1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-BvZPcapo.js","assets/defineChain-D1SuaLFt.js","assets/index-BbM11wFc.js"])))=>i.map(i=>d[i]); 2function h2(t,s){for(var n=0;n<s.length;n++){const o=s[n];if(typeof o!="string"&&!Array.isArray(o)){for(const i in o)if(i!=="default"&&!(i in t)){const c=Object.getOwnPropertyDescriptor(o,i);c&&Object.defineProperty(t,i,c.get?c:{enumerable:!0,get:()=>o[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const s=document.createElement("link").relList;if(s&&s.supports&&s.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))o(i);new MutationObserver(i=>{for(const c of i)if(c.type==="childList")for(const d of c.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&o(d)}).observe(document,{childList:!0,subtree:!0});function n(i){const c={};return i.integrity&&(c.integrity=i.integrity),i.referrerPolicy&&(c.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?c.credentials="include":i.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function o(i){if(i.ep)return;i.ep=!0;const c=n(i);fetch(i.href,c)}})();function U0(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var $m={exports:{}},Ei={},Vm={exports:{}},st={};var zg;function p2(){if(zg)return st;zg=1;var t=Symbol.for("react.element"),s=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),c=Symbol.for("react.provider"),d=Symbol.for("react.context"),m=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),x=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),y=Symbol.iterator;function b(R){return R===null||typeof R!="object"?null:(R=y&&R[y]||R["@@iterator"],typeof R=="function"?R:null)}var k={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,j={};function w(R,Q,Ne){this.props=R,this.context=Q,this.refs=j,this.updater=Ne||k}w.prototype.isReactComponent={},w.prototype.setState=function(R,Q){if(typeof R!="object"&&typeof R!="function"&&R!=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,R,Q,"setState")},w.prototype.forceUpdate=function(R){this.updater.enqueueForceUpdate(this,R,"forceUpdate")};function E(){}E.prototype=w.prototype;function C(R,Q,Ne){this.props=R,this.context=Q,this.refs=j,this.updater=Ne||k}var A=C.prototype=new E;A.constructor=C,S(A,w.prototype),A.isPureReactComponent=!0;var _=Array.isArray,D=Object.prototype.hasOwnProperty,O={current:null},F={key:!0,ref:!0,__self:!0,__source:!0};function P(R,Q,Ne){var Pe,ze={},Ve=null,fe=null;if(Q!=null)for(Pe in Q.ref!==void 0&&(fe=Q.ref),Q.key!==void 0&&(Ve=""+Q.key),Q)D.call(Q,Pe)&&!F.hasOwnProperty(Pe)&&(ze[Pe]=Q[Pe]);var De=arguments.length-2;if(De===1)ze.children=Ne;else if(1<De){for(var $e=Array(De),qe=0;qe<De;qe++)$e[qe]=arguments[qe+2];ze.children=$e}if(R&&R.defaultProps)for(Pe in De=R.defaultProps,De)ze[Pe]===void 0&&(ze[Pe]=De[Pe]);return{$$typeof:t,type:R,key:Ve,ref:fe,props:ze,_owner:O.current}}function Z(R,Q){return{$$typeof:t,type:R.type,key:Q,ref:R.ref,props:R.props,_owner:R._owner}}function z(R){return typeof R=="object"&&R!==null&&R.$$typeof===t}function te(R){var Q={"=":"=0",":":"=2"};return"$"+R.replace(/[=:]/g,function(Ne){return Q[Ne]})}var ee=/\/+/g;function se(R,Q){return typeof R=="object"&&R!==null&&R.key!=null?te(""+R.key):Q.toString(36)}function I(R,Q,Ne,Pe,ze){var Ve=typeof R;(Ve==="undefined"||Ve==="boolean")&&(R=null);var fe=!1;if(R===null)fe=!0;else switch(Ve){case"string":case"number":fe=!0;break;case"object":switch(R.$$typeof){case t:case s:fe=!0}}if(fe)return fe=R,ze=ze(fe),R=Pe===""?"."+se(fe,0):Pe,_(ze)?(Ne="",R!=null&&(Ne=R.replace(ee,"$&/")+"/"),I(ze,Q,Ne,"",function(qe){return qe})):ze!=null&&(z(ze)&&(ze=Z(ze,Ne+(!ze.key||fe&&fe.key===ze.key?"":(""+ze.key).replace(ee,"$&/")+"/")+R)),Q.push(ze)),1;if(fe=0,Pe=Pe===""?".":Pe+":",_(R))for(var De=0;De<R.length;De++){Ve=R[De];var $e=Pe+se(Ve,De);fe+=I(Ve,Q,Ne,$e,ze)}else if($e=b(R),typeof $e=="function")for(R=$e.call(R),De=0;!(Ve=R.next()).done;)Ve=Ve.value,$e=Pe+se(Ve,De++),fe+=I(Ve,Q,Ne,$e,ze);else if(Ve==="object")throw Q=String(R),Error("Objects are not valid as a React child (found: "+(Q==="[object Object]"?"object with keys {"+Object.keys(R).join(", ")+"}":Q)+"). If you meant to render a collection of children, use an array instead.");return fe}function le(R,Q,Ne){if(R==null)return R;var Pe=[],ze=0;return I(R,Pe,"","",function(Ve){return Q.call(Ne,Ve,ze++)}),Pe}function ne(R){if(R._status===-1){var Q=R._result;Q=Q(),Q.then(function(Ne){(R._status===0||R._status===-1)&&(R._status=1,R._result=Ne)},function(Ne){(R._status===0||R._status===-1)&&(R._status=2,R._result=Ne)}),R._status===-1&&(R._status=0,R._result=Q)}if(R._status===1)return R._result.default;throw R._result}var J={current:null},U={transition:null},q={ReactCurrentDispatcher:J,ReactCurrentBatchConfig:U,ReactCurrentOwner:O};function V(){throw Error("act(...) is not supported in production builds of React.")}return st.Children={map:le,forEach:function(R,Q,Ne){le(R,function(){Q.apply(this,arguments)},Ne)},count:function(R){var Q=0;return le(R,function(){Q++}),Q},toArray:function(R){return le(R,function(Q){return Q})||[]},only:function(R){if(!z(R))throw Error("React.Children.only expected to receive a single React element child.");return R}},st.Component=w,st.Fragment=n,st.Profiler=i,st.PureComponent=C,st.StrictMode=o,st.Suspense=f,st.__SECRET_INT
vendor: 3,544 bytes, line 2
2ERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=q,st.act=V,st.cloneElement=function(R,Q,Ne){if(R==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+R+".");var Pe=S({},R.props),ze=R.key,Ve=R.ref,fe=R._owner;if(Q!=null){if(Q.ref!==void 0&&(Ve=Q.ref,fe=O.current),Q.key!==void 0&&(ze=""+Q.key),R.type&&R.type.defaultProps)var De=R.type.defaultProps;for($e in Q)D.call(Q,$e)&&!F.hasOwnProperty($e)&&(Pe[$e]=Q[$e]===void 0&&De!==void 0?De[$e]:Q[$e])}var $e=arguments.length-2;if($e===1)Pe.children=Ne;else if(1<$e){De=Array($e);for(var qe=0;qe<$e;qe++)De[qe]=arguments[qe+2];Pe.children=De}return{$$typeof:t,type:R.type,key:ze,ref:Ve,props:Pe,_owner:fe}},st.createContext=function(R){return R={$$typeof:d,_currentValue:R,_currentValue2:R,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},R.Provider={$$typeof:c,_context:R},R.Consumer=R},st.createElement=P,st.createFactory=function(R){var Q=P.bind(null,R);return Q.type=R,Q},st.createRef=function(){return{current:null}},st.forwardRef=function(R){return{$$typeof:m,render:R}},st.isValidElement=z,st.lazy=function(R){return{$$typeof:v,_payload:{_status:-1,_result:R},_init:ne}},st.memo=function(R,Q){return{$$typeof:x,type:R,compare:Q===void 0?null:Q}},st.startTransition=function(R){var Q=U.transition;U.transition={};try{R()}finally{U.transition=Q}},st.unstable_act=V,st.useCallback=function(R,Q){return J.current.useCallback(R,Q)},st.useContext=function(R){return J.current.useContext(R)},st.useDebugValue=function(){},st.useDeferredValue=function(R){return J.current.useDeferredValue(R)},st.useEffect=function(R,Q){return J.current.useEffect(R,Q)},st.useId=function(){return J.current.useId()},st.useImperativeHandle=function(R,Q,Ne){return J.current.useImperativeHandle(R,Q,Ne)},st.useInsertionEffect=function(R,Q){return J.current.useInsertionEffect(R,Q)},st.useLayoutEffect=function(R,Q){return J.current.useLayoutEffect(R,Q)},st.useMemo=function(R,Q){return J.current.useMemo(R,Q)},st.useReducer=function(R,Q,Ne){return J.current.useReducer(R,Q,Ne)},st.useRef=function(R){return J.current.useRef(R)},st.useState=function(R){return J.current.useState(R)},st.useSyncExternalStore=function(R,Q,Ne){return J.current.useSyncExternalStore(R,Q,Ne)},st.useTransition=function(){return J.current.useTransition()},st.version="18.3.1",st}var Bg;function wd(){return Bg||(Bg=1,Vm.exports=p2()),Vm.exports}var Ug;function x2(){if(Ug)return Ei;Ug=1;var t=wd(),s=Symbol.for("react.element"),n=Symbol.for("react.fragment"),o=Object.prototype.hasOwnProperty,i=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,c={key:!0,ref:!0,__self:!0,__source:!0};function d(m,f,x){var v,y={},b=null,k=null;x!==void 0&&(b=""+x),f.key!==void 0&&(b=""+f.key),f.ref!==void 0&&(k=f.ref);for(v in f)o.call(f,v)&&!c.hasOwnProperty(v)&&(y[v]=f[v]);if(m&&m.defaultProps)for(v in f=m.defaultProps,f)y[v]===void 0&&(y[v]=f[v]);return{$$typeof:s,type:m,key:b,ref:k,props:y,_owner:i.current}}return Ei.Fragment=n,Ei.jsx=d,Ei.jsxs=d,Ei}var Hg;function g2(){return Hg||(Hg=1,$m.exports=x2()),$m.exports}var e=g2(),kc={},zm={exports:{}},Ds={},Bm={exports:{}},Um={};var Wg;function v2(){return Wg||(Wg=1,(function(t){function s(U,q){var V=U.length;U.push(q);e:for(;0<V;){var R=V-1>>>1,Q=U[R];if(0<i(Q,q))U[R]=q,U[V]=Q,V=R;else break e}}function n(U){return U.length===0?null:U[0]}function o(U){if(U.length===0)return null;var q=U[0],V=U.pop();if(V!==q){U[0]=V;e:for(var R=0,Q=U.length,Ne=Q>>>1;R<Ne;){var Pe=2*(R+1)-1,ze=U[Pe],Ve=Pe+1,fe=U[Ve];if(0>
vendor: 28,254 bytes, lines 2-6
2i(ze,V))Ve<Q&&0>i(fe,ze)?(U[R]=fe,U[Ve]=V,R=Ve):(U[R]=ze,U[Pe]=V,R=Pe);else if(Ve<Q&&0>i(fe,V))U[R]=fe,U[Ve]=V,R=Ve;else break e}}return q}function i(U,q){var V=U.sortIndex-q.sortIndex;return V!==0?V:U.id-q.id}if(typeof performance=="object"&&typeof performance.now=="function"){var c=performance;t.unstable_now=function(){return c.now()}}else{var d=Date,m=d.now();t.unstable_now=function(){return d.now()-m}}var f=[],x=[],v=1,y=null,b=3,k=!1,S=!1,j=!1,w=typeof setTimeout=="function"?setTimeout:null,E=typeof clearTimeout=="function"?clearTimeout:null,C=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function A(U){for(var q=n(x);q!==null;){if(q.callback===null)o(x);else if(q.startTime<=U)o(x),q.sortIndex=q.expirationTime,s(f,q);else break;q=n(x)}}function _(U){if(j=!1,A(U),!S)if(n(f)!==null)S=!0,ne(D);else{var q=n(x);q!==null&&J(_,q.startTime-U)}}function D(U,q){S=!1,j&&(j=!1,E(P),P=-1),k=!0;var V=b;try{for(A(q),y=n(f);y!==null&&(!(y.expirationTime>q)||U&&!te());){var R=y.callback;if(typeof R=="function"){y.callback=null,b=y.priorityLevel;var Q=R(y.expirationTime<=q);q=t.unstable_now(),typeof Q=="function"?y.callback=Q:y===n(f)&&o(f),A(q)}else o(f);y=n(f)}if(y!==null)var Ne=!0;else{var Pe=n(x);Pe!==null&&J(_,Pe.startTime-q),Ne=!1}return Ne}finally{y=null,b=V,k=!1}}var O=!1,F=null,P=-1,Z=5,z=-1;function te(){return!(t.unstable_now()-z<Z)}function ee(){if(F!==null){var U=t.unstable_now();z=U;var q=!0;try{q=F(!0,U)}finally{q?se():(O=!1,F=null)}}else O=!1}var se;if(typeof C=="function")se=function(){C(ee)};else if(typeof MessageChannel<"u"){var I=new MessageChannel,le=I.port2;I.port1.onmessage=ee,se=function(){le.postMessage(null)}}else se=function(){w(ee,0)};function ne(U){F=U,O||(O=!0,se())}function J(U,q){P=w(function(){U(t.unstable_now())},q)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(U){U.callback=null},t.unstable_continueExecution=function(){S||k||(S=!0,ne(D))},t.unstable_forceFrameRate=function(U){0>U||125<U?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Z=0<U?Math.floor(1e3/U):5},t.unstable_getCurrentPriorityLevel=function(){return b},t.unstable_getFirstCallbackNode=function(){return n(f)},t.unstable_next=function(U){switch(b){case 1:case 2:case 3:var q=3;break;default:q=b}var V=b;b=q;try{return U()}finally{b=V}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(U,q){switch(U){case 1:case 2:case 3:case 4:case 5:break;default:U=3}var V=b;b=U;try{return q()}finally{b=V}},t.unstable_scheduleCallback=function(U,q,V){var R=t.unstable_now();switch(typeof V=="object"&&V!==null?(V=V.delay,V=typeof V=="number"&&0<V?R+V:R):V=R,U){case 1:var Q=-1;break;case 2:Q=250;break;case 5:Q=1073741823;break;case 4:Q=1e4;break;default:Q=5e3}return Q=V+Q,U={id:v++,callback:q,priorityLevel:U,startTime:V,expirationTime:Q,sortIndex:-1},V>R?(U.sortIndex=V,s(x,U),n(f)===null&&U===n(x)&&(j?(E(P),P=-1):j=!0,J(_,V-R))):(U.sortIndex=Q,s(f,U),S||k||(S=!0,ne(D))),U},t.unstable_shouldYield=te,t.unstable_wrapCallback=function(U){var q=b;return function(){var V=b;b=q;try{return U.apply(this,arguments)}finally{b=V}}}})(Um)),Um}var Kg;function y2(){return Kg||(Kg=1,Bm.exports=v2()),Bm.exports}var qg;function b2(){if(qg)return Ds;qg=1;var t=wd(),s=y2();function n(r){for(var a="https://reactjs.org/docs/error-decoder.html?invariant="+r,l=1;l<arguments.length;l++)a+="&args[]="+encodeURIComponent(arguments[l]);return"Minified React error #"+r+"; visit "+a+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var o=new Set,i={};function c(r,a){d(r,a),d(r+"Capture",a)}function d(r,a){for(i[r]=a,r=0;r<a.length;r++)o.add(a[r])}var m=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),f=Object.prototype.hasOwnProperty,x=/^[: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]*$/,v={},y={};function b(r){return f.call(y,r)?!0:f.call(v,r)?!1:x.test(r)?y[r]=!0:(v[r]=!0,!1)}function k(r,a,l,u){if(l!==null&&l.type===0)return!1;switch(typeof a){case"function":case"symbol":return!0;case"boolean":return u?!1:l!==null?!l.acceptsBooleans:(r=r.toLowerCase().slice(0,5),r!=="data-"&&r!=="aria-");default:return!1}}function S(r,a,l,u){if(a===null||typeof a>"u"||k(r,a,l,u))return!0;if(u)return!1;if(l!==null)switch(l.type){case 3:return!a;case 4:return a===!1;case 5:return isNaN(a);case 6:return isNaN(a)||1>a}return!1}function j(r,a,l,u,h,g,N){this.acceptsBooleans=a===2||a===3||a===4,this.attributeName=u,this.attributeNamespace=h,this.mustUseProperty=l,this.propertyName=r,this.type=a,this.sanitizeURL=g,this.removeEmptyString=N}var w={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(r){w[r]=new j(r,0,!1,r,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(r){var a=r[0];w[a]=new j(a,1,!1,r[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(r){w[r]=new j(r,2,!1,r.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(r){w[r]=new j(r,2,!1,r,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(r){w[r]=new j(r,3,!1,r.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(r){w[r]=new j(r,3,!0,r,null,!1,!1)}),["capture","download"].forEach(function(r){w[r]=new j(r,4,!1,r,null,!1,!1)}),["cols","rows","size","span"].forEach(function(r){w[r]=new j(r,6,!1,r,null,!1,!1)}),["rowSpan","start"].forEach(function(r){w[r]=new j(r,5,!1,r.toLowerCase(),null,!1,!1)});var E=/[\-:]([a-z])/g;function C(r){return r[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(r){var a=r.replace(E,C);w[a]=new j(a,1,!1,r,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(r){var a=r.replace(E,C);w[a]=new j(a,1,!1,r,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(r){var a=r.replace(E,C);w[a]=new j(a,1,!1,r,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(r){w[r]=new j(r,1,!1,r.toLowerCase(),null,!1,!1)}),w.xlinkHref=new j("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(r){w[r]=new j(r,1,!1,r.toLowerCase(),null,!0,!0)});function A(r,a,l,u){var h=w.hasOwnProperty(a)?w[a]:null;(h!==null?h.type!==0:u||!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(S(a,l,h,u)&&(l=null),u||h===null?b(a)&&(l===null?r.removeAttribute(a):r.setAttribute(a,""+l)):h.mustUseProperty?r[h.propertyName]=l===null?h.type===3?!1:"":l:(a=h.attributeName,u=h.attributeNamespace,l===null?r.removeAttribute(a):(h=h.type,l=h===3||h===4&&l===!0?"":""+l,u?r.setAttributeNS(u,a,l):r.setAttribute(a,l))))}var _=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,D=Symbol.for("react.element"),O=Symbol.for("react.portal"),F=Symbol.for("react.fragment"),P=Symbol.for("react.strict_mode"),Z=Symbol.for("react.profiler"),z=Symbol.for("react.provider"),te=Symbol.for("react.context"),ee=Symbol.for("react.forward_ref"),se=Symbol.for("react.suspense"),I=Symbol.for("react.suspense_list"),le=Symbol.for("react.memo"),ne=Symbol.for("react.lazy"),J=Symbol.for("react.offscreen"),U=Symbol.iterator;function q(r){return r===null||typeof r!="object"?null:(r=U&&r[U]||r["@@iterator"],typeof r=="function"?r:null)}var V=Object.assign,R;function Q(r){if(R===void 0)try{throw Error()}catch(l){var a=l.stack.trim().match(/\n( *(at )?)/);R=a&&a[1]||""}return` 3`+R+r}var Ne=!1;function Pe(r,a){if(!r||Ne)return"";Ne=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(a)if(a=function(){throw Error()},Object.defineProperty(a.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(a,[])}catch(G){var u=G}Reflect.construct(r,[],a)}else{try{a.call()}catch(G){u=G}r.call(a.prototype)}else{try{throw Error()}catch(G){u=G}r()}}catch(G){if(G&&u&&typeof G.stack=="string"){for(var h=G.stack.split(` 4`),g=u.stack.split(` 5`),N=h.length-1,T=g.length-1;1<=N&&0<=T&&h[N]!==g[T];)T--;for(;1<=N&&0<=T;N--,T--)if(h[N]!==g[T]){if(N!==1||T!==1)do if(N--,T--,0>T||h[N]!==g[T]){var L=` 6`+h[N].replace(" at new "," at ");return r.displayName&&L.includes("<anonymous>")&&(L=L.replace("<anonymous>",r.displayName)),L}while(1<=N&&0<=T);break}}}finally{Ne=!1,Error.prepareStackTrace=l}return(r=r?r.displayName||r.name:"")?Q(r):""}function ze(r){switch(r.tag){case 5:return Q(r.type);case 16:return Q("Lazy");case 13:return Q("Suspense");case 19:return Q("SuspenseList");case 0:case 2:case 15:return r=Pe(r.type,!1),r;case 11:return r=Pe(r.type.render,!1),r;case 1:return r=Pe(r.type,!0),r;default:return""}}function Ve(r){if(r==null)return null;if(typeof r=="function")return r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case F:return"Fragment";case O:return"Portal";case Z:return"Profiler";case P:return"StrictMode";case se:return"Suspense";case I:return"SuspenseList"}if(typeof r=="object")switch(r.$$typeof){case te:return(r.displayName||"Context")+".Consumer";case z:return(r._context.displayName||"Context")+".Provider";case ee:var a=r.render;return r=r.displayName,r||(r=a.displayName||a.name||"",r=r!==""?"ForwardRef("+r+")":"ForwardRef"),r;case le:return a=r.displayName||null,a!==null?a:Ve(r.type)||"Memo";case ne:a=r._payload,r=r._init;try{return Ve(r(a))}catch{}}return null}function fe(r){var a=r.type;switch(r.tag){case 24:return"Cache";case 9:return(a.displayName||"Context")+".Consumer";case 10:return(a._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return r=a.render,r=r.displayName||r.name||"",a.displayName||(r!==""?"ForwardRef("+r+")":"ForwardRef");case 7:return"Fragment";case 5:return a;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Ve(a);case 8:return a===P?"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 a=="function")return a.displayName||a.name||null;if(typeof a=="string")return a}return null}function De(r){switch(typeof r){case"boolean":case"number":case"string":case"undefined":return r;case"object":return r;default:return""}}function $e(r){var a=r.type;return(r=r.nodeName)&&r.toLowerCase()==="input"&&(a==="checkbox"||a==="radio")}function qe(r){var a=$e(r)?"checked":"value",l=Object.getOwnPropertyDescriptor(r.constructor.prototype,a),u=""+r[a];if(!r.hasOwnProperty(a)&&typeof l<"u"&&typeof l.get=="function"&&typeof l.set=="function"){var h=l.get,g=l.set;return Object.defineProperty(r,a,{configurable:!0,get:function(){return h.call(this)},set:function(N){u=""+N,g.call(this,N)}}),Object.defineProperty(r,a,{enumerable:l.enumerable}),{getValue:function(){return u},setValue:function(N){u=""+N},stopTracking:function(){r._valueTracker=null,delete r[a]}}}}function pe(r){r._valueTracker||(r._valueTracker=qe(r))}function je(r){if(!r)return!1;var a=r._valueTracker;if(!a)return!0;var l=a.getValue(),u="";return r&&(u=$e(r)?r.checked?"true":"false":r.value),r=u,r!==l?(a.setValue(r),!0):!1}function we(r){if(r=r||(typeof document<"u"?document:void 0),typeof r>"u")return null;try{return r.activeElement||r.body}catch{return r.body}}function Ee(r,a){var l=a.checked;return V({},a,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:l??r._wrapperState.initialChecked})}function Ze(r,a){var l=a.defaultValue==null?"":a.defaultValue,u=a.checked!=null?a.checked:a.defaultChecked;l=De(a.value!=null?a.value:l),r._wrapperState={initialChecked:u,initialValue:l,controlled:a.type==="checkbox"||a.type==="radio"?a.checked!=null:a.value!=null}}function it(r,a){a=a.checked,a!=null&&A(r,"checked",a,!1)}function yt(r,a){it(r,a);var l=De(a.value),u=a.type;if(l!=null)u==="number"?(l===0&&r.value===""||r.value!=l)&&(r.value=""+l):r.value!==""+l&&(r.value=""+l);else if(u==="submit"||u==="reset"){r.removeAttribute("value");return}a.hasOwnProperty("value")?Jt(r,a.type,l):a.hasOwnProperty("defaultValue")&&Jt(r,a.type,De(a.defaultValue)),a.checked==null&&a.defaultChecked!=null&&(r.defaultChecked=!!a.defaultChecked)}function Ot(r,a,l){if(a.hasOwnProperty("value")||a.hasOwnProperty("defaultValue")){var u=a.type;if(!(u!=="submit"&&u!=="reset"||a.value!==void 0&&a.value!==null))return;a=""+r._wrapperState.initialValue,l||a===r.value||(r.value=a),r.defaultValue=a}l=r.name,l!==""&&(r.name=""),r.defaultChecked=!!r._wrapperState.initialChecked,l!==""&&(r.name=l)}function Jt(r,a,l){(a!=="number"||we(r.ownerDocument)!==r)&&(l==null?r.defaultValue=""+r._wrapperState.initialValue:r.defaultValue!==""+l&&(r.defaultValue=""+l))}var vt=Array.isArray;function Mt(r,a,l,u){if(r=r.options,a){a={};for(var h=0;h<l.length;h++)a["$"+l[h]]=!0;for(l=0;l<r.length;l++)h=a.hasOwnProperty("$"+r[l].value),r[l].selected!==h&&(r[l].selected=h),h&&u&&(r[l].defaultSelected=!0)}else{for(l=""+De(l),a=null,h=0;h<r.length;h++){if(r[h].value===l){r[h].selected=!0,u&&(r[h].defaultSelected=!0);return}a!==null||r[h].disabled||(a=r[h])}a!==null&&(a.selected=!0)}}function M(r,a){if(a.dangerouslySetInnerHTML!=null)throw Error(n(91));return V({},a,{value:void 0,defaultValue:void 0,children:""+r._wrapperState.initialValue})}function W(r,a){var l=a.value;if(l==null){if(l=a.children,a=a.defaultValue,l!=null){if(a!=null)throw Error(n(92));if(vt(l)){if(1<l.length)throw Error(n(93));l=l[0]}a=l}a==null&&(a=""),l=a}r._wrapperState={initialValue:De(l)}}function X(r,a){var l=De(a.value),u=De(a.defaultValue);l!=null&&(l=""+l,l!==r.value&&(r.value=l),a.defaultValue==null&&r.defaultValue!==l&&(r.defaultValue=l)),u!=null&&(r.defaultValue=""+u)}function ge(r){var a=r.textContent;a===r._wrapperState.initialValue&&a!==""&&a!==null&&(r.value=a)}function xe(r){switch(r){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 oe(r,a){return r==null||r==="http://www.w3.org/1999/xhtml"?xe(a):r==="http://www.w3.org/2000/svg"&&a==="foreignObject"?"http://www.w3.org/1999/xhtml":r}var Ce,Je=(function(r){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(a,l,u,h){MSApp.execUnsafeLocalFunction(function(){return r(a,l,u,h)})}:r})(function(r,a){if(r.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in r)r.innerHTML=a;else{for(Ce=Ce||document.createElement("div"),Ce.innerHTML="<svg>"+a.valueOf().toString()+"</svg>",a=Ce.firstChild;r.firstChild;)r.removeChild(r.firstChild);for(;a.firstChild;)r.appendChild(a.firstChild)}});function at(r,a){if(a){var l=r.firstChild;if(l&&l===r.lastChild&&l.nodeType===3){l.nodeValue=a;return}}r.textContent=a}var Nt={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},gs=["Webkit","ms","Moz","O"];Object.keys(Nt).forEach(function(r){gs.forEach(function(a){a=a+r.charAt(0).toUpperCase()+r.substring(1),Nt[a]=Nt[r]})});function As(r,a,l){return a==null||typeof a=="boolean"||a===""?"":l||typeof a!="number"||a===0||Nt.hasOwnProperty(r)&&Nt[r]?(""+a).trim():a+"px"}function mn(r,a){r=r.style;for(var l in a)if(a.hasOwnProperty(l)){var u=l.indexOf("--")===0,h=As(l,a[l],u);l==="float"&&(l="cssFloat"),u?r.setProperty(l,h):r[l]=h}}var ia=V({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 fn(r,a){if(a){if(ia[r]&&(a.children!=null||a.dangerouslySetInnerHTML!=null))throw Error(n(137,r));if(a.dangerouslySetInnerHTML!=null){if(a.children!=null)throw Error(n(60));if(typeof a.dangerouslySetInnerHTML!="object"||!("__html"in a.dangerouslySetInnerHTML))throw Error(n(61))}if(a.style!=null&&typeof a.style!="object")throw Error(n(62))}}function la(r,a){if(r.indexOf("-")===-1)return typeof a.is=="string";switch(r){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 hn=null;function Bo(r){return r=r.target||r.srcElement||window,r.correspondingUseElement&&(r=r.correspondingUseElement),r.nodeType===3?r.parentNode:r}var Uo=null,pn=null,xn=null;function hl(r){if(r=mi(r)){if(typeof Uo!="function")throw Error(n(280));var a=r.stateNode;a&&(a=$l(a),Uo(r.stateNode,r.type,a))}}function pl(r){pn?xn?xn.push(r):xn=[r]:pn=r}function xl(){if(pn){var r=pn,a=xn;if(xn=pn=null,hl(r),a)for(r=0;r<a.length;r++)hl(a[r])}}function H(r,a){return r(a)}function ke(){}var lt=!1;function ut(r,a,l){if(lt)return r(a,l);lt=!0;try{return H(r,a,l)}finally{lt=!1,(pn!==null||xn!==null)&&(ke(),xl())}}function Js(r,a){var l=r.stateNode;if(l===null)return null;var u=$l(l);if(u===null)return null;l=u[a];e:switch(a){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(u=!u.disabled)||(r=r.type,u=!(r==="button"||r==="input"||r==="select"||r==="textarea")),r=!u;break e;default:r=!1}if(r)return null;if(l&&typeof l!="function")throw Error(n(231,a,typeof l));return l}var Wr=!1;if(m)try{var ca={};Object.defineProperty(ca,"passive",{get:function(){Wr=!0}}),window.addEventListener("test",ca,ca),window.removeEventListener("test",ca,ca)}catch{Wr=!1}function eu(r,a,l,u,h,g,N,T,L){var G=Array.prototype.slice.call(arguments,3);try{a.apply(l,G)}catch(de){this.onError(de)}}var da=!1,Oa=null,Ho=!1,Wo=null,Ko={onError:function(r){da=!0,Oa=r}};function tu(r,a,l,u,h,g,N,T,L){da=!1,Oa=null,eu.apply(Ko,arguments)}function su(r,a,l,u,h,g,N,T,L){if(tu.apply(this,arguments),da){if(da){var G=Oa;da=!1,Oa=null}else throw Error(n(198));Ho||(Ho=!0,Wo=G)}}function Kr(r){var a=r,l=r;if(r.alternate)for(;a.return;)a=a.return;else{r=a;do a=r,(a.flags&4098)!==0&&(l=a.return),r=a.return;while(r)}return a.tag===3?l:null}function ru(r){if(r.tag===13){var a=r.memoizedState;if(a===null&&(r=r.alternate,r!==null&&(a=r.memoizedState)),a!==null)return a.dehydrated}return null}function nu(r){if(Kr(r)!==r)throw Error(n(188))}function gl(r){var a=r.alternate;if(!a){if(a=Kr(r),a===null)throw Error(n(188));return a!==r?null:r}for(var l=r,u=a;;){var h=l.return;if(h===null)break;var g=h.alternate;if(g===null){if(u=h.return,u!==null){l=u;continue}break}if(h.child===g.child){for(g=h.child;g;){if(g===l)return nu(h),r;if(g===u)return nu(h),a;g=g.sibling}throw Error(n(188))}if(l.return!==u.return)l=h,u=g;else{for(var N=!1,T=h.child;T;){if(T===l){N=!0,l=h,u=g;break}if(T===u){N=!0,u=h,l=g;break}T=T.sibling}if(!N){for(T=g.child;T;){if(T===l){N=!0,l=g,u=h;break}if(T===u){N=!0,u=g,l=h;break}T=T.sibling}if(!N)throw Error(n(189))}}if(l.alternate!==u)throw Error(n(190))}if(l.tag!==3)throw Error(n(188));return l.stateNode.current===l?r:a}function qo(r){return r=gl(r),r!==null?gn(r):null}function gn(r){if(r.tag===5||r.tag===6)return r;for(r=r.child;r!==null;){var a=gn(r);if(a!==null)return a;r=r.sibling}return null}var vl=s.unstable_scheduleCallback,pp=s.unstable_cancelCallback,CN=s.unstable_shouldYield,SN=s.unstable_requestPaint,Ft=s.unstable_now,EN=s.unstable_getCurrentPriorityLevel,au=s.unstable_ImmediatePriority,xp=s.unstable_UserBlockingPriority,yl=s.unstable_NormalPriority,_N=s.unstable_LowPriority,gp=s.unstable_IdlePriority,bl=null,Rr=null;function AN(r){if(Rr&&typeof Rr.onCommitFiberRoot=="function")try{Rr.onCommitFiberRoot(bl,r,void 0,(r.current.flags&128)===128)}catch{}}var pr=Math.clz32?Math.clz32:PN,TN=Math.log,RN=Math.LN2;function PN(r){return r>>>=0,r===0?32:31-(TN(r)/RN|0)|0}var jl=64,wl=4194304;function Zo(r){switch(r&-r){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 r&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return r&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return r}}function Nl(r,a){var l=r.pendingLanes;if(l===0)return 0;var u=0,h=r.suspendedLanes,g=r.pingedLanes,N=l&268435455;if(N!==0){var T=N&~h;T!==0?u=Zo(T):(g&=N,g!==0&&(u=Zo(g)))}else N=l&~h,N!==0?u=Zo(N):g!==0&&(u=Zo(g));if(u===0)return 0;if(a!==0&&a!==u&&(a&h)===0&&(h=u&-u,g=a&-a,h>=g||h===16&&(g&4194240)!==0))return a;if((u&4)!==0&&(u|=l&16),a=r.entangledLanes,a!==0)for(r=r.entanglements,a&=u;0<a;)l=31-pr(a),h=1<<l,u|=r[l],a&=~h;return u}function MN(r,a){switch(r){case 1:case 2:case 4:return a+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 a+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 IN(r,a){for(var l=r.suspendedLanes,u=r.pingedLanes,h=r.expirationTimes,g=r.pendingLanes;0<g;){var N=31-pr(g),T=1<<N,L=h[N];L===-1?((T&l)===0||(T&u)!==0)&&(h[N]=MN(T,a)):L<=a&&(r.expiredLanes|=T),g&=~T}}function ou(r){return r=r.pendingLanes&-1073741825,r!==0?r:r&1073741824?1073741824:0}function vp(){var r=jl;return jl<<=1,(jl&4194240)===0&&(jl=64),r}function iu(r){for(var a=[],l=0;31>l;l++)a.push(r);return a}function Go(r,a,l){r.pendingLanes|=a,a!==536870912&&(r.suspendedLanes=0,r.pingedLanes=0),r=r.eventTimes,a=31-pr(a),r[a]=l}function DN(r,a){var l=r.pendingLanes&~a;r.pendingLanes=a,r.suspendedLanes=0,r.pingedLanes=0,r.expiredLanes&=a,r.mutableReadLanes&=a,r.entangledLanes&=a,a=r.entanglements;var u=r.eventTimes;for(r=r.expirationTimes;0<l;){var h=31-pr(l),g=1<<h;a[h]=0,u[h]=-1,r[h]=-1,l&=~g}}function lu(r,a){var l=r.entangledLanes|=a;for(r=r.entanglements;l;){var u=31-pr(l),h=1<<u;h&a|r[u]&a&&(r[u]|=a),l&=~h}}var jt=0;function yp(r){return r&=-r,1<r?4<r?(r&268435455)!==0?16:536870912:4:1}var bp,cu,jp,wp,Np,du=!1,kl=[],vn=null,yn=null,bn=null,Qo=new Map,Yo=new Map,jn=[],ON="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 kp(r,a){switch(r){case"focusin":case"focusout":vn=null;break;case"dragenter":case"dragleave":yn=null;break;case"mouseover":case"mouseout":bn=null;break;case"pointerover":case"pointerout":Qo.delete(a.pointerId);break;case"gotpointercapture":case"lostpointercapture":Yo.delete(a.pointerId)}}function Jo(r,a,l,u,h,g){return r===null||r.nativeEvent!==g?(r={blockedOn:a,domEventName:l,eventSystemFlags:u,nativeEvent:g,targetContainers:[h]},a!==null&&(a=mi(a),a!==null&&cu(a)),r):(r.eventSystemFlags|=u,a=r.targetContainers,h!==null&&a.indexOf(h)===-1&&a.push(h),r)}function LN(r,a,l,u,h){switch(a){case"focusin":return vn=Jo(vn,r,a,l,u,h),!0;case"dragenter":return yn=Jo(yn,r,a,l,u,h),!0;case"mouseover":return bn=Jo(bn,r,a,l,u,h),!0;case"pointerover":var g=h.pointerId;return Qo.set(g,Jo(Qo.get(g)||null,r,a,l,u,h)),!0;case"gotpointercapture":return g=h.pointerId,Yo.set(g,Jo(Yo.get(g)||null,r,a,l,u,h)),!0}return!1}function Cp(r){var a=ua(r.target);if(a!==null){var l=Kr(a);if(l!==null){if(a=l.tag,a===13){if(a=ru(l),a!==null){r.blockedOn=a,Np(r.priority,function(){jp(l)});return}}else if(a===3&&l.stateNode.current.memoizedState.isDehydrated){r.blockedOn=l.tag===3?l.stateNode.containerInfo:null;return}}}r.blockedOn=null}function Cl(r){if(r.blockedOn!==null)return!1;for(var a=r.targetContainers;0<a.length;){var l=mu(r.domEventName,r.eventSystemFlags,a[0],r.nativeEvent);if(l===null){l=r.nativeEvent;var u=new l.constructor(l.type,l);hn=u,l.target.dispatchEvent(u),hn=null}else return a=mi(l),a!==null&&cu(a),r.blockedOn=l,!1;a.shift()}return!0}function Sp(r,a,l){Cl(r)&&l.delete(a)}function FN(){du=!1,vn!==null&&Cl(vn)&&(vn=null),yn!==null&&Cl(yn)&&(yn=null),bn!==null&&Cl(bn)&&(bn=null),Qo.forEach(Sp),Yo.forEach(Sp)}function Xo(r,a){r.blockedOn===a&&(r.blockedOn=null,du||(du=!0,s.unstable_scheduleCallback(s.unstable_NormalPriority,FN)))}function ei(r){function a(h){return Xo(h,r)}if(0<kl.length){Xo(kl[0],r);for(var l=1;l<kl.length;l++){var u=kl[l];u.blockedOn===r&&(u.blockedOn=null)}}for(vn!==null&&Xo(vn,r),yn!==null&&Xo(yn,r),bn!==null&&Xo(bn,r),Qo.forEach(a),Yo.forEach(a),l=0;l<jn.length;l++)u=jn[l],u.blockedOn===r&&(u.blockedOn=null);for(;0<jn.length&&(l=jn[0],l.blockedOn===null);)Cp(l),l.blockedOn===null&&jn.shift()}var La=_.ReactCurrentBatchConfig,Sl=!0;function $N(r,a,l,u){var h=jt,g=La.transition;La.transition=null;try{jt=1,uu(r,a,l,u)}finally{jt=h,La.transition=g}}function VN(r,a,l,u){var h=jt,g=La.transition;La.transition=null;try{jt=4,uu(r,a,l,u)}finally{jt=h,La.transition=g}}function uu(r,a,l,u){if(Sl){var h=mu(r,a,l,u);if(h===null)Au(r,a,u,El,l),kp(r,u);else if(LN(h,r,a,l,u))u.stopPropagation();else if(kp(r,u),a&4&&-1<ON.indexOf(r)){for(;h!==null;){var g=mi(h);if(g!==null&&bp(g),g=mu(r,a,l,u),g===null&&Au(r,a,u,El,l),g===h)break;h=g}h!==null&&u.stopPropagation()}else Au(r,a,u,null,l)}}var El=null;function mu(r,a,l,u){if(El=null,r=Bo(u),r=ua(r),r!==null)if(a=Kr(r),a===null)r=null;else if(l=a.tag,l===13){if(r=ru(a),r!==null)return r;r=null}else if(l===3){if(a.stateNode.current.memoizedState.isDehydrated)return a.tag===3?a.stateNode.containerInfo:null;r=null}else a!==r&&(r=null);return El=r,null}
vendor: 1,543 bytes, line 6
6function Ep(r){switch(r){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(EN()){case au:return 1;case xp:return 4;case yl:case _N:return 16;case gp:return 536870912;default:return 16}default:return 16}}var wn=null,fu=null,_l=null;function _p(){if(_l)return _l;var r,a=fu,l=a.length,u,h="value"in wn?wn.value:wn.textContent,g=h.length;for(r=0;r<l&&a[r]===h[r];r++);var N=l-r;for(u=1;u<=N&&a[l-u]===h[g-u];u++);return _l=h.slice(r,1<u?1-u:void 0)}function Al(r){var a=r.keyCode;
vendor: 11,135 bytes, line 6
6return"charCode"in r?(r=r.charCode,r===0&&a===13&&(r=13)):r=a,r===10&&(r=13),32<=r||r===13?r:0}function Tl(){return!0}function Ap(){return!1}function Fs(r){function a(l,u,h,g,N){this._reactName=l,this._targetInst=h,this.type=u,this.nativeEvent=g,this.target=N,this.currentTarget=null;for(var T in r)r.hasOwnProperty(T)&&(l=r[T],this[T]=l?l(g):g[T]);return this.isDefaultPrevented=(g.defaultPrevented!=null?g.defaultPrevented:g.returnValue===!1)?Tl:Ap,this.isPropagationStopped=Ap,this}return V(a.prototype,{preventDefault:function(){this.defaultPrevented=!0;var l=this.nativeEvent;l&&(l.preventDefault?l.preventDefault():typeof l.returnValue!="unknown"&&(l.returnValue=!1),this.isDefaultPrevented=Tl)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=Tl)},persist:function(){},isPersistent:Tl}),a}var Fa={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(r){return r.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},hu=Fs(Fa),ti=V({},Fa,{view:0,detail:0}),zN=Fs(ti),pu,xu,si,Rl=V({},ti,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:vu,button:0,buttons:0,relatedTarget:function(r){return r.relatedTarget===void 0?r.fromElement===r.srcElement?r.toElement:r.fromElement:r.relatedTarget},movementX:function(r){return"movementX"in r?r.movementX:(r!==si&&(si&&r.type==="mousemove"?(pu=r.screenX-si.screenX,xu=r.screenY-si.screenY):xu=pu=0,si=r),pu)},movementY:function(r){return"movementY"in r?r.movementY:xu}}),Tp=Fs(Rl),BN=V({},Rl,{dataTransfer:0}),UN=Fs(BN),HN=V({},ti,{relatedTarget:0}),gu=Fs(HN),WN=V({},Fa,{animationName:0,elapsedTime:0,pseudoElement:0}),KN=Fs(WN),qN=V({},Fa,{clipboardData:function(r){return"clipboardData"in r?r.clipboardData:window.clipboardData}}),ZN=Fs(qN),GN=V({},Fa,{data:0}),Rp=Fs(GN),QN={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},YN={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"},JN={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function XN(r){var a=this.nativeEvent;return a.getModifierState?a.getModifierState(r):(r=JN[r])?!!a[r]:!1}function vu(){return XN}var ek=V({},ti,{key:function(r){if(r.key){var a=QN[r.key]||r.key;if(a!=="Unidentified")return a}return r.type==="keypress"?(r=Al(r),r===13?"Enter":String.fromCharCode(r)):r.type==="keydown"||r.type==="keyup"?YN[r.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:vu,charCode:function(r){return r.type==="keypress"?Al(r):0},keyCode:function(r){return r.type==="keydown"||r.type==="keyup"?r.keyCode:0},which:function(r){return r.type==="keypress"?Al(r):r.type==="keydown"||r.type==="keyup"?r.keyCode:0}}),tk=Fs(ek),sk=V({},Rl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Pp=Fs(sk),rk=V({},ti,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:vu}),nk=Fs(rk),ak=V({},Fa,{propertyName:0,elapsedTime:0,pseudoElement:0}),ok=Fs(ak),ik=V({},Rl,{deltaX:function(r){return"deltaX"in r?r.deltaX:"wheelDeltaX"in r?-r.wheelDeltaX:0},deltaY:function(r){return"deltaY"in r?r.deltaY:"wheelDeltaY"in r?-r.wheelDeltaY:"wheelDelta"in r?-r.wheelDelta:0},deltaZ:0,deltaMode:0}),lk=Fs(ik),ck=[9,13,27,32],yu=m&&"CompositionEvent"in window,ri=null;m&&"documentMode"in document&&(ri=document.documentMode);var dk=m&&"TextEvent"in window&&!ri,Mp=m&&(!yu||ri&&8<ri&&11>=ri),Ip=" ",Dp=!1;function Op(r,a){switch(r){case"keyup":return ck.indexOf(a.keyCode)!==-1;case"keydown":return a.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Lp(r){return r=r.detail,typeof r=="object"&&"data"in r?r.data:null}var $a=!1;function uk(r,a){switch(r){case"compositionend":return Lp(a);case"keypress":return a.which!==32?null:(Dp=!0,Ip);case"textInput":return r=a.data,r===Ip&&Dp?null:r;default:return null}}function mk(r,a){if($a)return r==="compositionend"||!yu&&Op(r,a)?(r=_p(),_l=fu=wn=null,$a=!1,r):null;switch(r){case"paste":return null;case"keypress":if(!(a.ctrlKey||a.altKey||a.metaKey)||a.ctrlKey&&a.altKey){if(a.char&&1<a.char.length)return a.char;if(a.which)return String.fromCharCode(a.which)}return null;case"compositionend":return Mp&&a.locale!=="ko"?null:a.data;default:return null}}var fk={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 Fp(r){var a=r&&r.nodeName&&r.nodeName.toLowerCase();return a==="input"?!!fk[r.type]:a==="textarea"}function $p(r,a,l,u){pl(u),a=Ol(a,"onChange"),0<a.length&&(l=new hu("onChange","change",null,l,u),r.push({event:l,listeners:a}))}var ni=null,ai=null;function hk(r){rx(r,0)}function Pl(r){var a=Ha(r);if(je(a))return r}function pk(r,a){if(r==="change")return a}var Vp=!1;if(m){var bu;if(m){var ju="oninput"in document;if(!ju){var zp=document.createElement("div");zp.setAttribute("oninput","return;"),ju=typeof zp.oninput=="function"}bu=ju}else bu=!1;Vp=bu&&(!document.documentMode||9<document.documentMode)}function Bp(){ni&&(ni.detachEvent("onpropertychange",Up),ai=ni=null)}function Up(r){if(r.propertyName==="value"&&Pl(ai)){var a=[];$p(a,ai,r,Bo(r)),ut(hk,a)}}function xk(r,a,l){r==="focusin"?(Bp(),ni=a,ai=l,ni.attachEvent("onpropertychange",Up)):r==="focusout"&&Bp()}function gk(r){if(r==="selectionchange"||r==="keyup"||r==="keydown")return Pl(ai)}function vk(r,a){if(r==="click")return Pl(a)}function yk(r,a){if(r==="input"||r==="change")return Pl(a)}function bk(r,a){return r===a&&(r!==0||1/r===1/a)||r!==r&&a!==a}var xr=typeof Object.is=="function"?Object.is:bk;function oi(r,a){if(xr(r,a))return!0;if(typeof r!="object"||r===null||typeof a!="object"||a===null)return!1;var l=Object.keys(r),u=Object.keys(a);if(l.length!==u.length)return!1;for(u=0;u<l.length;u++){var h=l[u];if(!f.call(a,h)||!xr(r[h],a[h]))return!1}return!0}function Hp(r){for(;r&&r.firstChild;)r=r.firstChild;return r}function Wp(r,a){var l=Hp(r);r=0;for(var u;l;){if(l.nodeType===3){if(u=r+l.textContent.length,r<=a&&u>=a)return{node:l,offset:a-r};r=u}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=Hp(l)}}function Kp(r,a){return r&&a?r===a?!0:r&&r.nodeType===3?!1:a&&a.nodeType===3?Kp(r,a.parentNode):"contains"in r?r.contains(a):r.compareDocumentPosition?!!(r.compareDocumentPosition(a)&16):!1:!1}function qp(){for(var r=window,a=we();a instanceof r.HTMLIFrameElement;){try{var l=typeof a.contentWindow.location.href=="string"}catch{l=!1}if(l)r=a.contentWindow;else break;a=we(r.document)}return a}function wu(r){var a=r&&r.nodeName&&r.nodeName.toLowerCase();return a&&(a==="input"&&(r.type==="text"||r.type==="search"||r.type==="tel"||r.type==="url"||r.type==="password")||a==="textarea"||r.contentEditable==="true")}function jk(r){var a=qp(),l=r.focusedElem,u=r.selectionRange;if(a!==l&&l&&l.ownerDocument&&Kp(l.ownerDocument.documentElement,l)){if(u!==null&&wu(l)){if(a=u.start,r=u.end,r===void 0&&(r=a),"selectionStart"in l)l.selectionStart=a,l.selectionEnd=Math.min(r,l.value.length);else if(r=(a=l.ownerDocument||document)&&a.defaultView||window,r.getSelection){r=r.getSelection();var h=l.textContent.length,g=Math.min(u.start,h);u=u.end===void 0?g:Math.min(u.end,h),!r.extend&&g>u&&(h=u,u=g,g=h),h=Wp(l,g);var N=Wp(l,u);h&&N&&(r.rangeCount!==1||r.anchorNode!==h.node||r.anchorOffset!==h.offset||r.focusNode!==N.node||r.focusOffset!==N.offset)&&(a=a.createRange(),a.setStart(h.node,h.offset),r.removeAllRanges(),g>u?(r.addRange(a),r.extend(N.node,N.offset)):(a.setEnd(N.node,N.offset),r.addRange(a)))}}for(a=[],r=l;r=r.parentNode;)r.nodeType===1&&a.push({element:r,left:r.scrollLeft,top:r.scrollTop});for(typeof l.focus=="function"&&l.focus(),l=0;l<a.length;l++)r=a[l],r.element.scrollLeft=r.left,r.element.scrollTop=r.top}}var wk=m&&"documentMode"in document&&11>=document.documentMode,Va=null,Nu=null,ii=null,ku=!1;function Zp(r,a,l){var u=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;ku||Va==null||Va!==we(u)||(u=Va,"selectionStart"in u&&wu(u)?u={start:u.selectionStart,end:u.selectionEnd}:(u=(u.ownerDocument&&u.ownerDocument.defaultView||window).getSelection(),u={anchorNode:u.anchorNode,anchorOffset:u.anchorOffset,focusNode:u.focusNode,focusOffset:u.focusOffset}),ii&&oi(ii,u)||(ii=u,u=Ol(Nu,"onSelect"),0<u.length&&(a=new hu("onSelect","select",null,a,l),r.push({event:a,listeners:u}),a.target=Va)))}function Ml(r,a){var l={};return l[r.toLowerCase()]=a.toLowerCase(),l["Webkit"+r]="webkit"+a,l["Moz"+r]="moz"+a,l}var za={animationend:Ml("Animation","AnimationEnd"),animationiteration:Ml("Animation","AnimationIteration"),animationstart:Ml("Animation","AnimationStart"),transitionend:Ml("Transition","TransitionEnd")},Cu={},Gp={};m&&(Gp=document.createElement("div").style,"AnimationEvent"in window||(delete za.animationend.animation,delete za.animationiteration.animation,delete za.animationstart.animation),"TransitionEvent"in window||delete za.transitionend.transition);function Il(r){if(Cu[r])return Cu[r];if(!za[r])return r;var a=za[r],l;for(l in a)if(a.hasOwnProperty(l)&&l in Gp)return Cu[r]=a[l];return r}var Qp=Il("animationend"),Yp=Il("animationiteration"),Jp=Il("animationstart"),Xp=Il("transitionend"),ex=new Map,tx="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 Nn(r,a){ex.set(r,a),c(a,[r])}for(var Su=0;Su<tx.length;Su++){var Eu=tx[Su],Nk=Eu.toLowerCase(),kk=Eu[0].toUpperCase()+Eu.slice(1);Nn(Nk,"on"+kk)}Nn(Qp,"onAnimationEnd"),Nn(Yp,"onAnimationIteration"),Nn(Jp,"onAnimationStart"),Nn("dblclick","onDoubleClick"),Nn("focusin","onFocus"),Nn("focusout","onBlur"),Nn(Xp,"onTransitionEnd"),d("onMouseEnter",["mouseout","mouseover"]),d("onMouseLeave",["mouseout","mouseover"]),d("onPointerEnter",["pointerout","pointerover"]),d("onPointerLeave",["pointerout","pointerover"]),c("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),c("onSelect","focusout contextmenu dragend focu
6sin keydown keyup mousedown mouseup selectionchange".split(" ")),c("onBeforeInput",["compositionend","keypress","textInput","paste"]),c("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),c("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),c("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var li="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(" "),Ck=new Set("cancel close invalid load scroll toggle".split(" ").concat(li));function sx(r,a,l){var u=r.type||"unknown-event";r.currentTarget=l,su(u,a,void 0,r),r.currentTarget=null}function rx(r,a){a=(a&4)!==0;for(var l=0;l<r.length;l++){var u=r[l],h=u.event;u=u.listeners;e:{var g=void 0;if(a)for(var N=u.length-1;0<=N;N--){var T=u[N],L=T.instance,G=T.currentTarget;if(T=T.listener,L!==g&&h.isPropagationStopped())break e;sx(h,T,G),g=L}else for(N=0;N<u.length;N++){if(T=u[N],L=T.instance,G=T.currentTarget,T=T.listener,L!==g&&h.isPropagationStopped())break e;sx(h,T,G),g=L}}}if(Ho)throw r=Wo,Ho=!1,Wo=null,r}function _t(r,a){var l=a[Du];l===void 0&&(l=a[Du]=new Set);var u=r+"__bubble";l.has(u)||(nx(a,r,2,!1),l.add(u))}function _u(r,a,l){var u=0;a&&(u|=4),nx(l,r,u,a)}var Dl="_reactListening"+Math.random().toString(36).slice(2);function ci(r){if(!r[Dl]){r[Dl]=!0,o.forEach(function(l){l!=="selectionchange"&&(Ck.has(l)||_u(l,!1,r),_u(l,!0,r))});var a=r.nodeType===9?r:r.ownerDocument;a===null||a[Dl]||(a[Dl]=!0,_u("selectionchange",!1,a))}}function nx(r,a,l,u){switch(Ep(a)){case 1:var h=$N;break;case 4:h=VN;break;default:h=uu}l=h.bind(null,a,l,r),h=void 0,!Wr||a!=="touchstart"&&a!=="touchmove"&&a!=="wheel"||(h=!0),u?h!==void 0?r.addEventListener(a,l,{capture:!0,passive:h}):r.addEventListener(a,l,!0):h!==void 0?r.addEventListener(a,l,{passive:h}):r.addEventListener(a,l,!1)}function Au(r,a,l,u,h){var g=u;if((a&1)===0&&(a&2)===0&&u!==null)e:for(;;){if(u===null)return;var N=u.tag;if(N===3||N===4){var T=u.stateNode.containerInfo;if(T===h||T.nodeType===8&&T.parentNode===h)break;if(N===4)for(N=u.return;N!==null;){var L=N.tag;if((L===3||L===4)&&(L=N.stateNode.containerInfo,L===h||L.nodeType===8&&L.parentNode===h))return;N=N.return}for(;T!==null;){if(N=ua(T),N===null)return;if(L=N.tag,L===5||L===6){u=g=N;continue e}T=T.parentNode}}u=u.return}ut(function(){var G=g,de=Bo(l),he=[];e:{var ce=ex.get(r);if(ce!==void 0){var _e=hu,Re=r;switch(r){case"keypress":if(Al(l)===0)break e;case"keydown":case"keyup":_e=tk;break;case"focusin":Re="focus",_e=gu;break;case"focusout":Re="blur",_e=gu;break;case"beforeblur":case"afterblur":_e=gu;break;case"click":if(l.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":_e=Tp;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":_e=UN;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":_e=nk;break;case Qp:case Yp:case Jp:_e=KN;break;case Xp:_e=ok;break;case"scroll":_e=zN;break;case"wheel":_e=lk;break;case"copy":case"cut":case"paste":_e=ZN;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":_e=Pp}var Me=(a&4)!==0,$t=!Me&&r==="scroll",B=Me?ce!==null?ce+"Capture":null:ce;Me=[];for(var $=G,K;$!==null;){K=$;var ve=K.stateNode;if(K.tag===5&&ve!==null&&(K=ve,B!==null&&(ve=Js($,B),ve!=null&&Me.push(di($,ve,K)))),$t)break;$=$.return}0<Me.length&&(ce=new _e(ce,Re,null,l,de),he.push({event:ce,listeners:Me}))}}if((a&7)===0){e:{if(ce=r==="mouseover"||r==="pointerover",_e=r==="mouseout"||r==="pointerout",ce&&l!==hn&&(Re=l.relatedTarget||l.fromElement)&&(ua(Re)||Re[qr]))break e;if((_e||ce)&&(ce=de.window===de?de:(ce=de.ownerDocument)?ce.defaultView||ce.parentWindow:window,_e?(Re=l.relatedTarget||l.toElement,_e=G,Re=Re?ua(Re):null,Re!==null&&($t=Kr(
vendor: 6,116 bytes, lines 6-7
6Re),Re!==$t||Re.tag!==5&&Re.tag!==6)&&(Re=null)):(_e=null,Re=G),_e!==Re)){if(Me=Tp,ve="onMouseLeave",B="onMouseEnter",$="mouse",(r==="pointerout"||r==="pointerover")&&(Me=Pp,ve="onPointerLeave",B="onPointerEnter",$="pointer"),$t=_e==null?ce:Ha(_e),K=Re==null?ce:Ha(Re),ce=new Me(ve,$+"leave",_e,l,de),ce.target=$t,ce.relatedTarget=K,ve=null,ua(de)===G&&(Me=new Me(B,$+"enter",Re,l,de),Me.target=K,Me.relatedTarget=$t,ve=Me),$t=ve,_e&&Re)t:{for(Me=_e,B=Re,$=0,K=Me;K;K=Ba(K))$++;for(K=0,ve=B;ve;ve=Ba(ve))K++;for(;0<$-K;)Me=Ba(Me),$--;for(;0<K-$;)B=Ba(B),K--;for(;$--;){if(Me===B||B!==null&&Me===B.alternate)break t;Me=Ba(Me),B=Ba(B)}Me=null}else Me=null;_e!==null&&ax(he,ce,_e,Me,!1),Re!==null&&$t!==null&&ax(he,$t,Re,Me,!0)}}e:{if(ce=G?Ha(G):window,_e=ce.nodeName&&ce.nodeName.toLowerCase(),_e==="select"||_e==="input"&&ce.type==="file")var Oe=pk;else if(Fp(ce))if(Vp)Oe=yk;else{Oe=gk;var Be=xk}else(_e=ce.nodeName)&&_e.toLowerCase()==="input"&&(ce.type==="checkbox"||ce.type==="radio")&&(Oe=vk);if(Oe&&(Oe=Oe(r,G))){$p(he,Oe,l,de);break e}Be&&Be(r,ce,G),r==="focusout"&&(Be=ce._wrapperState)&&Be.controlled&&ce.type==="number"&&Jt(ce,"number",ce.value)}switch(Be=G?Ha(G):window,r){case"focusin":(Fp(Be)||Be.contentEditable==="true")&&(Va=Be,Nu=G,ii=null);break;case"focusout":ii=Nu=Va=null;break;case"mousedown":ku=!0;break;case"contextmenu":case"mouseup":case"dragend":ku=!1,Zp(he,l,de);break;case"selectionchange":if(wk)break;case"keydown":case"keyup":Zp(he,l,de)}var Ue;if(yu)e:{switch(r){case"compositionstart":var Ke="onCompositionStart";break e;case"compositionend":Ke="onCompositionEnd";break e;case"compositionupdate":Ke="onCompositionUpdate";break e}Ke=void 0}else $a?Op(r,l)&&(Ke="onCompositionEnd"):r==="keydown"&&l.keyCode===229&&(Ke="onCompositionStart");Ke&&(Mp&&l.locale!=="ko"&&($a||Ke!=="onCompositionStart"?Ke==="onCompositionEnd"&&$a&&(Ue=_p()):(wn=de,fu="value"in wn?wn.value:wn.textContent,$a=!0)),Be=Ol(G,Ke),0<Be.length&&(Ke=new Rp(Ke,r,null,l,de),he.push({event:Ke,listeners:Be}),Ue?Ke.data=Ue:(Ue=Lp(l),Ue!==null&&(Ke.data=Ue)))),(Ue=dk?uk(r,l):mk(r,l))&&(G=Ol(G,"onBeforeInput"),0<G.length&&(de=new Rp("onBeforeInput","beforeinput",null,l,de),he.push({event:de,listeners:G}),de.data=Ue))}rx(he,a)})}function di(r,a,l){return{instance:r,listener:a,currentTarget:l}}function Ol(r,a){for(var l=a+"Capture",u=[];r!==null;){var h=r,g=h.stateNode;h.tag===5&&g!==null&&(h=g,g=Js(r,l),g!=null&&u.unshift(di(r,g,h)),g=Js(r,a),g!=null&&u.push(di(r,g,h))),r=r.return}return u}function Ba(r){if(r===null)return null;do r=r.return;while(r&&r.tag!==5);return r||null}function ax(r,a,l,u,h){for(var g=a._reactName,N=[];l!==null&&l!==u;){var T=l,L=T.alternate,G=T.stateNode;if(L!==null&&L===u)break;T.tag===5&&G!==null&&(T=G,h?(L=Js(l,g),L!=null&&N.unshift(di(l,L,T))):h||(L=Js(l,g),L!=null&&N.push(di(l,L,T)))),l=l.return}N.length!==0&&r.push({event:a,listeners:N})}var Sk=/\r\n?/g,Ek=/\u0000|\uFFFD/g;function ox(r){return(typeof r=="string"?r:""+r).replace(Sk,` 7`).replace(Ek,"")}function Ll(r,a,l){if(a=ox(a),ox(r)!==a&&l)throw Error(n(425))}function Fl(){}var Tu=null,Ru=null;function Pu(r,a){return r==="textarea"||r==="noscript"||typeof a.children=="string"||typeof a.children=="number"||typeof a.dangerouslySetInnerHTML=="object"&&a.dangerouslySetInnerHTML!==null&&a.dangerouslySetInnerHTML.__html!=null}var Mu=typeof setTimeout=="function"?setTimeout:void 0,_k=typeof clearTimeout=="function"?clearTimeout:void 0,ix=typeof Promise=="function"?Promise:void 0,Ak=typeof queueMicrotask=="function"?queueMicrotask:typeof ix<"u"?function(r){return ix.resolve(null).then(r).catch(Tk)}:Mu;function Tk(r){setTimeout(function(){throw r})}function Iu(r,a){var l=a,u=0;do{var h=l.nextSibling;if(r.removeChild(l),h&&h.nodeType===8)if(l=h.data,l==="/$"){if(u===0){r.removeChild(h),ei(a);return}u--}else l!=="$"&&l!=="$?"&&l!=="$!"||u++;l=h}while(l);ei(a)}function kn(r){for(;r!=null;r=r.nextSibling){var a=r.nodeType;if(a===1||a===3)break;if(a===8){if(a=r.data,a==="$"||a==="$!"||a==="$?")break;if(a==="/$")return null}}return r}function lx(r){r=r.previousSibling;for(var a=0;r;){if(r.nodeType===8){var l=r.data;if(l==="$"||l==="$!"||l==="$?"){if(a===0)return r;a--}else l==="/$"&&a++}r=r.previousSibling}return null}var Ua=Math.random().toString(36).slice(2),Pr="__reactFiber$"+Ua,ui="__reactProps$"+Ua,qr="__reactContainer$"+Ua,Du="__reactEvents$"+Ua,Rk="__reactListeners$"+Ua,Pk="__reactHandles$"+Ua;function ua(r){var a=r[Pr];if(a)return a;for(var l=r.parentNode;l;){if(a=l[qr]||l[Pr]){if(l=a.alternate,a.child!==null||l!==null&&l.child!==null)for(r=lx(r);r!==null;){if(l=r[Pr])return l;r=lx(r)}return a}r=l,l=r.parentNode}return null}function mi(r){return r=r[Pr]||r[qr],!r||r.tag!==5&&r.tag!==6&&r.tag!==13&&r.tag!==3?null:r}function Ha(r){if(r.tag===5||r.tag===6)return r.stateNode;throw Error(n(33))}function $l(r){return r[ui]||null}var Ou=[],Wa=-1;function Cn(r){return{current:r}}function At(r){0>Wa||(r.current=Ou[Wa],Ou[Wa]=null,Wa--)}function Et(r,a){Wa++,Ou[Wa]=r.current,r.current=a}var Sn={},cs=Cn(Sn),Ts=Cn(!1),ma=Sn;function Ka(r,a){var l=r.type.contextTypes;if(!l)return Sn;var u=r.stateNode;if(u&&u.__reactInternalMemoizedUnmaskedChildContext===a)return u.__reactInternalMemoizedMaskedChildContext;var h={},g;for(g in l)h[g]=a[g];return u&&(r=r.stateNode,r.__reactInternalMemoizedUnmaskedChildContext=a,r.__reactInternalMemoizedMaskedChildContext=h),h}function Rs(r){return r=r.childContextTypes,r!=null}function Vl(){At(Ts),At(cs)}function cx(r,a,l){if(cs.current!==Sn)throw Error(n(168));Et(cs,a),Et(Ts,l)}function dx(r,a,l){var u=r.stateNode;if(a=a.childContextTypes,typeof u.getChildContext!="function")return l;u=u.getChildContext();for(var h in u)if(!(h in a))throw Error(n(108,fe(r)||"Unknown",h));return V({},l,u)}function zl(r){return r=(r=r.stateNode)&&r.__reactInternalMemoizedMergedChildContext||Sn,ma=cs.current,Et(cs,r),Et(Ts,Ts.current),!0}function ux(r,a,l){var u=r.stateNode;if(!u)throw Error(n(169));l?(r=dx(r,a,ma),u.__reactInternalMemoizedMergedChildContext=r,At(Ts),At(cs),Et(cs,r)):At(Ts),Et(Ts,l)}var Zr=null,Bl=!1,Lu=!1;function mx(r){Zr===null?Zr=[r]:Zr.push(r)}
vendor: 13,010 bytes, line 7
7function Mk(r){Bl=!0,mx(r)}function En(){if(!Lu&&Zr!==null){Lu=!0;var r=0,a=jt;try{var l=Zr;for(jt=1;r<l.length;r++){var u=l[r];do u=u(!0);while(u!==null)}Zr=null,Bl=!1}catch(h){throw Zr!==null&&(Zr=Zr.slice(r+1)),vl(au,En),h}finally{jt=a,Lu=!1}}return null}var qa=[],Za=0,Ul=null,Hl=0,Xs=[],er=0,fa=null,Gr=1,Qr="";function ha(r,a){qa[Za++]=Hl,qa[Za++]=Ul,Ul=r,Hl=a}function fx(r,a,l){Xs[er++]=Gr,Xs[er++]=Qr,Xs[er++]=fa,fa=r;var u=Gr;r=Qr;var h=32-pr(u)-1;u&=~(1<<h),l+=1;var g=32-pr(a)+h;if(30<g){var N=h-h%5;g=(u&(1<<N)-1).toString(32),u>>=N,h-=N,Gr=1<<32-pr(a)+h|l<<h|u,Qr=g+r}else Gr=1<<g|l<<h|u,Qr=r}function Fu(r){r.return!==null&&(ha(r,1),fx(r,1,0))}function $u(r){for(;r===Ul;)Ul=qa[--Za],qa[Za]=null,Hl=qa[--Za],qa[Za]=null;for(;r===fa;)fa=Xs[--er],Xs[er]=null,Qr=Xs[--er],Xs[er]=null,Gr=Xs[--er],Xs[er]=null}var $s=null,Vs=null,Rt=!1,gr=null;function hx(r,a){var l=nr(5,null,null,0);l.elementType="DELETED",l.stateNode=a,l.return=r,a=r.deletions,a===null?(r.deletions=[l],r.flags|=16):a.push(l)}function px(r,a){switch(r.tag){case 5:var l=r.type;return a=a.nodeType!==1||l.toLowerCase()!==a.nodeName.toLowerCase()?null:a,a!==null?(r.stateNode=a,$s=r,Vs=kn(a.firstChild),!0):!1;case 6:return a=r.pendingProps===""||a.nodeType!==3?null:a,a!==null?(r.stateNode=a,$s=r,Vs=null,!0):!1;case 13:return a=a.nodeType!==8?null:a,a!==null?(l=fa!==null?{id:Gr,overflow:Qr}:null,r.memoizedState={dehydrated:a,treeContext:l,retryLane:1073741824},l=nr(18,null,null,0),l.stateNode=a,l.return=r,r.child=l,$s=r,Vs=null,!0):!1;default:return!1}}function Vu(r){return(r.mode&1)!==0&&(r.flags&128)===0}function zu(r){if(Rt){var a=Vs;if(a){var l=a;if(!px(r,a)){if(Vu(r))throw Error(n(418));a=kn(l.nextSibling);var u=$s;a&&px(r,a)?hx(u,l):(r.flags=r.flags&-4097|2,Rt=!1,$s=r)}}else{if(Vu(r))throw Error(n(418));r.flags=r.flags&-4097|2,Rt=!1,$s=r}}}function xx(r){for(r=r.return;r!==null&&r.tag!==5&&r.tag!==3&&r.tag!==13;)r=r.return;$s=r}function Wl(r){if(r!==$s)return!1;if(!Rt)return xx(r),Rt=!0,!1;var a;if((a=r.tag!==3)&&!(a=r.tag!==5)&&(a=r.type,a=a!=="head"&&a!=="body"&&!Pu(r.type,r.memoizedProps)),a&&(a=Vs)){if(Vu(r))throw gx(),Error(n(418));for(;a;)hx(r,a),a=kn(a.nextSibling)}if(xx(r),r.tag===13){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(n(317));e:{for(r=r.nextSibling,a=0;r;){if(r.nodeType===8){var l=r.data;if(l==="/$"){if(a===0){Vs=kn(r.nextSibling);break e}a--}else l!=="$"&&l!=="$!"&&l!=="$?"||a++}r=r.nextSibling}Vs=null}}else Vs=$s?kn(r.stateNode.nextSibling):null;return!0}function gx(){for(var r=Vs;r;)r=kn(r.nextSibling)}function Ga(){Vs=$s=null,Rt=!1}function Bu(r){gr===null?gr=[r]:gr.push(r)}var Ik=_.ReactCurrentBatchConfig;function fi(r,a,l){if(r=l.ref,r!==null&&typeof r!="function"&&typeof r!="object"){if(l._owner){if(l=l._owner,l){if(l.tag!==1)throw Error(n(309));var u=l.stateNode}if(!u)throw Error(n(147,r));var h=u,g=""+r;return a!==null&&a.ref!==null&&typeof a.ref=="function"&&a.ref._stringRef===g?a.ref:(a=function(N){var T=h.refs;N===null?delete T[g]:T[g]=N},a._stringRef=g,a)}if(typeof r!="string")throw Error(n(284));if(!l._owner)throw Error(n(290,r))}return r}function Kl(r,a){throw r=Object.prototype.toString.call(a),Error(n(31,r==="[object Object]"?"object with keys {"+Object.keys(a).join(", ")+"}":r))}function vx(r){var a=r._init;return a(r._payload)}function yx(r){function a(B,$){if(r){var K=B.deletions;K===null?(B.deletions=[$],B.flags|=16):K.push($)}}function l(B,$){if(!r)return null;for(;$!==null;)a(B,$),$=$.sibling;return null}function u(B,$){for(B=new Map;$!==null;)$.key!==null?B.set($.key,$):B.set($.index,$),$=$.sibling;return B}function h(B,$){return B=Dn(B,$),B.index=0,B.sibling=null,B}function g(B,$,K){return B.index=K,r?(K=B.alternate,K!==null?(K=K.index,K<$?(B.flags|=2,$):K):(B.flags|=2,$)):(B.flags|=1048576,$)}function N(B){return r&&B.alternate===null&&(B.flags|=2),B}function T(B,$,K,ve){return $===null||$.tag!==6?($=Mm(K,B.mode,ve),$.return=B,$):($=h($,K),$.return=B,$)}function L(B,$,K,ve){var Oe=K.type;return Oe===F?de(B,$,K.props.children,ve,K.key):$!==null&&($.elementType===Oe||typeof Oe=="object"&&Oe!==null&&Oe.$$typeof===ne&&vx(Oe)===$.type)?(ve=h($,K.props),ve.ref=fi(B,$,K),ve.return=B,ve):(ve=xc(K.type,K.key,K.props,null,B.mode,ve),ve.ref=fi(B,$,K),ve.return=B,ve)}function G(B,$,K,ve){return $===null||$.tag!==4||$.stateNode.containerInfo!==K.containerInfo||$.stateNode.implementation!==K.implementation?($=Im(K,B.mode,ve),$.return=B,$):($=h($,K.children||[]),$.return=B,$)}function de(B,$,K,ve,Oe){return $===null||$.tag!==7?($=wa(K,B.mode,ve,Oe),$.return=B,$):($=h($,K),$.return=B,$)}function he(B,$,K){if(typeof $=="string"&&$!==""||typeof $=="number")return $=Mm(""+$,B.mode,K),$.return=B,$;if(typeof $=="object"&&$!==null){switch($.$$typeof){case D:return K=xc($.type,$.key,$.props,null,B.mode,K),K.ref=fi(B,null,$),K.return=B,K;case O:return $=Im($,B.mode,K),$.return=B,$;case ne:var ve=$._init;return he(B,ve($._payload),K)}if(vt($)||q($))return $=wa($,B.mode,K,null),$.return=B,$;Kl(B,$)}return null}function ce(B,$,K,ve){var Oe=$!==null?$.key:null;if(typeof K=="string"&&K!==""||typeof K=="number")return Oe!==null?null:T(B,$,""+K,ve);if(typeof K=="object"&&K!==null){switch(K.$$typeof){case D:return K.key===Oe?L(B,$,K,ve):null;case O:return K.key===Oe?G(B,$,K,ve):null;case ne:return Oe=K._init,ce(B,$,Oe(K._payload),ve)}if(vt(K)||q(K))return Oe!==null?null:de(B,$,K,ve,null);Kl(B,K)}return null}function _e(B,$,K,ve,Oe){if(typeof ve=="string"&&ve!==""||typeof ve=="number")return B=B.get(K)||null,T($,B,""+ve,Oe);if(typeof ve=="object"&&ve!==null){switch(ve.$$typeof){case D:return B=B.get(ve.key===null?K:ve.key)||null,L($,B,ve,Oe);case O:return B=B.get(ve.key===null?K:ve.key)||null,G($,B,ve,Oe);case ne:var Be=ve._init;return _e(B,$,K,Be(ve._payload),Oe)}if(vt(ve)||q(ve))return B=B.get(K)||null,de($,B,ve,Oe,null);Kl($,ve)}return null}function Re(B,$,K,ve){for(var Oe=null,Be=null,Ue=$,Ke=$=0,ts=null;Ue!==null&&Ke<K.length;Ke++){Ue.index>Ke?(ts=Ue,Ue=null):ts=Ue.sibling;var xt=ce(B,Ue,K[Ke],ve);if(xt===null){Ue===null&&(Ue=ts);break}r&&Ue&&xt.alternate===null&&a(B,Ue),$=g(xt,$,Ke),Be===null?Oe=xt:Be.sibling=xt,Be=xt,Ue=ts}if(Ke===K.length)return l(B,Ue),Rt&&ha(B,Ke),Oe;if(Ue===null){for(;Ke<K.length;Ke++)Ue=he(B,K[Ke],ve),Ue!==null&&($=g(Ue,$,Ke),Be===null?Oe=Ue:Be.sibling=Ue,Be=Ue);return Rt&&ha(B,Ke),Oe}for(Ue=u(B,Ue);Ke<K.length;Ke++)ts=_e(Ue,B,Ke,K[Ke],ve),ts!==null&&(r&&ts.alternate!==null&&Ue.delete(ts.key===null?Ke:ts.key),$=g(ts,$,Ke),Be===null?Oe=ts:Be.sibling=ts,Be=ts);return r&&Ue.forEach(function(On){return a(B,On)}),Rt&&ha(B,Ke),Oe}function Me(B,$,K,ve){var Oe=q(K);if(typeof Oe!="function")throw Error(n(150));if(K=Oe.call(K),K==null)throw Error(n(151));for(var Be=Oe=null,Ue=$,Ke=$=0,ts=null,xt=K.next();Ue!==null&&!xt.done;Ke++,xt=K.next()){Ue.index>Ke?(ts=Ue,Ue=null):ts=Ue.sibling;var On=ce(B,Ue,xt.value,ve);if(On===null){Ue===null&&(Ue=ts);break}r&&Ue&&On.alternate===null&&a(B,Ue),$=g(On,$,Ke),Be===null?Oe=On:Be.sibling=On,Be=On,Ue=ts}if(xt.done)return l(B,Ue),Rt&&ha(B,Ke),Oe;if(Ue===null){for(;!xt.done;Ke++,xt=K.next())xt=he(B,xt.value,ve),xt!==null&&($=g(xt,$,Ke),Be===null?Oe=xt:Be.sibling=xt,Be=xt);return Rt&&ha(B,Ke),Oe}for(Ue=u(B,Ue);!xt.done;Ke++,xt=K.next())xt=_e(Ue,B,Ke,xt.value,ve),xt!==null&&(r&&xt.alternate!==null&&Ue.delete(xt.key===null?Ke:xt.key),$=g(xt,$,Ke),Be===null?Oe=xt:Be.sibling=xt,Be=xt);return r&&Ue.forEach(function(f2){return a(B,f2)}),Rt&&ha(B,Ke),Oe}function $t(B,$,K,ve){if(typeof K=="object"&&K!==null&&K.type===F&&K.key===null&&(K=K.props.children),typeof K=="object"&&K!==null){switch(K.$$typeof){case D:e:{for(var Oe=K.key,Be=$;Be!==null;){if(Be.key===Oe){if(Oe=K.type,Oe===F){if(Be.tag===7){l(B,Be.sibling),$=h(Be,K.props.children),$.return=B,B=$;break e}}else if(Be.elementType===Oe||typeof Oe=="object"&&Oe!==null&&Oe.$$typeof===ne&&vx(Oe)===Be.type){l(B,Be.sibling),$=h(Be,K.props),$.ref=fi(B,Be,K),$.return=B,B=$;break e}l(B,Be);break}else a(B,Be);Be=Be.sibling}K.type===F?($=wa(K.props.children,B.mode,ve,K.key),$.return=B,B=$):(ve=xc(K.type,K.key,K.props,null,B.mode,ve),ve.ref=fi(B,$,K),ve.return=B,B=ve)}return N(B);case O:e:{for(Be=K.key;$!==null;){if($.key===Be)if($.tag===4&&$.stateNode.containerInfo===K.containerInfo&&$.stateNode.implementation===K.implementation){l(B,$.sibling),$=h($,K.children||[]),$.return=B,B=$;break e}else{l(B,$);break}else a(B,$);$=$.sibling}$=Im(K,B.mode,ve),$.return=B,B=$}return N(B);case ne:return Be=K._init,$t(B,$,Be(K._payload),ve)}if(vt(K))return Re(B,$,K,ve);if(q(K))return Me(B,$,K,ve);Kl(B,K)}return typeof K=="string"&&K!==""||typeof K=="number"?(K=""+K,$!==null&&$.tag===6?(l(B,$.sibling),$=h($,K),$.return=B,B=$):(l(B,$),$=Mm(K,B.mode,ve),$.return=B,B=$),N(B)):l(B,$)}return $t}var Qa=yx(!0),bx=yx(!1),ql=Cn(null),Zl=null,Ya=null,Uu=null;function Hu(){Uu=Ya=Zl=null}function Wu(r){var a=ql.current;At(ql),r._currentValue=a}function Ku(r,a,l){for(;r!==null;){var u=r.alternate;if((r.childLanes&a)!==a?(r.childLanes|=a,u!==null&&(u.childLanes|=a)):u!==null&&(u.childLanes&a)!==a&&(u.childLanes|=a),r===l)break;r=r.return}}function Ja(r,a){Zl=r,Uu=Ya=null,r=r.dependencies,r!==null&&r.firstContext!==null&&((r.lanes&a)!==0&&(Ps=!0),r.firstContext=null)}function tr(r){var a=r._currentValue;if(Uu!==r)if(r={context:r,memoizedValue:a,next:null},Ya===null){if(Zl===null)throw Error(n(308));Ya=r,Zl.dependencies={lanes:0,firstContext:r}}else Ya=Ya.next=r;return a}var pa=null;function qu(r){pa===null?pa=[r]:pa.push(r)}function jx(r,a,l,u){var h=a.interleaved;return h===null?(l.next=l,qu(a)):(l.next=h.next,h.next=l),a.interleaved=l,Yr(r,u)}function Yr(r,a){r.lanes|=a;var l=r.alternate;for(l!==null&&(l.lanes|=a),l=r,r=r.return;r!==null;)r.childLanes|=a,l=r.alternate,l!==null&&(l.childLanes|=a),l=r,r=r.return;return l.tag===3?l.stateNode:null}var _n=!1;function Zu(r){r.updateQueue={baseState:r.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function wx(r,a){r=r.updateQueue,a.updateQueue===r&&(a.updateQueue={baseState:r.baseState,firstBaseUpdate:r.firstBaseUpdate,lastBaseUpdate:r.lastBaseUpdate,shared:r.shared,effects:r.effects})}function Jr(r,a){return{eventTime:r,lane:a,tag:0,payload:null,callback:null,next:null}}function An(r,a,l){var u=r.updateQueue;if(u===null)return null;if(u=u.shared,(mt&2)!==0){var h=u.pending;return h===null?a.next=a:(a.next=h.next,h.next=a),u.pending=a,Yr(r,l)}return h=u.interleaved,h===null?(a.next=a,qu(u)):(a.next=h.next,h.next=a),u.interleaved=a,Yr(r,l)}function Gl(r,a,l){if(a=a.updateQueue,a!==null&&(a=a.shared,(l&4194240)!==0)){var u=a.lanes;u&=r.pendingLanes,l|=u,a.lanes=l,lu(r,l)}}function Nx(r,a){var l=r.updateQueue,u=r.alternate;if(u!==null&&(u=u.updateQueue,l===u)){var h=null,g=null;if(l=l.firstBaseUpdate,l!==null){do{var N={eventTime:l.eventTime,lane:l.lane,tag:l.tag,payload:l.payload,callback:l.callback,next:null};g===null?h=g=N:g=g.next=N,l=l.next}while(l!==null);g===null?h=g=a:g=g.next=a}else h=g=a;l={baseState:u.baseState,firstBaseUpdate:h,lastBaseUpdate:g,shared:u.shared,effects:u.effects},r.updateQueue=l;return}r=l.lastBaseUpdate,r===null?l.firstBaseUpdate=a:r.next=a,l.lastBaseUpdate=a}function Ql(r,a,l,u){var h=r.updateQueue;_n=!1;var g=h.firstBaseUpdate,N=h.lastBaseUpdate,T=h.shared.pending;if(T!==null){h.shared.pending=null;var L=T,G=L.next;L.next=null,N===null?g=G:N.next=G,N=L;var de=r.alternate;de!==null&&(de=de.updateQueue,T=de.lastBaseUpdate,T!==N&&(T===null?de.firstBaseUpdate=G:T.next=G,de.lastBaseUpdate=L))}if(g!==null){var he=h.baseState;N=0,de=G=L=null,T=g;do{var ce=T.lane,_e=T.eventTime;if((u&ce)===ce){de!==null&&(de=de.next={eventTime:_e,lane:0,tag:T.tag,payload:T.payload,callback:T.callback,next:null});e:{var Re=r,Me=T;switch(ce=a,_e=l,Me.tag){case 1:if(Re=Me.payload,typeof Re=="function"){he=Re.call(_e,he,ce);break e}he=Re;break e;case 3:Re.flags=Re.flags&-65537|128;case 0:if(Re=Me.payload,ce=typeof Re=="function"?Re.call(_e,he,ce):Re,ce==null)break e;he=V({},he,ce);break e;case 2:_n=!0}}T.callback!==null&&T.lane!==0&&(r.flags|=64,ce=h.effects,ce===null?h.effects=[T]:ce.push(T))}else _e={eventTime:_e,lane:ce,tag:T.tag,payload:T.payload,callback:T.callback,next:null},de===null?(G=de=_e,L=he):de=de.next=_e,N|=ce;if(T=T.next,T===null){if(T=h.shared.pending,T===null)break;ce=T,T=ce.next,ce.next=null,h.lastBaseUpdate=ce,h.shared.pending=null}}while(!0);if(de===null&&(L=he),h.baseState=L,h.firstBaseUpdate=G,h.lastBaseUpdate=de,a=h.shared.interleaved,a!==null){h=a;do N|=h.lane,h=h.next;while(h!==a)}else g===null&&(h.shared.lanes=0);va|=N,r.lanes=N,r.memoizedState=he}}function kx(r,a,l){if(r=a.effects,a.effects=null,r!==null)for(a=0;a<r.length;a++){var u=r[a],h=u.callback;if(h!==null){if(u.callback=null,u=l,typeof h!="function")throw Error(n(191,h));h.call(u)}}}var hi={},Mr=Cn(hi),pi=Cn(hi),xi=Cn(hi);function xa(r){if(r===hi)throw Error(n(174));return r}function Gu(r,a){switch(Et(xi,a),Et(pi,r),Et(Mr,hi),r=a.nodeType,r){case 9:case 11:a=(a=a.documentElement)?a.namespaceURI:oe(null,"");break;
vendor: 2,690 bytes, line 7
7default:r=r===8?a.parentNode:a,a=r.namespaceURI||null,r=r.tagName,a=oe(a,r)}At(Mr),Et(Mr,a)}function Xa(){At(Mr),At(pi),At(xi)}function Cx(r){xa(xi.current);var a=xa(Mr.current),l=oe(a,r.type);a!==l&&(Et(pi,r),Et(Mr,l))}function Qu(r){pi.current===r&&(At(Mr),At(pi))}var It=Cn(0);function Yl(r){for(var a=r;a!==null;){if(a.tag===13){var l=a.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||l.data==="$?"||l.data==="$!"))return a}else if(a.tag===19&&a.memoizedProps.revealOrder!==void 0){if((a.flags&128)!==0)return a}else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===r)break;for(;a.sibling===null;){if(a.return===null||a.return===r)return null;a=a.return}a.sibling.return=a.return,a=a.sibling}return null}var Yu=[];function Ju(){for(var r=0;r<Yu.length;r++)Yu[r]._workInProgressVersionPrimary=null;Yu.length=0}var Jl=_.ReactCurrentDispatcher,Xu=_.ReactCurrentBatchConfig,ga=0,Dt=null,qt=null,Xt=null,Xl=!1,gi=!1,vi=0,Dk=0;function ds(){throw Error(n(321))}function em(r,a){if(a===null)return!1;for(var l=0;l<a.length&&l<r.length;l++)if(!xr(r[l],a[l]))return!1;return!0}function tm(r,a,l,u,h,g){if(ga=g,Dt=a,a.memoizedState=null,a.updateQueue=null,a.lanes=0,Jl.current=r===null||r.memoizedState===null?$k:Vk,r=l(u,h),gi){g=0;do{if(gi=!1,vi=0,25<=g)throw Error(n(301));g+=1,Xt=qt=null,a.updateQueue=null,Jl.current=zk,r=l(u,h)}while(gi)}if(Jl.current=sc,a=qt!==null&&qt.next!==null,ga=0,Xt=qt=Dt=null,Xl=!1,a)throw Error(n(300));return r}function sm(){var r=vi!==0;return vi=0,r}function Ir(){var r={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Xt===null?Dt.memoizedState=Xt=r:Xt=Xt.next=r,Xt}function sr(){if(qt===null){var r=Dt.alternate;r=r!==null?r.memoizedState:null}else r=qt.next;var a=Xt===null?Dt.memoizedState:Xt.next;if(a!==null)Xt=a,qt=r;else{if(r===null)throw Error(n(310));qt=r,r={memoizedState:qt.memoizedState,baseState:qt.baseState,baseQueue:qt.baseQueue,queue:qt.queue,next:null},Xt===null?Dt.memoizedState=Xt=r:Xt=Xt.next=r}return Xt}function yi(r,a){return typeof a=="function"?a(r):a}function rm(r){var a=sr(),l=a.queue;if(l===null)throw Error(n(311));l.lastRenderedReducer=r;var u=qt,h=u.baseQueue,g=l.pending;if(g!==null){if(h!==null){var N=h.next;h.next=g.next,g.next=N}u.baseQueue=h=g,l.pending=null}if(h!==null){g=h.next,u=u.baseState;var T=N=null,L=null,G=g;do{var de=G.lane;if((ga&de)===de)L!==null&&(L=L.next={lane:0,action:G.action,hasEagerState:G.hasEagerState,eagerState:G.eagerState,next:null}),u=G.hasEagerState?G.eagerState:r(u,G.action);else{var he={lane:de,action:G.action,hasEagerState:G.hasEagerState,eagerState:G.eagerState,next:null};L===null?(T=L=he,N=u):L=L.next=he,Dt.lanes|=de,va|=de}G=G.next}
vendor: 12,618 bytes, lines 7-9
7while(G!==null&&G!==g);L===null?N=u:L.next=T,xr(u,a.memoizedState)||(Ps=!0),a.memoizedState=u,a.baseState=N,a.baseQueue=L,l.lastRenderedState=u}if(r=l.interleaved,r!==null){h=r;do g=h.lane,Dt.lanes|=g,va|=g,h=h.next;while(h!==r)}else h===null&&(l.lanes=0);return[a.memoizedState,l.dispatch]}function nm(r){var a=sr(),l=a.queue;if(l===null)throw Error(n(311));l.lastRenderedReducer=r;var u=l.dispatch,h=l.pending,g=a.memoizedState;if(h!==null){l.pending=null;var N=h=h.next;do g=r(g,N.action),N=N.next;while(N!==h);xr(g,a.memoizedState)||(Ps=!0),a.memoizedState=g,a.baseQueue===null&&(a.baseState=g),l.lastRenderedState=g}return[g,u]}function Sx(){}function Ex(r,a){var l=Dt,u=sr(),h=a(),g=!xr(u.memoizedState,h);if(g&&(u.memoizedState=h,Ps=!0),u=u.queue,am(Tx.bind(null,l,u,r),[r]),u.getSnapshot!==a||g||Xt!==null&&Xt.memoizedState.tag&1){if(l.flags|=2048,bi(9,Ax.bind(null,l,u,h,a),void 0,null),es===null)throw Error(n(349));(ga&30)!==0||_x(l,a,h)}return h}function _x(r,a,l){r.flags|=16384,r={getSnapshot:a,value:l},a=Dt.updateQueue,a===null?(a={lastEffect:null,stores:null},Dt.updateQueue=a,a.stores=[r]):(l=a.stores,l===null?a.stores=[r]:l.push(r))}function Ax(r,a,l,u){a.value=l,a.getSnapshot=u,Rx(a)&&Px(r)}function Tx(r,a,l){return l(function(){Rx(a)&&Px(r)})}function Rx(r){var a=r.getSnapshot;r=r.value;try{var l=a();return!xr(r,l)}catch{return!0}}function Px(r){var a=Yr(r,1);a!==null&&jr(a,r,1,-1)}function Mx(r){var a=Ir();return typeof r=="function"&&(r=r()),a.memoizedState=a.baseState=r,r={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:yi,lastRenderedState:r},a.queue=r,r=r.dispatch=Fk.bind(null,Dt,r),[a.memoizedState,r]}function bi(r,a,l,u){return r={tag:r,create:a,destroy:l,deps:u,next:null},a=Dt.updateQueue,a===null?(a={lastEffect:null,stores:null},Dt.updateQueue=a,a.lastEffect=r.next=r):(l=a.lastEffect,l===null?a.lastEffect=r.next=r:(u=l.next,l.next=r,r.next=u,a.lastEffect=r)),r}function Ix(){return sr().memoizedState}function ec(r,a,l,u){var h=Ir();Dt.flags|=r,h.memoizedState=bi(1|a,l,void 0,u===void 0?null:u)}function tc(r,a,l,u){var h=sr();u=u===void 0?null:u;var g=void 0;if(qt!==null){var N=qt.memoizedState;if(g=N.destroy,u!==null&&em(u,N.deps)){h.memoizedState=bi(a,l,g,u);return}}Dt.flags|=r,h.memoizedState=bi(1|a,l,g,u)}function Dx(r,a){return ec(8390656,8,r,a)}function am(r,a){return tc(2048,8,r,a)}function Ox(r,a){return tc(4,2,r,a)}function Lx(r,a){return tc(4,4,r,a)}function Fx(r,a){if(typeof a=="function")return r=r(),a(r),function(){a(null)};if(a!=null)return r=r(),a.current=r,function(){a.current=null}}function $x(r,a,l){return l=l!=null?l.concat([r]):null,tc(4,4,Fx.bind(null,a,r),l)}function om(){}function Vx(r,a){var l=sr();a=a===void 0?null:a;var u=l.memoizedState;return u!==null&&a!==null&&em(a,u[1])?u[0]:(l.memoizedState=[r,a],r)}function zx(r,a){var l=sr();a=a===void 0?null:a;var u=l.memoizedState;return u!==null&&a!==null&&em(a,u[1])?u[0]:(r=r(),l.memoizedState=[r,a],r)}function Bx(r,a,l){return(ga&21)===0?(r.baseState&&(r.baseState=!1,Ps=!0),r.memoizedState=l):(xr(l,a)||(l=vp(),Dt.lanes|=l,va|=l,r.baseState=!0),a)}function Ok(r,a){var l=jt;jt=l!==0&&4>l?l:4,r(!0);var u=Xu.transition;Xu.transition={};try{r(!1),a()}finally{jt=l,Xu.transition=u}}function Ux(){return sr().memoizedState}function Lk(r,a,l){var u=Mn(r);if(l={lane:u,action:l,hasEagerState:!1,eagerState:null,next:null},Hx(r))Wx(a,l);else if(l=jx(r,a,l,u),l!==null){var h=ys();jr(l,r,u,h),Kx(l,a,u)}}function Fk(r,a,l){var u=Mn(r),h={lane:u,action:l,hasEagerState:!1,eagerState:null,next:null};if(Hx(r))Wx(a,h);else{var g=r.alternate;if(r.lanes===0&&(g===null||g.lanes===0)&&(g=a.lastRenderedReducer,g!==null))try{var N=a.lastRenderedState,T=g(N,l);if(h.hasEagerState=!0,h.eagerState=T,xr(T,N)){var L=a.interleaved;L===null?(h.next=h,qu(a)):(h.next=L.next,L.next=h),a.interleaved=h;return}}catch{}l=jx(r,a,h,u),l!==null&&(h=ys(),jr(l,r,u,h),Kx(l,a,u))}}function Hx(r){var a=r.alternate;return r===Dt||a!==null&&a===Dt}function Wx(r,a){gi=Xl=!0;var l=r.pending;l===null?a.next=a:(a.next=l.next,l.next=a),r.pending=a}function Kx(r,a,l){if((l&4194240)!==0){var u=a.lanes;u&=r.pendingLanes,l|=u,a.lanes=l,lu(r,l)}}var sc={readContext:tr,useCallback:ds,useContext:ds,useEffect:ds,useImperativeHandle:ds,useInsertionEffect:ds,useLayoutEffect:ds,useMemo:ds,useReducer:ds,useRef:ds,useState:ds,useDebugValue:ds,useDeferredValue:ds,useTransition:ds,useMutableSource:ds,useSyncExternalStore:ds,useId:ds,unstable_isNewReconciler:!1},$k={readContext:tr,useCallback:function(r,a){return Ir().memoizedState=[r,a===void 0?null:a],r},useContext:tr,useEffect:Dx,useImperativeHandle:function(r,a,l){return l=l!=null?l.concat([r]):null,ec(4194308,4,Fx.bind(null,a,r),l)},useLayoutEffect:function(r,a){return ec(4194308,4,r,a)},useInsertionEffect:function(r,a){return ec(4,2,r,a)},useMemo:function(r,a){var l=Ir();return a=a===void 0?null:a,r=r(),l.memoizedState=[r,a],r},useReducer:function(r,a,l){var u=Ir();return a=l!==void 0?l(a):a,u.memoizedState=u.baseState=a,r={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:r,lastRenderedState:a},u.queue=r,r=r.dispatch=Lk.bind(null,Dt,r),[u.memoizedState,r]},useRef:function(r){var a=Ir();return r={current:r},a.memoizedState=r},useState:Mx,useDebugValue:om,useDeferredValue:function(r){return Ir().memoizedState=r},useTransition:function(){var r=Mx(!1),a=r[0];return r=Ok.bind(null,r[1]),Ir().memoizedState=r,[a,r]},useMutableSource:function(){},useSyncExternalStore:function(r,a,l){var u=Dt,h=Ir();if(Rt){if(l===void 0)throw Error(n(407));l=l()}else{if(l=a(),es===null)throw Error(n(349));(ga&30)!==0||_x(u,a,l)}h.memoizedState=l;var g={value:l,getSnapshot:a};return h.queue=g,Dx(Tx.bind(null,u,g,r),[r]),u.flags|=2048,bi(9,Ax.bind(null,u,g,l,a),void 0,null),l},useId:function(){var r=Ir(),a=es.identifierPrefix;if(Rt){var l=Qr,u=Gr;l=(u&~(1<<32-pr(u)-1)).toString(32)+l,a=":"+a+"R"+l,l=vi++,0<l&&(a+="H"+l.toString(32)),a+=":"}else l=Dk++,a=":"+a+"r"+l.toString(32)+":";return r.memoizedState=a},unstable_isNewReconciler:!1},Vk={readContext:tr,useCallback:Vx,useContext:tr,useEffect:am,useImperativeHandle:$x,useInsertionEffect:Ox,useLayoutEffect:Lx,useMemo:zx,useReducer:rm,useRef:Ix,useState:function(){return rm(yi)},useDebugValue:om,useDeferredValue:function(r){var a=sr();return Bx(a,qt.memoizedState,r)},useTransition:function(){var r=rm(yi)[0],a=sr().memoizedState;return[r,a]},useMutableSource:Sx,useSyncExternalStore:Ex,useId:Ux,unstable_isNewReconciler:!1},zk={readContext:tr,useCallback:Vx,useContext:tr,useEffect:am,useImperativeHandle:$x,useInsertionEffect:Ox,useLayoutEffect:Lx,useMemo:zx,useReducer:nm,useRef:Ix,useState:function(){return nm(yi)},useDebugValue:om,useDeferredValue:function(r){var a=sr();return qt===null?a.memoizedState=r:Bx(a,qt.memoizedState,r)},useTransition:function(){var r=nm(yi)[0],a=sr().memoizedState;return[r,a]},useMutableSource:Sx,useSyncExternalStore:Ex,useId:Ux,unstable_isNewReconciler:!1};function vr(r,a){if(r&&r.defaultProps){a=V({},a),r=r.defaultProps;for(var l in r)a[l]===void 0&&(a[l]=r[l]);return a}return a}function im(r,a,l,u){a=r.memoizedState,l=l(u,a),l=l==null?a:V({},a,l),r.memoizedState=l,r.lanes===0&&(r.updateQueue.baseState=l)}var rc={isMounted:function(r){return(r=r._reactInternals)?Kr(r)===r:!1},enqueueSetState:function(r,a,l){r=r._reactInternals;var u=ys(),h=Mn(r),g=Jr(u,h);g.payload=a,l!=null&&(g.callback=l),a=An(r,g,h),a!==null&&(jr(a,r,h,u),Gl(a,r,h))},enqueueReplaceState:function(r,a,l){r=r._reactInternals;var u=ys(),h=Mn(r),g=Jr(u,h);g.tag=1,g.payload=a,l!=null&&(g.callback=l),a=An(r,g,h),a!==null&&(jr(a,r,h,u),Gl(a,r,h))},enqueueForceUpdate:function(r,a){r=r._reactInternals;var l=ys(),u=Mn(r),h=Jr(l,u);h.tag=2,a!=null&&(h.callback=a),a=An(r,h,u),a!==null&&(jr(a,r,u,l),Gl(a,r,u))}};function qx(r,a,l,u,h,g,N){return r=r.stateNode,typeof r.shouldComponentUpdate=="function"?r.shouldComponentUpdate(u,g,N):a.prototype&&a.prototype.isPureReactComponent?!oi(l,u)||!oi(h,g):!0}function Zx(r,a,l){var u=!1,h=Sn,g=a.contextType;return typeof g=="object"&&g!==null?g=tr(g):(h=Rs(a)?ma:cs.current,u=a.contextTypes,g=(u=u!=null)?Ka(r,h):Sn),a=new a(l,g),r.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=rc,r.stateNode=a,a._reactInternals=r,u&&(r=r.stateNode,r.__reactInternalMemoizedUnmaskedChildContext=h,r.__reactInternalMemoizedMaskedChildContext=g),a}function Gx(r,a,l,u){r=a.state,typeof a.componentWillReceiveProps=="function"&&a.componentWillReceiveProps(l,u),typeof a.UNSAFE_componentWillReceiveProps=="function"&&a.UNSAFE_componentWillReceiveProps(l,u),a.state!==r&&rc.enqueueReplaceState(a,a.state,null)}function lm(r,a,l,u){var h=r.stateNode;h.props=l,h.state=r.memoizedState,h.refs={},Zu(r);var g=a.contextType;typeof g=="object"&&g!==null?h.context=tr(g):(g=Rs(a)?ma:cs.current,h.context=Ka(r,g)),h.state=r.memoizedState,g=a.getDerivedStateFromProps,typeof g=="function"&&(im(r,a,g,l),h.state=r.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof h.getSnapshotBeforeUpdate=="function"||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(a=h.state,typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount(),a!==h.state&&rc.enqueueReplaceState(h,h.state,null),Ql(r,l,h,u),h.state=r.memoizedState),typeof h.componentDidMount=="function"&&(r.flags|=4194308)}function eo(r,a){try{var l="",u=a;do l+=ze(u),u=u.return;while(u);var h=l}catch(g){h=` 8Error generating stack: `+g.message+` 9`+g.stack}return{value:r,source:a,stack:h,digest:null}}function cm(r,a,l){return{value:r,source:null,stack:l??null,digest:a??null}}function dm(r,a){try{console.error(a.value)}catch(l){setTimeout(function(){throw l})}}var Bk=typeof WeakMap=="function"?WeakMap:Map;function Qx(r,a,l){l=Jr(-1,l),l.tag=3,l.payload={element:null};var u=a.value;return l.callback=function(){dc||(dc=!0,Cm=u),dm(r,a)},l}function Yx(r,a,l){l=Jr(-1,l),l.tag=3;var u=r.type.getDerivedStateFromError;if(typeof u=="function"){var h=a.value;l.payload=function(){return u(h)},l.callback=function(){dm(r,a)}}var g=r.stateNode;return g!==null&&typeof g.componentDidCatch=="function"&&(l.callback=function(){dm(r,a),typeof u!="function"&&(Rn===null?Rn=new Set([this]):Rn.add(this));var N=a.stack;this.componentDidCatch(a.value,{componentStack:N!==null?N:""})}),l}function Jx(r,a,l){var u=r.pingCache;if(u===null){u=r.pingCache=new Bk;var h=new Set;u.set(a,h)}else h=u.get(a),h===void 0&&(h=new Set,u.set(a,h));h.has(l)||(h.add(l),r=s2.bind(null,r,a,l),a.then(r,r))}function Xx(r){do{var a;if((a=r.tag===13)&&(a=r.memoizedState,a=a!==null?a.dehydrated!==null:!0),a)return r;r=r.return}while(r!==null);return null}function eg(r,a,l,u,h){return(r.mode&1)===0?(r===a?r.flags|=65536:(r.flags|=128,l.flags|=131072,l.flags&=-52805,l.tag===1&&(l.alternate===null?l.tag=17:(a=Jr(-1,1),a.tag=2,An(l,a,1))),l.lanes|=1),r):(r.flags|=65536,r.lanes=h,r)}var Uk=_.ReactCurrentOwner,Ps=!1;function vs(r,a,l,u){a.child=r===null?bx(a,null,l,u):Qa(a,r.child,l,u)}function tg(r,a,l,u,h){l=l.render;var g=a.ref;return Ja(a,h),u=tm(r,a,l,u,g,h),l=sm(),r!==null&&!Ps?(a.updateQueue=r.updateQueue,a.flags&=-2053,r.lanes&=~h,Xr(r,a,h)):(Rt&&l&&Fu(a),a.flags|=1,vs(r,a,u,h),a.child)}function sg(r,a,l,u,h){if(r===null){var g=l.type;return typeof g=="function"&&!Pm(g)&&g.defaultProps===void 0&&l.compare===null&&l.defaultProps===void 0?(a.tag=15,a.type=g,rg(r,a,g,u,h)):(r=xc(l.type,null,u,a,a.mode,h),r.ref=a.ref,r.return=a,a.child=r)}if(g=r.child,(r.lanes&h)===0){var N=g.memoizedProps;if(l=l.compare,l=l!==null?l:oi,l(N,u)&&r.ref===a.ref)return Xr(r,a,h)}return a.flags|=1,r=Dn(g,u),r.ref=a.ref,r.return=a,a.child=r}function rg(r,a,l,u,h){if(r!==null){var g=r.memoizedProps;if(oi(g,u)&&r.ref===a.ref)if(Ps=!1,a.pendingProps=u=g,(r.lanes&h)!==0)(r.flags&131072)!==0&&(Ps=!0);else return a.lanes=r.lanes,Xr(r,a,h)}return um(r,a,l,u,h)}function ng(r,a,l){var u=a.pendingProps,h=u.children,g=r!==null?r.memoizedState:null;if(u.mode==="hidden")if((a.mode&1)===0)a.memoizedState={baseLanes:0,cachePool:null,transitions:null},Et(so,zs),zs|=l;else{if((l&1073741824)===0)return r=g!==null?g.baseLanes|l:l,a.lanes=a.childLanes=1073741824,a.memoizedState={baseLanes:r,cachePool:null,transitions:null},a.updateQueue=null,Et(so,zs),zs|=r,null;a.memoizedState={baseLanes:0,cachePool:null,transitions:null},u=g!==null?g.baseLanes:l,Et(so,zs),zs|=u}else g!==null?(u=g.baseLanes|l,a.memoizedState=null):u=l,Et(so,zs),zs|=u;return vs(r,a,h,l),a.child}function ag(r,a){var l=a.ref;(r===null&&l!==null||r!==null&&r.ref!==l)&&(a.flags|=512,a.flags|=2097152)}
vendor: 4,559 bytes, line 9
9function um(r,a,l,u,h){var g=Rs(l)?ma:cs.current;return g=Ka(a,g),Ja(a,h),l=tm(r,a,l,u,g,h),u=sm(),r!==null&&!Ps?(a.updateQueue=r.updateQueue,a.flags&=-2053,r.lanes&=~h,Xr(r,a,h)):(Rt&&u&&Fu(a),a.flags|=1,vs(r,a,l,h),a.child)}function og(r,a,l,u,h){if(Rs(l)){var g=!0;zl(a)}else g=!1;if(Ja(a,h),a.stateNode===null)ac(r,a),Zx(a,l,u),lm(a,l,u,h),u=!0;else if(r===null){var N=a.stateNode,T=a.memoizedProps;N.props=T;var L=N.context,G=l.contextType;typeof G=="object"&&G!==null?G=tr(G):(G=Rs(l)?ma:cs.current,G=Ka(a,G));var de=l.getDerivedStateFromProps,he=typeof de=="function"||typeof N.getSnapshotBeforeUpdate=="function";he||typeof N.UNSAFE_componentWillReceiveProps!="function"&&typeof N.componentWillReceiveProps!="function"||(T!==u||L!==G)&&Gx(a,N,u,G),_n=!1;var ce=a.memoizedState;N.state=ce,Ql(a,u,N,h),L=a.memoizedState,T!==u||ce!==L||Ts.current||_n?(typeof de=="function"&&(im(a,l,de,u),L=a.memoizedState),(T=_n||qx(a,l,T,u,ce,L,G))?(he||typeof N.UNSAFE_componentWillMount!="function"&&typeof N.componentWillMount!="function"||(typeof N.componentWillMount=="function"&&N.componentWillMount(),typeof N.UNSAFE_componentWillMount=="function"&&N.UNSAFE_componentWillMount()),typeof N.componentDidMount=="function"&&(a.flags|=4194308)):(typeof N.componentDidMount=="function"&&(a.flags|=4194308),a.memoizedProps=u,a.memoizedState=L),N.props=u,N.state=L,N.context=G,u=T):(typeof N.componentDidMount=="function"&&(a.flags|=4194308),u=!1)}else{N=a.stateNode,wx(r,a),T=a.memoizedProps,G=a.type===a.elementType?T:vr(a.type,T),N.props=G,he=a.pendingProps,ce=N.context,L=l.contextType,typeof L=="object"&&L!==null?L=tr(L):(L=Rs(l)?ma:cs.current,L=Ka(a,L));var _e=l.getDerivedStateFromProps;(de=typeof _e=="function"||typeof N.getSnapshotBeforeUpdate=="function")||typeof N.UNSAFE_componentWillReceiveProps!="function"&&typeof N.componentWillReceiveProps!="function"||(T!==he||ce!==L)&&Gx(a,N,u,L),_n=!1,ce=a.memoizedState,N.state=ce,Ql(a,u,N,h);var Re=a.memoizedState;T!==he||ce!==Re||Ts.current||_n?(typeof _e=="function"&&(im(a,l,_e,u),Re=a.memoizedState),(G=_n||qx(a,l,G,u,ce,Re,L)||!1)?(de||typeof N.UNSAFE_componentWillUpdate!="function"&&typeof N.componentWillUpdate!="function"||(typeof N.componentWillUpdate=="function"&&N.componentWillUpdate(u,Re,L),typeof N.UNSAFE_componentWillUpdate=="function"&&N.UNSAFE_componentWillUpdate(u,Re,L)),typeof N.componentDidUpdate=="function"&&(a.flags|=4),typeof N.getSnapshotBeforeUpdate=="function"&&(a.flags|=1024)):(typeof N.componentDidUpdate!="function"||T===r.memoizedProps&&ce===r.memoizedState||(a.flags|=4),typeof N.getSnapshotBeforeUpdate!="function"||T===r.memoizedProps&&ce===r.memoizedState||(a.flags|=1024),a.memoizedProps=u,a.memoizedState=Re),N.props=u,N.state=Re,N.context=L,u=G):(typeof N.componentDidUpdate!="function"||T===r.memoizedProps&&ce===r.memoizedState||(a.flags|=4),typeof N.getSnapshotBeforeUpdate!="function"||T===r.memoizedProps&&ce===r.memoizedState||(a.flags|=1024),u=!1)}return mm(r,a,l,u,g,h)}function mm(r,a,l,u,h,g){ag(r,a);var N=(a.flags&128)!==0;if(!u&&!N)return h&&ux(a,l,!1),Xr(r,a,g);u=a.stateNode,Uk.current=a;var T=N&&typeof l.getDerivedStateFromError!="function"?null:u.render();return a.flags|=1,r!==null&&N?(a.child=Qa(a,r.child,null,g),a.child=Qa(a,null,T,g)):vs(r,a,T,g),a.memoizedState=u.state,h&&ux(a,l,!0),a.child}function ig(r){var a=r.stateNode;a.pendingContext?cx(r,a.pendingContext,a.pendingContext!==a.context):a.context&&cx(r,a.context,!1),Gu(r,a.containerInfo)}function lg(r,a,l,u,h){return Ga(),Bu(h),a.flags|=256,vs(r,a,l,u),a.child}var fm={dehydrated:null,treeContext:null,retryLane:0};function hm(r){return{baseLanes:r,cachePool:null,transitions:null}}function cg(r,a,l){var u=a.pendingProps,h=It.current,g=!1,N=(a.flags&128)!==0,T;if((T=N)||(T=r!==null&&r.memoizedState===null?!1:(h&2)!==0),T?(g=!0,a.flags&=-129):(r===null||r.memoizedState!==null)&&(h|=1),Et(It,h&1),r===null)return zu(a),r=a.memoizedState,r!==null&&(r=r.dehydrated,r!==null)?((a.mode&1)===0?a.lanes=1:r.data==="$!"?a.lanes=8:a.lanes=1073741824,null):(N=u.children,r=u.fallback,g?(u=a.mode,g=a.child,N={mode:"hidden",children:N},(u&1)===0&&g!==null?(g.childLanes=0,g.pendingProps=N):g=gc(N,u,0,null),r=wa(r,u,l,null),g.return=a,r.return=a,g.sibling=r,a.child=g,a.child.memoizedState=hm(l),a.memoizedState=fm,r):pm(a,N));if(h=r.memoizedState,h!==null&&(T=h.dehydrated,T!==null))return Hk(r,a,N,u,T,h,l);if(g){g=u.fallback,N=a.mode,h=r.child,T=h.sibling;var L={mode:"hidden",children:u.children};return(N&1)===0&&a.child!==h?(u=a.child,u.childLanes=0,u.pendingProps=L,a.deletions=null):(u
vendor: 6,098 bytes, line 9
9=Dn(h,L),u.subtreeFlags=h.subtreeFlags&14680064),T!==null?g=Dn(T,g):(g=wa(g,N,l,null),g.flags|=2),g.return=a,u.return=a,u.sibling=g,a.child=u,u=g,g=a.child,N=r.child.memoizedState,N=N===null?hm(l):{baseLanes:N.baseLanes|l,cachePool:null,transitions:N.transitions},g.memoizedState=N,g.childLanes=r.childLanes&~l,a.memoizedState=fm,u}return g=r.child,r=g.sibling,u=Dn(g,{mode:"visible",children:u.children}),(a.mode&1)===0&&(u.lanes=l),u.return=a,u.sibling=null,r!==null&&(l=a.deletions,l===null?(a.deletions=[r],a.flags|=16):l.push(r)),a.child=u,a.memoizedState=null,u}function pm(r,a){return a=gc({mode:"visible",children:a},r.mode,0,null),a.return=r,r.child=a}function nc(r,a,l,u){return u!==null&&Bu(u),Qa(a,r.child,null,l),r=pm(a,a.pendingProps.children),r.flags|=2,a.memoizedState=null,r}function Hk(r,a,l,u,h,g,N){if(l)return a.flags&256?(a.flags&=-257,u=cm(Error(n(422))),nc(r,a,N,u)):a.memoizedState!==null?(a.child=r.child,a.flags|=128,null):(g=u.fallback,h=a.mode,u=gc({mode:"visible",children:u.children},h,0,null),g=wa(g,h,N,null),g.flags|=2,u.return=a,g.return=a,u.sibling=g,a.child=u,(a.mode&1)!==0&&Qa(a,r.child,null,N),a.child.memoizedState=hm(N),a.memoizedState=fm,g);if((a.mode&1)===0)return nc(r,a,N,null);if(h.data==="$!"){if(u=h.nextSibling&&h.nextSibling.dataset,u)var T=u.dgst;return u=T,g=Error(n(419)),u=cm(g,u,void 0),nc(r,a,N,u)}if(T=(N&r.childLanes)!==0,Ps||T){if(u=es,u!==null){switch(N&-N){case 4:h=2;break;case 16:h=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:h=32;break;case 536870912:h=268435456;break;default:h=0}h=(h&(u.suspendedLanes|N))!==0?0:h,h!==0&&h!==g.retryLane&&(g.retryLane=h,Yr(r,h),jr(u,r,h,-1))}return Rm(),u=cm(Error(n(421))),nc(r,a,N,u)}return h.data==="$?"?(a.flags|=128,a.child=r.child,a=r2.bind(null,r),h._reactRetry=a,null):(r=g.treeContext,Vs=kn(h.nextSibling),$s=a,Rt=!0,gr=null,r!==null&&(Xs[er++]=Gr,Xs[er++]=Qr,Xs[er++]=fa,Gr=r.id,Qr=r.overflow,fa=a),a=pm(a,u.children),a.flags|=4096,a)}function dg(r,a,l){r.lanes|=a;var u=r.alternate;u!==null&&(u.lanes|=a),Ku(r.return,a,l)}function xm(r,a,l,u,h){var g=r.memoizedState;g===null?r.memoizedState={isBackwards:a,rendering:null,renderingStartTime:0,last:u,tail:l,tailMode:h}:(g.isBackwards=a,g.rendering=null,g.renderingStartTime=0,g.last=u,g.tail=l,g.tailMode=h)}function ug(r,a,l){var u=a.pendingProps,h=u.revealOrder,g=u.tail;if(vs(r,a,u.children,l),u=It.current,(u&2)!==0)u=u&1|2,a.flags|=128;else{if(r!==null&&(r.flags&128)!==0)e:for(r=a.child;r!==null;){if(r.tag===13)r.memoizedState!==null&&dg(r,l,a);else if(r.tag===19)dg(r,l,a);else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===a)break e;for(;r.sibling===null;){if(r.return===null||r.return===a)break e;r=r.return}r.sibling.return=r.return,r=r.sibling}u&=1}if(Et(It,u),(a.mode&1)===0)a.memoizedState=null;else switch(h){case"forwards":for(l=a.child,h=null;l!==null;)r=l.alternate,r!==null&&Yl(r)===null&&(h=l),l=l.sibling;l=h,l===null?(h=a.child,a.child=null):(h=l.sibling,l.sibling=null),xm(a,!1,h,l,g);break;case"backwards":for(l=null,h=a.child,a.child=null;h!==null;){if(r=h.alternate,r!==null&&Yl(r)===null){a.child=h;break}r=h.sibling,h.sibling=l,l=h,h=r}xm(a,!0,l,null,g);break;case"together":xm(a,!1,null,null,void 0);break;default:a.memoizedState=null}return a.child}function ac(r,a){(a.mode&1)===0&&r!==null&&(r.alternate=null,a.alternate=null,a.flags|=2)}function Xr(r,a,l){if(r!==null&&(a.dependencies=r.dependencies),va|=a.lanes,(l&a.childLanes)===0)return null;if(r!==null&&a.child!==r.child)throw Error(n(153));if(a.child!==null){for(r=a.child,l=Dn(r,r.pendingProps),a.child=l,l.return=a;r.sibling!==null;)r=r.sibling,l=l.sibling=Dn(r,r.pendingProps),l.return=a;l.sibling=null}return a.child}function Wk(r,a,l){switch(a.tag){case 3:ig(a),Ga();break;case 5:Cx(a);break;case 1:Rs(a.type)&&zl(a);break;case 4:Gu(a,a.stateNode.containerInfo);break;case 10:var u=a.type._context,h=a.memoizedProps.value;Et(ql,u._currentValue),u._currentValue=h;break;case 13:if(u=a.memoizedState,u!==null)return u.dehydrated!==null?(Et(It,It.current&1),a.flags|=128,null):(l&a.child.childLanes)!==0?cg(r,a,l):(Et(It,It.current&1),r=Xr(r,a,l),r!==null?r.sibling:null);Et(It,It.current&1);break;case 19:if(u=(l&a.childLanes)!==0,(r.flags&128)!==0){if(u)return ug(r,a,l);a.flags|=128}if(h=a.memoizedState,h!==null&&(h.rendering=null,h.tail=null,h.lastEffect=null),Et(It,It.current),u)break;return null;case 22:case 23:return a.lanes=0,ng(r,a,l)}return Xr(r,a,l)}var mg,gm,fg,hg;mg=function(r,a){for(var l=a.child;l!==null;){if(l.tag===5||l.tag===6)r.appendChild(l.stateNode);else if(l.tag!==4&&l.child!==null){l.child.return=l,l=l.child;continue}if(l===a)break;for(;l.sibling===null;){if(l.return===null||l.return===a)return;l=l.return}l.sibling.return=l.return,l=l.sibling}},gm=function(){},fg=function(r,a,l,u){var h=r.memoizedProps;if(h!==u){r=a.stateNode,xa(Mr.current);var g=null;switch(l){case"input":h=Ee(r,h),u=Ee(r,u),g=[];break;case"select":h=V({},h,{value:void 0}),u=V({},u,{value:void 0}),g=[];break;case"textarea":h=M(r,h),u=M(r,u),g=[];break;default:typeof h.onClick!="function"&&typeof u.onClick=="function"&&(r.onclick=Fl)}fn(l,u);var N;l=null;for(G in h)if(!u.hasOwnProperty(G)&&h.hasOwnProperty(G)&&h[G]!=null)if(G==="style"){var T=h[G];for(N in T)T.hasOwnProperty(N)&&(l||(l={}),l[N]="")}else G!=="dangerouslySetInnerHTML"&&G!=="children"&&G!=="suppressContentEditableWarning"&&G!=="suppressHydrationWarning"&&G!=="autoFocus"&&(i.hasOwnProperty(G)?g||(g=[]):(g=g||[]).push(G,null));for(G in u){var L=u[G];if(T=h?.[G],u.hasOwnProperty(G)&&L!==T&&(L!=null||T!=null))if(G==="style")if(T){for(N in T)!T.hasOwnProperty(N)||L&&L.hasOwnProperty(N)||(l||(l={}),l[N]="");for(N in L)L.hasOwnProperty(N)&&T[N]!==L[N]&&(l||(l={}),l[N]=L[N])}else l||(g||(g=[]),g.push(G,l)),l=L;else G==="dangerouslySetInnerHTML"?(L=L?L.__html:void 0,T=T?T.__html:void 0,L!=null&&T!==L&&(g=g||[]).push(G,L)):G==="children"?typeof L!="str
9ing"&&typeof L!="number"||(g=g||[]).push(G,""+L):G!=="suppressContentEditableWarning"&&G!=="suppressHydrationWarning"&&(i.hasOwnProperty(G)?(L!=null&&G==="onScroll"&&_t("scroll",r),g||T===L||(g=[])):(g=g||[]).push(G,L))}l&&(g=g||[]).push("style",l);var G=g;(a.updateQueue=G)&&(a.flags|=4)}},hg=function(r,a,l,u){l!==u&&(a.flags|=4)};function ji(r,a){if(!Rt)switch(r.tailMode){case"hidden":a=r.tail;for(var l=null;a!==null;)a.alternate!==null&&(l=a),a=a.sibling;l===null?r.tail=null:l.sibling=null;break;case"collapsed":l=r.tail;for(var u=null;l!==null;)l.alternate!==null&&(u=l),l=l.sibling;u===null?a||r.tail===null?r.tail=null:r.tail.sibling=null:u.sibling=null}}function us(r){var a=r.alternate!==null&&r.alternate.child===r.child,l=0,u=0;if(a)for(var h=r.child;h!==null;)l|=h.lanes|h.childLanes,u|=h.subtreeFlags&14680064,u|=h.flags&14680064,h.return=r,h=h.sibling;else for(h=r.child;h!==null;)l|=h.lanes|h.childLanes,u|=h.subtreeFlags,u|=h.flags,h.return=r,h=h.sibling;return r.subtreeFlags|=u,r.childLanes=l,a}function Kk(r,a,l){var u=a.pendingProps;switch($u(a),a.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return us(a),null;case 1:return Rs(a.type)&&Vl(),us(a),null;
vendor: 6,933 bytes, line 9
9case 3:return u=a.stateNode,Xa(),At(Ts),At(cs),Ju(),u.pendingContext&&(u.context=u.pendingContext,u.pendingContext=null),(r===null||r.child===null)&&(Wl(a)?a.flags|=4:r===null||r.memoizedState.isDehydrated&&(a.flags&256)===0||(a.flags|=1024,gr!==null&&(_m(gr),gr=null))),gm(r,a),us(a),null;case 5:Qu(a);var h=xa(xi.current);if(l=a.type,r!==null&&a.stateNode!=null)fg(r,a,l,u,h),r.ref!==a.ref&&(a.flags|=512,a.flags|=2097152);else{if(!u){if(a.stateNode===null)throw Error(n(166));return us(a),null}if(r=xa(Mr.current),Wl(a)){u=a.stateNode,l=a.type;var g=a.memoizedProps;switch(u[Pr]=a,u[ui]=g,r=(a.mode&1)!==0,l){case"dialog":_t("cancel",u),_t("close",u);break;case"iframe":case"object":case"embed":_t("load",u);break;case"video":case"audio":for(h=0;h<li.length;h++)_t(li[h],u);break;case"source":_t("error",u);break;case"img":case"image":case"link":_t("error",u),_t("load",u);break;case"details":_t("toggle",u);break;case"input":Ze(u,g),_t("invalid",u);break;case"select":u._wrapperState={wasMultiple:!!g.multiple},_t("invalid",u);break;case"textarea":W(u,g),_t("invalid",u)}fn(l,g),h=null;for(var N in g)if(g.hasOwnProperty(N)){var T=g[N];N==="children"?typeof T=="string"?u.textContent!==T&&(g.suppressHydrationWarning!==!0&&Ll(u.textContent,T,r),h=["children",T]):typeof T=="number"&&u.textContent!==""+T&&(g.suppressHydrationWarning!==!0&&Ll(u.textContent,T,r),h=["children",""+T]):i.hasOwnProperty(N)&&T!=null&&N==="onScroll"&&_t("scroll",u)}switch(l){case"input":pe(u),Ot(u,g,!0);break;case"textarea":pe(u),ge(u);break;case"select":case"option":break;default:typeof g.onClick=="function"&&(u.onclick=Fl)}u=h,a.updateQueue=u,u!==null&&(a.flags|=4)}else{N=h.nodeType===9?h:h.ownerDocument,r==="http://www.w3.org/1999/xhtml"&&(r=xe(l)),r==="http://www.w3.org/1999/xhtml"?l==="script"?(r=N.createElement("div"),r.innerHTML="<script><\/script>",r=r.removeChild(r.firstChild)):typeof u.is=="string"?r=N.createElement(l,{is:u.is}):(r=N.createElement(l),l==="select"&&(N=r,u.multiple?N.multiple=!0:u.size&&(N.size=u.size))):r=N.createElementNS(r,l),r[Pr]=a,r[ui]=u,mg(r,a,!1,!1),a.stateNode=r;e:{switch(N=la(l,u),l){case"dialog":_t("cancel",r),_t("close",r),h=u;break;case"iframe":case"object":case"embed":_t("load",r),h=u;break;case"video":case"audio":for(h=0;h<li.length;h++)_t(li[h],r);h=u;break;case"source":_t("error",r),h=u;break;case"img":case"image":case"link":_t("error",r),_t("load",r),h=u;break;case"details":_t("toggle",r),h=u;break;case"input":Ze(r,u),h=Ee(r,u),_t("invalid",r);break;case"option":h=u;break;case"select":r._wrapperState={wasMultiple:!!u.multiple},h=V({},u,{value:void 0}),_t("invalid",r);break;case"textarea":W(r,u),h=M(r,u),_t("invalid",r);break;default:h=u}fn(l,h),T=h;for(g in T)if(T.hasOwnProperty(g)){var L=T[g];g==="style"?mn(r,L):g==="dangerouslySetInnerHTML"?(L=L?L.__html:void 0,L!=null&&Je(r,L)):g==="children"?typeof L=="string"?(l!=="textarea"||L!=="")&&at(r,L):typeof L=="number"&&at(r,""+L):g!=="suppressContentEditableWarning"&&g!=="suppressHydrationWarning"&&g!=="autoFocus"&&(i.hasOwnProperty(g)?L!=null&&g==="onScroll"&&_t("scroll",r):L!=null&&A(r,g,L,N))}switch(l){case"input":pe(r),Ot(r,u,!1);break;case"textarea":pe(r),ge(r);break;case"option":u.value!=null&&r.setAttribute("value",""+De(u.value));break;case"select":r.multiple=!!u.multiple,g=u.value,g!=null?Mt(r,!!u.multiple,g,!1):u.defaultValue!=null&&Mt(r,!!u.multiple,u.defaultValue,!0);break;default:typeof h.onClick=="function"&&(r.onclick=Fl)}switch(l){case"button":case"input":case"select":case"textarea":u=!!u.autoFocus;break e;case"img":u=!0;break e;default:u=!1}}u&&(a.flags|=4)}a.ref!==null&&(a.flags|=512,a.flags|=2097152)}return us(a),null;case 6:if(r&&a.stateNode!=null)hg(r,a,r.memoizedProps,u);else{if(typeof u!="string"&&a.stateNode===null)throw Error(n(166));if(l=xa(xi.current),xa(Mr.current),Wl(a)){if(u=a.stateNode,l=a.memoizedProps,u[Pr]=a,(g=u.nodeValue!==l)&&(r=$s,r!==null))switch(r.tag){case 3:Ll(u.nodeValue,l,(r.mode&1)!==0);break;case 5:r.memoizedProps.suppressHydrationWarning!==!0&&Ll(u.nodeValue,l,(r.mode&1)!==0)}g&&(a.flags|=4)}else u=(l.nodeType===9?l:l.ownerDocument).createTextNode(u),u[Pr]=a,a.stateNode=u}return us(a),null;case 13:if(At(It),u=a.memoizedState,r===null||r.memoizedState!==null&&r.memoizedState.dehydrated!==null){if(Rt&&Vs!==null&&(a.mode&1)!==0&&(a.flags&128)===0)gx(),Ga(),a.flags|=98560,g=!1;else if(g=Wl(a),u!==null&&u.dehydrated!==null){if(r===null){if(!g)throw Error(n(318));if(g=a.memoizedState,g=g!==null?g.dehydrated:null,!g)throw Error(n(317));g[Pr]=a}else Ga(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;us(a),g=!1}else gr!==null&&(_m(gr),gr=null),g=!0;if(!g)return a.flags&65536?a:null}return(a.flags&128)!==0?(a.lanes=l,a):(u=u!==null,u!==(r!==null&&r.memoizedState!==null)&&u&&(a.child.flags|=8192,(a.mode&1)!==0&&(r===null||(It.current&1)!==0?Zt===0&&(Zt=3):Rm())),a.updateQueue!==null&&(a.flags|=4),us(a),null);case 4:return Xa(),gm(r,a),r===null&&ci(a.stateNode.containerInfo),us(a),null;case 10:return Wu(a.type._context),us(a),null;case 17:return Rs(a.type)&&Vl(),us(a),null;case 19:if(At(It),g=a.memoizedState,g===null)return us(a),null;if(u=(a.flags&128)!==0,N=g.rendering,N===null)if(u)ji(g,!1);else{if(Zt!==0||r!==null&&(r.flags&128)!==0)for(r=a.child;r!==null;){if(N=Yl(r),N!==null){for(a.flags|=128,ji(g,!1),u=N.updateQueue,u!==null&&(a.updateQueue=u,a.flags|=4),a.subtreeFlags=0,u=l,l=a.child;l!==null;)g=l,r=u,g.flags&=14680066,N=g.alternate,N===null?(g.childLanes=0,g.lanes=r,g.child=null,g.subtreeFlags=0,g.memoizedProps=null,g.memoizedState=null,g.updateQueue=null,g.dependencies=null,g.stateNode=null):(g.childLanes=N.childLanes,g.lanes=N.lanes,g.child=N.child,g.subtreeFlags=0,g.deletions=null,g.memoizedProps=N.memoizedProps,g.memoizedState=N.memoizedState,g.updateQueue=N.updateQueue,g.type=N.type,r=N.dependencies,g.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext}),l=l.sibling;return Et(It,It.current&1|2),a.child}r=r.sibling}g.tail!==null&&Ft()>ro&&(a.flags|=128,u=!0,ji(g,!1),a.lanes=4194304)}else{if(!u)if(r=Yl(N),r!==null){if(a.flags|=128,u=!0,l=r.updateQueue,l!==null&&(a.updateQueue=l,a.flags|=4),ji(g,!0),g.tail===null&&g.tailMode==="hidden"&&!N.alternate&&!Rt)return us(a),null}else 2*Ft()-g.renderingStartTime>ro&&l!==1073741824&&(a.flags|=128,u=!0,ji(g,!1),a.lanes=4194304);g.isBackwards?(N.sibling=a.child,a.child=N):(l=g.last,l!==null?l.sibling=N:a.child=N,g.last=N)}return g.tail!==null?(a=g.tail,g.rendering=a,g.tail=a.sibling,g.renderingStartTime=Ft(),a.sibling=null,l=It.current,Et(It,u?l&1|2:l&1),a):(us(a),null);case 22:case 23:return Tm(),u=a.memoizedState!==null,r!==null&&r.memoizedState!==null!==u&&(a.flags|=8192),u&&(a.mode&1)!==0?(zs&1073741824)!==0&&(us(a),a.subtreeFlags&6&&(a.flags|=8192)):us(a),null;case 24:return null;case 25:return null}throw Error(n(156,a.tag))}function qk(r,a){switch($u(a),a.tag){case 1:return Rs(a.type)&&Vl(),r=a.flags,r&65536?(a.flags=r&-65537|128,a):null;
vendor: 5,357 bytes, line 9
9case 3:return Xa(),At(Ts),At(cs),Ju(),r=a.flags,(r&65536)!==0&&(r&128)===0?(a.flags=r&-65537|128,a):null;case 5:return Qu(a),null;case 13:if(At(It),r=a.memoizedState,r!==null&&r.dehydrated!==null){if(a.alternate===null)throw Error(n(340));Ga()}return r=a.flags,r&65536?(a.flags=r&-65537|128,a):null;case 19:return At(It),null;case 4:return Xa(),null;case 10:return Wu(a.type._context),null;case 22:case 23:return Tm(),null;case 24:return null;default:return null}}var oc=!1,ms=!1,Zk=typeof WeakSet=="function"?WeakSet:Set,Te=null;function to(r,a){var l=r.ref;if(l!==null)if(typeof l=="function")try{l(null)}catch(u){Lt(r,a,u)}else l.current=null}function vm(r,a,l){try{l()}catch(u){Lt(r,a,u)}}var pg=!1;function Gk(r,a){if(Tu=Sl,r=qp(),wu(r)){if("selectionStart"in r)var l={start:r.selectionStart,end:r.selectionEnd};else e:{l=(l=r.ownerDocument)&&l.defaultView||window;var u=l.getSelection&&l.getSelection();if(u&&u.rangeCount!==0){l=u.anchorNode;var h=u.anchorOffset,g=u.focusNode;u=u.focusOffset;try{l.nodeType,g.nodeType}catch{l=null;break e}var N=0,T=-1,L=-1,G=0,de=0,he=r,ce=null;t:for(;;){for(var _e;he!==l||h!==0&&he.nodeType!==3||(T=N+h),he!==g||u!==0&&he.nodeType!==3||(L=N+u),he.nodeType===3&&(N+=he.nodeValue.length),(_e=he.firstChild)!==null;)ce=he,he=_e;for(;;){if(he===r)break t;if(ce===l&&++G===h&&(T=N),ce===g&&++de===u&&(L=N),(_e=he.nextSibling)!==null)break;he=ce,ce=he.parentNode}he=_e}l=T===-1||L===-1?null:{start:T,end:L}}else l=null}l=l||{start:0,end:0}}else l=null;for(Ru={focusedElem:r,selectionRange:l},Sl=!1,Te=a;Te!==null;)if(a=Te,r=a.child,(a.subtreeFlags&1028)!==0&&r!==null)r.return=a,Te=r;else for(;Te!==null;){a=Te;try{var Re=a.alternate;if((a.flags&1024)!==0)switch(a.tag){case 0:case 11:case 15:break;case 1:if(Re!==null){var Me=Re.memoizedProps,$t=Re.memoizedState,B=a.stateNode,$=B.getSnapshotBeforeUpdate(a.elementType===a.type?Me:vr(a.type,Me),$t);B.__reactInternalSnapshotBeforeUpdate=$}break;case 3:var K=a.stateNode.containerInfo;K.nodeType===1?K.textContent="":K.nodeType===9&&K.documentElement&&K.removeChild(K.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(ve){Lt(a,a.return,ve)}if(r=a.sibling,r!==null){r.return=a.return,Te=r;break}Te=a.return}return Re=pg,pg=!1,Re}function wi(r,a,l){var u=a.updateQueue;if(u=u!==null?u.lastEffect:null,u!==null){var h=u=u.next;do{if((h.tag&r)===r){var g=h.destroy;h.destroy=void 0,g!==void 0&&vm(a,l,g)}h=h.next}while(h!==u)}}function ic(r,a){if(a=a.updateQueue,a=a!==null?a.lastEffect:null,a!==null){var l=a=a.next;do{if((l.tag&r)===r){var u=l.create;l.destroy=u()}l=l.next}while(l!==a)}}function ym(r){var a=r.ref;if(a!==null){var l=r.stateNode;r.tag,r=l,typeof a=="function"?a(r):a.current=r}}function xg(r){var a=r.alternate;a!==null&&(r.alternate=null,xg(a)),r.child=null,r.deletions=null,r.sibling=null,r.tag===5&&(a=r.stateNode,a!==null&&(delete a[Pr],delete a[ui],delete a[Du],delete a[Rk],delete a[Pk])),r.stateNode=null,r.return=null,r.dependencies=null,r.memoizedProps=null,r.memoizedState=null,r.pendingProps=null,r.stateNode=null,r.updateQueue=null}function gg(r){return r.tag===5||r.tag===3||r.tag===4}function vg(r){e:for(;;){for(;r.sibling===null;){if(r.return===null||gg(r.return))return null;r=r.return}for(r.sibling.return=r.return,r=r.sibling;r.tag!==5&&r.tag!==6&&r.tag!==18;){if(r.flags&2||r.child===null||r.tag===4)continue e;r.child.return=r,r=r.child}if(!(r.flags&2))return r.stateNode}}function bm(r,a,l){var u=r.tag;if(u===5||u===6)r=r.stateNode,a?l.nodeType===8?l.parentNode.insertBefore(r,a):l.insertBefore(r,a):(l.nodeType===8?(a=l.parentNode,a.insertBefore(r,l)):(a=l,a.appendChild(r)),l=l._reactRootContainer,l!=null||a.onclick!==null||(a.onclick=Fl));else if(u!==4&&(r=r.child,r!==null))for(bm(r,a,l),r=r.sibling;r!==null;)bm(r,a,l),r=r.sibling}function jm(r,a,l){var u=r.tag;if(u===5||u===6)r=r.stateNode,a?l.insertBefore(r,a):l.appendChild(r);else if(u!==4&&(r=r.child,r!==null))for(jm(r,a,l),r=r.sibling;r!==null;)jm(r,a,l),r=r.sibling}var ns=null,yr=!1;function Tn(r,a,l){for(l=l.child;l!==null;)yg(r,a,l),l=l.sibling}function yg(r,a,l){if(Rr&&typeof Rr.onCommitFiberUnmount=="function")try{Rr.onCommitFiberUnmount(bl,l)}catch{}switch(l.tag){case 5:ms||to(l,a);case 6:var u=ns,h=yr;ns=null,Tn(r,a,l),ns=u,yr=h,ns!==null&&(yr?(r=ns,l=l.stateNode,r.nodeType===8?r.parentNode.removeChild(l):r.removeChild(l)):ns.removeChild(l.stateNode));break;case 18:ns!==null&&(yr?(r=ns,l=l.stateNode,r.nodeType===8?Iu(r.parentNode,l):r.nodeType===1&&Iu(r,l),ei(r)):Iu(ns,l.stateNode));break;case 4:u=ns,h=yr,ns=l.stateNode.containerInfo,yr=!0,Tn(r,a,l),ns=u,yr=h;break;case 0:case 11:case 14:case 15:if(!ms&&(u=l.updateQueue,u!==null&&(u=u.lastEffect,u!==null))){h=u=u.next;do{var g=h,N=g.destroy;g=g.tag,N!==void 0&&((g&2)!==0||(g&4)!==0)&&vm(l,a,N),h=h.next}while(h!==u)}Tn(r,a,l);break;case 1:if(!ms&&(to(l,a),u=l.stateNode,typeof u.componentWillUnmount=="function"))try{u.props=l.memoizedProps,u.state=l.memoizedState,u.componentWillUnmount()}catch(T){Lt(l,a,T)}Tn(r,a,l);break;case 21:Tn(r,a,l);break;case 22:l.mode&1?(ms=(u=ms)||l.memoizedState!==null,Tn(r,a,l),ms=u):Tn(r,a,l);break;default:Tn(r,a,l)}}function bg(r){var a=r.updateQueue;if(a!==null){r.updateQueue=null;var l=r.stateNode;l===null&&(l=r.stateNode=new Zk),a.forEach(function(u){var h=n2.bind(null,r,u);l.has(u)||(l.add(u),u.then(h,h))})}}
vendor: 14,559 bytes, line 9
9function br(r,a){var l=a.deletions;if(l!==null)for(var u=0;u<l.length;u++){var h=l[u];try{var g=r,N=a,T=N;e:for(;T!==null;){switch(T.tag){case 5:ns=T.stateNode,yr=!1;break e;case 3:ns=T.stateNode.containerInfo,yr=!0;break e;case 4:ns=T.stateNode.containerInfo,yr=!0;break e}T=T.return}if(ns===null)throw Error(n(160));yg(g,N,h),ns=null,yr=!1;var L=h.alternate;L!==null&&(L.return=null),h.return=null}catch(G){Lt(h,a,G)}}if(a.subtreeFlags&12854)for(a=a.child;a!==null;)jg(a,r),a=a.sibling}function jg(r,a){var l=r.alternate,u=r.flags;switch(r.tag){case 0:case 11:case 14:case 15:if(br(a,r),Dr(r),u&4){try{wi(3,r,r.return),ic(3,r)}catch(Me){Lt(r,r.return,Me)}try{wi(5,r,r.return)}catch(Me){Lt(r,r.return,Me)}}break;case 1:br(a,r),Dr(r),u&512&&l!==null&&to(l,l.return);break;case 5:if(br(a,r),Dr(r),u&512&&l!==null&&to(l,l.return),r.flags&32){var h=r.stateNode;try{at(h,"")}catch(Me){Lt(r,r.return,Me)}}if(u&4&&(h=r.stateNode,h!=null)){var g=r.memoizedProps,N=l!==null?l.memoizedProps:g,T=r.type,L=r.updateQueue;if(r.updateQueue=null,L!==null)try{T==="input"&&g.type==="radio"&&g.name!=null&&it(h,g),la(T,N);var G=la(T,g);for(N=0;N<L.length;N+=2){var de=L[N],he=L[N+1];de==="style"?mn(h,he):de==="dangerouslySetInnerHTML"?Je(h,he):de==="children"?at(h,he):A(h,de,he,G)}switch(T){case"input":yt(h,g);break;case"textarea":X(h,g);break;case"select":var ce=h._wrapperState.wasMultiple;h._wrapperState.wasMultiple=!!g.multiple;var _e=g.value;_e!=null?Mt(h,!!g.multiple,_e,!1):ce!==!!g.multiple&&(g.defaultValue!=null?Mt(h,!!g.multiple,g.defaultValue,!0):Mt(h,!!g.multiple,g.multiple?[]:"",!1))}h[ui]=g}catch(Me){Lt(r,r.return,Me)}}break;case 6:if(br(a,r),Dr(r),u&4){if(r.stateNode===null)throw Error(n(162));h=r.stateNode,g=r.memoizedProps;try{h.nodeValue=g}catch(Me){Lt(r,r.return,Me)}}break;case 3:if(br(a,r),Dr(r),u&4&&l!==null&&l.memoizedState.isDehydrated)try{ei(a.containerInfo)}catch(Me){Lt(r,r.return,Me)}break;case 4:br(a,r),Dr(r);break;case 13:br(a,r),Dr(r),h=r.child,h.flags&8192&&(g=h.memoizedState!==null,h.stateNode.isHidden=g,!g||h.alternate!==null&&h.alternate.memoizedState!==null||(km=Ft())),u&4&&bg(r);break;case 22:if(de=l!==null&&l.memoizedState!==null,r.mode&1?(ms=(G=ms)||de,br(a,r),ms=G):br(a,r),Dr(r),u&8192){if(G=r.memoizedState!==null,(r.stateNode.isHidden=G)&&!de&&(r.mode&1)!==0)for(Te=r,de=r.child;de!==null;){for(he=Te=de;Te!==null;){switch(ce=Te,_e=ce.child,ce.tag){case 0:case 11:case 14:case 15:wi(4,ce,ce.return);break;case 1:to(ce,ce.return);var Re=ce.stateNode;if(typeof Re.componentWillUnmount=="function"){u=ce,l=ce.return;try{a=u,Re.props=a.memoizedProps,Re.state=a.memoizedState,Re.componentWillUnmount()}catch(Me){Lt(u,l,Me)}}break;case 5:to(ce,ce.return);break;case 22:if(ce.memoizedState!==null){kg(he);continue}}_e!==null?(_e.return=ce,Te=_e):kg(he)}de=de.sibling}e:for(de=null,he=r;;){if(he.tag===5){if(de===null){de=he;try{h=he.stateNode,G?(g=h.style,typeof g.setProperty=="function"?g.setProperty("display","none","important"):g.display="none"):(T=he.stateNode,L=he.memoizedProps.style,N=L!=null&&L.hasOwnProperty("display")?L.display:null,T.style.display=As("display",N))}catch(Me){Lt(r,r.return,Me)}}}else if(he.tag===6){if(de===null)try{he.stateNode.nodeValue=G?"":he.memoizedProps}catch(Me){Lt(r,r.return,Me)}}else if((he.tag!==22&&he.tag!==23||he.memoizedState===null||he===r)&&he.child!==null){he.child.return=he,he=he.child;continue}if(he===r)break e;for(;he.sibling===null;){if(he.return===null||he.return===r)break e;de===he&&(de=null),he=he.return}de===he&&(de=null),he.sibling.return=he.return,he=he.sibling}}break;case 19:br(a,r),Dr(r),u&4&&bg(r);break;case 21:break;default:br(a,r),Dr(r)}}function Dr(r){var a=r.flags;if(a&2){try{e:{for(var l=r.return;l!==null;){if(gg(l)){var u=l;break e}l=l.return}throw Error(n(160))}switch(u.tag){case 5:var h=u.stateNode;u.flags&32&&(at(h,""),u.flags&=-33);var g=vg(r);jm(r,g,h);break;case 3:case 4:var N=u.stateNode.containerInfo,T=vg(r);bm(r,T,N);break;default:throw Error(n(161))}}catch(L){Lt(r,r.return,L)}r.flags&=-3}a&4096&&(r.flags&=-4097)}function Qk(r,a,l){Te=r,wg(r)}function wg(r,a,l){for(var u=(r.mode&1)!==0;Te!==null;){var h=Te,g=h.child;if(h.tag===22&&u){var N=h.memoizedState!==null||oc;if(!N){var T=h.alternate,L=T!==null&&T.memoizedState!==null||ms;T=oc;var G=ms;if(oc=N,(ms=L)&&!G)for(Te=h;Te!==null;)N=Te,L=N.child,N.tag===22&&N.memoizedState!==null?Cg(h):L!==null?(L.return=N,Te=L):Cg(h);for(;g!==null;)Te=g,wg(g),g=g.sibling;Te=h,oc=T,ms=G}Ng(r)}else(h.subtreeFlags&8772)!==0&&g!==null?(g.return=h,Te=g):Ng(r)}}function Ng(r){for(;Te!==null;){var a=Te;if((a.flags&8772)!==0){var l=a.alternate;try{if((a.flags&8772)!==0)switch(a.tag){case 0:case 11:case 15:ms||ic(5,a);break;case 1:var u=a.stateNode;if(a.flags&4&&!ms)if(l===null)u.componentDidMount();else{var h=a.elementType===a.type?l.memoizedProps:vr(a.type,l.memoizedProps);u.componentDidUpdate(h,l.memoizedState,u.__reactInternalSnapshotBeforeUpdate)}var g=a.updateQueue;g!==null&&kx(a,g,u);break;case 3:var N=a.updateQueue;if(N!==null){if(l=null,a.child!==null)switch(a.child.tag){case 5:l=a.child.stateNode;break;case 1:l=a.child.stateNode}kx(a,N,l)}break;case 5:var T=a.stateNode;if(l===null&&a.flags&4){l=T;var L=a.memoizedProps;switch(a.type){case"button":case"input":case"select":case"textarea":L.autoFocus&&l.focus();break;case"img":L.src&&(l.src=L.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(a.memoizedState===null){var G=a.alternate;if(G!==null){var de=G.memoizedState;if(de!==null){var he=de.dehydrated;he!==null&&ei(he)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}ms||a.flags&512&&ym(a)}catch(ce){Lt(a,a.return,ce)}}if(a===r){Te=null;break}if(l=a.sibling,l!==null){l.return=a.return,Te=l;break}Te=a.return}}function kg(r){for(;Te!==null;){var a=Te;if(a===r){Te=null;break}var l=a.sibling;if(l!==null){l.return=a.return,Te=l;break}Te=a.return}}function Cg(r){for(;Te!==null;){var a=Te;try{switch(a.tag){case 0:case 11:case 15:var l=a.return;try{ic(4,a)}catch(L){Lt(a,l,L)}break;case 1:var u=a.stateNode;if(typeof u.componentDidMount=="function"){var h=a.return;try{u.componentDidMount()}catch(L){Lt(a,h,L)}}var g=a.return;try{ym(a)}catch(L){Lt(a,g,L)}break;case 5:var N=a.return;try{ym(a)}catch(L){Lt(a,N,L)}}}catch(L){Lt(a,a.return,L)}if(a===r){Te=null;break}var T=a.sibling;if(T!==null){T.return=a.return,Te=T;break}Te=a.return}}var Yk=Math.ceil,lc=_.ReactCurrentDispatcher,wm=_.ReactCurrentOwner,rr=_.ReactCurrentBatchConfig,mt=0,es=null,Wt=null,as=0,zs=0,so=Cn(0),Zt=0,Ni=null,va=0,cc=0,Nm=0,ki=null,Ms=null,km=0,ro=1/0,en=null,dc=!1,Cm=null,Rn=null,uc=!1,Pn=null,mc=0,Ci=0,Sm=null,fc=-1,hc=0;function ys(){return(mt&6)!==0?Ft():fc!==-1?fc:fc=Ft()}function Mn(r){return(r.mode&1)===0?1:(mt&2)!==0&&as!==0?as&-as:Ik.transition!==null?(hc===0&&(hc=vp()),hc):(r=jt,r!==0||(r=window.event,r=r===void 0?16:Ep(r.type)),r)}function jr(r,a,l,u){if(50<Ci)throw Ci=0,Sm=null,Error(n(185));Go(r,l,u),((mt&2)===0||r!==es)&&(r===es&&((mt&2)===0&&(cc|=l),Zt===4&&In(r,as)),Is(r,u),l===1&&mt===0&&(a.mode&1)===0&&(ro=Ft()+500,Bl&&En()))}function Is(r,a){var l=r.callbackNode;IN(r,a);var u=Nl(r,r===es?as:0);if(u===0)l!==null&&pp(l),r.callbackNode=null,r.callbackPriority=0;else if(a=u&-u,r.callbackPriority!==a){if(l!=null&&pp(l),a===1)r.tag===0?Mk(Eg.bind(null,r)):mx(Eg.bind(null,r)),Ak(function(){(mt&6)===0&&En()}),l=null;else{switch(yp(u)){case 1:l=au;break;case 4:l=xp;break;case 16:l=yl;break;case 536870912:l=gp;break;default:l=yl}l=Dg(l,Sg.bind(null,r))}r.callbackPriority=a,r.callbackNode=l}}function Sg(r,a){if(fc=-1,hc=0,(mt&6)!==0)throw Error(n(327));var l=r.callbackNode;if(no()&&r.callbackNode!==l)return null;var u=Nl(r,r===es?as:0);if(u===0)return null;if((u&30)!==0||(u&r.expiredLanes)!==0||a)a=pc(r,u);else{a=u;var h=mt;mt|=2;var g=Ag();(es!==r||as!==a)&&(en=null,ro=Ft()+500,ba(r,a));do try{e2();break}catch(T){_g(r,T)}while(!0);Hu(),lc.current=g,mt=h,Wt!==null?a=0:(es=null,as=0,a=Zt)}if(a!==0){if(a===2&&(h=ou(r),h!==0&&(u=h,a=Em(r,h))),a===1)throw l=Ni,ba(r,0),In(r,u),Is(r,Ft()),l;if(a===6)In(r,u);else{if(h=r.current.alternate,(u&30)===0&&!Jk(h)&&(a=pc(r,u),a===2&&(g=ou(r),g!==0&&(u=g,a=Em(r,g))),a===1))throw l=Ni,ba(r,0),In(r,u),Is(r,Ft()),l;switch(r.finishedWork=h,r.finishedLanes=u,a){case 0:case 1:throw Error(n(345));case 2:ja(r,Ms,en);break;case 3:if(In(r,u),(u&130023424)===u&&(a=km+500-Ft(),10<a)){if(Nl(r,0)!==0)break;if(h=r.suspendedLanes,(h&u)!==u){ys(),r.pingedLanes|=r.suspendedLanes&h;break}r.timeoutHandle=Mu(ja.bind(null,r,Ms,en),a);break}ja(r,Ms,en);break;case 4:if(In(r,u),(u&4194240)===u)break;for(a=r.eventTimes,h=-1;0<u;){var N=31-pr(u);g=1<<N,N=a[N],N>h&&(h=N),u&=~g}if(u=h,u=Ft()-u,u=(120>u?120:480>u?480:1080>u?1080:1920>u?1920:3e3>u?3e3:4320>u?4320:1960*Yk(u/1960))-u,10<u){r.timeoutHandle=Mu(ja.bind(null,r,Ms,en),u);break}ja(r,Ms,en);break;case 5:ja(r,Ms,en);break;default:throw Error(n(329))}}}return Is(r,Ft()),r.callbackNode===l?Sg.bind(null,r):null}function Em(r,a){var l=ki;return r.current.memoizedState.isDehydrated&&(ba(r,a).flags|=256),r=pc(r,a),r!==2&&(a=Ms,Ms=l,a!==null&&_m(a)),r}function _m(r){Ms===null?Ms=r:Ms.push.apply(Ms,r)}function Jk(r){for(var a=r;;){if(a.flags&16384){var l=a.updateQueue;if(l!==null&&(l=l.stores,l!==null))for(var u=0;u<l.length;u++){var h=l[u],g=h.getSnapshot;h=h.value;try{if(!xr(g(),h))return!1}catch{return!1}}}if(l=a.child,a.subtreeFlags&16384&&l!==null)l.return=a,a=l;else{if(a===r)break;for(;a.sibling===null;){if(a.return===null||a.return===r)return!0;a=a.return}a.sibling.return=a.return,a=a.sibling}}return!0}function In(r,a){for(a&=~Nm,a&=~cc,r.suspendedLanes|=a,r.pingedLanes&=~a,r=r.expirationTimes;0<a;){var l=31-pr(a),u=1<<l;r[l]=-1,a&=~u}}function Eg(r){if((mt&6)!==0)throw Error(n(327));no();var a=Nl(r,0);if((a&1)===0)return Is(r,Ft()),null;var l=pc(r,a);if(r.tag!==0&&l===2){var u=ou(r);u!==0&&(a=u,l=Em(r,u))}if(l===1)throw l=Ni,ba(r,0),In(r,a),Is(r,Ft()),l;if(l===6)throw Error(n(345));return r.finishedWork=r.current.alternate,r.finishedLanes=a,ja(r,Ms,en),Is(r,Ft()),null}function Am(r,a){var l=mt;mt|=1;try{return r(a)}finally{mt=l,mt===0&&(ro=Ft()+500,Bl&&En())}}function ya(r){Pn!==null&&Pn.tag===0&&(mt&6)===0&&no();var a=mt;mt|=1;var l=rr.transition,u=jt;try{if(rr.transition=null,jt=1,r)return r()}finally{jt=u,rr.transition=l,mt=a,(mt&6)===0&&En()}}function Tm(){zs=so.current,At(so)}function ba(r,a){r.finishedWork=null,r.finishedLanes=0;var l=r.timeoutHandle;if(l!==-1&&(r.timeoutHandle=-1,_k(l)),Wt!==null)for(l=Wt.return;l!==null;){var u=l;switch($u(u),u.tag){case 1:u=u.type.childContextTypes,u!=null&&Vl();break;case 3:Xa(),At(Ts),At(cs),Ju();break;case 5:Qu(u);break;case 4:Xa();break;case 13:At(It);break;case 19:At(It);break;case 10:Wu(u.type._context);break;case 22:case 23:Tm()}l=l.return}if(es=r,Wt=r=Dn(r.current,null),as=zs=a,Zt=0,Ni=null,Nm=cc=va=0,Ms=ki=null,pa!==null){for(a=0;a<pa.length;a++)if(l=pa[a],u=l.interleaved,u!==null){l.interleaved=null;var h=u.next,g=l.pending;if(g!==null){var N=g.next;g.next=h,u.next=N}l.pending=u}pa=null}return r}function _g(r,a){do{var l=Wt;try{if(Hu(),Jl.current=sc,Xl){for(var u=Dt.memoizedState;u!==null;){var h=u.queue;h!==null&&(h.pending=null),u=u.next}Xl=!1}if(ga=0,Xt=qt=Dt=null,gi=!1,vi=0,wm.current=null,l===null||l.return===null){Zt=1,Ni=a,Wt=null;break}e:{var g=r,N=l.return,T=l,L=a;if(a=as,T.flags|=32768,L!==null&&typeof L=="object"&&typeof L.then=="function"){var G=L,de=T,he=de.tag;if((de.mode&1)===0&&(he===0||he===11||he===15)){var ce=de.alternate;ce?(de.updateQueue=ce.updateQueue,de.memoizedState=ce.memoizedState,de.lanes=ce.lanes):(de.updateQueue=null,de.memoizedState=null)}var _e=Xx(N);if(_e!==null){_e.flags&=-257,eg(_e,N,T,g,a),_e.mode&1&&Jx(g,G,a),a=_e,L=G;var Re=a.updateQueue;if(Re===null){var Me=new Set;Me.add(L),a.updateQueue=Me}else Re.add(L);break e}else{if((a&1)===0){Jx(g,G,a),Rm();break e}L=Error(n(426))}}else if(Rt&&T.mode&1){var $t=Xx(N);if($t!==null){($t.flags&65536)===0&&($t.flags|=256),eg($t,N,T,g,a),Bu(eo(L,T));break e}}g=L=eo(L,T),Zt!==4&&(Zt=2),ki===null?ki=[g]:ki.push(g),g=N;do{switch(g.tag){case 3:g.flags|=65536,a&=-a,g.lanes|=a;var B=Qx(g,L,a);Nx(g,B);break e;case 1:T=L;var $=g.type,K=g.stateNode;if((g.flags&128)===0&&(typeof $.getDerivedStateFromError=="function"||K!==null&&typeof K.componentDidCatch=="function"&&(Rn===null||!Rn.has(K)))){g.flags|=65536,a&=-a,g.lanes|=a;var ve=Yx(g,T,a);Nx(g,ve);break e}}g=g.return}while(g!==null)}Rg(l)}catch(Oe){a=Oe,Wt===l&&l!==null&&(Wt=l=l.return);continue}break}while(!0)}function Ag(){var r=lc.current;return lc.current=sc,r===null?sc:r}function Rm(){(Zt===0||Zt===3||Zt===2)&&(Zt=4),es===null||(va&268435455)===0&&(cc&268435455)===0||In(es,as)}function pc(r,a){var l=mt;mt|=2;var u=Ag();(es!==r||as!==a)&&(en=null,ba(r,a));do try{Xk();break}catch(h){_g(r,h)}while(!0);if(Hu(),mt=l,lc.current=u,Wt!==null)throw Error(n(261));return es=null,as=0,Zt}function Xk(){for(;Wt!==null;)Tg(Wt)}function e2(){for(;Wt!==null&&!CN();)Tg(Wt)}function Tg(r){var a=Ig(r.alternate,r,zs);r.memoizedProps=r.pendingProps,a===null?Rg(r):Wt=a,wm.current=null}function Rg(r){var a=r;do{var l=a.alternate;if(r=a.return,(a.flags&32768)===0){if(l=Kk(l,a,zs),l!==null){Wt=l;return}}else{if(l=qk(l,a),l!==null){l.flags&=32767,Wt=l;return}if(r!==null)r.flags|=32768,r.subtreeFlags=0,r.deletions=null;else{Zt=6,Wt=null;return}}if(a=a.sibling,a!==null){Wt=a;return}Wt=a=r}while(a!==null);Zt===0&&(Zt=5)}function ja(r,a,l){var u=jt,h=rr.transition;try{rr.transition=null,jt=1,t2(r,a,l,u)}finally{rr.transition=h,jt=u}return null}function t2(r,a,l,u){do no();while(Pn!==null);if((mt&6)!==0)throw Error(n(327));l=r.finishedWork;var h=r.finishedLanes;if(l===null)return null;if(r.finishedWork=null,r.finishedLanes=0,l===r.current)throw Error(n(177));r.callbackNode=null,r.callbackPriority=0;var g=l.lanes|l.childLanes;if(DN(r,g),r===es&&(Wt=es=null,as=0),(l.subtreeFlags&2064)===0&&(l.flags&2064)===0||uc||(uc=!0,Dg(yl,function(){return no(),null})),g=(l.flags&15990)!==0,(l.subtreeFlags&15990)!==0||g){g=rr.transition,rr.transition=null;var N=jt;jt=1;var T=mt;mt|=4,wm.current=null,Gk(r,l),jg(l,r),jk(Ru),Sl=!!Tu,Ru=Tu=null,r.current=l,Qk(l),SN(),mt=T,jt=N,rr.transition=g}else r.current=l;if(uc&&(uc=!1,Pn=r,mc=h),g=r.pendingLanes,g===0&&(Rn=null),AN(l.stateNode),Is(r,Ft()),a!==null)for(u=r.onRecoverableError,l=0;l<a.length;l++)h=a[l],u(h.value,{componentStack:h.stack,digest:h.digest});if(dc)throw dc=!1,r=Cm,Cm=null,r;return(mc&1)!==0&&r.tag!==0&&no(),g=r.pendingLanes,(g&1)!==0?r===Sm?Ci++:(Ci=0,Sm=r):Ci=0,En(),null}function no(){if(Pn!==null){var r=yp(mc),a=rr.transition,l=jt;
vendor: 10,550 bytes, line 9
9try{if(rr.transition=null,jt=16>r?16:r,Pn===null)var u=!1;else{if(r=Pn,Pn=null,mc=0,(mt&6)!==0)throw Error(n(331));var h=mt;for(mt|=4,Te=r.current;Te!==null;){var g=Te,N=g.child;if((Te.flags&16)!==0){var T=g.deletions;if(T!==null){for(var L=0;L<T.length;L++){var G=T[L];for(Te=G;Te!==null;){var de=Te;switch(de.tag){case 0:case 11:case 15:wi(8,de,g)}var he=de.child;if(he!==null)he.return=de,Te=he;else for(;Te!==null;){de=Te;var ce=de.sibling,_e=de.return;if(xg(de),de===G){Te=null;break}if(ce!==null){ce.return=_e,Te=ce;break}Te=_e}}}var Re=g.alternate;if(Re!==null){var Me=Re.child;if(Me!==null){Re.child=null;do{var $t=Me.sibling;Me.sibling=null,Me=$t}while(Me!==null)}}Te=g}}if((g.subtreeFlags&2064)!==0&&N!==null)N.return=g,Te=N;else e:for(;Te!==null;){if(g=Te,(g.flags&2048)!==0)switch(g.tag){case 0:case 11:case 15:wi(9,g,g.return)}var B=g.sibling;if(B!==null){B.return=g.return,Te=B;break e}Te=g.return}}var $=r.current;for(Te=$;Te!==null;){N=Te;var K=N.child;if((N.subtreeFlags&2064)!==0&&K!==null)K.return=N,Te=K;else e:for(N=$;Te!==null;){if(T=Te,(T.flags&2048)!==0)try{switch(T.tag){case 0:case 11:case 15:ic(9,T)}}catch(Oe){Lt(T,T.return,Oe)}if(T===N){Te=null;break e}var ve=T.sibling;if(ve!==null){ve.return=T.return,Te=ve;break e}Te=T.return}}if(mt=h,En(),Rr&&typeof Rr.onPostCommitFiberRoot=="function")try{Rr.onPostCommitFiberRoot(bl,r)}catch{}u=!0}return u}finally{jt=l,rr.transition=a}}return!1}function Pg(r,a,l){a=eo(l,a),a=Qx(r,a,1),r=An(r,a,1),a=ys(),r!==null&&(Go(r,1,a),Is(r,a))}function Lt(r,a,l){if(r.tag===3)Pg(r,r,l);else for(;a!==null;){if(a.tag===3){Pg(a,r,l);break}else if(a.tag===1){var u=a.stateNode;if(typeof a.type.getDerivedStateFromError=="function"||typeof u.componentDidCatch=="function"&&(Rn===null||!Rn.has(u))){r=eo(l,r),r=Yx(a,r,1),a=An(a,r,1),r=ys(),a!==null&&(Go(a,1,r),Is(a,r));break}}a=a.return}}function s2(r,a,l){var u=r.pingCache;u!==null&&u.delete(a),a=ys(),r.pingedLanes|=r.suspendedLanes&l,es===r&&(as&l)===l&&(Zt===4||Zt===3&&(as&130023424)===as&&500>Ft()-km?ba(r,0):Nm|=l),Is(r,a)}function Mg(r,a){a===0&&((r.mode&1)===0?a=1:(a=wl,wl<<=1,(wl&130023424)===0&&(wl=4194304)));var l=ys();r=Yr(r,a),r!==null&&(Go(r,a,l),Is(r,l))}function r2(r){var a=r.memoizedState,l=0;a!==null&&(l=a.retryLane),Mg(r,l)}function n2(r,a){var l=0;switch(r.tag){case 13:var u=r.stateNode,h=r.memoizedState;h!==null&&(l=h.retryLane);break;case 19:u=r.stateNode;break;default:throw Error(n(314))}u!==null&&u.delete(a),Mg(r,l)}var Ig;Ig=function(r,a,l){if(r!==null)if(r.memoizedProps!==a.pendingProps||Ts.current)Ps=!0;else{if((r.lanes&l)===0&&(a.flags&128)===0)return Ps=!1,Wk(r,a,l);Ps=(r.flags&131072)!==0}else Ps=!1,Rt&&(a.flags&1048576)!==0&&fx(a,Hl,a.index);switch(a.lanes=0,a.tag){case 2:var u=a.type;ac(r,a),r=a.pendingProps;var h=Ka(a,cs.current);Ja(a,l),h=tm(null,a,u,r,h,l);var g=sm();return a.flags|=1,typeof h=="object"&&h!==null&&typeof h.render=="function"&&h.$$typeof===void 0?(a.tag=1,a.memoizedState=null,a.updateQueue=null,Rs(u)?(g=!0,zl(a)):g=!1,a.memoizedState=h.state!==null&&h.state!==void 0?h.state:null,Zu(a),h.updater=rc,a.stateNode=h,h._reactInternals=a,lm(a,u,r,l),a=mm(null,a,u,!0,g,l)):(a.tag=0,Rt&&g&&Fu(a),vs(null,a,h,l),a=a.child),a;case 16:u=a.elementType;e:{switch(ac(r,a),r=a.pendingProps,h=u._init,u=h(u._payload),a.type=u,h=a.tag=o2(u),r=vr(u,r),h){case 0:a=um(null,a,u,r,l);break e;case 1:a=og(null,a,u,r,l);break e;case 11:a=tg(null,a,u,r,l);break e;case 14:a=sg(null,a,u,vr(u.type,r),l);break e}throw Error(n(306,u,""))}return a;case 0:return u=a.type,h=a.pendingProps,h=a.elementType===u?h:vr(u,h),um(r,a,u,h,l);case 1:return u=a.type,h=a.pendingProps,h=a.elementType===u?h:vr(u,h),og(r,a,u,h,l);case 3:e:{if(ig(a),r===null)throw Error(n(387));u=a.pendingProps,g=a.memoizedState,h=g.element,wx(r,a),Ql(a,u,null,l);var N=a.memoizedState;if(u=N.element,g.isDehydrated)if(g={element:u,isDehydrated:!1,cache:N.cache,pendingSuspenseBoundaries:N.pendingSuspenseBoundaries,transitions:N.transitions},a.updateQueue.baseState=g,a.memoizedState=g,a.flags&256){h=eo(Error(n(423)),a),a=lg(r,a,u,l,h);break e}else if(u!==h){h=eo(Error(n(424)),a),a=lg(r,a,u,l,h);break e}else for(Vs=kn(a.stateNode.containerInfo.firstChild),$s=a,Rt=!0,gr=null,l=bx(a,null,u,l),a.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling;else{if(Ga(),u===h){a=Xr(r,a,l);break e}vs(r,a,u,l)}a=a.child}return a;case 5:return Cx(a),r===null&&zu(a),u=a.type,h=a.pendingProps,g=r!==null?r.memoizedProps:null,N=h.children,Pu(u,h)?N=null:g!==null&&Pu(u,g)&&(a.flags|=32),ag(r,a),vs(r,a,N,l),a.child;case 6:return r===null&&zu(a),null;case 13:return cg(r,a,l);case 4:return Gu(a,a.stateNode.containerInfo),u=a.pendingProps,r===null?a.child=Qa(a,null,u,l):vs(r,a,u,l),a.child;case 11:return u=a.type,h=a.pendingProps,h=a.elementType===u?h:vr(u,h),tg(r,a,u,h,l);case 7:return vs(r,a,a.pendingProps,l),a.child;case 8:return vs(r,a,a.pendingProps.children,l),a.child;case 12:return vs(r,a,a.pendingProps.children,l),a.child;case 10:e:{if(u=a.type._context,h=a.pendingProps,g=a.memoizedProps,N=h.value,Et(ql,u._currentValue),u._currentValue=N,g!==null)if(xr(g.value,N)){if(g.children===h.children&&!Ts.current){a=Xr(r,a,l);break e}}else for(g=a.child,g!==null&&(g.return=a);g!==null;){var T=g.dependencies;if(T!==null){N=g.child;for(var L=T.firstContext;L!==null;){if(L.context===u){if(g.tag===1){L=Jr(-1,l&-l),L.tag=2;var G=g.updateQueue;if(G!==null){G=G.shared;var de=G.pending;de===null?L.next=L:(L.next=de.next,de.next=L),G.pending=L}}g.lanes|=l,L=g.alternate,L!==null&&(L.lanes|=l),Ku(g.return,l,a),T.lanes|=l;break}L=L.next}}else if(g.tag===10)N=g.type===a.type?null:g.child;else if(g.tag===18){if(N=g.return,N===null)throw Error(n(341));N.lanes|=l,T=N.alternate,T!==null&&(T.lanes|=l),Ku(N,l,a),N=g.sibling}else N=g.child;if(N!==null)N.return=g;else for(N=g;N!==null;){if(N===a){N=null;break}if(g=N.sibling,g!==null){g.return=N.return,N=g;break}N=N.return}g=N}vs(r,a,h.children,l),a=a.child}return a;case 9:return h=a.type,u=a.pendingProps.children,Ja(a,l),h=tr(h),u=u(h),a.flags|=1,vs(r,a,u,l),a.child;case 14:return u=a.type,h=vr(u,a.pendingProps),h=vr(u.type,h),sg(r,a,u,h,l);case 15:return rg(r,a,a.type,a.pendingProps,l);case 17:return u=a.type,h=a.pendingProps,h=a.elementType===u?h:vr(u,h),ac(r,a),a.tag=1,Rs(u)?(r=!0,zl(a)):r=!1,Ja(a,l),Zx(a,u,h),lm(a,u,h,l),mm(null,a,u,!0,r,l);case 19:return ug(r,a,l);case 22:return ng(r,a,l)}throw Error(n(156,a.tag))};function Dg(r,a){return vl(r,a)}function a2(r,a,l,u){this.tag=r,this.key=l,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=a,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=u,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function nr(r,a,l,u){return new a2(r,a,l,u)}function Pm(r){return r=r.prototype,!(!r||!r.isReactComponent)}function o2(r){if(typeof r=="function")return Pm(r)?1:0;if(r!=null){if(r=r.$$typeof,r===ee)return 11;if(r===le)return 14}return 2}function Dn(r,a){var l=r.alternate;return l===null?(l=nr(r.tag,a,r.key,r.mode),l.elementType=r.elementType,l.type=r.type,l.stateNode=r.stateNode,l.alternate=r,r.alternate=l):(l.pendingProps=a,l.type=r.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=r.flags&14680064,l.childLanes=r.childLanes,l.lanes=r.lanes,l.child=r.child,l.memoizedProps=r.memoizedProps,l.memoizedState=r.memoizedState,l.updateQueue=r.updateQueue,a=r.dependencies,l.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext},l.sibling=r.sibling,l.index=r.index,l.ref=r.ref,l}function xc(r,a,l,u,h,g){var N=2;if(u=r,typeof r=="function")Pm(r)&&(N=1);else if(typeof r=="string")N=5;else e:switch(r){case F:return wa(l.children,h,g,a);case P:N=8,h|=8;break;case Z:return r=nr(12,l,a,h|2),r.elementType=Z,r.lanes=g,r;case se:return r=nr(13,l,a,h),r.elementType=se,r.lanes=g,r;case I:return r=nr(19,l,a,h),r.elementType=I,r.lanes=g,r;case J:return gc(l,h,g,a);default:if(typeof r=="object"&&r!==null)switch(r.$$typeof){case z:N=10;break e;case te:N=9;break e;case ee:N=11;break e;case le:N=14;break e;case ne:N=16,u=null;break e}throw Error(n(130,r==null?r:typeof r,""))}return a=nr(N,l,a,h),a.elementType=r,a.type=u,a.lanes=g,a}function wa(r,a,l,u){return r=nr(7,r,u,a),r.lanes=l,r}function gc(r,a,l,u){return r=nr(22,r,u,a),r.elementType=J,r.lanes=l,r.stateNode={isHidden:!1},r}function Mm(r,a,l){return r=nr(6,r,null,a),r.lanes=l,r}function Im(r,a,l){return a=nr(4,r.children!==null?r.children:[],r.key,a),a.lanes=l,a.stateNode={containerInfo:r.containerInfo,pendingChildren:null,implementation:r.implementation},a}function i2(r,a,l,u,h){this.tag=a,this.containerInfo=r,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=iu(0),this.expirationTimes=iu(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=iu(0),this.identifierPrefix=u,this.onRecoverableError=h,this.mutableSourceEagerHydrationData=null}function Dm(r,a,l,u,h,g,N,T,L){return r=new i2(r,a,l,T,L),a===1?(a=1,g===!0&&(a|=8)):a=0,g=nr(3,null,null,a),r.current=g,g.stateNode=r,g.memoizedState={element:u,isDehydrated:l,cache:null,transitions:null,pendingSuspenseBoundaries:null},Zu(g),r}function l2(r,a,l){var u=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:O,key:u==null?null:""+u,children:r,containerInfo:a,implementation:l}}function Og(r){if(!r)return Sn;r=r._reactInternals;e:{if(Kr(r)!==r||r.tag!==1)throw Error(n(170));var a=r;do{switch(a.tag){case 3:a=a.stateNode.context;break e;case 1:if(Rs(a.type)){a=a.stateNode.__reactInternalMemoizedMergedChildContext;break e}}a=a.return}while(a!==null);throw Error(n(171))}if(r.tag===1){var l=r.type;if(Rs(l))return dx(r,l,a)}return a}function Lg(r,a,l,u,h,g,N,T,L){return r=Dm(l,u,!0,r,h,g,N,T,L),r.context=Og(null),l=r.current,u=ys(),h=Mn(l),g=Jr(u,h),g.callback=a??null,An(l,g,h),r.current.lanes=h,Go(r,h,u),Is(r,u),r}function vc(r,a,l,u){var h=a.current,g=ys(),N=Mn(h);return l=Og(l),a.context===null?a.context=l:a.pendingContext=l,a=Jr(g,N),a.payload={element:r},u=u===void 0?null:u,u!==null&&(a.callback=u),r=An(h,a,N),r!==null&&(jr(r,h,N,g),Gl(r,h,N)),N}function yc(r){return r=r.current,r.child?(r.child.tag===5,r.child.stateNode):null}function Fg(r,a){if(r=r.memoizedState,r!==null&&r.dehydrated!==null){var l=r.retryLane;r.retryLane=l!==0&&l<a?l:a}}
9function Om(r,a){Fg(r,a),(r=r.alternate)&&Fg(r,a)}function c2(){return null}var $g=typeof reportError=="function"?reportError:function(r){console.error(r)};function Lm(r){this._internalRoot=r}bc.prototype.render=Lm.prototype.render=function(r){var a=this._internalRoot;if(a===null)throw Error(n(409));vc(r,a,null,null)},bc.prototype.unmount=Lm.prototype.unmount=function(){var r=this._internalRoot;if(r!==null){this._internalRoot=null;var a=r.containerInfo;ya(function(){vc(null,r,null,null)}),a[qr]=null}};function bc(r){this._internalRoot=r}bc.prototype.unstable_scheduleHydration=function(r){if(r){var a=wp();r={blockedOn:null,target:r,priority:a};for(var l=0;l<jn.length&&a!==0&&a<jn[l].priority;l++);jn.splice(l,0,r),l===0&&Cp(r)}};function Fm(r){return!(!r||r.nodeType!==1&&r.nodeType!==9&&r.nodeType!==11)}function jc(r){return!(!r||r.nodeType!==1&&r.nodeType!==9&&r.nodeType!==11&&(r.nodeType!==8||r.nodeValue!==" react-mount-point-unstable "))}function Vg(){}function d2(r,a,l,u,h){if(h){if(typeof u=="function"){var g=u;u=function(){var G=yc(N);g.call(G)}}var N=Lg(a,u,r,0,null,!1,!1,"",Vg);return r._reactRootContainer=N,r[qr]=N.current,ci(r.nodeType===8?r.parentNode:r),ya(),N}for(;h=r.lastChild;)r.removeChild(h);if(typeof u=="function"){var T=u;u=function(){var G=yc(L);T.call(G)}}var L=Dm(r,0,!1,null,null,!1,!1,"",Vg);return r._reactRootContainer=L,r[qr]=L.current,ci(r.nodeType===8?r.parentNode:r),ya(function(){vc(a,L,l,u)}),L}function wc(r,a,l,u,h){var g=l._reactRootContainer;if(g){var N=g;if(typeof h=="function"){var T=h;h=function(){var L=yc(N);T.call(L)}}vc(a,N,r,h)}else N=d2(l,a,r,h,u);return yc(N)}bp=function(r){switch(r.tag){case 3:var a=r.stateNode;if(a.current.memoizedState.isDehydrated){var l=Zo(a.pendingLanes);l!==0&&(lu(a,l|1),Is(a,Ft()),(mt&6)===0&&(ro=Ft()+500,En()))}break;case 13:ya(function(){var u=Yr(r,1);if(u!==null){var h=ys();jr(u,r,1,h)}}),Om(r,1)}},cu=function(r){if(r.tag===13){var a=Yr(r,134217728);if(a!==null){var l=ys();jr(a,r,134217728,l)}Om(r,134217728)}},jp=function(r){if(r.tag===13){var a=Mn(r),l=Yr(r,a);if(l!==null){var u=ys();jr(l,r,a,u)}Om(r,a)}},wp=function(){return jt},Np=function(r,a){var l=jt;try{return jt=r,a()}finally{jt=l}},Uo=function(r,a,l){switch(a){case"input":if(yt(r,l),a=l.name,l.type==="radio"&&a!=null){for(l=r;l.parentNode;)l=l.parentNode;for(l=l.querySelectorAll("input[name="+JSON.stringify(""+a)+'][type="radio"]'),a=0;a<l.length;a++){var u=l[a];if(u!==r&&u.form===r.form){var h=$l(u);if(!h)throw Error(n(90));je(u),yt(u,h)}}}break;case"textarea":X(r,l);break;case"select":a=l.value,a!=null&&Mt(r,!!l.multiple,a,!1)}},H=Am,ke=ya;var u2={usingClientEntryPoint:!1,Events:[mi,Ha,$l,pl,xl,Am]},Si={findFiberByHostInstance:ua,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},m2={bundleType:Si.bundleType,version:Si.version,rendererPackageName:Si.rendererPackageName,rendererConfig:Si.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:_.ReactCurrentDispatcher,findHostInstanceByFiber:function(r){return r=qo(r),r===null?null:r.stateNode},findFiberByHostInstance:Si.findFiberByHostInstance||c2,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 Nc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Nc.isDisabled&&Nc.supportsFiber)try{bl=Nc.inject(m2),Rr=Nc}catch{}}return Ds.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=u2,Ds.createPortal=function(r,a){var l=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Fm(a))throw Error(n(200));return l2(r,a,null,l)},Ds.createRoot=function(r,a){if(!Fm(r))throw Error(n(299));var l=!1,u="",h=$g;return a!=null&&(a.unstable_strictMode===!0&&(l=!0),a.identifierPrefix!==void 0&&(u=a.identifierPrefix),a.onRecoverableError!==void 0&&(h=a.onRecoverableError)),a=Dm(r,1,!1,null,null,l,!1,u,h),r[qr]=a.current,ci(r.nodeType===8?r.parentNode:r),new Lm(a)},Ds.findDOMNode=function(r){if(r==null)return null;if(r.nodeType===1)return r;var a=r._reactInternals;if(a===void 0)throw typeof r.render=="function"?Error(n(188)):(r=Object.keys(r).join(","),Error(n(268,r)));return r=qo(a),r=r===null?null:r.stateNode,r},Ds.flushSync=function(r){return ya(r)},Ds.hydrate=function(r,a,l){if(!jc(a))throw Error(n(200));return wc(null,r,a,!0,l)},Ds.hydrateRoot=function(r,a,l){if(!Fm(r))throw Error(n(405));var u=l!=null&&l.hydratedSources||null,h=!1,g="",N=$g;if(l!=null&&(l.unstable_strictMode===!0&&(h=!0),l.identifierPrefix!==void 0&&(g=l.identifierPrefix),l.onRecoverableError!==void 0&&(N=l.onRecoverableError)),a=Lg(a,null,r,1,l??null,h,!1,g,N),r[qr]=a.current,ci(r),u)for(r=0;r<u.length;r++)l=u[r],h=l._getVersion,h=h(l._source),a.mutableSourceEagerHydrationData==null?a.mutableSourceEagerHydrationData=[l,h]:a.mutableSourceEagerHydrationData.push(l,h);return new bc(a)},Ds.render=function(r,a,l){if(!jc(a))throw Error(n(200));return wc(null,r,a,!1,l)},Ds.unmountComponentAtNode=function(r){if(!jc(r))throw Error(n(40));return r._reactRootContainer?(ya(function(){wc(null,null,r,!1,function(){r._reactRootContainer=null,r[qr]=null})}),!0):!1},Ds.unstable_batchedUpdates=Am,Ds.unstable_renderSubtreeIntoContainer=function(r,a,l,u){if(!jc(l))throw Error(n(200));if(r==null||r._reactInternals===void 0)throw Error(n(38));return wc(r,a,l,!1,u)},Ds.version="18.3.1-next-f1338f8080-20240426",Ds}var Zg;function H0(){if(Zg)return zm.exports;Zg=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(s){console.error(s)}}return t(),zm.exports=b2(),zm.exports}var Gg;function j2(){if(Gg)return kc;Gg=1;var t=H0();return kc.createRoot=t.createRoot,kc.hydrateRoot=t.hydrateRoot,kc}var w2=j2(),p=wd();const We=U0(p),W0=h2({__proto__:null,default:We},[p]);function N2(t,s){if(t instanceof RegExp)return{keys:!1,pattern:t};var n,o,i,c,d=[],m="",f=t.split("/");for(f[0]||f.shift();i=f.shift();)n=i[0],n==="*"?(d.push(n),m+=i[1]==="?"?"(?:/(.*))?":"/(.*)"):n===":"?(o=i.indexOf("?",1),c=i.indexOf(".",1),d.push(i.substring(1,~o?o:~c?c:i.length)),m+=~o&&!~c?"(?:/([^/]+?))?":"/([^/]+?)",~c&&(m+=(~o?"?":"")+"\\"+i.substring(c))):m+="/"+i;return{keys:d,pattern:new RegExp("^"+m+(s?"(?=$|/)":"/?$"),"i")}}var Hm={exports:{}},Wm={};var Qg;function k2(){if(Qg)return Wm;Qg=1;var t=wd();function s(y,b){return y===b&&(y!==0||1/y===1/b)||y!==y&&b!==b}var n=typeof Object.is=="function"?Object.is:s,o=t.useState,i=t.useEffect,c=t.useLayoutEffect,d=t.useDebugValue;function m(y,b){var k=b(),S=o({inst:{value:k,getSnapshot:b}}),j=S[0].inst,w=S[1];return c(function(){j.value=k,j.getSnapshot=b,f(j)&&w({inst:j})},[y,k,b]),i(function(){return f(j)&&w({inst:j}),y(function(){f(j)&&w({inst:j})})},[y]),d(k),k}function f(y){var b=y.getSnapshot;y=y.value;try{var k=b();return!n(y,k)}catch{return!0}}function x(y,b){return b()}var v=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?x:m;return Wm.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:v,Wm}var Yg;function C2(){return Yg||(Yg=1,Hm.exports=k2()),Hm.exports}var S2=C2();const E2=W0.useInsertionEffect,_2=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",A2=_2?p.useLayoutEffect:p.useEffect,T2=E2||A2,K0=t=>{const s=p.useRef([t,(...n)=>s[0](...n)]).current;return T2(()=>{s[0]=t}),s[1]},R2="popstate",rh="pushState",nh="replaceState",P2="hashchange",Jg=[R2,rh,nh,P2],M2=t=>{for(const s of Jg)addEventListener(s,t);return()=>{for(const s of Jg)removeEventListener(s,t)}},q0=(t,s)=>S2.useSyncExternalStore(M2,t,s),I2=()=>location.search,D2=({ssrSearch:t=""}={})=>q0(I2,()=>t),Xg=()=>location.pathname,O2=({ssrPath:t}={})=>q0(Xg,t?()=>t:Xg),L2=(t,{replace:s=!1,state:n=null}={})=>history[s?nh:rh](n,"",t),F2=(t={})=>[O2(t),L2],ev=Symbol.for("wouter_v3");if(typeof history<"u"&&typeof window[ev]>"u"){for(const t of[rh,nh]){const s=history[t];history[t]=function(){const n=s.apply(this,arguments),o=new Event(t);return o.arguments=arguments,dispatchEvent(o),n}}Object.defineProperty(window,ev,{value:!0})}const $2=(t,s)=>s.toLowerCase().indexOf(t.toLowerCase())?"~"+s:s.slice(t.length)||"/",Z0=(t="")=>t==="/"?"":t,V2=(t,s)=>t[0]==="~"?t.slice(1):Z0(s)+t,z2=(t="",s)=>$2(tv(Z0(t)),tv(s)),tv=t=>{try{return decodeURI(t)}catch{return t}},G0={hook:F2,searchHook:D2,parser:N2,base:"",ssrPath:void 0,ssrSearch:void 0,hrefs:t=>t},Q0=p.createContext(G0),Ji=()=>p.useContext(Q0),Y0={},J0=p.createContext(Y0),X0=()=>p.useContext(J0),Nd=t=>{const[s,n]=t.hook(t);
9return[z2(t.base,s),K0((o,i)=>n(V2(o,t.base),i))]},Xi=()=>Nd(Ji()),ey=(t,s,n,o)=>{const{pattern:i,keys:c}=s instanceof RegExp?{keys:!1,pattern:s}:t(s||"*",o),d=i.exec(n)||[],[m,...f]=d;return m!==void 0?[!0,(()=>{const x=c!==!1?Object.fromEntries(c.map((y,b)=>[y,f[b]])):d.groups;let v={...f};return x&&Object.assign(v,x),v})(),...o?[m]:[]]:[!1,null]},B2=({children:t,...s})=>{const n=Ji(),o=s.hook?G0:n;let i=o;const[c,d]=s.ssrPath?.split("?")??[];d&&(s.ssrSearch=d,s.ssrPath=c),s.hrefs=s.hrefs??s.hook?.hrefs;let m=p.useRef({}),f=m.current,x=f;for(let v in o){const y=v==="base"?o[v]+(s[v]||""):s[v]||o[v];f===x&&y!==x[v]&&(m.current=x={...x}),x[v]=y,y!==o[v]&&(i=x)}return p.createElement(Q0.Provider,{value:i,children:t})},sv=({children:t,component:s},n)=>s?p.createElement(s,{params:n}):typeof t=="function"?t(n):t,U2=t=>{let s=p.useRef(Y0),n=s.current;for(const o in t)t[o]!==n[o]&&(n=t);return Object.keys(t).length===0&&(n=t),s.current=n},ss=({path:t,nest:s,match:n,...o})=>{const i=Ji(),[c]=Nd(i),[d,m,f]=n??ey(i.parser,t,c,s),x=U2({...X0(),...m});if(!d)return null;const v=f?p.createElement(B2,{base:f},sv(o,x)):sv(o,x);return p.createElement(J0.Provider,{value:x,children:v})},kt=p.forwardRef((t,s)=>{const n=Ji(),[o,i]=Nd(n),{to:c="",href:d=c,onClick:m,asChild:f,children:x,className:v,replace:y,state:b,...k}=t,S=K0(w=>{w.ctrlKey||w.metaKey||w.altKey||w.shiftKey||w.button!==0||(m?.(w),w.defaultPrevented||(w.preventDefault(),i(d,t)))}),j=n.hrefs(d[0]==="~"?d.slice(1):n.base+d,n);return f&&p.isValidElement(x)?p.cloneElement(x,{onClick:S,href:j}):p.createElement("a",{...k,onClick:S,href:j,className:v?.call?v(o===d):v,children:x,ref:s})}),ty=t=>Array.isArray(t)?t.flatMap(s=>ty(s&&s.type===p.Fragment?s.props.children:s)):[t],H2=({children:t,location:s})=>{const n=Ji(),[o]=Nd(n);for(const i of ty(t)){let c=0;if(p.isValidElement(i)&&(c=ey(n.parser,i.props.path,s||o,i.props.nest))[0])return p.cloneElement(i,{match:c})}return null};var Ro=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Ca=typeof window>"u"||"Deno"in globalThis;function or(){}function W2(t,s){return typeof t=="function"?t(s):t}function uf(t){return typeof t=="number"&&t>=0&&t!==1/0}function sy(t,s){return Math.max(t+(s||0)-Date.now(),0)}function po(t,s){return typeof t=="function"?t(s):t}function Nr(t,s){return typeof t=="function"?t(s):t}function rv(t,s){const{type:n="all",exact:o,fetchStatus:i,predicate:c,queryKey:d,stale:m}=t;if(d){if(o){if(s.queryHash!==ah(d,s.options))return!1}else if(!zi(s.queryKey,d))return!1}if(n!=="all"){const f=s.isActive();if(n==="active"&&!f||n==="inactive"&&f)return!1}return!(typeof m=="boolean"&&s.isStale()!==m||i&&i!==s.state.fetchStatus||c&&!c(s))}function nv(t,s){const{exact:n,status:o,predicate:i,mutationKey:c}=t;if(c){if(!s.options.mutationKey)return!1;if(n){if(Sa(s.options.mutationKey)!==Sa(c))return!1}else if(!zi(s.options.mutationKey,c))return!1}return!(o&&s.state.status!==o||i&&!i(s))}function ah(t,s){return(s?.queryKeyHashFn||Sa)(t)}function Sa(t){return JSON.stringify(t,(s,n)=>mf(n)?Object.keys(n).sort().reduce((o,i)=>(o[i]=n[i],o),{}):n)}function zi(t,s){return t===s?!0:typeof t!=typeof s?!1:t&&s&&typeof t=="object"&&typeof s=="object"?!Object.keys(s).some(n=>!zi(t[n],s[n])):!1}function ry(t,s){if(t===s)return t;const n=av(t)&&av(s);if(n||mf(t)&&mf(s)){const o=n?t:Object.keys(t),i=o.length,c=n?s:Object.keys(s),d=c.length,m=n?[]:{};let f=0;for(let x=0;x<d;x++){const v=n?x:c[x];(!n&&o.includes(v)||n)&&t[v]===void 0&&s[v]===void 0?(m[v]=void 0,f++):(m[v]=ry(t[v],s[v]),m[v]===t[v]&&t[v]!==void 0&&f++)}return i===d&&f===i?t:m}return s}function Bc(t,s){if(!s||Object.keys(t).length!==Object.keys(s).length)return!1;for(const n in t)if(t[n]!==s[n])return!1;return!0}function av(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function mf(t){if(!ov(t))return!1;const s=t.constructor;if(s===void 0)return!0;const n=s.prototype;return!(!ov(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(t)!==Object.prototype)}function ov(t){return Object.prototype.toString.call(t)==="[object Object]"}function K2(t){return new Promise(s=>{setTimeout(s,t)})}function ff(t,s,n){return typeof n.structuralSharing=="function"?n.structuralSharing(t,s):n.structuralSharing!==!1?ry(t,
vendor: 24,578 bytes, line 9
9s):s}function q2(t,s,n=0){const o=[...t,s];return n&&o.length>n?o.slice(1):o}function Z2(t,s,n=0){const o=[s,...t];return n&&o.length>n?o.slice(0,-1):o}var oh=Symbol();function ny(t,s){return!t.queryFn&&s?.initialPromise?()=>s.initialPromise:!t.queryFn||t.queryFn===oh?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}var G2=class extends Ro{#e;#t;#r;constructor(){super(),this.#r=t=>{if(!Ca&&window.addEventListener){const s=()=>t();return window.addEventListener("visibilitychange",s,!1),()=>{window.removeEventListener("visibilitychange",s)}}}}onSubscribe(){this.#t||this.setEventListener(this.#r)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(t){this.#r=t,this.#t?.(),this.#t=t(s=>{typeof s=="boolean"?this.setFocused(s):this.onFocus()})}setFocused(t){this.#e!==t&&(this.#e=t,this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(s=>{s(t)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},ih=new G2,Q2=class extends Ro{#e=!0;#t;#r;constructor(){super(),this.#r=t=>{if(!Ca&&window.addEventListener){const s=()=>t(!0),n=()=>t(!1);return window.addEventListener("online",s,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",s),window.removeEventListener("offline",n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#r)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(t){this.#r=t,this.#t?.(),this.#t=t(this.setOnline.bind(this))}setOnline(t){this.#e!==t&&(this.#e=t,this.listeners.forEach(n=>{n(t)}))}isOnline(){return this.#e}},Uc=new Q2;function hf(){let t,s;const n=new Promise((i,c)=>{t=i,s=c});n.status="pending",n.catch(()=>{});function o(i){Object.assign(n,i),delete n.resolve,delete n.reject}return n.resolve=i=>{o({status:"fulfilled",value:i}),t(i)},n.reject=i=>{o({status:"rejected",reason:i}),s(i)},n}function Y2(t){return Math.min(1e3*2**t,3e4)}function ay(t){return(t??"online")==="online"?Uc.isOnline():!0}var oy=class extends Error{constructor(t){super("CancelledError"),this.revert=t?.revert,this.silent=t?.silent}};function Km(t){return t instanceof oy}function iy(t){let s=!1,n=0,o=!1,i;const c=hf(),d=j=>{o||(b(new oy(j)),t.abort?.())},m=()=>{s=!0},f=()=>{s=!1},x=()=>ih.isFocused()&&(t.networkMode==="always"||Uc.isOnline())&&t.canRun(),v=()=>ay(t.networkMode)&&t.canRun(),y=j=>{o||(o=!0,t.onSuccess?.(j),i?.(),c.resolve(j))},b=j=>{o||(o=!0,t.onError?.(j),i?.(),c.reject(j))},k=()=>new Promise(j=>{i=w=>{(o||x())&&j(w)},t.onPause?.()}).then(()=>{i=void 0,o||t.onContinue?.()}),S=()=>{if(o)return;let j;const w=n===0?t.initialPromise:void 0;try{j=w??t.fn()}catch(E){j=Promise.reject(E)}Promise.resolve(j).then(y).catch(E=>{if(o)return;const C=t.retry??(Ca?0:3),A=t.retryDelay??Y2,_=typeof A=="function"?A(n,E):A,D=C===!0||typeof C=="number"&&n<C||typeof C=="function"&&C(n,E);if(s||!D){b(E);return}n++,t.onFail?.(n,E),K2(_).then(()=>x()?void 0:k()).then(()=>{s?b(E):S()})})};return{promise:c,cancel:d,continue:()=>(i?.(),c),cancelRetry:m,continueRetry:f,canStart:v,start:()=>(v()?S():k().then(S),c)}}function J2(){let t=[],s=0,n=m=>{m()},o=m=>{m()},i=m=>setTimeout(m,0);const c=m=>{s?t.push(m):i(()=>{n(m)})},d=()=>{const m=t;t=[],m.length&&i(()=>{o(()=>{m.forEach(f=>{n(f)})})})};return{batch:m=>{let f;s++;try{f=m()}finally{s--,s||d()}return f},batchCalls:m=>(...f)=>{c(()=>{m(...f)})},schedule:c,setNotifyFunction:m=>{n=m},setBatchNotifyFunction:m=>{o=m},setScheduler:m=>{i=m}}}var Qt=J2(),ly=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),uf(this.gcTime)&&(this.#e=setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(Ca?1/0:300*1e3))}clearGcTimeout(){this.#e&&(clearTimeout(this.#e),this.#e=void 0)}},X2=class extends ly{#e;#t;#r;#s;#o;#a;constructor(t){super(),this.#a=!1,this.#o=t.defaultOptions,this.setOptions(t.options),this.observers=[],this.#r=t.cache,this.queryKey=t.queryKey,this.queryHash=t.queryHash,this.#e=eC(this.options),this.state=t.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#s?.promise}setOptions(t){this.options={...this.#o,...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#r.remove(this)}setData(t,s){const n=ff(this.state.data,t,this.options);return this.#n({data:n,type:"success",dataUpdatedAt:s?.updatedAt,manual:s?.manual}),n}setState(t,s){this.#n({type:"setState",state:t,setStateOptions:s})}cancel(t){const s=this.#s?.promise;return this.#s?.cancel(t),s?s.then(or).catch(or):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(t=>Nr(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===oh||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(t=0){return this.state.isInvalidated||this.state.data===void 0||!sy(this.state.dataUpdatedAt,t)}onFocus(){this.observers.find(s=>s.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#s?.continue()}onOnline(){this.observers.find(s=>s.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#s?.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),this.#r.notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(s=>s!==t),this.observers.length||(this.#s&&(this.#a?this.#s.cancel({revert:!0}):this.#s.cancelRetry()),this.scheduleGc()),this.#r.notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#n({type:"invalidate"})}fetch(t,s){if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&s?.cancelRefetch)this.cancel({silent:!0});else if(this.#s)return this.#s.continueRetry(),this.#s.promise}if(t&&this.setOptions(t),!this.options.queryFn){const m=this.observers.find(f=>f.options.queryFn);m&&this.setOptions(m.options)}const n=new AbortController,o=m=>{Object.defineProperty(m,"signal",{enumerable:!0,get:()=>(this.#a=!0,n.signal)})},i=()=>{const m=ny(this.options,s),f={queryKey:this.queryKey,meta:this.meta};return o(f),this.#a=!1,this.options.persister?this.options.persister(m,f,this):m(f)},c={fetchOptions:s,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:i};o(c),this.options.behavior?.onFetch(c,this),this.#t=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==c.fetchOptions?.meta)&&this.#n({type:"fetch",meta:c.fetchOptions?.meta});const d=m=>{Km(m)&&m.silent||this.#n({type:"error",error:m}),Km(m)||(this.#r.config.onError?.(m,this),this.#r.config.onSettled?.(this.state.data,m,this)),this.scheduleGc()};return this.#s=iy({initialPromise:s?.initialPromise,fn:c.fetchFn,abort:n.abort.bind(n),onSuccess:m=>{if(m===void 0){d(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(m)}catch(f){d(f);return}this.#r.config.onSuccess?.(m,this),this.#r.config.onSettled?.(m,this.state.error,this),this.scheduleGc()},onError:d,onFail:(m,f)=>{this.#n({type:"failed",failureCount:m,error:f})},onPause:()=>{this.#n({type:"pause"})},onContinue:()=>{this.#n({type:"continue"})},retry:c.options.retry,retryDelay:c.options.retryDelay,networkMode:c.options.networkMode,canRun:()=>!0}),this.#s.start()}#n(t){const s=n=>{switch(t.type){case"failed":return{...n,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...cy(n.data,this.options),fetchMeta:t.meta??null};case"success":return{...n,data:t.data,dataUpdateCount:n.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const o=t.error;return Km(o)&&o.revert&&this.#t?{...this.#t,fetchStatus:"idle"}:{...n,error:o,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error"};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...t.state}}};this.state=s(this.state),Qt.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#r.notify({query:this,type:"updated",action:t})})}};function cy(t,s){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:ay(s.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function eC(t){const s=typeof t.initialData=="function"?t.initialData():t.initialData,n=s!==void 0,o=n?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:s,dataUpdateCount:0,dataUpdatedAt:n?o??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var tC=class extends Ro{constructor(t={}){super(),this.config=t,this.#e=new Map}#e;build(t,s,n){const o=s.queryKey,i=s.queryHash??ah(o,s);let c=this.get(i);return c||(c=new X2({cache:this,queryKey:o,queryHash:i,options:t.defaultQueryOptions(s),state:n,defaultOptions:t.getQueryDefaults(o)}),this.add(c)),c}add(t){this.#e.has(t.queryHash)||(this.#e.set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const s=this.#e.get(t.queryHash);s&&(t.destroy(),s===t&&this.#e.delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Qt.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return this.#e.get(t)}getAll(){return[...this.#e.values()]}find(t){const s={exact:!0,...t};return this.getAll().find(n=>rv(s,n))}findAll(t={}){const s=this.getAll();return Object.keys(t).length>0?s.filter(n=>rv(t,n)):s}notify(t){Qt.batch(()=>{this.listeners.forEach(s=>{s(t)})})}onFocus(){Qt.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Qt.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},sC=class extends ly{#e;#t;#r;constructor(t){super(),this.mutationId=t.mutationId,this.#t=t.mutationCache,this.#e=[],this.state=t.state||dy(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){this.#e.includes(t)||(this.#e.push(t),this.clearGcTimeout(),this.#t.notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){this.#e=this.#e.filter(s=>s!==t),this.scheduleGc(),this.#t.notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){this.#e.length||(this.state.status==="pending"?this.scheduleGc():this.#t.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(t){this.#r=iy({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(o,i)=>{this.#s({type:"failed",failureCount:o,error:i})},onPause:()=>{this.#s({type:"pause"})},onContinue:()=>{this.#s({type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#t.canRun(this)});const s=this.state.status==="pending",n=!this.#r.canStart();try{if(!s){this.#s({type:"pending",variables:t,isPaused:n}),await this.#t.config.onMutate?.(t,this);const i=await this.options.onMutate?.(t);i!==this.state.context&&this.#s({type:"pending",context:i,variables:t,isPaused:n})}const o=await this.#r.start();return await this.#t.config.onSuccess?.(o,t,this.state.context,this),await this.options.onSuccess?.(o,t,this.state.context),await this.#t.config.onSettled?.(o,null,this.state.variables,this.state.context,this),await this.options.onSettled?.(o,null,t,this.state.context),this.#s({type:"success",data:o}),o}catch(o){try{throw await this.#t.config.onError?.(o,t,this.state.context,this),await this.options.onError?.(o,t,this.state.context),await this.#t.config.onSettled?.(void 0,o,this.state.variables,this.state.context,this),await this.options.onSettled?.(void 0,o,t,this.state.context),o}finally{this.#s({type:"error",error:o})}}finally{this.#t.runNext(this)}}#s(t){const s=n=>{switch(t.type){case"failed":return{...n,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...n,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:t.error,failureCount:n.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=s(this.state),Qt.batch(()=>{this.#e.forEach(n=>{n.onMutationUpdate(t)}),this.#t.notify({mutation:this,type:"updated",action:t})})}};function dy(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var rC=class extends Ro{constructor(t={}){super(),this.config=t,this.#e=new Map,this.#t=Date.now()}#e;#t;build(t,s,n){const o=new sC({mutationCache:this,mutationId:++this.#t,options:t.defaultMutationOptions(s),state:n});return this.add(o),o}add(t){const s=Cc(t),n=this.#e.get(s)??[];n.push(t),this.#e.set(s,n),this.notify({type:"added",mutation:t})}remove(t){const s=Cc(t);if(this.#e.has(s)){const n=this.#e.get(s)?.filter(o=>o!==t);n&&(n.length===0?this.#e.delete(s):this.#e.set(s,n))}this.notify({type:"removed",mutation:t})}canRun(t){const s=this.#e.get(Cc(t))?.find(n=>n.state.status==="pending");return!s||s===t}runNext(t){return this.#e.get(Cc(t))?.find(n=>n!==t&&n.state.isPaused)?.continue()??Promise.resolve()}clear(){Qt.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}getAll(){return[...this.#e.values()].flat()}find(t){const s={exact:!0,...t};return this.getAll().find(n=>nv(s,n))}findAll(t={}){return this.getAll().filter(s=>nv(t,s))}notify(t){Qt.batch(()=>{this.listeners.forEach(s=>{s(t)})})}resumePausedMutations(){const t=this.getAll().filter(s=>s.state.isPaused);return Qt.batch(()=>Promise.all(t.map(s=>s.continue().catch(or))))}};function Cc(t){return t.options.scope?.id??String(t.mutationId)}function iv(t){return{onFetch:(s,n)=>{const o=s.options,i=s.fetchOptions?.meta?.fetchMore?.direction,c=s.state.data?.pages||[],d=s.state.data?.pageParams||[];let m={pages:[],pageParams:[]},f=0;const x=async()=>{let v=!1;const y=S=>{Object.defineProperty(S,"signal",{enumerable:!0,get:()=>(s.signal.aborted?v=!0:s.signal.addEventListener("abort",()=>{v=!0}),s.signal)})},b=ny(s.options,s.fetchOptions),k=async(S,j,w)=>{if(v)return Promise.reject();if(j==null&&S.pages.length)return Promise.resolve(S);const E={queryKey:s.queryKey,pageParam:j,direction:w?"backward":"forward",meta:s.options.meta};y(E);const C=await b(E),{maxPages:A}=s.options,_=w?Z2:q2;return{pages:_(S.pages,C,A),pageParams:_(S.pageParams,j,A)}};if(i&&c.length){const S=i==="backward",j=S?nC:lv,w={pages:c,pageParams:d},E=j(o,w);m=await k(w,E,S)}else{const S=t??c.length;do{const j=f===0?d[0]??o.initialPageParam:lv(o,m);if(f>0&&j==null)break;m=await k(m,j),f++}while(f<S)}return m};s.options.persister?s.fetchFn=()=>s.options.persister?.(x,{queryKey:s.queryKey,meta:s.options.meta,signal:s.signal},n):s.fetchFn=x}}}function lv(t,{pages:s,pageParams:n}){const o=s.length-1;return s.length>0?t.getNextPageParam(s[o],s,n[o],n):void 0}function nC(t,{pages:s,pageParams:n}){return s.length>0?t.getPreviousPageParam?.(s[0],s,n[0],n):void 0}var aC=class{#e;#t;#r;#s;#o;#a;#n;#i;constructor(t={}){this.#e=t.queryCache||new tC,this.#t=t.mutationCache||new rC,this.#r=t.defaultOptions||{},this.#s=new Map,this.#o=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#n=ih.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#i=Uc.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#n?.(),this.#n=void 0,this.#i?.(),this.#i=void 0)}isFetching(t){return this.#e.findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return this.#t.findAll({...t,status:"pending"}).length}getQueryData(t){const s=this.defaultQueryOptions({queryKey:t});return this.#e.get(s.queryHash)?.state.data}ensureQueryData(t){const s=this.getQueryData(t.queryKey);if(s===void 0)return this.fetchQuery(t);{const n=this.defaultQueryOptions(t),o=this.#e.build(this,n);return t.revalidateIfStale&&o.isStaleByTime(po(n.staleTime,o))&&this.prefetchQuery(n),Promise.resolve(s)}}getQueriesData(t){return this.#e.findAll(t).map(({queryKey:s,state:n})=>{const o=n.data;return[s,o]})}setQueryData(t,s,n){const o=this.defaultQueryOptions({queryKey:t}),c=this.#e.get(o.queryHash)?.state.data,d=W2(s,c);if(d!==void 0)return this.#e.build(this,o).setData(d,{...n,manual:!0})}setQueriesData(t,s,n){return Qt.batch(()=>this.#e.findAll(t).map(({queryKey:o})=>[o,this.setQueryData(o,s,n)]))}getQueryState(t){const s=this.defaultQueryOptions({queryKey:t});return this.#e.get(s.queryHash)?.state}removeQueries(t){const s=this.#e;Qt.batch(()=>{s.findAll(t).forEach(n=>{s.remove(n)})})}resetQueries(t,s){const n=this.#e,o={type:"active",...t};return Qt.batch(()=>(n.findAll(t).forEach(i=>{i.reset()}),this.refetchQueries(o,s)))}cancelQueries(t={},s={}){const n={revert:!0,...s},o=Qt.batch(()=>this.#e.findAll(t).map(i=>i.cancel(n)));return Promise.all(o).then(or).catch(or)}invalidateQueries(t={},s={}){return Qt.batch(()=>{if(this.#e.findAll(t).forEach(o=>{o.invalidate()}),t.refetchType==="none")return Promise.resolve();const n={...t,type:t.refetchType??t.type??"active"};return this.refetchQueries(n,s)})}refetchQueries(t={},s){const n={...s,cancelRefetch:s?.cancelRefetch??!0},o=Qt.batch(()=>this.#e.findAll(t).filter(i=>!i.isDisabled()).map(i=>{let c=i.fetch(void 0,n);return n.throwOnError||(c=c.catch(or)),i.state.fetchStatus==="paused"?Promise.resolve():c}));return Promise.all(o).then(or)}fetchQuery(t){const s=this.defaultQueryOptions(t);s.retry===void 0&&(s.retry=!1);const n=this.#e.build(this,s);return n.isStaleByTime(po(s.staleTime,n))?n.fetch(s):Promise.resolve(n.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(or).catch(or)}fetchInfiniteQuery(t){return t.behavior=iv(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(or).catch(or)}ensureInfiniteQueryData(t){return t.behavior=iv(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return Uc.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#r}setDefaultOptions(t){this.#r=t}setQueryDefaults(t,s){this.#s.set(Sa(t),{queryKey:t,defaultOptions:s})}getQueryDefaults(t){const s=[...this.#s.values()];let n={};return s.forEach(o=>{zi(t,o.queryKey)&&(n={...n,...o.defaultOptions})}),n}setMutationDefaults(t,s){this.#o.set(Sa(t),{mutationKey:t,defaultOptions:s})}getMutationDefaults(t){const s=[...this.#o.values()];let n={};return s.forEach(o=>{zi(t,o.mutationKey)&&(n={...n,...o.defaultOptions})}),n}defaultQueryOptions(t){if(t._defaulted)return t;const s={...this.#r.queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return s.queryHash||(s.queryHash=ah(s.queryKey,s)),s.refetchOnReconnect===void 0&&(s.refetchOnReconnect=s.networkMode!=="always"),s.throwOnError===void 0&&(s.throwOnError=!!s.suspense),!s.networkMode&&s.persister&&(s.networkMode="offlineFirst"),s.enabled!==!0&&s.queryFn===oh&&(s.enabled=!1),s}defaultMutationOptions(t){return t?._defaulted?t:{...this.#r.mutations,...t?.mutationKey&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},oC=class extends Ro{constructor(t,s){super(),this.options=s,this.#e=t,this.#i=null,this.#n=hf(),this.options.experimental_prefetchInRender||this.#n.reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(s)}#e;#t=void 0;#r=void 0;#s=void 0;#o;#a;#n;#i;#p;#m;#f;#c;#d;#l;#h=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),cv(this.#t,this.options)?this.#u():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return pf(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return pf(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#j(),this.#t.removeObserver(this)}setOptions(t,s){const n=this.options,o=this.#t;if(this.options=this.#e.defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Nr(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#w(),this.#t.setOptions(this.options),n._defaulted&&!Bc(this.options,n)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const i=this.hasListeners();i&&dv(this.#t,o,this.options,n)&&this.#u(),this.updateResult(s),i&&(this.#t!==o||Nr(this.options.enabled,this.#t)!==Nr(n.enabled,this.#t)||po(this.options.staleTime,this.#t)!==po(n.staleTime,this.#t))&&this.#x();const c=this.#g();i&&(this.#t!==o||Nr(this.options.enabled,this.#t)!==Nr(n.enabled,this.#t)||c!==this.#l)&&this.#v(c)}getOptimisticResult(t){const s=this.#e.getQueryCache().build(this.#e,t),n=this.createResult(s,t);return lC(this,n)&&(this.#s=n,this.#a=this.options,this.#o=this.#t.state),n}getCurrentResult(){return this.#s}trackResult(t,s){const n={};return Object.keys(t).forEach(o=>{Object.defineProperty(n,o,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(o),s?.(o),t[o])})}),n}trackProp(t){this.#h.add(t)}getCurrentQuery(){return this.#t}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const s=this.#e.defaultQueryOptions(t),n=this.#e.getQueryCache().build(this.#e,s);return n.fetch().then(()=>this.createResult(n,s))}fetch(t){return this.#u({...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#s))}#u(t){this.#w();let s=this.#t.fetch(this.options,t);return t?.throwOnError||(s=s.catch(or)),s}#x(){this.#b();const t=po(this.options.staleTime,this.#t);if(Ca||this.#s.isStale||!uf(t))return;const n=sy(this.#s.dataUpdatedAt,t)+1;this.#c=setTimeout(()=>{this.#s.isStale||this.updateResult()},n)}#g(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(t){this.#j(),this.#l=t,!(Ca||Nr(this.options.enabled,this.#t)===!1||!uf(this.#l)||this.#l===0)&&(this.#d=setInterval(()=>{(this.options.refetchIntervalInBackground||ih.isFocused())&&this.#u()},this.#l))}#y(){this.#x(),this.#v(this.#g())}#b(){this.#c&&(clearTimeout(this.#c),this.#c=void 0)}#j(){this.#d&&(clearInterval(this.#d),this.#d=void 0)}createResult(t,s){const n=this.#t,o=this.options,i=this.#s,c=this.#o,d=this.#a,f=t!==n?t.state:this.#r,{state:x}=t;let v={...x},y=!1,b;if(s._optimisticResults){const F=this.hasListeners(),P=!F&&cv(t,s),Z=F&&dv(t,n,s,o);(P||Z)&&(v={...v,...cy(x.data,t.options)}),s._optimisticResults==="isRestoring"&&(v.fetchStatus="idle")}let{error:k,errorUpdatedAt:S,status:j}=v;if(s.select&&v.data!==void 0)if(i&&v.data===c?.data&&s.select===this.#p)b=this.#m;else try{this.#p=s.select,b=s.select(v.data),b=ff(i?.data,b,s),this.#m=b,this.#i=null}catch(F){this.#i=F}else b=v.data;if(s.placeholderData!==void 0&&b===void 0&&j==="pending"){let F;if(i?.isPlaceholderData&&s.placeholderData===d?.placeholderData)F=i.data;else if(F=typeof s.placeholderData=="function"?s.placeholderData(this.#f?.state.data,this.#f):s.placeholderData,s.select&&F!==void 0)try{F=s.select(F),this.#i=null}catch(P){this.#i=P}F!==void 0&&(j="success",b=ff(i?.data,F,s),y=!0)}this.#i&&(k=this.#i,b=this.#m,S=Date.now(),j="error");const w=v.fetchStatus==="fetching",E=j==="pending",C=j==="error",A=E&&w,_=b!==void 0,O={status:j,fetchStatus:v.fetchStatus,isPending:E,isSuccess:j==="success",isError:C,isInitialLoading:A,isLoading:A,data:b,dataUpdatedAt:v.dataUpdatedAt,error:k,errorUpdatedAt:S,failureCount:v.fetchFailureCount,failureReason:v.fetchFailureReason,errorUpdate
9Count:v.errorUpdateCount,isFetched:v.dataUpdateCount>0||v.errorUpdateCount>0,isFetchedAfterMount:v.dataUpdateCount>f.dataUpdateCount||v.errorUpdateCount>f.errorUpdateCount,isFetching:w,isRefetching:w&&!E,isLoadingError:C&&!_,isPaused:v.fetchStatus==="paused",isPlaceholderData:y,isRefetchError:C&&_,isStale:lh(t,s),refetch:this.refetch,promise:this.#n};if(this.options.experimental_prefetchInRender){const F=z=>{O.status==="error"?z.reject(O.error):O.data!==void 0&&z.resolve(O.data)},P=()=>{const z=this.#n=O.promise=hf();F(z)},Z=this.#n;switch(Z.status){case"pending":t.queryHash===n.queryHash&&F(Z);break;case"fulfilled":(O.status==="error"||O.data!==Z.value)&&P();break;case"rejected":(O.status!=="error"||O.error!==Z.reason)&&P();break}}return O}updateResult(t){const s=this.#s,n=this.createResult(this.#t,this.options);if(this.#o=this.#t.state,this.#a=this.options,this.#o.data!==void 0&&(this.#f=this.#t),Bc(n,s))return;this.#s=n;const o={},i=()=>{if(!s)return!0;const{notifyOnChangeProps:c}=this.options,d=typeof c=="function"?c():c;if(d==="all"||!d&&!this.#h.size)return!0;const m=new Set(d??this.#h);return this.options.throwOnError&&m.add("error"),Object.keys(this.#s).some(f=>{const x=f;return this.#s[x]!==s[x]&&m.has(x)})};t?.listeners!==!1&&i()&&(o.listeners=!0),this.#N({...o,...t})}#w(){const t=this.#e.getQueryCache().build(this.#e,this.options);if(t===this.#t)return;const s=this.#t;this.#t=t,this.#r=t.state,this.hasListeners()&&(s?.removeObserver(this),t.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}#N(t){Qt.batch(()=>{t.listeners&&this.listeners.forEach(s=>{s(this.#s)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function iC(t,s){return Nr(s.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&s.retryOnMount===!1)}function cv(t,s){return iC(t,s)||t.state.data!==void 0&&pf(t,s,s.refetchOnMount)}function pf(t,s,n){if(Nr(s.enabled,t)!==!1){const o=typeof n=="function"?n(t):n;return o==="always"||o!==!1&&lh(t,s)}return!1}function dv(t,s,n,o){return(t!==s||Nr(o.enabled,t)===!1)&&(!n.suspense||t.state.status!=="error")&&lh(t,n)}function lh(t,s){return Nr(s.enabled,t)!==!1&&t.isStaleByTime(po(s.staleTime,t))}function lC(t,s){return!Bc(t.getCurrentResult(),s)}var cC=class extends Ro{#e;#t=void 0;#r;#s;constructor(s,n){super(),this.#e=s,this.setOptions(n),this.bindMethods(),this.#o()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(s){const n=this.options;this.options=this.#e.defaultMutationOptions(s),Bc(this.options,n)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#r,observer:this}),n?.mutationKey&&this.options.mutationKey&&Sa(n.mutationKey)!==Sa(this.options.mutationKey)?this.reset():this.#r?.state.status==="pending"&&this.#r.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#r?.removeObserver(this)}onMutationUpdate(s){this.#o(),this.#a(s)}getCurrentResult(){return this.#t}reset(){this.#r?.removeObserver(this),this.#r=void 0,this.#o(),this.#a()}mutate(s,n){return this.#s=n,this.#r?.removeObserver(this),this.#r=this.#e.getMutationCache().build(this.#e,this.options),this.#r.addObserver(this),this.#r.execute(s)}#o(){const s=this.#r?.state??dy();this.#t={...s,isPending:s.status==="pending",isSuccess:s.status==="success",isError:s.status==="error",isIdle:s.status==="idle",mutate:this.mutate,reset:this.reset}}#a(s){Qt.batch(()=>{if(this.#s&&this.hasListeners()){const n=this.#t.variables,o=this.#t.context;s?.type==="success"?(this.#s.onSuccess?.(s.data,n,o),this.#s.onSettled?.(s.data,null,n,o)):s?.type==="error"&&(this.#s.onError?.(s.error,n,o),this.#s.onSettled?.(void 0,s.error,n,o))}this.listeners.forEach(n=>{n(this.#t)})})}},uy=p.createContext(void 0),my=t=>{const s=p.useContext(uy);if(!s)throw new Error("No QueryClient set, use QueryClientProvider to set one");return s},dC=({client:t,children:s})=>(p.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),e.jsx(uy.Provider,{value:t,children:s})),fy=p.createContext(!1),uC=()=>p.useContext(fy);fy.Provider;function mC(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}var fC=p.createContext(mC()),hC=()=>p.useContext(fC);function hy(t,s){return typeof t=="function"?t(...s):!!t}function xf(){}var pC=(t,s)=>{(t.suspense||t.throwOnError||t.experimental_prefetchInRender)&&(s.isReset()||(t.retryOn
9Mount=!1))},xC=t=>{p.useEffect(()=>{t.clearReset()},[t])},gC=({result:t,errorResetBoundary:s,throwOnError:n,query:o})=>t.isError&&!s.isReset()&&!t.isFetching&&o&&hy(n,[t.error,o]),vC=t=>{t.suspense&&(t.staleTime===void 0&&(t.staleTime=1e3),typeof t.gcTime=="number"&&(t.gcTime=Math.max(t.gcTime,1e3)))},yC=(t,s)=>t.isLoading&&t.isFetching&&!s,bC=(t,s)=>t?.suspense&&s.isPending,uv=(t,s,n)=>s.fetchOptimistic(t).catch(()=>{n.clearReset()});function jC(t,s,n){const o=my(),i=uC(),c=hC(),d=o.defaultQueryOptions(t);o.getDefaultOptions().queries?._experimental_beforeQuery?.(d),d._optimisticResults=i?"isRestoring":"optimistic",vC(d),pC(d,c),xC(c);const m=!o.getQueryCache().get(d.queryHash),[f]=p.useState(()=>new s(o,d)),x=f.getOptimisticResult(d);if(p.useSyncExternalStore(p.useCallback(v=>{const y=i?xf:f.subscribe(Qt.batchCalls(v));return f.updateResult(),y},[f,i]),()=>f.getCurrentResult(),()=>f.getCurrentResult()),p.useEffect(()=>{f.setOptions(d,{listeners:!1})},[d,f]),bC(d,x))throw uv(d,f,c);if(gC({result:x,errorResetBoundary:c,throwOnError:d.throwOnError,query:o.getQueryCache().get(d.queryHash)}))throw x.error;return o.getDefaultOptions().queries?._experimental_afterQuery?.(d,x),d.experimental_prefetchInRender&&!Ca&&yC(x,i)&&(m?uv(d,f,c):o.getQueryCache().get(d.queryHash)?.promise)?.catch(xf).finally(()=>{f.updateResult()}),d.notifyOnChangeProps?x:f.trackResult(x)}function He(t,s){return jC(t,oC)}function Ut(t,s){const n=my(),[o]=p.useState(()=>new cC(n,t));p.useEffect(()=>{o.setOptions(t)},[o,t]);const i=p.useSyncExternalStore(p.useCallback(d=>o.subscribe(Qt.batchCalls(d)),[o]),()=>o.getCurrentResult(),()=>o.getCurrentResult()),c=p.useCallback((d,m)=>{o.mutate(d,m).catch(xf)},[o]);if(i.error&&hy(o.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:c,mutateAsync:i.mutate}}async function py(t){if(!t.ok){const s=await t.text()||t.statusText;throw new Error(`${t.status}: ${s}`)}}async function dt(t,s,n){const o=await fetch(s,{method:t,headers:n?{"Content-Type":"application/json"}:{},body:n?JSON.stringify(n):void 0,credentials:"include"});return await py(o),o}const wC=({on401:t})=>async({queryKey:s})=>{const n=await fetch(s.join("/"),{credentials:"include"});return await py(n),await n.json()},ct=new aC({defaultOptions:{queries:{queryFn:wC({on401:"throw"}),refetchInterval:!1,refetchOnWindowFocus:!1,staleTime:1/0,retry:!1},mutations:{retry:!1}}}),NC=1,kC=1e6;let qm=0;function CC(){return qm=(qm+1)%Number.MAX_SAFE_INTEGER,qm.toString()}const Zm=new Map,mv=t=>{if(Zm.has(t))return;const s=setTimeout(()=>{Zm.delete(t),Fi({type:"REMOVE_TOAST",toastId:t})},kC);Zm.set(t,s)},SC=(t,s)=>{switch(s.type){case"ADD_TOAST":return{...t,toasts:[s.toast,...t.toasts].slice(0,NC)};case"UPDATE_TOAST":return{...t,toasts:t.toasts.map(n=>n.id===s.toast.id?{...n,...s.toast}:n)};case"DISMISS_TOAST":{const{toastId:n}=s;return n?mv(n):t.toasts.forEach(o=>{mv(o.id)}),{...t,toasts:t.toasts.map(o=>o.id===n||n===void 0?{...o,open:!1}:o)}}case"REMOVE_TOAST":return s.toastId===void 0?{...t,toasts:[]}:{...t,toasts:t.toasts.filter(n=>n.id!==s.toastId)}}},Ic=[];let Dc={toasts:[]};function Fi(t){Dc=SC(Dc,t),Ic.forEach(s=>{s(Dc)})}function EC({...t}){const s=CC(),n=i=>Fi({type:"UPDATE_TOAST",toast:{...i,id:s}}),o=()=>Fi({type:"DISMISS_TOAST",toastId:s});return Fi({type:"ADD_TOAST",toast:{...t,id:s,open:!0,onOpenChange:i=>{i||o()}}}),{id:s,dismiss:o,update:n}}function Yt(){const[t,s]=p.useState(Dc);return p.useEffect(()=>(Ic.push(s),()=>{const n=Ic.indexOf(s);n>-1&&Ic.splice(n,1)}),[t]),{...t,toast:EC,dismiss:n=>Fi({type:"DISMISS_TOAST",toastId:n})}}var Po=H0();const _C=U0(Po);function be(t,s,{checkForDefaultPrevented:n=!0}={}){return function(i){if(t?.(i),n===!1||!i.defaultPrevented)return s?.(i)}}function fv(t,s){if(typeof t=="function")return t(s);t!=null&&(t.current=s)}function kd(...t){return s=>{let n=!1;const o=t.map(i=>{const c=fv(i,s);return!n&&typeof c=="function"&&(n=!0),c});if(n)return()=>{for(let i=0;i<o.length;i++){const c=o[i];typeof c=="function"?c():fv(t[i],null)}}}}function nt(...t){return p.useCallback(kd(...t),t)}function AC(t,s){const n=p.createContext(s),o=c=>{const{children:d,...m}=c,f=p.useMemo(()=>m,Object.values(m));return e.jsx(n.Provider,{value:f,children:d})};o.displayName=t+"Provider";function i(c){const d=p.useContext(n);if(d)return d;if(s!==void 0)return s;throw new Error(`\`${c}\` must be used within \`${t}\``)}return[o,i]}function Ls(t,s=[]){let n=[];function o(c,d){const m=p.createContext(d),f=n.length;n=[...n,d];const x=y=>{const{scope:b,children:k,...S}=y,j=b?.[t]?.[f]||m,w=p.useMemo(()=>S,Object.values(S));return e.jsx(j.Provider,{value:w,children:k})};x.displayName=c+"Provider";function v(y,b){const k=b?.[t]?.[f]||m,S=p.useContext(k);if(S)return S;if(d!==void 0)return d;throw new Error(`\`${y}\` must be used within \`${c}\``)}return[x,v]}const i=()=>{const c=n.map(d=>p.createContext(d));return function(m){const f=m?.[t]||c;return p.useMemo(()=>({[`__scope${t}`]:{...m,[t]:f}}
vendor: 5,162 bytes, line 9
9),[m,f])}};return i.scopeName=t,[o,TC(i,...s)]}function TC(...t){const s=t[0];if(t.length===1)return s;const n=()=>{const o=t.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(c){const d=o.reduce((m,{useScope:f,scopeName:x})=>{const y=f(c)[`__scope${x}`];return{...m,...y}},{});return p.useMemo(()=>({[`__scope${s.scopeName}`]:d}),[d])}};return n.scopeName=s.scopeName,n}function Ea(t){const s=RC(t),n=p.forwardRef((o,i)=>{const{children:c,...d}=o,m=p.Children.toArray(c),f=m.find(MC);if(f){const x=f.props.children,v=m.map(y=>y===f?p.Children.count(x)>1?p.Children.only(null):p.isValidElement(x)?x.props.children:null:y);return e.jsx(s,{...d,ref:i,children:p.isValidElement(x)?p.cloneElement(x,void 0,v):null})}return e.jsx(s,{...d,ref:i,children:c})});return n.displayName=`${t}.Slot`,n}var xy=Ea("Slot");function RC(t){const s=p.forwardRef((n,o)=>{const{children:i,...c}=n;if(p.isValidElement(i)){const d=DC(i),m=IC(c,i.props);return i.type!==p.Fragment&&(m.ref=o?kd(o,d):d),p.cloneElement(i,m)}return p.Children.count(i)>1?p.Children.only(null):null});return s.displayName=`${t}.SlotClone`,s}var gy=Symbol("radix.slottable");function PC(t){const s=({children:n})=>e.jsx(e.Fragment,{children:n});return s.displayName=`${t}.Slottable`,s.__radixId=gy,s}function MC(t){return p.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===gy}function IC(t,s){const n={...s};for(const o in s){const i=t[o],c=s[o];/^on[A-Z]/.test(o)?i&&c?n[o]=(...m)=>{c(...m),i(...m)}:i&&(n[o]=i):o==="style"?n[o]={...i,...c}:o==="className"&&(n[o]=[i,c].filter(Boolean).join(" "))}return{...t,...n}}function DC(t){let s=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,n=s&&"isReactWarning"in s&&s.isReactWarning;return n?t.ref:(s=Object.getOwnPropertyDescriptor(t,"ref")?.get,n=s&&"isReactWarning"in s&&s.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}function el(t){const s=t+"CollectionProvider",[n,o]=Ls(s),[i,c]=n(s,{collectionRef:{current:null},itemMap:new Map}),d=j=>{const{scope:w,children:E}=j,C=We.useRef(null),A=We.useRef(new Map).current;return e.jsx(i,{scope:w,itemMap:A,collectionRef:C,children:E})};d.displayName=s;const m=t+"CollectionSlot",f=Ea(m),x=We.forwardRef((j,w)=>{const{scope:E,children:C}=j,A=c(m,E),_=nt(w,A.collectionRef);return e.jsx(f,{ref:_,children:C})});x.displayName=m;const v=t+"CollectionItemSlot",y="data-radix-collection-item",b=Ea(v),k=We.forwardRef((j,w)=>{const{scope:E,children:C,...A}=j,_=We.useRef(null),D=nt(w,_),O=c(v,E);return We.useEffect(()=>(O.itemMap.set(_,{ref:_,...A}),()=>{O.itemMap.delete(_)})),e.jsx(b,{[y]:"",ref:D,children:C})});k.displayName=v;function S(j){const w=c(t+"CollectionConsumer",j);return We.useCallback(()=>{const C=w.collectionRef.current;if(!C)return[];const A=Array.from(C.querySelectorAll(`[${y}]`));return Array.from(w.itemMap.values()).sort((O,F)=>A.indexOf(O.ref.current)-A.indexOf(F.ref.current))},[w.collectionRef,w.itemMap])}return[{Provider:d,Slot:x,ItemSlot:k},S,o]}var OC=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Fe=OC.reduce((t,s)=>{const n=Ea(`Primitive.${s}`),o=p.forwardRef((i,c)=>{const{asChild:d,...m}=i,f=d?n:s;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),e.jsx(f,{...m,ref:c})});return o.displayName=`Primitive.${s}`,{...t,[s]:o}},{});function ch(t,s){t&&Po.flushSync(()=>t.dispatchEvent(s))}function xs(t){const s=p.useRef(t);return p.useEffect(()=>{s.current=t}),p.useMemo(()=>(...n)=>s.current?.(...n),[])}function LC(t,s=globalThis?.document){const n=xs(t);p.useEffect(()=>{const o=i=>{i.key==="Escape"&&n(i)};return s.addEventListener("keydown",o,{capture:!0}),()=>s.removeEventListener("keydown",o,{capture:!0})},[n,s])}var FC="DismissableLayer",gf="dismissableLayer.update",$C="dismissableLayer.pointerDownOutside",VC="dismissableLayer.focusOutside",hv,vy=p.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Mo=p.forwardRef((t,s)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:o,onPointerDownOutside:i,onFocusOutside:c,onInteractOutside:d,onDismiss:m,...f}=t,x=p.useContext(vy),[v,y]=p.useState(null),b=v?.ownerDocument??globalThis?.document,[,k]=p.useState({}),S=nt(s,F=>y(F)),j=Array.from(x.layers),[w]=[...x.layersWithOutsidePointerEventsDisabled].slice(-1),E=j.indexOf(w),C=v?j.indexOf(v):-1,A=x.layersWithOutsidePointerEventsDisabled.size>0,_=C>=E,D=BC(F=>{const P=F.target,Z=[...x.branches].some(z=>z.contains(P));!_||Z||(i?.(F),d?.(F),F.defaultPrevented||m?.())},b),O=UC(F=>{const P=F.target;[...x.branches].some(z=>z.contains(P))||(c?.(F),d?.(F),F.defaultPrevented||m?.())},b);return LC(F=>{C===x.layers.size-1&&(o?.(F),!F.defaultPrevented&&m&&(F.preventDefault(),m()))},b),p.useEffect(()=>{if(v)return n&&(x.layersWithOutsidePointerEventsDisabled.size===0&&(hv=b.body.style.pointerEvents,b.body.style.pointerEvents="none"),x.layersWithOutsidePointerEventsDisabled.add(v)),x.layers.add(v),pv(),()=>{n&&x.layersWithOutsidePointerEventsDisabled.size===1&&(b.body.style.pointerEvents=hv)}},[v,b,n,x]),p.useEffect(()=>()=>{v&&(x.layers.delete(v),x.layersWithOutsidePointerEventsDisabled.delete(v),pv()
9)},[v,x]),p.useEffect(()=>{const F=()=>k({});return document.addEventListener(gf,F),()=>document.removeEventListener(gf,F)},[]),e.jsx(Fe.div,{...f,ref:S,style:{pointerEvents:A?_?"auto":"none":void 0,...t.style},onFocusCapture:be(t.onFocusCapture,O.onFocusCapture),onBlurCapture:be(t.onBlurCapture,O.onBlurCapture),onPointerDownCapture:be(t.onPointerDownCapture,D.onPointerDownCapture)})});Mo.displayName=FC;var zC="DismissableLayerBranch",yy=p.forwardRef((t,s)=>{const n=p.useContext(vy),o=p.useRef(null),i=nt(s,o);return p.useEffect(()=>{const c=o.current;if(c)return n.branches.add(c),()=>{n.branches.delete(c)}},[n.branches]),e.jsx(Fe.div,{...t,ref:i})});yy.displayName=zC;function BC(t,s=globalThis?.document){const n=xs(t),o=p.useRef(!1),i=p.useRef(()=>{});return p.useEffect(()=>{const c=m=>{if(m.target&&!o.current){let f=function(){by($C,n,x,{discrete:!0})};const x={originalEvent:m};m.pointerType==="touch"?(s.removeEventListener("click",i.current),i.current=f,s.addEventListener("click",i.current,{once:!0})):f()}else s.removeEventListener("click",i.current);o.current=!1},d=window.setTimeout(()=>{s.addEventListener("pointerdown",c)},0);return()=>{window.clearTimeout(d),s.removeEventListener("pointerdown",c),s.removeEventListener("click",i.current)}},[s,n]),{onPointerDownCapture:()=>o.current=!0}}function UC(t,s=globalThis?.document){const n=xs(t),o=p.useRef(!1);return p.useEffect(()=>{const i=c=>{c.target&&!o.current&&by(VC,n,{originalEvent:c},{discrete:!1})};return s.addEventListener("focusin",i),()=>s.removeEventListener("focusin",i)},[s,n]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}function pv(){const t=new CustomEvent(gf);document.dispatchEvent(t)}function by(t,s,n,{discrete:o}){const i=n.originalEvent.target,c=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:n});s&&i.addEventListener(t,s,{once:!0}),o?ch(i,c):i.dispatchEvent(c)}var HC=Mo,WC=yy,ls=globalThis?.document?p.useLayoutEffect:()=>{},KC="Portal",tl=p.forwardRef((t,s)=>{const{container:n,...o}=t,[i,c]=p.useState(!1);ls(()=>c(!0),[]);const d=n||i&&globalThis?.document?.body;return d?_C.createPortal(e.jsx(Fe.div,{...o,ref:s}),d):null});tl.displayName=KC;function qC(t,s){return p.useReducer((n,o)=>s[n][o]??n,t)}var Ys=t=>{const{present:s,children:n}=t,o=ZC(s),i=typeof n=="function"?n({present:o.isPresent}):p.Children.only(n),c=nt(o.ref,GC(i));return typeof n=="function"||o.isPresent?p.cloneElement(i,{ref:c}):null};Ys.displayName="Presence";function ZC(t){const[s,n]=p.useState(),o=p.useRef({}),i=p.useRef(t),c=p.useRef("none"),d=t?"mounted":"unmounted",[m,f]=qC(d,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return p.useEffect(()=>{const x=Sc(o.current);c.current=m==="mounted"?x:"none"},[m]),ls(()=>{const x=o.current,v=i.current;if(v!==t){const b=c.current,k=Sc(x);t?f("MOUNT"):k==="none"||x?.display==="none"?f("UNMOUNT"):f(v&&b!==k?"ANIMATION_OUT":"UNMOUNT"),i.current=t}},[t,f]),ls(()=>{if(s){let x;const v=s.ownerDocument.defaultView??window,y=k=>{const j=Sc(o.current).includes(k.animationName);if(k.target===s&&j&&(f("ANIMATION_END"),!i.current)){const w=s.style.animationFillMode;s.style.animationFillMode="forwards",x=v.setTimeout(()=>{s.style.animationFillMode==="forwards"&&(s.style.animationFillMode=w)})}},b=k=>{k.target===s&&(c.current=Sc(o.current))};return s.addEventListener("animationstart",b),s.addEventListener("animationcancel",y),s.addEventListener("animationend",y),()=>{v.clearTimeout(x),s.removeEventListener("animationstart",b),s.removeEventListener("animationcancel",y),s.removeEventListener("animationend",y)}}else f("ANIMATION_END")},[s,f]),{isPresent:["mounted","unmountSuspended"].includes(m),ref:p.useCallback(x=>{x&&(o.current=getComputedStyle(x)),n(x)},[])}}function Sc(t){return t?.animationName||"none"}function GC(t){let s=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,n=s&&"isReactWarning"in s&&s.isReactWarning;return n?t.ref:(s=Object.getOwnPropertyDescriptor(t,"ref")?.get,n=s&&"isReactWarning"in s&&s.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}function Sr({prop:t,defaultProp:s,onChange:n=()=>{}}){const[o,i]=QC({defaultProp:s,onChange:n}),c=t!==void 0,d=c?t:o,m=xs(n),f=p.useCallback(x=>{if(c){const y=typeof x=="function"?x(t):x;y!==t&&m(y)}else i(x)},[c,t,i,m]);return[d,f]}function QC({defaultProp:t,onChange:s}){const n=p.useState(t),[o]=n,i=p.useRef(o),c=xs(s);return p.useEffect(()=>{i.current!==o&&(c(o),i.current=o)},[o,i,c]),n}var YC="VisuallyHidden",sl=p.forwardRef((t,s)=>e.jsx(Fe.span,{...t,ref:s,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...t.style}}));
9sl.displayName=YC;var JC=sl,dh="ToastProvider",[uh,XC,eS]=el("Toast"),[jy]=Ls("Toast",[eS]),[tS,Cd]=jy(dh),wy=t=>{const{__scopeToast:s,label:n="Notification",duration:o=5e3,swipeDirection:i="right",swipeThreshold:c=50,children:d}=t,[m,f]=p.useState(null),[x,v]=p.useState(0),y=p.useRef(!1),b=p.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${dh}\`. Expected non-empty \`string\`.`),e.jsx(uh.Provider,{scope:s,children:e.jsx(tS,{scope:s,label:n,duration:o,swipeDirection:i,swipeThreshold:c,toastCount:x,viewport:m,onViewportChange:f,onToastAdd:p.useCallback(()=>v(k=>k+1),[]),onToastRemove:p.useCallback(()=>v(k=>k-1),[]),isFocusedToastEscapeKeyDownRef:y,isClosePausedRef:b,children:d})})};wy.displayName=dh;var Ny="ToastViewport",sS=["F8"],vf="toast.viewportPause",yf="toast.viewportResume",ky=p.forwardRef((t,s)=>{const{__scopeToast:n,hotkey:o=sS,label:i="Notifications ({hotkey})",...c}=t,d=Cd(Ny,n),m=XC(n),f=p.useRef(null),x=p.useRef(null),v=p.useRef(null),y=p.useRef(null),b=nt(s,y,d.onViewportChange),k=o.join("+").replace(/Key/g,"").replace(/Digit/g,""),S=d.toastCount>0;p.useEffect(()=>{const w=E=>{o.length!==0&&o.every(A=>E[A]||E.code===A)&&y.current?.focus()};return document.addEventListener("keydown",w),()=>document.removeEventListener("keydown",w)},[o]),p.useEffect(()=>{const w=f.current,E=y.current;if(S&&w&&E){const C=()=>{if(!d.isClosePausedRef.current){const O=new CustomEvent(vf);E.dispatchEvent(O),d.isClosePausedRef.current=!0}},A=()=>{if(d.isClosePausedRef.current){const O=new CustomEvent(yf);E.dispatchEvent(O),d.isClosePausedRef.current=!1}},_=O=>{!w.contains(O.relatedTarget)&&A()},D=()=>{w.contains(document.activeElement)||A()};return w.addEventListener("focusin",C),w.addEventListener("focusout",_),w.addEventListener("pointermove",C),w.addEventListener("pointerleave",D),window.addEventListener("blur",C),window.addEventListener("focus",A),()=>{w.removeEventListener("focusin",C),w.removeEventListener("focusout",_),w.removeEventListener("pointermove",C),w.removeEventListener("pointerleave",D),window.removeEventListener("blur",C),window.removeEventListener("focus",A)}}},[S,d.isClosePausedRef]);const j=p.useCallback(({tabbingDirection:w})=>{const C=m().map(A=>{const _=A.ref.current,D=[_,...pS(_)];return w==="forwards"?D:D.reverse()});return(w==="forwards"?C.reverse():C).flat()},[m]);return p.useEffect(()=>{const w=y.current;if(w){const E=C=>{const A=C.altKey||C.ctrlKey||C.metaKey;if(C.key==="Tab"&&!A){const D=document.activeElement,O=C.shiftKey;if(C.target===w&&O){x.current?.focus();return}const Z=j({tabbingDirection:O?"backwards":"forwards"}),z=Z.findIndex(te=>te===D);Gm(Z.slice(z+1))?C.preventDefault():O?x.current?.focus():v.current?.focus()}};return w.addEventListener("keydown",E),()=>w.removeEventListener("keydown",E)}},[m,j]),e.jsxs(WC,{ref:f,role:"region","aria-label":i.replace("{hotkey}",k),tabIndex:-1,style:{pointerEvents:S?void 0:"none"},children:[S&&e.jsx(bf,{ref:x,onFocusFromOutsideViewport:()=>{const w=j({tabbingDirection:"forwards"});Gm(w)}}),e.jsx(uh.Slot,{scope:n,children:e.jsx(Fe.ol,{tabIndex:-1,...c,ref:b})}),S&&e.jsx(bf,{ref:v,onFocusFromOutsideViewport:()=>{const w=j({tabbingDirection:"backwards"});Gm(w)}})]})});ky.displayName=Ny;var Cy="ToastFocusProxy",bf=p.forwardRef((t,s)=>{const{__scopeToast:n,onFocusFromOutsideViewport:o,...i}=t,c=Cd(Cy,n);return e.jsx(sl,{"aria-hidden":!0,tabIndex:0,...i,ref:s,style:{position:"fixed"},onFocus:d=>{const m=d.relatedTarget;!c.viewport?.contains(m)&&o()}})});bf.displayName=Cy;var Sd="Toast",rS="toast.swipeStart",nS="toast.swipeMove",aS="toast.swipeCancel",oS="toast.swipeEnd",Sy=p.forwardRef((t,s)=>{const{forceMount:n,open:o,defaultOpen:i,onOpenChange:c,...d}=t,[m=!0,f]=Sr({prop:o,defaultProp:i,onChange:c});return e.jsx(Ys,{present:n||m,children:e.jsx(cS,{open:m,...d,ref:s,onClose:()=>f(!1),onPause:xs(t.onPause),onResume:xs(t.onResume),onSwipeStart:be(t.onSwipeStart,x=>{x.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:be(t.onSwipeMove,x=>{const{x:v,y}=x.detail.delta;x.currentTarget.setAttribute("data-swipe","move"),x.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${v}px`),x.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${y}px`)}
9),onSwipeCancel:be(t.onSwipeCancel,x=>{x.currentTarget.setAttribute("data-swipe","cancel"),x.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),x.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),x.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),x.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:be(t.onSwipeEnd,x=>{const{x:v,y}=x.detail.delta;x.currentTarget.setAttribute("data-swipe","end"),x.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),x.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),x.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${v}px`),x.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${y}px`),f(!1)})})})});Sy.displayName=Sd;var[iS,lS]=jy(Sd,{onClose(){}}),cS=p.forwardRef((t,s)=>{const{__scopeToast:n,type:o="foreground",duration:i,open:c,onClose:d,onEscapeKeyDown:m,onPause:f,onResume:x,onSwipeStart:v,onSwipeMove:y,onSwipeCancel:b,onSwipeEnd:k,...S}=t,j=Cd(Sd,n),[w,E]=p.useState(null),C=nt(s,I=>E(I)),A=p.useRef(null),_=p.useRef(null),D=i||j.duration,O=p.useRef(0),F=p.useRef(D),P=p.useRef(0),{onToastAdd:Z,onToastRemove:z}=j,te=xs(()=>{w?.contains(document.activeElement)&&j.viewport?.focus(),d()}),ee=p.useCallback(I=>{!I||I===1/0||(window.clearTimeout(P.current),O.current=new Date().getTime(),P.current=window.setTimeout(te,I))},[te]);p.useEffect(()=>{const I=j.viewport;if(I){const le=()=>{ee(F.current),x?.()},ne=()=>{const J=new Date().getTime()-O.current;F.current=F.current-J,window.clearTimeout(P.current),f?.()};return I.addEventListener(vf,ne),I.addEventListener(yf,le),()=>{I.removeEventListener(vf,ne),I.removeEventListener(yf,le)}}},[j.viewport,D,f,x,ee]),p.useEffect(()=>{c&&!j.isClosePausedRef.current&&ee(D)},[c,D,j.isClosePausedRef,ee]),p.useEffect(()=>(Z(),()=>z()),[Z,z]);const se=p.useMemo(()=>w?My(w):null,[w]);return j.viewport?e.jsxs(e.Fragment,{children:[se&&e.jsx(dS,{__scopeToast:n,role:"status","aria-live":o==="foreground"?"assertive":"polite","aria-atomic":!0,children:se}),e.jsx(iS,{scope:n,onClose:te,children:Po.createPortal(e.jsx(uh.ItemSlot,{scope:n,children:e.jsx(HC,{asChild:!0,onEscapeKeyDown:be(m,()=>{j.isFocusedToastEscapeKeyDownRef.current||te(),j.isFocusedToastEscapeKeyDownRef.current=!1}),children:e.jsx(Fe.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":c?"open":"closed","data-swipe-direction":j.swipeDirection,...S,ref:C,style:{userSelect:"none",touchAction:"none",...t.style},onKeyDown:be(t.onKeyDown,I=>{I.key==="Escape"&&(m?.(I.nativeEvent),I.nativeEvent.defaultPrevented||(j.isFocusedToastEscapeKeyDownRef.current=!0,te()))}),onPointerDown:be(t.onPointerDown,I=>{I.button===0&&(A.current={x:I.clientX,y:I.clientY})}),onPointerMove:be(t.onPointerMove,I=>{if(!A.current)return;const le=I.clientX-A.current.x,ne=I.clientY-A.current.y,J=!!_.current,U=["left","right"].includes(j.swipeDirection),q=["left","up"].includes(j.swipeDirection)?Math.min:Math.max,V=U?q(0,le):0,R=U?0:q(0,ne),Q=I.pointerType==="touch"?10:2,Ne={x:V,y:R},Pe={originalEvent:I,delta:Ne};J?(_.current=Ne,Ec(nS,y,Pe,{discrete:!1})):xv(Ne,j.swipeDirection,Q)?(_.current=Ne,Ec(rS,v,Pe,{discrete:!1}),I.target.setPointerCapture(I.pointerId)):(Math.abs(le)>Q||Math.abs(ne)>Q)&&(A.current=null)}),onPointerUp:be(t.onPointerUp,I=>{const le=_.current,ne=I.target;if(ne.hasPointerCapture(I.pointerId)&&ne.releasePointerCapture(I.pointerId),_.current=null,A.current=null,le){const J=I.currentTarget,U={originalEvent:I,delta:le};xv(le,j.swipeDirection,j.swipeThreshold)?Ec(oS,k,U,{discrete:!0}):Ec(aS,b,U,{discrete:!0}),J.addEventListener("click",q=>q.preventDefault(),{once:!0})}})})})}),j.viewport)})]}):null}),dS=t=>{const{__scopeToast:s,children:n,...o}=t,i=Cd(Sd,s),[c,d]=p.useState(!1),[m,f]=p.useState(!1);return fS(()=>d(!0)),p.useEffect(()=>{const x=window.setTimeout(()=>f(!0),1e3);return()=>window.clearTimeout(x)},[]),m?null:e.jsx(tl,{asChild:!0,children:e.jsx(sl,{...o,children:c&&e.jsxs(e.Fragment,{children:[i.label," ",n]})})})},uS="ToastTitle",Ey=p.forwardRef((t,s)=>{const{__scopeToast:n,...o}=t;return e.jsx(Fe.div,{...o,ref:s})});Ey.displayName=uS;var mS="ToastDescription",_y=p.forwardRef((t,s)=>{const{__scopeToast:n,...o}=t;return e.jsx(Fe.div,{...o,ref:s})});_y.displayName=mS;var Ay="ToastAction",Ty=p.forwardRef((t,s)=>{const{altText:n,...o}=t;return n.trim()?e.jsx(Py,{altText:n,asChild:!0,children:e.jsx(mh,{...o,ref:s})}):(console.error(`Invalid prop \`altText\` supplied to \`${Ay}\`. Expected non-empty \`string\`.`),null)});Ty.displayName=Ay;var Ry="ToastClose",mh=p.forwardRef((t,s)=>{const{__scopeToast:n,...o}=t,i=lS(Ry,n);return e.jsx(Py,{asChild:!0,children:e.jsx(Fe.button,{type:"button",...o,ref:s,onClick:be(t.onClick,i.onClose)})})});mh.displayName=Ry;var Py=p.forwardRef((t,s)=>{const{__scopeToast:n,altText:o,...i}=t;return e.jsx(Fe.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":o||void 0,...i,ref:s})});function My(t){const s=[];
9return Array.from(t.childNodes).forEach(o=>{if(o.nodeType===o.TEXT_NODE&&o.textContent&&s.push(o.textContent),hS(o)){const i=o.ariaHidden||o.hidden||o.style.display==="none",c=o.dataset.radixToastAnnounceExclude==="";if(!i)if(c){const d=o.dataset.radixToastAnnounceAlt;d&&s.push(d)}else s.push(...My(o))}}),s}function Ec(t,s,n,{discrete:o}){const i=n.originalEvent.currentTarget,c=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:n});s&&i.addEventListener(t,s,{once:!0}),o?ch(i,c):i.dispatchEvent(c)}var xv=(t,s,n=0)=>{const o=Math.abs(t.x),i=Math.abs(t.y),c=o>i;return s==="left"||s==="right"?c&&o>n:!c&&i>n};function fS(t=()=>{}){const s=xs(t);ls(()=>{let n=0,o=0;return n=window.requestAnimationFrame(()=>o=window.requestAnimationFrame(s)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(o)}},[s])}function hS(t){return t.nodeType===t.ELEMENT_NODE}function pS(t){const s=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:o=>{const i=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||i?NodeFilter.FILTER_SKIP:o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)s.push(n.currentNode);return s}function Gm(t){const s=document.activeElement;return t.some(n=>n===s?!0:(n.focus(),document.activeElement!==s))}var xS=wy,Iy=ky,Dy=Sy,Oy=Ey,Ly=_y,Fy=Ty,$y=mh;function Vy(t){var s,n,o="";if(typeof t=="string"||typeof t=="number")o+=t;else if(typeof t=="object")if(Array.isArray(t)){var i=t.length;for(s=0;s<i;s++)t[s]&&(n=Vy(t[s]))&&(o&&(o+=" "),o+=n)}else for(n in t)t[n]&&(o&&(o+=" "),o+=n);return o}function zy(){for(var t,s,n=0,o="",i=arguments.length;n<i;n++)(t=arguments[n])&&(s=Vy(t))&&(o&&(o+=" "),o+=s);return o}const gv=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,vv=zy,Ed=(t,s)=>n=>{var o;if(s?.variants==null)return vv(t,n?.class,n?.className);const{variants:i,defaultVariants:c}=s,d=Object.keys(i).map(x=>{const v=n?.[x],y=c?.[x];if(v===null)return null;const b=gv(v)||gv(y);return i[x][b]}),m=n&&Object.entries(n).reduce((x,v)=>{let[y,b]=v;return b===void 0||(x[y]=b),x},{}),f=s==null||(o=s.compoundVariants)===null||o===void 0?void 0:o.reduce((x,v)=>{let{class:y,className:b,...k}=v;return Object.entries(k).every(S=>{let[j,w]=S;return Array.isArray(w)?w.includes({...c,...m}[j]):{...c,...m}[j]===w})?[...x,y,b]:x},[]);return vv(t,d,f,n?.class,n?.className)};const gS=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),By=(...t)=>t.filter((s,n,o)=>!!s&&o.indexOf(s)===n).join(" ");var vS={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"};const yS=p.forwardRef(({color:t="currentColor",size:s=24,strokeWidth:n=2,absoluteStrokeWidth:o,className:i="",children:c,iconNode:d,...m},f)=>p.createElement("svg",{ref:f,...vS,width:s,height:s,stroke:t,strokeWidth:o?Number(n)*24/Number(s):n,className:By("lucide",i),...m},[...d.map(([x,v])=>p.createElement(x,v)),...Array.isArray(c)?c:[c]]));const ae=(t,s)=>{const n=p.forwardRef(({className:o,...i},c)=>p.createElement(yS,{ref:c,iconNode:s,className:By(`lucide-${gS(t)}`,o),...i}));return n.displayName=`${t}`,n};const Bi=ae("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"}]]);const Uy=ae("ArrowDownLeft",[["path",{d:"M17 7 7 17",key:"15tmo1"}],["path",{d:"M17 17H7V7",key:"1org7z"}]]);const bS=ae("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);const yv=ae("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);const lr=ae("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);const jS=ae("ArrowUpRight",[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]]);const wS=ae("AtSign",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M16 8v5a3 3 0 0 0 6 0v-1a10 10 0 1 0-4 8",key:"7n84p3"}]]);const NS=ae("Ban",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m4.9 4.9 14.2 14.2",key:"1m5liu"}]]);const Hy=ae("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"}]]);const Os=ae("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"}]]);const fh=ae("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"}]]);const Hc=ae("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"}]]);const kS=ae("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"}]]);const CS=ae("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"}]]);const bv=ae("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"}]]);const SS=ae("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"}]]);const rl=ae("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);const Ar=ae("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);const ES=ae("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);const Cs=ae("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);
9const Wy=ae("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);const mo=ae("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"}]]);const tt=ae("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);const ir=ae("CircleDot",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]]);const _S=ae("CirclePlus",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]]);const jv=ae("CircleStop",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["rect",{x:"9",y:"9",width:"6",height:"6",rx:"1",key:"1ssd4o"}]]);const Pt=ae("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"}]]);const AS=ae("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);const Fr=ae("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);const TS=ae("Cloud",[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]]);const Wc=ae("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);const qn=ae("Coins",[["circle",{cx:"8",cy:"8",r:"6",key:"3yglwk"}],["path",{d:"M18.09 10.37A6 6 0 1 1 10.34 18",key:"t5s6rm"}],["path",{d:"M7 6h1v4",key:"1obek4"}],["path",{d:"m16.71 13.88.7.71-2.82 2.82",key:"1rbuyh"}]]);const _d=ae("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);const Ky=ae("Cpu",[["rect",{width:"16",height:"16",x:"4",y:"4",rx:"2",key:"14l7u7"}],["rect",{width:"6",height:"6",x:"9",y:"9",rx:"1",key:"5aljv4"}],["path",{d:"M15 2v2",key:"13l42r"}],["path",{d:"M15 20v2",key:"15mkzm"}],["path",{d:"M2 15h2",key:"1gxd5l"}],["path",{d:"M2 9h2",key:"1bbxkp"}],["path",{d:"M20 15h2",key:"19e6y8"}],["path",{d:"M20 9h2",key:"19tzq7"}
9],["path",{d:"M9 2v2",key:"165o2o"}],["path",{d:"M9 20v2",key:"i2bqo8"}]]);const qy=ae("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"}]]);const Zy=ae("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);const Ss=ae("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"}]]);const wt=ae("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"}]]);const RS=ae("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"}]]);const PS=ae("FileCheck",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"m9 15 2 2 4-4",key:"1grp1n"}]]);const Gy=ae("FileCode",[["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7z",key:"1mlx9k"}]]);const MS=ae("FileKey",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["circle",{cx:"10",cy:"16",r:"2",key:"4ckbqe"}],["path",{d:"m16 10-4.5 4.5",key:"7p3ebg"}],["path",{d:"m15 11 1 1",key:"1bsyx3"}]]);const wv=ae("FilePenLine",[["path",{d:"m18 5-2.414-2.414A2 2 0 0 0 14.172 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2",key:"142zxg"}],["path",{d:"M21.378 12.626a1 1 0 0 0-3.004-3.004l-4.01 4.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z",key:"2t3380"}],["path",{d:"M8 18h1",key:"13wk12"}]]);const Qn=ae("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"}]]);const IS=ae("File",[["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"}]]);const Ui=ae("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"}],["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"}]]);const nl=ae("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"}]]);const DS=ae("Gauge",[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]]);const jf=ae("GitBranch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]);const an=ae("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"}]]);const OS=ae("Grid3x3",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"M15 3v18",key:"14nvp0"}]]);const wf=ae("HardDrive",[["line",{x1:"22",x2:"2",y1:"12",y2:"12",key:"1y58io"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}],["line",{x1:"6",x2:"6.01",y1:"16",y2:"16",key:"sgf278"}],["line",{x1:"10",x2:"10.01",y1:"16",y2:"16",key:"1l4acy"}
9]]);const nn=ae("Hash",[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]]);const Nf=ae("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"}]]);const LS=ae("House",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]]);const Nv=ae("Inbox",[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]]);const Kc=ae("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);const kf=ae("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"}]]);const kv=ae("Key",[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]]);const Ur=ae("Layers",[["path",{d:"m12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z",key:"8b97xw"}],["path",{d:"m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65",key:"dd6zsq"}],["path",{d:"m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65",key:"ep9fru"}]]);const FS=ae("LayoutDashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]);const on=ae("Link2",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"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"}]]);const al=ae("Link",[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]]);const Ge=ae("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);const Io=ae("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"}]]);const $S=ae("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"}]]);const Cf=ae("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"}]]);const VS=ae("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"}]]);const zS=ae("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"}]]);const Qy=ae("MessageCircle",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]]);const ho=ae("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"}]]);const BS=ae("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);const US=ae("Package",[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["path",{d:"m3.3 7 7.703 4.734a2 2 0 0 0 1.994 0L20.7 7",key:"yx3hmr"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]]);const hh=ae("Paperclip",[["path",{d:"m21.44 11.05-9.19 9.19a6 6 0 0 1-8.49-8.49l8.57-8.57A4 4 0 1 1 18 8.84l-8.59 8.57a2 2 0 0 1-2.83-2.83l8.49-8.48",key:"1u3ebp"}]]);const HS=ae("Phone",[["path",{d:"M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z",key:"foiqr5"}]]);const _a=ae("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);const Ad=ae("Plug",[["path",{d:"M12 22v-5",key:"1ega77"}
9],["path",{d:"M9 8V2",key:"14iosj"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M18 8v5a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V8Z",key:"osxo6l"}]]);const ka=ae("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);const WS=ae("Radio",[["path",{d:"M4.9 19.1C1 15.2 1 8.8 4.9 4.9",key:"1vaf9d"}],["path",{d:"M7.8 16.2c-2.3-2.3-2.3-6.1 0-8.5",key:"u1ii0m"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["path",{d:"M16.2 7.8c2.3 2.3 2.3 6.1 0 8.5",key:"1j5fej"}],["path",{d:"M19.1 4.9C23 8.8 23 15.1 19.1 19",key:"10b0cb"}]]);const KS=ae("Receipt",[["path",{d:"M4 2v20l2-1 2 1 2-1 2 1 2-1 2 1 2-1 2 1V2l-2 1-2-1-2 1-2-1-2 1-2-1-2 1Z",key:"q3az6g"}],["path",{d:"M16 8h-6a2 2 0 1 0 0 4h4a2 2 0 1 1 0 4H8",key:"1h4pet"}],["path",{d:"M12 17.5v-11",key:"1jc1ny"}]]);const qc=ae("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"}]]);const Cv=ae("Rocket",[["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z",key:"m3kijz"}],["path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z",key:"1fmvmk"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0",key:"1f8sc4"}],["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}]]);const Yy=ae("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"}]]);const qS=ae("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"}]]);const Zc=ae("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);const jo=ae("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"}]]);const Hi=ae("Server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]);const ln=ae("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",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]]);const Es=ae("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"}]]);const Ct=ae("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"}]]);const ZS=ae("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"}]]);const Gc=ae("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"}]]);const GS=ae("SquareCheckBig",[["path",{d:"M21 10.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.5",key:"1uzm8b"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);const xo=ae("Star",[["polygon",{points:"12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2",key:"8f66p6"}]]);const QS=ae("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"}]]);const Jy=ae("Table",[["path",{d:"M12 3v18",key:"108xh3"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}]]);const Sv=ae("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]]);
vendor: 4,293 bytes, line 9
9const Sf=ae("ThumbsDown",[["path",{d:"M17 14V2",key:"8ymqnk"}],["path",{d:"M9 18.12 10 14H4.17a2 2 0 0 1-1.92-2.56l2.33-8A2 2 0 0 1 6.5 2H20a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2.76a2 2 0 0 0-1.79 1.11L12 22a3.13 3.13 0 0 1-3-3.88Z",key:"m61m77"}]]);const Qc=ae("ThumbsUp",[["path",{d:"M7 10v12",key:"1qc93n"}],["path",{d:"M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z",key:"emmmcr"}]]);const Do=ae("Timer",[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]]);const Yc=ae("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);const Xy=ae("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"}]]);const ks=ae("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"}]]);const YS=ae("Triangle",[["path",{d:"M13.73 4a2 2 0 0 0-3.46 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z",key:"14u9p9"}]]);const JS=ae("Trophy",[["path",{d:"M6 9H4.5a2.5 2.5 0 0 1 0-5H6",key:"17hqa7"}],["path",{d:"M18 9h1.5a2.5 2.5 0 0 0 0-5H18",key:"lmptdp"}],["path",{d:"M4 22h16",key:"57wxv0"}],["path",{d:"M10 14.66V17c0 .55-.47.98-.97 1.21C7.85 18.75 7 20.24 7 22",key:"1nw9bq"}],["path",{d:"M14 14.66V17c0 .55.47.98.97 1.21C16.15 18.75 17 20.24 17 22",key:"1np0yb"}],["path",{d:"M18 2H6v7a6 6 0 0 0 12 0V2Z",key:"u46fv3"}]]);const wo=ae("UserCheck",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["polyline",{points:"16 11 18 13 22 9",key:"1pwet4"}]]);const XS=ae("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"}]]);const eb=ae("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"}]]);const St=ae("Wallet",[["path",{d:"M19 7V4a1 1 0 0 0-1-1H5a2 2 0 0 0 0 4h15a1 1 0 0 1 1 1v4h-3a2 2 0 0 0 0 4h3a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1",key:"18etb6"}],["path",{d:"M3 5v14a2 2 0 0 0 2 2h15a1 1 0 0 0 1-1v-4",key:"xoc0q4"}]]);const e5=ae("Webhook",[["path",{d:"M18 16.98h-5.99c-1.1 0-1.95.94-2.48 1.9A4 4 0 0 1 2 17c.01-.7.2-1.4.57-2",key:"q3hayz"}],["path",{d:"m6 17 3.13-5.78c.53-.97.1-2.18-.5-3.1a4 4 0 1 1 6.89-4.06",key:"1go1hn"}],["path",{d:"m12 6 3.13 5.73C15.66 12.7 16.9 13 18 13a4 4 0 0 1 0 8",key:"qlwsc0"}]]);const Gs=ae("Wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]]);const ol=ae("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);const ht=ae("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"}]]),ph="-",t5=t=>{const s=r5(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:o}=t;return{getClassGroupId:d=>{const m=d.split(ph);return m[0]===""&&m.length!==1&&m.shift(),tb(m,s)||s5(d)},getConflictingClassGroupIds:(d,m)=>{const f=n[d]||[];return m&&o[d]?[...f,...o[d]]:f}}},tb=(t,s)=>{if(t.length===0)return s.classGroupId;const n=t[0],o=s.nextPart.get(n),i=o?tb(t.slice(1),o):void 0;if(i)return i;if(s.validators.length===0)return;const c=t.join(ph);return s.validators.find(({validator:d})=>d(c))?.classGroupId},Ev=/^\[(.+)\]$/,s5=t=>{if(Ev.test(t)){const s=Ev.exec(t)[1],n=s?.substring(0,s.indexOf(":"));if(n)return"arbitrary.."+n}},r5=t=>{const{theme:s,prefix:n}=t,o={nextPart:new Map,validators:[]};
vendor: 5,125 bytes, line 9
9return a5(Object.entries(t.classGroups),n).forEach(([c,d])=>{Ef(d,o,c,s)}),o},Ef=(t,s,n,o)=>{t.forEach(i=>{if(typeof i=="string"){const c=i===""?s:_v(s,i);c.classGroupId=n;return}if(typeof i=="function"){if(n5(i)){Ef(i(o),s,n,o);return}s.validators.push({validator:i,classGroupId:n});return}Object.entries(i).forEach(([c,d])=>{Ef(d,_v(s,c),n,o)})})},_v=(t,s)=>{let n=t;return s.split(ph).forEach(o=>{n.nextPart.has(o)||n.nextPart.set(o,{nextPart:new Map,validators:[]}),n=n.nextPart.get(o)}),n},n5=t=>t.isThemeGetter,a5=(t,s)=>s?t.map(([n,o])=>{const i=o.map(c=>typeof c=="string"?s+c:typeof c=="object"?Object.fromEntries(Object.entries(c).map(([d,m])=>[s+d,m])):c);return[n,i]}):t,o5=t=>{if(t<1)return{get:()=>{},set:()=>{}};let s=0,n=new Map,o=new Map;const i=(c,d)=>{n.set(c,d),s++,s>t&&(s=0,o=n,n=new Map)};return{get(c){let d=n.get(c);if(d!==void 0)return d;if((d=o.get(c))!==void 0)return i(c,d),d},set(c,d){n.has(c)?n.set(c,d):i(c,d)}}},sb="!",i5=t=>{const{separator:s,experimentalParseClassName:n}=t,o=s.length===1,i=s[0],c=s.length,d=m=>{const f=[];let x=0,v=0,y;for(let w=0;w<m.length;w++){let E=m[w];if(x===0){if(E===i&&(o||m.slice(w,w+c)===s)){f.push(m.slice(v,w)),v=w+c;continue}if(E==="/"){y=w;continue}}E==="["?x++:E==="]"&&x--}const b=f.length===0?m:m.substring(v),k=b.startsWith(sb),S=k?b.substring(1):b,j=y&&y>v?y-v:void 0;return{modifiers:f,hasImportantModifier:k,baseClassName:S,maybePostfixModifierPosition:j}};return n?m=>n({className:m,parseClassName:d}):d},l5=t=>{if(t.length<=1)return t;const s=[];let n=[];return t.forEach(o=>{o[0]==="["?(s.push(...n.sort(),o),n=[]):n.push(o)}),s.push(...n.sort()),s},c5=t=>({cache:o5(t.cacheSize),parseClassName:i5(t),...t5(t)}),d5=/\s+/,u5=(t,s)=>{const{parseClassName:n,getClassGroupId:o,getConflictingClassGroupIds:i}=s,c=[],d=t.trim().split(d5);let m="";for(let f=d.length-1;f>=0;f-=1){const x=d[f],{modifiers:v,hasImportantModifier:y,baseClassName:b,maybePostfixModifierPosition:k}=n(x);let S=!!k,j=o(S?b.substring(0,k):b);if(!j){if(!S){m=x+(m.length>0?" "+m:m);continue}if(j=o(b),!j){m=x+(m.length>0?" "+m:m);continue}S=!1}const w=l5(v).join(":"),E=y?w+sb:w,C=E+j;if(c.includes(C))continue;c.push(C);const A=i(j,S);for(let _=0;_<A.length;++_){const D=A[_];c.push(E+D)}m=x+(m.length>0?" "+m:m)}return m};function m5(){let t=0,s,n,o="";for(;t<arguments.length;)(s=arguments[t++])&&(n=rb(s))&&(o&&(o+=" "),o+=n);return o}const rb=t=>{if(typeof t=="string")return t;let s,n="";for(let o=0;o<t.length;o++)t[o]&&(s=rb(t[o]))&&(n&&(n+=" "),n+=s);return n};function f5(t,...s){let n,o,i,c=d;function d(f){const x=s.reduce((v,y)=>y(v),t());return n=c5(x),o=n.cache.get,i=n.cache.set,c=m,m(f)}function m(f){const x=o(f);if(x)return x;const v=u5(f,n);return i(f,v),v}return function(){return c(m5.apply(null,arguments))}}const Tt=t=>{const s=n=>n[t]||[];return s.isThemeGetter=!0,s},nb=/^\[(?:([a-z-]+):)?(.+)\]$/i,h5=/^\d+\/\d+$/,p5=new Set(["px","full","screen"]),x5=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,g5=/\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$/,v5=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,y5=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,b5=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,tn=t=>go(t)||p5.has(t)||h5.test(t),Ln=t=>Oo(t,"length",_5),go=t=>!!t&&!Number.isNaN(Number(t)),Qm=t=>Oo(t,"number",go),_i=t=>!!t&&Number.isInteger(Number(t)),j5=t=>t.endsWith("%")&&go(t.slice(0,-1)),Xe=t=>nb.test(t),Fn=t=>x5.test(t),w5=new Set(["length","size","percentage"]),N5=t=>Oo(t,w5,ab),k5=t=>Oo(t,"position",ab),C5=new Set(["image","url"]),S5=t=>Oo(t,C5,T5),E5=t=>Oo(t,"",A5),Ai=()=>!0,Oo=(t,s,n)=>{const o=nb.exec(t);return o?o[1]?typeof s=="string"?o[1]===s:s.has(o[1]):n(o[2]):!1},_5=t=>g5.test(t)&&!v5.test(t),ab=()=>!1,A5=t=>y5.test(t),T5=t=>b5.test(t),R5=()=>{const t=Tt("colors"),s=Tt("spacing"),n=Tt("blur"),o=Tt("brightness"),i=Tt("borderColor"),c=Tt("borderRadius"),d=Tt("borderSpacing"),m=Tt("borderWidth"),f=Tt("contrast"),x=Tt("grayscale"),v=Tt("hueRotate"),y=Tt("invert"),b=Tt("gap"),k=Tt("gradientColorStops"),S=Tt("gradientColorStopPositions"),j=Tt("inset"),w=Tt("margin"),E=Tt("opacity"),C=Tt("padding"),A=Tt("saturate"),_=Tt("scale"),D=Tt("sepia"),O=Tt("skew"),F=Tt("space"),P=Tt("translate"),Z=()=>["auto","contain","none"],z=()=>["auto","hidden","clip","visible","scroll"],te=()=>["auto",Xe,s],ee=()=>[Xe,s],se=()=>["",tn,Ln],I=()=>["auto",go,Xe],le=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],ne=()=>["solid","dashed","dotted","double","none"],J=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],U=()=>["start","end","center","between","around","evenly","stretch"],q=()=>["","0",Xe],V=()=>["auto","avoid","all","avoid-page","page","left","right","column"],R=()=>[go,Xe];return{cacheSize:500,separator:":",theme:{colors:[Ai],spacing:[tn,Ln],blur:["none","",Fn,Xe],brightness:R(),borderColor:[t],borderRadius:["n
9one","","full",Fn,Xe],borderSpacing:ee(),borderWidth:se(),contrast:R(),grayscale:q(),hueRotate:R(),invert:q(),gap:ee(),gradientColorStops:[t],gradientColorStopPositions:[j5,Ln],inset:te(),margin:te(),opacity:R(),padding:ee(),saturate:R(),scale:R(),sepia:q(),skew:R(),space:ee(),translate:ee()},classGroups:{aspect:[{aspect:["auto","square","video",Xe]}],container:["container"],columns:[{columns:[Fn]}],"break-after":[{"break-after":V()}],"break-before":[{"break-before":V()}],"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:[...le(),Xe]}],overflow:[{overflow:z()}],"overflow-x":[{"overflow-x":z()}],"overflow-y":[{"overflow-y":z()}],overscroll:[{overscroll:Z()}],"overscroll-x":[{"overscroll-x":Z()}],"overscroll-y":[{"overscroll-y":Z()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[j]}],"inset-x":[{"inset-x":[j]}],"inset-y":[{"inset-y":[j]}],start:[{start:[j]}],end:[{end:[j]}],top:[{top:[j]}],right:[{right:[j]}],bottom:[{bottom:[j]}],left:[{left:[j]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",_i,Xe]}],basis:[{basis:te()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Xe]}],grow:[{grow:q()}],shrink:[{shrink:q()}],order:[{order:["first","last","none",_i,Xe]}],"grid-cols":[{"grid-cols":[Ai]}],"col-start-end":[{col:["auto",{span:["full",_i,Xe]},Xe]}],"col-start":[{"col-start":I()}],"col-end":[{"col-end":I()}],"grid-rows":[{"grid-rows":[Ai]}],"row-start-end":[{row:["auto",{span:[_i,Xe]},Xe]}],"row-start":[{"row-start":I()}],"row-end":[{"row-end":I()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Xe]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Xe]}],gap:[{gap:[b]}],"gap-x":[{"gap-x":[b]}],"gap-y":[{"gap-y":[b]}],"justify-content":[{justify:["normal",...U()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...U(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...U(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[C]}],px:[{px:[C]}],py:[{py:[C]}],ps:[{ps:[C]}],pe:[{pe:[C]}],pt:[{pt:[C]}],pr:[{pr:[C]}],pb:[{pb:[C]}],pl:[{pl:[C]}],m:[{m:[w]}],mx:[{mx:[w]}],my:[{my:[w]}],ms:[{ms:[w]}],me:[{me:[w]}],mt:[{mt:[w]}],mr:[{mr:[w]}],mb:[{mb:[w]}],ml:[{ml:[w]}],"space-x":[{"space-x":[F]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[F]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Xe,s]}],"min-w":[{"min-w":[Xe,s,"min","max","fit"]}],"max-w":[{"max-w":[Xe,s,"none","full","min","max","fit","prose",{screen:[Fn]},Fn]}],h:[{h:[Xe,s,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Xe,s,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Xe,s,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Xe,s,"auto","min","max","fit"]}],"font-size":[{text:["base",Fn,Ln]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Qm]}],"font-family":[{font:[Ai]}],"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",Xe]}],"line-clamp":[{"line-clamp":["none",go,Qm]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",tn,Xe]}],"list-image":[{"list-image":["none",Xe]}],"list-style-type":[{list:["none","disc","decimal",Xe]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[t]}],"placeholder-opacity":[{"placeholder-opacity":[E]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[t]}],"text-opacity":[{"text-opacity":[E]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ne(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",tn,Ln]}],"underline-offset":[{"underline-offset":["auto",tn,Xe]}],"text-decoration-color":[{decoration:[t]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:ee()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Xe]}],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",Xe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[E]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...le(),k5]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",N5]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},S5]}],"bg-color":[{bg:[t]}],"gradient-from-pos":[{from:[S]}
vendor: 5,202 bytes, line 9
9],"gradient-via-pos":[{via:[S]}],"gradient-to-pos":[{to:[S]}],"gradient-from":[{from:[k]}],"gradient-via":[{via:[k]}],"gradient-to":[{to:[k]}],rounded:[{rounded:[c]}],"rounded-s":[{"rounded-s":[c]}],"rounded-e":[{"rounded-e":[c]}],"rounded-t":[{"rounded-t":[c]}],"rounded-r":[{"rounded-r":[c]}],"rounded-b":[{"rounded-b":[c]}],"rounded-l":[{"rounded-l":[c]}],"rounded-ss":[{"rounded-ss":[c]}],"rounded-se":[{"rounded-se":[c]}],"rounded-ee":[{"rounded-ee":[c]}],"rounded-es":[{"rounded-es":[c]}],"rounded-tl":[{"rounded-tl":[c]}],"rounded-tr":[{"rounded-tr":[c]}],"rounded-br":[{"rounded-br":[c]}],"rounded-bl":[{"rounded-bl":[c]}],"border-w":[{border:[m]}],"border-w-x":[{"border-x":[m]}],"border-w-y":[{"border-y":[m]}],"border-w-s":[{"border-s":[m]}],"border-w-e":[{"border-e":[m]}],"border-w-t":[{"border-t":[m]}],"border-w-r":[{"border-r":[m]}],"border-w-b":[{"border-b":[m]}],"border-w-l":[{"border-l":[m]}],"border-opacity":[{"border-opacity":[E]}],"border-style":[{border:[...ne(),"hidden"]}],"divide-x":[{"divide-x":[m]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[m]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[E]}],"divide-style":[{divide:ne()}],"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:["",...ne()]}],"outline-offset":[{"outline-offset":[tn,Xe]}],"outline-w":[{outline:[tn,Ln]}],"outline-color":[{outline:[t]}],"ring-w":[{ring:se()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[t]}],"ring-opacity":[{"ring-opacity":[E]}],"ring-offset-w":[{"ring-offset":[tn,Ln]}],"ring-offset-color":[{"ring-offset":[t]}],shadow:[{shadow:["","inner","none",Fn,E5]}],"shadow-color":[{shadow:[Ai]}],opacity:[{opacity:[E]}],"mix-blend":[{"mix-blend":[...J(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":J()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[o]}],contrast:[{contrast:[f]}],"drop-shadow":[{"drop-shadow":["","none",Fn,Xe]}],grayscale:[{grayscale:[x]}],"hue-rotate":[{"hue-rotate":[v]}],invert:[{invert:[y]}],saturate:[{saturate:[A]}],sepia:[{sepia:[D]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[o]}],"backdrop-contrast":[{"backdrop-contrast":[f]}],"backdrop-grayscale":[{"backdrop-grayscale":[x]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[v]}],"backdrop-invert":[{"backdrop-invert":[y]}],"backdrop-opacity":[{"backdrop-opacity":[E]}],"backdrop-saturate":[{"backdrop-saturate":[A]}],"backdrop-sepia":[{"backdrop-sepia":[D]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[d]}],"border-spacing-x":[{"border-spacing-x":[d]}],"border-spacing-y":[{"border-spacing-y":[d]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Xe]}],duration:[{duration:R()}],ease:[{ease:["linear","in","out","in-out",Xe]}],delay:[{delay:R()}],animate:[{animate:["none","spin","ping","pulse","bounce",Xe]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[_]}],"scale-x":[{"scale-x":[_]}],"scale-y":[{"scale-y":[_]}],rotate:[{rotate:[_i,Xe]}],"translate-x":[{"translate-x":[P]}],"translate-y":[{"translate-y":[P]}],"skew-x":[{"skew-x":[O]}],"skew-y":[{"skew-y":[O]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Xe]}],accent:[{accent:["auto",t]}],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",Xe]}],"caret-color":[{caret:[t]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":ee()}],"scroll-mx":[{"scroll-mx":ee()}],"scroll-my":[{"scroll-my":ee()}],"scroll-ms":[{"scroll-ms":ee()}],"scroll-me":[{"scroll-me":ee()}],"scroll-mt":[{"scroll-mt":ee()}],"scroll-mr":[{"scroll-mr":ee()}],"scroll-mb":[{"scroll-mb":ee()}],"scroll-ml":[{"scroll-ml":ee()}],"scroll-p":[{"scroll-p":ee()}],"scroll-px":[{"scroll-px":ee()}],"scroll-py":[{"scroll-py":ee()}],"scroll-ps":[{"scroll-ps":ee()}],"scroll-pe":[{"scroll-pe":ee()}],"scroll-pt":[{"scroll-pt":ee()}],"scroll-pr":[{"scroll-pr":ee()}],"scroll-pb":[{"scroll-pb":ee()}],"scroll-pl":[{"scroll-pl":ee()}],"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"]}
9],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",Xe]}],fill:[{fill:[t,"none"]}],"stroke-w":[{stroke:[tn,Ln,Qm]}],stroke:[{stroke:[t,"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"]}}},P5=f5(R5);function re(...t){return P5(zy(t))}const M5=xS,ob=p.forwardRef(({className:t,...s},n)=>e.jsx(Iy,{ref:n,className:re("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]",t),...s}));ob.displayName=Iy.displayName;const I5=Ed("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"}}),ib=p.forwardRef(({className:t,variant:s,...n},o)=>e.jsx(Dy,{ref:o,className:re(I5({variant:s}),t),...n}));ib.displayName=Dy.displayName;const D5=p.forwardRef(({className:t,...s},n)=>e.jsx(Fy,{ref:n,className:re("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",t),...s}));D5.displayName=Fy.displayName;const lb=p.forwardRef(({className:t,...s},n)=>e.jsx($y,{ref:n,className:re("absolute right-2 top-2 rounded-md p-1 text-foreground
vendor: 4,150 bytes, line 9
9/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",t),"toast-close":"",...s,children:e.jsx(ol,{className:"h-4 w-4"})}));lb.displayName=$y.displayName;const cb=p.forwardRef(({className:t,...s},n)=>e.jsx(Oy,{ref:n,className:re("text-sm font-semibold",t),...s}));cb.displayName=Oy.displayName;const db=p.forwardRef(({className:t,...s},n)=>e.jsx(Ly,{ref:n,className:re("text-sm opacity-90",t),...s}));db.displayName=Ly.displayName;function O5(){const{toasts:t}=Yt();return e.jsxs(M5,{children:[t.map(function({id:s,title:n,description:o,action:i,...c}){return e.jsxs(ib,{...c,children:[e.jsxs("div",{className:"grid gap-1",children:[n&&e.jsx(cb,{children:n}),o&&e.jsx(db,{children:o})]}),i,e.jsx(lb,{})]},s)}),e.jsx(ob,{})]})}var L5=W0[" useId ".trim().toString()]||(()=>{}),F5=0;function cr(t){const[s,n]=p.useState(L5());return ls(()=>{n(o=>o??String(F5++))},[t]),s?`radix-${s}`:""}const $5=["top","right","bottom","left"],Yn=Math.min,Us=Math.max,Jc=Math.round,_c=Math.floor,$r=t=>({x:t,y:t}),V5={left:"right",right:"left",bottom:"top",top:"bottom"},z5={start:"end",end:"start"};function _f(t,s,n){return Us(t,Yn(s,n))}function cn(t,s){return typeof t=="function"?t(s):t}function dn(t){return t.split("-")[0]}function Lo(t){return t.split("-")[1]}function xh(t){return t==="x"?"y":"x"}function gh(t){return t==="y"?"height":"width"}function Jn(t){return["top","bottom"].includes(dn(t))?"y":"x"}function vh(t){return xh(Jn(t))}function B5(t,s,n){n===void 0&&(n=!1);const o=Lo(t),i=vh(t),c=gh(i);let d=i==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return s.reference[c]>s.floating[c]&&(d=Xc(d)),[d,Xc(d)]}function U5(t){const s=Xc(t);return[Af(t),s,Af(s)]}function Af(t){return t.replace(/start|end/g,s=>z5[s])}function H5(t,s,n){const o=["left","right"],i=["right","left"],c=["top","bottom"],d=["bottom","top"];switch(t){case"top":case"bottom":return n?s?i:o:s?o:i;case"left":case"right":return s?c:d;default:return[]}}function W5(t,s,n,o){const i=Lo(t);let c=H5(dn(t),n==="start",o);return i&&(c=c.map(d=>d+"-"+i),s&&(c=c.concat(c.map(Af)))),c}function Xc(t){return t.replace(/left|right|bottom|top/g,s=>V5[s])}function K5(t){return{top:0,right:0,bottom:0,left:0,...t}}function ub(t){return typeof t!="number"?K5(t):{top:t,right:t,bottom:t,left:t}}function ed(t){const{x:s,y:n,width:o,height:i}=t;return{width:o,height:i,top:n,left:s,right:s+o,bottom:n+i,x:s,y:n}}function Av(t,s,n){let{reference:o,floating:i}=t;const c=Jn(s),d=vh(s),m=gh(d),f=dn(s),x=c==="y",v=o.x+o.width/2-i.width/2,y=o.y+o.height/2-i.height/2,b=o[m]/2-i[m]/2;let k;switch(f){case"top":k={x:v,y:o.y-i.height};break;case"bottom":k={x:v,y:o.y+o.height};break;case"right":k={x:o.x+o.width,y};break;case"left":k={x:o.x-i.width,y};break;default:k={x:o.x,y:o.y}}switch(Lo(s)){case"start":k[d]-=b*(n&&x?-1:1);break;case"end":k[d]+=b*(n&&x?-1:1);break}return k}const q5=async(t,s,n)=>{const{placement:o="bottom",strategy:i="absolute",middleware:c=[],platform:d}=n,m=c.filter(Boolean),f=await(d.isRTL==null?void 0:d.isRTL(s));let x=await d.getElementRects({reference:t,floating:s,strategy:i}),{x:v,y}=Av(x,o,f),b=o,k={},S=0;for(let j=0;j<m.length;j++){const{name:w,fn:E}=m[j],{x:C,y:A,data:_,reset:D}=await E({x:v,y,initialPlacement:o,placement:b,strategy:i,middlewareData:k,rects:x,platform:d,elements:{reference:t,floating:s}});v=C??v,y=A??y,k={...k,[w]:{...k[w],..._}},D&&S<=50&&(S++,typeof D=="object"&&(D.placement&&(b=D.placement),D.rects&&(x=D.rects===!0?await d.getElementRects({reference:t,floating:s,strategy:i}):D.rects),{x:v,y}=Av(x,b,f)),j=-1)}return{x:v,y,placement:b,strategy:i,middlewareData:k}};async function Wi(t,s){var n;s===void 0&&(s={});const{x:o,y:i,platform:c,rects:d,elements:m,strategy:f}=t,{boundary:x="clippingAncestors",rootBoundary:v="viewport",elementContext:y="floating",altBoundary:b=!1,padding:k=0}=cn(s,t),S=ub(k),w=m[b?y==="floating"?"reference":"floating":y],E=ed(await c.getClippingRect
vendor: 6,129 bytes, line 9
9({element:(n=await(c.isElement==null?void 0:c.isElement(w)))==null||n?w:w.contextElement||await(c.getDocumentElement==null?void 0:c.getDocumentElement(m.floating)),boundary:x,rootBoundary:v,strategy:f})),C=y==="floating"?{x:o,y:i,width:d.floating.width,height:d.floating.height}:d.reference,A=await(c.getOffsetParent==null?void 0:c.getOffsetParent(m.floating)),_=await(c.isElement==null?void 0:c.isElement(A))?await(c.getScale==null?void 0:c.getScale(A))||{x:1,y:1}:{x:1,y:1},D=ed(c.convertOffsetParentRelativeRectToViewportRelativeRect?await c.convertOffsetParentRelativeRectToViewportRelativeRect({elements:m,rect:C,offsetParent:A,strategy:f}):C);return{top:(E.top-D.top+S.top)/_.y,bottom:(D.bottom-E.bottom+S.bottom)/_.y,left:(E.left-D.left+S.left)/_.x,right:(D.right-E.right+S.right)/_.x}}const Z5=t=>({name:"arrow",options:t,async fn(s){const{x:n,y:o,placement:i,rects:c,platform:d,elements:m,middlewareData:f}=s,{element:x,padding:v=0}=cn(t,s)||{};if(x==null)return{};const y=ub(v),b={x:n,y:o},k=vh(i),S=gh(k),j=await d.getDimensions(x),w=k==="y",E=w?"top":"left",C=w?"bottom":"right",A=w?"clientHeight":"clientWidth",_=c.reference[S]+c.reference[k]-b[k]-c.floating[S],D=b[k]-c.reference[k],O=await(d.getOffsetParent==null?void 0:d.getOffsetParent(x));let F=O?O[A]:0;(!F||!await(d.isElement==null?void 0:d.isElement(O)))&&(F=m.floating[A]||c.floating[S]);const P=_/2-D/2,Z=F/2-j[S]/2-1,z=Yn(y[E],Z),te=Yn(y[C],Z),ee=z,se=F-j[S]-te,I=F/2-j[S]/2+P,le=_f(ee,I,se),ne=!f.arrow&&Lo(i)!=null&&I!==le&&c.reference[S]/2-(I<ee?z:te)-j[S]/2<0,J=ne?I<ee?I-ee:I-se:0;return{[k]:b[k]+J,data:{[k]:le,centerOffset:I-le-J,...ne&&{alignmentOffset:J}},reset:ne}}}),G5=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(s){var n,o;const{placement:i,middlewareData:c,rects:d,initialPlacement:m,platform:f,elements:x}=s,{mainAxis:v=!0,crossAxis:y=!0,fallbackPlacements:b,fallbackStrategy:k="bestFit",fallbackAxisSideDirection:S="none",flipAlignment:j=!0,...w}=cn(t,s);if((n=c.arrow)!=null&&n.alignmentOffset)return{};const E=dn(i),C=Jn(m),A=dn(m)===m,_=await(f.isRTL==null?void 0:f.isRTL(x.floating)),D=b||(A||!j?[Xc(m)]:U5(m)),O=S!=="none";!b&&O&&D.push(...W5(m,j,S,_));const F=[m,...D],P=await Wi(s,w),Z=[];let z=((o=c.flip)==null?void 0:o.overflows)||[];if(v&&Z.push(P[E]),y){const I=B5(i,d,_);Z.push(P[I[0]],P[I[1]])}if(z=[...z,{placement:i,overflows:Z}],!Z.every(I=>I<=0)){var te,ee;const I=(((te=c.flip)==null?void 0:te.index)||0)+1,le=F[I];if(le)return{data:{index:I,overflows:z},reset:{placement:le}};let ne=(ee=z.filter(J=>J.overflows[0]<=0).sort((J,U)=>J.overflows[1]-U.overflows[1])[0])==null?void 0:ee.placement;if(!ne)switch(k){case"bestFit":{var se;const J=(se=z.filter(U=>{if(O){const q=Jn(U.placement);return q===C||q==="y"}return!0}).map(U=>[U.placement,U.overflows.filter(q=>q>0).reduce((q,V)=>q+V,0)]).sort((U,q)=>U[1]-q[1])[0])==null?void 0:se[0];J&&(ne=J);break}case"initialPlacement":ne=m;break}if(i!==ne)return{reset:{placement:ne}}}return{}}}};function Tv(t,s){return{top:t.top-s.height,right:t.right-s.width,bottom:t.bottom-s.height,left:t.left-s.width}}function Rv(t){return $5.some(s=>t[s]>=0)}const Q5=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(s){const{rects:n}=s,{strategy:o="referenceHidden",...i}=cn(t,s);switch(o){case"referenceHidden":{const c=await Wi(s,{...i,elementContext:"reference"}),d=Tv(c,n.reference);return{data:{referenceHiddenOffsets:d,referenceHidden:Rv(d)}}}case"escaped":{const c=await Wi(s,{...i,altBoundary:!0}),d=Tv(c,n.floating);return{data:{escapedOffsets:d,escaped:Rv(d)}}}default:return{}}}}};async function Y5(t,s){const{placement:n,platform:o,elements:i}=t,c=await(o.isRTL==null?void 0:o.isRTL(i.floating)),d=dn(n),m=Lo(n),f=Jn(n)==="y",x=["left","top"].includes(d)?-1:1,v=c&&f?-1:1,y=cn(s,t);let{mainAxis:b,crossAxis:k,alignmentAxis:S}=typeof y=="number"?{mainAxis:y,crossAxis:0,alignmentAxis:null}:{mainAxis:y.mainAxis||0,crossAxis:y.crossAxis||0,alignmentAxis:y.alignmentAxis};return m&&typeof S=="number"&&(k=m==="end"?S*-1:S),f?{x:k*v,y:b*x}:{x:b*x,y:k*v}}const J5=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(s){var n,o;const{x:i,y:c,placement:d,middlewareData:m}=s,f=await Y5(s,t);return d===((n=m.offset)==null?void 0:n.placement)&&(o=m.arrow)!=null&&o.alignmentOffset?{}:{x:i+f.x,y:c+f.y,data:{...f,placement:d}}}}},X5=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(s){const{x:n,y:o,placement:i}=s,{mainAxis:c=!0,crossAxis:d=!1,limiter:m={fn:w=>{let{x:E,y:C}=w;return{x:E,y:C}}},...f}=cn(t,s),x={x:n,y:o},v=await Wi(s,f),y=Jn(dn(i)),b=xh(y);let k=x[b],S=x[y];if(c){const w=b==="y"?"top":"left",E=b==="y"?"bottom":"right",C=k+v[w],A=k-v[E];k=_f(C,k,A)}if(d){const w=y==="y"?"top":"left",E=y==="y"?"bottom":"right",C=S+v[w],A=S-v[E];S=_f(C,S,A)}const j=m.fn({...s,[b]:k,[y]:S});return{...j,data:{x:j.x-n,y:j.y-o,enabled:{[b]:c,[y]:d}}}}}},e3=function(t){return t===void 0&&(t={}),{options:t,fn(s){const{x:n,y:o,placement:i,rects:c,middlewareData:d}=s,{offset:m=0,mainAxis:f=!0,crossAxis:x=!0}=cn(t,s),v={x:n,y:o},y=Jn(i),b=xh(y);let k=v[b],S=v[y];const j=cn(m,s),w=typeof j=="number"?{mainAxis:j,crossAxis:0}:{mainAxis:0,crossAxis:0,...j};if(f){const A=b==="y"?"height":"width",_=c.reference[b]-c.floating[A]+w.mainAxis,D=c.reference[b]+c.reference[A]-w.mainAxis;k<_?k=_:k>D&&(k=D)}if(x){var E,C;const A=b==="y"?"width":"height",_=["top","left"].includes(dn(i)),D=c.reference[y]-c.floating[A]+(_&&((E=d.offset)==null?void 0:E[y])||0)+(_?0:w.crossAxis),O=c.reference[y]+c.reference[A]+(_?0:((C=d.offset)==null?void 0:C[y])||0)-(_?w.crossAxis:0);S<D?S=D:S>O&&(S=O)}return{[b]:k,[y]:S}}}},t3=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(s){var n,o;const{placement:i,rects:c,platform:d,elements:m}=s,{apply:f=()=>{},...x}=cn(t,s),v=await Wi(s,x),y=dn(i),b=Lo(i),k=Jn(i)==="y",{width:S,height:j}=c.floating;let w,E;y==="top"||y==="bottom"?(w=y,E=b===(await(d.isRTL==null?void 0:d.isRTL(m.floating))?"start":"end")?"left":"right"):(E=y,w=b==="end"?"top":"bottom");const C=j-v.top-v.bottom,A=S-v.left-v.right,_=Yn(j-v[w],C),D=Yn(S-v[E],A),O=!s.middlewareData.shift;
vendor: 10,039 bytes, line 9
9let F=_,P=D;if((n=s.middlewareData.shift)!=null&&n.enabled.x&&(P=A),(o=s.middlewareData.shift)!=null&&o.enabled.y&&(F=C),O&&!b){const z=Us(v.left,0),te=Us(v.right,0),ee=Us(v.top,0),se=Us(v.bottom,0);k?P=S-2*(z!==0||te!==0?z+te:Us(v.left,v.right)):F=j-2*(ee!==0||se!==0?ee+se:Us(v.top,v.bottom))}await f({...s,availableWidth:P,availableHeight:F});const Z=await d.getDimensions(m.floating);return S!==Z.width||j!==Z.height?{reset:{rects:!0}}:{}}}};function Td(){return typeof window<"u"}function Fo(t){return mb(t)?(t.nodeName||"").toLowerCase():"#document"}function Ks(t){var s;return(t==null||(s=t.ownerDocument)==null?void 0:s.defaultView)||window}function Hr(t){var s;return(s=(mb(t)?t.ownerDocument:t.document)||window.document)==null?void 0:s.documentElement}function mb(t){return Td()?t instanceof Node||t instanceof Ks(t).Node:!1}function Er(t){return Td()?t instanceof Element||t instanceof Ks(t).Element:!1}function Br(t){return Td()?t instanceof HTMLElement||t instanceof Ks(t).HTMLElement:!1}function Pv(t){return!Td()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Ks(t).ShadowRoot}function il(t){const{overflow:s,overflowX:n,overflowY:o,display:i}=_r(t);return/auto|scroll|overlay|hidden|clip/.test(s+o+n)&&!["inline","contents"].includes(i)}function s3(t){return["table","td","th"].includes(Fo(t))}function Rd(t){return[":popover-open",":modal"].some(s=>{try{return t.matches(s)}catch{return!1}})}function yh(t){const s=bh(),n=Er(t)?_r(t):t;return["transform","translate","scale","rotate","perspective"].some(o=>n[o]?n[o]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!s&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!s&&(n.filter?n.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(o=>(n.willChange||"").includes(o))||["paint","layout","strict","content"].some(o=>(n.contain||"").includes(o))}function r3(t){let s=Xn(t);for(;Br(s)&&!No(s);){if(yh(s))return s;if(Rd(s))return null;s=Xn(s)}return null}function bh(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function No(t){return["html","body","#document"].includes(Fo(t))}function _r(t){return Ks(t).getComputedStyle(t)}function Pd(t){return Er(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Xn(t){if(Fo(t)==="html")return t;const s=t.assignedSlot||t.parentNode||Pv(t)&&t.host||Hr(t);return Pv(s)?s.host:s}function fb(t){const s=Xn(t);return No(s)?t.ownerDocument?t.ownerDocument.body:t.body:Br(s)&&il(s)?s:fb(s)}function Ki(t,s,n){var o;s===void 0&&(s=[]),n===void 0&&(n=!0);const i=fb(t),c=i===((o=t.ownerDocument)==null?void 0:o.body),d=Ks(i);if(c){const m=Tf(d);return s.concat(d,d.visualViewport||[],il(i)?i:[],m&&n?Ki(m):[])}return s.concat(i,Ki(i,[],n))}function Tf(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function hb(t){const s=_r(t);let n=parseFloat(s.width)||0,o=parseFloat(s.height)||0;const i=Br(t),c=i?t.offsetWidth:n,d=i?t.offsetHeight:o,m=Jc(n)!==c||Jc(o)!==d;return m&&(n=c,o=d),{width:n,height:o,$:m}}function jh(t){return Er(t)?t:t.contextElement}function vo(t){const s=jh(t);if(!Br(s))return $r(1);const n=s.getBoundingClientRect(),{width:o,height:i,$:c}=hb(s);let d=(c?Jc(n.width):n.width)/o,m=(c?Jc(n.height):n.height)/i;return(!d||!Number.isFinite(d))&&(d=1),(!m||!Number.isFinite(m))&&(m=1),{x:d,y:m}}const n3=$r(0);function pb(t){const s=Ks(t);return!bh()||!s.visualViewport?n3:{x:s.visualViewport.offsetLeft,y:s.visualViewport.offsetTop}}function a3(t,s,n){return s===void 0&&(s=!1),!n||s&&n!==Ks(t)?!1:s}function Aa(t,s,n,o){s===void 0&&(s=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),c=jh(t);let d=$r(1);s&&(o?Er(o)&&(d=vo(o)):d=vo(t));const m=a3(c,n,o)?pb(c):$r(0);let f=(i.left+m.x)/d.x,x=(i.top+m.y)/d.y,v=i.width/d.x,y=i.height/d.y;if(c){const b=Ks(c),k=o&&Er(o)?Ks(o):o;let S=b,j=Tf(S);for(;j&&o&&k!==S;){const w=vo(j),E=j.getBoundingClientRect(),C=_r(j),A=E.left+(j.clientLeft+parseFloat(C.paddingLeft))*w.x,_=E.top+(j.clientTop+parseFloat(C.paddingTop))*w.y;f*=w.x,x*=w.y,v*=w.x,y*=w.y,f+=A,x+=_,S=Ks(j),j=Tf(S)}}return ed({width:v,height:y,x:f,y:x})}function wh(t,s){const n=Pd(t).scrollLeft;return s?s.left+n:Aa(Hr(t)).left+n}function xb(t,s,n){n===void 0&&(n=!1);const o=t.getBoundingClientRect(),i=o.left+s.scrollLeft-(n?0:wh(t,o)),c=o.top+s.scrollTop;return{x:i,y:c}}function o3(t){let{elements:s,rect:n,offsetParent:o,strategy:i}=t;const c=i==="fixed",d=Hr(o),m=s?Rd(s.floating):!1;if(o===d||m&&c)return n;let f={scrollLeft:0,scrollTop:0},x=$r(1);const v=$r(0),y=Br(o);if((y||!y&&!c)&&((Fo(o)!=="body"||il(d))&&(f=Pd(o)),Br(o))){const k=Aa(o);x=vo(o),v.x=k.x+o.clientLeft,v.y=k.y+o.clientTop}const b=d&&!y&&!c?xb(d,f,!0):$r(0);return{width:n.width*x.x,height:n.height*x.y,x:n.x*x.x-f.scrollLeft*x.x+v.x+b.x,y:n.y*x.y-f.scrollTop*x.y+v.y+b.y}}function i3(t){return Array.from(t.getClientRects())}function l3(t){const s=Hr(t),n=Pd(t),o=t.ownerDocument.body,i=Us(s.scrollWidth,s.clientWidth,o.scrollWidth,o.clientWidth),c=Us(s.scrollHeight,s.clientHeight,o.scrollHeight,o.clientHeight);let d=-n.scrollLeft+wh(t);const m=-n.scrollTop;return _r(o).direction==="rtl"&&(d+=Us(s.clientWidth,o.clientWidth)-i),{width:i,height:c,x:d,y:m}}function c3(t,s){const n=Ks(t),o=Hr(t),i=n.visualViewport;let c=o.clientWidth,d=o.clientHeight,m=0,f=0;if(i){c=i.width,d=i.height;const x=bh();(!x||x&&s==="fixed")&&(m=i.offsetLeft,f=i.offsetTop)}return{width:c,height:d,x:m,y:f}}function d3(t,s){const n=Aa(t,!0,s==="fixed"),o=n.top+t.clientTop,i=n.left+t.clientLeft,c=Br(t)?vo(t):$r(1),d=t.clientWidth*c.x,m=t.clientHeight*c.y,f=i*c.x,x=o*c.y;return{width:d,height:m,x:f,y:x}}function Mv(t,s,n){let o;if(s==="viewport")o=c3(t,n);else if(s==="document")o=l3(Hr(t));else if(Er(s))o=d3(s,n);else{const i=pb(t);o={x:s.x-i.x,y:s.y-i.y,width:s.width,height:s.height}}return ed(o)}function gb(t,s){const n=Xn(t);return n===s||!Er(n)||No(n)?!1:_r(n).position==="fixed"||gb(n,s)}function u3(t,s){const n=s.get(t);if(n)return n;let o=Ki(t,[],!1).filter(m=>Er(m)&&Fo(m)!=="body"),i=null;const c=_r(t).position==="fixed";let d=c?Xn(t):t;for(;Er(d)&&!No(d);){const m=_r(d),f=yh(d);!f&&m.position==="fixed"&&(i=null),(c?!f&&!i:!f&&m.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||il(d)&&!f&&gb(t,d))?o=o.filter(v=>v!==d):i=m,d=Xn(d)}return s.set(t,o),o}function m3(t){let{element:s,boundary:n,rootBoundary:o,strategy:i}=t;const d=[...n==="clippingAncestors"?Rd(s)?[]:u3(s,this._c):[].concat(n),o],m=d[0],f=d.reduce((x,v)=>{const y=Mv(s,v,i);return x.top=Us(y.top,x.top),x.right=Yn(y.right,x.right),x.bottom=Yn(y.bottom,x.bottom),x.left=Us(y.left,x.left),x},Mv(s,m,i));return{width:f.right-f.left,height:f.bottom-f.top,x:f.left,y:f.top}}function f3(t){const{width:s,height:n}=hb(t);return{width:s,height:n}}function h3(t,s,n){const o=Br(s),i=Hr(s),c=n==="fixed",d=Aa(t,!0,c,s);let m={scrollLeft:0,scrollTop:0};const f=$r(0);if(o||!o&&!c)if((Fo(s)!=="body"||il(i))&&(m=Pd(s)),o){const b=Aa(s,!0,c,s);f.x=b.x+s.clientLeft,f.y=b.y+s.clientTop}else i&&(f.x=wh(i));const x=i&&!o&&!c?xb(i,m):$r(0),v=d.left+m.scrollLeft-f.x-x.x,y=d.top+m.scrollTop-f.y-x.y;return{x:v,y,width:d.width,height:d.height}}function Ym(t){return _r(t).position==="static"}function Iv(t,s){if(!Br(t)||_r(t).position==="fixed")return null;if(s)return s(t);let n=t.offsetParent;return Hr(t)===n&&(n=n.ownerDocument.body),n}function vb(t,s){const n=Ks(t);if(Rd(t))return n;if(!Br(t)){let i=Xn(t);for(;i&&!No(i);){if(Er(i)&&!Ym(i))return i;i=Xn(i)}return n}let o=Iv(t,s);for(;o&&s3(o)&&Ym(o);)o=Iv(o,s);return o&&No(o)&&Ym(o)&&!yh(o)?n:o||r3(t)||n}const p3=async function(t){const s=this.getOffsetParent||vb,n=this.getDimensions,o=await n(t.floating);return{reference:h3(t.reference,await s(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function x3(t){return _r(t).direction==="rtl"}const g3={convertOffsetParentRelativeRectToViewportRelativeRect:o3,getDocumentElement:Hr,getClippingRect:m3,getOffsetParent:vb,getElementRects:p3,getClientRects:i3,getDimensions:f3,getScale:vo,isElement:Er,isRTL:x3};function yb(t,s){return t.x===s.x&&t.y===s.y&&t.width===s.width&&t.height===s.height}function v3(t,s){let n=null,o;const i=Hr(t);function c(){var m;clearTimeout(o),(m=n)==null||m.disconnect(),n=null}function d(m,f){m===void 0&&(m=!1),f===void 0&&(f=1),c();const x=t.getBoundingClientRect(),{left:v,top:y,width:b,height:k}=x;if(m||s(),!b||!k)return;const S=_c(y),j=_c(i.clientWidth-(v+b)),w=_c(i.clientHeight-(y+k)),E=_c(v),A={rootMargin:-S+"px "+-j+"px "+-w+"px "+-E+"px",threshold:Us(0,Yn(1,f))||1};let _=!0;function D(O){const F=O[0].intersectionRatio;if(F!==f){if(!_)return d();F?d(!1,F):o=setTimeout(()=>{d(!1,1e-7)},1e3)}F===1&&!yb(x,t.getBoundingClientRect())&&d(),_=!1}try{n=new IntersectionObserver(D,{...A,root:i.ownerDocument})}catch{n=new IntersectionObserver(D,A)}n.observe(t)}return d(!0),c}function y3(t,s,n,o){o===void 0&&(o={});const{ancestorScroll:i=!0,ancestorResize:c=!0,elementResize:d=typeof ResizeObserver=="function",layoutShift:m=typeof IntersectionObserver=="function",animationFrame:f=!1}=o,x=jh(t),v=i||c?[...x?Ki(x):[],...Ki(s)]:[];v.forEach(E=>{i&&E.addEventListener("scroll",n,{passive:!0}),c&&E.addEventListener("resize",n)});const y=x&&m?v3(x,n):null;let b=-1,k=null;d&&(k=new ResizeObserver(E=>{let[C]=E;C&&C.target===x&&k&&(k.unobserve(s),cancelAnimationFrame(b),b=requestAnimationFrame(()=>{var A;(A=k)==null||A.observe(s)})),n()}),x&&!f&&k.observe(x),k.observe(s));let S,j=f?Aa(t):null;f&&w();function w(){const E=Aa(t);j&&!yb(j,E)&&n(),j=E,S=requestAnimationFrame(w)}return n(),()=>{var E;v.forEach(C=>{i&&C.removeEventListener("scroll",n),c&&C.removeEventListener("resize",n)}),y?.(),(E=k)==null||E.disconnect(),k=null,f&&cancelAnimationFrame(S)}}const b3=J5,j3=X5,w3=G5,N3=t3,k3=Q5,Dv=Z5,C3=e3,S3=(t,s,n)=>{const o=new Map,i={platform:g3,...n},c={...i.platform,_c:o};return q5(t,s,{...i,platform:c})};var Oc=typeof document<"u"?p.useLayoutEffect:p.useEffect;function td(t,s){if(t===s)return!0;
vendor: 2,807 bytes, line 9
9if(typeof t!=typeof s)return!1;if(typeof t=="function"&&t.toString()===s.toString())return!0;let n,o,i;if(t&&s&&typeof t=="object"){if(Array.isArray(t)){if(n=t.length,n!==s.length)return!1;for(o=n;o--!==0;)if(!td(t[o],s[o]))return!1;return!0}if(i=Object.keys(t),n=i.length,n!==Object.keys(s).length)return!1;for(o=n;o--!==0;)if(!{}.hasOwnProperty.call(s,i[o]))return!1;for(o=n;o--!==0;){const c=i[o];if(!(c==="_owner"&&t.$$typeof)&&!td(t[c],s[c]))return!1}return!0}return t!==t&&s!==s}function bb(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function Ov(t,s){const n=bb(t);return Math.round(s*n)/n}function Jm(t){const s=p.useRef(t);return Oc(()=>{s.current=t}),s}function E3(t){t===void 0&&(t={});const{placement:s="bottom",strategy:n="absolute",middleware:o=[],platform:i,elements:{reference:c,floating:d}={},transform:m=!0,whileElementsMounted:f,open:x}=t,[v,y]=p.useState({x:0,y:0,strategy:n,placement:s,middlewareData:{},isPositioned:!1}),[b,k]=p.useState(o);td(b,o)||k(o);const[S,j]=p.useState(null),[w,E]=p.useState(null),C=p.useCallback(U=>{U!==O.current&&(O.current=U,j(U))},[]),A=p.useCallback(U=>{U!==F.current&&(F.current=U,E(U))},[]),_=c||S,D=d||w,O=p.useRef(null),F=p.useRef(null),P=p.useRef(v),Z=f!=null,z=Jm(f),te=Jm(i),ee=Jm(x),se=p.useCallback(()=>{if(!O.current||!F.current)return;const U={placement:s,strategy:n,middleware:b};te.current&&(U.platform=te.current),S3(O.current,F.current,U).then(q=>{const V={...q,isPositioned:ee.current!==!1};I.current&&!td(P.current,V)&&(P.current=V,Po.flushSync(()=>{y(V)}))})},[b,s,n,te,ee]);Oc(()=>{x===!1&&P.current.isPositioned&&(P.current.isPositioned=!1,y(U=>({...U,isPositioned:!1})))},[x]);const I=p.useRef(!1);Oc(()=>(I.current=!0,()=>{I.current=!1}),[]),Oc(()=>{if(_&&(O.current=_),D&&(F.current=D),_&&D){if(z.current)return z.current(_,D,se);se()}},[_,D,se,z,Z]);const le=p.useMemo(()=>({reference:O,floating:F,setReference:C,setFloating:A}),[C,A]),ne=p.useMemo(()=>({reference:_,floating:D}),[_,D]),J=p.useMemo(()=>{const U={position:n,left:0,top:0};if(!ne.floating)return U;const q=Ov(ne.floating,v.x),V=Ov(ne.floating,v.y);return m?{...U,transform:"translate("+q+"px, "+V+"px)",...bb(ne.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:q,top:V}},[n,m,ne.floating,v.x,v.y]);return p.useMemo(()=>({...v,update:se,refs:le,elements:ne,floatingStyles:J}),[v,se,le,ne,J])}const _3=t=>{function s(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:t,fn(n){const{element:o,padding:i}=typeof t=="function"?t(n):t;return o&&s(o)?o.current!=null?Dv({element:o.current,padding:i}).fn(n):{}:o?Dv({element:o,padding:i}).fn(n):{}}}},A3=(t,s)=>({...b3(t),options:[t,s]}),T3=(t,s)=>({...j3(t),options:[t,s]}),R3=(t,s)=>({...C3(t),options:[t,s]}),P3=(t,s)=>({...w3(t),options:[t,s]}
vendor: 5,418 bytes, line 9
9),M3=(t,s)=>({...N3(t),options:[t,s]}),I3=(t,s)=>({...k3(t),options:[t,s]}),D3=(t,s)=>({..._3(t),options:[t,s]});var O3="Arrow",jb=p.forwardRef((t,s)=>{const{children:n,width:o=10,height:i=5,...c}=t;return e.jsx(Fe.svg,{...c,ref:s,width:o,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?n:e.jsx("polygon",{points:"0,0 30,0 15,10"})})});jb.displayName=O3;var L3=jb;function Nh(t){const[s,n]=p.useState(void 0);return ls(()=>{if(t){n({width:t.offsetWidth,height:t.offsetHeight});const o=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const c=i[0];let d,m;if("borderBoxSize"in c){const f=c.borderBoxSize,x=Array.isArray(f)?f[0]:f;d=x.inlineSize,m=x.blockSize}else d=t.offsetWidth,m=t.offsetHeight;n({width:d,height:m})});return o.observe(t,{box:"border-box"}),()=>o.unobserve(t)}else n(void 0)},[t]),s}var kh="Popper",[wb,$o]=Ls(kh),[F3,Nb]=wb(kh),kb=t=>{const{__scopePopper:s,children:n}=t,[o,i]=p.useState(null);return e.jsx(F3,{scope:s,anchor:o,onAnchorChange:i,children:n})};kb.displayName=kh;var Cb="PopperAnchor",Sb=p.forwardRef((t,s)=>{const{__scopePopper:n,virtualRef:o,...i}=t,c=Nb(Cb,n),d=p.useRef(null),m=nt(s,d);return p.useEffect(()=>{c.onAnchorChange(o?.current||d.current)}),o?null:e.jsx(Fe.div,{...i,ref:m})});Sb.displayName=Cb;var Ch="PopperContent",[$3,V3]=wb(Ch),Eb=p.forwardRef((t,s)=>{const{__scopePopper:n,side:o="bottom",sideOffset:i=0,align:c="center",alignOffset:d=0,arrowPadding:m=0,avoidCollisions:f=!0,collisionBoundary:x=[],collisionPadding:v=0,sticky:y="partial",hideWhenDetached:b=!1,updatePositionStrategy:k="optimized",onPlaced:S,...j}=t,w=Nb(Ch,n),[E,C]=p.useState(null),A=nt(s,fe=>C(fe)),[_,D]=p.useState(null),O=Nh(_),F=O?.width??0,P=O?.height??0,Z=o+(c!=="center"?"-"+c:""),z=typeof v=="number"?v:{top:0,right:0,bottom:0,left:0,...v},te=Array.isArray(x)?x:[x],ee=te.length>0,se={padding:z,boundary:te.filter(B3),altBoundary:ee},{refs:I,floatingStyles:le,placement:ne,isPositioned:J,middlewareData:U}=E3({strategy:"fixed",placement:Z,whileElementsMounted:(...fe)=>y3(...fe,{animationFrame:k==="always"}),elements:{reference:w.anchor},middleware:[A3({mainAxis:i+P,alignmentAxis:d}),f&&T3({mainAxis:!0,crossAxis:!1,limiter:y==="partial"?R3():void 0,...se}),f&&P3({...se}),M3({...se,apply:({elements:fe,rects:De,availableWidth:$e,availableHeight:qe})=>{const{width:pe,height:je}=De.reference,we=fe.floating.style;we.setProperty("--radix-popper-available-width",`${$e}px`),we.setProperty("--radix-popper-available-height",`${qe}px`),we.setProperty("--radix-popper-anchor-width",`${pe}px`),we.setProperty("--radix-popper-anchor-height",`${je}px`)}}),_&&D3({element:_,padding:m}),U3({arrowWidth:F,arrowHeight:P}),b&&I3({strategy:"referenceHidden",...se})]}),[q,V]=Tb(ne),R=xs(S);ls(()=>{J&&R?.()},[J,R]);const Q=U.arrow?.x,Ne=U.arrow?.y,Pe=U.arrow?.centerOffset!==0,[ze,Ve]=p.useState();return ls(()=>{E&&Ve(window.getComputedStyle(E).zIndex)},[E]),e.jsx("div",{ref:I.setFloating,"data-radix-popper-content-wrapper":"",style:{...le,transform:J?le.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ze,"--radix-popper-transform-origin":[U.transformOrigin?.x,U.transformOrigin?.y].join(" "),...U.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:e.jsx($3,{scope:n,placedSide:q,onArrowChange:D,arrowX:Q,arrowY:Ne,shouldHideArrow:Pe,children:e.jsx(Fe.div,{"data-side":q,"data-align":V,...j,ref:A,style:{...j.style,animation:J?void 0:"none"}})})})});Eb.displayName=Ch;var _b="PopperArrow",z3={top:"bottom",right:"left",bottom:"top",left:"right"},Ab=p.forwardRef(function(s,n){const{__scopePopper:o,...i}=s,c=V3(_b,o),d=z3[c.placedSide];return e.jsx("span",{ref:c.onArrowChange,style:{position:"absolute",left:c.arrowX,top:c.arrowY,[d]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[c.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[c.placedSide],visibility:c.shouldHideArrow?"hidden":void 0},children:e.jsx(L3,{...i,ref:n,style:{...i.style,display:"block"}})})});Ab.displayName=_b;function B3(t){return t!==null}var U3=t=>({name:"transformOrigin",options:t,fn(s){const{placement:n,rects:o,middlewareData:i}=s,d=i.arrow?.centerOffset!==0,m=d?0:t.arrowWidth,f=d?0:t.arrowHeight,[x,v]=Tb(n),y={start:"0%",center:"50%",end:"100%"}[v],b=(i.arrow?.x??0)+m/2,k=(i.arrow?.y??0)+f/2;let S="",j="";return x==="bottom"?(S=d?y:`${b}px`,j=`${-f}px`):x==="top"?(S=d?y:`${b}px`,j=`${o.floating.height+f}px`):x==="right"?(S=`${-f}px`,j=d?y:`${k}px`):x==="left"&&(S=`${o.floating.width+f}px`,j=d?y:`${k}px`),{data:{x:S,y:j}}}});function Tb(t){const[s,n="center"]=t.split("-");return[s,n]}var Sh=kb,Eh=Sb,_h=Eb,Ah=Ab,[Md]=Ls("Tooltip",[$o]),Id=$o(),Rb="TooltipProvider",H3=700,Rf="tooltip.open",[W3,Th]=Md(Rb),Pb=t=>{const{__scopeTooltip:s,delayDuration:n=H3,skipDelayDuration:o=300,disableHoverableContent:i=!1,children:c}=t,d=p.useRef(!0),m=p.useRef(!1),f=p.useRef(0);return p.useEffect(()=>{const x=f.current;return()=>window.clearTimeout(x)},[]),e.jsx(W3,{scope:s,isOpenDelayedRef:d,delayDuration:n,onOpen:p.useCallback(()=>{window.clearTimeout(f.current),d.current=!1},[]),onClose:p.useCallback(()=>{window.clearTimeout(f.current),f.current=window.setTimeout(()=>d.current=!0,o)},[o]),isPointerInTransitRef:m,onPointerInTransitChange:p.useCallback(x=>{m.current=x}
vendor: 5,563 bytes, line 9
9,[]),disableHoverableContent:i,children:c})};Pb.displayName=Rb;var Dd="Tooltip",[K3,Od]=Md(Dd),Mb=t=>{const{__scopeTooltip:s,children:n,open:o,defaultOpen:i=!1,onOpenChange:c,disableHoverableContent:d,delayDuration:m}=t,f=Th(Dd,t.__scopeTooltip),x=Id(s),[v,y]=p.useState(null),b=cr(),k=p.useRef(0),S=d??f.disableHoverableContent,j=m??f.delayDuration,w=p.useRef(!1),[E=!1,C]=Sr({prop:o,defaultProp:i,onChange:F=>{F?(f.onOpen(),document.dispatchEvent(new CustomEvent(Rf))):f.onClose(),c?.(F)}}),A=p.useMemo(()=>E?w.current?"delayed-open":"instant-open":"closed",[E]),_=p.useCallback(()=>{window.clearTimeout(k.current),k.current=0,w.current=!1,C(!0)},[C]),D=p.useCallback(()=>{window.clearTimeout(k.current),k.current=0,C(!1)},[C]),O=p.useCallback(()=>{window.clearTimeout(k.current),k.current=window.setTimeout(()=>{w.current=!0,C(!0),k.current=0},j)},[j,C]);return p.useEffect(()=>()=>{k.current&&(window.clearTimeout(k.current),k.current=0)},[]),e.jsx(Sh,{...x,children:e.jsx(K3,{scope:s,contentId:b,open:E,stateAttribute:A,trigger:v,onTriggerChange:y,onTriggerEnter:p.useCallback(()=>{f.isOpenDelayedRef.current?O():_()},[f.isOpenDelayedRef,O,_]),onTriggerLeave:p.useCallback(()=>{S?D():(window.clearTimeout(k.current),k.current=0)},[D,S]),onOpen:_,onClose:D,disableHoverableContent:S,children:n})})};Mb.displayName=Dd;var Pf="TooltipTrigger",Ib=p.forwardRef((t,s)=>{const{__scopeTooltip:n,...o}=t,i=Od(Pf,n),c=Th(Pf,n),d=Id(n),m=p.useRef(null),f=nt(s,m,i.onTriggerChange),x=p.useRef(!1),v=p.useRef(!1),y=p.useCallback(()=>x.current=!1,[]);return p.useEffect(()=>()=>document.removeEventListener("pointerup",y),[y]),e.jsx(Eh,{asChild:!0,...d,children:e.jsx(Fe.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...o,ref:f,onPointerMove:be(t.onPointerMove,b=>{b.pointerType!=="touch"&&!v.current&&!c.isPointerInTransitRef.current&&(i.onTriggerEnter(),v.current=!0)}),onPointerLeave:be(t.onPointerLeave,()=>{i.onTriggerLeave(),v.current=!1}),onPointerDown:be(t.onPointerDown,()=>{i.open&&i.onClose(),x.current=!0,document.addEventListener("pointerup",y,{once:!0})}),onFocus:be(t.onFocus,()=>{x.current||i.onOpen()}),onBlur:be(t.onBlur,i.onClose),onClick:be(t.onClick,i.onClose)})})});Ib.displayName=Pf;var q3="TooltipPortal",[xM,Z3]=Md(q3,{forceMount:void 0}),ko="TooltipContent",Db=p.forwardRef((t,s)=>{const n=Z3(ko,t.__scopeTooltip),{forceMount:o=n.forceMount,side:i="top",...c}=t,d=Od(ko,t.__scopeTooltip);return e.jsx(Ys,{present:o||d.open,children:d.disableHoverableContent?e.jsx(Ob,{side:i,...c,ref:s}):e.jsx(G3,{side:i,...c,ref:s})})}),G3=p.forwardRef((t,s)=>{const n=Od(ko,t.__scopeTooltip),o=Th(ko,t.__scopeTooltip),i=p.useRef(null),c=nt(s,i),[d,m]=p.useState(null),{trigger:f,onClose:x}=n,v=i.current,{onPointerInTransitChange:y}=o,b=p.useCallback(()=>{m(null),y(!1)},[y]),k=p.useCallback((S,j)=>{const w=S.currentTarget,E={x:S.clientX,y:S.clientY},C=eE(E,w.getBoundingClientRect()),A=tE(E,C),_=sE(j.getBoundingClientRect()),D=nE([...A,..._]);m(D),y(!0)},[y]);return p.useEffect(()=>()=>b(),[b]),p.useEffect(()=>{if(f&&v){const S=w=>k(w,v),j=w=>k(w,f);return f.addEventListener("pointerleave",S),v.addEventListener("pointerleave",j),()=>{f.removeEventListener("pointerleave",S),v.removeEventListener("pointerleave",j)}}},[f,v,k,b]),p.useEffect(()=>{if(d){const S=j=>{const w=j.target,E={x:j.clientX,y:j.clientY},C=f?.contains(w)||v?.contains(w),A=!rE(E,d);C?b():A&&(b(),x())};return document.addEventListener("pointermove",S),()=>document.removeEventListener("pointermove",S)}},[f,v,d,x,b]),e.jsx(Ob,{...t,ref:c})}),[Q3,Y3]=Md(Dd,{isInside:!1}),J3=PC("TooltipContent"),Ob=p.forwardRef((t,s)=>{const{__scopeTooltip:n,children:o,"aria-label":i,onEscapeKeyDown:c,onPointerDownOutside:d,...m}=t,f=Od(ko,n),x=Id(n),{onClose:v}=f;return p.useEffect(()=>(document.addEventListener(Rf,v),()=>document.removeEventListener(Rf,v)),[v]),p.useEffect(()=>{if(f.trigger){const y=b=>{b.target?.contains(f.trigger)&&v()};return window.addEventListener("scroll",y,{capture:!0}),()=>window.removeEventListener("scroll",y,{capture:!0})}},[f.trigger,v]),e.jsx(Mo,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:c,onPointerDownOutside:d,onFocusOutside:y=>y.preventDefault(),onDismiss:v,children:e.jsxs(_h,{"data-state":f.stateAttribute,...x,...m,ref:s,style:{...m.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:[e.jsx(J3,{children:o}),e.jsx(Q3,{scope:n,isInside:!0,children:e.jsx(JC,{id:f.contentId,role:"tooltip",children:i||o})})]})})});Db.displayName=ko;var Lb="TooltipArrow",X3=p.forwardRef((t,s)=>{const{__scopeTooltip:n,...o}=t,i=Id(n);return Y3(Lb,n).isInside?null:e.jsx(Ah,{...i,...o,ref:s})});X3.displayName=Lb;function eE(t,s){const n=Math.abs(s.top-t.y),o=Math.abs(s.bottom-t.y),i=Math.abs(s.right-t.x),c=Math.abs(s.left-t.x);switch(Math.min(n,o,i,c)){case c:return"left";case i:return"right";case n:return"top";case o:return"bottom";default:throw new Error("unreachable")}}function tE(t,s,n=5){const o=[];switch(s){case"top":o.push({x:t.x-n,y:t.y+n},{x:t.x+n,y:t.y+n});break;case"bottom":o.push({x:t.x-n,y:t.y-n},{x:t.x+n,y:t.y-n});break;case"left":o.push({x:t.x+n,y:t.y-n},{x:t.x+n,y:t.y+n});break;case"right":o.push({x:t.x-n,y:t.y-n},{x:t.x-n,y:t.y+n});break}return o}
9function sE(t){const{top:s,right:n,bottom:o,left:i}=t;return[{x:i,y:s},{x:n,y:s},{x:n,y:o},{x:i,y:o}]}function rE(t,s){const{x:n,y:o}=t;let i=!1;for(let c=0,d=s.length-1;c<s.length;d=c++){const m=s[c].x,f=s[c].y,x=s[d].x,v=s[d].y;f>o!=v>o&&n<(x-m)*(o-f)/(v-f)+m&&(i=!i)}return i}function nE(t){const s=t.slice();return s.sort((n,o)=>n.x<o.x?-1:n.x>o.x?1:n.y<o.y?-1:n.y>o.y?1:0),aE(s)}function aE(t){if(t.length<=1)return t.slice();const s=[];for(let o=0;o<t.length;o++){const i=t[o];for(;s.length>=2;){const c=s[s.length-1],d=s[s.length-2];if((c.x-d.x)*(i.y-d.y)>=(c.y-d.y)*(i.x-d.x))s.pop();else break}s.push(i)}s.pop();const n=[];for(let o=t.length-1;o>=0;o--){const i=t[o];for(;n.length>=2;){const c=n[n.length-1],d=n[n.length-2];if((c.x-d.x)*(i.y-d.y)>=(c.y-d.y)*(i.x-d.x))n.pop();else break}n.push(i)}return n.pop(),s.length===1&&n.length===1&&s[0].x===n[0].x&&s[0].y===n[0].y?s:s.concat(n)}var oE=Pb,iE=Mb,lE=Ib,Fb=Db;const cE=oE,Rh=iE,Ph=lE,Ld=p.forwardRef(({className:t,sideOffset:s=4,...n},o)=>e.jsx(Fb,{ref:o,sideOffset:s,className:re("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 origin-[--radix-tooltip-content-transform-origin]",t),...n}));Ld.displayName=Fb.displayName;const Ii={authenticated:!1,authMethod:null,address:null,kycVerified:!1,kycAttestationId:null,buyerTokenId:null,tbaAddress:null,googleId:null,googleEmail:null,googleName:null,googlePicture:null},$b=p.createContext({session:Ii,loading:!0,connecting:!1,connect:async()=>{},linkWallet:async()=>{},signChallenge:async()=>{},disconnect:async()=>{},attestKyc:async()=>{},mintBuyerAgent:async()=>{},refreshSession:async()=>{},setGoogleSession:()=>{}});function fr(){return p.useContext($b)}function dE({children:t}){const{toast:s}=Yt(),[n,o]=p.useState(Ii),[i,c]=p.useState(!0),[d,m]=p.useState(!1),f=p.useRef(!1),x=p.useCallback(async()=>{try{const A=await(await fetch("/api/auth/session",{credentials:"include",cache:"no-store"})).json();A.authenticated?o({authenticated:!0,authMethod:A.authMethod||"wallet",address:A.address,kycVerified:A.kycVerified,kycAttestationId:A.kycAttestationId,buyerTokenId:A.buyerTokenId,tbaAddress:A.tbaAddress,googleId:A.googleId||null,googleEmail:A.googleEmail||null,googleName:A.googleName||null,googlePicture:A.googlePicture||null}):o(Ii)}catch{o(Ii)}finally{c(!1)}},[]);p.useEffect(()=>{x()},[x]),p.useEffect(()=>{const C=()=>{f.current||S()};return window.ethereum?.on&&window.ethereum.on("accountsChanged",C),()=>{window.ethereum?.removeListener&&window.ethereum.removeListener("accountsChanged",C)}},[]);const v=p.useCallback(async C=>{if(!window.ethereum)throw new Error(C==="metamask"?"MetaMask not found. Please install MetaMask.":"Coinbase Wallet not found. Please install Coinbase Wallet.");const A=await window.ethereum.request({method:"eth_requestAccounts"});if(!A||A.length===0)throw new Error("No accounts returned");const _=A[0],D=await dt("POST","/api/auth/challenge",{address:_}),{message:O}=await D.json(),F=await window.ethereum.request({method:"personal_sign",params:[O,_]});return{address:_,signature:F,message:O}},[]),y=p.useCallback(async C=>{m(!0),f.current=!0;try{const{address:A,signature:_,message:D}=await v(C),F=await(await dt("POST","/api/auth/verify",{address:A,signature:_,message:D})).json();o({authenticated:!0,authMethod:"wallet",address:F.address,kycVerified:F.kycVerified,kycAttestationId:F.kycAttestationId,buyerTokenId:F.buyerTokenId,tbaAddress:F.tbaAddress,googleId:null,googleEmail:null,googleName:null,googlePicture:null}),ct.invalidateQueries(),s({title:"Wallet connected",description:`Signed in as ${A.slice(0,6)}...${A.slice(-4)}`})}catch(A){A.code===4001?s({title:"Connection rejected",description:"You rejected the wallet connection request"}):s({title:"Connection failed",description:A.message,variant:"destructive"})}finally{m(!1),f.current=!1}},[s,v]),b=p.useCallback(async C=>{m(!0),f.current=!0;try{const{address:A,signature:_,message:D}=await v(C);let O=null;try{O=sessionStorage.getItem("ob_approve_token")}catch{}const P=await(await dt("POST","/api/auth/link-wallet",{address:A,signature:_,message:D,...O?{approveToken:O}:{}})).json();o(Z=>({...Z,address:P.address,authMethod:"google+wallet"}
9)),ct.invalidateQueries(),s({title:"Wallet linked",description:`Linked ${A.slice(0,6)}...${A.slice(-4)} to your Google account`})}catch(A){A.code===4001?s({title:"Rejected",description:"You rejected the wallet link request"}):s({title:"Wallet link failed",description:A.message,variant:"destructive"})}finally{m(!1),f.current=!1}},[s,v]),k=p.useCallback(async()=>{if(!(!window.ethereum||!n.address)){m(!0);try{const C=await dt("POST","/api/auth/challenge",{address:n.address}),{message:A}=await C.json(),_=await window.ethereum.request({method:"personal_sign",params:[A,n.address]}),O=await(await dt("POST","/api/auth/verify",{address:n.address,signature:_,message:A})).json();o(F=>({...F,...O,authenticated:!0})),s({title:"Ownership verified",description:"EIP-191 signature verified successfully"})}catch(C){s({title:"Verification failed",description:C.message,variant:"destructive"})}finally{m(!1)}}},[n.address,s]),S=p.useCallback(async()=>{try{await dt("POST","/api/auth/disconnect")}catch{}o(Ii),ct.invalidateQueries(),s({title:"Signed out"})},[s]),j=p.useCallback(async()=>{try{const A=await(await dt("POST","/api/auth/attest-kyc")).json();o(_=>({..._,kycVerified:A.kycVerified??!1,kycAttestationId:A.attestationId??null})),A.status==="pending"?s({title:"KYC pending",description:A.message}):s({title:"KYC verified",description:"EAS attestation on Base confirmed"})}catch(C){s({title:"KYC failed",description:C.message,variant:"destructive"})}},[s]),w=p.useCallback(async()=>{try{const A=await(await dt("POST","/api/auth/mint-buyer-agent")).json();o(_=>({..._,buyerTokenId:A.tokenId??null,tbaAddress:A.tbaAddress??null})),A.status==="pending"?s({title:"Minting pending",description:A.message}):s({title:"Buyer Agent NFT minted",description:`Token #${A.tokenId} with TBA deployed`})}catch(C){s({title:"Mint failed",description:C.message,variant:"destructive"})}},[s]),E=p.useCallback(C=>{o({authenticated:!0,authMethod:C.authMethod||(C.address?"google+wallet":"google"),address:C.address||null,kycVerified:!1,kycAttestationId:null,buyerTokenId:null,tbaAddress:null,googleId:C.googleId,googleEmail:C.googleEmail,googleName:C.googleName??null,googlePicture:C.googlePicture??null}),c(!1)},[]);return e.jsx($b.Provider,{value:{session:n,loading:i,connecting:d,connect:y,linkWallet:b,signChallenge:k,disconnect:S,attestKyc:j,mintBuyerAgent:w,refreshSession:x,setGoogleSession:E},children:t})}var Xm="focusScope.autoFocusOnMount",ef="focusScope.autoFocusOnUnmount",Lv={bubbles:!1,cancelable:!0},uE="FocusScope",Fd=p.forwardRef((t,s)=>{const{loop:n=!1,trapped:o=!1,onMountAutoFocus:i,onUnmountAutoFocus:c,...d}=t,[m,f]=p.useState(null),x=xs(i),v=xs(c),y=p.useRef(null),b=nt(s,j=>f(j)),k=p.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;p.useEffect(()=>{if(o){let j=function(A){if(k.paused||!m)return;const _=A.target;m.contains(_)?y.current=_:zn(y.current,{select:!0})},w=function(A){if(k.paused||!m)return;const _=A.relatedTarget;_!==null&&(m.contains(_)||zn(y.current,{select:!0}))},E=function(A){if(document.activeElement===document.body)for(const D of A)D.removedNodes.length>0&&zn(m)};document.addEventListener("focusin",j),document.addEventListener("focusout",w);const C=new MutationObserver(E);return m&&C.observe(m,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",j),document.removeEventListener("focusout",w),C.disconnect()}}},[o,m,k.paused]),p.useEffect(()=>{if(m){$v.add(k);const j=document.activeElement;if(!m.contains(j)){const E=new CustomEvent(Xm,Lv);m.addEventListener(Xm,x),m.dispatchEvent(E),E.defaultPrevented||(mE(gE(Vb(m)),{select:!0}),document.activeElement===j&&zn(m))}return()=>{m.removeEventListener(Xm,x),setTimeout(()=>{const E=new CustomEvent(ef,Lv);m.addEventListener(ef,v),m.dispatchEvent(E),E.defaultPrevented||zn(j??document.body,{select:!0}),m.removeEventListener(ef,v),$v.remove(k)},0)}}},[m,x,v,k]);const S=p.useCallback(j=>{if(!n&&!o||k.paused)return;const w=j.key==="Tab"&&!j.altKey&&!j.ctrlKey&&!j.metaKey,E=document.activeElement;if(w&&E){const C=j.currentTarget,[A,_]=fE(C);A&&_?!j.shiftKey&&E===_?(j.preventDefault(),n&&zn(A,{select:!0})):j.shiftKey&&E===A&&(j.preventDefault(),n&&zn(_,{select:!0})):E===C&&j.preventDefault()}},[n,o,k.paused]);return e.jsx(Fe.div,{tabIndex:-1,...d,ref:b,onKeyDown:S})});Fd.displayName=uE;function mE(t,{select:s=!1}={}){const n=document.activeElement;for(const o of t)if(zn(o,{select:s}),document.activeElement!==n)return}function fE(t){const s=Vb(t),n=Fv(s,t),o=Fv(s.reverse(),t);return[n,o]}function Vb(t){const s=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:o=>{const i=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||i?NodeFilter.FILTER_SKIP:o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)s.push(n.currentNode);return s}function Fv(t,s){for(const n of t)if(!hE(n,{upTo:s}))return n}function hE(t,{upTo:s}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(s!==void 0&&t===s)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function pE(t){return t instanceof HTMLInputElement&&"select"in t}function zn(t,{select:s=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&pE(t)&&s&&t.select()}}var $v=xE();function xE(){let t=[];return{add(s){const n=t[0];s!==n&&n?.pause(),t=Vv(t,s),t.unshift(s)},remove(s){t=Vv(t,s),t[0]?.resume()}}}function Vv(t,s){const n=[...t],o=n.indexOf(s);return o!==-1&&n.splice(o,1),n}function gE(t){return t.filter(s=>s.tagName!=="A")}var tf=0;function Mh(){p.useEffect(()=>{const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",t[0]??zv()),document.body.insertAdjacentElement("beforeend",t[1]??zv()),tf++,()=>{tf===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(s=>s.remove()),tf--}},[])}function zv(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}var Or=function(){return Or=Object.assign||function(s){for(var n,o=1,i=arguments.length;o<i;o++){n=arguments[o];for(var c in n)Object.prototype.hasOwnProperty.call(n,c)&&(s[c]=n[c])}return s},Or.apply(this,arguments)};function zb(t,s){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&s.indexOf(o)<0&&(n[o]=t[o
vendor: 5,229 bytes, lines 9-24
9]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,o=Object.getOwnPropertySymbols(t);i<o.length;i++)s.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(t,o[i])&&(n[o[i]]=t[o[i]]);return n}function vE(t,s,n){if(n||arguments.length===2)for(var o=0,i=s.length,c;o<i;o++)(c||!(o in s))&&(c||(c=Array.prototype.slice.call(s,0,o)),c[o]=s[o]);return t.concat(c||Array.prototype.slice.call(s))}var Lc="right-scroll-bar-position",Fc="width-before-scroll-bar",yE="with-scroll-bars-hidden",bE="--removed-body-scroll-bar-size";function sf(t,s){return typeof t=="function"?t(s):t&&(t.current=s),t}function jE(t,s){var n=p.useState(function(){return{value:t,callback:s,facade:{get current(){return n.value},set current(o){var i=n.value;i!==o&&(n.value=o,n.callback(o,i))}}}})[0];return n.callback=s,n.facade}var wE=typeof window<"u"?p.useLayoutEffect:p.useEffect,Bv=new WeakMap;function NE(t,s){var n=jE(null,function(o){return t.forEach(function(i){return sf(i,o)})});return wE(function(){var o=Bv.get(n);if(o){var i=new Set(o),c=new Set(t),d=n.current;i.forEach(function(m){c.has(m)||sf(m,null)}),c.forEach(function(m){i.has(m)||sf(m,d)})}Bv.set(n,t)},[t]),n}function kE(t){return t}function CE(t,s){s===void 0&&(s=kE);var n=[],o=!1,i={read:function(){if(o)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]:t},useMedium:function(c){var d=s(c,o);return n.push(d),function(){n=n.filter(function(m){return m!==d})}},assignSyncMedium:function(c){for(o=!0;n.length;){var d=n;n=[],d.forEach(c)}n={push:function(m){return c(m)},filter:function(){return n}}},assignMedium:function(c){o=!0;var d=[];if(n.length){var m=n;n=[],m.forEach(c),d=n}var f=function(){var v=d;d=[],v.forEach(c)},x=function(){return Promise.resolve().then(f)};x(),n={push:function(v){d.push(v),x()},filter:function(v){return d=d.filter(v),n}}}};return i}function SE(t){t===void 0&&(t={});var s=CE(null);return s.options=Or({async:!0,ssr:!1},t),s}var Bb=function(t){var s=t.sideCar,n=zb(t,["sideCar"]);if(!s)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var o=s.read();if(!o)throw new Error("Sidecar medium not found");return p.createElement(o,Or({},n))};Bb.isSideCarExport=!0;function EE(t,s){return t.useMedium(s),Bb}var Ub=SE(),rf=function(){},$d=p.forwardRef(function(t,s){var n=p.useRef(null),o=p.useState({onScrollCapture:rf,onWheelCapture:rf,onTouchMoveCapture:rf}),i=o[0],c=o[1],d=t.forwardProps,m=t.children,f=t.className,x=t.removeScrollBar,v=t.enabled,y=t.shards,b=t.sideCar,k=t.noIsolation,S=t.inert,j=t.allowPinchZoom,w=t.as,E=w===void 0?"div":w,C=t.gapMode,A=zb(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),_=b,D=NE([n,s]),O=Or(Or({},A),i);return p.createElement(p.Fragment,null,v&&p.createElement(_,{sideCar:Ub,removeScrollBar:x,shards:y,noIsolation:k,inert:S,setCallbacks:c,allowPinchZoom:!!j,lockRef:n,gapMode:C}),d?p.cloneElement(p.Children.only(m),Or(Or({},O),{ref:D})):p.createElement(E,Or({},O,{className:f,ref:D}),m))});$d.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};$d.classNames={fullWidth:Fc,zeroRight:Lc};var _E=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function AE(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var s=_E();return s&&t.setAttribute("nonce",s),t}function TE(t,s){t.styleSheet?t.styleSheet.cssText=s:t.appendChild(document.createTextNode(s))}function RE(t){var s=document.head||document.getElementsByTagName("head")[0];s.appendChild(t)}var PE=function(){var t=0,s=null;return{add:function(n){t==0&&(s=AE())&&(TE(s,n),RE(s)),t++},remove:function(){t--,!t&&s&&(s.parentNode&&s.parentNode.removeChild(s),s=null)}}},ME=function(){var t=PE();return function(s,n){p.useEffect(function(){return t.add(s),function(){t.remove()}},[s&&n])}},Hb=function(){var t=ME(),s=function(n){var o=n.styles,i=n.dynamic;return t(o,i),null};return s},IE={left:0,top:0,right:0,gap:0},nf=function(t){return parseInt(t||"",10)||0},DE=function(t){var s=window.getComputedStyle(document.body),n=s[t==="padding"?"paddingLeft":"marginLeft"],o=s[t==="padding"?"paddingTop":"marginTop"],i=s[t==="padding"?"paddingRight":"marginRight"];return[nf(n),nf(o),nf(i)]},OE=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return IE;var s=DE(t),n=document.documentElement.clientWidth,o=window.innerWidth;return{left:s[0],top:s[1],right:s[2],gap:Math.max(0,o-n+s[2]-s[0])}},LE=Hb(),yo="data-scroll-locked",FE=function(t,s,n,o){var i=t.left,c=t.top,d=t.right,m=t.gap;return n===void 0&&(n="margin"),` 10 .`.concat(yE,` { 11 overflow: hidden `).concat(o,`; 12 padding-right: `).concat(m,"px ").concat(o,`; 13 } 14 body[`).concat(yo,`] { 15 overflow: hidden `).concat(o,`; 16 overscroll-behavior: contain; 17 `).concat([s&&"position: relative ".concat(o,";"),n==="margin"&&` 18 padding-left: `.concat(i,`px; 19 padding-top: `).concat(c,`px; 20 padding-right: `).concat(d,`px; 21 margin-left:0; 22 margin-top:0; 23 margin-right: `).concat(m,"px ").concat(o,`; 24 `),n==="padding"&&"padding-right: ".concat(m,"px ").concat(o,";
24")].filter(Boolean).join(""),` 25 } 26 27 .`).concat(Lc,` { 28 right: `).concat(m,"px ").concat(o,`; 29 } 30 31 .`).concat(Fc,` { 32 margin-right: `).concat(m,"px ").concat(o,`; 33 } 34 35 .`).concat(Lc," .").concat(Lc,` { 36 right: 0 `).concat(o,`; 37 } 38 39 .`).concat(Fc," .").concat(Fc,` { 40 margin-right: 0 `).concat(o,`; 41 } 42 43 body[`).concat(yo,`] { 44 `).concat(bE,": ").concat(m,`px; 45 } 46`)},Uv=function(){var t=parseInt(document.body.getAttribute(yo)||"0",10);return isFinite(t)?t:0},$E=function(){p.useEffect(function(){return document.body.setAttribute(yo,(Uv()+1).toString()),function(){var t=Uv()-1;t<=0?document.body.removeAttribute(yo):document.body.setAttribute(yo,t.toString())}},[])},VE=function(t){var s=t.noRelative,n=t.noImportant,o=t.gapMode,i=o===void 0?"margin":o;$E();var c=p.useMemo(function(){return OE(i)},[i]);return p.createElement(LE,{styles:FE(c,!s,i,n?"":"!important")})},Mf=!1;if(typeof window<"u")try{var Ac=Object.defineProperty({},"passive",{get:function(){return Mf=!0,!0}});window.addEventListener("test",Ac,Ac),window.removeEventListener("test",Ac,Ac)}catch{Mf=!1}var ao=Mf?{passive:!1}:!1,zE=function(t){return t.tagName==="TEXTAREA"},Wb=function(t,s){if(!(t instanceof Element))return!1;var n=window.getComputedStyle(t);return n[s]!=="hidden"&&!(n.overflowY===n.overflowX&&!zE(t)&&n[s]==="visible")},BE=function(t){return Wb(t,"overflowY")},UE=function(t){return Wb(t,"overflowX")},Hv=function(t,s){var n=s.ownerDocument,o=s;do{typeof ShadowRoot<"u"&&o instanceof ShadowRoot&&(o=o.host);var i=Kb(t,o);if(i){var c=qb(t,o),d=c[1],m=c[2];if(d>m)return!0}o=o.parentNode}while(o&&o!==n.body);return!1},HE=function(t){var s=t.scrollTop,n=t.scrollHeight,o=t.clientHeight;return[s,n,o]},WE=function(t){var s=t.scrollLeft,n=t.scrollWidth,o=t.clientWidth;return[s,n,o]},Kb=function(t,s){return t==="v"?BE(s):UE(s)},qb=function(t,s){return t==="v"?HE(s):WE(s)},KE=function(t,s){return t==="h"&&s==="rtl"?-1:1},qE=function(t,s,n,o,i){var c=KE(t,window.getComputedStyle(s).direction),d=c*o,m=n.target,f=s.contains(m),x=!1,v=d>0,y=0,b=0;do{var k=qb(t,m),S=k[0],j=k[1],w=k[2],E=j-w-c*S;(S||E)&&Kb(t,m)&&(y+=E,b+=S),m instanceof ShadowRoot?m=m.host:m=m.parentNode}while(!f&&m!==document.body||f&&(s.contains(m)||s===m));return(v&&Math.abs(y)<1||!v&&Math.abs(b)<1)&&(x=!0),x},Tc=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},Wv=function(t){return[t.deltaX,t.deltaY]},Kv=function(t){return t&&"current"in t?t.current:t},ZE=function(t,s){return t[0]===s[0]&&t[1]===s[1]},GE=function(t){return` 47 .block-interactivity-`.concat(t,` {pointer-events: none;} 48 .allow-interactivity-`).concat(t,` {pointer-events: all;} 49`)},QE=0,oo=[];function YE(t){var s=p.useRef([]),n=p.useRef([0,0]),o=p.useRef(),i=p.useState(QE++)[0],c=p.useState(Hb)[0],d=p.useRef(t);p.useEffect(function(){d.current=t},[t]),p.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(i));var j=vE([t.lockRef.current],(t.shards||[]).map(Kv),!0).filter(Boolean);return j.forEach(function(w){return w.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),j.forEach(function(w){return w.classList.remove("allow-interactivity-".concat(i))})}}},[t.inert,t.lockRef.current,t.shards]);var m=p.useCallback(function(j,w){if("touches"in j&&j.touches.length===2||j.type==="wheel"&&j.ctrlKey)return!d.current.allowPinchZoom;var E=Tc(j),C=n.current,A="deltaX"in j?j.deltaX:C[0]-E[0],_="deltaY"in j?j.deltaY:C[1]-E[1],D,O=j.target,F=Math.abs(A)>Math.abs(_)?"h":"v";if("touches"in j&&F==="h"&&O.type==="range")return!1;var P=Hv(F,O);if(!P)return!0;if(P?D=F:(D=F==="v"?"h":"v",P=Hv(F,O)),!P)return!1;if(!o.current&&"changedTouches"in j&&(A||_)&&(o.current=D),!D)return!0;var Z=o.current||D;return qE(Z,w,j,Z==="h"?A:_)},[]),f=p.useCallback(function(j){var w=j;if(!(!oo.length||oo[oo.length-1]!==c)){var E="deltaY"in w?Wv(w):Tc(w),C=s.current.filter(function(D){return D.name===w.type&&(D.target===w.target||w.target===D.shadowParent)&&ZE(D.delta,E)})[0];if(C&&C.should){w.cancelable&&w.preventDefault();return}
vendor: 5,632 bytes, line 49
49if(!C){var A=(d.current.shards||[]).map(Kv).filter(Boolean).filter(function(D){return D.contains(w.target)}),_=A.length>0?m(w,A[0]):!d.current.noIsolation;_&&w.cancelable&&w.preventDefault()}}},[]),x=p.useCallback(function(j,w,E,C){var A={name:j,delta:w,target:E,should:C,shadowParent:JE(E)};s.current.push(A),setTimeout(function(){s.current=s.current.filter(function(_){return _!==A})},1)},[]),v=p.useCallback(function(j){n.current=Tc(j),o.current=void 0},[]),y=p.useCallback(function(j){x(j.type,Wv(j),j.target,m(j,t.lockRef.current))},[]),b=p.useCallback(function(j){x(j.type,Tc(j),j.target,m(j,t.lockRef.current))},[]);p.useEffect(function(){return oo.push(c),t.setCallbacks({onScrollCapture:y,onWheelCapture:y,onTouchMoveCapture:b}),document.addEventListener("wheel",f,ao),document.addEventListener("touchmove",f,ao),document.addEventListener("touchstart",v,ao),function(){oo=oo.filter(function(j){return j!==c}),document.removeEventListener("wheel",f,ao),document.removeEventListener("touchmove",f,ao),document.removeEventListener("touchstart",v,ao)}},[]);var k=t.removeScrollBar,S=t.inert;return p.createElement(p.Fragment,null,S?p.createElement(c,{styles:GE(i)}):null,k?p.createElement(VE,{gapMode:t.gapMode}):null)}function JE(t){for(var s=null;t!==null;)t instanceof ShadowRoot&&(s=t.host,t=t.host),t=t.parentNode;return s}const XE=EE(Ub,YE);var Vd=p.forwardRef(function(t,s){return p.createElement($d,Or({},t,{ref:s,sideCar:XE}))});Vd.classNames=$d.classNames;var e4=function(t){if(typeof document>"u")return null;var s=Array.isArray(t)?t[0]:t;return s.ownerDocument.body},io=new WeakMap,Rc=new WeakMap,Pc={},af=0,Zb=function(t){return t&&(t.host||Zb(t.parentNode))},t4=function(t,s){return s.map(function(n){if(t.contains(n))return n;var o=Zb(n);return o&&t.contains(o)?o:(console.error("aria-hidden",n,"in not contained inside",t,". Doing nothing"),null)}).filter(function(n){return!!n})},s4=function(t,s,n,o){var i=t4(s,Array.isArray(t)?t:[t]);Pc[n]||(Pc[n]=new WeakMap);var c=Pc[n],d=[],m=new Set,f=new Set(i),x=function(y){!y||m.has(y)||(m.add(y),x(y.parentNode))};i.forEach(x);var v=function(y){!y||f.has(y)||Array.prototype.forEach.call(y.children,function(b){if(m.has(b))v(b);else try{var k=b.getAttribute(o),S=k!==null&&k!=="false",j=(io.get(b)||0)+1,w=(c.get(b)||0)+1;io.set(b,j),c.set(b,w),d.push(b),j===1&&S&&Rc.set(b,!0),w===1&&b.setAttribute(n,"true"),S||b.setAttribute(o,"true")}catch(E){console.error("aria-hidden: cannot operate on ",b,E)}})};return v(s),m.clear(),af++,function(){d.forEach(function(y){var b=io.get(y)-1,k=c.get(y)-1;io.set(y,b),c.set(y,k),b||(Rc.has(y)||y.removeAttribute(o),Rc.delete(y)),k||y.removeAttribute(n)}),af--,af||(io=new WeakMap,io=new WeakMap,Rc=new WeakMap,Pc={})}},Ih=function(t,s,n){n===void 0&&(n="data-aria-hidden");var o=Array.from(Array.isArray(t)?t:[t]),i=e4(t);return i?(o.push.apply(o,Array.from(i.querySelectorAll("[aria-live]"))),s4(o,i,n,"aria-hidden")):function(){return null}},Dh="Dialog",[Gb]=Ls(Dh),[r4,Tr]=Gb(Dh),Qb=t=>{const{__scopeDialog:s,children:n,open:o,defaultOpen:i,onOpenChange:c,modal:d=!0}=t,m=p.useRef(null),f=p.useRef(null),[x=!1,v]=Sr({prop:o,defaultProp:i,onChange:c});return e.jsx(r4,{scope:s,triggerRef:m,contentRef:f,contentId:cr(),titleId:cr(),descriptionId:cr(),open:x,onOpenChange:v,onOpenToggle:p.useCallback(()=>v(y=>!y),[v]),modal:d,children:n})};Qb.displayName=Dh;var Yb="DialogTrigger",Jb=p.forwardRef((t,s)=>{const{__scopeDialog:n,...o}=t,i=Tr(Yb,n),c=nt(s,i.triggerRef);return e.jsx(Fe.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":Fh(i.open),...o,ref:c,onClick:be(t.onClick,i.onOpenToggle)})});Jb.displayName=Yb;var Oh="DialogPortal",[n4,Xb]=Gb(Oh,{forceMount:void 0}),ej=t=>{const{__scopeDialog:s,forceMount:n,children:o,container:i}=t,c=Tr(Oh,s);return e.jsx(n4,{scope:s,forceMount:n,children:p.Children.map(o,d=>e.jsx(Ys,{present:n||c.open,children:e.jsx(tl,{asChild:!0,container:i,children:d})}))})};ej.displayName=Oh;var sd="DialogOverlay",tj=p.forwardRef((t,s)=>{const n=Xb(sd,t.__scopeDialog),{forceMount:o=n.forceMount,...i}=t,c=Tr(sd,t.__scopeDialog);return c.modal?e.jsx(Ys,{present:o||c.open,children:e.jsx(o4,{...i,ref:s})}):null});tj.displayName=sd;var a4=Ea("DialogOverlay.RemoveScroll"),o4=p.forwardRef((t,s)=>{const{__scopeDialog:n,...o}=t,i=Tr(sd,n);return e.jsx(Vd,{as:a4,allowPinchZoom:!0,shards:[i.contentRef],children:e.jsx(Fe.div,{"data-state":Fh(i.open),...o,ref:s,style:{pointerEvents:"auto",...o.style}})})}),Ta="DialogContent",sj=p.forwardRef((t,s)=>{const n=Xb(Ta,t.__scopeDialog),{forceMount:o=n.forceMount,...i}=t,c=Tr(Ta,t.__scopeDialog);return e.jsx(Ys,{present:o||c.open,children:c.modal?e.jsx(i4,{...i,ref:s}):e.jsx(l4,{...i,ref:s})})});sj.displayName=Ta;var i4=p.forwardRef((t,s)=>{const n=Tr(Ta,t.__scopeDialog),o=p.useRef(null),i=nt(s,n.contentRef,o);return p.useEffect(()=>{const c=o.current;if(c)return Ih(c)},[]),e.jsx(rj,{...t,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:be(t.onCloseAutoFocus,c=>{c.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:be(t.onPointerDownOutside,c=>{const d=c.detail.originalEvent,m=d.button===0&&d.ctrlKey===!0;(d.button===2||m)&&c.preventDefault()}),onFocusOutside:be(t.onFocusOutside,c=>c.preventDefault())})}),l4=p.forwardRef((t,s)=>{const n=Tr(Ta,t.__scopeDialog),o=p.useRef(!1),i=p.useRef(!1);return e.jsx(rj,{...t,ref:s,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:c=>{t.onCloseAutoFocus?.(c),c.defaultPrevented||(o.current||n.triggerRef.current?.focus(),c.preventDefault()),o.current=!1,i.current=!1},onInteractOutside:c=>
vendor: 3,261 bytes, lines 49-53
49{t.onInteractOutside?.(c),c.defaultPrevented||(o.current=!0,c.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const d=c.target;n.triggerRef.current?.contains(d)&&c.preventDefault(),c.detail.originalEvent.type==="focusin"&&i.current&&c.preventDefault()}})}),rj=p.forwardRef((t,s)=>{const{__scopeDialog:n,trapFocus:o,onOpenAutoFocus:i,onCloseAutoFocus:c,...d}=t,m=Tr(Ta,n),f=p.useRef(null),x=nt(s,f);return Mh(),e.jsxs(e.Fragment,{children:[e.jsx(Fd,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:i,onUnmountAutoFocus:c,children:e.jsx(Mo,{role:"dialog",id:m.contentId,"aria-describedby":m.descriptionId,"aria-labelledby":m.titleId,"data-state":Fh(m.open),...d,ref:x,onDismiss:()=>m.onOpenChange(!1)})}),e.jsxs(e.Fragment,{children:[e.jsx(c4,{titleId:m.titleId}),e.jsx(u4,{contentRef:f,descriptionId:m.descriptionId})]})]})}),Lh="DialogTitle",nj=p.forwardRef((t,s)=>{const{__scopeDialog:n,...o}=t,i=Tr(Lh,n);return e.jsx(Fe.h2,{id:i.titleId,...o,ref:s})});nj.displayName=Lh;var aj="DialogDescription",oj=p.forwardRef((t,s)=>{const{__scopeDialog:n,...o}=t,i=Tr(aj,n);return e.jsx(Fe.p,{id:i.descriptionId,...o,ref:s})});oj.displayName=aj;var ij="DialogClose",lj=p.forwardRef((t,s)=>{const{__scopeDialog:n,...o}=t,i=Tr(ij,n);return e.jsx(Fe.button,{type:"button",...o,ref:s,onClick:be(t.onClick,()=>i.onOpenChange(!1))})});lj.displayName=ij;function Fh(t){return t?"open":"closed"}var cj="DialogTitleWarning",[gM,dj]=AC(cj,{contentName:Ta,titleName:Lh,docsSlug:"dialog"}),c4=({titleId:t})=>{const s=dj(cj),n=`\`${s.contentName}\` requires a \`${s.titleName}\` for the component to be accessible for screen reader users. 50 51If you want to hide the \`${s.titleName}\`, you can wrap it with our VisuallyHidden component. 52 53For more information, see https://radix-ui.com/primitives/docs/components/${s.docsSlug}`;return p.useEffect(()=>{t&&(document.getElementById(t)||console.error(n))},[n,t]),null},d4="DialogDescriptionWarning",u4=({contentRef:t,descriptionId:s})=>{const o=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${dj(d4).contentName}}.`;return p.useEffect(()=>{const i=t.current?.getAttribute("aria-describedby");s&&i&&(document.getElementById(s)||console.warn(o))},[o,t,s]),null},m4=Qb,f4=Jb,h4=ej,uj=tj,mj=sj,fj=nj,hj=oj,pj=lj;const Ra=m4,$c=f4,p4=h4,x4=pj,xj=p.forwardRef(({className:t,...s},n)=>e.jsx(uj,{ref:n,className:re("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",t),...s}));xj.displayName=uj.displayName;const ea=p.forwardRef(({className:t,children:s,...n},o)=>e.jsxs(p4,{children:[e.jsx(xj,{}),e.jsxs(mj,{ref:o,className:re("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",t),...n,children:[s,e.jsxs(pj,{className:"absolute right-4 top-4 roun
53ded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[e.jsx(ol,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));ea.displayName=mj.displayName;const ta=({className:t,...s})=>e.jsx("div",{className:re("flex flex-col space-y-1.5 text-center sm:text-left",t),...s});ta.displayName="DialogHeader";const $h=({className:t,...s})=>e.jsx("div",{className:re("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...s});$h.displayName="DialogFooter";const sa=p.forwardRef(({className:t,...s},n)=>e.jsx(fj,{ref:n,className:re("text-lg font-semibold leading-none tracking-tight",t),...s}));sa.displayName=fj.displayName;const qi=p.forwardRef(({className:t,...s},n)=>e.jsx(hj,{ref:n,className:re("text-sm text-muted-foreground",t),...s}));qi.displayName=hj.displayName;const g4=Ed("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 hover-elevate active-elevate-2",{variants:{variant:{default:"bg-primary text-primary-foreground border border-primary-border",destructive:"bg-destructive text-destructive-foreground border border-destructive-border",outline:" border [border-color:var(--button-outline)] shadow-xs active:shadow-none ",secondary:"border bg-secondary text-secondary-foreground border border-secondary-border ",ghost:"border border-transparent"},size:{default:"min-h-9 px-4 py-2",sm:"min-h-8 rounded-md px-3 text-xs",lg:"min-h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),ie=p.forwardRef(({className:t,variant:s,size:n,asChild:o=!1,...i},c)=>{const d=o?xy:"button";return e.jsx(d,{className:re(g4({variant:s,size:n,className:t})),ref:c,...i})});ie.displayName="Button";var v4="Separator",qv="horizontal",y4=["horizontal","vertical"],gj=p.forwardRef((t,s)=>{const{decorative:n,orientation:o=qv,...i}=t,c=b4(o)?o:qv,m=n?{role:"none"}:{"aria-orientation":c==="vertical"?c:void 0,role:"separator"};return e.jsx(Fe.div,{"data-orientation":c,...m,...i,ref:s})});gj.displayName=v4;function b4(t){return y4.includes(t)}var vj=gj;const is=p.forwardRef(({className:t,orientation:s="horizontal",decorative:n=!0,...o},i)=>e.jsx(vj,{ref:i,decorative:n,orientation:s,className:re("shrink-0 bg-border",s==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",t),...o}));is.displayName=vj.displayName;var yj={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},Zv=We.createContext&&We.createContext(yj),j4=["attr","size","title"];function w4(t,s){if(t==null)return{};var n=N4(t,s),o,i;if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(t);for(i=0;i<c.length;i++)o=c[i],!(s.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(t,o)&&(n[o]=t[o])}return n}function N4(t,s){if(t==null)return{};var n={};for(var o in t)if(Object.prototype.hasOwnProperty.call(t,o)){if(s.indexOf(o)>=0)continue;n[o]=t[o]}return n}function rd(){return rd=Object.assign?Object.assign.bind():function(t){for(var s=1;s<arguments.length;s++){var n=arguments[s];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},rd.apply(this,arguments)}function Gv(t,s){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);s&&(o=o.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,o)}return n}function nd(t){for(var s=1;s<arguments.length;s++){var n=arguments[s]!=null?arguments[s]:{};s%2?Gv(Object(n),!0).forEach(function(o){k4(t,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Gv(Object(n)).forEach(function(o){Object.defineProperty(t,o,Object.getOwnPropertyDescriptor(n,o))})}return t}function k4(t,s,n){return s=C4(s),s in t?Object.defineProperty(t,s,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[s]=n,t}function C4(t){var s=S4(t,"string");return typeof s=="symbol"?s:s+""}function S4(t,s){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var o=n.call(t,s);if(typeof o!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(s==="string"?String:Number)(t)}function bj(t){return t&&t.map((s,n)=>We.createElement(s.tag,nd({key:n},s.attr),bj(s.child)))}function E4(t){return s=>We.createElement(_4,rd({attr:nd({},t.attr)},s),bj(t.child))}function _4(t){var s=n=>{var{attr:o,size:i,title:c}=t,d=w4(t,j4),m=i||n.size||"1em",f;return n.className&&(f=n.className),t.className&&(f=(f?f+" ":"")+t.className),We.createElement("svg",rd({stroke:"currentColor",fill:"
53currentColor",strokeWidth:"0"},n.attr,o,d,{className:f,style:nd(nd({color:t.color||n.color},n.style),t.style),height:m,width:m,xmlns:"http://www.w3.org/2000/svg"}),c&&We.createElement("title",null,c),t.children)};return Zv!==void 0?We.createElement(Zv.Consumer,null,n=>s(n)):s(yj)}function A4(t){return E4({attr:{role:"img",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M12.48 10.92v3.28h7.84c-.24 1.84-.853 3.187-1.787 4.133-1.147 1.147-2.933 2.4-6.053 2.4-4.827 0-8.6-3.893-8.6-8.72s3.773-8.72 8.6-8.72c2.6 0 4.507 1.027 5.907 2.347l2.307-2.307C18.747 1.44 16.133 0 12.48 0 5.867 0 .307 5.387.307 12s5.56 12 12.173 12c3.573 0 6.267-1.173 8.373-3.36 2.16-2.16 2.84-5.213 2.84-7.667 0-.76-.053-1.467-.173-2.053H12.48z"},child:[]}]})(t)}const Vh="/assets/logo-v1b-abstract-minimal-layout-opQ_Zyvw.png";function ad({open:t,onOpenChange:s,mode:n="login"}){const{connect:o,linkWallet:i,connecting:c,refreshSession:d,setGoogleSession:m}=fr(),{toast:f}=Yt(),[x,v]=p.useState(null),[y,b]=p.useState(!1),k=p.useRef(null),S=p.useRef(null),j=p.useRef(d),w=p.useRef(m),E=p.useRef(s),C=p.useRef(f),A=p.useRef(t);j.current=d,w.current=m,E.current=s,C.current=f,A.current=t,p.useEffect(()=>{async function O(F){if(!(!F.data||F.data.type!=="google-auth")&&A.current){if(F.data.error){b(!1);const P=F.data.error==="invalid_state"?"Authentication state mismatch. Please try again.":F.data.error==="token_exchange_failed"?"Could not complete Google sign-in. Please try again.":`Google sign-in failed: ${F.data.error}`;C.current({title:"Sign in failed",description:P,variant:"destructive"});return}if(F.data.token){if(S.current===F.data.token)return;S.current=F.data.token;try{const P=await fetch(`/api/auth/google/verify?token=${encodeURIComponent(F.data.token)}`,{credentials:"include"});if(!P.ok){const z=await P.json().catch(()=>({}));throw new Error(z.message||"Verification failed")}const Z=await P.json();if(Z.approveToken){try{sessionStorage.setItem("ob_approve_token",Z.approveToken)}catch{}try{sessionStorage.setItem("zapier_approve_token",Z.approveToken)}catch{}}w.current(Z),E.current(!1)}catch(P){S.current=null,C.current({title:"Sign in failed",description:P.message||"Could not verify Google sign-in.",variant:"destructive"})}finally{b(!1)}}}}return window.addEventListener("message",O),()=>window.removeEventListener("message",O)},[]);async function _(O){v(O),n==="link-wallet"?await i(O):await o(O),v(null),s(!1)}function D(){const P=window.screenX+(window.outerWidth-500)/2,Z=window.screenY+(window.outerHeight-600)/2,z=window.open("/api/auth/google?popup=true","google-signin",`width=500,height=600,left=${P},top=${Z},toolbar=no,menubar=no,scrollbars=yes`);if(!z){window.location.href="/api/auth/google";return}k.current=z,b(!0);const te=setInterval(()=>{z.closed&&(clearInterval(te),b(!1))},500)}return n==="link-wallet"?e.jsx(Ra,{open:t,onOpenChange:s,children:e.jsxs(ea,{className:"sm:max-w-sm",children:[e.jsxs(ta,{children:[e.jsxs(sa,{className:"flex items-center gap-2",children:[e.jsx(on,{className:"h-5 w-5 text-primary"}),"Link Your Wallet"]}),e.jsx(qi,{children:"Connect a wallet to enable on-chain features like payments, agent hiring, and Zapier integration."})]}),e.jsxs("div",{className:"space-y-3 pt-2",children:[e.jsxs(ie,{className:"w-full justify-start gap-3",variant:"outline",onClick:()=>_("metamask"),disabled:c,"data-testid":"button-link-metamask",children:[x==="metamask"&&c?e.jsx(Ge,{className:"h-4 w-4 animate-spin"}):e.jsx("img",{src:"https://upload.wikimedia.org/wikipedia/commons/3/36/MetaMask_Fox.svg",alt:"MetaMask",className:"h-5 w-5"}),"Link with MetaMask"]}),e.jsxs(ie,{className:"w-full justify-start gap-3",variant:"outline",onClick:()=>_("coinbase"),disabled:c,"data-testid":"button-link-coinbase",children:[x==="coinbase"&&c?e.jsx(Ge,{className:"h-4 w-4 animate-spin"}):e.jsx(St,{className:"h-5 w-5 text-blue-500"}),"Link with Coinbase Wallet"]})]})]})}):e.jsx(Ra,{open:t,onOpenChange:s,children:e.jsxs(ea,{className:"sm:max-w-sm",children:[e.jsxs(ta,{children:[e.jsxs(sa,{className:"flex items-center gap-2",children:[e.jsx("img",{src:Vh,alt:"onBench",className:"h-6 w-6 object-contain"}),"Sign in to onBench"]}
53),e.jsx(qi,{children:"Choose how you want to sign in. You can link a wallet to your Google account later."})]}),e.jsxs("div",{className:"space-y-3 pt-2",children:[e.jsxs(ie,{className:"w-full justify-start gap-3 bg-white hover:bg-gray-50 text-gray-800 border border-gray-300 dark:bg-zinc-800 dark:hover:bg-zinc-700 dark:text-white dark:border-zinc-600",variant:"outline",onClick:D,disabled:c||y,"data-testid":"button-login-google",children:[y?e.jsx(Ge,{className:"h-4 w-4 animate-spin"}):e.jsx(A4,{className:"h-4 w-4 text-red-500"}),y?"Signing inâ¦":"Continue with Google"]}),e.jsxs("div",{className:"flex items-center gap-3 py-1",children:[e.jsx(is,{className:"flex-1"}),e.jsx("span",{className:"text-xs text-muted-foreground",children:"or use wallet"}),e.jsx(is,{className:"flex-1"})]}),e.jsxs(ie,{className:"w-full justify-start gap-3",variant:"outline",onClick:()=>_("metamask"),disabled:c,"data-testid":"button-login-metamask",children:[x==="metamask"&&c?e.jsx(Ge,{className:"h-4 w-4 animate-spin"}):e.jsx("img",{src:"https://upload.wikimedia.org/wikipedia/commons/3/36/MetaMask_Fox.svg",alt:"MetaMask",className:"h-5 w-5"}),"Connect MetaMask"]}),e.jsxs(ie,{className:"w-full justify-start gap-3",variant:"outline",onClick:()=>_("coinbase"),disabled:c,"data-testid":"button-login-coinbase",children:[x==="coinbase"&&c?e.jsx(Ge,{className:"h-4 w-4 animate-spin"}):e.jsx(St,{className:"h-5 w-5 text-blue-500"}),"Connect Coinbase Wallet"]}),e.jsxs("p",{className:"text-[11px] text-muted-foreground text-center pt-1",children:["By signing in you agree to our"," ",e.jsx("a",{href:"/terms",className:"underline hover:text-foreground",children:"Terms"})," ","and"," ",e.jsx("a",{href:"/privacy",className:"underline hover:text-foreground",children:"Privacy Policy"}),"."]})]})]})})}const ue=p.forwardRef(({className:t,...s},n)=>e.jsx("div",{ref:n,className:re("shadcn-card rounded-xl border bg-card border-card-border text-card-foreground shadow-sm",t),...s}));ue.displayName="Card";const Vt=p.forwardRef(({className:t,...s},n)=>e.jsx("div",{ref:n,className:re("flex flex-col space-y-1.5 p-6",t),...s}));Vt.displayName="CardHeader";const zt=p.forwardRef(({className:t,...s},n)=>e.jsx("div",{ref:n,className:re("text-2xl font-semibold leading-none tracking-tight",t),...s}));zt.displayName="CardTitle";const T4=p.forwardRef(({className:t,...s},n)=>e.jsx("div",{ref:n,className:re("text-sm text-muted-foreground",t),...s}));T4.displayName="CardDescription";const me=p.forwardRef(({className:t,...s},n)=>e.jsx("div",{ref:n,className:re("p-6 pt-0",t),...s}));me.displayName="CardContent";const R4=p.forwardRef(({className:t,...s},n)=>e.jsx("div",{ref:n,className:re("flex items-center p-6 pt-0",t),...s}));R4.displayName="CardFooter";function $n({children:t}){const{session:s,loading:n}=fr(),[o,i]=p.useState(!1);return n?e.jsx("div",{className:"min-h-[60vh] flex items-center justify-center",children:e.jsx(Ge,{className:"h-8 w-8 animate-spin text-primary"})}):s.authenticated?e.jsx(e.Fragment,{children:t}):e.jsxs(e.Fragment,{children:[e.jsx(ad,{open:o,onOpenChange:i,mode:"login"}),e.jsx("div",{className:"min-h-[60vh] flex items-center justify-center px-4",children:e.jsx(ue,{className:"max-w-md w-full",children:e.jsxs(me,{className:"p-8 text-center space-y-6",children:[e.jsx("div",{className:"w-16 h-16 rounded-2xl bg-primary/10 flex items-center justify-center mx-auto",children:e.jsx(Ct,{className:"h-8 w-8 text-primary"})}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-xl font-bold text-foreground mb-2","data-testid":"text-auth-required",children:"Sign In Required"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Sign in with Google or connect your wallet to access this page."})]}),e.jsx(ie,{className:"w-full",onClick:()=>i(!0),"data-testid":"button-auth-signin",children:"Sign In"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Wallet login uses EIP-191 signing â no private keys are shared."})]})})})]})}const P4="/assets/logo-v1-robot-bench-icon-Byy6iV1t.png";var M4=p.createContext(void 0);function ll(t){const s=p.useContext(M4);return t||s||"ltr"}var of="rovingFocusGroup.onEntryFocus",I4={bubbles:!1,cancelable:!0},zd="RovingFocusGroup",[If,jj,D4]=el(zd),[O4,Bd]=Ls(zd,[D4]),[L4,F4]=O4(zd),wj=p.forwardRef((t,s)=>e.jsx(If.Provider,{scope:t.__scopeRovingFocusGroup,children:e.jsx(If.Slot,{scope:t.__scopeRovingFocusGroup,children:e.jsx($4,{...t,ref:s})})}));wj.displayName=zd;var $4=p.forwardRef((t,s)=>{const{__scopeRovingFocusGroup:n,orientation:o,loop:i=!1,dir:c,currentTabStopId:d,defaultCurrentTabStopId:m,onCurrentTabStopIdChange:f,onEntryFocus:x,preventScrollOnEntryFocus:v=!1,...y}
vendor: 17,415 bytes, line 53
53=t,b=p.useRef(null),k=nt(s,b),S=ll(c),[j=null,w]=Sr({prop:d,defaultProp:m,onChange:f}),[E,C]=p.useState(!1),A=xs(x),_=jj(n),D=p.useRef(!1),[O,F]=p.useState(0);return p.useEffect(()=>{const P=b.current;if(P)return P.addEventListener(of,A),()=>P.removeEventListener(of,A)},[A]),e.jsx(L4,{scope:n,orientation:o,dir:S,loop:i,currentTabStopId:j,onItemFocus:p.useCallback(P=>w(P),[w]),onItemShiftTab:p.useCallback(()=>C(!0),[]),onFocusableItemAdd:p.useCallback(()=>F(P=>P+1),[]),onFocusableItemRemove:p.useCallback(()=>F(P=>P-1),[]),children:e.jsx(Fe.div,{tabIndex:E||O===0?-1:0,"data-orientation":o,...y,ref:k,style:{outline:"none",...t.style},onMouseDown:be(t.onMouseDown,()=>{D.current=!0}),onFocus:be(t.onFocus,P=>{const Z=!D.current;if(P.target===P.currentTarget&&Z&&!E){const z=new CustomEvent(of,I4);if(P.currentTarget.dispatchEvent(z),!z.defaultPrevented){const te=_().filter(ne=>ne.focusable),ee=te.find(ne=>ne.active),se=te.find(ne=>ne.id===j),le=[ee,se,...te].filter(Boolean).map(ne=>ne.ref.current);Cj(le,v)}}D.current=!1}),onBlur:be(t.onBlur,()=>C(!1))})})}),Nj="RovingFocusGroupItem",kj=p.forwardRef((t,s)=>{const{__scopeRovingFocusGroup:n,focusable:o=!0,active:i=!1,tabStopId:c,...d}=t,m=cr(),f=c||m,x=F4(Nj,n),v=x.currentTabStopId===f,y=jj(n),{onFocusableItemAdd:b,onFocusableItemRemove:k}=x;return p.useEffect(()=>{if(o)return b(),()=>k()},[o,b,k]),e.jsx(If.ItemSlot,{scope:n,id:f,focusable:o,active:i,children:e.jsx(Fe.span,{tabIndex:v?0:-1,"data-orientation":x.orientation,...d,ref:s,onMouseDown:be(t.onMouseDown,S=>{o?x.onItemFocus(f):S.preventDefault()}),onFocus:be(t.onFocus,()=>x.onItemFocus(f)),onKeyDown:be(t.onKeyDown,S=>{if(S.key==="Tab"&&S.shiftKey){x.onItemShiftTab();return}if(S.target!==S.currentTarget)return;const j=B4(S,x.orientation,x.dir);if(j!==void 0){if(S.metaKey||S.ctrlKey||S.altKey||S.shiftKey)return;S.preventDefault();let E=y().filter(C=>C.focusable).map(C=>C.ref.current);if(j==="last")E.reverse();else if(j==="prev"||j==="next"){j==="prev"&&E.reverse();const C=E.indexOf(S.currentTarget);E=x.loop?U4(E,C+1):E.slice(C+1)}setTimeout(()=>Cj(E))}})})})});kj.displayName=Nj;var V4={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function z4(t,s){return s!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function B4(t,s,n){const o=z4(t.key,n);if(!(s==="vertical"&&["ArrowLeft","ArrowRight"].includes(o))&&!(s==="horizontal"&&["ArrowUp","ArrowDown"].includes(o)))return V4[o]}function Cj(t,s=!1){const n=document.activeElement;for(const o of t)if(o===n||(o.focus({preventScroll:s}),document.activeElement!==n))return}function U4(t,s){return t.map((n,o)=>t[(s+o)%t.length])}var Sj=wj,Ej=kj,Df=["Enter"," "],H4=["ArrowDown","PageUp","Home"],_j=["ArrowUp","PageDown","End"],W4=[...H4,..._j],K4={ltr:[...Df,"ArrowRight"],rtl:[...Df,"ArrowLeft"]},q4={ltr:["ArrowLeft"],rtl:["ArrowRight"]},cl="Menu",[Zi,Z4,G4]=el(cl),[Ia,Aj]=Ls(cl,[G4,$o,Bd]),Ud=$o(),Tj=Bd(),[Q4,Da]=Ia(cl),[Y4,dl]=Ia(cl),Rj=t=>{const{__scopeMenu:s,open:n=!1,children:o,dir:i,onOpenChange:c,modal:d=!0}=t,m=Ud(s),[f,x]=p.useState(null),v=p.useRef(!1),y=xs(c),b=ll(i);return p.useEffect(()=>{const k=()=>{v.current=!0,document.addEventListener("pointerdown",S,{capture:!0,once:!0}),document.addEventListener("pointermove",S,{capture:!0,once:!0})},S=()=>v.current=!1;return document.addEventListener("keydown",k,{capture:!0}),()=>{document.removeEventListener("keydown",k,{capture:!0}),document.removeEventListener("pointerdown",S,{capture:!0}),document.removeEventListener("pointermove",S,{capture:!0})}},[]),e.jsx(Sh,{...m,children:e.jsx(Q4,{scope:s,open:n,onOpenChange:y,content:f,onContentChange:x,children:e.jsx(Y4,{scope:s,onClose:p.useCallback(()=>y(!1),[y]),isUsingKeyboardRef:v,dir:b,modal:d,children:o})})})};Rj.displayName=cl;var J4="MenuAnchor",zh=p.forwardRef((t,s)=>{const{__scopeMenu:n,...o}=t,i=Ud(n);return e.jsx(Eh,{...i,...o,ref:s})});zh.displayName=J4;var Bh="MenuPortal",[X4,Pj]=Ia(Bh,{forceMount:void 0}),Mj=t=>{const{__scopeMenu:s,forceMount:n,children:o,container:i}=t,c=Da(Bh,s);return e.jsx(X4,{scope:s,forceMount:n,children:e.jsx(Ys,{present:n||c.open,children:e.jsx(tl,{asChild:!0,container:i,children:o})})})};Mj.displayName=Bh;var dr="MenuContent",[e_,Uh]=Ia(dr),Ij=p.forwardRef((t,s)=>{const n=Pj(dr,t.__scopeMenu),{forceMount:o=n.forceMount,...i}=t,c=Da(dr,t.__scopeMenu),d=dl(dr,t.__scopeMenu);return e.jsx(Zi.Provider,{scope:t.__scopeMenu,children:e.jsx(Ys,{present:o||c.open,children:e.jsx(Zi.Slot,{scope:t.__scopeMenu,children:d.modal?e.jsx(t_,{...i,ref:s}):e.jsx(s_,{...i,ref:s})})})})}),t_=p.forwardRef((t,s)=>{const n=Da(dr,t.__scopeMenu),o=p.useRef(null),i=nt(s,o);return p.useEffect(()=>{const c=o.current;if(c)return Ih(c)},[]),e.jsx(Hh,{...t,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:be(t.onFocusOutside,c=>c.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),s_=p.forwardRef((t,s)=>{const n=Da(dr,t.__scopeMenu);return e.jsx(Hh,{...t,ref:s,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),r_=Ea("MenuContent.ScrollLock"),Hh=p.forwardRef((t,s)=>{const{__scopeMenu:n,loop:o=!1,trapFocus:i,onOpenAutoFocus:c,onCloseAutoFocus:d,disableOutsidePointerEvents:m,onEntryFocus:f,onEscapeKeyDown:x,onPointerDownOutside:v,onFocusOutside:y,onInteractOutside:b,onDismiss:k,disableOutsideScroll:S,...j}=t,w=Da(dr,n),E=dl(dr,n),C=Ud(n),A=Tj(n),_=Z4(n),[D,O]=p.useState(null),F=p.useRef(null),P=nt(s,F,w.onContentChange),Z=p.useRef(0),z=p.useRef(""),te=p.useRef(0),ee=p.useRef(null),se=p.useRef("right"),I=p.useRef(0),le=S?Vd:p.Fragment,ne=S?{as:r_,allowPinchZoom:!0}:void 0,J=q=>{const V=z.current+q,R=_().filter(fe=>!fe.disabled),Q=document.activeElement,Ne=R.find(fe=>fe.ref.current===Q)?.textValue,Pe=R.map(fe=>fe.textValue),ze=p_(Pe,V,Ne),Ve=R.find(fe=>fe.textValue===ze)?.ref.current;(function fe(De){z.current=De,window.clearTimeout(Z.current),De!==""&&(Z.current=window.setTimeout(()=>fe(""),1e3))})(V),Ve&&setTimeout(()=>Ve.focus())};p.useEffect(()=>()=>window.clearTimeout(Z.current),[]),Mh();const U=p.useCallback(q=>se.current===ee.current?.side&&g_(q,ee.current?.area),[]);return e.jsx(e_,{scope:n,searchRef:z,onItemEnter:p.useCallback(q=>{U(q)&&q.preventDefault()},[U]),onItemLeave:p.useCallback(q=>{U(q)||(F.current?.focus(),O(null))},[U]),onTriggerLeave:p.useCallback(q=>{U(q)&&q.preventDefault()},[U]),pointerGraceTimerRef:te,onPointerGraceIntentChange:p.useCallback(q=>{ee.current=q},[]),children:e.jsx(le,{...ne,children:e.jsx(Fd,{asChild:!0,trapped:i,onMountAutoFocus:be(c,q=>{q.preventDefault(),F.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:d,children:e.jsx(Mo,{asChild:!0,disableOutsidePointerEvents:m,onEscapeKeyDown:x,onPointerDownOutside:v,onFocusOutside:y,onInteractOutside:b,onDismiss:k,children:e.jsx(Sj,{asChild:!0,...A,dir:E.dir,orientation:"vertical",loop:o,currentTabStopId:D,onCurrentTabStopIdChange:O,onEntryFocus:be(f,q=>{E.isUsingKeyboardRef.current||q.preventDefault()}),preventScrollOnEntryFocus:!0,children:e.jsx(_h,{role:"menu","aria-orientation":"vertical","data-state":Qj(w.open),"data-radix-menu-content":"",dir:E.dir,...C,...j,ref:P,style:{outline:"none",...j.style},onKeyDown:be(j.onKeyDown,q=>{const R=q.target.closest("[data-radix-menu-content]")===q.currentTarget,Q=q.ctrlKey||q.altKey||q.metaKey,Ne=q.key.length===1;R&&(q.key==="Tab"&&q.preventDefault(),!Q&&Ne&&J(q.key));const Pe=F.current;if(q.target!==Pe||!W4.includes(q.key))return;q.preventDefault();const Ve=_().filter(fe=>!fe.disabled).map(fe=>fe.ref.current);_j.includes(q.key)&&Ve.reverse(),f_(Ve)}),onBlur:be(t.onBlur,q=>{q.currentTarget.contains(q.target)||(window.clearTimeout(Z.current),z.current="")}),onPointerMove:be(t.onPointerMove,Gi(q=>{const V=q.target,R=I.current!==q.clientX;if(q.currentTarget.contains(V)&&R){const Q=q.clientX>I.current?"right":"left";se.current=Q,I.current=q.clientX}}))})})})})})})});Ij.displayName=dr;var n_="MenuGroup",Wh=p.forwardRef((t,s)=>{const{__scopeMenu:n,...o}=t;return e.jsx(Fe.div,{role:"group",...o,ref:s})});Wh.displayName=n_;var a_="MenuLabel",Dj=p.forwardRef((t,s)=>{const{__scopeMenu:n,...o}=t;return e.jsx(Fe.div,{...o,ref:s})});Dj.displayName=a_;var od="MenuItem",Qv="menu.itemSelect",Hd=p.forwardRef((t,s)=>{const{disabled:n=!1,onSelect:o,...i}=t,c=p.useRef(null),d=dl(od,t.__scopeMenu),m=Uh(od,t.__scopeMenu),f=nt(s,c),x=p.useRef(!1),v=()=>{const y=c.current;if(!n&&y){const b=new CustomEvent(Qv,{bubbles:!0,cancelable:!0});y.addEventListener(Qv,k=>o?.(k),{once:!0}),ch(y,b),b.defaultPrevented?x.current=!1:d.onClose()}};return e.jsx(Oj,{...i,ref:f,disabled:n,onClick:be(t.onClick,v),onPointerDown:y=>{t.onPointerDown?.(y),x.current=!0},onPointerUp:be(t.onPointerUp,y=>{x.current||y.currentTarget?.click()}),onKeyDown:be(t.onKeyDown,y=>{const b=m.searchRef.current!=="";n||b&&y.key===" "||Df.includes(y.key)&&(y.currentTarget.click(),y.preventDefault())})})});Hd.displayName=od;var Oj=p.forwardRef((t,s)=>{const{__scopeMenu:n,disabled:o=!1,textValue:i,...c}=t,d=Uh(od,n),m=Tj(n),f=p.useRef(null),x=nt(s,f),[v,y]=p.useState(!1),[b,k]=p.useState("");return p.useEffect(()=>{const S=f.current;S&&k((S.textContent??"").trim())},[c.children]),e.jsx(Zi.ItemSlot,{scope:n,disabled:o,textValue:i??b,children:e.jsx(Ej,{asChild:!0,...m,focusable:!o,children:e.jsx(Fe.div,{role:"menuitem","data-highlighted":v?"":void 0,"aria-disabled":o||void 0,"data-disabled":o?"":void 0,...c,ref:x,onPointerMove:be(t.onPointerMove,Gi(S=>{o?d.onItemLeave(S):(d.onItemEnter(S),S.defaultPrevented||S.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:be(t.onPointerLeave,Gi(S=>d.onItemLeave(S))),onFocus:be(t.onFocus,()=>y(!0)),onBlur:be(t.onBlur,()=>y(!1))})})})}),o_="MenuCheckboxItem",Lj=p.forwardRef((t,s)=>{const{checked:n=!1,onCheckedChange:o,...i}=t;return e.jsx(Bj,{scope:t.__scopeMenu,checked:n,children:e.jsx(Hd,{role:"menuitemcheckbox","aria-checked":id(n)?"mixed":n,...i,ref:s,"data-state":qh(n),onSelect:be(i.onSelect,()=>o?.(id(n)?!0:!n),{checkForDefaultPrevented:!1})})})});Lj.displayName=o_;var Fj="MenuRadioGroup",[i_,l_]=Ia(Fj,{value:void 0,onValueChange:()=>{}}),$j=p.forwardRef((t,s)=>{const{value:n,onValueChange:o,...i}=t,c=xs(o);return e.jsx(i_,{scope:t.__scopeMenu,value:n,onValueChange:c,children:e.jsx(Wh,{...i,ref:s})})});$j.displayName=Fj;var Vj="MenuRadioItem",zj=p.forwardRef((t,s)=>{const{value:n,...o}=t,i=l_(Vj,t.__scopeMenu),c=n===i.value;return e.jsx(Bj,{scope:t.__scopeMenu,checked:c,children:e.jsx(Hd,{role:"menuitemradio","aria-checked":c,...o,ref:s,"data-state":qh(c),onSelect:be(o.onSelect,()=>i.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});zj.displayName=Vj;var Kh="MenuItemIndicator",[Bj,c_]=Ia(Kh,{checked:!1}),Uj=p.forwardRef((t,s)=>{const{__scopeMenu:n,forceMount:o,...i}=t,c=c_(Kh,n);return e.jsx(Ys,{present:o||id(c.checked)||c.checked===!0,children:e.jsx(Fe.span,{...i,ref:s,"data-state":qh(c.checked)})})});Uj.displayName=Kh;var d_="MenuSeparator",Hj=p.forwardRef((t,s)=>{const{__scopeMenu:n,...o}=t;return e.jsx(Fe.div,{role:"separator","aria-orientation":"horizontal",...o,ref:s})});Hj.displayName=d_;var u_="MenuArrow",Wj=p.forwardRef((t,s)=>{const{__scopeMenu:n,...o}=t,i=Ud(n);return e.jsx(Ah,{...i,...o,ref:s})});Wj.displayName=u_;var m_="MenuSub",[vM,Kj]=Ia(m_),Di="MenuSubTrigger",qj=p.forwardRef((t,s)=>{const n=Da(Di,t.__scopeMenu),o=dl(Di,t.__scopeMenu),i=Kj(Di,t.__scopeMenu),c=Uh(Di,t.__scopeMenu),d=p.useRef(null),{pointerGraceTimerRef:m,onPointerGraceIntentChange:f}=c,x={__scopeMenu:t.__scopeMenu},v=p.useCallback(()=>{d.current&&window.clearTimeout(d.current),d.current=null},[]);return p.useEffect(()=>v,[v]),p.useEffect(()=>{const y=m.current;return()=>{window.clearTimeout(y),f(null)}},[m,f]),e.jsx(zh,{asChild:!0,...x,children:e.jsx(Oj,{id:i.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":i.contentId,"data-state":Qj(n.open),...t,ref:kd(s,i.onTriggerChange),onClick:y=>{t.onClick?.(y),!(t.disabled||y.defaultPrevented)&&(y.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:be(t.onPointerMove,Gi(y=>{c.onItemEnter(y),!y.defaultPrevented&&!t.disabled&&!n.open&&!d.current&&(c.onPointerGraceIntentChange(null),d.current=window.setTimeout(()=>{n.onOpenChange(!0),v()},100))})),onPointerLeave:be(t.onPointerLeave,Gi(y=>{v();const b=n.content?.getBoundingClientRect();if(b){const k=n.content?.dataset.side,S=k==="right",j=S?-5:5,w=b[S?"left":"right"],E=b[S?"right":"left"];c.onPointerGraceIntentChange({area:[{x:y.clientX+j,y:y.clientY},{x:w,y:b.top},{x:E,y:b.top},{x:E,y:b.bottom},{x:w,y:b.bottom}],side:k}),window.clearTimeout(m.current),m.current=window.setTimeout(()=>c.onPointerGraceIntentChange(null),300)}else{if(c.onTriggerLeave(y),y.defaultPrevented)return;c.onPointerGraceIntentChange(null)}})),onKeyDown:be(t.onKeyDown,y=>{const b=c.searchRef.current!=="";t.disabled||b&&y.key===" "||K4[o.dir].includes(y.key)&&(n.onOpenChange(!0),n.content?.focus(),y.preventDefault())})})})});qj.displayName=Di;var Zj="MenuSubContent",Gj=p.forwardRef((t,s)=>{const n=Pj(dr,t.__scopeMenu),{forceMount:o=n.forceMount,...i}=t,c=Da(dr,t.__scopeMenu),d=dl(dr,t.__scopeMenu),m=Kj(Zj,t.__scopeMenu),f=p.useRef(null),x=nt(s,f);return e.jsx(Zi.Provider,{scope:t.__scopeMenu,children:e.jsx(Ys,{present:o||c.open,children:e.jsx(Zi.Slot,{scope:t.__scopeMenu,children:e.jsx(Hh,{id:m.contentId,"aria-labelledby":m.triggerId,...i,ref:x,align:"start",side:d.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:v=>{d.isUsingKeyboardRef.current&&f.current?.focus(),v.preventDefault()},onCloseAutoFocus:v=>v.preventDefault(),onFocusOutside:be(t.onFocusOutside,v=>{v.target!==m.trigger&&c.onOpenChange(!1)}),onEscapeKeyDown:be(t.onEscapeKeyDown,v=>{d.onClose(),v.preventDefault()}),onKeyDown:be(t.onKeyDown,v=>{const y=v.currentTarget.contains(v.target),b=q4[d.dir].includes(v.key);y&&b&&(c.onOpenChange(!1),m.trigger?.focus(),v.preventDefault())})})})})})});Gj.displayName=Zj;function Qj(t){return t?"open":"closed"}function id(t){return t==="indeterminate"}function qh(t){return id(t)?"indeterminate":t?"checked":"unchecked"}function f_(t){const s=document.activeElement;for(const n of t)if(n===s||(n.focus(),document.activeElement!==s))return}function h_(t,s){return t.map((n,o)=>t[(s+o)%t.length])}function p_(t,s,n){const i=s.length>1&&Array.from(s).every(x=>x===s[0])?s[0]:s,c=n?t.indexOf(n):-1;let d=h_(t,Math.max(c,0));i.length===1&&(d=d.filter(x=>x!==n));const f=d.find(x=>x.toLowerCase().startsWith(i.toLowerCase()));return f!==n?f:void 0}function x_(t,s){const{x:n,y:o}=t;let i=!1;for(let c=0,d=s.length-1;c<s.length;d=c++){const m=s[c].x,f=s[c].y,x=s[d].x,v=s[d].y;f>o!=v>o&&n<(x-m)*(o-f)/(v-f)+m&&(i=!i)}return i}function g_(t,s){if(!s)return!1;const n={x:t.clientX,y:t.clientY};return x_(n,s)}function Gi(t){return s=>s.pointerType==="mouse"?t(s):void 0}var v_=Rj,y_=zh,b_=Mj,j_=Ij,w_=Wh,N_=Dj,k_=Hd,C_=Lj,S_=$j,E_=zj,__=Uj,A_=Hj,T_=Wj,R_=qj,P_=Gj,Zh="DropdownMenu",[M_]=Ls(Zh,[Aj]),_s=Aj(),[I_,Yj]=M_(Zh),Jj=t=>{const{__scopeDropdownMenu:s,children:n,dir:o,open:i,defaultOpen:c,onOpenChange:d,modal:m=!0}=t,f=_s(s),x=p.useRef(null),[v=!1,y]=Sr({prop:i,defaultProp:c,onChange:d});return e.jsx(I_,{scope:s,triggerId:cr(),triggerRef:x,contentId:cr(),open:v,onOpenChange:y,onOpenToggle:p.useCallback(()=>y(b=>!b),[y]),modal:m,children:e.jsx(v_,{...f,open:v,onOpenChange:y,dir:o,modal:m,children:n})})};Jj.displayName=Zh;var Xj="DropdownMenuTrigger",ew=p.forwardRef((t,s)=>{const{__scopeDropdownMenu:n,disabled:o=!1,...i}=t,c=Yj(Xj,n),d=_s(n);return e.jsx(y_,{asChild:!0,...d,children:e.jsx(Fe.button,{type:"button",id:c.triggerId,"aria-haspopup":"menu","aria-expanded":c.open,"aria-controls":c.open?c.contentId:void 0,"data-state":c.open?"open":"closed","data-disabled":o?"":void 0,disabled:o,...i,ref:kd(s,c.triggerRef),onPointerDown:be(t.onPointerDown,m=>{!o&&m.button===0&&m.ctrlKey===!1&&(c.onOpenToggle(),c.open||m.preventDefault())}),onKeyDown:be(t.onKeyDown,m=>{o||(["Enter"," "].includes(m.key)&&c.onOpenToggle(),m.key==="ArrowDown"&&c.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(m.key)&&m.preventDefault())})})})});ew.displayName=Xj;var D_="DropdownMenuPortal",tw=t=>{const{__scopeDropdownMenu:s,...n}=t,o=_s(s);return e.jsx(b_,{...o,...n})};tw.displayName=D_;var sw="DropdownMenuContent",rw=p.forwardRef((t,s)=>{const{__scopeDropdownMenu:n,...o}=t,i=Yj(sw,n),c=_s(n),d=p.useRef(!1);return e.jsx(j_,{id:i.contentId,"aria-labelledby":i.triggerId,...c,...o,ref:s,onCloseAutoFocus:be(t.onCloseAutoFocus,m=>{d.current||i.triggerRef.current?.focus(),d.current=!1,m.preventDefault()}),onInteractOutside:be(t.onInteractOutside,m=>{const f=m.detail.originalEvent,x=f.button===0&&f.ctrlKey===!0,v=f.button===2||x;(!i.modal||v)&&(d.current=!0)}),style:{...t.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)"}})});rw.displayName=sw;var O_="DropdownMenuGroup",L_=p.forwardRef((t,s)=>{const{__scopeDropdownMenu:n,...o}=t,i=_s(n);return e.jsx(w_,{...i,...o,ref:s})});
53L_.displayName=O_;var F_="DropdownMenuLabel",nw=p.forwardRef((t,s)=>{const{__scopeDropdownMenu:n,...o}=t,i=_s(n);return e.jsx(N_,{...i,...o,ref:s})});nw.displayName=F_;var $_="DropdownMenuItem",aw=p.forwardRef((t,s)=>{const{__scopeDropdownMenu:n,...o}=t,i=_s(n);return e.jsx(k_,{...i,...o,ref:s})});aw.displayName=$_;var V_="DropdownMenuCheckboxItem",ow=p.forwardRef((t,s)=>{const{__scopeDropdownMenu:n,...o}=t,i=_s(n);return e.jsx(C_,{...i,...o,ref:s})});ow.displayName=V_;var z_="DropdownMenuRadioGroup",B_=p.forwardRef((t,s)=>{const{__scopeDropdownMenu:n,...o}=t,i=_s(n);return e.jsx(S_,{...i,...o,ref:s})});B_.displayName=z_;var U_="DropdownMenuRadioItem",iw=p.forwardRef((t,s)=>{const{__scopeDropdownMenu:n,...o}=t,i=_s(n);return e.jsx(E_,{...i,...o,ref:s})});iw.displayName=U_;var H_="DropdownMenuItemIndicator",lw=p.forwardRef((t,s)=>{const{__scopeDropdownMenu:n,...o}=t,i=_s(n);return e.jsx(__,{...i,...o,ref:s})});lw.displayName=H_;var W_="DropdownMenuSeparator",cw=p.forwardRef((t,s)=>{const{__scopeDropdownMenu:n,...o}=t,i=_s(n);return e.jsx(A_,{...i,...o,ref:s})});cw.displayName=W_;var K_="DropdownMenuArrow",q_=p.forwardRef((t,s)=>{const{__scopeDropdownMenu:n,...o}=t,i=_s(n);return e.jsx(T_,{...i,...o,ref:s})});q_.displayName=K_;var Z_="DropdownMenuSubTrigger",dw=p.forwardRef((t,s)=>{const{__scopeDropdownMenu:n,...o}=t,i=_s(n);return e.jsx(R_,{...i,...o,ref:s})});dw.displayName=Z_;var G_="DropdownMenuSubContent",uw=p.forwardRef((t,s)=>{const{__scopeDropdownMenu:n,...o}=t,i=_s(n);return e.jsx(P_,{...i,...o,ref:s,style:{...t.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)"}})});uw.displayName=G_;var Q_=Jj,Y_=ew,J_=tw,mw=rw,fw=nw,hw=aw,pw=ow,xw=iw,gw=lw,vw=cw,yw=dw,bw=uw;const X_=Q_,eA=Y_,tA=p.forwardRef(({className:t,inset:s,children:n,...o},i)=>e.jsxs(yw,{ref:i,className:re("flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",s&&"pl-8",t),...o,children:[n,e.jsx(Cs,{className:"ml-auto"})]}));tA.displayName=yw.displayName;const sA=p.forwardRef(({className:t,...s},n)=>e.jsx(bw,{ref:n,className:re("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 origin-[--radix-dropdown-menu-content-transform-origin]",t),...s}));sA.displayName=bw.displayName;const jw=p.forwardRef(({className:t,sideOffset:s=4,...n},o)=>e.jsx(J_,{children:e.jsx(mw,{ref:o,sideOffset:s,className:re("z-50 max-h-[var(--radix-dropdown-menu-content-available-height)] min-w-[8rem] overflow-y-auto overflow-x-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 origin-[--radix-dropdown-menu-content-transform-origin]",t),...n})}));jw.displayName=mw.displayName;const Of=p.forwardRef(({className:t,inset:s,...n},o)=>e.jsx(hw,{ref:o,className:re("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",s&&"pl-8",t),...n}));Of.displayName=hw.displayName;const rA=p.forwardRef(({className:t,children:s,checked:n,...o},i)=>e.jsxs(pw,{ref:i,className:re("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),checked:n,...o,children:[e.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:e.jsx(gw,{children:e.jsx(rl,{className:"h-4 w-4"})})}),s]}));rA.displayName=pw.displayName;const nA=p.forwardRef(({className:t,children:s,...n},o)=>e.jsxs(xw,{ref:o,className:re("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...n,children:[e.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:e.jsx(gw,{children:e.jsx(AS,{className:"h-2 w-2 fill-current"})})}),s]}));nA.displayName=xw.displayName;const aA=p.forwardRef(({className:t,inset:s,...n},o)=>e.jsx(fw,{ref:o,className:re("px-2 py-1.5 text-sm font-semibold",s&&"pl-8",t),...n}));aA.displayName=fw.displayName;const ww=p.forwardRef(({className:t,...s},n)=>e.jsx(vw,{ref:n,className:re("-mx-1 my-1 h-px bg-muted",t),...s}));ww.displayName=vw.displayName;const Yv=[{path:"/",label:"Home",icon:LS},{path:"/explore",label:"Explore",icon:Zc},{path:"/developers",label:"Developers",icon:Ur},{path:"/e2e-test",label:"E2E Test",icon:nl}],Jv=[{path:"/tools",label:"Tools",icon:Gs},{path:"/hire",label:"Hire",icon:XS},{path:"/jobs",label:"Jobs",icon:Hc},{path:"/create",label:"Create",icon:_S},{path:"/orchestrate",label:"Orchestrate",icon:jf},{path:"/mandate",label:"Mandates",icon:MS},{path:"/vault",label:"Vault",icon:Io},{path:"/agent-dashboard",label:"Agent Dashboard",icon:FS},{path:"/identity",label:"Identity",icon:Ui}];function oA(){const[t]=Xi(),[s,n]=p.useState(!1),[o,i]=p.useState(!1),[c,d]=p.useState(!1),{session:m,connecting:f,disconnect:x}=fr(),v=m.authenticated&&m.authMethod==="google",y=!!m.address;function b(){return m.authenticated?y?e.jsxs("div",{className:"flex items-center gap-1.5 px-3 py-1.5 rounded-md bg-emerald-500/10 border border-emerald-500/20",children:[e.jsx(St,{className:"h-3.5 w-3.5 text-emerald-600 dark:text-emerald-400"}),e.jsxs("span",{className:"text-xs font-mono text-emerald-600 dark:text-emerald-400","data-testid":"text-nav-wallet",children:[m.address?.slice(0,6),"...",m.address?.slice(-4)]})]}):m.googleName||m.googleEmail?e.jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5 rounded-md bg-blue-500/10 border border-blue-500/20",children:[m.googlePicture?e.jsx("img",{src:m.googlePicture,alt:"",className:"h-5 w-5 rounded-full"}):e.jsx("div",{className:"h-5 w-5 rounded-full bg-blue-500/30 flex items-center justify-center text-[10px] font-bold text-blue-600 dar
53k:text-blue-400",children:(m.googleName||m.googleEmail||"G")[0].toUpperCase()}),e.jsx("span",{className:"text-xs text-blue-600 dark:text-blue-400 max-w-[120px] truncate","data-testid":"text-nav-google-user",children:m.googleName||m.googleEmail})]}):null:null}return e.jsxs(e.Fragment,{children:[e.jsx(ad,{open:o,onOpenChange:i,mode:"login"}),e.jsx(ad,{open:c,onOpenChange:d,mode:"link-wallet"}),e.jsxs("header",{className:"sticky top-0 z-50 w-full border-b border-border bg-background/80 backdrop-blur-xl","data-testid":"nav-header",children:[e.jsxs("div",{className:"max-w-7xl mx-auto flex items-center justify-between h-14 px-4 sm:px-6",children:[e.jsxs(kt,{href:"/",className:"flex items-center gap-2.5 shrink-0",children:[e.jsx("img",{src:P4,alt:"onBench",className:"h-8 w-8 rounded-lg object-cover"}),e.jsx("span",{className:"font-bold text-lg tracking-tight text-foreground","data-testid":"text-brand-name",children:"onBench"})]}),e.jsxs("nav",{className:"hidden lg:flex items-center gap-0.5",children:[Yv.map(k=>{const S=k.path==="/"?t==="/":t.startsWith(k.path);return e.jsxs(kt,{href:k.path,className:re("flex items-center gap-1.5 px-2.5 py-1.5 rounded-md text-sm font-medium transition-colors",S?"bg-primary/10 text-primary":"text-muted-foreground hover:text-foreground hover:bg-muted/50"),"data-testid":`link-nav-${k.label.toLowerCase()}`,children:[e.jsx(k.icon,{className:"h-3.5 w-3.5"}),e.jsx("span",{children:k.label})]},k.path)}),e.jsx("div",{className:"w-px h-5 bg-border mx-1.5"}),Jv.map(k=>{const S=t.startsWith(k.path);return e.jsxs(kt,{href:k.path,className:re("flex items-center gap-1.5 px-2.5 py-1.5 rounded-md text-sm font-medium transition-colors",S?"bg-primary/10 text-primary":"text-muted-foreground hover:text-foreground hover:bg-muted/50"),"data-testid":`link-nav-${k.label.toLowerCase()}`,children:[e.jsx(k.icon,{className:"h-3.5 w-3.5"}),e.jsx("span",{children:k.label})]},k.path)})]}),e.jsx("div",{className:"hidden lg:flex items-center gap-2",children:m.authenticated?e.jsxs(X_,{children:[e.jsx(eA,{asChild:!0,children:e.jsx("button",{className:"flex items-center gap-2 focus:outline-none","data-testid":"button-user-menu",children:b()})}),e.jsxs(jw,{align:"end",className:"w-48",children:[v&&!y&&e.jsxs(e.Fragment,{children:[e.jsxs(Of,{onClick:()=>d(!0),"data-testid":"menu-link-wallet",className:"gap-2",children:[e.jsx(on,{className:"h-3.5 w-3.5"}),"Link Wallet"]}),e.jsx(ww,{})]}),e.jsxs(Of,{onClick:x,"data-testid":"menu-sign-out",className:"gap-2 text-destructive focus:text-destructive",children:[e.jsx(Cf,{className:"h-3.5 w-3.5"}),"Sign Out"]})]})]}):e.jsxs(ie,{size:"sm",onClick:()=>i(!0),disabled:f,"data-testid":"button-nav-connect",children:[f?e.jsx(Ge,{className:"h-3.5 w-3.5 mr-1.5 animate-spin"}):e.jsx(St,{className:"h-3.5 w-3.5 mr-1.5"}),"Sign In"]})}),e.jsxs("div",{className:"flex items-center gap-2 lg:hidden",children:[m.authenticated&&e.jsx("div",{className:"flex items-center gap-1 px-2 py-1 rounded bg-emerald-500/10 border border-emerald-500/20",children:y?e.jsxs(e.Fragment,{children:[e.jsx(St,{className:"h-3 w-3 text-emerald-600 dark:text-emerald-400"}),e.jsxs("span",{className:"text-[10px] font-mono text-emerald-600 dark:text-emerald-400","data-testid":"text-nav-wallet-mobile",children:[m.address?.slice(0,4),"...",m.address?.slice(-3)]})]}):e.jsx("span",{className:"text-[10px] text-blue-600 dark:text-blue-400 max-w-[80px] truncate","data-testid":"text-nav-google-mobile",children:m.googleName||m.googleEmail})}),e.jsx(ie,{variant:"ghost",size:"icon",onClick:()=>n(!s),"data-testid":"button-mobile-menu",children:s?e.jsx(ol,{className:"h-5 w-5"}):e.jsx(zS,{className:"h-5 w-5"})})]})]}),s&&e.jsxs("div",{className:"lg:hidden border-t border-border bg-background px-4 py-3 space-y-1","data-testid":"mobile-nav",children:[!m.authenticated&&e.jsx("div",{className:"pb-3 mb-2 border-b border-border",children:e.jsxs(ie,{className:"w-full",onClick:()=>{i(!0),n(!1)},disabled:f,"data-testid":"button-mobile-connect",children:[f?e.jsx(Ge,{className:"h-4 w-4 mr-2 animate-spin"}):e.jsx(St,{className:"h-4 w-4 mr-2"}),"Sign In"]})}),m.authenticated&&v&&!y&&e.jsx("div",{className:"pb-3 mb-2 border-b border-border",children:e.jsxs(ie,{variant:"outline",className:"w-full gap-2",onClick:()=>{d(!0),n(!1)},"data-testid":"button-mobile-link-wallet",children:[e.jsx(on,{className:"h-4 w-4"}),"Link Wallet"]})}),e.jsx("div",{className:"text-[10px] uppercase tracking-wider text-muted-foreground font-semibold mb-1.5 px-2",children:"Public"}),Yv.map(k=>{const S=k.path==="/"?t==="/":t.startsWith(k.path);return e.jsxs(kt,{href:k.path,onClick:()=>n(!1),className:re("flex items-center gap-2 px-2 py-2 rounded-md text-sm font-medium transition-colors",S?"bg-primary/10 text-primary":"text-muted-foreground hover:text-foreground hover:bg-muted/50"),"data-testid":`link-mobile-${k.label.toLowerCase()}`,children:[e.jsx(k.icon,{className:"h-4 w-4"}),k.label]},k.path)}),e.jsx("div",{className:"border-t border-border my-2"}),e.jsx("div",{className:"text-[10px] uppercase tracking-wider text-muted-foreground font-semibold mb-1.5 px-2",children:"Platform"}),Jv.map(k=>{const S=t.startsWith(k.path);return e.jsxs(kt,{href:k.path,onClick:()=>n(!1),className:re("flex items-center gap-2 px-2 py-2 rounded-md text-sm font-medium transition-colors",S?"bg-primary/10 text-primary":"text-muted-foreground hover:text-foreground hover:bg-muted/50"),"data-testid":`link-mobile-${k.label.toLowerCase()}`,children:[e.jsx(k.icon,{className:"h-4 w-4"}),k.label]},k.path)}),m.authenticated&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"border-t border-border my-2"}),e.jsxs(ie,{variant:"ghost",className:"w-full justify-start text-destructive",onClick:()=>{x(),n(!1)},"data-testid":"button-mobile-disconnect",children:[e.jsx(Cf,{className:"h-4 w-4 mr-2"}),"Sign Out"]})]})]})]})]})}const iA=Ed("whitespace-nowrap inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 hover-elevate ",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow-xs",secondary:"border-transparent bg-secondary text-secondary-foreground",destructive:"border-transparent bg-destructive text-destructive-foreground shadow-xs",outline:" border [border-color:var(--badge-outline)] shadow-xs"}},defaultVariants:{variant:"default"}});function Y({className:t,variant:s,...n}){return e.jsx("div",{className:re(iA({variant:s}),t),...n})}function Lf(t){return t>=80?"#10b981":t>=60?"#f59e0b":t>=40?"#f97316":"#ef4444"}function lA(t){return t>=80?"Low Risk":t>=60?"Moderate":t>
53=40?"Elevated":"High Risk"}function ld({score:t,size:s=80,strokeWidth:n=6,className:o,showLabel:i=!0}){const c=(s-n)/2,d=c*2*Math.PI,m=(100-t)/100*d,f=Lf(t);return e.jsxs("div",{className:re("flex flex-col items-center gap-1.5",o),"data-testid":"risk-score-ring",children:[e.jsxs("div",{className:"relative",style:{width:s,height:s},children:[e.jsxs("svg",{width:s,height:s,className:"-rotate-90",children:[e.jsx("circle",{cx:s/2,cy:s/2,r:c,fill:"none",stroke:"hsl(var(--border))",strokeWidth:n}),e.jsx("circle",{cx:s/2,cy:s/2,r:c,fill:"none",stroke:f,strokeWidth:n,strokeDasharray:d,strokeDashoffset:m,strokeLinecap:"round",className:"transition-all duration-1000 ease-out"})]}),e.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:e.jsx("span",{className:"text-lg font-bold",style:{color:f},"data-testid":"risk-score-value",children:t})})]}),i&&e.jsx("span",{className:"text-xs font-medium",style:{color:f},"data-testid":"risk-score-label",children:lA(t)})]})}const Xv=[{key:"etv",name:"ETV",fullName:"Ethereum Token Verification",description:"Validates code legitimacy through on-chain token contract analysis",icon:Ct,scoreKey:"etvScore",verifiedKey:"etvVerified",color:"#3b82f6"},{key:"scv",name:"SCV",fullName:"Staking Contract Verification",description:"Assesses economic commitment through staking contract analysis",icon:qn,scoreKey:"scvScore",verifiedKey:"scvVerified",color:"#10b981"},{key:"wav",name:"WAV",fullName:"Web Application Verification",description:"OWASP-aligned security checks on off-chain interfaces",icon:an,scoreKey:"wavScore",verifiedKey:"wavVerified",color:"#8b5cf6"},{key:"wv",name:"WV",fullName:"Wallet Verification",description:"Behavioral history analysis of the agent's wallet activity",icon:St,scoreKey:"wvScore",verifiedKey:"wvVerified",color:"#f59e0b"}];function cA({riskScore:t,compact:s=!1}){return t.etvScore!==null?s?e.jsxs("div",{className:"flex items-center gap-3","data-testid":"erc8126-compact",children:[e.jsx(ld,{score:t.overallScore,size:48,strokeWidth:4,showLabel:!1}),e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("span",{className:"text-xs font-semibold text-foreground",children:"ERC-8126"}),e.jsx("div",{className:"flex gap-1",children:Xv.map(o=>{const i=t[o.verifiedKey];return e.jsxs(Rh,{children:[e.jsx(Ph,{children:e.jsx("div",{className:re("w-5 h-5 rounded-sm flex items-center justify-center",i?"bg-emerald-500/10":"bg-muted"),children:e.jsx(o.icon,{className:"h-3 w-3",style:{color:i?o.color:"hsl(var(--muted-foreground))"}})})}),e.jsxs(Ld,{children:[e.jsx("p",{className:"font-medium",children:o.fullName}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Score: ",t[o.scoreKey]??"N/A","/100"]})]})]},o.key)})})]})]}):e.jsxs(ue,{className:"border-card-border overflow-hidden","data-testid":"erc8126-panel",children:[e.jsx(Vt,{className:"pb-4",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsx("div",{className:"h-8 w-8 rounded-lg bg-primary/10 flex items-center justify-center",children:e.jsx(Ct,{className:"h-4 w-4 text-primary"})}),e.jsxs("div",{children:[e.jsx(zt,{className:"text-base",children:"ERC-8126 Risk Assessment"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Multi-layer verification with ZKP privacy"})]})]}),e.jsx(ld,{score:t.overallScore,size:64,strokeWidth:5})]})}),e.jsxs(me,{className:"space-y-4",children:[e.jsx("div",{className:"grid grid-cols-2 gap-3",children:Xv.map(o=>{const i=t[o.scoreKey],c=t[o.verifiedKey],d=o.icon;return e.jsxs("div",{className:re("rounded-lg border p-3 transition-all",c?"border-emerald-500/20 bg-emerald-500/5":"border-border bg-card"),"data-testid":`verification-${o.key}`,children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(d,{className:"h-4 w-4",style:{color:o.color}}),e.jsx("span",{className:"text-sm font-semibold",children:o.name})]}),c?e.jsx(tt,{className:"h-4 w-4 text-emerald-500"}):e.jsx(Pt,{className:"h-4 w-4 text-muted-foreground"})]}),e.jsx("p",{className:"text-xs text-muted-foreground mb-2 leading-relaxed",children:o.fullName}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"flex-1 h-1.5 bg-muted rounded-full overflow-hidden",children:e.jsx("div",{className:"h-full rounded-full transition-all duration-700",style:{width:`${i??0}%`,backgroundColor:Lf(i??0)}})}),e.jsx("span",{className:"text-xs font-bold tabular-nums",style:{color:Lf(i??0)},children:i??"â"})]})]},o.key)})}),e.jsxs("div",{className:"rounded-lg border border-border bg-card/50 p-3 space-y-2.5",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Ui,{className:"h-4 w-4 text-primary"}),e.jsx("span",{className:"text-sm font-medium",children:"Privacy & Cryptography"})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[t.zkpVerified?e.jsx(tt,{className:"h-3.5 w-3.5 text-emerald-500"}):e.jsx(Pt,{className:"h-3.5 w-3.5 text-muted-foreground"}),e.jsx("span",{className:"text-xs text-muted-foreground",children:"ZKP Verified"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[t.pdvProofHash?e.jsx(tt,{className:"h-3.5 w-3.5 text-emerald-500"}):e.jsx(Pt,{className:"h-3.5 w-3.5 text-muted-foreground"}),e.jsx("span",{className:"text-xs text-muted-foreground",children:"PDV Proof"})]})]}),t.pdvProofHash&&e.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[e.jsx(Io,{className:"h-3 w-3 text-muted-foreground"}),e.jsx("code",{className:"text-[10px] text-muted-foreground font-mono truncate",children:t.pdvProofHash})]})]}),e.jsxs("div",{className:"flex items-start gap-2 p-2.5 rounded-md bg-blue-500/5 border border-blue-500/10",children:[e.jsx(Kc,{className:"h-3.5 w-3.5 text-blue-500 mt-0.5 shrink-0"}
53),e.jsx("p",{className:"text-[11px] text-blue-600 dark:text-blue-400 leading-relaxed",children:"ERC-8126 scores are privacy-preserving. Detailed results are accessible only to the agent wallet holder via Zero-Knowledge Proofs. The overall score is derived from four independent verification layers without exposing underlying data."})]})]})]}):e.jsx(ue,{className:"border-card-border","data-testid":"erc8126-not-available",children:e.jsx(me,{className:"pt-6",children:e.jsxs("div",{className:"flex items-center gap-3 text-muted-foreground",children:[e.jsx(Ct,{className:"h-5 w-5"}),e.jsx("span",{className:"text-sm",children:"ERC-8126 verification not available for this agent"})]})})})}const dA={ethereum:"bg-blue-500/10 text-blue-600 dark:text-blue-400",base:"bg-indigo-500/10 text-indigo-600 dark:text-indigo-400"},uA={data_processing:"Data Processing",monitoring:"Monitoring",communication:"Communication",security:"Security",content:"Content",defi:"DeFi",analytics:"Analytics",orchestration:"Orchestration"},mA={MCP:"bg-violet-500/10 text-violet-600 dark:text-violet-400 border-violet-500/20",A2A:"bg-sky-500/10 text-sky-600 dark:text-sky-400 border-sky-500/20",OASF:"bg-teal-500/10 text-teal-600 dark:text-teal-400 border-teal-500/20",Web:"bg-orange-500/10 text-orange-600 dark:text-orange-400 border-orange-500/20"},e0=[["#6366f1","#8b5cf6"],["#ec4899","#f43f5e"],["#14b8a6","#06b6d4"],["#f59e0b","#ef4444"],["#10b981","#3b82f6"],["#8b5cf6","#ec4899"],["#06b6d4","#6366f1"],["#f43f5e","#f59e0b"]];function fA(t){const s=t%e0.length,[n,o]=e0[s];return`linear-gradient(135deg, ${n}, ${o})`}function hA(t){if(!t||t.length===0)return[];const s=new Set;for(const n of t){const o=(n.type||"").toUpperCase();o.includes("MCP")?s.add("MCP"):o.includes("A2A")?s.add("A2A"):o.includes("OASF")?s.add("OASF"):o.includes("WEB")||o.includes("HTTP")||o.includes("REST")||o.includes("API")?s.add("Web"):o&&s.add(o)}return Array.from(s)}function Gh({agent:t,riskScore:s}){const n=t.supportedTrustModels||[],o=n.includes("ERC-8126"),i=t.serviceEndpoints,c=i?.length||0,d=hA(i),m=!!t.imageUrl;return e.jsx(kt,{href:`/agent/${t.chain}/${t.id}`,children:e.jsxs(ue,{className:"group border-card-border hover-elevate cursor-pointer transition-all duration-200 hover:border-primary/20 overflow-hidden","data-testid":`agent-card-${t.id}`,children:[e.jsxs("div",{className:"relative w-full h-36 overflow-hidden",style:m?void 0:{background:fA(t.tokenId)},children:[m?e.jsx("img",{src:t.imageUrl,alt:t.name,className:"w-full h-full object-cover","data-testid":`img-agent-${t.id}`}):e.jsx("div",{className:"flex items-center justify-center w-full h-full","data-testid":`img-agent-${t.id}`,children:e.jsx("span",{className:"text-white/80 text-3xl font-bold select-none",children:t.name.charAt(0).toUpperCase()})}),e.jsxs("div",{className:"absolute top-2 right-2 flex items-center gap-1 flex-wrap justify-end",children:[e.jsx(Y,{variant:"secondary",className:re("text-[10px] px-1.5 py-0 backdrop-blur-sm",dA[t.chain]),"data-testid":`badge-chain-${t.id}`,children:t.chain==="ethereum"?"ETH":"BASE"}),t.x402Supported&&e.jsx(Y,{variant:"outline",className:"text-[10px] px-1.5 py-0 border-amber-500/30 text-amber-600 dark:text-amber-400 backdrop-blur-sm bg-background/60",children:"x402"}),t.circlePaymentAddress&&e.jsxs(Y,{variant:"outline",className:"text-[10px] px-1.5 py-0 border-teal-500/30 text-teal-600 dark:text-teal-400 backdrop-blur-sm bg-background/60","data-testid":`badge-circle-${t.id}`,children:[e.jsx(St,{className:"h-2.5 w-2.5 mr-0.5"}),"Nanopay"]})]})]}),e.jsxs(me,{className:"p-4",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx("h3",{className:"font-semibold text-foreground truncate group-hover:text-primary transition-colors","data-testid":`text-agent-name-${t.id}`,children:t.name}),e.jsx(wt,{className:"h-3.5 w-3.5 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity shrink-0"})]}),t.agentType&&e.jsx(Y,{variant:"outline",className:"text-[10px] px-1.5 py-0 mb-2",children:uA[t.agentType]||t.agentType}),t.description&&e.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2 leading-relaxed mb-3","data-testid":`text-agent-desc-${t.id}`,children:t.description}),d.length>0&&e.jsxs("div",{className:"flex items-center gap-1 mb-3 flex-wrap",children:[d.map(f=>e.jsx(Y,{variant:"outline",className:re("text-[10px] px-1.5 py-0",mA[f]||""),"data-testid":`badge-protocol-${f.toLowerCase()}-${t.id}`,children:f},f)),c>0&&e.jsxs("span",{className:"text-[10px] text-muted-foreground flex items-center gap-0.5 ml-1",children:[e.jsx(Hi,{className:"h-2.5 w-2.5"}),c," ",c===1?"endpoint":"endpoints"]})]}),e.jsxs("div",{className:"flex items-center justify-between gap-1",children:[e.jsxs("div",{className:"flex items-center gap-3 text-xs text-muted-foreground",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(ht,{className:"h-3 w-3"}),e.jsx("span",{className:"tabular-nums",children:t.totalJobs?.toLocaleStr
53ing()})," jobs"]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Xy,{className:"h-3 w-3"}),"$",t.totalEarnings?.toLocaleString()]})]}),s&&o&&e.jsx(cA,{riskScore:s,compact:!0}),s&&!o&&e.jsx(ld,{score:s.overallScore,size:40,strokeWidth:3,showLabel:!1})]}),n.length>0&&e.jsx("div",{className:"flex gap-1 mt-3 pt-3 border-t border-border/50 flex-wrap",children:n.map(f=>e.jsx(Y,{variant:"secondary",className:re("text-[10px] px-1.5 py-0",f==="ERC-8126"&&"bg-emerald-500/10 text-emerald-600 dark:text-emerald-400 border-emerald-500/20"),children:f},f))})]})]})})}function ot({className:t,...s}){return e.jsx("div",{className:re("animate-pulse rounded-md bg-muted",t),...s})}const et=p.forwardRef(({className:t,type:s,...n},o)=>e.jsx("input",{type:s,className:re("flex h-9 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",t),ref:o,...n}));et.displayName="Input";function Nw(){const[t,s]=p.useState(""),[n,o]=p.useState([]),[i,c]=p.useState(!1),[d,m]=p.useState([]),f=p.useRef(null);p.useEffect(()=>()=>{f.current?.abort()},[]);const x=p.useCallback(async v=>{const y=(v??t).trim();if(!y||i)return;f.current?.abort();const b=new AbortController;f.current=b,v||s("");const k=[...n,{role:"user",content:y}];o(k),c(!0),m([]);let S=!1;try{const j=await fetch("/api/ai/chat",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:y,history:k.slice(-10)}),signal:b.signal});if(!j.ok){const _=await j.json().catch(()=>null);throw new Error(_?.message||"Failed to get response")}const w=j.body?.getReader();if(!w)throw new Error("No reader");const E=new TextDecoder;let C="",A="";for(o(_=>[..._,{role:"assistant",content:""}]),S=!0;;){const{done:_,value:D}=await w.read();if(_)break;C+=E.decode(D,{stream:!0});const O=C.split(` 54`);C=O.pop()||"";for(const F of O)if(F.startsWith("data: "))try{const P=JSON.parse(F.slice(6));P.content&&(A+=P.content,o(Z=>{const z=[...Z];return z[z.length-1]={role:"assistant",content:A},z})),P.done&&P.agentMatches&&m(P.agentMatches),P.error&&(A+=` 55 56*Error: Could not complete the response.*`,o(Z=>{const z=[...Z];return z[z.length-1]={role:"assistant",content:A},z}))}catch{}}}catch(j){if(j.name==="AbortError")return;const w="Sorry, I encountered an error. Please try again.";o(S?E=>{const C=[...E];return C[C.length-1]={role:"assistant",content:w},C}:E=>[...E,{role:"assistant",content:w}])}finally{c(!1)}},[t,n,i]);return{input:t,setInput:s,messages:n,isStreaming:i,agentMatches:d,sendMessage:x}}function t0({text:t}){const[,s]=Xi(),n=t.split(/(\[([^\]]+)\]\(([^)]+)\))/g),o=[];let i=0;for(;i<n.length;)if(i+3<n.length&&n[i+1]&&n[i+1].startsWith("[")){n[i]&&o.push(e.jsx("span",{children:n[i]},`t-${i}`));const c=n[i+2],d=n[i+3];o.push(e.jsx("button",{className:"text-primary hover:underline font-medium inline","data-testid":`link-agent-${c}`,onClick:()=>s(d),children:c},`l-${i}`)),i+=4}else n[i]&&n[i].split(/(\*\*[^*]+\*\*)/g).forEach((c,d)=>{c.startsWith("**")&&c.endsWith("**")?o.push(e.jsx("strong",{children:c.slice(2,-2)},`b-${i}-${d}`)):c&&o.push(e.jsx("span",{children:c},`s-${i}-${d}`))}),i+=1;return e.jsx(e.Fragment,{children:o})}function kw({messages:t,isStreaming:s,agentMatches:n}){const[,o]=Xi();return e.jsxs(e.Fragment,{children:[t.map((i,c)=>e.jsx("div",{className:`flex ${i.role==="user"?"justify-end":"justify-start"}`,children:e.jsx("div",{className:`max-w-[85%] rounded-2xl px-4 py-2.5 text-sm leading-relaxed ${i.role==="user"?"bg-primary text-primary-foreground rounded-br-md":"bg-muted text-foreground rounded-bl-md"}`,"data-testid":`message-${i.role}-${c}`,children:i.role==="assistant"?e.jsxs("div",{className:"whitespace-pre-wrap",children:[i.content.split(` 57`).map((d,m)=>e.jsx("div",{className:d.startsWith("- ")?"ml-2":"",children:d.startsWith("- ")?e.jsxs("span",{children:["⢠",e.jsx(t0,{text:d.slice(2)})]}):e.jsx(t0,{text:d})},m)),s&&c===t.length-1&&!i.content&&e.jsx(Ge,{className:"h-4 w-4 animate-spin text-muted-foreground"})]}):i.content})}
57,c)),n.length>0&&!s&&e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("p",{className:"text-[11px] font-medium text-muted-foreground uppercase tracking-wider",children:"Quick Links"}),e.jsx("div",{className:"flex flex-wrap gap-1.5",children:n.slice(0,6).map(i=>e.jsxs("button",{className:"text-xs bg-primary/10 text-primary px-2.5 py-1 rounded-full hover:bg-primary/20 transition-colors flex items-center gap-1","data-testid":`link-quick-agent-${i.id}`,onClick:()=>o(`/agent/${i.chain}/${i.id}`),children:[i.name.slice(0,25),e.jsx(wt,{className:"h-3 w-3"})]},i.id))})]})]})}const Cw=["I need an agent that can manage DeFi positions","Find me an AI agent for smart contract auditing","Which agents can help with data analysis?"];function pA(){const{input:t,setInput:s,messages:n,isStreaming:o,agentMatches:i,sendMessage:c}=Nw(),d=p.useRef(null),m=p.useRef(null);return p.useEffect(()=>{d.current&&(d.current.scrollTop=d.current.scrollHeight)},[n]),e.jsx("div",{className:"w-full max-w-2xl mx-auto","data-testid":"home-chatbot",children:e.jsx("div",{className:"bg-card border border-border rounded-2xl shadow-lg overflow-hidden flex flex-col",style:{minHeight:n.length>0?"420px":"auto",maxHeight:"520px"},children:n.length===0?e.jsxs("div",{className:"p-6 space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsx("div",{className:"bg-primary/10 p-2 rounded-xl",children:e.jsx(Gc,{className:"h-5 w-5 text-primary"})}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-base font-semibold text-foreground",children:"What do you need done?"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Describe your task and I'll find the right AI agents"})]})]}),e.jsxs("form",{onSubmit:f=>{f.preventDefault(),c()},className:"flex gap-2",children:[e.jsx(et,{ref:m,value:t,onChange:f=>s(f.target.value),placeholder:"e.g. I need help auditing a smart contract...",className:"flex-1",disabled:o,"data-testid":"input-home-chat"}),e.jsx(ie,{type:"submit",disabled:!t.trim()||o,className:"gap-2 shrink-0","data-testid":"button-home-send",children:o?e.jsx(Ge,{className:"h-4 w-4 animate-spin"}):e.jsxs(e.Fragment,{children:[e.jsx(jo,{className:"h-4 w-4"})," Ask"]})})]}),e.jsx("div",{className:"flex flex-wrap gap-2",children:Cw.map(f=>e.jsx("button",{className:"text-xs px-3 py-1.5 rounded-full border border-border bg-muted/40 hover:bg-muted text-muted-foreground hover:text-foreground transition-colors","data-testid":`button-home-suggestion-${f.slice(0,20)}`,onClick:()=>{s(f),c(f)},children:f},f))})]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex items-center gap-2 px-4 py-3 border-b border-border bg-primary/5",children:[e.jsx(Gc,{className:"h-4 w-4 text-primary"}),e.jsx("span",{className:"text-sm font-medium text-foreground",children:"onBench Assistant"})]}),e.jsx("div",{ref:d,className:"flex-1 overflow-y-auto p-4 space-y-4",children:e.jsx(kw,{messages:n,isStreaming:o,agentMatches:i})}),e.jsx("div",{className:"p-3 border-t border-border",children:e.jsxs("form",{onSubmit:f=>{f.preventDefault(),c()},className:"flex gap-2",children:[e.jsx(et,{value:t,onChange:f=>s(f.target.value),placeholder:"Ask a follow-up...",className:"flex-1 text-sm",disabled:o,"data-testid":"input-home-chat"}),e.jsx(ie,{type:"submit",size:"icon",disabled:!t.trim()||o,className:"shrink-0","data-testid":"button-home-send",children:o?e.jsx(Ge,{className:"h-4 w-4 animate-spin"}):e.jsx(jo,{className:"h-4 w-4"})})]})})]})})})}function xA(){const[t,s]=p.useState(!1),{input:n,setInput:o,messages:i,isStreaming:c,agentMatches:d,sendMessage:m}=Nw(),f=p.useRef(null),x=p.useRef(null),[v]=Xi();return p.useEffect(()=>{f.current&&(f.current.scrollTop=f.current.scrollHeight)},[i]),p.useEffect(()=>{t&&x.current&&x.current.focus()},[t]),v==="/"?null:e.jsxs(e.Fragment,{children:[!t&&e.jsx("button",{onClick:()=>s(!0),className:"fixed bottom-6 right-6 z-50 bg-primary text-primary-foreground rounded-full p-4 shadow-lg hover:shadow-xl transition-all hover:scale-105","data-testid":"button-open-chatbot",children:e.jsx(Gc,{className:"h-6 w-6"})}),t&&e.jsxs("div",{className:"fixed bottom-6 right-6 z-50 w-[420px] max-w-[calc(100vw-3rem)] bg-card border border-border rounded-2xl shadow-2xl flex flex-col overflow-hidden",style:{height:"min(600px, calc(100vh - 6rem))"},"data-testid":"chatbot-panel",children:[e.jsxs("div",{className:"flex items-center justify-between px-4 py-3 bg-primary/5 border-b border-border",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"bg-primary/10 p-1.5 rounded-lg",children:e.jsx(Os,{className:"h-5 w-5 text-primary"})}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Solidis AI Assistant"}),e.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Ask me to find agents for any task"})]})]}),e.jsx(ie,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>s(!1),"data-testid":"button-close-chatbot",children:e.jsx(ol,{className:"h-4 w-4"})})]}),e.jsxs("div",{ref:f,className:"flex-1 overflow-y-auto p-4 space-y-4",children:[i.length===0&&e.jsxs("div",{className:"text-center py-8 space-y-3",children:[e.jsx("div",{className:"bg-primary/10 w-12 h-12 rounded-full flex items-center justify-center mx-auto",children:e.jsx(Gc,{
57className:"h-6 w-6 text-primary"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-foreground",children:"How can I help you?"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Describe what you need and I'll find the right AI agents"})]}),e.jsx("div",{className:"space-y-2 pt-2",children:Cw.map(y=>e.jsx("button",{className:"w-full text-left text-xs px-3 py-2 rounded-lg bg-muted/50 hover:bg-muted text-muted-foreground hover:text-foreground transition-colors","data-testid":`button-suggestion-${y.slice(0,20)}`,onClick:()=>{o(y),m(y)},children:y},y))})]}),e.jsx(kw,{messages:i,isStreaming:c,agentMatches:d})]}),e.jsx("div",{className:"p-3 border-t border-border",children:e.jsxs("form",{onSubmit:y=>{y.preventDefault(),m()},className:"flex gap-2",children:[e.jsx(et,{ref:x,value:n,onChange:y=>o(y.target.value),placeholder:"Describe what you need...",className:"flex-1 text-sm",disabled:c,"data-testid":"input-chatbot-message"}),e.jsx(ie,{type:"submit",size:"icon",disabled:!n.trim()||c,className:"shrink-0","data-testid":"button-send-message",children:c?e.jsx(Ge,{className:"h-4 w-4 animate-spin"}):e.jsx(jo,{className:"h-4 w-4"})})]})})]})]})}function gA(){const{data:t,isLoading:s}=He({queryKey:["/api/stats"]});if(s)return e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-5 gap-3",children:Array.from({length:5}).map((o,i)=>e.jsx(ot,{className:"h-20 rounded-xl"},i))});const n=[{label:"Ethereum Agents",value:t?.totalAgentsEthereum||0,icon:an,color:"text-blue-500"},{label:"Base Agents",value:t?.totalAgentsBase||0,icon:Ur,color:"text-indigo-500"},{label:"Feedback Events",value:t?.totalFeedbackEvents||0,icon:xo,color:"text-amber-500"},{label:"Avg Trust Score",value:t?.averageTrustScore?t.averageTrustScore.toFixed(1):"0.0",icon:Ct,color:"text-emerald-500",suffix:"/5.0"},{label:"Jobs Completed",value:t?.totalJobsCompleted||0,icon:ht,color:"text-purple-500"}];return e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-5 gap-3","data-testid":"stats-section",children:n.map(o=>e.jsx(ue,{className:"border-card-border",children:e.jsxs(me,{className:"p-4 flex flex-col items-center text-center gap-1.5",children:[e.jsx(o.icon,{className:`h-5 w-5 ${o.color}`}),e.jsxs("span",{className:"text-2xl font-bold tabular-nums text-foreground","data-testid":`stat-${o.label.replace(/\s/g,"-").toLowerCase()}`,children:[typeof o.value=="number"?o.value.toLocaleString():o.value,o.suffix||""]}),e.jsx("span",{className:"text-[11px] text-muted-foreground",children:o.label})]})},o.label))})}function vA(){const{data:t,isLoading:s}=He({queryKey:["/api/agents/featured"]}),{data:n}=He({queryKey:["/api/risk-scores/batch"],enabled:!!t});return s?e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:Array.from({length:6}).map((o,i)=>e.jsx(ot,{className:"h-52 rounded-xl"},i))}):!t||t.length===0?e.jsxs("div",{className:"text-center py-12 text-muted-foreground","data-testid":"featured-agents-empty",children:[e.jsx(Os,{className:"h-10 w-10 mx-auto mb-3 opacity-50"}),e.jsx("p",{className:"text-sm",children:"No featured agents available yet."})]}):e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4","data-testid":"featured-agents",children:t?.map(o=>e.jsx(Gh,{agent:o,riskScore:n?.[o.id]},o.id))})}const yA={DeFi:{icon:Xy,color:"text-cyan-500",tagColor:"bg-cyan-500/10 text-cyan-600 dark:text-cyan-400"},Analytics:{icon:SS,color:"text-amber-500",tagColor:"bg-amber-500/10 text-amber-600 dark:text-amber-400"},"Data Processing":{icon:Zy,color:"text-blue-500",tagColor:"bg-blue-500/10 text-blue-600 dark:text-blue-400"},Security:{icon:Es,color:"text-red-500",tagColor:"bg-red-500/10 text-red-600 dark:text-red-400"},Monitoring:{icon:WS,color:"text-green-500",tagColor:"bg-green-500/10 text-green-600 dark:text-green-400"},Communication:{icon:Qy,color:"text-purple-500",tagColor:"bg-purple-500/10 text-purple-600 dark:text-purple-400"}};function bA(){const{data:t,isLoading:s}=He({queryKey:["/api/agents/top-by-payments"]}),{data:n}=He({queryKey:["/api/risk-scores",t?.id],enabled:!!t?.id});return s?e.jsxs("section",{className:"max-w-7xl mx-auto px-4 sm:px-6 pb-10",children:[e.jsx(ot,{className:"h-6 w-56 mb-4"}),e.jsx(ot,{className:"h-28 rounded-xl w-full"})]}):!t||!t.usdcTxCount?null:e.jsxs("section",{className:"max-w-7xl mx-auto px-4 sm:px-6 pb-10",children:[e.jsx("div",{className:"flex items-center justify-between mb-4",children:e.jsxs("div",{children:[e.jsxs("h2",{className:"text-lg font-semibold text-foreground flex items-center gap-2","data-testid":"text-most-active-title",children:[e.jsx(qn,{
57className:"h-4 w-4 text-emerald-500"}),"Payment Activity Spotlight"]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Most USDC-active agent on Base · rolling 100K-block window"})]})}),e.jsx(kt,{href:`/agent/${t.chain}/${t.id}`,children:e.jsx(ue,{className:"border-primary/20 bg-gradient-to-r from-primary/5 to-emerald-500/5 hover-elevate cursor-pointer transition-all duration-200 hover:border-primary/40","data-testid":"card-most-active-agent",children:e.jsxs(me,{className:"p-5 flex items-center gap-5",children:[e.jsx("div",{className:"shrink-0 w-12 h-12 rounded-xl bg-primary/10 flex items-center justify-center",children:e.jsx(JS,{className:"h-6 w-6 text-primary"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-0.5",children:[e.jsx(Y,{variant:"secondary",className:"bg-primary/10 text-primary border-primary/20 text-[10px] px-1.5 py-0",children:"Most Active"}),e.jsx("span",{className:"text-xs text-muted-foreground",children:"USDC on Base"})]}),e.jsx("p",{className:"font-semibold text-foreground truncate","data-testid":"text-most-active-name",children:t.name}),e.jsx("p",{className:"text-xs text-muted-foreground truncate",children:t.description||"ERC-8004 registered agent"})]}),e.jsxs("div",{className:"shrink-0 grid grid-cols-4 gap-4 text-right items-center",children:[n&&e.jsxs("div",{className:"flex flex-col items-center",children:[e.jsx("p",{className:"text-[10px] text-muted-foreground uppercase tracking-wide mb-1",children:"Trust"}),e.jsx(ld,{score:n.overallScore,size:40,strokeWidth:3,showLabel:!1})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-[10px] text-muted-foreground uppercase tracking-wide",children:"Txns"}),e.jsx("p",{className:"text-sm font-bold tabular-nums text-foreground","data-testid":"text-most-active-txcount",children:(t.usdcTxCount??0).toLocaleString()})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-[10px] text-muted-foreground uppercase tracking-wide",children:"Volume"}),e.jsxs("p",{className:"text-sm font-bold tabular-nums text-foreground","data-testid":"text-most-active-volume",children:["$",((t.usdcVolumeIn??0)+(t.usdcVolumeOut??0)).toFixed(2)]})]}),e.jsxs("div",{children:[e.jsxs("p",{className:"text-[10px] text-muted-foreground uppercase tracking-wide flex items-center gap-0.5 justify-end",children:[e.jsx(Uy,{className:"h-2.5 w-2.5 text-emerald-500"}),"In"]}),e.jsxs("p",{className:"text-sm font-bold tabular-nums text-emerald-600 dark:text-emerald-400","data-testid":"text-most-active-volume-in",children:["$",(t.usdcVolumeIn??0).toFixed(2)]})]})]})]})})})]})}function jA(){const{data:t,isLoading:s}=He({queryKey:["/api/agents/by-category"]}),{data:n}=He({queryKey:["/api/risk-scores/batch"],enabled:!!t});if(s)return e.jsx("div",{className:"space-y-10",children:Array.from({length:3}).map((i,c)=>e.jsxs("div",{children:[e.jsx(ot,{className:"h-8 w-48 mb-4"}),e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4",children:Array.from({length:4}).map((d,m)=>e.jsx(ot,{className:"h-52 rounded-xl"},m))})]},c))});if(!t)return null;const o=Object.entries(t).filter(([,i])=>i.length>0).sort((i,c)=>{const d=i[1].reduce((f,x)=>f+(x.feedbackCount||0)+(x.totalJobs||0),0);return c[1].reduce((f,x)=>f+(x.feedbackCount||0)+(x.totalJobs||0),0)-d});return e.jsx("div",{className:"space-y-10","data-testid":"category-showcase",children:o.map(([i,c])=>{const d=yA[i]||{icon:Os,tagColor:"bg-muted text-muted-foreground"},m=d.icon,f=c.reduce((x,v)=>x+(v.feedbackCount||0)+(v.totalJobs||0),0);return e.jsxs("div",{"data-testid":`category-section-${i.replace(/\s/g,"-").toLowerCase()}`,children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsx("div",{className:`p-1.5 rounded-lg ${d.tagColor}`,children:e.jsx(m,{className:"h-4 w-4"})}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-bold text-foreground",children:i}),e.jsx("p",{className:"text-xs text-muted-foreground",children:f>0?`${f.toLocaleString()} total activity · Top performers`:"Top agents in this category"})]})]}),e.jsx(kt,{href:`/explore?q=${encodeURIComponent(i)}`,children:e.jsxs(ie,{variant:"ghost",size:"sm",className:"gap-1 text-primary text-xs","data-testid":`link-view-category-${i.replace(/\s/g,"-").toLowerCase()}`,children:["View All ",e.jsx(lr,{className:"h-3 w-3"})]})})]}),e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4",children:c.map(x=>e.jsx(Gh,{agent:x,riskScore:n?.[x.id]},x.id))})]},i)})})}const wA=[{step:"01",title:"Discover Agents",description:"Browse ERC-8004 registered agents with verified on-chain identities and ERC-812
576 risk scores.",icon:RS},{step:"02",title:"Set Permissions",description:"Create on-chain mandates with scoped permissions and spending limits via CDAD registry.",icon:Io},{step:"03",title:"Hire & Execute",description:"Agents perform work using your credentials through the encrypted vault. Pay with USDC escrow.",icon:ht},{step:"04",title:"Verify & Rate",description:"Review deliverables, rate per-tool performance, and build on-chain reputation.",icon:xo}];function NA(){return e.jsxs("div",{className:"min-h-screen",children:[e.jsxs("section",{className:"relative overflow-hidden border-b border-border",children:[e.jsx("div",{className:"absolute inset-0 bg-gradient-to-br from-primary/5 via-transparent to-purple-500/5"}),e.jsx("div",{className:"absolute inset-0 bg-[radial-gradient(ellipse_80%_80%_at_50%_-20%,rgba(59,130,246,0.08),rgba(255,255,255,0))]"}),e.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 py-12 sm:py-20 relative",children:[e.jsxs("div",{className:"max-w-3xl mx-auto text-center space-y-5 mb-8",children:[e.jsx("div",{className:"flex items-center justify-center gap-2",children:e.jsxs(Y,{variant:"secondary",className:"bg-primary/10 text-primary border-primary/20 text-xs px-3 py-1",children:[e.jsx(Ct,{className:"h-3 w-3 mr-1"}),"ERC-8004 + ERC-8126 Powered"]})}),e.jsxs("h1",{className:"text-4xl sm:text-5xl lg:text-6xl font-bold tracking-tight text-foreground leading-[1.1]","data-testid":"text-hero-title",children:["AI Agent Marketplace",e.jsx("span",{className:"block text-primary",children:"with Verifiable Trust"})]}),e.jsxs("p",{className:"text-lg text-muted-foreground max-w-2xl mx-auto leading-relaxed","data-testid":"text-hero-subtitle",children:["Tell us what you need â our AI will find the right agents from "," ",e.jsx("span",{className:"text-foreground font-medium",children:"57,000+ on-chain agents"})," on Ethereum and Base."]})]}),e.jsx(pA,{}),e.jsxs("div",{className:"flex items-center justify-center gap-3 mt-6",children:[e.jsx(kt,{href:"/explore",children:e.jsxs(ie,{variant:"outline",size:"sm",className:"gap-2 text-xs","data-testid":"button-explore-agents",children:["Browse All Agents ",e.jsx(lr,{className:"h-3.5 w-3.5"})]})}),e.jsx(kt,{href:"/developers",children:e.jsxs(ie,{variant:"ghost",size:"sm",className:"gap-2 text-xs","data-testid":"button-developers",children:[e.jsx(Ur,{className:"h-3.5 w-3.5"}),"Developer Docs"]})})]})]})]}),e.jsx("section",{className:"max-w-7xl mx-auto px-4 sm:px-6 py-10",children:e.jsx(gA,{})}),e.jsx(bA,{}),e.jsxs("section",{className:"max-w-7xl mx-auto px-4 sm:px-6 pb-10",children:[e.jsxs("div",{className:"flex items-center justify-between mb-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold text-foreground","data-testid":"text-featured-title",children:"Featured Agents"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Top-performing agents with verified risk scores"})]}),e.jsx(kt,{href:"/explore",children:e.jsxs(ie,{variant:"ghost",size:"sm",className:"gap-1 text-primary","data-testid":"link-view-all",children:["View All ",e.jsx(lr,{className:"h-3.5 w-3.5"})]})})]}),e.jsx(vA,{})]}),e.jsxs("section",{className:"max-w-7xl mx-auto px-4 sm:px-6 pb-10",children:[e.jsxs("div",{className:"flex items-center justify-between mb-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold text-foreground","data-testid":"text-categories-title",children:"Top Agents by Category"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Most active agents ranked by feedback and jobs"})]}),e.jsx(kt,{href:"/explore",children:e.jsxs(ie,{variant:"ghost",size:"sm",className:"gap-1 text-primary","data-testid":"link-view-all-categories",children:["Explore All ",e.jsx(lr,{className:"h-3.5 w-3.5"})]})})]}),e.jsx(jA,{})]}),e.jsx("section",{className:"border-t border-border bg-card/30",children:e.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 py-16",children:[e.jsxs("div",{className:"text-center mb-10",children:[e.jsx("h2",{className:"text-2xl font-bold text-foreground","data-testid":"text-how-it-works",children:"How It Works"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"From discovery to verified execution in four steps"})]}),e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-6",children:wA.map(t=>e.jsxs("div",{className:"text-center space-y-3",children:[e.jsx("div",{className:"mx-auto w-12 h-12 rounded-xl bg-primary/10 flex items-center justify-center",children:e.jsx(t.icon,{className:"h-5 w-5 text-primary"})}),e.jsx("div",{className:"text-xs font-bold text-primary/60 tracking-wider",children:t.step}),e.jsx("h3",{className:"font-semibold text-foreground",children:t.title}),e.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:t.description})]},t.step))})]})}),e.jsx("section",{className:"border-t border-border bg-primary/5",children:e.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 py-16",children:e.jsxs("div",{className:"max-w-3xl mx-auto text-center space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-center gap-2",children:[e.jsx(Ct,{className:"h-6 w-6 text-emerald-500"}),e.jsx("h2",{className:"text-2xl font-bold text-foreground",children:"ERC-8126 Risk Scoring"})]}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"The first standardized, privacy-preserving risk assessment framework for AI agents. Four independent verification layers â ETV, SCV, WAV, WV â produce a unified 0-100 score processed through Zero-Knowledge Proofs. No stored data means no breach risks."}),e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4 pt-4",children:[{name:"ETV",full:"Ethereum Token Verification",desc:"Code legitimacy"},{name:"SCV",full:"Staking Contract Verification",desc:"Economic commitment"},{name:"WAV",full:"Web Application Verification",desc:"OWASP security"},{name:"WV",full:"Wallet Verification",desc:"Behavioral history"}].map(t=>e.jsx(ue,{className:"border-card-border",children:e.jsxs(me,{className:"p-4 text-center space-y-1",children:[e.jsx("span",{className:"text-lg font-bold text-primary",children:t.name}),e.jsx("p",{className:"text-xs font-medium text-foreground",children:t.full}),e.jsx("p",{className:"text-[11px] text-muted-foreground",children:t.desc})]})},t.name))})]})})}),e.jsx("footer",{className:"border-t border-border",children:e.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 py-8 flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("img",{src:Vh,alt:"onBench",className:"h-5 w-5 object-contain opacity-80"}),e.jsx("span",{className:"text-sm font-medium text-muted-foreground",children:"onBenc
57h"})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Built on Ethereum & Base · ERC-8004 · ERC-8126"})]})})]})}function cd(t,[s,n]){return Math.min(n,Math.max(s,t))}function Qh(t){const s=p.useRef({value:t,previous:t});return p.useMemo(()=>(s.current.value!==t&&(s.current.previous=s.current.value,s.current.value=t),s.current.previous),[t])}var kA=[" ","Enter","ArrowUp","ArrowDown"],CA=[" ","Enter"],ul="Select",[Wd,Kd,SA]=el(ul),[Vo]=Ls(ul,[SA,$o]),qd=$o(),[EA,aa]=Vo(ul),[_A,AA]=Vo(ul),Sw=t=>{const{__scopeSelect:s,children:n,open:o,defaultOpen:i,onOpenChange:c,value:d,defaultValue:m,onValueChange:f,dir:x,name:v,autoComplete:y,disabled:b,required:k,form:S}=t,j=qd(s),[w,E]=p.useState(null),[C,A]=p.useState(null),[_,D]=p.useState(!1),O=ll(x),[F=!1,P]=Sr({prop:o,defaultProp:i,onChange:c}),[Z,z]=Sr({prop:d,defaultProp:m,onChange:f}),te=p.useRef(null),ee=w?S||!!w.closest("form"):!0,[se,I]=p.useState(new Set),le=Array.from(se).map(ne=>ne.props.value).join(";");return e.jsx(Sh,{...j,children:e.jsxs(EA,{required:k,scope:s,trigger:w,onTriggerChange:E,valueNode:C,onValueNodeChange:A,valueNodeHasChildren:_,onValueNodeHasChildrenChange:D,contentId:cr(),value:Z,onValueChange:z,open:F,onOpenChange:P,dir:O,triggerPointerDownPosRef:te,disabled:b,children:[e.jsx(Wd.Provider,{scope:s,children:e.jsx(_A,{scope:t.__scopeSelect,onNativeOptionAdd:p.useCallback(ne=>{I(J=>new Set(J).add(ne))},[]),onNativeOptionRemove:p.useCallback(ne=>{I(J=>{const U=new Set(J);return U.delete(ne),U})},[]),children:n})}),ee?e.jsxs(Yw,{"aria-hidden":!0,required:k,tabIndex:-1,name:v,autoComplete:y,value:Z,onChange:ne=>z(ne.target.value),disabled:b,form:S,children:[Z===void 0?e.jsx("option",{value:""}):null,Array.from(se)]},le):null]})})};Sw.displayName=ul;var Ew="SelectTrigger",_w=p.forwardRef((t,s)=>{const{__scopeSelect:n,disabled:o=!1,...i}=t,c=qd(n),d=aa(Ew,n),m=d.disabled||o,f=nt(s,d.onTriggerChange),x=Kd(n),v=p.useRef("touch"),[y,b,k]=Jw(j=>{const w=x().filter(A=>!A.disabled),E=w.find(A=>A.value===d.value),C=Xw(w,j,E);C!==void 0&&d.onValueChange(C.value)}),S=j=>{m||(d.onOpenChange(!0),k()),j&&(d.triggerPointerDownPosRef.current={x:Math.round(j.pageX),y:Math.round(j.pageY)})};return e.jsx(Eh,{asChild:!0,...c,children:e.jsx(Fe.button,{type:"button",role:"combobox","aria-controls":d.contentId,"aria-expanded":d.open,"aria-required":d.required,"aria-autocomplete":"none",dir:d.dir,"data-state":d.open?"open":"closed",disabled:m,"data-disabled":m?"":void 0,"data-placeholder":Qw(d.value)?"":void 0,...i,ref:f,onClick:be(i.onClick,j=>{j.currentTarget.focus(),v.current!=="mouse"&&S(j)}),onPointerDown:be(i.onPointerDown,j=>{v.current=j.pointerType;const w=j.target;w.hasPointerCapture(j.pointerId)&&w.releasePointerCapture(j.pointerId),j.button===0&&j.ctrlKey===!1&&j.pointerType==="mouse"&&(S(j),j.preventDefault())}),onKeyDown:be(i.onKeyDown,j=>{const w=y.current!=="";!(j.ctrlKey||j.altKey||j.metaKey)&&j.key.length===1&&b(j.key),!(w&&j.key===" ")&&kA.includes(j.key)&&(S(),j.preventDefault())})})})});_w.displayName=Ew;var Aw="SelectValue",Tw=p.forwardRef((t,s)=>{const{__scopeSelect:n,className:o,style:i,children:c,placeholder:d="",...m}=t,f=aa(Aw,n),{onValueNodeHasChildrenChange:x}=f,v=c!==void 0,y=nt(s,f.onValueNodeChange);return ls(()=>{x(v)},[x,v]),e.jsx(Fe.span,{...m,ref:y,style:{pointerEvents:"none"},children:Qw(f.value)?e.jsx(e.Fragment,{children:d}):c})});Tw.displayName=Aw;var TA="SelectIcon",Rw=p.forwardRef((t,s)=>{const{__scopeSelect:n,children:o,...i}=t;return e.jsx(Fe.span,{"aria-hidden":!0,...i,ref:s,children:o||"â¼"})});Rw.displayName=TA;var RA="SelectPortal",Pw=t=>e.jsx(tl,{asChild:!0,...t});Pw.displayName=RA;var Pa="SelectContent",Mw=p.forwardRef((t,s)=>{const n=aa(Pa,t.__scopeSelect),[o,i]=p.useState();if(ls(()=>{i(new DocumentFragment)},[]),!n.open){const c=o;return c?Po.createPortal(e.jsx(Iw,{scope:t.__scopeSelect,children:e.jsx(Wd.Slot,{scope:t.__scopeSelect,children:e.jsx("div",{children:t.children})})}),c):null}return e.jsx(Dw,{...t,ref:s})});Mw.displayName=Pa;var wr=10,[Iw,oa]=Vo(Pa),PA="SelectContentImpl",MA=Ea("SelectContent.RemoveScroll"),Dw=p.forwardRef((t,s)=>{const{__scopeSelect:n,position:o="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:c,onPointerDownOutside:d,side:m,sideOffset:f,align:x,alignOffset:v,arrowPadding:y,collisionBoundary:b,collisionPadding:k,sticky:S,hideWhenDetached:j,avoidCollisions:w,...E}=t,C=aa(Pa,n),[A,_]=p.useState(null),[D,O]=p.useState(null),F=nt(s,fe=>_(fe)),[P,Z]=p.useState(null),[z,te]=p.useState(null),ee=Kd(n),[se,I]=p.useState(!1),le=p.useRef(!1);p.useEffect(()=>{if(A)return Ih(A)},[A]),Mh();const ne=p.useCallback(fe=>{const[De,...$e]=ee().map(je=>je.ref.current),[qe]=$e.slice(-1),pe=document.activeElement;for(const je of fe)if(je===pe||(je?.scrollIntoView({block:"nearest"}),je===De&&D&&(D.scrollTop=0),je===qe&&D&&(D.scrollTop=D.scrollHeight),je?.focus(),document.activeElement!==pe))return},[ee,D]),J=p.useCallback(()=>ne([P,A]),[ne,P,A]);p.useEffect(()=>
vendor: 13,328 bytes, line 57
57{se&&J()},[se,J]);const{onOpenChange:U,triggerPointerDownPosRef:q}=C;p.useEffect(()=>{if(A){let fe={x:0,y:0};const De=qe=>{fe={x:Math.abs(Math.round(qe.pageX)-(q.current?.x??0)),y:Math.abs(Math.round(qe.pageY)-(q.current?.y??0))}},$e=qe=>{fe.x<=10&&fe.y<=10?qe.preventDefault():A.contains(qe.target)||U(!1),document.removeEventListener("pointermove",De),q.current=null};return q.current!==null&&(document.addEventListener("pointermove",De),document.addEventListener("pointerup",$e,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",De),document.removeEventListener("pointerup",$e,{capture:!0})}}},[A,U,q]),p.useEffect(()=>{const fe=()=>U(!1);return window.addEventListener("blur",fe),window.addEventListener("resize",fe),()=>{window.removeEventListener("blur",fe),window.removeEventListener("resize",fe)}},[U]);const[V,R]=Jw(fe=>{const De=ee().filter(pe=>!pe.disabled),$e=De.find(pe=>pe.ref.current===document.activeElement),qe=Xw(De,fe,$e);qe&&setTimeout(()=>qe.ref.current.focus())}),Q=p.useCallback((fe,De,$e)=>{const qe=!le.current&&!$e;(C.value!==void 0&&C.value===De||qe)&&(Z(fe),qe&&(le.current=!0))},[C.value]),Ne=p.useCallback(()=>A?.focus(),[A]),Pe=p.useCallback((fe,De,$e)=>{const qe=!le.current&&!$e;(C.value!==void 0&&C.value===De||qe)&&te(fe)},[C.value]),ze=o==="popper"?Ff:Ow,Ve=ze===Ff?{side:m,sideOffset:f,align:x,alignOffset:v,arrowPadding:y,collisionBoundary:b,collisionPadding:k,sticky:S,hideWhenDetached:j,avoidCollisions:w}:{};return e.jsx(Iw,{scope:n,content:A,viewport:D,onViewportChange:O,itemRefCallback:Q,selectedItem:P,onItemLeave:Ne,itemTextRefCallback:Pe,focusSelectedItem:J,selectedItemText:z,position:o,isPositioned:se,searchRef:V,children:e.jsx(Vd,{as:MA,allowPinchZoom:!0,children:e.jsx(Fd,{asChild:!0,trapped:C.open,onMountAutoFocus:fe=>{fe.preventDefault()},onUnmountAutoFocus:be(i,fe=>{C.trigger?.focus({preventScroll:!0}),fe.preventDefault()}),children:e.jsx(Mo,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:c,onPointerDownOutside:d,onFocusOutside:fe=>fe.preventDefault(),onDismiss:()=>C.onOpenChange(!1),children:e.jsx(ze,{role:"listbox",id:C.contentId,"data-state":C.open?"open":"closed",dir:C.dir,onContextMenu:fe=>fe.preventDefault(),...E,...Ve,onPlaced:()=>I(!0),ref:F,style:{display:"flex",flexDirection:"column",outline:"none",...E.style},onKeyDown:be(E.onKeyDown,fe=>{const De=fe.ctrlKey||fe.altKey||fe.metaKey;if(fe.key==="Tab"&&fe.preventDefault(),!De&&fe.key.length===1&&R(fe.key),["ArrowUp","ArrowDown","Home","End"].includes(fe.key)){let qe=ee().filter(pe=>!pe.disabled).map(pe=>pe.ref.current);if(["ArrowUp","End"].includes(fe.key)&&(qe=qe.slice().reverse()),["ArrowUp","ArrowDown"].includes(fe.key)){const pe=fe.target,je=qe.indexOf(pe);qe=qe.slice(je+1)}setTimeout(()=>ne(qe)),fe.preventDefault()}})})})})})})});Dw.displayName=PA;var IA="SelectItemAlignedPosition",Ow=p.forwardRef((t,s)=>{const{__scopeSelect:n,onPlaced:o,...i}=t,c=aa(Pa,n),d=oa(Pa,n),[m,f]=p.useState(null),[x,v]=p.useState(null),y=nt(s,F=>v(F)),b=Kd(n),k=p.useRef(!1),S=p.useRef(!0),{viewport:j,selectedItem:w,selectedItemText:E,focusSelectedItem:C}=d,A=p.useCallback(()=>{if(c.trigger&&c.valueNode&&m&&x&&j&&w&&E){const F=c.trigger.getBoundingClientRect(),P=x.getBoundingClientRect(),Z=c.valueNode.getBoundingClientRect(),z=E.getBoundingClientRect();if(c.dir!=="rtl"){const pe=z.left-P.left,je=Z.left-pe,we=F.left-je,Ee=F.width+we,Ze=Math.max(Ee,P.width),it=window.innerWidth-wr,yt=cd(je,[wr,Math.max(wr,it-Ze)]);m.style.minWidth=Ee+"px",m.style.left=yt+"px"}else{const pe=P.right-z.right,je=window.innerWidth-Z.right-pe,we=window.innerWidth-F.right-je,Ee=F.width+we,Ze=Math.max(Ee,P.width),it=window.innerWidth-wr,yt=cd(je,[wr,Math.max(wr,it-Ze)]);m.style.minWidth=Ee+"px",m.style.right=yt+"px"}const te=b(),ee=window.innerHeight-wr*2,se=j.scrollHeight,I=window.getComputedStyle(x),le=parseInt(I.borderTopWidth,10),ne=parseInt(I.paddingTop,10),J=parseInt(I.borderBottomWidth,10),U=parseInt(I.paddingBottom,10),q=le+ne+se+U+J,V=Math.min(w.offsetHeight*5,q),R=window.getComputedStyle(j),Q=parseInt(R.paddingTop,10),Ne=parseInt(R.paddingBottom,10),Pe=F.top+F.height/2-wr,ze=ee-Pe,Ve=w.offsetHeight/2,fe=w.offsetTop+Ve,De=le+ne+fe,$e=q-De;if(De<=Pe){const pe=te.length>0&&w===te[te.length-1].ref.current;m.style.bottom="0px";const je=x.clientHeight-j.offsetTop-j.offsetHeight,we=Math.max(ze,Ve+(pe?Ne:0)+je+J),Ee=De+we;m.style.height=Ee+"px"}else{const pe=te.length>0&&w===te[0].ref.current;m.style.top="0px";const we=Math.max(Pe,le+j.offsetTop+(pe?Q:0)+Ve)+$e;m.style.height=we+"px",j.scrollTop=De-Pe+j.offsetTop}m.style.margin=`${wr}px 0`,m.style.minHeight=V+"px",m.style.maxHeight=ee+"px",o?.(),requestAnimationFrame(()=>k.current=!0)}},[b,c.trigger,c.valueNode,m,x,j,w,E,c.dir,o]);ls(()=>A(),[A]);const[_,D]=p.useState();ls(()=>{x&&D(window.getComputedStyle(x).zIndex)},[x]);const O=p.useCallback(F=>{F&&S.current===!0&&(A(),C?.(),S.current=!1)},[A,C]);return e.jsx(OA,{scope:n,contentWrapper:m,shouldExpandOnScrollRef:k,onScrollButtonChange:O,children:e.jsx("div",{ref:f,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:_},children:e.jsx(Fe.div,{...i,ref:y,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});Ow.displayName=IA;var DA="SelectPopperPosition",Ff=p.forwardRef((t,s)=>{const{__scopeSelect:n,align:o="start",collisionPadding:i=wr,...c}=t,d=qd(n);return e.jsx(_h,{...d,...c,ref:s,align:o,collisionPadding:i,style:{boxSizing:"border-box",...c.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)"}})});Ff.displayName=DA;var[OA,Yh]=Vo(Pa,{}),$f="SelectViewport",Lw=p.forwardRef((t,s)=>{const{__scopeSelect:n,nonce:o,...i}=t,c=oa($f,n),d=Yh($f,n),m=nt(s,c.onViewportChange),f=p.useRef(0);return e.jsxs(e.Fragment,{children:[e.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:o}),e.jsx(Wd.Slot,{scope:n,children:e.jsx(Fe.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:m,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:be(i.onScroll,x=>{const v=x.currentTarget,{contentWrapper:y,shouldExpandOnScrollRef:b}=d;if(b?.current&&y){const k=Math.abs(f.current-v.scrollTop);if(k>0){const S=window.innerHeight-wr*2,j=parseFloat(y.style.minHeight),w=parseFloat(y.style.height),E=Math.max(j,w);if(E<S){const C=E+k,A=Math.min(S,C),_=C-A;y.style.height=A+"px",y.style.bottom==="0px"&&(v.scrollTop=_>0?_:0,y.style.justifyContent="flex-end")}}}f.current=v.scrollTop})})})]})});Lw.displayName=$f;var Fw="SelectGroup",[LA,FA]=Vo(Fw),$A=p.forwardRef((t,s)=>{const{__scopeSelect:n,...o}=t,i=cr();return e.jsx(LA,{scope:n,id:i,children:e.jsx(Fe.div,{role:"group","aria-labelledby":i,...o,ref:s})})});$A.displayName=Fw;var $w="SelectLabel",Vw=p.forwardRef((t,s)=>{const{__scopeSelect:n,...o}=t,i=FA($w,n);return e.jsx(Fe.div,{id:i.id,...o,ref:s})});Vw.displayName=$w;var dd="SelectItem",[VA,zw]=Vo(dd),Bw=p.forwardRef((t,s)=>{const{__scopeSelect:n,value:o,disabled:i=!1,textValue:c,...d}=t,m=aa(dd,n),f=oa(dd,n),x=m.value===o,[v,y]=p.useState(c??""),[b,k]=p.useState(!1),S=nt(s,C=>f.itemRefCallback?.(C,o,i)),j=cr(),w=p.useRef("touch"),E=()=>{i||(m.onValueChange(o),m.onOpenChange(!1))};if(o==="")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 e.jsx(VA,{scope:n,value:o,disabled:i,textId:j,isSelected:x,onItemTextChange:p.useCallback(C=>{y(A=>A||(C?.textContent??"").trim())},[]),children:e.jsx(Wd.ItemSlot,{scope:n,value:o,disabled:i,textValue:v,children:e.jsx(Fe.div,{role:"option","aria-labelledby":j,"data-highlighted":b?"":void 0,"aria-selected":x&&b,"data-state":x?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...d,ref:S,onFocus:be(d.onFocus,()=>k(!0)),onBlur:be(d.onBlur,()=>k(!1)),onClick:be(d.onClick,()=>{w.current!=="mouse"&&E()}),onPointerUp:be(d.onPointerUp,()=>{w.current==="mouse"&&E()}),onPointerDown:be(d.onPointerDown,C=>{w.current=C.pointerType}),onPointerMove:be(d.onPointerMove,C=>{w.current=C.pointerType,i?f.onItemLeave?.():w.current==="mouse"&&C.currentTarget.focus({preventScroll:!0})}),onPointerLeave:be(d.onPointerLeave,C=>{C.currentTarget===document.activeElement&&f.onItemLeave?.()}),onKeyDown:be(d.onKeyDown,C=>{f.searchRef?.current!==""&&C.key===" "||(CA.includes(C.key)&&E(),C.key===" "&&C.preventDefault())})})})})});Bw.displayName=dd;var Oi="SelectItemText",Uw=p.forwardRef((t,s)=>{const{__scopeSelect:n,className:o,style:i,...c}=t,d=aa(Oi,n),m=oa(Oi,n),f=zw(Oi,n),x=AA(Oi,n),[v,y]=p.useState(null),b=nt(s,E=>y(E),f.onItemTextChange,E=>m.itemTextRefCallback?.(E,f.value,f.disabled)),k=v?.textContent,S=p.useMemo(()=>e.jsx("option",{value:f.value,disabled:f.disabled,children:k},f.value),[f.disabled,f.value,k]),{onNativeOptionAdd:j,onNativeOptionRemove:w}=x;return ls(()=>(j(S),()=>w(S)),[j,w,S]),e.jsxs(e.Fragment,{children:[e.jsx(Fe.span,{id:f.textId,...c,ref:b}),f.isSelected&&d.valueNode&&!d.valueNodeHasChildren?Po.createPortal(c.children,d.valueNode):null]})});Uw.displayName=Oi;var Hw="SelectItemIndicator",Ww=p.forwardRef((t,s)=>{const{__scopeSelect:n,...o}=t;return zw(Hw,n).isSelected?e.jsx(Fe.span,{"aria-hidden":!0,...o,ref:s}):null});Ww.displayName=Hw;var Vf="SelectScrollUpButton",Kw=p.forwardRef((t,s)=>{const n=oa(Vf,t.__scopeSelect),o=Yh(Vf,t.__scopeSelect),[i,c]=p.useState(!1),d=nt(s,o.onScrollButtonChange);return ls(()=>{if(n.viewport&&n.isPositioned){let m=function(){const x=f.scrollTop>0;c(x)};const f=n.viewport;return m(),f.addEventListener("scroll",m),()=>f.removeEventListener("scroll",m)}},[n.viewport,n.isPositioned]),i?e.jsx(Zw,{...t,ref:d,onAutoScroll:()=>{const{viewport:m,selectedItem:f}=n;m&&f&&(m.scrollTop=m.scrollTop-f.offsetHeight)}}):null});Kw.displayName=Vf;var zf="SelectScrollDownButton",qw=p.forwardRef((t,s)=>{const n=oa(zf,t.__scopeSelect),o=Yh(zf,t.__scopeSelect),[i,c]=p.useState(!1),d=nt(s,o.onScrollButtonChange);return ls(()=>{if(n.viewport&&n.isPositioned){let m=function(){const x=f.scrollHeight-f.clientHeight,v=Math.ceil(f.scrollTop)<x;c(v)};const f=n.viewport;return m(),f.addEventListener("scroll",m),()=>f.removeEventListener("scroll",m)}},[n.viewport,n.isPositioned]),i?e.jsx(Zw,{...t,ref:d,onAutoScroll:()=>{const{viewport:m,selectedItem:f}=n;m&&f&&(m.scrollTop=m.scrollTop+f.offsetHeight)}}):null});qw.displayName=zf;var Zw=p.forwardRef((t,s)=>{const{__scopeSelect:n,onAutoScroll:o,...i}=t,c=oa("SelectScrollButton",n),d=p.useRef(null),m=Kd(n),f=p.useCallback(()=>{d.current!==null&&(window.clearInterval(d.current),d.current=null)},[]);return p.useEffect(()=>()=>f(),[f]),ls(()=>{m().find(v=>v.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[m]),e.jsx(Fe.div,{"aria-hidden":!0,...i,ref:s,style:{flexShrink:0,...i.style},onPointerDown:be(i.onPointerDown,()=>{d.current===null&&(d.current=window.setInterval(o,50))}),onPointerMove:be(i.onPointerMove,()=>{c.onItemLeave?.(),d.current===null&&(d.current=window.setInterval(o,50))}),onPointerLeave:be(i.onPointerLeave,()=>{f()})})}),zA="SelectSeparator",Gw=p.forwardRef((t,s)=>{const{__scopeSelect:n,...o}=t;return e.jsx(Fe.div,{"aria-hidden":!0,...o,ref:s})});Gw.displayName=zA;var Bf="SelectArrow",BA=p.forwardRef((t,s)=>{const{__scopeSelect:n,...o}=t,i=qd(n),c=aa(Bf,n),d=oa(Bf,n);return c.open&&d.position==="popper"?e.jsx(Ah,{...i,...o,ref:s}):null});BA.displayName=Bf;function Qw(t){return t===""||t===void 0}var Yw=p.forwardRef((t,s)=>{const{value:n,...o}=t,i=p.useRef(null),c=nt(s,i),d=Qh(n);return p.useEffect(()=>{const m=i.current,f=window.HTMLSelectElement.prototype,v=Object.getOwnPropertyDescriptor(f,"value").set;if(d!==n&&v){const y=new Event("change",{bubbles:!0});v.call(m,n),m.dispatchEvent(y)}},[d,n]),e.jsx(sl,{asChild:!0,children:e.jsx("select",{...o,ref:c,defaultValue:n})})});Yw.displayName="BubbleSelect";function Jw(t){const s=xs(t),n=p.useRef(""),o=p.useRef(0),i=p.useCallback(d=>{const m=n.current+d;s(m),(function f(x){n.current=x,window.clearTimeout(o.current),x!==""&&(o.current=window.setTimeout(()=>f(""),1e3))})(m)},[s]),c=p.useCallback(()=>{n.current="",window.clearTimeout(o.current)},[]);return p.useEffect(()=>()=>window.clearTimeout(o.current),[]),[n,i,c]}function Xw(t,s,n){const i=s.length>1&&Array.from(s).every(x=>x===s[0])?s[0]:s,c=n?t.indexOf(n):-1;let d=UA(t,Math.max(c,0));i.length===1&&(d=d.filter(x=>x!==n));const f=d.find(x=>x.textValue.toLowerCase().startsWith(i.toLowerCase()));return f!==n?f:void 0}function UA(t,s){return t.map((n,o)=>t[(s+o)%t.length])}var HA=Sw,e1=_w,WA=Tw,KA=Rw,qA=Pw,t1=Mw,ZA=Lw,s1=Vw,r1=Bw,GA=Uw,QA=Ww,n1=Kw,a1=qw,o1=Gw;const ur=HA,mr=WA,qs=p.forwardRef(({className:t,children:s,...n},o)=>e.jsxs(e1,{ref:o,className:re("flex h-9 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm r
57ing-offset-background data-[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",t),...n,children:[s,e.jsx(KA,{asChild:!0,children:e.jsx(Ar,{className:"h-4 w-4 opacity-50"})})]}));qs.displayName=e1.displayName;const i1=p.forwardRef(({className:t,...s},n)=>e.jsx(n1,{ref:n,className:re("flex cursor-default items-center justify-center py-1",t),...s,children:e.jsx(Wy,{className:"h-4 w-4"})}));i1.displayName=n1.displayName;const l1=p.forwardRef(({className:t,...s},n)=>e.jsx(a1,{ref:n,className:re("flex cursor-default items-center justify-center py-1",t),...s,children:e.jsx(Ar,{className:"h-4 w-4"})}));l1.displayName=a1.displayName;const Zs=p.forwardRef(({className:t,children:s,position:n="popper",...o},i)=>e.jsx(qA,{children:e.jsxs(t1,{ref:i,className:re("relative z-50 max-h-[--radix-select-content-available-height] min-w-[8rem] overflow-y-auto overflow-x-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 origin-[--radix-select-content-transform-origin]",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",t),position:n,...o,children:[e.jsx(i1,{}),e.jsx(ZA,{className:re("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:s}),e.jsx(l1,{})]})}));Zs.displayName=t1.displayName;const YA=p.forwardRef(({className:t,...s},n)=>e.jsx(s1,{ref:n,className:re("py-1.5 pl-8 pr-2 text-sm font-semibold",t),...s}));YA.displayName=s1.displayName;const ft=p.forwardRef(({className:t,children:s,...n},o)=>e.jsxs(r1,{ref:o,className:re("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...n,children:[e.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:e.jsx(QA,{children:e.jsx(rl,{className:"h-4 w-4"})})}),e.jsx(GA,{children:s})]}));ft.displayName=r1.displayName;const JA=p.forwardRef(({className:t,...s},n)=>e.jsx(o1,{ref:n,className:re("-mx-1 my-1 h-px bg-muted",t),...s}));JA.displayName=o1.displayName;const XA=[{value:"all",label:"All Chains"},{value:"ethereum",label:"Ethereum"},{value:"base",label:"Base"}],eT=[{value:"all",label:"All Trust Models"},{value:"ERC-8126",label:"ERC-8126"},{value:"SIWA",label:"SIWA"},{value:"ERC-7710",label:"ERC-7710"},{value:"ERC-8128",label:"ERC-8128"},{value:"Self ZK Identity",label:"Self ZK Identity"}],Ti=48;function tT(){const[t,s]=p.useState(""),[n,o]=p.useState("all"),[i,c]=p.useState("all"),[d,m]=p.useState(0),f=new URLSearchParams;f.set("limit",String(Ti)),f.set("offset",String(d*Ti)),n!=="all"&&f.set("chain",n),t.trim()&&f.set("search",t.trim());const{data:x,isLoading:v}=He({queryKey:["/api/agents",{page:d,chainFilter:n,searchQuery:t}],queryFn:()=>fetch(`/api/agents?${f.toString()}`).then(w=>w.json())}),y=x?.agents,b=x?.total||0,k=Math.ceil(b/Ti),{data:S}=He({queryKey:["/api/risk-scores/batch"]}),j=y?.filter(w=>!(i!=="all"&&!(w.supportedTrustModels||[]).includes(i)));return e.jsxs("div",{className:"min-h-screen",children:[e.jsx("div",{className:"border-b border-border bg-card/30",children:e.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 py-8",children:[e.jsxs("div",{className:"max-w-2xl",children:[e.jsx("h1",{className:"text-3xl font-bold text-foreground mb-2","data-testid":"text-explore-title",children:"Explore Agents"}),e.jsx("p",{className:"text-muted-foreground mb-6",children:"Discover AI agents registered on-chain via ERC-8004 with verifiable identity and risk scoring"})]}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-3",children:[e.jsxs("div",{className:"relative flex-1",children:[e.jsx(Zc,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),e.jsx(et,{placeholder:"Search agents by name or description...",value:t,onChange:w=>{s(w.target.value),m(0)},className:"pl-9","data-testid":"input-search-agents"})]}),e.jsxs(ur,{value:n,onValueChange:w=>{o(w),m(0)},children:[e.jsx(qs,{className:"w-full sm:w-40","data-testid":"select-chain-filter",children:e.jsx(mr,{})}),e.jsx(Zs,{children:XA.map(w=>e.jsx(ft,{value:w.value,children:w.label},w.value))})]}),e.jsxs(ur,{value:i,onValueChange:c,children:[e.jsx(qs,{className:"w-full sm:w-48","data-testid":"select-trust-filter",children:e.jsx(mr,{})}),e.jsx(Zs,{children:eT.map(w=>e.jsx(ft,{value:w.value,children:w.label},w.value))})]})]}),e.jsxs("div",{className:"flex items-center gap-2 mt-4",children:[e.jsxs(Y,{variant:"outline",className:"text-xs","data-testid":"badge-total-agents",children:[b.toLocaleStr
57ing()," agents indexed on-chain"]}),k>1&&e.jsxs(Y,{variant:"secondary",className:"text-xs",children:["Page ",d+1," of ",k.toLocaleString()]})]})]})}),e.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 py-8",children:v?e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:Array.from({length:6}).map((w,E)=>e.jsx(ot,{className:"h-56 rounded-xl"},E))}):j&&j.length>0?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4","data-testid":"agents-grid",children:j.map(w=>e.jsx(Gh,{agent:w,riskScore:S?.[w.id]},w.id))}),k>1&&e.jsxs("div",{className:"flex items-center justify-center gap-3 mt-8","data-testid":"pagination-controls",children:[e.jsxs(ie,{variant:"outline",size:"sm",onClick:()=>m(w=>Math.max(0,w-1)),disabled:d===0,"data-testid":"button-prev-page",children:[e.jsx(ES,{className:"h-4 w-4 mr-1"})," Previous"]}),e.jsxs("span",{className:"text-sm text-muted-foreground",children:[(d*Ti+1).toLocaleString()," â ",Math.min((d+1)*Ti,b).toLocaleString()," of ",b.toLocaleString()]}),e.jsxs(ie,{variant:"outline",size:"sm",onClick:()=>m(w=>w+1),disabled:d>=k-1,"data-testid":"button-next-page",children:["Next ",e.jsx(Cs,{className:"h-4 w-4 ml-1"})]})]})]}):e.jsxs("div",{className:"text-center py-20","data-testid":"empty-state",children:[e.jsx(Zc,{className:"h-12 w-12 text-muted-foreground/40 mx-auto mb-4"}),e.jsx("h3",{className:"text-lg font-medium text-foreground mb-1",children:"No agents found"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Try adjusting your search or filters"})]})})]})}var Jh="Tabs",[sT]=Ls(Jh,[Bd]),c1=Bd(),[rT,Xh]=sT(Jh),d1=p.forwardRef((t,s)=>{const{__scopeTabs:n,value:o,onValueChange:i,defaultValue:c,orientation:d="horizontal",dir:m,activationMode:f="automatic",...x}=t,v=ll(m),[y,b]=Sr({prop:o,onChange:i,defaultProp:c});return e.jsx(rT,{scope:n,baseId:cr(),value:y,onValueChange:b,orientation:d,dir:v,activationMode:f,children:e.jsx(Fe.div,{dir:v,"data-orientation":d,...x,ref:s})})});d1.displayName=Jh;var u1="TabsList",m1=p.forwardRef((t,s)=>{const{__scopeTabs:n,loop:o=!0,...i}=t,c=Xh(u1,n),d=c1(n);return e.jsx(Sj,{asChild:!0,...d,orientation:c.orientation,dir:c.dir,loop:o,children:e.jsx(Fe.div,{role:"tablist","aria-orientation":c.orientation,...i,ref:s})})});m1.displayName=u1;var f1="TabsTrigger",h1=p.forwardRef((t,s)=>{const{__scopeTabs:n,value:o,disabled:i=!1,...c}=t,d=Xh(f1,n),m=c1(n),f=g1(d.baseId,o),x=v1(d.baseId,o),v=o===d.value;return e.jsx(Ej,{asChild:!0,...m,focusable:!i,active:v,children:e.jsx(Fe.button,{type:"button",role:"tab","aria-selected":v,"aria-controls":x,"data-state":v?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:f,...c,ref:s,onMouseDown:be(t.onMouseDown,y=>{!i&&y.button===0&&y.ctrlKey===!1?d.onValueChange(o):y.preventDefault()}),onKeyDown:be(t.onKeyDown,y=>{[" ","Enter"].includes(y.key)&&d.onValueChange(o)}),onFocus:be(t.onFocus,()=>{const y=d.activationMode!=="manual";!v&&!i&&y&&d.onValueChange(o)})})})});h1.displayName=f1;var p1="TabsContent",x1=p.forwardRef((t,s)=>{const{__scopeTabs:n,value:o,forceMount:i,children:c,...d}=t,m=Xh(p1,n),f=g1(m.baseId,o),x=v1(m.baseId,o),v=o===m.value,y=p.useRef(v);return p.useEffect(()=>{const b=requestAnimationFrame(()=>y.current=!1);return()=>cancelAnimationFrame(b)},[]),e.jsx(Ys,{present:i||v,children:({present:b})=>e.jsx(Fe.div,{"data-state":v?"active":"inactive","data-orientation":m.orientation,role:"tabpanel","aria-labelledby":f,hidden:!b,id:x,tabIndex:0,...d,ref:s,style:{...t.style,animationDuration:y.current?"0s":void 0},children:b&&c})})});x1.displayName=p1;function g1(t,s){return`${t}-trigger-${s}`}function v1(t,s){return`${t}-content-${s}`}var nT=d1,y1=m1,b1=h1,j1=x1;const ep=nT,Zd=p.forwardRef(({className:t,...s},n)=>e.jsx(y1,{ref:n,className:re("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",t),...s}));Zd.displayName=y1.displayName;const Hs=p.forwardRef(({className:t,...s},n)=>e.jsx(b1,{ref:n,className:re("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",t),...s}));Hs.displayName=b1.displayName;const Ws=p.forwardRef(({className:t,...s},n)=>e.jsx(j1,{ref:n,className:re("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",t),...s}));Ws.displayName=j1.displayName;const Vr=p.forwardRef(({className:t,...s},n)=>e.jsx("textarea",{className:re("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",t),ref:n,...s}));Vr.displayName="Textarea";const s0=[{label:"Deposit USDC",icon:St,description:"Client deposits USDC into escrow smart contract"},{label:"x402 Execution",icon:ht,description:"Agent executes API calls, each deducting from escrow"},{label:"Evaluator Verifies",icon:Ct,description:"Evaluator reviews output and attests completion"},{label:"Balance Returned",icon:Ss,description:"Remaining escrow balance returned to client"}],r0=[{label:"Fund Gateway Wallet",icon:St,description:"Deposit USDC into your Circle Gateway Wallet (one-time gas)"},{label:"Authorize Per-Call",icon:ht,description:"Each agent call authorized via off-chain EIP-3009 signature"},{label:"Batch Settlement",icon:Ur,description:"Micro-transactions batched and settled on-chain"},{label:"Verification",icon:Ct,description:"Evaluator verifies output, settlement finalized"}];function n0(){return e.jsxs(Rh,{children:[e.jsx(Ph,{asChild:!0,children:e.jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5 rounded-md bg-amber-500/10 border border-amber-500/20","data-testid":"banner-testnet-mode",children:[e.jsx(nl,{className:"h-3.5 w-3.5 text-amber-600 dar
57k:text-amber-400 shrink-0"}),e.jsx("p",{className:"text-[11px] font-medium text-amber-600 dark:text-amber-400",children:"Testnet Mode"})]})}),e.jsx(Ld,{children:e.jsx("p",{className:"text-xs max-w-[220px]",children:"Circle Nanopayments is currently running on testnet. All USDC transactions use test tokens with no real monetary value."})})]})}function aT({status:t}){const s={pending:{className:"bg-amber-500/15 text-amber-600 dark:text-amber-400 border-amber-500/30",label:"Pending"},batched:{className:"bg-blue-500/15 text-blue-600 dark:text-blue-400 border-blue-500/30",label:"Batched"},settled:{className:"bg-emerald-500/15 text-emerald-600 dark:text-emerald-400 border-emerald-500/30",label:"Settled"},failed:{className:"bg-red-500/15 text-red-600 dark:text-red-400 border-red-500/30",label:"Failed"}},n=s[t]||s.pending;return e.jsx(Y,{className:re("text-[10px]",n.className),"data-testid":`badge-tx-status-${t}`,children:n.label})}function oT({userAddress:t}){const[s,n]=p.useState("10"),[o,i]=p.useState(null),c=Ut({mutationFn:async()=>(await dt("POST","/api/payments/circle/create-wallet",{userAddress:t})).json(),onSuccess:m=>{i(m.id||m.wallet?.id||null),ct.invalidateQueries({queryKey:["/api/payments/circle/balance"]})}}),d=Ut({mutationFn:async()=>(await dt("POST","/api/payments/circle/deposit",{walletId:o,amount:parseFloat(s)})).json(),onSuccess:()=>{ct.invalidateQueries({queryKey:["/api/payments/circle/balance"]})}});return e.jsxs("div",{className:"space-y-3","data-testid":"circle-deposit-flow",children:[e.jsx("p",{className:"text-[10px] font-medium text-muted-foreground uppercase tracking-wider",children:"Fund Gateway Wallet"}),o?e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(et,{type:"number",value:s,onChange:m=>n(m.target.value),min:"0.01",step:"0.01",className:"flex-1","data-testid":"input-deposit-amount"}),e.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:"USDC"})]}),e.jsxs(ie,{className:"w-full",onClick:()=>d.mutate(),disabled:d.isPending||!s,"data-testid":"button-deposit-usdc",children:[d.isPending?e.jsx(qc,{className:"h-3.5 w-3.5 mr-2 animate-spin"}):e.jsx(bS,{className:"h-3.5 w-3.5 mr-2"}),"Deposit ",s," USDC"]}),d.isSuccess&&e.jsxs("p",{className:"text-xs text-emerald-600 dark:text-emerald-400 flex items-center gap-1",children:[e.jsx(tt,{className:"h-3 w-3"}),"Deposit successful"]})]}):e.jsxs(ie,{variant:"outline",className:"w-full",onClick:()=>c.mutate(),disabled:c.isPending,"data-testid":"button-create-circle-wallet",children:[c.isPending?e.jsx(qc,{className:"h-3.5 w-3.5 mr-2 animate-spin"}):e.jsx(St,{className:"h-3.5 w-3.5 mr-2"}),"Create Circle Gateway Wallet"]})]})}function iT({jobId:t}){const{data:s,isLoading:n}=He({queryKey:["/api/payments/circle/transactions",t],refetchInterval:5e3});if(n)return e.jsxs("div",{className:"space-y-2","data-testid":"transaction-log-loading",children:[e.jsx("p",{className:"text-[10px] font-medium text-muted-foreground uppercase tracking-wider",children:"Transaction Log"}),[1,2,3].map(d=>e.jsx(ot,{className:"h-10 w-full"},d))]});if(!s||s.length===0)return e.jsxs("div",{"data-testid":"transaction-log-empty",children:[e.jsx("p",{className:"text-[10px] font-medium text-muted-foreground uppercase tracking-wider mb-2",children:"Transaction Log"}),e.jsxs("div",{className:"flex items-center gap-2 p-3 rounded-md bg-muted/30 border border-border/50",children:[e.jsx(Fr,{className:"h-3.5 w-3.5 text-muted-foreground"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"No transactions yet. They will appear here during job execution."})]})]});const o=s.reduce((d,m)=>d+m.amount,0),i=s.filter(d=>d.status==="settled").length,c=Array.from(new Set(s.map(d=>d.batchId).filter(Boolean)));return e.jsxs("div",{className:"space-y-2","data-testid":"transaction-log",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2 flex-wrap",children:[e.jsx("p",{className:"text-[10px] font-medium text-muted-foreground uppercase tracking-wider",children:"Transaction Log"}),e.jsxs(Y,{variant:"outline",className:"text-[10px]","data-testid":"badge-tx-count",children:[s.length," txns"]})]}),e.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[e.jsxs("div",{className:"p-2 rounded-md bg-muted/30 border border-border/50 text-center",children:[e.jsx("p",{className:"text-[10px] text-muted-foreground",children:"Total"}),e.jsx("p",{className:"text-xs font-bold tabular-nums","data-testid":"text-nanopay-total",children:o.toFixed(4)})]}),e.jsxs("div",{className:"p-2 rounded-md bg-muted/30 border border-border/50 text-center",children:[e.jsx("p",{className:"text-[10px] text-muted-foreground",children:"Settled"}),e.jsxs("p",{className:"text-xs font-bold tabular-nums","data-testid":"text-nanopay-settled",children:[i,"/",s.length]})]}),e.jsxs("div",{className:"p-2 rounded-md bg-muted/30 border border-border/50 text-center",children:[e.jsx("p",{className:"text-[10px] text-muted-foreground",children:"Batches"}),e.jsx("p",{className:"text-xs font-bold tabular-nums","data-testid":"text-nanopay-batches",children:c.length})]})]}),e.jsx("div",{className:"max-h-48 overflow-y-auto space-y-1",children:s.map(d=>e.jsxs("div",{className:"flex items-center justify-between gap-2 p-2 rounded-md bg-muted/20 border border-border/30","data-testid":`transaction-row-${d.id}`,children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx(ht,{className:"h-3 w-3 text-muted-foreground shrink-0"}),e.jsxs("div",{className:"min-w-0",children:[e.jsxs("p",{className:"text-xs font-medium tabular-nums",children:[d.amount.toFixed(4)," ",d.currency]}),d.createdAt&&e.jsx("p",{className:"text-[10px] text-muted-foreground",children:new Date(d.createdAt).toLocaleTimeString()})]})]}),e.jsx(aT,{status:d.status})]},d.id))}),c.length>0&&e.jsxs("div",{className:"flex items-center gap-2 p-2 rounded-md bg-emerald-500/10 border border-emerald-500/20",children:[e.jsx(Ur,{className:"h-3.5 w-3.5 text-emerald-600 dark:text-emerald-400 shrink-0"}),e.jsxs("p",{className:"text-[10px] text-emerald-600 dark:text-emerald-400",children:[c.length," batch",c.length>1?"es":""," settled on-chain"]})]})]})}function Vc({x402Supported:t,perCallCost:s=.001,currency:n="USDC",network:o="Base",escrowAmount:i=0,estimatedCalls:c,estimatedTotal:d,walletConnected:m=!1,compact:f=!1,circlePaymentAddress:x,jobId:v,userAddress:y}){const b=!!x,[k,S]=p.useState(b?"circle":"escrow"),j=i>0&&s>0?Math.floor(i/s):c||0,w=d||s*(c||j);return f?e.jsxs("div",{className:"space-y-3","data-testid":"payment-panel-compact",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[t?e.jsxs(Y,{className:"text-xs bg-amber-500/15 text-amber-600 dar
57k:text-amber-400 border-amber-500/30",children:[e.jsx(ht,{className:"h-3 w-3 mr-1"}),"x402 Protocol"]}):e.jsx(Y,{variant:"outline",className:"text-xs",children:"USDC Escrow"}),e.jsx(Y,{variant:"outline",className:"text-xs",children:o}),b&&e.jsxs(Y,{className:"text-xs bg-blue-500/15 text-blue-600 dark:text-blue-400 border-blue-500/30","data-testid":"badge-circle-nanopayments",children:[e.jsx(ir,{className:"h-3 w-3 mr-1"}),"Circle Nanopayments"]}),(t||b)&&e.jsxs(Y,{variant:"outline",className:"text-xs text-emerald-600 dark:text-emerald-400 border-emerald-500/30",children:[e.jsx(tt,{className:"h-3 w-3 mr-1"}),"No Gas Fees"]})]}),b&&e.jsx(n0,{}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{className:"p-2.5 rounded-md bg-muted/30 border border-border/50",children:[e.jsx("p",{className:"text-[10px] text-muted-foreground uppercase tracking-wider mb-0.5",children:"Per Call"}),e.jsxs("p",{className:"text-sm font-bold tabular-nums","data-testid":"text-per-call-cost",children:[s.toFixed(4)," ",e.jsx("span",{className:"text-xs font-normal text-muted-foreground",children:n})]})]}),e.jsxs("div",{className:"p-2.5 rounded-md bg-muted/30 border border-border/50",children:[e.jsx("p",{className:"text-[10px] text-muted-foreground uppercase tracking-wider mb-0.5",children:"Network"}),e.jsx("p",{className:"text-sm font-medium","data-testid":"text-payment-network",children:o})]})]})]}):e.jsxs("div",{className:"space-y-4","data-testid":"payment-panel",children:[b&&e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2","data-testid":"payment-mode-selector",children:[e.jsxs(ie,{variant:k==="circle"?"default":"outline",size:"sm",onClick:()=>S("circle"),"data-testid":"button-mode-circle",children:[e.jsx(ir,{className:"h-3.5 w-3.5 mr-1.5"}),"Circle Nanopayments"]}),e.jsxs(ie,{variant:k==="escrow"?"default":"outline",size:"sm",onClick:()=>S("escrow"),"data-testid":"button-mode-escrow",children:[e.jsx(Ss,{className:"h-3.5 w-3.5 mr-1.5"}),"USDC Escrow"]})]}),k==="circle"&&e.jsx(n0,{})]}),e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[k==="circle"?e.jsxs(Y,{className:"text-xs bg-blue-500/15 text-blue-600 dark:text-blue-400 border-blue-500/30","data-testid":"badge-circle-nanopayments",children:[e.jsx(ir,{className:"h-3 w-3 mr-1"}),"Circle Nanopayments"]}):t?e.jsxs(Y,{className:"text-xs bg-amber-500/15 text-amber-600 dark:text-amber-400 border-amber-500/30",children:[e.jsx(ht,{className:"h-3 w-3 mr-1"}),"x402 Payment Protocol"]}):e.jsxs(Y,{variant:"outline",className:"text-xs",children:[e.jsx(Ss,{className:"h-3 w-3 mr-1"}),"USDC Escrow"]}),e.jsx(Y,{variant:"outline",className:"text-xs",children:k==="circle"?"Circle Platform":"Coinbase CDP"}),(k==="circle"||t)&&e.jsxs(Y,{variant:"outline",className:"text-xs text-emerald-600 dark:text-emerald-400 border-emerald-500/30",children:[e.jsx(tt,{className:"h-3 w-3 mr-1"}),k==="circle"?"Zero Gas Fees":"Gasless (Sponsored)"]}),k==="circle"&&e.jsxs(Y,{variant:"outline",className:"text-xs text-blue-600 dark:text-blue-400 border-blue-500/30",children:[e.jsx(Ur,{className:"h-3 w-3 mr-1"}),"Batched Settlement"]})]}),e.jsxs("div",{className:re("grid gap-3","grid-cols-2 sm:grid-cols-4"),children:[e.jsxs("div",{className:"p-3 rounded-md bg-muted/30 border border-border/50",children:[e.jsx("p",{className:"text-[10px] text-muted-foreground uppercase tracking-wider mb-1",children:"Per Call"}),e.jsx("p",{className:"text-lg font-bold tabular-nums","data-testid":"text-per-call-cost",children:s.toFixed(4)}),e.jsx("p",{className:"text-[10px] text-muted-foreground",children:n})]}),e.jsxs("div",{className:"p-3 rounded-md bg-muted/30 border border-border/50",children:[e.jsx("p",{className:"text-[10px] text-muted-foreground uppercase tracking-wider mb-1",children:"Est. Calls"}),e.jsx("p",{className:"text-lg font-bold tabular-nums","data-testid":"text-est-calls",children:j.toLocaleString()}),e.jsx("p",{className:"text-[10px] text-muted-foreground",children:"from budget"})]}),e.jsxs("div",{className:"p-3 rounded-md bg-muted/30 border border-border/50",children:[e.jsx("p",{className:"text-[10px] text-muted-foreground uppercase tracking-wider mb-1",children:"Est. Total"}),e.jsx("p",{className:"text-lg font-bold tabular-nums","data-testid":"text-est-total",children:w.toFixed(4)}),e.jsx("p",{className:"text-[10px] text-muted-foreground",children:n})]}),e.jsxs("div",{className:"p-3 rounded-md bg-muted/30 border border-border/50",children:[e.jsx("p",{className:"text-[10px] text-muted-foreground uppercase tracking-wider mb-1",children:"Network"}),e.jsx("p",{className:"text-lg font-bold","data-testid":"text-payment-network",children:o}),e.jsx("p",{className:"text-[10px] text-muted-foreground",children:k==="circle"?"Zero gas fees":"No gas fees"})]})]}),e.jsx(is,{}
57),k==="circle"?e.jsxs(e.Fragment,{children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-[10px] font-medium text-muted-foreground uppercase tracking-wider mb-3",children:"Nanopayment Flow"}),e.jsx("div",{className:"space-y-0",children:r0.map((E,C)=>{const A=E.icon;return e.jsxs("div",{className:"flex items-start gap-3","data-testid":`nanopayment-stage-${C}`,children:[e.jsxs("div",{className:"flex flex-col items-center",children:[e.jsx("div",{className:re("w-7 h-7 rounded-full flex items-center justify-center shrink-0 border",C===0?"bg-blue-500/10 border-blue-500/30":"bg-muted/50 border-border"),children:e.jsx(A,{className:re("h-3.5 w-3.5",C===0?"text-blue-600 dark:text-blue-400":"text-muted-foreground")})}),C<r0.length-1&&e.jsx("div",{className:"w-px h-6 bg-border"})]}),e.jsxs("div",{className:"pb-4",children:[e.jsx("p",{className:"text-sm font-medium text-foreground",children:E.label}),e.jsx("p",{className:"text-[11px] text-muted-foreground",children:E.description})]})]},E.label)})})]}),e.jsx(is,{}),y&&e.jsx(oT,{userAddress:y}),v&&e.jsxs(e.Fragment,{children:[e.jsx(is,{}),e.jsx(iT,{jobId:v})]})]}):e.jsxs("div",{children:[e.jsx("p",{className:"text-[10px] font-medium text-muted-foreground uppercase tracking-wider mb-3",children:"Escrow Lifecycle"}),e.jsx("div",{className:"space-y-0",children:s0.map((E,C)=>{const A=E.icon;return e.jsxs("div",{className:"flex items-start gap-3","data-testid":`escrow-stage-${C}`,children:[e.jsxs("div",{className:"flex flex-col items-center",children:[e.jsx("div",{className:re("w-7 h-7 rounded-full flex items-center justify-center shrink-0 border",C===0?"bg-primary/10 border-primary/30":"bg-muted/50 border-border"),children:e.jsx(A,{className:re("h-3.5 w-3.5",C===0?"text-primary":"text-muted-foreground")})}),C<s0.length-1&&e.jsx("div",{className:"w-px h-6 bg-border"})]}),e.jsxs("div",{className:"pb-4",children:[e.jsx("p",{className:"text-sm font-medium text-foreground",children:E.label}),e.jsx("p",{className:"text-[11px] text-muted-foreground",children:E.description})]})]},E.label)})})]}),e.jsxs("div",{className:"flex items-center gap-2 p-3 rounded-md bg-muted/30 border border-border/50",children:[e.jsx(St,{className:"h-4 w-4 text-muted-foreground shrink-0"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-xs font-medium text-foreground",children:m?"Wallet Connected":"Wallet Not Connected"}),e.jsx("p",{className:"text-[10px] text-muted-foreground",children:m?k==="circle"?"Ready to fund Circle Gateway Wallet":"Ready to deposit USDC into escrow":k==="circle"?"Connect your wallet to use Circle Nanopayments":"Connect your wallet to deposit USDC into escrow"})]}),m?e.jsx(tt,{className:"h-4 w-4 text-emerald-500 shrink-0"}):e.jsx(ir,{className:"h-4 w-4 text-muted-foreground shrink-0"})]})]})}const a0={ethereum:"bg-blue-500/10 text-blue-600 dark:text-blue-400",base:"bg-indigo-500/10 text-indigo-600 dark:text-indigo-400"},lT={MCP:"bg-purple-500/10 text-purple-600 dark:text-purple-400 border-purple-500/20",A2A:"bg-cyan-500/10 text-cyan-600 dark:text-cyan-400 border-cyan-500/20",HTTP:"bg-blue-500/10 text-blue-600 dark:text-blue-400 border-blue-500/20",Web:"bg-emerald-500/10 text-emerald-600 dark:text-emerald-400 border-emerald-500/20",REST:"bg-orange-500/10 text-orange-600 dark:text-orange-400 border-orange-500/20"};function sn(t){return`${t.slice(0,6)}...${t.slice(-4)}`}function lo(t,s,n){return`${t==="ethereum"?"https://etherscan.io":"https://basescan.org"}/${s}/${n}`}function o0(t){if(!t)return"N/A";const s=new Date(t),o=new Date().getTime()-s.getTime(),i=Math.floor(o/6e4);if(i<1)return"Just now";if(i<60)return`${i}m ago`;const c=Math.floor(i/60);if(c<24)return`${c}h ago`;const d=Math.floor(c/24);return d<30?`${d}d ago`:s.toLocaleDateString()}function cT({score:t}){const s=t>=4?"text-emerald-600 dark:text-emerald-400 bg-emerald-500/10":t>=3?"text-amber-600 dark:text-amber-400 bg-amber-500/10":"text-red-600 dark:text-red-400 bg-red-500/10";return e.jsxs(Y,{variant:"outline",className:re("text-xs tabular-nums",s),children:[e.jsx(xo,{className:"h-3 w-3 mr-0.5 fill-current"}),t.toFixed(1)]})}function Ri({text:t,testId:s}){const n=()=>{navigator.clipboard.writeText(t)}
57;return e.jsx("button",{onClick:n,className:"text-muted-foreground hover:text-foreground transition-colors","data-testid":s,children:e.jsx(_d,{className:"h-3 w-3"})})}function dT({status:t}){const s=!t||t==="online"||t==="active";return e.jsx("span",{className:re("w-2 h-2 rounded-full shrink-0",s?"bg-emerald-500":"bg-red-500")})}function uT(){const t=X0(),s=parseInt(t.id||"0"),{session:n}=fr(),{toast:o}=Yt(),[i,c]=p.useState(!1),[d,m]=p.useState(""),[f,x]=p.useState("{}"),[v,y]=p.useState(50),[b,k]=p.useState("USDC"),[S,j]=p.useState(null),[w,E]=p.useState([]),[C,A]=p.useState(!1),{data:_,isLoading:D}=He({queryKey:["/api/agents",s],enabled:s>0}),{data:O}=He({queryKey:["/api/risk-scores",s],enabled:s>0}),{data:F}=He({queryKey:["/api/feedback",s],enabled:s>0}),{data:P}=He({queryKey:["/api/feedback/ratings",s],enabled:s>0}),{data:Z}=He({queryKey:["/api/payments/estimate",s],queryFn:()=>fetch("/api/payments/estimate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({agentId:s})}).then(V=>V.json()),enabled:s>0}),{data:z}=He({queryKey:["/api/connected-services"],enabled:n.authenticated}),te=z?.filter(V=>V.status==="active")||[],ee=Ut({mutationFn:async()=>{let V={};try{V=JSON.parse(f)}catch{V={}}return(await dt("POST","/api/jobs/instant",{agentId:s,taskDescription:d,taskPayload:V,selectedTools:[],escrowAmount:v,paymentMethod:b})).json()},onSuccess:V=>{j(V),ct.invalidateQueries({queryKey:["/api/jobs"]}),o({title:"Job Created",description:"Instant execution started."}),se(V.id)},onError:V=>{o({title:"Error",description:V.message,variant:"destructive"})}});async function se(V){for(let R=0;R<15;R++){await new Promise(Q=>setTimeout(Q,1e3));try{const Q=await fetch(`/api/jobs/${V}`,{credentials:"include"});if(!Q.ok)continue;const Ne=await Q.json();if(j(Ne),Ne.stepResults&&E(Ne.stepResults),Ne.status==="submitted"||Ne.status==="completed")break}catch{}}}if(D)return e.jsxs("div",{className:"max-w-5xl mx-auto px-4 sm:px-6 py-8 space-y-6",children:[e.jsx(ot,{className:"h-8 w-32"}),e.jsx(ot,{className:"h-48 rounded-xl"}),e.jsx(ot,{className:"h-96 rounded-xl"})]});if(!_)return e.jsxs("div",{className:"max-w-5xl mx-auto px-4 sm:px-6 py-20 text-center",children:[e.jsx(Ct,{className:"h-12 w-12 text-muted-foreground/40 mx-auto mb-4"}),e.jsx("h2",{className:"text-xl font-semibold mb-2",children:"Agent Not Found"}),e.jsx("p",{className:"text-muted-foreground mb-4",children:"This agent doesn't exist or has been deregistered"}),e.jsx(kt,{href:"/explore",children:e.jsxs(ie,{variant:"outline",className:"gap-2","data-testid":"button-back-explore",children:[e.jsx(yv,{className:"h-4 w-4"})," Back to Explore"]})})]});const I=_.supportedTrustModels||[],le=_.services||[],ne=_.serviceEndpoints||[],J=_.feedbackCount||F?.length||0,U=_.avgScore||0,q=_.executionMode==="always_on";return e.jsxs("div",{className:"min-h-screen",children:[e.jsx("div",{className:"border-b border-border bg-card/30",children:e.jsxs("div",{className:"max-w-5xl mx-auto px-4 sm:px-6 py-6",children:[e.jsx(kt,{href:"/explore",children:e.jsxs(ie,{variant:"ghost",size:"sm",className:"gap-1.5 mb-4 -ml-2 text-muted-foreground","data-testid":"button-back",children:[e.jsx(yv,{className:"h-4 w-4"})," Explore"]})}),e.jsxs("div",{className:"flex items-start gap-5",children:[e.jsx("div",{className:"shrink-0 w-20 h-20 rounded-2xl overflow-hidden bg-muted shadow-sm",children:e.jsx("img",{src:_.imageUrl||"/images/agent-dataforge.svg",alt:_.name,className:"w-full h-full object-cover","data-testid":"img-agent-profile"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2.5 mb-1.5",children:[e.jsx("h1",{className:"text-2xl font-bold text-foreground","data-testid":"text-agent-profile-name",children:_.name}),_.active&&e.jsx("span",{className:"w-2 h-2 rounded-full bg-emerald-500 shrink-0"})]}),e.jsxs("div",{className:"flex items-center gap-2 mb-3 flex-wrap",children:[e.jsx(Y,{variant:"secondary",className:re("text-xs",a0[_.chain]),"data-testid":"badge-agent-chain",children:_.chain==="ethereum"?"Ethereum":"Base"}),e.jsxs(Y,{variant:"outline",className:"text-xs font-mono","data-testid":"badge-token-id",children:["Token #",_.tokenId]}),e.jsxs(Y,{variant:"secondary",className:re("text-xs",q?"bg-emerald-500/10 text-emerald-600 dark:text-emerald-400":"bg-muted text-muted-foreground"),"data-testid":"badge-execution-mode",children:[q?e.jsx(ht,{className:"h-3 w-3 mr-1"}):e.jsx(Fr,{className:"h-3 w-3 mr-1"}),q?"Always-On":"Manual"]}),_.x402Supported&&e.jsxs(Y,{className:"text-xs bg-amber-500/15 text-amber-600 dar
57k:text-amber-400 border-amber-500/30","data-testid":"badge-x402",children:[e.jsx(Ct,{className:"h-3 w-3 mr-1"}),"x402 Payment Protocol"]}),_.circlePaymentAddress&&e.jsxs(Y,{className:"text-xs bg-teal-500/15 text-teal-600 dark:text-teal-400 border-teal-500/30","data-testid":"badge-circle-nanopayments",children:[e.jsx(St,{className:"h-3 w-3 mr-1"}),"Circle Nanopayments"]})]}),e.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed max-w-2xl","data-testid":"text-agent-profile-desc",children:_.description}),e.jsx("div",{className:"flex items-center gap-2 mt-4 flex-wrap",children:q?e.jsxs(ie,{className:"gap-2",onClick:()=>c(!i),"data-testid":"button-hire-now",children:[e.jsx(ht,{className:"h-4 w-4"}),i?"Close":"Hire Now"]}):e.jsx(kt,{href:`/hire?agentId=${_.id}&chain=${_.chain}`,children:e.jsxs(ie,{className:"gap-2","data-testid":"button-hire-agent",children:[e.jsx(_a,{className:"h-4 w-4"}),"Hire this Agent"]})})})]})]}),e.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3 mt-6",children:[e.jsx(ue,{className:"border-card-border",children:e.jsxs(me,{className:"p-3 flex items-center gap-3",children:[e.jsx(xo,{className:"h-4 w-4 text-amber-500"}),e.jsxs("div",{children:[e.jsxs("p",{className:"text-lg font-bold tabular-nums","data-testid":"stat-avg-score",children:[U.toFixed(1),e.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"/5.0"})]}),e.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Avg Score"})]})]})}),e.jsx(ue,{className:"border-card-border",children:e.jsxs(me,{className:"p-3 flex items-center gap-3",children:[e.jsx(ho,{className:"h-4 w-4 text-blue-500"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-lg font-bold tabular-nums","data-testid":"stat-feedback-count",children:J.toLocaleString()}),e.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Feedback"})]})]})}),e.jsx(ue,{className:"border-card-border",children:e.jsxs(me,{className:"p-3 flex items-center gap-3",children:[e.jsx(Hi,{className:"h-4 w-4 text-purple-500"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-lg font-bold tabular-nums","data-testid":"stat-services",children:ne.length||le.length}),e.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Services"})]})]})}),e.jsx(ue,{className:"border-card-border",children:e.jsxs(me,{className:"p-3 flex items-center gap-3",children:[e.jsx(Ct,{className:"h-4 w-4 text-emerald-500"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-lg font-bold tabular-nums","data-testid":"stat-trust-models",children:I.length}),e.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Trust Models"})]})]})})]})]})}),_.circlePaymentAddress&&e.jsx("div",{className:"max-w-5xl mx-auto px-4 sm:px-6 pt-6",children:e.jsxs(ue,{className:"border-card-border","data-testid":"panel-circle-nanopayments",children:[e.jsx(Vt,{className:"pb-3",children:e.jsxs(zt,{className:"text-base flex items-center gap-2",children:[e.jsx(St,{className:"h-4 w-4 text-teal-500"}),"Circle Nanopayments"]})}),e.jsxs(me,{children:[e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-xs text-muted-foreground",children:"Per-Call Pricing"}),e.jsxs("p",{className:"text-lg font-bold tabular-nums text-foreground","data-testid":"text-per-call-cost",children:[Z?.perCallCost!=null?`$${Z.perCallCost.toFixed(4)}`:"$0.001"," ",e.jsx("span",{className:"text-xs font-normal text-muted-foreground",children:"per call"})]})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-xs text-muted-foreground",children:"Gas Fees"}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(tt,{className:"h-4 w-4 text-emerald-500"}),e.jsx("p",{className:"text-sm font-medium text-foreground","data-testid":"text-zero-gas",children:"Zero Gas Fees"})]}),e.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Off-chain micropayments via Circle"})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-xs text-muted-foreground",children:"Settlement"}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(Bi,{className:"h-4 w-4 text-blue-500"}),e.jsx("p",{className:"text-sm font-medium text-foreground","data-testid":"text-batched-settlement",children:"Batched Settlement"})]}),e.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Transactions batched for efficiency"})]})]}),e.jsxs("div",{className:"flex items-center gap-2 mt-4 pt-3 border-t border-border/50 flex-wrap",children:[e.jsx("span",{className:"text-xs text-muted-foreground",children:"Payment Address:"}),e.jsx("code",{className:"text-xs font-mono text-foreground","data-testid":"text-circle-address",children:sn(_.circlePaymentAddress)}),e.jsx(Ri,{text:_.circlePaymentAddress,testId:"button-copy-circle-address"}),e.jsx(Y,{variant:"outline",className:"text-[10px] ml-auto","data-testid":"badge-usdc-currency",children:"USDC"})]})]})]})}),i&&q&&e.jsx("div",{className:"max-w-5xl mx-auto px-4 sm:px-6 py-6",children:e.jsxs(ue,{className:"border-card-border","data-testid":"panel-instant-hire",children:[e.jsx(Vt,{className:"pb-3",children:e.jsxs(zt,{className:"text-base flex items-center gap-2",children:[e.jsx(ht,{className:"h-4 w-4 text-amber-500"}),"Instant Hire â ",_.name]})}),e.jsx(me,{className:"space-y-4",children:S?e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-sm font-medium text-foreground",children:"Execution Progress"}),e.jsx("div",{className:"space-y-1.5",children:w.length>0?w.map((V,R)=>e.jsxs("div",{className:"flex items-center gap-2 text-sm","data-testid":`step-result-${R}`,children:[V.status==="completed"?e.jsx(tt,{className:"h-4 w-4 text-emerald-500 shrink-0"}):V.status==="running"?e.jsx(Ge,{className:"h-4 w-4 text-blue-500 animate-spin shrink-0"}):V.status==="failed"?e.jsx(Pt,{className:"h-4 w-4 text-red-500 shrink-0"}):e.jsx(Fr,{className:"h-4 w-4 text-muted-foreground shrink-0"}),e.jsx("span",{className:re(V.status==="completed"?"text-foreground":V.status==="running"?"text-blue-600 dar
57k:text-blue-400":"text-muted-foreground"),children:V.stepName}),V.output&&e.jsx("span",{className:"text-xs text-muted-foreground ml-auto truncate max-w-[200px]",children:V.output})]},R)):e.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[e.jsx(Ge,{className:"h-4 w-4 animate-spin"}),"Starting execution..."]})})]}),(S.status==="submitted"||S.status==="completed")&&e.jsxs(e.Fragment,{children:[e.jsx(is,{}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{className:"text-sm font-medium text-foreground",children:"Result"}),e.jsx(ue,{className:"border-card-border",children:e.jsxs(me,{className:"p-4 space-y-2",children:[S.deliverable&&e.jsx("p",{className:"text-sm text-foreground","data-testid":"text-deliverable",children:S.deliverable}),S.deliverableMetadata&&e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx(Y,{variant:"secondary",className:"text-xs","data-testid":"badge-deliverable-tool",children:S.deliverableMetadata.tool}),e.jsx("span",{className:"text-xs text-muted-foreground",children:S.deliverableMetadata.action}),S.deliverableMetadata.recordId&&e.jsx(Y,{variant:"outline",className:"text-xs font-mono","data-testid":"badge-record-id",children:S.deliverableMetadata.recordId})]}),S.deliverableMetadata.details&&e.jsx("pre",{className:"text-xs text-muted-foreground bg-muted/50 p-2 rounded-md overflow-auto max-h-[150px]","data-testid":"text-deliverable-details",children:JSON.stringify(S.deliverableMetadata.details,null,2)})]})]})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("button",{className:"flex items-center gap-1 text-sm font-medium text-foreground",onClick:()=>A(!C),"data-testid":"button-toggle-onchain",children:[C?e.jsx(Wy,{className:"h-4 w-4"}):e.jsx(Ar,{className:"h-4 w-4"}),"On-Chain Record"]}),C&&e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3 p-3 rounded-md bg-muted/30 border border-border/50",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-[10px] text-muted-foreground uppercase tracking-wider",children:"Task Hash"}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("code",{className:"text-xs font-mono text-foreground truncate","data-testid":"text-task-hash",children:S.taskHash||"N/A"}),S.taskHash&&e.jsx(Ri,{text:S.taskHash,testId:"button-copy-task-hash"})]})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-[10px] text-muted-foreground uppercase tracking-wider",children:"Deliverable Hash"}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("code",{className:"text-xs font-mono text-foreground truncate","data-testid":"text-deliverable-hash",children:S.deliverableHash||"Pending..."}),S.deliverableHash&&e.jsx(Ri,{text:S.deliverableHash,testId:"button-copy-deliverable-hash"})]})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-[10px] text-muted-foreground uppercase tracking-wider",children:"Escrow"}),e.jsxs("p",{className:"text-xs font-mono text-foreground","data-testid":"text-escrow-amount",children:[S.escrowAmount," ",S.escrowToken]})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-[10px] text-muted-foreground uppercase tracking-wider",children:"Status"}),e.jsx(Y,{variant:"secondary",className:"text-xs","data-testid":"badge-job-status",children:S.status})]})]})]})]}),e.jsxs("div",{className:"flex items-center justify-end gap-2 pt-2",children:[e.jsx(ie,{variant:"outline",onClick:()=>{j(null),E([]),A(!1),m(""),x("{}")},"data-testid":"button-new-execution",children:"New Execution"}),e.jsx(kt,{href:"/jobs",children:e.jsx(ie,{variant:"outline",className:"gap-1","data-testid":"button-view-jobs",children:"View All Jobs"})})]})]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:"Task Description"}),e.jsx(Vr,{placeholder:"Describe what you want this agent to do...",className:"resize-none min-h-[80px]",value:d,onChange:V=>m(V.target.value),"data-testid":"input-instant-task"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:"Task Payload (JSON)"}),e.jsx(Vr,{placeholder:'{"customer": "Acme Corp", "amount": 1500}',className:"resize-none min-h-[80px] font-mono text-xs",value:f,onChange:V=>x(V.target.value),"data-testid":"input-instant-payload"}),e.jsx("p",{className:"text-[10px] text-muted-foreground",children:"Structured input data for the agent (e.g. invoice items, query params)"})]}),te.length>0&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:"Vault Services"}),e.jsx("div",{className:"flex gap-2 flex-wrap",children:te.map(V=>e.jsxs(Y,{variant:"secondary",className:"text-xs","data-testid":`badge-vault-svc-${V.id}`,children:[e.jsx(tt,{className:"h-3 w-3 mr-1 text-emerald-500"}),V.serviceName]},V.id))}),e.jsx("p",{className:"text-[10px] text-muted-foreground",children:"These services will be shared with the agent"})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:"Escrow Amount (USDC)"}
57),e.jsx(et,{type:"number",value:v,onChange:V=>y(parseFloat(V.target.value)||0),"data-testid":"input-instant-escrow"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:"Payment Method"}),e.jsxs(ur,{value:b,onValueChange:k,children:[e.jsx(qs,{"data-testid":"select-instant-payment",children:e.jsx(mr,{})}),e.jsxs(Zs,{children:[e.jsx(ft,{value:"USDC",children:"USDC Escrow"}),e.jsx(ft,{value:"x402",children:"x402 Protocol"}),e.jsx(ft,{value:"Stripe",children:"Stripe"})]})]})]})]}),e.jsxs("div",{className:"flex items-center justify-end gap-2 pt-2",children:[e.jsx(ie,{variant:"outline",onClick:()=>c(!1),"data-testid":"button-cancel-instant",children:"Cancel"}),e.jsxs(ie,{className:"gap-2",disabled:!d||d.length<10||ee.isPending||!n.authenticated,onClick:()=>ee.mutate(),"data-testid":"button-execute-now",children:[ee.isPending?e.jsx(Ge,{className:"h-4 w-4 animate-spin"}):e.jsx(_a,{className:"h-4 w-4"}),"Execute Now"]})]}),!n.authenticated&&e.jsx("p",{className:"text-xs text-muted-foreground text-center",children:"Connect your wallet to execute instant jobs"})]})})]})}),e.jsx("div",{className:"max-w-5xl mx-auto px-4 sm:px-6 py-8",children:e.jsxs(ep,{defaultValue:"overview",className:"w-full",children:[e.jsxs(Zd,{className:"w-full justify-start","data-testid":"tabs-agent-profile",children:[e.jsxs(Hs,{value:"overview",className:"gap-1.5","data-testid":"tab-overview",children:[e.jsx(an,{className:"h-3.5 w-3.5"}),"Overview"]}),e.jsxs(Hs,{value:"statistics",className:"gap-1.5","data-testid":"tab-statistics",children:[e.jsx(bv,{className:"h-3.5 w-3.5"}),"Statistics"]}),e.jsxs(Hs,{value:"feedback",className:"gap-1.5","data-testid":"tab-feedback",children:[e.jsx(ho,{className:"h-3.5 w-3.5"}),"Feedback"]}),e.jsxs(Hs,{value:"metadata",className:"gap-1.5","data-testid":"tab-metadata",children:[e.jsx(Qn,{className:"h-3.5 w-3.5"}),"Metadata"]}),_.chain==="base"&&e.jsxs(Hs,{value:"payments",className:"gap-1.5","data-testid":"tab-payments",children:[e.jsx(qn,{
57className:"h-3.5 w-3.5"}),"Payments"]})]}),e.jsx(Ws,{value:"overview",className:"mt-4 space-y-6","data-testid":"tab-content-overview",children:e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[e.jsxs("div",{className:"lg:col-span-2 space-y-6",children:[e.jsxs(ue,{className:"border-card-border",children:[e.jsx(Vt,{className:"pb-3",children:e.jsxs("div",{className:"flex items-center justify-between gap-2 flex-wrap",children:[e.jsxs(zt,{className:"text-base flex items-center gap-2",children:[e.jsx(Hi,{className:"h-4 w-4 text-muted-foreground"}),"Service Endpoints"]}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:[ne.length," endpoint",ne.length!==1?"s":""]})]})}),e.jsx(me,{children:ne.length>0?e.jsx("div",{className:"space-y-2",children:ne.map((V,R)=>e.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg bg-muted/30 border border-border/50","data-testid":`endpoint-${R}`,children:[e.jsx(dT,{}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx("span",{className:"text-sm font-medium text-foreground",children:V.name}),e.jsx(Y,{variant:"outline",className:re("text-[10px]",lT[V.type]||"bg-muted"),children:V.type})]}),e.jsx("p",{className:"text-xs text-muted-foreground font-mono mt-0.5 truncate",children:V.endpoint})]}),e.jsx("a",{href:V.endpoint,target:"_blank",rel:"noopener noreferrer",className:"text-muted-foreground hover:text-foreground transition-colors shrink-0","data-testid":`link-endpoint-${R}`,children:e.jsx(wt,{className:"h-3.5 w-3.5"})})]},R))}):le.length>0?e.jsx("div",{className:"flex gap-1.5 flex-wrap",children:le.map(V=>e.jsx(Y,{variant:"secondary",className:"text-xs uppercase",children:V},V))}):e.jsx("p",{className:"text-sm text-muted-foreground text-center py-6",children:"No service endpoints registered"})})]}),_.description&&e.jsxs(ue,{className:"border-card-border",children:[e.jsx(Vt,{className:"pb-3",children:e.jsxs(zt,{className:"text-base flex items-center gap-2",children:[e.jsx(Kc,{className:"h-4 w-4 text-muted-foreground"}),"About"]})}),e.jsx(me,{children:e.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed","data-testid":"text-agent-about",children:_.description})})]}),I.length>0&&e.jsxs(ue,{className:"border-card-border",children:[e.jsx(Vt,{className:"pb-3",children:e.jsxs(zt,{className:"text-base flex items-center gap-2",children:[e.jsx(Ct,{className:"h-4 w-4 text-muted-foreground"}),"Trust Models"]})}),e.jsx(me,{children:e.jsx("div",{className:"space-y-2",children:I.map(V=>e.jsxs("div",{className:"flex items-center justify-between p-2.5 rounded-lg bg-muted/30",children:[e.jsx(Y,{variant:"secondary",className:re("text-xs",V==="ERC-8126"&&"bg-emerald-500/10 text-emerald-600 dark:text-emerald-400"),children:V}),e.jsx(tt,{className:"h-4 w-4 text-emerald-500"})]},V))})})]}),_.x402Supported&&Z&&e.jsxs(ue,{className:"border-card-border","data-testid":"card-x402-pricing",children:[e.jsx(Vt,{className:"pb-3",children:e.jsxs(zt,{className:"text-base flex items-center gap-2",children:[e.jsx(ht,{className:"h-4 w-4 text-amber-500"}),"x402 Pricing"]})}),e.jsx(me,{children:e.jsx(Vc,{x402Supported:Z.x402Supported,perCallCost:Z.perCallCost,currency:Z.currency,network:Z.network,estimatedCalls:Z.estimatedCalls,estimatedTotal:Z.estimatedTotal,compact:!0})})]})]}),e.jsxs("div",{className:"space-y-4",children:[O&&O.overallScore!==null&&e.jsxs(ue,{className:"border-card-border",children:[e.jsx(Vt,{className:"pb-3",children:e.jsx(zt,{className:"text-base",children:"Risk Score"})}),e.jsxs(me,{className:"flex flex-col items-center gap-3",children:[e.jsx("div",{className:"text-4xl font-bold tabular-nums","data-testid":"text-risk-overall",style:{color:O.overallScore>=80?"#10b981":O.overallScore>=60?"#f59e0b":O.overallScore>=40?"#f97316":"#ef4444"},children:O.overallScore}),e.jsx("p",{className:"text-xs text-muted-foreground",children:O.overallScore>=80?"Low Risk":O.overallScore>=60?"Moderate":O.overallScore>=40?"Elevated":"High Risk"}),e.jsx(is,{}),e.jsx("div",{className:"w-full space-y-2",children:[{label:"ETV",score:O.etvScore,verified:O.etvVerified},{label:"SCV",score:O.scvScore,verified:O.scvVerified},{label:"WAV",score:O.wavScore,verified:O.wavVerified},{label:"WV",score:O.wvScore,verified:O.wvVerified}].map(({label:V,score:R,verified:Q})=>e.jsxs("div",{className:"flex items-center justify-between text-xs",children:[e.jsx("span",{className:"text-muted-foreground",children:V}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"font-medium tabular-nums",children:R??"â"}),Q?e.jsx(tt,{className:"h-3 w-3 text-emerald-500"}):e.jsx(Pt,{className:"h-3 w-3 text-muted-foreground"})]})]},V))})]})]}),e.jsxs(ue,{className:"border-card-border",children:[e.jsx(Vt,{className:"pb-3",children:e.jsx(zt,{className:"text-base",children:"Qu
57ick Info"})}),e.jsxs(me,{className:"space-y-3",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-[11px] text-muted-foreground uppercase tracking-wider",children:"Owner"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("code",{className:"text-xs font-mono text-foreground","data-testid":"text-owner-address",children:_.ownerAddress?sn(_.ownerAddress):"Unknown"}),_.ownerAddress&&e.jsx(Ri,{text:_.ownerAddress,testId:"button-copy-owner"})]})]}),e.jsx(is,{}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-[11px] text-muted-foreground uppercase tracking-wider",children:"Chain"}),e.jsx("p",{className:"text-xs text-foreground capitalize","data-testid":"text-chain",children:_.chain})]}),e.jsx(is,{}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-[11px] text-muted-foreground uppercase tracking-wider",children:"Token ID"}),e.jsxs("p",{className:"text-xs font-mono text-foreground","data-testid":"text-token-id",children:["#",_.tokenId]})]})]})]})]})]})}),e.jsxs(Ws,{value:"statistics",className:"mt-4 space-y-6","data-testid":"tab-content-statistics",children:[e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[e.jsx(ue,{className:"border-card-border",children:e.jsxs(me,{className:"p-6 text-center",children:[e.jsx(xo,{className:"h-6 w-6 text-amber-500 mx-auto mb-2"}),e.jsxs("p",{className:"text-3xl font-bold tabular-nums","data-testid":"stat-avg-score-detail",children:[U.toFixed(1),e.jsx("span",{className:"text-sm text-muted-foreground font-normal",children:"/5.0"})]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Average Score"})]})}),e.jsx(ue,{className:"border-card-border",children:e.jsxs(me,{className:"p-6 text-center",children:[e.jsx(bv,{className:"h-6 w-6 text-blue-500 mx-auto mb-2"}),e.jsxs("p",{className:"text-3xl font-bold tabular-nums","data-testid":"stat-score-100",children:[Math.round(U*20),e.jsx("span",{className:"text-sm text-muted-foreground font-normal",children:"/100"})]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Overall Score"})]})}),e.jsx(ue,{className:"border-card-border",children:e.jsxs(me,{className:"p-6 text-center",children:[e.jsx(ho,{className:"h-6 w-6 text-emerald-500 mx-auto mb-2"}),e.jsx("p",{className:"text-3xl font-bold tabular-nums","data-testid":"stat-total-feedback",children:J.toLocaleString()}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Total Feedback"})]})})]}),P&&P.length>0&&e.jsxs(ue,{className:"border-card-border",children:[e.jsx(Vt,{className:"pb-3",children:e.jsx(zt,{className:"text-base",children:"Per-Tool Ratings"})}),e.jsx(me,{className:"space-y-3",children:P.map(V=>e.jsxs("div",{className:"flex items-center gap-3","data-testid":`tool-rating-${V.tool.replace(/\s/g,"-").toLowerCase()}`,children:[e.jsx("span",{className:"text-sm text-foreground w-28 shrink-0 truncate",children:V.tool}),e.jsx("div",{className:"flex-1 h-2 bg-muted rounded-full overflow-hidden",children:e.jsx("div",{className:"h-full rounded-full bg-amber-500 transition-all duration-700",style:{width:`${V.avgRating/5*100}%`}})}),e.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[e.jsx(xo,{className:"h-3 w-3 text-amber-500 fill-amber-500"}),e.jsx("span",{className:"text-sm font-medium tabular-nums",children:V.avgRating.toFixed(1)}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:["(",V.count,")"]})]})]},V.tool))})]}),O&&O.overallScore!==null&&e.jsxs(ue,{className:"border-card-border",children:[e.jsx(Vt,{className:"pb-3",children:e.jsx(zt,{className:"text-base",children:"ERC-8126 Risk Breakdown"})}),e.jsx(me,{children:e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[{label:"ETV",full:"Ethereum Token Verification",score:O.etvScore,verified:O.etvVerified},{label:"SCV",full:"Staking Contract Verification",score:O.scvScore,verified:O.scvVerified},{label:"WAV",full:"Web Application Verification",score:O.wavScore,verified:O.wavVerified},{label:"WV",full:"Wallet Verification",score:O.wvScore,verified:O.wvVerified}].map(({label:V,full:R,score:Q,verified:Ne})=>e.jsxs("div",{className:"text-center p-3 rounded-lg bg-muted/30 border border-border/50","data-testid":`stat-risk-${V.toLowerCase()}`,children:[e.jsx("p",{className:"text-xs text-muted-foreground mb-1",children:V}),e.jsx("p",{className:"text-2xl font-bold tabular-nums",children:Q??"â"}),e.jsx("p",{className:"text-[10px] text-muted-foreground mt-0.5",children:R}),e.jsxs("div",{className:"flex items-center justify-center gap-1 mt-1.5",children:[Ne?e.jsx(tt,{className:"h-3 w-3 text-emerald-500"}):e.jsx(Pt,{className:"h-3 w-3 text-muted-foreground"}),e.jsx("span",{className:"text-[10px]",children:Ne?"Verified":"Unverified"})]})]},V))})})]})]}),e.jsx(Ws,{value:"feedback",className:"mt-4 space-y-4","data-testid":"tab-content-feedback",children:F&&F.length>0?e.jsxs(ue,{className:"border-card-border",children:[e.jsx(Vt,{className:"pb-3",children:e.jsxs("div",{className:"flex items-center justify-between gap-2 flex-wrap",children:[e.jsx(zt,{className:"text-base",children:"Feedback Entries"}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:[F.length," total"]})]})}),e.jsx(me,{className:"space-y-2",children:F.map(V=>e.jsxs("div",{className:"flex items-start gap-3 p-3 rounded-lg bg-muted/30 border border-border/50","data-testid":`feedback-entry-${V.id}`,children:[e.jsx(cT,{score:V.rating}),e.jsxs("div",{className:"flex-1 min-w-0",children:[V.comment&&e.jsx("p",{className:"text-sm text-foreground mb-1.5",children:V.comment}),e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx(Y,{variant:"outline",className:"text-[10px]",children:V.tool}),V.buyerAddress&&e.jsx("span",{className:"text-[10px] text-muted-foreground font-mono","data-testid":`text-reviewer-${V.id}`,children:sn(V.buyerAddress)}),V.createdAt&&e.jsxs("span",{className:"text-[10px] text-muted-foreground flex items-center gap-0.5",children:[e.jsx(Fr,{className:"h-2.5 w-2.5"}),o0(V.createdAt)]})]})]}),V.txHash&&e.jsx("a",{href:lo(_.chain,"tx",V.txHash),target:"_blank",rel:"noopener noreferrer",className:"shrink-0","data-testid":`link-feedback-tx-${V.id}`,children:e.jsx(ie,{variant:"ghost",size:"icon",className:"h-8 w-8",children:e.jsx(wt,{className:"h-3.5 w-3.5"})})})]},V.id))})]}):e.jsx(ue,{className:"border-card-border",children:e.jsxs(me,{className:"pt-6 text-center py-12",children:[e.jsx(ho,{className:"h-10 w-10 text-muted-foreground
57/30 mx-auto mb-3"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"No feedback entries yet"})]})})}),e.jsxs(Ws,{value:"metadata",className:"mt-4 space-y-6","data-testid":"tab-content-metadata",children:[e.jsxs(ue,{className:"border-card-border",children:[e.jsx(Vt,{className:"pb-3",children:e.jsxs(zt,{className:"text-base flex items-center gap-2",children:[e.jsx(nn,{className:"h-4 w-4 text-muted-foreground"}),"Basic Information"]})}),e.jsx(me,{children:e.jsx("div",{className:"space-y-4",children:e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-[11px] text-muted-foreground uppercase tracking-wider",children:"Agent ID"}),e.jsxs("p",{className:"text-sm font-mono text-foreground","data-testid":"meta-agent-id",children:["#",_.tokenId]})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-[11px] text-muted-foreground uppercase tracking-wider",children:"Chain"}),e.jsx("div",{className:"flex items-center gap-2",children:e.jsx(Y,{variant:"secondary",className:re("text-xs",a0[_.chain]),children:_.chain==="ethereum"?"Ethereum":"Base"})})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-[11px] text-muted-foreground uppercase tracking-wider",children:"Owner"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("code",{className:"text-xs font-mono text-foreground","data-testid":"meta-owner",children:_.ownerAddress||"Unknown"}),_.ownerAddress&&e.jsx("a",{href:lo(_.chain,"address",_.ownerAddress),target:"_blank",rel:"noopener noreferrer",className:"text-muted-foreground hover:text-foreground transition-colors","data-testid":"link-owner-explorer",children:e.jsx(wt,{className:"h-3 w-3"})})]})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-[11px] text-muted-foreground uppercase tracking-wider",children:"Creator"}),e.jsx("code",{className:"text-xs font-mono text-foreground","data-testid":"meta-creator",children:_.ownerAddress?sn(_.ownerAddress):"Unknown"})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-[11px] text-muted-foreground uppercase tracking-wider",children:"Created TX"}),e.jsx("div",{className:"flex items-center gap-2",children:_.createdTxHash?e.jsxs(e.Fragment,{children:[e.jsx("code",{className:"text-xs font-mono text-foreground truncate","data-testid":"meta-created-tx",children:sn(_.createdTxHash)}),e.jsx("a",{href:lo(_.chain,"tx",_.createdTxHash),target:"_blank",rel:"noopener noreferrer",className:"text-muted-foreground hover:text-foreground transition-colors","data-testid":"link-created-tx",children:e.jsx(wt,{className:"h-3 w-3"})})]}):e.jsx("span",{className:"text-xs text-muted-foreground",children:"N/A"})})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-[11px] text-muted-foreground uppercase tracking-wider",children:"Registry Address"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("code",{className:"text-xs font-mono text-foreground truncate","data-testid":"meta-registry",children:_.registryAddress?sn(_.registryAddress):"N/A"}),_.registryAddress&&e.jsx("a",{href:lo(_.chain,"address",_.registryAddress),target:"_blank",rel:"noopener noreferrer",className:"text-muted-foreground hover:text-foreground transition-colors","data-testid":"link-registry-explorer",children:e.jsx(wt,{className:"h-3 w-3"})})]})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-[11px] text-muted-foreground uppercase tracking-wider",children:"Agent Wallet"}),e.jsx("div",{className:"flex items-center gap-2",children:_.agentWallet?e.jsxs(e.Fragment,{children:[e.jsx("code",{className:"text-xs font-mono text-foreground","data-testid":"meta-wallet",children:sn(_.agentWallet)}),e.jsx(Ri,{text:_.agentWallet,testId:"button-copy-wallet"}),e.jsx("a",{href:lo(_.chain,"address",_.agentWallet),target:"_blank",rel:"noopener noreferrer",className:"text-muted-foreground hover:text-foreground transition-colors","data-testid":"link-wallet-explorer",children:e.jsx(wt,{className:"h-3 w-3"})})]}):e.jsx("span",{className:"text-xs text-muted-foreground",children:"N/A"})})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-[11px] text-muted-foreground uppercase tracking-wider",children:"x402 Support"}),e.jsx("div",{"data-testid":"meta-x402",children:_.x402Supported?e.jsxs(Y,{className:"text-xs bg-amber-500/15 text-amber-600 dar
57k:text-amber-400 border-amber-500/30",children:[e.jsx(Ct,{className:"h-3 w-3 mr-1"}),"Supported"]}):e.jsx("span",{className:"text-xs text-muted-foreground",children:"Not Supported"})})]})]})})})]}),e.jsxs(ue,{className:"border-card-border",children:[e.jsx(Vt,{className:"pb-3",children:e.jsxs(zt,{className:"text-base flex items-center gap-2",children:[e.jsx(on,{className:"h-4 w-4 text-muted-foreground"}),"Off-chain Metadata"]})}),e.jsx(me,{children:e.jsx("div",{className:"space-y-4",children:e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-[11px] text-muted-foreground uppercase tracking-wider",children:"Agent URI"}),e.jsx("div",{className:"flex items-center gap-2",children:_.agentUri?e.jsxs(e.Fragment,{children:[e.jsx("code",{className:"text-xs font-mono text-foreground truncate block max-w-[250px]","data-testid":"meta-agent-uri",children:_.agentUri}),e.jsx("a",{href:_.agentUri,target:"_blank",rel:"noopener noreferrer",className:"text-muted-foreground hover:text-foreground transition-colors shrink-0","data-testid":"link-agent-uri",children:e.jsx(wt,{className:"h-3 w-3"})})]}):e.jsx("span",{className:"text-xs text-muted-foreground",children:"N/A"})})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-[11px] text-muted-foreground uppercase tracking-wider",children:"Name"}),e.jsx("p",{className:"text-sm text-foreground","data-testid":"meta-name",children:_.name})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-[11px] text-muted-foreground uppercase tracking-wider",children:"Created On-Chain"}),e.jsx("p",{className:"text-xs text-foreground","data-testid":"meta-created-on-chain",children:_.createdOnChain?new Date(_.createdOnChain).toLocaleString():"N/A"})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-[11px] text-muted-foreground uppercase tracking-wider",children:"Last Updated On-Chain"}),e.jsx("p",{className:"text-xs text-foreground","data-testid":"meta-last-updated",children:_.lastUpdatedOnChain?new Date(_.lastUpdatedOnChain).toLocaleString():"N/A"})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-[11px] text-muted-foreground uppercase tracking-wider",children:"Indexed At"}),e.jsx("p",{className:"text-xs text-foreground","data-testid":"meta-indexed-at",children:_.indexedAt?new Date(_.indexedAt).toLocaleString():"N/A"})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-[11px] text-muted-foreground uppercase tracking-wider",children:"TBA Address"}),e.jsx("div",{className:"flex items-center gap-2",children:_.tbaAddress?e.jsxs(e.Fragment,{children:[e.jsx("code",{className:"text-xs font-mono text-foreground","data-testid":"meta-tba",children:sn(_.tbaAddress)}),e.jsx("a",{href:lo(_.chain,"address",_.tbaAddress),target:"_blank",rel:"noopener noreferrer",className:"text-muted-foreground hover:text-foreground transition-colors","data-testid":"link-tba-explorer",children:e.jsx(wt,{className:"h-3 w-3"})})]}):e.jsx("span",{className:"text-xs text-muted-foreground",children:"Not deployed"})})]})]})})})]})]}),_.chain==="base"&&e.jsx(Ws,{value:"payments",className:"mt-4 space-y-6","data-testid":"tab-content-payments",children:(()=>{const V=_.usdcTxCount??0,R=_.usdcVolumeIn??0,Q=_.usdcVolumeOut??0,Ne=_.lastUsdcPaymentAt;return V===0?e.jsx(ue,{className:"border-card-border",children:e.jsxs(me,{className:"pt-6 text-center py-12",children:[e.jsx(qn,{
57className:"h-10 w-10 text-muted-foreground/30 mx-auto mb-3"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"No USDC payment activity detected in the past 100,000 blocks"}),_.agentWallet&&e.jsxs("a",{href:`https://basescan.org/address/${_.agentWallet}#tokentxns`,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1.5 mt-3 text-xs text-primary hover:underline","data-testid":"link-basescan-empty",children:["View on Basescan ",e.jsx(wt,{className:"h-3 w-3"})]})]})}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[e.jsx(ue,{className:"border-card-border",children:e.jsxs(me,{className:"p-6 text-center",children:[e.jsx(qn,{className:"h-6 w-6 text-primary mx-auto mb-2"}),e.jsx("p",{className:"text-3xl font-bold tabular-nums","data-testid":"stat-usdc-tx-count",children:V.toLocaleString()}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Total USDC Transactions"})]})}),e.jsx(ue,{className:"border-card-border",children:e.jsxs(me,{className:"p-6 text-center",children:[e.jsx(Uy,{className:"h-6 w-6 text-emerald-500 mx-auto mb-2"}),e.jsxs("p",{className:"text-3xl font-bold tabular-nums text-emerald-600 dark:text-emerald-400","data-testid":"stat-usdc-volume-in",children:["$",R.toFixed(2)]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"USDC Received"})]})}),e.jsx(ue,{className:"border-card-border",children:e.jsxs(me,{className:"p-6 text-center",children:[e.jsx(jS,{className:"h-6 w-6 text-amber-500 mx-auto mb-2"}),e.jsxs("p",{className:"text-3xl font-bold tabular-nums text-amber-600 dark:text-amber-400","data-testid":"stat-usdc-volume-out",children:["$",Q.toFixed(2)]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"USDC Sent"})]})})]}),e.jsxs(ue,{className:"border-card-border",children:[e.jsx(Vt,{className:"pb-3",children:e.jsxs(zt,{className:"text-base flex items-center gap-2",children:[e.jsx(Bi,{className:"h-4 w-4 text-muted-foreground"}),"Payment Details"]})}),e.jsxs(me,{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:"Network"}),e.jsx(Y,{variant:"secondary",className:"bg-indigo-500/10 text-indigo-600 dark:text-indigo-400 text-xs",children:"Base"})]}),e.jsx(is,{}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:"Token"}),e.jsx("span",{className:"text-sm font-medium text-foreground",children:"USDC (6 decimals)"})]}),e.jsx(is,{}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:"Last Payment"}),e.jsx("span",{className:"text-sm font-medium text-foreground","data-testid":"text-last-usdc-payment",children:Ne?o0(Ne):"Unknown"})]}),e.jsx(is,{}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:"Net Flow"}),e.jsxs("span",{className:`text-sm font-bold tabular-nums ${R-Q>=0?"text-emerald-600 dark:text-emerald-400":"text-red-500"}`,"data-testid":"text-usdc-net-flow",children:[R-Q>=0?"+":"","$",(R-Q).toFixed(2)," USDC"]})]}),_.agentWallet&&e.jsxs(e.Fragment,{children:[e.jsx(is,{}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:"Agent Wallet"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("code",{className:"text-xs font-mono text-foreground","data-testid":"text-agent-wallet-payments",children:sn(_.agentWallet)}),e.jsx("a",{href:`https://basescan.org/address/${_.agentWallet}#tokentxns`,target:"_blank",rel:"noopener noreferrer",className:"text-muted-foreground hover:text-foreground transition-colors","data-testid":"link-basescan-wallet",children:e.jsx(wt,{className:"h-3 w-3"})})]})]})]})]})]}),e.jsx("p",{className:"text-[11px] text-muted-foreground text-center",children:"Data indexed from Base chain · USDC contract 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913 · Last 100,000 blocks"})]})})()})]})})]})}const mT=[{layer:1,name:"Identity",description:"ERC-8004 Agent Registry + ERC-6551 Token Bound Accounts",color:"bg-blue-500/10 text-blue-600 dar
57k:text-blue-400",borderColor:"border-blue-500/20",standards:["ERC-8004","ERC-6551"]},{layer:2,name:"Permissions",description:"ERC-7715 Permission Manifest + CDAD Registry for granular on-chain access control",color:"bg-emerald-500/10 text-emerald-600 dark:text-emerald-400",borderColor:"border-emerald-500/20",standards:["ERC-7715","CDAD"]},{layer:3,name:"Smart Accounts",description:"ERC-7579 Modular Accounts for customizable agent logic",color:"bg-purple-500/10 text-purple-600 dark:text-purple-400",borderColor:"border-purple-500/20",standards:["ERC-7579"]},{layer:4,name:"Commerce",description:"MCP USDC, x402, EIP-8183 Escrow, Stripe, ERC-4337 Gas Sponsorship",color:"bg-amber-500/10 text-amber-600 dark:text-amber-400",borderColor:"border-amber-500/20",standards:["EIP-8183","x402","ERC-4337"]},{layer:5,name:"Risk Scoring",description:"ERC-8126 multi-layer verification with ZKP privacy (ETV, SCV, WAV, WV)",color:"bg-rose-500/10 text-rose-600 dark:text-rose-400",borderColor:"border-rose-500/20",standards:["ERC-8126"]}],fT=[{name:"eth-mcp",description:"Build and deploy Ethereum applications"},{name:"ens-mcp",description:"ENS name resolution and lookup"},{name:"blockscout-mcp",description:"Blockchain data â balances, tokens, NFTs"},{name:"etherscan-mcp",description:"Transaction history and contract ABIs"},{name:"quicknode-mcp",description:"RPC endpoints and indexing"}],hT=[{name:"ERC-8004 Identity Registry",chain:"Ethereum",address:"0x8004A169FB4a3325136EB29fA0ceB6D2e539a432"},{name:"ERC-8004 Identity Registry",chain:"Base",address:"0x8004A169FB4a3325136EB29fA0ceB6D2e539a432"},{name:"Reputation Registry",chain:"Ethereum",address:"0x8004BAa17C55a88189AE136b182e5fdA19dE9b63"},{name:"Reputation Registry",chain:"Base",address:"0x8004BAa17C55a88189AE136b182e5fdA19dE9b63"}],pT=["request_scope","proxied_call","request_payment","record_activity"];function xT(){return e.jsxs("div",{className:"min-h-screen",children:[e.jsx("div",{className:"border-b border-border bg-card/30",children:e.jsx("div",{className:"max-w-5xl mx-auto px-4 sm:px-6 py-8",children:e.jsxs("div",{className:"flex items-start justify-between gap-4 mb-3",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"h-10 w-10 rounded-xl bg-primary/10 flex items-center justify-center",children:e.jsx(Wc,{className:"h-5 w-5 text-primary"})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-3xl font-bold text-foreground","data-testid":"text-dev-title",children:"Developer Reference"}),e.jsx("p",{className:"text-muted-foreground text-sm",children:"SDK layers, MCP tools, on-chain contracts, and ERC-8126 integration"})]})]}),e.jsx(kt,{href:"/e2e-test",children:e.jsxs(ie,{variant:"outline",size:"sm",className:"shrink-0","data-testid":"link-e2e-test",children:[e.jsx(nl,{className:"h-3.5 w-3.5 mr-1.5"}),"E2E Test Runner"]})})]})})}),e.jsx("div",{className:"max-w-5xl mx-auto px-4 sm:px-6 py-8",children:e.jsxs(ep,{defaultValue:"stack",className:"w-full",children:[e.jsxs(Zd,{className:"w-full justify-start mb-6",children:[e.jsxs(Hs,{value:"stack",className:"gap-1.5","data-testid":"tab-stack",children:[e.jsx(Ur,{className:"h-3.5 w-3.5"})," Agent Stack"]}),e.jsxs(Hs,{value:"erc8126",className:"gap-1.5","data-testid":"tab-erc8126",children:[e.jsx(Ct,{className:"h-3.5 w-3.5"})," ERC-8126"]}),e.jsxs(Hs,{value:"contracts",className:"gap-1.5","data-testid":"tab-contracts",children:[e.jsx(Gy,{className:"h-3.5 w-3.5"})," Contracts"]}),e.jsxs(Hs,{value:"mcp",className:"gap-1.5","data-testid":"tab-mcp",children:[e.jsx(Hi,{className:"h-3.5 w-3.5"})," MCP"]})]}),e.jsx(Ws,{value:"stack",className:"space-y-4","data-testid":"tab-content-stack",children:mT.map(t=>e.jsx(ue,{className:"border-card-border overflow-hidden",children:e.jsx(me,{className:"p-5",children:e.jsxs("div",{className:"flex items-start gap-4",children:[e.jsx("div",{className:`w-10 h-10 rounded-xl ${t.color} flex items-center justify-center shrink-0`,children:e.jsxs("span",{className:"text-sm font-bold",children:["L",t.layer]})}),e.jsxs("div",{className:"flex-1",children:[e.jsx("div",{className:"flex items-center gap-2 mb-1.5",children:e.jsx("h3",{className:"font-semibold text-lg text-foreground",children:t.name})}),e.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed mb-3",children:t.description}),e.jsx("div",{className:"flex gap-1.5 flex-wrap",children:t.standards.map(s=>e.jsx(Y,{variant:"outline",className:`text-xs ${t.borderColor}`,children:s},s))})]})]})})},t.layer))}),e.jsx(Ws,{value:"erc8126",className:"space-y-6","data-testid":"tab-content-erc8126",children:e.jsxs(ue,{className:"border-card-border",children:[e.jsx(Vt,{children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"h-10 w-10 rounded-xl bg-emerald-500/10 flex items-center justify-center",children:e.jsx(Ct,{className:"h-5 w-5 text-emerald-500"})}),e.jsxs("div",{children:[e.jsx(zt,{children:"ERC-8126: AI Agent Registration and Verification"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-0.5",children:"Draft Standard â Privacy-preserving risk scoring"})]})]})}),e.jsxs(me,{className:"space-y-6",children:[e.jsx("div",{className:"prose prose-sm dark:prose-invert max-w-none",children:e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"ERC-8126 defines a standardized risk scoring and verification system for AI agents on Ethereum. It provides a unified 0-100 risk score derived from four independent verification layers, processed through Zero-Knowledge Proofs for privacy preservation."})}),e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[{name:"ETV â Ethereum Token Verification",desc:"Validates code legitimacy through on-chain token contract analysis. Checks contract bytecode, deployment patterns, and token standard compliance.",icon:Ct,color:"text-blue-500"},{name:"SCV â Staking Contract Verification",desc:"Assesses economic commitment by analyzing staking contract participation, lock-up periods, and slashing history.",icon:Io,color:"text-emerald-500"},{name:"WAV â Web Application Verification",desc:"OWASP-aligned security assessment of off-chain interfaces including API endpoints, authentication, and data handling.",icon:an,color:"text-purple-500"},{name:"WV â Wallet Verification",desc:"Behavioral analysis of wallet transaction history, interaction patterns, and on-chain reputation signals.",icon:St,color:"text-amber-500"}].map(t=>e.jsx(ue,{className:"border-card-border",children:e.jsxs(me,{className:"p-4 space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(t.icon,{className:`h-4 w-4 ${t.color}`}),e.jsx("h4",{className:"text-sm font-semibold",children:t.name})]}),e.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:t.desc})]})},t.name))}),e.jsx(ue,{className:"border-card-border bg-muted/30",children:e.jsxs(me,{className:"p-4",children:[e.jsxs("h4",{className:"text-sm font-semibold mb-3 flex items-center gap-2",children:[e.jsx(Sv,{className:"h-4 w-4 text-primary"}),"Conceptual Interface"]}),e.jsx("pre",{className:"text-xs font-mono bg-background rounded-lg p-4 overflow-x-auto border border-border",children:`interface IERC8126 { 58 function getAgentRiskScore( 59 address agentWallet 60 ) external view returns (uint8); 61 62 function getVerificationStatus( 63 address agentWallet, 64 VerificationType vType 65 ) external view returns (bool); 66 67 function registerAgent( 68 AgentRegistration calldata data 69 ) external; 70} 71 72enum VerificationType { 73 ETV, // Ethereum Token Verification 74 SCV, // Staking Contract Verification 75 WAV, // Web Application Verification 76 WV // Wallet Verification 77}`})]})}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsx(ue,{className:"border-card-border",children:e.jsxs(me,{className:"p-4 space-y-2",children:[e.jsx("h4",{className:"text-sm font-semibold",children:"Privacy Architecture"}),e.jsxs("ul",{className:"text-xs text-muted-foreground space-y-1.5",children:[e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-emerald-500 mt-0.5",children:"â¢"}),"Private Data Verification (PDV) via ZKPs"]}),e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-emerald-500 mt-0.5",children:"â¢"}),"No stored data = no data breach risks"]}),e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-emerald-500 mt-0.5",children:"â¢"}),"Detailed results only for wallet holders"]}),e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-emerald-500 mt-0.5",children:"â¢"}),"Quantum-resistant encryption option (QCV)"]})]})]})}),e.jsx(ue,{className:"border-card-border",children:e.jsxs(me,{className:"p-4 space-y-2",children:[e.jsx("h4",{className:"text-sm font-semibold",children:"Integration"}),e.jsxs("ul",{className:"text-xs text-muted-foreground space-y-1.5",children:[e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-blue-500 mt-0.5",children:"â¢"}),"x402 micropayment integration"]}),e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-blue-500 mt-0.5",children:"â¢"}),"EIP-712 structured signing"]}),e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-blue-500 mt-0.5",children:"â¢"}),"No agent modification required"]}),e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-blue-500 mt-0.5",children:"â¢"}),"Complements ERC-8004 identity layer"]})]})]})})]})]})]})}),e.jsxs(Ws,{value:"contracts",className:"space-y-4","data-testid":"tab-content-contracts",children:[e.jsxs(ue,{className:"border-card-border",children:[e.jsx(Vt,{className:"pb-3",children:e.jsx(zt,{className:"text-base",children:"Deployed Contracts"})}),e.jsx(me,{children:e.jsx("div",{className:"space-y-3",children:hT.map((t,s)=>e.jsxs("div",{className:"flex items-center justify-between p-3 rounded-lg bg-muted/30 border border-border/50",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(Y,{variant:"secondary",className:"text-xs",children:t.chain}),e.jsx("span",{className:"text-sm font-medium",children:t.name})]}),e.jsx("code",{className:"text-xs font-mono text-muted-foreground hidden sm:block",children:t.address}),e.jsxs("code",{className:"text-xs font-mono text-muted-foreground sm:hidden",children:[t.address.slice(0,10),"..."]})]},s))})})]}),e.jsxs(ue,{className:"border-card-border",children:[e.jsx(Vt,{className:"pb-3",children:e.jsx(zt,{className:"text-base",children:"On-Chain Architecture"})}),e.jsx(me,{children:e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:[{name:"CDAD Registry",purpose:"Stores buyer mandates â scopes, limits, signatures"},{name:"EIP-8183 Escrow",purpose:"Job escrow â fund, submit, complete, reject, refund"},{name:"EAS Attestation Service",purpose:"KYC attestations â verified human records"},{name:"ERC-6551 TBA Factory",purpose:"Token Bound Accounts â agent and buyer wallets"}].map(t=>e.jsxs("div",{className:"p-3 rounded-lg bg-card border border-border/50",children:[e.jsx("p",{className:"text-sm font-medium text-foreground",children:t.name}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:t.purpose})]},t.name))})})]})]}),e.jsxs(Ws,{value:"mcp",className:"space-y-4","data-testid":"tab-content-mcp",children:[e.jsxs(ue,{className:"border-card-border",children:[e.jsxs(Vt,{className:"pb-3",children:[e.jsx(zt,{className:"text-base",children:"Platform MCP Tools"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Core tools available to all connected agents"})]}),e.jsx(me,{className:"space-y-2",children:pT.map(t=>e.jsxs("div",{className:"flex items-center gap-3 p-2.5 rounded-lg bg-muted/30 border border-border/50",children:[e.jsx(Sv,{className:"h-4 w-4 text-primary"}),e.jsx("code",{className:"text-sm font-mono text-foreground",children:t})]},t))})]}),e.jsxs(ue,{className:"border-card-border",children:[e.jsxs(Vt,{className:"pb-3",children:[e.jsx(zt,{className:"text-base",children:"Blockchain MCP Servers"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Extended blockchain capabilities via MCP"})]}),e.jsx(me,{className:"space-y-2",children:fT.map(t=>e.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg bg-muted/30 border border-border/50",children:[e.jsx(Hi,{className:"h-4 w-4 text-primary"}),e.jsxs("div",{children:[e.jsx("code",{className:"text-sm font-mono font-medium text-foreground",children:t.name}),e.jsx("p",{className:"text-xs text-muted-foreground",children:t.description})]})]},t.name))})]})]})]})})]})}var tp="Progress",sp=100,[gT]=Ls(tp),[vT,yT]=gT(tp),w1=p.forwardRef((t,s)=>{const{__scopeProgress:n,value:o=null,max:i,getValueLabel:c=bT,...d}=t;(i||i===0)&&!i0(i)&&console.error(jT(`${i}`,"Progress"));const m=i0(i)?i:sp;o!==null&&!l0(o,m)&&console.error(wT(`${o}`,"Progress"));const f=l0(o,m)?o:null,x=ud(f)?c(f,m):void 0;return e.jsx(vT,{scope:n,value:f,max:m,children:e.jsx(Fe.div,{"aria-valuemax":m,"aria-valuemin":0,"aria-valuenow":ud(f)?f:void 0,"aria-valuetext":x,role:"progressbar","data-state":C1(f,m),"data-value":f??void 0,"data-max":m,...d,ref:s})})});w1.displayName=tp;var N1="ProgressIndicator",k1=p.forwardRef((t,s)=>{const{__scopeProgress:n,...o}=t,i=yT(N1,n);return e.jsx(Fe.div,{"data-state":C1(i.value,i.max),"data-value":i.value??void 0,"data-max":i.max,...o,ref:s})});k1.displayName=N1;function bT(t,s){return`${Math.round(t/s*100)}%`}function C1(t,s){return t==null?"indeterminate":t===s?"complete":"loading"}function ud(t){return typeof t=="number"}function i0(t){return ud(t)&&!isNaN(t)&&t>0}function l0(t,s){return ud(t)&&!isNaN(t)&&t<=s&&t>=0}function jT(t,s){return`Invalid prop \`max\` of value \`${t}\` supplied to \`${s}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${sp}\`.`}function wT(t,s){return`Invalid prop \`value\` of value \`${t}\` supplied to \`${s}\`. The \`value\` prop must be: 78 - a positive number 79 - less than the value passed to \`max\` (or ${sp} if no \`max\` prop is set) 80 - \`null\` or \`undefined\` if the progress is indeterminate. 81 82Defaulting to \`null\`.`}var S1=w1,NT=k1;const rp=p.forwardRef(({className:t,value:s,...n},o)=>e.jsx(S1,{ref:o,className:re("relative h-4 w-full overflow-hidden rounded-full bg-secondary",t),...n,children:e.jsx(NT,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(s||0)}%)`}})}));rp.displayName=S1.displayName;const bo={open:{label:"Open",color:"bg-blue-500/10 text-blue-600 dar
82k:text-blue-400 border-blue-500/20",icon:ir},funded:{label:"Funded",color:"bg-emerald-500/10 text-emerald-600 dark:text-emerald-400 border-emerald-500/20",icon:Ss},executing:{label:"Executing",color:"bg-violet-500/10 text-violet-600 dark:text-violet-400 border-violet-500/20",icon:Ge},submitted:{label:"Submitted",color:"bg-amber-500/10 text-amber-600 dark:text-amber-400 border-amber-500/20",icon:Ge},completed:{label:"Completed",color:"bg-green-500/10 text-green-600 dark:text-green-400 border-green-500/20",icon:tt},rejected:{label:"Rejected",color:"bg-red-500/10 text-red-600 dark:text-red-400 border-red-500/20",icon:Pt},expired:{label:"Expired",color:"bg-gray-500/10 text-gray-600 dark:text-gray-400 border-gray-500/20",icon:Do}},kT=["open","funded","submitted","completed"],CT=["funded","executing","submitted","completed"];function ST({currentStatus:t,executionMode:s}){const o=["rejected","expired"].includes(t),i=s==="always_on"?CT:kT,c=i.indexOf(t);return e.jsxs("div",{className:"flex items-center gap-1 flex-wrap","data-testid":"state-machine-viz",children:[i.map((d,m)=>{const f=bo[d],x=d===t,v=!o&&c>=0&&m<c,y=f.icon;return e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsxs("div",{className:re("flex items-center gap-1 px-2 py-1 rounded-md text-[10px] font-medium transition-all",x?f.color:v?"bg-muted text-muted-foreground line-through opacity-60":"bg-muted/50 text-muted-foreground/50"),children:[e.jsx(y,{className:"h-3 w-3"}),f.label]}),m<i.length-1&&e.jsx(Cs,{className:"h-3 w-3 text-muted-foreground/40 shrink-0"})]},d)}),o&&e.jsxs(e.Fragment,{children:[e.jsx(Cs,{className:"h-3 w-3 text-muted-foreground/40 shrink-0"}),e.jsxs("div",{className:re("flex items-center gap-1 px-2 py-1 rounded-md text-[10px] font-medium",bo[t].color),children:[t==="rejected"?e.jsx(Pt,{className:"h-3 w-3"}):e.jsx(Do,{className:"h-3 w-3"}),bo[t].label]})]})]})}function ET({steps:t}){const s={pending:"text-muted-foreground",running:"text-blue-500",completed:"text-green-500",failed:"text-red-500",gated:"text-amber-500"};return e.jsx("div",{className:"space-y-1.5",children:t.map((n,o)=>e.jsxs("div",{className:"flex items-center justify-between gap-2 text-xs",children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx("div",{className:re("h-1.5 w-1.5 rounded-full shrink-0",{"bg-muted-foreground":n.status==="pending","bg-blue-500 animate-pulse":n.status==="running","bg-green-500":n.status==="completed","bg-red-500":n.status==="failed","bg-amber-500":n.status==="gated"})}),e.jsx("span",{className:re("truncate",s[n.status]),children:n.stepName})]}),n.cost!==void 0&&e.jsxs("span",{className:"text-muted-foreground tabular-nums shrink-0",children:["$",n.cost.toFixed(4)]})]},o))})}function ml({text:t,label:s}){const[n,o]=p.useState(!1),i=()=>{navigator.clipboard.writeText(t),o(!0),setTimeout(()=>o(!1),2e3)};return e.jsx(ie,{size:"icon",variant:"ghost",onClick:i,"data-testid":`button-copy-${s||"text"}`,children:n?e.jsx(rl,{className:"h-3 w-3 text-green-500"}):e.jsx(_d,{className:"h-3 w-3"})})}function Mc({label:t,value:s}){return e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"text-[10px] text-muted-foreground",children:t}),e.jsx("p",{className:"text-xs font-mono text-foreground truncate",children:s})]}),e.jsx(ml,{text:s,label:t.toLowerCase().replace(/\s+/g,"-")})]})}function _T({metadata:t,deliverable:s}){const[n,o]=p.useState(!1);return e.jsxs("div",{className:"space-y-2","data-testid":"deliverable-tool-output",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"flex items-center justify-center h-8 w-8 rounded-md bg-primary/10",children:e.jsx(Gs,{className:"h-4 w-4 text-primary"})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap",children:[e.jsx("span",{className:"text-xs font-semibold text-foreground",children:t.tool}),e.jsx(lr,{className:"h-3 w-3 text-muted-foreground shrink-0"}),e.jsx("span",{className:"text-xs text-foreground",children:t.action}),t.recordId&&e.jsxs(e.Fragment,{children:[e.jsx(lr,{className:"h-3 w-3 text-muted-foreground shrink-0"}),e.jsx(Y,{variant:"secondary",className:"text-[10px] font-mono",children:t.recordId})]})]}),t.status&&e.jsx("p",{className:"text-[10px] text-muted-foreground mt-0.5",children:t.status})]})]}),s&&e.jsx("p",{className:"text-xs text-muted-foreground",children:s}),t.details&&Object.keys(t.details).length>0&&e.jsxs("div",{children:[e.jsxs("button",{onClick:()=>o(!n),className:"flex items-center gap-1 text-[10px] text-muted-foreground hover:text-foreground transition-colors","data-testid":"button-toggle-metadata",children:[n?e.jsx(Ar,{className:"h-3 w-3"}):e.jsx(Cs,{className:"h-3 w-3"}),"Metadata Details"]}
82),n&&e.jsx("pre",{className:"mt-2 p-3 bg-muted/50 rounded-md text-[10px] font-mono text-foreground overflow-x-auto",children:JSON.stringify(t.details,null,2)})]})]})}function AT(t){const s=t.split(` 83`),n=[];let o=0;for(;o<s.length;){const i=s[o];if(i.startsWith("```")){const c=[];for(o++;o<s.length&&!s[o].startsWith("```");)c.push(s[o]),o++;n.push({type:"code",content:c.join(` 84`)})}else if(i.startsWith("### "))n.push({type:"h3",content:i.slice(4)});else if(i.startsWith("## "))n.push({type:"h2",content:i.slice(3)});else if(i.startsWith("# "))n.push({type:"h1",content:i.slice(2)});else if(i.startsWith("> "))n.push({type:"blockquote",content:i.slice(2)});else if(i==="---"||i==="***"||i==="___")n.push({type:"hr",content:""});else if(i.startsWith("| ")){const c=[i];for(o++;o<s.length&&s[o].startsWith("|");)c.push(s[o]),o++;const d=c.filter(m=>!/^\|[-| :]+\|$/.test(m.trim())).map(m=>m.split("|").slice(1,-1).map(f=>f.trim()));n.push({type:"table",content:"",rows:d});continue}else if(/^[-*+] /.test(i)||/^\d+\. /.test(i)){const c=[];for(;o<s.length&&(/^[-*+] /.test(s[o])||/^\d+\. /.test(s[o]));)c.push(s[o].replace(/^[-*+] /,"").replace(/^\d+\. /,"")),o++;n.push({type:"list",content:"",items:c});continue}else i.trim()!==""&&n.push({type:"p",content:i});o++}return n}function TT(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function Vn(t){return TT(t).replace(/\*\*([^*]+)\*\*/g,"<strong>$1</strong>").replace(/\*([^*]+)\*/g,"<em>$1</em>").replace(/`([^`]+)`/g,'<code class="bg-muted px-1 py-0.5 rounded text-[10px] font-mono">$1</code>')}function RT({text:t}){const s=AT(t);return e.jsx("div",{className:"space-y-2",children:s.map((n,o)=>n.type==="h1"?e.jsx("h2",{className:"text-sm font-bold text-foreground mt-3 first:mt-0",dangerouslySetInnerHTML:{__html:Vn(n.content)}},o):n.type==="h2"?e.jsx("h3",{className:"text-xs font-bold text-foreground mt-2 first:mt-0",dangerouslySetInnerHTML:{__html:Vn(n.content)}},o):n.type==="h3"?e.jsx("h4",{className:"text-xs font-semibold text-foreground",dangerouslySetInnerHTML:{__html:Vn(n.content)}},o):n.type==="hr"?e.jsx("hr",{className:"border-border/50 my-1"},o):n.type==="blockquote"?e.jsx("div",{className:"border-l-2 border-primary/40 pl-3 text-xs text-muted-foreground italic",dangerouslySetInnerHTML:{__html:Vn(n.content)}},o):n.type==="code"?e.jsx("pre",{className:"p-2 bg-muted rounded text-[10px] font-mono text-foreground overflow-x-auto leading-relaxed",children:n.content},o):n.type==="list"?e.jsx("ul",{className:"space-y-0.5 pl-3",children:(n.items||[]).map((i,c)=>e.jsxs("li",{className:"flex items-start gap-1.5 text-xs text-foreground",children:[e.jsx("span",{className:"mt-1.5 h-1 w-1 rounded-full bg-muted-foreground shrink-0"}),e.jsx("span",{dangerouslySetInnerHTML:{__html:Vn(i)}})]},c))},o):n.type==="table"&&n.rows&&n.rows.length>0?e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"text-[10px] w-full border-collapse",children:[e.jsx("thead",{children:e.jsx("tr",{children:n.rows[0].map((i,c)=>e.jsx("th",{className:"border border-border/30 px-2 py-1 text-left font-semibold text-foreground bg-muted/50",dangerouslySetInnerHTML:{__html:Vn(i)}},c))})}),e.jsx("tbody",{children:n.rows.slice(1).map((i,c)=>e.jsx("tr",{children:i.map((d,m)=>e.jsx("td",{className:"border border-border/30 px-2 py-1 text-muted-foreground",dangerouslySetInnerHTML:{__html:Vn(d)}},m))},c))})]})},o):e.jsx("p",{className:"text-xs text-foreground leading-relaxed",dangerouslySetInnerHTML:{__html:Vn(n.content)}},o))})}function PT({deliverable:t}){return e.jsxs("div",{className:"space-y-1","data-testid":"deliverable-text",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx(Qn,{className:"h-4 w-4 text-muted-foreground"}),e.jsx("span",{className:"text-[10px] font-medium text-muted-foreground uppercase tracking-wider",children:"Text Deliverable"})]}),e.jsx("div",{className:"p-3 bg-muted/30 rounded-md",children:e.jsx(RT,{text:t})})]})}function MT({deliverable:t}){const s=t.startsWith("http")||t.startsWith("ipfs://"),n=t.startsWith("ipfs://")?`https://ipfs.io/ipfs/${t.replace("ipfs://","")}`:t;return e.jsxs("div",{className:"space-y-1","data-testid":"deliverable-file-hash",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx(on,{className:"h-4 w-4 text-muted-foreground"}),e.jsx("span",{className:"text-[10px] font-medium text-muted-foreground uppercase tracking-wider",children:"File / Hash"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("p",{className:"text-xs font-mono text-foreground truncate flex-1",children:t}),e.jsx(ml,{text:t,label:"file-hash"}),s&&e.jsx("a",{href:n,target:"_blank",rel:"noopener noreferrer",children:e.jsx(ie,{size:"icon",variant:"ghost","data-testid":"button-open-file",children:e.jsx(wt,{className:"h-3 w-3"})})})]})]})}function IT({job:t}){return!t.deliverable&&!t.deliverableMetadata?null:e.jsxs("div",{className:"border-t border-border/50 pt-3",children:[e.jsx("p",{className:"text-[10px] font-medium text-muted-foreground uppercase tracking-wider mb-2",children:"Deliverable"}),t.deliverableType==="tool_output"&&t.deliverableMetadata?e.jsx(_T,{metadata:t.deliverableMetadata,deliverable:t.deliverable}):t.deliverableType==="file_hash"&&t.deliverable?e.jsx(MT,{deliverable:t.deliverable}):t.deliverable?e.jsx(PT,{deliverable:t.deliverable}):null]})}function Uf(t,s){return t==="base"?`https://basescan.org/tx/${s}`:t==="sepolia"?`https://sepolia.etherscan.io/tx/${s}`:`https://etherscan.io/tx/${s}`}function DT(t,s){return t==="base"?`https://basescan.org/address/${s}`:t==="sepolia"?`https://sepolia.etherscan.io/address/${s}`:`https://etherscan.io/address/${s}`}function OT({status:t,txHash:s,chain:n}){return t==="confirmed"?e.jsxs("div",{className:"flex items-center gap-1.5","data-testid":"anchor-status-confirmed",children:[e.jsx(Es,{className:"h-3 w-3 text-green-500"}),e.jsx("span",{className:"text-[10px] font-medium text-green-600 dark:text-green-400",children:"Anchored On-Chain"}),s&&n&&e.jsxs("a",{href:Uf(n,s),target:"_blank",rel:"noopener noreferrer",className:"text-[10px] text-blue-500 hover:text-blue-600 underline flex items-center gap-0.5","data-testid":"link-explorer-tx",children:["View tx ",e.jsx(wt,{className:"h-2.5 w-2.5"})]})]}):t==="pending"?e.jsxs("div",{className:"flex items-center gap-1.5","data-testid":"anchor-status-pending",children:[e.jsx(Ge,{className:"h-3 w-3 text-amber-500 animate-spin"}),e.jsx("span",{className:"text-[10px] font-medium text-amber-600 dar
84k:text-amber-400",children:"Tx Pending Confirmation"}),s&&n&&e.jsxs("a",{href:Uf(n,s),target:"_blank",rel:"noopener noreferrer",className:"text-[10px] text-blue-500 hover:text-blue-600 underline flex items-center gap-0.5","data-testid":"link-explorer-tx",children:["Track tx ",e.jsx(wt,{className:"h-2.5 w-2.5"})]})]}):t==="failed"?e.jsxs("div",{className:"flex items-center gap-1.5","data-testid":"anchor-status-failed",children:[e.jsx(ln,{className:"h-3 w-3 text-red-500"}),e.jsx("span",{className:"text-[10px] font-medium text-red-600 dark:text-red-400",children:"Anchor Failed"})]}):e.jsxs("div",{className:"flex items-center gap-1.5","data-testid":"anchor-status-not-anchored",children:[e.jsx(al,{className:"h-3 w-3 text-muted-foreground"}),e.jsx("span",{className:"text-[10px] font-medium text-muted-foreground",children:"Not Yet Anchored"})]})}function LT({jobId:t}){const[s,n]=p.useState(!1),{data:o,isLoading:i}=He({queryKey:["/api/jobs",t,"on-chain-record"],queryFn:()=>fetch(`/api/jobs/${t}/on-chain-record`).then(d=>d.json()),enabled:s}),c="0x8004A169FB4a3325136EB29fA0ceB6D2e539a432";return e.jsxs("div",{className:"border-t border-border/50 pt-3","data-testid":`on-chain-record-${t}`,children:[e.jsxs("button",{onClick:()=>n(!s),className:"flex items-center gap-1.5 text-[10px] font-medium text-muted-foreground uppercase tracking-wider hover:text-foreground transition-colors w-full","data-testid":`button-toggle-onchain-${t}`,children:[e.jsx(nn,{className:"h-3 w-3"}),"ERC-8183 Agentic Commerce Record",s?e.jsx(Ar,{className:"h-3 w-3 ml-auto"}):e.jsx(Cs,{className:"h-3 w-3 ml-auto"})]}),s&&e.jsx("div",{className:"mt-3 space-y-3",children:i?e.jsxs("div",{className:"space-y-2",children:[e.jsx(ot,{className:"h-4 w-full"}),e.jsx(ot,{className:"h-4 w-3/4"})]}):o?e.jsxs("div",{className:"space-y-3 p-3 bg-muted/30 rounded-md",children:[e.jsx(OT,{status:o.anchorStatus,txHash:o.anchorTxHash,chain:o.anchorChain}),o.anchorTxHash&&e.jsxs("div",{className:"space-y-1.5 border border-border/30 rounded p-2 bg-background/50",children:[e.jsx("p",{className:"text-[10px] font-medium text-muted-foreground uppercase tracking-wider",children:"Identity Registry Anchor"}),e.jsxs("div",{className:"grid grid-cols-2 gap-2 text-[10px]",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground",children:"Registry: "}),e.jsxs("a",{href:DT(o.anchorChain||"ethereum",c),target:"_blank",rel:"noopener noreferrer",className:"text-blue-500 hover:text-blue-600 font-mono","data-testid":"link-registry-contract",children:[c.slice(0,10),"...",c.slice(-4)]})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground",children:"Chain: "}),e.jsx("span",{className:"text-foreground font-medium capitalize",children:o.anchorChain})]}),o.anchorBlockNumber&&e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground",children:"Block: "}),e.jsxs("span",{className:"text-foreground font-mono",children:["#",o.anchorBlockNumber.toLocaleString()]})]}),e.jsxs("div",{className:"col-span-2 flex items-center gap-1",children:[e.jsx("span",{className:"text-muted-foreground",children:"Tx: "}),e.jsxs("a",{href:Uf(o.anchorChain||"ethereum",o.anchorTxHash),target:"_blank",rel:"noopener noreferrer",className:"text-blue-500 hover:text-blue-600 font-mono","data-testid":"link-anchor-tx",children:[o.anchorTxHash.slice(0,10),"...",o.anchorTxHash.slice(-4)]}),e.jsx(ml,{text:o.anchorTxHash,label:"anchor-tx"})]})]})]}),o.taskHash&&e.jsx(Mc,{label:"Task Hash",value:o.taskHash}),o.deliverableHash&&e.jsx(Mc,{label:"Deliverable Hash",value:o.deliverableHash}),o.delegationHash&&e.jsx(Mc,{label:"Delegation Hash",value:o.delegationHash}),o.auditRootHash&&e.jsx(Mc,{label:"Audit Root Hash",value:o.auditRootHash}),e.jsxs("div",{className:"grid grid-cols-2 gap-3 text-xs",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-[10px] text-muted-foreground",children:"Escrow"}),e.jsxs("p",{className:"text-foreground font-medium",children:[o.escrowAmount," ",o.escrowToken]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-[10px] text-muted-foreground",children:"Provider Token ID"}),e.jsxs("p",{className:"text-foreground font-medium",children:["#",o.providerTokenId]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-[10px] text-muted-foreground",children:"Client Address"}),e.jsx("p",{className:"text-foreground font-mono text-[10px] truncate",children:o.clientAddress})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-[10px] text-muted-foreground",children:"Chain"}),e.jsx("p",{className:"text-foreground font-medium capitalize",children:o.providerChain})]}),o.evaluatorAddress&&e.jsxs("div",{children:[e.jsx("p",{className:"text-[10px] text-muted-foreground",children:"Evaluator"}),e.jsx("p",{className:"text-foreground font-mono text-[10px] truncate",children:o.evaluatorAddress})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-[10px] text-muted-foreground",children:"Evaluator Type"}),e.jsx("p",{className:"text-foreground font-medium capitalize",children:o.evaluatorType})]}),o.nanopaymentsTotalCost!==null&&o.nanopaymentsTotalCost!==void 0&&e.jsxs("div",{children:[e.jsx("p",{className:"text-[10px] text-muted-foreground",children:"Nanopayments Total"}),e.jsxs("p",{className:"text-foreground font-semibold tabular-nums","data-testid":`text-nanopayments-total-onchain-${o.jobId}`,children:["$",o.nanopaymentsTotalCost.toFixed(4)," USDC"]})]}),o.circlePaymentId&&e.jsxs("div",{children:[e.jsx("p",{className:"text-[10px] text-muted-foreground",children:"Circle Payment ID"}),e.jsx("p",{className:"text-foreground font-mono text-[10px] truncate","data-testid":`text-circle-payment-${o.jobId}`,children:o.circlePaymentId})]})]}),e.jsxs("div",{className:"border-t border-border/30 pt-2 space-y-1",children:[e.jsx("p",{className:"text-[10px] font-medium text-muted-foreground uppercase tracking-wider mb-1",children:"Timestamps"}),e.jsxs("div",{className:"grid grid-cols-2 gap-2 text-[10px]",children:[o.createdAt&&e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground",children:"Created: "}),e.jsx("span",{className:"text-foreground",children:new Date(o.createdAt).toLocaleStr
84ing()})]}),o.providerAcceptedAt&&e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground",children:"Accepted: "}),e.jsx("span",{className:"text-foreground",children:new Date(o.providerAcceptedAt).toLocaleString()})]}),o.executionStartedAt&&e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground",children:"Exec Start: "}),e.jsx("span",{className:"text-foreground",children:new Date(o.executionStartedAt).toLocaleString()})]}),o.executionCompletedAt&&e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground",children:"Exec End: "}),e.jsx("span",{className:"text-foreground",children:new Date(o.executionCompletedAt).toLocaleString()})]}),o.submittedAt&&e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground",children:"Submitted: "}),e.jsx("span",{className:"text-foreground",children:new Date(o.submittedAt).toLocaleString()})]})]})]}),o.sepoliaPaymentTxHash&&e.jsxs("div",{className:"flex items-center gap-2 p-2 bg-blue-500/5 border border-blue-500/20 rounded-md",children:[e.jsx(qn,{
84className:"h-3 w-3 text-blue-500 shrink-0"}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("p",{className:"text-[10px] text-muted-foreground",children:"Sepolia USDC Payment Tx"}),e.jsx("p",{className:"text-[10px] font-mono text-foreground truncate","data-testid":`text-sepolia-tx-${o.jobId}`,children:o.sepoliaPaymentTxHash})]}),e.jsxs("a",{href:`https://sepolia.etherscan.io/tx/${o.sepoliaPaymentTxHash}`,target:"_blank",rel:"noopener noreferrer",className:"text-[10px] text-blue-500 hover:text-blue-600 underline flex items-center gap-0.5 shrink-0","data-testid":`link-sepolia-tx-${o.jobId}`,children:["Sepolia ",e.jsx(wt,{className:"h-2.5 w-2.5"})]})]}),o.anchorStatus==="confirmed"?e.jsxs("div",{className:"flex items-center gap-1.5 pt-1",children:[e.jsx(Es,{className:"h-3 w-3 text-green-500"}),e.jsx("span",{className:"text-[10px] text-green-600 dark:text-green-400 font-medium",children:"Audit anchored in ERC-8004 Identity Registry"})]}):o.anchorStatus==="failed"?e.jsxs("div",{className:"flex items-center gap-1.5 pt-1",children:[e.jsx(ln,{className:"h-3 w-3 text-amber-500"}),e.jsx("span",{className:"text-[10px] text-amber-600 dark:text-amber-400 font-medium",children:"Anchor failed â configure CHAIN_SIGNER_PRIVATE_KEY to enable"})]}):e.jsxs("div",{className:"flex items-center gap-1.5 pt-1",children:[e.jsx(al,{className:"h-3 w-3 text-muted-foreground"}),e.jsx("span",{className:"text-[10px] text-muted-foreground font-medium",children:"Awaiting on-chain anchoring"})]})]}):e.jsx("p",{className:"text-xs text-muted-foreground",children:"Unable to load on-chain record"})})]})}function FT({job:t}){return t.providerAcceptedAt?e.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-green-600 dark:text-green-400",children:[e.jsx(wo,{className:"h-3 w-3"}),e.jsx("span",{children:"Accepted by provider"}),e.jsx("span",{className:"text-muted-foreground",children:new Date(t.providerAcceptedAt).toLocaleDateString()})]}):t.providerDeclinedAt?e.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-red-600 dark:text-red-400",children:[e.jsx(Pt,{className:"h-3 w-3"}),e.jsxs("span",{children:["Declined",t.declineReason?`: ${t.declineReason}`:""]})]}):null}const c0={pending:{label:"Pending",color:"bg-amber-500/10 text-amber-600 dark:text-amber-400 border-amber-500/20"},batched:{label:"Batched",color:"bg-blue-500/10 text-blue-600 dark:text-blue-400 border-blue-500/20"},settled:{label:"Settled",color:"bg-green-500/10 text-green-600 dark:text-green-400 border-green-500/20"},failed:{label:"Failed",color:"bg-red-500/10 text-red-600 dark:text-red-400 border-red-500/20"}};function $T({jobId:t,batchId:s}){const[n,o]=p.useState(!1),{data:i,isLoading:c}=He({queryKey:["/api/payments/circle/transactions",t],queryFn:()=>fetch(`/api/payments/circle/transactions/${t}`).then(v=>v.json()),enabled:n}),d=i?.reduce((v,y)=>v+(y.amount||0),0)||0,m=i?.filter(v=>v.status==="settled").length||0,f=i?.filter(v=>v.status==="pending").length||0,x=i?.filter(v=>v.status==="batched").length||0;return e.jsxs("div",{className:"border-t border-border/50 pt-3","data-testid":`nanopayment-history-${t}`,children:[e.jsxs("button",{onClick:()=>o(!n),className:"flex items-center gap-1.5 text-[10px] font-medium text-muted-foreground uppercase tracking-wider hover:text-foreground transition-colors w-full","data-testid":`button-toggle-payments-${t}`,children:[e.jsx(KS,{className:"h-3 w-3"}),"Payments",n?e.jsx(Ar,{className:"h-3 w-3 ml-auto"}):e.jsx(Cs,{className:"h-3 w-3 ml-auto"})]}),n&&e.jsx("div",{className:"mt-3 space-y-3",children:c?e.jsxs("div",{className:"space-y-2",children:[e.jsx(ot,{className:"h-4 w-full"}),e.jsx(ot,{className:"h-4 w-3/4"}),e.jsx(ot,{className:"h-4 w-1/2"})]}):i&&i.length>0?e.jsxs("div",{className:"space-y-3 p-3 bg-muted/30 rounded-md",children:[e.jsxs("div",{className:"grid grid-cols-3 gap-3 text-xs",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-[10px] text-muted-foreground",children:"Total Cost"}),e.jsxs("p",{className:"text-foreground font-semibold tabular-nums","data-testid":`text-total-cost-${t}`,children:["$",d.toFixed(4)," ",i[0]?.currency||"USDC"]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-[10px] text-muted-foreground",children:"Transactions"}),e.jsx("p",{className:"text-foreground font-medium","data-testid":`text-tx-count-${t}`,children:i.length})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-[10px] text-muted-foreground",children:"Settlement"}),e.jsx("p",{className:"text-foreground font-medium","data-testid":`text-settlement-status-${t}`,children:m===i.length?"Fully Settled":f>0?`${f} Pending`:`${x} Batched`})]})]}),s&&e.jsxs("div",{className:"flex items-center gap-2 p-2 bg-muted/50 rounded-md",children:[e.jsx(US,{className:"h-3 w-3 text-muted-foreground shrink-0"}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("p",{className:"text-[10px] text-muted-foreground",children:"Batch Settlement ID"}),e.jsx("p",{className:"text-xs font-mono text-foreground truncate","data-testid":`text-batch-id-${t}`,children:s})]}),e.jsx(ml,{text:s,label:"batch-id"})]}),e.jsxs("div",{className:"border-t border-border/30 pt-2",children:[e.jsx("p",{className:"text-[10px] font-medium text-muted-foreground uppercase tracking-wider mb-2",children:"Transaction Log"}),e.jsx("div",{className:"space-y-1.5 max-h-48 overflow-y-auto",children:i.map(v=>{const y=c0[v.status]||c0.pending;return e.jsxs("div",{className:"flex items-center justify-between gap-2 text-xs","data-testid":`row-nanopayment-${v.id}`,children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx("div",{className:re("h-1.5 w-1.5 rounded-full shrink-0",{"bg-amber-500":v.status==="pending","bg-blue-500":v.status==="batched","bg-green-500":v.status==="settled","bg-red-500":v.status==="failed"})}),e.jsxs("span",{className:"text-foreground tabular-nums font-mono",children:["$",v.amount.toFixed(4)]}),e.jsx(Y,{variant:"secondary",className:re("text-[9px]",y.color),children:y.label})]}),e.jsx("span",{className:"text-muted-foreground text-[10px] shrink-0 tabular-nums",children:v.createdAt?new Date(v.createdAt).toLocaleStr
84ing(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):"â"})]},v.id)})})]}),m===i.length&&i.length>0&&e.jsxs("div",{className:"flex items-center gap-1.5 pt-1",children:[e.jsx(tt,{className:"h-3 w-3 text-green-500"}),e.jsx("span",{className:"text-[10px] text-green-600 dark:text-green-400 font-medium",children:"All nanopayments settled on-chain"})]})]}):e.jsx("p",{className:"text-xs text-muted-foreground",children:"No nanopayment transactions recorded"})})]})}const VT={slack:ho,github:Qn,"google-sheets":Jy,notion:Hy,test:Bi},d0={success:{label:"Success",color:"bg-green-500/10 text-green-600 dark:text-green-400 border-green-500/20"},error:{label:"Error",color:"bg-red-500/10 text-red-600 dark:text-red-400 border-red-500/20"},blocked:{label:"Blocked",color:"bg-amber-500/10 text-amber-600 dark:text-amber-400 border-amber-500/20"},rate_limited:{label:"Rate Limited",color:"bg-orange-500/10 text-orange-600 dark:text-orange-400 border-orange-500/20"}};function zT({jobId:t,maxCalls:s}){const[n,o]=p.useState(!1),i=s||50,{data:c,isLoading:d}=He({queryKey:["/api/tools/proxy-calls",t],queryFn:()=>fetch(`/api/tools/proxy-calls/${t}`).then(b=>b.json()),enabled:n}),m=c?.length||0,f=c?.filter(b=>b.status==="success").length||0,x=c?.filter(b=>b.status==="error").length||0,v=c?.filter(b=>b.status==="blocked"||b.status==="rate_limited").length||0,y=Math.min(m/i*100,100);return e.jsxs("div",{className:"border-t border-border/50 pt-3","data-testid":`tool-actions-panel-${t}`,children:[e.jsxs("button",{onClick:()=>o(!n),className:"flex items-center gap-1.5 text-[10px] font-medium text-muted-foreground uppercase tracking-wider hover:text-foreground transition-colors w-full","data-testid":`button-toggle-tool-actions-${t}`,children:[e.jsx(Gs,{className:"h-3 w-3"}),"Tool Actions",n?e.jsx(Ar,{className:"h-3 w-3 ml-auto"}):e.jsx(Cs,{className:"h-3 w-3 ml-auto"})]}),n&&e.jsx("div",{className:"mt-3 space-y-3",children:d?e.jsxs("div",{className:"space-y-2",children:[e.jsx(ot,{className:"h-4 w-full"}),e.jsx(ot,{className:"h-4 w-3/4"}),e.jsx(ot,{className:"h-4 w-1/2"})]}):c&&c.length>0?e.jsxs("div",{className:"space-y-3 p-3 bg-muted/30 rounded-md",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2 text-xs",children:[e.jsx("span",{className:"text-muted-foreground",children:"Calls Used"}),e.jsxs("span",{className:"text-foreground font-semibold tabular-nums","data-testid":`text-calls-usage-${t}`,children:[m," / ",i]})]}),e.jsx(rp,{value:y,className:"h-1.5","data-testid":`progress-calls-${t}`})]}),e.jsxs("div",{className:"grid grid-cols-3 gap-3 text-xs",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-[10px] text-muted-foreground",children:"Successful"}),e.jsx("p",{className:"text-green-600 dark:text-green-400 font-semibold tabular-nums","data-testid":`text-success-count-${t}`,children:f})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-[10px] text-muted-foreground",children:"Errors"}),e.jsx("p",{className:"text-red-600 dark:text-red-400 font-semibold tabular-nums","data-testid":`text-error-count-${t}`,children:x})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-[10px] text-muted-foreground",children:"Blocked"}),e.jsx("p",{className:"text-amber-600 dark:text-amber-400 font-semibold tabular-nums","data-testid":`text-blocked-count-${t}`,children:v})]})]}),e.jsxs("div",{className:"border-t border-border/30 pt-2",children:[e.jsx("p",{className:"text-[10px] font-medium text-muted-foreground uppercase tracking-wider mb-2",children:"Action Log"}),e.jsx("div",{className:"space-y-1.5 max-h-48 overflow-y-auto",children:c.map(b=>{const k=d0[b.status]||d0.error,S=VT[b.service.toLowerCase()]||Gs,j=b.status==="blocked"||b.status==="rate_limited";return e.jsxs("div",{className:re("flex items-center justify-between gap-2 text-xs p-1.5 rounded-md",j?"bg-amber-500/5":""),"data-testid":`row-tool-call-${b.id}`,children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx(S,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"}),e.jsx("span",{className:"text-foreground font-medium truncate",children:b.action}),e.jsxs(Y,{variant:"secondary",className:re("text-[9px]",k.color),children:[j&&e.jsx(NS,{className:"h-2.5 w-2.5 mr-0.5"}),k.label]})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[b.responseTimeMs!==null&&b.responseTimeMs!==void 0&&e.jsxs("span",{className:"text-muted-foreground text-[10px] tabular-nums","data-testid":`text-response-time-${b.id}`,children:[b.responseTimeMs,"ms"]}),e.jsx("span",{className:"text-muted-foreground text-[10px] tabular-nums",children:b.timestamp?new Date(b.timestamp).toLocaleStr
84ing(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):"â"})]})]},b.id)})})]}),v>0&&e.jsxs("div",{className:"flex items-center gap-1.5 pt-1",children:[e.jsx(ln,{className:"h-3 w-3 text-amber-500"}),e.jsxs("span",{className:"text-[10px] text-amber-600 dark:text-amber-400 font-medium",children:[v," call",v>1?"s":""," blocked or rate-limited"]})]}),m>=i&&e.jsxs("div",{className:"flex items-center gap-1.5 pt-1",children:[e.jsx(ks,{className:"h-3 w-3 text-red-500"}),e.jsxs("span",{className:"text-[10px] text-red-600 dark:text-red-400 font-medium",children:["Call limit reached (",i," max)"]})]})]}):e.jsx("p",{className:"text-xs text-muted-foreground",children:"No tool proxy calls recorded"})})]})}function BT({jobId:t}){const[s,n]=p.useState(!1),{data:o,isLoading:i}=He({queryKey:["/api/jobs",t,"audit-chain"],queryFn:async()=>{const d=await fetch(`/api/jobs/${t}/audit-chain`,{credentials:"include"});return d.ok?d.json():null},enabled:s}),c=d=>d?`${d.slice(0,10)}...${d.slice(-6)}`:"â";return e.jsxs("div",{className:"border-t border-border/50 pt-3","data-testid":`audit-chain-panel-${t}`,children:[e.jsxs("button",{onClick:()=>n(!s),className:"flex items-center gap-1.5 text-[10px] font-medium text-muted-foreground uppercase tracking-wider hover:text-foreground transition-colors w-full","data-testid":`button-toggle-audit-chain-${t}`,children:[e.jsx(Ui,{className:"h-3 w-3"}),"Cryptographic Audit Chain",s?e.jsx(Ar,{className:"h-3 w-3 ml-auto"}):e.jsx(Cs,{className:"h-3 w-3 ml-auto"})]}),s&&e.jsx("div",{className:"mt-3 space-y-3",children:i?e.jsxs("div",{className:"space-y-2",children:[e.jsx(ot,{className:"h-4 w-full"}),e.jsx(ot,{className:"h-4 w-3/4"})]}):o?e.jsxs("div",{className:"space-y-3 p-3 bg-muted/30 rounded-md",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[o.chainIntegrity.valid?e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(Es,{className:"h-4 w-4 text-green-500"}),e.jsx("span",{className:"text-xs font-semibold text-green-600 dark:text-green-400","data-testid":`text-chain-status-${t}`,children:"Chain Verified"})]}):e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(ln,{className:"h-4 w-4 text-red-500"}),e.jsxs("span",{className:"text-xs font-semibold text-red-600 dark:text-red-400","data-testid":`text-chain-status-${t}`,children:["Chain Broken at #",o.chainIntegrity.brokenAt]})]}),e.jsx(Y,{variant:"secondary",className:re("text-[9px] ml-auto",o.auditRootStatus==="valid"?"text-green-600 dark:text-green-400":o.auditRootStatus==="invalid"?"text-red-600 dark:text-red-400":o.auditRootStatus==="error"?"text-amber-600 dark:text-amber-400":"text-muted-foreground"),children:o.auditRootStatus==="valid"?"Root Valid":o.auditRootStatus==="invalid"?"Root Tampered":o.auditRootStatus==="error"?"Root Error":"Root Pending"})]}),e.jsxs("div",{className:"space-y-2 text-xs",children:[e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsxs("span",{className:"text-muted-foreground flex items-center gap-1",children:[e.jsx(nn,{className:"h-3 w-3"})," Delegation"]}),e.jsx("code",{className:"text-[10px] font-mono text-foreground bg-muted px-1.5 py-0.5 rounded","data-testid":`text-delegation-hash-${t}`,children:c(o.delegationHash)})]}),e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsxs("span",{className:"text-muted-foreground flex items-center gap-1",children:[e.jsx(nn,{className:"h-3 w-3"})," Task"]}),e.jsx("code",{className:"text-[10px] font-mono text-foreground bg-muted px-1.5 py-0.5 rounded","data-testid":`text-task-hash-${t}`,children:c(o.taskHash)})]}),e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsxs("span",{className:"text-muted-foreground flex items-center gap-1",children:[e.jsx(nn,{className:"h-3 w-3"})," Merkle Root"]}),e.jsx("code",{className:"text-[10px] font-mono text-foreground bg-muted px-1.5 py-0.5 rounded","data-testid":`text-merkle-root-${t}`,children:c(o.merkleRoot)})]}),e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsxs("span",{className:"text-muted-foreground flex items-center gap-1",children:[e.jsx(Ui,{className:"h-3 w-3"})," Audit Root"]}),e.jsx("code",{className:"text-[10px] font-mono text-foreground bg-muted px-1.5 py-0.5 rounded","data-testid":`text-audit-root-${t}`,children:c(o.auditRootHash)})]}),e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsxs("span",{className:"text-muted-foreground flex items-center gap-1",children:[e.jsx(nn,{className:"h-3 w-3"})," Deliverable"]}),e.jsx("code",{className:"text-[10px] font-mono text-foreground bg-muted px-1.5 py-0.5 rounded","data-testid":`text-deliverable-hash-${t}`,children:c(o.deliverableHash)})]})]}),o.calls.length>0&&e.jsxs("div",{className:"border-t border-border/30 pt-2",children:[e.jsxs("p",{className:"text-[10px] font-medium text-muted-foreground uppercase tracking-wider mb-2",children:["Hash Chain (",o.totalCalls," links)"]}),e.jsx("div",{className:"space-y-1 max-h-40 overflow-y-auto",children:o.calls.map((d,m)=>e.jsxs("div",{className:"flex items-center gap-1.5 text-[10px] font-mono","data-testid":`row-hash-chain-${m}`,children:[e.jsx("span",{className:"text-muted-foreground w-4 text-right tabular-nums",children:d.sequenceNum}),e.jsx(al,{className:"h-2.5 w-2.5 text-muted-foreground shrink-0"}),e.jsx("span",{className:"text-foreground truncate",children:d.callHash?d.callHash.slice(0,18)+"...":"â"}),e.jsxs(Y,{variant:"secondary",className:re("text-[8px] ml-auto shrink-0",d.status==="success"?"text-green-600":d.status==="error"?"text-red-600":"text-amber-600"),children:[d.service,"/",d.action]})]},m))})]})]}):e.jsx("p",{className:"text-xs text-muted-foreground",children:"No audit chain data available"})})]})}function UT({job:t}){const s=!!t.circlePaymentId||!!t.nanopaymentsBatchId;if(t.paymentMethod==="USDC_SEPOLIA"||!!t.sepoliaPaymentTxHash){const o=e.jsxs(Y,{variant:"secondary",className:"text-[10px] bg-blue-500/10 text-blue-600 dar
84k:text-blue-400 border-blue-500/20","data-testid":`badge-payment-sepolia-${t.id}`,children:[e.jsx(qn,{className:"h-3 w-3 mr-0.5"}),"Sepolia USDC Escrow"]});return t.sepoliaPaymentTxHash?e.jsx("a",{href:`https://sepolia.etherscan.io/tx/${t.sepoliaPaymentTxHash}`,target:"_blank",rel:"noopener noreferrer","data-testid":`link-sepolia-etherscan-${t.id}`,children:o}):o}return s?e.jsxs(Y,{variant:"secondary",className:"text-[10px] bg-emerald-500/10 text-emerald-600 dark:text-emerald-400 border-emerald-500/20","data-testid":`badge-payment-circle-${t.id}`,children:[e.jsx(qn,{className:"h-3 w-3 mr-0.5"}),"Circle Nanopayments"]}):e.jsxs(Y,{variant:"secondary",className:"text-[10px] bg-slate-500/10 text-slate-600 dark:text-slate-400 border-slate-500/20","data-testid":`badge-payment-escrow-${t.id}`,children:[e.jsx(Ss,{className:"h-3 w-3 mr-0.5"}),"USDC Escrow"]})}function HT({type:t}){switch(t){case"text":return e.jsx(QS,{className:"h-3.5 w-3.5 text-blue-500"});case"link":return e.jsx(an,{className:"h-3.5 w-3.5 text-emerald-500"});case"file_reference":return e.jsx(IS,{className:"h-3.5 w-3.5 text-violet-500"});case"inline_data":return e.jsx(Qn,{className:"h-3.5 w-3.5 text-amber-500"});default:return e.jsx(hh,{className:"h-3.5 w-3.5 text-muted-foreground"})}}function WT({attachments:t}){const[s,n]=p.useState(!1);return!t||t.length===0?null:e.jsxs("div",{className:"border-t border-border/50 pt-3","data-testid":"context-attachments-section",children:[e.jsxs("button",{onClick:()=>n(!s),className:"flex items-center gap-1.5 text-[10px] font-medium text-muted-foreground uppercase tracking-wider hover:text-foreground transition-colors w-full","data-testid":"button-toggle-context",children:[e.jsx(hh,{className:"h-3 w-3"}),"Context (",t.length,")",s?e.jsx(Ar,{className:"h-3 w-3 ml-auto"}):e.jsx(Cs,{className:"h-3 w-3 ml-auto"})]}),s&&e.jsx("div",{className:"mt-3 space-y-3",children:t.map((o,i)=>e.jsxs("div",{className:"p-3 bg-muted/30 rounded-md space-y-1.5","data-testid":`context-attachment-${i}`,children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(HT,{type:o.type}),e.jsx("span",{className:"text-xs font-medium text-foreground",children:o.name}),e.jsx(Y,{variant:"secondary",className:"text-[9px] ml-auto",children:o.type==="file_reference"?"File":o.type==="inline_data"?"Data":o.type==="link"?"Link":"Text"}),o.mimeType&&e.jsx(Y,{variant:"outline",className:"text-[9px]",children:o.mimeType})]}),o.description&&e.jsx("p",{className:"text-[11px] text-muted-foreground",children:o.description}),o.type==="text"&&e.jsx("div",{className:"p-2 bg-muted/50 rounded-md",children:e.jsx("p",{className:"text-xs text-foreground whitespace-pre-wrap leading-relaxed",children:o.content})}),o.type==="link"&&e.jsxs("a",{href:o.content,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1.5 text-xs text-blue-600 dark:text-blue-400 hover:underline","data-testid":`link-attachment-${i}`,children:[e.jsx(wt,{className:"h-3 w-3 shrink-0"}),e.jsx("span",{className:"truncate",children:o.content})]}),o.type==="file_reference"&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("p",{className:"text-xs font-mono text-foreground truncate flex-1",children:o.content}),e.jsx(ml,{text:o.content,label:`file-ref-${i}`}),(o.content.startsWith("http")||o.content.startsWith("ipfs://"))&&e.jsx("a",{href:o.content.startsWith("ipfs://")?`https://ipfs.io/ipfs/${o.content.replace("ipfs://","")}`:o.content,target:"_blank",rel:"noopener noreferrer",children:e.jsx(ie,{size:"icon",variant:"ghost","data-testid":`button-open-file-ref-${i}`,children:e.jsx(wt,{className:"h-3 w-3"})})})]}),o.type==="inline_data"&&e.jsx("div",{className:"p-2 bg-muted/50 rounded-md overflow-x-auto",children:e.jsx("pre",{className:"text-[10px] font-mono text-foreground",children:o.content.length>200?o.content.slice(0,200)+"...":o.content})}),o.size!==void 0&&o.size>0&&e.jsxs("p",{className:"text-[10px] text-muted-foreground",children:["Size: ",o.size<1024?`${o.size} B`:o.size<1048576?`${(o.size/1024).toFixed(1)} KB`:`${(o.size/1048576).toFixed(1)} MB`]})]},i))})]})}function KT({job:t}){const{session:s}=fr(),{toast:n}=Yt(),o=s.authenticated&&s.address&&t.buyerAddress&&s.address.toLowerCase()===t.buyerAddress.toLowerCase(),i=Ut({mutationFn:()=>dt("PATCH",`/api/jobs/${t.id}/status`,{status:"completed"}),onSuccess:()=>
84{ct.invalidateQueries({queryKey:["/api/jobs"]}),n({title:"Deliverable approved",description:`Job #${t.id} marked as completed.`})},onError:d=>{n({title:"Approval failed",description:d?.message||"Could not approve deliverable.",variant:"destructive"})}}),c=Ut({mutationFn:()=>dt("PATCH",`/api/jobs/${t.id}/status`,{status:"rejected"}),onSuccess:()=>{ct.invalidateQueries({queryKey:["/api/jobs"]}),n({title:"Deliverable rejected",description:`Job #${t.id} has been rejected.`,variant:"destructive"})},onError:d=>{n({title:"Rejection failed",description:d?.message||"Could not reject deliverable.",variant:"destructive"})}});return t.status!=="submitted"||!o?null:e.jsxs("div",{className:"border-t border-border/50 pt-3",children:[e.jsx("p",{className:"text-[10px] font-medium text-muted-foreground uppercase tracking-wider mb-2",children:"Buyer Review"}),e.jsxs("div",{className:"p-3 bg-amber-500/5 border border-amber-500/20 rounded-md space-y-2",children:[e.jsxs("p",{className:"text-xs text-amber-600 dark:text-amber-400 font-medium flex items-center gap-1.5",children:[e.jsx(ks,{className:"h-3 w-3 shrink-0"}),"Deliverable submitted â awaiting your approval"]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(ie,{size:"sm",variant:"outline",className:"flex-1 h-8 text-xs border-green-500/30 text-green-600 dark:text-green-400 hover:bg-green-500/10 hover:border-green-500/50",onClick:()=>i.mutate(),disabled:i.isPending||c.isPending,"data-testid":`button-approve-job-${t.id}`,children:[i.isPending?e.jsx(Ge,{className:"h-3.5 w-3.5 animate-spin mr-1.5"}):e.jsx(Qc,{className:"h-3.5 w-3.5 mr-1.5"}),"Approve"]}),e.jsxs(ie,{size:"sm",variant:"outline",className:"flex-1 h-8 text-xs border-red-500/30 text-red-600 dark:text-red-400 hover:bg-red-500/10 hover:border-red-500/50",onClick:()=>c.mutate(),disabled:i.isPending||c.isPending,"data-testid":`button-reject-job-${t.id}`,children:[c.isPending?e.jsx(Ge,{className:"h-3.5 w-3.5 animate-spin mr-1.5"}):e.jsx(Sf,{className:"h-3.5 w-3.5 mr-1.5"}),"Reject"]})]})]})]})}function qT({job:t,agent:s,gateApprovals:n}){const o=bo[t.status]||bo.open,i=n?.filter(d=>d.status==="pending")||[],c=t.executionMode==="always_on";return e.jsx(ue,{className:"border-card-border","data-testid":`card-job-${t.id}`,children:e.jsxs(me,{className:"p-5 space-y-4",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1 flex-wrap",children:[e.jsxs("h3",{className:"font-semibold text-foreground text-sm","data-testid":`text-job-title-${t.id}`,children:["Job #",t.id]}),e.jsx(Y,{variant:"secondary",className:re("text-[10px]",o.color),"data-testid":`badge-job-status-${t.id}`,children:o.label}),e.jsxs(Y,{variant:"secondary",className:re("text-[10px]",c?"bg-violet-500/10 text-violet-600 dark:text-violet-400 border-violet-500/20":"bg-slate-500/10 text-slate-600 dark:text-slate-400 border-slate-500/20"),"data-testid":`badge-execution-mode-${t.id}`,children:[c?e.jsx(ht,{className:"h-3 w-3 mr-0.5"}):e.jsx(wo,{className:"h-3 w-3 mr-0.5"}),c?"Instant":"Manual"]}),e.jsx(UT,{job:t}),i.length>0&&e.jsxs(Y,{variant:"secondary",className:"text-[10px] bg-amber-500/10 text-amber-600 dark:text-amber-400 border-amber-500/20",children:[e.jsx(ks,{className:"h-3 w-3 mr-0.5"}),i.length," gate",i.length>1?"s":""," pending"]})]}),e.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2 leading-relaxed","data-testid":`text-job-desc-${t.id}`,children:t.taskDescription})]}),s&&e.jsx(kt,{href:`/agent/${s.chain}/${s.id}`,children:e.jsxs("div",{className:"flex items-center gap-2 shrink-0 text-xs text-muted-foreground hover-elevate rounded-md p-1.5",children:[e.jsx("div",{className:"w-7 h-7 rounded-md overflow-hidden bg-muted",children:e.jsx("img",{src:s.imageUrl||"/images/agent-dataforge.svg",alt:s.name,className:"w-full h-full object-cover"})}),e.jsx("span",{className:"font-medium text-foreground",children:s.name})]})})]}),e.jsx(FT,{job:t}),e.jsx(ST,{currentStatus:t.status,executionMode:t.executionMode}),e.jsxs("div",{className:"flex items-center gap-4 text-xs text-muted-foreground flex-wrap",children:[t.escrowAmount!==null&&t.escrowAmount!==void 0&&t.escrowAmount>0&&e.jsxs("span",{className:"flex items-center gap-1","data-testid":`text-escrow-${t.id}`,children:[e.jsx(Ss,{className:"h-3 w-3"}),t.escrowAmount," ",t.escrowToken||"USDC"]}),(t.evaluatorAddress||t.evaluatorType)&&e.jsxs("span",{className:"flex items-center gap-1","data-testid":`text-evaluator-${t.id}`,children:[e.jsx(Ct,{className:"h-3 w-3"}),t.evaluatorType==="ai_agent"?"AI Agent":t.evaluatorType==="smart_contract_zk"?"ZK Contract":t.evaluatorType==="multisig_dao"?"Multisig/DAO":"Self",t.evaluatorAddress?`: ${t.evaluatorAddress.slice(0,6)}...${t.evaluatorAddress.slice(-4)}`:""]}),t.paymentMethod&&e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(ht,{className:"h-3 w-3"}),t.paymentMethod]}),t.expiresAt&&e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Fr,{className:"h-3 w-3"}),"Expires: ",new Date(t.expiresAt).toLocaleDateString()]})]}),t.stepResults&&Array.isArray(t.stepResults)&&t.stepResults.length>0&&e.jsxs("div",{className:"border-t border-border/50 pt-3",children:[e.jsx("p",{className:"text-[10px] font-medium text-muted-foreground uppercase tracking-wider mb-2",children:"Step Results"}),e.jsx(ET,{steps:t.stepResults})]}),e.jsx(IT,{job:t}),e.jsx(KT,{job:t}),t.contextAttachments&&Array.isArray(t.contextAttachments)&&t.contextAttachments.length>0&&e.jsx(WT,{attachments:t.contextAttachments}
84),t.connectedServicesSnapshot&&Array.isArray(t.connectedServicesSnapshot)&&t.connectedServicesSnapshot.length>0&&e.jsxs("div",{className:"border-t border-border/50 pt-3",children:[e.jsx("p",{className:"text-[10px] font-medium text-muted-foreground uppercase tracking-wider mb-2",children:"Connected Services"}),e.jsx("div",{className:"flex gap-1 flex-wrap",children:t.connectedServicesSnapshot.map(d=>e.jsx(Y,{variant:"secondary",className:"text-[10px]",children:d},d))})]}),t.selectedTools&&Array.isArray(t.selectedTools)&&t.selectedTools.length>0&&e.jsx("div",{className:"flex gap-1 flex-wrap",children:t.selectedTools.map(d=>e.jsx(Y,{variant:"outline",className:"text-[10px]",children:d},d))}),e.jsx(zT,{jobId:t.id}),e.jsx(BT,{jobId:t.id}),(t.circlePaymentId||t.nanopaymentsBatchId||t.paymentMethod==="circle_nanopayments")&&e.jsx($T,{jobId:t.id,batchId:t.nanopaymentsBatchId}),e.jsx(LT,{jobId:t.id})]})})}function ZT(){const{data:t,isLoading:s}=He({queryKey:["/api/jobs"]}),{data:n}=He({queryKey:["/api/agents",{limit:200}],queryFn:()=>fetch("/api/agents?limit=200").then(f=>f.json())}),o=n?.agents,{data:i}=He({queryKey:["/api/gate-approvals"]}),c=o?.reduce((f,x)=>(f[x.id]=x,f),{})||{},d=i?.reduce((f,x)=>(f[x.jobId]||(f[x.jobId]=[]),f[x.jobId].push(x),f),{})||{},m=t?.reduce((f,x)=>(f[x.status]=(f[x.status]||0)+1,f),{})||{};return e.jsxs("div",{className:"min-h-screen",children:[e.jsx("div",{className:"border-b border-border bg-card/30",children:e.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 py-8",children:[e.jsxs("div",{className:"flex items-start justify-between gap-4 flex-wrap",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-3xl font-bold text-foreground mb-2","data-testid":"text-jobs-title",children:"Jobs"}),e.jsx("p",{className:"text-muted-foreground",children:"ERC-8183 Agentic Commerce job lifecycle: Client / Provider / Evaluator roles with escrow payments"})]}),e.jsx(kt,{href:"/hire",children:e.jsxs(ie,{className:"gap-2","data-testid":"button-hire-agent",children:[e.jsx(Hc,{className:"h-4 w-4"}),"Hire an Agent"]})})]}),e.jsxs("div",{className:"flex items-center gap-2 mt-4 flex-wrap",children:[Object.entries(m).map(([f,x])=>{const v=bo[f];return v?e.jsxs(Y,{variant:"secondary",className:re("text-[10px]",v.color),"data-testid":`badge-count-${f}`,children:[v.label,": ",x]},f):null}),e.jsxs(Y,{variant:"outline",className:"text-xs",children:[t?.length||0," total jobs"]})]})]})}),e.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 py-8",children:s?e.jsx("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4",children:Array.from({length:4}).map((f,x)=>e.jsx(ot,{className:"h-48 rounded-xl"},x))}):t&&t.length>0?e.jsx("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4","data-testid":"jobs-grid",children:t.map(f=>e.jsx(qT,{job:f,agent:c[f.agentId],gateApprovals:d[f.id]},f.id))}):e.jsxs("div",{className:"text-center py-20","data-testid":"empty-state",children:[e.jsx(Hc,{className:"h-12 w-12 text-muted-foreground/40 mx-auto mb-4"}),e.jsx("h3",{className:"text-lg font-medium text-foreground mb-1",children:"No jobs yet"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:"Hire an agent to create your first job"}),e.jsx(kt,{href:"/hire",children:e.jsxs(ie,{className:"gap-2","data-testid":"button-hire-first",children:[e.jsx(lr,{className:"h-4 w-4"}),"Hire an Agent"]})})]})})]})}const GT="modulepreload",QT=function(t){return"/"+t},u0={},md=function(s,n,o){let i=Promise.resolve();if(n&&n.length>0){let f=function(x){return Promise.all(x.map(v=>Promise.resolve(v).then(y=>({status:"fulfilled",value:y}),y=>({status:"rejected",reason:y}))))};document.getElementsByTagName("link");const d=document.querySelector("meta[property=csp-nonce]"),m=d?.nonce||d?.getAttribute("nonce");i=f(n.map(x=>{if(x=QT(x),x in u0)return;u0[x]=!0;const v=x.endsWith(".css"),y=v?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${x}"]${y}`))return;const b=document.createElement("link");if(b.rel=v?"stylesheet":GT,v||(b.as="script"),b.crossOrigin="",b.href=x,m&&b.setAttribute("nonce",m),document.head.appendChild(b),v)return new Promise((k,S)=>{b.addEventListener("load",k),b.addEventListener("error",()=>S(new Error(`Unable to preload CSS for ${x}`)))})}))}function c(d){const m=new Event("vite:preloadError",{cancelable:!0});if(m.payload=d,window.dispatchEvent(m),!m.defaultPrevented)throw d}return i.then(d=>{for(const m of d||[])m.status==="rejected"&&c(m.reason);return s().catch(c)})};var fl=t=>t.type==="checkbox",Na=t=>t instanceof Date,Ns=t=>t==null;const E1=t=>typeof t=="object";var Ht=t=>!Ns(t)&&!Array.isArray(t)&&E1(t)&&!Na(t),_1=t=>Ht(t)&&t.target?fl(t.target)?t.target.checked:t.target.value:t,YT=t=>t.substring(0,t.search(/\.\d+(\.|$)/))||t,A1=(t,s)=>t.has(YT(s)),JT=t=>{const s=t.constructor&&t.constructor.prototype;return Ht(s)&&s.hasOwnProperty("isPrototypeOf")},np=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function os(t){let s;const n=Array.isArray(t),o=typeof FileList<"u"?t instanceof FileList:!1;if(t instanceof Date)s=new Date(t);else if(t instanceof Set)s=new Set(t);else if(!(np&&(t instanceof Blob||o))&&(n||Ht(t)))if(s=n?[]:{},!n&&!JT(t))s=t;else for(const i in t)t.hasOwnProperty(i)&&(s[i]=os(t[i]));else return t;return s}var Gd=t=>Array.isArray(t)?t.filter(Boolean):[],Bt=t=>t===void 0,Se=(t,s,n)=>{if(!s||!Ht(t))return n;const o=Gd(s.split(/[,[\].]+?/)).reduce((i,c)=>Ns(i)?i:i[c],t);return Bt(o)||o===t?Bt(t[s])?n:t[s]:o},Bs=t=>typeof t=="boolean",ap=t=>/^\w*$/.test(t),T1=t=>Gd(t.replace(/["|']|\]/g,"").split(/\.|\[/)),bt=(t,s,n)=>{let o=-1;const i=ap(s)?[s]:T1(s),c=i.length,d=c-1;for(;++o<c;){const m=i[o];let f=n;if(o!==d){const x=t[m];f=Ht(x)||Array.isArray(x)?x:isNaN(+i[o+1])?{}:[]}if(m==="__proto__"||m==="constructor"||m==="prototype")return;t[m]=f,t=t[m]}};const fd={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},kr={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},rn={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},R1=We.createContext(null),Qd=()=>We.useContext(R1),XT=t=>{const{children:s,...n}=t;return We.createElement(R1.Provider,{value:n},s)};var P1=(t,s,n,o=!0)=>{const i={defaultValues:s._defaultValues};for(const c in t)Object.defineProperty(i,c,{get:()=>{const d=c;return s._proxyFormState[d]!==kr.all&&(s._proxyFormState[d]=!o||kr.all),n&&(n[d]=!0),t[d]}});return i};function eR(t){const s=Qd(),{control:n=s.control,disabled:o,name:i,exact:c}=t||{},[d,m]=We.useState(n._formState),f=We.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1}),x=We.useRef(i);return x.current=i,We.useEffect(()=>n._subscribe({name:x.current,formState:f.current,exact:c,callback:v=>{!o&&m({...n._formState,...v})}}
84),[n,o,c]),We.useEffect(()=>{f.current.isValid&&n._setValid(!0)},[n]),We.useMemo(()=>P1(d,n,f.current,!1),[d,n])}var Lr=t=>typeof t=="string",M1=(t,s,n,o,i)=>Lr(t)?(o&&s.watch.add(t),Se(n,t,i)):Array.isArray(t)?t.map(c=>(o&&s.watch.add(c),Se(n,c))):(o&&(s.watchAll=!0),n);function tR(t){const s=Qd(),{control:n=s.control,name:o,defaultValue:i,disabled:c,exact:d}=t||{},m=We.useRef(o),f=We.useRef(i);m.current=o,We.useEffect(()=>n._subscribe({name:m.current,formState:{values:!0},exact:d,callback:y=>!c&&v(M1(m.current,n._names,y.values||n._formValues,!1,f.current))}),[n,c,d]);const[x,v]=We.useState(n._getWatch(o,i));return We.useEffect(()=>n._removeUnmounted()),x}function sR(t){const s=Qd(),{name:n,disabled:o,control:i=s.control,shouldUnregister:c}=t,d=A1(i._names.array,n),m=tR({control:i,name:n,defaultValue:Se(i._formValues,n,Se(i._defaultValues,n,t.defaultValue)),exact:!0}),f=eR({control:i,name:n,exact:!0}),x=We.useRef(t),v=We.useRef(i.register(n,{...t.rules,value:m,...Bs(t.disabled)?{disabled:t.disabled}:{}})),y=We.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!Se(f.errors,n)},isDirty:{enumerable:!0,get:()=>!!Se(f.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!Se(f.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!Se(f.validatingFields,n)},error:{enumerable:!0,get:()=>Se(f.errors,n)}}),[f,n]),b=We.useCallback(w=>v.current.onChange({target:{value:_1(w),name:n},type:fd.CHANGE}),[n]),k=We.useCallback(()=>v.current.onBlur({target:{value:Se(i._formValues,n),name:n},type:fd.BLUR}),[n,i._formValues]),S=We.useCallback(w=>{const E=Se(i._fields,n);E&&w&&(E._f.ref={focus:()=>w.focus(),select:()=>w.select(),setCustomValidity:C=>w.setCustomValidity(C),reportValidity:()=>w.reportValidity()})},[i._fields,n]),j=We.useMemo(()=>({name:n,value:m,...Bs(o)||f.disabled?{disabled:f.disabled||o}:{},onChange:b,onBlur:k,ref:S}),[n,o,f.disabled,b,k,S,m]);return We.useEffect(()=>{const w=i._options.shouldUnregister||c;i.register(n,{...x.current.rules,...Bs(x.current.disabled)?{disabled:x.current.disabled}:{}});const E=(C,A)=>{const _=Se(i._fields,C);_&&_._f&&(_._f.mount=A)};if(E(n,!0),w){const C=os(Se(i._options.defaultValues,n));bt(i._defaultValues,n,C),Bt(Se(i._formValues,n))&&bt(i._formValues,n,C)}return!d&&i.register(n),()=>{(d?w&&!i._state.action:w)?i.unregister(n):E(n,!1)}},[n,i,d,c]),We.useEffect(()=>{i._setDisabledField({disabled:o,name:n})},[o,n,i]),We.useMemo(()=>({field:j,formState:f,fieldState:y}),[j,f,y])}const rR=t=>t.render(sR(t));var I1=(t,s,n,o,i)=>s?{...n[t],types:{...n[t]&&n[t].types?n[t].types:{},[o]:i||!0}}:{},$i=t=>Array.isArray(t)?t:[t],m0=()=>{let t=[];return{get observers(){return t},next:i=>{for(const c of t)c.next&&c.next(i)},subscribe:i=>(t.push(i),{unsubscribe:()=>{t=t.filter(c=>c!==i)}}),unsubscribe:()=>{t=[]}}},Hf=t=>Ns(t)||!E1(t);function Hn(t,s){if(Hf(t)||Hf(s))return t===s;if(Na(t)&&Na(s))return t.getTime()===s.getTime();const n=Object.keys(t),o=Object.keys(s);if(n.length!==o.length)return!1;for(const i of n){const c=t[i];if(!o.includes(i))return!1;if(i!=="ref"){const d=s[i];if(Na(c)&&Na(d)||Ht(c)&&Ht(d)||Array.isArray(c)&&Array.isArray(d)?!Hn(c,d):c!==d)return!1}}return!0}var bs=t=>Ht(t)&&!Object.keys(t).length,op=t=>t.type==="file",Cr=t=>typeof t=="function",hd=t=>{if(!np)return!1;const s=t?t.ownerDocument:0;return t instanceof(s&&s.defaultView?s.defaultView.HTMLElement:HTMLElement)},D1=t=>t.type==="select-multiple",ip=t=>t.type==="radio",nR=t=>ip(t)||fl(t),lf=t=>hd(t)&&t.isConnected;function aR(t,s){const n=s.slice(0,-1).length;let o=0;for(;o<n;)t=Bt(t)?o++:t[s[o++]];return t}function oR(t){for(const s in t)if(t.hasOwnProperty(s)&&!Bt(t[s]))return!1;return!0}function Gt(t,s){const n=Array.isArray(s)?s:ap(s)?[s]:T1(s),o=n.length===1?t:aR(t,n),i=n.length-1,c=n[i];return o&&delete o[c],i!==0&&(Ht(o)&&bs(o)||Array.isArray(o)&&oR(o))&&Gt(t,n.slice(0,-1)),t}var O1=t=>{for(const s in t)if(Cr(t[s]))return!0;return!1};function pd(t,s={}){const n=Array.isArray(t);if(Ht(t)||n)for(const o in t)Array.isArray(t[o])||Ht(t[o])&&!O1(t[o])?(s[o]=Array.isArray(t[o])?[]:{},pd(t[o],s[o])):Ns(t[o])||(s[o]=!0);return s}function L1(t,s,n){const o=Array.isArray(t);if(Ht(t)||o)for(const i in t)Array.isArray(t[i])||Ht(t[i])&&!O1(t[i])?Bt(s)||Hf(n[i])?n[i]=Array.isArray(t[i])?pd(t[i],[]):{...pd(t[i])}:L1(t[i],Ns(s)?{}:s[i],n[i]):n[i]=!Hn(t[i],s[i]);return n}var Pi=(t,s)=>L1(t,s,pd(s));const f0={value:!1,isValid:!1},h0={value:!0,isValid:!0};var F1=t=>{if(Array.isArray(t)){if(t.length>1){const s=t.filter(n=>n&&n.checked&&!n.disabled).map(n=>n.value);return{value:s,isValid:!!s.length}}return t[0].checked&&!t[0].disabled?t[0].attributes&&!Bt(t[0].attributes.value)?Bt(t[0].value)||t[0].value===""?h0:{value:t[0].value,isValid:!0}:h0:f0}return f0},$1=(t,{valueAsNumber:s,valueAsDate:n,setValueAs:o})=>Bt(t)?t:s?t===""?NaN:t&&+t:n&&Lr(t)?new Date(t):o?o(t):t;const p0={isValid:!1,value:null};var V1=t=>Array.isArray(t)?t.reduce((s,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:s,p0):p0;function x0(t){const s=t.ref;return op(s)?s.files:ip(s)?V1(t.refs).value:D1(s)?[...s.selectedOptions].map(({value:n})=>n):fl(s)?F1(t.refs).value:$1(Bt(s.value)?t.ref.value:s.value,t)}var iR=(t,s,n,o)=>{const i={};for(const c of t){const d=Se(s,c);d&&bt(i,c,d._f)}return{criteriaMode:n,names:[...t],fields:i,shouldUseNativeValidation:o}},xd=t=>t instanceof RegExp,Mi=t=>Bt(t)?t:xd(t)?t.source:Ht(t)?xd(t.value)?t.value.source:t.value:t,g0=t=>({isOnSubmit:!t||t===kr.onSubmit,isOnBlur:t===kr.onBlur,isOnChange:t===kr.onChange,isOnAll:t===kr.all,isOnTouch:t===kr.onTouched});const v0="AsyncFunction";var lR=t=>!!t&&!!t.validate&&!!(Cr(t.validate)&&t.validate.constructor.name===v0||Ht(t.validate)&&Object.values(t.validate).find(s=>s.constructor.name===v0)),cR=t=>t.mount&&(t.required||t.min||t.max||t.maxLength||t.minLength||t.pattern||t.validate),y0=(t,s,n)=>!n&&(s.watchAll||s.watch.has(t)||[...s.watch].some(o=>t.startsWith(o)&&/^\.\w+/.test(t.slice(o.length))));const Vi=(t,s,n,o)=>{for(const i of n||Object.keys(t)){const c=Se(t,i);if(c){const{_f:d,...m}=c;if(d){if(d.refs&&d.refs[0]&&s(d.refs[0],i)&&!o)return!0;
vendor: 4,157 bytes, line 84
84if(d.ref&&s(d.ref,d.name)&&!o)return!0;if(Vi(m,s))break}else if(Ht(m)&&Vi(m,s))break}}};function b0(t,s,n){const o=Se(t,n);if(o||ap(n))return{error:o,name:n};const i=n.split(".");for(;i.length;){const c=i.join("."),d=Se(s,c),m=Se(t,c);if(d&&!Array.isArray(d)&&n!==c)return{name:n};if(m&&m.type)return{name:c,error:m};i.pop()}return{name:n}}var dR=(t,s,n,o)=>{n(t);const{name:i,...c}=t;return bs(c)||Object.keys(c).length>=Object.keys(s).length||Object.keys(c).find(d=>s[d]===(!o||kr.all))},uR=(t,s,n)=>!t||!s||t===s||$i(t).some(o=>o&&(n?o===s:o.startsWith(s)||s.startsWith(o))),mR=(t,s,n,o,i)=>i.isOnAll?!1:!n&&i.isOnTouch?!(s||t):(n?o.isOnBlur:i.isOnBlur)?!t:(n?o.isOnChange:i.isOnChange)?t:!0,fR=(t,s)=>!Gd(Se(t,s)).length&&Gt(t,s),hR=(t,s,n)=>{const o=$i(Se(t,n));return bt(o,"root",s[n]),bt(t,n,o),t},zc=t=>Lr(t);function j0(t,s,n="validate"){if(zc(t)||Array.isArray(t)&&t.every(zc)||Bs(t)&&!t)return{type:n,message:zc(t)?t:"",ref:s}}var co=t=>Ht(t)&&!xd(t)?t:{value:t,message:""},w0=async(t,s,n,o,i,c)=>{const{ref:d,refs:m,required:f,maxLength:x,minLength:v,min:y,max:b,pattern:k,validate:S,name:j,valueAsNumber:w,mount:E}=t._f,C=Se(n,j);if(!E||s.has(j))return{};const A=m?m[0]:d,_=ee=>{i&&A.reportValidity&&(A.setCustomValidity(Bs(ee)?"":ee||""),A.reportValidity())},D={},O=ip(d),F=fl(d),P=O||F,Z=(w||op(d))&&Bt(d.value)&&Bt(C)||hd(d)&&d.value===""||C===""||Array.isArray(C)&&!C.length,z=I1.bind(null,j,o,D),te=(ee,se,I,le=rn.maxLength,ne=rn.minLength)=>{const J=ee?se:I;D[j]={type:ee?le:ne,message:J,ref:d,...z(ee?le:ne,J)}};if(c?!Array.isArray(C)||!C.length:f&&(!P&&(Z||Ns(C))||Bs(C)&&!C||F&&!F1(m).isValid||O&&!V1(m).isValid)){const{value:ee,message:se}=zc(f)?{value:!!f,message:f}:co(f);if(ee&&(D[j]={type:rn.required,message:se,ref:A,...z(rn.required,se)},!o))return _(se),D}if(!Z&&(!Ns(y)||!Ns(b))){let ee,se;const I=co(b),le=co(y);if(!Ns(C)&&!isNaN(C)){const ne=d.valueAsNumber||C&&+C;Ns(I.value)||(ee=ne>I.value),Ns(le.value)||(se=ne<le.value)}else{const ne=d.valueAsDate||new Date(C),J=V=>new Date(new Date().toDateString()+" "+V),U=d.type=="time",q=d.type=="week";Lr(I.value)&&C&&(ee=U?J(C)>J(I.value):q?C>I.value:ne>new Date(I.value)),Lr(le.value)&&C&&(se=U?J(C)<J(le.value):q?C<le.value:ne<new Date(le.value))}if((ee||se)&&(te(!!ee,I.message,le.message,rn.max,rn.min),!o))return _(D[j].message),D}if((x||v)&&!Z&&(Lr(C)||c&&Array.isArray(C))){const ee=co(x),se=co(v),I=!Ns(ee.value)&&C.length>+ee.value,le=!Ns(se.value)&&C.length<+se.value;if((I||le)&&(te(I,ee.message,se.message),!o))return _(D[j].message),D}if(k&&!Z&&Lr(C)){const{value:ee,message:se}=co(k);if(xd(ee)&&!C.match(ee)&&(D[j]={type:rn.pattern,message:se,ref:d,...z(rn.pattern,se)},!o))return _(se),D}if(S){if(Cr(S)){const ee=await S(C,n),se=j0(ee,A);if(se&&(D[j]={...se,...z(rn.validate,se.message)},!o))return _(se.message),D}else if(Ht(S)){let ee={};for(const se in S){if(!bs(ee)&&!o)break;const I=j0(await S[se](C,n),A,se);I&&(ee={...I,...z(se,I.message)},_(I.message),o&&(D[j]=ee))}if(!bs(ee)&&(D[j]={ref:A,...ee},!o))return D}}return _(!0),D};const pR={mode:kr.onSubmit,reValidateMode:kr.onChange,shouldFocusError:!0};function xR(t={}){let s={...pR,...t},n={submitCount:0,isDirty:!1,isLoading:Cr(s.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:s.errors||{},disabled:s.disabled||!1};const o={};let i=Ht(s.defaultValues)||Ht(s.values)?os(s.values||s.defaultValues)||{}:{},c=s.shouldUnregister?{}:os(i),d={action:!1,mount:!1,watch:!1},m={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},f,x=0;const v={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1};let y={...v};const b={array:m0(),state:m0()},k=g0(s.mode),S=g0(s.reValidateMode),j=s.criteriaMode===kr.all,w=M=>W=>{clearTimeout(x),x=setTimeout(M,W)},E=async M=>{if(!s.disabled&&(v.isValid||y.isValid||M)){const W=s.resolver?bs((await Z()).errors):await te(o,!0);W!==n.isValid&&b.state.next({isValid:W})}},C=(M,W)=>{!s.disabled&&(v.isValidating||v.validatingFields||y.isValidating||y.validatingFields)&&((M||Array.from(m.mount)).forEac
vendor: 5,294 bytes, line 84
84h(X=>{X&&(W?bt(n.validatingFields,X,W):Gt(n.validatingFields,X))}),b.state.next({validatingFields:n.validatingFields,isValidating:!bs(n.validatingFields)}))},A=(M,W=[],X,ge,xe=!0,oe=!0)=>{if(ge&&X&&!s.disabled){if(d.action=!0,oe&&Array.isArray(Se(o,M))){const Ce=X(Se(o,M),ge.argA,ge.argB);xe&&bt(o,M,Ce)}if(oe&&Array.isArray(Se(n.errors,M))){const Ce=X(Se(n.errors,M),ge.argA,ge.argB);xe&&bt(n.errors,M,Ce),fR(n.errors,M)}if((v.touchedFields||y.touchedFields)&&oe&&Array.isArray(Se(n.touchedFields,M))){const Ce=X(Se(n.touchedFields,M),ge.argA,ge.argB);xe&&bt(n.touchedFields,M,Ce)}(v.dirtyFields||y.dirtyFields)&&(n.dirtyFields=Pi(i,c)),b.state.next({name:M,isDirty:se(M,W),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else bt(c,M,W)},_=(M,W)=>{bt(n.errors,M,W),b.state.next({errors:n.errors})},D=M=>{n.errors=M,b.state.next({errors:n.errors,isValid:!1})},O=(M,W,X,ge)=>{const xe=Se(o,M);if(xe){const oe=Se(c,M,Bt(X)?Se(i,M):X);Bt(oe)||ge&&ge.defaultChecked||W?bt(c,M,W?oe:x0(xe._f)):ne(M,oe),d.mount&&E()}},F=(M,W,X,ge,xe)=>{let oe=!1,Ce=!1;const Je={name:M};if(!s.disabled){if(!X||ge){(v.isDirty||y.isDirty)&&(Ce=n.isDirty,n.isDirty=Je.isDirty=se(),oe=Ce!==Je.isDirty);const at=Hn(Se(i,M),W);Ce=!!Se(n.dirtyFields,M),at?Gt(n.dirtyFields,M):bt(n.dirtyFields,M,!0),Je.dirtyFields=n.dirtyFields,oe=oe||(v.dirtyFields||y.dirtyFields)&&Ce!==!at}if(X){const at=Se(n.touchedFields,M);at||(bt(n.touchedFields,M,X),Je.touchedFields=n.touchedFields,oe=oe||(v.touchedFields||y.touchedFields)&&at!==X)}oe&&xe&&b.state.next(Je)}return oe?Je:{}},P=(M,W,X,ge)=>{const xe=Se(n.errors,M),oe=(v.isValid||y.isValid)&&Bs(W)&&n.isValid!==W;if(s.delayError&&X?(f=w(()=>_(M,X)),f(s.delayError)):(clearTimeout(x),f=null,X?bt(n.errors,M,X):Gt(n.errors,M)),(X?!Hn(xe,X):xe)||!bs(ge)||oe){const Ce={...ge,...oe&&Bs(W)?{isValid:W}:{},errors:n.errors,name:M};n={...n,...Ce},b.state.next(Ce)}},Z=async M=>{C(M,!0);const W=await s.resolver(c,s.context,iR(M||m.mount,o,s.criteriaMode,s.shouldUseNativeValidation));return C(M),W},z=async M=>{const{errors:W}=await Z(M);if(M)for(const X of M){const ge=Se(W,X);ge?bt(n.errors,X,ge):Gt(n.errors,X)}else n.errors=W;return W},te=async(M,W,X={valid:!0})=>{for(const ge in M){const xe=M[ge];if(xe){const{_f:oe,...Ce}=xe;if(oe){const Je=m.array.has(oe.name),at=xe._f&&lR(xe._f);at&&v.validatingFields&&C([ge],!0);const Nt=await w0(xe,m.disabled,c,j,s.shouldUseNativeValidation&&!W,Je);if(at&&v.validatingFields&&C([ge]),Nt[oe.name]&&(X.valid=!1,W))break;!W&&(Se(Nt,oe.name)?Je?hR(n.errors,Nt,oe.name):bt(n.errors,oe.name,Nt[oe.name]):Gt(n.errors,oe.name))}!bs(Ce)&&await te(Ce,W,X)}}return X.valid},ee=()=>{for(const M of m.unMount){const W=Se(o,M);W&&(W._f.refs?W._f.refs.every(X=>!lf(X)):!lf(W._f.ref))&&$e(M)}m.unMount=new Set},se=(M,W)=>!s.disabled&&(M&&W&&bt(c,M,W),!Hn(Q(),i)),I=(M,W,X)=>M1(M,m,{...d.mount?c:Bt(W)?i:Lr(M)?{[M]:W}:W},X,W),le=M=>Gd(Se(d.mount?c:i,M,s.shouldUnregister?Se(i,M,[]):[])),ne=(M,W,X={})=>{const ge=Se(o,M);let xe=W;if(ge){const oe=ge._f;oe&&(!oe.disabled&&bt(c,M,$1(W,oe)),xe=hd(oe.ref)&&Ns(W)?"":W,D1(oe.ref)?[...oe.ref.options].forEach(Ce=>Ce.selected=xe.includes(Ce.value)):oe.refs?fl(oe.ref)?oe.refs.length>1?oe.refs.forEach(Ce=>(!Ce.defaultChecked||!Ce.disabled)&&(Ce.checked=Array.isArray(xe)?!!xe.find(Je=>Je===Ce.value):xe===Ce.value)):oe.refs[0]&&(oe.refs[0].checked=!!xe):oe.refs.forEach(Ce=>Ce.checked=Ce.value===xe):op(oe.ref)?oe.ref.value="":(oe.ref.value=xe,oe.ref.type||b.state.next({name:M,values:os(c)})))}(X.shouldDirty||X.shouldTouch)&&F(M,xe,X.shouldTouch,X.shouldDirty,!0),X.shouldValidate&&R(M)},J=(M,W,X)=>{for(const ge in W){const xe=W[ge],oe=`${M}.${ge}`,Ce=Se(o,oe);(m.array.has(M)||Ht(xe)||Ce&&!Ce._f)&&!Na(xe)?J(oe,xe,X):ne(oe,xe,X)}},U=(M,W,X={})=>{const ge=Se(o,M),xe=m.array.has(M),oe=os(W);bt(c,M,oe),xe?(b.array.next({name:M,values:os(c)}),(v.isDirty||v.dirtyFields||y.isDirty||y.dirtyFields)&&X.shouldDirty&&b.state.next({name:M,dirtyFields:Pi(i,c),isDirty:se(M,oe)})):ge&&!ge._f&&!Ns(oe)?J(M,oe,X):ne(M,oe,X),y0(M,m)&&b.state.next({...n}),b.state.next({name:d.mount?M:void 0,values:os(c)})},q=async M=>{d.mount=!0;const W=M.target;let X=W.name,ge=!0;const xe=Se(o,X),oe=Ce=>{ge=Number.isNaN(Ce)||Na(Ce)&&isNaN(Ce.getTime())||Hn(Ce,Se(c,X,Ce))};if(xe){let Ce,Je;const at=W.type?x0(xe._f):_1(M),Nt=M.type===fd.BLUR||M.type===fd.FOCUS_OUT,gs=!cR(xe._f)&&!s.resolver&&!Se(n.errors,X)&&!xe._f.deps||mR(Nt,Se(n.touchedFields,X),n.isSubmitted,S,k),As=y0(X,m,Nt);bt(c,X,at),Nt?(xe._f.onBlur&&xe._f.onBlur(M),f&&f(0)):xe._f.onChange&&xe._f.onChange(M);const mn=F(X,at,Nt),ia=!bs(mn)||As;if(!Nt&&b.state.next({name:X,type:M.type,values:os(c)}),gs)return(v.isValid||y.isValid)&&(s.mode==="onBlur"?Nt&&E():Nt||E()),ia&&b.state.next({name:X,...As?{}:mn});if(!Nt&&As&&b.state.next({...n}),s.resolver){const{errors:fn}=await Z([X]);if(oe(at),ge){const la=b0(n.errors,o,X),hn=b0(fn,o,la.name||X);Ce=hn.error,X=hn.name,Je=bs(fn)}}else C([X],!0),Ce=(await w0(xe,m.disabled,c,j,s.shouldUseNativeValidation))[X],C([X]),oe(at),ge&&(Ce?Je=!1:(v.isValid||y.isValid)&&(Je=await te(o,!0)));ge&&(xe._f.deps&&R(xe._f.deps),P(X,Je,Ce,mn))}},V=(M,W)=>{if(Se(n.errors,W)&&M.focus)return M.focus(),1},R=async(M,W={})=>{let X,ge;const xe=$i(M);if(s.resolver){const oe=await z(Bt(M)?M:xe);X=bs(oe),ge=M?!xe.some(Ce=>Se(oe,Ce)):X}
vendor: 4,136 bytes, line 84
84else M?(ge=(await Promise.all(xe.map(async oe=>{const Ce=Se(o,oe);return await te(Ce&&Ce._f?{[oe]:Ce}:Ce)}))).every(Boolean),!(!ge&&!n.isValid)&&E()):ge=X=await te(o);return b.state.next({...!Lr(M)||(v.isValid||y.isValid)&&X!==n.isValid?{}:{name:M},...s.resolver||!M?{isValid:X}:{},errors:n.errors}),W.shouldFocus&&!ge&&Vi(o,V,M?xe:m.mount),ge},Q=M=>{const W={...d.mount?c:i};return Bt(M)?W:Lr(M)?Se(W,M):M.map(X=>Se(W,X))},Ne=(M,W)=>({invalid:!!Se((W||n).errors,M),isDirty:!!Se((W||n).dirtyFields,M),error:Se((W||n).errors,M),isValidating:!!Se(n.validatingFields,M),isTouched:!!Se((W||n).touchedFields,M)}),Pe=M=>{M&&$i(M).forEach(W=>Gt(n.errors,W)),b.state.next({errors:M?n.errors:{}})},ze=(M,W,X)=>{const ge=(Se(o,M,{_f:{}})._f||{}).ref,xe=Se(n.errors,M)||{},{ref:oe,message:Ce,type:Je,...at}=xe;bt(n.errors,M,{...at,...W,ref:ge}),b.state.next({name:M,errors:n.errors,isValid:!1}),X&&X.shouldFocus&&ge&&ge.focus&&ge.focus()},Ve=(M,W)=>Cr(M)?b.state.subscribe({next:X=>M(I(void 0,W),X)}):I(M,W,!0),fe=M=>b.state.subscribe({next:W=>{uR(M.name,W.name,M.exact)&&dR(W,M.formState||v,Jt,M.reRenderRoot)&&M.callback({values:{...c},...n,...W})}}).unsubscribe,De=M=>(d.mount=!0,y={...y,...M.formState},fe({...M,formState:y})),$e=(M,W={})=>{for(const X of M?$i(M):m.mount)m.mount.delete(X),m.array.delete(X),W.keepValue||(Gt(o,X),Gt(c,X)),!W.keepError&&Gt(n.errors,X),!W.keepDirty&&Gt(n.dirtyFields,X),!W.keepTouched&&Gt(n.touchedFields,X),!W.keepIsValidating&&Gt(n.validatingFields,X),!s.shouldUnregister&&!W.keepDefaultValue&&Gt(i,X);b.state.next({values:os(c)}),b.state.next({...n,...W.keepDirty?{isDirty:se()}:{}}),!W.keepIsValid&&E()},qe=({disabled:M,name:W})=>{(Bs(M)&&d.mount||M||m.disabled.has(W))&&(M?m.disabled.add(W):m.disabled.delete(W))},pe=(M,W={})=>{let X=Se(o,M);const ge=Bs(W.disabled)||Bs(s.disabled);return bt(o,M,{...X||{},_f:{...X&&X._f?X._f:{ref:{name:M}},name:M,mount:!0,...W}}),m.mount.add(M),X?qe({disabled:Bs(W.disabled)?W.disabled:s.disabled,name:M}):O(M,!0,W.value),{...ge?{disabled:W.disabled||s.disabled}:{},...s.progressive?{required:!!W.required,min:Mi(W.min),max:Mi(W.max),minLength:Mi(W.minLength),maxLength:Mi(W.maxLength),pattern:Mi(W.pattern)}:{},name:M,onChange:q,onBlur:q,ref:xe=>{if(xe){pe(M,W),X=Se(o,M);const oe=Bt(xe.value)&&xe.querySelectorAll&&xe.querySelectorAll("input,select,textarea")[0]||xe,Ce=nR(oe),Je=X._f.refs||[];if(Ce?Je.find(at=>at===oe):oe===X._f.ref)return;bt(o,M,{_f:{...X._f,...Ce?{refs:[...Je.filter(lf),oe,...Array.isArray(Se(i,M))?[{}]:[]],ref:{type:oe.type,name:M}}:{ref:oe}}}),O(M,!1,void 0,oe)}else X=Se(o,M,{}),X._f&&(X._f.mount=!1),(s.shouldUnregister||W.shouldUnregister)&&!(A1(m.array,M)&&d.action)&&m.unMount.add(M)}}},je=()=>s.shouldFocusError&&Vi(o,V,m.mount),we=M=>{Bs(M)&&(b.state.next({disabled:M}),Vi(o,(W,X)=>{const ge=Se(o,X);ge&&(W.disabled=ge._f.disabled||M,Array.isArray(ge._f.refs)&&ge._f.refs.forEach(xe=>{xe.disabled=ge._f.disabled||M}))},0,!1))},Ee=(M,W)=>async X=>{let ge;X&&(X.preventDefault&&X.preventDefault(),X.persist&&X.persist());let xe=os(c);if(b.state.next({isSubmitting:!0}),s.resolver){const{errors:oe,values:Ce}=await Z();n.errors=oe,xe=Ce}else await te(o);if(m.disabled.size)for(const oe of m.disabled)bt(xe,oe,void 0);if(Gt(n.errors,"root"),bs(n.errors)){b.state.next({errors:{}});try{await M(xe,X)}catch(oe){ge=oe}}else W&&await W({...n.errors},X),je(),setTimeout(je);if(b.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:bs(n.errors)&&!ge,submitCount:n.submitCount+1,errors:n.errors}),ge)throw ge},Ze=(M,W={})=>{Se(o,M)&&(Bt(W.defaultValue)?U(M,os(Se(i,M))):(U(M,W.defaultValue),bt(i,M,os(W.defaultValue))),W.keepTouched||Gt(n.touchedFields,M),W.keepDirty||(Gt(n.dirtyFields,M),n.isDirty=W.defaultValue?se(M,os(Se(i,M))):se()),W.keepError||(Gt(n.errors,M),v.isValid&&E()),b.state.next({...n}))},it=(M,W={})=>{const X=M?os(M):i,ge=os(X),xe=bs(M),oe=xe?i:ge;if(W.keepDefaultValues||(i=X),!W.keepValues){if(W.keepDirtyValues){const Ce=new Set([...m.mount,...Object.keys(Pi(i,c))]);for(const Je of Array.from(Ce))Se(n.dirtyFields,Je)?bt(oe,Je,Se(c,Je)):U(Je,Se(oe,Je))}else{if(np&&Bt(M))for(const Ce of m.mount){const Je=Se(o,Ce);
84if(Je&&Je._f){const at=Array.isArray(Je._f.refs)?Je._f.refs[0]:Je._f.ref;if(hd(at)){const Nt=at.closest("form");if(Nt){Nt.reset();break}}}}for(const Ce of m.mount)U(Ce,Se(oe,Ce))}c=os(oe),b.array.next({values:{...oe}}),b.state.next({values:{...oe}})}m={mount:W.keepDirtyValues?m.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},d.mount=!v.isValid||!!W.keepIsValid||!!W.keepDirtyValues,d.watch=!!s.shouldUnregister,b.state.next({submitCount:W.keepSubmitCount?n.submitCount:0,isDirty:xe?!1:W.keepDirty?n.isDirty:!!(W.keepDefaultValues&&!Hn(M,i)),isSubmitted:W.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:xe?{}:W.keepDirtyValues?W.keepDefaultValues&&c?Pi(i,c):n.dirtyFields:W.keepDefaultValues&&M?Pi(i,M):W.keepDirty?n.dirtyFields:{},touchedFields:W.keepTouched?n.touchedFields:{},errors:W.keepErrors?n.errors:{},isSubmitSuccessful:W.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1})},yt=(M,W)=>it(Cr(M)?M(c):M,W),Ot=(M,W={})=>{const X=Se(o,M),ge=X&&X._f;if(ge){const xe=ge.refs?ge.refs[0]:ge.ref;xe.focus&&(xe.focus(),W.shouldSelect&&Cr(xe.select)&&xe.select())}},Jt=M=>{n={...n,...M}},Mt={control:{register:pe,unregister:$e,getFieldState:Ne,handleSubmit:Ee,setError:ze,_subscribe:fe,_runSchema:Z,_getWatch:I,_getDirty:se,_setValid:E,_setFieldArray:A,_setDisabledField:qe,_setErrors:D,_getFieldArray:le,_reset:it,_resetDefaultValues:()=>Cr(s.defaultValues)&&s.defaultValues().then(M=>{yt(M,s.resetOptions),b.state.next({isLoading:!1})}),_removeUnmounted:ee,_disableForm:we,_subjects:b,_proxyFormState:v,get _fields(){return o},get _formValues(){return c},get _state(){return d},set _state(M){d=M},get _defaultValues(){return i},get _names(){return m},set _names(M){m=M},get _formState(){return n},get _options(){return s},set _options(M){s={...s,...M}}},subscribe:De,trigger:R,register:pe,handleSubmit:Ee,watch:Ve,setValue:U,getValues:Q,reset:yt,resetField:Ze,clearErrors:Pe,unregister:$e,setError:ze,setFocus:Ot,getFieldState:Ne};return{...Mt,formControl:Mt}}function z1(t={}){const s=We.useRef(void 0),n=We.useRef(void 0),[o,i]=We.useState({isDirty:!1,isValidating:!1,isLoading:Cr(t.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1,defaultValues:Cr(t.defaultValues)?void 0:t.defaultValues});s.current||(s.current={...t.formControl?t.formControl:xR(t),formState:o},t.formControl&&t.defaultValues&&!Cr(t.defaultValues)&&t.formControl.reset(t.defaultValues,t.resetOptions));const c=s.current.control;return c._options=t,We.useLayoutEffect(()=>c._subscribe({formState:c._proxyFormState,callback:()=>i({...c._formState}),reRenderRoot:!0}),[c]),We.useEffect(()=>c._disableForm(t.disabled),[c,t.disabled]),We.useEffect(()=>{if(c._proxyFormState.isDirty){const d=c._getDirty();d!==o.isDirty&&c._subjects.state.next({isDirty:d})}},[c,o.isDirty]),We.useEffect(()=>{t.values&&!Hn(t.values,n.current)?(c._reset(t.values,c._options.resetOptions),n.current=t.values,i(d=>({...d}))):c._resetDefaultValues()},[t.values,c]),We.useEffect(()=>{t.errors&&!bs(t.errors)&&c._setErrors(t.errors)},[t.errors,c]),We.useEffect(()=>{c._state.mount||(c._setValid(),c._state.mount=!0),c._state.watch&&(c._state.watch=!1,c._subjects.state.next({...c._formState})),c._removeUnmounted()}),We.useEffect(()=>{t.shouldUnregister&&c._subjects.state.next({values:c._getWatch()})},[t.shouldUnregister,c]),s.current.formState=P1(o,c),s.current}const N0=(t,s,n)=>{if(t&&"reportValidity"in t){const o=Se(n,s);t.setCustomValidity(o&&o.message||""),t.reportValidity()}},B1=(t,s)=>{for(const n in s.fields){const o=s.fields[n];o&&o.ref&&"reportValidity"in o.ref?N0(o.ref,n,t):o.refs&&o.refs.forEach(i=>N0(i,n,t))}},gR=(t,s)=>{s.shouldUseNativeValidation&&B1(t,s);const n={};for(const o in t){const i=Se(s.fields,o),c=Object.assign(t[o]||{},{ref:i&&i.ref});if(vR(s.names||Object.keys(t),o)){const d=Object.assign({},Se(n,o));bt(d,"root",c),bt(n,o,d)}else bt(n,o,c)}return n},vR=(t,s)=>t.some(n=>n.startsWith(s+"."));var yR=function(t,s){for(var n={};t.length;){var o=t[0],i=o.code,c=o.message,d=o.path.join(".");if(!n[d])if("unionErrors"in o){var m=o.unionErrors[0].errors[0];n[d]={message:m.message,type:m.code}}else n[d]={message:c,type:i};
84if("unionErrors"in o&&o.unionErrors.forEach(function(v){return v.errors.forEach(function(y){return t.push(y)})}),s){var f=n[d].types,x=f&&f[o.code];n[d]=I1(d,s,n,i,x?[].concat(x,o.message):o.message)}t.shift()}return n},U1=function(t,s,n){return n===void 0&&(n={}),function(o,i,c){try{return Promise.resolve((function(d,m){try{var f=Promise.resolve(t[n.mode==="sync"?"parse":"parseAsync"](o,s)).then(function(x){return c.shouldUseNativeValidation&&B1({},c),{errors:{},values:n.raw?o:x}})}catch(x){return m(x)}return f&&f.then?f.then(void 0,m):f})(0,function(d){if((function(m){return Array.isArray(m?.errors)})(d))return{values:{},errors:gR(yR(d.errors,!c.shouldUseNativeValidation&&c.criteriaMode==="all"),c)};throw d}))}catch(d){return Promise.reject(d)}}},gt;(function(t){t.assertEqual=i=>{};function s(i){}t.assertIs=s;function n(i){throw new Error}t.assertNever=n,t.arrayToEnum=i=>{const c={};for(const d of i)c[d]=d;return c},t.getValidEnumValues=i=>{const c=t.objectKeys(i).filter(m=>typeof i[i[m]]!="number"),d={};for(const m of c)d[m]=i[m];return t.objectValues(d)},t.objectValues=i=>t.objectKeys(i).map(function(c){return i[c]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const c=[];for(const d in i)Object.prototype.hasOwnProperty.call(i,d)&&c.push(d);return c},t.find=(i,c)=>{for(const d of i)if(c(d))return d},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&Number.isFinite(i)&&Math.floor(i)===i;function o(i,c=" | "){return i.map(d=>typeof d=="string"?`'${d}'`:d).join(c)}t.joinValues=o,t.jsonStringifyReplacer=(i,c)=>typeof c=="bigint"?c.toString():c})(gt||(gt={}));var k0;(function(t){t.mergeShapes=(s,n)=>({...s,...n})})(k0||(k0={}));const Ie=gt.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Un=t=>{switch(typeof t){case"undefined":return Ie.undefined;case"string":return Ie.string;case"number":return Number.isNaN(t)?Ie.nan:Ie.number;case"boolean":return Ie.boolean;case"function":return Ie.function;case"bigint":return Ie.bigint;case"symbol":return Ie.symbol;case"object":return Array.isArray(t)?Ie.array:t===null?Ie.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?Ie.promise:typeof Map<"u"&&t instanceof Map?Ie.map:typeof Set<"u"&&t instanceof Set?Ie.set:typeof Date<"u"&&t instanceof Date?Ie.date:Ie.object;default:return Ie.unknown}}
vendor: 39,484 bytes, line 84
84,ye=gt.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 un extends Error{get errors(){return this.issues}constructor(s){super(),this.issues=[],this.addIssue=o=>{this.issues=[...this.issues,o]},this.addIssues=(o=[])=>{this.issues=[...this.issues,...o]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=s}format(s){const n=s||function(c){return c.message},o={_errors:[]},i=c=>{for(const d of c.issues)if(d.code==="invalid_union")d.unionErrors.map(i);else if(d.code==="invalid_return_type")i(d.returnTypeError);else if(d.code==="invalid_arguments")i(d.argumentsError);else if(d.path.length===0)o._errors.push(n(d));else{let m=o,f=0;for(;f<d.path.length;){const x=d.path[f];f===d.path.length-1?(m[x]=m[x]||{_errors:[]},m[x]._errors.push(n(d))):m[x]=m[x]||{_errors:[]},m=m[x],f++}}};return i(this),o}static assert(s){if(!(s instanceof un))throw new Error(`Not a ZodError: ${s}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,gt.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(s=n=>n.message){const n={},o=[];for(const i of this.issues)if(i.path.length>0){const c=i.path[0];n[c]=n[c]||[],n[c].push(s(i))}else o.push(s(i));return{formErrors:o,fieldErrors:n}}get formErrors(){return this.flatten()}}un.create=t=>new un(t);const Wf=(t,s)=>{let n;switch(t.code){case ye.invalid_type:t.received===Ie.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case ye.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,gt.jsonStringifyReplacer)}`;break;case ye.unrecognized_keys:n=`Unrecognized key(s) in object: ${gt.joinValues(t.keys,", ")}`;break;case ye.invalid_union:n="Invalid input";break;case ye.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${gt.joinValues(t.options)}`;break;case ye.invalid_enum_value:n=`Invalid enum value. Expected ${gt.joinValues(t.options)}, received '${t.received}'`;break;case ye.invalid_arguments:n="Invalid function arguments";break;case ye.invalid_return_type:n="Invalid function return type";break;case ye.invalid_date:n="Invalid date";break;case ye.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:gt.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case ye.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case ye.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case ye.custom:n="Invalid input";break;case ye.invalid_intersection_types:n="Intersection results could not be merged";break;case ye.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case ye.not_finite:n="Number must be finite";break;default:n=s.defaultError,gt.assertNever(t)}return{message:n}};let bR=Wf;function jR(){return bR}const wR=t=>{const{data:s,path:n,errorMaps:o,issueData:i}=t,c=[...n,...i.path||[]],d={...i,path:c};if(i.message!==void 0)return{...i,path:c,message:i.message};let m="";const f=o.filter(x=>!!x).slice().reverse();for(const x of f)m=x(d,{data:s,defaultError:m}).message;return{...i,path:c,message:m}};function Ae(t,s){const n=jR(),o=wR({issueData:s,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===Wf?void 0:Wf].filter(i=>!!i)});t.common.issues.push(o)}class Qs{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(s,n){const o=[];for(const i of n){if(i.status==="aborted")return Qe;i.status==="dirty"&&s.dirty(),o.push(i.value)}return{status:s.value,value:o}}static async mergeObjectAsync(s,n){const o=[];for(const i of n){const c=await i.key,d=await i.value;o.push({key:c,value:d})}return Qs.mergeObjectSync(s,o)}static mergeObjectSync(s,n){const o={};for(const i of n){const{key:c,value:d}=i;if(c.status==="aborted"||d.status==="aborted")return Qe;c.status==="dirty"&&s.dirty(),d.status==="dirty"&&s.dirty(),c.value!=="__proto__"&&(typeof d.value<"u"||i.alwaysSet)&&(o[c.value]=d.value)}return{status:s.value,value:o}}}const Qe=Object.freeze({status:"aborted"}),Li=t=>({status:"dirty",value:t}),hr=t=>({status:"valid",value:t}),C0=t=>t.status==="aborted",S0=t=>t.status==="dirty",Co=t=>t.status==="valid",gd=t=>typeof Promise<"u"&&t instanceof Promise;var Le;(function(t){t.errToObj=s=>typeof s=="string"?{message:s}:s||{},t.toString=s=>typeof s=="string"?s:s?.message})(Le||(Le={}));class ra{constructor(s,n,o,i){this._cachedPath=[],this.parent=s,this.data=n,this._path=o,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 E0=(t,s)=>{if(Co(s))return{success:!0,data:s.value};if(!t.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 un(t.common.issues);return this._error=n,this._error}}};function rt(t){if(!t)return{};const{errorMap:s,invalid_type_error:n,required_error:o,description:i}=t;if(s&&(n||o))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return s?{errorMap:s,description:i}:{errorMap:(d,m)=>{const{message:f}=t;return d.code==="invalid_enum_value"?{message:f??m.defaultError}:typeof m.data>"u"?{message:f??o??m.defaultError}:d.code!=="invalid_type"?{message:m.defaultError}:{message:f??n??m.defaultError}},description:i}}class pt{get description(){return this._def.description}_getType(s){return Un(s.data)}_getOrReturnCtx(s,n){return n||{common:s.parent.common,data:s.data,parsedType:Un(s.data),schemaErrorMap:this._def.errorMap,path:s.path,parent:s.parent}}_processInputParams(s){return{status:new Qs,ctx:{common:s.parent.common,data:s.data,parsedType:Un(s.data),schemaErrorMap:this._def.errorMap,path:s.path,parent:s.parent}}}_parseSync(s){const n=this._parse(s);if(gd(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(s){const n=this._parse(s);return Promise.resolve(n)}parse(s,n){const o=this.safeParse(s,n);if(o.success)return o.data;throw o.error}safeParse(s,n){const o={common:{issues:[],async:n?.async??!1,contextualErrorMap:n?.errorMap},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:s,parsedType:Un(s)},i=this._parseSync({data:s,path:o.path,parent:o});return E0(o,i)}"~validate"(s){const n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:s,parsedType:Un(s)};if(!this["~standard"].async)try{const o=this._parseSync({data:s,path:[],parent:n});return Co(o)?{value:o.value}:{issues:n.common.issues}}catch(o){o?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:s,path:[],parent:n}).then(o=>Co(o)?{value:o.value}:{issues:n.common.issues})}async parseAsync(s,n){const o=await this.safeParseAsync(s,n);if(o.success)return o.data;throw o.error}async safeParseAsync(s,n){const o={common:{issues:[],contextualErrorMap:n?.errorMap,async:!0},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:s,parsedType:Un(s)},i=this._parse({data:s,path:o.path,parent:o}),c=await(gd(i)?i:Promise.resolve(i));return E0(o,c)}refine(s,n){const o=i=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(i):n;return this._refinement((i,c)=>{const d=s(i),m=()=>c.addIssue({code:ye.custom,...o(i)});return typeof Promise<"u"&&d instanceof Promise?d.then(f=>f?!0:(m(),!1)):d?!0:(m(),!1)})}refinement(s,n){return this._refinement((o,i)=>s(o)?!0:(i.addIssue(typeof n=="function"?n(o,i):n),!1))}_refinement(s){return new _o({schema:this,typeName:Ye.ZodEffects,effect:{type:"refinement",refinement:s}})}superRefine(s){return this._refinement(s)}constructor(s){this.spa=this.safeParseAsync,this._def=s,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 Zn.create(this,this._def)}nullable(){return Ao.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return zr.create(this)}promise(){return jd.create(this,this._def)}or(s){return yd.create([this,s],this._def)}and(s){return bd.create(this,s,this._def)}transform(s){return new _o({...rt(this._def),schema:this,typeName:Ye.ZodEffects,effect:{type:"transform",transform:s}})}default(s){const n=typeof s=="function"?s:()=>s;return new Zf({...rt(this._def),innerType:this,defaultValue:n,typeName:Ye.ZodDefault})}brand(){return new WR({typeName:Ye.ZodBranded,type:this,...rt(this._def)})}catch(s){const n=typeof s=="function"?s:()=>s;return new Gf({...rt(this._def),innerType:this,catchValue:n,typeName:Ye.ZodCatch})}describe(s){const n=this.constructor;return new n({...this._def,description:s})}pipe(s){return lp.create(this,s)}readonly(){return Qf.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const NR=/^c[^\s-]{8,}$/i,kR=/^[0-9a-z]+$/,CR=/^[0-9A-HJKMNP-TV-Z]{26}$/i,SR=/^[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,ER=/^[a-z0-9_-]{21}$/i,_R=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,AR=/^[-+]?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)?)??$/,TR=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,RR="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let cf;const PR=/^(?:(?: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])$/,MR=/^(?:(?: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])$/,IR=/^(([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]))$/,DR=/^(([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])$/,OR=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,LR=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,H1="((\\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])))",FR=new RegExp(`^${H1}$`);function W1(t){let s="[0-5]\\d";t.precision?s=`${s}\\.\\d{${t.precision}}`:t.precision==null&&(s=`${s}(\\.\\d+)?`);const n=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${s})${n}`}function $R(t){return new RegExp(`^${W1(t)}$`)}function VR(t){let s=`${H1}T${W1(t)}`;const n=[];return n.push(t.local?"Z?":"Z"),t.offset&&n.push("([+-]\\d{2}:?\\d{2})"),s=`${s}(${n.join("|")})`,new RegExp(`^${s}$`)}function zR(t,s){return!!((s==="v4"||!s)&&PR.test(t)||(s==="v6"||!s)&&IR.test(t))}function BR(t,s){if(!_R.test(t))return!1;try{const[n]=t.split(".");if(!n)return!1;const o=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),i=JSON.parse(atob(o));return!(typeof i!="object"||i===null||"typ"in i&&i?.typ!=="JWT"||!i.alg||s&&i.alg!==s)}catch{return!1}}function UR(t,s){return!!((s==="v4"||!s)&&MR.test(t)||(s==="v6"||!s)&&DR.test(t))}class Kn extends pt{_parse(s){if(this._def.coerce&&(s.data=String(s.data)),this._getType(s)!==Ie.string){const c=this._getOrReturnCtx(s);return Ae(c,{code:ye.invalid_type,expected:Ie.string,received:c.parsedType}),Qe}const o=new Qs;let i;for(const c of this._def.checks)if(c.kind==="min")s.data.length<c.value&&(i=this._getOrReturnCtx(s,i),Ae(i,{code:ye.too_small,minimum:c.value,type:"string",inclusive:!0,exact:!1,message:c.message}),o.dirty());else if(c.kind==="max")s.data.length>c.value&&(i=this._getOrReturnCtx(s,i),Ae(i,{code:ye.too_big,maximum:c.value,type:"string",inclusive:!0,exact:!1,message:c.message}),o.dirty());else if(c.kind==="length"){const d=s.data.length>c.value,m=s.data.length<c.value;(d||m)&&(i=this._getOrReturnCtx(s,i),d?Ae(i,{code:ye.too_big,maximum:c.value,type:"string",inclusive:!0,exact:!0,message:c.message}):m&&Ae(i,{code:ye.too_small,minimum:c.value,type:"string",inclusive:!0,exact:!0,message:c.message}),o.dirty())}else if(c.kind==="email")TR.test(s.data)||(i=this._getOrReturnCtx(s,i),Ae(i,{validation:"email",code:ye.invalid_string,message:c.message}),o.dirty());else if(c.kind==="emoji")cf||(cf=new RegExp(RR,"u")),cf.test(s.data)||(i=this._getOrReturnCtx(s,i),Ae(i,{validation:"emoji",code:ye.invalid_string,message:c.message}),o.dirty());else if(c.kind==="uuid")SR.test(s.data)||(i=this._getOrReturnCtx(s,i),Ae(i,{validation:"uuid",code:ye.invalid_string,message:c.message}),o.dirty());else if(c.kind==="nanoid")ER.test(s.data)||(i=this._getOrReturnCtx(s,i),Ae(i,{validation:"nanoid",code:ye.invalid_string,message:c.message}),o.dirty());else if(c.kind==="cuid")NR.test(s.data)||(i=this._getOrReturnCtx(s,i),Ae(i,{validation:"cuid",code:ye.invalid_string,message:c.message}),o.dirty());else if(c.kind==="cuid2")kR.test(s.data)||(i=this._getOrReturnCtx(s,i),Ae(i,{validation:"cuid2",code:ye.invalid_string,message:c.message}),o.dirty());else if(c.kind==="ulid")CR.test(s.data)||(i=this._getOrReturnCtx(s,i),Ae(i,{validation:"ulid",code:ye.invalid_string,message:c.message}),o.dirty());else if(c.kind==="url")try{new URL(s.data)}catch{i=this._getOrReturnCtx(s,i),Ae(i,{validation:"url",code:ye.invalid_string,message:c.message}),o.dirty()}else c.kind==="regex"?(c.regex.lastIndex=0,c.regex.test(s.data)||(i=this._getOrReturnCtx(s,i),Ae(i,{validation:"regex",code:ye.invalid_string,message:c.message}),o.dirty())):c.kind==="trim"?s.data=s.data.trim():c.kind==="includes"?s.data.includes(c.value,c.position)||(i=this._getOrReturnCtx(s,i),Ae(i,{code:ye.invalid_string,validation:{includes:c.value,position:c.position},message:c.message}),o.dirty()):c.kind==="toLowerCase"?s.data=s.data.toLowerCase():c.kind==="toUpperCase"?s.data=s.data.toUpperCase():c.kind==="startsWith"?s.data.startsWith(c.value)||(i=this._getOrReturnCtx(s,i),Ae(i,{code:ye.invalid_string,validation:{startsWith:c.value},message:c.message}),o.dirty()):c.kind==="endsWith"?s.data.endsWith(c.value)||(i=this._getOrReturnCtx(s,i),Ae(i,{code:ye.invalid_string,validation:{endsWith:c.value},message:c.message}),o.dirty()):c.kind==="datetime"?VR(c).test(s.data)||(i=this._getOrReturnCtx(s,i),Ae(i,{code:ye.invalid_string,validation:"datetime",message:c.message}),o.dirty()):c.kind==="date"?FR.test(s.data)||(i=this._getOrReturnCtx(s,i),Ae(i,{code:ye.invalid_string,validation:"date",message:c.message}),o.dirty()):c.kind==="time"?$R(c).test(s.data)||(i=this._getOrReturnCtx(s,i),Ae(i,{code:ye.invalid_string,validation:"time",message:c.message}),o.dirty()):c.kind==="duration"?AR.test(s.data)||(i=this._getOrReturnCtx(s,i),Ae(i,{validation:"duration",code:ye.invalid_string,message:c.message}),o.dirty()):c.kind==="ip"?zR(s.data,c.version)||(i=this._getOrReturnCtx(s,i),Ae(i,{validation:"ip",code:ye.invalid_string,message:c.message}),o.dirty()):c.kind==="jwt"?BR(s.data,c.alg)||(i=this._getOrReturnCtx(s,i),Ae(i,{validation:"jwt",code:ye.invalid_string,message:c.message}),o.dirty()):c.kind==="cidr"?UR(s.data,c.version)||(i=this._getOrReturnCtx(s,i),Ae(i,{validation:"cidr",code:ye.invalid_string,message:c.message}),o.dirty()):c.kind==="base64"?OR.test(s.data)||(i=this._getOrReturnCtx(s,i),Ae(i,{validation:"base64",code:ye.invalid_string,message:c.message}),o.dirty()):c.kind==="base64url"?LR.test(s.data)||(i=this._getOrReturnCtx(s,i),Ae(i,{validation:"base64url",code:ye.invalid_string,message:c.message}),o.dirty()):gt.assertNever(c);return{status:o.value,value:s.data}}_regex(s,n,o){return this.refinement(i=>s.test(i),{validation:n,code:ye.invalid_string,...Le.errToObj(o)})}_addCheck(s){return new Kn({...this._def,checks:[...this._def.checks,s]})}email(s){return this._addCheck({kind:"email",...Le.errToObj(s)})}url(s){return this._addCheck({kind:"url",...Le.errToObj(s)})}emoji(s){return this._addCheck({kind:"emoji",...Le.errToObj(s)})}uuid(s){return this._addCheck({kind:"uuid",...Le.errToObj(s)})}nanoid(s){return this._addCheck({kind:"nanoid",...Le.errToObj(s)})}cuid(s){return this._addCheck({kind:"cuid",...Le.errToObj(s)})}cuid2(s){return this._addCheck({kind:"cuid2",...Le.errToObj(s)})}ulid(s){return this._addCheck({kind:"ulid",...Le.errToObj(s)})}base64(s){return this._addCheck({kind:"base64",...Le.errToObj(s)})}base64url(s){return this._addCheck({kind:"base64url",...Le.errToObj(s)})}jwt(s){return this._addCheck({kind:"jwt",...Le.errToObj(s)})}ip(s){return this._addCheck({kind:"ip",...Le.errToObj(s)})}cidr(s){return this._addCheck({kind:"cidr",...Le.errToObj(s)})}datetime(s){return typeof s=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:s}):this._addCheck({kind:"datetime",precision:typeof s?.precision>"u"?null:s?.precision,offset:s?.offset??!1,local:s?.local??!1,...Le.errToObj(s?.message)})}date(s){return this._addCheck({kind:"date",message:s})}time(s){return typeof s=="string"?this._addCheck({kind:"time",precision:null,message:s}):this._addCheck({kind:"time",precision:typeof s?.precision>"u"?null:s?.precision,...Le.errToObj(s?.message)})}duration(s){return this._addCheck({kind:"duration",...Le.errToObj(s)})}regex(s,n){return this._addCheck({kind:"regex",regex:s,...Le.errToObj(n)})}includes(s,n){return this._addCheck({kind:"includes",value:s,position:n?.position,...Le.errToObj(n?.message)})}startsWith(s,n){return this._addCheck({kind:"startsWith",value:s,...Le.errToObj(n)})}endsWith(s,n){return this._addCheck({kind:"endsWith",value:s,...Le.errToObj(n)})}min(s,n){return this._addCheck({kind:"min",value:s,...Le.errToObj(n)})}max(s,n){return this._addCheck({kind:"max",value:s,...Le.errToObj(n)})}length(s,n){return this._addCheck({kind:"length",value:s,...Le.errToObj(n)})}nonempty(s){return this.min(1,Le.errToObj(s))}trim(){return new Kn({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Kn({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Kn({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(s=>s.kind==="datetime")}get isDate(){return!!this._def.checks.find(s=>s.kind==="date")}get isTime(){return!!this._def.checks.find(s=>s.kind==="time")}get isDuration(){return!!this._def.checks.find(s=>s.kind==="duration")}get isEmail(){return!!this._def.checks.find(s=>s.kind==="email")}get isURL(){return!!this._def.checks.find(s=>s.kind==="url")}get isEmoji(){return!!this._def.checks.find(s=>s.kind==="emoji")}get isUUID(){return!!this._def.checks.find(s=>s.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(s=>s.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(s=>s.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(s=>s.kind==="cuid2")}get isULID(){return!!this._def.checks.find(s=>s.kind==="ulid")}get isIP(){return!!this._def.checks.find(s=>s.kind==="ip")}get isCIDR(){return!!this._def.checks.find(s=>s.kind==="cidr")}get isBase64(){return!!this._def.checks.find(s=>s.kind==="base64")}get isBase64url(){return!!this._def.checks.find(s=>s.kind==="base64url")}get minLength(){let s=null;for(const n of this._def.checks)n.kind==="min"&&(s===null||n.value>s)&&(s=n.value);return s}get maxLength(){let s=null;for(const n of this._def.checks)n.kind==="max"&&(s===null||n.value<s)&&(s=n.value);return s}}Kn.create=t=>new Kn({checks:[],typeName:Ye.ZodString,coerce:t?.coerce??!1,...rt(t)});function HR(t,s){const n=(t.toString().split(".")[1]||"").length,o=(s.toString().split(".")[1]||"").length,i=n>o?n:o,c=Number.parseInt(t.toFixed(i).replace(".","")),d=Number.parseInt(s.toFixed(i).replace(".",""));return c%d/10**i}class So extends pt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(s){if(this._def.coerce&&(s.data=Number(s.data)),this._getType(s)!==Ie.number){const c=this._getOrReturnCtx(s);return Ae(c,{code:ye.invalid_type,expected:Ie.number,received:c.parsedType}),Qe}let o;const i=new Qs;for(const c of this._def.checks)c.kind==="int"?gt.isInteger(s.data)||(o=this._getOrReturnCtx(s,o),Ae(o,{code:ye.invalid_type,expected:"integer",received:"float",message:c.message}),i.dirty()):c.kind==="min"?(c.inclusive?s.data<c.value:s.data<=c.value)&&(o=this._getOrReturnCtx(s,o),Ae(o,{code:ye.too_small,minimum:c.value,type:"number",inclusive:c.inclusive,exact:!1,message:c.message}),i.dirty()):c.kind==="max"?(c.inclusive?s.data>c.value:s.data>=c.value)&&(o=this._getOrReturnCtx(s,o),Ae(o,{code:ye.too_big,maximum:c.value,type:"number",inclusive:c.inclusive,exact:!1,message:c.message}),i.dirty()):c.kind==="multipleOf"?HR(s.data,c.value)!==0&&(o=this._getOrReturnCtx(s,o),Ae(o,{code:ye.not_multiple_of,multipleOf:c.value,message:c.message}),i.dirty()):c.kind==="finite"?Number.isFinite(s.data)||(o=this._getOrReturnCtx(s,o),Ae(o,{code:ye.not_finite,message:c.message}),i.dirty()):gt.assertNever(c);return{status:i.value,value:s.data}}gte(s,n){return this.setLimit("min",s,!0,Le.toString(n))}gt(s,n){return this.setLimit("min",s,!1,Le.toString(n))}lte(s,n){return this.setLimit("max",s,!0,Le.toString(n))}lt(s,n){return this.setLimit("max",s,!1,Le.toString(n))}setLimit(s,n,o,i){return new So({...this._def,checks:[...this._def.checks,{kind:s,value:n,inclusive:o,message:Le.toString(i)}]})}_addCheck(s){return new So({...this._def,checks:[...this._def.checks,s]})}int(s){return this._addCheck({kind:"int",message:Le.toString(s)})}positive(s){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Le.toString(s)})}negative(s){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Le.toString(s)})}nonpositive(s){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Le.toString(s)})}nonnegative(s){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Le.toString(s)})}multipleOf(s,n){return this._addCheck({kind:"multipleOf",value:s,message:Le.toString(n)})}finite(s){return this._addCheck({kind:"finite",message:Le.toString(s)})}safe(s){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Le.toString(s)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Le.toString(s)})}get minValue(){let s=null;for(const n of this._def.checks)n.kind==="min"&&(s===null||n.value>s)&&(s=n.value);return s}get maxValue(){let s=null;for(const n of this._def.checks)n.kind==="max"&&(s===null||n.value<s)&&(s=n.value);return s}get isInt(){return!!this._def.checks.find(s=>s.kind==="int"||s.kind==="multipleOf"&>.isInteger(s.value))}get isFinite(){let s=null,n=null;for(const o of this._def.checks){if(o.kind==="finite"||o.kind==="int"||o.kind==="multipleOf")return!0;o.kind==="min"?(n===null||o.value>n)&&(n=o.value):o.kind==="max"&&(s===null||o.value<s)&&(s=o.value)}return Number.isFinite(n)&&Number.isFinite(s)}}So.create=t=>new So({checks:[],typeName:Ye.ZodNumber,coerce:t?.coerce||!1,...rt(t)});class Qi extends pt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(s){if(this._def.coerce)try{s.data=BigInt(s.data)}catch{return this._getInvalidInput(s)}if(this._getType(s)!==Ie.bigint)return this._getInvalidInput(s);let o;const i=new Qs;for(const c of this._def.checks)c.kind==="min"?(c.inclusive?s.data<c.value:s.data<=c.value)&&(o=this._getOrReturnCtx(s,o),Ae(o,{code:ye.too_small,type:"bigint",minimum:c.value,inclusive:c.inclusive,message:c.message}),i.dirty()):c.kind==="max"?(c.inclusive?s.data>c.value:s.data>=c.value)&&(o=this._getOrReturnCtx(s,o),Ae(o,{code:ye.too_big,type:"bigint",maximum:c.value,inclusive:c.inclusive,message:c.message}),i.dirty()):c.kind==="multipleOf"?s.data%c.value!==BigInt(0)&&(o=this._getOrReturnCtx(s,o),Ae(o,{code:ye.not_multiple_of,multipleOf:c.value,message:c.message}),i.dirty()):gt.assertNever(c);return{status:i.value,value:s.data}}_getInvalidInput(s){const n=this._getOrReturnCtx(s);return Ae(n,{code:ye.invalid_type,expected:Ie.bigint,received:n.parsedType}),Qe}gte(s,n){return this.setLimit("min",s,!0,Le.toString(n))}gt(s,n){return this.setLimit("min",s,!1,Le.toString(n))}lte(s,n){return this.setLimit("max",s,!0,Le.toString(n))}lt(s,n){return this.setLimit("max",s,!1,Le.toString(n))}setLimit(s,n,o,i){return new Qi({...this._def,checks:[...this._def.checks,{kind:s,value:n,inclusive:o,message:Le.toString(i)}]})}_addCheck(s){return new Qi({...this._def,checks:[...this._def.checks,s]})}positive(s){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Le.toString(s)})}negative(s){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Le.toString(s)})}nonpositive(s){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Le.toString(s)})}nonnegative(s){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Le.toString(s)})}multipleOf(s,n){return this._addCheck({kind:"multipleOf",value:s,message:Le.toString(n)})}get minValue(){let s=null;for(const n of this._def.checks)n.kind==="min"&&(s===null||n.value>s)&&(s=n.value);return s}get maxValue(){let s=null;for(const n of this._def.checks)n.kind==="max"&&(s===null||n.value<s)&&(s=n.value);return s}}Qi.create=t=>new Qi({checks:[],typeName:Ye.ZodBigInt,coerce:t?.coerce??!1,...rt(t)});class _0 extends pt{_parse(s){if(this._def.coerce&&(s.data=!!s.data),this._getType(s)!==Ie.boolean){const o=this._getOrReturnCtx(s);return Ae(o,{code:ye.invalid_type,expected:Ie.boolean,received:o.parsedType}),Qe}return hr(s.data)}}_0.create=t=>new _0({typeName:Ye.ZodBoolean,coerce:t?.coerce||!1,...rt(t)});class vd extends pt{_parse(s){if(this._def.coerce&&(s.data=new Date(s.data)),this._getType(s)!==Ie.date){const c=this._getOrReturnCtx(s);return Ae(c,{code:ye.invalid_type,expected:Ie.date,received:c.parsedType}),Qe}if(Number.isNaN(s.data.getTime())){const c=this._getOrReturnCtx(s);return Ae(c,{code:ye.invalid_date}),Qe}const o=new Qs;let i;for(const c of this._def.checks)c.kind==="min"?s.data.getTime()<c.value&&(i=this._getOrReturnCtx(s,i),Ae(i,{code:ye.too_small,message:c.message,inclusive:!0,exact:!1,minimum:c.value,type:"date"}),o.dirty()):c.kind==="max"?s.data.getTime()>c.value&&(i=this._getOrReturnCtx(s,i),Ae(i,{code:ye.too_big,message:c.message,inclusive:!0,exact:!1,maximum:c.value,type:"date"}),o.dirty()):gt.assertNever(c);return{status:o.value,value:new Date(s.data.getTime())}}_addCheck(s){return new vd({...this._def,checks:[...this._def.checks,s]})}min(s,n){return this._addCheck({kind:"min",value:s.getTime(),message:Le.toString(n)})}max(s,n){return this._addCheck({kind:"max",value:s.getTime(),message:Le.toString(n)})}get minDate(){let s=null;for(const n of this._def.checks)n.kind==="min"&&(s===null||n.value>s)&&(s=n.value);return s!=null?new Date(s):null}get maxDate(){let s=null;for(const n of this._def.checks)n.kind==="max"&&(s===null||n.value<s)&&(s=n.value);return s!=null?new Date(s):null}}vd.create=t=>new vd({checks:[],coerce:t?.coerce||!1,typeName:Ye.ZodDate,...rt(t)});class A0 extends pt{_parse(s){if(this._getType(s)!==Ie.symbol){const o=this._getOrReturnCtx(s);return Ae(o,{code:ye.invalid_type,expected:Ie.symbol,received:o.parsedType}),Qe}return hr(s.data)}}A0.create=t=>new A0({typeName:Ye.ZodSymbol,...rt(t)});class T0 extends pt{_parse(s){if(this._getType(s)!==Ie.undefined){const o=this._getOrReturnCtx(s);return Ae(o,{code:ye.invalid_type,expected:Ie.undefined,received:o.parsedType}),Qe}return hr(s.data)}}T0.create=t=>new T0({typeName:Ye.ZodUndefined,...rt(t)});class R0 extends pt{_parse(s){if(this._getType(s)!==Ie.null){const o=this._getOrReturnCtx(s);return Ae(o,{code:ye.invalid_type,expected:Ie.null,received:o.parsedType}),Qe}return hr(s.data)}}R0.create=t=>new R0({typeName:Ye.ZodNull,...rt(t)});class P0 extends pt{constructor(){super(...arguments),this._any=!0}_parse(s){return hr(s.data)}}P0.create=t=>new P0({typeName:Ye.ZodAny,...rt(t)});class M0 extends pt{constructor(){super(...arguments),this._unknown=!0}_parse(s){return hr(s.data)}}M0.create=t=>new M0({typeName:Ye.ZodUnknown,...rt(t)});class na extends pt{_parse(s){const n=this._getOrReturnCtx(s);return Ae(n,{code:ye.invalid_type,expected:Ie.never,received:n.parsedType}),Qe}}na.create=t=>new na({typeName:Ye.ZodNever,...rt(t)});class I0 extends pt{_parse(s){if(this._getType(s)!==Ie.undefined){const o=this._getOrReturnCtx(s);return Ae(o,{code:ye.invalid_type,expected:Ie.void,received:o.parsedType}),Qe}return hr(s.data)}}I0.create=t=>new I0({typeName:Ye.ZodVoid,...rt(t)});class zr extends pt{_parse(s){const{ctx:n,status:o}=this._processInputParams(s),i=this._def;if(n.parsedType!==Ie.array)return Ae(n,{code:ye.invalid_type,expected:Ie.array,received:n.parsedType}),Qe;if(i.exactLength!==null){const d=n.data.length>i.exactLength.value,m=n.data.length<i.exactLength.value;(d||m)&&(Ae(n,{code:d?ye.too_big:ye.too_small,minimum:m?i.exactLength.value:void 0,maximum:d?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),o.dirty())}if(i.minLength!==null&&n.data.length<i.minLength.value&&(Ae(n,{code:ye.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),o.dirty()),i.maxLength!==null&&n.data.length>i.maxLength.value&&(Ae(n,{code:ye.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),o.dirty()),n.common.async)return Promise.all([...n.data].map((d,m)=>i.type._parseAsync(new ra(n,d,n.path,m)))).then(d=>Qs.mergeArray(o,d));const c=[...n.data].map((d,m)=>i.type._parseSync(new ra(n,d,n.path,m)));return Qs.mergeArray(o,c)}get element(){return this._def.type}min(s,n){return new zr({...this._def,minLength:{value:s,message:Le.toString(n)}})}max(s,n){return new zr({...this._def,maxLength:{value:s,message:Le.toString(n)}})}length(s,n){return new zr({...this._def,exactLength:{value:s,message:Le.toString(n)}})}nonempty(s){return this.min(1,s)}}zr.create=(t,s)=>new zr({type:t,minLength:null,maxLength:null,exactLength:null,typeName:Ye.ZodArray,...rt(s)});function fo(t){if(t instanceof Kt){const s={};for(const n in t.shape){const o=t.shape[n];s[n]=Zn.create(fo(o))}return new Kt({...t._def,shape:()=>s})}else return t instanceof zr?new zr({...t._def,type:fo(t.element)}):t instanceof Zn?Zn.create(fo(t.unwrap())):t instanceof Ao?Ao.create(fo(t.unwrap())):t instanceof Ma?Ma.create(t.items.map(s=>fo(s))):t}class Kt extends pt{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const s=this._def.shape(),n=gt.objectKeys(s);return this._cached={shape:s,keys:n},this._cached}_parse(s){if(this._getType(s)!==Ie.object){const x=this._getOrReturnCtx(s);return Ae(x,{code:ye.invalid_type,expected:Ie.object,received:x.parsedType}),Qe}const{status:o,ctx:i}=this._processInputParams(s),{shape:c,keys:d}=this._getCached(),m=[];if(!(this._def.catchall instanceof na&&this._def.unknownKeys==="strip"))for(const x in i.data)d.includes(x)||m.push(x);const f=[];for(const x of d){const v=c[x],y=i.data[x];f.push({key:{status:"valid",value:x},value:v._parse(new ra(i,y,i.path,x)),alwaysSet:x in i.data})}if(this._def.catchall instanceof na){const x=this._def.unknownKeys;if(x==="passthrough")for(const v of m)f.push({key:{status:"valid",value:v},value:{status:"valid",value:i.data[v]}});else if(x==="strict")m.length>0&&(Ae(i,{code:ye.unrecognized_keys,keys:m}),o.dirty());else if(x!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const x=this._def.catchall;for(const v of m){const y=i.data[v];f.push({key:{status:"valid",value:v},value:x._parse(new ra(i,y,i.path,v)),alwaysSet:v in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const x=[];for(const v of f){const y=await v.key,b=await v.value;x.push({key:y,value:b,alwaysSet:v.alwaysSet})}return x}).then(x=>Qs.mergeObjectSync(o,x)):Qs.mergeObjectSync(o,f)}get shape(){return this._def.shape()}strict(s){return Le.errToObj,new Kt({...this._def,unknownKeys:"strict",...s!==void 0?{errorMap:(n,o)=>{const i=this._def.errorMap?.(n,o).message??o.defaultError;return n.code==="unrecognized_keys"?{message:Le.errToObj(s).message??i}:{message:i}}}:{}})}strip(){return new Kt({...this._def,unknownKeys:"strip"})}passthrough(){return new Kt({...this._def,unknownKeys:"passthrough"})}extend(s){return new Kt({...this._def,shape:()=>({...this._def.shape(),...s})})}merge(s){return new Kt({unknownKeys:s._def.unknownKeys,catchall:s._def.catchall,shape:()=>({...this._def.shape(),...s._def.shape()}),typeName:Ye.ZodObject})}setKey(s,n){return this.augment({[s]:n})}catchall(s){return new Kt({...this._def,catchall:s})}pick(s){const n={};for(const o of gt.objectKeys(s))s[o]&&this.shape[o]&&(n[o]=this.shape[o]);return new Kt({...this._def,shape:()=>n})}omit(s){const n={};for(const o of gt.objectKeys(this.shape))s[o]||(n[o]=this.shape[o]);return new Kt({...this._def,shape:()=>n})}deepPartial(){return fo(this)}partial(s){const n={};for(const o of gt.objectKeys(this.shape)){const i=this.shape[o];s&&!s[o]?n[o]=i:n[o]=i.optional()}return new Kt({...this._def,shape:()=>n})}required(s){const n={};for(const o of gt.objectKeys(this.shape))if(s&&!s[o])n[o]=this.shape[o];else{let c=this.shape[o];for(;c instanceof Zn;)c=c._def.innerType;n[o]=c}return new Kt({...this._def,shape:()=>n})}keyof(){return K1(gt.objectKeys(this.shape))}}Kt.create=(t,s)=>new Kt({shape:()=>t,unknownKeys:"strip",catchall:na.create(),typeName:Ye.ZodObject,...rt(s)});Kt.strictCreate=(t,s)=>new Kt({shape:()=>t,unknownKeys:"strict",catchall:na.create(),typeName:Ye.ZodObject,...rt(s)});Kt.lazycreate=(t,s)=>new Kt({shape:t,unknownKeys:"strip",catchall:na.create(),typeName:Ye.ZodObject,...rt(s)});class yd extends pt{_parse(s){const{ctx:n}=this._processInputParams(s),o=this._def.options;function i(c){for(const m of c)if(m.result.status==="valid")return m.result;for(const m of c)if(m.result.status==="dirty")return n.common.issues.push(...m.ctx.common.issues),m.result;const d=c.map(m=>new un(m.ctx.common.issues));return Ae(n,{code:ye.invalid_union,unionErrors:d}),Qe}if(n.common.async)return Promise.all(o.map(async c=>{const d={...n,common:{...n.common,issues:[]},parent:null};return{result:await c._parseAsync({data:n.data,path:n.path,parent:d}),ctx:d}})).then(i);{let c;const d=[];for(const f of o){const x={...n,common:{...n.common,issues:[]},parent:null},v=f._parseSync({data:n.data,path:n.path,parent:x});if(v.status==="valid")return v;v.status==="dirty"&&!c&&(c={result:v,ctx:x}),x.common.issues.length&&d.push(x.common.issues)}if(c)return n.common.issues.push(...c.ctx.common.issues),c.result;const m=d.map(f=>new un(f));return Ae(n,{code:ye.invalid_union,unionErrors:m}),Qe}}get options(){return this._def.options}}yd.create=(t,s)=>new yd({options:t,typeName:Ye.ZodUnion,...rt(s)});function Kf(t,s){const n=Un(t),o=Un(s);if(t===s)return{valid:!0,data:t};if(n===Ie.object&&o===Ie.object){const i=gt.objectKeys(s),c=gt.objectKeys(t).filter(m=>i.indexOf(m)!==-1),d={...t,...s};for(const m of c){const f=Kf(t[m],s[m]);if(!f.valid)return{valid:!1};d[m]=f.data}return{valid:!0,data:d}}else if(n===Ie.array&&o===Ie.array){if(t.length!==s.length)return{valid:!1};const i=[];for(let c=0;c<t.length;c++){const d=t[c],m=s[c],f=Kf(d,m);if(!f.valid)return{valid:!1};i.push(f.data)}return{valid:!0,data:i}}else return n===Ie.date&&o===Ie.date&&+t==+s?{valid:!0,data:t}:{valid:!1}}class bd extends pt{_parse(s){const{status:n,ctx:o}=this._processInputParams(s),i=(c,d)=>
vendor: 4,181 bytes, line 84
84{if(C0(c)||C0(d))return Qe;const m=Kf(c.value,d.value);return m.valid?((S0(c)||S0(d))&&n.dirty(),{status:n.value,value:m.data}):(Ae(o,{code:ye.invalid_intersection_types}),Qe)};return o.common.async?Promise.all([this._def.left._parseAsync({data:o.data,path:o.path,parent:o}),this._def.right._parseAsync({data:o.data,path:o.path,parent:o})]).then(([c,d])=>i(c,d)):i(this._def.left._parseSync({data:o.data,path:o.path,parent:o}),this._def.right._parseSync({data:o.data,path:o.path,parent:o}))}}bd.create=(t,s,n)=>new bd({left:t,right:s,typeName:Ye.ZodIntersection,...rt(n)});class Ma extends pt{_parse(s){const{status:n,ctx:o}=this._processInputParams(s);if(o.parsedType!==Ie.array)return Ae(o,{code:ye.invalid_type,expected:Ie.array,received:o.parsedType}),Qe;if(o.data.length<this._def.items.length)return Ae(o,{code:ye.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Qe;!this._def.rest&&o.data.length>this._def.items.length&&(Ae(o,{code:ye.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const c=[...o.data].map((d,m)=>{const f=this._def.items[m]||this._def.rest;return f?f._parse(new ra(o,d,o.path,m)):null}).filter(d=>!!d);return o.common.async?Promise.all(c).then(d=>Qs.mergeArray(n,d)):Qs.mergeArray(n,c)}get items(){return this._def.items}rest(s){return new Ma({...this._def,rest:s})}}Ma.create=(t,s)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Ma({items:t,typeName:Ye.ZodTuple,rest:null,...rt(s)})};class D0 extends pt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(s){const{status:n,ctx:o}=this._processInputParams(s);if(o.parsedType!==Ie.map)return Ae(o,{code:ye.invalid_type,expected:Ie.map,received:o.parsedType}),Qe;const i=this._def.keyType,c=this._def.valueType,d=[...o.data.entries()].map(([m,f],x)=>({key:i._parse(new ra(o,m,o.path,[x,"key"])),value:c._parse(new ra(o,f,o.path,[x,"value"]))}));if(o.common.async){const m=new Map;return Promise.resolve().then(async()=>{for(const f of d){const x=await f.key,v=await f.value;if(x.status==="aborted"||v.status==="aborted")return Qe;(x.status==="dirty"||v.status==="dirty")&&n.dirty(),m.set(x.value,v.value)}return{status:n.value,value:m}})}else{const m=new Map;for(const f of d){const x=f.key,v=f.value;if(x.status==="aborted"||v.status==="aborted")return Qe;(x.status==="dirty"||v.status==="dirty")&&n.dirty(),m.set(x.value,v.value)}return{status:n.value,value:m}}}}D0.create=(t,s,n)=>new D0({valueType:s,keyType:t,typeName:Ye.ZodMap,...rt(n)});class Yi extends pt{_parse(s){const{status:n,ctx:o}=this._processInputParams(s);if(o.parsedType!==Ie.set)return Ae(o,{code:ye.invalid_type,expected:Ie.set,received:o.parsedType}),Qe;const i=this._def;i.minSize!==null&&o.data.size<i.minSize.value&&(Ae(o,{code:ye.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),n.dirty()),i.maxSize!==null&&o.data.size>i.maxSize.value&&(Ae(o,{code:ye.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),n.dirty());const c=this._def.valueType;function d(f){const x=new Set;for(const v of f){if(v.status==="aborted")return Qe;v.status==="dirty"&&n.dirty(),x.add(v.value)}return{status:n.value,value:x}}const m=[...o.data.values()].map((f,x)=>c._parse(new ra(o,f,o.path,x)));return o.common.async?Promise.all(m).then(f=>d(f)):d(m)}min(s,n){return new Yi({...this._def,minSize:{value:s,message:Le.toString(n)}})}max(s,n){return new Yi({...this._def,maxSize:{value:s,message:Le.toString(n)}})}size(s,n){return this.min(s,n).max(s,n)}nonempty(s){return this.min(1,s)}}Yi.create=(t,s)=>new Yi({valueType:t,minSize:null,maxSize:null,typeName:Ye.ZodSet,...rt(s)});class O0 extends pt{get schema(){return this._def.getter()}_parse(s){const{ctx:n}=this._processInputParams(s);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}O0.create=(t,s)=>new O0({getter:t,typeName:Ye.ZodLazy,...rt(s)});class qf extends pt{_parse(s){if(s.data!==this._def.value){const n=this._getOrReturnCtx(s);return Ae(n,{received:n.data,code:ye.invalid_literal,expected:this._def.value}),Qe}
vendor: 5,385 bytes, line 84
84return{status:"valid",value:s.data}}get value(){return this._def.value}}qf.create=(t,s)=>new qf({value:t,typeName:Ye.ZodLiteral,...rt(s)});function K1(t,s){return new Eo({values:t,typeName:Ye.ZodEnum,...rt(s)})}class Eo extends pt{_parse(s){if(typeof s.data!="string"){const n=this._getOrReturnCtx(s),o=this._def.values;return Ae(n,{expected:gt.joinValues(o),received:n.parsedType,code:ye.invalid_type}),Qe}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(s.data)){const n=this._getOrReturnCtx(s),o=this._def.values;return Ae(n,{received:n.data,code:ye.invalid_enum_value,options:o}),Qe}return hr(s.data)}get options(){return this._def.values}get enum(){const s={};for(const n of this._def.values)s[n]=n;return s}get Values(){const s={};for(const n of this._def.values)s[n]=n;return s}get Enum(){const s={};for(const n of this._def.values)s[n]=n;return s}extract(s,n=this._def){return Eo.create(s,{...this._def,...n})}exclude(s,n=this._def){return Eo.create(this.options.filter(o=>!s.includes(o)),{...this._def,...n})}}Eo.create=K1;class L0 extends pt{_parse(s){const n=gt.getValidEnumValues(this._def.values),o=this._getOrReturnCtx(s);if(o.parsedType!==Ie.string&&o.parsedType!==Ie.number){const i=gt.objectValues(n);return Ae(o,{expected:gt.joinValues(i),received:o.parsedType,code:ye.invalid_type}),Qe}if(this._cache||(this._cache=new Set(gt.getValidEnumValues(this._def.values))),!this._cache.has(s.data)){const i=gt.objectValues(n);return Ae(o,{received:o.data,code:ye.invalid_enum_value,options:i}),Qe}return hr(s.data)}get enum(){return this._def.values}}L0.create=(t,s)=>new L0({values:t,typeName:Ye.ZodNativeEnum,...rt(s)});class jd extends pt{unwrap(){return this._def.type}_parse(s){const{ctx:n}=this._processInputParams(s);if(n.parsedType!==Ie.promise&&n.common.async===!1)return Ae(n,{code:ye.invalid_type,expected:Ie.promise,received:n.parsedType}),Qe;const o=n.parsedType===Ie.promise?n.data:Promise.resolve(n.data);return hr(o.then(i=>this._def.type.parseAsync(i,{path:n.path,errorMap:n.common.contextualErrorMap})))}}jd.create=(t,s)=>new jd({type:t,typeName:Ye.ZodPromise,...rt(s)});class _o extends pt{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Ye.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(s){const{status:n,ctx:o}=this._processInputParams(s),i=this._def.effect||null,c={addIssue:d=>{Ae(o,d),d.fatal?n.abort():n.dirty()},get path(){return o.path}};if(c.addIssue=c.addIssue.bind(c),i.type==="preprocess"){const d=i.transform(o.data,c);if(o.common.async)return Promise.resolve(d).then(async m=>{if(n.value==="aborted")return Qe;const f=await this._def.schema._parseAsync({data:m,path:o.path,parent:o});return f.status==="aborted"?Qe:f.status==="dirty"||n.value==="dirty"?Li(f.value):f});{if(n.value==="aborted")return Qe;const m=this._def.schema._parseSync({data:d,path:o.path,parent:o});return m.status==="aborted"?Qe:m.status==="dirty"||n.value==="dirty"?Li(m.value):m}}if(i.type==="refinement"){const d=m=>{const f=i.refinement(m,c);if(o.common.async)return Promise.resolve(f);if(f instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return m};if(o.common.async===!1){const m=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});return m.status==="aborted"?Qe:(m.status==="dirty"&&n.dirty(),d(m.value),{status:n.value,value:m.value})}else return this._def.schema._parseAsync({data:o.data,path:o.path,parent:o}).then(m=>m.status==="aborted"?Qe:(m.status==="dirty"&&n.dirty(),d(m.value).then(()=>({status:n.value,value:m.value}))))}if(i.type==="transform")if(o.common.async===!1){const d=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});if(!Co(d))return Qe;const m=i.transform(d.value,c);if(m instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:m}}else return this._def.schema._parseAsync({data:o.data,path:o.path,parent:o}).then(d=>Co(d)?Promise.resolve(i.transform(d.value,c)).then(m=>({status:n.value,value:m})):Qe);gt.assertNever(i)}}_o.create=(t,s,n)=>new _o({schema:t,typeName:Ye.ZodEffects,effect:s,...rt(n)});_o.createWithPreprocess=(t,s,n)=>new _o({schema:s,effect:{type:"preprocess",transform:t},typeName:Ye.ZodEffects,...rt(n)});class Zn extends pt{_parse(s){return this._getType(s)===Ie.undefined?hr(void 0):this._def.innerType._parse(s)}unwrap(){return this._def.innerType}}Zn.create=(t,s)=>new Zn({innerType:t,typeName:Ye.ZodOptional,...rt(s)});class Ao extends pt{_parse(s){return this._getType(s)===Ie.null?hr(null):this._def.innerType._parse(s)}unwrap(){return this._def.innerType}}Ao.create=(t,s)=>new Ao({innerType:t,typeName:Ye.ZodNullable,...rt(s)});class Zf extends pt{_parse(s){const{ctx:n}=this._processInputParams(s);let o=n.data;return n.parsedType===Ie.undefined&&(o=this._def.defaultValue()),this._def.innerType._parse({data:o,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}Zf.create=(t,s)=>new Zf({innerType:t,typeName:Ye.ZodDefault,defaultValue:typeof s.default=="function"?s.default:()=>s.default,...rt(s)});class Gf extends pt{_parse(s){const{ctx:n}=this._processInputParams(s),o={...n,common:{...n.common,issues:[]}},i=this._def.innerType._parse({data:o.data,path:o.path,parent:{...o}});return gd(i)?i.then(c=>
84({status:"valid",value:c.status==="valid"?c.value:this._def.catchValue({get error(){return new un(o.common.issues)},input:o.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new un(o.common.issues)},input:o.data})}}removeCatch(){return this._def.innerType}}Gf.create=(t,s)=>new Gf({innerType:t,typeName:Ye.ZodCatch,catchValue:typeof s.catch=="function"?s.catch:()=>s.catch,...rt(s)});class F0 extends pt{_parse(s){if(this._getType(s)!==Ie.nan){const o=this._getOrReturnCtx(s);return Ae(o,{code:ye.invalid_type,expected:Ie.nan,received:o.parsedType}),Qe}return{status:"valid",value:s.data}}}F0.create=t=>new F0({typeName:Ye.ZodNaN,...rt(t)});class WR extends pt{_parse(s){const{ctx:n}=this._processInputParams(s),o=n.data;return this._def.type._parse({data:o,path:n.path,parent:n})}unwrap(){return this._def.type}}class lp extends pt{_parse(s){const{status:n,ctx:o}=this._processInputParams(s);if(o.common.async)return(async()=>{const c=await this._def.in._parseAsync({data:o.data,path:o.path,parent:o});return c.status==="aborted"?Qe:c.status==="dirty"?(n.dirty(),Li(c.value)):this._def.out._parseAsync({data:c.value,path:o.path,parent:o})})();{const i=this._def.in._parseSync({data:o.data,path:o.path,parent:o});return i.status==="aborted"?Qe:i.status==="dirty"?(n.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:o.path,parent:o})}}static create(s,n){return new lp({in:s,out:n,typeName:Ye.ZodPipeline})}}class Qf extends pt{_parse(s){const n=this._def.innerType._parse(s),o=i=>(Co(i)&&(i.value=Object.freeze(i.value)),i);return gd(n)?n.then(i=>o(i)):o(n)}unwrap(){return this._def.innerType}}Qf.create=(t,s)=>new Qf({innerType:t,typeName:Ye.ZodReadonly,...rt(s)});var Ye;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(Ye||(Ye={}));const Wn=Kn.create,uo=So.create;na.create;zr.create;const q1=Kt.create;yd.create;bd.create;Ma.create;const KR=qf.create,$0=Eo.create;jd.create;Zn.create;Ao.create;var cp="Collapsible",[qR]=Ls(cp),[ZR,dp]=qR(cp),Z1=p.forwardRef((t,s)=>{const{__scopeCollapsible:n,open:o,defaultOpen:i,disabled:c,onOpenChange:d,...m}=t,[f=!1,x]=Sr({prop:o,defaultProp:i,onChange:d});return e.jsx(ZR,{scope:n,disabled:c,contentId:cr(),open:f,onOpenToggle:p.useCallback(()=>x(v=>!v),[x]),children:e.jsx(Fe.div,{"data-state":mp(f),"data-disabled":c?"":void 0,...m,ref:s})})});Z1.displayName=cp;var G1="CollapsibleTrigger",Q1=p.forwardRef((t,s)=>{const{__scopeCollapsible:n,...o}=t,i=dp(G1,n);return e.jsx(Fe.button,{type:"button","aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":mp(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled,...o,ref:s,onClick:be(t.onClick,i.onOpenToggle)})});Q1.displayName=G1;var up="CollapsibleContent",Y1=p.forwardRef((t,s)=>{const{forceMount:n,...o}=t,i=dp(up,t.__scopeCollapsible);return e.jsx(Ys,{present:n||i.open,children:({present:c})=>e.jsx(GR,{...o,ref:s,present:c})})});Y1.displayName=up;var GR=p.forwardRef((t,s)=>{const{__scopeCollapsible:n,present:o,children:i,...c}=t,d=dp(up,n),[m,f]=p.useState(o),x=p.useRef(null),v=nt(s,x),y=p.useRef(0),b=y.current,k=p.useRef(0),S=k.current,j=d.open||m,w=p.useRef(j),E=p.useRef(void 0);return p.useEffect(()=>{const C=requestAnimationFrame(()=>w.current=!1);return()=>cancelAnimationFrame(C)},[]),ls(()=>{const C=x.current;if(C){E.current=E.current||{transitionDuration:C.style.transitionDuration,animationName:C.style.animationName},C.style.transitionDuration="0s",C.style.animationName="none";const A=C.getBoundingClientRect();y.current=A.height,k.current=A.width,w.current||(C.style.transitionDuration=E.current.transitionDuration,C.style.animationName=E.current.animationName),f(o)}},[d.open,o]),e.jsx(Fe.div,{"data-state":mp(d.open),"data-disabled":d.disabled?"":void 0,id:d.contentId,hidden:!j,...c,ref:v,style:{"--radix-collapsible-content-height":b?`${b}px`:void 0,"--radix-collapsible-content-width":S?`${S}px`:void 0,...t.style},children:j&&i})});function mp(t){return t?"open":"closed"}var QR=Z1;const YR=QR,JR=Q1,XR=Y1;var eP="Label",J1=p.forwardRef((t,s)=>e.jsx(Fe.label,{...t,ref:s,onMouseDown:n=>{n.target.closest("button, input, select, textarea")||(t.onMouseDown?.(n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));J1.displayName=eP;var X1=J1;const tP=Ed("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),rs=p.forwardRef(({className:t,...s},n)=>e.jsx(X1,{ref:n,className:re(tP(),t),...s}));rs.displayName=X1.displayName;const eN=XT,tN=p.createContext({}),js=({...t})=>e.jsx(tN.Provider,{value:{name:t.name},children:e.jsx(rR,{...t})}),Yd=()=>{const t=p.useContext(tN),s=p.useContext(sN),{getFieldState:n,formState:o}=Qd(),i=n(t.name,o);if(!t)throw new Error("useFormField should be used within <FormField>");const{id:c}=s;return{id:c,name:t.name,formItemId:`${c}-form-item`,formDescriptionId:`${c}-form-item-description`,formMessageId:`${c}-form-item-message`,...i}},sN=p.createContext({}),fs=p.forwardRef(({className:t,...s},n)=>{const o=p.useId();return e.jsx(sN.Provider,{value:{id:o},children:e.jsx("div",{ref:n,className:re("space-y-2",t),...s})})});fs.displayName="FormItem";const hs=p.forwardRef(({className:t,...s},n)=>{const{error:o,formItemId:i}=Yd();return e.jsx(rs,{ref:n,className:re(o&&"text-destructive",t),htmlFor:i,...s})});hs.displayName="FormLabel";const ws=p.forwardRef(({...t},s)=>{const{error:n,formItemId:o,formDescriptionId:i,formMessageId:c}=Yd();return e.jsx(xy,{ref:s,id:o,"aria-describedby":n?`${i} ${c}`:`${i}`,"aria-invalid":!!n,...t})});ws.displayName="FormControl";const Bn=p.forwardRef(({className:t,...s},n)=>{const{formDescriptionId:o}=Yd();return e.jsx("p",{ref:n,id:o,className:re("text-sm text-muted-foreground",t),...s})});Bn.displayName="FormDescription";const ps=p.forwardRef(({className:t,children:s,...n},o)=>{const{error:i,formMessageId:c}=Yd(),d=i?String(i?.message??""):s;
84return d?e.jsx("p",{ref:o,id:c,className:re("text-sm font-medium text-destructive",t),...n,children:d}):null});ps.displayName="FormMessage";var fp="Checkbox",[sP]=Ls(fp),[rP,nP]=sP(fp),rN=p.forwardRef((t,s)=>{const{__scopeCheckbox:n,name:o,checked:i,defaultChecked:c,required:d,disabled:m,value:f="on",onCheckedChange:x,form:v,...y}=t,[b,k]=p.useState(null),S=nt(s,_=>k(_)),j=p.useRef(!1),w=b?v||!!b.closest("form"):!0,[E=!1,C]=Sr({prop:i,defaultProp:c,onChange:x}),A=p.useRef(E);return p.useEffect(()=>{const _=b?.form;if(_){const D=()=>C(A.current);return _.addEventListener("reset",D),()=>_.removeEventListener("reset",D)}},[b,C]),e.jsxs(rP,{scope:n,state:E,disabled:m,children:[e.jsx(Fe.button,{type:"button",role:"checkbox","aria-checked":Gn(E)?"mixed":E,"aria-required":d,"data-state":oN(E),"data-disabled":m?"":void 0,disabled:m,value:f,...y,ref:S,onKeyDown:be(t.onKeyDown,_=>{_.key==="Enter"&&_.preventDefault()}),onClick:be(t.onClick,_=>{C(D=>Gn(D)?!0:!D),w&&(j.current=_.isPropagationStopped(),j.current||_.stopPropagation())})}),w&&e.jsx(aP,{control:b,bubbles:!j.current,name:o,value:f,checked:E,required:d,disabled:m,form:v,style:{transform:"translateX(-100%)"},defaultChecked:Gn(c)?!1:c})]})});rN.displayName=fp;var nN="CheckboxIndicator",aN=p.forwardRef((t,s)=>{const{__scopeCheckbox:n,forceMount:o,...i}=t,c=nP(nN,n);return e.jsx(Ys,{present:o||Gn(c.state)||c.state===!0,children:e.jsx(Fe.span,{"data-state":oN(c.state),"data-disabled":c.disabled?"":void 0,...i,ref:s,style:{pointerEvents:"none",...t.style}})})});aN.displayName=nN;var aP=t=>{const{control:s,checked:n,bubbles:o=!0,defaultChecked:i,...c}=t,d=p.useRef(null),m=Qh(n),f=Nh(s);p.useEffect(()=>{const v=d.current,y=window.HTMLInputElement.prototype,k=Object.getOwnPropertyDescriptor(y,"checked").set;if(m!==n&&k){const S=new Event("click",{bubbles:o});v.indeterminate=Gn(n),k.call(v,Gn(n)?!1:n),v.dispatchEvent(S)}},[m,n,o]);const x=p.useRef(Gn(n)?!1:n);return e.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:i??x.current,...c,tabIndex:-1,ref:d,style:{...t.style,...f,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function Gn(t){return t==="indeterminate"}function oN(t){return Gn(t)?"indeterminate":t?"checked":"unchecked"}var iN=rN,oP=aN;const Jd=p.forwardRef(({className:t,...s},n)=>e.jsx(iN,{ref:n,className:re("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",t),...s,children:e.jsx(oP,{className:re("flex items-center justify-center text-current"),children:e.jsx(rl,{className:"h-4 w-4"})})}));Jd.displayName=iN.displayName;var lN=["PageUp","PageDown"],cN=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],dN={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},zo="Slider",[Yf,iP,lP]=el(zo),[uN]=Ls(zo,[lP]),[cP,Xd]=uN(zo),mN=p.forwardRef((t,s)=>{const{name:n,min:o=0,max:i=100,step:c=1,orientation:d="horizontal",disabled:m=!1,minStepsBetweenThumbs:f=0,defaultValue:x=[o],value:v,onValueChange:y=()=>{},onValueCommit:b=()=>{},inverted:k=!1,form:S,...j}=t,w=p.useRef(new Set),E=p.useRef(0),A=d==="horizontal"?dP:uP,[_=[],D]=Sr({prop:v,defaultProp:x,onChange:te=>{[...w.current][E.current]?.focus(),y(te)}}),O=p.useRef(_);function F(te){const ee=xP(_,te);z(te,ee)}function P(te){z(te,E.current)}function Z(){const te=O.current[E.current];_[E.current]!==te&&b(_)}function z(te,ee,{commit:se}={commit:!1}){const I=bP(c),le=jP(Math.round((te-o)/c)*c+o,I),ne=cd(le,[o,i]);D((J=[])=>{const U=hP(J,ne,ee);if(yP(U,f*c)){E.current=U.indexOf(ne);const q=String(U)!==String(J);return q&&se&&b(U),q?U:J}else return J})}return e.jsx(cP,{scope:t.__scopeSlider,name:n,disabled:m,min:o,max:i,valueIndexToChangeRef:E,thumbs:w.current,values:_,orientation:d,form:S,children:e.jsx(Yf.Provider,{scope:t.__scopeSlider,children:e.jsx(Yf.Slot,{scope:t.__scopeSlider,children:e.jsx(A,{"aria-disabled":m,"data-disabled":m?"":void 0,...j,ref:s,onPointerDown:be(j.onPointerDown,()=>{m||(O.current=_)}),min:o,max:i,inverted:k,onSlideStart:m?void 0:F,onSlideMove:m?void 0:P,onSlideEnd:m?void 0:Z,onHomeKeyDown:()=>
84!m&&z(o,0,{commit:!0}),onEndKeyDown:()=>!m&&z(i,_.length-1,{commit:!0}),onStepKeyDown:({event:te,direction:ee})=>{if(!m){const le=lN.includes(te.key)||te.shiftKey&&cN.includes(te.key)?10:1,ne=E.current,J=_[ne],U=c*le*ee;z(J+U,ne,{commit:!0})}}})})})})});mN.displayName=zo;var[fN,hN]=uN(zo,{startEdge:"left",endEdge:"right",size:"width",direction:1}),dP=p.forwardRef((t,s)=>{const{min:n,max:o,dir:i,inverted:c,onSlideStart:d,onSlideMove:m,onSlideEnd:f,onStepKeyDown:x,...v}=t,[y,b]=p.useState(null),k=nt(s,A=>b(A)),S=p.useRef(void 0),j=ll(i),w=j==="ltr",E=w&&!c||!w&&c;function C(A){const _=S.current||y.getBoundingClientRect(),D=[0,_.width],F=hp(D,E?[n,o]:[o,n]);return S.current=_,F(A-_.left)}return e.jsx(fN,{scope:t.__scopeSlider,startEdge:E?"left":"right",endEdge:E?"right":"left",direction:E?1:-1,size:"width",children:e.jsx(pN,{dir:j,"data-orientation":"horizontal",...v,ref:k,style:{...v.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:A=>{const _=C(A.clientX);d?.(_)},onSlideMove:A=>{const _=C(A.clientX);m?.(_)},onSlideEnd:()=>{S.current=void 0,f?.()},onStepKeyDown:A=>{const D=dN[E?"from-left":"from-right"].includes(A.key);x?.({event:A,direction:D?-1:1})}})})}),uP=p.forwardRef((t,s)=>{const{min:n,max:o,inverted:i,onSlideStart:c,onSlideMove:d,onSlideEnd:m,onStepKeyDown:f,...x}=t,v=p.useRef(null),y=nt(s,v),b=p.useRef(void 0),k=!i;function S(j){const w=b.current||v.current.getBoundingClientRect(),E=[0,w.height],A=hp(E,k?[o,n]:[n,o]);return b.current=w,A(j-w.top)}return e.jsx(fN,{scope:t.__scopeSlider,startEdge:k?"bottom":"top",endEdge:k?"top":"bottom",size:"height",direction:k?1:-1,children:e.jsx(pN,{"data-orientation":"vertical",...x,ref:y,style:{...x.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:j=>{const w=S(j.clientY);c?.(w)},onSlideMove:j=>{const w=S(j.clientY);d?.(w)},onSlideEnd:()=>{b.current=void 0,m?.()},onStepKeyDown:j=>{const E=dN[k?"from-bottom":"from-top"].includes(j.key);f?.({event:j,direction:E?-1:1})}})})}),pN=p.forwardRef((t,s)=>{const{__scopeSlider:n,onSlideStart:o,onSlideMove:i,onSlideEnd:c,onHomeKeyDown:d,onEndKeyDown:m,onStepKeyDown:f,...x}=t,v=Xd(zo,n);return e.jsx(Fe.span,{...x,ref:s,onKeyDown:be(t.onKeyDown,y=>{y.key==="Home"?(d(y),y.preventDefault()):y.key==="End"?(m(y),y.preventDefault()):lN.concat(cN).includes(y.key)&&(f(y),y.preventDefault())}),onPointerDown:be(t.onPointerDown,y=>{const b=y.target;b.setPointerCapture(y.pointerId),y.preventDefault(),v.thumbs.has(b)?b.focus():o(y)}),onPointerMove:be(t.onPointerMove,y=>{y.target.hasPointerCapture(y.pointerId)&&i(y)}),onPointerUp:be(t.onPointerUp,y=>{const b=y.target;b.hasPointerCapture(y.pointerId)&&(b.releasePointerCapture(y.pointerId),c(y))})})}),xN="SliderTrack",gN=p.forwardRef((t,s)=>{const{__scopeSlider:n,...o}=t,i=Xd(xN,n);return e.jsx(Fe.span,{"data-disabled":i.disabled?"":void 0,"data-orientation":i.orientation,...o,ref:s})});gN.displayName=xN;var Jf="SliderRange",vN=p.forwardRef((t,s)=>{const{__scopeSlider:n,...o}=t,i=Xd(Jf,n),c=hN(Jf,n),d=p.useRef(null),m=nt(s,d),f=i.values.length,x=i.values.map(b=>bN(b,i.min,i.max)),v=f>1?Math.min(...x):0,y=100-Math.max(...x);return e.jsx(Fe.span,{"data-orientation":i.orientation,"data-disabled":i.disabled?"":void 0,...o,ref:m,style:{...t.style,[c.startEdge]:v+"%",[c.endEdge]:y+"%"}})});vN.displayName=Jf;var Xf="SliderThumb",yN=p.forwardRef((t,s)=>{const n=iP(t.__scopeSlider),[o,i]=p.useState(null),c=nt(s,m=>i(m)),d=p.useMemo(()=>o?n().findIndex(m=>m.ref.current===o):-1,[n,o]);return e.jsx(mP,{...t,ref:c,index:d})}),mP=p.forwardRef((t,s)=>{const{__scopeSlider:n,index:o,name:i,...c}=t,d=Xd(Xf,n),m=hN(Xf,n),[f,x]=p.useState(null),v=nt(s,C=>x(C)),y=f?d.form||!!f.closest("form"):!0,b=Nh(f),k=d.values[o],S=k===void 0?0:bN(k,d.min,d.max),j=pP(o,d.values.length),w=b?.[m.size],E=w?gP(w,S,m.direction):0;return p.useEffect(()=>{if(f)return d.thumbs.add(f),()=>{d.thumbs.delete(f)}},[f,d.thumbs]),e.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[m.startEdge]:`calc(${S}% + ${E}px)`},children:[e.jsx(Yf.ItemSlot,{scope:t.__scopeSlider,children:e.jsx(Fe.span,{role:"slider","aria-label":t["aria-label"]||j,"aria-valuemin":d.min,"aria-valuenow":k,"aria-valuemax":d.max,"aria-orientation":d.orientation,"data-orientation":d.orientation,"data-disabled":d.disabled?"":void 0,tabIndex:d.disabled?void 0:0,...c,ref:v,style:k===void 0?{display:"none"}:t.style,onFocus:be(t.onFocus,()=>{d.valueIndexToChangeRef.current=o})})}),y&&e.jsx(fP,{name:i??(d.name?d.name+(d.values.length>1?"[]":""):void 0),form:d.form,value:k},o)]})});yN.displayName=Xf;var fP=t=>{const{value:s,...n}=t,o=p.useRef(null),i=Qh(s);return p.useEffect(()=>{const c=o.current,d=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(d,"value").set;if(i!==s&&f){const x=new Event("input",{bubbles:!0});f.call(c,s),c.dispatchEvent(x)}},[i,s]),e.jsx("input",{style:{display:"none"},...n,ref:o,defaultValue:s})};function hP(t=[],s,n){const o=[...t];return o[n]=s,o.sort((i,c)=>i-c)}function bN(t,s,n){const c=100/(n-s)*(t-s);return cd(c,[0,100])}function pP(t,s){return s>2?`Value ${t+1} of ${s}`:s===2?["Minimum","Maximum"][t]:void 0}function xP(t,s){if(t.length===1)return 0;const n=t.map(i=>Math.abs(i-s)),o=Math.min(...n);return n.indexOf(o)}function gP(t,s,n){const o=t/2,c=hp([0,50],[0,o]);return(o-c(s)*n)*n}function vP(t){return t.slice(0,-1).map((s,n)=>t[n+1]-s)}function yP(t,s){if(s>0){const n=vP(t);return Math.min(...n)>=s}return!0}function hp(t,s){return n=>{if(t[0]===t[1]||s[0]===s[1])return s[0];const o=(s[1]-s[0])/(t[1]-t[0]);return s[0]+o*(n-t[0])}}function bP(t){return(String(t).split(".")[1]||"").length}function jP(t,s){const n=Math.pow(10,s);return Math.round(t*n)/n}var jN=mN,wP=gN,NP=vN,kP=yN;const eh=p.forwardRef(({className:t,...s},n)=>e.jsxs(jN,{ref:n,className:re("relative flex w-full touch-none select-none items-center",t),...s,children:[e.jsx(wP,{className:"relative h-2 w-full grow overflow-hidden rounded-full bg-secondary",children:e.jsx(NP,{className:"absolute h-full bg-primary"})}),e.jsx(kP,{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"})]}));eh.displayName=jN.displayName;const CP=q1({agentId:uo({required_error:"Select a provider agent"}).min(1,"Select a provider agent"),taskDescription:Wn().min(10,"Description must be at least 10 characters"),paymentMethod:$0(["USDC","x402","Stripe","USDC_SEPOLIA"]),escrowAmount:uo().min(0,"Must be >= 0"),escrowToken:Wn().default("USDC"),evaluatorAddress:Wn().optional(),evaluatorType:$0(["ai_agent","smart_contract_zk","multisig_dao","self"]),perTransaction:uo().min(0).default(100),perPeriod:uo().min(0).default(1e3),periodDays:uo().min(1).default(30),totalBudget:uo().min(0).default(5e3)}),V0=[{value:"ai_agent",label:"AI Agent",description:"Another on-chain AI agent evaluates deliverables",icon:Os},{value:"smart_contract_zk",label:"Smart Contract (ZK)",description:"Zero-knowledge proof verification on-chain",icon:Io},{value:"multisig_dao",label:"Multisig / DAO",description:"Multi-signature or DAO governance approval",icon:eb},{value:"self",label:"Self (Client)",description:"You review and approve deliverables yourself",icon:wo}
84],z0=[{key:"open",label:"Open",icon:ir},{key:"submitted",label:"Submitted",icon:PS},{key:"completed",label:"Complete",icon:tt}],SP=[{key:"rejected",label:"Rejected",icon:Pt},{key:"expired",label:"Expired",icon:Do}];function EP(){const{toast:t}=Yt(),{session:s}=fr(),[,n]=Xi(),[o,i]=p.useState([]),[c,d]=p.useState("{}"),[m,f]=p.useState(!1),[x,v]=p.useState([]),[y,b]=p.useState(""),[k,S]=p.useState(""),[j,w]=p.useState(""),[E,C]=p.useState(""),[A,_]=p.useState(""),[D,O]=p.useState(""),[F,P]=p.useState(""),[Z,z]=p.useState(""),[te,ee]=p.useState({}),[se,I]=p.useState(50),[le,ne]=p.useState(10),[J,U]=p.useState(null),[q,V]=p.useState(!1),[R,Q]=p.useState(!1),[Ne,Pe]=p.useState(!1),[ze,Ve]=p.useState(null);p.useEffect(()=>{if(!window.ethereum)return;window.ethereum.request({method:"eth_chainId"}).then(ke=>{Ve(parseInt(ke,16))}).catch(()=>{});const H=ke=>Ve(parseInt(ke,16));return window.ethereum.on("chainChanged",H),()=>{window.ethereum?.removeListener?.("chainChanged",H)}},[]);const fe=new URLSearchParams(window.location.search),De=parseInt(fe.get("agentId")||"0");fe.get("chain");const{data:$e,isLoading:qe}=He({queryKey:["/api/agents",{limit:200}],queryFn:()=>fetch("/api/agents?limit=200").then(H=>H.json())}),pe=$e?.agents,{data:je,isLoading:we}=He({queryKey:["/api/tools"]}),{data:Ee,isLoading:Ze}=He({queryKey:["/api/connected-services"],enabled:s.authenticated}),{data:it}=He({queryKey:["/api/integrations/status"],enabled:s.authenticated}),{data:yt}=He({queryKey:["/api/integrations/scope-catalog"],enabled:s.authenticated}),Ot=Ee?.filter(H=>H.status==="active")||[],Jt=Ot.map(H=>H.serviceName),vt=z1({resolver:U1(CP),defaultValues:{agentId:De||0,taskDescription:"",paymentMethod:"USDC",escrowAmount:0,escrowToken:"USDC",evaluatorAddress:"",evaluatorType:"self",perTransaction:100,perPeriod:1e3,periodDays:30,totalBudget:5e3}}),Mt=vt.watch("evaluatorType"),M=vt.watch("paymentMethod"),W=vt.watch("agentId"),X=vt.watch("escrowAmount"),ge=pe?.find(H=>H.id===vt.watch("agentId")),xe=!!ge?.circlePaymentAddress,oe=xe&&(M==="USDC"||M==="x402"),Ce=ge?.executionMode==="always_on",{data:Je}=He({queryKey:["/api/payments/circle/balance"],enabled:s.authenticated&&oe}),at=M==="USDC_SEPOLIA",Nt=!window.ethereum||ze===null||ze===11155111,{data:gs}=He({queryKey:["/api/payments/sepolia/config"],enabled:at}),{data:As}=He({queryKey:["/api/payments/sepolia/balance",s.address],queryFn:()=>fetch(`/api/payments/sepolia/balance/${s.address}`).then(H=>H.json()),enabled:at&&!!s.address&&/^0x[0-9a-fA-F]{40}$/.test(s.address||""),refetchInterval:at?3e4:!1});async function mn(){if(!window.ethereum){t({title:"Wallet not found",description:"Connect a wallet to transfer USDC",variant:"destructive"});return}const H=vt.getValues();if(!H.agentId||!H.taskDescription||H.taskDescription.length<10){t({title:"Validation error",description:"Please fill in the agent and task description",variant:"destructive"});return}if(!gs?.escrowAddress){t({title:"Escrow not configured",description:"SEPOLIA_ESCROW_ADDRESS is not set on this server",variant:"destructive"});return}const ke=H.escrowAmount||0;if(ke<=0){t({title:"Invalid amount",description:"Enter an escrow amount greater than 0",variant:"destructive"});return}Pe(!0);try{const lt=await window.ethereum.request({method:"eth_chainId"});if(parseInt(lt,16)!==11155111)try{await window.ethereum.request({method:"wallet_switchEthereumChain",params:[{chainId:"0xaa36a7"}]})}catch{t({title:"Wrong network",description:"Please switch to Sepolia testnet",variant:"destructive"}),Pe(!1);return}const ut=gs.usdcAddress||"0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238",Js=gs.escrowAddress,Wr=BigInt(Math.round(ke*1e6)),ca="a9059cbb",eu=Js.replace("0x","").toLowerCase().padStart(64,"0"),da=Wr.toString(16).padStart(64,"0"),Oa="0x"+ca+eu+da,Wo=(await window.ethereum.request({method:"eth_requestAccounts"}))[0],Ko=await window.ethereum.request({method:"eth_sendTransaction",params:[{from:Wo,to:ut,data:Oa,gas:"0x186a0"}]});t({title:"Transfer broadcasted",description:`Waiting for on-chain confirmation (Tx ${Ko.slice(0,10)}...)`});const{createPublicClient:tu,http:su}=await md(async()=>{const{createPublicClient:gn,http:vl}=await import("./index-BvZPcapo.js");return{createPublicClient:gn,http:vl}},__vite__mapDeps([0,1])),{sepolia:Kr}=await md(async()=>{const{sepolia:gn}=await import("./index-BbM11wFc.js");return{sepolia:gn}}
84,__vite__mapDeps([2,1]));if((await tu({chain:Kr,transport:su()}).waitForTransactionReceipt({hash:Ko,timeout:3e5,pollingInterval:3e3})).status!=="success")throw new Error("Transaction reverted on-chain. Please check Sepolia Etherscan for details.");t({title:"Confirmed on-chain",description:"Transaction mined â creating job record..."});let gl={};try{gl=JSON.parse(c)}catch{}const qo=await fetch("/api/payments/sepolia/submit",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({txHash:Ko,agentId:H.agentId,taskDescription:H.taskDescription,escrowAmount:ke,taskPayload:gl,contextAttachments:x.length>0?x:void 0,delegatedScopes:Object.keys(te).length>0?te:void 0,selectedTools:o})});if(!qo.ok){const gn=await qo.json();throw new Error(gn.message||"Failed to submit job")}ct.invalidateQueries({queryKey:["/api/jobs"]}),t({title:"Job created",description:"Sepolia USDC escrow job created successfully."}),n("/jobs")}catch(lt){lt.code===4001?t({title:"Transaction rejected",description:"You rejected the wallet transaction",variant:"destructive"}):t({title:"Transfer failed",description:lt.message||"Unknown error",variant:"destructive"})}finally{Pe(!1)}}p.useEffect(()=>{if(yt&&Jt.length>0){const H={};for(const ke of Jt){const lt=yt[ke];lt&&(H[ke]=lt.filter(ut=>ut.risk==="low").map(ut=>ut.scope))}ee(H)}},[yt,Jt.join(",")]),p.useEffect(()=>{if(oe&&Je&&J){const H=J.estimatedTotal||J.perCallCost*(J.estimatedCalls||0);Q(Je.balance<H)}else Q(!1)},[oe,Je,J]),p.useEffect(()=>{(M==="USDC"||M==="x402")&&W>0?(V(!0),fetch("/api/payments/estimate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({agentId:W})}).then(H=>H.json()).then(H=>{U(H),V(!1)}).catch(()=>V(!1))):U(null)},[M,W]);const ia=Ut({mutationFn:async H=>{let ke={};try{ke=JSON.parse(c)}catch{ke={}}const lt={agentId:H.agentId,taskDescription:H.taskDescription,taskPayload:ke,selectedTools:o,contextAttachments:x.length>0?x:void 0,spendingLimits:{perTransaction:H.perTransaction,perPeriod:H.perPeriod,periodDays:H.periodDays,totalBudget:H.totalBudget},status:"open",escrowAmount:H.escrowAmount,escrowToken:H.escrowToken,evaluatorAddress:H.evaluatorAddress||null,evaluatorType:H.evaluatorType,paymentMethod:H.paymentMethod,executionMode:Ce?"always_on":"manual",connectedServicesSnapshot:Ot.map(Wr=>Wr.serviceName),delegatedScopes:Object.keys(te).length>0?te:void 0,toolCallLimits:{maxCalls:se,perMinuteLimit:le}};return(await dt("POST",Ce?"/api/jobs/instant":"/api/jobs",lt)).json()},onSuccess:()=>{ct.invalidateQueries({queryKey:["/api/jobs"]}),t({title:"Job Created",description:"Your ERC-8183 job has been submitted successfully."}),n("/jobs")},onError:H=>{t({title:"Error",description:H.message,variant:"destructive"})}});function fn(){if(!k.trim())return;const H={type:"text",name:y.trim()||"Text Note",content:k.trim(),mimeType:"text/markdown"};v(ke=>[...ke,H]),b(""),S("")}function la(){if(!j.trim())return;const H={type:"link",name:E.trim()||j.trim(),content:j.trim(),description:A.trim()||void 0};v(ke=>[...ke,H]),w(""),C(""),_("")}function hn(){if(!D.trim()||!F.trim())return;const H={type:"file_reference",name:F.trim(),content:D.trim(),mimeType:Z.trim()||void 0};v(ke=>[...ke,H]),O(""),P(""),z("")}function Bo(H){v(ke=>ke.filter((lt,ut)=>ut!==H))}function Uo(H){switch(H){case"text":return Qn;case"link":return an;case"file_reference":return wf;case"inline_data":return Wc}}function pn(H){i(ke=>ke.includes(H)?ke.filter(lt=>lt!==H):[...ke,H])}function xn(H,ke){ee(lt=>{const ut=lt[H]||[],Js=ut.includes(ke)?ut.filter(Wr=>Wr!==ke):[...ut,ke];return{...lt,[H]:Js}})}function hl(H){switch(H){case"low":return"bg-emerald-500/15 text-emerald-600 dark:text-emerald-400 border-emerald-500/30";case"medium":return"bg-amber-500/15 text-amber-600 dark:text-amber-400 border-amber-500/30";case"high":return"bg-red-500/15 text-red-600 dark:text-red-400 border-red-500/30"}}function pl(H){ia.mutate(H)}const xl=je?.tools?.reduce((H,ke)=>(H[ke.category]||(H[ke.category]=[]),H[ke.category].push(ke),H),{})||{};return qe||we?e.jsxs("div",{className:"max-w-4xl mx-auto px-4 sm:px-6 py-8 space-y-6",children:[e.jsx(ot,{className:"h-10 w-64"}),e.jsx(ot,{className:"h-96 rounded-xl"})]}):e.jsxs("div",{className:"min-h-screen",children:[e.jsx("div",{className:"border-b border-border bg-card/30",children:e.jsxs("div",{className:"max-w-4xl mx-auto px-4 sm:px-6 py-8",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx(Y,{variant:"outline",className:"text-[10px]",children:"ERC-8183"}),e.jsx("span",{className:"text-xs text-muted-foreground",children:"Agentic Commerce"})]}),e.jsx("h1",{className:"text-3xl font-bold text-foreground mb-2","data-testid":"text-hire-title",children:"Hire a Provider Agent"}),e.jsx("p",{className:"text-muted-foreground",children:"Create an ERC-8183 job with Client/Provider/Evaluator roles, escrowed payment, and scoped permissions"}),e.jsxs("div",{className:"mt-6",children:[e.jsx("p",{className:"text-[10px] font-medium text-muted-foreground uppercase tracking-wider mb-3",children:"Job Lifecycle"}),e.jsxs("div",{className:"flex items-center gap-1 flex-wrap","data-testid":"lifecycle-preview",children:[z0.map((H,ke)=>{const lt=H.icon;return e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsxs("div",{className:"flex items-center gap-1 px-2 py-1 rounded-md text-[10px] font-medium bg-muted/50 text-muted-foreground",children:[e.jsx(lt,{className:"h-3 w-3"}),H.label]}),ke<z0.length-1&&e.jsx(Cs,{className:"h-3 w-3 text-muted-foreground
84/40 shrink-0"})]},H.key)}),e.jsx("span",{className:"text-[10px] text-muted-foreground/50 mx-1",children:"or"}),SP.map(H=>{const ke=H.icon;return e.jsxs("div",{className:"flex items-center gap-1 px-2 py-1 rounded-md text-[10px] font-medium bg-muted/50 text-muted-foreground",children:[e.jsx(ke,{className:"h-3 w-3"}),H.label]},H.key)})]})]})]})}),e.jsx("div",{className:"max-w-4xl mx-auto px-4 sm:px-6 py-8",children:e.jsx(eN,{...vt,children:e.jsxs("form",{onSubmit:vt.handleSubmit(pl),className:"space-y-6",children:[e.jsx(ue,{className:"border-card-border",children:e.jsxs(me,{className:"p-6 space-y-5",children:[e.jsxs("h2",{className:"text-lg font-semibold text-foreground flex items-center gap-2",children:[e.jsx(Hc,{className:"h-5 w-5 text-primary"}),"ERC-8183 Roles"]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-[10px] font-medium text-muted-foreground uppercase tracking-wider",children:"Client (Buyer)"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(wo,{className:"h-4 w-4 text-muted-foreground"}),e.jsx("span",{className:"text-sm text-foreground font-medium","data-testid":"text-client-address",children:s.authenticated&&s.address?`${s.address.slice(0,6)}...${s.address.slice(-4)}`:"Connect wallet"})]}),e.jsx("p",{className:"text-[10px] text-muted-foreground",children:"You commission and pay for the work"})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-[10px] font-medium text-muted-foreground uppercase tracking-wider",children:"Provider (Agent)"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Os,{className:"h-4 w-4 text-muted-foreground"}),e.jsx("span",{className:"text-sm text-foreground font-medium","data-testid":"text-provider-agent",children:ge?ge.name:"Select below"})]}),e.jsx("p",{className:"text-[10px] text-muted-foreground",children:"The agent that performs the task"})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-[10px] font-medium text-muted-foreground uppercase tracking-wider",children:"Evaluator (Verifier)"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Ct,{className:"h-4 w-4 text-muted-foreground"}),e.jsx("span",{className:"text-sm text-foreground font-medium","data-testid":"text-evaluator-role",children:V0.find(H=>H.value===Mt)?.label||"Self"})]}),e.jsx("p",{className:"text-[10px] text-muted-foreground",children:"Attests that work is complete"})]})]})]})}),e.jsx(ue,{className:"border-card-border",children:e.jsxs(me,{className:"p-6 space-y-5",children:[e.jsxs("h2",{className:"text-lg font-semibold text-foreground flex items-center gap-2",children:[e.jsx(Os,{className:"h-5 w-5 text-primary"}),"Provider Selection"]}),e.jsx(js,{control:vt.control,name:"agentId",render:({field:H})=>e.jsxs(fs,{children:[e.jsx(hs,{children:"Select Provider Agent"}),e.jsxs(ur,{value:H.value?String(H.value):"",onValueChange:ke=>H.onChange(parseInt(ke)),children:[e.jsx(ws,{children:e.jsx(qs,{"data-testid":"select-agent",children:e.jsx(mr,{placeholder:"Choose a provider agent to hire"})})}),e.jsx(Zs,{children:pe?.map(ke=>e.jsxs(ft,{value:String(ke.id),children:[ke.name," (",ke.chain,")"]},ke.id))})]}),e.jsx(Bn,{children:"The on-chain agent that will execute the task"}),e.jsx(ps,{})]})}),e.jsx(js,{control:vt.control,name:"taskDescription",render:({field:H})=>e.jsxs(fs,{children:[e.jsx(hs,{children:"Task Description"}),e.jsx(ws,{children:e.jsx(Vr,{placeholder:"Describe what you want the provider agent to do...",className:"resize-none min-h-[100px]","data-testid":"input-task-description",...H})}),e.jsx(ps,{})]})}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(hh,{className:"h-4 w-4 text-primary"}),e.jsx("p",{className:"text-sm font-medium text-foreground",children:"Context & Attachments"}),e.jsx(Y,{variant:"outline",className:"text-[10px]",children:"A2A Parts"})]}),e.jsx("p",{className:"text-[10px] text-muted-foreground",children:"Provide context documents, reference links, and file references for the agent. Follows the A2A Parts format for interoperability."}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2 p-3 rounded-md border border-border bg-muted/20",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Qn,{className:"h-3.5 w-3.5 text-muted-foreground"}),e.jsx("p",{className:"text-xs font-medium text-foreground",children:"Text Notes"}),e.jsx("span",{className:"text-[10px] text-muted-foreground",children:"(markdown supp
84orted)"})]}),e.jsx(et,{placeholder:"Note title (optional)",value:y,onChange:H=>b(H.target.value),"data-testid":"input-text-note-name"}),e.jsx(Vr,{placeholder:"Add freeform context, instructions, or notes for the agent...",className:"resize-none min-h-[80px] text-sm",value:k,onChange:H=>S(H.target.value),"data-testid":"input-text-note-content"}),e.jsx("div",{className:"flex justify-end",children:e.jsxs(ie,{type:"button",size:"sm",variant:"secondary",onClick:fn,disabled:!k.trim(),"data-testid":"button-add-text-note",children:[e.jsx(ka,{className:"h-3.5 w-3.5 mr-1"}),"Add Note"]})})]}),e.jsxs("div",{className:"space-y-2 p-3 rounded-md border border-border bg-muted/20",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(an,{className:"h-3.5 w-3.5 text-muted-foreground"}),e.jsx("p",{className:"text-xs font-medium text-foreground",children:"Add Link"})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2",children:[e.jsx(et,{placeholder:"https://docs.example.com/api",value:j,onChange:H=>w(H.target.value),"data-testid":"input-link-url"}),e.jsx(et,{placeholder:"Link name (optional)",value:E,onChange:H=>C(H.target.value),"data-testid":"input-link-name"})]}),e.jsx(et,{placeholder:"Description (optional)",value:A,onChange:H=>_(H.target.value),"data-testid":"input-link-description"}),e.jsx("div",{className:"flex justify-end",children:e.jsxs(ie,{type:"button",size:"sm",variant:"secondary",onClick:la,disabled:!j.trim(),"data-testid":"button-add-link",children:[e.jsx(ka,{className:"h-3.5 w-3.5 mr-1"}),"Add Link"]})})]}),e.jsxs("div",{className:"space-y-2 p-3 rounded-md border border-border bg-muted/20",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(wf,{className:"h-3.5 w-3.5 text-muted-foreground"}),e.jsx("p",{className:"text-xs font-medium text-foreground",children:"Add File Reference"})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2",children:[e.jsx(et,{placeholder:"IPFS hash, Arweave TX, or file URL",value:D,onChange:H=>O(H.target.value),"data-testid":"input-file-ref-url"}),e.jsx(et,{placeholder:"File name",value:F,onChange:H=>P(H.target.value),"data-testid":"input-file-ref-name"})]}),e.jsx(et,{placeholder:"MIME type (e.g. application/pdf, text/csv)",value:Z,onChange:H=>z(H.target.value),"data-testid":"input-file-ref-mime"}),e.jsx("div",{className:"flex justify-end",children:e.jsxs(ie,{type:"button",size:"sm",variant:"secondary",onClick:hn,disabled:!D.trim()||!F.trim(),"data-testid":"button-add-file-ref",children:[e.jsx(ka,{className:"h-3.5 w-3.5 mr-1"}),"Add File Reference"]})})]})]}),x.length>0&&e.jsxs("div",{className:"space-y-2","data-testid":"attachments-list",children:[e.jsxs("p",{className:"text-[10px] font-medium text-muted-foreground uppercase tracking-wider",children:["Attachments (",x.length,")"]}),e.jsx("div",{className:"space-y-1.5",children:x.map((H,ke)=>{const lt=Uo(H.type);return e.jsxs("div",{className:"flex items-center gap-2 p-2 rounded-md border border-border bg-card","data-testid":`attachment-item-${ke}`,children:[e.jsx(lt,{className:"h-4 w-4 text-muted-foreground shrink-0"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:H.name}),e.jsxs("p",{className:"text-[10px] text-muted-foreground truncate",children:[H.type==="text"&&`${H.content.slice(0,80)}${H.content.length>80?"...":""}`,H.type==="link"&&H.content,H.type==="file_reference"&&`${H.content}${H.mimeType?` (${H.mimeType})`:""}`,H.type==="inline_data"&&`${H.mimeType||"data"}`]})]}),e.jsx(Y,{variant:"outline",className:"text-[10px] shrink-0",children:H.type}),e.jsx(ie,{type:"button",size:"icon",variant:"ghost",onClick:()=>Bo(ke),"data-testid":`button-remove-attachment-${ke}`,children:e.jsx(ol,{className:"h-3.5 w-3.5"})})]},ke)})})]}),e.jsxs(YR,{open:m,onOpenChange:f,children:[e.jsx(JR,{asChild:!0,children:e.jsxs(ie,{type:"button",variant:"ghost",size:"sm",className:"gap-1 text-xs text-muted-foreground","data-testid":"button-toggle-advanced-payload",children:[e.jsx(Wc,{className:"h-3.5 w-3.5"}),"Advanced: Raw JSON Payload",m?e.jsx(Ar,{className:"h-3.5 w-3.5"}):e.jsx(Cs,{className:"h-3.5 w-3.5"})]})}),e.jsxs(XR,{className:"mt-2 space-y-2",children:[e.jsx(Vr,{placeholder:'{"customer": "Acme Corp", "amount": 1500, "lineItems": [...]}',className:"resize-none min-h-[80px] font-mono text-xs",value:c,onChange:H=>d(H.target.value),"data-testid":"input-task-payload"}),e.jsx("p",{className:"text-[10px] text-muted-foreground",children:"Structured input data for the task (optional)"})]})]})]}),ge&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(Y,{variant:"secondary",className:re("text-xs",ge.executionMode==="always_on"?"bg-emerald-500/10 text-emerald-600 dark:text-emerald-400":"bg-muted text-muted-foreground"),"data-testid":"badge-hire-execution-mode",children:[ge.executionMode==="always_on"?e.jsx(ht,{className:"h-3 w-3 mr-1"}
84):e.jsx(Do,{className:"h-3 w-3 mr-1"}),ge.executionMode==="always_on"?"Always-On":"Manual Acceptance"]}),e.jsx("span",{className:"text-[10px] text-muted-foreground",children:ge.executionMode==="always_on"?"This agent executes instantly upon job creation":"This agent requires manual acceptance before execution"})]})]})}),e.jsx(ue,{className:"border-card-border",children:e.jsxs(me,{className:"p-6 space-y-5",children:[e.jsxs("h2",{className:"text-lg font-semibold text-foreground flex items-center gap-2",children:[e.jsx(Ct,{className:"h-5 w-5 text-primary"}),"Evaluator Configuration"]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"The evaluator attests whether the provider has completed the task. Choose who verifies deliverables."}),e.jsx(js,{control:vt.control,name:"evaluatorType",render:({field:H})=>e.jsxs(fs,{children:[e.jsx(hs,{children:"Evaluator Type"}),e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:V0.map(ke=>{const lt=H.value===ke.value,ut=ke.icon;return e.jsxs("div",{className:re("flex items-start gap-3 p-3 rounded-md cursor-pointer border transition-colors",lt?"border-primary/40 bg-primary/5":"border-border"),onClick:()=>H.onChange(ke.value),"data-testid":`evaluator-type-${ke.value}`,children:[e.jsx(ut,{className:re("h-5 w-5 mt-0.5 shrink-0",lt?"text-primary":"text-muted-foreground")}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:re("text-sm font-medium",lt?"text-foreground":"text-muted-foreground"),children:ke.label}),e.jsx("p",{className:"text-[10px] text-muted-foreground leading-relaxed",children:ke.description})]}),lt&&e.jsx(tt,{className:"h-4 w-4 text-primary shrink-0 mt-0.5 ml-auto"})]},ke.value)})}),e.jsx(ps,{})]})}),Mt!=="self"&&e.jsx(js,{control:vt.control,name:"evaluatorAddress",render:({field:H})=>e.jsxs(fs,{children:[e.jsxs(hs,{children:["Evaluator Address",Mt==="ai_agent"&&" (Agent)",Mt==="smart_contract_zk"&&" (Contract)",Mt==="multisig_dao"&&" (Multisig/DAO)"]}),e.jsx(ws,{children:e.jsx(et,{placeholder:"0x...","data-testid":"input-evaluator-address",...H})}),e.jsxs(Bn,{children:[Mt==="ai_agent"&&"Address of the AI agent that will evaluate deliverables",Mt==="smart_contract_zk"&&"Address of the ZK verification contract",Mt==="multisig_dao"&&"Address of the multisig wallet or DAO contract"]}),e.jsx(ps,{})]})})]})}),e.jsx(ue,{className:"border-card-border",children:e.jsxs(me,{className:"p-6 space-y-5",children:[e.jsxs("h2",{className:"text-lg font-semibold text-foreground flex items-center gap-2",children:[e.jsx(on,{className:"h-5 w-5 text-primary"}),"Connected Services (Vault)"]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"These OAuth-connected services from your Vault will be available to the provider agent during task execution."}),s.authenticated?Ze?e.jsxs("div",{className:"space-y-2",children:[e.jsx(ot,{className:"h-8 w-full"}),e.jsx(ot,{className:"h-8 w-3/4"})]}):Ot.length>0?e.jsxs("div",{className:"space-y-3",children:[e.jsx("div",{className:"flex gap-2 flex-wrap",children:Ot.map(H=>e.jsxs(Y,{variant:"secondary",className:"text-xs","data-testid":`badge-connected-service-${H.id}`,children:[e.jsx(tt,{className:"h-3 w-3 mr-1 text-green-500"}),H.serviceName]},H.id))}),e.jsxs("p",{className:"text-[10px] text-muted-foreground",children:[Ot.length," service",Ot.length!==1?"s":""," will be snapshotted into the job for the provider agent"]})]}):e.jsxs("div",{className:"flex items-center gap-3 p-4 rounded-md bg-muted/50 border border-border",children:[e.jsx(mo,{className:"h-5 w-5 text-muted-foreground shrink-0"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-foreground",children:"No services connected"}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Visit the ",e.jsx(kt,{href:"/vault",className:"underline text-primary",children:"Vault"})," to connect OAuth services the agent can use"]})]})]}):e.jsxs("div",{className:"flex items-center gap-3 p-4 rounded-md bg-muted/50 border border-border",children:[e.jsx(mo,{className:"h-5 w-5 text-muted-foreground shrink-0"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-foreground",children:"Wallet not connected"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Connect your wallet to see available services"})]})]})]})}),s.authenticated&&Ot.length>0&&yt&&e.jsx(ue,{className:"border-card-border","data-testid":"card-tool-permissions",children:e.jsxs(me,{className:"p-6 space-y-5",children:[e.jsxs("h2",{className:"text-lg font-semibold text-foreground flex items-center gap-2",children:[e.jsx(kf,{className:"h-5 w-5 text-primary"}),"Tool Permissions"]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Select which scopes/permissions the agent gets for each connected service. Low-risk scopes are selected by default."}),Jt.map(H=>{const ke=yt[H];if(!ke||ke.length===0)return null;const lt=te[H]||[];return e.jsxs("div",{className:"space-y-2","data-testid":`scope-group-${H.replace(/\s/g,"-").toLowerCase()}`,children:[e.jsx("p",{className:"text-xs font-medium text-foreground",children:H}),e.jsx("div",{className:"space-y-1.5",children:ke.map(ut=>{const Js=lt.includes(ut.scope);return e.jsxs("label",{className:"flex items-start gap-3 p-2.5 rounded-md border border-border bg-muted/20 cursor-pointer hover-elevate","data-testid":`scope-item-${H.replace(/\s/g,"-").toLowerCase()}-${ut.scope.replace(/[:/]/g,"-")}`,children:[e.jsx(Jd,{checked:Js,onCheckedChange:()=>xn(H,ut.scope),"data-testid":`checkbox-scope-${H.replace(/\s/g,"-").toLowerCase()}-${ut.scope.replace(/[:/]/g,"-")}`}),e.jsxs("div",{className:"flex-1 min-w-0 space-y-0.5",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx("span",{className:"text-sm font-medium text-foreground",children:ut.label}),e.jsx(Y,{variant:"outline",className:re("text-[10px]",hl(ut.risk)),"data-testid":`badge-risk-${ut.risk}`,children:ut.risk})]}),e.jsx("p",{className:"text-[11px] text-muted-foreground",children:ut.description}
84),e.jsx("p",{className:"text-[10px] text-muted-foreground/70 font-mono",children:ut.scope})]})]},ut.scope)})})]},H)})]})}),e.jsx(ue,{className:"border-card-border","data-testid":"card-tool-call-limits",children:e.jsxs(me,{className:"p-6 space-y-5",children:[e.jsxs("h2",{className:"text-lg font-semibold text-foreground flex items-center gap-2",children:[e.jsx(DS,{className:"h-5 w-5 text-primary"}),"Tool Call Limits"]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Configure rate limits for tool proxy calls the agent can make during execution. These limits protect against runaway usage."}),e.jsxs("div",{className:"space-y-5",children:[e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2 flex-wrap",children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:"Max Total Calls"}),e.jsx("span",{className:"text-sm font-bold tabular-nums text-foreground","data-testid":"text-max-tool-calls",children:se})]}),e.jsx(eh,{value:[se],onValueChange:H=>I(H[0]),min:10,max:200,step:5,"data-testid":"slider-max-tool-calls"}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-[10px] text-muted-foreground",children:"10"}),e.jsx("span",{className:"text-[10px] text-muted-foreground",children:"Maximum number of tool proxy calls per job"}),e.jsx("span",{className:"text-[10px] text-muted-foreground",children:"200"})]})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2 flex-wrap",children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:"Per-Minute Rate Limit"}),e.jsx("span",{className:"text-sm font-bold tabular-nums text-foreground","data-testid":"text-per-minute-limit",children:le})]}),e.jsx(eh,{value:[le],onValueChange:H=>ne(H[0]),min:1,max:30,step:1,"data-testid":"slider-per-minute-limit"}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-[10px] text-muted-foreground",children:"1"}),e.jsx("span",{className:"text-[10px] text-muted-foreground",children:"Max calls per minute to prevent burst usage"}),e.jsx("span",{className:"text-[10px] text-muted-foreground",children:"30"})]})]}),J&&e.jsxs("div",{className:"p-3 rounded-md bg-muted/30 border border-border/50","data-testid":"tool-call-cost-estimate",children:[e.jsx("p",{className:"text-[10px] font-medium text-muted-foreground uppercase tracking-wider mb-2",children:"Estimated Cost at Current Rates"}),e.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"text-[10px] text-muted-foreground",children:"Per Call"}),e.jsx("p",{className:"text-sm font-bold tabular-nums","data-testid":"text-tool-cost-per-call",children:J.perCallCost.toFixed(4)}),e.jsx("p",{className:"text-[10px] text-muted-foreground",children:J.currency})]}),e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"text-[10px] text-muted-foreground",children:"Max Calls"}),e.jsx("p",{className:"text-sm font-bold tabular-nums","data-testid":"text-tool-max-calls",children:se}),e.jsx("p",{className:"text-[10px] text-muted-foreground",children:"configured"})]}),e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"text-[10px] text-muted-foreground",children:"Max Cost"}),e.jsx("p",{className:"text-sm font-bold tabular-nums","data-testid":"text-tool-max-cost",children:(J.perCallCost*se).toFixed(4)}),e.jsx("p",{className:"text-[10px] text-muted-foreground",children:J.currency})]})]})]})]})]})}),e.jsx(ue,{className:"border-card-border",children:e.jsxs(me,{className:"p-6 space-y-5",children:[e.jsxs("h2",{className:"text-lg font-semibold text-foreground flex items-center gap-2",children:[e.jsx(Gs,{className:"h-5 w-5 text-primary"}),"MCP Tools"]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Select the tools this provider agent is authorized to use"}),Object.entries(xl).map(([H,ke])=>e.jsxs("div",{children:[e.jsx("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider mb-2",children:H}),e.jsx("div",{className:"flex gap-2 flex-wrap",children:ke.map(lt=>{const ut=o.includes(lt.name);return e.jsxs(Y,{className:re("cursor-pointer toggle-elevate text-xs",ut?"bg-primary/10 text-primary border-primary/30 toggle-elevated":""),variant:ut?"secondary":"outline",onClick:()=>pn(lt.name),"data-testid":`badge-tool-${lt.name.replace(/\s/g,"-").toLowerCase()}`,children:[ut&&e.jsx(tt,{className:"h-3 w-3 mr-1"}),lt.name]},lt.name)}
84)})]},H))]})}),e.jsx(ue,{className:"border-card-border",children:e.jsxs(me,{className:"p-6 space-y-5",children:[e.jsxs("h2",{className:"text-lg font-semibold text-foreground flex items-center gap-2",children:[e.jsx(Ss,{className:"h-5 w-5 text-primary"}),"Spending Limits"]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[e.jsx(js,{control:vt.control,name:"perTransaction",render:({field:H})=>e.jsxs(fs,{children:[e.jsx(hs,{children:"Per Transaction ($)"}),e.jsx(ws,{children:e.jsx(et,{type:"number","data-testid":"input-per-transaction",...H,onChange:ke=>H.onChange(parseFloat(ke.target.value)||0)})}),e.jsx(Bn,{children:"Max per single operation"}),e.jsx(ps,{})]})}),e.jsx(js,{control:vt.control,name:"perPeriod",render:({field:H})=>e.jsxs(fs,{children:[e.jsx(hs,{children:"Per Period ($)"}),e.jsx(ws,{children:e.jsx(et,{type:"number","data-testid":"input-per-period",...H,onChange:ke=>H.onChange(parseFloat(ke.target.value)||0)})}),e.jsx(Bn,{children:"Max per billing period"}),e.jsx(ps,{})]})}),e.jsx(js,{control:vt.control,name:"periodDays",render:({field:H})=>e.jsxs(fs,{children:[e.jsx(hs,{children:"Period (Days)"}),e.jsx(ws,{children:e.jsx(et,{type:"number","data-testid":"input-period-days",...H,onChange:ke=>H.onChange(parseInt(ke.target.value)||1)})}),e.jsx(ps,{})]})}),e.jsx(js,{control:vt.control,name:"totalBudget",render:({field:H})=>e.jsxs(fs,{children:[e.jsx(hs,{children:"Total Budget ($)"}),e.jsx(ws,{children:e.jsx(et,{type:"number","data-testid":"input-total-budget",...H,onChange:ke=>H.onChange(parseFloat(ke.target.value)||0)})}),e.jsx(Bn,{children:"Maximum total spend"}),e.jsx(ps,{})]})})]})]})}),e.jsx(ue,{className:"border-card-border",children:e.jsxs(me,{className:"p-6 space-y-5",children:[e.jsxs("h2",{className:"text-lg font-semibold text-foreground flex items-center gap-2",children:[e.jsx(qy,{className:"h-5 w-5 text-primary"}),oe?"Circle Nanopayments":"Escrow Payment"]}),oe&&e.jsxs("div",{className:"flex items-center gap-2 flex-wrap","data-testid":"circle-nanopayments-indicator",children:[e.jsxs(Y,{className:"text-xs bg-blue-500/15 text-blue-600 dark:text-blue-400 border-blue-500/30","data-testid":"badge-circle-hire",children:[e.jsx(ir,{className:"h-3 w-3 mr-1"}),"Circle Nanopayments"]}),e.jsxs(Y,{variant:"outline",className:"text-xs text-emerald-600 dark:text-emerald-400 border-emerald-500/30",children:[e.jsx(tt,{className:"h-3 w-3 mr-1"}),"Zero Gas Fees"]}),Ce&&e.jsxs(Y,{className:"text-xs bg-emerald-500/15 text-emerald-600 dark:text-emerald-400 border-emerald-500/30","data-testid":"badge-instant-hire",children:[e.jsx(ht,{className:"h-3 w-3 mr-1"}),"Instant Hire"]})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[e.jsx(js,{control:vt.control,name:"paymentMethod",render:({field:H})=>e.jsxs(fs,{children:[e.jsx(hs,{children:"Payment Method"}),e.jsxs(ur,{value:H.value,onValueChange:H.onChange,children:[e.jsx(ws,{children:e.jsx(qs,{"data-testid":"select-payment-method",children:e.jsx(mr,{})})}),e.jsxs(Zs,{children:[e.jsx(ft,{value:"USDC",children:"USDC Escrow"}),e.jsx(ft,{value:"x402",children:"x402 Protocol"}),e.jsx(ft,{value:"Stripe",children:"Stripe"}),Nt&&e.jsx(ft,{value:"USDC_SEPOLIA",children:"Sepolia USDC (testnet)"})]})]}),xe&&(M==="USDC"||M==="x402")&&e.jsx(Bn,{className:"text-blue-600 dark:text-blue-400",children:"This agent supports Circle Nanopayments for sub-cent billing"}),e.jsx(ps,{})]})}),e.jsx(js,{control:vt.control,name:"escrowAmount",render:({field:H})=>e.jsxs(fs,{children:[e.jsx(hs,{children:oe?"Budget (USDC)":"Escrow Budget (USDC)"}),e.jsx(ws,{children:e.jsx(et,{type:"number","data-testid":"input-escrow-amount",...H,onChange:ke=>H.onChange(parseFloat(ke.target.value)||0)})}),e.jsx(Bn,{children:J&&X>0?`Covers ~${Math.floor(X/J.perCallCost).toLocaleString()} API calls`:oe?"Funds deposited into Circle Gateway Wallet":"Funds held until evaluator attests completion"}),e.jsx(ps,{})]})})]}),oe&&e.jsxs(Rh,{children:[e.jsx(Ph,{asChild:!0,children:e.jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5 rounded-md bg-amber-500/10 border border-amber-500/20","data-testid":"banner-hire-testnet-mode",children:[e.jsx(nl,{className:"h-3.5 w-3.5 text-amber-600 dar
84k:text-amber-400 shrink-0"}),e.jsx("p",{className:"text-[11px] font-medium text-amber-600 dark:text-amber-400",children:"Testnet Mode â Circle Nanopayments uses test USDC with no real value"})]})}),e.jsx(Ld,{children:e.jsx("p",{className:"text-xs max-w-[240px]",children:"This agent supports Circle Nanopayments which is currently on testnet. All micro-transactions use test tokens and settlements are on the test network."})})]}),oe&&J&&e.jsxs("div",{className:"space-y-3","data-testid":"circle-cost-breakdown",children:[e.jsx("p",{className:"text-[10px] font-medium text-muted-foreground uppercase tracking-wider",children:"Cost Breakdown"}),e.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[e.jsxs("div",{className:"p-2.5 rounded-md bg-muted/30 border border-border/50 text-center",children:[e.jsx("p",{className:"text-[10px] text-muted-foreground",children:"Per Call"}),e.jsx("p",{className:"text-sm font-bold tabular-nums","data-testid":"text-circle-per-call",children:J.perCallCost.toFixed(4)}),e.jsx("p",{className:"text-[10px] text-muted-foreground",children:J.currency})]}),e.jsxs("div",{className:"p-2.5 rounded-md bg-muted/30 border border-border/50 text-center",children:[e.jsx("p",{className:"text-[10px] text-muted-foreground",children:"Est. Calls"}),e.jsx("p",{className:"text-sm font-bold tabular-nums","data-testid":"text-circle-est-calls",children:(J.estimatedCalls||(X>0?Math.floor(X/J.perCallCost):0)).toLocaleString()}),e.jsx("p",{className:"text-[10px] text-muted-foreground",children:"from budget"})]}),e.jsxs("div",{className:"p-2.5 rounded-md bg-muted/30 border border-border/50 text-center",children:[e.jsx("p",{className:"text-[10px] text-muted-foreground",children:"Est. Total"}),e.jsx("p",{className:"text-sm font-bold tabular-nums","data-testid":"text-circle-est-total",children:(J.estimatedTotal||J.perCallCost*(J.estimatedCalls||0)).toFixed(4)}),e.jsx("p",{className:"text-[10px] text-muted-foreground",children:J.currency})]})]}),Je&&e.jsxs("div",{className:re("flex items-center gap-2 p-3 rounded-md border",R?"bg-amber-500/10 border-amber-500/30":"bg-emerald-500/10 border-emerald-500/30"),"data-testid":"circle-balance-status",children:[e.jsx(St,{className:"h-4 w-4 shrink-0"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("p",{className:"text-xs font-medium text-foreground",children:["Gateway Wallet Balance: ",Je.balance.toFixed(4)," USDC"]}),R&&e.jsx("p",{className:"text-[10px] text-amber-600 dark:text-amber-400",children:"Insufficient balance. Deposit more USDC to cover estimated costs."})]}),R?e.jsx(mo,{className:"h-4 w-4 text-amber-500 shrink-0"}):e.jsx(tt,{className:"h-4 w-4 text-emerald-500 shrink-0"})]}),R&&s.authenticated&&e.jsx(Vc,{x402Supported:J.x402Supported,perCallCost:J.perCallCost,currency:J.currency,network:J.network,escrowAmount:X,estimatedCalls:J.estimatedCalls,estimatedTotal:J.estimatedTotal,walletConnected:s.authenticated,circlePaymentAddress:ge?.circlePaymentAddress,userAddress:s.authenticated&&s.address?s.address:void 0,compact:!0})]}),oe&&!J&&!q&&W>0&&e.jsx(Vc,{x402Supported:!1,perCallCost:.001,currency:"USDC",network:"Base",escrowAmount:X,walletConnected:s.authenticated,circlePaymentAddress:ge?.circlePaymentAddress,userAddress:s.authenticated&&s.address?s.address:void 0}),!oe&&(M==="USDC"||M==="x402")&&e.jsx("div",{className:"mt-4",children:q?e.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground p-4",children:[e.jsx(Ge,{className:"h-4 w-4 animate-spin"}),"Probing agent endpoints for x402 pricing..."]}):J?e.jsx(Vc,{x402Supported:J.x402Supported,perCallCost:J.perCallCost,currency:J.currency,network:J.network,escrowAmount:X,estimatedCalls:J.estimatedCalls,estimatedTotal:J.estimatedTotal,walletConnected:s.authenticated}):W>0?null:e.jsxs("div",{className:"flex items-center gap-2 p-3 rounded-md bg-muted/30 border border-border/50 text-sm text-muted-foreground",children:[e.jsx(ht,{className:"h-4 w-4 shrink-0"}),"Select a provider agent to see x402 pricing details"]})}),oe&&q&&e.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground p-4",children:[e.jsx(Ge,{className:"h-4 w-4 animate-spin"}),"Probing agent for Circle Nanopayments pricing..."]})]})}),oe&&Ce&&e.jsx(ue,{className:"border-card-border",children:e.jsxs(me,{className:"p-6 space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ht,{className:"h-5 w-5 text-emerald-500"}),e.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"Instant Hire with Nanopayments"})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"This always-on agent will begin executing immediately upon job creation. Circle Nanopayments will automatically authorize sub-cent payments for each API call, with batch settlement on completion."}),R&&e.jsxs("div",{className:"flex items-center gap-2 p-2.5 rounded-md bg-amber-500/10 border border-amber-500/30","data-testid":"instant-hire-balance-warning",children:[e.jsx(mo,{className:"h-4 w-4 text-amber-500 shrink-0"}
84),e.jsx("p",{className:"text-xs text-amber-600 dark:text-amber-400",children:"Please deposit sufficient USDC into your Gateway Wallet before proceeding."})]})]})}),at&&e.jsx(ue,{className:"border-card-border","data-testid":"sepolia-payment-card",children:e.jsxs(me,{className:"p-6 space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(St,{className:"h-5 w-5 text-blue-500"}),e.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"Sepolia USDC Escrow"}),e.jsx(Y,{variant:"secondary",className:"text-[10px] bg-blue-500/10 text-blue-600 dark:text-blue-400 border-blue-500/20",children:"Testnet"})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Transfer USDC directly to the platform escrow address on Sepolia testnet. The transaction hash is recorded on-chain as your ERC-8183 payment record."}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3 text-xs",children:[e.jsxs("div",{className:"p-3 rounded-md bg-muted/30 border border-border/50 space-y-1",children:[e.jsx("p",{className:"text-[10px] text-muted-foreground uppercase tracking-wider",children:"Your Sepolia USDC Balance"}),As?e.jsxs("p",{className:"font-semibold text-foreground tabular-nums","data-testid":"text-sepolia-balance",children:[As.balanceFormatted.toFixed(4)," ",As.symbol]}):e.jsx("p",{className:"text-muted-foreground",children:"Connect wallet to check balance"})]}),e.jsxs("div",{className:"p-3 rounded-md bg-muted/30 border border-border/50 space-y-1",children:[e.jsx("p",{className:"text-[10px] text-muted-foreground uppercase tracking-wider",children:"Escrow Address"}),gs?.escrowAddress?e.jsxs("p",{className:"font-mono text-foreground text-[10px] break-all","data-testid":"text-escrow-address",children:[gs.escrowAddress.slice(0,10),"...",gs.escrowAddress.slice(-6)]}):e.jsx("p",{className:"text-amber-600 dark:text-amber-400 text-[10px]",children:"SEPOLIA_ESCROW_ADDRESS not configured"})]}),e.jsxs("div",{className:"p-3 rounded-md bg-muted/30 border border-border/50 space-y-1",children:[e.jsx("p",{className:"text-[10px] text-muted-foreground uppercase tracking-wider",children:"Estimated Gas"}),e.jsxs("p",{className:"font-semibold text-foreground tabular-nums","data-testid":"text-sepolia-gas-estimate",children:["~100,000 gas ",e.jsx("span",{className:"text-muted-foreground font-normal",children:"(ERC-20 transfer)"})]})]})]}),As&&vt.watch("escrowAmount")>0&&As.balanceFormatted<vt.watch("escrowAmount")&&e.jsxs("div",{className:"flex items-center gap-2 p-2.5 rounded-md bg-amber-500/10 border border-amber-500/30","data-testid":"sepolia-balance-warning",children:[e.jsx(mo,{className:"h-4 w-4 text-amber-500 shrink-0"}),e.jsxs("p",{className:"text-xs text-amber-600 dark:text-amber-400",children:["Insufficient Sepolia USDC balance. Get test USDC from the"," ",e.jsx("a",{href:"https://faucet.circle.com",target:"_blank",rel:"noopener noreferrer",className:"underline",children:"Circle faucet"}),"."]})]}),e.jsx("div",{className:"flex items-center justify-end",children:e.jsxs(ie,{type:"button",size:"lg",className:"gap-2",disabled:Ne||!gs?.configured,onClick:mn,"data-testid":"button-sepolia-transfer",children:[Ne?e.jsx(Ge,{className:"h-4 w-4 animate-spin"}):e.jsx(St,{className:"h-4 w-4"}),Ne?"Transferring...":"Transfer USDC to Escrow"]})})]})}),e.jsx("div",{className:"flex items-center justify-end gap-3",children:e.jsxs(ie,{type:"submit",size:"lg",className:"gap-2",disabled:ia.isPending||oe&&R||at,"data-testid":"button-submit-job",children:[ia.isPending?e.jsx(Ge,{className:"h-4 w-4 animate-spin"}):oe&&Ce?e.jsx(ht,{className:"h-4 w-4"}):e.jsx(lr,{className:"h-4 w-4"}),oe&&Ce?"Instant Hire with Nanopayments":oe?"Create Job with Circle Nanopayments":"Create ERC-8183 Job"]})})]})})})]})}const wN={Mail:VS,MessageSquare:ho,MessageCircle:Qy,Table:Jy,Calendar:CS,BookOpen:Hy,Globe:an,HardDrive:wf,Webhook:e5,Wallet:St,FileCode:Gy,AtSign:wS,Activity:Bi,Plug:Ad,Brain:fh,Cpu:Ky,Layers:Ur,CreditCard:qy,Code:Wc,Building:kS,Phone:HS,Cloud:TS,Triangle:YS,Grid3x3:OS,Database:Zy,Search:Zc,Send:jo,CheckSquare:GS,ShoppingCart:ZS,Users:eb}
84,th={Communication:"bg-purple-500/10 text-purple-600 dark:text-purple-400",Productivity:"bg-blue-500/10 text-blue-600 dark:text-blue-400",Data:"bg-cyan-500/10 text-cyan-600 dark:text-cyan-400",Blockchain:"bg-emerald-500/10 text-emerald-600 dark:text-emerald-400",Custom:"bg-amber-500/10 text-amber-600 dark:text-amber-400",AI:"bg-indigo-500/10 text-indigo-600 dark:text-indigo-400",Payments:"bg-green-500/10 text-green-600 dark:text-green-400",Development:"bg-gray-500/10 text-gray-600 dark:text-gray-400",Cloud:"bg-sky-500/10 text-sky-600 dark:text-sky-400",Commerce:"bg-orange-500/10 text-orange-600 dark:text-orange-400",CRM:"bg-pink-500/10 text-pink-600 dark:text-pink-400"};function _P({tool:t}){const s=wN[t.icon]||Gs,n=th[t.category]||"";return e.jsx(ue,{className:"border-card-border","data-testid":`card-tool-${t.name.replace(/\s/g,"-").toLowerCase()}`,children:e.jsxs(me,{className:"p-5 space-y-3",children:[e.jsx("div",{className:"flex items-start justify-between gap-2",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:re("w-10 h-10 rounded-md flex items-center justify-center shrink-0",n),children:e.jsx(s,{className:"h-5 w-5"})}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-semibold text-sm text-foreground","data-testid":`text-tool-name-${t.name.replace(/\s/g,"-").toLowerCase()}`,children:t.name}),e.jsx(Y,{variant:"secondary",className:re("text-[10px] mt-0.5",n),children:t.category})]})]})}),e.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:t.description}),e.jsx("div",{className:"flex gap-1 flex-wrap",children:t.scopes.map(o=>e.jsx(Y,{variant:"outline",className:"text-[10px]",children:o},o))})]})})}function AP({model:t}){return e.jsx(ue,{className:"border-card-border","data-testid":`card-model-${t.name.replace(/\s/g,"-").toLowerCase()}`,children:e.jsxs(me,{className:"p-5 space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 rounded-md flex items-center justify-center shrink-0 bg-indigo-500/10 text-indigo-600 dark:text-indigo-400",children:e.jsx(fh,{className:"h-5 w-5"})}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-semibold text-sm text-foreground",children:t.name}),e.jsx("span",{className:"text-[10px] text-muted-foreground",children:t.provider})]})]}),e.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:t.description}),e.jsx("div",{className:"flex items-center gap-2",children:e.jsxs(Y,{variant:"secondary",className:"text-[10px] bg-emerald-500/10 text-emerald-600 dark:text-emerald-400",children:["$",t.costPer1kTokens,"/1k tokens"]})})]})})}function TP({service:t,onDisconnect:s}){return e.jsx(ue,{className:"border-card-border","data-testid":`card-connected-${t.id}`,children:e.jsxs(me,{className:"p-4 flex items-center justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("h4",{className:"font-medium text-sm text-foreground",children:t.serviceName}),e.jsxs("div",{className:"flex items-center gap-1.5 mt-1 flex-wrap",children:[e.jsxs(Y,{variant:t.status==="active"?"secondary":"outline",className:re("text-[10px]",t.status==="active"?"bg-green-500/10 text-green-600 dark:text-green-400":""),children:[t.status==="active"?e.jsx(tt,{className:"h-3 w-3 mr-0.5"}):e.jsx(Pt,{className:"h-3 w-3 mr-0.5"}),t.status]}),t.scopes&&t.scopes.map(n=>e.jsx(Y,{variant:"outline",className:"text-[10px]",children:n},n))]})]}),e.jsx(ie,{size:"sm",variant:"ghost",className:"text-destructive shrink-0",onClick:()=>s(t.id),"data-testid":`button-disconnect-${t.id}`,children:"Disconnect"})]})})}function RP(){const{data:t}=He({queryKey:["/api/vault/zapier-status"]}),{data:s}=He({queryKey:["/api/zapier/exposed"],enabled:!!t?.connected&&!!t?.valid}),n=s?.results?.length||0;return e.jsxs("section",{children:[e.jsx("h2",{className:"text-2xl font-bold text-foreground mb-2","data-testid":"text-zapier-heading",children:"Zapier AI Actions"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:"Connect to 7,000+ apps via Zapier AI Actions for orchestration workflows"}),e.jsx(ue,{className:"border-card-border",children:e.jsxs(me,{className:"p-6 flex items-center justify-between gap-4 flex-wrap",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("div",{className:`w-12 h-12 rounded-md flex items-center justify-center ${t?.connected&&t?.valid?"bg-orange-500/10 text-orange-600 dar
84k:text-orange-400":"bg-muted text-muted-foreground"}`,children:e.jsx(ht,{className:"h-6 w-6"})}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h3",{className:"font-semibold text-foreground",children:"Zapier Integration"}),t?.connected&&t?.valid?e.jsxs(Y,{variant:"secondary",className:"bg-orange-500/10 text-orange-600 dark:text-orange-400 text-xs",children:[e.jsx(tt,{className:"h-3 w-3 mr-1"}),"Connected"]}):e.jsx(Y,{variant:"secondary",className:"text-xs",children:"Not Connected"})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:t?.connected&&t?.valid?`${n} exposed action${n!==1?"s":""} available for orchestration`:"Connect your API key in the Vault to enable Zap nodes"})]})]}),e.jsx("a",{href:"/vault",children:e.jsx(ie,{variant:"outline","data-testid":"button-connect-zapier",children:t?.connected?"Manage in Vault":"Connect in Vault"})})]})})]})}function PP(){const{toast:t}=Yt(),{data:s,isLoading:n}=He({queryKey:["/api/tools"]}),{data:o}=He({queryKey:["/api/connected-services"]}),i=Ut({mutationFn:async d=>{await dt("DELETE",`/api/connected-services/${d}`)},onSuccess:()=>{ct.invalidateQueries({queryKey:["/api/connected-services"]}),t({title:"Disconnected",description:"Service has been disconnected."})}}),c=s?.tools?.reduce((d,m)=>(d[m.category]||(d[m.category]=[]),d[m.category].push(m),d),{})||{};return n?e.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 py-8 space-y-6",children:[e.jsx(ot,{className:"h-10 w-64"}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:Array.from({length:6}).map((d,m)=>e.jsx(ot,{className:"h-40 rounded-xl"},m))})]}):e.jsxs("div",{className:"min-h-screen",children:[e.jsx("div",{className:"border-b border-border bg-card/30",children:e.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 py-8",children:[e.jsx("h1",{className:"text-3xl font-bold text-foreground mb-2","data-testid":"text-tools-title",children:"Tools & Services"}),e.jsx("p",{className:"text-muted-foreground",children:"MCP tool catalog, AI models, and connected service management"}),e.jsxs("div",{className:"flex items-center gap-2 mt-4 flex-wrap",children:[e.jsxs(Y,{variant:"secondary",className:"bg-primary/10 text-primary border-primary/20",children:[e.jsx(Gs,{className:"h-3 w-3 mr-1"}),s?.tools?.length||0," Built-in Tools"]}),e.jsxs(Y,{variant:"secondary",className:"bg-indigo-500/10 text-indigo-600 dark:text-indigo-400",children:[e.jsx(fh,{className:"h-3 w-3 mr-1"}),s?.models?.length||0," AI Models"]}),e.jsxs(Y,{variant:"outline",children:[e.jsx(on,{className:"h-3 w-3 mr-1"}),s?.services?.length||0," Connectable Services"]})]})]})}),e.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 py-8 space-y-10",children:[e.jsxs("section",{children:[e.jsx("h2",{className:"text-2xl font-bold text-foreground mb-2","data-testid":"text-mcp-tools-heading",children:"MCP Tools"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-6",children:"14 built-in tools organized by category for agent task execution"}),Object.entries(c).map(([d,m])=>e.jsxs("div",{className:"mb-8",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[e.jsx(Y,{variant:"secondary",className:re("text-xs",th[d]||""),children:d}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:[m.length," tool",m.length>1?"s":""]})]}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4","data-testid":`tools-grid-${d.toLowerCase()}`,children:m.map(f=>e.jsx(_P,{tool:f},f.name))})]},d))]}),e.jsxs("section",{children:[e.jsx("h2",{className:"text-2xl font-bold text-foreground mb-2","data-testid":"text-ai-models-heading",children:"AI Models"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-6",children:"Available language models for agent reasoning and generation"}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4","data-testid":"models-grid",children:s?.models?.map(d=>e.jsx(AP,{model:d},d.name))})]}),e.jsx(RP,{}),e.jsxs("section",{children:[e.jsx("h2",{className:"text-2xl font-bold text-foreground mb-2","data-testid":"text-connected-heading",children:"Connected Services"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-6",children:"Manage your credential vault and connected service integrations"}),o&&o.length>0?e.jsx("div",{className:"space-y-3 mb-8","data-testid":"connected-services-list",children:o.map(d=>e.jsx(TP,{service:d,onDisconnect:m=>i.mutate(m)},d.id))}):e.jsx(ue,{className:"border-card-border mb-8",children:e.jsxs(me,{className:"p-8 text-center","data-testid":"empty-connected",children:[e.jsx(on,{className:"h-10 w-10 text-muted-foreground
84/40 mx-auto mb-3"}),e.jsx("h3",{className:"font-medium text-foreground mb-1",children:"No connected services"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Connect a service below to get started"})]})}),e.jsx("h3",{className:"text-lg font-semibold text-foreground mb-4",children:"Available Services"}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4","data-testid":"services-catalog",children:s?.services?.map(d=>{const m=wN[d.icon]||Ad,f=th[d.category]||"";return e.jsx(ue,{className:"border-card-border","data-testid":`card-service-${d.name.replace(/\s/g,"-").toLowerCase()}`,children:e.jsxs(me,{className:"p-5 space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:re("w-10 h-10 rounded-md flex items-center justify-center shrink-0",f),children:e.jsx(m,{className:"h-5 w-5"})}),e.jsxs("div",{children:[e.jsx("h4",{className:"font-semibold text-sm text-foreground",children:d.name}),e.jsx(Y,{variant:"secondary",className:re("text-[10px] mt-0.5",f),children:d.category})]})]}),e.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:d.description}),e.jsx("div",{className:"flex gap-1 flex-wrap",children:d.availableScopes.map(x=>e.jsx(Y,{variant:"outline",className:"text-[10px]",children:x},x))})]})},d.name)})})]})]})]})}const MP=["A2A","MCP","ENS","DID","email","web","OASF"],IP=["ERC-8126","SIWA","ERC-7710","ERC-8128","Self ZK Identity"],DP=q1({chain:Wn().min(1,"Select a chain"),name:Wn().min(1,"Name is required").max(100),description:Wn().min(1,"Description is required").max(500),imageUrl:Wn().url("Must be a valid URL").or(KR("")),agentType:Wn().optional()});function OP(){const{toast:t}=Yt(),[s,n]=p.useState([]),[o,i]=p.useState([]),[c,d]=p.useState(!1),[m,f]=p.useState([]),x=z1({resolver:U1(DP),defaultValues:{chain:"",name:"",description:"",imageUrl:"",agentType:""}});function v(E){n(C=>C.includes(E)?C.filter(A=>A!==E):[...C,E])}function y(E){i(C=>C.includes(E)?C.filter(A=>A!==E):[...C,E])}function b(){f(E=>[...E,{name:"",description:"",type:"built_in_tool",tool:"",costUSDC:0}])}function k(E,C){f(A=>A.map((_,D)=>D===E?{..._,...C}:_))}function S(E){f(C=>C.filter((A,_)=>_!==E))}const j=Ut({mutationFn:async E=>(await dt("POST","/api/agents",{...E,tokenId:0,services:s,supportedTrustModels:o,x402Supported:c,active:!0,totalJobs:0,totalEarnings:0})).json(),onSuccess:()=>{ct.invalidateQueries({queryKey:["/api/agents"]}),t({title:"Agent draft saved",description:"On-chain minting requires a connected wallet with gas and a deployed ERC-8004 contract."}),x.reset(),n([]),i([]),d(!1),f([])},onError:E=>{t({title:"Registration failed",description:E.message,variant:"destructive"})}});function w(E){j.mutate(E)}return e.jsxs("div",{className:"min-h-screen",children:[e.jsx("div",{className:"border-b border-border bg-card/30",children:e.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 py-8",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[e.jsx(Cv,{className:"h-6 w-6 text-primary"}),e.jsx("h1",{className:"text-3xl font-bold text-foreground","data-testid":"text-create-title",children:"Register Agent"})]}),e.jsx("p",{className:"text-muted-foreground",children:"Register a new AI agent â on-chain minting requires a connected wallet with gas"})]})}),e.jsx("div",{className:"max-w-3xl mx-auto px-4 sm:px-6 py-8",children:e.jsx(eN,{...x,children:e.jsxs("form",{onSubmit:x.handleSubmit(w),className:"space-y-6",children:[e.jsx(ue,{children:e.jsxs(me,{className:"p-5 space-y-4",children:[e.jsxs("h2",{className:"font-semibold text-foreground flex items-center gap-2",children:[e.jsx(an,{className:"h-4 w-4 text-primary"}),"Basic Information"]}),e.jsx(js,{control:x.control,name:"chain",render:({field:E})=>e.jsxs(fs,{children:[e.jsx(hs,{children:"Chain"}),e.jsxs(ur,{value:E.value,onValueChange:E.onChange,children:[e.jsx(ws,{children:e.jsx(qs,{"data-testid":"select-create-chain",children:e.jsx(mr,{placeholder:"Select chain"})})}),e.jsxs(Zs,{children:[e.jsx(ft,{value:"ethereum",children:"Ethereum"}),e.jsx(ft,{value:"base",children:"Base"})]})]}),e.jsx(ps,{})]})}),e.jsx(js,{control:x.control,name:"name",render:({field:E})=>e.jsxs(fs,{children:[e.jsx(hs,{children:"Agent Name"}),e.jsx(ws,{children:e.jsx(et,{...E,placeholder:"My AI Agent","data-testid":"input-create-name"})}),e.jsx(ps,{})]})}),e.jsx(js,{control:x.control,name:"description",render:({field:E})=>e.jsxs(fs,{children:[e.jsx(hs,{children:"Description"}),e.jsx(ws,{children:e.jsx(Vr,{...E,placeholder:"Describe what your agent does...",className:"resize-none","data-testid":"input-create-description"})}),e.jsx(ps,{})]})}),e.jsx(js,{control:x.control,name:"imageUrl",render:({field:E})=>e.jsxs(fs,{children:[e.jsx(hs,{children:"Image URL"}),e.jsx(ws,{children:e.jsx(et,{...E,placeholder:"https://example.com/image.png","data-testid":"input-create-image"})}),e.jsx(ps,{})]})}),e.jsx(js,{control:x.control,name:"agentType",render:({field:E})=>e.jsxs(fs,{children:[e.jsx(hs,{children:"Agent Type (optional)"}),e.jsxs(ur,{value:E.value,onValueChange:E.onChange,children:[e.jsx(ws,{children:e.jsx(qs,{"data-testid":"select-create-type",children:e.jsx(mr,{placeholder:"Select type"})})}),e.jsxs(Zs,{children:[e.jsx(ft,{value:"data_processing",children:"Data Processing"}),e.jsx(ft,{value:"monitoring",children:"Monitoring"}),e.jsx(ft,{value:"communication",children:"Communication"}),e.jsx(ft,{value:"security",children:"Security"}),e.jsx(ft,{value:"content",children:"Content"}),e.jsx(ft,{value:"defi",children:"DeFi"}),e.jsx(ft,{value:"analytics",children:"Analytics"}),e.jsx(ft,{value:"orchestration",children:"Orchestration"})]})]}),e.jsx(ps,{})]})})]})}),e.jsx(ue,{children:e.jsxs(me,{className:"p-5 space-y-4",children:[e.jsxs("h2",{className:"font-semibold text-foreground flex items-center gap-2",children:[e.jsx(Gs,{className:"h-4 w-4 text-primary"}),"Services & Protocols"]}),e.jsx("div",{className:"flex gap-2 flex-wrap",children:MP.map(E=>e.jsx(Y,{variant:s.includes(E)?"default":"outline",className:"cursor-pointer toggle-elevate",onClick:()=>v(E),"data-testid":`badge-service-${E}`,children:E},E))})]})}),e.jsx(ue,{children:e.jsxs(me,{className:"p-5 space-y-4",children:[e.jsxs("h2",{className:"font-semibold text-foreground flex items-center gap-2",children:[e.jsx(Ct,{className:"h-4 w-4 text-primary"}),"Trust Models"]}),e.jsx("div",{className:"flex gap-2 flex-wrap",children:IP.map(E=>e.jsx(Y,{variant:o.includes(E)?"default":"outline",className:`curs
84or-pointer toggle-elevate ${o.includes(E)&&E==="ERC-8126"?"bg-emerald-600 text-white":""}`,onClick:()=>y(E),"data-testid":`badge-trust-${E}`,children:E},E))}),e.jsxs("label",{className:"flex items-center gap-2 text-sm cursor-pointer",children:[e.jsx(Jd,{checked:c,onCheckedChange:E=>d(E===!0),"data-testid":"checkbox-x402"}),e.jsx("span",{className:"text-foreground",children:"x402 Payment Protocol Support"})]})]})}),e.jsx(ue,{children:e.jsxs(me,{className:"p-5 space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2 flex-wrap",children:[e.jsxs("h2",{className:"font-semibold text-foreground flex items-center gap-2",children:[e.jsx(lr,{className:"h-4 w-4 text-primary"}),"Capability Steps"]}),e.jsxs(ie,{type:"button",size:"sm",variant:"outline",onClick:b,"data-testid":"button-add-step",children:[e.jsx(ka,{className:"h-3.5 w-3.5 mr-1"}),"Add Step"]})]}),m.length===0&&e.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:"Define the steps your agent performs to complete tasks"}),m.map((E,C)=>e.jsxs("div",{className:"border border-border rounded-md p-3 space-y-3","data-testid":`step-${C}`,children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsxs(Y,{variant:"secondary",className:"text-[10px]",children:["Step ",C+1]}),e.jsx(ie,{type:"button",size:"icon",variant:"ghost",onClick:()=>S(C),"data-testid":`button-remove-step-${C}`,children:e.jsx(Yc,{className:"h-3 w-3 text-destructive"})})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsx(et,{placeholder:"Step name",value:E.name,onChange:A=>k(C,{name:A.target.value}),"data-testid":`input-step-name-${C}`}),e.jsxs(ur,{value:E.type,onValueChange:A=>k(C,{type:A}),children:[e.jsx(qs,{"data-testid":`select-step-type-${C}`,children:e.jsx(mr,{})}),e.jsxs(Zs,{children:[e.jsx(ft,{value:"built_in_tool",children:"Built-in Tool"}),e.jsx(ft,{value:"built_in_model",children:"Built-in Model"}),e.jsx(ft,{value:"custom_api",children:"Custom API"}),e.jsx(ft,{value:"custom_model",children:"Custom Model"})]})]})]}),e.jsx(et,{placeholder:"Description",value:E.description,onChange:A=>k(C,{description:A.target.value}),"data-testid":`input-step-desc-${C}`}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsx(et,{placeholder:"Tool/Model name",value:E.tool||E.model||"",onChange:A=>k(C,{tool:A.target.value}),"data-testid":`input-step-tool-${C}`}),e.jsx(et,{type:"number",placeholder:"Cost (USDC)",value:E.costUSDC||"",onChange:A=>k(C,{costUSDC:parseFloat(A.target.value)||0}),"data-testid":`input-step-cost-${C}`})]})]},C))]})}),e.jsxs(ie,{type:"submit",className:"w-full",disabled:j.isPending,"data-testid":"button-register-agent",children:[e.jsx(Cv,{className:"h-4 w-4 mr-2"}),j.isPending?"Saving...":"Save Agent Draft"]})]})})})]})}function LP({workflow:t,agents:s,onUpdate:n}){const o=t.nodes||[],i=t.edges||[],[c,d]=p.useState(null),[m,f]=p.useState(null),[x,v]=p.useState(!1),[y,b]=p.useState([]),[k,S]=p.useState(null),[j,w]=p.useState([]),[E,C]=p.useState(!1),[A,_]=p.useState(!1),D={agent:Os,tool:Gs,gate:Es,start:ir,end:jv,zap:ht},O={agent:"border-blue-500/40 bg-blue-500/5",tool:"border-amber-500/40 bg-amber-500/5",gate:"border-red-500/40 bg-red-500/5",start:"border-emerald-500/40 bg-emerald-500/5",end:"border-purple-500/40 bg-purple-500/5",zap:"border-orange-500/40 bg-orange-500/5"};function F(I,le,ne,J){const U={id:`node-${Date.now()}`,type:I,label:le,agentId:ne,...J||{},position:{x:100+o.length*180,y:120}};n([...o,U],i)}async function P(){v(!0),S(null),w([]),b([]),C(!0);try{const I=await fetch("/api/zapier/apps",{credentials:"include"});if(I.ok){const le=await I.json();b(le.results||[])}else{const le=await I.json().catch(()=>({message:"Failed to fetch apps"}));b([])}}catch{b([])}C(!1)}async function Z(I){S(I),_(!0),w([]);try{const le=await fetch(`/api/zapier/apps/${encodeURIComponent(I)}/actions`,{credentials:"include"});if(le.ok){const ne=await le.json();w(ne.results||[])}else w([])}catch{w([])}_(!1)}function z(I,le){F("zap",`${le}: ${I.description||I.type}`,void 0,{zapActionId:I.id,zapActionName:I.description||I.type,zapAppName:le}),v(!1)}
84function te(I){n(o.filter(le=>le.id!==I),i.filter(le=>le.source!==I&&le.target!==I)),d(null)}function ee(I,le){if(I===le||i.some(J=>J.source===I&&J.target===le))return;const ne={id:`edge-${Date.now()}`,source:I,target:le,type:"sequential"};n(o,[...i,ne])}function se(I){m?(ee(m,I),f(null)):d(c===I?null:I)}return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsxs(ie,{size:"sm",variant:"outline",onClick:()=>F("start","Start"),"data-testid":"button-add-start-node",children:[e.jsx(ir,{className:"h-3.5 w-3.5 mr-1"})," Start"]}),e.jsxs(Ra,{children:[e.jsx($c,{asChild:!0,children:e.jsxs(ie,{size:"sm",variant:"outline","data-testid":"button-add-agent-node",children:[e.jsx(Os,{className:"h-3.5 w-3.5 mr-1"})," Agent"]})}),e.jsxs(ea,{children:[e.jsx(ta,{children:e.jsx(sa,{children:"Select Agent"})}),e.jsxs("div",{className:"space-y-2 max-h-64 overflow-y-auto",children:[s.map(I=>e.jsx($c,{asChild:!0,children:e.jsx(ue,{className:"cursor-pointer hover-elevate",onClick:()=>F("agent",I.name,I.id),"data-testid":`select-agent-node-${I.id}`,children:e.jsxs(me,{className:"p-3 flex items-center gap-2",children:[e.jsx(Os,{className:"h-4 w-4 text-blue-500"}),e.jsx("span",{className:"text-sm font-medium",children:I.name}),e.jsx(Y,{variant:"outline",className:"ml-auto text-[10px]",children:I.chain})]})})},I.id)),s.length===0&&e.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:"No agents available"})]})]})]}),e.jsxs(ie,{size:"sm",variant:"outline",onClick:()=>F("gate","Gate Check"),"data-testid":"button-add-gate-node",children:[e.jsx(Es,{className:"h-3.5 w-3.5 mr-1"})," Gate"]}),e.jsxs(ie,{size:"sm",variant:"outline",onClick:()=>F("tool","Tool"),"data-testid":"button-add-tool-node",children:[e.jsx(Gs,{className:"h-3.5 w-3.5 mr-1"})," Tool"]}),e.jsxs(Ra,{open:x,onOpenChange:v,children:[e.jsx($c,{asChild:!0,children:e.jsxs(ie,{size:"sm",variant:"outline",onClick:P,"data-testid":"button-add-zap-node",children:[e.jsx(ht,{className:"h-3.5 w-3.5 mr-1 text-orange-500"})," Zap"]})}),e.jsxs(ea,{className:"max-w-md",children:[e.jsx(ta,{children:e.jsx(sa,{children:k?"Select Action":"Select Zapier App"})}),k?e.jsxs("div",{className:"space-y-2 max-h-64 overflow-y-auto",children:[e.jsx(ie,{size:"sm",variant:"ghost",onClick:()=>S(null),className:"mb-2","data-testid":"button-back-to-apps",children:"â Back to apps"}),A?e.jsx("div",{className:"flex items-center justify-center py-8",children:e.jsx(Ge,{className:"h-5 w-5 animate-spin text-muted-foreground"})}):j.length>0?j.map(I=>e.jsx(ue,{className:"cursor-pointer hover-elevate",onClick:()=>z(I,k),"data-testid":`select-zap-action-${I.id}`,children:e.jsxs(me,{className:"p-3 flex items-center gap-2",children:[e.jsx(ht,{className:"h-4 w-4 text-orange-500"}),e.jsxs("div",{children:[e.jsx("span",{className:"text-sm font-medium",children:I.description||I.type}),e.jsx("p",{className:"text-[10px] text-muted-foreground",children:I.type})]})]})},I.id)):e.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:"No actions available for this app"})]}):e.jsx("div",{className:"space-y-2 max-h-64 overflow-y-auto",children:E?e.jsx("div",{className:"flex items-center justify-center py-8",children:e.jsx(Ge,{className:"h-5 w-5 animate-spin text-muted-foreground"})}):y.length>0?y.map(I=>e.jsx(ue,{className:"cursor-pointer hover-elevate",onClick:()=>Z(I.slug||I.id),"data-testid":`select-zap-app-${I.slug||I.id}`,children:e.jsxs(me,{className:"p-3 flex items-center gap-2",children:[I.image?e.jsx("img",{src:I.image,alt:I.name,className:"h-5 w-5 rounded"}):e.jsx(ht,{className:"h-4 w-4 text-orange-500"}),e.jsx("span",{className:"text-sm font-medium",children:I.name||I.slug})]})},I.slug||I.id)):e.jsxs("div",{className:"text-center py-6 space-y-2",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"No apps found. Connect your Zapier API key in the Vault first."}),e.jsx(ie,{size:"sm",variant:"outline",onClick:()=>v(!1),"data-testid":"button-close-zap-picker",children:"Close"})]})})]})]}),e.jsxs(ie,{size:"sm",variant:"outline",onClick:()=>F("end","End"),"data-testid":"button-add-end-node",children:[e.jsx(jv,{className:"h-3.5 w-3.5 mr-1"})," End"]}),m&&e.jsx(Y,{variant:"secondary",className:"bg-primary/10 text-primary",children:"Click a target node to connect"})]}),e.jsxs("div",{className:"relative border border-border rounded-md bg-muted/30 min-h-[320px] p-6 overflow-x-auto","data-testid":"workflow-canvas",children:[o.length===0&&e.jsx("div",{className:"absolute inset-0 flex items-center justify-center text-muted-foreground text-sm",children:"Add nodes to build your workflow"}),e.jsx("div",{className:"flex items-start gap-4 flex-wrap",children:o.map(I=>{const le=D[I.type]||ir,ne=O[I.type]||"",J=c===I.id,U=m===I.id;return e.jsxs("div",{className:`relative flex flex-col items-center gap-2 p-4 rounded-md border-2 min-w-[120px] cursor-pointer transition-all ${ne} ${J?"ring-2 ring-primary":""} ${U?"ring-2 ring-amber-500":""}`,onClick:()=>se(I.id),"data-testid":`workflow-node-${I.id}`,children:[e.jsx(le,{className:"h-6 w-6"}),e.jsx("span",{className:"text-xs font-medium text-center",children:I.label}),e.jsx(Y,{variant:"outline",className:"text-[9px]",children:I.type}),J&&e.jsxs("div",{className:"flex gap-1 mt-1",children:[e.jsx(ie,{size:"icon",variant:"ghost",onClick:q=>{q.stopPropagation(),f(I.id)},"data-testid":`button-connect-${I.id}`,children:e.jsx(al,{className:"h-3 w-3"})}),e.jsx(ie,{size:"icon",variant:"ghost",onClick:q=>{q.stopPropagation(),te(I.id)},"data-testid":`button-remove-${I.id}`,children:e.jsx(Yc,{className:"h-3 w-3 text-destructive"})})]})]},I.id)})}),i.length>0&&e.jsx("div",{className:"mt-4 space-y-1",children:i.map(I=>{const le=o.find(J=>J.id===I.source),ne=o.find(J=>J.id===I.target);return e.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground","data-testid":`workflow-edge-${I.id}`,children:[e.jsx(Y,{variant:"outline",className:"text-[10px]",children:le?.label||I.source}),e.jsx(lr,{className:"h-3 w-3"}),e.jsx(Y,{variant:"outline",className:"text-[10px]",children:ne?.label||I.target}),e.jsx(Y,{variant:"secondary",className:"text-[9px] ml-1",children:I.type||"sequential"})]},I.id)})})]})]})}function FP(){const{toast:t}=Yt(),[s,n]=p.useState(""),[o,i]=p.useState(""),[c,d]=p.useState(null),[m,f]=p.useState([]),[x,v]=p.useState([]),{data:y,isLoading:b}=He({queryKey:["/api/workflows"]}),{data:k}=He({queryKey:["/api/agents",{limit:200}],queryFn:()=>fetch("/api/agents?limit=200").then(P=>P.json())}),S=k?.agents,j=Ut({mutationFn:async P=>(await dt("POST","/api/workflows",{...P,nodes:[],edges:[],status:"draft"})).json(),onSuccess:P=>
84{ct.invalidateQueries({queryKey:["/api/workflows"]}),n(""),i(""),d(P.id),f(P.nodes||[]),v(P.edges||[]),t({title:"Workflow created"})}}),w=Ut({mutationFn:async()=>c?(await dt("PATCH",`/api/workflows/${c}`,{nodes:m,edges:x})).json():void 0,onSuccess:()=>{ct.invalidateQueries({queryKey:["/api/workflows"]}),t({title:"Workflow saved"})}}),[E,C]=p.useState("10"),A=Ut({mutationFn:async P=>(await dt("POST",`/api/workflows/${P}/execute`,{totalEscrow:parseFloat(E)||10})).json(),onSuccess:P=>{ct.invalidateQueries({queryKey:["/api/workflows"]}),ct.invalidateQueries({queryKey:["/api/workflows",c,"jobs"]}),t({title:"Workflow executing",description:`Created ${P.childJobs?.length||0} agent jobs`})},onError:P=>{t({title:"Execution failed",description:P.message,variant:"destructive"})}}),{data:_}=He({queryKey:["/api/workflows",c,"jobs"],queryFn:()=>c?fetch(`/api/workflows/${c}/jobs`).then(P=>P.json()):[],enabled:!!c,refetchInterval:c?3e3:!1});function D(P){d(P.id),f(P.nodes||[]),v(P.edges||[])}const O={draft:"bg-muted text-muted-foreground",active:"bg-emerald-500/10 text-emerald-600 dark:text-emerald-400",paused:"bg-amber-500/10 text-amber-600 dark:text-amber-400",completed:"bg-blue-500/10 text-blue-600 dark:text-blue-400"},F=y?.find(P=>P.id===c);return e.jsxs("div",{className:"min-h-screen",children:[e.jsx("div",{className:"border-b border-border bg-card/30",children:e.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 py-8",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[e.jsx(jf,{className:"h-6 w-6 text-primary"}),e.jsx("h1",{className:"text-3xl font-bold text-foreground","data-testid":"text-orchestrate-title",children:"Orchestrate"})]}),e.jsx("p",{className:"text-muted-foreground",children:"Build multi-agent workflows with visual node-based orchestration"})]})}),e.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 py-8 space-y-8",children:[e.jsx(ue,{children:e.jsxs(me,{className:"p-5 space-y-4",children:[e.jsx("h2",{className:"font-semibold text-foreground",children:"Create Workflow"}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-3",children:[e.jsx(et,{placeholder:"Workflow name",value:s,onChange:P=>n(P.target.value),"data-testid":"input-workflow-name"}),e.jsx(et,{placeholder:"Description (optional)",value:o,onChange:P=>i(P.target.value),"data-testid":"input-workflow-description"}),e.jsxs(ie,{onClick:()=>j.mutate({name:s,description:o}),disabled:!s||j.isPending,"data-testid":"button-create-workflow",children:[e.jsx(ka,{className:"h-4 w-4 mr-1"}),"Create"]})]})]})}),F&&e.jsx(ue,{children:e.jsxs(me,{className:"p-5 space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2 flex-wrap",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("h2",{className:"font-semibold text-foreground",children:["Editing: ",F.name]}),e.jsx(Y,{className:O[F.status],children:F.status})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(ie,{size:"sm",onClick:()=>w.mutate(),disabled:w.isPending,"data-testid":"button-save-workflow",children:[e.jsx(qS,{className:"h-3.5 w-3.5 mr-1"}),"Save"]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(et,{type:"number",value:E,onChange:P=>C(P.target.value),className:"w-20 h-8 text-xs",placeholder:"USDC","data-testid":"input-escrow-budget"}),e.jsxs(ie,{size:"sm",variant:"default",className:"bg-emerald-600 hover:bg-emerald-700",onClick:()=>c&&A.mutate(c),disabled:A.isPending||m.filter(P=>P.type==="agent"||P.type==="zap").length===0,"data-testid":"button-execute-workflow",children:[A.isPending?e.jsx(Ge,{className:"h-3.5 w-3.5 mr-1 animate-spin"}):e.jsx(ht,{className:"h-3.5 w-3.5 mr-1"}),"Execute"]})]}),e.jsx(ie,{size:"sm",variant:"outline",onClick:()=>d(null),"data-testid":"button-close-editor",children:"Close"})]})]}),e.jsx(LP,{workflow:{...F,nodes:m,edges:x},agents:S||[],onUpdate:(P,Z)=>{f(P),v(Z)}}),_&&_.length>0&&e.jsxs("div",{className:"border-t border-border pt-4 mt-4",children:[e.jsxs("h3",{className:"text-sm font-semibold text-foreground mb-3 flex items-center gap-2",children:[e.jsx(ht,{className:"h-4 w-4 text-primary"}),"ERC-8183 Jobs (",_.length,")"]}),e.jsx("div",{className:"space-y-2",children:_.map(P=>{const Z=P.status==="completed"||P.status==="submitted"?e.jsx(tt,{className:"h-3.5 w-3.5 text-emerald-500"}):P.status==="rejected"||P.status==="expired"?e.jsx(Pt,{className:"h-3.5 w-3.5 text-red-500"}):P.executionStartedAt?e.jsx(Ge,{className:"h-3.5 w-3.5 text-blue-500 animate-spin"}):e.jsx(Fr,{className:"h-3.5 w-3.5 text-muted-foreground"}),z=P.taskDescription?.startsWith("Orchestration:");return e.jsxs("div",{className:`flex items-center justify-between rounded-lg border border-border px-3 py-2 text-xs ${z?"bg-primary/5":""}`,"data-testid":`workflow-job-${P.id}`,children:[e.jsxs("div",{className:"flex items-center gap-2",children:[Z,e.jsx("span",{className:"font-medium text-foreground",children:z?"Parent Job":P.taskDescription})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Y,{variant:"outline",className:"text-[10px]",children:P.status}),P.escrowAmount>0&&e.jsxs("span",{className:"flex items-center gap-0.5 text-muted-foreground",children:[e.jsx(Ss,{className:"h-3 w-3"}),P.escrowAmount," USDC"]}),e.jsx("a",{href:"/jobs",className:"text-primary hover:underline flex items-center gap-0.5","data-testid":`link-job-${P.id}`,children:e.jsx(wt,{className:"h-3 w-3"})})]})]},P.id)})})]})]})}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-xl font-semibold text-foreground mb-4",children:"Your Workflows"}),b?e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:Array.from({length:4}).map((P,Z)=>e.jsx(ot,{className:"h-32 rounded-xl"},Z))}):y&&y.length>0?e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4","data-testid":"workflows-grid",children:y.map(P=>e.jsx(ue,{className:"hover-elevate cursor-pointer",onClick:()=>D(P),"data-testid":`workflow-card-${P.id}`,children:e.jsxs(me,{className:"p-5",children:[e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("h3",{className:"font-semibold text-foreground",children:P.name}),P.description&&e.jsx("p",{className:"text-xs text-muted-foreground",children:P.description})]}),e.jsx(Y,{className:O[P.status],children:P.status})]}),e.jsxs("div",{className:"flex items-center gap-3 mt-3 text-xs text-muted-foreground",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Ur,{className:"h-3 w-3"}
84),(P.nodes||[]).length," nodes"]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(lr,{className:"h-3 w-3"}),(P.edges||[]).length," connections"]})]})]})},P.id))}):e.jsxs("div",{className:"text-center py-16","data-testid":"empty-workflows",children:[e.jsx(jf,{className:"h-12 w-12 text-muted-foreground/40 mx-auto mb-4"}),e.jsx("h3",{className:"text-lg font-medium text-foreground mb-1",children:"No workflows yet"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Create your first multi-agent workflow above"})]})]})]})]})}const $P={Email:["send","read","manage_folders"],Slack:["post_message","read_channels","manage_threads"],Discord:["send_message","read_messages","manage_channels"],"Google Sheets":["read","write","create","share"],"Google Calendar":["read_events","create_events","modify_events"],Gmail:["send","read","labels","drafts"],"Google Docs":["read","write","create","share"],"Google Drive":["upload","download","list","share"],Notion:["read_pages","write_pages","manage_databases"],GitHub:["repos","issues","pulls","actions"],Stripe:["charges","subscriptions","invoices"],"Browse Web":["fetch","parse","screenshot"],"File Storage":["upload","download","list","delete"],"Check Wallets":["balance","tokens","history"],"Read Contracts":["call","multicall"],"ENS Lookup":["resolve","reverse","records"],"Custom API":["get","post","put","delete"]};function VP({agents:t,integrations:s}){const{toast:n}=Yt(),[o,i]=p.useState(""),[c,d]=p.useState([]),[m,f]=p.useState("100"),[x,v]=p.useState("1000"),[y,b]=p.useState("30"),[k,S]=p.useState("5000"),[j,w]=p.useState("USDC"),[E,C]=p.useState("90");function A(O,F){d(P=>{const Z=P.find(z=>z.service===O);if(Z){const z=Z.scopes.includes(F)?Z.scopes.filter(te=>te!==F):[...Z.scopes,F];return z.length===0?P.filter(te=>te.service!==O):P.map(te=>te.service===O?{...te,scopes:z}:te)}return[...P,{service:O,scopes:[F]}]})}function _(O,F){return c.find(P=>P.service===O)?.scopes.includes(F)||!1}const D=Ut({mutationFn:async()=>{const O=new Date;return O.setDate(O.getDate()+parseInt(E)),(await dt("POST","/api/mandates",{agentId:parseInt(o),authorizedScopes:c,paymentLimits:{perTransaction:parseFloat(m),perPeriod:parseFloat(x),periodDays:parseInt(y),totalBudget:parseFloat(k),token:j},expirationTimestamp:O.toISOString(),eip712Signature:`0xSig_${Date.now()}`,status:"active"})).json()},onSuccess:()=>{ct.invalidateQueries({queryKey:["/api/mandates"]}),n({title:"Mandate created",description:"CDAD mandate signed and activated"})}});return e.jsxs(ea,{className:"max-w-lg max-h-[80vh] overflow-y-auto",children:[e.jsx(ta,{children:e.jsxs(sa,{className:"flex items-center gap-2",children:[e.jsx(wv,{className:"h-5 w-5 text-primary"}),"Create CDAD Mandate"]})}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx(rs,{children:"Select Agent"}),e.jsxs(ur,{value:o,onValueChange:i,children:[e.jsx(qs,{"data-testid":"select-mandate-agent",children:e.jsx(mr,{placeholder:"Choose an agent"})}),e.jsx(Zs,{children:t.map(O=>e.jsxs(ft,{value:String(O.id),children:[O.name," (",O.chain,")"]},O.id))})]})]}),e.jsxs("div",{children:[e.jsx(rs,{className:"mb-2 block",children:"Authorized Scopes"}),e.jsx("div",{className:"space-y-3 max-h-52 overflow-y-auto border border-border rounded-md p-3",children:Object.entries($P).map(([O,F])=>{const P=s.find(te=>te.name===O),Z=P?.userConnected&&!P?.tokenExpired,z=P?.oauthAvailable;return e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-1.5 mb-1",children:[Z?e.jsx(Es,{className:"h-3 w-3 text-emerald-500"}):z?e.jsx(ln,{className:"h-3 w-3 text-amber-500"}):e.jsx(ln,{className:"h-3 w-3 text-muted-foreground"}),e.jsx("p",{className:"text-xs font-medium text-foreground",children:O}),Z&&e.jsx("span",{className:"text-[9px] text-emerald-600 dark:text-emerald-400",children:"Your token"}),!Z&&z&&e.jsx("span",{className:"text-[9px] text-amber-600 dark:text-amber-400",children:"Not connected"})]}),e.jsx("div",{className:"flex gap-2 flex-wrap",children:F.map(te=>e.jsxs("label",{className:"flex items-center gap-1 text-xs text-muted-foreground cursor-pointer",children:[e.jsx(Jd,{checked:_(O,te),onCheckedChange:()=>A(O,te),"data-testid":`checkbox-scope-${O}-${te}`}),te]},te))})]},O)})})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{children:[e.jsx(rs,{children:"Per-Transaction Limit"}),e.jsx(et,{type:"number",value:m,onChange:O=>f(O.target.value),"data-testid":"input-mandate-per-tx"})]}),e.jsxs("div",{children:[e.jsx(rs,{children:"Per-Period Limit"}),e.jsx(et,{type:"number",value:x,onChange:O=>v(O.target.value),"data-testid":"input-mandate-per-period"})]}),e.jsxs("div",{children:[e.jsx(rs,{children:"Period (days)"}),e.jsx(et,{type:"number",value:y,onChange:O=>b(O.target.value),"data-testid":"input-mandate-period-days"})]}),e.jsxs("div",{children:[e.jsx(rs,{children:"Total Budget"}),e.jsx(et,{type:"number",value:k,onChange:O=>S(O.target.value),"data-testid":"input-mandate-total-budget"})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{children:[e.jsx(rs,{children:"Token"}),e.jsxs(ur,{value:j,onValueChange:w,children:[e.jsx(qs,{"data-testid":"select-mandate-token",children:e.jsx(mr,{})}),e.jsxs(Zs,{children:[e.jsx(ft,{value:"USDC",children:"USDC"}),e.jsx(ft,{value:"ETH",children:"ETH"}),e.jsx(ft,{value:"DAI",children:"DAI"})]})]})]}),e.jsxs("div",{children:[e.jsx(rs,{children:"Expires In (days)"}),e.jsx(et,{type:"number",value:E,onChange:O=>C(O.target.value),"data-testid":"input-mandate-expiration"})]})]}),e.jsx(x4,{asChild:!0,children:e.jsxs(ie,{className:"w-full",onClick:()=>D.mutate(),disabled:!o||c.length===0||D.isPending,"data-testid":"button-sign-mandate",children:[e.jsx(wv,{className:"h-4 w-4 mr-2"}),"Sign & Create Mandate"]})})]})]})}function zP(){const{toast:t}=Yt(),{session:s}=fr(),{data:n,isLoading:o}=He({queryKey:["/api/mandates"]}),{data:i}=He({queryKey:["/api/agents",{limit:200}],queryFn:()=>fetch("/api/agents?limit=200").then(b=>b.json())}),c=i?.agents,{data:d}=He({queryKey:["/api/integrations/status"]}),m=d?.integrations||[];d?.oauthBackedScopes;const f=Ut({mutationFn:async b=>(await dt("PATCH",`/api/mandates/${b}`,{status:"revoked"})).json(),onSuccess:()=>
84{ct.invalidateQueries({queryKey:["/api/mandates"]}),t({title:"Mandate revoked"})}}),x={active:tt,revoked:Pt,expired:Fr},v={active:"bg-emerald-500/10 text-emerald-600 dark:text-emerald-400",revoked:"bg-red-500/10 text-red-600 dark:text-red-400",expired:"bg-amber-500/10 text-amber-600 dark:text-amber-400"};function y(b){return c?.find(k=>k.id===b)?.name||`Agent #${b}`}return e.jsxs("div",{className:"min-h-screen",children:[e.jsx("div",{className:"border-b border-border bg-card/30",children:e.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 py-8",children:e.jsxs("div",{className:"flex items-center justify-between gap-4 flex-wrap",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[e.jsx(Ct,{className:"h-6 w-6 text-primary"}),e.jsx("h1",{className:"text-3xl font-bold text-foreground","data-testid":"text-mandate-title",children:"Mandates"})]}),e.jsxs("p",{className:"text-muted-foreground",children:["Manage CDAD delegated mandates scoped to"," ",e.jsxs("span",{className:"font-mono text-xs text-foreground",children:[s.address?.slice(0,6),"...",s.address?.slice(-4)]})]})]}),e.jsxs(Ra,{children:[e.jsx($c,{asChild:!0,children:e.jsxs(ie,{"data-testid":"button-create-mandate",children:[e.jsx(ka,{className:"h-4 w-4 mr-2"}),"New Mandate"]})}),e.jsx(VP,{agents:c||[],integrations:m})]})]})})}),e.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 py-8",children:o?e.jsx("div",{className:"space-y-4",children:Array.from({length:3}).map((b,k)=>e.jsx(ot,{className:"h-36 rounded-xl"},k))}):n&&n.length>0?e.jsx("div",{className:"space-y-4","data-testid":"mandates-list",children:n.map(b=>{const k=x[b.status]||Fr,S=b.authorizedScopes||[],j=b.paymentLimits,w=b.expirationTimestamp?new Date(b.expirationTimestamp):null,E=w&&w<new Date;return e.jsx(ue,{"data-testid":`mandate-card-${b.id}`,children:e.jsx(me,{className:"p-5",children:e.jsxs("div",{className:"flex items-start justify-between gap-4 flex-wrap",children:[e.jsxs("div",{className:"space-y-2 flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx(Os,{className:"h-4 w-4 text-primary"}),e.jsx("span",{className:"font-semibold text-foreground",children:y(b.agentId)}),e.jsxs(Y,{className:v[b.status],children:[e.jsx(k,{className:"h-3 w-3 mr-1"}),b.status]}),E&&b.status==="active"&&e.jsxs(Y,{variant:"secondary",className:"bg-amber-500/10 text-amber-600 dark:text-amber-400",children:[e.jsx(ks,{className:"h-3 w-3 mr-1"}),"Expired"]})]}),e.jsxs("div",{className:"text-xs text-muted-foreground",children:["Buyer: ",b.buyerAddress]}),S.length>0&&e.jsx("div",{className:"flex gap-1 flex-wrap",children:S.map(C=>{const A=m.find(D=>D.name===C.service),_=A?.userConnected&&!A?.tokenExpired;return e.jsxs(Y,{variant:"outline",className:`text-[10px] ${_?"border-emerald-500/30":""}`,children:[_?e.jsx(Es,{className:"h-2.5 w-2.5 mr-0.5 text-emerald-500"}):A?.oauthAvailable?e.jsx(ln,{className:"h-2.5 w-2.5 mr-0.5 text-amber-500"}):null,C.service,": ",C.scopes.join(", ")]},C.service)})}),j&&e.jsxs("div",{className:"flex items-center gap-3 text-xs text-muted-foreground flex-wrap",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Ss,{className:"h-3 w-3"}),j.perTransaction," ",j.token,"/tx"]}),e.jsxs("span",{children:[j.perPeriod," ",j.token,"/",j.periodDays,"d"]}),e.jsxs("span",{children:["Budget: ",j.totalBudget," ",j.token]})]}),w&&e.jsxs("div",{className:"text-xs text-muted-foreground flex items-center gap-1",children:[e.jsx(Fr,{className:"h-3 w-3"}),"Expires: ",w.toLocaleDateString()]})]}),b.status==="active"&&e.jsxs(ie,{size:"sm",variant:"outline",onClick:()=>f.mutate(b.id),disabled:f.isPending,"data-testid":`button-revoke-mandate-${b.id}`,children:[e.jsx(Pt,{className:"h-3.5 w-3.5 mr-1"}),"Revoke"]})]})})},b.id)})}):e.jsxs("div",{className:"text-center py-16","data-testid":"empty-mandates",children:[e.jsx(Ct,{className:"h-12 w-12 text-muted-foreground/40 mx-auto mb-4"}),e.jsx("h3",{className:"text-lg font-medium text-foreground mb-1",children:"No mandates yet"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Create a CDAD mandate to delegate scoped permissions to an agent"})]})})]})}function BP(){const{toast:t}=Yt(),{session:s}=fr(),[n,o]=p.useState(""),[i,c]=p.useState(!1),d=new URLSearchParams(window.location.search),m=d.get("connected"),f=d.get("error");p.useEffect(()=>{m&&(t({title:"OAuth Connected",description:`${m} has been authorized successfully.`}),window.history.replaceState({}
84,"","/vault"),ct.invalidateQueries({queryKey:["/api/integrations/status"]}),ct.invalidateQueries({queryKey:["/api/connected-services"]})),f&&(t({title:"OAuth Error",description:f,variant:"destructive"}),window.history.replaceState({},"","/vault"))},[m,f]);const{data:x,isLoading:v}=He({queryKey:["/api/integrations/status"]}),{data:y}=He({queryKey:["/api/oauth/providers"]}),{data:b,isLoading:k}=He({queryKey:["/api/vault/delegation-history"],enabled:!!s.address}),{data:S,isLoading:j}=He({queryKey:["/api/vault/zapier-status"],enabled:!!s.address}),{data:w}=He({queryKey:["/api/zapier-integration/status"]}),[E,C]=p.useState("partner"),A=Ut({mutationFn:async z=>(await dt("POST","/api/vault/zapier-key",{apiKey:z})).json(),onSuccess:()=>{o(""),ct.invalidateQueries({queryKey:["/api/vault/zapier-status"]}),t({title:"Zapier connected",description:"Your AI Actions API key has been saved."})},onError:z=>{t({title:"Failed to save",description:z.message,variant:"destructive"})}}),_=Ut({mutationFn:async()=>(await dt("DELETE","/api/vault/zapier-key")).json(),onSuccess:()=>{ct.invalidateQueries({queryKey:["/api/vault/zapier-status"]}),t({title:"Zapier disconnected",description:"API key removed from vault."})}}),D=Ut({mutationFn:async z=>(await dt("POST",`/api/oauth/disconnect/${encodeURIComponent(z)}`)).json(),onSuccess:()=>{ct.invalidateQueries({queryKey:["/api/integrations/status"]}),ct.invalidateQueries({queryKey:["/api/connected-services"]}),t({title:"Service disconnected",description:"OAuth tokens have been revoked."})}}),O=x?.integrations||[];x?.oauthBackedScopes,x?.configuredProviders;const F=O.filter(z=>z.userConnected&&!z.tokenExpired).length;O.filter(z=>z.oauthAvailable).length;const P=O.length;(y||[]).reduce((z,te)=>(z[te.name]||(z[te.name]=te),z),{});function Z(z){window.location.href=`/api/oauth/start/${z}`}return e.jsxs("div",{className:"min-h-screen",children:[e.jsx("div",{className:"border-b border-border bg-card/30",children:e.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 py-8",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[e.jsx(Io,{className:"h-6 w-6 text-primary"}),e.jsx("h1",{className:"text-3xl font-bold text-foreground","data-testid":"text-vault-title",children:"Credential Vault"})]}),e.jsxs("p",{className:"text-muted-foreground",children:["Connect your own accounts so AI agents can act on your behalf with your OAuth tokens.",s.address&&e.jsxs("span",{className:"ml-1",children:["Scoped to"," ",e.jsxs("span",{className:"font-mono text-xs text-foreground",children:[s.address?.slice(0,6),"...",s.address?.slice(-4)]})]})]})]})}),e.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 py-8 space-y-8",children:[e.jsx(ue,{children:e.jsx(me,{className:"p-5",children:e.jsxs("div",{className:"flex items-center justify-between gap-4 flex-wrap",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 rounded-lg bg-primary/10 flex items-center justify-center",children:e.jsx(ht,{className:"h-5 w-5 text-primary"})}),e.jsxs("div",{children:[e.jsx("h2",{className:"font-semibold text-foreground","data-testid":"text-oauth-summary",children:"Your OAuth Connections"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:F>0?`${F} service${F!==1?"s":""} connected with live OAuth tokens. Agents can use these on your behalf.`:"No services connected yet. Connect your accounts below to authorize agent access."})]})]}),e.jsxs(Y,{variant:"outline",className:"text-xs","data-testid":"badge-oauth-count",children:[F,"/",P," Connected"]})]})})}),v?e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:Array.from({length:4}).map((z,te)=>e.jsx(ot,{className:"h-36 rounded-xl"},te))}):e.jsx("div",{className:"space-y-6",children:(y||[]).map(z=>{const te=O.filter(I=>I.provider===z.key),ee=te.some(I=>I.userConnected&&!I.tokenExpired),se=te.some(I=>I.userConnected&&I.tokenExpired);return e.jsx(ue,{"data-testid":`provider-card-${z.key}`,children:e.jsxs(me,{className:"p-5",children:[e.jsxs("div",{className:"flex items-start justify-between gap-4 flex-wrap mb-4",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:`w-10 h-10 rounded-lg flex items-center justify-center ${ee?"bg-emerald-500/10":z.configured?"bg-primary/10":"bg-muted"}`,children:ee?e.jsx(Es,{className:"h-5 w-5 text-emerald-500"}):z.configured?e.jsx(Ad,{className:"h-5 w-5 text-primary"}):e.jsx(ln,{className:"h-5 w-5 text-muted-foreground"})}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-semibold text-foreground",children:z.name}),e.jsx("p",{className:"text-xs text-muted-foreground",children:z.services.join(", ")})]})]}),e.jsx("div",{className:"flex items-center gap-2",children:ee?e.jsxs(e.Fragment,{children:[e.jsxs(Y,{variant:"secondary",className:"bg-emerald-500/10 text-emerald-600 dark:text-emerald-400 text-xs",children:[e.jsx(tt,{className:"h-3 w-3 mr-1"}),"Connected"]}),e.jsxs(ie,{size:"sm",variant:"outline",onClick:()=>Z(z.key),"data-testid":`button-reconnect-${z.key}`,children:[e.jsx(qc,{className:"h-3.5 w-3.5 mr-1"}),"Reconnect"]}),e.jsx(ie,{size:"sm",variant:"ghost",onClick:()=>{te.forEach(I=>{I.userConnected&&D.mutate(I.name)})},disabled:D.isPending,"data-testid":`button-disconnect-${z.key}`,children:e.jsx(Yc,{className:"h-3.5 w-3.5 text-destructive"})})]}):se?e.jsxs(e.Fragment,{children:[e.jsxs(Y,{variant:"secondary",className:"bg-amber-500/10 text-amber-600 dar
84k:text-amber-400 text-xs",children:[e.jsx(ks,{className:"h-3 w-3 mr-1"}),"Token Expired"]}),e.jsxs(ie,{size:"sm",onClick:()=>Z(z.key),"data-testid":`button-reauth-${z.key}`,children:[e.jsx(qc,{className:"h-3.5 w-3.5 mr-1"}),"Re-authorize"]})]}):z.configured?e.jsxs(ie,{size:"sm",onClick:()=>Z(z.key),"data-testid":`button-connect-${z.key}`,children:[e.jsx($S,{className:"h-3.5 w-3.5 mr-1"}),"Connect ",z.name]}):e.jsxs(Y,{variant:"outline",className:"text-xs text-muted-foreground",children:[e.jsx(Pt,{className:"h-3 w-3 mr-1"}),"Not Configured"]})})]}),e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-2",children:te.map(I=>e.jsxs("div",{className:`flex items-center justify-between px-3 py-2 rounded-md border text-sm ${I.userConnected&&!I.tokenExpired?"border-emerald-500/30 bg-emerald-500/5":I.tokenExpired?"border-amber-500/30 bg-amber-500/5":"border-border bg-muted/20"}`,"data-testid":`service-status-${I.name}`,children:[e.jsxs("div",{className:"flex items-center gap-2",children:[I.userConnected&&!I.tokenExpired?e.jsx(tt,{className:"h-3.5 w-3.5 text-emerald-500 shrink-0"}):I.tokenExpired?e.jsx(ks,{className:"h-3.5 w-3.5 text-amber-500 shrink-0"}):e.jsx(Pt,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"}),e.jsx("span",{className:`text-xs font-medium ${I.userConnected&&!I.tokenExpired?"text-emerald-600 dark:text-emerald-400":I.tokenExpired?"text-amber-600 dark:text-amber-400":"text-muted-foreground"}`,children:I.name})]}),I.userConnected&&!I.tokenExpired&&e.jsxs(Y,{variant:"outline",className:"text-[10px] border-emerald-500/30",children:[e.jsx(Es,{className:"h-2 w-2 mr-0.5"}),"Live"]})]},I.name))}),ee&&e.jsx("div",{className:"mt-3 pt-3 border-t border-border",children:e.jsxs("p",{className:"text-[11px] text-muted-foreground",children:["OAuth scopes granted: ",te[0]?.scopes?.length||0," scopes. Agents with mandates referencing these services can use your tokens."]})}),!z.configured&&e.jsx("div",{className:"mt-3 pt-3 border-t border-border",children:e.jsxs("p",{className:"text-[11px] text-muted-foreground flex items-center gap-1",children:[e.jsx(ln,{className:"h-3 w-3 shrink-0"}),"OAuth credentials not configured for ",z.name,". Platform admin needs to set up ",z.name," OAuth app credentials."]})})]})},z.key)})}),e.jsx(ue,{"data-testid":"zapier-vault-card",children:e.jsxs(me,{className:"p-5 space-y-4",children:[e.jsx("div",{className:"flex items-start justify-between gap-4 flex-wrap",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 rounded-lg bg-orange-500/10 flex items-center justify-center",children:e.jsx(ht,{className:"h-5 w-5 text-orange-500"})}),e.jsxs("div",{children:[e.jsx("h2",{className:"font-semibold text-foreground",children:"Zapier Integration"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Connect to 8,000+ apps via Zapier for workflow automation"})]})]})}),e.jsxs("div",{className:"flex gap-1 p-1 bg-muted rounded-md",children:[e.jsx("button",{className:`flex-1 text-xs py-1.5 px-3 rounded transition-colors ${E==="partner"?"bg-background text-foreground shadow-sm font-medium":"text-muted-foreground hover:text-foreground"}`,onClick:()=>C("partner"),"data-testid":"tab-zapier-partner",children:"Partner OAuth"}),e.jsx("button",{className:`flex-1 text-xs py-1.5 px-3 rounded transition-colors ${E==="apikey"?"bg-background text-foreground shadow-sm font-medium":"text-muted-foreground hover:text-foreground"}`,onClick:()=>C("apikey"),"data-testid":"tab-zapier-apikey",children:"AI Actions Key"})]}),E==="partner"?e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"rounded-md border border-orange-500/20 bg-orange-500/5 p-3 space-y-2",children:[e.jsx("p",{className:"text-xs font-semibold text-foreground",children:"Zapier Developer Integration (Recommended)"}),e.jsx("p",{className:"text-[11px] text-muted-foreground leading-relaxed",children:"Build a proper Zapier integration so users connect via OAuth â no API key copying. Enables the Zapier Workflow Element embed, Workflow API access, and app discovery."})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-[11px] font-medium text-foreground",children:"Setup Steps:"}),[{n:1,text:"Create a free developer account at",link:"https://developer.za
84pier.com",label:"developer.zapier.com"},{n:2,text:"Build the onBench integration using Zapier's Visual Builder (OAuth v2)"},{n:3,text:"Set these OAuth endpoints in the Zapier Developer Platform:"},{n:4,text:"Add ZAPIER_CLIENT_ID + ZAPIER_CLIENT_SECRET to onBench environment secrets"},{n:5,text:"Publish integration (Beta stage) to unlock Workflow Element embedding"}].map(z=>e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"shrink-0 w-5 h-5 rounded-full bg-orange-500/10 text-orange-600 text-[10px] flex items-center justify-center font-semibold",children:z.n}),e.jsxs("p",{className:"text-[11px] text-muted-foreground",children:[z.text," ",z.link&&e.jsxs("a",{href:z.link,target:"_blank",rel:"noopener noreferrer",className:"underline hover:text-foreground inline-flex items-center gap-0.5",children:[z.label," ",e.jsx(wt,{className:"h-2.5 w-2.5"})]})]})]},z.n))]}),e.jsxs("div",{className:"rounded-md border border-border bg-muted/50 p-3 space-y-1.5",children:[e.jsx("p",{className:"text-[10px] font-semibold text-muted-foreground uppercase tracking-wide",children:"OAuth Endpoints to configure in Zapier"}),[{label:"Authorization URL",value:"/api/zapier-oauth/authorize"},{label:"Access Token URL",value:"/api/zapier-oauth/token"},{label:"Refresh Token URL",value:"/api/zapier-oauth/token"},{label:"Test URL",value:"/api/zapier-oauth/me"}].map(z=>e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-[10px] text-muted-foreground",children:z.label}),e.jsx("code",{className:"text-[10px] font-mono bg-background px-1.5 py-0.5 rounded border border-border",children:z.value})]},z.label))]}),e.jsxs("div",{className:"flex items-center gap-2",children:[w?.configured?e.jsxs(Y,{variant:"secondary",className:"bg-emerald-500/10 text-emerald-600 dark:text-emerald-400 text-xs",children:[e.jsx(tt,{className:"h-3 w-3 mr-1"}),"OAuth credentials configured"]}):e.jsxs(Y,{variant:"secondary",className:"text-xs text-muted-foreground",children:[e.jsx(Pt,{className:"h-3 w-3 mr-1"}),"ZAPIER_CLIENT_ID not set"]}),e.jsx("a",{href:"https://docs.zapier.com/platform/build/oauth",target:"_blank",rel:"noopener noreferrer",children:e.jsxs(ie,{size:"sm",variant:"outline",className:"text-xs h-7","data-testid":"button-zapier-oauth-docs",children:[e.jsx(wt,{className:"h-3 w-3 mr-1"})," OAuth Docs"]})})]})]}):e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Quick connect using a personal Zapier AI Actions API key for immediate use without the partner setup."}),j?e.jsx(Ge,{className:"h-4 w-4 animate-spin text-muted-foreground"}):S?.connected&&S?.valid?e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 rounded-md border border-orange-500/30 bg-
84orange-500/5 flex-1",children:[e.jsx(tt,{className:"h-3.5 w-3.5 text-orange-500 shrink-0"}),e.jsx("span",{className:"text-xs font-medium text-orange-600 dark:text-orange-400",children:"AI Actions API key active"})]}),e.jsx(ie,{size:"sm",variant:"ghost",onClick:()=>_.mutate(),disabled:_.isPending,"data-testid":"button-disconnect-zapier",children:e.jsx(Yc,{className:"h-3.5 w-3.5 text-destructive"})})]}),e.jsxs("p",{className:"text-[11px] text-muted-foreground flex items-center gap-1",children:[e.jsx(wt,{className:"h-3 w-3 shrink-0"}),e.jsx("a",{href:"https://nla.zapier.com/manage/",target:"_blank",rel:"noopener noreferrer",className:"underline hover:text-foreground",children:"Manage enabled actions on Zapier"})]})]}):S?.connected&&!S?.valid?e.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 rounded-md border border-amber-500/30 bg-amber-500/5",children:[e.jsx(ks,{className:"h-3.5 w-3.5 text-amber-500 shrink-0"}),e.jsx("span",{className:"text-xs text-amber-600 dark:text-amber-400",children:"API key stored but invalid â please update it"})]}):null,(!S?.connected||!S?.valid)&&e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex gap-2",children:[e.jsx(et,{type:"password",placeholder:"Paste your Zapier AI Actions API key",value:n,onChange:z=>o(z.target.value),className:"flex-1","data-testid":"input-zapier-key"}),e.jsxs(ie,{size:"sm",onClick:()=>A.mutate(n),disabled:!n||n.length<10||A.isPending,"data-testid":"button-save-zapier",children:[A.isPending?e.jsx(Ge,{className:"h-3.5 w-3.5 mr-1 animate-spin"}):e.jsx(kf,{className:"h-3.5 w-3.5 mr-1"}),"Save"]})]}),e.jsxs("p",{className:"text-[11px] text-muted-foreground flex items-center gap-1",children:[e.jsx(wt,{className:"h-3 w-3 shrink-0"}),"Get from"," ",e.jsx("a",{href:"https://nla.zapier.com/credentials/",target:"_blank",rel:"noopener noreferrer",className:"underline hover:text-foreground",children:"nla.zapier.com/credentials"})]})]})]})]})}),s.address&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 rounded-lg bg-primary/10 flex items-center justify-center",children:e.jsx(Nf,{className:"h-5 w-5 text-primary"})}),e.jsxs("div",{children:[e.jsx("h2",{className:"font-semibold text-foreground","data-testid":"text-delegation-history-title",children:"Delegation History"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Recent jobs and the scopes you delegated to agents."})]})]}),k?e.jsx("div",{className:"space-y-3",children:Array.from({length:3}).map((z,te)=>e.jsx(ot,{className:"h-24 rounded-xl"},te))}):!b||b.length===0?e.jsx(ue,{children:e.jsx(me,{className:"p-5",children:e.jsx("p",{className:"text-sm text-muted-foreground text-center py-4","data-testid":"text-no-delegations",children:"No delegation history yet. When you hire agents with scoped permissions, they will appear here."})})}):e.jsx("div",{className:"space-y-3",children:b.map(z=>e.jsx(ue,{"data-testid":`delegation-card-${z.jobId}`,children:e.jsxs(me,{className:"p-5",children:[e.jsxs("div",{className:"flex items-start justify-between gap-4 flex-wrap mb-3",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-8 h-8 rounded-md bg-primary/10 flex items-center justify-center",children:e.jsx(kf,{className:"h-4 w-4 text-primary"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-foreground","data-testid":`text-delegation-agent-${z.jobId}`,children:z.agentName}),e.jsxs("p",{className:"text-xs text-muted-foreground","data-testid":`text-delegation-jobid-${z.jobId}`,children:["Job #",z.jobId]})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Y,{variant:"outline",className:`text-xs ${z.status==="completed"?"border-emerald-500/30 text-emerald-600 dark:text-emerald-400":z.status==="rejected"||z.status==="expired"?"border-destructive/30 text-destructive":"border-border text-muted-foreground"}`,"data-testid":`badge-delegation-status-${z.jobId}`,children:z.status}),e.jsx("span",{className:"text-[11px] text-muted-foreground","data-testid":`text-delegation-date-${z.jobId}`,children:new Date(z.createdAt).toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric",hour:"2-digit",minute:"2-digit"})})]})]}),e.jsx("div",{className:"space-y-2",children:Object.entries(z.delegatedScopes).map(([te,ee])=>e.jsxs("div",{className:"flex items-start gap-2 px-3 py-2 rounded-md border border-border bg-muted/20","data-testid":`delegation-service-${z.jobId}-${te}`,children:[e.jsx("span",{className:"text-xs font-medium text-foreground shrink-0 min-w-[80px]",children:te}),e.jsx("div",{className:"flex flex-wrap gap-1",children:ee.map(se=>e.jsx(Y,{variant:"secondary",className:"text-[10px]",children:se},se))})]},te))})]})},z.jobId))})]})]})]})}function UP(){const{toast:t}
84=Yt(),{session:s,loading:n,connecting:o,connect:i,disconnect:c,attestKyc:d,mintBuyerAgent:m}=fr(),{data:f}=He({queryKey:["/api/integrations/status"]}),x=f?.integrations||[],v=x.filter(S=>S.userConnected&&!S.tokenExpired).length,y=x.length;function b(S){navigator.clipboard.writeText(S),t({title:"Copied to clipboard"})}const k=[{label:"Wallet Connected",done:s.authenticated,icon:St},{label:"Verified Human",done:s.authenticated,icon:wo},{label:"KYC Attested",done:s.kycVerified,icon:Ct},{label:"Buyer Agent NFT",done:s.buyerTokenId!==null,icon:Os}];return n?e.jsx("div",{className:"min-h-[60vh] flex items-center justify-center",children:e.jsx(Ge,{className:"h-8 w-8 animate-spin text-primary"})}):e.jsxs("div",{className:"min-h-screen",children:[e.jsx("div",{className:"border-b border-border bg-card/30",children:e.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 py-8",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[e.jsx(Ui,{className:"h-6 w-6 text-primary"}),e.jsx("h1",{className:"text-3xl font-bold text-foreground","data-testid":"text-identity-title",children:"Identity"})]}),e.jsx("p",{className:"text-muted-foreground",children:"Connect your wallet, verify ownership via EIP-191 signature, complete KYC, and mint your Buyer Agent NFT"})]})}),e.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 py-8 space-y-8",children:[e.jsx(ue,{children:e.jsxs(me,{className:"p-5",children:[e.jsx("h2",{className:"font-semibold text-foreground mb-4",children:"Identity Chain"}),e.jsx("div",{className:"flex items-center gap-2 flex-wrap","data-testid":"identity-chain-steps",children:k.map((S,j)=>{const w=S.icon;return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("div",{className:`flex items-center gap-2 px-3 py-2 rounded-md border ${S.done?"border-emerald-500/40 bg-emerald-500/5":"border-border bg-muted/30"}`,children:[e.jsx(w,{className:`h-4 w-4 ${S.done?"text-emerald-500":"text-muted-foreground"}`}),e.jsx("span",{className:`text-xs font-medium ${S.done?"text-emerald-600 dark:text-emerald-400":"text-muted-foreground"}`,children:S.label}),S.done&&e.jsx(tt,{className:"h-3 w-3 text-emerald-500"})]}),j<k.length-1&&e.jsx(lr,{className:"h-3.5 w-3.5 text-muted-foreground"})]},S.label)})})]})}),e.jsx(ue,{children:e.jsxs(me,{className:"p-5 space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(St,{className:"h-5 w-5 text-primary"}),e.jsx("h2",{className:"font-semibold text-foreground",children:"Sign In With Wallet"})]}),s.authenticated?e.jsxs("div",{className:"space-y-3",children:[e.jsx("div",{className:"flex items-center gap-2 flex-wrap",children:e.jsxs(Y,{variant:"secondary",className:"bg-emerald-500/10 text-emerald-600 dark:text-emerald-400",children:[e.jsx(tt,{className:"h-3 w-3 mr-1"}),"Connected & Verified (EIP-191)"]})}),e.jsxs("div",{className:"flex items-center gap-2 bg-muted/50 rounded-md px-3 py-2",children:[e.jsx("span",{className:"text-xs font-mono text-foreground truncate","data-testid":"text-wallet-address",children:s.address}),e.jsx(ie,{size:"icon",variant:"ghost",onClick:()=>s.address&&b(s.address),"data-testid":"button-copy-address",children:e.jsx(_d,{className:"h-3 w-3"})})]}),e.jsxs(Y,{variant:"secondary",className:"bg-emerald-500/10 text-emerald-600 dark:text-emerald-400",children:[e.jsx(kv,{className:"h-3 w-3 mr-1"}),"Ownership verified via personal_sign"]}),e.jsx("div",{children:e.jsxs(ie,{variant:"outline",size:"sm",onClick:c,"data-testid":"button-disconnect-wallet",children:[e.jsx(Cf,{className:"h-3.5 w-3.5 mr-1.5"}),"Disconnect"]})})]}):e.jsxs("div",{className:"space-y-4",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"Connect your Ethereum wallet to authenticate. You will be asked to sign an EIP-191 challenge message to prove ownership. No private keys are shared â only the signature is verified server-side."}),e.jsxs("div",{className:"flex gap-3 flex-wrap",children:[e.jsxs(ie,{onClick:()=>i("metamask"),disabled:o,"data-testid":"button-connect-metamask",children:[o?e.jsx(Ge,{className:"h-4 w-4 mr-2 animate-spin"}):e.jsx(St,{className:"h-4 w-4 mr-2"}),"Sign in with MetaMask"]}),e.jsxs(ie,{variant:"outline",onClick:()=>i("coinbase"),disabled:o,"data-testid":"button-connect-coinbase",children:[o?e.jsx(Ge,{className:"h-4 w-4 mr-2 animate-spin"}):e.jsx(St,{className:"h-4 w-4 mr-2"}),"Sign in with Coinbase Wallet"]})]}),e.jsxs("div",{className:"bg-muted/50 rounded-md p-3 space-y-2",children:[e.jsx("p",{className:"text-xs font-medium text-foreground",children:"How it works:"}),e.jsxs("ol",{className:"text-xs text-muted-foreground space-y-1 list-decimal list-inside",children:[e.jsx("li",{children:'Click "Sign in" to request wallet connection via window.ethereum'}),e.jsx("li",{children:"Server generates a unique nonce challenge"}),e.jsx("li",{children:"You sign the challenge with personal_sign (EIP-191)"}),e.jsx("li",{children:"Server verifies the signature using viem.verifyMessage"}),e.jsx("li",{children:"Your wallet address is linked to your session as your buyer identity"})]})]})]})]})}),e.jsx(ue,{children:e.jsxs(me,{className:"p-5 space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Ct,{className:"h-5 w-5 text-primary"}),e.jsx("h2",{className:"font-semibold text-foreground",children:"KYC Attestation"}),e.jsx(Y,{variant:"outline",className:"text-[10px] ml-1",children:"EAS on Base"})]}),s.kycVerified?e.jsxs("div",{className:"space-y-3",children:[e.jsxs(Y,{variant:"secondary",className:"bg-emerald-500/10 text-emerald-600 dark:text-emerald-400",children:[e.jsx(tt,{className:"h-3 w-3 mr-1"}),"KYC Verified"]}),e.jsxs("div",{className:"text-xs text-muted-foreground space-y-1",children:[e.jsxs("p",{children:["Attestation ID: ",e.jsx("span",{className:"font-mono text-foreground",children:s.kycAttestationId})]}),e.jsxs("p",{children:["Schema: ",e.jsx("span",{className:"font-mono text-foreground",children:"0xEAS_SOLIDIS_BUYER_KYC_V1"})]}),e.jsxs("p",{children:["Linked Wallet: ",e.jsx("span",{className:"font-mono text-foreground",children:s.address})]})]})]}):e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"Complete KYC verification to receive an on-chain attestation via EAS on Base. This links your verified identity to your wallet address for scope-based mandate permissions."}),e.jsxs(ie,{onClick:d,disabled:!s.authenticated,"data-testid":"button-verify-kyc",children:[e.jsx(wo,{className:"h-4 w-4 mr-2"}),"Verify KYC & Attest"]}),!s.authenticated&&e.jsxs("p",{className:"text-xs text-muted-foreground flex items-center gap-1",children:[e.jsx(ks,{className:"h-3 w-3"}),"Connect and sign with your wallet first"]})]})]})}),e.jsx(ue,{children:e.jsxs(me,{className:"p-5 space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Os,{className:"h-5 w-5 text-primary"}),e.jsx("h2",{className:"font-semibold text-foreground",children:"Buyer Agent NFT"}),e.jsx(Y,{variant:"outline",className:"text-[10px] ml-1",children:"ERC-8004"})]}),s.buyerTokenId?e.jsx("div",{className:"space-y-3",children:e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-3",children:[e.jsxs("div",{className:"bg-muted/50 rounded-md p-3 space-y-1",children:[e.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Token ID"}),e.jsxs("p",{className:"text-sm font-semibold text-foreground","data-testid":"text-buyer-token-id",children:["#",s.buyerTokenId]})]}),e.jsxs("div",{className:"bg-muted/50 rounded-md p-3 space-y-1",children:[e.jsx("p",{className:"text-[11px] text-muted-foreground",children:"TBA Address (ERC-6551)"}),e.jsx("p",{className:"text-xs font-mono text-foreground truncate","data-testid":"text-tba-address",children:s.tbaAddress})]}),e.jsxs("div",{className:"bg-muted/50 rounded-md p-3 space-y-1",children:[e.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Owner Wallet"}),e.jsx("p",{className:"text-xs font-mono text-foreground truncate",children:s.address})]})]})}):e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"Mint a Buyer Agent NFT to create an ERC-6551 Token Bound Account for delegated operations. This TBA becomes your on-chain agent identity linked to your wallet."}),e.jsxs(ie,{onClick:m,disabled:!s.kycVerified,"data-testid":"button-mint-buyer-agent",children:[e.jsx(Os,{className:"h-4 w-4 mr-2"}),"Mint Buyer Agent"]}),!s.kycVerified&&e.jsxs("p",{className:"text-xs text-muted-foreground flex items-center gap-1",children:[e.jsx(ks,{className:"h-3 w-3"}),"Complete KYC verification first"]})]})]})}),s.authenticated&&e.jsx(ue,{children:e.jsxs(me,{className:"p-5 space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(kv,{className:"h-5 w-5 text-primary"}),e.jsx("h2",{className:"font-semibold text-foreground",children:"Linked Scopes & Permissions"})]}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Your wallet ",e.jsx("span",{className:"font-mono text-foreground text-xs",children:s.address})," is now your buyer identity. All mandates, vault credentials, jobs, and orchestration workflows are scoped to this address."]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:[e.jsxs("div",{className:"bg-muted/50 rounded-md p-3",children:[e.jsx("p",{className:"text-xs font-medium text-foreground mb-1",children:"Mandates"}),e.jsx("p",{className:"text-[11px] text-muted-foreground",children:"CDAD mandates are scoped to your wallet. Only you can create, view, and revoke mandates."})]}),e.jsxs("div",{className:"bg-muted/50 rounded-md p-3",children:[e.jsx("p",{className:"text-xs font-medium text-foreground mb-1",children:"Credential Vault"}),e.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Connected services and API keys are linked to your wallet address."})]}),e.jsxs("div",{className:"bg-muted/50 rounded-md p-3",children:[e.jsx("p",{className:"text-xs font-medium text-foreground mb-1",children:"Jobs"}),e.jsx("p",{className:"text-[11px] text-muted-foreground",children:"EIP-8183 jobs use your wallet as the buyer address for on-chain escrow."})]}),e.jsxs("div",{className:"bg-muted/50 rounded-md p-3",children:[e.jsx("p",{className:"text-xs font-medium text-foreground mb-1",children:"Orchestration"}),e.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Multi-agent workflows are owned by your wallet address."})]})]})]})}),s.authenticated&&e.jsx(ue,{children:e.jsxs(me,{className:"p-5 space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Ad,{className:"h-5 w-5 text-primary"}),e.jsx("h2",{className:"font-semibold text-foreground",children:"OAuth Service Connections"})]}),e.jsx(kt,{href:"/vault",children:e.jsxs(ie,{variant:"outline",size:"sm","data-testid":"link-manage-vault",children:[e.jsx(wt,{className:"h-3.5 w-3.5 mr-1.5"}),"Manage in Vault"]})})]}),e.jsxs("div",{className:"flex items-center gap-2 p-3 rounded-md bg-muted/50 border border-border",children:[e.jsx(Es,{className:"h-4 w-4 text-primary shrink-0"}),e.jsxs("p",{className:"text-sm text-foreground","data-testid":"text-oauth-summary",children:[e.jsxs("span",{className:"font-semibold",children:[v," of ",y]})," services connected with your OAuth tokens.",v>0?" Agents with mandates can use these services on your behalf.":" Connect your accounts in the Vault to authorize agent access."]})]}
84),e.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-5 gap-2",children:x.map(S=>{const j=S.userConnected&&!S.tokenExpired;return e.jsxs("div",{className:`flex items-center gap-1.5 px-2.5 py-1.5 rounded-md border text-xs ${j?"border-emerald-500/30 bg-emerald-500/5 text-emerald-600 dark:text-emerald-400":S.tokenExpired?"border-amber-500/30 bg-amber-500/5 text-amber-600 dark:text-amber-400":"border-border bg-muted/30 text-muted-foreground"}`,"data-testid":`identity-oauth-${S.name}`,children:[j?e.jsx(tt,{className:"h-3 w-3 shrink-0"}):e.jsx(Pt,{className:"h-3 w-3 shrink-0"}),e.jsx("span",{className:"truncate",children:S.name})]},S.name)})})]})})]})]})}const To={open:{label:"Open",color:"bg-blue-500/10 text-blue-600 dark:text-blue-400 border-blue-500/20",icon:ir},funded:{label:"Funded",color:"bg-emerald-500/10 text-emerald-600 dark:text-emerald-400 border-emerald-500/20",icon:Ss},executing:{label:"Executing",color:"bg-violet-500/10 text-violet-600 dark:text-violet-400 border-violet-500/20",icon:Ge},submitted:{label:"Submitted",color:"bg-amber-500/10 text-amber-600 dark:text-amber-400 border-amber-500/20",icon:Ge},completed:{label:"Completed",color:"bg-green-500/10 text-green-600 dark:text-green-400 border-green-500/20",icon:tt},rejected:{label:"Rejected",color:"bg-red-500/10 text-red-600 dark:text-red-400 border-red-500/20",icon:Pt},expired:{label:"Expired",color:"bg-gray-500/10 text-gray-600 dark:text-gray-400 border-gray-500/20",icon:Do}};function HP({claim:t,onUnclaim:s,isPending:n}){const o=t.agent;return e.jsx(ue,{"data-testid":`card-claimed-agent-${o.id}`,children:e.jsxs(me,{className:"p-4 space-y-3",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[e.jsx("div",{className:"w-10 h-10 rounded-md overflow-hidden bg-muted shrink-0",children:e.jsx("img",{src:o.imageUrl||"/images/agent-dataforge.svg",alt:o.name,className:"w-full h-full object-cover"})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("h3",{className:"font-semibold text-sm text-foreground truncate","data-testid":`text-claimed-agent-name-${o.id}`,children:o.name}),e.jsxs("p",{className:"text-xs text-muted-foreground truncate",children:[o.chain," #",o.tokenId]})]})]}),e.jsx(ie,{size:"sm",variant:"ghost",onClick:s,disabled:n,"data-testid":`button-unclaim-${o.id}`,children:n?e.jsx(Ge,{className:"h-3.5 w-3.5 animate-spin"}):e.jsx(BS,{className:"h-3.5 w-3.5"})})]}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsxs(Y,{variant:"secondary",className:"text-[10px]",children:[e.jsx(tt,{className:"h-3 w-3 mr-0.5 text-emerald-500"}),"Verified"]}),e.jsx(Y,{variant:"outline",className:"text-[10px]",children:o.executionMode==="always_on"?"Always-On":"Manual"})]}),e.jsxs("div",{className:"flex items-center gap-4 text-xs text-muted-foreground flex-wrap",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(_a,{className:"h-3 w-3"}),o.totalJobs||0," jobs"]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Ss,{className:"h-3 w-3"}),(o.totalEarnings||0).toFixed(2)," earned"]})]})]})})}function WP({agent:t,onClaim:s,isPending:n}){return e.jsx(ue,{"data-testid":`card-claimable-agent-${t.id}`,children:e.jsx(me,{className:"p-4",children:e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[e.jsx("div",{className:"w-10 h-10 rounded-md overflow-hidden bg-muted shrink-0",children:e.jsx("img",{src:t.imageUrl||"/images/agent-dataforge.svg",alt:t.name,className:"w-full h-full object-cover"})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("h3",{className:"font-semibold text-sm text-foreground truncate","data-testid":`text-claimable-agent-name-${t.id}`,children:t.name}),e.jsxs("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[e.jsx(Ct,{className:"h-3 w-3 text-emerald-500"}),e.jsxs("span",{className:"truncate",children:["Owner match: ",t.ownerAddress?.slice(0,6),"...",t.ownerAddress?.slice(-4)]})]})]})]}),e.jsxs(ie,{size:"sm",onClick:s,disabled:n,"data-testid":`button-claim-${t.id}`,children:[n?e.jsx(Ge,{className:"h-3.5 w-3.5 animate-spin"}):e.jsx(ka,{className:"h-3.5 w-3.5 mr-1"}),"Claim"]})]})})})}function KP({job:t,agents:s,onAccept:n,onDecline:o}){const i=s[t.agentId],c=To[t.status]||To.open;return e.jsx(ue,{"data-testid":`card-incoming-job-${t.id}`,children:e.jsxs(me,{className:"p-4 space-y-3",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1 flex-wrap",children:[e.jsxs("h3",{className:"font-semibold text-sm text-foreground","data-testid":`text-incoming-job-title-${t.id}`,children:["Job #",t.id]}),e.jsx(Y,{variant:"secondary",className:re("text-[10px]",c.color),children:c.label})]}),e.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2","data-testid":`text-incoming-job-desc-${t.id}`,children:t.taskDescription})]}),i&&e.jsxs("div",{className:"flex items-center gap-2 shrink-0 text-xs text-muted-foreground",children:[e.jsx("div",{className:"w-7 h-7 rounded-md overflow-hidden bg-muted",children:e.jsx("img",{src:i.imageUrl||"/images/agent-dataforge.svg",alt:i.name,className:"w-full h-full object-cover"})}),e.jsx("span",{className:"font-medium text-foreground",children:i.name})]})]}),e.jsxs("div",{className:"flex items-center gap-4 text-xs text-muted-foreground flex-wrap",children:[e.jsxs("span",{className:"flex items-center gap-1","data-testid":`text-incoming-client-${t.id}`,children:[e.jsx(St,{className:"h-3 w-3"}),t.buyerAddress.slice(0,6),"...",t.buyerAddress.slice(-4)]}),t.escrowAmount!=null&&t.escrowAmount>0&&e.jsxs("span",{className:"flex items-center gap-1","data-testid":`text-incoming-escrow-${t.id}`,children:[e.jsx(Ss,{className:"h-3 w-3"}),t.escrowAmount," ",t.escrowToken||"USDC"]}),t.evaluatorType&&e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Ct,{className:"h-3 w-3"}),t.evaluatorType==="ai_agent"?"AI Evaluator":t.evaluatorType==="self"?"Self":t.evaluatorType]})]}),t.selectedTools&&t.selectedTools.length>0&&e.jsx("div",{className:"flex gap-1 flex-wrap",children:t.selectedTools.map(d=>e.jsxs(Y,{variant:"outline",className:"text-[10px]",children:[e.jsx(Gs,{className:"h-3 w-3 mr-0.5"}),d]},d))}
84),t.connectedServicesSnapshot&&t.connectedServicesSnapshot.length>0&&e.jsxs("div",{children:[e.jsx("p",{className:"text-[10px] font-medium text-muted-foreground uppercase tracking-wider mb-1",children:"Shared Services"}),e.jsx("div",{className:"flex gap-1 flex-wrap",children:t.connectedServicesSnapshot.map(d=>e.jsx(Y,{variant:"secondary",className:"text-[10px]",children:d},d))})]}),e.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[e.jsxs(ie,{className:"flex-1 bg-emerald-600 hover:bg-emerald-700 text-white",onClick:()=>n(t.id),"data-testid":`button-accept-job-${t.id}`,children:[e.jsx(tt,{className:"h-4 w-4 mr-1.5"}),"Accept"]}),e.jsxs(ie,{variant:"outline",className:"flex-1 border-red-500/30 text-red-600 dark:text-red-400",onClick:()=>o(t.id),"data-testid":`button-decline-job-${t.id}`,children:[e.jsx(Pt,{className:"h-4 w-4 mr-1.5"}),"Decline"]})]})]})})}function qP({job:t,agents:s,onDeliver:n}){const o=s[t.agentId],i=To[t.status]||To.funded;return e.jsx(ue,{"data-testid":`card-active-job-${t.id}`,children:e.jsxs(me,{className:"p-4 space-y-3",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1 flex-wrap",children:[e.jsxs("h3",{className:"font-semibold text-sm text-foreground","data-testid":`text-active-job-title-${t.id}`,children:["Job #",t.id]}),e.jsx(Y,{variant:"secondary",className:re("text-[10px]",i.color),children:i.label}),t.providerAcceptedAt&&e.jsx(Y,{variant:"secondary",className:"text-[10px] bg-emerald-500/10 text-emerald-600 dark:text-emerald-400 border-emerald-500/20",children:"Accepted"})]}),e.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:t.taskDescription})]}),o&&e.jsx("div",{className:"flex items-center gap-2 shrink-0 text-xs",children:e.jsx("div",{className:"w-7 h-7 rounded-md overflow-hidden bg-muted",children:e.jsx("img",{src:o.imageUrl||"/images/agent-dataforge.svg",alt:o.name,className:"w-full h-full object-cover"})})})]}),t.stepResults&&Array.isArray(t.stepResults)&&t.stepResults.length>0&&e.jsxs("div",{className:"border-t border-border/50 pt-3",children:[e.jsx("p",{className:"text-[10px] font-medium text-muted-foreground uppercase tracking-wider mb-2",children:"Step Progress"}),e.jsx("div",{className:"space-y-1.5",children:t.stepResults.map((c,d)=>e.jsxs("div",{className:"flex items-center justify-between gap-2 text-xs",children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx("div",{className:re("h-1.5 w-1.5 rounded-full shrink-0",{"bg-muted-foreground":c.status==="pending","bg-blue-500 animate-pulse":c.status==="running","bg-green-500":c.status==="completed","bg-red-500":c.status==="failed","bg-amber-500":c.status==="gated"})}),e.jsx("span",{className:"truncate",children:c.stepName})]}),c.cost!==void 0&&e.jsxs("span",{className:"text-muted-foreground tabular-nums shrink-0",children:["$",c.cost.toFixed(4)]})]},d))})]}),t.taskPayload&&e.jsxs("div",{className:"border-t border-border/50 pt-3",children:[e.jsx("p",{className:"text-[10px] font-medium text-muted-foreground uppercase tracking-wider mb-1",children:"Task Payload"}),e.jsx("pre",{className:"text-xs text-foreground bg-muted/50 rounded-md p-2 overflow-x-auto max-h-24",children:JSON.stringify(t.taskPayload,null,2)})]}),e.jsx("div",{className:"flex items-center gap-4 text-xs text-muted-foreground flex-wrap",children:t.escrowAmount!=null&&t.escrowAmount>0&&e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Ss,{className:"h-3 w-3"}),t.escrowAmount," ",t.escrowToken||"USDC"]})}),(t.status==="funded"||t.status==="executing")&&e.jsxs(ie,{className:"w-full",onClick:()=>n(t),"data-testid":`button-deliver-job-${t.id}`,children:[e.jsx(jo,{className:"h-4 w-4 mr-1.5"}),"Submit Deliverable"]})]})})}function ZP({job:t,agents:s}){const n=s[t.agentId],o=To[t.status]||To.completed,[i,c]=p.useState(!1);return e.jsx(ue,{"data-testid":`card-history-job-${t.id}`,children:e.jsxs(me,{className:"p-4 space-y-3",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1 flex-wrap",children:[e.jsxs("h3",{className:"font-semibold text-sm text-foreground",children:["Job #",t.id]}),e.jsx(Y,{variant:"secondary",className:re("text-[10px]",o.color),children:o.label}),t.executionMode&&e.jsxs(Y,{variant:"outline",className:"text-[10px]",children:[t.executionMode==="always_on"?e.jsx(ht,{className:"h-3 w-3 mr-0.5"}):e.jsx(Fr,{className:"h-3 w-3 mr-0.5"}),t.executionMode==="always_on"?"Instant":"Manual"]})]}),e.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:t.taskDescription})]}),n&&e.jsxs("div",{className:"flex items-center gap-2 shrink-0 text-xs",children:[e.jsx("div",{className:"w-7 h-7 rounded-md overflow-hidden bg-muted",children:e.jsx("img",{src:n.imageUrl||"/images/agent-dataforge.svg",alt:n.name,className:"w-full h-full object-cover"})}),e.jsx("span",{className:"font-medium text-foreground",children:n.name})]})]}),t.declineReason&&e.jsx("div",{className:"bg-red-500/5 border border-red-500/20 rounded-md p-2",children:e.jsxs("p",{className:"text-xs text-red-600 dark:text-red-400",children:[e.jsx(ks,{className:"h-3 w-3 inline mr-1"}),"Declined: ",t.declineReason]})}),t.deliverable&&e.jsxs("div",{className:"border-t border-border/50 pt-3",children:[e.jsx("p",{className:"text-[10px] font-medium text-muted-foreground uppercase tracking-wider mb-1",children:"Deliverable"}),t.deliverableType==="tool_output"&&t.deliverableMetadata?e.jsx("div",{className:"bg-muted/50 rounded-md p-2 space-y-1",children:e.jsxs("div",{className:"flex items-center gap-2 text-xs font-medium text-foreground",children:[e.jsx(Gs,{className:"h-3 w-3"}),t.deliverableMetadata.tool,e.jsx(Cs,{className:"h-3 w-3 text-muted-foreground"}),t.deliverableMetadata.action,t.deliverableMetadata.recordId&&e.jsxs(e.Fragment,{children:[e.jsx(Cs,{className:"h-3 w-3 text-muted-foreground"}),e.jsx("span",{className:"font-mono",children:t.deliverableMetadata.recordId})]})]})}):e.jsx("p",{className:"text-xs text-foreground",children:t.deliverable})]}),t.deliverableHash&&e.jsxs("button",{className:"text-xs text-primary flex items-center gap-1",onClick:()=>c(!i),"data-testid":`button-toggle-onchain-${t.id}`,children:[e.jsx(nn,{className:"h-3 w-3"}),i?"Hide":"Show"," On-Chain Record"]}),i&&e.jsxs("div",{className:"bg-muted/50 rounded-md p-3 space-y-2 text-xs",children:[t.taskHash&&e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-muted-foreground",children:"Task Hash:"}),e.jsx("span",{className:"font-mono text-foreground truncate max-w-48",children:t.taskHash})]}),t.deliverableHash&&e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-muted-foreground",children:"Deliverable Hash:"}),e.jsx("span",{className:"font-mono text-foreground truncate max-w-48",children:t.deliverableHash})]}),t.escrowAmount!=null&&e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-muted-foreground",children:"Escrow:"}),e.jsxs("span",{className:"text-foreground",children:[t.escrowAmount," ",t.escrowToken||"USDC"]})]})]})]})})}
84function GP({job:t,open:s,onOpenChange:n}){const{toast:o}=Yt(),[i,c]=p.useState("text"),[d,m]=p.useState(""),[f,x]=p.useState(""),[v,y]=p.useState(""),[b,k]=p.useState(""),[S,j]=p.useState("{}"),[w,E]=p.useState(""),C=Ut({mutationFn:async()=>{if(!t)throw new Error("No job selected");let D="",O=null;if(i==="text")D=d;else if(i==="tool_output"){let F={};try{F=JSON.parse(S)}catch{F={}}O={tool:f,action:v,recordId:b,details:F},D=`${f}: ${v}${b?` (${b})`:""}`}else i==="file_hash"&&(D=w);await dt("POST",`/api/jobs/${t.id}/deliver`,{deliverable:D,deliverableType:i,deliverableMetadata:O})},onSuccess:()=>{o({title:"Deliverable submitted",description:`Job #${t?.id} deliverable has been submitted.`}),ct.invalidateQueries({queryKey:["/api/agent-dashboard/jobs/active"]}),ct.invalidateQueries({queryKey:["/api/agent-dashboard/jobs/history"]}),n(!1),A()},onError:D=>{o({title:"Submission failed",description:D.message,variant:"destructive"})}});function A(){c("text"),m(""),x(""),y(""),k(""),j("{}"),E("")}const _=(()=>{let D="";return i==="text"?D=d:i==="tool_output"?D=`${f}:${v}:${b}:${S}`:D=w,D?`0x${Array.from(D.slice(0,16)).map(O=>O.charCodeAt(0).toString(16).padStart(2,"0")).join("")}...`:"â"})();return e.jsx(Ra,{open:s,onOpenChange:n,children:e.jsxs(ea,{className:"max-w-lg",children:[e.jsxs(ta,{children:[e.jsx(sa,{children:"Submit Deliverable"}),e.jsx(qi,{children:t?`Submit your work for Job #${t.id}`:"Select a job first"})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx(rs,{children:"Deliverable Type"}),e.jsxs(ur,{value:i,onValueChange:c,children:[e.jsx(qs,{"data-testid":"select-deliverable-type",children:e.jsx(mr,{})}),e.jsxs(Zs,{children:[e.jsx(ft,{value:"text",children:e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx(Qn,{className:"h-3.5 w-3.5"})," Text / Report"]})}),e.jsx(ft,{value:"tool_output",children:e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx(Gs,{className:"h-3.5 w-3.5"})," Tool Output"]})}),e.jsx(ft,{value:"file_hash",children:e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx(on,{className:"h-3.5 w-3.5"})," File / Hash"]})})]})]})]}),i==="text"&&e.jsxs("div",{children:[e.jsx(rs,{children:"Content"}),e.jsx(Vr,{value:d,onChange:D=>m(D.target.value),placeholder:"Enter your deliverable text or report...",className:"min-h-32","data-testid":"input-deliverable-text"})]}),i==="tool_output"&&e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx(rs,{children:"Tool"}),t?.selectedTools&&t.selectedTools.length>0?e.jsxs(ur,{value:f,onValueChange:x,children:[e.jsx(qs,{"data-testid":"select-tool-name",children:e.jsx(mr,{placeholder:"Select tool..."})}),e.jsx(Zs,{children:t.selectedTools.map(D=>e.jsx(ft,{value:D,children:D},D))})]}):e.jsx(et,{value:f,onChange:D=>x(D.target.value),placeholder:"e.g. QuickBooks","data-testid":"input-tool-name"})]}),e.jsxs("div",{children:[e.jsx(rs,{children:"Action"}),e.jsx(et,{value:v,onChange:D=>y(D.target.value),placeholder:"e.g. invoice_created","data-testid":"input-tool-action"})]}),e.jsxs("div",{children:[e.jsx(rs,{children:"Record ID"}),e.jsx(et,{value:b,onChange:D=>k(D.target.value),placeholder:"e.g. INV-2024-0891","data-testid":"input-tool-record-id"})]}),e.jsxs("div",{children:[e.jsx(rs,{children:"Details (JSON)"}),e.jsx(Vr,{value:S,onChange:D=>j(D.target.value),placeholder:'{"customer": "Acme Corp", "amount": 1500}',className:"font-mono text-xs min-h-20","data-testid":"input-tool-details"})]})]}),i==="file_hash"&&e.jsxs("div",{children:[e.jsx(rs,{children:"IPFS Hash or URL"}),e.jsx(et,{value:w,onChange:D=>E(D.target.value),placeholder:"ipfs://Qm... or https://...","data-testid":"input-file-hash"})]}),e.jsx("div",{className:"bg-muted/50 rounded-md p-3",children:e.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[e.jsx(nn,{className:"h-3 w-3"}),e.jsx("span",{children:"Deliverable Hash Preview:"}),e.jsx("span",{className:"font-mono text-foreground","data-testid":"text-hash-preview",children:_})]})})]}),e.jsxs($h,{children:[e.jsx(ie,{variant:"outline",onClick:()=>n(!1),"data-testid":"button-cancel-deliver",children:"Cancel"}),e.jsxs(ie,{onClick:()=>C.mutate(),disabled:C.isPending,"data-testid":"button-submit-deliverable",children:[C.isPending?e.jsx(Ge,{className:"h-4 w-4 mr-1.5 animate-spin"}):e.jsx(jo,{className:"h-4 w-4 mr-1.5"}),"Submit"]})]})]})})}function QP({jobId:t,open:s,onOpenChange:n}){const{toast:o}=Yt(),[i,c]=p.useState(""),d=Ut({mutationFn:async()=>
84{if(!t)throw new Error("No job selected");await dt("POST",`/api/jobs/${t}/decline`,{reason:i||"No reason provided"})},onSuccess:()=>{o({title:"Job declined",description:`Job #${t} has been declined.`}),ct.invalidateQueries({queryKey:["/api/agent-dashboard/jobs/incoming"]}),ct.invalidateQueries({queryKey:["/api/agent-dashboard/jobs/history"]}),n(!1),c("")},onError:m=>{o({title:"Decline failed",description:m.message,variant:"destructive"})}});return e.jsx(Ra,{open:s,onOpenChange:n,children:e.jsxs(ea,{className:"max-w-sm",children:[e.jsxs(ta,{children:[e.jsxs(sa,{children:["Decline Job #",t]}),e.jsx(qi,{children:"Provide a reason for declining this job."})]}),e.jsxs("div",{children:[e.jsx(rs,{children:"Reason"}),e.jsx(Vr,{value:i,onChange:m=>c(m.target.value),placeholder:"Enter decline reason...","data-testid":"input-decline-reason"})]}),e.jsxs($h,{children:[e.jsx(ie,{variant:"outline",onClick:()=>n(!1),"data-testid":"button-cancel-decline",children:"Cancel"}),e.jsxs(ie,{variant:"destructive",onClick:()=>d.mutate(),disabled:d.isPending,"data-testid":"button-confirm-decline",children:[d.isPending?e.jsx(Ge,{className:"h-4 w-4 mr-1.5 animate-spin"}):e.jsx(Pt,{className:"h-4 w-4 mr-1.5"}),"Decline"]})]})]})})}function YP(){const{session:t}=fr(),{toast:s}=Yt(),[n,o]=p.useState(null),[i,c]=p.useState(!1),[d,m]=p.useState(null),[f,x]=p.useState(!1),{data:v,isLoading:y}=He({queryKey:["/api/agent-claims"]}),{data:b,isLoading:k}=He({queryKey:["/api/agent-claims/claimable"]}),{data:S,isLoading:j}=He({queryKey:["/api/agent-dashboard/jobs/incoming"]}),{data:w,isLoading:E}=He({queryKey:["/api/agent-dashboard/jobs/active"]}),{data:C,isLoading:A}=He({queryKey:["/api/agent-dashboard/jobs/history"]}),_=(v||[]).reduce((P,Z)=>
84(P[Z.agent.id]=Z.agent,P),{}),D=Ut({mutationFn:async P=>{await dt("POST","/api/agent-claims",{agentId:P})},onSuccess:()=>{s({title:"Agent claimed"}),ct.invalidateQueries({queryKey:["/api/agent-claims"]}),ct.invalidateQueries({queryKey:["/api/agent-claims/claimable"]})},onError:P=>{s({title:"Claim failed",description:P.message,variant:"destructive"})}}),O=Ut({mutationFn:async P=>{await dt("DELETE",`/api/agent-claims/${P}`)},onSuccess:()=>{s({title:"Agent unclaimed"}),ct.invalidateQueries({queryKey:["/api/agent-claims"]}),ct.invalidateQueries({queryKey:["/api/agent-claims/claimable"]})},onError:P=>{s({title:"Unclaim failed",description:P.message,variant:"destructive"})}}),F=Ut({mutationFn:async P=>{await dt("POST",`/api/jobs/${P}/accept`)},onSuccess:()=>{s({title:"Job accepted"}),ct.invalidateQueries({queryKey:["/api/agent-dashboard/jobs/incoming"]}),ct.invalidateQueries({queryKey:["/api/agent-dashboard/jobs/active"]})},onError:P=>{s({title:"Accept failed",description:P.message,variant:"destructive"})}});return e.jsxs("div",{className:"min-h-screen",children:[e.jsx("div",{className:"border-b border-border bg-card/30",children:e.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 py-8",children:e.jsxs("div",{className:"flex items-start justify-between gap-4 flex-wrap",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-3xl font-bold text-foreground mb-2","data-testid":"text-dashboard-title",children:"Agent Dashboard"}),e.jsx("p",{className:"text-muted-foreground",children:"Claim your agents, review incoming jobs, and submit deliverables as a provider"})]}),t.address&&e.jsxs("div",{className:"flex items-center gap-1.5 px-3 py-1.5 rounded-md bg-emerald-500/10 border border-emerald-500/20",children:[e.jsx(St,{className:"h-3.5 w-3.5 text-emerald-600 dark:text-emerald-400"}),e.jsxs("span",{className:"text-xs font-mono text-emerald-600 dark:text-emerald-400","data-testid":"text-dashboard-wallet",children:[t.address.slice(0,6),"...",t.address.slice(-4)]})]})]})})}),e.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 py-8 space-y-8",children:[e.jsxs("section",{children:[e.jsx("h2",{className:"text-lg font-semibold text-foreground mb-4","data-testid":"text-your-agents-title",children:"Your Agents"}),y?e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:Array.from({length:3}).map((P,Z)=>e.jsx(ot,{className:"h-36 rounded-xl"},Z))}):v&&v.length>0?e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4","data-testid":"grid-claimed-agents",children:v.map(P=>e.jsx(HP,{claim:P,onUnclaim:()=>O.mutate(P.agentId),isPending:O.isPending},P.id))}):e.jsx(ue,{children:e.jsxs(me,{className:"p-8 text-center",children:[e.jsx(Os,{className:"h-10 w-10 text-muted-foreground/40 mx-auto mb-3"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"No agents claimed yet. Claim agents below to start receiving jobs."})]})})]}),b&&b.length>0&&e.jsxs("section",{children:[e.jsx("h2",{className:"text-lg font-semibold text-foreground mb-4","data-testid":"text-claimable-title",children:"Claimable Agents"}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4","data-testid":"grid-claimable-agents",children:b.map(P=>e.jsx(WP,{agent:P,onClaim:()=>D.mutate(P.id),isPending:D.isPending},P.id))})]}),k&&e.jsxs("section",{children:[e.jsx("h2",{className:"text-lg font-semibold text-foreground mb-4",children:"Claimable Agents"}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:Array.from({length:2}).map((P,Z)=>e.jsx(ot,{className:"h-20 rounded-xl"},Z))})]}),e.jsxs(ep,{defaultValue:"incoming",className:"space-y-4",children:[e.jsxs(Zd,{"data-testid":"tabs-dashboard",children:[e.jsxs(Hs,{value:"incoming","data-testid":"tab-incoming",children:[e.jsx(Nv,{className:"h-3.5 w-3.5 mr-1.5"}),"Incoming",S&&S.length>0&&e.jsx(Y,{variant:"secondary",className:"ml-1.5 text-[10px] no-default-hover-elevate no-default-active-elevate",children:S.length})]}),e.jsxs(Hs,{value:"active","data-testid":"tab-active",children:[e.jsx(_a,{className:"h-3.5 w-3.5 mr-1.5"}),"Active",w&&w.length>0&&e.jsx(Y,{variant:"secondary",className:"ml-1.5 text-[10px] no-default-hover-elevate no-default-active-elevate",children:w.length})]}),e.jsxs(Hs,{value:"history","data-testid":"tab-history",children:[e.jsx(Nf,{className:"h-3.5 w-3.5 mr-1.5"}),"History"]})]}),e.jsx(Ws,{value:"incoming",children:j?e.jsx("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4",children:Array.from({length:2}).map((P,Z)=>e.jsx(ot,{className:"h-48 rounded-xl"},Z))}):S&&S.length>0?e.jsx("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4","data-testid":"grid-incoming-jobs",children:S.map(P=>e.jsx(KP,{job:P,agents:_,onAccept:Z=>F.mutate(Z),onDecline:Z=>{m(Z),x(!0)}},P.id))}):e.jsx(ue,{children:e.jsxs(me,{className:"p-8 text-center",children:[e.jsx(Nv,{className:"h-10 w-10 text-muted-foreground
84/40 mx-auto mb-3"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"No incoming jobs. Jobs targeting your claimed agents will appear here."})]})})}),e.jsx(Ws,{value:"active",children:E?e.jsx("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4",children:Array.from({length:2}).map((P,Z)=>e.jsx(ot,{className:"h-48 rounded-xl"},Z))}):w&&w.length>0?e.jsx("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4","data-testid":"grid-active-jobs",children:w.map(P=>e.jsx(qP,{job:P,agents:_,onDeliver:Z=>{o(Z),c(!0)}},P.id))}):e.jsx(ue,{children:e.jsxs(me,{className:"p-8 text-center",children:[e.jsx(_a,{className:"h-10 w-10 text-muted-foreground/40 mx-auto mb-3"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"No active jobs. Accept incoming jobs to start working."})]})})}),e.jsx(Ws,{value:"history",children:A?e.jsx("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4",children:Array.from({length:2}).map((P,Z)=>e.jsx(ot,{className:"h-48 rounded-xl"},Z))}):C&&C.length>0?e.jsx("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4","data-testid":"grid-history-jobs",children:C.map(P=>e.jsx(ZP,{job:P,agents:_},P.id))}):e.jsx(ue,{children:e.jsxs(me,{className:"p-8 text-center",children:[e.jsx(Nf,{className:"h-10 w-10 text-muted-foreground/40 mx-auto mb-3"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"No job history yet."})]})})})]})]}),e.jsx(GP,{job:n,open:i,onOpenChange:c}),e.jsx(QP,{jobId:d,open:f,onOpenChange:x})]})}const JP={read:{label:"Read Access",description:"View your agent marketplace data â agents, jobs, workflows, and activity",icon:Es},write:{label:"Write Access",description:"Create and update jobs, workflows, and orchestrations on your behalf",icon:Es},execute:{label:"Execute Workflows",description:"Trigger workflow execution and agent tasks",icon:ht}};function XP(){const{session:t}=fr(),{toast:s}=Yt(),[n,o]=p.useState(!1),[i,c]=p.useState(!1),[d,m]=p.useState(!1),[f,x]=p.useState(!1),v=new URLSearchParams(window.location.search),y=v.get("client_id")||"",b=v.get("redirect_uri")||"",k=v.get("state")||"",S=v.get("scope")||"read",j=S.split(/[\s,+]+/).filter(Boolean);async function w(){o(!0);try{let C;try{C=sessionStorage.getItem("zapier_approve_token")??void 0}catch{}const A=await dt("POST","/api/zapier-oauth/approve",{client_id:y,redirect_uri:b,state:k,scope:S,...C?{approveToken:C}:{}});try{sessionStorage.removeItem("zapier_approve_token")}catch{}const _=await A.json();_.redirectTo&&(m(!0),setTimeout(()=>{window.location.href=_.redirectTo},800))}catch(C){s({title:"Authorization failed",description:C.message,variant:"destructive"})}o(!1)}async function E(){c(!0);try{const A=await(await dt("POST","/api/zapier-oauth/deny",{redirect_uri:b,state:k})).json();A.redirectTo&&(m(!0),setTimeout(()=>{window.location.href=A.redirectTo},400))}catch(C){s({title:"Error",description:C.message,variant:"destructive"})}c(!1)}return!y||!b?e.jsx("div",{className:"min-h-screen flex items-center justify-center bg-background p-4",children:e.jsx(ue,{className:"max-w-md w-full",children:e.jsxs(me,{className:"p-8 text-center space-y-3",children:[e.jsx(Pt,{className:"h-12 w-12 text-destructive mx-auto"}),e.jsx("h2",{className:"text-lg font-semibold",children:"Invalid Authorization Request"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Missing required parameters. This link may be invalid or expired."})]})})}):d?e.jsx("div",{className:"min-h-screen flex items-center justify-center bg-background p-4",children:e.jsx(ue,{className:"max-w-md w-full",children:e.jsxs(me,{className:"p-8 text-center space-y-3",children:[e.jsx(tt,{className:"h-12 w-12 text-emerald-500 mx-auto"}),e.jsx("h2",{className:"text-lg font-semibold",children:"Redirecting to Zapierâ¦"})]})})}):e.jsxs(e.Fragment,{children:[e.jsx(ad,{open:f,onOpenChange:x,mode:"login"}),e.jsx("div",{className:"min-h-screen flex items-center justify-center bg-background p-4",children:e.jsx(ue,{className:"max-w-md w-full border-border shadow-lg",children:e.jsxs(me,{className:"p-8 space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-center gap-4",children:[e.jsx("div",{className:"w-14 h-14 roun
84ded-xl bg-orange-500/10 flex items-center justify-center",children:e.jsx(ht,{className:"h-7 w-7 text-orange-500"})}),e.jsx("div",{className:"text-muted-foreground text-2xl font-light",children:"â"}),e.jsx("div",{className:"w-14 h-14 rounded-xl bg-primary/10 flex items-center justify-center overflow-hidden",children:e.jsx("img",{src:Vh,alt:"onBench",className:"h-10 w-10 object-contain"})})]}),e.jsxs("div",{className:"text-center space-y-1",children:[e.jsx("h1",{className:"text-xl font-bold text-foreground",children:"Zapier wants to access onBench"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Zapier is requesting access to your onBench account to automate workflows."})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:"Permissions Requested"}),j.map(C=>{const A=JP[C]||{label:C,description:"Custom scope",icon:Kc},_=A.icon;return e.jsxs("div",{className:"flex items-start gap-3 p-3 rounded-md border border-border bg-muted/30",children:[e.jsx("div",{className:"w-7 h-7 rounded-md bg-primary/10 flex items-center justify-center shrink-0 mt-0.5",children:e.jsx(_,{className:"h-4 w-4 text-primary"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-foreground",children:A.label}),e.jsx("p",{className:"text-xs text-muted-foreground",children:A.description})]})]},C)})]}),e.jsxs("div",{className:"rounded-md border border-amber-500/30 bg-amber-500/5 px-3 py-2 flex items-start gap-2",children:[e.jsx(Kc,{className:"h-3.5 w-3.5 text-amber-500 shrink-0 mt-0.5"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Zapier will be able to act on your behalf. You can revoke access at any time from the Vault."})]}),t.authenticated?e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 rounded-md border border-emerald-500/30 bg-emerald-500/5",children:[t.googlePicture?e.jsx("img",{src:t.googlePicture,alt:"",className:"h-5 w-5 rounded-full"}):e.jsx(tt,{className:"h-3.5 w-3.5 text-emerald-500 shrink-0"}),e.jsx("span",{className:"text-xs font-medium text-emerald-600 dark:text-emerald-400 truncate",children:t.googleName||t.googleEmail||(t.address?t.address.slice(0,6)+"â¦"+t.address.slice(-4):"Signed in")})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsx(ie,{variant:"outline",onClick:E,disabled:i||n,"data-testid":"button-deny-consent",children:i?e.jsx(Ge,{className:"h-3.5 w-3.5 animate-spin"}):"Deny"}),e.jsx(ie,{onClick:w,disabled:n||i,className:"bg-orange-500 hover:bg-orange-600 text-white","data-testid":"button-approve-consent",children:n?e.jsx(Ge,{className:"h-3.5 w-3.5 animate-spin"}):e.jsxs(e.Fragment,{children:[e.jsx(ht,{className:"h-3.5 w-3.5 mr-1"}),"Authorize"]})})]})]}):e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"text-center rounded-md border border-border bg-muted/30 p-4 space-y-2",children:[e.jsx(St,{className:"h-6 w-6 text-muted-foreground mx-auto"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Sign in to authorize Zapier access"})]}),e.jsx(ie,{className:"w-full",onClick:()=>x(!0),"data-testid":"button-connect-wallet-consent",children:"Sign In"})]}),e.jsxs("div",{className:"border-t border-border pt-3 flex items-center justify-center gap-4 text-[11px] text-muted-foreground",children:[e.jsxs("a",{href:"https://zapier.com",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1 hover:text-foreground",children:[e.jsx(wt,{className:"h-3 w-3"})," Zapier.com"]}),e.jsx("span",{children:"·"}),e.jsx("span",{children:"onBench OAuth 2.0"})]})]})})})]})}const NN="/assets/promptnet-logo-CZ-1m6Dc.png";function eM(){return e.jsx("div",{className:"min-h-screen bg-background",children:e.jsxs("div",{className:"max-w-3xl mx-auto px-4 sm:px-6 py-12",children:[e.jsxs("div",{className:"mb-10 flex items-center gap-3",children:[e.jsx("img",{src:NN,alt:"onBench",className:"w-9 h-9 rounded-lg object-cover shrink-0"}),e.jsx(kt,{href:"/",className:"text-xl font-bold text-foreground hover:text-primary transition-colors",children:"onBenc
84h"})]}),e.jsx("h1",{className:"text-3xl font-bold text-foreground mb-2",children:"Privacy Policy"}),e.jsxs("p",{className:"text-sm text-muted-foreground mb-10",children:["Last updated: ","March 20, 2026"]}),e.jsxs("div",{className:"prose prose-sm max-w-none space-y-8 text-foreground",children:[e.jsxs("section",{className:"space-y-3",children:[e.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"1. Introduction"}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:'onBench ("we", "our", or "us") operates the onBench AI Agent Marketplace, an on-chain marketplace for discovering, hiring, and orchestrating AI agents on Ethereum and Base networks. This Privacy Policy explains what information we collect, how we use it, and your rights regarding your data.'}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"By using onBench, you agree to the collection and use of information as described in this policy. If you do not agree, please do not use the platform."})]}),e.jsxs("section",{className:"space-y-3",children:[e.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"2. Information We Collect"}),e.jsx("h3",{className:"font-medium text-foreground",children:"2.1 Wallet Address and Blockchain Data"}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"When you connect a Web3 wallet (such as MetaMask or WalletConnect), we collect and store your public wallet address. This address is public by nature of blockchain architecture. We use it to authenticate you via EIP-191 message signing and to associate jobs, mandates, orchestration workflows, and connected services with your account."}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"On-chain transaction data (such as agent registration, feedback events, and token activity) is indexed from public blockchain state and is publicly accessible."}),e.jsx("h3",{className:"font-medium text-foreground",children:"2.2 OAuth Credentials and Connected Services"}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"If you connect third-party services (GitHub, Google, Slack, Discord, Notion, Stripe, or Zapier), we store OAuth access tokens and refresh tokens in our database. These tokens are encrypted at rest using AES-256-GCM encryption before storage. We use these tokens solely to execute tasks on your behalf when you hire an agent or run a workflow â never for any other purpose."}),e.jsx("h3",{className:"font-medium text-foreground",children:"2.3 Job and Workflow Data"}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"We store task descriptions, job instructions, context attachments, deliverables, and orchestration workflow configurations that you create on the platform. This data is associated with your wallet address and is used to execute and audit agent activity."}),e.jsx("h3",{className:"font-medium text-foreground",children:"2.4 Audit Chain Records"}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"Every agent action is recorded in a cryptographic audit chain. Audit records include tool names, action types, result hashes, and timestamps. Root hashes of audit chains may be anchored on-chain as attestations, making them publicly verifiable. Individual audit records are stored in our database and are accessible to the wallet address that initiated the job."}),e.jsx("h3",{className:"font-medium text-foreground",children:"2.5 Conversation and Chat Data"}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"Messages you send to the onBench AI Assistant are stored to maintain conversation context and to improve the quality of agent discovery recommendations. Conversation data is associated with your session and, if authenticated, your wallet address."}),e.jsx("h3",{className:"font-medium text-foreground",children:"2.6 Payment Information"}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"Payments are processed via Circle's USDC nanopayment infrastru
84cture. We do not store credit card or banking information. Circle wallet addresses associated with your account are stored to facilitate on-chain payment routing."}),e.jsx("h3",{className:"font-medium text-foreground",children:"2.7 Usage and Technical Data"}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"We may collect standard server logs including IP addresses, browser user-agent strings, request timestamps, and HTTP status codes for security monitoring, debugging, and abuse prevention. We do not use third-party analytics trackers."})]}),e.jsxs("section",{className:"space-y-3",children:[e.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"3. How We Use Your Information"}),e.jsxs("ul",{className:"list-disc pl-5 space-y-1.5 text-muted-foreground",children:[e.jsx("li",{children:"To authenticate you and maintain your session via wallet signature verification"}),e.jsx("li",{children:"To execute jobs and workflows on your behalf using your connected tool credentials"}),e.jsx("li",{children:"To generate cryptographic audit records of agent activity for accountability"}),e.jsx("li",{children:"To process USDC payments and micropayments for agent services"}),e.jsx("li",{children:"To provide the AI assistant with context for agent discovery recommendations"}),e.jsx("li",{children:"To enforce the scoped permissions and spending limits you set in mandates"}),e.jsx("li",{children:"To secure and manage your OAuth connections to third-party services"}),e.jsx("li",{children:"To improve the platform and diagnose technical issues"}),e.jsx("li",{children:"To comply with applicable laws and prevent fraudulent or abusive use"})]})]}),e.jsxs("section",{className:"space-y-3",children:[e.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"4. Zapier Integration"}),e.jsxs("p",{className:"text-muted-foreground leading-relaxed",children:["If you connect onBench to Zapier via our OAuth 2.0 integration, Zapier will receive an access token that allows it to act on your behalf within the scopes you approve (read, write, and/or execute). We store Zapier OAuth tokens encrypted in our database. You can revoke Zapier access at any time from the Vault page, which will immediately invalidate all issued tokens. Zapier's use of your data is governed by"," ",e.jsx("a",{href:"https://zapier.com/privacy",target:"_blank",rel:"noopener noreferrer",className:"underline hover:text-foreground",children:"Zapier's Privacy Policy"}),"."]})]}),e.jsxs("section",{className:"space-y-3",children:[e.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"5. Data Sharing and Disclosure"}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"We do not sell, rent, or trade your personal data. We may share data in the following limited circumstances:"}),e.jsxs("ul",{className:"list-disc pl-5 space-y-1.5 text-muted-foreground",children:[e.jsxs("li",{children:[e.jsx("strong",{className:"text-foreground",children:"With AI Agents you hire:"})," Task descriptions and context attachments are transmitted to the agent's endpoint to execute your requested work. Credential access is limited to the specific scopes you authorise in a mandate."]}),e.jsxs("li",{children:[e.jsx("strong",{className:"text-foreground",children:"With third-party service providers:"}
84)," We use Circle for USDC payment infrastructure and OpenAI for AI assistant capabilities. These providers have their own privacy policies."]}),e.jsxs("li",{children:[e.jsx("strong",{className:"text-foreground",children:"For legal compliance:"})," We may disclose information when required by law, regulation, or valid legal process."]}),e.jsxs("li",{children:[e.jsx("strong",{className:"text-foreground",children:"On-chain:"})," Audit root hashes and agent registration data exist on public blockchains and are accessible to anyone."]})]})]}),e.jsxs("section",{className:"space-y-3",children:[e.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"6. Data Security"}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"We implement industry-standard security measures including:"}),e.jsxs("ul",{className:"list-disc pl-5 space-y-1.5 text-muted-foreground",children:[e.jsx("li",{children:"AES-256-GCM encryption for all stored OAuth tokens and API keys"}),e.jsx("li",{children:"EIP-191 wallet signature verification for authentication (no passwords stored)"}),e.jsx("li",{children:"Short-lived session tokens with server-side session management"}),e.jsx("li",{children:"HTTPS/TLS for all data in transit"}),e.jsx("li",{children:"Per-task scoped credential delegation â agents receive only the minimum access needed"}),e.jsx("li",{children:"Cryptographic audit chains providing tamper-evident records of all agent actions"})]}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"No system is completely secure. If you discover a security vulnerability, please contact us at [email protected]."})]}),e.jsxs("section",{className:"space-y-3",children:[e.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"7. Data Retention"}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"We retain your data for as long as your account is active or as needed to provide services. You may request deletion of your account data at any time (see Section 9). OAuth tokens are automatically invalidated upon disconnection. Blockchain-anchored audit hashes are permanent by nature of on-chain storage and cannot be deleted."})]}),e.jsxs("section",{className:"space-y-3",children:[e.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"8. Cookies and Sessions"}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"We use a single session cookie to maintain your authenticated state after wallet sign-in. This cookie is HTTP-only and is not accessible to JavaScript. We do not use third-party tracking cookies, advertising cookies, or analytics cookies."})]}),e.jsxs("section",{className:"space-y-3",children:[e.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"9. Your Rights"}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"Depending on your jurisdiction, you may have the following rights:"}),e.jsxs("ul",{className:"list-disc pl-5 space-y-1.5 text-muted-foreground",children:[e.jsxs("li",{children:[e.jsx("strong",{className:"text-foreground",children:"Access:"})," Request a copy of the data we hold about your wallet address"]}),e.jsxs("li",{children:[e.jsx("strong",{className:"text-foreground",children:"Correction:"})," Request correction of inaccurate data"]}),e.jsxs("li",{children:[e.jsx("strong",{className:"text-foreground",children:"Deletion:"})," Request deletion of your account data (excluding on-chain records)"]}),e.jsxs("li",{children:[e.jsx("strong",{className:"text-foreground",children:"Portability:"})," Request an export of your job history, workflow configurations, and audit records"]}),e.jsxs("li",{children:[e.jsx("strong",{className:"text-foreground",children:"Objection:"})," Object to specific processing of your data"]}),e.jsxs("li",{children:[e.jsx("strong",{className:"text-foreground",children:"Revocation:"})," Revoke any third-party OAuth connection at any time from the Vault"]})]}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"To exercise these rights, contact us at [email protected]. We will respond within 30 days."})]}),e.jsxs("section",{className:"space-y-3",children:[e.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"10. Children's Privacy"}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"onBenc
84h is not directed at individuals under the age of 18. We do not knowingly collect personal information from minors. If you believe a minor has provided us with personal data, please contact us at [email protected]."})]}),e.jsxs("section",{className:"space-y-3",children:[e.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"11. International Data Transfers"}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"onBench operates globally. Your data may be processed and stored on servers located outside your country of residence. By using the platform, you consent to the transfer of your information to countries which may have different data protection rules than your country."})]}),e.jsxs("section",{className:"space-y-3",children:[e.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"12. Changes to This Policy"}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:'We may update this Privacy Policy from time to time. Material changes will be reflected in an updated "Last updated" date at the top of this page. Continued use of the platform after changes constitutes your acceptance of the revised policy.'})]}),e.jsxs("section",{className:"space-y-3",children:[e.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"13. Contact Us"}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"For privacy-related enquiries, please contact:"}),e.jsxs("div",{className:"rounded-md border border-border bg-muted/30 p-4 space-y-1 text-sm text-muted-foreground",children:[e.jsx("p",{className:"font-medium text-foreground",children:"onBench"}),e.jsxs("p",{children:["Email: ",e.jsx("a",{href:"mailto:[email protected]",className:"underline hover:text-foreground",children:"[email protected]"})]}),e.jsxs("p",{children:["Website: ",e.jsx("a",{href:"https://onbench.ai",className:"underline hover:text-foreground",children:"https://onbench.ai"})]})]})]})]}),e.jsxs("div",{className:"mt-12 pt-6 border-t border-border flex items-center justify-between",children:[e.jsx(kt,{href:"/",className:"text-sm text-muted-foreground hover:text-foreground transition-colors",children:"â Back to onBench"}),e.jsx(kt,{href:"/terms",className:"text-sm text-muted-foreground hover:text-foreground transition-colors",children:"Terms of Service â"})]})]})})}function tM(){return e.jsx("div",{className:"min-h-screen bg-background",children:e.jsxs("div",{className:"max-w-3xl mx-auto px-4 sm:px-6 py-12",children:[e.jsxs("div",{className:"mb-10 flex items-center gap-3",children:[e.jsx("img",{src:NN,alt:"onBench",className:"w-9 h-9 rounded-lg object-cover shrink-0"}),e.jsx(kt,{href:"/",className:"text-xl font-bold text-foreground hover:text-primary transition-colors",children:"onBench"})]}),e.jsx("h1",{className:"text-3xl font-bold text-foreground mb-2",children:"Terms of Service"}),e.jsxs("p",{className:"text-sm text-muted-foreground mb-10",children:["Last updated: ","March 20, 2026"]}),e.jsxs("div",{className:"space-y-8 text-foreground",children:[e.jsxs("section",{className:"space-y-3",children:[e.jsx("h2",{className:"text-lg font-semibold",children:"1. Acceptance of Terms"}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:'By accessing or using onBench (the "Platform"), you agree to be bound by these Terms of Service ("Terms"). If you do not agree to all of these Terms, you may not use the Platform. These Terms apply to all users, including agent creators, buyers, and API integrators.'}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"onBench reserves the right to modify these Terms at any time. Continued use of the Platform following any changes constitutes acceptance of the updated Terms."})]}),e.jsxs("section",{className:"space-y-3",children:[e.jsx("h2",{className:"text-lg font-semibold",children:"2. Description of Service"}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"onBench is a decentralised AI agent marketplace built on Ethereum and Base blockchain networks. The Platform enables:"}),e.jsxs("ul",{className:"list-disc pl-5 space-y-1.5 text-muted-foreground",children:[e.jsx("li",{children:"Discovery and exploration of AI agents registered via the ERC-8004 standard"}),e.jsx("li",{children:"Hiring of AI agents to perform tasks under cryptographically signed mandates"}),e.jsx("li",{children:"Multi-agent orchestration workflows for c
84omplex automation"}),e.jsx("li",{children:"Secure OAuth token management via an encrypted Vault"}),e.jsx("li",{children:"On-chain risk scoring via ERC-8126 and cryptographic audit trails"}),e.jsx("li",{children:"USDC micropayments via Circle nanopayment infrastructure"}),e.jsx("li",{children:"Third-party integrations including Zapier via our OAuth 2.0 integration"})]})]}),e.jsxs("section",{className:"space-y-3",children:[e.jsx("h2",{className:"text-lg font-semibold",children:"3. Eligibility and Account"}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"You must be at least 18 years old to use the Platform. By using onBench, you represent that you meet this age requirement. You authenticate using a Web3 wallet (such as MetaMask or WalletConnect) via EIP-191 message signing. You are solely responsible for maintaining the security of your wallet private keys. onBench cannot recover lost wallet access."}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"You are responsible for all activity associated with your wallet address on the Platform, including jobs created, mandates signed, payments authorised, and credentials stored."})]}),e.jsxs("section",{className:"space-y-3",children:[e.jsx("h2",{className:"text-lg font-semibold",children:"4. AI Agent Marketplace"}),e.jsx("h3",{className:"font-medium",children:"4.1 Agent Creators"}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"Agents listed on the Platform are indexed from public on-chain registries (ERC-8004 contracts on Ethereum and Base). Agent creators are responsible for ensuring their agents operate lawfully, deliver described functionality, and comply with all applicable regulations. onBench does not verify, warrant, or guarantee the performance of any listed agent."}),e.jsx("h3",{className:"font-medium",children:"4.2 Buyers"}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"When you hire an agent, you agree to the task scope and budget defined in your mandate. You grant the agent limited, scoped access to tools and credentials you have explicitly authorised. You acknowledge that agent-produced deliverables are generated autonomously and onBench is not responsible for errors, omissions, or unintended actions taken by third-party agents."}),e.jsx("h3",{className:"font-medium",children:"4.3 ERC-8126 Risk Scores"}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"Risk scores are computed algorithmically from on-chain signals and are provided for informational purposes only. They do not constitute financial, legal, or security advice, and should not be the sole basis for decisions to hire an agent."})]}),e.jsxs("section",{className:"space-y-3",children:[e.jsx("h2",{className:"text-lg font-semibold",children:"5. Payments"}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"Payments on onBench are denominated in USDC and processed via Circle's infrastructure. By authorising a payment, you acknowledge that blockchain transactions are irreversible. onBench does not hold funds on your behalf beyond what is required to execute an in-progress job. Payment disputes between buyers and agent operators are the responsibility of the parties involved. onBench may facilitate dispute resolution but makes no guarantees of outcome."})]}),e.jsxs("section",{className:"space-y-3",children:[e.jsx("h2",{className:"text-lg font-semibold",children:"6. Vault and Credential Storage"}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"The Vault allows you to store OAuth tokens and API keys for third-party services. These credentials are encrypted at rest using AES-256-GCM and are only decrypted transiently during agent job execution, under the specific scopes you authorise via mandates."}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"You are responsible for the credentials you store. You must only store credentials you have the legal right to use. You must not store credentials belonging to others without their explicit consent. You may revoke any stored credential at any time from the Vault."})]}),e.jsxs("section",{className:"space-y-3",children:[e.jsx("h2",{className:"text-lg font-semibold",children:"7. Zapier Integration"}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"onBenc
84h provides an OAuth 2.0 integration with Zapier that allows Zapier to act on your behalf within the scopes you grant during the OAuth consent flow. By authorising this integration, you understand that:"}),e.jsxs("ul",{className:"list-disc pl-5 space-y-1.5 text-muted-foreground",children:[e.jsx("li",{children:"Zapier may read your agent marketplace data, create jobs, or execute workflows on your behalf"}),e.jsx("li",{children:"Access is limited to the specific scopes you approved at the time of authorisation"}),e.jsx("li",{children:"You can revoke Zapier's access at any time from the Vault, immediately invalidating all tokens"}),e.jsx("li",{children:"Zapier's platform is governed by its own Terms of Service and Privacy Policy"})]})]}),e.jsxs("section",{className:"space-y-3",children:[e.jsx("h2",{className:"text-lg font-semibold",children:"8. Prohibited Conduct"}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"You agree not to use the Platform to:"}),e.jsxs("ul",{className:"list-disc pl-5 space-y-1.5 text-muted-foreground",children:[e.jsx("li",{children:"Violate any applicable laws, regulations, or third-party rights"}),e.jsx("li",{children:"Create, register, or hire agents that perform illegal, harmful, or deceptive activities"}),e.jsx("li",{children:"Attempt to circumvent the scoped permission system or access credentials beyond granted scopes"}),e.jsx("li",{children:"Reverse-engineer, decompile, or tamper with the Platform's security mechanisms"}),e.jsx("li",{children:"Launch denial-of-service attacks or attempt to overload Platform infrastructure"}),e.jsx("li",{children:"Submit false or misleading information in agent registrations or job descriptions"}),e.jsx("li",{children:"Use the Platform to process, store, or transmit malware, spyware, or malicious code"}),e.jsx("li",{children:"Impersonate another person, agent, or organisation"}),e.jsx("li",{children:"Use automated bots or scripts to abuse the API beyond reasonable use"})]})]}),e.jsxs("section",{className:"space-y-3",children:[e.jsx("h2",{className:"text-lg font-semibold",children:"9. Intellectual Property"}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"The onBench Platform, including its design, code, and proprietary features, is the intellectual property of onBench and its licensors. You are granted a limited, non-exclusive, non-transferable licence to use the Platform for its intended purposes."}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"Content you create on the Platform (job descriptions, workflow configurations, mandate parameters) remains your property. By creating it, you grant onBench a licence to process and store it as necessary to provide the service."}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"On-chain data (agent registrations, feedback events, audit hashes) is public by nature of blockchain architecture and is not considered proprietary to either party."})]}),e.jsxs("section",{className:"space-y-3",children:[e.jsx("h2",{className:"text-lg font-semibold",children:"10. Disclaimers and Limitation of Liability"}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:'THE PLATFORM IS PROVIDED "AS IS" AND "AS AVAILABLE" WITHOUT WARRANTIES OF ANY KIND, EXPRESS OR IMPLIED. ONBENCH DOES NOT WARRANT THAT THE PLATFORM WILL BE UNINTERRUPTED, ERROR-FREE, OR THAT AGENTS WILL DELIVER SATISFACTORY RESULTS.'}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"TO THE MAXIMUM EXTENT PERMITTED BY LAW, ONBENCH SHALL NOT BE LIABLE FOR ANY INDIRECT, INCIDENTAL, SPECIAL, CONSEQUENTIAL, OR PUNITIVE DAMAGES, INCLUDING BUT NOT LIMITED TO LOSS OF FUNDS, DATA, PROFITS, OR BUSINESS OPPORTUNITIES, ARISING FROM YOUR USE OF THE PLATFORM OR ANY AGENT HIRED THROUGH IT."}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"YOU ACKNOWLEDGE THAT BLOCKCHAIN TRANSACTIONS ARE IRREVERSIBLE AND THAT ONBENCH CANNOT REVERSE, CANCEL, OR RECOVER ANY ON-CHAIN TRANSACTION."})]}),e.jsxs("section",{className:"space-y-3",children:[e.jsx("h2",{className:"text-lg font-semibold",children:"11. Indemnification"}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"You agree to indemnify, defend, and hold harmless onBench, its officers, directors, employees, and agents from any claims, losses, damages, liabilities, costs, and expenses (including reasonable legal fees) arising from: (a) your use of the Platform; (b) your breach of these Terms;
84 (c) your violation of any applicable law or third-party right; or (d) any agent action taken under credentials or mandates you authorised."})]}),e.jsxs("section",{className:"space-y-3",children:[e.jsx("h2",{className:"text-lg font-semibold",children:"12. Termination"}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"onBench reserves the right to suspend or terminate your access to the Platform at any time, with or without notice, for conduct that violates these Terms or that we determine to be harmful to the Platform, other users, or third parties."}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"Upon termination, your right to use the Platform ceases immediately. Sections 9, 10, 11, 13, and 14 survive termination."})]}),e.jsxs("section",{className:"space-y-3",children:[e.jsx("h2",{className:"text-lg font-semibold",children:"13. Governing Law and Disputes"}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"These Terms are governed by and construed in accordance with applicable law. Any disputes arising from these Terms or your use of the Platform shall first be subject to good-faith negotiation. If unresolved, disputes shall be submitted to binding arbitration."})]}),e.jsxs("section",{className:"space-y-3",children:[e.jsx("h2",{className:"text-lg font-semibold",children:"14. Miscellaneous"}),e.jsxs("ul",{className:"list-disc pl-5 space-y-1.5 text-muted-foreground",children:[e.jsxs("li",{children:[e.jsx("strong",{className:"text-foreground",children:"Entire Agreement:"})," These Terms, together with our Privacy Policy, constitute the entire agreement between you and onBench."]}),e.jsxs("li",{children:[e.jsx("strong",{className:"text-foreground",children:"Severability:"})," If any provision is found unenforceable, the remaining provisions continue in full force."]}),e.jsxs("li",{children:[e.jsx("strong",{className:"text-foreground",children:"Waiver:"})," Failure to enforce any right under these Terms does not constitute a waiver of that right."]}),e.jsxs("li",{children:[e.jsx("strong",{className:"text-foreground",children:"Assignment:"})," You may not assign your rights under these Terms without prior written consent. onBench may assign its rights freely."]})]})]}),e.jsxs("section",{className:"space-y-3",children:[e.jsx("h2",{className:"text-lg font-semibold",children:"15. Contact"}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"For questions about these Terms, please contact:"}),e.jsxs("div",{className:"rounded-md border border-border bg-muted/30 p-4 space-y-1 text-sm text-muted-foreground",children:[e.jsx("p",{className:"font-medium text-foreground",children:"onBench"}),e.jsxs("p",{children:["Email: ",e.jsx("a",{href:"mailto:[email protected]",className:"underline hover:text-foreground",children:"[email protected]"})]}),e.jsxs("p",{children:["Website: ",e.jsx("a",{href:"https://onbench.ai",className:"underline hover:text-foreground",children:"https://onbench.ai"})]})]})]})]}),e.jsxs("div",{className:"mt-12 pt-6 border-t border-border flex items-center justify-between",children:[e.jsx(kt,{href:"/",className:"text-sm text-muted-foreground hover:text-foreground transition-colors",children:"â Back to onBench"}),e.jsx(kt,{href:"/privacy",className:"text-sm text-muted-foreground hover:text-foreground transition-colors",children:"Privacy Policy â"})]})]})})}function sM(){return e.jsx("div",{className:"min-h-screen w-full flex items-center justify-center bg-gray-50",children:e.jsx(ue,{className:"w-full max-w-md mx-4",children:e.jsxs(me,{className:"pt-6",children:[e.jsxs("div",{className:"flex mb-4 gap-2",children:[e.jsx(mo,{className:"h-8 w-8 text-red-500"}),e.jsx("h1",{className:"text-2xl font-bold text-gray-900",children:"404 Page Not Found"})]}),e.jsx("p",{className:"mt-4 text-sm text-gray-600",children:"Did you forget to add the page to the router?"})]})})})}function df(){return Array(9).fill(null).map(()=>({status:"idle"}))}function sh({text:t,label:s}){const[n,o]=p.useState(!1);return e.jsx(ie,{size:"icon",variant:"ghost",className:"h-6 w-6",onClick:()=>{navigator.clipboard.writeText(t),o(!0),setTimeout(()=>
84o(!1),2e3)},"data-testid":`button-copy-${s||"value"}`,children:n?e.jsx(rl,{className:"h-3 w-3 text-green-500"}):e.jsx(_d,{className:"h-3 w-3"})})}function ar({label:t,value:s}){return e.jsxs("div",{className:"flex items-center justify-between gap-2 py-1",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("p",{className:"text-[10px] text-muted-foreground",children:t}),e.jsxs("p",{className:"text-xs font-mono text-foreground truncate",children:[s.slice(0,22),"â¦",s.slice(-8)]})]}),e.jsx(sh,{text:s,label:t.toLowerCase().replace(/\s+/g,"-")})]})}function rM({data:t}){const[s,n]=p.useState(!1);return e.jsxs("div",{className:"mt-3",children:[e.jsxs("button",{onClick:()=>n(o=>!o),className:"flex items-center gap-1 text-[10px] text-muted-foreground hover:text-foreground transition-colors","data-testid":"button-toggle-raw-json",children:[s?e.jsx(Ar,{className:"h-3 w-3"}):e.jsx(Cs,{className:"h-3 w-3"}),"Raw JSON"]}),s&&e.jsx("pre",{className:"mt-2 p-3 bg-muted/50 rounded-md text-[10px] font-mono text-foreground overflow-x-auto border border-border max-h-64",children:JSON.stringify(t,null,2)})]})}function nM({status:t}){return t==="running"?e.jsx(Ge,{className:"h-4 w-4 text-blue-500 animate-spin shrink-0"}):t==="done"?e.jsx(tt,{className:"h-4 w-4 text-green-500 shrink-0"}):t==="error"?e.jsx(Pt,{className:"h-4 w-4 text-red-500 shrink-0"}):e.jsx("div",{className:"h-4 w-4 rounded-full border-2 border-muted-foreground/30 shrink-0"})}function aM({status:t}){const s={idle:{label:"Idle",className:"bg-muted text-muted-foreground"},running:{label:"Running",className:"bg-blue-500/15 text-blue-600 dark:text-blue-400 border-blue-500/30 animate-pulse"},done:{label:"Done",className:"bg-green-500/15 text-green-600 dark:text-green-400 border-green-500/30"},error:{label:"Error",className:"bg-red-500/15 text-red-600 dark:text-red-400 border-red-500/30"}}[t];return e.jsx(Y,{className:re("text-[10px]",s.className),"data-testid":`badge-step-${t}`,children:s.label})}function oM({index:t,title:s,standard:n,standardColor:o,icon:i,state:c,blocked:d,onRun:m,children:f}){return e.jsx(ue,{className:re("border-card-border transition-all",c.status==="running"&&"border-blue-500/40 shadow-md shadow-blue-500/5",c.status==="done"&&"border-green-500/20",c.status==="error"&&"border-red-500/20"),"data-testid":`step-card-${t}`,children:e.jsxs(me,{className:"p-5",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3 mb-3",children:[e.jsxs("div",{className:"flex items-start gap-3 min-w-0",children:[e.jsx(nM,{status:c.status}),e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap mb-0.5",children:[e.jsxs("span",{className:"text-[10px] font-medium text-muted-foreground",children:["Step ",t]}),e.jsx(Y,{variant:"outline",className:re("text-[10px]",o),children:n}),e.jsx(aM,{status:c.status}),c.durationMs!==void 0&&e.jsxs("span",{className:"text-[10px] text-muted-foreground",children:[(c.durationMs/1e3).toFixed(1),"s"]})]}),e.jsxs("h3",{className:"text-sm font-semibold text-foreground flex items-center gap-2",children:[e.jsx(i,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"}),s]})]})]}),e.jsx(ie,{size:"sm",variant:"outline",onClick:m,disabled:c.status==="running"||d,className:"shrink-0","data-testid":`button-run-step-${t}`,children:c.status==="running"?e.jsx(Ge,{className:"h-3.5 w-3.5 animate-spin"}):e.jsx(_a,{className:"h-3.5 w-3.5"})})]}),c.status==="error"&&c.error&&e.jsxs("div",{className:"mb-3 p-3 rounded-md bg-red-500/10 border border-red-500/20",children:[e.jsxs("p",{className:"text-xs text-red-600 dark:text-red-400 flex items-start gap-2",children:[e.jsx(ks,{className:"h-3.5 w-3.5 shrink-0 mt-0.5"}),c.error]}),e.jsxs(ie,{size:"sm",variant:"outline",onClick:m,className:"mt-2 h-7 text-xs border-red-500/30 text-red-600 dark:text-red-400 hover:bg-red-500/10","data-testid":`button-retry-step-${t}`,children:[e.jsx(Yy,{className:"h-3 w-3 mr-1"}),"Retry"]})]}),c.status!=="idle"&&f&&e.jsx("div",{className:"mt-1",children:f}),c.result&&e.jsx(rM,{data:c.result})]})})}function iM({running:t,elapsed:s}){const n=o=>{const i=Math.floor(o/1e3),c=Math.floor(i/60);return c>0?`${c}m ${i%60}s`:`${i}s`};return e.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground","data-testid":"text-elapsed-timer",children:[e.jsx(Do,{
84className:"h-3.5 w-3.5"}),e.jsx("span",{children:n(s)}),t&&e.jsx("span",{className:"inline-block h-1.5 w-1.5 rounded-full bg-blue-500 animate-pulse"})]})}function B0({level:t}){const s={LOW:"bg-green-500/15 text-green-600 dark:text-green-400 border-green-500/30",MEDIUM:"bg-amber-500/15 text-amber-600 dark:text-amber-400 border-amber-500/30",HIGH:"bg-red-500/15 text-red-600 dark:text-red-400 border-red-500/30"}[t]??"bg-muted text-muted-foreground";return e.jsx(Y,{className:re("text-xs",s),"data-testid":"badge-risk-level",children:t})}function lM({status:t}){return t==="verified"?e.jsxs(Y,{className:"bg-green-500/15 text-green-600 dark:text-green-400 border-green-500/30 text-xs","data-testid":"badge-match-verified",children:[e.jsx(Es,{className:"h-3 w-3 mr-1"}),"Verified"]}):t==="not_anchored"?e.jsxs(Y,{className:"bg-amber-500/15 text-amber-600 dark:text-amber-400 border-amber-500/30 text-xs","data-testid":"badge-match-not-anchored",children:[e.jsx(al,{className:"h-3 w-3 mr-1"}),"Not Anchored"]}):e.jsxs(Y,{className:"bg-red-500/15 text-red-600 dark:text-red-400 border-red-500/30 text-xs","data-testid":"badge-match-mismatch",children:[e.jsx(Pt,{className:"h-3 w-3 mr-1"}),"Mismatch"]})}async function kN(t){const s=await crypto.subtle.digest("SHA-256",new TextEncoder().encode(t));return Array.from(new Uint8Array(s)).map(n=>n.toString(16).padStart(2,"0")).join("")}async function cM(t){const s="0x"+"0".repeat(64);if(t.length===0)return s;let n=t.map(o=>o.startsWith("0x")?o.slice(2):o);for(;n.length>1;){const o=[];for(let i=0;i<n.length;i+=2){const c=n[i],d=i+1<n.length?n[i+1]:n[i];o.push(await kN(c+d))}n=o}return"0x"+n[0]}function dM(){const{session:t}=fr(),s=t.address,n=t.authenticated,{toast:o}=Yt(),[i,c]=p.useState("sepolia"),[d,m]=p.useState(df()),[f,x]=p.useState(null),[v,y]=p.useState(null),[b,k]=p.useState(null),[S,j]=p.useState(!1),[w,E]=p.useState(null),[C,A]=p.useState(0),[_,D]=p.useState(null),[O,F]=p.useState(0),[P,Z]=p.useState({}),z=p.useRef(null);p.useEffect(()=>(S&&w!==null?z.current=setInterval(()=>A(Date.now()-w),500):z.current&&clearInterval(z.current),()=>{z.current&&clearInterval(z.current)}),[S,w]),p.useEffect(()=>{const pe=window.ethereum;if(pe){pe.request({method:"eth_chainId"}).then(we=>D(parseInt(we,16))).catch(()=>null);const je=we=>D(parseInt(we,16));return pe.on("chainChanged",je),()=>pe.removeListener("chainChanged",je)}},[]);const te=p.useCallback(async(pe,je,we=12e4,Ee)=>{const Ze=Date.now()+we,it=["submitted","completed","rejected"];for(;Date.now()<Ze;){const yt=await fetch(`/api/jobs/${pe}`);if(!yt.ok)throw new Error(`Job poll failed: ${yt.status}`);const Ot=await yt.json();if(Ee){const Jt=new Date().toLocaleTimeString();Ee(Ot,`[${Jt}] status=${Ot.status}`)}if(Ot.status===je||it.includes(Ot.status))return Ot;await new Promise(Jt=>setTimeout(Jt,3e3))}throw new Error(`Timed out waiting for job status ${je}`)},[]),ee=p.useCallback((pe,je)=>{m(we=>{const Ee=[...we];return Ee[pe]={...Ee[pe],...je},Ee})},[]),se=p.useCallback(async(pe,je)=>{const we=Date.now();ee(pe,{status:"running",error:void 0});try{const Ee=await je();return ee(pe,{status:"done",result:Ee,durationMs:Date.now()-we}),Ee}catch(Ee){const Ze=Ee instanceof Error?Ee.message:String(Ee);throw ee(pe,{status:"error",error:Ze,durationMs:Date.now()-we}),Ee}},[ee]),I=()=>{m(df()),x(null),y(null),k(null),j(!1),E(null),A(0),F(0),Z({})},le=p.useCallback(async()=>se(0,async()=>{const pe=await dt("POST","/api/test-agent/setup",i==="x402"?{x402:!0}:{});if(!pe.ok)throw new Error(`Setup failed: ${pe.status} ${await pe.text()}`);const je=await pe.json();return y(je.agent?.id??null),je}),[se,i]),ne=p.useCallback(async pe=>{const je=pe??v;if(!je)throw new Error("Run Step 1 first to create the test agent");return se(1,async()=>{const we=await fetch(`/api/risk-scores/${je}`);if(!we.ok)throw new Error(`Risk score fetch failed: ${we.status}`);const Ee=await we.json(),Ze=Ee.overallScore??50,it=Ze>=70?"HIGH":Ze>=40?"MEDIUM":"LOW";return k(it),{...Ee,riskLevel:it}})},[se,v]),J=p.useCallback(async()=>se(2,async()=>{if(!s)throw new Error("Wallet not connected");if(_!==11155111)throw new Error("Please switch MetaMask to the Sepolia network (chain 111
8455111)");const pe=await fetch(`/api/payments/sepolia/balance/${s}`);if(!pe.ok)throw new Error(`Balance check failed: ${pe.status}`);return pe.json()}),[se,s,_]),U=p.useCallback(async()=>se(2,async()=>{const pe=await fetch("/api/payments/circle/balance");if(!pe.ok)throw new Error(`Circle balance check failed: ${pe.status}`);return pe.json()}),[se]),q=p.useCallback(async pe=>{const je=pe??v;if(!je)throw new Error("Run Step 1 first");return se(3,async()=>{const we=await fetch("/api/payments/sepolia/config");if(!we.ok)throw new Error("Sepolia config not available â set SEPOLIA_ESCROW_ADDRESS env var");const{escrowAddress:Ee,usdcAddress:Ze}=await we.json(),it=BigInt(1e6),yt="a9059cbb",Ot=Ee.slice(2).padStart(64,"0"),Jt=it.toString(16).padStart(64,"0"),vt="0x"+yt+Ot+Jt,Mt=window.ethereum;if(!Mt)throw new Error("No wallet provider found");const W=(await Mt.request({method:"eth_requestAccounts"}))[0],X=window.ethereum;if(!X)throw new Error("No wallet provider found");const ge=await X.request({method:"eth_sendTransaction",params:[{from:W,to:Ze,data:vt,gas:"0x186a0"}]});o({title:"Transfer broadcasted",description:"Waiting for on-chain confirmationâ¦"});const{createPublicClient:xe,http:oe}=await md(async()=>{const{createPublicClient:gs,http:As}=await import("./index-BvZPcapo.js");return{createPublicClient:gs,http:As}},__vite__mapDeps([0,1])),{sepolia:Ce}=await md(async()=>{const{sepolia:gs}=await import("./index-BbM11wFc.js");return{sepolia:gs}},__vite__mapDeps([2,1]));await xe({chain:Ce,transport:oe()}).waitForTransactionReceipt({hash:ge,timeout:3e5,pollingInterval:3e3});const at=await dt("POST","/api/payments/sepolia/submit",{agentId:je,taskDescription:"E2E Protocol Conformance Test â ERC-8004, ERC-8126, ERC-8183, Tool Proxy, Cryptographic Audit Chain",taskPayload:{test:!0,standards:["ERC-8004","ERC-8126","ERC-8183","EIP-3009","Tool Proxy","Audit Chain"]},escrowAmount:1,delegatedScopes:{test:["echo"]},selectedTools:["echo"],txHash:ge});if(!at.ok)throw new Error(`Submit failed: ${at.status} ${await at.text()}`);const Nt=await at.json();return x(Nt.id),F(Nt.escrowAmount??1),{...Nt,paymentTxHash:ge}})},[se,v,o]),V=p.useCallback(async pe=>{const je=pe??v;if(!je)throw new Error("Run Step 1 first");return se(3,async()=>{const we=await dt("POST","/api/jobs",{agentId:je,taskDescription:"E2E Protocol Conformance Test â x402 nanopayment path (ERC-8004, ERC-8126, ERC-8183, EIP-3009, Tool Proxy, Audit Chain)",taskPayload:{test:!0,path:"x402"},escrowAmount:1,paymentMethod:"x402",delegatedScopes:{test:["echo"]},selectedTools:["echo"]});if(!we.ok)throw new Error(`Job creation failed: ${we.status} ${await we.text()}`);const Ee=await we.json();return x(Ee.id),F(Ee.escrowAmount??1),Ee})},[se,v]),R=p.useCallback(async pe=>{const je=pe??f;if(!je)throw new Error("Run Steps 1â4 first to create a job");return Z(we=>({...we,4:[]})),se(4,async()=>{const we=await te(je,"executing",6e4,(Ze,it)=>{Z(yt=>({...yt,4:[...yt[4]||[],it].slice(-20)}))});let Ee=[];if(i==="x402"){const Ze=await fetch(`/api/payments/circle/transactions/${je}`);Ze.ok&&(Ee=await Ze.json())}return{status:we.status,executionMode:we.executionMode,delegationHash:we.delegationHash,stepResults:we.stepResults,nanopayments:Ee}})},[se,f,te,i]),Q=p.useCallback(async pe=>{const je=pe??f;if(!je)throw new Error("Run Steps 1â5 first");return Z(we=>({...we,5:[]})),se(5,async()=>{const we=await te(je,"submitted",12e4,(Ze,it)=>{Z(yt=>({...yt,5:[...yt[5]||[],it].slice(-20)}))});let Ee=[];if(i==="x402"){const Ze=await fetch(`/api/payments/circle/transactions/${je}`);Ze.ok&&(Ee=await Ze.json())}return{status:we.status,deliverable:we.deliverable||"",deliverableHash:we.deliverableHash,auditRootHash:we.auditRootHash,delegationHash:we.delegationHash,escrowAmount:we.escrowAmount,escrowToken:we.escrowToken,nanopayments:Ee,nanopaymentsTotalCost:Ee.reduce((Ze,it)=>Ze+it.amount,0)}})},[se,f,te,i]),Ne=p.useCallback(async(pe="approve",je)=>{const we=je??f;if(!we)throw new Error("Run Steps 1â6 first");return se(6,async()=>{const Ee=pe==="approve"?"completed":"rejected",Ze=await dt("PATCH",`/api/jobs/${we}/status`,{status:Ee});if(!Ze.ok)throw new Error(`Status update failed: ${Ze.status} ${await Ze.text()}`);const it=await Ze.json();
84return ct.invalidateQueries({queryKey:["/api/jobs"]}),{...it,action:pe}})},[se,f]),Pe=p.useCallback(async pe=>{const je=pe??f;if(!je)throw new Error("Run Steps 1â7 first");return se(7,async()=>{const we=await fetch(`/api/jobs/${je}/audit-chain`);if(!we.ok)throw new Error(`Audit chain fetch failed: ${we.status}`);const Ee=await we.json(),Ze=Ee.calls.sort((xe,oe)=>(xe.sequenceNum||0)-(oe.sequenceNum||0)).map(xe=>xe.callHash).filter(xe=>xe!==null),it=await cM(Ze),yt=Ee.merkleRoot||"",Ot=it.toLowerCase()===yt.toLowerCase(),Jt=Ee.delegationHash||"0x"+"0".repeat(64),vt=Ee.taskHash||"0x"+"0".repeat(64),Mt=JSON.stringify({delegationHash:Jt,merkleRoot:it,taskHash:vt}),W="0x"+await kN(Mt),X=Ee.auditRootHash||"",ge=X?W.toLowerCase()===X.toLowerCase():!1;return{...Ee,clientMerkleRoot:it,merkleRootMatchesServer:Ot,clientAuditRootHash:W,auditRootMatchesServer:ge}})},[se,f]),ze=p.useCallback(async pe=>{const je=pe??f;if(!je)throw new Error("Run Steps 1â8 first");return se(8,async()=>{const we=await fetch(`/api/jobs/${je}/anchor-verify`);if(!we.ok)throw new Error(`Anchor verify failed: ${we.status}`);const Ee=await we.json(),Ze=await fetch(`/api/jobs/${je}`),it=Ze.ok?await Ze.json():null;return{...Ee,taskHash:it?.taskHash,paymentTxHash:it?.sepoliaPaymentTxHash??null,circlePaymentId:it?.circlePaymentId??null,nanopaymentsTotalCost:it?.nanopaymentsTotalCost??null,evaluatorType:it?.evaluatorType,escrowAmount:O,escrowToken:it?.escrowToken,providerChain:Ee.chain,capturedRiskLevel:b}})},[se,f,O,b]),Ve=p.useCallback(async()=>{if(!S){j(!0),E(Date.now()),A(0),m(df()),x(null),y(null),k(null),F(0);try{const je=(await le()).agent,we=typeof je?.id=="number"?je.id:null;we&&y(we),await ne(we??void 0);let Ee=null;if(i==="sepolia"){await J();const Ze=await q(we??void 0);Ee=typeof Ze.id=="number"?Ze.id:null}else{await U();const Ze=await V(we??void 0);Ee=typeof Ze.id=="number"?Ze.id:null}Ee&&x(Ee),await R(Ee??void 0),await Q(Ee??void 0),await Ne("approve",Ee??void 0),await Pe(Ee??void 0),await ze(Ee??void 0),o({title:"E2E test complete!",description:"All 9 steps passed successfully."})}catch{o({title:"E2E test stopped",description:"A step failed. Check individual steps for details.",variant:"destructive"})}finally{j(!1)}}},[S,le,ne,J,q,U,V,R,Q,Ne,Pe,ze,i,o]),fe=d.filter(pe=>pe.status==="done").length,De=d.some(pe=>pe.status==="error"),$e=i==="sepolia",qe=[{title:$e?"ERC-8004 Identity Registration":"ERC-8004 + x402 Agent Setup",standard:"ERC-8004",standardColor:"text-blue-600 dark:text-blue-400 border-blue-500/30",icon:Ct,handler:()=>le(),blocked:!1},{title:"ERC-8126 Risk Score Gate",standard:"ERC-8126",standardColor:"text-emerald-600 dark:text-emerald-400 border-emerald-500/30",icon:Es,handler:()=>ne(),blocked:d[0].status!=="done"},{title:$e?"Wallet & Sepolia USDC Balance":"Gateway Wallet Balance (x402)",standard:$e?"Sepolia":"EIP-3009",standardColor:$e?"text-violet-600 dark:text-violet-400 border-violet-500/30":"text-amber-600 dark:text-amber-400 border-amber-500/30",icon:St,handler:$e?J:U,blocked:d[1].status!=="done"},{title:$e?"Escrow Transfer (ERC-8183)":"Create Job (x402 Mode)",standard:$e?"ERC-8183":"x402",standardColor:$e?"text-purple-600 dark:text-purple-400 border-purple-500/30":"text-amber-600 dark:text-amber-400 border-amber-500/30",icon:Ss,handler:$e?()=>q():()=>V(),blocked:d[2].status!=="done"},{title:"Scope Delegation & Proxy Token",standard:"Tool Proxy",standardColor:"text-orange-600 dark:text-orange-400 border-orange-500/30",icon:Bi,handler:()=>R(),blocked:d[3].status!=="done"},{title:"OpenAI Execution & Tool Proxy Callback",standard:"ERC-8183",standardColor:"text-purple-600 dark:text-purple-400 border-purple-500/30",icon:Ky,handler:()=>Q(),blocked:d[4].status!=="done"},{title:"Buyer Approve Deliverable",standard:"ERC-8183",standardColor:"text-purple-600 dark:text-purple-400 border-purple-500/30",icon:Qc,handler:()=>Ne("approve"),blocked:d[5].status!=="done"},{title:"Cryptographic Audit Chain Verification",standard:"Audit Chain",standardColor:"text-rose-600 dar
84k:text-rose-400 border-rose-500/30",icon:nn,handler:()=>Pe(),blocked:d[6].status!=="done"},{title:"ERC-8183 Audit Certificate",standard:"ERC-8183",standardColor:"text-purple-600 dark:text-purple-400 border-purple-500/30",icon:Qn,handler:()=>ze(),blocked:d[7].status!=="done"}];return e.jsxs("div",{className:"min-h-screen",children:[e.jsx("div",{className:"border-b border-border bg-card/30",children:e.jsx("div",{className:"max-w-3xl mx-auto px-4 sm:px-6 py-8",children:e.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[e.jsx("div",{className:"h-10 w-10 rounded-xl bg-primary/10 flex items-center justify-center",children:e.jsx(nl,{className:"h-5 w-5 text-primary"})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold text-foreground","data-testid":"text-e2e-title",children:"E2E Test Runner"}),e.jsx("p",{className:"text-muted-foreground text-sm",children:"Full protocol stack conformance â ERC-8004 · ERC-8126 · ERC-8183 · Tool Proxy · Audit Chain"})]})]})})}),e.jsxs("div",{className:"max-w-3xl mx-auto px-4 sm:px-6 py-6 space-y-6",children:[e.jsx(ue,{className:"border-card-border",children:e.jsxs(me,{className:"p-5 space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2 flex-wrap",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider mb-1",children:"Payment Mode"}),e.jsxs("div",{className:"flex items-center gap-2","data-testid":"payment-mode-toggle",children:[e.jsxs(ie,{size:"sm",variant:i==="sepolia"?"default":"outline",onClick:()=>{c("sepolia"),I()},disabled:S,"data-testid":"button-mode-sepolia",children:[e.jsx(Ss,{className:"h-3.5 w-3.5 mr-1.5"}),"Sepolia USDC Escrow"]}),e.jsxs(ie,{size:"sm",variant:i==="x402"?"default":"outline",onClick:()=>{c("x402"),I()},disabled:S,"data-testid":"button-mode-x402",children:[e.jsx(ht,{className:"h-3.5 w-3.5 mr-1.5"}),"x402 Nanopayments"]})]})]}),e.jsx(iM,{running:S,elapsed:C})]}),e.jsx(is,{}),e.jsx("div",{className:"flex items-center gap-2",children:e.jsxs("div",{className:"flex-1 space-y-1",children:[e.jsxs("div",{className:"flex items-center justify-between text-xs text-muted-foreground",children:[e.jsxs("span",{children:[fe," / 9 steps complete"]}),De&&e.jsx("span",{className:"text-red-500",children:"Error in run"})]}),e.jsx(rp,{value:fe/9*100,className:"h-1.5"})]})}),e.jsxs("div",{className:"flex items-center gap-2","data-testid":"run-controls",children:[e.jsx(ie,{onClick:Ve,disabled:S||!n,className:"flex-1","data-testid":"button-run-all",children:S?e.jsxs(e.Fragment,{children:[e.jsx(Ge,{className:"h-4 w-4 mr-2 animate-spin"}),"Runningâ¦"]}):e.jsxs(e.Fragment,{children:[e.jsx(_a,{className:"h-4 w-4 mr-2"}),"Run Full E2E Test"]})}),e.jsx(ie,{variant:"outline",onClick:I,disabled:S,"data-testid":"button-reset",children:e.jsx(Yy,{className:"h-4 w-4"})})]}),!n&&e.jsxs("p",{className:"text-xs text-amber-600 dark:text-amber-400 flex items-center gap-1.5",children:[e.jsx(ks,{className:"h-3.5 w-3.5 shrink-0"}),"Connect your wallet to run the E2E test suite"]}),n&&i==="sepolia"&&_!==null&&_!==11155111&&e.jsxs("p",{className:"text-xs text-amber-600 dark:text-amber-400 flex items-center gap-1.5",children:[e.jsx(ks,{className:"h-3.5 w-3.5 shrink-0"}),"Switch MetaMask to Sepolia (chain 11155111) before running the Sepolia path"]}),f&&e.jsxs("p",{className:"text-xs text-muted-foreground flex items-center gap-1.5","data-testid":"text-active-job-id",children:[e.jsx(ir,{className:"h-3.5 w-3.5 text-blue-500"}),"Active job: #",f]})]})}),e.jsx("div",{className:"space-y-3",children:qe.map((pe,je)=>{const we=je===6&&d[5].status==="done"||d[je].status!=="idle",Ee=je===4||je===5?P[je]||[]:void 0;return e.jsx(oM,{index:je+1,title:pe.title,standard:pe.standard,standardColor:pe.standardColor,icon:pe.icon,state:d[je],blocked:pe.blocked,onRun:pe.handler,children:we&&e.jsx(uM,{idx:je,state:d[je],riskLevel:b,jobId:f,paymentMode:i,capturedEscrowAmount:O,pollLog:Ee,onApprove:()=>Ne("approve"),onReject:()=>Ne("reject")})},je)})})]})]})}function uM({idx:t,state:s,riskLevel:n,paymentMode:o,pollLog:i,onApprove:c,onReject:d}){const m=s.result;if(t===6){if(s.status==="done"&&m){const x=(typeof m.action=="str
84ing"?m.action:"approve")==="approve",v=j=>{if(!j)return null;try{return new Date(j).toLocaleString()}catch{return null}},y=v(m.createdAt),b=v(m.executionStartedAt),k=v(m.executionCompletedAt),S=v(m.updatedAt);return e.jsxs("div",{className:"space-y-3 text-xs",children:[e.jsx("div",{className:"flex items-center gap-2 flex-wrap",children:x?e.jsxs(Y,{className:"bg-green-500/15 text-green-600 dark:text-green-400 border-green-500/30 text-[10px]","data-testid":"badge-approved",children:[e.jsx(Qc,{className:"h-3 w-3 mr-1"}),"Approved"]}):e.jsxs(Y,{className:"bg-red-500/15 text-red-600 dark:text-red-400 border-red-500/30 text-[10px]","data-testid":"badge-rejected",children:[e.jsx(Sf,{className:"h-3 w-3 mr-1"}),"Rejected"]})}),typeof m.deliverableHash=="string"&&e.jsx(ar,{label:"Deliverable Hash",value:m.deliverableHash}),e.jsxs("div",{className:"p-2.5 rounded bg-muted/30 border border-border/50 space-y-1","data-testid":"lifecycle-timestamps",children:[e.jsx("p",{className:"text-[10px] font-semibold text-muted-foreground uppercase tracking-wider mb-1.5",children:"ERC-8183 Lifecycle"}),y&&e.jsxs("div",{className:"flex justify-between gap-2",children:[e.jsx("span",{className:"text-[10px] text-muted-foreground",children:"Created"}),e.jsx("span",{className:"text-[10px] font-mono","data-testid":"timestamp-created",children:y})]}),b&&e.jsxs("div",{className:"flex justify-between gap-2",children:[e.jsx("span",{className:"text-[10px] text-muted-foreground",children:"Execution Started"}),e.jsx("span",{className:"text-[10px] font-mono","data-testid":"timestamp-execution-started",children:b})]}),k&&e.jsxs("div",{className:"flex justify-between gap-2",children:[e.jsx("span",{className:"text-[10px] text-muted-foreground",children:"Execution Completed"}),e.jsx("span",{className:"text-[10px] font-mono","data-testid":"timestamp-execution-completed",children:k})]}),S&&e.jsxs("div",{className:"flex justify-between gap-2",children:[e.jsxs("span",{className:"text-[10px] text-muted-foreground",children:[x?"Approved":"Rejected"," At"]}),e.jsx("span",{className:"text-[10px] font-mono","data-testid":"timestamp-decision",children:S})]})]})]})}return s.status==="running"?e.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[e.jsx(Ge,{className:"h-3.5 w-3.5 animate-spin"}),"Submitting decisionâ¦"]}):e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-xs text-muted-foreground",children:"Review the deliverable from Step 6 and approve or reject it:"}),e.jsxs("div",{className:"flex items-center gap-2","data-testid":"approve-reject-controls",children:[e.jsxs(ie,{size:"sm",className:"gap-1.5 bg-green-600 hover:bg-green-700 text-white",onClick:()=>c(),"data-testid":"button-approve-deliverable",children:[e.jsx(Qc,{className:"h-3.5 w-3.5"}),"Approve Deliverable"]}),e.jsxs(ie,{size:"sm",variant:"outline",className:"gap-1.5 border-red-500/30 text-red-600 dark:text-red-400 hover:bg-red-500/10",onClick:()=>d(),"data-testid":"button-reject-deliverable",children:[e.jsx(Sf,{className:"h-3.5 w-3.5"}),"Reject"]})]})]})}if(!m)return null;if(t===0){const f=m.agent;return e.jsx("div",{className:"space-y-2 text-xs",children:f&&e.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[e.jsxs("div",{className:"p-2 rounded bg-muted/30 border border-border/50",children:[e.jsx("p",{className:"text-[10px] text-muted-foreground",children:"Agent ID"}),e.jsx("p",{className:"font-mono font-medium","data-testid":"text-agent-id",children:f.id})]}),e.jsxs("div",{className:"p-2 rounded bg-muted/30 border border-border/50",children:[e.jsx("p",{className:"text-[10px] text-muted-foreground",children:"Execution Mode"}),e.jsx("p",{className:"font-medium capitalize",children:f.executionMode?.replace(/_/g," ")??"â"})]}),f.endpoint&&e.jsxs("div",{className:"p-2 rounded bg-muted/30 border border-border/50 col-span-2",children:[e.jsx("p",{className:"text-[10px] text-muted-foreground",children:"Endpoint URL"}),e.jsx("p",{className:"font-mono text-[10px] truncate","data-testid":"text-agent-endpoint",children:f.endpoint})]}),e.jsxs("div",{className:"p-2 rounded bg-muted/30 border border-border/50",children:[e.jsx("p",{className:"text-[10px] text-muted-foreground",children:"x402"}),e.jsx("p",{className:re("font-medium text-xs",f.x402Supported?"text-green-500":"text-muted-foreground"),children:f.x402Supported?"Enabled":"Disabled"})]}),e.jsxs("div",{className:"p-2 rounded bg-muted/30 border border-border/50",children:[e.jsx("p",{className:"text-[10px] text-muted-foreground",children:"ERC-8004 TokenId"}),e.jsx("p",{className:"font-mono font-medium","data-testid":"text-token-id",children:typeof f.tokenId=="number"?f.tokenId:99999})]})]})})}if(t===1){const f=typeof m.overallScore=="number"?m.overallScore:50,x=n||(typeof m.riskLevel=="string"?m.riskLevel:"MEDIUM");return e.jsx("div",{className:"space-y-2",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"text-2xl font-bold tabular-nums","data-testid":"text-risk-score",children:f}),e.jsx("p",{className:"text-[10px] text-muted-foreground",children:"Score"})]}),e.jsx(is,{orientation:"vertical",className:"h-10"}),e.jsxs("div",{children:[e.jsx(B0,{level:x}),x==="HIGH"&&e.jsxs("p",{className:"text-[10px] text-amber-600 dar
84k:text-amber-400 mt-1 flex items-center gap-1",children:[e.jsx(ks,{className:"h-2.5 w-2.5"}),"High risk â a real buyer should reject this hire"]})]})]})})}if(t===2){const f=typeof m.balanceFormatted=="number"?m.balanceFormatted:typeof m.balance=="number"?m.balance:typeof m.usdcBalance=="number"?m.usdcBalance:null,x=f!==null&&Number(f)===0;return e.jsxs("div",{className:"space-y-2 text-xs",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("div",{className:"p-2.5 rounded bg-muted/30 border border-border/50",children:[e.jsx("p",{className:"text-[10px] text-muted-foreground",children:"USDC Balance"}),e.jsx("p",{className:"text-lg font-bold tabular-nums","data-testid":"text-usdc-balance",children:f!==null?Number(f).toFixed(2):"â"})]}),x&&e.jsxs("a",{href:"https://faucet.circle.com",target:"_blank",rel:"noopener noreferrer",className:"text-xs text-blue-500 hover:text-blue-600 underline flex items-center gap-1","data-testid":"link-faucet",children:["Get Sepolia USDC ",e.jsx(wt,{className:"h-3 w-3"})]})]}),x&&e.jsxs("p",{className:"text-[10px] text-amber-600 dark:text-amber-400 flex items-center gap-1",children:[e.jsx(ks,{className:"h-3 w-3 shrink-0"}),"Zero balance â use the faucet to get test USDC before proceeding"]})]})}if(t===3){const f=typeof m.paymentTxHash=="string"?m.paymentTxHash:typeof m.sepoliaPaymentTxHash=="string"?m.sepoliaPaymentTxHash:null,x=typeof m.id=="number"?m.id:null;return e.jsxs("div",{className:"space-y-2 text-xs",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[e.jsxs("div",{className:"p-2 rounded bg-muted/30 border border-border/50",children:[e.jsx("p",{className:"text-[10px] text-muted-foreground",children:"Escrow Amount"}),e.jsxs("p",{className:"font-bold","data-testid":"text-escrow-amount",children:[typeof m.escrowAmount=="number"?m.escrowAmount.toFixed(2):"1.00"," USDC"]})]}),e.jsxs("div",{className:"p-2 rounded bg-muted/30 border border-border/50",children:[e.jsx("p",{className:"text-[10px] text-muted-foreground",children:"Job ID"}),e.jsx("p",{className:"font-bold font-mono","data-testid":"text-job-id",children:x??"â"})]})]}),f&&e.jsxs("div",{className:"flex items-center gap-2 p-2 rounded bg-muted/30 border border-border/50",children:[e.jsx("p",{className:"text-[10px] text-muted-foreground shrink-0",children:"Tx:"}),e.jsxs("p",{className:"font-mono text-[10px] truncate flex-1",children:[f.slice(0,20),"â¦"]}),e.jsx(sh,{text:f,label:"payment-tx"}),e.jsx("a",{href:`https://sepolia.etherscan.io/tx/${f}`,target:"_blank",rel:"noopener noreferrer","data-testid":"link-etherscan-tx",children:e.jsx(ie,{size:"icon",variant:"ghost",className:"h-6 w-6",children:e.jsx(wt,{className:"h-3 w-3"})})})]})]})}if(t===4){const f=Array.isArray(m.stepResults)?m.stepResults:[],x=Array.isArray(m.nanopayments)?m.nanopayments:[],v=typeof m.delegationHash=="string"?m.delegationHash:null,y=i||[];return e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx(Y,{variant:"outline",className:"text-[10px]","data-testid":"badge-job-status",children:typeof m.status=="string"?m.status:"â"}),v&&e.jsxs("span",{className:"text-[10px] font-mono text-muted-foreground",children:["delHash: ",v.slice(0,14),"â¦"]})]}),(s.status==="running"||y.length>0)&&e.jsxs("div",{className:"p-2 rounded bg-muted/20 border border-border/30 space-y-0.5 max-h-24 overflow-y-auto","data-testid":"poll-log-step5",children:[s.status==="running"&&y.length===0&&e.jsx("p",{className:"text-[10px] text-muted-foreground font-mono animate-pulse",children:"Polling executor statusâ¦"}),y.map((b,k)=>e.jsx("p",{className:"text-[10px] font-mono text-muted-foreground",children:b},k))]}),f.length>0&&e.jsx("div",{className:"space-y-1 mt-1",children:f.map((b,k)=>e.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[e.jsx("div",{className:re("h-1.5 w-1.5 rounded-full shrink-0",{"bg-green-500":b.status==="completed","bg-red-500":b.status==="failed","bg-amber-500":b.status==="gated","bg-blue-500":b.status==="running","bg-muted-foreground":b.status==="pending"})}),e.jsx("span",{className:"text-muted-foreground truncate",children:b.stepName})]},k))}),o==="x402"&&x.length>0&&e.jsxs("div",{className:"space-y-1 mt-2","data-testid":"nanopayment-table-step5",children:[e.jsx("p",{className:"text-[10px] font-medium text-muted-foreground uppercase tracking-wider",children:"Nanopayment Transactions"}),x.slice(0,5).map(b=>e.jsxs("div",{className:"flex items-center justify-between gap-2 p-1.5 rounded bg-muted/20 border border-border/30","data-testid":`nanopay-row-${b.id}`,children:[e.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[e.jsxs("span",{className:"text-xs font-mono",children:[b.amount.toFixed(4)," ",b.currency]}),b.batchId&&e.jsxs("span",{className:"text-[10px] text-muted-foreground font-mono truncate",children:["batch:",b.batchId.slice(0,8),"â¦"]})]}),e.jsx(Y,{variant:"outline",className:"text-[10px] shrink-0",children:b.status})]},b.id))]})]})}if(t===5){const f=typeof m.deliverable=="string"?m.deliverable:null,x=Array.isArray(m.nanopayments)?m.nanopayments:[],v=Array.from(new Set(x.map(k=>k.batchId).filter(k=>k!==null))),y=typeof m.nanopaymentsTotalCost=="number"?m.nanopaymentsTotalCost:x.reduce((k,S)=>k+S.amount,0),b=i||[];return e.jsxs("div",{className:"space-y-2 text-xs",children:[e.jsx("div",{className:"flex items-center gap-2 flex-wrap",children:e.jsx(Y,{variant:"outline",className:"text-[10px]","data-testid":"badge-job-submitted",children:typeof m.status=="string"?m.status:"â"})}),(s.status==="running"||b.length>0)&&e.jsxs("div",{className:"p-2 rounded bg-muted/20 border border-border/30 space-y-0.5 max-h-24 overflow-y-auto","data-testid":"poll-log-step6",children:[s.status==="running"&&b.length===0&&e.jsx("p",{className:"text-[10px] text-muted-foreground font-mono animate-pulse",children:"Polling OpenAI execution + Tool Proxy callbacksâ¦"}),b.map((k,S)=>e.jsx("p",{className:"text-[10px] font-mono text-muted-foreground",children:k},S))]}),f&&e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-[10px] font-semibold text-muted-foreground uppercase tracking-wider",children:"ERC-8183 Protocol Report"}),e.jsx("div",{className:"p-2.5 rounded bg-muted/30 border border-border/50 max-h-56 overflow-y-auto","data-testid":"deliverable-output",children:e.jsx("p",{className:"text-[10px] font-mono leading-relaxed whitespace-pre-wrap",children:f})})]}),o==="x402"&&x.length>0&&e.jsxs("div",{className:"space-y-1 mt-1","data-testid":"nanopayment-table-step6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("p",{className:"text-[10px] font-medium text-muted-foreground uppercase tracking-wider",children:"Nanopayment Transactions"}),e.jsxs("span",{className:"text-[10px] text-muted-foreground",children:[y.toFixed(4)," USDC total"]})]}),x.map(k=>e.jsxs("div",{className:"flex items-center justify-between gap-2 p-1.5 rounded bg-muted/20 border border-border/30","data-testid":`nanopay-row-step6-${k.id}`,children:[e.jsxs("div",{className:"flex items-center gap-1.5 min-w-0 flex-1",children:[e.jsxs("span",{className:"text-xs font-mono",children:[k.amount.toFixed(6)," ",k.currency]}),k.batchId&&e.jsxs("span",{className:"text-[10px] font-mono text-muted-foreground truncate",children:["batch:",k.batchId.slice(0,8),"â¦"]})]}),e.jsx(Y,{variant:"outline",className:"text-[10px] shrink-0",children:k.status})]},k.id)),v.length>0&&e.jsxs("div",{className:"flex items-center gap-2 p-2 rounded bg-emerald-500/10 border border-emerald-500/20",children:[e.jsx(Ur,{className:"h-3.5 w-3.5 text-emerald-600 dark:text-emerald-400 shrink-0"}),e.jsxs("div",{className:"min-w-0",children:[e.jsxs("p",{className:"text-[10px] text-emerald-600 dark:text-emerald-400",children:[v.length," batch",v.length>1?"es":""," settled"]}),e.jsxs("p",{className:"text-[10px] font-mono text-emerald-700 dark:text-emerald-300 truncate",children:["ID: ",v.join(", ")
84]})]})]})]}),e.jsxs("div",{className:"space-y-0.5",children:[typeof m.deliverableHash=="string"&&e.jsx(ar,{label:"Deliverable Hash",value:m.deliverableHash}),typeof m.auditRootHash=="string"&&e.jsx(ar,{label:"Audit Root Hash",value:m.auditRootHash})]})]})}if(t===7){const f=m,x=Array.isArray(f.calls)?f.calls:[],v=f.merkleRootMatchesServer===!0,y=f.auditRootMatchesServer===!0;return e.jsxs("div",{className:"space-y-2 text-xs",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-2 sm:grid-cols-4",children:[e.jsxs("div",{className:"p-2 rounded bg-muted/30 border border-border/50 text-center",children:[e.jsx("p",{className:"text-[10px] text-muted-foreground",children:"Total Calls"}),e.jsx("p",{className:"font-bold","data-testid":"text-audit-call-count",children:f.totalCalls})]}),e.jsxs("div",{className:"p-2 rounded bg-muted/30 border border-border/50 text-center",children:[e.jsx("p",{className:"text-[10px] text-muted-foreground",children:"Chain Integrity"}),e.jsx("p",{className:re("font-bold text-xs",f.chainIntegrity?.valid?"text-green-500":"text-red-500"),"data-testid":"text-chain-integrity",children:f.chainIntegrity?.valid?"Valid":"Invalid"})]}),e.jsxs("div",{className:"p-2 rounded bg-muted/30 border border-border/50 text-center",children:[e.jsx("p",{className:"text-[10px] text-muted-foreground",children:"Merkle Root"}),e.jsx("p",{className:re("font-bold text-xs",v?"text-green-500":"text-amber-500"),"data-testid":"text-client-merkle-status",children:v?"Match â":"Differs"})]}),e.jsxs("div",{className:"p-2 rounded bg-muted/30 border border-border/50 text-center",children:[e.jsx("p",{className:"text-[10px] text-muted-foreground",children:"Audit Root Hash"}),e.jsx("p",{className:re("font-bold text-xs",y?"text-green-500":"text-amber-500"),"data-testid":"text-audit-root-match",children:y?"Match â":"Differs"})]})]}),e.jsxs("div",{className:"space-y-0.5",children:[f.clientMerkleRoot&&e.jsx(ar,{label:"Client Merkle Root",value:f.clientMerkleRoot}),f.merkleRoot&&e.jsx(ar,{label:"Server Merkle Root",value:f.merkleRoot}),f.clientAuditRootHash&&e.jsx(ar,{label:"Client Audit Root Hash",value:f.clientAuditRootHash}),f.auditRootHash&&e.jsx(ar,{label:"Server Audit Root Hash",value:f.auditRootHash})]}),x.length>0&&e.jsx("div",{className:"space-y-1 max-h-36 overflow-y-auto",children:x.map((b,k)=>e.jsxs("div",{className:"flex items-center justify-between gap-2 p-1.5 rounded bg-muted/20 border border-border/30","data-testid":`audit-call-row-${k}`,children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsxs("span",{className:"text-[10px] text-muted-foreground shrink-0",children:["#",b.sequenceNum]}),e.jsxs("span",{className:"font-mono text-[10px] truncate",children:[b.service,"/",b.action]})]}),e.jsx(Y,{variant:"outline",className:"text-[10px] shrink-0",children:b.status})]},k))})]})}if(t===8){const f=m,x=f.matchStatus,v="0x"+"0".repeat(64),y=f.onChainRecord;return e.jsxs("div",{className:"space-y-3 text-xs",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx(lM,{status:x}),f.anchorTxHash&&e.jsxs("a",{href:`https://etherscan.io/tx/${f.anchorTxHash}`,target:"_blank",rel:"noopener noreferrer",className:"text-[10px] text-blue-500 hover:underline flex items-center gap-0.5","data-testid":"link-anchor-tx",children:["View anchor tx ",e.jsx(wt,{className:"h-2.5 w-2.5"})]})]}),e.jsxs("div",{className:"p-3 rounded bg-muted/30 border border-border/50 space-y-1",children:[e.jsx("p",{className:"text-[10px] font-semibold text-muted-foreground uppercase tracking-wider mb-2",children:"ERC-8183 Job Certificate"}),f.taskHash&&e.jsx(ar,{label:"Task Hash",value:f.taskHash}),y?.delegationHash&&y.delegationHash!==v&&e.jsx(ar,{label:"Delegation Hash",value:y.delegationHash}),y?.auditRootHash&&y.auditRootHash!==v&&e.jsx(ar,{label:"Audit Root Hash",value:y.auditRootHash}),y?.deliverableHash&&y.deliverableHash!==v&&e.jsx(ar,{label:"Deliverable Hash",value:y.deliverableHash}),f.anchorTxHash&&e.jsx(ar,{label:"Anchor Tx Hash",value:f.anchorTxHash}),f.paymentTxHash&&e.jsxs("div",{className:"flex items-center justify-between gap-2 py-1",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("p",{className:"text-[10px] text-muted-foreground",children:"Payment Tx Hash (Sepolia)"}),e.jsxs("p",{className:"text-xs font-mono truncate",children:[f.paymentTxHash.slice(0,22),"â¦"]})]}),e.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[e.jsx(sh,{text:f.paymentTxHash,label:"payment-tx-cert"}),e.jsx("a",{href:`https://sepolia.etherscan.io/tx/${f.paymentTxHash}`,target:"_blank",rel:"noopener noreferrer",children:e.jsx(ie,{size:"icon",variant:"ghost",className:"h-6 w-6",children:e.jsx(wt,{className:"h-3 w-3"})})})]})]}),f.circlePaymentId&&e.jsxs("div",{className:"py-1",children:[e.jsx("p",{className:"text-[10px] text-muted-foreground",children:"Circle Payment ID"}),e.jsx("p",{className:"text-xs font-mono truncate",children:f.circlePaymentId})]}),e.jsx(is,{className:"my-2"}),e.jsxs("div",{className:"grid grid-cols-2 gap-x-4 gap-y-1.5",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-[10px] text-muted-foreground",children:"Escrow Amount"}),e.jsxs("p",{className:"font-mono text-xs",children:[typeof f.escrowAmount=="number"?f.escrowAmount.toFixed(2):"1.00"," ",f.escrowToken||"USDC"]})]}),typeof f.nanopaymentsTotalCost=="number"&&e.jsxs("div",{children:[e.jsx("p",{className:"text-[10px] text-muted-foreground",children:"Nanopayments Total"}),e.jsxs("p",{className:"font-mono text-xs",children:[f.nanopaymentsTotalCost.toFixed(4)," USDC"]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-[10px] text-muted-foreground",children:"Evaluator Type"}),e.jsx("p",{className:"text-xs",children:f.evaluatorType||"self"})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-[10px] text-muted-foreground",children:"Provider Token"}),e.jsx("p",{className:"font-mono text-xs",children:"#99999"})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-[10px] text-muted-foreground",children:"Provider Chain"}),e.jsx("p",{className:"text-xs",children:f.providerChain||f.chain})]}),f.capturedRiskLevel&&e.jsxs("div",{children:[e.jsx("p",{className:"text-[10px] text-muted-foreground",children:"ERC-8126 Risk Level"}),e.jsx(B0,{level:f.capturedRiskLevel})]})]})]})]})}return null}function mM(){return e.jsxs(H2,{children:[e.jsx(ss,{path:"/",component:NA}),e.jsx(ss,{path:"/explore",component:tT}),e.jsx(ss,{path:"/agent/:chain/:id",component:uT}),e.jsx(ss,{path:"/developers",component:xT}),e.jsx(ss,{path:"/tools",component:PP}),e.jsx(ss,{path:"/jobs",children:()=>e.jsx($n,{children:e.jsx(ZT,{})})}),e.jsx(ss,{path:"/hire",children:()=>e.jsx($n,{children:e.jsx(EP,{})})}),e.jsx(ss,{path:"/create",children:()=>e.jsx($n,{children:e.jsx(OP,{})})}),e.jsx(ss,{path:"/orchestrate",children:()=>e.jsx($n,{children:e.jsx(FP,{})})}),e.jsx(ss,{path:"/mandate",children:()=>e.jsx($n,{children:e.jsx(zP,{})})}),e.jsx(ss,{path:"/vault",children:()=>e.jsx($n,{children:e.jsx(BP,{})})}),e.jsx(ss,{path:"/agent-dashboard",children:()=>e.jsx($n,{children:e.jsx(YP,{})})}),e.jsx(ss,{path:"/identity",component:UP}),e.jsx(ss,{path:"/e2e-test",children:()=>e.jsx($n,{children:e.jsx(dM,{})})}),e.jsx(ss,{path:"/oauth/consent",component:XP}),e.jsx(ss,{path:"/privacy",component:eM}),e.jsx(ss,{path:"/terms",component:tM}),e.jsx(ss,{component:sM})]})}function fM(){const{toast:t}=Yt();return p.useEffect(()=>{const n=new URLSearchParams(window.location.search).get("auth_error");
84if(n){t({title:"Sign in failed",description:n==="invalid_state"?"Authentication state mismatch. Please try again.":n==="token_exchange_failed"?"Could not complete Google sign-in. Please try again.":"Sign in was cancelled or failed. Please try again.",variant:"destructive"});const o=new URL(window.location.href);o.searchParams.delete("auth_error"),window.history.replaceState({},"",o.toString())}},[]),null}function hM(){return e.jsx(dC,{client:ct,children:e.jsx(dE,{children:e.jsxs(cE,{children:[e.jsx(O5,{}),e.jsx(fM,{}),e.jsx(oA,{}),e.jsx(mM,{}),e.jsx(xA,{})]})})})}w2.createRoot(document.getElementById("root")).render(e.jsx(hM,{}));export{md as _};
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.