@commandgarden/cli 2.5.1 → 2.6.0

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.
Files changed (19) hide show
  1. package/node_modules/@commandgarden/app/dist/client/assets/index-Dm4TTmUS.css +1 -0
  2. package/node_modules/@commandgarden/app/dist/client/assets/index-tVkaaa2g.js +421 -0
  3. package/node_modules/@commandgarden/app/dist/client/index.html +2 -2
  4. package/node_modules/@commandgarden/app/dist/server/journal/sources/git.source.d.ts +1 -1
  5. package/node_modules/@commandgarden/app/dist/server/journal/sources/git.source.js +2 -2
  6. package/node_modules/@commandgarden/app/dist/server/journal/sources/meetings.source.d.ts +12 -13
  7. package/node_modules/@commandgarden/app/dist/server/journal/sources/meetings.source.js +70 -17
  8. package/node_modules/@commandgarden/chrome/dist/service-worker.js +68 -13
  9. package/node_modules/@commandgarden/chrome/dist/service-worker.js.map +2 -2
  10. package/node_modules/@commandgarden/daemon/connectors/ado-git-commits.eval.js +76 -119
  11. package/node_modules/@commandgarden/daemon/connectors/ado-git-commits.yaml +1 -1
  12. package/node_modules/@commandgarden/daemon/connectors/outlook-my-meetings.eval.js +150 -138
  13. package/node_modules/@commandgarden/daemon/connectors/outlook-my-meetings.yaml +1 -0
  14. package/node_modules/@commandgarden/daemon/connectors/teams-room-availability.eval.js +144 -50
  15. package/node_modules/@commandgarden/daemon/connectors/teams-room-availability.yaml +8 -2
  16. package/node_modules/@commandgarden/daemon/dist/ws-relay.js +1 -1
  17. package/package.json +1 -1
  18. package/node_modules/@commandgarden/app/dist/client/assets/index-DCptfmmK.js +0 -397
  19. package/node_modules/@commandgarden/app/dist/client/assets/index-qunCIeG9.css +0 -1
@@ -0,0 +1,421 @@
1
+ function Mm(e,t){for(var n=0;n<t.length;n++){const s=t[n];if(typeof s!="string"&&!Array.isArray(s)){for(const r in s)if(r!=="default"&&!(r in e)){const a=Object.getOwnPropertyDescriptor(s,r);a&&Object.defineProperty(e,r,a.get?a:{enumerable:!0,get:()=>s[r]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))s(r);new MutationObserver(r=>{for(const a of r)if(a.type==="childList")for(const o of a.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&s(o)}).observe(document,{childList:!0,subtree:!0});function n(r){const a={};return r.integrity&&(a.integrity=r.integrity),r.referrerPolicy&&(a.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?a.credentials="include":r.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function s(r){if(r.ep)return;r.ep=!0;const a=n(r);fetch(r.href,a)}})();function Dm(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var gd={exports:{}},Yi={},yd={exports:{}},V={};/**
2
+ * @license React
3
+ * react.production.min.js
4
+ *
5
+ * Copyright (c) Facebook, Inc. and its affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var br=Symbol.for("react.element"),$m=Symbol.for("react.portal"),Rm=Symbol.for("react.fragment"),zm=Symbol.for("react.strict_mode"),Fm=Symbol.for("react.profiler"),Bm=Symbol.for("react.provider"),Um=Symbol.for("react.context"),Wm=Symbol.for("react.forward_ref"),Hm=Symbol.for("react.suspense"),Vm=Symbol.for("react.memo"),Km=Symbol.for("react.lazy"),Cc=Symbol.iterator;function Gm(e){return e===null||typeof e!="object"?null:(e=Cc&&e[Cc]||e["@@iterator"],typeof e=="function"?e:null)}var xd={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},vd=Object.assign,bd={};function us(e,t,n){this.props=e,this.context=t,this.refs=bd,this.updater=n||xd}us.prototype.isReactComponent={};us.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};us.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function jd(){}jd.prototype=us.prototype;function ml(e,t,n){this.props=e,this.context=t,this.refs=bd,this.updater=n||xd}var hl=ml.prototype=new jd;hl.constructor=ml;vd(hl,us.prototype);hl.isPureReactComponent=!0;var Ec=Array.isArray,wd=Object.prototype.hasOwnProperty,gl={current:null},Nd={key:!0,ref:!0,__self:!0,__source:!0};function kd(e,t,n){var s,r={},a=null,o=null;if(t!=null)for(s in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(a=""+t.key),t)wd.call(t,s)&&!Nd.hasOwnProperty(s)&&(r[s]=t[s]);var l=arguments.length-2;if(l===1)r.children=n;else if(1<l){for(var c=Array(l),u=0;u<l;u++)c[u]=arguments[u+2];r.children=c}if(e&&e.defaultProps)for(s in l=e.defaultProps,l)r[s]===void 0&&(r[s]=l[s]);return{$$typeof:br,type:e,key:a,ref:o,props:r,_owner:gl.current}}function qm(e,t){return{$$typeof:br,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function yl(e){return typeof e=="object"&&e!==null&&e.$$typeof===br}function Ym(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var Tc=/\/+/g;function Na(e,t){return typeof e=="object"&&e!==null&&e.key!=null?Ym(""+e.key):t.toString(36)}function ri(e,t,n,s,r){var a=typeof e;(a==="undefined"||a==="boolean")&&(e=null);var o=!1;if(e===null)o=!0;else switch(a){case"string":case"number":o=!0;break;case"object":switch(e.$$typeof){case br:case $m:o=!0}}if(o)return o=e,r=r(o),e=s===""?"."+Na(o,0):s,Ec(r)?(n="",e!=null&&(n=e.replace(Tc,"$&/")+"/"),ri(r,t,n,"",function(u){return u})):r!=null&&(yl(r)&&(r=qm(r,n+(!r.key||o&&o.key===r.key?"":(""+r.key).replace(Tc,"$&/")+"/")+e)),t.push(r)),1;if(o=0,s=s===""?".":s+":",Ec(e))for(var l=0;l<e.length;l++){a=e[l];var c=s+Na(a,l);o+=ri(a,t,n,c,r)}else if(c=Gm(e),typeof c=="function")for(e=c.call(e),l=0;!(a=e.next()).done;)a=a.value,c=s+Na(a,l++),o+=ri(a,t,n,c,r);else if(a==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return o}function Or(e,t,n){if(e==null)return e;var s=[],r=0;return ri(e,s,"","",function(a){return t.call(n,a,r++)}),s}function Qm(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var Ae={current:null},ii={transition:null},Jm={ReactCurrentDispatcher:Ae,ReactCurrentBatchConfig:ii,ReactCurrentOwner:gl};function Sd(){throw Error("act(...) is not supported in production builds of React.")}V.Children={map:Or,forEach:function(e,t,n){Or(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Or(e,function(){t++}),t},toArray:function(e){return Or(e,function(t){return t})||[]},only:function(e){if(!yl(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};V.Component=us;V.Fragment=Rm;V.Profiler=Fm;V.PureComponent=ml;V.StrictMode=zm;V.Suspense=Hm;V.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Jm;V.act=Sd;V.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var s=vd({},e.props),r=e.key,a=e.ref,o=e._owner;if(t!=null){if(t.ref!==void 0&&(a=t.ref,o=gl.current),t.key!==void 0&&(r=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(c in t)wd.call(t,c)&&!Nd.hasOwnProperty(c)&&(s[c]=t[c]===void 0&&l!==void 0?l[c]:t[c])}var c=arguments.length-2;if(c===1)s.children=n;else if(1<c){l=Array(c);for(var u=0;u<c;u++)l[u]=arguments[u+2];s.children=l}return{$$typeof:br,type:e.type,key:r,ref:a,props:s,_owner:o}};V.createContext=function(e){return e={$$typeof:Um,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:Bm,_context:e},e.Consumer=e};V.createElement=kd;V.createFactory=function(e){var t=kd.bind(null,e);return t.type=e,t};V.createRef=function(){return{current:null}};V.forwardRef=function(e){return{$$typeof:Wm,render:e}};V.isValidElement=yl;V.lazy=function(e){return{$$typeof:Km,_payload:{_status:-1,_result:e},_init:Qm}};V.memo=function(e,t){return{$$typeof:Vm,type:e,compare:t===void 0?null:t}};V.startTransition=function(e){var t=ii.transition;ii.transition={};try{e()}finally{ii.transition=t}};V.unstable_act=Sd;V.useCallback=function(e,t){return Ae.current.useCallback(e,t)};V.useContext=function(e){return Ae.current.useContext(e)};V.useDebugValue=function(){};V.useDeferredValue=function(e){return Ae.current.useDeferredValue(e)};V.useEffect=function(e,t){return Ae.current.useEffect(e,t)};V.useId=function(){return Ae.current.useId()};V.useImperativeHandle=function(e,t,n){return Ae.current.useImperativeHandle(e,t,n)};V.useInsertionEffect=function(e,t){return Ae.current.useInsertionEffect(e,t)};V.useLayoutEffect=function(e,t){return Ae.current.useLayoutEffect(e,t)};V.useMemo=function(e,t){return Ae.current.useMemo(e,t)};V.useReducer=function(e,t,n){return Ae.current.useReducer(e,t,n)};V.useRef=function(e){return Ae.current.useRef(e)};V.useState=function(e){return Ae.current.useState(e)};V.useSyncExternalStore=function(e,t,n){return Ae.current.useSyncExternalStore(e,t,n)};V.useTransition=function(){return Ae.current.useTransition()};V.version="18.3.1";yd.exports=V;var b=yd.exports;const Xm=Dm(b),Zm=Mm({__proto__:null,default:Xm},[b]);/**
10
+ * @license React
11
+ * react-jsx-runtime.production.min.js
12
+ *
13
+ * Copyright (c) Facebook, Inc. and its affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var eh=b,th=Symbol.for("react.element"),nh=Symbol.for("react.fragment"),sh=Object.prototype.hasOwnProperty,rh=eh.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,ih={key:!0,ref:!0,__self:!0,__source:!0};function Cd(e,t,n){var s,r={},a=null,o=null;n!==void 0&&(a=""+n),t.key!==void 0&&(a=""+t.key),t.ref!==void 0&&(o=t.ref);for(s in t)sh.call(t,s)&&!ih.hasOwnProperty(s)&&(r[s]=t[s]);if(e&&e.defaultProps)for(s in t=e.defaultProps,t)r[s]===void 0&&(r[s]=t[s]);return{$$typeof:th,type:e,key:a,ref:o,props:r,_owner:rh.current}}Yi.Fragment=nh;Yi.jsx=Cd;Yi.jsxs=Cd;gd.exports=Yi;var i=gd.exports,Ed={exports:{}},Ue={},Td={exports:{}},Ad={};/**
18
+ * @license React
19
+ * scheduler.production.min.js
20
+ *
21
+ * Copyright (c) Facebook, Inc. and its affiliates.
22
+ *
23
+ * This source code is licensed under the MIT license found in the
24
+ * LICENSE file in the root directory of this source tree.
25
+ */(function(e){function t(A,_){var $=A.length;A.push(_);e:for(;0<$;){var z=$-1>>>1,J=A[z];if(0<r(J,_))A[z]=_,A[$]=J,$=z;else break e}}function n(A){return A.length===0?null:A[0]}function s(A){if(A.length===0)return null;var _=A[0],$=A.pop();if($!==_){A[0]=$;e:for(var z=0,J=A.length,$e=J>>>1;z<$e;){var et=2*(z+1)-1,js=A[et],rn=et+1,Ir=A[rn];if(0>r(js,$))rn<J&&0>r(Ir,js)?(A[z]=Ir,A[rn]=$,z=rn):(A[z]=js,A[et]=$,z=et);else if(rn<J&&0>r(Ir,$))A[z]=Ir,A[rn]=$,z=rn;else break e}}return _}function r(A,_){var $=A.sortIndex-_.sortIndex;return $!==0?$:A.id-_.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,l=o.now();e.unstable_now=function(){return o.now()-l}}var c=[],u=[],p=1,d=null,f=3,x=!1,y=!1,v=!1,w=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,h=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function m(A){for(var _=n(u);_!==null;){if(_.callback===null)s(u);else if(_.startTime<=A)s(u),_.sortIndex=_.expirationTime,t(c,_);else break;_=n(u)}}function j(A){if(v=!1,m(A),!y)if(n(c)!==null)y=!0,P(N);else{var _=n(u);_!==null&&R(j,_.startTime-A)}}function N(A,_){y=!1,v&&(v=!1,g(k),k=-1),x=!0;var $=f;try{for(m(_),d=n(c);d!==null&&(!(d.expirationTime>_)||A&&!O());){var z=d.callback;if(typeof z=="function"){d.callback=null,f=d.priorityLevel;var J=z(d.expirationTime<=_);_=e.unstable_now(),typeof J=="function"?d.callback=J:d===n(c)&&s(c),m(_)}else s(c);d=n(c)}if(d!==null)var $e=!0;else{var et=n(u);et!==null&&R(j,et.startTime-_),$e=!1}return $e}finally{d=null,f=$,x=!1}}var C=!1,S=null,k=-1,T=5,L=-1;function O(){return!(e.unstable_now()-L<T)}function U(){if(S!==null){var A=e.unstable_now();L=A;var _=!0;try{_=S(!0,A)}finally{_?F():(C=!1,S=null)}}else C=!1}var F;if(typeof h=="function")F=function(){h(U)};else if(typeof MessageChannel<"u"){var E=new MessageChannel,D=E.port2;E.port1.onmessage=U,F=function(){D.postMessage(null)}}else F=function(){w(U,0)};function P(A){S=A,C||(C=!0,F())}function R(A,_){k=w(function(){A(e.unstable_now())},_)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(A){A.callback=null},e.unstable_continueExecution=function(){y||x||(y=!0,P(N))},e.unstable_forceFrameRate=function(A){0>A||125<A?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):T=0<A?Math.floor(1e3/A):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(c)},e.unstable_next=function(A){switch(f){case 1:case 2:case 3:var _=3;break;default:_=f}var $=f;f=_;try{return A()}finally{f=$}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(A,_){switch(A){case 1:case 2:case 3:case 4:case 5:break;default:A=3}var $=f;f=A;try{return _()}finally{f=$}},e.unstable_scheduleCallback=function(A,_,$){var z=e.unstable_now();switch(typeof $=="object"&&$!==null?($=$.delay,$=typeof $=="number"&&0<$?z+$:z):$=z,A){case 1:var J=-1;break;case 2:J=250;break;case 5:J=1073741823;break;case 4:J=1e4;break;default:J=5e3}return J=$+J,A={id:p++,callback:_,priorityLevel:A,startTime:$,expirationTime:J,sortIndex:-1},$>z?(A.sortIndex=$,t(u,A),n(c)===null&&A===n(u)&&(v?(g(k),k=-1):v=!0,R(j,$-z))):(A.sortIndex=J,t(c,A),y||x||(y=!0,P(N))),A},e.unstable_shouldYield=O,e.unstable_wrapCallback=function(A){var _=f;return function(){var $=f;f=_;try{return A.apply(this,arguments)}finally{f=$}}}})(Ad);Td.exports=Ad;var ah=Td.exports;/**
26
+ * @license React
27
+ * react-dom.production.min.js
28
+ *
29
+ * Copyright (c) Facebook, Inc. and its affiliates.
30
+ *
31
+ * This source code is licensed under the MIT license found in the
32
+ * LICENSE file in the root directory of this source tree.
33
+ */var oh=b,Be=ah;function I(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var Ld=new Set,Xs={};function Nn(e,t){es(e,t),es(e+"Capture",t)}function es(e,t){for(Xs[e]=t,e=0;e<t.length;e++)Ld.add(t[e])}var Ct=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),oo=Object.prototype.hasOwnProperty,lh=/^[: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]*$/,Ac={},Lc={};function ch(e){return oo.call(Lc,e)?!0:oo.call(Ac,e)?!1:lh.test(e)?Lc[e]=!0:(Ac[e]=!0,!1)}function uh(e,t,n,s){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return s?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function dh(e,t,n,s){if(t===null||typeof t>"u"||uh(e,t,n,s))return!0;if(s)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Le(e,t,n,s,r,a,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=s,this.attributeNamespace=r,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=a,this.removeEmptyString=o}var be={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){be[e]=new Le(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];be[t]=new Le(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){be[e]=new Le(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){be[e]=new Le(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){be[e]=new Le(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){be[e]=new Le(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){be[e]=new Le(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){be[e]=new Le(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){be[e]=new Le(e,5,!1,e.toLowerCase(),null,!1,!1)});var xl=/[\-:]([a-z])/g;function vl(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(xl,vl);be[t]=new Le(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(xl,vl);be[t]=new Le(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(xl,vl);be[t]=new Le(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){be[e]=new Le(e,1,!1,e.toLowerCase(),null,!1,!1)});be.xlinkHref=new Le("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){be[e]=new Le(e,1,!1,e.toLowerCase(),null,!0,!0)});function bl(e,t,n,s){var r=be.hasOwnProperty(t)?be[t]:null;(r!==null?r.type!==0:s||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(dh(t,n,r,s)&&(n=null),s||r===null?ch(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):r.mustUseProperty?e[r.propertyName]=n===null?r.type===3?!1:"":n:(t=r.attributeName,s=r.attributeNamespace,n===null?e.removeAttribute(t):(r=r.type,n=r===3||r===4&&n===!0?"":""+n,s?e.setAttributeNS(s,t,n):e.setAttribute(t,n))))}var Lt=oh.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Pr=Symbol.for("react.element"),In=Symbol.for("react.portal"),On=Symbol.for("react.fragment"),jl=Symbol.for("react.strict_mode"),lo=Symbol.for("react.profiler"),Id=Symbol.for("react.provider"),Od=Symbol.for("react.context"),wl=Symbol.for("react.forward_ref"),co=Symbol.for("react.suspense"),uo=Symbol.for("react.suspense_list"),Nl=Symbol.for("react.memo"),Mt=Symbol.for("react.lazy"),Pd=Symbol.for("react.offscreen"),Ic=Symbol.iterator;function ws(e){return e===null||typeof e!="object"?null:(e=Ic&&e[Ic]||e["@@iterator"],typeof e=="function"?e:null)}var ie=Object.assign,ka;function Os(e){if(ka===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);ka=t&&t[1]||""}return`
34
+ `+ka+e}var Sa=!1;function Ca(e,t){if(!e||Sa)return"";Sa=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(u){var s=u}Reflect.construct(e,[],t)}else{try{t.call()}catch(u){s=u}e.call(t.prototype)}else{try{throw Error()}catch(u){s=u}e()}}catch(u){if(u&&s&&typeof u.stack=="string"){for(var r=u.stack.split(`
35
+ `),a=s.stack.split(`
36
+ `),o=r.length-1,l=a.length-1;1<=o&&0<=l&&r[o]!==a[l];)l--;for(;1<=o&&0<=l;o--,l--)if(r[o]!==a[l]){if(o!==1||l!==1)do if(o--,l--,0>l||r[o]!==a[l]){var c=`
37
+ `+r[o].replace(" at new "," at ");return e.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",e.displayName)),c}while(1<=o&&0<=l);break}}}finally{Sa=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Os(e):""}function fh(e){switch(e.tag){case 5:return Os(e.type);case 16:return Os("Lazy");case 13:return Os("Suspense");case 19:return Os("SuspenseList");case 0:case 2:case 15:return e=Ca(e.type,!1),e;case 11:return e=Ca(e.type.render,!1),e;case 1:return e=Ca(e.type,!0),e;default:return""}}function fo(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 On:return"Fragment";case In:return"Portal";case lo:return"Profiler";case jl:return"StrictMode";case co:return"Suspense";case uo:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Od:return(e.displayName||"Context")+".Consumer";case Id:return(e._context.displayName||"Context")+".Provider";case wl:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Nl:return t=e.displayName||null,t!==null?t:fo(e.type)||"Memo";case Mt:t=e._payload,e=e._init;try{return fo(e(t))}catch{}}return null}function ph(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return fo(t);case 8:return t===jl?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Zt(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function _d(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function mh(e){var t=_d(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),s=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var r=n.get,a=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return r.call(this)},set:function(o){s=""+o,a.call(this,o)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return s},setValue:function(o){s=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function _r(e){e._valueTracker||(e._valueTracker=mh(e))}function Md(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),s="";return e&&(s=_d(e)?e.checked?"true":"false":e.value),e=s,e!==n?(t.setValue(e),!0):!1}function bi(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 po(e,t){var n=t.checked;return ie({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Oc(e,t){var n=t.defaultValue==null?"":t.defaultValue,s=t.checked!=null?t.checked:t.defaultChecked;n=Zt(t.value!=null?t.value:n),e._wrapperState={initialChecked:s,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Dd(e,t){t=t.checked,t!=null&&bl(e,"checked",t,!1)}function mo(e,t){Dd(e,t);var n=Zt(t.value),s=t.type;if(n!=null)s==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(s==="submit"||s==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?ho(e,t.type,n):t.hasOwnProperty("defaultValue")&&ho(e,t.type,Zt(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Pc(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var s=t.type;if(!(s!=="submit"&&s!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function ho(e,t,n){(t!=="number"||bi(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Ps=Array.isArray;function Kn(e,t,n,s){if(e=e.options,t){t={};for(var r=0;r<n.length;r++)t["$"+n[r]]=!0;for(n=0;n<e.length;n++)r=t.hasOwnProperty("$"+e[n].value),e[n].selected!==r&&(e[n].selected=r),r&&s&&(e[n].defaultSelected=!0)}else{for(n=""+Zt(n),t=null,r=0;r<e.length;r++){if(e[r].value===n){e[r].selected=!0,s&&(e[r].defaultSelected=!0);return}t!==null||e[r].disabled||(t=e[r])}t!==null&&(t.selected=!0)}}function go(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(I(91));return ie({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function _c(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(I(92));if(Ps(n)){if(1<n.length)throw Error(I(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:Zt(n)}}function $d(e,t){var n=Zt(t.value),s=Zt(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),s!=null&&(e.defaultValue=""+s)}function Mc(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function Rd(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 yo(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?Rd(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Mr,zd=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,s,r){MSApp.execUnsafeLocalFunction(function(){return e(t,n,s,r)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Mr=Mr||document.createElement("div"),Mr.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Mr.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Zs(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Fs={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},hh=["Webkit","ms","Moz","O"];Object.keys(Fs).forEach(function(e){hh.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Fs[t]=Fs[e]})});function Fd(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Fs.hasOwnProperty(e)&&Fs[e]?(""+t).trim():t+"px"}function Bd(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var s=n.indexOf("--")===0,r=Fd(n,t[n],s);n==="float"&&(n="cssFloat"),s?e.setProperty(n,r):e[n]=r}}var gh=ie({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 xo(e,t){if(t){if(gh[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(I(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(I(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(I(61))}if(t.style!=null&&typeof t.style!="object")throw Error(I(62))}}function vo(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var bo=null;function kl(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var jo=null,Gn=null,qn=null;function Dc(e){if(e=Nr(e)){if(typeof jo!="function")throw Error(I(280));var t=e.stateNode;t&&(t=ea(t),jo(e.stateNode,e.type,t))}}function Ud(e){Gn?qn?qn.push(e):qn=[e]:Gn=e}function Wd(){if(Gn){var e=Gn,t=qn;if(qn=Gn=null,Dc(e),t)for(e=0;e<t.length;e++)Dc(t[e])}}function Hd(e,t){return e(t)}function Vd(){}var Ea=!1;function Kd(e,t,n){if(Ea)return e(t,n);Ea=!0;try{return Hd(e,t,n)}finally{Ea=!1,(Gn!==null||qn!==null)&&(Vd(),Wd())}}function er(e,t){var n=e.stateNode;if(n===null)return null;var s=ea(n);if(s===null)return null;n=s[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(s=!s.disabled)||(e=e.type,s=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!s;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(I(231,t,typeof n));return n}var wo=!1;if(Ct)try{var Ns={};Object.defineProperty(Ns,"passive",{get:function(){wo=!0}}),window.addEventListener("test",Ns,Ns),window.removeEventListener("test",Ns,Ns)}catch{wo=!1}function yh(e,t,n,s,r,a,o,l,c){var u=Array.prototype.slice.call(arguments,3);try{t.apply(n,u)}catch(p){this.onError(p)}}var Bs=!1,ji=null,wi=!1,No=null,xh={onError:function(e){Bs=!0,ji=e}};function vh(e,t,n,s,r,a,o,l,c){Bs=!1,ji=null,yh.apply(xh,arguments)}function bh(e,t,n,s,r,a,o,l,c){if(vh.apply(this,arguments),Bs){if(Bs){var u=ji;Bs=!1,ji=null}else throw Error(I(198));wi||(wi=!0,No=u)}}function kn(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function Gd(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function $c(e){if(kn(e)!==e)throw Error(I(188))}function jh(e){var t=e.alternate;if(!t){if(t=kn(e),t===null)throw Error(I(188));return t!==e?null:e}for(var n=e,s=t;;){var r=n.return;if(r===null)break;var a=r.alternate;if(a===null){if(s=r.return,s!==null){n=s;continue}break}if(r.child===a.child){for(a=r.child;a;){if(a===n)return $c(r),e;if(a===s)return $c(r),t;a=a.sibling}throw Error(I(188))}if(n.return!==s.return)n=r,s=a;else{for(var o=!1,l=r.child;l;){if(l===n){o=!0,n=r,s=a;break}if(l===s){o=!0,s=r,n=a;break}l=l.sibling}if(!o){for(l=a.child;l;){if(l===n){o=!0,n=a,s=r;break}if(l===s){o=!0,s=a,n=r;break}l=l.sibling}if(!o)throw Error(I(189))}}if(n.alternate!==s)throw Error(I(190))}if(n.tag!==3)throw Error(I(188));return n.stateNode.current===n?e:t}function qd(e){return e=jh(e),e!==null?Yd(e):null}function Yd(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Yd(e);if(t!==null)return t;e=e.sibling}return null}var Qd=Be.unstable_scheduleCallback,Rc=Be.unstable_cancelCallback,wh=Be.unstable_shouldYield,Nh=Be.unstable_requestPaint,oe=Be.unstable_now,kh=Be.unstable_getCurrentPriorityLevel,Sl=Be.unstable_ImmediatePriority,Jd=Be.unstable_UserBlockingPriority,Ni=Be.unstable_NormalPriority,Sh=Be.unstable_LowPriority,Xd=Be.unstable_IdlePriority,Qi=null,ht=null;function Ch(e){if(ht&&typeof ht.onCommitFiberRoot=="function")try{ht.onCommitFiberRoot(Qi,e,void 0,(e.current.flags&128)===128)}catch{}}var ot=Math.clz32?Math.clz32:Ah,Eh=Math.log,Th=Math.LN2;function Ah(e){return e>>>=0,e===0?32:31-(Eh(e)/Th|0)|0}var Dr=64,$r=4194304;function _s(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 ki(e,t){var n=e.pendingLanes;if(n===0)return 0;var s=0,r=e.suspendedLanes,a=e.pingedLanes,o=n&268435455;if(o!==0){var l=o&~r;l!==0?s=_s(l):(a&=o,a!==0&&(s=_s(a)))}else o=n&~r,o!==0?s=_s(o):a!==0&&(s=_s(a));if(s===0)return 0;if(t!==0&&t!==s&&!(t&r)&&(r=s&-s,a=t&-t,r>=a||r===16&&(a&4194240)!==0))return t;if(s&4&&(s|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=s;0<t;)n=31-ot(t),r=1<<n,s|=e[n],t&=~r;return s}function Lh(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Ih(e,t){for(var n=e.suspendedLanes,s=e.pingedLanes,r=e.expirationTimes,a=e.pendingLanes;0<a;){var o=31-ot(a),l=1<<o,c=r[o];c===-1?(!(l&n)||l&s)&&(r[o]=Lh(l,t)):c<=t&&(e.expiredLanes|=l),a&=~l}}function ko(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Zd(){var e=Dr;return Dr<<=1,!(Dr&4194240)&&(Dr=64),e}function Ta(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function jr(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-ot(t),e[t]=n}function Oh(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var s=e.eventTimes;for(e=e.expirationTimes;0<n;){var r=31-ot(n),a=1<<r;t[r]=0,s[r]=-1,e[r]=-1,n&=~a}}function Cl(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var s=31-ot(n),r=1<<s;r&t|e[s]&t&&(e[s]|=t),n&=~r}}var G=0;function ef(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var tf,El,nf,sf,rf,So=!1,Rr=[],Wt=null,Ht=null,Vt=null,tr=new Map,nr=new Map,Rt=[],Ph="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 zc(e,t){switch(e){case"focusin":case"focusout":Wt=null;break;case"dragenter":case"dragleave":Ht=null;break;case"mouseover":case"mouseout":Vt=null;break;case"pointerover":case"pointerout":tr.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":nr.delete(t.pointerId)}}function ks(e,t,n,s,r,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:s,nativeEvent:a,targetContainers:[r]},t!==null&&(t=Nr(t),t!==null&&El(t)),e):(e.eventSystemFlags|=s,t=e.targetContainers,r!==null&&t.indexOf(r)===-1&&t.push(r),e)}function _h(e,t,n,s,r){switch(t){case"focusin":return Wt=ks(Wt,e,t,n,s,r),!0;case"dragenter":return Ht=ks(Ht,e,t,n,s,r),!0;case"mouseover":return Vt=ks(Vt,e,t,n,s,r),!0;case"pointerover":var a=r.pointerId;return tr.set(a,ks(tr.get(a)||null,e,t,n,s,r)),!0;case"gotpointercapture":return a=r.pointerId,nr.set(a,ks(nr.get(a)||null,e,t,n,s,r)),!0}return!1}function af(e){var t=cn(e.target);if(t!==null){var n=kn(t);if(n!==null){if(t=n.tag,t===13){if(t=Gd(n),t!==null){e.blockedOn=t,rf(e.priority,function(){nf(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function ai(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Co(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var s=new n.constructor(n.type,n);bo=s,n.target.dispatchEvent(s),bo=null}else return t=Nr(n),t!==null&&El(t),e.blockedOn=n,!1;t.shift()}return!0}function Fc(e,t,n){ai(e)&&n.delete(t)}function Mh(){So=!1,Wt!==null&&ai(Wt)&&(Wt=null),Ht!==null&&ai(Ht)&&(Ht=null),Vt!==null&&ai(Vt)&&(Vt=null),tr.forEach(Fc),nr.forEach(Fc)}function Ss(e,t){e.blockedOn===t&&(e.blockedOn=null,So||(So=!0,Be.unstable_scheduleCallback(Be.unstable_NormalPriority,Mh)))}function sr(e){function t(r){return Ss(r,e)}if(0<Rr.length){Ss(Rr[0],e);for(var n=1;n<Rr.length;n++){var s=Rr[n];s.blockedOn===e&&(s.blockedOn=null)}}for(Wt!==null&&Ss(Wt,e),Ht!==null&&Ss(Ht,e),Vt!==null&&Ss(Vt,e),tr.forEach(t),nr.forEach(t),n=0;n<Rt.length;n++)s=Rt[n],s.blockedOn===e&&(s.blockedOn=null);for(;0<Rt.length&&(n=Rt[0],n.blockedOn===null);)af(n),n.blockedOn===null&&Rt.shift()}var Yn=Lt.ReactCurrentBatchConfig,Si=!0;function Dh(e,t,n,s){var r=G,a=Yn.transition;Yn.transition=null;try{G=1,Tl(e,t,n,s)}finally{G=r,Yn.transition=a}}function $h(e,t,n,s){var r=G,a=Yn.transition;Yn.transition=null;try{G=4,Tl(e,t,n,s)}finally{G=r,Yn.transition=a}}function Tl(e,t,n,s){if(Si){var r=Co(e,t,n,s);if(r===null)Ra(e,t,s,Ci,n),zc(e,s);else if(_h(r,e,t,n,s))s.stopPropagation();else if(zc(e,s),t&4&&-1<Ph.indexOf(e)){for(;r!==null;){var a=Nr(r);if(a!==null&&tf(a),a=Co(e,t,n,s),a===null&&Ra(e,t,s,Ci,n),a===r)break;r=a}r!==null&&s.stopPropagation()}else Ra(e,t,s,null,n)}}var Ci=null;function Co(e,t,n,s){if(Ci=null,e=kl(s),e=cn(e),e!==null)if(t=kn(e),t===null)e=null;else if(n=t.tag,n===13){if(e=Gd(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Ci=e,null}function of(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(kh()){case Sl:return 1;case Jd:return 4;case Ni:case Sh:return 16;case Xd:return 536870912;default:return 16}default:return 16}}var Ft=null,Al=null,oi=null;function lf(){if(oi)return oi;var e,t=Al,n=t.length,s,r="value"in Ft?Ft.value:Ft.textContent,a=r.length;for(e=0;e<n&&t[e]===r[e];e++);var o=n-e;for(s=1;s<=o&&t[n-s]===r[a-s];s++);return oi=r.slice(e,1<s?1-s:void 0)}function li(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function zr(){return!0}function Bc(){return!1}function We(e){function t(n,s,r,a,o){this._reactName=n,this._targetInst=r,this.type=s,this.nativeEvent=a,this.target=o,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(n=e[l],this[l]=n?n(a):a[l]);return this.isDefaultPrevented=(a.defaultPrevented!=null?a.defaultPrevented:a.returnValue===!1)?zr:Bc,this.isPropagationStopped=Bc,this}return ie(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=zr)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=zr)},persist:function(){},isPersistent:zr}),t}var ds={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ll=We(ds),wr=ie({},ds,{view:0,detail:0}),Rh=We(wr),Aa,La,Cs,Ji=ie({},wr,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Il,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!==Cs&&(Cs&&e.type==="mousemove"?(Aa=e.screenX-Cs.screenX,La=e.screenY-Cs.screenY):La=Aa=0,Cs=e),Aa)},movementY:function(e){return"movementY"in e?e.movementY:La}}),Uc=We(Ji),zh=ie({},Ji,{dataTransfer:0}),Fh=We(zh),Bh=ie({},wr,{relatedTarget:0}),Ia=We(Bh),Uh=ie({},ds,{animationName:0,elapsedTime:0,pseudoElement:0}),Wh=We(Uh),Hh=ie({},ds,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Vh=We(Hh),Kh=ie({},ds,{data:0}),Wc=We(Kh),Gh={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},qh={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"},Yh={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Qh(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Yh[e])?!!t[e]:!1}function Il(){return Qh}var Jh=ie({},wr,{key:function(e){if(e.key){var t=Gh[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=li(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?qh[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Il,charCode:function(e){return e.type==="keypress"?li(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?li(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Xh=We(Jh),Zh=ie({},Ji,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Hc=We(Zh),eg=ie({},wr,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Il}),tg=We(eg),ng=ie({},ds,{propertyName:0,elapsedTime:0,pseudoElement:0}),sg=We(ng),rg=ie({},Ji,{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}),ig=We(rg),ag=[9,13,27,32],Ol=Ct&&"CompositionEvent"in window,Us=null;Ct&&"documentMode"in document&&(Us=document.documentMode);var og=Ct&&"TextEvent"in window&&!Us,cf=Ct&&(!Ol||Us&&8<Us&&11>=Us),Vc=" ",Kc=!1;function uf(e,t){switch(e){case"keyup":return ag.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function df(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Pn=!1;function lg(e,t){switch(e){case"compositionend":return df(t);case"keypress":return t.which!==32?null:(Kc=!0,Vc);case"textInput":return e=t.data,e===Vc&&Kc?null:e;default:return null}}function cg(e,t){if(Pn)return e==="compositionend"||!Ol&&uf(e,t)?(e=lf(),oi=Al=Ft=null,Pn=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return cf&&t.locale!=="ko"?null:t.data;default:return null}}var ug={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 Gc(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!ug[e.type]:t==="textarea"}function ff(e,t,n,s){Ud(s),t=Ei(t,"onChange"),0<t.length&&(n=new Ll("onChange","change",null,n,s),e.push({event:n,listeners:t}))}var Ws=null,rr=null;function dg(e){Nf(e,0)}function Xi(e){var t=Dn(e);if(Md(t))return e}function fg(e,t){if(e==="change")return t}var pf=!1;if(Ct){var Oa;if(Ct){var Pa="oninput"in document;if(!Pa){var qc=document.createElement("div");qc.setAttribute("oninput","return;"),Pa=typeof qc.oninput=="function"}Oa=Pa}else Oa=!1;pf=Oa&&(!document.documentMode||9<document.documentMode)}function Yc(){Ws&&(Ws.detachEvent("onpropertychange",mf),rr=Ws=null)}function mf(e){if(e.propertyName==="value"&&Xi(rr)){var t=[];ff(t,rr,e,kl(e)),Kd(dg,t)}}function pg(e,t,n){e==="focusin"?(Yc(),Ws=t,rr=n,Ws.attachEvent("onpropertychange",mf)):e==="focusout"&&Yc()}function mg(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Xi(rr)}function hg(e,t){if(e==="click")return Xi(t)}function gg(e,t){if(e==="input"||e==="change")return Xi(t)}function yg(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var ct=typeof Object.is=="function"?Object.is:yg;function ir(e,t){if(ct(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),s=Object.keys(t);if(n.length!==s.length)return!1;for(s=0;s<n.length;s++){var r=n[s];if(!oo.call(t,r)||!ct(e[r],t[r]))return!1}return!0}function Qc(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Jc(e,t){var n=Qc(e);e=0;for(var s;n;){if(n.nodeType===3){if(s=e+n.textContent.length,e<=t&&s>=t)return{node:n,offset:t-e};e=s}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Qc(n)}}function hf(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?hf(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function gf(){for(var e=window,t=bi();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=bi(e.document)}return t}function Pl(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function xg(e){var t=gf(),n=e.focusedElem,s=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&hf(n.ownerDocument.documentElement,n)){if(s!==null&&Pl(n)){if(t=s.start,e=s.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var r=n.textContent.length,a=Math.min(s.start,r);s=s.end===void 0?a:Math.min(s.end,r),!e.extend&&a>s&&(r=s,s=a,a=r),r=Jc(n,a);var o=Jc(n,s);r&&o&&(e.rangeCount!==1||e.anchorNode!==r.node||e.anchorOffset!==r.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(r.node,r.offset),e.removeAllRanges(),a>s?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var vg=Ct&&"documentMode"in document&&11>=document.documentMode,_n=null,Eo=null,Hs=null,To=!1;function Xc(e,t,n){var s=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;To||_n==null||_n!==bi(s)||(s=_n,"selectionStart"in s&&Pl(s)?s={start:s.selectionStart,end:s.selectionEnd}:(s=(s.ownerDocument&&s.ownerDocument.defaultView||window).getSelection(),s={anchorNode:s.anchorNode,anchorOffset:s.anchorOffset,focusNode:s.focusNode,focusOffset:s.focusOffset}),Hs&&ir(Hs,s)||(Hs=s,s=Ei(Eo,"onSelect"),0<s.length&&(t=new Ll("onSelect","select",null,t,n),e.push({event:t,listeners:s}),t.target=_n)))}function Fr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Mn={animationend:Fr("Animation","AnimationEnd"),animationiteration:Fr("Animation","AnimationIteration"),animationstart:Fr("Animation","AnimationStart"),transitionend:Fr("Transition","TransitionEnd")},_a={},yf={};Ct&&(yf=document.createElement("div").style,"AnimationEvent"in window||(delete Mn.animationend.animation,delete Mn.animationiteration.animation,delete Mn.animationstart.animation),"TransitionEvent"in window||delete Mn.transitionend.transition);function Zi(e){if(_a[e])return _a[e];if(!Mn[e])return e;var t=Mn[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in yf)return _a[e]=t[n];return e}var xf=Zi("animationend"),vf=Zi("animationiteration"),bf=Zi("animationstart"),jf=Zi("transitionend"),wf=new Map,Zc="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 tn(e,t){wf.set(e,t),Nn(t,[e])}for(var Ma=0;Ma<Zc.length;Ma++){var Da=Zc[Ma],bg=Da.toLowerCase(),jg=Da[0].toUpperCase()+Da.slice(1);tn(bg,"on"+jg)}tn(xf,"onAnimationEnd");tn(vf,"onAnimationIteration");tn(bf,"onAnimationStart");tn("dblclick","onDoubleClick");tn("focusin","onFocus");tn("focusout","onBlur");tn(jf,"onTransitionEnd");es("onMouseEnter",["mouseout","mouseover"]);es("onMouseLeave",["mouseout","mouseover"]);es("onPointerEnter",["pointerout","pointerover"]);es("onPointerLeave",["pointerout","pointerover"]);Nn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Nn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Nn("onBeforeInput",["compositionend","keypress","textInput","paste"]);Nn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Nn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Nn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ms="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(" "),wg=new Set("cancel close invalid load scroll toggle".split(" ").concat(Ms));function eu(e,t,n){var s=e.type||"unknown-event";e.currentTarget=n,bh(s,t,void 0,e),e.currentTarget=null}function Nf(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var s=e[n],r=s.event;s=s.listeners;e:{var a=void 0;if(t)for(var o=s.length-1;0<=o;o--){var l=s[o],c=l.instance,u=l.currentTarget;if(l=l.listener,c!==a&&r.isPropagationStopped())break e;eu(r,l,u),a=c}else for(o=0;o<s.length;o++){if(l=s[o],c=l.instance,u=l.currentTarget,l=l.listener,c!==a&&r.isPropagationStopped())break e;eu(r,l,u),a=c}}}if(wi)throw e=No,wi=!1,No=null,e}function X(e,t){var n=t[Po];n===void 0&&(n=t[Po]=new Set);var s=e+"__bubble";n.has(s)||(kf(t,e,2,!1),n.add(s))}function $a(e,t,n){var s=0;t&&(s|=4),kf(n,e,s,t)}var Br="_reactListening"+Math.random().toString(36).slice(2);function ar(e){if(!e[Br]){e[Br]=!0,Ld.forEach(function(n){n!=="selectionchange"&&(wg.has(n)||$a(n,!1,e),$a(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Br]||(t[Br]=!0,$a("selectionchange",!1,t))}}function kf(e,t,n,s){switch(of(t)){case 1:var r=Dh;break;case 4:r=$h;break;default:r=Tl}n=r.bind(null,t,n,e),r=void 0,!wo||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(r=!0),s?r!==void 0?e.addEventListener(t,n,{capture:!0,passive:r}):e.addEventListener(t,n,!0):r!==void 0?e.addEventListener(t,n,{passive:r}):e.addEventListener(t,n,!1)}function Ra(e,t,n,s,r){var a=s;if(!(t&1)&&!(t&2)&&s!==null)e:for(;;){if(s===null)return;var o=s.tag;if(o===3||o===4){var l=s.stateNode.containerInfo;if(l===r||l.nodeType===8&&l.parentNode===r)break;if(o===4)for(o=s.return;o!==null;){var c=o.tag;if((c===3||c===4)&&(c=o.stateNode.containerInfo,c===r||c.nodeType===8&&c.parentNode===r))return;o=o.return}for(;l!==null;){if(o=cn(l),o===null)return;if(c=o.tag,c===5||c===6){s=a=o;continue e}l=l.parentNode}}s=s.return}Kd(function(){var u=a,p=kl(n),d=[];e:{var f=wf.get(e);if(f!==void 0){var x=Ll,y=e;switch(e){case"keypress":if(li(n)===0)break e;case"keydown":case"keyup":x=Xh;break;case"focusin":y="focus",x=Ia;break;case"focusout":y="blur",x=Ia;break;case"beforeblur":case"afterblur":x=Ia;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":x=Uc;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":x=Fh;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":x=tg;break;case xf:case vf:case bf:x=Wh;break;case jf:x=sg;break;case"scroll":x=Rh;break;case"wheel":x=ig;break;case"copy":case"cut":case"paste":x=Vh;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":x=Hc}var v=(t&4)!==0,w=!v&&e==="scroll",g=v?f!==null?f+"Capture":null:f;v=[];for(var h=u,m;h!==null;){m=h;var j=m.stateNode;if(m.tag===5&&j!==null&&(m=j,g!==null&&(j=er(h,g),j!=null&&v.push(or(h,j,m)))),w)break;h=h.return}0<v.length&&(f=new x(f,y,null,n,p),d.push({event:f,listeners:v}))}}if(!(t&7)){e:{if(f=e==="mouseover"||e==="pointerover",x=e==="mouseout"||e==="pointerout",f&&n!==bo&&(y=n.relatedTarget||n.fromElement)&&(cn(y)||y[Et]))break e;if((x||f)&&(f=p.window===p?p:(f=p.ownerDocument)?f.defaultView||f.parentWindow:window,x?(y=n.relatedTarget||n.toElement,x=u,y=y?cn(y):null,y!==null&&(w=kn(y),y!==w||y.tag!==5&&y.tag!==6)&&(y=null)):(x=null,y=u),x!==y)){if(v=Uc,j="onMouseLeave",g="onMouseEnter",h="mouse",(e==="pointerout"||e==="pointerover")&&(v=Hc,j="onPointerLeave",g="onPointerEnter",h="pointer"),w=x==null?f:Dn(x),m=y==null?f:Dn(y),f=new v(j,h+"leave",x,n,p),f.target=w,f.relatedTarget=m,j=null,cn(p)===u&&(v=new v(g,h+"enter",y,n,p),v.target=m,v.relatedTarget=w,j=v),w=j,x&&y)t:{for(v=x,g=y,h=0,m=v;m;m=Sn(m))h++;for(m=0,j=g;j;j=Sn(j))m++;for(;0<h-m;)v=Sn(v),h--;for(;0<m-h;)g=Sn(g),m--;for(;h--;){if(v===g||g!==null&&v===g.alternate)break t;v=Sn(v),g=Sn(g)}v=null}else v=null;x!==null&&tu(d,f,x,v,!1),y!==null&&w!==null&&tu(d,w,y,v,!0)}}e:{if(f=u?Dn(u):window,x=f.nodeName&&f.nodeName.toLowerCase(),x==="select"||x==="input"&&f.type==="file")var N=fg;else if(Gc(f))if(pf)N=gg;else{N=mg;var C=pg}else(x=f.nodeName)&&x.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(N=hg);if(N&&(N=N(e,u))){ff(d,N,n,p);break e}C&&C(e,f,u),e==="focusout"&&(C=f._wrapperState)&&C.controlled&&f.type==="number"&&ho(f,"number",f.value)}switch(C=u?Dn(u):window,e){case"focusin":(Gc(C)||C.contentEditable==="true")&&(_n=C,Eo=u,Hs=null);break;case"focusout":Hs=Eo=_n=null;break;case"mousedown":To=!0;break;case"contextmenu":case"mouseup":case"dragend":To=!1,Xc(d,n,p);break;case"selectionchange":if(vg)break;case"keydown":case"keyup":Xc(d,n,p)}var S;if(Ol)e:{switch(e){case"compositionstart":var k="onCompositionStart";break e;case"compositionend":k="onCompositionEnd";break e;case"compositionupdate":k="onCompositionUpdate";break e}k=void 0}else Pn?uf(e,n)&&(k="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(k="onCompositionStart");k&&(cf&&n.locale!=="ko"&&(Pn||k!=="onCompositionStart"?k==="onCompositionEnd"&&Pn&&(S=lf()):(Ft=p,Al="value"in Ft?Ft.value:Ft.textContent,Pn=!0)),C=Ei(u,k),0<C.length&&(k=new Wc(k,e,null,n,p),d.push({event:k,listeners:C}),S?k.data=S:(S=df(n),S!==null&&(k.data=S)))),(S=og?lg(e,n):cg(e,n))&&(u=Ei(u,"onBeforeInput"),0<u.length&&(p=new Wc("onBeforeInput","beforeinput",null,n,p),d.push({event:p,listeners:u}),p.data=S))}Nf(d,t)})}function or(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Ei(e,t){for(var n=t+"Capture",s=[];e!==null;){var r=e,a=r.stateNode;r.tag===5&&a!==null&&(r=a,a=er(e,n),a!=null&&s.unshift(or(e,a,r)),a=er(e,t),a!=null&&s.push(or(e,a,r))),e=e.return}return s}function Sn(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function tu(e,t,n,s,r){for(var a=t._reactName,o=[];n!==null&&n!==s;){var l=n,c=l.alternate,u=l.stateNode;if(c!==null&&c===s)break;l.tag===5&&u!==null&&(l=u,r?(c=er(n,a),c!=null&&o.unshift(or(n,c,l))):r||(c=er(n,a),c!=null&&o.push(or(n,c,l)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Ng=/\r\n?/g,kg=/\u0000|\uFFFD/g;function nu(e){return(typeof e=="string"?e:""+e).replace(Ng,`
38
+ `).replace(kg,"")}function Ur(e,t,n){if(t=nu(t),nu(e)!==t&&n)throw Error(I(425))}function Ti(){}var Ao=null,Lo=null;function Io(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Oo=typeof setTimeout=="function"?setTimeout:void 0,Sg=typeof clearTimeout=="function"?clearTimeout:void 0,su=typeof Promise=="function"?Promise:void 0,Cg=typeof queueMicrotask=="function"?queueMicrotask:typeof su<"u"?function(e){return su.resolve(null).then(e).catch(Eg)}:Oo;function Eg(e){setTimeout(function(){throw e})}function za(e,t){var n=t,s=0;do{var r=n.nextSibling;if(e.removeChild(n),r&&r.nodeType===8)if(n=r.data,n==="/$"){if(s===0){e.removeChild(r),sr(t);return}s--}else n!=="$"&&n!=="$?"&&n!=="$!"||s++;n=r}while(n);sr(t)}function Kt(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function ru(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var fs=Math.random().toString(36).slice(2),mt="__reactFiber$"+fs,lr="__reactProps$"+fs,Et="__reactContainer$"+fs,Po="__reactEvents$"+fs,Tg="__reactListeners$"+fs,Ag="__reactHandles$"+fs;function cn(e){var t=e[mt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Et]||n[mt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=ru(e);e!==null;){if(n=e[mt])return n;e=ru(e)}return t}e=n,n=e.parentNode}return null}function Nr(e){return e=e[mt]||e[Et],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Dn(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(I(33))}function ea(e){return e[lr]||null}var _o=[],$n=-1;function nn(e){return{current:e}}function Z(e){0>$n||(e.current=_o[$n],_o[$n]=null,$n--)}function Y(e,t){$n++,_o[$n]=e.current,e.current=t}var en={},ke=nn(en),_e=nn(!1),gn=en;function ts(e,t){var n=e.type.contextTypes;if(!n)return en;var s=e.stateNode;if(s&&s.__reactInternalMemoizedUnmaskedChildContext===t)return s.__reactInternalMemoizedMaskedChildContext;var r={},a;for(a in n)r[a]=t[a];return s&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=r),r}function Me(e){return e=e.childContextTypes,e!=null}function Ai(){Z(_e),Z(ke)}function iu(e,t,n){if(ke.current!==en)throw Error(I(168));Y(ke,t),Y(_e,n)}function Sf(e,t,n){var s=e.stateNode;if(t=t.childContextTypes,typeof s.getChildContext!="function")return n;s=s.getChildContext();for(var r in s)if(!(r in t))throw Error(I(108,ph(e)||"Unknown",r));return ie({},n,s)}function Li(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||en,gn=ke.current,Y(ke,e),Y(_e,_e.current),!0}function au(e,t,n){var s=e.stateNode;if(!s)throw Error(I(169));n?(e=Sf(e,t,gn),s.__reactInternalMemoizedMergedChildContext=e,Z(_e),Z(ke),Y(ke,e)):Z(_e),Y(_e,n)}var bt=null,ta=!1,Fa=!1;function Cf(e){bt===null?bt=[e]:bt.push(e)}function Lg(e){ta=!0,Cf(e)}function sn(){if(!Fa&&bt!==null){Fa=!0;var e=0,t=G;try{var n=bt;for(G=1;e<n.length;e++){var s=n[e];do s=s(!0);while(s!==null)}bt=null,ta=!1}catch(r){throw bt!==null&&(bt=bt.slice(e+1)),Qd(Sl,sn),r}finally{G=t,Fa=!1}}return null}var Rn=[],zn=0,Ii=null,Oi=0,Ve=[],Ke=0,yn=null,jt=1,wt="";function an(e,t){Rn[zn++]=Oi,Rn[zn++]=Ii,Ii=e,Oi=t}function Ef(e,t,n){Ve[Ke++]=jt,Ve[Ke++]=wt,Ve[Ke++]=yn,yn=e;var s=jt;e=wt;var r=32-ot(s)-1;s&=~(1<<r),n+=1;var a=32-ot(t)+r;if(30<a){var o=r-r%5;a=(s&(1<<o)-1).toString(32),s>>=o,r-=o,jt=1<<32-ot(t)+r|n<<r|s,wt=a+e}else jt=1<<a|n<<r|s,wt=e}function _l(e){e.return!==null&&(an(e,1),Ef(e,1,0))}function Ml(e){for(;e===Ii;)Ii=Rn[--zn],Rn[zn]=null,Oi=Rn[--zn],Rn[zn]=null;for(;e===yn;)yn=Ve[--Ke],Ve[Ke]=null,wt=Ve[--Ke],Ve[Ke]=null,jt=Ve[--Ke],Ve[Ke]=null}var Fe=null,ze=null,te=!1,at=null;function Tf(e,t){var n=qe(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function ou(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,Fe=e,ze=Kt(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Fe=e,ze=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=yn!==null?{id:jt,overflow:wt}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=qe(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,Fe=e,ze=null,!0):!1;default:return!1}}function Mo(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Do(e){if(te){var t=ze;if(t){var n=t;if(!ou(e,t)){if(Mo(e))throw Error(I(418));t=Kt(n.nextSibling);var s=Fe;t&&ou(e,t)?Tf(s,n):(e.flags=e.flags&-4097|2,te=!1,Fe=e)}}else{if(Mo(e))throw Error(I(418));e.flags=e.flags&-4097|2,te=!1,Fe=e}}}function lu(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Fe=e}function Wr(e){if(e!==Fe)return!1;if(!te)return lu(e),te=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Io(e.type,e.memoizedProps)),t&&(t=ze)){if(Mo(e))throw Af(),Error(I(418));for(;t;)Tf(e,t),t=Kt(t.nextSibling)}if(lu(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(I(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){ze=Kt(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}ze=null}}else ze=Fe?Kt(e.stateNode.nextSibling):null;return!0}function Af(){for(var e=ze;e;)e=Kt(e.nextSibling)}function ns(){ze=Fe=null,te=!1}function Dl(e){at===null?at=[e]:at.push(e)}var Ig=Lt.ReactCurrentBatchConfig;function Es(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(I(309));var s=n.stateNode}if(!s)throw Error(I(147,e));var r=s,a=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===a?t.ref:(t=function(o){var l=r.refs;o===null?delete l[a]:l[a]=o},t._stringRef=a,t)}if(typeof e!="string")throw Error(I(284));if(!n._owner)throw Error(I(290,e))}return e}function Hr(e,t){throw e=Object.prototype.toString.call(t),Error(I(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function cu(e){var t=e._init;return t(e._payload)}function Lf(e){function t(g,h){if(e){var m=g.deletions;m===null?(g.deletions=[h],g.flags|=16):m.push(h)}}function n(g,h){if(!e)return null;for(;h!==null;)t(g,h),h=h.sibling;return null}function s(g,h){for(g=new Map;h!==null;)h.key!==null?g.set(h.key,h):g.set(h.index,h),h=h.sibling;return g}function r(g,h){return g=Qt(g,h),g.index=0,g.sibling=null,g}function a(g,h,m){return g.index=m,e?(m=g.alternate,m!==null?(m=m.index,m<h?(g.flags|=2,h):m):(g.flags|=2,h)):(g.flags|=1048576,h)}function o(g){return e&&g.alternate===null&&(g.flags|=2),g}function l(g,h,m,j){return h===null||h.tag!==6?(h=Ga(m,g.mode,j),h.return=g,h):(h=r(h,m),h.return=g,h)}function c(g,h,m,j){var N=m.type;return N===On?p(g,h,m.props.children,j,m.key):h!==null&&(h.elementType===N||typeof N=="object"&&N!==null&&N.$$typeof===Mt&&cu(N)===h.type)?(j=r(h,m.props),j.ref=Es(g,h,m),j.return=g,j):(j=hi(m.type,m.key,m.props,null,g.mode,j),j.ref=Es(g,h,m),j.return=g,j)}function u(g,h,m,j){return h===null||h.tag!==4||h.stateNode.containerInfo!==m.containerInfo||h.stateNode.implementation!==m.implementation?(h=qa(m,g.mode,j),h.return=g,h):(h=r(h,m.children||[]),h.return=g,h)}function p(g,h,m,j,N){return h===null||h.tag!==7?(h=hn(m,g.mode,j,N),h.return=g,h):(h=r(h,m),h.return=g,h)}function d(g,h,m){if(typeof h=="string"&&h!==""||typeof h=="number")return h=Ga(""+h,g.mode,m),h.return=g,h;if(typeof h=="object"&&h!==null){switch(h.$$typeof){case Pr:return m=hi(h.type,h.key,h.props,null,g.mode,m),m.ref=Es(g,null,h),m.return=g,m;case In:return h=qa(h,g.mode,m),h.return=g,h;case Mt:var j=h._init;return d(g,j(h._payload),m)}if(Ps(h)||ws(h))return h=hn(h,g.mode,m,null),h.return=g,h;Hr(g,h)}return null}function f(g,h,m,j){var N=h!==null?h.key:null;if(typeof m=="string"&&m!==""||typeof m=="number")return N!==null?null:l(g,h,""+m,j);if(typeof m=="object"&&m!==null){switch(m.$$typeof){case Pr:return m.key===N?c(g,h,m,j):null;case In:return m.key===N?u(g,h,m,j):null;case Mt:return N=m._init,f(g,h,N(m._payload),j)}if(Ps(m)||ws(m))return N!==null?null:p(g,h,m,j,null);Hr(g,m)}return null}function x(g,h,m,j,N){if(typeof j=="string"&&j!==""||typeof j=="number")return g=g.get(m)||null,l(h,g,""+j,N);if(typeof j=="object"&&j!==null){switch(j.$$typeof){case Pr:return g=g.get(j.key===null?m:j.key)||null,c(h,g,j,N);case In:return g=g.get(j.key===null?m:j.key)||null,u(h,g,j,N);case Mt:var C=j._init;return x(g,h,m,C(j._payload),N)}if(Ps(j)||ws(j))return g=g.get(m)||null,p(h,g,j,N,null);Hr(h,j)}return null}function y(g,h,m,j){for(var N=null,C=null,S=h,k=h=0,T=null;S!==null&&k<m.length;k++){S.index>k?(T=S,S=null):T=S.sibling;var L=f(g,S,m[k],j);if(L===null){S===null&&(S=T);break}e&&S&&L.alternate===null&&t(g,S),h=a(L,h,k),C===null?N=L:C.sibling=L,C=L,S=T}if(k===m.length)return n(g,S),te&&an(g,k),N;if(S===null){for(;k<m.length;k++)S=d(g,m[k],j),S!==null&&(h=a(S,h,k),C===null?N=S:C.sibling=S,C=S);return te&&an(g,k),N}for(S=s(g,S);k<m.length;k++)T=x(S,g,k,m[k],j),T!==null&&(e&&T.alternate!==null&&S.delete(T.key===null?k:T.key),h=a(T,h,k),C===null?N=T:C.sibling=T,C=T);return e&&S.forEach(function(O){return t(g,O)}),te&&an(g,k),N}function v(g,h,m,j){var N=ws(m);if(typeof N!="function")throw Error(I(150));if(m=N.call(m),m==null)throw Error(I(151));for(var C=N=null,S=h,k=h=0,T=null,L=m.next();S!==null&&!L.done;k++,L=m.next()){S.index>k?(T=S,S=null):T=S.sibling;var O=f(g,S,L.value,j);if(O===null){S===null&&(S=T);break}e&&S&&O.alternate===null&&t(g,S),h=a(O,h,k),C===null?N=O:C.sibling=O,C=O,S=T}if(L.done)return n(g,S),te&&an(g,k),N;if(S===null){for(;!L.done;k++,L=m.next())L=d(g,L.value,j),L!==null&&(h=a(L,h,k),C===null?N=L:C.sibling=L,C=L);return te&&an(g,k),N}for(S=s(g,S);!L.done;k++,L=m.next())L=x(S,g,k,L.value,j),L!==null&&(e&&L.alternate!==null&&S.delete(L.key===null?k:L.key),h=a(L,h,k),C===null?N=L:C.sibling=L,C=L);return e&&S.forEach(function(U){return t(g,U)}),te&&an(g,k),N}function w(g,h,m,j){if(typeof m=="object"&&m!==null&&m.type===On&&m.key===null&&(m=m.props.children),typeof m=="object"&&m!==null){switch(m.$$typeof){case Pr:e:{for(var N=m.key,C=h;C!==null;){if(C.key===N){if(N=m.type,N===On){if(C.tag===7){n(g,C.sibling),h=r(C,m.props.children),h.return=g,g=h;break e}}else if(C.elementType===N||typeof N=="object"&&N!==null&&N.$$typeof===Mt&&cu(N)===C.type){n(g,C.sibling),h=r(C,m.props),h.ref=Es(g,C,m),h.return=g,g=h;break e}n(g,C);break}else t(g,C);C=C.sibling}m.type===On?(h=hn(m.props.children,g.mode,j,m.key),h.return=g,g=h):(j=hi(m.type,m.key,m.props,null,g.mode,j),j.ref=Es(g,h,m),j.return=g,g=j)}return o(g);case In:e:{for(C=m.key;h!==null;){if(h.key===C)if(h.tag===4&&h.stateNode.containerInfo===m.containerInfo&&h.stateNode.implementation===m.implementation){n(g,h.sibling),h=r(h,m.children||[]),h.return=g,g=h;break e}else{n(g,h);break}else t(g,h);h=h.sibling}h=qa(m,g.mode,j),h.return=g,g=h}return o(g);case Mt:return C=m._init,w(g,h,C(m._payload),j)}if(Ps(m))return y(g,h,m,j);if(ws(m))return v(g,h,m,j);Hr(g,m)}return typeof m=="string"&&m!==""||typeof m=="number"?(m=""+m,h!==null&&h.tag===6?(n(g,h.sibling),h=r(h,m),h.return=g,g=h):(n(g,h),h=Ga(m,g.mode,j),h.return=g,g=h),o(g)):n(g,h)}return w}var ss=Lf(!0),If=Lf(!1),Pi=nn(null),_i=null,Fn=null,$l=null;function Rl(){$l=Fn=_i=null}function zl(e){var t=Pi.current;Z(Pi),e._currentValue=t}function $o(e,t,n){for(;e!==null;){var s=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,s!==null&&(s.childLanes|=t)):s!==null&&(s.childLanes&t)!==t&&(s.childLanes|=t),e===n)break;e=e.return}}function Qn(e,t){_i=e,$l=Fn=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Oe=!0),e.firstContext=null)}function Je(e){var t=e._currentValue;if($l!==e)if(e={context:e,memoizedValue:t,next:null},Fn===null){if(_i===null)throw Error(I(308));Fn=e,_i.dependencies={lanes:0,firstContext:e}}else Fn=Fn.next=e;return t}var un=null;function Fl(e){un===null?un=[e]:un.push(e)}function Of(e,t,n,s){var r=t.interleaved;return r===null?(n.next=n,Fl(t)):(n.next=r.next,r.next=n),t.interleaved=n,Tt(e,s)}function Tt(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Dt=!1;function Bl(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Pf(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function kt(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Gt(e,t,n){var s=e.updateQueue;if(s===null)return null;if(s=s.shared,K&2){var r=s.pending;return r===null?t.next=t:(t.next=r.next,r.next=t),s.pending=t,Tt(e,n)}return r=s.interleaved,r===null?(t.next=t,Fl(s)):(t.next=r.next,r.next=t),s.interleaved=t,Tt(e,n)}function ci(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var s=t.lanes;s&=e.pendingLanes,n|=s,t.lanes=n,Cl(e,n)}}function uu(e,t){var n=e.updateQueue,s=e.alternate;if(s!==null&&(s=s.updateQueue,n===s)){var r=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};a===null?r=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?r=a=t:a=a.next=t}else r=a=t;n={baseState:s.baseState,firstBaseUpdate:r,lastBaseUpdate:a,shared:s.shared,effects:s.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Mi(e,t,n,s){var r=e.updateQueue;Dt=!1;var a=r.firstBaseUpdate,o=r.lastBaseUpdate,l=r.shared.pending;if(l!==null){r.shared.pending=null;var c=l,u=c.next;c.next=null,o===null?a=u:o.next=u,o=c;var p=e.alternate;p!==null&&(p=p.updateQueue,l=p.lastBaseUpdate,l!==o&&(l===null?p.firstBaseUpdate=u:l.next=u,p.lastBaseUpdate=c))}if(a!==null){var d=r.baseState;o=0,p=u=c=null,l=a;do{var f=l.lane,x=l.eventTime;if((s&f)===f){p!==null&&(p=p.next={eventTime:x,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var y=e,v=l;switch(f=t,x=n,v.tag){case 1:if(y=v.payload,typeof y=="function"){d=y.call(x,d,f);break e}d=y;break e;case 3:y.flags=y.flags&-65537|128;case 0:if(y=v.payload,f=typeof y=="function"?y.call(x,d,f):y,f==null)break e;d=ie({},d,f);break e;case 2:Dt=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,f=r.effects,f===null?r.effects=[l]:f.push(l))}else x={eventTime:x,lane:f,tag:l.tag,payload:l.payload,callback:l.callback,next:null},p===null?(u=p=x,c=d):p=p.next=x,o|=f;if(l=l.next,l===null){if(l=r.shared.pending,l===null)break;f=l,l=f.next,f.next=null,r.lastBaseUpdate=f,r.shared.pending=null}}while(!0);if(p===null&&(c=d),r.baseState=c,r.firstBaseUpdate=u,r.lastBaseUpdate=p,t=r.shared.interleaved,t!==null){r=t;do o|=r.lane,r=r.next;while(r!==t)}else a===null&&(r.shared.lanes=0);vn|=o,e.lanes=o,e.memoizedState=d}}function du(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var s=e[t],r=s.callback;if(r!==null){if(s.callback=null,s=n,typeof r!="function")throw Error(I(191,r));r.call(s)}}}var kr={},gt=nn(kr),cr=nn(kr),ur=nn(kr);function dn(e){if(e===kr)throw Error(I(174));return e}function Ul(e,t){switch(Y(ur,t),Y(cr,e),Y(gt,kr),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:yo(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=yo(t,e)}Z(gt),Y(gt,t)}function rs(){Z(gt),Z(cr),Z(ur)}function _f(e){dn(ur.current);var t=dn(gt.current),n=yo(t,e.type);t!==n&&(Y(cr,e),Y(gt,n))}function Wl(e){cr.current===e&&(Z(gt),Z(cr))}var ne=nn(0);function Di(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Ba=[];function Hl(){for(var e=0;e<Ba.length;e++)Ba[e]._workInProgressVersionPrimary=null;Ba.length=0}var ui=Lt.ReactCurrentDispatcher,Ua=Lt.ReactCurrentBatchConfig,xn=0,se=null,pe=null,he=null,$i=!1,Vs=!1,dr=0,Og=0;function je(){throw Error(I(321))}function Vl(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!ct(e[n],t[n]))return!1;return!0}function Kl(e,t,n,s,r,a){if(xn=a,se=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,ui.current=e===null||e.memoizedState===null?Dg:$g,e=n(s,r),Vs){a=0;do{if(Vs=!1,dr=0,25<=a)throw Error(I(301));a+=1,he=pe=null,t.updateQueue=null,ui.current=Rg,e=n(s,r)}while(Vs)}if(ui.current=Ri,t=pe!==null&&pe.next!==null,xn=0,he=pe=se=null,$i=!1,t)throw Error(I(300));return e}function Gl(){var e=dr!==0;return dr=0,e}function pt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return he===null?se.memoizedState=he=e:he=he.next=e,he}function Xe(){if(pe===null){var e=se.alternate;e=e!==null?e.memoizedState:null}else e=pe.next;var t=he===null?se.memoizedState:he.next;if(t!==null)he=t,pe=e;else{if(e===null)throw Error(I(310));pe=e,e={memoizedState:pe.memoizedState,baseState:pe.baseState,baseQueue:pe.baseQueue,queue:pe.queue,next:null},he===null?se.memoizedState=he=e:he=he.next=e}return he}function fr(e,t){return typeof t=="function"?t(e):t}function Wa(e){var t=Xe(),n=t.queue;if(n===null)throw Error(I(311));n.lastRenderedReducer=e;var s=pe,r=s.baseQueue,a=n.pending;if(a!==null){if(r!==null){var o=r.next;r.next=a.next,a.next=o}s.baseQueue=r=a,n.pending=null}if(r!==null){a=r.next,s=s.baseState;var l=o=null,c=null,u=a;do{var p=u.lane;if((xn&p)===p)c!==null&&(c=c.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),s=u.hasEagerState?u.eagerState:e(s,u.action);else{var d={lane:p,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};c===null?(l=c=d,o=s):c=c.next=d,se.lanes|=p,vn|=p}u=u.next}while(u!==null&&u!==a);c===null?o=s:c.next=l,ct(s,t.memoizedState)||(Oe=!0),t.memoizedState=s,t.baseState=o,t.baseQueue=c,n.lastRenderedState=s}if(e=n.interleaved,e!==null){r=e;do a=r.lane,se.lanes|=a,vn|=a,r=r.next;while(r!==e)}else r===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Ha(e){var t=Xe(),n=t.queue;if(n===null)throw Error(I(311));n.lastRenderedReducer=e;var s=n.dispatch,r=n.pending,a=t.memoizedState;if(r!==null){n.pending=null;var o=r=r.next;do a=e(a,o.action),o=o.next;while(o!==r);ct(a,t.memoizedState)||(Oe=!0),t.memoizedState=a,t.baseQueue===null&&(t.baseState=a),n.lastRenderedState=a}return[a,s]}function Mf(){}function Df(e,t){var n=se,s=Xe(),r=t(),a=!ct(s.memoizedState,r);if(a&&(s.memoizedState=r,Oe=!0),s=s.queue,ql(zf.bind(null,n,s,e),[e]),s.getSnapshot!==t||a||he!==null&&he.memoizedState.tag&1){if(n.flags|=2048,pr(9,Rf.bind(null,n,s,r,t),void 0,null),ge===null)throw Error(I(349));xn&30||$f(n,t,r)}return r}function $f(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=se.updateQueue,t===null?(t={lastEffect:null,stores:null},se.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Rf(e,t,n,s){t.value=n,t.getSnapshot=s,Ff(t)&&Bf(e)}function zf(e,t,n){return n(function(){Ff(t)&&Bf(e)})}function Ff(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!ct(e,n)}catch{return!0}}function Bf(e){var t=Tt(e,1);t!==null&&lt(t,e,1,-1)}function fu(e){var t=pt();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:fr,lastRenderedState:e},t.queue=e,e=e.dispatch=Mg.bind(null,se,e),[t.memoizedState,e]}function pr(e,t,n,s){return e={tag:e,create:t,destroy:n,deps:s,next:null},t=se.updateQueue,t===null?(t={lastEffect:null,stores:null},se.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(s=n.next,n.next=e,e.next=s,t.lastEffect=e)),e}function Uf(){return Xe().memoizedState}function di(e,t,n,s){var r=pt();se.flags|=e,r.memoizedState=pr(1|t,n,void 0,s===void 0?null:s)}function na(e,t,n,s){var r=Xe();s=s===void 0?null:s;var a=void 0;if(pe!==null){var o=pe.memoizedState;if(a=o.destroy,s!==null&&Vl(s,o.deps)){r.memoizedState=pr(t,n,a,s);return}}se.flags|=e,r.memoizedState=pr(1|t,n,a,s)}function pu(e,t){return di(8390656,8,e,t)}function ql(e,t){return na(2048,8,e,t)}function Wf(e,t){return na(4,2,e,t)}function Hf(e,t){return na(4,4,e,t)}function Vf(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Kf(e,t,n){return n=n!=null?n.concat([e]):null,na(4,4,Vf.bind(null,t,e),n)}function Yl(){}function Gf(e,t){var n=Xe();t=t===void 0?null:t;var s=n.memoizedState;return s!==null&&t!==null&&Vl(t,s[1])?s[0]:(n.memoizedState=[e,t],e)}function qf(e,t){var n=Xe();t=t===void 0?null:t;var s=n.memoizedState;return s!==null&&t!==null&&Vl(t,s[1])?s[0]:(e=e(),n.memoizedState=[e,t],e)}function Yf(e,t,n){return xn&21?(ct(n,t)||(n=Zd(),se.lanes|=n,vn|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Oe=!0),e.memoizedState=n)}function Pg(e,t){var n=G;G=n!==0&&4>n?n:4,e(!0);var s=Ua.transition;Ua.transition={};try{e(!1),t()}finally{G=n,Ua.transition=s}}function Qf(){return Xe().memoizedState}function _g(e,t,n){var s=Yt(e);if(n={lane:s,action:n,hasEagerState:!1,eagerState:null,next:null},Jf(e))Xf(t,n);else if(n=Of(e,t,n,s),n!==null){var r=Ee();lt(n,e,s,r),Zf(n,t,s)}}function Mg(e,t,n){var s=Yt(e),r={lane:s,action:n,hasEagerState:!1,eagerState:null,next:null};if(Jf(e))Xf(t,r);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,l=a(o,n);if(r.hasEagerState=!0,r.eagerState=l,ct(l,o)){var c=t.interleaved;c===null?(r.next=r,Fl(t)):(r.next=c.next,c.next=r),t.interleaved=r;return}}catch{}finally{}n=Of(e,t,r,s),n!==null&&(r=Ee(),lt(n,e,s,r),Zf(n,t,s))}}function Jf(e){var t=e.alternate;return e===se||t!==null&&t===se}function Xf(e,t){Vs=$i=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Zf(e,t,n){if(n&4194240){var s=t.lanes;s&=e.pendingLanes,n|=s,t.lanes=n,Cl(e,n)}}var Ri={readContext:Je,useCallback:je,useContext:je,useEffect:je,useImperativeHandle:je,useInsertionEffect:je,useLayoutEffect:je,useMemo:je,useReducer:je,useRef:je,useState:je,useDebugValue:je,useDeferredValue:je,useTransition:je,useMutableSource:je,useSyncExternalStore:je,useId:je,unstable_isNewReconciler:!1},Dg={readContext:Je,useCallback:function(e,t){return pt().memoizedState=[e,t===void 0?null:t],e},useContext:Je,useEffect:pu,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,di(4194308,4,Vf.bind(null,t,e),n)},useLayoutEffect:function(e,t){return di(4194308,4,e,t)},useInsertionEffect:function(e,t){return di(4,2,e,t)},useMemo:function(e,t){var n=pt();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var s=pt();return t=n!==void 0?n(t):t,s.memoizedState=s.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},s.queue=e,e=e.dispatch=_g.bind(null,se,e),[s.memoizedState,e]},useRef:function(e){var t=pt();return e={current:e},t.memoizedState=e},useState:fu,useDebugValue:Yl,useDeferredValue:function(e){return pt().memoizedState=e},useTransition:function(){var e=fu(!1),t=e[0];return e=Pg.bind(null,e[1]),pt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var s=se,r=pt();if(te){if(n===void 0)throw Error(I(407));n=n()}else{if(n=t(),ge===null)throw Error(I(349));xn&30||$f(s,t,n)}r.memoizedState=n;var a={value:n,getSnapshot:t};return r.queue=a,pu(zf.bind(null,s,a,e),[e]),s.flags|=2048,pr(9,Rf.bind(null,s,a,n,t),void 0,null),n},useId:function(){var e=pt(),t=ge.identifierPrefix;if(te){var n=wt,s=jt;n=(s&~(1<<32-ot(s)-1)).toString(32)+n,t=":"+t+"R"+n,n=dr++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=Og++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},$g={readContext:Je,useCallback:Gf,useContext:Je,useEffect:ql,useImperativeHandle:Kf,useInsertionEffect:Wf,useLayoutEffect:Hf,useMemo:qf,useReducer:Wa,useRef:Uf,useState:function(){return Wa(fr)},useDebugValue:Yl,useDeferredValue:function(e){var t=Xe();return Yf(t,pe.memoizedState,e)},useTransition:function(){var e=Wa(fr)[0],t=Xe().memoizedState;return[e,t]},useMutableSource:Mf,useSyncExternalStore:Df,useId:Qf,unstable_isNewReconciler:!1},Rg={readContext:Je,useCallback:Gf,useContext:Je,useEffect:ql,useImperativeHandle:Kf,useInsertionEffect:Wf,useLayoutEffect:Hf,useMemo:qf,useReducer:Ha,useRef:Uf,useState:function(){return Ha(fr)},useDebugValue:Yl,useDeferredValue:function(e){var t=Xe();return pe===null?t.memoizedState=e:Yf(t,pe.memoizedState,e)},useTransition:function(){var e=Ha(fr)[0],t=Xe().memoizedState;return[e,t]},useMutableSource:Mf,useSyncExternalStore:Df,useId:Qf,unstable_isNewReconciler:!1};function st(e,t){if(e&&e.defaultProps){t=ie({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function Ro(e,t,n,s){t=e.memoizedState,n=n(s,t),n=n==null?t:ie({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var sa={isMounted:function(e){return(e=e._reactInternals)?kn(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var s=Ee(),r=Yt(e),a=kt(s,r);a.payload=t,n!=null&&(a.callback=n),t=Gt(e,a,r),t!==null&&(lt(t,e,r,s),ci(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var s=Ee(),r=Yt(e),a=kt(s,r);a.tag=1,a.payload=t,n!=null&&(a.callback=n),t=Gt(e,a,r),t!==null&&(lt(t,e,r,s),ci(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Ee(),s=Yt(e),r=kt(n,s);r.tag=2,t!=null&&(r.callback=t),t=Gt(e,r,s),t!==null&&(lt(t,e,s,n),ci(t,e,s))}};function mu(e,t,n,s,r,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(s,a,o):t.prototype&&t.prototype.isPureReactComponent?!ir(n,s)||!ir(r,a):!0}function ep(e,t,n){var s=!1,r=en,a=t.contextType;return typeof a=="object"&&a!==null?a=Je(a):(r=Me(t)?gn:ke.current,s=t.contextTypes,a=(s=s!=null)?ts(e,r):en),t=new t(n,a),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=sa,e.stateNode=t,t._reactInternals=e,s&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=r,e.__reactInternalMemoizedMaskedChildContext=a),t}function hu(e,t,n,s){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,s),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,s),t.state!==e&&sa.enqueueReplaceState(t,t.state,null)}function zo(e,t,n,s){var r=e.stateNode;r.props=n,r.state=e.memoizedState,r.refs={},Bl(e);var a=t.contextType;typeof a=="object"&&a!==null?r.context=Je(a):(a=Me(t)?gn:ke.current,r.context=ts(e,a)),r.state=e.memoizedState,a=t.getDerivedStateFromProps,typeof a=="function"&&(Ro(e,t,a,n),r.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof r.getSnapshotBeforeUpdate=="function"||typeof r.UNSAFE_componentWillMount!="function"&&typeof r.componentWillMount!="function"||(t=r.state,typeof r.componentWillMount=="function"&&r.componentWillMount(),typeof r.UNSAFE_componentWillMount=="function"&&r.UNSAFE_componentWillMount(),t!==r.state&&sa.enqueueReplaceState(r,r.state,null),Mi(e,n,r,s),r.state=e.memoizedState),typeof r.componentDidMount=="function"&&(e.flags|=4194308)}function is(e,t){try{var n="",s=t;do n+=fh(s),s=s.return;while(s);var r=n}catch(a){r=`
39
+ Error generating stack: `+a.message+`
40
+ `+a.stack}return{value:e,source:t,stack:r,digest:null}}function Va(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Fo(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var zg=typeof WeakMap=="function"?WeakMap:Map;function tp(e,t,n){n=kt(-1,n),n.tag=3,n.payload={element:null};var s=t.value;return n.callback=function(){Fi||(Fi=!0,Qo=s),Fo(e,t)},n}function np(e,t,n){n=kt(-1,n),n.tag=3;var s=e.type.getDerivedStateFromError;if(typeof s=="function"){var r=t.value;n.payload=function(){return s(r)},n.callback=function(){Fo(e,t)}}var a=e.stateNode;return a!==null&&typeof a.componentDidCatch=="function"&&(n.callback=function(){Fo(e,t),typeof s!="function"&&(qt===null?qt=new Set([this]):qt.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),n}function gu(e,t,n){var s=e.pingCache;if(s===null){s=e.pingCache=new zg;var r=new Set;s.set(t,r)}else r=s.get(t),r===void 0&&(r=new Set,s.set(t,r));r.has(n)||(r.add(n),e=Zg.bind(null,e,t,n),t.then(e,e))}function yu(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function xu(e,t,n,s,r){return e.mode&1?(e.flags|=65536,e.lanes=r,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=kt(-1,1),t.tag=2,Gt(n,t,1))),n.lanes|=1),e)}var Fg=Lt.ReactCurrentOwner,Oe=!1;function Se(e,t,n,s){t.child=e===null?If(t,null,n,s):ss(t,e.child,n,s)}function vu(e,t,n,s,r){n=n.render;var a=t.ref;return Qn(t,r),s=Kl(e,t,n,s,a,r),n=Gl(),e!==null&&!Oe?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~r,At(e,t,r)):(te&&n&&_l(t),t.flags|=1,Se(e,t,s,r),t.child)}function bu(e,t,n,s,r){if(e===null){var a=n.type;return typeof a=="function"&&!sc(a)&&a.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=a,sp(e,t,a,s,r)):(e=hi(n.type,null,s,t,t.mode,r),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!(e.lanes&r)){var o=a.memoizedProps;if(n=n.compare,n=n!==null?n:ir,n(o,s)&&e.ref===t.ref)return At(e,t,r)}return t.flags|=1,e=Qt(a,s),e.ref=t.ref,e.return=t,t.child=e}function sp(e,t,n,s,r){if(e!==null){var a=e.memoizedProps;if(ir(a,s)&&e.ref===t.ref)if(Oe=!1,t.pendingProps=s=a,(e.lanes&r)!==0)e.flags&131072&&(Oe=!0);else return t.lanes=e.lanes,At(e,t,r)}return Bo(e,t,n,s,r)}function rp(e,t,n){var s=t.pendingProps,r=s.children,a=e!==null?e.memoizedState:null;if(s.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Y(Un,Re),Re|=n;else{if(!(n&1073741824))return e=a!==null?a.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Y(Un,Re),Re|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},s=a!==null?a.baseLanes:n,Y(Un,Re),Re|=s}else a!==null?(s=a.baseLanes|n,t.memoizedState=null):s=n,Y(Un,Re),Re|=s;return Se(e,t,r,n),t.child}function ip(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Bo(e,t,n,s,r){var a=Me(n)?gn:ke.current;return a=ts(t,a),Qn(t,r),n=Kl(e,t,n,s,a,r),s=Gl(),e!==null&&!Oe?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~r,At(e,t,r)):(te&&s&&_l(t),t.flags|=1,Se(e,t,n,r),t.child)}function ju(e,t,n,s,r){if(Me(n)){var a=!0;Li(t)}else a=!1;if(Qn(t,r),t.stateNode===null)fi(e,t),ep(t,n,s),zo(t,n,s,r),s=!0;else if(e===null){var o=t.stateNode,l=t.memoizedProps;o.props=l;var c=o.context,u=n.contextType;typeof u=="object"&&u!==null?u=Je(u):(u=Me(n)?gn:ke.current,u=ts(t,u));var p=n.getDerivedStateFromProps,d=typeof p=="function"||typeof o.getSnapshotBeforeUpdate=="function";d||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==s||c!==u)&&hu(t,o,s,u),Dt=!1;var f=t.memoizedState;o.state=f,Mi(t,s,o,r),c=t.memoizedState,l!==s||f!==c||_e.current||Dt?(typeof p=="function"&&(Ro(t,n,p,s),c=t.memoizedState),(l=Dt||mu(t,n,l,s,f,c,u))?(d||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(t.flags|=4194308)):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=s,t.memoizedState=c),o.props=s,o.state=c,o.context=u,s=l):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),s=!1)}else{o=t.stateNode,Pf(e,t),l=t.memoizedProps,u=t.type===t.elementType?l:st(t.type,l),o.props=u,d=t.pendingProps,f=o.context,c=n.contextType,typeof c=="object"&&c!==null?c=Je(c):(c=Me(n)?gn:ke.current,c=ts(t,c));var x=n.getDerivedStateFromProps;(p=typeof x=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==d||f!==c)&&hu(t,o,s,c),Dt=!1,f=t.memoizedState,o.state=f,Mi(t,s,o,r);var y=t.memoizedState;l!==d||f!==y||_e.current||Dt?(typeof x=="function"&&(Ro(t,n,x,s),y=t.memoizedState),(u=Dt||mu(t,n,u,s,f,y,c)||!1)?(p||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(s,y,c),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(s,y,c)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=s,t.memoizedState=y),o.props=s,o.state=y,o.context=c,s=u):(typeof o.componentDidUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),s=!1)}return Uo(e,t,n,s,a,r)}function Uo(e,t,n,s,r,a){ip(e,t);var o=(t.flags&128)!==0;if(!s&&!o)return r&&au(t,n,!1),At(e,t,a);s=t.stateNode,Fg.current=t;var l=o&&typeof n.getDerivedStateFromError!="function"?null:s.render();return t.flags|=1,e!==null&&o?(t.child=ss(t,e.child,null,a),t.child=ss(t,null,l,a)):Se(e,t,l,a),t.memoizedState=s.state,r&&au(t,n,!0),t.child}function ap(e){var t=e.stateNode;t.pendingContext?iu(e,t.pendingContext,t.pendingContext!==t.context):t.context&&iu(e,t.context,!1),Ul(e,t.containerInfo)}function wu(e,t,n,s,r){return ns(),Dl(r),t.flags|=256,Se(e,t,n,s),t.child}var Wo={dehydrated:null,treeContext:null,retryLane:0};function Ho(e){return{baseLanes:e,cachePool:null,transitions:null}}function op(e,t,n){var s=t.pendingProps,r=ne.current,a=!1,o=(t.flags&128)!==0,l;if((l=o)||(l=e!==null&&e.memoizedState===null?!1:(r&2)!==0),l?(a=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(r|=1),Y(ne,r&1),e===null)return Do(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(o=s.children,e=s.fallback,a?(s=t.mode,a=t.child,o={mode:"hidden",children:o},!(s&1)&&a!==null?(a.childLanes=0,a.pendingProps=o):a=aa(o,s,0,null),e=hn(e,s,n,null),a.return=t,e.return=t,a.sibling=e,t.child=a,t.child.memoizedState=Ho(n),t.memoizedState=Wo,e):Ql(t,o));if(r=e.memoizedState,r!==null&&(l=r.dehydrated,l!==null))return Bg(e,t,o,s,l,r,n);if(a){a=s.fallback,o=t.mode,r=e.child,l=r.sibling;var c={mode:"hidden",children:s.children};return!(o&1)&&t.child!==r?(s=t.child,s.childLanes=0,s.pendingProps=c,t.deletions=null):(s=Qt(r,c),s.subtreeFlags=r.subtreeFlags&14680064),l!==null?a=Qt(l,a):(a=hn(a,o,n,null),a.flags|=2),a.return=t,s.return=t,s.sibling=a,t.child=s,s=a,a=t.child,o=e.child.memoizedState,o=o===null?Ho(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},a.memoizedState=o,a.childLanes=e.childLanes&~n,t.memoizedState=Wo,s}return a=e.child,e=a.sibling,s=Qt(a,{mode:"visible",children:s.children}),!(t.mode&1)&&(s.lanes=n),s.return=t,s.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=s,t.memoizedState=null,s}function Ql(e,t){return t=aa({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Vr(e,t,n,s){return s!==null&&Dl(s),ss(t,e.child,null,n),e=Ql(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Bg(e,t,n,s,r,a,o){if(n)return t.flags&256?(t.flags&=-257,s=Va(Error(I(422))),Vr(e,t,o,s)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(a=s.fallback,r=t.mode,s=aa({mode:"visible",children:s.children},r,0,null),a=hn(a,r,o,null),a.flags|=2,s.return=t,a.return=t,s.sibling=a,t.child=s,t.mode&1&&ss(t,e.child,null,o),t.child.memoizedState=Ho(o),t.memoizedState=Wo,a);if(!(t.mode&1))return Vr(e,t,o,null);if(r.data==="$!"){if(s=r.nextSibling&&r.nextSibling.dataset,s)var l=s.dgst;return s=l,a=Error(I(419)),s=Va(a,s,void 0),Vr(e,t,o,s)}if(l=(o&e.childLanes)!==0,Oe||l){if(s=ge,s!==null){switch(o&-o){case 4:r=2;break;case 16:r=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:r=32;break;case 536870912:r=268435456;break;default:r=0}r=r&(s.suspendedLanes|o)?0:r,r!==0&&r!==a.retryLane&&(a.retryLane=r,Tt(e,r),lt(s,e,r,-1))}return nc(),s=Va(Error(I(421))),Vr(e,t,o,s)}return r.data==="$?"?(t.flags|=128,t.child=e.child,t=ey.bind(null,e),r._reactRetry=t,null):(e=a.treeContext,ze=Kt(r.nextSibling),Fe=t,te=!0,at=null,e!==null&&(Ve[Ke++]=jt,Ve[Ke++]=wt,Ve[Ke++]=yn,jt=e.id,wt=e.overflow,yn=t),t=Ql(t,s.children),t.flags|=4096,t)}function Nu(e,t,n){e.lanes|=t;var s=e.alternate;s!==null&&(s.lanes|=t),$o(e.return,t,n)}function Ka(e,t,n,s,r){var a=e.memoizedState;a===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:s,tail:n,tailMode:r}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=s,a.tail=n,a.tailMode=r)}function lp(e,t,n){var s=t.pendingProps,r=s.revealOrder,a=s.tail;if(Se(e,t,s.children,n),s=ne.current,s&2)s=s&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Nu(e,n,t);else if(e.tag===19)Nu(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}s&=1}if(Y(ne,s),!(t.mode&1))t.memoizedState=null;else switch(r){case"forwards":for(n=t.child,r=null;n!==null;)e=n.alternate,e!==null&&Di(e)===null&&(r=n),n=n.sibling;n=r,n===null?(r=t.child,t.child=null):(r=n.sibling,n.sibling=null),Ka(t,!1,r,n,a);break;case"backwards":for(n=null,r=t.child,t.child=null;r!==null;){if(e=r.alternate,e!==null&&Di(e)===null){t.child=r;break}e=r.sibling,r.sibling=n,n=r,r=e}Ka(t,!0,n,null,a);break;case"together":Ka(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function fi(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function At(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),vn|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(I(153));if(t.child!==null){for(e=t.child,n=Qt(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Qt(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Ug(e,t,n){switch(t.tag){case 3:ap(t),ns();break;case 5:_f(t);break;case 1:Me(t.type)&&Li(t);break;case 4:Ul(t,t.stateNode.containerInfo);break;case 10:var s=t.type._context,r=t.memoizedProps.value;Y(Pi,s._currentValue),s._currentValue=r;break;case 13:if(s=t.memoizedState,s!==null)return s.dehydrated!==null?(Y(ne,ne.current&1),t.flags|=128,null):n&t.child.childLanes?op(e,t,n):(Y(ne,ne.current&1),e=At(e,t,n),e!==null?e.sibling:null);Y(ne,ne.current&1);break;case 19:if(s=(n&t.childLanes)!==0,e.flags&128){if(s)return lp(e,t,n);t.flags|=128}if(r=t.memoizedState,r!==null&&(r.rendering=null,r.tail=null,r.lastEffect=null),Y(ne,ne.current),s)break;return null;case 22:case 23:return t.lanes=0,rp(e,t,n)}return At(e,t,n)}var cp,Vo,up,dp;cp=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};Vo=function(){};up=function(e,t,n,s){var r=e.memoizedProps;if(r!==s){e=t.stateNode,dn(gt.current);var a=null;switch(n){case"input":r=po(e,r),s=po(e,s),a=[];break;case"select":r=ie({},r,{value:void 0}),s=ie({},s,{value:void 0}),a=[];break;case"textarea":r=go(e,r),s=go(e,s),a=[];break;default:typeof r.onClick!="function"&&typeof s.onClick=="function"&&(e.onclick=Ti)}xo(n,s);var o;n=null;for(u in r)if(!s.hasOwnProperty(u)&&r.hasOwnProperty(u)&&r[u]!=null)if(u==="style"){var l=r[u];for(o in l)l.hasOwnProperty(o)&&(n||(n={}),n[o]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(Xs.hasOwnProperty(u)?a||(a=[]):(a=a||[]).push(u,null));for(u in s){var c=s[u];if(l=r!=null?r[u]:void 0,s.hasOwnProperty(u)&&c!==l&&(c!=null||l!=null))if(u==="style")if(l){for(o in l)!l.hasOwnProperty(o)||c&&c.hasOwnProperty(o)||(n||(n={}),n[o]="");for(o in c)c.hasOwnProperty(o)&&l[o]!==c[o]&&(n||(n={}),n[o]=c[o])}else n||(a||(a=[]),a.push(u,n)),n=c;else u==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,l=l?l.__html:void 0,c!=null&&l!==c&&(a=a||[]).push(u,c)):u==="children"?typeof c!="string"&&typeof c!="number"||(a=a||[]).push(u,""+c):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(Xs.hasOwnProperty(u)?(c!=null&&u==="onScroll"&&X("scroll",e),a||l===c||(a=[])):(a=a||[]).push(u,c))}n&&(a=a||[]).push("style",n);var u=a;(t.updateQueue=u)&&(t.flags|=4)}};dp=function(e,t,n,s){n!==s&&(t.flags|=4)};function Ts(e,t){if(!te)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var s=null;n!==null;)n.alternate!==null&&(s=n),n=n.sibling;s===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:s.sibling=null}}function we(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,s=0;if(t)for(var r=e.child;r!==null;)n|=r.lanes|r.childLanes,s|=r.subtreeFlags&14680064,s|=r.flags&14680064,r.return=e,r=r.sibling;else for(r=e.child;r!==null;)n|=r.lanes|r.childLanes,s|=r.subtreeFlags,s|=r.flags,r.return=e,r=r.sibling;return e.subtreeFlags|=s,e.childLanes=n,t}function Wg(e,t,n){var s=t.pendingProps;switch(Ml(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return we(t),null;case 1:return Me(t.type)&&Ai(),we(t),null;case 3:return s=t.stateNode,rs(),Z(_e),Z(ke),Hl(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(e===null||e.child===null)&&(Wr(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,at!==null&&(Zo(at),at=null))),Vo(e,t),we(t),null;case 5:Wl(t);var r=dn(ur.current);if(n=t.type,e!==null&&t.stateNode!=null)up(e,t,n,s,r),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!s){if(t.stateNode===null)throw Error(I(166));return we(t),null}if(e=dn(gt.current),Wr(t)){s=t.stateNode,n=t.type;var a=t.memoizedProps;switch(s[mt]=t,s[lr]=a,e=(t.mode&1)!==0,n){case"dialog":X("cancel",s),X("close",s);break;case"iframe":case"object":case"embed":X("load",s);break;case"video":case"audio":for(r=0;r<Ms.length;r++)X(Ms[r],s);break;case"source":X("error",s);break;case"img":case"image":case"link":X("error",s),X("load",s);break;case"details":X("toggle",s);break;case"input":Oc(s,a),X("invalid",s);break;case"select":s._wrapperState={wasMultiple:!!a.multiple},X("invalid",s);break;case"textarea":_c(s,a),X("invalid",s)}xo(n,a),r=null;for(var o in a)if(a.hasOwnProperty(o)){var l=a[o];o==="children"?typeof l=="string"?s.textContent!==l&&(a.suppressHydrationWarning!==!0&&Ur(s.textContent,l,e),r=["children",l]):typeof l=="number"&&s.textContent!==""+l&&(a.suppressHydrationWarning!==!0&&Ur(s.textContent,l,e),r=["children",""+l]):Xs.hasOwnProperty(o)&&l!=null&&o==="onScroll"&&X("scroll",s)}switch(n){case"input":_r(s),Pc(s,a,!0);break;case"textarea":_r(s),Mc(s);break;case"select":case"option":break;default:typeof a.onClick=="function"&&(s.onclick=Ti)}s=r,t.updateQueue=s,s!==null&&(t.flags|=4)}else{o=r.nodeType===9?r:r.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=Rd(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=o.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof s.is=="string"?e=o.createElement(n,{is:s.is}):(e=o.createElement(n),n==="select"&&(o=e,s.multiple?o.multiple=!0:s.size&&(o.size=s.size))):e=o.createElementNS(e,n),e[mt]=t,e[lr]=s,cp(e,t,!1,!1),t.stateNode=e;e:{switch(o=vo(n,s),n){case"dialog":X("cancel",e),X("close",e),r=s;break;case"iframe":case"object":case"embed":X("load",e),r=s;break;case"video":case"audio":for(r=0;r<Ms.length;r++)X(Ms[r],e);r=s;break;case"source":X("error",e),r=s;break;case"img":case"image":case"link":X("error",e),X("load",e),r=s;break;case"details":X("toggle",e),r=s;break;case"input":Oc(e,s),r=po(e,s),X("invalid",e);break;case"option":r=s;break;case"select":e._wrapperState={wasMultiple:!!s.multiple},r=ie({},s,{value:void 0}),X("invalid",e);break;case"textarea":_c(e,s),r=go(e,s),X("invalid",e);break;default:r=s}xo(n,r),l=r;for(a in l)if(l.hasOwnProperty(a)){var c=l[a];a==="style"?Bd(e,c):a==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&zd(e,c)):a==="children"?typeof c=="string"?(n!=="textarea"||c!=="")&&Zs(e,c):typeof c=="number"&&Zs(e,""+c):a!=="suppressContentEditableWarning"&&a!=="suppressHydrationWarning"&&a!=="autoFocus"&&(Xs.hasOwnProperty(a)?c!=null&&a==="onScroll"&&X("scroll",e):c!=null&&bl(e,a,c,o))}switch(n){case"input":_r(e),Pc(e,s,!1);break;case"textarea":_r(e),Mc(e);break;case"option":s.value!=null&&e.setAttribute("value",""+Zt(s.value));break;case"select":e.multiple=!!s.multiple,a=s.value,a!=null?Kn(e,!!s.multiple,a,!1):s.defaultValue!=null&&Kn(e,!!s.multiple,s.defaultValue,!0);break;default:typeof r.onClick=="function"&&(e.onclick=Ti)}switch(n){case"button":case"input":case"select":case"textarea":s=!!s.autoFocus;break e;case"img":s=!0;break e;default:s=!1}}s&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return we(t),null;case 6:if(e&&t.stateNode!=null)dp(e,t,e.memoizedProps,s);else{if(typeof s!="string"&&t.stateNode===null)throw Error(I(166));if(n=dn(ur.current),dn(gt.current),Wr(t)){if(s=t.stateNode,n=t.memoizedProps,s[mt]=t,(a=s.nodeValue!==n)&&(e=Fe,e!==null))switch(e.tag){case 3:Ur(s.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Ur(s.nodeValue,n,(e.mode&1)!==0)}a&&(t.flags|=4)}else s=(n.nodeType===9?n:n.ownerDocument).createTextNode(s),s[mt]=t,t.stateNode=s}return we(t),null;case 13:if(Z(ne),s=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(te&&ze!==null&&t.mode&1&&!(t.flags&128))Af(),ns(),t.flags|=98560,a=!1;else if(a=Wr(t),s!==null&&s.dehydrated!==null){if(e===null){if(!a)throw Error(I(318));if(a=t.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(I(317));a[mt]=t}else ns(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;we(t),a=!1}else at!==null&&(Zo(at),at=null),a=!0;if(!a)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(s=s!==null,s!==(e!==null&&e.memoizedState!==null)&&s&&(t.child.flags|=8192,t.mode&1&&(e===null||ne.current&1?me===0&&(me=3):nc())),t.updateQueue!==null&&(t.flags|=4),we(t),null);case 4:return rs(),Vo(e,t),e===null&&ar(t.stateNode.containerInfo),we(t),null;case 10:return zl(t.type._context),we(t),null;case 17:return Me(t.type)&&Ai(),we(t),null;case 19:if(Z(ne),a=t.memoizedState,a===null)return we(t),null;if(s=(t.flags&128)!==0,o=a.rendering,o===null)if(s)Ts(a,!1);else{if(me!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Di(e),o!==null){for(t.flags|=128,Ts(a,!1),s=o.updateQueue,s!==null&&(t.updateQueue=s,t.flags|=4),t.subtreeFlags=0,s=n,n=t.child;n!==null;)a=n,e=s,a.flags&=14680066,o=a.alternate,o===null?(a.childLanes=0,a.lanes=e,a.child=null,a.subtreeFlags=0,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null,a.stateNode=null):(a.childLanes=o.childLanes,a.lanes=o.lanes,a.child=o.child,a.subtreeFlags=0,a.deletions=null,a.memoizedProps=o.memoizedProps,a.memoizedState=o.memoizedState,a.updateQueue=o.updateQueue,a.type=o.type,e=o.dependencies,a.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return Y(ne,ne.current&1|2),t.child}e=e.sibling}a.tail!==null&&oe()>as&&(t.flags|=128,s=!0,Ts(a,!1),t.lanes=4194304)}else{if(!s)if(e=Di(o),e!==null){if(t.flags|=128,s=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Ts(a,!0),a.tail===null&&a.tailMode==="hidden"&&!o.alternate&&!te)return we(t),null}else 2*oe()-a.renderingStartTime>as&&n!==1073741824&&(t.flags|=128,s=!0,Ts(a,!1),t.lanes=4194304);a.isBackwards?(o.sibling=t.child,t.child=o):(n=a.last,n!==null?n.sibling=o:t.child=o,a.last=o)}return a.tail!==null?(t=a.tail,a.rendering=t,a.tail=t.sibling,a.renderingStartTime=oe(),t.sibling=null,n=ne.current,Y(ne,s?n&1|2:n&1),t):(we(t),null);case 22:case 23:return tc(),s=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==s&&(t.flags|=8192),s&&t.mode&1?Re&1073741824&&(we(t),t.subtreeFlags&6&&(t.flags|=8192)):we(t),null;case 24:return null;case 25:return null}throw Error(I(156,t.tag))}function Hg(e,t){switch(Ml(t),t.tag){case 1:return Me(t.type)&&Ai(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return rs(),Z(_e),Z(ke),Hl(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Wl(t),null;case 13:if(Z(ne),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(I(340));ns()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Z(ne),null;case 4:return rs(),null;case 10:return zl(t.type._context),null;case 22:case 23:return tc(),null;case 24:return null;default:return null}}var Kr=!1,Ne=!1,Vg=typeof WeakSet=="function"?WeakSet:Set,M=null;function Bn(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(s){ae(e,t,s)}else n.current=null}function Ko(e,t,n){try{n()}catch(s){ae(e,t,s)}}var ku=!1;function Kg(e,t){if(Ao=Si,e=gf(),Pl(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var s=n.getSelection&&n.getSelection();if(s&&s.rangeCount!==0){n=s.anchorNode;var r=s.anchorOffset,a=s.focusNode;s=s.focusOffset;try{n.nodeType,a.nodeType}catch{n=null;break e}var o=0,l=-1,c=-1,u=0,p=0,d=e,f=null;t:for(;;){for(var x;d!==n||r!==0&&d.nodeType!==3||(l=o+r),d!==a||s!==0&&d.nodeType!==3||(c=o+s),d.nodeType===3&&(o+=d.nodeValue.length),(x=d.firstChild)!==null;)f=d,d=x;for(;;){if(d===e)break t;if(f===n&&++u===r&&(l=o),f===a&&++p===s&&(c=o),(x=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=x}n=l===-1||c===-1?null:{start:l,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(Lo={focusedElem:e,selectionRange:n},Si=!1,M=t;M!==null;)if(t=M,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,M=e;else for(;M!==null;){t=M;try{var y=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(y!==null){var v=y.memoizedProps,w=y.memoizedState,g=t.stateNode,h=g.getSnapshotBeforeUpdate(t.elementType===t.type?v:st(t.type,v),w);g.__reactInternalSnapshotBeforeUpdate=h}break;case 3:var m=t.stateNode.containerInfo;m.nodeType===1?m.textContent="":m.nodeType===9&&m.documentElement&&m.removeChild(m.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(I(163))}}catch(j){ae(t,t.return,j)}if(e=t.sibling,e!==null){e.return=t.return,M=e;break}M=t.return}return y=ku,ku=!1,y}function Ks(e,t,n){var s=t.updateQueue;if(s=s!==null?s.lastEffect:null,s!==null){var r=s=s.next;do{if((r.tag&e)===e){var a=r.destroy;r.destroy=void 0,a!==void 0&&Ko(t,n,a)}r=r.next}while(r!==s)}}function ra(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var s=n.create;n.destroy=s()}n=n.next}while(n!==t)}}function Go(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function fp(e){var t=e.alternate;t!==null&&(e.alternate=null,fp(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[mt],delete t[lr],delete t[Po],delete t[Tg],delete t[Ag])),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 pp(e){return e.tag===5||e.tag===3||e.tag===4}function Su(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||pp(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 qo(e,t,n){var s=e.tag;if(s===5||s===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Ti));else if(s!==4&&(e=e.child,e!==null))for(qo(e,t,n),e=e.sibling;e!==null;)qo(e,t,n),e=e.sibling}function Yo(e,t,n){var s=e.tag;if(s===5||s===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(s!==4&&(e=e.child,e!==null))for(Yo(e,t,n),e=e.sibling;e!==null;)Yo(e,t,n),e=e.sibling}var ye=null,it=!1;function Pt(e,t,n){for(n=n.child;n!==null;)mp(e,t,n),n=n.sibling}function mp(e,t,n){if(ht&&typeof ht.onCommitFiberUnmount=="function")try{ht.onCommitFiberUnmount(Qi,n)}catch{}switch(n.tag){case 5:Ne||Bn(n,t);case 6:var s=ye,r=it;ye=null,Pt(e,t,n),ye=s,it=r,ye!==null&&(it?(e=ye,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):ye.removeChild(n.stateNode));break;case 18:ye!==null&&(it?(e=ye,n=n.stateNode,e.nodeType===8?za(e.parentNode,n):e.nodeType===1&&za(e,n),sr(e)):za(ye,n.stateNode));break;case 4:s=ye,r=it,ye=n.stateNode.containerInfo,it=!0,Pt(e,t,n),ye=s,it=r;break;case 0:case 11:case 14:case 15:if(!Ne&&(s=n.updateQueue,s!==null&&(s=s.lastEffect,s!==null))){r=s=s.next;do{var a=r,o=a.destroy;a=a.tag,o!==void 0&&(a&2||a&4)&&Ko(n,t,o),r=r.next}while(r!==s)}Pt(e,t,n);break;case 1:if(!Ne&&(Bn(n,t),s=n.stateNode,typeof s.componentWillUnmount=="function"))try{s.props=n.memoizedProps,s.state=n.memoizedState,s.componentWillUnmount()}catch(l){ae(n,t,l)}Pt(e,t,n);break;case 21:Pt(e,t,n);break;case 22:n.mode&1?(Ne=(s=Ne)||n.memoizedState!==null,Pt(e,t,n),Ne=s):Pt(e,t,n);break;default:Pt(e,t,n)}}function Cu(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new Vg),t.forEach(function(s){var r=ty.bind(null,e,s);n.has(s)||(n.add(s),s.then(r,r))})}}function tt(e,t){var n=t.deletions;if(n!==null)for(var s=0;s<n.length;s++){var r=n[s];try{var a=e,o=t,l=o;e:for(;l!==null;){switch(l.tag){case 5:ye=l.stateNode,it=!1;break e;case 3:ye=l.stateNode.containerInfo,it=!0;break e;case 4:ye=l.stateNode.containerInfo,it=!0;break e}l=l.return}if(ye===null)throw Error(I(160));mp(a,o,r),ye=null,it=!1;var c=r.alternate;c!==null&&(c.return=null),r.return=null}catch(u){ae(r,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)hp(t,e),t=t.sibling}function hp(e,t){var n=e.alternate,s=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(tt(t,e),ft(e),s&4){try{Ks(3,e,e.return),ra(3,e)}catch(v){ae(e,e.return,v)}try{Ks(5,e,e.return)}catch(v){ae(e,e.return,v)}}break;case 1:tt(t,e),ft(e),s&512&&n!==null&&Bn(n,n.return);break;case 5:if(tt(t,e),ft(e),s&512&&n!==null&&Bn(n,n.return),e.flags&32){var r=e.stateNode;try{Zs(r,"")}catch(v){ae(e,e.return,v)}}if(s&4&&(r=e.stateNode,r!=null)){var a=e.memoizedProps,o=n!==null?n.memoizedProps:a,l=e.type,c=e.updateQueue;if(e.updateQueue=null,c!==null)try{l==="input"&&a.type==="radio"&&a.name!=null&&Dd(r,a),vo(l,o);var u=vo(l,a);for(o=0;o<c.length;o+=2){var p=c[o],d=c[o+1];p==="style"?Bd(r,d):p==="dangerouslySetInnerHTML"?zd(r,d):p==="children"?Zs(r,d):bl(r,p,d,u)}switch(l){case"input":mo(r,a);break;case"textarea":$d(r,a);break;case"select":var f=r._wrapperState.wasMultiple;r._wrapperState.wasMultiple=!!a.multiple;var x=a.value;x!=null?Kn(r,!!a.multiple,x,!1):f!==!!a.multiple&&(a.defaultValue!=null?Kn(r,!!a.multiple,a.defaultValue,!0):Kn(r,!!a.multiple,a.multiple?[]:"",!1))}r[lr]=a}catch(v){ae(e,e.return,v)}}break;case 6:if(tt(t,e),ft(e),s&4){if(e.stateNode===null)throw Error(I(162));r=e.stateNode,a=e.memoizedProps;try{r.nodeValue=a}catch(v){ae(e,e.return,v)}}break;case 3:if(tt(t,e),ft(e),s&4&&n!==null&&n.memoizedState.isDehydrated)try{sr(t.containerInfo)}catch(v){ae(e,e.return,v)}break;case 4:tt(t,e),ft(e);break;case 13:tt(t,e),ft(e),r=e.child,r.flags&8192&&(a=r.memoizedState!==null,r.stateNode.isHidden=a,!a||r.alternate!==null&&r.alternate.memoizedState!==null||(Zl=oe())),s&4&&Cu(e);break;case 22:if(p=n!==null&&n.memoizedState!==null,e.mode&1?(Ne=(u=Ne)||p,tt(t,e),Ne=u):tt(t,e),ft(e),s&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!p&&e.mode&1)for(M=e,p=e.child;p!==null;){for(d=M=p;M!==null;){switch(f=M,x=f.child,f.tag){case 0:case 11:case 14:case 15:Ks(4,f,f.return);break;case 1:Bn(f,f.return);var y=f.stateNode;if(typeof y.componentWillUnmount=="function"){s=f,n=f.return;try{t=s,y.props=t.memoizedProps,y.state=t.memoizedState,y.componentWillUnmount()}catch(v){ae(s,n,v)}}break;case 5:Bn(f,f.return);break;case 22:if(f.memoizedState!==null){Tu(d);continue}}x!==null?(x.return=f,M=x):Tu(d)}p=p.sibling}e:for(p=null,d=e;;){if(d.tag===5){if(p===null){p=d;try{r=d.stateNode,u?(a=r.style,typeof a.setProperty=="function"?a.setProperty("display","none","important"):a.display="none"):(l=d.stateNode,c=d.memoizedProps.style,o=c!=null&&c.hasOwnProperty("display")?c.display:null,l.style.display=Fd("display",o))}catch(v){ae(e,e.return,v)}}}else if(d.tag===6){if(p===null)try{d.stateNode.nodeValue=u?"":d.memoizedProps}catch(v){ae(e,e.return,v)}}else if((d.tag!==22&&d.tag!==23||d.memoizedState===null||d===e)&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===e)break e;for(;d.sibling===null;){if(d.return===null||d.return===e)break e;p===d&&(p=null),d=d.return}p===d&&(p=null),d.sibling.return=d.return,d=d.sibling}}break;case 19:tt(t,e),ft(e),s&4&&Cu(e);break;case 21:break;default:tt(t,e),ft(e)}}function ft(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(pp(n)){var s=n;break e}n=n.return}throw Error(I(160))}switch(s.tag){case 5:var r=s.stateNode;s.flags&32&&(Zs(r,""),s.flags&=-33);var a=Su(e);Yo(e,a,r);break;case 3:case 4:var o=s.stateNode.containerInfo,l=Su(e);qo(e,l,o);break;default:throw Error(I(161))}}catch(c){ae(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Gg(e,t,n){M=e,gp(e)}function gp(e,t,n){for(var s=(e.mode&1)!==0;M!==null;){var r=M,a=r.child;if(r.tag===22&&s){var o=r.memoizedState!==null||Kr;if(!o){var l=r.alternate,c=l!==null&&l.memoizedState!==null||Ne;l=Kr;var u=Ne;if(Kr=o,(Ne=c)&&!u)for(M=r;M!==null;)o=M,c=o.child,o.tag===22&&o.memoizedState!==null?Au(r):c!==null?(c.return=o,M=c):Au(r);for(;a!==null;)M=a,gp(a),a=a.sibling;M=r,Kr=l,Ne=u}Eu(e)}else r.subtreeFlags&8772&&a!==null?(a.return=r,M=a):Eu(e)}}function Eu(e){for(;M!==null;){var t=M;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Ne||ra(5,t);break;case 1:var s=t.stateNode;if(t.flags&4&&!Ne)if(n===null)s.componentDidMount();else{var r=t.elementType===t.type?n.memoizedProps:st(t.type,n.memoizedProps);s.componentDidUpdate(r,n.memoizedState,s.__reactInternalSnapshotBeforeUpdate)}var a=t.updateQueue;a!==null&&du(t,a,s);break;case 3:var o=t.updateQueue;if(o!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}du(t,o,n)}break;case 5:var l=t.stateNode;if(n===null&&t.flags&4){n=l;var c=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":c.autoFocus&&n.focus();break;case"img":c.src&&(n.src=c.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var p=u.memoizedState;if(p!==null){var d=p.dehydrated;d!==null&&sr(d)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(I(163))}Ne||t.flags&512&&Go(t)}catch(f){ae(t,t.return,f)}}if(t===e){M=null;break}if(n=t.sibling,n!==null){n.return=t.return,M=n;break}M=t.return}}function Tu(e){for(;M!==null;){var t=M;if(t===e){M=null;break}var n=t.sibling;if(n!==null){n.return=t.return,M=n;break}M=t.return}}function Au(e){for(;M!==null;){var t=M;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{ra(4,t)}catch(c){ae(t,n,c)}break;case 1:var s=t.stateNode;if(typeof s.componentDidMount=="function"){var r=t.return;try{s.componentDidMount()}catch(c){ae(t,r,c)}}var a=t.return;try{Go(t)}catch(c){ae(t,a,c)}break;case 5:var o=t.return;try{Go(t)}catch(c){ae(t,o,c)}}}catch(c){ae(t,t.return,c)}if(t===e){M=null;break}var l=t.sibling;if(l!==null){l.return=t.return,M=l;break}M=t.return}}var qg=Math.ceil,zi=Lt.ReactCurrentDispatcher,Jl=Lt.ReactCurrentOwner,Ye=Lt.ReactCurrentBatchConfig,K=0,ge=null,fe=null,ve=0,Re=0,Un=nn(0),me=0,mr=null,vn=0,ia=0,Xl=0,Gs=null,Ie=null,Zl=0,as=1/0,vt=null,Fi=!1,Qo=null,qt=null,Gr=!1,Bt=null,Bi=0,qs=0,Jo=null,pi=-1,mi=0;function Ee(){return K&6?oe():pi!==-1?pi:pi=oe()}function Yt(e){return e.mode&1?K&2&&ve!==0?ve&-ve:Ig.transition!==null?(mi===0&&(mi=Zd()),mi):(e=G,e!==0||(e=window.event,e=e===void 0?16:of(e.type)),e):1}function lt(e,t,n,s){if(50<qs)throw qs=0,Jo=null,Error(I(185));jr(e,n,s),(!(K&2)||e!==ge)&&(e===ge&&(!(K&2)&&(ia|=n),me===4&&zt(e,ve)),De(e,s),n===1&&K===0&&!(t.mode&1)&&(as=oe()+500,ta&&sn()))}function De(e,t){var n=e.callbackNode;Ih(e,t);var s=ki(e,e===ge?ve:0);if(s===0)n!==null&&Rc(n),e.callbackNode=null,e.callbackPriority=0;else if(t=s&-s,e.callbackPriority!==t){if(n!=null&&Rc(n),t===1)e.tag===0?Lg(Lu.bind(null,e)):Cf(Lu.bind(null,e)),Cg(function(){!(K&6)&&sn()}),n=null;else{switch(ef(s)){case 1:n=Sl;break;case 4:n=Jd;break;case 16:n=Ni;break;case 536870912:n=Xd;break;default:n=Ni}n=kp(n,yp.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function yp(e,t){if(pi=-1,mi=0,K&6)throw Error(I(327));var n=e.callbackNode;if(Jn()&&e.callbackNode!==n)return null;var s=ki(e,e===ge?ve:0);if(s===0)return null;if(s&30||s&e.expiredLanes||t)t=Ui(e,s);else{t=s;var r=K;K|=2;var a=vp();(ge!==e||ve!==t)&&(vt=null,as=oe()+500,mn(e,t));do try{Jg();break}catch(l){xp(e,l)}while(!0);Rl(),zi.current=a,K=r,fe!==null?t=0:(ge=null,ve=0,t=me)}if(t!==0){if(t===2&&(r=ko(e),r!==0&&(s=r,t=Xo(e,r))),t===1)throw n=mr,mn(e,0),zt(e,s),De(e,oe()),n;if(t===6)zt(e,s);else{if(r=e.current.alternate,!(s&30)&&!Yg(r)&&(t=Ui(e,s),t===2&&(a=ko(e),a!==0&&(s=a,t=Xo(e,a))),t===1))throw n=mr,mn(e,0),zt(e,s),De(e,oe()),n;switch(e.finishedWork=r,e.finishedLanes=s,t){case 0:case 1:throw Error(I(345));case 2:on(e,Ie,vt);break;case 3:if(zt(e,s),(s&130023424)===s&&(t=Zl+500-oe(),10<t)){if(ki(e,0)!==0)break;if(r=e.suspendedLanes,(r&s)!==s){Ee(),e.pingedLanes|=e.suspendedLanes&r;break}e.timeoutHandle=Oo(on.bind(null,e,Ie,vt),t);break}on(e,Ie,vt);break;case 4:if(zt(e,s),(s&4194240)===s)break;for(t=e.eventTimes,r=-1;0<s;){var o=31-ot(s);a=1<<o,o=t[o],o>r&&(r=o),s&=~a}if(s=r,s=oe()-s,s=(120>s?120:480>s?480:1080>s?1080:1920>s?1920:3e3>s?3e3:4320>s?4320:1960*qg(s/1960))-s,10<s){e.timeoutHandle=Oo(on.bind(null,e,Ie,vt),s);break}on(e,Ie,vt);break;case 5:on(e,Ie,vt);break;default:throw Error(I(329))}}}return De(e,oe()),e.callbackNode===n?yp.bind(null,e):null}function Xo(e,t){var n=Gs;return e.current.memoizedState.isDehydrated&&(mn(e,t).flags|=256),e=Ui(e,t),e!==2&&(t=Ie,Ie=n,t!==null&&Zo(t)),e}function Zo(e){Ie===null?Ie=e:Ie.push.apply(Ie,e)}function Yg(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var s=0;s<n.length;s++){var r=n[s],a=r.getSnapshot;r=r.value;try{if(!ct(a(),r))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function zt(e,t){for(t&=~Xl,t&=~ia,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-ot(t),s=1<<n;e[n]=-1,t&=~s}}function Lu(e){if(K&6)throw Error(I(327));Jn();var t=ki(e,0);if(!(t&1))return De(e,oe()),null;var n=Ui(e,t);if(e.tag!==0&&n===2){var s=ko(e);s!==0&&(t=s,n=Xo(e,s))}if(n===1)throw n=mr,mn(e,0),zt(e,t),De(e,oe()),n;if(n===6)throw Error(I(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,on(e,Ie,vt),De(e,oe()),null}function ec(e,t){var n=K;K|=1;try{return e(t)}finally{K=n,K===0&&(as=oe()+500,ta&&sn())}}function bn(e){Bt!==null&&Bt.tag===0&&!(K&6)&&Jn();var t=K;K|=1;var n=Ye.transition,s=G;try{if(Ye.transition=null,G=1,e)return e()}finally{G=s,Ye.transition=n,K=t,!(K&6)&&sn()}}function tc(){Re=Un.current,Z(Un)}function mn(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,Sg(n)),fe!==null)for(n=fe.return;n!==null;){var s=n;switch(Ml(s),s.tag){case 1:s=s.type.childContextTypes,s!=null&&Ai();break;case 3:rs(),Z(_e),Z(ke),Hl();break;case 5:Wl(s);break;case 4:rs();break;case 13:Z(ne);break;case 19:Z(ne);break;case 10:zl(s.type._context);break;case 22:case 23:tc()}n=n.return}if(ge=e,fe=e=Qt(e.current,null),ve=Re=t,me=0,mr=null,Xl=ia=vn=0,Ie=Gs=null,un!==null){for(t=0;t<un.length;t++)if(n=un[t],s=n.interleaved,s!==null){n.interleaved=null;var r=s.next,a=n.pending;if(a!==null){var o=a.next;a.next=r,s.next=o}n.pending=s}un=null}return e}function xp(e,t){do{var n=fe;try{if(Rl(),ui.current=Ri,$i){for(var s=se.memoizedState;s!==null;){var r=s.queue;r!==null&&(r.pending=null),s=s.next}$i=!1}if(xn=0,he=pe=se=null,Vs=!1,dr=0,Jl.current=null,n===null||n.return===null){me=1,mr=t,fe=null;break}e:{var a=e,o=n.return,l=n,c=t;if(t=ve,l.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){var u=c,p=l,d=p.tag;if(!(p.mode&1)&&(d===0||d===11||d===15)){var f=p.alternate;f?(p.updateQueue=f.updateQueue,p.memoizedState=f.memoizedState,p.lanes=f.lanes):(p.updateQueue=null,p.memoizedState=null)}var x=yu(o);if(x!==null){x.flags&=-257,xu(x,o,l,a,t),x.mode&1&&gu(a,u,t),t=x,c=u;var y=t.updateQueue;if(y===null){var v=new Set;v.add(c),t.updateQueue=v}else y.add(c);break e}else{if(!(t&1)){gu(a,u,t),nc();break e}c=Error(I(426))}}else if(te&&l.mode&1){var w=yu(o);if(w!==null){!(w.flags&65536)&&(w.flags|=256),xu(w,o,l,a,t),Dl(is(c,l));break e}}a=c=is(c,l),me!==4&&(me=2),Gs===null?Gs=[a]:Gs.push(a),a=o;do{switch(a.tag){case 3:a.flags|=65536,t&=-t,a.lanes|=t;var g=tp(a,c,t);uu(a,g);break e;case 1:l=c;var h=a.type,m=a.stateNode;if(!(a.flags&128)&&(typeof h.getDerivedStateFromError=="function"||m!==null&&typeof m.componentDidCatch=="function"&&(qt===null||!qt.has(m)))){a.flags|=65536,t&=-t,a.lanes|=t;var j=np(a,l,t);uu(a,j);break e}}a=a.return}while(a!==null)}jp(n)}catch(N){t=N,fe===n&&n!==null&&(fe=n=n.return);continue}break}while(!0)}function vp(){var e=zi.current;return zi.current=Ri,e===null?Ri:e}function nc(){(me===0||me===3||me===2)&&(me=4),ge===null||!(vn&268435455)&&!(ia&268435455)||zt(ge,ve)}function Ui(e,t){var n=K;K|=2;var s=vp();(ge!==e||ve!==t)&&(vt=null,mn(e,t));do try{Qg();break}catch(r){xp(e,r)}while(!0);if(Rl(),K=n,zi.current=s,fe!==null)throw Error(I(261));return ge=null,ve=0,me}function Qg(){for(;fe!==null;)bp(fe)}function Jg(){for(;fe!==null&&!wh();)bp(fe)}function bp(e){var t=Np(e.alternate,e,Re);e.memoizedProps=e.pendingProps,t===null?jp(e):fe=t,Jl.current=null}function jp(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=Hg(n,t),n!==null){n.flags&=32767,fe=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{me=6,fe=null;return}}else if(n=Wg(n,t,Re),n!==null){fe=n;return}if(t=t.sibling,t!==null){fe=t;return}fe=t=e}while(t!==null);me===0&&(me=5)}function on(e,t,n){var s=G,r=Ye.transition;try{Ye.transition=null,G=1,Xg(e,t,n,s)}finally{Ye.transition=r,G=s}return null}function Xg(e,t,n,s){do Jn();while(Bt!==null);if(K&6)throw Error(I(327));n=e.finishedWork;var r=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(I(177));e.callbackNode=null,e.callbackPriority=0;var a=n.lanes|n.childLanes;if(Oh(e,a),e===ge&&(fe=ge=null,ve=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Gr||(Gr=!0,kp(Ni,function(){return Jn(),null})),a=(n.flags&15990)!==0,n.subtreeFlags&15990||a){a=Ye.transition,Ye.transition=null;var o=G;G=1;var l=K;K|=4,Jl.current=null,Kg(e,n),hp(n,e),xg(Lo),Si=!!Ao,Lo=Ao=null,e.current=n,Gg(n),Nh(),K=l,G=o,Ye.transition=a}else e.current=n;if(Gr&&(Gr=!1,Bt=e,Bi=r),a=e.pendingLanes,a===0&&(qt=null),Ch(n.stateNode),De(e,oe()),t!==null)for(s=e.onRecoverableError,n=0;n<t.length;n++)r=t[n],s(r.value,{componentStack:r.stack,digest:r.digest});if(Fi)throw Fi=!1,e=Qo,Qo=null,e;return Bi&1&&e.tag!==0&&Jn(),a=e.pendingLanes,a&1?e===Jo?qs++:(qs=0,Jo=e):qs=0,sn(),null}function Jn(){if(Bt!==null){var e=ef(Bi),t=Ye.transition,n=G;try{if(Ye.transition=null,G=16>e?16:e,Bt===null)var s=!1;else{if(e=Bt,Bt=null,Bi=0,K&6)throw Error(I(331));var r=K;for(K|=4,M=e.current;M!==null;){var a=M,o=a.child;if(M.flags&16){var l=a.deletions;if(l!==null){for(var c=0;c<l.length;c++){var u=l[c];for(M=u;M!==null;){var p=M;switch(p.tag){case 0:case 11:case 15:Ks(8,p,a)}var d=p.child;if(d!==null)d.return=p,M=d;else for(;M!==null;){p=M;var f=p.sibling,x=p.return;if(fp(p),p===u){M=null;break}if(f!==null){f.return=x,M=f;break}M=x}}}var y=a.alternate;if(y!==null){var v=y.child;if(v!==null){y.child=null;do{var w=v.sibling;v.sibling=null,v=w}while(v!==null)}}M=a}}if(a.subtreeFlags&2064&&o!==null)o.return=a,M=o;else e:for(;M!==null;){if(a=M,a.flags&2048)switch(a.tag){case 0:case 11:case 15:Ks(9,a,a.return)}var g=a.sibling;if(g!==null){g.return=a.return,M=g;break e}M=a.return}}var h=e.current;for(M=h;M!==null;){o=M;var m=o.child;if(o.subtreeFlags&2064&&m!==null)m.return=o,M=m;else e:for(o=h;M!==null;){if(l=M,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:ra(9,l)}}catch(N){ae(l,l.return,N)}if(l===o){M=null;break e}var j=l.sibling;if(j!==null){j.return=l.return,M=j;break e}M=l.return}}if(K=r,sn(),ht&&typeof ht.onPostCommitFiberRoot=="function")try{ht.onPostCommitFiberRoot(Qi,e)}catch{}s=!0}return s}finally{G=n,Ye.transition=t}}return!1}function Iu(e,t,n){t=is(n,t),t=tp(e,t,1),e=Gt(e,t,1),t=Ee(),e!==null&&(jr(e,1,t),De(e,t))}function ae(e,t,n){if(e.tag===3)Iu(e,e,n);else for(;t!==null;){if(t.tag===3){Iu(t,e,n);break}else if(t.tag===1){var s=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(qt===null||!qt.has(s))){e=is(n,e),e=np(t,e,1),t=Gt(t,e,1),e=Ee(),t!==null&&(jr(t,1,e),De(t,e));break}}t=t.return}}function Zg(e,t,n){var s=e.pingCache;s!==null&&s.delete(t),t=Ee(),e.pingedLanes|=e.suspendedLanes&n,ge===e&&(ve&n)===n&&(me===4||me===3&&(ve&130023424)===ve&&500>oe()-Zl?mn(e,0):Xl|=n),De(e,t)}function wp(e,t){t===0&&(e.mode&1?(t=$r,$r<<=1,!($r&130023424)&&($r=4194304)):t=1);var n=Ee();e=Tt(e,t),e!==null&&(jr(e,t,n),De(e,n))}function ey(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),wp(e,n)}function ty(e,t){var n=0;switch(e.tag){case 13:var s=e.stateNode,r=e.memoizedState;r!==null&&(n=r.retryLane);break;case 19:s=e.stateNode;break;default:throw Error(I(314))}s!==null&&s.delete(t),wp(e,n)}var Np;Np=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||_e.current)Oe=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Oe=!1,Ug(e,t,n);Oe=!!(e.flags&131072)}else Oe=!1,te&&t.flags&1048576&&Ef(t,Oi,t.index);switch(t.lanes=0,t.tag){case 2:var s=t.type;fi(e,t),e=t.pendingProps;var r=ts(t,ke.current);Qn(t,n),r=Kl(null,t,s,e,r,n);var a=Gl();return t.flags|=1,typeof r=="object"&&r!==null&&typeof r.render=="function"&&r.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Me(s)?(a=!0,Li(t)):a=!1,t.memoizedState=r.state!==null&&r.state!==void 0?r.state:null,Bl(t),r.updater=sa,t.stateNode=r,r._reactInternals=t,zo(t,s,e,n),t=Uo(null,t,s,!0,a,n)):(t.tag=0,te&&a&&_l(t),Se(null,t,r,n),t=t.child),t;case 16:s=t.elementType;e:{switch(fi(e,t),e=t.pendingProps,r=s._init,s=r(s._payload),t.type=s,r=t.tag=sy(s),e=st(s,e),r){case 0:t=Bo(null,t,s,e,n);break e;case 1:t=ju(null,t,s,e,n);break e;case 11:t=vu(null,t,s,e,n);break e;case 14:t=bu(null,t,s,st(s.type,e),n);break e}throw Error(I(306,s,""))}return t;case 0:return s=t.type,r=t.pendingProps,r=t.elementType===s?r:st(s,r),Bo(e,t,s,r,n);case 1:return s=t.type,r=t.pendingProps,r=t.elementType===s?r:st(s,r),ju(e,t,s,r,n);case 3:e:{if(ap(t),e===null)throw Error(I(387));s=t.pendingProps,a=t.memoizedState,r=a.element,Pf(e,t),Mi(t,s,null,n);var o=t.memoizedState;if(s=o.element,a.isDehydrated)if(a={element:s,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=a,t.memoizedState=a,t.flags&256){r=is(Error(I(423)),t),t=wu(e,t,s,n,r);break e}else if(s!==r){r=is(Error(I(424)),t),t=wu(e,t,s,n,r);break e}else for(ze=Kt(t.stateNode.containerInfo.firstChild),Fe=t,te=!0,at=null,n=If(t,null,s,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(ns(),s===r){t=At(e,t,n);break e}Se(e,t,s,n)}t=t.child}return t;case 5:return _f(t),e===null&&Do(t),s=t.type,r=t.pendingProps,a=e!==null?e.memoizedProps:null,o=r.children,Io(s,r)?o=null:a!==null&&Io(s,a)&&(t.flags|=32),ip(e,t),Se(e,t,o,n),t.child;case 6:return e===null&&Do(t),null;case 13:return op(e,t,n);case 4:return Ul(t,t.stateNode.containerInfo),s=t.pendingProps,e===null?t.child=ss(t,null,s,n):Se(e,t,s,n),t.child;case 11:return s=t.type,r=t.pendingProps,r=t.elementType===s?r:st(s,r),vu(e,t,s,r,n);case 7:return Se(e,t,t.pendingProps,n),t.child;case 8:return Se(e,t,t.pendingProps.children,n),t.child;case 12:return Se(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(s=t.type._context,r=t.pendingProps,a=t.memoizedProps,o=r.value,Y(Pi,s._currentValue),s._currentValue=o,a!==null)if(ct(a.value,o)){if(a.children===r.children&&!_e.current){t=At(e,t,n);break e}}else for(a=t.child,a!==null&&(a.return=t);a!==null;){var l=a.dependencies;if(l!==null){o=a.child;for(var c=l.firstContext;c!==null;){if(c.context===s){if(a.tag===1){c=kt(-1,n&-n),c.tag=2;var u=a.updateQueue;if(u!==null){u=u.shared;var p=u.pending;p===null?c.next=c:(c.next=p.next,p.next=c),u.pending=c}}a.lanes|=n,c=a.alternate,c!==null&&(c.lanes|=n),$o(a.return,n,t),l.lanes|=n;break}c=c.next}}else if(a.tag===10)o=a.type===t.type?null:a.child;else if(a.tag===18){if(o=a.return,o===null)throw Error(I(341));o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),$o(o,n,t),o=a.sibling}else o=a.child;if(o!==null)o.return=a;else for(o=a;o!==null;){if(o===t){o=null;break}if(a=o.sibling,a!==null){a.return=o.return,o=a;break}o=o.return}a=o}Se(e,t,r.children,n),t=t.child}return t;case 9:return r=t.type,s=t.pendingProps.children,Qn(t,n),r=Je(r),s=s(r),t.flags|=1,Se(e,t,s,n),t.child;case 14:return s=t.type,r=st(s,t.pendingProps),r=st(s.type,r),bu(e,t,s,r,n);case 15:return sp(e,t,t.type,t.pendingProps,n);case 17:return s=t.type,r=t.pendingProps,r=t.elementType===s?r:st(s,r),fi(e,t),t.tag=1,Me(s)?(e=!0,Li(t)):e=!1,Qn(t,n),ep(t,s,r),zo(t,s,r,n),Uo(null,t,s,!0,e,n);case 19:return lp(e,t,n);case 22:return rp(e,t,n)}throw Error(I(156,t.tag))};function kp(e,t){return Qd(e,t)}function ny(e,t,n,s){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=s,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function qe(e,t,n,s){return new ny(e,t,n,s)}function sc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function sy(e){if(typeof e=="function")return sc(e)?1:0;if(e!=null){if(e=e.$$typeof,e===wl)return 11;if(e===Nl)return 14}return 2}function Qt(e,t){var n=e.alternate;return n===null?(n=qe(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function hi(e,t,n,s,r,a){var o=2;if(s=e,typeof e=="function")sc(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case On:return hn(n.children,r,a,t);case jl:o=8,r|=8;break;case lo:return e=qe(12,n,t,r|2),e.elementType=lo,e.lanes=a,e;case co:return e=qe(13,n,t,r),e.elementType=co,e.lanes=a,e;case uo:return e=qe(19,n,t,r),e.elementType=uo,e.lanes=a,e;case Pd:return aa(n,r,a,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Id:o=10;break e;case Od:o=9;break e;case wl:o=11;break e;case Nl:o=14;break e;case Mt:o=16,s=null;break e}throw Error(I(130,e==null?e:typeof e,""))}return t=qe(o,n,t,r),t.elementType=e,t.type=s,t.lanes=a,t}function hn(e,t,n,s){return e=qe(7,e,s,t),e.lanes=n,e}function aa(e,t,n,s){return e=qe(22,e,s,t),e.elementType=Pd,e.lanes=n,e.stateNode={isHidden:!1},e}function Ga(e,t,n){return e=qe(6,e,null,t),e.lanes=n,e}function qa(e,t,n){return t=qe(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function ry(e,t,n,s,r){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Ta(0),this.expirationTimes=Ta(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ta(0),this.identifierPrefix=s,this.onRecoverableError=r,this.mutableSourceEagerHydrationData=null}function rc(e,t,n,s,r,a,o,l,c){return e=new ry(e,t,n,l,c),t===1?(t=1,a===!0&&(t|=8)):t=0,a=qe(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:s,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Bl(a),e}function iy(e,t,n){var s=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:In,key:s==null?null:""+s,children:e,containerInfo:t,implementation:n}}function Sp(e){if(!e)return en;e=e._reactInternals;e:{if(kn(e)!==e||e.tag!==1)throw Error(I(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Me(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(I(171))}if(e.tag===1){var n=e.type;if(Me(n))return Sf(e,n,t)}return t}function Cp(e,t,n,s,r,a,o,l,c){return e=rc(n,s,!0,e,r,a,o,l,c),e.context=Sp(null),n=e.current,s=Ee(),r=Yt(n),a=kt(s,r),a.callback=t??null,Gt(n,a,r),e.current.lanes=r,jr(e,r,s),De(e,s),e}function oa(e,t,n,s){var r=t.current,a=Ee(),o=Yt(r);return n=Sp(n),t.context===null?t.context=n:t.pendingContext=n,t=kt(a,o),t.payload={element:e},s=s===void 0?null:s,s!==null&&(t.callback=s),e=Gt(r,t,o),e!==null&&(lt(e,r,o,a),ci(e,r,o)),o}function Wi(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function Ou(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function ic(e,t){Ou(e,t),(e=e.alternate)&&Ou(e,t)}function ay(){return null}var Ep=typeof reportError=="function"?reportError:function(e){console.error(e)};function ac(e){this._internalRoot=e}la.prototype.render=ac.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(I(409));oa(e,t,null,null)};la.prototype.unmount=ac.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;bn(function(){oa(null,e,null,null)}),t[Et]=null}};function la(e){this._internalRoot=e}la.prototype.unstable_scheduleHydration=function(e){if(e){var t=sf();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Rt.length&&t!==0&&t<Rt[n].priority;n++);Rt.splice(n,0,e),n===0&&af(e)}};function oc(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function ca(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Pu(){}function oy(e,t,n,s,r){if(r){if(typeof s=="function"){var a=s;s=function(){var u=Wi(o);a.call(u)}}var o=Cp(t,s,e,0,null,!1,!1,"",Pu);return e._reactRootContainer=o,e[Et]=o.current,ar(e.nodeType===8?e.parentNode:e),bn(),o}for(;r=e.lastChild;)e.removeChild(r);if(typeof s=="function"){var l=s;s=function(){var u=Wi(c);l.call(u)}}var c=rc(e,0,!1,null,null,!1,!1,"",Pu);return e._reactRootContainer=c,e[Et]=c.current,ar(e.nodeType===8?e.parentNode:e),bn(function(){oa(t,c,n,s)}),c}function ua(e,t,n,s,r){var a=n._reactRootContainer;if(a){var o=a;if(typeof r=="function"){var l=r;r=function(){var c=Wi(o);l.call(c)}}oa(t,o,e,r)}else o=oy(n,t,e,r,s);return Wi(o)}tf=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=_s(t.pendingLanes);n!==0&&(Cl(t,n|1),De(t,oe()),!(K&6)&&(as=oe()+500,sn()))}break;case 13:bn(function(){var s=Tt(e,1);if(s!==null){var r=Ee();lt(s,e,1,r)}}),ic(e,1)}};El=function(e){if(e.tag===13){var t=Tt(e,134217728);if(t!==null){var n=Ee();lt(t,e,134217728,n)}ic(e,134217728)}};nf=function(e){if(e.tag===13){var t=Yt(e),n=Tt(e,t);if(n!==null){var s=Ee();lt(n,e,t,s)}ic(e,t)}};sf=function(){return G};rf=function(e,t){var n=G;try{return G=e,t()}finally{G=n}};jo=function(e,t,n){switch(t){case"input":if(mo(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var s=n[t];if(s!==e&&s.form===e.form){var r=ea(s);if(!r)throw Error(I(90));Md(s),mo(s,r)}}}break;case"textarea":$d(e,n);break;case"select":t=n.value,t!=null&&Kn(e,!!n.multiple,t,!1)}};Hd=ec;Vd=bn;var ly={usingClientEntryPoint:!1,Events:[Nr,Dn,ea,Ud,Wd,ec]},As={findFiberByHostInstance:cn,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},cy={bundleType:As.bundleType,version:As.version,rendererPackageName:As.rendererPackageName,rendererConfig:As.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Lt.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=qd(e),e===null?null:e.stateNode},findFiberByHostInstance:As.findFiberByHostInstance||ay,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 qr=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!qr.isDisabled&&qr.supportsFiber)try{Qi=qr.inject(cy),ht=qr}catch{}}Ue.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ly;Ue.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!oc(t))throw Error(I(200));return iy(e,t,null,n)};Ue.createRoot=function(e,t){if(!oc(e))throw Error(I(299));var n=!1,s="",r=Ep;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(s=t.identifierPrefix),t.onRecoverableError!==void 0&&(r=t.onRecoverableError)),t=rc(e,1,!1,null,null,n,!1,s,r),e[Et]=t.current,ar(e.nodeType===8?e.parentNode:e),new ac(t)};Ue.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(I(188)):(e=Object.keys(e).join(","),Error(I(268,e)));return e=qd(t),e=e===null?null:e.stateNode,e};Ue.flushSync=function(e){return bn(e)};Ue.hydrate=function(e,t,n){if(!ca(t))throw Error(I(200));return ua(null,e,t,!0,n)};Ue.hydrateRoot=function(e,t,n){if(!oc(e))throw Error(I(405));var s=n!=null&&n.hydratedSources||null,r=!1,a="",o=Ep;if(n!=null&&(n.unstable_strictMode===!0&&(r=!0),n.identifierPrefix!==void 0&&(a=n.identifierPrefix),n.onRecoverableError!==void 0&&(o=n.onRecoverableError)),t=Cp(t,null,e,1,n??null,r,!1,a,o),e[Et]=t.current,ar(e),s)for(e=0;e<s.length;e++)n=s[e],r=n._getVersion,r=r(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,r]:t.mutableSourceEagerHydrationData.push(n,r);return new la(t)};Ue.render=function(e,t,n){if(!ca(t))throw Error(I(200));return ua(null,e,t,!1,n)};Ue.unmountComponentAtNode=function(e){if(!ca(e))throw Error(I(40));return e._reactRootContainer?(bn(function(){ua(null,null,e,!1,function(){e._reactRootContainer=null,e[Et]=null})}),!0):!1};Ue.unstable_batchedUpdates=ec;Ue.unstable_renderSubtreeIntoContainer=function(e,t,n,s){if(!ca(n))throw Error(I(200));if(e==null||e._reactInternals===void 0)throw Error(I(38));return ua(e,t,n,!1,s)};Ue.version="18.3.1-next-f1338f8080-20240426";function Tp(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Tp)}catch(e){console.error(e)}}Tp(),Ed.exports=Ue;var uy=Ed.exports,Ap,_u=uy;Ap=_u.createRoot,_u.hydrateRoot;/**
41
+ * @remix-run/router v1.23.3
42
+ *
43
+ * Copyright (c) Remix Software Inc.
44
+ *
45
+ * This source code is licensed under the MIT license found in the
46
+ * LICENSE.md file in the root directory of this source tree.
47
+ *
48
+ * @license MIT
49
+ */function hr(){return hr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)({}).hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},hr.apply(null,arguments)}var Ut;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(Ut||(Ut={}));const Mu="popstate";function dy(e){e===void 0&&(e={});function t(s,r){let{pathname:a,search:o,hash:l}=s.location;return el("",{pathname:a,search:o,hash:l},r.state&&r.state.usr||null,r.state&&r.state.key||"default")}function n(s,r){return typeof r=="string"?r:Hi(r)}return py(t,n,null,e)}function re(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function lc(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function fy(){return Math.random().toString(36).substr(2,8)}function Du(e,t){return{usr:e.state,key:e.key,idx:t}}function el(e,t,n,s){return n===void 0&&(n=null),hr({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?ps(t):t,{state:n,key:t&&t.key||s||fy()})}function Hi(e){let{pathname:t="/",search:n="",hash:s=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),s&&s!=="#"&&(t+=s.charAt(0)==="#"?s:"#"+s),t}function ps(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let s=e.indexOf("?");s>=0&&(t.search=e.substr(s),e=e.substr(0,s)),e&&(t.pathname=e)}return t}function py(e,t,n,s){s===void 0&&(s={});let{window:r=document.defaultView,v5Compat:a=!1}=s,o=r.history,l=Ut.Pop,c=null,u=p();u==null&&(u=0,o.replaceState(hr({},o.state,{idx:u}),""));function p(){return(o.state||{idx:null}).idx}function d(){l=Ut.Pop;let w=p(),g=w==null?null:w-u;u=w,c&&c({action:l,location:v.location,delta:g})}function f(w,g){l=Ut.Push;let h=el(v.location,w,g);u=p()+1;let m=Du(h,u),j=v.createHref(h);try{o.pushState(m,"",j)}catch(N){if(N instanceof DOMException&&N.name==="DataCloneError")throw N;r.location.assign(j)}a&&c&&c({action:l,location:v.location,delta:1})}function x(w,g){l=Ut.Replace;let h=el(v.location,w,g);u=p();let m=Du(h,u),j=v.createHref(h);o.replaceState(m,"",j),a&&c&&c({action:l,location:v.location,delta:0})}function y(w){let g=r.location.origin!=="null"?r.location.origin:r.location.href,h=typeof w=="string"?w:Hi(w);return h=h.replace(/ $/,"%20"),re(g,"No window.location.(origin|href) available to create URL for href: "+h),new URL(h,g)}let v={get action(){return l},get location(){return e(r,o)},listen(w){if(c)throw new Error("A history only accepts one active listener");return r.addEventListener(Mu,d),c=w,()=>{r.removeEventListener(Mu,d),c=null}},createHref(w){return t(r,w)},createURL:y,encodeLocation(w){let g=y(w);return{pathname:g.pathname,search:g.search,hash:g.hash}},push:f,replace:x,go(w){return o.go(w)}};return v}var $u;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})($u||($u={}));function my(e,t,n){return n===void 0&&(n="/"),hy(e,t,n)}function hy(e,t,n,s){let r=typeof t=="string"?ps(t):t,a=os(r.pathname||"/",n);if(a==null)return null;let o=Lp(e);gy(o);let l=null,c=Ey(a);for(let u=0;l==null&&u<o.length;++u)l=Sy(o[u],c);return l}function Lp(e,t,n,s){t===void 0&&(t=[]),n===void 0&&(n=[]),s===void 0&&(s="");let r=(a,o,l)=>{let c={relativePath:l===void 0?a.path||"":l,caseSensitive:a.caseSensitive===!0,childrenIndex:o,route:a};c.relativePath.startsWith("/")&&(re(c.relativePath.startsWith(s),'Absolute route path "'+c.relativePath+'" nested under path '+('"'+s+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),c.relativePath=c.relativePath.slice(s.length));let u=Jt([s,c.relativePath]),p=n.concat(c);a.children&&a.children.length>0&&(re(a.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),Lp(a.children,t,p,u)),!(a.path==null&&!a.index)&&t.push({path:u,score:Ny(u,a.index),routesMeta:p})};return e.forEach((a,o)=>{var l;if(a.path===""||!((l=a.path)!=null&&l.includes("?")))r(a,o);else for(let c of Ip(a.path))r(a,o,c)}),t}function Ip(e){let t=e.split("/");if(t.length===0)return[];let[n,...s]=t,r=n.endsWith("?"),a=n.replace(/\?$/,"");if(s.length===0)return r?[a,""]:[a];let o=Ip(s.join("/")),l=[];return l.push(...o.map(c=>c===""?a:[a,c].join("/"))),r&&l.push(...o),l.map(c=>e.startsWith("/")&&c===""?"/":c)}function gy(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:ky(t.routesMeta.map(s=>s.childrenIndex),n.routesMeta.map(s=>s.childrenIndex)))}const yy=/^:[\w-]+$/,xy=3,vy=2,by=1,jy=10,wy=-2,Ru=e=>e==="*";function Ny(e,t){let n=e.split("/"),s=n.length;return n.some(Ru)&&(s+=wy),t&&(s+=vy),n.filter(r=>!Ru(r)).reduce((r,a)=>r+(yy.test(a)?xy:a===""?by:jy),s)}function ky(e,t){return e.length===t.length&&e.slice(0,-1).every((s,r)=>s===t[r])?e[e.length-1]-t[t.length-1]:0}function Sy(e,t,n){let{routesMeta:s}=e,r={},a="/",o=[];for(let l=0;l<s.length;++l){let c=s[l],u=l===s.length-1,p=a==="/"?t:t.slice(a.length)||"/",d=tl({path:c.relativePath,caseSensitive:c.caseSensitive,end:u},p),f=c.route;if(!d)return null;Object.assign(r,d.params),o.push({params:r,pathname:Jt([a,d.pathname]),pathnameBase:Oy(Jt([a,d.pathnameBase])),route:f}),d.pathnameBase!=="/"&&(a=Jt([a,d.pathnameBase]))}return o}function tl(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,s]=Cy(e.path,e.caseSensitive,e.end),r=t.match(n);if(!r)return null;let a=r[0],o=a.replace(/(.)\/+$/,"$1"),l=r.slice(1);return{params:s.reduce((u,p,d)=>{let{paramName:f,isOptional:x}=p;if(f==="*"){let v=l[d]||"";o=a.slice(0,a.length-v.length).replace(/(.)\/+$/,"$1")}const y=l[d];return x&&!y?u[f]=void 0:u[f]=(y||"").replace(/%2F/g,"/"),u},{}),pathname:a,pathnameBase:o,pattern:e}}function Cy(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),lc(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let s=[],r="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,l,c)=>(s.push({paramName:l,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(s.push({paramName:"*"}),r+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?r+="\\/*$":e!==""&&e!=="/"&&(r+="(?:(?=\\/|$))"),[new RegExp(r,t?void 0:"i"),s]}function Ey(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return lc(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function os(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,s=e.charAt(n);return s&&s!=="/"?null:e.slice(n)||"/"}const Ty=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Ay=e=>Ty.test(e);function Ly(e,t){t===void 0&&(t="/");let{pathname:n,search:s="",hash:r=""}=typeof e=="string"?ps(e):e,a;if(n)if(Ay(n))a=n;else{if(n.includes("//")){let o=n;n=Op(n),lc(!1,"Pathnames cannot have embedded double slashes - normalizing "+(o+" -> "+n))}n.startsWith("/")?a=zu(n.substring(1),"/"):a=zu(n,t)}else a=t;return{pathname:a,search:Py(s),hash:_y(r)}}function zu(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(r=>{r===".."?n.length>1&&n.pop():r!=="."&&n.push(r)}),n.length>1?n.join("/"):"/"}function Ya(e,t,n,s){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(s)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function Iy(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function cc(e,t){let n=Iy(e);return t?n.map((s,r)=>r===n.length-1?s.pathname:s.pathnameBase):n.map(s=>s.pathnameBase)}function uc(e,t,n,s){s===void 0&&(s=!1);let r;typeof e=="string"?r=ps(e):(r=hr({},e),re(!r.pathname||!r.pathname.includes("?"),Ya("?","pathname","search",r)),re(!r.pathname||!r.pathname.includes("#"),Ya("#","pathname","hash",r)),re(!r.search||!r.search.includes("#"),Ya("#","search","hash",r)));let a=e===""||r.pathname==="",o=a?"/":r.pathname,l;if(o==null)l=n;else{let d=t.length-1;if(!s&&o.startsWith("..")){let f=o.split("/");for(;f[0]==="..";)f.shift(),d-=1;r.pathname=f.join("/")}l=d>=0?t[d]:"/"}let c=Ly(r,l),u=o&&o!=="/"&&o.endsWith("/"),p=(a||o===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(u||p)&&(c.pathname+="/"),c}const Op=e=>e.replace(/\/\/+/g,"/"),Jt=e=>Op(e.join("/")),Oy=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Py=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,_y=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function My(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const Pp=["post","put","patch","delete"];new Set(Pp);const Dy=["get",...Pp];new Set(Dy);/**
50
+ * React Router v6.30.4
51
+ *
52
+ * Copyright (c) Remix Software Inc.
53
+ *
54
+ * This source code is licensed under the MIT license found in the
55
+ * LICENSE.md file in the root directory of this source tree.
56
+ *
57
+ * @license MIT
58
+ */function gr(){return gr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)({}).hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},gr.apply(null,arguments)}const da=b.createContext(null),_p=b.createContext(null),It=b.createContext(null),fa=b.createContext(null),xt=b.createContext({outlet:null,matches:[],isDataRoute:!1}),Mp=b.createContext(null);function $y(e,t){let{relative:n}=t===void 0?{}:t;ms()||re(!1);let{basename:s,navigator:r}=b.useContext(It),{hash:a,pathname:o,search:l}=pa(e,{relative:n}),c=o;return s!=="/"&&(c=o==="/"?s:Jt([s,o])),r.createHref({pathname:c,search:l,hash:a})}function ms(){return b.useContext(fa)!=null}function Ot(){return ms()||re(!1),b.useContext(fa).location}function Dp(e){b.useContext(It).static||b.useLayoutEffect(e)}function $p(){let{isDataRoute:e}=b.useContext(xt);return e?Zy():Ry()}function Ry(){ms()||re(!1);let e=b.useContext(da),{basename:t,future:n,navigator:s}=b.useContext(It),{matches:r}=b.useContext(xt),{pathname:a}=Ot(),o=JSON.stringify(cc(r,n.v7_relativeSplatPath)),l=b.useRef(!1);return Dp(()=>{l.current=!0}),b.useCallback(function(u,p){if(p===void 0&&(p={}),!l.current)return;if(typeof u=="number"){s.go(u);return}let d=uc(u,JSON.parse(o),a,p.relative==="path");e==null&&t!=="/"&&(d.pathname=d.pathname==="/"?t:Jt([t,d.pathname])),(p.replace?s.replace:s.push)(d,p.state,p)},[t,s,o,a,e])}const zy=b.createContext(null);function Fy(e){let t=b.useContext(xt).outlet;return t&&b.createElement(zy.Provider,{value:e},t)}function By(){let{matches:e}=b.useContext(xt),t=e[e.length-1];return t?t.params:{}}function pa(e,t){let{relative:n}=t===void 0?{}:t,{future:s}=b.useContext(It),{matches:r}=b.useContext(xt),{pathname:a}=Ot(),o=JSON.stringify(cc(r,s.v7_relativeSplatPath));return b.useMemo(()=>uc(e,JSON.parse(o),a,n==="path"),[e,o,a,n])}function Uy(e,t){return Wy(e,t)}function Wy(e,t,n,s){ms()||re(!1);let{navigator:r}=b.useContext(It),{matches:a}=b.useContext(xt),o=a[a.length-1],l=o?o.params:{};o&&o.pathname;let c=o?o.pathnameBase:"/";o&&o.route;let u=Ot(),p;if(t){var d;let w=typeof t=="string"?ps(t):t;c==="/"||(d=w.pathname)!=null&&d.startsWith(c)||re(!1),p=w}else p=u;let f=p.pathname||"/",x=f;if(c!=="/"){let w=c.replace(/^\//,"").split("/");x="/"+f.replace(/^\//,"").split("/").slice(w.length).join("/")}let y=my(e,{pathname:x}),v=qy(y&&y.map(w=>Object.assign({},w,{params:Object.assign({},l,w.params),pathname:Jt([c,r.encodeLocation?r.encodeLocation(w.pathname).pathname:w.pathname]),pathnameBase:w.pathnameBase==="/"?c:Jt([c,r.encodeLocation?r.encodeLocation(w.pathnameBase).pathname:w.pathnameBase])})),a,n,s);return t&&v?b.createElement(fa.Provider,{value:{location:gr({pathname:"/",search:"",hash:"",state:null,key:"default"},p),navigationType:Ut.Pop}},v):v}function Hy(){let e=Xy(),t=My(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return b.createElement(b.Fragment,null,b.createElement("h2",null,"Unexpected Application Error!"),b.createElement("h3",{style:{fontStyle:"italic"}},t),n?b.createElement("pre",{style:r},n):null,null)}const Vy=b.createElement(Hy,null);class Ky extends b.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?b.createElement(xt.Provider,{value:this.props.routeContext},b.createElement(Mp.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Gy(e){let{routeContext:t,match:n,children:s}=e,r=b.useContext(da);return r&&r.static&&r.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=n.route.id),b.createElement(xt.Provider,{value:t},s)}function qy(e,t,n,s){var r;if(t===void 0&&(t=[]),n===void 0&&(n=null),s===void 0&&(s=null),e==null){var a;if(!n)return null;if(n.errors)e=n.matches;else if((a=s)!=null&&a.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let o=e,l=(r=n)==null?void 0:r.errors;if(l!=null){let p=o.findIndex(d=>d.route.id&&(l==null?void 0:l[d.route.id])!==void 0);p>=0||re(!1),o=o.slice(0,Math.min(o.length,p+1))}let c=!1,u=-1;if(n&&s&&s.v7_partialHydration)for(let p=0;p<o.length;p++){let d=o[p];if((d.route.HydrateFallback||d.route.hydrateFallbackElement)&&(u=p),d.route.id){let{loaderData:f,errors:x}=n,y=d.route.loader&&f[d.route.id]===void 0&&(!x||x[d.route.id]===void 0);if(d.route.lazy||y){c=!0,u>=0?o=o.slice(0,u+1):o=[o[0]];break}}}return o.reduceRight((p,d,f)=>{let x,y=!1,v=null,w=null;n&&(x=l&&d.route.id?l[d.route.id]:void 0,v=d.route.errorElement||Vy,c&&(u<0&&f===0?(e0("route-fallback"),y=!0,w=null):u===f&&(y=!0,w=d.route.hydrateFallbackElement||null)));let g=t.concat(o.slice(0,f+1)),h=()=>{let m;return x?m=v:y?m=w:d.route.Component?m=b.createElement(d.route.Component,null):d.route.element?m=d.route.element:m=p,b.createElement(Gy,{match:d,routeContext:{outlet:p,matches:g,isDataRoute:n!=null},children:m})};return n&&(d.route.ErrorBoundary||d.route.errorElement||f===0)?b.createElement(Ky,{location:n.location,revalidation:n.revalidation,component:v,error:x,children:h(),routeContext:{outlet:null,matches:g,isDataRoute:!0}}):h()},null)}var Rp=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(Rp||{}),zp=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(zp||{});function Yy(e){let t=b.useContext(da);return t||re(!1),t}function Qy(e){let t=b.useContext(_p);return t||re(!1),t}function Jy(e){let t=b.useContext(xt);return t||re(!1),t}function Fp(e){let t=Jy(),n=t.matches[t.matches.length-1];return n.route.id||re(!1),n.route.id}function Xy(){var e;let t=b.useContext(Mp),n=Qy(),s=Fp();return t!==void 0?t:(e=n.errors)==null?void 0:e[s]}function Zy(){let{router:e}=Yy(Rp.UseNavigateStable),t=Fp(zp.UseNavigateStable),n=b.useRef(!1);return Dp(()=>{n.current=!0}),b.useCallback(function(r,a){a===void 0&&(a={}),n.current&&(typeof r=="number"?e.navigate(r):e.navigate(r,gr({fromRouteId:t},a)))},[e,t])}const Fu={};function e0(e,t,n){Fu[e]||(Fu[e]=!0)}function t0(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function n0(e){let{to:t,replace:n,state:s,relative:r}=e;ms()||re(!1);let{future:a,static:o}=b.useContext(It),{matches:l}=b.useContext(xt),{pathname:c}=Ot(),u=$p(),p=uc(t,cc(l,a.v7_relativeSplatPath),c,r==="path"),d=JSON.stringify(p);return b.useEffect(()=>u(JSON.parse(d),{replace:n,state:s,relative:r}),[u,d,r,n,s]),null}function s0(e){return Fy(e.context)}function de(e){re(!1)}function r0(e){let{basename:t="/",children:n=null,location:s,navigationType:r=Ut.Pop,navigator:a,static:o=!1,future:l}=e;ms()&&re(!1);let c=t.replace(/^\/*/,"/"),u=b.useMemo(()=>({basename:c,navigator:a,static:o,future:gr({v7_relativeSplatPath:!1},l)}),[c,l,a,o]);typeof s=="string"&&(s=ps(s));let{pathname:p="/",search:d="",hash:f="",state:x=null,key:y="default"}=s,v=b.useMemo(()=>{let w=os(p,c);return w==null?null:{location:{pathname:w,search:d,hash:f,state:x,key:y},navigationType:r}},[c,p,d,f,x,y,r]);return v==null?null:b.createElement(It.Provider,{value:u},b.createElement(fa.Provider,{children:n,value:v}))}function i0(e){let{children:t,location:n}=e;return Uy(nl(t),n)}new Promise(()=>{});function nl(e,t){t===void 0&&(t=[]);let n=[];return b.Children.forEach(e,(s,r)=>{if(!b.isValidElement(s))return;let a=[...t,r];if(s.type===b.Fragment){n.push.apply(n,nl(s.props.children,a));return}s.type!==de&&re(!1),!s.props.index||!s.props.children||re(!1);let o={id:s.props.id||a.join("-"),caseSensitive:s.props.caseSensitive,element:s.props.element,Component:s.props.Component,index:s.props.index,path:s.props.path,loader:s.props.loader,action:s.props.action,errorElement:s.props.errorElement,ErrorBoundary:s.props.ErrorBoundary,hasErrorBoundary:s.props.ErrorBoundary!=null||s.props.errorElement!=null,shouldRevalidate:s.props.shouldRevalidate,handle:s.props.handle,lazy:s.props.lazy};s.props.children&&(o.children=nl(s.props.children,a)),n.push(o)}),n}/**
59
+ * React Router DOM v6.30.4
60
+ *
61
+ * Copyright (c) Remix Software Inc.
62
+ *
63
+ * This source code is licensed under the MIT license found in the
64
+ * LICENSE.md file in the root directory of this source tree.
65
+ *
66
+ * @license MIT
67
+ */function Vi(){return Vi=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)({}).hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},Vi.apply(null,arguments)}function Bp(e,t){if(e==null)return{};var n={};for(var s in e)if({}.hasOwnProperty.call(e,s)){if(t.indexOf(s)!==-1)continue;n[s]=e[s]}return n}function a0(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function o0(e,t){return e.button===0&&(!t||t==="_self")&&!a0(e)}const l0=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],c0=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],u0="6";try{window.__reactRouterVersion=u0}catch{}const d0=b.createContext({isTransitioning:!1}),f0="startTransition",Bu=Zm[f0];function p0(e){let{basename:t,children:n,future:s,window:r}=e,a=b.useRef();a.current==null&&(a.current=dy({window:r,v5Compat:!0}));let o=a.current,[l,c]=b.useState({action:o.action,location:o.location}),{v7_startTransition:u}=s||{},p=b.useCallback(d=>{u&&Bu?Bu(()=>c(d)):c(d)},[c,u]);return b.useLayoutEffect(()=>o.listen(p),[o,p]),b.useEffect(()=>t0(s),[s]),b.createElement(r0,{basename:t,children:n,location:l.location,navigationType:l.action,navigator:o,future:s})}const m0=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",h0=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,xe=b.forwardRef(function(t,n){let{onClick:s,relative:r,reloadDocument:a,replace:o,state:l,target:c,to:u,preventScrollReset:p,viewTransition:d}=t,f=Bp(t,l0),{basename:x}=b.useContext(It),y,v=!1;if(typeof u=="string"&&h0.test(u)&&(y=u,m0))try{let m=new URL(window.location.href),j=u.startsWith("//")?new URL(m.protocol+u):new URL(u),N=os(j.pathname,x);j.origin===m.origin&&N!=null?u=N+j.search+j.hash:v=!0}catch{}let w=$y(u,{relative:r}),g=y0(u,{replace:o,state:l,target:c,preventScrollReset:p,relative:r,viewTransition:d});function h(m){s&&s(m),m.defaultPrevented||g(m)}return b.createElement("a",Vi({},f,{href:y||w,onClick:v||a?s:h,ref:n,target:c}))}),rt=b.forwardRef(function(t,n){let{"aria-current":s="page",caseSensitive:r=!1,className:a="",end:o=!1,style:l,to:c,viewTransition:u,children:p}=t,d=Bp(t,c0),f=pa(c,{relative:d.relative}),x=Ot(),y=b.useContext(_p),{navigator:v,basename:w}=b.useContext(It),g=y!=null&&x0(f)&&u===!0,h=v.encodeLocation?v.encodeLocation(f).pathname:f.pathname,m=x.pathname,j=y&&y.navigation&&y.navigation.location?y.navigation.location.pathname:null;r||(m=m.toLowerCase(),j=j?j.toLowerCase():null,h=h.toLowerCase()),j&&w&&(j=os(j,w)||j);const N=h!=="/"&&h.endsWith("/")?h.length-1:h.length;let C=m===h||!o&&m.startsWith(h)&&m.charAt(N)==="/",S=j!=null&&(j===h||!o&&j.startsWith(h)&&j.charAt(h.length)==="/"),k={isActive:C,isPending:S,isTransitioning:g},T=C?s:void 0,L;typeof a=="function"?L=a(k):L=[a,C?"active":null,S?"pending":null,g?"transitioning":null].filter(Boolean).join(" ");let O=typeof l=="function"?l(k):l;return b.createElement(xe,Vi({},d,{"aria-current":T,className:L,ref:n,style:O,to:c,viewTransition:u}),typeof p=="function"?p(k):p)});var sl;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(sl||(sl={}));var Uu;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Uu||(Uu={}));function g0(e){let t=b.useContext(da);return t||re(!1),t}function y0(e,t){let{target:n,replace:s,state:r,preventScrollReset:a,relative:o,viewTransition:l}=t===void 0?{}:t,c=$p(),u=Ot(),p=pa(e,{relative:o});return b.useCallback(d=>{if(o0(d,n)){d.preventDefault();let f=s!==void 0?s:Hi(u)===Hi(p);c(e,{replace:f,state:r,preventScrollReset:a,relative:o,viewTransition:l})}},[u,c,p,s,r,n,e,a,o,l])}function x0(e,t){t===void 0&&(t={});let n=b.useContext(d0);n==null&&re(!1);let{basename:s}=g0(sl.useViewTransitionState),r=pa(e,{relative:t.relative});if(!n.isTransitioning)return!1;let a=os(n.currentLocation.pathname,s)||n.currentLocation.pathname,o=os(n.nextLocation.pathname,s)||n.nextLocation.pathname;return tl(r.pathname,o)!=null||tl(r.pathname,a)!=null}function v0(e){const[t,n]=b.useState(null),s=b.useRef(0),r=b.useCallback(()=>{if(e.length===0){n(null);return}let a=e[0];for(const o of e){const l=document.getElementById(o);l&&l.getBoundingClientRect().top<=100&&(a=o)}n(a)},[e]);return b.useEffect(()=>{if(e.length===0)return;r();const a=()=>{cancelAnimationFrame(s.current),s.current=requestAnimationFrame(r)};return window.addEventListener("scroll",a,{passive:!0}),()=>{window.removeEventListener("scroll",a),cancelAnimationFrame(s.current)}},[r,e]),t}async function ee(e,t,n){const s={method:e};n&&(s.headers={"Content-Type":"application/json"},s.body=JSON.stringify(n));const r=await fetch(t,s),a=await r.json();if(!r.ok)throw new Error(a.error??`HTTP ${r.status}`);return a}const B={getStatus:()=>ee("GET","/api/status"),getConnectors:()=>ee("GET","/api/connectors"),getConnector:(e,t)=>ee("GET",`/api/connectors/${e}/${t}`),run:(e,t)=>ee("POST","/api/run",{connector:e,args:t}),approve:(e,t)=>ee("POST","/api/approval",{approvalId:e,approved:t}),getAudit:e=>{const t=new URLSearchParams(e).toString();return ee("GET",`/api/audit${t?`?${t}`:""}`)},getAuditEvent:e=>ee("GET",`/api/audit/${e}`),getConfig:()=>ee("GET","/api/config"),setConfig:(e,t)=>ee("POST","/api/config",{key:e,value:t}),getPreferences:()=>ee("GET","/api/preferences"),setPreference:(e,t)=>ee("PUT","/api/preferences",{key:e,value:t}),getGoals:e=>ee("GET",`/api/goals?month=${e}`),upsertGoal:e=>ee("POST","/api/goals",e),deleteGoal:e=>ee("DELETE",`/api/goals/${e}`),getCachedReport:e=>ee("GET",`/api/timetracking/cache?month=${e}`),cacheReport:(e,t)=>ee("POST","/api/timetracking/cache",{month:e,data:t}),getCachedProjects:()=>ee("GET","/api/timetracking/projects"),cacheProjects:e=>ee("POST","/api/timetracking/projects",{data:e}),generateJournal:e=>ee("POST","/api/journal/generate",e),getCachedSecurityNews:()=>ee("GET","/api/security-news/cache"),cacheSecurityNews:e=>ee("POST","/api/security-news/cache",{data:e}),getCachedTrustedPeers:()=>ee("GET","/api/trusted-peers/cache"),cacheTrustedPeers:e=>ee("POST","/api/trusted-peers/cache",{data:e}),getSkills:()=>ee("GET","/api/skills")};function ma(e){const t=new Map;for(const n of e){const s=n.key.split("/")[0],r=t.get(s)??[];r.push(n),t.set(s,r)}return[...t.entries()]}const Up={"command.success":"success","command.error":"error","command.denied":"error","command.start":"neutral","auth.failed":"warning","approval.granted":"success","approval.rejected":"error","config.changed":"neutral"},b0={success:"border-emerald-500 text-emerald-600 dark:text-emerald-400",error:"border-red-500 text-red-600 dark:text-red-400",warning:"border-amber-500 text-amber-600 dark:text-amber-400",info:"border-sky-500 text-sky-600 dark:text-sky-400",secondary:"border-violet-500 text-violet-600 dark:text-violet-400",neutral:"border-base-300 text-base-content/60"},j0={sm:"px-2 py-0.5 text-xs",xs:"px-1.5 py-px text-[0.65rem]"};function H({variant:e="neutral",size:t="sm",className:n="",children:s}){return i.jsx("span",{className:`inline-flex items-center font-mono font-medium border ${j0[t]} ${b0[e]} ${n}`,children:s})}function w0(){const[e,t]=b.useState(null),[n,s]=b.useState([]),r=b.useCallback(()=>{B.getStatus().then(t).catch(()=>t(null)),B.getAudit({limit:"10"}).then(o=>s(o.events)).catch(()=>{})},[]);b.useEffect(()=>{r();const o=setInterval(r,3e4);return()=>clearInterval(o)},[r]);function a(o){const l=Date.now()-new Date(o).getTime(),c=Math.floor(l/6e4);if(c<1)return"just now";if(c<60)return`${c} min ago`;const u=Math.floor(c/60);return u<24?`${u} hr ago`:`${Math.floor(u/24)}d ago`}return i.jsxs("div",{className:"max-w-4xl mx-auto",children:[i.jsx("h2",{className:"font-display text-xl font-bold uppercase tracking-[0.06em] mb-5",children:"Dashboard"}),i.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 border border-base-300 mb-8",children:[i.jsxs("div",{className:"p-3 sm:border-r sm:border-r-base-300",children:[i.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Daemon"}),i.jsx("div",{className:`font-display font-semibold text-sm ${e!=null&&e.ok?"text-success":"text-error"}`,children:e!=null&&e.ok?"Running":"Offline"})]}),i.jsxs("div",{className:"p-3 border-t border-t-base-300 sm:border-t-0 sm:border-r sm:border-r-base-300",children:[i.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Extension"}),i.jsx("div",{className:`font-display font-semibold text-sm ${e!=null&&e.extensionConnected?"text-success":"text-error"}`,children:e!=null&&e.extensionConnected?"Connected":"Disconnected"})]}),i.jsxs("div",{className:"p-3 border-t border-t-base-300 sm:border-t-0",children:[i.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Connectors"}),i.jsxs("div",{className:"font-display font-semibold text-sm",children:[(e==null?void 0:e.connectorCount)??0," loaded"]})]})]}),i.jsx("h3",{className:"font-display text-base font-semibold mb-3",children:"Recent activity"}),n.length===0?i.jsxs("div",{className:"border border-base-300 p-6 text-center",children:[i.jsx("p",{className:"text-sm opacity-50 mb-1",children:"No recent activity"}),i.jsx("p",{className:"font-mono text-xs opacity-30",children:"Run a connector to see events here."})]}):i.jsx("div",{className:"overflow-x-auto border border-base-300",children:i.jsxs("table",{className:"table table-sm w-full",children:[i.jsx("thead",{children:i.jsxs("tr",{className:"bg-base-200",children:[i.jsx("th",{children:"Time"}),i.jsx("th",{children:"Connector"}),i.jsx("th",{children:"Type"}),i.jsx("th",{children:"Duration"})]})}),i.jsx("tbody",{children:n.map(o=>i.jsxs("tr",{className:"hover:bg-base-200",children:[i.jsx("td",{className:"opacity-50 text-sm font-mono",children:a(o.timestamp)}),i.jsx("td",{className:"font-mono text-sm",children:o.connector}),i.jsx("td",{children:i.jsx(H,{variant:Up[o.type]??"neutral",children:o.type})}),i.jsx("td",{className:"text-sm font-mono",children:o.durationMs?`${(o.durationMs/1e3).toFixed(1)}s`:"—"})]},o.id))})]})})]})}function ut({label:e}){return i.jsxs("div",{className:"flex items-center gap-3 py-4",children:[i.jsx("span",{className:"loading loading-spinner loading-md"}),e&&i.jsx("span",{className:"text-sm opacity-60",children:e})]})}function N0({c:e,approvingKey:t,onApprove:n}){const[s,r]=e.key.split("/");return i.jsxs("div",{className:"border border-base-300/50 p-3 flex flex-col sm:flex-row sm:items-center sm:justify-between gap-2",children:[i.jsxs("div",{className:"flex-1",children:[i.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[i.jsx("span",{className:"font-mono font-semibold text-sm",children:r}),i.jsx(H,{size:"sm",children:e.access}),e.capabilities.map(a=>i.jsx(H,{size:"sm",children:a},a)),e.isHighRisk&&e.isApproved&&i.jsx(H,{variant:"success",size:"sm",children:"Approved"}),e.isHighRisk&&!e.isApproved&&i.jsx(H,{variant:"warning",size:"sm",children:"Blocked — requires approval"})]}),i.jsx("p",{className:"text-sm opacity-60 mt-1",children:e.description}),e.domains.length>0&&i.jsxs("div",{className:"text-xs opacity-40 mt-1",children:["Domains: ",e.domains.join(", ")]})]}),i.jsxs("div",{className:"flex gap-2 ml-4 shrink-0",children:[e.isHighRisk&&!e.isApproved&&i.jsx("button",{className:"btn btn-sm btn-warning btn-outline",disabled:t===e.key,onClick:()=>n(e.key),children:t===e.key?"Approving...":"Approve"}),e.hasAppPage&&e.appRoute&&i.jsx(xe,{to:e.appRoute,className:"btn btn-sm btn-primary",children:"Open App"}),i.jsx(xe,{to:`/connectors/${s}/${r}`,className:"btn btn-sm btn-ghost",children:"Run"})]})]})}function k0({site:e,connectors:t,approvingKey:n,onApprove:s}){const[r,a]=b.useState(!1);return i.jsxs("div",{id:`conn-${e}`,className:"border border-base-300 p-4 scroll-mt-4",children:[i.jsxs("button",{className:"flex items-center gap-2 w-full text-left",onClick:()=>a(!r),children:[i.jsx("span",{className:"text-xs opacity-50",children:r?"▸":"▾"}),i.jsx("span",{className:"font-mono font-semibold",children:e}),i.jsxs("span",{className:"text-xs opacity-40",children:[t.length," ",t.length===1?"connector":"connectors"]})]}),!r&&i.jsx("div",{className:"space-y-2 mt-3",children:t.map(o=>i.jsx(N0,{c:o,approvingKey:n,onApprove:s},o.key))})]})}function S0(){const[e,t]=b.useState([]),[n,s]=b.useState([]),[r,a]=b.useState(!0),[o,l]=b.useState(null),c=b.useCallback(()=>{const d=B.getConnectors(),f=B.getConfig().catch(()=>({ok:!1,config:{}}));Promise.all([d,f]).then(([x,y])=>{t(x.connectors);const v=y.config.security??{};s(v.approvedHighRisk??[])}).catch(()=>{}).finally(()=>a(!1))},[]);b.useEffect(()=>{c()},[c]);const u=b.useCallback(async d=>{l(d);try{const f=[...n,d];await B.setConfig("security.approvedHighRisk",JSON.stringify(f)),c()}catch{}finally{l(null)}},[n,c]),p=b.useMemo(()=>ma(e),[e]);return r?i.jsx(ut,{label:"Loading connectors..."}):i.jsxs("div",{className:"max-w-4xl mx-auto",children:[i.jsx("h2",{className:"font-display text-xl font-bold uppercase tracking-[0.06em] mb-5",children:"Connectors"}),e.length===0?i.jsxs("div",{className:"border border-base-300 p-6 text-center",children:[i.jsx("p",{className:"text-sm opacity-50 mb-1",children:"No connectors loaded"}),i.jsx("p",{className:"font-mono text-xs opacity-30",children:"Check the daemon is running and connectors are installed in ~/.commandgarden/connectors/"})]}):i.jsx("div",{className:"space-y-3",children:p.map(([d,f])=>i.jsx(k0,{site:d,connectors:f,approvingKey:o,onApprove:u},d))})]})}function yr(){const[e,t]=b.useState(!1),[n,s]=b.useState(null),[r,a]=b.useState(null),[o,l]=b.useState(!1),[c,u]=b.useState(null),p=b.useCallback(()=>{t(!1),s(null),a(null),l(!1),u(null)},[]),d=b.useCallback(async(x,y)=>{t(!0),a(null),s(null),l(!1),u(null);try{const v=await B.run(x,y);if(v.requiresApproval&&v.requestId){l(!0);const w=new EventSource(`/api/run/events/${v.requestId}`);w.addEventListener("approval",g=>{const h=JSON.parse(g.data);u(h.approvalId)}),w.addEventListener("result",g=>{const h=JSON.parse(g.data);!h.ok&&h.error?a(h.error):s(h),l(!1),t(!1),w.close()}),w.onerror=()=>{a("SSE connection lost"),l(!1),t(!1),w.close()}}else!v.ok&&v.error?(a(v.error),t(!1)):(s(v),t(!1))}catch(v){a(v instanceof Error?v.message:"Unknown error"),t(!1)}},[]),f=b.useCallback(async x=>{if(c)try{await B.approve(c,x),x||(l(!1),t(!1),a("Approval rejected"))}catch(y){a(y instanceof Error?y.message:"Approval failed")}},[c]);return{running:e,result:n,error:r,approvalPending:o,approvalId:c,run:d,handleApproval:f,reset:p}}function C0(){const{site:e,name:t}=By(),n=`${e}/${t}`,[s,r]=b.useState(null),[a,o]=b.useState(!0),[l,c]=b.useState({}),[u,p]=b.useState(null),{running:d,result:f,error:x,approvalPending:y,approvalId:v,run:w,handleApproval:g}=yr();b.useEffect(()=>{!e||!t||B.getConnector(e,t).then(m=>{r(m.connector);const j={};for(const N of m.connector.args??[])j[N.name]="";c(j)}).catch(m=>p(m.message)).finally(()=>o(!1))},[e,t]);const h=b.useCallback(async()=>{const m={};for(const[j,N]of Object.entries(l))N&&(m[j]=N);await w(n,m)},[l,n,w]);return a?i.jsx(ut,{label:"Loading connector..."}):s?i.jsxs("div",{className:"max-w-4xl mx-auto",children:[i.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[i.jsx(xe,{to:"/connectors",className:"text-sm opacity-50 hover:opacity-80",children:"Connectors"}),i.jsx("span",{className:"text-sm opacity-30",children:"/"})]}),i.jsx("h2",{className:"font-display text-xl font-bold uppercase tracking-[0.06em] mb-2",children:n}),i.jsx("p",{className:"text-sm opacity-50 mb-5",children:s.description}),i.jsxs("div",{className:"border border-base-300 p-5 mb-6",children:[i.jsx("h3",{className:"font-display font-semibold mb-4",children:"Arguments"}),i.jsxs("div",{className:"flex flex-wrap items-end gap-4",children:[(s.args??[]).map(m=>i.jsxs("label",{className:"form-control",children:[i.jsxs("span",{className:"label-text mb-1 text-sm",children:[m.name,!m.required&&i.jsx("span",{className:"opacity-40",children:" (optional)"})]}),i.jsx("input",{type:"text",className:"input input-bordered input-sm w-40",placeholder:m.help,value:l[m.name]??"",onChange:j=>c(N=>({...N,[m.name]:j.target.value})),pattern:m.pattern}),m.help&&i.jsx("span",{className:"text-xs opacity-40 mt-1",children:m.help})]},m.name)),i.jsx("button",{className:"btn btn-primary btn-sm",onClick:h,disabled:d,children:d?"Running...":"Run connector"})]})]}),d&&!y&&i.jsx(ut,{label:`Running ${n} — this drives your browser and may take up to a minute.`}),y&&i.jsxs("div",{className:"alert alert-warning mb-4",children:[i.jsx("span",{children:"This connector requires approval before proceeding."}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx("button",{className:"btn btn-sm btn-success",onClick:()=>g(!0),disabled:!v,children:"Approve"}),i.jsx("button",{className:"btn btn-sm btn-error",onClick:()=>g(!1),disabled:!v,children:"Reject"})]})]}),x&&i.jsx("div",{className:"alert alert-error mb-4",children:i.jsx("span",{children:x})}),f&&i.jsxs("div",{className:"border border-base-300 p-5",children:[i.jsxs("div",{className:"flex items-center justify-between mb-3",children:[i.jsx("h3",{className:"font-semibold",children:"Results"}),i.jsxs("div",{className:"text-xs opacity-40",children:[f.rowCount??f.data.length," rows",f.durationMs?` · ${(f.durationMs/1e3).toFixed(1)}s`:""]})]}),f.data.length===0?i.jsx("p",{className:"text-sm opacity-50",children:"No results returned."}):i.jsx("div",{className:"overflow-x-auto",children:i.jsxs("table",{className:"table table-sm",children:[i.jsx("thead",{children:i.jsx("tr",{children:(f.columns??Object.keys(f.data[0])).map(m=>i.jsx("th",{children:m},m))})}),i.jsx("tbody",{children:f.data.map((m,j)=>i.jsx("tr",{children:(f.columns??Object.keys(m)).map(N=>i.jsx("td",{className:"text-sm",children:String(m[N]??"")},N))},j))})]})})]})]}):i.jsx("div",{className:"text-error",children:u??`Connector not found: ${n}`})}const E0=[{label:"Last 24 hours",hours:24},{label:"Last 7 days",hours:168},{label:"Last 30 days",hours:720},{label:"Last 90 days",hours:2160}],T0=["command.start","command.success","command.error","command.denied","auth.failed","approval.granted","approval.rejected","config.changed"],Cn=20;function A0(){const[e,t]=b.useState([]),[n,s]=b.useState([]),[r,a]=b.useState(!0),[o,l]=b.useState(168),[c,u]=b.useState(""),[p,d]=b.useState(""),[f,x]=b.useState(null),[y,v]=b.useState(0);b.useEffect(()=>{B.getConnectors().then(m=>s(m.connectors)).catch(()=>{})},[]);const w=b.useCallback(()=>{a(!0);const m={since:new Date(Date.now()-o*36e5).toISOString(),limit:String(Cn+y+1)};c&&(m.type=c),p&&(m.connector=p),B.getAudit(m).then(j=>t(j.events)).catch(()=>{}).finally(()=>a(!1))},[o,c,p,y]);b.useEffect(()=>{w();const m=setInterval(w,6e4);return()=>clearInterval(m)},[w]);const g=e.slice(y,y+Cn),h=e.length>y+Cn;return i.jsxs("div",{className:"max-w-5xl mx-auto",children:[i.jsx("h2",{className:"font-display text-xl font-bold uppercase tracking-[0.06em] mb-5",children:"Audit Log"}),i.jsxs("div",{className:"flex flex-wrap items-end gap-3 mb-6",children:[i.jsxs("label",{className:"form-control",children:[i.jsx("span",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Time range"}),i.jsx("select",{className:"select select-bordered select-sm",value:o,onChange:m=>{l(Number(m.target.value)),v(0)},children:E0.map(m=>i.jsx("option",{value:m.hours,children:m.label},m.hours))})]}),i.jsxs("label",{className:"form-control",children:[i.jsx("span",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Event type"}),i.jsxs("select",{className:"select select-bordered select-sm",value:c,onChange:m=>{u(m.target.value),v(0)},children:[i.jsx("option",{value:"",children:"All types"}),T0.map(m=>i.jsx("option",{value:m,children:m},m))]})]}),i.jsxs("label",{className:"form-control",children:[i.jsx("span",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Connector"}),i.jsxs("select",{className:"select select-bordered select-sm",value:p,onChange:m=>{d(m.target.value),v(0)},children:[i.jsx("option",{value:"",children:"All connectors"}),n.map(m=>i.jsx("option",{value:m.key,children:m.key},m.key))]})]})]}),r&&e.length===0?i.jsx(ut,{label:"Loading audit events..."}):i.jsxs(i.Fragment,{children:[g.length===0?i.jsx("p",{className:"text-sm opacity-50",children:"No events match the current filters."}):i.jsx("div",{className:"overflow-x-auto border border-base-300",children:i.jsxs("table",{className:"table table-sm",children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("th",{children:"Time"}),i.jsx("th",{children:"Type"}),i.jsx("th",{children:"Connector"}),i.jsx("th",{children:"User"}),i.jsx("th",{children:"Duration"}),i.jsx("th",{})]})}),i.jsx("tbody",{children:g.map(m=>i.jsxs(b.Fragment,{children:[i.jsxs("tr",{className:"cursor-pointer hover:bg-base-200",onClick:()=>x(f===m.id?null:m.id),role:"button","aria-expanded":f===m.id,tabIndex:0,onKeyDown:j=>{(j.key==="Enter"||j.key===" ")&&(j.preventDefault(),x(f===m.id?null:m.id))},children:[i.jsx("td",{className:"text-sm font-mono",children:new Date(m.timestamp).toLocaleString()}),i.jsx("td",{children:i.jsx(H,{variant:Up[m.type]??"neutral",children:m.type})}),i.jsx("td",{className:"font-mono text-sm",children:m.connector||"—"}),i.jsx("td",{className:"text-sm",children:m.user}),i.jsx("td",{className:"text-sm font-mono",children:m.durationMs?`${(m.durationMs/1e3).toFixed(1)}s`:"—"}),i.jsx("td",{className:"text-xs opacity-40","aria-hidden":"true",children:f===m.id?"▲":"▼"})]},m.id),f===m.id&&i.jsx("tr",{children:i.jsxs("td",{colSpan:6,className:"bg-base-200/50 p-4",children:[i.jsxs("div",{className:"grid grid-cols-2 gap-2 text-sm mb-3",children:[i.jsxs("div",{children:[i.jsx("span",{className:"opacity-50",children:"ID:"})," ",i.jsx("span",{className:"font-mono text-xs",children:m.id})]}),i.jsxs("div",{children:[i.jsx("span",{className:"opacity-50",children:"Correlation:"})," ",i.jsx("span",{className:"font-mono text-xs",children:m.correlationId??"—"})]}),m.connectorHash&&i.jsxs("div",{children:[i.jsx("span",{className:"opacity-50",children:"Connector hash:"})," ",i.jsx("span",{className:"font-mono text-xs",children:m.connectorHash})]}),m.error&&i.jsxs("div",{className:"col-span-2",children:[i.jsx("span",{className:"opacity-50",children:"Error:"})," ",i.jsx("span",{className:"text-error",children:m.error})]}),m.args&&i.jsxs("div",{className:"col-span-2",children:[i.jsx("span",{className:"opacity-50",children:"Args:"})," ",i.jsx("span",{className:"font-mono text-xs",children:JSON.stringify(m.args)})]}),m.domains&&m.domains.length>0&&i.jsxs("div",{children:[i.jsx("span",{className:"opacity-50",children:"Domains:"})," ",m.domains.join(", ")]}),m.capabilities&&m.capabilities.length>0&&i.jsxs("div",{children:[i.jsx("span",{className:"opacity-50",children:"Capabilities:"})," ",m.capabilities.join(", ")]})]}),m.steps&&m.steps.length>0&&i.jsxs(i.Fragment,{children:[i.jsx("h4",{className:"font-semibold text-sm mb-2",children:"Pipeline steps"}),i.jsxs("table",{className:"table table-xs",children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("th",{children:"#"}),i.jsx("th",{children:"Step"}),i.jsx("th",{children:"Capability"}),i.jsx("th",{children:"Duration"}),i.jsx("th",{children:"Error"})]})}),i.jsx("tbody",{children:m.steps.map((j,N)=>i.jsxs("tr",{children:[i.jsx("td",{children:N+1}),i.jsx("td",{children:j.step}),i.jsx("td",{children:j.capability}),i.jsxs("td",{children:[(j.durationMs/1e3).toFixed(2),"s"]}),i.jsx("td",{className:"text-error",children:j.error??""})]},N))})]})]})]})},`${m.id}-detail`)]},m.id))})]})}),g.length>0&&i.jsxs("div",{className:"flex justify-between items-center mt-4",children:[i.jsx("button",{className:"btn btn-sm btn-ghost",disabled:y===0,onClick:()=>v(Math.max(0,y-Cn)),children:"Previous"}),i.jsxs("span",{className:"text-sm opacity-50",children:["Showing ",y+1,"–",Math.min(y+Cn,e.length),h?"":` of ${e.length}`]}),i.jsx("button",{className:"btn btn-sm btn-ghost",disabled:!h,onClick:()=>v(y+Cn),children:"Next"})]})]})]})}const dc=Symbol.for("yaml.alias"),rl=Symbol.for("yaml.document"),Xt=Symbol.for("yaml.map"),Wp=Symbol.for("yaml.pair"),yt=Symbol.for("yaml.scalar"),hs=Symbol.for("yaml.seq"),Ze=Symbol.for("yaml.node.type"),gs=e=>!!e&&typeof e=="object"&&e[Ze]===dc,Sr=e=>!!e&&typeof e=="object"&&e[Ze]===rl,Cr=e=>!!e&&typeof e=="object"&&e[Ze]===Xt,ue=e=>!!e&&typeof e=="object"&&e[Ze]===Wp,Q=e=>!!e&&typeof e=="object"&&e[Ze]===yt,Er=e=>!!e&&typeof e=="object"&&e[Ze]===hs;function le(e){if(e&&typeof e=="object")switch(e[Ze]){case Xt:case hs:return!0}return!1}function ce(e){if(e&&typeof e=="object")switch(e[Ze]){case dc:case Xt:case yt:case hs:return!0}return!1}const Hp=e=>(Q(e)||le(e))&&!!e.anchor,ln=Symbol("break visit"),L0=Symbol("skip children"),Ys=Symbol("remove node");function ys(e,t){const n=I0(t);Sr(e)?Wn(null,e.contents,n,Object.freeze([e]))===Ys&&(e.contents=null):Wn(null,e,n,Object.freeze([]))}ys.BREAK=ln;ys.SKIP=L0;ys.REMOVE=Ys;function Wn(e,t,n,s){const r=O0(e,t,n,s);if(ce(r)||ue(r))return P0(e,s,r),Wn(e,r,n,s);if(typeof r!="symbol"){if(le(t)){s=Object.freeze(s.concat(t));for(let a=0;a<t.items.length;++a){const o=Wn(a,t.items[a],n,s);if(typeof o=="number")a=o-1;else{if(o===ln)return ln;o===Ys&&(t.items.splice(a,1),a-=1)}}}else if(ue(t)){s=Object.freeze(s.concat(t));const a=Wn("key",t.key,n,s);if(a===ln)return ln;a===Ys&&(t.key=null);const o=Wn("value",t.value,n,s);if(o===ln)return ln;o===Ys&&(t.value=null)}}return r}function I0(e){return typeof e=="object"&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}function O0(e,t,n,s){var r,a,o,l,c;if(typeof n=="function")return n(e,t,s);if(Cr(t))return(r=n.Map)==null?void 0:r.call(n,e,t,s);if(Er(t))return(a=n.Seq)==null?void 0:a.call(n,e,t,s);if(ue(t))return(o=n.Pair)==null?void 0:o.call(n,e,t,s);if(Q(t))return(l=n.Scalar)==null?void 0:l.call(n,e,t,s);if(gs(t))return(c=n.Alias)==null?void 0:c.call(n,e,t,s)}function P0(e,t,n){const s=t[t.length-1];if(le(s))s.items[e]=n;else if(ue(s))e==="key"?s.key=n:s.value=n;else if(Sr(s))s.contents=n;else{const r=gs(s)?"alias":"scalar";throw new Error(`Cannot replace node with ${r} parent`)}}const _0={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},M0=e=>e.replace(/[!,[\]{}]/g,t=>_0[t]);class Ce{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},Ce.defaultYaml,t),this.tags=Object.assign({},Ce.defaultTags,n)}clone(){const t=new Ce(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){const t=new Ce(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:Ce.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},Ce.defaultTags);break}return t}add(t,n){this.atNextDocument&&(this.yaml={explicit:Ce.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},Ce.defaultTags),this.atNextDocument=!1);const s=t.trim().split(/[ \t]+/),r=s.shift();switch(r){case"%TAG":{if(s.length!==2&&(n(0,"%TAG directive should contain exactly two parts"),s.length<2))return!1;const[a,o]=s;return this.tags[a]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,s.length!==1)return n(0,"%YAML directive should contain exactly one part"),!1;const[a]=s;if(a==="1.1"||a==="1.2")return this.yaml.version=a,!0;{const o=/^\d+\.\d+$/.test(a);return n(6,`Unsupported YAML version ${a}`,o),!1}}default:return n(0,`Unknown directive ${r}`,!0),!1}}tagName(t,n){if(t==="!")return"!";if(t[0]!=="!")return n(`Not a valid tag: ${t}`),null;if(t[1]==="<"){const o=t.slice(2,-1);return o==="!"||o==="!!"?(n(`Verbatim tags aren't resolved, so ${t} is invalid.`),null):(t[t.length-1]!==">"&&n("Verbatim tags must end with a >"),o)}const[,s,r]=t.match(/^(.*!)([^!]*)$/s);r||n(`The ${t} tag has no suffix`);const a=this.tags[s];if(a)try{return a+decodeURIComponent(r)}catch(o){return n(String(o)),null}return s==="!"?t:(n(`Could not resolve tag: ${t}`),null)}tagString(t){for(const[n,s]of Object.entries(this.tags))if(t.startsWith(s))return n+M0(t.substring(s.length));return t[0]==="!"?t:`!<${t}>`}toString(t){const n=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],s=Object.entries(this.tags);let r;if(t&&s.length>0&&ce(t.contents)){const a={};ys(t.contents,(o,l)=>{ce(l)&&l.tag&&(a[l.tag]=!0)}),r=Object.keys(a)}else r=[];for(const[a,o]of s)a==="!!"&&o==="tag:yaml.org,2002:"||(!t||r.some(l=>l.startsWith(o)))&&n.push(`%TAG ${a} ${o}`);return n.join(`
68
+ `)}}Ce.defaultYaml={explicit:!1,version:"1.2"};Ce.defaultTags={"!!":"tag:yaml.org,2002:"};function Vp(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){const n=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw new Error(n)}return!0}function Kp(e){const t=new Set;return ys(e,{Value(n,s){s.anchor&&t.add(s.anchor)}}),t}function Gp(e,t){for(let n=1;;++n){const s=`${e}${n}`;if(!t.has(s))return s}}function D0(e,t){const n=[],s=new Map;let r=null;return{onAnchor:a=>{n.push(a),r??(r=Kp(e));const o=Gp(t,r);return r.add(o),o},setAnchors:()=>{for(const a of n){const o=s.get(a);if(typeof o=="object"&&o.anchor&&(Q(o.node)||le(o.node)))o.node.anchor=o.anchor;else{const l=new Error("Failed to resolve repeated object (this should not happen)");throw l.source=a,l}}},sourceObjects:s}}function Hn(e,t,n,s){if(s&&typeof s=="object")if(Array.isArray(s))for(let r=0,a=s.length;r<a;++r){const o=s[r],l=Hn(e,s,String(r),o);l===void 0?delete s[r]:l!==o&&(s[r]=l)}else if(s instanceof Map)for(const r of Array.from(s.keys())){const a=s.get(r),o=Hn(e,s,r,a);o===void 0?s.delete(r):o!==a&&s.set(r,o)}else if(s instanceof Set)for(const r of Array.from(s)){const a=Hn(e,s,r,r);a===void 0?s.delete(r):a!==r&&(s.delete(r),s.add(a))}else for(const[r,a]of Object.entries(s)){const o=Hn(e,s,r,a);o===void 0?delete s[r]:o!==a&&(s[r]=o)}return e.call(t,n,s)}function Qe(e,t,n){if(Array.isArray(e))return e.map((s,r)=>Qe(s,String(r),n));if(e&&typeof e.toJSON=="function"){if(!n||!Hp(e))return e.toJSON(t,n);const s={aliasCount:0,count:1,res:void 0};n.anchors.set(e,s),n.onCreate=a=>{s.res=a,delete n.onCreate};const r=e.toJSON(t,n);return n.onCreate&&n.onCreate(r),r}return typeof e=="bigint"&&!(n!=null&&n.keep)?Number(e):e}class fc{constructor(t){Object.defineProperty(this,Ze,{value:t})}clone(){const t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(t.range=this.range.slice()),t}toJS(t,{mapAsMap:n,maxAliasCount:s,onAnchor:r,reviver:a}={}){if(!Sr(t))throw new TypeError("A document argument is required");const o={anchors:new Map,doc:t,keep:!0,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof s=="number"?s:100},l=Qe(this,"",o);if(typeof r=="function")for(const{count:c,res:u}of o.anchors.values())r(u,c);return typeof a=="function"?Hn(a,{"":l},"",l):l}}class pc extends fc{constructor(t){super(dc),this.source=t,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(t,n){if((n==null?void 0:n.maxAliasCount)===0)throw new ReferenceError("Alias resolution is disabled");let s;n!=null&&n.aliasResolveCache?s=n.aliasResolveCache:(s=[],ys(t,{Node:(a,o)=>{(gs(o)||Hp(o))&&s.push(o)}}),n&&(n.aliasResolveCache=s));let r;for(const a of s){if(a===this)break;a.anchor===this.source&&(r=a)}return r}toJSON(t,n){if(!n)return{source:this.source};const{anchors:s,doc:r,maxAliasCount:a}=n,o=this.resolve(r,n);if(!o){const c=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(c)}let l=s.get(o);if(l||(Qe(o,null,n),l=s.get(o)),(l==null?void 0:l.res)===void 0){const c="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(c)}if(a>=0&&(l.count+=1,l.aliasCount===0&&(l.aliasCount=gi(r,o,s)),l.count*l.aliasCount>a)){const c="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(c)}return l.res}toString(t,n,s){const r=`*${this.source}`;if(t){if(Vp(this.source),t.options.verifyAliasOrder&&!t.anchors.has(this.source)){const a=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(a)}if(t.implicitKey)return`${r} `}return r}}function gi(e,t,n){if(gs(t)){const s=t.resolve(e),r=n&&s&&n.get(s);return r?r.count*r.aliasCount:0}else if(le(t)){let s=0;for(const r of t.items){const a=gi(e,r,n);a>s&&(s=a)}return s}else if(ue(t)){const s=gi(e,t.key,n),r=gi(e,t.value,n);return Math.max(s,r)}return 1}const qp=e=>!e||typeof e!="function"&&typeof e!="object";class W extends fc{constructor(t){super(yt),this.value=t}toJSON(t,n){return n!=null&&n.keep?this.value:Qe(this.value,t,n)}toString(){return String(this.value)}}W.BLOCK_FOLDED="BLOCK_FOLDED";W.BLOCK_LITERAL="BLOCK_LITERAL";W.PLAIN="PLAIN";W.QUOTE_DOUBLE="QUOTE_DOUBLE";W.QUOTE_SINGLE="QUOTE_SINGLE";const $0="tag:yaml.org,2002:";function R0(e,t,n){if(t){const s=n.filter(a=>a.tag===t),r=s.find(a=>!a.format)??s[0];if(!r)throw new Error(`Tag ${t} not found`);return r}return n.find(s=>{var r;return((r=s.identify)==null?void 0:r.call(s,e))&&!s.format})}function xr(e,t,n){var d,f,x;if(Sr(e)&&(e=e.contents),ce(e))return e;if(ue(e)){const y=(f=(d=n.schema[Xt]).createNode)==null?void 0:f.call(d,n.schema,null,n);return y.items.push(e),y}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<"u"&&e instanceof BigInt)&&(e=e.valueOf());const{aliasDuplicateObjects:s,onAnchor:r,onTagObj:a,schema:o,sourceObjects:l}=n;let c;if(s&&e&&typeof e=="object"){if(c=l.get(e),c)return c.anchor??(c.anchor=r(e)),new pc(c.anchor);c={anchor:null,node:null},l.set(e,c)}t!=null&&t.startsWith("!!")&&(t=$0+t.slice(2));let u=R0(e,t,o.tags);if(!u){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){const y=new W(e);return c&&(c.node=y),y}u=e instanceof Map?o[Xt]:Symbol.iterator in Object(e)?o[hs]:o[Xt]}a&&(a(u),delete n.onTagObj);const p=u!=null&&u.createNode?u.createNode(n.schema,e,n):typeof((x=u==null?void 0:u.nodeClass)==null?void 0:x.from)=="function"?u.nodeClass.from(n.schema,e,n):new W(e);return t?p.tag=t:u.default||(p.tag=u.tag),c&&(c.node=p),p}function Ki(e,t,n){let s=n;for(let r=t.length-1;r>=0;--r){const a=t[r];if(typeof a=="number"&&Number.isInteger(a)&&a>=0){const o=[];o[a]=s,s=o}else s=new Map([[a,s]])}return xr(s,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:e,sourceObjects:new Map})}const Ds=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done;class Yp extends fc{constructor(t,n){super(t),Object.defineProperty(this,"schema",{value:n,configurable:!0,enumerable:!1,writable:!0})}clone(t){const n=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return t&&(n.schema=t),n.items=n.items.map(s=>ce(s)||ue(s)?s.clone(t):s),this.range&&(n.range=this.range.slice()),n}addIn(t,n){if(Ds(t))this.add(n);else{const[s,...r]=t,a=this.get(s,!0);if(le(a))a.addIn(r,n);else if(a===void 0&&this.schema)this.set(s,Ki(this.schema,r,n));else throw new Error(`Expected YAML collection at ${s}. Remaining path: ${r}`)}}deleteIn(t){const[n,...s]=t;if(s.length===0)return this.delete(n);const r=this.get(n,!0);if(le(r))return r.deleteIn(s);throw new Error(`Expected YAML collection at ${n}. Remaining path: ${s}`)}getIn(t,n){const[s,...r]=t,a=this.get(s,!0);return r.length===0?!n&&Q(a)?a.value:a:le(a)?a.getIn(r,n):void 0}hasAllNullValues(t){return this.items.every(n=>{if(!ue(n))return!1;const s=n.value;return s==null||t&&Q(s)&&s.value==null&&!s.commentBefore&&!s.comment&&!s.tag})}hasIn(t){const[n,...s]=t;if(s.length===0)return this.has(n);const r=this.get(n,!0);return le(r)?r.hasIn(s):!1}setIn(t,n){const[s,...r]=t;if(r.length===0)this.set(s,n);else{const a=this.get(s,!0);if(le(a))a.setIn(r,n);else if(a===void 0&&this.schema)this.set(s,Ki(this.schema,r,n));else throw new Error(`Expected YAML collection at ${s}. Remaining path: ${r}`)}}}const z0=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function Nt(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}const fn=(e,t,n)=>e.endsWith(`
69
+ `)?Nt(n,t):n.includes(`
70
+ `)?`
71
+ `+Nt(n,t):(e.endsWith(" ")?"":" ")+n,Qp="flow",il="block",yi="quoted";function ha(e,t,n="flow",{indentAtStart:s,lineWidth:r=80,minContentWidth:a=20,onFold:o,onOverflow:l}={}){if(!r||r<0)return e;r<a&&(a=0);const c=Math.max(1+a,1+r-t.length);if(e.length<=c)return e;const u=[],p={};let d=r-t.length;typeof s=="number"&&(s>r-Math.max(2,a)?u.push(0):d=r-s);let f,x,y=!1,v=-1,w=-1,g=-1;n===il&&(v=Wu(e,v,t.length),v!==-1&&(d=v+c));for(let m;m=e[v+=1];){if(n===yi&&m==="\\"){switch(w=v,e[v+1]){case"x":v+=3;break;case"u":v+=5;break;case"U":v+=9;break;default:v+=1}g=v}if(m===`
72
+ `)n===il&&(v=Wu(e,v,t.length)),d=v+t.length+c,f=void 0;else{if(m===" "&&x&&x!==" "&&x!==`
73
+ `&&x!==" "){const j=e[v+1];j&&j!==" "&&j!==`
74
+ `&&j!==" "&&(f=v)}if(v>=d)if(f)u.push(f),d=f+c,f=void 0;else if(n===yi){for(;x===" "||x===" ";)x=m,m=e[v+=1],y=!0;const j=v>g+1?v-2:w-1;if(p[j])return e;u.push(j),p[j]=!0,d=j+c,f=void 0}else y=!0}x=m}if(y&&l&&l(),u.length===0)return e;o&&o();let h=e.slice(0,u[0]);for(let m=0;m<u.length;++m){const j=u[m],N=u[m+1]||e.length;j===0?h=`
75
+ ${t}${e.slice(0,N)}`:(n===yi&&p[j]&&(h+=`${e[j]}\\`),h+=`
76
+ ${t}${e.slice(j+1,N)}`)}return h}function Wu(e,t,n){let s=t,r=t+1,a=e[r];for(;a===" "||a===" ";)if(t<r+n)a=e[++t];else{do a=e[++t];while(a&&a!==`
77
+ `);s=t,r=t+1,a=e[r]}return s}const ga=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),ya=e=>/^(%|---|\.\.\.)/m.test(e);function F0(e,t,n){if(!t||t<0)return!1;const s=t-n,r=e.length;if(r<=s)return!1;for(let a=0,o=0;a<r;++a)if(e[a]===`
78
+ `){if(a-o>s)return!0;if(o=a+1,r-o<=s)return!1}return!0}function Qs(e,t){const n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;const{implicitKey:s}=t,r=t.options.doubleQuotedMinMultiLineLength,a=t.indent||(ya(e)?" ":"");let o="",l=0;for(let c=0,u=n[c];u;u=n[++c])if(u===" "&&n[c+1]==="\\"&&n[c+2]==="n"&&(o+=n.slice(l,c)+"\\ ",c+=1,l=c,u="\\"),u==="\\")switch(n[c+1]){case"u":{o+=n.slice(l,c);const p=n.substr(c+2,4);switch(p){case"0000":o+="\\0";break;case"0007":o+="\\a";break;case"000b":o+="\\v";break;case"001b":o+="\\e";break;case"0085":o+="\\N";break;case"00a0":o+="\\_";break;case"2028":o+="\\L";break;case"2029":o+="\\P";break;default:p.substr(0,2)==="00"?o+="\\x"+p.substr(2):o+=n.substr(c,6)}c+=5,l=c+1}break;case"n":if(s||n[c+2]==='"'||n.length<r)c+=1;else{for(o+=n.slice(l,c)+`
79
+
80
+ `;n[c+2]==="\\"&&n[c+3]==="n"&&n[c+4]!=='"';)o+=`
81
+ `,c+=2;o+=a,n[c+2]===" "&&(o+="\\"),c+=1,l=c+1}break;default:c+=1}return o=l?o+n.slice(l):n,s?o:ha(o,a,yi,ga(t,!1))}function al(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
82
+ `)||/[ \t]\n|\n[ \t]/.test(e))return Qs(e,t);const n=t.indent||(ya(e)?" ":""),s="'"+e.replace(/'/g,"''").replace(/\n+/g,`$&
83
+ ${n}`)+"'";return t.implicitKey?s:ha(s,n,Qp,ga(t,!1))}function Vn(e,t){const{singleQuote:n}=t.options;let s;if(n===!1)s=Qs;else{const r=e.includes('"'),a=e.includes("'");r&&!a?s=al:a&&!r?s=Qs:s=n?al:Qs}return s(e,t)}let ol;try{ol=new RegExp(`(^|(?<!
84
+ ))
85
+ +(?!
86
+ |$)`,"g")}catch{ol=/\n+(?!\n|$)/g}function xi({comment:e,type:t,value:n},s,r,a){const{blockQuote:o,commentString:l,lineWidth:c}=s.options;if(!o||/\n[\t ]+$/.test(n))return Vn(n,s);const u=s.indent||(s.forceBlockIndent||ya(n)?" ":""),p=o==="literal"?!0:o==="folded"||t===W.BLOCK_FOLDED?!1:t===W.BLOCK_LITERAL?!0:!F0(n,c,u.length);if(!n)return p?`|
87
+ `:`>
88
+ `;let d,f;for(f=n.length;f>0;--f){const N=n[f-1];if(N!==`
89
+ `&&N!==" "&&N!==" ")break}let x=n.substring(f);const y=x.indexOf(`
90
+ `);y===-1?d="-":n===x||y!==x.length-1?(d="+",a&&a()):d="",x&&(n=n.slice(0,-x.length),x[x.length-1]===`
91
+ `&&(x=x.slice(0,-1)),x=x.replace(ol,`$&${u}`));let v=!1,w,g=-1;for(w=0;w<n.length;++w){const N=n[w];if(N===" ")v=!0;else if(N===`
92
+ `)g=w;else break}let h=n.substring(0,g<w?g+1:w);h&&(n=n.substring(h.length),h=h.replace(/\n+/g,`$&${u}`));let j=(v?u?"2":"1":"")+d;if(e&&(j+=" "+l(e.replace(/ ?[\r\n]+/g," ")),r&&r()),!p){const N=n.replace(/\n+/g,`
93
+ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${u}`);let C=!1;const S=ga(s,!0);o!=="folded"&&t!==W.BLOCK_FOLDED&&(S.onOverflow=()=>{C=!0});const k=ha(`${h}${N}${x}`,u,il,S);if(!C)return`>${j}
94
+ ${u}${k}`}return n=n.replace(/\n+/g,`$&${u}`),`|${j}
95
+ ${u}${h}${n}${x}`}function B0(e,t,n,s){const{type:r,value:a}=e,{actualString:o,implicitKey:l,indent:c,indentStep:u,inFlow:p}=t;if(l&&a.includes(`
96
+ `)||p&&/[[\]{},]/.test(a))return Vn(a,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(a))return l||p||!a.includes(`
97
+ `)?Vn(a,t):xi(e,t,n,s);if(!l&&!p&&r!==W.PLAIN&&a.includes(`
98
+ `))return xi(e,t,n,s);if(ya(a)){if(c==="")return t.forceBlockIndent=!0,xi(e,t,n,s);if(l&&c===u)return Vn(a,t)}const d=a.replace(/\n+/g,`$&
99
+ ${c}`);if(o){const f=v=>{var w;return v.default&&v.tag!=="tag:yaml.org,2002:str"&&((w=v.test)==null?void 0:w.test(d))},{compat:x,tags:y}=t.doc.schema;if(y.some(f)||x!=null&&x.some(f))return Vn(a,t)}return l?d:ha(d,c,Qp,ga(t,!1))}function mc(e,t,n,s){const{implicitKey:r,inFlow:a}=t,o=typeof e.value=="string"?e:Object.assign({},e,{value:String(e.value)});let{type:l}=e;l!==W.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(l=W.QUOTE_DOUBLE);const c=p=>{switch(p){case W.BLOCK_FOLDED:case W.BLOCK_LITERAL:return r||a?Vn(o.value,t):xi(o,t,n,s);case W.QUOTE_DOUBLE:return Qs(o.value,t);case W.QUOTE_SINGLE:return al(o.value,t);case W.PLAIN:return B0(o,t,n,s);default:return null}};let u=c(l);if(u===null){const{defaultKeyType:p,defaultStringType:d}=t.options,f=r&&p||d;if(u=c(f),u===null)throw new Error(`Unsupported default string type ${f}`)}return u}function Jp(e,t){const n=Object.assign({blockQuote:!0,commentString:z0,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},e.schema.toStringOptions,t);let s;switch(n.collectionStyle){case"block":s=!1;break;case"flow":s=!0;break;default:s=null}return{anchors:new Set,doc:e,flowCollectionPadding:n.flowCollectionPadding?" ":"",indent:"",indentStep:typeof n.indent=="number"?" ".repeat(n.indent):" ",inFlow:s,options:n}}function U0(e,t){var r;if(t.tag){const a=e.filter(o=>o.tag===t.tag);if(a.length>0)return a.find(o=>o.format===t.format)??a[0]}let n,s;if(Q(t)){s=t.value;let a=e.filter(o=>{var l;return(l=o.identify)==null?void 0:l.call(o,s)});if(a.length>1){const o=a.filter(l=>l.test);o.length>0&&(a=o)}n=a.find(o=>o.format===t.format)??a.find(o=>!o.format)}else s=t,n=e.find(a=>a.nodeClass&&s instanceof a.nodeClass);if(!n){const a=((r=s==null?void 0:s.constructor)==null?void 0:r.name)??(s===null?"null":typeof s);throw new Error(`Tag not resolved for ${a} value`)}return n}function W0(e,t,{anchors:n,doc:s}){if(!s.directives)return"";const r=[],a=(Q(e)||le(e))&&e.anchor;a&&Vp(a)&&(n.add(a),r.push(`&${a}`));const o=e.tag??(t.default?null:t.tag);return o&&r.push(s.directives.tagString(o)),r.join(" ")}function ls(e,t,n,s){var c;if(ue(e))return e.toString(t,n,s);if(gs(e)){if(t.doc.directives)return e.toString(t);if((c=t.resolvedAliases)!=null&&c.has(e))throw new TypeError("Cannot stringify circular structure without alias nodes");t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let r;const a=ce(e)?e:t.doc.createNode(e,{onTagObj:u=>r=u});r??(r=U0(t.doc.schema.tags,a));const o=W0(a,r,t);o.length>0&&(t.indentAtStart=(t.indentAtStart??0)+o.length+1);const l=typeof r.stringify=="function"?r.stringify(a,t,n,s):Q(a)?mc(a,t,n,s):a.toString(t,n,s);return o?Q(a)||l[0]==="{"||l[0]==="["?`${o} ${l}`:`${o}
100
+ ${t.indent}${l}`:l}function H0({key:e,value:t},n,s,r){const{allNullValues:a,doc:o,indent:l,indentStep:c,options:{commentString:u,indentSeq:p,simpleKeys:d}}=n;let f=ce(e)&&e.comment||null;if(d){if(f)throw new Error("With simple keys, key nodes cannot have comments");if(le(e)||!ce(e)&&typeof e=="object"){const S="With simple keys, collection cannot be used as a key value";throw new Error(S)}}let x=!d&&(!e||f&&t==null&&!n.inFlow||le(e)||(Q(e)?e.type===W.BLOCK_FOLDED||e.type===W.BLOCK_LITERAL:typeof e=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!x&&(d||!a),indent:l+c});let y=!1,v=!1,w=ls(e,n,()=>y=!0,()=>v=!0);if(!x&&!n.inFlow&&w.length>1024){if(d)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");x=!0}if(n.inFlow){if(a||t==null)return y&&s&&s(),w===""?"?":x?`? ${w}`:w}else if(a&&!d||t==null&&x)return w=`? ${w}`,f&&!y?w+=fn(w,n.indent,u(f)):v&&r&&r(),w;y&&(f=null),x?(f&&(w+=fn(w,n.indent,u(f))),w=`? ${w}
101
+ ${l}:`):(w=`${w}:`,f&&(w+=fn(w,n.indent,u(f))));let g,h,m;ce(t)?(g=!!t.spaceBefore,h=t.commentBefore,m=t.comment):(g=!1,h=null,m=null,t&&typeof t=="object"&&(t=o.createNode(t))),n.implicitKey=!1,!x&&!f&&Q(t)&&(n.indentAtStart=w.length+1),v=!1,!p&&c.length>=2&&!n.inFlow&&!x&&Er(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let j=!1;const N=ls(t,n,()=>j=!0,()=>v=!0);let C=" ";if(f||g||h){if(C=g?`
102
+ `:"",h){const S=u(h);C+=`
103
+ ${Nt(S,n.indent)}`}N===""&&!n.inFlow?C===`
104
+ `&&m&&(C=`
105
+
106
+ `):C+=`
107
+ ${n.indent}`}else if(!x&&le(t)){const S=N[0],k=N.indexOf(`
108
+ `),T=k!==-1,L=n.inFlow??t.flow??t.items.length===0;if(T||!L){let O=!1;if(T&&(S==="&"||S==="!")){let U=N.indexOf(" ");S==="&"&&U!==-1&&U<k&&N[U+1]==="!"&&(U=N.indexOf(" ",U+1)),(U===-1||k<U)&&(O=!0)}O||(C=`
109
+ ${n.indent}`)}}else(N===""||N[0]===`
110
+ `)&&(C="");return w+=C+N,n.inFlow?j&&s&&s():m&&!j?w+=fn(w,n.indent,u(m)):v&&r&&r(),w}function Xp(e,t){(e==="debug"||e==="warn")&&console.warn(t)}const Yr="<<",St={identify:e=>e===Yr||typeof e=="symbol"&&e.description===Yr,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new W(Symbol(Yr)),{addToJSMap:Zp}),stringify:()=>Yr},V0=(e,t)=>(St.identify(t)||Q(t)&&(!t.type||t.type===W.PLAIN)&&St.identify(t.value))&&(e==null?void 0:e.doc.schema.tags.some(n=>n.tag===St.tag&&n.default));function Zp(e,t,n){const s=em(e,n);if(Er(s))for(const r of s.items)Qa(e,t,r);else if(Array.isArray(s))for(const r of s)Qa(e,t,r);else Qa(e,t,s)}function Qa(e,t,n){const s=em(e,n);if(!Cr(s))throw new Error("Merge sources must be maps or map aliases");const r=s.toJSON(null,e,Map);for(const[a,o]of r)t instanceof Map?t.has(a)||t.set(a,o):t instanceof Set?t.add(a):Object.prototype.hasOwnProperty.call(t,a)||Object.defineProperty(t,a,{value:o,writable:!0,enumerable:!0,configurable:!0});return t}function em(e,t){return e&&gs(t)?t.resolve(e.doc,e):t}function tm(e,t,{key:n,value:s}){if(ce(n)&&n.addToJSMap)n.addToJSMap(e,t,s);else if(V0(e,n))Zp(e,t,s);else{const r=Qe(n,"",e);if(t instanceof Map)t.set(r,Qe(s,r,e));else if(t instanceof Set)t.add(r);else{const a=K0(n,r,e),o=Qe(s,a,e);a in t?Object.defineProperty(t,a,{value:o,writable:!0,enumerable:!0,configurable:!0}):t[a]=o}}return t}function K0(e,t,n){if(t===null)return"";if(typeof t!="object")return String(t);if(ce(e)&&(n!=null&&n.doc)){const s=Jp(n.doc,{});s.anchors=new Set;for(const a of n.anchors.keys())s.anchors.add(a.anchor);s.inFlow=!0,s.inStringifyKey=!0;const r=e.toString(s);if(!n.mapKeyWarned){let a=JSON.stringify(r);a.length>40&&(a=a.substring(0,36)+'..."'),Xp(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${a}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return r}return JSON.stringify(t)}function hc(e,t,n){const s=xr(e,void 0,n),r=xr(t,void 0,n);return new Te(s,r)}class Te{constructor(t,n=null){Object.defineProperty(this,Ze,{value:Wp}),this.key=t,this.value=n}clone(t){let{key:n,value:s}=this;return ce(n)&&(n=n.clone(t)),ce(s)&&(s=s.clone(t)),new Te(n,s)}toJSON(t,n){const s=n!=null&&n.mapAsMap?new Map:{};return tm(n,s,this)}toString(t,n,s){return t!=null&&t.doc?H0(this,t,n,s):JSON.stringify(this)}}function nm(e,t,n){return(t.inFlow??e.flow?q0:G0)(e,t,n)}function G0({comment:e,items:t},n,{blockItemPrefix:s,flowChars:r,itemIndent:a,onChompKeep:o,onComment:l}){const{indent:c,options:{commentString:u}}=n,p=Object.assign({},n,{indent:a,type:null});let d=!1;const f=[];for(let y=0;y<t.length;++y){const v=t[y];let w=null;if(ce(v))!d&&v.spaceBefore&&f.push(""),Gi(n,f,v.commentBefore,d),v.comment&&(w=v.comment);else if(ue(v)){const h=ce(v.key)?v.key:null;h&&(!d&&h.spaceBefore&&f.push(""),Gi(n,f,h.commentBefore,d))}d=!1;let g=ls(v,p,()=>w=null,()=>d=!0);w&&(g+=fn(g,a,u(w))),d&&w&&(d=!1),f.push(s+g)}let x;if(f.length===0)x=r.start+r.end;else{x=f[0];for(let y=1;y<f.length;++y){const v=f[y];x+=v?`
111
+ ${c}${v}`:`
112
+ `}}return e?(x+=`
113
+ `+Nt(u(e),c),l&&l()):d&&o&&o(),x}function q0({items:e},t,{flowChars:n,itemIndent:s}){const{indent:r,indentStep:a,flowCollectionPadding:o,options:{commentString:l}}=t;s+=a;const c=Object.assign({},t,{indent:s,inFlow:!0,type:null});let u=!1,p=0;const d=[];for(let y=0;y<e.length;++y){const v=e[y];let w=null;if(ce(v))v.spaceBefore&&d.push(""),Gi(t,d,v.commentBefore,!1),v.comment&&(w=v.comment);else if(ue(v)){const h=ce(v.key)?v.key:null;h&&(h.spaceBefore&&d.push(""),Gi(t,d,h.commentBefore,!1),h.comment&&(u=!0));const m=ce(v.value)?v.value:null;m?(m.comment&&(w=m.comment),m.commentBefore&&(u=!0)):v.value==null&&(h!=null&&h.comment)&&(w=h.comment)}w&&(u=!0);let g=ls(v,c,()=>w=null);u||(u=d.length>p||g.includes(`
114
+ `)),y<e.length-1?g+=",":t.options.trailingComma&&(t.options.lineWidth>0&&(u||(u=d.reduce((h,m)=>h+m.length+2,2)+(g.length+2)>t.options.lineWidth)),u&&(g+=",")),w&&(g+=fn(g,s,l(w))),d.push(g),p=d.length}const{start:f,end:x}=n;if(d.length===0)return f+x;if(!u){const y=d.reduce((v,w)=>v+w.length+2,2);u=t.options.lineWidth>0&&y>t.options.lineWidth}if(u){let y=f;for(const v of d)y+=v?`
115
+ ${a}${r}${v}`:`
116
+ `;return`${y}
117
+ ${r}${x}`}else return`${f}${o}${d.join(" ")}${o}${x}`}function Gi({indent:e,options:{commentString:t}},n,s,r){if(s&&r&&(s=s.replace(/^\n+/,"")),s){const a=Nt(t(s),e);n.push(a.trimStart())}}function pn(e,t){const n=Q(t)?t.value:t;for(const s of e)if(ue(s)&&(s.key===t||s.key===n||Q(s.key)&&s.key.value===n))return s}class Ge extends Yp{static get tagName(){return"tag:yaml.org,2002:map"}constructor(t){super(Xt,t),this.items=[]}static from(t,n,s){const{keepUndefined:r,replacer:a}=s,o=new this(t),l=(c,u)=>{if(typeof a=="function")u=a.call(n,c,u);else if(Array.isArray(a)&&!a.includes(c))return;(u!==void 0||r)&&o.items.push(hc(c,u,s))};if(n instanceof Map)for(const[c,u]of n)l(c,u);else if(n&&typeof n=="object")for(const c of Object.keys(n))l(c,n[c]);return typeof t.sortMapEntries=="function"&&o.items.sort(t.sortMapEntries),o}add(t,n){var o;let s;ue(t)?s=t:!t||typeof t!="object"||!("key"in t)?s=new Te(t,t==null?void 0:t.value):s=new Te(t.key,t.value);const r=pn(this.items,s.key),a=(o=this.schema)==null?void 0:o.sortMapEntries;if(r){if(!n)throw new Error(`Key ${s.key} already set`);Q(r.value)&&qp(s.value)?r.value.value=s.value:r.value=s.value}else if(a){const l=this.items.findIndex(c=>a(s,c)<0);l===-1?this.items.push(s):this.items.splice(l,0,s)}else this.items.push(s)}delete(t){const n=pn(this.items,t);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(t,n){const s=pn(this.items,t),r=s==null?void 0:s.value;return(!n&&Q(r)?r.value:r)??void 0}has(t){return!!pn(this.items,t)}set(t,n){this.add(new Te(t,n),!0)}toJSON(t,n,s){const r=s?new s:n!=null&&n.mapAsMap?new Map:{};n!=null&&n.onCreate&&n.onCreate(r);for(const a of this.items)tm(n,r,a);return r}toString(t,n,s){if(!t)return JSON.stringify(this);for(const r of this.items)if(!ue(r))throw new Error(`Map items must all be pairs; found ${JSON.stringify(r)} instead`);return!t.allNullValues&&this.hasAllNullValues(!1)&&(t=Object.assign({},t,{allNullValues:!0})),nm(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:s,onComment:n})}}const xs={collection:"map",default:!0,nodeClass:Ge,tag:"tag:yaml.org,2002:map",resolve(e,t){return Cr(e)||t("Expected a mapping for this tag"),e},createNode:(e,t,n)=>Ge.from(e,t,n)};class jn extends Yp{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(t){super(hs,t),this.items=[]}add(t){this.items.push(t)}delete(t){const n=Qr(t);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(t,n){const s=Qr(t);if(typeof s!="number")return;const r=this.items[s];return!n&&Q(r)?r.value:r}has(t){const n=Qr(t);return typeof n=="number"&&n<this.items.length}set(t,n){const s=Qr(t);if(typeof s!="number")throw new Error(`Expected a valid index, not ${t}.`);const r=this.items[s];Q(r)&&qp(n)?r.value=n:this.items[s]=n}toJSON(t,n){const s=[];n!=null&&n.onCreate&&n.onCreate(s);let r=0;for(const a of this.items)s.push(Qe(a,String(r++),n));return s}toString(t,n,s){return t?nm(this,t,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(t.indent||"")+" ",onChompKeep:s,onComment:n}):JSON.stringify(this)}static from(t,n,s){const{replacer:r}=s,a=new this(t);if(n&&Symbol.iterator in Object(n)){let o=0;for(let l of n){if(typeof r=="function"){const c=n instanceof Set?l:String(o++);l=r.call(n,c,l)}a.items.push(xr(l,void 0,s))}}return a}}function Qr(e){let t=Q(e)?e.value:e;return t&&typeof t=="string"&&(t=Number(t)),typeof t=="number"&&Number.isInteger(t)&&t>=0?t:null}const vs={collection:"seq",default:!0,nodeClass:jn,tag:"tag:yaml.org,2002:seq",resolve(e,t){return Er(e)||t("Expected a sequence for this tag"),e},createNode:(e,t,n)=>jn.from(e,t,n)},xa={identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify(e,t,n,s){return t=Object.assign({actualString:!0},t),mc(e,t,n,s)}},va={identify:e=>e==null,createNode:()=>new W(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new W(null),stringify:({source:e},t)=>typeof e=="string"&&va.test.test(e)?e:t.options.nullStr},gc={identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new W(e[0]==="t"||e[0]==="T"),stringify({source:e,value:t},n){if(e&&gc.test.test(e)){const s=e[0]==="t"||e[0]==="T";if(t===s)return e}return t?n.options.trueStr:n.options.falseStr}};function dt({format:e,minFractionDigits:t,tag:n,value:s}){if(typeof s=="bigint")return String(s);const r=typeof s=="number"?s:Number(s);if(!isFinite(r))return isNaN(r)?".nan":r<0?"-.inf":".inf";let a=Object.is(s,-0)?"-0":JSON.stringify(s);if(!e&&t&&(!n||n==="tag:yaml.org,2002:float")&&/^-?\d/.test(a)&&!a.includes("e")){let o=a.indexOf(".");o<0&&(o=a.length,a+=".");let l=t-(a.length-o-1);for(;l-- >0;)a+="0"}return a}const sm={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:dt},rm={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e),stringify(e){const t=Number(e.value);return isFinite(t)?t.toExponential():dt(e)}},im={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(e){const t=new W(parseFloat(e)),n=e.indexOf(".");return n!==-1&&e[e.length-1]==="0"&&(t.minFractionDigits=e.length-n-1),t},stringify:dt},ba=e=>typeof e=="bigint"||Number.isInteger(e),yc=(e,t,n,{intAsBigInt:s})=>s?BigInt(e):parseInt(e.substring(t),n);function am(e,t,n){const{value:s}=e;return ba(s)&&s>=0?n+s.toString(t):dt(e)}const om={identify:e=>ba(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,n)=>yc(e,2,8,n),stringify:e=>am(e,8,"0o")},lm={identify:ba,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>yc(e,0,10,n),stringify:dt},cm={identify:e=>ba(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>yc(e,2,16,n),stringify:e=>am(e,16,"0x")},Y0=[xs,vs,xa,va,gc,om,lm,cm,sm,rm,im];function Hu(e){return typeof e=="bigint"||Number.isInteger(e)}const Jr=({value:e})=>JSON.stringify(e),Q0=[{identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:Jr},{identify:e=>e==null,createNode:()=>new W(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Jr},{identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>e==="true",stringify:Jr},{identify:Hu,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,t,{intAsBigInt:n})=>n?BigInt(e):parseInt(e,10),stringify:({value:e})=>Hu(e)?e.toString():JSON.stringify(e)},{identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:e=>parseFloat(e),stringify:Jr}],J0={default:!0,tag:"",test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},X0=[xs,vs].concat(Q0,J0),xc={identify:e=>e instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(e,t){if(typeof atob=="function"){const n=atob(e.replace(/[\n\r]/g,"")),s=new Uint8Array(n.length);for(let r=0;r<n.length;++r)s[r]=n.charCodeAt(r);return s}else return t("This environment does not support reading binary tags; either Buffer or atob is required"),e},stringify({comment:e,type:t,value:n},s,r,a){if(!n)return"";const o=n;let l;if(typeof btoa=="function"){let c="";for(let u=0;u<o.length;++u)c+=String.fromCharCode(o[u]);l=btoa(c)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(t??(t=W.BLOCK_LITERAL),t!==W.QUOTE_DOUBLE){const c=Math.max(s.options.lineWidth-s.indent.length,s.options.minContentWidth),u=Math.ceil(l.length/c),p=new Array(u);for(let d=0,f=0;d<u;++d,f+=c)p[d]=l.substr(f,c);l=p.join(t===W.BLOCK_LITERAL?`
118
+ `:" ")}return mc({comment:e,type:t,value:l},s,r,a)}};function um(e,t){if(Er(e))for(let n=0;n<e.items.length;++n){let s=e.items[n];if(!ue(s)){if(Cr(s)){s.items.length>1&&t("Each pair must have its own sequence indicator");const r=s.items[0]||new Te(new W(null));if(s.commentBefore&&(r.key.commentBefore=r.key.commentBefore?`${s.commentBefore}
119
+ ${r.key.commentBefore}`:s.commentBefore),s.comment){const a=r.value??r.key;a.comment=a.comment?`${s.comment}
120
+ ${a.comment}`:s.comment}s=r}e.items[n]=ue(s)?s:new Te(s)}}else t("Expected a sequence for this tag");return e}function dm(e,t,n){const{replacer:s}=n,r=new jn(e);r.tag="tag:yaml.org,2002:pairs";let a=0;if(t&&Symbol.iterator in Object(t))for(let o of t){typeof s=="function"&&(o=s.call(t,String(a++),o));let l,c;if(Array.isArray(o))if(o.length===2)l=o[0],c=o[1];else throw new TypeError(`Expected [key, value] tuple: ${o}`);else if(o&&o instanceof Object){const u=Object.keys(o);if(u.length===1)l=u[0],c=o[l];else throw new TypeError(`Expected tuple with one key, not ${u.length} keys`)}else l=o;r.items.push(hc(l,c,n))}return r}const vc={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:um,createNode:dm};class Xn extends jn{constructor(){super(),this.add=Ge.prototype.add.bind(this),this.delete=Ge.prototype.delete.bind(this),this.get=Ge.prototype.get.bind(this),this.has=Ge.prototype.has.bind(this),this.set=Ge.prototype.set.bind(this),this.tag=Xn.tag}toJSON(t,n){if(!n)return super.toJSON(t);const s=new Map;n!=null&&n.onCreate&&n.onCreate(s);for(const r of this.items){let a,o;if(ue(r)?(a=Qe(r.key,"",n),o=Qe(r.value,a,n)):a=Qe(r,"",n),s.has(a))throw new Error("Ordered maps must not include duplicate keys");s.set(a,o)}return s}static from(t,n,s){const r=dm(t,n,s),a=new this;return a.items=r.items,a}}Xn.tag="tag:yaml.org,2002:omap";const bc={collection:"seq",identify:e=>e instanceof Map,nodeClass:Xn,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){const n=um(e,t),s=[];for(const{key:r}of n.items)Q(r)&&(s.includes(r.value)?t(`Ordered maps must not include duplicate keys: ${r.value}`):s.push(r.value));return Object.assign(new Xn,n)},createNode:(e,t,n)=>Xn.from(e,t,n)};function fm({value:e,source:t},n){return t&&(e?pm:mm).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}const pm={identify:e=>e===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new W(!0),stringify:fm},mm={identify:e=>e===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new W(!1),stringify:fm},Z0={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:dt},ex={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,"")),stringify(e){const t=Number(e.value);return isFinite(t)?t.toExponential():dt(e)}},tx={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){const t=new W(parseFloat(e.replace(/_/g,""))),n=e.indexOf(".");if(n!==-1){const s=e.substring(n+1).replace(/_/g,"");s[s.length-1]==="0"&&(t.minFractionDigits=s.length)}return t},stringify:dt},Tr=e=>typeof e=="bigint"||Number.isInteger(e);function ja(e,t,n,{intAsBigInt:s}){const r=e[0];if((r==="-"||r==="+")&&(t+=1),e=e.substring(t).replace(/_/g,""),s){switch(n){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`;break}const o=BigInt(e);return r==="-"?BigInt(-1)*o:o}const a=parseInt(e,n);return r==="-"?-1*a:a}function jc(e,t,n){const{value:s}=e;if(Tr(s)){const r=s.toString(t);return s<0?"-"+n+r.substr(1):n+r}return dt(e)}const nx={identify:Tr,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>ja(e,2,2,n),stringify:e=>jc(e,2,"0b")},sx={identify:Tr,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>ja(e,1,8,n),stringify:e=>jc(e,8,"0")},rx={identify:Tr,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>ja(e,0,10,n),stringify:dt},ix={identify:Tr,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>ja(e,2,16,n),stringify:e=>jc(e,16,"0x")};class Zn extends Ge{constructor(t){super(t),this.tag=Zn.tag}add(t){let n;ue(t)?n=t:t&&typeof t=="object"&&"key"in t&&"value"in t&&t.value===null?n=new Te(t.key,null):n=new Te(t,null),pn(this.items,n.key)||this.items.push(n)}get(t,n){const s=pn(this.items,t);return!n&&ue(s)?Q(s.key)?s.key.value:s.key:s}set(t,n){if(typeof n!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof n}`);const s=pn(this.items,t);s&&!n?this.items.splice(this.items.indexOf(s),1):!s&&n&&this.items.push(new Te(t))}toJSON(t,n){return super.toJSON(t,n,Set)}toString(t,n,s){if(!t)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},t,{allNullValues:!0}),n,s);throw new Error("Set items must all have null values")}static from(t,n,s){const{replacer:r}=s,a=new this(t);if(n&&Symbol.iterator in Object(n))for(let o of n)typeof r=="function"&&(o=r.call(n,o,o)),a.items.push(hc(o,null,s));return a}}Zn.tag="tag:yaml.org,2002:set";const wc={collection:"map",identify:e=>e instanceof Set,nodeClass:Zn,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,n)=>Zn.from(e,t,n),resolve(e,t){if(Cr(e)){if(e.hasAllNullValues(!0))return Object.assign(new Zn,e);t("Set items must all have null values")}else t("Expected a mapping for this tag");return e}};function Nc(e,t){const n=e[0],s=n==="-"||n==="+"?e.substring(1):e,r=o=>t?BigInt(o):Number(o),a=s.replace(/_/g,"").split(":").reduce((o,l)=>o*r(60)+r(l),r(0));return n==="-"?r(-1)*a:a}function hm(e){let{value:t}=e,n=o=>o;if(typeof t=="bigint")n=o=>BigInt(o);else if(isNaN(t)||!isFinite(t))return dt(e);let s="";t<0&&(s="-",t*=n(-1));const r=n(60),a=[t%r];return t<60?a.unshift(0):(t=(t-a[0])/r,a.unshift(t%r),t>=60&&(t=(t-a[0])/r,a.unshift(t))),s+a.map(o=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}const gm={identify:e=>typeof e=="bigint"||Number.isInteger(e),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(e,t,{intAsBigInt:n})=>Nc(e,n),stringify:hm},ym={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:e=>Nc(e,!1),stringify:hm},wa={identify:e=>e instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(e){const t=e.match(wa.test);if(!t)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,n,s,r,a,o,l]=t.map(Number),c=t[7]?Number((t[7]+"00").substr(1,3)):0;let u=Date.UTC(n,s-1,r,a||0,o||0,l||0,c);const p=t[8];if(p&&p!=="Z"){let d=Nc(p,!1);Math.abs(d)<30&&(d*=60),u-=6e4*d}return new Date(u)},stringify:({value:e})=>(e==null?void 0:e.toISOString().replace(/(T00:00:00)?\.000Z$/,""))??""},Vu=[xs,vs,xa,va,pm,mm,nx,sx,rx,ix,Z0,ex,tx,xc,St,bc,vc,wc,gm,ym,wa],Ku=new Map([["core",Y0],["failsafe",[xs,vs,xa]],["json",X0],["yaml11",Vu],["yaml-1.1",Vu]]),Gu={binary:xc,bool:gc,float:im,floatExp:rm,floatNaN:sm,floatTime:ym,int:lm,intHex:cm,intOct:om,intTime:gm,map:xs,merge:St,null:va,omap:bc,pairs:vc,seq:vs,set:wc,timestamp:wa},ax={"tag:yaml.org,2002:binary":xc,"tag:yaml.org,2002:merge":St,"tag:yaml.org,2002:omap":bc,"tag:yaml.org,2002:pairs":vc,"tag:yaml.org,2002:set":wc,"tag:yaml.org,2002:timestamp":wa};function Ja(e,t,n){const s=Ku.get(t);if(s&&!e)return n&&!s.includes(St)?s.concat(St):s.slice();let r=s;if(!r)if(Array.isArray(e))r=[];else{const a=Array.from(Ku.keys()).filter(o=>o!=="yaml11").map(o=>JSON.stringify(o)).join(", ");throw new Error(`Unknown schema "${t}"; use one of ${a} or define customTags array`)}if(Array.isArray(e))for(const a of e)r=r.concat(a);else typeof e=="function"&&(r=e(r.slice()));return n&&(r=r.concat(St)),r.reduce((a,o)=>{const l=typeof o=="string"?Gu[o]:o;if(!l){const c=JSON.stringify(o),u=Object.keys(Gu).map(p=>JSON.stringify(p)).join(", ");throw new Error(`Unknown custom tag ${c}; use one of ${u}`)}return a.includes(l)||a.push(l),a},[])}const ox=(e,t)=>e.key<t.key?-1:e.key>t.key?1:0;class kc{constructor({compat:t,customTags:n,merge:s,resolveKnownTags:r,schema:a,sortMapEntries:o,toStringDefaults:l}){this.compat=Array.isArray(t)?Ja(t,"compat"):t?Ja(null,t):null,this.name=typeof a=="string"&&a||"core",this.knownTags=r?ax:{},this.tags=Ja(n,this.name,s),this.toStringOptions=l??null,Object.defineProperty(this,Xt,{value:xs}),Object.defineProperty(this,yt,{value:xa}),Object.defineProperty(this,hs,{value:vs}),this.sortMapEntries=typeof o=="function"?o:o===!0?ox:null}clone(){const t=Object.create(kc.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}}function lx(e,t){var c;const n=[];let s=t.directives===!0;if(t.directives!==!1&&e.directives){const u=e.directives.toString(e);u?(n.push(u),s=!0):e.directives.docStart&&(s=!0)}s&&n.push("---");const r=Jp(e,t),{commentString:a}=r.options;if(e.commentBefore){n.length!==1&&n.unshift("");const u=a(e.commentBefore);n.unshift(Nt(u,""))}let o=!1,l=null;if(e.contents){if(ce(e.contents)){if(e.contents.spaceBefore&&s&&n.push(""),e.contents.commentBefore){const d=a(e.contents.commentBefore);n.push(Nt(d,""))}r.forceBlockIndent=!!e.comment,l=e.contents.comment}const u=l?void 0:()=>o=!0;let p=ls(e.contents,r,()=>l=null,u);l&&(p+=fn(p,"",a(l))),(p[0]==="|"||p[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${p}`:n.push(p)}else n.push(ls(e.contents,r));if((c=e.directives)!=null&&c.docEnd)if(e.comment){const u=a(e.comment);u.includes(`
121
+ `)?(n.push("..."),n.push(Nt(u,""))):n.push(`... ${u}`)}else n.push("...");else{let u=e.comment;u&&o&&(u=u.replace(/^\n+/,"")),u&&((!o||l)&&n[n.length-1]!==""&&n.push(""),n.push(Nt(a(u),"")))}return n.join(`
122
+ `)+`
123
+ `}class Ar{constructor(t,n,s){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Ze,{value:rl});let r=null;typeof n=="function"||Array.isArray(n)?r=n:s===void 0&&n&&(s=n,n=void 0);const a=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},s);this.options=a;let{version:o}=a;s!=null&&s._directives?(this.directives=s._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new Ce({version:o}),this.setSchema(o,s),this.contents=t===void 0?null:this.createNode(t,r,s)}clone(){const t=Object.create(Ar.prototype,{[Ze]:{value:rl}});return t.commentBefore=this.commentBefore,t.comment=this.comment,t.errors=this.errors.slice(),t.warnings=this.warnings.slice(),t.options=Object.assign({},this.options),this.directives&&(t.directives=this.directives.clone()),t.schema=this.schema.clone(),t.contents=ce(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(t){En(this.contents)&&this.contents.add(t)}addIn(t,n){En(this.contents)&&this.contents.addIn(t,n)}createAlias(t,n){if(!t.anchor){const s=Kp(this);t.anchor=!n||s.has(n)?Gp(n||"a",s):n}return new pc(t.anchor)}createNode(t,n,s){let r;if(typeof n=="function")t=n.call({"":t},"",t),r=n;else if(Array.isArray(n)){const w=h=>typeof h=="number"||h instanceof String||h instanceof Number,g=n.filter(w).map(String);g.length>0&&(n=n.concat(g)),r=n}else s===void 0&&n&&(s=n,n=void 0);const{aliasDuplicateObjects:a,anchorPrefix:o,flow:l,keepUndefined:c,onTagObj:u,tag:p}=s??{},{onAnchor:d,setAnchors:f,sourceObjects:x}=D0(this,o||"a"),y={aliasDuplicateObjects:a??!0,keepUndefined:c??!1,onAnchor:d,onTagObj:u,replacer:r,schema:this.schema,sourceObjects:x},v=xr(t,p,y);return l&&le(v)&&(v.flow=!0),f(),v}createPair(t,n,s={}){const r=this.createNode(t,null,s),a=this.createNode(n,null,s);return new Te(r,a)}delete(t){return En(this.contents)?this.contents.delete(t):!1}deleteIn(t){return Ds(t)?this.contents==null?!1:(this.contents=null,!0):En(this.contents)?this.contents.deleteIn(t):!1}get(t,n){return le(this.contents)?this.contents.get(t,n):void 0}getIn(t,n){return Ds(t)?!n&&Q(this.contents)?this.contents.value:this.contents:le(this.contents)?this.contents.getIn(t,n):void 0}has(t){return le(this.contents)?this.contents.has(t):!1}hasIn(t){return Ds(t)?this.contents!==void 0:le(this.contents)?this.contents.hasIn(t):!1}set(t,n){this.contents==null?this.contents=Ki(this.schema,[t],n):En(this.contents)&&this.contents.set(t,n)}setIn(t,n){Ds(t)?this.contents=n:this.contents==null?this.contents=Ki(this.schema,Array.from(t),n):En(this.contents)&&this.contents.setIn(t,n)}setSchema(t,n={}){typeof t=="number"&&(t=String(t));let s;switch(t){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new Ce({version:"1.1"}),s={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=t:this.directives=new Ce({version:t}),s={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,s=null;break;default:{const r=JSON.stringify(t);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${r}`)}}if(n.schema instanceof Object)this.schema=n.schema;else if(s)this.schema=new kc(Object.assign(s,n));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:t,jsonArg:n,mapAsMap:s,maxAliasCount:r,onAnchor:a,reviver:o}={}){const l={anchors:new Map,doc:this,keep:!t,mapAsMap:s===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},c=Qe(this.contents,n??"",l);if(typeof a=="function")for(const{count:u,res:p}of l.anchors.values())a(p,u);return typeof o=="function"?Hn(o,{"":c},"",c):c}toJSON(t,n){return this.toJS({json:!0,jsonArg:t,mapAsMap:!1,onAnchor:n})}toString(t={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in t&&(!Number.isInteger(t.indent)||Number(t.indent)<=0)){const n=JSON.stringify(t.indent);throw new Error(`"indent" option must be a positive integer, not ${n}`)}return lx(this,t)}}function En(e){if(le(e))return!0;throw new Error("Expected a YAML collection as document contents")}class xm extends Error{constructor(t,n,s,r){super(),this.name=t,this.code=s,this.message=r,this.pos=n}}class $s extends xm{constructor(t,n,s){super("YAMLParseError",t,n,s)}}class cx extends xm{constructor(t,n,s){super("YAMLWarning",t,n,s)}}const qu=(e,t)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(l=>t.linePos(l));const{line:s,col:r}=n.linePos[0];n.message+=` at line ${s}, column ${r}`;let a=r-1,o=e.substring(t.lineStarts[s-1],t.lineStarts[s]).replace(/[\n\r]+$/,"");if(a>=60&&o.length>80){const l=Math.min(a-39,o.length-79);o="…"+o.substring(l),a-=l-1}if(o.length>80&&(o=o.substring(0,79)+"…"),s>1&&/^ *$/.test(o.substring(0,a))){let l=e.substring(t.lineStarts[s-2],t.lineStarts[s-1]);l.length>80&&(l=l.substring(0,79)+`…
124
+ `),o=l+o}if(/[^ ]/.test(o)){let l=1;const c=n.linePos[1];(c==null?void 0:c.line)===s&&c.col>r&&(l=Math.max(1,Math.min(c.col-r,80-a)));const u=" ".repeat(a)+"^".repeat(l);n.message+=`:
125
+
126
+ ${o}
127
+ ${u}
128
+ `}};function cs(e,{flow:t,indicator:n,next:s,offset:r,onError:a,parentIndent:o,startOnNewline:l}){let c=!1,u=l,p=l,d="",f="",x=!1,y=!1,v=null,w=null,g=null,h=null,m=null,j=null,N=null;for(const k of e)switch(y&&(k.type!=="space"&&k.type!=="newline"&&k.type!=="comma"&&a(k.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),y=!1),v&&(u&&k.type!=="comment"&&k.type!=="newline"&&a(v,"TAB_AS_INDENT","Tabs are not allowed as indentation"),v=null),k.type){case"space":!t&&(n!=="doc-start"||(s==null?void 0:s.type)!=="flow-collection")&&k.source.includes(" ")&&(v=k),p=!0;break;case"comment":{p||a(k,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const T=k.source.substring(1)||" ";d?d+=f+T:d=T,f="",u=!1;break}case"newline":u?d?d+=k.source:(!j||n!=="seq-item-ind")&&(c=!0):f+=k.source,u=!0,x=!0,(w||g)&&(h=k),p=!0;break;case"anchor":w&&a(k,"MULTIPLE_ANCHORS","A node can have at most one anchor"),k.source.endsWith(":")&&a(k.offset+k.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),w=k,N??(N=k.offset),u=!1,p=!1,y=!0;break;case"tag":{g&&a(k,"MULTIPLE_TAGS","A node can have at most one tag"),g=k,N??(N=k.offset),u=!1,p=!1,y=!0;break}case n:(w||g)&&a(k,"BAD_PROP_ORDER",`Anchors and tags must be after the ${k.source} indicator`),j&&a(k,"UNEXPECTED_TOKEN",`Unexpected ${k.source} in ${t??"collection"}`),j=k,u=n==="seq-item-ind"||n==="explicit-key-ind",p=!1;break;case"comma":if(t){m&&a(k,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`),m=k,u=!1,p=!1;break}default:a(k,"UNEXPECTED_TOKEN",`Unexpected ${k.type} token`),u=!1,p=!1}const C=e[e.length-1],S=C?C.offset+C.source.length:r;return y&&s&&s.type!=="space"&&s.type!=="newline"&&s.type!=="comma"&&(s.type!=="scalar"||s.source!=="")&&a(s.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),v&&(u&&v.indent<=o||(s==null?void 0:s.type)==="block-map"||(s==null?void 0:s.type)==="block-seq")&&a(v,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:m,found:j,spaceBefore:c,comment:d,hasNewline:x,anchor:w,tag:g,newlineAfterProp:h,end:S,start:N??S}}function vr(e){if(!e)return null;switch(e.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(e.source.includes(`
129
+ `))return!0;if(e.end){for(const t of e.end)if(t.type==="newline")return!0}return!1;case"flow-collection":for(const t of e.items){for(const n of t.start)if(n.type==="newline")return!0;if(t.sep){for(const n of t.sep)if(n.type==="newline")return!0}if(vr(t.key)||vr(t.value))return!0}return!1;default:return!0}}function ll(e,t,n){if((t==null?void 0:t.type)==="flow-collection"){const s=t.end[0];s.indent===e&&(s.source==="]"||s.source==="}")&&vr(t)&&n(s,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function vm(e,t,n){const{uniqueKeys:s}=e.options;if(s===!1)return!1;const r=typeof s=="function"?s:(a,o)=>a===o||Q(a)&&Q(o)&&a.value===o.value;return t.some(a=>r(a.key,n))}const Yu="All mapping items must start at the same column";function ux({composeNode:e,composeEmptyNode:t},n,s,r,a){var p;const o=(a==null?void 0:a.nodeClass)??Ge,l=new o(n.schema);n.atRoot&&(n.atRoot=!1);let c=s.offset,u=null;for(const d of s.items){const{start:f,key:x,sep:y,value:v}=d,w=cs(f,{indicator:"explicit-key-ind",next:x??(y==null?void 0:y[0]),offset:c,onError:r,parentIndent:s.indent,startOnNewline:!0}),g=!w.found;if(g){if(x&&(x.type==="block-seq"?r(c,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in x&&x.indent!==s.indent&&r(c,"BAD_INDENT",Yu)),!w.anchor&&!w.tag&&!y){u=w.end,w.comment&&(l.comment?l.comment+=`
130
+ `+w.comment:l.comment=w.comment);continue}(w.newlineAfterProp||vr(x))&&r(x??f[f.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else((p=w.found)==null?void 0:p.indent)!==s.indent&&r(c,"BAD_INDENT",Yu);n.atKey=!0;const h=w.end,m=x?e(n,x,w,r):t(n,h,f,null,w,r);n.schema.compat&&ll(s.indent,x,r),n.atKey=!1,vm(n,l.items,m)&&r(h,"DUPLICATE_KEY","Map keys must be unique");const j=cs(y??[],{indicator:"map-value-ind",next:v,offset:m.range[2],onError:r,parentIndent:s.indent,startOnNewline:!x||x.type==="block-scalar"});if(c=j.end,j.found){g&&((v==null?void 0:v.type)==="block-map"&&!j.hasNewline&&r(c,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&w.start<j.found.offset-1024&&r(m.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));const N=v?e(n,v,j,r):t(n,c,y,null,j,r);n.schema.compat&&ll(s.indent,v,r),c=N.range[2];const C=new Te(m,N);n.options.keepSourceTokens&&(C.srcToken=d),l.items.push(C)}else{g&&r(m.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),j.comment&&(m.comment?m.comment+=`
131
+ `+j.comment:m.comment=j.comment);const N=new Te(m);n.options.keepSourceTokens&&(N.srcToken=d),l.items.push(N)}}return u&&u<c&&r(u,"IMPOSSIBLE","Map comment with trailing content"),l.range=[s.offset,c,u??c],l}function dx({composeNode:e,composeEmptyNode:t},n,s,r,a){const o=(a==null?void 0:a.nodeClass)??jn,l=new o(n.schema);n.atRoot&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let c=s.offset,u=null;for(const{start:p,value:d}of s.items){const f=cs(p,{indicator:"seq-item-ind",next:d,offset:c,onError:r,parentIndent:s.indent,startOnNewline:!0});if(!f.found)if(f.anchor||f.tag||d)(d==null?void 0:d.type)==="block-seq"?r(f.end,"BAD_INDENT","All sequence items must start at the same column"):r(c,"MISSING_CHAR","Sequence item without - indicator");else{u=f.end,f.comment&&(l.comment=f.comment);continue}const x=d?e(n,d,f,r):t(n,f.end,p,null,f,r);n.schema.compat&&ll(s.indent,d,r),c=x.range[2],l.items.push(x)}return l.range=[s.offset,c,u??c],l}function Lr(e,t,n,s){let r="";if(e){let a=!1,o="";for(const l of e){const{source:c,type:u}=l;switch(u){case"space":a=!0;break;case"comment":{n&&!a&&s(l,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const p=c.substring(1)||" ";r?r+=o+p:r=p,o="";break}case"newline":r&&(o+=c),a=!0;break;default:s(l,"UNEXPECTED_TOKEN",`Unexpected ${u} at node end`)}t+=c.length}}return{comment:r,offset:t}}const Xa="Block collections are not allowed within flow collections",Za=e=>e&&(e.type==="block-map"||e.type==="block-seq");function fx({composeNode:e,composeEmptyNode:t},n,s,r,a){var w;const o=s.start.source==="{",l=o?"flow map":"flow sequence",c=(a==null?void 0:a.nodeClass)??(o?Ge:jn),u=new c(n.schema);u.flow=!0;const p=n.atRoot;p&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let d=s.offset+s.start.source.length;for(let g=0;g<s.items.length;++g){const h=s.items[g],{start:m,key:j,sep:N,value:C}=h,S=cs(m,{flow:l,indicator:"explicit-key-ind",next:j??(N==null?void 0:N[0]),offset:d,onError:r,parentIndent:s.indent,startOnNewline:!1});if(!S.found){if(!S.anchor&&!S.tag&&!N&&!C){g===0&&S.comma?r(S.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${l}`):g<s.items.length-1&&r(S.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${l}`),S.comment&&(u.comment?u.comment+=`
132
+ `+S.comment:u.comment=S.comment),d=S.end;continue}!o&&n.options.strict&&vr(j)&&r(j,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(g===0)S.comma&&r(S.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${l}`);else if(S.comma||r(S.start,"MISSING_CHAR",`Missing , between ${l} items`),S.comment){let k="";e:for(const T of m)switch(T.type){case"comma":case"space":break;case"comment":k=T.source.substring(1);break e;default:break e}if(k){let T=u.items[u.items.length-1];ue(T)&&(T=T.value??T.key),T.comment?T.comment+=`
133
+ `+k:T.comment=k,S.comment=S.comment.substring(k.length+1)}}if(!o&&!N&&!S.found){const k=C?e(n,C,S,r):t(n,S.end,N,null,S,r);u.items.push(k),d=k.range[2],Za(C)&&r(k.range,"BLOCK_IN_FLOW",Xa)}else{n.atKey=!0;const k=S.end,T=j?e(n,j,S,r):t(n,k,m,null,S,r);Za(j)&&r(T.range,"BLOCK_IN_FLOW",Xa),n.atKey=!1;const L=cs(N??[],{flow:l,indicator:"map-value-ind",next:C,offset:T.range[2],onError:r,parentIndent:s.indent,startOnNewline:!1});if(L.found){if(!o&&!S.found&&n.options.strict){if(N)for(const F of N){if(F===L.found)break;if(F.type==="newline"){r(F,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}S.start<L.found.offset-1024&&r(L.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else C&&("source"in C&&((w=C.source)==null?void 0:w[0])===":"?r(C,"MISSING_CHAR",`Missing space after : in ${l}`):r(L.start,"MISSING_CHAR",`Missing , or : between ${l} items`));const O=C?e(n,C,L,r):L.found?t(n,L.end,N,null,L,r):null;O?Za(C)&&r(O.range,"BLOCK_IN_FLOW",Xa):L.comment&&(T.comment?T.comment+=`
134
+ `+L.comment:T.comment=L.comment);const U=new Te(T,O);if(n.options.keepSourceTokens&&(U.srcToken=h),o){const F=u;vm(n,F.items,T)&&r(k,"DUPLICATE_KEY","Map keys must be unique"),F.items.push(U)}else{const F=new Ge(n.schema);F.flow=!0,F.items.push(U);const E=(O??T).range;F.range=[T.range[0],E[1],E[2]],u.items.push(F)}d=O?O.range[2]:L.end}}const f=o?"}":"]",[x,...y]=s.end;let v=d;if((x==null?void 0:x.source)===f)v=x.offset+x.source.length;else{const g=l[0].toUpperCase()+l.substring(1),h=p?`${g} must end with a ${f}`:`${g} in block collection must be sufficiently indented and end with a ${f}`;r(d,p?"MISSING_CHAR":"BAD_INDENT",h),x&&x.source.length!==1&&y.unshift(x)}if(y.length>0){const g=Lr(y,v,n.options.strict,r);g.comment&&(u.comment?u.comment+=`
135
+ `+g.comment:u.comment=g.comment),u.range=[s.offset,v,g.offset]}else u.range=[s.offset,v,v];return u}function eo(e,t,n,s,r,a){const o=n.type==="block-map"?ux(e,t,n,s,a):n.type==="block-seq"?dx(e,t,n,s,a):fx(e,t,n,s,a),l=o.constructor;return r==="!"||r===l.tagName?(o.tag=l.tagName,o):(r&&(o.tag=r),o)}function px(e,t,n,s,r){var f;const a=s.tag,o=a?t.directives.tagName(a.source,x=>r(a,"TAG_RESOLVE_FAILED",x)):null;if(n.type==="block-seq"){const{anchor:x,newlineAfterProp:y}=s,v=x&&a?x.offset>a.offset?x:a:x??a;v&&(!y||y.offset<v.offset)&&r(v,"MISSING_CHAR","Missing newline after block sequence props")}const l=n.type==="block-map"?"map":n.type==="block-seq"?"seq":n.start.source==="{"?"map":"seq";if(!a||!o||o==="!"||o===Ge.tagName&&l==="map"||o===jn.tagName&&l==="seq")return eo(e,t,n,r,o);let c=t.schema.tags.find(x=>x.tag===o&&x.collection===l);if(!c){const x=t.schema.knownTags[o];if((x==null?void 0:x.collection)===l)t.schema.tags.push(Object.assign({},x,{default:!1})),c=x;else return x?r(a,"BAD_COLLECTION_TYPE",`${x.tag} used for ${l} collection, but expects ${x.collection??"scalar"}`,!0):r(a,"TAG_RESOLVE_FAILED",`Unresolved tag: ${o}`,!0),eo(e,t,n,r,o)}const u=eo(e,t,n,r,o,c),p=((f=c.resolve)==null?void 0:f.call(c,u,x=>r(a,"TAG_RESOLVE_FAILED",x),t.options))??u,d=ce(p)?p:new W(p);return d.range=u.range,d.tag=o,c!=null&&c.format&&(d.format=c.format),d}function mx(e,t,n){const s=t.offset,r=hx(t,e.options.strict,n);if(!r)return{value:"",type:null,comment:"",range:[s,s,s]};const a=r.mode===">"?W.BLOCK_FOLDED:W.BLOCK_LITERAL,o=t.source?gx(t.source):[];let l=o.length;for(let v=o.length-1;v>=0;--v){const w=o[v][1];if(w===""||w==="\r")l=v;else break}if(l===0){const v=r.chomp==="+"&&o.length>0?`
136
+ `.repeat(Math.max(1,o.length-1)):"";let w=s+r.length;return t.source&&(w+=t.source.length),{value:v,type:a,comment:r.comment,range:[s,w,w]}}let c=t.indent+r.indent,u=t.offset+r.length,p=0;for(let v=0;v<l;++v){const[w,g]=o[v];if(g===""||g==="\r")r.indent===0&&w.length>c&&(c=w.length);else{w.length<c&&n(u+w.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),r.indent===0&&(c=w.length),p=v,c===0&&!e.atRoot&&n(u,"BAD_INDENT","Block scalar values in collections must be indented");break}u+=w.length+g.length+1}for(let v=o.length-1;v>=l;--v)o[v][0].length>c&&(l=v+1);let d="",f="",x=!1;for(let v=0;v<p;++v)d+=o[v][0].slice(c)+`
137
+ `;for(let v=p;v<l;++v){let[w,g]=o[v];u+=w.length+g.length+1;const h=g[g.length-1]==="\r";if(h&&(g=g.slice(0,-1)),g&&w.length<c){const j=`Block scalar lines must not be less indented than their ${r.indent?"explicit indentation indicator":"first line"}`;n(u-g.length-(h?2:1),"BAD_INDENT",j),w=""}a===W.BLOCK_LITERAL?(d+=f+w.slice(c)+g,f=`
138
+ `):w.length>c||g[0]===" "?(f===" "?f=`
139
+ `:!x&&f===`
140
+ `&&(f=`
141
+
142
+ `),d+=f+w.slice(c)+g,f=`
143
+ `,x=!0):g===""?f===`
144
+ `?d+=`
145
+ `:f=`
146
+ `:(d+=f+g,f=" ",x=!1)}switch(r.chomp){case"-":break;case"+":for(let v=l;v<o.length;++v)d+=`
147
+ `+o[v][0].slice(c);d[d.length-1]!==`
148
+ `&&(d+=`
149
+ `);break;default:d+=`
150
+ `}const y=s+r.length+t.source.length;return{value:d,type:a,comment:r.comment,range:[s,y,y]}}function hx({offset:e,props:t},n,s){if(t[0].type!=="block-scalar-header")return s(t[0],"IMPOSSIBLE","Block scalar header not found"),null;const{source:r}=t[0],a=r[0];let o=0,l="",c=-1;for(let f=1;f<r.length;++f){const x=r[f];if(!l&&(x==="-"||x==="+"))l=x;else{const y=Number(x);!o&&y?o=y:c===-1&&(c=e+f)}}c!==-1&&s(c,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${r}`);let u=!1,p="",d=r.length;for(let f=1;f<t.length;++f){const x=t[f];switch(x.type){case"space":u=!0;case"newline":d+=x.source.length;break;case"comment":n&&!u&&s(x,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),d+=x.source.length,p=x.source.substring(1);break;case"error":s(x,"UNEXPECTED_TOKEN",x.message),d+=x.source.length;break;default:{const y=`Unexpected token in block scalar header: ${x.type}`;s(x,"UNEXPECTED_TOKEN",y);const v=x.source;v&&typeof v=="string"&&(d+=v.length)}}}return{mode:a,indent:o,chomp:l,comment:p,length:d}}function gx(e){const t=e.split(/\n( *)/),n=t[0],s=n.match(/^( *)/),a=[s!=null&&s[1]?[s[1],n.slice(s[1].length)]:["",n]];for(let o=1;o<t.length;o+=2)a.push([t[o],t[o+1]]);return a}function yx(e,t,n){const{offset:s,type:r,source:a,end:o}=e;let l,c;const u=(f,x,y)=>n(s+f,x,y);switch(r){case"scalar":l=W.PLAIN,c=xx(a,u);break;case"single-quoted-scalar":l=W.QUOTE_SINGLE,c=vx(a,u);break;case"double-quoted-scalar":l=W.QUOTE_DOUBLE,c=bx(a,u);break;default:return n(e,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${r}`),{value:"",type:null,comment:"",range:[s,s+a.length,s+a.length]}}const p=s+a.length,d=Lr(o,p,t,n);return{value:c,type:l,comment:d.comment,range:[s,p,d.offset]}}function xx(e,t){let n="";switch(e[0]){case" ":n="a tab character";break;case",":n="flow indicator character ,";break;case"%":n="directive indicator character %";break;case"|":case">":{n=`block scalar indicator ${e[0]}`;break}case"@":case"`":{n=`reserved character ${e[0]}`;break}}return n&&t(0,"BAD_SCALAR_START",`Plain value cannot start with ${n}`),bm(e)}function vx(e,t){return(e[e.length-1]!=="'"||e.length===1)&&t(e.length,"MISSING_CHAR","Missing closing 'quote"),bm(e.slice(1,-1)).replace(/''/g,"'")}function bm(e){let t,n;try{t=new RegExp(`(.*?)(?<![ ])[ ]*\r?
151
+ `,"sy"),n=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
152
+ `,"sy")}catch{t=/(.*?)[ \t]*\r?\n/sy,n=/[ \t]*(.*?)[ \t]*\r?\n/sy}let s=t.exec(e);if(!s)return e;let r=s[1],a=" ",o=t.lastIndex;for(n.lastIndex=o;s=n.exec(e);)s[1]===""?a===`
153
+ `?r+=a:a=`
154
+ `:(r+=a+s[1],a=" "),o=n.lastIndex;const l=/[ \t]*(.*)/sy;return l.lastIndex=o,s=l.exec(e),r+a+((s==null?void 0:s[1])??"")}function bx(e,t){let n="";for(let s=1;s<e.length-1;++s){const r=e[s];if(!(r==="\r"&&e[s+1]===`
155
+ `))if(r===`
156
+ `){const{fold:a,offset:o}=jx(e,s);n+=a,s=o}else if(r==="\\"){let a=e[++s];const o=wx[a];if(o)n+=o;else if(a===`
157
+ `)for(a=e[s+1];a===" "||a===" ";)a=e[++s+1];else if(a==="\r"&&e[s+1]===`
158
+ `)for(a=e[++s+1];a===" "||a===" ";)a=e[++s+1];else if(a==="x"||a==="u"||a==="U"){const l=a==="x"?2:a==="u"?4:8;n+=Nx(e,s+1,l,t),s+=l}else{const l=e.substr(s-1,2);t(s-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${l}`),n+=l}}else if(r===" "||r===" "){const a=s;let o=e[s+1];for(;o===" "||o===" ";)o=e[++s+1];o!==`
159
+ `&&!(o==="\r"&&e[s+2]===`
160
+ `)&&(n+=s>a?e.slice(a,s+1):r)}else n+=r}return(e[e.length-1]!=='"'||e.length===1)&&t(e.length,"MISSING_CHAR",'Missing closing "quote'),n}function jx(e,t){let n="",s=e[t+1];for(;(s===" "||s===" "||s===`
161
+ `||s==="\r")&&!(s==="\r"&&e[t+2]!==`
162
+ `);)s===`
163
+ `&&(n+=`
164
+ `),t+=1,s=e[t+1];return n||(n=" "),{fold:n,offset:t}}const wx={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
165
+ `,r:"\r",t:" ",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function Nx(e,t,n,s){const r=e.substr(t,n),o=r.length===n&&/^[0-9a-fA-F]+$/.test(r)?parseInt(r,16):NaN;try{return String.fromCodePoint(o)}catch{const l=e.substr(t-2,n+2);return s(t-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${l}`),l}}function jm(e,t,n,s){const{value:r,type:a,comment:o,range:l}=t.type==="block-scalar"?mx(e,t,s):yx(t,e.options.strict,s),c=n?e.directives.tagName(n.source,d=>s(n,"TAG_RESOLVE_FAILED",d)):null;let u;e.options.stringKeys&&e.atKey?u=e.schema[yt]:c?u=kx(e.schema,r,c,n,s):t.type==="scalar"?u=Sx(e,r,t,s):u=e.schema[yt];let p;try{const d=u.resolve(r,f=>s(n??t,"TAG_RESOLVE_FAILED",f),e.options);p=Q(d)?d:new W(d)}catch(d){const f=d instanceof Error?d.message:String(d);s(n??t,"TAG_RESOLVE_FAILED",f),p=new W(r)}return p.range=l,p.source=r,a&&(p.type=a),c&&(p.tag=c),u.format&&(p.format=u.format),o&&(p.comment=o),p}function kx(e,t,n,s,r){var l;if(n==="!")return e[yt];const a=[];for(const c of e.tags)if(!c.collection&&c.tag===n)if(c.default&&c.test)a.push(c);else return c;for(const c of a)if((l=c.test)!=null&&l.test(t))return c;const o=e.knownTags[n];return o&&!o.collection?(e.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(r(s,"TAG_RESOLVE_FAILED",`Unresolved tag: ${n}`,n!=="tag:yaml.org,2002:str"),e[yt])}function Sx({atKey:e,directives:t,schema:n},s,r,a){const o=n.tags.find(l=>{var c;return(l.default===!0||e&&l.default==="key")&&((c=l.test)==null?void 0:c.test(s))})||n[yt];if(n.compat){const l=n.compat.find(c=>{var u;return c.default&&((u=c.test)==null?void 0:u.test(s))})??n[yt];if(o.tag!==l.tag){const c=t.tagString(o.tag),u=t.tagString(l.tag),p=`Value may be parsed as either ${c} or ${u}`;a(r,"TAG_RESOLVE_FAILED",p,!0)}}return o}function Cx(e,t,n){if(t){n??(n=t.length);for(let s=n-1;s>=0;--s){let r=t[s];switch(r.type){case"space":case"comment":case"newline":e-=r.source.length;continue}for(r=t[++s];(r==null?void 0:r.type)==="space";)e+=r.source.length,r=t[++s];break}}return e}const Ex={composeNode:wm,composeEmptyNode:Sc};function wm(e,t,n,s){const r=e.atKey,{spaceBefore:a,comment:o,anchor:l,tag:c}=n;let u,p=!0;switch(t.type){case"alias":u=Tx(e,t,s),(l||c)&&s(t,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":u=jm(e,t,c,s),l&&(u.anchor=l.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{u=px(Ex,e,t,n,s),l&&(u.anchor=l.source.substring(1))}catch(d){const f=d instanceof Error?d.message:String(d);s(t,"RESOURCE_EXHAUSTION",f)}break;default:{const d=t.type==="error"?t.message:`Unsupported token (type: ${t.type})`;s(t,"UNEXPECTED_TOKEN",d),p=!1}}return u??(u=Sc(e,t.offset,void 0,null,n,s)),l&&u.anchor===""&&s(l,"BAD_ALIAS","Anchor cannot be an empty string"),r&&e.options.stringKeys&&(!Q(u)||typeof u.value!="string"||u.tag&&u.tag!=="tag:yaml.org,2002:str")&&s(c??t,"NON_STRING_KEY","With stringKeys, all keys must be strings"),a&&(u.spaceBefore=!0),o&&(t.type==="scalar"&&t.source===""?u.comment=o:u.commentBefore=o),e.options.keepSourceTokens&&p&&(u.srcToken=t),u}function Sc(e,t,n,s,{spaceBefore:r,comment:a,anchor:o,tag:l,end:c},u){const p={type:"scalar",offset:Cx(t,n,s),indent:-1,source:""},d=jm(e,p,l,u);return o&&(d.anchor=o.source.substring(1),d.anchor===""&&u(o,"BAD_ALIAS","Anchor cannot be an empty string")),r&&(d.spaceBefore=!0),a&&(d.comment=a,d.range[2]=c),d}function Tx({options:e},{offset:t,source:n,end:s},r){const a=new pc(n.substring(1));a.source===""&&r(t,"BAD_ALIAS","Alias cannot be an empty string"),a.source.endsWith(":")&&r(t+n.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const o=t+n.length,l=Lr(s,o,e.strict,r);return a.range=[t,o,l.offset],l.comment&&(a.comment=l.comment),a}function Ax(e,t,{offset:n,start:s,value:r,end:a},o){const l=Object.assign({_directives:t},e),c=new Ar(void 0,l),u={atKey:!1,atRoot:!0,directives:c.directives,options:c.options,schema:c.schema},p=cs(s,{indicator:"doc-start",next:r??(a==null?void 0:a[0]),offset:n,onError:o,parentIndent:0,startOnNewline:!0});p.found&&(c.directives.docStart=!0,r&&(r.type==="block-map"||r.type==="block-seq")&&!p.hasNewline&&o(p.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),c.contents=r?wm(u,r,p,o):Sc(u,p.end,s,null,p,o);const d=c.contents.range[2],f=Lr(a,d,!1,o);return f.comment&&(c.comment=f.comment),c.range=[n,d,f.offset],c}function Ls(e){if(typeof e=="number")return[e,e+1];if(Array.isArray(e))return e.length===2?e:[e[0],e[1]];const{offset:t,source:n}=e;return[t,t+(typeof n=="string"?n.length:1)]}function Qu(e){var r;let t="",n=!1,s=!1;for(let a=0;a<e.length;++a){const o=e[a];switch(o[0]){case"#":t+=(t===""?"":s?`
166
+
167
+ `:`
168
+ `)+(o.substring(1)||" "),n=!0,s=!1;break;case"%":((r=e[a+1])==null?void 0:r[0])!=="#"&&(a+=1),n=!1;break;default:n||(s=!0),n=!1}}return{comment:t,afterEmptyLine:s}}class Lx{constructor(t={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(n,s,r,a)=>{const o=Ls(n);a?this.warnings.push(new cx(o,s,r)):this.errors.push(new $s(o,s,r))},this.directives=new Ce({version:t.version||"1.2"}),this.options=t}decorate(t,n){const{comment:s,afterEmptyLine:r}=Qu(this.prelude);if(s){const a=t.contents;if(n)t.comment=t.comment?`${t.comment}
169
+ ${s}`:s;else if(r||t.directives.docStart||!a)t.commentBefore=s;else if(le(a)&&!a.flow&&a.items.length>0){let o=a.items[0];ue(o)&&(o=o.key);const l=o.commentBefore;o.commentBefore=l?`${s}
170
+ ${l}`:s}else{const o=a.commentBefore;a.commentBefore=o?`${s}
171
+ ${o}`:s}}if(n){for(let a=0;a<this.errors.length;++a)t.errors.push(this.errors[a]);for(let a=0;a<this.warnings.length;++a)t.warnings.push(this.warnings[a])}else t.errors=this.errors,t.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:Qu(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(t,n=!1,s=-1){for(const r of t)yield*this.next(r);yield*this.end(n,s)}*next(t){switch(t.type){case"directive":this.directives.add(t.source,(n,s,r)=>{const a=Ls(t);a[0]+=n,this.onError(a,"BAD_DIRECTIVE",s,r)}),this.prelude.push(t.source),this.atDirectives=!0;break;case"document":{const n=Ax(this.options,this.directives,t,this.onError);this.atDirectives&&!n.directives.docStart&&this.onError(t,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(n,!1),this.doc&&(yield this.doc),this.doc=n,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(t.source);break;case"error":{const n=t.source?`${t.message}: ${JSON.stringify(t.source)}`:t.message,s=new $s(Ls(t),"UNEXPECTED_TOKEN",n);this.atDirectives||!this.doc?this.errors.push(s):this.doc.errors.push(s);break}case"doc-end":{if(!this.doc){const s="Unexpected doc-end without preceding document";this.errors.push(new $s(Ls(t),"UNEXPECTED_TOKEN",s));break}this.doc.directives.docEnd=!0;const n=Lr(t.end,t.offset+t.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),n.comment){const s=this.doc.comment;this.doc.comment=s?`${s}
172
+ ${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.push(new $s(Ls(t),"UNEXPECTED_TOKEN",`Unsupported token ${t.type}`))}}*end(t=!1,n=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(t){const s=Object.assign({_directives:this.directives},this.options),r=new Ar(void 0,s);this.atDirectives&&this.onError(n,"MISSING_CHAR","Missing directives-end indicator line"),r.range=[0,n,n],this.decorate(r,!1),yield r}}}const Nm="\uFEFF",km="",Sm="",cl="";function Ix(e){switch(e){case Nm:return"byte-order-mark";case km:return"doc-mode";case Sm:return"flow-error-end";case cl:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
173
+ `:case`\r
174
+ `:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(e[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}function nt(e){switch(e){case void 0:case" ":case`
175
+ `:case"\r":case" ":return!0;default:return!1}}const Ju=new Set("0123456789ABCDEFabcdef"),Ox=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Xr=new Set(",[]{}"),Px=new Set(` ,[]{}
176
+ \r `),to=e=>!e||Px.has(e);class _x{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(t,n=!1){if(t){if(typeof t!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+t:t,this.lineEndPos=null}this.atEnd=!n;let s=this.next??"stream";for(;s&&(n||this.hasChars(1));)s=yield*this.parseNext(s)}atLineEnd(){let t=this.pos,n=this.buffer[t];for(;n===" "||n===" ";)n=this.buffer[++t];return!n||n==="#"||n===`
177
+ `?!0:n==="\r"?this.buffer[t+1]===`
178
+ `:!1}charAt(t){return this.buffer[this.pos+t]}continueScalar(t){let n=this.buffer[t];if(this.indentNext>0){let s=0;for(;n===" ";)n=this.buffer[++s+t];if(n==="\r"){const r=this.buffer[s+t+1];if(r===`
179
+ `||!r&&!this.atEnd)return t+s+1}return n===`
180
+ `||s>=this.indentNext||!n&&!this.atEnd?t+s:-1}if(n==="-"||n==="."){const s=this.buffer.substr(t,3);if((s==="---"||s==="...")&&nt(this.buffer[t+3]))return-1}return t}getLine(){let t=this.lineEndPos;return(typeof t!="number"||t!==-1&&t<this.pos)&&(t=this.buffer.indexOf(`
181
+ `,this.pos),this.lineEndPos=t),t===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[t-1]==="\r"&&(t-=1),this.buffer.substring(this.pos,t))}hasChars(t){return this.pos+t<=this.buffer.length}setNext(t){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=t,null}peek(t){return this.buffer.substr(this.pos,t)}*parseNext(t){switch(t){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let t=this.getLine();if(t===null)return this.setNext("stream");if(t[0]===Nm&&(yield*this.pushCount(1),t=t.substring(1)),t[0]==="%"){let n=t.length,s=t.indexOf("#");for(;s!==-1;){const a=t[s-1];if(a===" "||a===" "){n=s-1;break}else s=t.indexOf("#",s+1)}for(;;){const a=t[n-1];if(a===" "||a===" ")n-=1;else break}const r=(yield*this.pushCount(n))+(yield*this.pushSpaces(!0));return yield*this.pushCount(t.length-r),this.pushNewline(),"stream"}if(this.atLineEnd()){const n=yield*this.pushSpaces(!0);return yield*this.pushCount(t.length-n),yield*this.pushNewline(),"stream"}return yield km,yield*this.parseLineStart()}*parseLineStart(){const t=this.charAt(0);if(!t&&!this.atEnd)return this.setNext("line-start");if(t==="-"||t==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");const n=this.peek(3);if((n==="---"||n==="...")&&nt(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,n==="---"?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!nt(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){const[t,n]=this.peek(2);if(!n&&!this.atEnd)return this.setNext("block-start");if((t==="-"||t==="?"||t===":")&&nt(n)){const s=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=s,"block-start"}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);const t=this.getLine();if(t===null)return this.setNext("doc");let n=yield*this.pushIndicators();switch(t[n]){case"#":yield*this.pushCount(t.length-n);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(to),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return n+=yield*this.parseBlockScalarHeader(),n+=yield*this.pushSpaces(!0),yield*this.pushCount(t.length-n),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let t,n,s=-1;do t=yield*this.pushNewline(),t>0?(n=yield*this.pushSpaces(!1),this.indentValue=s=n):n=0,n+=yield*this.pushSpaces(!0);while(t+n>0);const r=this.getLine();if(r===null)return this.setNext("flow");if((s!==-1&&s<this.indentNext&&r[0]!=="#"||s===0&&(r.startsWith("---")||r.startsWith("..."))&&nt(r[3]))&&!(s===this.indentNext-1&&this.flowLevel===1&&(r[0]==="]"||r[0]==="}")))return this.flowLevel=0,yield Sm,yield*this.parseLineStart();let a=0;for(;r[a]===",";)a+=yield*this.pushCount(1),a+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(a+=yield*this.pushIndicators(),r[a]){case void 0:return"flow";case"#":return yield*this.pushCount(r.length-a),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(to),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{const o=this.charAt(1);if(this.flowKey||nt(o)||o===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){const t=this.charAt(0);let n=this.buffer.indexOf(t,this.pos+1);if(t==="'")for(;n!==-1&&this.buffer[n+1]==="'";)n=this.buffer.indexOf("'",n+2);else for(;n!==-1;){let a=0;for(;this.buffer[n-1-a]==="\\";)a+=1;if(a%2===0)break;n=this.buffer.indexOf('"',n+1)}const s=this.buffer.substring(0,n);let r=s.indexOf(`
182
+ `,this.pos);if(r!==-1){for(;r!==-1;){const a=this.continueScalar(r+1);if(a===-1)break;r=s.indexOf(`
183
+ `,a)}r!==-1&&(n=r-(s[r-1]==="\r"?2:1))}if(n===-1){if(!this.atEnd)return this.setNext("quoted-scalar");n=this.buffer.length}return yield*this.pushToIndex(n+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let t=this.pos;for(;;){const n=this.buffer[++t];if(n==="+")this.blockScalarKeep=!0;else if(n>"0"&&n<="9")this.blockScalarIndent=Number(n)-1;else if(n!=="-")break}return yield*this.pushUntil(n=>nt(n)||n==="#")}*parseBlockScalar(){let t=this.pos-1,n=0,s;e:for(let a=this.pos;s=this.buffer[a];++a)switch(s){case" ":n+=1;break;case`
184
+ `:t=a,n=0;break;case"\r":{const o=this.buffer[a+1];if(!o&&!this.atEnd)return this.setNext("block-scalar");if(o===`
185
+ `)break}default:break e}if(!s&&!this.atEnd)return this.setNext("block-scalar");if(n>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=n:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{const a=this.continueScalar(t+1);if(a===-1)break;t=this.buffer.indexOf(`
186
+ `,a)}while(t!==-1);if(t===-1){if(!this.atEnd)return this.setNext("block-scalar");t=this.buffer.length}}let r=t+1;for(s=this.buffer[r];s===" ";)s=this.buffer[++r];if(s===" "){for(;s===" "||s===" "||s==="\r"||s===`
187
+ `;)s=this.buffer[++r];t=r-1}else if(!this.blockScalarKeep)do{let a=t-1,o=this.buffer[a];o==="\r"&&(o=this.buffer[--a]);const l=a;for(;o===" ";)o=this.buffer[--a];if(o===`
188
+ `&&a>=this.pos&&a+1+n>l)t=a;else break}while(!0);return yield cl,yield*this.pushToIndex(t+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){const t=this.flowLevel>0;let n=this.pos-1,s=this.pos-1,r;for(;r=this.buffer[++s];)if(r===":"){const a=this.buffer[s+1];if(nt(a)||t&&Xr.has(a))break;n=s}else if(nt(r)){let a=this.buffer[s+1];if(r==="\r"&&(a===`
189
+ `?(s+=1,r=`
190
+ `,a=this.buffer[s+1]):n=s),a==="#"||t&&Xr.has(a))break;if(r===`
191
+ `){const o=this.continueScalar(s+1);if(o===-1)break;s=Math.max(s,o-2)}}else{if(t&&Xr.has(r))break;n=s}return!r&&!this.atEnd?this.setNext("plain-scalar"):(yield cl,yield*this.pushToIndex(n+1,!0),t?"flow":"doc")}*pushCount(t){return t>0?(yield this.buffer.substr(this.pos,t),this.pos+=t,t):0}*pushToIndex(t,n){const s=this.buffer.slice(this.pos,t);return s?(yield s,this.pos+=s.length,s.length):(n&&(yield""),0)}*pushIndicators(){let t=0;e:for(;;){switch(this.charAt(0)){case"!":t+=yield*this.pushTag(),t+=yield*this.pushSpaces(!0);continue e;case"&":t+=yield*this.pushUntil(to),t+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{const n=this.flowLevel>0,s=this.charAt(1);if(nt(s)||n&&Xr.has(s)){n?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,t+=yield*this.pushCount(1),t+=yield*this.pushSpaces(!0);continue e}}}break e}return t}*pushTag(){if(this.charAt(1)==="<"){let t=this.pos+2,n=this.buffer[t];for(;!nt(n)&&n!==">";)n=this.buffer[++t];return yield*this.pushToIndex(n===">"?t+1:t,!1)}else{let t=this.pos+1,n=this.buffer[t];for(;n;)if(Ox.has(n))n=this.buffer[++t];else if(n==="%"&&Ju.has(this.buffer[t+1])&&Ju.has(this.buffer[t+2]))n=this.buffer[t+=3];else break;return yield*this.pushToIndex(t,!1)}}*pushNewline(){const t=this.buffer[this.pos];return t===`
192
+ `?yield*this.pushCount(1):t==="\r"&&this.charAt(1)===`
193
+ `?yield*this.pushCount(2):0}*pushSpaces(t){let n=this.pos-1,s;do s=this.buffer[++n];while(s===" "||t&&s===" ");const r=n-this.pos;return r>0&&(yield this.buffer.substr(this.pos,r),this.pos=n),r}*pushUntil(t){let n=this.pos,s=this.buffer[n];for(;!t(s);)s=this.buffer[++n];return yield*this.pushToIndex(n,!1)}}class Mx{constructor(){this.lineStarts=[],this.addNewLine=t=>this.lineStarts.push(t),this.linePos=t=>{let n=0,s=this.lineStarts.length;for(;n<s;){const a=n+s>>1;this.lineStarts[a]<t?n=a+1:s=a}if(this.lineStarts[n]===t)return{line:n+1,col:1};if(n===0)return{line:0,col:t};const r=this.lineStarts[n-1];return{line:n,col:t-r+1}}}}function $t(e,t){for(let n=0;n<e.length;++n)if(e[n].type===t)return!0;return!1}function Xu(e){for(let t=0;t<e.length;++t)switch(e[t].type){case"space":case"comment":case"newline":break;default:return t}return-1}function Cm(e){switch(e==null?void 0:e.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function Zr(e){switch(e.type){case"document":return e.start;case"block-map":{const t=e.items[e.items.length-1];return t.sep??t.start}case"block-seq":return e.items[e.items.length-1].start;default:return[]}}function Tn(e){var n;if(e.length===0)return[];let t=e.length;e:for(;--t>=0;)switch(e[t].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;((n=e[++t])==null?void 0:n.type)==="space";);return e.splice(t,e.length)}function qi(e,t){if(t.length<1e5)Array.prototype.push.apply(e,t);else for(let n=0;n<t.length;++n)e.push(t[n])}function Zu(e){if(e.start.type==="flow-seq-start")for(const t of e.items)t.sep&&!t.value&&!$t(t.start,"explicit-key-ind")&&!$t(t.sep,"map-value-ind")&&(t.key&&(t.value=t.key),delete t.key,Cm(t.value)?t.value.end?qi(t.value.end,t.sep):t.value.end=t.sep:qi(t.start,t.sep),delete t.sep)}class Dx{constructor(t){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new _x,this.onNewLine=t}*parse(t,n=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(const s of this.lexer.lex(t,n))yield*this.next(s);n||(yield*this.end())}*next(t){if(this.source=t,this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=t.length;return}const n=Ix(t);if(n)if(n==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=n,yield*this.step(),n){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+t.length);break;case"space":this.atNewLine&&t[0]===" "&&(this.indent+=t.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=t.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=t.length}else{const s=`Not a YAML token: ${t}`;yield*this.pop({type:"error",offset:this.offset,message:s,source:t}),this.offset+=t.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){const t=this.peek(1);if(this.type==="doc-end"&&(t==null?void 0:t.type)!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!t)return yield*this.stream();switch(t.type){case"document":return yield*this.document(t);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(t);case"block-scalar":return yield*this.blockScalar(t);case"block-map":return yield*this.blockMap(t);case"block-seq":return yield*this.blockSequence(t);case"flow-collection":return yield*this.flowCollection(t);case"doc-end":return yield*this.documentEnd(t)}yield*this.pop()}peek(t){return this.stack[this.stack.length-t]}*pop(t){const n=t??this.stack.pop();if(!n)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield n;else{const s=this.peek(1);switch(n.type==="block-scalar"?n.indent="indent"in s?s.indent:0:n.type==="flow-collection"&&s.type==="document"&&(n.indent=0),n.type==="flow-collection"&&Zu(n),s.type){case"document":s.value=n;break;case"block-scalar":s.props.push(n);break;case"block-map":{const r=s.items[s.items.length-1];if(r.value){s.items.push({start:[],key:n,sep:[]}),this.onKeyLine=!0;return}else if(r.sep)r.value=n;else{Object.assign(r,{key:n,sep:[]}),this.onKeyLine=!r.explicitKey;return}break}case"block-seq":{const r=s.items[s.items.length-1];r.value?s.items.push({start:[],value:n}):r.value=n;break}case"flow-collection":{const r=s.items[s.items.length-1];!r||r.value?s.items.push({start:[],key:n,sep:[]}):r.sep?r.value=n:Object.assign(r,{key:n,sep:[]});return}default:yield*this.pop(),yield*this.pop(n)}if((s.type==="document"||s.type==="block-map"||s.type==="block-seq")&&(n.type==="block-map"||n.type==="block-seq")){const r=n.items[n.items.length-1];r&&!r.sep&&!r.value&&r.start.length>0&&Xu(r.start)===-1&&(n.indent===0||r.start.every(a=>a.type!=="comment"||a.indent<n.indent))&&(s.type==="document"?s.end=r.start:s.items.push({start:r.start}),n.items.splice(-1,1))}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{const t={type:"document",offset:this.offset,start:[]};this.type==="doc-start"&&t.start.push(this.sourceToken),this.stack.push(t);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(t){if(t.value)return yield*this.lineEnd(t);switch(this.type){case"doc-start":{Xu(t.start)!==-1?(yield*this.pop(),yield*this.step()):t.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":t.start.push(this.sourceToken);return}const n=this.startBlockValue(t);n?this.stack.push(n):yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(t){if(this.type==="map-value-ind"){const n=Zr(this.peek(2)),s=Tn(n);let r;t.end?(r=t.end,r.push(this.sourceToken),delete t.end):r=[this.sourceToken];const a={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:s,key:t,sep:r}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=a}else yield*this.lineEnd(t)}*blockScalar(t){switch(this.type){case"space":case"comment":case"newline":t.props.push(this.sourceToken);return;case"scalar":if(t.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let n=this.source.indexOf(`
194
+ `)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
195
+ `,n)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(t){var s;const n=t.items[t.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,n.value){const r="end"in n.value?n.value.end:void 0,a=Array.isArray(r)?r[r.length-1]:void 0;(a==null?void 0:a.type)==="comment"?r==null||r.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)t.items.push({start:[this.sourceToken]});else if(n.sep)n.sep.push(this.sourceToken);else{if(this.atIndentedComment(n.start,t.indent)){const r=t.items[t.items.length-2],a=(s=r==null?void 0:r.value)==null?void 0:s.end;if(Array.isArray(a)){qi(a,n.start),a.push(this.sourceToken),t.items.pop();return}}n.start.push(this.sourceToken)}return}if(this.indent>=t.indent){const r=!this.onKeyLine&&this.indent===t.indent,a=r&&(n.sep||n.explicitKey)&&this.type!=="seq-item-ind";let o=[];if(a&&n.sep&&!n.value){const l=[];for(let c=0;c<n.sep.length;++c){const u=n.sep[c];switch(u.type){case"newline":l.push(c);break;case"space":break;case"comment":u.indent>t.indent&&(l.length=0);break;default:l.length=0}}l.length>=2&&(o=n.sep.splice(l[1]))}switch(this.type){case"anchor":case"tag":a||n.value?(o.push(this.sourceToken),t.items.push({start:o}),this.onKeyLine=!0):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"explicit-key-ind":!n.sep&&!n.explicitKey?(n.start.push(this.sourceToken),n.explicitKey=!0):a||n.value?(o.push(this.sourceToken),t.items.push({start:o,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(n.explicitKey)if(n.sep)if(n.value)t.items.push({start:[],key:null,sep:[this.sourceToken]});else if($t(n.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]});else if(Cm(n.key)&&!$t(n.sep,"newline")){const l=Tn(n.start),c=n.key,u=n.sep;u.push(this.sourceToken),delete n.key,delete n.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:l,key:c,sep:u}]})}else o.length>0?n.sep=n.sep.concat(o,this.sourceToken):n.sep.push(this.sourceToken);else if($t(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{const l=Tn(n.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:l,key:null,sep:[this.sourceToken]}]})}else n.sep?n.value||a?t.items.push({start:o,key:null,sep:[this.sourceToken]}):$t(n.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const l=this.flowScalar(this.type);a||n.value?(t.items.push({start:o,key:l,sep:[]}),this.onKeyLine=!0):n.sep?this.stack.push(l):(Object.assign(n,{key:l,sep:[]}),this.onKeyLine=!0);return}default:{const l=this.startBlockValue(t);if(l){if(l.type==="block-seq"){if(!n.explicitKey&&n.sep&&!$t(n.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else r&&t.items.push({start:o});this.stack.push(l);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(t){var s;const n=t.items[t.items.length-1];switch(this.type){case"newline":if(n.value){const r="end"in n.value?n.value.end:void 0,a=Array.isArray(r)?r[r.length-1]:void 0;(a==null?void 0:a.type)==="comment"?r==null||r.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)t.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(n.start,t.indent)){const r=t.items[t.items.length-2],a=(s=r==null?void 0:r.value)==null?void 0:s.end;if(Array.isArray(a)){qi(a,n.start),a.push(this.sourceToken),t.items.pop();return}}n.start.push(this.sourceToken)}return;case"anchor":case"tag":if(n.value||this.indent<=t.indent)break;n.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==t.indent)break;n.value||$t(n.start,"seq-item-ind")?t.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return}if(this.indent>t.indent){const r=this.startBlockValue(t);if(r){this.stack.push(r);return}}yield*this.pop(),yield*this.step()}*flowCollection(t){const n=t.items[t.items.length-1];if(this.type==="flow-error-end"){let s;do yield*this.pop(),s=this.peek(1);while((s==null?void 0:s.type)==="flow-collection")}else if(t.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!n||n.sep?t.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return;case"map-value-ind":!n||n.value?t.items.push({start:[],key:null,sep:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!n||n.value?t.items.push({start:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const r=this.flowScalar(this.type);!n||n.value?t.items.push({start:[],key:r,sep:[]}):n.sep?this.stack.push(r):Object.assign(n,{key:r,sep:[]});return}case"flow-map-end":case"flow-seq-end":t.end.push(this.sourceToken);return}const s=this.startBlockValue(t);s?this.stack.push(s):(yield*this.pop(),yield*this.step())}else{const s=this.peek(2);if(s.type==="block-map"&&(this.type==="map-value-ind"&&s.indent===t.indent||this.type==="newline"&&!s.items[s.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&s.type!=="flow-collection"){const r=Zr(s),a=Tn(r);Zu(t);const o=t.end.splice(1,t.end.length);o.push(this.sourceToken);const l={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:a,key:t,sep:o}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=l}else yield*this.lineEnd(t)}}flowScalar(t){if(this.onNewLine){let n=this.source.indexOf(`
196
+ `)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
197
+ `,n)+1}return{type:t,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(t){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;const n=Zr(t),s=Tn(n);return s.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;const n=Zr(t),s=Tn(n);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(t,n){return this.type!=="comment"||this.indent<=n?!1:t.every(s=>s.type==="newline"||s.type==="space")}*documentEnd(t){this.type!=="doc-mode"&&(t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(t){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}}function $x(e){const t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new Mx||null,prettyErrors:t}}function Rx(e,t={}){const{lineCounter:n,prettyErrors:s}=$x(t),r=new Dx(n==null?void 0:n.addNewLine),a=new Lx(t);let o=null;for(const l of a.compose(r.parse(e),!0,e.length))if(!o)o=l;else if(o.options.logLevel!=="silent"){o.errors.push(new $s(l.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return s&&n&&(o.errors.forEach(qu(e,n)),o.warnings.forEach(qu(e,n))),o}function zx(e,t,n){let s;const r=Rx(e,n);if(!r)return null;if(r.warnings.forEach(a=>Xp(r.options.logLevel,a)),r.errors.length>0){if(r.options.logLevel!=="silent")throw r.errors[0];r.errors=[]}return r.toJS(Object.assign({reviver:s},n))}function Fx(e,t,n){let s=null;if(Array.isArray(t)&&(s=t),e===void 0){const{keepUndefined:r}={};if(!r)return}return Sr(e)&&!s?e.toString(n):new Ar(e,s,n).toString(n)}const Bx=new Set(["daemon.host","daemon.port","app.port"]),Ux=["js_evaluate","cookie_write"];function ed(e){const t=e.daemon??{},n=e.security??{},s=e.connectors??{},r=e.audit??{},a=e.output??{},o=e.app??{};return{daemon:{host:String(t.host??"127.0.0.1"),port:Number(t.port??9091)},security:{extensionId:String(n.extensionId??""),highRiskCapabilities:n.highRiskCapabilities??[...Ux],approvedHighRisk:n.approvedHighRisk??[],approvalRequired:n.approvalRequired??[],autoApproveConnectors:n.autoApproveConnectors??[],approvalTimeoutMs:Number(n.approvalTimeoutMs??12e4)},connectors:{paths:s.paths??["./connectors","~/.commandgarden/connectors"]},audit:{retentionDays:Number(r.retentionDays??90),dbPath:String(r.dbPath??"~/.commandgarden/audit.db")},output:{defaultFormat:String(a.defaultFormat??"table")},app:{port:Number(o.port??9092)}}}function Wx(e){return{daemon:{...e.daemon},security:{...e.security},connectors:{...e.connectors},audit:{...e.audit},output:{...e.output},app:{...e.app}}}function Hx(){const[e,t]=b.useState(null),[n,s]=b.useState(null),[r,a]=b.useState([]),[o,l]=b.useState(!0),[c,u]=b.useState(!1),[p,d]=b.useState(null),[f,x]=b.useState(!1),[y,v]=b.useState(""),[w,g]=b.useState(!1),[h,m]=b.useState("");b.useEffect(()=>{Promise.all([B.getConfig(),B.getConnectors()]).then(([E,D])=>{const P=ed(E.config);t(P),s(structuredClone(P)),a(D.connectors)}).catch(()=>{t(null),s(null)}).finally(()=>l(!1))},[]);const j=b.useMemo(()=>!e||!n?!1:JSON.stringify(e)!==JSON.stringify(n),[e,n]),N=b.useMemo(()=>{if(!e||!n)return 0;let E=0;for(const D of Object.keys(n)){const P=e[D],R=n[D];for(const A of Object.keys(R))JSON.stringify(P[A])!==JSON.stringify(R[A])&&E++}return E},[e,n]),C=b.useCallback(async()=>{if(!e||!n)return;if(!n.daemon.host.trim()){d({type:"error",msg:"Daemon host cannot be empty."});return}u(!0),d(null);let E=!1;try{for(const D of Object.keys(n)){const P=e[D],R=n[D];for(const A of Object.keys(R)){const _=JSON.stringify(R[A]),$=JSON.stringify(P[A]??null);if(_!==$){const z=`${D}.${A}`,J=R[A];let $e;z==="security.approvalTimeoutMs"?$e=String(J):Array.isArray(J)?$e=JSON.stringify(J):$e=String(J),await B.setConfig(z,$e),Bx.has(z)&&(E=!0)}}}t(structuredClone(n)),d({type:"success",msg:"Configuration saved."}),E&&x(!0)}catch(D){d({type:"error",msg:D instanceof Error?D.message:"Save failed"})}finally{u(!1),setTimeout(()=>d(null),3e3)}},[e,n]),S=b.useCallback(()=>{e&&s(structuredClone(e))},[e]),k=b.useCallback(()=>{!w&&n&&(v(Fx(Wx(n))),m("")),g(!w)},[w,n]),T=b.useCallback(()=>{try{const E=zx(y);if(!E||typeof E!="object")throw new Error("Invalid YAML");s(ed(E)),m("")}catch(E){m(E instanceof Error?E.message:"Invalid YAML")}},[y]),L=b.useCallback((E,D,P)=>{s(R=>R&&{...R,[E]:{...R[E],[D]:P}})},[]),O=b.useCallback((E,D,P)=>{s(R=>{if(!R)return R;const A=R[E],_=A[D]??[];return _.includes(P)?R:{...R,[E]:{...A,[D]:[..._,P]}}})},[]),U=b.useCallback((E,D,P)=>{s(R=>{if(!R)return R;const A=R[E],_=A[D]??[];return{...R,[E]:{...A,[D]:_.filter($=>$!==P)}}})},[]),F=b.useMemo(()=>({updateField:L,addToArray:O,removeFromArray:U}),[L,O,U]);return o?i.jsx(ut,{label:"Loading configuration..."}):!n||!e?i.jsxs("div",{className:"max-w-3xl mx-auto",children:[i.jsx("h2",{className:"font-display text-xl font-bold uppercase tracking-[0.06em] mb-5",children:"Configuration"}),i.jsxs("div",{className:"border border-base-300 p-6 text-center",children:[i.jsx("p",{className:"text-sm opacity-50 mb-2",children:"No configuration found."}),i.jsx("p",{className:"font-mono text-xs opacity-30",children:"Make sure the daemon is running. Configuration will appear here automatically."})]})]}):i.jsxs("div",{className:"max-w-3xl mx-auto pb-20",children:[i.jsx("h2",{className:"font-display text-xl font-bold uppercase tracking-[0.06em] mb-5",children:"Configuration"}),f&&i.jsxs("div",{className:"alert alert-warning mb-6",children:[i.jsxs("span",{children:["Some changes require a daemon restart to take effect. Restart with: ",i.jsx("code",{className:"font-mono text-sm",children:"cg down && cg up"})]}),i.jsx("button",{className:"btn btn-sm btn-ghost",onClick:()=>x(!1),children:"Dismiss"})]}),i.jsxs("div",{className:"space-y-8",children:[i.jsx("div",{id:"cfg-server",className:"scroll-mt-4",children:i.jsx(Vx,{config:n,actions:F})}),i.jsx("div",{id:"cfg-security",className:"scroll-mt-4",children:i.jsx(Kx,{config:n,connectors:r,actions:F})}),i.jsx("div",{id:"cfg-sources",className:"scroll-mt-4",children:i.jsx(Gx,{config:n,actions:F})}),i.jsx("div",{id:"cfg-audit",className:"scroll-mt-4",children:i.jsx(qx,{config:n,actions:F})}),i.jsx("div",{id:"cfg-output",className:"scroll-mt-4",children:i.jsx(Yx,{config:n,actions:F})}),i.jsx("div",{id:"cfg-journal",className:"scroll-mt-4",children:i.jsx(Qx,{})})]}),i.jsxs("div",{className:"mt-8",children:[i.jsxs("button",{className:"btn btn-sm btn-ghost gap-1",onClick:k,children:[w?"▾":"▸"," Raw Configuration (YAML)"]}),w&&i.jsxs("div",{className:"mt-2 border border-base-300 p-4",children:[i.jsx("textarea",{className:"textarea textarea-bordered w-full font-mono text-sm",rows:16,value:y,onChange:E=>v(E.target.value)}),h&&i.jsx("p",{className:"text-error text-sm mt-1",children:h}),i.jsx("button",{className:"btn btn-sm btn-ghost mt-2",onClick:T,children:"Apply to form"})]})]}),j&&i.jsxs("div",{className:"fixed bottom-0 left-0 md:left-56 right-0 bg-base-100 border-t border-base-300 px-6 py-3 flex items-center justify-between z-50",children:[i.jsxs("span",{className:"text-sm opacity-60",children:[N," unsaved ",N===1?"change":"changes"]}),i.jsxs("div",{className:"flex items-center gap-3",children:[p&&i.jsx("span",{className:`text-sm ${p.type==="success"?"text-success":"text-error"}`,children:p.msg}),i.jsx("button",{className:"btn btn-sm btn-ghost",onClick:S,children:"Discard"}),i.jsx("button",{className:"btn btn-sm btn-primary",onClick:C,disabled:c,children:c?"Saving...":"Save changes"})]})]})]})}function bs({title:e,description:t,children:n}){return i.jsxs("div",{className:"border border-base-300 p-5",children:[i.jsx("h3",{className:"font-display font-semibold mb-1",children:e}),i.jsx("p",{className:"text-xs opacity-40 mb-5",children:t}),i.jsx("div",{className:"space-y-5",children:n})]})}function Pe({label:e,help:t,restart:n,children:s}){return i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center gap-4",children:[i.jsxs("div",{className:"w-48 shrink-0",children:[i.jsx("label",{className:"font-mono text-[0.7rem] font-medium uppercase tracking-wide",children:e}),n&&i.jsx("span",{className:"ml-1.5 tooltip tooltip-right","data-tip":"Requires daemon restart",children:i.jsx("span",{className:"text-xs opacity-40",children:"⟳"})})]}),i.jsx("div",{className:"flex-1",children:s})]}),i.jsx("p",{className:"text-xs opacity-40 mt-1 max-w-[12rem]",children:t})]})}function Vx({config:e,actions:t}){const{updateField:n}=t;return i.jsxs(bs,{title:"Server",description:"Daemon and app server binding configuration",children:[i.jsx(Pe,{label:"Daemon Host",help:"IP address the daemon binds to",restart:!0,children:i.jsx("input",{type:"text",className:"input input-bordered input-sm w-full",required:!0,value:e.daemon.host,onChange:s=>n("daemon","host",s.target.value)})}),i.jsx(Pe,{label:"Daemon Port",help:"Port the daemon listens on",restart:!0,children:i.jsx("input",{type:"number",className:"input input-bordered input-sm w-full",min:1024,max:65535,value:e.daemon.port,onChange:s=>n("daemon","port",Number(s.target.value))})}),i.jsx(Pe,{label:"GUI Port",help:"Port the GUI app server listens on",restart:!0,children:i.jsx("input",{type:"number",className:"input input-bordered input-sm w-full",min:1024,max:65535,value:e.app.port,onChange:s=>n("app","port",Number(s.target.value))})})]})}function td({values:e,onAdd:t,onRemove:n,placeholder:s}){const[r,a]=b.useState("");return i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"flex flex-wrap gap-1 mb-1",children:e.map(o=>i.jsxs(H,{size:"sm",className:"gap-1",children:[o,i.jsx("button",{className:"text-xs opacity-50 hover:opacity-100",onClick:()=>n(o),children:"×"})]},o))}),i.jsxs("div",{className:"flex gap-1",children:[i.jsx("input",{type:"text",className:"input input-bordered input-xs flex-1",placeholder:s,value:r,onChange:o=>a(o.target.value),onKeyDown:o=>{o.key==="Enter"&&r.trim()&&(t(r.trim()),a(""))}}),i.jsx("button",{className:"btn btn-xs btn-ghost",onClick:()=>{r.trim()&&(t(r.trim()),a(""))},children:"Add"})]})]})}function Kx({config:e,connectors:t,actions:n}){const{updateField:s,addToArray:r,removeFromArray:a}=n,o=new Set(e.security.highRiskCapabilities),l=b.useMemo(()=>ma(t),[t]);return i.jsxs(bs,{title:"Connector Security",description:"Manage which connectors are approved and which capabilities require approval",children:[t.length>0&&i.jsx("div",{className:"overflow-x-auto mb-4",children:i.jsxs("table",{className:"table table-sm",children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("th",{children:"Connector"}),i.jsx("th",{children:"Capabilities"}),i.jsx("th",{children:"Risk"}),i.jsx("th",{children:"Approved"}),i.jsx("th",{children:"Auto-Approve"})]})}),i.jsx("tbody",{children:l.map(([c,u])=>i.jsxs(b.Fragment,{children:[i.jsx("tr",{children:i.jsxs("td",{colSpan:5,className:"bg-base-200/50 font-mono font-semibold text-xs pt-3 pb-1",children:[c,i.jsxs("span",{className:"font-normal opacity-40 ml-2",children:[u.length," ",u.length===1?"connector":"connectors"]})]})}),u.map(p=>{const d=p.key.split("/")[1],f=p.capabilities.some(v=>o.has(v)),x=e.security.approvedHighRisk.includes(p.key),y=e.security.autoApproveConnectors.includes(p.key);return i.jsxs("tr",{children:[i.jsx("td",{className:"font-mono text-sm pl-6",children:d}),i.jsx("td",{children:i.jsx("div",{className:"flex flex-wrap gap-1",children:p.capabilities.map(v=>i.jsx(H,{variant:o.has(v)?"warning":"neutral",size:"xs",children:v},v))})}),i.jsx("td",{children:f?i.jsx(H,{variant:"warning",size:"xs",children:"High"}):i.jsx("span",{className:"opacity-40",children:"—"})}),i.jsx("td",{children:f?i.jsx("input",{type:"checkbox",className:"toggle toggle-sm toggle-success",checked:x,onChange:()=>x?a("security","approvedHighRisk",p.key):r("security","approvedHighRisk",p.key)}):i.jsx("span",{className:"opacity-40",children:"—"})}),i.jsx("td",{children:i.jsx("input",{type:"checkbox",className:"toggle toggle-sm",checked:y,title:"Skip approval prompts — pipeline steps execute without confirmation",onChange:()=>y?a("security","autoApproveConnectors",p.key):r("security","autoApproveConnectors",p.key)})})]},p.key)})]},c))})]})}),i.jsx(Pe,{label:"High-Risk Capabilities",help:"Capabilities that require connector-level approval before first use",children:i.jsx(td,{values:e.security.highRiskCapabilities,onAdd:c=>r("security","highRiskCapabilities",c),onRemove:c=>a("security","highRiskCapabilities",c),placeholder:"Capability name"})}),i.jsx(Pe,{label:"Step Approval Required",help:"Capabilities that pause for user confirmation at each pipeline step",children:i.jsx(td,{values:e.security.approvalRequired,onAdd:c=>r("security","approvalRequired",c),onRemove:c=>a("security","approvalRequired",c),placeholder:"Capability name"})}),i.jsx(Pe,{label:"Approval Timeout (seconds)",help:"How long to wait for approval before aborting the pipeline",children:i.jsx("input",{type:"number",className:"input input-bordered input-sm w-full",min:1,max:600,value:Math.round(e.security.approvalTimeoutMs/1e3),onChange:c=>s("security","approvalTimeoutMs",Number(c.target.value)*1e3)})}),i.jsx(Pe,{label:"Extension ID",help:"Chrome extension ID for origin validation. Leave blank to accept any extension.",children:i.jsx("input",{type:"text",className:"input input-bordered input-sm w-full",placeholder:"Leave blank for any",value:e.security.extensionId,onChange:c=>s("security","extensionId",c.target.value)})})]})}function Gx({config:e,actions:t}){const{addToArray:n,removeFromArray:s}=t,[r,a]=b.useState("");return i.jsxs(bs,{title:"Connector Sources",description:"Directories to scan for connector YAML files",children:[i.jsx("div",{className:"space-y-1",children:e.connectors.paths.map((o,l)=>i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"font-mono text-sm flex-1",children:o}),i.jsx("button",{className:"btn btn-xs btn-ghost opacity-50 hover:opacity-100",onClick:()=>s("connectors","paths",o),children:"×"})]},l))}),i.jsxs("div",{className:"flex gap-1 mt-2",children:[i.jsx("input",{type:"text",className:"input input-bordered input-xs flex-1 font-mono",placeholder:"~/path/to/connectors",value:r,onChange:o=>a(o.target.value),onKeyDown:o=>{o.key==="Enter"&&r.trim()&&(n("connectors","paths",r.trim()),a(""))}}),i.jsx("button",{className:"btn btn-xs btn-ghost",onClick:()=>{r.trim()&&(n("connectors","paths",r.trim()),a(""))},children:"Add path"})]}),i.jsxs("p",{className:"text-xs opacity-40 mt-1",children:["Use ",i.jsx("code",{children:"~/"})," for home directory paths. Relative paths resolve from the install directory."]})]})}function qx({config:e,actions:t}){const{updateField:n}=t;return i.jsxs(bs,{title:"Audit & Retention",description:"Audit log storage and cleanup settings",children:[i.jsx(Pe,{label:"Retention Period",help:"Days to keep audit log entries before cleanup",children:i.jsx("input",{type:"number",className:"input input-bordered input-sm w-full",min:1,max:3650,value:e.audit.retentionDays,onChange:s=>n("audit","retentionDays",Number(s.target.value))})}),i.jsx(Pe,{label:"Database Path",help:"Path to the audit SQLite database. Change only if you need a custom location.",children:i.jsx("input",{type:"text",className:"input input-bordered input-sm w-full font-mono opacity-60",value:e.audit.dbPath,onChange:s=>n("audit","dbPath",s.target.value)})})]})}function Yx({config:e,actions:t}){const{updateField:n}=t;return i.jsx(bs,{title:"Output Defaults",description:"Default formatting for CLI output",children:i.jsx(Pe,{label:"Default Output Format",help:"Format used when no --format flag is specified",children:i.jsxs("select",{className:"select select-bordered select-sm w-full",value:e.output.defaultFormat,onChange:s=>n("output","defaultFormat",s.target.value),children:[i.jsx("option",{value:"table",children:"table"}),i.jsx("option",{value:"json",children:"json"}),i.jsx("option",{value:"csv",children:"csv"})]})})})}function Qx(){const[e,t]=b.useState(""),[n,s]=b.useState(""),[r,a]=b.useState(""),[o,l]=b.useState("40"),[c,u]=b.useState(!1),[p,d]=b.useState(!1);b.useEffect(()=>{B.getPreferences().then(x=>{if(!x.ok)return;const y=x.preferences;t(y["journal.author"]??""),s(y["journal.ado_org"]??""),a(y["journal.ado_repos"]??""),l(y["journal.target_hours"]??"40"),u(!0)}).catch(()=>u(!0))},[]);async function f(){await Promise.all([B.setPreference("journal.author",e),B.setPreference("journal.ado_org",n),B.setPreference("journal.ado_repos",r),B.setPreference("journal.target_hours",o)]),d(!0),setTimeout(()=>d(!1),2e3)}return c?i.jsxs(bs,{title:"Journal Settings",description:"Configure your Dev Work Journal data sources",children:[i.jsx(Pe,{label:"Author",help:"Your name or email as it appears in ADO commits (e.g. mun_hong.lee@mercedes-benz.com)",children:i.jsx("input",{type:"text",className:"input input-bordered input-sm w-full",placeholder:"your.name@company.com",value:e,onChange:x=>t(x.target.value)})}),i.jsx(Pe,{label:"ADO Organization",help:"Azure DevOps organization name (e.g. daimler-mic)",children:i.jsx("input",{type:"text",className:"input input-bordered input-sm w-full",placeholder:"daimler-mic",value:n,onChange:x=>s(x.target.value)})}),i.jsx(Pe,{label:"ADO Repos",help:'Comma-separated project/repo pairs (e.g. "mic-dns/mic-dns-api,mic-dns/mic-dns-ui")',children:i.jsx("input",{type:"text",className:"input input-bordered input-sm w-full font-mono",placeholder:"project/repo,project/repo",value:r,onChange:x=>a(x.target.value)})}),i.jsx(Pe,{label:"Weekly Target Hours",help:"Target hours per week for the hours progress bar (default 40)",children:i.jsx("input",{type:"number",className:"input input-bordered input-sm w-20",min:1,max:80,value:o,onChange:x=>l(x.target.value)})}),i.jsxs("div",{className:"flex items-center gap-3 mt-2",children:[i.jsx("button",{className:"btn btn-primary btn-sm",onClick:f,children:"Save Journal Settings"}),p&&i.jsx("span",{className:"text-success text-sm",children:"Saved ✓"})]})]}):null}const Jx=i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.5,strokeLinecap:"round",strokeLinejoin:"round",className:"w-3.5 h-3.5",children:i.jsx("path",{d:"M20 6 9 17l-5-5"})});function Xx(){const[e,t]=b.useState(!1),[n,s]=b.useState(!1),[r,a]=b.useState(0),[o,l]=b.useState([]),[c,u]=b.useState([]),[p,d]=b.useState(null),f=b.useCallback(async()=>{try{const N=await B.getStatus();t(N.ok),s(N.extensionConnected),a(N.connectorCount)}catch{t(!1),s(!1),a(0)}try{const N=await B.getConnectors();l(N.connectors);const S=(await B.getConfig().catch(()=>({ok:!1,config:{}}))).config.security??{};u(S.approvedHighRisk??[])}catch{}},[]);b.useEffect(()=>{f();const N=setInterval(f,1e4);return()=>clearInterval(N)},[f]);const x=b.useCallback(async N=>{d(N);try{const C=[...c,N];await B.setConfig("security.approvedHighRisk",JSON.stringify(C)),f()}catch{}finally{d(null)}},[c,f]),y=o.filter(N=>N.isHighRisk&&!N.isApproved),v=y.length>0,w=[{id:"daemon",label:"Background service",ok:e,detail:e?"Running":"Not running",instructions:"Run cg up in your terminal to start commandGarden. This launches the background service and opens the web interface."},{id:"extension",label:"Browser extension",ok:n,detail:n?"Connected":"Not connected",instructions:"Install the commandGarden Chrome extension, then open Chrome. The extension connects automatically when the background service is running."},{id:"connectors",label:"Connectors installed",ok:r>0,detail:r>0?`${r} available`:"None found",instructions:"Connectors are loaded automatically when you start the service. If none appear, check that connector files exist in ~/.commandgarden/connectors/ and restart with cg up."}];v&&w.push({id:"permissions",label:"Connector permissions",ok:!1,detail:`${y.length} need${y.length===1?"s":""} authorization`,instructions:"Some connectors need authorization before first use. You can authorize them here or in Configuration → Connector Security."});const g=w.filter(N=>N.ok).length,h=w.length,m=g===h,j=b.useMemo(()=>ma(o),[o]);return i.jsxs("div",{className:"max-w-3xl mx-auto",children:[i.jsx("h2",{className:"font-display text-xl font-bold uppercase tracking-[0.06em] mb-1",children:"Setup Guide"}),i.jsx("p",{className:"text-sm opacity-60 mb-6",children:"Complete these steps to start running connectors from your browser."}),i.jsxs("div",{className:"flex items-center gap-3 mb-6",children:[i.jsx("div",{className:"flex-1 h-1.5 bg-base-300 overflow-hidden",children:i.jsx("div",{className:"h-full bg-success transition-all duration-300 ease-out",style:{width:`${h>0?g/h*100:0}%`}})}),i.jsxs("span",{className:"font-mono text-xs opacity-50 shrink-0",children:[g,"/",h]})]}),i.jsx("div",{className:"space-y-3 mb-8",children:w.map((N,C)=>i.jsxs("div",{className:`border ${N.ok?"border-base-300":"border-base-300 bg-base-200/50"}`,children:[i.jsxs("div",{className:"p-4 flex items-center gap-3",children:[i.jsx("span",{className:`w-5 h-5 flex items-center justify-center font-mono text-xs font-bold shrink-0 ${N.ok?"bg-success text-success-content":"border border-base-300 text-base-content/50"}`,children:N.ok?Jx:C+1}),i.jsx("span",{className:"font-semibold flex-1",children:N.label}),i.jsx(H,{variant:N.ok?"success":"warning",children:N.detail})]}),!N.ok&&i.jsxs("div",{className:"px-4 pb-4 text-sm opacity-70 border-t border-base-300/50 pt-3 ml-8",children:[N.instructions,N.id==="permissions"&&y.length>0&&i.jsx("div",{className:"mt-3 space-y-2",children:y.map(S=>i.jsxs("div",{className:"flex items-center justify-between gap-3 py-1.5",children:[i.jsxs("div",{children:[i.jsx("span",{className:"font-mono text-sm",children:S.key}),S.description&&i.jsx("span",{className:"text-xs opacity-50 ml-2",children:S.description})]}),i.jsx("button",{className:"btn btn-sm btn-warning btn-outline shrink-0",disabled:p===S.key,onClick:()=>x(S.key),children:p===S.key?"Authorizing…":"Authorize"})]},S.key))})]})]},C))}),m&&o.length>0&&i.jsxs("div",{className:"border border-success/30 bg-success/5 p-5",children:[i.jsx("p",{className:"font-semibold text-success mb-3",children:"Everything's ready. Pick a connector to try."}),i.jsx("div",{className:"space-y-3",children:j.map(([N,C])=>i.jsxs("div",{children:[i.jsx("span",{className:"font-mono font-semibold text-sm",children:N}),i.jsx("div",{className:"flex flex-wrap gap-2 mt-1",children:C.map(S=>{const k=S.key.split("/")[1];return i.jsx(xe,{to:`/connectors/${N}/${k}`,className:"btn btn-sm btn-outline",children:i.jsx("span",{className:"font-mono",children:k})},S.key)})})]},N))})]}),!m&&o.length>0&&i.jsxs("div",{className:"border-t border-base-300 pt-6",children:[i.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.12em] mb-4",children:"Installed connectors"}),i.jsx("div",{className:"space-y-4",children:j.map(([N,C])=>i.jsxs("div",{children:[i.jsx("div",{className:"font-mono font-semibold text-sm mb-1.5",children:N}),i.jsx("div",{className:"space-y-1",children:C.map(S=>{const k=S.key.split("/")[1];return i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-baseline gap-2",children:[i.jsx("span",{className:"font-mono text-sm",children:k}),i.jsx(H,{size:"xs",children:S.access})]}),S.description&&i.jsx("div",{className:"text-xs opacity-40 mb-1",children:S.description})]},S.key)})})]},N))}),i.jsx(xe,{to:"/connectors",className:"inline-flex items-center gap-1 font-mono text-xs mt-5 opacity-50 hover:opacity-80 transition-opacity",children:"View all connectors →"})]})]})}function wn({message:e}){return i.jsx("div",{role:"alert",className:"alert alert-warning",children:i.jsx("span",{children:e??"Sign in to the target app in Chrome, then try again."})})}function Em(e){const t=e.getDay();return t!==0&&t!==6}function Zx(e){const[t,n]=e.split("-").map(Number),s=new Date(t,n,0).getDate();let r=0;for(let a=1;a<=s;a++)Em(new Date(t,n-1,a))&&r++;return r}function ev(e,t){const[n,s]=e.split("-").map(Number),r=new Date(t+"T00:00:00"),a=new Date(n,s,0),o=r>a?a:r;let l=0;for(let c=1;c<=o.getDate();c++){const u=new Date(n,s-1,c);if(u>o)break;Em(u)&&l++}return l}function tv(e){const{targetHours:t,actualHours:n,month:s,today:r}=e,a=Zx(s),o=ev(s,r),l=a-o,c=t>0?n/t*100:0,u=Math.max(0,(t-n)/8);if(n>=t)return{status:"reached",percentage:c,daysRemaining:0,hoursPerDayNeeded:0,workingDaysTotal:a,workingDaysElapsed:o,workingDaysRemaining:l};const p=a>0?t/a*o:0,d=l>0?Math.max(0,(t-n)/l):0;let f;return n>=p?f="on_track":a>0&&o/a<.8?f="behind":f="at_risk",{status:f,percentage:c,daysRemaining:u,hoursPerDayNeeded:d,workingDaysTotal:a,workingDaysElapsed:o,workingDaysRemaining:l}}const nv={reached:"bg-success",on_track:"bg-success",behind:"bg-warning",at_risk:"bg-error"};function sv({percentage:e,status:t,className:n=""}){const s=Math.min(100,Math.max(0,e));return i.jsx("div",{className:`h-2 bg-base-300 ${n}`,children:i.jsx("div",{className:`h-full ${nv[t]} transition-[width] duration-150`,style:{width:`${s}%`}})})}/**
198
+ * @license lucide-react v1.23.0 - ISC
199
+ *
200
+ * This source code is licensed under the ISC license.
201
+ * See the LICENSE file in the root directory of this source tree.
202
+ */const Tm=(...e)=>e.filter((t,n,s)=>!!t&&t.trim()!==""&&s.indexOf(t)===n).join(" ").trim();/**
203
+ * @license lucide-react v1.23.0 - ISC
204
+ *
205
+ * This source code is licensed under the ISC license.
206
+ * See the LICENSE file in the root directory of this source tree.
207
+ */const rv=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
208
+ * @license lucide-react v1.23.0 - ISC
209
+ *
210
+ * This source code is licensed under the ISC license.
211
+ * See the LICENSE file in the root directory of this source tree.
212
+ */const iv=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,s)=>s?s.toUpperCase():n.toLowerCase());/**
213
+ * @license lucide-react v1.23.0 - ISC
214
+ *
215
+ * This source code is licensed under the ISC license.
216
+ * See the LICENSE file in the root directory of this source tree.
217
+ */const nd=e=>{const t=iv(e);return t.charAt(0).toUpperCase()+t.slice(1)};/**
218
+ * @license lucide-react v1.23.0 - ISC
219
+ *
220
+ * This source code is licensed under the ISC license.
221
+ * See the LICENSE file in the root directory of this source tree.
222
+ */var no={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
223
+ * @license lucide-react v1.23.0 - ISC
224
+ *
225
+ * This source code is licensed under the ISC license.
226
+ * See the LICENSE file in the root directory of this source tree.
227
+ */const av=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1},ov=b.createContext({}),lv=()=>b.useContext(ov),cv=b.forwardRef(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:s,className:r="",children:a,iconNode:o,...l},c)=>{const{size:u=24,strokeWidth:p=2,absoluteStrokeWidth:d=!1,color:f="currentColor",className:x=""}=lv()??{},y=s??d?Number(n??p)*24/Number(t??u):n??p;return b.createElement("svg",{ref:c,...no,width:t??u??no.width,height:t??u??no.height,stroke:e??f,strokeWidth:y,className:Tm("lucide",x,r),...!a&&!av(l)&&{"aria-hidden":"true"},...l},[...o.map(([v,w])=>b.createElement(v,w)),...Array.isArray(a)?a:[a]])});/**
228
+ * @license lucide-react v1.23.0 - ISC
229
+ *
230
+ * This source code is licensed under the ISC license.
231
+ * See the LICENSE file in the root directory of this source tree.
232
+ */const q=(e,t)=>{const n=b.forwardRef(({className:s,...r},a)=>b.createElement(cv,{ref:a,iconNode:t,className:Tm(`lucide-${rv(nd(e))}`,`lucide-${e}`,s),...r}));return n.displayName=nd(e),n};/**
233
+ * @license lucide-react v1.23.0 - ISC
234
+ *
235
+ * This source code is licensed under the ISC license.
236
+ * See the LICENSE file in the root directory of this source tree.
237
+ */const uv=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],He=q("arrow-right",uv);/**
238
+ * @license lucide-react v1.23.0 - ISC
239
+ *
240
+ * This source code is licensed under the ISC license.
241
+ * See the LICENSE file in the root directory of this source tree.
242
+ */const dv=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],fv=q("book-open",dv);/**
243
+ * @license lucide-react v1.23.0 - ISC
244
+ *
245
+ * This source code is licensed under the ISC license.
246
+ * See the LICENSE file in the root directory of this source tree.
247
+ */const pv=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],mv=q("circle-alert",pv);/**
248
+ * @license lucide-react v1.23.0 - ISC
249
+ *
250
+ * This source code is licensed under the ISC license.
251
+ * See the LICENSE file in the root directory of this source tree.
252
+ */const hv=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],gv=q("circle-check-big",hv);/**
253
+ * @license lucide-react v1.23.0 - ISC
254
+ *
255
+ * This source code is licensed under the ISC license.
256
+ * See the LICENSE file in the root directory of this source tree.
257
+ */const yv=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Am=q("circle-check",yv);/**
258
+ * @license lucide-react v1.23.0 - ISC
259
+ *
260
+ * This source code is licensed under the ISC license.
261
+ * See the LICENSE file in the root directory of this source tree.
262
+ */const xv=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],vv=q("circle-x",xv);/**
263
+ * @license lucide-react v1.23.0 - ISC
264
+ *
265
+ * This source code is licensed under the ISC license.
266
+ * See the LICENSE file in the root directory of this source tree.
267
+ */const bv=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]],Lm=q("clock",bv);/**
268
+ * @license lucide-react v1.23.0 - ISC
269
+ *
270
+ * This source code is licensed under the ISC license.
271
+ * See the LICENSE file in the root directory of this source tree.
272
+ */const jv=[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]],wv=q("code-xml",jv);/**
273
+ * @license lucide-react v1.23.0 - ISC
274
+ *
275
+ * This source code is licensed under the ISC license.
276
+ * See the LICENSE file in the root directory of this source tree.
277
+ */const Nv=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],sd=q("database",Nv);/**
278
+ * @license lucide-react v1.23.0 - ISC
279
+ *
280
+ * This source code is licensed under the ISC license.
281
+ * See the LICENSE file in the root directory of this source tree.
282
+ */const kv=[["path",{d:"M11 20H2",key:"nlcfvz"}],["path",{d:"M11 4.562v16.157a1 1 0 0 0 1.242.97L19 20V5.562a2 2 0 0 0-1.515-1.94l-4-1A2 2 0 0 0 11 4.561z",key:"au4z13"}],["path",{d:"M11 4H8a2 2 0 0 0-2 2v14",key:"74r1mk"}],["path",{d:"M14 12h.01",key:"1jfl7z"}],["path",{d:"M22 20h-3",key:"vhrsz"}]],Sv=q("door-open",kv);/**
283
+ * @license lucide-react v1.23.0 - ISC
284
+ *
285
+ * This source code is licensed under the ISC license.
286
+ * See the LICENSE file in the root directory of this source tree.
287
+ */const Cv=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Im=q("eye",Cv);/**
288
+ * @license lucide-react v1.23.0 - ISC
289
+ *
290
+ * This source code is licensed under the ISC license.
291
+ * See the LICENSE file in the root directory of this source tree.
292
+ */const Ev=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],so=q("file-text",Ev);/**
293
+ * @license lucide-react v1.23.0 - ISC
294
+ *
295
+ * This source code is licensed under the ISC license.
296
+ * See the LICENSE file in the root directory of this source tree.
297
+ */const Tv=[["path",{d:"M12 10a2 2 0 0 0-2 2c0 1.02-.1 2.51-.26 4",key:"1nerag"}],["path",{d:"M14 13.12c0 2.38 0 6.38-1 8.88",key:"o46ks0"}],["path",{d:"M17.29 21.02c.12-.6.43-2.3.5-3.02",key:"ptglia"}],["path",{d:"M2 12a10 10 0 0 1 18-6",key:"ydlgp0"}],["path",{d:"M2 16h.01",key:"1gqxmh"}],["path",{d:"M21.8 16c.2-2 .131-5.354 0-6",key:"drycrb"}],["path",{d:"M5 19.5C5.5 18 6 15 6 12a6 6 0 0 1 .34-2",key:"1tidbn"}],["path",{d:"M8.65 22c.21-.66.45-1.32.57-2",key:"13wd9y"}],["path",{d:"M9 6.8a6 6 0 0 1 9 5.2v2",key:"1fr1j5"}]],Av=q("fingerprint-pattern",Tv);/**
298
+ * @license lucide-react v1.23.0 - ISC
299
+ *
300
+ * This source code is licensed under the ISC license.
301
+ * See the LICENSE file in the root directory of this source tree.
302
+ */const Lv=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],ei=q("globe",Lv);/**
303
+ * @license lucide-react v1.23.0 - ISC
304
+ *
305
+ * This source code is licensed under the ISC license.
306
+ * See the LICENSE file in the root directory of this source tree.
307
+ */const Iv=[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]],Ov=q("key-round",Iv);/**
308
+ * @license lucide-react v1.23.0 - ISC
309
+ *
310
+ * This source code is licensed under the ISC license.
311
+ * See the LICENSE file in the root directory of this source tree.
312
+ */const Pv=[["path",{d:"m16 6 4 14",key:"ji33uf"}],["path",{d:"M12 6v14",key:"1n7gus"}],["path",{d:"M8 8v12",key:"1gg7y9"}],["path",{d:"M4 4v16",key:"6qkkli"}]],_v=q("library",Pv);/**
313
+ * @license lucide-react v1.23.0 - ISC
314
+ *
315
+ * This source code is licensed under the ISC license.
316
+ * See the LICENSE file in the root directory of this source tree.
317
+ */const Mv=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],Om=q("lock",Mv);/**
318
+ * @license lucide-react v1.23.0 - ISC
319
+ *
320
+ * This source code is licensed under the ISC license.
321
+ * See the LICENSE file in the root directory of this source tree.
322
+ */const Dv=[["path",{d:"M15 18h-5",key:"95g1m2"}],["path",{d:"M18 14h-8",key:"sponae"}],["path",{d:"M4 22h16a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2H8a2 2 0 0 0-2 2v16a2 2 0 0 1-4 0v-9a2 2 0 0 1 2-2h2",key:"39pd36"}],["rect",{width:"8",height:"4",x:"10",y:"6",rx:"1",key:"aywv1n"}]],$v=q("newspaper",Dv);/**
323
+ * @license lucide-react v1.23.0 - ISC
324
+ *
325
+ * This source code is licensed under the ISC license.
326
+ * See the LICENSE file in the root directory of this source tree.
327
+ */const Rv=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M9 21V9",key:"1oto5p"}]],zv=q("panels-top-left",Rv);/**
328
+ * @license lucide-react v1.23.0 - ISC
329
+ *
330
+ * This source code is licensed under the ISC license.
331
+ * See the LICENSE file in the root directory of this source tree.
332
+ */const Fv=[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]],Bv=q("scroll-text",Fv);/**
333
+ * @license lucide-react v1.23.0 - ISC
334
+ *
335
+ * This source code is licensed under the ISC license.
336
+ * See the LICENSE file in the root directory of this source tree.
337
+ */const Uv=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],ul=q("server",Uv);/**
338
+ * @license lucide-react v1.23.0 - ISC
339
+ *
340
+ * This source code is licensed under the ISC license.
341
+ * See the LICENSE file in the root directory of this source tree.
342
+ */const Wv=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]],Hv=q("shield-alert",Wv);/**
343
+ * @license lucide-react v1.23.0 - ISC
344
+ *
345
+ * This source code is licensed under the ISC license.
346
+ * See the LICENSE file in the root directory of this source tree.
347
+ */const Vv=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Kv=q("shield-check",Vv);/**
348
+ * @license lucide-react v1.23.0 - ISC
349
+ *
350
+ * This source code is licensed under the ISC license.
351
+ * See the LICENSE file in the root directory of this source tree.
352
+ */const Gv=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]],qv=q("shield",Gv);/**
353
+ * @license lucide-react v1.23.0 - ISC
354
+ *
355
+ * This source code is licensed under the ISC license.
356
+ * See the LICENSE file in the root directory of this source tree.
357
+ */const Yv=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],ro=q("terminal",Yv);/**
358
+ * @license lucide-react v1.23.0 - ISC
359
+ *
360
+ * This source code is licensed under the ISC license.
361
+ * See the LICENSE file in the root directory of this source tree.
362
+ */const Qv=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],Jv=q("trending-up",Qv);/**
363
+ * @license lucide-react v1.23.0 - ISC
364
+ *
365
+ * This source code is licensed under the ISC license.
366
+ * See the LICENSE file in the root directory of this source tree.
367
+ */const Xv=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Zv=q("triangle-alert",Xv),e1={reached:gv,on_track:Jv,behind:Lm,at_risk:Zv},t1={reached:"text-success",on_track:"text-success",behind:"text-warning",at_risk:"text-error"},n1={reached:"bg-success/10",on_track:"bg-success/5",behind:"bg-warning/10",at_risk:"bg-error/10"};function s1(e,t,n){const s=n.find(r=>r.projectId===e&&r.activity===t);return(s==null?void 0:s.totalHours)??0}function r1({goals:e,activityHours:t,projectNames:n,activityNames:s,month:r,today:a}){return e.length===0?null:i.jsx("div",{className:"border border-base-300",children:e.map((o,l)=>{const c=s1(o.projectId,o.activity,t),u=tv({targetHours:o.targetHours,actualHours:c,month:r,today:a}),p=n.get(o.projectId),d=e1[u.status];return i.jsxs("div",{className:`grid grid-cols-[auto_1fr_auto_1fr] gap-0 ${n1[u.status]} ${l>0?"border-t border-base-300":""}`,children:[i.jsx("div",{className:"p-3 border-r border-base-300 flex items-center justify-center",children:i.jsx(d,{size:18,className:t1[u.status]})}),i.jsxs("div",{className:"p-3 border-r border-base-300",children:[i.jsx("div",{className:"font-display font-semibold text-sm",children:p??o.projectId}),i.jsxs("div",{className:"font-mono text-[0.6rem] opacity-50 mt-0.5",children:[p?`${o.projectId} · `:"",s.get(`${o.projectId}\0${o.activity}`)??o.activity]})]}),i.jsxs("div",{className:"p-3 border-r border-base-300 text-right min-w-[7rem]",children:[i.jsxs("div",{className:"font-display font-semibold text-sm",children:[Math.round(c*10)/10,"/",o.targetHours,"h"]}),i.jsxs("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mt-0.5",children:[o.targetDays,"d target"]})]}),i.jsxs("div",{className:"p-3",children:[i.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[i.jsx(sv,{percentage:u.percentage,status:u.status,className:"flex-1"}),i.jsxs("span",{className:"font-mono text-xs font-medium min-w-[3rem] text-right",children:[Math.round(u.percentage),"%"]})]}),u.status==="reached"?i.jsx("div",{className:"font-mono text-[0.6rem] font-medium text-success uppercase tracking-[0.1em]",children:"Goal reached"}):i.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em]",children:u.workingDaysRemaining>0?`Book ${Math.round(u.hoursPerDayNeeded*10)/10}h/day · ${u.workingDaysRemaining} days left`:`${Math.round(u.daysRemaining*10)/10} days remaining`})]})]},o.id)})})}function i1({goals:e,month:t,onGoalChange:n,knownCombos:s,projectNames:r,activityNames:a,onRefreshProjects:o,refreshingProjects:l}){const[c,u]=b.useState(""),[p,d]=b.useState(""),[f,x]=b.useState(null),[y,v]=b.useState(""),[w,g]=b.useState(!1),h=b.useMemo(()=>{const T=new Set(e.map(L=>`${L.projectId}\0${L.activity}`));return s.filter(L=>!T.has(`${L.projectId}\0${L.activity}`))},[s,e]);function m(T){const L=T.indexOf("\0");return L<0?null:{projectId:T.slice(0,L),activity:T.slice(L+1)}}function j(T){return r.get(T)??T}function N(T,L){const O=a.get(`${T}\0${L}`);return O?`${j(T)} / ${O}`:`${j(T)} / ${L}`}async function C(){const T=m(c),L=parseFloat(p);if(!(!T||isNaN(L)||L<.5||L>31)){g(!0);try{await B.upsertGoal({month:t,projectId:T.projectId,activity:T.activity,targetDays:L}),u(""),d(""),n()}finally{g(!1)}}}async function S(T){g(!0);try{await B.deleteGoal(T),n()}finally{g(!1)}}async function k(T){const L=parseFloat(y);if(isNaN(L)||L<.5||L>31){x(null);return}g(!0);try{await B.upsertGoal({month:T.month,projectId:T.projectId,activity:T.activity,targetDays:L}),x(null),n()}finally{g(!1)}}return i.jsxs("details",{children:[i.jsxs("summary",{className:"cursor-pointer text-sm font-semibold mb-2",children:["Manage goals (",e.length,")"]}),i.jsxs("div",{className:"mt-2 space-y-3",children:[e.length>0&&i.jsx("div",{className:"overflow-x-auto border border-base-300",children:i.jsxs("table",{className:"table table-xs",children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("th",{children:"Project"}),i.jsx("th",{children:"Activity"}),i.jsx("th",{className:"text-right",children:"Target (days)"}),i.jsx("th",{className:"text-right",children:"Target (hours)"}),i.jsx("th",{children:"Actions"})]})}),i.jsx("tbody",{children:e.map(T=>i.jsxs("tr",{children:[i.jsxs("td",{children:[i.jsx("div",{className:"text-sm",children:j(T.projectId)}),r.has(T.projectId)&&i.jsx("div",{className:"font-mono text-[0.6rem] opacity-50",children:T.projectId})]}),i.jsxs("td",{children:[i.jsx("div",{className:"text-sm",children:a.get(`${T.projectId}\0${T.activity}`)??T.activity}),i.jsx("div",{className:"font-mono text-[0.6rem] opacity-50",children:T.activity})]}),i.jsx("td",{className:"text-right",children:f===T.id?i.jsx("input",{type:"number",step:"0.5",className:"input input-bordered input-xs w-20 text-right",value:y,onChange:L=>v(L.target.value),onBlur:()=>k(T),onKeyDown:L=>{L.key==="Enter"&&k(T),L.key==="Escape"&&x(null)},autoFocus:!0}):T.targetDays}),i.jsx("td",{className:"text-right",children:T.targetHours}),i.jsxs("td",{className:"flex gap-1",children:[i.jsx("button",{className:"btn btn-ghost btn-xs font-mono",onClick:()=>{x(T.id),v(String(T.targetDays))},disabled:w,"aria-label":`Edit goal ${T.projectId} ${T.activity}`,children:"Edit"}),i.jsx("button",{className:"btn btn-ghost btn-xs text-error font-mono",onClick:()=>S(T.id),disabled:w,"aria-label":`Delete goal ${T.projectId} ${T.activity}`,children:"Del"})]})]},T.id))})]})}),i.jsxs("div",{className:"flex items-end gap-2",children:[i.jsxs("select",{className:"select select-bordered select-sm",value:c,onChange:T=>u(T.target.value),children:[i.jsx("option",{value:"",children:"Select project / activity…"}),h.map(T=>i.jsx("option",{value:`${T.projectId}\0${T.activity}`,children:N(T.projectId,T.activity)},`${T.projectId}\0${T.activity}`))]}),i.jsx("input",{type:"number",step:"0.5",min:"0.5",max:"31",placeholder:"Days",className:"input input-bordered input-sm w-24",value:p,onChange:T=>d(T.target.value)}),i.jsx("button",{className:"btn btn-primary btn-sm",onClick:C,disabled:w||!c,children:"Add"}),i.jsx("button",{className:"btn btn-ghost btn-sm font-mono text-xs opacity-60",onClick:o,disabled:l,children:l?"Refreshing…":"Refresh projects"})]})]})]})}function a1(e,t){var F;const[n,s]=b.useState([]),[r,a]=b.useState([]),[o,l]=b.useState(null),[c,u]=b.useState([]),p=b.useRef(c);p.current=c;const[d,f]=b.useState(!1),x=b.useCallback(async()=>{try{const E=await B.getGoals(e);s(E.goals)}catch{}},[e]),y=b.useCallback(async()=>{try{const E=await B.getCachedReport(e);E.data?(a(E.data),l(E.fetchedAt)):(a([]),l(null))}catch{}},[e]),v=b.useCallback(async()=>{try{const E=await B.getCachedProjects();E.data&&u(E.data)}catch{}},[]),w=b.useCallback(async()=>{f(!0);try{const E=await B.run("timetracking/projects",{month:e});if(E.ok&&E.data&&E.data.length>0){const D=E.data.map(P=>({projectId:String(P.projectId??""),projectName:String(P.projectName??""),activityNumber:String(P.activityNumber??""),activityName:String(P.activityName??""),category:String(P.category??""),linePropertyId:String(P.linePropertyId??"")}));u(D),await B.cacheProjects(D)}}catch{}f(!1)},[e]);b.useEffect(()=>{x(),y(),v()},[x,y,v]);const g=t==null?void 0:t.data;b.useEffect(()=>{if(g&&g.length>0){l(null),B.cacheReport(e,g).catch(()=>{});const E=new Set,D=[];for(const P of g){const R=String(P.projectId??""),A=String(P.activity??"");if(!R||!A)continue;const _=`${R}\0${A}`;E.has(_)||(E.add(_),D.push({projectId:R,projectName:P.projectName?String(P.projectName):R,activityNumber:A,activityName:P.activityName?String(P.activityName):A,category:String(P.category??""),linePropertyId:""}))}if(D.length>0){const P=new Map;for(const A of p.current)P.set(`${A.projectId}\0${A.activityNumber}`,A);for(const A of D)P.set(`${A.projectId}\0${A.activityNumber}`,A);const R=Array.from(P.values());u(R),B.cacheProjects(R).catch(()=>{})}}},[g,e]);const h=((t==null?void 0:t.data)??[]).length>0?(t==null?void 0:t.data)??[]:r,m=h===r&&r.length>0&&!((F=t==null?void 0:t.data)!=null&&F.length),{projectNames:j,activityNames:N}=b.useMemo(()=>{const E=new Map,D=new Map;for(const P of c)P.projectId&&P.projectName&&E.set(P.projectId,P.projectName),P.projectId&&P.activityNumber&&P.activityName&&D.set(`${P.projectId}\0${P.activityNumber}`,P.activityName);for(const P of h){const R=String(P.projectId??""),A=P.projectName?String(P.projectName):null;R&&A&&E.set(R,A);const _=String(P.activity??""),$=P.activityName?String(P.activityName):null;R&&_&&$&&D.set(`${R}\0${_}`,$)}return{projectNames:E,activityNames:D}},[c,h]),{projectList:C,totalHours:S,draftCount:k,workingDayCount:T}=b.useMemo(()=>{const E=new Map;let D=0,P=0;const R=new Set;for(const A of h){const _=String(A.projectId??"Unknown"),$=Number(A.hours??0),z=String(A.date??""),J=String(A.status??""),$e=String(A.activity??"");D+=$,z&&R.add(z),J==="draft"&&P++,E.has(_)||E.set(_,{projectId:_,totalHours:0,entryCount:0,activities:new Set});const et=E.get(_);if(et.totalHours+=$,et.entryCount++,$e){const js=N.get(`${_}\0${$e}`)??$e;et.activities.add(js)}}return{projectList:Array.from(E.values()).sort((A,_)=>_.totalHours-A.totalHours),totalHours:D,draftCount:P,workingDayCount:R.size}},[h,N]),L=b.useMemo(()=>{const E=new Map;for(const D of h){const P=String(D.projectId??"Unknown"),R=String(D.activity??""),A=Number(D.hours??0),_=`${P}\0${R}`,$=E.get(_);$?$.totalHours+=A:E.set(_,{projectId:P,activity:R,totalHours:A})}return Array.from(E.values())},[h]),O=b.useMemo(()=>c.length>0?c.map(E=>({projectId:E.projectId,activity:E.activityNumber})):L.map(E=>({projectId:E.projectId,activity:E.activity})),[c,L]),U=new Date().toISOString().slice(0,10);return{goals:n,loadGoals:x,rows:h,isCached:m,cachedAt:o,projectNames:j,activityNames:N,projectList:C,totalHours:S,draftCount:k,workingDayCount:T,activityHours:L,allCombos:O,todayStr:U,refreshProjects:w,refreshingProjects:d}}function o1(){const e=new Date;return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}`}function l1(e){const t=Date.now()-new Date(e).getTime(),n=Math.floor(t/6e4);if(n<1)return"just now";if(n<60)return`${n}m ago`;const s=Math.floor(n/60);return s<24?`${s}h ago`:`${Math.floor(s/24)}d ago`}function c1(){const[e,t]=b.useState(o1()),[n,s]=b.useState(!1),{running:r,result:a,error:o,approvalPending:l,approvalId:c,run:u,handleApproval:p,reset:d}=yr(),{goals:f,loadGoals:x,rows:y,isCached:v,cachedAt:w,projectNames:g,activityNames:h,projectList:m,totalHours:j,draftCount:N,workingDayCount:C,activityHours:S,allCombos:k,todayStr:T,refreshProjects:L,refreshingProjects:O}=a1(e,a),U=(o==null?void 0:o.includes("auth_required"))||(o==null?void 0:o.includes("sign in")),F=b.useCallback(async()=>{const E={};e&&(E.month=e),await u("timetracking/report",E),await x()},[e,u,x]);return i.jsxs("div",{className:"max-w-4xl mx-auto",children:[i.jsx("h2",{className:"font-display text-xl font-bold uppercase tracking-[0.06em] mb-5",children:"Time Tracking"}),i.jsxs("div",{className:"flex items-end gap-4 mb-6",children:[i.jsxs("label",{className:"form-control",children:[i.jsx("span",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Month"}),i.jsx("input",{type:"month",className:"input input-bordered input-sm",value:e,onChange:E=>{t(E.target.value),d()},onClick:E=>{var D,P;return(P=(D=E.target).showPicker)==null?void 0:P.call(D)}})]}),i.jsx("button",{className:"btn btn-primary btn-sm",onClick:F,disabled:r,children:r?"Loading...":"Load report"})]}),r&&!l&&i.jsx(ut,{label:"Fetching timetracking data..."}),l&&i.jsxs("div",{className:"alert alert-warning mb-4",children:[i.jsx("span",{children:"This connector requires approval before proceeding."}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx("button",{className:"btn btn-sm btn-success",onClick:()=>p(!0),disabled:!c,children:"Approve"}),i.jsx("button",{className:"btn btn-sm btn-error",onClick:()=>p(!1),disabled:!c,children:"Reject"})]})]}),U&&i.jsx(wn,{message:"Sign in to the timetracking portal in Chrome, then try again."}),o&&!U&&i.jsx("div",{className:"alert alert-error mb-4",children:i.jsx("span",{children:o})}),y.length>0&&i.jsxs(i.Fragment,{children:[v&&w&&i.jsxs("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-2",children:["Showing cached data from ",l1(w)]}),i.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 border border-base-300 mb-6",children:[i.jsxs("div",{className:"p-3 border-r border-b border-base-300 md:border-b-0",children:[i.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Total hours"}),i.jsx("div",{className:"font-display text-xl font-bold",children:j.toFixed(1)})]}),i.jsxs("div",{className:"p-3 border-b border-base-300 md:border-r md:border-b-0",children:[i.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Working days"}),i.jsx("div",{className:"font-display text-xl font-bold",children:C})]}),i.jsxs("div",{className:"p-3 border-r border-base-300",children:[i.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Projects"}),i.jsx("div",{className:"font-display text-xl font-bold",children:m.length})]}),i.jsxs("div",{className:"p-3",children:[i.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Draft entries"}),i.jsx("div",{className:"font-display text-xl font-bold",children:N})]})]}),i.jsx("h3",{className:"font-display text-base font-semibold mb-3",children:"By project"}),i.jsx("div",{className:"overflow-x-auto border border-base-300 mb-6",children:i.jsxs("table",{className:"table table-sm",children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("th",{children:"Project"}),i.jsx("th",{children:"Activities"}),i.jsx("th",{className:"text-right",children:"Hours"}),i.jsx("th",{className:"text-right",children:"Entries"})]})}),i.jsx("tbody",{children:m.map(E=>i.jsxs("tr",{children:[i.jsx("td",{children:g.has(E.projectId)?i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"text-sm",children:g.get(E.projectId)}),i.jsx("div",{className:"font-mono text-[0.6rem] opacity-50",children:E.projectId})]}):i.jsx("span",{className:"font-mono text-sm",children:E.projectId})}),i.jsx("td",{className:"text-sm",children:Array.from(E.activities).join(", ")}),i.jsx("td",{className:"text-right font-semibold",children:E.totalHours.toFixed(1)}),i.jsx("td",{className:"text-right",children:E.entryCount})]},E.projectId))})]})}),i.jsxs("details",{open:n,onToggle:E=>s(E.target.open),children:[i.jsxs("summary",{className:"cursor-pointer text-sm font-semibold mb-2",children:["Raw booking lines (",y.length,")"]}),i.jsx("div",{className:"overflow-x-auto",children:i.jsxs("table",{className:"table table-xs",children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("th",{children:"Date"}),i.jsx("th",{children:"Project"}),i.jsx("th",{children:"Activity"}),i.jsx("th",{className:"text-right",children:"Hours"}),i.jsx("th",{children:"Status"})]})}),i.jsx("tbody",{children:y.map((E,D)=>i.jsxs("tr",{children:[i.jsx("td",{children:String(E.date??"")}),i.jsx("td",{className:"font-mono text-xs",children:String(E.projectId??"")}),i.jsx("td",{children:String(E.activity??"")}),i.jsx("td",{className:"text-right",children:Number(E.hours??0).toFixed(1)}),i.jsx("td",{children:i.jsx(H,{variant:String(E.status)==="posted"?"success":"warning",size:"xs",children:String(E.status??"")})})]},D))})]})})]})]}),a&&(a.data??[]).length===0&&y.length===0&&!o&&i.jsxs("p",{className:"text-sm opacity-50",children:["No entries found for ",e,"."]}),f.length>0&&i.jsxs("div",{className:"mb-6",children:[i.jsx("h3",{className:"font-display text-base font-semibold mb-3",children:"Goal progress"}),i.jsx(r1,{goals:f,activityHours:S,projectNames:g,activityNames:h,month:e,today:T})]}),i.jsx("div",{className:"mt-6",children:i.jsx(i1,{goals:f,month:e,onGoalChange:x,knownCombos:k,projectNames:g,activityNames:h,onRefreshProjects:L,refreshingProjects:O})})]})}const Pm={"MBTMY THE BASE CAMP":"res-rere-m6vz23ty@mercedes-benz.com","MBTMY THE TRAILHEAD":"res-rere-m6vc2q4d@mercedes-benz.com","MBTMY THE FOOTHILLS":"res-rere-m6vcb79c@mercedes-benz.com","MBTMY THE BRIDGE":"res-rere-m6vgcah6@mercedes-benz.com","MBTMY THE RIDGE":"res-rere-m6vjxdkc@mercedes-benz.com","MBTMY THE MEADOW":"res-rere-m6vhkzmd@mercedes-benz.com","MBTMY THE FOREST":"res-rere-m6vhsc6h@mercedes-benz.com","MBTMY THE LOOKOUT":"res-rere-m6vjqgrq@mercedes-benz.com","MBTMY THE CLIFFSIDE":"res-rere-m6vjl2tw@mercedes-benz.com","MBTMY THE LEDGE":"res-rere-m6vjfbmr@mercedes-benz.com","MBTMY THE HIGHPOINT":"res-rere-m6vjblgb@mercedes-benz.com","MBTMY THE VISTA":"RES-RERE-M6VJ7ZUW@mercedes-benz.com","MBTMY THE SHOULDER":"res-rere-m6vj3tuq@mercedes-benz.com","MBTMY THE PINNACLE":"res-rere-m6vhxd4c@mercedes-benz.com","MBTMY THE DESCENT":"res-rere-m6vzgysp@mercedes-benz.com"},u1=Object.fromEntries(Object.entries(Pm).map(([e,t])=>[t.toLowerCase(),e.replace(/^MBTMY\s+/i,"")])),rd={free:"success",busy:"error",tentative:"warning",oof:"secondary",elsewhere:"info"},d1={free:"bg-success/20 border-success/40",busy:"bg-error/20 border-error/40",tentative:"bg-warning/20 border-warning/40",oof:"bg-secondary/20 border-secondary/40",elsewhere:"bg-info/20 border-info/40"},f1={free:"bg-success/35 border-success/60",busy:"bg-error/35 border-error/60",tentative:"bg-warning/35 border-warning/60",oof:"bg-secondary/35 border-secondary/60",elsewhere:"bg-info/35 border-info/60"};function An(e){const t=e.match(/(\d{1,2}:\d{2})/);return t?t[1]:e}function p1({rows:e}){var r,a;const[t,n]=b.useState(null),s=e.reduce((o,l)=>o+(l.durationMin??0),0);return i.jsxs("div",{children:[s>0&&i.jsxs("div",{className:"mb-6",children:[i.jsx("div",{className:"flex h-10 overflow-hidden gap-px border border-base-300",children:e.map((o,l)=>{const c=s>0?(o.durationMin??0)/s*100:0;if(c<.5)return null;const u=t===l,p=u?f1[o.state??""]??"bg-base-300":d1[o.state??""]??"bg-base-300";return i.jsxs("div",{className:`${p} border flex items-center justify-center text-xs transition-colors duration-75 cursor-default relative`,style:{width:`${c}%`},onMouseEnter:()=>n(l),onMouseLeave:()=>n(null),children:[c>12&&i.jsx("span",{className:"opacity-60 truncate px-1 font-mono text-[0.65rem] uppercase tracking-wide",children:o.state}),u&&i.jsxs("div",{className:"absolute -top-9 left-1/2 -translate-x-1/2 bg-base-300 border border-base-content/10 px-2 py-1 text-[0.65rem] font-mono whitespace-nowrap z-10 pointer-events-none",children:[o.state,": ",An(o.start??""),"–",An(o.end??"")," (",o.durationMin,"m)"]})]},l)})}),i.jsxs("div",{className:"flex justify-between mt-1",children:[i.jsx("span",{className:"font-mono text-[0.6rem] opacity-30",children:An(((r=e[0])==null?void 0:r.start)??"")}),i.jsx("span",{className:"font-mono text-[0.6rem] opacity-30",children:An(((a=e[e.length-1])==null?void 0:a.end)??"")})]})]}),i.jsx("div",{className:"overflow-x-auto border border-base-300",children:i.jsxs("table",{className:"table table-sm",children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("th",{children:"Start"}),i.jsx("th",{children:"End"}),i.jsx("th",{children:"State"}),i.jsx("th",{className:"text-right",children:"Duration"})]})}),i.jsx("tbody",{children:e.map((o,l)=>i.jsxs("tr",{className:`transition-colors duration-75 ${t===l?"bg-base-200":"hover:bg-base-200"}`,onMouseEnter:()=>n(l),onMouseLeave:()=>n(null),children:[i.jsx("td",{className:"font-mono text-sm",children:An(o.start??"")}),i.jsx("td",{className:"font-mono text-sm",children:An(o.end??"")}),i.jsx("td",{children:i.jsx(H,{variant:rd[o.state??""]??"neutral",children:o.state})}),i.jsxs("td",{className:"text-right font-mono text-sm",children:[o.durationMin,"m"]})]},l))})]})}),i.jsx("div",{className:"flex flex-wrap gap-4 mt-3",children:Object.entries(rd).map(([o,l])=>i.jsx("div",{className:"flex items-center gap-1.5",children:i.jsx(H,{variant:l,size:"xs",children:o})},o))})]})}const m1=[{id:1,name:"The Base Camp",x:685,y:75,w:160,h:85,capacity:10},{id:2,name:"The Trailhead",x:880,y:130,w:95,h:100,capacity:4},{id:3,name:"The Foothills",x:880,y:255,w:95,h:100,capacity:5},{id:4,name:"The Bridge",x:880,y:380,w:95,h:100,capacity:4},{id:5,name:"The Ridge",x:650,y:620,w:250,h:110,capacity:18},{id:6,name:"The Meadow",x:535,y:480,w:92,h:80,capacity:6},{id:7,name:"The Forest",x:428,y:480,w:92,h:80,capacity:16},{id:8,name:"The Lookout",x:540,y:795,w:110,h:75,capacity:4},{id:9,name:"The Cliffside",x:410,y:795,w:110,h:75,capacity:4},{id:10,name:"The Ledge",x:280,y:795,w:110,h:75,capacity:4},{id:11,name:"The Highpoint",x:150,y:795,w:110,h:75,capacity:10},{id:12,name:"The Vista",x:30,y:750,w:100,h:115,capacity:12},{id:13,name:"The Shoulder",x:30,y:620,w:100,h:110,capacity:4},{id:14,name:"The Pinnacle",x:30,y:300,w:120,h:260,capacity:16},{id:15,name:"The Descent",x:30,y:60,w:120,h:170,capacity:6}],h1=[{name:"The Summit",x:170,y:60,w:230,h:500},{name:"The Lodge",x:670,y:60,w:190,h:500},{name:"The Plateau",x:150,y:620,w:470,h:150}],g1=[{x:90,y:48},{x:355,y:48},{x:765,y:48},{x:90,y:596}],y1={free:"fill-success/15 stroke-success",busy:"fill-error/15 stroke-error",unknown:"fill-base-200/60 stroke-base-300"};function ti(e){return e.toLowerCase().replace(/[^a-z0-9]/g,"").replace(/^mbtmy/,"").replace(/^the/,"")}function x1({statuses:e={},selected:t,onSelect:n}){const r=`hatch-${b.useId().replace(/[^a-zA-Z0-9]/g,"")}`,a=new Map(Object.entries(e).map(([c,u])=>[ti(c),u])),o=t?ti(t):null,l=c=>a.get(ti(c.name))??"unknown";return i.jsxs("div",{className:"border border-base-300 p-3 sm:p-4",children:[i.jsx("div",{className:"overflow-x-auto",children:i.jsxs("svg",{viewBox:"0 0 1000 900",className:"min-w-[560px] w-full h-auto select-none",role:"group","aria-label":"Office floor plan",children:[i.jsx("defs",{children:i.jsx("pattern",{id:r,width:"7",height:"7",patternUnits:"userSpaceOnUse",patternTransform:"rotate(45)",children:i.jsx("line",{x1:"0",y1:"0",x2:"0",y2:"7",strokeWidth:"1",className:"stroke-base-300"})})}),i.jsx("rect",{x:"14",y:"40",width:"972",height:"846",className:"fill-base-100 stroke-base-content/60",strokeWidth:"2"}),h1.map(c=>i.jsxs("g",{children:[i.jsx("rect",{x:c.x,y:c.y,width:c.w,height:c.h,className:"fill-base-200/30 stroke-base-300",strokeWidth:"1",strokeDasharray:"4 4"}),i.jsx("text",{x:c.x+c.w/2,y:c.y+c.h/2,textAnchor:"middle",dominantBaseline:"middle",fontSize:"13",letterSpacing:"2",className:"fill-base-content/25 font-mono uppercase",children:c.name})]},c.name)),i.jsxs("g",{children:[i.jsx("rect",{x:"420",y:"60",width:"232",height:"405",fill:`url(#${r})`,className:"stroke-base-300",strokeWidth:"1"}),i.jsx("rect",{x:"437",y:"192",width:"198",height:"140",className:"fill-base-100 stroke-base-300",strokeWidth:"1"}),i.jsx("text",{x:"536",y:"255",textAnchor:"middle",fontSize:"12",letterSpacing:"2",className:"fill-base-content/40 font-mono uppercase",children:"Courtyard"}),i.jsx("text",{x:"536",y:"275",textAnchor:"middle",fontSize:"8",letterSpacing:"1.5",className:"fill-base-content/25 font-mono uppercase",children:"Reflective pool"})]}),i.jsx("rect",{x:"680",y:"758",width:"220",height:"112",fill:`url(#${r})`,className:"stroke-base-300",strokeWidth:"1"}),i.jsx("text",{x:"790",y:"818",textAnchor:"middle",fontSize:"9",letterSpacing:"1.5",className:"fill-base-content/30 font-mono uppercase",children:"Facilities"}),g1.map((c,u)=>i.jsxs("g",{children:[i.jsx("path",{d:`M ${c.x-6} ${c.y} L ${c.x+6} ${c.y} L ${c.x} ${c.y+7} Z`,className:"fill-base-content/40"}),i.jsx("text",{x:c.x,y:c.y-5,textAnchor:"middle",fontSize:"8",letterSpacing:"1",className:"fill-base-content/40 font-mono uppercase",children:"Entry"})]},u)),m1.map(c=>{const u=l(c),p=o!==null&&ti(c.name)===o,d=c.w<100;return i.jsxs("g",{role:n?"button":void 0,tabIndex:n?0:void 0,onClick:n?()=>n(c.name):void 0,onKeyDown:n?f=>{(f.key==="Enter"||f.key===" ")&&(f.preventDefault(),n(c.name))}:void 0,className:n?"cursor-pointer hover:opacity-75 focus:outline-none transition-opacity":void 0,children:[i.jsx("title",{children:`${c.name} — ${u==="unknown"?"not checked":u}`}),i.jsx("rect",{x:c.x,y:c.y,width:c.w,height:c.h,strokeWidth:u==="unknown"?1:1.5,className:y1[u]}),p&&i.jsx("rect",{x:c.x+3,y:c.y+3,width:c.w-6,height:c.h-6,className:"fill-none stroke-primary",strokeWidth:"2"}),i.jsx("circle",{cx:c.x+15,cy:c.y+15,r:"9",className:"fill-base-100 stroke-base-content/30",strokeWidth:"1"}),i.jsx("text",{x:c.x+15,y:c.y+15,textAnchor:"middle",dominantBaseline:"central",fontSize:"8.5",className:"fill-base-content/60 font-mono",children:c.id}),i.jsx("text",{x:c.x+c.w/2,y:c.y+c.h/2+(c.h>90?10:8),textAnchor:"middle",fontSize:d?12:13.5,letterSpacing:"0.8",className:"fill-base-content/80 font-mono uppercase font-medium",children:c.name.replace(/^The\s+/i,"")}),i.jsxs("text",{x:c.x+c.w/2,y:c.y+c.h/2+(c.h>90?10:8)+(d?9:10.5),textAnchor:"middle",fontSize:10.5,letterSpacing:"0.5",className:"fill-base-content/40 font-mono",children:[c.capacity,"p"]})]},c.id)})]})}),i.jsxs("div",{className:"flex flex-wrap gap-x-5 gap-y-1 mt-3 font-mono text-[0.6rem] uppercase tracking-[0.1em] opacity-70",children:[i.jsxs("span",{className:"flex items-center gap-1.5",children:[i.jsx("span",{className:"w-2.5 h-2.5 inline-block bg-success/15 border border-success"})," Available"]}),i.jsxs("span",{className:"flex items-center gap-1.5",children:[i.jsx("span",{className:"w-2.5 h-2.5 inline-block bg-error/15 border border-error"})," Busy"]}),i.jsxs("span",{className:"flex items-center gap-1.5",children:[i.jsx("span",{className:"w-2.5 h-2.5 inline-block bg-base-200 border border-base-300"})," Not checked"]}),n&&i.jsx("span",{className:"opacity-60",children:"Click a room to select it"})]})]})}function v1(){return new Date().toISOString().slice(0,10)}const b1=[15,30,45,60,90,120],j1=Array.from({length:24*4},(e,t)=>{const n=Math.floor(t/4),s=t%4*15;return`${String(n).padStart(2,"0")}:${String(s).padStart(2,"0")}`});function w1(){const e=new Date,t=e.getHours()*60+Math.round(e.getMinutes()/15)*15,n=Math.floor(t/60)%24,s=t%60;return`${String(n).padStart(2,"0")}:${String(s).padStart(2,"0")}`}function id(e){const[t,n]=e.split(":").map(Number);return t*60+n}function dl(e){const t=Math.floor(e/60)%24,n=e%60;return`${String(t).padStart(2,"0")}:${String(n).padStart(2,"0")}`}function Js(e){const[t,n]=e.split(":").map(Number),s=t<12?"AM":"PM";return`${t%12===0?12:t%12}:${String(n).padStart(2,"0")} ${s}`}function N1(e){if(e<60)return`${e} min`;const t=Math.floor(e/60),n=e%60;return n===0?`${t}h`:`${t}h ${n}m`}function ad(e){try{const t=new Date(e+"T00:00:00"),n=new Date;n.setHours(0,0,0,0);const s=t.getTime()-n.getTime(),r=Math.round(s/864e5);return r===0?"Today":r===1?"Tomorrow":r===-1?"Yesterday":t.toLocaleDateString("en-US",{weekday:"short",month:"short",day:"numeric"})}catch{return e}}function od(e,t){if(!e)return null;let n=new Date(e);return Number.isNaN(n.getTime())?(n=new Date(`${t}T${e}`),Number.isNaN(n.getTime())?null:n):n}function k1(e,t,n,s){const r=new Date(`${t}T${n}:00`),a=new Date(r.getTime()+s*6e4);return!e.some(l=>{if(l.state==="free")return!1;const c=od(l.start,t),u=od(l.end,t);return c===null||u===null?!1:c<a&&r<u})}const vi=24*60;function fl(e,t){return Math.max(0,Math.min(vi-t,e))}function ld(e){return Math.round(e/15)*15}function S1({startMinutes:e,durationMinutes:t,onChange:n}){const s=b.useRef(null),r=b.useRef(!1),a=x=>{const y=s.current;if(!y)return e;const v=y.getBoundingClientRect(),g=Math.max(0,Math.min(1,(x-v.left)/v.width))*vi;return ld(g)},o=x=>{const y=a(x)-t/2;n(fl(ld(y),t))},l=x=>{r.current=!0,x.currentTarget.setPointerCapture(x.pointerId),o(x.clientX)},c=x=>{r.current&&o(x.clientX)},u=()=>{r.current=!1},p=e/vi*100,d=t/vi*100,f=e+t;return i.jsxs("div",{children:[i.jsxs("div",{ref:s,className:"relative h-10 bg-base-200 border border-base-300 rounded cursor-pointer select-none touch-none",onPointerDown:l,onPointerMove:c,onPointerUp:u,children:[i.jsx("div",{className:"absolute inset-0 flex",children:Array.from({length:8},(x,y)=>i.jsx("div",{className:"flex-1 border-r border-base-300/60 last:border-r-0"},y))}),i.jsxs("div",{className:"absolute top-0 h-full bg-primary/70 border border-primary rounded flex items-center justify-center text-[0.65rem] font-mono text-primary-content whitespace-nowrap px-1 cursor-grab active:cursor-grabbing",style:{left:`${p}%`,width:`${d}%`},children:[Js(dl(e)),"–",Js(dl(f))]})]}),i.jsxs("div",{className:"flex justify-between font-mono text-[0.55rem] opacity-30 mt-1",children:[i.jsx("span",{children:"12 AM"}),i.jsx("span",{children:"3 AM"}),i.jsx("span",{children:"6 AM"}),i.jsx("span",{children:"9 AM"}),i.jsx("span",{children:"12 PM"}),i.jsx("span",{children:"3 PM"}),i.jsx("span",{children:"6 PM"}),i.jsx("span",{children:"9 PM"}),i.jsx("span",{children:"12 AM"})]})]})}function C1(){var L;const[e,t]=b.useState(v1()),[n,s]=b.useState(()=>id(w1())),r=dl(n),[a,o]=b.useState(30),[l,c]=b.useState(1),[u,p]=b.useState(null),{running:d,result:f,error:x,approvalPending:y,approvalId:v,run:w,handleApproval:g}=yr(),h=b.useCallback(async()=>{const O=Object.keys(Pm).join(",");await w("teams/room-availability",{rooms:O,date:e})},[w,e]),m=(x==null?void 0:x.includes("auth_required"))||(x==null?void 0:x.includes("sign in")),j=b.useMemo(()=>((f==null?void 0:f.data)??[]).map(O=>({room:String(O.room??""),capacity:O.capacity===null||O.capacity===void 0||O.capacity===""?null:Number(O.capacity),start:String(O.start??""),end:String(O.end??""),state:String(O.state??""),durationMin:Number(O.durationMin??0)})),[f]),N=b.useMemo(()=>{const O=new Map;for(const F of j){const E=F.room.toLowerCase();O.has(E)||O.set(E,[]),O.get(E).push(F)}const U=new Map;for(const[F,E]of O)U.set(u1[F]??F,E);return U},[j]),C=b.useMemo(()=>{var U;const O={};for(const[F,E]of N){const D=((U=E.find(A=>A.capacity!==null))==null?void 0:U.capacity)??null,P=D===null||D>=l,R=k1(E,e,r,a);O[F]=R&&P?"free":"busy"}return O},[N,e,r,a,l]),S=u?N.get(u)??[]:[],k=((L=S.find(O=>O.capacity!==null))==null?void 0:L.capacity)??null,T=b.useCallback(O=>{p(U=>U===O?null:O)},[]);return i.jsxs("div",{className:"max-w-4xl mx-auto",children:[i.jsx("h2",{className:"font-display text-xl font-bold uppercase tracking-[0.06em] mb-5",children:"Room Availability"}),i.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-end gap-3 mb-6",children:[i.jsxs("label",{className:"form-control w-full sm:w-auto",children:[i.jsx("span",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Date"}),i.jsx("input",{type:"date",className:"input input-bordered input-sm w-full sm:w-auto",value:e,onChange:O=>t(O.target.value),onClick:O=>{var U,F;return(F=(U=O.target).showPicker)==null?void 0:F.call(U)}})]}),i.jsxs("label",{className:"form-control w-full sm:w-auto",children:[i.jsx("span",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Start time"}),i.jsx("select",{className:"select select-bordered select-sm w-full sm:w-auto",value:r,onChange:O=>{s(fl(id(O.target.value),a))},children:j1.map(O=>i.jsx("option",{value:O,children:Js(O)},O))})]}),i.jsxs("label",{className:"form-control w-full sm:w-auto",children:[i.jsx("span",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Duration"}),i.jsx("select",{className:"select select-bordered select-sm w-full sm:w-auto",value:a,onChange:O=>{const U=Number(O.target.value);o(U),s(F=>fl(F,U))},children:b1.map(O=>i.jsx("option",{value:O,children:N1(O)},O))})]}),i.jsxs("label",{className:"form-control w-full sm:w-24",children:[i.jsx("span",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"People"}),i.jsx("input",{type:"number",min:1,className:"input input-bordered input-sm w-full sm:w-24",value:l,onChange:O=>c(Math.max(1,Number(O.target.value)||1))})]}),i.jsx("button",{className:"btn btn-primary btn-sm w-full sm:w-auto",onClick:h,disabled:d,children:d?"Checking floor...":"Check floor plan"})]}),i.jsxs("div",{className:"mb-6",children:[i.jsx("span",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1 block",children:"Drag to pick a time · bar width = duration"}),i.jsx(S1,{startMinutes:n,durationMinutes:a,onChange:s})]}),d&&!y&&i.jsx(ut,{label:"Checking all rooms on the floor plan (this drives Outlook UI and can take a few minutes)..."}),y&&i.jsxs("div",{className:"alert alert-warning mb-4",children:[i.jsx("span",{children:"This connector requires approval before proceeding."}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx("button",{className:"btn btn-sm btn-success",onClick:()=>g(!0),disabled:!v,children:"Approve"}),i.jsx("button",{className:"btn btn-sm btn-error",onClick:()=>g(!1),disabled:!v,children:"Reject"})]})]}),m&&i.jsx(wn,{message:"Sign in to Microsoft Teams in Chrome, then try again."}),x&&!m&&i.jsx("div",{className:"alert alert-error mb-4",children:i.jsx("span",{children:x})}),!f&&!d&&!x&&i.jsxs("div",{className:"border border-base-300 p-8 text-center mb-8",children:[i.jsx("p",{className:"text-sm opacity-50 mb-1",children:"Pick a date, time, duration and party size, then check the floor plan"}),i.jsx("p",{className:"font-mono text-xs opacity-30",children:"Rooms that are free and big enough will show green; everything else red."})]}),i.jsxs("div",{className:"mt-2",children:[i.jsxs("h3",{className:"font-display text-base font-semibold mb-3",children:["Floor plan · ",Js(r),"–",Js((()=>{const[O,U]=r.split(":").map(Number),F=(O*60+U+a)%(24*60);return`${String(Math.floor(F/60)).padStart(2,"0")}:${String(F%60).padStart(2,"0")}`})())," · ",ad(e)," · ",l," ",l===1?"person":"people"]}),i.jsx(x1,{statuses:C,selected:u??void 0,onSelect:T})]}),u&&S.length>0&&i.jsxs("div",{className:"mt-8",children:[i.jsxs("h3",{className:"font-display text-base font-semibold mb-3",children:[u,k!==null&&i.jsxs("span",{className:"ml-2 font-mono text-xs font-normal opacity-50 uppercase tracking-[0.08em]",children:["Capacity ",k]})," ","· ",ad(e)]}),i.jsx(p1,{rows:S})]}),u&&S.length===0&&i.jsx("div",{className:"mt-8 border border-base-300 p-6 text-center",children:i.jsxs("p",{className:"text-sm opacity-50",children:["No data for ",u,' yet — run "Check floor plan" first.']})})]})}function E1({data:e}){const{timetracking:t,meetings:n,jira:s,git:r}=e,a=t?Math.min(100,Math.round(t.totalHours/t.targetHours*100)):0,o=t&&t.totalHours<t.targetHours*.8,l=(s==null?void 0:s.blockers.length)??0,c=(r==null?void 0:r.repos.length)??0;return i.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 border border-base-300",children:[i.jsxs("div",{className:"p-3 border-r border-b border-base-300 md:border-b-0",children:[i.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Hours Logged"}),i.jsx("div",{className:`font-display text-xl font-bold ${o?"text-warning":"text-success"}`,children:t?`${t.totalHours}h`:"—"}),i.jsxs("div",{className:"text-xs opacity-40",children:["/ ",(t==null?void 0:t.targetHours)??40,"h target"]}),t&&i.jsx("progress",{className:`progress ${o?"progress-warning":"progress-success"} w-full mt-1`,value:a,max:100})]}),i.jsxs("div",{className:"p-3 border-b border-base-300 md:border-r md:border-b-0",children:[i.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Meetings"}),i.jsx("div",{className:`font-display text-xl font-bold ${n&&n.totalHours>20?"text-warning":"text-info"}`,children:n?String(n.totalCount):"—"}),i.jsx("div",{className:"text-xs opacity-40",children:n?`${n.totalHours}h · avg ${n.avgDurationMin}min`:""})]}),i.jsxs("div",{className:"p-3 border-r border-base-300",children:[i.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Tickets Done"}),i.jsx("div",{className:"font-display text-xl font-bold text-accent",children:s?String(s.resolved.length):"—"}),i.jsx("div",{className:"text-xs opacity-40",children:s?i.jsxs(i.Fragment,{children:[s.inProgress.length," in progress",l>0&&i.jsxs("span",{className:"text-error font-semibold ml-1",children:["· ",l," blocked"]})]}):""})]}),i.jsxs("div",{className:"p-3",children:[i.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Commits"}),i.jsx("div",{className:"font-display text-xl font-bold text-primary",children:r?String(r.totalCommits):"—"}),i.jsx("div",{className:"text-xs opacity-40",children:r?`${r.totalPRsMerged} PRs · ${c} repo${c!==1?"s":""}`:""})]})]})}const T1=["Mon","Tue","Wed","Thu","Fri"];function A1(e){const t=new Date(e).getDay();return T1[t-1]??e}function L1({data:e}){const{timetracking:t,meetings:n,git:s,jira:r}=e,a=new Set;t==null||t.daily.forEach(f=>a.add(f.date)),n==null||n.daily.forEach(f=>a.add(f.date)),s==null||s.daily.forEach(f=>a.add(f.date));const o=[...a].sort().filter(f=>{const x=new Date(f+"T00:00:00").getDay();return x===0||x===6?(t==null?void 0:t.daily.some(v=>v.date===f&&v.hours>0))||(n==null?void 0:n.daily.some(v=>v.date===f&&v.count>0))||(s==null?void 0:s.daily.some(v=>v.date===f&&v.commits>0)):!0}),l=(t==null?void 0:t.totalHours)??0,c=(n==null?void 0:n.totalCount)??0,u=(n==null?void 0:n.totalHours)??0,p=(s==null?void 0:s.totalCommits)??0,d=(r==null?void 0:r.resolved.length)??0;return o.length===0?i.jsx("div",{className:"text-base-content/60",children:"No daily data available."}):i.jsx("div",{className:"overflow-x-auto border border-base-300",children:i.jsxs("table",{className:"table table-sm w-full",children:[i.jsx("thead",{children:i.jsxs("tr",{className:"font-mono text-[0.6rem] uppercase tracking-[0.1em] opacity-50",children:[i.jsx("th",{children:"Day"}),i.jsx("th",{children:"Date"}),i.jsx("th",{children:"Hours Logged"}),i.jsx("th",{children:"Meetings"}),i.jsx("th",{children:"Commits"}),i.jsx("th",{children:"Tickets"})]})}),i.jsx("tbody",{children:o.map(f=>{const x=t==null?void 0:t.daily.find(h=>h.date===f),y=n==null?void 0:n.daily.find(h=>h.date===f),v=s==null?void 0:s.daily.find(h=>h.date===f),w=t==null?void 0:t.gaps.includes(f),g=(r==null?void 0:r.resolved.filter(h=>h.resolvedDate===f))??[];return i.jsxs("tr",{className:w?"bg-warning/10":"",children:[i.jsx("td",{className:"font-medium",children:A1(f)}),i.jsx("td",{className:"text-xs text-base-content/60",children:f}),i.jsxs("td",{children:[i.jsx("span",{className:w?"text-warning font-semibold":"",children:x?`${x.hours}h`:"—"}),w&&i.jsx("span",{className:"ml-1 text-warning text-xs",children:"⚠"})]}),i.jsx("td",{children:y?`${y.count} (${y.hours}h)`:"—"}),i.jsx("td",{children:v?`${v.commits}`:"0"}),i.jsx("td",{className:"text-xs",children:g.length>0?g.map(h=>h.key).join(", "):"—"})]},f)})}),i.jsx("tfoot",{children:i.jsxs("tr",{className:"font-semibold border-t border-base-300",children:[i.jsx("td",{colSpan:2,children:"Total"}),i.jsx("td",{children:l>0?`${l}h`:"—"}),i.jsx("td",{children:c>0?`${c} (${u}h)`:"—"}),i.jsx("td",{children:p}),i.jsx("td",{className:"text-xs",children:d>0?`${d} done`:"—"})]})})]})})}function I1({insights:e,errors:t}){return i.jsxs("div",{className:"space-y-3",children:[e.length>0&&i.jsxs("div",{className:"border border-base-300 p-4",children:[i.jsx("p",{className:"font-mono text-[0.65rem] font-medium opacity-50 uppercase tracking-[0.12em] mb-2",children:"Insights"}),i.jsx("ul",{className:"list-disc list-inside space-y-1 text-sm",children:e.map((n,s)=>i.jsx("li",{children:n},s))})]}),t.length>0&&i.jsx("div",{className:"alert alert-warning text-sm",children:i.jsxs("div",{children:[i.jsx("p",{className:"font-semibold",children:"Some data sources had issues:"}),i.jsx("ul",{className:"list-disc list-inside mt-1",children:t.map((n,s)=>i.jsx("li",{children:n},s))})]})})]})}function _m(e){const t=e.getFullYear(),n=String(e.getMonth()+1).padStart(2,"0"),s=String(e.getDate()).padStart(2,"0");return`${t}-${n}-${s}`}function O1(){const e=new Date;return e.setDate(e.getDate()-e.getDay()),_m(e)}function cd(e,t){const n=new Date(e+"T00:00:00");return n.setDate(n.getDate()+t*7),_m(n)}function P1(e){const t=new Date(e+"T00:00:00"),n=new Date(t);n.setDate(n.getDate()+6);const s=r=>r.toLocaleDateString("en-GB",{day:"numeric",month:"short"});return`${s(t)} – ${s(n)}, ${t.getFullYear()}`}function _1(){const[e,t]=b.useState(O1()),[n,s]=b.useState(!1),[r,a]=b.useState(null),[o,l]=b.useState(null),[c,u]=b.useState(null);async function p(){s(!0),l(null),a(null),u(null);const d=Date.now();try{const f=await B.generateJournal({weekStart:e});u(Date.now()-d),a(f)}catch(f){l(f instanceof Error?f.message:"Unknown error")}finally{s(!1)}}return i.jsxs("div",{className:"max-w-4xl mx-auto",children:[i.jsx("h2",{className:"font-display text-xl font-bold uppercase tracking-[0.06em] mb-5",children:"Dev Work Journal"}),i.jsxs("div",{className:"flex flex-wrap items-center gap-3 mb-6",children:[i.jsx("button",{className:"btn btn-sm btn-ghost",onClick:()=>t(cd(e,-1)),disabled:n,children:"◄"}),i.jsx("span",{className:"font-medium text-lg",children:P1(e)}),i.jsx("button",{className:"btn btn-sm btn-ghost",onClick:()=>t(cd(e,1)),disabled:n,children:"►"}),i.jsx("button",{className:"btn btn-primary ml-4",onClick:p,disabled:n,children:n?i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"loading loading-spinner loading-xs"}),"Generating…"]}):"Generate"}),c!==null&&!n&&i.jsxs("span",{className:"text-xs text-base-content/40 ml-2",children:["Generated in ",(c/1e3).toFixed(1),"s"]})]}),n&&i.jsxs("div",{className:"flex items-center gap-3 text-base-content/60 mb-4",children:[i.jsx("span",{className:"loading loading-spinner loading-md"}),i.jsx("span",{children:"Gathering data from Git, Outlook, Jira…"})]}),o&&i.jsx("div",{role:"alert",className:"alert alert-error mb-4",children:i.jsx("span",{children:o})}),(r==null?void 0:r.status)==="partial"&&i.jsx("div",{role:"alert",className:"alert alert-warning text-sm mb-4",children:i.jsxs("div",{children:[i.jsx("p",{className:"font-semibold",children:"Some data sources were unavailable. Results may be incomplete."}),i.jsx("ul",{className:"list-disc list-inside mt-1",children:r.errors.map((d,f)=>i.jsx("li",{children:d},f))})]})}),r&&r.status!=="error"&&i.jsxs("div",{className:"space-y-6",children:[i.jsxs("section",{className:"space-y-4",children:[i.jsx("h3",{className:"font-mono text-[0.65rem] font-medium opacity-50 uppercase tracking-[0.12em]",children:"Summary"}),i.jsx(E1,{data:r})]}),i.jsxs("section",{className:"space-y-4",children:[i.jsx("h3",{className:"font-mono text-[0.65rem] font-medium opacity-50 uppercase tracking-[0.12em]",children:"Daily Breakdown"}),i.jsx(L1,{data:r})]}),i.jsx("section",{className:"space-y-4",children:i.jsx(I1,{insights:r.insights,errors:r.errors})})]}),(r==null?void 0:r.status)==="error"&&i.jsx("div",{role:"alert",className:"alert alert-error mb-4",children:i.jsxs("span",{children:["Failed to generate journal. ",r.errors.join("; ")]})})]})}function M1(){const e=new Date;return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}`}function D1(){const e=new Date;return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}function $1(e){const[t,n]=e.split("-").map(Number);return new Date(t,n-1,1).toLocaleDateString("en-GB",{month:"long",year:"numeric"})}function R1(e){return new Date(e+"T00:00:00").toLocaleDateString("en-GB",{weekday:"short",day:"numeric",month:"short"})}function z1(e){const[t,n]=e.split("-").map(Number),s=new Date(t,n,0).getDate();let r=0;for(let a=1;a<=s;a++){const o=new Date(t,n-1,a).getDay();o!==0&&o!==6&&r++}return r}function F1(e,t){const n=D1(),[s,r]=t.split("-").map(Number),a=new Date(n+"T00:00:00"),o=new Date(s,r,0).getDate(),l=[];for(let d=1;d<=o;d++){const f=new Date(s,r-1,d);if(f>a)break;const x=f.getDay();x!==0&&x!==6&&l.push(`${s}-${String(r).padStart(2,"0")}-${String(d).padStart(2,"0")}`)}const c=new Set(e.filter(d=>d.date&&d.status&&/released/i.test(String(d.status))).map(d=>d.date)),u=l.filter(d=>c.has(d)),p=l.filter(d=>!c.has(d));return{workingDaysTotal:z1(t),workingDaysElapsed:l.length,releasedDates:u,unreleasedDates:p}}function B1(e){return e.isOverdue?"badge badge-error badge-sm":typeof e.daysUntilDue=="number"&&e.daysUntilDue<=7?"badge badge-warning badge-sm":typeof e.daysUntilDue=="number"&&e.daysUntilDue<=30?"badge badge-info badge-sm":"badge badge-ghost badge-sm"}function U1(e){return e.isOverdue?"Overdue":e.daysUntilDue==null||e.daysUntilDue===9999?"No deadline":e.daysUntilDue===0?"Due today":e.daysUntilDue===1?"Due tomorrow":`${e.daysUntilDue}d left`}function W1(){const[e]=b.useState(M1()),[t,n]=b.useState([]),s=yr(),r=yr();function a(){s.reset(),r.reset(),n([]),s.run("timetracking/report",{month:e}),r.run("saba/pending-training",{}),B.getGoals(e).then(y=>n(y.goals)).catch(()=>{})}const o=b.useMemo(()=>{var y;return((y=s.result)==null?void 0:y.data)??null},[s.result]),l=b.useMemo(()=>o?F1(o,e):null,[o,e]),c=b.useMemo(()=>{const y=new Map;if(o)for(const v of o){const w=typeof v.projectId=="string"?v.projectId:null,g=typeof v.hours=="number"?v.hours:0;w&&y.set(w,(y.get(w)??0)+g)}return y},[o]),u=b.useMemo(()=>{var y;return((y=r.result)==null?void 0:y.data)??[]},[r.result]),p=typeof r.error=="string"&&(r.error.toLowerCase().includes("auth_required")||r.error.toLowerCase().includes("sign in")),d=typeof s.error=="string"&&(s.error.toLowerCase().includes("auth_required")||s.error.toLowerCase().includes("sign in")),f=s.running||r.running,x=s.result!==null||r.result!==null;return i.jsxs("div",{className:"max-w-4xl mx-auto",children:[i.jsxs("div",{className:"flex items-center justify-between mb-5",children:[i.jsxs("div",{children:[i.jsx("h2",{className:"font-display text-xl font-bold uppercase tracking-[0.06em]",children:"Daily Check-in"}),i.jsx("p",{className:"text-sm opacity-40 mt-0.5",children:$1(e)})]}),i.jsx("button",{className:"btn btn-primary btn-sm",onClick:a,disabled:f,children:f?"Loading…":x?"Refresh":"Load"})]}),f&&!s.approvalPending&&!r.approvalPending&&i.jsx("div",{className:"mb-4",children:i.jsx(ut,{label:"Fetching time tracking and Saba training…"})}),i.jsxs("section",{className:"space-y-4 mb-6",children:[i.jsx("h3",{className:"font-mono text-[0.65rem] font-medium opacity-50 uppercase tracking-[0.12em]",children:"Time Tracking"}),s.approvalPending&&i.jsxs("div",{className:"alert alert-warning",children:[i.jsx("span",{children:"Time tracking requires approval."}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx("button",{className:"btn btn-sm btn-success",onClick:()=>s.handleApproval(!0),disabled:!s.approvalId,children:"Approve"}),i.jsx("button",{className:"btn btn-sm btn-error",onClick:()=>s.handleApproval(!1),disabled:!s.approvalId,children:"Reject"})]})]}),d&&i.jsx(wn,{message:"Sign in to the timetracking portal in Chrome, then try again."}),s.error&&!d&&i.jsx("div",{className:"alert alert-error text-sm",children:i.jsx("span",{children:s.error})}),l&&i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"grid grid-cols-4 border border-base-300",children:[i.jsxs("div",{className:"p-3 border-r border-base-300",children:[i.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Working days"}),i.jsx("div",{className:"font-display text-xl font-bold",children:l.workingDaysTotal}),i.jsx("div",{className:"text-xs opacity-40",children:"in month"})]}),i.jsxs("div",{className:"p-3 border-r border-base-300",children:[i.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Elapsed"}),i.jsx("div",{className:"font-display text-xl font-bold",children:l.workingDaysElapsed}),i.jsx("div",{className:"text-xs opacity-40",children:"so far"})]}),i.jsxs("div",{className:"p-3 border-r border-base-300",children:[i.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Released"}),i.jsx("div",{className:"font-display text-xl font-bold text-success",children:l.releasedDates.length}),i.jsx("div",{className:"text-xs opacity-40",children:"days"})]}),i.jsxs("div",{className:"p-3",children:[i.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Unreleased"}),i.jsx("div",{className:`font-display text-xl font-bold ${l.unreleasedDates.length>0?"text-error":"text-success"}`,children:l.unreleasedDates.length}),i.jsx("div",{className:"text-xs opacity-40",children:"to action"})]})]}),l.unreleasedDates.length>0&&i.jsxs("div",{className:"border border-base-300 p-4 space-y-2",children:[i.jsx("p",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em]",children:"Unreleased dates"}),i.jsx("div",{className:"flex flex-wrap gap-2",children:l.unreleasedDates.map(y=>i.jsx("span",{className:"badge badge-error badge-outline badge-sm",children:R1(y)},y))})]}),l.unreleasedDates.length===0&&i.jsx("div",{className:"border border-base-300 p-4 text-center",children:i.jsx("p",{className:"text-sm text-success font-medium",children:"All days released ✓"})})]}),l&&t.length>0&&i.jsxs("div",{className:"border border-base-300 p-4 space-y-3",children:[i.jsx("p",{className:"font-mono text-[0.65rem] font-medium opacity-50 uppercase tracking-[0.12em]",children:"Goals Progress"}),i.jsx("div",{className:"space-y-3",children:t.map(y=>{const v=Math.round((c.get(y.projectId)??0)*100)/100,w=Math.round((y.targetHours-v)*100)/100,g=Math.min(100,Math.round(v/y.targetHours*100)),h=w<=0;return i.jsxs("div",{className:"space-y-1",children:[i.jsxs("div",{className:"flex items-center justify-between text-sm",children:[i.jsx("span",{className:"font-medium",children:y.projectId}),i.jsx("span",{className:`font-mono text-xs ${h?"text-success":"text-warning"}`,children:h?"✓ Goal met":`${w}h to go`})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("progress",{className:`progress flex-1 ${h?"progress-success":"progress-warning"}`,value:g,max:100}),i.jsxs("span",{className:"font-mono text-xs opacity-50 w-24 text-right",children:[v,"h / ",y.targetHours,"h"]})]})]},y.id)})})]}),o===null&&!s.error&&!s.running&&i.jsxs("div",{className:"border border-base-300 p-6 text-center",children:[i.jsx("p",{className:"text-sm opacity-40",children:"Click Load to check your time tracking status."}),i.jsx("p",{className:"font-mono text-xs opacity-25 mt-1",children:"Drives your browser — sign in to the portal first."})]})]}),i.jsxs("section",{className:"space-y-4",children:[i.jsx("h3",{className:"font-mono text-[0.65rem] font-medium opacity-50 uppercase tracking-[0.12em]",children:"Pending Training (Saba)"}),r.approvalPending&&i.jsxs("div",{className:"alert alert-warning",children:[i.jsx("span",{children:"This connector requires approval before proceeding."}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx("button",{className:"btn btn-sm btn-success",onClick:()=>r.handleApproval(!0),disabled:!r.approvalId,children:"Approve"}),i.jsx("button",{className:"btn btn-sm btn-error",onClick:()=>r.handleApproval(!1),disabled:!r.approvalId,children:"Reject"})]})]}),p&&i.jsx(wn,{message:"Sign in to Saba Cloud (daimler.sabacloud.com) in Chrome, then try again."}),r.error&&!p&&i.jsx("div",{className:"alert alert-error text-sm font-mono whitespace-pre-wrap",children:i.jsx("span",{children:r.error})}),r.result&&u.length>0&&i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"grid grid-cols-3 border border-base-300",children:[i.jsxs("div",{className:"p-3 border-r border-base-300",children:[i.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Pending"}),i.jsx("div",{className:"font-display text-xl font-bold",children:u.length})]}),i.jsxs("div",{className:"p-3 border-r border-base-300",children:[i.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Overdue"}),i.jsx("div",{className:`font-display text-xl font-bold ${u.filter(y=>y.isOverdue).length>0?"text-error":""}`,children:u.filter(y=>y.isOverdue).length})]}),i.jsxs("div",{className:"p-3",children:[i.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Due ≤ 30d"}),i.jsx("div",{className:`font-display text-xl font-bold ${u.filter(y=>!y.isOverdue&&typeof y.daysUntilDue=="number"&&y.daysUntilDue<=30).length>0?"text-warning":""}`,children:u.filter(y=>!y.isOverdue&&typeof y.daysUntilDue=="number"&&y.daysUntilDue<=30).length})]})]}),i.jsx("div",{className:"overflow-x-auto border border-base-300",children:i.jsxs("table",{className:"table table-sm w-full",children:[i.jsx("thead",{children:i.jsxs("tr",{className:"font-mono text-[0.6rem] uppercase tracking-[0.1em] opacity-50",children:[i.jsx("th",{children:"Course"}),i.jsx("th",{children:"Type"}),i.jsx("th",{children:"Status"}),i.jsx("th",{children:"Due"}),i.jsx("th",{children:"Urgency"})]})}),i.jsx("tbody",{children:u.map((y,v)=>i.jsxs("tr",{className:"hover",children:[i.jsx("td",{className:`font-medium text-sm ${y.isOverdue?"text-error":""}`,children:y.title??"—"}),i.jsx("td",{className:"font-mono text-xs opacity-60",children:y.type??"—"}),i.jsx("td",{className:"text-xs opacity-70",children:y.status??"—"}),i.jsx("td",{className:"font-mono text-xs",children:y.dueDate||"—"}),i.jsx("td",{children:i.jsx("span",{className:B1(y),children:U1(y)})})]},v))})]})})]}),r.result&&u.length===0&&!r.error&&i.jsxs("div",{className:"border border-base-300 p-6 text-center",children:[i.jsx("p",{className:"text-sm text-success font-medium",children:"No pending training ✓"}),i.jsx("p",{className:"font-mono text-xs opacity-30 mt-0.5",children:"You're all caught up."})]}),!r.result&&!r.error&&!r.running&&i.jsxs("div",{className:"border border-base-300 p-6 text-center",children:[i.jsx("p",{className:"text-sm opacity-40",children:"Click Load to fetch your pending Saba training."}),i.jsx("p",{className:"font-mono text-xs opacity-25 mt-1",children:"Requires an active Saba Cloud session in Chrome."})]})]})]})}const H1={socket:"info",wiz:"secondary",tldrsec:"warning"},V1={socket:"SOCKET",wiz:"WIZ",tldrsec:"TLDR SEC"};function K1(e,t){try{const n=new Date(e);if(isNaN(n.getTime()))return!1;const s=Date.now()-t*24*60*60*1e3;return n.getTime()>=s}catch{return!1}}function G1(e){try{const t=new Date(e);if(isNaN(t.getTime()))return e;const s=new Date().getTime()-t.getTime(),r=Math.floor(s/36e5);if(r<1)return"just now";if(r<24)return`${r}h ago`;const a=Math.floor(r/24);return a===1?"yesterday":a<7?`${a}d ago`:t.toLocaleDateString("en-US",{month:"short",day:"numeric"})}catch{return e}}function q1(e){return(e.data??[]).map(t=>({title:String(t.title??""),summary:String(t.summary??""),url:String(t.url??""),date:String(t.date??""),source:"socket",author:String(t.author??""),tags:String(t.tags??"")}))}function Y1(e){return(e.data??[]).map(t=>({title:String(t.title??""),summary:String(t.excerpt??""),url:String(t.url??""),date:String(t.publishedAt??""),source:"wiz",author:String(t.authors??""),tags:String(t.tags??"")}))}function Q1(e){return(e.data??[]).map(t=>({title:String(t.title??""),summary:String(t.excerpt??""),url:String(t.url??""),date:String(t.publishedAt??""),source:"tldrsec",author:String(t.authors??""),tags:String(t.tags??"")}))}const ud={7:"Past 7 days",30:"Past 30 days"};function J1(e){const t=Date.now()-new Date(e).getTime(),n=Math.floor(t/6e4);if(n<1)return"just now";if(n<60)return`${n}m ago`;const s=Math.floor(n/60);return s<24?`${s}h ago`:`${Math.floor(s/24)}d ago`}function X1(){const[e,t]=b.useState(7),[n,s]=b.useState("idle"),[r,a]=b.useState("idle"),[o,l]=b.useState("idle"),[c,u]=b.useState([]),[p,d]=b.useState([]),[f,x]=b.useState([]),[y,v]=b.useState(null),[w,g]=b.useState(null),[h,m]=b.useState(null),[j,N]=b.useState(null),[C,S]=b.useState(!1);b.useEffect(()=>{let E=!1;return B.getCachedSecurityNews().then(D=>{if(!E&&D.data&&D.data.length>0){if(s(_=>_==="loading"?(E=!0,_):"done"),E)return;const P=[],R=[],A=[];for(const _ of D.data){const $=_;$.source==="wiz"?R.push($):$.source==="tldrsec"?A.push($):P.push($)}u(P),d(R),x(A),N(D.fetchedAt),S(!0),a("done"),l("done")}}).catch(()=>{}),()=>{E=!0}},[]);const k=n==="loading"||r==="loading"||o==="loading",T=c.length>0||p.length>0||f.length>0,L=b.useMemo(()=>[...c,...p,...f].filter(D=>K1(D.date,e)).sort((D,P)=>new Date(P.date).getTime()-new Date(D.date).getTime()),[c,p,f,e]),O=b.useMemo(()=>{const E=L.filter(R=>R.source==="socket").length,D=L.filter(R=>R.source==="wiz").length,P=L.filter(R=>R.source==="tldrsec").length;return{total:L.length,socketCount:E,wizCount:D,tldrsecCount:P}},[L]),U=b.useCallback(async()=>{s("loading"),a("loading"),l("loading"),v(null),g(null),m(null),u([]),d([]),x([]),S(!1);let E=[],D=[],P=[];const R=B.run("socket/security-news",{}).then(z=>{!z.ok&&z.error?(v(z.error),s("error")):(E=q1(z),u(E),s("done"))}).catch(z=>{v(z instanceof Error?z.message:"Failed to fetch"),s("error")}),A=B.run("wiz/blog-security",{}).then(z=>{!z.ok&&z.error?(g(z.error),a("error")):(D=Y1(z),d(D),a("done"))}).catch(z=>{g(z instanceof Error?z.message:"Failed to fetch"),a("error")}),_=B.run("tldrsec/newsletter",{}).then(z=>{!z.ok&&z.error?(m(z.error),l("error")):(P=Q1(z),x(P),l("done"))}).catch(z=>{m(z instanceof Error?z.message:"Failed to fetch"),l("error")});await Promise.allSettled([R,A,_]);const $=[...E,...D,...P];if($.length>0){const z=new Date().toISOString();N(z),B.cacheSecurityNews($).catch(()=>{})}},[]),F=E=>(E==null?void 0:E.includes("auth_required"))||(E==null?void 0:E.includes("sign in"));return i.jsxs("div",{className:"max-w-4xl mx-auto",children:[i.jsx("h2",{className:"font-display text-xl font-bold uppercase tracking-[0.06em] mb-5",children:"Security News"}),i.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-end gap-3 mb-6",children:[i.jsxs("label",{className:"form-control w-full sm:w-auto",children:[i.jsx("span",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Range"}),i.jsxs("select",{className:"select select-bordered select-sm w-full sm:w-auto",value:e,onChange:E=>t(Number(E.target.value)),children:[i.jsx("option",{value:7,children:"Past 7 days"}),i.jsx("option",{value:30,children:"Past 30 days"})]})]}),i.jsx("button",{className:"btn btn-primary btn-sm w-full sm:w-auto",onClick:U,disabled:k,children:k?"Loading...":"Load news"}),i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx(io,{label:"Socket",status:n}),i.jsx(io,{label:"Wiz",status:r}),i.jsx(io,{label:"tl;dr sec",status:o})]})]}),k&&i.jsx(ut,{label:"Fetching security news..."}),y&&(F(y)?i.jsx(wn,{message:"Sign in to Socket.dev in Chrome, then try again."}):i.jsx("div",{className:"alert alert-error mb-3",children:i.jsxs("span",{children:[i.jsx("span",{className:"font-semibold",children:"Socket:"})," ",y]})})),w&&(F(w)?i.jsx(wn,{message:"Sign in to Wiz in Chrome, then try again."}):i.jsx("div",{className:"alert alert-error mb-3",children:i.jsxs("span",{children:[i.jsx("span",{className:"font-semibold",children:"Wiz:"})," ",w]})})),h&&i.jsx("div",{className:"alert alert-error mb-3",children:i.jsxs("span",{children:[i.jsx("span",{className:"font-semibold",children:"tl;dr sec:"})," ",h]})}),j&&!k&&i.jsxs("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-2",children:[C?"Showing cached data from":"Last fetched"," ",J1(j)]}),T&&!k&&i.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 border border-base-300 mb-6",children:[i.jsxs("div",{className:"p-3 border-r border-base-300",children:[i.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:ud[e]}),i.jsx("div",{className:"font-display text-xl font-bold",children:O.total})]}),i.jsxs("div",{className:"p-3 border-r border-base-300",children:[i.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Socket"}),i.jsx("div",{className:"font-display text-xl font-bold",children:O.socketCount})]}),i.jsxs("div",{className:"p-3 border-r border-base-300",children:[i.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Wiz"}),i.jsx("div",{className:"font-display text-xl font-bold",children:O.wizCount})]}),i.jsxs("div",{className:"p-3",children:[i.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"tl;dr sec"}),i.jsx("div",{className:"font-display text-xl font-bold",children:O.tldrsecCount})]})]}),L.length>0&&i.jsx("div",{className:"space-y-px",children:L.map((E,D)=>i.jsxs("article",{className:"border border-base-300 p-4",children:[i.jsxs("div",{className:"flex items-start justify-between gap-3 mb-2",children:[i.jsx("a",{href:E.url,target:"_blank",rel:"noopener noreferrer",className:"text-sm font-semibold hover:text-primary transition-colors leading-snug",children:E.title}),i.jsx(H,{variant:H1[E.source]??"neutral",size:"xs",children:V1[E.source]??E.source.toUpperCase()})]}),E.summary&&i.jsx("p",{className:"text-sm opacity-60 leading-relaxed mb-2 line-clamp-2",children:E.summary}),i.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[i.jsx("span",{className:"font-mono text-[0.6rem] opacity-40",children:G1(E.date)}),E.author&&i.jsx("span",{className:"font-mono text-[0.6rem] opacity-40",children:E.author}),E.tags&&i.jsx("div",{className:"flex gap-1 flex-wrap",children:E.tags.split(",").slice(0,3).map(P=>i.jsx(H,{variant:"neutral",size:"xs",children:P.trim()},P.trim()))})]})]},`${E.source}-${D}`))}),T&&L.length===0&&!k&&i.jsxs("div",{className:"border border-base-300 p-6 text-center",children:[i.jsxs("p",{className:"text-sm opacity-50 mb-1",children:["No news from the ",ud[e].toLowerCase()]}),i.jsx("p",{className:"font-mono text-xs opacity-30",children:"All sources returned data, but nothing within the date window."})]}),!T&&!k&&!y&&!w&&!h&&i.jsxs("div",{className:"border border-base-300 p-8 text-center",children:[i.jsx("p",{className:"text-sm opacity-50 mb-1",children:"Security news from Socket, Wiz, and tl;dr sec"}),i.jsx("p",{className:"font-mono text-xs opacity-30",children:"Select a range and press Load news to fetch the latest posts."})]})]})}function io({label:e,status:t}){const n={idle:"opacity-30",loading:"bg-warning animate-pulse",done:"bg-success",error:"bg-error"}[t];return i.jsxs("div",{className:"flex items-center gap-1.5",children:[i.jsx("span",{className:`w-1.5 h-1.5 ${n}`,"aria-hidden":"true"}),i.jsx("span",{className:"font-mono text-[0.6rem] opacity-50 uppercase",children:e})]})}function ni(e){if(!e)return null;try{const t=new Date(e);if(isNaN(t.getTime()))return null;const n=new Date;return n.setHours(0,0,0,0),t.setHours(0,0,0,0),Math.ceil((t.getTime()-n.getTime())/(24*60*60*1e3))}catch{return null}}function dd(e){return e===null?"none":e<0?"expired":e<=7?"critical":e<=30?"warning":"ok"}function Z1(e,t){switch(e){case"expired":return i.jsx(H,{variant:"error",size:"xs",children:"EXPIRED"});case"critical":return i.jsxs(H,{variant:"error",size:"xs",children:[t,"d LEFT"]});case"warning":return i.jsxs(H,{variant:"warning",size:"xs",children:[t,"d LEFT"]});case"ok":return i.jsxs(H,{variant:"success",size:"xs",children:[t,"d LEFT"]});case"none":return i.jsx(H,{variant:"neutral",size:"xs",children:"NO EXPIRY"});default:return null}}function eb(e){if(!e)return"—";try{const t=new Date(e);return isNaN(t.getTime())?e:t.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}catch{return e}}function tb(e){switch(e){case"expired":return"bg-red-500/5";case"critical":return"bg-red-500/5";case"warning":return"bg-amber-500/5";default:return""}}function nb(e){const t=Date.now()-new Date(e).getTime(),n=Math.floor(t/6e4);if(n<1)return"just now";if(n<60)return`${n}m ago`;const s=Math.floor(n/60);return s<24?`${s}h ago`:`${Math.floor(s/24)}d ago`}function sb(){const[e,t]=b.useState("idle"),[n,s]=b.useState(""),[r,a]=b.useState([]),[o,l]=b.useState(null),[c,u]=b.useState("all"),[p,d]=b.useState(null),[f,x]=b.useState(!1),y=e==="clients"||e==="trustedby";b.useEffect(()=>{let j=!1;return B.getCachedTrustedPeers().then(N=>{if(!j&&N.data&&N.data.length>0){if(t(S=>S==="clients"||S==="trustedby"?(j=!0,S):"done"),j)return;const C=N.data;a(C),d(N.fetchedAt),x(!0),s(`Loaded ${C.length} trusted peers from cache.`)}}).catch(()=>{}),()=>{j=!0}},[]);const v=b.useCallback(async()=>{t("clients"),l(null),a([]),x(!1),s("Fetching client list (all regions)...");try{const j=await B.run("tokenmaster/clients-list",{region:"all"});if(!j.ok&&j.error){l(j.error),t("error");return}const N=(j.data??[]).map(k=>({id:String(k.id??""),name:String(k.name??""),region:String(k.region??"emea")}));if(N.length===0){s("No clients found."),t("done");return}t("trustedby");const C=[],S=N.length;for(let k=0;k<N.length;k++){const T=N[k];s(`Fetching trusted peers... (${k+1}/${S}) — ${T.name||T.id}`);try{const L=await B.run("tokenmaster/client-trustedby",{clientid:T.id,region:T.region});if(L.ok&&L.data)for(const O of L.data)C.push({parentClientId:T.id,parentClientName:T.name||T.id,peerId:String(O.id??""),peerName:String(O.name??""),peerIdDisplay:String(O.idDisplay??""),expiryDate:O.expiry_date?String(O.expiry_date):null,region:String(O.region??T.region)})}catch{}}if(a(C),s(`Loaded ${C.length} trusted peers from ${S} clients.`),t("done"),C.length>0){const k=new Date().toISOString();d(k),B.cacheTrustedPeers(C).catch(()=>{})}}catch(j){l(j instanceof Error?j.message:"Unknown error"),t("error")}},[]),w=b.useMemo(()=>[...c==="all"?r:r.filter(N=>N.region===c)].sort((N,C)=>{const S=ni(N.expiryDate),k=ni(C.expiryDate);return S===null&&k===null?0:S===null?1:k===null?-1:S-k}),[r,c]),g=b.useMemo(()=>{let j=0,N=0,C=0;for(const S of w){const k=dd(ni(S.expiryDate));k==="expired"?j++:k==="critical"?N++:k==="warning"&&C++}return{total:w.length,expired:j,critical:N,warning:C}},[w]),h=b.useMemo(()=>{const j=new Set(r.map(N=>N.region));return Array.from(j).sort()},[r]),m=j=>(j==null?void 0:j.includes("auth_required"))||(j==null?void 0:j.includes("sign in"));return i.jsxs("div",{className:"max-w-5xl mx-auto",children:[i.jsx("h2",{className:"font-display text-xl font-bold uppercase tracking-[0.06em] mb-5",children:"Trusted Peer Expiry"}),p&&!y&&i.jsxs("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-3",children:[f?"Showing cached data from":"Last fetched"," ",nb(p)]}),i.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-end gap-3 mb-6",children:[i.jsxs("label",{className:"form-control w-full sm:w-auto",children:[i.jsx("span",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Region"}),i.jsxs("select",{className:"select select-bordered select-sm w-full sm:w-auto",value:c,onChange:j=>u(j.target.value),children:[i.jsx("option",{value:"all",children:"All regions"}),h.map(j=>i.jsx("option",{value:j,children:j.toUpperCase()},j))]})]}),i.jsx("button",{className:"btn btn-primary btn-sm w-full sm:w-auto",onClick:v,disabled:y,children:y?"Loading...":"Load trusted peers"})]}),y&&i.jsx(ut,{label:n}),o&&(m(o)?i.jsx(wn,{message:"Sign in to TokenMaster in Chrome, then try again."}):i.jsx("div",{className:"alert alert-error mb-3",children:i.jsx("span",{children:o})})),r.length>0&&!y&&i.jsxs("div",{className:"grid grid-cols-4 border border-base-300 mb-6",children:[i.jsxs("div",{className:"p-3 border-r border-base-300",children:[i.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Total"}),i.jsx("div",{className:"font-display text-xl font-bold",children:g.total})]}),i.jsxs("div",{className:"p-3 border-r border-base-300",children:[i.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Expired"}),i.jsx("div",{className:`font-display text-xl font-bold ${g.expired>0?"text-red-500":""}`,children:g.expired})]}),i.jsxs("div",{className:"p-3 border-r border-base-300",children:[i.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"≤ 7 days"}),i.jsx("div",{className:`font-display text-xl font-bold ${g.critical>0?"text-red-500":""}`,children:g.critical})]}),i.jsxs("div",{className:"p-3",children:[i.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"≤ 30 days"}),i.jsx("div",{className:`font-display text-xl font-bold ${g.warning>0?"text-amber-500":""}`,children:g.warning})]})]}),w.length>0&&i.jsx("div",{className:"border border-base-300 overflow-x-auto",children:i.jsxs("table",{className:"table table-sm w-full",children:[i.jsx("thead",{children:i.jsxs("tr",{className:"border-b border-base-300",children:[i.jsx("th",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em]",children:"Status"}),i.jsx("th",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em]",children:"Expiry Date"}),i.jsx("th",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em]",children:"Days Left"}),i.jsx("th",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em]",children:"Trusted Peer"}),i.jsx("th",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em]",children:"Peer ID"}),i.jsx("th",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em]",children:"Parent Client"}),i.jsx("th",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em]",children:"Region"})]})}),i.jsx("tbody",{children:w.map((j,N)=>{const C=ni(j.expiryDate),S=dd(C);return i.jsxs("tr",{className:`border-b border-base-300/50 ${tb(S)}`,children:[i.jsx("td",{children:Z1(S,C)}),i.jsx("td",{className:"font-mono text-sm",children:eb(j.expiryDate)}),i.jsx("td",{className:"font-mono text-sm",children:C!==null?C<0?`${Math.abs(C)}d overdue`:`${C}d`:"—"}),i.jsx("td",{className:"text-sm font-semibold",children:j.peerName||j.peerId}),i.jsx("td",{className:"font-mono text-xs opacity-60",children:j.peerIdDisplay||j.peerId}),i.jsx("td",{className:"text-sm",children:j.parentClientName}),i.jsx("td",{children:i.jsx(H,{variant:"neutral",size:"xs",children:j.region.toUpperCase()})})]},`${j.parentClientId}-${j.peerId}-${j.region}-${N}`)})})]})}),e==="done"&&!y&&r.length>0&&i.jsx("div",{className:"mt-1 font-mono text-xs opacity-40",children:n}),e==="done"&&r.length===0&&!y&&i.jsxs("div",{className:"border border-base-300 p-6 text-center",children:[i.jsx("p",{className:"text-sm opacity-50 mb-1",children:"No trusted peers found"}),i.jsx("p",{className:"font-mono text-xs opacity-30",children:"No clients returned from TokenMaster, or no trustedby relationships exist."})]}),e==="idle"&&i.jsxs("div",{className:"border border-base-300 p-8 text-center",children:[i.jsx("p",{className:"text-sm opacity-50 mb-1",children:"TokenMaster trusted peer expiry monitor"}),i.jsx("p",{className:"font-mono text-xs opacity-30",children:'Press "Load trusted peers" to fetch all clients and their trusted peer expiry dates across all regions.'})]})]})}const rb={client:"border-sky-500/50 bg-sky-500/10 text-sky-700 dark:text-sky-400",daemon:"border-amber-500/50 bg-amber-500/10 text-amber-700 dark:text-amber-400",extension:"border-emerald-500/50 bg-emerald-500/10 text-emerald-700 dark:text-emerald-400",browser:"border-violet-500/50 bg-violet-500/10 text-violet-700 dark:text-violet-400"},ib={client:"bg-sky-400/20",daemon:"bg-amber-400/20",extension:"bg-emerald-400/20",browser:"bg-violet-400/20"};function pl({flow:e}){const{lanes:t,steps:n,title:s}=e,r=t.length,a=`repeat(${r}, 1fr)`;return i.jsxs("div",{className:"border border-base-300 p-4 overflow-x-auto",children:[i.jsx("h4",{className:"font-semibold text-sm mb-3",children:s}),i.jsxs("div",{style:{minWidth:r*130},children:[i.jsx("div",{className:"grid",style:{gridTemplateColumns:a},children:t.map(o=>i.jsx("div",{className:"flex justify-center",children:i.jsx("span",{className:`px-2 py-1 text-[0.65rem] font-mono font-semibold border ${rb[o.color]}`,children:o.label})},o.id))}),i.jsxs("div",{className:"relative py-1",children:[i.jsx("div",{className:"absolute inset-0 grid pointer-events-none",style:{gridTemplateColumns:a},children:t.map(o=>i.jsx("div",{className:"flex justify-center",children:i.jsx("div",{className:`w-0.5 h-full ${ib[o.color]}`})},o.id))}),i.jsx("div",{className:"relative",children:n.map((o,l)=>{if(o.type==="action"){const w=(t.findIndex(g=>g.id===o.lane)+.5)/r*100;return i.jsx("div",{className:"relative",style:{height:26},children:i.jsx("div",{className:"absolute top-1/2 -translate-x-1/2 -translate-y-1/2 z-10",style:{left:`${w}%`},children:i.jsx("span",{className:"block px-2 py-0.5 text-[0.6rem] font-mono bg-base-200/90 border border-base-300/60 text-base-content/60 whitespace-nowrap",children:o.label})})},l)}const c=t.findIndex(v=>v.id===o.from),u=t.findIndex(v=>v.id===o.to),p=(c+.5)/r*100,d=(u+.5)/r*100,f=Math.min(p,d),x=Math.abs(d-p),y=c<u;return i.jsxs("div",{className:"relative",style:{height:30},children:[i.jsx("div",{className:"absolute top-1/2 h-px bg-base-content/20",style:{left:`${f}%`,width:`${x}%`}}),i.jsx("div",{className:"absolute top-1/2 w-1.5 h-1.5 rounded-full bg-base-content/30 -translate-x-1/2 -translate-y-1/2",style:{left:`${p}%`}}),i.jsx("div",{className:"absolute top-1/2 -translate-y-1/2 text-[0.55rem] leading-none text-base-content/40",style:{left:`${d}%`,transform:`translate(${y?"-100%":"0"}, -50%)`},children:y?"▸":"◂"}),i.jsx("div",{className:"absolute top-1/2 -translate-x-1/2 -translate-y-1/2 z-10",style:{left:`${(p+d)/2}%`},children:i.jsx("span",{className:"px-1.5 py-px text-[0.6rem] font-mono bg-base-100 text-base-content/60 whitespace-nowrap",children:o.label})})]},l)})})]})]})]})}const ab=[{name:"CLI Client",tech:"Node.js / Commander.js",port:null,desc:"Terminal interface. Sends commands to the Daemon over HTTP, formats output as table / JSON / CSV.",pkg:"@commandgarden/cli"},{name:"GUI",tech:"React SPA / Vite / Tailwind / DaisyUI",port:null,desc:"Browser-based interface. Talks to the App Server — never to the Daemon directly.",pkg:null},{name:"App Server",tech:"Fastify / SQLite",port:"9092",desc:"GUI backend. Proxies Daemon calls, enriches responses, and owns app-specific state (preferences, cached reports, goals).",pkg:"@commandgarden/app"},{name:"Daemon",tech:"Fastify / WebSocket / SQLite",port:"9091",desc:"Core service. Validates auth and capabilities, loads connectors, relays pipelines to the Chrome Extension, writes audit log.",pkg:"@commandgarden/daemon"},{name:"Chrome Extension",tech:"MV3 / TypeScript / Service Worker",port:null,desc:"Runs connector pipelines inside browser tabs via content scripts and CDP. Connects to the Daemon via WebSocket.",pkg:null}],ob=[{name:"Audit Log",tech:"SQLite",path:"~/.commandgarden/audit.db",desc:"Every command execution, denial, auth failure, and config change."},{name:"App DB",tech:"SQLite",path:"~/.commandgarden/app.db",desc:"Preferences, cached reports, goals, and saved views."},{name:"Config",tech:"YAML",path:"~/.commandgarden/config.yaml",desc:"Daemon + security + connector + audit settings."},{name:"Session Token",tech:"File",path:"~/.commandgarden/session-token",desc:"Bearer token generated on daemon start. CLI and App Server read it for auth."}],lb=[{title:"Command execution (CLI path)",lanes:[{id:"cli",label:"CLI",color:"client"},{id:"daemon",label:"Daemon :9091",color:"daemon"},{id:"ext",label:"Extension",color:"extension"},{id:"browser",label:"Browser Tab",color:"browser"}],steps:[{type:"arrow",from:"cli",to:"daemon",label:"POST /api/run (HTTP)"},{type:"action",lane:"daemon",label:"validate token + CSRF"},{type:"action",lane:"daemon",label:"check connector, domains, capabilities"},{type:"action",lane:"daemon",label:"audit: command.start"},{type:"action",lane:"daemon",label:"split pipeline (extension vs daemon steps)"},{type:"arrow",from:"daemon",to:"ext",label:"relay extension steps (WS)"},{type:"arrow",from:"ext",to:"browser",label:"execute pipeline steps"},{type:"arrow",from:"browser",to:"ext",label:"page data"},{type:"arrow",from:"ext",to:"daemon",label:"results (WS)"},{type:"action",lane:"daemon",label:"run daemon-side steps (transform, map)"},{type:"action",lane:"daemon",label:"audit: command.success / error"},{type:"arrow",from:"daemon",to:"cli",label:"structured data response"}]},{title:"Command execution (GUI path)",lanes:[{id:"gui",label:"GUI",color:"client"},{id:"app",label:"App Server :9092",color:"daemon"},{id:"daemon",label:"Daemon :9091",color:"daemon"}],steps:[{type:"arrow",from:"gui",to:"app",label:"POST /api/run (HTTP)"},{type:"arrow",from:"app",to:"daemon",label:"proxy to daemon (HTTP)"},{type:"action",lane:"daemon",label:"validate, execute, audit (same as CLI path)"},{type:"arrow",from:"daemon",to:"app",label:"structured data"},{type:"arrow",from:"app",to:"gui",label:"enriched response"}]},{title:"Step approval flow",lanes:[{id:"client",label:"CLI / GUI",color:"client"},{id:"daemon",label:"Daemon",color:"daemon"},{id:"ext",label:"Extension",color:"extension"}],steps:[{type:"action",lane:"daemon",label:"detect approval-required capability"},{type:"arrow",from:"daemon",to:"client",label:"HTTP 202 + requestId"},{type:"arrow",from:"daemon",to:"client",label:"approval prompt (SSE)"},{type:"arrow",from:"daemon",to:"ext",label:"approval notification (WS)"},{type:"arrow",from:"client",to:"daemon",label:"POST /api/approval"},{type:"arrow",from:"ext",to:"daemon",label:"resolve via WS"},{type:"action",lane:"daemon",label:"first responder wins → continue or abort"},{type:"action",lane:"daemon",label:"audit: approval.granted / rejected"}]},{title:"Extension connection",lanes:[{id:"ext",label:"Extension",color:"extension"},{id:"daemon",label:"Daemon",color:"daemon"}],steps:[{type:"arrow",from:"ext",to:"daemon",label:"WS connect :9091"},{type:"action",lane:"daemon",label:"validate origin"},{type:"action",lane:"daemon",label:"attach WS relay"},{type:"action",lane:"ext",label:"ready for commands"},{type:"arrow",from:"ext",to:"daemon",label:"heartbeat"}]}],cb=[{name:"shared",desc:"Connector schema (Zod), protocol messages, audit events, expression parser, pipeline definitions",published:!1},{name:"daemon",desc:"HTTP + WebSocket server, auth, connector registry, capability validation, audit store, WebSocket relay",published:!1},{name:"cli",desc:"CLI client (Commander.js) — run, list, inspect, validate, daemon/gui management, audit queries, config",published:!0},{name:"chrome",desc:"Chrome MV3 extension — service worker, content scripts, domain guard, pipeline step execution engine",published:!1},{name:"app",desc:"Web GUI — Fastify app server + React SPA (Vite, Tailwind, DaisyUI)",published:!1},{name:"connectors",desc:"Built-in YAML connector definitions",published:!1}];function ub(){return i.jsxs("div",{className:"max-w-4xl mx-auto",children:[i.jsx("h2",{className:"font-display text-xl font-bold uppercase tracking-[0.06em] mb-1",children:"Architecture"}),i.jsx("p",{className:"text-sm opacity-60 mb-6",children:"How commandGarden's components fit together."}),i.jsx("div",{id:"arch-diagram",className:"border border-base-300 p-5 mb-8 overflow-x-auto scroll-mt-4",children:i.jsxs("svg",{viewBox:"0 0 780 300",className:"w-full text-base-content",style:{minWidth:620},children:[i.jsxs("defs",{children:[i.jsx("marker",{id:"arch-ah",viewBox:"0 0 10 8",refX:"10",refY:"4",markerWidth:"7",markerHeight:"5",orient:"auto",children:i.jsx("path",{d:"M0 0L10 4L0 8z",fill:"currentColor",fillOpacity:.3})}),i.jsx("marker",{id:"arch-ah-rev",viewBox:"0 0 10 8",refX:"0",refY:"4",markerWidth:"7",markerHeight:"5",orient:"auto",children:i.jsx("path",{d:"M10 0L0 4L10 8z",fill:"currentColor",fillOpacity:.3})})]}),i.jsx("rect",{x:15,y:8,width:120,height:50,rx:3,fill:"rgba(56,189,248,0.08)",stroke:"rgba(56,189,248,0.4)",strokeWidth:1}),i.jsx("text",{x:75,y:29,textAnchor:"middle",fill:"currentColor",fontSize:11,fontWeight:600,children:"CLI Client"}),i.jsx("text",{x:75,y:44,textAnchor:"middle",fill:"currentColor",fontSize:9,opacity:.4,fontFamily:"ui-monospace,monospace",children:"Node.js"}),i.jsx("rect",{x:15,y:120,width:120,height:50,rx:3,fill:"rgba(56,189,248,0.08)",stroke:"rgba(56,189,248,0.4)",strokeWidth:1}),i.jsx("text",{x:75,y:141,textAnchor:"middle",fill:"currentColor",fontSize:11,fontWeight:600,children:"GUI"}),i.jsx("text",{x:75,y:156,textAnchor:"middle",fill:"currentColor",fontSize:9,opacity:.4,fontFamily:"ui-monospace,monospace",children:"React SPA"}),i.jsx("rect",{x:190,y:120,width:145,height:50,rx:3,fill:"rgba(251,191,36,0.08)",stroke:"rgba(251,191,36,0.4)",strokeWidth:1}),i.jsx("text",{x:262,y:141,textAnchor:"middle",fill:"currentColor",fontSize:11,fontWeight:600,children:"App Server"}),i.jsx("text",{x:262,y:156,textAnchor:"middle",fill:"currentColor",fontSize:9,opacity:.4,fontFamily:"ui-monospace,monospace",children:"Fastify :9092"}),i.jsx("rect",{x:395,y:10,width:160,height:84,rx:3,fill:"rgba(251,191,36,0.08)",stroke:"rgba(251,191,36,0.5)",strokeWidth:1.5}),i.jsx("text",{x:475,y:38,textAnchor:"middle",fill:"currentColor",fontSize:13,fontWeight:700,children:"Daemon"}),i.jsx("text",{x:475,y:56,textAnchor:"middle",fill:"currentColor",fontSize:9,opacity:.4,fontFamily:"ui-monospace,monospace",children:"Fastify :9091"}),i.jsx("text",{x:475,y:78,textAnchor:"middle",fill:"currentColor",fontSize:8,opacity:.25,fontFamily:"ui-monospace,monospace",children:"auth · registry · audit"}),i.jsx("rect",{x:615,y:20,width:150,height:60,rx:3,fill:"rgba(52,211,153,0.08)",stroke:"rgba(52,211,153,0.4)",strokeWidth:1}),i.jsx("text",{x:690,y:44,textAnchor:"middle",fill:"currentColor",fontSize:11,fontWeight:600,children:"Extension"}),i.jsx("text",{x:690,y:62,textAnchor:"middle",fill:"currentColor",fontSize:9,opacity:.4,fontFamily:"ui-monospace,monospace",children:"Chrome MV3"}),i.jsx("rect",{x:630,y:200,width:130,height:50,rx:3,fill:"rgba(167,139,250,0.08)",stroke:"rgba(167,139,250,0.4)",strokeWidth:1}),i.jsx("text",{x:695,y:221,textAnchor:"middle",fill:"currentColor",fontSize:11,fontWeight:600,children:"Browser Tab"}),i.jsx("text",{x:695,y:237,textAnchor:"middle",fill:"currentColor",fontSize:9,opacity:.4,fontFamily:"ui-monospace,monospace",children:"target page"}),i.jsx("rect",{x:195,y:240,width:100,height:36,rx:3,fill:"currentColor",fillOpacity:.04,stroke:"currentColor",strokeOpacity:.12,strokeWidth:1}),i.jsx("text",{x:245,y:257,textAnchor:"middle",fill:"currentColor",fontSize:9,fontWeight:500,opacity:.45,children:"App DB"}),i.jsx("text",{x:245,y:269,textAnchor:"middle",fill:"currentColor",fontSize:8,opacity:.25,fontFamily:"ui-monospace,monospace",children:"SQLite"}),i.jsx("rect",{x:390,y:200,width:105,height:36,rx:3,fill:"currentColor",fillOpacity:.04,stroke:"currentColor",strokeOpacity:.12,strokeWidth:1}),i.jsx("text",{x:442,y:217,textAnchor:"middle",fill:"currentColor",fontSize:9,fontWeight:500,opacity:.45,children:"Audit Log"}),i.jsx("text",{x:442,y:229,textAnchor:"middle",fill:"currentColor",fontSize:8,opacity:.25,fontFamily:"ui-monospace,monospace",children:"SQLite"}),i.jsx("rect",{x:500,y:200,width:85,height:36,rx:3,fill:"currentColor",fillOpacity:.04,stroke:"currentColor",strokeOpacity:.12,strokeWidth:1}),i.jsx("text",{x:542,y:217,textAnchor:"middle",fill:"currentColor",fontSize:9,fontWeight:500,opacity:.45,children:"Config"}),i.jsx("text",{x:542,y:229,textAnchor:"middle",fill:"currentColor",fontSize:8,opacity:.25,fontFamily:"ui-monospace,monospace",children:"YAML"}),i.jsx("rect",{x:75,y:200,width:105,height:36,rx:3,fill:"currentColor",fillOpacity:.04,stroke:"currentColor",strokeOpacity:.12,strokeWidth:1}),i.jsx("text",{x:127,y:217,textAnchor:"middle",fill:"currentColor",fontSize:9,fontWeight:500,opacity:.45,children:"Session Token"}),i.jsx("text",{x:127,y:229,textAnchor:"middle",fill:"currentColor",fontSize:8,opacity:.25,fontFamily:"ui-monospace,monospace",children:"file"}),i.jsx("line",{x1:137,y1:33,x2:393,y2:45,stroke:"currentColor",strokeOpacity:.15,markerEnd:"url(#arch-ah)"}),i.jsx("text",{x:255,y:28,textAnchor:"middle",fill:"currentColor",fontSize:8,opacity:.4,fontFamily:"ui-monospace,monospace",children:"HTTP :9091"}),i.jsx("line",{x1:137,y1:145,x2:188,y2:145,stroke:"currentColor",strokeOpacity:.15,markerEnd:"url(#arch-ah)"}),i.jsx("line",{x1:337,y1:138,x2:393,y2:78,stroke:"currentColor",strokeOpacity:.15,markerEnd:"url(#arch-ah)"}),i.jsx("text",{x:354,y:97,textAnchor:"middle",fill:"currentColor",fontSize:8,opacity:.4,fontFamily:"ui-monospace,monospace",children:"proxy"}),i.jsx("line",{x1:557,y1:50,x2:613,y2:50,stroke:"currentColor",strokeOpacity:.2,strokeWidth:1.5,markerEnd:"url(#arch-ah)",markerStart:"url(#arch-ah-rev)"}),i.jsx("text",{x:585,y:40,textAnchor:"middle",fill:"currentColor",fontSize:8,opacity:.4,fontFamily:"ui-monospace,monospace",children:"WebSocket"}),i.jsx("line",{x1:695,y1:82,x2:695,y2:198,stroke:"currentColor",strokeOpacity:.15,markerEnd:"url(#arch-ah)"}),i.jsx("text",{x:720,y:132,fill:"currentColor",fontSize:8,opacity:.35,fontFamily:"ui-monospace,monospace",children:"Content"}),i.jsx("text",{x:720,y:144,fill:"currentColor",fontSize:8,opacity:.35,fontFamily:"ui-monospace,monospace",children:"Scripts"}),i.jsx("text",{x:720,y:160,fill:"currentColor",fontSize:8,opacity:.35,fontFamily:"ui-monospace,monospace",children:"+ CDP"}),i.jsx("line",{x1:245,y1:172,x2:245,y2:238,stroke:"currentColor",strokeOpacity:.1,strokeDasharray:"3 2"}),i.jsx("line",{x1:442,y1:96,x2:442,y2:198,stroke:"currentColor",strokeOpacity:.1,strokeDasharray:"3 2"}),i.jsx("line",{x1:520,y1:96,x2:542,y2:198,stroke:"currentColor",strokeOpacity:.1,strokeDasharray:"3 2"}),i.jsx("line",{x1:75,y1:60,x2:110,y2:198,stroke:"currentColor",strokeOpacity:.08,strokeDasharray:"3 2"}),i.jsx("line",{x1:200,y1:172,x2:155,y2:198,stroke:"currentColor",strokeOpacity:.08,strokeDasharray:"3 2"})]})}),i.jsx("h3",{id:"arch-components",className:"font-display text-base font-semibold mb-3 scroll-mt-4",children:"Components"}),i.jsx("div",{className:"space-y-2 mb-8",children:ab.map(e=>i.jsxs("div",{className:"border border-base-300 p-4",children:[i.jsxs("div",{className:"flex items-center gap-3 flex-wrap mb-1",children:[i.jsx("span",{className:"font-semibold",children:e.name}),i.jsx(H,{size:"xs",children:e.tech}),e.port&&i.jsxs(H,{variant:"info",size:"xs",children:[":",e.port]}),e.pkg&&i.jsx(H,{variant:"secondary",size:"xs",children:e.pkg})]}),i.jsx("p",{className:"text-sm opacity-60",children:e.desc})]},e.name))}),i.jsx("h3",{id:"arch-stores",className:"font-display text-base font-semibold mb-3 scroll-mt-4",children:"Data Stores"}),i.jsx("div",{className:"overflow-x-auto border border-base-300 mb-8",children:i.jsxs("table",{className:"table table-sm w-full",children:[i.jsx("thead",{children:i.jsxs("tr",{className:"bg-base-200",children:[i.jsx("th",{children:"Store"}),i.jsx("th",{children:"Format"}),i.jsx("th",{children:"Path"}),i.jsx("th",{children:"Purpose"})]})}),i.jsx("tbody",{children:ob.map(e=>i.jsxs("tr",{className:"hover:bg-base-200",children:[i.jsx("td",{className:"font-semibold text-sm",children:e.name}),i.jsx("td",{children:i.jsx(H,{size:"xs",children:e.tech})}),i.jsx("td",{className:"font-mono text-xs opacity-60",children:e.path}),i.jsx("td",{className:"text-sm opacity-60",children:e.desc})]},e.name))})]})}),i.jsx("h3",{id:"arch-flows",className:"font-display text-base font-semibold mb-3 scroll-mt-4",children:"Data Flows"}),i.jsxs("p",{className:"text-sm opacity-60 mb-4",children:["For a plain-language walkthrough of these same flows, see"," ",i.jsxs(xe,{to:"/concepts",className:"text-primary hover:underline inline-flex items-center gap-1",children:["Concepts ",i.jsx(He,{className:"w-3 h-3"})]}),"."]}),i.jsx("div",{className:"space-y-4 mb-8",children:lb.map(e=>i.jsx(pl,{flow:e},e.title))}),i.jsx("h3",{id:"arch-security",className:"font-display text-base font-semibold mb-3 scroll-mt-4",children:"Security Model"}),i.jsx("div",{className:"border border-base-300 p-4 mb-8",children:i.jsxs("ul",{className:"space-y-2",children:[i.jsxs("li",{className:"text-sm opacity-70",children:[i.jsx("span",{className:"font-semibold opacity-100",children:"Session token"})," — generated on daemon start, stored at ~/.commandgarden/session-token. Every API call (except /api/status) requires Bearer auth + X-CommandGarden CSRF header."]}),i.jsxs("li",{className:"text-sm opacity-70",children:[i.jsx("span",{className:"font-semibold opacity-100",children:"Domain guard"})," — connector YAML declares allowed domains. Extension refuses to run on undeclared domains."]}),i.jsxs("li",{className:"text-sm opacity-70",children:[i.jsx("span",{className:"font-semibold opacity-100",children:"Capability gating"})," — each pipeline step requires a declared capability. High-risk capabilities (js_evaluate, cookie_write) require explicit approval."]}),i.jsxs("li",{className:"text-sm opacity-70",children:[i.jsx("span",{className:"font-semibold opacity-100",children:"Audit-or-fail"})," — if the audit store is unavailable, commands are blocked."]}),i.jsxs("li",{className:"text-sm opacity-70",children:[i.jsx("span",{className:"font-semibold opacity-100",children:"No credentials stored"})," — commandGarden reuses existing Chrome sessions. No passwords or cookies are persisted."]}),i.jsxs("li",{className:"text-sm opacity-70",children:[i.jsx("span",{className:"font-semibold opacity-100",children:"Localhost only"})," — daemon and app server bind to 127.0.0.1 by default."]})]})}),i.jsx("h3",{id:"arch-packages",className:"font-display text-base font-semibold mb-3 scroll-mt-4",children:"Workspace Packages"}),i.jsx("div",{className:"overflow-x-auto border border-base-300 mb-8",children:i.jsxs("table",{className:"table table-sm w-full",children:[i.jsx("thead",{children:i.jsxs("tr",{className:"bg-base-200",children:[i.jsx("th",{children:"Package"}),i.jsx("th",{children:"Description"}),i.jsx("th",{children:"Published"})]})}),i.jsx("tbody",{children:cb.map(e=>i.jsxs("tr",{className:"hover:bg-base-200",children:[i.jsx("td",{className:"font-mono text-sm font-semibold",children:e.name}),i.jsx("td",{className:"text-sm opacity-60",children:e.desc}),i.jsx("td",{children:e.published?i.jsx(H,{variant:"success",size:"xs",children:"npm"}):i.jsx(H,{size:"xs",children:"bundled"})})]},e.name))})]})}),i.jsx("h3",{id:"arch-build",className:"font-display text-base font-semibold mb-3 scroll-mt-4",children:"Build Order"}),i.jsxs("div",{className:"border border-base-300 p-4",children:[i.jsx("div",{className:"flex flex-wrap items-center gap-2 font-mono text-sm",children:["shared","daemon","cli","chrome","app"].map((e,t)=>i.jsxs("span",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"px-2 py-1 border border-base-300 bg-base-200",children:e}),t<4&&i.jsx("span",{className:"opacity-40",children:"→"})]},e))}),i.jsxs("p",{className:"text-sm opacity-60 mt-2",children:["Run ",i.jsx("code",{className:"font-mono text-xs bg-base-200 px-1 py-0.5",children:"npm run build"})," from the commandGarden root to build all packages in dependency order."]})]})]})}const db={GET:"success",POST:"warning",PUT:"info",DELETE:"error",WS:"secondary",SSE:"secondary"},fb=[{method:"GET",path:"/api/status",auth:!1,desc:"Health check. Returns daemon status, extension connection, and connector count."},{method:"GET",path:"/api/connectors",auth:!0,desc:"List all loaded connectors with key, description, access, domains, and capabilities."},{method:"GET",path:"/api/connectors/:site/:name",auth:!0,desc:"Full connector definition including pipeline, args, and columns.",params:"site, name — connector key segments"},{method:"POST",path:"/api/run",auth:!0,desc:"Execute a connector pipeline. Returns structured data. Returns 202 with requestId if step approval is required.",body:"{ connector: string, args: Record<string, string> }"},{method:"GET",path:"/api/audit",auth:!0,desc:"List audit events with optional filters.",params:"since?, connector?, type?, limit?"},{method:"GET",path:"/api/audit/:id",auth:!0,desc:"Single audit event with full detail including pipeline steps."},{method:"GET",path:"/api/config",auth:!0,desc:"Read the full config.yaml as JSON."},{method:"POST",path:"/api/config",auth:!0,desc:"Set a config value. Key must be section.property format.",body:"{ key: string, value: string }"},{method:"POST",path:"/api/approval",auth:!0,desc:"Resolve a pending step approval.",body:"{ approvalId: string, approved: boolean }"},{method:"SSE",path:"/api/run/events/:requestId",auth:!0,desc:"Server-Sent Events stream for approval-required runs. Sends approval and result events."},{method:"WS",path:"/ws/extension",auth:!1,desc:"WebSocket endpoint for Chrome Extension. Origin validated against security.extensionId."}],pb=[{method:"GET",path:"/api/status",auth:!1,desc:"Proxied daemon status (same as daemon /api/status)."},{method:"GET",path:"/api/connectors",auth:!1,desc:"Enriched connector list with hasAppPage, appRoute, isHighRisk, isApproved, isAutoApproved."},{method:"GET",path:"/api/connectors/:site/:name",auth:!1,desc:"Proxied connector detail."},{method:"POST",path:"/api/run",auth:!1,desc:"Proxied connector execution."},{method:"GET",path:"/api/audit",auth:!1,desc:"Proxied audit event list."},{method:"GET",path:"/api/audit/:id",auth:!1,desc:"Proxied single audit event."},{method:"GET",path:"/api/config",auth:!1,desc:"Proxied config read."},{method:"POST",path:"/api/config",auth:!1,desc:"Proxied config write."},{method:"POST",path:"/api/approval",auth:!1,desc:"Proxied approval resolution."},{method:"GET",path:"/api/preferences",auth:!1,desc:"Read app preferences (SQLite-backed).",response:"{ ok, preferences }"},{method:"PUT",path:"/api/preferences",auth:!1,desc:"Set an app preference.",body:"{ key: string, value: string }"},{method:"GET",path:"/api/goals",auth:!1,desc:"Read goals for a month.",params:"month (YYYY-MM)"},{method:"POST",path:"/api/goals",auth:!1,desc:"Create or update a goal.",body:"{ month, projectId, activity, targetDays }"},{method:"DELETE",path:"/api/goals/:id",auth:!1,desc:"Delete a goal."},{method:"GET",path:"/api/timetracking/cache",auth:!1,desc:"Get cached timetracking report for a month.",params:"month (YYYY-MM)"},{method:"POST",path:"/api/timetracking/cache",auth:!1,desc:"Store timetracking report in cache.",body:"{ month, data }"},{method:"GET",path:"/api/timetracking/projects",auth:!1,desc:"Get cached project/activity list."},{method:"POST",path:"/api/timetracking/projects",auth:!1,desc:"Store project/activity list in cache.",body:"{ data }"},{method:"POST",path:"/api/journal/generate",auth:!1,desc:"Generate a dev journal for a given week.",body:"{ weekStart: string }"},{method:"GET",path:"/api/security-news/cache",auth:!1,desc:"Get cached security news articles."},{method:"POST",path:"/api/security-news/cache",auth:!1,desc:"Store security news in cache.",body:"{ data }"}],mb=[{cmd:"cg up",desc:"Start daemon + GUI, open browser.",opts:["--no-open Skip opening browser"]},{cmd:"cg down",desc:"Stop GUI + daemon."},{cmd:"cg run <connector>",desc:"Run a connector command.",args:"Connector key (site/name), plus connector-specific args as --key value",opts:["-f, --format <format> Output format: table, json, csv (default: table)"],example:"cg run timetracking/report --month 2026-07 --format json"},{cmd:"cg list",desc:"List all installed connectors with access, domains, and capabilities."},{cmd:"cg inspect <connector>",desc:"Show full details of a connector (args, columns, pipeline).",example:"cg inspect teams/room-availability"},{cmd:"cg validate <file>",desc:"Validate a connector YAML file against the schema.",example:"cg validate connectors/my-connector.yaml"},{cmd:"cg daemon status",desc:"Check if the daemon is running."},{cmd:"cg daemon start",desc:"Start the daemon in background."},{cmd:"cg daemon stop",desc:"Stop the daemon."},{cmd:"cg gui",desc:"Start the GUI app server (foreground by default).",opts:["-b, --background Run in background","--no-open Skip opening browser"]},{cmd:"cg gui stop",desc:"Stop the GUI app server."},{cmd:"cg gui status",desc:"Check if the GUI is running."},{cmd:"cg audit list",desc:"List recent audit events.",opts:["--since <duration> Time window (e.g. 7d, 2w, 12h)","--connector <pattern> Filter by connector (e.g. test/*)","--type <pattern> Filter by event type (e.g. auth.failed)","--limit <n> Max events (default: 100)"]},{cmd:"cg audit show <id>",desc:"Show full details of a single audit event including pipeline steps."},{cmd:"cg audit export",desc:"Export audit events.",opts:["--format <format> Export format: json, csv (default: json)","--since <duration> Time window","--connector <pattern> Filter","--type <pattern> Filter"]},{cmd:"cg config show",desc:"Show current config.yaml contents."},{cmd:"cg config set <key> <value>",desc:"Set a config value (section.property format).",example:"cg config set daemon.port 9999"},{cmd:"cg extension setup",desc:"Show extension path and instructions for Chrome installation."}],hb=[{step:"navigate",capability:"navigate",desc:"Open a URL in the browser tab"},{step:"wait",capability:"navigate",desc:"Wait for a selector or timeout"},{step:"extract",capability:"dom_read",desc:"Read data from DOM elements"},{step:"extract_tree",capability:"dom_read",desc:"Recursive DOM tree walk with ancestry"},{step:"extract_html",capability:"dom_read",desc:"Capture element HTML as a variable"},{step:"click",capability:"dom_write",desc:"Click an element"},{step:"click_all",capability:"dom_write",desc:"Click all matching elements (with re-scan loop)"},{step:"type",capability:"dom_write",desc:"Type text into an input"},{step:"intercept",capability:"intercept_response",desc:"Capture a network response body"},{step:"cookie",capability:"cookie_read",desc:"Read cookies for a domain"},{step:"fetch",capability:"cookie_read",desc:"HTTP request from page context"},{step:"map",capability:"—",desc:"Transform/rename extracted fields"},{step:"filter",capability:"—",desc:"Filter rows by condition"},{step:"set",capability:"—",desc:"Set a variable for later steps"},{step:"transform",capability:"—",desc:"Server-side data transform (e.g. HTML→Markdown)"}];function fd({ep:e}){const[t,n]=b.useState(!1),s=e.params||e.body||e.response;return i.jsxs("div",{className:"border-b border-base-300/50 last:border-b-0",children:[i.jsxs("button",{className:`flex items-center gap-3 w-full text-left px-3 py-2.5 ${s?"cursor-pointer hover:bg-base-200/50":""}`,onClick:()=>s&&n(!t),disabled:!s,children:[i.jsx(H,{variant:db[e.method]??"neutral",size:"xs",className:"w-10 justify-center shrink-0",children:e.method}),i.jsx("span",{className:"font-mono text-sm flex-1",children:e.path}),e.auth&&i.jsx(H,{variant:"warning",size:"xs",children:"auth"}),s&&i.jsx("span",{className:"text-xs opacity-40",children:t?"▾":"▸"})]}),i.jsx("div",{className:"px-3 pb-2 pl-16 text-sm opacity-60",children:e.desc}),t&&s&&i.jsxs("div",{className:"px-3 pb-3 pl-16 space-y-1.5",children:[e.params&&i.jsxs("div",{className:"text-xs",children:[i.jsx("span",{className:"font-semibold opacity-50",children:"Params: "}),i.jsx("span",{className:"font-mono opacity-60",children:e.params})]}),e.body&&i.jsxs("div",{className:"text-xs",children:[i.jsx("span",{className:"font-semibold opacity-50",children:"Body: "}),i.jsx("code",{className:"font-mono bg-base-200 px-1 py-0.5 opacity-70",children:e.body})]}),e.response&&i.jsxs("div",{className:"text-xs",children:[i.jsx("span",{className:"font-semibold opacity-50",children:"Response: "}),i.jsx("code",{className:"font-mono bg-base-200 px-1 py-0.5 opacity-70",children:e.response})]})]})]})}function gb(){const[e,t]=b.useState("cli");return i.jsxs("div",{className:"max-w-4xl mx-auto",children:[i.jsx("h2",{className:"font-display text-xl font-bold uppercase tracking-[0.06em] mb-1",children:"API & CLI Reference"}),i.jsx("p",{className:"text-sm opacity-60 mb-6",children:"CLI commands, Daemon API endpoints, and App Server endpoints."}),i.jsx("div",{id:"api-endpoints",className:"border border-base-300 bg-base-200/30 p-3 mb-6 scroll-mt-4",children:i.jsxs("p",{className:"text-sm opacity-70",children:[i.jsx("span",{className:"font-semibold",children:"Authentication:"})," Daemon endpoints (except ",i.jsx("code",{className:"font-mono text-xs bg-base-200 px-1 py-0.5",children:"/api/status"})," and ",i.jsx("code",{className:"font-mono text-xs bg-base-200 px-1 py-0.5",children:"/ws/extension"}),") require an ",i.jsx("code",{className:"font-mono text-xs bg-base-200 px-1 py-0.5",children:"Authorization: Bearer <token>"})," header and an ",i.jsx("code",{className:"font-mono text-xs bg-base-200 px-1 py-0.5",children:"X-CommandGarden: 1"})," CSRF header. The App Server handles auth internally — GUI requests don't need tokens."]})}),i.jsx("div",{className:"flex border-b border-base-300 mb-4",children:[{id:"cli",label:"CLI Commands",sub:"cg"},{id:"daemon-api",label:"Daemon API",sub:":9091"},{id:"app-api",label:"App Server API",sub:":9092"}].map(n=>i.jsxs("button",{className:`px-4 py-2 text-sm font-medium transition-colors border-b-2 -mb-px ${e===n.id?"border-primary text-primary":"border-transparent opacity-60 hover:opacity-100"}`,onClick:()=>t(n.id),children:[n.label," ",i.jsx("span",{className:"font-mono text-xs opacity-40 ml-1",children:n.sub})]},n.id))}),e==="cli"&&i.jsx("div",{className:"space-y-2 mb-8",children:mb.map(n=>i.jsxs("div",{className:"border border-base-300 p-3",children:[i.jsxs("div",{className:"flex items-start gap-3",children:[i.jsx("code",{className:"font-mono text-sm font-semibold bg-base-200 px-2 py-0.5 shrink-0",children:n.cmd}),i.jsx("span",{className:"text-sm opacity-60 pt-0.5",children:n.desc})]}),n.args&&i.jsxs("div",{className:"mt-2 ml-1 text-xs",children:[i.jsx("span",{className:"font-semibold opacity-50",children:"Args: "}),i.jsx("span",{className:"opacity-60",children:n.args})]}),n.opts&&n.opts.length>0&&i.jsx("div",{className:"mt-1.5 ml-1 space-y-0.5",children:n.opts.map((s,r)=>i.jsx("div",{className:"text-xs font-mono opacity-50",children:s},r))}),n.example&&i.jsx("div",{className:"mt-2 ml-1",children:i.jsx("code",{className:"text-xs font-mono bg-base-200/70 px-2 py-1 block opacity-60",children:n.example})})]},n.cmd))}),e==="daemon-api"&&i.jsx("div",{className:"border border-base-300 mb-8",children:fb.map((n,s)=>i.jsx(fd,{ep:n},s))}),e==="app-api"&&i.jsxs(i.Fragment,{children:[i.jsxs("p",{className:"text-sm opacity-50 mb-3",children:["The App Server on ",i.jsx("code",{className:"font-mono text-xs bg-base-200 px-1 py-0.5",children:":9092"})," proxies all daemon endpoints and adds app-specific routes for preferences, caching, goals, and journal generation."]}),i.jsx("div",{className:"border border-base-300 mb-8",children:pb.map((n,s)=>i.jsx(fd,{ep:n},s))})]}),i.jsx("h3",{id:"api-pipeline",className:"font-display text-base font-semibold mb-3 scroll-mt-4",children:"Pipeline Steps"}),i.jsxs("p",{className:"text-sm opacity-50 mb-3",children:["Available steps for connector YAML pipeline definitions. For why each capability runs where it does, see"," ",i.jsxs(xe,{to:"/concepts#concepts-worlds",className:"text-primary hover:underline inline-flex items-center gap-1",children:["Capability & World Model ",i.jsx(He,{className:"w-3 h-3"})]}),"."]}),i.jsx("div",{className:"overflow-x-auto border border-base-300 mb-8",children:i.jsxs("table",{className:"table table-sm w-full",children:[i.jsx("thead",{children:i.jsxs("tr",{className:"bg-base-200",children:[i.jsx("th",{children:"Step"}),i.jsx("th",{children:"Capability"}),i.jsx("th",{children:"Description"})]})}),i.jsx("tbody",{children:hb.map(n=>i.jsxs("tr",{className:"hover:bg-base-200",children:[i.jsx("td",{className:"font-mono text-sm font-semibold",children:n.step}),i.jsx("td",{children:i.jsx(H,{size:"xs",variant:n.capability==="—"?"neutral":"info",children:n.capability})}),i.jsx("td",{className:"text-sm opacity-60",children:n.desc})]},n.step))})]})}),i.jsx("h3",{id:"api-expressions",className:"font-display text-base font-semibold mb-3 scroll-mt-4",children:"Expression Syntax"}),i.jsxs("div",{className:"border border-base-300 p-4",children:[i.jsxs("p",{className:"text-sm opacity-60 mb-3",children:["Use ",i.jsx("code",{className:"font-mono text-xs bg-base-200 px-1 py-0.5",children:"${{ }}"})," for template expressions (no JS eval):"]}),i.jsxs("div",{className:"space-y-1.5 font-mono text-xs",children:[i.jsxs("div",{className:"flex gap-3",children:[i.jsx("span",{className:"opacity-40 w-36 shrink-0",children:"Variable access"}),i.jsx("code",{className:"opacity-70",children:"args.month, vars.token, cookies.name"})]}),i.jsxs("div",{className:"flex gap-3",children:[i.jsx("span",{className:"opacity-40 w-36 shrink-0",children:"Row access (map)"}),i.jsx("code",{className:"opacity-70",children:"row.id, row.name"})]}),i.jsxs("div",{className:"flex gap-3",children:[i.jsx("span",{className:"opacity-40 w-36 shrink-0",children:"Concatenation"}),i.jsx("code",{className:"opacity-70",children:'"Bearer " + vars.token'})]}),i.jsxs("div",{className:"flex gap-3",children:[i.jsx("span",{className:"opacity-40 w-36 shrink-0",children:"Pipe filters"}),i.jsx("code",{className:"opacity-70",children:'args.month | default("2026-06"), value | number, text | trim'})]})]})]})]})}function yb(e){const n=e.replace(/^---\s*\n[\s\S]*?\n---\s*\n/,"").split(`
368
+ `),s=[];let r=null;for(const a of n){const o=a.match(/^(#{1,3})\s+(.+)/);o?(r&&s.push({heading:r.heading,body:r.lines.join(`
369
+ `).trim()}),r={heading:o[2],lines:[]}):r?r.lines.push(a):a.trim()&&(r||(r={heading:"",lines:[]}),r.lines.push(a))}return r&&s.push({heading:r.heading,body:r.lines.join(`
370
+ `).trim()}),s}function xb({content:e}){return i.jsx("pre",{className:"text-sm font-mono whitespace-pre-wrap opacity-70 leading-relaxed overflow-x-auto",children:e})}function pd({file:e,defaultOpen:t}){const[n,s]=b.useState(t??!1),r=b.useMemo(()=>yb(e.content),[e.content]);return i.jsxs("div",{className:"border border-base-300/50",children:[i.jsxs("button",{className:"flex items-center gap-2 w-full text-left px-4 py-3 hover:bg-base-200/50 transition-colors",onClick:()=>s(!n),children:[i.jsx("span",{className:"text-xs opacity-50",children:n?"▾":"▸"}),i.jsx("span",{className:"font-mono text-sm font-semibold",children:e.name}),i.jsxs("span",{className:"text-xs opacity-40",children:[r.length," ",r.length===1?"section":"sections"]})]}),n&&i.jsx("div",{className:"px-4 pb-4 space-y-4",children:r.map((a,o)=>i.jsxs("div",{children:[a.heading&&i.jsx("h5",{className:"font-mono text-xs font-semibold uppercase tracking-[0.08em] opacity-50 mb-2",children:a.heading}),i.jsx(xb,{content:a.body})]},o))})]})}function vb({skill:e}){const[t,n]=b.useState(!1),s=e.files.find(a=>a.name==="SKILL.md"),r=e.files.filter(a=>a.name!=="SKILL.md");return i.jsxs("div",{className:"border border-base-300",children:[i.jsx("div",{className:"p-4",children:i.jsxs("div",{className:"flex items-center justify-between gap-3",children:[i.jsxs("div",{className:"flex items-center gap-3 flex-wrap min-w-0",children:[i.jsx("span",{className:"font-mono text-base font-semibold",children:e.name}),i.jsxs(H,{size:"xs",children:[e.files.length," ",e.files.length===1?"file":"files"]})]}),i.jsx("button",{className:"btn btn-sm btn-ghost font-mono text-xs shrink-0",onClick:()=>n(!t),children:t?"Collapse":"View"})]})}),t&&i.jsxs("div",{className:"border-t border-base-300 p-4 space-y-3",children:[s&&i.jsx(pd,{file:s,defaultOpen:!0}),r.map(a=>i.jsx(pd,{file:a},a.name))]})]})}function bb(){const[e,t]=b.useState([]),[n,s]=b.useState(!0),[r,a]=b.useState(null);return b.useEffect(()=>{B.getSkills().then(o=>t(o.skills)).catch(o=>a(o instanceof Error?o.message:"Failed to load skills")).finally(()=>s(!1))},[]),n?i.jsx(ut,{label:"Loading skills..."}):i.jsxs("div",{className:"max-w-4xl mx-auto",children:[i.jsx("h2",{className:"font-display text-xl font-bold uppercase tracking-[0.06em] mb-1",children:"Skills"}),i.jsx("p",{className:"text-sm opacity-60 mb-5",children:"AI agent skills bundled with commandGarden. These teach coding assistants how to use cg and author connectors."}),r?i.jsxs("div",{className:"border border-error/30 p-4",children:[i.jsx("p",{className:"text-sm text-error font-semibold mb-1",children:"Failed to load skills"}),i.jsx("p",{className:"font-mono text-xs opacity-60",children:r})]}):e.length===0?i.jsxs("div",{className:"border border-base-300 p-6 text-center",children:[i.jsx("p",{className:"text-sm opacity-50 mb-1",children:"No skills found"}),i.jsx("p",{className:"font-mono text-xs opacity-30",children:"Skills should be located in the skills/ directory of the commandGarden package."})]}):i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"overflow-x-auto border border-base-300 mb-6",children:i.jsxs("table",{className:"table table-sm w-full",children:[i.jsx("thead",{children:i.jsxs("tr",{className:"bg-base-200",children:[i.jsx("th",{children:"Skill"}),i.jsx("th",{children:"Description"}),i.jsx("th",{children:"Files"})]})}),i.jsx("tbody",{children:e.map(o=>i.jsxs("tr",{className:"hover:bg-base-200",children:[i.jsx("td",{className:"font-mono text-sm font-semibold whitespace-nowrap",children:o.name}),i.jsx("td",{className:"text-sm opacity-60",children:o.description}),i.jsx("td",{className:"text-center",children:i.jsx(H,{size:"xs",children:o.files.length})})]},o.name))})]})}),i.jsx("h3",{className:"font-display text-base font-semibold mb-3",children:"Skill Details"}),i.jsx("div",{className:"space-y-3",children:e.map(o=>i.jsx(vb,{skill:o},o.name))}),i.jsxs("div",{className:"border border-base-300 p-4 mt-6",children:[i.jsx("h4",{className:"font-mono text-xs font-semibold uppercase tracking-[0.08em] opacity-50 mb-2",children:"Usage"}),i.jsxs("p",{className:"text-sm opacity-60 mb-2",children:["Copy a skill's ",i.jsx("code",{className:"font-mono text-xs bg-base-200 px-1 py-0.5",children:"SKILL.md"})," into your AI assistant's skill directory to teach it how to use commandGarden."]}),i.jsxs("div",{className:"font-mono text-xs opacity-40",children:[i.jsx("span",{children:"Windsurf: "}),i.jsx("code",{className:"bg-base-200 px-1 py-0.5",children:".windsurf/skills/"}),i.jsx("span",{className:"mx-2",children:"|"}),i.jsx("span",{children:"Claude: "}),i.jsx("code",{className:"bg-base-200 px-1 py-0.5",children:".claude/skills/"})]})]})]})]})}function _t({children:e}){return i.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.12em] mb-2",children:e})}function si({children:e}){return i.jsx("pre",{className:"bg-base-200 border border-base-300 p-4 overflow-x-auto text-sm font-mono leading-relaxed",children:i.jsx("code",{children:e})})}function jb(){return i.jsxs("div",{className:"max-w-4xl mx-auto pb-20",children:[i.jsxs("section",{className:"pt-8 pb-16 border-b border-base-300",children:[i.jsx(_t,{children:"Browser automation for the rest of us"}),i.jsx("h1",{className:"font-display text-3xl sm:text-4xl font-bold tracking-tight leading-tight mb-3",style:{textWrap:"balance"},children:"Turn any website into a CLI command."}),i.jsx("p",{className:"text-base sm:text-lg opacity-70 max-w-[65ch] mb-8 leading-relaxed",style:{textWrap:"pretty"},children:"commandGarden reuses your existing browser sessions to extract structured data from authenticated websites. No API keys, no service accounts, no token overhead."}),i.jsx("div",{className:"flex flex-wrap items-center gap-2 mb-8 font-mono text-xs",children:[{label:"cg run",color:"border-sky-500/50 bg-sky-500/10 text-sky-700 dark:text-sky-400"},{label:"Daemon",color:"border-amber-500/50 bg-amber-500/10 text-amber-700 dark:text-amber-400"},{label:"Chrome Extension",color:"border-emerald-500/50 bg-emerald-500/10 text-emerald-700 dark:text-emerald-400"},{label:"Browser Tab",color:"border-violet-500/50 bg-violet-500/10 text-violet-700 dark:text-violet-400"},{label:"Structured JSON",color:"border-primary/50 bg-primary/10 text-primary"}].map((e,t)=>i.jsxs("span",{className:"flex items-center gap-2",children:[i.jsx("span",{className:`px-2.5 py-1 border font-semibold ${e.color}`,children:e.label}),t<4&&i.jsx("span",{className:"opacity-30",children:"→"})]},e.label))}),i.jsx(si,{children:"npm install -g @commandgarden/cli"})]}),i.jsxs("section",{id:"why-problem",className:"py-16 border-b border-base-300 scroll-mt-4",children:[i.jsx(_t,{children:"Where the data actually lives"}),i.jsx("h2",{className:"font-display text-xl font-bold uppercase tracking-[0.06em] mb-8",children:"The Problem"}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6 mb-12",children:[i.jsxs("div",{className:"border border-base-300 p-5",children:[i.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[i.jsx(ei,{className:"w-4 h-4 text-primary"}),i.jsx("h3",{className:"font-display font-semibold text-sm",children:"Real-world data lives in browsers"})]}),i.jsx("p",{className:"text-sm opacity-70 leading-relaxed",children:"AI agents can't reach data inside internal portals, enterprise tools, and SaaS dashboards. These systems are where the work happens, but they're locked behind browser sessions."})]}),i.jsxs("div",{className:"border border-base-300 p-5",children:[i.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[i.jsx(vv,{className:"w-4 h-4 text-error"}),i.jsx("h3",{className:"font-display font-semibold text-sm",children:"APIs are the exception"})]}),i.jsx("p",{className:"text-sm opacity-70 leading-relaxed",children:"Most sites don't provide APIs. When one exists, you need service accounts, managed secrets, and OAuth flows. The data visible in the UI often has no programmatic equivalent."})]}),i.jsxs("div",{className:"border border-base-300 p-5",children:[i.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[i.jsx(mv,{className:"w-4 h-4 text-warning"}),i.jsx("h3",{className:"font-display font-semibold text-sm",children:"Browser automation is expensive"})]}),i.jsx("p",{className:"text-sm opacity-70 leading-relaxed",children:"AI browser tools (Playwright, Puppeteer) are slow, fragile, and token-intensive. Each interaction burns tokens just to understand what's on screen, even when the page layout hasn't changed."})]})]}),i.jsx("p",{className:"text-sm opacity-50 max-w-[65ch]",children:"AI skills, MCP servers, and browser tools all share this flaw: the agent re-parses page structure on every call, repeating work that could be done once."})]}),i.jsxs("section",{id:"why-solution",className:"py-16 border-b border-base-300 scroll-mt-4",children:[i.jsx(_t,{children:"How commandGarden works"}),i.jsx("h2",{className:"font-display text-xl font-bold uppercase tracking-[0.06em] mb-4",children:"The Solution"}),i.jsxs("p",{className:"text-sm opacity-70 max-w-[65ch] leading-relaxed mb-10",children:["Instead of making the agent figure out each website on every call, commandGarden uses pre-defined extraction recipes, called ",i.jsx("strong",{className:"text-base-content",children:"connectors"}),", that know how to navigate a site and return structured JSON. The agent (or a human) runs a single CLI command and gets back a fixed-schema response."]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-12",children:[i.jsxs("div",{className:"border border-error/20 bg-error/[0.03] p-5",children:[i.jsx("div",{className:"font-mono text-[0.6rem] font-medium text-error/60 uppercase tracking-[0.12em] mb-4",children:"Without commandGarden"}),i.jsx("div",{className:"space-y-2.5",children:[{label:"AI Agent",note:"receives task"},{label:"Browser Tool",note:"launch headless"},{label:"Navigate + Wait",note:"handle auth redirects"},{label:"Parse HTML",note:"tokens for structure"},{label:"Extract Data",note:"tokens for content"},{label:"Loose Output",note:"varies per run"}].map((e,t)=>i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center gap-2.5",children:[i.jsx("span",{className:"w-5 h-5 border border-error/30 bg-error/10 flex items-center justify-center font-mono text-[0.6rem] text-error/60 shrink-0",children:t+1}),i.jsx("span",{className:"text-sm font-medium",children:e.label}),i.jsx("span",{className:"text-xs opacity-40 font-mono",children:e.note})]}),t<5&&i.jsx("div",{className:"ml-2.5 w-px h-2 bg-error/20"})]},t))}),i.jsxs("div",{className:"mt-4 pt-3 border-t border-error/15 flex items-center gap-2",children:[i.jsx(H,{variant:"error",size:"xs",children:"thousands of tokens"}),i.jsx("span",{className:"text-xs opacity-50",children:"per interaction"})]})]}),i.jsxs("div",{className:"border border-primary/20 bg-primary/[0.03] p-5",children:[i.jsx("div",{className:"font-mono text-[0.6rem] font-medium text-primary/60 uppercase tracking-[0.12em] mb-4",children:"With commandGarden"}),i.jsx("div",{className:"space-y-2.5",children:[{label:"AI Agent",note:"receives task"},{label:"cg run site/command",note:"one CLI call"},{label:"Structured JSON",note:"fixed schema"}].map((e,t)=>i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center gap-2.5",children:[i.jsx("span",{className:"w-5 h-5 border border-primary/30 bg-primary/10 flex items-center justify-center font-mono text-[0.6rem] text-primary/60 shrink-0",children:t+1}),i.jsx("span",{className:"text-sm font-medium",children:e.label}),i.jsx("span",{className:"text-xs opacity-40 font-mono",children:e.note})]}),t<2&&i.jsx("div",{className:"ml-2.5 w-px h-2 bg-primary/20"})]},t))}),i.jsxs("div",{className:"mt-4 pt-3 border-t border-primary/15 flex items-center gap-2",children:[i.jsx(H,{variant:"success",size:"xs",children:"0 tokens"}),i.jsx("span",{className:"text-xs opacity-50",children:"parsing done locally"})]})]})]}),i.jsxs("div",{className:"space-y-8 mb-12",children:[i.jsxs("div",{className:"flex gap-4",children:[i.jsx(ei,{className:"w-5 h-5 shrink-0 mt-0.5 text-primary"}),i.jsxs("div",{children:[i.jsx("h3",{className:"font-display font-semibold mb-1",children:"Reuse your browser session"}),i.jsx("p",{className:"text-sm opacity-70 max-w-[60ch] leading-relaxed",children:"A Chrome extension runs inside your already-authenticated browser. If you can see the data, commandGarden can extract it."})]})]}),i.jsxs("div",{className:"flex gap-4",children:[i.jsx(so,{className:"w-5 h-5 shrink-0 mt-0.5 text-primary"}),i.jsxs("div",{children:[i.jsx("h3",{className:"font-display font-semibold mb-1",children:"Fixed-format parsing, done locally"}),i.jsx("p",{className:"text-sm opacity-70 max-w-[60ch] leading-relaxed",children:"Each connector defines a pipeline that produces the same structured output on every run. Parsing runs locally in the extension and daemon, so nothing leaves your machine."})]})]}),i.jsxs("div",{className:"flex gap-4",children:[i.jsx(ro,{className:"w-5 h-5 shrink-0 mt-0.5 text-primary"}),i.jsxs("div",{children:[i.jsx("h3",{className:"font-display font-semibold mb-1",children:"One CLI for humans and AI agents"}),i.jsx("p",{className:"text-sm opacity-70 max-w-[60ch] leading-relaxed mb-3",children:"The same command works whether a human types it or an AI agent calls it via a skill. Same arguments, same JSON schema."}),i.jsx(si,{children:"cg run timetracking/report --month 2026-06 --format json"})]})]})]}),i.jsx("h3",{className:"font-display font-semibold text-sm mb-3",children:"How it compares"}),i.jsx("div",{className:"overflow-x-auto border border-base-300",children:i.jsxs("table",{className:"table table-sm w-full",children:[i.jsx("thead",{children:i.jsxs("tr",{className:"bg-base-200",children:[i.jsx("th",{}),i.jsx("th",{className:"text-primary",children:"commandGarden"}),i.jsx("th",{children:"AI Skills"}),i.jsx("th",{children:"MCP Servers"})]})}),i.jsx("tbody",{children:[{label:"Return format",cg:["Fixed schema","success"],skills:["Loose, varies","warning"],mcp:["Typed schema","success"]},{label:"Parsing cost",cg:["Zero tokens","success"],skills:["Tokens/call","error"],mcp:["Tokens/call","error"]},{label:"Auth handling",cg:["Browser session","success"],skills:["Agent navigates","warning"],mcp:["Agent manages","warning"]},{label:"Processing",cg:["Local only","success"],skills:["Cloud/agent","warning"],mcp:["Server-side","warning"]},{label:"Privacy",cg:["Stays on machine","success"],skills:["Through AI","error"],mcp:["Through server","warning"]},{label:"Coverage",cg:["Any website","success"],skills:["Any (expensive)","warning"],mcp:["Server-limited","error"]}].map(({label:e,cg:t,skills:n,mcp:s})=>i.jsxs("tr",{children:[i.jsx("td",{className:"font-mono text-xs font-medium",children:e}),i.jsx("td",{className:"bg-primary/[0.03]",children:i.jsx(H,{variant:t[1],size:"xs",children:t[0]})}),i.jsx("td",{children:i.jsx(H,{variant:n[1],size:"xs",children:n[0]})}),i.jsx("td",{children:i.jsx(H,{variant:s[1],size:"xs",children:s[0]})})]},e))})]})}),i.jsxs("p",{className:"text-sm opacity-50 mt-4 max-w-[65ch]",children:["Skills and MCP provide the integration layer; commandGarden does the extraction and parsing locally. The ",i.jsx("span",{className:"font-mono",children:"cg"})," skill lets AI agents call commandGarden commands directly."]})]}),i.jsx("section",{id:"why-architecture",className:"py-16 border-b border-base-300 bg-base-200/30 -mx-4 px-4 md:-mx-5 md:px-5 scroll-mt-4",children:i.jsxs("div",{className:"max-w-4xl mx-auto",children:[i.jsx(_t,{children:"Built for security and efficiency"}),i.jsx("h2",{className:"font-display text-xl font-bold uppercase tracking-[0.06em] mb-4",children:"Architecture"}),i.jsx("p",{className:"text-sm opacity-70 max-w-[65ch] leading-relaxed mb-8",children:"Every component exists for a specific reason. All communication stays on localhost."}),i.jsx("div",{className:"border border-base-300 bg-base-100 p-5 mb-8 overflow-x-auto",children:i.jsxs("svg",{viewBox:"0 0 700 260",className:"w-full text-base-content",style:{minWidth:560},children:[i.jsxs("defs",{children:[i.jsx("marker",{id:"why-ah",viewBox:"0 0 10 8",refX:"10",refY:"4",markerWidth:"7",markerHeight:"5",orient:"auto",children:i.jsx("path",{d:"M0 0L10 4L0 8z",fill:"currentColor",fillOpacity:.3})}),i.jsx("marker",{id:"why-ah-rev",viewBox:"0 0 10 8",refX:"0",refY:"4",markerWidth:"7",markerHeight:"5",orient:"auto",children:i.jsx("path",{d:"M10 0L0 4L10 8z",fill:"currentColor",fillOpacity:.3})})]}),i.jsx("rect",{x:10,y:10,width:110,height:46,rx:0,fill:"rgba(56,189,248,0.08)",stroke:"rgba(56,189,248,0.4)",strokeWidth:1}),i.jsx("text",{x:65,y:30,textAnchor:"middle",fill:"currentColor",fontSize:11,fontWeight:600,children:"CLI"}),i.jsx("text",{x:65,y:44,textAnchor:"middle",fill:"currentColor",fontSize:8,opacity:.4,fontFamily:"ui-monospace,monospace",children:"cg run ..."}),i.jsx("rect",{x:10,y:80,width:110,height:46,rx:0,fill:"rgba(56,189,248,0.08)",stroke:"rgba(56,189,248,0.4)",strokeWidth:1}),i.jsx("text",{x:65,y:100,textAnchor:"middle",fill:"currentColor",fontSize:11,fontWeight:600,children:"GUI"}),i.jsx("text",{x:65,y:114,textAnchor:"middle",fill:"currentColor",fontSize:8,opacity:.4,fontFamily:"ui-monospace,monospace",children:"React SPA"}),i.jsx("rect",{x:160,y:80,width:120,height:46,rx:0,fill:"rgba(251,191,36,0.08)",stroke:"rgba(251,191,36,0.4)",strokeWidth:1}),i.jsx("text",{x:220,y:100,textAnchor:"middle",fill:"currentColor",fontSize:10,fontWeight:600,children:"App Server"}),i.jsx("text",{x:220,y:114,textAnchor:"middle",fill:"currentColor",fontSize:8,opacity:.4,fontFamily:"ui-monospace,monospace",children:":9092"}),i.jsx("rect",{x:320,y:15,width:150,height:76,rx:0,fill:"rgba(251,191,36,0.08)",stroke:"rgba(251,191,36,0.5)",strokeWidth:1.5}),i.jsx("text",{x:395,y:40,textAnchor:"middle",fill:"currentColor",fontSize:13,fontWeight:700,children:"Daemon"}),i.jsx("text",{x:395,y:56,textAnchor:"middle",fill:"currentColor",fontSize:8,opacity:.4,fontFamily:"ui-monospace,monospace",children:"Fastify :9091"}),i.jsx("text",{x:395,y:78,textAnchor:"middle",fill:"currentColor",fontSize:7,opacity:.25,fontFamily:"ui-monospace,monospace",children:"auth · registry · audit"}),i.jsx("rect",{x:520,y:20,width:130,height:55,rx:0,fill:"rgba(52,211,153,0.08)",stroke:"rgba(52,211,153,0.4)",strokeWidth:1}),i.jsx("text",{x:585,y:42,textAnchor:"middle",fill:"currentColor",fontSize:11,fontWeight:600,children:"Extension"}),i.jsx("text",{x:585,y:58,textAnchor:"middle",fill:"currentColor",fontSize:8,opacity:.4,fontFamily:"ui-monospace,monospace",children:"Chrome MV3"}),i.jsx("rect",{x:530,y:160,width:120,height:46,rx:0,fill:"rgba(167,139,250,0.08)",stroke:"rgba(167,139,250,0.4)",strokeWidth:1}),i.jsx("text",{x:590,y:180,textAnchor:"middle",fill:"currentColor",fontSize:11,fontWeight:600,children:"Browser Tab"}),i.jsx("text",{x:590,y:194,textAnchor:"middle",fill:"currentColor",fontSize:8,opacity:.4,fontFamily:"ui-monospace,monospace",children:"target page"}),i.jsx("rect",{x:310,y:170,width:90,height:30,rx:0,fill:"currentColor",fillOpacity:.04,stroke:"currentColor",strokeOpacity:.12,strokeWidth:1}),i.jsx("text",{x:355,y:188,textAnchor:"middle",fill:"currentColor",fontSize:8,fontWeight:500,opacity:.45,children:"Audit Log"}),i.jsx("rect",{x:410,y:170,width:80,height:30,rx:0,fill:"currentColor",fillOpacity:.04,stroke:"currentColor",strokeOpacity:.12,strokeWidth:1}),i.jsx("text",{x:450,y:188,textAnchor:"middle",fill:"currentColor",fontSize:8,fontWeight:500,opacity:.45,children:"Config"}),i.jsx("rect",{x:160,y:170,width:90,height:30,rx:0,fill:"currentColor",fillOpacity:.04,stroke:"currentColor",strokeOpacity:.12,strokeWidth:1}),i.jsx("text",{x:205,y:188,textAnchor:"middle",fill:"currentColor",fontSize:8,fontWeight:500,opacity:.45,children:"App DB"}),i.jsx("line",{x1:122,y1:33,x2:318,y2:45,stroke:"currentColor",strokeOpacity:.15,markerEnd:"url(#why-ah)"}),i.jsx("text",{x:210,y:28,textAnchor:"middle",fill:"currentColor",fontSize:7,opacity:.4,fontFamily:"ui-monospace,monospace",children:"HTTP"}),i.jsx("line",{x1:122,y1:103,x2:158,y2:103,stroke:"currentColor",strokeOpacity:.15,markerEnd:"url(#why-ah)"}),i.jsx("line",{x1:282,y1:96,x2:318,y2:72,stroke:"currentColor",strokeOpacity:.15,markerEnd:"url(#why-ah)"}),i.jsx("text",{x:295,y:76,textAnchor:"middle",fill:"currentColor",fontSize:7,opacity:.4,fontFamily:"ui-monospace,monospace",children:"proxy"}),i.jsx("line",{x1:472,y1:48,x2:518,y2:48,stroke:"currentColor",strokeOpacity:.2,strokeWidth:1.5,markerEnd:"url(#why-ah)",markerStart:"url(#why-ah-rev)"}),i.jsx("text",{x:495,y:38,textAnchor:"middle",fill:"currentColor",fontSize:7,opacity:.4,fontFamily:"ui-monospace,monospace",children:"WebSocket"}),i.jsx("line",{x1:590,y1:77,x2:590,y2:158,stroke:"currentColor",strokeOpacity:.15,markerEnd:"url(#why-ah)"}),i.jsx("line",{x1:370,y1:93,x2:365,y2:168,stroke:"currentColor",strokeOpacity:.1,strokeDasharray:"3 2"}),i.jsx("line",{x1:430,y1:93,x2:445,y2:168,stroke:"currentColor",strokeOpacity:.1,strokeDasharray:"3 2"}),i.jsx("line",{x1:210,y1:128,x2:210,y2:168,stroke:"currentColor",strokeOpacity:.1,strokeDasharray:"3 2"})]})}),i.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3 mb-6",children:[{icon:ro,title:"CLI",mono:"cg",desc:"Contact point for humans and AI agents. One command, structured JSON output."},{icon:ul,title:"Daemon",mono:":9091",desc:"Validates auth and capabilities, loads connectors, writes audit log."},{icon:ei,title:"Extension",mono:"MV3",desc:"Runs inside your authenticated Chrome. Accesses cookies and page data."},{icon:so,title:"Connectors",mono:"YAML",desc:"Declarative pipelines: navigate → wait → extract → map. No code execution."},{icon:sd,title:"Audit Log",mono:"SQLite",desc:"Every execution logged: connector, domains, timing, approvals."},{icon:zv,title:"GUI",mono:":9092",desc:"React SPA with app pages, connector browsing, and config management."}].map(({icon:e,title:t,mono:n,desc:s})=>i.jsxs("div",{className:"flex gap-3 p-3 border border-base-300 bg-base-100",children:[i.jsx(e,{className:"w-4 h-4 shrink-0 mt-0.5 opacity-40"}),i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-baseline gap-1.5 mb-0.5",children:[i.jsx("span",{className:"font-display font-semibold text-sm",children:t}),i.jsx("span",{className:"font-mono text-[0.65rem] opacity-40",children:n})]}),i.jsx("p",{className:"text-xs opacity-60 leading-relaxed",children:s})]})]},t))}),i.jsxs("div",{className:"flex flex-wrap gap-4",children:[i.jsxs(xe,{to:"/architecture",className:"font-mono text-xs text-primary hover:underline flex items-center gap-1",children:["Full architecture details ",i.jsx(He,{className:"w-3 h-3"})]}),i.jsxs(xe,{to:"/concepts",className:"font-mono text-xs text-primary hover:underline flex items-center gap-1",children:["Concepts deep dive ",i.jsx(He,{className:"w-3 h-3"})]})]})]})}),i.jsxs("section",{id:"why-apps",className:"py-16 border-b border-base-300 scroll-mt-4",children:[i.jsx(_t,{children:"Ready-to-use tools"}),i.jsx("h2",{className:"font-display text-xl font-bold uppercase tracking-[0.06em] mb-4",children:"Built-in Apps"}),i.jsx("p",{className:"text-sm opacity-70 max-w-[65ch] leading-relaxed mb-8",children:"commandGarden ships with connectors and dedicated app pages for common enterprise tasks. Each one runs entirely on your local machine using your browser session."}),i.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[{icon:Lm,title:"Time Tracking",tag:"Administrative",desc:"Monthly report with project breakdown and summary cards",route:"/apps/timetracking",cmd:"timetracking/report"},{icon:Sv,title:"Room Availability",tag:"Administrative",desc:"Meeting room free/busy from Outlook Scheduling Assistant",route:"/apps/rooms",cmd:"teams/room-availability"},{icon:fv,title:"Dev Journal",tag:"Productivity",desc:"Auto-generated daily journal from Git commits and Jira tickets",route:"/apps/journal",cmd:"ado/git-commits"},{icon:$v,title:"Security News",tag:"Security",desc:"Aggregated feed from Socket.dev, Wiz, and tl;dr sec",route:"/apps/security-news",cmd:"socket/security-news"},{icon:Ov,title:"Trusted Peer Expiry",tag:"Productivity",desc:"TokenMaster client trust relationships with expiry tracking",route:"/apps/trusted-peer-expiry",cmd:"tokenmaster/clients-list"},{icon:_v,title:"GCS Knowledge Base",tag:"Security",desc:"Browse and read internal security docs, converted to Markdown",route:null,cmd:"gcs/kb-pages"}].map(({icon:e,title:t,tag:n,desc:s,route:r,cmd:a})=>i.jsxs("div",{className:"border border-base-300 p-4",children:[i.jsxs("div",{className:"flex items-start gap-3 mb-2",children:[i.jsx(e,{className:"w-4 h-4 shrink-0 mt-0.5 opacity-40"}),i.jsxs("div",{className:"flex-1 min-w-0",children:[i.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[i.jsx("span",{className:"font-display font-semibold text-sm",children:t}),i.jsx(H,{size:"xs",children:n})]}),i.jsx("p",{className:"text-xs opacity-60 leading-relaxed",children:s})]})]}),i.jsxs("div",{className:"flex items-center justify-between mt-3 pt-2 border-t border-base-300/50",children:[i.jsxs("span",{className:"font-mono text-[0.65rem] opacity-30",children:["cg run ",a]}),r&&i.jsxs(xe,{to:r,className:"font-mono text-xs text-primary hover:underline flex items-center gap-1",children:["Open ",i.jsx(He,{className:"w-3 h-3"})]})]})]},t))}),i.jsx("p",{className:"text-xs opacity-40 mt-4 max-w-[65ch]",children:"Each app page combines multiple connector calls into a single view. The GUI handles orchestration, caching, and presentation; the connectors provide the raw data."})]}),i.jsxs("section",{id:"why-happy-path",className:"py-16 border-b border-base-300 scroll-mt-4",children:[i.jsx(_t,{children:"From install to first result"}),i.jsx("h2",{className:"font-display text-xl font-bold uppercase tracking-[0.06em] mb-8",children:"Typical workflow"}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[i.jsx(ro,{className:"w-4 h-4 opacity-40"}),i.jsx("h3",{className:"font-display font-semibold text-sm",children:"Human user"})]}),i.jsx("div",{className:"space-y-3 mb-4",children:[{step:"Install",cmd:"npm install -g @commandgarden/cli"},{step:"Start",cmd:"cg up"},{step:"Load extension",cmd:"chrome://extensions → Load unpacked"},{step:"Verify",cmd:"cg daemon status"},{step:"Run",cmd:"cg run timetracking/report --month 2026-06"}].map((e,t)=>i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center gap-2.5",children:[i.jsx("span",{className:"w-5 h-5 border border-base-300 bg-base-200 flex items-center justify-center font-mono text-[0.6rem] opacity-50 shrink-0",children:t+1}),i.jsx("span",{className:"text-xs font-medium opacity-60",children:e.step})]}),i.jsx("div",{className:"ml-[1.875rem] mt-1",children:i.jsx("code",{className:"text-xs font-mono bg-base-200 border border-base-300 px-2 py-0.5 opacity-70",children:e.cmd})}),t<4&&i.jsx("div",{className:"ml-2.5 w-px h-2 bg-base-300"})]},t))}),i.jsxs("p",{className:"text-xs opacity-50 ml-[1.875rem]",children:["Or open the GUI at ",i.jsx("span",{className:"font-mono",children:"localhost:9092"})," and use the visual interface."]})]}),i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[i.jsx(ei,{className:"w-4 h-4 opacity-40"}),i.jsx("h3",{className:"font-display font-semibold text-sm",children:"AI agent"})]}),i.jsx("div",{className:"space-y-3 mb-4",children:[{step:"Load skill",cmd:"cg skill loaded"},{step:"Check status",cmd:"cg daemon status → ready"},{step:"Discover",cmd:"cg list → available connectors"},{step:"Inspect",cmd:"cg inspect timetracking/report → args, columns"},{step:"Run",cmd:"cg run timetracking/report --format json"}].map((e,t)=>i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center gap-2.5",children:[i.jsx("span",{className:"w-5 h-5 border border-base-300 bg-base-200 flex items-center justify-center font-mono text-[0.6rem] opacity-50 shrink-0",children:t+1}),i.jsx("span",{className:"text-xs font-medium opacity-60",children:e.step})]}),i.jsx("div",{className:"ml-[1.875rem] mt-1",children:i.jsx("code",{className:"text-xs font-mono bg-base-200 border border-base-300 px-2 py-0.5 opacity-70",children:e.cmd})}),t<4&&i.jsx("div",{className:"ml-2.5 w-px h-2 bg-base-300"})]},t))}),i.jsx("p",{className:"text-xs opacity-50 ml-[1.875rem]",children:"Structured JSON back in seconds."})]})]}),i.jsxs("div",{className:"mt-8 border border-primary/20 bg-primary/[0.03] p-4 flex items-center gap-3",children:[i.jsx(Am,{className:"w-4 h-4 text-primary shrink-0"}),i.jsx("p",{className:"text-sm opacity-70",children:"Both paths produce identical output. Same connector, same schema, regardless of who calls it."})]})]}),i.jsx("section",{id:"why-security",className:"py-16 border-b border-base-300 bg-base-200/30 -mx-4 px-4 md:-mx-5 md:px-5 scroll-mt-4",children:i.jsxs("div",{className:"max-w-4xl mx-auto",children:[i.jsx(_t,{children:"Security by design"}),i.jsx("h2",{className:"font-display text-xl font-bold uppercase tracking-[0.06em] mb-4",children:"Security"}),i.jsx("p",{className:"text-sm opacity-70 max-w-[65ch] leading-relaxed mb-8",children:"commandGarden touches authenticated enterprise data, so the security model is strict by default."}),i.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4 mb-8",children:[{icon:Om,title:"No credentials stored",desc:"Reuses session cookies already in Chrome. Nothing stored on disk, nothing sent externally."},{icon:qv,title:"Domain-scoped permissions",desc:"Connectors declare allowed domains. Undeclared domains are blocked by the daemon."},{icon:Im,title:"Capability gating",desc:"Each step requires a declared capability. High-risk ops (js_evaluate, cookie_write) need approval."},{icon:Av,title:"Step-by-step approval",desc:"Sensitive operations pause for confirmation. Approve in CLI or via Chrome notification."},{icon:ul,title:"Local-only processing",desc:"Daemon on :9091, app server on :9092. Bound to localhost. No network exposure."},{icon:so,title:"Declarative connectors",desc:"Pure YAML pipelines. No JavaScript evaluation, no arbitrary code execution by default."},{icon:Bv,title:"Audit-or-fail",desc:"Every execution logged to SQLite. Domains, timing, approvals, row counts. If audit fails, commands are blocked."},{icon:sd,title:"Per-session auth",desc:"Session token generated on startup with owner-only permissions. Extension verifies its own ID per message."}].map(({icon:e,title:t,desc:n})=>i.jsxs("div",{className:"flex gap-3 p-3 border border-base-300 bg-base-100",children:[i.jsx(e,{className:"w-4 h-4 shrink-0 mt-0.5 opacity-40"}),i.jsxs("div",{children:[i.jsx("h3",{className:"font-display font-semibold text-sm mb-0.5",children:t}),i.jsx("p",{className:"text-xs opacity-60 leading-relaxed",children:n})]})]},t))}),i.jsxs("div",{className:"border border-base-300 bg-base-100 p-5",children:[i.jsx("h3",{className:"font-mono text-xs font-medium opacity-50 uppercase tracking-wide mb-3",children:"Limitations"}),i.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-x-8 gap-y-1.5 text-sm opacity-70",children:[i.jsx("p",{children:"Only works while Chrome is open and you're logged in."}),i.jsx("p",{children:"Connectors may break when a site redesigns its HTML."}),i.jsx("p",{children:"Chrome-only for now (no Firefox or Edge support)."}),i.jsx("p",{children:"No credential storage, so sessions expire when you log out."}),i.jsx("p",{children:"Extraction runs one connector at a time per tab."})]})]})]})}),i.jsxs("section",{id:"why-get-started",className:"py-16 border-b border-base-300 scroll-mt-4",children:[i.jsx("h2",{className:"font-display text-xl font-bold uppercase tracking-[0.06em] mb-4",children:"Get started in 60 seconds"}),i.jsx(si,{children:`# Install
371
+ npm install -g @commandgarden/cli
372
+
373
+ # Start the daemon and GUI
374
+ cg up
375
+
376
+ # Load the Chrome extension
377
+ # Chrome → chrome://extensions → Developer mode → Load unpacked
378
+
379
+ # Run your first connector
380
+ cg run socket/security-news --format table`}),i.jsxs("div",{className:"flex flex-wrap gap-4 mt-6",children:[i.jsxs(xe,{to:"/guide",className:"font-mono text-xs text-primary hover:underline flex items-center gap-1",children:["Setup Guide ",i.jsx(He,{className:"w-3 h-3"})]}),i.jsxs(xe,{to:"/architecture",className:"font-mono text-xs text-primary hover:underline flex items-center gap-1",children:["Architecture ",i.jsx(He,{className:"w-3 h-3"})]}),i.jsxs(xe,{to:"/concepts",className:"font-mono text-xs text-primary hover:underline flex items-center gap-1",children:["Concepts ",i.jsx(He,{className:"w-3 h-3"})]}),i.jsxs(xe,{to:"/api-reference",className:"font-mono text-xs text-primary hover:underline flex items-center gap-1",children:["API & CLI Reference ",i.jsx(He,{className:"w-3 h-3"})]}),i.jsxs(xe,{to:"/skills",className:"font-mono text-xs text-primary hover:underline flex items-center gap-1",children:["Skills ",i.jsx(He,{className:"w-3 h-3"})]})]})]}),i.jsxs("section",{id:"why-extend",className:"pt-16 scroll-mt-4",children:[i.jsx(_t,{children:"Extend to any website"}),i.jsx("h2",{className:"font-display text-xl font-bold uppercase tracking-[0.06em] mb-4",children:"Write your own connector"}),i.jsx("p",{className:"text-sm opacity-70 max-w-[65ch] leading-relaxed mb-8",children:"commandGarden ships with built-in connectors, but you can write your own for any site. If you can see it in Chrome, you can turn it into a CLI command."}),i.jsx("div",{className:"space-y-3 mb-8",children:[["Create a YAML file","~/.commandgarden/connectors/"],["Declare the domain, capabilities, arguments, and columns",null],["Define a pipeline","navigate → wait → extract/fetch → map"],["Validate","cg validate my-connector.yaml"],["Run","cg run mysite/my-command --format json"]].map(([e,t],n)=>i.jsxs("div",{className:"flex gap-3 items-baseline",children:[i.jsxs("span",{className:"font-mono text-xs opacity-30 w-4 text-right shrink-0",children:[n+1,"."]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-sm font-medium",children:e}),t&&i.jsx("span",{className:"font-mono text-xs opacity-40 ml-2",children:t})]})]},n))}),i.jsx(si,{children:`site: mysite
381
+ name: my-command
382
+ version: "1.0"
383
+ description: "Fetch search results"
384
+ access: read
385
+
386
+ domains:
387
+ - "mysite.example.com"
388
+ capabilities:
389
+ - navigate
390
+ - dom_read
391
+
392
+ args:
393
+ - name: query
394
+ type: string
395
+ required: true
396
+
397
+ columns:
398
+ - name: title
399
+ type: string
400
+ - name: url
401
+ type: string
402
+
403
+ pipeline:
404
+ - step: navigate
405
+ url: "https://mysite.example.com/search?q=\${{ args.query }}"
406
+ - step: wait
407
+ selector: ".results"
408
+ - step: extract
409
+ selector: ".results .item"
410
+ fields:
411
+ title: "h3"
412
+ url: "a@href"`}),i.jsx("p",{className:"text-xs opacity-40 mt-4 max-w-[65ch]",children:"No JavaScript required for most connectors. The declarative YAML format covers DOM extraction, cookie-authenticated API calls, network interception, and data transformation."})]})]})}function ao({children:e}){return i.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.12em] mb-2",children:e})}function wb({children:e}){return i.jsx("pre",{className:"bg-base-200 border border-base-300 p-4 overflow-x-auto text-sm font-mono leading-relaxed",children:i.jsx("code",{children:e})})}const md=[{icon:ul,title:"Background Worker",subtitle:"no page contact",access:"Never touches the page. Talks to Chrome APIs directly.",steps:["navigate","cookie"],tone:"border-sky-500/40 bg-sky-500/[0.04]"},{icon:Im,title:"ISOLATED Content Script",subtitle:"DOM only",access:"Shares the live page DOM, but can't see the page's own JavaScript variables or in-memory state.",steps:["dom_read","dom_write","fetch"],tone:"border-emerald-500/40 bg-emerald-500/[0.04]"},{icon:wv,title:"MAIN Page World",subtitle:"full page access",access:"Runs in the exact same JS realm as the website itself. Anything the page can do, this can do too.",steps:["js_evaluate"],tone:"border-red-500/40 bg-red-500/[0.04]"}],Nb=[{cap:"navigate",zone:"Background",risk:"info",desc:"Open a URL and wait for the page to finish loading."},{cap:"dom_read",zone:"ISOLATED",risk:"info",desc:"Read text and structure out of the page. Never modifies anything."},{cap:"dom_write",zone:"ISOLATED",risk:"warning",desc:"Click, type, and interact with page elements."},{cap:"cookie_read",zone:"Background / ISOLATED",risk:"warning",desc:"Reuse the browser's existing session to call an API or read a cookie value."},{cap:"js_evaluate",zone:"MAIN",risk:"error",desc:"Run arbitrary JavaScript in the page: the escape hatch for sites with no simpler path. Least constrained, used as a last resort."}],kb={title:"What happens when you run a command",lanes:[{id:"client",label:"CLI / GUI",color:"client"},{id:"daemon",label:"Daemon",color:"daemon"},{id:"extension",label:"Extension",color:"extension"},{id:"browser",label:"Browser Tab",color:"browser"}],steps:[{type:"arrow",from:"client",to:"daemon",label:"cg run site/command"},{type:"action",lane:"daemon",label:"check auth + declared domains + capabilities"},{type:"arrow",from:"daemon",to:"extension",label:"send the pipeline"},{type:"arrow",from:"extension",to:"browser",label:"run each step in your open tab"},{type:"arrow",from:"browser",to:"extension",label:"page data"},{type:"arrow",from:"extension",to:"daemon",label:"structured rows"},{type:"arrow",from:"daemon",to:"client",label:"JSON / table / CSV"}]},Sb={title:"When a step needs your OK",lanes:[{id:"client",label:"CLI / GUI",color:"client"},{id:"daemon",label:"Daemon",color:"daemon"},{id:"extension",label:"Extension",color:"extension"}],steps:[{type:"action",lane:"daemon",label:"this step needs approval"},{type:"arrow",from:"daemon",to:"client",label:'prompt: "allow this?"'},{type:"arrow",from:"daemon",to:"extension",label:"also notify the extension"},{type:"arrow",from:"client",to:"daemon",label:"you say yes or no"},{type:"action",lane:"daemon",label:"whichever answers first wins"},{type:"action",lane:"daemon",label:"continue the pipeline, or stop and report why"}]},hd=[{label:"Low",variant:"success",desc:"Runs automatically. Reading data, navigating pages.",icon:Am},{label:"Medium",variant:"warning",desc:"Runs automatically, but every use is logged to the audit trail.",icon:Kv},{label:"High",variant:"error",desc:"Pauses for a yes/no, unless you've pre-approved that specific connector.",icon:Hv}];function Cb(){return i.jsxs("div",{className:"max-w-4xl mx-auto pb-20",children:[i.jsx("h2",{className:"font-display text-xl font-bold uppercase tracking-[0.06em] mb-1",children:"Concepts"}),i.jsx("p",{className:"text-sm opacity-60 mb-10",children:"Three ideas worth understanding before you dig deeper into commandGarden."}),i.jsxs("section",{id:"concepts-worlds",className:"mb-16 scroll-mt-4",children:[i.jsx(ao,{children:"Not every step is equally trusted"}),i.jsx("h3",{className:"font-display text-base font-semibold mb-3",children:"Capability & world model"}),i.jsxs("p",{className:"text-sm opacity-70 max-w-[65ch] leading-relaxed mb-6",children:["A connector's pipeline is a list of steps: ",i.jsx("span",{className:"font-mono text-xs",children:"navigate"}),","," ",i.jsx("span",{className:"font-mono text-xs",children:"extract"}),", ",i.jsx("span",{className:"font-mono text-xs",children:"click"}),", and so on. Each step type is only allowed to run in one of three places, and each place can see a little more of the page than the last."]}),i.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-3 mb-4",children:md.map((e,t)=>i.jsxs("div",{className:"relative",children:[i.jsxs("div",{className:`border p-4 h-full ${e.tone}`,children:[i.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[i.jsx(e.icon,{className:"w-4 h-4 opacity-50"}),i.jsx("span",{className:"font-display font-semibold text-sm",children:e.title})]}),i.jsx(H,{size:"xs",className:"mb-2",children:e.subtitle}),i.jsx("p",{className:"text-xs opacity-60 leading-relaxed mb-3",children:e.access}),i.jsx("div",{className:"flex flex-wrap gap-1.5",children:e.steps.map(n=>i.jsx("span",{className:"font-mono text-[0.65rem] px-1.5 py-0.5 bg-base-200 border border-base-300",children:n},n))})]}),t<md.length-1&&i.jsx(He,{className:"hidden md:block w-4 h-4 opacity-30 absolute top-1/2 -right-2 -translate-y-1/2 translate-x-1/2 z-10"})]},e.title))}),i.jsx("p",{className:"text-xs opacity-40 mb-8",children:"More access, left to right. Most steps never need the rightmost zone."}),i.jsx("div",{className:"overflow-x-auto border border-base-300",children:i.jsxs("table",{className:"table table-sm w-full",children:[i.jsx("thead",{children:i.jsxs("tr",{className:"bg-base-200",children:[i.jsx("th",{children:"Capability"}),i.jsx("th",{children:"Runs in"}),i.jsx("th",{children:"Risk"}),i.jsx("th",{children:"What it does"})]})}),i.jsx("tbody",{children:Nb.map(e=>i.jsxs("tr",{children:[i.jsx("td",{className:"font-mono text-xs font-semibold",children:e.cap}),i.jsx("td",{className:"text-xs opacity-60",children:e.zone}),i.jsx("td",{children:i.jsx(H,{variant:e.risk,size:"xs",children:e.risk==="info"?"low":e.risk==="warning"?"medium":"high"})}),i.jsx("td",{className:"text-sm opacity-70",children:e.desc})]},e.cap))})]})})]}),i.jsxs("section",{id:"concepts-lifecycle",className:"mb-16 scroll-mt-4",children:[i.jsx(ao,{children:"From command to structured data"}),i.jsx("h3",{className:"font-display text-base font-semibold mb-3",children:"Connector pipeline lifecycle"}),i.jsx("p",{className:"text-sm opacity-70 max-w-[65ch] leading-relaxed mb-6",children:"A connector is a YAML file describing a pipeline. Running it walks the same four hops every time, whether you typed the command or an AI agent did."}),i.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-[1.3fr_1fr] gap-4 mb-2",children:[i.jsx(pl,{flow:kb}),i.jsxs("div",{children:[i.jsx("h4",{className:"font-semibold text-sm mb-3",children:"A minimal connector pipeline"}),i.jsx(wb,{children:`pipeline:
413
+ - step: navigate
414
+ url: "https://example.com/tickets"
415
+ - step: wait
416
+ selector: ".ticket-row"
417
+ - step: extract
418
+ selector: ".ticket-row"
419
+ fields:
420
+ id: ".ticket-id"
421
+ title: ".ticket-title"`}),i.jsxs("p",{className:"text-xs opacity-50 mt-2",children:["Each ",i.jsx("span",{className:"font-mono",children:"step"})," above maps to one hop in the diagram: navigate opens the tab, wait confirms it loaded, extract reads structured rows back out."]})]})]})]}),i.jsxs("section",{id:"concepts-approval",className:"scroll-mt-4",children:[i.jsx(ao,{children:"Not everything runs unattended"}),i.jsx("h3",{className:"font-display text-base font-semibold mb-3",children:"Approval & risk-tiering workflow"}),i.jsx("p",{className:"text-sm opacity-70 max-w-[65ch] leading-relaxed mb-6",children:"Every capability has a risk tier. Low and medium tiers run without interruption. High-risk steps pause and wait for a human to say yes, either in the CLI or as a Chrome notification."}),i.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-3 mb-8",children:hd.map((e,t)=>i.jsxs("div",{className:"relative",children:[i.jsxs("div",{className:"border border-base-300 p-4 h-full",children:[i.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[i.jsx(e.icon,{className:"w-4 h-4 opacity-50"}),i.jsx(H,{variant:e.variant,size:"xs",children:e.label})]}),i.jsx("p",{className:"text-xs opacity-60 leading-relaxed",children:e.desc})]}),t<hd.length-1&&i.jsx(He,{className:"hidden sm:block w-4 h-4 opacity-30 absolute top-1/2 -right-2 -translate-y-1/2 translate-x-1/2 z-10"})]},e.label))}),i.jsx(pl,{flow:Sb}),i.jsxs("div",{className:"mt-6 border border-primary/20 bg-primary/[0.03] p-4 flex items-center gap-3",children:[i.jsx(Om,{className:"w-4 h-4 text-primary shrink-0"}),i.jsx("p",{className:"text-sm opacity-70",children:"No credentials are ever stored to make this work. Approval just gates whether an already-authenticated step is allowed to run."})]})]})]})}function Rs({isActive:e}){return`block px-3 py-2 text-sm transition-colors ${e?"bg-primary text-primary-content font-semibold":"hover:text-primary"}`}function zs({isActive:e}){return`block pl-5 pr-3 py-1.5 text-sm transition-colors ${e?"bg-primary text-primary-content font-semibold":"hover:text-primary"}`}const Is={"/config":[{label:"Server",id:"cfg-server"},{label:"Security",id:"cfg-security"},{label:"Sources",id:"cfg-sources"},{label:"Audit",id:"cfg-audit"},{label:"Output",id:"cfg-output"},{label:"Journal",id:"cfg-journal"}],"/architecture":[{label:"Diagram",id:"arch-diagram"},{label:"Components",id:"arch-components"},{label:"Data Stores",id:"arch-stores"},{label:"Data Flows",id:"arch-flows"},{label:"Security",id:"arch-security"},{label:"Packages",id:"arch-packages"},{label:"Build Order",id:"arch-build"}],"/api-reference":[{label:"Endpoints",id:"api-endpoints"},{label:"Pipeline Steps",id:"api-pipeline"},{label:"Expressions",id:"api-expressions"}],"/concepts":[{label:"Capability & World Model",id:"concepts-worlds"},{label:"Pipeline Lifecycle",id:"concepts-lifecycle"},{label:"Approval & Risk-Tiering",id:"concepts-approval"}],"/why":[{label:"The Problem",id:"why-problem"},{label:"The Solution",id:"why-solution"},{label:"Architecture",id:"why-architecture"},{label:"Built-in Apps",id:"why-apps"},{label:"Workflow",id:"why-happy-path"},{label:"Security",id:"why-security"},{label:"Get Started",id:"why-get-started"},{label:"Extend",id:"why-extend"}]};function Eb({sections:e}){const t=b.useMemo(()=>e.map(r=>r.id),[e]),n=v0(t),s=r=>{const a=document.getElementById(r);a&&a.scrollIntoView({behavior:"smooth",block:"start"})};return i.jsx("div",{className:"ml-3 border-l border-base-300 py-0.5",children:e.map(r=>i.jsx("button",{onClick:()=>s(r.id),className:`block w-full text-left pl-3 py-1 text-[0.7rem] transition-colors ${n===r.id?"text-primary opacity-100":"opacity-50 hover:opacity-70"}`,children:r.label},r.id))})}const Tb=[{label:"Daily",to:"/apps/journal/daily"},{label:"Weekly",to:"/apps/journal/weekly"}];function Ab({to:e,label:t,items:n}){const r=Ot().pathname.startsWith(e);return i.jsxs(i.Fragment,{children:[i.jsx(rt,{to:e,className:zs,children:t}),r&&n.length>0&&i.jsx("div",{className:"ml-3 border-l border-base-300 py-0.5",children:n.map(a=>i.jsx(rt,{to:a.to,className:({isActive:o})=>`block w-full text-left pl-3 py-1 text-[0.7rem] transition-colors ${o?"text-primary opacity-100":"opacity-50 hover:opacity-70"}`,children:a.label},a.to))})]})}function Ln({to:e,label:t,sections:n}){const r=Ot().pathname===e;return i.jsxs(i.Fragment,{children:[i.jsx(rt,{to:e,end:e==="/",className:Rs,children:t}),r&&n.length>0&&i.jsx(Eb,{sections:n})]})}function Lb(){const[e,t]=b.useState(!1),[n,s]=b.useState(!1),[r,a]=b.useState(!1),[o,l]=b.useState([]),[c,u]=b.useState(!1),p=b.useRef(null),d=Ot();b.useEffect(()=>{a(!1)},[d.pathname]),b.useEffect(()=>{if(!d.hash)return;const y=d.hash.slice(1),v=document.getElementById(y);v&&v.scrollIntoView({behavior:"smooth",block:"start"})},[d.pathname,d.hash]),b.useEffect(()=>{const y=()=>{B.getStatus().then(w=>{t(w.ok),s(w.extensionConnected)}).catch(()=>{t(!1),s(!1)})};y();const v=setInterval(y,3e4);return()=>clearInterval(v)},[]),b.useEffect(()=>{B.getConnectors().then(y=>{const v=ma(y.connectors).map(([w])=>w);l(v)}).catch(()=>{})},[]);const f=b.useMemo(()=>o.map(y=>({label:y,id:`conn-${y}`})),[o]),x=b.useCallback(()=>{const y=p.current;y&&u(y.scrollHeight-y.scrollTop-y.clientHeight>1)},[]);return b.useEffect(()=>{x();const y=p.current;if(y)return y.addEventListener("scroll",x,{passive:!0}),window.addEventListener("resize",x),()=>{y.removeEventListener("scroll",x),window.removeEventListener("resize",x)}},[x,f,d.pathname,e]),i.jsxs("div",{className:"flex min-h-screen",children:[i.jsx("button",{className:"fixed top-3 left-3 z-50 md:hidden btn btn-sm btn-ghost",onClick:()=>a(!r),"aria-label":r?"Close menu":"Open menu",children:i.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:r?i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"}):i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 6h16M4 12h16M4 18h16"})})}),r&&i.jsx("div",{className:"fixed inset-0 bg-black/30 z-30 md:hidden",onClick:()=>a(!1)}),i.jsxs("aside",{className:`w-56 bg-base-100 border-r border-base-300 flex flex-col fixed top-0 left-0 bottom-0 z-40 transition-transform duration-150 ease-out ${r?"translate-x-0":"-translate-x-full"} md:translate-x-0`,children:[i.jsxs("div",{className:"flex items-start justify-between px-3 py-3 border-b border-base-300",children:[i.jsxs(xe,{to:"/",className:"hover:opacity-80 transition-opacity",children:[i.jsxs("h1",{className:"font-display text-lg font-bold tracking-tight",children:[i.jsx("span",{className:"font-normal opacity-50",children:"command"}),"Garden"]}),i.jsx("p",{className:"font-mono text-[0.65rem] opacity-30 mt-1 uppercase tracking-[0.14em]",children:"browser automation"})]}),i.jsx("button",{className:"btn btn-ghost btn-sm btn-square",onClick:()=>{const y=document.documentElement.getAttribute("data-theme")==="dark"?"light":"dark";document.documentElement.setAttribute("data-theme",y),localStorage.setItem("theme",y)},"aria-label":"Toggle theme",children:i.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 3v1m0 16v1m9-9h-1M4 12H3m15.364 6.364l-.707-.707M6.343 6.343l-.707-.707m12.728 0l-.707.707M6.343 17.657l-.707.707M16 12a4 4 0 11-8 0 4 4 0 018 0z"})})})]}),i.jsxs("div",{className:"relative flex-1 min-h-0",children:[i.jsxs("nav",{ref:p,className:"h-full px-2 py-2 space-y-0.5 overflow-y-auto",children:[i.jsx("div",{className:"px-3 pt-3 pb-1.5 font-mono text-[0.6rem] font-medium opacity-70 uppercase tracking-[0.12em]",children:"Overview"}),i.jsx(rt,{to:"/",end:!0,className:Rs,children:"Dashboard"}),i.jsx(rt,{to:"/guide",className:Rs,children:"Setup Guide"}),i.jsx("div",{className:"px-3 pt-6 pb-1.5 font-mono text-[0.6rem] font-medium opacity-70 uppercase tracking-[0.12em]",children:"Apps"}),i.jsx("div",{className:"pl-5 pr-3 pt-3 pb-1 font-mono text-[0.65rem] font-medium opacity-70 uppercase tracking-[0.12em]",children:"Administrative"}),i.jsx(rt,{to:"/apps/timetracking",className:zs,children:"Time Tracking"}),i.jsx(rt,{to:"/apps/rooms",className:zs,children:"Room Availability"}),i.jsx("div",{className:"pl-5 pr-3 pt-3 pb-1 font-mono text-[0.65rem] font-medium opacity-70 uppercase tracking-[0.12em]",children:"Productivity"}),i.jsx(Ab,{to:"/apps/journal",label:"Dev Journal",items:Tb}),i.jsx(rt,{to:"/apps/trusted-peer-expiry",className:zs,children:"Trusted Peer Expiry"}),i.jsx("div",{className:"pl-5 pr-3 pt-3 pb-1 font-mono text-[0.65rem] font-medium opacity-70 uppercase tracking-[0.12em]",children:"Security"}),i.jsx(rt,{to:"/apps/security-news",className:zs,children:"Security News"}),i.jsx("div",{className:"px-3 pt-6 pb-1.5 font-mono text-[0.6rem] font-medium opacity-70 uppercase tracking-[0.12em]",children:"Platform"}),i.jsx(Ln,{to:"/connectors",label:"Connectors",sections:f}),i.jsx(rt,{to:"/audit",className:Rs,children:"Audit Log"}),i.jsx(Ln,{to:"/config",label:"Configuration",sections:e?Is["/config"]:[]}),i.jsx("div",{className:"px-3 pt-6 pb-1.5 font-mono text-[0.6rem] font-medium opacity-70 uppercase tracking-[0.12em]",children:"Reference"}),i.jsx(Ln,{to:"/why",label:"Why commandGarden",sections:Is["/why"]}),i.jsx(Ln,{to:"/api-reference",label:"API & CLI",sections:Is["/api-reference"]}),i.jsx(rt,{to:"/skills",className:Rs,children:"Skills"}),i.jsx("div",{className:"px-3 pt-6 pb-1.5 font-mono text-[0.6rem] font-medium opacity-70 uppercase tracking-[0.12em]",children:"Deep Dive"}),i.jsx(Ln,{to:"/concepts",label:"Concepts",sections:Is["/concepts"]}),i.jsx(Ln,{to:"/architecture",label:"Architecture",sections:Is["/architecture"]})]}),c&&i.jsx("div",{className:"pointer-events-none absolute bottom-0 inset-x-0 h-8 bg-gradient-to-t from-base-100 to-transparent","aria-hidden":"true"})]}),i.jsxs("div",{className:"px-3 py-2.5 border-t border-base-300",children:[i.jsxs("div",{className:"flex items-center gap-2 text-xs font-mono",children:[i.jsx("span",{className:`w-1.5 h-1.5 ${e?"bg-success":"bg-error"}`,"aria-hidden":"true"}),i.jsx("span",{className:"opacity-50 text-[0.65rem]",children:e?"DAEMON OK":"DAEMON OFF"})]}),i.jsxs("div",{className:"flex items-center gap-2 text-xs font-mono mt-1",children:[i.jsx("span",{className:`w-1.5 h-1.5 ${n?"bg-success":"bg-error"}`,"aria-hidden":"true"}),i.jsx("span",{className:"opacity-50 text-[0.65rem]",children:n?"EXTENSION LINKED":"EXTENSION OFF"})]})]})]}),i.jsx("main",{className:"flex-1 p-4 pt-14 md:pt-5 md:p-5 md:ml-56",children:i.jsx(s0,{})})]})}function Ib(){return i.jsx(p0,{children:i.jsx(i0,{children:i.jsxs(de,{element:i.jsx(Lb,{}),children:[i.jsx(de,{index:!0,element:i.jsx(w0,{})}),i.jsx(de,{path:"connectors",element:i.jsx(S0,{})}),i.jsx(de,{path:"connectors/:site/:name",element:i.jsx(C0,{})}),i.jsx(de,{path:"audit",element:i.jsx(A0,{})}),i.jsx(de,{path:"config",element:i.jsx(Hx,{})}),i.jsx(de,{path:"guide",element:i.jsx(Xx,{})}),i.jsx(de,{path:"apps/timetracking",element:i.jsx(c1,{})}),i.jsx(de,{path:"apps/rooms",element:i.jsx(C1,{})}),i.jsx(de,{path:"apps/journal",element:i.jsx(n0,{to:"/apps/journal/daily",replace:!0})}),i.jsx(de,{path:"apps/journal/daily",element:i.jsx(W1,{})}),i.jsx(de,{path:"apps/journal/weekly",element:i.jsx(_1,{})}),i.jsx(de,{path:"apps/security-news",element:i.jsx(X1,{})}),i.jsx(de,{path:"apps/trusted-peer-expiry",element:i.jsx(sb,{})}),i.jsx(de,{path:"architecture",element:i.jsx(ub,{})}),i.jsx(de,{path:"api-reference",element:i.jsx(gb,{})}),i.jsx(de,{path:"skills",element:i.jsx(bb,{})}),i.jsx(de,{path:"why",element:i.jsx(jb,{})}),i.jsx(de,{path:"concepts",element:i.jsx(Cb,{})})]})})})}Ap(document.getElementById("root")).render(i.jsx(b.StrictMode,{children:i.jsx(Ib,{})}));