@manojkmfsi/monodog 1.1.28 → 1.1.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +64 -0
- package/check-db.js +58 -0
- package/create-test-session.js +50 -0
- package/dev-server.pid +1 -0
- package/dist/controllers/pipeline-controller.js +329 -0
- package/dist/controllers/publish-controller.js +119 -7
- package/dist/middleware/auth-middleware.js +1 -0
- package/dist/middleware/server-startup.js +19 -0
- package/dist/routes/auth-routes.js +2 -0
- package/dist/routes/pipeline-routes.js +76 -0
- package/dist/services/changeset-service.js +2 -13
- package/dist/services/github-actions-service.js +552 -0
- package/dist/services/pipeline-service.js +356 -0
- package/dist/types/github-actions.js +6 -0
- package/monodog-dashboard/dist/assets/index-6NrFUGfK.js +15 -0
- package/monodog-dashboard/dist/assets/index-6NrFUGfK.js.map +1 -0
- package/monodog-dashboard/dist/assets/index-DcvKt8qx.css +1 -0
- package/monodog-dashboard/dist/index.html +2 -2
- package/package.json +2 -2
- package/prisma/migrations/{20260118042615_init_database → 20260224091033_init_db}/migration.sql +58 -0
- package/prisma/schema/pipeline-audit-log.prisma +22 -0
- package/prisma/schema/release-pipeline.prisma +25 -0
- package/monodog-dashboard/dist/assets/index-7G3SCgcz.css +0 -1
- package/monodog-dashboard/dist/assets/index-BMoE990p.js +0 -13
- package/monodog-dashboard/dist/assets/index-BMoE990p.js.map +0 -1
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
function z0(s,l){for(var i=0;i<l.length;i++){const o=l[i];if(typeof o!="string"&&!Array.isArray(o)){for(const u in o)if(u!=="default"&&!(u in s)){const m=Object.getOwnPropertyDescriptor(o,u);m&&Object.defineProperty(s,u,m.get?m:{enumerable:!0,get:()=>o[u]})}}}return Object.freeze(Object.defineProperty(s,Symbol.toStringTag,{value:"Module"}))}(function(){const l=document.createElement("link").relList;if(l&&l.supports&&l.supports("modulepreload"))return;for(const u of document.querySelectorAll('link[rel="modulepreload"]'))o(u);new MutationObserver(u=>{for(const m of u)if(m.type==="childList")for(const h of m.addedNodes)h.tagName==="LINK"&&h.rel==="modulepreload"&&o(h)}).observe(document,{childList:!0,subtree:!0});function i(u){const m={};return u.integrity&&(m.integrity=u.integrity),u.referrerPolicy&&(m.referrerPolicy=u.referrerPolicy),u.crossOrigin==="use-credentials"?m.credentials="include":u.crossOrigin==="anonymous"?m.credentials="omit":m.credentials="same-origin",m}function o(u){if(u.ep)return;u.ep=!0;const m=i(u);fetch(u.href,m)}})();function $0(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}var xo={exports:{}},Ks={},po={exports:{}},Se={};var Sd;function B0(){if(Sd)return Se;Sd=1;var s=Symbol.for("react.element"),l=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),u=Symbol.for("react.profiler"),m=Symbol.for("react.provider"),h=Symbol.for("react.context"),p=Symbol.for("react.forward_ref"),x=Symbol.for("react.suspense"),y=Symbol.for("react.memo"),k=Symbol.for("react.lazy"),j=Symbol.iterator;function E(S){return S===null||typeof S!="object"?null:(S=j&&S[j]||S["@@iterator"],typeof S=="function"?S:null)}var I={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},L=Object.assign,A={};function P(S,D,ae){this.props=S,this.context=D,this.refs=A,this.updater=ae||I}P.prototype.isReactComponent={},P.prototype.setState=function(S,D){if(typeof S!="object"&&typeof S!="function"&&S!=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,S,D,"setState")},P.prototype.forceUpdate=function(S){this.updater.enqueueForceUpdate(this,S,"forceUpdate")};function O(){}O.prototype=P.prototype;function M(S,D,ae){this.props=S,this.context=D,this.refs=A,this.updater=ae||I}var R=M.prototype=new O;R.constructor=M,L(R,P.prototype),R.isPureReactComponent=!0;var $=Array.isArray,J=Object.prototype.hasOwnProperty,ve={current:null},ee={key:!0,ref:!0,__self:!0,__source:!0};function pe(S,D,ae){var B,G={},Z=null,ue=null;if(D!=null)for(B in D.ref!==void 0&&(ue=D.ref),D.key!==void 0&&(Z=""+D.key),D)J.call(D,B)&&!ee.hasOwnProperty(B)&&(G[B]=D[B]);var Q=arguments.length-2;if(Q===1)G.children=ae;else if(1<Q){for(var ie=Array(Q),Ee=0;Ee<Q;Ee++)ie[Ee]=arguments[Ee+2];G.children=ie}if(S&&S.defaultProps)for(B in Q=S.defaultProps,Q)G[B]===void 0&&(G[B]=Q[B]);return{$$typeof:s,type:S,key:Z,ref:ue,props:G,_owner:ve.current}}function xe(S,D){return{$$typeof:s,type:S.type,key:D,ref:S.ref,props:S.props,_owner:S._owner}}function we(S){return typeof S=="object"&&S!==null&&S.$$typeof===s}function X(S){var D={"=":"=0",":":"=2"};return"$"+S.replace(/[=:]/g,function(ae){return D[ae]})}var he=/\/+/g;function ye(S,D){return typeof S=="object"&&S!==null&&S.key!=null?X(""+S.key):D.toString(36)}function je(S,D,ae,B,G){var Z=typeof S;(Z==="undefined"||Z==="boolean")&&(S=null);var ue=!1;if(S===null)ue=!0;else switch(Z){case"string":case"number":ue=!0;break;case"object":switch(S.$$typeof){case s:case l:ue=!0}}if(ue)return ue=S,G=G(ue),S=B===""?"."+ye(ue,0):B,$(G)?(ae="",S!=null&&(ae=S.replace(he,"$&/")+"/"),je(G,D,ae,"",function(Ee){return Ee})):G!=null&&(we(G)&&(G=xe(G,ae+(!G.key||ue&&ue.key===G.key?"":(""+G.key).replace(he,"$&/")+"/")+S)),D.push(G)),1;if(ue=0,B=B===""?".":B+":",$(S))for(var Q=0;Q<S.length;Q++){Z=S[Q];var ie=B+ye(Z,Q);ue+=je(Z,D,ae,ie,G)}else if(ie=E(S),typeof ie=="function")for(S=ie.call(S),Q=0;!(Z=S.next()).done;)Z=Z.value,ie=B+ye(Z,Q++),ue+=je(Z,D,ae,ie,G);else if(Z==="object")throw D=String(S),Error("Objects are not valid as a React child (found: "+(D==="[object Object]"?"object with keys {"+Object.keys(S).join(", ")+"}":D)+"). If you meant to render a collection of children, use an array instead.");return ue}function Pe(S,D,ae){if(S==null)return S;var B=[],G=0;return je(S,B,"","",function(Z){return D.call(ae,Z,G++)}),B}function Ne(S){if(S._status===-1){var D=S._result;D=D(),D.then(function(ae){(S._status===0||S._status===-1)&&(S._status=1,S._result=ae)},function(ae){(S._status===0||S._status===-1)&&(S._status=2,S._result=ae)}),S._status===-1&&(S._status=0,S._result=D)}if(S._status===1)return S._result.default;throw S._result}var ce={current:null},W={transition:null},se={ReactCurrentDispatcher:ce,ReactCurrentBatchConfig:W,ReactCurrentOwner:ve};function Y(){throw Error("act(...) is not supported in production builds of React.")}return Se.Children={map:Pe,forEach:function(S,D,ae){Pe(S,function(){D.apply(this,arguments)},ae)},count:function(S){var D=0;return Pe(S,function(){D++}),D},toArray:function(S){return Pe(S,function(D){return D})||[]},only:function(S){if(!we(S))throw Error("React.Children.only expected to receive a single React element child.");return S}},Se.Component=P,Se.Fragment=i,Se.Profiler=u,Se.PureComponent=M,Se.StrictMode=o,Se.Suspense=x,Se.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=se,Se.act=Y,Se.cloneElement=function(S,D,ae){if(S==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+S+".");var B=L({},S.props),G=S.key,Z=S.ref,ue=S._owner;if(D!=null){if(D.ref!==void 0&&(Z=D.ref,ue=ve.current),D.key!==void 0&&(G=""+D.key),S.type&&S.type.defaultProps)var Q=S.type.defaultProps;for(ie in D)J.call(D,ie)&&!ee.hasOwnProperty(ie)&&(B[ie]=D[ie]===void 0&&Q!==void 0?Q[ie]:D[ie])}var ie=arguments.length-2;if(ie===1)B.children=ae;else if(1<ie){Q=Array(ie);for(var Ee=0;Ee<ie;Ee++)Q[Ee]=arguments[Ee+2];B.children=Q}return{$$typeof:s,type:S.type,key:G,ref:Z,props:B,_owner:ue}},Se.createContext=function(S){return S={$$typeof:h,_currentValue:S,_currentValue2:S,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},S.Provider={$$typeof:m,_context:S},S.Consumer=S},Se.createElement=pe,Se.createFactory=function(S){var D=pe.bind(null,S);return D.type=S,D},Se.createRef=function(){return{current:null}},Se.forwardRef=function(S){return{$$typeof:p,render:S}},Se.isValidElement=we,Se.lazy=function(S){return{$$typeof:k,_payload:{_status:-1,_result:S},_init:Ne}},Se.memo=function(S,D){return{$$typeof:y,type:S,compare:D===void 0?null:D}},Se.startTransition=function(S){var D=W.transition;W.transition={};try{S()}finally{W.transition=D}},Se.unstable_act=Y,Se.useCallback=function(S,D){return ce.current.useCallback(S,D)},Se.useContext=function(S){return ce.current.useContext(S)},Se.useDebugValue=function(){},Se.useDeferredValue=function(S){return ce.current.useDeferredValue(S)},Se.useEffect=function(S,D){return ce.current.useEffect(S,D)},Se.useId=function(){return ce.current.useId()},Se.useImperativeHandle=function(S,D,ae){return ce.current.useImperativeHandle(S,D,ae)},Se.useInsertionEffect=function(S,D){return ce.current.useInsertionEffect(S,D)},Se.useLayoutEffect=function(S,D){return ce.current.useLayoutEffect(S,D)},Se.useMemo=function(S,D){return ce.current.useMemo(S,D)},Se.useReducer=function(S,D,ae){return ce.current.useReducer(S,D,ae)},Se.useRef=function(S){return ce.current.useRef(S)},Se.useState=function(S){return ce.current.useState(S)},Se.useSyncExternalStore=function(S,D,ae){return ce.current.useSyncExternalStore(S,D,ae)},Se.useTransition=function(){return ce.current.useTransition()},Se.version="18.3.1",Se}var kd;function Do(){return kd||(kd=1,po.exports=B0()),po.exports}var Cd;function U0(){if(Cd)return Ks;Cd=1;var s=Do(),l=Symbol.for("react.element"),i=Symbol.for("react.fragment"),o=Object.prototype.hasOwnProperty,u=s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,m={key:!0,ref:!0,__self:!0,__source:!0};function h(p,x,y){var k,j={},E=null,I=null;y!==void 0&&(E=""+y),x.key!==void 0&&(E=""+x.key),x.ref!==void 0&&(I=x.ref);for(k in x)o.call(x,k)&&!m.hasOwnProperty(k)&&(j[k]=x[k]);if(p&&p.defaultProps)for(k in x=p.defaultProps,x)j[k]===void 0&&(j[k]=x[k]);return{$$typeof:l,type:p,key:E,ref:I,props:j,_owner:u.current}}return Ks.Fragment=i,Ks.jsx=h,Ks.jsxs=h,Ks}var Ed;function H0(){return Ed||(Ed=1,xo.exports=U0()),xo.exports}var t=H0(),ya={},go={exports:{}},jt={},yo={exports:{}},vo={};var Td;function V0(){return Td||(Td=1,(function(s){function l(W,se){var Y=W.length;W.push(se);e:for(;0<Y;){var S=Y-1>>>1,D=W[S];if(0<u(D,se))W[S]=se,W[Y]=D,Y=S;else break e}}function i(W){return W.length===0?null:W[0]}function o(W){if(W.length===0)return null;var se=W[0],Y=W.pop();if(Y!==se){W[0]=Y;e:for(var S=0,D=W.length,ae=D>>>1;S<ae;){var B=2*(S+1)-1,G=W[B],Z=B+1,ue=W[Z];if(0>u(G,Y))Z<D&&0>u(ue,G)?(W[S]=ue,W[Z]=Y,S=Z):(W[S]=G,W[B]=Y,S=B);else if(Z<D&&0>u(ue,Y))W[S]=ue,W[Z]=Y,S=Z;else break e}}return se}function u(W,se){var Y=W.sortIndex-se.sortIndex;return Y!==0?Y:W.id-se.id}if(typeof performance=="object"&&typeof performance.now=="function"){var m=performance;s.unstable_now=function(){return m.now()}}else{var h=Date,p=h.now();s.unstable_now=function(){return h.now()-p}}var x=[],y=[],k=1,j=null,E=3,I=!1,L=!1,A=!1,P=typeof setTimeout=="function"?setTimeout:null,O=typeof clearTimeout=="function"?clearTimeout:null,M=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function R(W){for(var se=i(y);se!==null;){if(se.callback===null)o(y);else if(se.startTime<=W)o(y),se.sortIndex=se.expirationTime,l(x,se);else break;se=i(y)}}function $(W){if(A=!1,R(W),!L)if(i(x)!==null)L=!0,Ne(J);else{var se=i(y);se!==null&&ce($,se.startTime-W)}}function J(W,se){L=!1,A&&(A=!1,O(pe),pe=-1),I=!0;var Y=E;try{for(R(se),j=i(x);j!==null&&(!(j.expirationTime>se)||W&&!X());){var S=j.callback;if(typeof S=="function"){j.callback=null,E=j.priorityLevel;var D=S(j.expirationTime<=se);se=s.unstable_now(),typeof D=="function"?j.callback=D:j===i(x)&&o(x),R(se)}else o(x);j=i(x)}if(j!==null)var ae=!0;else{var B=i(y);B!==null&&ce($,B.startTime-se),ae=!1}return ae}finally{j=null,E=Y,I=!1}}var ve=!1,ee=null,pe=-1,xe=5,we=-1;function X(){return!(s.unstable_now()-we<xe)}function he(){if(ee!==null){var W=s.unstable_now();we=W;var se=!0;try{se=ee(!0,W)}finally{se?ye():(ve=!1,ee=null)}}else ve=!1}var ye;if(typeof M=="function")ye=function(){M(he)};else if(typeof MessageChannel<"u"){var je=new MessageChannel,Pe=je.port2;je.port1.onmessage=he,ye=function(){Pe.postMessage(null)}}else ye=function(){P(he,0)};function Ne(W){ee=W,ve||(ve=!0,ye())}function ce(W,se){pe=P(function(){W(s.unstable_now())},se)}s.unstable_IdlePriority=5,s.unstable_ImmediatePriority=1,s.unstable_LowPriority=4,s.unstable_NormalPriority=3,s.unstable_Profiling=null,s.unstable_UserBlockingPriority=2,s.unstable_cancelCallback=function(W){W.callback=null},s.unstable_continueExecution=function(){L||I||(L=!0,Ne(J))},s.unstable_forceFrameRate=function(W){0>W||125<W?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):xe=0<W?Math.floor(1e3/W):5},s.unstable_getCurrentPriorityLevel=function(){return E},s.unstable_getFirstCallbackNode=function(){return i(x)},s.unstable_next=function(W){switch(E){case 1:case 2:case 3:var se=3;break;default:se=E}var Y=E;E=se;try{return W()}finally{E=Y}},s.unstable_pauseExecution=function(){},s.unstable_requestPaint=function(){},s.unstable_runWithPriority=function(W,se){switch(W){case 1:case 2:case 3:case 4:case 5:break;default:W=3}var Y=E;E=W;try{return se()}finally{E=Y}},s.unstable_scheduleCallback=function(W,se,Y){var S=s.unstable_now();switch(typeof Y=="object"&&Y!==null?(Y=Y.delay,Y=typeof Y=="number"&&0<Y?S+Y:S):Y=S,W){case 1:var D=-1;break;case 2:D=250;break;case 5:D=1073741823;break;case 4:D=1e4;break;default:D=5e3}return D=Y+D,W={id:k++,callback:se,priorityLevel:W,startTime:Y,expirationTime:D,sortIndex:-1},Y>S?(W.sortIndex=Y,l(y,W),i(x)===null&&W===i(y)&&(A?(O(pe),pe=-1):A=!0,ce($,Y-S))):(W.sortIndex=D,l(x,W),L||I||(L=!0,Ne(J))),W},s.unstable_shouldYield=X,s.unstable_wrapCallback=function(W){var se=E;return function(){var Y=E;E=se;try{return W.apply(this,arguments)}finally{E=Y}}}})(vo)),vo}var Pd;function W0(){return Pd||(Pd=1,yo.exports=V0()),yo.exports}var _d;function G0(){if(_d)return jt;_d=1;var s=Do(),l=W0();function i(e){for(var n="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r<arguments.length;r++)n+="&args[]="+encodeURIComponent(arguments[r]);return"Minified React error #"+e+"; visit "+n+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var o=new Set,u={};function m(e,n){h(e,n),h(e+"Capture",n)}function h(e,n){for(u[e]=n,e=0;e<n.length;e++)o.add(n[e])}var p=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),x=Object.prototype.hasOwnProperty,y=/^[: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]*$/,k={},j={};function E(e){return x.call(j,e)?!0:x.call(k,e)?!1:y.test(e)?j[e]=!0:(k[e]=!0,!1)}function I(e,n,r,a){if(r!==null&&r.type===0)return!1;switch(typeof n){case"function":case"symbol":return!0;case"boolean":return a?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function L(e,n,r,a){if(n===null||typeof n>"u"||I(e,n,r,a))return!0;if(a)return!1;if(r!==null)switch(r.type){case 3:return!n;case 4:return n===!1;case 5:return isNaN(n);case 6:return isNaN(n)||1>n}return!1}function A(e,n,r,a,c,d,f){this.acceptsBooleans=n===2||n===3||n===4,this.attributeName=a,this.attributeNamespace=c,this.mustUseProperty=r,this.propertyName=e,this.type=n,this.sanitizeURL=d,this.removeEmptyString=f}var P={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){P[e]=new A(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var n=e[0];P[n]=new A(n,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){P[e]=new A(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){P[e]=new A(e,2,!1,e,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){P[e]=new A(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){P[e]=new A(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){P[e]=new A(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){P[e]=new A(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){P[e]=new A(e,5,!1,e.toLowerCase(),null,!1,!1)});var O=/[\-:]([a-z])/g;function M(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var n=e.replace(O,M);P[n]=new A(n,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var n=e.replace(O,M);P[n]=new A(n,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var n=e.replace(O,M);P[n]=new A(n,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){P[e]=new A(e,1,!1,e.toLowerCase(),null,!1,!1)}),P.xlinkHref=new A("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){P[e]=new A(e,1,!1,e.toLowerCase(),null,!0,!0)});function R(e,n,r,a){var c=P.hasOwnProperty(n)?P[n]:null;(c!==null?c.type!==0:a||!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(L(n,r,c,a)&&(r=null),a||c===null?E(n)&&(r===null?e.removeAttribute(n):e.setAttribute(n,""+r)):c.mustUseProperty?e[c.propertyName]=r===null?c.type===3?!1:"":r:(n=c.attributeName,a=c.attributeNamespace,r===null?e.removeAttribute(n):(c=c.type,r=c===3||c===4&&r===!0?"":""+r,a?e.setAttributeNS(a,n,r):e.setAttribute(n,r))))}var $=s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,J=Symbol.for("react.element"),ve=Symbol.for("react.portal"),ee=Symbol.for("react.fragment"),pe=Symbol.for("react.strict_mode"),xe=Symbol.for("react.profiler"),we=Symbol.for("react.provider"),X=Symbol.for("react.context"),he=Symbol.for("react.forward_ref"),ye=Symbol.for("react.suspense"),je=Symbol.for("react.suspense_list"),Pe=Symbol.for("react.memo"),Ne=Symbol.for("react.lazy"),ce=Symbol.for("react.offscreen"),W=Symbol.iterator;function se(e){return e===null||typeof e!="object"?null:(e=W&&e[W]||e["@@iterator"],typeof e=="function"?e:null)}var Y=Object.assign,S;function D(e){if(S===void 0)try{throw Error()}catch(r){var n=r.stack.trim().match(/\n( *(at )?)/);S=n&&n[1]||""}return`
|
|
2
|
+
`+S+e}var ae=!1;function B(e,n){if(!e||ae)return"";ae=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(n)if(n=function(){throw Error()},Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(n,[])}catch(_){var a=_}Reflect.construct(e,[],n)}else{try{n.call()}catch(_){a=_}e.call(n.prototype)}else{try{throw Error()}catch(_){a=_}e()}}catch(_){if(_&&a&&typeof _.stack=="string"){for(var c=_.stack.split(`
|
|
3
|
+
`),d=a.stack.split(`
|
|
4
|
+
`),f=c.length-1,g=d.length-1;1<=f&&0<=g&&c[f]!==d[g];)g--;for(;1<=f&&0<=g;f--,g--)if(c[f]!==d[g]){if(f!==1||g!==1)do if(f--,g--,0>g||c[f]!==d[g]){var w=`
|
|
5
|
+
`+c[f].replace(" at new "," at ");return e.displayName&&w.includes("<anonymous>")&&(w=w.replace("<anonymous>",e.displayName)),w}while(1<=f&&0<=g);break}}}finally{ae=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?D(e):""}function G(e){switch(e.tag){case 5:return D(e.type);case 16:return D("Lazy");case 13:return D("Suspense");case 19:return D("SuspenseList");case 0:case 2:case 15:return e=B(e.type,!1),e;case 11:return e=B(e.type.render,!1),e;case 1:return e=B(e.type,!0),e;default:return""}}function Z(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case ee:return"Fragment";case ve:return"Portal";case xe:return"Profiler";case pe:return"StrictMode";case ye:return"Suspense";case je:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case X:return(e.displayName||"Context")+".Consumer";case we:return(e._context.displayName||"Context")+".Provider";case he:var n=e.render;return e=e.displayName,e||(e=n.displayName||n.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Pe:return n=e.displayName||null,n!==null?n:Z(e.type)||"Memo";case Ne:n=e._payload,e=e._init;try{return Z(e(n))}catch{}}return null}function ue(e){var n=e.type;switch(e.tag){case 24:return"Cache";case 9:return(n.displayName||"Context")+".Consumer";case 10:return(n._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=n.render,e=e.displayName||e.name||"",n.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return n;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Z(n);case 8:return n===pe?"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 n=="function")return n.displayName||n.name||null;if(typeof n=="string")return n}return null}function Q(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function ie(e){var n=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function Ee(e){var n=ie(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,n),a=""+e[n];if(!e.hasOwnProperty(n)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var c=r.get,d=r.set;return Object.defineProperty(e,n,{configurable:!0,get:function(){return c.call(this)},set:function(f){a=""+f,d.call(this,f)}}),Object.defineProperty(e,n,{enumerable:r.enumerable}),{getValue:function(){return a},setValue:function(f){a=""+f},stopTracking:function(){e._valueTracker=null,delete e[n]}}}}function wt(e){e._valueTracker||(e._valueTracker=Ee(e))}function qe(e){if(!e)return!1;var n=e._valueTracker;if(!n)return!0;var r=n.getValue(),a="";return e&&(a=ie(e)?e.checked?"true":"false":e.value),e=a,e!==r?(n.setValue(e),!0):!1}function Nt(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function tn(e,n){var r=n.checked;return Y({},n,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function et(e,n){var r=n.defaultValue==null?"":n.defaultValue,a=n.checked!=null?n.checked:n.defaultChecked;r=Q(n.value!=null?n.value:r),e._wrapperState={initialChecked:a,initialValue:r,controlled:n.type==="checkbox"||n.type==="radio"?n.checked!=null:n.value!=null}}function bt(e,n){n=n.checked,n!=null&&R(e,"checked",n,!1)}function nn(e,n){bt(e,n);var r=Q(n.value),a=n.type;if(r!=null)a==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(a==="submit"||a==="reset"){e.removeAttribute("value");return}n.hasOwnProperty("value")?Pn(e,n.type,r):n.hasOwnProperty("defaultValue")&&Pn(e,n.type,Q(n.defaultValue)),n.checked==null&&n.defaultChecked!=null&&(e.defaultChecked=!!n.defaultChecked)}function At(e,n,r){if(n.hasOwnProperty("value")||n.hasOwnProperty("defaultValue")){var a=n.type;if(!(a!=="submit"&&a!=="reset"||n.value!==void 0&&n.value!==null))return;n=""+e._wrapperState.initialValue,r||n===e.value||(e.value=n),e.defaultValue=n}r=e.name,r!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,r!==""&&(e.name=r)}function Pn(e,n,r){(n!=="number"||Nt(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var rn=Array.isArray;function hn(e,n,r,a){if(e=e.options,n){n={};for(var c=0;c<r.length;c++)n["$"+r[c]]=!0;for(r=0;r<e.length;r++)c=n.hasOwnProperty("$"+e[r].value),e[r].selected!==c&&(e[r].selected=c),c&&a&&(e[r].defaultSelected=!0)}else{for(r=""+Q(r),n=null,c=0;c<e.length;c++){if(e[c].value===r){e[c].selected=!0,a&&(e[c].defaultSelected=!0);return}n!==null||e[c].disabled||(n=e[c])}n!==null&&(n.selected=!0)}}function Tr(e,n){if(n.dangerouslySetInnerHTML!=null)throw Error(i(91));return Y({},n,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function ol(e,n){var r=n.value;if(r==null){if(r=n.children,n=n.defaultValue,r!=null){if(n!=null)throw Error(i(92));if(rn(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n==null&&(n=""),r=n}e._wrapperState={initialValue:Q(r)}}function Pr(e,n){var r=Q(n.value),a=Q(n.defaultValue);r!=null&&(r=""+r,r!==e.value&&(e.value=r),n.defaultValue==null&&e.defaultValue!==r&&(e.defaultValue=r)),a!=null&&(e.defaultValue=""+a)}function _n(e){var n=e.textContent;n===e._wrapperState.initialValue&&n!==""&&n!==null&&(e.value=n)}function fn(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function ft(e,n){return e==null||e==="http://www.w3.org/1999/xhtml"?fn(n):e==="http://www.w3.org/2000/svg"&&n==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Ln,os=(function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(n,r,a,c){MSApp.execUnsafeLocalFunction(function(){return e(n,r,a,c)})}:e})(function(e,n){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=n;else{for(Ln=Ln||document.createElement("div"),Ln.innerHTML="<svg>"+n.valueOf().toString()+"</svg>",n=Ln.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;n.firstChild;)e.appendChild(n.firstChild)}});function An(e,n){if(n){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=n;return}}e.textContent=n}var xn={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},cl=["Webkit","ms","Moz","O"];Object.keys(xn).forEach(function(e){cl.forEach(function(n){n=n+e.charAt(0).toUpperCase()+e.substring(1),xn[n]=xn[e]})});function ar(e,n,r){return n==null||typeof n=="boolean"||n===""?"":r||typeof n!="number"||n===0||xn.hasOwnProperty(e)&&xn[e]?(""+n).trim():n+"px"}function ir(e,n){e=e.style;for(var r in n)if(n.hasOwnProperty(r)){var a=r.indexOf("--")===0,c=ar(r,n[r],a);r==="float"&&(r="cssFloat"),a?e.setProperty(r,c):e[r]=c}}var Ht=Y({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 sn(e,n){if(n){if(Ht[e]&&(n.children!=null||n.dangerouslySetInnerHTML!=null))throw Error(i(137,e));if(n.dangerouslySetInnerHTML!=null){if(n.children!=null)throw Error(i(60));if(typeof n.dangerouslySetInnerHTML!="object"||!("__html"in n.dangerouslySetInnerHTML))throw Error(i(61))}if(n.style!=null&&typeof n.style!="object")throw Error(i(62))}}function or(e,n){if(e.indexOf("-")===-1)return typeof n.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var cr=null;function cs(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Rn=null,Vt=null,Mn=null;function In(e){if(e=Ms(e)){if(typeof Rn!="function")throw Error(i(280));var n=e.stateNode;n&&(n=Rl(n),Rn(e.stateNode,e.type,n))}}function ul(e){Vt?Mn?Mn.push(e):Mn=[e]:Vt=e}function dl(){if(Vt){var e=Vt,n=Mn;if(Mn=Vt=null,In(e),n)for(e=0;e<n.length;e++)In(n[e])}}function Fe(e,n){return e(n)}function pn(){}var us=!1;function ds(e,n,r){if(us)return e(n,r);us=!0;try{return Fe(e,n,r)}finally{us=!1,(Vt!==null||Mn!==null)&&(pn(),dl())}}function gn(e,n){var r=e.stateNode;if(r===null)return null;var a=Rl(r);if(a===null)return null;r=a[n];e:switch(n){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(a=!a.disabled)||(e=e.type,a=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!a;break e;default:e=!1}if(e)return null;if(r&&typeof r!="function")throw Error(i(231,n,typeof r));return r}var _r=!1;if(p)try{var On={};Object.defineProperty(On,"passive",{get:function(){_r=!0}}),window.addEventListener("test",On,On),window.removeEventListener("test",On,On)}catch{_r=!1}function Ma(e,n,r,a,c,d,f,g,w){var _=Array.prototype.slice.call(arguments,3);try{n.apply(r,_)}catch(z){this.onError(z)}}var rt=!1,Rt=null,ur=!1,Lr=null,ms={onError:function(e){rt=!0,Rt=e}};function ml(e,n,r,a,c,d,f,g,w){rt=!1,Rt=null,Ma.apply(ms,arguments)}function Wt(e,n,r,a,c,d,f,g,w){if(ml.apply(this,arguments),rt){if(rt){var _=Rt;rt=!1,Rt=null}else throw Error(i(198));ur||(ur=!0,Lr=_)}}function ln(e){var n=e,r=e;if(e.alternate)for(;n.return;)n=n.return;else{e=n;do n=e,(n.flags&4098)!==0&&(r=n.return),e=n.return;while(e)}return n.tag===3?r:null}function hs(e){if(e.tag===13){var n=e.memoizedState;if(n===null&&(e=e.alternate,e!==null&&(n=e.memoizedState)),n!==null)return n.dehydrated}return null}function fs(e){if(ln(e)!==e)throw Error(i(188))}function hl(e){var n=e.alternate;if(!n){if(n=ln(e),n===null)throw Error(i(188));return n!==e?null:e}for(var r=e,a=n;;){var c=r.return;if(c===null)break;var d=c.alternate;if(d===null){if(a=c.return,a!==null){r=a;continue}break}if(c.child===d.child){for(d=c.child;d;){if(d===r)return fs(c),e;if(d===a)return fs(c),n;d=d.sibling}throw Error(i(188))}if(r.return!==a.return)r=c,a=d;else{for(var f=!1,g=c.child;g;){if(g===r){f=!0,r=c,a=d;break}if(g===a){f=!0,a=c,r=d;break}g=g.sibling}if(!f){for(g=d.child;g;){if(g===r){f=!0,r=d,a=c;break}if(g===a){f=!0,a=d,r=c;break}g=g.sibling}if(!f)throw Error(i(189))}}if(r.alternate!==a)throw Error(i(190))}if(r.tag!==3)throw Error(i(188));return r.stateNode.current===r?e:n}function fl(e){return e=hl(e),e!==null?oe(e):null}function oe(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var n=oe(e);if(n!==null)return n;e=e.sibling}return null}var N=l.unstable_scheduleCallback,H=l.unstable_cancelCallback,ne=l.unstable_shouldYield,Le=l.unstable_requestPaint,be=l.unstable_now,ze=l.unstable_getCurrentPriorityLevel,Qe=l.unstable_ImmediatePriority,Mt=l.unstable_UserBlockingPriority,Gt=l.unstable_NormalPriority,xs=l.unstable_LowPriority,He=l.unstable_IdlePriority,dr=null,St=null;function eh(e){if(St&&typeof St.onCommitFiberRoot=="function")try{St.onCommitFiberRoot(dr,e,void 0,(e.current.flags&128)===128)}catch{}}var Yt=Math.clz32?Math.clz32:rh,th=Math.log,nh=Math.LN2;function rh(e){return e>>>=0,e===0?32:31-(th(e)/nh|0)|0}var xl=64,pl=4194304;function ps(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function gl(e,n){var r=e.pendingLanes;if(r===0)return 0;var a=0,c=e.suspendedLanes,d=e.pingedLanes,f=r&268435455;if(f!==0){var g=f&~c;g!==0?a=ps(g):(d&=f,d!==0&&(a=ps(d)))}else f=r&~c,f!==0?a=ps(f):d!==0&&(a=ps(d));if(a===0)return 0;if(n!==0&&n!==a&&(n&c)===0&&(c=a&-a,d=n&-n,c>=d||c===16&&(d&4194240)!==0))return n;if((a&4)!==0&&(a|=r&16),n=e.entangledLanes,n!==0)for(e=e.entanglements,n&=a;0<n;)r=31-Yt(n),c=1<<r,a|=e[r],n&=~c;return a}function sh(e,n){switch(e){case 1:case 2:case 4:return n+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 n+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 lh(e,n){for(var r=e.suspendedLanes,a=e.pingedLanes,c=e.expirationTimes,d=e.pendingLanes;0<d;){var f=31-Yt(d),g=1<<f,w=c[f];w===-1?((g&r)===0||(g&a)!==0)&&(c[f]=sh(g,n)):w<=n&&(e.expiredLanes|=g),d&=~g}}function Ia(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function tc(){var e=xl;return xl<<=1,(xl&4194240)===0&&(xl=64),e}function Oa(e){for(var n=[],r=0;31>r;r++)n.push(e);return n}function gs(e,n,r){e.pendingLanes|=n,n!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,n=31-Yt(n),e[n]=r}function ah(e,n){var r=e.pendingLanes&~n;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=n,e.mutableReadLanes&=n,e.entangledLanes&=n,n=e.entanglements;var a=e.eventTimes;for(e=e.expirationTimes;0<r;){var c=31-Yt(r),d=1<<c;n[c]=0,a[c]=-1,e[c]=-1,r&=~d}}function Da(e,n){var r=e.entangledLanes|=n;for(e=e.entanglements;r;){var a=31-Yt(r),c=1<<a;c&n|e[a]&n&&(e[a]|=n),r&=~c}}var _e=0;function nc(e){return e&=-e,1<e?4<e?(e&268435455)!==0?16:536870912:4:1}var rc,Fa,sc,lc,ac,za=!1,yl=[],Dn=null,Fn=null,zn=null,ys=new Map,vs=new Map,$n=[],ih="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 ic(e,n){switch(e){case"focusin":case"focusout":Dn=null;break;case"dragenter":case"dragleave":Fn=null;break;case"mouseover":case"mouseout":zn=null;break;case"pointerover":case"pointerout":ys.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":vs.delete(n.pointerId)}}function js(e,n,r,a,c,d){return e===null||e.nativeEvent!==d?(e={blockedOn:n,domEventName:r,eventSystemFlags:a,nativeEvent:d,targetContainers:[c]},n!==null&&(n=Ms(n),n!==null&&Fa(n)),e):(e.eventSystemFlags|=a,n=e.targetContainers,c!==null&&n.indexOf(c)===-1&&n.push(c),e)}function oh(e,n,r,a,c){switch(n){case"focusin":return Dn=js(Dn,e,n,r,a,c),!0;case"dragenter":return Fn=js(Fn,e,n,r,a,c),!0;case"mouseover":return zn=js(zn,e,n,r,a,c),!0;case"pointerover":var d=c.pointerId;return ys.set(d,js(ys.get(d)||null,e,n,r,a,c)),!0;case"gotpointercapture":return d=c.pointerId,vs.set(d,js(vs.get(d)||null,e,n,r,a,c)),!0}return!1}function oc(e){var n=mr(e.target);if(n!==null){var r=ln(n);if(r!==null){if(n=r.tag,n===13){if(n=hs(r),n!==null){e.blockedOn=n,ac(e.priority,function(){sc(r)});return}}else if(n===3&&r.stateNode.current.memoizedState.isDehydrated){e.blockedOn=r.tag===3?r.stateNode.containerInfo:null;return}}}e.blockedOn=null}function vl(e){if(e.blockedOn!==null)return!1;for(var n=e.targetContainers;0<n.length;){var r=Ba(e.domEventName,e.eventSystemFlags,n[0],e.nativeEvent);if(r===null){r=e.nativeEvent;var a=new r.constructor(r.type,r);cr=a,r.target.dispatchEvent(a),cr=null}else return n=Ms(r),n!==null&&Fa(n),e.blockedOn=r,!1;n.shift()}return!0}function cc(e,n,r){vl(e)&&r.delete(n)}function ch(){za=!1,Dn!==null&&vl(Dn)&&(Dn=null),Fn!==null&&vl(Fn)&&(Fn=null),zn!==null&&vl(zn)&&(zn=null),ys.forEach(cc),vs.forEach(cc)}function ws(e,n){e.blockedOn===n&&(e.blockedOn=null,za||(za=!0,l.unstable_scheduleCallback(l.unstable_NormalPriority,ch)))}function Ns(e){function n(c){return ws(c,e)}if(0<yl.length){ws(yl[0],e);for(var r=1;r<yl.length;r++){var a=yl[r];a.blockedOn===e&&(a.blockedOn=null)}}for(Dn!==null&&ws(Dn,e),Fn!==null&&ws(Fn,e),zn!==null&&ws(zn,e),ys.forEach(n),vs.forEach(n),r=0;r<$n.length;r++)a=$n[r],a.blockedOn===e&&(a.blockedOn=null);for(;0<$n.length&&(r=$n[0],r.blockedOn===null);)oc(r),r.blockedOn===null&&$n.shift()}var Ar=$.ReactCurrentBatchConfig,jl=!0;function uh(e,n,r,a){var c=_e,d=Ar.transition;Ar.transition=null;try{_e=1,$a(e,n,r,a)}finally{_e=c,Ar.transition=d}}function dh(e,n,r,a){var c=_e,d=Ar.transition;Ar.transition=null;try{_e=4,$a(e,n,r,a)}finally{_e=c,Ar.transition=d}}function $a(e,n,r,a){if(jl){var c=Ba(e,n,r,a);if(c===null)si(e,n,a,wl,r),ic(e,a);else if(oh(c,e,n,r,a))a.stopPropagation();else if(ic(e,a),n&4&&-1<ih.indexOf(e)){for(;c!==null;){var d=Ms(c);if(d!==null&&rc(d),d=Ba(e,n,r,a),d===null&&si(e,n,a,wl,r),d===c)break;c=d}c!==null&&a.stopPropagation()}else si(e,n,a,null,r)}}var wl=null;function Ba(e,n,r,a){if(wl=null,e=cs(a),e=mr(e),e!==null)if(n=ln(e),n===null)e=null;else if(r=n.tag,r===13){if(e=hs(n),e!==null)return e;e=null}else if(r===3){if(n.stateNode.current.memoizedState.isDehydrated)return n.tag===3?n.stateNode.containerInfo:null;e=null}else n!==e&&(e=null);return wl=e,null}function uc(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(ze()){case Qe:return 1;case Mt:return 4;case Gt:case xs:return 16;case He:return 536870912;default:return 16}default:return 16}}var Bn=null,Ua=null,Nl=null;function dc(){if(Nl)return Nl;var e,n=Ua,r=n.length,a,c="value"in Bn?Bn.value:Bn.textContent,d=c.length;for(e=0;e<r&&n[e]===c[e];e++);var f=r-e;for(a=1;a<=f&&n[r-a]===c[d-a];a++);return Nl=c.slice(e,1<a?1-a:void 0)}function bl(e){var n=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&n===13&&(e=13)):e=n,e===10&&(e=13),32<=e||e===13?e:0}function Sl(){return!0}function mc(){return!1}function kt(e){function n(r,a,c,d,f){this._reactName=r,this._targetInst=c,this.type=a,this.nativeEvent=d,this.target=f,this.currentTarget=null;for(var g in e)e.hasOwnProperty(g)&&(r=e[g],this[g]=r?r(d):d[g]);return this.isDefaultPrevented=(d.defaultPrevented!=null?d.defaultPrevented:d.returnValue===!1)?Sl:mc,this.isPropagationStopped=mc,this}return Y(n.prototype,{preventDefault:function(){this.defaultPrevented=!0;var r=this.nativeEvent;r&&(r.preventDefault?r.preventDefault():typeof r.returnValue!="unknown"&&(r.returnValue=!1),this.isDefaultPrevented=Sl)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=Sl)},persist:function(){},isPersistent:Sl}),n}var Rr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ha=kt(Rr),bs=Y({},Rr,{view:0,detail:0}),mh=kt(bs),Va,Wa,Ss,kl=Y({},bs,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ya,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Ss&&(Ss&&e.type==="mousemove"?(Va=e.screenX-Ss.screenX,Wa=e.screenY-Ss.screenY):Wa=Va=0,Ss=e),Va)},movementY:function(e){return"movementY"in e?e.movementY:Wa}}),hc=kt(kl),hh=Y({},kl,{dataTransfer:0}),fh=kt(hh),xh=Y({},bs,{relatedTarget:0}),Ga=kt(xh),ph=Y({},Rr,{animationName:0,elapsedTime:0,pseudoElement:0}),gh=kt(ph),yh=Y({},Rr,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),vh=kt(yh),jh=Y({},Rr,{data:0}),fc=kt(jh),wh={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Nh={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"},bh={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Sh(e){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(e):(e=bh[e])?!!n[e]:!1}function Ya(){return Sh}var kh=Y({},bs,{key:function(e){if(e.key){var n=wh[e.key]||e.key;if(n!=="Unidentified")return n}return e.type==="keypress"?(e=bl(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Nh[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ya,charCode:function(e){return e.type==="keypress"?bl(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?bl(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Ch=kt(kh),Eh=Y({},kl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),xc=kt(Eh),Th=Y({},bs,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ya}),Ph=kt(Th),_h=Y({},Rr,{propertyName:0,elapsedTime:0,pseudoElement:0}),Lh=kt(_h),Ah=Y({},kl,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),Rh=kt(Ah),Mh=[9,13,27,32],Qa=p&&"CompositionEvent"in window,ks=null;p&&"documentMode"in document&&(ks=document.documentMode);var Ih=p&&"TextEvent"in window&&!ks,pc=p&&(!Qa||ks&&8<ks&&11>=ks),gc=" ",yc=!1;function vc(e,n){switch(e){case"keyup":return Mh.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function jc(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Mr=!1;function Oh(e,n){switch(e){case"compositionend":return jc(n);case"keypress":return n.which!==32?null:(yc=!0,gc);case"textInput":return e=n.data,e===gc&&yc?null:e;default:return null}}function Dh(e,n){if(Mr)return e==="compositionend"||!Qa&&vc(e,n)?(e=dc(),Nl=Ua=Bn=null,Mr=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1<n.char.length)return n.char;if(n.which)return String.fromCharCode(n.which)}return null;case"compositionend":return pc&&n.locale!=="ko"?null:n.data;default:return null}}var Fh={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 wc(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n==="input"?!!Fh[e.type]:n==="textarea"}function Nc(e,n,r,a){ul(a),n=_l(n,"onChange"),0<n.length&&(r=new Ha("onChange","change",null,r,a),e.push({event:r,listeners:n}))}var Cs=null,Es=null;function zh(e){$c(e,0)}function Cl(e){var n=zr(e);if(qe(n))return e}function $h(e,n){if(e==="change")return n}var bc=!1;if(p){var Ka;if(p){var Xa="oninput"in document;if(!Xa){var Sc=document.createElement("div");Sc.setAttribute("oninput","return;"),Xa=typeof Sc.oninput=="function"}Ka=Xa}else Ka=!1;bc=Ka&&(!document.documentMode||9<document.documentMode)}function kc(){Cs&&(Cs.detachEvent("onpropertychange",Cc),Es=Cs=null)}function Cc(e){if(e.propertyName==="value"&&Cl(Es)){var n=[];Nc(n,Es,e,cs(e)),ds(zh,n)}}function Bh(e,n,r){e==="focusin"?(kc(),Cs=n,Es=r,Cs.attachEvent("onpropertychange",Cc)):e==="focusout"&&kc()}function Uh(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Cl(Es)}function Hh(e,n){if(e==="click")return Cl(n)}function Vh(e,n){if(e==="input"||e==="change")return Cl(n)}function Wh(e,n){return e===n&&(e!==0||1/e===1/n)||e!==e&&n!==n}var Qt=typeof Object.is=="function"?Object.is:Wh;function Ts(e,n){if(Qt(e,n))return!0;if(typeof e!="object"||e===null||typeof n!="object"||n===null)return!1;var r=Object.keys(e),a=Object.keys(n);if(r.length!==a.length)return!1;for(a=0;a<r.length;a++){var c=r[a];if(!x.call(n,c)||!Qt(e[c],n[c]))return!1}return!0}function Ec(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Tc(e,n){var r=Ec(e);e=0;for(var a;r;){if(r.nodeType===3){if(a=e+r.textContent.length,e<=n&&a>=n)return{node:r,offset:n-e};e=a}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=Ec(r)}}function Pc(e,n){return e&&n?e===n?!0:e&&e.nodeType===3?!1:n&&n.nodeType===3?Pc(e,n.parentNode):"contains"in e?e.contains(n):e.compareDocumentPosition?!!(e.compareDocumentPosition(n)&16):!1:!1}function _c(){for(var e=window,n=Nt();n instanceof e.HTMLIFrameElement;){try{var r=typeof n.contentWindow.location.href=="string"}catch{r=!1}if(r)e=n.contentWindow;else break;n=Nt(e.document)}return n}function Za(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n&&(n==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||n==="textarea"||e.contentEditable==="true")}function Gh(e){var n=_c(),r=e.focusedElem,a=e.selectionRange;if(n!==r&&r&&r.ownerDocument&&Pc(r.ownerDocument.documentElement,r)){if(a!==null&&Za(r)){if(n=a.start,e=a.end,e===void 0&&(e=n),"selectionStart"in r)r.selectionStart=n,r.selectionEnd=Math.min(e,r.value.length);else if(e=(n=r.ownerDocument||document)&&n.defaultView||window,e.getSelection){e=e.getSelection();var c=r.textContent.length,d=Math.min(a.start,c);a=a.end===void 0?d:Math.min(a.end,c),!e.extend&&d>a&&(c=a,a=d,d=c),c=Tc(r,d);var f=Tc(r,a);c&&f&&(e.rangeCount!==1||e.anchorNode!==c.node||e.anchorOffset!==c.offset||e.focusNode!==f.node||e.focusOffset!==f.offset)&&(n=n.createRange(),n.setStart(c.node,c.offset),e.removeAllRanges(),d>a?(e.addRange(n),e.extend(f.node,f.offset)):(n.setEnd(f.node,f.offset),e.addRange(n)))}}for(n=[],e=r;e=e.parentNode;)e.nodeType===1&&n.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r<n.length;r++)e=n[r],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var Yh=p&&"documentMode"in document&&11>=document.documentMode,Ir=null,Ja=null,Ps=null,qa=!1;function Lc(e,n,r){var a=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;qa||Ir==null||Ir!==Nt(a)||(a=Ir,"selectionStart"in a&&Za(a)?a={start:a.selectionStart,end:a.selectionEnd}:(a=(a.ownerDocument&&a.ownerDocument.defaultView||window).getSelection(),a={anchorNode:a.anchorNode,anchorOffset:a.anchorOffset,focusNode:a.focusNode,focusOffset:a.focusOffset}),Ps&&Ts(Ps,a)||(Ps=a,a=_l(Ja,"onSelect"),0<a.length&&(n=new Ha("onSelect","select",null,n,r),e.push({event:n,listeners:a}),n.target=Ir)))}function El(e,n){var r={};return r[e.toLowerCase()]=n.toLowerCase(),r["Webkit"+e]="webkit"+n,r["Moz"+e]="moz"+n,r}var Or={animationend:El("Animation","AnimationEnd"),animationiteration:El("Animation","AnimationIteration"),animationstart:El("Animation","AnimationStart"),transitionend:El("Transition","TransitionEnd")},ei={},Ac={};p&&(Ac=document.createElement("div").style,"AnimationEvent"in window||(delete Or.animationend.animation,delete Or.animationiteration.animation,delete Or.animationstart.animation),"TransitionEvent"in window||delete Or.transitionend.transition);function Tl(e){if(ei[e])return ei[e];if(!Or[e])return e;var n=Or[e],r;for(r in n)if(n.hasOwnProperty(r)&&r in Ac)return ei[e]=n[r];return e}var Rc=Tl("animationend"),Mc=Tl("animationiteration"),Ic=Tl("animationstart"),Oc=Tl("transitionend"),Dc=new Map,Fc="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 Un(e,n){Dc.set(e,n),m(n,[e])}for(var ti=0;ti<Fc.length;ti++){var ni=Fc[ti],Qh=ni.toLowerCase(),Kh=ni[0].toUpperCase()+ni.slice(1);Un(Qh,"on"+Kh)}Un(Rc,"onAnimationEnd"),Un(Mc,"onAnimationIteration"),Un(Ic,"onAnimationStart"),Un("dblclick","onDoubleClick"),Un("focusin","onFocus"),Un("focusout","onBlur"),Un(Oc,"onTransitionEnd"),h("onMouseEnter",["mouseout","mouseover"]),h("onMouseLeave",["mouseout","mouseover"]),h("onPointerEnter",["pointerout","pointerover"]),h("onPointerLeave",["pointerout","pointerover"]),m("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),m("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),m("onBeforeInput",["compositionend","keypress","textInput","paste"]),m("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),m("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),m("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var _s="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(" "),Xh=new Set("cancel close invalid load scroll toggle".split(" ").concat(_s));function zc(e,n,r){var a=e.type||"unknown-event";e.currentTarget=r,Wt(a,n,void 0,e),e.currentTarget=null}function $c(e,n){n=(n&4)!==0;for(var r=0;r<e.length;r++){var a=e[r],c=a.event;a=a.listeners;e:{var d=void 0;if(n)for(var f=a.length-1;0<=f;f--){var g=a[f],w=g.instance,_=g.currentTarget;if(g=g.listener,w!==d&&c.isPropagationStopped())break e;zc(c,g,_),d=w}else for(f=0;f<a.length;f++){if(g=a[f],w=g.instance,_=g.currentTarget,g=g.listener,w!==d&&c.isPropagationStopped())break e;zc(c,g,_),d=w}}}if(ur)throw e=Lr,ur=!1,Lr=null,e}function Re(e,n){var r=n[ui];r===void 0&&(r=n[ui]=new Set);var a=e+"__bubble";r.has(a)||(Bc(n,e,2,!1),r.add(a))}function ri(e,n,r){var a=0;n&&(a|=4),Bc(r,e,a,n)}var Pl="_reactListening"+Math.random().toString(36).slice(2);function Ls(e){if(!e[Pl]){e[Pl]=!0,o.forEach(function(r){r!=="selectionchange"&&(Xh.has(r)||ri(r,!1,e),ri(r,!0,e))});var n=e.nodeType===9?e:e.ownerDocument;n===null||n[Pl]||(n[Pl]=!0,ri("selectionchange",!1,n))}}function Bc(e,n,r,a){switch(uc(n)){case 1:var c=uh;break;case 4:c=dh;break;default:c=$a}r=c.bind(null,n,r,e),c=void 0,!_r||n!=="touchstart"&&n!=="touchmove"&&n!=="wheel"||(c=!0),a?c!==void 0?e.addEventListener(n,r,{capture:!0,passive:c}):e.addEventListener(n,r,!0):c!==void 0?e.addEventListener(n,r,{passive:c}):e.addEventListener(n,r,!1)}function si(e,n,r,a,c){var d=a;if((n&1)===0&&(n&2)===0&&a!==null)e:for(;;){if(a===null)return;var f=a.tag;if(f===3||f===4){var g=a.stateNode.containerInfo;if(g===c||g.nodeType===8&&g.parentNode===c)break;if(f===4)for(f=a.return;f!==null;){var w=f.tag;if((w===3||w===4)&&(w=f.stateNode.containerInfo,w===c||w.nodeType===8&&w.parentNode===c))return;f=f.return}for(;g!==null;){if(f=mr(g),f===null)return;if(w=f.tag,w===5||w===6){a=d=f;continue e}g=g.parentNode}}a=a.return}ds(function(){var _=d,z=cs(r),U=[];e:{var F=Dc.get(e);if(F!==void 0){var K=Ha,te=e;switch(e){case"keypress":if(bl(r)===0)break e;case"keydown":case"keyup":K=Ch;break;case"focusin":te="focus",K=Ga;break;case"focusout":te="blur",K=Ga;break;case"beforeblur":case"afterblur":K=Ga;break;case"click":if(r.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":K=hc;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":K=fh;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":K=Ph;break;case Rc:case Mc:case Ic:K=gh;break;case Oc:K=Lh;break;case"scroll":K=mh;break;case"wheel":K=Rh;break;case"copy":case"cut":case"paste":K=vh;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":K=xc}var re=(n&4)!==0,Be=!re&&e==="scroll",C=re?F!==null?F+"Capture":null:F;re=[];for(var b=_,T;b!==null;){T=b;var V=T.stateNode;if(T.tag===5&&V!==null&&(T=V,C!==null&&(V=gn(b,C),V!=null&&re.push(As(b,V,T)))),Be)break;b=b.return}0<re.length&&(F=new K(F,te,null,r,z),U.push({event:F,listeners:re}))}}if((n&7)===0){e:{if(F=e==="mouseover"||e==="pointerover",K=e==="mouseout"||e==="pointerout",F&&r!==cr&&(te=r.relatedTarget||r.fromElement)&&(mr(te)||te[yn]))break e;if((K||F)&&(F=z.window===z?z:(F=z.ownerDocument)?F.defaultView||F.parentWindow:window,K?(te=r.relatedTarget||r.toElement,K=_,te=te?mr(te):null,te!==null&&(Be=ln(te),te!==Be||te.tag!==5&&te.tag!==6)&&(te=null)):(K=null,te=_),K!==te)){if(re=hc,V="onMouseLeave",C="onMouseEnter",b="mouse",(e==="pointerout"||e==="pointerover")&&(re=xc,V="onPointerLeave",C="onPointerEnter",b="pointer"),Be=K==null?F:zr(K),T=te==null?F:zr(te),F=new re(V,b+"leave",K,r,z),F.target=Be,F.relatedTarget=T,V=null,mr(z)===_&&(re=new re(C,b+"enter",te,r,z),re.target=T,re.relatedTarget=Be,V=re),Be=V,K&&te)t:{for(re=K,C=te,b=0,T=re;T;T=Dr(T))b++;for(T=0,V=C;V;V=Dr(V))T++;for(;0<b-T;)re=Dr(re),b--;for(;0<T-b;)C=Dr(C),T--;for(;b--;){if(re===C||C!==null&&re===C.alternate)break t;re=Dr(re),C=Dr(C)}re=null}else re=null;K!==null&&Uc(U,F,K,re,!1),te!==null&&Be!==null&&Uc(U,Be,te,re,!0)}}e:{if(F=_?zr(_):window,K=F.nodeName&&F.nodeName.toLowerCase(),K==="select"||K==="input"&&F.type==="file")var le=$h;else if(wc(F))if(bc)le=Vh;else{le=Uh;var de=Bh}else(K=F.nodeName)&&K.toLowerCase()==="input"&&(F.type==="checkbox"||F.type==="radio")&&(le=Hh);if(le&&(le=le(e,_))){Nc(U,le,r,z);break e}de&&de(e,F,_),e==="focusout"&&(de=F._wrapperState)&&de.controlled&&F.type==="number"&&Pn(F,"number",F.value)}switch(de=_?zr(_):window,e){case"focusin":(wc(de)||de.contentEditable==="true")&&(Ir=de,Ja=_,Ps=null);break;case"focusout":Ps=Ja=Ir=null;break;case"mousedown":qa=!0;break;case"contextmenu":case"mouseup":case"dragend":qa=!1,Lc(U,r,z);break;case"selectionchange":if(Yh)break;case"keydown":case"keyup":Lc(U,r,z)}var me;if(Qa)e:{switch(e){case"compositionstart":var ge="onCompositionStart";break e;case"compositionend":ge="onCompositionEnd";break e;case"compositionupdate":ge="onCompositionUpdate";break e}ge=void 0}else Mr?vc(e,r)&&(ge="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&(ge="onCompositionStart");ge&&(pc&&r.locale!=="ko"&&(Mr||ge!=="onCompositionStart"?ge==="onCompositionEnd"&&Mr&&(me=dc()):(Bn=z,Ua="value"in Bn?Bn.value:Bn.textContent,Mr=!0)),de=_l(_,ge),0<de.length&&(ge=new fc(ge,e,null,r,z),U.push({event:ge,listeners:de}),me?ge.data=me:(me=jc(r),me!==null&&(ge.data=me)))),(me=Ih?Oh(e,r):Dh(e,r))&&(_=_l(_,"onBeforeInput"),0<_.length&&(z=new fc("onBeforeInput","beforeinput",null,r,z),U.push({event:z,listeners:_}),z.data=me))}$c(U,n)})}function As(e,n,r){return{instance:e,listener:n,currentTarget:r}}function _l(e,n){for(var r=n+"Capture",a=[];e!==null;){var c=e,d=c.stateNode;c.tag===5&&d!==null&&(c=d,d=gn(e,r),d!=null&&a.unshift(As(e,d,c)),d=gn(e,n),d!=null&&a.push(As(e,d,c))),e=e.return}return a}function Dr(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Uc(e,n,r,a,c){for(var d=n._reactName,f=[];r!==null&&r!==a;){var g=r,w=g.alternate,_=g.stateNode;if(w!==null&&w===a)break;g.tag===5&&_!==null&&(g=_,c?(w=gn(r,d),w!=null&&f.unshift(As(r,w,g))):c||(w=gn(r,d),w!=null&&f.push(As(r,w,g)))),r=r.return}f.length!==0&&e.push({event:n,listeners:f})}var Zh=/\r\n?/g,Jh=/\u0000|\uFFFD/g;function Hc(e){return(typeof e=="string"?e:""+e).replace(Zh,`
|
|
6
|
+
`).replace(Jh,"")}function Ll(e,n,r){if(n=Hc(n),Hc(e)!==n&&r)throw Error(i(425))}function Al(){}var li=null,ai=null;function ii(e,n){return e==="textarea"||e==="noscript"||typeof n.children=="string"||typeof n.children=="number"||typeof n.dangerouslySetInnerHTML=="object"&&n.dangerouslySetInnerHTML!==null&&n.dangerouslySetInnerHTML.__html!=null}var oi=typeof setTimeout=="function"?setTimeout:void 0,qh=typeof clearTimeout=="function"?clearTimeout:void 0,Vc=typeof Promise=="function"?Promise:void 0,e0=typeof queueMicrotask=="function"?queueMicrotask:typeof Vc<"u"?function(e){return Vc.resolve(null).then(e).catch(t0)}:oi;function t0(e){setTimeout(function(){throw e})}function ci(e,n){var r=n,a=0;do{var c=r.nextSibling;if(e.removeChild(r),c&&c.nodeType===8)if(r=c.data,r==="/$"){if(a===0){e.removeChild(c),Ns(n);return}a--}else r!=="$"&&r!=="$?"&&r!=="$!"||a++;r=c}while(r);Ns(n)}function Hn(e){for(;e!=null;e=e.nextSibling){var n=e.nodeType;if(n===1||n===3)break;if(n===8){if(n=e.data,n==="$"||n==="$!"||n==="$?")break;if(n==="/$")return null}}return e}function Wc(e){e=e.previousSibling;for(var n=0;e;){if(e.nodeType===8){var r=e.data;if(r==="$"||r==="$!"||r==="$?"){if(n===0)return e;n--}else r==="/$"&&n++}e=e.previousSibling}return null}var Fr=Math.random().toString(36).slice(2),an="__reactFiber$"+Fr,Rs="__reactProps$"+Fr,yn="__reactContainer$"+Fr,ui="__reactEvents$"+Fr,n0="__reactListeners$"+Fr,r0="__reactHandles$"+Fr;function mr(e){var n=e[an];if(n)return n;for(var r=e.parentNode;r;){if(n=r[yn]||r[an]){if(r=n.alternate,n.child!==null||r!==null&&r.child!==null)for(e=Wc(e);e!==null;){if(r=e[an])return r;e=Wc(e)}return n}e=r,r=e.parentNode}return null}function Ms(e){return e=e[an]||e[yn],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function zr(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(i(33))}function Rl(e){return e[Rs]||null}var di=[],$r=-1;function Vn(e){return{current:e}}function Me(e){0>$r||(e.current=di[$r],di[$r]=null,$r--)}function Ae(e,n){$r++,di[$r]=e.current,e.current=n}var Wn={},st=Vn(Wn),xt=Vn(!1),hr=Wn;function Br(e,n){var r=e.type.contextTypes;if(!r)return Wn;var a=e.stateNode;if(a&&a.__reactInternalMemoizedUnmaskedChildContext===n)return a.__reactInternalMemoizedMaskedChildContext;var c={},d;for(d in r)c[d]=n[d];return a&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=n,e.__reactInternalMemoizedMaskedChildContext=c),c}function pt(e){return e=e.childContextTypes,e!=null}function Ml(){Me(xt),Me(st)}function Gc(e,n,r){if(st.current!==Wn)throw Error(i(168));Ae(st,n),Ae(xt,r)}function Yc(e,n,r){var a=e.stateNode;if(n=n.childContextTypes,typeof a.getChildContext!="function")return r;a=a.getChildContext();for(var c in a)if(!(c in n))throw Error(i(108,ue(e)||"Unknown",c));return Y({},r,a)}function Il(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Wn,hr=st.current,Ae(st,e),Ae(xt,xt.current),!0}function Qc(e,n,r){var a=e.stateNode;if(!a)throw Error(i(169));r?(e=Yc(e,n,hr),a.__reactInternalMemoizedMergedChildContext=e,Me(xt),Me(st),Ae(st,e)):Me(xt),Ae(xt,r)}var vn=null,Ol=!1,mi=!1;function Kc(e){vn===null?vn=[e]:vn.push(e)}function s0(e){Ol=!0,Kc(e)}function Gn(){if(!mi&&vn!==null){mi=!0;var e=0,n=_e;try{var r=vn;for(_e=1;e<r.length;e++){var a=r[e];do a=a(!0);while(a!==null)}vn=null,Ol=!1}catch(c){throw vn!==null&&(vn=vn.slice(e+1)),N(Qe,Gn),c}finally{_e=n,mi=!1}}return null}var Ur=[],Hr=0,Dl=null,Fl=0,It=[],Ot=0,fr=null,jn=1,wn="";function xr(e,n){Ur[Hr++]=Fl,Ur[Hr++]=Dl,Dl=e,Fl=n}function Xc(e,n,r){It[Ot++]=jn,It[Ot++]=wn,It[Ot++]=fr,fr=e;var a=jn;e=wn;var c=32-Yt(a)-1;a&=~(1<<c),r+=1;var d=32-Yt(n)+c;if(30<d){var f=c-c%5;d=(a&(1<<f)-1).toString(32),a>>=f,c-=f,jn=1<<32-Yt(n)+c|r<<c|a,wn=d+e}else jn=1<<d|r<<c|a,wn=e}function hi(e){e.return!==null&&(xr(e,1),Xc(e,1,0))}function fi(e){for(;e===Dl;)Dl=Ur[--Hr],Ur[Hr]=null,Fl=Ur[--Hr],Ur[Hr]=null;for(;e===fr;)fr=It[--Ot],It[Ot]=null,wn=It[--Ot],It[Ot]=null,jn=It[--Ot],It[Ot]=null}var Ct=null,Et=null,Ie=!1,Kt=null;function Zc(e,n){var r=$t(5,null,null,0);r.elementType="DELETED",r.stateNode=n,r.return=e,n=e.deletions,n===null?(e.deletions=[r],e.flags|=16):n.push(r)}function Jc(e,n){switch(e.tag){case 5:var r=e.type;return n=n.nodeType!==1||r.toLowerCase()!==n.nodeName.toLowerCase()?null:n,n!==null?(e.stateNode=n,Ct=e,Et=Hn(n.firstChild),!0):!1;case 6:return n=e.pendingProps===""||n.nodeType!==3?null:n,n!==null?(e.stateNode=n,Ct=e,Et=null,!0):!1;case 13:return n=n.nodeType!==8?null:n,n!==null?(r=fr!==null?{id:jn,overflow:wn}:null,e.memoizedState={dehydrated:n,treeContext:r,retryLane:1073741824},r=$t(18,null,null,0),r.stateNode=n,r.return=e,e.child=r,Ct=e,Et=null,!0):!1;default:return!1}}function xi(e){return(e.mode&1)!==0&&(e.flags&128)===0}function pi(e){if(Ie){var n=Et;if(n){var r=n;if(!Jc(e,n)){if(xi(e))throw Error(i(418));n=Hn(r.nextSibling);var a=Ct;n&&Jc(e,n)?Zc(a,r):(e.flags=e.flags&-4097|2,Ie=!1,Ct=e)}}else{if(xi(e))throw Error(i(418));e.flags=e.flags&-4097|2,Ie=!1,Ct=e}}}function qc(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Ct=e}function zl(e){if(e!==Ct)return!1;if(!Ie)return qc(e),Ie=!0,!1;var n;if((n=e.tag!==3)&&!(n=e.tag!==5)&&(n=e.type,n=n!=="head"&&n!=="body"&&!ii(e.type,e.memoizedProps)),n&&(n=Et)){if(xi(e))throw eu(),Error(i(418));for(;n;)Zc(e,n),n=Hn(n.nextSibling)}if(qc(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(i(317));e:{for(e=e.nextSibling,n=0;e;){if(e.nodeType===8){var r=e.data;if(r==="/$"){if(n===0){Et=Hn(e.nextSibling);break e}n--}else r!=="$"&&r!=="$!"&&r!=="$?"||n++}e=e.nextSibling}Et=null}}else Et=Ct?Hn(e.stateNode.nextSibling):null;return!0}function eu(){for(var e=Et;e;)e=Hn(e.nextSibling)}function Vr(){Et=Ct=null,Ie=!1}function gi(e){Kt===null?Kt=[e]:Kt.push(e)}var l0=$.ReactCurrentBatchConfig;function Is(e,n,r){if(e=r.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(r._owner){if(r=r._owner,r){if(r.tag!==1)throw Error(i(309));var a=r.stateNode}if(!a)throw Error(i(147,e));var c=a,d=""+e;return n!==null&&n.ref!==null&&typeof n.ref=="function"&&n.ref._stringRef===d?n.ref:(n=function(f){var g=c.refs;f===null?delete g[d]:g[d]=f},n._stringRef=d,n)}if(typeof e!="string")throw Error(i(284));if(!r._owner)throw Error(i(290,e))}return e}function $l(e,n){throw e=Object.prototype.toString.call(n),Error(i(31,e==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":e))}function tu(e){var n=e._init;return n(e._payload)}function nu(e){function n(C,b){if(e){var T=C.deletions;T===null?(C.deletions=[b],C.flags|=16):T.push(b)}}function r(C,b){if(!e)return null;for(;b!==null;)n(C,b),b=b.sibling;return null}function a(C,b){for(C=new Map;b!==null;)b.key!==null?C.set(b.key,b):C.set(b.index,b),b=b.sibling;return C}function c(C,b){return C=er(C,b),C.index=0,C.sibling=null,C}function d(C,b,T){return C.index=T,e?(T=C.alternate,T!==null?(T=T.index,T<b?(C.flags|=2,b):T):(C.flags|=2,b)):(C.flags|=1048576,b)}function f(C){return e&&C.alternate===null&&(C.flags|=2),C}function g(C,b,T,V){return b===null||b.tag!==6?(b=oo(T,C.mode,V),b.return=C,b):(b=c(b,T),b.return=C,b)}function w(C,b,T,V){var le=T.type;return le===ee?z(C,b,T.props.children,V,T.key):b!==null&&(b.elementType===le||typeof le=="object"&&le!==null&&le.$$typeof===Ne&&tu(le)===b.type)?(V=c(b,T.props),V.ref=Is(C,b,T),V.return=C,V):(V=ua(T.type,T.key,T.props,null,C.mode,V),V.ref=Is(C,b,T),V.return=C,V)}function _(C,b,T,V){return b===null||b.tag!==4||b.stateNode.containerInfo!==T.containerInfo||b.stateNode.implementation!==T.implementation?(b=co(T,C.mode,V),b.return=C,b):(b=c(b,T.children||[]),b.return=C,b)}function z(C,b,T,V,le){return b===null||b.tag!==7?(b=br(T,C.mode,V,le),b.return=C,b):(b=c(b,T),b.return=C,b)}function U(C,b,T){if(typeof b=="string"&&b!==""||typeof b=="number")return b=oo(""+b,C.mode,T),b.return=C,b;if(typeof b=="object"&&b!==null){switch(b.$$typeof){case J:return T=ua(b.type,b.key,b.props,null,C.mode,T),T.ref=Is(C,null,b),T.return=C,T;case ve:return b=co(b,C.mode,T),b.return=C,b;case Ne:var V=b._init;return U(C,V(b._payload),T)}if(rn(b)||se(b))return b=br(b,C.mode,T,null),b.return=C,b;$l(C,b)}return null}function F(C,b,T,V){var le=b!==null?b.key:null;if(typeof T=="string"&&T!==""||typeof T=="number")return le!==null?null:g(C,b,""+T,V);if(typeof T=="object"&&T!==null){switch(T.$$typeof){case J:return T.key===le?w(C,b,T,V):null;case ve:return T.key===le?_(C,b,T,V):null;case Ne:return le=T._init,F(C,b,le(T._payload),V)}if(rn(T)||se(T))return le!==null?null:z(C,b,T,V,null);$l(C,T)}return null}function K(C,b,T,V,le){if(typeof V=="string"&&V!==""||typeof V=="number")return C=C.get(T)||null,g(b,C,""+V,le);if(typeof V=="object"&&V!==null){switch(V.$$typeof){case J:return C=C.get(V.key===null?T:V.key)||null,w(b,C,V,le);case ve:return C=C.get(V.key===null?T:V.key)||null,_(b,C,V,le);case Ne:var de=V._init;return K(C,b,T,de(V._payload),le)}if(rn(V)||se(V))return C=C.get(T)||null,z(b,C,V,le,null);$l(b,V)}return null}function te(C,b,T,V){for(var le=null,de=null,me=b,ge=b=0,Ze=null;me!==null&&ge<T.length;ge++){me.index>ge?(Ze=me,me=null):Ze=me.sibling;var Te=F(C,me,T[ge],V);if(Te===null){me===null&&(me=Ze);break}e&&me&&Te.alternate===null&&n(C,me),b=d(Te,b,ge),de===null?le=Te:de.sibling=Te,de=Te,me=Ze}if(ge===T.length)return r(C,me),Ie&&xr(C,ge),le;if(me===null){for(;ge<T.length;ge++)me=U(C,T[ge],V),me!==null&&(b=d(me,b,ge),de===null?le=me:de.sibling=me,de=me);return Ie&&xr(C,ge),le}for(me=a(C,me);ge<T.length;ge++)Ze=K(me,C,ge,T[ge],V),Ze!==null&&(e&&Ze.alternate!==null&&me.delete(Ze.key===null?ge:Ze.key),b=d(Ze,b,ge),de===null?le=Ze:de.sibling=Ze,de=Ze);return e&&me.forEach(function(tr){return n(C,tr)}),Ie&&xr(C,ge),le}function re(C,b,T,V){var le=se(T);if(typeof le!="function")throw Error(i(150));if(T=le.call(T),T==null)throw Error(i(151));for(var de=le=null,me=b,ge=b=0,Ze=null,Te=T.next();me!==null&&!Te.done;ge++,Te=T.next()){me.index>ge?(Ze=me,me=null):Ze=me.sibling;var tr=F(C,me,Te.value,V);if(tr===null){me===null&&(me=Ze);break}e&&me&&tr.alternate===null&&n(C,me),b=d(tr,b,ge),de===null?le=tr:de.sibling=tr,de=tr,me=Ze}if(Te.done)return r(C,me),Ie&&xr(C,ge),le;if(me===null){for(;!Te.done;ge++,Te=T.next())Te=U(C,Te.value,V),Te!==null&&(b=d(Te,b,ge),de===null?le=Te:de.sibling=Te,de=Te);return Ie&&xr(C,ge),le}for(me=a(C,me);!Te.done;ge++,Te=T.next())Te=K(me,C,ge,Te.value,V),Te!==null&&(e&&Te.alternate!==null&&me.delete(Te.key===null?ge:Te.key),b=d(Te,b,ge),de===null?le=Te:de.sibling=Te,de=Te);return e&&me.forEach(function(F0){return n(C,F0)}),Ie&&xr(C,ge),le}function Be(C,b,T,V){if(typeof T=="object"&&T!==null&&T.type===ee&&T.key===null&&(T=T.props.children),typeof T=="object"&&T!==null){switch(T.$$typeof){case J:e:{for(var le=T.key,de=b;de!==null;){if(de.key===le){if(le=T.type,le===ee){if(de.tag===7){r(C,de.sibling),b=c(de,T.props.children),b.return=C,C=b;break e}}else if(de.elementType===le||typeof le=="object"&&le!==null&&le.$$typeof===Ne&&tu(le)===de.type){r(C,de.sibling),b=c(de,T.props),b.ref=Is(C,de,T),b.return=C,C=b;break e}r(C,de);break}else n(C,de);de=de.sibling}T.type===ee?(b=br(T.props.children,C.mode,V,T.key),b.return=C,C=b):(V=ua(T.type,T.key,T.props,null,C.mode,V),V.ref=Is(C,b,T),V.return=C,C=V)}return f(C);case ve:e:{for(de=T.key;b!==null;){if(b.key===de)if(b.tag===4&&b.stateNode.containerInfo===T.containerInfo&&b.stateNode.implementation===T.implementation){r(C,b.sibling),b=c(b,T.children||[]),b.return=C,C=b;break e}else{r(C,b);break}else n(C,b);b=b.sibling}b=co(T,C.mode,V),b.return=C,C=b}return f(C);case Ne:return de=T._init,Be(C,b,de(T._payload),V)}if(rn(T))return te(C,b,T,V);if(se(T))return re(C,b,T,V);$l(C,T)}return typeof T=="string"&&T!==""||typeof T=="number"?(T=""+T,b!==null&&b.tag===6?(r(C,b.sibling),b=c(b,T),b.return=C,C=b):(r(C,b),b=oo(T,C.mode,V),b.return=C,C=b),f(C)):r(C,b)}return Be}var Wr=nu(!0),ru=nu(!1),Bl=Vn(null),Ul=null,Gr=null,yi=null;function vi(){yi=Gr=Ul=null}function ji(e){var n=Bl.current;Me(Bl),e._currentValue=n}function wi(e,n,r){for(;e!==null;){var a=e.alternate;if((e.childLanes&n)!==n?(e.childLanes|=n,a!==null&&(a.childLanes|=n)):a!==null&&(a.childLanes&n)!==n&&(a.childLanes|=n),e===r)break;e=e.return}}function Yr(e,n){Ul=e,yi=Gr=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&n)!==0&&(gt=!0),e.firstContext=null)}function Dt(e){var n=e._currentValue;if(yi!==e)if(e={context:e,memoizedValue:n,next:null},Gr===null){if(Ul===null)throw Error(i(308));Gr=e,Ul.dependencies={lanes:0,firstContext:e}}else Gr=Gr.next=e;return n}var pr=null;function Ni(e){pr===null?pr=[e]:pr.push(e)}function su(e,n,r,a){var c=n.interleaved;return c===null?(r.next=r,Ni(n)):(r.next=c.next,c.next=r),n.interleaved=r,Nn(e,a)}function Nn(e,n){e.lanes|=n;var r=e.alternate;for(r!==null&&(r.lanes|=n),r=e,e=e.return;e!==null;)e.childLanes|=n,r=e.alternate,r!==null&&(r.childLanes|=n),r=e,e=e.return;return r.tag===3?r.stateNode:null}var Yn=!1;function bi(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function lu(e,n){e=e.updateQueue,n.updateQueue===e&&(n.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function bn(e,n){return{eventTime:e,lane:n,tag:0,payload:null,callback:null,next:null}}function Qn(e,n,r){var a=e.updateQueue;if(a===null)return null;if(a=a.shared,(Ce&2)!==0){var c=a.pending;return c===null?n.next=n:(n.next=c.next,c.next=n),a.pending=n,Nn(e,r)}return c=a.interleaved,c===null?(n.next=n,Ni(a)):(n.next=c.next,c.next=n),a.interleaved=n,Nn(e,r)}function Hl(e,n,r){if(n=n.updateQueue,n!==null&&(n=n.shared,(r&4194240)!==0)){var a=n.lanes;a&=e.pendingLanes,r|=a,n.lanes=r,Da(e,r)}}function au(e,n){var r=e.updateQueue,a=e.alternate;if(a!==null&&(a=a.updateQueue,r===a)){var c=null,d=null;if(r=r.firstBaseUpdate,r!==null){do{var f={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};d===null?c=d=f:d=d.next=f,r=r.next}while(r!==null);d===null?c=d=n:d=d.next=n}else c=d=n;r={baseState:a.baseState,firstBaseUpdate:c,lastBaseUpdate:d,shared:a.shared,effects:a.effects},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=n:e.next=n,r.lastBaseUpdate=n}function Vl(e,n,r,a){var c=e.updateQueue;Yn=!1;var d=c.firstBaseUpdate,f=c.lastBaseUpdate,g=c.shared.pending;if(g!==null){c.shared.pending=null;var w=g,_=w.next;w.next=null,f===null?d=_:f.next=_,f=w;var z=e.alternate;z!==null&&(z=z.updateQueue,g=z.lastBaseUpdate,g!==f&&(g===null?z.firstBaseUpdate=_:g.next=_,z.lastBaseUpdate=w))}if(d!==null){var U=c.baseState;f=0,z=_=w=null,g=d;do{var F=g.lane,K=g.eventTime;if((a&F)===F){z!==null&&(z=z.next={eventTime:K,lane:0,tag:g.tag,payload:g.payload,callback:g.callback,next:null});e:{var te=e,re=g;switch(F=n,K=r,re.tag){case 1:if(te=re.payload,typeof te=="function"){U=te.call(K,U,F);break e}U=te;break e;case 3:te.flags=te.flags&-65537|128;case 0:if(te=re.payload,F=typeof te=="function"?te.call(K,U,F):te,F==null)break e;U=Y({},U,F);break e;case 2:Yn=!0}}g.callback!==null&&g.lane!==0&&(e.flags|=64,F=c.effects,F===null?c.effects=[g]:F.push(g))}else K={eventTime:K,lane:F,tag:g.tag,payload:g.payload,callback:g.callback,next:null},z===null?(_=z=K,w=U):z=z.next=K,f|=F;if(g=g.next,g===null){if(g=c.shared.pending,g===null)break;F=g,g=F.next,F.next=null,c.lastBaseUpdate=F,c.shared.pending=null}}while(!0);if(z===null&&(w=U),c.baseState=w,c.firstBaseUpdate=_,c.lastBaseUpdate=z,n=c.shared.interleaved,n!==null){c=n;do f|=c.lane,c=c.next;while(c!==n)}else d===null&&(c.shared.lanes=0);vr|=f,e.lanes=f,e.memoizedState=U}}function iu(e,n,r){if(e=n.effects,n.effects=null,e!==null)for(n=0;n<e.length;n++){var a=e[n],c=a.callback;if(c!==null){if(a.callback=null,a=r,typeof c!="function")throw Error(i(191,c));c.call(a)}}}var Os={},on=Vn(Os),Ds=Vn(Os),Fs=Vn(Os);function gr(e){if(e===Os)throw Error(i(174));return e}function Si(e,n){switch(Ae(Fs,n),Ae(Ds,e),Ae(on,Os),e=n.nodeType,e){case 9:case 11:n=(n=n.documentElement)?n.namespaceURI:ft(null,"");break;default:e=e===8?n.parentNode:n,n=e.namespaceURI||null,e=e.tagName,n=ft(n,e)}Me(on),Ae(on,n)}function Qr(){Me(on),Me(Ds),Me(Fs)}function ou(e){gr(Fs.current);var n=gr(on.current),r=ft(n,e.type);n!==r&&(Ae(Ds,e),Ae(on,r))}function ki(e){Ds.current===e&&(Me(on),Me(Ds))}var Oe=Vn(0);function Wl(e){for(var n=e;n!==null;){if(n.tag===13){var r=n.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||r.data==="$?"||r.data==="$!"))return n}else if(n.tag===19&&n.memoizedProps.revealOrder!==void 0){if((n.flags&128)!==0)return n}else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return null;n=n.return}n.sibling.return=n.return,n=n.sibling}return null}var Ci=[];function Ei(){for(var e=0;e<Ci.length;e++)Ci[e]._workInProgressVersionPrimary=null;Ci.length=0}var Gl=$.ReactCurrentDispatcher,Ti=$.ReactCurrentBatchConfig,yr=0,De=null,Ge=null,Ke=null,Yl=!1,zs=!1,$s=0,a0=0;function lt(){throw Error(i(321))}function Pi(e,n){if(n===null)return!1;for(var r=0;r<n.length&&r<e.length;r++)if(!Qt(e[r],n[r]))return!1;return!0}function _i(e,n,r,a,c,d){if(yr=d,De=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,Gl.current=e===null||e.memoizedState===null?u0:d0,e=r(a,c),zs){d=0;do{if(zs=!1,$s=0,25<=d)throw Error(i(301));d+=1,Ke=Ge=null,n.updateQueue=null,Gl.current=m0,e=r(a,c)}while(zs)}if(Gl.current=Xl,n=Ge!==null&&Ge.next!==null,yr=0,Ke=Ge=De=null,Yl=!1,n)throw Error(i(300));return e}function Li(){var e=$s!==0;return $s=0,e}function cn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ke===null?De.memoizedState=Ke=e:Ke=Ke.next=e,Ke}function Ft(){if(Ge===null){var e=De.alternate;e=e!==null?e.memoizedState:null}else e=Ge.next;var n=Ke===null?De.memoizedState:Ke.next;if(n!==null)Ke=n,Ge=e;else{if(e===null)throw Error(i(310));Ge=e,e={memoizedState:Ge.memoizedState,baseState:Ge.baseState,baseQueue:Ge.baseQueue,queue:Ge.queue,next:null},Ke===null?De.memoizedState=Ke=e:Ke=Ke.next=e}return Ke}function Bs(e,n){return typeof n=="function"?n(e):n}function Ai(e){var n=Ft(),r=n.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=e;var a=Ge,c=a.baseQueue,d=r.pending;if(d!==null){if(c!==null){var f=c.next;c.next=d.next,d.next=f}a.baseQueue=c=d,r.pending=null}if(c!==null){d=c.next,a=a.baseState;var g=f=null,w=null,_=d;do{var z=_.lane;if((yr&z)===z)w!==null&&(w=w.next={lane:0,action:_.action,hasEagerState:_.hasEagerState,eagerState:_.eagerState,next:null}),a=_.hasEagerState?_.eagerState:e(a,_.action);else{var U={lane:z,action:_.action,hasEagerState:_.hasEagerState,eagerState:_.eagerState,next:null};w===null?(g=w=U,f=a):w=w.next=U,De.lanes|=z,vr|=z}_=_.next}while(_!==null&&_!==d);w===null?f=a:w.next=g,Qt(a,n.memoizedState)||(gt=!0),n.memoizedState=a,n.baseState=f,n.baseQueue=w,r.lastRenderedState=a}if(e=r.interleaved,e!==null){c=e;do d=c.lane,De.lanes|=d,vr|=d,c=c.next;while(c!==e)}else c===null&&(r.lanes=0);return[n.memoizedState,r.dispatch]}function Ri(e){var n=Ft(),r=n.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=e;var a=r.dispatch,c=r.pending,d=n.memoizedState;if(c!==null){r.pending=null;var f=c=c.next;do d=e(d,f.action),f=f.next;while(f!==c);Qt(d,n.memoizedState)||(gt=!0),n.memoizedState=d,n.baseQueue===null&&(n.baseState=d),r.lastRenderedState=d}return[d,a]}function cu(){}function uu(e,n){var r=De,a=Ft(),c=n(),d=!Qt(a.memoizedState,c);if(d&&(a.memoizedState=c,gt=!0),a=a.queue,Mi(hu.bind(null,r,a,e),[e]),a.getSnapshot!==n||d||Ke!==null&&Ke.memoizedState.tag&1){if(r.flags|=2048,Us(9,mu.bind(null,r,a,c,n),void 0,null),Xe===null)throw Error(i(349));(yr&30)!==0||du(r,n,c)}return c}function du(e,n,r){e.flags|=16384,e={getSnapshot:n,value:r},n=De.updateQueue,n===null?(n={lastEffect:null,stores:null},De.updateQueue=n,n.stores=[e]):(r=n.stores,r===null?n.stores=[e]:r.push(e))}function mu(e,n,r,a){n.value=r,n.getSnapshot=a,fu(n)&&xu(e)}function hu(e,n,r){return r(function(){fu(n)&&xu(e)})}function fu(e){var n=e.getSnapshot;e=e.value;try{var r=n();return!Qt(e,r)}catch{return!0}}function xu(e){var n=Nn(e,1);n!==null&&qt(n,e,1,-1)}function pu(e){var n=cn();return typeof e=="function"&&(e=e()),n.memoizedState=n.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Bs,lastRenderedState:e},n.queue=e,e=e.dispatch=c0.bind(null,De,e),[n.memoizedState,e]}function Us(e,n,r,a){return e={tag:e,create:n,destroy:r,deps:a,next:null},n=De.updateQueue,n===null?(n={lastEffect:null,stores:null},De.updateQueue=n,n.lastEffect=e.next=e):(r=n.lastEffect,r===null?n.lastEffect=e.next=e:(a=r.next,r.next=e,e.next=a,n.lastEffect=e)),e}function gu(){return Ft().memoizedState}function Ql(e,n,r,a){var c=cn();De.flags|=e,c.memoizedState=Us(1|n,r,void 0,a===void 0?null:a)}function Kl(e,n,r,a){var c=Ft();a=a===void 0?null:a;var d=void 0;if(Ge!==null){var f=Ge.memoizedState;if(d=f.destroy,a!==null&&Pi(a,f.deps)){c.memoizedState=Us(n,r,d,a);return}}De.flags|=e,c.memoizedState=Us(1|n,r,d,a)}function yu(e,n){return Ql(8390656,8,e,n)}function Mi(e,n){return Kl(2048,8,e,n)}function vu(e,n){return Kl(4,2,e,n)}function ju(e,n){return Kl(4,4,e,n)}function wu(e,n){if(typeof n=="function")return e=e(),n(e),function(){n(null)};if(n!=null)return e=e(),n.current=e,function(){n.current=null}}function Nu(e,n,r){return r=r!=null?r.concat([e]):null,Kl(4,4,wu.bind(null,n,e),r)}function Ii(){}function bu(e,n){var r=Ft();n=n===void 0?null:n;var a=r.memoizedState;return a!==null&&n!==null&&Pi(n,a[1])?a[0]:(r.memoizedState=[e,n],e)}function Su(e,n){var r=Ft();n=n===void 0?null:n;var a=r.memoizedState;return a!==null&&n!==null&&Pi(n,a[1])?a[0]:(e=e(),r.memoizedState=[e,n],e)}function ku(e,n,r){return(yr&21)===0?(e.baseState&&(e.baseState=!1,gt=!0),e.memoizedState=r):(Qt(r,n)||(r=tc(),De.lanes|=r,vr|=r,e.baseState=!0),n)}function i0(e,n){var r=_e;_e=r!==0&&4>r?r:4,e(!0);var a=Ti.transition;Ti.transition={};try{e(!1),n()}finally{_e=r,Ti.transition=a}}function Cu(){return Ft().memoizedState}function o0(e,n,r){var a=Jn(e);if(r={lane:a,action:r,hasEagerState:!1,eagerState:null,next:null},Eu(e))Tu(n,r);else if(r=su(e,n,r,a),r!==null){var c=ut();qt(r,e,a,c),Pu(r,n,a)}}function c0(e,n,r){var a=Jn(e),c={lane:a,action:r,hasEagerState:!1,eagerState:null,next:null};if(Eu(e))Tu(n,c);else{var d=e.alternate;if(e.lanes===0&&(d===null||d.lanes===0)&&(d=n.lastRenderedReducer,d!==null))try{var f=n.lastRenderedState,g=d(f,r);if(c.hasEagerState=!0,c.eagerState=g,Qt(g,f)){var w=n.interleaved;w===null?(c.next=c,Ni(n)):(c.next=w.next,w.next=c),n.interleaved=c;return}}catch{}r=su(e,n,c,a),r!==null&&(c=ut(),qt(r,e,a,c),Pu(r,n,a))}}function Eu(e){var n=e.alternate;return e===De||n!==null&&n===De}function Tu(e,n){zs=Yl=!0;var r=e.pending;r===null?n.next=n:(n.next=r.next,r.next=n),e.pending=n}function Pu(e,n,r){if((r&4194240)!==0){var a=n.lanes;a&=e.pendingLanes,r|=a,n.lanes=r,Da(e,r)}}var Xl={readContext:Dt,useCallback:lt,useContext:lt,useEffect:lt,useImperativeHandle:lt,useInsertionEffect:lt,useLayoutEffect:lt,useMemo:lt,useReducer:lt,useRef:lt,useState:lt,useDebugValue:lt,useDeferredValue:lt,useTransition:lt,useMutableSource:lt,useSyncExternalStore:lt,useId:lt,unstable_isNewReconciler:!1},u0={readContext:Dt,useCallback:function(e,n){return cn().memoizedState=[e,n===void 0?null:n],e},useContext:Dt,useEffect:yu,useImperativeHandle:function(e,n,r){return r=r!=null?r.concat([e]):null,Ql(4194308,4,wu.bind(null,n,e),r)},useLayoutEffect:function(e,n){return Ql(4194308,4,e,n)},useInsertionEffect:function(e,n){return Ql(4,2,e,n)},useMemo:function(e,n){var r=cn();return n=n===void 0?null:n,e=e(),r.memoizedState=[e,n],e},useReducer:function(e,n,r){var a=cn();return n=r!==void 0?r(n):n,a.memoizedState=a.baseState=n,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:n},a.queue=e,e=e.dispatch=o0.bind(null,De,e),[a.memoizedState,e]},useRef:function(e){var n=cn();return e={current:e},n.memoizedState=e},useState:pu,useDebugValue:Ii,useDeferredValue:function(e){return cn().memoizedState=e},useTransition:function(){var e=pu(!1),n=e[0];return e=i0.bind(null,e[1]),cn().memoizedState=e,[n,e]},useMutableSource:function(){},useSyncExternalStore:function(e,n,r){var a=De,c=cn();if(Ie){if(r===void 0)throw Error(i(407));r=r()}else{if(r=n(),Xe===null)throw Error(i(349));(yr&30)!==0||du(a,n,r)}c.memoizedState=r;var d={value:r,getSnapshot:n};return c.queue=d,yu(hu.bind(null,a,d,e),[e]),a.flags|=2048,Us(9,mu.bind(null,a,d,r,n),void 0,null),r},useId:function(){var e=cn(),n=Xe.identifierPrefix;if(Ie){var r=wn,a=jn;r=(a&~(1<<32-Yt(a)-1)).toString(32)+r,n=":"+n+"R"+r,r=$s++,0<r&&(n+="H"+r.toString(32)),n+=":"}else r=a0++,n=":"+n+"r"+r.toString(32)+":";return e.memoizedState=n},unstable_isNewReconciler:!1},d0={readContext:Dt,useCallback:bu,useContext:Dt,useEffect:Mi,useImperativeHandle:Nu,useInsertionEffect:vu,useLayoutEffect:ju,useMemo:Su,useReducer:Ai,useRef:gu,useState:function(){return Ai(Bs)},useDebugValue:Ii,useDeferredValue:function(e){var n=Ft();return ku(n,Ge.memoizedState,e)},useTransition:function(){var e=Ai(Bs)[0],n=Ft().memoizedState;return[e,n]},useMutableSource:cu,useSyncExternalStore:uu,useId:Cu,unstable_isNewReconciler:!1},m0={readContext:Dt,useCallback:bu,useContext:Dt,useEffect:Mi,useImperativeHandle:Nu,useInsertionEffect:vu,useLayoutEffect:ju,useMemo:Su,useReducer:Ri,useRef:gu,useState:function(){return Ri(Bs)},useDebugValue:Ii,useDeferredValue:function(e){var n=Ft();return Ge===null?n.memoizedState=e:ku(n,Ge.memoizedState,e)},useTransition:function(){var e=Ri(Bs)[0],n=Ft().memoizedState;return[e,n]},useMutableSource:cu,useSyncExternalStore:uu,useId:Cu,unstable_isNewReconciler:!1};function Xt(e,n){if(e&&e.defaultProps){n=Y({},n),e=e.defaultProps;for(var r in e)n[r]===void 0&&(n[r]=e[r]);return n}return n}function Oi(e,n,r,a){n=e.memoizedState,r=r(a,n),r=r==null?n:Y({},n,r),e.memoizedState=r,e.lanes===0&&(e.updateQueue.baseState=r)}var Zl={isMounted:function(e){return(e=e._reactInternals)?ln(e)===e:!1},enqueueSetState:function(e,n,r){e=e._reactInternals;var a=ut(),c=Jn(e),d=bn(a,c);d.payload=n,r!=null&&(d.callback=r),n=Qn(e,d,c),n!==null&&(qt(n,e,c,a),Hl(n,e,c))},enqueueReplaceState:function(e,n,r){e=e._reactInternals;var a=ut(),c=Jn(e),d=bn(a,c);d.tag=1,d.payload=n,r!=null&&(d.callback=r),n=Qn(e,d,c),n!==null&&(qt(n,e,c,a),Hl(n,e,c))},enqueueForceUpdate:function(e,n){e=e._reactInternals;var r=ut(),a=Jn(e),c=bn(r,a);c.tag=2,n!=null&&(c.callback=n),n=Qn(e,c,a),n!==null&&(qt(n,e,a,r),Hl(n,e,a))}};function _u(e,n,r,a,c,d,f){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(a,d,f):n.prototype&&n.prototype.isPureReactComponent?!Ts(r,a)||!Ts(c,d):!0}function Lu(e,n,r){var a=!1,c=Wn,d=n.contextType;return typeof d=="object"&&d!==null?d=Dt(d):(c=pt(n)?hr:st.current,a=n.contextTypes,d=(a=a!=null)?Br(e,c):Wn),n=new n(r,d),e.memoizedState=n.state!==null&&n.state!==void 0?n.state:null,n.updater=Zl,e.stateNode=n,n._reactInternals=e,a&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=c,e.__reactInternalMemoizedMaskedChildContext=d),n}function Au(e,n,r,a){e=n.state,typeof n.componentWillReceiveProps=="function"&&n.componentWillReceiveProps(r,a),typeof n.UNSAFE_componentWillReceiveProps=="function"&&n.UNSAFE_componentWillReceiveProps(r,a),n.state!==e&&Zl.enqueueReplaceState(n,n.state,null)}function Di(e,n,r,a){var c=e.stateNode;c.props=r,c.state=e.memoizedState,c.refs={},bi(e);var d=n.contextType;typeof d=="object"&&d!==null?c.context=Dt(d):(d=pt(n)?hr:st.current,c.context=Br(e,d)),c.state=e.memoizedState,d=n.getDerivedStateFromProps,typeof d=="function"&&(Oi(e,n,d,r),c.state=e.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof c.getSnapshotBeforeUpdate=="function"||typeof c.UNSAFE_componentWillMount!="function"&&typeof c.componentWillMount!="function"||(n=c.state,typeof c.componentWillMount=="function"&&c.componentWillMount(),typeof c.UNSAFE_componentWillMount=="function"&&c.UNSAFE_componentWillMount(),n!==c.state&&Zl.enqueueReplaceState(c,c.state,null),Vl(e,r,c,a),c.state=e.memoizedState),typeof c.componentDidMount=="function"&&(e.flags|=4194308)}function Kr(e,n){try{var r="",a=n;do r+=G(a),a=a.return;while(a);var c=r}catch(d){c=`
|
|
7
|
+
Error generating stack: `+d.message+`
|
|
8
|
+
`+d.stack}return{value:e,source:n,stack:c,digest:null}}function Fi(e,n,r){return{value:e,source:null,stack:r??null,digest:n??null}}function zi(e,n){try{console.error(n.value)}catch(r){setTimeout(function(){throw r})}}var h0=typeof WeakMap=="function"?WeakMap:Map;function Ru(e,n,r){r=bn(-1,r),r.tag=3,r.payload={element:null};var a=n.value;return r.callback=function(){sa||(sa=!0,eo=a),zi(e,n)},r}function Mu(e,n,r){r=bn(-1,r),r.tag=3;var a=e.type.getDerivedStateFromError;if(typeof a=="function"){var c=n.value;r.payload=function(){return a(c)},r.callback=function(){zi(e,n)}}var d=e.stateNode;return d!==null&&typeof d.componentDidCatch=="function"&&(r.callback=function(){zi(e,n),typeof a!="function"&&(Xn===null?Xn=new Set([this]):Xn.add(this));var f=n.stack;this.componentDidCatch(n.value,{componentStack:f!==null?f:""})}),r}function Iu(e,n,r){var a=e.pingCache;if(a===null){a=e.pingCache=new h0;var c=new Set;a.set(n,c)}else c=a.get(n),c===void 0&&(c=new Set,a.set(n,c));c.has(r)||(c.add(r),e=E0.bind(null,e,n,r),n.then(e,e))}function Ou(e){do{var n;if((n=e.tag===13)&&(n=e.memoizedState,n=n!==null?n.dehydrated!==null:!0),n)return e;e=e.return}while(e!==null);return null}function Du(e,n,r,a,c){return(e.mode&1)===0?(e===n?e.flags|=65536:(e.flags|=128,r.flags|=131072,r.flags&=-52805,r.tag===1&&(r.alternate===null?r.tag=17:(n=bn(-1,1),n.tag=2,Qn(r,n,1))),r.lanes|=1),e):(e.flags|=65536,e.lanes=c,e)}var f0=$.ReactCurrentOwner,gt=!1;function ct(e,n,r,a){n.child=e===null?ru(n,null,r,a):Wr(n,e.child,r,a)}function Fu(e,n,r,a,c){r=r.render;var d=n.ref;return Yr(n,c),a=_i(e,n,r,a,d,c),r=Li(),e!==null&&!gt?(n.updateQueue=e.updateQueue,n.flags&=-2053,e.lanes&=~c,Sn(e,n,c)):(Ie&&r&&hi(n),n.flags|=1,ct(e,n,a,c),n.child)}function zu(e,n,r,a,c){if(e===null){var d=r.type;return typeof d=="function"&&!io(d)&&d.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(n.tag=15,n.type=d,$u(e,n,d,a,c)):(e=ua(r.type,null,a,n,n.mode,c),e.ref=n.ref,e.return=n,n.child=e)}if(d=e.child,(e.lanes&c)===0){var f=d.memoizedProps;if(r=r.compare,r=r!==null?r:Ts,r(f,a)&&e.ref===n.ref)return Sn(e,n,c)}return n.flags|=1,e=er(d,a),e.ref=n.ref,e.return=n,n.child=e}function $u(e,n,r,a,c){if(e!==null){var d=e.memoizedProps;if(Ts(d,a)&&e.ref===n.ref)if(gt=!1,n.pendingProps=a=d,(e.lanes&c)!==0)(e.flags&131072)!==0&&(gt=!0);else return n.lanes=e.lanes,Sn(e,n,c)}return $i(e,n,r,a,c)}function Bu(e,n,r){var a=n.pendingProps,c=a.children,d=e!==null?e.memoizedState:null;if(a.mode==="hidden")if((n.mode&1)===0)n.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ae(Zr,Tt),Tt|=r;else{if((r&1073741824)===0)return e=d!==null?d.baseLanes|r:r,n.lanes=n.childLanes=1073741824,n.memoizedState={baseLanes:e,cachePool:null,transitions:null},n.updateQueue=null,Ae(Zr,Tt),Tt|=e,null;n.memoizedState={baseLanes:0,cachePool:null,transitions:null},a=d!==null?d.baseLanes:r,Ae(Zr,Tt),Tt|=a}else d!==null?(a=d.baseLanes|r,n.memoizedState=null):a=r,Ae(Zr,Tt),Tt|=a;return ct(e,n,c,r),n.child}function Uu(e,n){var r=n.ref;(e===null&&r!==null||e!==null&&e.ref!==r)&&(n.flags|=512,n.flags|=2097152)}function $i(e,n,r,a,c){var d=pt(r)?hr:st.current;return d=Br(n,d),Yr(n,c),r=_i(e,n,r,a,d,c),a=Li(),e!==null&&!gt?(n.updateQueue=e.updateQueue,n.flags&=-2053,e.lanes&=~c,Sn(e,n,c)):(Ie&&a&&hi(n),n.flags|=1,ct(e,n,r,c),n.child)}function Hu(e,n,r,a,c){if(pt(r)){var d=!0;Il(n)}else d=!1;if(Yr(n,c),n.stateNode===null)ql(e,n),Lu(n,r,a),Di(n,r,a,c),a=!0;else if(e===null){var f=n.stateNode,g=n.memoizedProps;f.props=g;var w=f.context,_=r.contextType;typeof _=="object"&&_!==null?_=Dt(_):(_=pt(r)?hr:st.current,_=Br(n,_));var z=r.getDerivedStateFromProps,U=typeof z=="function"||typeof f.getSnapshotBeforeUpdate=="function";U||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(g!==a||w!==_)&&Au(n,f,a,_),Yn=!1;var F=n.memoizedState;f.state=F,Vl(n,a,f,c),w=n.memoizedState,g!==a||F!==w||xt.current||Yn?(typeof z=="function"&&(Oi(n,r,z,a),w=n.memoizedState),(g=Yn||_u(n,r,g,a,F,w,_))?(U||typeof f.UNSAFE_componentWillMount!="function"&&typeof f.componentWillMount!="function"||(typeof f.componentWillMount=="function"&&f.componentWillMount(),typeof f.UNSAFE_componentWillMount=="function"&&f.UNSAFE_componentWillMount()),typeof f.componentDidMount=="function"&&(n.flags|=4194308)):(typeof f.componentDidMount=="function"&&(n.flags|=4194308),n.memoizedProps=a,n.memoizedState=w),f.props=a,f.state=w,f.context=_,a=g):(typeof f.componentDidMount=="function"&&(n.flags|=4194308),a=!1)}else{f=n.stateNode,lu(e,n),g=n.memoizedProps,_=n.type===n.elementType?g:Xt(n.type,g),f.props=_,U=n.pendingProps,F=f.context,w=r.contextType,typeof w=="object"&&w!==null?w=Dt(w):(w=pt(r)?hr:st.current,w=Br(n,w));var K=r.getDerivedStateFromProps;(z=typeof K=="function"||typeof f.getSnapshotBeforeUpdate=="function")||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(g!==U||F!==w)&&Au(n,f,a,w),Yn=!1,F=n.memoizedState,f.state=F,Vl(n,a,f,c);var te=n.memoizedState;g!==U||F!==te||xt.current||Yn?(typeof K=="function"&&(Oi(n,r,K,a),te=n.memoizedState),(_=Yn||_u(n,r,_,a,F,te,w)||!1)?(z||typeof f.UNSAFE_componentWillUpdate!="function"&&typeof f.componentWillUpdate!="function"||(typeof f.componentWillUpdate=="function"&&f.componentWillUpdate(a,te,w),typeof f.UNSAFE_componentWillUpdate=="function"&&f.UNSAFE_componentWillUpdate(a,te,w)),typeof f.componentDidUpdate=="function"&&(n.flags|=4),typeof f.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof f.componentDidUpdate!="function"||g===e.memoizedProps&&F===e.memoizedState||(n.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||g===e.memoizedProps&&F===e.memoizedState||(n.flags|=1024),n.memoizedProps=a,n.memoizedState=te),f.props=a,f.state=te,f.context=w,a=_):(typeof f.componentDidUpdate!="function"||g===e.memoizedProps&&F===e.memoizedState||(n.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||g===e.memoizedProps&&F===e.memoizedState||(n.flags|=1024),a=!1)}return Bi(e,n,r,a,d,c)}function Bi(e,n,r,a,c,d){Uu(e,n);var f=(n.flags&128)!==0;if(!a&&!f)return c&&Qc(n,r,!1),Sn(e,n,d);a=n.stateNode,f0.current=n;var g=f&&typeof r.getDerivedStateFromError!="function"?null:a.render();return n.flags|=1,e!==null&&f?(n.child=Wr(n,e.child,null,d),n.child=Wr(n,null,g,d)):ct(e,n,g,d),n.memoizedState=a.state,c&&Qc(n,r,!0),n.child}function Vu(e){var n=e.stateNode;n.pendingContext?Gc(e,n.pendingContext,n.pendingContext!==n.context):n.context&&Gc(e,n.context,!1),Si(e,n.containerInfo)}function Wu(e,n,r,a,c){return Vr(),gi(c),n.flags|=256,ct(e,n,r,a),n.child}var Ui={dehydrated:null,treeContext:null,retryLane:0};function Hi(e){return{baseLanes:e,cachePool:null,transitions:null}}function Gu(e,n,r){var a=n.pendingProps,c=Oe.current,d=!1,f=(n.flags&128)!==0,g;if((g=f)||(g=e!==null&&e.memoizedState===null?!1:(c&2)!==0),g?(d=!0,n.flags&=-129):(e===null||e.memoizedState!==null)&&(c|=1),Ae(Oe,c&1),e===null)return pi(n),e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?((n.mode&1)===0?n.lanes=1:e.data==="$!"?n.lanes=8:n.lanes=1073741824,null):(f=a.children,e=a.fallback,d?(a=n.mode,d=n.child,f={mode:"hidden",children:f},(a&1)===0&&d!==null?(d.childLanes=0,d.pendingProps=f):d=da(f,a,0,null),e=br(e,a,r,null),d.return=n,e.return=n,d.sibling=e,n.child=d,n.child.memoizedState=Hi(r),n.memoizedState=Ui,e):Vi(n,f));if(c=e.memoizedState,c!==null&&(g=c.dehydrated,g!==null))return x0(e,n,f,a,g,c,r);if(d){d=a.fallback,f=n.mode,c=e.child,g=c.sibling;var w={mode:"hidden",children:a.children};return(f&1)===0&&n.child!==c?(a=n.child,a.childLanes=0,a.pendingProps=w,n.deletions=null):(a=er(c,w),a.subtreeFlags=c.subtreeFlags&14680064),g!==null?d=er(g,d):(d=br(d,f,r,null),d.flags|=2),d.return=n,a.return=n,a.sibling=d,n.child=a,a=d,d=n.child,f=e.child.memoizedState,f=f===null?Hi(r):{baseLanes:f.baseLanes|r,cachePool:null,transitions:f.transitions},d.memoizedState=f,d.childLanes=e.childLanes&~r,n.memoizedState=Ui,a}return d=e.child,e=d.sibling,a=er(d,{mode:"visible",children:a.children}),(n.mode&1)===0&&(a.lanes=r),a.return=n,a.sibling=null,e!==null&&(r=n.deletions,r===null?(n.deletions=[e],n.flags|=16):r.push(e)),n.child=a,n.memoizedState=null,a}function Vi(e,n){return n=da({mode:"visible",children:n},e.mode,0,null),n.return=e,e.child=n}function Jl(e,n,r,a){return a!==null&&gi(a),Wr(n,e.child,null,r),e=Vi(n,n.pendingProps.children),e.flags|=2,n.memoizedState=null,e}function x0(e,n,r,a,c,d,f){if(r)return n.flags&256?(n.flags&=-257,a=Fi(Error(i(422))),Jl(e,n,f,a)):n.memoizedState!==null?(n.child=e.child,n.flags|=128,null):(d=a.fallback,c=n.mode,a=da({mode:"visible",children:a.children},c,0,null),d=br(d,c,f,null),d.flags|=2,a.return=n,d.return=n,a.sibling=d,n.child=a,(n.mode&1)!==0&&Wr(n,e.child,null,f),n.child.memoizedState=Hi(f),n.memoizedState=Ui,d);if((n.mode&1)===0)return Jl(e,n,f,null);if(c.data==="$!"){if(a=c.nextSibling&&c.nextSibling.dataset,a)var g=a.dgst;return a=g,d=Error(i(419)),a=Fi(d,a,void 0),Jl(e,n,f,a)}if(g=(f&e.childLanes)!==0,gt||g){if(a=Xe,a!==null){switch(f&-f){case 4:c=2;break;case 16:c=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:c=32;break;case 536870912:c=268435456;break;default:c=0}c=(c&(a.suspendedLanes|f))!==0?0:c,c!==0&&c!==d.retryLane&&(d.retryLane=c,Nn(e,c),qt(a,e,c,-1))}return ao(),a=Fi(Error(i(421))),Jl(e,n,f,a)}return c.data==="$?"?(n.flags|=128,n.child=e.child,n=T0.bind(null,e),c._reactRetry=n,null):(e=d.treeContext,Et=Hn(c.nextSibling),Ct=n,Ie=!0,Kt=null,e!==null&&(It[Ot++]=jn,It[Ot++]=wn,It[Ot++]=fr,jn=e.id,wn=e.overflow,fr=n),n=Vi(n,a.children),n.flags|=4096,n)}function Yu(e,n,r){e.lanes|=n;var a=e.alternate;a!==null&&(a.lanes|=n),wi(e.return,n,r)}function Wi(e,n,r,a,c){var d=e.memoizedState;d===null?e.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:a,tail:r,tailMode:c}:(d.isBackwards=n,d.rendering=null,d.renderingStartTime=0,d.last=a,d.tail=r,d.tailMode=c)}function Qu(e,n,r){var a=n.pendingProps,c=a.revealOrder,d=a.tail;if(ct(e,n,a.children,r),a=Oe.current,(a&2)!==0)a=a&1|2,n.flags|=128;else{if(e!==null&&(e.flags&128)!==0)e:for(e=n.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Yu(e,r,n);else if(e.tag===19)Yu(e,r,n);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===n)break e;for(;e.sibling===null;){if(e.return===null||e.return===n)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}a&=1}if(Ae(Oe,a),(n.mode&1)===0)n.memoizedState=null;else switch(c){case"forwards":for(r=n.child,c=null;r!==null;)e=r.alternate,e!==null&&Wl(e)===null&&(c=r),r=r.sibling;r=c,r===null?(c=n.child,n.child=null):(c=r.sibling,r.sibling=null),Wi(n,!1,c,r,d);break;case"backwards":for(r=null,c=n.child,n.child=null;c!==null;){if(e=c.alternate,e!==null&&Wl(e)===null){n.child=c;break}e=c.sibling,c.sibling=r,r=c,c=e}Wi(n,!0,r,null,d);break;case"together":Wi(n,!1,null,null,void 0);break;default:n.memoizedState=null}return n.child}function ql(e,n){(n.mode&1)===0&&e!==null&&(e.alternate=null,n.alternate=null,n.flags|=2)}function Sn(e,n,r){if(e!==null&&(n.dependencies=e.dependencies),vr|=n.lanes,(r&n.childLanes)===0)return null;if(e!==null&&n.child!==e.child)throw Error(i(153));if(n.child!==null){for(e=n.child,r=er(e,e.pendingProps),n.child=r,r.return=n;e.sibling!==null;)e=e.sibling,r=r.sibling=er(e,e.pendingProps),r.return=n;r.sibling=null}return n.child}function p0(e,n,r){switch(n.tag){case 3:Vu(n),Vr();break;case 5:ou(n);break;case 1:pt(n.type)&&Il(n);break;case 4:Si(n,n.stateNode.containerInfo);break;case 10:var a=n.type._context,c=n.memoizedProps.value;Ae(Bl,a._currentValue),a._currentValue=c;break;case 13:if(a=n.memoizedState,a!==null)return a.dehydrated!==null?(Ae(Oe,Oe.current&1),n.flags|=128,null):(r&n.child.childLanes)!==0?Gu(e,n,r):(Ae(Oe,Oe.current&1),e=Sn(e,n,r),e!==null?e.sibling:null);Ae(Oe,Oe.current&1);break;case 19:if(a=(r&n.childLanes)!==0,(e.flags&128)!==0){if(a)return Qu(e,n,r);n.flags|=128}if(c=n.memoizedState,c!==null&&(c.rendering=null,c.tail=null,c.lastEffect=null),Ae(Oe,Oe.current),a)break;return null;case 22:case 23:return n.lanes=0,Bu(e,n,r)}return Sn(e,n,r)}var Ku,Gi,Xu,Zu;Ku=function(e,n){for(var r=n.child;r!==null;){if(r.tag===5||r.tag===6)e.appendChild(r.stateNode);else if(r.tag!==4&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===n)break;for(;r.sibling===null;){if(r.return===null||r.return===n)return;r=r.return}r.sibling.return=r.return,r=r.sibling}},Gi=function(){},Xu=function(e,n,r,a){var c=e.memoizedProps;if(c!==a){e=n.stateNode,gr(on.current);var d=null;switch(r){case"input":c=tn(e,c),a=tn(e,a),d=[];break;case"select":c=Y({},c,{value:void 0}),a=Y({},a,{value:void 0}),d=[];break;case"textarea":c=Tr(e,c),a=Tr(e,a),d=[];break;default:typeof c.onClick!="function"&&typeof a.onClick=="function"&&(e.onclick=Al)}sn(r,a);var f;r=null;for(_ in c)if(!a.hasOwnProperty(_)&&c.hasOwnProperty(_)&&c[_]!=null)if(_==="style"){var g=c[_];for(f in g)g.hasOwnProperty(f)&&(r||(r={}),r[f]="")}else _!=="dangerouslySetInnerHTML"&&_!=="children"&&_!=="suppressContentEditableWarning"&&_!=="suppressHydrationWarning"&&_!=="autoFocus"&&(u.hasOwnProperty(_)?d||(d=[]):(d=d||[]).push(_,null));for(_ in a){var w=a[_];if(g=c?.[_],a.hasOwnProperty(_)&&w!==g&&(w!=null||g!=null))if(_==="style")if(g){for(f in g)!g.hasOwnProperty(f)||w&&w.hasOwnProperty(f)||(r||(r={}),r[f]="");for(f in w)w.hasOwnProperty(f)&&g[f]!==w[f]&&(r||(r={}),r[f]=w[f])}else r||(d||(d=[]),d.push(_,r)),r=w;else _==="dangerouslySetInnerHTML"?(w=w?w.__html:void 0,g=g?g.__html:void 0,w!=null&&g!==w&&(d=d||[]).push(_,w)):_==="children"?typeof w!="string"&&typeof w!="number"||(d=d||[]).push(_,""+w):_!=="suppressContentEditableWarning"&&_!=="suppressHydrationWarning"&&(u.hasOwnProperty(_)?(w!=null&&_==="onScroll"&&Re("scroll",e),d||g===w||(d=[])):(d=d||[]).push(_,w))}r&&(d=d||[]).push("style",r);var _=d;(n.updateQueue=_)&&(n.flags|=4)}},Zu=function(e,n,r,a){r!==a&&(n.flags|=4)};function Hs(e,n){if(!Ie)switch(e.tailMode){case"hidden":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?e.tail=null:r.sibling=null;break;case"collapsed":r=e.tail;for(var a=null;r!==null;)r.alternate!==null&&(a=r),r=r.sibling;a===null?n||e.tail===null?e.tail=null:e.tail.sibling=null:a.sibling=null}}function at(e){var n=e.alternate!==null&&e.alternate.child===e.child,r=0,a=0;if(n)for(var c=e.child;c!==null;)r|=c.lanes|c.childLanes,a|=c.subtreeFlags&14680064,a|=c.flags&14680064,c.return=e,c=c.sibling;else for(c=e.child;c!==null;)r|=c.lanes|c.childLanes,a|=c.subtreeFlags,a|=c.flags,c.return=e,c=c.sibling;return e.subtreeFlags|=a,e.childLanes=r,n}function g0(e,n,r){var a=n.pendingProps;switch(fi(n),n.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return at(n),null;case 1:return pt(n.type)&&Ml(),at(n),null;case 3:return a=n.stateNode,Qr(),Me(xt),Me(st),Ei(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(e===null||e.child===null)&&(zl(n)?n.flags|=4:e===null||e.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,Kt!==null&&(ro(Kt),Kt=null))),Gi(e,n),at(n),null;case 5:ki(n);var c=gr(Fs.current);if(r=n.type,e!==null&&n.stateNode!=null)Xu(e,n,r,a,c),e.ref!==n.ref&&(n.flags|=512,n.flags|=2097152);else{if(!a){if(n.stateNode===null)throw Error(i(166));return at(n),null}if(e=gr(on.current),zl(n)){a=n.stateNode,r=n.type;var d=n.memoizedProps;switch(a[an]=n,a[Rs]=d,e=(n.mode&1)!==0,r){case"dialog":Re("cancel",a),Re("close",a);break;case"iframe":case"object":case"embed":Re("load",a);break;case"video":case"audio":for(c=0;c<_s.length;c++)Re(_s[c],a);break;case"source":Re("error",a);break;case"img":case"image":case"link":Re("error",a),Re("load",a);break;case"details":Re("toggle",a);break;case"input":et(a,d),Re("invalid",a);break;case"select":a._wrapperState={wasMultiple:!!d.multiple},Re("invalid",a);break;case"textarea":ol(a,d),Re("invalid",a)}sn(r,d),c=null;for(var f in d)if(d.hasOwnProperty(f)){var g=d[f];f==="children"?typeof g=="string"?a.textContent!==g&&(d.suppressHydrationWarning!==!0&&Ll(a.textContent,g,e),c=["children",g]):typeof g=="number"&&a.textContent!==""+g&&(d.suppressHydrationWarning!==!0&&Ll(a.textContent,g,e),c=["children",""+g]):u.hasOwnProperty(f)&&g!=null&&f==="onScroll"&&Re("scroll",a)}switch(r){case"input":wt(a),At(a,d,!0);break;case"textarea":wt(a),_n(a);break;case"select":case"option":break;default:typeof d.onClick=="function"&&(a.onclick=Al)}a=c,n.updateQueue=a,a!==null&&(n.flags|=4)}else{f=c.nodeType===9?c:c.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=fn(r)),e==="http://www.w3.org/1999/xhtml"?r==="script"?(e=f.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof a.is=="string"?e=f.createElement(r,{is:a.is}):(e=f.createElement(r),r==="select"&&(f=e,a.multiple?f.multiple=!0:a.size&&(f.size=a.size))):e=f.createElementNS(e,r),e[an]=n,e[Rs]=a,Ku(e,n,!1,!1),n.stateNode=e;e:{switch(f=or(r,a),r){case"dialog":Re("cancel",e),Re("close",e),c=a;break;case"iframe":case"object":case"embed":Re("load",e),c=a;break;case"video":case"audio":for(c=0;c<_s.length;c++)Re(_s[c],e);c=a;break;case"source":Re("error",e),c=a;break;case"img":case"image":case"link":Re("error",e),Re("load",e),c=a;break;case"details":Re("toggle",e),c=a;break;case"input":et(e,a),c=tn(e,a),Re("invalid",e);break;case"option":c=a;break;case"select":e._wrapperState={wasMultiple:!!a.multiple},c=Y({},a,{value:void 0}),Re("invalid",e);break;case"textarea":ol(e,a),c=Tr(e,a),Re("invalid",e);break;default:c=a}sn(r,c),g=c;for(d in g)if(g.hasOwnProperty(d)){var w=g[d];d==="style"?ir(e,w):d==="dangerouslySetInnerHTML"?(w=w?w.__html:void 0,w!=null&&os(e,w)):d==="children"?typeof w=="string"?(r!=="textarea"||w!=="")&&An(e,w):typeof w=="number"&&An(e,""+w):d!=="suppressContentEditableWarning"&&d!=="suppressHydrationWarning"&&d!=="autoFocus"&&(u.hasOwnProperty(d)?w!=null&&d==="onScroll"&&Re("scroll",e):w!=null&&R(e,d,w,f))}switch(r){case"input":wt(e),At(e,a,!1);break;case"textarea":wt(e),_n(e);break;case"option":a.value!=null&&e.setAttribute("value",""+Q(a.value));break;case"select":e.multiple=!!a.multiple,d=a.value,d!=null?hn(e,!!a.multiple,d,!1):a.defaultValue!=null&&hn(e,!!a.multiple,a.defaultValue,!0);break;default:typeof c.onClick=="function"&&(e.onclick=Al)}switch(r){case"button":case"input":case"select":case"textarea":a=!!a.autoFocus;break e;case"img":a=!0;break e;default:a=!1}}a&&(n.flags|=4)}n.ref!==null&&(n.flags|=512,n.flags|=2097152)}return at(n),null;case 6:if(e&&n.stateNode!=null)Zu(e,n,e.memoizedProps,a);else{if(typeof a!="string"&&n.stateNode===null)throw Error(i(166));if(r=gr(Fs.current),gr(on.current),zl(n)){if(a=n.stateNode,r=n.memoizedProps,a[an]=n,(d=a.nodeValue!==r)&&(e=Ct,e!==null))switch(e.tag){case 3:Ll(a.nodeValue,r,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Ll(a.nodeValue,r,(e.mode&1)!==0)}d&&(n.flags|=4)}else a=(r.nodeType===9?r:r.ownerDocument).createTextNode(a),a[an]=n,n.stateNode=a}return at(n),null;case 13:if(Me(Oe),a=n.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Ie&&Et!==null&&(n.mode&1)!==0&&(n.flags&128)===0)eu(),Vr(),n.flags|=98560,d=!1;else if(d=zl(n),a!==null&&a.dehydrated!==null){if(e===null){if(!d)throw Error(i(318));if(d=n.memoizedState,d=d!==null?d.dehydrated:null,!d)throw Error(i(317));d[an]=n}else Vr(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;at(n),d=!1}else Kt!==null&&(ro(Kt),Kt=null),d=!0;if(!d)return n.flags&65536?n:null}return(n.flags&128)!==0?(n.lanes=r,n):(a=a!==null,a!==(e!==null&&e.memoizedState!==null)&&a&&(n.child.flags|=8192,(n.mode&1)!==0&&(e===null||(Oe.current&1)!==0?Ye===0&&(Ye=3):ao())),n.updateQueue!==null&&(n.flags|=4),at(n),null);case 4:return Qr(),Gi(e,n),e===null&&Ls(n.stateNode.containerInfo),at(n),null;case 10:return ji(n.type._context),at(n),null;case 17:return pt(n.type)&&Ml(),at(n),null;case 19:if(Me(Oe),d=n.memoizedState,d===null)return at(n),null;if(a=(n.flags&128)!==0,f=d.rendering,f===null)if(a)Hs(d,!1);else{if(Ye!==0||e!==null&&(e.flags&128)!==0)for(e=n.child;e!==null;){if(f=Wl(e),f!==null){for(n.flags|=128,Hs(d,!1),a=f.updateQueue,a!==null&&(n.updateQueue=a,n.flags|=4),n.subtreeFlags=0,a=r,r=n.child;r!==null;)d=r,e=a,d.flags&=14680066,f=d.alternate,f===null?(d.childLanes=0,d.lanes=e,d.child=null,d.subtreeFlags=0,d.memoizedProps=null,d.memoizedState=null,d.updateQueue=null,d.dependencies=null,d.stateNode=null):(d.childLanes=f.childLanes,d.lanes=f.lanes,d.child=f.child,d.subtreeFlags=0,d.deletions=null,d.memoizedProps=f.memoizedProps,d.memoizedState=f.memoizedState,d.updateQueue=f.updateQueue,d.type=f.type,e=f.dependencies,d.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),r=r.sibling;return Ae(Oe,Oe.current&1|2),n.child}e=e.sibling}d.tail!==null&&be()>Jr&&(n.flags|=128,a=!0,Hs(d,!1),n.lanes=4194304)}else{if(!a)if(e=Wl(f),e!==null){if(n.flags|=128,a=!0,r=e.updateQueue,r!==null&&(n.updateQueue=r,n.flags|=4),Hs(d,!0),d.tail===null&&d.tailMode==="hidden"&&!f.alternate&&!Ie)return at(n),null}else 2*be()-d.renderingStartTime>Jr&&r!==1073741824&&(n.flags|=128,a=!0,Hs(d,!1),n.lanes=4194304);d.isBackwards?(f.sibling=n.child,n.child=f):(r=d.last,r!==null?r.sibling=f:n.child=f,d.last=f)}return d.tail!==null?(n=d.tail,d.rendering=n,d.tail=n.sibling,d.renderingStartTime=be(),n.sibling=null,r=Oe.current,Ae(Oe,a?r&1|2:r&1),n):(at(n),null);case 22:case 23:return lo(),a=n.memoizedState!==null,e!==null&&e.memoizedState!==null!==a&&(n.flags|=8192),a&&(n.mode&1)!==0?(Tt&1073741824)!==0&&(at(n),n.subtreeFlags&6&&(n.flags|=8192)):at(n),null;case 24:return null;case 25:return null}throw Error(i(156,n.tag))}function y0(e,n){switch(fi(n),n.tag){case 1:return pt(n.type)&&Ml(),e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 3:return Qr(),Me(xt),Me(st),Ei(),e=n.flags,(e&65536)!==0&&(e&128)===0?(n.flags=e&-65537|128,n):null;case 5:return ki(n),null;case 13:if(Me(Oe),e=n.memoizedState,e!==null&&e.dehydrated!==null){if(n.alternate===null)throw Error(i(340));Vr()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 19:return Me(Oe),null;case 4:return Qr(),null;case 10:return ji(n.type._context),null;case 22:case 23:return lo(),null;case 24:return null;default:return null}}var ea=!1,it=!1,v0=typeof WeakSet=="function"?WeakSet:Set,q=null;function Xr(e,n){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(a){$e(e,n,a)}else r.current=null}function Yi(e,n,r){try{r()}catch(a){$e(e,n,a)}}var Ju=!1;function j0(e,n){if(li=jl,e=_c(),Za(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var a=r.getSelection&&r.getSelection();if(a&&a.rangeCount!==0){r=a.anchorNode;var c=a.anchorOffset,d=a.focusNode;a=a.focusOffset;try{r.nodeType,d.nodeType}catch{r=null;break e}var f=0,g=-1,w=-1,_=0,z=0,U=e,F=null;t:for(;;){for(var K;U!==r||c!==0&&U.nodeType!==3||(g=f+c),U!==d||a!==0&&U.nodeType!==3||(w=f+a),U.nodeType===3&&(f+=U.nodeValue.length),(K=U.firstChild)!==null;)F=U,U=K;for(;;){if(U===e)break t;if(F===r&&++_===c&&(g=f),F===d&&++z===a&&(w=f),(K=U.nextSibling)!==null)break;U=F,F=U.parentNode}U=K}r=g===-1||w===-1?null:{start:g,end:w}}else r=null}r=r||{start:0,end:0}}else r=null;for(ai={focusedElem:e,selectionRange:r},jl=!1,q=n;q!==null;)if(n=q,e=n.child,(n.subtreeFlags&1028)!==0&&e!==null)e.return=n,q=e;else for(;q!==null;){n=q;try{var te=n.alternate;if((n.flags&1024)!==0)switch(n.tag){case 0:case 11:case 15:break;case 1:if(te!==null){var re=te.memoizedProps,Be=te.memoizedState,C=n.stateNode,b=C.getSnapshotBeforeUpdate(n.elementType===n.type?re:Xt(n.type,re),Be);C.__reactInternalSnapshotBeforeUpdate=b}break;case 3:var T=n.stateNode.containerInfo;T.nodeType===1?T.textContent="":T.nodeType===9&&T.documentElement&&T.removeChild(T.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(i(163))}}catch(V){$e(n,n.return,V)}if(e=n.sibling,e!==null){e.return=n.return,q=e;break}q=n.return}return te=Ju,Ju=!1,te}function Vs(e,n,r){var a=n.updateQueue;if(a=a!==null?a.lastEffect:null,a!==null){var c=a=a.next;do{if((c.tag&e)===e){var d=c.destroy;c.destroy=void 0,d!==void 0&&Yi(n,r,d)}c=c.next}while(c!==a)}}function ta(e,n){if(n=n.updateQueue,n=n!==null?n.lastEffect:null,n!==null){var r=n=n.next;do{if((r.tag&e)===e){var a=r.create;r.destroy=a()}r=r.next}while(r!==n)}}function Qi(e){var n=e.ref;if(n!==null){var r=e.stateNode;e.tag,e=r,typeof n=="function"?n(e):n.current=e}}function qu(e){var n=e.alternate;n!==null&&(e.alternate=null,qu(n)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(n=e.stateNode,n!==null&&(delete n[an],delete n[Rs],delete n[ui],delete n[n0],delete n[r0])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function ed(e){return e.tag===5||e.tag===3||e.tag===4}function td(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||ed(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Ki(e,n,r){var a=e.tag;if(a===5||a===6)e=e.stateNode,n?r.nodeType===8?r.parentNode.insertBefore(e,n):r.insertBefore(e,n):(r.nodeType===8?(n=r.parentNode,n.insertBefore(e,r)):(n=r,n.appendChild(e)),r=r._reactRootContainer,r!=null||n.onclick!==null||(n.onclick=Al));else if(a!==4&&(e=e.child,e!==null))for(Ki(e,n,r),e=e.sibling;e!==null;)Ki(e,n,r),e=e.sibling}function Xi(e,n,r){var a=e.tag;if(a===5||a===6)e=e.stateNode,n?r.insertBefore(e,n):r.appendChild(e);else if(a!==4&&(e=e.child,e!==null))for(Xi(e,n,r),e=e.sibling;e!==null;)Xi(e,n,r),e=e.sibling}var tt=null,Zt=!1;function Kn(e,n,r){for(r=r.child;r!==null;)nd(e,n,r),r=r.sibling}function nd(e,n,r){if(St&&typeof St.onCommitFiberUnmount=="function")try{St.onCommitFiberUnmount(dr,r)}catch{}switch(r.tag){case 5:it||Xr(r,n);case 6:var a=tt,c=Zt;tt=null,Kn(e,n,r),tt=a,Zt=c,tt!==null&&(Zt?(e=tt,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):tt.removeChild(r.stateNode));break;case 18:tt!==null&&(Zt?(e=tt,r=r.stateNode,e.nodeType===8?ci(e.parentNode,r):e.nodeType===1&&ci(e,r),Ns(e)):ci(tt,r.stateNode));break;case 4:a=tt,c=Zt,tt=r.stateNode.containerInfo,Zt=!0,Kn(e,n,r),tt=a,Zt=c;break;case 0:case 11:case 14:case 15:if(!it&&(a=r.updateQueue,a!==null&&(a=a.lastEffect,a!==null))){c=a=a.next;do{var d=c,f=d.destroy;d=d.tag,f!==void 0&&((d&2)!==0||(d&4)!==0)&&Yi(r,n,f),c=c.next}while(c!==a)}Kn(e,n,r);break;case 1:if(!it&&(Xr(r,n),a=r.stateNode,typeof a.componentWillUnmount=="function"))try{a.props=r.memoizedProps,a.state=r.memoizedState,a.componentWillUnmount()}catch(g){$e(r,n,g)}Kn(e,n,r);break;case 21:Kn(e,n,r);break;case 22:r.mode&1?(it=(a=it)||r.memoizedState!==null,Kn(e,n,r),it=a):Kn(e,n,r);break;default:Kn(e,n,r)}}function rd(e){var n=e.updateQueue;if(n!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new v0),n.forEach(function(a){var c=P0.bind(null,e,a);r.has(a)||(r.add(a),a.then(c,c))})}}function Jt(e,n){var r=n.deletions;if(r!==null)for(var a=0;a<r.length;a++){var c=r[a];try{var d=e,f=n,g=f;e:for(;g!==null;){switch(g.tag){case 5:tt=g.stateNode,Zt=!1;break e;case 3:tt=g.stateNode.containerInfo,Zt=!0;break e;case 4:tt=g.stateNode.containerInfo,Zt=!0;break e}g=g.return}if(tt===null)throw Error(i(160));nd(d,f,c),tt=null,Zt=!1;var w=c.alternate;w!==null&&(w.return=null),c.return=null}catch(_){$e(c,n,_)}}if(n.subtreeFlags&12854)for(n=n.child;n!==null;)sd(n,e),n=n.sibling}function sd(e,n){var r=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Jt(n,e),un(e),a&4){try{Vs(3,e,e.return),ta(3,e)}catch(re){$e(e,e.return,re)}try{Vs(5,e,e.return)}catch(re){$e(e,e.return,re)}}break;case 1:Jt(n,e),un(e),a&512&&r!==null&&Xr(r,r.return);break;case 5:if(Jt(n,e),un(e),a&512&&r!==null&&Xr(r,r.return),e.flags&32){var c=e.stateNode;try{An(c,"")}catch(re){$e(e,e.return,re)}}if(a&4&&(c=e.stateNode,c!=null)){var d=e.memoizedProps,f=r!==null?r.memoizedProps:d,g=e.type,w=e.updateQueue;if(e.updateQueue=null,w!==null)try{g==="input"&&d.type==="radio"&&d.name!=null&&bt(c,d),or(g,f);var _=or(g,d);for(f=0;f<w.length;f+=2){var z=w[f],U=w[f+1];z==="style"?ir(c,U):z==="dangerouslySetInnerHTML"?os(c,U):z==="children"?An(c,U):R(c,z,U,_)}switch(g){case"input":nn(c,d);break;case"textarea":Pr(c,d);break;case"select":var F=c._wrapperState.wasMultiple;c._wrapperState.wasMultiple=!!d.multiple;var K=d.value;K!=null?hn(c,!!d.multiple,K,!1):F!==!!d.multiple&&(d.defaultValue!=null?hn(c,!!d.multiple,d.defaultValue,!0):hn(c,!!d.multiple,d.multiple?[]:"",!1))}c[Rs]=d}catch(re){$e(e,e.return,re)}}break;case 6:if(Jt(n,e),un(e),a&4){if(e.stateNode===null)throw Error(i(162));c=e.stateNode,d=e.memoizedProps;try{c.nodeValue=d}catch(re){$e(e,e.return,re)}}break;case 3:if(Jt(n,e),un(e),a&4&&r!==null&&r.memoizedState.isDehydrated)try{Ns(n.containerInfo)}catch(re){$e(e,e.return,re)}break;case 4:Jt(n,e),un(e);break;case 13:Jt(n,e),un(e),c=e.child,c.flags&8192&&(d=c.memoizedState!==null,c.stateNode.isHidden=d,!d||c.alternate!==null&&c.alternate.memoizedState!==null||(qi=be())),a&4&&rd(e);break;case 22:if(z=r!==null&&r.memoizedState!==null,e.mode&1?(it=(_=it)||z,Jt(n,e),it=_):Jt(n,e),un(e),a&8192){if(_=e.memoizedState!==null,(e.stateNode.isHidden=_)&&!z&&(e.mode&1)!==0)for(q=e,z=e.child;z!==null;){for(U=q=z;q!==null;){switch(F=q,K=F.child,F.tag){case 0:case 11:case 14:case 15:Vs(4,F,F.return);break;case 1:Xr(F,F.return);var te=F.stateNode;if(typeof te.componentWillUnmount=="function"){a=F,r=F.return;try{n=a,te.props=n.memoizedProps,te.state=n.memoizedState,te.componentWillUnmount()}catch(re){$e(a,r,re)}}break;case 5:Xr(F,F.return);break;case 22:if(F.memoizedState!==null){id(U);continue}}K!==null?(K.return=F,q=K):id(U)}z=z.sibling}e:for(z=null,U=e;;){if(U.tag===5){if(z===null){z=U;try{c=U.stateNode,_?(d=c.style,typeof d.setProperty=="function"?d.setProperty("display","none","important"):d.display="none"):(g=U.stateNode,w=U.memoizedProps.style,f=w!=null&&w.hasOwnProperty("display")?w.display:null,g.style.display=ar("display",f))}catch(re){$e(e,e.return,re)}}}else if(U.tag===6){if(z===null)try{U.stateNode.nodeValue=_?"":U.memoizedProps}catch(re){$e(e,e.return,re)}}else if((U.tag!==22&&U.tag!==23||U.memoizedState===null||U===e)&&U.child!==null){U.child.return=U,U=U.child;continue}if(U===e)break e;for(;U.sibling===null;){if(U.return===null||U.return===e)break e;z===U&&(z=null),U=U.return}z===U&&(z=null),U.sibling.return=U.return,U=U.sibling}}break;case 19:Jt(n,e),un(e),a&4&&rd(e);break;case 21:break;default:Jt(n,e),un(e)}}function un(e){var n=e.flags;if(n&2){try{e:{for(var r=e.return;r!==null;){if(ed(r)){var a=r;break e}r=r.return}throw Error(i(160))}switch(a.tag){case 5:var c=a.stateNode;a.flags&32&&(An(c,""),a.flags&=-33);var d=td(e);Xi(e,d,c);break;case 3:case 4:var f=a.stateNode.containerInfo,g=td(e);Ki(e,g,f);break;default:throw Error(i(161))}}catch(w){$e(e,e.return,w)}e.flags&=-3}n&4096&&(e.flags&=-4097)}function w0(e,n,r){q=e,ld(e)}function ld(e,n,r){for(var a=(e.mode&1)!==0;q!==null;){var c=q,d=c.child;if(c.tag===22&&a){var f=c.memoizedState!==null||ea;if(!f){var g=c.alternate,w=g!==null&&g.memoizedState!==null||it;g=ea;var _=it;if(ea=f,(it=w)&&!_)for(q=c;q!==null;)f=q,w=f.child,f.tag===22&&f.memoizedState!==null?od(c):w!==null?(w.return=f,q=w):od(c);for(;d!==null;)q=d,ld(d),d=d.sibling;q=c,ea=g,it=_}ad(e)}else(c.subtreeFlags&8772)!==0&&d!==null?(d.return=c,q=d):ad(e)}}function ad(e){for(;q!==null;){var n=q;if((n.flags&8772)!==0){var r=n.alternate;try{if((n.flags&8772)!==0)switch(n.tag){case 0:case 11:case 15:it||ta(5,n);break;case 1:var a=n.stateNode;if(n.flags&4&&!it)if(r===null)a.componentDidMount();else{var c=n.elementType===n.type?r.memoizedProps:Xt(n.type,r.memoizedProps);a.componentDidUpdate(c,r.memoizedState,a.__reactInternalSnapshotBeforeUpdate)}var d=n.updateQueue;d!==null&&iu(n,d,a);break;case 3:var f=n.updateQueue;if(f!==null){if(r=null,n.child!==null)switch(n.child.tag){case 5:r=n.child.stateNode;break;case 1:r=n.child.stateNode}iu(n,f,r)}break;case 5:var g=n.stateNode;if(r===null&&n.flags&4){r=g;var w=n.memoizedProps;switch(n.type){case"button":case"input":case"select":case"textarea":w.autoFocus&&r.focus();break;case"img":w.src&&(r.src=w.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(n.memoizedState===null){var _=n.alternate;if(_!==null){var z=_.memoizedState;if(z!==null){var U=z.dehydrated;U!==null&&Ns(U)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(i(163))}it||n.flags&512&&Qi(n)}catch(F){$e(n,n.return,F)}}if(n===e){q=null;break}if(r=n.sibling,r!==null){r.return=n.return,q=r;break}q=n.return}}function id(e){for(;q!==null;){var n=q;if(n===e){q=null;break}var r=n.sibling;if(r!==null){r.return=n.return,q=r;break}q=n.return}}function od(e){for(;q!==null;){var n=q;try{switch(n.tag){case 0:case 11:case 15:var r=n.return;try{ta(4,n)}catch(w){$e(n,r,w)}break;case 1:var a=n.stateNode;if(typeof a.componentDidMount=="function"){var c=n.return;try{a.componentDidMount()}catch(w){$e(n,c,w)}}var d=n.return;try{Qi(n)}catch(w){$e(n,d,w)}break;case 5:var f=n.return;try{Qi(n)}catch(w){$e(n,f,w)}}}catch(w){$e(n,n.return,w)}if(n===e){q=null;break}var g=n.sibling;if(g!==null){g.return=n.return,q=g;break}q=n.return}}var N0=Math.ceil,na=$.ReactCurrentDispatcher,Zi=$.ReactCurrentOwner,zt=$.ReactCurrentBatchConfig,Ce=0,Xe=null,Ve=null,nt=0,Tt=0,Zr=Vn(0),Ye=0,Ws=null,vr=0,ra=0,Ji=0,Gs=null,yt=null,qi=0,Jr=1/0,kn=null,sa=!1,eo=null,Xn=null,la=!1,Zn=null,aa=0,Ys=0,to=null,ia=-1,oa=0;function ut(){return(Ce&6)!==0?be():ia!==-1?ia:ia=be()}function Jn(e){return(e.mode&1)===0?1:(Ce&2)!==0&&nt!==0?nt&-nt:l0.transition!==null?(oa===0&&(oa=tc()),oa):(e=_e,e!==0||(e=window.event,e=e===void 0?16:uc(e.type)),e)}function qt(e,n,r,a){if(50<Ys)throw Ys=0,to=null,Error(i(185));gs(e,r,a),((Ce&2)===0||e!==Xe)&&(e===Xe&&((Ce&2)===0&&(ra|=r),Ye===4&&qn(e,nt)),vt(e,a),r===1&&Ce===0&&(n.mode&1)===0&&(Jr=be()+500,Ol&&Gn()))}function vt(e,n){var r=e.callbackNode;lh(e,n);var a=gl(e,e===Xe?nt:0);if(a===0)r!==null&&H(r),e.callbackNode=null,e.callbackPriority=0;else if(n=a&-a,e.callbackPriority!==n){if(r!=null&&H(r),n===1)e.tag===0?s0(ud.bind(null,e)):Kc(ud.bind(null,e)),e0(function(){(Ce&6)===0&&Gn()}),r=null;else{switch(nc(a)){case 1:r=Qe;break;case 4:r=Mt;break;case 16:r=Gt;break;case 536870912:r=He;break;default:r=Gt}r=yd(r,cd.bind(null,e))}e.callbackPriority=n,e.callbackNode=r}}function cd(e,n){if(ia=-1,oa=0,(Ce&6)!==0)throw Error(i(327));var r=e.callbackNode;if(qr()&&e.callbackNode!==r)return null;var a=gl(e,e===Xe?nt:0);if(a===0)return null;if((a&30)!==0||(a&e.expiredLanes)!==0||n)n=ca(e,a);else{n=a;var c=Ce;Ce|=2;var d=md();(Xe!==e||nt!==n)&&(kn=null,Jr=be()+500,wr(e,n));do try{k0();break}catch(g){dd(e,g)}while(!0);vi(),na.current=d,Ce=c,Ve!==null?n=0:(Xe=null,nt=0,n=Ye)}if(n!==0){if(n===2&&(c=Ia(e),c!==0&&(a=c,n=no(e,c))),n===1)throw r=Ws,wr(e,0),qn(e,a),vt(e,be()),r;if(n===6)qn(e,a);else{if(c=e.current.alternate,(a&30)===0&&!b0(c)&&(n=ca(e,a),n===2&&(d=Ia(e),d!==0&&(a=d,n=no(e,d))),n===1))throw r=Ws,wr(e,0),qn(e,a),vt(e,be()),r;switch(e.finishedWork=c,e.finishedLanes=a,n){case 0:case 1:throw Error(i(345));case 2:Nr(e,yt,kn);break;case 3:if(qn(e,a),(a&130023424)===a&&(n=qi+500-be(),10<n)){if(gl(e,0)!==0)break;if(c=e.suspendedLanes,(c&a)!==a){ut(),e.pingedLanes|=e.suspendedLanes&c;break}e.timeoutHandle=oi(Nr.bind(null,e,yt,kn),n);break}Nr(e,yt,kn);break;case 4:if(qn(e,a),(a&4194240)===a)break;for(n=e.eventTimes,c=-1;0<a;){var f=31-Yt(a);d=1<<f,f=n[f],f>c&&(c=f),a&=~d}if(a=c,a=be()-a,a=(120>a?120:480>a?480:1080>a?1080:1920>a?1920:3e3>a?3e3:4320>a?4320:1960*N0(a/1960))-a,10<a){e.timeoutHandle=oi(Nr.bind(null,e,yt,kn),a);break}Nr(e,yt,kn);break;case 5:Nr(e,yt,kn);break;default:throw Error(i(329))}}}return vt(e,be()),e.callbackNode===r?cd.bind(null,e):null}function no(e,n){var r=Gs;return e.current.memoizedState.isDehydrated&&(wr(e,n).flags|=256),e=ca(e,n),e!==2&&(n=yt,yt=r,n!==null&&ro(n)),e}function ro(e){yt===null?yt=e:yt.push.apply(yt,e)}function b0(e){for(var n=e;;){if(n.flags&16384){var r=n.updateQueue;if(r!==null&&(r=r.stores,r!==null))for(var a=0;a<r.length;a++){var c=r[a],d=c.getSnapshot;c=c.value;try{if(!Qt(d(),c))return!1}catch{return!1}}}if(r=n.child,n.subtreeFlags&16384&&r!==null)r.return=n,n=r;else{if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return!0;n=n.return}n.sibling.return=n.return,n=n.sibling}}return!0}function qn(e,n){for(n&=~Ji,n&=~ra,e.suspendedLanes|=n,e.pingedLanes&=~n,e=e.expirationTimes;0<n;){var r=31-Yt(n),a=1<<r;e[r]=-1,n&=~a}}function ud(e){if((Ce&6)!==0)throw Error(i(327));qr();var n=gl(e,0);if((n&1)===0)return vt(e,be()),null;var r=ca(e,n);if(e.tag!==0&&r===2){var a=Ia(e);a!==0&&(n=a,r=no(e,a))}if(r===1)throw r=Ws,wr(e,0),qn(e,n),vt(e,be()),r;if(r===6)throw Error(i(345));return e.finishedWork=e.current.alternate,e.finishedLanes=n,Nr(e,yt,kn),vt(e,be()),null}function so(e,n){var r=Ce;Ce|=1;try{return e(n)}finally{Ce=r,Ce===0&&(Jr=be()+500,Ol&&Gn())}}function jr(e){Zn!==null&&Zn.tag===0&&(Ce&6)===0&&qr();var n=Ce;Ce|=1;var r=zt.transition,a=_e;try{if(zt.transition=null,_e=1,e)return e()}finally{_e=a,zt.transition=r,Ce=n,(Ce&6)===0&&Gn()}}function lo(){Tt=Zr.current,Me(Zr)}function wr(e,n){e.finishedWork=null,e.finishedLanes=0;var r=e.timeoutHandle;if(r!==-1&&(e.timeoutHandle=-1,qh(r)),Ve!==null)for(r=Ve.return;r!==null;){var a=r;switch(fi(a),a.tag){case 1:a=a.type.childContextTypes,a!=null&&Ml();break;case 3:Qr(),Me(xt),Me(st),Ei();break;case 5:ki(a);break;case 4:Qr();break;case 13:Me(Oe);break;case 19:Me(Oe);break;case 10:ji(a.type._context);break;case 22:case 23:lo()}r=r.return}if(Xe=e,Ve=e=er(e.current,null),nt=Tt=n,Ye=0,Ws=null,Ji=ra=vr=0,yt=Gs=null,pr!==null){for(n=0;n<pr.length;n++)if(r=pr[n],a=r.interleaved,a!==null){r.interleaved=null;var c=a.next,d=r.pending;if(d!==null){var f=d.next;d.next=c,a.next=f}r.pending=a}pr=null}return e}function dd(e,n){do{var r=Ve;try{if(vi(),Gl.current=Xl,Yl){for(var a=De.memoizedState;a!==null;){var c=a.queue;c!==null&&(c.pending=null),a=a.next}Yl=!1}if(yr=0,Ke=Ge=De=null,zs=!1,$s=0,Zi.current=null,r===null||r.return===null){Ye=1,Ws=n,Ve=null;break}e:{var d=e,f=r.return,g=r,w=n;if(n=nt,g.flags|=32768,w!==null&&typeof w=="object"&&typeof w.then=="function"){var _=w,z=g,U=z.tag;if((z.mode&1)===0&&(U===0||U===11||U===15)){var F=z.alternate;F?(z.updateQueue=F.updateQueue,z.memoizedState=F.memoizedState,z.lanes=F.lanes):(z.updateQueue=null,z.memoizedState=null)}var K=Ou(f);if(K!==null){K.flags&=-257,Du(K,f,g,d,n),K.mode&1&&Iu(d,_,n),n=K,w=_;var te=n.updateQueue;if(te===null){var re=new Set;re.add(w),n.updateQueue=re}else te.add(w);break e}else{if((n&1)===0){Iu(d,_,n),ao();break e}w=Error(i(426))}}else if(Ie&&g.mode&1){var Be=Ou(f);if(Be!==null){(Be.flags&65536)===0&&(Be.flags|=256),Du(Be,f,g,d,n),gi(Kr(w,g));break e}}d=w=Kr(w,g),Ye!==4&&(Ye=2),Gs===null?Gs=[d]:Gs.push(d),d=f;do{switch(d.tag){case 3:d.flags|=65536,n&=-n,d.lanes|=n;var C=Ru(d,w,n);au(d,C);break e;case 1:g=w;var b=d.type,T=d.stateNode;if((d.flags&128)===0&&(typeof b.getDerivedStateFromError=="function"||T!==null&&typeof T.componentDidCatch=="function"&&(Xn===null||!Xn.has(T)))){d.flags|=65536,n&=-n,d.lanes|=n;var V=Mu(d,g,n);au(d,V);break e}}d=d.return}while(d!==null)}fd(r)}catch(le){n=le,Ve===r&&r!==null&&(Ve=r=r.return);continue}break}while(!0)}function md(){var e=na.current;return na.current=Xl,e===null?Xl:e}function ao(){(Ye===0||Ye===3||Ye===2)&&(Ye=4),Xe===null||(vr&268435455)===0&&(ra&268435455)===0||qn(Xe,nt)}function ca(e,n){var r=Ce;Ce|=2;var a=md();(Xe!==e||nt!==n)&&(kn=null,wr(e,n));do try{S0();break}catch(c){dd(e,c)}while(!0);if(vi(),Ce=r,na.current=a,Ve!==null)throw Error(i(261));return Xe=null,nt=0,Ye}function S0(){for(;Ve!==null;)hd(Ve)}function k0(){for(;Ve!==null&&!ne();)hd(Ve)}function hd(e){var n=gd(e.alternate,e,Tt);e.memoizedProps=e.pendingProps,n===null?fd(e):Ve=n,Zi.current=null}function fd(e){var n=e;do{var r=n.alternate;if(e=n.return,(n.flags&32768)===0){if(r=g0(r,n,Tt),r!==null){Ve=r;return}}else{if(r=y0(r,n),r!==null){r.flags&=32767,Ve=r;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Ye=6,Ve=null;return}}if(n=n.sibling,n!==null){Ve=n;return}Ve=n=e}while(n!==null);Ye===0&&(Ye=5)}function Nr(e,n,r){var a=_e,c=zt.transition;try{zt.transition=null,_e=1,C0(e,n,r,a)}finally{zt.transition=c,_e=a}return null}function C0(e,n,r,a){do qr();while(Zn!==null);if((Ce&6)!==0)throw Error(i(327));r=e.finishedWork;var c=e.finishedLanes;if(r===null)return null;if(e.finishedWork=null,e.finishedLanes=0,r===e.current)throw Error(i(177));e.callbackNode=null,e.callbackPriority=0;var d=r.lanes|r.childLanes;if(ah(e,d),e===Xe&&(Ve=Xe=null,nt=0),(r.subtreeFlags&2064)===0&&(r.flags&2064)===0||la||(la=!0,yd(Gt,function(){return qr(),null})),d=(r.flags&15990)!==0,(r.subtreeFlags&15990)!==0||d){d=zt.transition,zt.transition=null;var f=_e;_e=1;var g=Ce;Ce|=4,Zi.current=null,j0(e,r),sd(r,e),Gh(ai),jl=!!li,ai=li=null,e.current=r,w0(r),Le(),Ce=g,_e=f,zt.transition=d}else e.current=r;if(la&&(la=!1,Zn=e,aa=c),d=e.pendingLanes,d===0&&(Xn=null),eh(r.stateNode),vt(e,be()),n!==null)for(a=e.onRecoverableError,r=0;r<n.length;r++)c=n[r],a(c.value,{componentStack:c.stack,digest:c.digest});if(sa)throw sa=!1,e=eo,eo=null,e;return(aa&1)!==0&&e.tag!==0&&qr(),d=e.pendingLanes,(d&1)!==0?e===to?Ys++:(Ys=0,to=e):Ys=0,Gn(),null}function qr(){if(Zn!==null){var e=nc(aa),n=zt.transition,r=_e;try{if(zt.transition=null,_e=16>e?16:e,Zn===null)var a=!1;else{if(e=Zn,Zn=null,aa=0,(Ce&6)!==0)throw Error(i(331));var c=Ce;for(Ce|=4,q=e.current;q!==null;){var d=q,f=d.child;if((q.flags&16)!==0){var g=d.deletions;if(g!==null){for(var w=0;w<g.length;w++){var _=g[w];for(q=_;q!==null;){var z=q;switch(z.tag){case 0:case 11:case 15:Vs(8,z,d)}var U=z.child;if(U!==null)U.return=z,q=U;else for(;q!==null;){z=q;var F=z.sibling,K=z.return;if(qu(z),z===_){q=null;break}if(F!==null){F.return=K,q=F;break}q=K}}}var te=d.alternate;if(te!==null){var re=te.child;if(re!==null){te.child=null;do{var Be=re.sibling;re.sibling=null,re=Be}while(re!==null)}}q=d}}if((d.subtreeFlags&2064)!==0&&f!==null)f.return=d,q=f;else e:for(;q!==null;){if(d=q,(d.flags&2048)!==0)switch(d.tag){case 0:case 11:case 15:Vs(9,d,d.return)}var C=d.sibling;if(C!==null){C.return=d.return,q=C;break e}q=d.return}}var b=e.current;for(q=b;q!==null;){f=q;var T=f.child;if((f.subtreeFlags&2064)!==0&&T!==null)T.return=f,q=T;else e:for(f=b;q!==null;){if(g=q,(g.flags&2048)!==0)try{switch(g.tag){case 0:case 11:case 15:ta(9,g)}}catch(le){$e(g,g.return,le)}if(g===f){q=null;break e}var V=g.sibling;if(V!==null){V.return=g.return,q=V;break e}q=g.return}}if(Ce=c,Gn(),St&&typeof St.onPostCommitFiberRoot=="function")try{St.onPostCommitFiberRoot(dr,e)}catch{}a=!0}return a}finally{_e=r,zt.transition=n}}return!1}function xd(e,n,r){n=Kr(r,n),n=Ru(e,n,1),e=Qn(e,n,1),n=ut(),e!==null&&(gs(e,1,n),vt(e,n))}function $e(e,n,r){if(e.tag===3)xd(e,e,r);else for(;n!==null;){if(n.tag===3){xd(n,e,r);break}else if(n.tag===1){var a=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof a.componentDidCatch=="function"&&(Xn===null||!Xn.has(a))){e=Kr(r,e),e=Mu(n,e,1),n=Qn(n,e,1),e=ut(),n!==null&&(gs(n,1,e),vt(n,e));break}}n=n.return}}function E0(e,n,r){var a=e.pingCache;a!==null&&a.delete(n),n=ut(),e.pingedLanes|=e.suspendedLanes&r,Xe===e&&(nt&r)===r&&(Ye===4||Ye===3&&(nt&130023424)===nt&&500>be()-qi?wr(e,0):Ji|=r),vt(e,n)}function pd(e,n){n===0&&((e.mode&1)===0?n=1:(n=pl,pl<<=1,(pl&130023424)===0&&(pl=4194304)));var r=ut();e=Nn(e,n),e!==null&&(gs(e,n,r),vt(e,r))}function T0(e){var n=e.memoizedState,r=0;n!==null&&(r=n.retryLane),pd(e,r)}function P0(e,n){var r=0;switch(e.tag){case 13:var a=e.stateNode,c=e.memoizedState;c!==null&&(r=c.retryLane);break;case 19:a=e.stateNode;break;default:throw Error(i(314))}a!==null&&a.delete(n),pd(e,r)}var gd;gd=function(e,n,r){if(e!==null)if(e.memoizedProps!==n.pendingProps||xt.current)gt=!0;else{if((e.lanes&r)===0&&(n.flags&128)===0)return gt=!1,p0(e,n,r);gt=(e.flags&131072)!==0}else gt=!1,Ie&&(n.flags&1048576)!==0&&Xc(n,Fl,n.index);switch(n.lanes=0,n.tag){case 2:var a=n.type;ql(e,n),e=n.pendingProps;var c=Br(n,st.current);Yr(n,r),c=_i(null,n,a,e,c,r);var d=Li();return n.flags|=1,typeof c=="object"&&c!==null&&typeof c.render=="function"&&c.$$typeof===void 0?(n.tag=1,n.memoizedState=null,n.updateQueue=null,pt(a)?(d=!0,Il(n)):d=!1,n.memoizedState=c.state!==null&&c.state!==void 0?c.state:null,bi(n),c.updater=Zl,n.stateNode=c,c._reactInternals=n,Di(n,a,e,r),n=Bi(null,n,a,!0,d,r)):(n.tag=0,Ie&&d&&hi(n),ct(null,n,c,r),n=n.child),n;case 16:a=n.elementType;e:{switch(ql(e,n),e=n.pendingProps,c=a._init,a=c(a._payload),n.type=a,c=n.tag=L0(a),e=Xt(a,e),c){case 0:n=$i(null,n,a,e,r);break e;case 1:n=Hu(null,n,a,e,r);break e;case 11:n=Fu(null,n,a,e,r);break e;case 14:n=zu(null,n,a,Xt(a.type,e),r);break e}throw Error(i(306,a,""))}return n;case 0:return a=n.type,c=n.pendingProps,c=n.elementType===a?c:Xt(a,c),$i(e,n,a,c,r);case 1:return a=n.type,c=n.pendingProps,c=n.elementType===a?c:Xt(a,c),Hu(e,n,a,c,r);case 3:e:{if(Vu(n),e===null)throw Error(i(387));a=n.pendingProps,d=n.memoizedState,c=d.element,lu(e,n),Vl(n,a,null,r);var f=n.memoizedState;if(a=f.element,d.isDehydrated)if(d={element:a,isDehydrated:!1,cache:f.cache,pendingSuspenseBoundaries:f.pendingSuspenseBoundaries,transitions:f.transitions},n.updateQueue.baseState=d,n.memoizedState=d,n.flags&256){c=Kr(Error(i(423)),n),n=Wu(e,n,a,r,c);break e}else if(a!==c){c=Kr(Error(i(424)),n),n=Wu(e,n,a,r,c);break e}else for(Et=Hn(n.stateNode.containerInfo.firstChild),Ct=n,Ie=!0,Kt=null,r=ru(n,null,a,r),n.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(Vr(),a===c){n=Sn(e,n,r);break e}ct(e,n,a,r)}n=n.child}return n;case 5:return ou(n),e===null&&pi(n),a=n.type,c=n.pendingProps,d=e!==null?e.memoizedProps:null,f=c.children,ii(a,c)?f=null:d!==null&&ii(a,d)&&(n.flags|=32),Uu(e,n),ct(e,n,f,r),n.child;case 6:return e===null&&pi(n),null;case 13:return Gu(e,n,r);case 4:return Si(n,n.stateNode.containerInfo),a=n.pendingProps,e===null?n.child=Wr(n,null,a,r):ct(e,n,a,r),n.child;case 11:return a=n.type,c=n.pendingProps,c=n.elementType===a?c:Xt(a,c),Fu(e,n,a,c,r);case 7:return ct(e,n,n.pendingProps,r),n.child;case 8:return ct(e,n,n.pendingProps.children,r),n.child;case 12:return ct(e,n,n.pendingProps.children,r),n.child;case 10:e:{if(a=n.type._context,c=n.pendingProps,d=n.memoizedProps,f=c.value,Ae(Bl,a._currentValue),a._currentValue=f,d!==null)if(Qt(d.value,f)){if(d.children===c.children&&!xt.current){n=Sn(e,n,r);break e}}else for(d=n.child,d!==null&&(d.return=n);d!==null;){var g=d.dependencies;if(g!==null){f=d.child;for(var w=g.firstContext;w!==null;){if(w.context===a){if(d.tag===1){w=bn(-1,r&-r),w.tag=2;var _=d.updateQueue;if(_!==null){_=_.shared;var z=_.pending;z===null?w.next=w:(w.next=z.next,z.next=w),_.pending=w}}d.lanes|=r,w=d.alternate,w!==null&&(w.lanes|=r),wi(d.return,r,n),g.lanes|=r;break}w=w.next}}else if(d.tag===10)f=d.type===n.type?null:d.child;else if(d.tag===18){if(f=d.return,f===null)throw Error(i(341));f.lanes|=r,g=f.alternate,g!==null&&(g.lanes|=r),wi(f,r,n),f=d.sibling}else f=d.child;if(f!==null)f.return=d;else for(f=d;f!==null;){if(f===n){f=null;break}if(d=f.sibling,d!==null){d.return=f.return,f=d;break}f=f.return}d=f}ct(e,n,c.children,r),n=n.child}return n;case 9:return c=n.type,a=n.pendingProps.children,Yr(n,r),c=Dt(c),a=a(c),n.flags|=1,ct(e,n,a,r),n.child;case 14:return a=n.type,c=Xt(a,n.pendingProps),c=Xt(a.type,c),zu(e,n,a,c,r);case 15:return $u(e,n,n.type,n.pendingProps,r);case 17:return a=n.type,c=n.pendingProps,c=n.elementType===a?c:Xt(a,c),ql(e,n),n.tag=1,pt(a)?(e=!0,Il(n)):e=!1,Yr(n,r),Lu(n,a,c),Di(n,a,c,r),Bi(null,n,a,!0,e,r);case 19:return Qu(e,n,r);case 22:return Bu(e,n,r)}throw Error(i(156,n.tag))};function yd(e,n){return N(e,n)}function _0(e,n,r,a){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=n,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=a,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function $t(e,n,r,a){return new _0(e,n,r,a)}function io(e){return e=e.prototype,!(!e||!e.isReactComponent)}function L0(e){if(typeof e=="function")return io(e)?1:0;if(e!=null){if(e=e.$$typeof,e===he)return 11;if(e===Pe)return 14}return 2}function er(e,n){var r=e.alternate;return r===null?(r=$t(e.tag,n,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=n,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&14680064,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,n=e.dependencies,r.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function ua(e,n,r,a,c,d){var f=2;if(a=e,typeof e=="function")io(e)&&(f=1);else if(typeof e=="string")f=5;else e:switch(e){case ee:return br(r.children,c,d,n);case pe:f=8,c|=8;break;case xe:return e=$t(12,r,n,c|2),e.elementType=xe,e.lanes=d,e;case ye:return e=$t(13,r,n,c),e.elementType=ye,e.lanes=d,e;case je:return e=$t(19,r,n,c),e.elementType=je,e.lanes=d,e;case ce:return da(r,c,d,n);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case we:f=10;break e;case X:f=9;break e;case he:f=11;break e;case Pe:f=14;break e;case Ne:f=16,a=null;break e}throw Error(i(130,e==null?e:typeof e,""))}return n=$t(f,r,n,c),n.elementType=e,n.type=a,n.lanes=d,n}function br(e,n,r,a){return e=$t(7,e,a,n),e.lanes=r,e}function da(e,n,r,a){return e=$t(22,e,a,n),e.elementType=ce,e.lanes=r,e.stateNode={isHidden:!1},e}function oo(e,n,r){return e=$t(6,e,null,n),e.lanes=r,e}function co(e,n,r){return n=$t(4,e.children!==null?e.children:[],e.key,n),n.lanes=r,n.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},n}function A0(e,n,r,a,c){this.tag=n,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Oa(0),this.expirationTimes=Oa(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Oa(0),this.identifierPrefix=a,this.onRecoverableError=c,this.mutableSourceEagerHydrationData=null}function uo(e,n,r,a,c,d,f,g,w){return e=new A0(e,n,r,g,w),n===1?(n=1,d===!0&&(n|=8)):n=0,d=$t(3,null,null,n),e.current=d,d.stateNode=e,d.memoizedState={element:a,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},bi(d),e}function R0(e,n,r){var a=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:ve,key:a==null?null:""+a,children:e,containerInfo:n,implementation:r}}function vd(e){if(!e)return Wn;e=e._reactInternals;e:{if(ln(e)!==e||e.tag!==1)throw Error(i(170));var n=e;do{switch(n.tag){case 3:n=n.stateNode.context;break e;case 1:if(pt(n.type)){n=n.stateNode.__reactInternalMemoizedMergedChildContext;break e}}n=n.return}while(n!==null);throw Error(i(171))}if(e.tag===1){var r=e.type;if(pt(r))return Yc(e,r,n)}return n}function jd(e,n,r,a,c,d,f,g,w){return e=uo(r,a,!0,e,c,d,f,g,w),e.context=vd(null),r=e.current,a=ut(),c=Jn(r),d=bn(a,c),d.callback=n??null,Qn(r,d,c),e.current.lanes=c,gs(e,c,a),vt(e,a),e}function ma(e,n,r,a){var c=n.current,d=ut(),f=Jn(c);return r=vd(r),n.context===null?n.context=r:n.pendingContext=r,n=bn(d,f),n.payload={element:e},a=a===void 0?null:a,a!==null&&(n.callback=a),e=Qn(c,n,f),e!==null&&(qt(e,c,f,d),Hl(e,c,f)),f}function ha(e){return e=e.current,e.child?(e.child.tag===5,e.child.stateNode):null}function wd(e,n){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<n?r:n}}function mo(e,n){wd(e,n),(e=e.alternate)&&wd(e,n)}function M0(){return null}var Nd=typeof reportError=="function"?reportError:function(e){console.error(e)};function ho(e){this._internalRoot=e}fa.prototype.render=ho.prototype.render=function(e){var n=this._internalRoot;if(n===null)throw Error(i(409));ma(e,n,null,null)},fa.prototype.unmount=ho.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var n=e.containerInfo;jr(function(){ma(null,e,null,null)}),n[yn]=null}};function fa(e){this._internalRoot=e}fa.prototype.unstable_scheduleHydration=function(e){if(e){var n=lc();e={blockedOn:null,target:e,priority:n};for(var r=0;r<$n.length&&n!==0&&n<$n[r].priority;r++);$n.splice(r,0,e),r===0&&oc(e)}};function fo(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function xa(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function bd(){}function I0(e,n,r,a,c){if(c){if(typeof a=="function"){var d=a;a=function(){var _=ha(f);d.call(_)}}var f=jd(n,a,e,0,null,!1,!1,"",bd);return e._reactRootContainer=f,e[yn]=f.current,Ls(e.nodeType===8?e.parentNode:e),jr(),f}for(;c=e.lastChild;)e.removeChild(c);if(typeof a=="function"){var g=a;a=function(){var _=ha(w);g.call(_)}}var w=uo(e,0,!1,null,null,!1,!1,"",bd);return e._reactRootContainer=w,e[yn]=w.current,Ls(e.nodeType===8?e.parentNode:e),jr(function(){ma(n,w,r,a)}),w}function pa(e,n,r,a,c){var d=r._reactRootContainer;if(d){var f=d;if(typeof c=="function"){var g=c;c=function(){var w=ha(f);g.call(w)}}ma(n,f,e,c)}else f=I0(r,n,e,c,a);return ha(f)}rc=function(e){switch(e.tag){case 3:var n=e.stateNode;if(n.current.memoizedState.isDehydrated){var r=ps(n.pendingLanes);r!==0&&(Da(n,r|1),vt(n,be()),(Ce&6)===0&&(Jr=be()+500,Gn()))}break;case 13:jr(function(){var a=Nn(e,1);if(a!==null){var c=ut();qt(a,e,1,c)}}),mo(e,1)}},Fa=function(e){if(e.tag===13){var n=Nn(e,134217728);if(n!==null){var r=ut();qt(n,e,134217728,r)}mo(e,134217728)}},sc=function(e){if(e.tag===13){var n=Jn(e),r=Nn(e,n);if(r!==null){var a=ut();qt(r,e,n,a)}mo(e,n)}},lc=function(){return _e},ac=function(e,n){var r=_e;try{return _e=e,n()}finally{_e=r}},Rn=function(e,n,r){switch(n){case"input":if(nn(e,r),n=r.name,r.type==="radio"&&n!=null){for(r=e;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll("input[name="+JSON.stringify(""+n)+'][type="radio"]'),n=0;n<r.length;n++){var a=r[n];if(a!==e&&a.form===e.form){var c=Rl(a);if(!c)throw Error(i(90));qe(a),nn(a,c)}}}break;case"textarea":Pr(e,r);break;case"select":n=r.value,n!=null&&hn(e,!!r.multiple,n,!1)}},Fe=so,pn=jr;var O0={usingClientEntryPoint:!1,Events:[Ms,zr,Rl,ul,dl,so]},Qs={findFiberByHostInstance:mr,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},D0={bundleType:Qs.bundleType,version:Qs.version,rendererPackageName:Qs.rendererPackageName,rendererConfig:Qs.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:$.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=fl(e),e===null?null:e.stateNode},findFiberByHostInstance:Qs.findFiberByHostInstance||M0,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 ga=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ga.isDisabled&&ga.supportsFiber)try{dr=ga.inject(D0),St=ga}catch{}}return jt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=O0,jt.createPortal=function(e,n){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!fo(n))throw Error(i(200));return R0(e,n,null,r)},jt.createRoot=function(e,n){if(!fo(e))throw Error(i(299));var r=!1,a="",c=Nd;return n!=null&&(n.unstable_strictMode===!0&&(r=!0),n.identifierPrefix!==void 0&&(a=n.identifierPrefix),n.onRecoverableError!==void 0&&(c=n.onRecoverableError)),n=uo(e,1,!1,null,null,r,!1,a,c),e[yn]=n.current,Ls(e.nodeType===8?e.parentNode:e),new ho(n)},jt.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var n=e._reactInternals;if(n===void 0)throw typeof e.render=="function"?Error(i(188)):(e=Object.keys(e).join(","),Error(i(268,e)));return e=fl(n),e=e===null?null:e.stateNode,e},jt.flushSync=function(e){return jr(e)},jt.hydrate=function(e,n,r){if(!xa(n))throw Error(i(200));return pa(null,e,n,!0,r)},jt.hydrateRoot=function(e,n,r){if(!fo(e))throw Error(i(405));var a=r!=null&&r.hydratedSources||null,c=!1,d="",f=Nd;if(r!=null&&(r.unstable_strictMode===!0&&(c=!0),r.identifierPrefix!==void 0&&(d=r.identifierPrefix),r.onRecoverableError!==void 0&&(f=r.onRecoverableError)),n=jd(n,null,e,1,r??null,c,!1,d,f),e[yn]=n.current,Ls(e),a)for(e=0;e<a.length;e++)r=a[e],c=r._getVersion,c=c(r._source),n.mutableSourceEagerHydrationData==null?n.mutableSourceEagerHydrationData=[r,c]:n.mutableSourceEagerHydrationData.push(r,c);return new fa(n)},jt.render=function(e,n,r){if(!xa(n))throw Error(i(200));return pa(null,e,n,!1,r)},jt.unmountComponentAtNode=function(e){if(!xa(e))throw Error(i(40));return e._reactRootContainer?(jr(function(){pa(null,null,e,!1,function(){e._reactRootContainer=null,e[yn]=null})}),!0):!1},jt.unstable_batchedUpdates=so,jt.unstable_renderSubtreeIntoContainer=function(e,n,r,a){if(!xa(r))throw Error(i(200));if(e==null||e._reactInternals===void 0)throw Error(i(38));return pa(e,n,r,!1,a)},jt.version="18.3.1-next-f1338f8080-20240426",jt}var Ld;function xm(){if(Ld)return go.exports;Ld=1;function s(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(s)}catch(l){console.error(l)}}return s(),go.exports=G0(),go.exports}var Ad;function Y0(){if(Ad)return ya;Ad=1;var s=xm();return ya.createRoot=s.createRoot,ya.hydrateRoot=s.hydrateRoot,ya}var Q0=Y0(),v=Do();const pm=$0(v),K0=z0({__proto__:null,default:pm},[v]);xm();function nl(){return nl=Object.assign?Object.assign.bind():function(s){for(var l=1;l<arguments.length;l++){var i=arguments[l];for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(s[o]=i[o])}return s},nl.apply(this,arguments)}var nr;(function(s){s.Pop="POP",s.Push="PUSH",s.Replace="REPLACE"})(nr||(nr={}));const Rd="popstate";function X0(s){s===void 0&&(s={});function l(o,u){let{pathname:m,search:h,hash:p}=o.location;return To("",{pathname:m,search:h,hash:p},u.state&&u.state.usr||null,u.state&&u.state.key||"default")}function i(o,u){return typeof u=="string"?u:ba(u)}return J0(l,i,null,s)}function Ue(s,l){if(s===!1||s===null||typeof s>"u")throw new Error(l)}function Fo(s,l){if(!s){typeof console<"u"&&console.warn(l);try{throw new Error(l)}catch{}}}function Z0(){return Math.random().toString(36).substr(2,8)}function Md(s,l){return{usr:s.state,key:s.key,idx:l}}function To(s,l,i,o){return i===void 0&&(i=null),nl({pathname:typeof s=="string"?s:s.pathname,search:"",hash:""},typeof l=="string"?ls(l):l,{state:i,key:l&&l.key||o||Z0()})}function ba(s){let{pathname:l="/",search:i="",hash:o=""}=s;return i&&i!=="?"&&(l+=i.charAt(0)==="?"?i:"?"+i),o&&o!=="#"&&(l+=o.charAt(0)==="#"?o:"#"+o),l}function ls(s){let l={};if(s){let i=s.indexOf("#");i>=0&&(l.hash=s.substr(i),s=s.substr(0,i));let o=s.indexOf("?");o>=0&&(l.search=s.substr(o),s=s.substr(0,o)),s&&(l.pathname=s)}return l}function J0(s,l,i,o){o===void 0&&(o={});let{window:u=document.defaultView,v5Compat:m=!1}=o,h=u.history,p=nr.Pop,x=null,y=k();y==null&&(y=0,h.replaceState(nl({},h.state,{idx:y}),""));function k(){return(h.state||{idx:null}).idx}function j(){p=nr.Pop;let P=k(),O=P==null?null:P-y;y=P,x&&x({action:p,location:A.location,delta:O})}function E(P,O){p=nr.Push;let M=To(A.location,P,O);y=k()+1;let R=Md(M,y),$=A.createHref(M);try{h.pushState(R,"",$)}catch(J){if(J instanceof DOMException&&J.name==="DataCloneError")throw J;u.location.assign($)}m&&x&&x({action:p,location:A.location,delta:1})}function I(P,O){p=nr.Replace;let M=To(A.location,P,O);y=k();let R=Md(M,y),$=A.createHref(M);h.replaceState(R,"",$),m&&x&&x({action:p,location:A.location,delta:0})}function L(P){let O=u.location.origin!=="null"?u.location.origin:u.location.href,M=typeof P=="string"?P:ba(P);return M=M.replace(/ $/,"%20"),Ue(O,"No window.location.(origin|href) available to create URL for href: "+M),new URL(M,O)}let A={get action(){return p},get location(){return s(u,h)},listen(P){if(x)throw new Error("A history only accepts one active listener");return u.addEventListener(Rd,j),x=P,()=>{u.removeEventListener(Rd,j),x=null}},createHref(P){return l(u,P)},createURL:L,encodeLocation(P){let O=L(P);return{pathname:O.pathname,search:O.search,hash:O.hash}},push:E,replace:I,go(P){return h.go(P)}};return A}var Id;(function(s){s.data="data",s.deferred="deferred",s.redirect="redirect",s.error="error"})(Id||(Id={}));function q0(s,l,i){return i===void 0&&(i="/"),ef(s,l,i)}function ef(s,l,i,o){let u=typeof l=="string"?ls(l):l,m=zo(u.pathname||"/",i);if(m==null)return null;let h=gm(s);tf(h);let p=null;for(let x=0;p==null&&x<h.length;++x){let y=ff(m);p=df(h[x],y)}return p}function gm(s,l,i,o){l===void 0&&(l=[]),i===void 0&&(i=[]),o===void 0&&(o="");let u=(m,h,p)=>{let x={relativePath:p===void 0?m.path||"":p,caseSensitive:m.caseSensitive===!0,childrenIndex:h,route:m};x.relativePath.startsWith("/")&&(Ue(x.relativePath.startsWith(o),'Absolute route path "'+x.relativePath+'" nested under path '+('"'+o+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),x.relativePath=x.relativePath.slice(o.length));let y=rr([o,x.relativePath]),k=i.concat(x);m.children&&m.children.length>0&&(Ue(m.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+y+'".')),gm(m.children,l,k,y)),!(m.path==null&&!m.index)&&l.push({path:y,score:cf(y,m.index),routesMeta:k})};return s.forEach((m,h)=>{var p;if(m.path===""||!((p=m.path)!=null&&p.includes("?")))u(m,h);else for(let x of ym(m.path))u(m,h,x)}),l}function ym(s){let l=s.split("/");if(l.length===0)return[];let[i,...o]=l,u=i.endsWith("?"),m=i.replace(/\?$/,"");if(o.length===0)return u?[m,""]:[m];let h=ym(o.join("/")),p=[];return p.push(...h.map(x=>x===""?m:[m,x].join("/"))),u&&p.push(...h),p.map(x=>s.startsWith("/")&&x===""?"/":x)}function tf(s){s.sort((l,i)=>l.score!==i.score?i.score-l.score:uf(l.routesMeta.map(o=>o.childrenIndex),i.routesMeta.map(o=>o.childrenIndex)))}const nf=/^:[\w-]+$/,rf=3,sf=2,lf=1,af=10,of=-2,Od=s=>s==="*";function cf(s,l){let i=s.split("/"),o=i.length;return i.some(Od)&&(o+=of),l&&(o+=sf),i.filter(u=>!Od(u)).reduce((u,m)=>u+(nf.test(m)?rf:m===""?lf:af),o)}function uf(s,l){return s.length===l.length&&s.slice(0,-1).every((o,u)=>o===l[u])?s[s.length-1]-l[l.length-1]:0}function df(s,l,i){let{routesMeta:o}=s,u={},m="/",h=[];for(let p=0;p<o.length;++p){let x=o[p],y=p===o.length-1,k=m==="/"?l:l.slice(m.length)||"/",j=mf({path:x.relativePath,caseSensitive:x.caseSensitive,end:y},k),E=x.route;if(!j)return null;Object.assign(u,j.params),h.push({params:u,pathname:rr([m,j.pathname]),pathnameBase:vf(rr([m,j.pathnameBase])),route:E}),j.pathnameBase!=="/"&&(m=rr([m,j.pathnameBase]))}return h}function mf(s,l){typeof s=="string"&&(s={path:s,caseSensitive:!1,end:!0});let[i,o]=hf(s.path,s.caseSensitive,s.end),u=l.match(i);if(!u)return null;let m=u[0],h=m.replace(/(.)\/+$/,"$1"),p=u.slice(1);return{params:o.reduce((y,k,j)=>{let{paramName:E,isOptional:I}=k;if(E==="*"){let A=p[j]||"";h=m.slice(0,m.length-A.length).replace(/(.)\/+$/,"$1")}const L=p[j];return I&&!L?y[E]=void 0:y[E]=(L||"").replace(/%2F/g,"/"),y},{}),pathname:m,pathnameBase:h,pattern:s}}function hf(s,l,i){l===void 0&&(l=!1),i===void 0&&(i=!0),Fo(s==="*"||!s.endsWith("*")||s.endsWith("/*"),'Route path "'+s+'" will be treated as if it were '+('"'+s.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+s.replace(/\*$/,"/*")+'".'));let o=[],u="^"+s.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(h,p,x)=>(o.push({paramName:p,isOptional:x!=null}),x?"/?([^\\/]+)?":"/([^\\/]+)"));return s.endsWith("*")?(o.push({paramName:"*"}),u+=s==="*"||s==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):i?u+="\\/*$":s!==""&&s!=="/"&&(u+="(?:(?=\\/|$))"),[new RegExp(u,l?void 0:"i"),o]}function ff(s){try{return s.split("/").map(l=>decodeURIComponent(l).replace(/\//g,"%2F")).join("/")}catch(l){return Fo(!1,'The URL path "'+s+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+l+").")),s}}function zo(s,l){if(l==="/")return s;if(!s.toLowerCase().startsWith(l.toLowerCase()))return null;let i=l.endsWith("/")?l.length-1:l.length,o=s.charAt(i);return o&&o!=="/"?null:s.slice(i)||"/"}const xf=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,pf=s=>xf.test(s);function gf(s,l){l===void 0&&(l="/");let{pathname:i,search:o="",hash:u=""}=typeof s=="string"?ls(s):s,m;if(i)if(pf(i))m=i;else{if(i.includes("//")){let h=i;i=i.replace(/\/\/+/g,"/"),Fo(!1,"Pathnames cannot have embedded double slashes - normalizing "+(h+" -> "+i))}i.startsWith("/")?m=Dd(i.substring(1),"/"):m=Dd(i,l)}else m=l;return{pathname:m,search:jf(o),hash:wf(u)}}function Dd(s,l){let i=l.replace(/\/+$/,"").split("/");return s.split("/").forEach(u=>{u===".."?i.length>1&&i.pop():u!=="."&&i.push(u)}),i.length>1?i.join("/"):"/"}function jo(s,l,i,o){return"Cannot include a '"+s+"' character in a manually specified "+("`to."+l+"` field ["+JSON.stringify(o)+"]. Please separate it out to the ")+("`to."+i+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function yf(s){return s.filter((l,i)=>i===0||l.route.path&&l.route.path.length>0)}function $o(s,l){let i=yf(s);return l?i.map((o,u)=>u===i.length-1?o.pathname:o.pathnameBase):i.map(o=>o.pathnameBase)}function Bo(s,l,i,o){o===void 0&&(o=!1);let u;typeof s=="string"?u=ls(s):(u=nl({},s),Ue(!u.pathname||!u.pathname.includes("?"),jo("?","pathname","search",u)),Ue(!u.pathname||!u.pathname.includes("#"),jo("#","pathname","hash",u)),Ue(!u.search||!u.search.includes("#"),jo("#","search","hash",u)));let m=s===""||u.pathname==="",h=m?"/":u.pathname,p;if(h==null)p=i;else{let j=l.length-1;if(!o&&h.startsWith("..")){let E=h.split("/");for(;E[0]==="..";)E.shift(),j-=1;u.pathname=E.join("/")}p=j>=0?l[j]:"/"}let x=gf(u,p),y=h&&h!=="/"&&h.endsWith("/"),k=(m||h===".")&&i.endsWith("/");return!x.pathname.endsWith("/")&&(y||k)&&(x.pathname+="/"),x}const rr=s=>s.join("/").replace(/\/\/+/g,"/"),vf=s=>s.replace(/\/+$/,"").replace(/^\/*/,"/"),jf=s=>!s||s==="?"?"":s.startsWith("?")?s:"?"+s,wf=s=>!s||s==="#"?"":s.startsWith("#")?s:"#"+s;function Nf(s){return s!=null&&typeof s.status=="number"&&typeof s.statusText=="string"&&typeof s.internal=="boolean"&&"data"in s}const vm=["post","put","patch","delete"];new Set(vm);const bf=["get",...vm];new Set(bf);function rl(){return rl=Object.assign?Object.assign.bind():function(s){for(var l=1;l<arguments.length;l++){var i=arguments[l];for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(s[o]=i[o])}return s},rl.apply(this,arguments)}const Uo=v.createContext(null),Sf=v.createContext(null),lr=v.createContext(null),Ta=v.createContext(null),En=v.createContext({outlet:null,matches:[],isDataRoute:!1}),jm=v.createContext(null);function kf(s,l){let{relative:i}=l===void 0?{}:l;as()||Ue(!1);let{basename:o,navigator:u}=v.useContext(lr),{hash:m,pathname:h,search:p}=Nm(s,{relative:i}),x=h;return o!=="/"&&(x=h==="/"?o:rr([o,h])),u.createHref({pathname:x,search:p,hash:m})}function as(){return v.useContext(Ta)!=null}function is(){return as()||Ue(!1),v.useContext(Ta).location}function wm(s){v.useContext(lr).static||v.useLayoutEffect(s)}function Ho(){let{isDataRoute:s}=v.useContext(En);return s?zf():Cf()}function Cf(){as()||Ue(!1);let s=v.useContext(Uo),{basename:l,future:i,navigator:o}=v.useContext(lr),{matches:u}=v.useContext(En),{pathname:m}=is(),h=JSON.stringify($o(u,i.v7_relativeSplatPath)),p=v.useRef(!1);return wm(()=>{p.current=!0}),v.useCallback(function(y,k){if(k===void 0&&(k={}),!p.current)return;if(typeof y=="number"){o.go(y);return}let j=Bo(y,JSON.parse(h),m,k.relative==="path");s==null&&l!=="/"&&(j.pathname=j.pathname==="/"?l:rr([l,j.pathname])),(k.replace?o.replace:o.push)(j,k.state,k)},[l,o,h,m,s])}function Ef(){let{matches:s}=v.useContext(En),l=s[s.length-1];return l?l.params:{}}function Nm(s,l){let{relative:i}=l===void 0?{}:l,{future:o}=v.useContext(lr),{matches:u}=v.useContext(En),{pathname:m}=is(),h=JSON.stringify($o(u,o.v7_relativeSplatPath));return v.useMemo(()=>Bo(s,JSON.parse(h),m,i==="path"),[s,h,m,i])}function Tf(s,l){return Pf(s,l)}function Pf(s,l,i,o){as()||Ue(!1);let{navigator:u}=v.useContext(lr),{matches:m}=v.useContext(En),h=m[m.length-1],p=h?h.params:{};h&&h.pathname;let x=h?h.pathnameBase:"/";h&&h.route;let y=is(),k;if(l){var j;let P=typeof l=="string"?ls(l):l;x==="/"||(j=P.pathname)!=null&&j.startsWith(x)||Ue(!1),k=P}else k=y;let E=k.pathname||"/",I=E;if(x!=="/"){let P=x.replace(/^\//,"").split("/");I="/"+E.replace(/^\//,"").split("/").slice(P.length).join("/")}let L=q0(s,{pathname:I}),A=Mf(L&&L.map(P=>Object.assign({},P,{params:Object.assign({},p,P.params),pathname:rr([x,u.encodeLocation?u.encodeLocation(P.pathname).pathname:P.pathname]),pathnameBase:P.pathnameBase==="/"?x:rr([x,u.encodeLocation?u.encodeLocation(P.pathnameBase).pathname:P.pathnameBase])})),m,i,o);return l&&A?v.createElement(Ta.Provider,{value:{location:rl({pathname:"/",search:"",hash:"",state:null,key:"default"},k),navigationType:nr.Pop}},A):A}function _f(){let s=Ff(),l=Nf(s)?s.status+" "+s.statusText:s instanceof Error?s.message:JSON.stringify(s),i=s instanceof Error?s.stack:null,u={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return v.createElement(v.Fragment,null,v.createElement("h2",null,"Unexpected Application Error!"),v.createElement("h3",{style:{fontStyle:"italic"}},l),i?v.createElement("pre",{style:u},i):null,null)}const Lf=v.createElement(_f,null);class Af extends v.Component{constructor(l){super(l),this.state={location:l.location,revalidation:l.revalidation,error:l.error}}static getDerivedStateFromError(l){return{error:l}}static getDerivedStateFromProps(l,i){return i.location!==l.location||i.revalidation!=="idle"&&l.revalidation==="idle"?{error:l.error,location:l.location,revalidation:l.revalidation}:{error:l.error!==void 0?l.error:i.error,location:i.location,revalidation:l.revalidation||i.revalidation}}componentDidCatch(l,i){console.error("React Router caught the following error during render",l,i)}render(){return this.state.error!==void 0?v.createElement(En.Provider,{value:this.props.routeContext},v.createElement(jm.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Rf(s){let{routeContext:l,match:i,children:o}=s,u=v.useContext(Uo);return u&&u.static&&u.staticContext&&(i.route.errorElement||i.route.ErrorBoundary)&&(u.staticContext._deepestRenderedBoundaryId=i.route.id),v.createElement(En.Provider,{value:l},o)}function Mf(s,l,i,o){var u;if(l===void 0&&(l=[]),i===void 0&&(i=null),o===void 0&&(o=null),s==null){var m;if(!i)return null;if(i.errors)s=i.matches;else if((m=o)!=null&&m.v7_partialHydration&&l.length===0&&!i.initialized&&i.matches.length>0)s=i.matches;else return null}let h=s,p=(u=i)==null?void 0:u.errors;if(p!=null){let k=h.findIndex(j=>j.route.id&&p?.[j.route.id]!==void 0);k>=0||Ue(!1),h=h.slice(0,Math.min(h.length,k+1))}let x=!1,y=-1;if(i&&o&&o.v7_partialHydration)for(let k=0;k<h.length;k++){let j=h[k];if((j.route.HydrateFallback||j.route.hydrateFallbackElement)&&(y=k),j.route.id){let{loaderData:E,errors:I}=i,L=j.route.loader&&E[j.route.id]===void 0&&(!I||I[j.route.id]===void 0);if(j.route.lazy||L){x=!0,y>=0?h=h.slice(0,y+1):h=[h[0]];break}}}return h.reduceRight((k,j,E)=>{let I,L=!1,A=null,P=null;i&&(I=p&&j.route.id?p[j.route.id]:void 0,A=j.route.errorElement||Lf,x&&(y<0&&E===0?($f("route-fallback"),L=!0,P=null):y===E&&(L=!0,P=j.route.hydrateFallbackElement||null)));let O=l.concat(h.slice(0,E+1)),M=()=>{let R;return I?R=A:L?R=P:j.route.Component?R=v.createElement(j.route.Component,null):j.route.element?R=j.route.element:R=k,v.createElement(Rf,{match:j,routeContext:{outlet:k,matches:O,isDataRoute:i!=null},children:R})};return i&&(j.route.ErrorBoundary||j.route.errorElement||E===0)?v.createElement(Af,{location:i.location,revalidation:i.revalidation,component:A,error:I,children:M(),routeContext:{outlet:null,matches:O,isDataRoute:!0}}):M()},null)}var bm=(function(s){return s.UseBlocker="useBlocker",s.UseRevalidator="useRevalidator",s.UseNavigateStable="useNavigate",s})(bm||{}),Sm=(function(s){return s.UseBlocker="useBlocker",s.UseLoaderData="useLoaderData",s.UseActionData="useActionData",s.UseRouteError="useRouteError",s.UseNavigation="useNavigation",s.UseRouteLoaderData="useRouteLoaderData",s.UseMatches="useMatches",s.UseRevalidator="useRevalidator",s.UseNavigateStable="useNavigate",s.UseRouteId="useRouteId",s})(Sm||{});function If(s){let l=v.useContext(Uo);return l||Ue(!1),l}function Of(s){let l=v.useContext(Sf);return l||Ue(!1),l}function Df(s){let l=v.useContext(En);return l||Ue(!1),l}function km(s){let l=Df(),i=l.matches[l.matches.length-1];return i.route.id||Ue(!1),i.route.id}function Ff(){var s;let l=v.useContext(jm),i=Of(),o=km();return l!==void 0?l:(s=i.errors)==null?void 0:s[o]}function zf(){let{router:s}=If(bm.UseNavigateStable),l=km(Sm.UseNavigateStable),i=v.useRef(!1);return wm(()=>{i.current=!0}),v.useCallback(function(u,m){m===void 0&&(m={}),i.current&&(typeof u=="number"?s.navigate(u):s.navigate(u,rl({fromRouteId:l},m)))},[s,l])}const Fd={};function $f(s,l,i){Fd[s]||(Fd[s]=!0)}function Bf(s,l){s?.v7_startTransition,s?.v7_relativeSplatPath}function Uf(s){let{to:l,replace:i,state:o,relative:u}=s;as()||Ue(!1);let{future:m,static:h}=v.useContext(lr),{matches:p}=v.useContext(En),{pathname:x}=is(),y=Ho(),k=Bo(l,$o(p,m.v7_relativeSplatPath),x,u==="path"),j=JSON.stringify(k);return v.useEffect(()=>y(JSON.parse(j),{replace:i,state:o,relative:u}),[y,j,u,i,o]),null}function rs(s){Ue(!1)}function Hf(s){let{basename:l="/",children:i=null,location:o,navigationType:u=nr.Pop,navigator:m,static:h=!1,future:p}=s;as()&&Ue(!1);let x=l.replace(/^\/*/,"/"),y=v.useMemo(()=>({basename:x,navigator:m,static:h,future:rl({v7_relativeSplatPath:!1},p)}),[x,p,m,h]);typeof o=="string"&&(o=ls(o));let{pathname:k="/",search:j="",hash:E="",state:I=null,key:L="default"}=o,A=v.useMemo(()=>{let P=zo(k,x);return P==null?null:{location:{pathname:P,search:j,hash:E,state:I,key:L},navigationType:u}},[x,k,j,E,I,L,u]);return A==null?null:v.createElement(lr.Provider,{value:y},v.createElement(Ta.Provider,{children:i,value:A}))}function Cm(s){let{children:l,location:i}=s;return Tf(Po(l),i)}new Promise(()=>{});function Po(s,l){l===void 0&&(l=[]);let i=[];return v.Children.forEach(s,(o,u)=>{if(!v.isValidElement(o))return;let m=[...l,u];if(o.type===v.Fragment){i.push.apply(i,Po(o.props.children,m));return}o.type!==rs&&Ue(!1),!o.props.index||!o.props.children||Ue(!1);let h={id:o.props.id||m.join("-"),caseSensitive:o.props.caseSensitive,element:o.props.element,Component:o.props.Component,index:o.props.index,path:o.props.path,loader:o.props.loader,action:o.props.action,errorElement:o.props.errorElement,ErrorBoundary:o.props.ErrorBoundary,hasErrorBoundary:o.props.ErrorBoundary!=null||o.props.errorElement!=null,shouldRevalidate:o.props.shouldRevalidate,handle:o.props.handle,lazy:o.props.lazy};o.props.children&&(h.children=Po(o.props.children,m)),i.push(h)}),i}function _o(){return _o=Object.assign?Object.assign.bind():function(s){for(var l=1;l<arguments.length;l++){var i=arguments[l];for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(s[o]=i[o])}return s},_o.apply(this,arguments)}function Vf(s,l){if(s==null)return{};var i={},o=Object.keys(s),u,m;for(m=0;m<o.length;m++)u=o[m],!(l.indexOf(u)>=0)&&(i[u]=s[u]);return i}function Wf(s){return!!(s.metaKey||s.altKey||s.ctrlKey||s.shiftKey)}function Gf(s,l){return s.button===0&&(!l||l==="_self")&&!Wf(s)}const Yf=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],Qf="6";try{window.__reactRouterVersion=Qf}catch{}const Kf="startTransition",zd=K0[Kf];function Xf(s){let{basename:l,children:i,future:o,window:u}=s,m=v.useRef();m.current==null&&(m.current=X0({window:u,v5Compat:!0}));let h=m.current,[p,x]=v.useState({action:h.action,location:h.location}),{v7_startTransition:y}=o||{},k=v.useCallback(j=>{y&&zd?zd(()=>x(j)):x(j)},[x,y]);return v.useLayoutEffect(()=>h.listen(k),[h,k]),v.useEffect(()=>Bf(o),[o]),v.createElement(Hf,{basename:l,children:i,location:p.location,navigationType:p.action,navigator:h,future:o})}const Zf=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Jf=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Cn=v.forwardRef(function(l,i){let{onClick:o,relative:u,reloadDocument:m,replace:h,state:p,target:x,to:y,preventScrollReset:k,viewTransition:j}=l,E=Vf(l,Yf),{basename:I}=v.useContext(lr),L,A=!1;if(typeof y=="string"&&Jf.test(y)&&(L=y,Zf))try{let R=new URL(window.location.href),$=y.startsWith("//")?new URL(R.protocol+y):new URL(y),J=zo($.pathname,I);$.origin===R.origin&&J!=null?y=J+$.search+$.hash:A=!0}catch{}let P=kf(y,{relative:u}),O=qf(y,{replace:h,state:p,target:x,preventScrollReset:k,relative:u,viewTransition:j});function M(R){o&&o(R),R.defaultPrevented||O(R)}return v.createElement("a",_o({},E,{href:L||P,onClick:A||m?o:M,ref:i,target:x}))});var $d;(function(s){s.UseScrollRestoration="useScrollRestoration",s.UseSubmit="useSubmit",s.UseSubmitFetcher="useSubmitFetcher",s.UseFetcher="useFetcher",s.useViewTransitionState="useViewTransitionState"})($d||($d={}));var Bd;(function(s){s.UseFetcher="useFetcher",s.UseFetchers="useFetchers",s.UseScrollRestoration="useScrollRestoration"})(Bd||(Bd={}));function qf(s,l){let{target:i,replace:o,state:u,preventScrollReset:m,relative:h,viewTransition:p}=l===void 0?{}:l,x=Ho(),y=is(),k=Nm(s,{relative:h});return v.useCallback(j=>{if(Gf(j,i)){j.preventDefault();let E=o!==void 0?o:ba(y)===ba(k);x(s,{replace:E,state:u,preventScrollReset:m,relative:h,viewTransition:p})}},[y,x,k,o,u,i,s,m,h,p])}const Em=[{path:"/",name:"dashboard",component:"Dashboard",title:"Dashboard",description:"Main dashboard overview",exact:!0},{path:"/packages",name:"packages",component:"PackagesOverview",title:"Packages",description:"Package management and overview",exact:!0},{path:"/packages/:name",name:"package-detail",component:"PackageDetail",title:"Package Details",description:"Detailed view of a specific package"},{path:"/dependencies",name:"dependencies",component:"DependencyGraph",title:"Dependencies",description:"Dependency graph visualization"},{path:"/health",name:"health",component:"HealthStatus",title:"Health Status",description:"Monorepo health monitoring"},{path:"/publish",name:"publish",component:"PublishControl",title:"Publish Control",description:"Package publishing and versioning"},{path:"/release",name:"release",component:"ReleaseManager",title:"Release Manager",description:"Comprehensive release management with Changesets",protected:!0},{path:"/ci",name:"ci",component:"CIIntegration",title:"CI/CD",description:"Continuous integration and deployment"},{path:"/pipeline",name:"pipeline",component:"Pipeline",title:"Release Pipeline",description:"Real-time release pipeline monitoring and management",protected:!0},{path:"/config",name:"config",component:"ConfigInspector",title:"Configuration",description:"Configuration file inspector"}];Em.filter(s=>!s.path.includes(":")&&s.path!=="/");const fe="w-6 h-6",ex=({className:s=fe,width:l=24,height:i=24,strokeWidth:o=1.5,variant:u="outline"})=>u==="solid"?t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:s,width:l,height:i,children:t.jsx("path",{d:"M10.5 3.75H5.625a1.875 1.875 0 0 0-1.875 1.875V20.25a1.875 1.875 0 0 0 1.875 1.875h12.75a1.875 1.875 0 0 0 1.875-1.875V5.625a1.875 1.875 0 0 0-1.875-1.875H13.5m-3 0V3m0 .75H9m1.5 0h1.5m-9 6.75h12m-12 4.5h12"})}):t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:o,stroke:"currentColor",className:s,width:l,height:i,children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 12l8.954-8.955c.44-.439 1.152-.439 1.591 0L21.75 12M4.5 9.75v10.125c0 .621.504 1.125 1.125 1.125H9.75v-4.875c0-.621.504-1.125 1.125-1.125h2.25c.621 0 1.125.504 1.125 1.125V21h4.125c.621 0 1.125-.504 1.125-1.125V9.75M8.25 21h8.25"})}),Lt=({className:s=fe,width:l=24,height:i=24,strokeWidth:o=1.5,variant:u="outline"})=>u==="solid"?t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:s,width:l,height:i,children:t.jsx("path",{d:"m21 7.5-9-5.25L3 7.5m18 0-9 5.25m9-5.25v9l-9 5.25M3 7.5l9 5.25M3 7.5v9l9 5.25m0-9v9"})}):t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:o,stroke:"currentColor",className:s,width:l,height:i,children:t.jsx("path",{d:"m21 7.5-9-5.25L3 7.5m18 0-9 5.25m9-5.25v9l-9 5.25M3 7.5l9 5.25M3 7.5v9l9 5.25m0-9v9"})}),Vo=({className:s=fe,width:l=24,height:i=24,strokeWidth:o=1.5,variant:u="outline"})=>u==="solid"?t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:s,width:l,height:i,children:t.jsx("path",{d:"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"})}):t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:o,stroke:"currentColor",className:s,width:l,height:i,children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.5 12.75l6 6 9-13.5"})}),al=({className:s=fe,width:l=24,height:i=24,strokeWidth:o=1.5,variant:u="outline"})=>u==="solid"?t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:s,width:l,height:i,children:t.jsx("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})}):t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:o,stroke:"currentColor",className:s,width:l,height:i,children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})}),tx=({className:s=fe,width:l=24,height:i=24,strokeWidth:o=1.5,variant:u="outline"})=>u==="solid"?t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:s,width:l,height:i,children:t.jsx("path",{d:"M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zM12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5zm0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z"})}):t.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:o,stroke:"currentColor",className:s,width:l,height:i,children:[t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"}),t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"})]}),nx=({className:s=fe,width:l=24,height:i=24,strokeWidth:o=1.5,variant:u="outline"})=>u==="solid"?t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:s,width:l,height:i,children:t.jsx("path",{d:"M3.98 8.223A10.477 10.477 0 0 0 1.934 12c1.292 4.338 5.31 7.5 10.066 7.5.996 0 1.956-.11 2.895-.327m4.326-3.494a11.952 11.952 0 0 0 3.464-5.192c-1.292-4.338-5.31-7.5-10.066-7.5-.996 0-1.956.11-2.895.327m0 0a11.966 11.966 0 0 0-4.576 3.84m4.576-3.84a11.966 11.966 0 0 1 4.576 3.84M6.502 16.503a3 3 0 1 1 4.243-4.243m-4.243 4.243L3.75 19.75"})}):t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:o,stroke:"currentColor",className:s,width:l,height:i,children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.98 8.223A10.477 10.477 0 001.934 12C3.226 16.338 7.244 19.5 12 19.5c.993 0 1.953-.138 2.863-.395M6.228 6.228A10.45 10.45 0 0112 4.5c4.756 0 8.773 3.162 10.065 7.498a10.523 10.523 0 01-4.293 5.774M6.228 6.228L3 3m3.228 3.228l3.65 3.65m7.894 7.894L21 21m-3.228-3.228l-3.65-3.65m0 0a3 3 0 10-4.243-4.243m4.242 4.242L9.88 9.88"})}),rx=({className:s=fe,width:l=24,height:i=24,strokeWidth:o=1.5,variant:u="outline"})=>u==="solid"?t.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:s,width:l,height:i,children:[t.jsx("path",{d:"M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25z"}),t.jsx("path",{d:"M20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.39-.39-1.02-.39-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z"})]}):t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:o,stroke:"currentColor",className:s,width:l,height:i,children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.862 4.487l1.687-1.688a1.875 1.875 0 112.652 2.652L10.582 16.07a4.5 4.5 0 01-1.897 1.13L6 18l.8-2.685a4.5 4.5 0 011.13-1.897l8.932-8.931zm0 0L19.5 7.125M18 14v4.75A2.25 2.25 0 0115.75 21H5.25A2.25 2.25 0 013 18.75V8.25A2.25 2.25 0 015.25 6H10"})}),Pa=({className:s=fe,width:l=24,height:i=24,strokeWidth:o=1.5,variant:u="outline"})=>u==="solid"?t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:s,width:l,height:i,children:t.jsx("path",{d:"M8 5v14l11-7z"})}):t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:o,stroke:"currentColor",className:s,width:l,height:i,children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5.25 5.653c0-.856.917-1.398 1.591-.784l12 9c.54.406.54 1.358 0 1.764l-12 9c-.674.614-1.591.07-1.591-.784V5.653z"})}),Wo=({className:s=fe,width:l=24,height:i=24,strokeWidth:o=1.5,variant:u="outline"})=>u==="solid"?t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:s,width:l,height:i,children:t.jsx("path",{d:"M7 14l5-5 5 5z"})}):t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:o,stroke:"currentColor",className:s,width:l,height:i,children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.5 10.5L12 3m0 0l7.5 7.5M12 3v18"})}),Tm=({className:s=fe,width:l=24,height:i=24,strokeWidth:o=1.5,variant:u="outline"})=>u==="solid"?t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:s,width:l,height:i,children:t.jsx("path",{d:"M7 10l5 5 5-5z"})}):t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:o,stroke:"currentColor",className:s,width:l,height:i,children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 13.5L12 21m0 0l-7.5-7.5M12 21V3"})}),sx=({className:s=fe,width:l=24,height:i=24,strokeWidth:o=1.5,variant:u="outline"})=>u==="solid"?t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:s,width:l,height:i,children:t.jsx("path",{d:"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"})}):t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:o,stroke:"currentColor",className:s,width:l,height:i,children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 19.5L8.25 12l7.5-7.5"})}),Ud=({className:s=fe,width:l=24,height:i=24,strokeWidth:o=1.5,variant:u="outline"})=>u==="solid"?t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:s,width:l,height:i,children:t.jsx("path",{d:"M8.59 16.59L10 18l6-6-6-6-1.41 1.41L13.17 12z"})}):t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:o,stroke:"currentColor",className:s,width:l,height:i,children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8.25 4.5L15.75 12l-7.5 7.5"})}),lx=({className:s=fe,width:l=24,height:i=24,strokeWidth:o=1.5,variant:u="outline"})=>u==="solid"?t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:s,width:l,height:i,children:t.jsx("path",{d:"M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"})}):t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:o,stroke:"currentColor",className:s,width:l,height:i,children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 6a3.75 3.75 0 11-7.5 0 3.75 3.75 0 017.5 0zM4.501 20.118a7.5 7.5 0 0114.998 0A17.933 17.933 0 0112 21.75c-2.676 0-5.216-.584-7.499-1.632z"})}),Pt=({className:s=fe,width:l=24,height:i=24,strokeWidth:o=1.5,variant:u="outline"})=>u==="solid"?t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:s,width:l,height:i,children:t.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"})}):t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:o,stroke:"currentColor",className:s,width:l,height:i,children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12.75L11.25 15 15 9.75M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),Bt=({className:s=fe,width:l=24,height:i=24,strokeWidth:o=1.5,variant:u="outline"})=>u==="solid"?t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:s,width:l,height:i,children:t.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm4.3 10.3l-1.3 1.3L13.3 15l1.3 1.3-1.3 1.3L12 16.3l-1.3 1.3-1.3-1.3L10.7 15 9.4 13.7l1.3-1.3L10.7 11l-1.3-1.3 1.3-1.3L12 10.3l1.3-1.3 1.3 1.3L13.3 11l1.3 1.3z"})}):t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:o,stroke:"currentColor",className:s,width:l,height:i,children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.75 9.75l4.5 4.5m0-4.5l-4.5 4.5M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),_a=({className:s=fe,width:l=24,height:i=24,strokeWidth:o=1.5,variant:u="outline"})=>u==="solid"?t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:s,width:l,height:i,children:t.jsx("path",{fillRule:"evenodd",d:"M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12ZM12 8.25a.75.75 0 0 1 .75.75v3.75a.75.75 0 0 1-1.5 0V9a.75.75 0 0 1 .75-.75Zm0 8.25a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5Z",clipRule:"evenodd"})}):t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:o,stroke:"currentColor",className:s,width:l,height:i,children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v3.75m9-.75a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9 3.75h.008v.008H12v-.008Z"})}),il=({className:s=fe,width:l=24,height:i=24,strokeWidth:o=1.5,variant:u="outline"})=>u==="solid"?t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:s,width:l,height:i,children:t.jsx("path",{d:"M5 9.2h3V19H5zM10.6 5h2.8v14h-2.8zm5.6 8H19v6h-2.8z"})}):t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:o,stroke:"currentColor",className:s,width:l,height:i,children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 13.125C3 12.504 3.504 12 4.125 12h2.25c.621 0 1.125.504 1.125 1.125v6.75C7.5 20.496 6.996 21 6.375 21h-2.25A1.125 1.125 0 0 1 3 19.875v-6.75zM9.75 6.875c0-.621.504-1.125 1.125-1.125h2.25c.621 0 1.125.504 1.125 1.125v13.5c0 .621-.504 1.125-1.125 1.125h-2.25a1.125 1.125 0 0 1-1.125-1.125V6.875zm6-4.5c-.621 0-1.125.504-1.125 1.125v15.75c0 .621.504 1.125 1.125 1.125h2.25a1.125 1.125 0 0 0 1.125-1.125V3.375c0-.621-.504-1.125-1.125-1.125h-2.25z"})}),Go=({className:s=fe,width:l=24,height:i=24,strokeWidth:o=1.5,variant:u="outline"})=>u==="solid"?t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:s,width:l,height:i,children:t.jsx("path",{d:"M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z"})}):t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:o,stroke:"currentColor",className:s,width:l,height:i,children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z"})}),Lo=({className:s=fe,width:l=24,height:i=24,strokeWidth:o=1.5,variant:u="outline"})=>u==="solid"?t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:s,width:l,height:i,children:t.jsx("path",{d:"M19.35 10.04C18.67 6.59 15.64 4 12 4c-1.48 0-2.85.43-4.01 1.17l1.46 1.46C10.21 6.23 11.08 6 12 6c3.04 0 5.5 2.46 5.5 5.5v.5H19c1.66 0 3 1.34 3 3 0 1.13-.64 2.11-1.56 2.62l1.45 1.45C23.16 18.16 24 16.68 24 15c0-2.64-2.05-4.78-4.65-4.96zM16 16v-3.5h-3v3.5h-3l4 4 4-4h-2z"})}):t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:o,stroke:"currentColor",className:s,width:l,height:i,children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 16.5V9.75m0 0l3 3m-3-3l-3 3M6.75 19.5a4.6 4.6 0 0 1-.88-9.1A5 5 0 1 1 15.9 6L16 6a5 5 0 1 1 .9 9.9m-5 5v-5m0 0L9.7 10.7M12 16l2.3-2.3"})}),Pm=({className:s=fe,width:l=24,height:i=24,strokeWidth:o=1.5})=>t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:o,stroke:"currentColor",className:s,width:l,height:i,children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5.75 7.5A2.25 2.25 0 0 1 8 5.25h8a2.25 2.25 0 0 1 2.25 2.25v8a2.25 2.25 0 0 1-2.25 2.25H8A2.25 2.25 0 0 1 5.75 15V7.5Z"})}),La=({className:s=fe,width:l=24,height:i=24,strokeWidth:o=1.5})=>t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:o,stroke:"currentColor",className:s,width:l,height:i,children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 21v-8.25M15.75 21v-8.25M8.25 21v-8.25M3 9l9-6 9 6m-1.5 12V10.332A48.36 48.36 0 0 0 12 9.75c-2.551 0-5.056.2-7.5.582V21M3 21h18M12 6.75h.008v.008H12V6.75Z"})}),Yo=({className:s=fe,width:l=24,height:i=24,strokeWidth:o=1.5})=>t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:o,stroke:"currentColor",className:s,width:l,height:i,children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 7v10a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-6l-2-2H5a2 2 0 0 0-2 2z"})}),Sa=({className:s=fe,width:l=24,height:i=24,strokeWidth:o=1.5})=>t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:o,stroke:"currentColor",className:s,width:l,height:i,children:t.jsx("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M19.5 14.25v-2.625a3.375 3.375 0 0 0-3.375-3.375h-1.5A1.125 1.125 0 0 1 13.5 7.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H8.25m2.25 0H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 0 0-9-9Z"})}),Qo=({className:s=fe,width:l=24,height:i=24,strokeWidth:o=1.5})=>t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:o,stroke:"currentColor",className:s,width:l,height:i,children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M7 8h10M7 12h10m-7 4h7M9 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-4l-2-2z"})}),ax=({className:s=fe,width:l=24,height:i=24,strokeWidth:o=1.5})=>t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:o,stroke:"currentColor",className:s,width:l,height:i,children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12l2 2 4-4m6 2a9 9 0 1 1-18 0 9 9 0 0 1 18 0z"})}),ix=({className:s=fe,width:l=24,height:i=24,strokeWidth:o=1.5})=>t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:o,stroke:"currentColor",className:s,width:l,height:i,children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.666 3.888A2.25 2.25 0 0 0 13.5 2.25h-3c-1.185 0-2.25 1.065-2.25 2.25v5.338a2.25 2.25 0 0 0 .375 1.322l1.968 2.332c.494.583.745 1.379.745 2.191V17.5a2.25 2.25 0 0 0 2.25 2.25h5a2.25 2.25 0 0 0 2.25-2.25v-1.5a.75.75 0 0 0-1.5 0v1.5a.75.75 0 0 1-.75.75h-5a.75.75 0 0 1-.75-.75V9.991a.75.75 0 0 1-.75-.75V4.5a.75.75 0 0 1 .75-.75h3a.75.75 0 0 1 .75.75v2.25a.75.75 0 0 0 1.5 0V4.5c0-.647-.146-1.262-.406-1.812z"})}),Ko=({className:s=fe,width:l=24,height:i=24,strokeWidth:o=1.5})=>t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:o,stroke:"currentColor",className:s,width:l,height:i,children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.568 3H5.25A2.25 2.25 0 0 0 3 5.25v4.318c0 .597.237 1.17.659 1.591l9.581 9.581c.402.402.937.629 1.531.629a2.16 2.16 0 0 0 1.532-.629l7.04-7.04a2.16 2.16 0 0 0 .628-1.532c0-.595-.227-1.129-.628-1.531l-9.58-9.581a2.25 2.25 0 0 0-1.592-.659H9.568z"})}),_m=({className:s=fe,width:l=24,height:i=24,strokeWidth:o=1.5})=>t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:o,stroke:"currentColor",className:s,width:l,height:i,children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6.75 3v2.25M17.25 3v2.25M3 18.75V7.5a2.25 2.25 0 0 1 2.25-2.25h13.5A2.25 2.25 0 0 1 21 7.5v11.25m-18 0A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75m-18 0v-7.5A2.25 2.25 0 0 1 5.25 9h13.5A2.25 2.25 0 0 1 21 11.25v7.5m-9-6h.008v.008H12v-.008zM12 15h.008v.008H12V15zm0 2.25h.008v.008H12v-.008zM9.75 15h.008v.008H9.75V15zm0 2.25h.008v.008H9.75v-.008zM7.5 15h.008v.008H7.5V15zm0 2.25h.008v.008H7.5v-.008zM14.25 15h.008v.008H14.25V15zm0 2.25h.008v.008H14.25v-.008zM16.5 15h.008v.008H16.5V15zm0 2.25h.008v.008H16.5v-.008z"})}),We=({className:s=fe,width:l=24,height:i=24,strokeWidth:o=1.5})=>t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:o,stroke:"currentColor",className:s,width:l,height:i,children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 6v6h4.5m4.5 0a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"})}),Aa=({className:s=fe,width:l=24,height:i=24,strokeWidth:o=1.5})=>t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:o,stroke:"currentColor",className:s,width:l,height:i,children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.19 8.688a4.5 4.5 0 0 1 1.242 7.244l-4.5 4.5a4.5 4.5 0 0 1-6.364-6.364l1.757-1.757m13.35-.039l1.758-1.757a4.5 4.5 0 0 0-6.364-6.364l-4.5 4.5a4.5 4.5 0 0 0 1.242 7.244"})}),Tn=({className:s=fe,width:l=24,height:i=24,strokeWidth:o=1.5,variant:u="outline"})=>u==="solid"?t.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:s,width:l,height:i,children:[t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.59 14.37a6 6 0 0 1-5.84 7.38v-4.8m5.84-2.58a14.98 14.98 0 0 0 6.16-12.12A14.98 14.98 0 0 0 9.631 8.41m5.96 5.96a14.926 14.926 0 0 1-5.841 2.58m-.119-8.54a6 6 0 0 0-7.381 5.84h4.8m2.581-5.84a14.927 14.927 0 0 0-2.58 5.84m2.699 2.7c-.103.021-.207.041-.311.06a15.09 15.09 0 0 1-2.448-2.448 14.9 14.9 0 0 1 .06-.312m-2.24 2.39a4.493 4.493 0 0 0-1.757 4.306 4.493 4.493 0 0 0 4.306-1.758M16.5 9a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0Z"})," "]}):t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:o,stroke:"currentColor",className:s,width:l,height:i,children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.59 14.37a6 6 0 0 1-5.84 7.38v-4.8m5.84-2.58a14.98 14.98 0 0 0 6.16-12.12A14.98 14.98 0 0 0 9.631 8.41m5.96 5.96a14.926 14.926 0 0 1-5.841 2.58m-.119-8.54a6 6 0 0 0-7.381 5.84h4.8m2.581-5.84a14.927 14.927 0 0 0-2.58 5.84m2.699 2.7c-.103.021-.207.041-.311.06a15.09 15.09 0 0 1-2.448-2.448 14.9 14.9 0 0 1 .06-.312m-2.24 2.39a4.493 4.493 0 0 0-1.757 4.306 4.493 4.493 0 0 0 4.306-1.758M16.5 9a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0Z"})}),Xo=({className:s=fe,width:l=24,height:i=24,strokeWidth:o=1.5})=>t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:o,stroke:"currentColor",className:s,width:l,height:i,children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 21l-5.197-5.197m0 0A7.5 7.5 0 1 0 5.5 5.5a7.5 7.5 0 0 0 10.5 10.5z"})}),Ra=({className:s=fe,width:l=24,height:i=24,strokeWidth:o=1.5})=>t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:o,stroke:"currentColor",className:s,width:l,height:i,children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 6.75h16.5M3.75 12h16.5m-16.5 5.25h16.5"})}),ss=({className:s=fe,width:l=24,height:i=24,strokeWidth:o=1.5})=>t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:o,stroke:"currentColor",className:s,width:l,height:i,children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11.25 11.25l.041-.02a.75.75 0 0 1 1.063.852l-.708 2.836a.75.75 0 0 0 1.063.853l.041-.021M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0zm-9-3.75h.008v.008H12V8.25z"})}),Je=({className:s=fe,width:l=24,height:i=24,strokeWidth:o=1.5})=>t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:o,stroke:"currentColor",className:s,width:l,height:i,children:t.jsx("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126ZM12 15.75h.007v.008H12v-.008Z"})}),sr=({className:s=fe,width:l=24,height:i=24,strokeWidth:o=1.5})=>t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:o,stroke:"currentColor",className:s,width:l,height:i,children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.755 10.059a7.5 7.5 0 0 1 12.548-3.364l1.903 1.903h-3.183a.75.75 0 1 0 0 1.5h4.992a.75.75 0 0 0 .75-.75V4.356a.75.75 0 0 0-1.5 0v3.18l-1.9-1.9A9 9 0 0 0 3.306 9.67a.75.75 0 1 0 1.45.388Zm15.408 3.352a.75.75 0 0 0-.919.53 7.5 7.5 0 0 1-12.548 3.364l-1.902-1.903h3.183a.75.75 0 0 0 0-1.5H2.984a.75.75 0 0 0-.75.75v4.992a.75.75 0 0 0 1.5 0v-3.18l1.9 1.9a9 9 0 0 0 15.059-4.035.75.75 0 0 0-.53-.918Z"})}),Lm=({className:s=fe,width:l=24,height:i=24,strokeWidth:o=1.5})=>t.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:o,stroke:"currentColor",className:s,width:l,height:i,children:[t.jsx("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9.594 3.94c.09-.542.56-.94 1.11-.94h2.593c.55 0 1.02.398 1.11.94l.213 1.281c.063.374.313.686.645.87.074.04.147.083.22.127.325.196.72.257 1.075.124l1.217-.456a1.125 1.125 0 0 1 1.37.49l1.296 2.247a1.125 1.125 0 0 1-.26 1.431l-1.003.827c-.293.241-.438.613-.43.992a7.723 7.723 0 0 1 0 .255c-.008.378.137.75.43.991l1.004.827c.424.35.534.955.26 1.43l-1.298 2.247a1.125 1.125 0 0 1-1.369.491l-1.217-.456c-.355-.133-.75-.072-1.076.124a6.47 6.47 0 0 1-.22.128c-.331.183-.581.495-.644.869l-.213 1.281c-.09.543-.56.94-1.11.94h-2.594c-.55 0-1.019-.398-1.11-.94l-.213-1.281c-.062-.374-.312-.686-.644-.87a6.52 6.52 0 0 1-.22-.127c-.325-.196-.72-.257-1.076-.124l-1.217.456a1.125 1.125 0 0 1-1.369-.49l-1.297-2.247a1.125 1.125 0 0 1 .26-1.431l1.004-.827c.292-.24.437-.613.43-.991a6.932 6.932 0 0 1 0-.255c.007-.38-.138-.751-.43-.992l-1.004-.827a1.125 1.125 0 0 1-.26-1.43l1.297-2.247a1.125 1.125 0 0 1 1.37-.491l1.216.456c.356.133.751.072 1.076-.124.072-.044.146-.086.22-.128.332-.183.582-.495.644-.869l.214-1.28Z"}),t.jsx("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"})]}),Cr=({className:s=fe,width:l=24,height:i=24,strokeWidth:o=1.5})=>t.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:o,stroke:"currentColor",className:s,width:l,height:i,children:[t.jsx("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9.594 3.94c.09-.542.56-.94 1.11-.94h2.593c.55 0 1.02.398 1.11.94l.213 1.281c.063.374.313.686.645.87.074.04.147.083.22.127.325.196.72.257 1.075.124l1.217-.456a1.125 1.125 0 0 1 1.37.49l1.296 2.247a1.125 1.125 0 0 1-.26 1.431l-1.003.827c-.293.241-.438.613-.43.992a7.723 7.723 0 0 1 0 .255c-.008.378.137.75.43.991l1.004.827c.424.35.534.955.26 1.43l-1.298 2.247a1.125 1.125 0 0 1-1.369.491l-1.217-.456c-.355-.133-.75-.072-1.076.124a6.47 6.47 0 0 1-.22.128c-.331.183-.581.495-.644.869l-.213 1.281c-.09.543-.56.94-1.11.94h-2.594c-.55 0-1.019-.398-1.11-.94l-.213-1.281c-.062-.374-.312-.686-.644-.87a6.52 6.52 0 0 1-.22-.127c-.325-.196-.72-.257-1.076-.124l-1.217.456a1.125 1.125 0 0 1-1.369-.49l-1.297-2.247a1.125 1.125 0 0 1 .26-1.431l1.004-.827c.292-.24.437-.613.43-.991a6.932 6.932 0 0 1 0-.255c.007-.38-.138-.751-.43-.992l-1.004-.827a1.125 1.125 0 0 1-.26-1.43l1.297-2.247a1.125 1.125 0 0 1 1.37-.491l1.216.456c.356.133.751.072 1.076-.124.072-.044.146-.086.22-.128.332-.183.582-.495.644-.869l.214-1.28Z"}),t.jsx("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"})]}),ox=({className:s=fe,width:l=24,height:i=24,strokeWidth:o=1.5})=>t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:o,stroke:"currentColor",className:s,width:l,height:i,children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8.625 12a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0zm0 0H8.25m4.125 0a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0zm0 0H12.25m4.125 0a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0zm0 0h-.375M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0z"})}),Hd=({className:s=fe,width:l=24,height:i=24,strokeWidth:o=1.5})=>t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:o,stroke:"currentColor",className:s,width:l,height:i,children:t.jsx("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M15.666 3.888A2.25 2.25 0 0 0 13.5 2.25h-3c-1.03 0-1.9.693-2.166 1.638m7.332 0c.055.194.084.4.084.612v0a.75.75 0 0 1-.75.75H9a.75.75 0 0 1-.75-.75v0c0-.212.03-.418.084-.612m7.332 0c.646.049 1.288.11 1.927.184 1.1.128 1.907 1.077 1.907 2.185V19.5a2.25 2.25 0 0 1-2.25 2.25H6.75A2.25 2.25 0 0 1 4.5 19.5V6.257c0-1.108.806-2.057 1.907-2.185a48.208 48.208 0 0 1 1.927-.184"})}),Vd=({className:s=fe,width:l=24,height:i=24,strokeWidth:o=1.5})=>t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:o,stroke:"currentColor",className:s,width:l,height:i,children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11.35 3.836c-.655.355-1.08.852-1.358 1.446-.201.416-.348.665-.518.923a2.712 2.712 0 0 0-.5 1.703c0 .462.1.946.348 1.384.245.531.645 1.046 1.28 1.696a.75.75 0 0 0 1.067-.03c.635-.64 1.035-1.165 1.28-1.696.248-.438.348-.922.348-1.384a2.712 2.712 0 0 0-.5-1.703c-.17-.258-.317-.507-.518-.923-.278-.594-.703-1.091-1.358-1.446m0 0C9.806 2.94 10.923 2.5 12 2.5c1.077 0 2.194.44 3.15 1.336m-1.8 0c.068.087.137.176.207.266.343.417.682.83 1.013 1.296.31.426.629.846 1.013 1.296a.75.75 0 0 0-.584 1.28 60.461 60.461 0 0 1-2.694-.449.75.75 0 0 0-.606.073c-.223.145-.456.366-.656.732a2.75 2.75 0 0 0-.426-1.26c0-.45.09-.88.258-1.28H9m0 0c.068.087.137.176.207.266.343.417.682.83 1.013 1.296.31.426.629.846 1.013 1.296M6.75 12a3 3 0 1 1 6 0 3 3 0 0 1-6 0zm12 0a3 3 0 1 1 6 0 3 3 0 0 1-6 0z"})}),cx=({className:s=fe,width:l=24,height:i=24,strokeWidth:o=1.5})=>t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:o,stroke:"currentColor",className:s,width:l,height:i,children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.375 19.5h17.25m-17.25-4.5h17.25m-17.25-4.5h17.25m-17.25-4.5h17.25"})}),ux=({className:s=fe,width:l=24,height:i=24,strokeWidth:o=1.5})=>t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:o,stroke:"currentColor",className:s,width:l,height:i,children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.75 3.104v5.714a2.25 2.25 0 0 1-.659 1.591L5.432 15.3a9.01 9.01 0 0 0-2.02 3.991v2.084a2.25 2.25 0 0 0 2.25 2.25h13.636a2.25 2.25 0 0 0 2.25-2.25v-2.084a9.01 9.01 0 0 0-2.02-3.991l-3.659-4.591A2.25 2.25 0 0 1 14.25 8.818v-5.714m0 0L9.75 3.104M14.25 3.104l4.5 0v5.714a2.25 2.25 0 0 1-.659 1.591L18.568 15.3"})}),dx=({className:s=fe,width:l=24,height:i=24,strokeWidth:o=1.5})=>t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:o,stroke:"currentColor",className:s,width:l,height:i,children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 6.75v10.5a.75.75 0 0 1-1.5 0V6.75m0 0a.75.75 0 0 1 1.5 0zm12 0v10.5a.75.75 0 0 1-1.5 0V6.75m0 0a.75.75 0 0 1 1.5 0z"})}),Ao=({className:s=fe,width:l=24,height:i=24,strokeWidth:o=1.5})=>t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:o,stroke:"currentColor",className:s,width:l,height:i,children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5.25 7.5A2.25 2.25 0 0 1 7.5 5.25h9a2.25 2.25 0 0 1 2.25 2.25v9a2.25 2.25 0 0 1-2.25 2.25h-9a2.25 2.25 0 0 1-2.25-2.25v-9z"})}),mx=({className:s=fe,width:l=24,height:i=24,strokeWidth:o=1.5})=>t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:o,stroke:"currentColor",className:s,width:l,height:i,children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 21l-5.197-5.197m0 0A7.5 7.5 0 1 0 5.5 5.5a7.5 7.5 0 0 0 10.5 10.5zm-6-3.75h.008v.008H12v-.008zm0 2.25h.008v.008H12v-.008zm0-8.25h.008v.008H12V8.25z"})}),hx=({className:s=fe,width:l=24,height:i=24,strokeWidth:o=1.5})=>t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:o,stroke:"currentColor",className:s,width:l,height:i,children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 21l-5.197-5.197m0 0A7.5 7.5 0 1 0 5.5 5.5a7.5 7.5 0 0 0 10.5 10.5zm-3-7.5h-3m0 0H9m0 0v3m0-3v-3"})}),fx=({className:s=fe,width:l=24,height:i=24,strokeWidth:o=1.5})=>t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:o,stroke:"currentColor",className:s,width:l,height:i,children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m19.5 8.25-7.5 7.5-7.5-7.5"})}),xx=({className:s=fe,width:l=24,height:i=24,strokeWidth:o=1.5})=>t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:o,stroke:"currentColor",className:s,width:l,height:i,children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m8.25 4.5 7.5 7.5-7.5 7.5"})}),px=({className:s=fe,width:l=24,height:i=24,strokeWidth:o=1.5})=>t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:o,stroke:"currentColor",className:s,width:l,height:i,children:t.jsx("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M15.75 9V5.25A2.25 2.25 0 0 0 13.5 3h-6a2.25 2.25 0 0 0-2.25 2.25v13.5A2.25 2.25 0 0 0 7.5 21h6a2.25 2.25 0 0 0 2.25-2.25V15m3 0 3-3m0 0-3-3m3 3H9"})}),Am=v.createContext(void 0),gx=window.ENV?.API_URL??"http://localhost:8999",Xs=`${gx}/api`,es="monodog_session_token",ts="monodog_session_data";function yx({children:s}){const[l,i]=v.useState(null),[o,u]=v.useState(!0),[m,h]=v.useState(null);v.useEffect(()=>{const L=localStorage.getItem(es),A=localStorage.getItem(ts);if(L&&A)try{const P=JSON.parse(A);i({sessionToken:L,...P})}catch{localStorage.removeItem(es),localStorage.removeItem(ts)}u(!1)},[]);const p=v.useCallback(async()=>{try{u(!0),h(null);const L=await fetch(`${Xs}/auth/login`,{method:"GET"});if(!L.ok)throw new Error("Failed to initiate login");const A=await L.json();A.authUrl&&(window.location.href=A.authUrl)}catch(L){const A=L instanceof Error?L.message:"Login failed";h(A),u(!1)}},[]),x=v.useCallback(async(L,A)=>{try{u(!0),h(null);const P=await fetch(`${Xs}/auth/me`,{method:"GET",headers:{Authorization:`Bearer ${L}`}});if(!P.ok)throw new Error("Failed to fetch user info");const O=await P.json(),M={sessionToken:L,user:O.user,scopes:O.scopes||[],expiresAt:O.expiresAt},R={user:O.user,scopes:O.scopes||[],permission:A||O.permission,expiresAt:O.expiresAt};localStorage.setItem(es,L),localStorage.setItem(ts,JSON.stringify(R));const $={...M,...R};return i($),!0}catch(P){const O=P instanceof Error?P.message:"Auth failed";return h(O),!1}finally{u(!1)}},[]),y=v.useCallback(async()=>{try{u(!0),l?.sessionToken&&await fetch(`${Xs}/auth/logout`,{method:"POST",headers:{Authorization:`Bearer ${l.sessionToken}`}}),localStorage.removeItem(es),localStorage.removeItem(ts),i(null)}catch(L){console.error("Logout error:",L)}finally{u(!1)}},[l]),k=v.useCallback(async()=>{if(!l?.sessionToken)return!1;try{const L=await fetch(`${Xs}/auth/validate`,{method:"POST",headers:{Authorization:`Bearer ${l.sessionToken}`}});return L.ok?(await L.json()).valid===!0:(localStorage.removeItem(es),localStorage.removeItem(ts),i(null),!1)}catch(L){return console.error("Session check error:",L),!1}},[l]),j=v.useCallback(async()=>{if(!l?.sessionToken)return!1;try{u(!0);const L=await fetch(`${Xs}/auth/refresh`,{method:"POST",headers:{Authorization:`Bearer ${l.sessionToken}`}});if(!L.ok)throw new Error("Failed to refresh session");const A=await L.json();if(A.success&&A.sessionToken){const P={sessionToken:A.sessionToken,user:l.user,scopes:l.scopes,expiresAt:A.expiresAt};return localStorage.setItem(es,A.sessionToken),localStorage.setItem(ts,JSON.stringify({user:l.user,scopes:l.scopes,expiresAt:A.expiresAt})),i(P),!0}return!1}catch(L){return console.error("Session refresh error:",L),!1}finally{u(!1)}},[l]);v.useEffect(()=>{if(!l)return;const L=setInterval(()=>{k()},300*1e3);return()=>clearInterval(L)},[l,k]);const E=v.useCallback(L=>{if(!l)return console.warn("[Auth] No session available for permission check"),!1;const A={admin:4,maintain:3,write:2,read:1,none:0};let P="read";const O=l?.permission;typeof O=="string"?P=O:O&&typeof O=="object"&&(O.level?P=O.level:O.permission&&(P=O.permission));const M=A[P]||0,R=A[L]||0;return console.debug(`[Auth] Permission check: user=${P}(${M}) required=${L}(${R}) result=${M>=R}`),M>=R},[l]),I={session:l,isAuthenticated:!!l,isLoading:o,error:m,login:p,logout:y,checkSession:k,refreshSession:j,hasPermission:E,permission:(()=>{const L=l?.permission;return L&&(L.level||L.permission)||null})()};return window.__authContext={handleOAuthCallback:x},t.jsx(Am.Provider,{value:I,children:s})}function Er(){const s=pm.useContext(Am);if(s===void 0)throw new Error("useAuth must be used within an AuthProvider");return s}const Wd=[{name:"Dashboard",href:"/",icon:ex},{name:"Packages",href:"/packages",icon:Lt},{name:"Dependencies",href:"/dependencies",icon:il},{name:"Health Status",href:"/health",icon:Go},{name:"Release",href:"/release",icon:Lo},{name:"Release Pipeline",href:"/pipeline",icon:Tn},{name:"Publish Control",href:"/publish",icon:Lo},{name:"CI/CD",href:"/ci",icon:Pm},{name:"Configuration",href:"/config",icon:Cr}];function vx({children:s}){const l=is(),{session:i,logout:o}=Er();return t.jsxs("div",{className:"min-h-screen bg-neutral-50",children:[t.jsxs("div",{className:"fixed inset-y-0 left-0 z-50 w-64 bg-white shadow-medium",children:[t.jsx("div",{className:"flex h-16 items-center justify-center border-b border-neutral-200",children:t.jsx("h1",{className:"text-heading text-xl text-primary-700",children:"MonoDog"})}),t.jsx("nav",{className:"mt-8 px-4",children:t.jsx("ul",{className:"space-y-2",children:Wd.map(u=>{const m=l.pathname===u.href;return t.jsx("li",{children:t.jsxs(Cn,{to:u.href,className:`nav-link ${m?"nav-link-active":"nav-link-inactive"}`,children:[t.jsx(u.icon,{className:"mr-3 h-5 w-5"}),u.name]})},u.name)})})})]}),t.jsxs("div",{className:"pl-64",children:[t.jsxs("header",{className:"bg-white shadow-soft border-b border-neutral-200 flex items-center justify-between px-6 py-4",children:[t.jsx("div",{className:"flex items-center gap-4",children:t.jsx("h2",{className:"text-heading text-lg font-semibold",children:Wd.find(u=>u.href===l.pathname)?.name||"Dashboard"})}),t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsxs("div",{className:"flex flex-col items-end text-sm",children:[i&&t.jsx("span",{className:"font-medium text-primary-700",children:i.user.login}),i&&t.jsx("span",{className:"text-neutral-500",children:i.permission.role})]}),t.jsx("div",{className:"flex flex-col items-end text-sm",children:t.jsx("button",{className:"font-medium",onClick:o,title:"Logout",children:t.jsx(px,{})})})]})]}),t.jsx("main",{className:"p-6",children:s})]})]})}function jx({isOpen:s,onClose:l,children:i}){return s?t.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",children:t.jsx("div",{className:"bg-white rounded-lg shadow-xl w-full max-w-4xl max-h-[90vh] overflow-hidden",onClick:o=>o.stopPropagation(),children:i})}):null}function wx({onSave:s,onClose:l}){return t.jsxs("div",{className:"flex items-center justify-between p-6 border-b border-gray-200",children:[t.jsxs("div",{className:"flex items-center space-x-3",children:[t.jsx(Lm,{className:"w-6 h-6 text-gray-600"}),t.jsx("h2",{className:"text-xl font-semibold text-gray-900",children:"Dashboard Configuration"})]}),t.jsxs("div",{className:"flex space-x-3",children:[t.jsxs("button",{onClick:s,className:"bg-blue-600 text-white px-4 py-2 rounded-lg hover:bg-blue-700 flex items-center space-x-2",children:[t.jsx(Vo,{className:"w-5 h-5"}),t.jsx("span",{children:"Save"})]}),t.jsxs("button",{onClick:l,className:"bg-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-400 flex items-center space-x-2",children:[t.jsx(al,{className:"w-5 h-5"}),t.jsx("span",{children:"Cancel"})]})]})]})}const Nx=()=>[{id:"general",label:"General",icon:t.jsx(Cr,{className:"w-6 h-6 text-primary-600"})},{id:"features",label:"Features",icon:t.jsx(Tn,{className:"w-6 h-6 text-primary-600"})},{id:"branding",label:"Branding",icon:"🎨"},{id:"monorepo",label:"Monorepo",icon:t.jsx(Lt,{className:"w-6 h-6 text-primary-600"})}],bx=()=>({title:"monodog Dashboard",description:"Visual management of our monorepo packages",packageTypes:["app","lib","tool","service"],customFields:["team","priority","environment"],features:{healthChecks:!0,ciIntegration:!0,dependencyGraph:!0,publishControl:!0,searchAndFilter:!0,configurationInspector:!0},branding:{logo:"",primaryColor:"#3B82F6",secondaryColor:"#1E40AF"},monorepo:{structure:"standard",packageManager:"pnpm",directories:["apps","packages","libs"],ignorePatterns:["node_modules","dist",".git"]}}),Gd=s=>{const l=bx();return{...l,...s,features:{...l.features,...s.features},branding:{...l.branding,...s.branding},monorepo:{...l.monorepo,...s.monorepo}}},Sx=s=>{const l=[];return(!s.title||s.title.trim()==="")&&l.push("Dashboard title is required"),s.monorepo?.directories&&s.monorepo.directories.length===0&&l.push("At least one package directory is required"),s.branding?.primaryColor&&!Yd(s.branding.primaryColor)&&l.push("Primary color must be a valid hex color"),s.branding?.secondaryColor&&!Yd(s.branding.secondaryColor)&&l.push("Secondary color must be a valid hex color"),{isValid:l.length===0,errors:l}},Yd=s=>/^#[0-9A-F]{6}$/i.test(s),ka=s=>s.split(",").map(l=>l.trim()).filter(l=>l.length>0),Ca=s=>s?s.join(", "):"",kx=s=>s.replace(/([A-Z])/g," $1").trim();function Cx({activeTab:s,onTabChange:l}){const i=Nx();return t.jsx("div",{className:"border-b border-gray-200",children:t.jsx("nav",{className:"flex space-x-8 px-6",children:i.map(o=>t.jsxs("button",{onClick:()=>l(o.id),className:`py-4 px-1 border-b-2 font-medium text-sm flex items-center space-x-2 ${s===o.id?"border-blue-500 text-blue-600":"border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300"}`,children:[t.jsx("span",{children:o.icon}),t.jsx("span",{children:o.label})]},o.id))})})}function Qd({config:s,onConfigChange:l}){return t.jsx("div",{className:"space-y-6",children:t.jsxs("div",{children:[t.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-4",children:"General Settings"}),t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[t.jsxs("div",{children:[t.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Dashboard Title"}),t.jsx("input",{type:"text",value:s.title||"",onChange:i=>l({title:i.target.value}),className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent",placeholder:"My Monorepo Dashboard"})]}),t.jsxs("div",{children:[t.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Description"}),t.jsx("input",{type:"text",value:s.description||"",onChange:i=>l({description:i.target.value}),className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent",placeholder:"Visual management of our monorepo packages"})]}),t.jsxs("div",{children:[t.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Package Types"}),t.jsx("input",{type:"text",value:Ca(s.packageTypes),onChange:i=>l({packageTypes:ka(i.target.value)}),className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent",placeholder:"app, lib, tool, service"}),t.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Comma-separated list of package types"})]}),t.jsxs("div",{children:[t.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Custom Fields"}),t.jsx("input",{type:"text",value:Ca(s.customFields),onChange:i=>l({customFields:ka(i.target.value)}),className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent",placeholder:"team, priority, environment"}),t.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Additional fields to display for packages"})]})]})]})})}function Ex({config:s,onConfigChange:l}){const i=(o,u)=>{l({features:{...s.features,[o]:u}})};return t.jsx("div",{className:"space-y-6",children:t.jsxs("div",{children:[t.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-4",children:"Feature Toggles"}),t.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:Object.entries(s.features||{}).map(([o,u])=>t.jsxs("label",{className:"flex items-center space-x-3",children:[t.jsx("input",{type:"checkbox",checked:u,onChange:m=>i(o,m.target.checked),className:"h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 rounded"}),t.jsx("span",{className:"text-sm font-medium text-gray-700 capitalize",children:kx(o)})]},o))}),t.jsxs("div",{className:"mt-6 p-4 bg-blue-50 border border-blue-200 rounded-lg",children:[t.jsx("h4",{className:"text-sm font-medium text-blue-900 mb-2",children:"Feature Descriptions"}),t.jsxs("div",{className:"text-xs text-blue-800 space-y-1",children:[t.jsxs("div",{children:[t.jsx("strong",{children:"Health Checks:"})," Monitor package health and status"]}),t.jsxs("div",{children:[t.jsx("strong",{children:"CI Integration:"})," Connect with CI/CD providers"]}),t.jsxs("div",{children:[t.jsx("strong",{children:"Dependency Graph:"})," Visualize package dependencies"]}),t.jsxs("div",{children:[t.jsx("strong",{children:"Publish Control:"})," Manage package publishing and versioning"]}),t.jsxs("div",{children:[t.jsx("strong",{children:"Search And Filter:"})," Advanced search and filtering capabilities"]}),t.jsxs("div",{children:[t.jsx("strong",{children:"Configuration Inspector:"})," View and edit configuration files"]})]})]})]})})}function Tx({config:s,onConfigChange:l}){const i=(o,u)=>{l({branding:{...s.branding,[o]:u}})};return t.jsx("div",{className:"space-y-6",children:t.jsxs("div",{children:[t.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-4",children:"Branding & Appearance"}),t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[t.jsxs("div",{children:[t.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Logo URL"}),t.jsx("input",{type:"text",value:s.branding?.logo||"",onChange:o=>i("logo",o.target.value),className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent",placeholder:"https://example.com/logo.png"}),t.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"URL to your company logo"})]}),t.jsxs("div",{children:[t.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Primary Color"}),t.jsxs("div",{className:"flex items-center space-x-3",children:[t.jsx("input",{type:"color",value:s.branding?.primaryColor||"#3B82F6",onChange:o=>i("primaryColor",o.target.value),className:"h-10 w-20 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent"}),t.jsx("input",{type:"text",value:s.branding?.primaryColor||"#3B82F6",onChange:o=>i("primaryColor",o.target.value),className:"flex-1 px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent",placeholder:"#3B82F6"})]}),t.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Primary brand color for buttons and accents"})]}),t.jsxs("div",{children:[t.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Secondary Color"}),t.jsxs("div",{className:"flex items-center space-x-3",children:[t.jsx("input",{type:"color",value:s.branding?.secondaryColor||"#1E40AF",onChange:o=>i("secondaryColor",o.target.value),className:"h-10 w-20 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent"}),t.jsx("input",{type:"text",value:s.branding?.secondaryColor||"#1E40AF",onChange:o=>i("secondaryColor",o.target.value),className:"flex-1 px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent",placeholder:"#1E40AF"})]}),t.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Secondary color for hover states and highlights"})]})]}),t.jsxs("div",{className:"mt-6 p-4 bg-gray-50 border border-gray-200 rounded-lg",children:[t.jsx("h4",{className:"text-sm font-medium text-gray-900 mb-3",children:"Color Preview"}),t.jsxs("div",{className:"flex items-center space-x-4",children:[t.jsxs("div",{className:"flex items-center space-x-2",children:[t.jsx("div",{className:"w-8 h-8 rounded-lg border border-gray-300",style:{backgroundColor:s.branding?.primaryColor||"#3B82F6"}}),t.jsx("span",{className:"text-sm text-gray-600",children:"Primary"})]}),t.jsxs("div",{className:"flex items-center space-x-2",children:[t.jsx("div",{className:"w-8 h-8 rounded-lg border border-gray-300",style:{backgroundColor:s.branding?.secondaryColor||"#1E40AF"}}),t.jsx("span",{className:"text-sm text-gray-600",children:"Secondary"})]}),t.jsx("button",{className:"px-4 py-2 rounded-lg text-white text-sm font-medium",style:{backgroundColor:s.branding?.primaryColor||"#3B82F6"},children:"Sample Button"})]})]})]})})}function Px({config:s,onConfigChange:l}){const i=(o,u)=>{l({monorepo:{...s.monorepo,[o]:u}})};return t.jsx("div",{className:"space-y-6",children:t.jsxs("div",{children:[t.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-4",children:"Monorepo Configuration"}),t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[t.jsxs("div",{children:[t.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Structure Type"}),t.jsxs("select",{value:s.monorepo?.structure||"standard",onChange:o=>i("structure",o.target.value),className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent",children:[t.jsx("option",{value:"standard",children:"Standard (apps/packages/libs)"}),t.jsx("option",{value:"custom",children:"Custom Structure"})]}),t.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Choose your monorepo directory structure"})]}),t.jsxs("div",{children:[t.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Package Manager"}),t.jsxs("select",{value:s.monorepo?.packageManager||"pnpm",onChange:o=>i("packageManager",o.target.value),className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent",children:[t.jsx("option",{value:"pnpm",children:"pnpm"}),t.jsx("option",{value:"npm",children:"npm"}),t.jsx("option",{value:"yarn",children:"Yarn"}),t.jsx("option",{value:"lerna",children:"Lerna"}),t.jsx("option",{value:"nx",children:"Nx"})]}),t.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Package manager used in your monorepo"})]}),t.jsxs("div",{children:[t.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Package Directories"}),t.jsx("input",{type:"text",value:Ca(s.monorepo?.directories),onChange:o=>i("directories",ka(o.target.value)),className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent",placeholder:"apps, packages, libs, services"}),t.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Directories containing packages"})]}),t.jsxs("div",{children:[t.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Ignore Patterns"}),t.jsx("input",{type:"text",value:Ca(s.monorepo?.ignorePatterns),onChange:o=>i("ignorePatterns",ka(o.target.value)),className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent",placeholder:"node_modules, dist, .git"}),t.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Patterns to ignore when scanning"})]})]}),t.jsxs("div",{className:"mt-6 p-4 bg-gray-50 border border-gray-200 rounded-lg",children:[t.jsx("h4",{className:"text-sm font-medium text-gray-900 mb-3",children:"Configuration Preview"}),t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 text-sm",children:[t.jsxs("div",{children:[t.jsx("span",{className:"font-medium text-gray-700",children:"Structure:"}),t.jsx("span",{className:"ml-2 text-gray-600 capitalize",children:s.monorepo?.structure||"standard"})]}),t.jsxs("div",{children:[t.jsx("span",{className:"font-medium text-gray-700",children:"Package Manager:"}),t.jsx("span",{className:"ml-2 text-gray-600",children:s.monorepo?.packageManager||"pnpm"})]}),t.jsxs("div",{children:[t.jsx("span",{className:"font-medium text-gray-700",children:"Directories:"}),t.jsxs("span",{className:"ml-2 text-gray-600",children:[s.monorepo?.directories?.length||0," configured"]})]}),t.jsxs("div",{children:[t.jsx("span",{className:"font-medium text-gray-700",children:"Ignore Patterns:"}),t.jsxs("span",{className:"ml-2 text-gray-600",children:[s.monorepo?.ignorePatterns?.length||0," patterns"]})]})]})]}),s.monorepo?.packageManager&&t.jsxs("div",{className:"mt-4 p-4 bg-blue-50 border border-blue-200 rounded-lg",children:[t.jsxs("h4",{className:"text-sm font-medium text-blue-900 mb-2",children:[s.monorepo.packageManager.toUpperCase()," Configuration Tips"]}),t.jsxs("div",{className:"text-xs text-blue-800",children:[s.monorepo.packageManager==="pnpm"&&t.jsx("p",{children:"Make sure you have a pnpm-workspace.yaml file in your root directory."}),s.monorepo.packageManager==="npm"&&t.jsx("p",{children:'Configure workspaces in your package.json with the "workspaces" field.'}),s.monorepo.packageManager==="yarn"&&t.jsx("p",{children:"Ensure you have workspaces configured in your package.json."}),s.monorepo.packageManager==="lerna"&&t.jsx("p",{children:"Make sure you have a lerna.json configuration file in your root."}),s.monorepo.packageManager==="nx"&&t.jsx("p",{children:"Ensure you have an nx.json configuration file in your workspace root."})]})]})]})})}function _x({isOpen:s,onClose:l,onSave:i,currentConfig:o}){const[u,m]=v.useState(Gd(o)),[h,p]=v.useState("general");v.useEffect(()=>{m(Gd(o))},[o]);const x=()=>{const j=Sx(u);j.isValid||console.warn("Configuration validation errors:",j.errors),i(u),l()},y=j=>{m(E=>({...E,...j}))},k=()=>{const j={config:u,onConfigChange:y};switch(h){case"general":return t.jsx(Qd,{...j});case"features":return t.jsx(Ex,{...j});case"branding":return t.jsx(Tx,{...j});case"monorepo":return t.jsx(Px,{...j});default:return t.jsx(Qd,{...j})}};return t.jsxs(jx,{isOpen:s,onClose:l,children:[t.jsx(wx,{onSave:x,onClose:l}),t.jsx(Cx,{activeTab:h,onTabChange:p}),t.jsx("div",{className:"p-6 overflow-y-auto max-h-[60vh]",children:k()})]})}function Lx({isOpen:s,onClose:l,children:i}){return s?t.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center p-4 z-50",children:t.jsx("div",{className:"bg-white rounded-lg shadow-xl max-w-2xl w-full max-h-[90vh] overflow-hidden",onClick:o=>o.stopPropagation(),children:i})}):null}function Ax({onClose:s}){return t.jsxs("div",{className:"flex items-center justify-between p-6 border-b border-gray-200",children:[t.jsxs("div",{children:[t.jsx("h2",{className:"text-xl font-semibold text-gray-900",children:"Setup Guide"}),t.jsx("p",{className:"text-sm text-gray-600 mt-1",children:"Configure your monorepo dashboard for optimal performance"})]}),t.jsx("button",{onClick:s,className:"text-gray-400 hover:text-gray-600 transition-colors",children:t.jsx(al,{className:"w-6 h-6"})})]})}function Rx({progress:s}){const{currentStep:l,totalSteps:i,completedSteps:o}=s,u=(l+1)/i*100;return t.jsxs("div",{className:"px-6 py-4 border-b border-gray-200",children:[t.jsxs("div",{className:"flex items-center justify-between mb-2",children:[t.jsxs("span",{className:"text-sm font-medium text-gray-700",children:["Step ",l+1," of ",i]}),t.jsxs("span",{className:"text-sm text-gray-500",children:[o," completed"]})]}),t.jsx("div",{className:"w-full bg-gray-200 rounded-full h-2",children:t.jsx("div",{className:"bg-blue-600 h-2 rounded-full transition-all duration-300",style:{width:`${u}%`}})})]})}function Mx({step:s,onStepComplete:l}){const i=()=>{switch(s.id){case"monorepo-structure":return t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-4",children:[t.jsx("h4",{className:"font-medium text-blue-900 mb-2",children:"Quick Setup"}),t.jsx("p",{className:"text-blue-800 text-sm mb-3",children:"Choose your monorepo structure to get started quickly:"}),t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[t.jsxs("button",{onClick:()=>l(s.id),className:"p-3 border border-blue-300 rounded-lg hover:bg-blue-100 text-left",children:[t.jsx("div",{className:"font-medium text-blue-900",children:"Standard Structure"}),t.jsx("div",{className:"text-sm text-blue-700",children:"apps/, packages/, libs/"})]}),t.jsxs("button",{onClick:()=>l(s.id),className:"p-3 border border-blue-300 rounded-lg hover:bg-blue-100 text-left",children:[t.jsx("div",{className:"font-medium text-blue-900",children:"Custom Structure"}),t.jsx("div",{className:"text-sm text-blue-700",children:"Define your own directories"})]})]})]}),t.jsxs("div",{className:"bg-gray-50 border border-gray-200 rounded-lg p-4",children:[t.jsx("h4",{className:"font-medium text-gray-900 mb-2",children:"Manual Configuration"}),t.jsxs("div",{className:"space-y-3",children:[t.jsxs("div",{children:[t.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Root Directory"}),t.jsx("input",{type:"text",defaultValue:"/path/to/monorepo",className:"w-full px-3 py-2 border border-gray-300 rounded-md text-sm"})]}),t.jsxs("div",{children:[t.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Package Manager"}),t.jsxs("select",{className:"w-full px-3 py-2 border border-gray-300 rounded-md text-sm",children:[t.jsx("option",{value:"pnpm",children:"pnpm"}),t.jsx("option",{value:"npm",children:"npm"}),t.jsx("option",{value:"yarn",children:"yarn"})]})]})]})]})]});case"package-scanning":return t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{className:"bg-green-50 border border-green-200 rounded-lg p-4",children:[t.jsx("h4",{className:"font-medium text-green-900 mb-2",children:"Automatic Discovery"}),t.jsx("p",{className:"text-green-800 text-sm mb-3",children:"We'll scan your monorepo for packages automatically:"}),t.jsx("button",{onClick:()=>l(s.id),className:"bg-green-600 text-white px-4 py-2 rounded-lg hover:bg-green-700 text-sm",children:"Start Package Scan"})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsxs("div",{className:"flex items-center text-sm text-gray-600",children:[t.jsx(ss,{className:"w-4 h-4 mr-2"}),"Scans for package.json files"]}),t.jsxs("div",{className:"flex items-center text-sm text-gray-600",children:[t.jsx(ss,{className:"w-4 h-4 mr-2"}),"Analyzes dependencies and relationships"]}),t.jsxs("div",{className:"flex items-center text-sm text-gray-600",children:[t.jsx(ss,{className:"w-4 h-4 mr-2"}),"Detects build configurations"]})]})]});case"ci-integration":return t.jsx("div",{className:"space-y-4",children:t.jsxs("div",{className:"bg-purple-50 border border-purple-200 rounded-lg p-4",children:[t.jsx("h4",{className:"font-medium text-purple-900 mb-2",children:"Connect CI/CD"}),t.jsx("p",{className:"text-purple-800 text-sm mb-3",children:"Choose your CI/CD provider to monitor builds and deployments:"}),t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[t.jsxs("button",{onClick:()=>l(s.id),className:"p-3 border border-purple-300 rounded-lg hover:bg-purple-100 text-left",children:[t.jsx("div",{className:"font-medium text-purple-900",children:"GitHub Actions"}),t.jsx("div",{className:"text-sm text-purple-700",children:"Connect with GitHub"})]}),t.jsxs("button",{onClick:()=>l(s.id),className:"p-3 border border-purple-300 rounded-lg hover:bg-purple-100 text-left",children:[t.jsx("div",{className:"font-medium text-purple-900",children:"GitLab CI"}),t.jsx("div",{className:"text-sm text-purple-700",children:"Connect with GitLab"})]}),t.jsxs("button",{onClick:()=>l(s.id),className:"p-3 border border-purple-300 rounded-lg hover:bg-purple-100 text-left",children:[t.jsx("div",{className:"font-medium text-purple-900",children:"Jenkins"}),t.jsx("div",{className:"text-sm text-purple-700",children:"Connect with Jenkins"})]}),t.jsxs("button",{onClick:()=>l(s.id),className:"p-3 border border-purple-300 rounded-lg hover:bg-purple-100 text-left",children:[t.jsx("div",{className:"font-medium text-purple-900",children:"Skip for now"}),t.jsx("div",{className:"text-sm text-purple-700",children:"Configure later"})]})]})]})});case"health-checks":return t.jsx("div",{className:"space-y-4",children:t.jsxs("div",{className:"bg-orange-50 border border-orange-200 rounded-lg p-4",children:[t.jsx("h4",{className:"font-medium text-orange-900 mb-2",children:"Health Monitoring"}),t.jsx("p",{className:"text-orange-800 text-sm mb-3",children:"Configure how we monitor your package health:"}),t.jsxs("div",{className:"space-y-3",children:[t.jsxs("label",{className:"flex items-center",children:[t.jsx("input",{type:"checkbox",className:"mr-2",defaultChecked:!0}),t.jsx("span",{className:"text-sm text-orange-900",children:"Monitor build status"})]}),t.jsxs("label",{className:"flex items-center",children:[t.jsx("input",{type:"checkbox",className:"mr-2",defaultChecked:!0}),t.jsx("span",{className:"text-sm text-orange-900",children:"Track test coverage"})]}),t.jsxs("label",{className:"flex items-center",children:[t.jsx("input",{type:"checkbox",className:"mr-2"}),t.jsx("span",{className:"text-sm text-orange-900",children:"Dependency vulnerability scanning"})]}),t.jsxs("label",{className:"flex items-center",children:[t.jsx("input",{type:"checkbox",className:"mr-2"}),t.jsx("span",{className:"text-sm text-orange-900",children:"Performance monitoring"})]})]}),t.jsx("button",{onClick:()=>l(s.id),className:"mt-3 bg-orange-600 text-white px-4 py-2 rounded-lg hover:bg-orange-700 text-sm",children:"Save Settings"})]})});case"notifications":return t.jsx("div",{className:"space-y-4",children:t.jsxs("div",{className:"bg-indigo-50 border border-indigo-200 rounded-lg p-4",children:[t.jsx("h4",{className:"font-medium text-indigo-900 mb-2",children:"Notification Preferences"}),t.jsx("p",{className:"text-indigo-800 text-sm mb-3",children:"Choose how you want to be notified about important events:"}),t.jsxs("div",{className:"space-y-3",children:[t.jsxs("label",{className:"flex items-center",children:[t.jsx("input",{type:"checkbox",className:"mr-2",defaultChecked:!0}),t.jsx("span",{className:"text-sm text-indigo-900",children:"Build failures"})]}),t.jsxs("label",{className:"flex items-center",children:[t.jsx("input",{type:"checkbox",className:"mr-2"}),t.jsx("span",{className:"text-sm text-indigo-900",children:"Security vulnerabilities"})]}),t.jsxs("label",{className:"flex items-center",children:[t.jsx("input",{type:"checkbox",className:"mr-2"}),t.jsx("span",{className:"text-sm text-indigo-900",children:"Dependency updates"})]}),t.jsxs("label",{className:"flex items-center",children:[t.jsx("input",{type:"checkbox",className:"mr-2"}),t.jsx("span",{className:"text-sm text-indigo-900",children:"Performance degradation"})]})]}),t.jsx("button",{onClick:()=>l(s.id),className:"mt-3 bg-indigo-600 text-white px-4 py-2 rounded-lg hover:bg-indigo-700 text-sm",children:"Save Preferences"})]})});default:return t.jsx("div",{className:"text-center py-8",children:t.jsx("p",{className:"text-gray-500",children:"Step content not found"})})}};return t.jsxs("div",{className:"p-6 overflow-y-auto max-h-[50vh]",children:[t.jsxs("div",{className:"mb-6",children:[t.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-2",children:s.title}),t.jsx("p",{className:"text-gray-600 mb-4",children:s.description})]}),i()]})}function Ix({currentStep:s,totalSteps:l,canGoNext:i,canGoPrevious:o,onNext:u,onPrevious:m,onComplete:h,isLastStep:p}){return t.jsxs("div",{className:"flex items-center justify-between p-6 border-t border-gray-200",children:[t.jsx("button",{onClick:m,disabled:!o,className:`px-4 py-2 text-sm rounded-lg border transition-colors ${o?"border-gray-300 text-gray-700 hover:bg-gray-50":"border-gray-200 text-gray-400 cursor-not-allowed"}`,children:"Previous"}),t.jsx("div",{className:"flex space-x-2",children:Array.from({length:l},(x,y)=>t.jsx("div",{className:`w-2 h-2 rounded-full transition-colors ${y<=s?"bg-blue-600":"bg-gray-300"}`},y))}),p?t.jsxs("button",{onClick:h,className:"bg-green-600 text-white px-4 py-2 rounded-lg hover:bg-green-700 flex items-center space-x-2 text-sm",children:[t.jsx(Vo,{className:"w-4 h-4"}),t.jsx("span",{children:"Complete Setup"})]}):t.jsx("button",{onClick:u,disabled:!i,className:`px-4 py-2 text-sm rounded-lg transition-colors ${i?"bg-blue-600 text-white hover:bg-blue-700":"bg-gray-300 text-gray-500 cursor-not-allowed"}`,children:"Next"})]})}const Ox=()=>[{id:"monorepo-structure",title:"Monorepo Structure",description:"Configure your monorepo directory structure and package manager",completed:!1,required:!0},{id:"package-scanning",title:"Package Scanning",description:"Set up automatic package discovery and dependency analysis",completed:!1,required:!0},{id:"ci-integration",title:"CI/CD Integration",description:"Connect with your CI/CD providers (GitHub Actions, GitLab CI, etc.)",completed:!1,required:!1},{id:"health-checks",title:"Health Monitoring",description:"Configure package health checks and status monitoring",completed:!1,required:!1},{id:"notifications",title:"Notifications",description:"Set up alerts and notifications for important events",completed:!1,required:!1}],Dx=(s,l)=>({currentStep:l,totalSteps:s.length,completedSteps:s.filter(i=>i.completed).length}),Fx=(s,l)=>{const i=s[l];return!i.required||i.completed},zx=s=>s.filter(i=>i.required).every(i=>i.completed),$x=(s,l)=>s.map(i=>i.id===l?{...i,completed:!0}:i);function Bx({isOpen:s,onClose:l,onComplete:i}){const[o,u]=v.useState(0),[m,h]=v.useState(Ox()),p=P=>{const O=$x(m,P);h(O),O[o].completed&&o<m.length-1&&u(R=>R+1)},x=()=>{o<m.length-1&&u(P=>P+1)},y=()=>{o>0&&u(P=>P-1)},k=()=>{zx(m)&&(i(),l())},j=Dx(m,o),E=Fx(m,o),I=o>0,L=o===m.length-1,A=m[o];return t.jsxs(Lx,{isOpen:s,onClose:l,children:[t.jsx(Ax,{onClose:l}),t.jsx(Rx,{progress:j}),t.jsx(Mx,{step:A,onStepComplete:p}),t.jsx(Ix,{currentStep:o,totalSteps:m.length,canGoNext:E,canGoPrevious:I,onNext:x,onPrevious:y,onComplete:k,isLastStep:L})]})}function Ux({config:s,onShowSetupGuide:l,onShowConfig:i,onRefresh:o}){return t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{children:[t.jsx("h1",{className:"text-heading text-3xl",children:s.title}),t.jsx("p",{className:"text-body mt-2",children:s.description}),t.jsx("button",{onClick:l,className:"hidden text-primary-600 hover:text-primary-700 text-sm font-medium mt-2",children:"First time? Run the setup guide"})]}),t.jsxs("div",{className:"flex space-x-3",children:[t.jsxs("button",{onClick:o,className:"btn-primary flex items-center space-x-2",children:[t.jsx(sr,{className:"w-5 h-5"}),t.jsx("span",{children:"Refresh"})]}),t.jsxs("button",{onClick:i,className:"hidden btn-ghost flex items-center space-x-2",children:[t.jsx(Lm,{className:"w-5 h-5"}),t.jsx("span",{children:"Configure"})]})]})]})}function Hx({stats:s}){return t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6",children:[t.jsx("div",{className:"card p-6 bg-gray-100",children:t.jsxs("div",{className:"flex items-center",children:[t.jsx("div",{className:"p-2 rounded-lg",children:t.jsx(Lt,{className:"w-6 h-6 text-primary-600"})}),t.jsxs("div",{className:"ml-4",children:[t.jsx("p",{className:"text-caption font-medium",children:"Total Packages"}),t.jsx("p",{className:"text-heading text-2xl",children:s.total})]})]})}),t.jsx("div",{className:"card p-6 bg-green-100",children:t.jsxs("div",{className:"flex items-center",children:[t.jsx("div",{className:"p-2 bg-secondary-100 rounded-lg",children:t.jsx(Tn,{className:"w-6 h-6 text-primary-600"})}),t.jsxs("div",{className:"ml-4",children:[t.jsx("p",{className:"text-caption font-medium",children:"Applications"}),t.jsx("p",{className:"text-heading text-2xl",children:s.apps})]})]})}),t.jsx("div",{className:"card p-6 bg-yellow-100",children:t.jsxs("div",{className:"flex items-center",children:[t.jsx("div",{className:"p-2 bg-accent-100 rounded-lg",children:t.jsx(La,{className:"w-6 h-6 text-primary-600"})}),t.jsxs("div",{className:"ml-4",children:[t.jsx("p",{className:"text-caption font-medium",children:"Libraries"}),t.jsx("p",{className:"text-heading text-2xl",children:s.libs})]})]})}),t.jsx("div",{className:"card p-6 bg-blue-100",children:t.jsxs("div",{className:"flex items-center",children:[t.jsx("div",{className:"p-2 rounded-lg",children:t.jsx(Aa,{className:"w-6 h-6 text-primary-600"})}),t.jsxs("div",{className:"ml-4",children:[t.jsx("p",{className:"text-caption font-medium",children:"Dependencies"}),t.jsx("p",{className:"text-heading text-2xl",children:s.totalDependencies})]})]})})]})}function Vx(){return t.jsxs("div",{className:"bg-white p-6 rounded-lg shadow border",children:[t.jsx("h3",{className:"text-lg font-semibold text-gray-900 mb-4",children:"Quick Actions"}),t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[t.jsx(Cn,{to:"/dependencies",className:"p-4 border border-gray-200 rounded-lg hover:border-blue-300 hover:bg-blue-50 transition-colors",children:t.jsxs("div",{className:"flex items-center space-x-3",children:[t.jsx("div",{className:"p-2 bg-blue-100 rounded-lg",children:t.jsx(il,{className:"w-6 h-6 text-primary-600"})}),t.jsxs("div",{children:[t.jsx("h4",{className:"font-medium text-gray-900",children:"Dependency Graph"}),t.jsx("p",{className:"text-sm text-gray-600",children:"Visualize package relationships"})]})]})}),t.jsx(Cn,{to:"/health",className:"p-4 border border-gray-200 rounded-lg hover:border-green-300 hover:bg-green-50 transition-colors",children:t.jsxs("div",{className:"flex items-center space-x-3",children:[t.jsx("div",{className:"p-2 bg-green-100 rounded-lg",children:t.jsx(Go,{className:"w-6 h-6 text-primary-600"})}),t.jsxs("div",{children:[t.jsx("h4",{className:"font-medium text-gray-900",children:"Health Check"}),t.jsx("p",{className:"text-sm text-gray-600",children:"Monitor package health"})]})]})}),t.jsx(Cn,{to:"/ci",className:"hidden p-4 border border-gray-200 rounded-lg hover:border-purple-300 hover:bg-purple-50 transition-colors",children:t.jsxs("div",{className:"flex items-center space-x-3",children:[t.jsx("div",{className:"p-2 bg-purple-100 rounded-lg",children:t.jsx("span",{className:"text-2xl",children:"🧪"})}),t.jsxs("div",{children:[t.jsx("h4",{className:"font-medium text-gray-900",children:"CI/CD Status"}),t.jsx("p",{className:"text-sm text-gray-600",children:"View build status"})]})]})})]})]})}function Wx({searchTerm:s,selectedType:l,packageTypes:i,onSearchChange:o,onTypeChange:u}){return t.jsxs("div",{className:"flex flex-col md:flex-row gap-4 mb-6",children:[t.jsxs("div",{className:"flex-1 relative",children:[t.jsx(Xo,{className:"w-5 h-5 absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400"}),t.jsx("input",{type:"text",placeholder:"Search packages...",value:s,onChange:m=>o(m.target.value),className:"w-full pl-10 pr-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent"})]}),t.jsxs("div",{className:"flex items-center space-x-2",children:[t.jsx(Ra,{className:"w-5 h-5 text-gray-400"}),t.jsxs("select",{value:l,onChange:m=>u(m.target.value),className:"px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent",children:[t.jsx("option",{value:"all",children:"All Types"}),i.map(m=>t.jsx("option",{value:m,className:"capitalize",children:m},m))]})]})]})}function Gx({packages:s,getTypeIcon:l,getStatusColor:i}){return t.jsx("div",{className:"overflow-x-auto",children:t.jsxs("table",{className:"min-w-full divide-y divide-gray-200",children:[t.jsx("thead",{className:"bg-gray-50",children:t.jsxs("tr",{children:[t.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Package"}),t.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Type"}),t.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Version"}),t.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Dependencies"}),t.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Description"}),t.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Actions"})]})}),t.jsx("tbody",{className:"bg-white divide-y divide-gray-200",children:s.map(o=>t.jsxs("tr",{className:"hover:bg-gray-50",children:[t.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:t.jsxs("div",{className:"flex items-center",children:[t.jsx("div",{className:"text-2xl mr-3",children:l(o.type)}),t.jsxs("div",{children:[t.jsx("div",{className:"text-sm font-medium text-gray-900",children:o.name}),t.jsx("div",{className:"text-sm text-gray-500",children:o.path})]})]})}),t.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:t.jsx("span",{className:`inline-flex px-2 py-1 text-xs font-semibold rounded-full ${i(o.type)}`,children:o.type})}),t.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-900",children:o.version}),t.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-900",children:Object.keys(o.dependencies).length+Object.keys(o.devDependencies).length+Object.keys(o.peerDependencies).length}),t.jsx("td",{className:"px-6 py-4 text-sm text-gray-900 max-w-xs truncate",children:o.description||"No description"}),t.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm font-medium",children:t.jsx(Cn,{to:`/packages/${encodeURIComponent(o.name)}`,className:"text-blue-600 hover:text-blue-500",children:"View Details"})})]},o.name))})]})})}const Yx=window.ENV?.API_URL??"http://localhost:8999",dn=`${Yx}/api`;class Qx{constructor(){this.mockPackages=[]}async getPackages(){try{const l=await fetch(`${dn}/packages`);if(l.ok)return await l.json();console.error(`getPackages: initial fetch failed with status ${l.status}. Attempting refresh...`);try{return await this.refreshPackages()}catch(i){return console.error("getPackages: refresh failed",i),[]}}catch(l){return console.error("getPackages: unexpected error",l),[]}}async getPackage(l){const i=await fetch(`${dn}/packages/`+encodeURIComponent(l));if(!i.ok)throw new Error(`Failed to fetch package details for "${l}" (Status: ${i.status})`);return await i.json()}async getDependencies(){await new Promise(i=>setTimeout(i,200));const l=new Set;try{return(await this.getPackages()).forEach(u=>{u.dependencies?.forEach(m=>l.add(m))}),Array.from(l).map(u=>({name:u,version:"unknown",type:"dependency",status:"active"}))}catch(i){return console.error("Error fetching dependencies:",i),[]}}async refreshPackages(){try{const l=await fetch(`${dn}/packages/refresh`,{method:"POST",headers:{"Content-Type":"application/json"}});return l.ok?await l.json():(console.error(`refreshPackages: fetch failed with status ${l.status}`),[])}catch(l){return console.error("refreshPackages: unexpected error",l),[]}}async getHealthStatus(){try{const l=await fetch(`${dn}/health/packages`);if(!l.ok){if(!(await fetch(`${dn}/health/refresh`,{method:"POST",headers:{"Content-Type":"application/json"}})).ok)throw new Error("Failed to refresh health data");await new Promise(h=>setTimeout(h,1e3));const u=await fetch(`${dn}/health/packages`);if(!u.ok)throw new Error("Failed to fetch health data after refresh");return await u.json()}return await l.json()}catch{}}async refreshHealthStatus(){try{const l=await fetch(`${dn}/health/refresh`,{method:"POST",headers:{"Content-Type":"application/json"}});if(!l.ok)throw new Error("Failed to fetch health data");return await l.json()}catch(l){console.error("Error fetching health data:",l)}}async getFallbackHealthStatus(){await new Promise(u=>setTimeout(u,400));const l=[{name:"Package Count",value:this.mockPackages.length,status:"healthy",description:`${this.mockPackages.length} packages in monorepo`},{name:"Dependency Health",value:85,status:"healthy",description:"Dependencies are up to date"},{name:"Build Status",value:95,status:"healthy",description:"Most builds are successful"}],i=this.mockPackages.map(u=>({package:u.name,score:u.status==="healthy"?90:u.status==="warning"?70:50,issues:u.status==="healthy"?[]:["Needs attention"]}));return{overallScore:85,metrics:l,packageHealth:i}}async updatePackageConfiguration(l,i,o){try{const u=await fetch(`${dn}/packages/update-config`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({packageName:l,config:i,packagePath:o})});if(!u.ok){const h=await u.text();console.error("📥 Error response:",h);let p=`HTTP error ${u.status}`;if(h)try{const x=JSON.parse(h);p=x.error||x.message||p}catch{p=h||p}throw new Error(p)}return await u.json()}catch(u){throw console.error("Error updating package configuration:",u),u}}async getBuildStatus(){await new Promise(i=>setTimeout(i,500));const l=[];for(const i of this.mockPackages){const o=i.scripts&&i.scripts.build,u=i.scripts&&i.scripts.test;if(o||u){const m=new Date(Date.now()-Math.random()*864e5).toISOString(),h=Math.random()>.8?"failed":Math.random()>.6?"building":Math.random()>.4?"queued":"success";l.push({id:`build-${i.name}-${Date.now()}`,package:i.name,status:h,startTime:m,endTime:h!=="building"?new Date(Date.now()-Math.random()*36e5).toISOString():void 0,duration:h!=="building"?Math.floor(Math.random()*300)+60:void 0,stages:this.generateBuildStages(i,h)})}}return l}async getConfigurationFiles(){try{const l=await fetch(`${dn}/config/files`);if(!l.ok)throw new Error(`Failed to fetch config files: ${l.status} ${l.statusText}`);const i=await l.json();if(i.success&&i.files)return i.files;throw new Error("Invalid response format from config files API")}catch(l){return console.error("Error fetching configuration files from backend:",l),[]}}async saveConfigurationFile(l,i){try{const o=await fetch(`${dn}/config/files/${encodeURIComponent(l)}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:i})});if(!o.ok){const m=await o.json();throw new Error(m.error||`Failed to save file: ${o.status} ${o.statusText}`)}const u=await o.json();if(u.success&&u.file)return u.file;throw new Error("Invalid response format from save file API")}catch(o){throw console.error("Error saving configuration file:",o),o}}generateBuildStages(l,i){const o=[{name:"Install",status:"success",duration:Math.floor(Math.random()*30)+10,logs:["Installing dependencies...","Dependencies installed successfully"]},{name:"Lint",status:i==="failed"&&Math.random()>.7?"failed":"success",duration:Math.floor(Math.random()*20)+5,logs:["Running ESLint...","Linting completed"]},{name:"Test",status:i==="failed"&&Math.random()>.5?"failed":"success",duration:Math.floor(Math.random()*60)+30,logs:["Running tests...","Test suite completed"]},{name:"Build",status:i==="failed"?"failed":"success",duration:Math.floor(Math.random()*120)+60,logs:["Building package...","Build completed successfully"]}];if(i==="building"){const u=Math.floor(Math.random()*o.length);o[u].status="running",o.slice(u+1).forEach(m=>m.status="pending")}return o}}const _t=new Qx,Kx=s=>({total:s.length,apps:s.filter(l=>l.type==="app").length,libs:s.filter(l=>l.type==="lib").length,tools:s.filter(l=>l.type==="tool").length,custom:s.filter(l=>!["app","Plib","tool"].includes(l.type)).length,totalDependencies:s.reduce((l,i)=>l+Object.keys(i.dependencies).length+Object.keys(i.peerDependencies).length+Object.keys(i.devDependencies).length,0)}),Xx=s=>[...new Set(s.map(l=>l.type))],Zx=(s,l,i)=>s.filter(o=>{const u=o.name.toLowerCase().includes(l.toLowerCase())||o.description?.toLowerCase().includes(l.toLowerCase()),m=i==="all"||o.type===i;return u&&m}),Jx=s=>{switch(s){case"app":return"bg-blue-100 text-blue-800";case"lib":return"bg-green-100 text-green-800";case"tool":return"bg-purple-100 text-purple-800";default:return"bg-gray-100 text-gray-800"}},qx=s=>{switch(s){case"app":return t.jsx(Tn,{className:"w-6 h-6 text-primary-600"});case"lib":return t.jsx(La,{className:"w-6 h-6 text-primary-600"});case"tool":return"🔧";default:return t.jsx(Lt,{className:"w-6 h-6 text-primary-600"})}};function Zo({message:s="Loading packages..."}){return t.jsx("div",{className:"flex items-center justify-center h-64",children:t.jsxs("div",{className:"text-center",children:[t.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-blue-600 mx-auto"}),t.jsx("p",{className:"mt-4 text-gray-600",children:s})]})})}function Rm({error:s,onRetry:l}){return t.jsx("div",{className:"flex items-center justify-center h-64",children:t.jsxs("div",{className:"text-center",children:[t.jsx(Je,{className:"w-12 h-12 text-red-500 mx-auto"}),t.jsx("p",{className:"mt-4 text-red-600",children:s}),l&&t.jsx("button",{onClick:l,className:"mt-4 bg-blue-600 text-white px-4 py-2 rounded-lg hover:bg-blue-700 transition-colors",children:"Retry"})]})})}function ep({stats:s}){return t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-6",children:[t.jsx("div",{className:"bg-gray-100 p-6 rounded-lg shadow border",children:t.jsxs("div",{className:"flex items-center",children:[t.jsx("div",{className:"p-2 rounded-lg",children:t.jsx(Lt,{className:"w-6 h-6 text-primary-600"})}),t.jsxs("div",{className:"ml-4",children:[t.jsx("p",{className:"text-sm font-medium text-gray-600",children:"Total Packages"}),t.jsx("p",{className:"text-2xl font-semibold text-gray-900",children:s.total})]})]})}),t.jsx("div",{className:"bg-green-100 p-6 rounded-lg shadow border",children:t.jsxs("div",{className:"flex items-center",children:[t.jsx("div",{className:"p-2 bg-green-100 rounded-lg",children:t.jsx(Pt,{className:"w-6 h-6 text-primary-600"})}),t.jsxs("div",{className:"ml-4",children:[t.jsx("p",{className:"text-sm font-medium text-gray-600",children:"Healthy"}),t.jsx("p",{className:"text-2xl font-semibold text-gray-600",children:s.healthy})]})]})}),t.jsx("div",{className:"bg-yellow-100 p-6 rounded-lg shadow border",children:t.jsxs("div",{className:"flex items-center",children:[t.jsx("div",{className:"p-2 bg-yellow-100 rounded-lg",children:t.jsx(Je,{className:"w-6 h-6 text-primary-600"})}),t.jsxs("div",{className:"ml-4",children:[t.jsx("p",{className:"text-sm font-medium text-gray-600",children:"Warnings"}),t.jsx("p",{className:"text-2xl font-semibold text-gray-600",children:s.warnings})]})]})}),t.jsx("div",{className:"bg-red-100 p-6 rounded-lg shadow border",children:t.jsxs("div",{className:"flex items-center",children:[t.jsx("div",{className:"p-2 bg-red-100 rounded-lg",children:t.jsx(Bt,{className:"w-6 h-6 text-primary-600"})}),t.jsxs("div",{className:"ml-4",children:[t.jsx("p",{className:"text-sm font-medium text-gray-600",children:"Errors"}),t.jsx("p",{className:"text-2xl font-semibold text-gray-600",children:s.errors})]})]})})]})}function tp({filters:s,onFiltersChange:l,availableTypes:i,availableStatuses:o}){return t.jsx("div",{className:"bg-white p-6 rounded-lg shadow border",children:t.jsxs("div",{className:"flex flex-col md:flex-row md:items-center md:justify-between space-y-4 md:space-y-0 md:space-x-4",children:[t.jsxs("div",{className:"flex-1 relative",children:[t.jsx(Xo,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400 h-5 w-5"}),t.jsx("input",{type:"text",placeholder:"Search packages by name, description, or tags...",value:s.search,onChange:u=>l({...s,search:u.target.value}),className:"w-full pl-10 pr-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent"})]}),t.jsxs("div",{className:"flex items-center space-x-4",children:[t.jsxs("div",{className:"flex items-center space-x-2",children:[t.jsx(Ra,{className:"h-5 w-5 text-gray-400"}),t.jsxs("select",{value:s.type,onChange:u=>l({...s,type:u.target.value}),className:"border border-gray-300 rounded-lg px-3 py-2 focus:ring-2 focus:ring-blue-500 focus:border-transparent",children:[t.jsx("option",{value:"all",children:"All Types"}),i.map(u=>t.jsx("option",{value:u,children:u.charAt(0).toUpperCase()+u.slice(1)},u))]})]}),t.jsxs("select",{value:s.status,onChange:u=>l({...s,status:u.target.value}),className:"border border-gray-300 rounded-lg px-3 py-2 focus:ring-2 focus:ring-blue-500 focus:border-transparent",children:[t.jsx("option",{value:"all",children:"All Status"}),o.map(u=>t.jsx("option",{value:u,children:u.charAt(0).toUpperCase()+u.slice(1)},u))]})]})]})})}const np=s=>({total:s.length,healthy:s.filter(l=>l.status==="healthy").length,warnings:s.filter(l=>l.status==="warning").length,errors:s.filter(l=>l.status==="error").length}),rp=s=>[...new Set(s.map(l=>l.type))],sp=s=>[...new Set(s.map(l=>l.status))],lp=(s,l)=>s.filter(i=>{const o=i.name.toLowerCase().includes(l.search.toLowerCase())||i.description.toLowerCase().includes(l.search.toLowerCase()),u=l.type==="all"||i.type===l.type,m=l.status==="all"||i.status===l.status;return o&&u&&m}),ap=(s,l)=>[...s].sort((i,o)=>{let u,m;switch(l.field){case"name":u=i.name.toLowerCase(),m=o.name.toLowerCase();break;case"version":u=i.version,m=o.version;break;case"lastUpdated":u=new Date(i.lastUpdated),m=new Date(o.lastUpdated);break;case"dependencies":u=Object.keys(i.dependencies).length,m=Object.keys(o.dependencies).length;break;default:return 0}return u<m?l.order==="asc"?-1:1:u>m?l.order==="asc"?1:-1:0}),Mm=s=>{switch(s){case"healthy":return"bg-green-100 text-green-800";case"warning":return"bg-yellow-100 text-yellow-800";case"error":return"bg-red-100 text-red-800";case"building":return"bg-blue-100 text-blue-800";default:return"bg-gray-100 text-gray-800"}},Im=s=>{switch(s){case"app":return"bg-blue-100 text-blue-800";case"lib":return"bg-purple-100 text-purple-800";case"tool":return"bg-orange-100 text-orange-800";case"service":return"bg-green-100 text-green-800";default:return"bg-gray-100 text-gray-800"}},ip=s=>{switch(s){case"up-to-date":return"bg-green-100 text-green-800";case"outdated":return"bg-yellow-100 text-yellow-800";case"major-update":return"bg-red-100 text-red-800";default:return"bg-gray-100 text-gray-800"}},op=s=>{switch(s){case"feature":return"bg-blue-100 text-blue-800";case"fix":return"bg-green-100 text-green-800";case"chore":return"bg-gray-100 text-gray-800";case"breaking":return"bg-red-100 text-red-800";default:return"bg-gray-100 text-gray-800"}},Jo=s=>new Date(s).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}),Om=s=>s.startsWith("v")?s:`v${s}`,Dm=s=>{switch(s){case"app":return t.jsx(Tn,{className:"w-6 h-6 text-primary-600"});case"lib":return t.jsx(La,{className:"w-6 h-6 text-primary-600"});case"tool":return"🔧";case"service":return"🌐";default:return t.jsx(Lt,{className:"w-6 h-6 text-primary-600"})}};function cp({packages:s,sorting:l,onSortChange:i}){const o=m=>{const h=l.field===m&&l.order==="asc"?"desc":"asc";i({field:m,order:h})},u=m=>l.field!==m?null:l.order==="asc"?t.jsx(Wo,{className:"w-4 h-4"}):t.jsx(Tm,{className:"w-4 h-4"});return t.jsx("div",{className:"bg-white rounded-lg shadow border overflow-hidden",children:t.jsx("div",{className:"overflow-x-auto",children:t.jsxs("table",{className:"w-full",children:[t.jsx("thead",{className:"bg-gray-50",children:t.jsxs("tr",{children:[t.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider cursor-pointer hover:bg-gray-100",onClick:()=>o("name"),children:t.jsxs("div",{className:"flex items-center space-x-1",children:[t.jsx("span",{children:"Package"}),u("name")]})}),t.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider cursor-pointer hover:bg-gray-100",onClick:()=>o("version"),children:t.jsxs("div",{className:"flex items-center space-x-1",children:[t.jsx("span",{children:"Version"}),u("version")]})}),t.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Type"}),t.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Status"}),t.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider cursor-pointer hover:bg-gray-100",onClick:()=>o("dependencies"),children:t.jsxs("div",{className:"flex items-center space-x-1",children:[t.jsx("span",{children:"Dependencies"}),u("dependencies")]})}),t.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider cursor-pointer hover:bg-gray-100",onClick:()=>o("lastUpdated"),children:t.jsxs("div",{className:"flex items-center space-x-1",children:[t.jsx("span",{children:"Last Updated"}),u("lastUpdated")]})}),t.jsx("th",{className:"hidden px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Maintainers"})]})}),t.jsx("tbody",{className:"bg-white divide-y divide-gray-200",children:s.map(m=>t.jsxs("tr",{className:"hover:bg-gray-50",children:[t.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:t.jsxs("div",{className:"flex items-center",children:[t.jsx("div",{className:"text-2xl mr-3",children:Dm(m.type)}),t.jsxs("div",{children:[t.jsx(Cn,{to:`/packages/${encodeURIComponent(m.name)}`,className:"text-sm font-medium text-blue-600 hover:text-blue-500",children:m.name}),t.jsx("div",{className:"text-sm text-gray-500",children:m.description})]})]})}),t.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:t.jsx("span",{className:"text-sm font-mono text-gray-900",children:Om(m.version)})}),t.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:t.jsx("span",{className:`inline-flex px-2 py-1 text-xs font-semibold rounded-full ${Im(m.type)}`,children:m.type})}),t.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:t.jsx("span",{className:`inline-flex px-2 py-1 text-xs font-semibold rounded-full ${Mm(m.status)}`,children:m.status})}),t.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-900",children:Object.keys(m.dependencies).length>0&&t.jsxs("div",{className:"text-xs text-gray-500 mt-1",children:[Object.keys(m.dependencies).slice(0,3).join(", "),Object.keys(m.dependencies).length>3&&` +${Object.keys(m.dependencies).length-3} more`]})}),t.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500",children:Jo(m.lastUpdated)}),t.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:t.jsxs("div",{className:"flex -space-x-1",children:[m.maintainers.slice(0,3).map((h,p)=>t.jsx("div",{className:"inline-flex items-center justify-center h-6 w-6 rounded-full bg-gray-500 text-xs font-medium text-white",title:h,children:h.charAt(0).toUpperCase()},h)),m.maintainers.length>3&&t.jsxs("div",{className:"inline-flex items-center justify-center h-6 w-6 rounded-full bg-gray-300 text-xs font-medium text-gray-600",children:["+",m.maintainers.length-3]})]})})]},m.name))})]})})})}function up({packageData:s}){const l=i=>{switch(i){case"healthy":return t.jsx(Pt,{className:"h-5 w-5 text-green-500"});case"warning":return t.jsx(Je,{className:"h-5 w-5 text-yellow-500"});case"error":return t.jsx(Je,{className:"h-5 w-5 text-red-500"});default:return t.jsx(We,{className:"h-5 w-5 text-gray-500"})}};return t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"mb-6",children:t.jsxs(Cn,{to:"/packages",className:"inline-flex items-center text-sm text-gray-500 hover:text-gray-700",children:[t.jsx(sx,{className:"mr-2 h-4 w-4"}),"Back to Packages"]})}),t.jsxs("div",{className:"bg-white rounded-lg shadow border p-6 mb-6",children:[t.jsxs("div",{className:"flex items-start justify-between",children:[t.jsxs("div",{className:"flex items-start space-x-4",children:[t.jsx("div",{className:"text-4xl",children:Dm(s.type)}),t.jsxs("div",{children:[t.jsx("h1",{className:"text-2xl font-bold text-gray-900",children:s.name}),t.jsx("p",{className:"text-gray-600 mt-1",children:s.description}),t.jsxs("div",{className:"flex items-center space-x-4 mt-4",children:[t.jsxs("div",{className:"flex items-center space-x-2",children:[t.jsx("span",{className:"text-sm font-medium text-gray-500",children:"Version:"}),t.jsx("span",{className:"text-sm font-mono bg-gray-100 px-2 py-1 rounded",children:Om(s.version)})]}),t.jsx("span",{className:`inline-flex px-2 py-1 text-xs font-semibold rounded-full ${Im(s.type)}`,children:s.type}),t.jsxs("div",{className:"flex items-center space-x-1",children:[l(s.status),t.jsx("span",{className:`inline-flex px-2 py-1 text-xs font-semibold rounded-full ${Mm(s.status)}`,children:s.status})]})]})]})]}),t.jsxs("div",{className:"text-right",children:[t.jsx("div",{className:"text-sm text-gray-500 mb-2",children:"Health Score"}),t.jsxs("div",{className:"text-2xl font-bold text-blue-600",children:[s.packageHealth?.packageOverallScore??"","%"]})]})]}),t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-4 mt-6 pt-6 border-t border-gray-200",children:[t.jsxs("div",{className:"flex items-center space-x-2",children:[t.jsx(_m,{className:"h-4 w-4 text-gray-400"}),t.jsxs("div",{children:[t.jsx("div",{className:"text-xs text-gray-500",children:"Last Updated"}),t.jsx("div",{className:"text-sm font-medium",children:Jo(s.lastUpdated)})]})]}),t.jsxs("div",{className:"hidden flex items-center space-x-2",children:[t.jsx(lx,{className:"h-4 w-4 text-gray-400"}),t.jsxs("div",{children:[t.jsx("div",{className:"text-xs text-gray-500",children:"Maintainers"}),t.jsx("div",{className:"text-sm font-medium",children:s.maintainers.length})]})]}),t.jsxs("div",{className:"flex items-center space-x-2",children:[t.jsx(Ko,{className:"h-4 w-4 text-gray-400"}),t.jsxs("div",{children:[t.jsx("div",{className:"text-xs text-gray-500",children:"License"}),t.jsx("div",{className:"text-sm font-medium",children:s.license})]})]}),t.jsxs("div",{className:"flex items-center space-x-2",children:[t.jsx("div",{className:"h-4 w-4 text-gray-400",children:t.jsx(Aa,{className:"h-4 w-4 text-gray-400"})}),t.jsxs("div",{children:[t.jsx("div",{className:"text-xs text-gray-500",children:"Repository"}),t.jsx("div",{className:"text-sm font-medium truncate",children:t.jsx("a",{href:s.repository.url||"",target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:text-blue-500",children:s.repository?.url?.split("/").pop()})})]})]})]}),s.tags?.length>0&&t.jsxs("div",{className:"mt-4",children:[t.jsx("div",{className:"text-xs text-gray-500 mb-2",children:"Tags"}),t.jsx("div",{className:"flex flex-wrap gap-2",children:s.tags.map(i=>t.jsx("span",{className:"inline-flex px-2 py-1 text-xs bg-gray-100 text-gray-700 rounded-full",children:i},i))})]})]})]})}function dp({activeTab:s,onTabChange:l}){const i=[{id:"overview",label:"Overview",icon:Lt},{id:"dependencies",label:"Dependencies",icon:Qo},{id:"commits",label:"Recent Commits",icon:We},{id:"health",label:"Health Metrics",icon:Go},{id:"config",label:"Configuration",icon:Cr}];return t.jsx("div",{className:"border-b border-gray-200",children:t.jsx("nav",{className:"flex space-x-8",children:i.map(o=>{const u=o.icon;return t.jsxs("button",{onClick:()=>l(o.id),className:`py-4 px-1 border-b-2 font-medium text-sm flex items-center space-x-2 ${s===o.id?"border-blue-500 text-blue-600":"border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300"}`,children:[t.jsx(u,{className:"w-4 h-4"}),t.jsx("span",{children:o.label})]},o.id)})})})}function mp({packageData:s}){if(!s.dependenciesInfo.length)return t.jsx("p",{className:"py-6 text-gray-600",children:"No dependency found."});const l=(i,o)=>t.jsxs("div",{className:"mb-8",children:[t.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-4",children:o}),t.jsx("div",{className:"bg-white border rounded-lg overflow-hidden",children:t.jsxs("table",{className:"w-full",children:[t.jsx("thead",{className:"bg-gray-50",children:t.jsxs("tr",{children:[t.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Package"}),t.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Current"}),t.jsx("th",{className:"hidden px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Latest"}),t.jsx("th",{className:"hidden px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Status"}),t.jsx("th",{className:"hidden px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Actions"})]})}),t.jsx("tbody",{className:"bg-white divide-y divide-gray-200",children:i.map(u=>t.jsxs("tr",{className:"hover:bg-gray-50",children:[t.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:t.jsx("div",{className:"text-sm font-medium text-gray-900",children:u.name})}),t.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:t.jsx("span",{className:"text-sm font-mono text-gray-700",children:u.version})}),t.jsx("td",{className:"hidden px-6 py-4 whitespace-nowrap",children:t.jsx("span",{className:"text-sm font-mono text-gray-700",children:u.latest})}),t.jsx("td",{className:"hidden px-6 py-4 whitespace-nowrap",children:t.jsx("span",{className:`inline-flex px-2 py-1 text-xs font-semibold rounded-full ${ip(u.status)}`,children:u.status.replace("-"," ")})}),t.jsx("td",{className:"hidden px-6 py-4 whitespace-nowrap text-sm",children:u.status!=="up-to-date"&&t.jsxs("button",{className:"text-blue-600 hover:text-blue-500 flex items-center space-x-1",children:[t.jsx(Wo,{className:"w-4 h-4"}),t.jsx("span",{children:"Update"})]})})]},u.name))})]})})]});return t.jsxs("div",{className:"py-6",children:[l(s.dependenciesInfo.filter(i=>i.type=="dependency"),"Dependencies"),l(s.dependenciesInfo.filter(i=>i.type=="devDependency"),"Dev Dependencies"),l(s.dependenciesInfo.filter(i=>i.type=="peerDependency"),"Peer Dependencies"),t.jsxs("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-4",children:[t.jsx("h4",{className:"font-medium text-blue-900 mb-2",children:"Dependency Summary"}),t.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4 text-sm",children:[t.jsxs("div",{children:[t.jsx("span",{className:"font-medium text-blue-800",children:"Total Dependencies:"}),t.jsx("span",{className:"ml-2 text-blue-700",children:s.dependenciesInfo.filter(i=>i.type=="dependency").length})]}),t.jsxs("div",{children:[t.jsx("span",{className:"font-medium text-blue-800",children:"Dev Dependencies:"}),t.jsx("span",{className:"ml-2 text-blue-700",children:s.dependenciesInfo.filter(i=>i.type=="devDependency").length})]}),t.jsxs("div",{children:[t.jsx("span",{className:"font-medium text-blue-800",children:"Peer Dependencies:"}),t.jsx("span",{className:"ml-2 text-blue-700",children:s.dependenciesInfo.filter(i=>i.type=="peerDependency").length})]}),t.jsxs("div",{children:[t.jsx("span",{className:"font-medium text-blue-800",children:"Outdated:"}),t.jsx("span",{className:"ml-2 text-blue-700",children:s.dependenciesInfo.filter(i=>i.status==="outdated").length})]}),t.jsxs("div",{children:[t.jsx("span",{className:"font-medium text-blue-800",children:"Major Updates:"}),t.jsx("span",{className:"ml-2 text-blue-700",children:s.dependenciesInfo.filter(i=>i.status==="major-update").length})]})]})]})]})}function hp({packageData:s}){return t.jsxs("div",{className:"py-6",children:[t.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-4",children:"Recent Commits"}),t.jsx("div",{className:"space-y-4",children:s.commits.map(l=>t.jsx("div",{className:"bg-white border rounded-lg p-4 hover:shadow-md transition-shadow",children:t.jsxs("div",{className:"flex items-start justify-between",children:[t.jsxs("div",{className:"flex-1",children:[t.jsxs("div",{className:"flex items-center space-x-3 mb-2",children:[t.jsx("span",{className:`inline-flex px-2 py-1 text-xs font-semibold rounded-full ${op(l.type)}`,children:l.type}),t.jsx("span",{className:"text-sm font-mono text-gray-500",children:l.hash})]}),t.jsx("p",{className:"text-sm font-medium text-gray-900 mb-2",children:l.message}),t.jsxs("div",{className:"flex items-center space-x-4 text-sm text-gray-500",children:[t.jsxs("span",{children:["by ",l.author]}),t.jsx("span",{children:Jo(l.date)})]})]}),t.jsx("div",{className:"hidden ml-4",children:t.jsx("button",{className:"text-blue-600 hover:text-blue-500 text-sm",children:"View Diff"})})]})},l.hash))}),s.commits.length===0&&t.jsxs("div",{className:"text-center py-8",children:[t.jsx("div",{className:"text-gray-400 text-4xl mb-2",children:"📝"}),t.jsx("p",{className:"text-gray-500",children:"No recent commits found"})]}),t.jsxs("div",{className:"mt-6 bg-gray-50 border border-gray-200 rounded-lg p-4",children:[t.jsx("h4",{className:"font-medium text-gray-900 mb-2",children:"Commit Summary"}),t.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4 text-sm",children:[t.jsxs("div",{children:[t.jsx("span",{className:"font-medium text-gray-800",children:"Features:"}),t.jsx("span",{className:"ml-2 text-gray-600",children:s.commits.filter(l=>l.type==="feat").length})]}),t.jsxs("div",{children:[t.jsx("span",{className:"font-medium text-gray-800",children:"Fixes:"}),t.jsx("span",{className:"ml-2 text-gray-600",children:s.commits.filter(l=>l.type==="fix").length})]}),t.jsxs("div",{children:[t.jsx("span",{className:"font-medium text-gray-800",children:"Chores:"}),t.jsx("span",{className:"ml-2 text-gray-600",children:s.commits.filter(l=>l.type==="chore").length})]}),t.jsxs("div",{children:[t.jsx("span",{className:"font-medium text-gray-800",children:"Breaking:"}),t.jsx("span",{className:"ml-2 text-gray-600",children:s.commits.filter(l=>l.type==="breaking").length})]})]})]})]})}function fp({packageData:s}){const l=m=>m>=80?"text-green-600":m>=60?"text-yellow-600":"text-red-600",i=m=>{switch(m){case"success":return t.jsx(Pt,{className:"w-5 h-5 text-green-500"});case"failed":return t.jsx(Bt,{className:"w-5 h-5 text-red-500"});case"running":return t.jsx("div",{className:"w-5 h-5 border-2 border-blue-500 border-t-transparent rounded-full animate-spin"});default:return t.jsx(Je,{className:"w-5 h-5 text-gray-500"})}},o=m=>{switch(m){case"success":return"bg-green-100 text-green-800";case"failed":return"bg-red-100 text-red-800";case"running":return"bg-blue-100 text-blue-800";default:return"bg-gray-100 text-gray-800"}},u=m=>{switch(m){case"pass":return"bg-green-100 text-green-800";case"fail":return"bg-red-100 text-red-800";case"warning":return"bg-yellow-100 text-yellow-800";default:return"bg-gray-100 text-gray-800"}};return s.packageHealth?.packageOverallScore?t.jsxs("div",{className:"py-6",children:[t.jsxs("div",{className:"bg-white border rounded-lg p-6 mb-6",children:[t.jsxs("div",{className:"flex items-center justify-between mb-4",children:[t.jsx("h3",{className:"text-lg font-medium text-gray-900",children:"Health Score"}),t.jsxs("div",{className:`text-3xl font-bold ${l(s.packageHealth.packageOverallScore)}`,children:[s.packageHealth.packageOverallScore,"%"]})]}),t.jsx("div",{className:"w-full bg-gray-200 rounded-full h-3 mb-4",children:t.jsx("div",{className:`h-3 rounded-full transition-all duration-300 ${s.packageHealth.packageOverallScore>=80?"bg-green-500":s.packageHealth.packageOverallScore>=60?"bg-yellow-500":"bg-red-500"}`,style:{width:`${s.packageHealth.packageOverallScore}%`}})}),t.jsxs("p",{className:"text-sm text-gray-600",children:[s.packageHealth.packageOverallScore>=80&&"Excellent health - package is in great condition",s.packageHealth.packageOverallScore>=60&&s.packageHealth.packageOverallScore<80&&"Good health - minor issues detected",s.packageHealth.packageOverallScore<60&&"Needs attention - several issues require fixing"]})]}),t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6 mb-6",children:[t.jsxs("div",{className:"bg-white border rounded-lg p-6",children:[t.jsxs("div",{className:"flex items-center justify-between mb-4",children:[t.jsx("h4",{className:"text-sm font-medium text-gray-900",children:"Build Status"}),i(s.packageHealth.packageBuildStatus)]}),t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("span",{className:`inline-flex px-2 py-1 text-xs font-semibold rounded-full ${o(s.packageHealth.packageBuildStatus)}`,children:s.packageHealth.packageBuildStatus}),t.jsx("button",{className:"hidden text-blue-600 hover:text-blue-500 text-sm",children:"View Logs"})]})]}),t.jsxs("div",{className:"hidden bg-white border rounded-lg p-6",children:[t.jsxs("div",{className:"flex items-center justify-between mb-4",children:[t.jsx("h4",{className:"text-sm font-medium text-gray-900",children:"Test Coverage"}),t.jsxs("div",{className:`text-lg font-semibold ${s.packageHealth.packageTestCoverage>=80?"text-green-600":s.packageHealth.packageTestCoverage>=60?"text-yellow-600":"text-red-600"}`,children:[s.packageHealth.packageTestCoverage,"%"]})]}),t.jsx("div",{className:"w-full bg-gray-200 rounded-full h-2",children:t.jsx("div",{className:`h-2 rounded-full ${s.packageHealth.packageTestCoverage>=80?"bg-green-500":s.packageHealth.packageTestCoverage>=60?"bg-yellow-500":"bg-red-500"}`,style:{width:`${s.packageHealth.packageTestCoverage}%`}})})]}),t.jsxs("div",{className:"bg-white border rounded-lg p-6",children:[t.jsxs("div",{className:"flex items-center justify-between mb-4",children:[t.jsx("h4",{className:"text-sm font-medium text-gray-900",children:"Lint Status"}),s.packageHealth.packageLintStatus==="pass"&&t.jsx(Pt,{className:"w-5 h-5 text-green-500"}),s.packageHealth.packageLintStatus==="fail"&&t.jsx(Bt,{className:"w-5 h-5 text-red-500"}),s.packageHealth.packageLintStatus==="warning"&&t.jsx(Je,{className:"w-5 h-5 text-yellow-500"})]}),t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("span",{className:`inline-flex px-2 py-1 text-xs font-semibold rounded-full ${u(s.packageHealth.packageLintStatus)}`,children:s.packageHealth.packageLintStatus}),t.jsx("button",{className:"hidden text-blue-600 hover:text-blue-500 text-sm",children:"View Issues"})]})]})]}),t.jsxs("div",{className:"bg-white border rounded-lg p-6",children:[t.jsx("h4",{className:"text-lg font-medium text-gray-900 mb-4",children:"Detailed Metrics"}),t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[t.jsxs("div",{children:[t.jsx("h5",{className:"text-sm font-medium text-gray-700 mb-3",children:"Dependencies"}),t.jsxs("div",{className:"space-y-2 text-sm",children:[t.jsxs("div",{className:"flex justify-between",children:[t.jsx("span",{className:"text-gray-600",children:"Total Dependencies:"}),t.jsx("span",{className:"font-medium",children:Object.keys(s.dependenciesInfo).length})]}),t.jsxs("div",{className:"flex justify-between",children:[t.jsx("span",{className:"text-gray-600",children:"Outdated:"}),t.jsx("span",{className:"font-medium text-yellow-600",children:s.dependenciesInfo.filter(m=>m.status==="outdated").length})]}),t.jsxs("div",{className:"flex justify-between",children:[t.jsx("span",{className:"text-gray-600",children:"Major Updates Available:"}),t.jsx("span",{className:"font-medium text-red-600",children:s.dependenciesInfo.filter(m=>m.status==="major-update").length})]})]})]}),t.jsxs("div",{children:[t.jsx("h5",{className:"text-sm font-medium text-gray-700 mb-3",children:"Code Quality"}),t.jsxs("div",{className:"space-y-2 text-sm",children:[t.jsxs("div",{className:"flex justify-between",children:[t.jsx("span",{className:"text-gray-600",children:"Build Status:"}),t.jsx("span",{className:`font-medium ${s.packageHealth.packageBuildStatus==="success"?"text-green-600":s.packageHealth.packageBuildStatus==="failed"?"text-red-600":"text-yellow-600"}`,children:s.packageHealth.packageBuildStatus})]}),t.jsxs("div",{className:"hidden flex justify-between",children:[t.jsx("span",{className:"text-gray-600",children:"Test Coverage:"}),t.jsxs("span",{className:"font-medium",children:[s.packageHealth.packageTestCoverage,"%"]})]}),t.jsxs("div",{className:"flex justify-between",children:[t.jsx("span",{className:"text-gray-600",children:"Lint Status:"}),t.jsx("span",{className:`font-medium ${s.packageHealth.packageLintStatus==="pass"?"text-green-600":s.packageHealth.packageLintStatus==="fail"?"text-red-600":"text-yellow-600"}`,children:s.packageHealth.packageLintStatus})]})]})]})]})]})]}):t.jsx("p",{className:"py-6 text-gray-600",children:"No health data available."})}function xp({packageData:s}){const[l,i]=v.useState(!1),[o,u]=v.useState(""),[m,h]=v.useState(!1),[p,x]=v.useState(""),[y,k]=v.useState(null),[j,E]=v.useState(!1),I=()=>{const R={name:s.name,version:s.version,description:s.description||"",license:s.license||"",repository:s.repository||{},scripts:s.scripts||{},dependencies:s.dependencies||{},devDependencies:s.devDependencies||{},peerDependencies:s.peerDependencies||{}};return JSON.stringify(R,null,2)};v.useState(()=>{u(I())});const L=()=>{i(!0),u(I()),x("")},A=()=>{i(!1),u(I()),x("")},P=async()=>{if(!o.trim()){x("Configuration cannot be empty");return}h(!0),x("");try{const R=await _t.updatePackageConfiguration(s.name,o,s.path);if(R.success)x("Configuration updated successfully!"),i(!1);else throw new Error(R.message||"Update failed")}catch(R){console.error("Error saving configuration:",R),x(R instanceof Error?R.message:"Failed to save configuration. Please try again.")}finally{h(!1)}},O=R=>{u(R.target.value),p&&x("")},M=async(R,$,J)=>{try{await navigator.clipboard.writeText(R),$==="config"?(E(!0),setTimeout(()=>E(!1),4e3)):$==="script"&&J&&(k(J),setTimeout(()=>k(null),4e3))}catch(ve){console.error("Failed to copy to clipboard:",ve);const ee=document.createElement("textarea");ee.value=R,document.body.appendChild(ee),ee.select();try{document.execCommand("copy"),$==="config"?(E(!0),setTimeout(()=>E(!1),2e3)):$==="script"&&J&&(k(J),setTimeout(()=>k(null),2e3))}catch(pe){console.error("Fallback copy failed:",pe),$==="config"&&x("Failed to copy to clipboard")}document.body.removeChild(ee)}};return t.jsxs("div",{className:"py-6",children:[t.jsxs("div",{className:"bg-white border rounded-lg p-6 mb-6",children:[t.jsxs("div",{className:"flex items-center space-x-2 mb-4",children:[t.jsx(Qo,{className:"w-5 h-5 text-gray-600"}),t.jsx("h3",{className:"text-lg font-medium text-gray-900",children:"Package Scripts"})]}),t.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:Object.entries(s.scripts).map(([R,$])=>t.jsxs("div",{className:"border border-gray-200 rounded-lg p-4",children:[t.jsxs("div",{className:"flex items-center justify-between mb-2",children:[t.jsx("h4",{className:"text-sm font-medium text-gray-900",children:R}),t.jsxs("div",{className:"flex items-center space-x-2",children:[t.jsx("button",{onClick:()=>M($,"script",R),className:`text-sm flex items-center space-x-1 ${y===R?"text-green-600":"text-gray-600 hover:text-gray-700"}`,title:"Copy command to clipboard",children:y===R?t.jsxs(t.Fragment,{children:[t.jsx(Vd,{className:"w-4 h-4"}),t.jsx("span",{children:"Copied!"})]}):t.jsxs(t.Fragment,{children:[t.jsx(Hd,{className:"w-4 h-4"}),t.jsx("span",{children:"Copy"})]})}),t.jsx("button",{className:"hidden text-blue-600 hover:text-blue-500 text-sm",children:"Run"})]})]}),t.jsx("code",{className:"text-xs text-gray-600 bg-gray-100 p-2 rounded block overflow-x-auto",children:$})]},R))}),Object.keys(s.scripts).length===0&&t.jsxs("div",{className:"text-center py-8",children:[t.jsx("div",{className:"text-gray-400 text-4xl mb-2",children:"📝"}),t.jsx("p",{className:"text-gray-500",children:"No scripts configured"})]})]}),t.jsxs("div",{className:"bg-white border rounded-lg p-6",children:[t.jsxs("div",{className:"flex items-center justify-between mb-4",children:[t.jsx("h3",{className:"text-lg font-medium text-gray-900",children:"Package Configuration"}),!l&&t.jsx("div",{className:"text-sm text-gray-500",children:"Read-only preview"})]}),l?t.jsxs("div",{className:"space-y-4",children:[t.jsx("div",{className:"bg-gray-900 text-gray-100 p-4 rounded-lg",children:t.jsx("textarea",{value:o,onChange:O,className:"w-full h-96 bg-gray-900 text-gray-100 text-sm font-mono resize-none focus:outline-none focus:ring-2 focus:ring-blue-500 rounded",spellCheck:"false"})}),p&&t.jsx("div",{className:`p-3 rounded-lg text-sm ${p.includes("successfully")?"bg-green-50 text-green-700 border border-green-200":"bg-red-50 text-red-700 border border-red-200"}`,children:p}),t.jsxs("div",{className:"flex space-x-3",children:[t.jsx("button",{onClick:P,disabled:m,className:"bg-blue-600 text-white px-4 py-2 rounded-lg hover:bg-blue-700 disabled:bg-blue-300 disabled:cursor-not-allowed text-sm flex items-center space-x-2",children:m?t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"w-4 h-4 border-2 border-white border-t-transparent rounded-full animate-spin"}),t.jsx("span",{children:"Saving..."})]}):t.jsx("span",{children:"Save Changes"})}),t.jsx("button",{onClick:A,disabled:m,className:"border border-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed text-sm",children:"Cancel"})]})]}):t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"bg-gray-900 text-gray-100 p-4 rounded-lg overflow-x-auto",children:t.jsx("pre",{className:"text-sm",children:o})}),t.jsxs("div",{className:"mt-4 flex space-x-3",children:[t.jsx("button",{onClick:L,className:"bg-blue-600 text-white px-4 py-2 rounded-lg hover:bg-blue-700 text-sm",children:"Edit Configuration"}),t.jsx("button",{onClick:()=>M(l?o:I(),"config"),className:"border border-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-50 text-sm flex items-center space-x-2",children:j?t.jsxs(t.Fragment,{children:[t.jsx(Vd,{className:"w-4 h-4 text-green-600"}),t.jsx("span",{children:"Copied!"})]}):t.jsxs(t.Fragment,{children:[t.jsx(Hd,{className:"w-4 h-4"}),t.jsx("span",{children:"Copy"})]})})]})]})]})]})}const Kd={title:"Monorepo Dashboard",description:"Visual management and monitoring of your monorepo packages",packageTypes:["app","lib","tool"],features:{healthChecks:!0,ciIntegration:!0,dependencyGraph:!0,publishControl:!0,searchAndFilter:!0,configurationInspector:!0},branding:{primaryColor:"#3B82F6",secondaryColor:"#1E40AF"}};function pp(){const[s,l]=v.useState(),[i,o]=v.useState(""),[u,m]=v.useState("all"),[h,p]=v.useState(Kd),[x,y]=v.useState(!1),[k,j]=v.useState(!1),[E,I]=v.useState(!0),[L,A]=v.useState(null),[P,O]=v.useState(!1);v.useEffect(()=>{(async()=>{try{I(!0);const pe=await _t.getPackages();l(pe),A(null)}catch(pe){A("Failed to fetch packages"),console.error("Error fetching packages:",pe)}finally{I(!1)}})()},[]),v.useEffect(()=>{const ee=localStorage.getItem("monodog-config");ee&&p({...Kd,...JSON.parse(ee)})},[]);const M=ee=>{p(ee),localStorage.setItem("monodog-config",JSON.stringify(ee))},R=async()=>{try{O(!0),A(null),I(!0);try{const ee=await _t.refreshPackages();l(ee),A(null)}catch(ee){A("Failed to fetch package data"),console.error("Error fetching package data:",ee)}finally{I(!1)}}catch(ee){A("Failed to refresh package data"),console.error("Error refreshing package data:",ee)}finally{O(!1)}};if(E&&!s)return t.jsx(Zo,{});if(L)return t.jsx(Rm,{error:L,onRetry:R});const $=Zx(s??[],i,u),J=Xx(s??[]),ve=Kx(s??[]);return t.jsxs("div",{className:"p-6 space-y-6",children:[P&&s&&t.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-70 flex items-center justify-center z-50",children:t.jsxs("div",{className:"bg-white p-6 rounded-lg shadow-lg text-center",children:[t.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-blue-600 mx-auto"}),t.jsx("p",{className:"mt-4 text-gray-700",children:"Refreshing packages..."})]})}),t.jsx(Ux,{config:h,onShowSetupGuide:()=>j(!0),onShowConfig:()=>y(!0),onRefresh:R}),t.jsx(Hx,{stats:ve}),t.jsx(Vx,{}),t.jsxs("div",{className:"bg-white p-6 rounded-lg shadow border",children:[t.jsx(Wx,{searchTerm:i,selectedType:u,packageTypes:J,onSearchChange:o,onTypeChange:m}),t.jsx(Gx,{packages:$,getTypeIcon:qx,getStatusColor:Jx})]}),t.jsx(_x,{isOpen:x,onClose:()=>y(!1),onSave:M,currentConfig:h}),t.jsx(Bx,{isOpen:k,onClose:()=>j(!1),onComplete:()=>j(!1)})]})}function gp(){const[s,l]=v.useState([]),[i,o]=v.useState(!0),[u,m]=v.useState(null),[h,p]=v.useState({search:"",type:"all",status:"all"}),[x,y]=v.useState({field:"name",order:"asc"});v.useEffect(()=>{(async()=>{try{o(!0);const O=await _t.getPackages();l(O),m(null)}catch(O){m("Failed to fetch packages"),console.error("Error fetching packages:",O)}finally{o(!1)}})()},[]);const k=()=>{window.location.reload()},j=lp(s,h),E=ap(j,x),I=np(s),L=rp(s),A=sp(s);return i?t.jsx(Zo,{}):u?t.jsx(Rm,{error:u,onRetry:k}):t.jsxs("div",{className:"space-y-6",children:[t.jsx("div",{className:"flex items-center justify-between",children:t.jsxs("div",{children:[t.jsx("h1",{className:"text-heading text-2xl",children:"Packages Overview"}),t.jsx("p",{className:"text-body mt-1",children:"Manage and monitor all packages in your monorepo"})]})}),t.jsx(ep,{stats:I}),t.jsx(tp,{filters:h,onFiltersChange:p,availableTypes:L,availableStatuses:A}),t.jsxs("div",{className:"flex items-center justify-between text-sm text-gray-600",children:[t.jsxs("span",{children:["Showing ",E.length," of ",s.length," packages",h.search&&` matching "${h.search}"`]}),t.jsxs("span",{children:[h.type!=="all"&&`Filtered by type: ${h.type}`,h.status!=="all"&&` • status: ${h.status}`]})]}),t.jsx(cp,{packages:E,sorting:x,onSortChange:y}),E.length===0&&!i&&t.jsxs("div",{className:"text-center py-12",children:[t.jsx("div",{className:"text-neutral-400 text-6xl mb-4 flex justify-center",children:t.jsx(Lt,{className:"w-6 h-6 text-primary-600"})}),t.jsx("h3",{className:"text-heading text-lg mb-2",children:"No packages found"}),t.jsx("p",{className:"text-body mb-4",children:h.search||h.type!=="all"||h.status!=="all"?"Try adjusting your filters to see more results.":"Get started by adding your first package to the monorepo."}),(h.search||h.type!=="all"||h.status!=="all")&&t.jsx("button",{onClick:()=>p({search:"",type:"all",status:"all"}),className:"text-primary-600 hover:text-primary-500",children:"Clear Filters"})]})]})}function yp(){const{name:s}=Ef(),[l,i]=v.useState(null),[o,u]=v.useState("overview");if(v.useEffect(()=>{(async()=>{try{const p=await _t.getPackage(s??"");i(p)}catch(p){console.error("Error fetching packages:",p)}})()},[s]),!l)return t.jsx(Zo,{message:"Loading package details..."});const m=()=>{switch(o){case"overview":return t.jsx("div",{className:"py-6",children:t.jsxs("div",{className:"bg-white border rounded-lg p-6",children:[t.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-4",children:"Package Overview"}),t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[t.jsxs("div",{children:[t.jsx("h4",{className:"text-sm font-medium text-gray-700 mb-2",children:"Description"}),t.jsx("p",{className:"text-gray-600 mb-4",children:l.description}),t.jsx("h4",{className:"hidden text-sm font-medium text-gray-700 mb-2",children:"Maintainers"}),t.jsx("div",{className:"space-y-1",children:Object.keys(l.maintainers).map(h=>t.jsx("div",{className:"text-sm text-gray-600",children:h},h))})]}),t.jsxs("div",{children:[t.jsx("h4",{className:"text-sm font-medium text-gray-700 mb-2",children:"Quick Stats"}),t.jsxs("div",{className:"space-y-2 text-sm",children:[t.jsxs("div",{className:"flex justify-between",children:[t.jsx("span",{className:"text-gray-600",children:"Dependencies:"}),t.jsx("span",{className:"font-medium",children:l.dependenciesInfo.filter(h=>h.type=="dependency").length})]}),t.jsxs("div",{className:"flex justify-between",children:[t.jsx("span",{className:"text-gray-600",children:"Dev Dependencies:"}),t.jsx("span",{className:"font-medium",children:l.dependenciesInfo.filter(h=>h.type=="devDependency").length})]}),t.jsxs("div",{className:"flex justify-between",children:[t.jsx("span",{className:"text-gray-600",children:"Peer Dependencies:"}),t.jsx("span",{className:"font-medium",children:l.dependenciesInfo.filter(h=>h.type=="peerDependency").length})]}),t.jsxs("div",{className:"flex justify-between",children:[t.jsx("span",{className:"text-gray-600",children:"Scripts:"}),t.jsx("span",{className:"font-medium",children:Object.keys(l.scripts).length})]}),t.jsxs("div",{className:"flex justify-between",children:[t.jsx("span",{className:"text-gray-600",children:"Recent Commits:"}),t.jsx("span",{className:"font-medium",children:l.commits?.length})]})]})]})]})]})});case"dependencies":return t.jsx(mp,{packageData:l});case"commits":return t.jsx(hp,{packageData:l});case"health":return t.jsx(fp,{packageData:l});case"config":return t.jsx(xp,{packageData:l});default:return null}};return t.jsxs("div",{className:"space-y-6",children:[t.jsx(up,{packageData:l}),t.jsxs("div",{className:"bg-white rounded-lg shadow border",children:[t.jsx(dp,{activeTab:o,onTabChange:u}),t.jsx("div",{className:"px-6",children:m()})]})]})}function vp({message:s="Loading dependency graph..."}){return t.jsx("div",{className:"flex items-center justify-center h-64",children:t.jsxs("div",{className:"text-center",children:[t.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-blue-600 mx-auto"}),t.jsx("p",{className:"mt-4 text-gray-600",children:s})]})})}function jp({error:s,onRetry:l}){return t.jsx("div",{className:"flex items-center justify-center h-64",children:t.jsxs("div",{className:"text-center",children:[t.jsx(Je,{className:"w-12 h-12 text-red-500 mx-auto"}),t.jsx("p",{className:"mt-4 text-red-600",children:s}),l&&t.jsx("button",{onClick:l,className:"mt-4 bg-blue-600 text-white px-4 py-2 rounded-lg hover:bg-blue-700 transition-colors",children:"Retry"})]})})}function wp({onRefresh:s,loading:l=!1}){return t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{children:[t.jsx("h1",{className:"text-2xl font-bold text-gray-900",children:"Dependency Graph"}),t.jsx("p",{className:"text-gray-600 mt-1",children:"Visualize package dependencies and relationships"})]}),s&&t.jsxs("button",{onClick:s,disabled:l,className:"hidden bg-blue-600 text-white px-4 py-2 rounded-lg hover:bg-blue-700 disabled:opacity-50 disabled:cursor-not-allowed flex items-center space-x-2 transition-colors",children:[t.jsx(sr,{className:`w-5 h-5 ${l?"animate-spin":""}`}),t.jsx("span",{children:"Refresh"})]})]})}function Np({viewMode:s,onViewModeChange:l,layout:i,onLayoutChange:o,showLegend:u,onToggleLegend:m,zoomLevel:h,onZoomChange:p}){return t.jsxs("div",{className:"bg-white p-4 rounded-lg shadow border flex items-center justify-between",children:[t.jsxs("div",{className:"flex items-center space-x-2",children:[t.jsx("span",{className:"text-sm font-medium text-gray-700",children:"View:"}),t.jsxs("div",{className:"flex rounded-lg border border-gray-300 overflow-hidden",children:[t.jsxs("button",{onClick:()=>l("graph"),className:`px-3 py-2 text-sm font-medium flex items-center space-x-1 ${s==="graph"?"bg-blue-600 text-white":"bg-white text-gray-700 hover:bg-gray-50"}`,children:[t.jsx(cx,{className:"w-4 h-4"}),t.jsx("span",{children:"Graph"})]}),t.jsxs("button",{onClick:()=>l("list"),className:`px-3 py-2 text-sm font-medium flex items-center space-x-1 ${s==="list"?"bg-blue-600 text-white":"bg-white text-gray-700 hover:bg-gray-50"}`,children:[t.jsx(ox,{className:"w-4 h-4"}),t.jsx("span",{children:"List"})]})]})]}),s==="graph"&&t.jsxs("div",{className:"flex items-center space-x-4",children:[t.jsxs("div",{className:"flex items-center space-x-2",children:[t.jsx("span",{className:"text-sm font-medium text-gray-700",children:"Layout:"}),t.jsxs("select",{value:i,onChange:x=>o(x.target.value),className:"border border-gray-300 rounded-md px-3 py-1 text-sm focus:ring-2 focus:ring-blue-500 focus:border-transparent",children:[t.jsx("option",{value:"hierarchical",children:"Hierarchical"}),t.jsx("option",{value:"circular",children:"Circular"}),t.jsx("option",{value:"force",children:"Force-Directed"})]})]}),t.jsxs("div",{className:"flex items-center space-x-2",children:[t.jsx("span",{className:"text-sm font-medium text-gray-700",children:"Zoom:"}),t.jsxs("div",{className:"flex items-center space-x-1",children:[t.jsx("button",{onClick:()=>p(Math.max(.5,h-.1)),className:"p-1 text-gray-600 hover:text-gray-800 disabled:opacity-50",disabled:h<=.5,children:t.jsx(hx,{className:"w-4 h-4"})}),t.jsxs("span",{className:"text-sm text-gray-600 min-w-[3rem] text-center",children:[Math.round(h*100),"%"]}),t.jsx("button",{onClick:()=>p(Math.min(2,h+.1)),className:"p-1 text-gray-600 hover:text-gray-800 disabled:opacity-50",disabled:h>=2,children:t.jsx(mx,{className:"w-4 h-4"})})]})]})]}),t.jsxs("button",{onClick:m,className:`px-3 py-2 text-sm font-medium rounded-lg flex items-center space-x-1 transition-colors ${u?"bg-blue-100 text-blue-700":"bg-gray-100 text-gray-700 hover:bg-gray-200"}`,children:[t.jsx(ss,{className:"w-4 h-4"}),t.jsx("span",{children:"Legend"})]})]})}const Fm=s=>{switch(s){case"healthy":return"text-green-600 bg-green-100";case"warning":return"text-yellow-600 bg-yellow-100";case"error":return"text-red-600 bg-red-100";default:return"text-gray-600 bg-gray-100"}},zm=s=>{switch(s){case"app":return"text-blue-600 bg-blue-100";case"lib":return"text-purple-600 bg-purple-100";case"tool":return"text-orange-600 bg-orange-100";default:return"text-gray-600 bg-gray-100"}},Xd=(s,l)=>{const i=l.find(o=>o.name===s);if(!i)return"text-gray-400";switch(i.status){case"healthy":return"text-green-500";case"warning":return"text-yellow-500";case"error":return"text-red-500";default:return"text-gray-400"}},bp=s=>{const l=s.length,i=s.reduce((x,y)=>x+Object.keys(y.dependencies).length,0),o=s.filter(x=>Object.keys(x.dependencies).length===0).length,u=s.filter(x=>x.dependents.length===0).length,m=Sp(s),h=l>0?i/l:0,p=$m(s);return{totalPackages:l,totalDependencies:i,circularDependencies:p.length,leafPackages:o,rootPackages:u,maxDepth:m,avgDependencies:Math.round(h*10)/10}},Sp=s=>{const l=new Set;let i=0;const o=(u,m)=>{if(l.has(u))return m;l.add(u);const h=s.find(x=>x.name===u);if(!h)return m;let p=m;for(const x of Object.keys(h.dependencies)){const y=o(x,m+1);p=Math.max(p,y)}return p};for(const u of s)if(!l.has(u.name)){const m=o(u.name,0);i=Math.max(i,m)}return i},$m=s=>{const l=[],i=new Set,o=new Set,u=[],m=h=>{if(o.has(h)){const x=u.indexOf(h),y=u.slice(x).concat(h);return l.push({cycle:y,severity:y.length>5?"high":y.length>3?"medium":"low",impact:`Circular dependency involving ${y.length} packages`}),!0}if(i.has(h))return!1;i.add(h),o.add(h),u.push(h);const p=s.find(x=>x.name===h);if(p){for(const x of Object.keys(p.dependencies))if(m(x))return!0}return o.delete(h),u.pop(),!1};for(const h of s)i.has(h.name)||m(h.name);return l},kp=(s,l,i)=>[...s].sort((o,u)=>{let m,h;switch(l){case"name":m=o.name.toLowerCase(),h=u.name.toLowerCase();break;case"dependencies":m=Object.keys(o.dependencies).length,h=Object.keys(u.dependencies).length;break;case"dependents":m=o.dependents.length,h=u.dependents.length;break;case"status":{const p={error:0,warning:1,healthy:2};m=p[o.status]||3,h=p[u.status]||3;break}default:return 0}return m<h?i==="asc"?-1:1:m>h?i==="asc"?1:-1:0}),Cp=(s,l,i=800,o=600)=>{switch(l){case"hierarchical":return Ep(s,i,o);case"circular":return Tp(s,i,o);case"force":return Pp(s,i,o);default:return s}},Ep=(s,l,i)=>{const o=[],u=new Set,m=(h,p)=>{if(u.has(h))return;u.add(h),o[p]||(o[p]=[]),o[p].push(h);const x=s.find(y=>y.name===h);x&&x.dependents.forEach(y=>m(y,p+1))};return s.filter(h=>Object.keys(h.dependencies).length===0&&h.dependents.length>0).forEach(h=>{m(h.name,0)}),o.length===0&&s.filter(h=>Object.keys(h.dependencies).length>0&&h.dependents.length>0).forEach(h=>{m(h.name,0)}),s.map(h=>{const p=o.findIndex(k=>k.includes(h.name)),x=o[p]?.indexOf(h.name)||0,y=o[p]?.length||1;return{...h,x:l/(o.length+1)*(p+1)-50,y:i/(y+1)*(x+1)-25}})},Tp=(s,l,i)=>{const o=l/2,u=i/2,m=Math.min(l,i)/3;return s.map((h,p)=>{const x=2*Math.PI*p/s.length;return{...h,x:o+m*Math.cos(x)-50,y:u+m*Math.sin(x)-25}})},Pp=(s,l,i)=>{const o=s.map((u,m)=>({...u,x:Math.random()*(l-100),y:Math.random()*(i-50)}));for(let u=0;u<50;u++)o.forEach(m=>{let h=0,p=0;o.forEach(x=>{if(x.name!==m.name){const y=m.x-x.x,k=m.y-x.y,j=Math.sqrt(y*y+k*k)||1,E=1e3/(j*j);h+=y/j*E,p+=k/j*E}}),Object.keys(m.dependencies).forEach(x=>{const y=o.find(k=>k.name===x);if(y){const k=y.x-m.x,j=y.y-m.y,E=Math.sqrt(k*k+j*j)||1,I=E*.01;h+=k/E*I,p+=j/E*I}}),m.x+=h*.1,m.y+=p*.1,m.x=Math.max(50,Math.min(l-100,m.x)),m.y=Math.max(25,Math.min(i-50,m.y))});return o},_p=s=>{switch(s){case"app":return t.jsx(Tn,{className:"w-6 h-6 text-primary-600"});case"lib":return t.jsx(La,{className:"w-6 h-6 text-primary-600"});case"tool":return"🔧";default:return t.jsx(Lt,{className:"w-6 h-6 text-primary-600"})}},Lp=s=>s.length>12?`${s.substring(0,12)}...`:s,Ap=s=>{const l={};return s.forEach(i=>{l[i.name]=[]}),s.forEach(i=>{const o=i.name;[...Object.keys(i.dependencies??{}),...Object.keys(i.devDependencies??{}),...Object.keys(i.peerDependencies??{})].forEach(m=>{l[m]||(l[m]=[]),l[m].includes(o)||l[m].push(o)})}),l};function Rp({packages:s,selectedPackage:l,hoveredPackage:i,onPackageSelect:o,onPackageHover:u,layout:m}){return t.jsxs("div",{className:"relative bg-white rounded-lg shadow-sm border border-gray-200 p-6 min-h-[600px]",children:[t.jsxs("svg",{className:"w-full h-full absolute inset-0",viewBox:"0 0 800 600",children:[s.map(h=>Object.keys(h.dependencies).map(p=>{const x=s.find(k=>k.name===p);if(!x)return null;const y=i===h.name||i===p||l===h.name||l===p;return t.jsxs("g",{children:[t.jsx("defs",{children:t.jsx("marker",{id:`arrow-${h.name}-${p}`,markerWidth:"10",markerHeight:"10",refX:"9",refY:"3",orient:"auto",markerUnits:"strokeWidth",children:t.jsx("path",{d:"M0,0 L0,6 L9,3 z",fill:y?"#3B82F6":"#6B7280"})})}),t.jsx("line",{x1:x.x+50,y1:x.y+25,x2:h.x,y2:h.y+25,stroke:y?"#3B82F6":"#6B7280",strokeWidth:y?"3":"2",markerEnd:`url(#arrow-${h.name}-${p})`,className:"transition-all duration-200",style:{opacity:y?1:.6}})]},`${h.name}-${p}`)})),s.map(h=>{const p=l===h.name,x=i===h.name,y=l&&(Object.keys(h.dependencies).includes(l)||Object.keys(h.dependents).includes(l));return t.jsxs("g",{children:[t.jsx("rect",{x:h.x,y:h.y,width:"100",height:"50",rx:"8",fill:"white",stroke:p?"#3B82F6":y?"#10B981":x?"#6B7280":"#E5E7EB",strokeWidth:p?"3":"2",className:"cursor-pointer transition-all duration-200",style:{filter:x||p||y?"drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1))":"none"},onMouseEnter:()=>u(h.name),onMouseLeave:()=>u(null),onClick:()=>o(p?null:h.name)}),t.jsx("text",{x:h.x+50,y:h.y+20,textAnchor:"middle",className:"text-xs font-medium fill-gray-900 pointer-events-none",children:Lp(h.name)}),t.jsxs("text",{x:h.x+50,y:h.y+35,textAnchor:"middle",className:"text-xs fill-gray-500 pointer-events-none",children:["v",h.version]}),t.jsx("circle",{cx:h.x+85,cy:h.y+15,r:"6",fill:h.status==="healthy"?"#10B981":h.status==="warning"?"#F59E0B":"#EF4444",className:"pointer-events-none"}),t.jsx("rect",{x:h.x+5,y:h.y+5,width:"12",height:"8",rx:"2",fill:h.type==="app"?"#3B82F6":h.type==="lib"?"#8B5CF6":"#F97316",className:"pointer-events-none"})]},h.name)})]}),s.length===0&&t.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:t.jsxs("div",{className:"text-center",children:[t.jsx("div",{className:"flex justify-center text-gray-400 text-6xl mb-4",children:t.jsx(Aa,{className:"w-6 h-6 text-primary-600"})}),t.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-2",children:"No dependencies found"}),t.jsx("p",{className:"text-gray-600",children:"No package dependencies to display."})]})})]})}function Mp({packages:s,selectedPackage:l,onPackageSelect:i,sortBy:o,sortOrder:u,onSortChange:m}){const h=x=>{m(x,o===x&&u==="asc"?"desc":"asc")},p=x=>o!==x?null:u==="asc"?t.jsx(Wo,{className:"w-4 h-4"}):t.jsx(Tm,{className:"w-4 h-4"});return t.jsxs("div",{className:"bg-white rounded-lg shadow-sm border border-gray-200",children:[t.jsxs("div",{className:"p-6 border-b border-gray-200",children:[t.jsx("h3",{className:"text-lg font-medium text-gray-900",children:"Package Dependencies"}),t.jsx("p",{className:"text-sm text-gray-600 mt-1",children:"Click on a view details to explore its dependencies, commits, configuration and health"})]}),t.jsx("div",{className:"overflow-x-auto",children:t.jsxs("table",{className:"min-w-full divide-y divide-gray-200",children:[t.jsx("thead",{className:"bg-gray-50",children:t.jsxs("tr",{children:[t.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider cursor-pointer hover:bg-gray-100",onClick:()=>h("name"),children:t.jsxs("div",{className:"flex items-center space-x-1",children:[t.jsx("span",{children:"Package"}),p("name")]})}),t.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Type"}),t.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Status"}),t.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider cursor-pointer hover:bg-gray-100",onClick:()=>h("dependencies"),children:t.jsxs("div",{className:"flex items-center space-x-1",children:[t.jsx("span",{children:"Dependencies"}),p("dependencies")]})}),t.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider cursor-pointer hover:bg-gray-100",onClick:()=>h("dependents"),children:t.jsxs("div",{className:"flex items-center space-x-1",children:[t.jsx("span",{children:"Dependents"}),p("dependents")]})}),t.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Actions"})]})}),t.jsx("tbody",{className:"bg-white divide-y divide-gray-200",children:s.map(x=>t.jsxs("tr",{className:`hover:bg-gray-50 cursor-pointer transition-colors ${l===x.name?"bg-blue-50":""}`,onClick:()=>i(x.name),children:[t.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:t.jsxs("div",{className:"flex items-center",children:[t.jsx("div",{className:"text-2xl mr-3",children:_p(x.type)}),t.jsxs("div",{children:[t.jsx("div",{className:"text-sm font-medium text-gray-900",children:x.name}),t.jsxs("div",{className:"text-sm text-gray-500",children:["v",x.version]})]})]})}),t.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:t.jsx("span",{className:`inline-flex px-2 py-1 text-xs font-semibold rounded-full ${zm(x.type)}`,children:x.type})}),t.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:t.jsx("span",{className:`inline-flex px-2 py-1 text-xs font-semibold rounded-full ${Fm(x.status)}`,children:x.status})}),t.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:t.jsxs("div",{className:"text-sm text-gray-900",children:[Object.keys(x.dependencies).length,Object.keys(x.dependencies).length>0&&t.jsxs("div",{className:"text-xs text-gray-500 mt-1",children:[Object.keys(x.dependencies).slice(0,3).join(", "),Object.keys(x.dependencies).length>3&&` +${Object.keys(x.dependencies).length-3} more`]})]})}),t.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:t.jsxs("div",{className:"text-sm text-gray-900",children:[x.dependents.length,x.dependents.length>0&&t.jsxs("div",{className:"text-xs text-gray-500 mt-1",children:[x.dependents.slice(0,3).join(", "),x.dependents.length>3&&` +${x.dependents.length-3} more`]})]})}),t.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm",children:t.jsx(Cn,{to:`/packages/${encodeURIComponent(x.name)}`,className:"text-blue-600 hover:text-blue-500",onClick:y=>y.stopPropagation(),children:"View Details"})})]},x.name))})]})}),s.length===0&&t.jsxs("div",{className:"text-center py-12",children:[t.jsx("div",{className:"text-gray-400 text-4xl mb-2 flex justify-center",children:t.jsx(Lt,{className:"w-6 h-6 text-primary-600"})}),t.jsx("p",{className:"text-gray-500",children:"No packages found"})]})]})}function Ip({package:s,packages:l,onClose:i}){return s?t.jsxs("div",{className:"absolute top-4 right-4 bg-white p-4 rounded-lg shadow-lg border border-gray-200 w-80 max-h-[80vh] overflow-y-auto",children:[t.jsxs("div",{className:"flex items-center justify-between mb-3",children:[t.jsx("h3",{className:"text-lg font-medium text-gray-900",children:s.name}),t.jsx("button",{onClick:i,className:"text-gray-400 hover:text-gray-600 transition-colors",children:t.jsx(al,{className:"w-5 h-5"})})]}),t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{children:[t.jsxs("div",{className:"flex items-center space-x-2 mb-2",children:[t.jsx("span",{className:`inline-flex px-2 py-1 text-xs font-semibold rounded-full ${zm(s.type)}`,children:s.type}),t.jsx("span",{className:`inline-flex px-2 py-1 text-xs font-semibold rounded-full ${Fm(s.status)}`,children:s.status})]}),t.jsxs("div",{className:"text-sm text-gray-600",children:["Version: ",t.jsx("span",{className:"font-mono",children:s.version})]})]}),t.jsxs("div",{children:[t.jsxs("div",{className:"flex items-center justify-between mb-2",children:[t.jsx("h4",{className:"text-sm font-medium text-gray-700",children:"Dependencies"}),t.jsxs("span",{className:"text-xs text-gray-500",children:["(",Object.keys(s.dependencies).length,")"]})]}),Object.keys(s.dependencies).length>0?t.jsx("div",{className:"space-y-1 max-h-32 overflow-y-auto",children:Object.keys(s.dependencies).map(o=>{const u=l.find(m=>m.name===o);return u?t.jsxs("div",{className:"flex items-center justify-between text-sm py-1",children:[t.jsx("span",{className:"text-gray-600 truncate",children:u.name}),t.jsxs("div",{className:"flex items-center space-x-1",children:[t.jsx("span",{className:"text-xs text-gray-400",children:u.version}),t.jsx("span",{className:`${Xd(o,l)}`,children:u.status==="healthy"?"✓":u.status==="warning"?"⚠":"✗"})]})]},o):t.jsxs("div",{className:"text-sm text-gray-400 py-1",children:[o," (not found)"]},o)})}):t.jsx("div",{className:"text-sm text-gray-500 text-center py-2",children:"No dependencies"})]}),t.jsxs("div",{children:[t.jsxs("div",{className:"flex items-center justify-between mb-2",children:[t.jsx("h4",{className:"text-sm font-medium text-gray-700",children:"Dependents"}),t.jsxs("span",{className:"text-xs text-gray-500",children:["(",s.dependents.length,")"]})]}),s.dependents.length>0?t.jsx("div",{className:"space-y-1 max-h-32 overflow-y-auto",children:s.dependents.map(o=>{const u=l.find(m=>m.name===o);return u?t.jsxs("div",{className:"flex items-center justify-between text-sm py-1",children:[t.jsx("span",{className:"text-gray-600 truncate",children:u.name}),t.jsxs("div",{className:"flex items-center space-x-1",children:[t.jsx("span",{className:"text-xs text-gray-400",children:u.version}),t.jsx("span",{className:`${Xd(o,l)}`,children:u.status==="healthy"?"✓":u.status==="warning"?"⚠":"✗"})]})]},o):t.jsxs("div",{className:"text-sm text-gray-400 py-1",children:[o," (not found)"]},o)})}):t.jsx("div",{className:"text-sm text-gray-500 text-center py-2",children:"No dependents"})]}),t.jsxs("div",{className:"pt-2 border-t border-gray-200",children:[t.jsx("h4",{className:"text-sm font-medium text-gray-700 mb-2",children:"Impact Analysis"}),t.jsxs("div",{className:"space-y-1 text-xs text-gray-600",children:[t.jsxs("div",{className:"flex justify-between",children:[t.jsx("span",{children:"Direct dependencies:"}),t.jsx("span",{className:"font-medium",children:Object.keys(s.dependencies).length})]}),t.jsxs("div",{className:"flex justify-between",children:[t.jsx("span",{children:"Direct dependents:"}),t.jsx("span",{className:"font-medium",children:s.dependents.length})]}),t.jsxs("div",{className:"flex justify-between",children:[t.jsx("span",{children:"Risk level:"}),t.jsx("span",{className:`font-medium ${s.dependents.length>5?"text-red-600":s.dependents.length>2?"text-yellow-600":"text-green-600"}`,children:s.dependents.length>5?"High":s.dependents.length>2?"Medium":"Low"})]})]})]}),t.jsx("div",{className:"pt-2 border-t border-gray-200",children:t.jsx(Cn,{to:`/packages/${encodeURIComponent(s.name)}`,className:"block w-full text-center bg-blue-600 text-white px-3 py-2 rounded-lg hover:bg-blue-700 text-sm font-medium transition-colors",children:"View Package Details →"})})]})]}):null}function Op({stats:s,packages:l}){return t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-4",children:[t.jsx("div",{className:"bg-gray-100 p-4 rounded-lg shadow border",children:t.jsxs("div",{className:"flex items-center",children:[t.jsx("div",{className:"p-2 rounded-lg",children:t.jsx(Lt,{className:"w-6 h-6 text-primary-600"})}),t.jsxs("div",{className:"ml-4",children:[t.jsx("p",{className:"text-sm font-medium text-gray-600",children:"Total Packages"}),t.jsx("p",{className:"text-2xl font-semibold text-gray-900",children:s.totalPackages})]})]})}),t.jsx("div",{className:"bg-blue-100 p-4 rounded-lg shadow border",children:t.jsxs("div",{className:"flex items-center",children:[t.jsx("div",{className:"p-2 rounded-lg",children:t.jsx(Aa,{className:"w-6 h-6 text-primary-600"})}),t.jsxs("div",{className:"ml-4",children:[t.jsx("p",{className:"text-sm font-medium text-gray-600",children:"Dependencies"}),t.jsx("p",{className:"text-2xl font-semibold text-gray-900",children:s.totalDependencies})]})]})}),t.jsx("div",{className:`${s.circularDependencies>0?"bg-red-100":"bg-green-100"} p-4 rounded-lg shadow border`,children:t.jsxs("div",{className:"flex items-center",children:[t.jsx("div",{className:`p-2 rounded-lg ${s.circularDependencies>0?"bg-red-100":"bg-green-100"}`,children:t.jsx(Je,{className:`w-6 h-6 ${s.circularDependencies>0?"text-red-600":"text-primary-600"}`})}),t.jsxs("div",{className:"ml-4",children:[t.jsx("p",{className:"text-sm font-medium text-gray-600",children:"Circular Deps"}),t.jsx("p",{className:`text-2xl font-semibold ${s.circularDependencies>0?"text-red-600":"text-gray-600"}`,children:s.circularDependencies})]})]})}),t.jsx("div",{className:"bg-purple-100 p-4 rounded-lg shadow border",children:t.jsxs("div",{className:"flex items-center",children:[t.jsx("div",{className:"p-2 bg-purple-100 rounded-lg",children:t.jsx(il,{className:"w-6 h-6 text-primary-600"})}),t.jsxs("div",{className:"ml-4",children:[t.jsx("p",{className:"text-sm font-medium text-gray-600",children:"Max Depth"}),t.jsx("p",{className:"text-2xl font-semibold text-gray-900",children:s.maxDepth})]})]})}),t.jsxs("div",{className:"md:col-span-4 bg-white p-4 rounded-lg shadow border",children:[t.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-4",children:"Dependency Analysis"}),t.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[t.jsxs("div",{className:"text-center bg-gray-100 p-2",children:[t.jsx("div",{className:"text-2xl font-bold text-blue-600",children:s.leafPackages}),t.jsx("div",{className:"text-sm text-gray-600",children:"Leaf Packages"}),t.jsx("div",{className:"text-xs text-gray-500",children:"No dependencies"})]}),t.jsxs("div",{className:"text-center bg-gray-100 p-2",children:[t.jsx("div",{className:"text-2xl font-bold text-green-600",children:s.rootPackages}),t.jsx("div",{className:"text-sm text-gray-600",children:"Root Packages"}),t.jsx("div",{className:"text-xs text-gray-500",children:"No dependents"})]}),t.jsxs("div",{className:"text-center bg-gray-100 p-2",children:[t.jsx("div",{className:"text-2xl font-bold text-purple-600",children:s.avgDependencies}),t.jsx("div",{className:"text-sm text-gray-600",children:"Avg Dependencies"}),t.jsx("div",{className:"text-xs text-gray-500",children:"Per package"})]}),t.jsxs("div",{className:"text-center bg-gray-100 p-2",children:[t.jsx("div",{className:"text-2xl font-bold text-orange-600",children:l.filter(i=>i.status==="healthy").length}),t.jsx("div",{className:"text-sm text-gray-600",children:"Healthy Packages"}),t.jsxs("div",{className:"text-xs text-gray-500",children:[Math.round(l.filter(i=>i.status==="healthy").length/l.length*100),"% of total"]})]})]})]})]})}function Dp({cycles:s,packages:l,onPackageSelect:i}){const o=m=>{switch(m){case"high":return"bg-red-100 text-red-800 border-red-200";case"medium":return"bg-yellow-100 text-yellow-800 border-yellow-200";case"low":return"bg-blue-100 text-blue-800 border-blue-200";default:return"bg-gray-100 text-gray-800 border-gray-200"}},u=m=>{switch(m){case"high":return"🔴";case"medium":return"🟡";case"low":return"🔵";default:return"⚪"}};return s.length===0?t.jsxs("div",{className:"bg-white p-6 rounded-lg shadow border",children:[t.jsxs("div",{className:"flex items-center space-x-3 mb-4",children:[t.jsx("div",{className:"p-2 bg-green-100 rounded-lg",children:t.jsx(Je,{className:"w-6 h-6 text-green-600"})}),t.jsxs("div",{children:[t.jsx("h3",{className:"text-lg font-medium text-gray-900",children:"Circular Dependencies"}),t.jsx("p",{className:"text-sm text-gray-600",children:"Dependency cycle analysis"})]})]}),t.jsxs("div",{className:"text-center py-8",children:[t.jsx("div",{className:"text-green-400 text-4xl mb-2"}),t.jsx("h4",{className:"text-green-800 font-medium mb-1",children:"No Circular Dependencies!"}),t.jsx("p",{className:"text-green-700 text-sm",children:"Your dependency graph is clean and free of circular references."})]})]}):t.jsxs("div",{className:"bg-white p-6 rounded-lg shadow border",children:[t.jsxs("div",{className:"flex items-center space-x-3 mb-4",children:[t.jsx("div",{className:"p-2 bg-red-100 rounded-lg",children:t.jsx(Je,{className:"w-6 h-6 text-red-600"})}),t.jsxs("div",{children:[t.jsx("h3",{className:"text-lg font-medium text-gray-900",children:"Circular Dependencies"}),t.jsxs("p",{className:"text-sm text-gray-600",children:["Found ",s.length," circular dependency cycle",s.length>1?"s":""]})]})]}),t.jsx("div",{className:"space-y-4",children:s.map((m,h)=>t.jsxs("div",{className:`border rounded-lg p-4 ${o(m.severity)}`,children:[t.jsxs("div",{className:"flex items-center justify-between mb-3",children:[t.jsxs("div",{className:"flex items-center space-x-2",children:[t.jsx("span",{className:"text-lg",children:u(m.severity)}),t.jsxs("span",{className:"text-sm font-medium capitalize",children:[m.severity," Severity"]})]}),t.jsxs("span",{className:"text-xs opacity-75",children:[m.cycle.length," packages affected"]})]}),t.jsx("div",{className:"mb-3",children:t.jsx("p",{className:"text-sm mb-2",children:m.impact})}),t.jsx("div",{className:"bg-white bg-opacity-50 rounded-lg p-3",children:t.jsxs("div",{className:"flex items-center flex-wrap gap-2",children:[m.cycle.map((p,x)=>t.jsxs(v.Fragment,{children:[t.jsx("button",{onClick:()=>i(p),className:"px-3 py-1 bg-white rounded-lg text-sm font-medium hover:bg-gray-50 transition-colors border shadow-sm",children:p}),x<m.cycle.length-1&&t.jsx(Ud,{className:"w-4 h-4 text-gray-400"})]},`${p}-${x}`)),m.cycle.length>1&&t.jsxs(t.Fragment,{children:[t.jsx(Ud,{className:"w-4 h-4 text-gray-400"}),t.jsxs("span",{className:"text-sm text-gray-500 italic",children:["(cycles back to ",m.cycle[0],")"]})]})]})}),t.jsxs("div",{className:"mt-3 pt-3 border-t border-current border-opacity-20",children:[t.jsx("h5",{className:"text-xs font-medium mb-1",children:"Recommendation:"}),t.jsxs("p",{className:"text-xs opacity-90",children:[m.severity==="high"&&"Critical: Refactor immediately to break this cycle. Consider dependency inversion or splitting packages.",m.severity==="medium"&&"Important: Plan to refactor this cycle. Review package boundaries and extract common dependencies.",m.severity==="low"&&"Minor: Monitor this cycle. Consider if these packages could be merged or dependencies restructured."]})]})]},h))}),t.jsx("div",{className:"mt-6 pt-4 border-t border-gray-200",children:t.jsxs("div",{className:"grid grid-cols-3 gap-4 text-center",children:[t.jsxs("div",{children:[t.jsx("div",{className:"text-lg font-bold text-red-600",children:s.filter(m=>m.severity==="high").length}),t.jsx("div",{className:"text-xs text-gray-600",children:"High Severity"})]}),t.jsxs("div",{children:[t.jsx("div",{className:"text-lg font-bold text-yellow-600",children:s.filter(m=>m.severity==="medium").length}),t.jsx("div",{className:"text-xs text-gray-600",children:"Medium Severity"})]}),t.jsxs("div",{children:[t.jsx("div",{className:"text-lg font-bold text-blue-600",children:s.filter(m=>m.severity==="low").length}),t.jsx("div",{className:"text-xs text-gray-600",children:"Low Severity"})]})]})})]})}function Fp({show:s}){return s?t.jsxs("div",{className:"bg-white p-4 rounded-lg shadow border",children:[t.jsx("h4",{className:"text-sm font-medium text-gray-900 mb-3",children:"Legend"}),t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{children:[t.jsx("h5",{className:"text-xs font-medium text-gray-700 mb-2",children:"Package Types"}),t.jsxs("div",{className:"grid grid-cols-3 gap-2 text-xs",children:[t.jsxs("div",{className:"flex items-center space-x-2",children:[t.jsx("div",{className:"w-3 h-2 bg-blue-500 rounded"}),t.jsx("span",{children:"App"})]}),t.jsxs("div",{className:"flex items-center space-x-2",children:[t.jsx("div",{className:"w-3 h-2 bg-purple-500 rounded"}),t.jsx("span",{children:"Library"})]}),t.jsxs("div",{className:"flex items-center space-x-2",children:[t.jsx("div",{className:"w-3 h-2 bg-orange-500 rounded"}),t.jsx("span",{children:"Tool"})]})]})]}),t.jsxs("div",{children:[t.jsx("h5",{className:"text-xs font-medium text-gray-700 mb-2",children:"Health Status"}),t.jsxs("div",{className:"grid grid-cols-3 gap-2 text-xs",children:[t.jsxs("div",{className:"flex items-center space-x-2",children:[t.jsx("div",{className:"w-3 h-3 bg-green-500 rounded-full"}),t.jsx("span",{children:"Healthy"})]}),t.jsxs("div",{className:"flex items-center space-x-2",children:[t.jsx("div",{className:"w-3 h-3 bg-yellow-500 rounded-full"}),t.jsx("span",{children:"Warning"})]}),t.jsxs("div",{className:"flex items-center space-x-2",children:[t.jsx("div",{className:"w-3 h-3 bg-red-500 rounded-full"}),t.jsx("span",{children:"Error"})]})]})]}),t.jsxs("div",{children:[t.jsx("h5",{className:"text-xs font-medium text-gray-700 mb-2",children:"Visual Elements"}),t.jsxs("div",{className:"space-y-1 text-xs",children:[t.jsxs("div",{className:"flex items-center space-x-2",children:[t.jsxs("svg",{width:"16",height:"8",children:[t.jsx("line",{x1:"0",y1:"4",x2:"16",y2:"4",stroke:"#6B7280",strokeWidth:"2",markerEnd:"url(#arrow)"}),t.jsx("defs",{children:t.jsx("marker",{id:"arrow",markerWidth:"10",markerHeight:"10",refX:"9",refY:"3",orient:"auto",markerUnits:"strokeWidth",children:t.jsx("path",{d:"M0,0 L0,6 L9,3 z",fill:"#6B7280"})})})]}),t.jsx("span",{children:"Dependency"})]}),t.jsxs("div",{className:"flex items-center space-x-2",children:[t.jsx("div",{className:"w-4 h-3 border-2 border-blue-500 rounded bg-white"}),t.jsx("span",{children:"Selected"})]}),t.jsxs("div",{className:"flex items-center space-x-2",children:[t.jsx("div",{className:"w-4 h-3 border-2 border-green-500 rounded bg-white"}),t.jsx("span",{children:"Connected"})]})]})]}),t.jsxs("div",{children:[t.jsx("h5",{className:"text-xs font-medium text-gray-700 mb-2",children:"Interactions"}),t.jsxs("div",{className:"space-y-1 text-xs text-gray-600",children:[t.jsx("div",{children:"• Click a package to select and view details"}),t.jsx("div",{children:"• Hover to highlight connections"}),t.jsx("div",{children:"• Use toolbar to change layout and zoom"})]})]})]})]}):null}function zp(){v.useEffect(()=>{(async()=>{try{l(!0);const Ne=await _t.getPackages(),ce=Ap(Ne),W=Ne.map(se=>({...se,dependencies:{...se.dependencies,...se.devDependencies,...se.peerDependencies},dependents:ce[se.name]}));m(W),o(null)}catch(Ne){o("Failed to fetch packages"),console.error("Error fetching packages:",Ne)}finally{l(!1)}})()},[]);const[s,l]=v.useState(!1),[i,o]=v.useState(null),[u,m]=v.useState([]),[h,p]=v.useState("graph"),[x,y]=v.useState("hierarchical"),[k,j]=v.useState(null),[E,I]=v.useState(null),[L,A]=v.useState(!0),[P,O]=v.useState(1),[M,R]=v.useState("name"),[$,J]=v.useState("asc"),ve=v.useMemo(()=>Cp(u??[],x,800,600),[u,x]),ee=v.useMemo(()=>kp(u,M,$),[u,M,$]),pe=v.useMemo(()=>bp(u),[u]),xe=v.useMemo(()=>$m(u),[u]),we=k&&u.find(Pe=>Pe.name===k)||null,X=()=>{},he=Pe=>{j(Pe)},ye=(Pe,Ne)=>{R(Pe),J(Ne)},je=()=>{window.location.reload()};return s?t.jsx(vp,{}):i?t.jsx(jp,{error:i,onRetry:je}):t.jsxs("div",{className:"space-y-6",children:[t.jsx(wp,{onRefresh:X,loading:s}),t.jsx(Op,{stats:pe,packages:u??[]}),xe.length>0&&t.jsx(Dp,{cycles:xe,packages:u,onPackageSelect:he}),t.jsx(Np,{viewMode:h,onViewModeChange:p,layout:x,onLayoutChange:y,showLegend:L,onToggleLegend:()=>A(!L),zoomLevel:P,onZoomChange:O}),t.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-4 gap-6",children:[t.jsx("div",{className:`${L?"lg:col-span-3":"lg:col-span-4"}`,children:h==="graph"?t.jsxs("div",{className:"relative",children:[t.jsx("div",{style:{transform:`scale(${P})`,transformOrigin:"top left"},children:t.jsx(Rp,{packages:ve,selectedPackage:k,hoveredPackage:E,onPackageSelect:he,onPackageHover:I,layout:x})}),t.jsx(Ip,{package:we,packages:u,onClose:()=>j(null)})]}):t.jsx(Mp,{packages:ee,selectedPackage:k,onPackageSelect:he,sortBy:M,sortOrder:$,onSortChange:ye})}),L&&t.jsx("div",{className:"lg:col-span-1",children:t.jsx(Fp,{show:L})})]})]})}function $p(){const[s,l]=v.useState(0),[i,o]=v.useState(null),[u,m]=v.useState(!0),[h,p]=v.useState(null),[x,y]=v.useState(!1);v.useEffect(()=>{(async()=>{try{m(!0);const R=await _t.getHealthStatus();o(R),p(null)}catch(R){p("Failed to fetch health data"),console.error("Error fetching health data:",R)}finally{m(!1)}})()},[s]);const k=async()=>{try{y(!0),p(null),m(!0);try{const M=await _t.refreshHealthStatus();o(M),p(null)}catch(M){p("Failed to fetch health data"),console.error("Error fetching health data:",M)}finally{m(!1)}}catch(M){p("Failed to refresh health data"),console.error("Error refreshing health data:",M)}finally{y(!1)}},j=()=>{l(M=>M+1)},E=M=>{switch(M){case"healthy":case"success":case"pass":case"up-to-date":return"bg-green-100 text-green-800";case"warning":case"warn":case"outdated":return"bg-yellow-100 text-yellow-800";case"error":case"failed":case"fail":case"vulnerable":return"bg-red-100 text-red-800";default:return"bg-gray-100 text-gray-800"}};if(u&&!i)return t.jsx("div",{className:"flex items-center justify-center h-64",children:t.jsxs("div",{className:"text-center",children:[t.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-blue-600 mx-auto"}),t.jsx("p",{className:"mt-4 text-gray-600",children:"Loading health data..."})]})});if(h)return t.jsx("div",{className:"flex items-center justify-center h-64",children:t.jsxs("div",{className:"text-center",children:[t.jsx(Je,{className:"w-12 h-12 text-red-500 mx-auto"}),t.jsx("p",{className:"mt-4 text-red-600",children:h}),t.jsx("button",{onClick:j,className:"mt-4 bg-blue-600 text-white px-4 py-2 rounded-lg hover:bg-blue-700 transition-colors",children:"Retry"})]})});const I=i?i.summary?.averageScore:0,L=i?i?.packages?.filter(M=>M.health.overallScore>=80).length:0,A=i?i?.packages?.filter(M=>M.health.overallScore>=60&&M.health.overallScore<80).length:0,P=i?i?.packages?.filter(M=>M.health.overallScore<60).length:0,O=[{name:"Package Health",value:L||0,status:(()=>{const M=L||0,R=i?.packages.length||0;if(R===0)return"healthy";const $=M/R;return $>=.8?"healthy":$>=.6?"warning":"error"})(),description:`${L||0} healthy packages out of ${i?.packages.length||0}`},{name:"Overall Score",value:Math.round(I),status:Math.round(I)>=80?"healthy":Math.round(I)>=60?"warning":"error",description:`Average health score: ${Math.round(I)}/100`},{name:"Unhealthy Packages",value:A+P||0,status:(A+P||0)===0?"healthy":(A+P||0)<=2?"warning":"error",description:`${A+P||0} packages need attention`}];return t.jsxs("div",{className:"",children:[t.jsxs("div",{className:"flex items-center justify-between my-3",children:[t.jsxs("div",{children:[t.jsx("h1",{className:"text-2xl font-bold text-gray-900",children:"Health Status"}),t.jsx("p",{className:"text-gray-600 mt-1",children:"Monitor the health and performance of your monorepo packages"})]}),t.jsxs("button",{onClick:k,disabled:x,className:"bg-blue-600 text-white px-4 py-2 rounded-lg hover:bg-blue-700 disabled:bg-blue-400 disabled:cursor-not-allowed flex items-center space-x-2 transition-colors",children:[x?t.jsx("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-white"}):t.jsx(sr,{className:"w-5 h-5"}),t.jsx("span",{children:x?"Refreshing...":"Refresh"})]})]}),x&&i&&t.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-70 flex items-center justify-center z-50",children:t.jsxs("div",{className:"bg-white p-6 rounded-lg shadow-lg text-center",children:[t.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-blue-600 mx-auto"}),t.jsx("p",{className:"mt-4 text-gray-700",children:"Refreshing health data..."})]})}),t.jsxs("div",{className:"my-3 bg-gradient-to-r from-blue-500 to-purple-600 rounded-lg p-6 text-white",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{children:[t.jsx("h2",{className:"text-xl font-semibold",children:"Overall Monorepo Health"}),t.jsx("p",{className:"text-blue-100 mt-1",children:"Based on all package metrics and recent activity"})]}),t.jsxs("div",{className:"text-right",children:[t.jsx("div",{className:"text-4xl font-bold",children:I?.toFixed(2)}),t.jsx("div",{className:"text-blue-100",children:"out of 100"})]})]}),t.jsxs("div",{className:"mt-4 flex space-x-4",children:[t.jsxs("div",{className:"flex items-center space-x-2",children:[t.jsx(Pt,{className:"w-5 h-5 text-green-300"}),t.jsxs("span",{children:[L," Healthy"]})]}),t.jsxs("div",{className:"flex items-center space-x-2",children:[t.jsx(Je,{className:"w-5 h-5 text-yellow-300"}),t.jsxs("span",{children:[A," Warnings"]})]}),t.jsxs("div",{className:"flex items-center space-x-2",children:[t.jsx(Bt,{className:"w-5 h-5 text-red-300"}),t.jsxs("span",{children:[P," Errors"]})]})]})]}),t.jsx("div",{className:"my-3 grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:O.map(M=>t.jsxs("div",{className:"bg-white p-6 rounded-lg shadow border",children:[t.jsxs("div",{className:"flex items-center justify-between mb-4",children:[t.jsx("h3",{className:"text-lg font-medium text-gray-900",children:M.name}),t.jsx("div",{className:`w-3 h-3 rounded-full ${M.status==="healthy"?"bg-green-500":M.status==="warning"?"bg-yellow-500":"bg-red-500"}`})]}),t.jsx("div",{className:"flex items-end space-x-2",children:t.jsx("span",{className:"text-3xl font-bold text-gray-900",children:M.value})}),t.jsxs("div",{className:"mt-4 flex items-center justify-between",children:[t.jsx("span",{className:`inline-flex px-2 py-1 text-xs font-semibold rounded-full ${E(M.status)}`,children:M.status}),t.jsx("span",{className:"text-sm text-gray-500",children:M.description})]})]},M.name))}),t.jsxs("div",{className:"my-3 bg-white rounded-lg shadow border overflow-hidden",children:[t.jsx("div",{className:"px-6 py-4 border-b border-gray-200",children:t.jsx("h3",{className:"text-lg font-medium text-gray-900",children:"Package Health Details"})}),t.jsx("div",{className:"overflow-x-auto",children:t.jsxs("table",{className:"min-w-full divide-y divide-gray-200",children:[t.jsx("thead",{className:"bg-gray-50",children:t.jsxs("tr",{children:[t.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Package"}),t.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Overall Score"}),t.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Build Status"}),t.jsx("th",{className:"hidden px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Test Coverage"}),t.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Lint Status"}),t.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Security"}),t.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Dependencies"}),t.jsx("th",{className:"hidden px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Actions"})]})}),t.jsx("tbody",{className:"bg-white divide-y divide-gray-200",children:i?.packages?.map(M=>t.jsxs("tr",{className:"hover:bg-gray-50",children:[t.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:t.jsxs("div",{className:"flex items-center",children:[t.jsx("div",{className:"h-8 w-8 rounded-lg bg-gray-100 flex items-center justify-center",children:t.jsx("div",{className:"text-sm",children:t.jsx(Lt,{className:"w-6 h-6 text-primary-600"})})}),t.jsxs("div",{className:"ml-3",children:[t.jsx("div",{className:"text-sm font-medium text-gray-900",children:M.packageName}),t.jsxs("div",{className:"text-sm text-gray-500",children:["Score: ",M.health.overallScore,"/100"]})]})]})}),t.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:t.jsxs("div",{className:"flex items-center",children:[t.jsx("div",{className:"w-16 bg-gray-200 rounded-full h-2 mr-2",children:t.jsx("div",{className:`h-2 rounded-full ${M.health.overallScore>=80?"bg-green-500":M.health.overallScore>=60?"bg-yellow-500":"bg-red-500"}`,style:{width:`${M.health.overallScore}%`}})}),t.jsx("span",{className:"text-sm font-medium text-gray-900",children:M.health.overallScore})]})}),t.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:t.jsxs("div",{className:"flex items-center",children:[t.jsx("div",{className:`w-3 h-3 rounded-full ${M.health.buildStatus==="success"?"bg-green-500":M.health.buildStatus==="unknown"?"bg-yellow-500":"bg-red-500"}`}),t.jsx("span",{className:`ml-2 inline-flex px-2 py-1 text-xs font-semibold rounded-full ${E(M.health.buildStatus==="success"?"healthy":M.health.buildStatus==="unknown"?"warning":"error")}`,children:M.health.buildStatus==="success"?"healthy":M.health.buildStatus==="unknown"?"warning":"error"})]})}),t.jsx("td",{className:"hidden px-6 py-4 whitespace-nowrap",children:t.jsxs("div",{className:"flex items-center",children:[t.jsx(ux,{className:"w-4 h-4 text-gray-400 mr-1"}),t.jsx("span",{className:"text-sm text-gray-900",children:"-"})]})}),t.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:t.jsx("span",{className:`inline-flex px-2 py-1 text-xs font-semibold rounded-full ${E(M.health.lintStatus==="pass"?"pass":M.health.lintStatus==="unknown"?"warn":"fail")}`,children:M.health.lintStatus==="pass"?"pass":M.health.lintStatus==="unknown"?"warn":"fail"})}),t.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:t.jsx("div",{className:"flex items-center",children:t.jsx("span",{className:`inline-flex px-2 py-1 text-xs font-semibold rounded-full ${E(M.health.securityAudit==="pass"?"pass":M.health.securityAudit==="unknown"?"warn":"fail")}`,children:M.health.securityAudit==="pass"?"pass":M.health.securityAudit==="unknown"?"warn":"fail"})})}),t.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:t.jsx("span",{className:`inline-flex px-2 py-1 text-xs font-semibold rounded-full ${E(M.health.overallScore>=80?"up-to-date":M.health.overallScore>=60?"outdated":"vulnerable")}`,children:M.health.overallScore>=80?"up-to-date":M.health.overallScore>=60?"outdated":"vulnerable"})}),t.jsx("td",{className:"hidden px-6 py-4 whitespace-nowrap text-sm font-medium",children:t.jsx("div",{className:"flex space-x-2",children:t.jsx("button",{className:"text-blue-600 hover:text-blue-900",children:"Details"})})})]},M.packageName))})]})})]}),t.jsxs("div",{className:"hidden bg-white rounded-lg shadow border p-6",children:[t.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-4",children:"Health Recommendations"}),t.jsxs("div",{className:"space-y-3",children:[t.jsxs("div",{className:"flex items-start space-x-3 p-3 bg-yellow-50 rounded-lg border border-yellow-200",children:[t.jsx(Je,{className:"w-5 h-5 text-yellow-600 mt-0.5"}),t.jsxs("div",{children:[t.jsx("p",{className:"text-sm font-medium text-yellow-800",children:"Test Coverage Below Target"}),t.jsx("p",{className:"text-sm text-yellow-700",children:"Consider adding more tests to improve coverage above 90%"})]})]}),t.jsxs("div",{className:"flex items-start space-x-3 p-3 bg-red-50 rounded-lg border border-red-200",children:[t.jsx(Bt,{className:"w-5 h-5 text-red-600 mt-0.5"}),t.jsxs("div",{children:[t.jsx("p",{className:"text-sm font-medium text-red-800",children:"Build Failures Detected"}),t.jsx("p",{className:"text-sm text-red-700",children:"monorepo-scanner package has build failures that need immediate attention"})]})]}),t.jsxs("div",{className:"flex items-start space-x-3 p-3 bg-blue-50 rounded-lg border border-blue-200",children:[t.jsx(il,{className:"w-5 h-5 text-blue-600 mt-0.5"}),t.jsxs("div",{children:[t.jsx("p",{className:"text-sm font-medium text-blue-800",children:"Performance Improvements Available"}),t.jsx("p",{className:"text-sm text-blue-700",children:"Consider optimizing build times and dependency resolution"})]})]})]})]})]})}function Bp({packageCount:s,onNewRelease:l}){return t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{children:[t.jsx("h1",{className:"text-2xl font-bold text-gray-900",children:"Publish Control"}),t.jsxs("p",{className:"text-gray-600 mt-1",children:["Manage package releases and versioning across your monorepo (",s," packages)"]})]}),t.jsxs("button",{onClick:l,className:"bg-blue-600 text-white px-4 py-2 rounded-lg hover:bg-blue-700 flex items-center space-x-2",children:[t.jsx(Lo,{className:"w-5 h-5"}),t.jsx("span",{children:"New Release"})]})]})}function Up({stats:s}){return t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[t.jsx("div",{className:"bg-white p-6 rounded-lg shadow border",children:t.jsxs("div",{className:"flex items-center",children:[t.jsx("div",{className:"p-2 bg-green-100 rounded-lg",children:t.jsx(Pa,{className:"w-6 h-6 text-green-600"})}),t.jsxs("div",{className:"ml-4",children:[t.jsx("p",{className:"text-sm font-medium text-gray-600",children:"Ready to Publish"}),t.jsx("p",{className:"text-2xl font-semibold text-gray-900",children:s.readyToPublish})]})]})}),t.jsx("div",{className:"bg-white p-6 rounded-lg shadow border",children:t.jsxs("div",{className:"flex items-center",children:[t.jsx("div",{className:"p-2 bg-blue-100 rounded-lg",children:t.jsx("div",{className:"h-6 w-6 animate-spin rounded-full border-2 border-blue-500 border-t-transparent"})}),t.jsxs("div",{className:"ml-4",children:[t.jsx("p",{className:"text-sm font-medium text-gray-600",children:"In Progress"}),t.jsx("p",{className:"text-2xl font-semibold text-gray-900",children:s.inProgress})]})]})}),t.jsx("div",{className:"bg-white p-6 rounded-lg shadow border",children:t.jsxs("div",{className:"flex items-center",children:[t.jsx("div",{className:"p-2 bg-purple-100 rounded-lg",children:t.jsx("span",{className:"text-2xl",children:t.jsx(Tn,{className:"w-6 h-6 text-primary-600"})})}),t.jsxs("div",{className:"ml-4",children:[t.jsx("p",{className:"text-sm font-medium text-gray-600",children:"Published Today"}),t.jsx("p",{className:"text-2xl font-semibold text-gray-900",children:s.published})]})]})})]})}const Hp=s=>({readyToPublish:s.filter(l=>l.status==="ready").length,inProgress:s.filter(l=>l.status==="building"||l.status==="testing").length,published:s.filter(l=>l.status==="published").length}),Bm=s=>{switch(s){case"ready":case"completed":return"bg-green-100 text-green-800";case"building":case"testing":case"in-progress":return"bg-blue-100 text-blue-800";case"published":return"bg-purple-100 text-purple-800";case"failed":return"bg-red-100 text-red-800";case"scheduled":return"bg-yellow-100 text-yellow-800";default:return"bg-gray-100 text-gray-800"}},Vp=s=>{switch(s){case"patch":return"bg-green-100 text-green-800";case"minor":return"bg-blue-100 text-blue-800";case"major":return"bg-red-100 text-red-800";case"prerelease":return"bg-yellow-100 text-yellow-800";default:return"bg-gray-100 text-gray-800"}},Wp=(s,l)=>l==="all"?s:s.filter(i=>i.name===l);function Gp({packages:s,selectedPackage:l,onPackageChange:i}){return t.jsxs("div",{className:"bg-white rounded-lg shadow border overflow-hidden",children:[t.jsx("div",{className:"px-6 py-4 border-b border-gray-200",children:t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("h3",{className:"text-lg font-medium text-gray-900",children:"Package Release Status"}),t.jsxs("div",{className:"flex items-center space-x-2",children:[t.jsx("span",{className:"text-sm text-gray-500",children:"Filter by package:"}),t.jsxs("select",{value:l,onChange:o=>i(o.target.value),className:"px-3 py-1 border border-gray-300 rounded text-sm focus:ring-2 focus:ring-blue-500 focus:border-transparent",children:[t.jsx("option",{value:"all",children:"All Packages"}),[...new Set(s.map(o=>o.name))].map(o=>t.jsx("option",{value:o,children:o},o))]})]})]})}),t.jsx("div",{className:"overflow-x-auto",children:t.jsxs("table",{className:"min-w-full divide-y divide-gray-200",children:[t.jsx("thead",{className:"bg-gray-50",children:t.jsxs("tr",{children:[t.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Package"}),t.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Current Version"}),t.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Next Version"}),t.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Type"}),t.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Status"}),t.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Commits"}),t.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Last Published"}),t.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Actions"})]})}),t.jsx("tbody",{className:"bg-white divide-y divide-gray-200",children:s.map(o=>t.jsxs("tr",{className:"hover:bg-gray-50",children:[t.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:t.jsxs("div",{className:"flex items-center",children:[t.jsx("div",{className:"h-8 w-8 rounded-lg bg-gray-100 flex items-center justify-center",children:t.jsx(Ko,{className:"w-4 h-4 text-gray-600"})}),t.jsxs("div",{className:"ml-3",children:[t.jsx("div",{className:"text-sm font-medium text-gray-900",children:o.name}),t.jsxs("div",{className:"text-sm text-gray-500",children:[Object.keys(o.dependencies).length," dependencies"]})]})]})}),t.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-900",children:o.currentVersion}),t.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-900",children:o.nextVersion}),t.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:t.jsx("span",{className:`inline-flex px-2 py-1 text-xs font-semibold rounded-full ${Vp(o.publishType)}`,children:o.publishType})}),t.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:t.jsx("span",{className:`inline-flex px-2 py-1 text-xs font-semibold rounded-full ${Bm(o.status)}`,children:o.status})}),t.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-900",children:o.commits}),t.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:t.jsxs("div",{className:"flex items-center text-sm text-gray-900",children:[t.jsx(We,{className:"w-4 h-4 mr-1 text-gray-400"}),o.lastPublished]})}),t.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm font-medium",children:t.jsxs("div",{className:"flex space-x-2",children:[o.status==="ready"&&t.jsx("button",{className:"text-green-600 hover:text-green-900",children:"Publish"}),t.jsx("button",{className:"text-blue-600 hover:text-blue-900",children:"Details"}),t.jsx("button",{className:"text-purple-600 hover:text-purple-900",children:"Changelog"})]})})]},o.name))})]})})]})}function Yp({releases:s,selectedStatus:l,onStatusChange:i}){const o=[{id:"1",packageName:"dashboard",version:"1.0.1",status:"scheduled",scheduledFor:"2024-01-16 10:00 AM",changelog:"Bug fixes and performance improvements",author:"team-frontend"},{id:"2",packageName:"backend",version:"1.3.0",status:"in-progress",scheduledFor:"2024-01-16 11:00 AM",startedAt:"2024-01-16 11:05 AM",changelog:"New API endpoints and enhanced security",author:"team-backend"}];return t.jsxs("div",{className:"bg-white rounded-lg shadow border overflow-hidden",children:[t.jsx("div",{className:"px-6 py-4 border-b border-gray-200",children:t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("h3",{className:"text-lg font-medium text-gray-900",children:"Release Schedule"}),t.jsxs("div",{className:"flex items-center space-x-2",children:[t.jsx("span",{className:"text-sm text-gray-500",children:"Filter by status:"}),t.jsxs("select",{value:l,onChange:u=>i(u.target.value),className:"px-3 py-1 border border-gray-300 rounded text-sm focus:ring-2 focus:ring-blue-500 focus:border-transparent",children:[t.jsx("option",{value:"all",children:"All Status"}),t.jsx("option",{value:"scheduled",children:"Scheduled"}),t.jsx("option",{value:"in-progress",children:"In Progress"}),t.jsx("option",{value:"completed",children:"Completed"}),t.jsx("option",{value:"failed",children:"Failed"})]})]})]})}),t.jsx("div",{className:"p-6",children:t.jsx("div",{className:"space-y-4",children:o.map(u=>t.jsxs("div",{className:"border rounded-lg p-4 hover:bg-gray-50",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{className:"flex items-center space-x-3",children:[t.jsx("div",{className:"h-8 w-8 rounded-lg bg-purple-100 flex items-center justify-center",children:t.jsx(_m,{className:"w-4 h-4 text-purple-600"})}),t.jsxs("div",{children:[t.jsxs("div",{className:"text-sm font-medium text-gray-900",children:[u.packageName," v",u.version]}),t.jsxs("div",{className:"text-sm text-gray-500",children:["by ",u.author]})]})]}),t.jsxs("div",{className:"flex items-center space-x-3",children:[t.jsx("span",{className:`inline-flex px-2 py-1 text-xs font-semibold rounded-full ${Bm(u.status)}`,children:u.status}),t.jsxs("div",{className:"text-sm text-gray-500 flex items-center",children:[t.jsx(We,{className:"w-4 h-4 mr-1"}),u.scheduledFor]})]})]}),t.jsx("div",{className:"mt-3 text-sm text-gray-700",children:u.changelog})]},u.id))})})]})}function Qp(){const s=[{id:"1",packageName:"dashboard",version:"1.0.0",date:"2024-01-15",changes:["Added new dashboard layout","Improved search functionality","Fixed responsive design issues"],author:"team-frontend",type:"feature"},{id:"2",packageName:"backend",version:"1.2.0",date:"2024-01-14",changes:["Added authentication middleware","Implemented rate limiting","Fixed database connection pool"],author:"team-backend",type:"feature"}],l=i=>{switch(i){case"feature":return"bg-green-100 text-green-800";case"bugfix":return"bg-blue-100 text-blue-800";case"breaking":return"bg-red-100 text-red-800";case"docs":return"bg-gray-100 text-gray-800";default:return"bg-gray-100 text-gray-800"}};return t.jsxs("div",{className:"bg-white rounded-lg shadow border overflow-hidden",children:[t.jsx("div",{className:"px-6 py-4 border-b border-gray-200",children:t.jsx("h3",{className:"text-lg font-medium text-gray-900",children:"Recent Changelogs"})}),t.jsx("div",{className:"p-6",children:t.jsx("div",{className:"space-y-6",children:s.map(i=>t.jsxs("div",{className:"border-l-4 border-blue-500 pl-4",children:[t.jsxs("div",{className:"flex items-center justify-between mb-2",children:[t.jsxs("div",{className:"flex items-center space-x-3",children:[t.jsx("div",{className:"h-8 w-8 rounded-lg bg-blue-100 flex items-center justify-center",children:t.jsx(Ko,{className:"w-4 h-4 text-blue-600"})}),t.jsxs("div",{children:[t.jsxs("div",{className:"text-sm font-medium text-gray-900",children:[i.packageName," v",i.version]}),t.jsxs("div",{className:"text-sm text-gray-500",children:[i.date," • by ",i.author]})]})]}),t.jsx("span",{className:`inline-flex px-2 py-1 text-xs font-semibold rounded-full ${l(i.type)}`,children:i.type})]}),t.jsx("div",{className:"space-y-1",children:i.changes.map((o,u)=>t.jsxs("div",{className:"flex items-start space-x-2",children:[t.jsx(Qo,{className:"w-4 h-4 text-gray-400 mt-0.5 flex-shrink-0"}),t.jsx("span",{className:"text-sm text-gray-700",children:o})]},u))})]},i.id))})})]})}function Kp(){return t.jsx("div",{className:"flex items-center justify-center h-64",children:t.jsxs("div",{className:"text-center",children:[t.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-blue-600 mx-auto"}),t.jsx("p",{className:"mt-4 text-gray-600",children:"Loading package data..."})]})})}function Xp({error:s,onRetry:l}){return t.jsx("div",{className:"flex items-center justify-center h-64",children:t.jsxs("div",{className:"text-center",children:[t.jsx(Je,{className:"w-12 h-12 text-red-500 mx-auto"}),t.jsx("p",{className:"mt-4 text-red-600",children:s}),t.jsx("button",{onClick:l,className:"mt-4 bg-blue-600 text-white px-4 py-2 rounded-lg hover:bg-blue-700 transition-colors",children:"Retry"})]})})}const Zd=[{name:"dashboard",currentVersion:"1.0.0",nextVersion:"1.0.1",status:"ready",lastPublished:"2024-01-10",changelog:"Bug fixes and performance improvements",commits:15,dependencies:["react","tailwindcss"],publishType:"patch"},{name:"backend",currentVersion:"1.2.0",nextVersion:"1.3.0",status:"building",lastPublished:"2024-01-08",changelog:"New API endpoints and enhanced security",commits:28,dependencies:["express","prisma"],publishType:"minor"},{name:"utils",currentVersion:"0.5.2",nextVersion:"1.0.0",status:"ready",lastPublished:"2024-01-05",changelog:"Major refactor with breaking changes",commits:42,dependencies:["lodash"],publishType:"major"},{name:"ci-status",currentVersion:"0.3.1",nextVersion:"0.4.0",status:"testing",lastPublished:"2024-01-12",changelog:"Enhanced CI monitoring and reporting",commits:18,dependencies:["axios","ws"],publishType:"minor"}],Zp=[{id:"1",packageName:"dashboard",version:"1.0.1",status:"scheduled",scheduledFor:"2024-01-16 10:00 AM",changelog:"Bug fixes and performance improvements",author:"team-frontend"},{id:"2",packageName:"backend",version:"1.3.0",status:"in-progress",scheduledFor:"2024-01-16 09:00 AM",startedAt:"2024-01-16 09:00 AM",changelog:"New API endpoints and enhanced security",author:"team-backend"},{id:"3",packageName:"utils",version:"1.0.0",status:"completed",scheduledFor:"2024-01-15 02:00 PM",startedAt:"2024-01-15 02:00 PM",completedAt:"2024-01-15 02:15 PM",changelog:"Major refactor with breaking changes",author:"team-shared"}];function Jp(){const[s,l]=v.useState("all"),[i,o]=v.useState("all"),[u,m]=v.useState(Zd),[h,p]=v.useState(!1),[x,y]=v.useState(null);v.useEffect(()=>{(async()=>{try{p(!0);const R=(await _t.getPackages()).map($=>({name:$.name,currentVersion:$.version,nextVersion:k($.version),status:j($.status),lastPublished:$.lastUpdated,changelog:$.description||"No changelog available",commits:Math.floor(Math.random()*20)+1,dependencies:$.dependencies||[],publishType:E()}));m(R),y(null)}catch(M){y("Failed to fetch package data"),console.error("Error fetching packages:",M),m(Zd)}finally{p(!1)}})()},[]);const k=O=>{const M=O.split(".").map(Number);return M[2]+=1,M.join(".")},j=O=>{switch(O){case"healthy":return"ready";case"warning":return"testing";case"error":return"failed";case"building":return"building";default:return"ready"}},E=()=>{const O=["patch","minor","major","prerelease"];return O[Math.floor(Math.random()*O.length)]},I=()=>{},L=()=>{window.location.reload()},A=Wp(u,s),P=Hp(u);return h?t.jsx(Kp,{}):x?t.jsx(Xp,{error:x,onRetry:L}):t.jsxs("div",{className:"space-y-6",children:[t.jsx(Bp,{packageCount:u.length,onNewRelease:I}),t.jsx(Up,{stats:P}),t.jsx(Gp,{packages:A,selectedPackage:s,onPackageChange:l}),t.jsx(Yp,{releases:Zp,selectedStatus:i,onStatusChange:o}),t.jsx(Qp,{})]})}function qp({message:s="Loading CI/CD data..."}){return t.jsx("div",{className:"flex items-center justify-center h-64",children:t.jsxs("div",{className:"text-center",children:[t.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-blue-600 mx-auto"}),t.jsx("p",{className:"mt-4 text-gray-600",children:s})]})})}function eg({error:s,onRetry:l}){return t.jsx("div",{className:"flex items-center justify-center h-64",children:t.jsxs("div",{className:"text-center",children:[t.jsx(Je,{className:"w-12 h-12 text-red-500 mx-auto"}),t.jsx("p",{className:"mt-4 text-red-600",children:s}),l&&t.jsx("button",{onClick:l,className:"mt-4 bg-blue-600 text-white px-4 py-2 rounded-lg hover:bg-blue-700 transition-colors",children:"Retry"})]})})}function tg({onTriggerBuild:s,onCreatePipeline:l}){return t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{children:[t.jsx("h1",{className:"text-heading text-2xl",children:"CI/CD Integration"}),t.jsx("p",{className:"text-body mt-1",children:"Monitor and manage continuous integration and deployment pipelines"})]}),t.jsxs("div",{className:"flex space-x-2",children:[t.jsxs("button",{onClick:s,className:"btn-secondary flex items-center space-x-2",children:[t.jsx(Pa,{className:"w-5 h-5"}),t.jsx("span",{children:"Trigger Build"})]}),t.jsxs("button",{onClick:l,className:"btn-primary flex items-center space-x-2",children:[t.jsx(Pm,{className:"w-5 h-5"}),t.jsx("span",{children:"New Pipeline"})]})]})]})}const Ea=s=>{switch(s){case"success":case"active":return"bg-green-100 text-green-800";case"running":return"bg-blue-100 text-blue-800";case"pending":return"bg-yellow-100 text-yellow-800";case"failed":case"cancelled":return"bg-red-100 text-red-800";case"paused":return"bg-gray-100 text-gray-800";case"skipped":return"bg-gray-100 text-gray-600";default:return"bg-gray-100 text-gray-800"}},ng=s=>{switch(s){case"success":return"bg-green-100 text-green-800";case"running":return"bg-blue-100 text-blue-800";case"pending":return"bg-gray-100 text-gray-800";case"failed":return"bg-red-100 text-red-800";case"skipped":return"bg-gray-100 text-gray-600";default:return"bg-gray-100 text-gray-800"}},rg=s=>{const l=s.length,i=s.filter(x=>x.status==="success").length,o=s.filter(x=>x.status==="failed").length,u=s.filter(x=>x.status==="running").length,m=l>0?Math.round(i/l*100):0,h=s.filter(x=>x.duration),p=h.length>0?Math.round(h.reduce((x,y)=>x+(y.duration||0),0)/h.length):0;return{total:l,successful:i,failed:o,running:u,successRate:m,avgDuration:p}},sg=(s,l)=>s.filter(i=>{const o=l.package==="all"||i.packageName===l.package,u=l.status==="all"||i.status===l.status;return o&&u&&!0}),lg=s=>[...new Set(s.map(l=>l.packageName))],ag=s=>[...new Set(s.map(l=>l.status))],sl=s=>{if(s<60)return`${s}s`;if(s<3600){const l=Math.floor(s/60),i=s%60;return i>0?`${l}m ${i}s`:`${l}m`}else{const l=Math.floor(s/3600),i=Math.floor(s%3600/60);return i>0?`${l}h ${i}m`:`${l}h`}},Jd=s=>new Date(s).toLocaleString("en-US",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}),Um=s=>{const l=new Date(s),o=new Date().getTime()-l.getTime(),u=Math.floor(o/(1e3*60)),m=Math.floor(u/60),h=Math.floor(m/24);return u<1?"Just now":u<60?`${u} min ago`:m<24?`${m} hour${m>1?"s":""} ago`:`${h} day${h>1?"s":""} ago`},ig=s=>{if(s.status==="success"||s.status==="failed"||s.status==="cancelled")return 100;if(s.status==="pending")return 0;const l=s.stages.length;if(l===0)return 0;const i=s.stages.filter(m=>m.status==="success"||m.status==="failed"||m.status==="skipped").length,o=s.stages.filter(m=>m.status==="running").length,u=(i+o*.5)/l;return Math.round(u*100)},og=s=>{const l=s.toLowerCase();return l.includes("build")||l.includes("compile")?"🔨":l.includes("test")?"🧪":l.includes("lint")||l.includes("format")?"✨":l.includes("deploy")||l.includes("publish")?t.jsx(Tn,{className:"w-6 h-6 text-primary-600"}):l.includes("security")||l.includes("audit")?"🔒":l.includes("install")||l.includes("dependencies")?t.jsx(Lt,{className:"w-6 h-6 text-primary-600"}):t.jsx(Cr,{className:"w-6 h-6 text-primary-600"})},cg=s=>s.status==="failed"?"critical":s.status==="paused"?"warning":s.successRate<70?"critical":s.successRate<85?"warning":"healthy",Hm=s=>s.substring(0,8);function ug({stats:s,onRefresh:l,loading:i=!1}){return t.jsxs("div",{className:"space-y-6",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("h2",{className:"text-heading text-lg",children:"Build Statistics"}),t.jsxs("button",{onClick:l,disabled:i,className:"btn-ghost",children:[t.jsx(sr,{className:`w-4 h-4 mr-2 ${i?"animate-spin":""}`}),"Refresh"]})]}),t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-5 gap-4",children:[t.jsx("div",{className:"card p-4",children:t.jsxs("div",{className:"flex items-center",children:[t.jsx("div",{className:"p-2 bg-primary-100 rounded-lg",children:t.jsx(il,{className:"w-6 h-6 text-primary-600"})}),t.jsxs("div",{className:"ml-4",children:[t.jsx("p",{className:"text-caption font-medium",children:"Total Builds"}),t.jsx("p",{className:"text-heading text-2xl",children:s.total})]})]})}),t.jsx("div",{className:"card p-4",children:t.jsxs("div",{className:"flex items-center",children:[t.jsx("div",{className:"p-2 bg-success-100 rounded-lg",children:t.jsx(Pt,{className:"w-6 h-6 text-success-600"})}),t.jsxs("div",{className:"ml-4",children:[t.jsx("p",{className:"text-caption font-medium",children:"Successful"}),t.jsx("p",{className:"text-heading text-2xl text-success-600",children:s.successful})]})]})}),t.jsx("div",{className:"card p-4",children:t.jsxs("div",{className:"flex items-center",children:[t.jsx("div",{className:"p-2 bg-error-100 rounded-lg",children:t.jsx(Bt,{className:"w-6 h-6 text-error-600"})}),t.jsxs("div",{className:"ml-4",children:[t.jsx("p",{className:"text-caption font-medium",children:"Failed"}),t.jsx("p",{className:"text-heading text-2xl text-error-600",children:s.failed})]})]})}),t.jsx("div",{className:"card p-4",children:t.jsxs("div",{className:"flex items-center",children:[t.jsx("div",{className:"p-2 bg-info-100 rounded-lg",children:t.jsx(We,{className:"w-6 h-6 text-info-600"})}),t.jsxs("div",{className:"ml-4",children:[t.jsx("p",{className:"text-caption font-medium",children:"Running"}),t.jsx("p",{className:"text-heading text-2xl text-info-600",children:s.running})]})]})}),t.jsxs("div",{className:"card p-4",children:[t.jsxs("div",{className:"flex items-center justify-between mb-2",children:[t.jsx("p",{className:"text-caption font-medium",children:"Success Rate"}),t.jsxs("span",{className:`text-lg font-bold ${s.successRate>=90?"text-success-600":s.successRate>=70?"text-warning-600":"text-error-600"}`,children:[s.successRate,"%"]})]}),t.jsx("div",{className:"w-full bg-neutral-200 rounded-full h-2",children:t.jsx("div",{className:`h-2 rounded-full transition-all duration-300 ${s.successRate>=90?"bg-success-500":s.successRate>=70?"bg-warning-500":"bg-error-500"}`,style:{width:`${s.successRate}%`}})})]})]}),t.jsxs("div",{className:"card p-6",children:[t.jsx("h3",{className:"text-heading text-lg mb-4",children:"Performance Metrics"}),t.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[t.jsxs("div",{className:"text-center",children:[t.jsx("div",{className:"text-heading text-2xl text-primary-600",children:sl(s.avgDuration)}),t.jsx("div",{className:"text-caption",children:"Avg Duration"})]}),t.jsxs("div",{className:"text-center",children:[t.jsxs("div",{className:"text-heading text-2xl text-success-600",children:[s.total>0?Math.round(s.successful/s.total*100):0,"%"]}),t.jsx("div",{className:"text-caption",children:"Success Rate"})]}),t.jsxs("div",{className:"text-center",children:[t.jsxs("div",{className:"text-heading text-2xl text-error-600",children:[s.total>0?Math.round(s.failed/s.total*100):0,"%"]}),t.jsx("div",{className:"text-caption",children:"Failure Rate"})]}),t.jsxs("div",{className:"text-center",children:[t.jsx("div",{className:"text-heading text-2xl text-accent-600",children:s.running}),t.jsx("div",{className:"text-caption",children:"Active Builds"})]})]})]})]})}function dg({builds:s,selectedBuild:l,onBuildSelect:i,filters:o,onFiltersChange:u}){const m=lg(s),h=ag(s),p=x=>{switch(x){case"success":return t.jsx(Pt,{className:"h-5 w-5 text-green-500"});case"running":return t.jsx("div",{className:"h-5 w-5 animate-spin rounded-full border-2 border-blue-500 border-t-transparent"});case"pending":return t.jsx(We,{className:"h-5 w-5 text-yellow-500"});case"failed":return t.jsx(Bt,{className:"h-5 w-5 text-red-500"});case"cancelled":return t.jsx(Ao,{className:"h-5 w-5 text-red-500"});default:return t.jsx(We,{className:"h-5 w-5 text-gray-500"})}};return t.jsxs("div",{className:"space-y-4",children:[t.jsx("div",{className:"bg-white p-4 rounded-lg shadow border",children:t.jsxs("div",{className:"flex items-center space-x-4",children:[t.jsxs("div",{className:"flex items-center space-x-2",children:[t.jsx(Ra,{className:"h-4 w-4 text-gray-400"}),t.jsxs("select",{value:o.package,onChange:x=>u({...o,package:x.target.value}),className:"border border-gray-300 rounded-md px-3 py-2 text-sm focus:ring-2 focus:ring-blue-500 focus:border-transparent",children:[t.jsx("option",{value:"all",children:"All Packages"}),m.map(x=>t.jsx("option",{value:x,children:x},x))]})]}),t.jsxs("select",{value:o.status,onChange:x=>u({...o,status:x.target.value}),className:"border border-gray-300 rounded-md px-3 py-2 text-sm focus:ring-2 focus:ring-blue-500 focus:border-transparent",children:[t.jsx("option",{value:"all",children:"All Statuses"}),h.map(x=>t.jsx("option",{value:x,children:x.charAt(0).toUpperCase()+x.slice(1)},x))]}),t.jsxs("select",{value:o.dateRange,onChange:x=>u({...o,dateRange:x.target.value}),className:"border border-gray-300 rounded-md px-3 py-2 text-sm focus:ring-2 focus:ring-blue-500 focus:border-transparent",children:[t.jsx("option",{value:"all",children:"All Time"}),t.jsx("option",{value:"today",children:"Today"}),t.jsx("option",{value:"week",children:"This Week"}),t.jsx("option",{value:"month",children:"This Month"})]})]})}),t.jsxs("div",{className:"bg-white rounded-lg shadow border",children:[t.jsxs("div",{className:"p-4 border-b border-gray-200",children:[t.jsx("h3",{className:"text-lg font-medium text-gray-900",children:"Recent Builds"}),t.jsxs("p",{className:"text-sm text-gray-500 mt-1",children:[s.length," build",s.length!==1?"s":""," found"]})]}),s.length===0?t.jsxs("div",{className:"p-8 text-center",children:[t.jsx("div",{className:"text-gray-400 text-4xl mb-2",children:"🔨"}),t.jsx("p",{className:"text-gray-500",children:"No builds found matching your filters"})]}):t.jsx("div",{className:"divide-y divide-gray-200",children:s.map(x=>{const y=ig(x),k=l===x.id;return t.jsxs("div",{className:`p-4 cursor-pointer transition-colors ${k?"bg-blue-50 border-l-4 border-blue-500":"hover:bg-gray-50"}`,onClick:()=>i(k?null:x.id),children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{className:"flex items-center space-x-4",children:[p(x.status),t.jsxs("div",{children:[t.jsxs("div",{className:"flex items-center space-x-2",children:[t.jsx("h4",{className:"text-sm font-medium text-gray-900",children:x.packageName}),t.jsx("span",{className:"inline-flex items-center px-2 py-0.5 rounded text-xs font-medium bg-gray-100 text-gray-800",children:x.branch}),t.jsx("span",{className:"text-xs text-gray-500 font-mono",children:Hm(x.commit)})]}),t.jsxs("div",{className:"flex items-center space-x-2 mt-1",children:[t.jsx("span",{className:`inline-flex px-2 py-1 text-xs font-semibold rounded-full ${Ea(x.status)}`,children:x.status}),t.jsxs("span",{className:"text-xs text-gray-500",children:["by ",x.triggeredBy]}),t.jsx("span",{className:"text-xs text-gray-500",children:Um(x.startTime)})]})]})]}),t.jsxs("div",{className:"text-right",children:[x.duration&&t.jsx("div",{className:"text-sm font-medium text-gray-900",children:sl(x.duration)}),x.status==="running"&&t.jsx("div",{className:"mt-1",children:t.jsxs("div",{className:"flex items-center space-x-2",children:[t.jsx("div",{className:"w-20 bg-gray-200 rounded-full h-2",children:t.jsx("div",{className:"bg-blue-500 h-2 rounded-full transition-all duration-300",style:{width:`${y}%`}})}),t.jsxs("span",{className:"text-xs text-gray-500",children:[y,"%"]})]})})]})]}),k&&x.stages.length>0&&t.jsx("div",{className:"mt-4 pt-4 border-t border-gray-100",children:t.jsx("div",{className:"flex items-center space-x-2",children:x.stages.map((j,E)=>t.jsx("div",{className:`flex items-center px-2 py-1 text-xs rounded ${Ea(j.status)}`,title:`${j.name}: ${j.status}`,children:j.name},j.name))})})]},x.id)})})]})]})}function mg({pipelines:s,onPipelineSelect:l,onPipelineToggle:i}){const o=m=>{switch(m){case"healthy":return t.jsx(Pt,{className:"w-5 h-5 text-green-500"});case"warning":return t.jsx(Je,{className:"w-5 h-5 text-yellow-500"});case"critical":return t.jsx(Bt,{className:"w-5 h-5 text-red-500"});default:return t.jsx(Cr,{className:"w-5 h-5 text-gray-500"})}},u=m=>{switch(m){case"healthy":return"bg-green-100 text-green-800";case"warning":return"bg-yellow-100 text-yellow-800";case"critical":return"bg-red-100 text-red-800";default:return"bg-gray-100 text-gray-800"}};return s.length===0?t.jsx("div",{className:"bg-white rounded-lg shadow border p-6",children:t.jsxs("div",{className:"text-center",children:[t.jsx(Cr,{className:"w-12 h-12 text-gray-400 mx-auto mb-4"}),t.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-2",children:"No Pipelines Configured"}),t.jsx("p",{className:"text-gray-600 mb-4",children:"Get started by creating your first CI/CD pipeline to automate builds and deployments."}),t.jsx("button",{className:"bg-blue-600 text-white px-4 py-2 rounded-lg hover:bg-blue-700 transition-colors",children:"Create Pipeline"})]})}):t.jsxs("div",{className:"bg-white rounded-lg shadow border",children:[t.jsxs("div",{className:"p-4 border-b border-gray-200",children:[t.jsx("h3",{className:"text-lg font-medium text-gray-900",children:"Pipeline Status"}),t.jsxs("p",{className:"text-sm text-gray-500 mt-1",children:[s.length," pipeline",s.length!==1?"s":""," ","configured"]})]}),t.jsx("div",{className:"divide-y divide-gray-200",children:s.map(m=>{const h=cg(m);return t.jsxs("div",{className:"p-4 hover:bg-gray-50 transition-colors cursor-pointer",onClick:()=>l(m.id),children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{className:"flex items-center space-x-4",children:[o(h),t.jsxs("div",{children:[t.jsxs("div",{className:"flex items-center space-x-2",children:[t.jsx("h4",{className:"text-sm font-medium text-gray-900",children:m.name}),t.jsx("span",{className:"inline-flex items-center px-2 py-0.5 rounded text-xs font-medium bg-gray-100 text-gray-800",children:m.packageName})]}),t.jsxs("div",{className:"flex items-center space-x-4 mt-1",children:[t.jsx("span",{className:`inline-flex px-2 py-1 text-xs font-semibold rounded-full ${Ea(m.status)}`,children:m.status}),t.jsx("span",{className:`inline-flex px-2 py-1 text-xs font-semibold rounded-full ${u(h)}`,children:h})]})]})]}),t.jsx("div",{className:"flex items-center space-x-4",children:t.jsx("button",{onClick:p=>{p.stopPropagation(),i(m.id,m.status!=="active")},className:`p-2 rounded-lg transition-colors ${m.status==="active"?"text-green-600 hover:bg-green-100":"text-gray-400 hover:bg-gray-100"}`,title:m.status==="active"?"Pause Pipeline":"Activate Pipeline",children:m.status==="active"?t.jsx(dx,{className:"w-5 h-5"}):t.jsx(Pa,{className:"w-5 h-5"})})})]}),t.jsxs("div",{className:"mt-3 grid grid-cols-4 gap-4 text-xs",children:[t.jsxs("div",{children:[t.jsx("span",{className:"text-gray-500",children:"Success Rate:"}),t.jsxs("div",{className:`font-medium ${m.successRate>=90?"text-green-600":m.successRate>=70?"text-yellow-600":"text-red-600"}`,children:[m.successRate,"%"]})]}),t.jsxs("div",{children:[t.jsx("span",{className:"text-gray-500",children:"Avg Duration:"}),t.jsx("div",{className:"font-medium text-gray-900",children:sl(m.avgDuration)})]}),t.jsxs("div",{children:[t.jsx("span",{className:"text-gray-500",children:"Last Run:"}),t.jsx("div",{className:"font-medium text-gray-900",children:Um(m.lastRun)})]}),t.jsxs("div",{children:[t.jsx("span",{className:"text-gray-500",children:"Triggers:"}),t.jsx("div",{className:"font-medium text-gray-900",children:m.triggers.length})]})]}),t.jsxs("div",{className:"mt-3",children:[t.jsxs("div",{className:"flex items-center justify-between text-xs mb-1",children:[t.jsx("span",{className:"text-gray-500",children:"Pipeline Health"}),t.jsxs("span",{className:"font-medium text-gray-900",children:[m.successRate,"%"]})]}),t.jsx("div",{className:"w-full bg-gray-200 rounded-full h-2",children:t.jsx("div",{className:`h-2 rounded-full transition-all duration-300 ${m.successRate>=90?"bg-green-500":m.successRate>=70?"bg-yellow-500":"bg-red-500"}`,style:{width:`${m.successRate}%`}})})]}),t.jsx("div",{className:"mt-3",children:t.jsxs("div",{className:"flex items-center space-x-1",children:[t.jsx("span",{className:"text-xs text-gray-500",children:"Triggers:"}),m.triggers.map(p=>t.jsx("span",{className:"inline-flex items-center px-2 py-0.5 rounded text-xs font-medium bg-blue-100 text-blue-800",children:p},p))]})})]},m.id)})})]})}function hg({build:s,onClose:l,onCancel:i,onRetry:o}){if(!s)return null;const u=m=>{switch(m){case"success":return t.jsx(Pt,{className:"h-5 w-5 text-green-500"});case"running":return t.jsx("div",{className:"h-5 w-5 animate-spin rounded-full border-2 border-blue-500 border-t-transparent"});case"pending":return t.jsx(We,{className:"h-5 w-5 text-yellow-500"});case"failed":return t.jsx(Bt,{className:"h-5 w-5 text-red-500"});case"cancelled":return t.jsx(Ao,{className:"h-5 w-5 text-red-500"});default:return t.jsx(We,{className:"h-5 w-5 text-gray-500"})}};return t.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",children:t.jsxs("div",{className:"bg-white rounded-lg shadow-xl max-w-4xl w-full max-h-[90vh] overflow-hidden",children:[t.jsxs("div",{className:"flex items-center justify-between p-6 border-b border-gray-200",children:[t.jsxs("div",{className:"flex items-center space-x-3",children:[u(s.status),t.jsxs("div",{children:[t.jsxs("h2",{className:"text-xl font-semibold text-gray-900",children:[s.packageName," Build"]}),t.jsxs("p",{className:"text-sm text-gray-600",children:[s.branch," • ",Hm(s.commit)]})]})]}),t.jsxs("div",{className:"flex items-center space-x-2",children:[s.status==="running"&&i&&t.jsxs("button",{onClick:()=>i(s.id),className:"inline-flex items-center px-3 py-2 text-sm font-medium text-red-700 bg-red-100 rounded-lg hover:bg-red-200 transition-colors",children:[t.jsx(Ao,{className:"w-4 h-4 mr-1"}),"Cancel"]}),(s.status==="failed"||s.status==="cancelled")&&o&&t.jsxs("button",{onClick:()=>o(s.id),className:"inline-flex items-center px-3 py-2 text-sm font-medium text-green-700 bg-green-100 rounded-lg hover:bg-green-200 transition-colors",children:[t.jsx(sr,{className:"w-4 h-4 mr-1"}),"Retry"]}),t.jsx("button",{onClick:l,className:"text-gray-400 hover:text-gray-600 transition-colors",children:t.jsx(al,{className:"w-6 h-6"})})]})]}),t.jsxs("div",{className:"p-6 overflow-y-auto max-h-[70vh]",children:[t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6 mb-6",children:[t.jsx("div",{className:"space-y-4",children:t.jsxs("div",{children:[t.jsx("h3",{className:"text-sm font-medium text-gray-700 mb-2",children:"Build Information"}),t.jsxs("div",{className:"space-y-2 text-sm",children:[t.jsxs("div",{className:"flex justify-between",children:[t.jsx("span",{className:"text-gray-600",children:"Status:"}),t.jsx("span",{className:`inline-flex px-2 py-1 text-xs font-semibold rounded-full ${Ea(s.status)}`,children:s.status})]}),t.jsxs("div",{className:"flex justify-between",children:[t.jsx("span",{className:"text-gray-600",children:"Started:"}),t.jsx("span",{className:"font-medium",children:Jd(s.startTime)})]}),s.endTime&&t.jsxs("div",{className:"flex justify-between",children:[t.jsx("span",{className:"text-gray-600",children:"Ended:"}),t.jsx("span",{className:"font-medium",children:Jd(s.endTime)})]}),s.duration&&t.jsxs("div",{className:"flex justify-between",children:[t.jsx("span",{className:"text-gray-600",children:"Duration:"}),t.jsx("span",{className:"font-medium",children:sl(s.duration)})]}),t.jsxs("div",{className:"flex justify-between",children:[t.jsx("span",{className:"text-gray-600",children:"Triggered by:"}),t.jsx("span",{className:"font-medium",children:s.triggeredBy})]})]})]})}),t.jsx("div",{className:"space-y-4",children:t.jsxs("div",{children:[t.jsx("h3",{className:"text-sm font-medium text-gray-700 mb-2",children:"Artifacts"}),s.artifacts.length>0?t.jsx("div",{className:"space-y-1",children:s.artifacts.map((m,h)=>t.jsx("div",{className:"text-sm",children:t.jsx("a",{href:"#",className:"text-blue-600 hover:text-blue-500 font-medium",children:m})},h))}):t.jsx("p",{className:"text-sm text-gray-500",children:"No artifacts generated"})]})})]}),t.jsxs("div",{children:[t.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-4",children:"Build Stages"}),t.jsx("div",{className:"space-y-4",children:s.stages.map((m,h)=>t.jsxs("div",{className:"border border-gray-200 rounded-lg p-4",children:[t.jsxs("div",{className:"flex items-center justify-between mb-3",children:[t.jsxs("div",{className:"flex items-center space-x-3",children:[t.jsx("span",{className:"text-2xl",children:og(m.name)}),t.jsxs("div",{children:[t.jsx("h4",{className:"text-sm font-medium text-gray-900",children:m.name}),t.jsxs("div",{className:"flex items-center space-x-2 mt-1",children:[t.jsx("span",{className:`inline-flex px-2 py-1 text-xs font-semibold rounded-full ${ng(m.status)}`,children:m.status}),m.duration&&t.jsx("span",{className:"text-xs text-gray-500",children:sl(m.duration)})]})]})]}),t.jsxs("div",{className:"text-sm text-gray-500",children:["Step ",h+1," of ",s.stages.length]})]}),m.logs&&m.logs.length>0&&t.jsxs("div",{className:"mt-3",children:[t.jsx("h5",{className:"text-xs font-medium text-gray-700 mb-2",children:"Logs"}),t.jsx("div",{className:"bg-gray-900 text-gray-100 p-3 rounded-lg text-xs font-mono max-h-32 overflow-y-auto",children:m.logs.map((p,x)=>t.jsx("div",{className:"mb-1",children:p},x))})]})]},m.name))})]})]})]})})}const fg=[{id:"1",name:"Dashboard CI",packageName:"dashboard",status:"active",lastRun:"2024-01-16T09:00:00Z",nextRun:"2024-01-16T10:00:00Z",successRate:95,avgDuration:420,triggers:["push","pull_request"]},{id:"2",name:"Backend CI",packageName:"backend",status:"active",lastRun:"2024-01-16T08:30:00Z",nextRun:"2024-01-16T09:30:00Z",successRate:88,avgDuration:900,triggers:["push","pull_request","tag"]},{id:"3",name:"Utils CI",packageName:"utils",status:"paused",lastRun:"2024-01-16T08:00:00Z",successRate:75,avgDuration:600,triggers:["push","pull_request"]}];function xg(){const[s,l]=v.useState(!0),[i,o]=v.useState(null),[u,m]=v.useState([]),[h]=v.useState(fg),[p,x]=v.useState(null),[y,k]=v.useState({package:"all",status:"all",pipeline:"all",dateRange:"all"});v.useEffect(()=>{(async()=>{try{l(!0);const xe=(await _t.getBuildStatus()).map(we=>({id:we.id||Math.random().toString(36).substr(2,9),packageName:we.package||we.packageName||"unknown",branch:we.branch||"main",commit:we.commit||"unknown",status:we.status||"pending",startTime:we.startTime||new Date().toISOString(),endTime:we.endTime,duration:we.duration,stages:we.stages||[],triggeredBy:we.triggeredBy||"system",artifacts:we.artifacts||[]}));m(xe),o(null)}catch(pe){o("Failed to fetch build data"),console.error("Error fetching build data:",pe)}finally{l(!1)}})()},[]);const j=sg(u,y),E=rg(u),I=p&&u.find(ee=>ee.id===p)||null,L=()=>{window.location.reload()},A=()=>{console.log("Triggering new build...")},P=()=>{console.log("Creating new pipeline...")},O=ee=>{x(ee)},M=ee=>{console.log("Selected pipeline:",ee)},R=(ee,pe)=>{console.log("Toggle pipeline:",ee,"active:",pe)},$=ee=>{console.log("Cancelling build:",ee),x(null)},J=ee=>{console.log("Retrying build:",ee),x(null)},ve=()=>{window.location.reload()};return s?t.jsx(qp,{}):i?t.jsx(eg,{error:i,onRetry:ve}):t.jsxs("div",{className:"space-y-6",children:[t.jsx(tg,{onTriggerBuild:A,onCreatePipeline:P}),t.jsx(ug,{stats:E,onRefresh:L,loading:s}),t.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[t.jsx("div",{className:"lg:col-span-2",children:t.jsx(dg,{builds:j,selectedBuild:p,onBuildSelect:O,filters:y,onFiltersChange:k})}),t.jsx("div",{className:"lg:col-span-1",children:t.jsx(mg,{pipelines:h,onPipelineSelect:M,onPipelineToggle:R})})]}),t.jsx(hg,{build:I,onClose:()=>x(null),onCancel:$,onRetry:J}),j.length===0&&u.length>0&&t.jsxs("div",{className:"text-center py-12",children:[t.jsx("div",{className:"text-gray-400 text-6xl mb-4",children:"🔨"}),t.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-2",children:"No builds found"}),t.jsx("p",{className:"text-gray-600 mb-4",children:"No builds match your current filters. Try adjusting your search criteria."}),t.jsx("button",{onClick:()=>k({package:"all",status:"all",pipeline:"all",dateRange:"all"}),className:"text-blue-600 hover:text-blue-500",children:"Clear Filters"})]}),u.length===0&&!s&&t.jsxs("div",{className:"text-center py-12",children:[t.jsx("div",{className:"text-gray-400 text-6xl mb-4",children:t.jsx(Tn,{className:"w-6 h-6 text-primary-600"})}),t.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-2",children:"No CI/CD data available"}),t.jsx("p",{className:"text-gray-600 mb-4",children:"Get started by triggering your first build or setting up a pipeline."}),t.jsxs("div",{className:"flex justify-center space-x-4",children:[t.jsx("button",{onClick:A,className:"bg-green-600 text-white px-4 py-2 rounded-lg hover:bg-green-700 transition-colors",children:"Trigger Build"}),t.jsx("button",{onClick:P,className:"bg-blue-600 text-white px-4 py-2 rounded-lg hover:bg-blue-700 transition-colors",children:"Create Pipeline"})]})]})]})}function pg({message:s="Loading configuration files..."}){return t.jsx("div",{className:"flex items-center justify-center h-64",children:t.jsxs("div",{className:"text-center",children:[t.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-blue-600 mx-auto"}),t.jsx("p",{className:"mt-4 text-gray-600",children:s})]})})}function gg({error:s,onRetry:l}){return t.jsx("div",{className:"flex items-center justify-center h-64",children:t.jsxs("div",{className:"text-center",children:[t.jsx(Je,{className:"w-12 h-12 text-red-500 mx-auto"}),t.jsx("p",{className:"mt-4 text-red-600",children:s}),l&&t.jsx("button",{onClick:l,className:"mt-4 bg-blue-600 text-white px-4 py-2 rounded-lg hover:bg-blue-700 transition-colors",children:"Retry"})]})})}function yg({onRefresh:s,loading:l=!1}){return t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{children:[t.jsx("h1",{className:"text-2xl font-bold text-gray-900",children:"Configuration Inspector"}),t.jsx("p",{className:"text-gray-600 mt-1",children:"View and manage configuration files across your monorepo"})]}),s&&t.jsxs("button",{onClick:s,disabled:l,className:"bg-blue-600 text-white px-4 py-2 rounded-lg hover:bg-blue-700 disabled:opacity-50 disabled:cursor-not-allowed flex items-center space-x-2 transition-colors",children:[t.jsx(sr,{className:`w-5 h-5 ${l?"animate-spin":""}`}),t.jsx("span",{children:"Refresh"})]})]})}function Vm(s){return typeof s>"u"||s===null}function vg(s){return typeof s=="object"&&s!==null}function jg(s){return Array.isArray(s)?s:Vm(s)?[]:[s]}function wg(s,l){var i,o,u,m;if(l)for(m=Object.keys(l),i=0,o=m.length;i<o;i+=1)u=m[i],s[u]=l[u];return s}function Ng(s,l){var i="",o;for(o=0;o<l;o+=1)i+=s;return i}function bg(s){return s===0&&Number.NEGATIVE_INFINITY===1/s}var Sg=Vm,kg=vg,Cg=jg,Eg=Ng,Tg=bg,Pg=wg,qo={isNothing:Sg,isObject:kg,toArray:Cg,repeat:Eg,isNegativeZero:Tg,extend:Pg};function Wm(s,l){var i="",o=s.reason||"(unknown reason)";return s.mark?(s.mark.name&&(i+='in "'+s.mark.name+'" '),i+="("+(s.mark.line+1)+":"+(s.mark.column+1)+")",!l&&s.mark.snippet&&(i+=`
|
|
9
|
+
|
|
10
|
+
`+s.mark.snippet),o+" "+i):o}function ll(s,l){Error.call(this),this.name="YAMLException",this.reason=s,this.mark=l,this.message=Wm(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}ll.prototype=Object.create(Error.prototype);ll.prototype.constructor=ll;ll.prototype.toString=function(l){return this.name+": "+Wm(this,l)};var kr=ll,_g=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],Lg=["scalar","sequence","mapping"];function Ag(s){var l={};return s!==null&&Object.keys(s).forEach(function(i){s[i].forEach(function(o){l[String(o)]=i})}),l}function Rg(s,l){if(l=l||{},Object.keys(l).forEach(function(i){if(_g.indexOf(i)===-1)throw new kr('Unknown option "'+i+'" is met in definition of "'+s+'" YAML type.')}),this.options=l,this.tag=s,this.kind=l.kind||null,this.resolve=l.resolve||function(){return!0},this.construct=l.construct||function(i){return i},this.instanceOf=l.instanceOf||null,this.predicate=l.predicate||null,this.represent=l.represent||null,this.representName=l.representName||null,this.defaultStyle=l.defaultStyle||null,this.multi=l.multi||!1,this.styleAliases=Ag(l.styleAliases||null),Lg.indexOf(this.kind)===-1)throw new kr('Unknown kind "'+this.kind+'" is specified for "'+s+'" YAML type.')}var ot=Rg;function qd(s,l){var i=[];return s[l].forEach(function(o){var u=i.length;i.forEach(function(m,h){m.tag===o.tag&&m.kind===o.kind&&m.multi===o.multi&&(u=h)}),i[u]=o}),i}function Mg(){var s={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},l,i;function o(u){u.multi?(s.multi[u.kind].push(u),s.multi.fallback.push(u)):s[u.kind][u.tag]=s.fallback[u.tag]=u}for(l=0,i=arguments.length;l<i;l+=1)arguments[l].forEach(o);return s}function Ro(s){return this.extend(s)}Ro.prototype.extend=function(l){var i=[],o=[];if(l instanceof ot)o.push(l);else if(Array.isArray(l))o=o.concat(l);else if(l&&(Array.isArray(l.implicit)||Array.isArray(l.explicit)))l.implicit&&(i=i.concat(l.implicit)),l.explicit&&(o=o.concat(l.explicit));else throw new kr("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");i.forEach(function(m){if(!(m instanceof ot))throw new kr("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(m.loadKind&&m.loadKind!=="scalar")throw new kr("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(m.multi)throw new kr("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),o.forEach(function(m){if(!(m instanceof ot))throw new kr("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var u=Object.create(Ro.prototype);return u.implicit=(this.implicit||[]).concat(i),u.explicit=(this.explicit||[]).concat(o),u.compiledImplicit=qd(u,"implicit"),u.compiledExplicit=qd(u,"explicit"),u.compiledTypeMap=Mg(u.compiledImplicit,u.compiledExplicit),u};var Ig=Ro,Og=new ot("tag:yaml.org,2002:str",{kind:"scalar",construct:function(s){return s!==null?s:""}}),Dg=new ot("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(s){return s!==null?s:[]}}),Fg=new ot("tag:yaml.org,2002:map",{kind:"mapping",construct:function(s){return s!==null?s:{}}}),zg=new Ig({explicit:[Og,Dg,Fg]});function $g(s){if(s===null)return!0;var l=s.length;return l===1&&s==="~"||l===4&&(s==="null"||s==="Null"||s==="NULL")}function Bg(){return null}function Ug(s){return s===null}var Hg=new ot("tag:yaml.org,2002:null",{kind:"scalar",resolve:$g,construct:Bg,predicate:Ug,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});function Vg(s){if(s===null)return!1;var l=s.length;return l===4&&(s==="true"||s==="True"||s==="TRUE")||l===5&&(s==="false"||s==="False"||s==="FALSE")}function Wg(s){return s==="true"||s==="True"||s==="TRUE"}function Gg(s){return Object.prototype.toString.call(s)==="[object Boolean]"}var Yg=new ot("tag:yaml.org,2002:bool",{kind:"scalar",resolve:Vg,construct:Wg,predicate:Gg,represent:{lowercase:function(s){return s?"true":"false"},uppercase:function(s){return s?"TRUE":"FALSE"},camelcase:function(s){return s?"True":"False"}},defaultStyle:"lowercase"});function Qg(s){return 48<=s&&s<=57||65<=s&&s<=70||97<=s&&s<=102}function Kg(s){return 48<=s&&s<=55}function Xg(s){return 48<=s&&s<=57}function Zg(s){if(s===null)return!1;var l=s.length,i=0,o=!1,u;if(!l)return!1;if(u=s[i],(u==="-"||u==="+")&&(u=s[++i]),u==="0"){if(i+1===l)return!0;if(u=s[++i],u==="b"){for(i++;i<l;i++)if(u=s[i],u!=="_"){if(u!=="0"&&u!=="1")return!1;o=!0}return o&&u!=="_"}if(u==="x"){for(i++;i<l;i++)if(u=s[i],u!=="_"){if(!Qg(s.charCodeAt(i)))return!1;o=!0}return o&&u!=="_"}if(u==="o"){for(i++;i<l;i++)if(u=s[i],u!=="_"){if(!Kg(s.charCodeAt(i)))return!1;o=!0}return o&&u!=="_"}}if(u==="_")return!1;for(;i<l;i++)if(u=s[i],u!=="_"){if(!Xg(s.charCodeAt(i)))return!1;o=!0}return!(!o||u==="_")}function Jg(s){var l=s,i=1,o;if(l.indexOf("_")!==-1&&(l=l.replace(/_/g,"")),o=l[0],(o==="-"||o==="+")&&(o==="-"&&(i=-1),l=l.slice(1),o=l[0]),l==="0")return 0;if(o==="0"){if(l[1]==="b")return i*parseInt(l.slice(2),2);if(l[1]==="x")return i*parseInt(l.slice(2),16);if(l[1]==="o")return i*parseInt(l.slice(2),8)}return i*parseInt(l,10)}function qg(s){return Object.prototype.toString.call(s)==="[object Number]"&&s%1===0&&!qo.isNegativeZero(s)}var ey=new ot("tag:yaml.org,2002:int",{kind:"scalar",resolve:Zg,construct:Jg,predicate:qg,represent:{binary:function(s){return s>=0?"0b"+s.toString(2):"-0b"+s.toString(2).slice(1)},octal:function(s){return s>=0?"0o"+s.toString(8):"-0o"+s.toString(8).slice(1)},decimal:function(s){return s.toString(10)},hexadecimal:function(s){return s>=0?"0x"+s.toString(16).toUpperCase():"-0x"+s.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),ty=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function ny(s){return!(s===null||!ty.test(s)||s[s.length-1]==="_")}function ry(s){var l,i;return l=s.replace(/_/g,"").toLowerCase(),i=l[0]==="-"?-1:1,"+-".indexOf(l[0])>=0&&(l=l.slice(1)),l===".inf"?i===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:l===".nan"?NaN:i*parseFloat(l,10)}var sy=/^[-+]?[0-9]+e/;function ly(s,l){var i;if(isNaN(s))switch(l){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===s)switch(l){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===s)switch(l){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(qo.isNegativeZero(s))return"-0.0";return i=s.toString(10),sy.test(i)?i.replace("e",".e"):i}function ay(s){return Object.prototype.toString.call(s)==="[object Number]"&&(s%1!==0||qo.isNegativeZero(s))}var iy=new ot("tag:yaml.org,2002:float",{kind:"scalar",resolve:ny,construct:ry,predicate:ay,represent:ly,defaultStyle:"lowercase"}),oy=zg.extend({implicit:[Hg,Yg,ey,iy]}),cy=oy,Gm=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),Ym=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function uy(s){return s===null?!1:Gm.exec(s)!==null||Ym.exec(s)!==null}function dy(s){var l,i,o,u,m,h,p,x=0,y=null,k,j,E;if(l=Gm.exec(s),l===null&&(l=Ym.exec(s)),l===null)throw new Error("Date resolve error");if(i=+l[1],o=+l[2]-1,u=+l[3],!l[4])return new Date(Date.UTC(i,o,u));if(m=+l[4],h=+l[5],p=+l[6],l[7]){for(x=l[7].slice(0,3);x.length<3;)x+="0";x=+x}return l[9]&&(k=+l[10],j=+(l[11]||0),y=(k*60+j)*6e4,l[9]==="-"&&(y=-y)),E=new Date(Date.UTC(i,o,u,m,h,p,x)),y&&E.setTime(E.getTime()-y),E}function my(s){return s.toISOString()}var hy=new ot("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:uy,construct:dy,instanceOf:Date,represent:my});function fy(s){return s==="<<"||s===null}var xy=new ot("tag:yaml.org,2002:merge",{kind:"scalar",resolve:fy}),ec=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
|
|
11
|
+
\r`;function py(s){if(s===null)return!1;var l,i,o=0,u=s.length,m=ec;for(i=0;i<u;i++)if(l=m.indexOf(s.charAt(i)),!(l>64)){if(l<0)return!1;o+=6}return o%8===0}function gy(s){var l,i,o=s.replace(/[\r\n=]/g,""),u=o.length,m=ec,h=0,p=[];for(l=0;l<u;l++)l%4===0&&l&&(p.push(h>>16&255),p.push(h>>8&255),p.push(h&255)),h=h<<6|m.indexOf(o.charAt(l));return i=u%4*6,i===0?(p.push(h>>16&255),p.push(h>>8&255),p.push(h&255)):i===18?(p.push(h>>10&255),p.push(h>>2&255)):i===12&&p.push(h>>4&255),new Uint8Array(p)}function yy(s){var l="",i=0,o,u,m=s.length,h=ec;for(o=0;o<m;o++)o%3===0&&o&&(l+=h[i>>18&63],l+=h[i>>12&63],l+=h[i>>6&63],l+=h[i&63]),i=(i<<8)+s[o];return u=m%3,u===0?(l+=h[i>>18&63],l+=h[i>>12&63],l+=h[i>>6&63],l+=h[i&63]):u===2?(l+=h[i>>10&63],l+=h[i>>4&63],l+=h[i<<2&63],l+=h[64]):u===1&&(l+=h[i>>2&63],l+=h[i<<4&63],l+=h[64],l+=h[64]),l}function vy(s){return Object.prototype.toString.call(s)==="[object Uint8Array]"}var jy=new ot("tag:yaml.org,2002:binary",{kind:"scalar",resolve:py,construct:gy,predicate:vy,represent:yy}),wy=Object.prototype.hasOwnProperty,Ny=Object.prototype.toString;function by(s){if(s===null)return!0;var l=[],i,o,u,m,h,p=s;for(i=0,o=p.length;i<o;i+=1){if(u=p[i],h=!1,Ny.call(u)!=="[object Object]")return!1;for(m in u)if(wy.call(u,m))if(!h)h=!0;else return!1;if(!h)return!1;if(l.indexOf(m)===-1)l.push(m);else return!1}return!0}function Sy(s){return s!==null?s:[]}var ky=new ot("tag:yaml.org,2002:omap",{kind:"sequence",resolve:by,construct:Sy}),Cy=Object.prototype.toString;function Ey(s){if(s===null)return!0;var l,i,o,u,m,h=s;for(m=new Array(h.length),l=0,i=h.length;l<i;l+=1){if(o=h[l],Cy.call(o)!=="[object Object]"||(u=Object.keys(o),u.length!==1))return!1;m[l]=[u[0],o[u[0]]]}return!0}function Ty(s){if(s===null)return[];var l,i,o,u,m,h=s;for(m=new Array(h.length),l=0,i=h.length;l<i;l+=1)o=h[l],u=Object.keys(o),m[l]=[u[0],o[u[0]]];return m}var Py=new ot("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:Ey,construct:Ty}),_y=Object.prototype.hasOwnProperty;function Ly(s){if(s===null)return!0;var l,i=s;for(l in i)if(_y.call(i,l)&&i[l]!==null)return!1;return!0}function Ay(s){return s!==null?s:{}}var Ry=new ot("tag:yaml.org,2002:set",{kind:"mapping",resolve:Ly,construct:Ay});cy.extend({implicit:[hy,xy],explicit:[jy,ky,Py,Ry]});function em(s){return s===48?"\0":s===97?"\x07":s===98?"\b":s===116||s===9?" ":s===110?`
|
|
12
|
+
`:s===118?"\v":s===102?"\f":s===114?"\r":s===101?"\x1B":s===32?" ":s===34?'"':s===47?"/":s===92?"\\":s===78?"
":s===95?" ":s===76?"\u2028":s===80?"\u2029":""}var My=new Array(256),Iy=new Array(256);for(var ns=0;ns<256;ns++)My[ns]=em(ns)?1:0,Iy[ns]=em(ns);const Oy=s=>{switch(s){case"workspace":return"bg-blue-100 text-blue-800";case"package":return"bg-green-100 text-green-800";case"environment":return"bg-purple-100 text-purple-800";case"tool":return"bg-orange-100 text-orange-800";default:return"bg-gray-100 text-gray-800"}},tm=s=>{switch(s){case"valid":return"bg-green-100 text-green-800";case"warning":return"bg-yellow-100 text-yellow-800";case"error":return"bg-red-100 text-red-800";default:return"bg-gray-100 text-gray-800"}},Dy=(s,l)=>s.filter(i=>{const o=l.section==="all"||i.id===l.section,u=l.type==="all"||i.type===l.type,m=l.status==="all"||l.status==="secrets"&&i.hasSecrets||l.status==="standard"&&!i.hasSecrets,h=!l.search||i.name.toLowerCase().includes(l.search.toLowerCase())||i.path.toLowerCase().includes(l.search.toLowerCase());return o&&u&&m&&h}),Fy=s=>[...new Set(s.map(l=>l.type))],zy=s=>{if(s===0)return"0 Bytes";const l=1024,i=["Bytes","KB","MB","GB"],o=Math.floor(Math.log(s)/Math.log(l));return parseFloat((s/Math.pow(l,o)).toFixed(2))+" "+i[o]},$y=s=>new Date(s).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}),Qm=s=>{const l=s.split(".").pop()?.toLowerCase(),i={json:"json",yaml:"yaml",yml:"yaml",js:"javascript",mjs:"javascript",cjs:"javascript",ts:"typescript",mts:"typescript",cts:"typescript",env:"env",config:"text",rc:"text",lock:"text",md:"markdown",txt:"text"};return s==="package.json"?"json":s==="docker-compose.yml"||s==="docker-compose.yaml"?"yaml":s===".eslintrc.js"||s===".prettierrc.js"?"javascript":s==="tsconfig.json"?"json":i[l||""]||"text"},By=s=>{const l=[/^([A-Z_]+(?:PASSWORD|SECRET|KEY|TOKEN|AUTH)[A-Z_]*)\s*=\s*(.+)$/gim,/"([^"]*(?:password|secret|key|token|auth)[^"]*)"\s*:\s*"([^"]+)"/gi,/^(\s*[^:\s]*(?:password|secret|key|token|auth)[^:\s]*)\s*:\s*(.+)$/gim];let i=s;return l.forEach(o=>{i=i.replace(o,(u,m,h)=>{const p="*".repeat(Math.min(h.length,8));return u.replace(h,p)})}),i},Uy=s=>{switch(Qm(s)){case"json":return t.jsx(Sa,{className:"w-6 h-6 text-primary-600"});case"yaml":return t.jsx(Sa,{className:"w-6 h-6 text-primary-600"});case"javascript":case"typescript":return t.jsx(Cr,{className:"w-6 h-6 text-primary-600"});case"env":return"🔐";case"markdown":return"📝";default:return t.jsx(Yo,{className:"w-6 h-6 text-primary-600"})}};function Hy({configs:s,selectedConfig:l,onConfigSelect:i,filters:o,onFiltersChange:u}){const m=Fy(s);return t.jsxs("div",{className:"bg-white rounded-lg shadow border h-full flex flex-col max-h-[calc(100vh-180px)]",children:[t.jsxs("div",{className:"p-4 border-b border-gray-200",children:[t.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-4",children:"Configuration Files"}),t.jsxs("div",{className:"relative mb-4",children:[t.jsx(Xo,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400 h-4 w-4"}),t.jsx("input",{type:"text",placeholder:"Search config files...",value:o.search,onChange:h=>u({...o,search:h.target.value}),className:"w-full pl-10 pr-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent text-sm"})]}),t.jsxs("div",{className:"space-y-3",children:[t.jsxs("div",{className:"flex items-center space-x-2",children:[t.jsx(Ra,{className:"h-4 w-4 text-gray-400"}),t.jsxs("select",{value:o.type,onChange:h=>u({...o,type:h.target.value}),className:"flex-1 border border-gray-300 rounded-md px-3 py-1 text-sm focus:ring-2 focus:ring-blue-500 focus:border-transparent",children:[t.jsx("option",{value:"all",children:"All Types"}),m.map(h=>t.jsx("option",{value:h,children:h.charAt(0).toUpperCase()+h.slice(1)},h))]})]}),t.jsxs("select",{value:o.status,onChange:h=>u({...o,status:h.target.value}),className:"w-full border border-gray-300 rounded-md px-3 py-1 text-sm focus:ring-2 focus:ring-blue-500 focus:border-transparent",children:[t.jsx("option",{value:"all",children:"All Files"}),t.jsx("option",{value:"standard",children:"Standard Files"}),t.jsx("option",{value:"secrets",children:"Files with Secrets"})]})]})]}),t.jsx("div",{className:"flex-1 overflow-y-auto",children:s.length===0?t.jsxs("div",{className:"p-4 text-center text-gray-500",children:[t.jsx("div",{className:"text-4xl mb-2",children:t.jsx(Yo,{className:"w-6 h-6 text-primary-600"})}),t.jsx("p",{className:"text-sm",children:"No configuration files found"})]}):t.jsx("div",{className:"p-2",children:s.map(h=>t.jsx("button",{onClick:()=>i(h.id),className:`w-full text-left p-3 rounded-lg mb-2 transition-colors ${l===h.id?"bg-blue-50 border border-blue-200":"hover:bg-gray-50 border border-transparent"}`,children:t.jsxs("div",{className:"flex items-start space-x-3",children:[t.jsx("div",{className:"text-2xl",children:Uy(h.name)}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsxs("div",{className:"flex items-center space-x-2 mb-1",children:[t.jsx("p",{className:"text-sm font-medium text-gray-900 truncate",children:h.name}),h.hasSecrets&&t.jsx("span",{className:"inline-flex items-center px-1.5 py-0.5 rounded text-xs font-medium bg-yellow-100 text-yellow-800",children:"🔒"})]}),t.jsx("p",{className:"text-xs text-gray-500 truncate mb-1",children:h.path}),t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("span",{className:`inline-flex px-2 py-0.5 text-xs font-semibold rounded-full ${Oy(h.type)}`,children:h.type}),t.jsx("span",{className:"text-xs text-gray-400",children:zy(h.size)})]}),t.jsx("p",{className:"text-xs text-gray-400 mt-1",children:$y(h.lastModified)})]})]})},h.id))})}),t.jsx("div",{className:"p-4 border-t border-gray-200",children:t.jsxs("div",{className:"text-xs text-gray-500",children:[s.length," file",s.length!==1?"s":""," found"]})})]})}function Vy({isEditing:s,canEdit:l,hasSecrets:i,showSecrets:o,saving:u,onStartEdit:m,onSaveEdit:h,onCancelEdit:p,onToggleSecrets:x,onRefresh:y,content:k}){const[j,E]=v.useState(!1),I=async()=>{try{const L=k||"No content available";await navigator.clipboard.writeText(L),E(!0),setTimeout(()=>{E(!1)},4e3)}catch(L){console.error("Failed to copy to clipboard:",L),E(!0),setTimeout(()=>E(!1),2e3)}};return u?t.jsxs("div",{className:"flex items-center justify-between p-4 bg-gray-50 border-b border-gray-200",children:[t.jsx("div",{className:"flex items-center space-x-2",children:t.jsxs("div",{className:"inline-flex items-center px-3 py-1.5 text-sm font-medium text-orange-600 bg-white border border-gray-300 rounded-lg",children:[t.jsx(sr,{className:"w-4 h-4 mr-1 animate-spin"}),"Saving..."]})}),t.jsx("div",{className:"flex items-center space-x-2",children:t.jsxs("button",{onClick:y,className:"inline-flex items-center px-3 py-1.5 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-lg hover:bg-gray-50 transition-colors",children:[t.jsx(sr,{className:"w-4 h-4 mr-1"}),"Refresh"]})})]}):t.jsxs("div",{className:"flex items-center justify-between p-4 bg-gray-50 border-b border-gray-200",children:[t.jsxs("div",{className:"flex items-center space-x-2",children:[s?t.jsxs(t.Fragment,{children:[t.jsxs("button",{onClick:h,className:"inline-flex items-center px-3 py-1.5 text-sm font-medium text-white bg-green-600 rounded-lg hover:bg-green-700 transition-colors",children:[t.jsx(Vo,{className:"w-4 h-4 mr-1"}),"Save"]}),t.jsxs("button",{onClick:p,className:"inline-flex items-center px-3 py-1.5 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-lg hover:bg-gray-50 transition-colors",children:[t.jsx(al,{className:"w-4 h-4 mr-1"}),"Cancel"]})]}):l&&t.jsxs("button",{onClick:m,className:"inline-flex items-center px-3 py-1.5 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-lg hover:bg-gray-50 transition-colors",children:[t.jsx(rx,{className:"w-4 h-4 mr-1"}),"Edit"]}),i&&t.jsx("button",{onClick:x,className:`inline-flex items-center px-3 py-1.5 text-sm font-medium rounded-lg transition-colors ${o?"text-red-700 bg-red-100 hover:bg-red-200":"text-yellow-700 bg-yellow-100 hover:bg-yellow-200"}`,children:o?t.jsxs(t.Fragment,{children:[t.jsx(nx,{className:"w-4 h-4 mr-1"}),"Hide Secrets"]}):t.jsxs(t.Fragment,{children:[t.jsx(tx,{className:"w-4 h-4 mr-1"}),"Show Secrets"]})})]}),t.jsx("div",{className:"flex items-center space-x-2",children:t.jsx("button",{onClick:I,className:`inline-flex items-center px-3 py-1.5 text-sm font-medium rounded-lg transition-colors ${j?"text-green-700 bg-green-100 border border-green-300":"text-gray-700 bg-white border border-gray-300 hover:bg-gray-50"}`,children:j?t.jsxs(t.Fragment,{children:[t.jsx(ax,{className:"w-4 h-4 mr-1"}),"Copied!"]}):t.jsxs(t.Fragment,{children:[t.jsx(ix,{className:"w-4 h-4 mr-1"}),"Copy"]})})})]})}function Wy({config:s,isEditing:l,editValue:i,onStartEdit:o,onSaveEdit:u,onCancelEdit:m,onValueChange:h,showSecrets:p,onToggleSecrets:x}){if(!s)return t.jsx("div",{className:"flex items-center justify-center h-64 bg-gray-50 rounded-lg",children:t.jsxs("div",{className:"text-center",children:[t.jsx("div",{className:"text-gray-400 text-4xl mb-2",children:t.jsx(Sa,{className:"w-6 h-6 text-primary-600"})}),t.jsx("p",{className:"text-gray-500",children:"Select a configuration file to view or edit"})]})});const y=Qm(s.name),k=p?s.content:By(s.content);return t.jsxs("div",{className:"bg-white rounded-lg shadow border h-full flex flex-col",children:[t.jsx("div",{className:"p-4 border-b border-gray-200",children:t.jsxs("div",{className:"flex items-center space-x-3",children:[t.jsx("div",{className:"text-2xl",children:t.jsx(Sa,{className:"w-6 h-6 text-primary-600"})}),t.jsxs("div",{children:[t.jsx("h3",{className:"text-lg font-medium text-gray-900",children:s.name}),t.jsx("p",{className:"text-sm text-gray-500",children:s.path})]})]})}),t.jsx("div",{className:"flex-1 p-4",children:l?t.jsx("div",{className:"h-full",children:t.jsx("textarea",{value:i,onChange:j=>h(j.target.value),className:"w-full h-full font-mono text-sm border border-gray-300 rounded-lg p-4 focus:ring-2 focus:ring-blue-500 focus:border-transparent resize-none",placeholder:"Enter configuration content...",spellCheck:!1})}):t.jsx("div",{className:"h-full",children:t.jsx("pre",{className:"w-full h-full font-mono text-sm bg-gray-50 border border-gray-200 rounded-lg p-4 overflow-auto whitespace-pre-wrap",children:t.jsx("code",{className:`language-${y}`,children:k})})})}),t.jsx("div",{className:"p-4 border-t border-gray-200 bg-gray-50",children:t.jsxs("div",{className:"flex items-center justify-between text-sm text-gray-500",children:[t.jsxs("div",{className:"flex items-center space-x-4",children:[t.jsxs("span",{children:["Language: ",y.toUpperCase()]}),t.jsxs("span",{children:["Size: ",s.content.length," characters"]}),s.hasSecrets&&t.jsx("span",{className:"inline-flex items-center px-2 py-1 rounded-full text-xs font-medium bg-yellow-100 text-yellow-800",children:"🔒 Contains secrets"})]}),t.jsx("div",{children:l?t.jsx("span",{className:"text-blue-600 font-medium",children:"Editing mode"}):s.isEditable?t.jsx("span",{className:"text-green-600",children:"Editable"}):t.jsx("span",{className:"text-gray-400",children:"Read-only"})})]})})]})}function Gy({validation:s,configName:l}){const i=x=>{switch(x){case"valid":return t.jsx(Pt,{className:"w-5 h-5 text-green-500"});case"warning":return t.jsx(Je,{className:"w-5 h-5 text-yellow-500"});case"error":return t.jsx(Bt,{className:"w-5 h-5 text-red-500"});default:return t.jsx(ss,{className:"w-5 h-5 text-gray-500"})}},u=s.some(x=>x.status==="error")?"error":s.some(x=>x.status==="warning")?"warning":"valid",m=s.filter(x=>x.status==="error").length,h=s.filter(x=>x.status==="warning").length,p=s.filter(x=>x.status==="valid").length;return s.length===0?t.jsx("div",{className:"bg-white rounded-lg shadow border p-6",children:t.jsxs("div",{className:"text-center",children:[t.jsx(ss,{className:"w-8 h-8 text-gray-400 mx-auto mb-2"}),t.jsx("h3",{className:"text-sm font-medium text-gray-900 mb-1",children:"No Validation Results"}),t.jsx("p",{className:"text-sm text-gray-500",children:"Select a configuration file to see validation results."})]})}):t.jsxs("div",{className:"bg-white rounded-lg shadow border",children:[t.jsxs("div",{className:"p-4 border-b border-gray-200",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("h3",{className:"text-lg font-medium text-gray-900",children:"Validation Results"}),t.jsxs("div",{className:"flex items-center space-x-2",children:[i(u),t.jsx("span",{className:`inline-flex px-2 py-1 text-xs font-semibold rounded-full ${tm(u)}`,children:u.toUpperCase()})]})]}),t.jsxs("p",{className:"text-sm text-gray-500 mt-1",children:["Validation results for ",l]})]}),t.jsx("div",{className:"p-4 border-b border-gray-200 bg-gray-50",children:t.jsxs("div",{className:"grid grid-cols-3 gap-4 text-center",children:[t.jsxs("div",{children:[t.jsx("div",{className:"text-lg font-bold text-green-600",children:p}),t.jsx("div",{className:"text-xs text-gray-600",children:"Valid"})]}),t.jsxs("div",{children:[t.jsx("div",{className:"text-lg font-bold text-yellow-600",children:h}),t.jsx("div",{className:"text-xs text-gray-600",children:"Warnings"})]}),t.jsxs("div",{children:[t.jsx("div",{className:"text-lg font-bold text-red-600",children:m}),t.jsx("div",{className:"text-xs text-gray-600",children:"Errors"})]})]})}),t.jsx("div",{className:"p-4",children:t.jsx("div",{className:"space-y-3",children:s.map((x,y)=>t.jsx("div",{className:`p-3 rounded-lg border ${x.status==="error"?"border-red-200 bg-red-50":x.status==="warning"?"border-yellow-200 bg-yellow-50":"border-green-200 bg-green-50"}`,children:t.jsxs("div",{className:"flex items-start space-x-3",children:[i(x.status),t.jsxs("div",{className:"flex-1",children:[t.jsxs("div",{className:"flex items-center space-x-2 mb-1",children:[t.jsx("h4",{className:"text-sm font-medium text-gray-900",children:x.field}),t.jsx("span",{className:`inline-flex px-2 py-0.5 text-xs font-semibold rounded-full ${tm(x.status)}`,children:x.status})]}),t.jsx("p",{className:"text-sm text-gray-600",children:x.message})]})]})},y))})}),(m>0||h>0)&&t.jsx("div",{className:"p-4 border-t border-gray-200 bg-gray-50",children:t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{className:"text-sm text-gray-600",children:[m>0&&t.jsxs("span",{className:"text-red-600 font-medium",children:[m," error",m>1?"s":""," need attention"]}),h>0&&m===0&&t.jsxs("span",{className:"text-yellow-600 font-medium",children:[h," warning",h>1?"s":""," to review"]})]}),t.jsx("button",{className:"text-blue-600 hover:text-blue-500 text-sm font-medium",children:"View Details"})]})})]})}function Yy(){const[s,l]=v.useState(!0),[i,o]=v.useState(!1),[u,m]=v.useState(null),[h,p]=v.useState([]),[x,y]=v.useState(null),[k,j]=v.useState(!1),[E,I]=v.useState(""),[L,A]=v.useState(!1),[P,O]=v.useState({section:"all",type:"all",status:"all",search:""});v.useEffect(()=>{(async()=>{try{l(!0);const ye=(await _t.getConfigurationFiles()).map(je=>({id:je.id||je.name,name:je.name,path:je.path||je.name,type:je.type||"text",content:je.content||"",size:je.content?.length||0,lastModified:je.lastModified||new Date().toISOString(),hasSecrets:je.hasSecrets||!1,isEditable:je.isEditable!==!1,validation:je.validation||[]}));p(ye),m(null)}catch(he){m("Failed to fetch configuration files"),console.error("Error fetching config files:",he)}finally{l(!1)}})()},[]);const M=Dy(h,P),R=x&&h.find(X=>X.id===x)||null,$=()=>{window.location.reload()},J=X=>{y(X),j(!1),I("")},ve=()=>{R&&(j(!0),I(R.content))},ee=async()=>{if(R&&!i)try{o(!0),m(null);const X=await _t.saveConfigurationFile(R.id,E);p(he=>he.map(ye=>ye.id===x?{...X,isEditable:ye.isEditable}:ye)),x===R.id&&y(R.id),j(!1),I("")}catch(X){console.error("Error saving config file:",X),m(`Failed to save configuration: ${X.message}`)}finally{o(!1)}},pe=()=>{j(!1),I("")},xe=()=>{A(!L)},we=()=>{window.location.reload()};return s?t.jsx(pg,{}):u?t.jsx(gg,{error:u,onRetry:we}):t.jsxs("div",{className:"space-y-6",children:[t.jsx(yg,{onRefresh:$,loading:s}),t.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-4 gap-6 h-[800px]",children:[t.jsx("div",{className:"lg:col-span-1",children:t.jsx(Hy,{configs:M,selectedConfig:x,onConfigSelect:J,filters:P,onFiltersChange:O})}),t.jsxs("div",{className:"lg:col-span-2 flex flex-col",children:[R&&t.jsx("div",{className:"mb-4",children:t.jsx(Vy,{isEditing:k,canEdit:R.isEditable,hasSecrets:R.hasSecrets,showSecrets:L,saving:i,onStartEdit:ve,onSaveEdit:ee,onCancelEdit:pe,onToggleSecrets:xe,onRefresh:$,content:k?E:R?.content})}),t.jsx("div",{className:"flex-1",children:t.jsx(Wy,{config:R,isEditing:k,editValue:E,saving:i,onStartEdit:ve,onSaveEdit:ee,onCancelEdit:pe,onValueChange:I,showSecrets:L,onToggleSecrets:xe})})]}),t.jsx("div",{className:"lg:col-span-1 space-y-6",children:t.jsx(Gy,{validation:R?.validation||[],configName:R?.name||"No file selected"})})]}),M.length===0&&!s&&t.jsxs("div",{className:"text-center py-12",children:[t.jsx("div",{className:"flex justify-center text-gray-400 text-6xl mb-4",children:t.jsx(Yo,{className:"w-6 h-6 text-primary-600"})}),t.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-2",children:"No configuration files found"}),t.jsx("p",{className:"text-gray-600 mb-4",children:P.search||P.type!=="all"||P.status!=="all"?"Try adjusting your filters to see more results.":"No configuration files are available to inspect."}),(P.search||P.type!=="all"||P.status!=="all")&&t.jsx("button",{onClick:()=>O({section:"all",type:"all",status:"all",search:""}),className:"text-blue-600 hover:text-blue-500",children:"Clear Filters"})]})]})}function Qy({packages:s,onConfirm:l,loading:i}){const[o,u]=v.useState(new Set),[m,h]=v.useState(""),p=v.useMemo(()=>s.filter(j=>!j.private&&j.name.toLowerCase().includes(m.toLowerCase())),[s,m]),x=j=>{const E=new Set(o);E.has(j)?E.delete(j):E.add(j),u(E)},y=()=>{o.size===p.length?u(new Set):u(new Set(p.map(j=>j.name)))},k=()=>{const j=s.filter(E=>o.has(E.name));l(j)};return t.jsxs("div",{className:"bg-white rounded-lg shadow p-6 space-y-6",children:[t.jsxs("div",{children:[t.jsx("h2",{className:"text-2xl font-bold text-gray-900 mb-2",children:"Step 1: Select Packages"}),t.jsx("p",{className:"text-gray-600",children:"Choose which packages you want to release. You can select multiple packages."})]}),t.jsxs("div",{children:[t.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Search Packages"}),t.jsx("input",{type:"text",value:m,onChange:j=>h(j.target.value),placeholder:"Search by package name...",className:"w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-primary-500 focus:border-transparent"})]}),t.jsxs("div",{children:[t.jsxs("div",{className:"flex items-center justify-between mb-4",children:[t.jsxs("label",{className:"text-sm font-medium text-gray-700",children:["Available Packages (",p.length,")"]}),p.length>0&&t.jsx("button",{onClick:y,className:"text-sm text-primary-600 hover:text-primary-700 font-medium",children:o.size===p.length?"Deselect All":"Select All"})]}),t.jsx("div",{className:"border border-gray-200 rounded-lg divide-y max-h-96 overflow-y-auto",children:p.length===0?t.jsx("div",{className:"p-4 text-center text-gray-500",children:"No packages found"}):p.map(j=>t.jsx("div",{className:"p-4 hover:bg-gray-50 cursor-pointer transition",onClick:()=>x(j.name),children:t.jsxs("div",{className:"flex items-center space-x-3",children:[t.jsx("input",{type:"checkbox",checked:o.has(j.name),onChange:()=>x(j.name),className:"w-4 h-4 text-primary-600 rounded focus:ring-2 focus:ring-primary-500"}),t.jsxs("div",{className:"flex-1",children:[t.jsx("p",{className:"font-medium text-gray-900",children:j.name}),t.jsxs("p",{className:"text-sm text-gray-500",children:["Current: v",j.version]})]}),j.dependencies&&j.dependencies.length>0&&t.jsxs("span",{className:"inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-blue-100 text-blue-800",children:[j.dependencies.length," deps"]})]})},j.name))})]}),t.jsx("div",{className:"flex gap-3 justify-end",children:t.jsxs("button",{onClick:k,disabled:o.size===0||i,className:"px-6 py-2 bg-primary-600 text-white rounded-lg font-medium hover:bg-primary-700 disabled:opacity-50 disabled:cursor-not-allowed transition",children:["Continue (",o.size," selected)"]})})]})}const Ky={major:"Breaking changes, incompatible API changes",minor:"New features, backward compatible",patch:"Bug fixes, patches, backward compatible"};function Xy({packages:s,onConfirm:l,onBack:i}){const[o,u]=v.useState(s.reduce((x,y)=>({...x,[y.name]:y.bumpType}),{})),m=(x,y)=>{const k=x.split(".").map(Number);return y==="major"?`${k[0]+1}.0.0`:y==="minor"?`${k[0]}.${k[1]+1}.0`:`${k[0]}.${k[1]}.${k[2]+1}`},h=(x,y)=>{u(k=>({...k,[x]:y}))},p=()=>{const x=s.map(y=>({...y,bumpType:o[y.name],newVersion:m(y.currentVersion,o[y.name])}));l(x)};return t.jsxs("div",{className:"bg-white rounded-lg shadow p-6 space-y-6",children:[t.jsxs("div",{children:[t.jsx("h2",{className:"text-2xl font-bold text-gray-900 mb-2",children:"Step 2: Select Version Bumps"}),t.jsx("p",{className:"text-gray-600",children:"Choose the version bump type for each package. This determines the new version number."})]}),t.jsx("div",{className:"grid grid-cols-3 gap-4",children:Object.entries(Ky).map(([x,y])=>t.jsxs("div",{className:"p-4 bg-gray-50 rounded-lg",children:[t.jsx("p",{className:"font-medium text-gray-900 capitalize mb-1",children:x}),t.jsx("p",{className:"text-sm text-gray-600",children:y})]},x))}),t.jsx("div",{className:"space-y-4",children:s.map(x=>t.jsxs("div",{className:"border border-gray-200 rounded-lg p-4",children:[t.jsxs("div",{className:"flex items-center justify-between mb-4",children:[t.jsxs("div",{children:[t.jsx("p",{className:"font-medium text-gray-900",children:x.name}),t.jsxs("p",{className:"text-sm text-gray-500",children:["Current: v",x.currentVersion]})]}),t.jsxs("div",{className:"text-right",children:[t.jsx("p",{className:"text-sm text-gray-500",children:"New Version:"}),t.jsxs("p",{className:"text-lg font-bold text-primary-600",children:["v",m(x.currentVersion,o[x.name])]})]})]}),t.jsx("div",{className:"grid grid-cols-3 gap-3",children:["major","minor","patch"].map(y=>t.jsx("button",{onClick:()=>h(x.name,y),className:`p-3 rounded-lg border-2 transition font-medium text-sm ${o[x.name]===y?"border-primary-600 bg-primary-50 text-primary-700":"border-gray-200 bg-white text-gray-700 hover:border-gray-300"}`,children:t.jsx("span",{className:"capitalize",children:y})},y))}),x.affectedDependencies.length>0&&t.jsxs("div",{className:"mt-4 p-3 bg-blue-50 rounded-lg",children:[t.jsxs("p",{className:"text-sm font-medium text-blue-900",children:["ℹ️ ",x.affectedDependencies.length," dependent package(s)"]}),t.jsx("p",{className:"text-xs text-blue-700 mt-1",children:"Will be auto-bumped when this package is released"})]})]},x.name))}),t.jsxs("div",{className:"flex gap-3 justify-end",children:[t.jsx("button",{onClick:i,className:"px-6 py-2 border border-gray-300 text-gray-700 rounded-lg font-medium hover:bg-gray-50 transition",children:"Back"}),t.jsx("button",{onClick:p,className:"px-6 py-2 bg-primary-600 text-white rounded-lg font-medium hover:bg-primary-700 transition",children:"Continue"})]})]})}function Zy({packages:s,existingChangesets:l,onConfirm:i,onBack:o,loading:u}){const[m,h]=v.useState(""),[p,x]=v.useState([]),y=()=>{const j=[];return m.trim()||j.push("Please enter a changelog summary"),m.trim().length<10&&j.push("Summary must be at least 10 characters"),x(j),j.length===0},k=()=>{y()&&i(m)};return t.jsxs("div",{className:"bg-white rounded-lg shadow p-6 space-y-6",children:[t.jsxs("div",{children:[t.jsx("h2",{className:"text-2xl font-bold text-gray-900 mb-2",children:"Step 3: Preview Changeset"}),t.jsx("p",{className:"text-gray-600",children:"Review the changeset that will be created. Enter a summary of the changes."})]}),t.jsxs("div",{children:[t.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Changelog Summary"}),t.jsx("textarea",{value:m,onChange:j=>h(j.target.value),placeholder:"Describe the changes in this release (e.g., 'Add new API endpoints for user management')",rows:4,className:"w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-primary-500 focus:border-transparent font-mono text-sm"}),p.length>0&&t.jsx("div",{className:"mt-2 space-y-1",children:p.map((j,E)=>t.jsxs("p",{className:"text-sm text-red-600",children:["✗ ",j]},E))})]}),t.jsxs("div",{className:"border-t pt-6",children:[t.jsx("h3",{className:"text-lg font-bold text-gray-900 mb-4",children:"Packages to Release"}),t.jsx("div",{className:"space-y-3",children:s.map(j=>t.jsxs("div",{className:"flex items-center justify-between p-3 bg-gray-50 rounded-lg",children:[t.jsxs("div",{children:[t.jsx("p",{className:"font-medium text-gray-900",children:j.name}),t.jsxs("p",{className:"text-sm text-gray-500",children:[j.currentVersion," → ",j.newVersion]})]}),t.jsx("div",{className:"text-right",children:t.jsx("span",{className:"inline-flex items-center px-3 py-1 rounded-full text-sm font-medium bg-primary-100 text-primary-800",children:j.bumpType.charAt(0).toUpperCase()+j.bumpType.slice(1)})})]},j.name))})]}),l.length>0&&t.jsxs("div",{className:"p-4 bg-yellow-50 border border-yellow-200 rounded-lg",children:[t.jsx("p",{className:"text-yellow-800 font-medium",children:"⚠️ Unpublished Changesets"}),t.jsxs("p",{className:"text-yellow-700 text-sm mt-1",children:["There are ",l.length," existing unpublished changeset(s). Creating new ones will accumulate until published."]})]}),t.jsxs("div",{className:"flex gap-3 justify-end",children:[t.jsx("button",{onClick:o,className:"px-6 py-2 border border-gray-300 text-gray-700 rounded-lg font-medium hover:bg-gray-50 transition",disabled:u,children:"Back"}),t.jsx("button",{onClick:k,disabled:u||p.length>0,className:"px-6 py-2 bg-primary-600 text-white rounded-lg font-medium hover:bg-primary-700 disabled:opacity-50 disabled:cursor-not-allowed transition",children:u?"Processing...":"Continue to Validation"})]})]})}function Jy({validation:s,packages:l,onConfirm:i,onBack:o,loading:u}){const m=[{name:"User Permissions",passed:s.checks.permissions},{name:"Working Tree Clean",passed:s.checks.workingTreeClean},{name:"CI Tests Passing",passed:s.checks.ciPassing},{name:"Version Available on npm",passed:s.checks.versionAvailable}];return t.jsxs("div",{className:"bg-white rounded-lg shadow p-6 space-y-6",children:[t.jsxs("div",{children:[t.jsx("h2",{className:"text-2xl font-bold text-gray-900 mb-2",children:"Step 4: Validate Release"}),t.jsx("p",{className:"text-gray-600",children:"Checking if the release is safe to proceed. All checks must pass."})]}),t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsxs("div",{className:`p-4 rounded-lg ${s.isValid?"bg-green-50":"bg-red-50"}`,children:[t.jsx("p",{className:`font-medium ${s.isValid?"text-green-900":"text-red-900"}`,children:s.isValid?"✓ Ready to Release":"✗ Not Ready"}),t.jsx("p",{className:`text-sm mt-1 ${s.isValid?"text-green-700":"text-red-700"}`,children:s.isValid?"All checks passed. Safe to proceed.":`${s.errors.length} error(s) need resolution`})]}),t.jsxs("div",{className:"p-4 bg-blue-50 rounded-lg",children:[t.jsx("p",{className:"font-medium text-blue-900",children:"Release Summary"}),t.jsxs("p",{className:"text-sm text-blue-700 mt-1",children:[l.length," package(s) will be released"]})]})]}),t.jsxs("div",{className:"border-t pt-6",children:[t.jsx("h3",{className:"text-lg font-bold text-gray-900 mb-4",children:"Pre-release Checks"}),t.jsx("div",{className:"space-y-3",children:m.map((h,p)=>t.jsxs("div",{className:`flex items-center space-x-3 p-3 rounded-lg ${h.passed?"bg-green-50":"bg-red-50"}`,children:[t.jsx("div",{className:`flex-shrink-0 w-6 h-6 rounded-full flex items-center justify-center font-bold text-white ${h.passed?"bg-green-500":"bg-red-500"}`,children:h.passed?"✓":"✗"}),t.jsx("span",{className:`font-medium ${h.passed?"text-green-900":"text-red-900"}`,children:h.name})]},p))})]}),s.errors.length>0&&t.jsxs("div",{className:"border-t pt-6",children:[t.jsx("h3",{className:"text-lg font-bold text-red-900 mb-4",children:"Errors"}),t.jsx("div",{className:"space-y-2",children:s.errors.map((h,p)=>t.jsxs("p",{className:"text-red-700 text-sm",children:["• ",h]},p))})]}),s.warnings.length>0&&t.jsxs("div",{className:"border-t pt-6",children:[t.jsx("h3",{className:"text-lg font-bold text-yellow-900 mb-4",children:"Warnings"}),t.jsx("div",{className:"space-y-2",children:s.warnings.map((h,p)=>t.jsxs("p",{className:"text-yellow-700 text-sm",children:["⚠️ ",h]},p))})]}),t.jsxs("div",{className:"flex gap-3 justify-end",children:[t.jsx("button",{onClick:o,className:"px-6 py-2 border border-gray-300 text-gray-700 rounded-lg font-medium hover:bg-gray-50 transition",disabled:u,children:"Back"}),t.jsx("button",{onClick:i,disabled:!s.isValid||u,className:"px-6 py-2 bg-primary-600 text-white rounded-lg font-medium hover:bg-primary-700 disabled:opacity-50 disabled:cursor-not-allowed transition",children:u?"Publishing...":"Confirm & Publish"})]})]})}function qy({packages:s,summary:l,onReset:i}){const o=new Date().toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"});return t.jsxs("div",{className:"bg-white rounded-lg shadow p-6 space-y-6",children:[t.jsxs("div",{className:"text-center",children:[t.jsx("div",{className:"flex justify-center mb-4",children:t.jsx("div",{className:"w-16 h-16 bg-green-100 rounded-full flex items-center justify-center",children:t.jsx("svg",{className:"w-10 h-10 text-green-600",fill:"currentColor",viewBox:"0 0 20 20",children:t.jsx("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z",clipRule:"evenodd"})})})}),t.jsx("h2",{className:"text-3xl font-bold text-gray-900 mb-2",children:"Release Initiated!"}),t.jsxs("p",{className:"text-gray-600 text-lg mb-4",children:["Changeset created and publishing workflow started for ",s.length," package(s)"]}),t.jsxs("p",{className:"text-gray-500 text-sm",children:["Initiated on ",o]})]}),t.jsxs("div",{className:"border-t pt-6",children:[t.jsx("h3",{className:"text-lg font-bold text-gray-900 mb-4",children:"What Happens Next"}),t.jsxs("div",{className:"space-y-3",children:[t.jsxs("div",{className:"flex items-start space-x-3 p-3 bg-blue-50 rounded-lg",children:[t.jsx("div",{className:"flex-shrink-0 text-blue-600 mt-0.5",children:t.jsx("svg",{className:"h-5 w-5",fill:"currentColor",viewBox:"0 0 20 20",children:t.jsx("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z",clipRule:"evenodd"})})}),t.jsxs("div",{children:[t.jsx("p",{className:"font-medium text-blue-900",children:"1. Changeset Created"}),t.jsx("p",{className:"text-sm text-blue-700 mt-1",children:"A changeset has been created with your release information"})]})]}),t.jsxs("div",{className:"flex items-start space-x-3 p-3 bg-blue-50 rounded-lg",children:[t.jsx("div",{className:"flex-shrink-0 text-blue-600 mt-0.5",children:t.jsx("svg",{className:"h-5 w-5",fill:"currentColor",viewBox:"0 0 20 20",children:t.jsx("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z",clipRule:"evenodd"})})}),t.jsxs("div",{children:[t.jsx("p",{className:"font-medium text-blue-900",children:"2. Publishing Workflow Started"}),t.jsx("p",{className:"text-sm text-blue-700 mt-1",children:"GitHub Actions workflow has been triggered to publish your packages"})]})]}),t.jsxs("div",{className:"flex items-start space-x-3 p-3 bg-blue-50 rounded-lg",children:[t.jsx("div",{className:"flex-shrink-0 text-blue-600 mt-0.5",children:t.jsxs("svg",{className:"h-5 w-5",fill:"currentColor",viewBox:"0 0 20 20",children:[t.jsx("path",{d:"M10 12a2 2 0 100-4 2 2 0 000 4z"}),t.jsx("path",{fillRule:"evenodd",d:"M.458 10C1.732 5.943 5.522 3 10 3s8.268 2.943 9.542 7c-1.274 4.057-5.064 7-9.542 7S1.732 14.057.458 10zM14 10a4 4 0 11-8 0 4 4 0 018 0z",clipRule:"evenodd"})]})}),t.jsxs("div",{children:[t.jsx("p",{className:"font-medium text-blue-900",children:"3. Monitor Progress"}),t.jsx("p",{className:"text-sm text-blue-700 mt-1",children:"Check GitHub Actions for the workflow status and npm registry for package updates"})]})]})]})]}),t.jsxs("div",{className:"border-t pt-6",children:[t.jsx("h3",{className:"text-lg font-bold text-gray-900 mb-4",children:"Packages Released"}),t.jsx("div",{className:"space-y-2",children:s.map(u=>t.jsxs("div",{className:"flex items-center justify-between p-3 bg-gray-50 rounded-lg",children:[t.jsxs("div",{children:[t.jsx("p",{className:"font-medium text-gray-900",children:u.name}),t.jsxs("p",{className:"text-sm text-gray-500",children:["v",u.currentVersion," → v",u.newVersion]})]}),t.jsx("span",{className:"inline-flex items-center px-3 py-1 rounded-full text-sm font-medium bg-primary-100 text-primary-800",children:u.bumpType.charAt(0).toUpperCase()+u.bumpType.slice(1)})]},u.name))})]}),t.jsxs("div",{className:"border-t pt-6",children:[t.jsx("h3",{className:"text-lg font-bold text-gray-900 mb-4",children:"Changelog Summary"}),t.jsx("div",{className:"p-4 bg-gray-50 rounded-lg",children:t.jsx("p",{className:"text-gray-700 whitespace-pre-wrap",children:l})})]}),t.jsxs("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-4",children:[t.jsx("h4",{className:"font-medium text-blue-900 mb-2",children:"Next Steps"}),t.jsxs("ul",{className:"text-sm text-blue-700 space-y-2",children:[t.jsx("li",{children:"✓ Changeset created and committed"}),t.jsx("li",{children:"✓ Package versions updated"}),t.jsx("li",{children:"✓ Release pipeline triggered"}),t.jsx("li",{children:"✓ GitHub release created (in progress)"}),t.jsx("li",{children:"⏳ npm registry will be updated shortly"})]})]}),t.jsx("div",{className:"flex gap-3 justify-center",children:t.jsx("button",{onClick:i,className:"px-8 py-3 bg-primary-600 text-white rounded-lg font-medium hover:bg-primary-700 transition",children:"Release Another Package"})}),t.jsxs("div",{className:"border-t pt-6 flex gap-4 justify-center",children:[t.jsx("a",{href:"#",className:"text-primary-600 hover:text-primary-700 font-medium text-sm",children:"View Release on GitHub →"}),t.jsx("a",{href:"#",className:"text-primary-600 hover:text-primary-700 font-medium text-sm",children:"View on npm →"})]})]})}function ev({message:s="Loading..."}){return t.jsxs("div",{className:"flex flex-col items-center justify-center py-12",children:[t.jsx("div",{className:"w-12 h-12 rounded-full border-4 border-gray-200 border-t-primary-500 animate-spin mb-4"}),t.jsx("p",{className:"text-gray-600",children:s})]})}function tv({error:s,onRetry:l}){return t.jsx("div",{className:"bg-red-50 border border-red-200 rounded-lg p-6",children:t.jsxs("div",{className:"flex items-start",children:[t.jsx("div",{className:"flex-shrink-0",children:t.jsx("svg",{className:"w-6 h-6 text-red-600",fill:"currentColor",viewBox:"0 0 20 20",children:t.jsx("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z",clipRule:"evenodd"})})}),t.jsxs("div",{className:"ml-3 flex-1",children:[t.jsx("h3",{className:"text-lg font-medium text-red-800",children:"Error"}),t.jsx("p",{className:"mt-2 text-sm text-red-700",children:s}),t.jsx("button",{onClick:l,className:"mt-4 px-4 py-2 bg-red-600 text-white rounded-lg font-medium hover:bg-red-700 transition",children:"Try Again"})]})]})})}function nv(){const{isAuthenticated:s,hasPermission:l}=Er(),[i,o]=v.useState("select"),[u,m]=v.useState([]),[h,p]=v.useState(""),[x,y]=v.useState(!1),[k,j]=v.useState(null),[E,I]=v.useState(null),[L,A]=v.useState([]),[P,O]=v.useState([]);v.useEffect(()=>{M()},[]);const M=async()=>{try{y(!0);const he=`${window.ENV?.API_URL??"http://localhost:8999"}/api`,ye=localStorage.getItem("monodog_session_token"),je={"Content-Type":"application/json",...ye&&{Authorization:`Bearer ${ye}`}},Pe=await fetch(`${he}/publish/packages`,{headers:je});if(Pe.ok){const ce=await Pe.json();A(ce.packages||[])}else{console.warn("Failed to fetch packages:",Pe.status);const ce=await fetch(`${he}/packages`,{headers:je});if(ce.ok){const W=await ce.json();A(W||[])}}const Ne=await fetch(`${he}/publish/changesets`,{headers:je});if(Ne.ok){const ce=await Ne.json();O(ce.changesets||[])}else(Ne.status===401||Ne.status===403)&&(window.location.href="/login");j(null)}catch(X){const he=X instanceof Error?X.message:"Failed to fetch workspace data";j(he),console.error("Error fetching workspace data:",X)}finally{y(!1)}},R=X=>{const he=X.map(ye=>({name:ye.name,currentVersion:ye.version,newVersion:ye.version,bumpType:"patch",affectedDependencies:ye.dependents||[]}));m(he),o("bump")},$=X=>{m(X),o("preview")},J=X=>{p(X),ve(u,X)},ve=async(X,he)=>{try{y(!0);const je=`${window.ENV?.API_URL??"http://localhost:8999"}/api`,Pe=localStorage.getItem("monodog_session_token"),Ne={"Content-Type":"application/json",...Pe&&{Authorization:`Bearer ${Pe}`}},ce=await fetch(`${je}/publish/preview`,{method:"POST",headers:Ne,body:JSON.stringify({packages:X.map(Y=>Y.name),bumps:X.map(Y=>({package:Y.name,bumpType:Y.bumpType})),summary:he})});if(!ce.ok)throw new Error("Validation failed");const W=await ce.json(),se={isValid:W.isValid??!0,errors:W.errors??[],warnings:W.warnings??[],checks:W.checks??{permissions:!0,workingTreeClean:!0,ciPassing:!0,versionAvailable:!0}};I(se),o("validate"),j(null)}catch(ye){const je=ye instanceof Error?ye.message:"Validation error";j(je),console.error("Validation error:",ye)}finally{y(!1)}},ee=async()=>{try{if(!l("maintain")){j("You do not have permission to publish packages. Required: maintain permission");return}y(!0);const he=`${window.ENV?.API_URL??"http://localhost:8999"}/api`,ye=localStorage.getItem("monodog_session_token"),je={"Content-Type":"application/json",...ye&&{Authorization:`Bearer ${ye}`}};if(!(await fetch(`${he}/publish/changesets`,{method:"POST",headers:je,body:JSON.stringify({packages:u.map(ce=>ce.name),bumps:u.map(ce=>({package:ce.name,bumpType:ce.bumpType})),summary:h})})).ok)throw new Error("Failed to create changeset");if(!(await fetch(`${he}/publish/trigger`,{method:"POST",headers:je,body:JSON.stringify({packages:u})})).ok)throw new Error("Failed to trigger publish");o("confirm"),j(null)}catch(X){const he=X instanceof Error?X.message:"Publishing error";j(he)}finally{y(!1)}},pe=()=>{o("select"),m([]),p(""),I(null),j(null),M()};if(!s)return t.jsx("div",{className:"p-6 bg-yellow-50 border border-yellow-200 rounded-lg",children:t.jsx("p",{className:"text-yellow-800",children:"Please log in to access release management."})});if(x&&i==="select"&&L.length===0)return t.jsx(ev,{message:"Loading workspace packages..."});if(k&&i==="select")return t.jsx(tv,{error:k,onRetry:M});const xe=l("write"),we=l("maintain");return t.jsxs("div",{className:"space-y-6",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{children:[t.jsx("h1",{className:"text-3xl font-bold text-gray-900",children:"Release Manager"}),t.jsx("p",{className:"text-gray-600 mt-1",children:"Manage package versions and publish releases with Changesets"})]}),t.jsxs("div",{className:"text-sm text-gray-500",children:["Step ",["select","bump","preview","validate","confirm"].indexOf(i)+1," of 5"]})]}),!xe&&t.jsxs("div",{className:"p-4 bg-yellow-50 border border-yellow-200 rounded-lg",children:[t.jsx("p",{className:"text-yellow-700 font-medium",children:"⚠️ Limited Access"}),t.jsx("p",{className:"text-yellow-600 text-sm mt-1",children:"You do not have write permission to create and publish changesets. Contact your repository administrator to request access."})]}),k&&t.jsxs("div",{className:"p-4 bg-red-50 border border-red-200 rounded-lg",children:[t.jsx("p",{className:"text-red-700 font-medium",children:"Error"}),t.jsx("p",{className:"text-red-600 text-sm mt-1",children:k})]}),P.length>0&&i==="select"&&t.jsxs("div",{className:"p-4 bg-blue-50 border border-blue-200 rounded-lg",children:[t.jsxs("p",{className:"text-blue-700 font-medium",children:[P.length," unpublished changeset(s) detected"]}),t.jsx("p",{className:"text-blue-600 text-sm mt-1",children:"Consider reviewing existing changesets before creating new ones"})]}),i==="select"&&!xe&&t.jsxs("div",{className:"p-4 bg-red-50 border border-red-200 rounded-lg",children:[t.jsx("p",{className:"text-red-700 font-medium",children:"🚫 Access Denied"}),t.jsx("p",{className:"text-red-600 text-sm mt-1",children:"You do not have write permission to create changesets. Contact your repository administrator."})]}),i==="select"&&xe&&t.jsx(Qy,{packages:L,onConfirm:R,loading:x}),i==="bump"&&xe&&t.jsx(Xy,{packages:u,onConfirm:$,onBack:()=>o("select")}),i==="preview"&&xe&&t.jsx(Zy,{packages:u,existingChangesets:P,onConfirm:J,onBack:()=>o("select"),loading:x}),i==="validate"&&!we&&t.jsxs("div",{className:"p-4 bg-red-50 border border-red-200 rounded-lg",children:[t.jsx("p",{className:"text-red-700 font-medium",children:"🚫 Access Denied"}),t.jsx("p",{className:"text-red-600 text-sm mt-1",children:"You do not have maintain permission to publish changesets. Contact your repository administrator."})]}),i==="validate"&&we&&E&&t.jsx(Jy,{validation:E,packages:u,onConfirm:ee,onBack:()=>o("preview"),loading:x}),i==="confirm"&&t.jsx(qy,{packages:u,summary:h,onReset:pe}),t.jsx("div",{className:"flex gap-2 justify-center",children:["select","bump","preview","validate","confirm"].map((X,he)=>t.jsx("div",{className:`h-2 flex-1 rounded-full transition-colors ${["select","bump","preview","validate","confirm"].indexOf(i)>=he?"bg-primary-500":"bg-gray-300"}`},X))})]})}const{entries:Km,setPrototypeOf:nm,isFrozen:rv,getPrototypeOf:sv,getOwnPropertyDescriptor:lv}=Object;let{freeze:mt,seal:Ut,create:Mo}=Object,{apply:Io,construct:Oo}=typeof Reflect<"u"&&Reflect;mt||(mt=function(l){return l});Ut||(Ut=function(l){return l});Io||(Io=function(l,i){for(var o=arguments.length,u=new Array(o>2?o-2:0),m=2;m<o;m++)u[m-2]=arguments[m];return l.apply(i,u)});Oo||(Oo=function(l){for(var i=arguments.length,o=new Array(i>1?i-1:0),u=1;u<i;u++)o[u-1]=arguments[u];return new l(...o)});const va=ht(Array.prototype.forEach),av=ht(Array.prototype.lastIndexOf),rm=ht(Array.prototype.pop),Zs=ht(Array.prototype.push),iv=ht(Array.prototype.splice),Na=ht(String.prototype.toLowerCase),wo=ht(String.prototype.toString),No=ht(String.prototype.match),Js=ht(String.prototype.replace),ov=ht(String.prototype.indexOf),cv=ht(String.prototype.trim),en=ht(Object.prototype.hasOwnProperty),dt=ht(RegExp.prototype.test),qs=uv(TypeError);function ht(s){return function(l){l instanceof RegExp&&(l.lastIndex=0);for(var i=arguments.length,o=new Array(i>1?i-1:0),u=1;u<i;u++)o[u-1]=arguments[u];return Io(s,l,o)}}function uv(s){return function(){for(var l=arguments.length,i=new Array(l),o=0;o<l;o++)i[o]=arguments[o];return Oo(s,i)}}function ke(s,l){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Na;nm&&nm(s,null);let o=l.length;for(;o--;){let u=l[o];if(typeof u=="string"){const m=i(u);m!==u&&(rv(l)||(l[o]=m),u=m)}s[u]=!0}return s}function dv(s){for(let l=0;l<s.length;l++)en(s,l)||(s[l]=null);return s}function mn(s){const l=Mo(null);for(const[i,o]of Km(s))en(s,i)&&(Array.isArray(o)?l[i]=dv(o):o&&typeof o=="object"&&o.constructor===Object?l[i]=mn(o):l[i]=o);return l}function el(s,l){for(;s!==null;){const o=lv(s,l);if(o){if(o.get)return ht(o.get);if(typeof o.value=="function")return ht(o.value)}s=sv(s)}function i(){return null}return i}const sm=mt(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),bo=mt(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),So=mt(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),mv=mt(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),ko=mt(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),hv=mt(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),lm=mt(["#text"]),am=mt(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),Co=mt(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),im=mt(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),ja=mt(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),fv=Ut(/\{\{[\w\W]*|[\w\W]*\}\}/gm),xv=Ut(/<%[\w\W]*|[\w\W]*%>/gm),pv=Ut(/\$\{[\w\W]*/gm),gv=Ut(/^data-[\-\w.\u00B7-\uFFFF]+$/),yv=Ut(/^aria-[\-\w]+$/),Xm=Ut(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),vv=Ut(/^(?:\w+script|data):/i),jv=Ut(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Zm=Ut(/^html$/i),wv=Ut(/^[a-z][.\w]*(-[.\w]+)+$/i);var om=Object.freeze({__proto__:null,ARIA_ATTR:yv,ATTR_WHITESPACE:jv,CUSTOM_ELEMENT:wv,DATA_ATTR:gv,DOCTYPE_NAME:Zm,ERB_EXPR:xv,IS_ALLOWED_URI:Xm,IS_SCRIPT_OR_DATA:vv,MUSTACHE_EXPR:fv,TMPLIT_EXPR:pv});const tl={element:1,text:3,progressingInstruction:7,comment:8,document:9},Nv=function(){return typeof window>"u"?null:window},bv=function(l,i){if(typeof l!="object"||typeof l.createPolicy!="function")return null;let o=null;const u="data-tt-policy-suffix";i&&i.hasAttribute(u)&&(o=i.getAttribute(u));const m="dompurify"+(o?"#"+o:"");try{return l.createPolicy(m,{createHTML(h){return h},createScriptURL(h){return h}})}catch{return console.warn("TrustedTypes policy "+m+" could not be created."),null}},cm=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Jm(){let s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Nv();const l=oe=>Jm(oe);if(l.version="3.3.1",l.removed=[],!s||!s.document||s.document.nodeType!==tl.document||!s.Element)return l.isSupported=!1,l;let{document:i}=s;const o=i,u=o.currentScript,{DocumentFragment:m,HTMLTemplateElement:h,Node:p,Element:x,NodeFilter:y,NamedNodeMap:k=s.NamedNodeMap||s.MozNamedAttrMap,HTMLFormElement:j,DOMParser:E,trustedTypes:I}=s,L=x.prototype,A=el(L,"cloneNode"),P=el(L,"remove"),O=el(L,"nextSibling"),M=el(L,"childNodes"),R=el(L,"parentNode");if(typeof h=="function"){const oe=i.createElement("template");oe.content&&oe.content.ownerDocument&&(i=oe.content.ownerDocument)}let $,J="";const{implementation:ve,createNodeIterator:ee,createDocumentFragment:pe,getElementsByTagName:xe}=i,{importNode:we}=o;let X=cm();l.isSupported=typeof Km=="function"&&typeof R=="function"&&ve&&ve.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:he,ERB_EXPR:ye,TMPLIT_EXPR:je,DATA_ATTR:Pe,ARIA_ATTR:Ne,IS_SCRIPT_OR_DATA:ce,ATTR_WHITESPACE:W,CUSTOM_ELEMENT:se}=om;let{IS_ALLOWED_URI:Y}=om,S=null;const D=ke({},[...sm,...bo,...So,...ko,...lm]);let ae=null;const B=ke({},[...am,...Co,...im,...ja]);let G=Object.seal(Mo(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Z=null,ue=null;const Q=Object.seal(Mo(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let ie=!0,Ee=!0,wt=!1,qe=!0,Nt=!1,tn=!0,et=!1,bt=!1,nn=!1,At=!1,Pn=!1,rn=!1,hn=!0,Tr=!1;const ol="user-content-";let Pr=!0,_n=!1,fn={},ft=null;const Ln=ke({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let os=null;const An=ke({},["audio","video","img","source","image","track"]);let xn=null;const cl=ke({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),ar="http://www.w3.org/1998/Math/MathML",ir="http://www.w3.org/2000/svg",Ht="http://www.w3.org/1999/xhtml";let sn=Ht,or=!1,cr=null;const cs=ke({},[ar,ir,Ht],wo);let Rn=ke({},["mi","mo","mn","ms","mtext"]),Vt=ke({},["annotation-xml"]);const Mn=ke({},["title","style","font","a","script"]);let In=null;const ul=["application/xhtml+xml","text/html"],dl="text/html";let Fe=null,pn=null;const us=i.createElement("form"),ds=function(N){return N instanceof RegExp||N instanceof Function},gn=function(){let N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(pn&&pn===N)){if((!N||typeof N!="object")&&(N={}),N=mn(N),In=ul.indexOf(N.PARSER_MEDIA_TYPE)===-1?dl:N.PARSER_MEDIA_TYPE,Fe=In==="application/xhtml+xml"?wo:Na,S=en(N,"ALLOWED_TAGS")?ke({},N.ALLOWED_TAGS,Fe):D,ae=en(N,"ALLOWED_ATTR")?ke({},N.ALLOWED_ATTR,Fe):B,cr=en(N,"ALLOWED_NAMESPACES")?ke({},N.ALLOWED_NAMESPACES,wo):cs,xn=en(N,"ADD_URI_SAFE_ATTR")?ke(mn(cl),N.ADD_URI_SAFE_ATTR,Fe):cl,os=en(N,"ADD_DATA_URI_TAGS")?ke(mn(An),N.ADD_DATA_URI_TAGS,Fe):An,ft=en(N,"FORBID_CONTENTS")?ke({},N.FORBID_CONTENTS,Fe):Ln,Z=en(N,"FORBID_TAGS")?ke({},N.FORBID_TAGS,Fe):mn({}),ue=en(N,"FORBID_ATTR")?ke({},N.FORBID_ATTR,Fe):mn({}),fn=en(N,"USE_PROFILES")?N.USE_PROFILES:!1,ie=N.ALLOW_ARIA_ATTR!==!1,Ee=N.ALLOW_DATA_ATTR!==!1,wt=N.ALLOW_UNKNOWN_PROTOCOLS||!1,qe=N.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Nt=N.SAFE_FOR_TEMPLATES||!1,tn=N.SAFE_FOR_XML!==!1,et=N.WHOLE_DOCUMENT||!1,At=N.RETURN_DOM||!1,Pn=N.RETURN_DOM_FRAGMENT||!1,rn=N.RETURN_TRUSTED_TYPE||!1,nn=N.FORCE_BODY||!1,hn=N.SANITIZE_DOM!==!1,Tr=N.SANITIZE_NAMED_PROPS||!1,Pr=N.KEEP_CONTENT!==!1,_n=N.IN_PLACE||!1,Y=N.ALLOWED_URI_REGEXP||Xm,sn=N.NAMESPACE||Ht,Rn=N.MATHML_TEXT_INTEGRATION_POINTS||Rn,Vt=N.HTML_INTEGRATION_POINTS||Vt,G=N.CUSTOM_ELEMENT_HANDLING||{},N.CUSTOM_ELEMENT_HANDLING&&ds(N.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(G.tagNameCheck=N.CUSTOM_ELEMENT_HANDLING.tagNameCheck),N.CUSTOM_ELEMENT_HANDLING&&ds(N.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(G.attributeNameCheck=N.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),N.CUSTOM_ELEMENT_HANDLING&&typeof N.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(G.allowCustomizedBuiltInElements=N.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Nt&&(Ee=!1),Pn&&(At=!0),fn&&(S=ke({},lm),ae=[],fn.html===!0&&(ke(S,sm),ke(ae,am)),fn.svg===!0&&(ke(S,bo),ke(ae,Co),ke(ae,ja)),fn.svgFilters===!0&&(ke(S,So),ke(ae,Co),ke(ae,ja)),fn.mathMl===!0&&(ke(S,ko),ke(ae,im),ke(ae,ja))),N.ADD_TAGS&&(typeof N.ADD_TAGS=="function"?Q.tagCheck=N.ADD_TAGS:(S===D&&(S=mn(S)),ke(S,N.ADD_TAGS,Fe))),N.ADD_ATTR&&(typeof N.ADD_ATTR=="function"?Q.attributeCheck=N.ADD_ATTR:(ae===B&&(ae=mn(ae)),ke(ae,N.ADD_ATTR,Fe))),N.ADD_URI_SAFE_ATTR&&ke(xn,N.ADD_URI_SAFE_ATTR,Fe),N.FORBID_CONTENTS&&(ft===Ln&&(ft=mn(ft)),ke(ft,N.FORBID_CONTENTS,Fe)),N.ADD_FORBID_CONTENTS&&(ft===Ln&&(ft=mn(ft)),ke(ft,N.ADD_FORBID_CONTENTS,Fe)),Pr&&(S["#text"]=!0),et&&ke(S,["html","head","body"]),S.table&&(ke(S,["tbody"]),delete Z.tbody),N.TRUSTED_TYPES_POLICY){if(typeof N.TRUSTED_TYPES_POLICY.createHTML!="function")throw qs('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof N.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw qs('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');$=N.TRUSTED_TYPES_POLICY,J=$.createHTML("")}else $===void 0&&($=bv(I,u)),$!==null&&typeof J=="string"&&(J=$.createHTML(""));mt&&mt(N),pn=N}},_r=ke({},[...bo,...So,...mv]),On=ke({},[...ko,...hv]),Ma=function(N){let H=R(N);(!H||!H.tagName)&&(H={namespaceURI:sn,tagName:"template"});const ne=Na(N.tagName),Le=Na(H.tagName);return cr[N.namespaceURI]?N.namespaceURI===ir?H.namespaceURI===Ht?ne==="svg":H.namespaceURI===ar?ne==="svg"&&(Le==="annotation-xml"||Rn[Le]):!!_r[ne]:N.namespaceURI===ar?H.namespaceURI===Ht?ne==="math":H.namespaceURI===ir?ne==="math"&&Vt[Le]:!!On[ne]:N.namespaceURI===Ht?H.namespaceURI===ir&&!Vt[Le]||H.namespaceURI===ar&&!Rn[Le]?!1:!On[ne]&&(Mn[ne]||!_r[ne]):!!(In==="application/xhtml+xml"&&cr[N.namespaceURI]):!1},rt=function(N){Zs(l.removed,{element:N});try{R(N).removeChild(N)}catch{P(N)}},Rt=function(N,H){try{Zs(l.removed,{attribute:H.getAttributeNode(N),from:H})}catch{Zs(l.removed,{attribute:null,from:H})}if(H.removeAttribute(N),N==="is")if(At||Pn)try{rt(H)}catch{}else try{H.setAttribute(N,"")}catch{}},ur=function(N){let H=null,ne=null;if(nn)N="<remove></remove>"+N;else{const ze=No(N,/^[\r\n\t ]+/);ne=ze&&ze[0]}In==="application/xhtml+xml"&&sn===Ht&&(N='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+N+"</body></html>");const Le=$?$.createHTML(N):N;if(sn===Ht)try{H=new E().parseFromString(Le,In)}catch{}if(!H||!H.documentElement){H=ve.createDocument(sn,"template",null);try{H.documentElement.innerHTML=or?J:Le}catch{}}const be=H.body||H.documentElement;return N&&ne&&be.insertBefore(i.createTextNode(ne),be.childNodes[0]||null),sn===Ht?xe.call(H,et?"html":"body")[0]:et?H.documentElement:be},Lr=function(N){return ee.call(N.ownerDocument||N,N,y.SHOW_ELEMENT|y.SHOW_COMMENT|y.SHOW_TEXT|y.SHOW_PROCESSING_INSTRUCTION|y.SHOW_CDATA_SECTION,null)},ms=function(N){return N instanceof j&&(typeof N.nodeName!="string"||typeof N.textContent!="string"||typeof N.removeChild!="function"||!(N.attributes instanceof k)||typeof N.removeAttribute!="function"||typeof N.setAttribute!="function"||typeof N.namespaceURI!="string"||typeof N.insertBefore!="function"||typeof N.hasChildNodes!="function")},ml=function(N){return typeof p=="function"&&N instanceof p};function Wt(oe,N,H){va(oe,ne=>{ne.call(l,N,H,pn)})}const ln=function(N){let H=null;if(Wt(X.beforeSanitizeElements,N,null),ms(N))return rt(N),!0;const ne=Fe(N.nodeName);if(Wt(X.uponSanitizeElement,N,{tagName:ne,allowedTags:S}),tn&&N.hasChildNodes()&&!ml(N.firstElementChild)&&dt(/<[/\w!]/g,N.innerHTML)&&dt(/<[/\w!]/g,N.textContent)||N.nodeType===tl.progressingInstruction||tn&&N.nodeType===tl.comment&&dt(/<[/\w]/g,N.data))return rt(N),!0;if(!(Q.tagCheck instanceof Function&&Q.tagCheck(ne))&&(!S[ne]||Z[ne])){if(!Z[ne]&&fs(ne)&&(G.tagNameCheck instanceof RegExp&&dt(G.tagNameCheck,ne)||G.tagNameCheck instanceof Function&&G.tagNameCheck(ne)))return!1;if(Pr&&!ft[ne]){const Le=R(N)||N.parentNode,be=M(N)||N.childNodes;if(be&&Le){const ze=be.length;for(let Qe=ze-1;Qe>=0;--Qe){const Mt=A(be[Qe],!0);Mt.__removalCount=(N.__removalCount||0)+1,Le.insertBefore(Mt,O(N))}}}return rt(N),!0}return N instanceof x&&!Ma(N)||(ne==="noscript"||ne==="noembed"||ne==="noframes")&&dt(/<\/no(script|embed|frames)/i,N.innerHTML)?(rt(N),!0):(Nt&&N.nodeType===tl.text&&(H=N.textContent,va([he,ye,je],Le=>{H=Js(H,Le," ")}),N.textContent!==H&&(Zs(l.removed,{element:N.cloneNode()}),N.textContent=H)),Wt(X.afterSanitizeElements,N,null),!1)},hs=function(N,H,ne){if(hn&&(H==="id"||H==="name")&&(ne in i||ne in us))return!1;if(!(Ee&&!ue[H]&&dt(Pe,H))){if(!(ie&&dt(Ne,H))){if(!(Q.attributeCheck instanceof Function&&Q.attributeCheck(H,N))){if(!ae[H]||ue[H]){if(!(fs(N)&&(G.tagNameCheck instanceof RegExp&&dt(G.tagNameCheck,N)||G.tagNameCheck instanceof Function&&G.tagNameCheck(N))&&(G.attributeNameCheck instanceof RegExp&&dt(G.attributeNameCheck,H)||G.attributeNameCheck instanceof Function&&G.attributeNameCheck(H,N))||H==="is"&&G.allowCustomizedBuiltInElements&&(G.tagNameCheck instanceof RegExp&&dt(G.tagNameCheck,ne)||G.tagNameCheck instanceof Function&&G.tagNameCheck(ne))))return!1}else if(!xn[H]){if(!dt(Y,Js(ne,W,""))){if(!((H==="src"||H==="xlink:href"||H==="href")&&N!=="script"&&ov(ne,"data:")===0&&os[N])){if(!(wt&&!dt(ce,Js(ne,W,"")))){if(ne)return!1}}}}}}}return!0},fs=function(N){return N!=="annotation-xml"&&No(N,se)},hl=function(N){Wt(X.beforeSanitizeAttributes,N,null);const{attributes:H}=N;if(!H||ms(N))return;const ne={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:ae,forceKeepAttr:void 0};let Le=H.length;for(;Le--;){const be=H[Le],{name:ze,namespaceURI:Qe,value:Mt}=be,Gt=Fe(ze),xs=Mt;let He=ze==="value"?xs:cv(xs);if(ne.attrName=Gt,ne.attrValue=He,ne.keepAttr=!0,ne.forceKeepAttr=void 0,Wt(X.uponSanitizeAttribute,N,ne),He=ne.attrValue,Tr&&(Gt==="id"||Gt==="name")&&(Rt(ze,N),He=ol+He),tn&&dt(/((--!?|])>)|<\/(style|title|textarea)/i,He)){Rt(ze,N);continue}if(Gt==="attributename"&&No(He,"href")){Rt(ze,N);continue}if(ne.forceKeepAttr)continue;if(!ne.keepAttr){Rt(ze,N);continue}if(!qe&&dt(/\/>/i,He)){Rt(ze,N);continue}Nt&&va([he,ye,je],St=>{He=Js(He,St," ")});const dr=Fe(N.nodeName);if(!hs(dr,Gt,He)){Rt(ze,N);continue}if($&&typeof I=="object"&&typeof I.getAttributeType=="function"&&!Qe)switch(I.getAttributeType(dr,Gt)){case"TrustedHTML":{He=$.createHTML(He);break}case"TrustedScriptURL":{He=$.createScriptURL(He);break}}if(He!==xs)try{Qe?N.setAttributeNS(Qe,ze,He):N.setAttribute(ze,He),ms(N)?rt(N):rm(l.removed)}catch{Rt(ze,N)}}Wt(X.afterSanitizeAttributes,N,null)},fl=function oe(N){let H=null;const ne=Lr(N);for(Wt(X.beforeSanitizeShadowDOM,N,null);H=ne.nextNode();)Wt(X.uponSanitizeShadowNode,H,null),ln(H),hl(H),H.content instanceof m&&oe(H.content);Wt(X.afterSanitizeShadowDOM,N,null)};return l.sanitize=function(oe){let N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},H=null,ne=null,Le=null,be=null;if(or=!oe,or&&(oe="<!-->"),typeof oe!="string"&&!ml(oe))if(typeof oe.toString=="function"){if(oe=oe.toString(),typeof oe!="string")throw qs("dirty is not a string, aborting")}else throw qs("toString is not a function");if(!l.isSupported)return oe;if(bt||gn(N),l.removed=[],typeof oe=="string"&&(_n=!1),_n){if(oe.nodeName){const Mt=Fe(oe.nodeName);if(!S[Mt]||Z[Mt])throw qs("root node is forbidden and cannot be sanitized in-place")}}else if(oe instanceof p)H=ur("<!---->"),ne=H.ownerDocument.importNode(oe,!0),ne.nodeType===tl.element&&ne.nodeName==="BODY"||ne.nodeName==="HTML"?H=ne:H.appendChild(ne);else{if(!At&&!Nt&&!et&&oe.indexOf("<")===-1)return $&&rn?$.createHTML(oe):oe;if(H=ur(oe),!H)return At?null:rn?J:""}H&&nn&&rt(H.firstChild);const ze=Lr(_n?oe:H);for(;Le=ze.nextNode();)ln(Le),hl(Le),Le.content instanceof m&&fl(Le.content);if(_n)return oe;if(At){if(Pn)for(be=pe.call(H.ownerDocument);H.firstChild;)be.appendChild(H.firstChild);else be=H;return(ae.shadowroot||ae.shadowrootmode)&&(be=we.call(o,be,!0)),be}let Qe=et?H.outerHTML:H.innerHTML;return et&&S["!doctype"]&&H.ownerDocument&&H.ownerDocument.doctype&&H.ownerDocument.doctype.name&&dt(Zm,H.ownerDocument.doctype.name)&&(Qe="<!DOCTYPE "+H.ownerDocument.doctype.name+`>
|
|
13
|
+
`+Qe),Nt&&va([he,ye,je],Mt=>{Qe=Js(Qe,Mt," ")}),$&&rn?$.createHTML(Qe):Qe},l.setConfig=function(){let oe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};gn(oe),bt=!0},l.clearConfig=function(){pn=null,bt=!1},l.isValidAttribute=function(oe,N,H){pn||gn({});const ne=Fe(oe),Le=Fe(N);return hs(ne,Le,H)},l.addHook=function(oe,N){typeof N=="function"&&Zs(X[oe],N)},l.removeHook=function(oe,N){if(N!==void 0){const H=av(X[oe],N);return H===-1?void 0:iv(X[oe],H,1)[0]}return rm(X[oe])},l.removeHooks=function(oe){X[oe]=[]},l.removeAllHooks=function(){X=cm()},l}var Sv=Jm();function kv(s){const l=/\u001b\[([0-9;]*m|K)|(\u001b\(B|\u001b\[m)/g;let i="",o={};const u=Array.from(s.matchAll(l)),m={30:"#000000",31:"#e06c75",32:"#98c379",33:"#e5c07b",34:"#61afef",35:"#c678dd",36:"#56b6c2",37:"#abb2bf"},h={90:"#5c6370",91:"#ff7b86",92:"#98c379",93:"#e5c07b",94:"#61afef",95:"#c678dd",96:"#56b6c2",97:"#ffffff"};let p=0,x="";for(const k of u){const j=s.substring(p,k.index);x+=um(j);const E=k[1];if(p=k.index+k[0].length,E==="m"||E==="0m")x&&(i+=Eo(x,o),x=""),o={};else if(E==="1m")o.fontWeight="bold";else if(E==="2m")o.opacity="0.5";else if(E==="3m")o.fontStyle="italic";else if(E==="4m")o.textDecoration="underline";else if(E.includes(";")){const I=E.split(";").filter(L=>L);for(const L of I){const A=parseInt(L);if(A===0)x&&(i+=Eo(x,o),x=""),o={};else if(A===1)o.fontWeight="bold";else if(A===2)o.opacity="0.5";else if(A===3)o.fontStyle="italic";else if(A===4)o.textDecoration="underline";else if(m[A])o.color=m[A];else if(h[A])o.color=h[A];else if(A>=40&&A<=47){const P=m[A-10];P&&(o.backgroundColor=P)}else if(A>=100&&A<=107){const P=h[A-60];P&&(o.backgroundColor=P)}}}else{const I=parseInt(E);m[I]?o.color=m[I]:h[I]&&(o.color=h[I])}}const y=s.substring(p);return x+=um(y),x&&(i+=Eo(x,o)),i}function um(s){const l={"&":"&","<":"<",">":">",'"':""","'":"'"};return s.replace(/[&<>"']/g,i=>l[i])}function Eo(s,l){return!s||Object.keys(l).length===0?s:`<span style="${Object.entries(l).map(([o,u])=>`${o.replace(/([A-Z])/g,"-$1").toLowerCase()}: ${u}`).join("; ")}">${s}</span>`}function Cv(s,l){if(s==="completed"){if(l==="success")return t.jsx(Pt,{className:"h-6 w-6 text-green-600"});if(l==="failure")return t.jsx(_a,{className:"h-6 w-6 text-red-600"});if(l==="cancelled")return t.jsx(Bt,{className:"h-6 w-6 text-gray-600"})}return t.jsx(We,{className:"h-6 w-6 text-blue-600"})}function qm({step:s,onToggle:l,expandedSteps:i,stepIndex:o}){const u=v.useRef(null),[m,h]=v.useState(!1),p=i.has(s.stepNumber),x=s.children&&s.children.length>0||s.logs.length>0,y=v.useMemo(()=>m?s.logs:s.logs.slice(0,1e3),[s.logs,m]);v.useEffect(()=>{if(s.status==="in_progress"&&p&&u.current){const E=u.current;E.scrollTop=E.scrollHeight}},[s.logs.length,p,s.status]);const k=v.useMemo(()=>!s.startedAt||!s.completedAt?0:Math.round((new Date(s.completedAt).getTime()-new Date(s.startedAt).getTime())/100)/10,[s.startedAt,s.completedAt]),j={marginLeft:`${s.level*20}px`};return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"border-b border-gray-200 bg-white",style:j,children:[t.jsxs("button",{onClick:()=>l(s.stepNumber),className:"w-full flex items-center gap-3 px-4 py-3 hover:bg-gray-50 transition-colors group",children:[t.jsx("span",{className:"text-gray-400 group-hover:text-gray-600 flex-shrink-0",children:x?p?t.jsx(fx,{className:"h-5 w-5"}):t.jsx(xx,{className:"h-5 w-5"}):t.jsx("span",{className:"h-5 w-5"})}),t.jsx("span",{className:"text-xs font-bold text-gray-500 bg-gray-100 rounded px-2 py-1 min-w-fit",children:o+1}),t.jsx("span",{className:"flex-1 text-left",children:t.jsx("span",{className:"text-sm font-semibold text-gray-900",children:s.stepName})}),t.jsxs("div",{className:"flex items-center gap-2 ml-2",children:[s.status==="in_progress"&&t.jsx("span",{className:"flex h-2 w-2 rounded-full bg-blue-500 animate-pulse"}),t.jsxs("span",{className:"text-xs text-gray-500 font-mono",children:[k,"s"]})]})]}),p&&s.logs.length>0&&t.jsx("div",{className:"border-t border-gray-200 bg-[#0d1117]",children:t.jsxs("div",{ref:u,className:"text-gray-300 font-mono text-xs max-h-[600px] overflow-y-auto",children:[y.length===0?t.jsx("div",{className:"px-10 py-6 italic text-gray-500 text-center",children:"No logs available yet"}):t.jsx("div",{className:"py-2 px-0",children:y.map((E,I)=>t.jsxs("div",{className:"flex hover:bg-gray-800/40 transition-colors leading-6 group",children:[t.jsx("span",{className:"w-12 text-right pr-4 text-gray-600 select-none border-r border-gray-800 flex-shrink-0 group-hover:bg-gray-800/20",children:E.lineNumber}),t.jsx("span",{className:"pl-4 pr-3 text-gray-500 select-none opacity-50 text-xs flex-shrink-0",children:E.timestamp.split("T")[1]?.slice(0,8)}),t.jsx("span",{className:"flex-1 whitespace-pre break-all pr-4 text-gray-300",dangerouslySetInnerHTML:{__html:Sv.sanitize(kv(E.ansiContent))}})]},`${s.stepNumber}-${E.lineNumber}`))}),!m&&s.logs.length>1e3&&t.jsx("div",{className:"px-4 py-2 border-t border-gray-800 text-center",children:t.jsxs("button",{onClick:()=>h(!0),className:"text-blue-400 hover:text-blue-300 text-xs font-medium transition-colors",children:["Show all ",s.logs.length," lines"]})})]})})]}),p&&s.children&&s.children.length>0&&t.jsx(t.Fragment,{children:s.children.map((E,I)=>t.jsx(qm,{step:E,onToggle:l,expandedSteps:i,stepIndex:I},E.stepNumber))})]})}function Ev({steps:s,jobName:l,jobStatus:i,jobConclusion:o,gitHubLogsUrl:u}){const[m,h]=v.useState(new Set([s[0]?.stepNumber])),p=y=>{h(k=>{const j=new Set(k);return j.has(y)?j.delete(y):j.add(y),j})},x=y=>y.reduce((k,j)=>{let E=1;return j.children&&j.children.length>0&&(E+=x(j.children)),k+E},0);return t.jsxs("div",{className:"flex flex-col h-full bg-white border border-gray-200 rounded-lg overflow-hidden",children:[t.jsxs("div",{className:"px-4 py-3 bg-gray-50 border-b border-gray-200 flex items-center justify-between",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("span",{className:"text-lg font-semibold ",children:Cv(i,o)}),t.jsxs("div",{children:[t.jsx("h3",{className:"text-sm font-semibold text-gray-900",children:l}),t.jsxs("p",{className:"text-xs text-gray-500",children:[x(s)," step",x(s)!==1?"s":""]})]})]}),t.jsx("a",{href:u,target:"_blank",rel:"noopener noreferrer",className:"text-xs px-3 py-2 bg-blue-50 text-blue-600 hover:bg-blue-100 rounded border border-blue-200 transition-colors",children:"View on GitHub"})]}),t.jsx("div",{className:"flex-1 overflow-y-auto",children:s.length===0?t.jsx("div",{className:"p-4 text-center text-gray-500",children:"No steps available"}):s.map((y,k)=>t.jsx(qm,{step:y,onToggle:p,expandedSteps:m,stepIndex:k},y.stepNumber))})]})}const wa=window.ENV?.API_URL;function Tv(s,l){if(s==="completed"){if(l==="success")return t.jsx(Pt,{className:"h-5 w-5 text-green-600"});if(l==="failure")return t.jsx(_a,{className:"h-5 w-5 text-red-600"})}return t.jsx(We,{className:"h-5 w-5 text-yellow-600"})}function Pv(s,l){if(s==="completed"){if(l==="success")return"bg-green-100 text-green-800";if(l==="failure")return"bg-red-100 text-red-800"}return"bg-yellow-100 text-yellow-800"}function _v(s){const l=new Date(s),o=Math.floor((new Date().getTime()-l.getTime())/1e3);if(o<60)return"just now";const u=Math.floor(o/60);if(u<60)return`${u}m ago`;const m=Math.floor(u/60);if(m<24)return`${m}h ago`;const h=Math.floor(m/24);return h<7?`${h}d ago`:l.toLocaleDateString()}function Lv({owner:s,repo:l,packageName:i,onSelectRun:o,runId:u,limit:m=10,pipelineId:h}){const[p,x]=v.useState([]),[y,k]=v.useState(!0),[j,E]=v.useState(null),[I,L]=v.useState(null),{isAuthenticated:A,hasPermission:P}=Er();v.useEffect(()=>{const R=async()=>{try{k(!0),E(null);let J=`${wa}/api/workflows/${s}/${l}?per_page=${m}`;i&&(J=`${wa}/api/workflows/package/${s}/${l}/${encodeURIComponent(i)}`);const ve=localStorage.getItem("monodog_session_token"),ee={"Content-Type":"application/json",...ve&&{Authorization:`Bearer ${ve}`}},pe=await fetch(J,{headers:ee});if(!pe.ok)throw new Error("Failed to fetch workflow runs");const xe=await pe.json(),we=i?xe.flatMap(X=>X.workflowRuns).slice(0,m):xe.runs;x(we)}catch(J){E(J instanceof Error?J.message:"Unknown error")}finally{k(!1)}},$=setInterval(R,5e3);return R(),()=>clearInterval($)},[s,l,i,m]);const O=async(R,$)=>{R.stopPropagation(),L($.id);try{const J=localStorage.getItem("monodog_session_token"),ve={"Content-Type":"application/json",...J&&{Authorization:`Bearer ${J}`}};if((await fetch(`${wa}/api/workflows/${s}/${l}/runs/${$.id}/cancel`,{method:"POST",headers:ve,body:JSON.stringify({pipelineId:h})})).ok)x(p.map(pe=>pe.id===$.id?{...pe,status:"completed",conclusion:"cancelled"}:pe));else throw new Error("Failed to cancel run")}catch(J){console.error("Failed to cancel run:",J),E(J instanceof Error?J.message:"Failed to cancel run")}finally{L(null)}},M=async(R,$)=>{R.stopPropagation(),L($.id);try{const J=localStorage.getItem("monodog_session_token"),ve={"Content-Type":"application/json",...J&&{Authorization:`Bearer ${J}`}};if((await fetch(`${wa}/api/workflows/${s}/${l}/runs/${$.id}/rerun`,{method:"POST",headers:ve,body:JSON.stringify({pipelineId:h,failedOnly:!1})})).ok)x(p.map(pe=>pe.id===$.id?{...pe,status:"in_progress",conclusion:null}:pe));else throw new Error("Failed to rerun workflow")}catch(J){console.error("Failed to rerun workflow:",J),E(J instanceof Error?J.message:"Failed to rerun workflow")}finally{L(null)}};return y&&p.length===0?t.jsx("div",{className:"flex items-center justify-center py-8",children:t.jsx("div",{className:"animate-spin",children:t.jsx(We,{className:"h-6 w-6 text-blue-600"})})}):j?t.jsx("div",{className:"rounded-lg bg-red-50 p-4 border border-red-200",children:t.jsxs("p",{className:"text-sm text-red-800",children:["Error: ",j]})}):t.jsx("div",{className:"space-y-2",children:p.length===0?t.jsx("p",{className:"text-sm text-gray-500 py-4",children:"No workflow runs found"}):p.map(R=>t.jsxs("div",{className:`text-left p-3 rounded-lg border transition-colors ${u===R.id?"border-blue-500 bg-blue-50":"border-gray-200 hover:bg-gray-50"}`,children:[t.jsx("button",{onClick:()=>o?.(R.id),className:"w-full text-left",children:t.jsxs("div",{className:"flex items-start gap-2",children:[Tv(R.status,R.conclusion),t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsx("p",{className:"font-medium text-sm text-gray-900",children:R.name}),t.jsxs("p",{className:"text-xs text-gray-500 mt-1",children:[t.jsx("span",{className:`px-2 py-1 rounded text-xs font-medium ${Pv(R.status,R.conclusion)}`,children:R.conclusion??R.status}),t.jsx("span",{children:" • "}),t.jsxs("span",{children:["Branch: ",R.head_branch]}),t.jsx("span",{children:" • "}),t.jsxs("span",{children:["by ",R.actor.login]}),t.jsx("span",{children:" • "}),t.jsx("span",{children:_v(R.created_at)})]})]})]})}),P("maintain")&&t.jsxs("div",{className:"flex gap-2 mt-3",children:[R.status==="in_progress"&&t.jsx("button",{onClick:$=>O($,R),disabled:I===R.id,className:"flex-1 px-3 py-2 text-sm font-medium text-red-700 bg-red-50 border border-red-200 rounded hover:bg-red-100 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",title:"Cancel this workflow run",children:I===R.id?"Cancelling...":"Cancel Run"}),(R.conclusion==="cancelled"||R.conclusion==="failure")&&t.jsx("button",{onClick:$=>M($,R),disabled:I===R.id,className:"flex-1 px-3 py-2 text-sm font-medium text-blue-700 bg-blue-50 border border-blue-200 rounded hover:bg-blue-100 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",title:"Rerun this workflow",children:I===R.id?"Rerunning...":"Rerun"})]})]},R.id))})}const dm=window.ENV?.API_URL;function Av({owner:s,repo:l,workflowId:i,defaultBranch:o="main",onSuccess:u,onError:m,pipelineId:h}){const[p,x]=v.useState(!1),[y,k]=v.useState(o),[j,E]=v.useState({}),[I,L]=v.useState(!1),[A,P]=v.useState(null),[O,M]=v.useState([]),[R,$]=v.useState(),[J,ve]=v.useState(!1);v.useEffect(()=>{p&&O.length===0&&ee()},[p]);const ee=async()=>{try{ve(!0);const xe=localStorage.getItem("monodog_session_token"),we={"Content-Type":"application/json",...xe&&{Authorization:`Bearer ${xe}`}},X=await fetch(`${dm}/api/workflows/${s}/${l}/available`,{headers:we});if(X.ok){const he=await X.json();M(he.workflows||[]),he.workflows?.length>0&&!R&&$(he.workflows[0].path)}}catch(xe){console.error("Failed to fetch workflows:",xe)}finally{ve(!1)}},pe=async()=>{try{L(!0),P(null);const xe=localStorage.getItem("monodog_session_token"),we={"Content-Type":"application/json",...xe&&{Authorization:`Bearer ${xe}`}},X=await fetch(`${dm}/api/workflows/${s}/${l}/trigger`,{method:"POST",headers:we,body:JSON.stringify({workflow:R,ref:y,inputs:j,pipelineId:h,workflowId:i})});if(!X.ok)throw new Error("Failed to trigger workflow");const he=await X.json();if(he.success)u?.(he.runUrl||`https://github.com/${s}/${l}/actions`),x(!1),k(o),E({});else throw new Error(he.message||"Failed to trigger workflow")}catch(xe){const we=xe instanceof Error?xe.message:"Unknown error";P(we),m?.(we)}finally{L(!1)}};return t.jsxs("div",{className:"relative",children:[t.jsxs("button",{onClick:()=>x(!p),disabled:I,className:"flex items-center gap-2 px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:[t.jsx(Pa,{className:"h-4 w-4"}),"Trigger Workflow"]}),p&&t.jsxs("div",{className:"absolute right-0 mt-2 w-96 bg-white border border-gray-200 rounded-lg shadow-lg z-10 p-6",children:[t.jsx("h3",{className:"text-lg font-semibold text-gray-900 mb-4",children:"Trigger Workflow"}),A&&t.jsxs("div",{className:"mb-4 p-3 bg-red-50 border border-red-200 rounded-lg flex items-start gap-3",children:[t.jsx(_a,{className:"h-5 w-5 text-red-600 flex-shrink-0 mt-0.5"}),t.jsx("p",{className:"text-sm text-red-700",children:A})]}),t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{children:[t.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Workflow"}),J?t.jsx("div",{className:"w-full px-3 py-2 border border-gray-300 rounded-lg bg-gray-50 text-gray-500",children:"Loading workflows..."}):O.length>0?t.jsx("select",{value:R,onChange:xe=>$(xe.target.value),className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500",children:O.map(xe=>t.jsxs("option",{value:xe.path,children:[xe.name," (",xe.path,")"]},xe.id))}):t.jsx("div",{className:"w-full px-3 py-2 border border-gray-300 rounded-lg bg-yellow-50 text-yellow-700 text-sm",children:"No workflows available"})]}),t.jsxs("div",{children:[t.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Branch"}),t.jsx("input",{type:"text",value:y,onChange:xe=>k(xe.target.value),placeholder:"main",className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500"})]}),t.jsxs("div",{className:"flex gap-2 pt-4",children:[t.jsx("button",{onClick:pe,disabled:I||!y,className:"flex-1 px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 disabled:opacity-50 disabled:cursor-not-allowed transition-colors font-medium",children:I?"Triggering...":"Trigger"}),t.jsx("button",{onClick:()=>x(!1),className:"px-4 py-2 border border-gray-300 text-gray-700 rounded-lg hover:bg-gray-50 transition-colors font-medium",children:"Cancel"})]})]})]})]})}const Rv=()=>{try{const s=localStorage.getItem("monodog_session_data");return s?JSON.parse(s).permission:null}catch(s){return console.error("Failed to parse session data",s),null}},Sr=window.ENV?.API_URL;function Mv(s){const l=s.split(`
|
|
14
|
+
`),i=[];let o=null;const u=[];for(let m=0;m<l.length;m++){const h=l[m],p=h.trim(),x=h.match(/^(\s*)/)?.[1].length||0,y=Math.floor(x/2);if(h.includes("##[group]")){const k=h.match(/##\[group\](.*?)(?:##\[endgroup\]|$)/),E={name:k?k[1].trim():`Step ${i.length+1}`,logs:[],level:y,children:[],startIndex:m};for(;u.length>0&&u[u.length-1].level>=E.level;)u.pop();if(u.length>0){const I=u[u.length-1];I.children||(I.children=[]),I.children.push(E)}else i.push(E);u.push(E),o=E}else{if(h.includes("##[endgroup]"))continue;p&&o&&o.logs.push(h)}}return i}function mm(s,l,i=!1){if(i)return t.jsx(We,{className:"h-6 w-6 text-yellow-500 animate-spin"});if(s==="completed"){if(l==="success")return t.jsx(Pt,{className:"h-6 w-6 text-green-600"});if(l==="failure")return t.jsx(_a,{className:"h-6 w-6 text-red-600"});if(l==="cancelled")return t.jsx(Bt,{className:"h-6 w-6 text-gray-600"});if(l==="skipped")return t.jsx(We,{className:"h-6 w-6 text-gray-600"})}return s==="in_progress"||s==="queued"?t.jsx(We,{className:"h-6 w-6 text-blue-600"}):t.jsx(We,{className:"h-6 w-6 text-gray-600"})}function Iv({packageName:s,onNavigate:l}){const[i,o]=v.useState([]),[u,m]=v.useState(null),[h,p]=v.useState(null),[x,y]=v.useState([]),[k,j]=v.useState(null),[E,I]=v.useState(null),[L,A]=v.useState(!0),[P,O]=v.useState(null),[M,R]=v.useState(new Set),{hasPermission:$}=Er(),[J,ve]=v.useState(0),[ee,pe]=v.useState(!1),[xe,we]=v.useState(0),[X,he]=v.useState(!1),ye=10,je=20,Pe=20,{owner:Ne,repo:ce}=v.useMemo(()=>Rv()||{},[]);v.useEffect(()=>{const B=async()=>{try{const Z=`${Sr}/api/pipelines`,ue=localStorage.getItem("monodog_session_token"),Q={"Content-Type":"application/json",...ue&&{Authorization:`Bearer ${ue}`}},ie=await fetch(Z,{headers:Q});if(ie.status===401||ie.status===403){window.location.href="/login";return}if(!ie.ok)throw new Error(`Failed to fetch pipelines: ${ie.statusText}`);const Ee=await ie.json();o(Ee),Ee.length>0&&!u&&m(Ee[0]),A(!1)}catch(Z){O(Z instanceof Error?Z.message:"Unknown error"),A(!1)}};B();const G=setInterval(B,5e3);return()=>clearInterval(G)},[u,Ne,ce,s]),v.useEffect(()=>{const B=async()=>{try{const Z=localStorage.getItem("monodog_session_token"),ue={"Content-Type":"application/json",...Z&&{Authorization:`Bearer ${Z}`}};i.forEach(async Q=>{if(Q.workflowId&&Q.currentStatus!=="completed"&&!M.has(Q.workflowId)){const ie=`${Sr}/api/workflows/${Ne}/${ce}?workflow_id=${Q.workflowId}&per_page=${je}&page=1`,Ee=await fetch(ie,{headers:ue});if(Ee.ok){const wt=await Ee.json(),qe=wt.workflow_runs?.[0]||wt.runs?.[0];if(qe){const Nt=qe.status!==Q.currentStatus,tn=qe.conclusion!==Q.currentConclusion;if(Nt||tn){R(et=>new Set(et).add(Q.workflowId));try{const et=await fetch(`${Sr}/api/pipelines/${Q.id}/status`,{method:"PUT",headers:ue,body:JSON.stringify({currentStatus:qe.status,currentConclusion:qe.conclusion||null,lastRunId:qe.id})}),bt={...Q,currentStatus:qe.status,currentConclusion:qe.conclusion||null,lastRunId:qe.id};if(console.log(bt),bt.currentStatus=="completed"){const nn=await _t.refreshPackages()}o(nn=>nn.map(At=>At.id===Q.id?bt:At))}catch(et){console.warn("Failed to update pipeline status:",et)}finally{R(et=>{const bt=new Set(et);return bt.delete(Q.workflowId),bt})}}}}}})}catch(Z){console.warn("Failed to poll pipeline status:",Z)}};B();const G=setInterval(B,1e4);return()=>clearInterval(G)},[u,i,Ne,ce]),v.useEffect(()=>{if(!h||!u)return;const B=async()=>{try{const Z=localStorage.getItem("monodog_session_token"),ue={"Content-Type":"application/json",...Z&&{Authorization:`Bearer ${Z}`}},Q=await fetch(`${Sr}/api/workflows/${Ne}/${ce}/runs/${h}`,{headers:ue});if(Q.status===401||Q.status===403){window.location.href="/login";return}if(!Q.ok)throw new Error(`Failed to fetch jobs: ${Q.statusText}`);const ie=await Q.json();y(ie.jobs||[])}catch(Z){O(Z instanceof Error?Z.message:"Unknown error")}},G=setInterval(B,5e3);return B(),()=>clearInterval(G)},[h,Ne,ce]),v.useEffect(()=>{if(!k||!u)return;const B=async()=>{try{const G=localStorage.getItem("monodog_session_token"),Z={"Content-Type":"application/json",...G&&{Authorization:`Bearer ${G}`}},ue=await fetch(`${Sr}/api/workflows/${Ne}/${ce}/jobs/${k.gitHubJobId}/logs`,{headers:Z});if(ue.status===401||ue.status===403){ue.status===403?O("Access denied: You do not have admin rights to view logs for this repository"):(O("Session expired. Please log in again."),window.location.href="/login");return}if(!ue.ok){const ie=await ue.json().catch(()=>({})),Ee=ie.details||ie.error||ue.statusText;Ee.includes("403")||Ee.includes("admin")?O("Admin access required: Repository logs require admin permissions. Contact your repository administrator."):Ee.includes("404")||Ee.includes("not found")?O("Job logs not found. The job may have been cleaned up or the job ID may be invalid."):O(`Failed to fetch logs: ${Ee}`);return}const Q=await ue.json();Q.meta&&Q.meta.isEmpty?(I(""),O("No logs available for this job yet. The job may still be running or logs have been cleaned up.")):(I(Q.logs||Q),O(null))}catch(G){const Z=G instanceof Error?G.message:"Failed to fetch logs";O(`Error loading logs: ${Z}`)}};if(B(),k.status!=="completed"){const G=setInterval(B,5e3);return()=>clearInterval(G)}},[k,Ne,ce]);const W=B=>{j(B),I(null)},se=B=>{const G=B.currentTarget;G.scrollHeight-G.scrollTop-G.clientHeight<100&&!ee&&i.length>=ye&&Y()},Y=async()=>{if(!ee){pe(!0);try{const B=`${Sr}/api/pipelines?offset=${J+ye}&limit=${ye}`,G=localStorage.getItem("monodog_session_token"),Z={"Content-Type":"application/json",...G&&{Authorization:`Bearer ${G}`}},ue=await fetch(B,{headers:Z});if(!ue.ok)throw new Error("Failed to fetch more pipelines");const Q=await ue.json();o(ie=>[...ie,...Q]),ve(ie=>ie+ye)}catch(B){console.error("Error loading more pipelines:",B)}finally{pe(!1)}}},S=B=>{const G=B.currentTarget;G.scrollHeight-G.scrollTop-G.clientHeight<100&&!X&&x.length>=Pe&&h&&D()},D=async()=>{if(!(X||!h)){he(!0);try{const B=localStorage.getItem("monodog_session_token"),G={"Content-Type":"application/json",...B&&{Authorization:`Bearer ${B}`}},Z=await fetch(`${Sr}/api/workflows/${Ne}/${ce}/runs/${h}?page=${Math.floor(xe/Pe)+2}`,{headers:G});if(!Z.ok)throw new Error("Failed to fetch more jobs");const Q=((await Z.json()).jobs||[]).map(ie=>({id:ie.id,gitHubJobId:ie.id,name:ie.name,status:ie.status,conclusion:ie.conclusion||null,htmlUrl:ie.html_url,startedAt:ie.started_at,completedAt:ie.completed_at}));y(ie=>[...ie,...Q]),we(ie=>ie+Pe)}catch(B){console.error("Error loading more jobs:",B)}finally{he(!1)}}},ae=B=>{p(B),j(null),y([]),we(0)};return L&&i.length===0?t.jsx("div",{className:"flex items-center justify-center py-12",children:t.jsx("div",{className:"animate-spin",children:t.jsx(We,{className:"h-8 w-8 text-blue-600"})})}):t.jsxs("div",{children:[t.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6 h-[50vh] overflow-hidden",children:[t.jsx("div",{className:"lg:col-span-1 overflow-y-auto border-r border-gray-200",onScroll:se,children:t.jsxs("div",{className:"p-4 space-y-4",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("h3",{className:"text-lg font-semibold text-gray-900",children:"Pipelines"}),u&&$("maintain")&&t.jsx(Av,{owner:Ne,repo:ce,workflowId:u.workflowPath||u.workflowId})]}),P&&t.jsx("div",{className:"p-3 bg-red-50 border border-red-200 rounded-lg",children:t.jsx("p",{className:"text-xs text-red-700",children:P})}),t.jsx("div",{className:"space-y-2",children:i.length===0?t.jsx("p",{className:"text-sm text-gray-500",children:"No pipelines found"}):t.jsxs(t.Fragment,{children:[i.map(B=>t.jsx("button",{onClick:()=>{m(B),p(null),y([])},className:`w-full text-left p-3 rounded-lg border transition-colors ${u?.id===B.id?"border-blue-500 bg-blue-50":"border-gray-200 hover:bg-gray-50"}`,children:t.jsxs("div",{className:"flex items-start gap-2",children:[mm(B.currentStatus,B.currentConclusion||null,M.has(B.id)),t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsx("p",{className:"font-medium text-sm text-gray-900 truncate",children:B.packageName}),t.jsxs("p",{className:"text-xs text-gray-500",children:["v",B.releaseVersion]}),t.jsx("p",{className:"text-xs text-gray-400 mt-1",children:B.workflowName})]})]})},B.id)),ee&&t.jsx("div",{className:"flex justify-center py-4",children:t.jsx("div",{className:"animate-spin",children:t.jsx(We,{className:"h-5 w-5 text-blue-600"})})})]})})]})}),t.jsx("div",{className:"lg:col-span-1 overflow-y-auto border-r border-gray-200",children:t.jsxs("div",{className:"p-4 space-y-4",children:[t.jsx("h3",{className:"text-lg font-semibold text-gray-900",children:"Runs"}),u&&t.jsx(Lv,{owner:Ne,repo:ce,packageName:s,onSelectRun:ae,runId:h,limit:je,pipelineId:u.id})]})}),t.jsx("div",{className:"lg:col-span-1 overflow-y-auto border-r border-gray-200",onScroll:S,children:t.jsxs("div",{className:"p-4 space-y-4",children:[t.jsx("h3",{className:"text-lg font-semibold text-gray-900",children:"Jobs"}),t.jsx("div",{className:"space-y-2",children:x.length===0?t.jsx("p",{className:"text-sm text-gray-500",children:"No jobs available"}):t.jsxs(t.Fragment,{children:[x.map(B=>{const G=B.startedAt&&B.completedAt?Math.round((new Date(B.completedAt).getTime()-new Date(B.startedAt).getTime())/1e3):0;return B.status==="in_progress"||B.status,B.conclusion,t.jsx("div",{className:`rounded-lg border transition-colors ${k?.id===B.id?"border-blue-500 bg-blue-50":"border-gray-200 hover:bg-gray-50"}`,children:t.jsx("button",{onClick:()=>W(B),className:"w-full text-left p-3",children:t.jsxs("div",{className:"flex items-start gap-2",children:[mm(B.status,B.conclusion),t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsx("p",{className:"font-medium text-sm text-gray-900 truncate",children:B.name}),t.jsxs("p",{className:"text-xs text-gray-500 mt-1",children:[B.status," • ",G,"s"]})]})]})})},B.id)}),X&&t.jsx("div",{className:"flex justify-center py-4",children:t.jsx("div",{className:"animate-spin",children:t.jsx(We,{className:"h-5 w-5 text-blue-600"})})})]})})]})})]}),t.jsx("div",{className:"lg:col-span-1 overflow-hidden border-t pt-2 h-[50vh]",children:t.jsxs("div",{className:"p-4 h-full overflow-hidden flex flex-col",children:[t.jsx("h3",{className:"text-lg font-semibold text-gray-900",children:"Logs"}),k&&E?t.jsx(Ev,{steps:(()=>{const B=Mv(E);let G=0;const Z=ue=>ue.map(Q=>{G++;const ie=Q.logs.at(0)?.split(" ")[0],Ee=Q.logs.at(-1)?.split(" ")[0];return{stepNumber:G,stepName:Q.name,level:Q.level,status:"",conclusion:"",startedAt:ie,completedAt:Ee,logs:Q.logs.map((wt,qe)=>({lineNumber:qe+1,timestamp:new Date().toISOString(),content:wt,ansiContent:wt})),children:Q.children?Z(Q.children):void 0}});return Z(B)})(),jobName:k.name,jobStatus:k.status,jobConclusion:k.conclusion,gitHubLogsUrl:k.htmlUrl}):k?t.jsx("div",{className:"flex items-center justify-center h-full",children:t.jsx("div",{className:"animate-spin",children:t.jsx(We,{className:"h-8 w-8 text-blue-600"})})}):t.jsx("div",{className:"flex items-center justify-center h-full text-gray-500",children:t.jsx("p",{className:"text-sm",children:"Select a job to view logs"})})]})})]})}function Ov(){const{session:s}=Er();return s?t.jsx("div",{className:"h-screen overflow-hidden",children:t.jsx(Iv,{})}):t.jsx("div",{className:"flex items-center justify-center h-screen",children:t.jsx("p",{className:"text-gray-600",children:"Please sign in to view pipelines"})})}const Dv={Dashboard:pp,PackagesOverview:gp,PackageDetail:yp,DependencyGraph:zp,HealthStatus:$p,PublishControl:Jp,CIIntegration:xg,ConfigInspector:Yy,ReleaseManager:nv,Pipeline:Ov},Fv=({componentName:s})=>{const l=Dv[s];return l?t.jsx(l,{}):t.jsx("div",{className:"flex items-center justify-center h-64",children:t.jsxs("div",{className:"text-center",children:[t.jsx("h2",{className:"text-xl font-semibold text-gray-900 mb-2",children:"Page Not Found"}),t.jsx("p",{className:"text-gray-600",children:"The requested page could not be found."})]})})};function zv(){return t.jsxs(Cm,{children:[Em.map(s=>t.jsx(rs,{path:s.path,element:t.jsx(Fv,{componentName:s.component})},s.path)),t.jsx(rs,{path:"*",element:t.jsx("div",{className:"flex items-center justify-center h-64",children:t.jsxs("div",{className:"text-center",children:[t.jsx("div",{className:"text-gray-400 text-6xl mb-4",children:"🔍"}),t.jsx("h2",{className:"text-xl font-semibold text-gray-900 mb-2",children:"404 - Page Not Found"}),t.jsx("p",{className:"text-gray-600 mb-4",children:"The page you're looking for doesn't exist or has been moved."}),t.jsx("a",{href:"/",className:"text-blue-600 hover:text-blue-500 font-medium",children:"Go back to Dashboard"})]})})})]})}const $v=v.createContext(void 0),Bv=window.ENV?.API_URL??"http://localhost:8999",hm=`${Bv}/api`;function Uv({children:s}){const[l,i]=v.useState(new Map),[o,u]=v.useState(!1),[m,h]=v.useState(null),p=(I,L)=>`${I}/${L}`,x=v.useCallback(async(I,L,A)=>{try{u(!0),h(null);const P=p(L,A);if(l.has(P))return l.get(P)||null;const O=await fetch(`${hm}/permissions/${L}/${A}`,{method:"GET",headers:{Authorization:`Bearer ${I}`}});if(!O.ok)throw O.status===401?new Error("Unauthorized"):new Error("Failed to check permission");const M=await O.json(),R={permission:M.permission,role:M.role,canAdmin:M.canAdmin,canMaintain:M.canMaintain,canWrite:M.canWrite,canRead:M.canRead,denied:M.denied};return i($=>{const J=new Map($);return J.set(P,R),J}),R}catch(P){const O=P instanceof Error?P.message:"Permission check failed";return h(O),null}finally{u(!1)}},[l]),y=v.useCallback(async(I,L,A,P)=>{try{u(!0),h(null);const O=await fetch(`${hm}/permissions/${L}/${A}/can-action`,{method:"POST",headers:{Authorization:`Bearer ${I}`,"Content-Type":"application/json"},body:JSON.stringify({action:P})});if(!O.ok)throw new Error("Failed to check action permission");return(await O.json()).can===!0}catch(O){return console.error("Action permission check error:",O),!1}finally{u(!1)}},[]),k=v.useCallback((I,L)=>{const A=p(I,L);i(P=>{const O=new Map(P);return O.delete(A),O})},[]),j=v.useCallback(()=>{i(new Map)},[]),E={permissions:l,isLoading:o,error:m,checkPermission:x,canPerformAction:y,invalidatePermission:k,invalidateAll:j};return t.jsx($v.Provider,{value:E,children:s})}function Hv(){const{login:s,isLoading:l,error:i}=Er(),[o,u]=v.useState(!1),m=async()=>{u(!0),await s()};return t.jsx("div",{className:"min-h-screen flex items-center justify-center bg-gradient-to-br p-5",children:t.jsxs("div",{className:"bg-white rounded-xl shadow-2xl max-w-md w-full overflow-hidden",children:[t.jsxs("div",{className:"bg-gradient-to-br from-primary-500 to-primary-700 text-white p-8 text-center",children:[t.jsx("h1",{className:"text-4xl font-bold m-0",children:"MonoDog"}),t.jsx("p",{className:"text-sm opacity-90 font-medium mt-2 m-0",children:"Monorepo Analytics & Management"})]}),t.jsxs("div",{className:"p-10",children:[t.jsx("h2",{className:"text-2xl font-bold text-gray-900 text-center mb-8",children:"Sign in to your account"}),i&&t.jsx("div",{className:"bg-red-100 text-red-700 px-4 py-3 rounded-lg mb-5 text-sm border-l-4 border-red-700",children:i}),t.jsxs("button",{onClick:m,disabled:l||o,className:"w-full flex items-center justify-center gap-3 px-5 py-3 bg-primary-600 text-white rounded-lg font-semibold text-base cursor-pointer transition-all duration-300 disabled:opacity-60 disabled:cursor-not-allowed hover:enabled:bg-primary-700 hover:enabled:-translate-y-0.5 hover:enabled:shadow-lg mb-8",children:[t.jsx("svg",{className:"w-5 h-5",viewBox:"0 0 24 24",fill:"currentColor",children:t.jsx("path",{d:"M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v 3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z"})}),"Continue with GitHub"]}),t.jsxs("div",{className:"flex items-center gap-3 my-8 text-gray-400 text-xs font-semibold uppercase tracking-widest",children:[t.jsx("div",{className:"flex-1 h-px bg-gray-200"}),t.jsx("span",{children:"GitHub OAuth Authentication"}),t.jsx("div",{className:"flex-1 h-px bg-gray-200"})]}),t.jsxs("div",{className:"bg-primary-50 rounded-lg p-5 border-l-4 border-primary-500",children:[t.jsx("h4",{className:"text-xs font-semibold text-gray-900 mb-3 uppercase tracking-wide",children:"Requested Permissions"}),t.jsxs("ul",{className:"m-0 p-0 list-none space-y-2",children:[t.jsxs("li",{className:"text-sm text-gray-700",children:[t.jsx("code",{className:"bg-white text-primary-500 px-1.5 py-0.5 rounded text-xs font-semibold",children:"read:user"})," - Read your profile information"]}),t.jsxs("li",{className:"text-sm text-gray-700",children:[t.jsx("code",{className:"bg-white text-primary-500 px-1.5 py-0.5 rounded text-xs font-semibold",children:"user:email"})," - Access your email address"]}),t.jsxs("li",{className:"text-sm text-gray-700",children:[t.jsx("code",{className:"bg-white text-primary-500 px-1.5 py-0.5 rounded text-xs font-semibold",children:"repo"})," - Access your repositories (required for private repos)"]})]})]})]}),t.jsx("div",{className:"bg-gray-50 px-10 py-5 border-t border-gray-200 text-center",children:t.jsx("p",{className:"text-xs text-gray-500 leading-relaxed m-0",children:"By signing in, you agree to our Terms of Service and Privacy Policy"})})]})})}function Vv(){const s=Ho(),[l,i]=v.useState(!0),[o,u]=v.useState(null);return v.useEffect(()=>{(async()=>{try{const h=new URLSearchParams(window.location.search),p=h.get("code"),x=h.get("state"),y=h.get("error"),k=h.get("error_description");if(y){u(`${y}: ${k}`),i(!1);return}if(!p||!x){u("Missing authorization code or state"),i(!1);return}const E=`${window.ENV?.API_URL??"http://localhost:8999"}/api`,I=await fetch(`${E}/auth/callback?code=${p}&state=${x}`);if(!I.ok){const P=await I.json();u(P.message||"Authentication failed"),i(!1);return}const L=await I.json();if(!L.success||!L.sessionToken){u("Failed to complete authentication"),i(!1);return}const A=window.__authContext;if(A&&A.handleOAuthCallback)if(await A.handleOAuthCallback(L.sessionToken,L.permission)){const O=L.redirectUrl||"/";s(O)}else u("Failed to store session");else u("Auth context not available")}catch(h){const p=h instanceof Error?h.message:"Unknown error occurred";u(p)}finally{i(!1)}})()},[s]),t.jsx("div",{className:"min-h-screen flex items-center justify-center bg-gradient-to-br from-primary-500 to-primary-700 p-5",children:t.jsx("div",{className:"bg-white rounded-xl shadow-2xl max-w-sm text-center p-10",children:l?t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"w-10 h-10 border-4 border-gray-200 border-t-indigo-500 rounded-full animate-spin mx-auto my-5"}),t.jsx("h2",{className:"text-2xl font-bold text-gray-900 mt-5 mb-2",children:"Completing Authentication..."}),t.jsx("p",{className:"text-gray-700 text-sm leading-relaxed",children:"Please wait while we verify your GitHub account."})]}):o?t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"text-5xl mb-5",children:"⚠️"}),t.jsx("h2",{className:"text-2xl font-bold text-gray-900 mb-3",children:"Authentication Failed"}),t.jsx("p",{className:"text-gray-700 text-sm leading-relaxed mb-5",children:o}),t.jsx("button",{onClick:()=>s("/login"),className:"inline-block px-6 py-3 bg-primary-500 text-white rounded-lg font-semibold text-sm cursor-pointer transition-all duration-300 hover:bg-primary-600 hover:-translate-y-0.5 hover:shadow-lg",children:"Return to Login"})]}):null})})}function Wv({children:s}){const{isAuthenticated:l,isLoading:i}=Er();return i?t.jsxs("div",{className:"loading-container",children:[t.jsx("div",{className:"spinner"}),t.jsx("p",{children:"Loading..."})]}):l?t.jsx(t.Fragment,{children:s}):t.jsx(Uf,{to:"/login",replace:!0})}function Gv(){return t.jsx(Xf,{children:t.jsx(yx,{children:t.jsx(Uv,{children:t.jsxs(Cm,{children:[t.jsx(rs,{path:"/login",element:t.jsx(Hv,{})}),t.jsx(rs,{path:"/auth/callback",element:t.jsx(Vv,{})}),t.jsx(rs,{path:"/*",element:t.jsx(Wv,{children:t.jsx(vx,{children:t.jsx(zv,{})})})})]})})})})}const fm=document.getElementById("root");fm&&Q0.createRoot(fm).render(t.jsx(Gv,{}));
|
|
15
|
+
//# sourceMappingURL=index-6NrFUGfK.js.map
|