byterover-cli 3.11.0 → 3.12.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 (43) hide show
  1. package/dist/agent/infra/tools/implementations/curate-tool.js +18 -8
  2. package/dist/server/constants.d.ts +6 -0
  3. package/dist/server/constants.js +11 -0
  4. package/dist/server/core/domain/entities/task-history-entry.d.ts +775 -0
  5. package/dist/server/core/domain/entities/task-history-entry.js +88 -0
  6. package/dist/server/core/domain/transport/schemas.d.ts +1403 -11
  7. package/dist/server/core/domain/transport/schemas.js +157 -6
  8. package/dist/server/core/domain/transport/task-info.d.ts +18 -0
  9. package/dist/server/core/interfaces/process/i-task-lifecycle-hook.d.ts +7 -0
  10. package/dist/server/core/interfaces/storage/i-task-history-store.d.ts +62 -0
  11. package/dist/server/core/interfaces/storage/i-task-history-store.js +1 -0
  12. package/dist/server/infra/daemon/brv-server.js +43 -18
  13. package/dist/server/infra/dream/dream-response-schemas.d.ts +24 -0
  14. package/dist/server/infra/dream/dream-response-schemas.js +7 -0
  15. package/dist/server/infra/dream/operations/consolidate.js +21 -8
  16. package/dist/server/infra/dream/operations/synthesize.js +35 -8
  17. package/dist/server/infra/process/task-history-entry-builder.d.ts +36 -0
  18. package/dist/server/infra/process/task-history-entry-builder.js +101 -0
  19. package/dist/server/infra/process/task-history-hook.d.ts +37 -0
  20. package/dist/server/infra/process/task-history-hook.js +70 -0
  21. package/dist/server/infra/process/task-history-store-cache.d.ts +25 -0
  22. package/dist/server/infra/process/task-history-store-cache.js +106 -0
  23. package/dist/server/infra/process/task-router.d.ts +72 -0
  24. package/dist/server/infra/process/task-router.js +690 -15
  25. package/dist/server/infra/process/transport-handlers.d.ts +8 -0
  26. package/dist/server/infra/process/transport-handlers.js +2 -0
  27. package/dist/server/infra/storage/file-task-history-store.d.ts +294 -0
  28. package/dist/server/infra/storage/file-task-history-store.js +912 -0
  29. package/dist/shared/transport/events/index.d.ts +5 -0
  30. package/dist/shared/transport/events/task-events.d.ts +204 -1
  31. package/dist/shared/transport/events/task-events.js +11 -0
  32. package/dist/tui/features/tasks/hooks/use-task-subscriptions.js +7 -0
  33. package/dist/tui/features/tasks/stores/tasks-store.d.ts +4 -16
  34. package/dist/tui/features/tasks/stores/tasks-store.js +7 -0
  35. package/dist/tui/types/messages.d.ts +2 -9
  36. package/dist/webui/assets/index-DyVvFoM6.css +1 -0
  37. package/dist/webui/assets/index-lr0byHh9.js +130 -0
  38. package/dist/webui/index.html +2 -2
  39. package/dist/webui/sw.js +1 -1
  40. package/oclif.manifest.json +665 -665
  41. package/package.json +1 -1
  42. package/dist/webui/assets/index--sXE__bc.css +0 -1
  43. package/dist/webui/assets/index-Bkkx961b.js +0 -130
@@ -0,0 +1,130 @@
1
+ function qM(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in e)){const s=Object.getOwnPropertyDescriptor(r,i);s&&Object.defineProperty(e,i,s.get?s:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const a of s.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=n(i);fetch(i.href,s)}})();function Zc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var s2={exports:{}},rd={};var x5;function $M(){if(x5)return rd;x5=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,i,s){var a=null;if(s!==void 0&&(a=""+s),i.key!==void 0&&(a=""+i.key),"key"in i){s={};for(var c in i)c!=="key"&&(s[c]=i[c])}else s=i;return i=s.ref,{$$typeof:e,type:r,key:a,ref:i!==void 0?i:null,props:s}}return rd.Fragment=t,rd.jsx=n,rd.jsxs=n,rd}var b5;function YM(){return b5||(b5=1,s2.exports=$M()),s2.exports}var h=YM(),a2={exports:{}},id={},l2={exports:{}},c2={};var v5;function WM(){return v5||(v5=1,(function(e){function t(z,$){var G=z.length;z.push($);e:for(;0<G;){var Q=G-1>>>1,_=z[Q];if(0<i(_,$))z[Q]=$,z[G]=_,G=Q;else break e}}function n(z){return z.length===0?null:z[0]}function r(z){if(z.length===0)return null;var $=z[0],G=z.pop();if(G!==$){z[0]=G;e:for(var Q=0,_=z.length,P=_>>>1;Q<P;){var W=2*(Q+1)-1,D=z[W],Z=W+1,ee=z[Z];if(0>i(D,G))Z<_&&0>i(ee,D)?(z[Q]=ee,z[Z]=G,Q=Z):(z[Q]=D,z[W]=G,Q=W);else if(Z<_&&0>i(ee,G))z[Q]=ee,z[Z]=G,Q=Z;else break e}}return $}function i(z,$){var G=z.sortIndex-$.sortIndex;return G!==0?G:z.id-$.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var a=Date,c=a.now();e.unstable_now=function(){return a.now()-c}}var u=[],f=[],m=1,p=null,y=3,x=!1,b=!1,S=!1,k=!1,E=typeof setTimeout=="function"?setTimeout:null,T=typeof clearTimeout=="function"?clearTimeout:null,N=typeof setImmediate<"u"?setImmediate:null;function j(z){for(var $=n(f);$!==null;){if($.callback===null)r(f);else if($.startTime<=z)r(f),$.sortIndex=$.expirationTime,t(u,$);else break;$=n(f)}}function O(z){if(S=!1,j(z),!b)if(n(u)!==null)b=!0,A||(A=!0,Y());else{var $=n(f);$!==null&&H(O,$.startTime-z)}}var A=!1,R=-1,L=5,B=-1;function I(){return k?!0:!(e.unstable_now()-B<L)}function U(){if(k=!1,A){var z=e.unstable_now();B=z;var $=!0;try{e:{b=!1,S&&(S=!1,T(R),R=-1),x=!0;var G=y;try{t:{for(j(z),p=n(u);p!==null&&!(p.expirationTime>z&&I());){var Q=p.callback;if(typeof Q=="function"){p.callback=null,y=p.priorityLevel;var _=Q(p.expirationTime<=z);if(z=e.unstable_now(),typeof _=="function"){p.callback=_,j(z),$=!0;break t}p===n(u)&&r(u),j(z)}else r(u);p=n(u)}if(p!==null)$=!0;else{var P=n(f);P!==null&&H(O,P.startTime-z),$=!1}}break e}finally{p=null,y=G,x=!1}$=void 0}}finally{$?Y():A=!1}}}var Y;if(typeof N=="function")Y=function(){N(U)};else if(typeof MessageChannel<"u"){var V=new MessageChannel,q=V.port2;V.port1.onmessage=U,Y=function(){q.postMessage(null)}}else Y=function(){E(U,0)};function H(z,$){R=E(function(){z(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(z){z.callback=null},e.unstable_forceFrameRate=function(z){0>z||125<z?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):L=0<z?Math.floor(1e3/z):5},e.unstable_getCurrentPriorityLevel=function(){return y},e.unstable_next=function(z){switch(y){case 1:case 2:case 3:var $=3;break;default:$=y}var G=y;y=$;try{return z()}finally{y=G}},e.unstable_requestPaint=function(){k=!0},e.unstable_runWithPriority=function(z,$){switch(z){case 1:case 2:case 3:case 4:case 5:break;default:z=3}var G=y;y=z;try{return $()}finally{y=G}},e.unstable_scheduleCallback=function(z,$,G){var Q=e.unstable_now();switch(typeof G=="object"&&G!==null?(G=G.delay,G=typeof G=="number"&&0<G?Q+G:Q):G=Q,z){case 1:var _=-1;break;case 2:_=250;break;case 5:_=1073741823;break;case 4:_=1e4;break;default:_=5e3}return _=G+_,z={id:m++,callback:$,priorityLevel:z,startTime:G,expirationTime:_,sortIndex:-1},G>Q?(z.sortIndex=G,t(f,z),n(u)===null&&z===n(f)&&(S?(T(R),R=-1):S=!0,H(O,G-Q))):(z.sortIndex=_,t(u,z),b||x||(b=!0,A||(A=!0,Y()))),z},e.unstable_shouldYield=I,e.unstable_wrapCallback=function(z){var $=y;return function(){var G=y;y=$;try{return z.apply(this,arguments)}finally{y=G}}}})(c2)),c2}var w5;function GM(){return w5||(w5=1,l2.exports=WM()),l2.exports}var u2={exports:{}},At={};var S5;function KM(){if(S5)return At;S5=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),s=Symbol.for("react.consumer"),a=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),p=Symbol.for("react.activity"),y=Symbol.iterator;function x(P){return P===null||typeof P!="object"?null:(P=y&&P[y]||P["@@iterator"],typeof P=="function"?P:null)}var b={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,k={};function E(P,W,D){this.props=P,this.context=W,this.refs=k,this.updater=D||b}E.prototype.isReactComponent={},E.prototype.setState=function(P,W){if(typeof P!="object"&&typeof P!="function"&&P!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,P,W,"setState")},E.prototype.forceUpdate=function(P){this.updater.enqueueForceUpdate(this,P,"forceUpdate")};function T(){}T.prototype=E.prototype;function N(P,W,D){this.props=P,this.context=W,this.refs=k,this.updater=D||b}var j=N.prototype=new T;j.constructor=N,S(j,E.prototype),j.isPureReactComponent=!0;var O=Array.isArray;function A(){}var R={H:null,A:null,T:null,S:null},L=Object.prototype.hasOwnProperty;function B(P,W,D){var Z=D.ref;return{$$typeof:e,type:P,key:W,ref:Z!==void 0?Z:null,props:D}}function I(P,W){return B(P.type,W,P.props)}function U(P){return typeof P=="object"&&P!==null&&P.$$typeof===e}function Y(P){var W={"=":"=0",":":"=2"};return"$"+P.replace(/[=:]/g,function(D){return W[D]})}var V=/\/+/g;function q(P,W){return typeof P=="object"&&P!==null&&P.key!=null?Y(""+P.key):W.toString(36)}function H(P){switch(P.status){case"fulfilled":return P.value;case"rejected":throw P.reason;default:switch(typeof P.status=="string"?P.then(A,A):(P.status="pending",P.then(function(W){P.status==="pending"&&(P.status="fulfilled",P.value=W)},function(W){P.status==="pending"&&(P.status="rejected",P.reason=W)})),P.status){case"fulfilled":return P.value;case"rejected":throw P.reason}}throw P}function z(P,W,D,Z,ee){var J=typeof P;(J==="undefined"||J==="boolean")&&(P=null);var he=!1;if(P===null)he=!0;else switch(J){case"bigint":case"string":case"number":he=!0;break;case"object":switch(P.$$typeof){case e:case t:he=!0;break;case m:return he=P._init,z(he(P._payload),W,D,Z,ee)}}if(he)return ee=ee(P),he=Z===""?"."+q(P,0):Z,O(ee)?(D="",he!=null&&(D=he.replace(V,"$&/")+"/"),z(ee,W,D,"",function(Ae){return Ae})):ee!=null&&(U(ee)&&(ee=I(ee,D+(ee.key==null||P&&P.key===ee.key?"":(""+ee.key).replace(V,"$&/")+"/")+he)),W.push(ee)),1;he=0;var fe=Z===""?".":Z+":";if(O(P))for(var Se=0;Se<P.length;Se++)Z=P[Se],J=fe+q(Z,Se),he+=z(Z,W,D,J,ee);else if(Se=x(P),typeof Se=="function")for(P=Se.call(P),Se=0;!(Z=P.next()).done;)Z=Z.value,J=fe+q(Z,Se++),he+=z(Z,W,D,J,ee);else if(J==="object"){if(typeof P.then=="function")return z(H(P),W,D,Z,ee);throw W=String(P),Error("Objects are not valid as a React child (found: "+(W==="[object Object]"?"object with keys {"+Object.keys(P).join(", ")+"}":W)+"). If you meant to render a collection of children, use an array instead.")}return he}function $(P,W,D){if(P==null)return P;var Z=[],ee=0;return z(P,Z,"","",function(J){return W.call(D,J,ee++)}),Z}function G(P){if(P._status===-1){var W=P._result;W=W(),W.then(function(D){(P._status===0||P._status===-1)&&(P._status=1,P._result=D)},function(D){(P._status===0||P._status===-1)&&(P._status=2,P._result=D)}),P._status===-1&&(P._status=0,P._result=W)}if(P._status===1)return P._result.default;throw P._result}var Q=typeof reportError=="function"?reportError:function(P){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var W=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof P=="object"&&P!==null&&typeof P.message=="string"?String(P.message):String(P),error:P});if(!window.dispatchEvent(W))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",P);return}console.error(P)},_={map:$,forEach:function(P,W,D){$(P,function(){W.apply(this,arguments)},D)},count:function(P){var W=0;return $(P,function(){W++}),W},toArray:function(P){return $(P,function(W){return W})||[]},only:function(P){if(!U(P))throw Error("React.Children.only expected to receive a single React element child.");return P}};return At.Activity=p,At.Children=_,At.Component=E,At.Fragment=n,At.Profiler=i,At.PureComponent=N,At.StrictMode=r,At.Suspense=u,At.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=R,At.__COMPILER_RUNTIME={__proto__:null,c:function(P){return R.H.useMemoCache(P)}},At.cache=function(P){return function(){return P.apply(null,arguments)}},At.cacheSignal=function(){return null},At.cloneElement=function(P,W,D){if(P==null)throw Error("The argument must be a React element, but you passed "+P+".");var Z=S({},P.props),ee=P.key;if(W!=null)for(J in W.key!==void 0&&(ee=""+W.key),W)!L.call(W,J)||J==="key"||J==="__self"||J==="__source"||J==="ref"&&W.ref===void 0||(Z[J]=W[J]);var J=arguments.length-2;if(J===1)Z.children=D;else if(1<J){for(var he=Array(J),fe=0;fe<J;fe++)he[fe]=arguments[fe+2];Z.children=he}return B(P.type,ee,Z)},At.createContext=function(P){return P={$$typeof:a,_currentValue:P,_currentValue2:P,_threadCount:0,Provider:null,Consumer:null},P.Provider=P,P.Consumer={$$typeof:s,_context:P},P},At.createElement=function(P,W,D){var Z,ee={},J=null;if(W!=null)for(Z in W.key!==void 0&&(J=""+W.key),W)L.call(W,Z)&&Z!=="key"&&Z!=="__self"&&Z!=="__source"&&(ee[Z]=W[Z]);var he=arguments.length-2;if(he===1)ee.children=D;else if(1<he){for(var fe=Array(he),Se=0;Se<he;Se++)fe[Se]=arguments[Se+2];ee.children=fe}if(P&&P.defaultProps)for(Z in he=P.defaultProps,he)ee[Z]===void 0&&(ee[Z]=he[Z]);return B(P,J,ee)},At.createRef=function(){return{current:null}},At.forwardRef=function(P){return{$$typeof:c,render:P}},At.isValidElement=U,At.lazy=function(P){return{$$typeof:m,_payload:{_status:-1,_result:P},_init:G}},At.memo=function(P,W){return{$$typeof:f,type:P,compare:W===void 0?null:W}},At.startTransition=function(P){var W=R.T,D={};R.T=D;try{var Z=P(),ee=R.S;ee!==null&&ee(D,Z),typeof Z=="object"&&Z!==null&&typeof Z.then=="function"&&Z.then(A,Q)}catch(J){Q(J)}finally{W!==null&&D.types!==null&&(W.types=D.types),R.T=W}},At.unstable_useCacheRefresh=function(){return R.H.useCacheRefresh()},At.use=function(P){return R.H.use(P)},At.useActionState=function(P,W,D){return R.H.useActionState(P,W,D)},At.useCallback=function(P,W){return R.H.useCallback(P,W)},At.useContext=function(P){return R.H.useContext(P)},At.useDebugValue=function(){},At.useDeferredValue=function(P,W){return R.H.useDeferredValue(P,W)},At.useEffect=function(P,W){return R.H.useEffect(P,W)},At.useEffectEvent=function(P){return R.H.useEffectEvent(P)},At.useId=function(){return R.H.useId()},At.useImperativeHandle=function(P,W,D){return R.H.useImperativeHandle(P,W,D)},At.useInsertionEffect=function(P,W){return R.H.useInsertionEffect(P,W)},At.useLayoutEffect=function(P,W){return R.H.useLayoutEffect(P,W)},At.useMemo=function(P,W){return R.H.useMemo(P,W)},At.useOptimistic=function(P,W){return R.H.useOptimistic(P,W)},At.useReducer=function(P,W,D){return R.H.useReducer(P,W,D)},At.useRef=function(P){return R.H.useRef(P)},At.useState=function(P){return R.H.useState(P)},At.useSyncExternalStore=function(P,W,D){return R.H.useSyncExternalStore(P,W,D)},At.useTransition=function(){return R.H.useTransition()},At.version="19.2.4",At}var C5;function xf(){return C5||(C5=1,u2.exports=KM()),u2.exports}var d2={exports:{}},Er={};var k5;function QM(){if(k5)return Er;k5=1;var e=xf();function t(u){var f="https://react.dev/errors/"+u;if(1<arguments.length){f+="?args[]="+encodeURIComponent(arguments[1]);for(var m=2;m<arguments.length;m++)f+="&args[]="+encodeURIComponent(arguments[m])}return"Minified React error #"+u+"; visit "+f+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},i=Symbol.for("react.portal");function s(u,f,m){var p=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:i,key:p==null?null:""+p,children:u,containerInfo:f,implementation:m}}var a=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(u,f){if(u==="font")return"";if(typeof f=="string")return f==="use-credentials"?f:""}return Er.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,Er.createPortal=function(u,f){var m=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!f||f.nodeType!==1&&f.nodeType!==9&&f.nodeType!==11)throw Error(t(299));return s(u,f,null,m)},Er.flushSync=function(u){var f=a.T,m=r.p;try{if(a.T=null,r.p=2,u)return u()}finally{a.T=f,r.p=m,r.d.f()}},Er.preconnect=function(u,f){typeof u=="string"&&(f?(f=f.crossOrigin,f=typeof f=="string"?f==="use-credentials"?f:"":void 0):f=null,r.d.C(u,f))},Er.prefetchDNS=function(u){typeof u=="string"&&r.d.D(u)},Er.preinit=function(u,f){if(typeof u=="string"&&f&&typeof f.as=="string"){var m=f.as,p=c(m,f.crossOrigin),y=typeof f.integrity=="string"?f.integrity:void 0,x=typeof f.fetchPriority=="string"?f.fetchPriority:void 0;m==="style"?r.d.S(u,typeof f.precedence=="string"?f.precedence:void 0,{crossOrigin:p,integrity:y,fetchPriority:x}):m==="script"&&r.d.X(u,{crossOrigin:p,integrity:y,fetchPriority:x,nonce:typeof f.nonce=="string"?f.nonce:void 0})}},Er.preinitModule=function(u,f){if(typeof u=="string")if(typeof f=="object"&&f!==null){if(f.as==null||f.as==="script"){var m=c(f.as,f.crossOrigin);r.d.M(u,{crossOrigin:m,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0})}}else f==null&&r.d.M(u)},Er.preload=function(u,f){if(typeof u=="string"&&typeof f=="object"&&f!==null&&typeof f.as=="string"){var m=f.as,p=c(m,f.crossOrigin);r.d.L(u,m,{crossOrigin:p,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0,type:typeof f.type=="string"?f.type:void 0,fetchPriority:typeof f.fetchPriority=="string"?f.fetchPriority:void 0,referrerPolicy:typeof f.referrerPolicy=="string"?f.referrerPolicy:void 0,imageSrcSet:typeof f.imageSrcSet=="string"?f.imageSrcSet:void 0,imageSizes:typeof f.imageSizes=="string"?f.imageSizes:void 0,media:typeof f.media=="string"?f.media:void 0})}},Er.preloadModule=function(u,f){if(typeof u=="string")if(f){var m=c(f.as,f.crossOrigin);r.d.m(u,{as:typeof f.as=="string"&&f.as!=="script"?f.as:void 0,crossOrigin:m,integrity:typeof f.integrity=="string"?f.integrity:void 0})}else r.d.m(u)},Er.requestFormReset=function(u){r.d.r(u)},Er.unstable_batchedUpdates=function(u,f){return u(f)},Er.useFormState=function(u,f,m){return a.H.useFormState(u,f,m)},Er.useFormStatus=function(){return a.H.useHostTransitionStatus()},Er.version="19.2.4",Er}var E5;function s6(){if(E5)return d2.exports;E5=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),d2.exports=QM(),d2.exports}var T5;function XM(){if(T5)return id;T5=1;var e=GM(),t=xf(),n=s6();function r(o){var l="https://react.dev/errors/"+o;if(1<arguments.length){l+="?args[]="+encodeURIComponent(arguments[1]);for(var d=2;d<arguments.length;d++)l+="&args[]="+encodeURIComponent(arguments[d])}return"Minified React error #"+o+"; visit "+l+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(o){return!(!o||o.nodeType!==1&&o.nodeType!==9&&o.nodeType!==11)}function s(o){var l=o,d=o;if(o.alternate)for(;l.return;)l=l.return;else{o=l;do l=o,(l.flags&4098)!==0&&(d=l.return),o=l.return;while(o)}return l.tag===3?d:null}function a(o){if(o.tag===13){var l=o.memoizedState;if(l===null&&(o=o.alternate,o!==null&&(l=o.memoizedState)),l!==null)return l.dehydrated}return null}function c(o){if(o.tag===31){var l=o.memoizedState;if(l===null&&(o=o.alternate,o!==null&&(l=o.memoizedState)),l!==null)return l.dehydrated}return null}function u(o){if(s(o)!==o)throw Error(r(188))}function f(o){var l=o.alternate;if(!l){if(l=s(o),l===null)throw Error(r(188));return l!==o?null:o}for(var d=o,g=l;;){var v=d.return;if(v===null)break;var C=v.alternate;if(C===null){if(g=v.return,g!==null){d=g;continue}break}if(v.child===C.child){for(C=v.child;C;){if(C===d)return u(v),o;if(C===g)return u(v),l;C=C.sibling}throw Error(r(188))}if(d.return!==g.return)d=v,g=C;else{for(var M=!1,F=v.child;F;){if(F===d){M=!0,d=v,g=C;break}if(F===g){M=!0,g=v,d=C;break}F=F.sibling}if(!M){for(F=C.child;F;){if(F===d){M=!0,d=C,g=v;break}if(F===g){M=!0,g=C,d=v;break}F=F.sibling}if(!M)throw Error(r(189))}}if(d.alternate!==g)throw Error(r(190))}if(d.tag!==3)throw Error(r(188));return d.stateNode.current===d?o:l}function m(o){var l=o.tag;if(l===5||l===26||l===27||l===6)return o;for(o=o.child;o!==null;){if(l=m(o),l!==null)return l;o=o.sibling}return null}var p=Object.assign,y=Symbol.for("react.element"),x=Symbol.for("react.transitional.element"),b=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),k=Symbol.for("react.strict_mode"),E=Symbol.for("react.profiler"),T=Symbol.for("react.consumer"),N=Symbol.for("react.context"),j=Symbol.for("react.forward_ref"),O=Symbol.for("react.suspense"),A=Symbol.for("react.suspense_list"),R=Symbol.for("react.memo"),L=Symbol.for("react.lazy"),B=Symbol.for("react.activity"),I=Symbol.for("react.memo_cache_sentinel"),U=Symbol.iterator;function Y(o){return o===null||typeof o!="object"?null:(o=U&&o[U]||o["@@iterator"],typeof o=="function"?o:null)}var V=Symbol.for("react.client.reference");function q(o){if(o==null)return null;if(typeof o=="function")return o.$$typeof===V?null:o.displayName||o.name||null;if(typeof o=="string")return o;switch(o){case S:return"Fragment";case E:return"Profiler";case k:return"StrictMode";case O:return"Suspense";case A:return"SuspenseList";case B:return"Activity"}if(typeof o=="object")switch(o.$$typeof){case b:return"Portal";case N:return o.displayName||"Context";case T:return(o._context.displayName||"Context")+".Consumer";case j:var l=o.render;return o=o.displayName,o||(o=l.displayName||l.name||"",o=o!==""?"ForwardRef("+o+")":"ForwardRef"),o;case R:return l=o.displayName||null,l!==null?l:q(o.type)||"Memo";case L:l=o._payload,o=o._init;try{return q(o(l))}catch{}}return null}var H=Array.isArray,z=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,$=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,G={pending:!1,data:null,method:null,action:null},Q=[],_=-1;function P(o){return{current:o}}function W(o){0>_||(o.current=Q[_],Q[_]=null,_--)}function D(o,l){_++,Q[_]=o.current,o.current=l}var Z=P(null),ee=P(null),J=P(null),he=P(null);function fe(o,l){switch(D(J,l),D(ee,o),D(Z,null),l.nodeType){case 9:case 11:o=(o=l.documentElement)&&(o=o.namespaceURI)?HC(o):0;break;default:if(o=l.tagName,l=l.namespaceURI)l=HC(l),o=UC(l,o);else switch(o){case"svg":o=1;break;case"math":o=2;break;default:o=0}}W(Z),D(Z,o)}function Se(){W(Z),W(ee),W(J)}function Ae(o){o.memoizedState!==null&&D(he,o);var l=Z.current,d=UC(l,o.type);l!==d&&(D(ee,o),D(Z,d))}function Oe(o){ee.current===o&&(W(Z),W(ee)),he.current===o&&(W(he),Ju._currentValue=G)}var Pe,_e;function De(o){if(Pe===void 0)try{throw Error()}catch(d){var l=d.stack.trim().match(/\n( *(at )?)/);Pe=l&&l[1]||"",_e=-1<d.stack.indexOf(`
2
+ at`)?" (<anonymous>)":-1<d.stack.indexOf("@")?"@unknown:0:0":""}return`
3
+ `+Pe+o+_e}var xe=!1;function Ge(o,l){if(!o||xe)return"";xe=!0;var d=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var g={DetermineComponentFrameRoot:function(){try{if(l){var Ne=function(){throw Error()};if(Object.defineProperty(Ne.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Ne,[])}catch(me){var de=me}Reflect.construct(o,[],Ne)}else{try{Ne.call()}catch(me){de=me}o.call(Ne.prototype)}}else{try{throw Error()}catch(me){de=me}(Ne=o())&&typeof Ne.catch=="function"&&Ne.catch(function(){})}}catch(me){if(me&&de&&typeof me.stack=="string")return[me.stack,de.stack]}return[null,null]}};g.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var v=Object.getOwnPropertyDescriptor(g.DetermineComponentFrameRoot,"name");v&&v.configurable&&Object.defineProperty(g.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var C=g.DetermineComponentFrameRoot(),M=C[0],F=C[1];if(M&&F){var X=M.split(`
4
+ `),ue=F.split(`
5
+ `);for(v=g=0;g<X.length&&!X[g].includes("DetermineComponentFrameRoot");)g++;for(;v<ue.length&&!ue[v].includes("DetermineComponentFrameRoot");)v++;if(g===X.length||v===ue.length)for(g=X.length-1,v=ue.length-1;1<=g&&0<=v&&X[g]!==ue[v];)v--;for(;1<=g&&0<=v;g--,v--)if(X[g]!==ue[v]){if(g!==1||v!==1)do if(g--,v--,0>v||X[g]!==ue[v]){var ve=`
6
+ `+X[g].replace(" at new "," at ");return o.displayName&&ve.includes("<anonymous>")&&(ve=ve.replace("<anonymous>",o.displayName)),ve}while(1<=g&&0<=v);break}}}finally{xe=!1,Error.prepareStackTrace=d}return(d=o?o.displayName||o.name:"")?De(d):""}function we(o,l){switch(o.tag){case 26:case 27:case 5:return De(o.type);case 16:return De("Lazy");case 13:return o.child!==l&&l!==null?De("Suspense Fallback"):De("Suspense");case 19:return De("SuspenseList");case 0:case 15:return Ge(o.type,!1);case 11:return Ge(o.type.render,!1);case 1:return Ge(o.type,!0);case 31:return De("Activity");default:return""}}function Re(o){try{var l="",d=null;do l+=we(o,d),d=o,o=o.return;while(o);return l}catch(g){return`
7
+ Error generating stack: `+g.message+`
8
+ `+g.stack}}var pe=Object.prototype.hasOwnProperty,be=e.unstable_scheduleCallback,ne=e.unstable_cancelCallback,ye=e.unstable_shouldYield,Ce=e.unstable_requestPaint,Ve=e.unstable_now,lt=e.unstable_getCurrentPriorityLevel,oe=e.unstable_ImmediatePriority,ke=e.unstable_UserBlockingPriority,Le=e.unstable_NormalPriority,Me=e.unstable_LowPriority,He=e.unstable_IdlePriority,ut=e.log,xt=e.unstable_setDisableYieldValue,Je=null,Ke=null;function bt(o){if(typeof ut=="function"&&xt(o),Ke&&typeof Ke.setStrictMode=="function")try{Ke.setStrictMode(Je,o)}catch{}}var nt=Math.clz32?Math.clz32:qe,Qe=Math.log,Ct=Math.LN2;function qe(o){return o>>>=0,o===0?32:31-(Qe(o)/Ct|0)|0}var ge=256,je=262144,Ye=4194304;function Rt(o){var l=o&42;if(l!==0)return l;switch(o&-o){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:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return o&261888;case 262144:case 524288:case 1048576:case 2097152:return o&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return o&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return o}}function Ie(o,l,d){var g=o.pendingLanes;if(g===0)return 0;var v=0,C=o.suspendedLanes,M=o.pingedLanes;o=o.warmLanes;var F=g&134217727;return F!==0?(g=F&~C,g!==0?v=Rt(g):(M&=F,M!==0?v=Rt(M):d||(d=F&~o,d!==0&&(v=Rt(d))))):(F=g&~C,F!==0?v=Rt(F):M!==0?v=Rt(M):d||(d=g&~o,d!==0&&(v=Rt(d)))),v===0?0:l!==0&&l!==v&&(l&C)===0&&(C=v&-v,d=l&-l,C>=d||C===32&&(d&4194048)!==0)?l:v}function Pt(o,l){return(o.pendingLanes&~(o.suspendedLanes&~o.pingedLanes)&l)===0}function on(o,l){switch(o){case 1:case 2:case 4:case 8:case 64:return l+250;case 16:case 32: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 l+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function tn(){var o=Ye;return Ye<<=1,(Ye&62914560)===0&&(Ye=4194304),o}function vn(o){for(var l=[],d=0;31>d;d++)l.push(o);return l}function Ut(o,l){o.pendingLanes|=l,l!==268435456&&(o.suspendedLanes=0,o.pingedLanes=0,o.warmLanes=0)}function yt(o,l,d,g,v,C){var M=o.pendingLanes;o.pendingLanes=d,o.suspendedLanes=0,o.pingedLanes=0,o.warmLanes=0,o.expiredLanes&=d,o.entangledLanes&=d,o.errorRecoveryDisabledLanes&=d,o.shellSuspendCounter=0;var F=o.entanglements,X=o.expirationTimes,ue=o.hiddenUpdates;for(d=M&~d;0<d;){var ve=31-nt(d),Ne=1<<ve;F[ve]=0,X[ve]=-1;var de=ue[ve];if(de!==null)for(ue[ve]=null,ve=0;ve<de.length;ve++){var me=de[ve];me!==null&&(me.lane&=-536870913)}d&=~Ne}g!==0&&zt(o,g,0),C!==0&&v===0&&o.tag!==0&&(o.suspendedLanes|=C&~(M&~l))}function zt(o,l,d){o.pendingLanes|=l,o.suspendedLanes&=~l;var g=31-nt(l);o.entangledLanes|=l,o.entanglements[g]=o.entanglements[g]|1073741824|d&261930}function K(o,l){var d=o.entangledLanes|=l;for(o=o.entanglements;d;){var g=31-nt(d),v=1<<g;v&l|o[g]&l&&(o[g]|=l),d&=~v}}function te(o,l){var d=l&-l;return d=(d&42)!==0?1:se(d),(d&(o.suspendedLanes|l))!==0?0:d}function se(o){switch(o){case 2:o=1;break;case 8:o=4;break;case 32:o=16;break;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:o=128;break;case 268435456:o=134217728;break;default:o=0}return o}function Te(o){return o&=-o,2<o?8<o?(o&134217727)!==0?32:268435456:8:2}function Be(){var o=$.p;return o!==0?o:(o=window.event,o===void 0?32:d5(o.type))}function st(o,l){var d=$.p;try{return $.p=o,l()}finally{$.p=d}}var Ze=Math.random().toString(36).slice(2),Xe="__reactFiber$"+Ze,et="__reactProps$"+Ze,ct="__reactContainer$"+Ze,vt="__reactEvents$"+Ze,dt="__reactListeners$"+Ze,Xt="__reactHandles$"+Ze,$t="__reactResources$"+Ze,Mn="__reactMarker$"+Ze;function _n(o){delete o[Xe],delete o[et],delete o[vt],delete o[dt],delete o[Xt]}function Ln(o){var l=o[Xe];if(l)return l;for(var d=o.parentNode;d;){if(l=d[ct]||d[Xe]){if(d=l.alternate,l.child!==null||d!==null&&d.child!==null)for(o=KC(o);o!==null;){if(d=o[Xe])return d;o=KC(o)}return l}o=d,d=o.parentNode}return null}function Yt(o){if(o=o[Xe]||o[ct]){var l=o.tag;if(l===5||l===6||l===13||l===31||l===26||l===27||l===3)return o}return null}function dr(o){var l=o.tag;if(l===5||l===26||l===27||l===6)return o.stateNode;throw Error(r(33))}function Ur(o){var l=o[$t];return l||(l=o[$t]={hoistableStyles:new Map,hoistableScripts:new Map}),l}function Rn(o){o[Mn]=!0}var Qi=new Set,ri={};function Xi(o,l){Ri(o,l),Ri(o+"Capture",l)}function Ri(o,l){for(ri[o]=l,o=0;o<l.length;o++)Qi.add(l[o])}var Po=RegExp("^[: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]*$"),Ma={},Da={};function Wt(o){return pe.call(Da,o)?!0:pe.call(Ma,o)?!1:Po.test(o)?Da[o]=!0:(Ma[o]=!0,!1)}function $n(o,l,d){if(Wt(l))if(d===null)o.removeAttribute(l);else{switch(typeof d){case"undefined":case"function":case"symbol":o.removeAttribute(l);return;case"boolean":var g=l.toLowerCase().slice(0,5);if(g!=="data-"&&g!=="aria-"){o.removeAttribute(l);return}}o.setAttribute(l,""+d)}}function Zi(o,l,d){if(d===null)o.removeAttribute(l);else{switch(typeof d){case"undefined":case"function":case"symbol":case"boolean":o.removeAttribute(l);return}o.setAttribute(l,""+d)}}function yr(o,l,d,g){if(g===null)o.removeAttribute(d);else{switch(typeof g){case"undefined":case"function":case"symbol":case"boolean":o.removeAttribute(d);return}o.setAttributeNS(l,d,""+g)}}function Gt(o){switch(typeof o){case"bigint":case"boolean":case"number":case"string":case"undefined":return o;case"object":return o;default:return""}}function _a(o){var l=o.type;return(o=o.nodeName)&&o.toLowerCase()==="input"&&(l==="checkbox"||l==="radio")}function eh(o,l,d){var g=Object.getOwnPropertyDescriptor(o.constructor.prototype,l);if(!o.hasOwnProperty(l)&&typeof g<"u"&&typeof g.get=="function"&&typeof g.set=="function"){var v=g.get,C=g.set;return Object.defineProperty(o,l,{configurable:!0,get:function(){return v.call(this)},set:function(M){d=""+M,C.call(this,M)}}),Object.defineProperty(o,l,{enumerable:g.enumerable}),{getValue:function(){return d},setValue:function(M){d=""+M},stopTracking:function(){o._valueTracker=null,delete o[l]}}}}function mu(o){if(!o._valueTracker){var l=_a(o)?"checked":"value";o._valueTracker=eh(o,l,""+o[l])}}function _w(o){if(!o)return!1;var l=o._valueTracker;if(!l)return!0;var d=l.getValue(),g="";return o&&(g=_a(o)?o.checked?"true":"false":o.value),o=g,o!==d?(l.setValue(o),!0):!1}function th(o){if(o=o||(typeof document<"u"?document:void 0),typeof o>"u")return null;try{return o.activeElement||o.body}catch{return o.body}}var zO=/[\n"\\]/g;function Ai(o){return o.replace(zO,function(l){return"\\"+l.charCodeAt(0).toString(16)+" "})}function eg(o,l,d,g,v,C,M,F){o.name="",M!=null&&typeof M!="function"&&typeof M!="symbol"&&typeof M!="boolean"?o.type=M:o.removeAttribute("type"),l!=null?M==="number"?(l===0&&o.value===""||o.value!=l)&&(o.value=""+Gt(l)):o.value!==""+Gt(l)&&(o.value=""+Gt(l)):M!=="submit"&&M!=="reset"||o.removeAttribute("value"),l!=null?tg(o,M,Gt(l)):d!=null?tg(o,M,Gt(d)):g!=null&&o.removeAttribute("value"),v==null&&C!=null&&(o.defaultChecked=!!C),v!=null&&(o.checked=v&&typeof v!="function"&&typeof v!="symbol"),F!=null&&typeof F!="function"&&typeof F!="symbol"&&typeof F!="boolean"?o.name=""+Gt(F):o.removeAttribute("name")}function Lw(o,l,d,g,v,C,M,F){if(C!=null&&typeof C!="function"&&typeof C!="symbol"&&typeof C!="boolean"&&(o.type=C),l!=null||d!=null){if(!(C!=="submit"&&C!=="reset"||l!=null)){mu(o);return}d=d!=null?""+Gt(d):"",l=l!=null?""+Gt(l):d,F||l===o.value||(o.value=l),o.defaultValue=l}g=g??v,g=typeof g!="function"&&typeof g!="symbol"&&!!g,o.checked=F?o.checked:!!g,o.defaultChecked=!!g,M!=null&&typeof M!="function"&&typeof M!="symbol"&&typeof M!="boolean"&&(o.name=M),mu(o)}function tg(o,l,d){l==="number"&&th(o.ownerDocument)===o||o.defaultValue===""+d||(o.defaultValue=""+d)}function jl(o,l,d,g){if(o=o.options,l){l={};for(var v=0;v<d.length;v++)l["$"+d[v]]=!0;for(d=0;d<o.length;d++)v=l.hasOwnProperty("$"+o[d].value),o[d].selected!==v&&(o[d].selected=v),v&&g&&(o[d].defaultSelected=!0)}else{for(d=""+Gt(d),l=null,v=0;v<o.length;v++){if(o[v].value===d){o[v].selected=!0,g&&(o[v].defaultSelected=!0);return}l!==null||o[v].disabled||(l=o[v])}l!==null&&(l.selected=!0)}}function Iw(o,l,d){if(l!=null&&(l=""+Gt(l),l!==o.value&&(o.value=l),d==null)){o.defaultValue!==l&&(o.defaultValue=l);return}o.defaultValue=d!=null?""+Gt(d):""}function Pw(o,l,d,g){if(l==null){if(g!=null){if(d!=null)throw Error(r(92));if(H(g)){if(1<g.length)throw Error(r(93));g=g[0]}d=g}d==null&&(d=""),l=d}d=Gt(l),o.defaultValue=d,g=o.textContent,g===d&&g!==""&&g!==null&&(o.value=g),mu(o)}function Ml(o,l){if(l){var d=o.firstChild;if(d&&d===o.lastChild&&d.nodeType===3){d.nodeValue=l;return}}o.textContent=l}var FO=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function zw(o,l,d){var g=l.indexOf("--")===0;d==null||typeof d=="boolean"||d===""?g?o.setProperty(l,""):l==="float"?o.cssFloat="":o[l]="":g?o.setProperty(l,d):typeof d!="number"||d===0||FO.has(l)?l==="float"?o.cssFloat=d:o[l]=(""+d).trim():o[l]=d+"px"}function Fw(o,l,d){if(l!=null&&typeof l!="object")throw Error(r(62));if(o=o.style,d!=null){for(var g in d)!d.hasOwnProperty(g)||l!=null&&l.hasOwnProperty(g)||(g.indexOf("--")===0?o.setProperty(g,""):g==="float"?o.cssFloat="":o[g]="");for(var v in l)g=l[v],l.hasOwnProperty(v)&&d[v]!==g&&zw(o,v,g)}else for(var C in l)l.hasOwnProperty(C)&&zw(o,C,l[C])}function ng(o){if(o.indexOf("-")===-1)return!1;switch(o){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=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),HO=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function nh(o){return HO.test(""+o)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":o}function zo(){}var rg=null;function ig(o){return o=o.target||o.srcElement||window,o.correspondingUseElement&&(o=o.correspondingUseElement),o.nodeType===3?o.parentNode:o}var Dl=null,_l=null;function Bw(o){var l=Yt(o);if(l&&(o=l.stateNode)){var d=o[et]||null;e:switch(o=l.stateNode,l.type){case"input":if(eg(o,d.value,d.defaultValue,d.defaultValue,d.checked,d.defaultChecked,d.type,d.name),l=d.name,d.type==="radio"&&l!=null){for(d=o;d.parentNode;)d=d.parentNode;for(d=d.querySelectorAll('input[name="'+Ai(""+l)+'"][type="radio"]'),l=0;l<d.length;l++){var g=d[l];if(g!==o&&g.form===o.form){var v=g[et]||null;if(!v)throw Error(r(90));eg(g,v.value,v.defaultValue,v.defaultValue,v.checked,v.defaultChecked,v.type,v.name)}}for(l=0;l<d.length;l++)g=d[l],g.form===o.form&&_w(g)}break e;case"textarea":Iw(o,d.value,d.defaultValue);break e;case"select":l=d.value,l!=null&&jl(o,!!d.multiple,l,!1)}}}var og=!1;function Hw(o,l,d){if(og)return o(l,d);og=!0;try{var g=o(l);return g}finally{if(og=!1,(Dl!==null||_l!==null)&&(Vh(),Dl&&(l=Dl,o=_l,_l=Dl=null,Bw(l),o)))for(l=0;l<o.length;l++)Bw(o[l])}}function gu(o,l){var d=o.stateNode;if(d===null)return null;var g=d[et]||null;if(g===null)return null;d=g[l];e:switch(l){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(g=!g.disabled)||(o=o.type,g=!(o==="button"||o==="input"||o==="select"||o==="textarea")),o=!g;break e;default:o=!1}if(o)return null;if(d&&typeof d!="function")throw Error(r(231,l,typeof d));return d}var Fo=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),sg=!1;if(Fo)try{var yu={};Object.defineProperty(yu,"passive",{get:function(){sg=!0}}),window.addEventListener("test",yu,yu),window.removeEventListener("test",yu,yu)}catch{sg=!1}var Ns=null,ag=null,rh=null;function Uw(){if(rh)return rh;var o,l=ag,d=l.length,g,v="value"in Ns?Ns.value:Ns.textContent,C=v.length;for(o=0;o<d&&l[o]===v[o];o++);var M=d-o;for(g=1;g<=M&&l[d-g]===v[C-g];g++);return rh=v.slice(o,1<g?1-g:void 0)}function ih(o){var l=o.keyCode;return"charCode"in o?(o=o.charCode,o===0&&l===13&&(o=13)):o=l,o===10&&(o=13),32<=o||o===13?o:0}function oh(){return!0}function Vw(){return!1}function Vr(o){function l(d,g,v,C,M){this._reactName=d,this._targetInst=v,this.type=g,this.nativeEvent=C,this.target=M,this.currentTarget=null;for(var F in o)o.hasOwnProperty(F)&&(d=o[F],this[F]=d?d(C):C[F]);return this.isDefaultPrevented=(C.defaultPrevented!=null?C.defaultPrevented:C.returnValue===!1)?oh:Vw,this.isPropagationStopped=Vw,this}return p(l.prototype,{preventDefault:function(){this.defaultPrevented=!0;var d=this.nativeEvent;d&&(d.preventDefault?d.preventDefault():typeof d.returnValue!="unknown"&&(d.returnValue=!1),this.isDefaultPrevented=oh)},stopPropagation:function(){var d=this.nativeEvent;d&&(d.stopPropagation?d.stopPropagation():typeof d.cancelBubble!="unknown"&&(d.cancelBubble=!0),this.isPropagationStopped=oh)},persist:function(){},isPersistent:oh}),l}var La={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(o){return o.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},sh=Vr(La),xu=p({},La,{view:0,detail:0}),UO=Vr(xu),lg,cg,bu,ah=p({},xu,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:dg,button:0,buttons:0,relatedTarget:function(o){return o.relatedTarget===void 0?o.fromElement===o.srcElement?o.toElement:o.fromElement:o.relatedTarget},movementX:function(o){return"movementX"in o?o.movementX:(o!==bu&&(bu&&o.type==="mousemove"?(lg=o.screenX-bu.screenX,cg=o.screenY-bu.screenY):cg=lg=0,bu=o),lg)},movementY:function(o){return"movementY"in o?o.movementY:cg}}),qw=Vr(ah),VO=p({},ah,{dataTransfer:0}),qO=Vr(VO),$O=p({},xu,{relatedTarget:0}),ug=Vr($O),YO=p({},La,{animationName:0,elapsedTime:0,pseudoElement:0}),WO=Vr(YO),GO=p({},La,{clipboardData:function(o){return"clipboardData"in o?o.clipboardData:window.clipboardData}}),KO=Vr(GO),QO=p({},La,{data:0}),$w=Vr(QO),XO={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},ZO={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"},JO={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function ej(o){var l=this.nativeEvent;return l.getModifierState?l.getModifierState(o):(o=JO[o])?!!l[o]:!1}function dg(){return ej}var tj=p({},xu,{key:function(o){if(o.key){var l=XO[o.key]||o.key;if(l!=="Unidentified")return l}return o.type==="keypress"?(o=ih(o),o===13?"Enter":String.fromCharCode(o)):o.type==="keydown"||o.type==="keyup"?ZO[o.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:dg,charCode:function(o){return o.type==="keypress"?ih(o):0},keyCode:function(o){return o.type==="keydown"||o.type==="keyup"?o.keyCode:0},which:function(o){return o.type==="keypress"?ih(o):o.type==="keydown"||o.type==="keyup"?o.keyCode:0}}),nj=Vr(tj),rj=p({},ah,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Yw=Vr(rj),ij=p({},xu,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:dg}),oj=Vr(ij),sj=p({},La,{propertyName:0,elapsedTime:0,pseudoElement:0}),aj=Vr(sj),lj=p({},ah,{deltaX:function(o){return"deltaX"in o?o.deltaX:"wheelDeltaX"in o?-o.wheelDeltaX:0},deltaY:function(o){return"deltaY"in o?o.deltaY:"wheelDeltaY"in o?-o.wheelDeltaY:"wheelDelta"in o?-o.wheelDelta:0},deltaZ:0,deltaMode:0}),cj=Vr(lj),uj=p({},La,{newState:0,oldState:0}),dj=Vr(uj),fj=[9,13,27,32],fg=Fo&&"CompositionEvent"in window,vu=null;Fo&&"documentMode"in document&&(vu=document.documentMode);var hj=Fo&&"TextEvent"in window&&!vu,Ww=Fo&&(!fg||vu&&8<vu&&11>=vu),Gw=" ",Kw=!1;function Qw(o,l){switch(o){case"keyup":return fj.indexOf(l.keyCode)!==-1;case"keydown":return l.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Xw(o){return o=o.detail,typeof o=="object"&&"data"in o?o.data:null}var Ll=!1;function pj(o,l){switch(o){case"compositionend":return Xw(l);case"keypress":return l.which!==32?null:(Kw=!0,Gw);case"textInput":return o=l.data,o===Gw&&Kw?null:o;default:return null}}function mj(o,l){if(Ll)return o==="compositionend"||!fg&&Qw(o,l)?(o=Uw(),rh=ag=Ns=null,Ll=!1,o):null;switch(o){case"paste":return null;case"keypress":if(!(l.ctrlKey||l.altKey||l.metaKey)||l.ctrlKey&&l.altKey){if(l.char&&1<l.char.length)return l.char;if(l.which)return String.fromCharCode(l.which)}return null;case"compositionend":return Ww&&l.locale!=="ko"?null:l.data;default:return null}}var gj={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 Zw(o){var l=o&&o.nodeName&&o.nodeName.toLowerCase();return l==="input"?!!gj[o.type]:l==="textarea"}function Jw(o,l,d,g){Dl?_l?_l.push(g):_l=[g]:Dl=g,l=Qh(l,"onChange"),0<l.length&&(d=new sh("onChange","change",null,d,g),o.push({event:d,listeners:l}))}var wu=null,Su=null;function yj(o){LC(o,0)}function lh(o){var l=dr(o);if(_w(l))return o}function e3(o,l){if(o==="change")return l}var t3=!1;if(Fo){var hg;if(Fo){var pg="oninput"in document;if(!pg){var n3=document.createElement("div");n3.setAttribute("oninput","return;"),pg=typeof n3.oninput=="function"}hg=pg}else hg=!1;t3=hg&&(!document.documentMode||9<document.documentMode)}function r3(){wu&&(wu.detachEvent("onpropertychange",i3),Su=wu=null)}function i3(o){if(o.propertyName==="value"&&lh(Su)){var l=[];Jw(l,Su,o,ig(o)),Hw(yj,l)}}function xj(o,l,d){o==="focusin"?(r3(),wu=l,Su=d,wu.attachEvent("onpropertychange",i3)):o==="focusout"&&r3()}function bj(o){if(o==="selectionchange"||o==="keyup"||o==="keydown")return lh(Su)}function vj(o,l){if(o==="click")return lh(l)}function wj(o,l){if(o==="input"||o==="change")return lh(l)}function Sj(o,l){return o===l&&(o!==0||1/o===1/l)||o!==o&&l!==l}var ii=typeof Object.is=="function"?Object.is:Sj;function Cu(o,l){if(ii(o,l))return!0;if(typeof o!="object"||o===null||typeof l!="object"||l===null)return!1;var d=Object.keys(o),g=Object.keys(l);if(d.length!==g.length)return!1;for(g=0;g<d.length;g++){var v=d[g];if(!pe.call(l,v)||!ii(o[v],l[v]))return!1}return!0}function o3(o){for(;o&&o.firstChild;)o=o.firstChild;return o}function s3(o,l){var d=o3(o);o=0;for(var g;d;){if(d.nodeType===3){if(g=o+d.textContent.length,o<=l&&g>=l)return{node:d,offset:l-o};o=g}e:{for(;d;){if(d.nextSibling){d=d.nextSibling;break e}d=d.parentNode}d=void 0}d=o3(d)}}function a3(o,l){return o&&l?o===l?!0:o&&o.nodeType===3?!1:l&&l.nodeType===3?a3(o,l.parentNode):"contains"in o?o.contains(l):o.compareDocumentPosition?!!(o.compareDocumentPosition(l)&16):!1:!1}function l3(o){o=o!=null&&o.ownerDocument!=null&&o.ownerDocument.defaultView!=null?o.ownerDocument.defaultView:window;for(var l=th(o.document);l instanceof o.HTMLIFrameElement;){try{var d=typeof l.contentWindow.location.href=="string"}catch{d=!1}if(d)o=l.contentWindow;else break;l=th(o.document)}return l}function mg(o){var l=o&&o.nodeName&&o.nodeName.toLowerCase();return l&&(l==="input"&&(o.type==="text"||o.type==="search"||o.type==="tel"||o.type==="url"||o.type==="password")||l==="textarea"||o.contentEditable==="true")}var Cj=Fo&&"documentMode"in document&&11>=document.documentMode,Il=null,gg=null,ku=null,yg=!1;function c3(o,l,d){var g=d.window===d?d.document:d.nodeType===9?d:d.ownerDocument;yg||Il==null||Il!==th(g)||(g=Il,"selectionStart"in g&&mg(g)?g={start:g.selectionStart,end:g.selectionEnd}:(g=(g.ownerDocument&&g.ownerDocument.defaultView||window).getSelection(),g={anchorNode:g.anchorNode,anchorOffset:g.anchorOffset,focusNode:g.focusNode,focusOffset:g.focusOffset}),ku&&Cu(ku,g)||(ku=g,g=Qh(gg,"onSelect"),0<g.length&&(l=new sh("onSelect","select",null,l,d),o.push({event:l,listeners:g}),l.target=Il)))}function Ia(o,l){var d={};return d[o.toLowerCase()]=l.toLowerCase(),d["Webkit"+o]="webkit"+l,d["Moz"+o]="moz"+l,d}var Pl={animationend:Ia("Animation","AnimationEnd"),animationiteration:Ia("Animation","AnimationIteration"),animationstart:Ia("Animation","AnimationStart"),transitionrun:Ia("Transition","TransitionRun"),transitionstart:Ia("Transition","TransitionStart"),transitioncancel:Ia("Transition","TransitionCancel"),transitionend:Ia("Transition","TransitionEnd")},xg={},u3={};Fo&&(u3=document.createElement("div").style,"AnimationEvent"in window||(delete Pl.animationend.animation,delete Pl.animationiteration.animation,delete Pl.animationstart.animation),"TransitionEvent"in window||delete Pl.transitionend.transition);function Pa(o){if(xg[o])return xg[o];if(!Pl[o])return o;var l=Pl[o],d;for(d in l)if(l.hasOwnProperty(d)&&d in u3)return xg[o]=l[d];return o}var d3=Pa("animationend"),f3=Pa("animationiteration"),h3=Pa("animationstart"),kj=Pa("transitionrun"),Ej=Pa("transitionstart"),Tj=Pa("transitioncancel"),p3=Pa("transitionend"),m3=new Map,bg="abort auxClick beforeToggle 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(" ");bg.push("scrollEnd");function Ji(o,l){m3.set(o,l),Xi(l,[o])}var ch=typeof reportError=="function"?reportError:function(o){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var l=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof o=="object"&&o!==null&&typeof o.message=="string"?String(o.message):String(o),error:o});if(!window.dispatchEvent(l))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",o);return}console.error(o)},Oi=[],zl=0,vg=0;function uh(){for(var o=zl,l=vg=zl=0;l<o;){var d=Oi[l];Oi[l++]=null;var g=Oi[l];Oi[l++]=null;var v=Oi[l];Oi[l++]=null;var C=Oi[l];if(Oi[l++]=null,g!==null&&v!==null){var M=g.pending;M===null?v.next=v:(v.next=M.next,M.next=v),g.pending=v}C!==0&&g3(d,v,C)}}function dh(o,l,d,g){Oi[zl++]=o,Oi[zl++]=l,Oi[zl++]=d,Oi[zl++]=g,vg|=g,o.lanes|=g,o=o.alternate,o!==null&&(o.lanes|=g)}function wg(o,l,d,g){return dh(o,l,d,g),fh(o)}function za(o,l){return dh(o,null,null,l),fh(o)}function g3(o,l,d){o.lanes|=d;var g=o.alternate;g!==null&&(g.lanes|=d);for(var v=!1,C=o.return;C!==null;)C.childLanes|=d,g=C.alternate,g!==null&&(g.childLanes|=d),C.tag===22&&(o=C.stateNode,o===null||o._visibility&1||(v=!0)),o=C,C=C.return;return o.tag===3?(C=o.stateNode,v&&l!==null&&(v=31-nt(d),o=C.hiddenUpdates,g=o[v],g===null?o[v]=[l]:g.push(l),l.lane=d|536870912),C):null}function fh(o){if(50<Yu)throw Yu=0,O1=null,Error(r(185));for(var l=o.return;l!==null;)o=l,l=o.return;return o.tag===3?o.stateNode:null}var Fl={};function Nj(o,l,d,g){this.tag=o,this.key=d,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=l,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=g,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function oi(o,l,d,g){return new Nj(o,l,d,g)}function Sg(o){return o=o.prototype,!(!o||!o.isReactComponent)}function Bo(o,l){var d=o.alternate;return d===null?(d=oi(o.tag,l,o.key,o.mode),d.elementType=o.elementType,d.type=o.type,d.stateNode=o.stateNode,d.alternate=o,o.alternate=d):(d.pendingProps=l,d.type=o.type,d.flags=0,d.subtreeFlags=0,d.deletions=null),d.flags=o.flags&65011712,d.childLanes=o.childLanes,d.lanes=o.lanes,d.child=o.child,d.memoizedProps=o.memoizedProps,d.memoizedState=o.memoizedState,d.updateQueue=o.updateQueue,l=o.dependencies,d.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext},d.sibling=o.sibling,d.index=o.index,d.ref=o.ref,d.refCleanup=o.refCleanup,d}function y3(o,l){o.flags&=65011714;var d=o.alternate;return d===null?(o.childLanes=0,o.lanes=l,o.child=null,o.subtreeFlags=0,o.memoizedProps=null,o.memoizedState=null,o.updateQueue=null,o.dependencies=null,o.stateNode=null):(o.childLanes=d.childLanes,o.lanes=d.lanes,o.child=d.child,o.subtreeFlags=0,o.deletions=null,o.memoizedProps=d.memoizedProps,o.memoizedState=d.memoizedState,o.updateQueue=d.updateQueue,o.type=d.type,l=d.dependencies,o.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext}),o}function hh(o,l,d,g,v,C){var M=0;if(g=o,typeof o=="function")Sg(o)&&(M=1);else if(typeof o=="string")M=MM(o,d,Z.current)?26:o==="html"||o==="head"||o==="body"?27:5;else e:switch(o){case B:return o=oi(31,d,l,v),o.elementType=B,o.lanes=C,o;case S:return Fa(d.children,v,C,l);case k:M=8,v|=24;break;case E:return o=oi(12,d,l,v|2),o.elementType=E,o.lanes=C,o;case O:return o=oi(13,d,l,v),o.elementType=O,o.lanes=C,o;case A:return o=oi(19,d,l,v),o.elementType=A,o.lanes=C,o;default:if(typeof o=="object"&&o!==null)switch(o.$$typeof){case N:M=10;break e;case T:M=9;break e;case j:M=11;break e;case R:M=14;break e;case L:M=16,g=null;break e}M=29,d=Error(r(130,o===null?"null":typeof o,"")),g=null}return l=oi(M,d,l,v),l.elementType=o,l.type=g,l.lanes=C,l}function Fa(o,l,d,g){return o=oi(7,o,g,l),o.lanes=d,o}function Cg(o,l,d){return o=oi(6,o,null,l),o.lanes=d,o}function x3(o){var l=oi(18,null,null,0);return l.stateNode=o,l}function kg(o,l,d){return l=oi(4,o.children!==null?o.children:[],o.key,l),l.lanes=d,l.stateNode={containerInfo:o.containerInfo,pendingChildren:null,implementation:o.implementation},l}var b3=new WeakMap;function ji(o,l){if(typeof o=="object"&&o!==null){var d=b3.get(o);return d!==void 0?d:(l={value:o,source:l,stack:Re(l)},b3.set(o,l),l)}return{value:o,source:l,stack:Re(l)}}var Bl=[],Hl=0,ph=null,Eu=0,Mi=[],Di=0,Rs=null,ho=1,po="";function Ho(o,l){Bl[Hl++]=Eu,Bl[Hl++]=ph,ph=o,Eu=l}function v3(o,l,d){Mi[Di++]=ho,Mi[Di++]=po,Mi[Di++]=Rs,Rs=o;var g=ho;o=po;var v=32-nt(g)-1;g&=~(1<<v),d+=1;var C=32-nt(l)+v;if(30<C){var M=v-v%5;C=(g&(1<<M)-1).toString(32),g>>=M,v-=M,ho=1<<32-nt(l)+v|d<<v|g,po=C+o}else ho=1<<C|d<<v|g,po=o}function Eg(o){o.return!==null&&(Ho(o,1),v3(o,1,0))}function Tg(o){for(;o===ph;)ph=Bl[--Hl],Bl[Hl]=null,Eu=Bl[--Hl],Bl[Hl]=null;for(;o===Rs;)Rs=Mi[--Di],Mi[Di]=null,po=Mi[--Di],Mi[Di]=null,ho=Mi[--Di],Mi[Di]=null}function w3(o,l){Mi[Di++]=ho,Mi[Di++]=po,Mi[Di++]=Rs,ho=l.id,po=l.overflow,Rs=o}var xr=null,En=null,Kt=!1,As=null,_i=!1,Ng=Error(r(519));function Os(o){var l=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Tu(ji(l,o)),Ng}function S3(o){var l=o.stateNode,d=o.type,g=o.memoizedProps;switch(l[Xe]=o,l[et]=g,d){case"dialog":Bt("cancel",l),Bt("close",l);break;case"iframe":case"object":case"embed":Bt("load",l);break;case"video":case"audio":for(d=0;d<Gu.length;d++)Bt(Gu[d],l);break;case"source":Bt("error",l);break;case"img":case"image":case"link":Bt("error",l),Bt("load",l);break;case"details":Bt("toggle",l);break;case"input":Bt("invalid",l),Lw(l,g.value,g.defaultValue,g.checked,g.defaultChecked,g.type,g.name,!0);break;case"select":Bt("invalid",l);break;case"textarea":Bt("invalid",l),Pw(l,g.value,g.defaultValue,g.children)}d=g.children,typeof d!="string"&&typeof d!="number"&&typeof d!="bigint"||l.textContent===""+d||g.suppressHydrationWarning===!0||FC(l.textContent,d)?(g.popover!=null&&(Bt("beforetoggle",l),Bt("toggle",l)),g.onScroll!=null&&Bt("scroll",l),g.onScrollEnd!=null&&Bt("scrollend",l),g.onClick!=null&&(l.onclick=zo),l=!0):l=!1,l||Os(o,!0)}function C3(o){for(xr=o.return;xr;)switch(xr.tag){case 5:case 31:case 13:_i=!1;return;case 27:case 3:_i=!0;return;default:xr=xr.return}}function Ul(o){if(o!==xr)return!1;if(!Kt)return C3(o),Kt=!0,!1;var l=o.tag,d;if((d=l!==3&&l!==27)&&((d=l===5)&&(d=o.type,d=!(d!=="form"&&d!=="button")||$1(o.type,o.memoizedProps)),d=!d),d&&En&&Os(o),C3(o),l===13){if(o=o.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(r(317));En=GC(o)}else if(l===31){if(o=o.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(r(317));En=GC(o)}else l===27?(l=En,qs(o.type)?(o=Q1,Q1=null,En=o):En=l):En=xr?Ii(o.stateNode.nextSibling):null;return!0}function Ba(){En=xr=null,Kt=!1}function Rg(){var o=As;return o!==null&&(Wr===null?Wr=o:Wr.push.apply(Wr,o),As=null),o}function Tu(o){As===null?As=[o]:As.push(o)}var Ag=P(null),Ha=null,Uo=null;function js(o,l,d){D(Ag,l._currentValue),l._currentValue=d}function Vo(o){o._currentValue=Ag.current,W(Ag)}function Og(o,l,d){for(;o!==null;){var g=o.alternate;if((o.childLanes&l)!==l?(o.childLanes|=l,g!==null&&(g.childLanes|=l)):g!==null&&(g.childLanes&l)!==l&&(g.childLanes|=l),o===d)break;o=o.return}}function jg(o,l,d,g){var v=o.child;for(v!==null&&(v.return=o);v!==null;){var C=v.dependencies;if(C!==null){var M=v.child;C=C.firstContext;e:for(;C!==null;){var F=C;C=v;for(var X=0;X<l.length;X++)if(F.context===l[X]){C.lanes|=d,F=C.alternate,F!==null&&(F.lanes|=d),Og(C.return,d,o),g||(M=null);break e}C=F.next}}else if(v.tag===18){if(M=v.return,M===null)throw Error(r(341));M.lanes|=d,C=M.alternate,C!==null&&(C.lanes|=d),Og(M,d,o),M=null}else M=v.child;if(M!==null)M.return=v;else for(M=v;M!==null;){if(M===o){M=null;break}if(v=M.sibling,v!==null){v.return=M.return,M=v;break}M=M.return}v=M}}function Vl(o,l,d,g){o=null;for(var v=l,C=!1;v!==null;){if(!C){if((v.flags&524288)!==0)C=!0;else if((v.flags&262144)!==0)break}if(v.tag===10){var M=v.alternate;if(M===null)throw Error(r(387));if(M=M.memoizedProps,M!==null){var F=v.type;ii(v.pendingProps.value,M.value)||(o!==null?o.push(F):o=[F])}}else if(v===he.current){if(M=v.alternate,M===null)throw Error(r(387));M.memoizedState.memoizedState!==v.memoizedState.memoizedState&&(o!==null?o.push(Ju):o=[Ju])}v=v.return}o!==null&&jg(l,o,d,g),l.flags|=262144}function mh(o){for(o=o.firstContext;o!==null;){if(!ii(o.context._currentValue,o.memoizedValue))return!0;o=o.next}return!1}function Ua(o){Ha=o,Uo=null,o=o.dependencies,o!==null&&(o.firstContext=null)}function br(o){return k3(Ha,o)}function gh(o,l){return Ha===null&&Ua(o),k3(o,l)}function k3(o,l){var d=l._currentValue;if(l={context:l,memoizedValue:d,next:null},Uo===null){if(o===null)throw Error(r(308));Uo=l,o.dependencies={lanes:0,firstContext:l},o.flags|=524288}else Uo=Uo.next=l;return d}var Rj=typeof AbortController<"u"?AbortController:function(){var o=[],l=this.signal={aborted:!1,addEventListener:function(d,g){o.push(g)}};this.abort=function(){l.aborted=!0,o.forEach(function(d){return d()})}},Aj=e.unstable_scheduleCallback,Oj=e.unstable_NormalPriority,Qn={$$typeof:N,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Mg(){return{controller:new Rj,data:new Map,refCount:0}}function Nu(o){o.refCount--,o.refCount===0&&Aj(Oj,function(){o.controller.abort()})}var Ru=null,Dg=0,ql=0,$l=null;function jj(o,l){if(Ru===null){var d=Ru=[];Dg=0,ql=I1(),$l={status:"pending",value:void 0,then:function(g){d.push(g)}}}return Dg++,l.then(E3,E3),l}function E3(){if(--Dg===0&&Ru!==null){$l!==null&&($l.status="fulfilled");var o=Ru;Ru=null,ql=0,$l=null;for(var l=0;l<o.length;l++)(0,o[l])()}}function Mj(o,l){var d=[],g={status:"pending",value:null,reason:null,then:function(v){d.push(v)}};return o.then(function(){g.status="fulfilled",g.value=l;for(var v=0;v<d.length;v++)(0,d[v])(l)},function(v){for(g.status="rejected",g.reason=v,v=0;v<d.length;v++)(0,d[v])(void 0)}),g}var T3=z.S;z.S=function(o,l){cC=Ve(),typeof l=="object"&&l!==null&&typeof l.then=="function"&&jj(o,l),T3!==null&&T3(o,l)};var Va=P(null);function _g(){var o=Va.current;return o!==null?o:wn.pooledCache}function yh(o,l){l===null?D(Va,Va.current):D(Va,l.pool)}function N3(){var o=_g();return o===null?null:{parent:Qn._currentValue,pool:o}}var Yl=Error(r(460)),Lg=Error(r(474)),xh=Error(r(542)),bh={then:function(){}};function R3(o){return o=o.status,o==="fulfilled"||o==="rejected"}function A3(o,l,d){switch(d=o[d],d===void 0?o.push(l):d!==l&&(l.then(zo,zo),l=d),l.status){case"fulfilled":return l.value;case"rejected":throw o=l.reason,j3(o),o;default:if(typeof l.status=="string")l.then(zo,zo);else{if(o=wn,o!==null&&100<o.shellSuspendCounter)throw Error(r(482));o=l,o.status="pending",o.then(function(g){if(l.status==="pending"){var v=l;v.status="fulfilled",v.value=g}},function(g){if(l.status==="pending"){var v=l;v.status="rejected",v.reason=g}})}switch(l.status){case"fulfilled":return l.value;case"rejected":throw o=l.reason,j3(o),o}throw $a=l,Yl}}function qa(o){try{var l=o._init;return l(o._payload)}catch(d){throw d!==null&&typeof d=="object"&&typeof d.then=="function"?($a=d,Yl):d}}var $a=null;function O3(){if($a===null)throw Error(r(459));var o=$a;return $a=null,o}function j3(o){if(o===Yl||o===xh)throw Error(r(483))}var Wl=null,Au=0;function vh(o){var l=Au;return Au+=1,Wl===null&&(Wl=[]),A3(Wl,o,l)}function Ou(o,l){l=l.props.ref,o.ref=l!==void 0?l:null}function wh(o,l){throw l.$$typeof===y?Error(r(525)):(o=Object.prototype.toString.call(l),Error(r(31,o==="[object Object]"?"object with keys {"+Object.keys(l).join(", ")+"}":o)))}function M3(o){function l(ie,re){if(o){var ce=ie.deletions;ce===null?(ie.deletions=[re],ie.flags|=16):ce.push(re)}}function d(ie,re){if(!o)return null;for(;re!==null;)l(ie,re),re=re.sibling;return null}function g(ie){for(var re=new Map;ie!==null;)ie.key!==null?re.set(ie.key,ie):re.set(ie.index,ie),ie=ie.sibling;return re}function v(ie,re){return ie=Bo(ie,re),ie.index=0,ie.sibling=null,ie}function C(ie,re,ce){return ie.index=ce,o?(ce=ie.alternate,ce!==null?(ce=ce.index,ce<re?(ie.flags|=67108866,re):ce):(ie.flags|=67108866,re)):(ie.flags|=1048576,re)}function M(ie){return o&&ie.alternate===null&&(ie.flags|=67108866),ie}function F(ie,re,ce,Ee){return re===null||re.tag!==6?(re=Cg(ce,ie.mode,Ee),re.return=ie,re):(re=v(re,ce),re.return=ie,re)}function X(ie,re,ce,Ee){var gt=ce.type;return gt===S?ve(ie,re,ce.props.children,Ee,ce.key):re!==null&&(re.elementType===gt||typeof gt=="object"&&gt!==null&&gt.$$typeof===L&&qa(gt)===re.type)?(re=v(re,ce.props),Ou(re,ce),re.return=ie,re):(re=hh(ce.type,ce.key,ce.props,null,ie.mode,Ee),Ou(re,ce),re.return=ie,re)}function ue(ie,re,ce,Ee){return re===null||re.tag!==4||re.stateNode.containerInfo!==ce.containerInfo||re.stateNode.implementation!==ce.implementation?(re=kg(ce,ie.mode,Ee),re.return=ie,re):(re=v(re,ce.children||[]),re.return=ie,re)}function ve(ie,re,ce,Ee,gt){return re===null||re.tag!==7?(re=Fa(ce,ie.mode,Ee,gt),re.return=ie,re):(re=v(re,ce),re.return=ie,re)}function Ne(ie,re,ce){if(typeof re=="string"&&re!==""||typeof re=="number"||typeof re=="bigint")return re=Cg(""+re,ie.mode,ce),re.return=ie,re;if(typeof re=="object"&&re!==null){switch(re.$$typeof){case x:return ce=hh(re.type,re.key,re.props,null,ie.mode,ce),Ou(ce,re),ce.return=ie,ce;case b:return re=kg(re,ie.mode,ce),re.return=ie,re;case L:return re=qa(re),Ne(ie,re,ce)}if(H(re)||Y(re))return re=Fa(re,ie.mode,ce,null),re.return=ie,re;if(typeof re.then=="function")return Ne(ie,vh(re),ce);if(re.$$typeof===N)return Ne(ie,gh(ie,re),ce);wh(ie,re)}return null}function de(ie,re,ce,Ee){var gt=re!==null?re.key:null;if(typeof ce=="string"&&ce!==""||typeof ce=="number"||typeof ce=="bigint")return gt!==null?null:F(ie,re,""+ce,Ee);if(typeof ce=="object"&&ce!==null){switch(ce.$$typeof){case x:return ce.key===gt?X(ie,re,ce,Ee):null;case b:return ce.key===gt?ue(ie,re,ce,Ee):null;case L:return ce=qa(ce),de(ie,re,ce,Ee)}if(H(ce)||Y(ce))return gt!==null?null:ve(ie,re,ce,Ee,null);if(typeof ce.then=="function")return de(ie,re,vh(ce),Ee);if(ce.$$typeof===N)return de(ie,re,gh(ie,ce),Ee);wh(ie,ce)}return null}function me(ie,re,ce,Ee,gt){if(typeof Ee=="string"&&Ee!==""||typeof Ee=="number"||typeof Ee=="bigint")return ie=ie.get(ce)||null,F(re,ie,""+Ee,gt);if(typeof Ee=="object"&&Ee!==null){switch(Ee.$$typeof){case x:return ie=ie.get(Ee.key===null?ce:Ee.key)||null,X(re,ie,Ee,gt);case b:return ie=ie.get(Ee.key===null?ce:Ee.key)||null,ue(re,ie,Ee,gt);case L:return Ee=qa(Ee),me(ie,re,ce,Ee,gt)}if(H(Ee)||Y(Ee))return ie=ie.get(ce)||null,ve(re,ie,Ee,gt,null);if(typeof Ee.then=="function")return me(ie,re,ce,vh(Ee),gt);if(Ee.$$typeof===N)return me(ie,re,ce,gh(re,Ee),gt);wh(re,Ee)}return null}function rt(ie,re,ce,Ee){for(var gt=null,nn=null,at=re,Mt=re=0,qt=null;at!==null&&Mt<ce.length;Mt++){at.index>Mt?(qt=at,at=null):qt=at.sibling;var rn=de(ie,at,ce[Mt],Ee);if(rn===null){at===null&&(at=qt);break}o&&at&&rn.alternate===null&&l(ie,at),re=C(rn,re,Mt),nn===null?gt=rn:nn.sibling=rn,nn=rn,at=qt}if(Mt===ce.length)return d(ie,at),Kt&&Ho(ie,Mt),gt;if(at===null){for(;Mt<ce.length;Mt++)at=Ne(ie,ce[Mt],Ee),at!==null&&(re=C(at,re,Mt),nn===null?gt=at:nn.sibling=at,nn=at);return Kt&&Ho(ie,Mt),gt}for(at=g(at);Mt<ce.length;Mt++)qt=me(at,ie,Mt,ce[Mt],Ee),qt!==null&&(o&&qt.alternate!==null&&at.delete(qt.key===null?Mt:qt.key),re=C(qt,re,Mt),nn===null?gt=qt:nn.sibling=qt,nn=qt);return o&&at.forEach(function(Ks){return l(ie,Ks)}),Kt&&Ho(ie,Mt),gt}function wt(ie,re,ce,Ee){if(ce==null)throw Error(r(151));for(var gt=null,nn=null,at=re,Mt=re=0,qt=null,rn=ce.next();at!==null&&!rn.done;Mt++,rn=ce.next()){at.index>Mt?(qt=at,at=null):qt=at.sibling;var Ks=de(ie,at,rn.value,Ee);if(Ks===null){at===null&&(at=qt);break}o&&at&&Ks.alternate===null&&l(ie,at),re=C(Ks,re,Mt),nn===null?gt=Ks:nn.sibling=Ks,nn=Ks,at=qt}if(rn.done)return d(ie,at),Kt&&Ho(ie,Mt),gt;if(at===null){for(;!rn.done;Mt++,rn=ce.next())rn=Ne(ie,rn.value,Ee),rn!==null&&(re=C(rn,re,Mt),nn===null?gt=rn:nn.sibling=rn,nn=rn);return Kt&&Ho(ie,Mt),gt}for(at=g(at);!rn.done;Mt++,rn=ce.next())rn=me(at,ie,Mt,rn.value,Ee),rn!==null&&(o&&rn.alternate!==null&&at.delete(rn.key===null?Mt:rn.key),re=C(rn,re,Mt),nn===null?gt=rn:nn.sibling=rn,nn=rn);return o&&at.forEach(function(VM){return l(ie,VM)}),Kt&&Ho(ie,Mt),gt}function xn(ie,re,ce,Ee){if(typeof ce=="object"&&ce!==null&&ce.type===S&&ce.key===null&&(ce=ce.props.children),typeof ce=="object"&&ce!==null){switch(ce.$$typeof){case x:e:{for(var gt=ce.key;re!==null;){if(re.key===gt){if(gt=ce.type,gt===S){if(re.tag===7){d(ie,re.sibling),Ee=v(re,ce.props.children),Ee.return=ie,ie=Ee;break e}}else if(re.elementType===gt||typeof gt=="object"&&gt!==null&&gt.$$typeof===L&&qa(gt)===re.type){d(ie,re.sibling),Ee=v(re,ce.props),Ou(Ee,ce),Ee.return=ie,ie=Ee;break e}d(ie,re);break}else l(ie,re);re=re.sibling}ce.type===S?(Ee=Fa(ce.props.children,ie.mode,Ee,ce.key),Ee.return=ie,ie=Ee):(Ee=hh(ce.type,ce.key,ce.props,null,ie.mode,Ee),Ou(Ee,ce),Ee.return=ie,ie=Ee)}return M(ie);case b:e:{for(gt=ce.key;re!==null;){if(re.key===gt)if(re.tag===4&&re.stateNode.containerInfo===ce.containerInfo&&re.stateNode.implementation===ce.implementation){d(ie,re.sibling),Ee=v(re,ce.children||[]),Ee.return=ie,ie=Ee;break e}else{d(ie,re);break}else l(ie,re);re=re.sibling}Ee=kg(ce,ie.mode,Ee),Ee.return=ie,ie=Ee}return M(ie);case L:return ce=qa(ce),xn(ie,re,ce,Ee)}if(H(ce))return rt(ie,re,ce,Ee);if(Y(ce)){if(gt=Y(ce),typeof gt!="function")throw Error(r(150));return ce=gt.call(ce),wt(ie,re,ce,Ee)}if(typeof ce.then=="function")return xn(ie,re,vh(ce),Ee);if(ce.$$typeof===N)return xn(ie,re,gh(ie,ce),Ee);wh(ie,ce)}return typeof ce=="string"&&ce!==""||typeof ce=="number"||typeof ce=="bigint"?(ce=""+ce,re!==null&&re.tag===6?(d(ie,re.sibling),Ee=v(re,ce),Ee.return=ie,ie=Ee):(d(ie,re),Ee=Cg(ce,ie.mode,Ee),Ee.return=ie,ie=Ee),M(ie)):d(ie,re)}return function(ie,re,ce,Ee){try{Au=0;var gt=xn(ie,re,ce,Ee);return Wl=null,gt}catch(at){if(at===Yl||at===xh)throw at;var nn=oi(29,at,null,ie.mode);return nn.lanes=Ee,nn.return=ie,nn}}}var Ya=M3(!0),D3=M3(!1),Ms=!1;function Ig(o){o.updateQueue={baseState:o.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Pg(o,l){o=o.updateQueue,l.updateQueue===o&&(l.updateQueue={baseState:o.baseState,firstBaseUpdate:o.firstBaseUpdate,lastBaseUpdate:o.lastBaseUpdate,shared:o.shared,callbacks:null})}function Ds(o){return{lane:o,tag:0,payload:null,callback:null,next:null}}function _s(o,l,d){var g=o.updateQueue;if(g===null)return null;if(g=g.shared,(sn&2)!==0){var v=g.pending;return v===null?l.next=l:(l.next=v.next,v.next=l),g.pending=l,l=fh(o),g3(o,null,d),l}return dh(o,g,l,d),fh(o)}function ju(o,l,d){if(l=l.updateQueue,l!==null&&(l=l.shared,(d&4194048)!==0)){var g=l.lanes;g&=o.pendingLanes,d|=g,l.lanes=d,K(o,d)}}function zg(o,l){var d=o.updateQueue,g=o.alternate;if(g!==null&&(g=g.updateQueue,d===g)){var v=null,C=null;if(d=d.firstBaseUpdate,d!==null){do{var M={lane:d.lane,tag:d.tag,payload:d.payload,callback:null,next:null};C===null?v=C=M:C=C.next=M,d=d.next}while(d!==null);C===null?v=C=l:C=C.next=l}else v=C=l;d={baseState:g.baseState,firstBaseUpdate:v,lastBaseUpdate:C,shared:g.shared,callbacks:g.callbacks},o.updateQueue=d;return}o=d.lastBaseUpdate,o===null?d.firstBaseUpdate=l:o.next=l,d.lastBaseUpdate=l}var Fg=!1;function Mu(){if(Fg){var o=$l;if(o!==null)throw o}}function Du(o,l,d,g){Fg=!1;var v=o.updateQueue;Ms=!1;var C=v.firstBaseUpdate,M=v.lastBaseUpdate,F=v.shared.pending;if(F!==null){v.shared.pending=null;var X=F,ue=X.next;X.next=null,M===null?C=ue:M.next=ue,M=X;var ve=o.alternate;ve!==null&&(ve=ve.updateQueue,F=ve.lastBaseUpdate,F!==M&&(F===null?ve.firstBaseUpdate=ue:F.next=ue,ve.lastBaseUpdate=X))}if(C!==null){var Ne=v.baseState;M=0,ve=ue=X=null,F=C;do{var de=F.lane&-536870913,me=de!==F.lane;if(me?(Vt&de)===de:(g&de)===de){de!==0&&de===ql&&(Fg=!0),ve!==null&&(ve=ve.next={lane:0,tag:F.tag,payload:F.payload,callback:null,next:null});e:{var rt=o,wt=F;de=l;var xn=d;switch(wt.tag){case 1:if(rt=wt.payload,typeof rt=="function"){Ne=rt.call(xn,Ne,de);break e}Ne=rt;break e;case 3:rt.flags=rt.flags&-65537|128;case 0:if(rt=wt.payload,de=typeof rt=="function"?rt.call(xn,Ne,de):rt,de==null)break e;Ne=p({},Ne,de);break e;case 2:Ms=!0}}de=F.callback,de!==null&&(o.flags|=64,me&&(o.flags|=8192),me=v.callbacks,me===null?v.callbacks=[de]:me.push(de))}else me={lane:de,tag:F.tag,payload:F.payload,callback:F.callback,next:null},ve===null?(ue=ve=me,X=Ne):ve=ve.next=me,M|=de;if(F=F.next,F===null){if(F=v.shared.pending,F===null)break;me=F,F=me.next,me.next=null,v.lastBaseUpdate=me,v.shared.pending=null}}while(!0);ve===null&&(X=Ne),v.baseState=X,v.firstBaseUpdate=ue,v.lastBaseUpdate=ve,C===null&&(v.shared.lanes=0),Fs|=M,o.lanes=M,o.memoizedState=Ne}}function _3(o,l){if(typeof o!="function")throw Error(r(191,o));o.call(l)}function L3(o,l){var d=o.callbacks;if(d!==null)for(o.callbacks=null,o=0;o<d.length;o++)_3(d[o],l)}var Gl=P(null),Sh=P(0);function I3(o,l){o=Zo,D(Sh,o),D(Gl,l),Zo=o|l.baseLanes}function Bg(){D(Sh,Zo),D(Gl,Gl.current)}function Hg(){Zo=Sh.current,W(Gl),W(Sh)}var si=P(null),Li=null;function Ls(o){var l=o.alternate;D(Yn,Yn.current&1),D(si,o),Li===null&&(l===null||Gl.current!==null||l.memoizedState!==null)&&(Li=o)}function Ug(o){D(Yn,Yn.current),D(si,o),Li===null&&(Li=o)}function P3(o){o.tag===22?(D(Yn,Yn.current),D(si,o),Li===null&&(Li=o)):Is()}function Is(){D(Yn,Yn.current),D(si,si.current)}function ai(o){W(si),Li===o&&(Li=null),W(Yn)}var Yn=P(0);function Ch(o){for(var l=o;l!==null;){if(l.tag===13){var d=l.memoizedState;if(d!==null&&(d=d.dehydrated,d===null||G1(d)||K1(d)))return l}else if(l.tag===19&&(l.memoizedProps.revealOrder==="forwards"||l.memoizedProps.revealOrder==="backwards"||l.memoizedProps.revealOrder==="unstable_legacy-backwards"||l.memoizedProps.revealOrder==="together")){if((l.flags&128)!==0)return l}else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===o)break;for(;l.sibling===null;){if(l.return===null||l.return===o)return null;l=l.return}l.sibling.return=l.return,l=l.sibling}return null}var qo=0,Ot=null,gn=null,Xn=null,kh=!1,Kl=!1,Wa=!1,Eh=0,_u=0,Ql=null,Dj=0;function In(){throw Error(r(321))}function Vg(o,l){if(l===null)return!1;for(var d=0;d<l.length&&d<o.length;d++)if(!ii(o[d],l[d]))return!1;return!0}function qg(o,l,d,g,v,C){return qo=C,Ot=l,l.memoizedState=null,l.updateQueue=null,l.lanes=0,z.H=o===null||o.memoizedState===null?vS:o1,Wa=!1,C=d(g,v),Wa=!1,Kl&&(C=F3(l,d,g,v)),z3(o),C}function z3(o){z.H=Pu;var l=gn!==null&&gn.next!==null;if(qo=0,Xn=gn=Ot=null,kh=!1,_u=0,Ql=null,l)throw Error(r(300));o===null||Zn||(o=o.dependencies,o!==null&&mh(o)&&(Zn=!0))}function F3(o,l,d,g){Ot=o;var v=0;do{if(Kl&&(Ql=null),_u=0,Kl=!1,25<=v)throw Error(r(301));if(v+=1,Xn=gn=null,o.updateQueue!=null){var C=o.updateQueue;C.lastEffect=null,C.events=null,C.stores=null,C.memoCache!=null&&(C.memoCache.index=0)}z.H=wS,C=l(d,g)}while(Kl);return C}function _j(){var o=z.H,l=o.useState()[0];return l=typeof l.then=="function"?Lu(l):l,o=o.useState()[0],(gn!==null?gn.memoizedState:null)!==o&&(Ot.flags|=1024),l}function $g(){var o=Eh!==0;return Eh=0,o}function Yg(o,l,d){l.updateQueue=o.updateQueue,l.flags&=-2053,o.lanes&=~d}function Wg(o){if(kh){for(o=o.memoizedState;o!==null;){var l=o.queue;l!==null&&(l.pending=null),o=o.next}kh=!1}qo=0,Xn=gn=Ot=null,Kl=!1,_u=Eh=0,Ql=null}function _r(){var o={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Xn===null?Ot.memoizedState=Xn=o:Xn=Xn.next=o,Xn}function Wn(){if(gn===null){var o=Ot.alternate;o=o!==null?o.memoizedState:null}else o=gn.next;var l=Xn===null?Ot.memoizedState:Xn.next;if(l!==null)Xn=l,gn=o;else{if(o===null)throw Ot.alternate===null?Error(r(467)):Error(r(310));gn=o,o={memoizedState:gn.memoizedState,baseState:gn.baseState,baseQueue:gn.baseQueue,queue:gn.queue,next:null},Xn===null?Ot.memoizedState=Xn=o:Xn=Xn.next=o}return Xn}function Th(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Lu(o){var l=_u;return _u+=1,Ql===null&&(Ql=[]),o=A3(Ql,o,l),l=Ot,(Xn===null?l.memoizedState:Xn.next)===null&&(l=l.alternate,z.H=l===null||l.memoizedState===null?vS:o1),o}function Nh(o){if(o!==null&&typeof o=="object"){if(typeof o.then=="function")return Lu(o);if(o.$$typeof===N)return br(o)}throw Error(r(438,String(o)))}function Gg(o){var l=null,d=Ot.updateQueue;if(d!==null&&(l=d.memoCache),l==null){var g=Ot.alternate;g!==null&&(g=g.updateQueue,g!==null&&(g=g.memoCache,g!=null&&(l={data:g.data.map(function(v){return v.slice()}),index:0})))}if(l==null&&(l={data:[],index:0}),d===null&&(d=Th(),Ot.updateQueue=d),d.memoCache=l,d=l.data[l.index],d===void 0)for(d=l.data[l.index]=Array(o),g=0;g<o;g++)d[g]=I;return l.index++,d}function $o(o,l){return typeof l=="function"?l(o):l}function Rh(o){var l=Wn();return Kg(l,gn,o)}function Kg(o,l,d){var g=o.queue;if(g===null)throw Error(r(311));g.lastRenderedReducer=d;var v=o.baseQueue,C=g.pending;if(C!==null){if(v!==null){var M=v.next;v.next=C.next,C.next=M}l.baseQueue=v=C,g.pending=null}if(C=o.baseState,v===null)o.memoizedState=C;else{l=v.next;var F=M=null,X=null,ue=l,ve=!1;do{var Ne=ue.lane&-536870913;if(Ne!==ue.lane?(Vt&Ne)===Ne:(qo&Ne)===Ne){var de=ue.revertLane;if(de===0)X!==null&&(X=X.next={lane:0,revertLane:0,gesture:null,action:ue.action,hasEagerState:ue.hasEagerState,eagerState:ue.eagerState,next:null}),Ne===ql&&(ve=!0);else if((qo&de)===de){ue=ue.next,de===ql&&(ve=!0);continue}else Ne={lane:0,revertLane:ue.revertLane,gesture:null,action:ue.action,hasEagerState:ue.hasEagerState,eagerState:ue.eagerState,next:null},X===null?(F=X=Ne,M=C):X=X.next=Ne,Ot.lanes|=de,Fs|=de;Ne=ue.action,Wa&&d(C,Ne),C=ue.hasEagerState?ue.eagerState:d(C,Ne)}else de={lane:Ne,revertLane:ue.revertLane,gesture:ue.gesture,action:ue.action,hasEagerState:ue.hasEagerState,eagerState:ue.eagerState,next:null},X===null?(F=X=de,M=C):X=X.next=de,Ot.lanes|=Ne,Fs|=Ne;ue=ue.next}while(ue!==null&&ue!==l);if(X===null?M=C:X.next=F,!ii(C,o.memoizedState)&&(Zn=!0,ve&&(d=$l,d!==null)))throw d;o.memoizedState=C,o.baseState=M,o.baseQueue=X,g.lastRenderedState=C}return v===null&&(g.lanes=0),[o.memoizedState,g.dispatch]}function Qg(o){var l=Wn(),d=l.queue;if(d===null)throw Error(r(311));d.lastRenderedReducer=o;var g=d.dispatch,v=d.pending,C=l.memoizedState;if(v!==null){d.pending=null;var M=v=v.next;do C=o(C,M.action),M=M.next;while(M!==v);ii(C,l.memoizedState)||(Zn=!0),l.memoizedState=C,l.baseQueue===null&&(l.baseState=C),d.lastRenderedState=C}return[C,g]}function B3(o,l,d){var g=Ot,v=Wn(),C=Kt;if(C){if(d===void 0)throw Error(r(407));d=d()}else d=l();var M=!ii((gn||v).memoizedState,d);if(M&&(v.memoizedState=d,Zn=!0),v=v.queue,Jg(V3.bind(null,g,v,o),[o]),v.getSnapshot!==l||M||Xn!==null&&Xn.memoizedState.tag&1){if(g.flags|=2048,Xl(9,{destroy:void 0},U3.bind(null,g,v,d,l),null),wn===null)throw Error(r(349));C||(qo&127)!==0||H3(g,l,d)}return d}function H3(o,l,d){o.flags|=16384,o={getSnapshot:l,value:d},l=Ot.updateQueue,l===null?(l=Th(),Ot.updateQueue=l,l.stores=[o]):(d=l.stores,d===null?l.stores=[o]:d.push(o))}function U3(o,l,d,g){l.value=d,l.getSnapshot=g,q3(l)&&$3(o)}function V3(o,l,d){return d(function(){q3(l)&&$3(o)})}function q3(o){var l=o.getSnapshot;o=o.value;try{var d=l();return!ii(o,d)}catch{return!0}}function $3(o){var l=za(o,2);l!==null&&Gr(l,o,2)}function Xg(o){var l=_r();if(typeof o=="function"){var d=o;if(o=d(),Wa){bt(!0);try{d()}finally{bt(!1)}}}return l.memoizedState=l.baseState=o,l.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:$o,lastRenderedState:o},l}function Y3(o,l,d,g){return o.baseState=d,Kg(o,gn,typeof g=="function"?g:$o)}function Lj(o,l,d,g,v){if(jh(o))throw Error(r(485));if(o=l.action,o!==null){var C={payload:v,action:o,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(M){C.listeners.push(M)}};z.T!==null?d(!0):C.isTransition=!1,g(C),d=l.pending,d===null?(C.next=l.pending=C,W3(l,C)):(C.next=d.next,l.pending=d.next=C)}}function W3(o,l){var d=l.action,g=l.payload,v=o.state;if(l.isTransition){var C=z.T,M={};z.T=M;try{var F=d(v,g),X=z.S;X!==null&&X(M,F),G3(o,l,F)}catch(ue){Zg(o,l,ue)}finally{C!==null&&M.types!==null&&(C.types=M.types),z.T=C}}else try{C=d(v,g),G3(o,l,C)}catch(ue){Zg(o,l,ue)}}function G3(o,l,d){d!==null&&typeof d=="object"&&typeof d.then=="function"?d.then(function(g){K3(o,l,g)},function(g){return Zg(o,l,g)}):K3(o,l,d)}function K3(o,l,d){l.status="fulfilled",l.value=d,Q3(l),o.state=d,l=o.pending,l!==null&&(d=l.next,d===l?o.pending=null:(d=d.next,l.next=d,W3(o,d)))}function Zg(o,l,d){var g=o.pending;if(o.pending=null,g!==null){g=g.next;do l.status="rejected",l.reason=d,Q3(l),l=l.next;while(l!==g)}o.action=null}function Q3(o){o=o.listeners;for(var l=0;l<o.length;l++)(0,o[l])()}function X3(o,l){return l}function Z3(o,l){if(Kt){var d=wn.formState;if(d!==null){e:{var g=Ot;if(Kt){if(En){t:{for(var v=En,C=_i;v.nodeType!==8;){if(!C){v=null;break t}if(v=Ii(v.nextSibling),v===null){v=null;break t}}C=v.data,v=C==="F!"||C==="F"?v:null}if(v){En=Ii(v.nextSibling),g=v.data==="F!";break e}}Os(g)}g=!1}g&&(l=d[0])}}return d=_r(),d.memoizedState=d.baseState=l,g={pending:null,lanes:0,dispatch:null,lastRenderedReducer:X3,lastRenderedState:l},d.queue=g,d=yS.bind(null,Ot,g),g.dispatch=d,g=Xg(!1),C=i1.bind(null,Ot,!1,g.queue),g=_r(),v={state:l,dispatch:null,action:o,pending:null},g.queue=v,d=Lj.bind(null,Ot,v,C,d),v.dispatch=d,g.memoizedState=o,[l,d,!1]}function J3(o){var l=Wn();return eS(l,gn,o)}function eS(o,l,d){if(l=Kg(o,l,X3)[0],o=Rh($o)[0],typeof l=="object"&&l!==null&&typeof l.then=="function")try{var g=Lu(l)}catch(M){throw M===Yl?xh:M}else g=l;l=Wn();var v=l.queue,C=v.dispatch;return d!==l.memoizedState&&(Ot.flags|=2048,Xl(9,{destroy:void 0},Ij.bind(null,v,d),null)),[g,C,o]}function Ij(o,l){o.action=l}function tS(o){var l=Wn(),d=gn;if(d!==null)return eS(l,d,o);Wn(),l=l.memoizedState,d=Wn();var g=d.queue.dispatch;return d.memoizedState=o,[l,g,!1]}function Xl(o,l,d,g){return o={tag:o,create:d,deps:g,inst:l,next:null},l=Ot.updateQueue,l===null&&(l=Th(),Ot.updateQueue=l),d=l.lastEffect,d===null?l.lastEffect=o.next=o:(g=d.next,d.next=o,o.next=g,l.lastEffect=o),o}function nS(){return Wn().memoizedState}function Ah(o,l,d,g){var v=_r();Ot.flags|=o,v.memoizedState=Xl(1|l,{destroy:void 0},d,g===void 0?null:g)}function Oh(o,l,d,g){var v=Wn();g=g===void 0?null:g;var C=v.memoizedState.inst;gn!==null&&g!==null&&Vg(g,gn.memoizedState.deps)?v.memoizedState=Xl(l,C,d,g):(Ot.flags|=o,v.memoizedState=Xl(1|l,C,d,g))}function rS(o,l){Ah(8390656,8,o,l)}function Jg(o,l){Oh(2048,8,o,l)}function Pj(o){Ot.flags|=4;var l=Ot.updateQueue;if(l===null)l=Th(),Ot.updateQueue=l,l.events=[o];else{var d=l.events;d===null?l.events=[o]:d.push(o)}}function iS(o){var l=Wn().memoizedState;return Pj({ref:l,nextImpl:o}),function(){if((sn&2)!==0)throw Error(r(440));return l.impl.apply(void 0,arguments)}}function oS(o,l){return Oh(4,2,o,l)}function sS(o,l){return Oh(4,4,o,l)}function aS(o,l){if(typeof l=="function"){o=o();var d=l(o);return function(){typeof d=="function"?d():l(null)}}if(l!=null)return o=o(),l.current=o,function(){l.current=null}}function lS(o,l,d){d=d!=null?d.concat([o]):null,Oh(4,4,aS.bind(null,l,o),d)}function e1(){}function cS(o,l){var d=Wn();l=l===void 0?null:l;var g=d.memoizedState;return l!==null&&Vg(l,g[1])?g[0]:(d.memoizedState=[o,l],o)}function uS(o,l){var d=Wn();l=l===void 0?null:l;var g=d.memoizedState;if(l!==null&&Vg(l,g[1]))return g[0];if(g=o(),Wa){bt(!0);try{o()}finally{bt(!1)}}return d.memoizedState=[g,l],g}function t1(o,l,d){return d===void 0||(qo&1073741824)!==0&&(Vt&261930)===0?o.memoizedState=l:(o.memoizedState=d,o=dC(),Ot.lanes|=o,Fs|=o,d)}function dS(o,l,d,g){return ii(d,l)?d:Gl.current!==null?(o=t1(o,d,g),ii(o,l)||(Zn=!0),o):(qo&42)===0||(qo&1073741824)!==0&&(Vt&261930)===0?(Zn=!0,o.memoizedState=d):(o=dC(),Ot.lanes|=o,Fs|=o,l)}function fS(o,l,d,g,v){var C=$.p;$.p=C!==0&&8>C?C:8;var M=z.T,F={};z.T=F,i1(o,!1,l,d);try{var X=v(),ue=z.S;if(ue!==null&&ue(F,X),X!==null&&typeof X=="object"&&typeof X.then=="function"){var ve=Mj(X,g);Iu(o,l,ve,ui(o))}else Iu(o,l,g,ui(o))}catch(Ne){Iu(o,l,{then:function(){},status:"rejected",reason:Ne},ui())}finally{$.p=C,M!==null&&F.types!==null&&(M.types=F.types),z.T=M}}function zj(){}function n1(o,l,d,g){if(o.tag!==5)throw Error(r(476));var v=hS(o).queue;fS(o,v,l,G,d===null?zj:function(){return pS(o),d(g)})}function hS(o){var l=o.memoizedState;if(l!==null)return l;l={memoizedState:G,baseState:G,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:$o,lastRenderedState:G},next:null};var d={};return l.next={memoizedState:d,baseState:d,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:$o,lastRenderedState:d},next:null},o.memoizedState=l,o=o.alternate,o!==null&&(o.memoizedState=l),l}function pS(o){var l=hS(o);l.next===null&&(l=o.alternate.memoizedState),Iu(o,l.next.queue,{},ui())}function r1(){return br(Ju)}function mS(){return Wn().memoizedState}function gS(){return Wn().memoizedState}function Fj(o){for(var l=o.return;l!==null;){switch(l.tag){case 24:case 3:var d=ui();o=Ds(d);var g=_s(l,o,d);g!==null&&(Gr(g,l,d),ju(g,l,d)),l={cache:Mg()},o.payload=l;return}l=l.return}}function Bj(o,l,d){var g=ui();d={lane:g,revertLane:0,gesture:null,action:d,hasEagerState:!1,eagerState:null,next:null},jh(o)?xS(l,d):(d=wg(o,l,d,g),d!==null&&(Gr(d,o,g),bS(d,l,g)))}function yS(o,l,d){var g=ui();Iu(o,l,d,g)}function Iu(o,l,d,g){var v={lane:g,revertLane:0,gesture:null,action:d,hasEagerState:!1,eagerState:null,next:null};if(jh(o))xS(l,v);else{var C=o.alternate;if(o.lanes===0&&(C===null||C.lanes===0)&&(C=l.lastRenderedReducer,C!==null))try{var M=l.lastRenderedState,F=C(M,d);if(v.hasEagerState=!0,v.eagerState=F,ii(F,M))return dh(o,l,v,0),wn===null&&uh(),!1}catch{}if(d=wg(o,l,v,g),d!==null)return Gr(d,o,g),bS(d,l,g),!0}return!1}function i1(o,l,d,g){if(g={lane:2,revertLane:I1(),gesture:null,action:g,hasEagerState:!1,eagerState:null,next:null},jh(o)){if(l)throw Error(r(479))}else l=wg(o,d,g,2),l!==null&&Gr(l,o,2)}function jh(o){var l=o.alternate;return o===Ot||l!==null&&l===Ot}function xS(o,l){Kl=kh=!0;var d=o.pending;d===null?l.next=l:(l.next=d.next,d.next=l),o.pending=l}function bS(o,l,d){if((d&4194048)!==0){var g=l.lanes;g&=o.pendingLanes,d|=g,l.lanes=d,K(o,d)}}var Pu={readContext:br,use:Nh,useCallback:In,useContext:In,useEffect:In,useImperativeHandle:In,useLayoutEffect:In,useInsertionEffect:In,useMemo:In,useReducer:In,useRef:In,useState:In,useDebugValue:In,useDeferredValue:In,useTransition:In,useSyncExternalStore:In,useId:In,useHostTransitionStatus:In,useFormState:In,useActionState:In,useOptimistic:In,useMemoCache:In,useCacheRefresh:In};Pu.useEffectEvent=In;var vS={readContext:br,use:Nh,useCallback:function(o,l){return _r().memoizedState=[o,l===void 0?null:l],o},useContext:br,useEffect:rS,useImperativeHandle:function(o,l,d){d=d!=null?d.concat([o]):null,Ah(4194308,4,aS.bind(null,l,o),d)},useLayoutEffect:function(o,l){return Ah(4194308,4,o,l)},useInsertionEffect:function(o,l){Ah(4,2,o,l)},useMemo:function(o,l){var d=_r();l=l===void 0?null:l;var g=o();if(Wa){bt(!0);try{o()}finally{bt(!1)}}return d.memoizedState=[g,l],g},useReducer:function(o,l,d){var g=_r();if(d!==void 0){var v=d(l);if(Wa){bt(!0);try{d(l)}finally{bt(!1)}}}else v=l;return g.memoizedState=g.baseState=v,o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:o,lastRenderedState:v},g.queue=o,o=o.dispatch=Bj.bind(null,Ot,o),[g.memoizedState,o]},useRef:function(o){var l=_r();return o={current:o},l.memoizedState=o},useState:function(o){o=Xg(o);var l=o.queue,d=yS.bind(null,Ot,l);return l.dispatch=d,[o.memoizedState,d]},useDebugValue:e1,useDeferredValue:function(o,l){var d=_r();return t1(d,o,l)},useTransition:function(){var o=Xg(!1);return o=fS.bind(null,Ot,o.queue,!0,!1),_r().memoizedState=o,[!1,o]},useSyncExternalStore:function(o,l,d){var g=Ot,v=_r();if(Kt){if(d===void 0)throw Error(r(407));d=d()}else{if(d=l(),wn===null)throw Error(r(349));(Vt&127)!==0||H3(g,l,d)}v.memoizedState=d;var C={value:d,getSnapshot:l};return v.queue=C,rS(V3.bind(null,g,C,o),[o]),g.flags|=2048,Xl(9,{destroy:void 0},U3.bind(null,g,C,d,l),null),d},useId:function(){var o=_r(),l=wn.identifierPrefix;if(Kt){var d=po,g=ho;d=(g&~(1<<32-nt(g)-1)).toString(32)+d,l="_"+l+"R_"+d,d=Eh++,0<d&&(l+="H"+d.toString(32)),l+="_"}else d=Dj++,l="_"+l+"r_"+d.toString(32)+"_";return o.memoizedState=l},useHostTransitionStatus:r1,useFormState:Z3,useActionState:Z3,useOptimistic:function(o){var l=_r();l.memoizedState=l.baseState=o;var d={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return l.queue=d,l=i1.bind(null,Ot,!0,d),d.dispatch=l,[o,l]},useMemoCache:Gg,useCacheRefresh:function(){return _r().memoizedState=Fj.bind(null,Ot)},useEffectEvent:function(o){var l=_r(),d={impl:o};return l.memoizedState=d,function(){if((sn&2)!==0)throw Error(r(440));return d.impl.apply(void 0,arguments)}}},o1={readContext:br,use:Nh,useCallback:cS,useContext:br,useEffect:Jg,useImperativeHandle:lS,useInsertionEffect:oS,useLayoutEffect:sS,useMemo:uS,useReducer:Rh,useRef:nS,useState:function(){return Rh($o)},useDebugValue:e1,useDeferredValue:function(o,l){var d=Wn();return dS(d,gn.memoizedState,o,l)},useTransition:function(){var o=Rh($o)[0],l=Wn().memoizedState;return[typeof o=="boolean"?o:Lu(o),l]},useSyncExternalStore:B3,useId:mS,useHostTransitionStatus:r1,useFormState:J3,useActionState:J3,useOptimistic:function(o,l){var d=Wn();return Y3(d,gn,o,l)},useMemoCache:Gg,useCacheRefresh:gS};o1.useEffectEvent=iS;var wS={readContext:br,use:Nh,useCallback:cS,useContext:br,useEffect:Jg,useImperativeHandle:lS,useInsertionEffect:oS,useLayoutEffect:sS,useMemo:uS,useReducer:Qg,useRef:nS,useState:function(){return Qg($o)},useDebugValue:e1,useDeferredValue:function(o,l){var d=Wn();return gn===null?t1(d,o,l):dS(d,gn.memoizedState,o,l)},useTransition:function(){var o=Qg($o)[0],l=Wn().memoizedState;return[typeof o=="boolean"?o:Lu(o),l]},useSyncExternalStore:B3,useId:mS,useHostTransitionStatus:r1,useFormState:tS,useActionState:tS,useOptimistic:function(o,l){var d=Wn();return gn!==null?Y3(d,gn,o,l):(d.baseState=o,[o,d.queue.dispatch])},useMemoCache:Gg,useCacheRefresh:gS};wS.useEffectEvent=iS;function s1(o,l,d,g){l=o.memoizedState,d=d(g,l),d=d==null?l:p({},l,d),o.memoizedState=d,o.lanes===0&&(o.updateQueue.baseState=d)}var a1={enqueueSetState:function(o,l,d){o=o._reactInternals;var g=ui(),v=Ds(g);v.payload=l,d!=null&&(v.callback=d),l=_s(o,v,g),l!==null&&(Gr(l,o,g),ju(l,o,g))},enqueueReplaceState:function(o,l,d){o=o._reactInternals;var g=ui(),v=Ds(g);v.tag=1,v.payload=l,d!=null&&(v.callback=d),l=_s(o,v,g),l!==null&&(Gr(l,o,g),ju(l,o,g))},enqueueForceUpdate:function(o,l){o=o._reactInternals;var d=ui(),g=Ds(d);g.tag=2,l!=null&&(g.callback=l),l=_s(o,g,d),l!==null&&(Gr(l,o,d),ju(l,o,d))}};function SS(o,l,d,g,v,C,M){return o=o.stateNode,typeof o.shouldComponentUpdate=="function"?o.shouldComponentUpdate(g,C,M):l.prototype&&l.prototype.isPureReactComponent?!Cu(d,g)||!Cu(v,C):!0}function CS(o,l,d,g){o=l.state,typeof l.componentWillReceiveProps=="function"&&l.componentWillReceiveProps(d,g),typeof l.UNSAFE_componentWillReceiveProps=="function"&&l.UNSAFE_componentWillReceiveProps(d,g),l.state!==o&&a1.enqueueReplaceState(l,l.state,null)}function Ga(o,l){var d=l;if("ref"in l){d={};for(var g in l)g!=="ref"&&(d[g]=l[g])}if(o=o.defaultProps){d===l&&(d=p({},d));for(var v in o)d[v]===void 0&&(d[v]=o[v])}return d}function kS(o){ch(o)}function ES(o){console.error(o)}function TS(o){ch(o)}function Mh(o,l){try{var d=o.onUncaughtError;d(l.value,{componentStack:l.stack})}catch(g){setTimeout(function(){throw g})}}function NS(o,l,d){try{var g=o.onCaughtError;g(d.value,{componentStack:d.stack,errorBoundary:l.tag===1?l.stateNode:null})}catch(v){setTimeout(function(){throw v})}}function l1(o,l,d){return d=Ds(d),d.tag=3,d.payload={element:null},d.callback=function(){Mh(o,l)},d}function RS(o){return o=Ds(o),o.tag=3,o}function AS(o,l,d,g){var v=d.type.getDerivedStateFromError;if(typeof v=="function"){var C=g.value;o.payload=function(){return v(C)},o.callback=function(){NS(l,d,g)}}var M=d.stateNode;M!==null&&typeof M.componentDidCatch=="function"&&(o.callback=function(){NS(l,d,g),typeof v!="function"&&(Bs===null?Bs=new Set([this]):Bs.add(this));var F=g.stack;this.componentDidCatch(g.value,{componentStack:F!==null?F:""})})}function Hj(o,l,d,g,v){if(d.flags|=32768,g!==null&&typeof g=="object"&&typeof g.then=="function"){if(l=d.alternate,l!==null&&Vl(l,d,v,!0),d=si.current,d!==null){switch(d.tag){case 31:case 13:return Li===null?qh():d.alternate===null&&Pn===0&&(Pn=3),d.flags&=-257,d.flags|=65536,d.lanes=v,g===bh?d.flags|=16384:(l=d.updateQueue,l===null?d.updateQueue=new Set([g]):l.add(g),D1(o,g,v)),!1;case 22:return d.flags|=65536,g===bh?d.flags|=16384:(l=d.updateQueue,l===null?(l={transitions:null,markerInstances:null,retryQueue:new Set([g])},d.updateQueue=l):(d=l.retryQueue,d===null?l.retryQueue=new Set([g]):d.add(g)),D1(o,g,v)),!1}throw Error(r(435,d.tag))}return D1(o,g,v),qh(),!1}if(Kt)return l=si.current,l!==null?((l.flags&65536)===0&&(l.flags|=256),l.flags|=65536,l.lanes=v,g!==Ng&&(o=Error(r(422),{cause:g}),Tu(ji(o,d)))):(g!==Ng&&(l=Error(r(423),{cause:g}),Tu(ji(l,d))),o=o.current.alternate,o.flags|=65536,v&=-v,o.lanes|=v,g=ji(g,d),v=l1(o.stateNode,g,v),zg(o,v),Pn!==4&&(Pn=2)),!1;var C=Error(r(520),{cause:g});if(C=ji(C,d),$u===null?$u=[C]:$u.push(C),Pn!==4&&(Pn=2),l===null)return!0;g=ji(g,d),d=l;do{switch(d.tag){case 3:return d.flags|=65536,o=v&-v,d.lanes|=o,o=l1(d.stateNode,g,o),zg(d,o),!1;case 1:if(l=d.type,C=d.stateNode,(d.flags&128)===0&&(typeof l.getDerivedStateFromError=="function"||C!==null&&typeof C.componentDidCatch=="function"&&(Bs===null||!Bs.has(C))))return d.flags|=65536,v&=-v,d.lanes|=v,v=RS(v),AS(v,o,d,g),zg(d,v),!1}d=d.return}while(d!==null);return!1}var c1=Error(r(461)),Zn=!1;function vr(o,l,d,g){l.child=o===null?D3(l,null,d,g):Ya(l,o.child,d,g)}function OS(o,l,d,g,v){d=d.render;var C=l.ref;if("ref"in g){var M={};for(var F in g)F!=="ref"&&(M[F]=g[F])}else M=g;return Ua(l),g=qg(o,l,d,M,C,v),F=$g(),o!==null&&!Zn?(Yg(o,l,v),Yo(o,l,v)):(Kt&&F&&Eg(l),l.flags|=1,vr(o,l,g,v),l.child)}function jS(o,l,d,g,v){if(o===null){var C=d.type;return typeof C=="function"&&!Sg(C)&&C.defaultProps===void 0&&d.compare===null?(l.tag=15,l.type=C,MS(o,l,C,g,v)):(o=hh(d.type,null,g,l,l.mode,v),o.ref=l.ref,o.return=l,l.child=o)}if(C=o.child,!y1(o,v)){var M=C.memoizedProps;if(d=d.compare,d=d!==null?d:Cu,d(M,g)&&o.ref===l.ref)return Yo(o,l,v)}return l.flags|=1,o=Bo(C,g),o.ref=l.ref,o.return=l,l.child=o}function MS(o,l,d,g,v){if(o!==null){var C=o.memoizedProps;if(Cu(C,g)&&o.ref===l.ref)if(Zn=!1,l.pendingProps=g=C,y1(o,v))(o.flags&131072)!==0&&(Zn=!0);else return l.lanes=o.lanes,Yo(o,l,v)}return u1(o,l,d,g,v)}function DS(o,l,d,g){var v=g.children,C=o!==null?o.memoizedState:null;if(o===null&&l.stateNode===null&&(l.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),g.mode==="hidden"){if((l.flags&128)!==0){if(C=C!==null?C.baseLanes|d:d,o!==null){for(g=l.child=o.child,v=0;g!==null;)v=v|g.lanes|g.childLanes,g=g.sibling;g=v&~C}else g=0,l.child=null;return _S(o,l,C,d,g)}if((d&536870912)!==0)l.memoizedState={baseLanes:0,cachePool:null},o!==null&&yh(l,C!==null?C.cachePool:null),C!==null?I3(l,C):Bg(),P3(l);else return g=l.lanes=536870912,_S(o,l,C!==null?C.baseLanes|d:d,d,g)}else C!==null?(yh(l,C.cachePool),I3(l,C),Is(),l.memoizedState=null):(o!==null&&yh(l,null),Bg(),Is());return vr(o,l,v,d),l.child}function zu(o,l){return o!==null&&o.tag===22||l.stateNode!==null||(l.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.sibling}function _S(o,l,d,g,v){var C=_g();return C=C===null?null:{parent:Qn._currentValue,pool:C},l.memoizedState={baseLanes:d,cachePool:C},o!==null&&yh(l,null),Bg(),P3(l),o!==null&&Vl(o,l,g,!0),l.childLanes=v,null}function Dh(o,l){return l=Lh({mode:l.mode,children:l.children},o.mode),l.ref=o.ref,o.child=l,l.return=o,l}function LS(o,l,d){return Ya(l,o.child,null,d),o=Dh(l,l.pendingProps),o.flags|=2,ai(l),l.memoizedState=null,o}function Uj(o,l,d){var g=l.pendingProps,v=(l.flags&128)!==0;if(l.flags&=-129,o===null){if(Kt){if(g.mode==="hidden")return o=Dh(l,g),l.lanes=536870912,zu(null,o);if(Ug(l),(o=En)?(o=WC(o,_i),o=o!==null&&o.data==="&"?o:null,o!==null&&(l.memoizedState={dehydrated:o,treeContext:Rs!==null?{id:ho,overflow:po}:null,retryLane:536870912,hydrationErrors:null},d=x3(o),d.return=l,l.child=d,xr=l,En=null)):o=null,o===null)throw Os(l);return l.lanes=536870912,null}return Dh(l,g)}var C=o.memoizedState;if(C!==null){var M=C.dehydrated;if(Ug(l),v)if(l.flags&256)l.flags&=-257,l=LS(o,l,d);else if(l.memoizedState!==null)l.child=o.child,l.flags|=128,l=null;else throw Error(r(558));else if(Zn||Vl(o,l,d,!1),v=(d&o.childLanes)!==0,Zn||v){if(g=wn,g!==null&&(M=te(g,d),M!==0&&M!==C.retryLane))throw C.retryLane=M,za(o,M),Gr(g,o,M),c1;qh(),l=LS(o,l,d)}else o=C.treeContext,En=Ii(M.nextSibling),xr=l,Kt=!0,As=null,_i=!1,o!==null&&w3(l,o),l=Dh(l,g),l.flags|=4096;return l}return o=Bo(o.child,{mode:g.mode,children:g.children}),o.ref=l.ref,l.child=o,o.return=l,o}function _h(o,l){var d=l.ref;if(d===null)o!==null&&o.ref!==null&&(l.flags|=4194816);else{if(typeof d!="function"&&typeof d!="object")throw Error(r(284));(o===null||o.ref!==d)&&(l.flags|=4194816)}}function u1(o,l,d,g,v){return Ua(l),d=qg(o,l,d,g,void 0,v),g=$g(),o!==null&&!Zn?(Yg(o,l,v),Yo(o,l,v)):(Kt&&g&&Eg(l),l.flags|=1,vr(o,l,d,v),l.child)}function IS(o,l,d,g,v,C){return Ua(l),l.updateQueue=null,d=F3(l,g,d,v),z3(o),g=$g(),o!==null&&!Zn?(Yg(o,l,C),Yo(o,l,C)):(Kt&&g&&Eg(l),l.flags|=1,vr(o,l,d,C),l.child)}function PS(o,l,d,g,v){if(Ua(l),l.stateNode===null){var C=Fl,M=d.contextType;typeof M=="object"&&M!==null&&(C=br(M)),C=new d(g,C),l.memoizedState=C.state!==null&&C.state!==void 0?C.state:null,C.updater=a1,l.stateNode=C,C._reactInternals=l,C=l.stateNode,C.props=g,C.state=l.memoizedState,C.refs={},Ig(l),M=d.contextType,C.context=typeof M=="object"&&M!==null?br(M):Fl,C.state=l.memoizedState,M=d.getDerivedStateFromProps,typeof M=="function"&&(s1(l,d,M,g),C.state=l.memoizedState),typeof d.getDerivedStateFromProps=="function"||typeof C.getSnapshotBeforeUpdate=="function"||typeof C.UNSAFE_componentWillMount!="function"&&typeof C.componentWillMount!="function"||(M=C.state,typeof C.componentWillMount=="function"&&C.componentWillMount(),typeof C.UNSAFE_componentWillMount=="function"&&C.UNSAFE_componentWillMount(),M!==C.state&&a1.enqueueReplaceState(C,C.state,null),Du(l,g,C,v),Mu(),C.state=l.memoizedState),typeof C.componentDidMount=="function"&&(l.flags|=4194308),g=!0}else if(o===null){C=l.stateNode;var F=l.memoizedProps,X=Ga(d,F);C.props=X;var ue=C.context,ve=d.contextType;M=Fl,typeof ve=="object"&&ve!==null&&(M=br(ve));var Ne=d.getDerivedStateFromProps;ve=typeof Ne=="function"||typeof C.getSnapshotBeforeUpdate=="function",F=l.pendingProps!==F,ve||typeof C.UNSAFE_componentWillReceiveProps!="function"&&typeof C.componentWillReceiveProps!="function"||(F||ue!==M)&&CS(l,C,g,M),Ms=!1;var de=l.memoizedState;C.state=de,Du(l,g,C,v),Mu(),ue=l.memoizedState,F||de!==ue||Ms?(typeof Ne=="function"&&(s1(l,d,Ne,g),ue=l.memoizedState),(X=Ms||SS(l,d,X,g,de,ue,M))?(ve||typeof C.UNSAFE_componentWillMount!="function"&&typeof C.componentWillMount!="function"||(typeof C.componentWillMount=="function"&&C.componentWillMount(),typeof C.UNSAFE_componentWillMount=="function"&&C.UNSAFE_componentWillMount()),typeof C.componentDidMount=="function"&&(l.flags|=4194308)):(typeof C.componentDidMount=="function"&&(l.flags|=4194308),l.memoizedProps=g,l.memoizedState=ue),C.props=g,C.state=ue,C.context=M,g=X):(typeof C.componentDidMount=="function"&&(l.flags|=4194308),g=!1)}else{C=l.stateNode,Pg(o,l),M=l.memoizedProps,ve=Ga(d,M),C.props=ve,Ne=l.pendingProps,de=C.context,ue=d.contextType,X=Fl,typeof ue=="object"&&ue!==null&&(X=br(ue)),F=d.getDerivedStateFromProps,(ue=typeof F=="function"||typeof C.getSnapshotBeforeUpdate=="function")||typeof C.UNSAFE_componentWillReceiveProps!="function"&&typeof C.componentWillReceiveProps!="function"||(M!==Ne||de!==X)&&CS(l,C,g,X),Ms=!1,de=l.memoizedState,C.state=de,Du(l,g,C,v),Mu();var me=l.memoizedState;M!==Ne||de!==me||Ms||o!==null&&o.dependencies!==null&&mh(o.dependencies)?(typeof F=="function"&&(s1(l,d,F,g),me=l.memoizedState),(ve=Ms||SS(l,d,ve,g,de,me,X)||o!==null&&o.dependencies!==null&&mh(o.dependencies))?(ue||typeof C.UNSAFE_componentWillUpdate!="function"&&typeof C.componentWillUpdate!="function"||(typeof C.componentWillUpdate=="function"&&C.componentWillUpdate(g,me,X),typeof C.UNSAFE_componentWillUpdate=="function"&&C.UNSAFE_componentWillUpdate(g,me,X)),typeof C.componentDidUpdate=="function"&&(l.flags|=4),typeof C.getSnapshotBeforeUpdate=="function"&&(l.flags|=1024)):(typeof C.componentDidUpdate!="function"||M===o.memoizedProps&&de===o.memoizedState||(l.flags|=4),typeof C.getSnapshotBeforeUpdate!="function"||M===o.memoizedProps&&de===o.memoizedState||(l.flags|=1024),l.memoizedProps=g,l.memoizedState=me),C.props=g,C.state=me,C.context=X,g=ve):(typeof C.componentDidUpdate!="function"||M===o.memoizedProps&&de===o.memoizedState||(l.flags|=4),typeof C.getSnapshotBeforeUpdate!="function"||M===o.memoizedProps&&de===o.memoizedState||(l.flags|=1024),g=!1)}return C=g,_h(o,l),g=(l.flags&128)!==0,C||g?(C=l.stateNode,d=g&&typeof d.getDerivedStateFromError!="function"?null:C.render(),l.flags|=1,o!==null&&g?(l.child=Ya(l,o.child,null,v),l.child=Ya(l,null,d,v)):vr(o,l,d,v),l.memoizedState=C.state,o=l.child):o=Yo(o,l,v),o}function zS(o,l,d,g){return Ba(),l.flags|=256,vr(o,l,d,g),l.child}var d1={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function f1(o){return{baseLanes:o,cachePool:N3()}}function h1(o,l,d){return o=o!==null?o.childLanes&~d:0,l&&(o|=ci),o}function FS(o,l,d){var g=l.pendingProps,v=!1,C=(l.flags&128)!==0,M;if((M=C)||(M=o!==null&&o.memoizedState===null?!1:(Yn.current&2)!==0),M&&(v=!0,l.flags&=-129),M=(l.flags&32)!==0,l.flags&=-33,o===null){if(Kt){if(v?Ls(l):Is(),(o=En)?(o=WC(o,_i),o=o!==null&&o.data!=="&"?o:null,o!==null&&(l.memoizedState={dehydrated:o,treeContext:Rs!==null?{id:ho,overflow:po}:null,retryLane:536870912,hydrationErrors:null},d=x3(o),d.return=l,l.child=d,xr=l,En=null)):o=null,o===null)throw Os(l);return K1(o)?l.lanes=32:l.lanes=536870912,null}var F=g.children;return g=g.fallback,v?(Is(),v=l.mode,F=Lh({mode:"hidden",children:F},v),g=Fa(g,v,d,null),F.return=l,g.return=l,F.sibling=g,l.child=F,g=l.child,g.memoizedState=f1(d),g.childLanes=h1(o,M,d),l.memoizedState=d1,zu(null,g)):(Ls(l),p1(l,F))}var X=o.memoizedState;if(X!==null&&(F=X.dehydrated,F!==null)){if(C)l.flags&256?(Ls(l),l.flags&=-257,l=m1(o,l,d)):l.memoizedState!==null?(Is(),l.child=o.child,l.flags|=128,l=null):(Is(),F=g.fallback,v=l.mode,g=Lh({mode:"visible",children:g.children},v),F=Fa(F,v,d,null),F.flags|=2,g.return=l,F.return=l,g.sibling=F,l.child=g,Ya(l,o.child,null,d),g=l.child,g.memoizedState=f1(d),g.childLanes=h1(o,M,d),l.memoizedState=d1,l=zu(null,g));else if(Ls(l),K1(F)){if(M=F.nextSibling&&F.nextSibling.dataset,M)var ue=M.dgst;M=ue,g=Error(r(419)),g.stack="",g.digest=M,Tu({value:g,source:null,stack:null}),l=m1(o,l,d)}else if(Zn||Vl(o,l,d,!1),M=(d&o.childLanes)!==0,Zn||M){if(M=wn,M!==null&&(g=te(M,d),g!==0&&g!==X.retryLane))throw X.retryLane=g,za(o,g),Gr(M,o,g),c1;G1(F)||qh(),l=m1(o,l,d)}else G1(F)?(l.flags|=192,l.child=o.child,l=null):(o=X.treeContext,En=Ii(F.nextSibling),xr=l,Kt=!0,As=null,_i=!1,o!==null&&w3(l,o),l=p1(l,g.children),l.flags|=4096);return l}return v?(Is(),F=g.fallback,v=l.mode,X=o.child,ue=X.sibling,g=Bo(X,{mode:"hidden",children:g.children}),g.subtreeFlags=X.subtreeFlags&65011712,ue!==null?F=Bo(ue,F):(F=Fa(F,v,d,null),F.flags|=2),F.return=l,g.return=l,g.sibling=F,l.child=g,zu(null,g),g=l.child,F=o.child.memoizedState,F===null?F=f1(d):(v=F.cachePool,v!==null?(X=Qn._currentValue,v=v.parent!==X?{parent:X,pool:X}:v):v=N3(),F={baseLanes:F.baseLanes|d,cachePool:v}),g.memoizedState=F,g.childLanes=h1(o,M,d),l.memoizedState=d1,zu(o.child,g)):(Ls(l),d=o.child,o=d.sibling,d=Bo(d,{mode:"visible",children:g.children}),d.return=l,d.sibling=null,o!==null&&(M=l.deletions,M===null?(l.deletions=[o],l.flags|=16):M.push(o)),l.child=d,l.memoizedState=null,d)}function p1(o,l){return l=Lh({mode:"visible",children:l},o.mode),l.return=o,o.child=l}function Lh(o,l){return o=oi(22,o,null,l),o.lanes=0,o}function m1(o,l,d){return Ya(l,o.child,null,d),o=p1(l,l.pendingProps.children),o.flags|=2,l.memoizedState=null,o}function BS(o,l,d){o.lanes|=l;var g=o.alternate;g!==null&&(g.lanes|=l),Og(o.return,l,d)}function g1(o,l,d,g,v,C){var M=o.memoizedState;M===null?o.memoizedState={isBackwards:l,rendering:null,renderingStartTime:0,last:g,tail:d,tailMode:v,treeForkCount:C}:(M.isBackwards=l,M.rendering=null,M.renderingStartTime=0,M.last=g,M.tail=d,M.tailMode=v,M.treeForkCount=C)}function HS(o,l,d){var g=l.pendingProps,v=g.revealOrder,C=g.tail;g=g.children;var M=Yn.current,F=(M&2)!==0;if(F?(M=M&1|2,l.flags|=128):M&=1,D(Yn,M),vr(o,l,g,d),g=Kt?Eu:0,!F&&o!==null&&(o.flags&128)!==0)e:for(o=l.child;o!==null;){if(o.tag===13)o.memoizedState!==null&&BS(o,d,l);else if(o.tag===19)BS(o,d,l);else if(o.child!==null){o.child.return=o,o=o.child;continue}if(o===l)break e;for(;o.sibling===null;){if(o.return===null||o.return===l)break e;o=o.return}o.sibling.return=o.return,o=o.sibling}switch(v){case"forwards":for(d=l.child,v=null;d!==null;)o=d.alternate,o!==null&&Ch(o)===null&&(v=d),d=d.sibling;d=v,d===null?(v=l.child,l.child=null):(v=d.sibling,d.sibling=null),g1(l,!1,v,d,C,g);break;case"backwards":case"unstable_legacy-backwards":for(d=null,v=l.child,l.child=null;v!==null;){if(o=v.alternate,o!==null&&Ch(o)===null){l.child=v;break}o=v.sibling,v.sibling=d,d=v,v=o}g1(l,!0,d,null,C,g);break;case"together":g1(l,!1,null,null,void 0,g);break;default:l.memoizedState=null}return l.child}function Yo(o,l,d){if(o!==null&&(l.dependencies=o.dependencies),Fs|=l.lanes,(d&l.childLanes)===0)if(o!==null){if(Vl(o,l,d,!1),(d&l.childLanes)===0)return null}else return null;if(o!==null&&l.child!==o.child)throw Error(r(153));if(l.child!==null){for(o=l.child,d=Bo(o,o.pendingProps),l.child=d,d.return=l;o.sibling!==null;)o=o.sibling,d=d.sibling=Bo(o,o.pendingProps),d.return=l;d.sibling=null}return l.child}function y1(o,l){return(o.lanes&l)!==0?!0:(o=o.dependencies,!!(o!==null&&mh(o)))}function Vj(o,l,d){switch(l.tag){case 3:fe(l,l.stateNode.containerInfo),js(l,Qn,o.memoizedState.cache),Ba();break;case 27:case 5:Ae(l);break;case 4:fe(l,l.stateNode.containerInfo);break;case 10:js(l,l.type,l.memoizedProps.value);break;case 31:if(l.memoizedState!==null)return l.flags|=128,Ug(l),null;break;case 13:var g=l.memoizedState;if(g!==null)return g.dehydrated!==null?(Ls(l),l.flags|=128,null):(d&l.child.childLanes)!==0?FS(o,l,d):(Ls(l),o=Yo(o,l,d),o!==null?o.sibling:null);Ls(l);break;case 19:var v=(o.flags&128)!==0;if(g=(d&l.childLanes)!==0,g||(Vl(o,l,d,!1),g=(d&l.childLanes)!==0),v){if(g)return HS(o,l,d);l.flags|=128}if(v=l.memoizedState,v!==null&&(v.rendering=null,v.tail=null,v.lastEffect=null),D(Yn,Yn.current),g)break;return null;case 22:return l.lanes=0,DS(o,l,d,l.pendingProps);case 24:js(l,Qn,o.memoizedState.cache)}return Yo(o,l,d)}function US(o,l,d){if(o!==null)if(o.memoizedProps!==l.pendingProps)Zn=!0;else{if(!y1(o,d)&&(l.flags&128)===0)return Zn=!1,Vj(o,l,d);Zn=(o.flags&131072)!==0}else Zn=!1,Kt&&(l.flags&1048576)!==0&&v3(l,Eu,l.index);switch(l.lanes=0,l.tag){case 16:e:{var g=l.pendingProps;if(o=qa(l.elementType),l.type=o,typeof o=="function")Sg(o)?(g=Ga(o,g),l.tag=1,l=PS(null,l,o,g,d)):(l.tag=0,l=u1(null,l,o,g,d));else{if(o!=null){var v=o.$$typeof;if(v===j){l.tag=11,l=OS(null,l,o,g,d);break e}else if(v===R){l.tag=14,l=jS(null,l,o,g,d);break e}}throw l=q(o)||o,Error(r(306,l,""))}}return l;case 0:return u1(o,l,l.type,l.pendingProps,d);case 1:return g=l.type,v=Ga(g,l.pendingProps),PS(o,l,g,v,d);case 3:e:{if(fe(l,l.stateNode.containerInfo),o===null)throw Error(r(387));g=l.pendingProps;var C=l.memoizedState;v=C.element,Pg(o,l),Du(l,g,null,d);var M=l.memoizedState;if(g=M.cache,js(l,Qn,g),g!==C.cache&&jg(l,[Qn],d,!0),Mu(),g=M.element,C.isDehydrated)if(C={element:g,isDehydrated:!1,cache:M.cache},l.updateQueue.baseState=C,l.memoizedState=C,l.flags&256){l=zS(o,l,g,d);break e}else if(g!==v){v=ji(Error(r(424)),l),Tu(v),l=zS(o,l,g,d);break e}else for(o=l.stateNode.containerInfo,o.nodeType===9?o=o.body:o=o.nodeName==="HTML"?o.ownerDocument.body:o,En=Ii(o.firstChild),xr=l,Kt=!0,As=null,_i=!0,d=D3(l,null,g,d),l.child=d;d;)d.flags=d.flags&-3|4096,d=d.sibling;else{if(Ba(),g===v){l=Yo(o,l,d);break e}vr(o,l,g,d)}l=l.child}return l;case 26:return _h(o,l),o===null?(d=JC(l.type,null,l.pendingProps,null))?l.memoizedState=d:Kt||(d=l.type,o=l.pendingProps,g=Xh(J.current).createElement(d),g[Xe]=l,g[et]=o,wr(g,d,o),Rn(g),l.stateNode=g):l.memoizedState=JC(l.type,o.memoizedProps,l.pendingProps,o.memoizedState),null;case 27:return Ae(l),o===null&&Kt&&(g=l.stateNode=QC(l.type,l.pendingProps,J.current),xr=l,_i=!0,v=En,qs(l.type)?(Q1=v,En=Ii(g.firstChild)):En=v),vr(o,l,l.pendingProps.children,d),_h(o,l),o===null&&(l.flags|=4194304),l.child;case 5:return o===null&&Kt&&((v=g=En)&&(g=bM(g,l.type,l.pendingProps,_i),g!==null?(l.stateNode=g,xr=l,En=Ii(g.firstChild),_i=!1,v=!0):v=!1),v||Os(l)),Ae(l),v=l.type,C=l.pendingProps,M=o!==null?o.memoizedProps:null,g=C.children,$1(v,C)?g=null:M!==null&&$1(v,M)&&(l.flags|=32),l.memoizedState!==null&&(v=qg(o,l,_j,null,null,d),Ju._currentValue=v),_h(o,l),vr(o,l,g,d),l.child;case 6:return o===null&&Kt&&((o=d=En)&&(d=vM(d,l.pendingProps,_i),d!==null?(l.stateNode=d,xr=l,En=null,o=!0):o=!1),o||Os(l)),null;case 13:return FS(o,l,d);case 4:return fe(l,l.stateNode.containerInfo),g=l.pendingProps,o===null?l.child=Ya(l,null,g,d):vr(o,l,g,d),l.child;case 11:return OS(o,l,l.type,l.pendingProps,d);case 7:return vr(o,l,l.pendingProps,d),l.child;case 8:return vr(o,l,l.pendingProps.children,d),l.child;case 12:return vr(o,l,l.pendingProps.children,d),l.child;case 10:return g=l.pendingProps,js(l,l.type,g.value),vr(o,l,g.children,d),l.child;case 9:return v=l.type._context,g=l.pendingProps.children,Ua(l),v=br(v),g=g(v),l.flags|=1,vr(o,l,g,d),l.child;case 14:return jS(o,l,l.type,l.pendingProps,d);case 15:return MS(o,l,l.type,l.pendingProps,d);case 19:return HS(o,l,d);case 31:return Uj(o,l,d);case 22:return DS(o,l,d,l.pendingProps);case 24:return Ua(l),g=br(Qn),o===null?(v=_g(),v===null&&(v=wn,C=Mg(),v.pooledCache=C,C.refCount++,C!==null&&(v.pooledCacheLanes|=d),v=C),l.memoizedState={parent:g,cache:v},Ig(l),js(l,Qn,v)):((o.lanes&d)!==0&&(Pg(o,l),Du(l,null,null,d),Mu()),v=o.memoizedState,C=l.memoizedState,v.parent!==g?(v={parent:g,cache:g},l.memoizedState=v,l.lanes===0&&(l.memoizedState=l.updateQueue.baseState=v),js(l,Qn,g)):(g=C.cache,js(l,Qn,g),g!==v.cache&&jg(l,[Qn],d,!0))),vr(o,l,l.pendingProps.children,d),l.child;case 29:throw l.pendingProps}throw Error(r(156,l.tag))}function Wo(o){o.flags|=4}function x1(o,l,d,g,v){if((l=(o.mode&32)!==0)&&(l=!1),l){if(o.flags|=16777216,(v&335544128)===v)if(o.stateNode.complete)o.flags|=8192;else if(mC())o.flags|=8192;else throw $a=bh,Lg}else o.flags&=-16777217}function VS(o,l){if(l.type!=="stylesheet"||(l.state.loading&4)!==0)o.flags&=-16777217;else if(o.flags|=16777216,!i5(l))if(mC())o.flags|=8192;else throw $a=bh,Lg}function Ih(o,l){l!==null&&(o.flags|=4),o.flags&16384&&(l=o.tag!==22?tn():536870912,o.lanes|=l,tc|=l)}function Fu(o,l){if(!Kt)switch(o.tailMode){case"hidden":l=o.tail;for(var d=null;l!==null;)l.alternate!==null&&(d=l),l=l.sibling;d===null?o.tail=null:d.sibling=null;break;case"collapsed":d=o.tail;for(var g=null;d!==null;)d.alternate!==null&&(g=d),d=d.sibling;g===null?l||o.tail===null?o.tail=null:o.tail.sibling=null:g.sibling=null}}function Tn(o){var l=o.alternate!==null&&o.alternate.child===o.child,d=0,g=0;if(l)for(var v=o.child;v!==null;)d|=v.lanes|v.childLanes,g|=v.subtreeFlags&65011712,g|=v.flags&65011712,v.return=o,v=v.sibling;else for(v=o.child;v!==null;)d|=v.lanes|v.childLanes,g|=v.subtreeFlags,g|=v.flags,v.return=o,v=v.sibling;return o.subtreeFlags|=g,o.childLanes=d,l}function qj(o,l,d){var g=l.pendingProps;switch(Tg(l),l.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Tn(l),null;case 1:return Tn(l),null;case 3:return d=l.stateNode,g=null,o!==null&&(g=o.memoizedState.cache),l.memoizedState.cache!==g&&(l.flags|=2048),Vo(Qn),Se(),d.pendingContext&&(d.context=d.pendingContext,d.pendingContext=null),(o===null||o.child===null)&&(Ul(l)?Wo(l):o===null||o.memoizedState.isDehydrated&&(l.flags&256)===0||(l.flags|=1024,Rg())),Tn(l),null;case 26:var v=l.type,C=l.memoizedState;return o===null?(Wo(l),C!==null?(Tn(l),VS(l,C)):(Tn(l),x1(l,v,null,g,d))):C?C!==o.memoizedState?(Wo(l),Tn(l),VS(l,C)):(Tn(l),l.flags&=-16777217):(o=o.memoizedProps,o!==g&&Wo(l),Tn(l),x1(l,v,o,g,d)),null;case 27:if(Oe(l),d=J.current,v=l.type,o!==null&&l.stateNode!=null)o.memoizedProps!==g&&Wo(l);else{if(!g){if(l.stateNode===null)throw Error(r(166));return Tn(l),null}o=Z.current,Ul(l)?S3(l):(o=QC(v,g,d),l.stateNode=o,Wo(l))}return Tn(l),null;case 5:if(Oe(l),v=l.type,o!==null&&l.stateNode!=null)o.memoizedProps!==g&&Wo(l);else{if(!g){if(l.stateNode===null)throw Error(r(166));return Tn(l),null}if(C=Z.current,Ul(l))S3(l);else{var M=Xh(J.current);switch(C){case 1:C=M.createElementNS("http://www.w3.org/2000/svg",v);break;case 2:C=M.createElementNS("http://www.w3.org/1998/Math/MathML",v);break;default:switch(v){case"svg":C=M.createElementNS("http://www.w3.org/2000/svg",v);break;case"math":C=M.createElementNS("http://www.w3.org/1998/Math/MathML",v);break;case"script":C=M.createElement("div"),C.innerHTML="<script><\/script>",C=C.removeChild(C.firstChild);break;case"select":C=typeof g.is=="string"?M.createElement("select",{is:g.is}):M.createElement("select"),g.multiple?C.multiple=!0:g.size&&(C.size=g.size);break;default:C=typeof g.is=="string"?M.createElement(v,{is:g.is}):M.createElement(v)}}C[Xe]=l,C[et]=g;e:for(M=l.child;M!==null;){if(M.tag===5||M.tag===6)C.appendChild(M.stateNode);else if(M.tag!==4&&M.tag!==27&&M.child!==null){M.child.return=M,M=M.child;continue}if(M===l)break e;for(;M.sibling===null;){if(M.return===null||M.return===l)break e;M=M.return}M.sibling.return=M.return,M=M.sibling}l.stateNode=C;e:switch(wr(C,v,g),v){case"button":case"input":case"select":case"textarea":g=!!g.autoFocus;break e;case"img":g=!0;break e;default:g=!1}g&&Wo(l)}}return Tn(l),x1(l,l.type,o===null?null:o.memoizedProps,l.pendingProps,d),null;case 6:if(o&&l.stateNode!=null)o.memoizedProps!==g&&Wo(l);else{if(typeof g!="string"&&l.stateNode===null)throw Error(r(166));if(o=J.current,Ul(l)){if(o=l.stateNode,d=l.memoizedProps,g=null,v=xr,v!==null)switch(v.tag){case 27:case 5:g=v.memoizedProps}o[Xe]=l,o=!!(o.nodeValue===d||g!==null&&g.suppressHydrationWarning===!0||FC(o.nodeValue,d)),o||Os(l,!0)}else o=Xh(o).createTextNode(g),o[Xe]=l,l.stateNode=o}return Tn(l),null;case 31:if(d=l.memoizedState,o===null||o.memoizedState!==null){if(g=Ul(l),d!==null){if(o===null){if(!g)throw Error(r(318));if(o=l.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(r(557));o[Xe]=l}else Ba(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;Tn(l),o=!1}else d=Rg(),o!==null&&o.memoizedState!==null&&(o.memoizedState.hydrationErrors=d),o=!0;if(!o)return l.flags&256?(ai(l),l):(ai(l),null);if((l.flags&128)!==0)throw Error(r(558))}return Tn(l),null;case 13:if(g=l.memoizedState,o===null||o.memoizedState!==null&&o.memoizedState.dehydrated!==null){if(v=Ul(l),g!==null&&g.dehydrated!==null){if(o===null){if(!v)throw Error(r(318));if(v=l.memoizedState,v=v!==null?v.dehydrated:null,!v)throw Error(r(317));v[Xe]=l}else Ba(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;Tn(l),v=!1}else v=Rg(),o!==null&&o.memoizedState!==null&&(o.memoizedState.hydrationErrors=v),v=!0;if(!v)return l.flags&256?(ai(l),l):(ai(l),null)}return ai(l),(l.flags&128)!==0?(l.lanes=d,l):(d=g!==null,o=o!==null&&o.memoizedState!==null,d&&(g=l.child,v=null,g.alternate!==null&&g.alternate.memoizedState!==null&&g.alternate.memoizedState.cachePool!==null&&(v=g.alternate.memoizedState.cachePool.pool),C=null,g.memoizedState!==null&&g.memoizedState.cachePool!==null&&(C=g.memoizedState.cachePool.pool),C!==v&&(g.flags|=2048)),d!==o&&d&&(l.child.flags|=8192),Ih(l,l.updateQueue),Tn(l),null);case 4:return Se(),o===null&&B1(l.stateNode.containerInfo),Tn(l),null;case 10:return Vo(l.type),Tn(l),null;case 19:if(W(Yn),g=l.memoizedState,g===null)return Tn(l),null;if(v=(l.flags&128)!==0,C=g.rendering,C===null)if(v)Fu(g,!1);else{if(Pn!==0||o!==null&&(o.flags&128)!==0)for(o=l.child;o!==null;){if(C=Ch(o),C!==null){for(l.flags|=128,Fu(g,!1),o=C.updateQueue,l.updateQueue=o,Ih(l,o),l.subtreeFlags=0,o=d,d=l.child;d!==null;)y3(d,o),d=d.sibling;return D(Yn,Yn.current&1|2),Kt&&Ho(l,g.treeForkCount),l.child}o=o.sibling}g.tail!==null&&Ve()>Hh&&(l.flags|=128,v=!0,Fu(g,!1),l.lanes=4194304)}else{if(!v)if(o=Ch(C),o!==null){if(l.flags|=128,v=!0,o=o.updateQueue,l.updateQueue=o,Ih(l,o),Fu(g,!0),g.tail===null&&g.tailMode==="hidden"&&!C.alternate&&!Kt)return Tn(l),null}else 2*Ve()-g.renderingStartTime>Hh&&d!==536870912&&(l.flags|=128,v=!0,Fu(g,!1),l.lanes=4194304);g.isBackwards?(C.sibling=l.child,l.child=C):(o=g.last,o!==null?o.sibling=C:l.child=C,g.last=C)}return g.tail!==null?(o=g.tail,g.rendering=o,g.tail=o.sibling,g.renderingStartTime=Ve(),o.sibling=null,d=Yn.current,D(Yn,v?d&1|2:d&1),Kt&&Ho(l,g.treeForkCount),o):(Tn(l),null);case 22:case 23:return ai(l),Hg(),g=l.memoizedState!==null,o!==null?o.memoizedState!==null!==g&&(l.flags|=8192):g&&(l.flags|=8192),g?(d&536870912)!==0&&(l.flags&128)===0&&(Tn(l),l.subtreeFlags&6&&(l.flags|=8192)):Tn(l),d=l.updateQueue,d!==null&&Ih(l,d.retryQueue),d=null,o!==null&&o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(d=o.memoizedState.cachePool.pool),g=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(g=l.memoizedState.cachePool.pool),g!==d&&(l.flags|=2048),o!==null&&W(Va),null;case 24:return d=null,o!==null&&(d=o.memoizedState.cache),l.memoizedState.cache!==d&&(l.flags|=2048),Vo(Qn),Tn(l),null;case 25:return null;case 30:return null}throw Error(r(156,l.tag))}function $j(o,l){switch(Tg(l),l.tag){case 1:return o=l.flags,o&65536?(l.flags=o&-65537|128,l):null;case 3:return Vo(Qn),Se(),o=l.flags,(o&65536)!==0&&(o&128)===0?(l.flags=o&-65537|128,l):null;case 26:case 27:case 5:return Oe(l),null;case 31:if(l.memoizedState!==null){if(ai(l),l.alternate===null)throw Error(r(340));Ba()}return o=l.flags,o&65536?(l.flags=o&-65537|128,l):null;case 13:if(ai(l),o=l.memoizedState,o!==null&&o.dehydrated!==null){if(l.alternate===null)throw Error(r(340));Ba()}return o=l.flags,o&65536?(l.flags=o&-65537|128,l):null;case 19:return W(Yn),null;case 4:return Se(),null;case 10:return Vo(l.type),null;case 22:case 23:return ai(l),Hg(),o!==null&&W(Va),o=l.flags,o&65536?(l.flags=o&-65537|128,l):null;case 24:return Vo(Qn),null;case 25:return null;default:return null}}function qS(o,l){switch(Tg(l),l.tag){case 3:Vo(Qn),Se();break;case 26:case 27:case 5:Oe(l);break;case 4:Se();break;case 31:l.memoizedState!==null&&ai(l);break;case 13:ai(l);break;case 19:W(Yn);break;case 10:Vo(l.type);break;case 22:case 23:ai(l),Hg(),o!==null&&W(Va);break;case 24:Vo(Qn)}}function Bu(o,l){try{var d=l.updateQueue,g=d!==null?d.lastEffect:null;if(g!==null){var v=g.next;d=v;do{if((d.tag&o)===o){g=void 0;var C=d.create,M=d.inst;g=C(),M.destroy=g}d=d.next}while(d!==v)}}catch(F){pn(l,l.return,F)}}function Ps(o,l,d){try{var g=l.updateQueue,v=g!==null?g.lastEffect:null;if(v!==null){var C=v.next;g=C;do{if((g.tag&o)===o){var M=g.inst,F=M.destroy;if(F!==void 0){M.destroy=void 0,v=l;var X=d,ue=F;try{ue()}catch(ve){pn(v,X,ve)}}}g=g.next}while(g!==C)}}catch(ve){pn(l,l.return,ve)}}function $S(o){var l=o.updateQueue;if(l!==null){var d=o.stateNode;try{L3(l,d)}catch(g){pn(o,o.return,g)}}}function YS(o,l,d){d.props=Ga(o.type,o.memoizedProps),d.state=o.memoizedState;try{d.componentWillUnmount()}catch(g){pn(o,l,g)}}function Hu(o,l){try{var d=o.ref;if(d!==null){switch(o.tag){case 26:case 27:case 5:var g=o.stateNode;break;case 30:g=o.stateNode;break;default:g=o.stateNode}typeof d=="function"?o.refCleanup=d(g):d.current=g}}catch(v){pn(o,l,v)}}function mo(o,l){var d=o.ref,g=o.refCleanup;if(d!==null)if(typeof g=="function")try{g()}catch(v){pn(o,l,v)}finally{o.refCleanup=null,o=o.alternate,o!=null&&(o.refCleanup=null)}else if(typeof d=="function")try{d(null)}catch(v){pn(o,l,v)}else d.current=null}function WS(o){var l=o.type,d=o.memoizedProps,g=o.stateNode;try{e:switch(l){case"button":case"input":case"select":case"textarea":d.autoFocus&&g.focus();break e;case"img":d.src?g.src=d.src:d.srcSet&&(g.srcset=d.srcSet)}}catch(v){pn(o,o.return,v)}}function b1(o,l,d){try{var g=o.stateNode;hM(g,o.type,d,l),g[et]=l}catch(v){pn(o,o.return,v)}}function GS(o){return o.tag===5||o.tag===3||o.tag===26||o.tag===27&&qs(o.type)||o.tag===4}function v1(o){e:for(;;){for(;o.sibling===null;){if(o.return===null||GS(o.return))return null;o=o.return}for(o.sibling.return=o.return,o=o.sibling;o.tag!==5&&o.tag!==6&&o.tag!==18;){if(o.tag===27&&qs(o.type)||o.flags&2||o.child===null||o.tag===4)continue e;o.child.return=o,o=o.child}if(!(o.flags&2))return o.stateNode}}function w1(o,l,d){var g=o.tag;if(g===5||g===6)o=o.stateNode,l?(d.nodeType===9?d.body:d.nodeName==="HTML"?d.ownerDocument.body:d).insertBefore(o,l):(l=d.nodeType===9?d.body:d.nodeName==="HTML"?d.ownerDocument.body:d,l.appendChild(o),d=d._reactRootContainer,d!=null||l.onclick!==null||(l.onclick=zo));else if(g!==4&&(g===27&&qs(o.type)&&(d=o.stateNode,l=null),o=o.child,o!==null))for(w1(o,l,d),o=o.sibling;o!==null;)w1(o,l,d),o=o.sibling}function Ph(o,l,d){var g=o.tag;if(g===5||g===6)o=o.stateNode,l?d.insertBefore(o,l):d.appendChild(o);else if(g!==4&&(g===27&&qs(o.type)&&(d=o.stateNode),o=o.child,o!==null))for(Ph(o,l,d),o=o.sibling;o!==null;)Ph(o,l,d),o=o.sibling}function KS(o){var l=o.stateNode,d=o.memoizedProps;try{for(var g=o.type,v=l.attributes;v.length;)l.removeAttributeNode(v[0]);wr(l,g,d),l[Xe]=o,l[et]=d}catch(C){pn(o,o.return,C)}}var Go=!1,Jn=!1,S1=!1,QS=typeof WeakSet=="function"?WeakSet:Set,fr=null;function Yj(o,l){if(o=o.containerInfo,V1=ip,o=l3(o),mg(o)){if("selectionStart"in o)var d={start:o.selectionStart,end:o.selectionEnd};else e:{d=(d=o.ownerDocument)&&d.defaultView||window;var g=d.getSelection&&d.getSelection();if(g&&g.rangeCount!==0){d=g.anchorNode;var v=g.anchorOffset,C=g.focusNode;g=g.focusOffset;try{d.nodeType,C.nodeType}catch{d=null;break e}var M=0,F=-1,X=-1,ue=0,ve=0,Ne=o,de=null;t:for(;;){for(var me;Ne!==d||v!==0&&Ne.nodeType!==3||(F=M+v),Ne!==C||g!==0&&Ne.nodeType!==3||(X=M+g),Ne.nodeType===3&&(M+=Ne.nodeValue.length),(me=Ne.firstChild)!==null;)de=Ne,Ne=me;for(;;){if(Ne===o)break t;if(de===d&&++ue===v&&(F=M),de===C&&++ve===g&&(X=M),(me=Ne.nextSibling)!==null)break;Ne=de,de=Ne.parentNode}Ne=me}d=F===-1||X===-1?null:{start:F,end:X}}else d=null}d=d||{start:0,end:0}}else d=null;for(q1={focusedElem:o,selectionRange:d},ip=!1,fr=l;fr!==null;)if(l=fr,o=l.child,(l.subtreeFlags&1028)!==0&&o!==null)o.return=l,fr=o;else for(;fr!==null;){switch(l=fr,C=l.alternate,o=l.flags,l.tag){case 0:if((o&4)!==0&&(o=l.updateQueue,o=o!==null?o.events:null,o!==null))for(d=0;d<o.length;d++)v=o[d],v.ref.impl=v.nextImpl;break;case 11:case 15:break;case 1:if((o&1024)!==0&&C!==null){o=void 0,d=l,v=C.memoizedProps,C=C.memoizedState,g=d.stateNode;try{var rt=Ga(d.type,v);o=g.getSnapshotBeforeUpdate(rt,C),g.__reactInternalSnapshotBeforeUpdate=o}catch(wt){pn(d,d.return,wt)}}break;case 3:if((o&1024)!==0){if(o=l.stateNode.containerInfo,d=o.nodeType,d===9)W1(o);else if(d===1)switch(o.nodeName){case"HEAD":case"HTML":case"BODY":W1(o);break;default:o.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((o&1024)!==0)throw Error(r(163))}if(o=l.sibling,o!==null){o.return=l.return,fr=o;break}fr=l.return}}function XS(o,l,d){var g=d.flags;switch(d.tag){case 0:case 11:case 15:Qo(o,d),g&4&&Bu(5,d);break;case 1:if(Qo(o,d),g&4)if(o=d.stateNode,l===null)try{o.componentDidMount()}catch(M){pn(d,d.return,M)}else{var v=Ga(d.type,l.memoizedProps);l=l.memoizedState;try{o.componentDidUpdate(v,l,o.__reactInternalSnapshotBeforeUpdate)}catch(M){pn(d,d.return,M)}}g&64&&$S(d),g&512&&Hu(d,d.return);break;case 3:if(Qo(o,d),g&64&&(o=d.updateQueue,o!==null)){if(l=null,d.child!==null)switch(d.child.tag){case 27:case 5:l=d.child.stateNode;break;case 1:l=d.child.stateNode}try{L3(o,l)}catch(M){pn(d,d.return,M)}}break;case 27:l===null&&g&4&&KS(d);case 26:case 5:Qo(o,d),l===null&&g&4&&WS(d),g&512&&Hu(d,d.return);break;case 12:Qo(o,d);break;case 31:Qo(o,d),g&4&&eC(o,d);break;case 13:Qo(o,d),g&4&&tC(o,d),g&64&&(o=d.memoizedState,o!==null&&(o=o.dehydrated,o!==null&&(d=tM.bind(null,d),wM(o,d))));break;case 22:if(g=d.memoizedState!==null||Go,!g){l=l!==null&&l.memoizedState!==null||Jn,v=Go;var C=Jn;Go=g,(Jn=l)&&!C?Xo(o,d,(d.subtreeFlags&8772)!==0):Qo(o,d),Go=v,Jn=C}break;case 30:break;default:Qo(o,d)}}function ZS(o){var l=o.alternate;l!==null&&(o.alternate=null,ZS(l)),o.child=null,o.deletions=null,o.sibling=null,o.tag===5&&(l=o.stateNode,l!==null&&_n(l)),o.stateNode=null,o.return=null,o.dependencies=null,o.memoizedProps=null,o.memoizedState=null,o.pendingProps=null,o.stateNode=null,o.updateQueue=null}var An=null,qr=!1;function Ko(o,l,d){for(d=d.child;d!==null;)JS(o,l,d),d=d.sibling}function JS(o,l,d){if(Ke&&typeof Ke.onCommitFiberUnmount=="function")try{Ke.onCommitFiberUnmount(Je,d)}catch{}switch(d.tag){case 26:Jn||mo(d,l),Ko(o,l,d),d.memoizedState?d.memoizedState.count--:d.stateNode&&(d=d.stateNode,d.parentNode.removeChild(d));break;case 27:Jn||mo(d,l);var g=An,v=qr;qs(d.type)&&(An=d.stateNode,qr=!1),Ko(o,l,d),Qu(d.stateNode),An=g,qr=v;break;case 5:Jn||mo(d,l);case 6:if(g=An,v=qr,An=null,Ko(o,l,d),An=g,qr=v,An!==null)if(qr)try{(An.nodeType===9?An.body:An.nodeName==="HTML"?An.ownerDocument.body:An).removeChild(d.stateNode)}catch(C){pn(d,l,C)}else try{An.removeChild(d.stateNode)}catch(C){pn(d,l,C)}break;case 18:An!==null&&(qr?(o=An,$C(o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o,d.stateNode),cc(o)):$C(An,d.stateNode));break;case 4:g=An,v=qr,An=d.stateNode.containerInfo,qr=!0,Ko(o,l,d),An=g,qr=v;break;case 0:case 11:case 14:case 15:Ps(2,d,l),Jn||Ps(4,d,l),Ko(o,l,d);break;case 1:Jn||(mo(d,l),g=d.stateNode,typeof g.componentWillUnmount=="function"&&YS(d,l,g)),Ko(o,l,d);break;case 21:Ko(o,l,d);break;case 22:Jn=(g=Jn)||d.memoizedState!==null,Ko(o,l,d),Jn=g;break;default:Ko(o,l,d)}}function eC(o,l){if(l.memoizedState===null&&(o=l.alternate,o!==null&&(o=o.memoizedState,o!==null))){o=o.dehydrated;try{cc(o)}catch(d){pn(l,l.return,d)}}}function tC(o,l){if(l.memoizedState===null&&(o=l.alternate,o!==null&&(o=o.memoizedState,o!==null&&(o=o.dehydrated,o!==null))))try{cc(o)}catch(d){pn(l,l.return,d)}}function Wj(o){switch(o.tag){case 31:case 13:case 19:var l=o.stateNode;return l===null&&(l=o.stateNode=new QS),l;case 22:return o=o.stateNode,l=o._retryCache,l===null&&(l=o._retryCache=new QS),l;default:throw Error(r(435,o.tag))}}function zh(o,l){var d=Wj(o);l.forEach(function(g){if(!d.has(g)){d.add(g);var v=nM.bind(null,o,g);g.then(v,v)}})}function $r(o,l){var d=l.deletions;if(d!==null)for(var g=0;g<d.length;g++){var v=d[g],C=o,M=l,F=M;e:for(;F!==null;){switch(F.tag){case 27:if(qs(F.type)){An=F.stateNode,qr=!1;break e}break;case 5:An=F.stateNode,qr=!1;break e;case 3:case 4:An=F.stateNode.containerInfo,qr=!0;break e}F=F.return}if(An===null)throw Error(r(160));JS(C,M,v),An=null,qr=!1,C=v.alternate,C!==null&&(C.return=null),v.return=null}if(l.subtreeFlags&13886)for(l=l.child;l!==null;)nC(l,o),l=l.sibling}var eo=null;function nC(o,l){var d=o.alternate,g=o.flags;switch(o.tag){case 0:case 11:case 14:case 15:$r(l,o),Yr(o),g&4&&(Ps(3,o,o.return),Bu(3,o),Ps(5,o,o.return));break;case 1:$r(l,o),Yr(o),g&512&&(Jn||d===null||mo(d,d.return)),g&64&&Go&&(o=o.updateQueue,o!==null&&(g=o.callbacks,g!==null&&(d=o.shared.hiddenCallbacks,o.shared.hiddenCallbacks=d===null?g:d.concat(g))));break;case 26:var v=eo;if($r(l,o),Yr(o),g&512&&(Jn||d===null||mo(d,d.return)),g&4){var C=d!==null?d.memoizedState:null;if(g=o.memoizedState,d===null)if(g===null)if(o.stateNode===null){e:{g=o.type,d=o.memoizedProps,v=v.ownerDocument||v;t:switch(g){case"title":C=v.getElementsByTagName("title")[0],(!C||C[Mn]||C[Xe]||C.namespaceURI==="http://www.w3.org/2000/svg"||C.hasAttribute("itemprop"))&&(C=v.createElement(g),v.head.insertBefore(C,v.querySelector("head > title"))),wr(C,g,d),C[Xe]=o,Rn(C),g=C;break e;case"link":var M=n5("link","href",v).get(g+(d.href||""));if(M){for(var F=0;F<M.length;F++)if(C=M[F],C.getAttribute("href")===(d.href==null||d.href===""?null:d.href)&&C.getAttribute("rel")===(d.rel==null?null:d.rel)&&C.getAttribute("title")===(d.title==null?null:d.title)&&C.getAttribute("crossorigin")===(d.crossOrigin==null?null:d.crossOrigin)){M.splice(F,1);break t}}C=v.createElement(g),wr(C,g,d),v.head.appendChild(C);break;case"meta":if(M=n5("meta","content",v).get(g+(d.content||""))){for(F=0;F<M.length;F++)if(C=M[F],C.getAttribute("content")===(d.content==null?null:""+d.content)&&C.getAttribute("name")===(d.name==null?null:d.name)&&C.getAttribute("property")===(d.property==null?null:d.property)&&C.getAttribute("http-equiv")===(d.httpEquiv==null?null:d.httpEquiv)&&C.getAttribute("charset")===(d.charSet==null?null:d.charSet)){M.splice(F,1);break t}}C=v.createElement(g),wr(C,g,d),v.head.appendChild(C);break;default:throw Error(r(468,g))}C[Xe]=o,Rn(C),g=C}o.stateNode=g}else r5(v,o.type,o.stateNode);else o.stateNode=t5(v,g,o.memoizedProps);else C!==g?(C===null?d.stateNode!==null&&(d=d.stateNode,d.parentNode.removeChild(d)):C.count--,g===null?r5(v,o.type,o.stateNode):t5(v,g,o.memoizedProps)):g===null&&o.stateNode!==null&&b1(o,o.memoizedProps,d.memoizedProps)}break;case 27:$r(l,o),Yr(o),g&512&&(Jn||d===null||mo(d,d.return)),d!==null&&g&4&&b1(o,o.memoizedProps,d.memoizedProps);break;case 5:if($r(l,o),Yr(o),g&512&&(Jn||d===null||mo(d,d.return)),o.flags&32){v=o.stateNode;try{Ml(v,"")}catch(rt){pn(o,o.return,rt)}}g&4&&o.stateNode!=null&&(v=o.memoizedProps,b1(o,v,d!==null?d.memoizedProps:v)),g&1024&&(S1=!0);break;case 6:if($r(l,o),Yr(o),g&4){if(o.stateNode===null)throw Error(r(162));g=o.memoizedProps,d=o.stateNode;try{d.nodeValue=g}catch(rt){pn(o,o.return,rt)}}break;case 3:if(ep=null,v=eo,eo=Zh(l.containerInfo),$r(l,o),eo=v,Yr(o),g&4&&d!==null&&d.memoizedState.isDehydrated)try{cc(l.containerInfo)}catch(rt){pn(o,o.return,rt)}S1&&(S1=!1,rC(o));break;case 4:g=eo,eo=Zh(o.stateNode.containerInfo),$r(l,o),Yr(o),eo=g;break;case 12:$r(l,o),Yr(o);break;case 31:$r(l,o),Yr(o),g&4&&(g=o.updateQueue,g!==null&&(o.updateQueue=null,zh(o,g)));break;case 13:$r(l,o),Yr(o),o.child.flags&8192&&o.memoizedState!==null!=(d!==null&&d.memoizedState!==null)&&(Bh=Ve()),g&4&&(g=o.updateQueue,g!==null&&(o.updateQueue=null,zh(o,g)));break;case 22:v=o.memoizedState!==null;var X=d!==null&&d.memoizedState!==null,ue=Go,ve=Jn;if(Go=ue||v,Jn=ve||X,$r(l,o),Jn=ve,Go=ue,Yr(o),g&8192)e:for(l=o.stateNode,l._visibility=v?l._visibility&-2:l._visibility|1,v&&(d===null||X||Go||Jn||Ka(o)),d=null,l=o;;){if(l.tag===5||l.tag===26){if(d===null){X=d=l;try{if(C=X.stateNode,v)M=C.style,typeof M.setProperty=="function"?M.setProperty("display","none","important"):M.display="none";else{F=X.stateNode;var Ne=X.memoizedProps.style,de=Ne!=null&&Ne.hasOwnProperty("display")?Ne.display:null;F.style.display=de==null||typeof de=="boolean"?"":(""+de).trim()}}catch(rt){pn(X,X.return,rt)}}}else if(l.tag===6){if(d===null){X=l;try{X.stateNode.nodeValue=v?"":X.memoizedProps}catch(rt){pn(X,X.return,rt)}}}else if(l.tag===18){if(d===null){X=l;try{var me=X.stateNode;v?YC(me,!0):YC(X.stateNode,!1)}catch(rt){pn(X,X.return,rt)}}}else if((l.tag!==22&&l.tag!==23||l.memoizedState===null||l===o)&&l.child!==null){l.child.return=l,l=l.child;continue}if(l===o)break e;for(;l.sibling===null;){if(l.return===null||l.return===o)break e;d===l&&(d=null),l=l.return}d===l&&(d=null),l.sibling.return=l.return,l=l.sibling}g&4&&(g=o.updateQueue,g!==null&&(d=g.retryQueue,d!==null&&(g.retryQueue=null,zh(o,d))));break;case 19:$r(l,o),Yr(o),g&4&&(g=o.updateQueue,g!==null&&(o.updateQueue=null,zh(o,g)));break;case 30:break;case 21:break;default:$r(l,o),Yr(o)}}function Yr(o){var l=o.flags;if(l&2){try{for(var d,g=o.return;g!==null;){if(GS(g)){d=g;break}g=g.return}if(d==null)throw Error(r(160));switch(d.tag){case 27:var v=d.stateNode,C=v1(o);Ph(o,C,v);break;case 5:var M=d.stateNode;d.flags&32&&(Ml(M,""),d.flags&=-33);var F=v1(o);Ph(o,F,M);break;case 3:case 4:var X=d.stateNode.containerInfo,ue=v1(o);w1(o,ue,X);break;default:throw Error(r(161))}}catch(ve){pn(o,o.return,ve)}o.flags&=-3}l&4096&&(o.flags&=-4097)}function rC(o){if(o.subtreeFlags&1024)for(o=o.child;o!==null;){var l=o;rC(l),l.tag===5&&l.flags&1024&&l.stateNode.reset(),o=o.sibling}}function Qo(o,l){if(l.subtreeFlags&8772)for(l=l.child;l!==null;)XS(o,l.alternate,l),l=l.sibling}function Ka(o){for(o=o.child;o!==null;){var l=o;switch(l.tag){case 0:case 11:case 14:case 15:Ps(4,l,l.return),Ka(l);break;case 1:mo(l,l.return);var d=l.stateNode;typeof d.componentWillUnmount=="function"&&YS(l,l.return,d),Ka(l);break;case 27:Qu(l.stateNode);case 26:case 5:mo(l,l.return),Ka(l);break;case 22:l.memoizedState===null&&Ka(l);break;case 30:Ka(l);break;default:Ka(l)}o=o.sibling}}function Xo(o,l,d){for(d=d&&(l.subtreeFlags&8772)!==0,l=l.child;l!==null;){var g=l.alternate,v=o,C=l,M=C.flags;switch(C.tag){case 0:case 11:case 15:Xo(v,C,d),Bu(4,C);break;case 1:if(Xo(v,C,d),g=C,v=g.stateNode,typeof v.componentDidMount=="function")try{v.componentDidMount()}catch(ue){pn(g,g.return,ue)}if(g=C,v=g.updateQueue,v!==null){var F=g.stateNode;try{var X=v.shared.hiddenCallbacks;if(X!==null)for(v.shared.hiddenCallbacks=null,v=0;v<X.length;v++)_3(X[v],F)}catch(ue){pn(g,g.return,ue)}}d&&M&64&&$S(C),Hu(C,C.return);break;case 27:KS(C);case 26:case 5:Xo(v,C,d),d&&g===null&&M&4&&WS(C),Hu(C,C.return);break;case 12:Xo(v,C,d);break;case 31:Xo(v,C,d),d&&M&4&&eC(v,C);break;case 13:Xo(v,C,d),d&&M&4&&tC(v,C);break;case 22:C.memoizedState===null&&Xo(v,C,d),Hu(C,C.return);break;case 30:break;default:Xo(v,C,d)}l=l.sibling}}function C1(o,l){var d=null;o!==null&&o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(d=o.memoizedState.cachePool.pool),o=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(o=l.memoizedState.cachePool.pool),o!==d&&(o!=null&&o.refCount++,d!=null&&Nu(d))}function k1(o,l){o=null,l.alternate!==null&&(o=l.alternate.memoizedState.cache),l=l.memoizedState.cache,l!==o&&(l.refCount++,o!=null&&Nu(o))}function to(o,l,d,g){if(l.subtreeFlags&10256)for(l=l.child;l!==null;)iC(o,l,d,g),l=l.sibling}function iC(o,l,d,g){var v=l.flags;switch(l.tag){case 0:case 11:case 15:to(o,l,d,g),v&2048&&Bu(9,l);break;case 1:to(o,l,d,g);break;case 3:to(o,l,d,g),v&2048&&(o=null,l.alternate!==null&&(o=l.alternate.memoizedState.cache),l=l.memoizedState.cache,l!==o&&(l.refCount++,o!=null&&Nu(o)));break;case 12:if(v&2048){to(o,l,d,g),o=l.stateNode;try{var C=l.memoizedProps,M=C.id,F=C.onPostCommit;typeof F=="function"&&F(M,l.alternate===null?"mount":"update",o.passiveEffectDuration,-0)}catch(X){pn(l,l.return,X)}}else to(o,l,d,g);break;case 31:to(o,l,d,g);break;case 13:to(o,l,d,g);break;case 23:break;case 22:C=l.stateNode,M=l.alternate,l.memoizedState!==null?C._visibility&2?to(o,l,d,g):Uu(o,l):C._visibility&2?to(o,l,d,g):(C._visibility|=2,Zl(o,l,d,g,(l.subtreeFlags&10256)!==0||!1)),v&2048&&C1(M,l);break;case 24:to(o,l,d,g),v&2048&&k1(l.alternate,l);break;default:to(o,l,d,g)}}function Zl(o,l,d,g,v){for(v=v&&((l.subtreeFlags&10256)!==0||!1),l=l.child;l!==null;){var C=o,M=l,F=d,X=g,ue=M.flags;switch(M.tag){case 0:case 11:case 15:Zl(C,M,F,X,v),Bu(8,M);break;case 23:break;case 22:var ve=M.stateNode;M.memoizedState!==null?ve._visibility&2?Zl(C,M,F,X,v):Uu(C,M):(ve._visibility|=2,Zl(C,M,F,X,v)),v&&ue&2048&&C1(M.alternate,M);break;case 24:Zl(C,M,F,X,v),v&&ue&2048&&k1(M.alternate,M);break;default:Zl(C,M,F,X,v)}l=l.sibling}}function Uu(o,l){if(l.subtreeFlags&10256)for(l=l.child;l!==null;){var d=o,g=l,v=g.flags;switch(g.tag){case 22:Uu(d,g),v&2048&&C1(g.alternate,g);break;case 24:Uu(d,g),v&2048&&k1(g.alternate,g);break;default:Uu(d,g)}l=l.sibling}}var Vu=8192;function Jl(o,l,d){if(o.subtreeFlags&Vu)for(o=o.child;o!==null;)oC(o,l,d),o=o.sibling}function oC(o,l,d){switch(o.tag){case 26:Jl(o,l,d),o.flags&Vu&&o.memoizedState!==null&&DM(d,eo,o.memoizedState,o.memoizedProps);break;case 5:Jl(o,l,d);break;case 3:case 4:var g=eo;eo=Zh(o.stateNode.containerInfo),Jl(o,l,d),eo=g;break;case 22:o.memoizedState===null&&(g=o.alternate,g!==null&&g.memoizedState!==null?(g=Vu,Vu=16777216,Jl(o,l,d),Vu=g):Jl(o,l,d));break;default:Jl(o,l,d)}}function sC(o){var l=o.alternate;if(l!==null&&(o=l.child,o!==null)){l.child=null;do l=o.sibling,o.sibling=null,o=l;while(o!==null)}}function qu(o){var l=o.deletions;if((o.flags&16)!==0){if(l!==null)for(var d=0;d<l.length;d++){var g=l[d];fr=g,lC(g,o)}sC(o)}if(o.subtreeFlags&10256)for(o=o.child;o!==null;)aC(o),o=o.sibling}function aC(o){switch(o.tag){case 0:case 11:case 15:qu(o),o.flags&2048&&Ps(9,o,o.return);break;case 3:qu(o);break;case 12:qu(o);break;case 22:var l=o.stateNode;o.memoizedState!==null&&l._visibility&2&&(o.return===null||o.return.tag!==13)?(l._visibility&=-3,Fh(o)):qu(o);break;default:qu(o)}}function Fh(o){var l=o.deletions;if((o.flags&16)!==0){if(l!==null)for(var d=0;d<l.length;d++){var g=l[d];fr=g,lC(g,o)}sC(o)}for(o=o.child;o!==null;){switch(l=o,l.tag){case 0:case 11:case 15:Ps(8,l,l.return),Fh(l);break;case 22:d=l.stateNode,d._visibility&2&&(d._visibility&=-3,Fh(l));break;default:Fh(l)}o=o.sibling}}function lC(o,l){for(;fr!==null;){var d=fr;switch(d.tag){case 0:case 11:case 15:Ps(8,d,l);break;case 23:case 22:if(d.memoizedState!==null&&d.memoizedState.cachePool!==null){var g=d.memoizedState.cachePool.pool;g!=null&&g.refCount++}break;case 24:Nu(d.memoizedState.cache)}if(g=d.child,g!==null)g.return=d,fr=g;else e:for(d=o;fr!==null;){g=fr;var v=g.sibling,C=g.return;if(ZS(g),g===d){fr=null;break e}if(v!==null){v.return=C,fr=v;break e}fr=C}}}var Gj={getCacheForType:function(o){var l=br(Qn),d=l.data.get(o);return d===void 0&&(d=o(),l.data.set(o,d)),d},cacheSignal:function(){return br(Qn).controller.signal}},Kj=typeof WeakMap=="function"?WeakMap:Map,sn=0,wn=null,Ft=null,Vt=0,hn=0,li=null,zs=!1,ec=!1,E1=!1,Zo=0,Pn=0,Fs=0,Qa=0,T1=0,ci=0,tc=0,$u=null,Wr=null,N1=!1,Bh=0,cC=0,Hh=1/0,Uh=null,Bs=null,sr=0,Hs=null,nc=null,Jo=0,R1=0,A1=null,uC=null,Yu=0,O1=null;function ui(){return(sn&2)!==0&&Vt!==0?Vt&-Vt:z.T!==null?I1():Be()}function dC(){if(ci===0)if((Vt&536870912)===0||Kt){var o=je;je<<=1,(je&3932160)===0&&(je=262144),ci=o}else ci=536870912;return o=si.current,o!==null&&(o.flags|=32),ci}function Gr(o,l,d){(o===wn&&(hn===2||hn===9)||o.cancelPendingCommit!==null)&&(rc(o,0),Us(o,Vt,ci,!1)),Ut(o,d),((sn&2)===0||o!==wn)&&(o===wn&&((sn&2)===0&&(Qa|=d),Pn===4&&Us(o,Vt,ci,!1)),go(o))}function fC(o,l,d){if((sn&6)!==0)throw Error(r(327));var g=!d&&(l&127)===0&&(l&o.expiredLanes)===0||Pt(o,l),v=g?Zj(o,l):M1(o,l,!0),C=g;do{if(v===0){ec&&!g&&Us(o,l,0,!1);break}else{if(d=o.current.alternate,C&&!Qj(d)){v=M1(o,l,!1),C=!1;continue}if(v===2){if(C=l,o.errorRecoveryDisabledLanes&C)var M=0;else M=o.pendingLanes&-536870913,M=M!==0?M:M&536870912?536870912:0;if(M!==0){l=M;e:{var F=o;v=$u;var X=F.current.memoizedState.isDehydrated;if(X&&(rc(F,M).flags|=256),M=M1(F,M,!1),M!==2){if(E1&&!X){F.errorRecoveryDisabledLanes|=C,Qa|=C,v=4;break e}C=Wr,Wr=v,C!==null&&(Wr===null?Wr=C:Wr.push.apply(Wr,C))}v=M}if(C=!1,v!==2)continue}}if(v===1){rc(o,0),Us(o,l,0,!0);break}e:{switch(g=o,C=v,C){case 0:case 1:throw Error(r(345));case 4:if((l&4194048)!==l)break;case 6:Us(g,l,ci,!zs);break e;case 2:Wr=null;break;case 3:case 5:break;default:throw Error(r(329))}if((l&62914560)===l&&(v=Bh+300-Ve(),10<v)){if(Us(g,l,ci,!zs),Ie(g,0,!0)!==0)break e;Jo=l,g.timeoutHandle=VC(hC.bind(null,g,d,Wr,Uh,N1,l,ci,Qa,tc,zs,C,"Throttled",-0,0),v);break e}hC(g,d,Wr,Uh,N1,l,ci,Qa,tc,zs,C,null,-0,0)}}break}while(!0);go(o)}function hC(o,l,d,g,v,C,M,F,X,ue,ve,Ne,de,me){if(o.timeoutHandle=-1,Ne=l.subtreeFlags,Ne&8192||(Ne&16785408)===16785408){Ne={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:zo},oC(l,C,Ne);var rt=(C&62914560)===C?Bh-Ve():(C&4194048)===C?cC-Ve():0;if(rt=_M(Ne,rt),rt!==null){Jo=C,o.cancelPendingCommit=rt(wC.bind(null,o,l,C,d,g,v,M,F,X,ve,Ne,null,de,me)),Us(o,C,M,!ue);return}}wC(o,l,C,d,g,v,M,F,X)}function Qj(o){for(var l=o;;){var d=l.tag;if((d===0||d===11||d===15)&&l.flags&16384&&(d=l.updateQueue,d!==null&&(d=d.stores,d!==null)))for(var g=0;g<d.length;g++){var v=d[g],C=v.getSnapshot;v=v.value;try{if(!ii(C(),v))return!1}catch{return!1}}if(d=l.child,l.subtreeFlags&16384&&d!==null)d.return=l,l=d;else{if(l===o)break;for(;l.sibling===null;){if(l.return===null||l.return===o)return!0;l=l.return}l.sibling.return=l.return,l=l.sibling}}return!0}function Us(o,l,d,g){l&=~T1,l&=~Qa,o.suspendedLanes|=l,o.pingedLanes&=~l,g&&(o.warmLanes|=l),g=o.expirationTimes;for(var v=l;0<v;){var C=31-nt(v),M=1<<C;g[C]=-1,v&=~M}d!==0&&zt(o,d,l)}function Vh(){return(sn&6)===0?(Wu(0),!1):!0}function j1(){if(Ft!==null){if(hn===0)var o=Ft.return;else o=Ft,Uo=Ha=null,Wg(o),Wl=null,Au=0,o=Ft;for(;o!==null;)qS(o.alternate,o),o=o.return;Ft=null}}function rc(o,l){var d=o.timeoutHandle;d!==-1&&(o.timeoutHandle=-1,gM(d)),d=o.cancelPendingCommit,d!==null&&(o.cancelPendingCommit=null,d()),Jo=0,j1(),wn=o,Ft=d=Bo(o.current,null),Vt=l,hn=0,li=null,zs=!1,ec=Pt(o,l),E1=!1,tc=ci=T1=Qa=Fs=Pn=0,Wr=$u=null,N1=!1,(l&8)!==0&&(l|=l&32);var g=o.entangledLanes;if(g!==0)for(o=o.entanglements,g&=l;0<g;){var v=31-nt(g),C=1<<v;l|=o[v],g&=~C}return Zo=l,uh(),d}function pC(o,l){Ot=null,z.H=Pu,l===Yl||l===xh?(l=O3(),hn=3):l===Lg?(l=O3(),hn=4):hn=l===c1?8:l!==null&&typeof l=="object"&&typeof l.then=="function"?6:1,li=l,Ft===null&&(Pn=1,Mh(o,ji(l,o.current)))}function mC(){var o=si.current;return o===null?!0:(Vt&4194048)===Vt?Li===null:(Vt&62914560)===Vt||(Vt&536870912)!==0?o===Li:!1}function gC(){var o=z.H;return z.H=Pu,o===null?Pu:o}function yC(){var o=z.A;return z.A=Gj,o}function qh(){Pn=4,zs||(Vt&4194048)!==Vt&&si.current!==null||(ec=!0),(Fs&134217727)===0&&(Qa&134217727)===0||wn===null||Us(wn,Vt,ci,!1)}function M1(o,l,d){var g=sn;sn|=2;var v=gC(),C=yC();(wn!==o||Vt!==l)&&(Uh=null,rc(o,l)),l=!1;var M=Pn;e:do try{if(hn!==0&&Ft!==null){var F=Ft,X=li;switch(hn){case 8:j1(),M=6;break e;case 3:case 2:case 9:case 6:si.current===null&&(l=!0);var ue=hn;if(hn=0,li=null,ic(o,F,X,ue),d&&ec){M=0;break e}break;default:ue=hn,hn=0,li=null,ic(o,F,X,ue)}}Xj(),M=Pn;break}catch(ve){pC(o,ve)}while(!0);return l&&o.shellSuspendCounter++,Uo=Ha=null,sn=g,z.H=v,z.A=C,Ft===null&&(wn=null,Vt=0,uh()),M}function Xj(){for(;Ft!==null;)xC(Ft)}function Zj(o,l){var d=sn;sn|=2;var g=gC(),v=yC();wn!==o||Vt!==l?(Uh=null,Hh=Ve()+500,rc(o,l)):ec=Pt(o,l);e:do try{if(hn!==0&&Ft!==null){l=Ft;var C=li;t:switch(hn){case 1:hn=0,li=null,ic(o,l,C,1);break;case 2:case 9:if(R3(C)){hn=0,li=null,bC(l);break}l=function(){hn!==2&&hn!==9||wn!==o||(hn=7),go(o)},C.then(l,l);break e;case 3:hn=7;break e;case 4:hn=5;break e;case 7:R3(C)?(hn=0,li=null,bC(l)):(hn=0,li=null,ic(o,l,C,7));break;case 5:var M=null;switch(Ft.tag){case 26:M=Ft.memoizedState;case 5:case 27:var F=Ft;if(M?i5(M):F.stateNode.complete){hn=0,li=null;var X=F.sibling;if(X!==null)Ft=X;else{var ue=F.return;ue!==null?(Ft=ue,$h(ue)):Ft=null}break t}}hn=0,li=null,ic(o,l,C,5);break;case 6:hn=0,li=null,ic(o,l,C,6);break;case 8:j1(),Pn=6;break e;default:throw Error(r(462))}}Jj();break}catch(ve){pC(o,ve)}while(!0);return Uo=Ha=null,z.H=g,z.A=v,sn=d,Ft!==null?0:(wn=null,Vt=0,uh(),Pn)}function Jj(){for(;Ft!==null&&!ye();)xC(Ft)}function xC(o){var l=US(o.alternate,o,Zo);o.memoizedProps=o.pendingProps,l===null?$h(o):Ft=l}function bC(o){var l=o,d=l.alternate;switch(l.tag){case 15:case 0:l=IS(d,l,l.pendingProps,l.type,void 0,Vt);break;case 11:l=IS(d,l,l.pendingProps,l.type.render,l.ref,Vt);break;case 5:Wg(l);default:qS(d,l),l=Ft=y3(l,Zo),l=US(d,l,Zo)}o.memoizedProps=o.pendingProps,l===null?$h(o):Ft=l}function ic(o,l,d,g){Uo=Ha=null,Wg(l),Wl=null,Au=0;var v=l.return;try{if(Hj(o,v,l,d,Vt)){Pn=1,Mh(o,ji(d,o.current)),Ft=null;return}}catch(C){if(v!==null)throw Ft=v,C;Pn=1,Mh(o,ji(d,o.current)),Ft=null;return}l.flags&32768?(Kt||g===1?o=!0:ec||(Vt&536870912)!==0?o=!1:(zs=o=!0,(g===2||g===9||g===3||g===6)&&(g=si.current,g!==null&&g.tag===13&&(g.flags|=16384))),vC(l,o)):$h(l)}function $h(o){var l=o;do{if((l.flags&32768)!==0){vC(l,zs);return}o=l.return;var d=qj(l.alternate,l,Zo);if(d!==null){Ft=d;return}if(l=l.sibling,l!==null){Ft=l;return}Ft=l=o}while(l!==null);Pn===0&&(Pn=5)}function vC(o,l){do{var d=$j(o.alternate,o);if(d!==null){d.flags&=32767,Ft=d;return}if(d=o.return,d!==null&&(d.flags|=32768,d.subtreeFlags=0,d.deletions=null),!l&&(o=o.sibling,o!==null)){Ft=o;return}Ft=o=d}while(o!==null);Pn=6,Ft=null}function wC(o,l,d,g,v,C,M,F,X){o.cancelPendingCommit=null;do Yh();while(sr!==0);if((sn&6)!==0)throw Error(r(327));if(l!==null){if(l===o.current)throw Error(r(177));if(C=l.lanes|l.childLanes,C|=vg,yt(o,d,C,M,F,X),o===wn&&(Ft=wn=null,Vt=0),nc=l,Hs=o,Jo=d,R1=C,A1=v,uC=g,(l.subtreeFlags&10256)!==0||(l.flags&10256)!==0?(o.callbackNode=null,o.callbackPriority=0,rM(Le,function(){return TC(),null})):(o.callbackNode=null,o.callbackPriority=0),g=(l.flags&13878)!==0,(l.subtreeFlags&13878)!==0||g){g=z.T,z.T=null,v=$.p,$.p=2,M=sn,sn|=4;try{Yj(o,l,d)}finally{sn=M,$.p=v,z.T=g}}sr=1,SC(),CC(),kC()}}function SC(){if(sr===1){sr=0;var o=Hs,l=nc,d=(l.flags&13878)!==0;if((l.subtreeFlags&13878)!==0||d){d=z.T,z.T=null;var g=$.p;$.p=2;var v=sn;sn|=4;try{nC(l,o);var C=q1,M=l3(o.containerInfo),F=C.focusedElem,X=C.selectionRange;if(M!==F&&F&&F.ownerDocument&&a3(F.ownerDocument.documentElement,F)){if(X!==null&&mg(F)){var ue=X.start,ve=X.end;if(ve===void 0&&(ve=ue),"selectionStart"in F)F.selectionStart=ue,F.selectionEnd=Math.min(ve,F.value.length);else{var Ne=F.ownerDocument||document,de=Ne&&Ne.defaultView||window;if(de.getSelection){var me=de.getSelection(),rt=F.textContent.length,wt=Math.min(X.start,rt),xn=X.end===void 0?wt:Math.min(X.end,rt);!me.extend&&wt>xn&&(M=xn,xn=wt,wt=M);var ie=s3(F,wt),re=s3(F,xn);if(ie&&re&&(me.rangeCount!==1||me.anchorNode!==ie.node||me.anchorOffset!==ie.offset||me.focusNode!==re.node||me.focusOffset!==re.offset)){var ce=Ne.createRange();ce.setStart(ie.node,ie.offset),me.removeAllRanges(),wt>xn?(me.addRange(ce),me.extend(re.node,re.offset)):(ce.setEnd(re.node,re.offset),me.addRange(ce))}}}}for(Ne=[],me=F;me=me.parentNode;)me.nodeType===1&&Ne.push({element:me,left:me.scrollLeft,top:me.scrollTop});for(typeof F.focus=="function"&&F.focus(),F=0;F<Ne.length;F++){var Ee=Ne[F];Ee.element.scrollLeft=Ee.left,Ee.element.scrollTop=Ee.top}}ip=!!V1,q1=V1=null}finally{sn=v,$.p=g,z.T=d}}o.current=l,sr=2}}function CC(){if(sr===2){sr=0;var o=Hs,l=nc,d=(l.flags&8772)!==0;if((l.subtreeFlags&8772)!==0||d){d=z.T,z.T=null;var g=$.p;$.p=2;var v=sn;sn|=4;try{XS(o,l.alternate,l)}finally{sn=v,$.p=g,z.T=d}}sr=3}}function kC(){if(sr===4||sr===3){sr=0,Ce();var o=Hs,l=nc,d=Jo,g=uC;(l.subtreeFlags&10256)!==0||(l.flags&10256)!==0?sr=5:(sr=0,nc=Hs=null,EC(o,o.pendingLanes));var v=o.pendingLanes;if(v===0&&(Bs=null),Te(d),l=l.stateNode,Ke&&typeof Ke.onCommitFiberRoot=="function")try{Ke.onCommitFiberRoot(Je,l,void 0,(l.current.flags&128)===128)}catch{}if(g!==null){l=z.T,v=$.p,$.p=2,z.T=null;try{for(var C=o.onRecoverableError,M=0;M<g.length;M++){var F=g[M];C(F.value,{componentStack:F.stack})}}finally{z.T=l,$.p=v}}(Jo&3)!==0&&Yh(),go(o),v=o.pendingLanes,(d&261930)!==0&&(v&42)!==0?o===O1?Yu++:(Yu=0,O1=o):Yu=0,Wu(0)}}function EC(o,l){(o.pooledCacheLanes&=l)===0&&(l=o.pooledCache,l!=null&&(o.pooledCache=null,Nu(l)))}function Yh(){return SC(),CC(),kC(),TC()}function TC(){if(sr!==5)return!1;var o=Hs,l=R1;R1=0;var d=Te(Jo),g=z.T,v=$.p;try{$.p=32>d?32:d,z.T=null,d=A1,A1=null;var C=Hs,M=Jo;if(sr=0,nc=Hs=null,Jo=0,(sn&6)!==0)throw Error(r(331));var F=sn;if(sn|=4,aC(C.current),iC(C,C.current,M,d),sn=F,Wu(0,!1),Ke&&typeof Ke.onPostCommitFiberRoot=="function")try{Ke.onPostCommitFiberRoot(Je,C)}catch{}return!0}finally{$.p=v,z.T=g,EC(o,l)}}function NC(o,l,d){l=ji(d,l),l=l1(o.stateNode,l,2),o=_s(o,l,2),o!==null&&(Ut(o,2),go(o))}function pn(o,l,d){if(o.tag===3)NC(o,o,d);else for(;l!==null;){if(l.tag===3){NC(l,o,d);break}else if(l.tag===1){var g=l.stateNode;if(typeof l.type.getDerivedStateFromError=="function"||typeof g.componentDidCatch=="function"&&(Bs===null||!Bs.has(g))){o=ji(d,o),d=RS(2),g=_s(l,d,2),g!==null&&(AS(d,g,l,o),Ut(g,2),go(g));break}}l=l.return}}function D1(o,l,d){var g=o.pingCache;if(g===null){g=o.pingCache=new Kj;var v=new Set;g.set(l,v)}else v=g.get(l),v===void 0&&(v=new Set,g.set(l,v));v.has(d)||(E1=!0,v.add(d),o=eM.bind(null,o,l,d),l.then(o,o))}function eM(o,l,d){var g=o.pingCache;g!==null&&g.delete(l),o.pingedLanes|=o.suspendedLanes&d,o.warmLanes&=~d,wn===o&&(Vt&d)===d&&(Pn===4||Pn===3&&(Vt&62914560)===Vt&&300>Ve()-Bh?(sn&2)===0&&rc(o,0):T1|=d,tc===Vt&&(tc=0)),go(o)}function RC(o,l){l===0&&(l=tn()),o=za(o,l),o!==null&&(Ut(o,l),go(o))}function tM(o){var l=o.memoizedState,d=0;l!==null&&(d=l.retryLane),RC(o,d)}function nM(o,l){var d=0;switch(o.tag){case 31:case 13:var g=o.stateNode,v=o.memoizedState;v!==null&&(d=v.retryLane);break;case 19:g=o.stateNode;break;case 22:g=o.stateNode._retryCache;break;default:throw Error(r(314))}g!==null&&g.delete(l),RC(o,d)}function rM(o,l){return be(o,l)}var Wh=null,oc=null,_1=!1,Gh=!1,L1=!1,Vs=0;function go(o){o!==oc&&o.next===null&&(oc===null?Wh=oc=o:oc=oc.next=o),Gh=!0,_1||(_1=!0,oM())}function Wu(o,l){if(!L1&&Gh){L1=!0;do for(var d=!1,g=Wh;g!==null;){if(o!==0){var v=g.pendingLanes;if(v===0)var C=0;else{var M=g.suspendedLanes,F=g.pingedLanes;C=(1<<31-nt(42|o)+1)-1,C&=v&~(M&~F),C=C&201326741?C&201326741|1:C?C|2:0}C!==0&&(d=!0,MC(g,C))}else C=Vt,C=Ie(g,g===wn?C:0,g.cancelPendingCommit!==null||g.timeoutHandle!==-1),(C&3)===0||Pt(g,C)||(d=!0,MC(g,C));g=g.next}while(d);L1=!1}}function iM(){AC()}function AC(){Gh=_1=!1;var o=0;Vs!==0&&mM()&&(o=Vs);for(var l=Ve(),d=null,g=Wh;g!==null;){var v=g.next,C=OC(g,l);C===0?(g.next=null,d===null?Wh=v:d.next=v,v===null&&(oc=d)):(d=g,(o!==0||(C&3)!==0)&&(Gh=!0)),g=v}sr!==0&&sr!==5||Wu(o),Vs!==0&&(Vs=0)}function OC(o,l){for(var d=o.suspendedLanes,g=o.pingedLanes,v=o.expirationTimes,C=o.pendingLanes&-62914561;0<C;){var M=31-nt(C),F=1<<M,X=v[M];X===-1?((F&d)===0||(F&g)!==0)&&(v[M]=on(F,l)):X<=l&&(o.expiredLanes|=F),C&=~F}if(l=wn,d=Vt,d=Ie(o,o===l?d:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),g=o.callbackNode,d===0||o===l&&(hn===2||hn===9)||o.cancelPendingCommit!==null)return g!==null&&g!==null&&ne(g),o.callbackNode=null,o.callbackPriority=0;if((d&3)===0||Pt(o,d)){if(l=d&-d,l===o.callbackPriority)return l;switch(g!==null&&ne(g),Te(d)){case 2:case 8:d=ke;break;case 32:d=Le;break;case 268435456:d=He;break;default:d=Le}return g=jC.bind(null,o),d=be(d,g),o.callbackPriority=l,o.callbackNode=d,l}return g!==null&&g!==null&&ne(g),o.callbackPriority=2,o.callbackNode=null,2}function jC(o,l){if(sr!==0&&sr!==5)return o.callbackNode=null,o.callbackPriority=0,null;var d=o.callbackNode;if(Yh()&&o.callbackNode!==d)return null;var g=Vt;return g=Ie(o,o===wn?g:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),g===0?null:(fC(o,g,l),OC(o,Ve()),o.callbackNode!=null&&o.callbackNode===d?jC.bind(null,o):null)}function MC(o,l){if(Yh())return null;fC(o,l,!0)}function oM(){yM(function(){(sn&6)!==0?be(oe,iM):AC()})}function I1(){if(Vs===0){var o=ql;o===0&&(o=ge,ge<<=1,(ge&261888)===0&&(ge=256)),Vs=o}return Vs}function DC(o){return o==null||typeof o=="symbol"||typeof o=="boolean"?null:typeof o=="function"?o:nh(""+o)}function _C(o,l){var d=l.ownerDocument.createElement("input");return d.name=l.name,d.value=l.value,o.id&&d.setAttribute("form",o.id),l.parentNode.insertBefore(d,l),o=new FormData(o),d.parentNode.removeChild(d),o}function sM(o,l,d,g,v){if(l==="submit"&&d&&d.stateNode===v){var C=DC((v[et]||null).action),M=g.submitter;M&&(l=(l=M[et]||null)?DC(l.formAction):M.getAttribute("formAction"),l!==null&&(C=l,M=null));var F=new sh("action","action",null,g,v);o.push({event:F,listeners:[{instance:null,listener:function(){if(g.defaultPrevented){if(Vs!==0){var X=M?_C(v,M):new FormData(v);n1(d,{pending:!0,data:X,method:v.method,action:C},null,X)}}else typeof C=="function"&&(F.preventDefault(),X=M?_C(v,M):new FormData(v),n1(d,{pending:!0,data:X,method:v.method,action:C},C,X))},currentTarget:v}]})}}for(var P1=0;P1<bg.length;P1++){var z1=bg[P1],aM=z1.toLowerCase(),lM=z1[0].toUpperCase()+z1.slice(1);Ji(aM,"on"+lM)}Ji(d3,"onAnimationEnd"),Ji(f3,"onAnimationIteration"),Ji(h3,"onAnimationStart"),Ji("dblclick","onDoubleClick"),Ji("focusin","onFocus"),Ji("focusout","onBlur"),Ji(kj,"onTransitionRun"),Ji(Ej,"onTransitionStart"),Ji(Tj,"onTransitionCancel"),Ji(p3,"onTransitionEnd"),Ri("onMouseEnter",["mouseout","mouseover"]),Ri("onMouseLeave",["mouseout","mouseover"]),Ri("onPointerEnter",["pointerout","pointerover"]),Ri("onPointerLeave",["pointerout","pointerover"]),Xi("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Xi("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Xi("onBeforeInput",["compositionend","keypress","textInput","paste"]),Xi("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Xi("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Xi("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Gu="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(" "),cM=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Gu));function LC(o,l){l=(l&4)!==0;for(var d=0;d<o.length;d++){var g=o[d],v=g.event;g=g.listeners;e:{var C=void 0;if(l)for(var M=g.length-1;0<=M;M--){var F=g[M],X=F.instance,ue=F.currentTarget;if(F=F.listener,X!==C&&v.isPropagationStopped())break e;C=F,v.currentTarget=ue;try{C(v)}catch(ve){ch(ve)}v.currentTarget=null,C=X}else for(M=0;M<g.length;M++){if(F=g[M],X=F.instance,ue=F.currentTarget,F=F.listener,X!==C&&v.isPropagationStopped())break e;C=F,v.currentTarget=ue;try{C(v)}catch(ve){ch(ve)}v.currentTarget=null,C=X}}}}function Bt(o,l){var d=l[vt];d===void 0&&(d=l[vt]=new Set);var g=o+"__bubble";d.has(g)||(IC(l,o,2,!1),d.add(g))}function F1(o,l,d){var g=0;l&&(g|=4),IC(d,o,g,l)}var Kh="_reactListening"+Math.random().toString(36).slice(2);function B1(o){if(!o[Kh]){o[Kh]=!0,Qi.forEach(function(d){d!=="selectionchange"&&(cM.has(d)||F1(d,!1,o),F1(d,!0,o))});var l=o.nodeType===9?o:o.ownerDocument;l===null||l[Kh]||(l[Kh]=!0,F1("selectionchange",!1,l))}}function IC(o,l,d,g){switch(d5(l)){case 2:var v=PM;break;case 8:v=zM;break;default:v=t2}d=v.bind(null,l,d,o),v=void 0,!sg||l!=="touchstart"&&l!=="touchmove"&&l!=="wheel"||(v=!0),g?v!==void 0?o.addEventListener(l,d,{capture:!0,passive:v}):o.addEventListener(l,d,!0):v!==void 0?o.addEventListener(l,d,{passive:v}):o.addEventListener(l,d,!1)}function H1(o,l,d,g,v){var C=g;if((l&1)===0&&(l&2)===0&&g!==null)e:for(;;){if(g===null)return;var M=g.tag;if(M===3||M===4){var F=g.stateNode.containerInfo;if(F===v)break;if(M===4)for(M=g.return;M!==null;){var X=M.tag;if((X===3||X===4)&&M.stateNode.containerInfo===v)return;M=M.return}for(;F!==null;){if(M=Ln(F),M===null)return;if(X=M.tag,X===5||X===6||X===26||X===27){g=C=M;continue e}F=F.parentNode}}g=g.return}Hw(function(){var ue=C,ve=ig(d),Ne=[];e:{var de=m3.get(o);if(de!==void 0){var me=sh,rt=o;switch(o){case"keypress":if(ih(d)===0)break e;case"keydown":case"keyup":me=nj;break;case"focusin":rt="focus",me=ug;break;case"focusout":rt="blur",me=ug;break;case"beforeblur":case"afterblur":me=ug;break;case"click":if(d.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":me=qw;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":me=qO;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":me=oj;break;case d3:case f3:case h3:me=WO;break;case p3:me=aj;break;case"scroll":case"scrollend":me=UO;break;case"wheel":me=cj;break;case"copy":case"cut":case"paste":me=KO;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":me=Yw;break;case"toggle":case"beforetoggle":me=dj}var wt=(l&4)!==0,xn=!wt&&(o==="scroll"||o==="scrollend"),ie=wt?de!==null?de+"Capture":null:de;wt=[];for(var re=ue,ce;re!==null;){var Ee=re;if(ce=Ee.stateNode,Ee=Ee.tag,Ee!==5&&Ee!==26&&Ee!==27||ce===null||ie===null||(Ee=gu(re,ie),Ee!=null&&wt.push(Ku(re,Ee,ce))),xn)break;re=re.return}0<wt.length&&(de=new me(de,rt,null,d,ve),Ne.push({event:de,listeners:wt}))}}if((l&7)===0){e:{if(de=o==="mouseover"||o==="pointerover",me=o==="mouseout"||o==="pointerout",de&&d!==rg&&(rt=d.relatedTarget||d.fromElement)&&(Ln(rt)||rt[ct]))break e;if((me||de)&&(de=ve.window===ve?ve:(de=ve.ownerDocument)?de.defaultView||de.parentWindow:window,me?(rt=d.relatedTarget||d.toElement,me=ue,rt=rt?Ln(rt):null,rt!==null&&(xn=s(rt),wt=rt.tag,rt!==xn||wt!==5&&wt!==27&&wt!==6)&&(rt=null)):(me=null,rt=ue),me!==rt)){if(wt=qw,Ee="onMouseLeave",ie="onMouseEnter",re="mouse",(o==="pointerout"||o==="pointerover")&&(wt=Yw,Ee="onPointerLeave",ie="onPointerEnter",re="pointer"),xn=me==null?de:dr(me),ce=rt==null?de:dr(rt),de=new wt(Ee,re+"leave",me,d,ve),de.target=xn,de.relatedTarget=ce,Ee=null,Ln(ve)===ue&&(wt=new wt(ie,re+"enter",rt,d,ve),wt.target=ce,wt.relatedTarget=xn,Ee=wt),xn=Ee,me&&rt)t:{for(wt=uM,ie=me,re=rt,ce=0,Ee=ie;Ee;Ee=wt(Ee))ce++;Ee=0;for(var gt=re;gt;gt=wt(gt))Ee++;for(;0<ce-Ee;)ie=wt(ie),ce--;for(;0<Ee-ce;)re=wt(re),Ee--;for(;ce--;){if(ie===re||re!==null&&ie===re.alternate){wt=ie;break t}ie=wt(ie),re=wt(re)}wt=null}else wt=null;me!==null&&PC(Ne,de,me,wt,!1),rt!==null&&xn!==null&&PC(Ne,xn,rt,wt,!0)}}e:{if(de=ue?dr(ue):window,me=de.nodeName&&de.nodeName.toLowerCase(),me==="select"||me==="input"&&de.type==="file")var nn=e3;else if(Zw(de))if(t3)nn=wj;else{nn=bj;var at=xj}else me=de.nodeName,!me||me.toLowerCase()!=="input"||de.type!=="checkbox"&&de.type!=="radio"?ue&&ng(ue.elementType)&&(nn=e3):nn=vj;if(nn&&(nn=nn(o,ue))){Jw(Ne,nn,d,ve);break e}at&&at(o,de,ue),o==="focusout"&&ue&&de.type==="number"&&ue.memoizedProps.value!=null&&tg(de,"number",de.value)}switch(at=ue?dr(ue):window,o){case"focusin":(Zw(at)||at.contentEditable==="true")&&(Il=at,gg=ue,ku=null);break;case"focusout":ku=gg=Il=null;break;case"mousedown":yg=!0;break;case"contextmenu":case"mouseup":case"dragend":yg=!1,c3(Ne,d,ve);break;case"selectionchange":if(Cj)break;case"keydown":case"keyup":c3(Ne,d,ve)}var Mt;if(fg)e:{switch(o){case"compositionstart":var qt="onCompositionStart";break e;case"compositionend":qt="onCompositionEnd";break e;case"compositionupdate":qt="onCompositionUpdate";break e}qt=void 0}else Ll?Qw(o,d)&&(qt="onCompositionEnd"):o==="keydown"&&d.keyCode===229&&(qt="onCompositionStart");qt&&(Ww&&d.locale!=="ko"&&(Ll||qt!=="onCompositionStart"?qt==="onCompositionEnd"&&Ll&&(Mt=Uw()):(Ns=ve,ag="value"in Ns?Ns.value:Ns.textContent,Ll=!0)),at=Qh(ue,qt),0<at.length&&(qt=new $w(qt,o,null,d,ve),Ne.push({event:qt,listeners:at}),Mt?qt.data=Mt:(Mt=Xw(d),Mt!==null&&(qt.data=Mt)))),(Mt=hj?pj(o,d):mj(o,d))&&(qt=Qh(ue,"onBeforeInput"),0<qt.length&&(at=new $w("onBeforeInput","beforeinput",null,d,ve),Ne.push({event:at,listeners:qt}),at.data=Mt)),sM(Ne,o,ue,d,ve)}LC(Ne,l)})}function Ku(o,l,d){return{instance:o,listener:l,currentTarget:d}}function Qh(o,l){for(var d=l+"Capture",g=[];o!==null;){var v=o,C=v.stateNode;if(v=v.tag,v!==5&&v!==26&&v!==27||C===null||(v=gu(o,d),v!=null&&g.unshift(Ku(o,v,C)),v=gu(o,l),v!=null&&g.push(Ku(o,v,C))),o.tag===3)return g;o=o.return}return[]}function uM(o){if(o===null)return null;do o=o.return;while(o&&o.tag!==5&&o.tag!==27);return o||null}function PC(o,l,d,g,v){for(var C=l._reactName,M=[];d!==null&&d!==g;){var F=d,X=F.alternate,ue=F.stateNode;if(F=F.tag,X!==null&&X===g)break;F!==5&&F!==26&&F!==27||ue===null||(X=ue,v?(ue=gu(d,C),ue!=null&&M.unshift(Ku(d,ue,X))):v||(ue=gu(d,C),ue!=null&&M.push(Ku(d,ue,X)))),d=d.return}M.length!==0&&o.push({event:l,listeners:M})}var dM=/\r\n?/g,fM=/\u0000|\uFFFD/g;function zC(o){return(typeof o=="string"?o:""+o).replace(dM,`
9
+ `).replace(fM,"")}function FC(o,l){return l=zC(l),zC(o)===l}function yn(o,l,d,g,v,C){switch(d){case"children":typeof g=="string"?l==="body"||l==="textarea"&&g===""||Ml(o,g):(typeof g=="number"||typeof g=="bigint")&&l!=="body"&&Ml(o,""+g);break;case"className":Zi(o,"class",g);break;case"tabIndex":Zi(o,"tabindex",g);break;case"dir":case"role":case"viewBox":case"width":case"height":Zi(o,d,g);break;case"style":Fw(o,g,C);break;case"data":if(l!=="object"){Zi(o,"data",g);break}case"src":case"href":if(g===""&&(l!=="a"||d!=="href")){o.removeAttribute(d);break}if(g==null||typeof g=="function"||typeof g=="symbol"||typeof g=="boolean"){o.removeAttribute(d);break}g=nh(""+g),o.setAttribute(d,g);break;case"action":case"formAction":if(typeof g=="function"){o.setAttribute(d,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof C=="function"&&(d==="formAction"?(l!=="input"&&yn(o,l,"name",v.name,v,null),yn(o,l,"formEncType",v.formEncType,v,null),yn(o,l,"formMethod",v.formMethod,v,null),yn(o,l,"formTarget",v.formTarget,v,null)):(yn(o,l,"encType",v.encType,v,null),yn(o,l,"method",v.method,v,null),yn(o,l,"target",v.target,v,null)));if(g==null||typeof g=="symbol"||typeof g=="boolean"){o.removeAttribute(d);break}g=nh(""+g),o.setAttribute(d,g);break;case"onClick":g!=null&&(o.onclick=zo);break;case"onScroll":g!=null&&Bt("scroll",o);break;case"onScrollEnd":g!=null&&Bt("scrollend",o);break;case"dangerouslySetInnerHTML":if(g!=null){if(typeof g!="object"||!("__html"in g))throw Error(r(61));if(d=g.__html,d!=null){if(v.children!=null)throw Error(r(60));o.innerHTML=d}}break;case"multiple":o.multiple=g&&typeof g!="function"&&typeof g!="symbol";break;case"muted":o.muted=g&&typeof g!="function"&&typeof g!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(g==null||typeof g=="function"||typeof g=="boolean"||typeof g=="symbol"){o.removeAttribute("xlink:href");break}d=nh(""+g),o.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",d);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":g!=null&&typeof g!="function"&&typeof g!="symbol"?o.setAttribute(d,""+g):o.removeAttribute(d);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":g&&typeof g!="function"&&typeof g!="symbol"?o.setAttribute(d,""):o.removeAttribute(d);break;case"capture":case"download":g===!0?o.setAttribute(d,""):g!==!1&&g!=null&&typeof g!="function"&&typeof g!="symbol"?o.setAttribute(d,g):o.removeAttribute(d);break;case"cols":case"rows":case"size":case"span":g!=null&&typeof g!="function"&&typeof g!="symbol"&&!isNaN(g)&&1<=g?o.setAttribute(d,g):o.removeAttribute(d);break;case"rowSpan":case"start":g==null||typeof g=="function"||typeof g=="symbol"||isNaN(g)?o.removeAttribute(d):o.setAttribute(d,g);break;case"popover":Bt("beforetoggle",o),Bt("toggle",o),$n(o,"popover",g);break;case"xlinkActuate":yr(o,"http://www.w3.org/1999/xlink","xlink:actuate",g);break;case"xlinkArcrole":yr(o,"http://www.w3.org/1999/xlink","xlink:arcrole",g);break;case"xlinkRole":yr(o,"http://www.w3.org/1999/xlink","xlink:role",g);break;case"xlinkShow":yr(o,"http://www.w3.org/1999/xlink","xlink:show",g);break;case"xlinkTitle":yr(o,"http://www.w3.org/1999/xlink","xlink:title",g);break;case"xlinkType":yr(o,"http://www.w3.org/1999/xlink","xlink:type",g);break;case"xmlBase":yr(o,"http://www.w3.org/XML/1998/namespace","xml:base",g);break;case"xmlLang":yr(o,"http://www.w3.org/XML/1998/namespace","xml:lang",g);break;case"xmlSpace":yr(o,"http://www.w3.org/XML/1998/namespace","xml:space",g);break;case"is":$n(o,"is",g);break;case"innerText":case"textContent":break;default:(!(2<d.length)||d[0]!=="o"&&d[0]!=="O"||d[1]!=="n"&&d[1]!=="N")&&(d=BO.get(d)||d,$n(o,d,g))}}function U1(o,l,d,g,v,C){switch(d){case"style":Fw(o,g,C);break;case"dangerouslySetInnerHTML":if(g!=null){if(typeof g!="object"||!("__html"in g))throw Error(r(61));if(d=g.__html,d!=null){if(v.children!=null)throw Error(r(60));o.innerHTML=d}}break;case"children":typeof g=="string"?Ml(o,g):(typeof g=="number"||typeof g=="bigint")&&Ml(o,""+g);break;case"onScroll":g!=null&&Bt("scroll",o);break;case"onScrollEnd":g!=null&&Bt("scrollend",o);break;case"onClick":g!=null&&(o.onclick=zo);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!ri.hasOwnProperty(d))e:{if(d[0]==="o"&&d[1]==="n"&&(v=d.endsWith("Capture"),l=d.slice(2,v?d.length-7:void 0),C=o[et]||null,C=C!=null?C[d]:null,typeof C=="function"&&o.removeEventListener(l,C,v),typeof g=="function")){typeof C!="function"&&C!==null&&(d in o?o[d]=null:o.hasAttribute(d)&&o.removeAttribute(d)),o.addEventListener(l,g,v);break e}d in o?o[d]=g:g===!0?o.setAttribute(d,""):$n(o,d,g)}}}function wr(o,l,d){switch(l){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Bt("error",o),Bt("load",o);var g=!1,v=!1,C;for(C in d)if(d.hasOwnProperty(C)){var M=d[C];if(M!=null)switch(C){case"src":g=!0;break;case"srcSet":v=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,l));default:yn(o,l,C,M,d,null)}}v&&yn(o,l,"srcSet",d.srcSet,d,null),g&&yn(o,l,"src",d.src,d,null);return;case"input":Bt("invalid",o);var F=C=M=v=null,X=null,ue=null;for(g in d)if(d.hasOwnProperty(g)){var ve=d[g];if(ve!=null)switch(g){case"name":v=ve;break;case"type":M=ve;break;case"checked":X=ve;break;case"defaultChecked":ue=ve;break;case"value":C=ve;break;case"defaultValue":F=ve;break;case"children":case"dangerouslySetInnerHTML":if(ve!=null)throw Error(r(137,l));break;default:yn(o,l,g,ve,d,null)}}Lw(o,C,F,X,ue,M,v,!1);return;case"select":Bt("invalid",o),g=M=C=null;for(v in d)if(d.hasOwnProperty(v)&&(F=d[v],F!=null))switch(v){case"value":C=F;break;case"defaultValue":M=F;break;case"multiple":g=F;default:yn(o,l,v,F,d,null)}l=C,d=M,o.multiple=!!g,l!=null?jl(o,!!g,l,!1):d!=null&&jl(o,!!g,d,!0);return;case"textarea":Bt("invalid",o),C=v=g=null;for(M in d)if(d.hasOwnProperty(M)&&(F=d[M],F!=null))switch(M){case"value":g=F;break;case"defaultValue":v=F;break;case"children":C=F;break;case"dangerouslySetInnerHTML":if(F!=null)throw Error(r(91));break;default:yn(o,l,M,F,d,null)}Pw(o,g,v,C);return;case"option":for(X in d)d.hasOwnProperty(X)&&(g=d[X],g!=null)&&(X==="selected"?o.selected=g&&typeof g!="function"&&typeof g!="symbol":yn(o,l,X,g,d,null));return;case"dialog":Bt("beforetoggle",o),Bt("toggle",o),Bt("cancel",o),Bt("close",o);break;case"iframe":case"object":Bt("load",o);break;case"video":case"audio":for(g=0;g<Gu.length;g++)Bt(Gu[g],o);break;case"image":Bt("error",o),Bt("load",o);break;case"details":Bt("toggle",o);break;case"embed":case"source":case"link":Bt("error",o),Bt("load",o);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(ue in d)if(d.hasOwnProperty(ue)&&(g=d[ue],g!=null))switch(ue){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,l));default:yn(o,l,ue,g,d,null)}return;default:if(ng(l)){for(ve in d)d.hasOwnProperty(ve)&&(g=d[ve],g!==void 0&&U1(o,l,ve,g,d,void 0));return}}for(F in d)d.hasOwnProperty(F)&&(g=d[F],g!=null&&yn(o,l,F,g,d,null))}function hM(o,l,d,g){switch(l){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var v=null,C=null,M=null,F=null,X=null,ue=null,ve=null;for(me in d){var Ne=d[me];if(d.hasOwnProperty(me)&&Ne!=null)switch(me){case"checked":break;case"value":break;case"defaultValue":X=Ne;default:g.hasOwnProperty(me)||yn(o,l,me,null,g,Ne)}}for(var de in g){var me=g[de];if(Ne=d[de],g.hasOwnProperty(de)&&(me!=null||Ne!=null))switch(de){case"type":C=me;break;case"name":v=me;break;case"checked":ue=me;break;case"defaultChecked":ve=me;break;case"value":M=me;break;case"defaultValue":F=me;break;case"children":case"dangerouslySetInnerHTML":if(me!=null)throw Error(r(137,l));break;default:me!==Ne&&yn(o,l,de,me,g,Ne)}}eg(o,M,F,X,ue,ve,C,v);return;case"select":me=M=F=de=null;for(C in d)if(X=d[C],d.hasOwnProperty(C)&&X!=null)switch(C){case"value":break;case"multiple":me=X;default:g.hasOwnProperty(C)||yn(o,l,C,null,g,X)}for(v in g)if(C=g[v],X=d[v],g.hasOwnProperty(v)&&(C!=null||X!=null))switch(v){case"value":de=C;break;case"defaultValue":F=C;break;case"multiple":M=C;default:C!==X&&yn(o,l,v,C,g,X)}l=F,d=M,g=me,de!=null?jl(o,!!d,de,!1):!!g!=!!d&&(l!=null?jl(o,!!d,l,!0):jl(o,!!d,d?[]:"",!1));return;case"textarea":me=de=null;for(F in d)if(v=d[F],d.hasOwnProperty(F)&&v!=null&&!g.hasOwnProperty(F))switch(F){case"value":break;case"children":break;default:yn(o,l,F,null,g,v)}for(M in g)if(v=g[M],C=d[M],g.hasOwnProperty(M)&&(v!=null||C!=null))switch(M){case"value":de=v;break;case"defaultValue":me=v;break;case"children":break;case"dangerouslySetInnerHTML":if(v!=null)throw Error(r(91));break;default:v!==C&&yn(o,l,M,v,g,C)}Iw(o,de,me);return;case"option":for(var rt in d)de=d[rt],d.hasOwnProperty(rt)&&de!=null&&!g.hasOwnProperty(rt)&&(rt==="selected"?o.selected=!1:yn(o,l,rt,null,g,de));for(X in g)de=g[X],me=d[X],g.hasOwnProperty(X)&&de!==me&&(de!=null||me!=null)&&(X==="selected"?o.selected=de&&typeof de!="function"&&typeof de!="symbol":yn(o,l,X,de,g,me));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var wt in d)de=d[wt],d.hasOwnProperty(wt)&&de!=null&&!g.hasOwnProperty(wt)&&yn(o,l,wt,null,g,de);for(ue in g)if(de=g[ue],me=d[ue],g.hasOwnProperty(ue)&&de!==me&&(de!=null||me!=null))switch(ue){case"children":case"dangerouslySetInnerHTML":if(de!=null)throw Error(r(137,l));break;default:yn(o,l,ue,de,g,me)}return;default:if(ng(l)){for(var xn in d)de=d[xn],d.hasOwnProperty(xn)&&de!==void 0&&!g.hasOwnProperty(xn)&&U1(o,l,xn,void 0,g,de);for(ve in g)de=g[ve],me=d[ve],!g.hasOwnProperty(ve)||de===me||de===void 0&&me===void 0||U1(o,l,ve,de,g,me);return}}for(var ie in d)de=d[ie],d.hasOwnProperty(ie)&&de!=null&&!g.hasOwnProperty(ie)&&yn(o,l,ie,null,g,de);for(Ne in g)de=g[Ne],me=d[Ne],!g.hasOwnProperty(Ne)||de===me||de==null&&me==null||yn(o,l,Ne,de,g,me)}function BC(o){switch(o){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function pM(){if(typeof performance.getEntriesByType=="function"){for(var o=0,l=0,d=performance.getEntriesByType("resource"),g=0;g<d.length;g++){var v=d[g],C=v.transferSize,M=v.initiatorType,F=v.duration;if(C&&F&&BC(M)){for(M=0,F=v.responseEnd,g+=1;g<d.length;g++){var X=d[g],ue=X.startTime;if(ue>F)break;var ve=X.transferSize,Ne=X.initiatorType;ve&&BC(Ne)&&(X=X.responseEnd,M+=ve*(X<F?1:(F-ue)/(X-ue)))}if(--g,l+=8*(C+M)/(v.duration/1e3),o++,10<o)break}}if(0<o)return l/o/1e6}return navigator.connection&&(o=navigator.connection.downlink,typeof o=="number")?o:5}var V1=null,q1=null;function Xh(o){return o.nodeType===9?o:o.ownerDocument}function HC(o){switch(o){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function UC(o,l){if(o===0)switch(l){case"svg":return 1;case"math":return 2;default:return 0}return o===1&&l==="foreignObject"?0:o}function $1(o,l){return o==="textarea"||o==="noscript"||typeof l.children=="string"||typeof l.children=="number"||typeof l.children=="bigint"||typeof l.dangerouslySetInnerHTML=="object"&&l.dangerouslySetInnerHTML!==null&&l.dangerouslySetInnerHTML.__html!=null}var Y1=null;function mM(){var o=window.event;return o&&o.type==="popstate"?o===Y1?!1:(Y1=o,!0):(Y1=null,!1)}var VC=typeof setTimeout=="function"?setTimeout:void 0,gM=typeof clearTimeout=="function"?clearTimeout:void 0,qC=typeof Promise=="function"?Promise:void 0,yM=typeof queueMicrotask=="function"?queueMicrotask:typeof qC<"u"?function(o){return qC.resolve(null).then(o).catch(xM)}:VC;function xM(o){setTimeout(function(){throw o})}function qs(o){return o==="head"}function $C(o,l){var d=l,g=0;do{var v=d.nextSibling;if(o.removeChild(d),v&&v.nodeType===8)if(d=v.data,d==="/$"||d==="/&"){if(g===0){o.removeChild(v),cc(l);return}g--}else if(d==="$"||d==="$?"||d==="$~"||d==="$!"||d==="&")g++;else if(d==="html")Qu(o.ownerDocument.documentElement);else if(d==="head"){d=o.ownerDocument.head,Qu(d);for(var C=d.firstChild;C;){var M=C.nextSibling,F=C.nodeName;C[Mn]||F==="SCRIPT"||F==="STYLE"||F==="LINK"&&C.rel.toLowerCase()==="stylesheet"||d.removeChild(C),C=M}}else d==="body"&&Qu(o.ownerDocument.body);d=v}while(d);cc(l)}function YC(o,l){var d=o;o=0;do{var g=d.nextSibling;if(d.nodeType===1?l?(d._stashedDisplay=d.style.display,d.style.display="none"):(d.style.display=d._stashedDisplay||"",d.getAttribute("style")===""&&d.removeAttribute("style")):d.nodeType===3&&(l?(d._stashedText=d.nodeValue,d.nodeValue=""):d.nodeValue=d._stashedText||""),g&&g.nodeType===8)if(d=g.data,d==="/$"){if(o===0)break;o--}else d!=="$"&&d!=="$?"&&d!=="$~"&&d!=="$!"||o++;d=g}while(d)}function W1(o){var l=o.firstChild;for(l&&l.nodeType===10&&(l=l.nextSibling);l;){var d=l;switch(l=l.nextSibling,d.nodeName){case"HTML":case"HEAD":case"BODY":W1(d),_n(d);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(d.rel.toLowerCase()==="stylesheet")continue}o.removeChild(d)}}function bM(o,l,d,g){for(;o.nodeType===1;){var v=d;if(o.nodeName.toLowerCase()!==l.toLowerCase()){if(!g&&(o.nodeName!=="INPUT"||o.type!=="hidden"))break}else if(g){if(!o[Mn])switch(l){case"meta":if(!o.hasAttribute("itemprop"))break;return o;case"link":if(C=o.getAttribute("rel"),C==="stylesheet"&&o.hasAttribute("data-precedence"))break;if(C!==v.rel||o.getAttribute("href")!==(v.href==null||v.href===""?null:v.href)||o.getAttribute("crossorigin")!==(v.crossOrigin==null?null:v.crossOrigin)||o.getAttribute("title")!==(v.title==null?null:v.title))break;return o;case"style":if(o.hasAttribute("data-precedence"))break;return o;case"script":if(C=o.getAttribute("src"),(C!==(v.src==null?null:v.src)||o.getAttribute("type")!==(v.type==null?null:v.type)||o.getAttribute("crossorigin")!==(v.crossOrigin==null?null:v.crossOrigin))&&C&&o.hasAttribute("async")&&!o.hasAttribute("itemprop"))break;return o;default:return o}}else if(l==="input"&&o.type==="hidden"){var C=v.name==null?null:""+v.name;if(v.type==="hidden"&&o.getAttribute("name")===C)return o}else return o;if(o=Ii(o.nextSibling),o===null)break}return null}function vM(o,l,d){if(l==="")return null;for(;o.nodeType!==3;)if((o.nodeType!==1||o.nodeName!=="INPUT"||o.type!=="hidden")&&!d||(o=Ii(o.nextSibling),o===null))return null;return o}function WC(o,l){for(;o.nodeType!==8;)if((o.nodeType!==1||o.nodeName!=="INPUT"||o.type!=="hidden")&&!l||(o=Ii(o.nextSibling),o===null))return null;return o}function G1(o){return o.data==="$?"||o.data==="$~"}function K1(o){return o.data==="$!"||o.data==="$?"&&o.ownerDocument.readyState!=="loading"}function wM(o,l){var d=o.ownerDocument;if(o.data==="$~")o._reactRetry=l;else if(o.data!=="$?"||d.readyState!=="loading")l();else{var g=function(){l(),d.removeEventListener("DOMContentLoaded",g)};d.addEventListener("DOMContentLoaded",g),o._reactRetry=g}}function Ii(o){for(;o!=null;o=o.nextSibling){var l=o.nodeType;if(l===1||l===3)break;if(l===8){if(l=o.data,l==="$"||l==="$!"||l==="$?"||l==="$~"||l==="&"||l==="F!"||l==="F")break;if(l==="/$"||l==="/&")return null}}return o}var Q1=null;function GC(o){o=o.nextSibling;for(var l=0;o;){if(o.nodeType===8){var d=o.data;if(d==="/$"||d==="/&"){if(l===0)return Ii(o.nextSibling);l--}else d!=="$"&&d!=="$!"&&d!=="$?"&&d!=="$~"&&d!=="&"||l++}o=o.nextSibling}return null}function KC(o){o=o.previousSibling;for(var l=0;o;){if(o.nodeType===8){var d=o.data;if(d==="$"||d==="$!"||d==="$?"||d==="$~"||d==="&"){if(l===0)return o;l--}else d!=="/$"&&d!=="/&"||l++}o=o.previousSibling}return null}function QC(o,l,d){switch(l=Xh(d),o){case"html":if(o=l.documentElement,!o)throw Error(r(452));return o;case"head":if(o=l.head,!o)throw Error(r(453));return o;case"body":if(o=l.body,!o)throw Error(r(454));return o;default:throw Error(r(451))}}function Qu(o){for(var l=o.attributes;l.length;)o.removeAttributeNode(l[0]);_n(o)}var Pi=new Map,XC=new Set;function Zh(o){return typeof o.getRootNode=="function"?o.getRootNode():o.nodeType===9?o:o.ownerDocument}var es=$.d;$.d={f:SM,r:CM,D:kM,C:EM,L:TM,m:NM,X:AM,S:RM,M:OM};function SM(){var o=es.f(),l=Vh();return o||l}function CM(o){var l=Yt(o);l!==null&&l.tag===5&&l.type==="form"?pS(l):es.r(o)}var sc=typeof document>"u"?null:document;function ZC(o,l,d){var g=sc;if(g&&typeof l=="string"&&l){var v=Ai(l);v='link[rel="'+o+'"][href="'+v+'"]',typeof d=="string"&&(v+='[crossorigin="'+d+'"]'),XC.has(v)||(XC.add(v),o={rel:o,crossOrigin:d,href:l},g.querySelector(v)===null&&(l=g.createElement("link"),wr(l,"link",o),Rn(l),g.head.appendChild(l)))}}function kM(o){es.D(o),ZC("dns-prefetch",o,null)}function EM(o,l){es.C(o,l),ZC("preconnect",o,l)}function TM(o,l,d){es.L(o,l,d);var g=sc;if(g&&o&&l){var v='link[rel="preload"][as="'+Ai(l)+'"]';l==="image"&&d&&d.imageSrcSet?(v+='[imagesrcset="'+Ai(d.imageSrcSet)+'"]',typeof d.imageSizes=="string"&&(v+='[imagesizes="'+Ai(d.imageSizes)+'"]')):v+='[href="'+Ai(o)+'"]';var C=v;switch(l){case"style":C=ac(o);break;case"script":C=lc(o)}Pi.has(C)||(o=p({rel:"preload",href:l==="image"&&d&&d.imageSrcSet?void 0:o,as:l},d),Pi.set(C,o),g.querySelector(v)!==null||l==="style"&&g.querySelector(Xu(C))||l==="script"&&g.querySelector(Zu(C))||(l=g.createElement("link"),wr(l,"link",o),Rn(l),g.head.appendChild(l)))}}function NM(o,l){es.m(o,l);var d=sc;if(d&&o){var g=l&&typeof l.as=="string"?l.as:"script",v='link[rel="modulepreload"][as="'+Ai(g)+'"][href="'+Ai(o)+'"]',C=v;switch(g){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":C=lc(o)}if(!Pi.has(C)&&(o=p({rel:"modulepreload",href:o},l),Pi.set(C,o),d.querySelector(v)===null)){switch(g){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(d.querySelector(Zu(C)))return}g=d.createElement("link"),wr(g,"link",o),Rn(g),d.head.appendChild(g)}}}function RM(o,l,d){es.S(o,l,d);var g=sc;if(g&&o){var v=Ur(g).hoistableStyles,C=ac(o);l=l||"default";var M=v.get(C);if(!M){var F={loading:0,preload:null};if(M=g.querySelector(Xu(C)))F.loading=5;else{o=p({rel:"stylesheet",href:o,"data-precedence":l},d),(d=Pi.get(C))&&X1(o,d);var X=M=g.createElement("link");Rn(X),wr(X,"link",o),X._p=new Promise(function(ue,ve){X.onload=ue,X.onerror=ve}),X.addEventListener("load",function(){F.loading|=1}),X.addEventListener("error",function(){F.loading|=2}),F.loading|=4,Jh(M,l,g)}M={type:"stylesheet",instance:M,count:1,state:F},v.set(C,M)}}}function AM(o,l){es.X(o,l);var d=sc;if(d&&o){var g=Ur(d).hoistableScripts,v=lc(o),C=g.get(v);C||(C=d.querySelector(Zu(v)),C||(o=p({src:o,async:!0},l),(l=Pi.get(v))&&Z1(o,l),C=d.createElement("script"),Rn(C),wr(C,"link",o),d.head.appendChild(C)),C={type:"script",instance:C,count:1,state:null},g.set(v,C))}}function OM(o,l){es.M(o,l);var d=sc;if(d&&o){var g=Ur(d).hoistableScripts,v=lc(o),C=g.get(v);C||(C=d.querySelector(Zu(v)),C||(o=p({src:o,async:!0,type:"module"},l),(l=Pi.get(v))&&Z1(o,l),C=d.createElement("script"),Rn(C),wr(C,"link",o),d.head.appendChild(C)),C={type:"script",instance:C,count:1,state:null},g.set(v,C))}}function JC(o,l,d,g){var v=(v=J.current)?Zh(v):null;if(!v)throw Error(r(446));switch(o){case"meta":case"title":return null;case"style":return typeof d.precedence=="string"&&typeof d.href=="string"?(l=ac(d.href),d=Ur(v).hoistableStyles,g=d.get(l),g||(g={type:"style",instance:null,count:0,state:null},d.set(l,g)),g):{type:"void",instance:null,count:0,state:null};case"link":if(d.rel==="stylesheet"&&typeof d.href=="string"&&typeof d.precedence=="string"){o=ac(d.href);var C=Ur(v).hoistableStyles,M=C.get(o);if(M||(v=v.ownerDocument||v,M={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},C.set(o,M),(C=v.querySelector(Xu(o)))&&!C._p&&(M.instance=C,M.state.loading=5),Pi.has(o)||(d={rel:"preload",as:"style",href:d.href,crossOrigin:d.crossOrigin,integrity:d.integrity,media:d.media,hrefLang:d.hrefLang,referrerPolicy:d.referrerPolicy},Pi.set(o,d),C||jM(v,o,d,M.state))),l&&g===null)throw Error(r(528,""));return M}if(l&&g!==null)throw Error(r(529,""));return null;case"script":return l=d.async,d=d.src,typeof d=="string"&&l&&typeof l!="function"&&typeof l!="symbol"?(l=lc(d),d=Ur(v).hoistableScripts,g=d.get(l),g||(g={type:"script",instance:null,count:0,state:null},d.set(l,g)),g):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,o))}}function ac(o){return'href="'+Ai(o)+'"'}function Xu(o){return'link[rel="stylesheet"]['+o+"]"}function e5(o){return p({},o,{"data-precedence":o.precedence,precedence:null})}function jM(o,l,d,g){o.querySelector('link[rel="preload"][as="style"]['+l+"]")?g.loading=1:(l=o.createElement("link"),g.preload=l,l.addEventListener("load",function(){return g.loading|=1}),l.addEventListener("error",function(){return g.loading|=2}),wr(l,"link",d),Rn(l),o.head.appendChild(l))}function lc(o){return'[src="'+Ai(o)+'"]'}function Zu(o){return"script[async]"+o}function t5(o,l,d){if(l.count++,l.instance===null)switch(l.type){case"style":var g=o.querySelector('style[data-href~="'+Ai(d.href)+'"]');if(g)return l.instance=g,Rn(g),g;var v=p({},d,{"data-href":d.href,"data-precedence":d.precedence,href:null,precedence:null});return g=(o.ownerDocument||o).createElement("style"),Rn(g),wr(g,"style",v),Jh(g,d.precedence,o),l.instance=g;case"stylesheet":v=ac(d.href);var C=o.querySelector(Xu(v));if(C)return l.state.loading|=4,l.instance=C,Rn(C),C;g=e5(d),(v=Pi.get(v))&&X1(g,v),C=(o.ownerDocument||o).createElement("link"),Rn(C);var M=C;return M._p=new Promise(function(F,X){M.onload=F,M.onerror=X}),wr(C,"link",g),l.state.loading|=4,Jh(C,d.precedence,o),l.instance=C;case"script":return C=lc(d.src),(v=o.querySelector(Zu(C)))?(l.instance=v,Rn(v),v):(g=d,(v=Pi.get(C))&&(g=p({},d),Z1(g,v)),o=o.ownerDocument||o,v=o.createElement("script"),Rn(v),wr(v,"link",g),o.head.appendChild(v),l.instance=v);case"void":return null;default:throw Error(r(443,l.type))}else l.type==="stylesheet"&&(l.state.loading&4)===0&&(g=l.instance,l.state.loading|=4,Jh(g,d.precedence,o));return l.instance}function Jh(o,l,d){for(var g=d.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),v=g.length?g[g.length-1]:null,C=v,M=0;M<g.length;M++){var F=g[M];if(F.dataset.precedence===l)C=F;else if(C!==v)break}C?C.parentNode.insertBefore(o,C.nextSibling):(l=d.nodeType===9?d.head:d,l.insertBefore(o,l.firstChild))}function X1(o,l){o.crossOrigin==null&&(o.crossOrigin=l.crossOrigin),o.referrerPolicy==null&&(o.referrerPolicy=l.referrerPolicy),o.title==null&&(o.title=l.title)}function Z1(o,l){o.crossOrigin==null&&(o.crossOrigin=l.crossOrigin),o.referrerPolicy==null&&(o.referrerPolicy=l.referrerPolicy),o.integrity==null&&(o.integrity=l.integrity)}var ep=null;function n5(o,l,d){if(ep===null){var g=new Map,v=ep=new Map;v.set(d,g)}else v=ep,g=v.get(d),g||(g=new Map,v.set(d,g));if(g.has(o))return g;for(g.set(o,null),d=d.getElementsByTagName(o),v=0;v<d.length;v++){var C=d[v];if(!(C[Mn]||C[Xe]||o==="link"&&C.getAttribute("rel")==="stylesheet")&&C.namespaceURI!=="http://www.w3.org/2000/svg"){var M=C.getAttribute(l)||"";M=o+M;var F=g.get(M);F?F.push(C):g.set(M,[C])}}return g}function r5(o,l,d){o=o.ownerDocument||o,o.head.insertBefore(d,l==="title"?o.querySelector("head > title"):null)}function MM(o,l,d){if(d===1||l.itemProp!=null)return!1;switch(o){case"meta":case"title":return!0;case"style":if(typeof l.precedence!="string"||typeof l.href!="string"||l.href==="")break;return!0;case"link":if(typeof l.rel!="string"||typeof l.href!="string"||l.href===""||l.onLoad||l.onError)break;return l.rel==="stylesheet"?(o=l.disabled,typeof l.precedence=="string"&&o==null):!0;case"script":if(l.async&&typeof l.async!="function"&&typeof l.async!="symbol"&&!l.onLoad&&!l.onError&&l.src&&typeof l.src=="string")return!0}return!1}function i5(o){return!(o.type==="stylesheet"&&(o.state.loading&3)===0)}function DM(o,l,d,g){if(d.type==="stylesheet"&&(typeof g.media!="string"||matchMedia(g.media).matches!==!1)&&(d.state.loading&4)===0){if(d.instance===null){var v=ac(g.href),C=l.querySelector(Xu(v));if(C){l=C._p,l!==null&&typeof l=="object"&&typeof l.then=="function"&&(o.count++,o=tp.bind(o),l.then(o,o)),d.state.loading|=4,d.instance=C,Rn(C);return}C=l.ownerDocument||l,g=e5(g),(v=Pi.get(v))&&X1(g,v),C=C.createElement("link"),Rn(C);var M=C;M._p=new Promise(function(F,X){M.onload=F,M.onerror=X}),wr(C,"link",g),d.instance=C}o.stylesheets===null&&(o.stylesheets=new Map),o.stylesheets.set(d,l),(l=d.state.preload)&&(d.state.loading&3)===0&&(o.count++,d=tp.bind(o),l.addEventListener("load",d),l.addEventListener("error",d))}}var J1=0;function _M(o,l){return o.stylesheets&&o.count===0&&rp(o,o.stylesheets),0<o.count||0<o.imgCount?function(d){var g=setTimeout(function(){if(o.stylesheets&&rp(o,o.stylesheets),o.unsuspend){var C=o.unsuspend;o.unsuspend=null,C()}},6e4+l);0<o.imgBytes&&J1===0&&(J1=62500*pM());var v=setTimeout(function(){if(o.waitingForImages=!1,o.count===0&&(o.stylesheets&&rp(o,o.stylesheets),o.unsuspend)){var C=o.unsuspend;o.unsuspend=null,C()}},(o.imgBytes>J1?50:800)+l);return o.unsuspend=d,function(){o.unsuspend=null,clearTimeout(g),clearTimeout(v)}}:null}function tp(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)rp(this,this.stylesheets);else if(this.unsuspend){var o=this.unsuspend;this.unsuspend=null,o()}}}var np=null;function rp(o,l){o.stylesheets=null,o.unsuspend!==null&&(o.count++,np=new Map,l.forEach(LM,o),np=null,tp.call(o))}function LM(o,l){if(!(l.state.loading&4)){var d=np.get(o);if(d)var g=d.get(null);else{d=new Map,np.set(o,d);for(var v=o.querySelectorAll("link[data-precedence],style[data-precedence]"),C=0;C<v.length;C++){var M=v[C];(M.nodeName==="LINK"||M.getAttribute("media")!=="not all")&&(d.set(M.dataset.precedence,M),g=M)}g&&d.set(null,g)}v=l.instance,M=v.getAttribute("data-precedence"),C=d.get(M)||g,C===g&&d.set(null,v),d.set(M,v),this.count++,g=tp.bind(this),v.addEventListener("load",g),v.addEventListener("error",g),C?C.parentNode.insertBefore(v,C.nextSibling):(o=o.nodeType===9?o.head:o,o.insertBefore(v,o.firstChild)),l.state.loading|=4}}var Ju={$$typeof:N,Provider:null,Consumer:null,_currentValue:G,_currentValue2:G,_threadCount:0};function IM(o,l,d,g,v,C,M,F,X){this.tag=1,this.containerInfo=o,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=vn(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=vn(0),this.hiddenUpdates=vn(null),this.identifierPrefix=g,this.onUncaughtError=v,this.onCaughtError=C,this.onRecoverableError=M,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=X,this.incompleteTransitions=new Map}function o5(o,l,d,g,v,C,M,F,X,ue,ve,Ne){return o=new IM(o,l,d,M,X,ue,ve,Ne,F),l=1,C===!0&&(l|=24),C=oi(3,null,null,l),o.current=C,C.stateNode=o,l=Mg(),l.refCount++,o.pooledCache=l,l.refCount++,C.memoizedState={element:g,isDehydrated:d,cache:l},Ig(C),o}function s5(o){return o?(o=Fl,o):Fl}function a5(o,l,d,g,v,C){v=s5(v),g.context===null?g.context=v:g.pendingContext=v,g=Ds(l),g.payload={element:d},C=C===void 0?null:C,C!==null&&(g.callback=C),d=_s(o,g,l),d!==null&&(Gr(d,o,l),ju(d,o,l))}function l5(o,l){if(o=o.memoizedState,o!==null&&o.dehydrated!==null){var d=o.retryLane;o.retryLane=d!==0&&d<l?d:l}}function e2(o,l){l5(o,l),(o=o.alternate)&&l5(o,l)}function c5(o){if(o.tag===13||o.tag===31){var l=za(o,67108864);l!==null&&Gr(l,o,67108864),e2(o,67108864)}}function u5(o){if(o.tag===13||o.tag===31){var l=ui();l=se(l);var d=za(o,l);d!==null&&Gr(d,o,l),e2(o,l)}}var ip=!0;function PM(o,l,d,g){var v=z.T;z.T=null;var C=$.p;try{$.p=2,t2(o,l,d,g)}finally{$.p=C,z.T=v}}function zM(o,l,d,g){var v=z.T;z.T=null;var C=$.p;try{$.p=8,t2(o,l,d,g)}finally{$.p=C,z.T=v}}function t2(o,l,d,g){if(ip){var v=n2(g);if(v===null)H1(o,l,g,op,d),f5(o,g);else if(BM(v,o,l,d,g))g.stopPropagation();else if(f5(o,g),l&4&&-1<FM.indexOf(o)){for(;v!==null;){var C=Yt(v);if(C!==null)switch(C.tag){case 3:if(C=C.stateNode,C.current.memoizedState.isDehydrated){var M=Rt(C.pendingLanes);if(M!==0){var F=C;for(F.pendingLanes|=2,F.entangledLanes|=2;M;){var X=1<<31-nt(M);F.entanglements[1]|=X,M&=~X}go(C),(sn&6)===0&&(Hh=Ve()+500,Wu(0))}}break;case 31:case 13:F=za(C,2),F!==null&&Gr(F,C,2),Vh(),e2(C,2)}if(C=n2(g),C===null&&H1(o,l,g,op,d),C===v)break;v=C}v!==null&&g.stopPropagation()}else H1(o,l,g,null,d)}}function n2(o){return o=ig(o),r2(o)}var op=null;function r2(o){if(op=null,o=Ln(o),o!==null){var l=s(o);if(l===null)o=null;else{var d=l.tag;if(d===13){if(o=a(l),o!==null)return o;o=null}else if(d===31){if(o=c(l),o!==null)return o;o=null}else if(d===3){if(l.stateNode.current.memoizedState.isDehydrated)return l.tag===3?l.stateNode.containerInfo:null;o=null}else l!==o&&(o=null)}}return op=o,null}function d5(o){switch(o){case"beforetoggle":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"toggle":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 2;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"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(lt()){case oe:return 2;case ke:return 8;case Le:case Me:return 32;case He:return 268435456;default:return 32}default:return 32}}var i2=!1,$s=null,Ys=null,Ws=null,ed=new Map,td=new Map,Gs=[],FM="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".split(" ");function f5(o,l){switch(o){case"focusin":case"focusout":$s=null;break;case"dragenter":case"dragleave":Ys=null;break;case"mouseover":case"mouseout":Ws=null;break;case"pointerover":case"pointerout":ed.delete(l.pointerId);break;case"gotpointercapture":case"lostpointercapture":td.delete(l.pointerId)}}function nd(o,l,d,g,v,C){return o===null||o.nativeEvent!==C?(o={blockedOn:l,domEventName:d,eventSystemFlags:g,nativeEvent:C,targetContainers:[v]},l!==null&&(l=Yt(l),l!==null&&c5(l)),o):(o.eventSystemFlags|=g,l=o.targetContainers,v!==null&&l.indexOf(v)===-1&&l.push(v),o)}function BM(o,l,d,g,v){switch(l){case"focusin":return $s=nd($s,o,l,d,g,v),!0;case"dragenter":return Ys=nd(Ys,o,l,d,g,v),!0;case"mouseover":return Ws=nd(Ws,o,l,d,g,v),!0;case"pointerover":var C=v.pointerId;return ed.set(C,nd(ed.get(C)||null,o,l,d,g,v)),!0;case"gotpointercapture":return C=v.pointerId,td.set(C,nd(td.get(C)||null,o,l,d,g,v)),!0}return!1}function h5(o){var l=Ln(o.target);if(l!==null){var d=s(l);if(d!==null){if(l=d.tag,l===13){if(l=a(d),l!==null){o.blockedOn=l,st(o.priority,function(){u5(d)});return}}else if(l===31){if(l=c(d),l!==null){o.blockedOn=l,st(o.priority,function(){u5(d)});return}}else if(l===3&&d.stateNode.current.memoizedState.isDehydrated){o.blockedOn=d.tag===3?d.stateNode.containerInfo:null;return}}}o.blockedOn=null}function sp(o){if(o.blockedOn!==null)return!1;for(var l=o.targetContainers;0<l.length;){var d=n2(o.nativeEvent);if(d===null){d=o.nativeEvent;var g=new d.constructor(d.type,d);rg=g,d.target.dispatchEvent(g),rg=null}else return l=Yt(d),l!==null&&c5(l),o.blockedOn=d,!1;l.shift()}return!0}function p5(o,l,d){sp(o)&&d.delete(l)}function HM(){i2=!1,$s!==null&&sp($s)&&($s=null),Ys!==null&&sp(Ys)&&(Ys=null),Ws!==null&&sp(Ws)&&(Ws=null),ed.forEach(p5),td.forEach(p5)}function ap(o,l){o.blockedOn===l&&(o.blockedOn=null,i2||(i2=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,HM)))}var lp=null;function m5(o){lp!==o&&(lp=o,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){lp===o&&(lp=null);for(var l=0;l<o.length;l+=3){var d=o[l],g=o[l+1],v=o[l+2];if(typeof g!="function"){if(r2(g||d)===null)continue;break}var C=Yt(d);C!==null&&(o.splice(l,3),l-=3,n1(C,{pending:!0,data:v,method:d.method,action:g},g,v))}}))}function cc(o){function l(X){return ap(X,o)}$s!==null&&ap($s,o),Ys!==null&&ap(Ys,o),Ws!==null&&ap(Ws,o),ed.forEach(l),td.forEach(l);for(var d=0;d<Gs.length;d++){var g=Gs[d];g.blockedOn===o&&(g.blockedOn=null)}for(;0<Gs.length&&(d=Gs[0],d.blockedOn===null);)h5(d),d.blockedOn===null&&Gs.shift();if(d=(o.ownerDocument||o).$$reactFormReplay,d!=null)for(g=0;g<d.length;g+=3){var v=d[g],C=d[g+1],M=v[et]||null;if(typeof C=="function")M||m5(d);else if(M){var F=null;if(C&&C.hasAttribute("formAction")){if(v=C,M=C[et]||null)F=M.formAction;else if(r2(v)!==null)continue}else F=M.action;typeof F=="function"?d[g+1]=F:(d.splice(g,3),g-=3),m5(d)}}}function g5(){function o(C){C.canIntercept&&C.info==="react-transition"&&C.intercept({handler:function(){return new Promise(function(M){return v=M})},focusReset:"manual",scroll:"manual"})}function l(){v!==null&&(v(),v=null),g||setTimeout(d,20)}function d(){if(!g&&!navigation.transition){var C=navigation.currentEntry;C&&C.url!=null&&navigation.navigate(C.url,{state:C.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var g=!1,v=null;return navigation.addEventListener("navigate",o),navigation.addEventListener("navigatesuccess",l),navigation.addEventListener("navigateerror",l),setTimeout(d,100),function(){g=!0,navigation.removeEventListener("navigate",o),navigation.removeEventListener("navigatesuccess",l),navigation.removeEventListener("navigateerror",l),v!==null&&(v(),v=null)}}}function o2(o){this._internalRoot=o}cp.prototype.render=o2.prototype.render=function(o){var l=this._internalRoot;if(l===null)throw Error(r(409));var d=l.current,g=ui();a5(d,g,o,l,null,null)},cp.prototype.unmount=o2.prototype.unmount=function(){var o=this._internalRoot;if(o!==null){this._internalRoot=null;var l=o.containerInfo;a5(o.current,2,null,o,null,null),Vh(),l[ct]=null}};function cp(o){this._internalRoot=o}cp.prototype.unstable_scheduleHydration=function(o){if(o){var l=Be();o={blockedOn:null,target:o,priority:l};for(var d=0;d<Gs.length&&l!==0&&l<Gs[d].priority;d++);Gs.splice(d,0,o),d===0&&h5(o)}};var y5=t.version;if(y5!=="19.2.4")throw Error(r(527,y5,"19.2.4"));$.findDOMNode=function(o){var l=o._reactInternals;if(l===void 0)throw typeof o.render=="function"?Error(r(188)):(o=Object.keys(o).join(","),Error(r(268,o)));return o=f(l),o=o!==null?m(o):null,o=o===null?null:o.stateNode,o};var UM={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:z,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var up=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!up.isDisabled&&up.supportsFiber)try{Je=up.inject(UM),Ke=up}catch{}}return id.createRoot=function(o,l){if(!i(o))throw Error(r(299));var d=!1,g="",v=kS,C=ES,M=TS;return l!=null&&(l.unstable_strictMode===!0&&(d=!0),l.identifierPrefix!==void 0&&(g=l.identifierPrefix),l.onUncaughtError!==void 0&&(v=l.onUncaughtError),l.onCaughtError!==void 0&&(C=l.onCaughtError),l.onRecoverableError!==void 0&&(M=l.onRecoverableError)),l=o5(o,1,!1,null,null,d,g,null,v,C,M,g5),o[ct]=l.current,B1(o),new o2(l)},id.hydrateRoot=function(o,l,d){if(!i(o))throw Error(r(299));var g=!1,v="",C=kS,M=ES,F=TS,X=null;return d!=null&&(d.unstable_strictMode===!0&&(g=!0),d.identifierPrefix!==void 0&&(v=d.identifierPrefix),d.onUncaughtError!==void 0&&(C=d.onUncaughtError),d.onCaughtError!==void 0&&(M=d.onCaughtError),d.onRecoverableError!==void 0&&(F=d.onRecoverableError),d.formState!==void 0&&(X=d.formState)),l=o5(o,1,!0,l,d??null,g,v,X,C,M,F,g5),l.context=s5(null),d=l.current,g=ui(),g=se(g),v=Ds(g),v.callback=null,_s(d,v,g),d=g,l.current.lanes=d,Ut(l,d),go(l),o[ct]=l.current,B1(o),new cp(l)},id.version="19.2.4",id}var N5;function ZM(){if(N5)return a2.exports;N5=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),a2.exports=XM(),a2.exports}var JM=ZM(),w=xf();const le=Zc(w),Zx=qM({__proto__:null,default:le},[w]);var eD=(e,t,n,r,i,s,a,c)=>{let u=document.documentElement,f=["light","dark"];function m(x){(Array.isArray(e)?e:[e]).forEach(b=>{let S=b==="class",k=S&&s?i.map(E=>s[E]||E):i;S?(u.classList.remove(...k),u.classList.add(s&&s[x]?s[x]:x)):u.setAttribute(b,x)}),p(x)}function p(x){c&&f.includes(x)&&(u.style.colorScheme=x)}function y(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(r)m(r);else try{let x=localStorage.getItem(t)||n,b=a&&x==="system"?y():x;m(b)}catch{}},tD=w.createContext(void 0),nD={setTheme:e=>{},themes:[]},rD=()=>{var e;return(e=w.useContext(tD))!=null?e:nD};w.memo(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:r,enableColorScheme:i,defaultTheme:s,value:a,themes:c,nonce:u,scriptProps:f})=>{let m=JSON.stringify([n,t,s,e,c,a,r,i]).slice(1,-1);return w.createElement("script",{...f,suppressHydrationWarning:!0,nonce:typeof window>"u"?u:"",dangerouslySetInnerHTML:{__html:`(${eD.toString()})(${m})`}})});var vi=s6();const iD=Zc(vi);function oD(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}const sD=e=>{switch(e){case"success":return cD;case"info":return dD;case"warning":return uD;case"error":return fD;default:return null}},aD=Array(12).fill(0),lD=({visible:e,className:t})=>le.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},le.createElement("div",{className:"sonner-spinner"},aD.map((n,r)=>le.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),cD=le.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},le.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),uD=le.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},le.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),dD=le.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},le.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),fD=le.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},le.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),hD=le.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},le.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),le.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),pD=()=>{const[e,t]=le.useState(document.hidden);return le.useEffect(()=>{const n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e};let Ny=1;class mD{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const n=this.subscribers.indexOf(t);this.subscribers.splice(n,1)}),this.publish=t=>{this.subscribers.forEach(n=>n(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var n;const{message:r,...i}=t,s=typeof t?.id=="number"||((n=t.id)==null?void 0:n.length)>0?t.id:Ny++,a=this.toasts.find(u=>u.id===s),c=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(s)&&this.dismissedToasts.delete(s),a?this.toasts=this.toasts.map(u=>u.id===s?(this.publish({...u,...t,id:s,title:r}),{...u,...t,id:s,dismissible:c,title:r}):u):this.addToast({title:r,...i,dismissible:c,id:s}),s},this.dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(n=>n({id:t,dismiss:!0})))):this.toasts.forEach(n=>{this.subscribers.forEach(r=>r({id:n.id,dismiss:!0}))}),t),this.message=(t,n)=>this.create({...n,message:t}),this.error=(t,n)=>this.create({...n,message:t,type:"error"}),this.success=(t,n)=>this.create({...n,type:"success",message:t}),this.info=(t,n)=>this.create({...n,type:"info",message:t}),this.warning=(t,n)=>this.create({...n,type:"warning",message:t}),this.loading=(t,n)=>this.create({...n,type:"loading",message:t}),this.promise=(t,n)=>{if(!n)return;let r;n.loading!==void 0&&(r=this.create({...n,promise:t,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const i=Promise.resolve(t instanceof Function?t():t);let s=r!==void 0,a;const c=i.then(async f=>{if(a=["resolve",f],le.isValidElement(f))s=!1,this.create({id:r,type:"default",message:f});else if(yD(f)&&!f.ok){s=!1;const p=typeof n.error=="function"?await n.error(`HTTP error! status: ${f.status}`):n.error,y=typeof n.description=="function"?await n.description(`HTTP error! status: ${f.status}`):n.description,b=typeof p=="object"&&!le.isValidElement(p)?p:{message:p};this.create({id:r,type:"error",description:y,...b})}else if(f instanceof Error){s=!1;const p=typeof n.error=="function"?await n.error(f):n.error,y=typeof n.description=="function"?await n.description(f):n.description,b=typeof p=="object"&&!le.isValidElement(p)?p:{message:p};this.create({id:r,type:"error",description:y,...b})}else if(n.success!==void 0){s=!1;const p=typeof n.success=="function"?await n.success(f):n.success,y=typeof n.description=="function"?await n.description(f):n.description,b=typeof p=="object"&&!le.isValidElement(p)?p:{message:p};this.create({id:r,type:"success",description:y,...b})}}).catch(async f=>{if(a=["reject",f],n.error!==void 0){s=!1;const m=typeof n.error=="function"?await n.error(f):n.error,p=typeof n.description=="function"?await n.description(f):n.description,x=typeof m=="object"&&!le.isValidElement(m)?m:{message:m};this.create({id:r,type:"error",description:p,...x})}}).finally(()=>{s&&(this.dismiss(r),r=void 0),n.finally==null||n.finally.call(n)}),u=()=>new Promise((f,m)=>c.then(()=>a[0]==="reject"?m(a[1]):f(a[1])).catch(m));return typeof r!="string"&&typeof r!="number"?{unwrap:u}:Object.assign(r,{unwrap:u})},this.custom=(t,n)=>{const r=n?.id||Ny++;return this.create({jsx:t(r),id:r,...n}),r},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const Qr=new mD,gD=(e,t)=>{const n=t?.id||Ny++;return Qr.addToast({title:e,...t,id:n}),n},yD=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",xD=gD,bD=()=>Qr.toasts,vD=()=>Qr.getActiveToasts(),ht=Object.assign(xD,{success:Qr.success,info:Qr.info,warning:Qr.warning,error:Qr.error,custom:Qr.custom,message:Qr.message,promise:Qr.promise,dismiss:Qr.dismiss,loading:Qr.loading},{getHistory:bD,getToasts:vD});oD("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function dp(e){return e.label!==void 0}const wD=3,SD="24px",CD="16px",R5=4e3,kD=356,ED=14,TD=45,ND=200;function yo(...e){return e.filter(Boolean).join(" ")}function RD(e){const[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}const AD=e=>{var t,n,r,i,s,a,c,u,f;const{invert:m,toast:p,unstyled:y,interacting:x,setHeights:b,visibleToasts:S,heights:k,index:E,toasts:T,expanded:N,removeToast:j,defaultRichColors:O,closeButton:A,style:R,cancelButtonStyle:L,actionButtonStyle:B,className:I="",descriptionClassName:U="",duration:Y,position:V,gap:q,expandByDefault:H,classNames:z,icons:$,closeButtonAriaLabel:G="Close toast"}=e,[Q,_]=le.useState(null),[P,W]=le.useState(null),[D,Z]=le.useState(!1),[ee,J]=le.useState(!1),[he,fe]=le.useState(!1),[Se,Ae]=le.useState(!1),[Oe,Pe]=le.useState(!1),[_e,De]=le.useState(0),[xe,Ge]=le.useState(0),we=le.useRef(p.duration||Y||R5),Re=le.useRef(null),pe=le.useRef(null),be=E===0,ne=E+1<=S,ye=p.type,Ce=p.dismissible!==!1,Ve=p.className||"",lt=p.descriptionClassName||"",oe=le.useMemo(()=>k.findIndex(Ie=>Ie.toastId===p.id)||0,[k,p.id]),ke=le.useMemo(()=>{var Ie;return(Ie=p.closeButton)!=null?Ie:A},[p.closeButton,A]),Le=le.useMemo(()=>p.duration||Y||R5,[p.duration,Y]),Me=le.useRef(0),He=le.useRef(0),ut=le.useRef(0),xt=le.useRef(null),[Je,Ke]=V.split("-"),bt=le.useMemo(()=>k.reduce((Ie,Pt,on)=>on>=oe?Ie:Ie+Pt.height,0),[k,oe]),nt=pD(),Qe=p.invert||m,Ct=ye==="loading";He.current=le.useMemo(()=>oe*q+bt,[oe,bt]),le.useEffect(()=>{we.current=Le},[Le]),le.useEffect(()=>{Z(!0)},[]),le.useEffect(()=>{const Ie=pe.current;if(Ie){const Pt=Ie.getBoundingClientRect().height;return Ge(Pt),b(on=>[{toastId:p.id,height:Pt,position:p.position},...on]),()=>b(on=>on.filter(tn=>tn.toastId!==p.id))}},[b,p.id]),le.useLayoutEffect(()=>{if(!D)return;const Ie=pe.current,Pt=Ie.style.height;Ie.style.height="auto";const on=Ie.getBoundingClientRect().height;Ie.style.height=Pt,Ge(on),b(tn=>tn.find(Ut=>Ut.toastId===p.id)?tn.map(Ut=>Ut.toastId===p.id?{...Ut,height:on}:Ut):[{toastId:p.id,height:on,position:p.position},...tn])},[D,p.title,p.description,b,p.id,p.jsx,p.action,p.cancel]);const qe=le.useCallback(()=>{J(!0),De(He.current),b(Ie=>Ie.filter(Pt=>Pt.toastId!==p.id)),setTimeout(()=>{j(p)},ND)},[p,j,b,He]);le.useEffect(()=>{if(p.promise&&ye==="loading"||p.duration===1/0||p.type==="loading")return;let Ie;return N||x||nt?(()=>{if(ut.current<Me.current){const tn=new Date().getTime()-Me.current;we.current=we.current-tn}ut.current=new Date().getTime()})():we.current!==1/0&&(Me.current=new Date().getTime(),Ie=setTimeout(()=>{p.onAutoClose==null||p.onAutoClose.call(p,p),qe()},we.current)),()=>clearTimeout(Ie)},[N,x,p,ye,nt,qe]),le.useEffect(()=>{p.delete&&(qe(),p.onDismiss==null||p.onDismiss.call(p,p))},[qe,p.delete]);function ge(){var Ie;if($?.loading){var Pt;return le.createElement("div",{className:yo(z?.loader,p==null||(Pt=p.classNames)==null?void 0:Pt.loader,"sonner-loader"),"data-visible":ye==="loading"},$.loading)}return le.createElement(lD,{className:yo(z?.loader,p==null||(Ie=p.classNames)==null?void 0:Ie.loader),visible:ye==="loading"})}const je=p.icon||$?.[ye]||sD(ye);var Ye,Rt;return le.createElement("li",{tabIndex:0,ref:pe,className:yo(I,Ve,z?.toast,p==null||(t=p.classNames)==null?void 0:t.toast,z?.default,z?.[ye],p==null||(n=p.classNames)==null?void 0:n[ye]),"data-sonner-toast":"","data-rich-colors":(Ye=p.richColors)!=null?Ye:O,"data-styled":!(p.jsx||p.unstyled||y),"data-mounted":D,"data-promise":!!p.promise,"data-swiped":Oe,"data-removed":ee,"data-visible":ne,"data-y-position":Je,"data-x-position":Ke,"data-index":E,"data-front":be,"data-swiping":he,"data-dismissible":Ce,"data-type":ye,"data-invert":Qe,"data-swipe-out":Se,"data-swipe-direction":P,"data-expanded":!!(N||H&&D),"data-testid":p.testId,style:{"--index":E,"--toasts-before":E,"--z-index":T.length-E,"--offset":`${ee?_e:He.current}px`,"--initial-height":H?"auto":`${xe}px`,...R,...p.style},onDragEnd:()=>{fe(!1),_(null),xt.current=null},onPointerDown:Ie=>{Ie.button!==2&&(Ct||!Ce||(Re.current=new Date,De(He.current),Ie.target.setPointerCapture(Ie.pointerId),Ie.target.tagName!=="BUTTON"&&(fe(!0),xt.current={x:Ie.clientX,y:Ie.clientY})))},onPointerUp:()=>{var Ie,Pt,on;if(Se||!Ce)return;xt.current=null;const tn=Number(((Ie=pe.current)==null?void 0:Ie.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),vn=Number(((Pt=pe.current)==null?void 0:Pt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Ut=new Date().getTime()-((on=Re.current)==null?void 0:on.getTime()),yt=Q==="x"?tn:vn,zt=Math.abs(yt)/Ut;if(Math.abs(yt)>=TD||zt>.11){De(He.current),p.onDismiss==null||p.onDismiss.call(p,p),W(Q==="x"?tn>0?"right":"left":vn>0?"down":"up"),qe(),Ae(!0);return}else{var K,te;(K=pe.current)==null||K.style.setProperty("--swipe-amount-x","0px"),(te=pe.current)==null||te.style.setProperty("--swipe-amount-y","0px")}Pe(!1),fe(!1),_(null)},onPointerMove:Ie=>{var Pt,on,tn;if(!xt.current||!Ce||((Pt=window.getSelection())==null?void 0:Pt.toString().length)>0)return;const Ut=Ie.clientY-xt.current.y,yt=Ie.clientX-xt.current.x;var zt;const K=(zt=e.swipeDirections)!=null?zt:RD(V);!Q&&(Math.abs(yt)>1||Math.abs(Ut)>1)&&_(Math.abs(yt)>Math.abs(Ut)?"x":"y");let te={x:0,y:0};const se=Te=>1/(1.5+Math.abs(Te)/20);if(Q==="y"){if(K.includes("top")||K.includes("bottom"))if(K.includes("top")&&Ut<0||K.includes("bottom")&&Ut>0)te.y=Ut;else{const Te=Ut*se(Ut);te.y=Math.abs(Te)<Math.abs(Ut)?Te:Ut}}else if(Q==="x"&&(K.includes("left")||K.includes("right")))if(K.includes("left")&&yt<0||K.includes("right")&&yt>0)te.x=yt;else{const Te=yt*se(yt);te.x=Math.abs(Te)<Math.abs(yt)?Te:yt}(Math.abs(te.x)>0||Math.abs(te.y)>0)&&Pe(!0),(on=pe.current)==null||on.style.setProperty("--swipe-amount-x",`${te.x}px`),(tn=pe.current)==null||tn.style.setProperty("--swipe-amount-y",`${te.y}px`)}},ke&&!p.jsx&&ye!=="loading"?le.createElement("button",{"aria-label":G,"data-disabled":Ct,"data-close-button":!0,onClick:Ct||!Ce?()=>{}:()=>{qe(),p.onDismiss==null||p.onDismiss.call(p,p)},className:yo(z?.closeButton,p==null||(r=p.classNames)==null?void 0:r.closeButton)},(Rt=$?.close)!=null?Rt:hD):null,(ye||p.icon||p.promise)&&p.icon!==null&&($?.[ye]!==null||p.icon)?le.createElement("div",{"data-icon":"",className:yo(z?.icon,p==null||(i=p.classNames)==null?void 0:i.icon)},p.promise||p.type==="loading"&&!p.icon?p.icon||ge():null,p.type!=="loading"?je:null):null,le.createElement("div",{"data-content":"",className:yo(z?.content,p==null||(s=p.classNames)==null?void 0:s.content)},le.createElement("div",{"data-title":"",className:yo(z?.title,p==null||(a=p.classNames)==null?void 0:a.title)},p.jsx?p.jsx:typeof p.title=="function"?p.title():p.title),p.description?le.createElement("div",{"data-description":"",className:yo(U,lt,z?.description,p==null||(c=p.classNames)==null?void 0:c.description)},typeof p.description=="function"?p.description():p.description):null),le.isValidElement(p.cancel)?p.cancel:p.cancel&&dp(p.cancel)?le.createElement("button",{"data-button":!0,"data-cancel":!0,style:p.cancelButtonStyle||L,onClick:Ie=>{dp(p.cancel)&&Ce&&(p.cancel.onClick==null||p.cancel.onClick.call(p.cancel,Ie),qe())},className:yo(z?.cancelButton,p==null||(u=p.classNames)==null?void 0:u.cancelButton)},p.cancel.label):null,le.isValidElement(p.action)?p.action:p.action&&dp(p.action)?le.createElement("button",{"data-button":!0,"data-action":!0,style:p.actionButtonStyle||B,onClick:Ie=>{dp(p.action)&&(p.action.onClick==null||p.action.onClick.call(p.action,Ie),!Ie.defaultPrevented&&qe())},className:yo(z?.actionButton,p==null||(f=p.classNames)==null?void 0:f.actionButton)},p.action.label):null)};function A5(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function OD(e,t){const n={};return[e,t].forEach((r,i)=>{const s=i===1,a=s?"--mobile-offset":"--offset",c=s?CD:SD;function u(f){["top","right","bottom","left"].forEach(m=>{n[`${a}-${m}`]=typeof f=="number"?`${f}px`:f})}typeof r=="number"||typeof r=="string"?u(r):typeof r=="object"?["top","right","bottom","left"].forEach(f=>{r[f]===void 0?n[`${a}-${f}`]=c:n[`${a}-${f}`]=typeof r[f]=="number"?`${r[f]}px`:r[f]}):u(c)}),n}const jD=le.forwardRef(function(t,n){const{id:r,invert:i,position:s="bottom-right",hotkey:a=["altKey","KeyT"],expand:c,closeButton:u,className:f,offset:m,mobileOffset:p,theme:y="light",richColors:x,duration:b,style:S,visibleToasts:k=wD,toastOptions:E,dir:T=A5(),gap:N=ED,icons:j,containerAriaLabel:O="Notifications"}=t,[A,R]=le.useState([]),L=le.useMemo(()=>r?A.filter(D=>D.toasterId===r):A.filter(D=>!D.toasterId),[A,r]),B=le.useMemo(()=>Array.from(new Set([s].concat(L.filter(D=>D.position).map(D=>D.position)))),[L,s]),[I,U]=le.useState([]),[Y,V]=le.useState(!1),[q,H]=le.useState(!1),[z,$]=le.useState(y!=="system"?y:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),G=le.useRef(null),Q=a.join("+").replace(/Key/g,"").replace(/Digit/g,""),_=le.useRef(null),P=le.useRef(!1),W=le.useCallback(D=>{R(Z=>{var ee;return(ee=Z.find(J=>J.id===D.id))!=null&&ee.delete||Qr.dismiss(D.id),Z.filter(({id:J})=>J!==D.id)})},[]);return le.useEffect(()=>Qr.subscribe(D=>{if(D.dismiss){requestAnimationFrame(()=>{R(Z=>Z.map(ee=>ee.id===D.id?{...ee,delete:!0}:ee))});return}setTimeout(()=>{iD.flushSync(()=>{R(Z=>{const ee=Z.findIndex(J=>J.id===D.id);return ee!==-1?[...Z.slice(0,ee),{...Z[ee],...D},...Z.slice(ee+1)]:[D,...Z]})})})}),[A]),le.useEffect(()=>{if(y!=="system"){$(y);return}if(y==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?$("dark"):$("light")),typeof window>"u")return;const D=window.matchMedia("(prefers-color-scheme: dark)");try{D.addEventListener("change",({matches:Z})=>{$(Z?"dark":"light")})}catch{D.addListener(({matches:ee})=>{try{$(ee?"dark":"light")}catch(J){console.error(J)}})}},[y]),le.useEffect(()=>{A.length<=1&&V(!1)},[A]),le.useEffect(()=>{const D=Z=>{var ee;if(a.every(fe=>Z[fe]||Z.code===fe)){var he;V(!0),(he=G.current)==null||he.focus()}Z.code==="Escape"&&(document.activeElement===G.current||(ee=G.current)!=null&&ee.contains(document.activeElement))&&V(!1)};return document.addEventListener("keydown",D),()=>document.removeEventListener("keydown",D)},[a]),le.useEffect(()=>{if(G.current)return()=>{_.current&&(_.current.focus({preventScroll:!0}),_.current=null,P.current=!1)}},[G.current]),le.createElement("section",{ref:n,"aria-label":`${O} ${Q}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},B.map((D,Z)=>{var ee;const[J,he]=D.split("-");return L.length?le.createElement("ol",{key:D,dir:T==="auto"?A5():T,tabIndex:-1,ref:G,className:f,"data-sonner-toaster":!0,"data-sonner-theme":z,"data-y-position":J,"data-x-position":he,style:{"--front-toast-height":`${((ee=I[0])==null?void 0:ee.height)||0}px`,"--width":`${kD}px`,"--gap":`${N}px`,...S,...OD(m,p)},onBlur:fe=>{P.current&&!fe.currentTarget.contains(fe.relatedTarget)&&(P.current=!1,_.current&&(_.current.focus({preventScroll:!0}),_.current=null))},onFocus:fe=>{fe.target instanceof HTMLElement&&fe.target.dataset.dismissible==="false"||P.current||(P.current=!0,_.current=fe.relatedTarget)},onMouseEnter:()=>V(!0),onMouseMove:()=>V(!0),onMouseLeave:()=>{q||V(!1)},onDragEnd:()=>V(!1),onPointerDown:fe=>{fe.target instanceof HTMLElement&&fe.target.dataset.dismissible==="false"||H(!0)},onPointerUp:()=>H(!1)},L.filter(fe=>!fe.position&&Z===0||fe.position===D).map((fe,Se)=>{var Ae,Oe;return le.createElement(AD,{key:fe.id,icons:j,index:Se,toast:fe,defaultRichColors:x,duration:(Ae=E?.duration)!=null?Ae:b,className:E?.className,descriptionClassName:E?.descriptionClassName,invert:i,visibleToasts:k,closeButton:(Oe=E?.closeButton)!=null?Oe:u,interacting:q,position:D,style:E?.style,unstyled:E?.unstyled,classNames:E?.classNames,cancelButtonStyle:E?.cancelButtonStyle,actionButtonStyle:E?.actionButtonStyle,closeButtonAriaLabel:E?.closeButtonAriaLabel,removeToast:W,toasts:L.filter(Pe=>Pe.position==fe.position),heights:I.filter(Pe=>Pe.position==fe.position),setHeights:U,expandByDefault:c,gap:N,expanded:Y,swipeDirections:t.swipeDirections})})):null}))});const a6=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();const MD=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const DD=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase());const O5=e=>{const t=DD(e);return t.charAt(0).toUpperCase()+t.slice(1)};var _D={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const LD=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};const ID=w.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:s,iconNode:a,...c},u)=>w.createElement("svg",{ref:u,..._D,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:a6("lucide",i),...!s&&!LD(c)&&{"aria-hidden":"true"},...c},[...a.map(([f,m])=>w.createElement(f,m)),...Array.isArray(s)?s:[s]]));const Kn=(e,t)=>{const n=w.forwardRef(({className:r,...i},s)=>w.createElement(ID,{ref:s,iconNode:t,className:a6(`lucide-${MD(O5(e))}`,`lucide-${e}`,r),...i}));return n.displayName=O5(e),n};const PD=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],bf=Kn("check",PD);const zD=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],e0=Kn("chevron-down",zD);const FD=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],l6=Kn("chevron-left",FD);const BD=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],t0=Kn("chevron-right",BD);const HD=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],UD=Kn("chevron-up",HD);const VD=[["path",{d:"m11 17-5-5 5-5",key:"13zhaf"}],["path",{d:"m18 17-5-5 5-5",key:"h8a8et"}]],qD=Kn("chevrons-left",VD);const $D=[["path",{d:"m6 17 5-5-5-5",key:"xnjwq"}],["path",{d:"m13 17 5-5-5-5",key:"17xmmf"}]],YD=Kn("chevrons-right",$D);const WD=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],GD=Kn("circle-check",WD);const KD=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],QD=Kn("circle",KD);const XD=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],ZD=Kn("copy",XD);const JD=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]],e_=Kn("ellipsis-vertical",JD);const t_=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],n_=Kn("ellipsis",t_);const r_=[["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"}]],c6=Kn("file-text",r_);const i_=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],Ry=Kn("folder",i_);const o_=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],s_=Kn("history",o_);const a_=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],l_=Kn("info",a_);const c_=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Yd=Kn("loader-circle",c_);const u_=[["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z",key:"2d38gg"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],d_=Kn("octagon-x",u_);const f_=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],h_=Kn("pencil",f_);const p_=[["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"}]],m_=Kn("triangle-alert",p_);const g_=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],n0=Kn("x",g_),y_=({...e})=>{const{theme:t="system"}=rD();return h.jsx(jD,{theme:t,className:"toaster group",icons:{success:h.jsx(GD,{className:"size-5 text-green-500"}),info:h.jsx(l_,{className:"size-5 text-blue-500"}),warning:h.jsx(m_,{className:"size-5 text-yellow-500"}),error:h.jsx(d_,{className:"size-5 text-red-500"}),loading:h.jsx(Yd,{className:"size-5 animate-spin"})},style:{"--normal-bg":"var(--popover)","--normal-text":"var(--popover-foreground)","--normal-border":"var(--border)","--border-radius":"var(--radius)"},toastOptions:{classNames:{description:"whitespace-pre-line",toast:"cn-toast"}},...e})};var u6=e=>{throw TypeError(e)},x_=(e,t,n)=>t.has(e)||u6("Cannot "+n),f2=(e,t,n)=>(x_(e,t,"read from private field"),n?n.call(e):t.get(e)),b_=(e,t,n)=>t.has(e)?u6("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),j5="popstate";function v_(e={}){function t(r,i){let{pathname:s,search:a,hash:c}=r.location;return Wd("",{pathname:s,search:a,hash:c},i.state&&i.state.usr||null,i.state&&i.state.key||"default")}function n(r,i){return typeof i=="string"?i:Ao(i)}return S_(t,n,null,e)}function It(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Hn(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function w_(){return Math.random().toString(36).substring(2,10)}function M5(e,t){return{usr:e.state,key:e.key,idx:t}}function Wd(e,t,n=null,r){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?ya(t):t,state:n,key:t&&t.key||r||w_()}}function Ao({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function ya(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function S_(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:s=!1}=r,a=i.history,c="POP",u=null,f=m();f==null&&(f=0,a.replaceState({...a.state,idx:f},""));function m(){return(a.state||{idx:null}).idx}function p(){c="POP";let k=m(),E=k==null?null:k-f;f=k,u&&u({action:c,location:S.location,delta:E})}function y(k,E){c="PUSH";let T=Wd(S.location,k,E);f=m()+1;let N=M5(T,f),j=S.createHref(T);try{a.pushState(N,"",j)}catch(O){if(O instanceof DOMException&&O.name==="DataCloneError")throw O;i.location.assign(j)}s&&u&&u({action:c,location:S.location,delta:1})}function x(k,E){c="REPLACE";let T=Wd(S.location,k,E);f=m();let N=M5(T,f),j=S.createHref(T);a.replaceState(N,"",j),s&&u&&u({action:c,location:S.location,delta:0})}function b(k){return d6(k)}let S={get action(){return c},get location(){return e(i,a)},listen(k){if(u)throw new Error("A history only accepts one active listener");return i.addEventListener(j5,p),u=k,()=>{i.removeEventListener(j5,p),u=null}},createHref(k){return t(i,k)},createURL:b,encodeLocation(k){let E=b(k);return{pathname:E.pathname,search:E.search,hash:E.hash}},push:y,replace:x,go(k){return a.go(k)}};return S}function d6(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),It(n,"No window.location.(origin|href) available to create URL");let r=typeof e=="string"?e:Ao(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}var Ed,D5=class{constructor(e){if(b_(this,Ed,new Map),e)for(let[t,n]of e)this.set(t,n)}get(e){if(f2(this,Ed).has(e))return f2(this,Ed).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw new Error("No value found for context")}set(e,t){f2(this,Ed).set(e,t)}};Ed=new WeakMap;var C_=new Set(["lazy","caseSensitive","path","id","index","children"]);function k_(e){return C_.has(e)}var E_=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function T_(e){return E_.has(e)}function N_(e){return e.index===!0}function Gd(e,t,n=[],r={},i=!1){return e.map((s,a)=>{let c=[...n,String(a)],u=typeof s.id=="string"?s.id:c.join("-");if(It(s.index!==!0||!s.children,"Cannot specify children on an index route"),It(i||!r[u],`Found a route id collision on id "${u}". Route id's must be globally unique within Data Router usages`),N_(s)){let f={...s,id:u};return r[u]=_5(f,t(f)),f}else{let f={...s,id:u,children:void 0};return r[u]=_5(f,t(f)),s.children&&(f.children=Gd(s.children,t,c,r,i)),f}})}function _5(e,t){return Object.assign(e,{...t,...typeof t.lazy=="object"&&t.lazy!=null?{lazy:{...e.lazy,...t.lazy}}:{}})}function ea(e,t,n="/"){return Td(e,t,n,!1)}function Td(e,t,n,r){let i=typeof t=="string"?ya(t):t,s=Yi(i.pathname||"/",n);if(s==null)return null;let a=f6(e);A_(a);let c=null;for(let u=0;c==null&&u<a.length;++u){let f=B_(s);c=z_(a[u],f,r)}return c}function R_(e,t){let{route:n,pathname:r,params:i}=e;return{id:n.id,pathname:r,params:i,data:t[n.id],loaderData:t[n.id],handle:n.handle}}function f6(e,t=[],n=[],r="",i=!1){let s=(a,c,u=i,f)=>{let m={relativePath:f===void 0?a.path||"":f,caseSensitive:a.caseSensitive===!0,childrenIndex:c,route:a};if(m.relativePath.startsWith("/")){if(!m.relativePath.startsWith(r)&&u)return;It(m.relativePath.startsWith(r),`Absolute route path "${m.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),m.relativePath=m.relativePath.slice(r.length)}let p=Co([r,m.relativePath]),y=n.concat(m);a.children&&a.children.length>0&&(It(a.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${p}".`),f6(a.children,t,y,p,u)),!(a.path==null&&!a.index)&&t.push({path:p,score:I_(p,a.index),routesMeta:y})};return e.forEach((a,c)=>{if(a.path===""||!a.path?.includes("?"))s(a,c);else for(let u of h6(a.path))s(a,c,!0,u)}),t}function h6(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,i=n.endsWith("?"),s=n.replace(/\?$/,"");if(r.length===0)return i?[s,""]:[s];let a=h6(r.join("/")),c=[];return c.push(...a.map(u=>u===""?s:[s,u].join("/"))),i&&c.push(...a),c.map(u=>e.startsWith("/")&&u===""?"/":u)}function A_(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:P_(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var O_=/^:[\w-]+$/,j_=3,M_=2,D_=1,__=10,L_=-2,L5=e=>e==="*";function I_(e,t){let n=e.split("/"),r=n.length;return n.some(L5)&&(r+=L_),t&&(r+=M_),n.filter(i=>!L5(i)).reduce((i,s)=>i+(O_.test(s)?j_:s===""?D_:__),r)}function P_(e,t){return e.length===t.length&&e.slice(0,-1).every((r,i)=>r===t[i])?e[e.length-1]-t[t.length-1]:0}function z_(e,t,n=!1){let{routesMeta:r}=e,i={},s="/",a=[];for(let c=0;c<r.length;++c){let u=r[c],f=c===r.length-1,m=s==="/"?t:t.slice(s.length)||"/",p=mm({path:u.relativePath,caseSensitive:u.caseSensitive,end:f},m),y=u.route;if(!p&&f&&n&&!r[r.length-1].route.index&&(p=mm({path:u.relativePath,caseSensitive:u.caseSensitive,end:!1},m)),!p)return null;Object.assign(i,p.params),a.push({params:i,pathname:Co([s,p.pathname]),pathnameBase:V_(Co([s,p.pathnameBase])),route:y}),p.pathnameBase!=="/"&&(s=Co([s,p.pathnameBase]))}return a}function mm(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=F_(e.path,e.caseSensitive,e.end),i=t.match(n);if(!i)return null;let s=i[0],a=s.replace(/(.)\/+$/,"$1"),c=i.slice(1);return{params:r.reduce((f,{paramName:m,isOptional:p},y)=>{if(m==="*"){let b=c[y]||"";a=s.slice(0,s.length-b.length).replace(/(.)\/+$/,"$1")}const x=c[y];return p&&!x?f[m]=void 0:f[m]=(x||"").replace(/%2F/g,"/"),f},{}),pathname:s,pathnameBase:a,pattern:e}}function F_(e,t=!1,n=!0){Hn(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let r=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(a,c,u)=>(r.push({paramName:c,isOptional:u!=null}),u?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(r.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),r]}function B_(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Hn(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function Yi(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function H_({basename:e,pathname:t}){return t==="/"?e:Co([e,t])}var p6=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Jx=e=>p6.test(e);function U_(e,t="/"){let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?ya(e):e,s;return n?(n=n.replace(/\/\/+/g,"/"),n.startsWith("/")?s=I5(n.substring(1),"/"):s=I5(n,t)):s=t,{pathname:s,search:q_(r),hash:$_(i)}}function I5(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function h2(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function m6(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function r0(e){let t=m6(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function i0(e,t,n,r=!1){let i;typeof e=="string"?i=ya(e):(i={...e},It(!i.pathname||!i.pathname.includes("?"),h2("?","pathname","search",i)),It(!i.pathname||!i.pathname.includes("#"),h2("#","pathname","hash",i)),It(!i.search||!i.search.includes("#"),h2("#","search","hash",i)));let s=e===""||i.pathname==="",a=s?"/":i.pathname,c;if(a==null)c=n;else{let p=t.length-1;if(!r&&a.startsWith("..")){let y=a.split("/");for(;y[0]==="..";)y.shift(),p-=1;i.pathname=y.join("/")}c=p>=0?t[p]:"/"}let u=U_(i,c),f=a&&a!=="/"&&a.endsWith("/"),m=(s||a===".")&&n.endsWith("/");return!u.pathname.endsWith("/")&&(f||m)&&(u.pathname+="/"),u}var Co=e=>e.join("/").replace(/\/\/+/g,"/"),V_=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),q_=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,$_=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,vf=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||"",this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function Kd(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function wf(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var g6=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function y6(e,t){let n=e;if(typeof n!="string"||!p6.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(g6)try{let s=new URL(window.location.href),a=n.startsWith("//")?new URL(s.protocol+n):new URL(n),c=Yi(a.pathname,t);a.origin===s.origin&&c!=null?n=c+a.search+a.hash:i=!0}catch{Hn(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:i,to:n}}var oa=Symbol("Uninstrumented");function Y_(e,t){let n={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};e.forEach(i=>i({id:t.id,index:t.index,path:t.path,instrument(s){let a=Object.keys(n);for(let c of a)s[c]&&n[c].push(s[c])}}));let r={};if(typeof t.lazy=="function"&&n.lazy.length>0){let i=Cc(n.lazy,t.lazy,()=>{});i&&(r.lazy=i)}if(typeof t.lazy=="object"){let i=t.lazy;["middleware","loader","action"].forEach(s=>{let a=i[s],c=n[`lazy.${s}`];if(typeof a=="function"&&c.length>0){let u=Cc(c,a,()=>{});u&&(r.lazy=Object.assign(r.lazy||{},{[s]:u}))}})}return["loader","action"].forEach(i=>{let s=t[i];if(typeof s=="function"&&n[i].length>0){let a=s[oa]??s,c=Cc(n[i],a,(...u)=>P5(u[0]));c&&(i==="loader"&&a.hydrate===!0&&(c.hydrate=!0),c[oa]=a,r[i]=c)}}),t.middleware&&t.middleware.length>0&&n.middleware.length>0&&(r.middleware=t.middleware.map(i=>{let s=i[oa]??i,a=Cc(n.middleware,s,(...c)=>P5(c[0]));return a?(a[oa]=s,a):i})),r}function W_(e,t){let n={navigate:[],fetch:[]};if(t.forEach(r=>r({instrument(i){let s=Object.keys(i);for(let a of s)i[a]&&n[a].push(i[a])}})),n.navigate.length>0){let r=e.navigate[oa]??e.navigate,i=Cc(n.navigate,r,(...s)=>{let[a,c]=s;return{to:typeof a=="number"||typeof a=="string"?a:a?Ao(a):".",...z5(e,c??{})}});i&&(i[oa]=r,e.navigate=i)}if(n.fetch.length>0){let r=e.fetch[oa]??e.fetch,i=Cc(n.fetch,r,(...s)=>{let[a,,c,u]=s;return{href:c??".",fetcherKey:a,...z5(e,u??{})}});i&&(i[oa]=r,e.fetch=i)}return e}function Cc(e,t,n){return e.length===0?null:async(...r)=>{let i=await x6(e,n(...r),()=>t(...r),e.length-1);if(i.type==="error")throw i.value;return i.value}}async function x6(e,t,n,r){let i=e[r],s;if(i){let a,c=async()=>(a?console.error("You cannot call instrumented handlers more than once"):a=x6(e,t,n,r-1),s=await a,It(s,"Expected a result"),s.type==="error"&&s.value instanceof Error?{status:"error",error:s.value}:{status:"success",error:void 0});try{await i(c,t)}catch(u){console.error("An instrumentation function threw an error:",u)}a||await c(),await a}else try{s={type:"success",value:await n()}}catch(a){s={type:"error",value:a}}return s||{type:"error",value:new Error("No result assigned in instrumentation chain.")}}function P5(e){let{request:t,context:n,params:r,unstable_pattern:i}=e;return{request:G_(t),params:{...r},unstable_pattern:i,context:K_(n)}}function z5(e,t){return{currentUrl:Ao(e.state.location),..."formMethod"in t?{formMethod:t.formMethod}:{},..."formEncType"in t?{formEncType:t.formEncType}:{},..."formData"in t?{formData:t.formData}:{},..."body"in t?{body:t.body}:{}}}function G_(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function K_(e){if(X_(e)){let t={...e};return Object.freeze(t),t}else return{get:t=>e.get(t)}}var Q_=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function X_(e){if(e===null||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null||Object.getOwnPropertyNames(t).sort().join("\0")===Q_}var b6=["POST","PUT","PATCH","DELETE"],Z_=new Set(b6),J_=["GET",...b6],eL=new Set(J_),v6=new Set([301,302,303,307,308]),tL=new Set([307,308]),p2={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},nL={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},od={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},rL=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),w6="remix-router-transitions",S6=Symbol("ResetLoaderData");function iL(e){const t=e.window?e.window:typeof window<"u"?window:void 0,n=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u";It(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let r=e.hydrationRouteProperties||[],i=e.mapRouteProperties||rL,s=i;if(e.unstable_instrumentations){let K=e.unstable_instrumentations;s=te=>({...i(te),...Y_(K.map(se=>se.route).filter(Boolean),te)})}let a={},c=Gd(e.routes,s,void 0,a),u,f=e.basename||"/";f.startsWith("/")||(f=`/${f}`);let m=e.dataStrategy||cL,p={...e.future},y=null,x=new Set,b=null,S=null,k=null,E=e.hydrationData!=null,T=ea(c,e.history.location,f),N=!1,j=null,O;if(T==null&&!e.patchRoutesOnNavigation){let K=Bi(404,{pathname:e.history.location.pathname}),{matches:te,route:se}=fp(c);O=!0,T=te,j={[se.id]:K}}else if(T&&!e.hydrationData&&tn(T,c,e.history.location.pathname).active&&(T=null),T)if(T.some(K=>K.route.lazy))O=!1;else if(!T.some(K=>eb(K.route)))O=!0;else{let K=e.hydrationData?e.hydrationData.loaderData:null,te=e.hydrationData?e.hydrationData.errors:null;if(te){let se=T.findIndex(Te=>te[Te.route.id]!==void 0);O=T.slice(0,se+1).every(Te=>!Oy(Te.route,K,te))}else O=T.every(se=>!Oy(se.route,K,te))}else{O=!1,T=[];let K=tn(null,c,e.history.location.pathname);K.active&&K.matches&&(N=!0,T=K.matches)}let A,R={historyAction:e.history.action,location:e.history.location,matches:T,initialized:O,navigation:p2,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||j,fetchers:new Map,blockers:new Map},L="POP",B=null,I=!1,U,Y=!1,V=new Map,q=null,H=!1,z=!1,$=new Set,G=new Map,Q=0,_=-1,P=new Map,W=new Set,D=new Map,Z=new Map,ee=new Set,J=new Map,he,fe=null;function Se(){if(y=e.history.listen(({action:K,location:te,delta:se})=>{if(he){he(),he=void 0;return}Hn(J.size===0||se!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let Te=je({currentLocation:R.location,nextLocation:te,historyAction:K});if(Te&&se!=null){let Be=new Promise(st=>{he=st});e.history.go(se*-1),ge(Te,{state:"blocked",location:te,proceed(){ge(Te,{state:"proceeding",proceed:void 0,reset:void 0,location:te}),Be.then(()=>e.history.go(se))},reset(){let st=new Map(R.blockers);st.set(Te,od),Pe({blockers:st})}}),B?.resolve(),B=null;return}return Ge(K,te)}),n){NL(t,V);let K=()=>RL(t,V);t.addEventListener("pagehide",K),q=()=>t.removeEventListener("pagehide",K)}return R.initialized||Ge("POP",R.location,{initialHydration:!0}),A}function Ae(){y&&y(),q&&q(),x.clear(),U&&U.abort(),R.fetchers.forEach((K,te)=>xt(te)),R.blockers.forEach((K,te)=>qe(te))}function Oe(K){return x.add(K),()=>x.delete(K)}function Pe(K,te={}){K.matches&&(K.matches=K.matches.map(Be=>{let st=a[Be.route.id],Ze=Be.route;return Ze.element!==st.element||Ze.errorElement!==st.errorElement||Ze.hydrateFallbackElement!==st.hydrateFallbackElement?{...Be,route:st}:Be})),R={...R,...K};let se=[],Te=[];R.fetchers.forEach((Be,st)=>{Be.state==="idle"&&(ee.has(st)?se.push(st):Te.push(st))}),ee.forEach(Be=>{!R.fetchers.has(Be)&&!G.has(Be)&&se.push(Be)}),[...x].forEach(Be=>Be(R,{deletedFetchers:se,newErrors:K.errors??null,viewTransitionOpts:te.viewTransitionOpts,flushSync:te.flushSync===!0})),se.forEach(Be=>xt(Be)),Te.forEach(Be=>R.fetchers.delete(Be))}function _e(K,te,{flushSync:se}={}){let Te=R.actionData!=null&&R.navigation.formMethod!=null&&Rr(R.navigation.formMethod)&&R.navigation.state==="loading"&&K.state?._isRedirect!==!0,Be;te.actionData?Object.keys(te.actionData).length>0?Be=te.actionData:Be=null:Te?Be=R.actionData:Be=null;let st=te.loaderData?G5(R.loaderData,te.loaderData,te.matches||[],te.errors):R.loaderData,Ze=R.blockers;Ze.size>0&&(Ze=new Map(Ze),Ze.forEach((vt,dt)=>Ze.set(dt,od)));let Xe=H?!1:on(K,te.matches||R.matches),et=I===!0||R.navigation.formMethod!=null&&Rr(R.navigation.formMethod)&&K.state?._isRedirect!==!0;u&&(c=u,u=void 0),H||L==="POP"||(L==="PUSH"?e.history.push(K,K.state):L==="REPLACE"&&e.history.replace(K,K.state));let ct;if(L==="POP"){let vt=V.get(R.location.pathname);vt&&vt.has(K.pathname)?ct={currentLocation:R.location,nextLocation:K}:V.has(K.pathname)&&(ct={currentLocation:K,nextLocation:R.location})}else if(Y){let vt=V.get(R.location.pathname);vt?vt.add(K.pathname):(vt=new Set([K.pathname]),V.set(R.location.pathname,vt)),ct={currentLocation:R.location,nextLocation:K}}Pe({...te,actionData:Be,loaderData:st,historyAction:L,location:K,initialized:!0,navigation:p2,revalidation:"idle",restoreScrollPosition:Xe,preventScrollReset:et,blockers:Ze},{viewTransitionOpts:ct,flushSync:se===!0}),L="POP",I=!1,Y=!1,H=!1,z=!1,B?.resolve(),B=null,fe?.resolve(),fe=null}async function De(K,te){if(B?.resolve(),B=null,typeof K=="number"){B||(B=Z5());let $t=B.promise;return e.history.go(K),$t}let se=Ay(R.location,R.matches,f,K,te?.fromRouteId,te?.relative),{path:Te,submission:Be,error:st}=F5(!1,se,te),Ze=R.location,Xe=Wd(R.location,Te,te&&te.state);Xe={...Xe,...e.history.encodeLocation(Xe)};let et=te&&te.replace!=null?te.replace:void 0,ct="PUSH";et===!0?ct="REPLACE":et===!1||Be!=null&&Rr(Be.formMethod)&&Be.formAction===R.location.pathname+R.location.search&&(ct="REPLACE");let vt=te&&"preventScrollReset"in te?te.preventScrollReset===!0:void 0,dt=(te&&te.flushSync)===!0,Xt=je({currentLocation:Ze,nextLocation:Xe,historyAction:ct});if(Xt){ge(Xt,{state:"blocked",location:Xe,proceed(){ge(Xt,{state:"proceeding",proceed:void 0,reset:void 0,location:Xe}),De(K,te)},reset(){let $t=new Map(R.blockers);$t.set(Xt,od),Pe({blockers:$t})}});return}await Ge(ct,Xe,{submission:Be,pendingError:st,preventScrollReset:vt,replace:te&&te.replace,enableViewTransition:te&&te.viewTransition,flushSync:dt,callSiteDefaultShouldRevalidate:te&&te.unstable_defaultShouldRevalidate})}function xe(){fe||(fe=Z5()),ke(),Pe({revalidation:"loading"});let K=fe.promise;return R.navigation.state==="submitting"?K:R.navigation.state==="idle"?(Ge(R.historyAction,R.location,{startUninterruptedRevalidation:!0}),K):(Ge(L||R.historyAction,R.navigation.location,{overrideNavigation:R.navigation,enableViewTransition:Y===!0}),K)}async function Ge(K,te,se){U&&U.abort(),U=null,L=K,H=(se&&se.startUninterruptedRevalidation)===!0,Pt(R.location,R.matches),I=(se&&se.preventScrollReset)===!0,Y=(se&&se.enableViewTransition)===!0;let Te=u||c,Be=se&&se.overrideNavigation,st=se?.initialHydration&&R.matches&&R.matches.length>0&&!N?R.matches:ea(Te,te,f),Ze=(se&&se.flushSync)===!0;if(st&&R.initialized&&!z&&yL(R.location,te)&&!(se&&se.submission&&Rr(se.submission.formMethod))){_e(te,{matches:st},{flushSync:Ze});return}let Xe=tn(st,Te,te.pathname);if(Xe.active&&Xe.matches&&(st=Xe.matches),!st){let{error:_n,notFoundMatches:Ln,route:Yt}=Ye(te.pathname);_e(te,{matches:Ln,loaderData:{},errors:{[Yt.id]:_n}},{flushSync:Ze});return}U=new AbortController;let et=xc(e.history,te,U.signal,se&&se.submission),ct=e.getContext?await e.getContext():new D5,vt;if(se&&se.pendingError)vt=[ta(st).route.id,{type:"error",error:se.pendingError}];else if(se&&se.submission&&Rr(se.submission.formMethod)){let _n=await we(et,te,se.submission,st,ct,Xe.active,se&&se.initialHydration===!0,{replace:se.replace,flushSync:Ze});if(_n.shortCircuited)return;if(_n.pendingActionResult){let[Ln,Yt]=_n.pendingActionResult;if(hi(Yt)&&Kd(Yt.error)&&Yt.error.status===404){U=null,_e(te,{matches:_n.matches,loaderData:{},errors:{[Ln]:Yt.error}});return}}st=_n.matches||st,vt=_n.pendingActionResult,Be=m2(te,se.submission),Ze=!1,Xe.active=!1,et=xc(e.history,et.url,et.signal)}let{shortCircuited:dt,matches:Xt,loaderData:$t,errors:Mn}=await Re(et,te,st,ct,Xe.active,Be,se&&se.submission,se&&se.fetcherSubmission,se&&se.replace,se&&se.initialHydration===!0,Ze,vt,se&&se.callSiteDefaultShouldRevalidate);dt||(U=null,_e(te,{matches:Xt||st,...K5(vt),loaderData:$t,errors:Mn}))}async function we(K,te,se,Te,Be,st,Ze,Xe={}){ke();let et=EL(te,se);if(Pe({navigation:et},{flushSync:Xe.flushSync===!0}),st){let dt=await vn(Te,te.pathname,K.signal);if(dt.type==="aborted")return{shortCircuited:!0};if(dt.type==="error"){if(dt.partialMatches.length===0){let{matches:$t,route:Mn}=fp(c);return{matches:$t,pendingActionResult:[Mn.id,{type:"error",error:dt.error}]}}let Xt=ta(dt.partialMatches).route.id;return{matches:dt.partialMatches,pendingActionResult:[Xt,{type:"error",error:dt.error}]}}else if(dt.matches)Te=dt.matches;else{let{notFoundMatches:Xt,error:$t,route:Mn}=Ye(te.pathname);return{matches:Xt,pendingActionResult:[Mn.id,{type:"error",error:$t}]}}}let ct,vt=Qp(Te,te);if(!vt.route.action&&!vt.route.lazy)ct={type:"error",error:Bi(405,{method:K.method,pathname:te.pathname,routeId:vt.route.id})};else{let dt=Nc(s,a,K,Te,vt,Ze?[]:r,Be),Xt=await lt(K,dt,Be,null);if(ct=Xt[vt.route.id],!ct){for(let $t of Te)if(Xt[$t.route.id]){ct=Xt[$t.route.id];break}}if(K.signal.aborted)return{shortCircuited:!0}}if(rl(ct)){let dt;return Xe&&Xe.replace!=null?dt=Xe.replace:dt=$5(ct.response.headers.get("Location"),new URL(K.url),f,e.history)===R.location.pathname+R.location.search,await Ve(K,ct,!0,{submission:se,replace:dt}),{shortCircuited:!0}}if(hi(ct)){let dt=ta(Te,vt.route.id);return(Xe&&Xe.replace)!==!0&&(L="PUSH"),{matches:Te,pendingActionResult:[dt.route.id,ct,vt.route.id]}}return{matches:Te,pendingActionResult:[vt.route.id,ct]}}async function Re(K,te,se,Te,Be,st,Ze,Xe,et,ct,vt,dt,Xt){let $t=st||m2(te,Ze),Mn=Ze||Xe||X5($t),_n=!H&&!ct;if(Be){if(_n){let $n=pe(dt);Pe({navigation:$t,...$n!==void 0?{actionData:$n}:{}},{flushSync:vt})}let Wt=await vn(se,te.pathname,K.signal);if(Wt.type==="aborted")return{shortCircuited:!0};if(Wt.type==="error"){if(Wt.partialMatches.length===0){let{matches:Zi,route:yr}=fp(c);return{matches:Zi,loaderData:{},errors:{[yr.id]:Wt.error}}}let $n=ta(Wt.partialMatches).route.id;return{matches:Wt.partialMatches,loaderData:{},errors:{[$n]:Wt.error}}}else if(Wt.matches)se=Wt.matches;else{let{error:$n,notFoundMatches:Zi,route:yr}=Ye(te.pathname);return{matches:Zi,loaderData:{},errors:{[yr.id]:$n}}}}let Ln=u||c,{dsMatches:Yt,revalidatingFetchers:dr}=B5(K,Te,s,a,e.history,R,se,Mn,te,ct?[]:r,ct===!0,z,$,ee,D,W,Ln,f,e.patchRoutesOnNavigation!=null,dt,Xt);if(_=++Q,!e.dataStrategy&&!Yt.some(Wt=>Wt.shouldLoad)&&!Yt.some(Wt=>Wt.route.middleware&&Wt.route.middleware.length>0)&&dr.length===0){let Wt=nt();return _e(te,{matches:se,loaderData:{},errors:dt&&hi(dt[1])?{[dt[0]]:dt[1].error}:null,...K5(dt),...Wt?{fetchers:new Map(R.fetchers)}:{}},{flushSync:vt}),{shortCircuited:!0}}if(_n){let Wt={};if(!Be){Wt.navigation=$t;let $n=pe(dt);$n!==void 0&&(Wt.actionData=$n)}dr.length>0&&(Wt.fetchers=be(dr)),Pe(Wt,{flushSync:vt})}dr.forEach(Wt=>{Ke(Wt.key),Wt.controller&&G.set(Wt.key,Wt.controller)});let Ur=()=>dr.forEach(Wt=>Ke(Wt.key));U&&U.signal.addEventListener("abort",Ur);let{loaderResults:Rn,fetcherResults:Qi}=await oe(Yt,dr,K,Te);if(K.signal.aborted)return{shortCircuited:!0};U&&U.signal.removeEventListener("abort",Ur),dr.forEach(Wt=>G.delete(Wt.key));let ri=hp(Rn);if(ri)return await Ve(K,ri.result,!0,{replace:et}),{shortCircuited:!0};if(ri=hp(Qi),ri)return W.add(ri.key),await Ve(K,ri.result,!0,{replace:et}),{shortCircuited:!0};let{loaderData:Xi,errors:Ri}=W5(R,se,Rn,dt,dr,Qi);ct&&R.errors&&(Ri={...R.errors,...Ri});let Po=nt(),Ma=Qe(_),Da=Po||Ma||dr.length>0;return{matches:se,loaderData:Xi,errors:Ri,...Da?{fetchers:new Map(R.fetchers)}:{}}}function pe(K){if(K&&!hi(K[1]))return{[K[0]]:K[1].data};if(R.actionData)return Object.keys(R.actionData).length===0?null:R.actionData}function be(K){return K.forEach(te=>{let se=R.fetchers.get(te.key),Te=sd(void 0,se?se.data:void 0);R.fetchers.set(te.key,Te)}),new Map(R.fetchers)}async function ne(K,te,se,Te){Ke(K);let Be=(Te&&Te.flushSync)===!0,st=u||c,Ze=Ay(R.location,R.matches,f,se,te,Te?.relative),Xe=ea(st,Ze,f),et=tn(Xe,st,Ze);if(et.active&&et.matches&&(Xe=et.matches),!Xe){Me(K,te,Bi(404,{pathname:Ze}),{flushSync:Be});return}let{path:ct,submission:vt,error:dt}=F5(!0,Ze,Te);if(dt){Me(K,te,dt,{flushSync:Be});return}let Xt=e.getContext?await e.getContext():new D5,$t=(Te&&Te.preventScrollReset)===!0;if(vt&&Rr(vt.formMethod)){await ye(K,te,ct,Xe,Xt,et.active,Be,$t,vt,Te&&Te.unstable_defaultShouldRevalidate);return}D.set(K,{routeId:te,path:ct}),await Ce(K,te,ct,Xe,Xt,et.active,Be,$t,vt)}async function ye(K,te,se,Te,Be,st,Ze,Xe,et,ct){ke(),D.delete(K);let vt=R.fetchers.get(K);Le(K,TL(et,vt),{flushSync:Ze});let dt=new AbortController,Xt=xc(e.history,se,dt.signal,et);if(st){let Gt=await vn(Te,new URL(Xt.url).pathname,Xt.signal,K);if(Gt.type==="aborted")return;if(Gt.type==="error"){Me(K,te,Gt.error,{flushSync:Ze});return}else if(Gt.matches)Te=Gt.matches;else{Me(K,te,Bi(404,{pathname:se}),{flushSync:Ze});return}}let $t=Qp(Te,se);if(!$t.route.action&&!$t.route.lazy){let Gt=Bi(405,{method:et.formMethod,pathname:se,routeId:te});Me(K,te,Gt,{flushSync:Ze});return}G.set(K,dt);let Mn=Q,_n=Nc(s,a,Xt,Te,$t,r,Be),Ln=await lt(Xt,_n,Be,K),Yt=Ln[$t.route.id];if(!Yt){for(let Gt of _n)if(Ln[Gt.route.id]){Yt=Ln[Gt.route.id];break}}if(Xt.signal.aborted){G.get(K)===dt&&G.delete(K);return}if(ee.has(K)){if(rl(Yt)||hi(Yt)){Le(K,os(void 0));return}}else{if(rl(Yt))if(G.delete(K),_>Mn){Le(K,os(void 0));return}else return W.add(K),Le(K,sd(et)),Ve(Xt,Yt,!1,{fetcherSubmission:et,preventScrollReset:Xe});if(hi(Yt)){Me(K,te,Yt.error);return}}let dr=R.navigation.location||R.location,Ur=xc(e.history,dr,dt.signal),Rn=u||c,Qi=R.navigation.state!=="idle"?ea(Rn,R.navigation.location,f):R.matches;It(Qi,"Didn't find any matches after fetcher action");let ri=++Q;P.set(K,ri);let Xi=sd(et,Yt.data);R.fetchers.set(K,Xi);let{dsMatches:Ri,revalidatingFetchers:Po}=B5(Ur,Be,s,a,e.history,R,Qi,et,dr,r,!1,z,$,ee,D,W,Rn,f,e.patchRoutesOnNavigation!=null,[$t.route.id,Yt],ct);Po.filter(Gt=>Gt.key!==K).forEach(Gt=>{let _a=Gt.key,eh=R.fetchers.get(_a),mu=sd(void 0,eh?eh.data:void 0);R.fetchers.set(_a,mu),Ke(_a),Gt.controller&&G.set(_a,Gt.controller)}),Pe({fetchers:new Map(R.fetchers)});let Ma=()=>Po.forEach(Gt=>Ke(Gt.key));dt.signal.addEventListener("abort",Ma);let{loaderResults:Da,fetcherResults:Wt}=await oe(Ri,Po,Ur,Be);if(dt.signal.aborted)return;if(dt.signal.removeEventListener("abort",Ma),P.delete(K),G.delete(K),Po.forEach(Gt=>G.delete(Gt.key)),R.fetchers.has(K)){let Gt=os(Yt.data);R.fetchers.set(K,Gt)}let $n=hp(Da);if($n)return Ve(Ur,$n.result,!1,{preventScrollReset:Xe});if($n=hp(Wt),$n)return W.add($n.key),Ve(Ur,$n.result,!1,{preventScrollReset:Xe});let{loaderData:Zi,errors:yr}=W5(R,Qi,Da,void 0,Po,Wt);Qe(ri),R.navigation.state==="loading"&&ri>_?(It(L,"Expected pending action"),U&&U.abort(),_e(R.navigation.location,{matches:Qi,loaderData:Zi,errors:yr,fetchers:new Map(R.fetchers)})):(Pe({errors:yr,loaderData:G5(R.loaderData,Zi,Qi,yr),fetchers:new Map(R.fetchers)}),z=!1)}async function Ce(K,te,se,Te,Be,st,Ze,Xe,et){let ct=R.fetchers.get(K);Le(K,sd(et,ct?ct.data:void 0),{flushSync:Ze});let vt=new AbortController,dt=xc(e.history,se,vt.signal);if(st){let Yt=await vn(Te,new URL(dt.url).pathname,dt.signal,K);if(Yt.type==="aborted")return;if(Yt.type==="error"){Me(K,te,Yt.error,{flushSync:Ze});return}else if(Yt.matches)Te=Yt.matches;else{Me(K,te,Bi(404,{pathname:se}),{flushSync:Ze});return}}let Xt=Qp(Te,se);G.set(K,vt);let $t=Q,Mn=Nc(s,a,dt,Te,Xt,r,Be),Ln=(await lt(dt,Mn,Be,K))[Xt.route.id];if(G.get(K)===vt&&G.delete(K),!dt.signal.aborted){if(ee.has(K)){Le(K,os(void 0));return}if(rl(Ln))if(_>$t){Le(K,os(void 0));return}else{W.add(K),await Ve(dt,Ln,!1,{preventScrollReset:Xe});return}if(hi(Ln)){Me(K,te,Ln.error);return}Le(K,os(Ln.data))}}async function Ve(K,te,se,{submission:Te,fetcherSubmission:Be,preventScrollReset:st,replace:Ze}={}){se||(B?.resolve(),B=null),te.response.headers.has("X-Remix-Revalidate")&&(z=!0);let Xe=te.response.headers.get("Location");It(Xe,"Expected a Location header on the redirect Response"),Xe=$5(Xe,new URL(K.url),f,e.history);let et=Wd(R.location,Xe,{_isRedirect:!0});if(n){let Mn=!1;if(te.response.headers.has("X-Remix-Reload-Document"))Mn=!0;else if(Jx(Xe)){const _n=d6(Xe,!0);Mn=_n.origin!==t.location.origin||Yi(_n.pathname,f)==null}if(Mn){Ze?t.location.replace(Xe):t.location.assign(Xe);return}}U=null;let ct=Ze===!0||te.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:vt,formAction:dt,formEncType:Xt}=R.navigation;!Te&&!Be&&vt&&dt&&Xt&&(Te=X5(R.navigation));let $t=Te||Be;if(tL.has(te.response.status)&&$t&&Rr($t.formMethod))await Ge(ct,et,{submission:{...$t,formAction:Xe},preventScrollReset:st||I,enableViewTransition:se?Y:void 0});else{let Mn=m2(et,Te);await Ge(ct,et,{overrideNavigation:Mn,fetcherSubmission:Be,preventScrollReset:st||I,enableViewTransition:se?Y:void 0})}}async function lt(K,te,se,Te){let Be,st={};try{Be=await dL(m,K,te,Te,se,!1)}catch(Ze){return te.filter(Xe=>Xe.shouldLoad).forEach(Xe=>{st[Xe.route.id]={type:"error",error:Ze}}),st}if(K.signal.aborted)return st;if(!Rr(K.method))for(let Ze of te){if(Be[Ze.route.id]?.type==="error")break;!Be.hasOwnProperty(Ze.route.id)&&!R.loaderData.hasOwnProperty(Ze.route.id)&&(!R.errors||!R.errors.hasOwnProperty(Ze.route.id))&&Ze.shouldCallHandler()&&(Be[Ze.route.id]={type:"error",result:new Error(`No result returned from dataStrategy for route ${Ze.route.id}`)})}for(let[Ze,Xe]of Object.entries(Be))if(wL(Xe)){let et=Xe.result;st[Ze]={type:"redirect",response:mL(et,K,Ze,te,f)}}else st[Ze]=await pL(Xe);return st}async function oe(K,te,se,Te){let Be=lt(se,K,Te,null),st=Promise.all(te.map(async et=>{if(et.matches&&et.match&&et.request&&et.controller){let vt=(await lt(et.request,et.matches,Te,et.key))[et.match.route.id];return{[et.key]:vt}}else return Promise.resolve({[et.key]:{type:"error",error:Bi(404,{pathname:et.path})}})})),Ze=await Be,Xe=(await st).reduce((et,ct)=>Object.assign(et,ct),{});return{loaderResults:Ze,fetcherResults:Xe}}function ke(){z=!0,D.forEach((K,te)=>{G.has(te)&&$.add(te),Ke(te)})}function Le(K,te,se={}){R.fetchers.set(K,te),Pe({fetchers:new Map(R.fetchers)},{flushSync:(se&&se.flushSync)===!0})}function Me(K,te,se,Te={}){let Be=ta(R.matches,te);xt(K),Pe({errors:{[Be.route.id]:se},fetchers:new Map(R.fetchers)},{flushSync:(Te&&Te.flushSync)===!0})}function He(K){return Z.set(K,(Z.get(K)||0)+1),ee.has(K)&&ee.delete(K),R.fetchers.get(K)||nL}function ut(K,te){Ke(K,te?.reason),Le(K,os(null))}function xt(K){let te=R.fetchers.get(K);G.has(K)&&!(te&&te.state==="loading"&&P.has(K))&&Ke(K),D.delete(K),P.delete(K),W.delete(K),ee.delete(K),$.delete(K),R.fetchers.delete(K)}function Je(K){let te=(Z.get(K)||0)-1;te<=0?(Z.delete(K),ee.add(K)):Z.set(K,te),Pe({fetchers:new Map(R.fetchers)})}function Ke(K,te){let se=G.get(K);se&&(se.abort(te),G.delete(K))}function bt(K){for(let te of K){let se=He(te),Te=os(se.data);R.fetchers.set(te,Te)}}function nt(){let K=[],te=!1;for(let se of W){let Te=R.fetchers.get(se);It(Te,`Expected fetcher: ${se}`),Te.state==="loading"&&(W.delete(se),K.push(se),te=!0)}return bt(K),te}function Qe(K){let te=[];for(let[se,Te]of P)if(Te<K){let Be=R.fetchers.get(se);It(Be,`Expected fetcher: ${se}`),Be.state==="loading"&&(Ke(se),P.delete(se),te.push(se))}return bt(te),te.length>0}function Ct(K,te){let se=R.blockers.get(K)||od;return J.get(K)!==te&&J.set(K,te),se}function qe(K){R.blockers.delete(K),J.delete(K)}function ge(K,te){let se=R.blockers.get(K)||od;It(se.state==="unblocked"&&te.state==="blocked"||se.state==="blocked"&&te.state==="blocked"||se.state==="blocked"&&te.state==="proceeding"||se.state==="blocked"&&te.state==="unblocked"||se.state==="proceeding"&&te.state==="unblocked",`Invalid blocker state transition: ${se.state} -> ${te.state}`);let Te=new Map(R.blockers);Te.set(K,te),Pe({blockers:Te})}function je({currentLocation:K,nextLocation:te,historyAction:se}){if(J.size===0)return;J.size>1&&Hn(!1,"A router only supports one blocker at a time");let Te=Array.from(J.entries()),[Be,st]=Te[Te.length-1],Ze=R.blockers.get(Be);if(!(Ze&&Ze.state==="proceeding")&&st({currentLocation:K,nextLocation:te,historyAction:se}))return Be}function Ye(K){let te=Bi(404,{pathname:K}),se=u||c,{matches:Te,route:Be}=fp(se);return{notFoundMatches:Te,route:Be,error:te}}function Rt(K,te,se){if(b=K,k=te,S=se||null,!E&&R.navigation===p2){E=!0;let Te=on(R.location,R.matches);Te!=null&&Pe({restoreScrollPosition:Te})}return()=>{b=null,k=null,S=null}}function Ie(K,te){return S&&S(K,te.map(Te=>R_(Te,R.loaderData)))||K.key}function Pt(K,te){if(b&&k){let se=Ie(K,te);b[se]=k()}}function on(K,te){if(b){let se=Ie(K,te),Te=b[se];if(typeof Te=="number")return Te}return null}function tn(K,te,se){if(e.patchRoutesOnNavigation)if(K){if(Object.keys(K[0].params).length>0)return{active:!0,matches:Td(te,se,f,!0)}}else return{active:!0,matches:Td(te,se,f,!0)||[]};return{active:!1,matches:null}}async function vn(K,te,se,Te){if(!e.patchRoutesOnNavigation)return{type:"success",matches:K};let Be=K;for(;;){let st=u==null,Ze=u||c,Xe=a;try{await e.patchRoutesOnNavigation({signal:se,path:te,matches:Be,fetcherKey:Te,patch:(vt,dt)=>{se.aborted||H5(vt,dt,Ze,Xe,s,!1)}})}catch(vt){return{type:"error",error:vt,partialMatches:Be}}finally{st&&!se.aborted&&(c=[...c])}if(se.aborted)return{type:"aborted"};let et=ea(Ze,te,f),ct=null;if(et){if(Object.keys(et[0].params).length===0)return{type:"success",matches:et};if(ct=Td(Ze,te,f,!0),!(ct&&Be.length<ct.length&&Ut(Be,ct.slice(0,Be.length))))return{type:"success",matches:et}}if(ct||(ct=Td(Ze,te,f,!0)),!ct||Ut(Be,ct))return{type:"success",matches:null};Be=ct}}function Ut(K,te){return K.length===te.length&&K.every((se,Te)=>se.route.id===te[Te].route.id)}function yt(K){a={},u=Gd(K,s,void 0,a)}function zt(K,te,se=!1){let Te=u==null;H5(K,te,u||c,a,s,se),Te&&(c=[...c],Pe({}))}return A={get basename(){return f},get future(){return p},get state(){return R},get routes(){return c},get window(){return t},initialize:Se,subscribe:Oe,enableScrollRestoration:Rt,navigate:De,fetch:ne,revalidate:xe,createHref:K=>e.history.createHref(K),encodeLocation:K=>e.history.encodeLocation(K),getFetcher:He,resetFetcher:ut,deleteFetcher:Je,dispose:Ae,getBlocker:Ct,deleteBlocker:qe,patchRoutes:zt,_internalFetchControllers:G,_internalSetRoutes:yt,_internalSetStateDoNotUseOrYouWillBreakYourApp(K){Pe(K)}},e.unstable_instrumentations&&(A=W_(A,e.unstable_instrumentations.map(K=>K.router).filter(Boolean))),A}function oL(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function Ay(e,t,n,r,i,s){let a,c;if(i){a=[];for(let f of t)if(a.push(f),f.route.id===i){c=f;break}}else a=t,c=t[t.length-1];let u=i0(r||".",r0(a),Yi(e.pathname,n)||e.pathname,s==="path");if(r==null&&(u.search=e.search,u.hash=e.hash),(r==null||r===""||r===".")&&c){let f=nb(u.search);if(c.route.index&&!f)u.search=u.search?u.search.replace(/^\?/,"?index&"):"?index";else if(!c.route.index&&f){let m=new URLSearchParams(u.search),p=m.getAll("index");m.delete("index"),p.filter(x=>x).forEach(x=>m.append("index",x));let y=m.toString();u.search=y?`?${y}`:""}}return n!=="/"&&(u.pathname=H_({basename:n,pathname:u.pathname})),Ao(u)}function F5(e,t,n){if(!n||!oL(n))return{path:t};if(n.formMethod&&!kL(n.formMethod))return{path:t,error:Bi(405,{method:n.formMethod})};let r=()=>({path:t,error:Bi(400,{type:"invalid-body"})}),s=(n.formMethod||"get").toUpperCase(),a=R6(t);if(n.body!==void 0){if(n.formEncType==="text/plain"){if(!Rr(s))return r();let p=typeof n.body=="string"?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((y,[x,b])=>`${y}${x}=${b}
10
+ `,""):String(n.body);return{path:t,submission:{formMethod:s,formAction:a,formEncType:n.formEncType,formData:void 0,json:void 0,text:p}}}else if(n.formEncType==="application/json"){if(!Rr(s))return r();try{let p=typeof n.body=="string"?JSON.parse(n.body):n.body;return{path:t,submission:{formMethod:s,formAction:a,formEncType:n.formEncType,formData:void 0,json:p,text:void 0}}}catch{return r()}}}It(typeof FormData=="function","FormData is not available in this environment");let c,u;if(n.formData)c=My(n.formData),u=n.formData;else if(n.body instanceof FormData)c=My(n.body),u=n.body;else if(n.body instanceof URLSearchParams)c=n.body,u=Y5(c);else if(n.body==null)c=new URLSearchParams,u=new FormData;else try{c=new URLSearchParams(n.body),u=Y5(c)}catch{return r()}let f={formMethod:s,formAction:a,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:u,json:void 0,text:void 0};if(Rr(f.formMethod))return{path:t,submission:f};let m=ya(t);return e&&m.search&&nb(m.search)&&c.append("index",""),m.search=`?${c}`,{path:Ao(m),submission:f}}function B5(e,t,n,r,i,s,a,c,u,f,m,p,y,x,b,S,k,E,T,N,j){let O=N?hi(N[1])?N[1].error:N[1].data:void 0,A=i.createURL(s.location),R=i.createURL(u),L;if(m&&s.errors){let H=Object.keys(s.errors)[0];L=a.findIndex(z=>z.route.id===H)}else if(N&&hi(N[1])){let H=N[0];L=a.findIndex(z=>z.route.id===H)-1}let B=N?N[1].statusCode:void 0,I=B&&B>=400,U={currentUrl:A,currentParams:s.matches[0]?.params||{},nextUrl:R,nextParams:a[0].params,...c,actionResult:O,actionStatus:B},Y=wf(a),V=a.map((H,z)=>{let{route:$}=H,G=null;if(L!=null&&z>L?G=!1:$.lazy?G=!0:eb($)?m?G=Oy($,s.loaderData,s.errors):sL(s.loaderData,s.matches[z],H)&&(G=!0):G=!1,G!==null)return jy(n,r,e,Y,H,f,t,G);let Q=!1;typeof j=="boolean"?Q=j:I?Q=!1:(p||A.pathname+A.search===R.pathname+R.search||A.search!==R.search||aL(s.matches[z],H))&&(Q=!0);let _={...U,defaultShouldRevalidate:Q},P=_d(H,_);return jy(n,r,e,Y,H,f,t,P,_,j)}),q=[];return b.forEach((H,z)=>{if(m||!a.some(Z=>Z.route.id===H.routeId)||x.has(z))return;let $=s.fetchers.get(z),G=$&&$.state!=="idle"&&$.data===void 0,Q=ea(k,H.path,E);if(!Q){if(T&&G)return;q.push({key:z,routeId:H.routeId,path:H.path,matches:null,match:null,request:null,controller:null});return}if(S.has(z))return;let _=Qp(Q,H.path),P=new AbortController,W=xc(i,H.path,P.signal),D=null;if(y.has(z))y.delete(z),D=Nc(n,r,W,Q,_,f,t);else if(G)p&&(D=Nc(n,r,W,Q,_,f,t));else{let Z;typeof j=="boolean"?Z=j:I?Z=!1:Z=p;let ee={...U,defaultShouldRevalidate:Z};_d(_,ee)&&(D=Nc(n,r,W,Q,_,f,t,ee))}D&&q.push({key:z,routeId:H.routeId,path:H.path,matches:D,match:_,request:W,controller:P})}),{dsMatches:V,revalidatingFetchers:q}}function eb(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function Oy(e,t,n){if(e.lazy)return!0;if(!eb(e))return!1;let r=t!=null&&e.id in t,i=n!=null&&n[e.id]!==void 0;return!r&&i?!1:typeof e.loader=="function"&&e.loader.hydrate===!0?!0:!r&&!i}function sL(e,t,n){let r=!t||n.route.id!==t.route.id,i=!e.hasOwnProperty(n.route.id);return r||i}function aL(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function _d(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}function H5(e,t,n,r,i,s){let a;if(e){let f=r[e];It(f,`No route found to patch children into: routeId = ${e}`),f.children||(f.children=[]),a=f.children}else a=n;let c=[],u=[];if(t.forEach(f=>{let m=a.find(p=>C6(f,p));m?u.push({existingRoute:m,newRoute:f}):c.push(f)}),c.length>0){let f=Gd(c,i,[e||"_","patch",String(a?.length||"0")],r);a.push(...f)}if(s&&u.length>0)for(let f=0;f<u.length;f++){let{existingRoute:m,newRoute:p}=u[f],y=m,[x]=Gd([p],i,[],{},!0);Object.assign(y,{element:x.element?x.element:y.element,errorElement:x.errorElement?x.errorElement:y.errorElement,hydrateFallbackElement:x.hydrateFallbackElement?x.hydrateFallbackElement:y.hydrateFallbackElement})}}function C6(e,t){return"id"in e&&"id"in t&&e.id===t.id?!0:e.index===t.index&&e.path===t.path&&e.caseSensitive===t.caseSensitive?(!e.children||e.children.length===0)&&(!t.children||t.children.length===0)?!0:e.children.every((n,r)=>t.children?.some(i=>C6(n,i))):!1}var U5=new WeakMap,k6=({key:e,route:t,manifest:n,mapRouteProperties:r})=>{let i=n[t.id];if(It(i,"No route found in manifest"),!i.lazy||typeof i.lazy!="object")return;let s=i.lazy[e];if(!s)return;let a=U5.get(i);a||(a={},U5.set(i,a));let c=a[e];if(c)return c;let u=(async()=>{let f=k_(e),p=i[e]!==void 0&&e!=="hasErrorBoundary";if(f)Hn(!f,"Route property "+e+" is not a supported lazy route property. This property will be ignored."),a[e]=Promise.resolve();else if(p)Hn(!1,`Route "${i.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let y=await s();y!=null&&(Object.assign(i,{[e]:y}),Object.assign(i,r(i)))}typeof i.lazy=="object"&&(i.lazy[e]=void 0,Object.values(i.lazy).every(y=>y===void 0)&&(i.lazy=void 0))})();return a[e]=u,u},V5=new WeakMap;function lL(e,t,n,r,i){let s=n[e.id];if(It(s,"No route found in manifest"),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy=="function"){let m=V5.get(s);if(m)return{lazyRoutePromise:m,lazyHandlerPromise:m};let p=(async()=>{It(typeof e.lazy=="function","No lazy route function found");let y=await e.lazy(),x={};for(let b in y){let S=y[b];if(S===void 0)continue;let k=T_(b),T=s[b]!==void 0&&b!=="hasErrorBoundary";k?Hn(!k,"Route property "+b+" is not a supported property to be returned from a lazy route function. This property will be ignored."):T?Hn(!T,`Route "${s.id}" has a static property "${b}" defined but its lazy function is also returning a value for this property. The lazy route property "${b}" will be ignored.`):x[b]=S}Object.assign(s,x),Object.assign(s,{...r(s),lazy:void 0})})();return V5.set(s,p),p.catch(()=>{}),{lazyRoutePromise:p,lazyHandlerPromise:p}}let a=Object.keys(e.lazy),c=[],u;for(let m of a){if(i&&i.includes(m))continue;let p=k6({key:m,route:e,manifest:n,mapRouteProperties:r});p&&(c.push(p),m===t&&(u=p))}let f=c.length>0?Promise.all(c).then(()=>{}):void 0;return f?.catch(()=>{}),u?.catch(()=>{}),{lazyRoutePromise:f,lazyHandlerPromise:u}}async function q5(e){let t=e.matches.filter(i=>i.shouldLoad),n={};return(await Promise.all(t.map(i=>i.resolve()))).forEach((i,s)=>{n[t[s].route.id]=i}),n}async function cL(e){return e.matches.some(t=>t.route.middleware)?E6(e,()=>q5(e)):q5(e)}function E6(e,t){return uL(e,t,r=>{if(CL(r))throw r;return r},bL,n);function n(r,i,s){if(s)return Promise.resolve(Object.assign(s.value,{[i]:{type:"error",result:r}}));{let{matches:a}=e,c=Math.min(Math.max(a.findIndex(f=>f.route.id===i),0),Math.max(a.findIndex(f=>f.shouldCallHandler()),0)),u=ta(a,a[c].route.id).route.id;return Promise.resolve({[u]:{type:"error",result:r}})}}}async function uL(e,t,n,r,i){let{matches:s,request:a,params:c,context:u,unstable_pattern:f}=e,m=s.flatMap(y=>y.route.middleware?y.route.middleware.map(x=>[y.route.id,x]):[]);return await T6({request:a,params:c,context:u,unstable_pattern:f},m,t,n,r,i)}async function T6(e,t,n,r,i,s,a=0){let{request:c}=e;if(c.signal.aborted)throw c.signal.reason??new Error(`Request aborted: ${c.method} ${c.url}`);let u=t[a];if(!u)return await n();let[f,m]=u,p,y=async()=>{if(p)throw new Error("You may only call `next()` once per middleware");try{return p={value:await T6(e,t,n,r,i,s,a+1)},p.value}catch(x){return p={value:await s(x,f,p)},p.value}};try{let x=await m(e,y),b=x!=null?r(x):void 0;return i(b)?b:p?b??p.value:(p={value:await y()},p.value)}catch(x){return await s(x,f,p)}}function N6(e,t,n,r,i){let s=k6({key:"middleware",route:r.route,manifest:t,mapRouteProperties:e}),a=lL(r.route,Rr(n.method)?"action":"loader",t,e,i);return{middleware:s,route:a.lazyRoutePromise,handler:a.lazyHandlerPromise}}function jy(e,t,n,r,i,s,a,c,u=null,f){let m=!1,p=N6(e,t,n,i,s);return{...i,_lazyPromises:p,shouldLoad:c,shouldRevalidateArgs:u,shouldCallHandler(y){return m=!0,u?typeof f=="boolean"?_d(i,{...u,defaultShouldRevalidate:f}):typeof y=="boolean"?_d(i,{...u,defaultShouldRevalidate:y}):_d(i,u):c},resolve(y){let{lazy:x,loader:b,middleware:S}=i.route,k=m||c||y&&!Rr(n.method)&&(x||b),E=S&&S.length>0&&!b&&!x;return k&&(Rr(n.method)||!E)?fL({request:n,unstable_pattern:r,match:i,lazyHandlerPromise:p?.handler,lazyRoutePromise:p?.route,handlerOverride:y,scopedContext:a}):Promise.resolve({type:"data",result:void 0})}}}function Nc(e,t,n,r,i,s,a,c=null){return r.map(u=>u.route.id!==i.route.id?{...u,shouldLoad:!1,shouldRevalidateArgs:c,shouldCallHandler:()=>!1,_lazyPromises:N6(e,t,n,u,s),resolve:()=>Promise.resolve({type:"data",result:void 0})}:jy(e,t,n,wf(r),u,s,a,!0,c))}async function dL(e,t,n,r,i,s){n.some(f=>f._lazyPromises?.middleware)&&await Promise.all(n.map(f=>f._lazyPromises?.middleware));let a={request:t,unstable_pattern:wf(n),params:n[0].params,context:i,matches:n},u=await e({...a,fetcherKey:r,runClientMiddleware:f=>{let m=a;return E6(m,()=>f({...m,fetcherKey:r,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))}});try{await Promise.all(n.flatMap(f=>[f._lazyPromises?.handler,f._lazyPromises?.route]))}catch{}return u}async function fL({request:e,unstable_pattern:t,match:n,lazyHandlerPromise:r,lazyRoutePromise:i,handlerOverride:s,scopedContext:a}){let c,u,f=Rr(e.method),m=f?"action":"loader",p=y=>{let x,b=new Promise((E,T)=>x=T);u=()=>x(),e.signal.addEventListener("abort",u);let S=E=>typeof y!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${m}" [routeId: ${n.route.id}]`)):y({request:e,unstable_pattern:t,params:n.params,context:a},...E!==void 0?[E]:[]),k=(async()=>{try{return{type:"data",result:await(s?s(T=>S(T)):S())}}catch(E){return{type:"error",result:E}}})();return Promise.race([k,b])};try{let y=f?n.route.action:n.route.loader;if(r||i)if(y){let x,[b]=await Promise.all([p(y).catch(S=>{x=S}),r,i]);if(x!==void 0)throw x;c=b}else{await r;let x=f?n.route.action:n.route.loader;if(x)[c]=await Promise.all([p(x),i]);else if(m==="action"){let b=new URL(e.url),S=b.pathname+b.search;throw Bi(405,{method:e.method,pathname:S,routeId:n.route.id})}else return{type:"data",result:void 0}}else if(y)c=await p(y);else{let x=new URL(e.url),b=x.pathname+x.search;throw Bi(404,{pathname:b})}}catch(y){return{type:"error",result:y}}finally{u&&e.signal.removeEventListener("abort",u)}return c}async function hL(e){let t=e.headers.get("Content-Type");return t&&/\bapplication\/json\b/.test(t)?e.body==null?null:e.json():e.text()}async function pL(e){let{result:t,type:n}=e;if(tb(t)){let r;try{r=await hL(t)}catch(i){return{type:"error",error:i}}return n==="error"?{type:"error",error:new vf(t.status,t.statusText,r),statusCode:t.status,headers:t.headers}:{type:"data",data:r,statusCode:t.status,headers:t.headers}}return n==="error"?Q5(t)?t.data instanceof Error?{type:"error",error:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"error",error:xL(t),statusCode:Kd(t)?t.status:void 0,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"error",error:t,statusCode:Kd(t)?t.status:void 0}:Q5(t)?{type:"data",data:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"data",data:t}}function mL(e,t,n,r,i){let s=e.headers.get("Location");if(It(s,"Redirects returned/thrown from loaders/actions must have a Location header"),!Jx(s)){let a=r.slice(0,r.findIndex(c=>c.route.id===n)+1);s=Ay(new URL(t.url),a,i,s),e.headers.set("Location",s)}return e}function $5(e,t,n,r){let i=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];if(Jx(e)){let s=e,a=s.startsWith("//")?new URL(t.protocol+s):new URL(s);if(i.includes(a.protocol))throw new Error("Invalid redirect location");let c=Yi(a.pathname,n)!=null;if(a.origin===t.origin&&c)return a.pathname+a.search+a.hash}try{let s=r.createURL(e);if(i.includes(s.protocol))throw new Error("Invalid redirect location")}catch{}return e}function xc(e,t,n,r){let i=e.createURL(R6(t)).toString(),s={signal:n};if(r&&Rr(r.formMethod)){let{formMethod:a,formEncType:c}=r;s.method=a.toUpperCase(),c==="application/json"?(s.headers=new Headers({"Content-Type":c}),s.body=JSON.stringify(r.json)):c==="text/plain"?s.body=r.text:c==="application/x-www-form-urlencoded"&&r.formData?s.body=My(r.formData):s.body=r.formData}return new Request(i,s)}function My(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r=="string"?r:r.name);return t}function Y5(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function gL(e,t,n,r=!1,i=!1){let s={},a=null,c,u=!1,f={},m=n&&hi(n[1])?n[1].error:void 0;return e.forEach(p=>{if(!(p.route.id in t))return;let y=p.route.id,x=t[y];if(It(!rl(x),"Cannot handle redirect results in processLoaderData"),hi(x)){let b=x.error;if(m!==void 0&&(b=m,m=void 0),a=a||{},i)a[y]=b;else{let S=ta(e,y);a[S.route.id]==null&&(a[S.route.id]=b)}r||(s[y]=S6),u||(u=!0,c=Kd(x.error)?x.error.status:500),x.headers&&(f[y]=x.headers)}else s[y]=x.data,x.statusCode&&x.statusCode!==200&&!u&&(c=x.statusCode),x.headers&&(f[y]=x.headers)}),m!==void 0&&n&&(a={[n[0]]:m},n[2]&&(s[n[2]]=void 0)),{loaderData:s,errors:a,statusCode:c||200,loaderHeaders:f}}function W5(e,t,n,r,i,s){let{loaderData:a,errors:c}=gL(t,n,r);return i.filter(u=>!u.matches||u.matches.some(f=>f.shouldLoad)).forEach(u=>{let{key:f,match:m,controller:p}=u;if(p&&p.signal.aborted)return;let y=s[f];if(It(y,"Did not find corresponding fetcher result"),hi(y)){let x=ta(e.matches,m?.route.id);c&&c[x.route.id]||(c={...c,[x.route.id]:y.error}),e.fetchers.delete(f)}else if(rl(y))It(!1,"Unhandled fetcher revalidation redirect");else{let x=os(y.data);e.fetchers.set(f,x)}}),{loaderData:a,errors:c}}function G5(e,t,n,r){let i=Object.entries(t).filter(([,s])=>s!==S6).reduce((s,[a,c])=>(s[a]=c,s),{});for(let s of n){let a=s.route.id;if(!t.hasOwnProperty(a)&&e.hasOwnProperty(a)&&s.route.loader&&(i[a]=e[a]),r&&r.hasOwnProperty(a))break}return i}function K5(e){return e?hi(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function ta(e,t){return(t?e.slice(0,e.findIndex(r=>r.route.id===t)+1):[...e]).reverse().find(r=>r.route.hasErrorBoundary===!0)||e[0]}function fp(e){let t=e.length===1?e[0]:e.find(n=>n.index||!n.path||n.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function Bi(e,{pathname:t,routeId:n,method:r,type:i,message:s}={}){let a="Unknown Server Error",c="Unknown @remix-run/router error";return e===400?(a="Bad Request",r&&t&&n?c=`You made a ${r} request to "${t}" but did not provide a \`loader\` for route "${n}", so there is no way to handle the request.`:i==="invalid-body"&&(c="Unable to encode submission body")):e===403?(a="Forbidden",c=`Route "${n}" does not match URL "${t}"`):e===404?(a="Not Found",c=`No route matches URL "${t}"`):e===405&&(a="Method Not Allowed",r&&t&&n?c=`You made a ${r.toUpperCase()} request to "${t}" but did not provide an \`action\` for route "${n}", so there is no way to handle the request.`:r&&(c=`Invalid request method "${r.toUpperCase()}"`)),new vf(e||500,a,new Error(c),!0)}function hp(e){let t=Object.entries(e);for(let n=t.length-1;n>=0;n--){let[r,i]=t[n];if(rl(i))return{key:r,result:i}}}function R6(e){let t=typeof e=="string"?ya(e):e;return Ao({...t,hash:""})}function yL(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function xL(e){return new vf(e.init?.status??500,e.init?.statusText??"Internal Server Error",e.data)}function bL(e){return e!=null&&typeof e=="object"&&Object.entries(e).every(([t,n])=>typeof t=="string"&&vL(n))}function vL(e){return e!=null&&typeof e=="object"&&"type"in e&&"result"in e&&(e.type==="data"||e.type==="error")}function wL(e){return tb(e.result)&&v6.has(e.result.status)}function hi(e){return e.type==="error"}function rl(e){return(e&&e.type)==="redirect"}function Q5(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function tb(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function SL(e){return v6.has(e)}function CL(e){return tb(e)&&SL(e.status)&&e.headers.has("Location")}function kL(e){return eL.has(e.toUpperCase())}function Rr(e){return Z_.has(e.toUpperCase())}function nb(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function Qp(e,t){let n=typeof t=="string"?ya(t).search:t.search;if(e[e.length-1].route.index&&nb(n||""))return e[e.length-1];let r=m6(e);return r[r.length-1]}function X5(e){let{formMethod:t,formAction:n,formEncType:r,text:i,formData:s,json:a}=e;if(!(!t||!n||!r)){if(i!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:i};if(s!=null)return{formMethod:t,formAction:n,formEncType:r,formData:s,json:void 0,text:void 0};if(a!==void 0)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:a,text:void 0}}}function m2(e,t){return t?{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function EL(e,t){return{state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}function sd(e,t){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function TL(e,t){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function os(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function NL(e,t){try{let n=e.sessionStorage.getItem(w6);if(n){let r=JSON.parse(n);for(let[i,s]of Object.entries(r||{}))s&&Array.isArray(s)&&t.set(i,new Set(s||[]))}}catch{}}function RL(e,t){if(t.size>0){let n={};for(let[r,i]of t)n[r]=[...i];try{e.sessionStorage.setItem(w6,JSON.stringify(n))}catch(r){Hn(!1,`Failed to save applied view transitions in sessionStorage (${r}).`)}}}function Z5(){let e,t,n=new Promise((r,i)=>{e=async s=>{r(s);try{await n}catch{}},t=async s=>{i(s);try{await n}catch{}}});return{promise:n,resolve:e,reject:t}}var bl=w.createContext(null);bl.displayName="DataRouter";var Sf=w.createContext(null);Sf.displayName="DataRouterState";var A6=w.createContext(!1);function AL(){return w.useContext(A6)}var rb=w.createContext({isTransitioning:!1});rb.displayName="ViewTransition";var O6=w.createContext(new Map);O6.displayName="Fetchers";var OL=w.createContext(null);OL.displayName="Await";var Ti=w.createContext(null);Ti.displayName="Navigation";var o0=w.createContext(null);o0.displayName="Location";var co=w.createContext({outlet:null,matches:[],isDataRoute:!1});co.displayName="Route";var ib=w.createContext(null);ib.displayName="RouteError";var j6="REACT_ROUTER_ERROR",jL="REDIRECT",ML="ROUTE_ERROR_RESPONSE";function DL(e){if(e.startsWith(`${j6}:${jL}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function _L(e){if(e.startsWith(`${j6}:${ML}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new vf(t.status,t.statusText,t.data)}catch{}}function LL(e,{relative:t}={}){It(Jc(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=w.useContext(Ti),{hash:i,pathname:s,search:a}=Cf(e,{relative:t}),c=s;return n!=="/"&&(c=s==="/"?n:Co([n,s])),r.createHref({pathname:c,search:a,hash:i})}function Jc(){return w.useContext(o0)!=null}function Gi(){return It(Jc(),"useLocation() may be used only in the context of a <Router> component."),w.useContext(o0).location}var M6="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function D6(e){w.useContext(Ti).static||w.useLayoutEffect(e)}function vl(){let{isDataRoute:e}=w.useContext(co);return e?QL():IL()}function IL(){It(Jc(),"useNavigate() may be used only in the context of a <Router> component.");let e=w.useContext(bl),{basename:t,navigator:n}=w.useContext(Ti),{matches:r}=w.useContext(co),{pathname:i}=Gi(),s=JSON.stringify(r0(r)),a=w.useRef(!1);return D6(()=>{a.current=!0}),w.useCallback((u,f={})=>{if(Hn(a.current,M6),!a.current)return;if(typeof u=="number"){n.go(u);return}let m=i0(u,JSON.parse(s),i,f.relative==="path");e==null&&t!=="/"&&(m.pathname=m.pathname==="/"?t:Co([t,m.pathname])),(f.replace?n.replace:n.push)(m,f.state,f)},[t,n,s,i,e])}var PL=w.createContext(null);function zL(e){let t=w.useContext(co).outlet;return w.useMemo(()=>t&&w.createElement(PL.Provider,{value:e},t),[t,e])}function Cf(e,{relative:t}={}){let{matches:n}=w.useContext(co),{pathname:r}=Gi(),i=JSON.stringify(r0(n));return w.useMemo(()=>i0(e,JSON.parse(i),r,t==="path"),[e,i,r,t])}function FL(e,t,n,r,i){It(Jc(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:s}=w.useContext(Ti),{matches:a}=w.useContext(co),c=a[a.length-1],u=c?c.params:{},f=c?c.pathname:"/",m=c?c.pathnameBase:"/",p=c&&c.route;{let T=p&&p.path||"";L6(f,!p||T.endsWith("*")||T.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${f}" (under <Route path="${T}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
11
+
12
+ Please change the parent <Route path="${T}"> to <Route path="${T==="/"?"*":`${T}/*`}">.`)}let y=Gi(),x;x=y;let b=x.pathname||"/",S=b;if(m!=="/"){let T=m.replace(/^\//,"").split("/");S="/"+b.replace(/^\//,"").split("/").slice(T.length).join("/")}let k=ea(e,{pathname:S});return Hn(p||k!=null,`No routes matched location "${x.pathname}${x.search}${x.hash}" `),Hn(k==null||k[k.length-1].route.element!==void 0||k[k.length-1].route.Component!==void 0||k[k.length-1].route.lazy!==void 0,`Matched leaf route at location "${x.pathname}${x.search}${x.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`),qL(k&&k.map(T=>Object.assign({},T,{params:Object.assign({},u,T.params),pathname:Co([m,s.encodeLocation?s.encodeLocation(T.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:T.pathname]),pathnameBase:T.pathnameBase==="/"?m:Co([m,s.encodeLocation?s.encodeLocation(T.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:T.pathnameBase])})),a,n,r,i)}function BL(){let e=KL(),t=Kd(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",i={padding:"0.5rem",backgroundColor:r},s={padding:"2px 4px",backgroundColor:r},a=null;return console.error("Error handled by React Router default ErrorBoundary:",e),a=w.createElement(w.Fragment,null,w.createElement("p",null,"💿 Hey developer 👋"),w.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",w.createElement("code",{style:s},"ErrorBoundary")," or"," ",w.createElement("code",{style:s},"errorElement")," prop on your route.")),w.createElement(w.Fragment,null,w.createElement("h2",null,"Unexpected Application Error!"),w.createElement("h3",{style:{fontStyle:"italic"}},t),n?w.createElement("pre",{style:i},n):null,a)}var HL=w.createElement(BL,null),_6=class extends w.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const n=_L(e.digest);n&&(e=n)}let t=e!==void 0?w.createElement(co.Provider,{value:this.props.routeContext},w.createElement(ib.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?w.createElement(UL,{error:e},t):t}};_6.contextType=A6;var g2=new WeakMap;function UL({children:e,error:t}){let{basename:n}=w.useContext(Ti);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let r=DL(t.digest);if(r){let i=g2.get(t);if(i)throw i;let s=y6(r.location,n);if(g6&&!g2.get(t))if(s.isExternal||r.reloadDocument)window.location.href=s.absoluteURL||s.to;else{const a=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(s.to,{replace:r.replace}));throw g2.set(t,a),a}return w.createElement("meta",{httpEquiv:"refresh",content:`0;url=${s.absoluteURL||s.to}`})}}return e}function VL({routeContext:e,match:t,children:n}){let r=w.useContext(bl);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),w.createElement(co.Provider,{value:e},n)}function qL(e,t=[],n=null,r=null,i=null){if(e==null){if(!n)return null;if(n.errors)e=n.matches;else if(t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let s=e,a=n?.errors;if(a!=null){let m=s.findIndex(p=>p.route.id&&a?.[p.route.id]!==void 0);It(m>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(",")}`),s=s.slice(0,Math.min(s.length,m+1))}let c=!1,u=-1;if(n)for(let m=0;m<s.length;m++){let p=s[m];if((p.route.HydrateFallback||p.route.hydrateFallbackElement)&&(u=m),p.route.id){let{loaderData:y,errors:x}=n,b=p.route.loader&&!y.hasOwnProperty(p.route.id)&&(!x||x[p.route.id]===void 0);if(p.route.lazy||b){c=!0,u>=0?s=s.slice(0,u+1):s=[s[0]];break}}}let f=n&&r?(m,p)=>{r(m,{location:n.location,params:n.matches?.[0]?.params??{},unstable_pattern:wf(n.matches),errorInfo:p})}:void 0;return s.reduceRight((m,p,y)=>{let x,b=!1,S=null,k=null;n&&(x=a&&p.route.id?a[p.route.id]:void 0,S=p.route.errorElement||HL,c&&(u<0&&y===0?(L6("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),b=!0,k=null):u===y&&(b=!0,k=p.route.hydrateFallbackElement||null)));let E=t.concat(s.slice(0,y+1)),T=()=>{let N;return x?N=S:b?N=k:p.route.Component?N=w.createElement(p.route.Component,null):p.route.element?N=p.route.element:N=m,w.createElement(VL,{match:p,routeContext:{outlet:m,matches:E,isDataRoute:n!=null},children:N})};return n&&(p.route.ErrorBoundary||p.route.errorElement||y===0)?w.createElement(_6,{location:n.location,revalidation:n.revalidation,component:S,error:x,children:T(),routeContext:{outlet:null,matches:E,isDataRoute:!0},onError:f}):T()},null)}function ob(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function $L(e){let t=w.useContext(bl);return It(t,ob(e)),t}function YL(e){let t=w.useContext(Sf);return It(t,ob(e)),t}function WL(e){let t=w.useContext(co);return It(t,ob(e)),t}function sb(e){let t=WL(e),n=t.matches[t.matches.length-1];return It(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function GL(){return sb("useRouteId")}function KL(){let e=w.useContext(ib),t=YL("useRouteError"),n=sb("useRouteError");return e!==void 0?e:t.errors?.[n]}function QL(){let{router:e}=$L("useNavigate"),t=sb("useNavigate"),n=w.useRef(!1);return D6(()=>{n.current=!0}),w.useCallback(async(i,s={})=>{Hn(n.current,M6),n.current&&(typeof i=="number"?await e.navigate(i):await e.navigate(i,{fromRouteId:t,...s}))},[e,t])}var J5={};function L6(e,t,n){!t&&!J5[e]&&(J5[e]=!0,Hn(!1,n))}var ek={};function tk(e,t){!e&&!ek[t]&&(ek[t]=!0,console.warn(t))}var XL="useOptimistic",nk=Zx[XL],ZL=()=>{};function JL(e){return nk?nk(e):[e,ZL]}function eI(e){let t={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&Hn(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(t,{element:w.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&Hn(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(t,{hydrateFallbackElement:w.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&Hn(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(t,{errorElement:w.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}var tI=["HydrateFallback","hydrateFallbackElement"],nI=class{constructor(){this.status="pending",this.promise=new Promise((e,t)=>{this.resolve=n=>{this.status==="pending"&&(this.status="resolved",e(n))},this.reject=n=>{this.status==="pending"&&(this.status="rejected",t(n))}})}};function rI({router:e,flushSync:t,onError:n,unstable_useTransitions:r}){r=AL()||r;let[s,a]=w.useState(e.state),[c,u]=JL(s),[f,m]=w.useState(),[p,y]=w.useState({isTransitioning:!1}),[x,b]=w.useState(),[S,k]=w.useState(),[E,T]=w.useState(),N=w.useRef(new Map),j=w.useCallback((L,{deletedFetchers:B,newErrors:I,flushSync:U,viewTransitionOpts:Y})=>{I&&n&&Object.values(I).forEach(q=>n(q,{location:L.location,params:L.matches[0]?.params??{},unstable_pattern:wf(L.matches)})),L.fetchers.forEach((q,H)=>{q.data!==void 0&&N.current.set(H,q.data)}),B.forEach(q=>N.current.delete(q)),tk(U===!1||t!=null,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let V=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition=="function";if(tk(Y==null||V,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),!Y||!V){t&&U?t(()=>a(L)):r===!1?a(L):w.startTransition(()=>{r===!0&&u(q=>rk(q,L)),a(L)});return}if(t&&U){t(()=>{S&&(x?.resolve(),S.skipTransition()),y({isTransitioning:!0,flushSync:!0,currentLocation:Y.currentLocation,nextLocation:Y.nextLocation})});let q=e.window.document.startViewTransition(()=>{t(()=>a(L))});q.finished.finally(()=>{t(()=>{b(void 0),k(void 0),m(void 0),y({isTransitioning:!1})})}),t(()=>k(q));return}S?(x?.resolve(),S.skipTransition(),T({state:L,currentLocation:Y.currentLocation,nextLocation:Y.nextLocation})):(m(L),y({isTransitioning:!0,flushSync:!1,currentLocation:Y.currentLocation,nextLocation:Y.nextLocation}))},[e.window,t,S,x,r,u,n]);w.useLayoutEffect(()=>e.subscribe(j),[e,j]),w.useEffect(()=>{p.isTransitioning&&!p.flushSync&&b(new nI)},[p]),w.useEffect(()=>{if(x&&f&&e.window){let L=f,B=x.promise,I=e.window.document.startViewTransition(async()=>{r===!1?a(L):w.startTransition(()=>{r===!0&&u(U=>rk(U,L)),a(L)}),await B});I.finished.finally(()=>{b(void 0),k(void 0),m(void 0),y({isTransitioning:!1})}),k(I)}},[f,x,e.window,r,u]),w.useEffect(()=>{x&&f&&c.location.key===f.location.key&&x.resolve()},[x,S,c.location,f]),w.useEffect(()=>{!p.isTransitioning&&E&&(m(E.state),y({isTransitioning:!0,flushSync:!1,currentLocation:E.currentLocation,nextLocation:E.nextLocation}),T(void 0))},[p.isTransitioning,E]);let O=w.useMemo(()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:L=>e.navigate(L),push:(L,B,I)=>e.navigate(L,{state:B,preventScrollReset:I?.preventScrollReset}),replace:(L,B,I)=>e.navigate(L,{replace:!0,state:B,preventScrollReset:I?.preventScrollReset})}),[e]),A=e.basename||"/",R=w.useMemo(()=>({router:e,navigator:O,static:!1,basename:A,onError:n}),[e,O,A,n]);return w.createElement(w.Fragment,null,w.createElement(bl.Provider,{value:R},w.createElement(Sf.Provider,{value:c},w.createElement(O6.Provider,{value:N.current},w.createElement(rb.Provider,{value:p},w.createElement(sI,{basename:A,location:c.location,navigationType:c.historyAction,navigator:O,unstable_useTransitions:r},w.createElement(iI,{routes:e.routes,future:e.future,state:c,onError:n})))))),null)}function rk(e,t){return{...e,navigation:t.navigation.state!=="idle"?t.navigation:e.navigation,revalidation:t.revalidation!=="idle"?t.revalidation:e.revalidation,actionData:t.navigation.state!=="submitting"?t.actionData:e.actionData,fetchers:t.fetchers}}var iI=w.memo(oI);function oI({routes:e,future:t,state:n,onError:r}){return FL(e,void 0,n,r,t)}function I6({to:e,replace:t,state:n,relative:r}){It(Jc(),"<Navigate> may be used only in the context of a <Router> component.");let{static:i}=w.useContext(Ti);Hn(!i,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:s}=w.useContext(co),{pathname:a}=Gi(),c=vl(),u=i0(e,r0(s),a,r==="path"),f=JSON.stringify(u);return w.useEffect(()=>{c(JSON.parse(f),{replace:t,state:n,relative:r})},[c,f,r,t,n]),null}function P6(e){return zL(e.context)}function sI({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:i,static:s=!1,unstable_useTransitions:a}){It(!Jc(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let c=e.replace(/^\/*/,"/"),u=w.useMemo(()=>({basename:c,navigator:i,static:s,unstable_useTransitions:a,future:{}}),[c,i,s,a]);typeof n=="string"&&(n=ya(n));let{pathname:f="/",search:m="",hash:p="",state:y=null,key:x="default"}=n,b=w.useMemo(()=>{let S=Yi(f,c);return S==null?null:{location:{pathname:S,search:m,hash:p,state:y,key:x},navigationType:r}},[c,f,m,p,y,x,r]);return Hn(b!=null,`<Router basename="${c}"> is not able to match the URL "${f}${m}${p}" because it does not start with the basename, so the <Router> won't render anything.`),b==null?null:w.createElement(Ti.Provider,{value:u},w.createElement(o0.Provider,{children:t,value:b}))}var Xp="get",Zp="application/x-www-form-urlencoded";function s0(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function aI(e){return s0(e)&&e.tagName.toLowerCase()==="button"}function lI(e){return s0(e)&&e.tagName.toLowerCase()==="form"}function cI(e){return s0(e)&&e.tagName.toLowerCase()==="input"}function uI(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function dI(e,t){return e.button===0&&(!t||t==="_self")&&!uI(e)}function Dy(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(i=>[n,i]):[[n,r]])},[]))}function fI(e,t){let n=Dy(e);return t&&t.forEach((r,i)=>{n.has(i)||t.getAll(i).forEach(s=>{n.append(i,s)})}),n}var pp=null;function hI(){if(pp===null)try{new FormData(document.createElement("form"),0),pp=!1}catch{pp=!0}return pp}var pI=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function y2(e){return e!=null&&!pI.has(e)?(Hn(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Zp}"`),null):e}function mI(e,t){let n,r,i,s,a;if(lI(e)){let c=e.getAttribute("action");r=c?Yi(c,t):null,n=e.getAttribute("method")||Xp,i=y2(e.getAttribute("enctype"))||Zp,s=new FormData(e)}else if(aI(e)||cI(e)&&(e.type==="submit"||e.type==="image")){let c=e.form;if(c==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let u=e.getAttribute("formaction")||c.getAttribute("action");if(r=u?Yi(u,t):null,n=e.getAttribute("formmethod")||c.getAttribute("method")||Xp,i=y2(e.getAttribute("formenctype"))||y2(c.getAttribute("enctype"))||Zp,s=new FormData(c,e),!hI()){let{name:f,type:m,value:p}=e;if(m==="image"){let y=f?`${f}.`:"";s.append(`${y}x`,"0"),s.append(`${y}y`,"0")}else f&&s.append(f,p)}}else{if(s0(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Xp,r=null,i=Zp,a=e}return s&&i==="text/plain"&&(a=s,s=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:s,body:a}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function ab(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function gI(e,t,n,r){let i=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return n?i.pathname.endsWith("/")?i.pathname=`${i.pathname}_.${r}`:i.pathname=`${i.pathname}.${r}`:i.pathname==="/"?i.pathname=`_root.${r}`:t&&Yi(i.pathname,t)==="/"?i.pathname=`${t.replace(/\/$/,"")}/_root.${r}`:i.pathname=`${i.pathname.replace(/\/$/,"")}.${r}`,i}async function yI(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(n){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function xI(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function bI(e,t,n){let r=await Promise.all(e.map(async i=>{let s=t.routes[i.route.id];if(s){let a=await yI(s,n);return a.links?a.links():[]}return[]}));return CI(r.flat(1).filter(xI).filter(i=>i.rel==="stylesheet"||i.rel==="preload").map(i=>i.rel==="stylesheet"?{...i,rel:"prefetch",as:"style"}:{...i,rel:"prefetch"}))}function ik(e,t,n,r,i,s){let a=(u,f)=>n[f]?u.route.id!==n[f].route.id:!0,c=(u,f)=>n[f].pathname!==u.pathname||n[f].route.path?.endsWith("*")&&n[f].params["*"]!==u.params["*"];return s==="assets"?t.filter((u,f)=>a(u,f)||c(u,f)):s==="data"?t.filter((u,f)=>{let m=r.routes[u.route.id];if(!m||!m.hasLoader)return!1;if(a(u,f)||c(u,f))return!0;if(u.route.shouldRevalidate){let p=u.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:u.params,defaultShouldRevalidate:!0});if(typeof p=="boolean")return p}return!0}):[]}function vI(e,t,{includeHydrateFallback:n}={}){return wI(e.map(r=>{let i=t.routes[r.route.id];if(!i)return[];let s=[i.module];return i.clientActionModule&&(s=s.concat(i.clientActionModule)),i.clientLoaderModule&&(s=s.concat(i.clientLoaderModule)),n&&i.hydrateFallbackModule&&(s=s.concat(i.hydrateFallbackModule)),i.imports&&(s=s.concat(i.imports)),s}).flat(1))}function wI(e){return[...new Set(e)]}function SI(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function CI(e,t){let n=new Set;return new Set(t),e.reduce((r,i)=>{let s=JSON.stringify(SI(i));return n.has(s)||(n.add(s),r.push({key:s,link:i})),r},[])}function z6(){let e=w.useContext(bl);return ab(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function kI(){let e=w.useContext(Sf);return ab(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var lb=w.createContext(void 0);lb.displayName="FrameworkContext";function F6(){let e=w.useContext(lb);return ab(e,"You must render this element inside a <HydratedRouter> element"),e}function EI(e,t){let n=w.useContext(lb),[r,i]=w.useState(!1),[s,a]=w.useState(!1),{onFocus:c,onBlur:u,onMouseEnter:f,onMouseLeave:m,onTouchStart:p}=t,y=w.useRef(null);w.useEffect(()=>{if(e==="render"&&a(!0),e==="viewport"){let S=E=>{E.forEach(T=>{a(T.isIntersecting)})},k=new IntersectionObserver(S,{threshold:.5});return y.current&&k.observe(y.current),()=>{k.disconnect()}}},[e]),w.useEffect(()=>{if(r){let S=setTimeout(()=>{a(!0)},100);return()=>{clearTimeout(S)}}},[r]);let x=()=>{i(!0)},b=()=>{i(!1),a(!1)};return n?e!=="intent"?[s,y,{}]:[s,y,{onFocus:ad(c,x),onBlur:ad(u,b),onMouseEnter:ad(f,x),onMouseLeave:ad(m,b),onTouchStart:ad(p,x)}]:[!1,y,{}]}function ad(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function TI({page:e,...t}){let{router:n}=z6(),r=w.useMemo(()=>ea(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?w.createElement(RI,{page:e,matches:r,...t}):null}function NI(e){let{manifest:t,routeModules:n}=F6(),[r,i]=w.useState([]);return w.useEffect(()=>{let s=!1;return bI(e,t,n).then(a=>{s||i(a)}),()=>{s=!0}},[e,t,n]),r}function RI({page:e,matches:t,...n}){let r=Gi(),{future:i,manifest:s,routeModules:a}=F6(),{basename:c}=z6(),{loaderData:u,matches:f}=kI(),m=w.useMemo(()=>ik(e,t,f,s,r,"data"),[e,t,f,s,r]),p=w.useMemo(()=>ik(e,t,f,s,r,"assets"),[e,t,f,s,r]),y=w.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let S=new Set,k=!1;if(t.forEach(T=>{let N=s.routes[T.route.id];!N||!N.hasLoader||(!m.some(j=>j.route.id===T.route.id)&&T.route.id in u&&a[T.route.id]?.shouldRevalidate||N.hasClientLoader?k=!0:S.add(T.route.id))}),S.size===0)return[];let E=gI(e,c,i.unstable_trailingSlashAwareDataRequests,"data");return k&&S.size>0&&E.searchParams.set("_routes",t.filter(T=>S.has(T.route.id)).map(T=>T.route.id).join(",")),[E.pathname+E.search]},[c,i.unstable_trailingSlashAwareDataRequests,u,r,s,m,t,e,a]),x=w.useMemo(()=>vI(p,s),[p,s]),b=NI(p);return w.createElement(w.Fragment,null,y.map(S=>w.createElement("link",{key:S,rel:"prefetch",as:"fetch",href:S,...n})),x.map(S=>w.createElement("link",{key:S,rel:"modulepreload",href:S,...n})),b.map(({key:S,link:k})=>w.createElement("link",{key:S,nonce:n.nonce,...k,crossOrigin:k.crossOrigin??n.crossOrigin})))}function AI(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var OI=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{OI&&(window.__reactRouterVersion="7.13.0")}catch{}function jI(e,t){return iL({basename:t?.basename,getContext:t?.getContext,future:t?.future,history:v_({window:t?.window}),hydrationData:MI(),routes:e,mapRouteProperties:eI,hydrationRouteProperties:tI,dataStrategy:t?.dataStrategy,patchRoutesOnNavigation:t?.patchRoutesOnNavigation,window:t?.window,unstable_instrumentations:t?.unstable_instrumentations}).initialize()}function MI(){let e=window?.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:DI(e.errors)}),e}function DI(e){if(!e)return null;let t=Object.entries(e),n={};for(let[r,i]of t)if(i&&i.__type==="RouteErrorResponse")n[r]=new vf(i.status,i.statusText,i.data,i.internal===!0);else if(i&&i.__type==="Error"){if(i.__subType){let s=window[i.__subType];if(typeof s=="function")try{let a=new s(i.message);a.stack="",n[r]=a}catch{}}if(n[r]==null){let s=new Error(i.message);s.stack="",n[r]=s}}else n[r]=i;return n}var B6=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,cb=w.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:i,reloadDocument:s,replace:a,state:c,target:u,to:f,preventScrollReset:m,viewTransition:p,unstable_defaultShouldRevalidate:y,...x},b){let{basename:S,unstable_useTransitions:k}=w.useContext(Ti),E=typeof f=="string"&&B6.test(f),T=y6(f,S);f=T.to;let N=LL(f,{relative:i}),[j,O,A]=EI(r,x),R=II(f,{replace:a,state:c,target:u,preventScrollReset:m,relative:i,viewTransition:p,unstable_defaultShouldRevalidate:y,unstable_useTransitions:k});function L(I){t&&t(I),I.defaultPrevented||R(I)}let B=w.createElement("a",{...x,...A,href:T.absoluteURL||N,onClick:T.isExternal||s?t:L,ref:AI(b,O),target:u,"data-discover":!E&&n==="render"?"true":void 0});return j&&!E?w.createElement(w.Fragment,null,B,w.createElement(TI,{page:N})):B});cb.displayName="Link";var H6=w.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:i=!1,style:s,to:a,viewTransition:c,children:u,...f},m){let p=Cf(a,{relative:f.relative}),y=Gi(),x=w.useContext(Sf),{navigator:b,basename:S}=w.useContext(Ti),k=x!=null&&HI(p)&&c===!0,E=b.encodeLocation?b.encodeLocation(p).pathname:p.pathname,T=y.pathname,N=x&&x.navigation&&x.navigation.location?x.navigation.location.pathname:null;n||(T=T.toLowerCase(),N=N?N.toLowerCase():null,E=E.toLowerCase()),N&&S&&(N=Yi(N,S)||N);const j=E!=="/"&&E.endsWith("/")?E.length-1:E.length;let O=T===E||!i&&T.startsWith(E)&&T.charAt(j)==="/",A=N!=null&&(N===E||!i&&N.startsWith(E)&&N.charAt(E.length)==="/"),R={isActive:O,isPending:A,isTransitioning:k},L=O?t:void 0,B;typeof r=="function"?B=r(R):B=[r,O?"active":null,A?"pending":null,k?"transitioning":null].filter(Boolean).join(" ");let I=typeof s=="function"?s(R):s;return w.createElement(cb,{...f,"aria-current":L,className:B,ref:m,style:I,to:a,viewTransition:c},typeof u=="function"?u(R):u)});H6.displayName="NavLink";var _I=w.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:s,method:a=Xp,action:c,onSubmit:u,relative:f,preventScrollReset:m,viewTransition:p,unstable_defaultShouldRevalidate:y,...x},b)=>{let{unstable_useTransitions:S}=w.useContext(Ti),k=FI(),E=BI(c,{relative:f}),T=a.toLowerCase()==="get"?"get":"post",N=typeof c=="string"&&B6.test(c),j=O=>{if(u&&u(O),O.defaultPrevented)return;O.preventDefault();let A=O.nativeEvent.submitter,R=A?.getAttribute("formmethod")||a,L=()=>k(A||O.currentTarget,{fetcherKey:t,method:R,navigate:n,replace:i,state:s,relative:f,preventScrollReset:m,viewTransition:p,unstable_defaultShouldRevalidate:y});S&&n!==!1?w.startTransition(()=>L()):L()};return w.createElement("form",{ref:b,method:T,action:E,onSubmit:r?u:j,...x,"data-discover":!N&&e==="render"?"true":void 0})});_I.displayName="Form";function LI(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function U6(e){let t=w.useContext(bl);return It(t,LI(e)),t}function II(e,{target:t,replace:n,state:r,preventScrollReset:i,relative:s,viewTransition:a,unstable_defaultShouldRevalidate:c,unstable_useTransitions:u}={}){let f=vl(),m=Gi(),p=Cf(e,{relative:s});return w.useCallback(y=>{if(dI(y,t)){y.preventDefault();let x=n!==void 0?n:Ao(m)===Ao(p),b=()=>f(e,{replace:x,state:r,preventScrollReset:i,relative:s,viewTransition:a,unstable_defaultShouldRevalidate:c});u?w.startTransition(()=>b()):b()}},[m,f,p,n,r,t,e,i,s,a,c,u])}function a0(e){Hn(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=w.useRef(Dy(e)),n=w.useRef(!1),r=Gi(),i=w.useMemo(()=>fI(r.search,n.current?null:t.current),[r.search]),s=vl(),a=w.useCallback((c,u)=>{const f=Dy(typeof c=="function"?c(new URLSearchParams(i)):c);n.current=!0,s("?"+f,u)},[s,i]);return[i,a]}var PI=0,zI=()=>`__${String(++PI)}__`;function FI(){let{router:e}=U6("useSubmit"),{basename:t}=w.useContext(Ti),n=GL(),r=e.fetch,i=e.navigate;return w.useCallback(async(s,a={})=>{let{action:c,method:u,encType:f,formData:m,body:p}=mI(s,t);if(a.navigate===!1){let y=a.fetcherKey||zI();await r(y,n,a.action||c,{unstable_defaultShouldRevalidate:a.unstable_defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:m,body:p,formMethod:a.method||u,formEncType:a.encType||f,flushSync:a.flushSync})}else await i(a.action||c,{unstable_defaultShouldRevalidate:a.unstable_defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:m,body:p,formMethod:a.method||u,formEncType:a.encType||f,replace:a.replace,state:a.state,fromRouteId:n,flushSync:a.flushSync,viewTransition:a.viewTransition})},[r,i,t,n])}function BI(e,{relative:t}={}){let{basename:n}=w.useContext(Ti),r=w.useContext(co);It(r,"useFormAction must be used inside a RouteContext");let[i]=r.matches.slice(-1),s={...Cf(e||".",{relative:t})},a=Gi();if(e==null){s.search=a.search;let c=new URLSearchParams(s.search),u=c.getAll("index");if(u.some(m=>m==="")){c.delete("index"),u.filter(p=>p).forEach(p=>c.append("index",p));let m=c.toString();s.search=m?`?${m}`:""}}return(!e||e===".")&&i.route.index&&(s.search=s.search?s.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(s.pathname=s.pathname==="/"?n:Co([n,s.pathname])),Ao(s)}function HI(e,{relative:t}={}){let n=w.useContext(rb);It(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=U6("useViewTransitionState"),i=Cf(e,{relative:t});if(!n.isTransitioning)return!1;let s=Yi(n.currentLocation.pathname,r)||n.currentLocation.pathname,a=Yi(n.nextLocation.pathname,r)||n.nextLocation.pathname;return mm(i.pathname,a)!=null||mm(i.pathname,s)!=null}function UI(e){return w.createElement(rI,{flushSync:vi.flushSync,...e})}const ok={};function ir(e,t){const n=w.useRef(ok);return n.current===ok&&(n.current=e(t)),n}const _y=[];let Ly;function VI(){return Ly}function qI(e){_y.push(e)}function ub(e){const t=(n,r)=>{const i=ir($I).current;let s;try{Ly=i;for(const a of _y)a.before(i);s=e(n,r);for(const a of _y)a.after(i);i.didInitialize=!0}finally{Ly=void 0}return s};return t.displayName=e.displayName||e.name,t}function V6(e){return w.forwardRef(ub(e))}function $I(){return{didInitialize:!1}}function l0(e){const t=w.useRef(!0);t.current&&(t.current=!1,e())}const YI=()=>{},We=typeof document<"u"?w.useLayoutEffect:YI;function WI(e,t){return function(r,...i){const s=new URL(e);return s.searchParams.set("code",r.toString()),i.forEach(a=>s.searchParams.append("args[]",a)),`${t} error #${r}; visit ${s} for the full message.`}}const Cn=WI("https://base-ui.com/production-error","Base UI"),q6=w.createContext(void 0);function kf(e){const t=w.useContext(q6);if(t===void 0&&!e)throw new Error(Cn(72));return t}const GI=[];function db(e){w.useEffect(e,GI)}const ld=0;class lo{static create(){return new lo}currentId=ld;start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=ld,n()},t)}isStarted(){return this.currentId!==ld}clear=()=>{this.currentId!==ld&&(clearTimeout(this.currentId),this.currentId=ld)};disposeEffect=()=>this.clear}function Bn(){const e=ir(lo.create).current;return db(e.disposeEffect),e}function c0(){return typeof window<"u"}function xa(e){return fb(e)?(e.nodeName||"").toLowerCase():"#document"}function Un(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Do(e){var t;return(t=(fb(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function fb(e){return c0()?e instanceof Node||e instanceof Un(e).Node:!1}function cn(e){return c0()?e instanceof Element||e instanceof Un(e).Element:!1}function zn(e){return c0()?e instanceof HTMLElement||e instanceof Un(e).HTMLElement:!1}function Qd(e){return!c0()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Un(e).ShadowRoot}function ba(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=wi(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!=="inline"&&i!=="contents"}function KI(e){return/^(table|td|th)$/.test(xa(e))}function u0(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const QI=/transform|translate|scale|rotate|perspective|filter/,XI=/paint|layout|strict|content/,Xa=e=>!!e&&e!=="none";let x2;function hb(e){const t=cn(e)?wi(e):e;return Xa(t.transform)||Xa(t.translate)||Xa(t.scale)||Xa(t.rotate)||Xa(t.perspective)||!d0()&&(Xa(t.backdropFilter)||Xa(t.filter))||QI.test(t.willChange||"")||XI.test(t.contain||"")}function ZI(e){let t=Oo(e);for(;zn(t)&&!ko(t);){if(hb(t))return t;if(u0(t))return null;t=Oo(t)}return null}function d0(){return x2==null&&(x2=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),x2}function ko(e){return/^(html|body|#document)$/.test(xa(e))}function wi(e){return Un(e).getComputedStyle(e)}function f0(e){return cn(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Oo(e){if(xa(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Qd(e)&&e.host||Do(e);return Qd(t)?t.host:t}function $6(e){const t=Oo(e);return ko(t)?e.ownerDocument?e.ownerDocument.body:e.body:zn(t)&&ba(t)?t:$6(t)}function Xd(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=$6(e),s=i===((r=e.ownerDocument)==null?void 0:r.body),a=Un(i);if(s){const c=Iy(a);return t.concat(a,a.visualViewport||[],ba(i)?i:[],c&&n?Xd(c):[])}else return t.concat(i,Xd(i,[],n))}function Iy(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const eu=typeof navigator<"u",b2=JI(),Y6=tP(),W6=eP(),pb=typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter:none"),G6=b2.platform==="MacIntel"&&b2.maxTouchPoints>1?!0:/iP(hone|ad|od)|iOS/.test(b2.platform),K6=eu&&/apple/i.test(navigator.vendor),Py=eu&&/android/i.test(Y6)||/android/i.test(W6),Q6=eu&&Y6.toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints,X6=W6.includes("jsdom/");function JI(){if(!eu)return{platform:"",maxTouchPoints:-1};const e=navigator.userAgentData;return e?.platform?{platform:e.platform,maxTouchPoints:navigator.maxTouchPoints}:{platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??-1}}function eP(){if(!eu)return"";const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:t,version:n})=>`${t}/${n}`).join(" "):navigator.userAgent}function tP(){if(!eu)return"";const e=navigator.userAgentData;return e?.platform?e.platform:navigator.platform??""}const zy="data-base-ui-focusable",Z6="active",J6="selected",eN="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",da="ArrowLeft",fa="ArrowRight",mb="ArrowUp",Ef="ArrowDown";function mi(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function Nt(e,t){if(!e||!t)return!1;const n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&Qd(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function gm(e,t){if(!cn(e))return!1;const n=e;if(t.hasElement(n))return!n.hasAttribute("data-trigger-disabled");for(const[,r]of t.entries())if(Nt(r,n))return!r.hasAttribute("data-trigger-disabled");return!1}function Fr(e){return"composedPath"in e?e.composedPath()[0]:e.target}function no(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function nP(e){return e.matches("html,body")}function h0(e){return zn(e)&&e.matches(eN)}function Fy(e){return e?e.getAttribute("role")==="combobox"&&h0(e):!1}function rP(e){if(!e||X6)return!0;try{return e.matches(":focus-visible")}catch{return!0}}function Zd(e){return e?e.hasAttribute(zy)?e:e.querySelector(`[${zy}]`)||e:null}function ds(e,t,n=!0){return e.filter(i=>i.parentId===t&&(!n||i.context?.open)).flatMap(i=>[i,...ds(e,i.id,n)])}function sk(e,t){let n=[],r=e.find(i=>i.id===t)?.parentId;for(;r;){const i=e.find(s=>s.id===r);r=i?.parentId,i&&(n=n.concat(i))}return n}function pi(e){e.preventDefault(),e.stopPropagation()}function iP(e){return"nativeEvent"in e}function tN(e){return e.pointerType===""&&e.isTrusted?!0:Py&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function nN(e){return X6?!1:!Py&&e.width===0&&e.height===0||Py&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function zc(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function rN(e){const t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}const oP=["top","right","bottom","left"],Fc=Math.min,gi=Math.max,ym=Math.round,il=Math.floor,Eo=e=>({x:e,y:e}),sP={left:"right",right:"left",bottom:"top",top:"bottom"};function By(e,t,n){return gi(e,Fc(t,n))}function hs(e,t){return typeof e=="function"?e(t):e}function Jr(e){return e.split("-")[0]}function va(e){return e.split("-")[1]}function gb(e){return e==="x"?"y":"x"}function yb(e){return e==="y"?"height":"width"}function qi(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function xb(e){return gb(qi(e))}function aP(e,t,n){n===void 0&&(n=!1);const r=va(e),i=xb(e),s=yb(i);let a=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(a=xm(a)),[a,xm(a)]}function lP(e){const t=xm(e);return[Hy(e),t,Hy(t)]}function Hy(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const ak=["left","right"],lk=["right","left"],cP=["top","bottom"],uP=["bottom","top"];function dP(e,t,n){switch(e){case"top":case"bottom":return n?t?lk:ak:t?ak:lk;case"left":case"right":return t?cP:uP;default:return[]}}function fP(e,t,n,r){const i=va(e);let s=dP(Jr(e),n==="start",r);return i&&(s=s.map(a=>a+"-"+i),t&&(s=s.concat(s.map(Hy)))),s}function xm(e){const t=Jr(e);return sP[t]+e.slice(t.length)}function hP(e){return{top:0,right:0,bottom:0,left:0,...e}}function iN(e){return typeof e!="number"?hP(e):{top:e,right:e,bottom:e,left:e}}function Jd(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function mp(e,t,n){return Math.floor(e/t)!==n}function bm(e,t){return t<0||t>=e.current.length}function v2(e,t){return Pr(e,{disabledIndices:t})}function ck(e,t){return Pr(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function Pr(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:r,amount:i=1}={}){let s=t;do s+=n?-i:i;while(s>=0&&s<=e.current.length-1&&Rc(e,s,r));return s}function pP(e,{event:t,orientation:n,loopFocus:r,rtl:i,cols:s,disabledIndices:a,minIndex:c,maxIndex:u,prevIndex:f,stopEvent:m=!1}){let p=f,y;if(t.key===mb?y="up":t.key===Ef&&(y="down"),y){const x=[],b=[];let S=!1,k=0;{let L=null,B=-1;e.current.forEach((I,U)=>{if(I==null)return;k+=1;const Y=I.closest('[role="row"]');Y&&(S=!0),(Y!==L||B===-1)&&(L=Y,B+=1,x[B]=[]),x[B].push(U),b[U]=B})}let E=!1,T=0;if(S)for(const L of x){const B=L.length;B>T&&(T=B),B!==s&&(E=!0)}const N=E&&k<e.current.length,j=T||s,O=L=>{if(!E||f===-1)return;const B=b[f];if(B==null)return;const I=x[B].indexOf(f),U=L==="up"?-1:1;for(let Y=B+U,V=0;V<x.length;V+=1,Y+=U){if(Y<0||Y>=x.length){if(!r||N)return;Y=Y<0?x.length-1:0}const q=x[Y];for(let H=Math.min(I,q.length-1);H>=0;H-=1){const z=q[H];if(!Rc(e,z,a))return z}}},A=L=>{if(!N||f===-1)return;const B=f%j,I=L==="up"?-j:j,U=u-u%j,Y=il(u/j)+1;for(let V=f-B+I,q=0;q<Y;q+=1,V+=I){if(V<0||V>u){if(!r)return;V=V<0?U:0}const H=Math.min(V+j-1,u);for(let z=Math.min(V+B,H);z>=V;z-=1)if(!Rc(e,z,a))return z}};m&&pi(t);const R=O(y)??A(y);if(R!==void 0)p=R;else if(f===-1)p=y==="up"?u:c;else if(p=Pr(e,{startingIndex:f,amount:j,decrement:y==="up",disabledIndices:a}),r){if(y==="up"&&(f-j<c||p<0)){const L=f%j,B=u%j,I=u-(B-L);B===L?p=u:p=B>L?I:I-j}y==="down"&&f+j>u&&(p=Pr(e,{startingIndex:f%j-j,amount:j,disabledIndices:a}))}bm(e,p)&&(p=f)}if(n==="both"){const x=il(f/s);t.key===(i?da:fa)&&(m&&pi(t),f%s!==s-1?(p=Pr(e,{startingIndex:f,disabledIndices:a}),r&&mp(p,s,x)&&(p=Pr(e,{startingIndex:f-f%s-1,disabledIndices:a}))):r&&(p=Pr(e,{startingIndex:f-f%s-1,disabledIndices:a})),mp(p,s,x)&&(p=f)),t.key===(i?fa:da)&&(m&&pi(t),f%s!==0?(p=Pr(e,{startingIndex:f,decrement:!0,disabledIndices:a}),r&&mp(p,s,x)&&(p=Pr(e,{startingIndex:f+(s-f%s),decrement:!0,disabledIndices:a}))):r&&(p=Pr(e,{startingIndex:f+(s-f%s),decrement:!0,disabledIndices:a})),mp(p,s,x)&&(p=f));const b=il(u/s)===x;bm(e,p)&&(r&&b?p=t.key===(i?fa:da)?u:Pr(e,{startingIndex:f-f%s-1,disabledIndices:a}):p=f)}return p}function mP(e,t,n){const r=[];let i=0;return e.forEach(({width:s,height:a},c)=>{let u=!1;for(;!u;){const f=[];for(let m=0;m<s;m+=1)for(let p=0;p<a;p+=1)f.push(i+m+p*t);i%t+s<=t&&f.every(m=>r[m]==null)?(f.forEach(m=>{r[m]=c}),u=!0):i+=1}}),[...r]}function gP(e,t,n,r,i){if(e===-1)return-1;const s=n.indexOf(e),a=t[e];switch(i){case"tl":return s;case"tr":return a?s+a.width-1:s;case"bl":return a?s+(a.height-1)*r:s;case"br":return n.lastIndexOf(e);default:return-1}}function yP(e,t){return t.flatMap((n,r)=>e.includes(n)?[r]:[])}function Rc(e,t,n){if(typeof n=="function"?n(t):n?.includes(t)??!1)return!0;const i=e.current[t];return i?bb(i)?!n&&(i.hasAttribute("disabled")||i.getAttribute("aria-disabled")==="true"):!0:!1}function bb(e){return wi(e).display!=="none"}var xP=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"],vm=xP.join(","),oN=typeof Element>"u",Bc=oN?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,wm=!oN&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e?.ownerDocument},Sm=function(t,n){var r;n===void 0&&(n=!0);var i=t==null||(r=t.getAttribute)===null||r===void 0?void 0:r.call(t,"inert"),s=i===""||i==="true",a=s||n&&t&&(typeof t.closest=="function"?t.closest("[inert]"):Sm(t.parentNode));return a},bP=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},sN=function(t,n,r){if(Sm(t))return[];var i=Array.prototype.slice.apply(t.querySelectorAll(vm));return n&&Bc.call(t,vm)&&i.unshift(t),i=i.filter(r),i},Cm=function(t,n,r){for(var i=[],s=Array.from(t);s.length;){var a=s.shift();if(!Sm(a,!1))if(a.tagName==="SLOT"){var c=a.assignedElements(),u=c.length?c:a.children,f=Cm(u,!0,r);r.flatten?i.push.apply(i,f):i.push({scopeParent:a,candidates:f})}else{var m=Bc.call(a,vm);m&&r.filter(a)&&(n||!t.includes(a))&&i.push(a);var p=a.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(a),y=!Sm(p,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(a));if(p&&y){var x=Cm(p===!0?a.children:p.children,!0,r);r.flatten?i.push.apply(i,x):i.push({scopeParent:a,candidates:x})}else s.unshift.apply(s,a.children)}}return i},aN=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},lN=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||bP(t))&&!aN(t)?0:t.tabIndex},vP=function(t,n){var r=lN(t);return r<0&&n&&!aN(t)?0:r},wP=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},cN=function(t){return t.tagName==="INPUT"},SP=function(t){return cN(t)&&t.type==="hidden"},CP=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},kP=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},EP=function(t){if(!t.name)return!0;var n=t.form||wm(t),r=function(c){return n.querySelectorAll('input[type="radio"][name="'+c+'"]')},i;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")i=r(window.CSS.escape(t.name));else try{i=r(t.name)}catch(a){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",a.message),!1}var s=kP(i,t.form);return!s||s===t},TP=function(t){return cN(t)&&t.type==="radio"},NP=function(t){return TP(t)&&!EP(t)},RP=function(t){var n,r=t&&wm(t),i=(n=r)===null||n===void 0?void 0:n.host,s=!1;if(r&&r!==t){var a,c,u;for(s=!!((a=i)!==null&&a!==void 0&&(c=a.ownerDocument)!==null&&c!==void 0&&c.contains(i)||t!=null&&(u=t.ownerDocument)!==null&&u!==void 0&&u.contains(t));!s&&i;){var f,m,p;r=wm(i),i=(f=r)===null||f===void 0?void 0:f.host,s=!!((m=i)!==null&&m!==void 0&&(p=m.ownerDocument)!==null&&p!==void 0&&p.contains(i))}}return s},uk=function(t){var n=t.getBoundingClientRect(),r=n.width,i=n.height;return r===0&&i===0},AP=function(t,n){var r=n.displayCheck,i=n.getShadowRoot;if(r==="full-native"&&"checkVisibility"in t){var s=t.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!s}if(getComputedStyle(t).visibility==="hidden")return!0;var a=Bc.call(t,"details>summary:first-of-type"),c=a?t.parentElement:t;if(Bc.call(c,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="full-native"||r==="legacy-full"){if(typeof i=="function"){for(var u=t;t;){var f=t.parentElement,m=wm(t);if(f&&!f.shadowRoot&&i(f)===!0)return uk(t);t.assignedSlot?t=t.assignedSlot:!f&&m!==t.ownerDocument?t=m.host:t=f}t=u}if(RP(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return uk(t);return!1},OP=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var r=0;r<n.children.length;r++){var i=n.children.item(r);if(i.tagName==="LEGEND")return Bc.call(n,"fieldset[disabled] *")?!0:!i.contains(t)}return!0}n=n.parentElement}return!1},Uy=function(t,n){return!(n.disabled||SP(n)||AP(n,t)||CP(n)||OP(n))},Vy=function(t,n){return!(NP(n)||lN(n)<0||!Uy(t,n))},jP=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},uN=function(t){var n=[],r=[];return t.forEach(function(i,s){var a=!!i.scopeParent,c=a?i.scopeParent:i,u=vP(c,a),f=a?uN(i.candidates):c;u===0?a?n.push.apply(n,f):n.push(c):r.push({documentOrder:s,tabIndex:u,item:i,isScope:a,content:f})}),r.sort(wP).reduce(function(i,s){return s.isScope?i.push.apply(i,s.content):i.push(s.content),i},[]).concat(n)},Tf=function(t,n){n=n||{};var r;return n.getShadowRoot?r=Cm([t],n.includeContainer,{filter:Vy.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:jP}):r=sN(t,n.includeContainer,Vy.bind(null,n)),uN(r)},MP=function(t,n){n=n||{};var r;return n.getShadowRoot?r=Cm([t],n.includeContainer,{filter:Uy.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):r=sN(t,n.includeContainer,Uy.bind(null,n)),r},dN=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return Bc.call(t,vm)===!1?!1:Vy(n,t)};function Zt(e){return e?.ownerDocument||document}const tu=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function fN(e,t){const n=Tf(e,tu()),r=n.length;if(r===0)return;const i=mi(Zt(e)),s=n.indexOf(i),a=s===-1?t===1?0:r-1:s+t;return n[a]}function vb(e){return fN(Zt(e).body,1)||e}function hN(e){return fN(Zt(e).body,-1)||e}function pN(e,t){if(!e)return null;const n=Tf(Zt(e).body,tu()),r=n.length;if(r===0)return null;const i=n.indexOf(e);if(i===-1)return null;const s=(i+t+r)%r;return n[s]}function DP(e){return pN(e,1)}function _P(e){return pN(e,-1)}function Ac(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!Nt(n,r)}function LP(e){Tf(e,tu()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function dk(e){e.querySelectorAll("[data-tabindex]").forEach(n=>{const r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}function IP(e,t){return t!=null&&!zc(t)?0:typeof e=="function"?e():e}function Ld(e,t,n){const r=IP(e,n);return typeof r=="number"?r:r?.[t]}function fk(e){return typeof e=="function"?e():e}function mN(e,t){return t||e==="click"||e==="mousedown"}function Cr(){}const ef=Object.freeze([]),Fn=Object.freeze({}),PP=500,zP=500,FP={style:{transition:"none"}},BP="data-base-ui-click-trigger",gN={fallbackAxisSide:"none"},yN={fallbackAxisSide:"end"},HP={clipPath:"inset(50%)",position:"fixed",top:0,left:0},wl="none",Hc="trigger-press",Br="trigger-hover",Oc="trigger-focus",p0="outside-press",ul="item-press",UP="close-press",fl="focus-out",m0="escape-key",Jp="list-navigation",xN="cancel-open",Nd="sibling-open",VP="disabled",wb="imperative-action",qP="window-resize";function Et(e,t,n,r){let i=!1,s=!1;const a=Fn;return{reason:e,event:t??new Event("base-ui"),cancel(){i=!0},allowPropagation(){s=!0},get isCanceled(){return i},get isPropagationAllowed(){return s},trigger:n,...a}}const bN=w.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new lo,currentIdRef:{current:null},currentContextRef:{current:null}});function $P(e){const{children:t,delay:n,timeoutMs:r=0}=e,i=w.useRef(n),s=w.useRef(n),a=w.useRef(null),c=w.useRef(null),u=Bn();return h.jsx(bN.Provider,{value:w.useMemo(()=>({hasProvider:!0,delayRef:i,initialDelayRef:s,currentIdRef:a,timeoutMs:r,currentContextRef:c,timeout:u}),[r,u]),children:t})}function YP(e,t={open:!1}){const n="rootStore"in e?e.rootStore:e,r=n.useState("floatingId"),{open:i}=t,s=w.useContext(bN),{currentIdRef:a,delayRef:c,timeoutMs:u,initialDelayRef:f,currentContextRef:m,hasProvider:p,timeout:y}=s,[x,b]=w.useState(!1);return We(()=>{function S(){b(!1),m.current?.setIsInstantPhase(!1),a.current=null,m.current=null,c.current=f.current}if(a.current&&!i&&a.current===r){if(b(!1),u){const k=r;return y.start(u,()=>{n.select("open")||a.current&&a.current!==k||S()}),()=>{y.clear()}}S()}},[i,r,a,c,u,f,m,y,n]),We(()=>{if(!i)return;const S=m.current,k=a.current;y.clear(),m.current={onOpenChange:n.setOpen,setIsInstantPhase:b},a.current=r,c.current={open:0,close:Ld(f.current,"close")},k!==null&&k!==r?(b(!0),S?.setIsInstantPhase(!0),S?.onOpenChange(!1,Et(wl))):(b(!1),S?.setIsInstantPhase(!1))},[i,r,n,a,c,u,f,m,y]),We(()=>()=>{m.current=null},[m]),w.useMemo(()=>({hasProvider:p,delayRef:c,isInstantPhase:x}),[p,c,x])}function ps(e,t,n,r){const i=ir(vN).current;return GP(i,e,t,n,r)&&wN(i,[e,t,n,r]),i.callback}function WP(e){const t=ir(vN).current;return KP(t,e)&&wN(t,e),t.callback}function vN(){return{callback:null,cleanup:null,refs:[]}}function GP(e,t,n,r,i){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==i}function KP(e,t){return e.refs.length!==t.length||e.refs.some((n,r)=>n!==t[r])}function wN(e,t){if(e.refs=t,t.every(n=>n==null)){e.callback=null;return}e.callback=n=>{if(e.cleanup&&(e.cleanup(),e.cleanup=null),n!=null){const r=Array(t.length).fill(null);for(let i=0;i<t.length;i+=1){const s=t[i];if(s!=null)switch(typeof s){case"function":{const a=s(n);typeof a=="function"&&(r[i]=a);break}case"object":{s.current=n;break}}}e.cleanup=()=>{for(let i=0;i<t.length;i+=1){const s=t[i];if(s!=null)switch(typeof s){case"function":{const a=r[i];typeof a=="function"?a():s(null);break}case"object":{s.current=null;break}}}}}}}function gr(e){const t=ir(QP,e).current;return t.next=e,We(t.effect),t}function QP(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}const w2=Zx[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],XP=w2&&w2!==w.useLayoutEffect?w2:e=>e();function tt(e){const t=ir(ZP).current;return t.next=e,XP(t.effect),t.trampoline}function ZP(){const e={next:void 0,callback:JP,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function JP(){}const gp=null;class ez{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=t=>{this.isScheduled=!1;const n=this.callbacks,r=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,r>0)for(let i=0;i<n.length;i+=1)n[i]?.(t)};request(t){const n=this.nextId;return this.nextId+=1,this.callbacks.push(t),this.callbacksCount+=1,!this.isScheduled&&(requestAnimationFrame(this.tick),this.isScheduled=!0),n}cancel(t){const n=t-this.startId;n<0||n>=this.callbacks.length||(this.callbacks[n]=null,this.callbacksCount-=1)}}const yp=new ez;class vo{static create(){return new vo}static request(t){return yp.request(t)}static cancel(t){return yp.cancel(t)}currentId=gp;request(t){this.cancel(),this.currentId=yp.request(()=>{this.currentId=gp,t()})}cancel=()=>{this.currentId!==gp&&(yp.cancel(this.currentId),this.currentId=gp)};disposeEffect=()=>this.cancel}function g0(){const e=ir(vo.create).current;return db(e.disposeEffect),e}const SN={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},Sb={...SN,position:"fixed",top:0,left:0},CN={...SN,position:"absolute"},Uc=w.forwardRef(function(t,n){const[r,i]=w.useState();We(()=>{K6&&i("button")},[]);const s={tabIndex:0,role:r};return h.jsx("span",{...t,ref:n,style:Sb,"aria-hidden":r?void 0:!0,...s,"data-base-ui-focus-guard":""})});function tf(e){return`data-base-ui-${e}`}let hk=0;function Id(e,t={}){const{preventScroll:n=!1,cancelPrevious:r=!0,sync:i=!1}=t;r&&cancelAnimationFrame(hk);const s=()=>e?.focus({preventScroll:n});i?s():hk=requestAnimationFrame(s)}const S2={inert:new WeakMap,"aria-hidden":new WeakMap},pk="data-base-ui-inert",qy={inert:new WeakSet,"aria-hidden":new WeakSet};let cd=new WeakMap,C2=0;function tz(e){return qy[e]}function kN(e){return e?Qd(e)?e.host:kN(e.parentNode):null}const k2=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=kN(n);return e.contains(r)?r:null}).filter(n=>n!=null),mk=e=>{const t=new Set;return e.forEach(n=>{let r=n;for(;r&&!t.has(r);)t.add(r),r=r.parentNode}),t},gk=(e,t,n)=>{const r=[],i=s=>{!s||n.has(s)||Array.from(s.children).forEach(a=>{xa(a)!=="script"&&(t.has(a)?i(a):r.push(a))})};return i(e),r};function nz(e,t,n,r,{mark:i=!0,markerIgnoreElements:s=[]}){const a=r?"inert":n?"aria-hidden":null;let c=null,u=null;const f=k2(t,e),m=i?k2(t,s):[],p=new Set(m),y=i?gk(t,mk(f),new Set(f)).filter(S=>!p.has(S)):[],x=[],b=[];if(a){const S=S2[a],k=tz(a);u=k,c=S;const E=k2(t,Array.from(t.querySelectorAll("[aria-live]"))),T=f.concat(E);gk(t,mk(T),new Set(T)).forEach(j=>{const O=j.getAttribute(a),A=O!==null&&O!=="false",R=(S.get(j)||0)+1;S.set(j,R),x.push(j),R===1&&A&&k.add(j),A||j.setAttribute(a,a==="inert"?"":"true")})}return i&&y.forEach(S=>{const k=(cd.get(S)||0)+1;cd.set(S,k),b.push(S),k===1&&S.setAttribute(pk,"")}),C2+=1,()=>{c&&x.forEach(S=>{const E=(c.get(S)||0)-1;c.set(S,E),E||(!u?.has(S)&&a&&S.removeAttribute(a),u?.delete(S))}),i&&b.forEach(S=>{const k=(cd.get(S)||0)-1;cd.set(S,k),k||S.removeAttribute(pk)}),C2-=1,C2||(S2.inert=new WeakMap,S2["aria-hidden"]=new WeakMap,qy.inert=new WeakSet,qy["aria-hidden"]=new WeakSet,cd=new WeakMap)}}function yk(e,t={}){const{ariaHidden:n=!1,inert:r=!1,mark:i=!0,markerIgnoreElements:s=[]}=t,a=Zt(e[0]).body;return nz(e,a,n,r,{mark:i,markerIgnoreElements:s})}const rz={...Zx};let xk=0;function iz(e,t="mui"){const[n,r]=w.useState(e),i=e||n;return w.useEffect(()=>{n==null&&(xk+=1,r(`${t}-${xk}`))},[n,t]),i}const bk=rz.useId;function Sl(e,t){if(bk!==void 0){const n=bk();return e??(t?`${t}-${n}`:n)}return iz(e,t)}const oz=parseInt(w.version,10);function Cb(e){return oz>=e}function vk(e){if(!w.isValidElement(e))return null;const t=e,n=t.props;return(Cb(19)?n?.ref:t.ref)??null}function $y(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function sz(e,t){const n={};for(const r in e){const i=e[r];if(t?.hasOwnProperty(r)){const s=t[r](i);s!=null&&Object.assign(n,s);continue}i===!0?n[`data-${r.toLowerCase()}`]="":i&&(n[`data-${r.toLowerCase()}`]=i.toString())}return n}function az(e,t){return typeof e=="function"?e(t):e}function lz(e,t){return typeof e=="function"?e(t):e}const Pd={};function jo(e,t,n,r,i){let s={...Yy(e,Pd)};return t&&(s=Rd(s,t)),n&&(s=Rd(s,n)),r&&(s=Rd(s,r)),i&&(s=Rd(s,i)),s}function cz(e){if(e.length===0)return Pd;if(e.length===1)return Yy(e[0],Pd);let t={...Yy(e[0],Pd)};for(let n=1;n<e.length;n+=1)t=Rd(t,e[n]);return t}function Rd(e,t){return EN(t)?t(e):uz(e,t)}function uz(e,t){if(!t)return e;for(const n in t){const r=t[n];switch(n){case"style":{e[n]=$y(e.style,r);break}case"className":{e[n]=TN(e.className,r);break}default:dz(n,r)?e[n]=fz(e[n],r):e[n]=r}}return e}function dz(e,t){const n=e.charCodeAt(0),r=e.charCodeAt(1),i=e.charCodeAt(2);return n===111&&r===110&&i>=65&&i<=90&&(typeof t=="function"||typeof t>"u")}function EN(e){return typeof e=="function"}function Yy(e,t){return EN(e)?e(t):e??Pd}function fz(e,t){return t?e?n=>{if(hz(n)){const i=n;Wy(i);const s=t(i);return i.baseUIHandlerPrevented||e?.(i),s}const r=t(n);return e?.(n),r}:t:e}function Wy(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function TN(e,t){return t?e?t+" "+e:t:e}function hz(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}function jt(e,t,n={}){const r=t.render,i=pz(t,n);if(n.enabled===!1)return null;const s=n.state??Fn;return gz(e,r,i,s)}function pz(e,t={}){const{className:n,style:r,render:i}=e,{state:s=Fn,ref:a,props:c,stateAttributesMapping:u,enabled:f=!0}=t,m=f?az(n,s):void 0,p=f?lz(r,s):void 0,y=f?sz(s,u):Fn,x=f?$y(y,Array.isArray(c)?cz(c):c)??Fn:Fn;return typeof document<"u"&&(f?Array.isArray(a)?x.ref=WP([x.ref,vk(i),...a]):x.ref=ps(x.ref,vk(i),a):ps(null,null)),f?(m!==void 0&&(x.className=TN(x.className,m)),p!==void 0&&(x.style=$y(x.style,p)),x):Fn}const mz=Symbol.for("react.lazy");function gz(e,t,n,r){if(t){if(typeof t=="function")return t(n,r);const i=jo(n,t.props);i.ref=n.ref;let s=t;return s?.$$typeof===mz&&(s=w.Children.toArray(t)[0]),w.cloneElement(s,i)}if(e&&typeof e=="string")return yz(e,n);throw new Error(Cn(8))}function yz(e,t){return e==="button"?w.createElement("button",{type:"button",...t,key:t.key}):e==="img"?w.createElement("img",{alt:"",...t,key:t.key}):w.createElement(e,t)}const NN=w.createContext(null),RN=()=>w.useContext(NN),xz=tf("portal");function AN(e={}){const{ref:t,container:n,componentProps:r=Fn,elementProps:i}=e,s=Sl(),c=RN()?.portalNode,[u,f]=w.useState(null),[m,p]=w.useState(null),y=tt(k=>{k!==null&&p(k)}),x=w.useRef(null);We(()=>{if(n===null){x.current&&(x.current=null,p(null),f(null));return}if(s==null)return;const k=(n&&(fb(n)?n:n.current))??c??document.body;if(k==null){x.current&&(x.current=null,p(null),f(null));return}x.current!==k&&(x.current=k,p(null),f(k))},[n,c,s]);const b=jt("div",r,{ref:[t,y],props:[{id:s,[xz]:""},i]});return{portalNode:m,portalSubtree:u&&b?vi.createPortal(b,u):null}}const kb=w.forwardRef(function(t,n){const{children:r,container:i,className:s,render:a,renderGuards:c,...u}=t,{portalNode:f,portalSubtree:m}=AN({container:i,ref:n,componentProps:t,elementProps:u}),p=w.useRef(null),y=w.useRef(null),x=w.useRef(null),b=w.useRef(null),[S,k]=w.useState(null),E=S?.modal,T=S?.open,N=typeof c=="boolean"?c:!!S&&!S.modal&&S.open&&!!f;w.useEffect(()=>{if(!f||E)return;function O(A){f&&A.relatedTarget&&Ac(A)&&(A.type==="focusin"?dk:LP)(f)}return f.addEventListener("focusin",O,!0),f.addEventListener("focusout",O,!0),()=>{f.removeEventListener("focusin",O,!0),f.removeEventListener("focusout",O,!0)}},[f,E]),w.useEffect(()=>{!f||T||dk(f)},[T,f]);const j=w.useMemo(()=>({beforeOutsideRef:p,afterOutsideRef:y,beforeInsideRef:x,afterInsideRef:b,portalNode:f,setFocusManagerState:k}),[f]);return h.jsxs(w.Fragment,{children:[m,h.jsxs(NN.Provider,{value:j,children:[N&&f&&h.jsx(Uc,{"data-type":"outside",ref:p,onFocus:O=>{if(Ac(O,f))x.current?.focus();else{const A=S?S.domReference:null;hN(A)?.focus()}}}),N&&f&&h.jsx("span",{"aria-owns":f.id,style:HP}),f&&vi.createPortal(r,f),N&&f&&h.jsx(Uc,{"data-type":"outside",ref:y,onFocus:O=>{if(Ac(O,f))b.current?.focus();else{const A=S?S.domReference:null;vb(A)?.focus(),S?.closeOnFocusOut&&S?.onOpenChange(!1,Et(fl,O.nativeEvent))}}})]})]})});function ON(){const e=new Map;return{emit(t,n){e.get(t)?.forEach(r=>r(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}class Eb{nodesRef={current:[]};events=ON();addNode(t){this.nodesRef.current.push(t)}removeNode(t){const n=this.nodesRef.current.findIndex(r=>r===t);n!==-1&&this.nodesRef.current.splice(n,1)}}const jN=w.createContext(null),MN=w.createContext(null),vs=()=>w.useContext(jN)?.id||null,wa=e=>{const t=w.useContext(MN);return e??t};function DN(e){const t=Sl(),n=wa(e),r=vs();return We(()=>{if(!t)return;const i={id:t,parentId:r};return n?.addNode(i),()=>{n?.removeNode(i)}},[n,t,r]),t}function bz(e){const{children:t,id:n}=e,r=vs();return h.jsx(jN.Provider,{value:w.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function vz(e){const{children:t,externalTree:n}=e,r=ir(()=>n??new Eb).current;return h.jsx(MN.Provider,{value:r,children:t})}function ss(e){return e==null?e:"current"in e?e.current:e}function wz(e,t){const n=Un(e.target);return e instanceof n.KeyboardEvent?"keyboard":e instanceof n.FocusEvent?t||"keyboard":"pointerType"in e?e.pointerType||"keyboard":"touches"in e?"touch":e instanceof n.MouseEvent?t||(e.detail===0?"keyboard":"mouse"):""}const wk=20;let sa=[];function Tb(){sa=sa.filter(e=>e.deref()?.isConnected)}function Sz(e){Tb(),e&&xa(e)!=="body"&&(sa.push(new WeakRef(e)),sa.length>wk&&(sa=sa.slice(-wk)))}function E2(){return Tb(),sa[sa.length-1]?.deref()}function Cz(e){if(!e)return null;const t=tu();return dN(e,t)?e:Tf(e,t)[0]||e}function kz(e){return!e||!e.isConnected?!1:typeof e.checkVisibility=="function"?e.checkVisibility():bb(e)}function Sk(e,t){if(!t.current.includes("floating")&&!e.getAttribute("role")?.includes("dialog"))return;const n=tu(),i=MP(e,n).filter(a=>{const c=a.getAttribute("data-tabindex")||"";return dN(a,n)||a.hasAttribute("data-tabindex")&&!c.startsWith("-")}),s=e.getAttribute("tabindex");t.current.includes("floating")||i.length===0?s!=="0"&&e.setAttribute("tabindex","0"):(s!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}function Nb(e){const{context:t,children:n,disabled:r=!1,initialFocus:i=!0,returnFocus:s=!0,restoreFocus:a=!1,modal:c=!0,closeOnFocusOut:u=!0,openInteractionType:f="",nextFocusableElement:m,previousFocusableElement:p,beforeContentFocusGuardRef:y,externalTree:x,getInsideElements:b}=e,S="rootStore"in t?t.rootStore:t,k=S.useState("open"),E=S.useState("domReferenceElement"),T=S.useState("floatingElement"),{events:N,dataRef:j}=S.context,O=tt(()=>j.current.floatingContext?.nodeId),A=i===!1,R=Fy(E)&&A,L=w.useRef(["content"]),B=gr(i),I=gr(s),U=gr(f),Y=wa(x),V=RN(),q=w.useRef(!1),H=w.useRef(!1),z=w.useRef(!1),$=w.useRef(-1),G=w.useRef(""),Q=w.useRef(""),_=w.useRef(null),P=w.useRef(null),W=ps(_,y,V?.beforeInsideRef),D=ps(P,V?.afterInsideRef),Z=Bn(),ee=Bn(),J=g0(),he=V!=null,fe=Zd(T),Se=tt((_e=fe)=>_e?Tf(_e,tu()):[]),Ae=tt(()=>b?.().filter(_e=>_e!=null)??[]),Oe=tt(_e=>{const De=Se(_e);return L.current.map(()=>De).filter(Boolean).flat()});w.useEffect(()=>{if(r||!c)return;function _e(xe){xe.key==="Tab"&&Nt(fe,mi(Zt(fe)))&&Se().length===0&&!R&&pi(xe)}const De=Zt(fe);return De.addEventListener("keydown",_e),()=>{De.removeEventListener("keydown",_e)}},[r,E,fe,c,L,R,Se,Oe]),w.useEffect(()=>{if(r||!k)return;const _e=Zt(fe);function De(){z.current=!1}function xe(we){const Re=Fr(we),pe=Ae(),be=Nt(T,Re)||Nt(E,Re)||Nt(V?.portalNode,Re)||pe.some(ne=>ne===Re||Nt(ne,Re));z.current=!be,Q.current=we.pointerType||"keyboard",Re?.closest(`[${BP}]`)&&(H.current=!0)}function Ge(){Q.current="keyboard"}return _e.addEventListener("pointerdown",xe,!0),_e.addEventListener("pointerup",De,!0),_e.addEventListener("pointercancel",De,!0),_e.addEventListener("keydown",Ge,!0),()=>{_e.removeEventListener("pointerdown",xe,!0),_e.removeEventListener("pointerup",De,!0),_e.removeEventListener("pointercancel",De,!0),_e.removeEventListener("keydown",Ge,!0)}},[r,T,E,fe,k,V,Ae]),w.useEffect(()=>{if(r||!u)return;const _e=Zt(fe);function De(){H.current=!0,ee.start(0,()=>{H.current=!1})}function xe(be){const ne=Fr(be),Ce=Se().indexOf(ne);Ce!==-1&&($.current=Ce)}function Ge(be){const ne=be.relatedTarget,ye=be.currentTarget,Ce=Fr(be);queueMicrotask(()=>{const Ve=O(),lt=S.context.triggerElements,oe=Ae(),ke=ne?.hasAttribute(tf("focus-guard"))&&[_.current,P.current,V?.beforeInsideRef.current,V?.afterInsideRef.current,V?.beforeOutsideRef.current,V?.afterOutsideRef.current,ss(p),ss(m)].includes(ne),Le=!(Nt(E,ne)||Nt(T,ne)||Nt(ne,T)||Nt(V?.portalNode,ne)||oe.some(Me=>Me===ne||Nt(Me,ne))||ne!=null&&lt.hasElement(ne)||lt.hasMatchingElement(Me=>Nt(Me,ne))||ke||Y&&(ds(Y.nodesRef.current,Ve).find(Me=>Nt(Me.context?.elements.floating,ne)||Nt(Me.context?.elements.domReference,ne))||sk(Y.nodesRef.current,Ve).find(Me=>[Me.context?.elements.floating,Zd(Me.context?.elements.floating)].includes(ne)||Me.context?.elements.domReference===ne)));if(ye===E&&fe&&Sk(fe,L),a&&ye!==E&&!kz(Ce)&&mi(_e)===_e.body){if(zn(fe)&&(fe.focus(),a==="popup")){J.request(()=>{fe.focus()});return}const Me=$.current,He=Se(),ut=He[Me]||He[He.length-1]||fe;zn(ut)&&ut.focus()}if(j.current.insideReactTree){j.current.insideReactTree=!1;return}(R||!c)&&ne&&Le&&!H.current&&(R||ne!==E2())&&(q.current=!0,S.setOpen(!1,Et(fl,be)))})}function we(){z.current||(j.current.insideReactTree=!0,Z.start(0,()=>{j.current.insideReactTree=!1}))}const Re=zn(E)?E:null,pe=[];if(!(!T&&!Re))return Re&&(Re.addEventListener("focusout",Ge),Re.addEventListener("pointerdown",De),pe.push(()=>{Re.removeEventListener("focusout",Ge),Re.removeEventListener("pointerdown",De)})),T&&(T.addEventListener("focusin",xe),T.addEventListener("focusout",Ge),V&&(T.addEventListener("focusout",we,!0),pe.push(()=>{T.removeEventListener("focusout",we,!0)})),pe.push(()=>{T.removeEventListener("focusin",xe),T.removeEventListener("focusout",Ge)})),()=>{pe.forEach(be=>{be()})}},[r,E,T,fe,c,Y,V,S,u,a,Se,R,O,L,j,Z,ee,J,m,p,Ae]),w.useEffect(()=>{if(r||!T||!k)return;const _e=Array.from(V?.portalNode?.querySelectorAll(`[${tf("portal")}]`)||[]),xe=(Y?sk(Y.nodesRef.current,O()):[]).find(ne=>Fy(ne.context?.elements.domReference||null))?.context?.elements.domReference,we=[...[T,..._e,_.current,P.current,V?.beforeOutsideRef.current,V?.afterOutsideRef.current,...Ae()],xe,ss(p),ss(m),R?E:null].filter(ne=>ne!=null),Re=yk(we,{ariaHidden:c||R,mark:!1}),pe=[T,..._e].filter(ne=>ne!=null),be=yk(pe);return()=>{be(),Re()}},[k,r,E,T,c,L,V,R,Y,O,m,p,Ae]),We(()=>{if(!k||r||!zn(fe))return;const _e=Zt(fe),De=mi(_e);queueMicrotask(()=>{const xe=Oe(fe),Ge=B.current,we=typeof Ge=="function"?Ge(U.current||""):Ge;if(we===void 0||we===!1)return;let Re;we===!0||we===null?Re=xe[0]||fe:Re=ss(we),Re=Re||xe[0]||fe,!Nt(fe,De)&&Id(Re,{preventScroll:Re===fe})})},[r,k,fe,A,Oe,B,U]),We(()=>{if(r||!fe)return;const _e=Zt(fe),De=mi(_e);Sz(De);function xe(we){if(we.open||(G.current=wz(we.nativeEvent,Q.current)),we.reason===Br&&we.nativeEvent.type==="mouseleave"&&(q.current=!0),we.reason===p0)if(we.nested)q.current=!1;else if(tN(we.nativeEvent)||nN(we.nativeEvent))q.current=!1;else{let Re=!1;document.createElement("div").focus({get preventScroll(){return Re=!0,!1}}),Re?q.current=!1:q.current=!0}}N.on("openchange",xe);function Ge(){const we=I.current;let Re=typeof we=="function"?we(G.current):we;if(Re===void 0||Re===!1)return null;if(Re===null&&(Re=!0),typeof Re=="boolean"){const be=E||E2();return be&&be.isConnected?be:null}const pe=E||E2();return ss(Re)||pe||null}return()=>{N.off("openchange",xe);const we=mi(_e),Re=Ae(),pe=Nt(T,we)||Re.some(ne=>ne===we||Nt(ne,we))||Y&&ds(Y.nodesRef.current,O(),!1).some(ne=>Nt(ne.context?.elements.floating,we)),be=Ge();queueMicrotask(()=>{const ne=Cz(be),ye=typeof I.current!="boolean";I.current&&!q.current&&zn(ne)&&(!(!ye&&ne!==we&&we!==_e.body)||pe)&&ne.focus({preventScroll:!0}),q.current=!1})}},[r,T,fe,I,j,N,Y,E,O,Ae]),We(()=>{if(!pb||k||!T)return;const _e=mi(Zt(T));!zn(_e)||!h0(_e)||Nt(T,_e)&&_e.blur()},[k,T]),We(()=>{if(!(r||!V))return V.setFocusManagerState({modal:c,closeOnFocusOut:u,open:k,onOpenChange:S.setOpen,domReference:E}),()=>{V.setFocusManagerState(null)}},[r,V,c,k,S,u,E]),We(()=>{if(!(r||!fe))return Sk(fe,L),()=>{queueMicrotask(Tb)}},[r,fe,L]);const Pe=!r&&(c?!R:!0)&&(he||c);return h.jsxs(w.Fragment,{children:[Pe&&h.jsx(Uc,{"data-type":"inside",ref:W,onFocus:_e=>{if(c){const De=Oe();Id(De[De.length-1])}else V?.portalNode&&(q.current=!1,Ac(_e,V.portalNode)?vb(E)?.focus():ss(p??V.beforeOutsideRef)?.focus())}}),n,Pe&&h.jsx(Uc,{"data-type":"inside",ref:D,onFocus:_e=>{c?Id(Oe()[0]):V?.portalNode&&(u&&(q.current=!0),Ac(_e,V.portalNode)?hN(E)?.focus():ss(m??V.afterOutsideRef)?.focus())}})]})}function Rb(e,t={}){const n="rootStore"in e?e.rootStore:e,r=n.context.dataRef,{enabled:i=!0,event:s="click",toggle:a=!0,ignoreMouse:c=!1,stickIfOpen:u=!0,touchOpenDelay:f=0,reason:m=Hc}=t,p=w.useRef(void 0),y=g0(),x=Bn(),b=w.useMemo(()=>({onPointerDown(S){p.current=S.pointerType},onMouseDown(S){const k=p.current,E=S.nativeEvent,T=n.select("open");if(S.button!==0||s==="click"||zc(k,!0)&&c)return;const N=r.current.openEvent,j=N?.type,O=n.select("domReferenceElement")!==S.currentTarget,A=T&&O||!(T&&a&&(!(N&&u)||j==="click"||j==="mousedown"));if(h0(E.target)){const L=Et(m,E,E.target);A&&k==="touch"&&f>0?x.start(f,()=>{n.setOpen(!0,L)}):n.setOpen(A,L);return}const R=S.currentTarget;y.request(()=>{const L=Et(m,E,R);A&&k==="touch"&&f>0?x.start(f,()=>{n.setOpen(!0,L)}):n.setOpen(A,L)})},onClick(S){if(s==="mousedown-only")return;const k=p.current;if(s==="mousedown"&&k){p.current=void 0;return}if(zc(k,!0)&&c)return;const E=n.select("open"),T=r.current.openEvent,N=n.select("domReferenceElement")!==S.currentTarget,j=E&&N||!(E&&a&&(!(T&&u)||rN(T))),O=Et(m,S.nativeEvent,S.currentTarget);j&&k==="touch"&&f>0?x.start(f,()=>{n.setOpen(!0,O)}):n.setOpen(j,O)},onKeyDown(){p.current=void 0}}),[r,s,c,n,u,a,y,x,f,m]);return w.useMemo(()=>i?{reference:b}:Fn,[i,b])}function Ez(e,t){let n=null,r=null,i=!1;return{contextElement:e||void 0,getBoundingClientRect(){const s=e?.getBoundingClientRect()||{width:0,height:0,x:0,y:0},a=t.axis==="x"||t.axis==="both",c=t.axis==="y"||t.axis==="both",u=["mouseenter","mousemove"].includes(t.dataRef.current.openEvent?.type||"")&&t.pointerType!=="touch";let f=s.width,m=s.height,p=s.x,y=s.y;return n==null&&t.x&&a&&(n=s.x-t.x),r==null&&t.y&&c&&(r=s.y-t.y),p-=n||0,y-=r||0,f=0,m=0,!i||u?(f=t.axis==="y"?s.width:0,m=t.axis==="x"?s.height:0,p=a&&t.x!=null?t.x:p,y=c&&t.y!=null?t.y:y):i&&!u&&(m=t.axis==="x"?s.height:m,f=t.axis==="y"?s.width:f),i=!0,{width:f,height:m,x:p,y,top:y,right:p+f,bottom:y+m,left:p}}}}function Ck(e){return e!=null&&e.clientX!=null}function Tz(e,t={}){const n="rootStore"in e?e.rootStore:e,r=n.useState("open"),i=n.useState("floatingElement"),s=n.useState("domReferenceElement"),a=n.context.dataRef,{enabled:c=!0,axis:u="both"}=t,f=w.useRef(!1),m=w.useRef(null),[p,y]=w.useState(),[x,b]=w.useState([]),S=tt((j,O,A)=>{f.current||a.current.openEvent&&!Ck(a.current.openEvent)||n.set("positionReference",Ez(A??s,{x:j,y:O,axis:u,dataRef:a,pointerType:p}))}),k=tt(j=>{r?m.current||b([]):S(j.clientX,j.clientY,j.currentTarget)}),E=zc(p)?i:r,T=w.useCallback(()=>{if(!E||!c)return;const j=Un(i);function O(A){const R=Fr(A);Nt(i,R)?(j.removeEventListener("mousemove",O),m.current=null):S(A.clientX,A.clientY)}if(!a.current.openEvent||Ck(a.current.openEvent)){j.addEventListener("mousemove",O);const A=()=>{j.removeEventListener("mousemove",O),m.current=null};return m.current=A,A}n.set("positionReference",s)},[E,c,i,a,s,n,S]);w.useEffect(()=>T(),[T,x]),w.useEffect(()=>{c&&!i&&(f.current=!1)},[c,i]),w.useEffect(()=>{!c&&r&&(f.current=!0)},[c,r]);const N=w.useMemo(()=>{function j(O){y(O.pointerType)}return{onPointerDown:j,onPointerEnter:j,onMouseMove:k,onMouseEnter:k}},[k]);return w.useMemo(()=>c?{reference:N,trigger:N}:{},[c,N])}const Nz={intentional:"onClick",sloppy:"onPointerDown"};function Rz(){return!1}function Az(e){return{escapeKey:typeof e=="boolean"?e:e?.escapeKey??!1,outsidePress:typeof e=="boolean"?e:e?.outsidePress??!0}}function y0(e,t={}){const n="rootStore"in e?e.rootStore:e,r=n.useState("open"),i=n.useState("floatingElement"),{dataRef:s}=n.context,{enabled:a=!0,escapeKey:c=!0,outsidePress:u=!0,outsidePressEvent:f="sloppy",referencePress:m=Rz,referencePressEvent:p="sloppy",bubbles:y,externalTree:x}=t,b=wa(x),S=tt(typeof u=="function"?u:()=>!1),k=typeof u=="function"?S:u,E=k!==!1,T=tt(()=>f),N=w.useRef(!1),j=w.useRef(!1),O=w.useRef(!1),{escapeKey:A,outsidePress:R}=Az(y),L=w.useRef(null),B=Bn(),I=Bn(),U=tt(()=>{I.clear(),s.current.insideReactTree=!1}),Y=w.useRef(!1),V=w.useRef(""),q=tt(m),H=tt(P=>{if(!r||!a||!c||P.key!=="Escape"||Y.current)return;const W=s.current.floatingContext?.nodeId,D=b?ds(b.nodesRef.current,W):[];if(!A&&D.length>0){let J=!0;if(D.forEach(he=>{he.context?.open&&!he.context.dataRef.current.__escapeKeyBubbles&&(J=!1)}),!J)return}const Z=iP(P)?P.nativeEvent:P,ee=Et(m0,Z);n.setOpen(!1,ee),!A&&!ee.isPropagationAllowed&&P.stopPropagation()}),z=tt(()=>{s.current.insideReactTree=!0,I.start(0,U)});w.useEffect(()=>{if(!r||!a)return;s.current.__escapeKeyBubbles=A,s.current.__outsidePressBubbles=R;const P=new lo,W=new lo;function D(){P.clear(),Y.current=!0}function Z(){P.start(d0()?5:0,()=>{Y.current=!1})}function ee(){O.current=!0,W.start(0,()=>{O.current=!1})}function J(){N.current=!1,j.current=!1}function he(){const ne=V.current,ye=ne==="pen"||!ne?"mouse":ne,Ce=T(),Ve=typeof Ce=="function"?Ce():Ce;return typeof Ve=="string"?Ve:Ve[ye]}function fe(ne){const ye=he();return ye==="intentional"&&ne.type!=="click"||ye==="sloppy"&&ne.type==="click"}function Se(ne){const ye=s.current.floatingContext?.nodeId,Ce=b&&ds(b.nodesRef.current,ye).some(Ve=>no(ne,Ve.context?.elements.floating));return no(ne,n.select("floatingElement"))||no(ne,n.select("domReferenceElement"))||Ce}function Ae(ne){if(fe(ne)){U();return}if(s.current.insideReactTree){U();return}const ye=Fr(ne),Ce=`[${tf("inert")}]`;let Ve=Array.from(Zt(n.select("floatingElement")).querySelectorAll(Ce));const lt=cn(ye)?ye.getRootNode():null;Qd(lt)&&(Ve=Ve.concat(Array.from(lt.querySelectorAll(Ce))));const oe=n.context.triggerElements;if(ye&&(oe.hasElement(ye)||oe.hasMatchingElement(He=>Nt(He,ye))))return;let ke=cn(ye)?ye:null;for(;ke&&!ko(ke);){const He=Oo(ke);if(ko(He)||!cn(He))break;ke=He}if(Ve.length&&cn(ye)&&!nP(ye)&&!Nt(ye,n.select("floatingElement"))&&Ve.every(He=>!Nt(ke,He)))return;if(zn(ye)&&!("touches"in ne)){const He=ko(ye),ut=wi(ye),xt=/auto|scroll/,Je=He||xt.test(ut.overflowX),Ke=He||xt.test(ut.overflowY),bt=Je&&ye.clientWidth>0&&ye.scrollWidth>ye.clientWidth,nt=Ke&&ye.clientHeight>0&&ye.scrollHeight>ye.clientHeight,Qe=ut.direction==="rtl",Ct=nt&&(Qe?ne.offsetX<=ye.offsetWidth-ye.clientWidth:ne.offsetX>ye.clientWidth),qe=bt&&ne.offsetY>ye.clientHeight;if(Ct||qe)return}if(Se(ne))return;if(he()==="intentional"&&O.current){W.clear(),O.current=!1;return}if(typeof k=="function"&&!k(ne))return;const Le=s.current.floatingContext?.nodeId,Me=b?ds(b.nodesRef.current,Le):[];if(Me.length>0){let He=!0;if(Me.forEach(ut=>{ut.context?.open&&!ut.context.dataRef.current.__outsidePressBubbles&&(He=!1)}),!He)return}n.setOpen(!1,Et(p0,ne)),U()}function Oe(ne){he()!=="sloppy"||ne.pointerType==="touch"||!n.select("open")||!a||no(ne,n.select("floatingElement"))||no(ne,n.select("domReferenceElement"))||Ae(ne)}function Pe(ne){if(he()!=="sloppy"||!n.select("open")||!a||no(ne,n.select("floatingElement"))||no(ne,n.select("domReferenceElement")))return;const ye=ne.touches[0];ye&&(L.current={startTime:Date.now(),startX:ye.clientX,startY:ye.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},B.start(1e3,()=>{L.current&&(L.current.dismissOnTouchEnd=!1,L.current.dismissOnMouseDown=!1)}))}function _e(ne){V.current="touch";const ye=Fr(ne);function Ce(){Pe(ne),ye?.removeEventListener(ne.type,Ce)}ye?.addEventListener(ne.type,Ce)}function De(ne){if(B.clear(),ne.type==="pointerdown"&&(V.current=ne.pointerType),ne.type==="mousedown"&&L.current&&!L.current.dismissOnMouseDown)return;const ye=Fr(ne);function Ce(){ne.type==="pointerdown"?Oe(ne):Ae(ne),ye?.removeEventListener(ne.type,Ce)}ye?.addEventListener(ne.type,Ce)}function xe(ne){if(!N.current)return;const ye=j.current;if(J(),he()==="intentional"){if(ne.type==="pointercancel"){ye&&ee();return}if(!Se(ne)){if(ye){ee();return}typeof k=="function"&&!k(ne)||(W.clear(),O.current=!0,U())}}}function Ge(ne){if(he()!=="sloppy"||!L.current||no(ne,n.select("floatingElement"))||no(ne,n.select("domReferenceElement")))return;const ye=ne.touches[0];if(!ye)return;const Ce=Math.abs(ye.clientX-L.current.startX),Ve=Math.abs(ye.clientY-L.current.startY),lt=Math.sqrt(Ce*Ce+Ve*Ve);lt>5&&(L.current.dismissOnTouchEnd=!0),lt>10&&(Ae(ne),B.clear(),L.current=null)}function we(ne){const ye=Fr(ne);function Ce(){Ge(ne),ye?.removeEventListener(ne.type,Ce)}ye?.addEventListener(ne.type,Ce)}function Re(ne){he()!=="sloppy"||!L.current||no(ne,n.select("floatingElement"))||no(ne,n.select("domReferenceElement"))||(L.current.dismissOnTouchEnd&&Ae(ne),B.clear(),L.current=null)}function pe(ne){const ye=Fr(ne);function Ce(){Re(ne),ye?.removeEventListener(ne.type,Ce)}ye?.addEventListener(ne.type,Ce)}const be=Zt(i);return c&&(be.addEventListener("keydown",H),be.addEventListener("compositionstart",D),be.addEventListener("compositionend",Z)),E&&(be.addEventListener("click",De,!0),be.addEventListener("pointerdown",De,!0),be.addEventListener("pointerup",xe,!0),be.addEventListener("pointercancel",xe,!0),be.addEventListener("mousedown",De,!0),be.addEventListener("mouseup",xe,!0),be.addEventListener("touchstart",_e,!0),be.addEventListener("touchmove",we,!0),be.addEventListener("touchend",pe,!0)),()=>{c&&(be.removeEventListener("keydown",H),be.removeEventListener("compositionstart",D),be.removeEventListener("compositionend",Z)),E&&(be.removeEventListener("click",De,!0),be.removeEventListener("pointerdown",De,!0),be.removeEventListener("pointerup",xe,!0),be.removeEventListener("pointercancel",xe,!0),be.removeEventListener("mousedown",De,!0),be.removeEventListener("mouseup",xe,!0),be.removeEventListener("touchstart",_e,!0),be.removeEventListener("touchmove",we,!0),be.removeEventListener("touchend",pe,!0)),P.clear(),W.clear(),J(),O.current=!1}},[s,i,c,E,k,r,a,A,R,H,U,T,b,n,B]),w.useEffect(U,[k,U]);const $=w.useMemo(()=>({onKeyDown:H,[Nz[p]]:P=>{q()&&n.setOpen(!1,Et(Hc,P.nativeEvent))},...p!=="intentional"&&{onClick(P){q()&&n.setOpen(!1,Et(Hc,P.nativeEvent))}}}),[H,n,p,q]),G=tt(P=>{if(!r||!a||P.button!==0)return;const W=Fr(P.nativeEvent);Nt(n.select("floatingElement"),W)&&(N.current||(N.current=!0,j.current=!1))}),Q=tt(P=>{!r||!a||(P.defaultPrevented||P.nativeEvent.defaultPrevented)&&N.current&&(j.current=!0)}),_=w.useMemo(()=>({onKeyDown:H,onPointerDown:Q,onMouseDown:Q,onClickCapture:z,onMouseDownCapture(P){z(),G(P)},onPointerDownCapture(P){z(),G(P)},onMouseUpCapture:z,onTouchEndCapture:z,onTouchMoveCapture:z}),[H,z,G,Q]);return w.useMemo(()=>a?{reference:$,floating:_,trigger:$}:{},[a,$,_])}function kk(e,t,n){let{reference:r,floating:i}=e;const s=qi(t),a=xb(t),c=yb(a),u=Jr(t),f=s==="y",m=r.x+r.width/2-i.width/2,p=r.y+r.height/2-i.height/2,y=r[c]/2-i[c]/2;let x;switch(u){case"top":x={x:m,y:r.y-i.height};break;case"bottom":x={x:m,y:r.y+r.height};break;case"right":x={x:r.x+r.width,y:p};break;case"left":x={x:r.x-i.width,y:p};break;default:x={x:r.x,y:r.y}}switch(va(t)){case"start":x[a]-=y*(n&&f?-1:1);break;case"end":x[a]+=y*(n&&f?-1:1);break}return x}async function Oz(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:s,rects:a,elements:c,strategy:u}=e,{boundary:f="clippingAncestors",rootBoundary:m="viewport",elementContext:p="floating",altBoundary:y=!1,padding:x=0}=hs(t,e),b=iN(x),k=c[y?p==="floating"?"reference":"floating":p],E=Jd(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(k)))==null||n?k:k.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(c.floating)),boundary:f,rootBoundary:m,strategy:u})),T=p==="floating"?{x:r,y:i,width:a.floating.width,height:a.floating.height}:a.reference,N=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c.floating)),j=await(s.isElement==null?void 0:s.isElement(N))?await(s.getScale==null?void 0:s.getScale(N))||{x:1,y:1}:{x:1,y:1},O=Jd(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:T,offsetParent:N,strategy:u}):T);return{top:(E.top-O.top+b.top)/j.y,bottom:(O.bottom-E.bottom+b.bottom)/j.y,left:(E.left-O.left+b.left)/j.x,right:(O.right-E.right+b.right)/j.x}}const jz=50,Mz=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:s=[],platform:a}=n,c=a.detectOverflow?a:{...a,detectOverflow:Oz},u=await(a.isRTL==null?void 0:a.isRTL(t));let f=await a.getElementRects({reference:e,floating:t,strategy:i}),{x:m,y:p}=kk(f,r,u),y=r,x=0;const b={};for(let S=0;S<s.length;S++){const k=s[S];if(!k)continue;const{name:E,fn:T}=k,{x:N,y:j,data:O,reset:A}=await T({x:m,y:p,initialPlacement:r,placement:y,strategy:i,middlewareData:b,rects:f,platform:c,elements:{reference:e,floating:t}});m=N??m,p=j??p,b[E]={...b[E],...O},A&&x<jz&&(x++,typeof A=="object"&&(A.placement&&(y=A.placement),A.rects&&(f=A.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:i}):A.rects),{x:m,y:p}=kk(f,y,u)),S=-1)}return{x:m,y:p,placement:y,strategy:i,middlewareData:b}},Dz=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:i,middlewareData:s,rects:a,initialPlacement:c,platform:u,elements:f}=t,{mainAxis:m=!0,crossAxis:p=!0,fallbackPlacements:y,fallbackStrategy:x="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:S=!0,...k}=hs(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const E=Jr(i),T=qi(c),N=Jr(c)===c,j=await(u.isRTL==null?void 0:u.isRTL(f.floating)),O=y||(N||!S?[xm(c)]:lP(c)),A=b!=="none";!y&&A&&O.push(...fP(c,S,b,j));const R=[c,...O],L=await u.detectOverflow(t,k),B=[];let I=((r=s.flip)==null?void 0:r.overflows)||[];if(m&&B.push(L[E]),p){const q=aP(i,a,j);B.push(L[q[0]],L[q[1]])}if(I=[...I,{placement:i,overflows:B}],!B.every(q=>q<=0)){var U,Y;const q=(((U=s.flip)==null?void 0:U.index)||0)+1,H=R[q];if(H&&(!(p==="alignment"?T!==qi(H):!1)||I.every(G=>qi(G.placement)===T?G.overflows[0]>0:!0)))return{data:{index:q,overflows:I},reset:{placement:H}};let z=(Y=I.filter($=>$.overflows[0]<=0).sort(($,G)=>$.overflows[1]-G.overflows[1])[0])==null?void 0:Y.placement;if(!z)switch(x){case"bestFit":{var V;const $=(V=I.filter(G=>{if(A){const Q=qi(G.placement);return Q===T||Q==="y"}return!0}).map(G=>[G.placement,G.overflows.filter(Q=>Q>0).reduce((Q,_)=>Q+_,0)]).sort((G,Q)=>G[1]-Q[1])[0])==null?void 0:V[0];$&&(z=$);break}case"initialPlacement":z=c;break}if(i!==z)return{reset:{placement:z}}}return{}}}};function Ek(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Tk(e){return oP.some(t=>e[t]>=0)}const _z=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:i="referenceHidden",...s}=hs(e,t);switch(i){case"referenceHidden":{const a=await r.detectOverflow(t,{...s,elementContext:"reference"}),c=Ek(a,n.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:Tk(c)}}}case"escaped":{const a=await r.detectOverflow(t,{...s,altBoundary:!0}),c=Ek(a,n.floating);return{data:{escapedOffsets:c,escaped:Tk(c)}}}default:return{}}}}},_N=new Set(["left","top"]);async function Lz(e,t){const{placement:n,platform:r,elements:i}=e,s=await(r.isRTL==null?void 0:r.isRTL(i.floating)),a=Jr(n),c=va(n),u=qi(n)==="y",f=_N.has(a)?-1:1,m=s&&u?-1:1,p=hs(t,e);let{mainAxis:y,crossAxis:x,alignmentAxis:b}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return c&&typeof b=="number"&&(x=c==="end"?b*-1:b),u?{x:x*m,y:y*f}:{x:y*f,y:x*m}}const Iz=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:s,placement:a,middlewareData:c}=t,u=await Lz(t,e);return a===((n=c.offset)==null?void 0:n.placement)&&(r=c.arrow)!=null&&r.alignmentOffset?{}:{x:i+u.x,y:s+u.y,data:{...u,placement:a}}}}},Pz=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i,platform:s}=t,{mainAxis:a=!0,crossAxis:c=!1,limiter:u={fn:E=>{let{x:T,y:N}=E;return{x:T,y:N}}},...f}=hs(e,t),m={x:n,y:r},p=await s.detectOverflow(t,f),y=qi(Jr(i)),x=gb(y);let b=m[x],S=m[y];if(a){const E=x==="y"?"top":"left",T=x==="y"?"bottom":"right",N=b+p[E],j=b-p[T];b=By(N,b,j)}if(c){const E=y==="y"?"top":"left",T=y==="y"?"bottom":"right",N=S+p[E],j=S-p[T];S=By(N,S,j)}const k=u.fn({...t,[x]:b,[y]:S});return{...k,data:{x:k.x-n,y:k.y-r,enabled:{[x]:a,[y]:c}}}}}},zz=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:i,rects:s,middlewareData:a}=t,{offset:c=0,mainAxis:u=!0,crossAxis:f=!0}=hs(e,t),m={x:n,y:r},p=qi(i),y=gb(p);let x=m[y],b=m[p];const S=hs(c,t),k=typeof S=="number"?{mainAxis:S,crossAxis:0}:{mainAxis:0,crossAxis:0,...S};if(u){const N=y==="y"?"height":"width",j=s.reference[y]-s.floating[N]+k.mainAxis,O=s.reference[y]+s.reference[N]-k.mainAxis;x<j?x=j:x>O&&(x=O)}if(f){var E,T;const N=y==="y"?"width":"height",j=_N.has(Jr(i)),O=s.reference[p]-s.floating[N]+(j&&((E=a.offset)==null?void 0:E[p])||0)+(j?0:k.crossAxis),A=s.reference[p]+s.reference[N]+(j?0:((T=a.offset)==null?void 0:T[p])||0)-(j?k.crossAxis:0);b<O?b=O:b>A&&(b=A)}return{[y]:x,[p]:b}}}},Fz=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:i,rects:s,platform:a,elements:c}=t,{apply:u=()=>{},...f}=hs(e,t),m=await a.detectOverflow(t,f),p=Jr(i),y=va(i),x=qi(i)==="y",{width:b,height:S}=s.floating;let k,E;p==="top"||p==="bottom"?(k=p,E=y===(await(a.isRTL==null?void 0:a.isRTL(c.floating))?"start":"end")?"left":"right"):(E=p,k=y==="end"?"top":"bottom");const T=S-m.top-m.bottom,N=b-m.left-m.right,j=Fc(S-m[k],T),O=Fc(b-m[E],N),A=!t.middlewareData.shift;let R=j,L=O;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(L=N),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(R=T),A&&!y){const I=gi(m.left,0),U=gi(m.right,0),Y=gi(m.top,0),V=gi(m.bottom,0);x?L=b-2*(I!==0||U!==0?I+U:gi(m.left,m.right)):R=S-2*(Y!==0||V!==0?Y+V:gi(m.top,m.bottom))}await u({...t,availableWidth:L,availableHeight:R});const B=await a.getDimensions(c.floating);return b!==B.width||S!==B.height?{reset:{rects:!0}}:{}}}};function LN(e){const t=wi(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=zn(e),s=i?e.offsetWidth:n,a=i?e.offsetHeight:r,c=ym(n)!==s||ym(r)!==a;return c&&(n=s,r=a),{width:n,height:r,$:c}}function Ab(e){return cn(e)?e:e.contextElement}function jc(e){const t=Ab(e);if(!zn(t))return Eo(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:s}=LN(t);let a=(s?ym(n.width):n.width)/r,c=(s?ym(n.height):n.height)/i;return(!a||!Number.isFinite(a))&&(a=1),(!c||!Number.isFinite(c))&&(c=1),{x:a,y:c}}const Bz=Eo(0);function IN(e){const t=Un(e);return!d0()||!t.visualViewport?Bz:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Hz(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Un(e)?!1:t}function hl(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),s=Ab(e);let a=Eo(1);t&&(r?cn(r)&&(a=jc(r)):a=jc(e));const c=Hz(s,n,r)?IN(s):Eo(0);let u=(i.left+c.x)/a.x,f=(i.top+c.y)/a.y,m=i.width/a.x,p=i.height/a.y;if(s){const y=Un(s),x=r&&cn(r)?Un(r):r;let b=y,S=Iy(b);for(;S&&r&&x!==b;){const k=jc(S),E=S.getBoundingClientRect(),T=wi(S),N=E.left+(S.clientLeft+parseFloat(T.paddingLeft))*k.x,j=E.top+(S.clientTop+parseFloat(T.paddingTop))*k.y;u*=k.x,f*=k.y,m*=k.x,p*=k.y,u+=N,f+=j,b=Un(S),S=Iy(b)}}return Jd({width:m,height:p,x:u,y:f})}function x0(e,t){const n=f0(e).scrollLeft;return t?t.left+n:hl(Do(e)).left+n}function PN(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-x0(e,n),i=n.top+t.scrollTop;return{x:r,y:i}}function Uz(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const s=i==="fixed",a=Do(r),c=t?u0(t.floating):!1;if(r===a||c&&s)return n;let u={scrollLeft:0,scrollTop:0},f=Eo(1);const m=Eo(0),p=zn(r);if((p||!p&&!s)&&((xa(r)!=="body"||ba(a))&&(u=f0(r)),p)){const x=hl(r);f=jc(r),m.x=x.x+r.clientLeft,m.y=x.y+r.clientTop}const y=a&&!p&&!s?PN(a,u):Eo(0);return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-u.scrollLeft*f.x+m.x+y.x,y:n.y*f.y-u.scrollTop*f.y+m.y+y.y}}function Vz(e){return Array.from(e.getClientRects())}function qz(e){const t=Do(e),n=f0(e),r=e.ownerDocument.body,i=gi(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=gi(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+x0(e);const c=-n.scrollTop;return wi(r).direction==="rtl"&&(a+=gi(t.clientWidth,r.clientWidth)-i),{width:i,height:s,x:a,y:c}}const Nk=25;function $z(e,t){const n=Un(e),r=Do(e),i=n.visualViewport;let s=r.clientWidth,a=r.clientHeight,c=0,u=0;if(i){s=i.width,a=i.height;const m=d0();(!m||m&&t==="fixed")&&(c=i.offsetLeft,u=i.offsetTop)}const f=x0(r);if(f<=0){const m=r.ownerDocument,p=m.body,y=getComputedStyle(p),x=m.compatMode==="CSS1Compat"&&parseFloat(y.marginLeft)+parseFloat(y.marginRight)||0,b=Math.abs(r.clientWidth-p.clientWidth-x);b<=Nk&&(s-=b)}else f<=Nk&&(s+=f);return{width:s,height:a,x:c,y:u}}function Yz(e,t){const n=hl(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,s=zn(e)?jc(e):Eo(1),a=e.clientWidth*s.x,c=e.clientHeight*s.y,u=i*s.x,f=r*s.y;return{width:a,height:c,x:u,y:f}}function Rk(e,t,n){let r;if(t==="viewport")r=$z(e,n);else if(t==="document")r=qz(Do(e));else if(cn(t))r=Yz(t,n);else{const i=IN(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return Jd(r)}function zN(e,t){const n=Oo(e);return n===t||!cn(n)||ko(n)?!1:wi(n).position==="fixed"||zN(n,t)}function Wz(e,t){const n=t.get(e);if(n)return n;let r=Xd(e,[],!1).filter(c=>cn(c)&&xa(c)!=="body"),i=null;const s=wi(e).position==="fixed";let a=s?Oo(e):e;for(;cn(a)&&!ko(a);){const c=wi(a),u=hb(a);!u&&c.position==="fixed"&&(i=null),(s?!u&&!i:!u&&c.position==="static"&&!!i&&(i.position==="absolute"||i.position==="fixed")||ba(a)&&!u&&zN(e,a))?r=r.filter(m=>m!==a):i=c,a=Oo(a)}return t.set(e,r),r}function Gz(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const a=[...n==="clippingAncestors"?u0(t)?[]:Wz(t,this._c):[].concat(n),r],c=Rk(t,a[0],i);let u=c.top,f=c.right,m=c.bottom,p=c.left;for(let y=1;y<a.length;y++){const x=Rk(t,a[y],i);u=gi(x.top,u),f=Fc(x.right,f),m=Fc(x.bottom,m),p=gi(x.left,p)}return{width:f-p,height:m-u,x:p,y:u}}function Kz(e){const{width:t,height:n}=LN(e);return{width:t,height:n}}function Qz(e,t,n){const r=zn(t),i=Do(t),s=n==="fixed",a=hl(e,!0,s,t);let c={scrollLeft:0,scrollTop:0};const u=Eo(0);function f(){u.x=x0(i)}if(r||!r&&!s)if((xa(t)!=="body"||ba(i))&&(c=f0(t)),r){const x=hl(t,!0,s,t);u.x=x.x+t.clientLeft,u.y=x.y+t.clientTop}else i&&f();s&&!r&&i&&f();const m=i&&!r&&!s?PN(i,c):Eo(0),p=a.left+c.scrollLeft-u.x-m.x,y=a.top+c.scrollTop-u.y-m.y;return{x:p,y,width:a.width,height:a.height}}function T2(e){return wi(e).position==="static"}function Ak(e,t){if(!zn(e)||wi(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Do(e)===n&&(n=n.ownerDocument.body),n}function FN(e,t){const n=Un(e);if(u0(e))return n;if(!zn(e)){let i=Oo(e);for(;i&&!ko(i);){if(cn(i)&&!T2(i))return i;i=Oo(i)}return n}let r=Ak(e,t);for(;r&&KI(r)&&T2(r);)r=Ak(r,t);return r&&ko(r)&&T2(r)&&!hb(r)?n:r||ZI(e)||n}const Xz=async function(e){const t=this.getOffsetParent||FN,n=this.getDimensions,r=await n(e.floating);return{reference:Qz(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Zz(e){return wi(e).direction==="rtl"}const BN={convertOffsetParentRelativeRectToViewportRelativeRect:Uz,getDocumentElement:Do,getClippingRect:Gz,getOffsetParent:FN,getElementRects:Xz,getClientRects:Vz,getDimensions:Kz,getScale:jc,isElement:cn,isRTL:Zz};function HN(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Jz(e,t){let n=null,r;const i=Do(e);function s(){var c;clearTimeout(r),(c=n)==null||c.disconnect(),n=null}function a(c,u){c===void 0&&(c=!1),u===void 0&&(u=1),s();const f=e.getBoundingClientRect(),{left:m,top:p,width:y,height:x}=f;if(c||t(),!y||!x)return;const b=il(p),S=il(i.clientWidth-(m+y)),k=il(i.clientHeight-(p+x)),E=il(m),N={rootMargin:-b+"px "+-S+"px "+-k+"px "+-E+"px",threshold:gi(0,Fc(1,u))||1};let j=!0;function O(A){const R=A[0].intersectionRatio;if(R!==u){if(!j)return a();R?a(!1,R):r=setTimeout(()=>{a(!1,1e-7)},1e3)}R===1&&!HN(f,e.getBoundingClientRect())&&a(),j=!1}try{n=new IntersectionObserver(O,{...N,root:i.ownerDocument})}catch{n=new IntersectionObserver(O,N)}n.observe(e)}return a(!0),s}function Ok(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:u=!1}=r,f=Ab(e),m=i||s?[...f?Xd(f):[],...t?Xd(t):[]]:[];m.forEach(E=>{i&&E.addEventListener("scroll",n,{passive:!0}),s&&E.addEventListener("resize",n)});const p=f&&c?Jz(f,n):null;let y=-1,x=null;a&&(x=new ResizeObserver(E=>{let[T]=E;T&&T.target===f&&x&&t&&(x.unobserve(t),cancelAnimationFrame(y),y=requestAnimationFrame(()=>{var N;(N=x)==null||N.observe(t)})),n()}),f&&!u&&x.observe(f),t&&x.observe(t));let b,S=u?hl(e):null;u&&k();function k(){const E=hl(e);S&&!HN(S,E)&&n(),S=E,b=requestAnimationFrame(k)}return n(),()=>{var E;m.forEach(T=>{i&&T.removeEventListener("scroll",n),s&&T.removeEventListener("resize",n)}),p?.(),(E=x)==null||E.disconnect(),x=null,u&&cancelAnimationFrame(b)}}const eF=Iz,tF=Pz,nF=Dz,rF=Fz,iF=_z,oF=zz,sF=(e,t,n)=>{const r=new Map,i={platform:BN,...n},s={...i.platform,_c:r};return Mz(e,t,{...i,platform:s})};var aF=typeof document<"u",lF=function(){},em=aF?w.useLayoutEffect:lF;function km(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!km(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const s=i[r];if(!(s==="_owner"&&e.$$typeof)&&!km(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function UN(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function jk(e,t){const n=UN(e);return Math.round(t*n)/n}function N2(e){const t=w.useRef(e);return em(()=>{t.current=e}),t}function cF(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:s,floating:a}={},transform:c=!0,whileElementsMounted:u,open:f}=e,[m,p]=w.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[y,x]=w.useState(r);km(y,r)||x(r);const[b,S]=w.useState(null),[k,E]=w.useState(null),T=w.useCallback(G=>{G!==A.current&&(A.current=G,S(G))},[]),N=w.useCallback(G=>{G!==R.current&&(R.current=G,E(G))},[]),j=s||b,O=a||k,A=w.useRef(null),R=w.useRef(null),L=w.useRef(m),B=u!=null,I=N2(u),U=N2(i),Y=N2(f),V=w.useCallback(()=>{if(!A.current||!R.current)return;const G={placement:t,strategy:n,middleware:y};U.current&&(G.platform=U.current),sF(A.current,R.current,G).then(Q=>{const _={...Q,isPositioned:Y.current!==!1};q.current&&!km(L.current,_)&&(L.current=_,vi.flushSync(()=>{p(_)}))})},[y,t,n,U,Y]);em(()=>{f===!1&&L.current.isPositioned&&(L.current.isPositioned=!1,p(G=>({...G,isPositioned:!1})))},[f]);const q=w.useRef(!1);em(()=>(q.current=!0,()=>{q.current=!1}),[]),em(()=>{if(j&&(A.current=j),O&&(R.current=O),j&&O){if(I.current)return I.current(j,O,V);V()}},[j,O,V,I,B]);const H=w.useMemo(()=>({reference:A,floating:R,setReference:T,setFloating:N}),[T,N]),z=w.useMemo(()=>({reference:j,floating:O}),[j,O]),$=w.useMemo(()=>{const G={position:n,left:0,top:0};if(!z.floating)return G;const Q=jk(z.floating,m.x),_=jk(z.floating,m.y);return c?{...G,transform:"translate("+Q+"px, "+_+"px)",...UN(z.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:Q,top:_}},[n,c,z.floating,m.x,m.y]);return w.useMemo(()=>({...m,update:V,refs:H,elements:z,floatingStyles:$}),[m,V,H,z,$])}const uF=(e,t)=>{const n=eF(e);return{name:n.name,fn:n.fn,options:[e,t]}},dF=(e,t)=>{const n=tF(e);return{name:n.name,fn:n.fn,options:[e,t]}},fF=(e,t)=>({fn:oF(e).fn,options:[e,t]}),hF=(e,t)=>{const n=nF(e);return{name:n.name,fn:n.fn,options:[e,t]}},pF=(e,t)=>{const n=rF(e);return{name:n.name,fn:n.fn,options:[e,t]}},mF=(e,t)=>{const n=iF(e);return{name:n.name,fn:n.fn,options:[e,t]}};var Em=Symbol("NOT_FOUND");function gF(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function yF(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function xF(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(n=>typeof n=="function")){const n=e.map(r=>typeof r=="function"?`function ${r.name||"unnamed"}()`:typeof r).join(", ");throw new TypeError(`${t}[${n}]`)}}var Mk=e=>Array.isArray(e)?e:[e];function bF(e){const t=Array.isArray(e[0])?e[0]:e;return xF(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function vF(e,t){const n=[],{length:r}=e;for(let i=0;i<r;i++)n.push(e[i].apply(null,t));return n}function wF(e){let t;return{get(n){return t&&e(t.key,n)?t.value:Em},put(n,r){t={key:n,value:r}},getEntries(){return t?[t]:[]},clear(){t=void 0}}}function SF(e,t){let n=[];function r(c){const u=n.findIndex(f=>t(c,f.key));if(u>-1){const f=n[u];return u>0&&(n.splice(u,1),n.unshift(f)),f.value}return Em}function i(c,u){r(c)===Em&&(n.unshift({key:c,value:u}),n.length>e&&n.pop())}function s(){return n}function a(){n=[]}return{get:r,put:i,getEntries:s,clear:a}}var CF=(e,t)=>e===t;function kF(e){return function(n,r){if(n===null||r===null||n.length!==r.length)return!1;const{length:i}=n;for(let s=0;s<i;s++)if(!e(n[s],r[s]))return!1;return!0}}function EF(e,t){const n=typeof t=="object"?t:{equalityCheck:t},{equalityCheck:r=CF,maxSize:i=1,resultEqualityCheck:s}=n,a=kF(r);let c=0;const u=i<=1?wF(a):SF(i,a);function f(){let m=u.get(arguments);if(m===Em){if(m=e.apply(null,arguments),c++,s){const y=u.getEntries().find(x=>s(x.value,m));y&&(m=y.value,c!==0&&c--)}u.put(arguments,m)}return m}return f.clearCache=()=>{u.clear(),f.resetResultsCount()},f.resultsCount=()=>c,f.resetResultsCount=()=>{c=0},f}var TF=class{constructor(e){this.value=e}deref(){return this.value}},NF=typeof WeakRef<"u"?WeakRef:TF,RF=0,Dk=1;function xp(){return{s:RF,v:void 0,o:null,p:null}}function VN(e,t={}){let n=xp();const{resultEqualityCheck:r}=t;let i,s=0;function a(){let c=n;const{length:u}=arguments;for(let p=0,y=u;p<y;p++){const x=arguments[p];if(typeof x=="function"||typeof x=="object"&&x!==null){let b=c.o;b===null&&(c.o=b=new WeakMap);const S=b.get(x);S===void 0?(c=xp(),b.set(x,c)):c=S}else{let b=c.p;b===null&&(c.p=b=new Map);const S=b.get(x);S===void 0?(c=xp(),b.set(x,c)):c=S}}const f=c;let m;if(c.s===Dk)m=c.v;else if(m=e.apply(null,arguments),s++,r){const p=i?.deref?.()??i;p!=null&&r(p,m)&&(m=p,s!==0&&s--),i=typeof m=="object"&&m!==null||typeof m=="function"?new NF(m):m}return f.s=Dk,f.v=m,m}return a.clearCache=()=>{n=xp(),a.resetResultsCount()},a.resultsCount=()=>s,a.resetResultsCount=()=>{s=0},a}function qN(e,...t){const n=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,r=(...i)=>{let s=0,a=0,c,u={},f=i.pop();typeof f=="object"&&(u=f,f=i.pop()),gF(f,`createSelector expects an output function after the inputs, but received: [${typeof f}]`);const m={...n,...u},{memoize:p,memoizeOptions:y=[],argsMemoize:x=VN,argsMemoizeOptions:b=[]}=m,S=Mk(y),k=Mk(b),E=bF(i),T=p(function(){return s++,f.apply(null,arguments)},...S),N=x(function(){a++;const O=vF(E,arguments);return c=T.apply(null,O),c},...k);return Object.assign(N,{resultFunc:f,memoizedResultFunc:T,dependencies:E,dependencyRecomputations:()=>a,resetDependencyRecomputations:()=>{a=0},lastResult:()=>c,recomputations:()=>s,resetRecomputations:()=>{s=0},memoize:p,argsMemoize:x})};return Object.assign(r,{withTypes:()=>r}),r}var AF=qN(VN),OF=Object.assign((e,t=AF)=>{yF(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);const n=Object.keys(e),r=n.map(s=>e[s]);return t(r,(...s)=>s.reduce((a,c,u)=>(a[n[u]]=c,a),{}))},{withTypes:()=>OF});qN({memoize:EF,memoizeOptions:{maxSize:1,equalityCheck:Object.is}});const Ue=(e,t,n,r,i,s,...a)=>{if(a.length>0)throw new Error(Cn(1));let c;if(e)c=e;else throw new Error("Missing arguments");return c};var R2={exports:{}},A2={};var _k;function jF(){if(_k)return A2;_k=1;var e=xf();function t(p,y){return p===y&&(p!==0||1/p===1/y)||p!==p&&y!==y}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,i=e.useEffect,s=e.useLayoutEffect,a=e.useDebugValue;function c(p,y){var x=y(),b=r({inst:{value:x,getSnapshot:y}}),S=b[0].inst,k=b[1];return s(function(){S.value=x,S.getSnapshot=y,u(S)&&k({inst:S})},[p,x,y]),i(function(){return u(S)&&k({inst:S}),p(function(){u(S)&&k({inst:S})})},[p]),a(x),x}function u(p){var y=p.getSnapshot;p=p.value;try{var x=y();return!n(p,x)}catch{return!0}}function f(p,y){return y()}var m=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?f:c;return A2.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:m,A2}var Lk;function $N(){return Lk||(Lk=1,R2.exports=jF()),R2.exports}var YN=$N(),O2={exports:{}},j2={};var Ik;function MF(){if(Ik)return j2;Ik=1;var e=xf(),t=$N();function n(f,m){return f===m&&(f!==0||1/f===1/m)||f!==f&&m!==m}var r=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,s=e.useRef,a=e.useEffect,c=e.useMemo,u=e.useDebugValue;return j2.useSyncExternalStoreWithSelector=function(f,m,p,y,x){var b=s(null);if(b.current===null){var S={hasValue:!1,value:null};b.current=S}else S=b.current;b=c(function(){function E(A){if(!T){if(T=!0,N=A,A=y(A),x!==void 0&&S.hasValue){var R=S.value;if(x(R,A))return j=R}return j=A}if(R=j,r(N,A))return R;var L=y(A);return x!==void 0&&x(R,L)?(N=A,R):(N=A,j=L)}var T=!1,N,j,O=p===void 0?null:p;return[function(){return E(m())},O===null?void 0:function(){return E(O())}]},[m,p,y,x]);var k=i(f,b[0],b[1]);return a(function(){S.hasValue=!0,S.value=k},[k]),u(k),k},j2}var Pk;function DF(){return Pk||(Pk=1,O2.exports=MF()),O2.exports}var _F=DF();const LF=Cb(19),IF=LF?zF:FF;function kt(e,t,n,r,i){return IF(e,t,n,r,i)}function PF(e,t,n,r,i){const s=w.useCallback(()=>t(e.getSnapshot(),n,r,i),[e,t,n,r,i]);return YN.useSyncExternalStore(e.subscribe,s,s)}qI({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let n=0;n<e.syncHooks.length;n+=1){const r=e.syncHooks[n],i=r.selector(r.store.state,r.a1,r.a2,r.a3);(r.didChange||!Object.is(r.value,i))&&(t=!0,r.value=i,r.didChange=!1)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{const n=new Set;for(const i of e.syncHooks)n.add(i.store);const r=[];for(const i of n)r.push(i.subscribe(t));return()=>{for(const i of r)i()}}),YN.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot))}});function zF(e,t,n,r,i){const s=VI();if(!s)return PF(e,t,n,r,i);const a=s.syncIndex;s.syncIndex+=1;let c;return s.didInitialize?(c=s.syncHooks[a],(c.store!==e||c.selector!==t||!Object.is(c.a1,n)||!Object.is(c.a2,r)||!Object.is(c.a3,i))&&(c.store!==e&&(s.didChangeStore=!0),c.store=e,c.selector=t,c.a1=n,c.a2=r,c.a3=i,c.didChange=!0)):(c={store:e,selector:t,a1:n,a2:r,a3:i,value:t(e.getSnapshot(),n,r,i),didChange:!1},s.syncHooks.push(c)),c.value}function FF(e,t,n,r,i){return _F.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,s=>t(s,n,r,i))}class WN{constructor(t){this.state=t,this.listeners=new Set,this.updateTick=0}subscribe=t=>(this.listeners.add(t),()=>{this.listeners.delete(t)});getSnapshot=()=>this.state;setState(t){if(this.state===t)return;this.state=t,this.updateTick+=1;const n=this.updateTick;for(const r of this.listeners){if(n!==this.updateTick)return;r(t)}}update(t){for(const n in t)if(!Object.is(this.state[n],t[n])){this.setState({...this.state,...t});return}}set(t,n){Object.is(this.state[t],n)||this.setState({...this.state,[t]:n})}notifyAll(){const t={...this.state};this.setState(t)}use(t,n,r,i){return kt(this,t,n,r,i)}}class b0 extends WN{constructor(t,n={},r){super(t),this.context=n,this.selectors=r}useSyncedValue(t,n){w.useDebugValue(t),We(()=>{this.state[t]!==n&&this.set(t,n)},[t,n])}useSyncedValueWithCleanup(t,n){const r=this;We(()=>(r.state[t]!==n&&r.set(t,n),()=>{r.set(t,void 0)}),[r,t,n])}useSyncedValues(t){const n=this,r=Object.values(t);We(()=>{n.update(t)},[n,...r])}useControlledProp(t,n){w.useDebugValue(t);const r=n!==void 0;We(()=>{r&&!Object.is(this.state[t],n)&&super.setState({...this.state,[t]:n})},[t,n,r])}select(t,n,r,i){const s=this.selectors[t];return s(this.state,n,r,i)}useState(t,n,r,i){return w.useDebugValue(t),kt(this,this.selectors[t],n,r,i)}useContextCallback(t,n){w.useDebugValue(t);const r=tt(n??Cr);this.context[t]=r}useStateSetter(t){const n=w.useRef(void 0);return n.current===void 0&&(n.current=r=>{this.set(t,r)}),n.current}observe(t,n){let r;typeof t=="function"?r=t:r=this.selectors[t];let i=r(this.state);return n(i,i,this),this.subscribe(s=>{const a=r(s);if(!Object.is(i,a)){const c=i;i=a,n(a,c,this)}})}}const BF={open:Ue(e=>e.open),domReferenceElement:Ue(e=>e.domReferenceElement),referenceElement:Ue(e=>e.positionReference??e.referenceElement),floatingElement:Ue(e=>e.floatingElement),floatingId:Ue(e=>e.floatingId)};class Ob extends b0{constructor(t){const{nested:n,noEmit:r,onOpenChange:i,triggerElements:s,...a}=t;super({...a,positionReference:a.referenceElement,domReferenceElement:a.referenceElement},{onOpenChange:i,dataRef:{current:{}},events:ON(),nested:n,noEmit:r,triggerElements:s},BF)}setOpen=(t,n)=>{if((!t||!this.state.open||rN(n.event))&&(this.context.dataRef.current.openEvent=t?n.event:void 0),!this.context.noEmit){const r={open:t,reason:n.reason,nativeEvent:n.event,nested:this.context.nested,triggerElement:n.trigger};this.context.events.emit("openchange",r)}this.context.onOpenChange?.(t,n)}}function Sa(e,t=!1,n=!1){const[r,i]=w.useState(e&&t?"idle":void 0),[s,a]=w.useState(e);return e&&!s&&(a(!0),i("starting")),!e&&s&&r!=="ending"&&!n&&i("ending"),!e&&!s&&r==="ending"&&i(void 0),We(()=>{if(!e&&s&&r!=="ending"&&n){const c=vo.request(()=>{i("ending")});return()=>{vo.cancel(c)}}},[e,s,r,n]),We(()=>{if(!e||t)return;const c=vo.request(()=>{i(void 0)});return()=>{vo.cancel(c)}},[t,e]),We(()=>{if(!e||!t)return;e&&s&&r!=="idle"&&i("starting");const c=vo.request(()=>{i("idle")});return()=>{vo.cancel(c)}},[t,e,s,i,r]),w.useMemo(()=>({mounted:s,setMounted:a,transitionStatus:r}),[s,r])}let nf=(function(e){return e.startingStyle="data-starting-style",e.endingStyle="data-ending-style",e})({});const HF={[nf.startingStyle]:""},UF={[nf.endingStyle]:""},ws={transitionStatus(e){return e==="starting"?HF:e==="ending"?UF:null}};function GN(e,t=!1,n=!0){const r=g0();return tt((i,s=null)=>{r.cancel();function a(){vi.flushSync(i)}const c=ss(e);if(c==null)return;const u=c;if(typeof u.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED)i();else{let p=function(){const x=nf.startingStyle;if(!u.hasAttribute(x)){r.request(y);return}const b=new MutationObserver(()=>{u.hasAttribute(x)||(b.disconnect(),y())});b.observe(u,{attributes:!0,attributeFilter:[x]}),s?.addEventListener("abort",()=>b.disconnect(),{once:!0})},y=function(){Promise.all(u.getAnimations().map(x=>x.finished)).then(()=>{s?.aborted||a()}).catch(()=>{const x=u.getAnimations();if(n){if(s?.aborted)return;a()}else x.length>0&&x.some(b=>b.pending||b.playState!=="finished")&&y()})};var f=p,m=y;if(t){p();return}r.request(y)}})}function Ki(e){const{enabled:t=!0,open:n,ref:r,onComplete:i}=e,s=tt(i),a=GN(r,n,!1);w.useEffect(()=>{if(!t)return;const c=new AbortController;return a(s,c.signal),()=>{c.abort()}},[t,n,s,a])}function KN(e,t){const n=w.useRef(null),r=w.useRef(null);return w.useCallback(i=>{if(e!==void 0){if(n.current!==null){const s=n.current,a=r.current,c=t.context.triggerElements.getById(s);a&&c===a&&t.context.triggerElements.delete(s),n.current=null,r.current=null}i!==null&&(n.current=e,r.current=i,t.context.triggerElements.add(e,i))}},[t,e])}function QN(e,t,n,r){const i=n.useState("isMountedByTrigger",e),s=KN(e,n),a=tt(c=>{if(s(c),!c||!n.select("open"))return;const u=n.select("activeTriggerId");if(u===e){n.update({activeTriggerElement:c,...r});return}u==null&&n.update({activeTriggerId:e,activeTriggerElement:c,...r})});return We(()=>{i&&n.update({activeTriggerElement:t.current,...r})},[i,n,t,...Object.values(r)]),{registerTrigger:a,isMountedByThisTrigger:i}}function jb(e){const t=e.useState("open");We(()=>{if(t&&!e.select("activeTriggerId")&&e.context.triggerElements.size===1){const n=e.context.triggerElements.entries().next();if(!n.done){const[r,i]=n.value;e.update({activeTriggerId:r,activeTriggerElement:i})}}},[t,e])}function Mb(e,t,n){const{mounted:r,setMounted:i,transitionStatus:s}=Sa(e);t.useSyncedValues({mounted:r,transitionStatus:s});const a=tt(()=>{i(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)}),c=t.useState("preventUnmountingOnClose");return Ki({enabled:!c,open:e,ref:t.context.popupRef,onComplete(){e||a()}}),{forceUnmount:a,transitionStatus:s}}class Nf{constructor(){this.elementsSet=new Set,this.idMap=new Map}add(t,n){const r=this.idMap.get(t);r!==n&&(r!==void 0&&this.elementsSet.delete(r),this.elementsSet.add(n),this.idMap.set(t,n))}delete(t){const n=this.idMap.get(t);n&&(this.elementsSet.delete(n),this.idMap.delete(t))}hasElement(t){return this.elementsSet.has(t)}hasMatchingElement(t){for(const n of this.elementsSet)if(t(n))return!0;return!1}getById(t){return this.idMap.get(t)}entries(){return this.idMap.entries()}elements(){return this.elementsSet.values()}get size(){return this.idMap.size}}function VF(){return new Ob({open:!1,floatingElement:null,referenceElement:null,triggerElements:new Nf,floatingId:"",nested:!1,noEmit:!1,onOpenChange:void 0})}function Db(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:"idle",floatingRootContext:VF(),preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:Fn,inactiveTriggerProps:Fn,popupProps:Fn}}const bp=Ue(e=>e.triggerIdProp??e.activeTriggerId),_b={open:Ue(e=>e.openProp??e.open),mounted:Ue(e=>e.mounted),transitionStatus:Ue(e=>e.transitionStatus),floatingRootContext:Ue(e=>e.floatingRootContext),preventUnmountingOnClose:Ue(e=>e.preventUnmountingOnClose),payload:Ue(e=>e.payload),activeTriggerId:bp,activeTriggerElement:Ue(e=>e.mounted?e.activeTriggerElement:null),isTriggerActive:Ue((e,t)=>t!==void 0&&bp(e)===t),isOpenedByTrigger:Ue((e,t)=>t!==void 0&&bp(e)===t&&e.open),isMountedByTrigger:Ue((e,t)=>t!==void 0&&bp(e)===t&&e.mounted),triggerProps:Ue((e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps),popupProps:Ue(e=>e.popupProps),popupElement:Ue(e=>e.popupElement),positionerElement:Ue(e=>e.positionerElement)};function XN(e){const{open:t=!1,onOpenChange:n,elements:r={}}=e,i=Sl(),s=vs()!=null,a=ir(()=>new Ob({open:t,onOpenChange:n,referenceElement:r.reference??null,floatingElement:r.floating??null,triggerElements:new Nf,floatingId:i,nested:s,noEmit:!1})).current;return We(()=>{const c={open:t,floatingId:i};r.reference!==void 0&&(c.referenceElement=r.reference,c.domReferenceElement=cn(r.reference)?r.reference:null),r.floating!==void 0&&(c.floatingElement=r.floating),a.update(c)},[t,i,r.reference,r.floating,a]),a.context.onOpenChange=n,a.context.nested=s,a.context.noEmit=!1,a}function qF(e={}){const{nodeId:t,externalTree:n}=e,r=XN(e),i=e.rootContext||r,s={reference:i.useState("referenceElement"),floating:i.useState("floatingElement"),domReference:i.useState("domReferenceElement")},[a,c]=w.useState(null),u=w.useRef(null),f=wa(n);We(()=>{s.domReference&&(u.current=s.domReference)},[s.domReference]);const m=cF({...e,elements:{...s,...a&&{reference:a}}}),p=w.useCallback(R=>{const L=cn(R)?{getBoundingClientRect:()=>R.getBoundingClientRect(),getClientRects:()=>R.getClientRects(),contextElement:R}:R;c(L),m.refs.setReference(L)},[m.refs]),[y,x]=w.useState(null),[b,S]=w.useState(null);i.useSyncedValue("referenceElement",y),i.useSyncedValue("domReferenceElement",cn(y)?y:null),i.useSyncedValue("floatingElement",b);const k=w.useCallback(R=>{(cn(R)||R===null)&&(u.current=R,x(R)),(cn(m.refs.reference.current)||m.refs.reference.current===null||R!==null&&!cn(R))&&m.refs.setReference(R)},[m.refs,x]),E=w.useCallback(R=>{S(R),m.refs.setFloating(R)},[m.refs]),T=w.useMemo(()=>({...m.refs,setReference:k,setFloating:E,setPositionReference:p,domReference:u}),[m.refs,k,E,p]),N=w.useMemo(()=>({...m.elements,domReference:s.domReference}),[m.elements,s.domReference]),j=i.useState("open"),O=i.useState("floatingId"),A=w.useMemo(()=>({...m,dataRef:i.context.dataRef,open:j,onOpenChange:i.setOpen,events:i.context.events,floatingId:O,refs:T,elements:N,nodeId:t,rootStore:i}),[m,T,N,t,i,j,O]);return We(()=>{i.context.dataRef.current.floatingContext=A;const R=f?.nodesRef.current.find(L=>L.id===t);R&&(R.context=A)}),w.useMemo(()=>({...m,context:A,refs:T,elements:N,rootStore:i}),[m,T,N,A,i])}function Lb(e){const{popupStore:t,noEmit:n=!1,treatPopupAsFloatingElement:r=!1,onOpenChange:i}=e,s=Sl(),a=vs()!=null,c=t.useState("open"),u=t.useState("activeTriggerElement"),f=t.useState(r?"popupElement":"positionerElement"),m=t.context.triggerElements,p=ir(()=>new Ob({open:c,referenceElement:u,floatingElement:f,triggerElements:m,onOpenChange:i,floatingId:s,nested:a,noEmit:n})).current;return We(()=>{const y={open:c,floatingId:s,referenceElement:u,floatingElement:f};cn(u)&&(y.domReferenceElement=u),p.state.positionReference===p.state.referenceElement&&(y.positionReference=u),p.update(y)},[c,s,u,f,p]),p.context.onOpenChange=i,p.context.nested=a,p.context.noEmit=n,p}const M2=Q6&&K6;function ZN(e,t={}){const n="rootStore"in e?e.rootStore:e,{events:r,dataRef:i}=n.context,{enabled:s=!0,delay:a}=t,c=w.useRef(!1),u=w.useRef(null),f=Bn(),m=w.useRef(!0);w.useEffect(()=>{const y=n.select("domReferenceElement");if(!s)return;const x=Un(y);function b(){const E=n.select("domReferenceElement");!n.select("open")&&zn(E)&&E===mi(Zt(E))&&(c.current=!0)}function S(){m.current=!0}function k(){m.current=!1}return x.addEventListener("blur",b),M2&&(x.addEventListener("keydown",S,!0),x.addEventListener("pointerdown",k,!0)),()=>{x.removeEventListener("blur",b),M2&&(x.removeEventListener("keydown",S,!0),x.removeEventListener("pointerdown",k,!0))}},[n,s]),w.useEffect(()=>{if(!s)return;function y(x){if(x.reason===Hc||x.reason===m0){const b=n.select("domReferenceElement");cn(b)&&(u.current=b,c.current=!0)}}return r.on("openchange",y),()=>{r.off("openchange",y)}},[r,s,n]);const p=w.useMemo(()=>({onMouseLeave(){c.current=!1,u.current=null},onFocus(y){const x=y.currentTarget;if(c.current){if(u.current===x)return;c.current=!1,u.current=null}const b=Fr(y.nativeEvent);if(cn(b)){if(M2&&!y.relatedTarget){if(!m.current&&!h0(b))return}else if(!rP(b))return}const S=gm(y.relatedTarget,n.context.triggerElements),{nativeEvent:k,currentTarget:E}=y,T=typeof a=="function"?a():a;if(n.select("open")&&S||T===0||T===void 0){n.setOpen(!0,Et(Oc,k,E));return}f.start(T,()=>{c.current||n.setOpen(!0,Et(Oc,k,E))})},onBlur(y){c.current=!1,u.current=null;const x=y.relatedTarget,b=y.nativeEvent,S=cn(x)&&x.hasAttribute(tf("focus-guard"))&&x.getAttribute("data-type")==="outside";f.start(0,()=>{const k=n.select("domReferenceElement"),E=mi(k?k.ownerDocument:document);!x&&E===k||Nt(i.current.floatingContext?.refs.floating.current,E)||Nt(k,E)||S||gm(x??E,n.context.triggerElements)||n.setOpen(!1,Et(Oc,b))})}}),[i,n,f,a]);return w.useMemo(()=>s?{reference:p,trigger:p}:{},[s,p])}const $F=`button,a,[role="button"],select,[tabindex]:not([tabindex="-1"]),${eN}`;function YF(e){return e?!!e.closest($F):!1}class Ib{constructor(){this.pointerType=void 0,this.interactedInside=!1,this.handler=void 0,this.blockMouseMove=!0,this.performedPointerEventsMutation=!1,this.pointerEventsScopeElement=null,this.pointerEventsReferenceElement=null,this.pointerEventsFloatingElement=null,this.restTimeoutPending=!1,this.openChangeTimeout=new lo,this.restTimeout=new lo,this.handleCloseOptions=void 0}static create(){return new Ib}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose}function Pb(e){e.performedPointerEventsMutation&&(e.pointerEventsScopeElement?.style.removeProperty("pointer-events"),e.pointerEventsReferenceElement?.style.removeProperty("pointer-events"),e.pointerEventsFloatingElement?.style.removeProperty("pointer-events"),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null)}function WF(e,t){const{scopeElement:n,referenceElement:r,floatingElement:i}=t;Pb(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=r,e.pointerEventsFloatingElement=i,n.style.pointerEvents="none",r.style.pointerEvents="auto",i.style.pointerEvents="auto"}function JN(e){const t=ir(Ib.create).current,n=e.context.dataRef.current;return n.hoverInteractionState||(n.hoverInteractionState=t),db(n.hoverInteractionState.disposeEffect),n.hoverInteractionState}function eR(e,t={}){const n="rootStore"in e?e.rootStore:e,r=n.useState("open"),i=n.useState("floatingElement"),s=n.useState("domReferenceElement"),{dataRef:a}=n.context,{enabled:c=!0,closeDelay:u=0}=t,f=JN(n),m=wa(),p=vs(),y=tt(()=>mN(a.current.openEvent?.type,f.interactedInside)),x=tt(()=>{const N=a.current.openEvent?.type;return N?.includes("mouse")&&N!=="mousedown"}),b=tt(N=>gm(N,n.context.triggerElements)),S=w.useCallback(N=>{const j=Ld(u,"close",f.pointerType),O=()=>{n.setOpen(!1,Et(Br,N)),m?.events.emit("floating.closed",N)};j?f.openChangeTimeout.start(j,O):(f.openChangeTimeout.clear(),O())},[u,n,f,m]),k=tt(()=>{Pb(f)}),E=tt(N=>{const j=Fr(N);if(!YF(j)){f.interactedInside=!1;return}f.interactedInside=j?.closest("[aria-haspopup]")!=null});We(()=>{r||(f.pointerType=void 0,f.restTimeoutPending=!1,f.interactedInside=!1,k())},[r,f,k]),w.useEffect(()=>k,[k]),We(()=>{if(c&&r&&f.handleCloseOptions?.blockPointerEvents&&x()&&cn(s)&&i){const N=s,j=i,O=Zt(i),A=m?.nodesRef.current.find(L=>L.id===p)?.context?.elements.floating;A&&(A.style.pointerEvents="");const R=f.handleCloseOptions?.getScope?.()??f.pointerEventsScopeElement??A??N.closest("[data-rootownerid]")??O.body;return WF(f,{scopeElement:R,referenceElement:N,floatingElement:j}),()=>{k()}}},[c,r,s,i,f,x,m,p,k]);const T=Bn();w.useEffect(()=>{if(!c)return;function N(){f.openChangeTimeout.clear(),T.clear(),m?.events.off("floating.closed",O),k()}function j(R){if(m&&p&&ds(m.nodesRef.current,p).length>0){m.events.on("floating.closed",O);return}if(!b(R.relatedTarget)){if(f.handler){f.handler(R);return}k(),y()||S(R)}}function O(R){!m||!p||ds(m.nodesRef.current,p).length>0||T.start(0,()=>{m.events.off("floating.closed",O),n.setOpen(!1,Et(Br,R)),m.events.emit("floating.closed",R)})}const A=i;return A&&(A.addEventListener("mouseenter",N),A.addEventListener("mouseleave",j),A.addEventListener("pointerdown",E,!0)),()=>{A&&(A.removeEventListener("mouseenter",N),A.removeEventListener("mouseleave",j),A.removeEventListener("pointerdown",E,!0)),m?.events.off("floating.closed",O)}},[c,i,n,a,y,b,S,k,E,f,m,p,T])}const GF={current:null};function zb(e,t={}){const n="rootStore"in e?e.rootStore:e,{dataRef:r,events:i}=n.context,{enabled:s=!0,delay:a=0,handleClose:c=null,mouseOnly:u=!1,restMs:f=0,move:m=!0,triggerElementRef:p=GF,externalTree:y,isActiveTrigger:x=!0,getHandleCloseContext:b}=t,S=wa(y),k=JN(n),E=gr(c),T=gr(a),N=gr(f),j=gr(s);x&&(k.handleCloseOptions=E.current?.__options);const O=tt(()=>mN(r.current.openEvent?.type,k.interactedInside)),A=tt(U=>gm(U,n.context.triggerElements)),R=tt((U,Y,V)=>{const q=n.context.triggerElements;if(q.hasElement(Y))return!U||!Nt(U,Y);if(!cn(V))return!1;const H=V;return q.hasMatchingElement(z=>Nt(z,H))&&(!U||!Nt(U,H))}),L=w.useCallback((U,Y=!0)=>{const V=Ld(T.current,"close",k.pointerType);V?k.openChangeTimeout.start(V,()=>{n.setOpen(!1,Et(Br,U)),S?.events.emit("floating.closed",U)}):Y&&(k.openChangeTimeout.clear(),n.setOpen(!1,Et(Br,U)),S?.events.emit("floating.closed",U))},[T,n,k,S]),B=tt(()=>{if(!k.handler)return;Zt(n.select("domReferenceElement")).removeEventListener("mousemove",k.handler),k.handler=void 0});w.useEffect(()=>B,[B]);const I=tt(()=>{Pb(k)});return w.useEffect(()=>{if(!s)return;function U(Y){Y.open||(B(),k.openChangeTimeout.clear(),k.restTimeout.clear(),k.blockMouseMove=!0,k.restTimeoutPending=!1)}return i.on("openchange",U),()=>{i.off("openchange",U)}},[s,i,k,B]),w.useEffect(()=>{if(!s)return;const U=p.current??(x?n.select("domReferenceElement"):null);if(!cn(U))return;function Y(q){if(k.openChangeTimeout.clear(),k.blockMouseMove=!1,u&&!zc(k.pointerType)||fk(N.current)>0&&!Ld(T.current,"open"))return;const z=Ld(T.current,"open",k.pointerType),$=q.currentTarget??null,G=n.select("domReferenceElement"),Q=$==null?!1:R(G,$,q.target),_=n.select("open"),P=!_||Q;Q&&_?n.setOpen(!0,Et(Br,q,$)):z?k.openChangeTimeout.start(z,()=>{P&&n.setOpen(!0,Et(Br,q,$))}):P&&n.setOpen(!0,Et(Br,q,$))}function V(q){if(O()){I();return}B();const H=n.select("domReferenceElement"),z=Zt(H);k.restTimeout.clear(),k.restTimeoutPending=!1;const $=r.current.floatingContext??b?.();if(A(q.relatedTarget))return;if(E.current&&$){n.select("open")||k.openChangeTimeout.clear();const _=p.current;k.handler=E.current({...$,tree:S,x:q.clientX,y:q.clientY,onClose(){I(),B(),j.current&&!O()&&_===n.select("domReferenceElement")&&L(q,!0)}}),z.addEventListener("mousemove",k.handler),k.handler(q);return}(k.pointerType!=="touch"||!Nt(n.select("floatingElement"),q.relatedTarget))&&L(q)}return m&&U.addEventListener("mousemove",Y,{once:!0}),U.addEventListener("mouseenter",Y),U.addEventListener("mouseleave",V),()=>{m&&U.removeEventListener("mousemove",Y),U.removeEventListener("mouseenter",Y),U.removeEventListener("mouseleave",V)}},[B,I,r,T,L,n,s,E,k,x,R,O,A,u,m,N,p,S,j,b]),w.useMemo(()=>{if(!s)return;function U(Y){k.pointerType=Y.pointerType}return{onPointerDown:U,onPointerEnter:U,onMouseMove(Y){const{nativeEvent:V}=Y,q=Y.currentTarget,H=n.select("domReferenceElement"),z=n.select("open"),$=R(H,q,Y.target);if(u&&!zc(k.pointerType))return;const G=fk(N.current);if(z&&!$||G===0||!$&&k.restTimeoutPending&&Y.movementX**2+Y.movementY**2<2)return;k.restTimeout.clear();function Q(){if(k.restTimeoutPending=!1,O())return;const _=n.select("open");!k.blockMouseMove&&(!_||$)&&n.setOpen(!0,Et(Br,V,q))}k.pointerType==="touch"?vi.flushSync(()=>{Q()}):$&&z?Q():(k.restTimeoutPending=!0,k.restTimeout.start(G,Q))}}},[s,k,O,R,u,n,N])}function nu(e=[]){const t=e.map(f=>f?.reference),n=e.map(f=>f?.floating),r=e.map(f=>f?.item),i=e.map(f=>f?.trigger),s=w.useCallback(f=>vp(f,e,"reference"),t),a=w.useCallback(f=>vp(f,e,"floating"),n),c=w.useCallback(f=>vp(f,e,"item"),r),u=w.useCallback(f=>vp(f,e,"trigger"),i);return w.useMemo(()=>({getReferenceProps:s,getFloatingProps:a,getItemProps:c,getTriggerProps:u}),[s,a,c,u])}function vp(e,t,n){const r=new Map,i=n==="item",s={};n==="floating"&&(s.tabIndex=-1,s[zy]="");for(const a in e)i&&e&&(a===Z6||a===J6)||(s[a]=e[a]);for(let a=0;a<t.length;a+=1){let c;const u=t[a]?.[n];typeof u=="function"?c=e?u(e):null:c=u,c&&zk(s,c,i,r)}return zk(s,e,i,r),s}function zk(e,t,n,r){for(const i in t){const s=t[i];n&&(i===Z6||i===J6)||(i.startsWith("on")?(r.has(i)||r.set(i,[]),typeof s=="function"&&(r.get(i)?.push(s),e[i]=(...a)=>r.get(i)?.map(c=>c(...a)).find(c=>c!==void 0))):e[i]=s)}}const KF="Escape";function v0(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function wp(e,t){return v0(t,e===mb||e===Ef,e===da||e===fa)}function D2(e,t,n){return v0(t,e===Ef,n?e===da:e===fa)||e==="Enter"||e===" "||e===""}function QF(e,t,n){return v0(t,n?e===da:e===fa,e===Ef)}function XF(e,t,n,r){const i=n?e===fa:e===da,s=e===mb;return t==="both"||t==="horizontal"&&r&&r>1?e===KF:v0(t,i,s)}function tR(e,t){const n="rootStore"in e?e.rootStore:e,r=n.useState("open"),i=n.useState("floatingElement"),s=n.useState("domReferenceElement"),a=n.context.dataRef,{listRef:c,activeIndex:u,onNavigate:f=()=>{},enabled:m=!0,selectedIndex:p=null,allowEscape:y=!1,loopFocus:x=!1,nested:b=!1,rtl:S=!1,virtual:k=!1,focusItemOnOpen:E="auto",focusItemOnHover:T=!0,openOnArrowKeyDown:N=!0,disabledIndices:j=void 0,orientation:O="vertical",parentOrientation:A,cols:R=1,id:L,resetOnPointerLeave:B=!0,externalTree:I}=t,U=Zd(i),Y=gr(U),V=vs(),q=wa(I);We(()=>{a.current.orientation=O},[a,O]);const H=Fy(s),z=w.useRef(E),$=w.useRef(p??-1),G=w.useRef(null),Q=w.useRef(!0),_=tt(pe=>{f($.current===-1?null:$.current,pe)}),P=w.useRef(_),W=w.useRef(!!i),D=w.useRef(r),Z=w.useRef(!1),ee=w.useRef(!1),J=gr(j),he=gr(r),fe=gr(p),Se=gr(B),Ae=tt(()=>{function pe(Ce){k?q?.events.emit("virtualfocus",Ce):Id(Ce,{sync:Z.current,preventScroll:!0})}const be=c.current[$.current],ne=ee.current;be&&pe(be),(Z.current?Ce=>Ce():requestAnimationFrame)(()=>{const Ce=c.current[$.current]||be;if(!Ce)return;be||pe(Ce),Pe&&(ne||!Q.current)&&Ce.scrollIntoView?.({block:"nearest",inline:"nearest"})})});We(()=>{m&&(r&&i?($.current=p??-1,z.current&&p!=null&&(ee.current=!0,_())):W.current&&($.current=-1,P.current()))},[m,r,i,p,_]),We(()=>{if(m){if(!r){Z.current=!1;return}if(i)if(u==null){if(Z.current=!1,fe.current!=null)return;if(W.current&&($.current=-1,Ae()),(!D.current||!W.current)&&z.current&&(G.current!=null||z.current===!0&&G.current==null)){let pe=0;const be=()=>{c.current[0]==null?(pe<2&&(pe?requestAnimationFrame:queueMicrotask)(be),pe+=1):($.current=G.current==null||D2(G.current,O,S)||b?v2(c):ck(c),G.current=null,_())};be()}}else bm(c,u)||($.current=u,Ae(),ee.current=!1)}},[m,r,i,u,fe,b,c,O,S,_,Ae,J]),We(()=>{if(!m||i||!q||k||!W.current)return;const pe=q.nodesRef.current,be=pe.find(Ce=>Ce.id===V)?.context?.elements.floating,ne=mi(Zt(i)),ye=pe.some(Ce=>Ce.context&&Nt(Ce.context.elements.floating,ne));be&&!ye&&Q.current&&be.focus({preventScroll:!0})},[m,i,q,V,k]),We(()=>{P.current=_,D.current=r,W.current=!!i}),We(()=>{r||(G.current=null,z.current=E)},[r,E]);const Oe=u!=null,Pe=w.useMemo(()=>{function pe(ne){if(!he.current)return;const ye=c.current.indexOf(ne.currentTarget);ye!==-1&&$.current!==ye&&($.current=ye,_(ne))}return{onFocus(ne){Z.current=!0,pe(ne)},onClick:({currentTarget:ne})=>ne.focus({preventScroll:!0}),onMouseMove(ne){Z.current=!0,ee.current=!1,T&&pe(ne)},onPointerLeave(ne){if(!he.current||!Q.current||ne.pointerType==="touch")return;Z.current=!0;const ye=ne.relatedTarget;if(!(!T||c.current.includes(ye))&&Se.current&&(Id(null,{sync:!0}),$.current=-1,_(ne),!k)){const Ce=Y.current,Ve=mi(Zt(Ce));Ce&&Nt(Ce,Ve)&&Ce.focus({preventScroll:!0})}}}},[he,Y,T,c,_,Se,k]),_e=w.useCallback(()=>A??q?.nodesRef.current.find(pe=>pe.id===V)?.context?.dataRef?.current.orientation,[V,q,A]),De=tt(pe=>{if(Q.current=!1,Z.current=!0,pe.which===229||!he.current&&pe.currentTarget===Y.current)return;if(b&&XF(pe.key,O,S,R)){wp(pe.key,_e())||pi(pe),n.setOpen(!1,Et(Jp,pe.nativeEvent)),zn(s)&&(k?q?.events.emit("virtualfocus",s):s.focus());return}const be=$.current,ne=v2(c,j),ye=ck(c,j);if(H||(pe.key==="Home"&&(pi(pe),$.current=ne,_(pe)),pe.key==="End"&&(pi(pe),$.current=ye,_(pe))),R>1){const Ce=Array.from({length:c.current.length},()=>({width:1,height:1})),Ve=mP(Ce,R),lt=Ve.findIndex(Le=>Le!=null&&!Rc(c,Le,j)),oe=Ve.reduce((Le,Me,He)=>Me!=null&&!Rc(c,Me,j)?He:Le,-1),ke=Ve[pP({current:Ve.map(Le=>Le!=null?c.current[Le]:null)},{event:pe,orientation:O,loopFocus:x,rtl:S,cols:R,disabledIndices:yP([...(typeof j!="function"?j:null)||c.current.map((Le,Me)=>Rc(c,Me,j)?Me:void 0),void 0],Ve),minIndex:lt,maxIndex:oe,prevIndex:gP($.current>ye?ne:$.current,Ce,Ve,R,pe.key===Ef?"bl":pe.key===(S?da:fa)?"tr":"tl"),stopEvent:!0})];if(ke!=null&&($.current=ke,_(pe)),O==="both")return}if(wp(pe.key,O)){if(pi(pe),r&&!k&&mi(pe.currentTarget.ownerDocument)===pe.currentTarget){$.current=D2(pe.key,O,S)?ne:ye,_(pe);return}D2(pe.key,O,S)?x?be>=ye?y&&be!==c.current.length?$.current=-1:(Z.current=!1,$.current=ne):$.current=Pr(c,{startingIndex:be,disabledIndices:j}):$.current=Math.min(ye,Pr(c,{startingIndex:be,disabledIndices:j})):x?be<=ne?y&&be!==-1?$.current=c.current.length:(Z.current=!1,$.current=ye):$.current=Pr(c,{startingIndex:be,decrement:!0,disabledIndices:j}):$.current=Math.max(ne,Pr(c,{startingIndex:be,decrement:!0,disabledIndices:j})),bm(c,$.current)&&($.current=-1),_(pe)}}),xe=w.useMemo(()=>k&&r&&Oe&&{"aria-activedescendant":`${L}-${u}`},[k,r,Oe,L,u]),Ge=w.useMemo(()=>({"aria-orientation":O==="both"?void 0:O,...H?{}:xe,onKeyDown(pe){if(pe.key==="Tab"&&pe.shiftKey&&r&&!k){const be=Fr(pe.nativeEvent);if(be&&!Nt(Y.current,be))return;pi(pe),n.setOpen(!1,Et(fl,pe.nativeEvent)),zn(s)&&s.focus();return}De(pe)},onPointerMove(){Q.current=!0}}),[xe,De,Y,O,H,n,r,k,s]),we=w.useMemo(()=>{function pe(ne){E==="auto"&&tN(ne.nativeEvent)&&(z.current=!k)}function be(ne){z.current=E,E==="auto"&&nN(ne.nativeEvent)&&(z.current=!0)}return{onKeyDown(ne){const ye=n.select("open");Q.current=!1;const Ce=ne.key.startsWith("Arrow"),Ve=QF(ne.key,_e(),S),lt=wp(ne.key,O),oe=(b?Ve:lt)||ne.key==="Enter"||ne.key.trim()==="";if(k&&ye)return De(ne);if(!(!ye&&!N&&Ce)){if(oe){const ke=wp(ne.key,_e());G.current=b&&ke?null:ne.key}if(b){Ve&&(pi(ne),ye?($.current=v2(c,J.current),_(ne)):n.setOpen(!0,Et(Jp,ne.nativeEvent,ne.currentTarget)));return}lt&&(fe.current!=null&&($.current=fe.current),pi(ne),!ye&&N?n.setOpen(!0,Et(Jp,ne.nativeEvent,ne.currentTarget)):De(ne),ye&&_(ne))}},onFocus(ne){n.select("open")&&!k&&($.current=-1,_(ne))},onPointerDown:be,onPointerEnter:be,onMouseDown:pe,onClick:pe}},[De,J,E,c,b,_,n,N,O,_e,S,fe,k]),Re=w.useMemo(()=>({...xe,...we}),[xe,we]);return w.useMemo(()=>m?{reference:Re,floating:Ge,item:Pe,trigger:we}:{},[m,Re,Ge,we,Pe])}const ZF=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function nR(e,t={}){const n="rootStore"in e?e.rootStore:e,r=n.useState("open"),i=n.useState("floatingId"),s=n.useState("domReferenceElement"),a=n.useState("floatingElement"),{role:c="dialog"}=t,u=Sl(),f=s?.id||u,m=w.useMemo(()=>Zd(a)?.id||i,[a,i]),p=ZF.get(c)??c,x=vs()!=null,b=w.useMemo(()=>p==="tooltip"||c==="label"?Fn:{"aria-haspopup":p==="alertdialog"?"dialog":p,"aria-expanded":"false",...p==="listbox"&&{role:"combobox"},...p==="menu"&&x&&{role:"menuitem"},...c==="select"&&{"aria-autocomplete":"none"},...c==="combobox"&&{"aria-autocomplete":"list"}},[p,x,c]),S=w.useMemo(()=>p==="tooltip"||c==="label"?{[`aria-${c==="label"?"labelledby":"describedby"}`]:r?m:void 0}:{...b,"aria-expanded":r?"true":"false","aria-controls":r?m:void 0,...p==="menu"&&{id:f}},[p,m,r,f,c,b]),k=w.useMemo(()=>{const T={id:m,...p&&{role:p}};return p==="tooltip"||c==="label"?T:{...T,...p==="menu"&&{"aria-labelledby":f}}},[p,m,f,c]),E=w.useCallback(({active:T,selected:N})=>{const j={role:"option",...T&&{id:`${m}-fui-option`}};switch(c){case"select":case"combobox":return{...j,"aria-selected":N}}return{}},[m,c]);return w.useMemo(()=>({reference:S,floating:k,item:E,trigger:b}),[S,k,b,E])}function rR(e,t){const n="rootStore"in e?e.rootStore:e,r=n.context.dataRef,i=n.useState("open"),{listRef:s,elementsRef:a,activeIndex:c,onMatch:u,onTypingChange:f,enabled:m=!0,resetMs:p=750,selectedIndex:y=null}=t,x=Bn(),b=w.useRef(""),S=w.useRef(y??c??-1),k=w.useRef(null);We(()=>{!i&&y!==null||(x.clear(),k.current=null,b.current!==""&&(b.current=""))},[i,y,x]),We(()=>{i&&b.current===""&&(S.current=y??c??-1)},[i,y,c]);const E=tt(A=>{A?r.current.typing||(r.current.typing=A,f?.(A)):r.current.typing&&(r.current.typing=A,f?.(A))}),T=tt(A=>{function R(H){const z=a?.current[H];return!z||bb(z)}function L(H,z,$=0){if(H.length===0)return-1;const G=($%H.length+H.length)%H.length,Q=z.toLocaleLowerCase();for(let _=0;_<H.length;_+=1){const P=(G+_)%H.length;if(!(!H[P]?.toLocaleLowerCase().startsWith(Q)||!R(P)))return P}return-1}const B=s.current;if(b.current.length>0&&A.key===" "&&(pi(A),E(!0)),b.current.length>0&&b.current[0]!==" "&&L(B,b.current)===-1&&A.key!==" "&&E(!1),B==null||A.key.length!==1||A.ctrlKey||A.metaKey||A.altKey)return;i&&A.key!==" "&&(pi(A),E(!0));const I=b.current==="";I&&(S.current=y??c??-1),B.every(H=>H?H[0]?.toLocaleLowerCase()!==H[1]?.toLocaleLowerCase():!0)&&b.current===A.key&&(b.current="",S.current=k.current),b.current+=A.key,x.start(p,()=>{b.current="",S.current=k.current,E(!1)});const V=((I?y??c??-1:S.current)??0)+1,q=L(B,b.current,V);q!==-1?(u?.(q),k.current=q):A.key!==" "&&(b.current="",E(!1))}),N=tt(A=>{const R=A.relatedTarget,L=n.select("domReferenceElement"),B=n.select("floatingElement"),I=Nt(L,R),U=Nt(B,R);I||U||(x.clear(),b.current="",S.current=k.current,E(!1))}),j=w.useMemo(()=>({onKeyDown:T,onBlur:N}),[T,N]),O=w.useMemo(()=>({onKeyDown:T,onBlur:N}),[T,N]);return w.useMemo(()=>m?{reference:j,floating:O}:{},[m,j,O])}const Fk=.1,JF=Fk*Fk,bn=.5;function Sp(e,t,n,r,i,s){return r>=t!=s>=t&&e<=(i-n)*(t-r)/(s-r)+n}function Cp(e,t,n,r,i,s,a,c,u,f){let m=!1;return Sp(e,t,n,r,i,s)&&(m=!m),Sp(e,t,i,s,a,c)&&(m=!m),Sp(e,t,a,c,u,f)&&(m=!m),Sp(e,t,u,f,n,r)&&(m=!m),m}function eB(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function kp(e,t,n,r,i,s){const a=Math.min(n,i),c=Math.max(n,i),u=Math.min(r,s),f=Math.max(r,s);return e>=a&&e<=c&&t>=u&&t<=f}function Fb(e={}){const{blockPointerEvents:t=!1}=e,n=new lo,r=({x:i,y:s,placement:a,elements:c,onClose:u,nodeId:f,tree:m})=>{const p=a?.split("-")[0];let y=!1,x=null,b=null,S=typeof performance<"u"?performance.now():0;function k(T,N){const j=performance.now(),O=j-S;if(x===null||b===null||O===0)return x=T,b=N,S=j,!1;const A=T-x,R=N-b,L=A*A+R*R,B=O*O*JF;return x=T,b=N,S=j,L<B}function E(){n.clear(),u()}return function(N){n.clear();const j=c.domReference,O=c.floating;if(!j||!O||p==null||i==null||s==null)return;const{clientX:A,clientY:R}=N,L=Fr(N),B=N.type==="mouseleave",I=Nt(O,L),U=Nt(j,L);if(I&&(y=!0,!B))return;if(U&&(y=!1,!B)){y=!0;return}if(B&&cn(N.relatedTarget)&&Nt(O,N.relatedTarget))return;function Y(){return!!(m&&ds(m.nodesRef.current,f).length>0)}function V(){Y()||E()}if(Y())return;const q=j.getBoundingClientRect(),H=O.getBoundingClientRect(),z=i>H.right-H.width/2,$=s>H.bottom-H.height/2,G=H.width>q.width,Q=H.height>q.height,_=(G?q:H).left,P=(G?q:H).right,W=(Q?q:H).top,D=(Q?q:H).bottom;if(p==="top"&&s>=q.bottom-1||p==="bottom"&&s<=q.top+1||p==="left"&&i>=q.right-1||p==="right"&&i<=q.left+1){V();return}let Z=!1;switch(p){case"top":Z=kp(A,R,_,q.top+1,P,H.bottom-1);break;case"bottom":Z=kp(A,R,_,H.top+1,P,q.bottom-1);break;case"left":Z=kp(A,R,H.right-1,D,q.left+1,W);break;case"right":Z=kp(A,R,q.right-1,D,H.left+1,W);break}if(Z)return;if(y&&!eB(A,R,q)){V();return}if(!B&&k(A,R)){V();return}let ee=!1;switch(p){case"top":{const J=G?bn/2:bn*4,he=G||z?i+J:i-J,fe=G?i-J:z?i+J:i-J,Se=s+bn+1,Ae=z||G?H.bottom-bn:H.top,Oe=z?G?H.bottom-bn:H.top:H.bottom-bn;ee=Cp(A,R,he,Se,fe,Se,H.left,Ae,H.right,Oe);break}case"bottom":{const J=G?bn/2:bn*4,he=G||z?i+J:i-J,fe=G?i-J:z?i+J:i-J,Se=s-bn,Ae=z||G?H.top+bn:H.bottom,Oe=z?G?H.top+bn:H.bottom:H.top+bn;ee=Cp(A,R,he,Se,fe,Se,H.left,Ae,H.right,Oe);break}case"left":{const J=Q?bn/2:bn*4,he=Q||$?s+J:s-J,fe=Q?s-J:$?s+J:s-J,Se=i+bn+1,Ae=$||Q?H.right-bn:H.left,Oe=$?Q?H.right-bn:H.left:H.right-bn;ee=Cp(A,R,Ae,H.top,Oe,H.bottom,Se,he,Se,fe);break}case"right":{const J=Q?bn/2:bn*4,he=Q||$?s+J:s-J,fe=Q?s-J:$?s+J:s-J,Se=i-bn,Ae=$||Q?H.left+bn:H.right,Oe=$?Q?H.left+bn:H.right:H.left+bn;ee=Cp(A,R,Se,he,Se,fe,Ae,H.top,Oe,H.bottom);break}}ee?y||n.start(40,V):V()}};return r.__options={blockPointerEvents:t},r}const tB={..._b,disabled:Ue(e=>e.disabled),instantType:Ue(e=>e.instantType),isInstantPhase:Ue(e=>e.isInstantPhase),trackCursorAxis:Ue(e=>e.trackCursorAxis),disableHoverablePopup:Ue(e=>e.disableHoverablePopup),lastOpenChangeReason:Ue(e=>e.openChangeReason),closeOnClick:Ue(e=>e.closeOnClick),closeDelay:Ue(e=>e.closeDelay),hasViewport:Ue(e=>e.hasViewport)};class Bb extends b0{constructor(t){super({...nB(),...t},{popupRef:w.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:new Nf},tB)}setOpen=(t,n)=>{const r=n.reason,i=r===Br,s=t&&r===Oc,a=!t&&(r===Hc||r===m0);if(n.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},this.context.onOpenChange?.(t,n),n.isCanceled)return;const c=()=>{const u={open:t,openChangeReason:r};s?u.instantType="focus":a?u.instantType="dismiss":r===Br&&(u.instantType=void 0);const f=n.trigger?.id??null;(f||t)&&(u.activeTriggerId=f,u.activeTriggerElement=n.trigger??null),this.update(u)};i?vi.flushSync(c):c()};static useStore(t,n){const r=ir(()=>new Bb(n)).current,i=t??r,s=Lb({popupStore:i,onOpenChange:i.setOpen});return i.state.floatingRootContext=s,i}}function nB(){return{...Db(),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:"none",disableHoverablePopup:!1,openChangeReason:null,closeOnClick:!0,closeDelay:0,hasViewport:!1}}const rB=ub(function(t){const{disabled:n=!1,defaultOpen:r=!1,open:i,disableHoverablePopup:s=!1,trackCursorAxis:a="none",actionsRef:c,onOpenChange:u,onOpenChangeComplete:f,handle:m,triggerId:p,defaultTriggerId:y=null,children:x}=t,b=Bb.useStore(m?.store,{open:r,openProp:i,activeTriggerId:y,triggerIdProp:p});l0(()=>{i===void 0&&b.state.open===!1&&r===!0&&b.update({open:!0,activeTriggerId:y})}),b.useControlledProp("openProp",i),b.useControlledProp("triggerIdProp",p),b.useContextCallback("onOpenChange",u),b.useContextCallback("onOpenChangeComplete",f);const S=b.useState("open"),k=!n&&S,E=b.useState("activeTriggerId"),T=b.useState("payload");b.useSyncedValues({trackCursorAxis:a,disableHoverablePopup:s}),We(()=>{S&&n&&b.setOpen(!1,Et(VP))},[S,n,b]),b.useSyncedValue("disabled",n),jb(b);const{forceUnmount:N,transitionStatus:j}=Mb(k,b),O=b.useState("isInstantPhase"),A=b.useState("instantType"),R=b.useState("lastOpenChangeReason"),L=w.useRef(null);We(()=>{j==="ending"&&R===wl||j!=="ending"&&O?(A!=="delay"&&(L.current=A),b.set("instantType","delay")):L.current!==null&&(b.set("instantType",L.current),L.current=null)},[j,O,R,A,b]),We(()=>{k&&E==null&&b.set("payload",void 0)},[b,E,k]);const B=w.useCallback(()=>{b.setOpen(!1,iB(b,wb))},[b]);w.useImperativeHandle(c,()=>({unmount:N,close:B}),[N,B]);const I=b.useState("floatingRootContext"),U=y0(I,{enabled:!n,referencePress:()=>b.select("closeOnClick")}),Y=Tz(I,{enabled:!n&&a!=="none",axis:a==="none"?void 0:a}),{getReferenceProps:V,getFloatingProps:q,getTriggerProps:H}=nu([U,Y]),z=w.useMemo(()=>V(),[V]),$=w.useMemo(()=>H(),[H]),G=w.useMemo(()=>q(),[q]);return b.useSyncedValues({activeTriggerProps:z,inactiveTriggerProps:$,popupProps:G}),h.jsx(q6.Provider,{value:b,children:typeof x=="function"?x({payload:T}):x})});function iB(e,t){const n=Et(t);return n.preventUnmountOnClose=()=>{e.set("preventUnmountingOnClose",!0)},n}let ol=(function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=nf.startingStyle]="startingStyle",e[e.endingStyle=nf.endingStyle]="endingStyle",e.anchorHidden="data-anchor-hidden",e.side="data-side",e.align="data-align",e})({}),Tm=(function(e){return e.popupOpen="data-popup-open",e.pressed="data-pressed",e})({});const oB={[Tm.popupOpen]:""},sB={[Tm.popupOpen]:"",[Tm.pressed]:""},aB={[ol.open]:""},lB={[ol.closed]:""},cB={[ol.anchorHidden]:""},Hb={open(e){return e?oB:null}},Gy={open(e){return e?sB:null}},Ss={open(e){return e?aB:lB},anchorHidden(e){return e?cB:null}};function Si(e){return Sl(e,"base-ui")}const iR=w.createContext(void 0);function uB(){return w.useContext(iR)}let dB=(function(e){return e[e.popupOpen=Tm.popupOpen]="popupOpen",e.triggerDisabled="data-trigger-disabled",e})({});const fB=600,hB=V6(function(t,n){const{className:r,render:i,handle:s,payload:a,disabled:c,delay:u,closeOnClick:f=!0,closeDelay:m,id:p,...y}=t,x=kf(!0),b=s?.store??x;if(!b)throw new Error(Cn(82));const S=Si(p),k=b.useState("isTriggerActive",S),E=b.useState("isOpenedByTrigger",S),T=b.useState("floatingRootContext"),N=w.useRef(null),j=u??fB,O=m??0,{registerTrigger:A,isMountedByThisTrigger:R}=QN(S,N,b,{payload:a,closeOnClick:f,closeDelay:O}),L=uB(),{delayRef:B,isInstantPhase:I,hasProvider:U}=YP(T,{open:E});b.useSyncedValue("isInstantPhase",I);const Y=b.useState("disabled"),V=c??Y,q=b.useState("trackCursorAxis"),H=b.useState("disableHoverablePopup"),z=zb(T,{enabled:!V,mouseOnly:!0,move:!1,handleClose:!H&&q!=="both"?Fb():null,restMs(){const P=L?.delay,W=typeof B.current=="object"?B.current.open:void 0;let D=j;return U&&(W!==0?D=u??P??j:D=0),D},delay(){const P=typeof B.current=="object"?B.current.close:void 0;let W=O;return m==null&&U&&(W=P),{close:W}},triggerElementRef:N,isActiveTrigger:k}),$=ZN(T,{enabled:!V}).reference,G={open:E},Q=b.useState("triggerProps",R);return jt("button",t,{state:G,ref:[n,A,N],props:[z,$,Q,{onPointerDown(){b.set("closeOnClick",f)},id:S,[dB.triggerDisabled]:V?"":void 0},y],stateAttributesMapping:Hb})}),oR=w.createContext(void 0);function pB(){const e=w.useContext(oR);if(e===void 0)throw new Error(Cn(70));return e}const mB=w.forwardRef(function(t,n){const{children:r,container:i,className:s,render:a,...c}=t,{portalNode:u,portalSubtree:f}=AN({container:i,ref:n,componentProps:t,elementProps:c});return!f&&!u?null:h.jsxs(w.Fragment,{children:[f,u&&vi.createPortal(r,u)]})}),gB=w.forwardRef(function(t,n){const{keepMounted:r=!1,...i}=t;return kf().useState("mounted")||r?h.jsx(oR.Provider,{value:r,children:h.jsx(mB,{ref:n,...i})}):null}),sR=w.createContext(void 0);function aR(){const e=w.useContext(sR);if(e===void 0)throw new Error(Cn(71));return e}const yB=w.createContext(void 0);function lR(){return w.useContext(yB)?.direction??"ltr"}const xB=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:s,platform:a,elements:c,middlewareData:u}=t,{element:f,padding:m=0,offsetParent:p="real"}=hs(e,t)||{};if(f==null)return{};const y=iN(m),x={x:n,y:r},b=xb(i),S=yb(b),k=await a.getDimensions(f),E=b==="y",T=E?"top":"left",N=E?"bottom":"right",j=E?"clientHeight":"clientWidth",O=s.reference[S]+s.reference[b]-x[b]-s.floating[S],A=x[b]-s.reference[b],R=p==="real"?await a.getOffsetParent?.(f):c.floating;let L=c.floating[j]||s.floating[S];(!L||!await a.isElement?.(R))&&(L=c.floating[j]||s.floating[S]);const B=O/2-A/2,I=L/2-k[S]/2-1,U=Math.min(y[T],I),Y=Math.min(y[N],I),V=U,q=L-k[S]-Y,H=L/2-k[S]/2+B,z=By(V,H,q),$=!u.arrow&&va(i)!=null&&H!==z&&s.reference[S]/2-(H<V?U:Y)-k[S]/2<0,G=$?H<V?H-V:H-q:0;return{[b]:x[b]+G,data:{[b]:z,centerOffset:H-z-G,...$&&{alignmentOffset:G}},reset:$}}}),bB=(e,t)=>({...xB(e),options:[e,t]}),vB={name:"hide",async fn(e){const{width:t,height:n,x:r,y:i}=e.rects.reference,s=t===0&&n===0&&r===0&&i===0;return{data:{referenceHidden:(await mF().fn(e)).data?.referenceHidden||s}}}},tm={sideX:"left",sideY:"top"},cR={name:"adaptiveOrigin",async fn(e){const{x:t,y:n,rects:{floating:r},elements:{floating:i},platform:s,strategy:a,placement:c}=e,u=Un(i),f=u.getComputedStyle(i);if(!(f.transitionDuration!=="0s"&&f.transitionDuration!==""))return{x:t,y:n,data:tm};const p=await s.getOffsetParent?.(i);let y={width:0,height:0};if(a==="fixed"&&u?.visualViewport)y={width:u.visualViewport.width,height:u.visualViewport.height};else if(p===u){const T=Zt(i);y={width:T.documentElement.clientWidth,height:T.documentElement.clientHeight}}else await s.isElement?.(p)&&(y=await s.getDimensions(p));const x=Jr(c);let b=t,S=n;x==="left"&&(b=y.width-(t+r.width)),x==="top"&&(S=y.height-(n+r.height));const k=x==="left"?"right":tm.sideX,E=x==="top"?"bottom":tm.sideY;return{x:b,y:S,data:{sideX:k,sideY:E}}}};function uR(e,t,n){const r=e==="inline-start"||e==="inline-end";return{top:"top",right:r?n?"inline-start":"inline-end":"right",bottom:"bottom",left:r?n?"inline-end":"inline-start":"left"}[t]}function Bk(e,t,n){const{rects:r,placement:i}=e;return{side:uR(t,Jr(i),n),align:va(i)||"center",anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function Ub(e){const{anchor:t,positionMethod:n="absolute",side:r="bottom",sideOffset:i=0,align:s="center",alignOffset:a=0,collisionBoundary:c,collisionPadding:u=5,sticky:f=!1,arrowPadding:m=5,disableAnchorTracking:p=!1,keepMounted:y=!1,floatingRootContext:x,mounted:b,collisionAvoidance:S,shiftCrossAxis:k=!1,nodeId:E,adaptiveOrigin:T,lazyFlip:N=!1,externalTree:j}=e,[O,A]=w.useState(null);!b&&O!==null&&A(null);const R=S.side||"flip",L=S.align||"flip",B=S.fallbackAxisSide||"end",I=typeof t=="function"?t:void 0,U=tt(I),Y=I?U:t,V=gr(t),H=lR()==="rtl",z=O||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":H?"left":"right","inline-start":H?"right":"left"}[r],$=s==="center"?z:`${z}-${s}`;let G=u;const Q=1,_=r==="bottom"?Q:0,P=r==="top"?Q:0,W=r==="right"?Q:0,D=r==="left"?Q:0;typeof G=="number"?G={top:G+_,right:G+D,bottom:G+P,left:G+W}:G&&(G={top:(G.top||0)+_,right:(G.right||0)+D,bottom:(G.bottom||0)+P,left:(G.left||0)+W});const Z={boundary:c==="clipping-ancestors"?"clippingAncestors":c,padding:G},ee=w.useRef(null),J=gr(i),he=gr(a),Ae=[uF(Qe=>{const Ct=Bk(Qe,r,H),qe=typeof J.current=="function"?J.current(Ct):J.current,ge=typeof he.current=="function"?he.current(Ct):he.current;return{mainAxis:qe,crossAxis:ge,alignmentAxis:ge}},[typeof i!="function"?i:0,typeof a!="function"?a:0,H,r])],Oe=L==="none"&&R!=="shift",Pe=!Oe&&(f||k||R==="shift"),_e=R==="none"?null:hF({...Z,padding:{top:G.top+Q,right:G.right+Q,bottom:G.bottom+Q,left:G.left+Q},mainAxis:!k&&R==="flip",crossAxis:L==="flip"?"alignment":!1,fallbackAxisSideDirection:B}),De=Oe?null:dF(Qe=>{const Ct=Zt(Qe.elements.floating).documentElement;return{...Z,rootBoundary:k?{x:0,y:0,width:Ct.clientWidth,height:Ct.clientHeight}:void 0,mainAxis:L!=="none",crossAxis:Pe,limiter:f||k?void 0:fF(qe=>{if(!ee.current)return{};const{width:ge,height:je}=ee.current.getBoundingClientRect(),Ye=qi(Jr(qe.placement)),Rt=Ye==="y"?ge:je,Ie=Ye==="y"?G.left+G.right:G.top+G.bottom;return{offset:Rt/2+Ie/2}})}},[Z,f,k,G,L]);R==="shift"||L==="shift"||s==="center"?Ae.push(De,_e):Ae.push(_e,De),Ae.push(pF({...Z,apply({elements:{floating:Qe},availableWidth:Ct,availableHeight:qe,rects:ge}){const je=Qe.style;je.setProperty("--available-width",`${Ct}px`),je.setProperty("--available-height",`${qe}px`);const Ye=window.devicePixelRatio||1,{x:Rt,y:Ie,width:Pt,height:on}=ge.reference,tn=(Math.round((Rt+Pt)*Ye)-Math.round(Rt*Ye))/Ye,vn=(Math.round((Ie+on)*Ye)-Math.round(Ie*Ye))/Ye;je.setProperty("--anchor-width",`${tn}px`),je.setProperty("--anchor-height",`${vn}px`)}}),bB(()=>({element:ee.current||document.createElement("div"),padding:m,offsetParent:"floating"}),[m]),{name:"transformOrigin",fn(Qe){const{elements:Ct,middlewareData:qe,placement:ge,rects:je,y:Ye}=Qe,Rt=Jr(ge),Ie=qi(Rt),Pt=ee.current,on=qe.arrow?.x||0,tn=qe.arrow?.y||0,vn=Pt?.clientWidth||0,Ut=Pt?.clientHeight||0,yt=on+vn/2,zt=tn+Ut/2,K=Math.abs(qe.shift?.y||0),te=je.reference.height/2,se=typeof i=="function"?i(Bk(Qe,r,H)):i,Te=K>se,Be={top:`${yt}px calc(100% + ${se}px)`,bottom:`${yt}px ${-se}px`,left:`calc(100% + ${se}px) ${zt}px`,right:`${-se}px ${zt}px`}[Rt],st=`${yt}px ${je.reference.y+te-Ye}px`;return Ct.floating.style.setProperty("--transform-origin",Pe&&Ie==="y"&&Te?st:Be),{}}},vB,T),We(()=>{!b&&x&&x.update({referenceElement:null,floatingElement:null,domReferenceElement:null})},[b,x]);const xe=w.useMemo(()=>({elementResize:!p&&typeof ResizeObserver<"u",layoutShift:!p&&typeof IntersectionObserver<"u"}),[p]),{refs:Ge,elements:we,x:Re,y:pe,middlewareData:be,update:ne,placement:ye,context:Ce,isPositioned:Ve,floatingStyles:lt}=qF({rootContext:x,placement:$,middleware:Ae,strategy:n,whileElementsMounted:y?void 0:(...Qe)=>Ok(...Qe,xe),nodeId:E,externalTree:j}),{sideX:oe,sideY:ke}=be.adaptiveOrigin||tm,Le=Ve?n:"fixed",Me=w.useMemo(()=>{const Qe=T?{position:Le,[oe]:Re,[ke]:pe}:{position:Le,...lt};return Ve||(Qe.opacity=0),Qe},[T,Le,oe,Re,ke,pe,lt,Ve]),He=w.useRef(null);We(()=>{if(!b)return;const Qe=V.current,Ct=typeof Qe=="function"?Qe():Qe,ge=(Hk(Ct)?Ct.current:Ct)||null||null;ge!==He.current&&(Ge.setPositionReference(ge),He.current=ge)},[b,Ge,Y,V]),w.useEffect(()=>{if(!b)return;const Qe=V.current;typeof Qe!="function"&&Hk(Qe)&&Qe.current!==He.current&&(Ge.setPositionReference(Qe.current),He.current=Qe.current)},[b,Ge,Y,V]),w.useEffect(()=>{if(y&&b&&we.domReference&&we.floating)return Ok(we.domReference,we.floating,ne,xe)},[y,b,we,ne,xe]);const ut=Jr(ye),xt=uR(r,ut,H),Je=va(ye)||"center",Ke=!!be.hide?.referenceHidden;We(()=>{N&&b&&Ve&&A(ut)},[N,b,Ve,ut]);const bt=w.useMemo(()=>({position:"absolute",top:be.arrow?.y,left:be.arrow?.x}),[be.arrow]),nt=be.arrow?.centerOffset!==0;return w.useMemo(()=>({positionerStyles:Me,arrowStyles:bt,arrowRef:ee,arrowUncentered:nt,side:xt,align:Je,physicalSide:ut,anchorHidden:Ke,refs:Ge,context:Ce,isPositioned:Ve,update:ne}),[Me,bt,ee,nt,xt,Je,ut,Ke,Ge,Ce,Ve,ne])}function Hk(e){return e!=null&&"current"in e}function ru(e){return e==="starting"?FP:Fn}const wB=w.forwardRef(function(t,n){const{render:r,className:i,anchor:s,positionMethod:a="absolute",side:c="top",align:u="center",sideOffset:f=0,alignOffset:m=0,collisionBoundary:p="clipping-ancestors",collisionPadding:y=5,arrowPadding:x=5,sticky:b=!1,disableAnchorTracking:S=!1,collisionAvoidance:k=yN,...E}=t,T=kf(),N=pB(),j=T.useState("open"),O=T.useState("mounted"),A=T.useState("trackCursorAxis"),R=T.useState("disableHoverablePopup"),L=T.useState("floatingRootContext"),B=T.useState("instantType"),I=T.useState("transitionStatus"),U=T.useState("hasViewport"),Y=Ub({anchor:s,positionMethod:a,floatingRootContext:L,mounted:O,side:c,sideOffset:f,align:u,alignOffset:m,collisionBoundary:p,collisionPadding:y,sticky:b,arrowPadding:x,disableAnchorTracking:S,keepMounted:N,collisionAvoidance:k,adaptiveOrigin:U?cR:void 0}),V=w.useMemo(()=>{const $={};return(!j||A==="both"||R)&&($.pointerEvents="none"),{role:"presentation",hidden:!O,style:{...Y.positionerStyles,...$}}},[j,A,R,O,Y.positionerStyles]),q=w.useMemo(()=>({open:j,side:Y.side,align:Y.align,anchorHidden:Y.anchorHidden,instant:A!=="none"?"tracking-cursor":B}),[j,Y.side,Y.align,Y.anchorHidden,A,B]),H=w.useMemo(()=>({...q,arrowRef:Y.arrowRef,arrowStyles:Y.arrowStyles,arrowUncentered:Y.arrowUncentered}),[q,Y.arrowRef,Y.arrowStyles,Y.arrowUncentered]),z=jt("div",t,{state:q,props:[V,ru(I),E],ref:[n,T.useStateSetter("positionerElement")],stateAttributesMapping:Ss});return h.jsx(sR.Provider,{value:H,children:z})}),SB={...Ss,...ws},CB=w.forwardRef(function(t,n){const{className:r,render:i,...s}=t,a=kf(),{side:c,align:u}=aR(),f=a.useState("open"),m=a.useState("instantType"),p=a.useState("transitionStatus"),y=a.useState("popupProps"),x=a.useState("floatingRootContext");Ki({open:f,ref:a.context.popupRef,onComplete(){f&&a.context.onOpenChangeComplete?.(!0)}});const b=a.useState("disabled"),S=a.useState("closeDelay");return eR(x,{enabled:!b,closeDelay:S}),jt("div",t,{state:{open:f,side:c,align:u,instant:m,transitionStatus:p},ref:[n,a.context.popupRef,a.useStateSetter("popupElement")],props:[y,ru(p),s],stateAttributesMapping:SB})}),kB=w.forwardRef(function(t,n){const{className:r,render:i,...s}=t,c=kf().useState("instantType"),{open:u,arrowRef:f,side:m,align:p,arrowUncentered:y,arrowStyles:x}=aR();return jt("div",t,{state:{open:u,side:m,align:p,uncentered:y,instant:c},ref:[n,f],props:[{style:x,"aria-hidden":!0},s],stateAttributesMapping:Ss})}),EB=function(t){const{delay:n,closeDelay:r,timeout:i=400}=t,s=w.useMemo(()=>({delay:n,closeDelay:r}),[n,r]),a=w.useMemo(()=>({open:n,close:r}),[n,r]);return h.jsx(iR.Provider,{value:s,children:h.jsx($P,{delay:a,timeoutMs:i,children:t.children})})};function Vb(e){return Cb(19)?e:e?"true":void 0}function dR(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=dR(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function fR(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=dR(e))&&(r&&(r+=" "),r+=t);return r}const TB=(e,t)=>{const n=new Array(e.length+t.length);for(let r=0;r<e.length;r++)n[r]=e[r];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},NB=(e,t)=>({classGroupId:e,validator:t}),hR=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Nm="-",Uk=[],RB="arbitrary..",AB=e=>{const t=jB(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:a=>{if(a.startsWith("[")&&a.endsWith("]"))return OB(a);const c=a.split(Nm),u=c[0]===""&&c.length>1?1:0;return pR(c,u,t)},getConflictingClassGroupIds:(a,c)=>{if(c){const u=r[a],f=n[a];return u?f?TB(f,u):u:f||Uk}return n[a]||Uk}}},pR=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const i=e[t],s=n.nextPart.get(i);if(s){const f=pR(e,t+1,s);if(f)return f}const a=n.validators;if(a===null)return;const c=t===0?e.join(Nm):e.slice(t).join(Nm),u=a.length;for(let f=0;f<u;f++){const m=a[f];if(m.validator(c))return m.classGroupId}},OB=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),r=t.slice(0,n);return r?RB+r:void 0})(),jB=e=>{const{theme:t,classGroups:n}=e;return MB(n,t)},MB=(e,t)=>{const n=hR();for(const r in e){const i=e[r];qb(i,n,r,t)}return n},qb=(e,t,n,r)=>{const i=e.length;for(let s=0;s<i;s++){const a=e[s];DB(a,t,n,r)}},DB=(e,t,n,r)=>{if(typeof e=="string"){_B(e,t,n);return}if(typeof e=="function"){LB(e,t,n,r);return}IB(e,t,n,r)},_B=(e,t,n)=>{const r=e===""?t:mR(t,e);r.classGroupId=n},LB=(e,t,n,r)=>{if(PB(e)){qb(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(NB(n,e))},IB=(e,t,n,r)=>{const i=Object.entries(e),s=i.length;for(let a=0;a<s;a++){const[c,u]=i[a];qb(u,mR(t,c),n,r)}},mR=(e,t)=>{let n=e;const r=t.split(Nm),i=r.length;for(let s=0;s<i;s++){const a=r[s];let c=n.nextPart.get(a);c||(c=hR(),n.nextPart.set(a,c)),n=c}return n},PB=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,zB=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const i=(s,a)=>{n[s]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(s){let a=n[s];if(a!==void 0)return a;if((a=r[s])!==void 0)return i(s,a),a},set(s,a){s in n?n[s]=a:i(s,a)}}},Ky="!",Vk=":",FB=[],qk=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),BB=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=i=>{const s=[];let a=0,c=0,u=0,f;const m=i.length;for(let S=0;S<m;S++){const k=i[S];if(a===0&&c===0){if(k===Vk){s.push(i.slice(u,S)),u=S+1;continue}if(k==="/"){f=S;continue}}k==="["?a++:k==="]"?a--:k==="("?c++:k===")"&&c--}const p=s.length===0?i:i.slice(u);let y=p,x=!1;p.endsWith(Ky)?(y=p.slice(0,-1),x=!0):p.startsWith(Ky)&&(y=p.slice(1),x=!0);const b=f&&f>u?f-u:void 0;return qk(s,x,y,b)};if(t){const i=t+Vk,s=r;r=a=>a.startsWith(i)?s(a.slice(i.length)):qk(FB,!1,a,void 0,!0)}if(n){const i=r;r=s=>n({className:s,parseClassName:i})}return r},HB=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let i=[];for(let s=0;s<n.length;s++){const a=n[s],c=a[0]==="[",u=t.has(a);c||u?(i.length>0&&(i.sort(),r.push(...i),i=[]),r.push(a)):i.push(a)}return i.length>0&&(i.sort(),r.push(...i)),r}},UB=e=>({cache:zB(e.cacheSize),parseClassName:BB(e),sortModifiers:HB(e),...AB(e)}),VB=/\s+/,qB=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:s}=t,a=[],c=e.trim().split(VB);let u="";for(let f=c.length-1;f>=0;f-=1){const m=c[f],{isExternal:p,modifiers:y,hasImportantModifier:x,baseClassName:b,maybePostfixModifierPosition:S}=n(m);if(p){u=m+(u.length>0?" "+u:u);continue}let k=!!S,E=r(k?b.substring(0,S):b);if(!E){if(!k){u=m+(u.length>0?" "+u:u);continue}if(E=r(b),!E){u=m+(u.length>0?" "+u:u);continue}k=!1}const T=y.length===0?"":y.length===1?y[0]:s(y).join(":"),N=x?T+Ky:T,j=N+E;if(a.indexOf(j)>-1)continue;a.push(j);const O=i(E,k);for(let A=0;A<O.length;++A){const R=O[A];a.push(N+R)}u=m+(u.length>0?" "+u:u)}return u},$B=(...e)=>{let t=0,n,r,i="";for(;t<e.length;)(n=e[t++])&&(r=gR(n))&&(i&&(i+=" "),i+=r);return i},gR=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=gR(e[r]))&&(n&&(n+=" "),n+=t);return n},YB=(e,...t)=>{let n,r,i,s;const a=u=>{const f=t.reduce((m,p)=>p(m),e());return n=UB(f),r=n.cache.get,i=n.cache.set,s=c,c(u)},c=u=>{const f=r(u);if(f)return f;const m=qB(u,n);return i(u,m),m};return s=a,(...u)=>s($B(...u))},WB=[],ar=e=>{const t=n=>n[e]||WB;return t.isThemeGetter=!0,t},yR=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,xR=/^\((?:(\w[\w-]*):)?(.+)\)$/i,GB=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,KB=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,QB=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,XB=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,ZB=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,JB=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Qs=e=>GB.test(e),Lt=e=>!!e&&!Number.isNaN(Number(e)),Xs=e=>!!e&&Number.isInteger(Number(e)),_2=e=>e.endsWith("%")&&Lt(e.slice(0,-1)),ts=e=>KB.test(e),bR=()=>!0,eH=e=>QB.test(e)&&!XB.test(e),$b=()=>!1,tH=e=>ZB.test(e),nH=e=>JB.test(e),rH=e=>!it(e)&&!ot(e),iH=e=>Ca(e,SR,$b),it=e=>yR.test(e),Za=e=>Ca(e,CR,eH),$k=e=>Ca(e,fH,Lt),oH=e=>Ca(e,ER,bR),sH=e=>Ca(e,kR,$b),Yk=e=>Ca(e,vR,$b),aH=e=>Ca(e,wR,nH),Ep=e=>Ca(e,TR,tH),ot=e=>xR.test(e),ud=e=>Cl(e,CR),lH=e=>Cl(e,kR),Wk=e=>Cl(e,vR),cH=e=>Cl(e,SR),uH=e=>Cl(e,wR),Tp=e=>Cl(e,TR,!0),dH=e=>Cl(e,ER,!0),Ca=(e,t,n)=>{const r=yR.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Cl=(e,t,n=!1)=>{const r=xR.exec(e);return r?r[1]?t(r[1]):n:!1},vR=e=>e==="position"||e==="percentage",wR=e=>e==="image"||e==="url",SR=e=>e==="length"||e==="size"||e==="bg-size",CR=e=>e==="length",fH=e=>e==="number",kR=e=>e==="family-name",ER=e=>e==="number"||e==="weight",TR=e=>e==="shadow",hH=()=>{const e=ar("color"),t=ar("font"),n=ar("text"),r=ar("font-weight"),i=ar("tracking"),s=ar("leading"),a=ar("breakpoint"),c=ar("container"),u=ar("spacing"),f=ar("radius"),m=ar("shadow"),p=ar("inset-shadow"),y=ar("text-shadow"),x=ar("drop-shadow"),b=ar("blur"),S=ar("perspective"),k=ar("aspect"),E=ar("ease"),T=ar("animate"),N=()=>["auto","avoid","all","avoid-page","page","left","right","column"],j=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],O=()=>[...j(),ot,it],A=()=>["auto","hidden","clip","visible","scroll"],R=()=>["auto","contain","none"],L=()=>[ot,it,u],B=()=>[Qs,"full","auto",...L()],I=()=>[Xs,"none","subgrid",ot,it],U=()=>["auto",{span:["full",Xs,ot,it]},Xs,ot,it],Y=()=>[Xs,"auto",ot,it],V=()=>["auto","min","max","fr",ot,it],q=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],H=()=>["start","end","center","stretch","center-safe","end-safe"],z=()=>["auto",...L()],$=()=>[Qs,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...L()],G=()=>[Qs,"screen","full","dvw","lvw","svw","min","max","fit",...L()],Q=()=>[Qs,"screen","full","lh","dvh","lvh","svh","min","max","fit",...L()],_=()=>[e,ot,it],P=()=>[...j(),Wk,Yk,{position:[ot,it]}],W=()=>["no-repeat",{repeat:["","x","y","space","round"]}],D=()=>["auto","cover","contain",cH,iH,{size:[ot,it]}],Z=()=>[_2,ud,Za],ee=()=>["","none","full",f,ot,it],J=()=>["",Lt,ud,Za],he=()=>["solid","dashed","dotted","double"],fe=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Se=()=>[Lt,_2,Wk,Yk],Ae=()=>["","none",b,ot,it],Oe=()=>["none",Lt,ot,it],Pe=()=>["none",Lt,ot,it],_e=()=>[Lt,ot,it],De=()=>[Qs,"full",...L()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[ts],breakpoint:[ts],color:[bR],container:[ts],"drop-shadow":[ts],ease:["in","out","in-out"],font:[rH],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[ts],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[ts],shadow:[ts],spacing:["px",Lt],text:[ts],"text-shadow":[ts],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Qs,it,ot,k]}],container:["container"],columns:[{columns:[Lt,it,ot,c]}],"break-after":[{"break-after":N()}],"break-before":[{"break-before":N()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:O()}],overflow:[{overflow:A()}],"overflow-x":[{"overflow-x":A()}],"overflow-y":[{"overflow-y":A()}],overscroll:[{overscroll:R()}],"overscroll-x":[{"overscroll-x":R()}],"overscroll-y":[{"overscroll-y":R()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:B()}],"inset-x":[{"inset-x":B()}],"inset-y":[{"inset-y":B()}],start:[{"inset-s":B(),start:B()}],end:[{"inset-e":B(),end:B()}],"inset-bs":[{"inset-bs":B()}],"inset-be":[{"inset-be":B()}],top:[{top:B()}],right:[{right:B()}],bottom:[{bottom:B()}],left:[{left:B()}],visibility:["visible","invisible","collapse"],z:[{z:[Xs,"auto",ot,it]}],basis:[{basis:[Qs,"full","auto",c,...L()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Lt,Qs,"auto","initial","none",it]}],grow:[{grow:["",Lt,ot,it]}],shrink:[{shrink:["",Lt,ot,it]}],order:[{order:[Xs,"first","last","none",ot,it]}],"grid-cols":[{"grid-cols":I()}],"col-start-end":[{col:U()}],"col-start":[{"col-start":Y()}],"col-end":[{"col-end":Y()}],"grid-rows":[{"grid-rows":I()}],"row-start-end":[{row:U()}],"row-start":[{"row-start":Y()}],"row-end":[{"row-end":Y()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":V()}],"auto-rows":[{"auto-rows":V()}],gap:[{gap:L()}],"gap-x":[{"gap-x":L()}],"gap-y":[{"gap-y":L()}],"justify-content":[{justify:[...q(),"normal"]}],"justify-items":[{"justify-items":[...H(),"normal"]}],"justify-self":[{"justify-self":["auto",...H()]}],"align-content":[{content:["normal",...q()]}],"align-items":[{items:[...H(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...H(),{baseline:["","last"]}]}],"place-content":[{"place-content":q()}],"place-items":[{"place-items":[...H(),"baseline"]}],"place-self":[{"place-self":["auto",...H()]}],p:[{p:L()}],px:[{px:L()}],py:[{py:L()}],ps:[{ps:L()}],pe:[{pe:L()}],pbs:[{pbs:L()}],pbe:[{pbe:L()}],pt:[{pt:L()}],pr:[{pr:L()}],pb:[{pb:L()}],pl:[{pl:L()}],m:[{m:z()}],mx:[{mx:z()}],my:[{my:z()}],ms:[{ms:z()}],me:[{me:z()}],mbs:[{mbs:z()}],mbe:[{mbe:z()}],mt:[{mt:z()}],mr:[{mr:z()}],mb:[{mb:z()}],ml:[{ml:z()}],"space-x":[{"space-x":L()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":L()}],"space-y-reverse":["space-y-reverse"],size:[{size:$()}],"inline-size":[{inline:["auto",...G()]}],"min-inline-size":[{"min-inline":["auto",...G()]}],"max-inline-size":[{"max-inline":["none",...G()]}],"block-size":[{block:["auto",...Q()]}],"min-block-size":[{"min-block":["auto",...Q()]}],"max-block-size":[{"max-block":["none",...Q()]}],w:[{w:[c,"screen",...$()]}],"min-w":[{"min-w":[c,"screen","none",...$()]}],"max-w":[{"max-w":[c,"screen","none","prose",{screen:[a]},...$()]}],h:[{h:["screen","lh",...$()]}],"min-h":[{"min-h":["screen","lh","none",...$()]}],"max-h":[{"max-h":["screen","lh",...$()]}],"font-size":[{text:["base",n,ud,Za]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,dH,oH]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",_2,it]}],"font-family":[{font:[lH,sH,t]}],"font-features":[{"font-features":[it]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[i,ot,it]}],"line-clamp":[{"line-clamp":[Lt,"none",ot,$k]}],leading:[{leading:[s,...L()]}],"list-image":[{"list-image":["none",ot,it]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ot,it]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:_()}],"text-color":[{text:_()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...he(),"wavy"]}],"text-decoration-thickness":[{decoration:[Lt,"from-font","auto",ot,Za]}],"text-decoration-color":[{decoration:_()}],"underline-offset":[{"underline-offset":[Lt,"auto",ot,it]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:L()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ot,it]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ot,it]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:P()}],"bg-repeat":[{bg:W()}],"bg-size":[{bg:D()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Xs,ot,it],radial:["",ot,it],conic:[Xs,ot,it]},uH,aH]}],"bg-color":[{bg:_()}],"gradient-from-pos":[{from:Z()}],"gradient-via-pos":[{via:Z()}],"gradient-to-pos":[{to:Z()}],"gradient-from":[{from:_()}],"gradient-via":[{via:_()}],"gradient-to":[{to:_()}],rounded:[{rounded:ee()}],"rounded-s":[{"rounded-s":ee()}],"rounded-e":[{"rounded-e":ee()}],"rounded-t":[{"rounded-t":ee()}],"rounded-r":[{"rounded-r":ee()}],"rounded-b":[{"rounded-b":ee()}],"rounded-l":[{"rounded-l":ee()}],"rounded-ss":[{"rounded-ss":ee()}],"rounded-se":[{"rounded-se":ee()}],"rounded-ee":[{"rounded-ee":ee()}],"rounded-es":[{"rounded-es":ee()}],"rounded-tl":[{"rounded-tl":ee()}],"rounded-tr":[{"rounded-tr":ee()}],"rounded-br":[{"rounded-br":ee()}],"rounded-bl":[{"rounded-bl":ee()}],"border-w":[{border:J()}],"border-w-x":[{"border-x":J()}],"border-w-y":[{"border-y":J()}],"border-w-s":[{"border-s":J()}],"border-w-e":[{"border-e":J()}],"border-w-bs":[{"border-bs":J()}],"border-w-be":[{"border-be":J()}],"border-w-t":[{"border-t":J()}],"border-w-r":[{"border-r":J()}],"border-w-b":[{"border-b":J()}],"border-w-l":[{"border-l":J()}],"divide-x":[{"divide-x":J()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":J()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...he(),"hidden","none"]}],"divide-style":[{divide:[...he(),"hidden","none"]}],"border-color":[{border:_()}],"border-color-x":[{"border-x":_()}],"border-color-y":[{"border-y":_()}],"border-color-s":[{"border-s":_()}],"border-color-e":[{"border-e":_()}],"border-color-bs":[{"border-bs":_()}],"border-color-be":[{"border-be":_()}],"border-color-t":[{"border-t":_()}],"border-color-r":[{"border-r":_()}],"border-color-b":[{"border-b":_()}],"border-color-l":[{"border-l":_()}],"divide-color":[{divide:_()}],"outline-style":[{outline:[...he(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Lt,ot,it]}],"outline-w":[{outline:["",Lt,ud,Za]}],"outline-color":[{outline:_()}],shadow:[{shadow:["","none",m,Tp,Ep]}],"shadow-color":[{shadow:_()}],"inset-shadow":[{"inset-shadow":["none",p,Tp,Ep]}],"inset-shadow-color":[{"inset-shadow":_()}],"ring-w":[{ring:J()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:_()}],"ring-offset-w":[{"ring-offset":[Lt,Za]}],"ring-offset-color":[{"ring-offset":_()}],"inset-ring-w":[{"inset-ring":J()}],"inset-ring-color":[{"inset-ring":_()}],"text-shadow":[{"text-shadow":["none",y,Tp,Ep]}],"text-shadow-color":[{"text-shadow":_()}],opacity:[{opacity:[Lt,ot,it]}],"mix-blend":[{"mix-blend":[...fe(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":fe()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Lt]}],"mask-image-linear-from-pos":[{"mask-linear-from":Se()}],"mask-image-linear-to-pos":[{"mask-linear-to":Se()}],"mask-image-linear-from-color":[{"mask-linear-from":_()}],"mask-image-linear-to-color":[{"mask-linear-to":_()}],"mask-image-t-from-pos":[{"mask-t-from":Se()}],"mask-image-t-to-pos":[{"mask-t-to":Se()}],"mask-image-t-from-color":[{"mask-t-from":_()}],"mask-image-t-to-color":[{"mask-t-to":_()}],"mask-image-r-from-pos":[{"mask-r-from":Se()}],"mask-image-r-to-pos":[{"mask-r-to":Se()}],"mask-image-r-from-color":[{"mask-r-from":_()}],"mask-image-r-to-color":[{"mask-r-to":_()}],"mask-image-b-from-pos":[{"mask-b-from":Se()}],"mask-image-b-to-pos":[{"mask-b-to":Se()}],"mask-image-b-from-color":[{"mask-b-from":_()}],"mask-image-b-to-color":[{"mask-b-to":_()}],"mask-image-l-from-pos":[{"mask-l-from":Se()}],"mask-image-l-to-pos":[{"mask-l-to":Se()}],"mask-image-l-from-color":[{"mask-l-from":_()}],"mask-image-l-to-color":[{"mask-l-to":_()}],"mask-image-x-from-pos":[{"mask-x-from":Se()}],"mask-image-x-to-pos":[{"mask-x-to":Se()}],"mask-image-x-from-color":[{"mask-x-from":_()}],"mask-image-x-to-color":[{"mask-x-to":_()}],"mask-image-y-from-pos":[{"mask-y-from":Se()}],"mask-image-y-to-pos":[{"mask-y-to":Se()}],"mask-image-y-from-color":[{"mask-y-from":_()}],"mask-image-y-to-color":[{"mask-y-to":_()}],"mask-image-radial":[{"mask-radial":[ot,it]}],"mask-image-radial-from-pos":[{"mask-radial-from":Se()}],"mask-image-radial-to-pos":[{"mask-radial-to":Se()}],"mask-image-radial-from-color":[{"mask-radial-from":_()}],"mask-image-radial-to-color":[{"mask-radial-to":_()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":j()}],"mask-image-conic-pos":[{"mask-conic":[Lt]}],"mask-image-conic-from-pos":[{"mask-conic-from":Se()}],"mask-image-conic-to-pos":[{"mask-conic-to":Se()}],"mask-image-conic-from-color":[{"mask-conic-from":_()}],"mask-image-conic-to-color":[{"mask-conic-to":_()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:P()}],"mask-repeat":[{mask:W()}],"mask-size":[{mask:D()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ot,it]}],filter:[{filter:["","none",ot,it]}],blur:[{blur:Ae()}],brightness:[{brightness:[Lt,ot,it]}],contrast:[{contrast:[Lt,ot,it]}],"drop-shadow":[{"drop-shadow":["","none",x,Tp,Ep]}],"drop-shadow-color":[{"drop-shadow":_()}],grayscale:[{grayscale:["",Lt,ot,it]}],"hue-rotate":[{"hue-rotate":[Lt,ot,it]}],invert:[{invert:["",Lt,ot,it]}],saturate:[{saturate:[Lt,ot,it]}],sepia:[{sepia:["",Lt,ot,it]}],"backdrop-filter":[{"backdrop-filter":["","none",ot,it]}],"backdrop-blur":[{"backdrop-blur":Ae()}],"backdrop-brightness":[{"backdrop-brightness":[Lt,ot,it]}],"backdrop-contrast":[{"backdrop-contrast":[Lt,ot,it]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Lt,ot,it]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Lt,ot,it]}],"backdrop-invert":[{"backdrop-invert":["",Lt,ot,it]}],"backdrop-opacity":[{"backdrop-opacity":[Lt,ot,it]}],"backdrop-saturate":[{"backdrop-saturate":[Lt,ot,it]}],"backdrop-sepia":[{"backdrop-sepia":["",Lt,ot,it]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":L()}],"border-spacing-x":[{"border-spacing-x":L()}],"border-spacing-y":[{"border-spacing-y":L()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ot,it]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Lt,"initial",ot,it]}],ease:[{ease:["linear","initial",E,ot,it]}],delay:[{delay:[Lt,ot,it]}],animate:[{animate:["none",T,ot,it]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[S,ot,it]}],"perspective-origin":[{"perspective-origin":O()}],rotate:[{rotate:Oe()}],"rotate-x":[{"rotate-x":Oe()}],"rotate-y":[{"rotate-y":Oe()}],"rotate-z":[{"rotate-z":Oe()}],scale:[{scale:Pe()}],"scale-x":[{"scale-x":Pe()}],"scale-y":[{"scale-y":Pe()}],"scale-z":[{"scale-z":Pe()}],"scale-3d":["scale-3d"],skew:[{skew:_e()}],"skew-x":[{"skew-x":_e()}],"skew-y":[{"skew-y":_e()}],transform:[{transform:[ot,it,"","none","gpu","cpu"]}],"transform-origin":[{origin:O()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:De()}],"translate-x":[{"translate-x":De()}],"translate-y":[{"translate-y":De()}],"translate-z":[{"translate-z":De()}],"translate-none":["translate-none"],accent:[{accent:_()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:_()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ot,it]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":L()}],"scroll-mx":[{"scroll-mx":L()}],"scroll-my":[{"scroll-my":L()}],"scroll-ms":[{"scroll-ms":L()}],"scroll-me":[{"scroll-me":L()}],"scroll-mbs":[{"scroll-mbs":L()}],"scroll-mbe":[{"scroll-mbe":L()}],"scroll-mt":[{"scroll-mt":L()}],"scroll-mr":[{"scroll-mr":L()}],"scroll-mb":[{"scroll-mb":L()}],"scroll-ml":[{"scroll-ml":L()}],"scroll-p":[{"scroll-p":L()}],"scroll-px":[{"scroll-px":L()}],"scroll-py":[{"scroll-py":L()}],"scroll-ps":[{"scroll-ps":L()}],"scroll-pe":[{"scroll-pe":L()}],"scroll-pbs":[{"scroll-pbs":L()}],"scroll-pbe":[{"scroll-pbe":L()}],"scroll-pt":[{"scroll-pt":L()}],"scroll-pr":[{"scroll-pr":L()}],"scroll-pb":[{"scroll-pb":L()}],"scroll-pl":[{"scroll-pl":L()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ot,it]}],fill:[{fill:["none",..._()]}],"stroke-w":[{stroke:[Lt,ud,Za,$k]}],stroke:[{stroke:["none",..._()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},pH=YB(hH);function ae(...e){return pH(fR(e))}function Yb({delay:e=0,...t}){return h.jsx(EB,{"data-slot":"tooltip-provider",delay:e,...t})}function ms({...e}){return h.jsx(rB,{"data-slot":"tooltip",...e})}function gs({...e}){return h.jsx(hB,{"data-slot":"tooltip-trigger",...e})}function ys({className:e,side:t="top",sideOffset:n=4,align:r="center",alignOffset:i=0,children:s,...a}){return h.jsx(gB,{children:h.jsx(wB,{align:r,alignOffset:i,side:t,sideOffset:n,className:"isolate z-50",children:h.jsxs(CB,{"data-slot":"tooltip-content",className:ae("z-50 inline-flex w-fit max-w-xs origin-(--transform-origin) items-center gap-1.5 rounded-md bg-popover px-3 py-1.5 text-xs text-foreground has-data-[slot=kbd]:pr-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",e),...a,children:[s,h.jsx(kB,{className:"z-50 size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-[2px] bg-popover fill-foreground data-[side=bottom]:top-1 data-[side=inline-end]:top-1/2! data-[side=inline-end]:-left-1 data-[side=inline-end]:-translate-y-1/2 data-[side=inline-start]:top-1/2! data-[side=inline-start]:-right-1 data-[side=inline-start]:-translate-y-1/2 data-[side=left]:top-1/2! data-[side=left]:-right-1 data-[side=left]:-translate-y-1/2 data-[side=right]:top-1/2! data-[side=right]:-left-1 data-[side=right]:-translate-y-1/2 data-[side=top]:-bottom-2.5"})]})})})}var iu=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},mH={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},gH=class{#e=mH;#t=!1;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}},sl=new gH;function yH(e){setTimeout(e,0)}var pl=typeof window>"u"||"Deno"in globalThis;function zr(){}function xH(e,t){return typeof e=="function"?e(t):e}function Qy(e){return typeof e=="number"&&e>=0&&e!==1/0}function NR(e,t){return Math.max(e+(t||0)-Date.now(),0)}function ha(e,t){return typeof e=="function"?e(t):e}function Hi(e,t){return typeof e=="function"?e(t):e}function Gk(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:s,queryKey:a,stale:c}=e;if(a){if(r){if(t.queryHash!==Wb(a,t.options))return!1}else if(!rf(t.queryKey,a))return!1}if(n!=="all"){const u=t.isActive();if(n==="active"&&!u||n==="inactive"&&u)return!1}return!(typeof c=="boolean"&&t.isStale()!==c||i&&i!==t.state.fetchStatus||s&&!s(t))}function Kk(e,t){const{exact:n,status:r,predicate:i,mutationKey:s}=e;if(s){if(!t.options.mutationKey)return!1;if(n){if(ml(t.options.mutationKey)!==ml(s))return!1}else if(!rf(t.options.mutationKey,s))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function Wb(e,t){return(t?.queryKeyHashFn||ml)(e)}function ml(e){return JSON.stringify(e,(t,n)=>Xy(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function rf(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>rf(e[n],t[n])):!1}var bH=Object.prototype.hasOwnProperty;function RR(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=Qk(e)&&Qk(t);if(!r&&!(Xy(e)&&Xy(t)))return t;const s=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),c=a.length,u=r?new Array(c):{};let f=0;for(let m=0;m<c;m++){const p=r?m:a[m],y=e[p],x=t[p];if(y===x){u[p]=y,(r?m<s:bH.call(e,p))&&f++;continue}if(y===null||x===null||typeof y!="object"||typeof x!="object"){u[p]=x;continue}const b=RR(y,x,n+1);u[p]=b,b===y&&f++}return s===c&&f===s?e:u}function Rm(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function Qk(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Xy(e){if(!Xk(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!Xk(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Xk(e){return Object.prototype.toString.call(e)==="[object Object]"}function vH(e){return new Promise(t=>{sl.setTimeout(t,e)})}function Zy(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?RR(e,t):t}function wH(e){return e}function SH(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function CH(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Gb=Symbol();function AR(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===Gb?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Kb(e,t){return typeof e=="function"?e(...t):!!e}function kH(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r||(r=!0,i.aborted?n():i.addEventListener("abort",n,{once:!0})),i)}),e}var EH=class extends iu{#e;#t;#n;constructor(){super(),this.#n=e=>{if(!pl&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(t=>{typeof t=="boolean"?this.setFocused(t):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},Qb=new EH;function Jy(){let e,t;const n=new Promise((i,s)=>{e=i,t=s});n.status="pending",n.catch(()=>{});function r(i){Object.assign(n,i),delete n.resolve,delete n.reject}return n.resolve=i=>{r({status:"fulfilled",value:i}),e(i)},n.reject=i=>{r({status:"rejected",reason:i}),t(i)},n}var TH=yH;function NH(){let e=[],t=0,n=c=>{c()},r=c=>{c()},i=TH;const s=c=>{t?e.push(c):i(()=>{n(c)})},a=()=>{const c=e;e=[],c.length&&i(()=>{r(()=>{c.forEach(u=>{n(u)})})})};return{batch:c=>{let u;t++;try{u=c()}finally{t--,t||a()}return u},batchCalls:c=>(...u)=>{s(()=>{c(...u)})},schedule:s,setNotifyFunction:c=>{n=c},setBatchNotifyFunction:c=>{r=c},setScheduler:c=>{i=c}}}var lr=NH(),RH=class extends iu{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(!pl&&window.addEventListener){const t=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(n=>{n(e)}))}isOnline(){return this.#e}},Am=new RH;function AH(e){return Math.min(1e3*2**e,3e4)}function OR(e){return(e??"online")==="online"?Am.isOnline():!0}var ex=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function jR(e){let t=!1,n=0,r;const i=Jy(),s=()=>i.status!=="pending",a=S=>{if(!s()){const k=new ex(S);y(k),e.onCancel?.(k)}},c=()=>{t=!0},u=()=>{t=!1},f=()=>Qb.isFocused()&&(e.networkMode==="always"||Am.isOnline())&&e.canRun(),m=()=>OR(e.networkMode)&&e.canRun(),p=S=>{s()||(r?.(),i.resolve(S))},y=S=>{s()||(r?.(),i.reject(S))},x=()=>new Promise(S=>{r=k=>{(s()||f())&&S(k)},e.onPause?.()}).then(()=>{r=void 0,s()||e.onContinue?.()}),b=()=>{if(s())return;let S;const k=n===0?e.initialPromise:void 0;try{S=k??e.fn()}catch(E){S=Promise.reject(E)}Promise.resolve(S).then(p).catch(E=>{if(s())return;const T=e.retry??(pl?0:3),N=e.retryDelay??AH,j=typeof N=="function"?N(n,E):N,O=T===!0||typeof T=="number"&&n<T||typeof T=="function"&&T(n,E);if(t||!O){y(E);return}n++,e.onFail?.(n,E),vH(j).then(()=>f()?void 0:x()).then(()=>{t?y(E):b()})})};return{promise:i,status:()=>i.status,cancel:a,continue:()=>(r?.(),i),cancelRetry:c,continueRetry:u,canStart:m,start:()=>(m()?b():x().then(b),i)}}var MR=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Qy(this.gcTime)&&(this.#e=sl.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(pl?1/0:300*1e3))}clearGcTimeout(){this.#e&&(sl.clearTimeout(this.#e),this.#e=void 0)}},OH=class extends MR{#e;#t;#n;#i;#r;#s;#a;constructor(e){super(),this.#a=!1,this.#s=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#n=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=Jk(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#r?.promise}setOptions(e){if(this.options={...this.#s,...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const t=Jk(this.options);t.data!==void 0&&(this.setState(Zk(t.data,t.dataUpdatedAt)),this.#e=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(e,t){const n=Zy(this.state.data,e,this.options);return this.#o({data:n,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#o({type:"setState",state:e,setStateOptions:t})}cancel(e){const t=this.#r?.promise;return this.#r?.cancel(e),t?t.then(zr).catch(zr):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(e=>Hi(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Gb||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>ha(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!NR(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#r?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#r?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#r&&(this.#a?this.#r.cancel({revert:!0}):this.#r.cancelRetry()),this.scheduleGc()),this.#n.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#o({type:"invalidate"})}async fetch(e,t){if(this.state.fetchStatus!=="idle"&&this.#r?.status()!=="rejected"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#r)return this.#r.continueRetry(),this.#r.promise}if(e&&this.setOptions(e),!this.options.queryFn){const c=this.observers.find(u=>u.options.queryFn);c&&this.setOptions(c.options)}const n=new AbortController,r=c=>{Object.defineProperty(c,"signal",{enumerable:!0,get:()=>(this.#a=!0,n.signal)})},i=()=>{const c=AR(this.options,t),f=(()=>{const m={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(m),m})();return this.#a=!1,this.options.persister?this.options.persister(c,f,this):c(f)},a=(()=>{const c={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(c),c})();this.options.behavior?.onFetch(a,this),this.#t=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#o({type:"fetch",meta:a.fetchOptions?.meta}),this.#r=jR({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:c=>{c instanceof ex&&c.revert&&this.setState({...this.#t,fetchStatus:"idle"}),n.abort()},onFail:(c,u)=>{this.#o({type:"failed",failureCount:c,error:u})},onPause:()=>{this.#o({type:"pause"})},onContinue:()=>{this.#o({type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{const c=await this.#r.start();if(c===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(c),this.#n.config.onSuccess?.(c,this),this.#n.config.onSettled?.(c,this.state.error,this),c}catch(c){if(c instanceof ex){if(c.silent)return this.#r.promise;if(c.revert){if(this.state.data===void 0)throw c;return this.state.data}}throw this.#o({type:"error",error:c}),this.#n.config.onError?.(c,this),this.#n.config.onSettled?.(this.state.data,c,this),c}finally{this.scheduleGc()}}#o(e){const t=n=>{switch(e.type){case"failed":return{...n,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...DR(n.data,this.options),fetchMeta:e.meta??null};case"success":const r={...n,...Zk(e.data,e.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#t=e.manual?r:void 0,r;case"error":const i=e.error;return{...n,error:i,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...e.state}}};this.state=t(this.state),lr.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:e})})}};function DR(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:OR(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Zk(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Jk(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var _R=class extends iu{constructor(e,t){super(),this.options=t,this.#e=e,this.#o=null,this.#a=Jy(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#i=void 0;#r;#s;#a;#o;#m;#f;#h;#c;#u;#l;#p=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),eE(this.#t,this.options)?this.#d():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return tx(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return tx(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#v(),this.#w(),this.#t.removeObserver(this)}setOptions(e){const t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Hi(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#S(),this.#t.setOptions(this.options),t._defaulted&&!Rm(this.options,t)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const r=this.hasListeners();r&&tE(this.#t,n,this.options,t)&&this.#d(),this.updateResult(),r&&(this.#t!==n||Hi(this.options.enabled,this.#t)!==Hi(t.enabled,this.#t)||ha(this.options.staleTime,this.#t)!==ha(t.staleTime,this.#t))&&this.#g();const i=this.#y();r&&(this.#t!==n||Hi(this.options.enabled,this.#t)!==Hi(t.enabled,this.#t)||i!==this.#l)&&this.#x(i)}getOptimisticResult(e){const t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return MH(this,n)&&(this.#i=n,this.#s=this.options,this.#r=this.#t.state),n}getCurrentResult(){return this.#i}trackResult(e,t){return new Proxy(e,{get:(n,r)=>(this.trackProp(r),t?.(r),r==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#a.status==="pending"&&this.#a.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(n,r))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#d({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#i))}#d(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(zr)),t}#g(){this.#v();const e=ha(this.options.staleTime,this.#t);if(pl||this.#i.isStale||!Qy(e))return;const n=NR(this.#i.dataUpdatedAt,e)+1;this.#c=sl.setTimeout(()=>{this.#i.isStale||this.updateResult()},n)}#y(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#x(e){this.#w(),this.#l=e,!(pl||Hi(this.options.enabled,this.#t)===!1||!Qy(this.#l)||this.#l===0)&&(this.#u=sl.setInterval(()=>{(this.options.refetchIntervalInBackground||Qb.isFocused())&&this.#d()},this.#l))}#b(){this.#g(),this.#x(this.#y())}#v(){this.#c&&(sl.clearTimeout(this.#c),this.#c=void 0)}#w(){this.#u&&(sl.clearInterval(this.#u),this.#u=void 0)}createResult(e,t){const n=this.#t,r=this.options,i=this.#i,s=this.#r,a=this.#s,u=e!==n?e.state:this.#n,{state:f}=e;let m={...f},p=!1,y;if(t._optimisticResults){const L=this.hasListeners(),B=!L&&eE(e,t),I=L&&tE(e,n,t,r);(B||I)&&(m={...m,...DR(f.data,e.options)}),t._optimisticResults==="isRestoring"&&(m.fetchStatus="idle")}let{error:x,errorUpdatedAt:b,status:S}=m;y=m.data;let k=!1;if(t.placeholderData!==void 0&&y===void 0&&S==="pending"){let L;i?.isPlaceholderData&&t.placeholderData===a?.placeholderData?(L=i.data,k=!0):L=typeof t.placeholderData=="function"?t.placeholderData(this.#h?.state.data,this.#h):t.placeholderData,L!==void 0&&(S="success",y=Zy(i?.data,L,t),p=!0)}if(t.select&&y!==void 0&&!k)if(i&&y===s?.data&&t.select===this.#m)y=this.#f;else try{this.#m=t.select,y=t.select(y),y=Zy(i?.data,y,t),this.#f=y,this.#o=null}catch(L){this.#o=L}this.#o&&(x=this.#o,y=this.#f,b=Date.now(),S="error");const E=m.fetchStatus==="fetching",T=S==="pending",N=S==="error",j=T&&E,O=y!==void 0,R={status:S,fetchStatus:m.fetchStatus,isPending:T,isSuccess:S==="success",isError:N,isInitialLoading:j,isLoading:j,data:y,dataUpdatedAt:m.dataUpdatedAt,error:x,errorUpdatedAt:b,failureCount:m.fetchFailureCount,failureReason:m.fetchFailureReason,errorUpdateCount:m.errorUpdateCount,isFetched:m.dataUpdateCount>0||m.errorUpdateCount>0,isFetchedAfterMount:m.dataUpdateCount>u.dataUpdateCount||m.errorUpdateCount>u.errorUpdateCount,isFetching:E,isRefetching:E&&!T,isLoadingError:N&&!O,isPaused:m.fetchStatus==="paused",isPlaceholderData:p,isRefetchError:N&&O,isStale:Xb(e,t),refetch:this.refetch,promise:this.#a,isEnabled:Hi(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const L=R.data!==void 0,B=R.status==="error"&&!L,I=V=>{B?V.reject(R.error):L&&V.resolve(R.data)},U=()=>{const V=this.#a=R.promise=Jy();I(V)},Y=this.#a;switch(Y.status){case"pending":e.queryHash===n.queryHash&&I(Y);break;case"fulfilled":(B||R.data!==Y.value)&&U();break;case"rejected":(!B||R.error!==Y.reason)&&U();break}}return R}updateResult(){const e=this.#i,t=this.createResult(this.#t,this.options);if(this.#r=this.#t.state,this.#s=this.options,this.#r.data!==void 0&&(this.#h=this.#t),Rm(t,e))return;this.#i=t;const n=()=>{if(!e)return!0;const{notifyOnChangeProps:r}=this.options,i=typeof r=="function"?r():r;if(i==="all"||!i&&!this.#p.size)return!0;const s=new Set(i??this.#p);return this.options.throwOnError&&s.add("error"),Object.keys(this.#i).some(a=>{const c=a;return this.#i[c]!==e[c]&&s.has(c)})};this.#C({listeners:n()})}#S(){const e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;const t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#b()}#C(e){lr.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#i)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function jH(e,t){return Hi(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function eE(e,t){return jH(e,t)||e.state.data!==void 0&&tx(e,t,t.refetchOnMount)}function tx(e,t,n){if(Hi(t.enabled,e)!==!1&&ha(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&Xb(e,t)}return!1}function tE(e,t,n,r){return(e!==t||Hi(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&Xb(e,n)}function Xb(e,t){return Hi(t.enabled,e)!==!1&&e.isStaleByTime(ha(t.staleTime,e))}function MH(e,t){return!Rm(e.getCurrentResult(),t)}function Om(e){return{onFetch:(t,n)=>{const r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,s=t.state.data?.pages||[],a=t.state.data?.pageParams||[];let c={pages:[],pageParams:[]},u=0;const f=async()=>{let m=!1;const p=b=>{kH(b,()=>t.signal,()=>m=!0)},y=AR(t.options,t.fetchOptions),x=async(b,S,k)=>{if(m)return Promise.reject();if(S==null&&b.pages.length)return Promise.resolve(b);const T=(()=>{const A={client:t.client,queryKey:t.queryKey,pageParam:S,direction:k?"backward":"forward",meta:t.options.meta};return p(A),A})(),N=await y(T),{maxPages:j}=t.options,O=k?CH:SH;return{pages:O(b.pages,N,j),pageParams:O(b.pageParams,S,j)}};if(i&&s.length){const b=i==="backward",S=b?LR:nx,k={pages:s,pageParams:a},E=S(r,k);c=await x(k,E,b)}else{const b=e??s.length;do{const S=u===0?a[0]??r.initialPageParam:nx(r,c);if(u>0&&S==null)break;c=await x(c,S),u++}while(u<b)}return c};t.options.persister?t.fetchFn=()=>t.options.persister?.(f,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=f}}}function nx(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function LR(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}function DH(e,t){return t?nx(e,t)!=null:!1}function _H(e,t){return!t||!e.getPreviousPageParam?!1:LR(e,t)!=null}var LH=class extends _R{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){super.setOptions({...e,behavior:Om()})}getOptimisticResult(e){return e.behavior=Om(),super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"backward"}}})}createResult(e,t){const{state:n}=e,r=super.createResult(e,t),{isFetching:i,isRefetching:s,isError:a,isRefetchError:c}=r,u=n.fetchMeta?.fetchMore?.direction,f=a&&u==="forward",m=i&&u==="forward",p=a&&u==="backward",y=i&&u==="backward";return{...r,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:DH(t,n.data),hasPreviousPage:_H(t,n.data),isFetchNextPageError:f,isFetchingNextPage:m,isFetchPreviousPageError:p,isFetchingPreviousPage:y,isRefetchError:c&&!f&&!p,isRefetching:s&&!m&&!y}}},IH=class extends MR{#e;#t;#n;#i;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||IR(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#n.remove(this))}continue(){return this.#i?.continue()??this.execute(this.state.variables)}async execute(e){const t=()=>{this.#r({type:"continue"})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#i=jR({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(new Error("No mutationFn found")),onFail:(s,a)=>{this.#r({type:"failed",failureCount:s,error:a})},onPause:()=>{this.#r({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});const r=this.state.status==="pending",i=!this.#i.canStart();try{if(r)t();else{this.#r({type:"pending",variables:e,isPaused:i}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);const a=await this.options.onMutate?.(e,n);a!==this.state.context&&this.#r({type:"pending",context:a,variables:e,isPaused:i})}const s=await this.#i.start();return await this.#n.config.onSuccess?.(s,e,this.state.context,this,n),await this.options.onSuccess?.(s,e,this.state.context,n),await this.#n.config.onSettled?.(s,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(s,null,e,this.state.context,n),this.#r({type:"success",data:s}),s}catch(s){try{await this.#n.config.onError?.(s,e,this.state.context,this,n)}catch(a){Promise.reject(a)}try{await this.options.onError?.(s,e,this.state.context,n)}catch(a){Promise.reject(a)}try{await this.#n.config.onSettled?.(void 0,s,this.state.variables,this.state.context,this,n)}catch(a){Promise.reject(a)}try{await this.options.onSettled?.(void 0,s,e,this.state.context,n)}catch(a){Promise.reject(a)}throw this.#r({type:"error",error:s}),s}finally{this.#n.runNext(this)}}#r(e){const t=n=>{switch(e.type){case"failed":return{...n,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...n,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:e.error,failureCount:n.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),lr.batch(()=>{this.#t.forEach(n=>{n.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function IR(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var PH=class extends iu{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){const r=new IH({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);const t=Np(e);if(typeof t=="string"){const n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#e.delete(e)){const t=Np(e);if(typeof t=="string"){const n=this.#t.get(t);if(n)if(n.length>1){const r=n.indexOf(e);r!==-1&&n.splice(r,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=Np(e);if(typeof t=="string"){const r=this.#t.get(t)?.find(i=>i.state.status==="pending");return!r||r===e}else return!0}runNext(e){const t=Np(e);return typeof t=="string"?this.#t.get(t)?.find(r=>r!==e&&r.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){lr.batch(()=>{this.#e.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){const t={exact:!0,...e};return this.getAll().find(n=>Kk(t,n))}findAll(e={}){return this.getAll().filter(t=>Kk(e,t))}notify(e){lr.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return lr.batch(()=>Promise.all(e.map(t=>t.continue().catch(zr))))}};function Np(e){return e.options.scope?.id}var zH=class extends iu{#e;#t=void 0;#n;#i;constructor(t,n){super(),this.#e=t,this.setOptions(n),this.bindMethods(),this.#r()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){const n=this.options;this.options=this.#e.defaultMutationOptions(t),Rm(this.options,n)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),n?.mutationKey&&this.options.mutationKey&&ml(n.mutationKey)!==ml(this.options.mutationKey)?this.reset():this.#n?.state.status==="pending"&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(t){this.#r(),this.#s(t)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#r(),this.#s()}mutate(t,n){return this.#i=n,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(t)}#r(){const t=this.#n?.state??IR();this.#t={...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset}}#s(t){lr.batch(()=>{if(this.#i&&this.hasListeners()){const n=this.#t.variables,r=this.#t.context,i={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(t?.type==="success"){try{this.#i.onSuccess?.(t.data,n,r,i)}catch(s){Promise.reject(s)}try{this.#i.onSettled?.(t.data,null,n,r,i)}catch(s){Promise.reject(s)}}else if(t?.type==="error"){try{this.#i.onError?.(t.error,n,r,i)}catch(s){Promise.reject(s)}try{this.#i.onSettled?.(void 0,t.error,n,r,i)}catch(s){Promise.reject(s)}}}this.listeners.forEach(n=>{n(this.#t)})})}},FH=class extends iu{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){const r=t.queryKey,i=t.queryHash??Wb(r,t);let s=this.get(i);return s||(s=new OH({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(s)),s}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){lr.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){const t={exact:!0,...e};return this.getAll().find(n=>Gk(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>Gk(e,n)):t}notify(e){lr.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){lr.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){lr.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},BH=class{#e;#t;#n;#i;#r;#s;#a;#o;constructor(e={}){this.#e=e.queryCache||new FH,this.#t=e.mutationCache||new PH,this.#n=e.defaultOptions||{},this.#i=new Map,this.#r=new Map,this.#s=0}mount(){this.#s++,this.#s===1&&(this.#a=Qb.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#o=Am.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#s--,this.#s===0&&(this.#a?.(),this.#a=void 0,this.#o?.(),this.#o=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#t.findAll({...e,status:"pending"}).length}getQueryData(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(ha(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),s=this.#e.get(r.queryHash)?.state.data,a=xH(t,s);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return lr.batch(()=>this.#e.findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){const t=this.#e;lr.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=this.#e;return lr.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=lr.batch(()=>this.#e.findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(zr).catch(zr)}invalidateQueries(e,t={}){return lr.batch(()=>(this.#e.findAll(e).forEach(n=>{n.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=lr.batch(()=>this.#e.findAll(e).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let s=i.fetch(void 0,n);return n.throwOnError||(s=s.catch(zr)),i.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(r).then(zr)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=this.#e.build(this,t);return n.isStaleByTime(ha(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(zr).catch(zr)}fetchInfiniteQuery(e){return e.behavior=Om(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(zr).catch(zr)}ensureInfiniteQueryData(e){return e.behavior=Om(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Am.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#i.set(ml(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#i.values()],n={};return t.forEach(r=>{rf(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){this.#r.set(ml(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#r.values()],n={};return t.forEach(r=>{rf(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Wb(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===Gb&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},PR=w.createContext(void 0),un=e=>{const t=w.useContext(PR);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},HH=({client:e,children:t})=>(w.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),h.jsx(PR.Provider,{value:e,children:t})),zR=w.createContext(!1),UH=()=>w.useContext(zR);zR.Provider;function VH(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var qH=w.createContext(VH()),$H=()=>w.useContext(qH),YH=(e,t,n)=>{const r=n?.state.error&&typeof e.throwOnError=="function"?Kb(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},WH=e=>{w.useEffect(()=>{e.clearReset()},[e])},GH=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||Kb(n,[e.error,r])),KH=e=>{if(e.suspense){const n=i=>i==="static"?i:Math.max(i??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...i)=>n(r(...i)):n(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},QH=(e,t)=>e.isLoading&&e.isFetching&&!t,XH=(e,t)=>e?.suspense&&t.isPending,nE=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function FR(e,t,n){const r=UH(),i=$H(),s=un(),a=s.defaultQueryOptions(e);s.getDefaultOptions().queries?._experimental_beforeQuery?.(a);const c=s.getQueryCache().get(a.queryHash);a._optimisticResults=r?"isRestoring":"optimistic",KH(a),YH(a,i,c),WH(i);const u=!s.getQueryCache().get(a.queryHash),[f]=w.useState(()=>new t(s,a)),m=f.getOptimisticResult(a),p=!r&&e.subscribed!==!1;if(w.useSyncExternalStore(w.useCallback(y=>{const x=p?f.subscribe(lr.batchCalls(y)):zr;return f.updateResult(),x},[f,p]),()=>f.getCurrentResult(),()=>f.getCurrentResult()),w.useEffect(()=>{f.setOptions(a)},[a,f]),XH(a,m))throw nE(a,f,i);if(GH({result:m,errorResetBoundary:i,throwOnError:a.throwOnError,query:c,suspense:a.suspense}))throw m.error;return s.getDefaultOptions().queries?._experimental_afterQuery?.(a,m),a.experimental_prefetchInRender&&!pl&&QH(m,r)&&(u?nE(a,f,i):c?.promise)?.catch(zr).finally(()=>{f.updateResult()}),a.notifyOnChangeProps?m:f.trackResult(m)}function or(e,t){return FR(e,_R)}function dn(e,t){const n=un(),[r]=w.useState(()=>new zH(n,e));w.useEffect(()=>{r.setOptions(e)},[r,e]);const i=w.useSyncExternalStore(w.useCallback(a=>r.subscribe(lr.batchCalls(a)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),s=w.useCallback((a,c)=>{r.mutate(a,c).catch(zr)},[r]);if(i.error&&Kb(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:s,mutateAsync:i.mutate}}function ZH(e,t){return FR(e,LH)}const JH={queries:{gcTime:0,refetchOnWindowFocus:!1,retry:!1,staleTime:0}};function BR(e){return jt(e.defaultTagName??"div",e,e)}const rE=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,iE=fR,w0=(e,t)=>n=>{var r;if(t?.variants==null)return iE(e,n?.class,n?.className);const{variants:i,defaultVariants:s}=t,a=Object.keys(i).map(f=>{const m=n?.[f],p=s?.[f];if(m===null)return null;const y=rE(m)||rE(p);return i[f][y]}),c=n&&Object.entries(n).reduce((f,m)=>{let[p,y]=m;return y===void 0||(f[p]=y),f},{}),u=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((f,m)=>{let{class:p,className:y,...x}=m;return Object.entries(x).every(b=>{let[S,k]=b;return Array.isArray(k)?k.includes({...s,...c}[S]):{...s,...c}[S]===k})?[...f,p,y]:f},[]);return iE(e,a,u,n?.class,n?.className)},eU=w0("group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",destructive:"bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20",outline:"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",ghost:"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",link:"text-primary underline-offset-4 hover:underline"}},defaultVariants:{variant:"default"}});function uo({className:e,variant:t="default",render:n,...r}){return BR({defaultTagName:"span",props:jo({className:ae(eU({variant:t}),e)},r),render:n,state:{slot:"badge",variant:t}})}const Zb="/assets/logo-DJvq-PY2.svg",oE=e=>{let t;const n=new Set,r=(f,m)=>{const p=typeof f=="function"?f(t):f;if(!Object.is(p,t)){const y=t;t=m??(typeof p!="object"||p===null)?p:Object.assign({},t,p),n.forEach(x=>x(t,y))}},i=()=>t,c={setState:r,getState:i,getInitialState:()=>u,subscribe:f=>(n.add(f),()=>n.delete(f))},u=t=e(r,i,c);return c},tU=(e=>e?oE(e):oE),nU=e=>e;function rU(e,t=nU){const n=le.useSyncExternalStore(e.subscribe,le.useCallback(()=>t(e.getState()),[e,t]),le.useCallback(()=>t(e.getInitialState()),[e,t]));return le.useDebugValue(n),n}const sE=e=>{const t=tU(e),n=r=>rU(t,r);return Object.assign(n,t),n},kl=(e=>e?sE(e):sE);function S0(e,t){let n;try{n=e()}catch{return}return{getItem:i=>{var s;const a=u=>u===null?null:JSON.parse(u,void 0),c=(s=n.getItem(i))!=null?s:null;return c instanceof Promise?c.then(a):a(c)},setItem:(i,s)=>n.setItem(i,JSON.stringify(s,void 0)),removeItem:i=>n.removeItem(i)}}const rx=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(r){return rx(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return rx(r)(n)}}}},iU=(e,t)=>(n,r,i)=>{let s={storage:S0(()=>window.localStorage),partialize:k=>k,version:0,merge:(k,E)=>({...E,...k}),...t},a=!1,c=0;const u=new Set,f=new Set;let m=s.storage;if(!m)return e((...k)=>{console.warn(`[zustand persist middleware] Unable to update item '${s.name}', the given storage is currently unavailable.`),n(...k)},r,i);const p=()=>{const k=s.partialize({...r()});return m.setItem(s.name,{state:k,version:s.version})},y=i.setState;i.setState=(k,E)=>(y(k,E),p());const x=e((...k)=>(n(...k),p()),r,i);i.getInitialState=()=>x;let b;const S=()=>{var k,E;if(!m)return;const T=++c;a=!1,u.forEach(j=>{var O;return j((O=r())!=null?O:x)});const N=((E=s.onRehydrateStorage)==null?void 0:E.call(s,(k=r())!=null?k:x))||void 0;return rx(m.getItem.bind(m))(s.name).then(j=>{if(j)if(typeof j.version=="number"&&j.version!==s.version){if(s.migrate){const O=s.migrate(j.state,j.version);return O instanceof Promise?O.then(A=>[!0,A]):[!0,O]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,j.state];return[!1,void 0]}).then(j=>{var O;if(T!==c)return;const[A,R]=j;if(b=s.merge(R,(O=r())!=null?O:x),n(b,!0),A)return p()}).then(()=>{T===c&&(N?.(b,void 0),b=r(),a=!0,f.forEach(j=>j(b)))}).catch(j=>{T===c&&N?.(void 0,j)})};return i.persist={setOptions:k=>{s={...s,...k},k.storage&&(m=k.storage)},clearStorage:()=>{m?.removeItem(s.name)},getOptions:()=>s,rehydrate:()=>S(),hasHydrated:()=>a,onHydrate:k=>(u.add(k),()=>{u.delete(k)}),onFinishHydration:k=>(f.add(k),()=>{f.delete(k)})},s.skipHydration||S(),b||x},Jb=iU,oU=5e3;class sU{constructor(t){this.socket=t}on(t,n){return this.socket.on(t,n),()=>{this.socket.off(t,n)}}async request(t,n,r){return new Promise((i,s)=>{let a=!1;const c=r?.timeout??oU,u=globalThis.setTimeout(()=>{a=!0,s(new Error(`Request timed out after ${c}ms`))},c);this.socket.emit(t,n,f=>{if(!a)if(a=!0,globalThis.clearTimeout(u),f.success)i(f.data);else{const m=Object.assign(new Error(f.error??"Request failed"),f.code?{code:f.code}:{});s(m)}})})}}const aE={apiClient:null,connectionState:"disconnected",error:null,isConnected:!1,projectCwd:"",reconnectCount:0,selectedProject:"",socket:null,version:""},$e=kl()(Jb(e=>({...aE,incrementReconnectCount:()=>e(t=>({reconnectCount:t.reconnectCount+1})),reset:()=>e({...aE,selectedProject:""}),setConnectionState:t=>e({connectionState:t,isConnected:t==="connected"}),setError:t=>e({connectionState:"disconnected",error:t,isConnected:!1}),setSelectedProject:t=>e({selectedProject:t}),setSocket:(t,n)=>e({apiClient:new sU(t),connectionState:"connected",error:null,isConnected:!0,projectCwd:n.projectCwd,reconnectCount:0,socket:t,version:n.version})}),{name:"brv-transport",partialize:e=>({selectedProject:e.selectedProject}),storage:S0(()=>sessionStorage)})),aU={destructive:"border-red-500/20 bg-red-500/10 text-red-600 dark:text-red-400",info:"border-blue-500/20 bg-blue-500/10 text-blue-600 dark:text-blue-400",warn:"border-orange-500/20 bg-orange-500/10 text-orange-600 dark:text-orange-400"},lE={destructive:"bg-red-500",info:"bg-blue-500",warn:"bg-orange-500"};function lU({className:e}){return h.jsx("img",{alt:"Byterover",className:e,src:Zb})}function HR({children:e,tone:t}){return h.jsxs(uo,{className:ae("h-auto gap-1.5 px-2 py-0.5 text-[11px]",aU[t]),variant:"outline",children:[h.jsx("span",{className:ae("relative size-1.5 rounded-full",lE[t]),children:h.jsx("span",{className:ae("absolute inset-0 animate-ping rounded-full opacity-50",lE[t])})}),e]})}function UR(){const e=$e(t=>t.version);return e?h.jsxs("span",{className:"text-muted-foreground/70 ml-auto font-mono text-[10px]",children:["v",e]}):null}function VR({body:e,footer:t,pill:n,title:r}){return h.jsx("div",{className:"bg-background fixed inset-0 flex items-center justify-center p-6",children:h.jsxs("div",{className:"border-border bg-card text-card-foreground w-full max-w-md overflow-hidden rounded-xl border shadow-[0_1px_0_0_rgba(0,0,0,0.02),0_8px_28px_-10px_rgba(0,0,0,0.12)] dark:shadow-[0_1px_0_0_rgba(0,0,0,0.4),0_8px_32px_-10px_rgba(0,0,0,0.6)]",children:[h.jsxs("div",{className:"flex items-center justify-between gap-4 px-5 pt-4",children:[h.jsxs("div",{className:"inline-flex min-w-0 items-center gap-2.5",children:[h.jsx(lU,{className:"size-8"}),h.jsx("h2",{className:"text-sm leading-tight font-semibold",children:r})]}),n]}),h.jsx("div",{className:"px-5 pt-2 pb-4",children:e}),t&&h.jsx("div",{className:"border-border bg-foreground/1.5 flex items-center gap-2 border-t px-5 py-2.5",children:t})]})})}function cU(){return h.jsx(VR,{body:h.jsx("p",{className:"text-muted-foreground text-sm leading-relaxed",children:"Establishing a connection to the ByteRover daemon. This usually takes less than a second."}),footer:h.jsxs(h.Fragment,{children:[h.jsx("span",{"aria-hidden":!0,className:"bg-blue-500/70 size-1.5 animate-pulse rounded-full"}),h.jsx("span",{className:"text-muted-foreground text-xs",children:"Waiting for the daemon…"}),h.jsx(UR,{})]}),pill:h.jsx(HR,{tone:"info",children:"Connecting"}),title:"Connecting to ByteRover"})}function uU({textToCopy:e,className:t,showCopiedText:n=!0,onCopied:r}){const[i,s]=w.useState(!1),a=async()=>{try{await navigator.clipboard.writeText(e),s(!0),r?.(),setTimeout(()=>s(!1),2e3)}catch(c){console.error("Failed to copy text: ",c)}};return h.jsx("button",{type:"button",onClick:()=>{a()},className:ae("box-border flex shrink-0 cursor-pointer items-center justify-center gap-1 overflow-clip rounded-md p-1","hover:bg-input text-muted-foreground transition-colors",t),children:i?h.jsxs("div",{className:"flex items-center gap-1.5",children:[n&&h.jsx("span",{className:"pl-0.5 text-xs font-medium",children:"Copied!"}),h.jsx(bf,{className:"size-4 text-green-500"})]}):h.jsx(ZD,{className:"size-4"})})}const Mo=Object.create(null);Mo.open="0";Mo.close="1";Mo.ping="2";Mo.pong="3";Mo.message="4";Mo.upgrade="5";Mo.noop="6";const nm=Object.create(null);Object.keys(Mo).forEach(e=>{nm[Mo[e]]=e});const ix={type:"error",data:"parser error"},qR=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",$R=typeof ArrayBuffer=="function",YR=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,ev=({type:e,data:t},n,r)=>qR&&t instanceof Blob?n?r(t):cE(t,r):$R&&(t instanceof ArrayBuffer||YR(t))?n?r(t):cE(new Blob([t]),r):r(Mo[e]+(t||"")),cE=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+(r||""))},n.readAsDataURL(e)};function uE(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let L2;function dU(e,t){if(qR&&e.data instanceof Blob)return e.data.arrayBuffer().then(uE).then(t);if($R&&(e.data instanceof ArrayBuffer||YR(e.data)))return t(uE(e.data));ev(e,!1,n=>{L2||(L2=new TextEncoder),t(L2.encode(n))})}const dE="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ad=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<dE.length;e++)Ad[dE.charCodeAt(e)]=e;const fU=e=>{let t=e.length*.75,n=e.length,r,i=0,s,a,c,u;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const f=new ArrayBuffer(t),m=new Uint8Array(f);for(r=0;r<n;r+=4)s=Ad[e.charCodeAt(r)],a=Ad[e.charCodeAt(r+1)],c=Ad[e.charCodeAt(r+2)],u=Ad[e.charCodeAt(r+3)],m[i++]=s<<2|a>>4,m[i++]=(a&15)<<4|c>>2,m[i++]=(c&3)<<6|u&63;return f},hU=typeof ArrayBuffer=="function",tv=(e,t)=>{if(typeof e!="string")return{type:"message",data:WR(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:pU(e.substring(1),t)}:nm[n]?e.length>1?{type:nm[n],data:e.substring(1)}:{type:nm[n]}:ix},pU=(e,t)=>{if(hU){const n=fU(e);return WR(n,t)}else return{base64:!0,data:e}},WR=(e,t)=>t==="blob"?e instanceof Blob?e:new Blob([e]):e instanceof ArrayBuffer?e:e.buffer,GR="",mU=(e,t)=>{const n=e.length,r=new Array(n);let i=0;e.forEach((s,a)=>{ev(s,!1,c=>{r[a]=c,++i===n&&t(r.join(GR))})})},gU=(e,t)=>{const n=e.split(GR),r=[];for(let i=0;i<n.length;i++){const s=tv(n[i],t);if(r.push(s),s.type==="error")break}return r};function yU(){return new TransformStream({transform(e,t){dU(e,n=>{const r=n.length;let i;if(r<126)i=new Uint8Array(1),new DataView(i.buffer).setUint8(0,r);else if(r<65536){i=new Uint8Array(3);const s=new DataView(i.buffer);s.setUint8(0,126),s.setUint16(1,r)}else{i=new Uint8Array(9);const s=new DataView(i.buffer);s.setUint8(0,127),s.setBigUint64(1,BigInt(r))}e.data&&typeof e.data!="string"&&(i[0]|=128),t.enqueue(i),t.enqueue(n)})}})}let I2;function Rp(e){return e.reduce((t,n)=>t+n.length,0)}function Ap(e,t){if(e[0].length===t)return e.shift();const n=new Uint8Array(t);let r=0;for(let i=0;i<t;i++)n[i]=e[0][r++],r===e[0].length&&(e.shift(),r=0);return e.length&&r<e[0].length&&(e[0]=e[0].slice(r)),n}function xU(e,t){I2||(I2=new TextDecoder);const n=[];let r=0,i=-1,s=!1;return new TransformStream({transform(a,c){for(n.push(a);;){if(r===0){if(Rp(n)<1)break;const u=Ap(n,1);s=(u[0]&128)===128,i=u[0]&127,i<126?r=3:i===126?r=1:r=2}else if(r===1){if(Rp(n)<2)break;const u=Ap(n,2);i=new DataView(u.buffer,u.byteOffset,u.length).getUint16(0),r=3}else if(r===2){if(Rp(n)<8)break;const u=Ap(n,8),f=new DataView(u.buffer,u.byteOffset,u.length),m=f.getUint32(0);if(m>Math.pow(2,21)-1){c.enqueue(ix);break}i=m*Math.pow(2,32)+f.getUint32(4),r=3}else{if(Rp(n)<i)break;const u=Ap(n,i);c.enqueue(tv(s?u:I2.decode(u),t)),r=0}if(i===0||i>e){c.enqueue(ix);break}}}})}const KR=4;function rr(e){if(e)return bU(e)}function bU(e){for(var t in rr.prototype)e[t]=rr.prototype[t];return e}rr.prototype.on=rr.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this};rr.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this};rr.prototype.off=rr.prototype.removeListener=rr.prototype.removeAllListeners=rr.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks["$"+e];if(!n)return this;if(arguments.length==1)return delete this._callbacks["$"+e],this;for(var r,i=0;i<n.length;i++)if(r=n[i],r===t||r.fn===t){n.splice(i,1);break}return n.length===0&&delete this._callbacks["$"+e],this};rr.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(n){n=n.slice(0);for(var r=0,i=n.length;r<i;++r)n[r].apply(this,t)}return this};rr.prototype.emitReserved=rr.prototype.emit;rr.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]};rr.prototype.hasListeners=function(e){return!!this.listeners(e).length};const C0=typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0),Ui=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),vU="arraybuffer";function QR(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const wU=Ui.setTimeout,SU=Ui.clearTimeout;function k0(e,t){t.useNativeTimers?(e.setTimeoutFn=wU.bind(Ui),e.clearTimeoutFn=SU.bind(Ui)):(e.setTimeoutFn=Ui.setTimeout.bind(Ui),e.clearTimeoutFn=Ui.clearTimeout.bind(Ui))}const CU=1.33;function kU(e){return typeof e=="string"?EU(e):Math.ceil((e.byteLength||e.size)*CU)}function EU(e){let t=0,n=0;for(let r=0,i=e.length;r<i;r++)t=e.charCodeAt(r),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(r++,n+=4);return n}function XR(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function TU(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function NU(e){let t={},n=e.split("&");for(let r=0,i=n.length;r<i;r++){let s=n[r].split("=");t[decodeURIComponent(s[0])]=decodeURIComponent(s[1])}return t}class RU extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}}class nv extends rr{constructor(t){super(),this.writable=!1,k0(this,t),this.opts=t,this.query=t.query,this.socket=t.socket,this.supportsBinary=!t.forceBase64}onError(t,n,r){return super.emitReserved("error",new RU(t,n,r)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(t){this.readyState==="open"&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){const n=tv(t,this.socket.binaryType);this.onPacket(n)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}createUri(t,n={}){return t+"://"+this._hostname()+this._port()+this.opts.path+this._query(n)}_hostname(){const t=this.opts.hostname;return t.indexOf(":")===-1?t:"["+t+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(t){const n=TU(t);return n.length?"?"+n:""}}class AU extends nv{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(t){this.readyState="pausing";const n=()=>{this.readyState="paused",t()};if(this._polling||!this.writable){let r=0;this._polling&&(r++,this.once("pollComplete",function(){--r||n()})),this.writable||(r++,this.once("drain",function(){--r||n()}))}else n()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){const n=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};gU(t,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,mU(t,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const t=this.opts.secure?"https":"http",n=this.query||{};return this.opts.timestampRequests!==!1&&(n[this.opts.timestampParam]=XR()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}}let ZR=!1;try{ZR=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const OU=ZR;function jU(){}class MU extends AU{constructor(t){if(super(t),typeof location<"u"){const n=location.protocol==="https:";let r=location.port;r||(r=n?"443":"80"),this.xd=typeof location<"u"&&t.hostname!==location.hostname||r!==t.port}}doWrite(t,n){const r=this.request({method:"POST",data:t});r.on("success",n),r.on("error",(i,s)=>{this.onError("xhr post error",i,s)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=t}}let Mc=class rm extends rr{constructor(t,n,r){super(),this.createRequest=t,k0(this,r),this._opts=r,this._method=r.method||"GET",this._uri=n,this._data=r.data!==void 0?r.data:null,this._create()}_create(){var t;const n=QR(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");n.xdomain=!!this._opts.xd;const r=this._xhr=this.createRequest(n);try{r.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let i in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(i)&&r.setRequestHeader(i,this._opts.extraHeaders[i])}}catch{}if(this._method==="POST")try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{r.setRequestHeader("Accept","*/*")}catch{}(t=this._opts.cookieJar)===null||t===void 0||t.addCookies(r),"withCredentials"in r&&(r.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(r.timeout=this._opts.requestTimeout),r.onreadystatechange=()=>{var i;r.readyState===3&&((i=this._opts.cookieJar)===null||i===void 0||i.parseCookies(r.getResponseHeader("set-cookie"))),r.readyState===4&&(r.status===200||r.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof r.status=="number"?r.status:0)},0))},r.send(this._data)}catch(i){this.setTimeoutFn(()=>{this._onError(i)},0);return}typeof document<"u"&&(this._index=rm.requestsCount++,rm.requests[this._index]=this)}_onError(t){this.emitReserved("error",t,this._xhr),this._cleanup(!0)}_cleanup(t){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=jU,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete rm.requests[this._index],this._xhr=null}}_onLoad(){const t=this._xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}};Mc.requestsCount=0;Mc.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",fE);else if(typeof addEventListener=="function"){const e="onpagehide"in Ui?"pagehide":"unload";addEventListener(e,fE,!1)}}function fE(){for(let e in Mc.requests)Mc.requests.hasOwnProperty(e)&&Mc.requests[e].abort()}const DU=(function(){const e=JR({xdomain:!1});return e&&e.responseType!==null})();class _U extends MU{constructor(t){super(t);const n=t&&t.forceBase64;this.supportsBinary=DU&&!n}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new Mc(JR,this.uri(),t)}}function JR(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||OU))return new XMLHttpRequest}catch{}if(!t)try{return new Ui[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const eA=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class LU extends nv{get name(){return"websocket"}doOpen(){const t=this.uri(),n=this.opts.protocols,r=eA?{}:QR(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(t,n,r)}catch(i){return this.emitReserved("error",i)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],i=n===t.length-1;ev(r,this.supportsBinary,s=>{try{this.doWrite(r,s)}catch{}i&&C0(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const t=this.opts.secure?"wss":"ws",n=this.query||{};return this.opts.timestampRequests&&(n[this.opts.timestampParam]=XR()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}}const P2=Ui.WebSocket||Ui.MozWebSocket;class IU extends LU{createSocket(t,n,r){return eA?new P2(t,n,r):n?new P2(t,n):new P2(t)}doWrite(t,n){this.ws.send(n)}}class PU extends nv{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(t){return this.emitReserved("error",t)}this._transport.closed.then(()=>{this.onClose()}).catch(t=>{this.onError("webtransport error",t)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(t=>{const n=xU(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=t.readable.pipeThrough(n).getReader(),i=yU();i.readable.pipeTo(t.writable),this._writer=i.writable.getWriter();const s=()=>{r.read().then(({done:c,value:u})=>{c||(this.onPacket(u),s())}).catch(c=>{})};s();const a={type:"open"};this.query.sid&&(a.data=`{"sid":"${this.query.sid}"}`),this._writer.write(a).then(()=>this.onOpen())})})}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],i=n===t.length-1;this._writer.write(r).then(()=>{i&&C0(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}}const zU={websocket:IU,webtransport:PU,polling:_U},FU=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,BU=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function ox(e){if(e.length>8e3)throw"URI too long";const t=e,n=e.indexOf("["),r=e.indexOf("]");n!=-1&&r!=-1&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));let i=FU.exec(e||""),s={},a=14;for(;a--;)s[BU[a]]=i[a]||"";return n!=-1&&r!=-1&&(s.source=t,s.host=s.host.substring(1,s.host.length-1).replace(/;/g,":"),s.authority=s.authority.replace("[","").replace("]","").replace(/;/g,":"),s.ipv6uri=!0),s.pathNames=HU(s,s.path),s.queryKey=UU(s,s.query),s}function HU(e,t){const n=/\/{2,9}/g,r=t.replace(n,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&r.splice(0,1),t.slice(-1)=="/"&&r.splice(r.length-1,1),r}function UU(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,i,s){i&&(n[i]=s)}),n}const sx=typeof addEventListener=="function"&&typeof removeEventListener=="function",im=[];sx&&addEventListener("offline",()=>{im.forEach(e=>e())},!1);class pa extends rr{constructor(t,n){if(super(),this.binaryType=vU,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,t&&typeof t=="object"&&(n=t,t=null),t){const r=ox(t);n.hostname=r.host,n.secure=r.protocol==="https"||r.protocol==="wss",n.port=r.port,r.query&&(n.query=r.query)}else n.host&&(n.hostname=ox(n.host).host);k0(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},n.transports.forEach(r=>{const i=r.prototype.name;this.transports.push(i),this._transportsByName[i]=r}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},n),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=NU(this.opts.query)),sx&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},im.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=KR,n.transport=t,this.id&&(n.sid=this.id);const r=Object.assign({},this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new this._transportsByName[t](r)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const t=this.opts.rememberUpgrade&&pa.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const n=this.createTransport(t);n.open(),this.setTransport(n)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",n=>this._onClose("transport close",n))}onOpen(){this.readyState="open",pa.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const n=new Error("server error");n.code=t.data,this._onError(n);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data);break}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this._pingInterval=t.pingInterval,this._pingTimeout=t.pingTimeout,this._maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const t=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+t,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},t),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this._getWritablePackets();this.transport.send(t),this._prevBufferLen=t.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let r=0;r<this.writeBuffer.length;r++){const i=this.writeBuffer[r].data;if(i&&(n+=kU(i)),r>0&&n>this._maxPayload)return this.writeBuffer.slice(0,r);n+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const t=Date.now()>this._pingTimeoutTime;return t&&(this._pingTimeoutTime=0,C0(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),t}write(t,n,r){return this._sendPacket("message",t,n,r),this}send(t,n,r){return this._sendPacket("message",t,n,r),this}_sendPacket(t,n,r,i){if(typeof n=="function"&&(i=n,n=void 0),typeof r=="function"&&(i=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const s={type:t,data:n,options:r};this.emitReserved("packetCreate",s),this.writeBuffer.push(s),i&&this.once("flush",i),this.flush()}close(){const t=()=>{this._onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),t()},r=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():t()}):this.upgrading?r():t()),this}_onError(t){if(pa.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",t),this._onClose("transport error",t)}_onClose(t,n){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),sx&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const r=im.indexOf(this._offlineEventListener);r!==-1&&im.splice(r,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this._prevBufferLen=0}}}pa.protocol=KR;class VU extends pa{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let t=0;t<this._upgrades.length;t++)this._probe(this._upgrades[t])}_probe(t){let n=this.createTransport(t),r=!1;pa.priorWebsocketSuccess=!1;const i=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",p=>{if(!r)if(p.type==="pong"&&p.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;pa.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(m(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const y=new Error("probe error");y.transport=n.name,this.emitReserved("upgradeError",y)}}))};function s(){r||(r=!0,m(),n.close(),n=null)}const a=p=>{const y=new Error("probe error: "+p);y.transport=n.name,s(),this.emitReserved("upgradeError",y)};function c(){a("transport closed")}function u(){a("socket closed")}function f(p){n&&p.name!==n.name&&s()}const m=()=>{n.removeListener("open",i),n.removeListener("error",a),n.removeListener("close",c),this.off("close",u),this.off("upgrading",f)};n.once("open",i),n.once("error",a),n.once("close",c),this.once("close",u),this.once("upgrading",f),this._upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{r||n.open()},200):n.open()}onHandshake(t){this._upgrades=this._filterUpgrades(t.upgrades),super.onHandshake(t)}_filterUpgrades(t){const n=[];for(let r=0;r<t.length;r++)~this.transports.indexOf(t[r])&&n.push(t[r]);return n}}let qU=class extends VU{constructor(t,n={}){const r=typeof t=="object"?t:n;(!r.transports||r.transports&&typeof r.transports[0]=="string")&&(r.transports=(r.transports||["polling","websocket","webtransport"]).map(i=>zU[i]).filter(i=>!!i)),super(t,r)}};function $U(e,t="",n){let r=e;n=n||typeof location<"u"&&location,e==null&&(e=n.protocol+"//"+n.host),typeof e=="string"&&(e.charAt(0)==="/"&&(e.charAt(1)==="/"?e=n.protocol+e:e=n.host+e),/^(https?|wss?):\/\//.test(e)||(typeof n<"u"?e=n.protocol+"//"+e:e="https://"+e),r=ox(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const s=r.host.indexOf(":")!==-1?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+s+":"+r.port+t,r.href=r.protocol+"://"+s+(n&&n.port===r.port?"":":"+r.port),r}const YU=typeof ArrayBuffer=="function",WU=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,tA=Object.prototype.toString,GU=typeof Blob=="function"||typeof Blob<"u"&&tA.call(Blob)==="[object BlobConstructor]",KU=typeof File=="function"||typeof File<"u"&&tA.call(File)==="[object FileConstructor]";function rv(e){return YU&&(e instanceof ArrayBuffer||WU(e))||GU&&e instanceof Blob||KU&&e instanceof File}function om(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n<r;n++)if(om(e[n]))return!0;return!1}if(rv(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return om(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&om(e[n]))return!0;return!1}function QU(e){const t=[],n=e.data,r=e;return r.data=ax(n,t),r.attachments=t.length,{packet:r,buffers:t}}function ax(e,t){if(!e)return e;if(rv(e)){const n={_placeholder:!0,num:t.length};return t.push(e),n}else if(Array.isArray(e)){const n=new Array(e.length);for(let r=0;r<e.length;r++)n[r]=ax(e[r],t);return n}else if(typeof e=="object"&&!(e instanceof Date)){const n={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=ax(e[r],t));return n}return e}function XU(e,t){return e.data=lx(e.data,t),delete e.attachments,e}function lx(e,t){if(!e)return e;if(e&&e._placeholder===!0){if(typeof e.num=="number"&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}else if(Array.isArray(e))for(let n=0;n<e.length;n++)e[n]=lx(e[n],t);else if(typeof e=="object")for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=lx(e[n],t));return e}const ZU=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];var Qt;(function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"})(Qt||(Qt={}));class JU{constructor(t){this.replacer=t}encode(t){return(t.type===Qt.EVENT||t.type===Qt.ACK)&&om(t)?this.encodeAsBinary({type:t.type===Qt.EVENT?Qt.BINARY_EVENT:Qt.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let n=""+t.type;return(t.type===Qt.BINARY_EVENT||t.type===Qt.BINARY_ACK)&&(n+=t.attachments+"-"),t.nsp&&t.nsp!=="/"&&(n+=t.nsp+","),t.id!=null&&(n+=t.id),t.data!=null&&(n+=JSON.stringify(t.data,this.replacer)),n}encodeAsBinary(t){const n=QU(t),r=this.encodeAsString(n.packet),i=n.buffers;return i.unshift(r),i}}class iv extends rr{constructor(t){super(),this.opts=Object.assign({reviver:void 0,maxAttachments:10},typeof t=="function"?{reviver:t}:t)}add(t){let n;if(typeof t=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");n=this.decodeString(t);const r=n.type===Qt.BINARY_EVENT;r||n.type===Qt.BINARY_ACK?(n.type=r?Qt.EVENT:Qt.ACK,this.reconstructor=new eV(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(rv(t)||t.base64)if(this.reconstructor)n=this.reconstructor.takeBinaryData(t),n&&(this.reconstructor=null,super.emitReserved("decoded",n));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+t)}decodeString(t){let n=0;const r={type:Number(t.charAt(0))};if(Qt[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===Qt.BINARY_EVENT||r.type===Qt.BINARY_ACK){const s=n+1;for(;t.charAt(++n)!=="-"&&n!=t.length;);const a=t.substring(s,n);if(a!=Number(a)||t.charAt(n)!=="-")throw new Error("Illegal attachments");const c=Number(a);if(!tV(c)||c<0)throw new Error("Illegal attachments");if(c>this.opts.maxAttachments)throw new Error("too many attachments");r.attachments=c}if(t.charAt(n+1)==="/"){const s=n+1;for(;++n&&!(t.charAt(n)===","||n===t.length););r.nsp=t.substring(s,n)}else r.nsp="/";const i=t.charAt(n+1);if(i!==""&&Number(i)==i){const s=n+1;for(;++n;){const a=t.charAt(n);if(a==null||Number(a)!=a){--n;break}if(n===t.length)break}r.id=Number(t.substring(s,n+1))}if(t.charAt(++n)){const s=this.tryParse(t.substr(n));if(iv.isPayloadValid(r.type,s))r.data=s;else throw new Error("invalid payload")}return r}tryParse(t){try{return JSON.parse(t,this.opts.reviver)}catch{return!1}}static isPayloadValid(t,n){switch(t){case Qt.CONNECT:return hE(n);case Qt.DISCONNECT:return n===void 0;case Qt.CONNECT_ERROR:return typeof n=="string"||hE(n);case Qt.EVENT:case Qt.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&ZU.indexOf(n[0])===-1);case Qt.ACK:case Qt.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class eV{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){const n=XU(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const tV=Number.isInteger||function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e};function hE(e){return Object.prototype.toString.call(e)==="[object Object]"}const nV=Object.freeze(Object.defineProperty({__proto__:null,Decoder:iv,Encoder:JU,get PacketType(){return Qt}},Symbol.toStringTag,{value:"Module"}));function oo(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const rV=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class nA extends rr{constructor(t,n,r){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=n,r&&r.auth&&(this.auth=r.auth),this._opts=Object.assign({},r),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[oo(t,"open",this.onopen.bind(this)),oo(t,"packet",this.onpacket.bind(this)),oo(t,"error",this.onerror.bind(this)),oo(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...n){var r,i,s;if(rV.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(n.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(n),this;const a={type:Qt.EVENT,data:n};if(a.options={},a.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const m=this.ids++,p=n.pop();this._registerAckCallback(m,p),a.id=m}const c=(i=(r=this.io.engine)===null||r===void 0?void 0:r.transport)===null||i===void 0?void 0:i.writable,u=this.connected&&!(!((s=this.io.engine)===null||s===void 0)&&s._hasPingExpired());return this.flags.volatile&&!c||(u?(this.notifyOutgoingListeners(a),this.packet(a)):this.sendBuffer.push(a)),this.flags={},this}_registerAckCallback(t,n){var r;const i=(r=this.flags.timeout)!==null&&r!==void 0?r:this._opts.ackTimeout;if(i===void 0){this.acks[t]=n;return}const s=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let c=0;c<this.sendBuffer.length;c++)this.sendBuffer[c].id===t&&this.sendBuffer.splice(c,1);n.call(this,new Error("operation has timed out"))},i),a=(...c)=>{this.io.clearTimeoutFn(s),n.apply(this,c)};a.withError=!0,this.acks[t]=a}emitWithAck(t,...n){return new Promise((r,i)=>{const s=(a,c)=>a?i(a):r(c);s.withError=!0,n.push(s),this.emit(t,...n)})}_addToQueue(t){let n;typeof t[t.length-1]=="function"&&(n=t.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((i,...s)=>(this._queue[0],i!==null?r.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(i)):(this._queue.shift(),n&&n(null,...s)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||this._queue.length===0)return;const n=this._queue[0];n.pending&&!t||(n.pending=!0,n.tryCount++,this.flags=n.flags,this.emit.apply(this,n.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:Qt.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,n),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(t=>{if(!this.sendBuffer.some(r=>String(r.id)===t)){const r=this.acks[t];delete this.acks[t],r.withError&&r.call(this,new Error("socket has been disconnected"))}})}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case Qt.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case Qt.EVENT:case Qt.BINARY_EVENT:this.onevent(t);break;case Qt.ACK:case Qt.BINARY_ACK:this.onack(t);break;case Qt.DISCONNECT:this.ondisconnect();break;case Qt.CONNECT_ERROR:this.destroy();const r=new Error(t.data.message);r.data=t.data.data,this.emitReserved("connect_error",r);break}}onevent(t){const n=t.data||[];t.id!=null&&n.push(this.ack(t.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){const n=this;let r=!1;return function(...i){r||(r=!0,n.packet({type:Qt.ACK,id:t,data:i}))}}onack(t){const n=this.acks[t.id];typeof n=="function"&&(delete this.acks[t.id],n.withError&&t.data.unshift(null),n.apply(this,t.data))}onconnect(t,n){this.id=t,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this._drainQueue(!0),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:Qt.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const n=this._anyListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(!this._anyOutgoingListeners)return this;if(t){const n=this._anyOutgoingListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const n=this._anyOutgoingListeners.slice();for(const r of n)r.apply(this,t.data)}}}function ou(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}ou.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=(Math.floor(t*10)&1)==0?e-n:e+n}return Math.min(e,this.max)|0};ou.prototype.reset=function(){this.attempts=0};ou.prototype.setMin=function(e){this.ms=e};ou.prototype.setMax=function(e){this.max=e};ou.prototype.setJitter=function(e){this.jitter=e};class cx extends rr{constructor(t,n){var r;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(n=t,t=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,k0(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((r=n.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new ou({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=t;const i=n.parser||nV;this.encoder=new i.Encoder,this.decoder=new i.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,t||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var n;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(n=this.backoff)===null||n===void 0||n.setMin(t),this)}randomizationFactor(t){var n;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(n=this.backoff)===null||n===void 0||n.setJitter(t),this)}reconnectionDelayMax(t){var n;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(n=this.backoff)===null||n===void 0||n.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new qU(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const i=oo(n,"open",function(){r.onopen(),t&&t()}),s=c=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",c),t?t(c):this.maybeReconnectOnOpen()},a=oo(n,"error",s);if(this._timeout!==!1){const c=this._timeout,u=this.setTimeoutFn(()=>{i(),s(new Error("timeout")),n.close()},c);this.opts.autoUnref&&u.unref(),this.subs.push(()=>{this.clearTimeoutFn(u)})}return this.subs.push(i),this.subs.push(a),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(oo(t,"ping",this.onping.bind(this)),oo(t,"data",this.ondata.bind(this)),oo(t,"error",this.onerror.bind(this)),oo(t,"close",this.onclose.bind(this)),oo(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(n){this.onclose("parse error",n)}}ondecoded(t){C0(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,n){let r=this.nsps[t];return r?this._autoConnect&&!r.active&&r.connect():(r=new nA(this,t,n),this.nsps[t]=r),r}_destroy(t){const n=Object.keys(this.nsps);for(const r of n)if(this.nsps[r].active)return;this._close()}_packet(t){const n=this.encoder.encode(t);for(let r=0;r<n.length;r++)this.engine.write(n[r],t.options)}cleanup(){this.subs.forEach(t=>t()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(t,n){var r;this.cleanup(),(r=this.engine)===null||r===void 0||r.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const r=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(i=>{i?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",i)):t.onreconnect()}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const dd={};function sm(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=$U(e,t.path||"/socket.io"),r=n.source,i=n.id,s=n.path,a=dd[i]&&s in dd[i].nsps,c=t.forceNew||t["force new connection"]||t.multiplex===!1||a;let u;return c?u=new cx(r,t):(dd[i]||(dd[i]=new cx(r,t)),u=dd[i]),n.query&&!t.query&&(t.query=n.queryKey),u.socket(n.path,t)}Object.assign(sm,{Manager:cx,Socket:nA,io:sm,connect:sm});class rA extends Error{constructor(t){super(t),this.name="UiConfigError"}}async function iV(){const e=await fetch("/api/ui/config");if(!e.ok)throw new rA(`Failed to fetch UI config: ${e.statusText}`);return e.json()}function oV(e,t){e.emit("client:register",{clientType:"webui",projectPath:t},()=>{}),e.emit("room:join","broadcast-room")}async function sV(e){const t=await iV(),n=sm(`http://127.0.0.1:${t.daemonPort}`,{reconnection:!0,reconnectionAttempts:30,reconnectionDelay:50,reconnectionDelayMax:1e3,transports:["websocket"]});return n.on("connect",()=>oV(n,e)),await new Promise((r,i)=>{const s=()=>{clearTimeout(u),n.off("connect",a),n.off("connect_error",c)},a=()=>{s(),r()},c=f=>{s(),i(f)},u=setTimeout(()=>{s(),i(new Error("Connection timeout"))},5e3);n.once("connect",a),n.once("connect_error",c)}),{config:t,socket:n}}function pE({error:e}){const t=e instanceof rA,n=$e(s=>s.reconnectCount),r=t?"brv restart":"brv webui",i=t?"Web UI server not available":"ByteRover is not running";return h.jsx(VR,{body:h.jsxs(h.Fragment,{children:[h.jsx("p",{className:"text-muted-foreground text-sm leading-relaxed",children:t?h.jsxs(h.Fragment,{children:["Could not load"," ",h.jsx("code",{className:"bg-muted text-foreground rounded px-1.5 py-0.5 font-mono text-xs",children:"/api/ui-config"}),". The dev server may have stopped or moved to a different port. Restart it from your terminal:"]}):"Could not connect to the ByteRover daemon. Start it from your terminal:"}),h.jsxs("div",{className:"bg-muted mt-3 flex items-center justify-between gap-3 rounded-md px-3.5 py-2.5 font-mono text-xs",children:[h.jsxs("span",{children:[h.jsx("span",{className:"text-muted-foreground",children:"$"})," ",r]}),h.jsx(uU,{className:"-mr-1",showCopiedText:!1,textToCopy:r})]})]}),footer:h.jsxs(h.Fragment,{children:[t?h.jsx("span",{className:"text-muted-foreground/80 text-xs",children:"Refresh once the host is back."}):h.jsxs(h.Fragment,{children:[h.jsx("span",{"aria-hidden":!0,className:"bg-muted-foreground/60 size-1.5 animate-pulse rounded-full"}),h.jsxs("span",{className:"text-muted-foreground text-xs",children:["Reconnecting",h.jsx("span",{className:"opacity-60",children:" · attempt "}),h.jsx("span",{className:"text-foreground tabular-nums",children:n})]})]}),h.jsx(UR,{})]}),pill:h.jsx(HR,{tone:t?"destructive":"warn",children:t?"Unreachable":"Offline"}),title:i})}function aV({children:e}){const t=$e(f=>f.incrementReconnectCount),n=$e(f=>f.setConnectionState),r=$e(f=>f.setError),i=$e(f=>f.setSocket),s=$e(f=>f.selectedProject);w.useEffect(()=>{let f=!0,m=null,p=null;async function y(){try{n("connecting");const{config:x,socket:b}=await sV(s);if(!f){b.disconnect();return}m=b,i(b,x),b.on("disconnect",()=>{f&&n("disconnected")}),b.io.on("reconnect_attempt",()=>{f&&(t(),n("reconnecting"))}),b.io.on("reconnect",()=>{f&&n("connected")})}catch(x){if(!f)return;r(x instanceof Error?x:new Error(String(x))),t(),p=setTimeout(y,3e3)}}return y(),()=>{f=!1,m?.disconnect(),p!==null&&clearTimeout(p)}},[s,t,n,r,i]);const a=$e(f=>f.connectionState),c=$e(f=>f.error),u=$e(f=>f.apiClient);return c?h.jsx(pE,{error:c}):a==="connecting"?h.jsx(cU,{}):u?h.jsx(h.Fragment,{children:e}):h.jsx(pE,{})}const lV=new BH({defaultOptions:JH});function cV({children:e}){return h.jsx(HH,{client:lV,children:h.jsx(aV,{children:h.jsx(Yb,{delay:0,children:e})})})}const Rf={GET_STATE:"auth:getState",LOGIN_COMPLETED:"auth:loginCompleted",LOGOUT:"auth:logout",START_LOGIN:"auth:startLogin",STATE_CHANGED:"auth:stateChanged"},uV={GET_ENVIRONMENT:"config:getEnvironment"},ov={GET_AGENTS:"connectors:getAgents",INSTALL:"connectors:install",LIST:"connectors:list"},Af={GET_FILE:"contextTree:getFile",GET_FILE_METADATA:"contextTree:getFileMetadata",GET_HISTORY:"contextTree:getHistory",GET_NODES:"contextTree:getNodes",UPDATE_FILE:"contextTree:updateFile"},uc={CHUNK:"llmservice:chunk",ERROR:"llmservice:error",RESPONSE:"llmservice:response",THINKING:"llmservice:thinking",TOOL_CALL:"llmservice:toolCall",TOOL_RESULT:"llmservice:toolResult"},iA={GET:"locations:get",REVEAL:"locations:reveal"},oA={LIST:"model:list",SET_ACTIVE:"model:setActive"},Cs={AWAIT_OAUTH_CALLBACK:"provider:awaitOAuthCallback",CONNECT:"provider:connect",DISCONNECT:"provider:disconnect",GET_ACTIVE:"provider:getActive",LIST:"provider:list",SET_ACTIVE:"provider:setActive",START_OAUTH:"provider:startOAuth",UPDATED:"provider:updated",VALIDATE_API_KEY:"provider:validateApiKey"},mr={CANCELLED:"task:cancelled",CLEAR_COMPLETED:"task:clearCompleted",COMPLETED:"task:completed",CREATE:"task:create",CREATED:"task:created",DELETE:"task:delete",DELETE_BULK:"task:deleteBulk",DELETED:"task:deleted",ERROR:"task:error",GET:"task:get",LIST:"task:list",STARTED:"task:started"},Ir={ALREADY_INITIALIZED:"ERR_VC_ALREADY_INITIALIZED",AUTH_FAILED:"ERR_VC_AUTH_FAILED",BRANCH_NOT_FOUND:"ERR_VC_BRANCH_NOT_FOUND",CONFIG_KEY_NOT_SET:"ERR_VC_CONFIG_KEY_NOT_SET",GIT_NOT_INITIALIZED:"ERR_VC_GIT_NOT_INITIALIZED",NO_COMMITS:"ERR_VC_NO_COMMITS",NO_REMOTE:"ERR_VC_NO_REMOTE",NO_UPSTREAM:"ERR_VC_NO_UPSTREAM",NON_FAST_FORWARD:"ERR_VC_NON_FAST_FORWARD",NOTHING_TO_PUSH:"ERR_VC_NOTHING_TO_PUSH",REMOTE_ALREADY_EXISTS:"ERR_VC_REMOTE_ALREADY_EXISTS",USER_NOT_CONFIGURED:"ERR_VC_USER_NOT_CONFIGURED"},qn={ADD:"vc:add",BRANCH:"vc:branch",CHECKOUT:"vc:checkout",CLONE:"vc:clone",CLONE_PROGRESS:"vc:clone:progress",COMMIT:"vc:commit",CONFIG:"vc:config",DIFF:"vc:diff",DIFFS:"vc:diffs",DISCARD:"vc:discard",FETCH:"vc:fetch",INIT:"vc:init",LOG:"vc:log",MERGE:"vc:merge",PULL:"vc:pull",PUSH:"vc:push",REMOTE:"vc:remote",RESET:"vc:reset",STATUS:"vc:status"},mE={activeModel:null,favorites:[],isLoading:!1,models:[],recent:[]},dV=kl()(e=>({...mE,reset:()=>e(mE),setActiveModel:t=>e({activeModel:t}),setLoading:t=>e({isLoading:t}),setModels:t=>e({activeModel:t.activeModel??null,favorites:t.favorites,models:t.models,recent:t.recent})})),gE={activeProviderId:null,isDialogOpen:!1,isLoading:!1,providers:[]},jm=kl()(e=>({...gE,closeProviderDialog:()=>e({isDialogOpen:!1}),openProviderDialog:()=>e({isDialogOpen:!0}),reset:()=>e(gE),setActiveProviderId:t=>e({activeProviderId:t}),setLoading:t=>e({isLoading:t}),setProviders:t=>e({providers:t}),updateProvider:(t,n)=>e(r=>({providers:r.providers.map(i=>i.id===t?{...i,...n}:i)}))})),fV=()=>{const{apiClient:e}=$e.getState();return e?e.request(Rf.GET_STATE,void 0,{timeout:5e3}):Promise.reject(new Error("Not connected"))},To=()=>({gcTime:300*1e3,queryFn:fV,queryKey:["auth","state"],staleTime:60*1e3}),hV=({queryConfig:e}={})=>or({...To(),...e}),yE={brvConfig:null,isAuthorized:!1,isLoadingInitial:!0,isLoggingIn:!1,user:null},yi=kl()(e=>({...yE,reset:()=>e(yE),setLoggingIn:t=>e({isLoggingIn:t}),setState:t=>e(n=>({brvConfig:t.isAuthorized?t.brvConfig===void 0?n.brvConfig:t.brvConfig:null,isAuthorized:t.isAuthorized,isLoggingIn:!1,user:t.isAuthorized?t.user===void 0?n.user:t.user:null}))}));function pV({children:e}){const t=$e(f=>f.apiClient),n=$e(f=>f.connectionState),r=$e(f=>f.reconnectCount),i=un(),s=yi(f=>f.setState),{data:a,isFetched:c,isLoading:u}=hV({queryConfig:{enabled:t!==null,retry:5,retryDelay:f=>Math.min(500*2**f,2e3),staleTime:120*1e3}});return w.useEffect(()=>{a?(s({brvConfig:a.brvConfig??null,isAuthorized:a.isAuthorized,user:a.user??null}),yi.setState({isLoadingInitial:!1})):c&&!u&&yi.setState({isLoadingInitial:!1})},[a,c,u,s]),w.useEffect(()=>t?t.on(Rf.STATE_CHANGED,m=>{s({brvConfig:m.brvConfig,isAuthorized:m.isAuthorized,user:m.user}),m.isAuthorized||(jm.getState().reset(),dV.getState().reset()),m.isAuthorized&&i.invalidateQueries({queryKey:To().queryKey}).catch(()=>{})}):void 0,[t,i,s]),w.useEffect(()=>{t&&n==="connected"&&r!==0&&i.invalidateQueries({queryKey:To().queryKey}).catch(()=>{})},[t,n,i,r]),h.jsx(h.Fragment,{children:e})}const mV=()=>{const{apiClient:e}=$e.getState();return e?e.request(Cs.GET_ACTIVE):Promise.reject(new Error("Not connected"))},sv=()=>({queryFn:mV,queryKey:["getActiveProviderConfig"]}),av=({queryConfig:e}={})=>or({...sv(),...e}),gV=()=>{const{apiClient:e}=$e.getState();return e?e.request(Cs.LIST):Promise.reject(new Error("Not connected"))},su=()=>({queryFn:gV,queryKey:["providers"]}),lv=({queryConfig:e}={})=>or({...su(),...e});function yV(){const e=$e(n=>n.apiClient),t=un();w.useEffect(()=>e?e.on(Cs.UPDATED,()=>{t.invalidateQueries({queryKey:su().queryKey}),t.invalidateQueries({queryKey:sv().queryKey})}):void 0,[e,t])}function xV(){return yV(),null}function xE(e,t){if(t.length===0)return e;const n=new Map(t.map(i=>[i.taskId,i])),r=e.map(i=>{const s=n.get(i.taskId);return s?(n.delete(i.taskId),vV(i,s)):i});for(const i of n.values())r.push(i);return r}function bV(e,t){const n=e.filter(r=>r.taskId!==t);return n.length===e.length?e:n}function vV(e,t){return{...e,...wV(t)}}function wV(e){const t={};for(const[n,r]of Object.entries(e))r!==void 0&&(t[n]=r);return t}function SV(e,t){const n=e.toolCalls??[],r=t.callId?n.findIndex(i=>i.callId===t.callId):-1;if(r>=0){const i=n[r],s=t.args&&Object.keys(t.args).length>0,a=[...n];return a[r]={...i,args:s?t.args:i.args,sessionId:t.sessionId},{...e,sessionId:t.sessionId,toolCalls:a}}return{...e,sessionId:t.sessionId,toolCalls:[...n,t]}}function CV(e,t){const n=e.toolCalls??[];if(n.length===0)return e;let r=-1;if(t.callId&&(r=n.findIndex(s=>s.callId===t.callId)),r===-1&&t.toolName){for(let s=n.length-1;s>=0;s--)if(n[s].toolName===t.toolName&&n[s].status==="running"){r=s;break}}if(r===-1)return e;const i=[...n];return i[r]={...i[r],error:t.error,errorType:t.errorType,result:t.result,status:t.success?"completed":"error"},{...e,toolCalls:i}}function kV(e,t){const n=e.reasoningContents??[],r=n.at(-1);return t.isThinking&&r?.isThinking?e:{...e,reasoningContents:[...n,t]}}function EV(e,t){if(t.type==="reasoning"){const n=e.reasoningContents??[],r=n.length-1,i=n[r];if(i){const s=[...n];return s[r]={...i,content:i.content+t.content,isThinking:!1},{...e,isStreaming:!t.isComplete,reasoningContents:s,sessionId:t.sessionId??e.sessionId}}return{...e,isStreaming:!t.isComplete,reasoningContents:[{content:t.content,isThinking:!1,timestamp:Date.now()}],sessionId:t.sessionId??e.sessionId}}return{...e,isStreaming:!t.isComplete,sessionId:t.sessionId??e.sessionId,streamingContent:(e.streamingContent??"")+t.content}}function TV(e,t){return{...e,isStreaming:!1,responseContent:t.content,sessionId:t.sessionId??e.sessionId,streamingContent:void 0}}function sA(e){return e==="curate-folder"?"curate":e}const aA=new Set(["cancelled","completed","error"]);function aa(e){return aA.has(e)}function Vc(e){return!aA.has(e)}const bE={searchQuery:"",statusFilter:"all",tasks:[],typeFilter:"all"};function dc(e,t,n){const r=e.tasks.findIndex(a=>a.taskId===t);if(r===-1)return;const i=n(e.tasks[r]);if(i===e.tasks[r])return;const s=[...e.tasks];return s[r]=i,{tasks:s}}const qc=kl()(Jb((e,t)=>({...bE,addReasoningContent:(n,r)=>e(i=>dc(i,n,s=>kV(s,r))??{}),addToolCall:(n,r)=>e(i=>dc(i,n,s=>SV(s,r))??{}),appendStreamingContent:({content:n,isComplete:r,sessionId:i,taskId:s,type:a})=>e(c=>dc(c,s,u=>EV(u,{content:n,isComplete:r,sessionId:i,type:a}))??{}),clearCompleted:()=>e(n=>({tasks:n.tasks.filter(r=>!aa(r.status))})),markLlmServiceError:n=>e(r=>dc(r,n,i=>({...i,hadLlmServiceError:!0}))??{}),mergeTasks:n=>e(r=>({tasks:xE(r.tasks,n)})),removeTask:n=>e(r=>({tasks:bV(r.tasks,n)})),reset:()=>e({...bE}),setResponse:(n,r,i)=>e(s=>dc(s,n,a=>TV(a,{content:r,sessionId:i}))??{}),setSearchQuery:n=>e({searchQuery:n}),setStatusFilter:n=>e({statusFilter:n}),setTypeFilter:n=>e({typeFilter:n}),updateToolCallResult:({callId:n,error:r,errorType:i,result:s,success:a,taskId:c,toolName:u})=>e(f=>dc(f,c,m=>CV(m,{callId:n,error:r,errorType:i,result:s,success:a,toolName:u}))??{}),upsertStatus(n,r){const i=t().tasks.find(a=>a.taskId===n),s=i?{...i,...r}:{content:"",createdAt:Date.now(),type:"unknown",...r,taskId:n};e(a=>({tasks:xE(a.tasks,[s])}))}}),{name:"brv-tasks",partialize:e=>({tasks:e.tasks}),storage:S0(()=>sessionStorage)})),NV=["all","running","completed","failed","cancelled"],RV=e=>qc(t=>e?t.tasks.find(n=>n.taskId===e):void 0),AV=()=>{const e=qc(i=>i.tasks);let t=0,n=0,r=0;for(const i of e)i.status==="created"?t++:i.status==="started"?n++:r++;return{completed:r,inProgress:n,pending:t,total:e.length}};function OV(){const e=$e(t=>t.apiClient);w.useEffect(()=>{if(!e)return;const t=qc.getState(),n=[];return n.push(e.on(mr.CREATED,r=>{t.upsertStatus(r.taskId,{content:r.content,createdAt:Date.now(),...r.files?.length?{files:r.files}:{},...r.folderPath?{folderPath:r.folderPath}:{},...r.model?{model:r.model}:{},...r.provider?{provider:r.provider}:{},status:"created",type:r.type})}),e.on(mr.STARTED,r=>{t.upsertStatus(r.taskId,{startedAt:Date.now(),status:"started"})}),e.on(mr.COMPLETED,r=>{t.upsertStatus(r.taskId,{completedAt:Date.now(),result:r.result,status:"completed"})}),e.on(mr.ERROR,r=>{t.upsertStatus(r.taskId,{completedAt:Date.now(),error:r.error,status:"error"})}),e.on(mr.CANCELLED,r=>{t.upsertStatus(r.taskId,{completedAt:Date.now(),status:"cancelled"})}),e.on(mr.DELETED,r=>{t.removeTask(r.taskId)}),e.on(uc.TOOL_CALL,r=>{r.taskId&&t.addToolCall(r.taskId,{args:r.args,callId:r.callId,sessionId:r.sessionId,status:"running",timestamp:Date.now(),toolName:r.toolName})}),e.on(uc.TOOL_RESULT,r=>{r.taskId&&t.updateToolCallResult({callId:r.callId,error:r.error,errorType:r.errorType,result:r.result,success:r.success,taskId:r.taskId,toolName:r.toolName})}),e.on(uc.CHUNK,r=>{r.taskId&&t.appendStreamingContent({content:r.content,isComplete:r.isComplete??!1,sessionId:r.sessionId,taskId:r.taskId,type:r.type==="reasoning"?"reasoning":"text"})}),e.on(uc.RESPONSE,r=>{r.taskId&&t.setResponse(r.taskId,r.content,r.sessionId)}),e.on(uc.THINKING,r=>{r.taskId&&t.addReasoningContent(r.taskId,{content:"",isThinking:!0,timestamp:Date.now()})}),e.on(uc.ERROR,r=>{r.taskId&&t.markLlmServiceError(r.taskId)})),()=>{for(const r of n)r()}},[e])}const jV=[mr.CREATED,mr.STARTED,mr.COMPLETED,mr.ERROR,mr.CANCELLED,mr.DELETED];function MV(){const e=$e(s=>s.selectedProject),t=$e(s=>s.apiClient),n=qc(s=>s.reset),r=w.useRef(e),i=un();return OV(),w.useEffect(()=>{r.current!==e&&(n(),r.current=e)},[e,n]),w.useEffect(()=>{if(!t)return;const s=jV.map(a=>t.on(a,()=>{i.invalidateQueries({queryKey:["tasks","list"]})}));return()=>{for(const a of s)a()}},[t,i]),null}function DV(){const e=Gi();return $e(n=>n.selectedProject)?h.jsxs(pV,{children:[h.jsx(xV,{}),h.jsx(MV,{}),h.jsx(P6,{})]}):h.jsx(I6,{replace:!0,state:{from:e},to:"/projects"})}const zd=["provider","curate","query","connector"],_V={seenWelcome:!1,tourActive:!1,tourCompleted:!1,tourStep:null,tourTaskId:null},Ht=kl()(Jb((e,t)=>({..._V,advanceTour(){const{tourStep:n}=t();if(!n)return;const r=zd.indexOf(n),i=zd[r+1];e(i?{tourStep:i,tourTaskId:null}:{tourActive:!1,tourCompleted:!0,tourStep:null,tourTaskId:null})},dismissWelcome:()=>e({seenWelcome:!0}),exitTour:()=>e({tourActive:!1,tourStep:null,tourTaskId:null}),goToStep:n=>e({tourActive:!0,tourStep:n,tourTaskId:null}),setTourTaskId:n=>e({tourTaskId:n}),startTour:(n="provider")=>e({seenWelcome:!0,tourActive:!0,tourStep:n,tourTaskId:null})}),{name:"brv:onboarding",partialize:e=>({seenWelcome:e.seenWelcome,tourCompleted:e.tourCompleted}),storage:S0(()=>globalThis.localStorage)}));function LV(){const e=Ht(s=>s.tourActive),t=Ht(s=>s.tourStep),n=Ht(s=>s.tourTaskId);return e&&(t==="curate"||t==="query")&&!n?h.jsx("div",{"aria-hidden":!0,className:"bg-background/50 fixed inset-0 z-40 backdrop-blur-xs"}):null}const IV={connector:"Connect to your AI tool",curate:"Curate your first knowledge",provider:"Connect a provider",query:"Ask your first question"};function PV(){const[e,t]=w.useState(0);return w.useEffect(()=>{const n='[data-slot="sheet-content"][data-side="right"]';let r=null;const i=()=>{const c=document.querySelectorAll(n);let u=0;for(const f of c){const m=f.getBoundingClientRect();m.width>u&&(u=m.width)}t(f=>f===u?f:u)},s=()=>{r?.disconnect();const c=document.querySelectorAll(n);if(c.length===0){i();return}r=new globalThis.ResizeObserver(i);for(const u of c)r.observe(u);i()},a=new globalThis.MutationObserver(s);return a.observe(document.body,{childList:!0,subtree:!0}),s(),()=>{r?.disconnect(),a.disconnect()}},[]),e}function zV(){const e=Ht(m=>m.tourActive),t=Ht(m=>m.tourStep),n=Ht(m=>m.exitTour),r=PV();if(!e||!t)return null;const i=zd.indexOf(t),a=t==="curate"||t==="query"?"top-4":"bottom-4",c=r>0,u=ae("pointer-events-none fixed z-100 flex",a,c?"":"inset-x-0 justify-center px-4"),f=c?{right:`${r+16}px`}:void 0;return h.jsx("div",{className:u,style:f,children:h.jsxs("div",{className:"border-border bg-card text-card-foreground pointer-events-auto inline-flex items-center gap-3 rounded-full border px-3 py-2 pl-3.5 shadow-[0_8px_28px_-10px_rgba(0,0,0,0.25)]",children:[h.jsx("div",{className:"inline-flex items-center gap-1",children:zd.map((m,p)=>h.jsx("span",{"aria-hidden":!0,className:ae("h-1.5 rounded-full transition-all",p<i&&"bg-muted-foreground w-1.5",p===i&&"bg-primary-foreground w-4",p>i&&"bg-border w-1.5")},m))}),h.jsxs("span",{className:"text-foreground text-xs font-medium",children:[h.jsxs("span",{className:"text-muted-foreground mono mr-1.5 text-[10.5px]",children:[i+1,"/",zd.length]}),IV[t]]}),h.jsx("span",{"aria-hidden":!0,className:"bg-border h-4 w-px"}),h.jsx("button",{className:"text-muted-foreground hover:text-foreground cursor-pointer rounded px-1.5 py-0.5 text-[11px] transition-colors",onClick:()=>n(),type:"button",children:"Exit tour"})]})})}const cv=w.createContext(void 0);function ka(e){const t=w.useContext(cv);if(e===!1&&t===void 0)throw new Error(Cn(27));return t}const FV={...Ss,...ws},uv=w.forwardRef(function(t,n){const{render:r,className:i,forceRender:s=!1,...a}=t,{store:c}=ka(),u=c.useState("open"),f=c.useState("nested"),m=c.useState("mounted"),p=c.useState("transitionStatus");return jt("div",t,{state:{open:u,transitionStatus:p},ref:[c.context.backdropRef,n],stateAttributesMapping:FV,props:[{role:"presentation",hidden:!m,style:{userSelect:"none",WebkitUserSelect:"none"}},a],enabled:s||!f})}),BV=w.createContext(void 0);function dv(e=!1){const t=w.useContext(BV);if(t===void 0&&!e)throw new Error(Cn(16));return t}function HV(e){const{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:i=0,isNativeButton:s}=e,a=r&&t!==!1,c=r&&t===!1;return{props:w.useMemo(()=>{const f={onKeyDown(m){n&&t&&m.key!=="Tab"&&m.preventDefault()}};return r||(f.tabIndex=i,!s&&n&&(f.tabIndex=t?i:-1)),(s&&(t||a)||!s&&n)&&(f["aria-disabled"]=n),s&&(!t||c)&&(f.disabled=n),f},[r,n,t,a,c,s,i])}}function El(e={}){const{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:i=!0,composite:s}=e,a=w.useRef(null),c=dv(!0),u=s??c!==void 0,{props:f}=HV({focusableWhenDisabled:n,disabled:t,composite:u,tabIndex:r,isNativeButton:i}),m=w.useCallback(()=>{const x=a.current;z2(x)&&u&&t&&f.disabled===void 0&&x.disabled&&(x.disabled=!1)},[t,f.disabled,u]);We(m,[m]);const p=w.useCallback((x={})=>{const{onClick:b,onMouseDown:S,onKeyUp:k,onKeyDown:E,onPointerDown:T,...N}=x;return jo({type:i?"button":void 0,onClick(O){if(t){O.preventDefault();return}b?.(O)},onMouseDown(O){t||S?.(O)},onKeyDown(O){if(t||(Wy(O),E?.(O),O.baseUIHandlerPrevented))return;const A=O.target===O.currentTarget,R=O.currentTarget,L=z2(R),B=!i&&UV(R),I=A&&(i?L:!B),U=O.key==="Enter",Y=O.key===" ",V=R.getAttribute("role"),q=V?.startsWith("menuitem")||V==="option"||V==="gridcell";if(A&&u&&Y){if(O.defaultPrevented&&q)return;O.preventDefault(),B||i&&L?(R.click(),O.preventBaseUIHandler()):I&&(b?.(O),O.preventBaseUIHandler());return}I&&(!i&&(Y||U)&&O.preventDefault(),!i&&U&&b?.(O))},onKeyUp(O){if(!t){if(Wy(O),k?.(O),O.target===O.currentTarget&&i&&u&&z2(O.currentTarget)&&O.key===" "){O.preventDefault();return}O.baseUIHandlerPrevented||O.target===O.currentTarget&&!i&&!u&&O.key===" "&&b?.(O)}},onPointerDown(O){if(t){O.preventDefault();return}T?.(O)}},i?void 0:{role:"button"},f,N)},[t,f,u,i]),y=tt(x=>{a.current=x,m()});return{getButtonProps:p,buttonRef:y}}function z2(e){return zn(e)&&e.tagName==="BUTTON"}function UV(e){return!!(e?.tagName==="A"&&e?.href)}const Of=w.forwardRef(function(t,n){const{render:r,className:i,disabled:s=!1,nativeButton:a=!0,...c}=t,{store:u}=ka(),f=u.useState("open");function m(b){f&&u.setOpen(!1,Et(UP,b.nativeEvent))}const{getButtonProps:p,buttonRef:y}=El({disabled:s,native:a});return jt("button",t,{state:{disabled:s},ref:[n,y],props:[{onClick:m},c,p]})}),lA=w.forwardRef(function(t,n){const{render:r,className:i,id:s,...a}=t,{store:c}=ka(),u=Si(s);return c.useSyncedValueWithCleanup("descriptionElementId",u),jt("p",t,{ref:n,props:[{id:u},a]})});let VV=(function(e){return e.nestedDialogs="--nested-dialogs",e})({}),qV=(function(e){return e[e.open=ol.open]="open",e[e.closed=ol.closed]="closed",e[e.startingStyle=ol.startingStyle]="startingStyle",e[e.endingStyle=ol.endingStyle]="endingStyle",e.nested="data-nested",e.nestedDialogOpen="data-nested-dialog-open",e})({});const cA=w.createContext(void 0);function $V(){const e=w.useContext(cA);if(e===void 0)throw new Error(Cn(26));return e}const uA="ArrowUp",dA="ArrowDown",fA="ArrowLeft",hA="ArrowRight",pA="Home",mA="End",YV=new Set([fA,hA]),WV=new Set([uA,dA]),GV=new Set([...YV,...WV]);[...GV];const fv=new Set([uA,dA,fA,hA,pA,mA]),KV={...Ss,...ws,nestedDialogOpen(e){return e?{[qV.nestedDialogOpen]:""}:null}},hv=w.forwardRef(function(t,n){const{className:r,finalFocus:i,initialFocus:s,render:a,...c}=t,{store:u}=ka(),f=u.useState("descriptionElementId"),m=u.useState("disablePointerDismissal"),p=u.useState("floatingRootContext"),y=u.useState("popupProps"),x=u.useState("modal"),b=u.useState("mounted"),S=u.useState("nested"),k=u.useState("nestedOpenDialogCount"),E=u.useState("open"),T=u.useState("openMethod"),N=u.useState("titleElementId"),j=u.useState("transitionStatus"),O=u.useState("role");$V(),Ki({open:E,ref:u.context.popupRef,onComplete(){E&&u.context.onOpenChangeComplete?.(!0)}});function A(U){return U==="touch"?u.context.popupRef.current:!0}const R=s===void 0?A:s,L=k>0,I=jt("div",t,{state:{open:E,nested:S,transitionStatus:j,nestedDialogOpen:L},props:[y,{"aria-labelledby":N??void 0,"aria-describedby":f??void 0,role:O,tabIndex:-1,hidden:!b,onKeyDown(U){fv.has(U.key)&&U.stopPropagation()},style:{[VV.nestedDialogs]:k}},c],ref:[n,u.context.popupRef,u.useStateSetter("popupElement")],stateAttributesMapping:KV});return h.jsx(Nb,{context:p,openInteractionType:T,disabled:!b,closeOnFocusOut:!m,initialFocus:R,returnFocus:i,modal:x!==!1,restoreFocus:"popup",children:I})}),pv=w.forwardRef(function(t,n){const{cutout:r,...i}=t;let s;if(r){const a=r?.getBoundingClientRect();s=`polygon(
13
+ 0% 0%,
14
+ 100% 0%,
15
+ 100% 100%,
16
+ 0% 100%,
17
+ 0% 0%,
18
+ ${a.left}px ${a.top}px,
19
+ ${a.left}px ${a.bottom}px,
20
+ ${a.right}px ${a.bottom}px,
21
+ ${a.right}px ${a.top}px,
22
+ ${a.left}px ${a.top}px
23
+ )`}return h.jsx("div",{ref:n,role:"presentation","data-base-ui-inert":"",...i,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:s}})}),mv=w.forwardRef(function(t,n){const{keepMounted:r=!1,...i}=t,{store:s}=ka(),a=s.useState("mounted"),c=s.useState("modal"),u=s.useState("open");return a||r?h.jsx(cA.Provider,{value:r,children:h.jsxs(kb,{ref:n,...i,children:[a&&c===!0&&h.jsx(pv,{ref:s.context.internalBackdropRef,inert:Vb(!u)}),t.children]})}):null});let vE={},wE={},SE="";function QV(e){if(typeof document>"u")return!1;const t=Zt(e);return Un(t).innerWidth-t.documentElement.clientWidth>0}function XV(e){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;const n=Zt(e),r=n.documentElement,i=n.body,s=ba(r)?r:i,a=s.style.overflowY,c=r.style.scrollbarGutter;r.style.scrollbarGutter="stable",s.style.overflowY="scroll";const u=s.offsetWidth;s.style.overflowY="hidden";const f=s.offsetWidth;return s.style.overflowY=a,r.style.scrollbarGutter=c,u===f}function ZV(e){const t=Zt(e),n=t.documentElement,r=t.body,i=ba(n)?n:r,s={overflowY:i.style.overflowY,overflowX:i.style.overflowX};return Object.assign(i.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(i.style,s)}}function JV(e){const t=Zt(e),n=t.documentElement,r=t.body,i=Un(n);let s=0,a=0,c=!1;const u=vo.create();if(pb&&(i.visualViewport?.scale??1)!==1)return()=>{};function f(){const y=i.getComputedStyle(n),x=i.getComputedStyle(r),k=(y.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";s=n.scrollTop,a=n.scrollLeft,vE={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},SE=n.style.scrollBehavior,wE={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};const E=n.scrollHeight>n.clientHeight,T=n.scrollWidth>n.clientWidth,N=y.overflowY==="scroll"||x.overflowY==="scroll",j=y.overflowX==="scroll"||x.overflowX==="scroll",O=Math.max(0,i.innerWidth-r.clientWidth),A=Math.max(0,i.innerHeight-r.clientHeight),R=parseFloat(x.marginTop)+parseFloat(x.marginBottom),L=parseFloat(x.marginLeft)+parseFloat(x.marginRight),B=ba(n)?n:r;if(c=XV(e),c){n.style.scrollbarGutter=k,B.style.overflowY="hidden",B.style.overflowX="hidden";return}Object.assign(n.style,{scrollbarGutter:k,overflowY:"hidden",overflowX:"hidden"}),(E||N)&&(n.style.overflowY="scroll"),(T||j)&&(n.style.overflowX="scroll"),Object.assign(r.style,{position:"relative",height:R||A?`calc(100dvh - ${R+A}px)`:"100dvh",width:L||O?`calc(100vw - ${L+O}px)`:"100vw",boxSizing:"border-box",overflow:"hidden",scrollBehavior:"unset"}),r.scrollTop=s,r.scrollLeft=a,n.setAttribute("data-base-ui-scroll-locked",""),n.style.scrollBehavior="unset"}function m(){Object.assign(n.style,vE),Object.assign(r.style,wE),c||(n.scrollTop=s,n.scrollLeft=a,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=SE)}function p(){m(),u.request(f)}return f(),i.addEventListener("resize",p),()=>{u.cancel(),m(),typeof i.removeEventListener=="function"&&i.removeEventListener("resize",p)}}class eq{lockCount=0;restore=null;timeoutLock=lo.create();timeoutUnlock=lo.create();acquire(t){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(t)),this.release}release=()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(t){if(this.lockCount===0||this.restore!==null)return;const r=Zt(t).documentElement,i=Un(r).getComputedStyle(r).overflowY;if(i==="hidden"||i==="clip"){this.restore=Cr;return}const s=G6||!QV(t);this.restore=s?ZV(t):JV(t)}}const tq=new eq;function gv(e=!0,t=null){We(()=>{if(e)return tq.acquire(t)},[e,t])}function nq(e){const t=w.useRef(""),n=w.useCallback(i=>{i.defaultPrevented||(t.current=i.pointerType,e(i,i.pointerType))},[e]);return{onClick:w.useCallback(i=>{if(i.detail===0){e(i,"keyboard");return}"pointerType"in i?e(i,i.pointerType):e(i,t.current),t.current=""},[e]),onPointerDown:n}}function yv(e,t){const n=w.useRef(e),r=tt(t);We(()=>{n.current!==e&&r(n.current)},[e,r]),We(()=>{n.current=e},[e])}function xv(e){const[t,n]=w.useState(null),r=tt((a,c)=>{e||n(c||(G6?"touch":""))});yv(e,a=>{a&&!e&&n(null)});const{onClick:i,onPointerDown:s}=nq(r);return w.useMemo(()=>({openMethod:t,triggerProps:{onClick:i,onPointerDown:s}}),[t,i,s])}function gA(e){const{store:t,parentContext:n,actionsRef:r}=e,i=t.useState("open"),s=t.useState("disablePointerDismissal"),a=t.useState("modal"),c=t.useState("popupElement"),{openMethod:u,triggerProps:f}=xv(i);jb(t);const{forceUnmount:m}=Mb(i,t),p=tt(B=>{const I=Et(B);return I.preventUnmountOnClose=()=>{t.set("preventUnmountingOnClose",!0)},I}),y=w.useCallback(()=>{t.setOpen(!1,p(wb))},[t,p]);w.useImperativeHandle(r,()=>({unmount:m,close:y}),[m,y]);const x=Lb({popupStore:t,onOpenChange:t.setOpen,treatPopupAsFloatingElement:!0,noEmit:!0}),[b,S]=w.useState(0),k=b===0,E=nR(x),T=y0(x,{outsidePressEvent(){return t.context.internalBackdropRef.current||t.context.backdropRef.current?"intentional":{mouse:a==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(B){if(!t.context.outsidePressEnabledRef.current||"button"in B&&B.button!==0||"touches"in B&&B.touches.length!==1)return!1;const I=Fr(B);if(k&&!s){const U=I;return a&&(t.context.internalBackdropRef.current||t.context.backdropRef.current)?t.context.internalBackdropRef.current===U||t.context.backdropRef.current===U||Nt(U,c)&&!U?.hasAttribute("data-base-ui-portal"):!0}return!1},escapeKey:k});gv(i&&a===!0,c);const{getReferenceProps:N,getFloatingProps:j,getTriggerProps:O}=nu([E,T]);t.useContextCallback("onNestedDialogOpen",B=>{S(B+1)}),t.useContextCallback("onNestedDialogClose",()=>{S(0)}),w.useEffect(()=>(n?.onNestedDialogOpen&&i&&n.onNestedDialogOpen(b),n?.onNestedDialogClose&&!i&&n.onNestedDialogClose(),()=>{n?.onNestedDialogClose&&i&&n.onNestedDialogClose()}),[i,n,b]);const A=w.useMemo(()=>N(f),[N,f]),R=w.useMemo(()=>O(f),[O,f]),L=w.useMemo(()=>j(),[j]);t.useSyncedValues({openMethod:u,activeTriggerProps:A,inactiveTriggerProps:R,popupProps:L,floatingRootContext:x,nestedOpenDialogCount:b})}const rq={..._b,modal:Ue(e=>e.modal),nested:Ue(e=>e.nested),nestedOpenDialogCount:Ue(e=>e.nestedOpenDialogCount),disablePointerDismissal:Ue(e=>e.disablePointerDismissal),openMethod:Ue(e=>e.openMethod),descriptionElementId:Ue(e=>e.descriptionElementId),titleElementId:Ue(e=>e.titleElementId),viewportElement:Ue(e=>e.viewportElement),role:Ue(e=>e.role)};class yA extends b0{constructor(t){super(iq(t),{popupRef:w.createRef(),backdropRef:w.createRef(),internalBackdropRef:w.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:new Nf,onOpenChange:void 0,onOpenChangeComplete:void 0},rq)}setOpen=(t,n)=>{if(n.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},!t&&n.trigger==null&&this.state.activeTriggerId!=null&&(n.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(t,n),n.isCanceled)return;const r={open:t,nativeEvent:n.event,reason:n.reason,nested:this.state.nested};this.state.floatingRootContext.context.events?.emit("openchange",r);const i={open:t},s=n.trigger?.id??null;(s||t)&&(i.activeTriggerId=s,i.activeTriggerElement=n.trigger??null),this.update(i)}}function iq(e={}){return{...Db(),modal:!0,disablePointerDismissal:!1,popupElement:null,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,role:"dialog",...e}}function xA(e){const{children:t,open:n,defaultOpen:r=!1,onOpenChange:i,onOpenChangeComplete:s,disablePointerDismissal:a=!1,modal:c=!0,actionsRef:u,handle:f,triggerId:m,defaultTriggerId:p=null}=e,y=ka(!0),x=!!y,b=ir(()=>f?.store??new yA({open:r,openProp:n,activeTriggerId:p,triggerIdProp:m,modal:c,disablePointerDismissal:a,nested:x})).current;l0(()=>{n===void 0&&b.state.open===!1&&r===!0&&b.update({open:!0,activeTriggerId:p})}),b.useControlledProp("openProp",n),b.useControlledProp("triggerIdProp",m),b.useSyncedValues({disablePointerDismissal:a,nested:x,modal:c}),b.useContextCallback("onOpenChange",i),b.useContextCallback("onOpenChangeComplete",s);const S=b.useState("payload");gA({store:b,actionsRef:u,parentContext:y?.store.context});const k=w.useMemo(()=>({store:b}),[b]);return h.jsx(cv.Provider,{value:k,children:typeof t=="function"?t({payload:S}):t})}const bA=w.forwardRef(function(t,n){const{render:r,className:i,id:s,...a}=t,{store:c}=ka(),u=Si(s);return c.useSyncedValueWithCleanup("titleElementId",u),jt("h2",t,{ref:n,props:[{id:u},a]})}),oq=w.forwardRef(function(t,n){const{render:r,className:i,disabled:s=!1,focusableWhenDisabled:a=!1,nativeButton:c=!0,...u}=t,{getButtonProps:f,buttonRef:m}=El({disabled:s,focusableWhenDisabled:a,native:c});return jt("button",t,{state:{disabled:s},ref:[n,m],props:[u,f]})}),ux=w0("group/button inline-flex shrink-0 items-center justify-center rounded-md border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 cursor-pointer",{variants:{variant:{default:"bg-primary text-foreground font-medium hover:bg-primary/80",outline:"border-border bg-background shadow-xs hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-background dark:hover:bg-muted",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",ghost:"hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",destructive:"bg-destructive text-foreground hover:bg-destructive/80 focus-visible:border-destructive/40 focus-visible:ring-destructive/20",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 gap-1.5 px-2.5 in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",xs:"h-6 gap-1 rounded-[min(var(--radius-md),8px)] px-2 text-xs in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-8 gap-1 rounded-[min(var(--radius-md),10px)] px-2.5 in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5",lg:"h-10 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-3",icon:"size-9","icon-xs":"size-6 rounded-[min(var(--radius-md),8px)] in-data-[slot=button-group]:rounded-md [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-8 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-md","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function ze({className:e,variant:t="default",size:n="default",...r}){return h.jsx(oq,{"data-slot":"button",className:ae(ux({variant:t,size:n,className:e})),...r})}function Tl({...e}){return h.jsx(xA,{"data-slot":"dialog",...e})}function sq({...e}){return h.jsx(mv,{"data-slot":"dialog-portal",...e})}function dx({...e}){return h.jsx(Of,{"data-slot":"dialog-close",...e})}function aq({className:e,...t}){return h.jsx(uv,{"data-slot":"dialog-overlay",className:ae("fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",e),...t})}function Nl({className:e,children:t,showCloseButton:n=!0,...r}){return h.jsxs(sq,{children:[h.jsx(aq,{}),h.jsxs(hv,{"data-slot":"dialog-content",className:ae("fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-6 rounded-xl bg-background p-6 text-sm text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none sm:max-w-md data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",e),...r,children:[t,n&&h.jsxs(Of,{"data-slot":"dialog-close",render:h.jsx(ze,{variant:"ghost",className:"absolute top-4 right-4",size:"icon-sm"}),children:[h.jsx(n0,{}),h.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function Ci({className:e,...t}){return h.jsx("div",{"data-slot":"dialog-header",className:ae("flex flex-col gap-2",e),...t})}function Ea({className:e,showCloseButton:t=!1,children:n,...r}){return h.jsxs("div",{"data-slot":"dialog-footer",className:ae("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...r,children:[n,t&&h.jsx(Of,{render:h.jsx(ze,{variant:"outline"}),children:"Close"})]})}function ki({className:e,...t}){return h.jsx(bA,{"data-slot":"dialog-title",className:ae("leading-none text-lg font-semibold text-foreground",e),...t})}function jf({className:e,...t}){return h.jsx(lA,{"data-slot":"dialog-description",className:ae("text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground",e),...t})}const vA=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();const lq=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const cq=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase());const CE=e=>{const t=cq(e);return t.charAt(0).toUpperCase()+t.slice(1)};var F2={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const uq=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1},dq=w.createContext({}),fq=()=>w.useContext(dq),hq=w.forwardRef(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:i="",children:s,iconNode:a,...c},u)=>{const{size:f=24,strokeWidth:m=2,absoluteStrokeWidth:p=!1,color:y="currentColor",className:x=""}=fq()??{},b=r??p?Number(n??m)*24/Number(t??f):n??m;return w.createElement("svg",{ref:u,...F2,width:t??f??F2.width,height:t??f??F2.height,stroke:e??y,strokeWidth:b,className:vA("lucide",x,i),...!s&&!uq(c)&&{"aria-hidden":"true"},...c},[...a.map(([S,k])=>w.createElement(S,k)),...Array.isArray(s)?s:[s]])});const Tt=(e,t)=>{const n=w.forwardRef(({className:r,...i},s)=>w.createElement(hq,{ref:s,iconNode:t,className:vA(`lucide-${lq(CE(e))}`,`lucide-${e}`,r),...i}));return n.displayName=CE(e),n};const pq=[["path",{d:"M17 7 7 17",key:"15tmo1"}],["path",{d:"M17 17H7V7",key:"1org7z"}]],mq=Tt("arrow-down-left",pq);const gq=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],yq=Tt("arrow-down",gq);const xq=[["path",{d:"m16 3 4 4-4 4",key:"1x1c3m"}],["path",{d:"M20 7H4",key:"zbl0bi"}],["path",{d:"m8 21-4-4 4-4",key:"h9nckh"}],["path",{d:"M4 17h16",key:"g4d7ey"}]],bq=Tt("arrow-right-left",xq);const vq=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],wA=Tt("arrow-right",vq);const wq=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],Sq=Tt("arrow-up",wq);const Cq=[["path",{d:"M13.5 10.5 15 9",key:"1nsxvm"}],["path",{d:"M4 4v15a1 1 0 0 0 1 1h15",key:"1w6lkd"}],["path",{d:"M4.293 19.707 6 18",key:"3g1p8c"}],["path",{d:"m9 15 1.5-1.5",key:"1xfbes"}]],kq=Tt("axis-3d",Cq);const Eq=[["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"}]],Tq=Tt("book-open",Eq);const Nq=[["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M14 7a4 4 0 0 1 4 4v3a6 6 0 0 1-12 0v-3a4 4 0 0 1 4-4z",key:"uouzyp"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M21 21a4 4 0 0 0-3.81-4",key:"1b0z45"}],["path",{d:"M21 5a4 4 0 0 1-3.55 3.97",key:"5cxbf6"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M3 21a4 4 0 0 1 3.81-4",key:"1fjd4g"}],["path",{d:"M3 5a4 4 0 0 0 3.55 3.97",key:"1d7oge"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M9 7.13V6a3 3 0 1 1 6 0v1.13",key:"1vgav8"}]],Rq=Tt("bug",Nq);const Aq=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Rl=Tt("check",Aq);const Oq=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Mf=Tt("chevron-down",Oq);const jq=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],gl=Tt("chevron-left",jq);const Mq=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],SA=Tt("chevron-right",Mq);const Dq=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],_q=Tt("chevron-up",Dq);const Lq=[["path",{d:"m11 17-5-5 5-5",key:"13zhaf"}],["path",{d:"m18 17-5-5 5-5",key:"h8a8et"}]],Iq=Tt("chevrons-left",Lq);const Pq=[["path",{d:"m6 17 5-5-5-5",key:"xnjwq"}],["path",{d:"m13 17 5-5-5-5",key:"17xmmf"}]],zq=Tt("chevrons-right",Pq);const Fq=[["path",{d:"M9 9.003a1 1 0 0 1 1.517-.859l4.997 2.997a1 1 0 0 1 0 1.718l-4.997 2.997A1 1 0 0 1 9 14.996z",key:"kmsa83"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],Bq=Tt("circle-play",Fq);const Hq=[["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"}]],Uq=Tt("circle-x",Hq);const Vq=[["path",{d:"M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3",key:"11bfej"}]],qq=Tt("command",Vq);const $q=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],Yq=Tt("copy",$q);const Wq=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],Mm=Tt("external-link",Wq);const Gq=[["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:"M9 10h6",key:"9gxzsh"}],["path",{d:"M12 13V7",key:"h0r20n"}],["path",{d:"M9 17h6",key:"r8uit2"}]],Kq=Tt("file-diff",Gq);const Qq=[["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"}]],E0=Tt("file-text",Qq);const Xq=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],Zq=Tt("folder-open",Xq);const Jq=[["path",{d:"M10.7 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v4.1",key:"1bw5m7"}],["path",{d:"m21 21-1.9-1.9",key:"1g2n9r"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}]],e$=Tt("folder-search",Jq);const t$=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],CA=Tt("folder",t$);const n$=[["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["line",{x1:"3",x2:"9",y1:"12",y2:"12",key:"1dyftd"}],["line",{x1:"15",x2:"21",y1:"12",y2:"12",key:"oup4p8"}]],r$=Tt("git-commit-horizontal",n$);const i$=[["path",{d:"M15 6a9 9 0 0 0-9 9V3",key:"1cii5b"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}]],bv=Tt("git-branch",i$);const o$=[["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"}]],s$=Tt("globe",o$);const a$=[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]],kA=Tt("house",a$);const l$=[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]],c$=Tt("key",l$);const u$=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m4.93 4.93 4.24 4.24",key:"1ymg45"}],["path",{d:"m14.83 9.17 4.24-4.24",key:"1cb5xl"}],["path",{d:"m14.83 14.83 4.24 4.24",key:"q42g0n"}],["path",{d:"m9.17 14.83-4.24 4.24",key:"bqpfvv"}],["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}]],d$=Tt("life-buoy",u$);const f$=[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]],h$=Tt("lightbulb",f$);const p$=[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["rect",{x:"3",y:"4",width:"6",height:"6",rx:"1",key:"cif1o7"}]],kE=Tt("list-todo",p$);const m$=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],ei=Tt("loader-circle",m$);const g$=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],y$=Tt("log-out",g$);const x$=[["path",{d:"M5 12h14",key:"1ays0h"}]],vv=Tt("minus",x$);const b$=[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]],v$=Tt("paperclip",b$);const w$=[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z",key:"1xoxul"}],["path",{d:"M9 8V2",key:"14iosj"}]],EA=Tt("plug",w$);const S$=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Ta=Tt("plus",S$);const C$=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],k$=Tt("rotate-ccw",C$);const E$=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],au=Tt("search",E$);const T$=[["path",{d:"M10 5H3",key:"1qgfaw"}],["path",{d:"M12 19H3",key:"yhmn1j"}],["path",{d:"M14 3v4",key:"1sua03"}],["path",{d:"M16 17v4",key:"1q0r14"}],["path",{d:"M21 12h-9",key:"1o4lsq"}],["path",{d:"M21 19h-5",key:"1rlt1p"}],["path",{d:"M21 5h-7",key:"1oszz2"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M8 12H3",key:"a7s4jb"}]],N$=Tt("sliders-horizontal",T$);const R$=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],A$=Tt("sparkles",R$);const O$=[["path",{d:"M21 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h6",key:"y09zxi"}],["path",{d:"m21 3-9 9",key:"mpx6sq"}],["path",{d:"M15 3h6v6",key:"1q9fwt"}]],j$=Tt("square-arrow-out-up-right",O$);const M$=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],D$=Tt("trash-2",M$);const _$=[["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"}]],L$=Tt("triangle-alert",_$);const I$=[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]],TA=Tt("undo-2",I$);const P$=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],wv=Tt("user",P$);const z$=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Sv=Tt("x",z$),F$={ERR_NOT_AUTHENTICATED:"Please sign in to continue.",ERR_PROVIDER_NOT_CONFIGURED:"No provider is connected, or its credentials are missing or expired.",[Ir.ALREADY_INITIALIZED]:"Version control is already initialized for this project.",[Ir.AUTH_FAILED]:"Authentication failed. Please sign in and try again.",[Ir.BRANCH_NOT_FOUND]:"Branch not found. You can create a new branch if needed.",[Ir.NO_COMMITS]:"Make at least one commit before continuing.",[Ir.NO_REMOTE]:"No remote configured for this project.",[Ir.NO_UPSTREAM]:"This branch has no upstream configured yet. Use the Push button to publish it and set upstream in one step.",[Ir.NON_FAST_FORWARD]:"The remote has changes. Pull first, then try again.",[Ir.NOTHING_TO_PUSH]:"Nothing to push — stage and commit your changes first.",[Ir.REMOTE_ALREADY_EXISTS]:"A remote named 'origin' already exists. Remove or rename it before adding a new one.",[Ir.USER_NOT_CONFIGURED]:"Commit author is not configured."},B$="Something went wrong";function EE(e,t){return typeof e=="object"&&e!==null&&t in e&&typeof e[t]=="string"}function jn(e,t=B$,n={}){if(EE(e,"code")){const r=F$[e.code];if(r!==void 0)return typeof r=="function"?r(n):r}return EE(e,"message")?e.message:t}const H$=async({contextLength:e,modelId:t,providerId:n})=>{const{apiClient:r}=$e.getState();if(!r)throw new Error("Not connected");const i=await r.request(oA.SET_ACTIVE,{contextLength:e,modelId:t,providerId:n});if(!i.success&&i.error)throw new Error(i.error);return i},U$=({mutationConfig:e}={})=>dn({...e,mutationFn:H$});function T0({label:e}){return h.jsx(uo,{className:"mono border-primary-foreground bg-primary-foreground/20 inline-flex h-6 w-fit items-center gap-1 px-2 text-[10px] leading-none tracking-[0.08em] uppercase",variant:"outline",children:e})}const V$=3e5,q$=({providerId:e})=>{const{apiClient:t}=$e.getState();return t?t.request(Cs.AWAIT_OAUTH_CALLBACK,{providerId:e},{timeout:V$}):Promise.reject(new Error("Not connected"))},$$=({mutationConfig:e}={})=>{const t=un(),{onSuccess:n,...r}=e??{};return dn({onSuccess(...i){t.invalidateQueries({queryKey:su().queryKey}),n?.(...i)},...r,mutationFn:q$})},Y$=({apiKey:e,baseUrl:t,providerId:n})=>{const{apiClient:r}=$e.getState();return r?r.request(Cs.CONNECT,{apiKey:e,baseUrl:t,providerId:n}):Promise.reject(new Error("Not connected"))},W$=({mutationConfig:e}={})=>{const t=un(),{onSuccess:n,...r}=e??{};return dn({onSuccess(...i){t.invalidateQueries({queryKey:su().queryKey}),n?.(...i)},...r,mutationFn:Y$})},G$=({providerId:e})=>{const{apiClient:t}=$e.getState();return t?t.request(Cs.DISCONNECT,{providerId:e}):Promise.reject(new Error("Not connected"))},K$=({mutationConfig:e}={})=>{const t=un(),{onSuccess:n,...r}=e??{};return dn({onSuccess(...i){t.invalidateQueries({queryKey:su().queryKey}),n?.(...i)},...r,mutationFn:G$})},Q$=({providerId:e})=>{const{apiClient:t}=$e.getState();return t?t.request(Cs.SET_ACTIVE,{providerId:e}):Promise.reject(new Error("Not connected"))},X$=({mutationConfig:e}={})=>{const t=un(),{onSuccess:n,...r}=e??{};return dn({onSuccess(...i){t.invalidateQueries({queryKey:su().queryKey}),t.invalidateQueries({queryKey:sv().queryKey}),n?.(...i)},...r,mutationFn:Q$})},Z$=({providerId:e})=>{const{apiClient:t}=$e.getState();return t?t.request(Cs.START_OAUTH,{providerId:e}):Promise.reject(new Error("Not connected"))},J$=({mutationConfig:e}={})=>dn({...e,mutationFn:Z$}),eY=({apiKey:e,providerId:t})=>{const{apiClient:n}=$e.getState();return n?n.request(Cs.VALIDATE_API_KEY,{apiKey:e,providerId:t}):Promise.reject(new Error("Not connected"))},tY=({mutationConfig:e}={})=>dn({...e,mutationFn:eY});let TE=(function(e){return e.disabled="data-disabled",e.valid="data-valid",e.invalid="data-invalid",e.touched="data-touched",e.dirty="data-dirty",e.filled="data-filled",e.focused="data-focused",e})({});const nY={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},Od={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},rY={disabled:!1,...Od},N0={valid(e){return e===null?null:e?{[TE.valid]:""}:{[TE.invalid]:""}}},iY=w.createContext({invalid:void 0,name:void 0,validityData:{state:nY,errors:[],error:"",value:"",initialValue:null},setValidityData:Cr,disabled:void 0,touched:Od.touched,setTouched:Cr,dirty:Od.dirty,setDirty:Cr,filled:Od.filled,setFilled:Cr,focused:Od.focused,setFocused:Cr,validate:()=>null,validationMode:"onSubmit",validationDebounceTime:0,shouldValidateOnChange:()=>!1,state:rY,markedDirtyRef:{current:!1},validation:{getValidationProps:(e=Fn)=>e,getInputValidationProps:(e=Fn)=>e,inputRef:{current:null},commit:async()=>{}}});function Df(e=!0){const t=w.useContext(iY);if(t.setValidityData===Cr&&!e)throw new Error(Cn(28));return t}const oY=w.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:Cr,validationMode:"onSubmit",submitAttemptedRef:{current:!1}});function Cv(){return w.useContext(oY)}const sY=w.createContext({controlId:void 0,registerControlId:Cr,labelId:void 0,setLabelId:Cr,messageIds:[],setMessageIds:Cr,getDescriptionProps:e=>e});function R0(){return w.useContext(sY)}function aY(e,t){return{...e,state:{...e.state,valid:!t&&e.state.valid}}}function $c({controlled:e,default:t,name:n,state:r="value"}){const{current:i}=w.useRef(e!==void 0),[s,a]=w.useState(t),c=i?e:s,u=w.useCallback(f=>{i||a(f)},[]);return[c,u]}function kv(e={}){const{id:t,implicit:n=!1,controlRef:r}=e,{controlId:i,registerControlId:s}=R0(),a=Si(t),c=n?i:void 0,u=ir(()=>Symbol("labelable-control")),f=w.useRef(!1),m=w.useRef(t!=null),p=tt(()=>{!f.current||s===Cr||(f.current=!1,s(u.current,void 0))});return We(()=>{if(s===Cr)return;let y;if(n){const x=r?.current;cn(x)&&x.closest("label")!=null?y=t??null:y=c??a}else if(t!=null)m.current=!0,y=t;else if(m.current)y=a;else{p();return}if(y===void 0){p();return}f.current=!0,s(u.current,y)},[t,r,c,s,n,a,u,p]),w.useEffect(()=>p,[p]),i??a}function Ev(e){const{enabled:t=!0,value:n,id:r,name:i,controlRef:s,commit:a}=e,{formRef:c}=Cv(),{invalid:u,markedDirtyRef:f,validityData:m,setValidityData:p}=Df(),y=tt(e.getValue);We(()=>{if(!t)return;let x=n;x===void 0&&(x=y()),m.initialValue===null&&x!==null&&p(b=>({...b,initialValue:x}))},[t,p,n,m.initialValue,y]),We(()=>{!t||!r||c.current.fields.set(r,{getValue:y,name:i,controlRef:s,validityData:aY(m,u),validate(x=!0){let b=n;b===void 0&&(b=y()),f.current=!0,x?vi.flushSync(()=>a(b)):a(b)}})},[a,s,t,c,y,r,u,f,i,m,n]),We(()=>{const x=c.current.fields;return()=>{r&&x.delete(r)}},[c,r])}const lY=w.forwardRef(function(t,n){const{render:r,className:i,id:s,name:a,value:c,disabled:u=!1,onValueChange:f,defaultValue:m,autoFocus:p=!1,...y}=t,{state:x,name:b,disabled:S,setTouched:k,setDirty:E,validityData:T,setFocused:N,setFilled:j,validationMode:O,validation:A}=Df(),R=S||u,L=b??a,B={...x,disabled:R},{labelId:I}=R0(),U=kv({id:s});We(()=>{const $=c!=null;A.inputRef.current?.value||$&&c!==""?j(!0):$&&c===""&&j(!1)},[A.inputRef,j,c]);const Y=w.useRef(null);We(()=>{p&&Y.current===mi(Zt(Y.current))&&N(!0)},[p,N]);const[V]=$c({controlled:c,default:m,name:"FieldControl",state:"value"}),q=c!==void 0,H=q?V:void 0;return Ev({id:U,name:L,commit:A.commit,value:H,getValue:()=>A.inputRef.current?.value,controlRef:A.inputRef}),jt("input",t,{ref:[n,Y],state:B,props:[{id:U,disabled:R,name:L,ref:A.inputRef,"aria-labelledby":I,autoFocus:p,...q?{value:H}:{defaultValue:m},onChange($){const G=$.currentTarget.value;f?.(G,Et(wl,$.nativeEvent)),E(G!==T.initialValue),j(G!=="")},onFocus(){N(!0)},onBlur($){k(!0),N(!1),O==="onBlur"&&A.commit($.currentTarget.value)},onKeyDown($){$.currentTarget.tagName==="INPUT"&&$.key==="Enter"&&(k(!0),A.commit($.currentTarget.value))}},A.getInputValidationProps(),y],stateAttributesMapping:N0})}),cY=w.createContext({disabled:!1});function uY(){return w.useContext(cY)}const dY=w.createContext(void 0);function fY(e=!0){const t=w.useContext(dY);if(t===void 0&&!e)throw new Error(Cn(3));return t}const hY=w.forwardRef(function(t,n){return h.jsx(lY,{ref:n,...t})});function Wi({className:e,type:t,...n}){return h.jsx(hY,{type:t,"data-slot":"input",className:ae("h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-2.5 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",e),...n})}function pY({error:e,isOptional:t,isValidating:n,onBack:r,onSubmit:i,provider:s}){const[a,c]=w.useState("");return h.jsxs("div",{className:"flex flex-1 flex-col gap-6",children:[h.jsx(Ci,{children:h.jsxs(ki,{className:"flex items-center gap-2",children:[h.jsx("button",{className:"hover:bg-muted rounded p-0.5 transition-colors",onClick:r,type:"button",children:h.jsx(gl,{className:"size-5"})}),"Selecting ",s.name]})}),h.jsxs("div",{className:"flex flex-col gap-4",children:[s.apiKeyUrl&&h.jsxs("p",{className:"text-muted-foreground text-sm",children:["Get your API key at"," ",h.jsx("a",{className:"underline hover:text-foreground",href:s.apiKeyUrl,rel:"noopener noreferrer",target:"_blank",children:s.apiKeyUrl})]}),e&&h.jsx("div",{className:"text-destructive bg-destructive/10 rounded-lg px-4 py-2.5 text-sm",children:e}),h.jsxs("div",{className:"flex flex-col gap-2",children:[h.jsxs("label",{className:"text-foreground text-sm font-medium",htmlFor:"api-key",children:["Enter your ",s.name," API key"]}),h.jsx(Wi,{id:"api-key",onChange:u=>c(u.target.value),placeholder:"Enter key",type:"password",value:a})]})]}),h.jsxs(Ea,{className:"mt-auto",children:[h.jsx(ze,{onClick:r,variant:"secondary",children:"Cancel"}),h.jsx(ze,{disabled:!t&&!a.trim()||n,onClick:()=>i(a.trim()),children:n?"Validating...":"Change"})]})]})}function mY({onBack:e,onSelect:t,provider:n}){return h.jsxs("div",{className:"flex flex-1 flex-col gap-6",children:[h.jsx(Ci,{children:h.jsxs(ki,{className:"flex items-center gap-2",children:[h.jsx("button",{className:"hover:bg-muted rounded p-0.5 transition-colors",onClick:e,type:"button",children:h.jsx(gl,{className:"size-5"})}),"Connect ",n.name]})}),h.jsxs("div",{className:"flex flex-col gap-2",children:[h.jsxs("button",{className:"hover:bg-muted flex w-full cursor-pointer items-center gap-3 rounded-lg px-3 py-3 text-left transition-colors",onClick:()=>t("oauth"),type:"button",children:[h.jsx(s$,{className:"text-muted-foreground size-5"}),h.jsxs("div",{className:"flex flex-col",children:[h.jsx("span",{className:"text-foreground text-sm font-medium",children:n.oauthLabel??"Sign in with browser"}),h.jsx("span",{className:"text-muted-foreground text-xs",children:"Authenticate via OAuth in your browser"})]})]}),h.jsxs("button",{className:"hover:bg-muted flex w-full cursor-pointer items-center gap-3 rounded-lg px-3 py-3 text-left transition-colors",onClick:()=>t("api-key"),type:"button",children:[h.jsx(c$,{className:"text-muted-foreground size-5"}),h.jsxs("div",{className:"flex flex-col",children:[h.jsx("span",{className:"text-foreground text-sm font-medium",children:"Enter API key"}),h.jsx("span",{className:"text-muted-foreground text-xs",children:"Paste your API key manually"})]})]})]}),h.jsx(Ea,{className:"mt-auto",children:h.jsx(ze,{onClick:e,variant:"secondary",children:"Cancel"})})]})}function gY(e){if(!e)return"Base URL is required";try{const t=new URL(e);return["http:","https:"].includes(t.protocol)?void 0:"URL must start with http:// or https://"}catch{return"Invalid URL format"}}function yY({error:e,onBack:t,onSubmit:n,provider:r}){const[i,s]=w.useState(""),[a,c]=w.useState(),u=a??e,f=w.useCallback(()=>{const m=i.trim().replace(/\/+$/,""),p=gY(m);if(p){c(p);return}c(void 0),n(m)},[i,n]);return h.jsxs("div",{className:"flex flex-1 flex-col gap-6",children:[h.jsx(Ci,{children:h.jsxs(ki,{className:"flex items-center gap-2",children:[h.jsx("button",{className:"hover:bg-muted rounded p-0.5 transition-colors",onClick:t,type:"button",children:h.jsx(gl,{className:"size-5"})}),"Selecting ",r.name]})}),h.jsxs("div",{className:"flex flex-col gap-2",children:[h.jsx("label",{className:"text-foreground text-sm font-medium",htmlFor:"base-url",children:"Enter endpoint manually"}),h.jsx(Wi,{id:"base-url",onChange:m=>{s(m.target.value),c(void 0)},placeholder:"http://localhost:11434/v1",value:i}),u&&h.jsx("p",{className:"text-destructive text-sm",children:u})]}),h.jsxs(Ea,{className:"mt-auto",children:[h.jsx(ze,{onClick:t,variant:"secondary",children:"Cancel"}),h.jsx(ze,{disabled:!i.trim(),onClick:f,children:"Change"})]})]})}const NA=()=>{const{apiClient:e}=$e.getState();return e?e.request(Rf.START_LOGIN,{skipBrowserLaunch:!0}):Promise.reject(new Error("Not connected"))},RA=e=>{const{apiClient:t}=$e.getState();return t?t.on(Rf.LOGIN_COMPLETED,e):()=>{}};function Tv(e){try{const t=new URL(e);return t.protocol==="http:"||t.protocol==="https:"}catch{return!1}}const xY=2500,bY=800;function vY(e){return new Promise(t=>{setTimeout(t,e)})}function wY({onAuthenticated:e,onBack:t,popup:n}){const r=un(),i=yi(y=>y.isAuthorized),s=yi(y=>y.setLoggingIn),[a,c]=w.useState({type:"starting"}),[u,f]=w.useState(0),m=w.useRef(!1);w.useEffect(()=>{if(m.current)return;m.current=!0,s(!0);let y=!1;async function x(){try{const[b]=await Promise.all([NA(),vY(bY)]);if(y)return;if(!Tv(b.authUrl)){n?.close(),c({message:"Received an unsafe OAuth URL from the daemon",type:"error"}),s(!1);return}n&&!n.closed?(n.location.href=b.authUrl,c({authUrl:b.authUrl,type:"waiting"})):c({authUrl:b.authUrl,type:"blocked"})}catch(b){if(y)return;s(!1),c({message:b instanceof Error?b.message:"Unable to start login",type:"error"})}}return x().catch(()=>{}),()=>{y=!0}},[n,s,u]),w.useEffect(()=>{i&&a.type==="waiting"&&(s(!1),e())},[i,e,s,a.type]),w.useEffect(()=>a.type!=="waiting"?void 0:RA(x=>{x.success&&x.user?r.invalidateQueries({queryKey:To().queryKey}):c({message:x.error??"Authentication failed",type:"error"}),s(!1)}),[r,s,a.type]),w.useEffect(()=>{if(a.type!=="waiting")return;let y=!1;async function x(){try{const S=await r.fetchQuery(To());if(y)return;S.isAuthorized&&(r.invalidateQueries({queryKey:To().queryKey}),s(!1))}catch{}}const b=globalThis.setInterval(x,xY);return()=>{y=!0,globalThis.clearInterval(b)}},[r,s,a.type]);function p(){m.current=!1,c({type:"starting"}),f(y=>y+1)}return h.jsxs("div",{className:"flex flex-1 flex-col gap-6",children:[h.jsx(Ci,{children:h.jsxs(ki,{className:"flex items-center gap-2",children:[h.jsx("button",{className:"hover:bg-muted rounded p-0.5 transition-colors",onClick:t,type:"button",children:h.jsx(gl,{className:"size-5"})}),"Signing in to ByteRover"]})}),h.jsxs("div",{className:"flex flex-col gap-4",children:[a.type==="starting"&&h.jsxs("div",{className:"border-primary/30 bg-primary/5 flex items-center gap-2 rounded-lg border p-3 text-sm",children:[h.jsx(ei,{className:"text-primary-foreground size-4 animate-spin"}),"Preparing sign-in…"]}),a.type==="waiting"&&h.jsxs("div",{className:"border-primary/30 bg-primary/5 flex flex-col gap-1 rounded-lg border p-3",children:[h.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[h.jsx(ei,{className:"text-primary-foreground size-4 animate-spin"}),"Finish signing in in the new tab."]}),h.jsxs("div",{className:"text-muted-foreground pl-6 text-xs",children:["If the tab didn’t open,"," ",h.jsx("a",{className:"underline underline-offset-2",href:a.authUrl,rel:"noopener noreferrer",target:"_blank",children:"click this link"}),"."]})]}),a.type==="blocked"&&h.jsxs("div",{className:"border-border bg-muted text-foreground flex items-center gap-2 rounded-lg border p-3 text-sm",children:[h.jsx(Mm,{className:"size-4 shrink-0"}),"Your browser blocked the sign-in popup."]}),a.type==="error"&&h.jsx("div",{className:"text-destructive bg-destructive/10 rounded-lg px-4 py-2.5 text-sm",children:a.message})]}),h.jsxs(Ea,{className:"mt-auto",children:[h.jsx(ze,{onClick:t,variant:"secondary",children:"Use a different provider"}),a.type==="error"&&h.jsx(ze,{onClick:p,children:"Retry sign-in"}),a.type==="blocked"&&h.jsxs(ze,{onClick:()=>{window.open(a.authUrl,"_blank","noopener,noreferrer"),c({authUrl:a.authUrl,type:"waiting"})},children:[h.jsx(Mm,{className:"size-3.5"}),"Open sign-in page"]}),(a.type==="starting"||a.type==="waiting")&&h.jsx(ze,{disabled:!0,children:"Waiting…"})]})]})}const SY=({providerId:e})=>{const{apiClient:t}=$e.getState();return t?t.request(oA.LIST,{providerId:e}):Promise.reject(new Error("Not connected"))},CY=e=>({queryFn:()=>SY({providerId:e}),queryKey:["models",e]}),AA=({providerId:e,queryConfig:t})=>or({...CY(e),...t});function kY({onBack:e,onSelect:t,providerId:n}){const[r,i]=w.useState(""),{data:s,isLoading:a}=AA({providerId:n}),[c,u]=w.useState(),f=w.useMemo(()=>s?.models??[],[s?.models]);w.useEffect(()=>{s?.activeModel&&!c&&u(s.activeModel)},[s?.activeModel,c]);const m=w.useMemo(()=>{if(!r)return f;const y=r.toLowerCase();return f.filter(x=>x.name.toLowerCase().includes(y)||x.id.toLowerCase().includes(y))},[f,r]),p=w.useMemo(()=>f.find(y=>y.id===c),[f,c]);return a?h.jsxs("div",{className:"flex flex-1 flex-col gap-6",children:[h.jsx(Ci,{children:h.jsxs(ki,{className:"flex items-center gap-2",children:[h.jsx("button",{className:"hover:bg-muted rounded p-0.5 transition-colors",onClick:e,type:"button",children:h.jsx(gl,{className:"size-5"})}),"Choose model"]})}),h.jsx("div",{className:"flex items-center justify-center py-12",children:h.jsx(ei,{className:"text-muted-foreground size-5 animate-spin"})})]}):h.jsxs("div",{className:"flex flex-1 flex-col gap-6",children:[h.jsx(Ci,{children:h.jsxs(ki,{className:"flex items-center gap-2",children:[h.jsx("button",{className:"hover:bg-muted rounded p-0.5 transition-colors",onClick:e,type:"button",children:h.jsx(gl,{className:"size-5"})}),"Choose model"]})}),h.jsxs("div",{className:"flex flex-col gap-3",children:[h.jsxs("div",{className:"relative",children:[h.jsx(au,{className:"text-muted-foreground absolute top-1/2 left-3 size-4 -translate-y-1/2"}),h.jsx(Wi,{className:"pl-9",onChange:y=>i(y.target.value),placeholder:"Search...",value:r})]}),h.jsxs("div",{className:"max-h-96 overflow-y-auto",children:[m.map(y=>{const x=y.id===c;return h.jsxs("button",{className:`border-border flex w-full cursor-pointer items-center justify-between border-b px-3 py-2.5 text-left transition-colors last:border-b-0 ${x?"bg-primary/10":"hover:bg-muted"}`,onClick:()=>u(y.id),type:"button",children:[h.jsx("span",{className:"text-foreground text-sm",children:y.name}),x&&h.jsx(Rl,{className:"text-primary size-4"})]},y.id)}),m.length===0&&h.jsx("p",{className:"text-muted-foreground py-8 text-center text-sm",children:"No models found"})]})]}),h.jsxs(Ea,{className:"mt-auto",children:[h.jsx(ze,{onClick:e,variant:"secondary",children:"Cancel"}),h.jsx(ze,{disabled:!p,onClick:()=>p&&t(p),children:"Confirm"})]})]})}function EY({error:e,onAction:t,onBack:n,provider:r}){const{data:i}=AA({providerId:r.id}),s=i?.activeModel,a=r.id==="byterover";return h.jsxs("div",{className:"flex flex-1 flex-col gap-6",children:[h.jsx(Ci,{children:h.jsxs(ki,{className:"flex items-center gap-2",children:[h.jsx("button",{className:"hover:bg-muted rounded p-0.5 transition-colors",onClick:n,type:"button",children:h.jsx(gl,{className:"size-5"})}),r.name]})}),h.jsxs("div",{className:"flex flex-col gap-4",children:[e&&h.jsx("div",{className:"text-destructive bg-destructive/10 rounded-lg px-4 py-2.5 text-sm",children:e}),a?h.jsxs("div",{className:"flex items-start justify-between",children:[h.jsxs("div",{className:"flex flex-col gap-1",children:[h.jsx("span",{className:"text-foreground text-sm font-medium",children:"Status"}),h.jsx("span",{className:"text-muted-foreground text-sm",children:r.isConnected?"Connected":"Not connected"})]}),r.isConnected&&h.jsx(ze,{onClick:()=>t("disconnect"),size:"sm",variant:"outline",children:"Disconnect"})]}):h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:"flex items-start justify-between",children:[h.jsxs("div",{className:"flex flex-col gap-1",children:[h.jsx("span",{className:"text-foreground text-sm font-medium",children:"Model"}),h.jsx("span",{className:"text-muted-foreground text-sm",children:s??"Not selected"})]}),h.jsx(ze,{onClick:()=>t("change_model"),size:"sm",variant:"outline",children:"Change"})]}),h.jsxs("div",{className:"flex items-start justify-between",children:[h.jsxs("div",{className:"flex flex-col gap-1",children:[h.jsx("span",{className:"text-foreground text-sm font-medium",children:r.authMethod==="oauth"?"OAuth":"API Key"}),h.jsx("span",{className:"text-muted-foreground text-sm",children:r.authMethod==="oauth"?"Authenticated via browser":"****************"})]}),h.jsx(ze,{onClick:()=>t("disconnect"),size:"sm",variant:"outline",children:"Disconnect"})]})]})]}),!r.isCurrent&&h.jsxs(Ea,{className:"mt-auto",children:[h.jsx(ze,{onClick:n,variant:"secondary",children:"Cancel"}),h.jsx(ze,{onClick:()=>t("activate"),children:"Active"})]})]})}const TY="data:image/svg+xml,%3csvg%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M4.53096%2012.97L8.07285%2010.9839L8.13242%2010.8115L8.07285%2010.7155H7.90026L7.30833%2010.679L5.28456%2010.6244L3.5294%2010.5515L1.82897%2010.4604L1.4011%2010.3693L1%209.84087L1.04132%209.57726L1.40112%209.33553L1.91647%209.38047L3.05537%209.45823L4.76433%209.57605L6.00411%209.64894L7.8407%209.83964H8.13242L8.17374%209.72182L8.07407%209.64894L7.99629%209.57605L6.22776%208.37831L4.31339%207.11255L3.31063%206.38372L2.76851%206.01443L2.49504%205.66823L2.37713%204.91268L2.86941%204.3709L3.53062%204.41585L3.69958%204.46079L4.3693%204.97583L5.79991%206.08247L7.66811%207.45754L7.94158%207.68469L8.05098%207.60696L8.06435%207.55229L7.94158%207.34701L6.92544%205.51154L5.84125%203.64449L5.35869%202.8707L5.23107%202.40667C5.1861%202.21595%205.15329%202.05561%205.15329%201.86003L5.71361%201.09961L6.02356%201L6.77108%201.09961L7.0859%201.37293L7.55021%202.43462L8.30258%204.10609L9.46944%206.37885L9.81099%207.05303L9.9933%207.67741L10.0614%207.86813H10.1793V7.75881L10.2753%206.47848L10.4528%204.9066L10.6254%202.88406L10.6849%202.31435L10.9669%201.63166L11.5272%201.2624L11.9648%201.47133L12.3246%201.98638L12.2748%202.31922L12.0608%203.70888L11.6415%205.8857L11.368%207.34338H11.5272L11.7095%207.16118L12.4474%206.18209L13.6871%204.6333L14.2341%204.01864L14.8722%203.3396L15.2818%203.01648H16.0561L16.6262%203.86316L16.3709%204.73776L15.5736%205.74843L14.9123%206.60483L13.9643%207.88029L13.3723%208.90067L13.427%208.98206L13.568%208.96869L15.7097%208.51317L16.8668%208.30424L18.2476%208.06736L18.8724%208.3589L18.9404%208.65528L18.6949%209.26145L17.2181%209.62586L15.4861%209.97207L12.9068%2010.5819L12.8752%2010.605L12.9117%2010.6499L14.0737%2010.7592L14.5708%2010.7859H15.7875L18.0531%2010.9548L18.6451%2011.3459L19%2011.8246L18.9404%2012.189L18.0288%2012.653L16.7988%2012.3614L13.9278%2011.6788L12.9433%2011.4334H12.8072V11.5148L13.6276%2012.3165L15.1311%2013.6734L17.0139%2015.4226L17.1099%2015.855L16.8681%2016.1964L16.6128%2016.1599L14.9585%2014.9161L14.3204%2014.3561L12.8752%2013.1401H12.7792V13.2676L13.1122%2013.7548L14.871%2016.3968L14.9622%2017.2071L14.8346%2017.4706L14.3788%2017.6298L13.878%2017.5387L12.8485%2016.0944L11.7861%2014.4678L10.9292%2013.0101L10.8247%2013.0697L10.3191%2018.5129L10.0821%2018.7911L9.53507%2019L9.07927%2018.6538L8.83739%2018.0938L9.07927%2016.9872L9.37099%2015.5429L9.608%2014.3949L9.82193%2012.9688L9.94955%2012.4951L9.94105%2012.4635L9.83651%2012.4769L8.76081%2013.9528L7.12479%2016.1624L5.83031%2017.5472L5.52036%2017.6699L4.98312%2017.3917L5.03294%2016.8949L5.33317%2016.4527L7.12479%2014.1751L8.20535%2012.7635L8.90303%2011.9485L8.89817%2011.8306H8.85684L4.09825%2014.9185L3.25106%2015.0278L2.88643%2014.6865L2.9314%2014.1265L3.10398%2013.9443L4.5346%2012.9603L4.52974%2012.9652L4.53096%2012.97Z'%20fill='%23D4D4D4'/%3e%3c/svg%3e",NY="data:image/svg+xml,%3csvg%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M10%2020C15.5228%2020%2020%2015.5228%2020%2010C20%204.47715%2015.5228%200%2010%200C4.47715%200%200%204.47715%200%2010C0%2015.5228%204.47715%2020%2010%2020Z'%20fill='black'/%3e%3cpath%20d='M10.001%2019.002C14.9715%2019.002%2019.001%2014.9725%2019.001%2010.002C19.001%205.03139%2014.9715%201.00195%2010.001%201.00195C5.03042%201.00195%201.00098%205.03139%201.00098%2010.002C1.00098%2014.9725%205.03042%2019.002%2010.001%2019.002Z'%20fill='%23FAFAFA'/%3e%3cpath%20d='M9.99951%2017.998C14.4178%2017.998%2017.9995%2014.4163%2017.9995%209.99805C17.9995%205.57977%2014.4178%201.99805%209.99951%201.99805C5.58123%201.99805%201.99951%205.57977%201.99951%209.99805C1.99951%2014.4163%205.58123%2017.998%209.99951%2017.998Z'%20fill='black'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M3.31787%209.29102C3.31787%209.29102%2018.082%209.72982%2016.6512%2015.291C15.9389%2016.4198%2015.8512%2015.691%2015.8512%2015.691C15.8512%2015.691%2018.2852%2011.1457%203.31787%209.29102Z'%20fill='%23FAFAFA'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M5.27588%205.86523C5.27588%205.86523%2020.04%206.30403%2018.6092%2011.8652C17.8969%2012.994%2017.8092%2012.2652%2017.8092%2012.2652C17.8092%2012.2652%2020.2432%207.7199%205.27588%205.86523Z'%20fill='%23FAFAFA'/%3e%3cpath%20d='M8.72058%203.59961C8.75064%203.60051%2016.4092%203.83385%2017.83%206.39648L17.3895%206.91504C16.922%205.87794%2015.0863%204.38843%208.72058%203.59961Z'%20fill='%23FAFAFA'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M5.45898%2013.9904C5.48859%2013.9908%2013.7293%2014.1055%2013.9676%2017.2002L13.4287%2017.5307C13.2582%2016.5898%2011.9628%2014.9484%205.45898%2013.9904Z'%20fill='%23FAFAFA'/%3e%3c/svg%3e",RY="data:image/svg+xml,%3csvg%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M11.7675%202.25036C9.71229%202.25036%207.74126%203.06679%206.28801%204.52004C4.83476%205.97329%204.01833%207.94432%204.01833%209.99953C4.01833%2012.0547%204.83476%2014.0258%206.28801%2015.479C7.74126%2016.9323%209.71229%2017.7487%2011.7675%2017.7487V18.9162C6.8425%2018.9162%202.85083%2014.9237%202.85083%209.9987C2.85083%205.0737%206.84166%201.08203%2011.7667%201.08203V2.24953L11.7675%202.25036ZM15.7275%205.31453C15.1118%204.79188%2014.3989%204.3961%2013.6297%204.14994C12.8605%203.90378%2012.0503%203.8121%2011.2455%203.88018C10.4408%203.94825%209.65746%204.17474%208.94056%204.54661C8.22366%204.91848%207.58735%205.42841%207.06821%206.04706C6.54907%206.6657%206.15735%207.38088%205.91557%208.15144C5.6738%208.92201%205.58673%209.73277%205.65938%2010.5371C5.73204%2011.3414%205.96298%2012.1235%206.33892%2012.8382C6.71487%2013.553%207.2284%2014.1864%207.85%2014.702L7.09916%2015.597C6.36511%2014.9813%205.75953%2014.227%205.31702%2013.3772C4.87452%2012.5274%204.60374%2011.5987%204.52017%2010.6443C4.43659%209.68983%204.54185%208.72826%204.82994%207.81448C5.11802%206.90071%205.58329%206.05264%206.19916%205.3187C6.81497%204.58461%207.56935%203.97902%208.41922%203.5365C9.26909%203.09398%2010.1978%202.8232%2011.1523%202.73963C12.1069%202.65606%2013.0685%202.76132%2013.9823%203.04942C14.8962%203.33752%2015.7443%203.8028%2016.4783%204.4187L15.7275%205.31453ZM13.8483%206.01786C12.7928%205.47266%2011.5646%205.36641%2010.4311%205.72223C9.29756%206.07806%208.35044%206.86716%207.79583%207.91781C7.24123%208.96847%207.12401%2010.1956%207.4697%2011.3323C7.81539%2012.4689%208.596%2013.4231%209.64166%2013.987L9.095%2015.0204C7.7889%2014.3042%206.81675%2013.1032%206.38832%2011.6766C5.95989%2010.25%206.10954%208.7121%206.80498%207.39485C7.50041%206.07759%208.68587%205.08657%2010.1055%204.63564C11.5252%204.1847%2013.0652%204.31001%2014.3933%204.98453L13.8483%206.01786ZM11.7667%207.11536C11.0017%207.11536%2010.2681%207.41923%209.72725%207.96012C9.18636%208.501%208.8825%209.2346%208.8825%209.99953C8.8825%2010.7645%209.18636%2011.4981%209.72725%2012.0389C10.2681%2012.5798%2011.0017%2012.8837%2011.7667%2012.8837V14.052C10.6919%2014.052%209.6611%2013.6251%208.90111%2012.8651C8.14112%2012.1051%207.71416%2011.0743%207.71416%209.99953C7.71416%208.92474%208.14112%207.89397%208.90111%207.13398C9.6611%206.37399%2010.6919%205.94703%2011.7667%205.94703V7.11536Z'%20fill='%23D4D4D4'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M12.8392%209.03094C12.715%208.89716%2012.5718%208.78232%2012.4142%208.69011C12.277%208.60856%2012.1205%208.56486%2011.9609%208.56344C11.7484%208.56344%2011.5584%208.60261%2011.3909%208.68011C11.229%208.75304%2011.0835%208.85797%2010.9632%208.98857C10.8429%209.11918%2010.7503%209.27277%2010.6909%209.44011C10.6292%209.60927%2010.5992%209.78677%2010.5992%209.96594C10.5992%2010.1476%2010.6292%2010.3243%2010.6909%2010.4918C10.7508%2010.6589%2010.8436%2010.8124%2010.9638%2010.9431C11.0841%2011.0738%2011.2293%2011.179%2011.3909%2011.2526C11.5576%2011.3301%2011.7492%2011.3693%2011.9609%2011.3693C12.1409%2011.3693%2012.3084%2011.3309%2012.4626%2011.2568C12.6192%2011.1818%2012.7542%2011.0693%2012.8584%2010.9301L13.6317%2011.7684C13.5151%2011.8851%2013.3817%2011.9859%2013.2301%2012.0709C12.9496%2012.2274%2012.6443%2012.3345%2012.3276%2012.3876C12.1859%2012.4093%2012.0634%2012.4209%2011.9609%2012.4209C11.6246%2012.423%2011.2908%2012.3637%2010.9759%2012.2459C10.6781%2012.1358%2010.4057%2011.9666%2010.1751%2011.7484C9.94568%2011.5293%209.76311%2011.2659%209.63839%2010.9743C9.50286%2010.6556%209.43531%2010.3122%209.44005%209.96594C9.44005%209.59594%209.50672%209.26011%209.63839%208.95761C9.76339%208.66594%209.94505%208.40261%2010.1742%208.18344C10.4059%207.96594%2010.6784%207.79677%2010.9759%207.68677C11.2908%207.56898%2011.6246%207.50967%2011.9609%207.51177C12.2567%207.51177%2012.5542%207.56844%2012.8542%207.68177C13.1551%207.79677%2013.4251%207.98177%2013.6409%208.22261L12.8392%209.03094Z'%20fill='%23D4D4D4'/%3e%3c/svg%3e",AY="data:image/svg+xml,%3csvg%20width='154'%20height='154'%20viewBox='0%200%20154%20154'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cmask%20id='mask0_2024_36638'%20style='mask-type:luminance'%20maskUnits='userSpaceOnUse'%20x='0'%20y='0'%20width='155'%20height='155'%3e%3cpath%20d='M0%200H154.006V154.006H0V0Z'%20fill='white'/%3e%3c/mask%3e%3cg%20mask='url(%23mask0_2024_36638)'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M49.8953%2091.6962C54.0408%2091.6962%2062.2864%2091.4688%2073.6847%2086.7762C86.9655%2081.308%20113.39%2071.381%20132.453%2061.1848C145.784%2054.0535%20151.628%2044.621%20151.628%2031.9191C151.628%2014.2909%20137.337%200%20119.709%200H45.8476C20.5281%200%200%2020.5272%200%2045.8485C0%2071.169%2019.2191%2091.6962%2049.8953%2091.6962Z'%20fill='white'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M62.3879%20123.269C62.388%20117.199%2064.1868%20111.266%2067.5572%20106.218C70.9276%20101.17%2075.7184%2097.2344%2081.3244%2094.908L104.585%2085.2545C128.112%2075.4896%20154.009%2092.78%20154.009%20118.254C154.009%20137.99%20138.007%20153.987%20118.27%20153.982L93.0868%20153.976C76.1307%20153.971%2062.3879%20140.225%2062.3879%20123.269Z'%20fill='white'/%3e%3cpath%20d='M26.4302%2097.7402C11.8322%2097.7402%200%20109.572%200%20124.17V127.593C0%20142.189%2011.8331%20154.022%2026.4293%20154.022C41.0263%20154.022%2052.8595%20142.189%2052.8595%20127.593V124.17C52.8595%20109.572%2041.0263%2097.7402%2026.4302%2097.7402Z'%20fill='white'/%3e%3c/g%3e%3c/svg%3e",OY="/assets/deepinfra-provider-C9hH_wkN.svg",jY="data:image/svg+xml,%3csvg%20viewBox='18%2021%2028%2023'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eDeepSeek%20icon%3c/title%3e%3cg%20transform='translate(19.2,%2019.2)'%20fill='%23D4D4D4'%3e%3cpath%20d='M23.748%204.482c-.254-.124-.364.113-.512.234-.051.039-.094.09-.137.136-.372.397-.806.657-1.373.626-.829-.046-1.537.214-2.163.848-.133-.782-.575-1.248-1.247-1.548-.352-.156-.708-.311-.955-.65-.172-.241-.219-.51-.305-.774-.055-.16-.11-.323-.293-.35-.2-.031-.278.136-.356.276-.313.572-.434%201.202-.422%201.84.027%201.436.633%202.58%201.838%203.393.137.093.172.187.129.323-.082.28-.18.552-.266.833-.055.179-.137.217-.329.14a5.526%205.526%200%2001-1.736-1.18c-.857-.828-1.631-1.742-2.597-2.458a11.365%2011.365%200%2000-.689-.471c-.985-.957.13-1.743.388-1.836.27-.098.093-.432-.779-.428-.872.004-1.67.295-2.687.684a3.055%203.055%200%2001-.465.137%209.597%209.597%200%2000-2.883-.102c-1.885.21-3.39%201.102-4.497%202.623C.082%208.606-.231%2010.684.152%2012.85c.403%202.284%201.569%204.175%203.36%205.653%201.858%201.533%203.997%202.284%206.438%202.14%201.482-.085%203.133-.284%204.994-1.86.47.234.962.327%201.78.397.63.059%201.236-.03%201.705-.128.735-.156.684-.837.419-.961-2.155-1.004-1.682-.595-2.113-.926%201.096-1.296%202.746-2.642%203.392-7.003.05-.347.007-.565%200-.845-.004-.17.035-.237.23-.256a4.173%204.173%200%20001.545-.475c1.396-.763%201.96-2.015%202.093-3.517.02-.23-.004-.467-.247-.588zM11.581%2018c-2.089-1.642-3.102-2.183-3.52-2.16-.392.024-.321.471-.235.763.09.288.207.486.371.739.114.167.192.416-.113.603-.673.416-1.842-.14-1.897-.167-1.361-.802-2.5-1.86-3.301-3.307-.774-1.393-1.224-2.887-1.298-4.482-.02-.386.093-.522.477-.592a4.696%204.696%200%20011.529-.039c2.132.312%203.946%201.265%205.468%202.774.868.86%201.525%201.887%202.202%202.891.72%201.066%201.494%202.082%202.48%202.914.348.292.625.514.891.677-.802.09-2.14.11-3.054-.614zm1-6.44a.306.306%200%2001.415-.287.302.302%200%2001.2.288.306.306%200%2001-.31.307.303.303%200%2001-.304-.308zm3.11%201.596c-.2.081-.399.151-.59.16a1.245%201.245%200%2001-.798-.254c-.274-.23-.47-.358-.552-.758a1.73%201.73%200%2001.016-.588c.07-.327-.008-.537-.239-.727-.187-.156-.426-.199-.688-.199a.559.559%200%2001-.254-.078c-.11-.054-.2-.19-.114-.358.028-.054.16-.186.192-.21.356-.202.767-.136%201.146.016.352.144.618.408%201.001.782.391.451.462.576.685.914.176.265.336.537.445.848.067.195-.019.354-.25.452z'%20fill='%23D4D4D4'/%3e%3c/g%3e%3c/svg%3e",MY="data:image/svg+xml,%3csvg%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M17.05%209.04649C15.6632%208.44953%2014.4499%207.63057%2013.4094%206.59059C12.3695%205.55064%2011.5505%204.33675%2010.9535%202.94998C10.7243%202.4185%2010.5402%201.87217%2010.399%201.31204C10.353%201.12891%2010.1888%201%2010%201C9.81124%201%209.64703%201.12891%209.60102%201.31204C9.45981%201.87217%209.27566%202.41798%209.04649%202.94998C8.44953%204.33675%207.63057%205.55064%206.59059%206.59059C5.55064%207.63057%204.33675%208.44953%202.94998%209.04649C2.41849%209.27566%201.87217%209.4598%201.31204%209.60102C1.12891%209.64703%201%209.81124%201%2010C1%2010.1888%201.12891%2010.353%201.31204%2010.399C1.87217%2010.5402%202.41798%2010.7243%202.94998%2010.9535C4.33675%2011.5505%205.55014%2012.3695%206.59059%2013.4094C7.63107%2014.4494%208.44953%2015.6632%209.04649%2017.05C9.27566%2017.5815%209.45981%2018.1278%209.60102%2018.688C9.64703%2018.8711%209.81124%2019%2010%2019C10.1888%2019%2010.353%2018.8711%2010.399%2018.688C10.5402%2018.1278%2010.7243%2017.582%2010.9535%2017.05C11.5505%2015.6632%2012.3695%2014.4499%2013.4094%2013.4094C14.4494%2012.3695%2015.6632%2011.5505%2017.05%2010.9535C17.5815%2010.7243%2018.1278%2010.5402%2018.688%2010.399C18.8711%2010.353%2019%2010.1888%2019%2010C19%209.81124%2018.8711%209.64703%2018.688%209.60102C18.1278%209.4598%2017.582%209.27566%2017.05%209.04649Z'%20fill='%23D4D4D4'/%3e%3c/svg%3e",DY="data:image/svg+xml,%3csvg%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M10.03%201.66627C6.81913%201.6371%204.19663%204.16627%204.16663%207.3171C4.13746%2010.4688%206.71246%2013.0438%209.92329%2013.0729H11.94V10.9346H10.03C8.02413%2010.9579%206.37996%209.3796%206.35663%207.4096C6.33246%205.44127%207.94079%203.82793%209.94663%203.8046H10.03C12.0358%203.8046%2013.6616%205.40043%2013.6675%207.3696V12.6238C13.6675%2014.5754%2012.0475%2016.1654%2010.065%2016.1896C9.11901%2016.1829%208.2127%2015.8088%207.53746%2015.1463L5.99496%2016.6613C7.07129%2017.7186%208.51543%2018.3177%2010.0241%2018.3329H10.1008C13.27%2018.2863%2015.8158%2015.7638%2015.8333%2012.6529V7.23627C15.7558%204.13543%2013.1808%201.66627%2010.03%201.66627Z'%20fill='%23D4D4D4'/%3e%3c/svg%3e",_Y="data:image/svg+xml,%3csvg%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M18.205%200C18.63%200%2019.0377%200.168834%2019.3382%200.469361C19.6387%200.769888%2019.8075%201.17749%2019.8075%201.6025C19.8075%202.02751%2019.6387%202.43511%2019.3382%202.73564C19.0377%203.03617%2018.63%203.205%2018.205%203.205H16.7917C16.7669%203.20511%2016.7423%203.20032%2016.7194%203.1909C16.6964%203.18149%2016.6756%203.16763%2016.658%203.15013C16.6404%203.13263%2016.6265%203.11184%2016.617%203.08893C16.6074%203.06603%2016.6025%203.04147%2016.6025%203.01667V1.6025C16.6025%200.7175%2017.32%200%2018.205%200Z'%20fill='%23D4D4D4'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M9.22083%209.3319L15.2683%203.3319C15.3825%203.21857%2015.3183%202.99023%2015.1717%202.99023H11.9167C11.8984%202.99044%2011.8804%202.99431%2011.8636%203.00161C11.8469%203.00891%2011.8318%203.01949%2011.8192%203.03273L5.3025%209.49607C5.20083%209.59607%205.05083%209.5069%205.05083%209.3469V3.18273C5.05083%203.0769%204.98167%202.99107%204.89667%202.99107H2.655C2.56917%202.99107%202.5%203.0769%202.5%203.18273V16.4744C2.5%2016.5811%202.56917%2016.6661%202.655%2016.6661H4.89667C4.9825%2016.6661%205.05167%2016.5811%205.05167%2016.4744V13.7661C5.05167%2013.7086%205.0725%2013.6536%205.10917%2013.6177L7.12917%2011.6127C7.15062%2011.5896%207.17967%2011.5749%207.21102%2011.5714C7.24238%2011.5679%207.27395%2011.5758%207.3%2011.5936L12.7033%2015.5702C13.5615%2016.1549%2014.5491%2016.5218%2015.5808%2016.6394C15.6708%2016.6494%2015.7475%2016.5602%2015.7475%2016.4477V13.8977C15.7475%2013.8002%2015.6892%2013.7211%2015.6108%2013.7086C15.0053%2013.6107%2014.4287%2013.3812%2013.9217%2013.0361L9.24417%209.6494C9.14667%209.5844%209.13417%209.4169%209.22083%209.3319Z'%20fill='%23D4D4D4'/%3e%3c/svg%3e",LY="/assets/minimax-provider-BqW25BvT.svg",IY="data:image/svg+xml,%3csvg%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M2.85667%202.83398H5.71417V5.69065H8.57167V8.54815H8.57H11.4292V5.69065H14.285V2.83398H17.1433V14.2623H20V17.1198H11.4283V14.2632H8.57167V11.4057H5.71333V14.2623L8.57167%2014.2632V17.1198H0V14.2623H2.85667V2.83398ZM11.4283%2014.2632H14.285V11.4057H11.4292V14.2632H11.4283Z'%20fill='%23D4D4D4'/%3e%3c/svg%3e",NE="data:image/svg+xml,%3csvg%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M17.813%208.3673C18.2269%207.14159%2018.0844%205.79887%2017.4226%204.68397C16.4272%202.97394%2014.4263%202.09417%2012.4721%202.50818C11.6027%201.54178%2010.3537%200.992208%209.04425%201.00008C7.04673%200.995583%205.27439%202.26461%204.65985%204.14003C3.37663%204.39934%202.26898%205.19192%201.62082%206.31526C0.618065%208.0208%200.846663%2010.1707%202.18632%2011.6332C1.77245%2012.859%201.91497%2014.2017%202.57682%2015.3166C3.57216%2017.0266%205.5731%2017.9064%207.5273%2017.4924C8.39608%2018.4588%209.64567%2019.0083%2010.9551%2018.9999C12.9538%2019.005%2014.7267%2017.7348%2015.3412%2015.8577C16.6245%2015.5984%2017.7321%2014.8058%2018.3803%2013.6825C19.3819%2011.9769%2019.1527%209.82871%2017.8136%208.36618L17.813%208.3673ZM10.9563%2017.8237C10.1565%2017.8248%209.38173%2017.5486%208.76777%2017.0429C8.7957%2017.0283%208.84416%2017.0019%208.87551%2016.9827L12.508%2014.9127C12.6938%2014.8086%2012.8078%2014.6134%2012.8067%2014.4025V9.34945L14.3419%2010.2242C14.3584%2010.232%2014.3693%2010.2478%2014.3715%2010.2658V14.4503C14.3693%2016.3111%2012.8421%2017.8198%2010.9563%2017.8237ZM3.6115%2014.7282C3.21074%2014.0453%203.06651%2013.2448%203.2039%2012.468C3.23069%2012.4838%203.27801%2012.5125%203.31164%2012.5316L6.94412%2014.6016C7.12825%2014.7079%207.35628%2014.7079%207.54098%2014.6016L11.9755%2012.0748V13.8242C11.9767%2013.8422%2011.9681%2013.8597%2011.9539%2013.8709L8.28207%2015.9629C6.64654%2016.8922%204.55781%2016.3398%203.61207%2014.7282H3.6115ZM2.65549%206.90421C3.05454%206.2202%203.68447%205.69706%204.43468%205.42537C4.43468%205.4563%204.43297%205.51087%204.43297%205.54912V9.68977C4.43183%209.90015%204.54584%2010.0953%204.73111%2010.1994L9.16568%2012.7256L7.63048%2013.6004C7.61509%2013.6105%207.59571%2013.6122%207.57861%2013.6049L3.90622%2011.5112C2.27412%2010.5785%201.71431%208.51806%202.65492%206.90477L2.65549%206.90421ZM15.2688%209.80058L10.8343%207.27378L12.3695%206.39964C12.3849%206.38951%2012.4042%206.38782%2012.4213%206.39514L16.0937%208.48712C17.7287%209.4192%2018.2891%2011.4831%2017.3445%2013.0963C16.9448%2013.7792%2016.3155%2014.3024%2015.5658%2014.5746V10.3102C15.5675%2010.0998%2015.4541%209.90521%2015.2694%209.80058H15.2688ZM16.7966%207.53141C16.7698%207.5151%2016.7225%207.48697%2016.6889%207.46785L13.0564%205.3978C12.8723%205.29149%2012.6442%205.29149%2012.4595%205.3978L8.02497%207.92461V6.17519C8.02383%206.15719%208.03238%206.13976%208.04663%206.12851L11.7184%204.03821C13.354%203.10725%2015.445%203.66133%2016.3879%205.27574C16.7864%205.9575%2016.9306%206.75571%2016.7955%207.53141H16.7966ZM7.19039%2010.6494L5.65462%209.77471C5.63809%209.76683%205.62726%209.75108%205.62498%209.73308V5.54856C5.62612%203.68552%207.1579%202.17573%209.04596%202.17686C9.84463%202.17686%2010.6176%202.45361%2011.2316%202.95763C11.2037%202.97225%2011.1558%202.99869%2011.1239%203.01781L7.49138%205.08786C7.30554%205.19192%207.19153%205.38655%207.19267%205.59749L7.19039%2010.6483V10.6494ZM8.0244%208.87525L9.99969%207.74967L11.975%208.87469V11.1253L9.99969%2012.2503L8.0244%2011.1253V8.87525Z'%20fill='%23D4D4D4'/%3e%3c/svg%3e",PY="data:image/svg+xml,%3csvg%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cmask%20id='mask0_1940_35557'%20style='mask-type:luminance'%20maskUnits='userSpaceOnUse'%20x='2'%20y='2'%20width='16'%20height='16'%3e%3cpath%20d='M2%202H18V18H2V2Z'%20fill='white'/%3e%3c/mask%3e%3cg%20mask='url(%23mask0_1940_35557)'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M13.2027%203.30472L18.016%206.04138V6.09938L13.1533%208.80669L13.1647%207.39538L12.6173%207.37538C11.9113%207.35669%2011.5433%207.37669%2011.1053%207.44869C10.396%207.56538%209.74666%207.83337%209.00734%208.35003L7.56334%209.35338C7.374%209.48338%207.23334%209.57738%207.11%209.65669L6.76666%209.87138L6.502%2010.0274L6.75866%2010.1807L7.112%2010.406C7.42934%2010.6154%207.892%2010.9367%208.91266%2011.65C9.65266%2012.1667%2010.3013%2012.4347%2011.0107%2012.5514L11.2107%2012.5814C11.6733%2012.642%2012.1273%2012.644%2013.094%2012.6034L13.1087%2011.164L17.922%2013.9007V13.9587L13.0593%2016.6667L13.0687%2015.4254L12.6453%2015.44C11.7213%2015.468%2011.2207%2015.4414%2010.5533%2015.332C9.424%2015.1454%208.38%2014.7147%207.29934%2013.9594L5.86066%2012.9594C5.69519%2012.8453%205.52738%2012.7346%205.35734%2012.6274L5.046%2012.4407C4.87788%2012.3438%204.70897%2012.2483%204.53934%2012.154C3.93866%2011.82%202.37531%2011.4107%202%2011.4107V8.59203L2.09334%208.59469C2.46934%208.59003%204.03334%208.18003%204.63266%207.84538L5.31%207.45869L5.602%207.27603C5.88734%207.08938%206.31666%206.79203%207.39266%206.04069C8.47334%205.28537%209.51666%204.85403%2010.6467%204.66803C11.4147%204.54138%2011.9627%204.52603%2013.1893%204.57603L13.2027%203.30472Z'%20fill='%23D4D4D4'/%3e%3c/g%3e%3c/svg%3e",zY="data:image/svg+xml,%3csvg%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M16.4875%200V6.06H18.75V14.6833H16.3042V20L10.44%2014.8383V19.9592H9.53083V14.8325L3.66%2020V14.6125H1.25V5.99H3.65333V0L9.53083%205.41167V0.158333H10.4392V5.56667L16.4875%200ZM10.44%207.53667V13.6358L15.395%2017.9975V12.0333L10.44%207.53667ZM9.52417%207.47L4.56917%2011.9683V17.9975L9.52417%2013.6358V7.47083V7.47ZM16.3042%2013.7867H17.8408V6.9575H11.2167L16.3042%2011.5742V13.7867ZM8.81917%206.88667H2.15833V13.7158H3.65833V11.5692L8.81833%206.88583L8.81917%206.88667ZM4.5625%202.06333V5.98833H8.825L4.5625%202.06333ZM15.5783%202.06333L11.3158%205.98833H15.5783V2.06333Z'%20fill='%23D4D4D4'/%3e%3c/svg%3e",FY="data:image/svg+xml,%3csvg%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_1940_35595)'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M19.3308%203.75216C19.0025%203.18344%2018.5654%202.68496%2018.0444%202.28519C17.5234%201.88543%2016.9288%201.5922%2016.2945%201.42227C15.6601%201.25233%2014.9986%201.20901%2014.3475%201.29479C13.6964%201.38056%2013.0686%201.59374%2012.5%201.92216C11.7706%202.34073%2011.1591%202.93729%2010.7227%203.65615C10.2862%204.37502%2010.039%205.19274%2010.0042%206.033L15.0008%206.03966V6.46883H10.0042C10.0367%207.24966%2010.2525%208.02716%2010.6708%208.75216C10.9925%209.33338%2011.4267%209.84468%2011.9482%2010.2562C12.4696%2010.6677%2013.0679%2010.9712%2013.708%2011.1489C14.348%2011.3266%2015.0171%2011.375%2015.6761%2011.2912C16.3351%2011.2075%2016.9707%2010.9932%2017.546%2010.661C18.1213%2010.3288%2018.6245%209.88533%2019.0265%209.35644C19.4284%208.82755%2019.7209%208.22387%2019.8869%207.58067C20.0529%206.93746%2020.0891%206.26762%2019.9934%205.61028C19.8976%204.95293%2019.6718%204.32126%2019.3292%203.75216H19.3308Z'%20fill='%23D4D4D4'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M0.670785%203.74946C0.342331%204.31807%200.129098%204.94582%200.0432647%205.59684C-0.042569%206.24787%200.00067736%206.90943%200.170534%207.54374C0.340391%208.17806%200.633531%208.7727%201.03322%209.29371C1.4329%209.81473%201.9313%2010.2519%202.49995%2010.5803C3.22718%2011.0028%204.04963%2011.2341%204.89049%2011.2526C5.73134%2011.2711%206.56317%2011.0762%207.30829%2010.6861L4.81579%206.35529L5.18745%206.14113L7.68495%2010.4678C8.32417%2010.0608%208.86254%209.51393%209.25936%208.86837C9.65619%208.22281%209.90109%207.4955%209.97556%206.7414C10.05%205.9873%209.95213%205.22614%209.68925%204.51543C9.42637%203.80472%209.00539%203.16306%208.45812%202.63893C7.91085%202.11481%207.25161%201.72193%206.53021%201.48999C5.80881%201.25804%205.04413%201.1931%204.29395%201.30007C3.54377%201.40704%202.82771%201.68312%202.1999%202.10745C1.57208%202.53178%201.04975%203.09326%200.670785%203.74946Z'%20fill='%23D4D4D4'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M9.99996%2019.9121C11.3259%2019.9119%2012.5975%2019.385%2013.535%2018.4473C14.4725%2017.5097%2014.9991%2016.238%2014.9991%2014.9121C14.9991%2013.1371%2014.0825%2011.5821%2012.6866%2010.6954L10.1825%2015.0196L9.81246%2014.8046L12.31%2010.4779C11.6379%2010.1278%2010.895%209.93492%2010.1375%209.91401C9.37993%209.8931%208.62755%2010.0447%207.93719%2010.3572C7.24683%2010.6698%206.63655%2011.1352%206.15248%2011.7183C5.66841%2012.3014%205.32321%2012.9869%205.14298%2013.723C4.96274%2014.459%204.95219%2015.2265%205.11211%2015.9672C5.27203%2016.708%205.59824%2017.4027%206.06609%2017.9989C6.53394%2018.5951%207.13119%2019.0771%207.8127%2019.4085C8.4942%2019.74%209.24213%2019.9122%209.99996%2019.9121Z'%20fill='%23D4D4D4'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_1940_35595'%3e%3crect%20width='20'%20height='20'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",BY="data:image/svg+xml,%3csvg%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M10%203L18%2017H2L10%203Z'%20fill='%23D4D4D4'/%3e%3c/svg%3e",HY="data:image/svg+xml,%3csvg%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M6.1283%207.65527L13.1584%2018H10.0336L3.0035%207.65527H6.1283ZM6.1255%2013.4007L7.6886%2015.7018L6.1269%2018H3L6.1255%2013.4007ZM17%203.15055V18H14.4387V6.91927L17%203.15055ZM17%202L10.0336%2012.2509L8.4705%209.95055L13.8731%202H17Z'%20fill='%23D4D4D4'/%3e%3c/svg%3e",RE="data:image/svg+xml,%3csvg%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M10.5744%203L9.03162%205.0671H2.46254L4.00458%203H10.5751H10.5744ZM18.4716%2014.9336L16.9302%2017H10.3838L11.9237%2014.9336H18.4716ZM19%203L8.562%2017H2L12.438%203H19Z'%20fill='%23D4D4D4'/%3e%3c/svg%3e",UY={anthropic:TY,byterover:NY,cerebras:RY,cohere:AY,deepinfra:OY,deepseek:jY,glm:RE,"glm-coding-plan":RE,google:MY,groq:DY,minimax:LY,mistral:IY,moonshot:_Y,openai:NE,"openai-compatible":NE,openrouter:PY,perplexity:zY,togetherai:FY,vercel:BY,xai:HY},fx="byterover";function VY(e){const t=e.find(n=>n.id===fx);return t?[t,...e.filter(n=>n.id!==fx)]:e}function qY({onSelect:e,providers:t}){const[n,r]=w.useState(""),i=w.useMemo(()=>{const s=VY(t);if(!n)return s;const a=n.toLowerCase();return s.filter(c=>c.name.toLowerCase().includes(a))},[t,n]);return h.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-5",children:[h.jsxs(Ci,{children:[h.jsx(ki,{children:"Pick a provider to power curate & query"}),h.jsx(jf,{children:"ByteRover routes LLM calls through your chosen provider. You can change this later."})]}),h.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-3",children:[h.jsxs("div",{className:"relative",children:[h.jsx(au,{className:"text-muted-foreground absolute top-1/2 left-3 size-4 -translate-y-1/2"}),h.jsx(Wi,{className:"pl-9",onChange:s=>r(s.target.value),placeholder:"Search...",value:n})]}),h.jsx("div",{className:"flex min-h-0 flex-1 flex-col gap-2 overflow-y-auto pr-4 -mr-4 [scrollbar-gutter:stable]",children:i.map(s=>{const a=UY[s.id],c=s.isCurrent,u=s.id===fx;return h.jsxs("button",{className:ae("group/row flex w-full cursor-pointer items-center gap-3 rounded-lg border px-3 py-2.5 text-left transition-colors",c?"border-primary-foreground/40 bg-primary/5":"border-border hover:border-foreground/25"),onClick:()=>e(s),title:s.description,type:"button",children:[h.jsx("div",{className:"bg-muted/50 grid size-7 shrink-0 place-items-center overflow-hidden rounded-md",children:a&&h.jsx("img",{alt:"",className:"size-5",src:a})}),h.jsxs("div",{className:"min-w-0 flex-1 space-y-0.5",children:[h.jsxs("div",{className:"text-foreground flex flex-wrap items-center gap-1.5 text-sm",children:[h.jsx("span",{className:"font-medium truncate",children:s.name}),u&&h.jsx(uo,{className:"border-amber-500/50 bg-amber-500/15 text-amber-400 h-[18px] rounded-sm px-1.5 text-[11px] font-medium leading-none",variant:"outline",children:"Native"})]}),h.jsx("div",{className:"text-muted-foreground min-h-lh truncate text-xs",children:s.description})]}),h.jsx("div",{className:ae("grid size-[18px] shrink-0 place-items-center rounded-full border transition-colors",c?"bg-primary-foreground border-primary-foreground":"border-border"),children:c&&h.jsx(Rl,{className:"text-background size-3",strokeWidth:3})})]},s.id)})})]})]})}const B2="byterover",$Y=6,YY=1e3;function WY(e){return new Promise(t=>{setTimeout(t,e)})}function A0({onOpenChange:e,onProviderActivated:t,open:n,tourStepLabel:r}){const[i,s]=w.useState("select"),[a,c]=w.useState(),[u,f]=w.useState(),[m,p]=w.useState(),[y,x]=w.useState(!1),b=w.useRef(null),S=yi(P=>P.isAuthorized),{data:k}=lv(),E=W$(),T=K$(),N=X$(),j=tY(),O=J$(),A=$$(),R=U$(),L=k?.providers??[],B=w.useCallback(()=>{s("select"),c(void 0),f(void 0),p(void 0),x(!1)},[]),I=w.useCallback(()=>{e(!1),setTimeout(B,150)},[e,B]),U=w.useCallback(P=>{P?e(!0):(e(!1),setTimeout(B,150))},[e,B]),Y=w.useCallback(async P=>{s("connecting");try{let W=await E.mutateAsync({providerId:P.id});for(let D=0;!W.success&&D<$Y;D++)await WY(YY),W=await E.mutateAsync({providerId:P.id});if(!W.success){ht.error(W.error??"Failed to connect ByteRover"),s("select");return}await N.mutateAsync({providerId:P.id}),ht.success(`Connected to ${P.name}`),t?.(),I()}catch(W){ht.error(jn(W,"Connection failed")),s("select")}},[E,t,I,N]),V=w.useCallback(async P=>{if(c(P),p(void 0),P.id===B2&&!S){b.current=window.open("about:blank","_blank"),s("login_prompt");return}if(P.id===B2&&P.isCurrent){t?.(),I();return}if(P.isConnected){s("provider_actions");return}if(P.id===B2){await Y(P);return}if(P.id==="openai-compatible"){s("base_url");return}if(P.supportsOAuth){s("auth_method");return}if(P.requiresApiKey){s("api_key");return}s("connecting");try{await E.mutateAsync({providerId:P.id}),x(!0),s("model_select")}catch(W){ht.error(jn(W,"Connection failed")),s("select")}},[Y,E,S,t,I]),q=w.useCallback(async P=>{s("connecting");try{const W=await O.mutateAsync({providerId:P.id});if(!W.success){ht.error(W.error??"Failed to start OAuth"),s("select");return}const D=await A.mutateAsync({providerId:P.id});D.success?(x(!0),s("model_select")):(ht.error(D.error??"OAuth failed"),s("select"))}catch(W){ht.error(jn(W,"OAuth failed")),s("select")}},[A,O]),H=w.useCallback(async P=>{if(a)switch(P){case"activate":{s("connecting");try{await N.mutateAsync({providerId:a.id}),ht.success(`Activated ${a.name}`),t?.(),I()}catch(W){p(jn(W,"Failed")),s("provider_actions")}break}case"change_model":{s("model_select");break}case"disconnect":{s("connecting");try{await T.mutateAsync({providerId:a.id}),ht.success(`Disconnected ${a.name}`),s("select"),c(void 0),p(void 0)}catch(W){p(jn(W,"Failed")),s("provider_actions")}break}case"reconfigure":{s("base_url");break}case"reconnect_oauth":{await q(a);break}case"replace":{s("api_key");break}}},[T,q,t,I,a,N]),z=w.useCallback(P=>{f(P),s("api_key")},[]),$=w.useCallback(async P=>{if(a){if(a.id!=="openai-compatible"&&P)try{const W=await j.mutateAsync({apiKey:P,providerId:a.id});if(!W.isValid){p(W.error??"Invalid API key");return}}catch(W){p(jn(W,"Validation failed"));return}s("connecting");try{await E.mutateAsync({apiKey:P||void 0,baseUrl:u??void 0,providerId:a.id}),x(!0),s("model_select")}catch(W){p(jn(W,"Connection failed")),s("api_key")}}},[u,E,a,j]),G=w.useCallback(async P=>{if(a)try{await R.mutateAsync({contextLength:P.contextLength,modelId:P.id,providerId:a.id}),y?(ht.success(`Connected to ${a.name}`),t?.(),I()):(ht.success(`Model set to ${P.name}`),s("provider_actions"))}catch(W){ht.error(jn(W,"Failed to set model"))}},[y,t,I,a,R]),Q=w.useCallback(()=>{p(void 0),a?.id==="openai-compatible"?s("base_url"):a?.supportsOAuth?s("auth_method"):s("select")},[a]),_=()=>{switch(i){case"api_key":return a?h.jsx(pY,{error:m,isOptional:a.id==="openai-compatible",isValidating:j.isPending,onBack:Q,onSubmit:P=>$(P),provider:a}):null;case"auth_method":return a?h.jsx(mY,{onBack:()=>{s("select"),c(void 0),p(void 0)},onSelect:P=>{P==="oauth"?q(a):s("api_key")},provider:a}):null;case"base_url":return a?h.jsx(yY,{error:m,onBack:()=>{s("select"),p(void 0)},onSubmit:z,provider:a}):null;case"connecting":return h.jsxs("div",{className:"flex flex-col items-center gap-3 py-12",children:[h.jsx(ei,{className:"text-primary size-6 animate-spin"}),h.jsxs("p",{className:"text-muted-foreground text-sm",children:["Connecting to ",a?.name,"..."]})]});case"login_prompt":return a?h.jsx(wY,{onAuthenticated:()=>{Y(a)},onBack:()=>{s("select"),c(void 0)},popup:b.current}):null;case"model_select":return a?h.jsx(kY,{onBack:()=>{s(y?"select":"provider_actions")},onSelect:G,providerId:a.id}):null;case"provider_actions":return a?h.jsx(EY,{error:m,onAction:H,onBack:()=>{s("select"),c(void 0),p(void 0)},provider:a}):null;case"select":return h.jsx(qY,{onSelect:P=>V(P),providers:L});default:return null}};return h.jsx(Tl,{onOpenChange:U,open:n,children:h.jsxs(Nl,{className:"flex h-150 flex-col sm:max-w-lg",showCloseButton:i==="select"||i==="model_select"||i==="connecting"||i==="login_prompt",children:[r&&h.jsx(T0,{label:r}),_()]})})}function GY(){const e=Ht(c=>c.tourActive),t=Ht(c=>c.tourStep),n=Ht(c=>c.advanceTour),r=Ht(c=>c.exitTour),i=vl(),s=e&&t==="connector",a=()=>{n(),i("/configuration")};return h.jsx(Tl,{onOpenChange:c=>!c&&r(),open:s,children:h.jsxs(Nl,{className:"flex flex-col gap-5 p-6 sm:max-w-[460px]",children:[h.jsx(T0,{label:"Step 4 of 4 · Optional"}),h.jsxs("div",{className:"flex flex-col gap-3",children:[h.jsx("div",{className:"bg-primary/12 text-primary-foreground grid size-10 place-items-center rounded-lg",children:h.jsx(EA,{className:"size-5"})}),h.jsx("h2",{className:"text-foreground text-base font-semibold",children:"Use ByteRover from your AI agent"}),h.jsxs("p",{className:"text-muted-foreground text-sm leading-relaxed",children:["Connect a tool like Claude Code, Cursor, or any MCP client and you can curate & query the context tree without leaving your chat. It's optional — you can always come back via the"," ",h.jsx("span",{className:"text-foreground font-medium",children:"Configuration"})," tab."]})]}),h.jsxs("div",{className:"border-border -mx-6 -mb-6 mt-2 flex items-center gap-2 border-t px-6 py-4",children:[h.jsx(ze,{onClick:()=>n(),type:"button",variant:"ghost",children:"Maybe later"}),h.jsx("div",{className:"flex-1"}),h.jsxs(ze,{onClick:a,type:"button",children:["Open Configuration",h.jsx(wA,{className:"size-4"})]})]})]})})}function KY(){return Ht.getState().tourStep==="provider"}function QY(){const e=Ht(i=>i.tourActive),t=Ht(i=>i.tourStep),n=Ht(i=>i.exitTour),r=Ht(i=>i.advanceTour);return!e||!t?null:h.jsxs(h.Fragment,{children:[t==="provider"&&h.jsx(A0,{onOpenChange:i=>{i||KY()&&n()},onProviderActivated:()=>r(),open:!0,tourStepLabel:"Step 1 of 4"}),h.jsx(GY,{})]})}function XY({className:e,curveFrom:t,direction:n}){const r=t==="right";return h.jsx("svg",{"aria-hidden":!0,className:ae("h-12 w-6",e),fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",viewBox:"0 0 24 48",children:n==="up"?r?h.jsxs(h.Fragment,{children:[h.jsx("path",{d:"M 18 46 Q 4 30 12 4",stroke:"currentColor"}),h.jsx("path",{d:"M 7 9 L 12 4 L 13 11",stroke:"currentColor"})]}):h.jsxs(h.Fragment,{children:[h.jsx("path",{d:"M 6 46 Q 20 30 12 4",stroke:"currentColor"}),h.jsx("path",{d:"M 11 11 L 12 4 L 17 9",stroke:"currentColor"})]}):r?h.jsxs(h.Fragment,{children:[h.jsx("path",{d:"M 18 2 Q 4 18 12 44",stroke:"currentColor"}),h.jsx("path",{d:"M 7 39 L 12 44 L 13 37",stroke:"currentColor"})]}):h.jsxs(h.Fragment,{children:[h.jsx("path",{d:"M 6 2 Q 20 18 12 44",stroke:"currentColor"}),h.jsx("path",{d:"M 11 37 L 12 44 L 17 39",stroke:"currentColor"})]})})}function Nv({active:e,align:t="center",children:n,className:r,label:i,side:s="bottom"}){if(!e)return h.jsx(h.Fragment,{children:n});const a=t==="end"?"left":"right";return h.jsxs("span",{className:ae("relative z-50 inline-flex",r),children:[h.jsx("span",{className:"rounded-md shadow-[0_0_0_2px_var(--primary-foreground),0_0_24px_4px_color-mix(in_oklch,var(--primary-foreground)_45%,transparent)]",children:n}),h.jsx("span",{"aria-hidden":!0,className:ae("pointer-events-none absolute left-1/2 -translate-x-1/2",s==="bottom"?"top-full mt-1":"bottom-full mb-1"),children:h.jsx(XY,{curveFrom:a,direction:s==="bottom"?"up":"down"})}),h.jsx("span",{"aria-hidden":!0,className:ae("pointer-events-none absolute",s==="bottom"?"top-[calc(100%+3.25rem)]":"bottom-[calc(100%+3.25rem)]",t==="start"&&"left-0",t==="center"&&"left-1/2 -translate-x-1/2",t==="end"&&"right-0"),children:h.jsx("span",{className:"text-xl whitespace-nowrap font-medium tracking-wide leading-tight",children:i})})]})}function ZY(){const e=Ht(i=>i.seenWelcome),t=Ht(i=>i.dismissWelcome),n=Ht(i=>i.startTour),r=$e(i=>i.selectedProject);return e?null:h.jsx(Tl,{onOpenChange:i=>!i&&t(),open:!0,children:h.jsxs(Nl,{className:"flex max-w-[420px] flex-col items-center gap-6 p-8 text-center sm:max-w-[420px]",showCloseButton:!1,children:[h.jsx("img",{alt:"Byterover",className:"size-11",src:Zb}),h.jsxs(Ci,{className:"flex flex-col gap-2.5",children:[h.jsx(ki,{className:"text-foreground text-xl font-semibold tracking-tight",children:"Welcome to ByteRover"}),h.jsxs(jf,{className:"text-muted-foreground text-sm leading-relaxed",children:["A 3-minute tour will get you from zero to your first answer. You can restart it any time from the"," ",h.jsx("span",{className:"text-foreground font-medium",children:"Help"})," menu in the top-right."]})]}),h.jsxs("div",{className:"flex w-full max-w-[300px] flex-col gap-2",children:[h.jsxs(ze,{onClick:()=>n(),size:"lg",children:[h.jsx(A$,{className:"size-4"}),"Take the tour"]}),h.jsx(ze,{className:"text-muted-foreground hover:text-foreground text-xs",onClick:()=>t(),variant:"link",children:"Skip — take me in"})]}),r&&h.jsx("p",{className:"text-identifier mono max-w-full truncate text-[10px] tracking-wider",title:r,children:r})]})})}function JY(){const e=Ht(a=>a.tourActive),t=Ht(a=>a.tourStep),n=Ht(a=>a.tourTaskId),r=Ht(a=>a.advanceTour),[,i]=a0(),{data:s}=av({queryConfig:{enabled:e&&t==="provider"}});w.useEffect(()=>{!e||t!=="provider"||s?.activeModel&&r()},[e,t,s?.activeModel,r]),w.useEffect(()=>{!e||t!=="query"||n||i(a=>{if(!a.has("task"))return a;const c=new URLSearchParams(a);return c.delete("task"),c},{replace:!0})},[e,t,n,i])}function eW(){const e=jm(n=>n.isDialogOpen),t=jm(n=>n.closeProviderDialog);return h.jsx(A0,{onOpenChange:n=>!n&&t(),open:e})}const tW=()=>{const{apiClient:e}=$e.getState();return e?e.request(qn.STATUS):Promise.reject(new Error("Not connected"))},Ni=()=>({queryFn:tW,queryKey:["vc","status"],refetchInterval:3e3,refetchIntervalInBackground:!1,staleTime:2e3}),Rv=({queryConfig:e}={})=>or({...Ni(),...e}),nW=["both_added","both_modified","deleted_modified"];function rW(e){return nW.includes(e)?e:void 0}function OA(e){if(!e)return{staged:[],unmerged:[],unstaged:[]};const t=new Set(e.conflictMarkerFiles??[]),n=(e.unmerged??[]).map(({path:a,type:c})=>({conflictType:rW(c),hasMarkers:t.has(a),isStaged:!1,path:a,status:"unmerged"})),r=[...e.staged.added.map(a=>({isStaged:!0,path:a,status:"added"})),...e.staged.modified.map(a=>({isStaged:!0,path:a,status:"modified"})),...e.staged.deleted.map(a=>({isStaged:!0,path:a,status:"deleted"}))],i=[...e.unstaged.modified.map(a=>({isStaged:!1,path:a,status:"modified"})),...e.unstaged.deleted.map(a=>({isStaged:!1,path:a,status:"deleted"})),...e.untracked.map(a=>({isStaged:!1,path:a,status:"untracked"}))],s=(a,c)=>a.path.localeCompare(c.path);return{staged:r.sort(s),unmerged:n.sort(s),unstaged:i.sort(s)}}const iW="/assets/logo-byterover-DB7H7faH.svg",oW={amber:"bg-amber-500",destructive:"bg-destructive",info:"bg-blue-500",success:"bg-primary-foreground"};function AE({className:e,pulsing:t=!1,tone:n}){const r=oW[n];return t?h.jsxs("span",{className:ae("relative inline-flex size-1.5 shrink-0",e),children:[h.jsx("span",{className:ae("absolute inline-flex size-full animate-ping rounded-full opacity-75",r)}),h.jsx("span",{className:ae("relative inline-flex size-full rounded-full",r)})]}):h.jsx("span",{className:ae("inline-block size-1.5 shrink-0 rounded-full",r,e)})}const jA=w.createContext(void 0);function MA(){const e=w.useContext(jA);if(e===void 0)throw new Error(Cn(13));return e}const Av={imageLoadingStatus:()=>null},sW=w.forwardRef(function(t,n){const{className:r,render:i,...s}=t,[a,c]=w.useState("idle"),u={imageLoadingStatus:a},f=w.useMemo(()=>({imageLoadingStatus:a,setImageLoadingStatus:c}),[a,c]),m=jt("span",t,{state:u,ref:n,props:s,stateAttributesMapping:Av});return h.jsx(jA.Provider,{value:f,children:m})});function aW(e,{referrerPolicy:t,crossOrigin:n}){const[r,i]=w.useState("idle");return We(()=>{if(!e)return i("error"),Cr;let s=!0;const a=new window.Image,c=u=>()=>{s&&i(u)};return i("loading"),a.onload=c("loaded"),a.onerror=c("error"),t&&(a.referrerPolicy=t),a.crossOrigin=n??null,a.src=e,()=>{s=!1}},[e,n,t]),r}const lW={...Av,...ws},cW=w.forwardRef(function(t,n){const{className:r,render:i,onLoadingStatusChange:s,referrerPolicy:a,crossOrigin:c,...u}=t,f=MA(),m=aW(t.src,{referrerPolicy:a,crossOrigin:c}),p=m==="loaded",{mounted:y,transitionStatus:x,setMounted:b}=Sa(p),S=w.useRef(null),k=tt(N=>{s?.(N),f.setImageLoadingStatus(N)});We(()=>{m!=="idle"&&k(m)},[m,k]);const E={imageLoadingStatus:m,transitionStatus:x};Ki({open:p,ref:S,onComplete(){p||b(!1)}});const T=jt("img",t,{state:E,ref:[n,S],props:u,stateAttributesMapping:lW,enabled:y});return y?T:null}),uW=w.forwardRef(function(t,n){const{className:r,render:i,delay:s,...a}=t,{imageLoadingStatus:c}=MA(),[u,f]=w.useState(s===void 0),m=Bn();return w.useEffect(()=>(s!==void 0&&m.start(s,()=>f(!0)),m.clear),[m,s]),jt("span",t,{state:{imageLoadingStatus:c},ref:n,props:a,stateAttributesMapping:Av,enabled:c!=="loaded"&&u})});function _f({className:e,size:t="default",...n}){return h.jsx(sW,{"data-slot":"avatar","data-size":t,className:ae("group/avatar relative flex size-8 shrink-0 rounded-full select-none after:absolute after:inset-0 after:rounded-full after:border after:border-border after:mix-blend-darken data-[size=lg]:size-10 data-[size=sm]:size-6 dark:after:mix-blend-lighten",e),...n})}function O0({className:e,...t}){return h.jsx(cW,{"data-slot":"avatar-image",className:ae("aspect-square size-full rounded-full object-cover",e),...t})}function Lf({className:e,...t}){return h.jsx(uW,{"data-slot":"avatar-fallback",className:ae("flex size-full items-center justify-center rounded-full bg-muted text-sm text-muted-foreground group-data-[size=sm]/avatar:text-xs",e),...t})}const DA=w.createContext(void 0);function If(e){const t=w.useContext(DA);if(t===void 0&&!e)throw new Error(Cn(33));return t}const _A=w.createContext(void 0);function fo(e){const t=w.useContext(_A);if(t===void 0&&!e)throw new Error(Cn(36));return t}const dW=w.createContext(void 0);function j0(e=!0){const t=w.useContext(dW);if(t===void 0&&!e)throw new Error(Cn(25));return t}const LA=w.createContext(void 0);function fW(){const e=w.useContext(LA);if(e===void 0)throw new Error(Cn(30));return e}function hW(e){const{closeOnClick:t,highlighted:n,id:r,nodeId:i,store:s,typingRef:a,itemRef:c,itemMetadata:u}=e,{events:f}=s.useState("floatingTreeRoot"),m=j0(!0),p=m!==void 0;return w.useMemo(()=>({id:r,role:"menuitem",tabIndex:n?0:-1,onKeyDown(y){y.key===" "&&a?.current&&y.preventDefault()},onMouseMove(y){i&&f.emit("itemhover",{nodeId:i,target:y.currentTarget})},onClick(y){t&&f.emit("close",{domEvent:y,reason:ul})},onMouseUp(y){if(m){const x=m.initialCursorPointRef.current;if(m.initialCursorPointRef.current=null,p&&x&&Math.abs(y.clientX-x.x)<=1&&Math.abs(y.clientY-x.y)<=1||p&&!Q6&&y.button===2)return}c.current&&s.context.allowMouseUpTriggerRef.current&&(!p||y.button===2)&&(!u||u.type==="regular-item")&&c.current.click()}}),[t,n,r,f,i,s,a,c,m,p,u])}const Ov={type:"regular-item"};function M0(e){const{closeOnClick:t,disabled:n=!1,highlighted:r,id:i,store:s,typingRef:a=s.context.typingRef,nativeButton:c,itemMetadata:u,nodeId:f}=e,m=w.useRef(null),{getButtonProps:p,buttonRef:y}=El({disabled:n,focusableWhenDisabled:!0,native:c,composite:!0}),x=hW({closeOnClick:t,highlighted:r,id:i,nodeId:f,store:s,typingRef:a,itemRef:m,itemMetadata:u}),b=w.useCallback(k=>jo(x,{onMouseEnter(){u.type==="submenu-trigger"&&u.setActive()}},k,p),[x,p,u]),S=ps(m,y);return w.useMemo(()=>({getItemProps:b,itemRef:S}),[b,S])}const IA=w.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},elementsRef:{current:[]},nextIndexRef:{current:0}});function pW(){return w.useContext(IA)}let PA=(function(e){return e[e.None=0]="None",e[e.GuessFromOrder=1]="GuessFromOrder",e})({});function lu(e={}){const{label:t,metadata:n,textRef:r,indexGuessBehavior:i,index:s}=e,{register:a,unregister:c,subscribeMapChange:u,elementsRef:f,labelsRef:m,nextIndexRef:p}=pW(),y=w.useRef(-1),[x,b]=w.useState(s??(i===PA.GuessFromOrder?()=>{if(y.current===-1){const E=p.current;p.current+=1,y.current=E}return y.current}:-1)),S=w.useRef(null),k=w.useCallback(E=>{if(S.current=E,x!==-1&&E!==null&&(f.current[x]=E,m)){const T=t!==void 0;m.current[x]=T?t:r?.current?.textContent??E.textContent}},[x,f,m,t,r]);return We(()=>{if(s!=null)return;const E=S.current;if(E)return a(E,n),()=>{c(E)}},[s,a,c,n]),We(()=>{if(s==null)return u(E=>{const T=S.current?E.get(S.current)?.index:null;T!=null&&b(T)})},[s,u,b]),w.useMemo(()=>({ref:k,index:x}),[x,k])}let OE=(function(e){return e.checked="data-checked",e.unchecked="data-unchecked",e.disabled="data-disabled",e.highlighted="data-highlighted",e})({});const D0={checked(e){return e?{[OE.checked]:""}:{[OE.unchecked]:""}},...ws},mW=w.forwardRef(function(t,n){const{render:r,className:i,id:s,label:a,nativeButton:c=!1,disabled:u=!1,closeOnClick:f=!1,checked:m,defaultChecked:p,onCheckedChange:y,...x}=t,b=lu({label:a}),S=If(!0),k=Si(s),{store:E}=fo(),T=E.useState("isActive",b.index),N=E.useState("itemProps"),[j,O]=$c({controlled:m,default:p??!1,name:"MenuCheckboxItem",state:"checked"}),{getItemProps:A,itemRef:R}=M0({closeOnClick:f,disabled:u,highlighted:T,id:k,store:E,nativeButton:c,nodeId:S?.nodeId,itemMetadata:Ov}),L=w.useMemo(()=>({disabled:u,highlighted:T,checked:j}),[u,T,j]),B=tt(U=>{const Y={...Et(ul,U.nativeEvent),preventUnmountOnClose:()=>{}};y?.(!j,Y),!Y.isCanceled&&O(V=>!V)}),I=jt("div",t,{state:L,stateAttributesMapping:D0,props:[N,{role:"menuitemcheckbox","aria-checked":j,onClick:B},x,A],ref:[R,n,b.ref]});return h.jsx(LA.Provider,{value:L,children:I})}),gW=w.forwardRef(function(t,n){const{render:r,className:i,keepMounted:s=!1,...a}=t,c=fW(),u=w.useRef(null),{transitionStatus:f,setMounted:m}=Sa(c.checked);Ki({open:c.checked,ref:u,onComplete(){c.checked||m(!1)}});const p={checked:c.checked,disabled:c.disabled,highlighted:c.highlighted,transitionStatus:f};return jt("span",t,{state:p,ref:[n,u],stateAttributesMapping:D0,props:{"aria-hidden":!0,...a},enabled:s||c.checked})}),zA=w.createContext(void 0);function yW(){const e=w.useContext(zA);if(e===void 0)throw new Error(Cn(31));return e}const xW=w.forwardRef(function(t,n){const{render:r,className:i,...s}=t,[a,c]=w.useState(void 0),u=w.useMemo(()=>({setLabelId:c}),[c]),f=jt("div",t,{ref:n,props:{role:"group","aria-labelledby":a,...s}});return h.jsx(zA.Provider,{value:u,children:f})}),bW=w.forwardRef(function(t,n){const{className:r,render:i,id:s,...a}=t,c=Si(s),{setLabelId:u}=yW();return We(()=>(u(c),()=>{u(void 0)}),[u,c]),jt("div",t,{ref:n,props:{id:c,role:"presentation",...a}})}),vW=w.forwardRef(function(t,n){const{render:r,className:i,id:s,label:a,nativeButton:c=!1,disabled:u=!1,closeOnClick:f=!0,...m}=t,p=lu({label:a}),y=If(!0),x=Si(s),{store:b}=fo(),S=b.useState("isActive",p.index),k=b.useState("itemProps"),{getItemProps:E,itemRef:T}=M0({closeOnClick:f,disabled:u,highlighted:S,id:x,store:b,nativeButton:c,nodeId:y?.nodeId,itemMetadata:Ov});return jt("div",t,{state:{disabled:u,highlighted:S},props:[k,m,E],ref:[T,n,p.ref]})}),wW=w.createContext(void 0);function FA(e){return w.useContext(wW)}const SW={...Ss,...ws},CW=w.forwardRef(function(t,n){const{render:r,className:i,finalFocus:s,...a}=t,{store:c}=fo(),{side:u,align:f}=If(),m=FA()!=null,p=c.useState("open"),y=c.useState("transitionStatus"),x=c.useState("popupProps"),b=c.useState("mounted"),S=c.useState("instantType"),k=c.useState("activeTriggerElement"),E=c.useState("parent"),T=c.useState("lastOpenChangeReason"),N=c.useState("rootId"),j=c.useState("floatingRootContext"),O=c.useState("floatingTreeRoot"),A=c.useState("closeDelay"),R=c.useState("activeTriggerElement"),L=E.type==="context-menu";Ki({open:p,ref:c.context.popupRef,onComplete(){p&&c.context.onOpenChangeComplete?.(!0)}}),w.useEffect(()=>{function H(z){c.setOpen(!1,Et(z.reason,z.domEvent))}return O.events.on("close",H),()=>{O.events.off("close",H)}},[O.events,c]);const B=c.useState("hoverEnabled"),I=c.useState("disabled");eR(j,{enabled:B&&!I&&!L&&E.type!=="menubar",closeDelay:A});const U={transitionStatus:y,side:u,align:f,open:p,nested:E.type==="menu",instant:S},Y=w.useCallback(H=>{c.set("popupElement",H)},[c]),V=jt("div",t,{state:U,ref:[n,c.context.popupRef,Y],stateAttributesMapping:SW,props:[x,{onKeyDown(H){m&&fv.has(H.key)&&H.stopPropagation()}},ru(y),a,{"data-rootownerid":N}]});let q=E.type===void 0||L;return(k||E.type==="menubar"&&T!==p0)&&(q=!0),h.jsx(Nb,{context:j,modal:L,disabled:!b,returnFocus:s===void 0?q:s,initialFocus:E.type!=="menu",restoreFocus:!0,externalTree:E.type!=="menubar"?O:void 0,previousFocusableElement:R,nextFocusableElement:E.type===void 0?c.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:E.type===void 0?c.context.beforeContentFocusGuardRef:void 0,children:V})}),BA=w.createContext(void 0);function kW(){const e=w.useContext(BA);if(e===void 0)throw new Error(Cn(32));return e}const EW=w.forwardRef(function(t,n){const{keepMounted:r=!1,...i}=t,{store:s}=fo();return s.useState("mounted")||r?h.jsx(BA.Provider,{value:r,children:h.jsx(kb,{ref:n,...i})}):null});function HA(e){const{children:t,elementsRef:n,labelsRef:r,onMapChange:i}=e,s=tt(i),a=w.useRef(0),c=ir(NW).current,u=ir(TW).current,[f,m]=w.useState(0),p=w.useRef(f),y=tt((E,T)=>{u.set(E,T??null),p.current+=1,m(p.current)}),x=tt(E=>{u.delete(E),p.current+=1,m(p.current)}),b=w.useMemo(()=>{const E=new Map;return Array.from(u.keys()).filter(N=>N.isConnected).sort(RW).forEach((N,j)=>{const O=u.get(N)??{};E.set(N,{...O,index:j})}),E},[u,f]);We(()=>{if(typeof MutationObserver!="function"||b.size===0)return;const E=new MutationObserver(T=>{const N=new Set,j=O=>N.has(O)?N.delete(O):N.add(O);T.forEach(O=>{O.removedNodes.forEach(j),O.addedNodes.forEach(j)}),N.size===0&&(p.current+=1,m(p.current))});return b.forEach((T,N)=>{N.parentElement&&E.observe(N.parentElement,{childList:!0})}),()=>{E.disconnect()}},[b]),We(()=>{p.current===f&&(n.current.length!==b.size&&(n.current.length=b.size),r&&r.current.length!==b.size&&(r.current.length=b.size),a.current=b.size),s(b)},[s,b,n,r,f]),We(()=>()=>{n.current=[]},[n]),We(()=>()=>{r&&(r.current=[])},[r]);const S=tt(E=>(c.add(E),()=>{c.delete(E)}));We(()=>{c.forEach(E=>E(b))},[c,b]);const k=w.useMemo(()=>({register:y,unregister:x,subscribeMapChange:S,elementsRef:n,labelsRef:r,nextIndexRef:a}),[y,x,S,n,r,a]);return h.jsx(IA.Provider,{value:k,children:t})}function TW(){return new Map}function NW(){return new Set}function RW(e,t){const n=e.compareDocumentPosition(t);return n&Node.DOCUMENT_POSITION_FOLLOWING||n&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:n&Node.DOCUMENT_POSITION_PRECEDING||n&Node.DOCUMENT_POSITION_CONTAINS?1:0}const AW=w.forwardRef(function(t,n){const{anchor:r,positionMethod:i="absolute",className:s,render:a,side:c,align:u,sideOffset:f=0,alignOffset:m=0,collisionBoundary:p="clipping-ancestors",collisionPadding:y=5,arrowPadding:x=5,sticky:b=!1,disableAnchorTracking:S=!1,collisionAvoidance:k=gN,...E}=t,{store:T}=fo(),N=kW(),j=j0(!0),O=T.useState("parent"),A=T.useState("floatingRootContext"),R=T.useState("floatingTreeRoot"),L=T.useState("mounted"),B=T.useState("open"),I=T.useState("modal"),U=T.useState("activeTriggerElement"),Y=T.useState("transitionStatus"),V=T.useState("positionerElement"),q=T.useState("instantType"),H=T.useState("hasViewport"),z=T.useState("lastOpenChangeReason"),$=T.useState("floatingNodeId"),G=T.useState("floatingParentNodeId"),Q=A.useState("domReferenceElement"),_=w.useRef(null),P=GN(V,!1,!1);let W=r,D=f,Z=m,ee=u,J=k;O.type==="context-menu"&&(W=r??O.context?.anchor,ee=ee??"start",!c&&ee!=="center"&&(Z=t.alignOffset??2,D=t.sideOffset??-5));let he=c,fe=ee;O.type==="menu"?(he=he??"inline-end",fe=fe??"start",J=t.collisionAvoidance??yN):O.type==="menubar"&&(he=he??"bottom",fe=fe??"start");const Se=O.type==="context-menu",Ae=Ub({anchor:W,floatingRootContext:A,positionMethod:j?"fixed":i,mounted:L,side:he,sideOffset:D,align:fe,alignOffset:Z,arrowPadding:Se?0:x,collisionBoundary:p,collisionPadding:y,sticky:b,nodeId:$,keepMounted:N,disableAnchorTracking:S,collisionAvoidance:J,shiftCrossAxis:Se&&!("side"in J&&J.side==="flip"),externalTree:R,adaptiveOrigin:H?cR:void 0}),Oe=w.useMemo(()=>{const Re={};return B||(Re.pointerEvents="none"),{role:"presentation",hidden:!L,style:{...Ae.positionerStyles,...Re}}},[B,L,Ae.positionerStyles]);w.useEffect(()=>{function Re(pe){pe.open&&(pe.parentNodeId===$&&T.set("hoverEnabled",!1),pe.nodeId!==$&&pe.parentNodeId===T.select("floatingParentNodeId")&&T.setOpen(!1,Et(Nd)))}return R.events.on("menuopenchange",Re),()=>{R.events.off("menuopenchange",Re)}},[T,R.events,$]),w.useEffect(()=>{if(T.select("floatingParentNodeId")==null)return;function Re(pe){if(pe.open||pe.nodeId!==T.select("floatingParentNodeId"))return;const be=pe.reason??Nd;T.setOpen(!1,Et(be))}return R.events.on("menuopenchange",Re),()=>{R.events.off("menuopenchange",Re)}},[R.events,T]);const Pe=Bn();w.useEffect(()=>{B||Pe.clear()},[B,Pe]),w.useEffect(()=>{function Re(pe){if(!(!B||pe.nodeId!==T.select("floatingParentNodeId")))if(pe.target&&U&&U!==pe.target){const be=T.select("closeDelay");be>0?Pe.isStarted()||Pe.start(be,()=>{T.setOpen(!1,Et(Nd))}):T.setOpen(!1,Et(Nd))}else Pe.clear()}return R.events.on("itemhover",Re),()=>{R.events.off("itemhover",Re)}},[R.events,B,U,T,Pe]),w.useEffect(()=>{const Re={open:B,nodeId:$,parentNodeId:G,reason:T.select("lastOpenChangeReason")};R.events.emit("menuopenchange",Re)},[R.events,B,T,$,G]),We(()=>{const Re=Q,pe=_.current;if(Re&&(_.current=Re),pe&&Re&&Re!==pe){T.set("instantType",void 0);const be=new AbortController;return P(()=>{T.set("instantType","trigger-change")},be.signal),()=>{be.abort()}}},[Q,P,T]);const _e={open:B,side:Ae.side,align:Ae.align,anchorHidden:Ae.anchorHidden,nested:O.type==="menu",instant:q},De=w.useMemo(()=>({side:Ae.side,align:Ae.align,arrowRef:Ae.arrowRef,arrowUncentered:Ae.arrowUncentered,arrowStyles:Ae.arrowStyles,nodeId:Ae.context.nodeId}),[Ae.side,Ae.align,Ae.arrowRef,Ae.arrowUncentered,Ae.arrowStyles,Ae.context.nodeId]),xe=jt("div",t,{state:_e,stateAttributesMapping:Ss,ref:[n,T.useStateSetter("positionerElement")],props:[Oe,ru(Y),E]}),Ge=L&&O.type!=="menu"&&(O.type!=="menubar"&&I&&z!==Br||O.type==="menubar"&&O.context.modal);let we=null;return O.type==="menubar"?we=O.context.contentElement:O.type===void 0&&(we=U),h.jsxs(DA.Provider,{value:De,children:[Ge&&h.jsx(pv,{ref:O.type==="context-menu"||O.type==="nested-context-menu"?O.context.internalBackdropRef:null,inert:Vb(!B),cutout:we}),h.jsx(bz,{id:$,children:h.jsx(HA,{elementsRef:T.context.itemDomElements,labelsRef:T.context.itemLabels,children:xe})})]})}),UA=w.createContext(void 0);function OW(){const e=w.useContext(UA);if(e===void 0)throw new Error(Cn(34));return e}const jW=w.memo(w.forwardRef(function(t,n){const{render:r,className:i,value:s,defaultValue:a,onValueChange:c,disabled:u=!1,...f}=t,[m,p]=$c({controlled:s,default:a,name:"MenuRadioGroup"}),y=tt(c),x=tt((E,T)=>{y?.(E,T),!T.isCanceled&&p(E)}),S=jt("div",t,{state:{disabled:u},ref:n,props:{role:"group","aria-disabled":u||void 0,...f}}),k=w.useMemo(()=>({value:m,setValue:x,disabled:u}),[m,x,u]);return h.jsx(UA.Provider,{value:k,children:S})})),VA=w.createContext(void 0);function MW(){const e=w.useContext(VA);if(e===void 0)throw new Error(Cn(35));return e}const DW=w.forwardRef(function(t,n){const{render:r,className:i,id:s,label:a,nativeButton:c=!1,disabled:u=!1,closeOnClick:f=!1,value:m,...p}=t,y=lu({label:a}),x=If(!0),b=Si(s),{store:S}=fo(),k=S.useState("isActive",y.index),E=S.useState("itemProps"),{value:T,setValue:N,disabled:j}=OW(),O=j||u,A=T===m,{getItemProps:R,itemRef:L}=M0({closeOnClick:f,disabled:O,highlighted:k,id:b,store:S,nativeButton:c,nodeId:x?.nodeId,itemMetadata:Ov}),B=w.useMemo(()=>({disabled:O,highlighted:k,checked:A}),[O,k,A]),I=tt(Y=>{const V={...Et(ul,Y.nativeEvent),preventUnmountOnClose:()=>{}};N(m,V)}),U=jt("div",t,{state:B,stateAttributesMapping:D0,props:[E,{role:"menuitemradio","aria-checked":A,onClick:I},p,R],ref:[L,n,y.ref]});return h.jsx(VA.Provider,{value:B,children:U})}),_W=w.forwardRef(function(t,n){const{render:r,className:i,keepMounted:s=!1,...a}=t,c=MW(),u=w.useRef(null),{transitionStatus:f,setMounted:m}=Sa(c.checked);Ki({open:c.checked,ref:u,onComplete(){c.checked||m(!1)}});const p={checked:c.checked,disabled:c.disabled,highlighted:c.highlighted,transitionStatus:f};return jt("span",t,{state:p,stateAttributesMapping:D0,ref:[n,u],props:{"aria-hidden":!0,...a},enabled:s||c.checked})}),LW=w.createContext(null);function qA(e){return w.useContext(LW)}const IW={..._b,disabled:Ue(e=>e.parent.type==="menubar"&&e.parent.context.disabled||e.disabled),modal:Ue(e=>(e.parent.type===void 0||e.parent.type==="context-menu")&&(e.modal??!0)),allowMouseEnter:Ue(e=>e.allowMouseEnter),stickIfOpen:Ue(e=>e.stickIfOpen),parent:Ue(e=>e.parent),rootId:Ue(e=>e.parent.type==="menu"?e.parent.store.select("rootId"):e.parent.type!==void 0?e.parent.context.rootId:e.rootId),activeIndex:Ue(e=>e.activeIndex),isActive:Ue((e,t)=>e.activeIndex===t),hoverEnabled:Ue(e=>e.hoverEnabled),instantType:Ue(e=>e.instantType),lastOpenChangeReason:Ue(e=>e.openChangeReason),floatingTreeRoot:Ue(e=>e.parent.type==="menu"?e.parent.store.select("floatingTreeRoot"):e.floatingTreeRoot),floatingNodeId:Ue(e=>e.floatingNodeId),floatingParentNodeId:Ue(e=>e.floatingParentNodeId),itemProps:Ue(e=>e.itemProps),closeDelay:Ue(e=>e.closeDelay),hasViewport:Ue(e=>e.hasViewport),keyboardEventRelay:Ue(e=>{if(e.keyboardEventRelay)return e.keyboardEventRelay;if(e.parent.type==="menu")return e.parent.store.select("keyboardEventRelay")})};class jv extends b0{constructor(t){super({...PW(),...t},{positionerRef:w.createRef(),popupRef:w.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},allowMouseUpTriggerRef:{current:!1},triggerFocusTargetRef:w.createRef(),beforeContentFocusGuardRef:w.createRef(),onOpenChangeComplete:void 0,triggerElements:new Nf},IW),this.unsubscribeParentListener=this.observe("parent",n=>{if(this.unsubscribeParentListener?.(),n.type==="menu"){let r=n.store.select("rootId"),i=n.store.select("floatingTreeRoot"),s=n.store.select("keyboardEventRelay");this.unsubscribeParentListener=n.store.subscribe(()=>{const a=n.store.select("rootId"),c=n.store.select("floatingTreeRoot"),u=n.store.select("keyboardEventRelay");r===a&&i===c&&s===u||(r=a,i=c,s=u,this.notifyAll())}),this.context.allowMouseUpTriggerRef=n.store.context.allowMouseUpTriggerRef;return}n.type!==void 0&&(this.context.allowMouseUpTriggerRef=n.context.allowMouseUpTriggerRef),this.unsubscribeParentListener=null})}setOpen(t,n){this.state.floatingRootContext.context.events.emit("setOpen",{open:t,eventDetails:n})}static useStore(t,n){const r=ir(()=>new jv(n)).current;return t??r}unsubscribeParentListener=null}function PW(){return{...Db(),disabled:!1,modal:!0,allowMouseEnter:!1,stickIfOpen:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new Eb,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:Fn,keyboardEventRelay:void 0,closeDelay:0,hasViewport:!1}}const $A=w.createContext(void 0);function YA(){return w.useContext($A)}const WA=ub(function(t){const{children:n,open:r,onOpenChange:i,onOpenChangeComplete:s,defaultOpen:a=!1,disabled:c=!1,modal:u,loopFocus:f=!0,orientation:m="vertical",actionsRef:p,closeParentOnEsc:y=!1,handle:x,triggerId:b,defaultTriggerId:S=null,highlightItemOnHover:k=!0}=t,E=j0(!0),T=fo(!0),N=qA(!0),j=YA(),O=w.useMemo(()=>j&&T?{type:"menu",store:T.store}:N?{type:"menubar",context:N}:E&&!T?{type:"context-menu",context:E}:{type:void 0},[E,T,N,j]),A=jv.useStore(x?.store,{open:a,openProp:r,activeTriggerId:S,triggerIdProp:b,parent:O});l0(()=>{r===void 0&&A.state.open===!1&&a===!0&&A.update({open:!0,activeTriggerId:S})}),A.useControlledProp("openProp",r),A.useControlledProp("triggerIdProp",b),A.useContextCallback("onOpenChangeComplete",s);const R=A.useState("floatingTreeRoot"),L=DN(R),B=vs();We(()=>{E&&!T?A.update({parent:{type:"context-menu",context:E},floatingNodeId:L,floatingParentNodeId:B}):T&&A.update({floatingNodeId:L,floatingParentNodeId:B})},[E,T,L,B,A]);const I=A.useState("open"),U=A.useState("activeTriggerElement"),Y=A.useState("positionerElement"),V=A.useState("hoverEnabled"),q=A.useState("modal"),H=A.useState("disabled"),z=A.useState("lastOpenChangeReason"),$=A.useState("parent"),G=A.useState("activeIndex"),Q=A.useState("payload"),_=A.useState("floatingParentNodeId"),P=w.useRef(null),W=_!=null;let D;A.useSyncedValues({disabled:c,modal:$.type===void 0?u:void 0,rootId:Sl()});const{openMethod:Z,triggerProps:ee}=xv(I);jb(A);const{forceUnmount:J}=Mb(I,A,()=>{A.update({allowMouseEnter:!1,stickIfOpen:!0})}),he=w.useRef($.type!=="context-menu"),fe=Bn();w.useEffect(()=>{if(I||(P.current=null),$.type==="context-menu"){if(!I){fe.clear(),he.current=!1;return}fe.start(500,()=>{he.current=!0})}},[fe,I,$.type]),gv(I&&q&&z!==Br&&Z!=="touch",Y),We(()=>{!I&&!V&&A.set("hoverEnabled",!0)},[I,V,A]);const Se=w.useRef(!0),Ae=Bn(),Oe=tt((Je,Ke)=>{const bt=Ke.reason;if(I===Je&&Ke.trigger===U&&z===bt||(Ke.preventUnmountOnClose=()=>{A.set("preventUnmountingOnClose",!0)},!Je&&Ke.trigger==null&&(Ke.trigger=U??void 0),i?.(Je,Ke),Ke.isCanceled))return;const nt={open:Je,nativeEvent:Ke.event,reason:Ke.reason,nested:W};D?.emit("openchange",nt);const Qe=Ke.event;if(Je===!1&&Qe?.type==="click"&&Qe.pointerType==="touch"&&!Se.current)return;if(!Je&&G!==null){const Ye=A.context.itemDomElements.current[G];queueMicrotask(()=>{Ye?.setAttribute("tabindex","-1")})}Je&&bt===Oc?(Se.current=!1,Ae.start(300,()=>{Se.current=!0})):(Se.current=!0,Ae.clear());const Ct=(bt===Hc||bt===ul)&&Qe.detail===0&&Qe?.isTrusted,qe=!Je&&(bt===m0||bt==null),ge={open:Je,openChangeReason:bt};P.current=Ke.event??null;const je=Ke.trigger?.id??null;(je||Je)&&(ge.activeTriggerId=je,ge.activeTriggerElement=Ke.trigger??null),A.update(ge),$.type==="menubar"&&(bt===Oc||bt===fl||bt===Br||bt===Jp||bt===Nd)?A.set("instantType","group"):Ct||qe?A.set("instantType",Ct?"click":"dismiss"):A.set("instantType",void 0)}),Pe=w.useCallback(Je=>{const Ke=Et(Je);return Ke.preventUnmountOnClose=()=>{A.set("preventUnmountingOnClose",!0)},Ke},[A]),_e=w.useCallback(()=>{A.setOpen(!1,Pe(wb))},[A,Pe]);w.useImperativeHandle(p,()=>({unmount:J,close:_e}),[J,_e]);let De;$.type==="context-menu"&&(De=$.context),w.useImperativeHandle(De?.positionerRef,()=>Y,[Y]),w.useImperativeHandle(De?.actionsRef,()=>({setOpen:Oe}),[Oe]);const xe=Lb({popupStore:A,onOpenChange:Oe});D=xe.context.events,w.useEffect(()=>{const Je=({open:Ke,eventDetails:bt})=>Oe(Ke,bt);return D.on("setOpen",Je),()=>{D?.off("setOpen",Je)}},[D,Oe]);const Ge=y0(xe,{enabled:!H,bubbles:{escapeKey:y&&$.type==="menu"},outsidePress(){return $.type!=="context-menu"||P.current?.type==="contextmenu"?!0:he.current},externalTree:W?R:void 0}),we=nR(xe,{role:"menu"}),Re=lR(),pe=w.useCallback(Je=>{A.select("activeIndex")!==Je&&A.set("activeIndex",Je)},[A]),be=tR(xe,{enabled:!H,listRef:A.context.itemDomElements,activeIndex:G,nested:$.type!==void 0,loopFocus:f,orientation:m,parentOrientation:$.type==="menubar"?$.context.orientation:void 0,rtl:Re==="rtl",disabledIndices:ef,onNavigate:pe,openOnArrowKeyDown:$.type!=="context-menu",externalTree:W?R:void 0,focusItemOnHover:k}),ne=w.useCallback(Je=>{A.context.typingRef.current=Je},[A]),ye=rR(xe,{listRef:A.context.itemLabels,elementsRef:A.context.itemDomElements,activeIndex:G,resetMs:PP,onMatch:Je=>{I&&Je!==G&&A.set("activeIndex",Je)},onTypingChange:ne}),{getReferenceProps:Ce,getFloatingProps:Ve,getItemProps:lt,getTriggerProps:oe}=nu([Ge,we,be,ye]),ke=w.useMemo(()=>{const Je=jo(Ce(),{onMouseMove(){A.set("allowMouseEnter",!0)}},ee);return delete Je.role,Je},[Ce,A,ee]),Le=w.useMemo(()=>{const Je=oe();if(!Je)return Je;const Ke=jo(Je,ee);return delete Ke.role,delete Ke["aria-controls"],Ke},[oe,ee]),Me=w.useMemo(()=>Ve({onMouseMove(){A.set("allowMouseEnter",!0),$.type==="menu"&&A.set("hoverEnabled",!1)},onClick(){A.select("hoverEnabled")&&A.set("hoverEnabled",!1)},onKeyDown(Je){const Ke=A.select("keyboardEventRelay");Ke&&!Je.isPropagationStopped()&&Ke(Je)}}),[Ve,$.type,A]),He=w.useMemo(()=>lt(),[lt]);A.useSyncedValues({floatingRootContext:xe,activeTriggerProps:ke,inactiveTriggerProps:Le,popupProps:Me,itemProps:He});const ut=w.useMemo(()=>({store:A,parent:O}),[A,O]),xt=h.jsx(_A.Provider,{value:ut,children:typeof n=="function"?n({payload:Q}):n});return $.type===void 0||$.type==="context-menu"?h.jsx(vz,{externalTree:R,children:xt}):xt});function zW(e){const t=fo().store,n=w.useMemo(()=>({parentMenu:t}),[t]);return h.jsx($A.Provider,{value:n,children:h.jsx(WA,{...e})})}function GA(e){const t=e.getBoundingClientRect(),n=window.getComputedStyle(e,"::before"),r=window.getComputedStyle(e,"::after");if(!(n.content!=="none"||r.content!=="none"))return t;const s=parseFloat(n.width)||0,a=parseFloat(n.height)||0,c=parseFloat(r.width)||0,u=parseFloat(r.height)||0,f=Math.max(t.width,s,c),m=Math.max(t.height,a,u),p=f-t.width,y=m-t.height;return{left:t.left-p/2,right:t.right+p/2,top:t.top-y/2,bottom:t.bottom+y/2}}function FW(e={}){const{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:r}=dv(),{ref:i,index:s}=lu(e),a=n===s,c=w.useRef(null),u=ps(i,c);return{compositeProps:w.useMemo(()=>({tabIndex:a?0:-1,onFocus(){r(s)},onMouseMove(){const m=c.current;if(!t||!m)return;const p=m.hasAttribute("disabled")||m.ariaDisabled==="true";!a&&!p&&m.focus()}}),[a,r,s,t]),compositeRef:u,index:s}}function BW(e){const{render:t,className:n,state:r=Fn,props:i=ef,refs:s=ef,metadata:a,stateAttributesMapping:c,tag:u="div",...f}=e,{compositeProps:m,compositeRef:p}=FW({metadata:a});return jt(u,e,{state:r,ref:[...s,p],props:[m,...i,f],stateAttributesMapping:c})}function KA(e){if(zn(e)&&e.hasAttribute("data-rootownerid"))return e.getAttribute("data-rootownerid")??void 0;if(!ko(e))return KA(Oo(e))}function HW(e){const{enabled:t=!0,mouseDownAction:n,open:r}=e,i=w.useRef(!1);return w.useMemo(()=>t?{onMouseDown:s=>{(n==="open"&&!r||n==="close"&&r)&&(i.current=!0,Zt(s.currentTarget).addEventListener("click",()=>{i.current=!1},{once:!0}))},onClick:s=>{i.current&&(i.current=!1,s.preventBaseUIHandler())}}:Fn,[t,n,r])}const Op=2,UW=V6(function(t,n){const{render:r,className:i,disabled:s=!1,nativeButton:a=!0,id:c,openOnHover:u,delay:f=100,closeDelay:m=0,handle:p,payload:y,...x}=t,b=fo(!0),S=p?.store??b?.store;if(!S)throw new Error(Cn(85));const k=Si(c),E=S.useState("isTriggerActive",k),T=S.useState("floatingRootContext"),N=S.useState("isOpenedByTrigger",k),j=w.useRef(null),O=qW(),A=dv(!0),R=wa(),L=w.useMemo(()=>R??new Eb,[R]),B=DN(L),I=vs(),{registerTrigger:U,isMountedByThisTrigger:Y}=QN(k,j,S,{payload:y,closeDelay:m,parent:O,floatingTreeRoot:L,floatingNodeId:B,floatingParentNodeId:I,keyboardEventRelay:A?.relayKeyboardEvent}),V=O.type==="menubar",q=S.useState("disabled"),H=s||q||V&&O.context.disabled,{getButtonProps:z,buttonRef:$}=El({disabled:H,native:a});w.useEffect(()=>{!N&&O.type===void 0&&(S.context.allowMouseUpTriggerRef.current=!1)},[S,N,O.type]);const G=w.useRef(null),Q=Bn(),_=tt(we=>{if(!G.current)return;Q.clear(),S.context.allowMouseUpTriggerRef.current=!1;const Re=we.target;if(Nt(G.current,Re)||Nt(S.select("positionerElement"),Re)||Re===G.current||Re!=null&&KA(Re)===S.select("rootId"))return;const pe=GA(G.current);we.clientX>=pe.left-Op&&we.clientX<=pe.right+Op&&we.clientY>=pe.top-Op&&we.clientY<=pe.bottom+Op||L.events.emit("close",{domEvent:we,reason:xN})});w.useEffect(()=>{N&&S.select("lastOpenChangeReason")===Br&&Zt(G.current).addEventListener("mouseup",_,{once:!0})},[N,_,S]);const P=V&&O.context.hasSubmenuOpen,D=zb(T,{enabled:(u??P)&&!H&&O.type!=="context-menu"&&(!V||P&&!Y),handleClose:Fb({blockPointerEvents:!V}),mouseOnly:!0,move:!1,restMs:O.type===void 0?f:void 0,delay:{close:m},triggerElementRef:j,externalTree:L,isActiveTrigger:E}),Z=VW(N,S.select("lastOpenChangeReason")),ee=Rb(T,{enabled:!H&&O.type!=="context-menu",event:N&&V?"click":"mousedown",toggle:!0,ignoreMouse:!1,stickIfOpen:O.type===void 0?Z:!1}),J=ZN(T,{enabled:!H&&P}),he=HW({open:N,enabled:V,mouseDownAction:"open"}),fe=nu([ee,J]),Se={disabled:H,open:N},Ae=S.useState("triggerProps",Y),Oe=[G,n,$,U,j],Pe=[fe.getReferenceProps(),D??Fn,Ae,{"aria-haspopup":"menu",id:k,onMouseDown:we=>{if(S.select("open"))return;Q.start(200,()=>{S.context.allowMouseUpTriggerRef.current=!0}),Zt(we.currentTarget).addEventListener("mouseup",_,{once:!0})}},V?{role:"menuitem"}:{},he,x,z],_e=w.useRef(null),De=tt(we=>{vi.flushSync(()=>{S.setOpen(!1,Et(fl,we.nativeEvent,we.currentTarget))}),_P(_e.current)?.focus()}),xe=tt(we=>{const Re=S.select("positionerElement");if(Re&&Ac(we,Re))S.context.beforeContentFocusGuardRef.current?.focus();else{vi.flushSync(()=>{S.setOpen(!1,Et(fl,we.nativeEvent,we.currentTarget))});let pe=DP(S.context.triggerFocusTargetRef.current||j.current);for(;pe!==null&&Nt(Re,pe);){const be=pe;if(pe=vb(pe),pe===be)break}pe?.focus()}}),Ge=jt("button",t,{enabled:!V,stateAttributesMapping:Gy,state:Se,ref:Oe,props:Pe});return V?h.jsx(BW,{tag:"button",render:r,className:i,state:Se,refs:Oe,props:Pe,stateAttributesMapping:Gy}):N?h.jsxs(w.Fragment,{children:[h.jsx(Uc,{ref:_e,onFocus:De},`${k}-pre-focus-guard`),h.jsx(w.Fragment,{children:Ge},k),h.jsx(Uc,{ref:S.context.triggerFocusTargetRef,onFocus:xe},`${k}-post-focus-guard`)]}):h.jsx(w.Fragment,{children:Ge},k)});function VW(e,t){const n=Bn(),[r,i]=w.useState(!1);return We(()=>{e&&t==="trigger-hover"?(i(!0),n.start(zP,()=>{i(!1)})):e||(n.clear(),i(!1))},[e,t,n]),r}function qW(){const e=j0(!0),t=fo(!0),n=qA();return w.useMemo(()=>n?{type:"menubar",context:n}:e&&!t?{type:"context-menu",context:e}:{type:void 0},[e,t,n])}const $W=w.forwardRef(function(t,n){const{className:r,render:i,orientation:s="horizontal",...a}=t;return jt("div",t,{state:{orientation:s},ref:n,props:[{role:"separator","aria-orientation":s},a]})}),YW=w.forwardRef(function(t,n){const{render:r,className:i,label:s,id:a,nativeButton:c=!1,openOnHover:u=!0,delay:f=100,closeDelay:m=0,disabled:p=!1,...y}=t,x=lu(),b=If(),{store:S}=fo(),k=Si(a),E=S.useState("open"),T=S.useState("floatingRootContext"),N=S.useState("floatingTreeRoot"),j=KN(k,S),O=w.useCallback(ee=>{const J=j(ee);return ee!==null&&S.select("open")&&S.select("activeTriggerId")==null&&S.update({activeTriggerId:k,activeTriggerElement:ee,closeDelay:m}),J},[j,m,S,k]),A=w.useRef(null),R=w.useCallback(ee=>{A.current=ee,S.set("activeTriggerElement",ee)},[S]),L=YA();if(!L?.parentMenu)throw new Error(Cn(37));S.useSyncedValue("closeDelay",m);const B=L.parentMenu,I=B.useState("itemProps"),U=B.useState("isActive",x.index),Y=w.useMemo(()=>({type:"submenu-trigger",setActive(){B.set("activeIndex",x.index)}}),[B,x.index]),V=S.useState("disabled"),q=p||V,{getItemProps:H,itemRef:z}=M0({closeOnClick:!1,disabled:q,highlighted:U,id:k,store:S,typingRef:B.context.typingRef,nativeButton:c,itemMetadata:Y,nodeId:b?.nodeId}),$=S.useState("hoverEnabled"),G=B.useState("allowMouseEnter"),Q=zb(T,{enabled:$&&u&&!q,handleClose:Fb({blockPointerEvents:!0}),mouseOnly:!0,move:!0,restMs:f,delay:G?{open:f,close:m}:0,triggerElementRef:A,externalTree:N}),_=Rb(T,{enabled:!q,event:"mousedown",toggle:!u,ignoreMouse:u,stickIfOpen:!1}),P=nu([_]),W=S.useState("triggerProps",!0);return delete W.id,jt("div",t,{state:{disabled:q,highlighted:U,open:E},stateAttributesMapping:Hb,props:[P.getReferenceProps(),Q,W,I,{tabIndex:E||U?0:-1,onBlur(){U&&B.set("activeIndex",null)}},y,H],ref:[n,x.ref,z,O,R]})});function Na({...e}){return h.jsx(WA,{"data-slot":"dropdown-menu",...e})}function Ra({...e}){return h.jsx(UW,{"data-slot":"dropdown-menu-trigger",...e})}function ks({align:e="start",alignOffset:t=0,side:n="bottom",sideOffset:r=4,className:i,...s}){return h.jsx(EW,{children:h.jsx(AW,{className:"isolate z-50 outline-none",align:e,alignOffset:t,side:n,sideOffset:r,children:h.jsx(CW,{"data-slot":"dropdown-menu-content",className:ae("z-50 max-h-(--available-height) w-(--anchor-width) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg border border-border bg-neutral-900 p-1 text-foreground shadow-md ring-0 duration-100 outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:overflow-hidden data-closed:fade-out-0 data-closed:zoom-out-95",i),...s})})})}function al({...e}){return h.jsx(xW,{"data-slot":"dropdown-menu-group",...e})}function Dc({className:e,inset:t,...n}){return h.jsx(bW,{"data-slot":"dropdown-menu-label","data-inset":t,className:ae("px-2 py-1.5 text-xs font-medium text-muted-foreground data-inset:pl-8",e),...n})}function Vn({className:e,inset:t,variant:n="default",...r}){return h.jsx(vW,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":n,className:ae("group/dropdown-menu-item relative flex cursor-pointer items-center gap-2 rounded px-2 py-1.5 text-sm text-foreground outline-hidden select-none hover:bg-neutral-800 focus:bg-neutral-800 not-data-[variant=destructive]:focus:**:text-foreground data-inset:pl-8 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive",e),...r})}function na({...e}){return h.jsx(zW,{"data-slot":"dropdown-menu-sub",...e})}function ra({className:e,inset:t,children:n,...r}){return h.jsxs(YW,{"data-slot":"dropdown-menu-sub-trigger","data-inset":t,className:ae("flex cursor-pointer items-center gap-2 rounded px-2 py-1.5 text-sm text-foreground outline-hidden select-none hover:bg-neutral-800 focus:bg-neutral-800 data-inset:pl-8 data-popup-open:bg-neutral-800 data-open:bg-neutral-800 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...r,children:[n,h.jsx(t0,{className:"ml-auto"})]})}function ia({align:e="start",alignOffset:t=-3,side:n="right",sideOffset:r=0,className:i,...s}){return h.jsx(ks,{"data-slot":"dropdown-menu-sub-content",className:ae("w-auto min-w-24 rounded-lg border border-border bg-neutral-900 p-1 text-foreground shadow-lg ring-0 duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",i),align:e,alignOffset:t,side:n,sideOffset:r,...s})}function H2({className:e,children:t,checked:n,inset:r,...i}){return h.jsxs(mW,{"data-slot":"dropdown-menu-checkbox-item","data-inset":r,className:ae("relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-8 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),checked:n,...i,children:[h.jsx("span",{className:"pointer-events-none absolute right-2 flex items-center justify-center","data-slot":"dropdown-menu-checkbox-item-indicator",children:h.jsx(gW,{children:h.jsx(bf,{})})}),t]})}function WW({...e}){return h.jsx(jW,{"data-slot":"dropdown-menu-radio-group",...e})}function GW({className:e,children:t,inset:n,...r}){return h.jsxs(DW,{"data-slot":"dropdown-menu-radio-item","data-inset":n,className:ae("relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-8 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...r,children:[h.jsx("span",{className:"pointer-events-none absolute right-2 flex items-center justify-center","data-slot":"dropdown-menu-radio-item-indicator",children:h.jsx(_W,{children:h.jsx(bf,{})})}),t]})}function ls({className:e,...t}){return h.jsx($W,{"data-slot":"dropdown-menu-separator",className:ae("-mx-1 my-1 h-px bg-border",e),...t})}function Mv(e){const t=e.split(/[-_\s]+/).filter(Boolean);return t.length>=2?(t[0][0]+t[1][0]).toUpperCase():e.slice(0,2).toUpperCase()}const KW=()=>{const{apiClient:e}=$e.getState();return e?e.request(Rf.LOGOUT):Promise.reject(new Error("Not connected"))},QW=({mutationConfig:e}={})=>{const t=un(),{onSuccess:n,...r}=e??{};return dn({onSuccess(...i){t.invalidateQueries({queryKey:To().queryKey}),n?.(...i)},...r,mutationFn:KW})};function la({className:e,size:t="default",...n}){return h.jsx("div",{"data-slot":"card","data-size":t,className:ae("group/card flex flex-col gap-6 overflow-hidden rounded-xl bg-card py-6 text-sm text-card-foreground shadow-xs ring-1 ring-foreground/10 has-[>img:first-child]:pt-0 data-[size=sm]:gap-4 data-[size=sm]:py-4 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl",e),...n})}function XW({className:e,...t}){return h.jsx("div",{"data-slot":"card-title",className:ae("text-base leading-normal font-medium group-data-[size=sm]/card:text-sm",e),...t})}function jp({className:e,...t}){return h.jsx("div",{"data-slot":"card-description",className:ae("text-sm text-muted-foreground",e),...t})}const ZW=2500;function JW({onOpenChange:e,open:t}){const n=un(),r=yi(p=>p.isLoggingIn),i=yi(p=>p.setLoggingIn),s=$e(p=>p.connectionState),[a,c]=w.useState({type:"idle"});w.useEffect(()=>{t||(c({type:"idle"}),i(!1))},[t,i]),w.useEffect(()=>a.type!=="waiting"?void 0:RA(y=>{y.success&&y.user?(ht.success(`Logged in as ${y.user.email}`),n.invalidateQueries({queryKey:To().queryKey}),e(!1)):c({message:y.error??"Authentication failed",type:"error"}),i(!1)}),[e,n,i,a.type]),w.useEffect(()=>{if(a.type!=="waiting")return;let p=!1;async function y(){try{const b=await n.fetchQuery(To());if(p)return;b.isAuthorized&&b.user&&(ht.success(`Logged in as ${b.user.email}`),i(!1),e(!1))}catch{}}const x=globalThis.setInterval(y,ZW);return()=>{p=!0,globalThis.clearInterval(x)}},[e,n,i,a.type]);async function u(){i(!0),c({type:"starting"});try{const p=await NA();if(!Tv(p.authUrl))throw new Error("Received an unsafe OAuth URL from the daemon");window.open(p.authUrl,"_blank","noopener,noreferrer"),c({authUrl:p.authUrl,type:"waiting"})}catch(p){i(!1),c({message:p instanceof Error?p.message:"Unable to start login",type:"error"})}}function f(){c({type:"idle"})}const m=s!=="connected"||r;return h.jsx(Tl,{onOpenChange:e,open:t,children:h.jsxs(Nl,{children:[h.jsxs(Ci,{children:[h.jsx(ki,{children:"Redirecting to ByteRover"}),h.jsxs(jf,{children:["Please sign in to your ",h.jsx("span",{className:"text-foreground",children:"byterover.dev"})," account to continue."]})]}),a.type==="starting"&&h.jsx("div",{className:"rounded-lg border border-blue-500/20 bg-blue-500/5 p-3 text-sm text-blue-700",children:"Starting authentication…"}),a.type==="waiting"&&h.jsxs(la,{className:"p-4 gap-2",children:[h.jsx("div",{children:"Finish signing in in the new tab."}),h.jsxs("div",{className:"text-xs text-muted-foreground",children:["If the tab didn’t open,"," ",h.jsx("a",{className:"underline underline-offset-2",href:a.authUrl,rel:"noopener noreferrer",target:"_blank",children:"click this link"}),"."]})]}),a.type==="error"&&h.jsx("div",{className:"rounded-lg border border-destructive/20 bg-destructive/5 p-3 text-sm text-destructive",children:a.message}),h.jsx(Ea,{children:a.type==="error"?h.jsxs(h.Fragment,{children:[h.jsx(dx,{render:h.jsx(ze,{className:"cursor-pointer",variant:"ghost"}),children:"Cancel"}),h.jsx(ze,{className:"cursor-pointer",onClick:f,children:"Try again"})]}):h.jsxs(h.Fragment,{children:[h.jsx(dx,{render:h.jsx(ze,{className:"cursor-pointer",variant:"ghost"}),children:"Cancel"}),h.jsx(ze,{className:"cursor-pointer",disabled:m,onClick:u,children:a.type==="waiting"?"Waiting for authentication…":"Proceed to Login"})]})})]})})}function eG(){const[e,t]=w.useState(!1);return h.jsxs(h.Fragment,{children:[h.jsx(ze,{className:"h-auto rounded-full p-0",onClick:()=>t(!0),variant:"ghost",children:h.jsx(_f,{children:h.jsx(Lf,{className:"bg-transparent",children:h.jsx(wv,{className:"size-4 shrink-0"})})})}),h.jsx(JW,{onOpenChange:t,open:e})]})}function tG(){const e=yi(i=>i.user),t=QW(),n=un();if(w.useEffect(()=>{e||n.invalidateQueries({queryKey:To().queryKey}).catch(()=>{})},[n,e]),!e)return h.jsxs(ze,{disabled:!0,size:"sm",variant:"outline",children:[h.jsx(wv,{className:"size-4 shrink-0 text-muted-foreground"}),h.jsx("span",{children:"Signed in"})]});const r=e.name??e.email;return h.jsxs(Na,{children:[h.jsx(Ra,{children:h.jsxs(_f,{className:"cursor-pointer",children:[h.jsx(O0,{alt:r,src:e.avatarUrl}),h.jsx(Lf,{children:Mv(r)})]})}),h.jsxs(ks,{align:"start",className:"w-(--anchor-width) min-w-56",sideOffset:6,children:[h.jsx(al,{children:h.jsxs(Dc,{className:"flex flex-col gap-0.5",children:[h.jsx("span",{className:"text-xs tracking-widest text-muted-foreground",children:"Signed in"}),h.jsx("span",{className:"truncate text-sm font-medium text-card-foreground!",children:e.email})]})}),h.jsx(ls,{}),h.jsxs(Vn,{disabled:t.isPending,onClick:()=>t.mutate(),children:[h.jsx(y$,{className:"size-4 text-muted-foreground!"}),h.jsx("span",{className:"text-sm",children:t.isPending?"Logging out…":"Log out"})]})]})]})}function nG(){const e=yi(n=>n.isAuthorized);return yi(n=>n.isLoadingInitial)?h.jsx(ze,{disabled:!0,size:"icon",variant:"outline",children:h.jsx(wv,{className:"size-4 shrink-0 text-muted-foreground animate-pulse"})}):e?h.jsx(tG,{}):h.jsx(eG,{})}function rG(){const e=Ht(i=>i.seenWelcome),t=Ht(i=>i.tourCompleted),n=Ht(i=>i.startTour),r=!e&&!t;return h.jsxs(Na,{children:[h.jsx(Ra,{render:h.jsxs(ze,{size:"sm",variant:"ghost",children:[h.jsx(d$,{className:"size-4 mr-1"}),"Help",r&&h.jsx("span",{"aria-hidden":!0,className:ae("size-1.5 rounded-full bg-orange-500")})]})}),h.jsxs(ks,{align:"end",className:"w-56",children:[h.jsxs(Vn,{className:"bg-primary/8 hover:bg-primary/12 focus:bg-primary/12",onClick:()=>n(),children:[h.jsx(Bq,{className:"text-primary-foreground"}),h.jsx("span",{children:t?"Restart the tour":"Take the tour"})]}),h.jsx(ls,{}),h.jsx(Vn,{render:h.jsxs("a",{href:"https://docs.byterover.dev",rel:"noopener noreferrer",target:"_blank",children:[h.jsx(Tq,{}),h.jsx("span",{children:"Documentation"})]})}),h.jsx(Vn,{render:h.jsxs("a",{href:"https://github.com/campfirein/byterover-cli/issues",rel:"noopener noreferrer",target:"_blank",children:[h.jsx(Rq,{}),h.jsx("span",{children:"Report an issue"})]})})]})]})}function iG(e){const{children:t,open:n,defaultOpen:r=!1,onOpenChange:i,onOpenChangeComplete:s,actionsRef:a,handle:c,triggerId:u,defaultTriggerId:f=null}=e,m=ka(),p=!!m,y=ir(()=>c?.store??new yA({open:r,openProp:n,activeTriggerId:f,triggerIdProp:u,modal:!0,disablePointerDismissal:!0,nested:p,role:"alertdialog"})).current;y.useControlledProp("openProp",n),y.useControlledProp("triggerIdProp",u),y.useSyncedValue("nested",p),y.useContextCallback("onOpenChange",i),y.useContextCallback("onOpenChangeComplete",s);const x=y.useState("payload");gA({store:y,actionsRef:a,parentContext:m?.store.context});const b=w.useMemo(()=>({store:y}),[y]);return h.jsx(cv.Provider,{value:b,children:typeof t=="function"?t({payload:x}):t})}function Pf({...e}){return h.jsx(iG,{"data-slot":"alert-dialog",...e})}function oG({...e}){return h.jsx(mv,{"data-slot":"alert-dialog-portal",...e})}function sG({className:e,...t}){return h.jsx(uv,{"data-slot":"alert-dialog-overlay",className:ae("fixed inset-0 isolate z-50 bg-background/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",e),...t})}function zf({className:e,size:t="default",...n}){return h.jsxs(oG,{children:[h.jsx(sG,{}),h.jsx(hv,{"data-slot":"alert-dialog-content","data-size":t,className:ae("group/alert-dialog-content fixed top-1/2 left-1/2 z-50 grid w-full -translate-x-1/2 -translate-y-1/2 gap-6 rounded-xl bg-background p-6 text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none data-[size=default]:max-w-xs data-[size=sm]:max-w-xs data-[size=default]:sm:max-w-lg data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",e),...n})]})}function Ff({className:e,...t}){return h.jsx("div",{"data-slot":"alert-dialog-header",className:ae("grid grid-rows-[auto_1fr] place-items-center gap-1.5 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-6 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-left sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]",e),...t})}function Bf({className:e,...t}){return h.jsx("div",{"data-slot":"alert-dialog-footer",className:ae("flex flex-col-reverse gap-2 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end",e),...t})}function Hf({className:e,...t}){return h.jsx(bA,{"data-slot":"alert-dialog-title",className:ae("text-lg font-medium sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2",e),...t})}function Uf({className:e,...t}){return h.jsx(lA,{"data-slot":"alert-dialog-description",className:ae("text-sm text-balance text-muted-foreground md:text-pretty *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground",e),...t})}function Vf({className:e,variant:t="outline",size:n="default",...r}){return h.jsx(Of,{"data-slot":"alert-dialog-cancel",className:ae(e),render:h.jsx(ze,{variant:t,size:n}),...r})}const aG="state:getProjectConfig",lG=e=>{const{apiClient:t}=$e.getState();return t?t.request(aG,{projectPath:e}):Promise.reject(new Error("Not connected"))},cG=e=>({enabled:e.length>0,queryFn:()=>lG(e),queryKey:["project-config",e]}),QA=({projectPath:e,queryConfig:t})=>or({...t,...cG(e)}),uG=()=>{const{apiClient:e}=$e.getState();return e?e.request(iA.GET):Promise.reject(new Error("Not connected"))},dG=()=>({queryFn:uG,queryKey:["projects"]}),XA=({queryConfig:e}={})=>or({...dG(),...e}),fG=e=>{const{apiClient:t}=$e.getState();return t?t.request(iA.REVEAL,e):Promise.reject(new Error("Not connected"))},hG=({mutationConfig:e}={})=>dn({...e,mutationFn:fG}),pG=/^(?:\/Users\/|\/home\/|[A-Za-z]:[/\\]Users[/\\])[^/\\]+([/\\].*)$/;function ZA(e){const t=pG.exec(e);return t?`~${t[1]}`:e}function _0(e){return e.replace(/[/\\]+$/,"").split(/[/\\]/).at(-1)||e}const jE=["bg-gradient-to-br from-red-600 to-red-500 text-white","bg-gradient-to-br from-orange-400 to-pink-500 text-white","bg-gradient-to-br from-teal-500 to-emerald-500 text-white","bg-gradient-to-br from-blue-800 to-blue-600 text-white","bg-gradient-to-br from-sky-400 to-sky-300 text-white","bg-gradient-to-br from-purple-500 to-pink-500 text-white","bg-gradient-to-br from-green-500 to-lime-300 text-white","bg-gradient-to-br from-yellow-300 to-orange-400 text-white","bg-gradient-to-br from-orange-500 to-red-600 text-white","bg-gradient-to-br from-cyan-400 to-cyan-300 text-white"];function mG(e){let t=0;for(let n=0;n<e.length;n++){const r=e.codePointAt(n)??0;t=Math.abs(Math.trunc(t*31+r))}return jE[t%jE.length]}const gG={lg:"size-7 text-xs",md:"size-6 text-xs",sm:"size-5 text-[10px]"};function Dv({name:e,seed:t,size:n="md"}){return h.jsx("span",{className:ae("relative flex shrink-0 items-center justify-center overflow-hidden rounded font-extrabold leading-4",'before:absolute before:inset-0 before:bg-black/10 before:content-[""]',gG[n],mG(t??e)),children:h.jsx("span",{className:"relative",children:Mv(e)})})}function JA({onClick:e,project:t}){const n=_0(t.projectPath);return h.jsxs("button",{className:"flex w-full items-center gap-2 rounded-md p-2 text-left transition-colors hover:bg-accent cursor-pointer",onClick:e,type:"button",children:[h.jsx(Dv,{name:n,seed:t.projectPath,size:"lg"}),h.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[h.jsx("span",{className:"truncate text-sm font-medium leading-5 text-card-foreground",children:n}),h.jsx("span",{className:"truncate text-xs leading-4 text-muted-foreground",children:ZA(t.projectPath)})]})]})}function e8({onOpenChange:e,onSelect:t,open:n,projects:r}){const[i,s]=w.useState(""),a=w.useMemo(()=>{const u=i.trim().toLowerCase();return u?r.filter(f=>f.projectPath.toLowerCase().includes(u)):r},[r,i]);function c(u){t(u),e(!1)}return h.jsx(Tl,{onOpenChange:e,open:n,children:h.jsxs(Nl,{className:"gap-2 sm:max-w-lg",children:[h.jsxs(Ci,{children:[h.jsx(ki,{children:"All projects"}),h.jsx(jf,{children:h.jsxs("div",{className:"relative",children:[h.jsx(au,{className:"absolute left-3 top-1/2 size-4 -translate-y-1/2 text-muted-foreground"}),h.jsx(Wi,{autoFocus:!0,className:"pl-9",onChange:u=>s(u.target.value),placeholder:"Search...",value:i})]})})]}),h.jsx("div",{className:"-mx-4 no-scrollbar max-h-[60vh] min-h-[200px] overflow-y-auto px-4 mt-2",children:a.length===0?h.jsx("p",{className:"px-2 py-4 text-center text-xs text-muted-foreground",children:"No projects match your search."}):a.map(u=>h.jsx(JA,{onClick:()=>c(u),project:u},u.projectPath))})]})})}const ME=5;function t8({name:e,project:t,remoteLabel:n}){return h.jsxs(h.Fragment,{children:[h.jsx(Dv,{name:e,seed:t.projectPath}),h.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[h.jsx("span",{className:"truncate text-sm font-medium leading-5 text-card-foreground!",children:e}),h.jsx("span",{className:"truncate text-xs leading-4 text-muted-foreground!",children:ZA(t.projectPath)}),n&&h.jsx("span",{className:"text-muted-foreground! mono flex items-start gap-1 text-[10px] leading-4",children:h.jsxs("span",{className:"min-w-0 wrap-break-word",children:[h.jsx("span",{children:"Remote space: "}),h.jsx("span",{className:"text-primary-foreground! font-medium",children:n})]})})]})]})}function yG({onSelect:e,project:t,showRemote:n=!1}){const r=_0(t.projectPath),{data:i}=QA({projectPath:t.projectPath,queryConfig:{enabled:n}}),s=i?.brvConfig?.teamName,a=i?.brvConfig?.spaceName,c=s&&a?`${s} / ${a}`:void 0;return h.jsx(Vn,{className:"gap-2 rounded-md",onClick:e,children:h.jsx(t8,{name:r,project:t,remoteLabel:c})})}function xG({isSelected:e,onSelect:t,project:n}){const r=_0(n.projectPath),{data:i}=QA({projectPath:n.projectPath}),s=hG(),a=i?.brvConfig?.teamName,c=i?.brvConfig?.spaceName,u=a&&c?`${a} / ${c}`:void 0,f=i?.remoteUrl&&Tv(i.remoteUrl)?i.remoteUrl:void 0;function m(){s.mutate({projectPath:n.projectPath},{onError(p){ht.error(p instanceof Error?p.message:"Failed to open folder.")}})}return h.jsxs(na,{children:[h.jsx(ra,{className:"gap-2 rounded-md",children:h.jsx(t8,{name:r,project:n,remoteLabel:u})}),h.jsxs(ia,{className:"min-w-56",children:[h.jsxs(Vn,{disabled:e,onClick:t,children:[h.jsx(bq,{className:"size-4"}),h.jsx("span",{className:"text-sm",children:e?"Current project":"Switch to this project"})]}),h.jsxs(Vn,{disabled:!f,onClick:()=>{f&&window.open(f,"_blank","noopener,noreferrer")},children:[h.jsx(j$,{className:"size-4"}),h.jsx("span",{className:"text-sm",children:"Open Remote space"})]}),h.jsxs(Vn,{disabled:s.isPending,onClick:m,children:[h.jsx(e$,{className:"size-4"}),h.jsx("span",{className:"text-sm",children:"Open local folder"})]})]})]})}function bG(){const e=$e(b=>b.selectedProject),t=$e(b=>b.setSelectedProject),{data:n}=XA({queryConfig:{refetchInterval:3e3,refetchIntervalInBackground:!1,staleTime:30*1e3}}),r=w.useMemo(()=>n?.locations??[],[n]),{openProjects:i,recentProjects:s}=w.useMemo(()=>{const b=[],S=[];for(const k of r)k.isActive?b.push(k):S.push(k);return{openProjects:b,recentProjects:S}},[r]),[a,c]=w.useState(!1),[u,f]=w.useState(!1),[m,p]=w.useState(!1),y=_0(e);function x(b){b.projectPath!==e&&t(b.projectPath)}return h.jsxs(h.Fragment,{children:[h.jsxs(Na,{onOpenChange:c,open:a,children:[h.jsxs(Ra,{render:h.jsx(ze,{variant:"ghost"}),children:[e?h.jsx(Dv,{name:y,seed:e,size:"sm"}):null,h.jsx("span",{className:"truncate",children:y||"No project selected"}),h.jsx(Mf,{className:"size-4 shrink-0"})]}),h.jsxs(ks,{align:"start",className:"w-(--anchor-width) min-w-72",sideOffset:6,children:[h.jsxs(Vn,{onClick:()=>f(!0),children:[h.jsx(Zq,{className:"size-4"}),h.jsx("span",{className:"text-sm",children:"Open Project"})]}),h.jsx(ls,{}),i.length>0&&h.jsxs(al,{children:[h.jsx(Dc,{children:"Open Projects"}),i.map(b=>h.jsx(xG,{isSelected:b.projectPath===e,onSelect:()=>x(b),project:b},b.projectPath)),h.jsx(ls,{})]}),s.length>0&&h.jsxs(al,{children:[h.jsx(Dc,{children:"Recent Projects"}),s.slice(0,ME).map(b=>h.jsx(yG,{onSelect:()=>x(b),project:b},b.projectPath)),s.length>ME&&h.jsx(Vn,{onClick:()=>p(!0),children:h.jsx("span",{className:"text-xs",children:"See all"})})]})]})]}),h.jsx(Pf,{onOpenChange:f,open:u,children:h.jsxs(zf,{children:[h.jsxs(Ff,{children:[h.jsx(Hf,{children:"Add a project"}),h.jsxs(Uf,{children:["To add a project, run ",h.jsx("code",{className:"rounded bg-muted px-1.5 py-0.5 text-sm",children:"brv webui"})," in that folder from your terminal. Once registered, it will appear here."]})]}),h.jsx(Bf,{children:h.jsx(Vf,{children:"Got it"})})]})}),h.jsx(e8,{onOpenChange:p,onSelect:x,open:m,projects:r})]})}const vG=()=>{const{apiClient:e}=$e.getState();return e?e.request(qn.BRANCH,{action:"list",all:!0}).then(t=>{if(t.action!=="list")throw new Error(`Unexpected branch response action: ${t.action}`);return t.branches}):Promise.reject(new Error("Not connected"))},Aa=()=>({queryFn:vG,queryKey:["vc","branches","all"],refetchInterval:1e4,refetchIntervalInBackground:!1,staleTime:5e3}),wG=({queryConfig:e}={})=>or({...Aa(),...e}),SG=e=>{const{apiClient:t}=$e.getState();return t?t.request(qn.BRANCH,{action:"set-upstream",upstream:e}):Promise.reject(new Error("Not connected"))},CG=({mutationConfig:e}={})=>{const t=un(),{onSuccess:n,...r}=e??{};return dn({onSuccess(...i){t.invalidateQueries({queryKey:Ni().queryKey}),t.invalidateQueries({queryKey:Aa().queryKey}),n?.(...i)},...r,mutationFn:SG})},kG=e=>{const{apiClient:t}=$e.getState();return t?t.request(qn.CHECKOUT,e):Promise.reject(new Error("Not connected"))},n8=({mutationConfig:e}={})=>{const t=un(),{onSuccess:n,...r}=e??{};return dn({onSuccess(...i){t.invalidateQueries({queryKey:Ni().queryKey}),t.invalidateQueries({queryKey:Aa().queryKey}),n?.(...i)},...r,mutationFn:kG})},EG=(e={})=>{const{apiClient:t}=$e.getState();return t?t.request(qn.FETCH,e):Promise.reject(new Error("Not connected"))},TG=({mutationConfig:e}={})=>{const t=un(),{onSuccess:n,...r}=e??{};return dn({onSuccess(...i){t.invalidateQueries({queryKey:Ni().queryKey}),t.invalidateQueries({queryKey:Aa().queryKey}),n?.(...i)},...r,mutationFn:EG})},NG=(e={})=>{const{apiClient:t}=$e.getState();return t?t.request(qn.PULL,e):Promise.reject(new Error("Not connected"))},r8=({mutationConfig:e}={})=>{const t=un(),{onSuccess:n,...r}=e??{};return dn({onSuccess(...i){t.invalidateQueries({queryKey:Ni().queryKey}),t.invalidateQueries({queryKey:Aa().queryKey}),n?.(...i)},...r,mutationFn:NG})};function RG(e,t){const n=t.trim().toLowerCase();return n===""?[...e]:e.filter(r=>r.name.toLowerCase().includes(n))}const DE="refs/remotes/";function AG(e){const t=e.startsWith(DE)?e.slice(DE.length):e,n=t.indexOf("/");return n===-1?"unknown":t.slice(0,n)}function OG(e){const t=[],n=new Map;for(const r of e)if(r.isRemote){const i=AG(r.name),s=n.get(i);s?s.push(r):n.set(i,[r])}else t.push(r);return{locals:t,remotesByHost:n}}function jG(e,t){return t?e.some(r=>!r.isRemote&&r.name===t)?[...e]:[{isCurrent:!0,isRemote:!1,name:t},...e]:[...e]}const MG=e=>{const{apiClient:t}=$e.getState();return t?t.request(qn.BRANCH,{action:"delete",name:e}):Promise.reject(new Error("Not connected"))},DG=({mutationConfig:e}={})=>{const t=un(),{onSuccess:n,...r}=e??{};return dn({onSuccess(...i){t.invalidateQueries({queryKey:Aa().queryKey}),n?.(...i)},...r,mutationFn:MG})};function _G({branchName:e,onOpenChange:t,open:n}){const r=DG();async function i(){try{await r.mutateAsync(e),ht.success(`Deleted ${e}`),t(!1)}catch(s){ht.error(s instanceof Error?s.message:"Failed to delete branch")}}return h.jsx(Pf,{onOpenChange:t,open:n,children:h.jsxs(zf,{children:[h.jsxs(Ff,{children:[h.jsx(Hf,{children:"Delete branch?"}),h.jsxs(Uf,{children:["Branch ",h.jsx("code",{className:"rounded bg-muted px-1.5 py-0.5 text-sm",children:e})," will be removed. Unmerged commits on this branch will be lost unless they are reachable from another ref."]})]}),h.jsxs(Bf,{children:[h.jsx(Vf,{children:"Cancel"}),h.jsx(ze,{disabled:r.isPending,onClick:i,variant:"destructive",children:r.isPending?"Deleting…":"Delete branch"})]})]})})}function i8(e){return typeof e=="object"&&e!==null&&"code"in e&&typeof e.code=="string"}const LG=async()=>{const{apiClient:e}=$e.getState();if(!e)throw new Error("Not connected");try{return{gitInitialized:!0,url:(await e.request(qn.REMOTE,{subcommand:"show"})).url}}catch(t){if(i8(t)&&t.code===Ir.GIT_NOT_INITIALIZED)return{gitInitialized:!1,url:void 0};throw t}},_v=()=>({queryFn:LG,queryKey:["vc","remote"],staleTime:5e3}),IG=({queryConfig:e}={})=>or({..._v(),...e}),PG=()=>{const{apiClient:e}=$e.getState();return e?e.request(qn.INIT):Promise.reject(new Error("Not connected"))},zG=({mutationConfig:e}={})=>{const t=un(),{onSuccess:n,...r}=e??{};return dn({onSuccess(...i){t.invalidateQueries({queryKey:Ni().queryKey}),t.invalidateQueries({queryKey:Aa().queryKey}),t.invalidateQueries({queryKey:_v().queryKey}),n?.(...i)},...r,mutationFn:PG})};function Lv(){const e=zG();async function t(){try{const n=await e.mutateAsync();ht.success(n.reinitialized?"Reinitialized version control":"Initialized version control")}catch(n){ht.error(n instanceof Error?n.message:"Failed to initialize")}}return h.jsxs(ze,{disabled:e.isPending,onClick:()=>{t().catch(()=>{})},size:"sm",variant:"outline",children:[h.jsx(bv,{className:"size-4 shrink-0"}),h.jsx("span",{children:e.isPending?"Initializing…":"Initialize Version Control"})]})}function FG({className:e,...t}){return h.jsx("label",{"data-slot":"label",className:ae("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...t})}const BG=w0("group/field flex w-full gap-3 data-[invalid=true]:text-destructive",{variants:{orientation:{vertical:"flex-col *:w-full [&>.sr-only]:w-auto",horizontal:"flex-row items-center has-[>[data-slot=field-content]]:items-start *:data-[slot=field-label]:flex-auto has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px",responsive:"flex-col *:w-full @md/field-group:flex-row @md/field-group:items-center @md/field-group:*:w-auto @md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:*:data-[slot=field-label]:flex-auto [&>.sr-only]:w-auto @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px"}},defaultVariants:{orientation:"vertical"}});function Dm({className:e,orientation:t="vertical",...n}){return h.jsx("div",{role:"group","data-slot":"field","data-orientation":t,className:ae(BG({orientation:t}),e),...n})}function _m({className:e,...t}){return h.jsx(FG,{"data-slot":"field-label",className:ae("group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50 has-data-checked:border-primary/30 has-data-checked:bg-primary/5 has-[>[data-slot=field]]:rounded-md has-[>[data-slot=field]]:border *:data-[slot=field]:p-3 dark:has-data-checked:border-primary/20 dark:has-data-checked:bg-primary/10","has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col",e),...t})}function hx({className:e,...t}){return h.jsx("p",{"data-slot":"field-description",className:ae("text-left text-sm leading-normal font-normal text-muted-foreground group-has-data-horizontal/field:text-balance [[data-variant=legend]+&]:-mt-1.5","last:mt-0 nth-last-2:-mt-1","[&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary",e),...t})}function o8({className:e,children:t,errors:n,...r}){const i=w.useMemo(()=>{if(t)return t;if(!n?.length)return null;const s=[...new Map(n.map(a=>[a?.message,a])).values()];return s?.length==1?s[0]?.message:h.jsx("ul",{className:"ml-4 flex list-disc flex-col gap-1",children:s.map((a,c)=>a?.message&&h.jsx("li",{children:a.message},c))})},[t,n]);return i?h.jsx("div",{role:"alert","data-slot":"field-error",className:ae("text-sm font-normal text-destructive",e),...r,children:i}):null}function HG({initialName:e="",onOpenChange:t,open:n,startPoint:r}){const i=w.useId(),[s,a]=w.useState(e),[c,u]=w.useState(),f=n8();w.useEffect(()=>{n&&(a(e),u(void 0))},[e,n]);async function m(){const p=s.trim();if(p){u(void 0);try{await f.mutateAsync({branch:p,create:!0,startPoint:r}),ht.success(r?`Created ${p} from ${r} and switched to it`:`Created and switched to ${p}`),t(!1)}catch(y){u(y instanceof Error?y.message:"Failed to create branch")}}}return h.jsx(Tl,{onOpenChange:t,open:n,children:h.jsxs(Nl,{children:[h.jsxs(Ci,{children:[h.jsx(ki,{children:"New branch"}),h.jsx(jf,{children:r?`Create a branch based on ${r} and switch to it.`:"Create a branch from the current HEAD and switch to it."})]}),h.jsxs(Dm,{"data-invalid":!!c,children:[h.jsx(_m,{htmlFor:i,children:"Branch name"}),h.jsx(Wi,{"aria-invalid":!!c,autoFocus:!0,id:i,onChange:p=>{a(p.target.value),c&&u(void 0)},onKeyDown:p=>{p.key==="Enter"&&m()},placeholder:"Branch name",value:s}),h.jsx(hx,{children:c})]}),h.jsxs(Ea,{children:[h.jsx(dx,{render:h.jsx(ze,{className:"cursor-pointer",variant:"ghost"}),children:"Cancel"}),h.jsx(ze,{className:"cursor-pointer",disabled:s.trim().length===0||f.isPending,onClick:m,children:f.isPending?"Creating…":"Create branch"})]})]})})}function UG(e){return e?e.initialized?e.branch?e.branch:"detached":"No git repo":"branch"}function px(e){const t=e.startsWith("refs/remotes/")?e.slice(13):e,n=t.indexOf("/");return n===-1?t:t.slice(n+1)}function VG(){const e=vl(),[t,n]=w.useState(!1),[r,i]=w.useState(""),[s,a]=w.useState(null),[c,u]=w.useState(""),[f,m]=w.useState(),[p,y]=w.useState(null),[x,b]=w.useState(new Set(["origin"])),S=Rv(),k=wG({queryConfig:{enabled:S.data?.initialized??!1}}),E=n8(),T=TG(),N=r8(),j=CG(),{locals:O,remotesByHost:A}=w.useMemo(()=>{const D=jG(k.data??[],S.data?.branch),Z=r.trim()===""?D:RG(D,r);return OG(Z)},[k.data,r,S.data?.branch]),{currentLocal:R,hasLocals:L,hasOtherLocals:B,otherLocals:I}=w.useMemo(()=>{let D;const Z=[];for(const ee of O)ee.isCurrent&&!D?D=ee:Z.push(ee);return{currentLocal:D,hasLocals:O.length>0,hasOtherLocals:Z.length>0,otherLocals:Z}},[O]),U=A.size>0;function Y(D,Z=""){n(!1),u(Z),m(void 0),a(D)}function V(D){n(!1),u(px(D)),m(D),a("new-branch")}async function q(D,Z){n(!1);try{await E.mutateAsync({branch:D}),ht.success(Z)}catch(ee){ht.error("Failed to switch branch",{description:jn(ee)})}}function H(D){n(!1),y({branchName:D})}async function z(D){const Z=px(D.name),ee=(k.data??[]).find(J=>!J.isRemote&&J.name===Z);if(ee){q(ee.name,`Switched to ${ee.name}`).catch(()=>{});return}n(!1);try{await E.mutateAsync({branch:Z,create:!0,startPoint:D.name});try{await j.mutateAsync(D.name)}catch{}ht.success(`Switched to ${Z} (tracking ${D.name})`)}catch(J){ht.error("Failed to checkout remote branch",{description:jn(J)})}}function $(D){b(Z=>{const ee=new Set(Z);return ee.has(D)?ee.delete(D):ee.add(D),ee})}function G(){n(!1),ht.promise(T.mutateAsync({}),{error:D=>({description:jn(D),message:"Fetch failed"}),loading:"Fetching from remote…",success:"Fetched from remote"})}function Q(){n(!1),ht.promise(N.mutateAsync({}),{error:D=>({description:jn(D),message:"Pull failed"}),loading:"Updating project…",success:D=>D.alreadyUpToDate?`${D.branch} is up to date`:`Pulled ${D.branch}`})}const _=S.data!==void 0,P=S.data?.initialized??!1,W=UG(S.data);return _&&!P?h.jsx(Lv,{}):h.jsxs(h.Fragment,{children:[h.jsxs(Na,{onOpenChange:n,open:t,children:[h.jsxs(Ra,{render:h.jsx(ze,{disabled:!_,variant:"ghost"}),children:[h.jsx(bv,{className:"size-4 shrink-0"}),h.jsx("span",{className:"truncate max-w-40",children:W}),h.jsx(Mf,{className:"size-4 shrink-0"})]}),h.jsxs(ks,{align:"start",className:"w-80 p-0",sideOffset:6,children:[h.jsxs("div",{className:"flex items-center gap-1.5 p-2 border-b border-border",children:[h.jsxs("div",{className:"relative min-w-0 flex-1",children:[h.jsx(au,{className:"absolute left-3 top-1/2 size-4 -translate-y-1/2 text-muted-foreground"}),h.jsx(Wi,{autoFocus:!0,className:"pl-8",onChange:D=>i(D.target.value),onKeyDown:D=>D.stopPropagation(),placeholder:"Search branches…",value:r})]}),h.jsx(ze,{className:"shrink-0",disabled:T.isPending,onClick:G,size:"icon-sm",title:"Fetch",variant:"ghost",children:h.jsx(kq,{className:T.isPending?"size-4 animate-pulse":"size-4"})})]}),h.jsxs("div",{className:"max-h-[60vh] overflow-x-hidden overflow-y-auto py-1",children:[r.trim()===""&&h.jsxs(al,{children:[h.jsxs(Vn,{onClick:Q,children:[h.jsx(mq,{className:"size-5"}),h.jsx("span",{children:"Update Project"})]}),h.jsxs(Vn,{onClick:()=>{n(!1),e("/changes")},children:[h.jsx(r$,{className:"size-5"}),h.jsx("span",{children:"Commit..."})]}),h.jsx(ls,{}),h.jsxs(Vn,{onClick:()=>Y("new-branch",R?.name||""),children:[h.jsx(Ta,{className:"size-5"}),h.jsx("span",{children:"New Branch..."})]})]}),R?h.jsxs(h.Fragment,{children:[h.jsx(ls,{}),h.jsxs(al,{children:[h.jsx(Dc,{children:"Current"}),h.jsx(_E,{branch:R,onCheckout:()=>{q(R.name,`Switched to ${R.name}`).catch(()=>{})},onDelete:()=>H(R.name),onNewBranchFrom:()=>V(R.name),trackingBranch:S.data?.trackingBranch})]})]}):null,B&&h.jsxs(h.Fragment,{children:[h.jsx(ls,{}),h.jsxs(al,{children:[h.jsx(Dc,{children:"Local"}),I.map(D=>h.jsx(_E,{branch:D,onCheckout:()=>{q(D.name,`Switched to ${D.name}`).catch(()=>{})},onDelete:()=>H(D.name),onNewBranchFrom:()=>V(D.name)},D.name))]})]}),U&&h.jsxs(h.Fragment,{children:[h.jsx(ls,{}),h.jsxs(al,{children:[h.jsx(Dc,{children:"Remote"}),[...A.entries()].map(([D,Z])=>h.jsx(qG,{branches:Z,expanded:x.has(D),host:D,onBranchCheckout:z,onBranchNewBranchFrom:ee=>V(ee.name),onToggle:()=>$(D)},D))]})]}),!L&&!U&&h.jsx("p",{className:"px-3 py-4 text-center text-xs text-muted-foreground",children:r?"No branches match your search.":"No branches."})]})]})]}),h.jsx(HG,{initialName:c,onOpenChange:D=>D?null:a(null),open:s==="new-branch",startPoint:f}),h.jsx(_G,{branchName:p?.branchName??"",onOpenChange:D=>D?null:y(null),open:p!==null})]})}function _E({branch:e,onCheckout:t,onDelete:n,onNewBranchFrom:r,trackingBranch:i}){return h.jsxs(na,{children:[h.jsxs(ra,{children:[h.jsx("span",{className:"flex size-4 shrink-0 items-center justify-center",children:e.isCurrent?h.jsx(Rl,{className:"size-4 text-primary"}):null}),h.jsx("span",{className:"min-w-0 flex-1 truncate text-left",children:e.name}),i?h.jsx("span",{className:"shrink-0 truncate max-w-32 text-xs text-muted-foreground",children:i}):null]}),h.jsxs(ia,{className:"min-w-56",children:[!e.isCurrent&&h.jsx(Vn,{onClick:t,children:"Checkout"}),h.jsx(Vn,{onClick:r,children:h.jsxs("span",{className:"min-w-0 flex-1 truncate",children:["New Branch from '",e.name,"'..."]})}),!e.isCurrent&&h.jsxs(h.Fragment,{children:[h.jsx(ls,{}),h.jsx(Vn,{onClick:n,children:"Delete…"})]})]})]})}function qG({branches:e,expanded:t,host:n,onBranchCheckout:r,onBranchNewBranchFrom:i,onToggle:s}){return h.jsxs("div",{className:"flex min-w-0 flex-col",children:[h.jsxs("button",{className:"flex min-w-0 cursor-pointer items-center gap-2 px-3 py-1.5 text-sm text-foreground outline-none hover:bg-muted focus:bg-muted",onClick:s,type:"button",children:[h.jsx(SA,{className:`size-4 shrink-0 text-muted-foreground transition-transform ${t?"rotate-90":""}`}),h.jsx("span",{className:"min-w-0 flex-1 truncate text-left",children:n})]}),t?e.map(a=>h.jsx($G,{branch:a,onCheckout:()=>r(a),onNewBranchFrom:()=>i(a)},a.name)):null]})}function $G({branch:e,onCheckout:t,onNewBranchFrom:n}){const r=px(e.name);return h.jsxs(na,{children:[h.jsx(ra,{className:"pl-15",children:h.jsx("span",{className:"min-w-0 flex-1 truncate text-left",children:r})}),h.jsxs(ia,{className:"min-w-56",children:[h.jsx(Vn,{onClick:t,children:"Checkout"}),h.jsx(Vn,{onClick:n,children:h.jsxs("span",{className:"min-w-0 flex-1 truncate",children:["New Branch from '",e.name,"'..."]})})]})]})}function YG(){const e=$e(c=>c.version),[t,n]=w.useState(!1),{data:r}=lv(),{data:i}=av(),s=r?.providers.find(c=>c.isCurrent),a=s?`${s.name}${i?.activeModel?` | ${i.activeModel}`:""}`:"No model configured";return h.jsxs("header",{className:"flex items-center gap-4 px-6 py-3.5",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsxs("div",{className:"flex items-center gap-1.5 mr-2.5",children:[h.jsx("img",{alt:"ByteRover",className:"w-32",src:iW}),e&&h.jsxs("span",{className:"text-primary-foreground text-xs font-medium",children:["v",e]})]}),h.jsx(bG,{}),h.jsx(VG,{}),h.jsxs(ms,{children:[h.jsxs(gs,{render:h.jsx(uo,{className:"border-primary-foreground/40 bg-primary-foreground/15 text-primary-foreground mono gap-1 px-1.5 text-[9px] leading-none font-semibold tracking-[0.16em] uppercase",variant:"outline"}),children:[h.jsx("span",{"aria-hidden":!0,className:"bg-primary-foreground size-1 shrink-0 rounded-full"}),h.jsx("span",{className:"leading-none",children:"Local"})]}),h.jsx(ys,{children:"You're viewing the local web UI, served from the daemon on your machine."})]})]}),h.jsx("div",{className:"flex-1"}),h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsxs(ms,{children:[h.jsxs(gs,{render:h.jsx(ze,{onClick:()=>n(!0),size:"sm",variant:"ghost"}),children:[h.jsxs("span",{className:"relative mr-1 inline-flex size-4 shrink-0",children:[h.jsx(EA,{className:"size-4"}),s&&h.jsx(AE,{className:"border-background absolute -right-0.5 -bottom-0.5 size-2 border-2",tone:"success"})]}),a,!s&&h.jsx(AE,{pulsing:!0,tone:"amber"})]}),h.jsx(ys,{children:"Configure provider to power curate & query"})]}),h.jsx(A0,{onOpenChange:n,open:t}),h.jsx(rG,{}),h.jsx(nG,{})]})]})}function WG(){const{completed:e,inProgress:t,total:n}=AV(),r=n>0?`${e}/${n}`:void 0,i=t>0?"active":"idle";return[{label:"Context",path:"/contexts"},{label:"Changes",path:"/changes"},{badge:r,badgeTone:i,label:"Tasks",path:"/tasks"},{label:"Configuration",path:"/configuration"}]}function GG(){const{data:e}=Rv(),{staged:t,unmerged:n,unstaged:r}=OA(e),i=t.length+r.length+n.length;return i===0?null:h.jsx("span",{className:"ml-1.5 rounded-md bg-[#4f3422] p-1 text-xs font-semibold tabular-nums text-[#ffc53d]",children:i})}function KG(){const e=WG();JY();const t=Ht(c=>c.tourActive),n=Ht(c=>c.tourStep),r=Ht(c=>c.tourTaskId),{pathname:i}=Gi(),s=i.startsWith("/tasks"),a=t&&(n==="curate"||n==="query")&&!r&&!s;return h.jsxs("div",{className:"flex h-screen flex-col",children:[h.jsx(YG,{}),h.jsx("nav",{className:"border-border flex gap-2 border-b px-6",children:e.map(c=>{const u=h.jsxs(H6,{className:({isActive:f})=>ae("flex items-center gap-1.5 border-b-2 px-2 pt-2 pb-3 text-sm transition-colors",{"border-primary-foreground text-primary-foreground font-medium":f,"border-transparent text-muted-foreground hover:text-foreground":!f}),to:c.path,children:[h.jsx("span",{children:c.label}),c.badge&&h.jsxs(uo,{className:"tabular-nums",variant:"secondary",children:[c.badgeTone==="active"&&h.jsx("span",{"aria-hidden":!0,className:"bg-primary-foreground size-1.5 shrink-0 rounded-full"}),c.badge]}),c.path==="/changes"&&h.jsx(GG,{})]});return c.path==="/tasks"?h.jsx(Nv,{active:a,label:"Click here",children:u},c.path):h.jsx("span",{children:u},c.path)})}),h.jsx("main",{className:"min-h-0 flex-1 overflow-y-auto p-4",children:h.jsx(P6,{})}),h.jsx(ZY,{}),h.jsx(QY,{}),h.jsx(LV,{}),h.jsx(zV,{}),h.jsx(eW,{})]})}function QG(){return h.jsxs("div",{className:"flex flex-col gap-4",children:[h.jsxs("section",{className:"grid gap-4 grid-cols-3",children:[h.jsxs(la,{className:"gap-1 px-4 shadow-none ring-border/80",size:"sm",children:[h.jsx("div",{className:"text-xs tracking-wider uppercase text-muted-foreground",children:"Total tasks"}),h.jsx("strong",{className:"text-3xl leading-none",children:"0"}),h.jsx(jp,{children:"Waiting for the skipped task-subscription issue."})]}),h.jsxs(la,{className:"gap-1 px-4 shadow-none ring-border/80",size:"sm",children:[h.jsx("div",{className:"text-xs tracking-wider uppercase text-muted-foreground",children:"Success rate"}),h.jsx("strong",{className:"text-3xl leading-none",children:"0%"}),h.jsx(jp,{children:"No client-side task history is wired into the web app yet."})]}),h.jsxs(la,{className:"gap-1 px-4 shadow-none ring-border/80",size:"sm",children:[h.jsx("div",{className:"text-xs tracking-wider uppercase text-muted-foreground",children:"Average duration"}),h.jsx("strong",{className:"text-3xl leading-none",children:"0s"}),h.jsx(jp,{children:"This will populate once task-store parity lands."})]})]}),h.jsxs(la,{className:"min-h-56 items-start justify-center gap-3 px-5 shadow-sm ring-border/70",size:"sm",children:[h.jsx(uo,{className:"rounded-sm border-yellow-500/20 bg-yellow-500/10 text-yellow-600",variant:"outline",children:"Empty state"}),h.jsx(XW,{className:"font-semibold",children:"No task data available yet"}),h.jsx(jp,{children:"The plan explicitly skips the activity/task subscription issue. This page is wired as a placeholder so the route exists cleanly and can consume task-store data once that transport work lands."})]})]})}const XG="data:image/svg+xml,%3csvg%20width='120'%20height='120'%20viewBox='0%200%20120%20120'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M60%20120C93%20120%20120%2093%20120%2060C120%2027%2093%200%2060%200C27%200%200%2027%200%2060C0%2093%2027%20120%2060%20120Z'%20fill='url(%23paint0_linear_2037_60923)'%20fill-opacity='0.15'/%3e%3cpath%20d='M60%200.75C92.5858%200.75%20119.25%2027.4142%20119.25%2060C119.25%2092.5858%2092.5858%20119.25%2060%20119.25C27.4142%20119.25%200.75%2092.5858%200.75%2060C0.75%2027.4142%2027.4142%200.75%2060%200.75Z'%20stroke='url(%23paint1_linear_2037_60923)'%20stroke-opacity='0.5'%20stroke-width='1.5'/%3e%3cpath%20d='M87.3926%2037.6738C88.505%2036.4418%2090.2734%2036.4418%2091.3857%2037.6738C92.5382%2038.9504%2092.5381%2041.0486%2091.3857%2042.3252L51.6631%2086.3262C50.5507%2087.5582%2048.7823%2087.5582%2047.6699%2086.3262L29.6143%2066.3252C28.4621%2065.0486%2028.4621%2062.9514%2029.6143%2061.6748C30.7267%2060.4426%2032.495%2060.4426%2033.6074%2061.6748L47.625%2077.2021C48.717%2078.4118%2050.616%2078.4118%2051.708%2077.2021L87.3926%2037.6738Z'%20fill='url(%23paint2_linear_2037_60923)'%20stroke='%2300E275'%20stroke-width='1.5'/%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_2037_60923'%20x1='17.9848'%20y1='14.0983'%20x2='125.634'%20y2='103.845'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='white'/%3e%3cstop%20offset='1'%20stop-color='%23999999'%20stop-opacity='0.5'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint1_linear_2037_60923'%20x1='15.3936'%20y1='-1.63761e-06'%20x2='120'%20y2='90.8895'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='white'%20stop-opacity='0.5'/%3e%3cstop%20offset='1'%20stop-color='%23999999'%20stop-opacity='0'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint2_linear_2037_60923'%20x1='65.5979'%20y1='65.9795'%20x2='78.5737'%20y2='-56.684'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%2309814A'/%3e%3cstop%20offset='1'%20stop-color='%2300CC66'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e",ZG={[Ir.CONFIG_KEY_NOT_SET]:{label:"Set identity",target:"/configuration"},[Ir.NO_REMOTE]:{label:"Set remote",target:"/configuration"},[Ir.USER_NOT_CONFIGURED]:{label:"Set identity",target:"/configuration"}};function JG(e){if(typeof e!="object"||e===null||!("code"in e))return;const{code:t}=e;return typeof t=="string"?t:void 0}function fd(e,t,n,r={}){const i=jn(e,t,r),s=ZG[JG(e)??""];if(s){ht.error(i,{action:{label:s.label,onClick:()=>n(s.target)}});return}ht.error(i)}const eK=(e={})=>{const{apiClient:t}=$e.getState();return t?t.request(qn.ADD,e):Promise.reject(new Error("Not connected"))},tK=({mutationConfig:e}={})=>{const t=un(),{onSuccess:n,...r}=e??{};return dn({onSuccess(...i){t.invalidateQueries({queryKey:Ni().queryKey}),n?.(...i)},...r,mutationFn:eK})},nK=({addAll:e,filePaths:t,message:n})=>{const{apiClient:r}=$e.getState();if(!r)return Promise.reject(new Error("Not connected"));const i=()=>r.request(qn.COMMIT,{message:n});if(e||t&&t.length>0){const s=t?{filePaths:t}:{};return r.request(qn.ADD,s).then(i)}return i()},rK=({mutationConfig:e}={})=>{const t=un(),{onSuccess:n,...r}=e??{};return dn({onSuccess(...i){t.invalidateQueries({queryKey:Ni().queryKey}),n?.(...i)},...r,mutationFn:nK})},iK=()=>{const{apiClient:e}=$e.getState();return e?e.request(qn.MERGE,{action:"abort"}):Promise.reject(new Error("Not connected"))},oK=({mutationConfig:e}={})=>{const t=un(),{onSuccess:n,...r}=e??{};return dn({onSuccess(...i){t.invalidateQueries({queryKey:Ni().queryKey}),t.invalidateQueries({queryKey:["vc","diff"]}),t.invalidateQueries({queryKey:["vc","diffs"]}),n?.(...i)},...r,mutationFn:iK})},sK=e=>{const{apiClient:t}=$e.getState();return t?t.request(qn.MERGE,{action:"continue",message:e.message}):Promise.reject(new Error("Not connected"))},aK=({mutationConfig:e}={})=>{const t=un(),{onSuccess:n,...r}=e??{};return dn({onSuccess(...i){t.invalidateQueries({queryKey:Ni().queryKey}),t.invalidateQueries({queryKey:["vc","diff"]}),t.invalidateQueries({queryKey:["vc","diffs"]}),n?.(...i)},...r,mutationFn:sK})},lK=(e={})=>{const{apiClient:t}=$e.getState();return t?t.request(qn.PUSH,e):Promise.reject(new Error("Not connected"))},cK=({mutationConfig:e}={})=>{const t=un(),{onSuccess:n,...r}=e??{};return dn({onSuccess(...i){t.invalidateQueries({queryKey:Ni().queryKey}),t.invalidateQueries({queryKey:Aa().queryKey}),n?.(...i)},...r,mutationFn:lK})},uK=(e={})=>{const{apiClient:t}=$e.getState();return t?t.request(qn.RESET,e):Promise.reject(new Error("Not connected"))},dK=({mutationConfig:e}={})=>{const t=un(),{onSuccess:n,...r}=e??{};return dn({onSuccess(...i){t.invalidateQueries({queryKey:Ni().queryKey}),n?.(...i)},...r,mutationFn:uK})};function fK(e){return e.status==="unmerged"?"merge":e.isStaged?"staged":"unstaged"}function am(e){return`${fK(e)}:${e.path}`}const mx="Please sign in to use sync feature";function LE(e,t){return t?e:h.jsxs(ms,{children:[h.jsx(gs,{render:h.jsx("span",{tabIndex:0}),children:e}),h.jsx(ys,{children:mx})]})}function hK({ahead:e=0,behind:t=0,branch:n,hasTracking:r,isAborting:i=!1,isAuthenticated:s,isPulling:a,isPushing:c,mergeInProgress:u=!1,onAbortMerge:f,onPull:m,onPush:p}){const y=a||c||i,x=s?r?"Pull from upstream":"No upstream tracking branch":mx,b=s?r?"Push to upstream":"Push and set upstream":mx,S=h.jsxs(ze,{className:"h-7 gap-1 px-2 text-sm",disabled:y||!r||!s,onClick:m,size:"sm",title:x,variant:"ghost",children:[a?h.jsx(ei,{className:"size-3.5 animate-spin"}):h.jsx(yq,{className:"size-3.5"}),t>0&&h.jsx("span",{className:"text-sm tabular-nums",children:t})]}),k=h.jsxs(ze,{className:"h-7 gap-1 px-2 text-sm",disabled:y||!s,onClick:p,size:"sm",title:b,variant:"ghost",children:[c?h.jsx(ei,{className:"size-3.5 animate-spin"}):h.jsx(Sq,{className:"size-3.5"}),e>0&&h.jsx("span",{className:"text-sm tabular-nums",children:e})]});return h.jsxs("div",{className:"flex items-center justify-between gap-2",children:[h.jsxs("div",{className:"text-muted-foreground flex min-w-0 items-center gap-1.5",children:[h.jsx(bv,{className:"size-4 shrink-0"}),h.jsx("span",{className:"truncate text-sm font-medium",children:n??"(detached)"})]}),h.jsxs("div",{className:"flex items-center gap-0.5",children:[u&&f&&h.jsxs(ze,{className:"text-destructive h-7 gap-1 px-2 text-sm hover:bg-destructive/10 hover:text-destructive",disabled:y,onClick:f,size:"sm",title:"Abort merge",variant:"ghost",children:[i?h.jsx(ei,{className:"size-3.5 animate-spin"}):h.jsx(Uq,{className:"size-3.5"}),h.jsx("span",{children:"Abort"})]}),LE(S,s),LE(k,s)]})]})}function Iv({className:e,...t}){return h.jsx("textarea",{"data-slot":"textarea",className:ae("flex field-sizing-content min-h-16 w-full rounded-md border border-border bg-background px-2.5 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none placeholder:text-muted-foreground focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-background dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",e),...t})}function pK({canCommit:e,isCommitting:t,message:n,onCommit:r,onMessageChange:i}){const s=a=>{(a.metaKey||a.ctrlKey)&&a.key==="Enter"&&(a.preventDefault(),r())};return h.jsxs("div",{className:"flex flex-col gap-2",children:[h.jsx(Iv,{className:"min-h-20 resize-none",onChange:a=>i(a.target.value),onKeyDown:s,placeholder:"Commit message (Cmd/Ctrl+Enter to commit)",value:n}),h.jsx(ze,{className:"w-full gap-2",disabled:!e||!n.trim()||t,onClick:r,size:"sm",children:"Commit"})]})}const mK=e=>{const{apiClient:t}=$e.getState();return t?t.request(qn.DIFF,e):Promise.reject(new Error("Not connected"))},gK=e=>({queryFn:()=>mK(e),queryKey:["vc","diff",e.path,e.side],staleTime:0}),yK=({enabled:e=!0,path:t,queryConfig:n,side:r})=>or({...gK({path:t,side:r}),enabled:e&&!!t,...n});function s8({file:e,onOpenFile:t,onStageToggle:n}){const r=e.isStaged?"Unstage":"Stage",i=e.isStaged?vv:Ta,s=e.status==="deleted";return h.jsxs("div",{className:"border-border bg-muted sticky top-0 z-10 flex items-center gap-2 border-b px-3 py-1.5",children:[h.jsx(E0,{className:"text-primary-foreground size-4 shrink-0",strokeWidth:2}),h.jsx("span",{className:"text-foreground flex-1 truncate font-mono text-xs",children:e.path}),h.jsx(ze,{className:"size-6 transition-colors hover:bg-foreground/15 dark:hover:bg-foreground/15 hover:text-foreground",disabled:s,onClick:t,size:"icon-xs",title:s?"File no longer exists":"Open file",variant:"ghost",children:h.jsx(Mm,{className:"size-3"})}),h.jsx(ze,{className:"size-6 transition-colors hover:bg-foreground/15 dark:hover:bg-foreground/15 hover:text-foreground",onClick:n,size:"icon-xs",title:r,variant:"ghost",children:h.jsx(i,{className:"size-3"})})]})}var U2={exports:{}};var IE;function xK(){return IE||(IE=1,(function(e){(function(){var t={}.hasOwnProperty;function n(){for(var s="",a=0;a<arguments.length;a++){var c=arguments[a];c&&(s=i(s,r(c)))}return s}function r(s){if(typeof s=="string"||typeof s=="number")return s;if(typeof s!="object")return"";if(Array.isArray(s))return n.apply(null,s);if(s.toString!==Object.prototype.toString&&!s.toString.toString().includes("[native code]"))return s.toString();var a="";for(var c in s)t.call(s,c)&&s[c]&&(a=i(a,c));return a}function i(s,a){return a?s?s+" "+a:s+a:s}e.exports?(n.default=n,e.exports=n):window.classNames=n})()})(U2)),U2.exports}var bK=xK();const ro=Zc(bK);var PE=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function vK(e,t){return!!(e===t||PE(e)&&PE(t))}function wK(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!vK(e[n],t[n]))return!1;return!0}function SK(e,t){t===void 0&&(t=wK);var n=null;function r(){for(var i=[],s=0;s<arguments.length;s++)i[s]=arguments[s];if(n&&n.lastThis===this&&t(i,n.lastArgs))return n.lastResult;var a=e.apply(this,i);return n={lastResult:a,lastArgs:i,lastThis:this},a}return r.clear=function(){n=null},r}function CK(e,t,n){let r=0,i;const s={},a=[];return e.forEach((c,u)=>{const f=t.some(m=>m>=u-n&&m<=u+n);!f&&i===void 0?(i={index:r,startLine:u,endLine:u,lines:1},a.push(i),s[u]=i.index,r++):!f&&i?(i.endLine=u,i.lines++,s[u]=i.index):i=void 0}),{lineBlocks:s,blocks:a}}class Es{diff(t,n,r={}){let i;typeof r=="function"?(i=r,r={}):"callback"in r&&(i=r.callback);const s=this.castInput(t,r),a=this.castInput(n,r),c=this.removeEmpty(this.tokenize(s,r)),u=this.removeEmpty(this.tokenize(a,r));return this.diffWithOptionsObj(c,u,r,i)}diffWithOptionsObj(t,n,r,i){var s;const a=T=>{if(T=this.postProcess(T,r),i){setTimeout(function(){i(T)},0);return}else return T},c=n.length,u=t.length;let f=1,m=c+u;r.maxEditLength!=null&&(m=Math.min(m,r.maxEditLength));const p=(s=r.timeout)!==null&&s!==void 0?s:1/0,y=Date.now()+p,x=[{oldPos:-1,lastComponent:void 0}];let b=this.extractCommon(x[0],n,t,0,r);if(x[0].oldPos+1>=u&&b+1>=c)return a(this.buildValues(x[0].lastComponent,n,t));let S=-1/0,k=1/0;const E=()=>{for(let T=Math.max(S,-f);T<=Math.min(k,f);T+=2){let N;const j=x[T-1],O=x[T+1];j&&(x[T-1]=void 0);let A=!1;if(O){const L=O.oldPos-T;A=O&&0<=L&&L<c}const R=j&&j.oldPos+1<u;if(!A&&!R){x[T]=void 0;continue}if(!R||A&&j.oldPos<O.oldPos?N=this.addToPath(O,!0,!1,0,r):N=this.addToPath(j,!1,!0,1,r),b=this.extractCommon(N,n,t,T,r),N.oldPos+1>=u&&b+1>=c)return a(this.buildValues(N.lastComponent,n,t))||!0;x[T]=N,N.oldPos+1>=u&&(k=Math.min(k,T-1)),b+1>=c&&(S=Math.max(S,T+1))}f++};if(i)(function T(){setTimeout(function(){if(f>m||Date.now()>y)return i(void 0);E()||T()},0)})();else for(;f<=m&&Date.now()<=y;){const T=E();if(T)return T}}addToPath(t,n,r,i,s){const a=t.lastComponent;return a&&!s.oneChangePerToken&&a.added===n&&a.removed===r?{oldPos:t.oldPos+i,lastComponent:{count:a.count+1,added:n,removed:r,previousComponent:a.previousComponent}}:{oldPos:t.oldPos+i,lastComponent:{count:1,added:n,removed:r,previousComponent:a}}}extractCommon(t,n,r,i,s){const a=n.length,c=r.length;let u=t.oldPos,f=u-i,m=0;for(;f+1<a&&u+1<c&&this.equals(r[u+1],n[f+1],s);)f++,u++,m++,s.oneChangePerToken&&(t.lastComponent={count:1,previousComponent:t.lastComponent,added:!1,removed:!1});return m&&!s.oneChangePerToken&&(t.lastComponent={count:m,previousComponent:t.lastComponent,added:!1,removed:!1}),t.oldPos=u,f}equals(t,n,r){return r.comparator?r.comparator(t,n):t===n||!!r.ignoreCase&&t.toLowerCase()===n.toLowerCase()}removeEmpty(t){const n=[];for(let r=0;r<t.length;r++)t[r]&&n.push(t[r]);return n}castInput(t,n){return t}tokenize(t,n){return Array.from(t)}join(t){return t.join("")}postProcess(t,n){return t}get useLongestToken(){return!1}buildValues(t,n,r){const i=[];let s;for(;t;)i.push(t),s=t.previousComponent,delete t.previousComponent,t=s;i.reverse();const a=i.length;let c=0,u=0,f=0;for(;c<a;c++){const m=i[c];if(m.removed)m.value=this.join(r.slice(f,f+m.count)),f+=m.count;else{if(!m.added&&this.useLongestToken){let p=n.slice(u,u+m.count);p=p.map(function(y,x){const b=r[f+x];return b.length>y.length?b:y}),m.value=this.join(p)}else m.value=this.join(n.slice(u,u+m.count));u+=m.count,m.added||(f+=m.count)}}return i}}class kK extends Es{}const a8=new kK;function EK(e,t,n){return a8.diff(e,t,n)}function zE(e,t){let n;for(n=0;n<e.length&&n<t.length;n++)if(e[n]!=t[n])return e.slice(0,n);return e.slice(0,n)}function FE(e,t){let n;if(!e||!t||e[e.length-1]!=t[t.length-1])return"";for(n=0;n<e.length&&n<t.length;n++)if(e[e.length-(n+1)]!=t[t.length-(n+1)])return e.slice(-n);return e.slice(-n)}function gx(e,t,n){if(e.slice(0,t.length)!=t)throw Error(`string ${JSON.stringify(e)} doesn't start with prefix ${JSON.stringify(t)}; this is a bug`);return n+e.slice(t.length)}function yx(e,t,n){if(!t)return e+n;if(e.slice(-t.length)!=t)throw Error(`string ${JSON.stringify(e)} doesn't end with suffix ${JSON.stringify(t)}; this is a bug`);return e.slice(0,-t.length)+n}function hd(e,t){return gx(e,t,"")}function Mp(e,t){return yx(e,t,"")}function BE(e,t){return t.slice(0,TK(e,t))}function TK(e,t){let n=0;e.length>t.length&&(n=e.length-t.length);let r=t.length;e.length<t.length&&(r=e.length);const i=Array(r);let s=0;i[0]=0;for(let a=1;a<r;a++){for(t[a]==t[s]?i[a]=i[s]:i[a]=s;s>0&&t[a]!=t[s];)s=i[s];t[a]==t[s]&&s++}s=0;for(let a=n;a<e.length;a++){for(;s>0&&e[a]!=t[s];)s=i[s];e[a]==t[s]&&s++}return s}function NK(e){return e.includes(`\r
24
+ `)&&!e.startsWith(`
25
+ `)&&!e.match(/[^\r]\n/)}function RK(e){return!e.includes(`\r
26
+ `)&&e.includes(`
27
+ `)}function l8(e,t){const n=[];for(const r of Array.from(t.segment(e))){const i=r.segment;n.length&&/\s/.test(n[n.length-1])&&/\s/.test(i)?n[n.length-1]+=i:n.push(i)}return n}function xx(e,t){if(t)return Fd(e,t)[1];let n;for(n=e.length-1;n>=0&&e[n].match(/\s/);n--);return e.substring(n+1)}function bc(e,t){if(t)return Fd(e,t)[0];const n=e.match(/^\s*/);return n?n[0]:""}function Fd(e,t){if(!t)return[bc(e),xx(e)];if(t.resolvedOptions().granularity!="word")throw new Error('The segmenter passed must have a granularity of "word"');const n=l8(e,t),r=n[0],i=n[n.length-1],s=/\s/.test(r)?r:"",a=/\s/.test(i)?i:"";return[s,a]}const Lm="a-zA-Z0-9_\\u{AD}\\u{C0}-\\u{D6}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}",AK=new RegExp(`[${Lm}]+|\\s+|[^${Lm}]`,"ug");class OK extends Es{equals(t,n,r){return r.ignoreCase&&(t=t.toLowerCase(),n=n.toLowerCase()),t.trim()===n.trim()}tokenize(t,n={}){let r;if(n.intlSegmenter){const a=n.intlSegmenter;if(a.resolvedOptions().granularity!="word")throw new Error('The segmenter passed must have a granularity of "word"');r=l8(t,a)}else r=t.match(AK)||[];const i=[];let s=null;return r.forEach(a=>{/\s/.test(a)?s==null?i.push(a):i.push(i.pop()+a):s!=null&&/\s/.test(s)?i[i.length-1]==s?i.push(i.pop()+a):i.push(s+a):i.push(a),s=a}),i}join(t){return t.map((n,r)=>r==0?n:n.replace(/^\s+/,"")).join("")}postProcess(t,n){if(!t||n.oneChangePerToken)return t;let r=null,i=null,s=null;return t.forEach(a=>{a.added?i=a:a.removed?s=a:((i||s)&&HE(r,s,i,a,n.intlSegmenter),r=a,i=null,s=null)}),(i||s)&&HE(r,s,i,null,n.intlSegmenter),t}}const c8=new OK;function jK(e,t,n){return n?.ignoreWhitespace!=null&&!n.ignoreWhitespace?d8(e,t,n):c8.diff(e,t,n)}function HE(e,t,n,r,i){if(t&&n){const[s,a]=Fd(t.value,i),[c,u]=Fd(n.value,i);if(e){const f=zE(s,c);e.value=yx(e.value,c,f),t.value=hd(t.value,f),n.value=hd(n.value,f)}if(r){const f=FE(a,u);r.value=gx(r.value,u,f),t.value=Mp(t.value,f),n.value=Mp(n.value,f)}}else if(n){if(e){const s=bc(n.value,i);n.value=n.value.substring(s.length)}if(r){const s=bc(r.value,i);r.value=r.value.substring(s.length)}}else if(e&&r){const s=bc(r.value,i),[a,c]=Fd(t.value,i),u=zE(s,a);t.value=hd(t.value,u);const f=FE(hd(s,u),c);t.value=Mp(t.value,f),r.value=gx(r.value,s,f),e.value=yx(e.value,s,s.slice(0,s.length-f.length))}else if(r){const s=bc(r.value,i),a=xx(t.value,i),c=BE(a,s);t.value=Mp(t.value,c)}else if(e){const s=xx(e.value,i),a=bc(t.value,i),c=BE(s,a);t.value=hd(t.value,c)}}class MK extends Es{tokenize(t){const n=new RegExp(`(\\r?\\n)|[${Lm}]+|[^\\S\\n\\r]+|[^${Lm}]`,"ug");return t.match(n)||[]}}const u8=new MK;function d8(e,t,n){return u8.diff(e,t,n)}function DK(e,t){if(typeof e=="function")t.callback=e;else if(e)for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}class _K extends Es{constructor(){super(...arguments),this.tokenize=f8}equals(t,n,r){return r.ignoreWhitespace?((!r.newlineIsToken||!t.includes(`
28
+ `))&&(t=t.trim()),(!r.newlineIsToken||!n.includes(`
29
+ `))&&(n=n.trim())):r.ignoreNewlineAtEof&&!r.newlineIsToken&&(t.endsWith(`
30
+ `)&&(t=t.slice(0,-1)),n.endsWith(`
31
+ `)&&(n=n.slice(0,-1))),super.equals(t,n,r)}}const Pv=new _K;function xs(e,t,n){return Pv.diff(e,t,n)}function LK(e,t,n){return n=DK(n,{ignoreWhitespace:!0}),Pv.diff(e,t,n)}function f8(e,t){t.stripTrailingCr&&(e=e.replace(/\r\n/g,`
32
+ `));const n=[],r=e.split(/(\n|\r\n)/);r[r.length-1]||r.pop();for(let i=0;i<r.length;i++){const s=r[i];i%2&&!t.newlineIsToken?n[n.length-1]+=s:n.push(s)}return n}function IK(e){return e=="."||e=="!"||e=="?"}class PK extends Es{tokenize(t){var n;const r=[];let i=0;for(let s=0;s<t.length;s++){if(s==t.length-1){r.push(t.slice(i));break}if(IK(t[s])&&t[s+1].match(/\s/)){for(r.push(t.slice(i,s+1)),s=i=s+1;!((n=t[s+1])===null||n===void 0)&&n.match(/\s/);)s++;r.push(t.slice(i,s+1)),i=s+1}}return r}}const h8=new PK;function zK(e,t,n){return h8.diff(e,t,n)}class FK extends Es{tokenize(t){return t.split(/([{}:;,]|\s+)/)}}const p8=new FK;function BK(e,t,n){return p8.diff(e,t,n)}class HK extends Es{constructor(){super(...arguments),this.tokenize=f8}get useLongestToken(){return!0}castInput(t,n){const{undefinedReplacement:r,stringifyReplacer:i=(s,a)=>typeof a>"u"?r:a}=n;return typeof t=="string"?t:JSON.stringify(Im(t,null,null,i),null," ")}equals(t,n,r){return super.equals(t.replace(/,([\r\n])/g,"$1"),n.replace(/,([\r\n])/g,"$1"),r)}}const m8=new HK;function UK(e,t,n){return m8.diff(e,t,n)}function Im(e,t,n,r,i){t=t||[],n=n||[],r&&(e=r(i===void 0?"":i,e));let s;for(s=0;s<t.length;s+=1)if(t[s]===e)return n[s];let a;if(Object.prototype.toString.call(e)==="[object Array]"){for(t.push(e),a=new Array(e.length),n.push(a),s=0;s<e.length;s+=1)a[s]=Im(e[s],t,n,r,String(s));return t.pop(),n.pop(),a}if(e&&e.toJSON&&(e=e.toJSON()),typeof e=="object"&&e!==null){t.push(e),a={},n.push(a);const c=[];let u;for(u in e)Object.prototype.hasOwnProperty.call(e,u)&&c.push(u);for(c.sort(),s=0;s<c.length;s+=1)u=c[s],a[u]=Im(e[u],t,n,r,u);t.pop(),n.pop()}else a=e;return a}class VK extends Es{tokenize(t){return t.slice()}join(t){return t}removeEmpty(t){return t}}const g8=new VK;function qK(e,t,n){return g8.diff(e,t,n)}function y8(e){return Array.isArray(e)?e.map(t=>y8(t)):Object.assign(Object.assign({},e),{hunks:e.hunks.map(t=>Object.assign(Object.assign({},t),{lines:t.lines.map((n,r)=>{var i;return n.startsWith("\\")||n.endsWith("\r")||!((i=t.lines[r+1])===null||i===void 0)&&i.startsWith("\\")?n:n+"\r"})}))})}function x8(e){return Array.isArray(e)?e.map(t=>x8(t)):Object.assign(Object.assign({},e),{hunks:e.hunks.map(t=>Object.assign(Object.assign({},t),{lines:t.lines.map(n=>n.endsWith("\r")?n.substring(0,n.length-1):n)}))})}function $K(e){return Array.isArray(e)||(e=[e]),!e.some(t=>t.hunks.some(n=>n.lines.some(r=>!r.startsWith("\\")&&r.endsWith("\r"))))}function YK(e){return Array.isArray(e)||(e=[e]),e.some(t=>t.hunks.some(n=>n.lines.some(r=>r.endsWith("\r"))))&&e.every(t=>t.hunks.every(n=>n.lines.every((r,i)=>{var s;return r.startsWith("\\")||r.endsWith("\r")||((s=n.lines[i+1])===null||s===void 0?void 0:s.startsWith("\\"))})))}function zv(e){const t=e.split(/\n/),n=[];let r=0;function i(){const c={};for(n.push(c);r<t.length;){const u=t[r];if(/^(---|\+\+\+|@@)\s/.test(u))break;const f=/^(?:Index:|diff(?: -r \w+)+)\s+/.exec(u);f&&(c.index=u.substring(f[0].length).trim()),r++}for(s(c),s(c),c.hunks=[];r<t.length;){const u=t[r];if(/^(Index:\s|diff\s|---\s|\+\+\+\s|===================================================================)/.test(u))break;if(/^@@/.test(u))c.hunks.push(a());else{if(u)throw new Error("Unknown line "+(r+1)+" "+JSON.stringify(u));r++}}}function s(c){const u=/^(---|\+\+\+)\s+/.exec(t[r]);if(u){const f=u[1],m=t[r].substring(3).trim().split(" ",2),p=(m[1]||"").trim();let y=m[0].replace(/\\\\/g,"\\");y.startsWith('"')&&y.endsWith('"')&&(y=y.substr(1,y.length-2)),f==="---"?(c.oldFileName=y,c.oldHeader=p):(c.newFileName=y,c.newHeader=p),r++}}function a(){var c;const u=r,f=t[r++],m=f.split(/@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/),p={oldStart:+m[1],oldLines:typeof m[2]>"u"?1:+m[2],newStart:+m[3],newLines:typeof m[4]>"u"?1:+m[4],lines:[]};p.oldLines===0&&(p.oldStart+=1),p.newLines===0&&(p.newStart+=1);let y=0,x=0;for(;r<t.length&&(x<p.oldLines||y<p.newLines||!((c=t[r])===null||c===void 0)&&c.startsWith("\\"));r++){const b=t[r].length==0&&r!=t.length-1?" ":t[r][0];if(b==="+"||b==="-"||b===" "||b==="\\")p.lines.push(t[r]),b==="+"?y++:b==="-"?x++:b===" "&&(y++,x++);else throw new Error(`Hunk at line ${u+1} contained invalid line ${t[r]}`)}if(!y&&p.newLines===1&&(p.newLines=0),!x&&p.oldLines===1&&(p.oldLines=0),y!==p.newLines)throw new Error("Added line count did not match for hunk at line "+(u+1));if(x!==p.oldLines)throw new Error("Removed line count did not match for hunk at line "+(u+1));return p}for(;r<t.length;)i();return n}function WK(e,t,n){let r=!0,i=!1,s=!1,a=1;return function c(){if(r&&!s){if(i?a++:r=!1,e+a<=n)return e+a;s=!0}if(!i)return s||(r=!0),t<=e-a?e-a++:(i=!0,c())}}function b8(e,t,n={}){let r;if(typeof t=="string"?r=zv(t):Array.isArray(t)?r=t:r=[t],r.length>1)throw new Error("applyPatch only works with a single input.");return GK(e,r[0],n)}function GK(e,t,n={}){(n.autoConvertLineEndings||n.autoConvertLineEndings==null)&&(NK(e)&&$K(t)?t=y8(t):RK(e)&&YK(t)&&(t=x8(t)));const r=e.split(`
33
+ `),i=t.hunks,s=n.compareLine||((b,S,k,E)=>S===E),a=n.fuzzFactor||0;let c=0;if(a<0||!Number.isInteger(a))throw new Error("fuzzFactor must be a non-negative integer");if(!i.length)return e;let u="",f=!1,m=!1;for(let b=0;b<i[i.length-1].lines.length;b++){const S=i[i.length-1].lines[b];S[0]=="\\"&&(u[0]=="+"?f=!0:u[0]=="-"&&(m=!0)),u=S}if(f){if(m){if(!a&&r[r.length-1]=="")return!1}else if(r[r.length-1]=="")r.pop();else if(!a)return!1}else if(m){if(r[r.length-1]!="")r.push("");else if(!a)return!1}function p(b,S,k,E=0,T=!0,N=[],j=0){let O=0,A=!1;for(;E<b.length;E++){const R=b[E],L=R.length>0?R[0]:" ",B=R.length>0?R.substr(1):R;if(L==="-")if(s(S+1,r[S],L,B))S++,O=0;else return!k||r[S]==null?null:(N[j]=r[S],p(b,S+1,k-1,E,!1,N,j+1));if(L==="+"){if(!T)return null;N[j]=B,j++,O=0,A=!0}if(L===" ")if(O++,N[j]=r[S],s(S+1,r[S],L,B))j++,T=!0,A=!1,S++;else return A||!k?null:r[S]&&(p(b,S+1,k-1,E+1,!1,N,j+1)||p(b,S+1,k-1,E,!1,N,j+1))||p(b,S,k-1,E+1,!1,N,j)}return j-=O,S-=O,N.length=j,{patchedLines:N,oldLineLastI:S-1}}const y=[];let x=0;for(let b=0;b<i.length;b++){const S=i[b];let k;const E=r.length-S.oldLines+a;let T;for(let N=0;N<=a;N++){T=S.oldStart+x-1;const j=WK(T,c,E);for(;T!==void 0&&(k=p(S.lines,T,N),!k);T=j());if(k)break}if(!k)return!1;for(let N=c;N<T;N++)y.push(r[N]);for(let N=0;N<k.patchedLines.length;N++){const j=k.patchedLines[N];y.push(j)}c=k.oldLineLastI+1,x=T+1-S.oldStart}for(let b=c;b<r.length;b++)y.push(r[b]);return y.join(`
34
+ `)}function KK(e,t){const n=typeof e=="string"?zv(e):e;let r=0;function i(){const s=n[r++];if(!s)return t.complete();t.loadFile(s,function(a,c){if(a)return t.complete(a);const u=b8(c,s,t);t.patched(s,u,function(f){if(f)return t.complete(f);i()})})}i()}function v8(e){return Array.isArray(e)?e.map(t=>v8(t)).reverse():Object.assign(Object.assign({},e),{oldFileName:e.newFileName,oldHeader:e.newHeader,newFileName:e.oldFileName,newHeader:e.oldHeader,hunks:e.hunks.map(t=>({oldLines:t.newLines,oldStart:t.newStart,newLines:t.oldLines,newStart:t.oldStart,lines:t.lines.map(n=>n.startsWith("-")?`+${n.slice(1)}`:n.startsWith("+")?`-${n.slice(1)}`:n)}))})}const w8={includeIndex:!0,includeUnderline:!0,includeFileHeaders:!0},QK={includeIndex:!1,includeUnderline:!1,includeFileHeaders:!0},XK={includeIndex:!1,includeUnderline:!1,includeFileHeaders:!1};function bx(e,t,n,r,i,s,a){let c;a?typeof a=="function"?c={callback:a}:c=a:c={},typeof c.context>"u"&&(c.context=4);const u=c.context;if(c.newlineIsToken)throw new Error("newlineIsToken may not be used with patch-generation functions, only with diffing functions");if(c.callback){const{callback:m}=c;xs(n,r,Object.assign(Object.assign({},c),{callback:p=>{const y=f(p);m(y)}}))}else return f(xs(n,r,c));function f(m){if(!m)return;m.push({value:"",lines:[]});function p(T){return T.map(function(N){return" "+N})}const y=[];let x=0,b=0,S=[],k=1,E=1;for(let T=0;T<m.length;T++){const N=m[T],j=N.lines||JK(N.value);if(N.lines=j,N.added||N.removed){if(!x){const O=m[T-1];x=k,b=E,O&&(S=u>0?p(O.lines.slice(-u)):[],x-=S.length,b-=S.length)}for(const O of j)S.push((N.added?"+":"-")+O);N.added?E+=j.length:k+=j.length}else{if(x)if(j.length<=u*2&&T<m.length-2)for(const O of p(j))S.push(O);else{const O=Math.min(j.length,u);for(const R of p(j.slice(0,O)))S.push(R);const A={oldStart:x,oldLines:k-x+O,newStart:b,newLines:E-b+O,lines:S};y.push(A),x=0,b=0,S=[]}k+=j.length,E+=j.length}}for(const T of y)for(let N=0;N<T.lines.length;N++)T.lines[N].endsWith(`
35
+ `)?T.lines[N]=T.lines[N].slice(0,-1):(T.lines.splice(N+1,0,"\"),N++);return{oldFileName:e,newFileName:t,oldHeader:i,newHeader:s,hunks:y}}}function Pm(e,t){if(t||(t=w8),Array.isArray(e)){if(e.length>1&&!t.includeFileHeaders)throw new Error("Cannot omit file headers on a multi-file patch. (The result would be unparseable; how would a tool trying to apply the patch know which changes are to which file?)");return e.map(r=>Pm(r,t)).join(`
36
+ `)}const n=[];t.includeIndex&&e.oldFileName==e.newFileName&&n.push("Index: "+e.oldFileName),t.includeUnderline&&n.push("==================================================================="),t.includeFileHeaders&&(n.push("--- "+e.oldFileName+(typeof e.oldHeader>"u"?"":" "+e.oldHeader)),n.push("+++ "+e.newFileName+(typeof e.newHeader>"u"?"":" "+e.newHeader)));for(let r=0;r<e.hunks.length;r++){const i=e.hunks[r];i.oldLines===0&&(i.oldStart-=1),i.newLines===0&&(i.newStart-=1),n.push("@@ -"+i.oldStart+","+i.oldLines+" +"+i.newStart+","+i.newLines+" @@");for(const s of i.lines)n.push(s)}return n.join(`
37
+ `)+`
38
+ `}function S8(e,t,n,r,i,s,a){if(typeof a=="function"&&(a={callback:a}),a?.callback){const{callback:c}=a;bx(e,t,n,r,i,s,Object.assign(Object.assign({},a),{callback:u=>{c(u?Pm(u,a.headerOptions):void 0)}}))}else{const c=bx(e,t,n,r,i,s,a);return c?Pm(c,a?.headerOptions):void 0}}function ZK(e,t,n,r,i,s){return S8(e,e,t,n,r,i,s)}function JK(e){const t=e.endsWith(`
39
+ `),n=e.split(`
40
+ `).map(r=>r+`
41
+ `);return t?n.pop():n.push(n.pop().slice(0,-1)),n}function eQ(e){const t=[];let n,r;for(let i=0;i<e.length;i++)n=e[i],n.added?r=1:n.removed?r=-1:r=0,t.push([r,n.value]);return t}function tQ(e){const t=[];for(let n=0;n<e.length;n++){const r=e[n];r.added?t.push("<ins>"):r.removed&&t.push("<del>"),t.push(nQ(r.value)),r.added?t.push("</ins>"):r.removed&&t.push("</del>")}return t.join("")}function nQ(e){let t=e;return t=t.replace(/&/g,"&amp;"),t=t.replace(/</g,"&lt;"),t=t.replace(/>/g,"&gt;"),t=t.replace(/"/g,"&quot;"),t}const rQ=Object.freeze(Object.defineProperty({__proto__:null,Diff:Es,FILE_HEADERS_ONLY:QK,INCLUDE_HEADERS:w8,OMIT_HEADERS:XK,applyPatch:b8,applyPatches:KK,arrayDiff:g8,canonicalize:Im,characterDiff:a8,convertChangesToDMP:eQ,convertChangesToXML:tQ,createPatch:ZK,createTwoFilesPatch:S8,cssDiff:p8,diffArrays:qK,diffChars:EK,diffCss:BK,diffJson:UK,diffLines:xs,diffSentences:zK,diffTrimmedLines:LK,diffWords:jK,diffWordsWithSpace:d8,formatPatch:Pm,jsonDiff:m8,lineDiff:Pv,parsePatch:zv,reversePatch:v8,sentenceDiff:h8,structuredPatch:bx,wordDiff:c8,wordsWithSpaceDiff:u8},Symbol.toStringTag,{value:"Module"}));function C8(e){return typeof e>"u"||e===null}function iQ(e){return typeof e=="object"&&e!==null}function oQ(e){return Array.isArray(e)?e:C8(e)?[]:[e]}function sQ(e,t){var n,r,i,s;if(t)for(s=Object.keys(t),n=0,r=s.length;n<r;n+=1)i=s[n],e[i]=t[i];return e}function aQ(e,t){var n="",r;for(r=0;r<t;r+=1)n+=e;return n}function lQ(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var cQ=C8,uQ=iQ,dQ=oQ,fQ=aQ,hQ=lQ,pQ=sQ,cr={isNothing:cQ,isObject:uQ,toArray:dQ,repeat:fQ,isNegativeZero:hQ,extend:pQ};function k8(e,t){var n="",r=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(n+='in "'+e.mark.name+'" '),n+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!t&&e.mark.snippet&&(n+=`
42
+
43
+ `+e.mark.snippet),r+" "+n):r}function of(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=k8(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}of.prototype=Object.create(Error.prototype);of.prototype.constructor=of;of.prototype.toString=function(t){return this.name+": "+k8(this,t)};var Xr=of;function V2(e,t,n,r,i){var s="",a="",c=Math.floor(i/2)-1;return r-t>c&&(s=" ... ",t=r-c+s.length),n-r>c&&(a=" ...",n=r+c-a.length),{str:s+e.slice(t,n).replace(/\t/g,"→")+a,pos:r-t+s.length}}function q2(e,t){return cr.repeat(" ",t-e.length)+e}function mQ(e,t){if(t=Object.create(t||null),!e.buffer)return null;t.maxLength||(t.maxLength=79),typeof t.indent!="number"&&(t.indent=1),typeof t.linesBefore!="number"&&(t.linesBefore=3),typeof t.linesAfter!="number"&&(t.linesAfter=2);for(var n=/\r?\n|\r|\0/g,r=[0],i=[],s,a=-1;s=n.exec(e.buffer);)i.push(s.index),r.push(s.index+s[0].length),e.position<=s.index&&a<0&&(a=r.length-2);a<0&&(a=r.length-1);var c="",u,f,m=Math.min(e.line+t.linesAfter,i.length).toString().length,p=t.maxLength-(t.indent+m+3);for(u=1;u<=t.linesBefore&&!(a-u<0);u++)f=V2(e.buffer,r[a-u],i[a-u],e.position-(r[a]-r[a-u]),p),c=cr.repeat(" ",t.indent)+q2((e.line-u+1).toString(),m)+" | "+f.str+`
44
+ `+c;for(f=V2(e.buffer,r[a],i[a],e.position,p),c+=cr.repeat(" ",t.indent)+q2((e.line+1).toString(),m)+" | "+f.str+`
45
+ `,c+=cr.repeat("-",t.indent+m+3+f.pos)+`^
46
+ `,u=1;u<=t.linesAfter&&!(a+u>=i.length);u++)f=V2(e.buffer,r[a+u],i[a+u],e.position-(r[a]-r[a+u]),p),c+=cr.repeat(" ",t.indent)+q2((e.line+u+1).toString(),m)+" | "+f.str+`
47
+ `;return c.replace(/\n$/,"")}var gQ=mQ,yQ=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],xQ=["scalar","sequence","mapping"];function bQ(e){var t={};return e!==null&&Object.keys(e).forEach(function(n){e[n].forEach(function(r){t[String(r)]=n})}),t}function vQ(e,t){if(t=t||{},Object.keys(t).forEach(function(n){if(yQ.indexOf(n)===-1)throw new Xr('Unknown option "'+n+'" is met in definition of "'+e+'" YAML type.')}),this.options=t,this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(n){return n},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.representName=t.representName||null,this.defaultStyle=t.defaultStyle||null,this.multi=t.multi||!1,this.styleAliases=bQ(t.styleAliases||null),xQ.indexOf(this.kind)===-1)throw new Xr('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}var jr=vQ;function UE(e,t){var n=[];return e[t].forEach(function(r){var i=n.length;n.forEach(function(s,a){s.tag===r.tag&&s.kind===r.kind&&s.multi===r.multi&&(i=a)}),n[i]=r}),n}function wQ(){var e={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},t,n;function r(i){i.multi?(e.multi[i.kind].push(i),e.multi.fallback.push(i)):e[i.kind][i.tag]=e.fallback[i.tag]=i}for(t=0,n=arguments.length;t<n;t+=1)arguments[t].forEach(r);return e}function vx(e){return this.extend(e)}vx.prototype.extend=function(t){var n=[],r=[];if(t instanceof jr)r.push(t);else if(Array.isArray(t))r=r.concat(t);else if(t&&(Array.isArray(t.implicit)||Array.isArray(t.explicit)))t.implicit&&(n=n.concat(t.implicit)),t.explicit&&(r=r.concat(t.explicit));else throw new Xr("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");n.forEach(function(s){if(!(s instanceof jr))throw new Xr("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(s.loadKind&&s.loadKind!=="scalar")throw new Xr("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(s.multi)throw new Xr("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),r.forEach(function(s){if(!(s instanceof jr))throw new Xr("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var i=Object.create(vx.prototype);return i.implicit=(this.implicit||[]).concat(n),i.explicit=(this.explicit||[]).concat(r),i.compiledImplicit=UE(i,"implicit"),i.compiledExplicit=UE(i,"explicit"),i.compiledTypeMap=wQ(i.compiledImplicit,i.compiledExplicit),i};var SQ=vx,CQ=new jr("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return e!==null?e:""}}),kQ=new jr("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return e!==null?e:[]}}),EQ=new jr("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return e!==null?e:{}}}),TQ=new SQ({explicit:[CQ,kQ,EQ]});function NQ(e){if(e===null)return!0;var t=e.length;return t===1&&e==="~"||t===4&&(e==="null"||e==="Null"||e==="NULL")}function RQ(){return null}function AQ(e){return e===null}var OQ=new jr("tag:yaml.org,2002:null",{kind:"scalar",resolve:NQ,construct:RQ,predicate:AQ,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});function jQ(e){if(e===null)return!1;var t=e.length;return t===4&&(e==="true"||e==="True"||e==="TRUE")||t===5&&(e==="false"||e==="False"||e==="FALSE")}function MQ(e){return e==="true"||e==="True"||e==="TRUE"}function DQ(e){return Object.prototype.toString.call(e)==="[object Boolean]"}var _Q=new jr("tag:yaml.org,2002:bool",{kind:"scalar",resolve:jQ,construct:MQ,predicate:DQ,represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"});function LQ(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function IQ(e){return 48<=e&&e<=55}function PQ(e){return 48<=e&&e<=57}function zQ(e){if(e===null)return!1;var t=e.length,n=0,r=!1,i;if(!t)return!1;if(i=e[n],(i==="-"||i==="+")&&(i=e[++n]),i==="0"){if(n+1===t)return!0;if(i=e[++n],i==="b"){for(n++;n<t;n++)if(i=e[n],i!=="_"){if(i!=="0"&&i!=="1")return!1;r=!0}return r&&i!=="_"}if(i==="x"){for(n++;n<t;n++)if(i=e[n],i!=="_"){if(!LQ(e.charCodeAt(n)))return!1;r=!0}return r&&i!=="_"}if(i==="o"){for(n++;n<t;n++)if(i=e[n],i!=="_"){if(!IQ(e.charCodeAt(n)))return!1;r=!0}return r&&i!=="_"}}if(i==="_")return!1;for(;n<t;n++)if(i=e[n],i!=="_"){if(!PQ(e.charCodeAt(n)))return!1;r=!0}return!(!r||i==="_")}function FQ(e){var t=e,n=1,r;if(t.indexOf("_")!==-1&&(t=t.replace(/_/g,"")),r=t[0],(r==="-"||r==="+")&&(r==="-"&&(n=-1),t=t.slice(1),r=t[0]),t==="0")return 0;if(r==="0"){if(t[1]==="b")return n*parseInt(t.slice(2),2);if(t[1]==="x")return n*parseInt(t.slice(2),16);if(t[1]==="o")return n*parseInt(t.slice(2),8)}return n*parseInt(t,10)}function BQ(e){return Object.prototype.toString.call(e)==="[object Number]"&&e%1===0&&!cr.isNegativeZero(e)}var HQ=new jr("tag:yaml.org,2002:int",{kind:"scalar",resolve:zQ,construct:FQ,predicate:BQ,represent:{binary:function(e){return e>=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},octal:function(e){return e>=0?"0o"+e.toString(8):"-0o"+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),UQ=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function VQ(e){return!(e===null||!UQ.test(e)||e[e.length-1]==="_")}function qQ(e){var t,n;return t=e.replace(/_/g,"").toLowerCase(),n=t[0]==="-"?-1:1,"+-".indexOf(t[0])>=0&&(t=t.slice(1)),t===".inf"?n===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:t===".nan"?NaN:n*parseFloat(t,10)}var $Q=/^[-+]?[0-9]+e/;function YQ(e,t){var n;if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(cr.isNegativeZero(e))return"-0.0";return n=e.toString(10),$Q.test(n)?n.replace("e",".e"):n}function WQ(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||cr.isNegativeZero(e))}var GQ=new jr("tag:yaml.org,2002:float",{kind:"scalar",resolve:VQ,construct:qQ,predicate:WQ,represent:YQ,defaultStyle:"lowercase"}),KQ=TQ.extend({implicit:[OQ,_Q,HQ,GQ]}),QQ=KQ,E8=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),T8=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function XQ(e){return e===null?!1:E8.exec(e)!==null||T8.exec(e)!==null}function ZQ(e){var t,n,r,i,s,a,c,u=0,f=null,m,p,y;if(t=E8.exec(e),t===null&&(t=T8.exec(e)),t===null)throw new Error("Date resolve error");if(n=+t[1],r=+t[2]-1,i=+t[3],!t[4])return new Date(Date.UTC(n,r,i));if(s=+t[4],a=+t[5],c=+t[6],t[7]){for(u=t[7].slice(0,3);u.length<3;)u+="0";u=+u}return t[9]&&(m=+t[10],p=+(t[11]||0),f=(m*60+p)*6e4,t[9]==="-"&&(f=-f)),y=new Date(Date.UTC(n,r,i,s,a,c,u)),f&&y.setTime(y.getTime()-f),y}function JQ(e){return e.toISOString()}var eX=new jr("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:XQ,construct:ZQ,instanceOf:Date,represent:JQ});function tX(e){return e==="<<"||e===null}var nX=new jr("tag:yaml.org,2002:merge",{kind:"scalar",resolve:tX}),Fv=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
48
+ \r`;function rX(e){if(e===null)return!1;var t,n,r=0,i=e.length,s=Fv;for(n=0;n<i;n++)if(t=s.indexOf(e.charAt(n)),!(t>64)){if(t<0)return!1;r+=6}return r%8===0}function iX(e){var t,n,r=e.replace(/[\r\n=]/g,""),i=r.length,s=Fv,a=0,c=[];for(t=0;t<i;t++)t%4===0&&t&&(c.push(a>>16&255),c.push(a>>8&255),c.push(a&255)),a=a<<6|s.indexOf(r.charAt(t));return n=i%4*6,n===0?(c.push(a>>16&255),c.push(a>>8&255),c.push(a&255)):n===18?(c.push(a>>10&255),c.push(a>>2&255)):n===12&&c.push(a>>4&255),new Uint8Array(c)}function oX(e){var t="",n=0,r,i,s=e.length,a=Fv;for(r=0;r<s;r++)r%3===0&&r&&(t+=a[n>>18&63],t+=a[n>>12&63],t+=a[n>>6&63],t+=a[n&63]),n=(n<<8)+e[r];return i=s%3,i===0?(t+=a[n>>18&63],t+=a[n>>12&63],t+=a[n>>6&63],t+=a[n&63]):i===2?(t+=a[n>>10&63],t+=a[n>>4&63],t+=a[n<<2&63],t+=a[64]):i===1&&(t+=a[n>>2&63],t+=a[n<<4&63],t+=a[64],t+=a[64]),t}function sX(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}var aX=new jr("tag:yaml.org,2002:binary",{kind:"scalar",resolve:rX,construct:iX,predicate:sX,represent:oX}),lX=Object.prototype.hasOwnProperty,cX=Object.prototype.toString;function uX(e){if(e===null)return!0;var t=[],n,r,i,s,a,c=e;for(n=0,r=c.length;n<r;n+=1){if(i=c[n],a=!1,cX.call(i)!=="[object Object]")return!1;for(s in i)if(lX.call(i,s))if(!a)a=!0;else return!1;if(!a)return!1;if(t.indexOf(s)===-1)t.push(s);else return!1}return!0}function dX(e){return e!==null?e:[]}var fX=new jr("tag:yaml.org,2002:omap",{kind:"sequence",resolve:uX,construct:dX}),hX=Object.prototype.toString;function pX(e){if(e===null)return!0;var t,n,r,i,s,a=e;for(s=new Array(a.length),t=0,n=a.length;t<n;t+=1){if(r=a[t],hX.call(r)!=="[object Object]"||(i=Object.keys(r),i.length!==1))return!1;s[t]=[i[0],r[i[0]]]}return!0}function mX(e){if(e===null)return[];var t,n,r,i,s,a=e;for(s=new Array(a.length),t=0,n=a.length;t<n;t+=1)r=a[t],i=Object.keys(r),s[t]=[i[0],r[i[0]]];return s}var gX=new jr("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:pX,construct:mX}),yX=Object.prototype.hasOwnProperty;function xX(e){if(e===null)return!0;var t,n=e;for(t in n)if(yX.call(n,t)&&n[t]!==null)return!1;return!0}function bX(e){return e!==null?e:{}}var vX=new jr("tag:yaml.org,2002:set",{kind:"mapping",resolve:xX,construct:bX}),N8=QQ.extend({implicit:[eX,nX],explicit:[aX,fX,gX,vX]}),ga=Object.prototype.hasOwnProperty,zm=1,R8=2,A8=3,Fm=4,$2=1,wX=2,VE=3,SX=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,CX=/[\x85\u2028\u2029]/,kX=/[,\[\]\{\}]/,O8=/^(?:!|!!|![a-z\-]+!)$/i,j8=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function qE(e){return Object.prototype.toString.call(e)}function No(e){return e===10||e===13}function dl(e){return e===9||e===32}function Zr(e){return e===9||e===32||e===10||e===13}function kc(e){return e===44||e===91||e===93||e===123||e===125}function EX(e){var t;return 48<=e&&e<=57?e-48:(t=e|32,97<=t&&t<=102?t-97+10:-1)}function TX(e){return e===120?2:e===117?4:e===85?8:0}function NX(e){return 48<=e&&e<=57?e-48:-1}function $E(e){return e===48?"\0":e===97?"\x07":e===98?"\b":e===116||e===9?" ":e===110?`
49
+ `:e===118?"\v":e===102?"\f":e===114?"\r":e===101?"\x1B":e===32?" ":e===34?'"':e===47?"/":e===92?"\\":e===78?"…":e===95?" ":e===76?"\u2028":e===80?"\u2029":""}function RX(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}function M8(e,t,n){t==="__proto__"?Object.defineProperty(e,t,{configurable:!0,enumerable:!0,writable:!0,value:n}):e[t]=n}var D8=new Array(256),_8=new Array(256);for(var fc=0;fc<256;fc++)D8[fc]=$E(fc)?1:0,_8[fc]=$E(fc);function AX(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||N8,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.json=t.json||!1,this.listener=t.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function L8(e,t){var n={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return n.snippet=gQ(n),new Xr(t,n)}function pt(e,t){throw L8(e,t)}function Bm(e,t){e.onWarning&&e.onWarning.call(null,L8(e,t))}var YE={YAML:function(t,n,r){var i,s,a;t.version!==null&&pt(t,"duplication of %YAML directive"),r.length!==1&&pt(t,"YAML directive accepts exactly one argument"),i=/^([0-9]+)\.([0-9]+)$/.exec(r[0]),i===null&&pt(t,"ill-formed argument of the YAML directive"),s=parseInt(i[1],10),a=parseInt(i[2],10),s!==1&&pt(t,"unacceptable YAML version of the document"),t.version=r[0],t.checkLineBreaks=a<2,a!==1&&a!==2&&Bm(t,"unsupported YAML version of the document")},TAG:function(t,n,r){var i,s;r.length!==2&&pt(t,"TAG directive accepts exactly two arguments"),i=r[0],s=r[1],O8.test(i)||pt(t,"ill-formed tag handle (first argument) of the TAG directive"),ga.call(t.tagMap,i)&&pt(t,'there is a previously declared suffix for "'+i+'" tag handle'),j8.test(s)||pt(t,"ill-formed tag prefix (second argument) of the TAG directive");try{s=decodeURIComponent(s)}catch{pt(t,"tag prefix is malformed: "+s)}t.tagMap[i]=s}};function ma(e,t,n,r){var i,s,a,c;if(t<n){if(c=e.input.slice(t,n),r)for(i=0,s=c.length;i<s;i+=1)a=c.charCodeAt(i),a===9||32<=a&&a<=1114111||pt(e,"expected valid JSON character");else SX.test(c)&&pt(e,"the stream contains non-printable characters");e.result+=c}}function WE(e,t,n,r){var i,s,a,c;for(cr.isObject(n)||pt(e,"cannot merge mappings; the provided source object is unacceptable"),i=Object.keys(n),a=0,c=i.length;a<c;a+=1)s=i[a],ga.call(t,s)||(M8(t,s,n[s]),r[s]=!0)}function Ec(e,t,n,r,i,s,a,c,u){var f,m;if(Array.isArray(i))for(i=Array.prototype.slice.call(i),f=0,m=i.length;f<m;f+=1)Array.isArray(i[f])&&pt(e,"nested arrays are not supported inside keys"),typeof i=="object"&&qE(i[f])==="[object Object]"&&(i[f]="[object Object]");if(typeof i=="object"&&qE(i)==="[object Object]"&&(i="[object Object]"),i=String(i),t===null&&(t={}),r==="tag:yaml.org,2002:merge")if(Array.isArray(s))for(f=0,m=s.length;f<m;f+=1)WE(e,t,s[f],n);else WE(e,t,s,n);else!e.json&&!ga.call(n,i)&&ga.call(t,i)&&(e.line=a||e.line,e.lineStart=c||e.lineStart,e.position=u||e.position,pt(e,"duplicated mapping key")),M8(t,i,s),delete n[i];return t}function Bv(e){var t;t=e.input.charCodeAt(e.position),t===10?e.position++:t===13?(e.position++,e.input.charCodeAt(e.position)===10&&e.position++):pt(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}function nr(e,t,n){for(var r=0,i=e.input.charCodeAt(e.position);i!==0;){for(;dl(i);)i===9&&e.firstTabInLine===-1&&(e.firstTabInLine=e.position),i=e.input.charCodeAt(++e.position);if(t&&i===35)do i=e.input.charCodeAt(++e.position);while(i!==10&&i!==13&&i!==0);if(No(i))for(Bv(e),i=e.input.charCodeAt(e.position),r++,e.lineIndent=0;i===32;)e.lineIndent++,i=e.input.charCodeAt(++e.position);else break}return n!==-1&&r!==0&&e.lineIndent<n&&Bm(e,"deficient indentation"),r}function L0(e){var t=e.position,n;return n=e.input.charCodeAt(t),!!((n===45||n===46)&&n===e.input.charCodeAt(t+1)&&n===e.input.charCodeAt(t+2)&&(t+=3,n=e.input.charCodeAt(t),n===0||Zr(n)))}function Hv(e,t){t===1?e.result+=" ":t>1&&(e.result+=cr.repeat(`
50
+ `,t-1))}function OX(e,t,n){var r,i,s,a,c,u,f,m,p=e.kind,y=e.result,x;if(x=e.input.charCodeAt(e.position),Zr(x)||kc(x)||x===35||x===38||x===42||x===33||x===124||x===62||x===39||x===34||x===37||x===64||x===96||(x===63||x===45)&&(i=e.input.charCodeAt(e.position+1),Zr(i)||n&&kc(i)))return!1;for(e.kind="scalar",e.result="",s=a=e.position,c=!1;x!==0;){if(x===58){if(i=e.input.charCodeAt(e.position+1),Zr(i)||n&&kc(i))break}else if(x===35){if(r=e.input.charCodeAt(e.position-1),Zr(r))break}else{if(e.position===e.lineStart&&L0(e)||n&&kc(x))break;if(No(x))if(u=e.line,f=e.lineStart,m=e.lineIndent,nr(e,!1,-1),e.lineIndent>=t){c=!0,x=e.input.charCodeAt(e.position);continue}else{e.position=a,e.line=u,e.lineStart=f,e.lineIndent=m;break}}c&&(ma(e,s,a,!1),Hv(e,e.line-u),s=a=e.position,c=!1),dl(x)||(a=e.position+1),x=e.input.charCodeAt(++e.position)}return ma(e,s,a,!1),e.result?!0:(e.kind=p,e.result=y,!1)}function jX(e,t){var n,r,i;if(n=e.input.charCodeAt(e.position),n!==39)return!1;for(e.kind="scalar",e.result="",e.position++,r=i=e.position;(n=e.input.charCodeAt(e.position))!==0;)if(n===39)if(ma(e,r,e.position,!0),n=e.input.charCodeAt(++e.position),n===39)r=e.position,e.position++,i=e.position;else return!0;else No(n)?(ma(e,r,i,!0),Hv(e,nr(e,!1,t)),r=i=e.position):e.position===e.lineStart&&L0(e)?pt(e,"unexpected end of the document within a single quoted scalar"):(e.position++,i=e.position);pt(e,"unexpected end of the stream within a single quoted scalar")}function MX(e,t){var n,r,i,s,a,c;if(c=e.input.charCodeAt(e.position),c!==34)return!1;for(e.kind="scalar",e.result="",e.position++,n=r=e.position;(c=e.input.charCodeAt(e.position))!==0;){if(c===34)return ma(e,n,e.position,!0),e.position++,!0;if(c===92){if(ma(e,n,e.position,!0),c=e.input.charCodeAt(++e.position),No(c))nr(e,!1,t);else if(c<256&&D8[c])e.result+=_8[c],e.position++;else if((a=TX(c))>0){for(i=a,s=0;i>0;i--)c=e.input.charCodeAt(++e.position),(a=EX(c))>=0?s=(s<<4)+a:pt(e,"expected hexadecimal character");e.result+=RX(s),e.position++}else pt(e,"unknown escape sequence");n=r=e.position}else No(c)?(ma(e,n,r,!0),Hv(e,nr(e,!1,t)),n=r=e.position):e.position===e.lineStart&&L0(e)?pt(e,"unexpected end of the document within a double quoted scalar"):(e.position++,r=e.position)}pt(e,"unexpected end of the stream within a double quoted scalar")}function DX(e,t){var n=!0,r,i,s,a=e.tag,c,u=e.anchor,f,m,p,y,x,b=Object.create(null),S,k,E,T;if(T=e.input.charCodeAt(e.position),T===91)m=93,x=!1,c=[];else if(T===123)m=125,x=!0,c={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=c),T=e.input.charCodeAt(++e.position);T!==0;){if(nr(e,!0,t),T=e.input.charCodeAt(e.position),T===m)return e.position++,e.tag=a,e.anchor=u,e.kind=x?"mapping":"sequence",e.result=c,!0;n?T===44&&pt(e,"expected the node content, but found ','"):pt(e,"missed comma between flow collection entries"),k=S=E=null,p=y=!1,T===63&&(f=e.input.charCodeAt(e.position+1),Zr(f)&&(p=y=!0,e.position++,nr(e,!0,t))),r=e.line,i=e.lineStart,s=e.position,Yc(e,t,zm,!1,!0),k=e.tag,S=e.result,nr(e,!0,t),T=e.input.charCodeAt(e.position),(y||e.line===r)&&T===58&&(p=!0,T=e.input.charCodeAt(++e.position),nr(e,!0,t),Yc(e,t,zm,!1,!0),E=e.result),x?Ec(e,c,b,k,S,E,r,i,s):p?c.push(Ec(e,null,b,k,S,E,r,i,s)):c.push(S),nr(e,!0,t),T=e.input.charCodeAt(e.position),T===44?(n=!0,T=e.input.charCodeAt(++e.position)):n=!1}pt(e,"unexpected end of the stream within a flow collection")}function _X(e,t){var n,r,i=$2,s=!1,a=!1,c=t,u=0,f=!1,m,p;if(p=e.input.charCodeAt(e.position),p===124)r=!1;else if(p===62)r=!0;else return!1;for(e.kind="scalar",e.result="";p!==0;)if(p=e.input.charCodeAt(++e.position),p===43||p===45)$2===i?i=p===43?VE:wX:pt(e,"repeat of a chomping mode identifier");else if((m=NX(p))>=0)m===0?pt(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):a?pt(e,"repeat of an indentation width identifier"):(c=t+m-1,a=!0);else break;if(dl(p)){do p=e.input.charCodeAt(++e.position);while(dl(p));if(p===35)do p=e.input.charCodeAt(++e.position);while(!No(p)&&p!==0)}for(;p!==0;){for(Bv(e),e.lineIndent=0,p=e.input.charCodeAt(e.position);(!a||e.lineIndent<c)&&p===32;)e.lineIndent++,p=e.input.charCodeAt(++e.position);if(!a&&e.lineIndent>c&&(c=e.lineIndent),No(p)){u++;continue}if(e.lineIndent<c){i===VE?e.result+=cr.repeat(`
51
+ `,s?1+u:u):i===$2&&s&&(e.result+=`
52
+ `);break}for(r?dl(p)?(f=!0,e.result+=cr.repeat(`
53
+ `,s?1+u:u)):f?(f=!1,e.result+=cr.repeat(`
54
+ `,u+1)):u===0?s&&(e.result+=" "):e.result+=cr.repeat(`
55
+ `,u):e.result+=cr.repeat(`
56
+ `,s?1+u:u),s=!0,a=!0,u=0,n=e.position;!No(p)&&p!==0;)p=e.input.charCodeAt(++e.position);ma(e,n,e.position,!1)}return!0}function GE(e,t){var n,r=e.tag,i=e.anchor,s=[],a,c=!1,u;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=s),u=e.input.charCodeAt(e.position);u!==0&&(e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,pt(e,"tab characters must not be used in indentation")),!(u!==45||(a=e.input.charCodeAt(e.position+1),!Zr(a))));){if(c=!0,e.position++,nr(e,!0,-1)&&e.lineIndent<=t){s.push(null),u=e.input.charCodeAt(e.position);continue}if(n=e.line,Yc(e,t,A8,!1,!0),s.push(e.result),nr(e,!0,-1),u=e.input.charCodeAt(e.position),(e.line===n||e.lineIndent>t)&&u!==0)pt(e,"bad indentation of a sequence entry");else if(e.lineIndent<t)break}return c?(e.tag=r,e.anchor=i,e.kind="sequence",e.result=s,!0):!1}function LX(e,t,n){var r,i,s,a,c,u,f=e.tag,m=e.anchor,p={},y=Object.create(null),x=null,b=null,S=null,k=!1,E=!1,T;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=p),T=e.input.charCodeAt(e.position);T!==0;){if(!k&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,pt(e,"tab characters must not be used in indentation")),r=e.input.charCodeAt(e.position+1),s=e.line,(T===63||T===58)&&Zr(r))T===63?(k&&(Ec(e,p,y,x,b,null,a,c,u),x=b=S=null),E=!0,k=!0,i=!0):k?(k=!1,i=!0):pt(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,T=r;else{if(a=e.line,c=e.lineStart,u=e.position,!Yc(e,n,R8,!1,!0))break;if(e.line===s){for(T=e.input.charCodeAt(e.position);dl(T);)T=e.input.charCodeAt(++e.position);if(T===58)T=e.input.charCodeAt(++e.position),Zr(T)||pt(e,"a whitespace character is expected after the key-value separator within a block mapping"),k&&(Ec(e,p,y,x,b,null,a,c,u),x=b=S=null),E=!0,k=!1,i=!1,x=e.tag,b=e.result;else if(E)pt(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=f,e.anchor=m,!0}else if(E)pt(e,"can not read a block mapping entry; a multiline key may not be an implicit key");else return e.tag=f,e.anchor=m,!0}if((e.line===s||e.lineIndent>t)&&(k&&(a=e.line,c=e.lineStart,u=e.position),Yc(e,t,Fm,!0,i)&&(k?b=e.result:S=e.result),k||(Ec(e,p,y,x,b,S,a,c,u),x=b=S=null),nr(e,!0,-1),T=e.input.charCodeAt(e.position)),(e.line===s||e.lineIndent>t)&&T!==0)pt(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return k&&Ec(e,p,y,x,b,null,a,c,u),E&&(e.tag=f,e.anchor=m,e.kind="mapping",e.result=p),E}function IX(e){var t,n=!1,r=!1,i,s,a;if(a=e.input.charCodeAt(e.position),a!==33)return!1;if(e.tag!==null&&pt(e,"duplication of a tag property"),a=e.input.charCodeAt(++e.position),a===60?(n=!0,a=e.input.charCodeAt(++e.position)):a===33?(r=!0,i="!!",a=e.input.charCodeAt(++e.position)):i="!",t=e.position,n){do a=e.input.charCodeAt(++e.position);while(a!==0&&a!==62);e.position<e.length?(s=e.input.slice(t,e.position),a=e.input.charCodeAt(++e.position)):pt(e,"unexpected end of the stream within a verbatim tag")}else{for(;a!==0&&!Zr(a);)a===33&&(r?pt(e,"tag suffix cannot contain exclamation marks"):(i=e.input.slice(t-1,e.position+1),O8.test(i)||pt(e,"named tag handle cannot contain such characters"),r=!0,t=e.position+1)),a=e.input.charCodeAt(++e.position);s=e.input.slice(t,e.position),kX.test(s)&&pt(e,"tag suffix cannot contain flow indicator characters")}s&&!j8.test(s)&&pt(e,"tag name cannot contain such characters: "+s);try{s=decodeURIComponent(s)}catch{pt(e,"tag name is malformed: "+s)}return n?e.tag=s:ga.call(e.tagMap,i)?e.tag=e.tagMap[i]+s:i==="!"?e.tag="!"+s:i==="!!"?e.tag="tag:yaml.org,2002:"+s:pt(e,'undeclared tag handle "'+i+'"'),!0}function PX(e){var t,n;if(n=e.input.charCodeAt(e.position),n!==38)return!1;for(e.anchor!==null&&pt(e,"duplication of an anchor property"),n=e.input.charCodeAt(++e.position),t=e.position;n!==0&&!Zr(n)&&!kc(n);)n=e.input.charCodeAt(++e.position);return e.position===t&&pt(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),!0}function zX(e){var t,n,r;if(r=e.input.charCodeAt(e.position),r!==42)return!1;for(r=e.input.charCodeAt(++e.position),t=e.position;r!==0&&!Zr(r)&&!kc(r);)r=e.input.charCodeAt(++e.position);return e.position===t&&pt(e,"name of an alias node must contain at least one character"),n=e.input.slice(t,e.position),ga.call(e.anchorMap,n)||pt(e,'unidentified alias "'+n+'"'),e.result=e.anchorMap[n],nr(e,!0,-1),!0}function Yc(e,t,n,r,i){var s,a,c,u=1,f=!1,m=!1,p,y,x,b,S,k;if(e.listener!==null&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,s=a=c=Fm===n||A8===n,r&&nr(e,!0,-1)&&(f=!0,e.lineIndent>t?u=1:e.lineIndent===t?u=0:e.lineIndent<t&&(u=-1)),u===1)for(;IX(e)||PX(e);)nr(e,!0,-1)?(f=!0,c=s,e.lineIndent>t?u=1:e.lineIndent===t?u=0:e.lineIndent<t&&(u=-1)):c=!1;if(c&&(c=f||i),(u===1||Fm===n)&&(zm===n||R8===n?S=t:S=t+1,k=e.position-e.lineStart,u===1?c&&(GE(e,k)||LX(e,k,S))||DX(e,S)?m=!0:(a&&_X(e,S)||jX(e,S)||MX(e,S)?m=!0:zX(e)?(m=!0,(e.tag!==null||e.anchor!==null)&&pt(e,"alias node should not have any properties")):OX(e,S,zm===n)&&(m=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):u===0&&(m=c&&GE(e,k))),e.tag===null)e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);else if(e.tag==="?"){for(e.result!==null&&e.kind!=="scalar"&&pt(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),p=0,y=e.implicitTypes.length;p<y;p+=1)if(b=e.implicitTypes[p],b.resolve(e.result)){e.result=b.construct(e.result),e.tag=b.tag,e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);break}}else if(e.tag!=="!"){if(ga.call(e.typeMap[e.kind||"fallback"],e.tag))b=e.typeMap[e.kind||"fallback"][e.tag];else for(b=null,x=e.typeMap.multi[e.kind||"fallback"],p=0,y=x.length;p<y;p+=1)if(e.tag.slice(0,x[p].tag.length)===x[p].tag){b=x[p];break}b||pt(e,"unknown tag !<"+e.tag+">"),e.result!==null&&b.kind!==e.kind&&pt(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+b.kind+'", not "'+e.kind+'"'),b.resolve(e.result,e.tag)?(e.result=b.construct(e.result,e.tag),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):pt(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return e.listener!==null&&e.listener("close",e),e.tag!==null||e.anchor!==null||m}function FX(e){var t=e.position,n,r,i,s=!1,a;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);(a=e.input.charCodeAt(e.position))!==0&&(nr(e,!0,-1),a=e.input.charCodeAt(e.position),!(e.lineIndent>0||a!==37));){for(s=!0,a=e.input.charCodeAt(++e.position),n=e.position;a!==0&&!Zr(a);)a=e.input.charCodeAt(++e.position);for(r=e.input.slice(n,e.position),i=[],r.length<1&&pt(e,"directive name must not be less than one character in length");a!==0;){for(;dl(a);)a=e.input.charCodeAt(++e.position);if(a===35){do a=e.input.charCodeAt(++e.position);while(a!==0&&!No(a));break}if(No(a))break;for(n=e.position;a!==0&&!Zr(a);)a=e.input.charCodeAt(++e.position);i.push(e.input.slice(n,e.position))}a!==0&&Bv(e),ga.call(YE,r)?YE[r](e,r,i):Bm(e,'unknown document directive "'+r+'"')}if(nr(e,!0,-1),e.lineIndent===0&&e.input.charCodeAt(e.position)===45&&e.input.charCodeAt(e.position+1)===45&&e.input.charCodeAt(e.position+2)===45?(e.position+=3,nr(e,!0,-1)):s&&pt(e,"directives end mark is expected"),Yc(e,e.lineIndent-1,Fm,!1,!0),nr(e,!0,-1),e.checkLineBreaks&&CX.test(e.input.slice(t,e.position))&&Bm(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&L0(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,nr(e,!0,-1));return}if(e.position<e.length-1)pt(e,"end of the stream or a document separator is expected");else return}function BX(e,t){e=String(e),t=t||{},e.length!==0&&(e.charCodeAt(e.length-1)!==10&&e.charCodeAt(e.length-1)!==13&&(e+=`
57
+ `),e.charCodeAt(0)===65279&&(e=e.slice(1)));var n=new AX(e,t),r=e.indexOf("\0");for(r!==-1&&(n.position=r,pt(n,"null byte is not allowed in input")),n.input+="\0";n.input.charCodeAt(n.position)===32;)n.lineIndent+=1,n.position+=1;for(;n.position<n.length-1;)FX(n);return n.documents}function HX(e,t){var n=BX(e,t);if(n.length!==0){if(n.length===1)return n[0];throw new Xr("expected a single document in the stream, but found more")}}var UX=HX,VX={load:UX},I8=Object.prototype.toString,P8=Object.prototype.hasOwnProperty,Uv=65279,qX=9,sf=10,$X=13,YX=32,WX=33,GX=34,wx=35,KX=37,QX=38,XX=39,ZX=42,z8=44,JX=45,Hm=58,eZ=61,tZ=62,nZ=63,rZ=64,F8=91,B8=93,iZ=96,H8=123,oZ=124,U8=125,Mr={};Mr[0]="\\0";Mr[7]="\\a";Mr[8]="\\b";Mr[9]="\\t";Mr[10]="\\n";Mr[11]="\\v";Mr[12]="\\f";Mr[13]="\\r";Mr[27]="\\e";Mr[34]='\\"';Mr[92]="\\\\";Mr[133]="\\N";Mr[160]="\\_";Mr[8232]="\\L";Mr[8233]="\\P";var sZ=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],aZ=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function lZ(e,t){var n,r,i,s,a,c,u;if(t===null)return{};for(n={},r=Object.keys(t),i=0,s=r.length;i<s;i+=1)a=r[i],c=String(t[a]),a.slice(0,2)==="!!"&&(a="tag:yaml.org,2002:"+a.slice(2)),u=e.compiledTypeMap.fallback[a],u&&P8.call(u.styleAliases,c)&&(c=u.styleAliases[c]),n[a]=c;return n}function cZ(e){var t,n,r;if(t=e.toString(16).toUpperCase(),e<=255)n="x",r=2;else if(e<=65535)n="u",r=4;else if(e<=4294967295)n="U",r=8;else throw new Xr("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+n+cr.repeat("0",r-t.length)+t}var uZ=1,af=2;function dZ(e){this.schema=e.schema||N8,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=cr.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=lZ(this.schema,e.styles||null),this.sortKeys=e.sortKeys||!1,this.lineWidth=e.lineWidth||80,this.noRefs=e.noRefs||!1,this.noCompatMode=e.noCompatMode||!1,this.condenseFlow=e.condenseFlow||!1,this.quotingType=e.quotingType==='"'?af:uZ,this.forceQuotes=e.forceQuotes||!1,this.replacer=typeof e.replacer=="function"?e.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function KE(e,t){for(var n=cr.repeat(" ",t),r=0,i=-1,s="",a,c=e.length;r<c;)i=e.indexOf(`
58
+ `,r),i===-1?(a=e.slice(r),r=c):(a=e.slice(r,i+1),r=i+1),a.length&&a!==`
59
+ `&&(s+=n),s+=a;return s}function Sx(e,t){return`
60
+ `+cr.repeat(" ",e.indent*t)}function fZ(e,t){var n,r,i;for(n=0,r=e.implicitTypes.length;n<r;n+=1)if(i=e.implicitTypes[n],i.resolve(t))return!0;return!1}function Um(e){return e===YX||e===qX}function lf(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==Uv||65536<=e&&e<=1114111}function QE(e){return lf(e)&&e!==Uv&&e!==$X&&e!==sf}function XE(e,t,n){var r=QE(e),i=r&&!Um(e);return(n?r:r&&e!==z8&&e!==F8&&e!==B8&&e!==H8&&e!==U8)&&e!==wx&&!(t===Hm&&!i)||QE(t)&&!Um(t)&&e===wx||t===Hm&&i}function hZ(e){return lf(e)&&e!==Uv&&!Um(e)&&e!==JX&&e!==nZ&&e!==Hm&&e!==z8&&e!==F8&&e!==B8&&e!==H8&&e!==U8&&e!==wx&&e!==QX&&e!==ZX&&e!==WX&&e!==oZ&&e!==eZ&&e!==tZ&&e!==XX&&e!==GX&&e!==KX&&e!==rZ&&e!==iZ}function pZ(e){return!Um(e)&&e!==Hm}function jd(e,t){var n=e.charCodeAt(t),r;return n>=55296&&n<=56319&&t+1<e.length&&(r=e.charCodeAt(t+1),r>=56320&&r<=57343)?(n-55296)*1024+r-56320+65536:n}function V8(e){var t=/^\n* /;return t.test(e)}var q8=1,Cx=2,$8=3,Y8=4,vc=5;function mZ(e,t,n,r,i,s,a,c){var u,f=0,m=null,p=!1,y=!1,x=r!==-1,b=-1,S=hZ(jd(e,0))&&pZ(jd(e,e.length-1));if(t||a)for(u=0;u<e.length;f>=65536?u+=2:u++){if(f=jd(e,u),!lf(f))return vc;S=S&&XE(f,m,c),m=f}else{for(u=0;u<e.length;f>=65536?u+=2:u++){if(f=jd(e,u),f===sf)p=!0,x&&(y=y||u-b-1>r&&e[b+1]!==" ",b=u);else if(!lf(f))return vc;S=S&&XE(f,m,c),m=f}y=y||x&&u-b-1>r&&e[b+1]!==" "}return!p&&!y?S&&!a&&!i(e)?q8:s===af?vc:Cx:n>9&&V8(e)?vc:a?s===af?vc:Cx:y?Y8:$8}function gZ(e,t,n,r,i){e.dump=(function(){if(t.length===0)return e.quotingType===af?'""':"''";if(!e.noCompatMode&&(sZ.indexOf(t)!==-1||aZ.test(t)))return e.quotingType===af?'"'+t+'"':"'"+t+"'";var s=e.indent*Math.max(1,n),a=e.lineWidth===-1?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-s),c=r||e.flowLevel>-1&&n>=e.flowLevel;function u(f){return fZ(e,f)}switch(mZ(t,c,e.indent,a,u,e.quotingType,e.forceQuotes&&!r,i)){case q8:return t;case Cx:return"'"+t.replace(/'/g,"''")+"'";case $8:return"|"+ZE(t,e.indent)+JE(KE(t,s));case Y8:return">"+ZE(t,e.indent)+JE(KE(yZ(t,a),s));case vc:return'"'+xZ(t)+'"';default:throw new Xr("impossible error: invalid scalar style")}})()}function ZE(e,t){var n=V8(e)?String(t):"",r=e[e.length-1]===`
61
+ `,i=r&&(e[e.length-2]===`
62
+ `||e===`
63
+ `),s=i?"+":r?"":"-";return n+s+`
64
+ `}function JE(e){return e[e.length-1]===`
65
+ `?e.slice(0,-1):e}function yZ(e,t){for(var n=/(\n+)([^\n]*)/g,r=(function(){var f=e.indexOf(`
66
+ `);return f=f!==-1?f:e.length,n.lastIndex=f,e4(e.slice(0,f),t)})(),i=e[0]===`
67
+ `||e[0]===" ",s,a;a=n.exec(e);){var c=a[1],u=a[2];s=u[0]===" ",r+=c+(!i&&!s&&u!==""?`
68
+ `:"")+e4(u,t),i=s}return r}function e4(e,t){if(e===""||e[0]===" ")return e;for(var n=/ [^ ]/g,r,i=0,s,a=0,c=0,u="";r=n.exec(e);)c=r.index,c-i>t&&(s=a>i?a:c,u+=`
69
+ `+e.slice(i,s),i=s+1),a=c;return u+=`
70
+ `,e.length-i>t&&a>i?u+=e.slice(i,a)+`
71
+ `+e.slice(a+1):u+=e.slice(i),u.slice(1)}function xZ(e){for(var t="",n=0,r,i=0;i<e.length;n>=65536?i+=2:i++)n=jd(e,i),r=Mr[n],!r&&lf(n)?(t+=e[i],n>=65536&&(t+=e[i+1])):t+=r||cZ(n);return t}function bZ(e,t,n){var r="",i=e.tag,s,a,c;for(s=0,a=n.length;s<a;s+=1)c=n[s],e.replacer&&(c=e.replacer.call(n,String(s),c)),(bs(e,t,c,!1,!1)||typeof c>"u"&&bs(e,t,null,!1,!1))&&(r!==""&&(r+=","+(e.condenseFlow?"":" ")),r+=e.dump);e.tag=i,e.dump="["+r+"]"}function t4(e,t,n,r){var i="",s=e.tag,a,c,u;for(a=0,c=n.length;a<c;a+=1)u=n[a],e.replacer&&(u=e.replacer.call(n,String(a),u)),(bs(e,t+1,u,!0,!0,!1,!0)||typeof u>"u"&&bs(e,t+1,null,!0,!0,!1,!0))&&((!r||i!=="")&&(i+=Sx(e,t)),e.dump&&sf===e.dump.charCodeAt(0)?i+="-":i+="- ",i+=e.dump);e.tag=s,e.dump=i||"[]"}function vZ(e,t,n){var r="",i=e.tag,s=Object.keys(n),a,c,u,f,m;for(a=0,c=s.length;a<c;a+=1)m="",r!==""&&(m+=", "),e.condenseFlow&&(m+='"'),u=s[a],f=n[u],e.replacer&&(f=e.replacer.call(n,u,f)),bs(e,t,u,!1,!1)&&(e.dump.length>1024&&(m+="? "),m+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),bs(e,t,f,!1,!1)&&(m+=e.dump,r+=m));e.tag=i,e.dump="{"+r+"}"}function wZ(e,t,n,r){var i="",s=e.tag,a=Object.keys(n),c,u,f,m,p,y;if(e.sortKeys===!0)a.sort();else if(typeof e.sortKeys=="function")a.sort(e.sortKeys);else if(e.sortKeys)throw new Xr("sortKeys must be a boolean or a function");for(c=0,u=a.length;c<u;c+=1)y="",(!r||i!=="")&&(y+=Sx(e,t)),f=a[c],m=n[f],e.replacer&&(m=e.replacer.call(n,f,m)),bs(e,t+1,f,!0,!0,!0)&&(p=e.tag!==null&&e.tag!=="?"||e.dump&&e.dump.length>1024,p&&(e.dump&&sf===e.dump.charCodeAt(0)?y+="?":y+="? "),y+=e.dump,p&&(y+=Sx(e,t)),bs(e,t+1,m,!0,p)&&(e.dump&&sf===e.dump.charCodeAt(0)?y+=":":y+=": ",y+=e.dump,i+=y));e.tag=s,e.dump=i||"{}"}function n4(e,t,n){var r,i,s,a,c,u;for(i=n?e.explicitTypes:e.implicitTypes,s=0,a=i.length;s<a;s+=1)if(c=i[s],(c.instanceOf||c.predicate)&&(!c.instanceOf||typeof t=="object"&&t instanceof c.instanceOf)&&(!c.predicate||c.predicate(t))){if(n?c.multi&&c.representName?e.tag=c.representName(t):e.tag=c.tag:e.tag="?",c.represent){if(u=e.styleMap[c.tag]||c.defaultStyle,I8.call(c.represent)==="[object Function]")r=c.represent(t,u);else if(P8.call(c.represent,u))r=c.represent[u](t,u);else throw new Xr("!<"+c.tag+'> tag resolver accepts not "'+u+'" style');e.dump=r}return!0}return!1}function bs(e,t,n,r,i,s,a){e.tag=null,e.dump=n,n4(e,n,!1)||n4(e,n,!0);var c=I8.call(e.dump),u=r,f;r&&(r=e.flowLevel<0||e.flowLevel>t);var m=c==="[object Object]"||c==="[object Array]",p,y;if(m&&(p=e.duplicates.indexOf(n),y=p!==-1),(e.tag!==null&&e.tag!=="?"||y||e.indent!==2&&t>0)&&(i=!1),y&&e.usedDuplicates[p])e.dump="*ref_"+p;else{if(m&&y&&!e.usedDuplicates[p]&&(e.usedDuplicates[p]=!0),c==="[object Object]")r&&Object.keys(e.dump).length!==0?(wZ(e,t,e.dump,i),y&&(e.dump="&ref_"+p+e.dump)):(vZ(e,t,e.dump),y&&(e.dump="&ref_"+p+" "+e.dump));else if(c==="[object Array]")r&&e.dump.length!==0?(e.noArrayIndent&&!a&&t>0?t4(e,t-1,e.dump,i):t4(e,t,e.dump,i),y&&(e.dump="&ref_"+p+e.dump)):(bZ(e,t,e.dump),y&&(e.dump="&ref_"+p+" "+e.dump));else if(c==="[object String]")e.tag!=="?"&&gZ(e,e.dump,t,s,u);else{if(c==="[object Undefined]")return!1;if(e.skipInvalid)return!1;throw new Xr("unacceptable kind of an object to dump "+c)}e.tag!==null&&e.tag!=="?"&&(f=encodeURI(e.tag[0]==="!"?e.tag.slice(1):e.tag).replace(/!/g,"%21"),e.tag[0]==="!"?f="!"+f:f.slice(0,18)==="tag:yaml.org,2002:"?f="!!"+f.slice(18):f="!<"+f+">",e.dump=f+" "+e.dump)}return!0}function SZ(e,t){var n=[],r=[],i,s;for(kx(e,n,r),i=0,s=r.length;i<s;i+=1)t.duplicates.push(n[r[i]]);t.usedDuplicates=new Array(s)}function kx(e,t,n){var r,i,s;if(e!==null&&typeof e=="object")if(i=t.indexOf(e),i!==-1)n.indexOf(i)===-1&&n.push(i);else if(t.push(e),Array.isArray(e))for(i=0,s=e.length;i<s;i+=1)kx(e[i],t,n);else for(r=Object.keys(e),i=0,s=r.length;i<s;i+=1)kx(e[r[i]],t,n)}function CZ(e,t){t=t||{};var n=new dZ(t);n.noRefs||SZ(e,n);var r=e;return n.replacer&&(r=n.replacer.call({"":r},"",r)),bs(n,0,r,!0,!0)?n.dump+`
72
+ `:""}var kZ=CZ,EZ={dump:kZ},r4=VX.load,Ex=EZ.dump;const TZ='(()=>{var Si=Object.defineProperty;var bi=(e,n)=>{for(var i in n)Si(e,i,{get:n[i],enumerable:!0})};var $e={};bi($e,{Diff:()=>b,FILE_HEADERS_ONLY:()=>_n,INCLUDE_HEADERS:()=>Ue,OMIT_HEADERS:()=>Ln,applyPatch:()=>je,applyPatches:()=>bn,arrayDiff:()=>Pe,canonicalize:()=>V,characterDiff:()=>ye,convertChangesToDMP:()=>On,convertChangesToXML:()=>In,createPatch:()=>Fn,createTwoFilesPatch:()=>Ye,cssDiff:()=>Ne,diffArrays:()=>wn,diffChars:()=>sn,diffCss:()=>yn,diffJson:()=>An,diffLines:()=>N,diffSentences:()=>vn,diffTrimmedLines:()=>xn,diffWords:()=>mn,diffWordsWithSpace:()=>Le,formatPatch:()=>ee,jsonDiff:()=>Re,lineDiff:()=>ce,parsePatch:()=>Z,reversePatch:()=>Be,sentenceDiff:()=>ke,structuredPatch:()=>ae,wordDiff:()=>be,wordsWithSpaceDiff:()=>_e});var b=class{diff(n,i,r={}){let l;typeof r=="function"?(l=r,r={}):"callback"in r&&(l=r.callback);let t=this.castInput(n,r),o=this.castInput(i,r),u=this.removeEmpty(this.tokenize(t,r)),f=this.removeEmpty(this.tokenize(o,r));return this.diffWithOptionsObj(u,f,r,l)}diffWithOptionsObj(n,i,r,l){var t;let o=m=>{if(m=this.postProcess(m,r),l){setTimeout(function(){l(m)},0);return}else return m},u=i.length,f=n.length,c=1,s=u+f;r.maxEditLength!=null&&(s=Math.min(s,r.maxEditLength));let a=(t=r.timeout)!==null&&t!==void 0?t:1/0,p=Date.now()+a,d=[{oldPos:-1,lastComponent:void 0}],h=this.extractCommon(d[0],i,n,0,r);if(d[0].oldPos+1>=f&&h+1>=u)return o(this.buildValues(d[0].lastComponent,i,n));let g=-1/0,y=1/0,w=()=>{for(let m=Math.max(g,-c);m<=Math.min(y,c);m+=2){let x,A=d[m-1],C=d[m+1];A&&(d[m-1]=void 0);let F=!1;if(C){let S=C.oldPos-m;F=C&&0<=S&&S<u}let E=A&&A.oldPos+1<f;if(!F&&!E){d[m]=void 0;continue}if(!E||F&&A.oldPos<C.oldPos?x=this.addToPath(C,!0,!1,0,r):x=this.addToPath(A,!1,!0,1,r),h=this.extractCommon(x,i,n,m,r),x.oldPos+1>=f&&h+1>=u)return o(this.buildValues(x.lastComponent,i,n))||!0;d[m]=x,x.oldPos+1>=f&&(y=Math.min(y,m-1)),h+1>=u&&(g=Math.max(g,m+1))}c++};if(l)(function m(){setTimeout(function(){if(c>s||Date.now()>p)return l(void 0);w()||m()},0)})();else for(;c<=s&&Date.now()<=p;){let m=w();if(m)return m}}addToPath(n,i,r,l,t){let o=n.lastComponent;return o&&!t.oneChangePerToken&&o.added===i&&o.removed===r?{oldPos:n.oldPos+l,lastComponent:{count:o.count+1,added:i,removed:r,previousComponent:o.previousComponent}}:{oldPos:n.oldPos+l,lastComponent:{count:1,added:i,removed:r,previousComponent:o}}}extractCommon(n,i,r,l,t){let o=i.length,u=r.length,f=n.oldPos,c=f-l,s=0;for(;c+1<o&&f+1<u&&this.equals(r[f+1],i[c+1],t);)c++,f++,s++,t.oneChangePerToken&&(n.lastComponent={count:1,previousComponent:n.lastComponent,added:!1,removed:!1});return s&&!t.oneChangePerToken&&(n.lastComponent={count:s,previousComponent:n.lastComponent,added:!1,removed:!1}),n.oldPos=f,c}equals(n,i,r){return r.comparator?r.comparator(n,i):n===i||!!r.ignoreCase&&n.toLowerCase()===i.toLowerCase()}removeEmpty(n){let i=[];for(let r=0;r<n.length;r++)n[r]&&i.push(n[r]);return i}castInput(n,i){return n}tokenize(n,i){return Array.from(n)}join(n){return n.join("")}postProcess(n,i){return n}get useLongestToken(){return!1}buildValues(n,i,r){let l=[],t;for(;n;)l.push(n),t=n.previousComponent,delete n.previousComponent,n=t;l.reverse();let o=l.length,u=0,f=0,c=0;for(;u<o;u++){let s=l[u];if(s.removed)s.value=this.join(r.slice(c,c+s.count)),c+=s.count;else{if(!s.added&&this.useLongestToken){let a=i.slice(f,f+s.count);a=a.map(function(p,d){let h=r[c+d];return h.length>p.length?h:p}),s.value=this.join(a)}else s.value=this.join(i.slice(f,f+s.count));f+=s.count,s.added||(c+=s.count)}}return l}};var ve=class extends b{},ye=new ve;function sn(e,n,i){return ye.diff(e,n,i)}function Ae(e,n){let i;for(i=0;i<e.length&&i<n.length;i++)if(e[i]!=n[i])return e.slice(0,i);return e.slice(0,i)}function we(e,n){let i;if(!e||!n||e[e.length-1]!=n[n.length-1])return"";for(i=0;i<e.length&&i<n.length;i++)if(e[e.length-(i+1)]!=n[n.length-(i+1)])return e.slice(-i);return e.slice(-i)}function te(e,n,i){if(e.slice(0,n.length)!=n)throw Error(`string ${JSON.stringify(e)} doesn\'t start with prefix ${JSON.stringify(n)}; this is a bug`);return i+e.slice(n.length)}function ue(e,n,i){if(!n)return e+i;if(e.slice(-n.length)!=n)throw Error(`string ${JSON.stringify(e)} doesn\'t end with suffix ${JSON.stringify(n)}; this is a bug`);return e.slice(0,-n.length)+i}function q(e,n){return te(e,n,"")}function X(e,n){return ue(e,n,"")}function Ce(e,n){return n.slice(0,_i(e,n))}function _i(e,n){let i=0;e.length>n.length&&(i=e.length-n.length);let r=n.length;e.length<n.length&&(r=e.length);let l=Array(r),t=0;l[0]=0;for(let o=1;o<r;o++){for(n[o]==n[t]?l[o]=l[t]:l[o]=t;t>0&&n[o]!=n[t];)t=l[t];n[o]==n[t]&&t++}t=0;for(let o=i;o<e.length;o++){for(;t>0&&e[o]!=n[t];)t=l[t];e[o]==n[t]&&t++}return t}function pn(e){return e.includes(`\\r\n`)&&!e.startsWith(`\n`)&&!e.match(/[^\\r]\\n/)}function dn(e){return!e.includes(`\\r\n`)&&e.includes(`\n`)}function z(e){let n;for(n=e.length-1;n>=0&&e[n].match(/\\s/);n--);return e.substring(n+1)}function M(e){let n=e.match(/^\\s*/);return n?n[0]:""}var fe="a-zA-Z0-9_\\\\u{AD}\\\\u{C0}-\\\\u{D6}\\\\u{D8}-\\\\u{F6}\\\\u{F8}-\\\\u{2C6}\\\\u{2C8}-\\\\u{2D7}\\\\u{2DE}-\\\\u{2FF}\\\\u{1E00}-\\\\u{1EFF}",Li=new RegExp(`[${fe}]+|\\\\s+|[^${fe}]`,"ug"),Ee=class extends b{equals(n,i,r){return r.ignoreCase&&(n=n.toLowerCase(),i=i.toLowerCase()),n.trim()===i.trim()}tokenize(n,i={}){let r;if(i.intlSegmenter){let o=i.intlSegmenter;if(o.resolvedOptions().granularity!="word")throw new Error(\'The segmenter passed must have a granularity of "word"\');r=[];for(let u of Array.from(o.segment(n))){let f=u.segment;r.length&&/\\s/.test(r[r.length-1])&&/\\s/.test(f)?r[r.length-1]+=f:r.push(f)}}else r=n.match(Li)||[];let l=[],t=null;return r.forEach(o=>{/\\s/.test(o)?t==null?l.push(o):l.push(l.pop()+o):t!=null&&/\\s/.test(t)?l[l.length-1]==t?l.push(l.pop()+o):l.push(t+o):l.push(o),t=o}),l}join(n){return n.map((i,r)=>r==0?i:i.replace(/^\\s+/,"")).join("")}postProcess(n,i){if(!n||i.oneChangePerToken)return n;let r=null,l=null,t=null;return n.forEach(o=>{o.added?l=o:o.removed?t=o:((l||t)&&hn(r,t,l,o),r=o,l=null,t=null)}),(l||t)&&hn(r,t,l,null),n}},be=new Ee;function mn(e,n,i){return i?.ignoreWhitespace!=null&&!i.ignoreWhitespace?Le(e,n,i):be.diff(e,n,i)}function hn(e,n,i,r){if(n&&i){let l=M(n.value),t=z(n.value),o=M(i.value),u=z(i.value);if(e){let f=Ae(l,o);e.value=ue(e.value,o,f),n.value=q(n.value,f),i.value=q(i.value,f)}if(r){let f=we(t,u);r.value=te(r.value,u,f),n.value=X(n.value,f),i.value=X(i.value,f)}}else if(i){if(e){let l=M(i.value);i.value=i.value.substring(l.length)}if(r){let l=M(r.value);r.value=r.value.substring(l.length)}}else if(e&&r){let l=M(r.value),t=M(n.value),o=z(n.value),u=Ae(l,t);n.value=q(n.value,u);let f=we(q(l,u),o);n.value=X(n.value,f),r.value=te(r.value,l,f),e.value=ue(e.value,l,l.slice(0,l.length-f.length))}else if(r){let l=M(r.value),t=z(n.value),o=Ce(t,l);n.value=X(n.value,o)}else if(e){let l=z(e.value),t=M(n.value),o=Ce(l,t);n.value=q(n.value,o)}}var Se=class extends b{tokenize(n){let i=new RegExp(`(\\\\r?\\\\n)|[${fe}]+|[^\\\\S\\\\n\\\\r]+|[^${fe}]`,"ug");return n.match(i)||[]}},_e=new Se;function Le(e,n,i){return _e.diff(e,n,i)}function gn(e,n){if(typeof e=="function")n.callback=e;else if(e)for(let i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i]);return n}var Fe=class extends b{constructor(){super(...arguments),this.tokenize=Oe}equals(n,i,r){return r.ignoreWhitespace?((!r.newlineIsToken||!n.includes(`\n`))&&(n=n.trim()),(!r.newlineIsToken||!i.includes(`\n`))&&(i=i.trim())):r.ignoreNewlineAtEof&&!r.newlineIsToken&&(n.endsWith(`\n`)&&(n=n.slice(0,-1)),i.endsWith(`\n`)&&(i=i.slice(0,-1))),super.equals(n,i,r)}},ce=new Fe;function N(e,n,i){return ce.diff(e,n,i)}function xn(e,n,i){return i=gn(i,{ignoreWhitespace:!0}),ce.diff(e,n,i)}function Oe(e,n){n.stripTrailingCr&&(e=e.replace(/\\r\\n/g,`\n`));let i=[],r=e.split(/(\\n|\\r\\n)/);r[r.length-1]||r.pop();for(let l=0;l<r.length;l++){let t=r[l];l%2&&!n.newlineIsToken?i[i.length-1]+=t:i.push(t)}return i}function Fi(e){return e=="."||e=="!"||e=="?"}var Ie=class extends b{tokenize(n){var i;let r=[],l=0;for(let t=0;t<n.length;t++){if(t==n.length-1){r.push(n.slice(l));break}if(Fi(n[t])&&n[t+1].match(/\\s/)){for(r.push(n.slice(l,t+1)),t=l=t+1;!((i=n[t+1])===null||i===void 0)&&i.match(/\\s/);)t++;r.push(n.slice(l,t+1)),l=t+1}}return r}},ke=new Ie;function vn(e,n,i){return ke.diff(e,n,i)}var Te=class extends b{tokenize(n){return n.split(/([{}:;,]|\\s+)/)}},Ne=new Te;function yn(e,n,i){return Ne.diff(e,n,i)}var De=class extends b{constructor(){super(...arguments),this.tokenize=Oe}get useLongestToken(){return!0}castInput(n,i){let{undefinedReplacement:r,stringifyReplacer:l=(t,o)=>typeof o>"u"?r:o}=i;return typeof n=="string"?n:JSON.stringify(V(n,null,null,l),null," ")}equals(n,i,r){return super.equals(n.replace(/,([\\r\\n])/g,"$1"),i.replace(/,([\\r\\n])/g,"$1"),r)}},Re=new De;function An(e,n,i){return Re.diff(e,n,i)}function V(e,n,i,r,l){n=n||[],i=i||[],r&&(e=r(l===void 0?"":l,e));let t;for(t=0;t<n.length;t+=1)if(n[t]===e)return i[t];let o;if(Object.prototype.toString.call(e)==="[object Array]"){for(n.push(e),o=new Array(e.length),i.push(o),t=0;t<e.length;t+=1)o[t]=V(e[t],n,i,r,String(t));return n.pop(),i.pop(),o}if(e&&e.toJSON&&(e=e.toJSON()),typeof e=="object"&&e!==null){n.push(e),o={},i.push(o);let u=[],f;for(f in e)Object.prototype.hasOwnProperty.call(e,f)&&u.push(f);for(u.sort(),t=0;t<u.length;t+=1)f=u[t],o[f]=V(e[f],n,i,r,f);n.pop(),i.pop()}else o=e;return o}var Me=class extends b{tokenize(n){return n.slice()}join(n){return n}removeEmpty(n){return n}},Pe=new Me;function wn(e,n,i){return Pe.diff(e,n,i)}function We(e){return Array.isArray(e)?e.map(n=>We(n)):Object.assign(Object.assign({},e),{hunks:e.hunks.map(n=>Object.assign(Object.assign({},n),{lines:n.lines.map((i,r)=>{var l;return i.startsWith("\\\\")||i.endsWith("\\r")||!((l=n.lines[r+1])===null||l===void 0)&&l.startsWith("\\\\")?i:i+"\\r"})}))})}function He(e){return Array.isArray(e)?e.map(n=>He(n)):Object.assign(Object.assign({},e),{hunks:e.hunks.map(n=>Object.assign(Object.assign({},n),{lines:n.lines.map(i=>i.endsWith("\\r")?i.substring(0,i.length-1):i)}))})}function Cn(e){return Array.isArray(e)||(e=[e]),!e.some(n=>n.hunks.some(i=>i.lines.some(r=>!r.startsWith("\\\\")&&r.endsWith("\\r"))))}function En(e){return Array.isArray(e)||(e=[e]),e.some(n=>n.hunks.some(i=>i.lines.some(r=>r.endsWith("\\r"))))&&e.every(n=>n.hunks.every(i=>i.lines.every((r,l)=>{var t;return r.startsWith("\\\\")||r.endsWith("\\r")||((t=i.lines[l+1])===null||t===void 0?void 0:t.startsWith("\\\\"))})))}function Z(e){let n=e.split(/\\n/),i=[],r=0;function l(){let u={};for(i.push(u);r<n.length;){let f=n[r];if(/^(---|\\+\\+\\+|@@)\\s/.test(f))break;let c=/^(?:Index:|diff(?: -r \\w+)+)\\s+/.exec(f);c&&(u.index=f.substring(c[0].length).trim()),r++}for(t(u),t(u),u.hunks=[];r<n.length;){let f=n[r];if(/^(Index:\\s|diff\\s|---\\s|\\+\\+\\+\\s|===================================================================)/.test(f))break;if(/^@@/.test(f))u.hunks.push(o());else{if(f)throw new Error("Unknown line "+(r+1)+" "+JSON.stringify(f));r++}}}function t(u){let f=/^(---|\\+\\+\\+)\\s+/.exec(n[r]);if(f){let c=f[1],s=n[r].substring(3).trim().split(" ",2),a=(s[1]||"").trim(),p=s[0].replace(/\\\\\\\\/g,"\\\\");p.startsWith(\'"\')&&p.endsWith(\'"\')&&(p=p.substr(1,p.length-2)),c==="---"?(u.oldFileName=p,u.oldHeader=a):(u.newFileName=p,u.newHeader=a),r++}}function o(){var u;let f=r,c=n[r++],s=c.split(/@@ -(\\d+)(?:,(\\d+))? \\+(\\d+)(?:,(\\d+))? @@/),a={oldStart:+s[1],oldLines:typeof s[2]>"u"?1:+s[2],newStart:+s[3],newLines:typeof s[4]>"u"?1:+s[4],lines:[]};a.oldLines===0&&(a.oldStart+=1),a.newLines===0&&(a.newStart+=1);let p=0,d=0;for(;r<n.length&&(d<a.oldLines||p<a.newLines||!((u=n[r])===null||u===void 0)&&u.startsWith("\\\\"));r++){let h=n[r].length==0&&r!=n.length-1?" ":n[r][0];if(h==="+"||h==="-"||h===" "||h==="\\\\")a.lines.push(n[r]),h==="+"?p++:h==="-"?d++:h===" "&&(p++,d++);else throw new Error(`Hunk at line ${f+1} contained invalid line ${n[r]}`)}if(!p&&a.newLines===1&&(a.newLines=0),!d&&a.oldLines===1&&(a.oldLines=0),p!==a.newLines)throw new Error("Added line count did not match for hunk at line "+(f+1));if(d!==a.oldLines)throw new Error("Removed line count did not match for hunk at line "+(f+1));return a}for(;r<n.length;)l();return i}function Sn(e,n,i){let r=!0,l=!1,t=!1,o=1;return function u(){if(r&&!t){if(l?o++:r=!1,e+o<=i)return e+o;t=!0}if(!l)return t||(r=!0),n<=e-o?e-o++:(l=!0,u())}}function je(e,n,i={}){let r;if(typeof n=="string"?r=Z(n):Array.isArray(n)?r=n:r=[n],r.length>1)throw new Error("applyPatch only works with a single input.");return Oi(e,r[0],i)}function Oi(e,n,i={}){(i.autoConvertLineEndings||i.autoConvertLineEndings==null)&&(pn(e)&&Cn(n)?n=We(n):dn(e)&&En(n)&&(n=He(n)));let r=e.split(`\n`),l=n.hunks,t=i.compareLine||((h,g,y,w)=>g===w),o=i.fuzzFactor||0,u=0;if(o<0||!Number.isInteger(o))throw new Error("fuzzFactor must be a non-negative integer");if(!l.length)return e;let f="",c=!1,s=!1;for(let h=0;h<l[l.length-1].lines.length;h++){let g=l[l.length-1].lines[h];g[0]=="\\\\"&&(f[0]=="+"?c=!0:f[0]=="-"&&(s=!0)),f=g}if(c){if(s){if(!o&&r[r.length-1]=="")return!1}else if(r[r.length-1]=="")r.pop();else if(!o)return!1}else if(s){if(r[r.length-1]!="")r.push("");else if(!o)return!1}function a(h,g,y,w=0,m=!0,x=[],A=0){let C=0,F=!1;for(;w<h.length;w++){let E=h[w],S=E.length>0?E[0]:" ",$=E.length>0?E.substr(1):E;if(S==="-")if(t(g+1,r[g],S,$))g++,C=0;else return!y||r[g]==null?null:(x[A]=r[g],a(h,g+1,y-1,w,!1,x,A+1));if(S==="+"){if(!m)return null;x[A]=$,A++,C=0,F=!0}if(S===" ")if(C++,x[A]=r[g],t(g+1,r[g],S,$))A++,m=!0,F=!1,g++;else return F||!y?null:r[g]&&(a(h,g+1,y-1,w+1,!1,x,A+1)||a(h,g+1,y-1,w,!1,x,A+1))||a(h,g,y-1,w+1,!1,x,A)}return A-=C,g-=C,x.length=A,{patchedLines:x,oldLineLastI:g-1}}let p=[],d=0;for(let h=0;h<l.length;h++){let g=l[h],y,w=r.length-g.oldLines+o,m;for(let x=0;x<=o;x++){m=g.oldStart+d-1;let A=Sn(m,u,w);for(;m!==void 0&&(y=a(g.lines,m,x),!y);m=A());if(y)break}if(!y)return!1;for(let x=u;x<m;x++)p.push(r[x]);for(let x=0;x<y.patchedLines.length;x++){let A=y.patchedLines[x];p.push(A)}u=y.oldLineLastI+1,d=m+1-g.oldStart}for(let h=u;h<r.length;h++)p.push(r[h]);return p.join(`\n`)}function bn(e,n){let i=typeof e=="string"?Z(e):e,r=0;function l(){let t=i[r++];if(!t)return n.complete();n.loadFile(t,function(o,u){if(o)return n.complete(o);let f=je(u,t,n);n.patched(t,f,function(c){if(c)return n.complete(c);l()})})}l()}function Be(e){return Array.isArray(e)?e.map(n=>Be(n)).reverse():Object.assign(Object.assign({},e),{oldFileName:e.newFileName,oldHeader:e.newHeader,newFileName:e.oldFileName,newHeader:e.oldHeader,hunks:e.hunks.map(n=>({oldLines:n.newLines,oldStart:n.newStart,newLines:n.oldLines,newStart:n.oldStart,lines:n.lines.map(i=>i.startsWith("-")?`+${i.slice(1)}`:i.startsWith("+")?`-${i.slice(1)}`:i)}))})}var Ue={includeIndex:!0,includeUnderline:!0,includeFileHeaders:!0},_n={includeIndex:!1,includeUnderline:!1,includeFileHeaders:!0},Ln={includeIndex:!1,includeUnderline:!1,includeFileHeaders:!1};function ae(e,n,i,r,l,t,o){let u;o?typeof o=="function"?u={callback:o}:u=o:u={},typeof u.context>"u"&&(u.context=4);let f=u.context;if(u.newlineIsToken)throw new Error("newlineIsToken may not be used with patch-generation functions, only with diffing functions");if(u.callback){let{callback:s}=u;N(i,r,Object.assign(Object.assign({},u),{callback:a=>{let p=c(a);s(p)}}))}else return c(N(i,r,u));function c(s){if(!s)return;s.push({value:"",lines:[]});function a(m){return m.map(function(x){return" "+x})}let p=[],d=0,h=0,g=[],y=1,w=1;for(let m=0;m<s.length;m++){let x=s[m],A=x.lines||Ii(x.value);if(x.lines=A,x.added||x.removed){if(!d){let C=s[m-1];d=y,h=w,C&&(g=f>0?a(C.lines.slice(-f)):[],d-=g.length,h-=g.length)}for(let C of A)g.push((x.added?"+":"-")+C);x.added?w+=A.length:y+=A.length}else{if(d)if(A.length<=f*2&&m<s.length-2)for(let C of a(A))g.push(C);else{let C=Math.min(A.length,f);for(let E of a(A.slice(0,C)))g.push(E);let F={oldStart:d,oldLines:y-d+C,newStart:h,newLines:w-h+C,lines:g};p.push(F),d=0,h=0,g=[]}y+=A.length,w+=A.length}}for(let m of p)for(let x=0;x<m.lines.length;x++)m.lines[x].endsWith(`\n`)?m.lines[x]=m.lines[x].slice(0,-1):(m.lines.splice(x+1,0,"\\\"),x++);return{oldFileName:e,newFileName:n,oldHeader:l,newHeader:t,hunks:p}}}function ee(e,n){if(n||(n=Ue),Array.isArray(e)){if(e.length>1&&!n.includeFileHeaders)throw new Error("Cannot omit file headers on a multi-file patch. (The result would be unparseable; how would a tool trying to apply the patch know which changes are to which file?)");return e.map(r=>ee(r,n)).join(`\n`)}let i=[];n.includeIndex&&e.oldFileName==e.newFileName&&i.push("Index: "+e.oldFileName),n.includeUnderline&&i.push("==================================================================="),n.includeFileHeaders&&(i.push("--- "+e.oldFileName+(typeof e.oldHeader>"u"?"":" "+e.oldHeader)),i.push("+++ "+e.newFileName+(typeof e.newHeader>"u"?"":" "+e.newHeader)));for(let r=0;r<e.hunks.length;r++){let l=e.hunks[r];l.oldLines===0&&(l.oldStart-=1),l.newLines===0&&(l.newStart-=1),i.push("@@ -"+l.oldStart+","+l.oldLines+" +"+l.newStart+","+l.newLines+" @@");for(let t of l.lines)i.push(t)}return i.join(`\n`)+`\n`}function Ye(e,n,i,r,l,t,o){if(typeof o=="function"&&(o={callback:o}),o?.callback){let{callback:u}=o;ae(e,n,i,r,l,t,Object.assign(Object.assign({},o),{callback:f=>{u(f?ee(f,o.headerOptions):void 0)}}))}else{let u=ae(e,n,i,r,l,t,o);return u?ee(u,o?.headerOptions):void 0}}function Fn(e,n,i,r,l,t){return Ye(e,e,n,i,r,l,t)}function Ii(e){let n=e.endsWith(`\n`),i=e.split(`\n`).map(r=>r+`\n`);return n?i.pop():i.push(i.pop().slice(0,-1)),i}function On(e){let n=[],i,r;for(let l=0;l<e.length;l++)i=e[l],i.added?r=1:i.removed?r=-1:r=0,n.push([r,i.value]);return n}function In(e){let n=[];for(let i=0;i<e.length;i++){let r=e[i];r.added?n.push("<ins>"):r.removed&&n.push("<del>"),n.push(ki(r.value)),r.added?n.push("</ins>"):r.removed&&n.push("</del>")}return n.join("")}function ki(e){let n=e;return n=n.replace(/&/g,"&amp;"),n=n.replace(/</g,"&lt;"),n=n.replace(/>/g,"&gt;"),n=n.replace(/"/g,"&quot;"),n}function zn(e){return typeof e>"u"||e===null}function Ti(e){return typeof e=="object"&&e!==null}function Ni(e){return Array.isArray(e)?e:zn(e)?[]:[e]}function Di(e,n){var i,r,l,t;if(n)for(t=Object.keys(n),i=0,r=t.length;i<r;i+=1)l=t[i],e[l]=n[l];return e}function Ri(e,n){var i="",r;for(r=0;r<n;r+=1)i+=e;return i}function Mi(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var Pi=zn,Wi=Ti,Hi=Ni,ji=Ri,Bi=Mi,Ui=Di,L={isNothing:Pi,isObject:Wi,toArray:Hi,repeat:ji,isNegativeZero:Bi,extend:Ui};function Gn(e,n){var i="",r=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(i+=\'in "\'+e.mark.name+\'" \'),i+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!n&&e.mark.snippet&&(i+=`\n\n`+e.mark.snippet),r+" "+i):r}function ie(e,n){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=n,this.message=Gn(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}ie.prototype=Object.create(Error.prototype);ie.prototype.constructor=ie;ie.prototype.toString=function(n){return this.name+": "+Gn(this,n)};var k=ie;function qe(e,n,i,r,l){var t="",o="",u=Math.floor(l/2)-1;return r-n>u&&(t=" ... ",n=r-u+t.length),i-r>u&&(o=" ...",i=r+u-o.length),{str:t+e.slice(n,i).replace(/\\t/g,"\\u2192")+o,pos:r-n+t.length}}function ze(e,n){return L.repeat(" ",n-e.length)+e}function Yi(e,n){if(n=Object.create(n||null),!e.buffer)return null;n.maxLength||(n.maxLength=79),typeof n.indent!="number"&&(n.indent=1),typeof n.linesBefore!="number"&&(n.linesBefore=3),typeof n.linesAfter!="number"&&(n.linesAfter=2);for(var i=/\\r?\\n|\\r|\\0/g,r=[0],l=[],t,o=-1;t=i.exec(e.buffer);)l.push(t.index),r.push(t.index+t[0].length),e.position<=t.index&&o<0&&(o=r.length-2);o<0&&(o=r.length-1);var u="",f,c,s=Math.min(e.line+n.linesAfter,l.length).toString().length,a=n.maxLength-(n.indent+s+3);for(f=1;f<=n.linesBefore&&!(o-f<0);f++)c=qe(e.buffer,r[o-f],l[o-f],e.position-(r[o]-r[o-f]),a),u=L.repeat(" ",n.indent)+ze((e.line-f+1).toString(),s)+" | "+c.str+`\n`+u;for(c=qe(e.buffer,r[o],l[o],e.position,a),u+=L.repeat(" ",n.indent)+ze((e.line+1).toString(),s)+" | "+c.str+`\n`,u+=L.repeat("-",n.indent+s+3+c.pos)+`^\n`,f=1;f<=n.linesAfter&&!(o+f>=l.length);f++)c=qe(e.buffer,r[o+f],l[o+f],e.position-(r[o]-r[o+f]),a),u+=L.repeat(" ",n.indent)+ze((e.line+f+1).toString(),s)+" | "+c.str+`\n`;return u.replace(/\\n$/,"")}var $i=Yi,qi=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],zi=["scalar","sequence","mapping"];function Gi(e){var n={};return e!==null&&Object.keys(e).forEach(function(i){e[i].forEach(function(r){n[String(r)]=i})}),n}function Ji(e,n){if(n=n||{},Object.keys(n).forEach(function(i){if(qi.indexOf(i)===-1)throw new k(\'Unknown option "\'+i+\'" is met in definition of "\'+e+\'" YAML type.\')}),this.options=n,this.tag=e,this.kind=n.kind||null,this.resolve=n.resolve||function(){return!0},this.construct=n.construct||function(i){return i},this.instanceOf=n.instanceOf||null,this.predicate=n.predicate||null,this.represent=n.represent||null,this.representName=n.representName||null,this.defaultStyle=n.defaultStyle||null,this.multi=n.multi||!1,this.styleAliases=Gi(n.styleAliases||null),zi.indexOf(this.kind)===-1)throw new k(\'Unknown kind "\'+this.kind+\'" is specified for "\'+e+\'" YAML type.\')}var O=Ji;function kn(e,n){var i=[];return e[n].forEach(function(r){var l=i.length;i.forEach(function(t,o){t.tag===r.tag&&t.kind===r.kind&&t.multi===r.multi&&(l=o)}),i[l]=r}),i}function Ki(){var e={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},n,i;function r(l){l.multi?(e.multi[l.kind].push(l),e.multi.fallback.push(l)):e[l.kind][l.tag]=e.fallback[l.tag]=l}for(n=0,i=arguments.length;n<i;n+=1)arguments[n].forEach(r);return e}function Je(e){return this.extend(e)}Je.prototype.extend=function(n){var i=[],r=[];if(n instanceof O)r.push(n);else if(Array.isArray(n))r=r.concat(n);else if(n&&(Array.isArray(n.implicit)||Array.isArray(n.explicit)))n.implicit&&(i=i.concat(n.implicit)),n.explicit&&(r=r.concat(n.explicit));else throw new k("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");i.forEach(function(t){if(!(t instanceof O))throw new k("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(t.loadKind&&t.loadKind!=="scalar")throw new k("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(t.multi)throw new k("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),r.forEach(function(t){if(!(t instanceof O))throw new k("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var l=Object.create(Je.prototype);return l.implicit=(this.implicit||[]).concat(i),l.explicit=(this.explicit||[]).concat(r),l.compiledImplicit=kn(l,"implicit"),l.compiledExplicit=kn(l,"explicit"),l.compiledTypeMap=Ki(l.compiledImplicit,l.compiledExplicit),l};var Qi=Je,Xi=new O("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return e!==null?e:""}}),Vi=new O("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return e!==null?e:[]}}),Zi=new O("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return e!==null?e:{}}}),er=new Qi({explicit:[Xi,Vi,Zi]});function nr(e){if(e===null)return!0;var n=e.length;return n===1&&e==="~"||n===4&&(e==="null"||e==="Null"||e==="NULL")}function ir(){return null}function rr(e){return e===null}var lr=new O("tag:yaml.org,2002:null",{kind:"scalar",resolve:nr,construct:ir,predicate:rr,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});function or(e){if(e===null)return!1;var n=e.length;return n===4&&(e==="true"||e==="True"||e==="TRUE")||n===5&&(e==="false"||e==="False"||e==="FALSE")}function tr(e){return e==="true"||e==="True"||e==="TRUE"}function ur(e){return Object.prototype.toString.call(e)==="[object Boolean]"}var fr=new O("tag:yaml.org,2002:bool",{kind:"scalar",resolve:or,construct:tr,predicate:ur,represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"});function cr(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function ar(e){return 48<=e&&e<=55}function sr(e){return 48<=e&&e<=57}function pr(e){if(e===null)return!1;var n=e.length,i=0,r=!1,l;if(!n)return!1;if(l=e[i],(l==="-"||l==="+")&&(l=e[++i]),l==="0"){if(i+1===n)return!0;if(l=e[++i],l==="b"){for(i++;i<n;i++)if(l=e[i],l!=="_"){if(l!=="0"&&l!=="1")return!1;r=!0}return r&&l!=="_"}if(l==="x"){for(i++;i<n;i++)if(l=e[i],l!=="_"){if(!cr(e.charCodeAt(i)))return!1;r=!0}return r&&l!=="_"}if(l==="o"){for(i++;i<n;i++)if(l=e[i],l!=="_"){if(!ar(e.charCodeAt(i)))return!1;r=!0}return r&&l!=="_"}}if(l==="_")return!1;for(;i<n;i++)if(l=e[i],l!=="_"){if(!sr(e.charCodeAt(i)))return!1;r=!0}return!(!r||l==="_")}function dr(e){var n=e,i=1,r;if(n.indexOf("_")!==-1&&(n=n.replace(/_/g,"")),r=n[0],(r==="-"||r==="+")&&(r==="-"&&(i=-1),n=n.slice(1),r=n[0]),n==="0")return 0;if(r==="0"){if(n[1]==="b")return i*parseInt(n.slice(2),2);if(n[1]==="x")return i*parseInt(n.slice(2),16);if(n[1]==="o")return i*parseInt(n.slice(2),8)}return i*parseInt(n,10)}function hr(e){return Object.prototype.toString.call(e)==="[object Number]"&&e%1===0&&!L.isNegativeZero(e)}var mr=new O("tag:yaml.org,2002:int",{kind:"scalar",resolve:pr,construct:dr,predicate:hr,represent:{binary:function(e){return e>=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},octal:function(e){return e>=0?"0o"+e.toString(8):"-0o"+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),gr=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\\\.(?:inf|Inf|INF)|\\\\.(?:nan|NaN|NAN))$");function xr(e){return!(e===null||!gr.test(e)||e[e.length-1]==="_")}function vr(e){var n,i;return n=e.replace(/_/g,"").toLowerCase(),i=n[0]==="-"?-1:1,"+-".indexOf(n[0])>=0&&(n=n.slice(1)),n===".inf"?i===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:n===".nan"?NaN:i*parseFloat(n,10)}var yr=/^[-+]?[0-9]+e/;function Ar(e,n){var i;if(isNaN(e))switch(n){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(n){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(n){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(L.isNegativeZero(e))return"-0.0";return i=e.toString(10),yr.test(i)?i.replace("e",".e"):i}function wr(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||L.isNegativeZero(e))}var Cr=new O("tag:yaml.org,2002:float",{kind:"scalar",resolve:xr,construct:vr,predicate:wr,represent:Ar,defaultStyle:"lowercase"}),Er=er.extend({implicit:[lr,fr,mr,Cr]}),Sr=Er,Jn=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),Kn=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\\\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\\\.([0-9]*))?(?:[ \\\\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function br(e){return e===null?!1:Jn.exec(e)!==null||Kn.exec(e)!==null}function _r(e){var n,i,r,l,t,o,u,f=0,c=null,s,a,p;if(n=Jn.exec(e),n===null&&(n=Kn.exec(e)),n===null)throw new Error("Date resolve error");if(i=+n[1],r=+n[2]-1,l=+n[3],!n[4])return new Date(Date.UTC(i,r,l));if(t=+n[4],o=+n[5],u=+n[6],n[7]){for(f=n[7].slice(0,3);f.length<3;)f+="0";f=+f}return n[9]&&(s=+n[10],a=+(n[11]||0),c=(s*60+a)*6e4,n[9]==="-"&&(c=-c)),p=new Date(Date.UTC(i,r,l,t,o,u,f)),c&&p.setTime(p.getTime()-c),p}function Lr(e){return e.toISOString()}var Fr=new O("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:br,construct:_r,instanceOf:Date,represent:Lr});function Or(e){return e==="<<"||e===null}var Ir=new O("tag:yaml.org,2002:merge",{kind:"scalar",resolve:Or}),Ze=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\\r`;function kr(e){if(e===null)return!1;var n,i,r=0,l=e.length,t=Ze;for(i=0;i<l;i++)if(n=t.indexOf(e.charAt(i)),!(n>64)){if(n<0)return!1;r+=6}return r%8===0}function Tr(e){var n,i,r=e.replace(/[\\r\\n=]/g,""),l=r.length,t=Ze,o=0,u=[];for(n=0;n<l;n++)n%4===0&&n&&(u.push(o>>16&255),u.push(o>>8&255),u.push(o&255)),o=o<<6|t.indexOf(r.charAt(n));return i=l%4*6,i===0?(u.push(o>>16&255),u.push(o>>8&255),u.push(o&255)):i===18?(u.push(o>>10&255),u.push(o>>2&255)):i===12&&u.push(o>>4&255),new Uint8Array(u)}function Nr(e){var n="",i=0,r,l,t=e.length,o=Ze;for(r=0;r<t;r++)r%3===0&&r&&(n+=o[i>>18&63],n+=o[i>>12&63],n+=o[i>>6&63],n+=o[i&63]),i=(i<<8)+e[r];return l=t%3,l===0?(n+=o[i>>18&63],n+=o[i>>12&63],n+=o[i>>6&63],n+=o[i&63]):l===2?(n+=o[i>>10&63],n+=o[i>>4&63],n+=o[i<<2&63],n+=o[64]):l===1&&(n+=o[i>>2&63],n+=o[i<<4&63],n+=o[64],n+=o[64]),n}function Dr(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}var Rr=new O("tag:yaml.org,2002:binary",{kind:"scalar",resolve:kr,construct:Tr,predicate:Dr,represent:Nr}),Mr=Object.prototype.hasOwnProperty,Pr=Object.prototype.toString;function Wr(e){if(e===null)return!0;var n=[],i,r,l,t,o,u=e;for(i=0,r=u.length;i<r;i+=1){if(l=u[i],o=!1,Pr.call(l)!=="[object Object]")return!1;for(t in l)if(Mr.call(l,t))if(!o)o=!0;else return!1;if(!o)return!1;if(n.indexOf(t)===-1)n.push(t);else return!1}return!0}function Hr(e){return e!==null?e:[]}var jr=new O("tag:yaml.org,2002:omap",{kind:"sequence",resolve:Wr,construct:Hr}),Br=Object.prototype.toString;function Ur(e){if(e===null)return!0;var n,i,r,l,t,o=e;for(t=new Array(o.length),n=0,i=o.length;n<i;n+=1){if(r=o[n],Br.call(r)!=="[object Object]"||(l=Object.keys(r),l.length!==1))return!1;t[n]=[l[0],r[l[0]]]}return!0}function Yr(e){if(e===null)return[];var n,i,r,l,t,o=e;for(t=new Array(o.length),n=0,i=o.length;n<i;n+=1)r=o[n],l=Object.keys(r),t[n]=[l[0],r[l[0]]];return t}var $r=new O("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:Ur,construct:Yr}),qr=Object.prototype.hasOwnProperty;function zr(e){if(e===null)return!0;var n,i=e;for(n in i)if(qr.call(i,n)&&i[n]!==null)return!1;return!0}function Gr(e){return e!==null?e:{}}var Jr=new O("tag:yaml.org,2002:set",{kind:"mapping",resolve:zr,construct:Gr}),Qn=Sr.extend({implicit:[Fr,Ir],explicit:[Rr,jr,$r,Jr]}),j=Object.prototype.hasOwnProperty,se=1,Xn=2,Vn=3,pe=4,Ge=1,Kr=2,Tn=3,Qr=/[\\x00-\\x08\\x0B\\x0C\\x0E-\\x1F\\x7F-\\x84\\x86-\\x9F\\uFFFE\\uFFFF]|[\\uD800-\\uDBFF](?![\\uDC00-\\uDFFF])|(?:[^\\uD800-\\uDBFF]|^)[\\uDC00-\\uDFFF]/,Xr=/[\\x85\\u2028\\u2029]/,Vr=/[,\\[\\]\\{\\}]/,Zn=/^(?:!|!!|![a-z\\-]+!)$/i,ei=/^(?:!|[^,\\[\\]\\{\\}])(?:%[0-9a-f]{2}|[0-9a-z\\-#;\\/\\?:@&=\\+\\$,_\\.!~\\*\'\\(\\)\\[\\]])*$/i;function Nn(e){return Object.prototype.toString.call(e)}function R(e){return e===10||e===13}function Y(e){return e===9||e===32}function T(e){return e===9||e===32||e===10||e===13}function J(e){return e===44||e===91||e===93||e===123||e===125}function Zr(e){var n;return 48<=e&&e<=57?e-48:(n=e|32,97<=n&&n<=102?n-97+10:-1)}function el(e){return e===120?2:e===117?4:e===85?8:0}function nl(e){return 48<=e&&e<=57?e-48:-1}function Dn(e){return e===48?"\\0":e===97?"\\x07":e===98?"\\b":e===116||e===9?" ":e===110?`\n`:e===118?"\\v":e===102?"\\f":e===114?"\\r":e===101?"\\x1B":e===32?" ":e===34?\'"\':e===47?"/":e===92?"\\\\":e===78?"\\x85":e===95?"\\xA0":e===76?"\\u2028":e===80?"\\u2029":""}function il(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}function ni(e,n,i){n==="__proto__"?Object.defineProperty(e,n,{configurable:!0,enumerable:!0,writable:!0,value:i}):e[n]=i}var ii=new Array(256),ri=new Array(256);for(U=0;U<256;U++)ii[U]=Dn(U)?1:0,ri[U]=Dn(U);var U;function rl(e,n){this.input=e,this.filename=n.filename||null,this.schema=n.schema||Qn,this.onWarning=n.onWarning||null,this.legacy=n.legacy||!1,this.json=n.json||!1,this.listener=n.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function li(e,n){var i={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return i.snippet=$i(i),new k(n,i)}function v(e,n){throw li(e,n)}function de(e,n){e.onWarning&&e.onWarning.call(null,li(e,n))}var Rn={YAML:function(n,i,r){var l,t,o;n.version!==null&&v(n,"duplication of %YAML directive"),r.length!==1&&v(n,"YAML directive accepts exactly one argument"),l=/^([0-9]+)\\.([0-9]+)$/.exec(r[0]),l===null&&v(n,"ill-formed argument of the YAML directive"),t=parseInt(l[1],10),o=parseInt(l[2],10),t!==1&&v(n,"unacceptable YAML version of the document"),n.version=r[0],n.checkLineBreaks=o<2,o!==1&&o!==2&&de(n,"unsupported YAML version of the document")},TAG:function(n,i,r){var l,t;r.length!==2&&v(n,"TAG directive accepts exactly two arguments"),l=r[0],t=r[1],Zn.test(l)||v(n,"ill-formed tag handle (first argument) of the TAG directive"),j.call(n.tagMap,l)&&v(n,\'there is a previously declared suffix for "\'+l+\'" tag handle\'),ei.test(t)||v(n,"ill-formed tag prefix (second argument) of the TAG directive");try{t=decodeURIComponent(t)}catch{v(n,"tag prefix is malformed: "+t)}n.tagMap[l]=t}};function H(e,n,i,r){var l,t,o,u;if(n<i){if(u=e.input.slice(n,i),r)for(l=0,t=u.length;l<t;l+=1)o=u.charCodeAt(l),o===9||32<=o&&o<=1114111||v(e,"expected valid JSON character");else Qr.test(u)&&v(e,"the stream contains non-printable characters");e.result+=u}}function Mn(e,n,i,r){var l,t,o,u;for(L.isObject(i)||v(e,"cannot merge mappings; the provided source object is unacceptable"),l=Object.keys(i),o=0,u=l.length;o<u;o+=1)t=l[o],j.call(n,t)||(ni(n,t,i[t]),r[t]=!0)}function K(e,n,i,r,l,t,o,u,f){var c,s;if(Array.isArray(l))for(l=Array.prototype.slice.call(l),c=0,s=l.length;c<s;c+=1)Array.isArray(l[c])&&v(e,"nested arrays are not supported inside keys"),typeof l=="object"&&Nn(l[c])==="[object Object]"&&(l[c]="[object Object]");if(typeof l=="object"&&Nn(l)==="[object Object]"&&(l="[object Object]"),l=String(l),n===null&&(n={}),r==="tag:yaml.org,2002:merge")if(Array.isArray(t))for(c=0,s=t.length;c<s;c+=1)Mn(e,n,t[c],i);else Mn(e,n,t,i);else!e.json&&!j.call(i,l)&&j.call(n,l)&&(e.line=o||e.line,e.lineStart=u||e.lineStart,e.position=f||e.position,v(e,"duplicated mapping key")),ni(n,l,t),delete i[l];return n}function en(e){var n;n=e.input.charCodeAt(e.position),n===10?e.position++:n===13?(e.position++,e.input.charCodeAt(e.position)===10&&e.position++):v(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}function _(e,n,i){for(var r=0,l=e.input.charCodeAt(e.position);l!==0;){for(;Y(l);)l===9&&e.firstTabInLine===-1&&(e.firstTabInLine=e.position),l=e.input.charCodeAt(++e.position);if(n&&l===35)do l=e.input.charCodeAt(++e.position);while(l!==10&&l!==13&&l!==0);if(R(l))for(en(e),l=e.input.charCodeAt(e.position),r++,e.lineIndent=0;l===32;)e.lineIndent++,l=e.input.charCodeAt(++e.position);else break}return i!==-1&&r!==0&&e.lineIndent<i&&de(e,"deficient indentation"),r}function ge(e){var n=e.position,i;return i=e.input.charCodeAt(n),!!((i===45||i===46)&&i===e.input.charCodeAt(n+1)&&i===e.input.charCodeAt(n+2)&&(n+=3,i=e.input.charCodeAt(n),i===0||T(i)))}function nn(e,n){n===1?e.result+=" ":n>1&&(e.result+=L.repeat(`\n`,n-1))}function ll(e,n,i){var r,l,t,o,u,f,c,s,a=e.kind,p=e.result,d;if(d=e.input.charCodeAt(e.position),T(d)||J(d)||d===35||d===38||d===42||d===33||d===124||d===62||d===39||d===34||d===37||d===64||d===96||(d===63||d===45)&&(l=e.input.charCodeAt(e.position+1),T(l)||i&&J(l)))return!1;for(e.kind="scalar",e.result="",t=o=e.position,u=!1;d!==0;){if(d===58){if(l=e.input.charCodeAt(e.position+1),T(l)||i&&J(l))break}else if(d===35){if(r=e.input.charCodeAt(e.position-1),T(r))break}else{if(e.position===e.lineStart&&ge(e)||i&&J(d))break;if(R(d))if(f=e.line,c=e.lineStart,s=e.lineIndent,_(e,!1,-1),e.lineIndent>=n){u=!0,d=e.input.charCodeAt(e.position);continue}else{e.position=o,e.line=f,e.lineStart=c,e.lineIndent=s;break}}u&&(H(e,t,o,!1),nn(e,e.line-f),t=o=e.position,u=!1),Y(d)||(o=e.position+1),d=e.input.charCodeAt(++e.position)}return H(e,t,o,!1),e.result?!0:(e.kind=a,e.result=p,!1)}function ol(e,n){var i,r,l;if(i=e.input.charCodeAt(e.position),i!==39)return!1;for(e.kind="scalar",e.result="",e.position++,r=l=e.position;(i=e.input.charCodeAt(e.position))!==0;)if(i===39)if(H(e,r,e.position,!0),i=e.input.charCodeAt(++e.position),i===39)r=e.position,e.position++,l=e.position;else return!0;else R(i)?(H(e,r,l,!0),nn(e,_(e,!1,n)),r=l=e.position):e.position===e.lineStart&&ge(e)?v(e,"unexpected end of the document within a single quoted scalar"):(e.position++,l=e.position);v(e,"unexpected end of the stream within a single quoted scalar")}function tl(e,n){var i,r,l,t,o,u;if(u=e.input.charCodeAt(e.position),u!==34)return!1;for(e.kind="scalar",e.result="",e.position++,i=r=e.position;(u=e.input.charCodeAt(e.position))!==0;){if(u===34)return H(e,i,e.position,!0),e.position++,!0;if(u===92){if(H(e,i,e.position,!0),u=e.input.charCodeAt(++e.position),R(u))_(e,!1,n);else if(u<256&&ii[u])e.result+=ri[u],e.position++;else if((o=el(u))>0){for(l=o,t=0;l>0;l--)u=e.input.charCodeAt(++e.position),(o=Zr(u))>=0?t=(t<<4)+o:v(e,"expected hexadecimal character");e.result+=il(t),e.position++}else v(e,"unknown escape sequence");i=r=e.position}else R(u)?(H(e,i,r,!0),nn(e,_(e,!1,n)),i=r=e.position):e.position===e.lineStart&&ge(e)?v(e,"unexpected end of the document within a double quoted scalar"):(e.position++,r=e.position)}v(e,"unexpected end of the stream within a double quoted scalar")}function ul(e,n){var i=!0,r,l,t,o=e.tag,u,f=e.anchor,c,s,a,p,d,h=Object.create(null),g,y,w,m;if(m=e.input.charCodeAt(e.position),m===91)s=93,d=!1,u=[];else if(m===123)s=125,d=!0,u={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=u),m=e.input.charCodeAt(++e.position);m!==0;){if(_(e,!0,n),m=e.input.charCodeAt(e.position),m===s)return e.position++,e.tag=o,e.anchor=f,e.kind=d?"mapping":"sequence",e.result=u,!0;i?m===44&&v(e,"expected the node content, but found \',\'"):v(e,"missed comma between flow collection entries"),y=g=w=null,a=p=!1,m===63&&(c=e.input.charCodeAt(e.position+1),T(c)&&(a=p=!0,e.position++,_(e,!0,n))),r=e.line,l=e.lineStart,t=e.position,Q(e,n,se,!1,!0),y=e.tag,g=e.result,_(e,!0,n),m=e.input.charCodeAt(e.position),(p||e.line===r)&&m===58&&(a=!0,m=e.input.charCodeAt(++e.position),_(e,!0,n),Q(e,n,se,!1,!0),w=e.result),d?K(e,u,h,y,g,w,r,l,t):a?u.push(K(e,null,h,y,g,w,r,l,t)):u.push(g),_(e,!0,n),m=e.input.charCodeAt(e.position),m===44?(i=!0,m=e.input.charCodeAt(++e.position)):i=!1}v(e,"unexpected end of the stream within a flow collection")}function fl(e,n){var i,r,l=Ge,t=!1,o=!1,u=n,f=0,c=!1,s,a;if(a=e.input.charCodeAt(e.position),a===124)r=!1;else if(a===62)r=!0;else return!1;for(e.kind="scalar",e.result="";a!==0;)if(a=e.input.charCodeAt(++e.position),a===43||a===45)Ge===l?l=a===43?Tn:Kr:v(e,"repeat of a chomping mode identifier");else if((s=nl(a))>=0)s===0?v(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):o?v(e,"repeat of an indentation width identifier"):(u=n+s-1,o=!0);else break;if(Y(a)){do a=e.input.charCodeAt(++e.position);while(Y(a));if(a===35)do a=e.input.charCodeAt(++e.position);while(!R(a)&&a!==0)}for(;a!==0;){for(en(e),e.lineIndent=0,a=e.input.charCodeAt(e.position);(!o||e.lineIndent<u)&&a===32;)e.lineIndent++,a=e.input.charCodeAt(++e.position);if(!o&&e.lineIndent>u&&(u=e.lineIndent),R(a)){f++;continue}if(e.lineIndent<u){l===Tn?e.result+=L.repeat(`\n`,t?1+f:f):l===Ge&&t&&(e.result+=`\n`);break}for(r?Y(a)?(c=!0,e.result+=L.repeat(`\n`,t?1+f:f)):c?(c=!1,e.result+=L.repeat(`\n`,f+1)):f===0?t&&(e.result+=" "):e.result+=L.repeat(`\n`,f):e.result+=L.repeat(`\n`,t?1+f:f),t=!0,o=!0,f=0,i=e.position;!R(a)&&a!==0;)a=e.input.charCodeAt(++e.position);H(e,i,e.position,!1)}return!0}function Pn(e,n){var i,r=e.tag,l=e.anchor,t=[],o,u=!1,f;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=t),f=e.input.charCodeAt(e.position);f!==0&&(e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,v(e,"tab characters must not be used in indentation")),!(f!==45||(o=e.input.charCodeAt(e.position+1),!T(o))));){if(u=!0,e.position++,_(e,!0,-1)&&e.lineIndent<=n){t.push(null),f=e.input.charCodeAt(e.position);continue}if(i=e.line,Q(e,n,Vn,!1,!0),t.push(e.result),_(e,!0,-1),f=e.input.charCodeAt(e.position),(e.line===i||e.lineIndent>n)&&f!==0)v(e,"bad indentation of a sequence entry");else if(e.lineIndent<n)break}return u?(e.tag=r,e.anchor=l,e.kind="sequence",e.result=t,!0):!1}function cl(e,n,i){var r,l,t,o,u,f,c=e.tag,s=e.anchor,a={},p=Object.create(null),d=null,h=null,g=null,y=!1,w=!1,m;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=a),m=e.input.charCodeAt(e.position);m!==0;){if(!y&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,v(e,"tab characters must not be used in indentation")),r=e.input.charCodeAt(e.position+1),t=e.line,(m===63||m===58)&&T(r))m===63?(y&&(K(e,a,p,d,h,null,o,u,f),d=h=g=null),w=!0,y=!0,l=!0):y?(y=!1,l=!0):v(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,m=r;else{if(o=e.line,u=e.lineStart,f=e.position,!Q(e,i,Xn,!1,!0))break;if(e.line===t){for(m=e.input.charCodeAt(e.position);Y(m);)m=e.input.charCodeAt(++e.position);if(m===58)m=e.input.charCodeAt(++e.position),T(m)||v(e,"a whitespace character is expected after the key-value separator within a block mapping"),y&&(K(e,a,p,d,h,null,o,u,f),d=h=g=null),w=!0,y=!1,l=!1,d=e.tag,h=e.result;else if(w)v(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=c,e.anchor=s,!0}else if(w)v(e,"can not read a block mapping entry; a multiline key may not be an implicit key");else return e.tag=c,e.anchor=s,!0}if((e.line===t||e.lineIndent>n)&&(y&&(o=e.line,u=e.lineStart,f=e.position),Q(e,n,pe,!0,l)&&(y?h=e.result:g=e.result),y||(K(e,a,p,d,h,g,o,u,f),d=h=g=null),_(e,!0,-1),m=e.input.charCodeAt(e.position)),(e.line===t||e.lineIndent>n)&&m!==0)v(e,"bad indentation of a mapping entry");else if(e.lineIndent<n)break}return y&&K(e,a,p,d,h,null,o,u,f),w&&(e.tag=c,e.anchor=s,e.kind="mapping",e.result=a),w}function al(e){var n,i=!1,r=!1,l,t,o;if(o=e.input.charCodeAt(e.position),o!==33)return!1;if(e.tag!==null&&v(e,"duplication of a tag property"),o=e.input.charCodeAt(++e.position),o===60?(i=!0,o=e.input.charCodeAt(++e.position)):o===33?(r=!0,l="!!",o=e.input.charCodeAt(++e.position)):l="!",n=e.position,i){do o=e.input.charCodeAt(++e.position);while(o!==0&&o!==62);e.position<e.length?(t=e.input.slice(n,e.position),o=e.input.charCodeAt(++e.position)):v(e,"unexpected end of the stream within a verbatim tag")}else{for(;o!==0&&!T(o);)o===33&&(r?v(e,"tag suffix cannot contain exclamation marks"):(l=e.input.slice(n-1,e.position+1),Zn.test(l)||v(e,"named tag handle cannot contain such characters"),r=!0,n=e.position+1)),o=e.input.charCodeAt(++e.position);t=e.input.slice(n,e.position),Vr.test(t)&&v(e,"tag suffix cannot contain flow indicator characters")}t&&!ei.test(t)&&v(e,"tag name cannot contain such characters: "+t);try{t=decodeURIComponent(t)}catch{v(e,"tag name is malformed: "+t)}return i?e.tag=t:j.call(e.tagMap,l)?e.tag=e.tagMap[l]+t:l==="!"?e.tag="!"+t:l==="!!"?e.tag="tag:yaml.org,2002:"+t:v(e,\'undeclared tag handle "\'+l+\'"\'),!0}function sl(e){var n,i;if(i=e.input.charCodeAt(e.position),i!==38)return!1;for(e.anchor!==null&&v(e,"duplication of an anchor property"),i=e.input.charCodeAt(++e.position),n=e.position;i!==0&&!T(i)&&!J(i);)i=e.input.charCodeAt(++e.position);return e.position===n&&v(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(n,e.position),!0}function pl(e){var n,i,r;if(r=e.input.charCodeAt(e.position),r!==42)return!1;for(r=e.input.charCodeAt(++e.position),n=e.position;r!==0&&!T(r)&&!J(r);)r=e.input.charCodeAt(++e.position);return e.position===n&&v(e,"name of an alias node must contain at least one character"),i=e.input.slice(n,e.position),j.call(e.anchorMap,i)||v(e,\'unidentified alias "\'+i+\'"\'),e.result=e.anchorMap[i],_(e,!0,-1),!0}function Q(e,n,i,r,l){var t,o,u,f=1,c=!1,s=!1,a,p,d,h,g,y;if(e.listener!==null&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,t=o=u=pe===i||Vn===i,r&&_(e,!0,-1)&&(c=!0,e.lineIndent>n?f=1:e.lineIndent===n?f=0:e.lineIndent<n&&(f=-1)),f===1)for(;al(e)||sl(e);)_(e,!0,-1)?(c=!0,u=t,e.lineIndent>n?f=1:e.lineIndent===n?f=0:e.lineIndent<n&&(f=-1)):u=!1;if(u&&(u=c||l),(f===1||pe===i)&&(se===i||Xn===i?g=n:g=n+1,y=e.position-e.lineStart,f===1?u&&(Pn(e,y)||cl(e,y,g))||ul(e,g)?s=!0:(o&&fl(e,g)||ol(e,g)||tl(e,g)?s=!0:pl(e)?(s=!0,(e.tag!==null||e.anchor!==null)&&v(e,"alias node should not have any properties")):ll(e,g,se===i)&&(s=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):f===0&&(s=u&&Pn(e,y))),e.tag===null)e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);else if(e.tag==="?"){for(e.result!==null&&e.kind!=="scalar"&&v(e,\'unacceptable node kind for !<?> tag; it should be "scalar", not "\'+e.kind+\'"\'),a=0,p=e.implicitTypes.length;a<p;a+=1)if(h=e.implicitTypes[a],h.resolve(e.result)){e.result=h.construct(e.result),e.tag=h.tag,e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);break}}else if(e.tag!=="!"){if(j.call(e.typeMap[e.kind||"fallback"],e.tag))h=e.typeMap[e.kind||"fallback"][e.tag];else for(h=null,d=e.typeMap.multi[e.kind||"fallback"],a=0,p=d.length;a<p;a+=1)if(e.tag.slice(0,d[a].tag.length)===d[a].tag){h=d[a];break}h||v(e,"unknown tag !<"+e.tag+">"),e.result!==null&&h.kind!==e.kind&&v(e,"unacceptable node kind for !<"+e.tag+\'> tag; it should be "\'+h.kind+\'", not "\'+e.kind+\'"\'),h.resolve(e.result,e.tag)?(e.result=h.construct(e.result,e.tag),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):v(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return e.listener!==null&&e.listener("close",e),e.tag!==null||e.anchor!==null||s}function dl(e){var n=e.position,i,r,l,t=!1,o;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);(o=e.input.charCodeAt(e.position))!==0&&(_(e,!0,-1),o=e.input.charCodeAt(e.position),!(e.lineIndent>0||o!==37));){for(t=!0,o=e.input.charCodeAt(++e.position),i=e.position;o!==0&&!T(o);)o=e.input.charCodeAt(++e.position);for(r=e.input.slice(i,e.position),l=[],r.length<1&&v(e,"directive name must not be less than one character in length");o!==0;){for(;Y(o);)o=e.input.charCodeAt(++e.position);if(o===35){do o=e.input.charCodeAt(++e.position);while(o!==0&&!R(o));break}if(R(o))break;for(i=e.position;o!==0&&!T(o);)o=e.input.charCodeAt(++e.position);l.push(e.input.slice(i,e.position))}o!==0&&en(e),j.call(Rn,r)?Rn[r](e,r,l):de(e,\'unknown document directive "\'+r+\'"\')}if(_(e,!0,-1),e.lineIndent===0&&e.input.charCodeAt(e.position)===45&&e.input.charCodeAt(e.position+1)===45&&e.input.charCodeAt(e.position+2)===45?(e.position+=3,_(e,!0,-1)):t&&v(e,"directives end mark is expected"),Q(e,e.lineIndent-1,pe,!1,!0),_(e,!0,-1),e.checkLineBreaks&&Xr.test(e.input.slice(n,e.position))&&de(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&ge(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,_(e,!0,-1));return}if(e.position<e.length-1)v(e,"end of the stream or a document separator is expected");else return}function oi(e,n){e=String(e),n=n||{},e.length!==0&&(e.charCodeAt(e.length-1)!==10&&e.charCodeAt(e.length-1)!==13&&(e+=`\n`),e.charCodeAt(0)===65279&&(e=e.slice(1)));var i=new rl(e,n),r=e.indexOf("\\0");for(r!==-1&&(i.position=r,v(i,"null byte is not allowed in input")),i.input+="\\0";i.input.charCodeAt(i.position)===32;)i.lineIndent+=1,i.position+=1;for(;i.position<i.length-1;)dl(i);return i.documents}function hl(e,n,i){n!==null&&typeof n=="object"&&typeof i>"u"&&(i=n,n=null);var r=oi(e,i);if(typeof n!="function")return r;for(var l=0,t=r.length;l<t;l+=1)n(r[l])}function ml(e,n){var i=oi(e,n);if(i.length!==0){if(i.length===1)return i[0];throw new k("expected a single document in the stream, but found more")}}var gl=hl,xl=ml,ti={loadAll:gl,load:xl},ui=Object.prototype.toString,fi=Object.prototype.hasOwnProperty,rn=65279,vl=9,re=10,yl=13,Al=32,wl=33,Cl=34,Ke=35,El=37,Sl=38,bl=39,_l=42,ci=44,Ll=45,he=58,Fl=61,Ol=62,Il=63,kl=64,ai=91,si=93,Tl=96,pi=123,Nl=124,di=125,I={};I[0]="\\\\0";I[7]="\\\\a";I[8]="\\\\b";I[9]="\\\\t";I[10]="\\\\n";I[11]="\\\\v";I[12]="\\\\f";I[13]="\\\\r";I[27]="\\\\e";I[34]=\'\\\\"\';I[92]="\\\\\\\\";I[133]="\\\\N";I[160]="\\\\_";I[8232]="\\\\L";I[8233]="\\\\P";var Dl=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],Rl=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\\.[0-9_]*)?$/;function Ml(e,n){var i,r,l,t,o,u,f;if(n===null)return{};for(i={},r=Object.keys(n),l=0,t=r.length;l<t;l+=1)o=r[l],u=String(n[o]),o.slice(0,2)==="!!"&&(o="tag:yaml.org,2002:"+o.slice(2)),f=e.compiledTypeMap.fallback[o],f&&fi.call(f.styleAliases,u)&&(u=f.styleAliases[u]),i[o]=u;return i}function Pl(e){var n,i,r;if(n=e.toString(16).toUpperCase(),e<=255)i="x",r=2;else if(e<=65535)i="u",r=4;else if(e<=4294967295)i="U",r=8;else throw new k("code point within a string may not be greater than 0xFFFFFFFF");return"\\\\"+i+L.repeat("0",r-n.length)+n}var Wl=1,le=2;function Hl(e){this.schema=e.schema||Qn,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=L.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=Ml(this.schema,e.styles||null),this.sortKeys=e.sortKeys||!1,this.lineWidth=e.lineWidth||80,this.noRefs=e.noRefs||!1,this.noCompatMode=e.noCompatMode||!1,this.condenseFlow=e.condenseFlow||!1,this.quotingType=e.quotingType===\'"\'?le:Wl,this.forceQuotes=e.forceQuotes||!1,this.replacer=typeof e.replacer=="function"?e.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function Wn(e,n){for(var i=L.repeat(" ",n),r=0,l=-1,t="",o,u=e.length;r<u;)l=e.indexOf(`\n`,r),l===-1?(o=e.slice(r),r=u):(o=e.slice(r,l+1),r=l+1),o.length&&o!==`\n`&&(t+=i),t+=o;return t}function Qe(e,n){return`\n`+L.repeat(" ",e.indent*n)}function jl(e,n){var i,r,l;for(i=0,r=e.implicitTypes.length;i<r;i+=1)if(l=e.implicitTypes[i],l.resolve(n))return!0;return!1}function me(e){return e===Al||e===vl}function oe(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==rn||65536<=e&&e<=1114111}function Hn(e){return oe(e)&&e!==rn&&e!==yl&&e!==re}function jn(e,n,i){var r=Hn(e),l=r&&!me(e);return(i?r:r&&e!==ci&&e!==ai&&e!==si&&e!==pi&&e!==di)&&e!==Ke&&!(n===he&&!l)||Hn(n)&&!me(n)&&e===Ke||n===he&&l}function Bl(e){return oe(e)&&e!==rn&&!me(e)&&e!==Ll&&e!==Il&&e!==he&&e!==ci&&e!==ai&&e!==si&&e!==pi&&e!==di&&e!==Ke&&e!==Sl&&e!==_l&&e!==wl&&e!==Nl&&e!==Fl&&e!==Ol&&e!==bl&&e!==Cl&&e!==El&&e!==kl&&e!==Tl}function Ul(e){return!me(e)&&e!==he}function ne(e,n){var i=e.charCodeAt(n),r;return i>=55296&&i<=56319&&n+1<e.length&&(r=e.charCodeAt(n+1),r>=56320&&r<=57343)?(i-55296)*1024+r-56320+65536:i}function hi(e){var n=/^\\n* /;return n.test(e)}var mi=1,Xe=2,gi=3,xi=4,G=5;function Yl(e,n,i,r,l,t,o,u){var f,c=0,s=null,a=!1,p=!1,d=r!==-1,h=-1,g=Bl(ne(e,0))&&Ul(ne(e,e.length-1));if(n||o)for(f=0;f<e.length;c>=65536?f+=2:f++){if(c=ne(e,f),!oe(c))return G;g=g&&jn(c,s,u),s=c}else{for(f=0;f<e.length;c>=65536?f+=2:f++){if(c=ne(e,f),c===re)a=!0,d&&(p=p||f-h-1>r&&e[h+1]!==" ",h=f);else if(!oe(c))return G;g=g&&jn(c,s,u),s=c}p=p||d&&f-h-1>r&&e[h+1]!==" "}return!a&&!p?g&&!o&&!l(e)?mi:t===le?G:Xe:i>9&&hi(e)?G:o?t===le?G:Xe:p?xi:gi}function $l(e,n,i,r,l){e.dump=(function(){if(n.length===0)return e.quotingType===le?\'""\':"\'\'";if(!e.noCompatMode&&(Dl.indexOf(n)!==-1||Rl.test(n)))return e.quotingType===le?\'"\'+n+\'"\':"\'"+n+"\'";var t=e.indent*Math.max(1,i),o=e.lineWidth===-1?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-t),u=r||e.flowLevel>-1&&i>=e.flowLevel;function f(c){return jl(e,c)}switch(Yl(n,u,e.indent,o,f,e.quotingType,e.forceQuotes&&!r,l)){case mi:return n;case Xe:return"\'"+n.replace(/\'/g,"\'\'")+"\'";case gi:return"|"+Bn(n,e.indent)+Un(Wn(n,t));case xi:return">"+Bn(n,e.indent)+Un(Wn(ql(n,o),t));case G:return\'"\'+zl(n)+\'"\';default:throw new k("impossible error: invalid scalar style")}})()}function Bn(e,n){var i=hi(e)?String(n):"",r=e[e.length-1]===`\n`,l=r&&(e[e.length-2]===`\n`||e===`\n`),t=l?"+":r?"":"-";return i+t+`\n`}function Un(e){return e[e.length-1]===`\n`?e.slice(0,-1):e}function ql(e,n){for(var i=/(\\n+)([^\\n]*)/g,r=(function(){var c=e.indexOf(`\n`);return c=c!==-1?c:e.length,i.lastIndex=c,Yn(e.slice(0,c),n)})(),l=e[0]===`\n`||e[0]===" ",t,o;o=i.exec(e);){var u=o[1],f=o[2];t=f[0]===" ",r+=u+(!l&&!t&&f!==""?`\n`:"")+Yn(f,n),l=t}return r}function Yn(e,n){if(e===""||e[0]===" ")return e;for(var i=/ [^ ]/g,r,l=0,t,o=0,u=0,f="";r=i.exec(e);)u=r.index,u-l>n&&(t=o>l?o:u,f+=`\n`+e.slice(l,t),l=t+1),o=u;return f+=`\n`,e.length-l>n&&o>l?f+=e.slice(l,o)+`\n`+e.slice(o+1):f+=e.slice(l),f.slice(1)}function zl(e){for(var n="",i=0,r,l=0;l<e.length;i>=65536?l+=2:l++)i=ne(e,l),r=I[i],!r&&oe(i)?(n+=e[l],i>=65536&&(n+=e[l+1])):n+=r||Pl(i);return n}function Gl(e,n,i){var r="",l=e.tag,t,o,u;for(t=0,o=i.length;t<o;t+=1)u=i[t],e.replacer&&(u=e.replacer.call(i,String(t),u)),(P(e,n,u,!1,!1)||typeof u>"u"&&P(e,n,null,!1,!1))&&(r!==""&&(r+=","+(e.condenseFlow?"":" ")),r+=e.dump);e.tag=l,e.dump="["+r+"]"}function $n(e,n,i,r){var l="",t=e.tag,o,u,f;for(o=0,u=i.length;o<u;o+=1)f=i[o],e.replacer&&(f=e.replacer.call(i,String(o),f)),(P(e,n+1,f,!0,!0,!1,!0)||typeof f>"u"&&P(e,n+1,null,!0,!0,!1,!0))&&((!r||l!=="")&&(l+=Qe(e,n)),e.dump&&re===e.dump.charCodeAt(0)?l+="-":l+="- ",l+=e.dump);e.tag=t,e.dump=l||"[]"}function Jl(e,n,i){var r="",l=e.tag,t=Object.keys(i),o,u,f,c,s;for(o=0,u=t.length;o<u;o+=1)s="",r!==""&&(s+=", "),e.condenseFlow&&(s+=\'"\'),f=t[o],c=i[f],e.replacer&&(c=e.replacer.call(i,f,c)),P(e,n,f,!1,!1)&&(e.dump.length>1024&&(s+="? "),s+=e.dump+(e.condenseFlow?\'"\':"")+":"+(e.condenseFlow?"":" "),P(e,n,c,!1,!1)&&(s+=e.dump,r+=s));e.tag=l,e.dump="{"+r+"}"}function Kl(e,n,i,r){var l="",t=e.tag,o=Object.keys(i),u,f,c,s,a,p;if(e.sortKeys===!0)o.sort();else if(typeof e.sortKeys=="function")o.sort(e.sortKeys);else if(e.sortKeys)throw new k("sortKeys must be a boolean or a function");for(u=0,f=o.length;u<f;u+=1)p="",(!r||l!=="")&&(p+=Qe(e,n)),c=o[u],s=i[c],e.replacer&&(s=e.replacer.call(i,c,s)),P(e,n+1,c,!0,!0,!0)&&(a=e.tag!==null&&e.tag!=="?"||e.dump&&e.dump.length>1024,a&&(e.dump&&re===e.dump.charCodeAt(0)?p+="?":p+="? "),p+=e.dump,a&&(p+=Qe(e,n)),P(e,n+1,s,!0,a)&&(e.dump&&re===e.dump.charCodeAt(0)?p+=":":p+=": ",p+=e.dump,l+=p));e.tag=t,e.dump=l||"{}"}function qn(e,n,i){var r,l,t,o,u,f;for(l=i?e.explicitTypes:e.implicitTypes,t=0,o=l.length;t<o;t+=1)if(u=l[t],(u.instanceOf||u.predicate)&&(!u.instanceOf||typeof n=="object"&&n instanceof u.instanceOf)&&(!u.predicate||u.predicate(n))){if(i?u.multi&&u.representName?e.tag=u.representName(n):e.tag=u.tag:e.tag="?",u.represent){if(f=e.styleMap[u.tag]||u.defaultStyle,ui.call(u.represent)==="[object Function]")r=u.represent(n,f);else if(fi.call(u.represent,f))r=u.represent[f](n,f);else throw new k("!<"+u.tag+\'> tag resolver accepts not "\'+f+\'" style\');e.dump=r}return!0}return!1}function P(e,n,i,r,l,t,o){e.tag=null,e.dump=i,qn(e,i,!1)||qn(e,i,!0);var u=ui.call(e.dump),f=r,c;r&&(r=e.flowLevel<0||e.flowLevel>n);var s=u==="[object Object]"||u==="[object Array]",a,p;if(s&&(a=e.duplicates.indexOf(i),p=a!==-1),(e.tag!==null&&e.tag!=="?"||p||e.indent!==2&&n>0)&&(l=!1),p&&e.usedDuplicates[a])e.dump="*ref_"+a;else{if(s&&p&&!e.usedDuplicates[a]&&(e.usedDuplicates[a]=!0),u==="[object Object]")r&&Object.keys(e.dump).length!==0?(Kl(e,n,e.dump,l),p&&(e.dump="&ref_"+a+e.dump)):(Jl(e,n,e.dump),p&&(e.dump="&ref_"+a+" "+e.dump));else if(u==="[object Array]")r&&e.dump.length!==0?(e.noArrayIndent&&!o&&n>0?$n(e,n-1,e.dump,l):$n(e,n,e.dump,l),p&&(e.dump="&ref_"+a+e.dump)):(Gl(e,n,e.dump),p&&(e.dump="&ref_"+a+" "+e.dump));else if(u==="[object String]")e.tag!=="?"&&$l(e,e.dump,n,t,f);else{if(u==="[object Undefined]")return!1;if(e.skipInvalid)return!1;throw new k("unacceptable kind of an object to dump "+u)}e.tag!==null&&e.tag!=="?"&&(c=encodeURI(e.tag[0]==="!"?e.tag.slice(1):e.tag).replace(/!/g,"%21"),e.tag[0]==="!"?c="!"+c:c.slice(0,18)==="tag:yaml.org,2002:"?c="!!"+c.slice(18):c="!<"+c+">",e.dump=c+" "+e.dump)}return!0}function Ql(e,n){var i=[],r=[],l,t;for(Ve(e,i,r),l=0,t=r.length;l<t;l+=1)n.duplicates.push(i[r[l]]);n.usedDuplicates=new Array(t)}function Ve(e,n,i){var r,l,t;if(e!==null&&typeof e=="object")if(l=n.indexOf(e),l!==-1)i.indexOf(l)===-1&&i.push(l);else if(n.push(e),Array.isArray(e))for(l=0,t=e.length;l<t;l+=1)Ve(e[l],n,i);else for(r=Object.keys(e),l=0,t=r.length;l<t;l+=1)Ve(e[r[l]],n,i)}function Xl(e,n){n=n||{};var i=new Hl(n);i.noRefs||Ql(e,i);var r=e;return i.replacer&&(r=i.replacer.call({"":r},"",r)),P(i,0,r,!0,!0)?i.dump+`\n`:""}var Vl=Xl,Zl={dump:Vl};function ln(e,n){return function(){throw new Error("Function yaml."+e+" is removed in js-yaml 4. Use yaml."+n+" instead, which is now safe by default.")}}var on=ti.load,ot=ti.loadAll,xe=Zl.dump;var tt=ln("safeLoad","load"),ut=ln("safeLoadAll","loadAll"),ft=ln("safeDump","dump");var no=$e;function D(e,n){return n==="yaml"?xe(e,{indent:2,lineWidth:-1,noRefs:!0}).trimEnd():JSON.stringify(e,null,2)}function io(e,n,i="json"){let r=D(e,i),l=D(n,i);return r===l?[{value:r}]:tn(e,n,0,i)}function ro(e,n){return io(e,n,"json")}function lo(e,n){try{let i=JSON.parse(e),r=JSON.parse(n),l=JSON.stringify(i),t=JSON.stringify(r);return l===t?[{value:e}]:N(e,n,{newlineIsToken:!1})}catch{return N(e,n,{newlineIsToken:!1})}}function oo(e,n){let i=on(e),r=on(n),l=xe(i,{indent:2,lineWidth:-1,noRefs:!0}),t=xe(r,{indent:2,lineWidth:-1,noRefs:!0});return l===t?[{value:e}]:N(e,n,{newlineIsToken:!1})}function tn(e,n,i,r="json"){let l=D(e,r),t=D(n,r);return l===t?[{value:W(l,i,r)}]:typeof e=="object"&&e!==null&&typeof n=="object"&&n!==null&&!Array.isArray(e)&&!Array.isArray(n)?to(e,n,i,r):Array.isArray(e)&&Array.isArray(n)?uo(e,n,i,r):fo(l,t,i,r)}function to(e,n,i,r="json"){let l=[],t=" ".repeat(i),o=" ".repeat(i+1),u=new Set(Object.keys(e)),f=Object.keys(n),c=[...u].filter(a=>!(a in n)),s=[...f,...c];l.push({value:`{\n`});for(let a=0;a<s.length;a++){let p=s[a],h=a===s.length-1?"":",",g=p in e,y=p in n;if(g&&y){let w=D(e[p],r),m=D(n[p],r);if(w===m){let x=W(w,i+1);l.push({value:o+JSON.stringify(p)+": "+x+h+`\n`})}else{let x=o+JSON.stringify(p)+": ",A=tn(e[p],n[p],i+1,r);if(A.length>0)if(!A[0].removed&&!A[0].added)A[0].value=x+A[0].value;else{let C=A.find(E=>E.removed),F=A.find(E=>E.added);C&&(C.value=x+C.value),F&&(F.value=x+F.value)}if(h&&A.length>0){let C=A[A.length-1];C.value=C.value.replace(/\\n$/,h+`\n`)}l.push(...A)}}else if(g){let w=W(D(e[p],r),i+1);l.push({removed:!0,value:o+JSON.stringify(p)+": "+w+h+`\n`})}else{let w=W(D(n[p],r),i+1);l.push({added:!0,value:o+JSON.stringify(p)+": "+w+h+`\n`})}}return l.push({value:t+`}\n`}),l}function uo(e,n,i,r="json"){let l=[],t=" ".repeat(i),o=" ".repeat(i+1);l.push({value:`[\n`});let u=Math.max(e.length,n.length);for(let f=0;f<u;f++){let s=f===u-1?"":",";if(f>=e.length){let a=W(D(n[f],r),i+1);l.push({added:!0,value:o+a+s+`\n`})}else if(f>=n.length){let a=W(D(e[f],r),i+1);l.push({removed:!0,value:o+a+s+`\n`})}else{let a=D(e[f],r),p=D(n[f],r);if(a===p){let d=W(a,i+1);l.push({value:o+d+s+`\n`})}else{let d=tn(e[f],n[f],i+1,r);if(d.length>0&&(d[0].value=o+d[0].value),s&&d.length>0){let h=d[d.length-1];h.value=h.value.replace(/\\n$/,s+`\n`)}l.push(...d)}}}return l.push({value:t+`]\n`}),l}function fo(e,n,i,r="json"){let l=W(e,i),t=W(n,i);return N(l,t).map(u=>({value:u.value,added:u.added,removed:u.removed}))}function W(e,n,i="json"){if(n===0)return e;let r=" ".repeat(n);return e.split(`\n`).map((l,t)=>t===0?l:r+l).join(`\n`)}var vi=e=>e===""?[]:e.replace(/\\n$/,"").split(`\n`),co=(e,n,i="diffChars")=>{let l=(typeof i=="string"?no[i]:i)(e,n),t={left:[],right:[]};return l.forEach(({added:o,removed:u,value:f})=>{let c={};return o&&(c.type=1,c.value=f,t.right.push(c)),u&&(c.type=2,c.value=f,t.left.push(c)),!u&&!o&&(c.type=0,c.value=f,t.right.push(c),t.left.push(c)),c}),t},yi=(e,n,i=!1,r="diffChars",l=0,t=[],o=!1)=>{let u=[];if(typeof e=="string"&&typeof n=="string")if(r==="diffJson")u=lo(e,n);else if(r==="diffYaml")try{u=oo(e,n)}catch{u=N(e,n,{newlineIsToken:!1})}else u=N(e,n,{newlineIsToken:!1});else u=ro(e,n);let f=l,c=l,s=[],a=0,p=[],d=[],h=(g,y,w,m,x)=>vi(g).map((C,F)=>{let E={},S={};if(!(d.includes(`${y}-${F}`)||x&&F!==0)){if(w||m){let $=!0;if(m){c+=1,E.lineNumber=c,E.type=2,E.value=C||" ";let un=u[y+1];if(un?.added){let fn=vi(un.value)[F];if(fn){let Ai=h(fn,y,!0,!1,!0),{value:B,lineNumber:wi,type:Ci}=Ai[0].right;if(d.push(`${y+1}-${F}`),S.lineNumber=wi,E.value===B)$=!1,S.type=0,E.type=0,S.value=B;else{S.type=Ci;let cn=500,Ei=C.length>cn||B.length>cn;if(i||Ei)S.value=B;else if(o)E.rawValue=C,E.value=C,S.rawValue=B,S.value=B;else{let an=co(C,B,r);S.value=an.right,E.value=an.left}}}}}else f+=1,S.lineNumber=f,S.type=1,S.value=C;$&&!x&&(p.includes(a)||p.push(a))}else c+=1,f+=1,E.lineNumber=c,E.type=0,E.value=C,S.lineNumber=f,S.type=0,S.value=C;return(t?.includes(`L-${E.lineNumber}`)||t?.includes(`R-${S.lineNumber}`)&&!p.includes(a))&&p.push(a),x||(a+=1),{right:S,left:E}}}).filter(Boolean);return u.forEach(({added:g,removed:y,value:w},m)=>{s=[...s,...h(w,m,g,y)]}),{lineInformation:s,diffLines:p}};self.onmessage=e=>{let{oldString:n,newString:i,disableWordDiff:r,lineCompareMethod:l,linesOffset:t,showLines:o,deferWordDiff:u}=e.data,f=yi(n,i,r,l,t,o,u);self.postMessage(f)};})();\n/*! Bundled license information:\n\njs-yaml/dist/js-yaml.mjs:\n (*! js-yaml 4.1.1 https://github.com/nodeca/js-yaml @license MIT *)\n*/\n',NZ=rQ;var Nn;(function(e){e[e.DEFAULT=0]="DEFAULT",e[e.ADDED=1]="ADDED",e[e.REMOVED=2]="REMOVED",e[e.CHANGED=3]="CHANGED"})(Nn||(Nn={}));function $i(e,t){return t==="yaml"?Ex(e,{indent:2,lineWidth:-1,noRefs:!0}).trimEnd():JSON.stringify(e,null,2)}function RZ(e,t,n="json"){const r=$i(e,n),i=$i(t,n);return r===i?[{value:r}]:Vv(e,t,0,n)}function AZ(e,t){return RZ(e,t,"json")}function OZ(e,t){try{const n=JSON.parse(e),r=JSON.parse(t),i=JSON.stringify(n),s=JSON.stringify(r);return i===s?[{value:e}]:xs(e,t,{newlineIsToken:!1})}catch{return xs(e,t,{newlineIsToken:!1})}}function jZ(e,t){const n=r4(e),r=r4(t),i=Ex(n,{indent:2,lineWidth:-1,noRefs:!0}),s=Ex(r,{indent:2,lineWidth:-1,noRefs:!0});return i===s?[{value:e}]:xs(e,t,{newlineIsToken:!1})}function Vv(e,t,n,r="json"){const i=$i(e,r),s=$i(t,r);return i===s?[{value:fs(i,n,r)}]:typeof e=="object"&&e!==null&&typeof t=="object"&&t!==null&&!Array.isArray(e)&&!Array.isArray(t)?MZ(e,t,n,r):Array.isArray(e)&&Array.isArray(t)?DZ(e,t,n,r):_Z(i,s,n,r)}function MZ(e,t,n,r="json"){const i=[],s=" ".repeat(n),a=" ".repeat(n+1),c=new Set(Object.keys(e)),u=Object.keys(t),f=[...c].filter(p=>!(p in t)),m=[...u,...f];i.push({value:`{
73
+ `});for(let p=0;p<m.length;p++){const y=m[p],b=p===m.length-1?"":",",S=y in e,k=y in t;if(S&&k){const E=$i(e[y],r),T=$i(t[y],r);if(E===T){const N=fs(E,n+1);i.push({value:a+JSON.stringify(y)+": "+N+b+`
74
+ `})}else{const N=a+JSON.stringify(y)+": ",j=Vv(e[y],t[y],n+1,r);if(j.length>0)if(!j[0].removed&&!j[0].added)j[0].value=N+j[0].value;else{const O=j.find(R=>R.removed),A=j.find(R=>R.added);O&&(O.value=N+O.value),A&&(A.value=N+A.value)}if(b&&j.length>0){const O=j[j.length-1];O.value=O.value.replace(/\n$/,b+`
75
+ `)}i.push(...j)}}else if(S){const E=fs($i(e[y],r),n+1);i.push({removed:!0,value:a+JSON.stringify(y)+": "+E+b+`
76
+ `})}else{const E=fs($i(t[y],r),n+1);i.push({added:!0,value:a+JSON.stringify(y)+": "+E+b+`
77
+ `})}}return i.push({value:s+`}
78
+ `}),i}function DZ(e,t,n,r="json"){const i=[],s=" ".repeat(n),a=" ".repeat(n+1);i.push({value:`[
79
+ `});const c=Math.max(e.length,t.length);for(let u=0;u<c;u++){const m=u===c-1?"":",";if(u>=e.length){const p=fs($i(t[u],r),n+1);i.push({added:!0,value:a+p+m+`
80
+ `})}else if(u>=t.length){const p=fs($i(e[u],r),n+1);i.push({removed:!0,value:a+p+m+`
81
+ `})}else{const p=$i(e[u],r),y=$i(t[u],r);if(p===y){const x=fs(p,n+1);i.push({value:a+x+m+`
82
+ `})}else{const x=Vv(e[u],t[u],n+1,r);if(x.length>0&&(x[0].value=a+x[0].value),m&&x.length>0){const b=x[x.length-1];b.value=b.value.replace(/\n$/,m+`
83
+ `)}i.push(...x)}}}return i.push({value:s+`]
84
+ `}),i}function _Z(e,t,n,r="json"){const i=fs(e,n),s=fs(t,n);return xs(i,s).map(c=>({value:c.value,added:c.added,removed:c.removed}))}function fs(e,t,n="json"){if(t===0)return e;const r=" ".repeat(t);return e.split(`
85
+ `).map((i,s)=>s===0?i:r+i).join(`
86
+ `)}var pr;(function(e){e.CHARS="diffChars",e.WORDS="diffWords",e.WORDS_WITH_SPACE="diffWordsWithSpace",e.LINES="diffLines",e.TRIMMED_LINES="diffTrimmedLines",e.SENTENCES="diffSentences",e.CSS="diffCss",e.JSON="diffJson",e.YAML="diffYaml"})(pr||(pr={}));const i4=e=>e===""?[]:e.replace(/\n$/,"").split(`
87
+ `),W8=(e,t,n=pr.CHARS)=>{const i=(typeof n=="string"?NZ[n]:n)(e,t),s={left:[],right:[]};return i.forEach(({added:a,removed:c,value:u})=>{const f={};return a&&(f.type=Nn.ADDED,f.value=u,s.right.push(f)),c&&(f.type=Nn.REMOVED,f.value=u,s.left.push(f)),!c&&!a&&(f.type=Nn.DEFAULT,f.value=u,s.right.push(f),s.left.push(f)),f}),s},LZ=(e,t,n=!1,r=pr.CHARS,i=0,s=[],a=!1)=>{let c=[];if(typeof e=="string"&&typeof t=="string")if(r===pr.JSON)c=OZ(e,t);else if(r===pr.YAML)try{c=jZ(e,t)}catch{c=xs(e,t,{newlineIsToken:!1})}else c=xs(e,t,{newlineIsToken:!1});else c=AZ(e,t);let u=i,f=i,m=[],p=0;const y=[],x=[],b=(S,k,E,T,N)=>i4(S).map((O,A)=>{const R={},L={};if(!(x.includes(`${k}-${A}`)||N&&A!==0)){if(E||T){let B=!0;if(T){f+=1,R.lineNumber=f,R.type=Nn.REMOVED,R.value=O||" ";const I=c[k+1];if(I?.added){const U=i4(I.value)[A];if(U){const Y=b(U,k,!0,!1,!0),{value:V,lineNumber:q,type:H}=Y[0].right;if(x.push(`${k+1}-${A}`),L.lineNumber=q,R.value===V)B=!1,L.type=0,R.type=0,L.value=V;else{L.type=H;const z=500,$=O.length>z||V.length>z;if(n||$)L.value=V;else if(a)R.rawValue=O,R.value=O,L.rawValue=V,L.value=V;else{const G=W8(O,V,r);L.value=G.right,R.value=G.left}}}}}else u+=1,L.lineNumber=u,L.type=Nn.ADDED,L.value=O;B&&!N&&(y.includes(p)||y.push(p))}else f+=1,u+=1,R.lineNumber=f,R.type=Nn.DEFAULT,R.value=O,L.lineNumber=u,L.type=Nn.DEFAULT,L.value=O;return(s?.includes(`L-${R.lineNumber}`)||s?.includes(`R-${L.lineNumber}`)&&!y.includes(p))&&y.push(p),N||(p+=1),{right:L,left:R}}}).filter(Boolean);return c.forEach(({added:S,removed:k,value:E},T)=>{m=[...m,...b(E,T,S,k)]}),{lineInformation:m,diffLines:y}};let pd=null,Bd=null;const IZ=()=>{if(pd!==null)return pd;if(typeof Worker>"u"||typeof Blob>"u"||typeof URL>"u")return Bd=!1,null;try{const e=new Blob([TZ],{type:"application/javascript"});pd=URL.createObjectURL(e),Bd=!0}catch{Bd=!1,pd=null}return pd},PZ=(e,t,n=!1,r=pr.CHARS,i=0,s=[],a=!1)=>{const c=()=>LZ(e,t,n,r,i,s,a),u=IZ();return u?new Promise(f=>{let m;try{m=new Worker(u)}catch{Bd=!1,f(c());return}m.onmessage=p=>{f(p.data),m.terminate()},m.onerror=()=>{Bd=!1,m.terminate(),f(c())},m.postMessage({oldString:e,newString:t,disableWordDiff:n,lineCompareMethod:r,linesOffset:i,showLines:s,deferWordDiff:a})}):Promise.resolve(c())};function o4(){return h.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",width:"16",height:"16",children:[h.jsx("title",{children:"expand"}),h.jsx("path",{d:"m8.177.677 2.896 2.896a.25.25 0 0 1-.177.427H8.75v1.25a.75.75 0 0 1-1.5 0V4H5.104a.25.25 0 0 1-.177-.427L7.823.677a.25.25 0 0 1 .354 0ZM7.25 10.75a.75.75 0 0 1 1.5 0V12h2.146a.25.25 0 0 1 .177.427l-2.896 2.896a.25.25 0 0 1-.354 0l-2.896-2.896A.25.25 0 0 1 5.104 12H7.25v-1.25Zm-5-2a.75.75 0 0 0 0-1.5h-.5a.75.75 0 0 0 0 1.5h.5ZM6 8a.75.75 0 0 1-.75.75h-.5a.75.75 0 0 1 0-1.5h.5A.75.75 0 0 1 6 8Zm2.25.75a.75.75 0 0 0 0-1.5h-.5a.75.75 0 0 0 0 1.5h.5ZM12 8a.75.75 0 0 1-.75.75h-.5a.75.75 0 0 1 0-1.5h.5A.75.75 0 0 1 12 8Zm2.25.75a.75.75 0 0 0 0-1.5h-.5a.75.75 0 0 0 0 1.5h.5Z"})]})}function zZ(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}function FZ(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),e.nonce!==void 0&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}var BZ=(function(){function e(n){var r=this;this._insertTag=function(i){var s;r.tags.length===0?r.insertionPoint?s=r.insertionPoint.nextSibling:r.prepend?s=r.container.firstChild:s=r.before:s=r.tags[r.tags.length-1].nextSibling,r.container.insertBefore(i,s),r.tags.push(i)},this.isSpeedy=n.speedy===void 0?!0:n.speedy,this.tags=[],this.ctr=0,this.nonce=n.nonce,this.key=n.key,this.container=n.container,this.prepend=n.prepend,this.insertionPoint=n.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(r){r.forEach(this._insertTag)},t.insert=function(r){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(FZ(this));var i=this.tags[this.tags.length-1];if(this.isSpeedy){var s=zZ(i);try{s.insertRule(r,s.cssRules.length)}catch{}}else i.appendChild(document.createTextNode(r));this.ctr++},t.flush=function(){this.tags.forEach(function(r){var i;return(i=r.parentNode)==null?void 0:i.removeChild(r)}),this.tags=[],this.ctr=0},e})(),Tr="-ms-",Vm="-moz-",an="-webkit-",G8="comm",qv="rule",$v="decl",HZ="@import",K8="@keyframes",UZ="@layer",VZ=Math.abs,I0=String.fromCharCode,qZ=Object.assign;function $Z(e,t){return Sr(e,0)^45?(((t<<2^Sr(e,0))<<2^Sr(e,1))<<2^Sr(e,2))<<2^Sr(e,3):0}function Q8(e){return e.trim()}function YZ(e,t){return(e=t.exec(e))?e[0]:e}function ln(e,t,n){return e.replace(t,n)}function Tx(e,t){return e.indexOf(t)}function Sr(e,t){return e.charCodeAt(t)|0}function cf(e,t,n){return e.slice(t,n)}function wo(e){return e.length}function Yv(e){return e.length}function Dp(e,t){return t.push(e),e}function WZ(e,t){return e.map(t).join("")}var P0=1,Wc=1,X8=0,ti=0,tr=0,cu="";function z0(e,t,n,r,i,s,a){return{value:e,root:t,parent:n,type:r,props:i,children:s,line:P0,column:Wc,length:a,return:""}}function md(e,t){return qZ(z0("",null,null,"",null,null,0),e,{length:-e.length},t)}function GZ(){return tr}function KZ(){return tr=ti>0?Sr(cu,--ti):0,Wc--,tr===10&&(Wc=1,P0--),tr}function xi(){return tr=ti<X8?Sr(cu,ti++):0,Wc++,tr===10&&(Wc=1,P0++),tr}function Ro(){return Sr(cu,ti)}function lm(){return ti}function qf(e,t){return cf(cu,e,t)}function uf(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function Z8(e){return P0=Wc=1,X8=wo(cu=e),ti=0,[]}function J8(e){return cu="",e}function cm(e){return Q8(qf(ti-1,Nx(e===91?e+2:e===40?e+1:e)))}function QZ(e){for(;(tr=Ro())&&tr<33;)xi();return uf(e)>2||uf(tr)>3?"":" "}function XZ(e,t){for(;--t&&xi()&&!(tr<48||tr>102||tr>57&&tr<65||tr>70&&tr<97););return qf(e,lm()+(t<6&&Ro()==32&&xi()==32))}function Nx(e){for(;xi();)switch(tr){case e:return ti;case 34:case 39:e!==34&&e!==39&&Nx(tr);break;case 40:e===41&&Nx(e);break;case 92:xi();break}return ti}function ZZ(e,t){for(;xi()&&e+tr!==57;)if(e+tr===84&&Ro()===47)break;return"/*"+qf(t,ti-1)+"*"+I0(e===47?e:xi())}function JZ(e){for(;!uf(Ro());)xi();return qf(e,ti)}function eJ(e){return J8(um("",null,null,null,[""],e=Z8(e),0,[0],e))}function um(e,t,n,r,i,s,a,c,u){for(var f=0,m=0,p=a,y=0,x=0,b=0,S=1,k=1,E=1,T=0,N="",j=i,O=s,A=r,R=N;k;)switch(b=T,T=xi()){case 40:if(b!=108&&Sr(R,p-1)==58){Tx(R+=ln(cm(T),"&","&\f"),"&\f")!=-1&&(E=-1);break}case 34:case 39:case 91:R+=cm(T);break;case 9:case 10:case 13:case 32:R+=QZ(b);break;case 92:R+=XZ(lm()-1,7);continue;case 47:switch(Ro()){case 42:case 47:Dp(tJ(ZZ(xi(),lm()),t,n),u);break;default:R+="/"}break;case 123*S:c[f++]=wo(R)*E;case 125*S:case 59:case 0:switch(T){case 0:case 125:k=0;case 59+m:E==-1&&(R=ln(R,/\f/g,"")),x>0&&wo(R)-p&&Dp(x>32?a4(R+";",r,n,p-1):a4(ln(R," ","")+";",r,n,p-2),u);break;case 59:R+=";";default:if(Dp(A=s4(R,t,n,f,m,i,c,N,j=[],O=[],p),s),T===123)if(m===0)um(R,t,A,A,j,s,p,c,O);else switch(y===99&&Sr(R,3)===110?100:y){case 100:case 108:case 109:case 115:um(e,A,A,r&&Dp(s4(e,A,A,0,0,i,c,N,i,j=[],p),O),i,O,p,c,r?j:O);break;default:um(R,A,A,A,[""],O,0,c,O)}}f=m=x=0,S=E=1,N=R="",p=a;break;case 58:p=1+wo(R),x=b;default:if(S<1){if(T==123)--S;else if(T==125&&S++==0&&KZ()==125)continue}switch(R+=I0(T),T*S){case 38:E=m>0?1:(R+="\f",-1);break;case 44:c[f++]=(wo(R)-1)*E,E=1;break;case 64:Ro()===45&&(R+=cm(xi())),y=Ro(),m=p=wo(N=R+=JZ(lm())),T++;break;case 45:b===45&&wo(R)==2&&(S=0)}}return s}function s4(e,t,n,r,i,s,a,c,u,f,m){for(var p=i-1,y=i===0?s:[""],x=Yv(y),b=0,S=0,k=0;b<r;++b)for(var E=0,T=cf(e,p+1,p=VZ(S=a[b])),N=e;E<x;++E)(N=Q8(S>0?y[E]+" "+T:ln(T,/&\f/g,y[E])))&&(u[k++]=N);return z0(e,t,n,i===0?qv:c,u,f,m)}function tJ(e,t,n){return z0(e,t,n,G8,I0(GZ()),cf(e,2,-2),0)}function a4(e,t,n,r){return z0(e,t,n,$v,cf(e,0,r),cf(e,r+1,-1),r)}function _c(e,t){for(var n="",r=Yv(e),i=0;i<r;i++)n+=t(e[i],i,e,t)||"";return n}function nJ(e,t,n,r){switch(e.type){case UZ:if(e.children.length)break;case HZ:case $v:return e.return=e.return||e.value;case G8:return"";case K8:return e.return=e.value+"{"+_c(e.children,r)+"}";case qv:e.value=e.props.join(",")}return wo(n=_c(e.children,r))?e.return=e.value+"{"+n+"}":""}function rJ(e){var t=Yv(e);return function(n,r,i,s){for(var a="",c=0;c<t;c++)a+=e[c](n,r,i,s)||"";return a}}function iJ(e){return function(t){t.root||(t=t.return)&&e(t)}}function oJ(e){var t=Object.create(null);return function(n){return t[n]===void 0&&(t[n]=e(n)),t[n]}}var sJ=function(t,n,r){for(var i=0,s=0;i=s,s=Ro(),i===38&&s===12&&(n[r]=1),!uf(s);)xi();return qf(t,ti)},aJ=function(t,n){var r=-1,i=44;do switch(uf(i)){case 0:i===38&&Ro()===12&&(n[r]=1),t[r]+=sJ(ti-1,n,r);break;case 2:t[r]+=cm(i);break;case 4:if(i===44){t[++r]=Ro()===58?"&\f":"",n[r]=t[r].length;break}default:t[r]+=I0(i)}while(i=xi());return t},lJ=function(t,n){return J8(aJ(Z8(t),n))},l4=new WeakMap,cJ=function(t){if(!(t.type!=="rule"||!t.parent||t.length<1)){for(var n=t.value,r=t.parent,i=t.column===r.column&&t.line===r.line;r.type!=="rule";)if(r=r.parent,!r)return;if(!(t.props.length===1&&n.charCodeAt(0)!==58&&!l4.get(r))&&!i){l4.set(t,!0);for(var s=[],a=lJ(n,s),c=r.props,u=0,f=0;u<a.length;u++)for(var m=0;m<c.length;m++,f++)t.props[f]=s[u]?a[u].replace(/&\f/g,c[m]):c[m]+" "+a[u]}}},uJ=function(t){if(t.type==="decl"){var n=t.value;n.charCodeAt(0)===108&&n.charCodeAt(2)===98&&(t.return="",t.value="")}};function e9(e,t){switch($Z(e,t)){case 5103:return an+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return an+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return an+e+Vm+e+Tr+e+e;case 6828:case 4268:return an+e+Tr+e+e;case 6165:return an+e+Tr+"flex-"+e+e;case 5187:return an+e+ln(e,/(\w+).+(:[^]+)/,an+"box-$1$2"+Tr+"flex-$1$2")+e;case 5443:return an+e+Tr+"flex-item-"+ln(e,/flex-|-self/,"")+e;case 4675:return an+e+Tr+"flex-line-pack"+ln(e,/align-content|flex-|-self/,"")+e;case 5548:return an+e+Tr+ln(e,"shrink","negative")+e;case 5292:return an+e+Tr+ln(e,"basis","preferred-size")+e;case 6060:return an+"box-"+ln(e,"-grow","")+an+e+Tr+ln(e,"grow","positive")+e;case 4554:return an+ln(e,/([^-])(transform)/g,"$1"+an+"$2")+e;case 6187:return ln(ln(ln(e,/(zoom-|grab)/,an+"$1"),/(image-set)/,an+"$1"),e,"")+e;case 5495:case 3959:return ln(e,/(image-set\([^]*)/,an+"$1$`$1");case 4968:return ln(ln(e,/(.+:)(flex-)?(.*)/,an+"box-pack:$3"+Tr+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+an+e+e;case 4095:case 3583:case 4068:case 2532:return ln(e,/(.+)-inline(.+)/,an+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(wo(e)-1-t>6)switch(Sr(e,t+1)){case 109:if(Sr(e,t+4)!==45)break;case 102:return ln(e,/(.+:)(.+)-([^]+)/,"$1"+an+"$2-$3$1"+Vm+(Sr(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~Tx(e,"stretch")?e9(ln(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(Sr(e,t+1)!==115)break;case 6444:switch(Sr(e,wo(e)-3-(~Tx(e,"!important")&&10))){case 107:return ln(e,":",":"+an)+e;case 101:return ln(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+an+(Sr(e,14)===45?"inline-":"")+"box$3$1"+an+"$2$3$1"+Tr+"$2box$3")+e}break;case 5936:switch(Sr(e,t+11)){case 114:return an+e+Tr+ln(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return an+e+Tr+ln(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return an+e+Tr+ln(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return an+e+Tr+e+e}return e}var dJ=function(t,n,r,i){if(t.length>-1&&!t.return)switch(t.type){case $v:t.return=e9(t.value,t.length);break;case K8:return _c([md(t,{value:ln(t.value,"@","@"+an)})],i);case qv:if(t.length)return WZ(t.props,function(s){switch(YZ(s,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return _c([md(t,{props:[ln(s,/:(read-\w+)/,":"+Vm+"$1")]})],i);case"::placeholder":return _c([md(t,{props:[ln(s,/:(plac\w+)/,":"+an+"input-$1")]}),md(t,{props:[ln(s,/:(plac\w+)/,":"+Vm+"$1")]}),md(t,{props:[ln(s,/:(plac\w+)/,Tr+"input-$1")]})],i)}return""})}},fJ=[dJ],hJ=function(t){var n=t.key;if(n==="css"){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(S){var k=S.getAttribute("data-emotion");k.indexOf(" ")!==-1&&(document.head.appendChild(S),S.setAttribute("data-s",""))})}var i=t.stylisPlugins||fJ,s={},a,c=[];a=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+n+' "]'),function(S){for(var k=S.getAttribute("data-emotion").split(" "),E=1;E<k.length;E++)s[k[E]]=!0;c.push(S)});var u,f=[cJ,uJ];{var m,p=[nJ,iJ(function(S){m.insert(S)})],y=rJ(f.concat(i,p)),x=function(k){return _c(eJ(k),y)};u=function(k,E,T,N){m=T,x(k?k+"{"+E.styles+"}":E.styles),N&&(b.inserted[E.name]=!0)}}var b={key:n,sheet:new BZ({key:n,container:a,nonce:t.nonce,speedy:t.speedy,prepend:t.prepend,insertionPoint:t.insertionPoint}),nonce:t.nonce,inserted:s,registered:{},insert:u};return b.sheet.hydrate(c),b};function pJ(e){for(var t=0,n,r=0,i=e.length;i>=4;++r,i-=4)n=e.charCodeAt(r)&255|(e.charCodeAt(++r)&255)<<8|(e.charCodeAt(++r)&255)<<16|(e.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,t=(n&65535)*1540483477+((n>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(i){case 3:t^=(e.charCodeAt(r+2)&255)<<16;case 2:t^=(e.charCodeAt(r+1)&255)<<8;case 1:t^=e.charCodeAt(r)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var mJ={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},gJ=/[A-Z]|^ms/g,yJ=/_EMO_([^_]+?)_([^]*?)_EMO_/g,t9=function(t){return t.charCodeAt(1)===45},c4=function(t){return t!=null&&typeof t!="boolean"},Y2=oJ(function(e){return t9(e)?e:e.replace(gJ,"-$&").toLowerCase()}),u4=function(t,n){switch(t){case"animation":case"animationName":if(typeof n=="string")return n.replace(yJ,function(r,i,s){return ca={name:i,styles:s,next:ca},i})}return mJ[t]!==1&&!t9(t)&&typeof n=="number"&&n!==0?n+"px":n};function qm(e,t,n){if(n==null)return"";var r=n;if(r.__emotion_styles!==void 0)return r;switch(typeof n){case"boolean":return"";case"object":{var i=n;if(i.anim===1)return ca={name:i.name,styles:i.styles,next:ca},i.name;var s=n;if(s.styles!==void 0){var a=s.next;if(a!==void 0)for(;a!==void 0;)ca={name:a.name,styles:a.styles,next:ca},a=a.next;var c=s.styles+";";return c}return xJ(e,t,n)}}var u=n;if(t==null)return u;var f=t[u];return f!==void 0?f:u}function xJ(e,t,n){var r="";if(Array.isArray(n))for(var i=0;i<n.length;i++)r+=qm(e,t,n[i])+";";else for(var s in n){var a=n[s];if(typeof a!="object"){var c=a;t!=null&&t[c]!==void 0?r+=s+"{"+t[c]+"}":c4(c)&&(r+=Y2(s)+":"+u4(s,c)+";")}else if(Array.isArray(a)&&typeof a[0]=="string"&&(t==null||t[a[0]]===void 0))for(var u=0;u<a.length;u++)c4(a[u])&&(r+=Y2(s)+":"+u4(s,a[u])+";");else{var f=qm(e,t,a);switch(s){case"animation":case"animationName":{r+=Y2(s)+":"+f+";";break}default:r+=s+"{"+f+"}"}}}return r}var d4=/label:\s*([^\s;{]+)\s*(;|$)/g,ca;function W2(e,t,n){if(e.length===1&&typeof e[0]=="object"&&e[0]!==null&&e[0].styles!==void 0)return e[0];var r=!0,i="";ca=void 0;var s=e[0];if(s==null||s.raw===void 0)r=!1,i+=qm(n,t,s);else{var a=s;i+=a[0]}for(var c=1;c<e.length;c++)if(i+=qm(n,t,e[c]),r){var u=s;i+=u[c]}d4.lastIndex=0;for(var f="",m;(m=d4.exec(i))!==null;)f+="-"+m[1];var p=pJ(i)+f;return{name:p,styles:i,next:ca}}function n9(e,t,n){var r="";return n.split(" ").forEach(function(i){e[i]!==void 0?t.push(e[i]+";"):i&&(r+=i+" ")}),r}var bJ=function(t,n,r){var i=t.key+"-"+n.name;t.registered[i]===void 0&&(t.registered[i]=n.styles)},vJ=function(t,n,r){bJ(t,n);var i=t.key+"-"+n.name;if(t.inserted[n.name]===void 0){var s=n;do t.insert(n===s?"."+i:"",s,t.sheet,!0),s=s.next;while(s!==void 0)}};function f4(e,t){if(e.inserted[t.name]===void 0)return e.insert("",t,e.sheet,!0)}function h4(e,t,n){var r=[],i=n9(e,r,n);return r.length<2?n:i+t(r)}var wJ=function(t){var n=hJ(t);n.sheet.speedy=function(c){this.isSpeedy=c},n.compat=!0;var r=function(){for(var u=arguments.length,f=new Array(u),m=0;m<u;m++)f[m]=arguments[m];var p=W2(f,n.registered,void 0);return vJ(n,p),n.key+"-"+p.name},i=function(){for(var u=arguments.length,f=new Array(u),m=0;m<u;m++)f[m]=arguments[m];var p=W2(f,n.registered),y="animation-"+p.name;return f4(n,{name:p.name,styles:"@keyframes "+y+"{"+p.styles+"}"}),y},s=function(){for(var u=arguments.length,f=new Array(u),m=0;m<u;m++)f[m]=arguments[m];var p=W2(f,n.registered);f4(n,p)},a=function(){for(var u=arguments.length,f=new Array(u),m=0;m<u;m++)f[m]=arguments[m];return h4(n.registered,r,SJ(f))};return{css:r,cx:a,injectGlobal:s,keyframes:i,hydrate:function(u){u.forEach(function(f){n.inserted[f]=!0})},flush:function(){n.registered={},n.inserted={},n.sheet.flush()},sheet:n.sheet,cache:n,getRegisteredStyles:n9.bind(null,n.registered),merge:h4.bind(null,n.registered,r)}},SJ=function e(t){for(var n="",r=0;r<t.length;r++){var i=t[r];if(i!=null){var s=void 0;switch(typeof i){case"boolean":break;case"object":{if(Array.isArray(i))s=e(i);else{s="";for(var a in i)i[a]&&a&&(s&&(s+=" "),s+=a)}break}default:s=i}s&&(n&&(n+=" "),n+=s)}}return n};const CJ=(e,t=!1,n="")=>{const{variables:r={},...i}=e,s={light:{diffViewerBackground:"#fff",diffViewerColor:"#212529",addedBackground:"#e6ffed",addedColor:"#24292e",removedBackground:"#ffeef0",removedColor:"#24292e",changedBackground:"#fffbdd",wordAddedBackground:"#acf2bd",wordRemovedBackground:"#fdb8c0",addedGutterBackground:"#cdffd8",removedGutterBackground:"#ffdce0",gutterBackground:"#f7f7f7",gutterBackgroundDark:"#f3f1f1",highlightBackground:"#fffbdd",highlightGutterBackground:"#fff5b1",codeFoldGutterBackground:"#dbedff",codeFoldBackground:"#f1f8ff",emptyLineBackground:"#fafbfc",gutterColor:"#212529",addedGutterColor:"#212529",removedGutterColor:"#212529",codeFoldContentColor:"#212529",diffViewerTitleBackground:"#fafbfc",diffViewerTitleColor:"#212529",diffViewerTitleBorderColor:"#eee",...r.light||{}},dark:{diffViewerBackground:"#2e303c",diffViewerColor:"#FFF",addedBackground:"#2ea04326",addedColor:"white",removedBackground:"#f851491a",removedColor:"white",changedBackground:"#3e302c",wordAddedBackground:"#2ea04366",wordRemovedBackground:"#f8514966",addedGutterBackground:"#3fb9504d",removedGutterBackground:"#f851494d",gutterBackground:"#2c2f3a",gutterBackgroundDark:"#262933",highlightBackground:"#2a3967",highlightGutterBackground:"#2d4077",codeFoldGutterBackground:"#262831",codeFoldBackground:"#262831",emptyLineBackground:"#363946",gutterColor:"#f0f6fc",addedGutterColor:"#f0f6fc",removedGutterColor:"#f0f6fc",codeFoldContentColor:"#9198a1",diffViewerTitleBackground:"#2f323e",diffViewerTitleColor:"#f0f6fc",diffViewerTitleBorderColor:"#353846",...r.dark||{}}},a=t?s.dark:s.light,{css:c,cx:u}=wJ({key:"react-diff",nonce:n}),f=c({width:"auto",overflow:"hidden",label:"content"}),m=c({label:"split-view"}),p=c({position:"sticky",top:0,zIndex:2,label:"sticky-header"}),y=c({background:a.diffViewerTitleBackground,color:a.diffViewerTitleColor,padding:"0.5em 1em",display:"flex",alignItems:"center",gap:"0.5em",fontFamily:"monospace",fontSize:12,fill:a.diffViewerTitleColor}),x=c({display:"flex",label:"column-headers"}),b=c({width:"100%",minWidth:"1000px",overflowX:"auto",tableLayout:"fixed",fontSize:12,background:a.diffViewerBackground,pre:{margin:0,whiteSpace:"pre-wrap",lineHeight:"1.6em",width:"fit-content"},label:"diff-container",borderCollapse:"collapse","@media (max-width: 768px)":{minWidth:"unset"}}),S=c({overflow:"hidden",width:"100%"}),k=c({color:a.diffViewerColor,whiteSpace:"pre-wrap",fontFamily:"monospace",lineBreak:"anywhere",textDecoration:"none",label:"content-text"}),E=c({userSelect:"none",label:"unselectable"}),T=c({label:"no-wrap",pre:{whiteSpace:"pre"},[`.${k}`]:{whiteSpace:"pre",lineBreak:"auto"}}),N=c({background:"transparent",border:"none",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",margin:0,label:"all-expand-button",":hover":{fill:a.addedGutterColor},":focus":{outline:`1px ${a.addedGutterColor} solid`}}),j=c({background:a.diffViewerTitleBackground,padding:"0.5em",lineHeight:"1.4em",height:"2.4em",overflow:"hidden",width:"50%",borderBottom:`1px solid ${a.diffViewerTitleBorderColor}`,boxSizing:"border-box",fontSize:12,label:"title-block",":only-child":{width:"100%"},":last-child:not(:only-child)":{borderLeft:`1px solid ${a.diffViewerTitleBorderColor}`},[`.${k}`]:{color:a.diffViewerTitleColor}}),O=c({color:a.gutterColor,label:"line-number"}),A=c({background:a.removedBackground,color:a.removedColor,pre:{color:a.removedColor},[`.${O}`]:{color:a.removedGutterColor},label:"diff-removed"}),R=c({background:a.addedBackground,color:a.addedColor,pre:{color:a.addedColor},[`.${O}`]:{color:a.addedGutterColor},label:"diff-added"}),L=c({background:a.changedBackground,[`.${O}`]:{color:a.gutterColor},label:"diff-changed"}),B=c({display:"inline",textDecoration:"none",label:"word-diff"}),I=c({background:a.wordAddedBackground,label:"word-added"}),U=c({background:a.wordRemovedBackground,label:"word-removed"}),Y=c({backgroundColor:a.codeFoldGutterBackground,label:"code-fold-gutter",minWidth:"50px",width:"50px",textAlign:"center",fill:a.codeFoldContentColor}),V=c({padding:""}),q=c({background:a.codeFoldBackground,cursor:"pointer",display:"inline",margin:0,border:"none",fill:a.codeFoldContentColor,label:"code-fold-expand-button"}),H=c({color:a.codeFoldContentColor,fontFamily:"monospace",label:"code-fold-content"}),z=c({display:"block",width:"10px",height:"10px",backgroundColor:"#ddd",borderWidth:"1px",borderStyle:"solid",borderColor:a.diffViewerTitleBorderColor}),$=c({backgroundColor:a.wordAddedBackground}),G=c({backgroundColor:a.wordRemovedBackground}),Q=c({backgroundColor:a.codeFoldBackground,fontSize:12,alignItems:"center",userSelect:"none",fontWeight:700,cursor:"pointer",label:"code-fold","&:hover":{color:a.diffViewerColor,fill:a.diffViewerColor,"& *":{color:a.diffViewerColor,fill:a.diffViewerColor}},a:{textDecoration:"underline !important",cursor:"pointer",pre:{display:"inline"}}}),_=c({backgroundColor:a.emptyLineBackground,label:"empty-line"}),P=c({width:28,paddingLeft:10,paddingRight:10,userSelect:"none",label:"marker",[`&.${R}`]:{pre:{color:a.addedColor}},[`&.${A}`]:{pre:{color:a.removedColor}}}),W=c({background:a.highlightBackground,label:"highlighted-line",[`.${I}, .${U}`]:{backgroundColor:"initial"}}),D=c({label:"highlighted-gutter"}),Z=c({userSelect:"none",minWidth:50,width:"50px",padding:"0 10px",whiteSpace:"nowrap",label:"gutter",textAlign:"center",color:a.gutterColor,background:a.gutterBackground,"&:hover":{cursor:"pointer",background:a.gutterBackgroundDark,pre:{opacity:1}},pre:{opacity:.5,textAlign:"center",width:"100%"},[`&.${R}`]:{background:a.addedGutterBackground},[`&.${A}`]:{background:a.removedGutterBackground},[`&.${D}`]:{background:a.highlightGutterBackground,"&:hover":{background:a.highlightGutterBackground}}}),ee=c({"&:hover":{background:a.gutterBackground,cursor:"initial"},label:"empty-gutter"}),J=c({verticalAlign:"baseline",label:"line",textDecoration:"none"}),he=c({}),fe={diffContainer:b,diffRemoved:A,diffAdded:R,diffChanged:L,splitView:m,marker:P,highlightedGutter:D,highlightedLine:W,gutter:Z,line:J,lineContent:S,wordDiff:B,wordAdded:I,summary:y,block:z,blockAddition:$,blockDeletion:G,wordRemoved:U,noSelect:E,noWrap:T,codeFoldGutter:Y,codeFoldExpandButton:q,codeFoldContentContainer:V,codeFold:Q,emptyGutter:ee,emptyLine:_,lineNumber:O,contentText:k,content:f,column:he,codeFoldContent:H,stickyHeader:p,columnHeaders:x,titleBlock:j,allExpandButton:N},Se=Object.keys(i).reduce((Ae,Oe)=>({...Ae,[Oe]:c(i[Oe])}),{});return Object.keys(fe).reduce((Ae,Oe)=>({...Ae,[Oe]:Se[Oe]?u(fe[Oe],Se[Oe]):fe[Oe]}),{})};function kJ(){return h.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",width:"16",height:"16",children:[h.jsx("title",{children:"fold"}),h.jsx("path",{d:"M10.896 2H8.75V.75a.75.75 0 0 0-1.5 0V2H5.104a.25.25 0 0 0-.177.427l2.896 2.896a.25.25 0 0 0 .354 0l2.896-2.896A.25.25 0 0 0 10.896 2ZM8.75 15.25a.75.75 0 0 1-1.5 0V14H5.104a.25.25 0 0 1-.177-.427l2.896-2.896a.25.25 0 0 1 .354 0l2.896 2.896a.25.25 0 0 1-.177.427H8.75v1.25Zm-6.5-6.5a.75.75 0 0 0 0-1.5h-.5a.75.75 0 0 0 0 1.5h.5ZM6 8a.75.75 0 0 1-.75.75h-.5a.75.75 0 0 1 0-1.5h.5A.75.75 0 0 1 6 8Zm2.25.75a.75.75 0 0 0 0-1.5h-.5a.75.75 0 0 0 0 1.5h.5ZM12 8a.75.75 0 0 1-.75.75h-.5a.75.75 0 0 1 0-1.5h.5A.75.75 0 0 1 12 8Zm2.25.75a.75.75 0 0 0 0-1.5h-.5a.75.75 0 0 0 0 1.5h.5Z"})]})}function EJ(e,t,n){const r=[];let i=0;for(const p of t){const y=typeof p.value=="string"?p.value:"";y.length>0&&(r.push({start:i,end:i+y.length,type:p.type}),i+=y.length)}const s=[];let a=0;for(;a<e.length;)if(e[a]==="<"){const p=e.indexOf(">",a);if(p===-1){s.push({type:"text",content:e.slice(a)});break}s.push({type:"tag",content:e.slice(a,p+1)}),a=p+1}else{let p=e.indexOf("<",a);p===-1&&(p=e.length),s.push({type:"text",content:e.slice(a,p)}),a=p}function c(p){return p.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&").replace(/&quot;/g,'"').replace(/&#39;/g,"'").replace(/&nbsp;/g," ")}function u(p){return p===Nn.ADDED?{open:`<ins class="${n.wordDiff} ${n.wordAdded}">`,close:"</ins>"}:p===Nn.REMOVED?{open:`<del class="${n.wordDiff} ${n.wordRemoved}">`,close:"</del>"}:{open:`<span class="${n.wordDiff}">`,close:"</span>"}}let f=0,m="";for(const p of s)if(p.type==="tag")m+=p.content;else{const y=p.content,x=c(y);let b=0,S=0;for(;b<x.length;){const k=f+b,E=r.find(B=>k>=B.start&&k<B.end);if(!E){const B=y[S];m+=B,S++,b++;continue}const T=E.end-k,N=x.length-b,j=Math.min(T,N);let O=S,A=0;for(;A<j&&O<y.length;){if(y[O]==="&"){const B=y.indexOf(";",O);B!==-1&&B-O<10?O=B+1:O++}else O++;A++}const R=y.slice(S,O),L=u(E.type);L?m+=L.open+R+L.close:m+=R,S=O,b+=j}f+=x.length}return m}var Lr;(function(e){e.LEFT="L",e.RIGHT="R"})(Lr||(Lr={}));let TJ=class as extends w.Component{styles;wordDiffCache=new Map;contentColumnRef=w.createRef();charMeasureRef=w.createRef();stickyHeaderRef=w.createRef();resizeObserver=null;static defaultProps={oldValue:"",newValue:"",splitView:!0,highlightLines:[],disableWordDiff:!1,compareMethod:pr.CHARS,styles:{},hideLineNumbers:!1,extraLinesSurroundingDiff:3,showDiffOnly:!0,useDarkTheme:!1,linesOffset:0,nonce:""};constructor(t){super(t),this.state={expandedBlocks:[],noSelect:void 0,scrollableContainerRef:w.createRef(),computedDiffResult:{},isLoading:!1,visibleStartRow:0,contentColumnWidth:null,charWidth:null,cumulativeOffsets:null}}getWordDiffValues=(t,n,r)=>{if(!t||!n)return{leftValue:t?.value,rightValue:n?.value};if(t.rawValue===void 0||n.rawValue===void 0)return{leftValue:t.value,rightValue:n.value};const i=`${r}-${t.rawValue}-${n.rawValue}`;let s=this.wordDiffCache.get(i);if(!s){const a=this.props.compareMethod===pr.JSON||this.props.compareMethod===pr.YAML?pr.CHARS:this.props.compareMethod,c=W8(t.rawValue,n.rawValue,a);s={left:c.left,right:c.right},this.wordDiffCache.set(i,s)}return{leftValue:s.left,rightValue:s.right}};resetCodeBlocks=()=>this.state.expandedBlocks.length>0?(this.setState({expandedBlocks:[]}),!0):!1;onBlockExpand=t=>{const n=this.state.expandedBlocks.slice();n.push(t),this.setState({expandedBlocks:n},()=>this.recalculateOffsets())};getStickyHeaderHeight(){return this.stickyHeaderRef.current?.offsetHeight||0}measureCharWidth(){const t=this.charMeasureRef.current;return t&&t.getBoundingClientRect().width||7.2}measureContentColumnWidth(){const t=this.contentColumnRef.current;if(t&&t.clientWidth>0){const p=window.getComputedStyle(t),y=parseFloat(p.paddingLeft)+parseFloat(p.paddingRight),x=t.clientWidth-y;if(x>0)return x}const n=this.state.scrollableContainerRef.current;if(!n||n.clientWidth<=0)return null;const r=n.clientWidth,i=this.props.hideLineNumbers?0:50,s=28,a=(this.props.splitView,2),c=this.props.splitView?2:1,u=this.props.splitView?2:1,f=a*i+c*s,m=r-f;return Math.max(100,m/u)}getTextLength(t){return t?typeof t=="string"?t.length:t.reduce((n,r)=>n+(typeof r.value=="string"?r.value.length:0),0):0}buildCumulativeOffsets(t,n,r,i,s,a,c,u){const f=[0],m=new Set;for(let p=0;p<t.length;p++){const y=t[p];if(s){const T=n[p];if(T!==void 0&&!i.includes(T)){const N=r[T].endLine===p;!m.has(T)&&N&&(m.add(T),f.push(f[f.length-1]+as.ESTIMATED_ROW_HEIGHT));continue}}const x=y.left?.value?this.getTextLength(y.left.value):0,b=y.right?.value?this.getTextLength(y.right.value):0,S=u?Math.max(x,b):x||b,k=Math.floor(c/a),E=k>0?Math.max(1,Math.ceil(S/k)):1;f.push(f[f.length-1]+E*as.ESTIMATED_ROW_HEIGHT)}return f}findLineAtOffset(t,n){let r=0,i=n.length-2;for(;r<i;){const s=Math.floor((r+i+1)/2);n[s]<=t?r=s:i=s-1}return r}recalculateOffsets=()=>{if(!this.props.infiniteLoading)return;const t=this.measureContentColumnWidth(),n=this.measureCharWidth();if(!t)return;const r=this.getMemoisedKey(),{lineInformation:i,lineBlocks:s,blocks:a}=this.state.computedDiffResult[r]??{};if(!i)return;const c=this.buildCumulativeOffsets(i,s,a,this.state.expandedBlocks,this.props.showDiffOnly,n,t,this.props.splitView);this.setState({cumulativeOffsets:c,contentColumnWidth:t,charWidth:n},()=>{this.onScroll()})};computeStyles=SK(CJ);onLineNumberClickProxy=t=>this.props.onLineNumberClick?n=>this.props.onLineNumberClick(t,n):()=>{};shouldHighlightWordDiff=()=>{const{compareMethod:t}=this.props;return t===pr.CHARS||t===pr.WORDS||t===pr.WORDS_WITH_SPACE||t===pr.JSON||t===pr.YAML};renderWordDiff=(t,n)=>{const r=this.shouldHighlightWordDiff(),i=t.map(a=>typeof a.value=="string"?a.value:"").join("");if(i.length>500)return[h.jsx("span",{children:i},"long-line")];if(n){const a=n(i),c=a?.props?.dangerouslySetInnerHTML?.__html;if(typeof c=="string"){const u=EJ(c,t,{wordDiff:this.styles.wordDiff,wordAdded:r?this.styles.wordAdded:"",wordRemoved:r?this.styles.wordRemoved:""});return[w.cloneElement(a,{key:"highlighted-diff",dangerouslySetInnerHTML:{__html:u}})]}}return t.map((a,c)=>{let u;return typeof a.value=="string"?u=a.value:u=void 0,a.type===Nn.ADDED?h.jsx("ins",{className:ro(this.styles.wordDiff,{[this.styles.wordAdded]:r}),children:u},c):a.type===Nn.REMOVED?h.jsx("del",{className:ro(this.styles.wordDiff,{[this.styles.wordRemoved]:r}),children:u},c):h.jsx("span",{className:ro(this.styles.wordDiff),children:u},c)})};renderLine=(t,n,r,i,s,a)=>{const c=`${r}-${t}`,u=`${a}-${s}`,f=this.props.highlightLines.includes(c)||this.props.highlightLines.includes(u),m=n===Nn.ADDED,p=n===Nn.REMOVED,y=n===Nn.CHANGED;let x;const b=Array.isArray(i);b?x=this.renderWordDiff(i,this.props.renderContent):this.props.renderContent?x=this.props.renderContent(i):x=i;let S="div";return m&&!b?S="ins":p&&!b&&(S="del"),h.jsxs(h.Fragment,{children:[!this.props.hideLineNumbers&&h.jsx("td",{onClick:t&&this.onLineNumberClickProxy(c),className:ro(this.styles.gutter,{[this.styles.emptyGutter]:!t,[this.styles.diffAdded]:m,[this.styles.diffRemoved]:p,[this.styles.diffChanged]:y,[this.styles.highlightedGutter]:f}),children:h.jsx("pre",{className:this.styles.lineNumber,children:t})}),!this.props.splitView&&!this.props.hideLineNumbers&&h.jsx("td",{onClick:s&&this.onLineNumberClickProxy(u),className:ro(this.styles.gutter,{[this.styles.emptyGutter]:!s,[this.styles.diffAdded]:m,[this.styles.diffRemoved]:p,[this.styles.diffChanged]:y,[this.styles.highlightedGutter]:f}),children:h.jsx("pre",{className:this.styles.lineNumber,children:s})}),this.props.renderGutter?this.props.renderGutter({lineNumber:t,type:n,prefix:r,value:i,additionalLineNumber:s,additionalPrefix:a,styles:this.styles}):null,h.jsx("td",{className:ro(this.styles.marker,{[this.styles.emptyLine]:!x,[this.styles.diffAdded]:m,[this.styles.diffRemoved]:p,[this.styles.diffChanged]:y,[this.styles.highlightedLine]:f}),children:h.jsxs("pre",{children:[m&&"+",p&&"-"]})}),h.jsx("td",{ref:r===Lr.LEFT&&!this.state.cumulativeOffsets?this.contentColumnRef:void 0,className:ro(this.styles.content,{[this.styles.emptyLine]:!x,[this.styles.diffAdded]:m,[this.styles.diffRemoved]:p,[this.styles.diffChanged]:y,[this.styles.highlightedLine]:f,left:r===Lr.LEFT,right:r===Lr.RIGHT}),onMouseDown:()=>{const k=document.getElementsByClassName(r===Lr.LEFT?"right":"left");for(let E=0;E<k.length;E++)k.item(E).classList.add(this.styles.noSelect)},title:m&&!b?"Added line":p&&!b?"Removed line":void 0,children:h.jsx(S,{className:this.styles.contentText,children:x})})]})};renderSplitView=({left:t,right:n},r)=>{const{leftValue:i,rightValue:s}=this.getWordDiffValues(t,n,r);return h.jsxs("tr",{className:this.styles.line,children:[this.renderLine(t.lineNumber,t.type,Lr.LEFT,i),this.renderLine(n.lineNumber,n.type,Lr.RIGHT,s)]},r)};renderInlineView=({left:t,right:n},r)=>{const{leftValue:i,rightValue:s}=this.getWordDiffValues(t,n,r);let a;return t.type===Nn.REMOVED&&n.type===Nn.ADDED?h.jsxs(w.Fragment,{children:[h.jsx("tr",{className:this.styles.line,children:this.renderLine(t.lineNumber,t.type,Lr.LEFT,i,null)}),h.jsx("tr",{className:this.styles.line,children:this.renderLine(null,n.type,Lr.RIGHT,s,n.lineNumber,Lr.RIGHT)})]},r):(t.type===Nn.REMOVED&&(a=this.renderLine(t.lineNumber,t.type,Lr.LEFT,i,null)),t.type===Nn.DEFAULT&&(a=this.renderLine(t.lineNumber,t.type,Lr.LEFT,i,n.lineNumber,Lr.RIGHT)),n.type===Nn.ADDED&&(a=this.renderLine(null,n.type,Lr.RIGHT,s,n.lineNumber)),h.jsx("tr",{className:this.styles.line,children:a},r))};onBlockClickProxy=t=>()=>this.onBlockExpand(t);renderSkippedLineIndicator=(t,n,r,i)=>{const{hideLineNumbers:s,splitView:a}=this.props,c=this.props.codeFoldMessageRenderer?this.props.codeFoldMessageRenderer(t,r,i):h.jsxs("span",{className:this.styles.codeFoldContent,children:["@@ -",r-t,",",t," +",i-t,",",t," @@"]}),u=h.jsx("td",{className:this.styles.codeFoldContentContainer,children:h.jsx("button",{type:"button",className:this.styles.codeFoldExpandButton,onClick:this.onBlockClickProxy(n),tabIndex:0,children:c})}),f=!a&&!s,m=h.jsx("td",{className:this.styles.codeFoldGutter,children:h.jsx(o4,{})});return h.jsxs("tr",{className:this.styles.codeFold,onClick:this.onBlockClickProxy(n),role:"button",tabIndex:0,children:[!s&&m,this.props.renderGutter?h.jsx("td",{className:this.styles.codeFoldGutter}):null,h.jsx("td",{className:ro({[this.styles.codeFoldGutter]:f})}),f?h.jsxs(w.Fragment,{children:[h.jsx("td",{}),u]}):h.jsxs(w.Fragment,{children:[u,this.props.renderGutter?h.jsx("td",{}):null,h.jsx("td",{}),h.jsx("td",{}),s?null:h.jsx("td",{})]})]},`${r}-${i}`)};getMemoisedKey=()=>{const{oldValue:t,newValue:n,disableWordDiff:r,compareMethod:i,linesOffset:s,alwaysShowLines:a,extraLinesSurroundingDiff:c}=this.props;return JSON.stringify({oldValue:t,newValue:n,disableWordDiff:r,compareMethod:i,linesOffset:s,alwaysShowLines:a,extraLinesSurroundingDiff:c})};memoisedCompute=async()=>{const{oldValue:t,newValue:n,disableWordDiff:r,compareMethod:i,linesOffset:s}=this.props,a=this.getMemoisedKey();if(this.state.computedDiffResult[a]){this.setState(S=>({...S,isLoading:!1}));return}const c=this.props.infiniteLoading?.containerHeight,u=c?typeof c=="number"?c:parseInt(c,10)||0:0,f=!r&&!!this.props.infiniteLoading&&u>0&&u<2e3,{lineInformation:m,diffLines:p}=await PZ(t,n,r,i,s,this.props.alwaysShowLines,f),y=this.props.extraLinesSurroundingDiff<0?0:Math.round(this.props.extraLinesSurroundingDiff),{lineBlocks:x,blocks:b}=CK(m,p,y);this.state.computedDiffResult[a]={lineInformation:m,lineBlocks:x,blocks:b},this.setState(S=>({...S,computedDiffResult:this.state.computedDiffResult,isLoading:!1}),()=>{this.props.infiniteLoading&&requestAnimationFrame(()=>this.recalculateOffsets())})};static ESTIMATED_ROW_HEIGHT=19;onScroll=()=>{const t=this.state.scrollableContainerRef.current;if(!t||!this.props.infiniteLoading)return;const n=this.getStickyHeaderHeight(),r=Math.max(0,t.scrollTop-n),{cumulativeOffsets:i}=this.state,s=i?this.findLineAtOffset(r,i):Math.floor(r/as.ESTIMATED_ROW_HEIGHT);s!==this.state.visibleStartRow&&this.setState({visibleStartRow:s})};renderDiff=()=>{const{splitView:t,infiniteLoading:n,showDiffOnly:r}=this.props,{computedDiffResult:i,expandedBlocks:s,visibleStartRow:a,scrollableContainerRef:c,cumulativeOffsets:u}=this.state,f=this.getMemoisedKey(),{lineInformation:m=[],lineBlocks:p=[],blocks:y=[]}=i[f]??{};let x=0,b=1/0;const S=5;if(n&&c.current){const I=c.current,U=this.getStickyHeaderHeight(),Y=Math.max(0,I.scrollTop-U);if(u){const V=u[u.length-1]||0,q=u.length-2;x=Math.max(0,this.findLineAtOffset(Y,u)-S),b=this.findLineAtOffset(Y+I.clientHeight,u)+S;const H=Math.ceil(I.clientHeight/as.ESTIMATED_ROW_HEIGHT);b=Math.max(b,x+H+S),Y+I.clientHeight>=V-S*as.ESTIMATED_ROW_HEIGHT&&(b=q+S)}else{const V=Math.ceil(I.clientHeight/as.ESTIMATED_ROW_HEIGHT);x=Math.max(0,a-S),b=a+V+S}}const k=new Map,E=new Set;let T=0;for(let I=0;I<m.length;I++){const U=p[I];if(r&&U!==void 0)if(s.includes(U))k.set(I,T),T++;else{const Y=y[U].endLine===I;!E.has(U)&&Y&&(E.add(U),k.set(I,T),T++)}else k.set(I,T),T++}const N=T,j=[];let O=0,A=!1,R=-1;E.clear();for(let I=0;I<m.length;I++){const U=m[I],Y=k.get(I);if(Y!==void 0&&!(Y<x)){if(Y>b)break;if(A||(O=u?u[Y]||0:Y*as.ESTIMATED_ROW_HEIGHT,A=!0),R=Y,r){const V=p[I];if(V!==void 0){const q=y[V].endLine===I;if(!s.includes(V)&&q){j.push(h.jsx(w.Fragment,{children:this.renderSkippedLineIndicator(y[V].lines,V,U.left.lineNumber,U.right.lineNumber)},I));continue}if(!s.includes(V))continue}}j.push(t?this.renderSplitView(U,I):this.renderInlineView(U,I))}}const L=u?u[u.length-1]||0:N*as.ESTIMATED_ROW_HEIGHT,B=u&&R>=0?L-(u[R+1]||L):0;return{diffNodes:j,blocks:y,lineInformation:m,totalRenderedRows:N,topPadding:O,bottomPadding:B,totalContentHeight:L,renderedCount:j.length,debug:{visibleRowStart:x,visibleRowEnd:b,totalRows:N,offsetsLength:u?.length??0,renderedCount:j.length,scrollTop:c.current?.scrollTop??0,headerHeight:this.getStickyHeaderHeight(),contentScrollTop:c.current?Math.max(0,c.current.scrollTop-this.getStickyHeaderHeight()):0,clientHeight:c.current?.clientHeight??0}}};componentDidUpdate(t){if(t.oldValue!==this.props.oldValue||t.newValue!==this.props.newValue||t.compareMethod!==this.props.compareMethod||t.disableWordDiff!==this.props.disableWordDiff||t.linesOffset!==this.props.linesOffset){this.wordDiffCache.clear();const n=this.state.scrollableContainerRef.current;n&&(n.scrollTop=0),this.setState(r=>({...r,isLoading:!0,visibleStartRow:0,cumulativeOffsets:null})),this.memoisedCompute()}}componentDidMount(){if(this.setState(t=>({...t,isLoading:!0})),this.memoisedCompute(),typeof ResizeObserver<"u"&&this.props.infiniteLoading){this.resizeObserver=new ResizeObserver(()=>{requestAnimationFrame(()=>this.recalculateOffsets())});const t=this.state.scrollableContainerRef.current;t&&this.resizeObserver.observe(t)}}componentWillUnmount(){this.resizeObserver?.disconnect()}render=()=>{const{oldValue:t,newValue:n,useDarkTheme:r,leftTitle:i,rightTitle:s,splitView:a,compareMethod:c,hideLineNumbers:u,nonce:f}=this.props;if(typeof c=="string"&&c!==pr.JSON&&(typeof t!="string"||typeof n!="string"))throw Error('"oldValue" and "newValue" should be strings');this.styles=this.computeStyles(this.props.styles,r,f);const m=this.renderDiff();this.props.renderGutter;let p=0,y=0;for(const O of m.lineInformation)O.left.type===Nn.ADDED&&y++,O.right.type===Nn.ADDED&&y++,O.left.type===Nn.REMOVED&&p++,O.right.type===Nn.REMOVED&&p++;const x=p+y,b=Math.round(y/x*100),S=[];for(let O=0;O<5;O++)b>O*20?S.push(h.jsx("span",{className:ro(this.styles.block,this.styles.blockAddition)},O)):S.push(h.jsx("span",{className:ro(this.styles.block,this.styles.blockDeletion)},O));const k=this.state.expandedBlocks.length===m.blocks.length,E=this.props.loadingElement,T=this.props.infiniteLoading?{overflowY:"scroll",overflowX:"hidden",height:this.props.infiniteLoading.containerHeight}:{},N=!!this.props.infiniteLoading&&!this.state.cumulativeOffsets,j=h.jsxs("table",{className:ro(this.styles.diffContainer,{[this.styles.splitView]:a,[this.styles.noWrap]:N}),onMouseUp:()=>{const O=document.getElementsByClassName("right");for(let R=0;R<O.length;R++)O.item(R).classList.remove(this.styles.noSelect);const A=document.getElementsByClassName("left");for(let R=0;R<A.length;R++)A.item(R).classList.remove(this.styles.noSelect)},children:[h.jsxs("colgroup",{children:[!this.props.hideLineNumbers&&h.jsx("col",{width:"50px"}),!a&&!this.props.hideLineNumbers&&h.jsx("col",{width:"50px"}),this.props.renderGutter&&h.jsx("col",{width:"50px"}),h.jsx("col",{width:"28px"}),h.jsx("col",{width:"auto"}),a&&h.jsxs(h.Fragment,{children:[!this.props.hideLineNumbers&&h.jsx("col",{width:"50px"}),this.props.renderGutter&&h.jsx("col",{width:"50px"}),h.jsx("col",{width:"28px"}),h.jsx("col",{width:"auto"})]})]}),h.jsx("tbody",{children:m.diffNodes})]});return h.jsxs("div",{style:{...T,position:"relative"},onScroll:this.onScroll,ref:this.state.scrollableContainerRef,children:[(!this.props.hideSummary||i||s)&&h.jsxs("div",{ref:this.stickyHeaderRef,className:this.styles.stickyHeader,children:[!this.props.hideSummary&&h.jsxs("div",{className:this.styles.summary,role:"banner",children:[h.jsx("button",{type:"button",className:this.styles.allExpandButton,onClick:()=>{this.setState({expandedBlocks:k?[]:m.blocks.map(O=>O.index)},()=>this.recalculateOffsets())},children:k?h.jsx(kJ,{}):h.jsx(o4,{})})," ",x,h.jsx("div",{style:{display:"flex",gap:"1px"},children:S}),this.props.summary?h.jsx("span",{children:this.props.summary}):null]}),(i||s)&&h.jsxs("div",{className:this.styles.columnHeaders,children:[h.jsx("div",{className:this.styles.titleBlock,children:i?h.jsx("pre",{className:this.styles.contentText,children:i}):null}),a&&h.jsx("div",{className:this.styles.titleBlock,children:s?h.jsx("pre",{className:this.styles.contentText,children:s}):null})]})]}),this.state.isLoading&&E&&h.jsx(E,{}),this.props.infiniteLoading?h.jsx("div",{style:{height:m.totalContentHeight,position:"relative"},children:h.jsx("div",{style:{position:"absolute",top:m.topPadding,left:0,right:0},children:j})}):j,h.jsx("span",{ref:this.charMeasureRef,style:{position:"absolute",top:0,left:"-9999px",visibility:"hidden",whiteSpace:"pre",fontFamily:"monospace",fontSize:12},"aria-hidden":"true",children:"M"}),this.props.infiniteLoading&&this.props.showDebugInfo&&h.jsxs("div",{style:{position:"fixed",top:10,right:10,background:"rgba(0,0,0,0.85)",color:"#0f0",padding:"10px",fontFamily:"monospace",fontSize:"11px",zIndex:9999,borderRadius:"4px",maxWidth:"300px",lineHeight:1.4},children:[h.jsx("div",{style:{fontWeight:"bold",marginBottom:"5px",color:"#fff"},children:"Debug Info"}),h.jsxs("div",{children:["scrollTop: ",m.debug.scrollTop]}),h.jsxs("div",{children:["headerHeight: ",m.debug.headerHeight]}),h.jsxs("div",{children:["contentScrollTop: ",m.debug.contentScrollTop]}),h.jsxs("div",{children:["clientHeight: ",m.debug.clientHeight]}),h.jsxs("div",{style:{marginTop:"5px",borderTop:"1px solid #444",paddingTop:"5px"},children:[h.jsxs("div",{children:["visibleRowStart: ",m.debug.visibleRowStart]}),h.jsxs("div",{children:["visibleRowEnd: ",m.debug.visibleRowEnd]})]}),h.jsxs("div",{style:{marginTop:"5px",borderTop:"1px solid #444",paddingTop:"5px"},children:[h.jsxs("div",{children:["totalRows: ",m.debug.totalRows]}),h.jsxs("div",{children:["offsetsLength: ",m.debug.offsetsLength]}),h.jsxs("div",{children:["renderedCount: ",m.debug.renderedCount]})]}),h.jsxs("div",{style:{marginTop:"5px",borderTop:"1px solid #444",paddingTop:"5px"},children:[h.jsxs("div",{children:["topPadding: ",m.topPadding.toFixed(0)]}),h.jsxs("div",{children:["bottomPadding: ",m.bottomPadding.toFixed(0)]}),h.jsxs("div",{children:["totalContentHeight: ",m.totalContentHeight.toFixed(0)]})]}),h.jsxs("div",{style:{marginTop:"5px",borderTop:"1px solid #444",paddingTop:"5px",color:"#ff0"},children:[h.jsxs("div",{children:["cumulativeOffsets: ",this.state.cumulativeOffsets?"SET":"NULL"]}),h.jsxs("div",{children:["columnWidth: ",this.state.contentColumnWidth?.toFixed(0)??"N/A","px"]}),h.jsxs("div",{children:["charWidth: ",this.state.charWidth?.toFixed(2)??"N/A","px"]}),h.jsxs("div",{children:["charsPerRow: ",this.state.contentColumnWidth&&this.state.charWidth?Math.floor(this.state.contentColumnWidth/this.state.charWidth):"N/A"]})]}),this.state.cumulativeOffsets&&h.jsxs("div",{style:{marginTop:"5px",borderTop:"1px solid #444",paddingTop:"5px",color:"#0ff",fontSize:"10px"},children:[h.jsxs("div",{children:["offsets[",m.debug.visibleRowEnd,"]: ",this.state.cumulativeOffsets[m.debug.visibleRowEnd]?.toFixed(0)??"N/A"]}),h.jsxs("div",{children:["offsets[",m.debug.totalRows-1,"]: ",this.state.cumulativeOffsets[m.debug.totalRows-1]?.toFixed(0)??"N/A"]}),h.jsxs("div",{children:["offsets[",m.debug.totalRows,"]: ",this.state.cumulativeOffsets[m.debug.totalRows]?.toFixed(0)??"N/A"]}),h.jsxs("div",{style:{marginTop:"3px"},children:["viewportEnd: ",(m.debug.contentScrollTop+m.debug.clientHeight).toFixed(0)]}),h.jsxs("div",{style:{marginTop:"3px",color:"#f0f"},children:["scrollHeight: ",this.state.scrollableContainerRef.current?.scrollHeight??"N/A"]}),h.jsxs("div",{children:["maxScrollTop: ",(this.state.scrollableContainerRef.current?.scrollHeight??0)-m.debug.clientHeight]})]})]})]})}};function NJ(){return h.jsx("div",{className:"bg-card absolute inset-0 z-20 flex items-center justify-center",children:h.jsx(ei,{className:"text-muted-foreground size-5 animate-spin"})})}const RJ={codeFoldGutter:{cursor:"pointer"},contentText:{fontFamily:'"JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace',fontSize:"12px",lineHeight:"1.6"},diffContainer:{"& pre":{fontFamily:'"JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace'},fontFamily:'"JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace',fontSize:"12px"},gutter:{"& pre":{color:"var(--muted-foreground)",opacity:.7},minWidth:"2.5rem",padding:"0 10px",userSelect:"none"},line:{"&:hover":{background:"color-mix(in oklch, var(--muted) 40%, transparent)"}},lineNumber:{color:"var(--muted-foreground)",opacity:.7},marker:{paddingLeft:"8px",paddingRight:"4px"},titleBlock:{borderBottom:"1px solid var(--border)",fontFamily:'"JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace',fontSize:"12px",padding:"10px 12px"},variables:{dark:{addedBackground:"color-mix(in oklch, var(--primary) 18%, transparent)",addedColor:"var(--foreground)",addedGutterBackground:"color-mix(in oklch, var(--primary) 26%, transparent)",addedGutterColor:"var(--muted-foreground)",codeFoldBackground:"var(--muted)",codeFoldContentColor:"var(--muted-foreground)",codeFoldGutterBackground:"var(--muted)",diffViewerBackground:"var(--card)",diffViewerColor:"var(--foreground)",diffViewerTitleBackground:"var(--muted)",diffViewerTitleBorderColor:"var(--border)",diffViewerTitleColor:"var(--foreground)",emptyLineBackground:"var(--card)",gutterBackground:"var(--card)",gutterBackgroundDark:"var(--card)",gutterColor:"var(--muted-foreground)",highlightBackground:"color-mix(in oklch, var(--accent) 30%, transparent)",highlightGutterBackground:"color-mix(in oklch, var(--accent) 40%, transparent)",removedBackground:"color-mix(in oklch, var(--destructive) 16%, transparent)",removedColor:"var(--foreground)",removedGutterBackground:"color-mix(in oklch, var(--destructive) 24%, transparent)",removedGutterColor:"var(--muted-foreground)",wordAddedBackground:"color-mix(in oklch, var(--primary) 40%, transparent)",wordRemovedBackground:"color-mix(in oklch, var(--destructive) 36%, transparent)"}}};function AJ({filename:e,hideSummary:t=!1,newContent:n,oldContent:r,showDiffOnly:i=!1,showLoadingOverlay:s=!0,viewMode:a="split"}){return h.jsx(TJ,{compareMethod:pr.WORDS,hideSummary:t,loadingElement:s?NJ:void 0,newValue:n,oldValue:r,showDiffOnly:i,splitView:a==="split",styles:RJ,summary:e,useDarkTheme:!0})}function r9(e){return h.jsx(AJ,{...e})}function OJ({file:e,onOpenFile:t,onStageToggle:n}){const r=e.isStaged?"staged":"unstaged",{data:i,error:s,isLoading:a}=yK({path:e.path,side:r});return a?h.jsx("div",{className:"flex h-full items-center justify-center",children:h.jsx(ei,{className:"text-muted-foreground size-5 animate-spin"})}):s?h.jsx("div",{className:"flex h-full items-center justify-center",children:h.jsx("p",{className:"text-muted-foreground text-sm",children:jn(s,"Failed to load diff")})}):i?h.jsxs("div",{className:"bg-card flex h-full flex-col overflow-auto rounded-md",children:[h.jsx(s8,{file:e,onOpenFile:()=>t(e),onStageToggle:()=>n(e)}),h.jsx("div",{className:"flex-1 [&>div]:min-h-full",children:h.jsx(r9,{filename:e.path,hideSummary:!0,newContent:i.newContent,oldContent:i.oldContent,viewMode:"split"})})]}):h.jsx("div",{className:"flex h-full items-center justify-center",children:h.jsx("p",{className:"text-muted-foreground text-sm",children:"No diff available"})})}const jJ=e=>{const{apiClient:t}=$e.getState();return t?t.request(qn.DISCARD,e):Promise.reject(new Error("Not connected"))},MJ=({mutationConfig:e}={})=>{const t=un(),{onSuccess:n,...r}=e??{};return dn({onSuccess(...i){t.invalidateQueries({queryKey:Ni().queryKey}),n?.(...i)},...r,mutationFn:jJ})};function DJ({files:e,onOpenChange:t,open:n}){const r=MJ(),i=async()=>{try{await r.mutateAsync({filePaths:e.map(a=>a.path)}),ht.success(e.length===1?`Discarded changes in ${e[0].path}`:`Discarded changes in ${e.length} files`),t(!1)}catch(a){ht.error(jn(a,"Failed to discard changes"))}},s=e.length===1;return h.jsx(Pf,{onOpenChange:t,open:n,children:h.jsxs(zf,{children:[h.jsxs(Ff,{children:[h.jsx(Hf,{children:s?"Discard changes?":`Discard changes in ${e.length} files?`}),h.jsx(Uf,{children:s?h.jsxs(h.Fragment,{children:["Unstaged changes in"," ",h.jsx("code",{className:"bg-muted rounded px-1.5 py-0.5 text-sm",children:e[0].path})," will be lost and cannot be restored."]}):"Unstaged changes in the selected files will be lost and cannot be restored."})]}),h.jsxs(Bf,{children:[h.jsx(Vf,{children:"Cancel"}),h.jsx(ze,{disabled:r.isPending,onClick:i,variant:"destructive",children:r.isPending?"Discarding…":"Discard changes"})]})]})})}const _J={added:{label:"Added",letter:"A",textClass:"text-primary-foreground"},deleted:{label:"Deleted",letter:"D",textClass:"text-destructive"},modified:{label:"Modified",letter:"M",textClass:"text-amber-500"},unmerged:{label:"Conflict",letter:"!",textClass:"text-amber-500"},untracked:{label:"Untracked",letter:"?",textClass:"text-primary-foreground"}},LJ={both_added:"Both added",both_modified:"Both modified",deleted_modified:"Deleted / modified"};function IJ({disabled:e,file:t,isSelected:n,onAction:r,onDiscard:i,onSelect:s}){const a=_J[t.status],c=t.path.split("/").pop()??t.path,u=t.path.slice(0,t.path.length-c.length).replace(/\/$/,""),f=p=>{p.stopPropagation(),r(t)},m=p=>{p.stopPropagation(),i?.(t)};return h.jsxs("div",{className:ae("group flex cursor-pointer items-center gap-2 rounded px-2 py-1 transition-colors h-8",n?"bg-muted":"hover:bg-muted/50"),onClick:()=>s?.(t),onKeyDown:p=>{(p.key==="Enter"||p.key===" ")&&(p.preventDefault(),s?.(t))},role:"button",tabIndex:0,children:[h.jsx(E0,{className:"text-primary-foreground size-4 shrink-0",strokeWidth:2}),h.jsxs(ms,{disableHoverablePopup:!0,children:[h.jsxs(gs,{render:h.jsx("div",{className:"flex min-w-0 flex-1 items-baseline gap-1.5"}),children:[h.jsx("span",{className:"text-foreground truncate text-sm",children:c}),u&&h.jsx("span",{className:"text-muted-foreground truncate text-xs group-hover:hidden",children:u})]}),h.jsx(ys,{className:"pointer-events-none max-w-lg break-all",side:"bottom",children:t.path})]}),h.jsxs("div",{className:"flex items-center gap-1",children:[h.jsxs("div",{className:"hidden items-center gap-1 group-hover:flex group-focus-within:flex",children:[i&&h.jsx(ze,{className:"size-5 transition-colors hover:bg-foreground/15 dark:hover:bg-foreground/15 hover:text-foreground",disabled:e,onClick:m,size:"icon-xs",title:"Discard changes",variant:"ghost",children:h.jsx(TA,{className:"size-3"})}),h.jsx(ze,{className:"size-5 transition-colors hover:bg-foreground/15 dark:hover:bg-foreground/15 hover:text-foreground",disabled:e,onClick:f,size:"icon-xs",title:t.isStaged?"Unstage":"Stage",variant:"ghost",children:t.isStaged?h.jsx(vv,{className:"size-3"}):h.jsx(Ta,{className:"size-3"})})]}),h.jsx("span",{className:ae("w-4 text-center font-mono text-xs font-semibold",a.textClass),title:t.conflictType?`Conflict: ${LJ[t.conflictType]}`:a.label,children:a.letter})]})]})}function G2(e){e.stopPropagation()}function K2({disabled:e,files:t,isFileSelected:n,label:r,onDiscardFile:i,onDiscardGroup:s,onFileAction:a,onFileSelect:c,onGroupAction:u,onOpenAll:f,openAllLabel:m,variant:p}){const[y,x]=w.useState(!0);if(t.length===0)return null;const b=p==="stage"?Ta:vv,S=y?Mf:SA;return h.jsxs("section",{className:"flex flex-col",children:[h.jsxs("div",{"aria-expanded":y,className:"h-8 group hover:bg-muted/50 flex cursor-pointer items-center justify-between rounded px-1 py-1.5 transition-colors",onClick:()=>x(k=>!k),onKeyDown:k=>{(k.key==="Enter"||k.key===" ")&&(k.preventDefault(),x(E=>!E))},role:"button",tabIndex:0,children:[h.jsxs("div",{className:"flex items-center gap-1",children:[h.jsx(S,{className:"text-muted-foreground size-3.5",strokeWidth:2.5}),h.jsx("h3",{className:"text-muted-foreground text-sm font-bold",children:r}),h.jsx("span",{className:"text-muted-foreground bg-muted ml-1 rounded px-1.5 py-0.5 text-xs font-medium",children:t.length})]}),h.jsxs("div",{className:"flex items-center gap-1",children:[f&&h.jsx(ze,{className:"size-5 opacity-0 transition-colors group-hover:opacity-100 focus:opacity-100 hover:bg-foreground/15 dark:hover:bg-foreground/15 hover:text-foreground disabled:opacity-0",onClick:k=>{G2(k),f()},size:"icon-xs",title:m??"Open all",variant:"ghost",children:h.jsx(Kq,{className:"size-3"})}),s&&h.jsx(ze,{className:"size-5 opacity-0 transition-colors group-hover:opacity-100 focus:opacity-100 hover:bg-foreground/15 dark:hover:bg-foreground/15 hover:text-foreground disabled:opacity-0",disabled:e,onClick:k=>{G2(k),s()},size:"icon-xs",title:"Discard all changes",variant:"ghost",children:h.jsx(TA,{className:"size-3"})}),u&&h.jsx(ze,{className:"size-5 opacity-0 transition-colors group-hover:opacity-100 focus:opacity-100 hover:bg-foreground/15 dark:hover:bg-foreground/15 hover:text-foreground disabled:opacity-0",disabled:e,onClick:k=>{G2(k),u()},size:"icon-xs",title:p==="stage"?"Stage all":"Unstage all",variant:"ghost",children:h.jsx(b,{className:"size-3"})})]})]}),y&&h.jsx(Yb,{delay:500,children:h.jsx("div",{className:"flex flex-col",children:t.map(k=>h.jsx(IJ,{disabled:e,file:k,isSelected:n?.(k),onAction:a,onDiscard:i,onSelect:c},am(k)))})})]})}const PJ=e=>{const{apiClient:t}=$e.getState();return t?t.request(qn.DIFFS,e):Promise.reject(new Error("Not connected"))},zJ=e=>({placeholderData:wH,queryFn:()=>PJ(e),queryKey:["vc","diffs",e.side,...e.paths],staleTime:0}),FJ=({enabled:e=!0,paths:t,queryConfig:n,side:r})=>or({...zJ({paths:t,side:r}),enabled:e&&t.length>0,...n}),BJ=300;function p4({emptyMessage:e,files:t,onOpenFile:n,onStageToggle:r,side:i,title:s}){const a=w.useMemo(()=>t.map(b=>b.path),[t]),{data:c,error:u,isPending:f}=FJ({paths:a,side:i}),m=w.useRef(!1),[p,y]=w.useState(!0);if(w.useEffect(()=>{if(m.current||!c)return;m.current=!0;const b=setTimeout(()=>y(!1),BJ);return()=>clearTimeout(b)},[c]),t.length===0)return h.jsx("div",{className:"flex h-full items-center justify-center bg-card rounded-md",children:h.jsx("p",{className:"text-secondary-foreground text-sm",children:e})});if(u)return h.jsx("div",{className:"flex h-full items-center justify-center bg-card rounded-md",children:h.jsx("p",{className:"text-secondary-foreground text-sm",children:jn(u,"Failed to load diffs")})});const x=f&&!c||p;return h.jsxs("div",{className:"bg-card relative flex h-full flex-col overflow-auto rounded-md",children:[c&&h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:"border-border bg-muted flex items-center gap-2 border-b px-4 py-2 text-sm font-semibold",children:[h.jsx("span",{className:"text-foreground",children:s}),h.jsxs("span",{className:"text-muted-foreground",children:[t.length," file",t.length===1?"":"s"]})]}),h.jsx("div",{className:"flex flex-col gap-4",children:c.diffs.map(b=>{const S=t.find(k=>k.path===b.path);return S?h.jsxs("div",{className:"flex flex-col",children:[h.jsx(s8,{file:S,onOpenFile:()=>n(S),onStageToggle:()=>r(S)}),h.jsx(r9,{filename:b.path,hideSummary:!0,newContent:b.newContent,oldContent:b.oldContent,showDiffOnly:!0,showLoadingOverlay:!1,viewMode:"split"})]},`${i}:${b.path}`):null})})]}),x&&h.jsx("div",{className:"bg-card absolute inset-0 z-30 flex items-center justify-center",children:h.jsx(ei,{className:"text-muted-foreground size-5 animate-spin"})})]})}function HJ({isCommitting:e,onConfirm:t,onOpenChange:n,open:r}){return h.jsx(Pf,{onOpenChange:n,open:r,children:h.jsxs(zf,{children:[h.jsxs(Ff,{children:[h.jsx(Hf,{children:"There are no staged changes to commit"}),h.jsx(Uf,{children:"Would you like to stage all your changes and commit them directly?"})]}),h.jsxs(Bf,{children:[h.jsx(Vf,{children:"Cancel"}),h.jsx(ze,{disabled:e,onClick:t,children:e?"Committing…":"Stage all & commit"})]})]})})}async function gd(e,t){try{await e}catch(n){ht.error(jn(n,t))}}function UJ(){const e=vl(),t=yi(xe=>xe.isAuthorized),n=$e(xe=>xe.selectedProject),{data:r,isFetching:i,isLoading:s,refetch:a}=Rv(),[c,u]=w.useState(),[f,m]=w.useState("single"),[p,y]=w.useState(),[x,b]=w.useState(""),[S,k]=w.useState(!1),E=tK(),T=dK(),N=rK(),j=cK(),O=r8(),A=oK(),R=aK(),{staged:L,unmerged:B,unstaged:I}=w.useMemo(()=>OA(r),[r]),U=w.useMemo(()=>c?[...B,...L,...I].find(xe=>am(xe)===c):void 0,[c,L,B,I]),Y=E.isPending||T.isPending||N.isPending||j.isPending||O.isPending||A.isPending||R.isPending;if(s)return h.jsx("div",{className:"flex h-full items-center justify-center",children:h.jsx(ei,{className:"text-muted-foreground size-5 animate-spin"})});if(!r?.initialized)return h.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-4",children:[h.jsxs("div",{className:"flex flex-col items-center gap-1 text-center",children:[h.jsx("h2",{className:"text-foreground text-lg font-semibold",children:"Version control not initialized"}),h.jsx("p",{className:"text-muted-foreground text-sm",children:"Initialize to start tracking changes in this project."})]}),h.jsx(Lv,{})]});const V=xe=>gd(E.mutateAsync({filePaths:[xe.path]}),"Failed to stage file"),q=xe=>gd(T.mutateAsync({filePaths:[xe.path]}),"Failed to unstage file"),H=()=>{const xe=I.map(Ge=>Ge.path);xe.length!==0&&gd(E.mutateAsync({filePaths:xe}),"Failed to stage all")},z=xe=>gd(E.mutateAsync({filePaths:xe}),"Failed to stage"),$=()=>z(B.map(xe=>xe.path)),G=async()=>{try{await A.mutateAsync(),ht.success("Merge aborted")}catch(xe){ht.error(jn(xe,"Failed to abort merge"))}},Q=()=>gd(T.mutateAsync({}),"Failed to unstage all"),_=async xe=>{try{return await N.mutateAsync({message:xe}),ht.success("Committed"),!0}catch(Ge){return fd(Ge,"Failed to commit",e,{projectPath:n}),!1}},P=async xe=>{try{return await R.mutateAsync({message:xe}),ht.success("Merge committed"),!0}catch(Ge){return fd(Ge,"Failed to commit merge",e,{projectPath:n}),!1}},W=async()=>{const xe=x.trim();if(!xe)return;if(r.mergeInProgress){await P(xe)&&b("");return}if(L.length===0&&I.length>0){k(!0);return}await _(xe)&&b("")},D=async()=>{const xe=x.trim();if(xe)try{await E.mutateAsync({}),await _(xe)&&(b(""),k(!1))}catch(Ge){fd(Ge,"Failed to stage & commit",e,{projectPath:n})}},Z=async()=>{try{const xe=await j.mutateAsync({setUpstream:!r.trackingBranch});ht.success(xe.alreadyUpToDate?"Already up to date":`Pushed ${xe.branch}`)}catch(xe){fd(xe,"Failed to push",e)}},ee=async()=>{try{const xe=await O.mutateAsync({});xe.conflicts&&xe.conflicts.length>0?ht.error(`Pull had conflicts in ${xe.conflicts.length} file(s)`):ht.success(xe.alreadyUpToDate?"Already up to date":`Pulled ${xe.branch}`)}catch(xe){fd(xe,"Failed to pull",e)}},J=xe=>{u(am(xe)),m("single")},he=xe=>am(xe)===c&&f==="single",fe=()=>m("multi-staged"),Se=()=>m("multi-unstaged"),Ae=xe=>{e(`/contexts?path=${encodeURIComponent(xe.path)}`)},Oe=xe=>xe.isStaged?q(xe):V(xe),Pe=xe=>y([xe]),_e=()=>{I.length>0&&y(I)},De=L.length+I.length+B.length>0;return h.jsxs("div",{className:"flex h-full w-full",children:[h.jsxs("aside",{className:"border-border flex h-full w-80 shrink-0 flex-col gap-2",children:[h.jsx(hK,{ahead:r.ahead,behind:r.behind,branch:r.branch,hasTracking:!!r.trackingBranch,isAborting:A.isPending,isAuthenticated:t,isPulling:O.isPending,isPushing:j.isPending,mergeInProgress:r.mergeInProgress,onAbortMerge:G,onPull:ee,onPush:Z}),h.jsx(pK,{canCommit:L.length>0||I.length>0,isCommitting:N.isPending,message:x,onCommit:W,onMessageChange:b}),h.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-2 overflow-y-auto",children:[h.jsx(K2,{disabled:Y,files:B,isFileSelected:he,label:"Merge Changes",onFileAction:V,onFileSelect:J,onGroupAction:$,variant:"stage"}),h.jsx(K2,{disabled:Y,files:L,isFileSelected:he,label:"Staged Changes",onFileAction:q,onFileSelect:J,onGroupAction:Q,onOpenAll:fe,openAllLabel:"Open all staged changes",variant:"unstage"}),h.jsx(K2,{disabled:Y,files:I,isFileSelected:he,label:"Changes",onDiscardFile:Pe,onDiscardGroup:_e,onFileAction:V,onFileSelect:J,onGroupAction:H,onOpenAll:Se,openAllLabel:"Open all changes",variant:"stage"})]})]}),h.jsxs("main",{className:"flex h-full flex-1 flex-col overflow-hidden pl-4",children:[f==="multi-staged"&&h.jsx(p4,{emptyMessage:"No staged changes",files:L,onOpenFile:Ae,onStageToggle:Oe,side:"staged",title:"Staged Changes"}),f==="multi-unstaged"&&h.jsx(p4,{emptyMessage:"No changes",files:I,onOpenFile:Ae,onStageToggle:Oe,side:"unstaged",title:"Changes"}),f==="single"&&(U?h.jsx(OJ,{file:U,onOpenFile:Ae,onStageToggle:Oe}):De?h.jsxs("div",{className:"bg-card text-secondary-foreground flex h-full flex-col items-center justify-center gap-3 rounded-md text-sm",children:[h.jsx(E0,{className:"size-8",strokeWidth:1.25}),h.jsx("p",{children:"Select a file to view changes"})]}):h.jsxs("div",{className:"flex h-full flex-col items-center justify-center rounded-md bg-card",children:[h.jsx("img",{alt:"",className:"size-30 mb-6",src:XG}),h.jsxs("div",{className:"flex flex-col items-center gap-1 text-center mb-5",children:[h.jsx("p",{className:"text-foreground text-base font-medium",children:"No changes detected"}),h.jsx("p",{className:"text-muted-foreground max-w-xs text-xs",children:"Your workspace is up to date. Any modifications to your files will appear here."})]}),h.jsx(ze,{className:"w-37",disabled:i,onClick:()=>a(),variant:"secondary",children:"Refresh"})]}))]}),h.jsx(DJ,{files:p??[],onOpenChange:xe=>{xe||y(void 0)},open:p!==void 0&&p.length>0}),h.jsx(HJ,{isCommitting:E.isPending||N.isPending,onConfirm:D,onOpenChange:k,open:S})]})}function VJ(){return h.jsx("div",{className:"h-full w-full",children:h.jsx(UJ,{})})}function kr({className:e,...t}){return h.jsx("div",{"data-slot":"skeleton",className:ae("animate-pulse rounded-md bg-muted",e),...t})}const qJ=["rules","hook","mcp","skill"];new Set(qJ);const $J=new Set(["hook","mcp","skill"]);function YJ(e){return $J.has(e)}const WJ=()=>{const{apiClient:e}=$e.getState();return e?e.request(ov.GET_AGENTS):Promise.reject(new Error("Not connected"))},GJ=()=>({gcTime:1/0,queryFn:WJ,queryKey:["connectors","agents"],staleTime:1/0}),KJ=({queryConfig:e}={})=>or({...GJ(),...e}),QJ=()=>{const{apiClient:e}=$e.getState();return e?e.request(ov.LIST):Promise.reject(new Error("Not connected"))},i9=()=>({queryFn:QJ,queryKey:["connectors","list"]}),XJ=({queryConfig:e}={})=>or({...i9(),...e}),ZJ=({agentId:e,connectorType:t})=>{const{apiClient:n}=$e.getState();return n?n.request(ov.INSTALL,{agentId:e,connectorType:t}):Promise.reject(new Error("Not connected"))},JJ=({mutationConfig:e}={})=>{const t=un(),{onSuccess:n,...r}=e??{};return dn({onSuccess(...i){t.invalidateQueries({queryKey:i9().queryKey}),n?.(...i)},...r,mutationFn:ZJ})},eee="data:image/svg+xml,%3csvg%20fill='%23fafafa'%20fill-rule='evenodd'%20height='1em'%20style='flex:none;line-height:1'%20viewBox='0%200%2024%2024'%20width='1em'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eAmp%3c/title%3e%3cpath%20d='M15.087%2023.18L12.03%2024l-2.097-7.823-5.738%205.738-2.251-2.251%205.718-5.719-7.769-2.082.82-3.057%2011.294%203.08%203.08%2011.295z'%3e%3c/path%3e%3cpath%20d='M19.505%2018.762l-3.057.82-2.564-9.573-9.572-2.564.819-3.057%2011.295%203.079%203.08%2011.295z'%3e%3c/path%3e%3cpath%20d='M23.893%2014.374l-3.057.82-2.565-9.572L8.7%203.057%209.52%200l11.295%203.08%203.079%2011.294z'%3e%3c/path%3e%3c/svg%3e",tee="data:image/svg+xml,%3csvg%20fill='%23fafafa'%20fill-rule='evenodd'%20height='1em'%20style='flex:none;line-height:1'%20viewBox='0%200%2024%2024'%20width='1em'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eAntigravity%3c/title%3e%3cpath%20d='M21.751%2022.607c1.34%201.005%203.35.335%201.508-1.508C17.73%2015.74%2018.904%201%2012.037%201%205.17%201%206.342%2015.74.815%2021.1c-2.01%202.009.167%202.511%201.507%201.506%205.192-3.517%204.857-9.714%209.715-9.714%204.857%200%204.522%206.197%209.714%209.715z'%3e%3c/path%3e%3c/svg%3e",nee="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20fill='none'%20viewBox='0%200%2016%2016'%3e%3cpath%20fill='%23fafafa'%20d='M9.972%2013.193h2.577q.187%200%20.277-.09t.091-.294V10.47q0-.324.133-.59.135-.27.36-.424a1%201%200%200%201%20.099-.06%201%201%200%200%201-.1-.058%201.1%201.1%200%200%201-.359-.424%201.3%201.3%200%200%201-.133-.59v-2.33q0-.202-.091-.293t-.277-.089H9.972a.38.38%200%200%201-.294-.124.4.4%200%200%201-.108-.281q.002-.176.131-.293a.46.46%200%200%201%20.313-.111h2.775c.36%200%20.642.097.836.288q.293.29.294.832V8.24q0%20.39.152.562.148.168.555.178a.4.4%200%200%201%20.27.128.41.41%200%200%201%20.104.287.44.44%200%200%201-.1.282.34.34%200%200%201-.277.132c-.266.006-.452.066-.55.177q-.151.174-.152.573v2.318c0%20.235-.043.44-.128.607a.85.85%200%200%201-.389.387%201.3%201.3%200%200%201-.534.124V14h-2.854a.45.45%200%200%201-.315-.118.38.38%200%200%201-.129-.286q0-.164.109-.282a.38.38%200%200%201%20.293-.123zM1.103%209.108a.4.4%200%200%201%20.276-.128q.4-.008.55-.177.15-.173.151-.562V5.923q.002-.543.294-.832c.195-.191.477-.288.836-.288h2.775q.188%200%20.313.111a.37.37%200%200%201%20.131.293.4.4%200%200%201-.108.281.38.38%200%200%201-.293.123H3.45q-.186%200-.277.09t-.092.292v2.33c0%20.213-.044.413-.133.59a1.1%201.1%200%200%201-.359.424%201%201%200%200%201-.1.059%201%201%200%200%201%20.1.059q.225.156.359.423t.133.59v2.34q0%20.203.092.293.088.09.277.089h2.577a.38.38%200%200%201%20.294.123q.108.12.108.281a.38.38%200%200%201-.13.286.45.45%200%200%201-.314.118l-2.775-.003a1.4%201.4%200%200%201-.613-.126.87.87%200%200%201-.388-.387%201.34%201.34%200%200%201-.129-.608v-2.318q0-.4-.151-.572-.151-.168-.55-.177a.35.35%200%200%201-.278-.132.42.42%200%200%201-.102-.28q0-.173.103-.287'/%3e%3cpath%20fill='%23fafafa'%20d='M5.437%2010.36a.986.986%200%200%201-.994-.975c0-.538.446-.976.994-.976s.994.438.994.976a.986.986%200%200%201-.994.976M10.562%208.41c.548%200%20.994.437.994.975a.986.986%200%200%201-.994.976.986.986%200%200%201-.994-.976c0-.538.446-.976.994-.976M8.74%202c.37%200%20.446.15.446.275v.034q0%20.034-.009.201-.01.162-.017.549-.018.378-.044%201.06c0%20.106-.065.233-.375.233-.311%200-.376-.126-.376-.23l-.07-1.835v-.003c0-.13.078-.284.446-.284M7.256%202c.369%200%20.446.15.446.275v.034q0%20.034-.01.201-.007.162-.017.549-.017.378-.043%201.06c0%20.106-.065.233-.376.233-.31%200-.375-.126-.375-.23l-.07-1.835v-.003C6.81%202.154%206.887%202%207.256%202'/%3e%3c/svg%3e",ree="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20fill='none'%20viewBox='0%200%2016%2016'%3e%3cpath%20fill='%23fafafa'%20d='M9.972%2013.193h2.577q.187%200%20.277-.09t.091-.294V10.47q0-.324.133-.59.135-.27.36-.424a1%201%200%200%201%20.099-.06%201%201%200%200%201-.1-.058%201.1%201.1%200%200%201-.359-.424%201.3%201.3%200%200%201-.133-.59v-2.33q0-.202-.091-.293t-.277-.089H9.972a.38.38%200%200%201-.294-.124.4.4%200%200%201-.108-.281q.002-.176.131-.293a.46.46%200%200%201%20.313-.111h2.775c.36%200%20.642.097.836.288q.293.29.294.832V8.24q0%20.39.152.562.148.168.555.178a.4.4%200%200%201%20.27.128.41.41%200%200%201%20.104.287.44.44%200%200%201-.1.282.34.34%200%200%201-.277.132c-.266.006-.452.066-.55.177q-.151.174-.152.573v2.318c0%20.235-.043.44-.128.607a.85.85%200%200%201-.389.387%201.3%201.3%200%200%201-.534.124V14h-2.854a.45.45%200%200%201-.315-.118.38.38%200%200%201-.129-.286q0-.164.109-.282a.38.38%200%200%201%20.293-.123zM1.103%209.108a.4.4%200%200%201%20.276-.128q.4-.008.55-.177.15-.173.151-.562V5.923q.002-.543.294-.832c.195-.191.477-.288.836-.288h2.775q.188%200%20.313.111a.37.37%200%200%201%20.131.293.4.4%200%200%201-.108.281.38.38%200%200%201-.293.123H3.45q-.186%200-.277.09t-.092.292v2.33c0%20.213-.044.413-.133.59a1.1%201.1%200%200%201-.359.424%201%201%200%200%201-.1.059%201%201%200%200%201%20.1.059q.225.156.359.423t.133.59v2.34q0%20.203.092.293.088.09.277.089h2.577a.38.38%200%200%201%20.294.123q.108.12.108.281a.38.38%200%200%201-.13.286.45.45%200%200%201-.314.118l-2.775-.003a1.4%201.4%200%200%201-.613-.126.87.87%200%200%201-.388-.387%201.34%201.34%200%200%201-.129-.608v-2.318q0-.4-.151-.572-.151-.168-.55-.177a.35.35%200%200%201-.278-.132.42.42%200%200%201-.102-.28q0-.173.103-.287'/%3e%3cpath%20fill='%23fafafa'%20d='M5.437%2010.36a.986.986%200%200%201-.994-.975c0-.538.446-.976.994-.976s.994.438.994.976a.986.986%200%200%201-.994.976M10.562%208.41c.548%200%20.994.437.994.975a.986.986%200%200%201-.994.976.986.986%200%200%201-.994-.976c0-.538.446-.976.994-.976M8.74%202c.37%200%20.446.15.446.275v.034q0%20.034-.009.201-.01.162-.017.549-.018.378-.044%201.06c0%20.106-.065.233-.375.233-.311%200-.376-.126-.376-.23l-.07-1.835v-.003c0-.13.078-.284.446-.284M7.256%202c.369%200%20.446.15.446.275v.034q0%20.034-.01.201-.007.162-.017.549-.017.378-.043%201.06c0%20.106-.065.233-.376.233-.31%200-.375-.126-.375-.23l-.07-1.835v-.003C6.81%202.154%206.887%202%207.256%202'/%3e%3c/svg%3e",m4="data:image/svg+xml,%3csvg%20fill='%23fafafa'%20fill-rule='evenodd'%20height='56'%20viewBox='0%200%2024%2024'%20width='56'%20xmlns='http://www.w3.org/2000/svg'%20style='flex:%200%200%20auto;%20line-height:%201;'%3e%3ctitle%3eClaude%3c/title%3e%3cpath%20d='M4.709%2015.955l4.72-2.647.08-.23-.08-.128H9.2l-.79-.048-2.698-.073-2.339-.097-2.266-.122-.571-.121L0%2011.784l.055-.352.48-.321.686.06%201.52.103%202.278.158%201.652.097%202.449.255h.389l.055-.157-.134-.098-.103-.097-2.358-1.596-2.552-1.688-1.336-.972-.724-.491-.364-.462-.158-1.008.656-.722.881.06.225.061.893.686%201.908%201.476%202.491%201.833.365.304.145-.103.019-.073-.164-.274-1.355-2.446-1.446-2.49-.644-1.032-.17-.619a2.97%202.97%200%2001-.104-.729L6.283.134%206.696%200l.996.134.42.364.62%201.414%201.002%202.229%201.555%203.03.456.898.243.832.091.255h.158V9.01l.128-1.706.237-2.095.23-2.695.08-.76.376-.91.747-.492.584.28.48.685-.067.444-.286%201.851-.559%202.903-.364%201.942h.212l.243-.242.985-1.306%201.652-2.064.73-.82.85-.904.547-.431h1.033l.76%201.129-.34%201.166-1.064%201.347-.881%201.142-1.264%201.7-.79%201.36.073.11.188-.02%202.856-.606%201.543-.28%201.841-.315.833.388.091.395-.328.807-1.969.486-2.309.462-3.439.813-.042.03.049.061%201.549.146.662.036h1.622l3.02.225.79.522.474.638-.079.485-1.215.62-1.64-.389-3.829-.91-1.312-.329h-.182v.11l1.093%201.068%202.006%201.81%202.509%202.33.127.578-.322.455-.34-.049-2.205-1.657-.851-.747-1.926-1.62h-.128v.17l.444.649%202.345%203.521.122%201.08-.17.353-.608.213-.668-.122-1.374-1.925-1.415-2.167-1.143-1.943-.14.08-.674%207.254-.316.37-.729.28-.607-.461-.322-.747.322-1.476.389-1.924.315-1.53.286-1.9.17-.632-.012-.042-.14.018-1.434%201.967-2.18%202.945-1.726%201.845-.414.164-.717-.37.067-.662.401-.589%202.388-3.036%201.44-1.882.93-1.086-.006-.158h-.055L4.132%2018.56l-1.13.146-.487-.456.061-.746.231-.243%201.908-1.312-.006.006z'%3e%3c/path%3e%3c/svg%3e",iee="data:image/svg+xml,%3csvg%20fill='%23fafafa'%20fill-rule='evenodd'%20height='1em'%20style='flex:none;line-height:1'%20viewBox='0%200%2024%2024'%20width='1em'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eCline%3c/title%3e%3cpath%20d='M17.035%203.991c2.75%200%204.98%202.24%204.98%205.003v1.667l1.45%202.896a1.01%201.01%200%2001-.002.909l-1.448%202.864v1.668c0%202.762-2.23%205.002-4.98%205.002H7.074c-2.751%200-4.98-2.24-4.98-5.002V17.33l-1.48-2.855a1.01%201.01%200%2001-.003-.927l1.482-2.887V8.994c0-2.763%202.23-5.003%204.98-5.003h9.962zM8.265%209.6a2.274%202.274%200%2000-2.274%202.274v4.042a2.274%202.274%200%20004.547%200v-4.042A2.274%202.274%200%20008.265%209.6zm7.326%200a2.274%202.274%200%2000-2.274%202.274v4.042a2.274%202.274%200%20104.548%200v-4.042A2.274%202.274%200%200015.59%209.6z'%3e%3c/path%3e%3cpath%20d='M12.054%205.558a2.779%202.779%200%20100-5.558%202.779%202.779%200%20000%205.558z'%3e%3c/path%3e%3c/svg%3e",oee="data:image/svg+xml,%3csvg%20fill='%23fafafa'%20fill-rule='evenodd'%20height='56'%20viewBox='0%200%2024%2024'%20width='56'%20xmlns='http://www.w3.org/2000/svg'%20style='flex:%200%200%20auto;%20line-height:%201;'%3e%3ctitle%3eCodex%3c/title%3e%3cpath%20clip-rule='evenodd'%20d='M8.086.457a6.105%206.105%200%20013.046-.415c1.333.153%202.521.72%203.564%201.7a.117.117%200%2000.107.029c1.408-.346%202.762-.224%204.061.366l.063.03.154.076c1.357.703%202.33%201.77%202.918%203.198.278.679.418%201.388.421%202.126a5.655%205.655%200%2001-.18%201.631.167.167%200%2000.04.155%205.982%205.982%200%20011.578%202.891c.385%201.901-.01%203.615-1.183%205.14l-.182.22a6.063%206.063%200%2001-2.934%201.851.162.162%200%2000-.108.102c-.255.736-.511%201.364-.987%201.992-1.199%201.582-2.962%202.462-4.948%202.451-1.583-.008-2.986-.587-4.21-1.736a.145.145%200%2000-.14-.032c-.518.167-1.04.191-1.604.185a5.924%205.924%200%2001-2.595-.622%206.058%206.058%200%2001-2.146-1.781c-.203-.269-.404-.522-.551-.821a7.74%207.74%200%2001-.495-1.283%206.11%206.11%200%2001-.017-3.064.166.166%200%2000.008-.074.115.115%200%2000-.037-.064%205.958%205.958%200%2001-1.38-2.202%205.196%205.196%200%2001-.333-1.589%206.915%206.915%200%2001.188-2.132c.45-1.484%201.309-2.648%202.577-3.493.282-.188.55-.334.802-.438.286-.12.573-.22.861-.304a.129.129%200%2000.087-.087A6.016%206.016%200%20015.635%202.31C6.315%201.464%207.132.846%208.086.457zm-.804%207.85a.848.848%200%2000-1.473.842l1.694%202.965-1.688%202.848a.849.849%200%20001.46.864l1.94-3.272a.849.849%200%2000.007-.854l-1.94-3.393zm5.446%206.24a.849.849%200%20000%201.695h4.848a.849.849%200%20000-1.696h-4.848z'%3e%3c/path%3e%3c/svg%3e",see="data:image/svg+xml,%3csvg%20fill='%23fafafa'%20fill-rule='evenodd'%20height='56'%20viewBox='0%200%2024%2024'%20width='56'%20xmlns='http://www.w3.org/2000/svg'%20style='flex:%200%200%20auto;%20line-height:%201;'%3e%3ctitle%3eCursor%3c/title%3e%3cpath%20d='M22.106%205.68L12.5.135a.998.998%200%2000-.998%200L1.893%205.68a.84.84%200%2000-.419.726v11.186c0%20.3.16.577.42.727l9.607%205.547a.999.999%200%2000.998%200l9.608-5.547a.84.84%200%2000.42-.727V6.407a.84.84%200%2000-.42-.726zm-.603%201.176L12.228%2022.92c-.063.108-.228.064-.228-.061V12.34a.59.59%200%2000-.295-.51l-9.11-5.26c-.107-.062-.063-.228.062-.228h18.55c.264%200%20.428.286.296.514z'%3e%3c/path%3e%3c/svg%3e",aee="data:image/svg+xml,%3csvg%20fill='%23fafafa'%20fill-rule='evenodd'%20height='56'%20viewBox='0%200%2024%2024'%20width='56'%20xmlns='http://www.w3.org/2000/svg'%20style='flex:%200%200%20auto;%20line-height:%201;'%3e%3ctitle%3eGemini%3c/title%3e%3cpath%20d='M20.616%2010.835a14.147%2014.147%200%2001-4.45-3.001%2014.111%2014.111%200%2001-3.678-6.452.503.503%200%2000-.975%200%2014.134%2014.134%200%2001-3.679%206.452%2014.155%2014.155%200%2001-4.45%203.001c-.65.28-1.318.505-2.002.678a.502.502%200%20000%20.975c.684.172%201.35.397%202.002.677a14.147%2014.147%200%20014.45%203.001%2014.112%2014.112%200%20013.679%206.453.502.502%200%2000.975%200c.172-.685.397-1.351.677-2.003a14.145%2014.145%200%20013.001-4.45%2014.113%2014.113%200%20016.453-3.678.503.503%200%20000-.975%2013.245%2013.245%200%2001-2.003-.678z'%3e%3c/path%3e%3c/svg%3e",lee="data:image/svg+xml,%3csvg%20fill='%23fafafa'%20fill-rule='evenodd'%20height='56'%20viewBox='0%200%2024%2024'%20width='56'%20xmlns='http://www.w3.org/2000/svg'%20style='flex:%200%200%20auto;%20line-height:%201;'%3e%3ctitle%3eGithubCopilot%3c/title%3e%3cpath%20d='M19.245%205.364c1.322%201.36%201.877%203.216%202.11%205.817.622%200%201.2.135%201.592.654l.73.964c.21.278.323.61.323.955v2.62c0%20.339-.173.669-.453.868C20.239%2019.602%2016.157%2021.5%2012%2021.5c-4.6%200-9.205-2.583-11.547-4.258-.28-.2-.452-.53-.453-.868v-2.62c0-.345.113-.679.321-.956l.73-.963c.392-.517.974-.654%201.593-.654l.029-.297c.25-2.446.81-4.213%202.082-5.52%202.461-2.54%205.71-2.851%207.146-2.864h.198c1.436.013%204.685.323%207.146%202.864zm-7.244%204.328c-.284%200-.613.016-.962.05-.123.447-.305.85-.57%201.108-1.05%201.023-2.316%201.18-2.994%201.18-.638%200-1.306-.13-1.851-.464-.516.165-1.012.403-1.044.996a65.882%2065.882%200%2000-.063%202.884l-.002.48c-.002.563-.005%201.126-.013%201.69.002.326.204.63.51.765%202.482%201.102%204.83%201.657%206.99%201.657%202.156%200%204.504-.555%206.985-1.657a.854.854%200%2000.51-.766c.03-1.682.006-3.372-.076-5.053-.031-.596-.528-.83-1.046-.996-.546.333-1.212.464-1.85.464-.677%200-1.942-.157-2.993-1.18-.266-.258-.447-.661-.57-1.108-.32-.032-.64-.049-.96-.05zm-2.525%204.013c.539%200%20.976.426.976.95v1.753c0%20.525-.437.95-.976.95a.964.964%200%2001-.976-.95v-1.752c0-.525.437-.951.976-.951zm5%200c.539%200%20.976.426.976.95v1.753c0%20.525-.437.95-.976.95a.964.964%200%2001-.976-.95v-1.752c0-.525.437-.951.976-.951zM7.635%205.087c-1.05.102-1.935.438-2.385.906-.975%201.037-.765%203.668-.21%204.224.405.394%201.17.657%201.995.657h.09c.649-.013%201.785-.176%202.73-1.11.435-.41.705-1.433.675-2.47-.03-.834-.27-1.52-.63-1.813-.39-.336-1.275-.482-2.265-.394zm6.465.394c-.36.292-.6.98-.63%201.813-.03%201.037.24%202.06.675%202.47.968.957%202.136%201.104%202.776%201.11h.044c.825%200%201.59-.263%201.995-.657.555-.556.765-3.187-.21-4.224-.45-.468-1.335-.804-2.385-.906-.99-.088-1.875.058-2.265.394zM12%207.615c-.24%200-.525.015-.84.044.03.16.045.336.06.526l-.001.159a2.94%202.94%200%2001-.014.25c.225-.022.425-.027.612-.028h.366c.187%200%20.387.006.612.028-.015-.146-.015-.277-.015-.409.015-.19.03-.365.06-.526a9.29%209.29%200%2000-.84-.044z'%3e%3c/path%3e%3c/svg%3e",cee="data:image/svg+xml,%3csvg%20fill='%23fafafa'%20fill-rule='evenodd'%20height='56'%20viewBox='0%200%2024%2024'%20width='56'%20xmlns='http://www.w3.org/2000/svg'%20style='flex:%200%200%20auto;%20line-height:%201;'%3e%3ctitle%3eJunie%3c/title%3e%3cpath%20d='M24%209.333C24%2018.666%2020%2024%209.333%2024H8v-8h1.333C14%2016%2016%2014%2016%209.333V8h8v1.333zM8%2016H0V8h8v8zM16%208H8V0h8v8z'%3e%3c/path%3e%3c/svg%3e",uee="data:image/svg+xml,%3csvg%20fill='%23fafafa'%20fill-rule='evenodd'%20height='56'%20viewBox='0%200%2024%2024'%20width='56'%20xmlns='http://www.w3.org/2000/svg'%20style='flex:%200%200%20auto;%20line-height:%201;'%3e%3ctitle%3eKilo%20Code%3c/title%3e%3cpath%20d='M0%200v24h24V0H0zm22.222%2022.222H1.778V1.778h20.444v20.444zm-7.555-4.964h2.222v1.778h-2.794L12.89%2017.83v-2.794h1.778v2.222zm4%200h-1.778v-2.222h-2.222v-1.778h2.793l1.207%201.207v2.793zm-7.556-2.591H9.333v-1.778h1.778v1.778zm-5.778-1.778h1.778v4h4v1.778H6.54L5.333%2017.46V12.89zm13.334-3.556v1.778h-5.778V9.333h1.987V7.111h-1.987V5.333h2.558l1.206%201.207v2.793h2.014zm-11.556-2h2.222l1.778%201.778v2H9.333v-2H7.111v2H5.333V5.333h1.778v2zm4%200H9.333v-2h1.778v2z'%3e%3c/path%3e%3c/svg%3e",dee="data:image/svg+xml,%3csvg%20fill='none'%20viewBox='24%2020%2047%2057'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%3e%3cpath%20d='m33.8075%2063.4223c-5.7924%2012.8272%206.545%2016.0468%2015.6448%208.5396%202.6776%208.4172%2012.705%202.1354%2016.31-4.3924%207.9276-14.3847%204.725-29.0499%203.9025-32.0774-5.635-20.6324-33.8098-20.6675-38.6573.105-1.1375%203.64-1.155%207.77-1.785%2012.0575-.315%202.17-.56%203.5525-1.3825%205.8273-.49%201.3128-1.1375%202.4676-2.1875%204.4275-1.61%203.0453-.9275%208.9077%207.4025%205.8628l.7875-.3499z'%20fill='%23fff'/%3e%3cg%20fill='%23000'%3e%3cpath%20d='m50.5406%2044.4358c-2.3099%200-2.6599-2.765-2.6599-4.41%200-1.4875.2625-2.6599.7702-3.4125.4374-.6649%201.0849-.9975%201.8897-.9975.8052%200%201.5051.3326%201.995%201.015.56.7701.8576%201.9425.8576%203.395%200%202.765-1.0672%204.41-2.8348%204.41z'/%3e%3cpath%20d='m60.0575%2044.4358c-2.3099%200-2.6598-2.765-2.6598-4.41%200-1.4875.2624-2.6599.7701-3.4125.4374-.6649%201.0849-.9975%201.8897-.9975.8052%200%201.5051.3326%201.995%201.015.5601.7701.8576%201.9425.8576%203.395%200%202.765-1.0672%204.41-2.8348%204.41z'/%3e%3c/g%3e%3c/g%3e%3c/svg%3e",fee="data:image/svg+xml,%3csvg%20fill='%23fafafa'%20fill-rule='evenodd'%20height='56'%20viewBox='0%200%2024%2024'%20width='56'%20xmlns='http://www.w3.org/2000/svg'%20style='flex:%200%200%20auto;%20line-height:%201;'%3e%3ctitle%3eOpenClaude%3c/title%3e%3cdefs%3e%3cmask%20id='openclaude-front-mask'%3e%3crect%20width='24'%20height='24'%20fill='%23fff'/%3e%3crect%20x='3'%20y='2.5'%20width='14'%20height='14'%20rx='2.5'%20fill='%23000'/%3e%3c/mask%3e%3c/defs%3e%3cg%20mask='url(%23openclaude-front-mask)'%3e%3cpath%20d='M8.5%205.5h9a2.5%202.5%200%200%201%202.5%202.5v9a2.5%202.5%200%200%201-2.5%202.5h-9a2.5%202.5%200%200%201-2.5-2.5v-9a2.5%202.5%200%200%201%202.5-2.5zm0%201.5a1%201%200%200%200-1%201v9a1%201%200%200%200%201%201h9a1%201%200%200%200%201-1v-9a1%201%200%200%200-1-1h-9z'/%3e%3c/g%3e%3cpath%20d='M5.5%202.5h9a2.5%202.5%200%200%201%202.5%202.5v9a2.5%202.5%200%200%201-2.5%202.5h-9a2.5%202.5%200%200%201-2.5-2.5v-9a2.5%202.5%200%200%201%202.5-2.5zm0%201.5a1%201%200%200%200-1%201v9a1%201%200%200%200%201%201h9a1%201%200%200%200%201-1v-9a1%201%200%200%200-1-1h-9z'/%3e%3crect%20x='6.8'%20y='6.4'%20width='1.2'%20height='2.4'%20rx='0.6'/%3e%3crect%20x='12'%20y='6.4'%20width='1.2'%20height='2.4'%20rx='0.6'/%3e%3cpath%20d='M5.6%2010.7l.7-.8%202.6%202%200%20.1-2.6%202-.7-.8%201.7-1.2-1.7-1.3z'/%3e%3crect%20x='8.5'%20y='13.4'%20width='3.2'%20height='0.8'%20rx='0.3'/%3e%3c/svg%3e",hee="data:image/svg+xml,%3csvg%20fill='%23fafafa'%20fill-rule='evenodd'%20height='56'%20viewBox='0%200%2024%2024'%20width='56'%20xmlns='http://www.w3.org/2000/svg'%20style='flex:%200%200%20auto;%20line-height:%201;'%3e%3ctitle%3eOpenClaw%3c/title%3e%3cg%20clip-path='url(%23a)'%3e%3cpath%20d='M9.046%207.104a.527.527%200%20110%201.055.527.527%200%20010-1.055z'%3e%3c/path%3e%3cpath%20d='M15.376%207.104a.528.528%200%20110%201.056.528.528%200%20010-1.056z'%3e%3c/path%3e%3cpath%20clip-rule='evenodd'%20d='M16.877%201.912c.58-.27%201.14-.323%201.616-.037a.317.317%200%2001-.326.542c-.227-.136-.547-.153-1.022.068-.352.165-.765.45-1.234.866%202.683%201.17%204.4%203.5%205.148%205.921a6.421%206.421%200%2000-.704.184c-.578.016-1.174.204-1.502.735-.338.55-.268%201.276.072%202.069l.005.012.007.014c.523%201.045%201.318%201.91%202.2%202.284-.912%203.274-3.44%206.144-5.972%206.988v2.109h-2.11v-2.11c-1.043.417-2.086.01-2.11%200v2.11h-2.11v-2.11c-2.531-.843-5.061-3.713-5.973-6.987.882-.373%201.678-1.238%202.2-2.284l.007-.014.006-.012c.34-.793.41-1.518.071-2.069-.327-.531-.923-.719-1.503-.735a6.409%206.409%200%2000-.704-.183c.749-2.421%202.466-4.751%205.149-5.922-.47-.416-.88-.701-1.234-.866-.474-.221-.794-.204-1.021-.068a.318.318%200%2001-.435-.109.317.317%200%2001.109-.433c.476-.286%201.036-.233%201.615.037.49.229%201.031.628%201.621%201.182A9.924%209.924%200%200112%202.568c1.199%200%202.284.19%203.256.526.59-.554%201.13-.953%201.62-1.182zM8.835%206.577a1.266%201.266%200%20100%202.532%201.266%201.266%200%20000-2.532zm6.33%200a1.267%201.267%200%20100%202.533%201.267%201.267%200%20000-2.533z'%3e%3c/path%3e%3cpath%20d='M.395%2013.118c-.966-1.932-.163-3.863%202.41-3.365v-.001l.05.01c.084.018.17.038.26.06.033.009.067.017.1.027.084.022.168.048.255.076l.09.027c.528%200%20.95.158%201.16.501.212.343.212.87-.105%201.61-.085.17-.178.333-.276.489l-.01.017a4.967%204.967%200%2001-.62.791l-.019.02c-1.092%201.117-2.496%201.336-3.295-.262z'%3e%3c/path%3e%3cpath%20d='M21.193%209.753c2.574-.5%203.378%201.433%202.411%203.365-.58%201.159-1.476%201.361-2.342.96l-.011-.005a2.419%202.419%200%2001-.114-.056l-.019-.01a2.751%202.751%200%2001-.115-.067l-.023-.014c-.035-.022-.071-.044-.106-.068l-.05-.035c-.55-.388-1.062-1.007-1.44-1.76-.276-.647-.311-1.132-.174-1.472.176-.439.636-.639%201.23-.639.032-.011.066-.02.099-.03.08-.026.16-.05.238-.072l.117-.03a5.502%205.502%200%2001.3-.067z'%3e%3c/path%3e%3c/g%3e%3cdefs%3e%3clinearGradient%20gradientUnits='userSpaceOnUse'%20id='b'%20x1='-.659'%20x2='27.023'%20y1='.458'%20y2='22.855'%3e%3cstop%20stop-color='%23FF4D4D'%3e%3c/stop%3e%3cstop%20offset='1'%20stop-color='%23991B1B'%3e%3c/stop%3e%3c/linearGradient%3e%3clinearGradient%20gradientUnits='userSpaceOnUse'%20id='c'%20x1='-.659'%20x2='27.023'%20y1='.458'%20y2='22.855'%3e%3cstop%20stop-color='%23FF4D4D'%3e%3c/stop%3e%3cstop%20offset='1'%20stop-color='%23991B1B'%3e%3c/stop%3e%3c/linearGradient%3e%3clinearGradient%20gradientUnits='userSpaceOnUse'%20id='d'%20x1='-.659'%20x2='27.023'%20y1='.458'%20y2='22.855'%3e%3cstop%20stop-color='%23FF4D4D'%3e%3c/stop%3e%3cstop%20offset='1'%20stop-color='%23991B1B'%3e%3c/stop%3e%3c/linearGradient%3e%3clinearGradient%20gradientUnits='userSpaceOnUse'%20id='e'%20x1='-.659'%20x2='27.023'%20y1='.458'%20y2='22.855'%3e%3cstop%20stop-color='%23FF4D4D'%3e%3c/stop%3e%3cstop%20offset='1'%20stop-color='%23991B1B'%3e%3c/stop%3e%3c/linearGradient%3e%3clinearGradient%20gradientUnits='userSpaceOnUse'%20id='f'%20x1='-.659'%20x2='27.023'%20y1='.458'%20y2='22.855'%3e%3cstop%20stop-color='%23FF4D4D'%3e%3c/stop%3e%3cstop%20offset='1'%20stop-color='%23991B1B'%3e%3c/stop%3e%3c/linearGradient%3e%3cclipPath%20id='a'%3e%3cpath%20d='M0%200h24v24H0z'%3e%3c/path%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",pee="data:image/svg+xml,%3csvg%20fill='%23fafafa'%20fill-rule='evenodd'%20height='56'%20viewBox='0%200%2024%2024'%20width='56'%20xmlns='http://www.w3.org/2000/svg'%20style='flex:%200%200%20auto;%20line-height:%201;'%3e%3ctitle%3eopencode%3c/title%3e%3cpath%20d='M16%206H8v12h8V6zm4%2016H4V2h16v20z'%3e%3c/path%3e%3c/svg%3e",mee="/assets/qoder-connector-D9_pSbd_.svg",gee="data:image/svg+xml,%3csvg%20fill='%23fafafa'%20fill-rule='evenodd'%20height='56'%20viewBox='0%200%2024%2024'%20width='56'%20xmlns='http://www.w3.org/2000/svg'%20style='flex:%200%200%20auto;%20line-height:%201;'%3e%3ctitle%3eQwen%3c/title%3e%3cpath%20d='M12.604%201.34c.393.69.784%201.382%201.174%202.075a.18.18%200%2000.157.091h5.552c.174%200%20.322.11.446.327l1.454%202.57c.19.337.24.478.024.837-.26.43-.513.864-.76%201.3l-.367.658c-.106.196-.223.28-.04.512l2.652%204.637c.172.301.111.494-.043.77-.437.785-.882%201.564-1.335%202.34-.159.272-.352.375-.68.37-.777-.016-1.552-.01-2.327.016a.099.099%200%2000-.081.05%20575.097%20575.097%200%2001-2.705%204.74c-.169.293-.38.363-.725.364-.997.003-2.002.004-3.017.002a.537.537%200%2001-.465-.271l-1.335-2.323a.09.09%200%2000-.083-.049H4.982c-.285.03-.553-.001-.805-.092l-1.603-2.77a.543.543%200%2001-.002-.54l1.207-2.12a.198.198%200%20000-.197%20550.951%20550.951%200%2001-1.875-3.272l-.79-1.395c-.16-.31-.173-.496.095-.965.465-.813.927-1.625%201.387-2.436.132-.234.304-.334.584-.335a338.3%20338.3%200%20012.589-.001.124.124%200%2000.107-.063l2.806-4.895a.488.488%200%2001.422-.246c.524-.001%201.053%200%201.583-.006L11.704%201c.341-.003.724.032.9.34zm-3.432.403a.06.06%200%2000-.052.03L6.254%206.788a.157.157%200%2001-.135.078H3.253c-.056%200-.07.025-.041.074l5.81%2010.156c.025.042.013.062-.034.063l-2.795.015a.218.218%200%2000-.2.116l-1.32%202.31c-.044.078-.021.118.068.118l5.716.008c.046%200%20.08.02.104.061l1.403%202.454c.046.081.092.082.139%200l5.006-8.76.783-1.382a.055.055%200%2001.096%200l1.424%202.53a.122.122%200%2000.107.062l2.763-.02a.04.04%200%2000.035-.02.041.041%200%20000-.04l-2.9-5.086a.108.108%200%20010-.113l.293-.507%201.12-1.977c.024-.041.012-.062-.035-.062H9.2c-.059%200-.073-.026-.043-.077l1.434-2.505a.107.107%200%20000-.114L9.225%201.774a.06.06%200%2000-.053-.031zm6.29%208.02c.046%200%20.058.02.034.06l-.832%201.465-2.613%204.585a.056.056%200%2001-.05.029.058.058%200%2001-.05-.029L8.498%209.841c-.02-.034-.01-.052.028-.054l.216-.012%206.722-.012z'%3e%3c/path%3e%3c/svg%3e",yee="data:image/svg+xml,%3csvg%20fill='%23fafafa'%20fill-rule='evenodd'%20height='56'%20viewBox='0%200%2024%2024'%20width='56'%20xmlns='http://www.w3.org/2000/svg'%20style='flex:%200%200%20auto;%20line-height:%201;'%3e%3ctitle%3eRooCode%3c/title%3e%3cpath%20d='M20.113%205.5l-.442%201.557a.157.157%200%2001-.196.106l-7.414-2.157a.16.16%200%2000-.143.028l-7.342%205.74a.159.159%200%2001-.074.032l-4.37.656a.154.154%200%2000-.132.162l.02.245c.005.078.071.14.152.141l5.074.128.058.002%203.75-1.953a.16.16%200%2001.164.01l2.657%201.847a.152.152%200%2001.066.125l-.023%202.45c0%20.032.01.063.028.089l3.737%205.227c.03.04.077.065.129.065h1.182a.153.153%200%2000.14-.224l-2.664-4.919a.15.15%200%2001.005-.152l1.389-2.169a.156.156%200%2001.062-.055l4.965-2.456a.16.16%200%2001.158.01l1.418.921a.16.16%200%2000.087.026h1.289c.125%200%20.2-.136.13-.237l-3.578-5.29c-.074-.109-.246-.082-.282.044z'%3e%3c/path%3e%3c/svg%3e",xee="data:image/svg+xml,%3csvg%20fill='%23fafafa'%20fill-rule='evenodd'%20height='56'%20viewBox='0%200%2024%2024'%20width='56'%20xmlns='http://www.w3.org/2000/svg'%20style='flex:%200%200%20auto;%20line-height:%201;'%3e%3ctitle%3eTRAE%3c/title%3e%3cpath%20d='M24%2020.541H3.428v-3.426H0V3.4h24V20.54zM3.428%2017.115h17.144V6.827H3.428v10.288zm8.573-5.196l-2.425%202.424-2.424-2.424%202.424-2.424%202.425%202.424zm6.857-.001l-2.424%202.423-2.425-2.423%202.425-2.425%202.424%202.425z'%3e%3c/path%3e%3c/svg%3e",bee="data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%20fill='%23fafafa'%3e%3ctitle%3eWarp%3c/title%3e%3cpath%20d='M12.035%202.723h9.253A2.712%202.712%200%200%201%2024%205.435v10.529a2.712%202.712%200%200%201-2.712%202.713H8.047Zm-1.681%202.6L6.766%2019.677h5.598l-.399%201.6H2.712A2.712%202.712%200%200%201%200%2018.565V8.036a2.712%202.712%200%200%201%202.712-2.712Z'/%3e%3c/svg%3e",vee="data:image/svg+xml,%3csvg%20fill='%23fafafa'%20fill-rule='evenodd'%20height='56'%20viewBox='0%200%2024%2024'%20width='56'%20xmlns='http://www.w3.org/2000/svg'%20style='flex:%200%200%20auto;%20line-height:%201;'%3e%3ctitle%3eWindsurf%3c/title%3e%3cpath%20clip-rule='evenodd'%20d='M23.78%205.004h-.228a2.187%202.187%200%2000-2.18%202.196v4.912c0%20.98-.804%201.775-1.76%201.775a1.818%201.818%200%2001-1.472-.773L13.168%205.95a2.197%202.197%200%2000-1.81-.95c-1.134%200-2.154.972-2.154%202.173v4.94c0%20.98-.797%201.775-1.76%201.775-.57%200-1.136-.289-1.472-.773L.408%205.098C.282%204.918%200%205.007%200%205.228v4.284c0%20.216.066.426.188.604l5.475%207.889c.324.466.8.812%201.351.938%201.377.316%202.645-.754%202.645-2.117V11.89c0-.98.787-1.775%201.76-1.775h.002c.586%200%201.135.288%201.472.773l4.972%207.163a2.15%202.15%200%20001.81.95c1.158%200%202.151-.973%202.151-2.173v-4.939c0-.98.787-1.775%201.76-1.775h.194c.122%200%20.22-.1.22-.222V5.225a.221.221%200%2000-.22-.222z'%3e%3c/path%3e%3c/svg%3e",wee="data:image/svg+xml,%3csvg%20width='90'%20viewBox='0%200%2090%2090'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M8.4375%205.625C6.8842%205.625%205.625%206.8842%205.625%208.4375V70.3125H0V8.4375C0%203.7776%203.7776%200%208.4375%200H83.7925C87.551%200%2089.4333%204.5442%2086.7756%207.20186L40.3642%2053.6133H53.4375V47.8125H59.0625V55.0195C59.0625%2057.3495%2057.1737%2059.2383%2054.8438%2059.2383H34.7392L25.0712%2068.9062H68.9062V33.75H74.5312V68.9062C74.5312%2072.0128%2072.0128%2074.5312%2068.9062%2074.5312H19.4462L9.60248%2084.375H81.5625C83.1158%2084.375%2084.375%2083.1158%2084.375%2081.5625V19.6875H90V81.5625C90%2086.2224%2086.2224%2090%2081.5625%2090H6.20749C2.44898%2090%200.566723%2085.4558%203.22438%2082.7981L49.46%2036.5625H36.5625V42.1875H30.9375V35.1562C30.9375%2032.8263%2032.8263%2030.9375%2035.1562%2030.9375H55.085L64.9288%2021.0938H21.0938V56.25H15.4688V21.0938C15.4688%2017.9871%2017.9871%2015.4688%2021.0938%2015.4688H70.5538L80.3975%205.625H8.4375Z'%20fill='%23fafafa'/%3e%3c/svg%3e",$m={Amp:eee,Antigravity:tee,"Auggie CLI":nee,"Augment Code":ree,"Claude Code":m4,"Claude Desktop":m4,Cline:iee,Codex:oee,Cursor:see,"Gemini CLI":aee,"Github Copilot":lee,Junie:cee,"Kilo Code":uee,Kiro:dee,OpenClaude:fee,OpenClaw:hee,OpenCode:pee,Qoder:mee,"Qwen Code":gee,"Roo Code":yee,"Trae.ai":xee,Warp:bee,Windsurf:vee,Zed:wee};function See({agents:e,connectors:t,onAdd:n,onOpenChange:r,open:i,pendingAgentId:s}){const[a,c]=w.useState("");w.useEffect(()=>{i||c("")},[i]);const u=w.useMemo(()=>new Set(t.map(m=>m.agent)),[t]),f=w.useMemo(()=>{if(!a)return e;const m=a.toLowerCase();return e.filter(p=>p.name.toLowerCase().includes(m))},[e,a]);return h.jsx(Tl,{onOpenChange:r,open:i,children:h.jsxs(Nl,{className:"flex h-150 flex-col sm:max-w-lg",children:[h.jsx(Ci,{children:h.jsx(ki,{children:"Add connector"})}),h.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-3",children:[h.jsxs("div",{className:"relative shrink-0",children:[h.jsx(au,{className:"text-muted-foreground absolute top-1/2 left-3 size-4 -translate-y-1/2"}),h.jsx(Wi,{className:"pl-9",onChange:m=>c(m.target.value),placeholder:"Search agents...",value:a})]}),h.jsxs("div",{className:"min-h-0 flex-1 overflow-y-auto",children:[f.map(m=>{const p=u.has(m.id),y=s===m.id;return h.jsxs("div",{className:"flex items-center justify-between rounded px-3 py-2.5",children:[h.jsxs("div",{className:"flex items-center gap-3",children:[$m[m.name]?h.jsx("img",{alt:"",className:"size-5 shrink-0",src:$m[m.name]}):h.jsx("div",{className:"size-5 shrink-0"}),h.jsx("span",{className:"text-foreground text-sm",children:m.name})]}),h.jsx("div",{className:"flex size-8 shrink-0 items-center justify-center",children:y?h.jsx(ei,{className:"text-muted-foreground size-4 animate-spin"}):p?h.jsx(Rl,{className:"text-primary size-4"}):h.jsx(ze,{className:"size-8",onClick:()=>n(m),size:"icon-sm",variant:"outline",children:h.jsx(Ta,{className:"size-4"})})})]},m.id)}),f.length===0&&h.jsx("p",{className:"text-muted-foreground py-8 text-center text-sm",children:"No agents found"})]})]})]})})}const yd={hook:"Hook",mcp:"MCP",rules:"Rules",skill:"Skill"};function Cee(){const{data:e,isLoading:t}=XJ(),{data:n,isLoading:r}=KJ(),i=JJ(),[s,a]=w.useState(!1),[c,u]=w.useState(),f=e?.connectors??[],m=n?.agents??[],p=t||r,y=async(b,S)=>{if(S!==b.connectorType)try{await i.mutateAsync({agentId:b.agent,connectorType:S});const k=YJ(S);ht.success(k?`${b.agent} switched to ${yd[S]}. Restart the agent to apply.`:`${b.agent} switched to ${yd[S]}.`)}catch(k){ht.error(k instanceof Error?k.message:"Failed to switch connector type")}},x=async(b,S)=>{try{await i.mutateAsync({agentId:b,connectorType:S}),ht.success(`${b} connected via ${yd[S]}.`)}catch(k){ht.error(k instanceof Error?k.message:"Failed to install connector")}};return h.jsxs("div",{className:"flex w-full flex-col gap-5",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsxs("div",{className:"flex flex-col gap-1",children:[h.jsx("h2",{className:"text-foreground text-[0.95rem] font-semibold leading-tight",children:"Connectors"}),h.jsx("p",{className:"text-muted-foreground mt-0.5 text-[0.8125rem] leading-snug",children:"Manage how AI agents connect to ByteRover."})]}),h.jsxs("div",{className:"flex items-center gap-2",children:[p&&h.jsx(ei,{className:"text-muted-foreground size-4 animate-spin"}),h.jsxs(ze,{disabled:p,onClick:()=>a(!0),size:"sm",variant:"outline",children:[h.jsx(Ta,{strokeWidth:3})," Add connector"]})]})]}),h.jsx(See,{agents:m,connectors:f,onAdd:async b=>{u(b.id);try{await x(b.id,b.defaultConnectorType)}finally{u(void 0)}},onOpenChange:a,open:s,pendingAgentId:c}),p?h.jsx("div",{className:"bg-card border rounded-xl px-6 py-5",children:h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx(kr,{className:"size-5 shrink-0 rounded-full"}),h.jsx(kr,{className:"h-4 flex-1"}),h.jsx(kr,{className:"h-8 w-16 shrink-0"})]})}):f.length===0?h.jsx("p",{className:"text-muted-foreground py-8 text-center text-sm",children:"No connectors installed. Add one to get started."}):h.jsx("div",{className:"bg-card border rounded-xl px-6 py-5 flex flex-col gap-4",children:f.map((b,S)=>h.jsxs("div",{className:"flex flex-col gap-4",children:[h.jsxs("div",{className:"flex justify-between items-center",children:[h.jsxs("div",{className:"flex items-center gap-3 text-sm",children:[$m[b.agent]?h.jsx("img",{alt:"",className:"size-5 shrink-0",src:$m[b.agent]}):h.jsx("div",{className:"size-5 shrink-0"}),h.jsxs("div",{className:"flex flex-col",children:[h.jsx("span",{children:b.agent}),h.jsx("span",{className:"text-primary text-xs",children:"Connected"})]})]}),h.jsx("div",{className:"flex items-center",children:h.jsxs(Na,{children:[h.jsxs(Ra,{disabled:i.isPending,render:h.jsx(ze,{className:"text-sm",disabled:i.isPending,size:"sm",variant:"secondary"}),children:[yd[b.connectorType],h.jsx(Mf,{className:"size-3.5 shrink-0"})]}),h.jsx(ks,{align:"end",children:b.supportedTypes.map(k=>h.jsx(Vn,{onClick:()=>y(b,k),children:yd[k]},k))})]})})]}),S<f.length-1&&h.jsx("div",{className:"border-b"})]},b.agent))})]})}const yl=()=>{};async function g4(e){const{apiClient:t}=$e.getState();if(!t)throw new Error("Not connected");try{return(await t.request(qn.CONFIG,{key:e})).value}catch(n){if(i8(n)&&n.code===Ir.CONFIG_KEY_NOT_SET)return;throw n}}const kee=async()=>{const[e,t]=await Promise.all([g4("user.name"),g4("user.email")]);return{email:t,name:e}},o9=()=>({queryFn:kee,queryKey:["vc","config"],staleTime:5e3}),Eee=({queryConfig:e}={})=>or({...o9(),...e}),Tee=e=>{const{apiClient:t}=$e.getState();return t?t.request(qn.CONFIG,e):Promise.reject(new Error("Not connected"))},Nee=({mutationConfig:e}={})=>{const t=un(),{onSuccess:n,...r}=e??{};return dn({onSuccess(...i){t.invalidateQueries({queryKey:o9().queryKey}),n?.(...i)},...r,mutationFn:Tee})},Ree=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;function Aee(e){const t=e.trim();return t===""?!1:Ree.test(t)}function s9({action:e,children:t,compact:n=!1,description:r,error:i,errorFallback:s="Failed to load",onRetry:a,title:c}){const u=n?"bg-card flex flex-col gap-3 rounded-xl border px-4.5 py-3.5":"bg-card flex flex-col gap-4 rounded-xl border px-5 py-4";return h.jsxs("div",{className:"flex w-full flex-col gap-3.5",children:[h.jsxs("div",{className:"flex items-start justify-between gap-3",children:[h.jsxs("div",{className:"flex min-w-0 flex-col",children:[h.jsx("h2",{className:"text-foreground text-[0.95rem] font-semibold leading-tight",children:c}),h.jsx("p",{className:"text-muted-foreground mt-0.5 text-[0.8125rem] leading-snug",children:r})]}),e]}),i?h.jsxs("p",{className:"text-destructive text-sm",children:["✗ ",jn(i,s),a&&h.jsxs(h.Fragment,{children:[" · ",h.jsx("button",{className:"underline underline-offset-2",onClick:a,type:"button",children:"retry"})]})]}):t&&h.jsx("div",{className:u,children:t})]})}function Oee({isPending:e,onApplyAccount:t,onSetManually:n,user:r}){const i="flex items-center justify-between gap-3 rounded-md border border-dashed border-border bg-muted/40 px-3.5 py-2.5";if(!r)return h.jsxs("div",{className:i,children:[h.jsxs("div",{className:"flex min-w-0 flex-col gap-0.5",children:[h.jsx("span",{className:"text-foreground text-sm font-medium",children:"Identity not configured"}),h.jsx("span",{className:"text-muted-foreground truncate text-xs",children:"Optional — used for commit attribution."})]}),h.jsx(ze,{disabled:e,onClick:n,size:"sm",variant:"secondary",children:"Set manually"})]});const s=r.name??r.email;return h.jsxs("div",{className:i,children:[h.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[h.jsxs(_f,{className:"size-7 shrink-0",children:[h.jsx(O0,{alt:s,src:r.avatarUrl}),h.jsx(Lf,{className:"text-[10px]",children:Mv(s)})]}),h.jsxs("div",{className:"flex min-w-0 flex-col gap-0.5",children:[h.jsxs("span",{className:"text-foreground truncate text-sm font-medium",children:[s," ",h.jsxs("span",{className:"text-muted-foreground font-normal",children:["<",r.email,">"]})]}),h.jsx("span",{className:"text-muted-foreground truncate text-xs",children:"From your ByteRover account — optional, used for commit attribution."})]})]}),h.jsxs("div",{className:"flex shrink-0 gap-1.5",children:[h.jsx(ze,{disabled:e,onClick:n,size:"sm",variant:"ghost",children:"Edit"}),h.jsx(ze,{disabled:e,onClick:t,size:"sm",children:"Apply"})]})]})}function jee({email:e,name:t,onEdit:n}){return h.jsxs("div",{className:"flex min-h-8 items-center gap-3",children:[h.jsxs("span",{className:"text-foreground min-w-0 flex-1 truncate text-sm",children:[t," ",h.jsxs("span",{className:"text-muted-foreground mono",children:["<",e,">"]})]}),h.jsx(ze,{onClick:n,size:"sm",variant:"ghost",children:"Edit"})]})}function Mee({initial:e,isPending:t,onCancel:n,onSubmit:r}){const i=w.useId(),s=w.useId(),[a,c]=w.useState(e.name),[u,f]=w.useState(e.email),m=a.trim(),p=u.trim(),y=m!==e.name||p!==e.email,x=m.length>0&&p.length>0,b=p.length>0&&!Aee(p),S=b&&y,k=y&&x&&!b&&!t;async function E(N){N.preventDefault(),k&&await r({email:p,name:m})}function T(N){E(N).catch(yl)}return h.jsxs("form",{className:"flex flex-col gap-4",onSubmit:T,children:[h.jsxs(Dm,{children:[h.jsx(_m,{htmlFor:i,children:"Name"}),h.jsx(Wi,{disabled:t,id:i,onChange:N=>c(N.target.value),placeholder:"Your name",value:a})]}),h.jsxs(Dm,{"data-invalid":S,children:[h.jsx(_m,{htmlFor:s,children:"Email"}),h.jsx(Wi,{"aria-invalid":S,disabled:t,id:s,onChange:N=>f(N.target.value),placeholder:"you@example.com",type:"email",value:u}),S&&h.jsx(o8,{children:"Enter a valid email address."})]}),h.jsxs("div",{className:"flex items-center justify-end gap-2",children:[h.jsx(ze,{disabled:t,onClick:n,type:"button",variant:"secondary",children:"Cancel"}),h.jsx(ze,{disabled:!k,type:"submit",children:t?"Saving…":"Save"})]})]})}function Dee(){const{data:e,error:t,isError:n,isLoading:r,refetch:i}=Eee(),s=Nee(),a=yi(b=>b.user),[c,u]=w.useState(!1),f=e?.name??"",m=e?.email??"",p=!!(f&&m);async function y(b){try{b.name&&b.name!==f&&await s.mutateAsync({key:"user.name",value:b.name}),b.email&&b.email!==m&&await s.mutateAsync({key:"user.email",value:b.email}),ht.success("Git identity saved."),u(!1)}catch(S){throw ht.error(jn(S,"Failed to save identity.")),S}}async function x(){if(a)try{await s.mutateAsync({key:"user.name",value:a.name??a.email}),await s.mutateAsync({key:"user.email",value:a.email}),ht.success("Git identity applied from your ByteRover account.")}catch(b){ht.error(jn(b,"Failed to apply identity."))}}return h.jsx(s9,{action:r?h.jsx(ei,{className:"text-muted-foreground mt-1 size-4 animate-spin"}):void 0,compact:!c,description:"Recorded on every commit in this project.",error:n?t:void 0,errorFallback:"Failed to load identity",onRetry:()=>i().catch(yl),title:"Git identity",children:e?c?h.jsx(Mee,{initial:{email:m,name:f},isPending:s.isPending,onCancel:()=>u(!1),onSubmit:y}):p?h.jsx(jee,{email:m,name:f,onEdit:()=>u(!0)}):h.jsx(Oee,{isPending:s.isPending,onApplyAccount:()=>x().catch(yl),onSetManually:()=>u(!0),user:a}):h.jsxs("div",{className:"flex min-h-8 items-center gap-3",children:[h.jsx(kr,{className:"h-4 flex-1"}),h.jsx(kr,{className:"h-8 w-12"})]})})}const _ee=()=>{const{apiClient:e}=$e.getState();return e?e.request(uV.GET_ENVIRONMENT):Promise.reject(new Error("Not connected"))},Lee=()=>({queryFn:_ee,queryKey:["config","environment"],staleTime:1/0}),Iee=({queryConfig:e}={})=>or({...Lee(),...e}),Pee=e=>{const{apiClient:t}=$e.getState();if(!t)return Promise.reject(new Error("Not connected"));const n=e.subcommand==="remove"?{subcommand:"remove"}:{subcommand:e.subcommand,url:e.url};return t.request(qn.REMOTE,n)},zee=({mutationConfig:e}={})=>{const t=un(),{onSuccess:n,...r}=e??{};return dn({onSuccess(...i){t.invalidateQueries({queryKey:_v().queryKey}),n?.(...i)},...r,mutationFn:Pee})},Fee=/^[a-zA-Z0-9_.-]+@[a-zA-Z0-9_.-]+:[^/].*$/;function a9(e){const t=e.trim();return t===""?"unknown":t.startsWith("https://")?"https":t.startsWith("http://")?"http":t.startsWith("ssh://")?"ssh":t.startsWith("git://")?"git":Fee.test(t)?"ssh":"unknown"}function Bee(e){const t=e.trim();if(t==="")return"URL is required.";const n=a9(t);if(n==="ssh")return"SSH remotes aren't supported yet — use an HTTPS URL.";if(n==="http")return"Plain HTTP isn't supported — use an HTTPS URL.";if(n!=="https")return"Expected an HTTPS URL (e.g. https://byterover.dev/team/space.git)."}function Hee({action:e,description:t,title:n}){return h.jsxs("div",{className:"border-border bg-muted/40 flex items-center justify-between gap-3 rounded-md border border-dashed px-3.5 py-2.5",children:[h.jsxs("div",{className:"flex min-w-0 flex-col gap-0.5",children:[h.jsx("span",{className:"text-foreground text-sm font-medium",children:n}),h.jsx("span",{className:"text-muted-foreground truncate text-xs",children:t})]}),e]})}const Wv="origin";function Uee({isDeleting:e,onDelete:t,onEdit:n,url:r}){const i=a9(r),s=i==="ssh"||i==="git";return h.jsxs("div",{className:"flex flex-col gap-1.5",children:[h.jsxs("div",{className:"flex min-h-8 items-center gap-3",children:[h.jsx("span",{className:"text-foreground w-14 shrink-0 text-sm font-medium",children:Wv}),h.jsx("span",{className:"mono text-foreground min-w-0 flex-1 truncate text-sm",children:r}),h.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[h.jsx(ze,{disabled:e,onClick:n,size:"sm",variant:"ghost",children:"Edit"}),h.jsx(ze,{className:"text-destructive hover:text-destructive",disabled:e,onClick:t,size:"sm",variant:"ghost",children:"Delete"})]})]}),s&&h.jsx("p",{className:"text-muted-foreground text-xs",children:"Read-only from the web UI. Push and pull require an SSH agent; change to HTTPS to use them here."})]})}function Vee({isPending:e,onConfirm:t,onOpenChange:n,open:r,url:i}){function s(){t().catch(yl)}return h.jsx(Pf,{onOpenChange:n,open:r,children:h.jsxs(zf,{children:[h.jsxs(Ff,{children:[h.jsxs(Hf,{children:["Remove ",h.jsx("span",{className:"mono",children:Wv}),"?"]}),h.jsxs(Uf,{children:["Removes ",h.jsx("code",{className:"mono bg-muted text-foreground rounded px-1.5 py-0.5 text-xs",children:i})," from this project. Push, pull, and fetch will be disabled until you set a new remote."]})]}),h.jsxs(Bf,{children:[h.jsx(Vf,{disabled:e,children:"Cancel"}),h.jsx(ze,{disabled:e,onClick:s,variant:"destructive",children:e?"Removing…":"Remove remote"})]})]})})}function qee({initial:e,isPending:t,mode:n,onCancel:r,onSubmit:i,placeholder:s,webAppUrl:a}){const c=w.useId(),[u,f]=w.useState(e),[m,p]=w.useState(),y=w.useRef(null),x=u.trim()!==e,b=Bee(u),S=x&&!b&&!t;w.useEffect(()=>{y.current?.focus(),y.current?.select()},[]);async function k(O){if(O.preventDefault(),b){p(b);return}try{await i(u.trim()),p(void 0)}catch(A){p(jn(A,"Failed to save remote"))}}function E(O){k(O).catch(yl)}function T(O){O.key==="Escape"&&(O.preventDefault(),r())}const N=m??(x?b:void 0),j=n==="edit"&&!N&&e!=="";return h.jsxs("form",{className:"flex flex-col gap-4",onSubmit:E,children:[h.jsxs(Dm,{"data-invalid":!!N,children:[h.jsxs("div",{className:"flex items-center justify-between gap-2",children:[h.jsxs(_m,{htmlFor:c,children:[n==="add"?"Adding ":"Editing ",h.jsx("span",{className:"mono text-foreground",children:Wv})]}),n==="add"&&a&&h.jsxs(ze,{className:"hidden sm:inline-flex",onClick:()=>window.open(a,"_blank","noopener,noreferrer"),size:"sm",type:"button",variant:"ghost",children:[h.jsx(Mm,{className:"size-3.5"}),"Find in ByteRover"]})]}),h.jsx(Wi,{"aria-invalid":!!N,className:"mono",disabled:t,id:c,onChange:O=>{f(O.target.value),m&&p(void 0)},onKeyDown:T,placeholder:s,ref:y,value:u}),N&&h.jsx(o8,{children:N}),!N&&n==="add"&&h.jsx(hx,{children:"Only HTTPS URLs are supported right now."}),j&&h.jsxs(hx,{children:["Replaces current URL ",h.jsx("span",{className:"mono text-foreground",children:e})]})]}),h.jsxs("div",{className:"flex items-center justify-end gap-2",children:[h.jsx(ze,{disabled:t,onClick:r,type:"button",variant:"secondary",children:"Cancel"}),h.jsx(ze,{disabled:!S,type:"submit",children:t?"Saving…":n==="add"?"Add remote":"Replace URL"})]})]})}function $ee(){const{data:e,error:t,isError:n,refetch:r}=IG(),{data:i}=Iee(),s=zee(),[a,c]=w.useState(!1),[u,f]=w.useState(!1),m=e?.url,p=e?.gitInitialized,y=!!m,x=p===!0&&!y&&!a,b=`${i?.gitRemoteBaseUrl??"https://example.com"}/team/space.git`;async function S(E){await s.mutateAsync({subcommand:y?"set-url":"add",url:E}),ht.success(y?"Origin replaced.":"Remote added."),c(!1)}async function k(){try{await s.mutateAsync({subcommand:"remove"}),ht.success("Remote removed."),f(!1)}catch(E){ht.error(jn(E,"Failed to remove remote"))}}return h.jsx(s9,{action:x&&h.jsx(ze,{onClick:()=>c(!0),size:"sm",variant:"outline",children:"Add remote"}),compact:!a,description:"Used for push, pull, and fetch.",error:n?t:void 0,errorFallback:"Failed to load remote",onRetry:()=>r().catch(yl),title:"Remotes",children:e?p===!1?h.jsx(Hee,{action:h.jsx(Lv,{}),description:"Initialize version control before adding a remote.",title:"Not initialized"}):a?h.jsx(qee,{initial:m??"",isPending:s.isPending,mode:y?"edit":"add",onCancel:()=>c(!1),onSubmit:S,placeholder:b,webAppUrl:i?.webAppUrl}):m?h.jsxs(h.Fragment,{children:[h.jsx(Uee,{isDeleting:s.isPending&&u,onDelete:()=>f(!0),onEdit:()=>c(!0),url:m}),h.jsx(Vee,{isPending:s.isPending,onConfirm:k,onOpenChange:f,open:u,url:m})]}):h.jsxs("p",{className:"text-muted-foreground text-sm",children:["No remote set. Push and pull need an"," ",h.jsx("code",{className:"mono bg-muted text-foreground rounded px-1 py-0.5 text-xs",children:"origin"})," URL."]}):h.jsxs("div",{className:"flex min-h-8 items-center gap-3",children:[h.jsx(kr,{className:"h-4 w-14"}),h.jsx(kr,{className:"h-5 w-12 rounded-full"}),h.jsx(kr,{className:"h-4 flex-1"}),h.jsx(kr,{className:"h-8 w-12"})]})})}function Yee(){return h.jsx("div",{className:"flex flex-col items-center pt-8",children:h.jsxs("div",{className:"flex w-full flex-col gap-6 md:gap-12 sm:max-w-lg md:max-w-xl lg:max-w-2xl",children:[h.jsx(Dee,{}),h.jsx($ee,{}),h.jsx(Cee,{})]})})}function Wee(){const[e,t]=w.useState(!0),[n,r]=w.useState(!1),i=w.useCallback(()=>{t(c=>!c)},[]),s=w.useCallback(()=>{r(c=>!c)},[]);return{closeRightPanel:w.useCallback(()=>{r(!1)},[]),isLeftPanelOpen:e,isRightPanelOpen:n,toggleLeftPanel:i,toggleRightPanel:s}}const Gee=e=>{const{apiClient:t}=$e.getState();return t?t.request(Af.GET_FILE,e):Promise.reject(new Error("Not connected"))},Kee=({branch:e,path:t})=>({queryFn:()=>Gee({branch:e,path:t}),queryKey:["contextTree","file",e,t]}),Qee=({branch:e,path:t,queryConfig:n})=>or({...Kee({branch:e,path:t}),enabled:!!t,...n}),Xee=e=>{const{apiClient:t}=$e.getState();return t?t.request(Af.GET_NODES,e):Promise.reject(new Error("Not connected"))},Zee=e=>({queryFn:()=>Xee({branch:e}),queryKey:["contextTree","nodes",e]}),Jee=({branch:e,queryConfig:t}={})=>or({...Zee(e),...t}),ete=e=>{const{apiClient:t}=$e.getState();return t?t.request(Af.UPDATE_FILE,e):Promise.reject(new Error("Not connected"))},tte=({mutationConfig:e}={})=>{const t=un(),{onSuccess:n,...r}=e??{};return dn({onSuccess(...i){t.invalidateQueries({queryKey:["contextTree"]}),n?.(...i)},...r,mutationFn:ete})},$f=e=>e.endsWith(".md"),y4=e=>{const t=new Set;if(!e)return t;const n=e.split("/").filter(Boolean);for(let r=0;r<n.length;r++){const i=n.slice(0,r+1).join("/");r===n.length-1&&$f(i)||t.add(i)}return t},Gv=(e,t)=>{for(const n of e){if(n.path===t)return n;if(n.type==="tree"&&n.children&&t.startsWith(n.path+"/")){const r=Gv(n.children,t);if(r)return r}}},l9=(e,t,n=0,r=[])=>{for(const i of e)r.push({depth:n,node:i}),i.type==="tree"&&t.has(i.path)&&i.children&&l9(i.children,t,n+1,r);return r},c9=w.createContext(void 0);function nte({children:e}){const[t,n]=a0(),r=t.get("branch")??void 0,i=t.get("path")??"",[s,a]=w.useState(()=>y4(i)),[c,u]=w.useState(!1),[f,m]=w.useState(""),{data:p,isFetching:y}=Jee({branch:r}),{data:x,isFetching:b}=Qee({branch:r,path:i,queryConfig:{enabled:!!i&&$f(i)}});w.useEffect(()=>{p?.branch&&!t.has("branch")&&n(V=>{const q=new URLSearchParams(V);return q.set("branch",p.branch),q},{replace:!0})},[p?.branch,t,n]);const S=w.useMemo(()=>p?.nodes??[],[p]),k=w.useMemo(()=>i?Gv(S,i):void 0,[S,i]),E=w.useMemo(()=>l9(S,s),[S,s]),T=x?.file,N=w.useCallback(V=>{const q=y4(V);a(H=>new Set([...q,...H]))},[]),j=w.useCallback(V=>{a(q=>{const H=new Set(q);return H.has(V.path)?H.delete(V.path):H.add(V.path),H})},[]),O=w.useCallback(V=>{N(V.path),n(q=>{const H=new URLSearchParams(q);return H.set("path",V.path),H},{replace:!0}),u(!1),m("")},[N,n]),A=w.useCallback(()=>{n(V=>{const q=new URLSearchParams(V);return q.delete("path"),q},{replace:!0}),u(!1),m("")},[n]),R=tte(),L=w.useCallback(()=>{T&&(m(T.content),u(!0))},[T]),B=w.useCallback(()=>{u(!1),m("")},[]),I=w.useCallback(async()=>{!i||!c||(await R.mutateAsync({content:f,path:i}),u(!1))},[f,c,i,R]),U=c&&T!==void 0&&f!==T.content,Y={branch:p?.branch??r,cancelEdit:B,editContent:f,enterEditMode:L,expandedPaths:s,fileData:T,flattenedNodes:E,handleSelect:O,handleToggle:j,hasChanges:U,isEditMode:c,isFetchingFile:b,isFetchingTree:y,isUpdating:R.isPending,navigateHome:A,nodes:S,saveChanges:I,selectedNode:k,selectedPath:i,setEditContent:m};return h.jsx(c9.Provider,{value:Y,children:e})}function uu(){const e=w.useContext(c9);if(!e)throw new Error("useContextTree must be used within a ContextTreeProvider");return e}function rte({name:e,avatar:t,description:n,timestamp:r,className:i}){return h.jsx("div",{className:ae("border-border flex items-center justify-between border-b py-2",i),children:h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsxs(_f,{className:"size-6",children:[t&&h.jsx(O0,{src:t,alt:e}),h.jsx(Lf,{className:"text-sm font-semibold",children:e[0]||"U"})]}),n&&h.jsx("div",{className:"text-muted-foreground text-sm",children:n}),r&&h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"text-muted-foreground font-semibold",children:"·"}),h.jsx("div",{className:"text-muted-foreground text-sm font-semibold",children:r})]})]})})}const ite=w0("group/tag inline-flex h-6 w-fit shrink-0 items-center gap-1 overflow-hidden rounded-md border px-2 text-xs font-medium whitespace-nowrap transition-all [&>svg]:pointer-events-none [&>svg]:size-3",{variants:{variant:{default:"border-border bg-muted text-muted-foreground",secondary:"border-transparent bg-secondary text-secondary-foreground",outline:"border-border bg-transparent text-foreground"},size:{default:"h-6 px-2 text-xs",sm:"h-5 px-2.5 text-xs py-0.5"}},defaultVariants:{variant:"default",size:"default"}});function Rx({className:e,variant:t="default",size:n="default",closable:r=!1,onClose:i,disabled:s=!1,children:a,...c}){const u=w.useCallback(m=>{m.stopPropagation(),s||i?.()},[s,i]),f=w.useCallback(m=>{(m.key==="Enter"||m.key===" ")&&(m.stopPropagation(),m.preventDefault(),s||i?.())},[s,i]);return h.jsxs("span",{"data-slot":"tag","data-disabled":s||void 0,className:ae(ite({variant:t,size:n}),s&&"pointer-events-none opacity-50",r&&"pr-1",e),...c,children:[h.jsx("span",{className:"truncate",children:a}),r&&h.jsx("button",{type:"button","aria-label":"Remove tag",disabled:s,onClick:u,onKeyDown:f,className:"inline-flex shrink-0 items-center justify-center rounded-sm opacity-60 transition-opacity hover:opacity-100 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none cursor-pointer",children:h.jsx(n0,{className:"size-3"})})]})}function ote({fileName:e,content:t,tags:n=[],isLoading:r,error:i,isEditMode:s,editContent:a,editTags:c=[],onContentChange:u,onTagsChange:f,isUpdating:m,hasChanges:p,canEdit:y,onEnterEditMode:x,onSaveChanges:b,onCancelEdit:S,headerClassName:k,isHistoryVisible:E,onToggleHistory:T,showTags:N=!0,timeline:j,contentView:O}){return r?h.jsx("div",{className:"flex h-full items-center justify-center",children:h.jsx(Yd,{className:"size-4 animate-spin"})}):i?h.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-3",children:[h.jsx("div",{className:"text-sm text-red-400",children:"Failed to load file content"}),h.jsx("div",{className:"text-sm text-gray-500",children:i})]}):!t&&!s?h.jsx("div",{className:"flex h-full items-center justify-center",children:h.jsx("div",{className:"text-sm text-gray-500",children:"No content available"})}):s?h.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-4 p-5",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsx("span",{className:"text-foreground text-lg font-semibold",children:e}),h.jsxs("div",{className:"flex gap-2",children:[h.jsx(ze,{size:"default",onClick:S,disabled:m,className:"bg-secondary text-secondary-foreground gap-2 px-4 py-2 text-sm hover:bg-neutral-800",children:"Cancel"}),h.jsx(ze,{variant:"default",size:"default",onClick:b,disabled:m||!p,className:"text-foreground gap-2 px-4 py-2 text-sm",children:m?h.jsxs(h.Fragment,{children:[h.jsx(Yd,{className:"size-4 animate-spin"}),"Saving..."]}):"Save"})]})]}),f&&h.jsxs("div",{className:"flex flex-col gap-2",children:[h.jsx("span",{className:"text-foreground text-sm font-medium",children:"Tags"}),h.jsxs("div",{className:"bg-background flex flex-wrap items-center gap-2 rounded-lg px-5 py-2 border",children:[c.map(A=>h.jsx(Rx,{variant:"outline",closable:!0,onClose:()=>f(c.filter(R=>R!==A)),className:"text-foreground bg-secondary rounded-sm border-none",children:A},A)),h.jsx("input",{type:"text",placeholder:"Add tag...",disabled:m,className:"h-7 w-24 bg-transparent text-sm text-neutral-200 placeholder:text-neutral-500 focus:outline-none",onKeyDown:A=>{if(A.key==="Enter"){A.preventDefault();const R=A.currentTarget.value.trim();R&&!c.includes(R)&&(f([...c,R]),A.currentTarget.value="")}}})]})]}),h.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-2",children:[h.jsx("span",{className:"text-foreground text-sm font-medium",children:"Context detail"}),h.jsx(Iv,{value:a,onChange:A=>u(A.target.value),disabled:m,className:"flex-1 resize-none rounded-lg px-5 text-sm leading-6 text-neutral-200 focus:ring-0 focus:ring-offset-0 focus:outline-none focus-visible:ring-0 focus-visible:ring-offset-0 focus-visible:outline-none",placeholder:"Enter context content..."})]})]}):h.jsxs("div",{className:"mx-auto flex min-h-0 w-full flex-1 flex-col",children:[h.jsxs("div",{className:ae("flex items-center justify-between p-5",k),children:[h.jsx("span",{className:"text-foreground text-lg font-semibold",children:e}),h.jsxs(Na,{children:[h.jsx(Ra,{render:h.jsx(ze,{size:"icon",className:"border-border bg-background hover:bg-muted"}),children:h.jsx(e_,{className:"h-5 w-5"})}),h.jsxs(ks,{align:"end",className:"bg-popover w-32 border-none p-1",children:[y&&h.jsxs(Vn,{className:"bg-popover",onClick:x,children:[h.jsx(h_,{className:"mr-2 h-4 w-4"}),"Edit"]}),h.jsxs(Vn,{className:"bg-popover",onClick:T,children:[h.jsx(s_,{className:"mr-2 h-5 w-5"}),"History"]})]})]})]}),j,N&&n.length>0&&h.jsx("div",{className:"mb-7 flex flex-wrap gap-1.5",children:n.map(A=>h.jsx(Rx,{variant:"default",size:"sm",className:"text-muted-foreground bg-muted rounded-sm border-none",children:A},A))}),h.jsx("div",{className:"overflow-y-auto p-5 pt-0",children:O})]})}function Ym({text:e,className:t,delay:n=500}){const r=w.useRef(null),[i,s]=w.useState(!1);w.useEffect(()=>{const c=r.current;c&&s(c.scrollWidth>c.clientWidth)},[e]);const a=ae("overflow-hidden text-ellipsis whitespace-nowrap",t);return i?h.jsx(Yb,{delay:n,children:h.jsxs(ms,{children:[h.jsx(gs,{render:h.jsx("span",{ref:r,className:a}),children:e}),h.jsx(ys,{className:"[&>[aria-hidden]]:hidden bg-popover text-foreground",children:h.jsx("p",{children:e})})]})}):h.jsx("span",{ref:r,className:a,children:e})}function u9({className:e,...t}){return h.jsx("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto rounded-lg border",children:h.jsx("table",{"data-slot":"table",className:ae("w-full caption-bottom text-sm",e),...t})})}function d9({className:e,...t}){return h.jsx("thead",{"data-slot":"table-header",className:ae("[&_tr]:border-b bg-card",e),...t})}function f9({className:e,...t}){return h.jsx("tbody",{"data-slot":"table-body",className:ae("[&_tr:last-child]:border-0",e),...t})}function Lc({className:e,...t}){return h.jsx("tr",{"data-slot":"table-row",className:ae("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t})}function zi({className:e,...t}){return h.jsx("th",{"data-slot":"table-head",className:ae("h-10 text-left align-middle font-medium whitespace-nowrap text-muted-foreground [&:has([role=checkbox])]:pr-0 px-5",e),...t})}function Nr({className:e,...t}){return h.jsx("td",{"data-slot":"table-cell",className:ae("px-5 py-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 h-12.5",e),...t})}function ste({nodes:e,showBack:t,onNodeClick:n,onBack:r}){return h.jsxs(u9,{className:"overflow-hidden",children:[h.jsx(d9,{className:"bg-popover",children:h.jsxs(Lc,{className:"h-11",children:[h.jsx(zi,{className:"text-muted-foreground bg-border border-border px-6 text-sm",children:"Memory"}),h.jsx(zi,{className:"text-muted-foreground border-border bg-border px-6 text-sm",children:"Updated by"}),h.jsx(zi,{className:"text-muted-foreground border-border bg-border px-6 text-sm",children:"Last Modified"})]})}),h.jsxs(f9,{children:[t&&r&&h.jsxs(Lc,{className:"h-13 cursor-pointer bg-transparent text-sm",onClick:r,children:[h.jsx(Nr,{className:ae("text-foreground px-6 hover:underline",{"border-border border-b":e.length>0}),children:h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(Ry,{className:"text-muted-foreground size-4 shrink-0",strokeWidth:2}),h.jsx(Ym,{text:".."})]})}),h.jsx(Nr,{className:ae("px-6 text-muted-foreground",{"border-border border-b":e.length>0})}),h.jsx(Nr,{className:ae("px-6 text-muted-foreground",{"border-border border-b":e.length>0})})]}),e.map((i,s)=>{const a=s===e.length-1;return h.jsxs(Lc,{className:"h-13 cursor-pointer bg-transparent text-sm",onClick:()=>n(i),children:[h.jsx(Nr,{className:ae("text-foreground px-6 hover:underline",{"border-border border-b":!a}),children:h.jsxs("div",{className:"flex items-center gap-2",children:[i.type==="tree"?h.jsx(Ry,{className:"text-muted-foreground size-4 shrink-0",strokeWidth:2}):h.jsx(c6,{className:"text-primary size-4 shrink-0",strokeWidth:2}),h.jsx(Ym,{text:i.name})]})}),h.jsx(Nr,{className:ae("text-muted-foreground px-6",{"border-border border-b":!a}),children:i.type==="blob"&&i.lastUpdatedBy?i.lastUpdatedBy:"-"}),h.jsx(Nr,{className:ae("text-muted-foreground px-6",{"border-border border-b":!a}),children:i.type==="blob"&&i.lastUpdatedWhen?i.lastUpdatedWhen:"-"})]},i.path)})]})]})}const h9=6048e5,ate=864e5,_p=43200,x4=1440,b4=Symbol.for("constructDateFrom");function Gn(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&b4 in e?e[b4](t):e instanceof Date?new e.constructor(t):new Date(t)}function en(e,t){return Gn(t||e,e)}function p9(e,t,n){const r=en(e,n?.in);return isNaN(t)?Gn(e,NaN):(t&&r.setDate(r.getDate()+t),r)}function m9(e,t,n){const r=en(e,n?.in);if(isNaN(t))return Gn(e,NaN);if(!t)return r;const i=r.getDate(),s=Gn(e,r.getTime());s.setMonth(r.getMonth()+t+1,0);const a=s.getDate();return i>=a?s:(r.setFullYear(s.getFullYear(),s.getMonth(),i),r)}let lte={};function du(){return lte}function Gc(e,t){const n=du(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,i=en(e,t?.in),s=i.getDay(),a=(s<r?7:0)+s-r;return i.setDate(i.getDate()-a),i.setHours(0,0,0,0),i}function df(e,t){return Gc(e,{...t,weekStartsOn:1})}function g9(e,t){const n=en(e,t?.in),r=n.getFullYear(),i=Gn(n,0);i.setFullYear(r+1,0,4),i.setHours(0,0,0,0);const s=df(i),a=Gn(n,0);a.setFullYear(r,0,4),a.setHours(0,0,0,0);const c=df(a);return n.getTime()>=s.getTime()?r+1:n.getTime()>=c.getTime()?r:r-1}function Wm(e){const t=en(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function Oa(e,...t){const n=Gn.bind(null,e||t.find(r=>typeof r=="object"));return t.map(n)}function Kc(e,t){const n=en(e,t?.in);return n.setHours(0,0,0,0),n}function Kv(e,t,n){const[r,i]=Oa(n?.in,e,t),s=Kc(r),a=Kc(i),c=+s-Wm(s),u=+a-Wm(a);return Math.round((c-u)/ate)}function cte(e,t){const n=g9(e,t),r=Gn(e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),df(r)}function ute(e,t,n){return p9(e,t*7,n)}function dte(e,t,n){return m9(e,t*12,n)}function fte(e,t){let n,r=t?.in;return e.forEach(i=>{!r&&typeof i=="object"&&(r=Gn.bind(null,i));const s=en(i,r);(!n||n<s||isNaN(+s))&&(n=s)}),Gn(r,n||NaN)}function hte(e,t){let n,r=t?.in;return e.forEach(i=>{!r&&typeof i=="object"&&(r=Gn.bind(null,i));const s=en(i,r);(!n||n>s||isNaN(+s))&&(n=s)}),Gn(r,n||NaN)}function dm(e,t){const n=+en(e)-+en(t);return n<0?-1:n>0?1:n}function pte(e){return Gn(e,Date.now())}function mte(e,t,n){const[r,i]=Oa(n?.in,e,t);return+Kc(r)==+Kc(i)}function y9(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function gte(e){return!(!y9(e)&&typeof e!="number"||isNaN(+en(e)))}function Qv(e,t,n){const[r,i]=Oa(n?.in,e,t),s=r.getFullYear()-i.getFullYear(),a=r.getMonth()-i.getMonth();return s*12+a}function yte(e){return t=>{const r=(e?Math[e]:Math.trunc)(t);return r===0?0:r}}function xte(e,t){return+en(e)-+en(t)}function x9(e,t){const n=en(e,t?.in);return n.setHours(23,59,59,999),n}function b9(e,t){const n=en(e,t?.in),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(23,59,59,999),n}function bte(e,t){const n=en(e,t?.in);return+x9(n,t)==+b9(n,t)}function vte(e,t,n){const[r,i,s]=Oa(n?.in,e,e,t),a=dm(i,s),c=Math.abs(Qv(i,s));if(c<1)return 0;i.getMonth()===1&&i.getDate()>27&&i.setDate(30),i.setMonth(i.getMonth()-a*c);let u=dm(i,s)===-a;bte(r)&&c===1&&dm(r,s)===1&&(u=!1);const f=a*(c-+u);return f===0?0:f}function wte(e,t,n){const r=xte(e,t)/1e3;return yte(n?.roundingMethod)(r)}function v9(e,t){const[n,r]=Oa(e,t.start,t.end);return{start:n,end:r}}function Ste(e,t){const{start:n,end:r}=v9(t?.in,e);let i=+n>+r;const s=i?+n:+r,a=i?r:n;a.setHours(0,0,0,0),a.setDate(1);let c=1;const u=[];for(;+a<=s;)u.push(Gn(n,a)),a.setMonth(a.getMonth()+c);return i?u.reverse():u}function Cte(e,t){const n=en(e,t?.in);return n.setDate(1),n.setHours(0,0,0,0),n}function kte(e,t){const n=en(e,t?.in),r=n.getFullYear();return n.setFullYear(r+1,0,0),n.setHours(23,59,59,999),n}function w9(e,t){const n=en(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function Ete(e,t){const{start:n,end:r}=v9(t?.in,e);let i=+n>+r;const s=i?+n:+r,a=i?r:n;a.setHours(0,0,0,0),a.setMonth(0,1);let c=1;const u=[];for(;+a<=s;)u.push(Gn(n,a)),a.setFullYear(a.getFullYear()+c);return i?u.reverse():u}function S9(e,t){const n=du(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,i=en(e,t?.in),s=i.getDay(),a=(s<r?-7:0)+6-(s-r);return i.setDate(i.getDate()+a),i.setHours(23,59,59,999),i}function Tte(e,t){return S9(e,{...t,weekStartsOn:1})}const Nte={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},Rte=(e,t,n)=>{let r;const i=Nte[e];return typeof i=="string"?r=i:t===1?r=i.one:r=i.other.replace("{{count}}",t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function Q2(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const Ate={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Ote={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},jte={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Mte={date:Q2({formats:Ate,defaultWidth:"full"}),time:Q2({formats:Ote,defaultWidth:"full"}),dateTime:Q2({formats:jte,defaultWidth:"full"})},Dte={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},_te=(e,t,n,r)=>Dte[e];function xd(e){return(t,n)=>{const r=n?.context?String(n.context):"standalone";let i;if(r==="formatting"&&e.formattingValues){const a=e.defaultFormattingWidth||e.defaultWidth,c=n?.width?String(n.width):a;i=e.formattingValues[c]||e.formattingValues[a]}else{const a=e.defaultWidth,c=n?.width?String(n.width):e.defaultWidth;i=e.values[c]||e.values[a]}const s=e.argumentCallback?e.argumentCallback(t):t;return i[s]}}const Lte={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Ite={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Pte={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},zte={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},Fte={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},Bte={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},Hte=(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},Ute={ordinalNumber:Hte,era:xd({values:Lte,defaultWidth:"wide"}),quarter:xd({values:Ite,defaultWidth:"wide",argumentCallback:e=>e-1}),month:xd({values:Pte,defaultWidth:"wide"}),day:xd({values:zte,defaultWidth:"wide"}),dayPeriod:xd({values:Fte,defaultWidth:"wide",formattingValues:Bte,defaultFormattingWidth:"wide"})};function bd(e){return(t,n={})=>{const r=n.width,i=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],s=t.match(i);if(!s)return null;const a=s[0],c=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],u=Array.isArray(c)?qte(c,p=>p.test(a)):Vte(c,p=>p.test(a));let f;f=e.valueCallback?e.valueCallback(u):u,f=n.valueCallback?n.valueCallback(f):f;const m=t.slice(a.length);return{value:f,rest:m}}}function Vte(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function qte(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function $te(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const i=r[0],s=t.match(e.parsePattern);if(!s)return null;let a=e.valueCallback?e.valueCallback(s[0]):s[0];a=n.valueCallback?n.valueCallback(a):a;const c=t.slice(i.length);return{value:a,rest:c}}}const Yte=/^(\d+)(th|st|nd|rd)?/i,Wte=/\d+/i,Gte={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},Kte={any:[/^b/i,/^(a|c)/i]},Qte={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Xte={any:[/1/i,/2/i,/3/i,/4/i]},Zte={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Jte={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},ene={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},tne={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},nne={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},rne={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},ine={ordinalNumber:$te({matchPattern:Yte,parsePattern:Wte,valueCallback:e=>parseInt(e,10)}),era:bd({matchPatterns:Gte,defaultMatchWidth:"wide",parsePatterns:Kte,defaultParseWidth:"any"}),quarter:bd({matchPatterns:Qte,defaultMatchWidth:"wide",parsePatterns:Xte,defaultParseWidth:"any",valueCallback:e=>e+1}),month:bd({matchPatterns:Zte,defaultMatchWidth:"wide",parsePatterns:Jte,defaultParseWidth:"any"}),day:bd({matchPatterns:ene,defaultMatchWidth:"wide",parsePatterns:tne,defaultParseWidth:"any"}),dayPeriod:bd({matchPatterns:nne,defaultMatchWidth:"any",parsePatterns:rne,defaultParseWidth:"any"})},nl={code:"en-US",formatDistance:Rte,formatLong:Mte,formatRelative:_te,localize:Ute,match:ine,options:{weekStartsOn:0,firstWeekContainsDate:1}};function one(e,t){const n=en(e,t?.in);return Kv(n,w9(n))+1}function Xv(e,t){const n=en(e,t?.in),r=+df(n)-+cte(n);return Math.round(r/h9)+1}function C9(e,t){const n=en(e,t?.in),r=n.getFullYear(),i=du(),s=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,a=Gn(t?.in||e,0);a.setFullYear(r+1,0,s),a.setHours(0,0,0,0);const c=Gc(a,t),u=Gn(t?.in||e,0);u.setFullYear(r,0,s),u.setHours(0,0,0,0);const f=Gc(u,t);return+n>=+c?r+1:+n>=+f?r:r-1}function sne(e,t){const n=du(),r=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,i=C9(e,t),s=Gn(t?.in||e,0);return s.setFullYear(i,0,r),s.setHours(0,0,0,0),Gc(s,t)}function Zv(e,t){const n=en(e,t?.in),r=+Gc(n,t)-+sne(n,t);return Math.round(r/h9)+1}function mn(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const Zs={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return mn(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):mn(n+1,2)},d(e,t){return mn(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];default:return n==="am"?"a.m.":"p.m."}},h(e,t){return mn(e.getHours()%12||12,t.length)},H(e,t){return mn(e.getHours(),t.length)},m(e,t){return mn(e.getMinutes(),t.length)},s(e,t){return mn(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),i=Math.trunc(r*Math.pow(10,n-3));return mn(i,t.length)}},hc={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},v4={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const r=e.getFullYear(),i=r>0?r:1-r;return n.ordinalNumber(i,{unit:"year"})}return Zs.y(e,t)},Y:function(e,t,n,r){const i=C9(e,r),s=i>0?i:1-i;if(t==="YY"){const a=s%100;return mn(a,2)}return t==="Yo"?n.ordinalNumber(s,{unit:"year"}):mn(s,t.length)},R:function(e,t){const n=g9(e);return mn(n,t.length)},u:function(e,t){const n=e.getFullYear();return mn(n,t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return mn(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return mn(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return Zs.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return mn(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const i=Zv(e,r);return t==="wo"?n.ordinalNumber(i,{unit:"week"}):mn(i,t.length)},I:function(e,t,n){const r=Xv(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):mn(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):Zs.d(e,t)},D:function(e,t,n){const r=one(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):mn(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const i=e.getDay(),s=(i-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(s);case"ee":return mn(s,2);case"eo":return n.ordinalNumber(s,{unit:"day"});case"eee":return n.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(i,{width:"short",context:"formatting"});default:return n.day(i,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const i=e.getDay(),s=(i-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(s);case"cc":return mn(s,t.length);case"co":return n.ordinalNumber(s,{unit:"day"});case"ccc":return n.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(i,{width:"narrow",context:"standalone"});case"cccccc":return n.day(i,{width:"short",context:"standalone"});default:return n.day(i,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),i=r===0?7:r;switch(t){case"i":return String(i);case"ii":return mn(i,t.length);case"io":return n.ordinalNumber(i,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const i=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(i,{width:"narrow",context:"formatting"});default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let i;switch(r===12?i=hc.noon:r===0?i=hc.midnight:i=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(i,{width:"narrow",context:"formatting"});default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let i;switch(r>=17?i=hc.evening:r>=12?i=hc.afternoon:r>=4?i=hc.morning:i=hc.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(i,{width:"narrow",context:"formatting"});default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return Zs.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):Zs.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):mn(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):mn(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):Zs.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):Zs.s(e,t)},S:function(e,t){return Zs.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return S4(r);case"XXXX":case"XX":return tl(r);default:return tl(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return S4(r);case"xxxx":case"xx":return tl(r);default:return tl(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+w4(r,":");default:return"GMT"+tl(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+w4(r,":");default:return"GMT"+tl(r,":")}},t:function(e,t,n){const r=Math.trunc(+e/1e3);return mn(r,t.length)},T:function(e,t,n){return mn(+e,t.length)}};function w4(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=Math.trunc(r/60),s=r%60;return s===0?n+String(i):n+String(i)+t+mn(s,2)}function S4(e,t){return e%60===0?(e>0?"-":"+")+mn(Math.abs(e)/60,2):tl(e,t)}function tl(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=mn(Math.trunc(r/60),2),s=mn(r%60,2);return n+i+t+s}const C4=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},k9=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},ane=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],i=n[2];if(!i)return C4(e,t);let s;switch(r){case"P":s=t.dateTime({width:"short"});break;case"PP":s=t.dateTime({width:"medium"});break;case"PPP":s=t.dateTime({width:"long"});break;default:s=t.dateTime({width:"full"});break}return s.replace("{{date}}",C4(r,t)).replace("{{time}}",k9(i,t))},lne={p:k9,P:ane},cne=/^D+$/,une=/^Y+$/,dne=["D","DD","YY","YYYY"];function fne(e){return cne.test(e)}function hne(e){return une.test(e)}function pne(e,t,n){const r=mne(e,t,n);if(console.warn(r),dne.includes(e))throw new RangeError(r)}function mne(e,t,n){const r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const gne=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,yne=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,xne=/^'([^]*?)'?$/,bne=/''/g,vne=/[a-zA-Z]/;function ll(e,t,n){const r=du(),i=n?.locale??r.locale??nl,s=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,a=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,c=en(e,n?.in);if(!gte(c))throw new RangeError("Invalid time value");let u=t.match(yne).map(m=>{const p=m[0];if(p==="p"||p==="P"){const y=lne[p];return y(m,i.formatLong)}return m}).join("").match(gne).map(m=>{if(m==="''")return{isToken:!1,value:"'"};const p=m[0];if(p==="'")return{isToken:!1,value:wne(m)};if(v4[p])return{isToken:!0,value:m};if(p.match(vne))throw new RangeError("Format string contains an unescaped latin alphabet character `"+p+"`");return{isToken:!1,value:m}});i.localize.preprocessor&&(u=i.localize.preprocessor(c,u));const f={firstWeekContainsDate:s,weekStartsOn:a,locale:i};return u.map(m=>{if(!m.isToken)return m.value;const p=m.value;(!n?.useAdditionalWeekYearTokens&&hne(p)||!n?.useAdditionalDayOfYearTokens&&fne(p))&&pne(p,t,String(e));const y=v4[p[0]];return y(c,p,i.localize,f)}).join("")}function wne(e){const t=e.match(xne);return t?t[1].replace(bne,"'"):e}function Sne(e,t,n){const r=du(),i=n?.locale??r.locale??nl,s=2520,a=dm(e,t);if(isNaN(a))throw new RangeError("Invalid time value");const c=Object.assign({},n,{addSuffix:n?.addSuffix,comparison:a}),[u,f]=Oa(n?.in,...a>0?[t,e]:[e,t]),m=wte(f,u),p=(Wm(f)-Wm(u))/1e3,y=Math.round((m-p)/60);let x;if(y<2)return n?.includeSeconds?m<5?i.formatDistance("lessThanXSeconds",5,c):m<10?i.formatDistance("lessThanXSeconds",10,c):m<20?i.formatDistance("lessThanXSeconds",20,c):m<40?i.formatDistance("halfAMinute",0,c):m<60?i.formatDistance("lessThanXMinutes",1,c):i.formatDistance("xMinutes",1,c):y===0?i.formatDistance("lessThanXMinutes",1,c):i.formatDistance("xMinutes",y,c);if(y<45)return i.formatDistance("xMinutes",y,c);if(y<90)return i.formatDistance("aboutXHours",1,c);if(y<x4){const b=Math.round(y/60);return i.formatDistance("aboutXHours",b,c)}else{if(y<s)return i.formatDistance("xDays",1,c);if(y<_p){const b=Math.round(y/x4);return i.formatDistance("xDays",b,c)}else if(y<_p*2)return x=Math.round(y/_p),i.formatDistance("aboutXMonths",x,c)}if(x=vte(f,u),x<12){const b=Math.round(y/_p);return i.formatDistance("xMonths",b,c)}else{const b=x%12,S=Math.trunc(x/12);return b<3?i.formatDistance("aboutXYears",S,c):b<9?i.formatDistance("overXYears",S,c):i.formatDistance("almostXYears",S+1,c)}}function k4(e,t){return Sne(e,pte(e),t)}function Cne(e,t){const n=en(e,t?.in),r=n.getFullYear(),i=n.getMonth(),s=Gn(n,0);return s.setFullYear(r,i+1,0),s.setHours(0,0,0,0),s.getDate()}function kne(e,t){return en(e,t?.in).getMonth()}function Ene(e,t){return en(e,t?.in).getFullYear()}function Tne(e,t){return+en(e)>+en(t)}function Nne(e,t){return+en(e)<+en(t)}function Rne(e,t,n){const[r,i]=Oa(n?.in,e,t);return r.getFullYear()===i.getFullYear()&&r.getMonth()===i.getMonth()}function Ane(e,t,n){const[r,i]=Oa(n?.in,e,t);return r.getFullYear()===i.getFullYear()}function One(e,t,n){const r=en(e,n?.in),i=r.getFullYear(),s=r.getDate(),a=Gn(e,0);a.setFullYear(i,t,15),a.setHours(0,0,0,0);const c=Cne(a);return r.setMonth(t,Math.min(s,c)),r}function jne(e,t,n){const r=en(e,n?.in);return isNaN(+r)?Gn(e,NaN):(r.setFullYear(t),r)}const Mne=e=>{const{apiClient:t}=$e.getState();return t?t.request(Af.GET_FILE_METADATA,e):Promise.reject(new Error("Not connected"))},Dne=e=>({queryFn:()=>Mne({paths:e}),queryKey:["contextTree","fileMetadata",...[...e].sort()]}),_ne=({enabled:e=!0,paths:t,queryConfig:n})=>or({...Dne(t),enabled:e&&t.length>0,...n}),Lne=e=>{const{apiClient:t}=$e.getState();return t?t.request(Af.GET_HISTORY,e):Promise.reject(new Error("Not connected"))},E9=({enabled:e=!0,path:t})=>ZH({enabled:e&&!!t,getNextPageParam:n=>n.hasMore?n.nextCursor:void 0,initialPageParam:void 0,queryFn:({pageParam:n})=>Lne({cursor:n,path:t}),queryKey:["contextTree","history",t]});function Ine({className:e,...t}){return h.jsx("nav",{"aria-label":"breadcrumb","data-slot":"breadcrumb",className:ae(e),...t})}function Pne({className:e,...t}){return h.jsx("ol",{"data-slot":"breadcrumb-list",className:ae("flex flex-wrap items-center gap-1.5 text-sm wrap-break-word text-muted-foreground sm:gap-2.5",e),...t})}function X2({className:e,...t}){return h.jsx("li",{"data-slot":"breadcrumb-item",className:ae("inline-flex items-center gap-1.5",e),...t})}function E4({className:e,render:t,...n}){return BR({defaultTagName:"a",props:jo({className:ae("transition-colors hover:text-foreground",e)},n),render:t,state:{slot:"breadcrumb-link"}})}function zne({className:e,...t}){return h.jsx("span",{"data-slot":"breadcrumb-page",role:"link","aria-disabled":"true","aria-current":"page",className:ae("font-normal text-foreground",e),...t})}function T4({children:e,className:t,...n}){return h.jsx("li",{"data-slot":"breadcrumb-separator",role:"presentation","aria-hidden":"true",className:ae("[&>svg]:size-3.5",t),...n,children:e??h.jsx(t0,{})})}function Fne({className:e,...t}){return h.jsxs("span",{"data-slot":"breadcrumb-ellipsis",role:"presentation","aria-hidden":"true",className:ae("flex size-5 items-center justify-center [&>svg]:size-4",e),...t,children:[h.jsx(n_,{}),h.jsx("span",{className:"sr-only",children:"More"})]})}const Bne=3;function Z2({type:e}){return e==="tree"?h.jsx(CA,{className:"text-secondary-foreground h-4 w-4.5",strokeWidth:2}):h.jsx(E0,{className:"text-primary-foreground size-4",strokeWidth:2})}function N4(){const{handleSelect:e,navigateHome:t,nodes:n,selectedPath:r}=uu(),i=w.useMemo(()=>{if(!r)return[];const u=r.split("/").filter(Boolean);return u.map((f,m)=>{const p=u.slice(0,m+1).join("/");return Gv(n,p)}).filter(f=>f!==void 0)},[r,n]),s=i.length>Bne,a=s?i.slice(0,-2):[],c=s?i.slice(-2):i;return h.jsx(Ine,{className:"min-w-0 text-sm font-medium",children:h.jsxs(Pne,{className:"h-8 flex-nowrap gap-1 whitespace-nowrap sm:gap-1",children:[h.jsx(X2,{children:h.jsx(E4,{className:"cursor-pointer rounded px-1 hover:bg-neutral-800",onClick:t,children:h.jsx(kA,{className:"text-secondary-foreground size-4"})})}),s&&h.jsxs(h.Fragment,{children:[h.jsx(T4,{className:"text-muted-foreground text-sm font-medium",children:"/"}),h.jsx(X2,{children:h.jsxs(Na,{children:[h.jsx(Ra,{className:"flex h-5 cursor-pointer items-center rounded-sm outline-none hover:bg-neutral-800 focus-visible:outline-none",children:h.jsx(Fne,{className:"text-foreground"})}),h.jsx(ks,{align:"start",children:a.map(u=>h.jsxs(Vn,{className:"flex cursor-pointer items-center gap-2 hover:bg-neutral-800",onClick:()=>e(u),children:[h.jsx(Z2,{type:u.type}),h.jsx("span",{children:u.name})]},u.path))})]})})]}),c.map((u,f)=>{const m=f===c.length-1;return h.jsxs(w.Fragment,{children:[h.jsx(T4,{className:"text-muted-foreground text-sm font-medium",children:"/"}),h.jsx(X2,{children:m?h.jsxs(zne,{className:"text-secondary-foreground flex items-center gap-2 px-2 text-sm font-medium",children:[h.jsx(Z2,{type:u.type}),h.jsx("span",{children:u.name})]}):h.jsxs(E4,{className:"text-muted-foreground flex cursor-pointer items-center gap-2 rounded px-2 text-sm font-medium hover:bg-neutral-800",onClick:()=>e(u),children:[h.jsx(Z2,{type:u.type}),h.jsx("span",{children:u.name})]})})]},u.path)})]})})}function R4(e){const t=[],n=String(e||"");let r=n.indexOf(","),i=0,s=!1;for(;!s;){r===-1&&(r=n.length,s=!0);const a=n.slice(i,r).trim();(a||!s)&&t.push(a),i=r+1,r=n.indexOf(",",i)}return t}function Hne(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Une=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Vne=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,qne={};function A4(e,t){return(qne.jsx?Vne:Une).test(e)}const $ne=/[ \t\n\f\r]/g;function Yne(e){return typeof e=="object"?e.type==="text"?O4(e.value):!1:O4(e)}function O4(e){return e.replace($ne,"")===""}class Yf{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Yf.prototype.normal={};Yf.prototype.property={};Yf.prototype.space=void 0;function T9(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new Yf(n,r,t)}function ff(e){return e.toLowerCase()}class ni{constructor(t,n){this.attribute=n,this.property=t}}ni.prototype.attribute="";ni.prototype.booleanish=!1;ni.prototype.boolean=!1;ni.prototype.commaOrSpaceSeparated=!1;ni.prototype.commaSeparated=!1;ni.prototype.defined=!1;ni.prototype.mustUseProperty=!1;ni.prototype.number=!1;ni.prototype.overloadedBoolean=!1;ni.prototype.property="";ni.prototype.spaceSeparated=!1;ni.prototype.space=void 0;let Wne=0;const Dt=Al(),er=Al(),Ax=Al(),Fe=Al(),kn=Al(),Ic=Al(),di=Al();function Al(){return 2**++Wne}const Ox=Object.freeze(Object.defineProperty({__proto__:null,boolean:Dt,booleanish:er,commaOrSpaceSeparated:di,commaSeparated:Ic,number:Fe,overloadedBoolean:Ax,spaceSeparated:kn},Symbol.toStringTag,{value:"Module"})),J2=Object.keys(Ox);class Jv extends ni{constructor(t,n,r,i){let s=-1;if(super(t,n),j4(this,"space",i),typeof r=="number")for(;++s<J2.length;){const a=J2[s];j4(this,J2[s],(r&Ox[a])===Ox[a])}}}Jv.prototype.defined=!0;function j4(e,t,n){n&&(e[t]=n)}function fu(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const s=new Jv(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(s.mustUseProperty=!0),t[r]=s,n[ff(r)]=r,n[ff(s.attribute)]=r}return new Yf(t,n,e.space)}const N9=fu({properties:{ariaActiveDescendant:null,ariaAtomic:er,ariaAutoComplete:null,ariaBusy:er,ariaChecked:er,ariaColCount:Fe,ariaColIndex:Fe,ariaColSpan:Fe,ariaControls:kn,ariaCurrent:null,ariaDescribedBy:kn,ariaDetails:null,ariaDisabled:er,ariaDropEffect:kn,ariaErrorMessage:null,ariaExpanded:er,ariaFlowTo:kn,ariaGrabbed:er,ariaHasPopup:null,ariaHidden:er,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:kn,ariaLevel:Fe,ariaLive:null,ariaModal:er,ariaMultiLine:er,ariaMultiSelectable:er,ariaOrientation:null,ariaOwns:kn,ariaPlaceholder:null,ariaPosInSet:Fe,ariaPressed:er,ariaReadOnly:er,ariaRelevant:null,ariaRequired:er,ariaRoleDescription:kn,ariaRowCount:Fe,ariaRowIndex:Fe,ariaRowSpan:Fe,ariaSelected:er,ariaSetSize:Fe,ariaSort:null,ariaValueMax:Fe,ariaValueMin:Fe,ariaValueNow:Fe,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function R9(e,t){return t in e?e[t]:t}function A9(e,t){return R9(e,t.toLowerCase())}const Gne=fu({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Ic,acceptCharset:kn,accessKey:kn,action:null,allow:null,allowFullScreen:Dt,allowPaymentRequest:Dt,allowUserMedia:Dt,alt:null,as:null,async:Dt,autoCapitalize:null,autoComplete:kn,autoFocus:Dt,autoPlay:Dt,blocking:kn,capture:null,charSet:null,checked:Dt,cite:null,className:kn,cols:Fe,colSpan:null,content:null,contentEditable:er,controls:Dt,controlsList:kn,coords:Fe|Ic,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Dt,defer:Dt,dir:null,dirName:null,disabled:Dt,download:Ax,draggable:er,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Dt,formTarget:null,headers:kn,height:Fe,hidden:Ax,high:Fe,href:null,hrefLang:null,htmlFor:kn,httpEquiv:kn,id:null,imageSizes:null,imageSrcSet:null,inert:Dt,inputMode:null,integrity:null,is:null,isMap:Dt,itemId:null,itemProp:kn,itemRef:kn,itemScope:Dt,itemType:kn,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Dt,low:Fe,manifest:null,max:null,maxLength:Fe,media:null,method:null,min:null,minLength:Fe,multiple:Dt,muted:Dt,name:null,nonce:null,noModule:Dt,noValidate:Dt,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Dt,optimum:Fe,pattern:null,ping:kn,placeholder:null,playsInline:Dt,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Dt,referrerPolicy:null,rel:kn,required:Dt,reversed:Dt,rows:Fe,rowSpan:Fe,sandbox:kn,scope:null,scoped:Dt,seamless:Dt,selected:Dt,shadowRootClonable:Dt,shadowRootDelegatesFocus:Dt,shadowRootMode:null,shape:null,size:Fe,sizes:null,slot:null,span:Fe,spellCheck:er,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Fe,step:null,style:null,tabIndex:Fe,target:null,title:null,translate:null,type:null,typeMustMatch:Dt,useMap:null,value:er,width:Fe,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:kn,axis:null,background:null,bgColor:null,border:Fe,borderColor:null,bottomMargin:Fe,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Dt,declare:Dt,event:null,face:null,frame:null,frameBorder:null,hSpace:Fe,leftMargin:Fe,link:null,longDesc:null,lowSrc:null,marginHeight:Fe,marginWidth:Fe,noResize:Dt,noHref:Dt,noShade:Dt,noWrap:Dt,object:null,profile:null,prompt:null,rev:null,rightMargin:Fe,rules:null,scheme:null,scrolling:er,standby:null,summary:null,text:null,topMargin:Fe,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Fe,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Dt,disableRemotePlayback:Dt,prefix:null,property:null,results:Fe,security:null,unselectable:null},space:"html",transform:A9}),Kne=fu({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:di,accentHeight:Fe,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Fe,amplitude:Fe,arabicForm:null,ascent:Fe,attributeName:null,attributeType:null,azimuth:Fe,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Fe,by:null,calcMode:null,capHeight:Fe,className:kn,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Fe,diffuseConstant:Fe,direction:null,display:null,dur:null,divisor:Fe,dominantBaseline:null,download:Dt,dx:null,dy:null,edgeMode:null,editable:null,elevation:Fe,enableBackground:null,end:null,event:null,exponent:Fe,externalResourcesRequired:null,fill:null,fillOpacity:Fe,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Ic,g2:Ic,glyphName:Ic,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Fe,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Fe,horizOriginX:Fe,horizOriginY:Fe,id:null,ideographic:Fe,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Fe,k:Fe,k1:Fe,k2:Fe,k3:Fe,k4:Fe,kernelMatrix:di,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Fe,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Fe,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Fe,overlineThickness:Fe,paintOrder:null,panose1:null,path:null,pathLength:Fe,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:kn,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Fe,pointsAtY:Fe,pointsAtZ:Fe,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:di,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:di,rev:di,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:di,requiredFeatures:di,requiredFonts:di,requiredFormats:di,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Fe,specularExponent:Fe,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Fe,strikethroughThickness:Fe,string:null,stroke:null,strokeDashArray:di,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Fe,strokeOpacity:Fe,strokeWidth:null,style:null,surfaceScale:Fe,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:di,tabIndex:Fe,tableValues:null,target:null,targetX:Fe,targetY:Fe,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:di,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Fe,underlineThickness:Fe,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Fe,values:null,vAlphabetic:Fe,vMathematical:Fe,vectorEffect:null,vHanging:Fe,vIdeographic:Fe,version:null,vertAdvY:Fe,vertOriginX:Fe,vertOriginY:Fe,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Fe,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:R9}),O9=fu({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),j9=fu({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:A9}),M9=fu({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),Qne={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},Xne=/[A-Z]/g,M4=/-[a-z]/g,Zne=/^data[-\w.:]+$/i;function D9(e,t){const n=ff(t);let r=t,i=ni;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&Zne.test(t)){if(t.charAt(4)==="-"){const s=t.slice(5).replace(M4,ere);r="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=t.slice(4);if(!M4.test(s)){let a=s.replace(Xne,Jne);a.charAt(0)!=="-"&&(a="-"+a),t="data"+a}}i=Jv}return new i(r,t)}function Jne(e){return"-"+e.toLowerCase()}function ere(e){return e.charAt(1).toUpperCase()}const _9=T9([N9,Gne,O9,j9,M9],"html"),F0=T9([N9,Kne,O9,j9,M9],"svg");function D4(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function tre(e){return e.join(" ").trim()}var pc={},ey,_4;function nre(){if(_4)return ey;_4=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,a=/^[;\s]*/,c=/^\s+|\s+$/g,u=`
88
+ `,f="/",m="*",p="",y="comment",x="declaration";function b(k,E){if(typeof k!="string")throw new TypeError("First argument must be a string");if(!k)return[];E=E||{};var T=1,N=1;function j(q){var H=q.match(t);H&&(T+=H.length);var z=q.lastIndexOf(u);N=~z?q.length-z:N+q.length}function O(){var q={line:T,column:N};return function(H){return H.position=new A(q),B(),H}}function A(q){this.start=q,this.end={line:T,column:N},this.source=E.source}A.prototype.content=k;function R(q){var H=new Error(E.source+":"+T+":"+N+": "+q);if(H.reason=q,H.filename=E.source,H.line=T,H.column=N,H.source=k,!E.silent)throw H}function L(q){var H=q.exec(k);if(H){var z=H[0];return j(z),k=k.slice(z.length),H}}function B(){L(n)}function I(q){var H;for(q=q||[];H=U();)H!==!1&&q.push(H);return q}function U(){var q=O();if(!(f!=k.charAt(0)||m!=k.charAt(1))){for(var H=2;p!=k.charAt(H)&&(m!=k.charAt(H)||f!=k.charAt(H+1));)++H;if(H+=2,p===k.charAt(H-1))return R("End of comment missing");var z=k.slice(2,H-2);return N+=2,j(z),k=k.slice(H),N+=2,q({type:y,comment:z})}}function Y(){var q=O(),H=L(r);if(H){if(U(),!L(i))return R("property missing ':'");var z=L(s),$=q({type:x,property:S(H[0].replace(e,p)),value:z?S(z[0].replace(e,p)):p});return L(a),$}}function V(){var q=[];I(q);for(var H;H=Y();)H!==!1&&(q.push(H),I(q));return q}return B(),V()}function S(k){return k?k.replace(c,p):p}return ey=b,ey}var L4;function rre(){if(L4)return pc;L4=1;var e=pc&&pc.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(pc,"__esModule",{value:!0}),pc.default=n;const t=e(nre());function n(r,i){let s=null;if(!r||typeof r!="string")return s;const a=(0,t.default)(r),c=typeof i=="function";return a.forEach(u=>{if(u.type!=="declaration")return;const{property:f,value:m}=u;c?i(f,m,u):m&&(s=s||{},s[f]=m)}),s}return pc}var vd={},I4;function ire(){if(I4)return vd;I4=1,Object.defineProperty(vd,"__esModule",{value:!0}),vd.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,s=function(f){return!f||n.test(f)||e.test(f)},a=function(f,m){return m.toUpperCase()},c=function(f,m){return"".concat(m,"-")},u=function(f,m){return m===void 0&&(m={}),s(f)?f:(f=f.toLowerCase(),m.reactCompat?f=f.replace(i,c):f=f.replace(r,c),f.replace(t,a))};return vd.camelCase=u,vd}var wd,P4;function ore(){if(P4)return wd;P4=1;var e=wd&&wd.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},t=e(rre()),n=ire();function r(i,s){var a={};return!i||typeof i!="string"||(0,t.default)(i,function(c,u){c&&u&&(a[(0,n.camelCase)(c,s)]=u)}),a}return r.default=r,wd=r,wd}var sre=ore();const are=Zc(sre),L9=I9("end"),ew=I9("start");function I9(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function lre(e){const t=ew(e),n=L9(e);if(t&&n)return{start:t,end:n}}function Hd(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?z4(e.position):"start"in e||"end"in e?z4(e):"line"in e||"column"in e?jx(e):""}function jx(e){return F4(e&&e.line)+":"+F4(e&&e.column)}function z4(e){return jx(e&&e.start)+"-"+jx(e&&e.end)}function F4(e){return e&&typeof e=="number"?e:1}class Dr extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",s={},a=!1;if(n&&("line"in n&&"column"in n?s={place:n}:"start"in n&&"end"in n?s={place:n}:"type"in n?s={ancestors:[n],place:n.position}:s={...n}),typeof t=="string"?i=t:!s.cause&&t&&(a=!0,i=t.message,s.cause=t),!s.ruleId&&!s.source&&typeof r=="string"){const u=r.indexOf(":");u===-1?s.ruleId=r:(s.source=r.slice(0,u),s.ruleId=r.slice(u+1))}if(!s.place&&s.ancestors&&s.ancestors){const u=s.ancestors[s.ancestors.length-1];u&&(s.place=u.position)}const c=s.place&&"start"in s.place?s.place.start:s.place;this.ancestors=s.ancestors||void 0,this.cause=s.cause||void 0,this.column=c?c.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=c?c.line:void 0,this.name=Hd(s.place)||"1:1",this.place=s.place||void 0,this.reason=this.message,this.ruleId=s.ruleId||void 0,this.source=s.source||void 0,this.stack=a&&s.cause&&typeof s.cause.stack=="string"?s.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Dr.prototype.file="";Dr.prototype.name="";Dr.prototype.reason="";Dr.prototype.message="";Dr.prototype.stack="";Dr.prototype.column=void 0;Dr.prototype.line=void 0;Dr.prototype.ancestors=void 0;Dr.prototype.cause=void 0;Dr.prototype.fatal=void 0;Dr.prototype.place=void 0;Dr.prototype.ruleId=void 0;Dr.prototype.source=void 0;const tw={}.hasOwnProperty,cre=new Map,ure=/[A-Z]/g,dre=new Set(["table","tbody","thead","tfoot","tr"]),fre=new Set(["td","th"]),P9="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function hre(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=wre(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=vre(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?F0:_9,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},s=z9(i,e,void 0);return s&&typeof s!="string"?s:i.create(e,i.Fragment,{children:s||void 0},void 0)}function z9(e,t,n){if(t.type==="element")return pre(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return mre(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return yre(e,t,n);if(t.type==="mdxjsEsm")return gre(e,t);if(t.type==="root")return xre(e,t,n);if(t.type==="text")return bre(e,t)}function pre(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=F0,e.schema=i),e.ancestors.push(t);const s=B9(e,t.tagName,!1),a=Sre(e,t);let c=rw(e,t);return dre.has(t.tagName)&&(c=c.filter(function(u){return typeof u=="string"?!Yne(u):!0})),F9(e,a,s,t),nw(a,c),e.ancestors.pop(),e.schema=r,e.create(t,s,a,n)}function mre(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}hf(e,t.position)}function gre(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);hf(e,t.position)}function yre(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=F0,e.schema=i),e.ancestors.push(t);const s=t.name===null?e.Fragment:B9(e,t.name,!0),a=Cre(e,t),c=rw(e,t);return F9(e,a,s,t),nw(a,c),e.ancestors.pop(),e.schema=r,e.create(t,s,a,n)}function xre(e,t,n){const r={};return nw(r,rw(e,t)),e.create(t,e.Fragment,r,n)}function bre(e,t){return t.value}function F9(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function nw(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function vre(e,t,n){return r;function r(i,s,a,c){const f=Array.isArray(a.children)?n:t;return c?f(s,a,c):f(s,a)}}function wre(e,t){return n;function n(r,i,s,a){const c=Array.isArray(s.children),u=ew(r);return t(i,s,a,c,{columnNumber:u?u.column-1:void 0,fileName:e,lineNumber:u?u.line:void 0},void 0)}}function Sre(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&tw.call(t.properties,i)){const s=kre(e,i,t.properties[i]);if(s){const[a,c]=s;e.tableCellAlignToStyle&&a==="align"&&typeof c=="string"&&fre.has(t.tagName)?r=c:n[a]=c}}if(r){const s=n.style||(n.style={});s[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function Cre(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const s=r.data.estree.body[0];s.type;const a=s.expression;a.type;const c=a.properties[0];c.type,Object.assign(n,e.evaluater.evaluateExpression(c.argument))}else hf(e,t.position);else{const i=r.name;let s;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const c=r.value.data.estree.body[0];c.type,s=e.evaluater.evaluateExpression(c.expression)}else hf(e,t.position);else s=r.value===null?!0:r.value;n[i]=s}return n}function rw(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:cre;for(;++r<t.children.length;){const s=t.children[r];let a;if(e.passKeys){const u=s.type==="element"?s.tagName:s.type==="mdxJsxFlowElement"||s.type==="mdxJsxTextElement"?s.name:void 0;if(u){const f=i.get(u)||0;a=u+"-"+f,i.set(u,f+1)}}const c=z9(e,s,a);c!==void 0&&n.push(c)}return n}function kre(e,t,n){const r=D9(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?Hne(n):tre(n)),r.property==="style"){let i=typeof n=="object"?n:Ere(e,String(n));return e.stylePropertyNameCase==="css"&&(i=Tre(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?Qne[r.property]||r.property:r.attribute,n]}}function Ere(e,t){try{return are(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new Dr("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=P9+"#cannot-parse-style-attribute",i}}function B9(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let s=-1,a;for(;++s<i.length;){const c=A4(i[s])?{type:"Identifier",name:i[s]}:{type:"Literal",value:i[s]};a=a?{type:"MemberExpression",object:a,property:c,computed:!!(s&&c.type==="Literal"),optional:!1}:c}r=a}else r=A4(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return tw.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);hf(e)}function hf(e,t){const n=new Dr("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=P9+"#cannot-handle-mdx-estrees-without-createevaluater",n}function Tre(e){const t={};let n;for(n in e)tw.call(e,n)&&(t[Nre(n)]=e[n]);return t}function Nre(e){let t=e.replace(ure,Rre);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function Rre(e){return"-"+e.toLowerCase()}const ty={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},Are={};function iw(e,t){const n=Are,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return H9(e,r,i)}function H9(e,t,n){if(Ore(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return B4(e.children,t,n)}return Array.isArray(e)?B4(e,t,n):""}function B4(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=H9(e[i],t,n);return r.join("")}function Ore(e){return!!(e&&typeof e=="object")}const H4=document.createElement("i");function pf(e){const t="&"+e+";";H4.innerHTML=t;const n=H4.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function bi(e,t,n,r){const i=e.length;let s=0,a;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)a=Array.from(r),a.unshift(t,n),e.splice(...a);else for(n&&e.splice(t,n);s<r.length;)a=r.slice(s,s+1e4),a.unshift(t,0),e.splice(...a),s+=1e4,t+=1e4}function Vi(e,t){return e.length>0?(bi(e,e.length,0,t),e):t}const U4={}.hasOwnProperty;function U9(e){const t={};let n=-1;for(;++n<e.length;)jre(t,e[n]);return t}function jre(e,t){let n;for(n in t){const i=(U4.call(e,n)?e[n]:void 0)||(e[n]={}),s=t[n];let a;if(s)for(a in s){U4.call(i,a)||(i[a]=[]);const c=s[a];Mre(i[a],Array.isArray(c)?c:c?[c]:[])}}}function Mre(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);bi(e,0,0,r)}function V9(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function ao(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Hr=ja(/[A-Za-z]/),Or=ja(/[\dA-Za-z]/),Dre=ja(/[#-'*+\--9=?A-Z^-~]/);function Gm(e){return e!==null&&(e<32||e===127)}const Mx=ja(/\d/),_re=ja(/[\dA-Fa-f]/),Lre=ja(/[!-/:-@[-`{-~]/);function mt(e){return e!==null&&e<-2}function Sn(e){return e!==null&&(e<0||e===32)}function _t(e){return e===-2||e===-1||e===32}const B0=ja(new RegExp("\\p{P}|\\p{S}","u")),xl=ja(/\s/);function ja(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function hu(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const s=e.charCodeAt(n);let a="";if(s===37&&Or(e.charCodeAt(n+1))&&Or(e.charCodeAt(n+2)))i=2;else if(s<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(s))||(a=String.fromCharCode(s));else if(s>55295&&s<57344){const c=e.charCodeAt(n+1);s<56320&&c>56319&&c<57344?(a=String.fromCharCode(s,c),i=1):a="�"}else a=String.fromCharCode(s);a&&(t.push(e.slice(r,n),encodeURIComponent(a)),r=n+i+1,a=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function Jt(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let s=0;return a;function a(u){return _t(u)?(e.enter(n),c(u)):t(u)}function c(u){return _t(u)&&s++<i?(e.consume(u),c):(e.exit(n),t(u))}}const Ire={tokenize:Pre};function Pre(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(c){if(c===null){e.consume(c);return}return e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),Jt(e,t,"linePrefix")}function i(c){return e.enter("paragraph"),s(c)}function s(c){const u=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=u),n=u,a(c)}function a(c){if(c===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(c);return}return mt(c)?(e.consume(c),e.exit("chunkText"),s):(e.consume(c),a)}}const zre={tokenize:Fre},V4={tokenize:Bre};function Fre(e){const t=this,n=[];let r=0,i,s,a;return c;function c(N){if(r<n.length){const j=n[r];return t.containerState=j[1],e.attempt(j[0].continuation,u,f)(N)}return f(N)}function u(N){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&T();const j=t.events.length;let O=j,A;for(;O--;)if(t.events[O][0]==="exit"&&t.events[O][1].type==="chunkFlow"){A=t.events[O][1].end;break}E(r);let R=j;for(;R<t.events.length;)t.events[R][1].end={...A},R++;return bi(t.events,O+1,0,t.events.slice(j)),t.events.length=R,f(N)}return c(N)}function f(N){if(r===n.length){if(!i)return y(N);if(i.currentConstruct&&i.currentConstruct.concrete)return b(N);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(V4,m,p)(N)}function m(N){return i&&T(),E(r),y(N)}function p(N){return t.parser.lazy[t.now().line]=r!==n.length,a=t.now().offset,b(N)}function y(N){return t.containerState={},e.attempt(V4,x,b)(N)}function x(N){return r++,n.push([t.currentConstruct,t.containerState]),y(N)}function b(N){if(N===null){i&&T(),E(0),e.consume(N);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:s}),S(N)}function S(N){if(N===null){k(e.exit("chunkFlow"),!0),E(0),e.consume(N);return}return mt(N)?(e.consume(N),k(e.exit("chunkFlow")),r=0,t.interrupt=void 0,c):(e.consume(N),S)}function k(N,j){const O=t.sliceStream(N);if(j&&O.push(null),N.previous=s,s&&(s.next=N),s=N,i.defineSkip(N.start),i.write(O),t.parser.lazy[N.start.line]){let A=i.events.length;for(;A--;)if(i.events[A][1].start.offset<a&&(!i.events[A][1].end||i.events[A][1].end.offset>a))return;const R=t.events.length;let L=R,B,I;for(;L--;)if(t.events[L][0]==="exit"&&t.events[L][1].type==="chunkFlow"){if(B){I=t.events[L][1].end;break}B=!0}for(E(r),A=R;A<t.events.length;)t.events[A][1].end={...I},A++;bi(t.events,L+1,0,t.events.slice(R)),t.events.length=A}}function E(N){let j=n.length;for(;j-- >N;){const O=n[j];t.containerState=O[1],O[0].exit.call(t,e)}n.length=N}function T(){i.write([null]),s=void 0,i=void 0,t.containerState._closeFlow=void 0}}function Bre(e,t,n){return Jt(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Qc(e){if(e===null||Sn(e)||xl(e))return 1;if(B0(e))return 2}function H0(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const s=e[i].resolveAll;s&&!r.includes(s)&&(t=s(t,n),r.push(s))}return t}const Dx={name:"attention",resolveAll:Hre,tokenize:Ure};function Hre(e,t){let n=-1,r,i,s,a,c,u,f,m;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;u=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const p={...e[r][1].end},y={...e[n][1].start};q4(p,-u),q4(y,u),a={type:u>1?"strongSequence":"emphasisSequence",start:p,end:{...e[r][1].end}},c={type:u>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:y},s={type:u>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:u>1?"strong":"emphasis",start:{...a.start},end:{...c.end}},e[r][1].end={...a.start},e[n][1].start={...c.end},f=[],e[r][1].end.offset-e[r][1].start.offset&&(f=Vi(f,[["enter",e[r][1],t],["exit",e[r][1],t]])),f=Vi(f,[["enter",i,t],["enter",a,t],["exit",a,t],["enter",s,t]]),f=Vi(f,H0(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),f=Vi(f,[["exit",s,t],["enter",c,t],["exit",c,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(m=2,f=Vi(f,[["enter",e[n][1],t],["exit",e[n][1],t]])):m=0,bi(e,r-1,n-r+3,f),n=r+f.length-m-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function Ure(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Qc(r);let s;return a;function a(u){return s=u,e.enter("attentionSequence"),c(u)}function c(u){if(u===s)return e.consume(u),c;const f=e.exit("attentionSequence"),m=Qc(u),p=!m||m===2&&i||n.includes(u),y=!i||i===2&&m||n.includes(r);return f._open=!!(s===42?p:p&&(i||!y)),f._close=!!(s===42?y:y&&(m||!p)),t(u)}}function q4(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const Vre={name:"autolink",tokenize:qre};function qre(e,t,n){let r=0;return i;function i(x){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(x),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),s}function s(x){return Hr(x)?(e.consume(x),a):x===64?n(x):f(x)}function a(x){return x===43||x===45||x===46||Or(x)?(r=1,c(x)):f(x)}function c(x){return x===58?(e.consume(x),r=0,u):(x===43||x===45||x===46||Or(x))&&r++<32?(e.consume(x),c):(r=0,f(x))}function u(x){return x===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(x),e.exit("autolinkMarker"),e.exit("autolink"),t):x===null||x===32||x===60||Gm(x)?n(x):(e.consume(x),u)}function f(x){return x===64?(e.consume(x),m):Dre(x)?(e.consume(x),f):n(x)}function m(x){return Or(x)?p(x):n(x)}function p(x){return x===46?(e.consume(x),r=0,m):x===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(x),e.exit("autolinkMarker"),e.exit("autolink"),t):y(x)}function y(x){if((x===45||Or(x))&&r++<63){const b=x===45?y:p;return e.consume(x),b}return n(x)}}const Wf={partial:!0,tokenize:$re};function $re(e,t,n){return r;function r(s){return _t(s)?Jt(e,i,"linePrefix")(s):i(s)}function i(s){return s===null||mt(s)?t(s):n(s)}}const q9={continuation:{tokenize:Wre},exit:Gre,name:"blockQuote",tokenize:Yre};function Yre(e,t,n){const r=this;return i;function i(a){if(a===62){const c=r.containerState;return c.open||(e.enter("blockQuote",{_container:!0}),c.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(a),e.exit("blockQuoteMarker"),s}return n(a)}function s(a){return _t(a)?(e.enter("blockQuotePrefixWhitespace"),e.consume(a),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(a))}}function Wre(e,t,n){const r=this;return i;function i(a){return _t(a)?Jt(e,s,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a):s(a)}function s(a){return e.attempt(q9,t,n)(a)}}function Gre(e){e.exit("blockQuote")}const $9={name:"characterEscape",tokenize:Kre};function Kre(e,t,n){return r;function r(s){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(s),e.exit("escapeMarker"),i}function i(s){return Lre(s)?(e.enter("characterEscapeValue"),e.consume(s),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(s)}}const Y9={name:"characterReference",tokenize:Qre};function Qre(e,t,n){const r=this;let i=0,s,a;return c;function c(p){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(p),e.exit("characterReferenceMarker"),u}function u(p){return p===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(p),e.exit("characterReferenceMarkerNumeric"),f):(e.enter("characterReferenceValue"),s=31,a=Or,m(p))}function f(p){return p===88||p===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(p),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),s=6,a=_re,m):(e.enter("characterReferenceValue"),s=7,a=Mx,m(p))}function m(p){if(p===59&&i){const y=e.exit("characterReferenceValue");return a===Or&&!pf(r.sliceSerialize(y))?n(p):(e.enter("characterReferenceMarker"),e.consume(p),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return a(p)&&i++<s?(e.consume(p),m):n(p)}}const $4={partial:!0,tokenize:Zre},Y4={concrete:!0,name:"codeFenced",tokenize:Xre};function Xre(e,t,n){const r=this,i={partial:!0,tokenize:O};let s=0,a=0,c;return u;function u(A){return f(A)}function f(A){const R=r.events[r.events.length-1];return s=R&&R[1].type==="linePrefix"?R[2].sliceSerialize(R[1],!0).length:0,c=A,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),m(A)}function m(A){return A===c?(a++,e.consume(A),m):a<3?n(A):(e.exit("codeFencedFenceSequence"),_t(A)?Jt(e,p,"whitespace")(A):p(A))}function p(A){return A===null||mt(A)?(e.exit("codeFencedFence"),r.interrupt?t(A):e.check($4,S,j)(A)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),y(A))}function y(A){return A===null||mt(A)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),p(A)):_t(A)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Jt(e,x,"whitespace")(A)):A===96&&A===c?n(A):(e.consume(A),y)}function x(A){return A===null||mt(A)?p(A):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),b(A))}function b(A){return A===null||mt(A)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),p(A)):A===96&&A===c?n(A):(e.consume(A),b)}function S(A){return e.attempt(i,j,k)(A)}function k(A){return e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),E}function E(A){return s>0&&_t(A)?Jt(e,T,"linePrefix",s+1)(A):T(A)}function T(A){return A===null||mt(A)?e.check($4,S,j)(A):(e.enter("codeFlowValue"),N(A))}function N(A){return A===null||mt(A)?(e.exit("codeFlowValue"),T(A)):(e.consume(A),N)}function j(A){return e.exit("codeFenced"),t(A)}function O(A,R,L){let B=0;return I;function I(H){return A.enter("lineEnding"),A.consume(H),A.exit("lineEnding"),U}function U(H){return A.enter("codeFencedFence"),_t(H)?Jt(A,Y,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(H):Y(H)}function Y(H){return H===c?(A.enter("codeFencedFenceSequence"),V(H)):L(H)}function V(H){return H===c?(B++,A.consume(H),V):B>=a?(A.exit("codeFencedFenceSequence"),_t(H)?Jt(A,q,"whitespace")(H):q(H)):L(H)}function q(H){return H===null||mt(H)?(A.exit("codeFencedFence"),R(H)):L(H)}}}function Zre(e,t,n){const r=this;return i;function i(a){return a===null?n(a):(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),s)}function s(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}const ny={name:"codeIndented",tokenize:eie},Jre={partial:!0,tokenize:tie};function eie(e,t,n){const r=this;return i;function i(f){return e.enter("codeIndented"),Jt(e,s,"linePrefix",5)(f)}function s(f){const m=r.events[r.events.length-1];return m&&m[1].type==="linePrefix"&&m[2].sliceSerialize(m[1],!0).length>=4?a(f):n(f)}function a(f){return f===null?u(f):mt(f)?e.attempt(Jre,a,u)(f):(e.enter("codeFlowValue"),c(f))}function c(f){return f===null||mt(f)?(e.exit("codeFlowValue"),a(f)):(e.consume(f),c)}function u(f){return e.exit("codeIndented"),t(f)}}function tie(e,t,n){const r=this;return i;function i(a){return r.parser.lazy[r.now().line]?n(a):mt(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),i):Jt(e,s,"linePrefix",5)(a)}function s(a){const c=r.events[r.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?t(a):mt(a)?i(a):n(a)}}const nie={name:"codeText",previous:iie,resolve:rie,tokenize:oie};function rie(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function iie(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function oie(e,t,n){let r=0,i,s;return a;function a(p){return e.enter("codeText"),e.enter("codeTextSequence"),c(p)}function c(p){return p===96?(e.consume(p),r++,c):(e.exit("codeTextSequence"),u(p))}function u(p){return p===null?n(p):p===32?(e.enter("space"),e.consume(p),e.exit("space"),u):p===96?(s=e.enter("codeTextSequence"),i=0,m(p)):mt(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),u):(e.enter("codeTextData"),f(p))}function f(p){return p===null||p===32||p===96||mt(p)?(e.exit("codeTextData"),u(p)):(e.consume(p),f)}function m(p){return p===96?(e.consume(p),i++,m):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(p)):(s.type="codeTextData",f(p))}}class sie{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const s=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&Sd(this.left,r),s.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Sd(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Sd(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);Sd(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Sd(this.left,n.reverse())}}}function Sd(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function W9(e){const t={};let n=-1,r,i,s,a,c,u,f;const m=new sie(e);for(;++n<m.length;){for(;n in t;)n=t[n];if(r=m.get(n),n&&r[1].type==="chunkFlow"&&m.get(n-1)[1].type==="listItemPrefix"&&(u=r[1]._tokenizer.events,s=0,s<u.length&&u[s][1].type==="lineEndingBlank"&&(s+=2),s<u.length&&u[s][1].type==="content"))for(;++s<u.length&&u[s][1].type!=="content";)u[s][1].type==="chunkText"&&(u[s][1]._isInFirstContentOfListItem=!0,s++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,aie(m,n)),n=t[n],f=!0);else if(r[1]._container){for(s=n,i=void 0;s--;)if(a=m.get(s),a[1].type==="lineEnding"||a[1].type==="lineEndingBlank")a[0]==="enter"&&(i&&(m.get(i)[1].type="lineEndingBlank"),a[1].type="lineEnding",i=s);else if(!(a[1].type==="linePrefix"||a[1].type==="listItemIndent"))break;i&&(r[1].end={...m.get(i)[1].start},c=m.slice(i,n),c.unshift(r),m.splice(i,n-i+1,c))}}return bi(e,0,Number.POSITIVE_INFINITY,m.slice(0)),!f}function aie(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const s=[];let a=n._tokenizer;a||(a=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(a._contentTypeTextTrailing=!0));const c=a.events,u=[],f={};let m,p,y=-1,x=n,b=0,S=0;const k=[S];for(;x;){for(;e.get(++i)[1]!==x;);s.push(i),x._tokenizer||(m=r.sliceStream(x),x.next||m.push(null),p&&a.defineSkip(x.start),x._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=!0),a.write(m),x._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=void 0)),p=x,x=x.next}for(x=n;++y<c.length;)c[y][0]==="exit"&&c[y-1][0]==="enter"&&c[y][1].type===c[y-1][1].type&&c[y][1].start.line!==c[y][1].end.line&&(S=y+1,k.push(S),x._tokenizer=void 0,x.previous=void 0,x=x.next);for(a.events=[],x?(x._tokenizer=void 0,x.previous=void 0):k.pop(),y=k.length;y--;){const E=c.slice(k[y],k[y+1]),T=s.pop();u.push([T,T+E.length-1]),e.splice(T,2,E)}for(u.reverse(),y=-1;++y<u.length;)f[b+u[y][0]]=b+u[y][1],b+=u[y][1]-u[y][0]-1;return f}const lie={resolve:uie,tokenize:die},cie={partial:!0,tokenize:fie};function uie(e){return W9(e),e}function die(e,t){let n;return r;function r(c){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(c)}function i(c){return c===null?s(c):mt(c)?e.check(cie,a,s)(c):(e.consume(c),i)}function s(c){return e.exit("chunkContent"),e.exit("content"),t(c)}function a(c){return e.consume(c),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function fie(e,t,n){const r=this;return i;function i(a){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),Jt(e,s,"linePrefix")}function s(a){if(a===null||mt(a))return n(a);const c=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?t(a):e.interrupt(r.parser.constructs.flow,n,t)(a)}}function G9(e,t,n,r,i,s,a,c,u){const f=u||Number.POSITIVE_INFINITY;let m=0;return p;function p(E){return E===60?(e.enter(r),e.enter(i),e.enter(s),e.consume(E),e.exit(s),y):E===null||E===32||E===41||Gm(E)?n(E):(e.enter(r),e.enter(a),e.enter(c),e.enter("chunkString",{contentType:"string"}),S(E))}function y(E){return E===62?(e.enter(s),e.consume(E),e.exit(s),e.exit(i),e.exit(r),t):(e.enter(c),e.enter("chunkString",{contentType:"string"}),x(E))}function x(E){return E===62?(e.exit("chunkString"),e.exit(c),y(E)):E===null||E===60||mt(E)?n(E):(e.consume(E),E===92?b:x)}function b(E){return E===60||E===62||E===92?(e.consume(E),x):x(E)}function S(E){return!m&&(E===null||E===41||Sn(E))?(e.exit("chunkString"),e.exit(c),e.exit(a),e.exit(r),t(E)):m<f&&E===40?(e.consume(E),m++,S):E===41?(e.consume(E),m--,S):E===null||E===32||E===40||Gm(E)?n(E):(e.consume(E),E===92?k:S)}function k(E){return E===40||E===41||E===92?(e.consume(E),S):S(E)}}function K9(e,t,n,r,i,s){const a=this;let c=0,u;return f;function f(x){return e.enter(r),e.enter(i),e.consume(x),e.exit(i),e.enter(s),m}function m(x){return c>999||x===null||x===91||x===93&&!u||x===94&&!c&&"_hiddenFootnoteSupport"in a.parser.constructs?n(x):x===93?(e.exit(s),e.enter(i),e.consume(x),e.exit(i),e.exit(r),t):mt(x)?(e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),m):(e.enter("chunkString",{contentType:"string"}),p(x))}function p(x){return x===null||x===91||x===93||mt(x)||c++>999?(e.exit("chunkString"),m(x)):(e.consume(x),u||(u=!_t(x)),x===92?y:p)}function y(x){return x===91||x===92||x===93?(e.consume(x),c++,p):p(x)}}function Q9(e,t,n,r,i,s){let a;return c;function c(y){return y===34||y===39||y===40?(e.enter(r),e.enter(i),e.consume(y),e.exit(i),a=y===40?41:y,u):n(y)}function u(y){return y===a?(e.enter(i),e.consume(y),e.exit(i),e.exit(r),t):(e.enter(s),f(y))}function f(y){return y===a?(e.exit(s),u(a)):y===null?n(y):mt(y)?(e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),Jt(e,f,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),m(y))}function m(y){return y===a||y===null||mt(y)?(e.exit("chunkString"),f(y)):(e.consume(y),y===92?p:m)}function p(y){return y===a||y===92?(e.consume(y),m):m(y)}}function Ud(e,t){let n;return r;function r(i){return mt(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):_t(i)?Jt(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const hie={name:"definition",tokenize:mie},pie={partial:!0,tokenize:gie};function mie(e,t,n){const r=this;let i;return s;function s(x){return e.enter("definition"),a(x)}function a(x){return K9.call(r,e,c,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(x)}function c(x){return i=ao(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),x===58?(e.enter("definitionMarker"),e.consume(x),e.exit("definitionMarker"),u):n(x)}function u(x){return Sn(x)?Ud(e,f)(x):f(x)}function f(x){return G9(e,m,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(x)}function m(x){return e.attempt(pie,p,p)(x)}function p(x){return _t(x)?Jt(e,y,"whitespace")(x):y(x)}function y(x){return x===null||mt(x)?(e.exit("definition"),r.parser.defined.push(i),t(x)):n(x)}}function gie(e,t,n){return r;function r(c){return Sn(c)?Ud(e,i)(c):n(c)}function i(c){return Q9(e,s,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(c)}function s(c){return _t(c)?Jt(e,a,"whitespace")(c):a(c)}function a(c){return c===null||mt(c)?t(c):n(c)}}const yie={name:"hardBreakEscape",tokenize:xie};function xie(e,t,n){return r;function r(s){return e.enter("hardBreakEscape"),e.consume(s),i}function i(s){return mt(s)?(e.exit("hardBreakEscape"),t(s)):n(s)}}const bie={name:"headingAtx",resolve:vie,tokenize:wie};function vie(e,t){let n=e.length-2,r=3,i,s;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},s={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},bi(e,r,n-r+1,[["enter",i,t],["enter",s,t],["exit",s,t],["exit",i,t]])),e}function wie(e,t,n){let r=0;return i;function i(m){return e.enter("atxHeading"),s(m)}function s(m){return e.enter("atxHeadingSequence"),a(m)}function a(m){return m===35&&r++<6?(e.consume(m),a):m===null||Sn(m)?(e.exit("atxHeadingSequence"),c(m)):n(m)}function c(m){return m===35?(e.enter("atxHeadingSequence"),u(m)):m===null||mt(m)?(e.exit("atxHeading"),t(m)):_t(m)?Jt(e,c,"whitespace")(m):(e.enter("atxHeadingText"),f(m))}function u(m){return m===35?(e.consume(m),u):(e.exit("atxHeadingSequence"),c(m))}function f(m){return m===null||m===35||Sn(m)?(e.exit("atxHeadingText"),c(m)):(e.consume(m),f)}}const Sie=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],W4=["pre","script","style","textarea"],Cie={concrete:!0,name:"htmlFlow",resolveTo:Tie,tokenize:Nie},kie={partial:!0,tokenize:Aie},Eie={partial:!0,tokenize:Rie};function Tie(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function Nie(e,t,n){const r=this;let i,s,a,c,u;return f;function f(D){return m(D)}function m(D){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(D),p}function p(D){return D===33?(e.consume(D),y):D===47?(e.consume(D),s=!0,S):D===63?(e.consume(D),i=3,r.interrupt?t:_):Hr(D)?(e.consume(D),a=String.fromCharCode(D),k):n(D)}function y(D){return D===45?(e.consume(D),i=2,x):D===91?(e.consume(D),i=5,c=0,b):Hr(D)?(e.consume(D),i=4,r.interrupt?t:_):n(D)}function x(D){return D===45?(e.consume(D),r.interrupt?t:_):n(D)}function b(D){const Z="CDATA[";return D===Z.charCodeAt(c++)?(e.consume(D),c===Z.length?r.interrupt?t:Y:b):n(D)}function S(D){return Hr(D)?(e.consume(D),a=String.fromCharCode(D),k):n(D)}function k(D){if(D===null||D===47||D===62||Sn(D)){const Z=D===47,ee=a.toLowerCase();return!Z&&!s&&W4.includes(ee)?(i=1,r.interrupt?t(D):Y(D)):Sie.includes(a.toLowerCase())?(i=6,Z?(e.consume(D),E):r.interrupt?t(D):Y(D)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(D):s?T(D):N(D))}return D===45||Or(D)?(e.consume(D),a+=String.fromCharCode(D),k):n(D)}function E(D){return D===62?(e.consume(D),r.interrupt?t:Y):n(D)}function T(D){return _t(D)?(e.consume(D),T):I(D)}function N(D){return D===47?(e.consume(D),I):D===58||D===95||Hr(D)?(e.consume(D),j):_t(D)?(e.consume(D),N):I(D)}function j(D){return D===45||D===46||D===58||D===95||Or(D)?(e.consume(D),j):O(D)}function O(D){return D===61?(e.consume(D),A):_t(D)?(e.consume(D),O):N(D)}function A(D){return D===null||D===60||D===61||D===62||D===96?n(D):D===34||D===39?(e.consume(D),u=D,R):_t(D)?(e.consume(D),A):L(D)}function R(D){return D===u?(e.consume(D),u=null,B):D===null||mt(D)?n(D):(e.consume(D),R)}function L(D){return D===null||D===34||D===39||D===47||D===60||D===61||D===62||D===96||Sn(D)?O(D):(e.consume(D),L)}function B(D){return D===47||D===62||_t(D)?N(D):n(D)}function I(D){return D===62?(e.consume(D),U):n(D)}function U(D){return D===null||mt(D)?Y(D):_t(D)?(e.consume(D),U):n(D)}function Y(D){return D===45&&i===2?(e.consume(D),z):D===60&&i===1?(e.consume(D),$):D===62&&i===4?(e.consume(D),P):D===63&&i===3?(e.consume(D),_):D===93&&i===5?(e.consume(D),Q):mt(D)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(kie,W,V)(D)):D===null||mt(D)?(e.exit("htmlFlowData"),V(D)):(e.consume(D),Y)}function V(D){return e.check(Eie,q,W)(D)}function q(D){return e.enter("lineEnding"),e.consume(D),e.exit("lineEnding"),H}function H(D){return D===null||mt(D)?V(D):(e.enter("htmlFlowData"),Y(D))}function z(D){return D===45?(e.consume(D),_):Y(D)}function $(D){return D===47?(e.consume(D),a="",G):Y(D)}function G(D){if(D===62){const Z=a.toLowerCase();return W4.includes(Z)?(e.consume(D),P):Y(D)}return Hr(D)&&a.length<8?(e.consume(D),a+=String.fromCharCode(D),G):Y(D)}function Q(D){return D===93?(e.consume(D),_):Y(D)}function _(D){return D===62?(e.consume(D),P):D===45&&i===2?(e.consume(D),_):Y(D)}function P(D){return D===null||mt(D)?(e.exit("htmlFlowData"),W(D)):(e.consume(D),P)}function W(D){return e.exit("htmlFlow"),t(D)}}function Rie(e,t,n){const r=this;return i;function i(a){return mt(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),s):n(a)}function s(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}function Aie(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Wf,t,n)}}const Oie={name:"htmlText",tokenize:jie};function jie(e,t,n){const r=this;let i,s,a;return c;function c(_){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(_),u}function u(_){return _===33?(e.consume(_),f):_===47?(e.consume(_),O):_===63?(e.consume(_),N):Hr(_)?(e.consume(_),L):n(_)}function f(_){return _===45?(e.consume(_),m):_===91?(e.consume(_),s=0,b):Hr(_)?(e.consume(_),T):n(_)}function m(_){return _===45?(e.consume(_),x):n(_)}function p(_){return _===null?n(_):_===45?(e.consume(_),y):mt(_)?(a=p,$(_)):(e.consume(_),p)}function y(_){return _===45?(e.consume(_),x):p(_)}function x(_){return _===62?z(_):_===45?y(_):p(_)}function b(_){const P="CDATA[";return _===P.charCodeAt(s++)?(e.consume(_),s===P.length?S:b):n(_)}function S(_){return _===null?n(_):_===93?(e.consume(_),k):mt(_)?(a=S,$(_)):(e.consume(_),S)}function k(_){return _===93?(e.consume(_),E):S(_)}function E(_){return _===62?z(_):_===93?(e.consume(_),E):S(_)}function T(_){return _===null||_===62?z(_):mt(_)?(a=T,$(_)):(e.consume(_),T)}function N(_){return _===null?n(_):_===63?(e.consume(_),j):mt(_)?(a=N,$(_)):(e.consume(_),N)}function j(_){return _===62?z(_):N(_)}function O(_){return Hr(_)?(e.consume(_),A):n(_)}function A(_){return _===45||Or(_)?(e.consume(_),A):R(_)}function R(_){return mt(_)?(a=R,$(_)):_t(_)?(e.consume(_),R):z(_)}function L(_){return _===45||Or(_)?(e.consume(_),L):_===47||_===62||Sn(_)?B(_):n(_)}function B(_){return _===47?(e.consume(_),z):_===58||_===95||Hr(_)?(e.consume(_),I):mt(_)?(a=B,$(_)):_t(_)?(e.consume(_),B):z(_)}function I(_){return _===45||_===46||_===58||_===95||Or(_)?(e.consume(_),I):U(_)}function U(_){return _===61?(e.consume(_),Y):mt(_)?(a=U,$(_)):_t(_)?(e.consume(_),U):B(_)}function Y(_){return _===null||_===60||_===61||_===62||_===96?n(_):_===34||_===39?(e.consume(_),i=_,V):mt(_)?(a=Y,$(_)):_t(_)?(e.consume(_),Y):(e.consume(_),q)}function V(_){return _===i?(e.consume(_),i=void 0,H):_===null?n(_):mt(_)?(a=V,$(_)):(e.consume(_),V)}function q(_){return _===null||_===34||_===39||_===60||_===61||_===96?n(_):_===47||_===62||Sn(_)?B(_):(e.consume(_),q)}function H(_){return _===47||_===62||Sn(_)?B(_):n(_)}function z(_){return _===62?(e.consume(_),e.exit("htmlTextData"),e.exit("htmlText"),t):n(_)}function $(_){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(_),e.exit("lineEnding"),G}function G(_){return _t(_)?Jt(e,Q,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(_):Q(_)}function Q(_){return e.enter("htmlTextData"),a(_)}}const ow={name:"labelEnd",resolveAll:Lie,resolveTo:Iie,tokenize:Pie},Mie={tokenize:zie},Die={tokenize:Fie},_ie={tokenize:Bie};function Lie(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&bi(e,0,e.length,n),e}function Iie(e,t){let n=e.length,r=0,i,s,a,c;for(;n--;)if(i=e[n][1],s){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(a){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(s=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(a=n);const u={type:e[s][1].type==="labelLink"?"link":"image",start:{...e[s][1].start},end:{...e[e.length-1][1].end}},f={type:"label",start:{...e[s][1].start},end:{...e[a][1].end}},m={type:"labelText",start:{...e[s+r+2][1].end},end:{...e[a-2][1].start}};return c=[["enter",u,t],["enter",f,t]],c=Vi(c,e.slice(s+1,s+r+3)),c=Vi(c,[["enter",m,t]]),c=Vi(c,H0(t.parser.constructs.insideSpan.null,e.slice(s+r+4,a-3),t)),c=Vi(c,[["exit",m,t],e[a-2],e[a-1],["exit",f,t]]),c=Vi(c,e.slice(a+1)),c=Vi(c,[["exit",u,t]]),bi(e,s,e.length,c),e}function Pie(e,t,n){const r=this;let i=r.events.length,s,a;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){s=r.events[i][1];break}return c;function c(y){return s?s._inactive?p(y):(a=r.parser.defined.includes(ao(r.sliceSerialize({start:s.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(y),e.exit("labelMarker"),e.exit("labelEnd"),u):n(y)}function u(y){return y===40?e.attempt(Mie,m,a?m:p)(y):y===91?e.attempt(Die,m,a?f:p)(y):a?m(y):p(y)}function f(y){return e.attempt(_ie,m,p)(y)}function m(y){return t(y)}function p(y){return s._balanced=!0,n(y)}}function zie(e,t,n){return r;function r(p){return e.enter("resource"),e.enter("resourceMarker"),e.consume(p),e.exit("resourceMarker"),i}function i(p){return Sn(p)?Ud(e,s)(p):s(p)}function s(p){return p===41?m(p):G9(e,a,c,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(p)}function a(p){return Sn(p)?Ud(e,u)(p):m(p)}function c(p){return n(p)}function u(p){return p===34||p===39||p===40?Q9(e,f,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(p):m(p)}function f(p){return Sn(p)?Ud(e,m)(p):m(p)}function m(p){return p===41?(e.enter("resourceMarker"),e.consume(p),e.exit("resourceMarker"),e.exit("resource"),t):n(p)}}function Fie(e,t,n){const r=this;return i;function i(c){return K9.call(r,e,s,a,"reference","referenceMarker","referenceString")(c)}function s(c){return r.parser.defined.includes(ao(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(c):n(c)}function a(c){return n(c)}}function Bie(e,t,n){return r;function r(s){return e.enter("reference"),e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),i}function i(s){return s===93?(e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),e.exit("reference"),t):n(s)}}const Hie={name:"labelStartImage",resolveAll:ow.resolveAll,tokenize:Uie};function Uie(e,t,n){const r=this;return i;function i(c){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(c),e.exit("labelImageMarker"),s}function s(c){return c===91?(e.enter("labelMarker"),e.consume(c),e.exit("labelMarker"),e.exit("labelImage"),a):n(c)}function a(c){return c===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(c):t(c)}}const Vie={name:"labelStartLink",resolveAll:ow.resolveAll,tokenize:qie};function qie(e,t,n){const r=this;return i;function i(a){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelLink"),s}function s(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):t(a)}}const ry={name:"lineEnding",tokenize:$ie};function $ie(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Jt(e,t,"linePrefix")}}const fm={name:"thematicBreak",tokenize:Yie};function Yie(e,t,n){let r=0,i;return s;function s(f){return e.enter("thematicBreak"),a(f)}function a(f){return i=f,c(f)}function c(f){return f===i?(e.enter("thematicBreakSequence"),u(f)):r>=3&&(f===null||mt(f))?(e.exit("thematicBreak"),t(f)):n(f)}function u(f){return f===i?(e.consume(f),r++,u):(e.exit("thematicBreakSequence"),_t(f)?Jt(e,c,"whitespace")(f):c(f))}}const Kr={continuation:{tokenize:Qie},exit:Zie,name:"list",tokenize:Kie},Wie={partial:!0,tokenize:Jie},Gie={partial:!0,tokenize:Xie};function Kie(e,t,n){const r=this,i=r.events[r.events.length-1];let s=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,a=0;return c;function c(x){const b=r.containerState.type||(x===42||x===43||x===45?"listUnordered":"listOrdered");if(b==="listUnordered"?!r.containerState.marker||x===r.containerState.marker:Mx(x)){if(r.containerState.type||(r.containerState.type=b,e.enter(b,{_container:!0})),b==="listUnordered")return e.enter("listItemPrefix"),x===42||x===45?e.check(fm,n,f)(x):f(x);if(!r.interrupt||x===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),u(x)}return n(x)}function u(x){return Mx(x)&&++a<10?(e.consume(x),u):(!r.interrupt||a<2)&&(r.containerState.marker?x===r.containerState.marker:x===41||x===46)?(e.exit("listItemValue"),f(x)):n(x)}function f(x){return e.enter("listItemMarker"),e.consume(x),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||x,e.check(Wf,r.interrupt?n:m,e.attempt(Wie,y,p))}function m(x){return r.containerState.initialBlankLine=!0,s++,y(x)}function p(x){return _t(x)?(e.enter("listItemPrefixWhitespace"),e.consume(x),e.exit("listItemPrefixWhitespace"),y):n(x)}function y(x){return r.containerState.size=s+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(x)}}function Qie(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Wf,i,s);function i(c){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Jt(e,t,"listItemIndent",r.containerState.size+1)(c)}function s(c){return r.containerState.furtherBlankLines||!_t(c)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,a(c)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(Gie,t,a)(c))}function a(c){return r.containerState._closeFlow=!0,r.interrupt=void 0,Jt(e,e.attempt(Kr,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c)}}function Xie(e,t,n){const r=this;return Jt(e,i,"listItemIndent",r.containerState.size+1);function i(s){const a=r.events[r.events.length-1];return a&&a[1].type==="listItemIndent"&&a[2].sliceSerialize(a[1],!0).length===r.containerState.size?t(s):n(s)}}function Zie(e){e.exit(this.containerState.type)}function Jie(e,t,n){const r=this;return Jt(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(s){const a=r.events[r.events.length-1];return!_t(s)&&a&&a[1].type==="listItemPrefixWhitespace"?t(s):n(s)}}const G4={name:"setextUnderline",resolveTo:eoe,tokenize:toe};function eoe(e,t){let n=e.length,r,i,s;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!s&&e[n][1].type==="definition"&&(s=n);const a={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",s?(e.splice(i,0,["enter",a,t]),e.splice(s+1,0,["exit",e[r][1],t]),e[r][1].end={...e[s][1].end}):e[r][1]=a,e.push(["exit",a,t]),e}function toe(e,t,n){const r=this;let i;return s;function s(f){let m=r.events.length,p;for(;m--;)if(r.events[m][1].type!=="lineEnding"&&r.events[m][1].type!=="linePrefix"&&r.events[m][1].type!=="content"){p=r.events[m][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||p)?(e.enter("setextHeadingLine"),i=f,a(f)):n(f)}function a(f){return e.enter("setextHeadingLineSequence"),c(f)}function c(f){return f===i?(e.consume(f),c):(e.exit("setextHeadingLineSequence"),_t(f)?Jt(e,u,"lineSuffix")(f):u(f))}function u(f){return f===null||mt(f)?(e.exit("setextHeadingLine"),t(f)):n(f)}}const noe={tokenize:roe};function roe(e){const t=this,n=e.attempt(Wf,r,e.attempt(this.parser.constructs.flowInitial,i,Jt(e,e.attempt(this.parser.constructs.flow,i,e.attempt(lie,i)),"linePrefix")));return n;function r(s){if(s===null){e.consume(s);return}return e.enter("lineEndingBlank"),e.consume(s),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const ioe={resolveAll:Z9()},ooe=X9("string"),soe=X9("text");function X9(e){return{resolveAll:Z9(e==="text"?aoe:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],s=n.attempt(i,a,c);return a;function a(m){return f(m)?s(m):c(m)}function c(m){if(m===null){n.consume(m);return}return n.enter("data"),n.consume(m),u}function u(m){return f(m)?(n.exit("data"),s(m)):(n.consume(m),u)}function f(m){if(m===null)return!0;const p=i[m];let y=-1;if(p)for(;++y<p.length;){const x=p[y];if(!x.previous||x.previous.call(r,r.previous))return!0}return!1}}}function Z9(e){return t;function t(n,r){let i=-1,s;for(;++i<=n.length;)s===void 0?n[i]&&n[i][1].type==="data"&&(s=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==s+2&&(n[s][1].end=n[i-1][1].end,n.splice(s+2,i-s-2),i=s+2),s=void 0);return e?e(n,r):n}}function aoe(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],i=t.sliceStream(r);let s=i.length,a=-1,c=0,u;for(;s--;){const f=i[s];if(typeof f=="string"){for(a=f.length;f.charCodeAt(a-1)===32;)c++,a--;if(a)break;a=-1}else if(f===-2)u=!0,c++;else if(f!==-1){s++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(c=0),c){const f={type:n===e.length||u||c<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:s?a:r.start._bufferIndex+a,_index:r.start._index+s,line:r.end.line,column:r.end.column-c,offset:r.end.offset-c},end:{...r.end}};r.end={...f.start},r.start.offset===r.end.offset?Object.assign(r,f):(e.splice(n,0,["enter",f,t],["exit",f,t]),n+=2)}n++}return e}const loe={42:Kr,43:Kr,45:Kr,48:Kr,49:Kr,50:Kr,51:Kr,52:Kr,53:Kr,54:Kr,55:Kr,56:Kr,57:Kr,62:q9},coe={91:hie},uoe={[-2]:ny,[-1]:ny,32:ny},doe={35:bie,42:fm,45:[G4,fm],60:Cie,61:G4,95:fm,96:Y4,126:Y4},foe={38:Y9,92:$9},hoe={[-5]:ry,[-4]:ry,[-3]:ry,33:Hie,38:Y9,42:Dx,60:[Vre,Oie],91:Vie,92:[yie,$9],93:ow,95:Dx,96:nie},poe={null:[Dx,ioe]},moe={null:[42,95]},goe={null:[]},yoe=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:moe,contentInitial:coe,disable:goe,document:loe,flow:doe,flowInitial:uoe,insideSpan:poe,string:foe,text:hoe},Symbol.toStringTag,{value:"Module"}));function xoe(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},s=[];let a=[],c=[];const u={attempt:R(O),check:R(A),consume:T,enter:N,exit:j,interrupt:R(A,{interrupt:!0})},f={code:null,containerState:{},defineSkip:S,events:[],now:b,parser:e,previous:null,sliceSerialize:y,sliceStream:x,write:p};let m=t.tokenize.call(f,u);return t.resolveAll&&s.push(t),f;function p(U){return a=Vi(a,U),k(),a[a.length-1]!==null?[]:(L(t,0),f.events=H0(s,f.events,f),f.events)}function y(U,Y){return voe(x(U),Y)}function x(U){return boe(a,U)}function b(){const{_bufferIndex:U,_index:Y,line:V,column:q,offset:H}=r;return{_bufferIndex:U,_index:Y,line:V,column:q,offset:H}}function S(U){i[U.line]=U.column,I()}function k(){let U;for(;r._index<a.length;){const Y=a[r._index];if(typeof Y=="string")for(U=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===U&&r._bufferIndex<Y.length;)E(Y.charCodeAt(r._bufferIndex));else E(Y)}}function E(U){m=m(U)}function T(U){mt(U)?(r.line++,r.column=1,r.offset+=U===-3?2:1,I()):U!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===a[r._index].length&&(r._bufferIndex=-1,r._index++)),f.previous=U}function N(U,Y){const V=Y||{};return V.type=U,V.start=b(),f.events.push(["enter",V,f]),c.push(V),V}function j(U){const Y=c.pop();return Y.end=b(),f.events.push(["exit",Y,f]),Y}function O(U,Y){L(U,Y.from)}function A(U,Y){Y.restore()}function R(U,Y){return V;function V(q,H,z){let $,G,Q,_;return Array.isArray(q)?W(q):"tokenize"in q?W([q]):P(q);function P(J){return he;function he(fe){const Se=fe!==null&&J[fe],Ae=fe!==null&&J.null,Oe=[...Array.isArray(Se)?Se:Se?[Se]:[],...Array.isArray(Ae)?Ae:Ae?[Ae]:[]];return W(Oe)(fe)}}function W(J){return $=J,G=0,J.length===0?z:D(J[G])}function D(J){return he;function he(fe){return _=B(),Q=J,J.partial||(f.currentConstruct=J),J.name&&f.parser.constructs.disable.null.includes(J.name)?ee():J.tokenize.call(Y?Object.assign(Object.create(f),Y):f,u,Z,ee)(fe)}}function Z(J){return U(Q,_),H}function ee(J){return _.restore(),++G<$.length?D($[G]):z}}}function L(U,Y){U.resolveAll&&!s.includes(U)&&s.push(U),U.resolve&&bi(f.events,Y,f.events.length-Y,U.resolve(f.events.slice(Y),f)),U.resolveTo&&(f.events=U.resolveTo(f.events,f))}function B(){const U=b(),Y=f.previous,V=f.currentConstruct,q=f.events.length,H=Array.from(c);return{from:q,restore:z};function z(){r=U,f.previous=Y,f.currentConstruct=V,f.events.length=q,c=H,I()}}function I(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function boe(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,s=t.end._bufferIndex;let a;if(n===i)a=[e[n].slice(r,s)];else{if(a=e.slice(n,i),r>-1){const c=a[0];typeof c=="string"?a[0]=c.slice(r):a.shift()}s>0&&a.push(e[i].slice(0,s))}return a}function voe(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const s=e[n];let a;if(typeof s=="string")a=s;else switch(s){case-5:{a="\r";break}case-4:{a=`
89
+ `;break}case-3:{a=`\r
90
+ `;break}case-2:{a=t?" ":" ";break}case-1:{if(!t&&i)continue;a=" ";break}default:a=String.fromCharCode(s)}i=s===-2,r.push(a)}return r.join("")}function woe(e){const r={constructs:U9([yoe,...(e||{}).extensions||[]]),content:i(Ire),defined:[],document:i(zre),flow:i(noe),lazy:{},string:i(ooe),text:i(soe)};return r;function i(s){return a;function a(c){return xoe(r,s,c)}}}function Soe(e){for(;!W9(e););return e}const K4=/[\0\t\n\r]/g;function Coe(){let e=1,t="",n=!0,r;return i;function i(s,a,c){const u=[];let f,m,p,y,x;for(s=t+(typeof s=="string"?s.toString():new TextDecoder(a||void 0).decode(s)),p=0,t="",n&&(s.charCodeAt(0)===65279&&p++,n=void 0);p<s.length;){if(K4.lastIndex=p,f=K4.exec(s),y=f&&f.index!==void 0?f.index:s.length,x=s.charCodeAt(y),!f){t=s.slice(p);break}if(x===10&&p===y&&r)u.push(-3),r=void 0;else switch(r&&(u.push(-5),r=void 0),p<y&&(u.push(s.slice(p,y)),e+=y-p),x){case 0:{u.push(65533),e++;break}case 9:{for(m=Math.ceil(e/4)*4,u.push(-2);e++<m;)u.push(-1);break}case 10:{u.push(-4),e=1;break}default:r=!0,e=1}p=y+1}return c&&(r&&u.push(-5),t&&u.push(t),u.push(null)),u}}const koe=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Eoe(e){return e.replace(koe,Toe)}function Toe(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),s=i===120||i===88;return V9(n.slice(s?2:1),s?16:10)}return pf(n)||e}const J9={}.hasOwnProperty;function Noe(e,t,n){return typeof t!="string"&&(n=t,t=void 0),Roe(n)(Soe(woe(n).document().write(Coe()(e,t,!0))))}function Roe(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(pe),autolinkProtocol:B,autolinkEmail:B,atxHeading:s(xe),blockQuote:s(Ae),characterEscape:B,characterReference:B,codeFenced:s(Oe),codeFencedFenceInfo:a,codeFencedFenceMeta:a,codeIndented:s(Oe,a),codeText:s(Pe,a),codeTextData:B,data:B,codeFlowValue:B,definition:s(_e),definitionDestinationString:a,definitionLabelString:a,definitionTitleString:a,emphasis:s(De),hardBreakEscape:s(Ge),hardBreakTrailing:s(Ge),htmlFlow:s(we,a),htmlFlowData:B,htmlText:s(we,a),htmlTextData:B,image:s(Re),label:a,link:s(pe),listItem:s(ne),listItemValue:y,listOrdered:s(be,p),listUnordered:s(be),paragraph:s(ye),reference:D,referenceString:a,resourceDestinationString:a,resourceTitleString:a,setextHeading:s(xe),strong:s(Ce),thematicBreak:s(lt)},exit:{atxHeading:u(),atxHeadingSequence:O,autolink:u(),autolinkEmail:Se,autolinkProtocol:fe,blockQuote:u(),characterEscapeValue:I,characterReferenceMarkerHexadecimal:ee,characterReferenceMarkerNumeric:ee,characterReferenceValue:J,characterReference:he,codeFenced:u(k),codeFencedFence:S,codeFencedFenceInfo:x,codeFencedFenceMeta:b,codeFlowValue:I,codeIndented:u(E),codeText:u(H),codeTextData:I,data:I,definition:u(),definitionDestinationString:j,definitionLabelString:T,definitionTitleString:N,emphasis:u(),hardBreakEscape:u(Y),hardBreakTrailing:u(Y),htmlFlow:u(V),htmlFlowData:I,htmlText:u(q),htmlTextData:I,image:u($),label:Q,labelText:G,lineEnding:U,link:u(z),listItem:u(),listOrdered:u(),listUnordered:u(),paragraph:u(),referenceString:Z,resourceDestinationString:_,resourceTitleString:P,resource:W,setextHeading:u(L),setextHeadingLineSequence:R,setextHeadingText:A,strong:u(),thematicBreak:u()}};e7(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(oe){let ke={type:"root",children:[]};const Le={stack:[ke],tokenStack:[],config:t,enter:c,exit:f,buffer:a,resume:m,data:n},Me=[];let He=-1;for(;++He<oe.length;)if(oe[He][1].type==="listOrdered"||oe[He][1].type==="listUnordered")if(oe[He][0]==="enter")Me.push(He);else{const ut=Me.pop();He=i(oe,ut,He)}for(He=-1;++He<oe.length;){const ut=t[oe[He][0]];J9.call(ut,oe[He][1].type)&&ut[oe[He][1].type].call(Object.assign({sliceSerialize:oe[He][2].sliceSerialize},Le),oe[He][1])}if(Le.tokenStack.length>0){const ut=Le.tokenStack[Le.tokenStack.length-1];(ut[1]||Q4).call(Le,void 0,ut[0])}for(ke.position={start:Js(oe.length>0?oe[0][1].start:{line:1,column:1,offset:0}),end:Js(oe.length>0?oe[oe.length-2][1].end:{line:1,column:1,offset:0})},He=-1;++He<t.transforms.length;)ke=t.transforms[He](ke)||ke;return ke}function i(oe,ke,Le){let Me=ke-1,He=-1,ut=!1,xt,Je,Ke,bt;for(;++Me<=Le;){const nt=oe[Me];switch(nt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{nt[0]==="enter"?He++:He--,bt=void 0;break}case"lineEndingBlank":{nt[0]==="enter"&&(xt&&!bt&&!He&&!Ke&&(Ke=Me),bt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:bt=void 0}if(!He&&nt[0]==="enter"&&nt[1].type==="listItemPrefix"||He===-1&&nt[0]==="exit"&&(nt[1].type==="listUnordered"||nt[1].type==="listOrdered")){if(xt){let Qe=Me;for(Je=void 0;Qe--;){const Ct=oe[Qe];if(Ct[1].type==="lineEnding"||Ct[1].type==="lineEndingBlank"){if(Ct[0]==="exit")continue;Je&&(oe[Je][1].type="lineEndingBlank",ut=!0),Ct[1].type="lineEnding",Je=Qe}else if(!(Ct[1].type==="linePrefix"||Ct[1].type==="blockQuotePrefix"||Ct[1].type==="blockQuotePrefixWhitespace"||Ct[1].type==="blockQuoteMarker"||Ct[1].type==="listItemIndent"))break}Ke&&(!Je||Ke<Je)&&(xt._spread=!0),xt.end=Object.assign({},Je?oe[Je][1].start:nt[1].end),oe.splice(Je||Me,0,["exit",xt,nt[2]]),Me++,Le++}if(nt[1].type==="listItemPrefix"){const Qe={type:"listItem",_spread:!1,start:Object.assign({},nt[1].start),end:void 0};xt=Qe,oe.splice(Me,0,["enter",Qe,nt[2]]),Me++,Le++,Ke=void 0,bt=!0}}}return oe[ke][1]._spread=ut,Le}function s(oe,ke){return Le;function Le(Me){c.call(this,oe(Me),Me),ke&&ke.call(this,Me)}}function a(){this.stack.push({type:"fragment",children:[]})}function c(oe,ke,Le){this.stack[this.stack.length-1].children.push(oe),this.stack.push(oe),this.tokenStack.push([ke,Le||void 0]),oe.position={start:Js(ke.start),end:void 0}}function u(oe){return ke;function ke(Le){oe&&oe.call(this,Le),f.call(this,Le)}}function f(oe,ke){const Le=this.stack.pop(),Me=this.tokenStack.pop();if(Me)Me[0].type!==oe.type&&(ke?ke.call(this,oe,Me[0]):(Me[1]||Q4).call(this,oe,Me[0]));else throw new Error("Cannot close `"+oe.type+"` ("+Hd({start:oe.start,end:oe.end})+"): it’s not open");Le.position.end=Js(oe.end)}function m(){return iw(this.stack.pop())}function p(){this.data.expectingFirstListItemValue=!0}function y(oe){if(this.data.expectingFirstListItemValue){const ke=this.stack[this.stack.length-2];ke.start=Number.parseInt(this.sliceSerialize(oe),10),this.data.expectingFirstListItemValue=void 0}}function x(){const oe=this.resume(),ke=this.stack[this.stack.length-1];ke.lang=oe}function b(){const oe=this.resume(),ke=this.stack[this.stack.length-1];ke.meta=oe}function S(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function k(){const oe=this.resume(),ke=this.stack[this.stack.length-1];ke.value=oe.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function E(){const oe=this.resume(),ke=this.stack[this.stack.length-1];ke.value=oe.replace(/(\r?\n|\r)$/g,"")}function T(oe){const ke=this.resume(),Le=this.stack[this.stack.length-1];Le.label=ke,Le.identifier=ao(this.sliceSerialize(oe)).toLowerCase()}function N(){const oe=this.resume(),ke=this.stack[this.stack.length-1];ke.title=oe}function j(){const oe=this.resume(),ke=this.stack[this.stack.length-1];ke.url=oe}function O(oe){const ke=this.stack[this.stack.length-1];if(!ke.depth){const Le=this.sliceSerialize(oe).length;ke.depth=Le}}function A(){this.data.setextHeadingSlurpLineEnding=!0}function R(oe){const ke=this.stack[this.stack.length-1];ke.depth=this.sliceSerialize(oe).codePointAt(0)===61?1:2}function L(){this.data.setextHeadingSlurpLineEnding=void 0}function B(oe){const Le=this.stack[this.stack.length-1].children;let Me=Le[Le.length-1];(!Me||Me.type!=="text")&&(Me=Ve(),Me.position={start:Js(oe.start),end:void 0},Le.push(Me)),this.stack.push(Me)}function I(oe){const ke=this.stack.pop();ke.value+=this.sliceSerialize(oe),ke.position.end=Js(oe.end)}function U(oe){const ke=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Le=ke.children[ke.children.length-1];Le.position.end=Js(oe.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(ke.type)&&(B.call(this,oe),I.call(this,oe))}function Y(){this.data.atHardBreak=!0}function V(){const oe=this.resume(),ke=this.stack[this.stack.length-1];ke.value=oe}function q(){const oe=this.resume(),ke=this.stack[this.stack.length-1];ke.value=oe}function H(){const oe=this.resume(),ke=this.stack[this.stack.length-1];ke.value=oe}function z(){const oe=this.stack[this.stack.length-1];if(this.data.inReference){const ke=this.data.referenceType||"shortcut";oe.type+="Reference",oe.referenceType=ke,delete oe.url,delete oe.title}else delete oe.identifier,delete oe.label;this.data.referenceType=void 0}function $(){const oe=this.stack[this.stack.length-1];if(this.data.inReference){const ke=this.data.referenceType||"shortcut";oe.type+="Reference",oe.referenceType=ke,delete oe.url,delete oe.title}else delete oe.identifier,delete oe.label;this.data.referenceType=void 0}function G(oe){const ke=this.sliceSerialize(oe),Le=this.stack[this.stack.length-2];Le.label=Eoe(ke),Le.identifier=ao(ke).toLowerCase()}function Q(){const oe=this.stack[this.stack.length-1],ke=this.resume(),Le=this.stack[this.stack.length-1];if(this.data.inReference=!0,Le.type==="link"){const Me=oe.children;Le.children=Me}else Le.alt=ke}function _(){const oe=this.resume(),ke=this.stack[this.stack.length-1];ke.url=oe}function P(){const oe=this.resume(),ke=this.stack[this.stack.length-1];ke.title=oe}function W(){this.data.inReference=void 0}function D(){this.data.referenceType="collapsed"}function Z(oe){const ke=this.resume(),Le=this.stack[this.stack.length-1];Le.label=ke,Le.identifier=ao(this.sliceSerialize(oe)).toLowerCase(),this.data.referenceType="full"}function ee(oe){this.data.characterReferenceType=oe.type}function J(oe){const ke=this.sliceSerialize(oe),Le=this.data.characterReferenceType;let Me;Le?(Me=V9(ke,Le==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Me=pf(ke);const He=this.stack[this.stack.length-1];He.value+=Me}function he(oe){const ke=this.stack.pop();ke.position.end=Js(oe.end)}function fe(oe){I.call(this,oe);const ke=this.stack[this.stack.length-1];ke.url=this.sliceSerialize(oe)}function Se(oe){I.call(this,oe);const ke=this.stack[this.stack.length-1];ke.url="mailto:"+this.sliceSerialize(oe)}function Ae(){return{type:"blockquote",children:[]}}function Oe(){return{type:"code",lang:null,meta:null,value:""}}function Pe(){return{type:"inlineCode",value:""}}function _e(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function De(){return{type:"emphasis",children:[]}}function xe(){return{type:"heading",depth:0,children:[]}}function Ge(){return{type:"break"}}function we(){return{type:"html",value:""}}function Re(){return{type:"image",title:null,url:"",alt:null}}function pe(){return{type:"link",title:null,url:"",children:[]}}function be(oe){return{type:"list",ordered:oe.type==="listOrdered",start:null,spread:oe._spread,children:[]}}function ne(oe){return{type:"listItem",spread:oe._spread,checked:null,children:[]}}function ye(){return{type:"paragraph",children:[]}}function Ce(){return{type:"strong",children:[]}}function Ve(){return{type:"text",value:""}}function lt(){return{type:"thematicBreak"}}}function Js(e){return{line:e.line,column:e.column,offset:e.offset}}function e7(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?e7(e,r):Aoe(e,r)}}function Aoe(e,t){let n;for(n in t)if(J9.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function Q4(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Hd({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Hd({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Hd({start:t.start,end:t.end})+") is still open")}function Ooe(e){const t=this;t.parser=n;function n(r){return Noe(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function joe(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function Moe(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
91
+ `}]}function Doe(e,t){const n=t.value?t.value+`
92
+ `:"",r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let s={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(s.data={meta:t.meta}),e.patch(t,s),s=e.applyData(t,s),s={type:"element",tagName:"pre",properties:{},children:[s]},e.patch(t,s),s}function _oe(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Loe(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Ioe(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=hu(r.toLowerCase()),s=e.footnoteOrder.indexOf(r);let a,c=e.footnoteCounts.get(r);c===void 0?(c=0,e.footnoteOrder.push(r),a=e.footnoteOrder.length):a=s+1,c+=1,e.footnoteCounts.set(r,c);const u={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(c>1?"-"+c:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(a)}]};e.patch(t,u);const f={type:"element",tagName:"sup",properties:{},children:[u]};return e.patch(t,f),e.applyData(t,f)}function Poe(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function zoe(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function t7(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const i=e.all(t),s=i[0];s&&s.type==="text"?s.value="["+s.value:i.unshift({type:"text",value:"["});const a=i[i.length-1];return a&&a.type==="text"?a.value+=r:i.push({type:"text",value:r}),i}function Foe(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return t7(e,t);const i={src:hu(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const s={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,s),e.applyData(t,s)}function Boe(e,t){const n={src:hu(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function Hoe(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function Uoe(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return t7(e,t);const i={href:hu(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const s={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,s),e.applyData(t,s)}function Voe(e,t){const n={href:hu(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function qoe(e,t,n){const r=e.all(t),i=n?$oe(n):n7(t),s={},a=[];if(typeof t.checked=="boolean"){const m=r[0];let p;m&&m.type==="element"&&m.tagName==="p"?p=m:(p={type:"element",tagName:"p",properties:{},children:[]},r.unshift(p)),p.children.length>0&&p.children.unshift({type:"text",value:" "}),p.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),s.className=["task-list-item"]}let c=-1;for(;++c<r.length;){const m=r[c];(i||c!==0||m.type!=="element"||m.tagName!=="p")&&a.push({type:"text",value:`
93
+ `}),m.type==="element"&&m.tagName==="p"&&!i?a.push(...m.children):a.push(m)}const u=r[r.length-1];u&&(i||u.type!=="element"||u.tagName!=="p")&&a.push({type:"text",value:`
94
+ `});const f={type:"element",tagName:"li",properties:s,children:a};return e.patch(t,f),e.applyData(t,f)}function $oe(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=n7(n[r])}return t}function n7(e){const t=e.spread;return t??e.children.length>1}function Yoe(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i<r.length;){const a=r[i];if(a.type==="element"&&a.tagName==="li"&&a.properties&&Array.isArray(a.properties.className)&&a.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const s={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,s),e.applyData(t,s)}function Woe(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Goe(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function Koe(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Qoe(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const a={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],a),i.push(a)}if(n.length>0){const a={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},c=ew(t.children[1]),u=L9(t.children[t.children.length-1]);c&&u&&(a.position={start:c,end:u}),i.push(a)}const s={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,s),e.applyData(t,s)}function Xoe(e,t,n){const r=n?n.children:void 0,s=(r?r.indexOf(t):1)===0?"th":"td",a=n&&n.type==="table"?n.align:void 0,c=a?a.length:t.children.length;let u=-1;const f=[];for(;++u<c;){const p=t.children[u],y={},x=a?a[u]:void 0;x&&(y.align=x);let b={type:"element",tagName:s,properties:y,children:[]};p&&(b.children=e.all(p),e.patch(p,b),b=e.applyData(p,b)),f.push(b)}const m={type:"element",tagName:"tr",properties:{},children:e.wrap(f,!0)};return e.patch(t,m),e.applyData(t,m)}function Zoe(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const X4=9,Z4=32;function Joe(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const s=[];for(;r;)s.push(J4(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return s.push(J4(t.slice(i),i>0,!1)),s.join("")}function J4(e,t,n){let r=0,i=e.length;if(t){let s=e.codePointAt(r);for(;s===X4||s===Z4;)r++,s=e.codePointAt(r)}if(n){let s=e.codePointAt(i-1);for(;s===X4||s===Z4;)i--,s=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function ese(e,t){const n={type:"text",value:Joe(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function tse(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const nse={blockquote:joe,break:Moe,code:Doe,delete:_oe,emphasis:Loe,footnoteReference:Ioe,heading:Poe,html:zoe,imageReference:Foe,image:Boe,inlineCode:Hoe,linkReference:Uoe,link:Voe,listItem:qoe,list:Yoe,paragraph:Woe,root:Goe,strong:Koe,table:Qoe,tableCell:Zoe,tableRow:Xoe,text:ese,thematicBreak:tse,toml:Lp,yaml:Lp,definition:Lp,footnoteDefinition:Lp};function Lp(){}const r7=-1,U0=0,Vd=1,Km=2,sw=3,aw=4,lw=5,cw=6,i7=7,o7=8,eT=typeof self=="object"?self:globalThis,rse=(e,t)=>{const n=(i,s)=>(e.set(s,i),i),r=i=>{if(e.has(i))return e.get(i);const[s,a]=t[i];switch(s){case U0:case r7:return n(a,i);case Vd:{const c=n([],i);for(const u of a)c.push(r(u));return c}case Km:{const c=n({},i);for(const[u,f]of a)c[r(u)]=r(f);return c}case sw:return n(new Date(a),i);case aw:{const{source:c,flags:u}=a;return n(new RegExp(c,u),i)}case lw:{const c=n(new Map,i);for(const[u,f]of a)c.set(r(u),r(f));return c}case cw:{const c=n(new Set,i);for(const u of a)c.add(r(u));return c}case i7:{const{name:c,message:u}=a;return n(new eT[c](u),i)}case o7:return n(BigInt(a),i);case"BigInt":return n(Object(BigInt(a)),i);case"ArrayBuffer":return n(new Uint8Array(a).buffer,a);case"DataView":{const{buffer:c}=new Uint8Array(a);return n(new DataView(c),a)}}return n(new eT[s](a),i)};return r},tT=e=>rse(new Map,e)(0),mc="",{toString:ise}={},{keys:ose}=Object,Cd=e=>{const t=typeof e;if(t!=="object"||!e)return[U0,t];const n=ise.call(e).slice(8,-1);switch(n){case"Array":return[Vd,mc];case"Object":return[Km,mc];case"Date":return[sw,mc];case"RegExp":return[aw,mc];case"Map":return[lw,mc];case"Set":return[cw,mc];case"DataView":return[Vd,n]}return n.includes("Array")?[Vd,n]:n.includes("Error")?[i7,n]:[Km,n]},Ip=([e,t])=>e===U0&&(t==="function"||t==="symbol"),sse=(e,t,n,r)=>{const i=(a,c)=>{const u=r.push(a)-1;return n.set(c,u),u},s=a=>{if(n.has(a))return n.get(a);let[c,u]=Cd(a);switch(c){case U0:{let m=a;switch(u){case"bigint":c=o7,m=a.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+u);m=null;break;case"undefined":return i([r7],a)}return i([c,m],a)}case Vd:{if(u){let y=a;return u==="DataView"?y=new Uint8Array(a.buffer):u==="ArrayBuffer"&&(y=new Uint8Array(a)),i([u,[...y]],a)}const m=[],p=i([c,m],a);for(const y of a)m.push(s(y));return p}case Km:{if(u)switch(u){case"BigInt":return i([u,a.toString()],a);case"Boolean":case"Number":case"String":return i([u,a.valueOf()],a)}if(t&&"toJSON"in a)return s(a.toJSON());const m=[],p=i([c,m],a);for(const y of ose(a))(e||!Ip(Cd(a[y])))&&m.push([s(y),s(a[y])]);return p}case sw:return i([c,a.toISOString()],a);case aw:{const{source:m,flags:p}=a;return i([c,{source:m,flags:p}],a)}case lw:{const m=[],p=i([c,m],a);for(const[y,x]of a)(e||!(Ip(Cd(y))||Ip(Cd(x))))&&m.push([s(y),s(x)]);return p}case cw:{const m=[],p=i([c,m],a);for(const y of a)(e||!Ip(Cd(y)))&&m.push(s(y));return p}}const{message:f}=a;return i([c,{name:u,message:f}],a)};return s},nT=(e,{json:t,lossy:n}={})=>{const r=[];return sse(!(t||n),!!t,new Map,r)(e),r},Qm=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?tT(nT(e,t)):structuredClone(e):(e,t)=>tT(nT(e,t));function ase(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function lse(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function cse(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||ase,r=e.options.footnoteBackLabel||lse,i=e.options.footnoteLabel||"Footnotes",s=e.options.footnoteLabelTagName||"h2",a=e.options.footnoteLabelProperties||{className:["sr-only"]},c=[];let u=-1;for(;++u<e.footnoteOrder.length;){const f=e.footnoteById.get(e.footnoteOrder[u]);if(!f)continue;const m=e.all(f),p=String(f.identifier).toUpperCase(),y=hu(p.toLowerCase());let x=0;const b=[],S=e.footnoteCounts.get(p);for(;S!==void 0&&++x<=S;){b.length>0&&b.push({type:"text",value:" "});let T=typeof n=="string"?n:n(u,x);typeof T=="string"&&(T={type:"text",value:T}),b.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+y+(x>1?"-"+x:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(u,x),className:["data-footnote-backref"]},children:Array.isArray(T)?T:[T]})}const k=m[m.length-1];if(k&&k.type==="element"&&k.tagName==="p"){const T=k.children[k.children.length-1];T&&T.type==="text"?T.value+=" ":k.children.push({type:"text",value:" "}),k.children.push(...b)}else m.push(...b);const E={type:"element",tagName:"li",properties:{id:t+"fn-"+y},children:e.wrap(m,!0)};e.patch(f,E),c.push(E)}if(c.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:s,properties:{...Qm(a),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
95
+ `},{type:"element",tagName:"ol",properties:{},children:e.wrap(c,!0)},{type:"text",value:`
96
+ `}]}}const V0=(function(e){if(e==null)return hse;if(typeof e=="function")return q0(e);if(typeof e=="object")return Array.isArray(e)?use(e):dse(e);if(typeof e=="string")return fse(e);throw new Error("Expected function, string, or object as test")});function use(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=V0(e[n]);return q0(r);function r(...i){let s=-1;for(;++s<t.length;)if(t[s].apply(this,i))return!0;return!1}}function dse(e){const t=e;return q0(n);function n(r){const i=r;let s;for(s in e)if(i[s]!==t[s])return!1;return!0}}function fse(e){return q0(t);function t(n){return n&&n.type===e}}function q0(e){return t;function t(n,r,i){return!!(pse(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function hse(){return!0}function pse(e){return e!==null&&typeof e=="object"&&"type"in e}const s7=[],mse=!0,_x=!1,gse="skip";function a7(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const s=V0(i),a=r?-1:1;c(e,void 0,[])();function c(u,f,m){const p=u&&typeof u=="object"?u:{};if(typeof p.type=="string"){const x=typeof p.tagName=="string"?p.tagName:typeof p.name=="string"?p.name:void 0;Object.defineProperty(y,"name",{value:"node ("+(u.type+(x?"<"+x+">":""))+")"})}return y;function y(){let x=s7,b,S,k;if((!t||s(u,f,m[m.length-1]||void 0))&&(x=yse(n(u,m)),x[0]===_x))return x;if("children"in u&&u.children){const E=u;if(E.children&&x[0]!==gse)for(S=(r?E.children.length:-1)+a,k=m.concat(E);S>-1&&S<E.children.length;){const T=E.children[S];if(b=c(T,S,k)(),b[0]===_x)return b;S=typeof b[1]=="number"?b[1]:S+a}}return x}}}function yse(e){return Array.isArray(e)?e:typeof e=="number"?[mse,e]:e==null?s7:[e]}function uw(e,t,n,r){let i,s,a;typeof t=="function"&&typeof n!="function"?(s=void 0,a=t,i=n):(s=t,a=n,i=r),a7(e,s,c,i);function c(u,f){const m=f[f.length-1],p=m?m.children.indexOf(u):void 0;return a(u,p,m)}}const Lx={}.hasOwnProperty,xse={};function bse(e,t){const n=t||xse,r=new Map,i=new Map,s=new Map,a={...nse,...n.handlers},c={all:f,applyData:wse,definitionById:r,footnoteById:i,footnoteCounts:s,footnoteOrder:[],handlers:a,one:u,options:n,patch:vse,wrap:Cse};return uw(e,function(m){if(m.type==="definition"||m.type==="footnoteDefinition"){const p=m.type==="definition"?r:i,y=String(m.identifier).toUpperCase();p.has(y)||p.set(y,m)}}),c;function u(m,p){const y=m.type,x=c.handlers[y];if(Lx.call(c.handlers,y)&&x)return x(c,m,p);if(c.options.passThrough&&c.options.passThrough.includes(y)){if("children"in m){const{children:S,...k}=m,E=Qm(k);return E.children=c.all(m),E}return Qm(m)}return(c.options.unknownHandler||Sse)(c,m,p)}function f(m){const p=[];if("children"in m){const y=m.children;let x=-1;for(;++x<y.length;){const b=c.one(y[x],m);if(b){if(x&&y[x-1].type==="break"&&(!Array.isArray(b)&&b.type==="text"&&(b.value=rT(b.value)),!Array.isArray(b)&&b.type==="element")){const S=b.children[0];S&&S.type==="text"&&(S.value=rT(S.value))}Array.isArray(b)?p.push(...b):p.push(b)}}}return p}}function vse(e,t){e.position&&(t.position=lre(e))}function wse(e,t){let n=t;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,s=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const a="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:a}}n.type==="element"&&s&&Object.assign(n.properties,Qm(s)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function Sse(e,t){const n=t.data||{},r="value"in t&&!(Lx.call(n,"hProperties")||Lx.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function Cse(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
97
+ `});++r<e.length;)r&&n.push({type:"text",value:`
98
+ `}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
99
+ `}),n}function rT(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function iT(e,t){const n=bse(e,t),r=n.one(e,void 0),i=cse(n),s=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&s.children.push({type:"text",value:`
100
+ `},i),s}function kse(e,t){return e&&"run"in e?async function(n,r){const i=iT(n,{file:r,...t});await e.run(i,r)}:function(n,r){return iT(n,{file:r,...e||t})}}function oT(e){if(e)throw e}var iy,sT;function Ese(){if(sT)return iy;sT=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(f){return typeof Array.isArray=="function"?Array.isArray(f):t.call(f)==="[object Array]"},s=function(f){if(!f||t.call(f)!=="[object Object]")return!1;var m=e.call(f,"constructor"),p=f.constructor&&f.constructor.prototype&&e.call(f.constructor.prototype,"isPrototypeOf");if(f.constructor&&!m&&!p)return!1;var y;for(y in f);return typeof y>"u"||e.call(f,y)},a=function(f,m){n&&m.name==="__proto__"?n(f,m.name,{enumerable:!0,configurable:!0,value:m.newValue,writable:!0}):f[m.name]=m.newValue},c=function(f,m){if(m==="__proto__")if(e.call(f,m)){if(r)return r(f,m).value}else return;return f[m]};return iy=function u(){var f,m,p,y,x,b,S=arguments[0],k=1,E=arguments.length,T=!1;for(typeof S=="boolean"&&(T=S,S=arguments[1]||{},k=2),(S==null||typeof S!="object"&&typeof S!="function")&&(S={});k<E;++k)if(f=arguments[k],f!=null)for(m in f)p=c(S,m),y=c(f,m),S!==y&&(T&&y&&(s(y)||(x=i(y)))?(x?(x=!1,b=p&&i(p)?p:[]):b=p&&s(p)?p:{},a(S,{name:m,newValue:u(T,b,y)})):typeof y<"u"&&a(S,{name:m,newValue:y}));return S},iy}var Tse=Ese();const oy=Zc(Tse);function Ix(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function Nse(){const e=[],t={run:n,use:r};return t;function n(...i){let s=-1;const a=i.pop();if(typeof a!="function")throw new TypeError("Expected function as last argument, not "+a);c(null,...i);function c(u,...f){const m=e[++s];let p=-1;if(u){a(u);return}for(;++p<i.length;)(f[p]===null||f[p]===void 0)&&(f[p]=i[p]);i=f,m?Rse(m,c)(...f):a(null,...f)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function Rse(e,t){let n;return r;function r(...a){const c=e.length>a.length;let u;c&&a.push(i);try{u=e.apply(this,a)}catch(f){const m=f;if(c&&n)throw m;return i(m)}c||(u&&u.then&&typeof u.then=="function"?u.then(s,i):u instanceof Error?i(u):s(u))}function i(a,...c){n||(n=!0,t(a,...c))}function s(a){i(null,a)}}const xo={basename:Ase,dirname:Ose,extname:jse,join:Mse,sep:"/"};function Ase(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Gf(e);let n=0,r=-1,i=e.length,s;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(s){n=i+1;break}}else r<0&&(s=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let a=-1,c=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(s){n=i+1;break}}else a<0&&(s=!0,a=i+1),c>-1&&(e.codePointAt(i)===t.codePointAt(c--)?c<0&&(r=i):(c=-1,r=a));return n===r?r=a:r<0&&(r=e.length),e.slice(n,r)}function Ose(e){if(Gf(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function jse(e){Gf(e);let t=e.length,n=-1,r=0,i=-1,s=0,a;for(;t--;){const c=e.codePointAt(t);if(c===47){if(a){r=t+1;break}continue}n<0&&(a=!0,n=t+1),c===46?i<0?i=t:s!==1&&(s=1):i>-1&&(s=-1)}return i<0||n<0||s===0||s===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function Mse(...e){let t=-1,n;for(;++t<e.length;)Gf(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":Dse(n)}function Dse(e){Gf(e);const t=e.codePointAt(0)===47;let n=_se(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function _se(e,t){let n="",r=0,i=-1,s=0,a=-1,c,u;for(;++a<=e.length;){if(a<e.length)c=e.codePointAt(a);else{if(c===47)break;c=47}if(c===47){if(!(i===a-1||s===1))if(i!==a-1&&s===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(u=n.lastIndexOf("/"),u!==n.length-1){u<0?(n="",r=0):(n=n.slice(0,u),r=n.length-1-n.lastIndexOf("/")),i=a,s=0;continue}}else if(n.length>0){n="",r=0,i=a,s=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,a):n=e.slice(i+1,a),r=a-i-1;i=a,s=0}else c===46&&s>-1?s++:s=-1}return n}function Gf(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Lse={cwd:Ise};function Ise(){return"/"}function Px(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function Pse(e){if(typeof e=="string")e=new URL(e);else if(!Px(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return zse(e)}function zse(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(t)}const sy=["history","path","basename","stem","extname","dirname"];class l7{constructor(t){let n;t?Px(t)?n={path:t}:typeof t=="string"||Fse(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":Lse.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<sy.length;){const s=sy[r];s in n&&n[s]!==void 0&&n[s]!==null&&(this[s]=s==="history"?[...n[s]]:n[s])}let i;for(i in n)sy.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?xo.basename(this.path):void 0}set basename(t){ly(t,"basename"),ay(t,"basename"),this.path=xo.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?xo.dirname(this.path):void 0}set dirname(t){aT(this.basename,"dirname"),this.path=xo.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?xo.extname(this.path):void 0}set extname(t){if(ay(t,"extname"),aT(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=xo.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Px(t)&&(t=Pse(t)),ly(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?xo.basename(this.path,this.extname):void 0}set stem(t){ly(t,"stem"),ay(t,"stem"),this.path=xo.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const i=this.message(t,n,r);throw i.fatal=!0,i}info(t,n,r){const i=this.message(t,n,r);return i.fatal=void 0,i}message(t,n,r){const i=new Dr(t,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function ay(e,t){if(e&&e.includes(xo.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+xo.sep+"`")}function ly(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function aT(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function Fse(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Bse=(function(e){const r=this.constructor.prototype,i=r[e],s=function(){return i.apply(s,arguments)};return Object.setPrototypeOf(s,r),s}),Hse={}.hasOwnProperty;class dw extends Bse{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=Nse()}copy(){const t=new dw;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(oy(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(dy("data",this.frozen),this.namespace[t]=n,this):Hse.call(this.namespace,t)&&this.namespace[t]||void 0:t?(dy("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=n.call(t,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=Pp(t),r=this.parser||this.Parser;return cy("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),cy("process",this.parser||this.Parser),uy("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(s,a){const c=Pp(t),u=r.parse(c);r.run(u,c,function(m,p,y){if(m||!p||!y)return f(m);const x=p,b=r.stringify(x,y);qse(b)?y.value=b:y.result=b,f(m,y)});function f(m,p){m||!p?a(m):s?s(p):n(void 0,p)}}}processSync(t){let n=!1,r;return this.freeze(),cy("processSync",this.parser||this.Parser),uy("processSync",this.compiler||this.Compiler),this.process(t,i),cT("processSync","process",n),r;function i(s,a){n=!0,oT(s),r=a}}run(t,n,r){lT(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?s(void 0,r):new Promise(s);function s(a,c){const u=Pp(n);i.run(t,u,f);function f(m,p,y){const x=p||t;m?c(m):a?a(x):r(void 0,x,y)}}}runSync(t,n){let r=!1,i;return this.run(t,n,s),cT("runSync","run",r),i;function s(a,c){oT(a),i=c,r=!0}}stringify(t,n){this.freeze();const r=Pp(n),i=this.compiler||this.Compiler;return uy("stringify",i),lT(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(dy("use",this.frozen),t!=null)if(typeof t=="function")u(t,n);else if(typeof t=="object")Array.isArray(t)?c(t):a(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function s(f){if(typeof f=="function")u(f,[]);else if(typeof f=="object")if(Array.isArray(f)){const[m,...p]=f;u(m,p)}else a(f);else throw new TypeError("Expected usable value, not `"+f+"`")}function a(f){if(!("plugins"in f)&&!("settings"in f))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");c(f.plugins),f.settings&&(i.settings=oy(!0,i.settings,f.settings))}function c(f){let m=-1;if(f!=null)if(Array.isArray(f))for(;++m<f.length;){const p=f[m];s(p)}else throw new TypeError("Expected a list of plugins, not `"+f+"`")}function u(f,m){let p=-1,y=-1;for(;++p<r.length;)if(r[p][0]===f){y=p;break}if(y===-1)r.push([f,...m]);else if(m.length>0){let[x,...b]=m;const S=r[y][1];Ix(S)&&Ix(x)&&(x=oy(!0,S,x)),r[y]=[f,x,...b]}}}}const Use=new dw().freeze();function cy(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function uy(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function dy(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function lT(e){if(!Ix(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function cT(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Pp(e){return Vse(e)?e:new l7(e)}function Vse(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function qse(e){return typeof e=="string"||$se(e)}function $se(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Yse="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",uT=[],dT={allowDangerousHtml:!0},Wse=/^(https?|ircs?|mailto|xmpp)$/i,Gse=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function c7(e){const t=Kse(e),n=Qse(e);return Xse(t.runSync(t.parse(n),n),e)}function Kse(e){const t=e.rehypePlugins||uT,n=e.remarkPlugins||uT,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...dT}:dT;return Use().use(Ooe).use(n).use(kse,r).use(t)}function Qse(e){const t=e.children||"",n=new l7;return typeof t=="string"&&(n.value=t),n}function Xse(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,s=t.disallowedElements,a=t.skipHtml,c=t.unwrapDisallowed,u=t.urlTransform||Zse;for(const m of Gse)Object.hasOwn(t,m.from)&&(""+m.from+(m.to?"use `"+m.to+"` instead":"remove it")+Yse+m.id,void 0);return uw(e,f),hre(e,{Fragment:h.Fragment,components:i,ignoreInvalidStyle:!0,jsx:h.jsx,jsxs:h.jsxs,passKeys:!0,passNode:!0});function f(m,p,y){if(m.type==="raw"&&y&&typeof p=="number")return a?y.children.splice(p,1):y.children[p]={type:"text",value:m.value},p;if(m.type==="element"){let x;for(x in ty)if(Object.hasOwn(ty,x)&&Object.hasOwn(m.properties,x)){const b=m.properties[x],S=ty[x];(S===null||S.includes(m.tagName))&&(m.properties[x]=u(String(b||""),x,m))}}if(m.type==="element"){let x=n?!n.includes(m.tagName):s?s.includes(m.tagName):!1;if(!x&&r&&typeof p=="number"&&(x=!r(m,p,y)),x&&y&&typeof p=="number")return c&&m.children?y.children.splice(p,1,...m.children):y.children.splice(p,1),p}}}function Zse(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||Wse.test(e.slice(0,t))?e:""}var fy={exports:{}},fT;function Jse(){return fT||(fT=1,(function(e){(function(){var t;t=e.exports=i,t.format=i,t.vsprintf=r,typeof console<"u"&&typeof console.log=="function"&&(t.printf=n);function n(){console.log(i.apply(null,arguments))}function r(s,a){return i.apply(null,[s].concat(a))}function i(s){for(var a=1,c=[].slice.call(arguments),u=0,f=s.length,m="",p,y=!1,x,b,S=!1,k,E=function(){return c[a++]},T=function(){for(var N="";/\d/.test(s[u]);)N+=s[u++],p=s[u];return N.length>0?parseInt(N):null};u<f;++u)if(p=s[u],y)switch(y=!1,p=="."?(S=!1,p=s[++u]):p=="0"&&s[u+1]=="."?(S=!0,u+=2,p=s[u]):S=!0,k=T(),p){case"b":m+=parseInt(E(),10).toString(2);break;case"c":x=E(),typeof x=="string"||x instanceof String?m+=x:m+=String.fromCharCode(parseInt(x,10));break;case"d":m+=parseInt(E(),10);break;case"f":b=String(parseFloat(E()).toFixed(k||6)),m+=S?b:b.replace(/^0/,"");break;case"j":m+=JSON.stringify(E());break;case"o":m+="0"+parseInt(E(),10).toString(8);break;case"s":m+=E();break;case"x":m+="0x"+parseInt(E(),10).toString(16);break;case"X":m+="0x"+parseInt(E(),10).toString(16).toUpperCase();break;default:m+=p;break}else p==="%"?y=!0:m+=p;return m}})()})(fy)),fy.exports}var eae=Jse();const tae=Zc(eae),zp=Object.assign(Ja(Error),{eval:Ja(EvalError),range:Ja(RangeError),reference:Ja(ReferenceError),syntax:Ja(SyntaxError),type:Ja(TypeError),uri:Ja(URIError)});function Ja(e){return t.displayName=e.displayName||e.name,t;function t(n,...r){const i=n&&tae(n,...r);return new e(i)}}const Fp={}.hasOwnProperty,hT={yaml:"-",toml:"+"};function fw(e){const t=[];let n=-1;const r=Array.isArray(e)?e:e?[e]:["yaml"];for(;++n<r.length;)t[n]=nae(r[n]);return t}function nae(e){let t=e;if(typeof t=="string"){if(!Fp.call(hT,t))throw zp("Missing matter definition for `%s`",t);t={type:t,marker:hT[t]}}else if(typeof t!="object")throw zp("Expected matter to be an object, not `%j`",t);if(!Fp.call(t,"type"))throw zp("Missing `type` in matter `%j`",t);if(!Fp.call(t,"fence")&&!Fp.call(t,"marker"))throw zp("Missing `marker` or `fence` in matter `%j`",t);return t}function rae(e){const t=fw(e),n={};let r=-1;for(;++r<t.length;){const i=t[r],s=zx(i,"open").charCodeAt(0),a=iae(i),c=n[s];Array.isArray(c)?c.push(a):n[s]=[a]}return{flow:n}}function iae(e){const t=e.anywhere,n=e.type,r=n+"Fence",i=r+"Sequence",s=n+"Value",a={tokenize:m,partial:!0};let c,u=0;return{tokenize:f,concrete:!0};function f(p,y,x){const b=this;return S;function S(R){const L=b.now();return L.column===1&&(L.line===1||t)&&(c=zx(e,"open"),u=0,R===c.charCodeAt(u))?(p.enter(n),p.enter(r),p.enter(i),k(R)):x(R)}function k(R){return u===c.length?(p.exit(i),_t(R)?(p.enter("whitespace"),E(R)):T(R)):R===c.charCodeAt(u++)?(p.consume(R),k):x(R)}function E(R){return _t(R)?(p.consume(R),E):(p.exit("whitespace"),T(R))}function T(R){return mt(R)?(p.exit(r),p.enter("lineEnding"),p.consume(R),p.exit("lineEnding"),c=zx(e,"close"),u=0,p.attempt(a,A,N)):x(R)}function N(R){return R===null||mt(R)?O(R):(p.enter(s),j(R))}function j(R){return R===null||mt(R)?(p.exit(s),O(R)):(p.consume(R),j)}function O(R){return R===null?x(R):(p.enter("lineEnding"),p.consume(R),p.exit("lineEnding"),p.attempt(a,A,N))}function A(R){return p.exit(n),y(R)}}function m(p,y,x){let b=0;return S;function S(N){return N===c.charCodeAt(b)?(p.enter(r),p.enter(i),k(N)):x(N)}function k(N){return b===c.length?(p.exit(i),_t(N)?(p.enter("whitespace"),E(N)):T(N)):N===c.charCodeAt(b++)?(p.consume(N),k):x(N)}function E(N){return _t(N)?(p.consume(N),E):(p.exit("whitespace"),T(N))}function T(N){return N===null||mt(N)?(p.exit(r),y(N)):x(N)}}}function zx(e,t){return e.marker?pT(e.marker,t).repeat(3):pT(e.fence,t)}function pT(e,t){return typeof e=="string"?e:e[t]}function oae(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function sae(e){const t=fw(e),n={},r={};let i=-1;for(;++i<t.length;){const s=t[i];n[s.type]=aae(s),r[s.type]=lae,r[s.type+"Value"]=cae}return{enter:n,exit:r}}function aae(e){return t;function t(n){this.enter({type:e.type,value:""},n),this.buffer()}}function lae(e){const t=this.resume(),n=this.stack[this.stack.length-1];this.exit(e),n.value=t.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,"")}function cae(e){this.config.enter.data.call(this,e),this.config.exit.data.call(this,e)}function uae(e){const t=[],n={},r=fw(e);let i=-1;for(;++i<r.length;){const s=r[i];n[s.type]=dae(s);const a=Fx(s,"open");t.push({atBreak:!0,character:a.charAt(0),after:oae(a.charAt(1))})}return{unsafe:t,handlers:n}}function dae(e){const t=Fx(e,"open"),n=Fx(e,"close");return r;function r(i){return t+(i.value?`
101
+ `+i.value:"")+`
102
+ `+n}}function Fx(e,t){return e.marker?mT(e.marker,t).repeat(3):mT(e.fence,t)}function mT(e,t){return typeof e=="string"?e:e[t]}const fae="yaml";function hae(e){const t=this,n=e||fae,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),s=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),a=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(rae(n)),s.push(sae(n)),a.push(uae(n))}function gT(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function pae(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function mae(e,t,n){const i=V0((n||{}).ignore||[]),s=gae(t);let a=-1;for(;++a<s.length;)a7(e,"text",c);function c(f,m){let p=-1,y;for(;++p<m.length;){const x=m[p],b=y?y.children:void 0;if(i(x,b?b.indexOf(x):void 0,y))return;y=x}if(y)return u(f,m)}function u(f,m){const p=m[m.length-1],y=s[a][0],x=s[a][1];let b=0;const k=p.children.indexOf(f);let E=!1,T=[];y.lastIndex=0;let N=y.exec(f.value);for(;N;){const j=N.index,O={index:N.index,input:N.input,stack:[...m,f]};let A=x(...N,O);if(typeof A=="string"&&(A=A.length>0?{type:"text",value:A}:void 0),A===!1?y.lastIndex=j+1:(b!==j&&T.push({type:"text",value:f.value.slice(b,j)}),Array.isArray(A)?T.push(...A):A&&T.push(A),b=j+N[0].length,E=!0),!y.global)break;N=y.exec(f.value)}return E?(b<f.value.length&&T.push({type:"text",value:f.value.slice(b)}),p.children.splice(k,1,...T)):T=[f],k+T.length}}function gae(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const i=n[r];t.push([yae(i[0]),xae(i[1])])}return t}function yae(e){return typeof e=="string"?new RegExp(pae(e),"g"):e}function xae(e){return typeof e=="function"?e:function(){return e}}const hy="phrasing",py=["autolink","link","image","label"];function bae(){return{transforms:[Tae],enter:{literalAutolink:wae,literalAutolinkEmail:my,literalAutolinkHttp:my,literalAutolinkWww:my},exit:{literalAutolink:Eae,literalAutolinkEmail:kae,literalAutolinkHttp:Sae,literalAutolinkWww:Cae}}}function vae(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:hy,notInConstruct:py},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:hy,notInConstruct:py},{character:":",before:"[ps]",after:"\\/",inConstruct:hy,notInConstruct:py}]}}function wae(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function my(e){this.config.enter.autolinkProtocol.call(this,e)}function Sae(e){this.config.exit.autolinkProtocol.call(this,e)}function Cae(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function kae(e){this.config.exit.autolinkEmail.call(this,e)}function Eae(e){this.exit(e)}function Tae(e){mae(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,Nae],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),Rae]],{ignore:["link","linkReference"]})}function Nae(e,t,n,r,i){let s="";if(!u7(i)||(/^w/i.test(t)&&(n=t+n,t="",s="http://"),!Aae(n)))return!1;const a=Oae(n+r);if(!a[0])return!1;const c={type:"link",title:null,url:s+t+a[0],children:[{type:"text",value:t+a[0]}]};return a[1]?[c,{type:"text",value:a[1]}]:c}function Rae(e,t,n,r){return!u7(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function Aae(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function Oae(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const i=gT(e,"(");let s=gT(e,")");for(;r!==-1&&i>s;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),s++;return[e,n]}function u7(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||xl(n)||B0(n))&&(!t||n!==47)}d7.peek=Fae;function jae(){this.buffer()}function Mae(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function Dae(){this.buffer()}function _ae(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function Lae(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=ao(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Iae(e){this.exit(e)}function Pae(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=ao(this.sliceSerialize(e)).toLowerCase(),n.label=t}function zae(e){this.exit(e)}function Fae(){return"["}function d7(e,t,n,r){const i=n.createTracker(r);let s=i.move("[^");const a=n.enter("footnoteReference"),c=n.enter("reference");return s+=i.move(n.safe(n.associationId(e),{after:"]",before:s})),c(),a(),s+=i.move("]"),s}function Bae(){return{enter:{gfmFootnoteCallString:jae,gfmFootnoteCall:Mae,gfmFootnoteDefinitionLabelString:Dae,gfmFootnoteDefinition:_ae},exit:{gfmFootnoteCallString:Lae,gfmFootnoteCall:Iae,gfmFootnoteDefinitionLabelString:Pae,gfmFootnoteDefinition:zae}}}function Hae(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:d7},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,s,a){const c=s.createTracker(a);let u=c.move("[^");const f=s.enter("footnoteDefinition"),m=s.enter("label");return u+=c.move(s.safe(s.associationId(r),{before:u,after:"]"})),m(),u+=c.move("]:"),r.children&&r.children.length>0&&(c.shift(4),u+=c.move((t?`
103
+ `:" ")+s.indentLines(s.containerFlow(r,c.current()),t?f7:Uae))),f(),u}}function Uae(e,t,n){return t===0?e:f7(e,t,n)}function f7(e,t,n){return(n?"":" ")+e}const Vae=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];h7.peek=Gae;function qae(){return{canContainEols:["delete"],enter:{strikethrough:Yae},exit:{strikethrough:Wae}}}function $ae(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:Vae}],handlers:{delete:h7}}}function Yae(e){this.enter({type:"delete",children:[]},e)}function Wae(e){this.exit(e)}function h7(e,t,n,r){const i=n.createTracker(r),s=n.enter("strikethrough");let a=i.move("~~");return a+=n.containerPhrasing(e,{...i.current(),before:a,after:"~"}),a+=i.move("~~"),s(),a}function Gae(){return"~"}function Kae(e){return e.length}function Qae(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||Kae,s=[],a=[],c=[],u=[];let f=0,m=-1;for(;++m<e.length;){const S=[],k=[];let E=-1;for(e[m].length>f&&(f=e[m].length);++E<e[m].length;){const T=Xae(e[m][E]);if(n.alignDelimiters!==!1){const N=i(T);k[E]=N,(u[E]===void 0||N>u[E])&&(u[E]=N)}S.push(T)}a[m]=S,c[m]=k}let p=-1;if(typeof r=="object"&&"length"in r)for(;++p<f;)s[p]=yT(r[p]);else{const S=yT(r);for(;++p<f;)s[p]=S}p=-1;const y=[],x=[];for(;++p<f;){const S=s[p];let k="",E="";S===99?(k=":",E=":"):S===108?k=":":S===114&&(E=":");let T=n.alignDelimiters===!1?1:Math.max(1,u[p]-k.length-E.length);const N=k+"-".repeat(T)+E;n.alignDelimiters!==!1&&(T=k.length+T+E.length,T>u[p]&&(u[p]=T),x[p]=T),y[p]=N}a.splice(1,0,y),c.splice(1,0,x),m=-1;const b=[];for(;++m<a.length;){const S=a[m],k=c[m];p=-1;const E=[];for(;++p<f;){const T=S[p]||"";let N="",j="";if(n.alignDelimiters!==!1){const O=u[p]-(k[p]||0),A=s[p];A===114?N=" ".repeat(O):A===99?O%2?(N=" ".repeat(O/2+.5),j=" ".repeat(O/2-.5)):(N=" ".repeat(O/2),j=N):j=" ".repeat(O)}n.delimiterStart!==!1&&!p&&E.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&T==="")&&(n.delimiterStart!==!1||p)&&E.push(" "),n.alignDelimiters!==!1&&E.push(N),E.push(T),n.alignDelimiters!==!1&&E.push(j),n.padding!==!1&&E.push(" "),(n.delimiterEnd!==!1||p!==f-1)&&E.push("|")}b.push(n.delimiterEnd===!1?E.join("").replace(/ +$/,""):E.join(""))}return b.join(`
104
+ `)}function Xae(e){return e==null?"":String(e)}function yT(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function Zae(e,t,n,r){const i=n.enter("blockquote"),s=n.createTracker(r);s.move("> "),s.shift(2);const a=n.indentLines(n.containerFlow(e,s.current()),Jae);return i(),a}function Jae(e,t,n){return">"+(n?"":" ")+e}function ele(e,t){return xT(e,t.inConstruct,!0)&&!xT(e,t.notInConstruct,!1)}function xT(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function bT(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
105
+ `&&ele(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
106
+ `}function tle(e,t){const n=String(e);let r=n.indexOf(t),i=r,s=0,a=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++s>a&&(a=s):s=1,i=r+t.length,r=n.indexOf(t,i);return a}function nle(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function rle(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function ile(e,t,n,r){const i=rle(n),s=e.value||"",a=i==="`"?"GraveAccent":"Tilde";if(nle(e,n)){const p=n.enter("codeIndented"),y=n.indentLines(s,ole);return p(),y}const c=n.createTracker(r),u=i.repeat(Math.max(tle(s,i)+1,3)),f=n.enter("codeFenced");let m=c.move(u);if(e.lang){const p=n.enter(`codeFencedLang${a}`);m+=c.move(n.safe(e.lang,{before:m,after:" ",encode:["`"],...c.current()})),p()}if(e.lang&&e.meta){const p=n.enter(`codeFencedMeta${a}`);m+=c.move(" "),m+=c.move(n.safe(e.meta,{before:m,after:`
107
+ `,encode:["`"],...c.current()})),p()}return m+=c.move(`
108
+ `),s&&(m+=c.move(s+`
109
+ `)),m+=c.move(u),f(),m}function ole(e,t,n){return(n?"":" ")+e}function hw(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function sle(e,t,n,r){const i=hw(n),s=i==='"'?"Quote":"Apostrophe",a=n.enter("definition");let c=n.enter("label");const u=n.createTracker(r);let f=u.move("[");return f+=u.move(n.safe(n.associationId(e),{before:f,after:"]",...u.current()})),f+=u.move("]: "),c(),!e.url||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),f+=u.move("<"),f+=u.move(n.safe(e.url,{before:f,after:">",...u.current()})),f+=u.move(">")):(c=n.enter("destinationRaw"),f+=u.move(n.safe(e.url,{before:f,after:e.title?" ":`
110
+ `,...u.current()}))),c(),e.title&&(c=n.enter(`title${s}`),f+=u.move(" "+i),f+=u.move(n.safe(e.title,{before:f,after:i,...u.current()})),f+=u.move(i),c()),a(),f}function ale(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function mf(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Xm(e,t,n){const r=Qc(e),i=Qc(t);return r===void 0?i===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}p7.peek=lle;function p7(e,t,n,r){const i=ale(n),s=n.enter("emphasis"),a=n.createTracker(r),c=a.move(i);let u=a.move(n.containerPhrasing(e,{after:i,before:c,...a.current()}));const f=u.charCodeAt(0),m=Xm(r.before.charCodeAt(r.before.length-1),f,i);m.inside&&(u=mf(f)+u.slice(1));const p=u.charCodeAt(u.length-1),y=Xm(r.after.charCodeAt(0),p,i);y.inside&&(u=u.slice(0,-1)+mf(p));const x=a.move(i);return s(),n.attentionEncodeSurroundingInfo={after:y.outside,before:m.outside},c+u+x}function lle(e,t,n){return n.options.emphasis||"*"}function cle(e,t){let n=!1;return uw(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,_x}),!!((!e.depth||e.depth<3)&&iw(e)&&(t.options.setext||n))}function ule(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),s=n.createTracker(r);if(cle(e,n)){const m=n.enter("headingSetext"),p=n.enter("phrasing"),y=n.containerPhrasing(e,{...s.current(),before:`
111
+ `,after:`
112
+ `});return p(),m(),y+`
113
+ `+(i===1?"=":"-").repeat(y.length-(Math.max(y.lastIndexOf("\r"),y.lastIndexOf(`
114
+ `))+1))}const a="#".repeat(i),c=n.enter("headingAtx"),u=n.enter("phrasing");s.move(a+" ");let f=n.containerPhrasing(e,{before:"# ",after:`
115
+ `,...s.current()});return/^[\t ]/.test(f)&&(f=mf(f.charCodeAt(0))+f.slice(1)),f=f?a+" "+f:a,n.options.closeAtx&&(f+=" "+a),u(),c(),f}m7.peek=dle;function m7(e){return e.value||""}function dle(){return"<"}g7.peek=fle;function g7(e,t,n,r){const i=hw(n),s=i==='"'?"Quote":"Apostrophe",a=n.enter("image");let c=n.enter("label");const u=n.createTracker(r);let f=u.move("![");return f+=u.move(n.safe(e.alt,{before:f,after:"]",...u.current()})),f+=u.move("]("),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),f+=u.move("<"),f+=u.move(n.safe(e.url,{before:f,after:">",...u.current()})),f+=u.move(">")):(c=n.enter("destinationRaw"),f+=u.move(n.safe(e.url,{before:f,after:e.title?" ":")",...u.current()}))),c(),e.title&&(c=n.enter(`title${s}`),f+=u.move(" "+i),f+=u.move(n.safe(e.title,{before:f,after:i,...u.current()})),f+=u.move(i),c()),f+=u.move(")"),a(),f}function fle(){return"!"}y7.peek=hle;function y7(e,t,n,r){const i=e.referenceType,s=n.enter("imageReference");let a=n.enter("label");const c=n.createTracker(r);let u=c.move("![");const f=n.safe(e.alt,{before:u,after:"]",...c.current()});u+=c.move(f+"]["),a();const m=n.stack;n.stack=[],a=n.enter("reference");const p=n.safe(n.associationId(e),{before:u,after:"]",...c.current()});return a(),n.stack=m,s(),i==="full"||!f||f!==p?u+=c.move(p+"]"):i==="shortcut"?u=u.slice(0,-1):u+=c.move("]"),u}function hle(){return"!"}x7.peek=ple;function x7(e,t,n){let r=e.value||"",i="`",s=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++s<n.unsafe.length;){const a=n.unsafe[s],c=n.compilePattern(a);let u;if(a.atBreak)for(;u=c.exec(r);){let f=u.index;r.charCodeAt(f)===10&&r.charCodeAt(f-1)===13&&f--,r=r.slice(0,f)+" "+r.slice(u.index+1)}}return i+r+i}function ple(){return"`"}function b7(e,t){const n=iw(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}v7.peek=mle;function v7(e,t,n,r){const i=hw(n),s=i==='"'?"Quote":"Apostrophe",a=n.createTracker(r);let c,u;if(b7(e,n)){const m=n.stack;n.stack=[],c=n.enter("autolink");let p=a.move("<");return p+=a.move(n.containerPhrasing(e,{before:p,after:">",...a.current()})),p+=a.move(">"),c(),n.stack=m,p}c=n.enter("link"),u=n.enter("label");let f=a.move("[");return f+=a.move(n.containerPhrasing(e,{before:f,after:"](",...a.current()})),f+=a.move("]("),u(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(u=n.enter("destinationLiteral"),f+=a.move("<"),f+=a.move(n.safe(e.url,{before:f,after:">",...a.current()})),f+=a.move(">")):(u=n.enter("destinationRaw"),f+=a.move(n.safe(e.url,{before:f,after:e.title?" ":")",...a.current()}))),u(),e.title&&(u=n.enter(`title${s}`),f+=a.move(" "+i),f+=a.move(n.safe(e.title,{before:f,after:i,...a.current()})),f+=a.move(i),u()),f+=a.move(")"),c(),f}function mle(e,t,n){return b7(e,n)?"<":"["}w7.peek=gle;function w7(e,t,n,r){const i=e.referenceType,s=n.enter("linkReference");let a=n.enter("label");const c=n.createTracker(r);let u=c.move("[");const f=n.containerPhrasing(e,{before:u,after:"]",...c.current()});u+=c.move(f+"]["),a();const m=n.stack;n.stack=[],a=n.enter("reference");const p=n.safe(n.associationId(e),{before:u,after:"]",...c.current()});return a(),n.stack=m,s(),i==="full"||!f||f!==p?u+=c.move(p+"]"):i==="shortcut"?u=u.slice(0,-1):u+=c.move("]"),u}function gle(){return"["}function pw(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function yle(e){const t=pw(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function xle(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function S7(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function ble(e,t,n,r){const i=n.enter("list"),s=n.bulletCurrent;let a=e.ordered?xle(n):pw(n);const c=e.ordered?a==="."?")":".":yle(n);let u=t&&n.bulletLastUsed?a===n.bulletLastUsed:!1;if(!e.ordered){const m=e.children?e.children[0]:void 0;if((a==="*"||a==="-")&&m&&(!m.children||!m.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(u=!0),S7(n)===a&&m){let p=-1;for(;++p<e.children.length;){const y=e.children[p];if(y&&y.type==="listItem"&&y.children&&y.children[0]&&y.children[0].type==="thematicBreak"){u=!0;break}}}}u&&(a=c),n.bulletCurrent=a;const f=n.containerFlow(e,r);return n.bulletLastUsed=a,n.bulletCurrent=s,i(),f}function vle(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function wle(e,t,n,r){const i=vle(n);let s=n.bulletCurrent||pw(n);t&&t.type==="list"&&t.ordered&&(s=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+s);let a=s.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(a=Math.ceil(a/4)*4);const c=n.createTracker(r);c.move(s+" ".repeat(a-s.length)),c.shift(a);const u=n.enter("listItem"),f=n.indentLines(n.containerFlow(e,c.current()),m);return u(),f;function m(p,y,x){return y?(x?"":" ".repeat(a))+p:(x?s:s+" ".repeat(a-s.length))+p}}function Sle(e,t,n,r){const i=n.enter("paragraph"),s=n.enter("phrasing"),a=n.containerPhrasing(e,r);return s(),i(),a}const Cle=V0(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function kle(e,t,n,r){return(e.children.some(function(a){return Cle(a)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function Ele(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}C7.peek=Tle;function C7(e,t,n,r){const i=Ele(n),s=n.enter("strong"),a=n.createTracker(r),c=a.move(i+i);let u=a.move(n.containerPhrasing(e,{after:i,before:c,...a.current()}));const f=u.charCodeAt(0),m=Xm(r.before.charCodeAt(r.before.length-1),f,i);m.inside&&(u=mf(f)+u.slice(1));const p=u.charCodeAt(u.length-1),y=Xm(r.after.charCodeAt(0),p,i);y.inside&&(u=u.slice(0,-1)+mf(p));const x=a.move(i+i);return s(),n.attentionEncodeSurroundingInfo={after:y.outside,before:m.outside},c+u+x}function Tle(e,t,n){return n.options.strong||"*"}function Nle(e,t,n,r){return n.safe(e.value,r)}function Rle(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function Ale(e,t,n){const r=(S7(n)+(n.options.ruleSpaces?" ":"")).repeat(Rle(n));return n.options.ruleSpaces?r.slice(0,-1):r}const k7={blockquote:Zae,break:bT,code:ile,definition:sle,emphasis:p7,hardBreak:bT,heading:ule,html:m7,image:g7,imageReference:y7,inlineCode:x7,link:v7,linkReference:w7,list:ble,listItem:wle,paragraph:Sle,root:kle,strong:C7,text:Nle,thematicBreak:Ale};function Ole(){return{enter:{table:jle,tableData:vT,tableHeader:vT,tableRow:Dle},exit:{codeText:_le,table:Mle,tableData:gy,tableHeader:gy,tableRow:gy}}}function jle(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function Mle(e){this.exit(e),this.data.inTable=void 0}function Dle(e){this.enter({type:"tableRow",children:[]},e)}function gy(e){this.exit(e)}function vT(e){this.enter({type:"tableCell",children:[]},e)}function _le(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,Lle));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function Lle(e,t){return t==="|"?t:e}function Ile(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,s=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
116
+ `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:y,table:a,tableCell:u,tableRow:c}};function a(x,b,S,k){return f(m(x,S,k),x.align)}function c(x,b,S,k){const E=p(x,S,k),T=f([E]);return T.slice(0,T.indexOf(`
117
+ `))}function u(x,b,S,k){const E=S.enter("tableCell"),T=S.enter("phrasing"),N=S.containerPhrasing(x,{...k,before:s,after:s});return T(),E(),N}function f(x,b){return Qae(x,{align:b,alignDelimiters:r,padding:n,stringLength:i})}function m(x,b,S){const k=x.children;let E=-1;const T=[],N=b.enter("table");for(;++E<k.length;)T[E]=p(k[E],b,S);return N(),T}function p(x,b,S){const k=x.children;let E=-1;const T=[],N=b.enter("tableRow");for(;++E<k.length;)T[E]=u(k[E],x,b,S);return N(),T}function y(x,b,S){let k=k7.inlineCode(x,b,S);return S.stack.includes("tableCell")&&(k=k.replace(/\|/g,"\\$&")),k}}function Ple(){return{exit:{taskListCheckValueChecked:wT,taskListCheckValueUnchecked:wT,paragraph:Fle}}}function zle(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:Ble}}}function wT(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function Fle(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const i=t.children;let s=-1,a;for(;++s<i.length;){const c=i[s];if(c.type==="paragraph"){a=c;break}}a===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function Ble(e,t,n,r){const i=e.children[0],s=typeof e.checked=="boolean"&&i&&i.type==="paragraph",a="["+(e.checked?"x":" ")+"] ",c=n.createTracker(r);s&&c.move(a);let u=k7.listItem(e,t,n,{...r,...c.current()});return s&&(u=u.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,f)),u;function f(m){return m+a}}function Hle(){return[bae(),Bae(),qae(),Ole(),Ple()]}function Ule(e){return{extensions:[vae(),Hae(e),$ae(),Ile(e),zle()]}}const Vle={tokenize:Kle,partial:!0},E7={tokenize:Qle,partial:!0},T7={tokenize:Xle,partial:!0},N7={tokenize:Zle,partial:!0},qle={tokenize:Jle,partial:!0},R7={name:"wwwAutolink",tokenize:Wle,previous:O7},A7={name:"protocolAutolink",tokenize:Gle,previous:j7},Ts={name:"emailAutolink",tokenize:Yle,previous:M7},_o={};function $le(){return{text:_o}}let el=48;for(;el<123;)_o[el]=Ts,el++,el===58?el=65:el===91&&(el=97);_o[43]=Ts;_o[45]=Ts;_o[46]=Ts;_o[95]=Ts;_o[72]=[Ts,A7];_o[104]=[Ts,A7];_o[87]=[Ts,R7];_o[119]=[Ts,R7];function Yle(e,t,n){const r=this;let i,s;return a;function a(p){return!Bx(p)||!M7.call(r,r.previous)||mw(r.events)?n(p):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),c(p))}function c(p){return Bx(p)?(e.consume(p),c):p===64?(e.consume(p),u):n(p)}function u(p){return p===46?e.check(qle,m,f)(p):p===45||p===95||Or(p)?(s=!0,e.consume(p),u):m(p)}function f(p){return e.consume(p),i=!0,u}function m(p){return s&&i&&Hr(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(p)):n(p)}}function Wle(e,t,n){const r=this;return i;function i(a){return a!==87&&a!==119||!O7.call(r,r.previous)||mw(r.events)?n(a):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(Vle,e.attempt(E7,e.attempt(T7,s),n),n)(a))}function s(a){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(a)}}function Gle(e,t,n){const r=this;let i="",s=!1;return a;function a(p){return(p===72||p===104)&&j7.call(r,r.previous)&&!mw(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(p),e.consume(p),c):n(p)}function c(p){if(Hr(p)&&i.length<5)return i+=String.fromCodePoint(p),e.consume(p),c;if(p===58){const y=i.toLowerCase();if(y==="http"||y==="https")return e.consume(p),u}return n(p)}function u(p){return p===47?(e.consume(p),s?f:(s=!0,u)):n(p)}function f(p){return p===null||Gm(p)||Sn(p)||xl(p)||B0(p)?n(p):e.attempt(E7,e.attempt(T7,m),n)(p)}function m(p){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(p)}}function Kle(e,t,n){let r=0;return i;function i(a){return(a===87||a===119)&&r<3?(r++,e.consume(a),i):a===46&&r===3?(e.consume(a),s):n(a)}function s(a){return a===null?n(a):t(a)}}function Qle(e,t,n){let r,i,s;return a;function a(f){return f===46||f===95?e.check(N7,u,c)(f):f===null||Sn(f)||xl(f)||f!==45&&B0(f)?u(f):(s=!0,e.consume(f),a)}function c(f){return f===95?r=!0:(i=r,r=void 0),e.consume(f),a}function u(f){return i||r||!s?n(f):t(f)}}function Xle(e,t){let n=0,r=0;return i;function i(a){return a===40?(n++,e.consume(a),i):a===41&&r<n?s(a):a===33||a===34||a===38||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===60||a===63||a===93||a===95||a===126?e.check(N7,t,s)(a):a===null||Sn(a)||xl(a)?t(a):(e.consume(a),i)}function s(a){return a===41&&r++,e.consume(a),i}}function Zle(e,t,n){return r;function r(c){return c===33||c===34||c===39||c===41||c===42||c===44||c===46||c===58||c===59||c===63||c===95||c===126?(e.consume(c),r):c===38?(e.consume(c),s):c===93?(e.consume(c),i):c===60||c===null||Sn(c)||xl(c)?t(c):n(c)}function i(c){return c===null||c===40||c===91||Sn(c)||xl(c)?t(c):r(c)}function s(c){return Hr(c)?a(c):n(c)}function a(c){return c===59?(e.consume(c),r):Hr(c)?(e.consume(c),a):n(c)}}function Jle(e,t,n){return r;function r(s){return e.consume(s),i}function i(s){return Or(s)?n(s):t(s)}}function O7(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Sn(e)}function j7(e){return!Hr(e)}function M7(e){return!(e===47||Bx(e))}function Bx(e){return e===43||e===45||e===46||e===95||Or(e)}function mw(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const ece={tokenize:lce,partial:!0};function tce(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:oce,continuation:{tokenize:sce},exit:ace}},text:{91:{name:"gfmFootnoteCall",tokenize:ice},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:nce,resolveTo:rce}}}}function nce(e,t,n){const r=this;let i=r.events.length;const s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a;for(;i--;){const u=r.events[i][1];if(u.type==="labelImage"){a=u;break}if(u.type==="gfmFootnoteCall"||u.type==="labelLink"||u.type==="label"||u.type==="image"||u.type==="link")break}return c;function c(u){if(!a||!a._balanced)return n(u);const f=ao(r.sliceSerialize({start:a.end,end:r.now()}));return f.codePointAt(0)!==94||!s.includes(f.slice(1))?n(u):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(u),e.exit("gfmFootnoteCallLabelMarker"),t(u))}}function rce(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const s={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},s.start),end:Object.assign({},s.end)},c=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",s,t],["enter",a,t],["exit",a,t],["exit",s,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...c),e}function ice(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s=0,a;return c;function c(p){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(p),e.exit("gfmFootnoteCallLabelMarker"),u}function u(p){return p!==94?n(p):(e.enter("gfmFootnoteCallMarker"),e.consume(p),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",f)}function f(p){if(s>999||p===93&&!a||p===null||p===91||Sn(p))return n(p);if(p===93){e.exit("chunkString");const y=e.exit("gfmFootnoteCallString");return i.includes(ao(r.sliceSerialize(y)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(p),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(p)}return Sn(p)||(a=!0),s++,e.consume(p),p===92?m:f}function m(p){return p===91||p===92||p===93?(e.consume(p),s++,f):f(p)}}function oce(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s,a=0,c;return u;function u(b){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(b),e.exit("gfmFootnoteDefinitionLabelMarker"),f}function f(b){return b===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(b),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",m):n(b)}function m(b){if(a>999||b===93&&!c||b===null||b===91||Sn(b))return n(b);if(b===93){e.exit("chunkString");const S=e.exit("gfmFootnoteDefinitionLabelString");return s=ao(r.sliceSerialize(S)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(b),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),y}return Sn(b)||(c=!0),a++,e.consume(b),b===92?p:m}function p(b){return b===91||b===92||b===93?(e.consume(b),a++,m):m(b)}function y(b){return b===58?(e.enter("definitionMarker"),e.consume(b),e.exit("definitionMarker"),i.includes(s)||i.push(s),Jt(e,x,"gfmFootnoteDefinitionWhitespace")):n(b)}function x(b){return t(b)}}function sce(e,t,n){return e.check(Wf,t,e.attempt(ece,t,n))}function ace(e){e.exit("gfmFootnoteDefinition")}function lce(e,t,n){const r=this;return Jt(e,i,"gfmFootnoteDefinitionIndent",5);function i(s){const a=r.events[r.events.length-1];return a&&a[1].type==="gfmFootnoteDefinitionIndent"&&a[2].sliceSerialize(a[1],!0).length===4?t(s):n(s)}}function cce(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:s,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(a,c){let u=-1;for(;++u<a.length;)if(a[u][0]==="enter"&&a[u][1].type==="strikethroughSequenceTemporary"&&a[u][1]._close){let f=u;for(;f--;)if(a[f][0]==="exit"&&a[f][1].type==="strikethroughSequenceTemporary"&&a[f][1]._open&&a[u][1].end.offset-a[u][1].start.offset===a[f][1].end.offset-a[f][1].start.offset){a[u][1].type="strikethroughSequence",a[f][1].type="strikethroughSequence";const m={type:"strikethrough",start:Object.assign({},a[f][1].start),end:Object.assign({},a[u][1].end)},p={type:"strikethroughText",start:Object.assign({},a[f][1].end),end:Object.assign({},a[u][1].start)},y=[["enter",m,c],["enter",a[f][1],c],["exit",a[f][1],c],["enter",p,c]],x=c.parser.constructs.insideSpan.null;x&&bi(y,y.length,0,H0(x,a.slice(f+1,u),c)),bi(y,y.length,0,[["exit",p,c],["enter",a[u][1],c],["exit",a[u][1],c],["exit",m,c]]),bi(a,f-1,u-f+3,y),u=f+y.length-2;break}}for(u=-1;++u<a.length;)a[u][1].type==="strikethroughSequenceTemporary"&&(a[u][1].type="data");return a}function s(a,c,u){const f=this.previous,m=this.events;let p=0;return y;function y(b){return f===126&&m[m.length-1][1].type!=="characterEscape"?u(b):(a.enter("strikethroughSequenceTemporary"),x(b))}function x(b){const S=Qc(f);if(b===126)return p>1?u(b):(a.consume(b),p++,x);if(p<2&&!n)return u(b);const k=a.exit("strikethroughSequenceTemporary"),E=Qc(b);return k._open=!E||E===2&&!!S,k._close=!S||S===2&&!!E,c(b)}}}class uce{constructor(){this.map=[]}add(t,n,r){dce(this,t,n,r)}consume(t){if(this.map.sort(function(s,a){return s[0]-a[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let i=r.pop();for(;i;){for(const s of i)t.push(s);i=r.pop()}this.map.length=0}}function dce(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function fce(e,t){let n=!1;const r=[];for(;t<e.length;){const i=e[t];if(n){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const s=r.length-1;r[s]=r[s]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function hce(){return{flow:{null:{name:"table",tokenize:pce,resolveAll:mce}}}}function pce(e,t,n){const r=this;let i=0,s=0,a;return c;function c(I){let U=r.events.length-1;for(;U>-1;){const q=r.events[U][1].type;if(q==="lineEnding"||q==="linePrefix")U--;else break}const Y=U>-1?r.events[U][1].type:null,V=Y==="tableHead"||Y==="tableRow"?A:u;return V===A&&r.parser.lazy[r.now().line]?n(I):V(I)}function u(I){return e.enter("tableHead"),e.enter("tableRow"),f(I)}function f(I){return I===124||(a=!0,s+=1),m(I)}function m(I){return I===null?n(I):mt(I)?s>1?(s=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(I),e.exit("lineEnding"),x):n(I):_t(I)?Jt(e,m,"whitespace")(I):(s+=1,a&&(a=!1,i+=1),I===124?(e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),a=!0,m):(e.enter("data"),p(I)))}function p(I){return I===null||I===124||Sn(I)?(e.exit("data"),m(I)):(e.consume(I),I===92?y:p)}function y(I){return I===92||I===124?(e.consume(I),p):p(I)}function x(I){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(I):(e.enter("tableDelimiterRow"),a=!1,_t(I)?Jt(e,b,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(I):b(I))}function b(I){return I===45||I===58?k(I):I===124?(a=!0,e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),S):O(I)}function S(I){return _t(I)?Jt(e,k,"whitespace")(I):k(I)}function k(I){return I===58?(s+=1,a=!0,e.enter("tableDelimiterMarker"),e.consume(I),e.exit("tableDelimiterMarker"),E):I===45?(s+=1,E(I)):I===null||mt(I)?j(I):O(I)}function E(I){return I===45?(e.enter("tableDelimiterFiller"),T(I)):O(I)}function T(I){return I===45?(e.consume(I),T):I===58?(a=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(I),e.exit("tableDelimiterMarker"),N):(e.exit("tableDelimiterFiller"),N(I))}function N(I){return _t(I)?Jt(e,j,"whitespace")(I):j(I)}function j(I){return I===124?b(I):I===null||mt(I)?!a||i!==s?O(I):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(I)):O(I)}function O(I){return n(I)}function A(I){return e.enter("tableRow"),R(I)}function R(I){return I===124?(e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),R):I===null||mt(I)?(e.exit("tableRow"),t(I)):_t(I)?Jt(e,R,"whitespace")(I):(e.enter("data"),L(I))}function L(I){return I===null||I===124||Sn(I)?(e.exit("data"),R(I)):(e.consume(I),I===92?B:L)}function B(I){return I===92||I===124?(e.consume(I),L):L(I)}}function mce(e,t){let n=-1,r=!0,i=0,s=[0,0,0,0],a=[0,0,0,0],c=!1,u=0,f,m,p;const y=new uce;for(;++n<e.length;){const x=e[n],b=x[1];x[0]==="enter"?b.type==="tableHead"?(c=!1,u!==0&&(ST(y,t,u,f,m),m=void 0,u=0),f={type:"table",start:Object.assign({},b.start),end:Object.assign({},b.end)},y.add(n,0,[["enter",f,t]])):b.type==="tableRow"||b.type==="tableDelimiterRow"?(r=!0,p=void 0,s=[0,0,0,0],a=[0,n+1,0,0],c&&(c=!1,m={type:"tableBody",start:Object.assign({},b.start),end:Object.assign({},b.end)},y.add(n,0,[["enter",m,t]])),i=b.type==="tableDelimiterRow"?2:m?3:1):i&&(b.type==="data"||b.type==="tableDelimiterMarker"||b.type==="tableDelimiterFiller")?(r=!1,a[2]===0&&(s[1]!==0&&(a[0]=a[1],p=Bp(y,t,s,i,void 0,p),s=[0,0,0,0]),a[2]=n)):b.type==="tableCellDivider"&&(r?r=!1:(s[1]!==0&&(a[0]=a[1],p=Bp(y,t,s,i,void 0,p)),s=a,a=[s[1],n,0,0])):b.type==="tableHead"?(c=!0,u=n):b.type==="tableRow"||b.type==="tableDelimiterRow"?(u=n,s[1]!==0?(a[0]=a[1],p=Bp(y,t,s,i,n,p)):a[1]!==0&&(p=Bp(y,t,a,i,n,p)),i=0):i&&(b.type==="data"||b.type==="tableDelimiterMarker"||b.type==="tableDelimiterFiller")&&(a[3]=n)}for(u!==0&&ST(y,t,u,f,m),y.consume(t.events),n=-1;++n<t.events.length;){const x=t.events[n];x[0]==="enter"&&x[1].type==="table"&&(x[1]._align=fce(t.events,n))}return e}function Bp(e,t,n,r,i,s){const a=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",c="tableContent";n[0]!==0&&(s.end=Object.assign({},wc(t.events,n[0])),e.add(n[0],0,[["exit",s,t]]));const u=wc(t.events,n[1]);if(s={type:a,start:Object.assign({},u),end:Object.assign({},u)},e.add(n[1],0,[["enter",s,t]]),n[2]!==0){const f=wc(t.events,n[2]),m=wc(t.events,n[3]),p={type:c,start:Object.assign({},f),end:Object.assign({},m)};if(e.add(n[2],0,[["enter",p,t]]),r!==2){const y=t.events[n[2]],x=t.events[n[3]];if(y[1].end=Object.assign({},x[1].end),y[1].type="chunkText",y[1].contentType="text",n[3]>n[2]+1){const b=n[2]+1,S=n[3]-n[2]-1;e.add(b,S,[])}}e.add(n[3]+1,0,[["exit",p,t]])}return i!==void 0&&(s.end=Object.assign({},wc(t.events,i)),e.add(i,0,[["exit",s,t]]),s=void 0),s}function ST(e,t,n,r,i){const s=[],a=wc(t.events,n);i&&(i.end=Object.assign({},a),s.push(["exit",i,t])),r.end=Object.assign({},a),s.push(["exit",r,t]),e.add(n+1,0,s)}function wc(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const gce={name:"tasklistCheck",tokenize:xce};function yce(){return{text:{91:gce}}}function xce(e,t,n){const r=this;return i;function i(u){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(u):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(u),e.exit("taskListCheckMarker"),s)}function s(u){return Sn(u)?(e.enter("taskListCheckValueUnchecked"),e.consume(u),e.exit("taskListCheckValueUnchecked"),a):u===88||u===120?(e.enter("taskListCheckValueChecked"),e.consume(u),e.exit("taskListCheckValueChecked"),a):n(u)}function a(u){return u===93?(e.enter("taskListCheckMarker"),e.consume(u),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),c):n(u)}function c(u){return mt(u)?t(u):_t(u)?e.check({tokenize:bce},t,n)(u):n(u)}}function bce(e,t,n){return Jt(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function vce(e){return U9([$le(),tce(),cce(e),hce(),yce()])}const wce={};function D7(e){const t=this,n=e||wce,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),s=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),a=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(vce(n)),s.push(Hle()),a.push(Ule(n))}function Sce(e){return e.includes("<<<<<<<")&&e.includes("=======")&&e.includes(">>>>>>>")}function Cce(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function kce(e,t){if(e==null)return{};var n,r,i=Cce(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Hx(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Ece(e){if(Array.isArray(e))return Hx(e)}function Tce(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Nce(e,t){if(e){if(typeof e=="string")return Hx(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Hx(e,t):void 0}}function Rce(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
118
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ux(e){return Ece(e)||Tce(e)||Nce(e)||Rce()}function gf(e){"@babel/helpers - typeof";return gf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},gf(e)}function Ace(e,t){if(gf(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(gf(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Oce(e){var t=Ace(e,"string");return gf(t)=="symbol"?t:t+""}function _7(e,t,n){return(t=Oce(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Vx(){return Vx=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Vx.apply(null,arguments)}function CT(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Tc(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?CT(Object(n),!0).forEach(function(r){_7(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):CT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function jce(e){var t=e.length;if(t===0||t===1)return e;if(t===2)return[e[0],e[1],"".concat(e[0],".").concat(e[1]),"".concat(e[1],".").concat(e[0])];if(t===3)return[e[0],e[1],e[2],"".concat(e[0],".").concat(e[1]),"".concat(e[0],".").concat(e[2]),"".concat(e[1],".").concat(e[0]),"".concat(e[1],".").concat(e[2]),"".concat(e[2],".").concat(e[0]),"".concat(e[2],".").concat(e[1]),"".concat(e[0],".").concat(e[1],".").concat(e[2]),"".concat(e[0],".").concat(e[2],".").concat(e[1]),"".concat(e[1],".").concat(e[0],".").concat(e[2]),"".concat(e[1],".").concat(e[2],".").concat(e[0]),"".concat(e[2],".").concat(e[0],".").concat(e[1]),"".concat(e[2],".").concat(e[1],".").concat(e[0])];if(t>=4)return[e[0],e[1],e[2],e[3],"".concat(e[0],".").concat(e[1]),"".concat(e[0],".").concat(e[2]),"".concat(e[0],".").concat(e[3]),"".concat(e[1],".").concat(e[0]),"".concat(e[1],".").concat(e[2]),"".concat(e[1],".").concat(e[3]),"".concat(e[2],".").concat(e[0]),"".concat(e[2],".").concat(e[1]),"".concat(e[2],".").concat(e[3]),"".concat(e[3],".").concat(e[0]),"".concat(e[3],".").concat(e[1]),"".concat(e[3],".").concat(e[2]),"".concat(e[0],".").concat(e[1],".").concat(e[2]),"".concat(e[0],".").concat(e[1],".").concat(e[3]),"".concat(e[0],".").concat(e[2],".").concat(e[1]),"".concat(e[0],".").concat(e[2],".").concat(e[3]),"".concat(e[0],".").concat(e[3],".").concat(e[1]),"".concat(e[0],".").concat(e[3],".").concat(e[2]),"".concat(e[1],".").concat(e[0],".").concat(e[2]),"".concat(e[1],".").concat(e[0],".").concat(e[3]),"".concat(e[1],".").concat(e[2],".").concat(e[0]),"".concat(e[1],".").concat(e[2],".").concat(e[3]),"".concat(e[1],".").concat(e[3],".").concat(e[0]),"".concat(e[1],".").concat(e[3],".").concat(e[2]),"".concat(e[2],".").concat(e[0],".").concat(e[1]),"".concat(e[2],".").concat(e[0],".").concat(e[3]),"".concat(e[2],".").concat(e[1],".").concat(e[0]),"".concat(e[2],".").concat(e[1],".").concat(e[3]),"".concat(e[2],".").concat(e[3],".").concat(e[0]),"".concat(e[2],".").concat(e[3],".").concat(e[1]),"".concat(e[3],".").concat(e[0],".").concat(e[1]),"".concat(e[3],".").concat(e[0],".").concat(e[2]),"".concat(e[3],".").concat(e[1],".").concat(e[0]),"".concat(e[3],".").concat(e[1],".").concat(e[2]),"".concat(e[3],".").concat(e[2],".").concat(e[0]),"".concat(e[3],".").concat(e[2],".").concat(e[1]),"".concat(e[0],".").concat(e[1],".").concat(e[2],".").concat(e[3]),"".concat(e[0],".").concat(e[1],".").concat(e[3],".").concat(e[2]),"".concat(e[0],".").concat(e[2],".").concat(e[1],".").concat(e[3]),"".concat(e[0],".").concat(e[2],".").concat(e[3],".").concat(e[1]),"".concat(e[0],".").concat(e[3],".").concat(e[1],".").concat(e[2]),"".concat(e[0],".").concat(e[3],".").concat(e[2],".").concat(e[1]),"".concat(e[1],".").concat(e[0],".").concat(e[2],".").concat(e[3]),"".concat(e[1],".").concat(e[0],".").concat(e[3],".").concat(e[2]),"".concat(e[1],".").concat(e[2],".").concat(e[0],".").concat(e[3]),"".concat(e[1],".").concat(e[2],".").concat(e[3],".").concat(e[0]),"".concat(e[1],".").concat(e[3],".").concat(e[0],".").concat(e[2]),"".concat(e[1],".").concat(e[3],".").concat(e[2],".").concat(e[0]),"".concat(e[2],".").concat(e[0],".").concat(e[1],".").concat(e[3]),"".concat(e[2],".").concat(e[0],".").concat(e[3],".").concat(e[1]),"".concat(e[2],".").concat(e[1],".").concat(e[0],".").concat(e[3]),"".concat(e[2],".").concat(e[1],".").concat(e[3],".").concat(e[0]),"".concat(e[2],".").concat(e[3],".").concat(e[0],".").concat(e[1]),"".concat(e[2],".").concat(e[3],".").concat(e[1],".").concat(e[0]),"".concat(e[3],".").concat(e[0],".").concat(e[1],".").concat(e[2]),"".concat(e[3],".").concat(e[0],".").concat(e[2],".").concat(e[1]),"".concat(e[3],".").concat(e[1],".").concat(e[0],".").concat(e[2]),"".concat(e[3],".").concat(e[1],".").concat(e[2],".").concat(e[0]),"".concat(e[3],".").concat(e[2],".").concat(e[0],".").concat(e[1]),"".concat(e[3],".").concat(e[2],".").concat(e[1],".").concat(e[0])]}var yy={};function Mce(e){if(e.length===0||e.length===1)return e;var t=e.join(".");return yy[t]||(yy[t]=jce(e)),yy[t]}function Dce(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0,r=e.filter(function(s){return s!=="token"}),i=Mce(r);return i.reduce(function(s,a){return Tc(Tc({},s),n[a])},t)}function kT(e){return e.join(" ")}function _ce(e,t){var n=0;return function(r){return n+=1,r.map(function(i,s){return L7({node:i,stylesheet:e,useInlineStyles:t,key:"code-segment-".concat(n,"-").concat(s)})})}}function L7(e){var t=e.node,n=e.stylesheet,r=e.style,i=r===void 0?{}:r,s=e.useInlineStyles,a=e.key,c=t.properties,u=t.type,f=t.tagName,m=t.value;if(u==="text")return m;if(f){var p=_ce(n,s),y;if(!s)y=Tc(Tc({},c),{},{className:kT(c.className)});else{var x=Object.keys(n).reduce(function(E,T){return T.split(".").forEach(function(N){E.includes(N)||E.push(N)}),E},[]),b=c.className&&c.className.includes("token")?["token"]:[],S=c.className&&b.concat(c.className.filter(function(E){return!x.includes(E)}));y=Tc(Tc({},c),{},{className:kT(S)||void 0,style:Dce(c.className,Object.assign({},c.style,i),n)})}var k=p(t.children);return le.createElement(f,Vx({key:a},y),k)}}const Lce=(function(e,t){var n=e.listLanguages();return n.indexOf(t)!==-1});var Ice=["language","children","style","customStyle","codeTagProps","useInlineStyles","showLineNumbers","showInlineLineNumbers","startingLineNumber","lineNumberContainerStyle","lineNumberStyle","wrapLines","wrapLongLines","lineProps","renderer","PreTag","CodeTag","code","astGenerator"];function ET(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function ua(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ET(Object(n),!0).forEach(function(r){_7(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ET(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var Pce=/\n/g;function zce(e){return e.match(Pce)}function Fce(e){var t=e.lines,n=e.startingLineNumber,r=e.style;return t.map(function(i,s){var a=s+n;return le.createElement("span",{key:"line-".concat(s),className:"react-syntax-highlighter-line-number",style:typeof r=="function"?r(a):r},"".concat(a,`
119
+ `))})}function Bce(e){var t=e.codeString,n=e.codeStyle,r=e.containerStyle,i=r===void 0?{float:"left",paddingRight:"10px"}:r,s=e.numberStyle,a=s===void 0?{}:s,c=e.startingLineNumber;return le.createElement("code",{style:Object.assign({},n,i)},Fce({lines:t.replace(/\n$/,"").split(`
120
+ `),style:a,startingLineNumber:c}))}function Hce(e){return"".concat(e.toString().length,".25em")}function I7(e,t){return{type:"element",tagName:"span",properties:{key:"line-number--".concat(e),className:["comment","linenumber","react-syntax-highlighter-line-number"],style:t},children:[{type:"text",value:e}]}}function P7(e,t,n){var r={display:"inline-block",minWidth:Hce(n),paddingRight:"1em",textAlign:"right",userSelect:"none"},i=typeof e=="function"?e(t):e,s=ua(ua({},r),i);return s}function hm(e){var t=e.children,n=e.lineNumber,r=e.lineNumberStyle,i=e.largestLineNumber,s=e.showInlineLineNumbers,a=e.lineProps,c=a===void 0?{}:a,u=e.className,f=u===void 0?[]:u,m=e.showLineNumbers,p=e.wrapLongLines,y=e.wrapLines,x=y===void 0?!1:y,b=x?ua({},typeof c=="function"?c(n):c):{};if(b.className=b.className?[].concat(Ux(b.className.trim().split(/\s+/)),Ux(f)):f,n&&s){var S=P7(r,n,i);t.unshift(I7(n,S))}return p&m&&(b.style=ua({display:"flex"},b.style)),{type:"element",tagName:"span",properties:b,children:t}}function z7(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];e.length===void 0&&(e=[e]);for(var r=0;r<e.length;r++){var i=e[r];if(i.type==="text")n.push(hm({children:[i],className:Ux(new Set(t))}));else if(i.children){var s,a=t.concat(((s=i.properties)===null||s===void 0?void 0:s.className)||[]);z7(i.children,a).forEach(function(c){return n.push(c)})}}return n}function Uce(e,t,n,r,i,s,a,c,u){var f,m=z7(e.value),p=[],y=-1,x=0;function b(O,A){var R=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];return hm({children:O,lineNumber:A,lineNumberStyle:c,largestLineNumber:a,showInlineLineNumbers:i,lineProps:n,className:R,showLineNumbers:r,wrapLongLines:u,wrapLines:t})}function S(O,A){if(r&&A&&i){var R=P7(c,A,a);O.unshift(I7(A,R))}return O}function k(O,A){var R=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];return t||R.length>0?b(O,A,R):S(O,A)}for(var E=function(){var A=m[x],R=A.children[0].value,L=zce(R);if(L){var B=R.split(`
121
+ `);B.forEach(function(I,U){var Y=r&&p.length+s,V={type:"text",value:"".concat(I,`
122
+ `)};if(U===0){var q=m.slice(y+1,x).concat(hm({children:[V],className:A.properties.className})),H=k(q,Y);p.push(H)}else if(U===B.length-1){var z=m[x+1]&&m[x+1].children&&m[x+1].children[0],$={type:"text",value:"".concat(I)};if(z){var G=hm({children:[$],className:A.properties.className});m.splice(x+1,0,G)}else{var Q=[$],_=k(Q,Y,A.properties.className);p.push(_)}}else{var P=[V],W=k(P,Y,A.properties.className);p.push(W)}}),y=x}x++};x<m.length;)E();if(y!==m.length-1){var T=m.slice(y+1,m.length);if(T&&T.length){var N=r&&p.length+s,j=k(T,N);p.push(j)}}return t?p:(f=[]).concat.apply(f,p)}function Vce(e){var t=e.rows,n=e.stylesheet,r=e.useInlineStyles;return t.map(function(i,s){return L7({node:i,stylesheet:n,useInlineStyles:r,key:"code-segment-".concat(s)})})}function F7(e){return e&&typeof e.highlightAuto<"u"}function qce(e){var t=e.astGenerator,n=e.language,r=e.code,i=e.defaultCodeValue;if(F7(t)){var s=Lce(t,n);return n==="text"?{value:i,language:"text"}:s?t.highlight(n,r):t.highlightAuto(r)}try{return n&&n!=="text"?{value:t.highlight(r,n)}:{value:i}}catch{return{value:i}}}function $ce(e,t){return function(r){var i,s,a=r.language,c=r.children,u=r.style,f=u===void 0?t:u,m=r.customStyle,p=m===void 0?{}:m,y=r.codeTagProps,x=y===void 0?{className:a?"language-".concat(a):void 0,style:ua(ua({},f['code[class*="language-"]']),f['code[class*="language-'.concat(a,'"]')])}:y,b=r.useInlineStyles,S=b===void 0?!0:b,k=r.showLineNumbers,E=k===void 0?!1:k,T=r.showInlineLineNumbers,N=T===void 0?!0:T,j=r.startingLineNumber,O=j===void 0?1:j,A=r.lineNumberContainerStyle,R=r.lineNumberStyle,L=R===void 0?{}:R,B=r.wrapLines,I=r.wrapLongLines,U=I===void 0?!1:I,Y=r.lineProps,V=Y===void 0?{}:Y,q=r.renderer,H=r.PreTag,z=H===void 0?"pre":H,$=r.CodeTag,G=$===void 0?"code":$,Q=r.code,_=Q===void 0?(Array.isArray(c)?c[0]:c)||"":Q,P=r.astGenerator,W=kce(r,Ice);P=P||e;var D=E?le.createElement(Bce,{containerStyle:A,codeStyle:x.style||{},numberStyle:L,startingLineNumber:O,codeString:_}):null,Z=f.hljs||f['pre[class*="language-"]']||{backgroundColor:"#fff"},ee=F7(P)?"hljs":"prismjs",J=S?Object.assign({},W,{style:Object.assign({},Z,p)}):Object.assign({},W,{className:W.className?"".concat(ee," ").concat(W.className):ee,style:Object.assign({},p)});if(U?x.style=ua({whiteSpace:"pre-wrap"},x.style):x.style=ua({whiteSpace:"pre"},x.style),!P)return le.createElement(z,J,D,le.createElement(G,x,_));(B===void 0&&q||U)&&(B=!0),q=q||Vce;var he=[{type:"text",value:_}],fe=qce({astGenerator:P,language:a,code:_,defaultCodeValue:he});fe.language===null&&(fe.value=he);var Se=(i=(s=_.match(/\n/g))===null||s===void 0?void 0:s.length)!==null&&i!==void 0?i:0,Ae=O+Se,Oe=Uce(fe,B,V,E,N,O,Ae,L,U);return le.createElement(z,J,le.createElement(G,x,!N&&D,q({rows:Oe,stylesheet:f,useInlineStyles:S})))}}const TT=/[#.]/g;function Yce(e,t){const n=e||"",r={};let i=0,s,a;for(;i<n.length;){TT.lastIndex=i;const c=TT.exec(n),u=n.slice(i,c?c.index:n.length);u&&(s?s==="#"?r.id=u:Array.isArray(r.className)?r.className.push(u):r.className=[u]:a=u,i+=u.length),c&&(s=c[0],i++)}return{type:"element",tagName:a||t||"div",properties:r,children:[]}}function B7(e,t,n){const r=n?Qce(n):void 0;function i(s,a,...c){let u;if(s==null){u={type:"root",children:[]};const f=a;c.unshift(f)}else{u=Yce(s,t);const f=u.tagName.toLowerCase(),m=r?r.get(f):void 0;if(u.tagName=m||f,Wce(a))c.unshift(a);else for(const[p,y]of Object.entries(a))Gce(e,u.properties,p,y)}for(const f of c)qx(u.children,f);return u.type==="element"&&u.tagName==="template"&&(u.content={type:"root",children:u.children},u.children=[]),u}return i}function Wce(e){if(e===null||typeof e!="object"||Array.isArray(e))return!0;if(typeof e.type!="string")return!1;const t=e,n=Object.keys(e);for(const r of n){const i=t[r];if(i&&typeof i=="object"){if(!Array.isArray(i))return!0;const s=i;for(const a of s)if(typeof a!="number"&&typeof a!="string")return!0}}return!!("children"in e&&Array.isArray(e.children))}function Gce(e,t,n,r){const i=D9(e,n);let s;if(r!=null){if(typeof r=="number"){if(Number.isNaN(r))return;s=r}else typeof r=="boolean"?s=r:typeof r=="string"?i.spaceSeparated?s=D4(r):i.commaSeparated?s=R4(r):i.commaOrSpaceSeparated?s=D4(R4(r).join(" ")):s=NT(i,i.property,r):Array.isArray(r)?s=[...r]:s=i.property==="style"?Kce(r):String(r);if(Array.isArray(s)){const a=[];for(const c of s)a.push(NT(i,i.property,c));s=a}i.property==="className"&&Array.isArray(t.className)&&(s=t.className.concat(s)),t[i.property]=s}}function qx(e,t){if(t!=null)if(typeof t=="number"||typeof t=="string")e.push({type:"text",value:String(t)});else if(Array.isArray(t))for(const n of t)qx(e,n);else if(typeof t=="object"&&"type"in t)t.type==="root"?qx(e,t.children):e.push(t);else throw new Error("Expected node, nodes, or string, got `"+t+"`")}function NT(e,t,n){if(typeof n=="string"){if(e.number&&n&&!Number.isNaN(Number(n)))return Number(n);if((e.boolean||e.overloadedBoolean)&&(n===""||ff(n)===ff(t)))return!0}return n}function Kce(e){const t=[];for(const[n,r]of Object.entries(e))t.push([n,r].join(": "));return t.join("; ")}function Qce(e){const t=new Map;for(const n of e)t.set(n.toLowerCase(),n);return t}const Xce=["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","solidColor","textArea","textPath"],Zce=B7(_9,"div");B7(F0,"g",Xce);const Jce=["AElig","AMP","Aacute","Acirc","Agrave","Aring","Atilde","Auml","COPY","Ccedil","ETH","Eacute","Ecirc","Egrave","Euml","GT","Iacute","Icirc","Igrave","Iuml","LT","Ntilde","Oacute","Ocirc","Ograve","Oslash","Otilde","Ouml","QUOT","REG","THORN","Uacute","Ucirc","Ugrave","Uuml","Yacute","aacute","acirc","acute","aelig","agrave","amp","aring","atilde","auml","brvbar","ccedil","cedil","cent","copy","curren","deg","divide","eacute","ecirc","egrave","eth","euml","frac12","frac14","frac34","gt","iacute","icirc","iexcl","igrave","iquest","iuml","laquo","lt","macr","micro","middot","nbsp","not","ntilde","oacute","ocirc","ograve","ordf","ordm","oslash","otilde","ouml","para","plusmn","pound","quot","raquo","reg","sect","shy","sup1","sup2","sup3","szlig","thorn","times","uacute","ucirc","ugrave","uml","uuml","yacute","yen","yuml"],RT={0:"�",128:"€",130:"‚",131:"ƒ",132:"„",133:"…",134:"†",135:"‡",136:"ˆ",137:"‰",138:"Š",139:"‹",140:"Œ",142:"Ž",145:"‘",146:"’",147:"“",148:"”",149:"•",150:"–",151:"—",152:"˜",153:"™",154:"š",155:"›",156:"œ",158:"ž",159:"Ÿ"};function H7(e){const t=typeof e=="string"?e.charCodeAt(0):e;return t>=48&&t<=57}function eue(e){const t=typeof e=="string"?e.charCodeAt(0):e;return t>=97&&t<=102||t>=65&&t<=70||t>=48&&t<=57}function tue(e){const t=typeof e=="string"?e.charCodeAt(0):e;return t>=97&&t<=122||t>=65&&t<=90}function AT(e){return tue(e)||H7(e)}const nue=["","Named character references must be terminated by a semicolon","Numeric character references must be terminated by a semicolon","Named character references cannot be empty","Numeric character references cannot be empty","Named character references must be known","Numeric character references cannot be disallowed","Numeric character references cannot be outside the permissible Unicode range"];function rue(e,t){const n={},r=typeof n.additional=="string"?n.additional.charCodeAt(0):n.additional,i=[];let s=0,a=-1,c="",u,f;n.position&&("start"in n.position||"indent"in n.position?(f=n.position.indent,u=n.position.start):u=n.position);let m=(u?u.line:0)||1,p=(u?u.column:0)||1,y=b(),x;for(s--;++s<=e.length;)if(x===10&&(p=(f?f[a]:0)||1),x=e.charCodeAt(s),x===38){const E=e.charCodeAt(s+1);if(E===9||E===10||E===12||E===32||E===38||E===60||Number.isNaN(E)||r&&E===r){c+=String.fromCharCode(x),p++;continue}const T=s+1;let N=T,j=T,O;if(E===35){j=++N;const V=e.charCodeAt(j);V===88||V===120?(O="hexadecimal",j=++N):O="decimal"}else O="named";let A="",R="",L="";const B=O==="named"?AT:O==="decimal"?H7:eue;for(j--;++j<=e.length;){const V=e.charCodeAt(j);if(!B(V))break;L+=String.fromCharCode(V),O==="named"&&Jce.includes(L)&&(A=L,R=pf(L))}let I=e.charCodeAt(j)===59;if(I){j++;const V=O==="named"?pf(L):!1;V&&(A=L,R=V)}let U=1+j-T,Y="";if(!(!I&&n.nonTerminated===!1))if(!L)O!=="named"&&S(4,U);else if(O==="named"){if(I&&!R)S(5,1);else if(A!==L&&(j=N+A.length,U=1+j-N,I=!1),!I){const V=A?1:3;if(n.attribute){const q=e.charCodeAt(j);q===61?(S(V,U),R=""):AT(q)?R="":S(V,U)}else S(V,U)}Y=R}else{I||S(2,U);let V=Number.parseInt(L,O==="hexadecimal"?16:10);if(iue(V))S(7,U),Y="�";else if(V in RT)S(6,U),Y=RT[V];else{let q="";oue(V)&&S(6,U),V>65535&&(V-=65536,q+=String.fromCharCode(V>>>10|55296),V=56320|V&1023),Y=q+String.fromCharCode(V)}}if(Y){k(),y=b(),s=j-1,p+=j-T+1,i.push(Y);const V=b();V.offset++,n.reference&&n.reference.call(n.referenceContext||void 0,Y,{start:y,end:V},e.slice(T-1,j)),y=V}else L=e.slice(T-1,j),c+=L,p+=L.length,s=j-1}else x===10&&(m++,a++,p=0),Number.isNaN(x)?k():(c+=String.fromCharCode(x),p++);return i.join("");function b(){return{line:m,column:p,offset:s+((u?u.offset:0)||0)}}function S(E,T){let N;n.warning&&(N=b(),N.column+=T,N.offset+=T,n.warning.call(n.warningContext||void 0,nue[E],N,E))}function k(){c&&(i.push(c),n.text&&n.text.call(n.textContext||void 0,c,{start:y,end:b()}),c="")}}function iue(e){return e>=55296&&e<=57343||e>1114111}function oue(e){return e>=1&&e<=8||e===11||e>=13&&e<=31||e>=127&&e<=159||e>=64976&&e<=65007||(e&65535)===65535||(e&65535)===65534}var sue=0,Hp={},hr={util:{type:function(e){return Object.prototype.toString.call(e).slice(8,-1)},objId:function(e){return e.__id||Object.defineProperty(e,"__id",{value:++sue}),e.__id},clone:function e(t,n){n=n||{};var r,i;switch(hr.util.type(t)){case"Object":if(i=hr.util.objId(t),n[i])return n[i];r={},n[i]=r;for(var s in t)t.hasOwnProperty(s)&&(r[s]=e(t[s],n));return r;case"Array":return i=hr.util.objId(t),n[i]?n[i]:(r=[],n[i]=r,t.forEach(function(a,c){r[c]=e(a,n)}),r);default:return t}}},languages:{plain:Hp,plaintext:Hp,text:Hp,txt:Hp,extend:function(e,t){var n=hr.util.clone(hr.languages[e]);for(var r in t)n[r]=t[r];return n},insertBefore:function(e,t,n,r){r=r||hr.languages;var i=r[e],s={};for(var a in i)if(i.hasOwnProperty(a)){if(a==t)for(var c in n)n.hasOwnProperty(c)&&(s[c]=n[c]);n.hasOwnProperty(a)||(s[a]=i[a])}var u=r[e];return r[e]=s,hr.languages.DFS(hr.languages,function(f,m){m===u&&f!=e&&(this[f]=s)}),s},DFS:function e(t,n,r,i){i=i||{};var s=hr.util.objId;for(var a in t)if(t.hasOwnProperty(a)){n.call(t,a,t[a],r||a);var c=t[a],u=hr.util.type(c);u==="Object"&&!i[s(c)]?(i[s(c)]=!0,e(c,n,null,i)):u==="Array"&&!i[s(c)]&&(i[s(c)]=!0,e(c,n,a,i))}}},plugins:{},highlight:function(e,t,n){var r={code:e,grammar:t,language:n};if(hr.hooks.run("before-tokenize",r),!r.grammar)throw new Error('The language "'+r.language+'" has no grammar.');return r.tokens=hr.tokenize(r.code,r.grammar),hr.hooks.run("after-tokenize",r),qd.stringify(hr.util.encode(r.tokens),r.language)},tokenize:function(e,t){var n=t.rest;if(n){for(var r in n)t[r]=n[r];delete t.rest}var i=new aue;return pm(i,i.head,e),U7(e,i,t,i.head,0),cue(i)},hooks:{all:{},add:function(e,t){var n=hr.hooks.all;n[e]=n[e]||[],n[e].push(t)},run:function(e,t){var n=hr.hooks.all[e];if(!(!n||!n.length))for(var r=0,i;i=n[r++];)i(t)}},Token:qd};function qd(e,t,n,r){this.type=e,this.content=t,this.alias=n,this.length=(r||"").length|0}function OT(e,t,n,r){e.lastIndex=t;var i=e.exec(n);if(i&&r&&i[1]){var s=i[1].length;i.index+=s,i[0]=i[0].slice(s)}return i}function U7(e,t,n,r,i,s){for(var a in n)if(!(!n.hasOwnProperty(a)||!n[a])){var c=n[a];c=Array.isArray(c)?c:[c];for(var u=0;u<c.length;++u){if(s&&s.cause==a+","+u)return;var f=c[u],m=f.inside,p=!!f.lookbehind,y=!!f.greedy,x=f.alias;if(y&&!f.pattern.global){var b=f.pattern.toString().match(/[imsuy]*$/)[0];f.pattern=RegExp(f.pattern.source,b+"g")}for(var S=f.pattern||f,k=r.next,E=i;k!==t.tail&&!(s&&E>=s.reach);E+=k.value.length,k=k.next){var T=k.value;if(t.length>e.length)return;if(!(T instanceof qd)){var N=1,j;if(y){if(j=OT(S,E,e,p),!j||j.index>=e.length)break;var L=j.index,O=j.index+j[0].length,A=E;for(A+=k.value.length;L>=A;)k=k.next,A+=k.value.length;if(A-=k.value.length,E=A,k.value instanceof qd)continue;for(var R=k;R!==t.tail&&(A<O||typeof R.value=="string");R=R.next)N++,A+=R.value.length;N--,T=e.slice(E,A),j.index-=E}else if(j=OT(S,0,T,p),!j)continue;var L=j.index,B=j[0],I=T.slice(0,L),U=T.slice(L+B.length),Y=E+T.length;s&&Y>s.reach&&(s.reach=Y);var V=k.prev;I&&(V=pm(t,V,I),E+=I.length),lue(t,V,N);var q=new qd(a,m?hr.tokenize(B,m):B,x,B);if(k=pm(t,V,q),U&&pm(t,k,U),N>1){var H={cause:a+","+u,reach:Y};U7(e,t,n,k.prev,E,H),s&&H.reach>s.reach&&(s.reach=H.reach)}}}}}}function aue(){var e={value:null,prev:null,next:null},t={value:null,prev:e,next:null};e.next=t,this.head=e,this.tail=t,this.length=0}function pm(e,t,n){var r=t.next,i={value:n,prev:t,next:r};return t.next=i,r.prev=i,e.length++,i}function lue(e,t,n){for(var r=t.next,i=0;i<n&&r!==e.tail;i++)r=r.next;t.next=r,r.prev=t,e.length-=i}function cue(e){for(var t=[],n=e.head.next;n!==e.tail;)t.push(n.value),n=n.next;return t}const V7=hr;function q7(){}q7.prototype=V7;const ur=new q7;ur.highlight=uue;ur.register=due;ur.alias=fue;ur.registered=hue;ur.listLanguages=pue;ur.util.encode=mue;ur.Token.stringify=$x;function uue(e,t){if(typeof e!="string")throw new TypeError("Expected `string` for `value`, got `"+e+"`");let n,r;if(t&&typeof t=="object")n=t;else{if(r=t,typeof r!="string")throw new TypeError("Expected `string` for `name`, got `"+r+"`");if(Object.hasOwn(ur.languages,r))n=ur.languages[r];else throw new Error("Unknown language: `"+r+"` is not registered")}return{type:"root",children:V7.highlight.call(ur,e,n,r)}}function due(e){if(typeof e!="function"||!e.displayName)throw new Error("Expected `function` for `syntax`, got `"+e+"`");Object.hasOwn(ur.languages,e.displayName)||e(ur)}function fue(e,t){const n=ur.languages;let r={};typeof e=="string"?t&&(r[e]=t):r=e;let i;for(i in r)if(Object.hasOwn(r,i)){const s=r[i],a=typeof s=="string"?[s]:s;let c=-1;for(;++c<a.length;)n[a[c]]=n[i]}}function hue(e){if(typeof e!="string")throw new TypeError("Expected `string` for `aliasOrLanguage`, got `"+e+"`");return Object.hasOwn(ur.languages,e)}function pue(){const e=ur.languages,t=[];let n;for(n in e)Object.hasOwn(e,n)&&typeof e[n]=="object"&&t.push(n);return t}function $x(e,t){if(typeof e=="string")return{type:"text",value:e};if(Array.isArray(e)){const r=[];let i=-1;for(;++i<e.length;)e[i]!==null&&e[i]!==void 0&&e[i]!==""&&r.push($x(e[i],t));return r}const n={attributes:{},classes:["token",e.type],content:$x(e.content,t),language:t,tag:"span",type:e.type};return e.alias&&n.classes.push(...typeof e.alias=="string"?[e.alias]:e.alias),ur.hooks.run("wrap",n),Zce(n.tag+"."+n.classes.join("."),gue(n.attributes),n.content)}function mue(e){return e}function gue(e){let t;for(t in e)Object.hasOwn(e,t)&&(e[t]=rue(e[t]));return e}var fn=$ce(ur,{});fn.registerLanguage=function(e,t){return ur.register(t)};fn.alias=function(e,t){return ur.alias(e,t)};Ol.displayName="markup";Ol.aliases=["atom","html","mathml","rss","ssml","svg","xml"];function Ol(e){e.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},e.languages.markup.tag.inside["attr-value"].inside.entity=e.languages.markup.entity,e.languages.markup.doctype.inside["internal-subset"].inside=e.languages.markup,e.hooks.add("wrap",function(t){t.type==="entity"&&(t.attributes.title=t.content.value.replace(/&amp;/,"&"))}),Object.defineProperty(e.languages.markup.tag,"addInlined",{value:function(n,r){var i={};i["language-"+r]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:e.languages[r]},i.cdata=/^<!\[CDATA\[|\]\]>$/i;var s={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:i}};s["language-"+r]={pattern:/[\s\S]+/,inside:e.languages[r]};var a={};a[n]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return n}),"i"),lookbehind:!0,greedy:!0,inside:s},e.languages.insertBefore("markup","cdata",a)}}),Object.defineProperty(e.languages.markup.tag,"addAttribute",{value:function(t,n){e.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+t+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[n,"language-"+n],inside:e.languages[n]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),e.languages.html=e.languages.markup,e.languages.mathml=e.languages.markup,e.languages.svg=e.languages.markup,e.languages.xml=e.languages.extend("markup",{}),e.languages.ssml=e.languages.xml,e.languages.atom=e.languages.xml,e.languages.rss=e.languages.xml}gw.displayName="css";gw.aliases=[];function gw(e){(function(t){var n=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;t.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+n.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+n.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+n.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+n.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:n,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},t.languages.css.atrule.inside.rest=t.languages.css;var r=t.languages.markup;r&&(r.tag.addInlined("style","css"),r.tag.addAttribute("style","css"))})(e)}$0.displayName="clike";$0.aliases=[];function $0(e){e.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/}}pu.displayName="javascript";pu.aliases=["js"];function pu(e){e.register($0),e.languages.javascript=e.languages.extend("clike",{"class-name":[e.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+(/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source)+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),e.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,e.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:e.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:e.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:e.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:e.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:e.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),e.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:e.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),e.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),e.languages.markup&&(e.languages.markup.tag.addInlined("script","javascript"),e.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),e.languages.js=e.languages.javascript}yw.displayName="sql";yw.aliases=[];function yw(e){e.languages.sql={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,lookbehind:!0},variable:[{pattern:/@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,greedy:!0},/@[\w.$]+/],string:{pattern:/(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,greedy:!0,lookbehind:!0},identifier:{pattern:/(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/,greedy:!0,lookbehind:!0,inside:{punctuation:/^`|`$/}},function:/\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,keyword:/\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,boolean:/\b(?:FALSE|NULL|TRUE)\b/i,number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/}}Kf.displayName="bash";Kf.aliases=["sh","shell"];function Kf(e){(function(t){var n="\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\b",r={pattern:/(^(["']?)\w+\2)[ \t]+\S.*/,lookbehind:!0,alias:"punctuation",inside:null},i={bash:r,environment:{pattern:RegExp("\\$"+n),alias:"constant"},variable:[{pattern:/\$?\(\([\s\S]+?\)\)/,greedy:!0,inside:{variable:[{pattern:/(^\$\(\([\s\S]+)\)\)/,lookbehind:!0},/^\$\(\(/],number:/\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee]-?\d+)?/,operator:/--|\+\+|\*\*=?|<<=?|>>=?|&&|\|\||[=!+\-*/%<>^&|]=?|[?~:]/,punctuation:/\(\(?|\)\)?|,|;/}},{pattern:/\$\((?:\([^)]+\)|[^()])+\)|`[^`]+`/,greedy:!0,inside:{variable:/^\$\(|^`|\)$|`$/}},{pattern:/\$\{[^}]+\}/,greedy:!0,inside:{operator:/:[-=?+]?|[!\/]|##?|%%?|\^\^?|,,?/,punctuation:/[\[\]]/,environment:{pattern:RegExp("(\\{)"+n),lookbehind:!0,alias:"constant"}}},/\$(?:\w+|[#?*!@$])/],entity:/\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|U[0-9a-fA-F]{8}|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{1,2})/};t.languages.bash={shebang:{pattern:/^#!\s*\/.*/,alias:"important"},comment:{pattern:/(^|[^"{\\$])#.*/,lookbehind:!0},"function-name":[{pattern:/(\bfunction\s+)[\w-]+(?=(?:\s*\(?:\s*\))?\s*\{)/,lookbehind:!0,alias:"function"},{pattern:/\b[\w-]+(?=\s*\(\s*\)\s*\{)/,alias:"function"}],"for-or-select":{pattern:/(\b(?:for|select)\s+)\w+(?=\s+in\s)/,alias:"variable",lookbehind:!0},"assign-left":{pattern:/(^|[\s;|&]|[<>]\()\w+(?:\.\w+)*(?=\+?=)/,inside:{environment:{pattern:RegExp("(^|[\\s;|&]|[<>]\\()"+n),lookbehind:!0,alias:"constant"}},alias:"variable",lookbehind:!0},parameter:{pattern:/(^|\s)-{1,2}(?:\w+:[+-]?)?\w+(?:\.\w+)*(?=[=\s]|$)/,alias:"variable",lookbehind:!0},string:[{pattern:/((?:^|[^<])<<-?\s*)(\w+)\s[\s\S]*?(?:\r?\n|\r)\2/,lookbehind:!0,greedy:!0,inside:i},{pattern:/((?:^|[^<])<<-?\s*)(["'])(\w+)\2\s[\s\S]*?(?:\r?\n|\r)\3/,lookbehind:!0,greedy:!0,inside:{bash:r}},{pattern:/(^|[^\\](?:\\\\)*)"(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^"\\`$])*"/,lookbehind:!0,greedy:!0,inside:i},{pattern:/(^|[^$\\])'[^']*'/,lookbehind:!0,greedy:!0},{pattern:/\$'(?:[^'\\]|\\[\s\S])*'/,greedy:!0,inside:{entity:i.entity}}],environment:{pattern:RegExp("\\$?"+n),alias:"constant"},variable:i.variable,function:{pattern:/(^|[\s;|&]|[<>]\()(?:add|apropos|apt|apt-cache|apt-get|aptitude|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cargo|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|docker|docker-compose|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|java|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|node|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|podman|podman-compose|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|sysctl|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vcpkg|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/,lookbehind:!0},keyword:{pattern:/(^|[\s;|&]|[<>]\()(?:case|do|done|elif|else|esac|fi|for|function|if|in|select|then|until|while)(?=$|[)\s;|&])/,lookbehind:!0},builtin:{pattern:/(^|[\s;|&]|[<>]\()(?:\.|:|alias|bind|break|builtin|caller|cd|command|continue|declare|echo|enable|eval|exec|exit|export|getopts|hash|help|let|local|logout|mapfile|printf|pwd|read|readarray|readonly|return|set|shift|shopt|source|test|times|trap|type|typeset|ulimit|umask|unalias|unset)(?=$|[)\s;|&])/,lookbehind:!0,alias:"class-name"},boolean:{pattern:/(^|[\s;|&]|[<>]\()(?:false|true)(?=$|[)\s;|&])/,lookbehind:!0},"file-descriptor":{pattern:/\B&\d\b/,alias:"important"},operator:{pattern:/\d?<>|>\||\+=|=[=~]?|!=?|<<[<-]?|[&\d]?>>|\d[<>]&?|[<>][&=]?|&[>&]?|\|[&|]?/,inside:{"file-descriptor":{pattern:/^\d/,alias:"important"}}},punctuation:/\$?\(\(?|\)\)?|\.\.|[{}[\];\\]/,number:{pattern:/(^|\s)(?:[1-9]\d*|0)(?:[.,]\d+)?\b/,lookbehind:!0}},r.inside=t.languages.bash;for(var s=["comment","function-name","for-or-select","assign-left","parameter","string","environment","function","keyword","builtin","boolean","file-descriptor","operator","punctuation","number"],a=i.variable[1].inside,c=0;c<s.length;c++)a[s[c]]=t.languages.bash[s[c]];t.languages.sh=t.languages.bash,t.languages.shell=t.languages.bash})(e)}Y0.displayName="yaml";Y0.aliases=["yml"];function Y0(e){(function(t){var n=/[*&][^\s[\]{},]+/,r=/!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/,i="(?:"+r.source+"(?:[ ]+"+n.source+")?|"+n.source+"(?:[ ]+"+r.source+")?)",s=/(?:[^\s\x00-\x08\x0e-\x1f!"#%&'*,\-:>?@[\]`{|}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]|[?:-]<PLAIN>)(?:[ \t]*(?:(?![#:])<PLAIN>|:<PLAIN>))*/.source.replace(/<PLAIN>/g,function(){return/[^\s\x00-\x08\x0e-\x1f,[\]{}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]/.source}),a=/"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'/.source;function c(u,f){f=(f||"").replace(/m/g,"")+"m";var m=/([:\-,[{]\s*(?:\s<<prop>>[ \t]+)?)(?:<<value>>)(?=[ \t]*(?:$|,|\]|\}|(?:[\r\n]\s*)?#))/.source.replace(/<<prop>>/g,function(){return i}).replace(/<<value>>/g,function(){return u});return RegExp(m,f)}t.languages.yaml={scalar:{pattern:RegExp(/([\-:]\s*(?:\s<<prop>>[ \t]+)?[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)\S[^\r\n]*(?:\2[^\r\n]+)*)/.source.replace(/<<prop>>/g,function(){return i})),lookbehind:!0,alias:"string"},comment:/#.*/,key:{pattern:RegExp(/((?:^|[:\-,[{\r\n?])[ \t]*(?:<<prop>>[ \t]+)?)<<key>>(?=\s*:\s)/.source.replace(/<<prop>>/g,function(){return i}).replace(/<<key>>/g,function(){return"(?:"+s+"|"+a+")"})),lookbehind:!0,greedy:!0,alias:"atrule"},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:"important"},datetime:{pattern:c(/\d{4}-\d\d?-\d\d?(?:[tT]|[ \t]+)\d\d?:\d{2}:\d{2}(?:\.\d*)?(?:[ \t]*(?:Z|[-+]\d\d?(?::\d{2})?))?|\d{4}-\d{2}-\d{2}|\d\d?:\d{2}(?::\d{2}(?:\.\d*)?)?/.source),lookbehind:!0,alias:"number"},boolean:{pattern:c(/false|true/.source,"i"),lookbehind:!0,alias:"important"},null:{pattern:c(/null|~/.source,"i"),lookbehind:!0,alias:"important"},string:{pattern:c(a),lookbehind:!0,greedy:!0},number:{pattern:c(/[+-]?(?:0x[\da-f]+|0o[0-7]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?|\.inf|\.nan)/.source,"i"),lookbehind:!0},tag:r,important:n,punctuation:/---|[:[\]{}\-,|>?]|\.\.\./},t.languages.yml=t.languages.yaml})(e)}W0.displayName="markdown";W0.aliases=["md"];function W0(e){e.register(Ol),(function(t){var n=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function r(c){return c=c.replace(/<inner>/g,function(){return n}),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+c+")")}var i=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,s=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,function(){return i}),a=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source;t.languages.markdown=t.languages.extend("markup",{}),t.languages.insertBefore("markdown","prolog",{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:["yaml","language-yaml"],inside:t.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+s+a+"(?:"+s+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+s+a+")(?:"+s+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(i),inside:t.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+s+")"+a+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+s+"$"),inside:{"table-header":{pattern:RegExp(i),alias:"important",inside:t.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:"keyword"},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:"punctuation"},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:"url"},bold:{pattern:r(/\b__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__\b|\*\*(?:(?!\*)<inner>|\*(?:(?!\*)<inner>)+\*)+\*\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:r(/\b_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_\b|\*(?:(?!\*)<inner>|\*\*(?:(?!\*)<inner>)+\*\*)+\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:r(/(~~?)(?:(?!~)<inner>)+\2/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:["code","keyword"]},url:{pattern:r(/!?\[(?:(?!\])<inner>)+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\])<inner>)+\])/.source),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),["url","bold","italic","strike"].forEach(function(c){["url","bold","italic","strike","code-snippet"].forEach(function(u){c!==u&&(t.languages.markdown[c].inside.content.inside[u]=t.languages.markdown[u])})}),t.hooks.add("after-tokenize",function(c){if(c.language!=="markdown"&&c.language!=="md")return;function u(f){if(!(!f||typeof f=="string"))for(var m=0,p=f.length;m<p;m++){var y=f[m];if(y.type!=="code"){u(y.content);continue}var x=y.content[1],b=y.content[3];if(x&&b&&x.type==="code-language"&&b.type==="code-block"&&typeof x.content=="string"){var S=x.content.replace(/\b#/g,"sharp").replace(/\b\+\+/g,"pp");S=(/[a-z][\w-]*/i.exec(S)||[""])[0].toLowerCase();var k="language-"+S;b.alias?typeof b.alias=="string"?b.alias=[b.alias,k]:b.alias.push(k):b.alias=[k]}}}u(c.tokens)}),t.hooks.add("wrap",function(c){if(c.type==="code-block"){for(var u="",f=0,m=c.classes.length;f<m;f++){var p=c.classes[f],y=/language-(.+)/.exec(p);if(y){u=y[1];break}}var x=t.languages[u];if(x)c.content=t.highlight(c.content.value,x,u);else if(u&&u!=="none"&&t.plugins.autoloader){var b="md-"+new Date().valueOf()+"-"+Math.floor(Math.random()*1e16);c.attributes.id=b,t.plugins.autoloader.loadLanguages(u,function(){var S=document.getElementById(b);S&&(S.innerHTML=t.highlight(S.textContent,t.languages[u],u))})}}}),RegExp(t.languages.markup.tag.pattern.source,"gi"),t.languages.md=t.languages.markdown})(e)}xw.displayName="diff";xw.aliases=[];function xw(e){(function(t){t.languages.diff={coord:[/^(?:\*{3}|-{3}|\+{3}).*$/m,/^@@.*@@$/m,/^\d.*$/m]};var n={"deleted-sign":"-","deleted-arrow":"<","inserted-sign":"+","inserted-arrow":">",unchanged:" ",diff:"!"};Object.keys(n).forEach(function(r){var i=n[r],s=[];/^\w+$/.test(r)||s.push(/\w+/.exec(r)[0]),r==="diff"&&s.push("bold"),t.languages.diff[r]={pattern:RegExp("^(?:["+i+`].*(?:\r
123
+ ?|
124
+ |(?![\\s\\S])))+`,"m"),alias:s,inside:{line:{pattern:/(.)(?=[\s\S]).*(?:\r\n?|\n)?/,lookbehind:!0},prefix:{pattern:/[\s\S]/,alias:/\w+/.exec(r)[0]}}}}),Object.defineProperty(t.languages.diff,"PREFIXES",{value:n})})(e)}bw.displayName="go";bw.aliases=[];function bw(e){e.register($0),e.languages.go=e.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"|`[^`]*`/,lookbehind:!0,greedy:!0},keyword:/\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/,boolean:/\b(?:_|false|iota|nil|true)\b/,number:[/\b0(?:b[01_]+|o[0-7_]+)i?\b/i,/\b0x(?:[a-f\d_]+(?:\.[a-f\d_]*)?|\.[a-f\d_]+)(?:p[+-]?\d+(?:_\d+)*)?i?(?!\w)/i,/(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?[\d_]+)?i?(?!\w)/i],operator:/[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,builtin:/\b(?:append|bool|byte|cap|close|complex|complex(?:64|128)|copy|delete|error|float(?:32|64)|u?int(?:8|16|32|64)?|imag|len|make|new|panic|print(?:ln)?|real|recover|rune|string|uintptr)\b/}),e.languages.insertBefore("go","string",{char:{pattern:/'(?:\\.|[^'\\\r\n]){0,10}'/,greedy:!0}}),delete e.languages.go["class-name"]}vw.displayName="json";vw.aliases=["webmanifest"];function vw(e){e.languages.json={property:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,lookbehind:!0,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"}},e.languages.webmanifest=e.languages.json}Qf.displayName="typescript";Qf.aliases=["ts"];function Qf(e){e.register(pu),(function(t){t.languages.typescript=t.languages.extend("javascript",{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),t.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete t.languages.typescript.parameter,delete t.languages.typescript["literal-property"];var n=t.languages.extend("typescript",{});delete n["class-name"],t.languages.typescript["class-name"].inside=n,t.languages.insertBefore("typescript","function",{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:"operator"},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:n}}}}),t.languages.ts=t.languages.typescript})(e)}G0.displayName="python";G0.aliases=["py"];function G0(e){e.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern:/![sra](?=[:}]$)/,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},e.languages.python["string-interpolation"].inside.interpolation.inside.rest=e.languages.python,e.languages.py=e.languages.python}K0.displayName="jsx";K0.aliases=[];function K0(e){e.register(pu),e.register(Ol),(function(t){var n=t.util.clone(t.languages.javascript),r=/(?:\s|\/\/.*(?!.)|\/\*(?:[^*]|\*(?!\/))\*\/)/.source,i=/(?:\{(?:\{(?:\{[^{}]*\}|[^{}])*\}|[^{}])*\})/.source,s=/(?:\{<S>*\.{3}(?:[^{}]|<BRACES>)*\})/.source;function a(f,m){return f=f.replace(/<S>/g,function(){return r}).replace(/<BRACES>/g,function(){return i}).replace(/<SPREAD>/g,function(){return s}),RegExp(f,m)}s=a(s).source,t.languages.jsx=t.languages.extend("markup",n),t.languages.jsx.tag.pattern=a(/<\/?(?:[\w.:-]+(?:<S>+(?:[\w.:$-]+(?:=(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s{'"/>=]+|<BRACES>))?|<SPREAD>))*<S>*\/?)?>/.source),t.languages.jsx.tag.inside.tag.pattern=/^<\/?[^\s>\/]*/,t.languages.jsx.tag.inside["attr-value"].pattern=/=(?!\{)(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s'">]+)/,t.languages.jsx.tag.inside.tag.inside["class-name"]=/^[A-Z]\w*(?:\.[A-Z]\w*)*$/,t.languages.jsx.tag.inside.comment=n.comment,t.languages.insertBefore("inside","attr-name",{spread:{pattern:a(/<SPREAD>/.source),inside:t.languages.jsx}},t.languages.jsx.tag),t.languages.insertBefore("inside","special-attr",{script:{pattern:a(/=<BRACES>/.source),alias:"language-javascript",inside:{"script-punctuation":{pattern:/^=(?=\{)/,alias:"punctuation"},rest:t.languages.jsx}}},t.languages.jsx.tag);var c=function(f){return f?typeof f=="string"?f:typeof f.content=="string"?f.content:f.content.map(c).join(""):""},u=function(f){for(var m=[],p=0;p<f.length;p++){var y=f[p],x=!1;if(typeof y!="string"&&(y.type==="tag"&&y.content[0]&&y.content[0].type==="tag"?y.content[0].content[0].content==="</"?m.length>0&&m[m.length-1].tagName===c(y.content[0].content[1])&&m.pop():y.content[y.content.length-1].content==="/>"||m.push({tagName:c(y.content[0].content[1]),openedBraces:0}):m.length>0&&y.type==="punctuation"&&y.content==="{"?m[m.length-1].openedBraces++:m.length>0&&m[m.length-1].openedBraces>0&&y.type==="punctuation"&&y.content==="}"?m[m.length-1].openedBraces--:x=!0),(x||typeof y=="string")&&m.length>0&&m[m.length-1].openedBraces===0){var b=c(y);p<f.length-1&&(typeof f[p+1]=="string"||f[p+1].type==="plain-text")&&(b+=c(f[p+1]),f.splice(p+1,1)),p>0&&(typeof f[p-1]=="string"||f[p-1].type==="plain-text")&&(b=c(f[p-1])+b,f.splice(p-1,1),p--),f[p]=new t.Token("plain-text",b,null,b)}y.content&&typeof y.content!="string"&&u(y.content)}};t.hooks.add("after-tokenize",function(f){f.language!=="jsx"&&f.language!=="tsx"||u(f.tokens)})})(e)}ww.displayName="tsx";ww.aliases=[];function ww(e){e.register(K0),e.register(Qf),(function(t){var n=t.util.clone(t.languages.typescript);t.languages.tsx=t.languages.extend("jsx",n),delete t.languages.tsx.parameter,delete t.languages.tsx["literal-property"];var r=t.languages.tsx.tag;r.pattern=RegExp(/(^|[^\w$]|(?=<\/))/.source+"(?:"+r.pattern.source+")",r.pattern.flags),r.lookbehind=!0})(e)}Q0.displayName="rust";Q0.aliases=[];function Q0(e){(function(t){for(var n=/\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|<self>)*\*\//.source,r=0;r<2;r++)n=n.replace(/<self>/g,function(){return n});n=n.replace(/<self>/g,function(){return/[^\s\S]/.source}),t.languages.rust={comment:[{pattern:RegExp(/(^|[^\\])/.source+n),lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/,greedy:!0},char:{pattern:/b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/,greedy:!0},attribute:{pattern:/#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/,greedy:!0,alias:"attr-name",inside:{string:null}},"closure-params":{pattern:/([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/,lookbehind:!0,greedy:!0,inside:{"closure-punctuation":{pattern:/^\||\|$/,alias:"punctuation"},rest:null}},"lifetime-annotation":{pattern:/'\w+/,alias:"symbol"},"fragment-specifier":{pattern:/(\$\w+:)[a-z]+/,lookbehind:!0,alias:"punctuation"},variable:/\$\w+/,"function-definition":{pattern:/(\bfn\s+)\w+/,lookbehind:!0,alias:"function"},"type-definition":{pattern:/(\b(?:enum|struct|trait|type|union)\s+)\w+/,lookbehind:!0,alias:"class-name"},"module-declaration":[{pattern:/(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/,lookbehind:!0,alias:"namespace"},{pattern:/(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/,lookbehind:!0,alias:"namespace",inside:{punctuation:/::/}}],keyword:[/\b(?:Self|abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/,/\b(?:bool|char|f(?:32|64)|[ui](?:8|16|32|64|128|size)|str)\b/],function:/\b[a-z_]\w*(?=\s*(?:::\s*<|\())/,macro:{pattern:/\b\w+!/,alias:"property"},constant:/\b[A-Z_][A-Z_\d]+\b/,"class-name":/\b[A-Z]\w*\b/,namespace:{pattern:/(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/,inside:{punctuation:/::/}},number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:f32|f64|[iu](?:8|16|32|64|size)?))?\b/,boolean:/\b(?:false|true)\b/,punctuation:/->|\.\.=|\.{1,3}|::|[{}[\];(),:]/,operator:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<<?=?|>>?=?|[@?]/},t.languages.rust["closure-params"].inside.rest=t.languages.rust,t.languages.rust.attribute.inside.string=t.languages.rust.string})(e)}const Sw={'code[class*="language-"]':{background:"hsl(220, 13%, 18%)",color:"hsl(220, 14%, 71%)",textShadow:"0 1px rgba(0, 0, 0, 0.3)",fontFamily:'"Fira Code", "Fira Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace',direction:"ltr",textAlign:"left",whiteSpace:"pre",wordSpacing:"normal",wordBreak:"normal",lineHeight:"1.5",MozTabSize:"2",OTabSize:"2",tabSize:"2",WebkitHyphens:"none",MozHyphens:"none",msHyphens:"none",hyphens:"none"},'pre[class*="language-"]':{background:"hsl(220, 13%, 18%)",color:"hsl(220, 14%, 71%)",textShadow:"0 1px rgba(0, 0, 0, 0.3)",fontFamily:'"Fira Code", "Fira Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace',direction:"ltr",textAlign:"left",whiteSpace:"pre",wordSpacing:"normal",wordBreak:"normal",lineHeight:"1.5",MozTabSize:"2",OTabSize:"2",tabSize:"2",WebkitHyphens:"none",MozHyphens:"none",msHyphens:"none",hyphens:"none",padding:"1em",margin:"0.5em 0",overflow:"auto",borderRadius:"0.3em"},'code[class*="language-"]::-moz-selection':{background:"hsl(220, 13%, 28%)",color:"inherit",textShadow:"none"},'code[class*="language-"] *::-moz-selection':{background:"hsl(220, 13%, 28%)",color:"inherit",textShadow:"none"},'pre[class*="language-"] *::-moz-selection':{background:"hsl(220, 13%, 28%)",color:"inherit",textShadow:"none"},'code[class*="language-"]::selection':{background:"hsl(220, 13%, 28%)",color:"inherit",textShadow:"none"},'code[class*="language-"] *::selection':{background:"hsl(220, 13%, 28%)",color:"inherit",textShadow:"none"},'pre[class*="language-"] *::selection':{background:"hsl(220, 13%, 28%)",color:"inherit",textShadow:"none"},':not(pre) > code[class*="language-"]':{padding:"0.2em 0.3em",borderRadius:"0.3em",whiteSpace:"normal"},comment:{color:"hsl(220, 10%, 40%)",fontStyle:"italic"},prolog:{color:"hsl(220, 10%, 40%)"},cdata:{color:"hsl(220, 10%, 40%)"},doctype:{color:"hsl(220, 14%, 71%)"},punctuation:{color:"hsl(220, 14%, 71%)"},entity:{color:"hsl(220, 14%, 71%)",cursor:"help"},"attr-name":{color:"hsl(29, 54%, 61%)"},"class-name":{color:"hsl(29, 54%, 61%)"},boolean:{color:"hsl(29, 54%, 61%)"},constant:{color:"hsl(29, 54%, 61%)"},number:{color:"hsl(29, 54%, 61%)"},atrule:{color:"hsl(29, 54%, 61%)"},keyword:{color:"hsl(286, 60%, 67%)"},property:{color:"hsl(355, 65%, 65%)"},tag:{color:"hsl(355, 65%, 65%)"},symbol:{color:"hsl(355, 65%, 65%)"},deleted:{color:"hsl(355, 65%, 65%)"},important:{color:"hsl(355, 65%, 65%)"},selector:{color:"hsl(95, 38%, 62%)"},string:{color:"hsl(95, 38%, 62%)"},char:{color:"hsl(95, 38%, 62%)"},builtin:{color:"hsl(95, 38%, 62%)"},inserted:{color:"hsl(95, 38%, 62%)"},regex:{color:"hsl(95, 38%, 62%)"},"attr-value":{color:"hsl(95, 38%, 62%)"},"attr-value > .token.punctuation":{color:"hsl(95, 38%, 62%)"},variable:{color:"hsl(207, 82%, 66%)"},operator:{color:"hsl(207, 82%, 66%)"},function:{color:"hsl(207, 82%, 66%)"},url:{color:"hsl(187, 47%, 55%)"},"attr-value > .token.punctuation.attr-equals":{color:"hsl(220, 14%, 71%)"},"special-attr > .token.attr-value > .token.value.css":{color:"hsl(220, 14%, 71%)"},".language-css .token.selector":{color:"hsl(355, 65%, 65%)"},".language-css .token.property":{color:"hsl(220, 14%, 71%)"},".language-css .token.function":{color:"hsl(187, 47%, 55%)"},".language-css .token.url > .token.function":{color:"hsl(187, 47%, 55%)"},".language-css .token.url > .token.string.url":{color:"hsl(95, 38%, 62%)"},".language-css .token.important":{color:"hsl(286, 60%, 67%)"},".language-css .token.atrule .token.rule":{color:"hsl(286, 60%, 67%)"},".language-javascript .token.operator":{color:"hsl(286, 60%, 67%)"},".language-javascript .token.template-string > .token.interpolation > .token.interpolation-punctuation.punctuation":{color:"hsl(5, 48%, 51%)"},".language-json .token.operator":{color:"hsl(220, 14%, 71%)"},".language-json .token.null.keyword":{color:"hsl(29, 54%, 61%)"},".language-markdown .token.url":{color:"hsl(220, 14%, 71%)"},".language-markdown .token.url > .token.operator":{color:"hsl(220, 14%, 71%)"},".language-markdown .token.url-reference.url > .token.string":{color:"hsl(220, 14%, 71%)"},".language-markdown .token.url > .token.content":{color:"hsl(207, 82%, 66%)"},".language-markdown .token.url > .token.url":{color:"hsl(187, 47%, 55%)"},".language-markdown .token.url-reference.url":{color:"hsl(187, 47%, 55%)"},".language-markdown .token.blockquote.punctuation":{color:"hsl(220, 10%, 40%)",fontStyle:"italic"},".language-markdown .token.hr.punctuation":{color:"hsl(220, 10%, 40%)",fontStyle:"italic"},".language-markdown .token.code-snippet":{color:"hsl(95, 38%, 62%)"},".language-markdown .token.bold .token.content":{color:"hsl(29, 54%, 61%)"},".language-markdown .token.italic .token.content":{color:"hsl(286, 60%, 67%)"},".language-markdown .token.strike .token.content":{color:"hsl(355, 65%, 65%)"},".language-markdown .token.strike .token.punctuation":{color:"hsl(355, 65%, 65%)"},".language-markdown .token.list.punctuation":{color:"hsl(355, 65%, 65%)"},".language-markdown .token.title.important > .token.punctuation":{color:"hsl(355, 65%, 65%)"},bold:{fontWeight:"bold"},italic:{fontStyle:"italic"},namespace:{Opacity:"0.8"},"token.tab:not(:empty):before":{color:"hsla(220, 14%, 71%, 0.15)",textShadow:"none"},"token.cr:before":{color:"hsla(220, 14%, 71%, 0.15)",textShadow:"none"},"token.lf:before":{color:"hsla(220, 14%, 71%, 0.15)",textShadow:"none"},"token.space:before":{color:"hsla(220, 14%, 71%, 0.15)",textShadow:"none"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item":{marginRight:"0.4em"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > button":{background:"hsl(220, 13%, 26%)",color:"hsl(220, 9%, 55%)",padding:"0.1em 0.4em",borderRadius:"0.3em"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > a":{background:"hsl(220, 13%, 26%)",color:"hsl(220, 9%, 55%)",padding:"0.1em 0.4em",borderRadius:"0.3em"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > span":{background:"hsl(220, 13%, 26%)",color:"hsl(220, 9%, 55%)",padding:"0.1em 0.4em",borderRadius:"0.3em"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > button:hover":{background:"hsl(220, 13%, 28%)",color:"hsl(220, 14%, 71%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > button:focus":{background:"hsl(220, 13%, 28%)",color:"hsl(220, 14%, 71%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > a:hover":{background:"hsl(220, 13%, 28%)",color:"hsl(220, 14%, 71%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > a:focus":{background:"hsl(220, 13%, 28%)",color:"hsl(220, 14%, 71%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > span:hover":{background:"hsl(220, 13%, 28%)",color:"hsl(220, 14%, 71%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > span:focus":{background:"hsl(220, 13%, 28%)",color:"hsl(220, 14%, 71%)"},".line-highlight.line-highlight":{background:"hsla(220, 100%, 80%, 0.04)"},".line-highlight.line-highlight:before":{background:"hsl(220, 13%, 26%)",color:"hsl(220, 14%, 71%)",padding:"0.1em 0.6em",borderRadius:"0.3em",boxShadow:"0 2px 0 0 rgba(0, 0, 0, 0.2)"},".line-highlight.line-highlight[data-end]:after":{background:"hsl(220, 13%, 26%)",color:"hsl(220, 14%, 71%)",padding:"0.1em 0.6em",borderRadius:"0.3em",boxShadow:"0 2px 0 0 rgba(0, 0, 0, 0.2)"},"pre[id].linkable-line-numbers.linkable-line-numbers span.line-numbers-rows > span:hover:before":{backgroundColor:"hsla(220, 100%, 80%, 0.04)"},".line-numbers.line-numbers .line-numbers-rows":{borderRightColor:"hsla(220, 14%, 71%, 0.15)"},".command-line .command-line-prompt":{borderRightColor:"hsla(220, 14%, 71%, 0.15)"},".line-numbers .line-numbers-rows > span:before":{color:"hsl(220, 14%, 45%)"},".command-line .command-line-prompt > span:before":{color:"hsl(220, 14%, 45%)"},".rainbow-braces .token.token.punctuation.brace-level-1":{color:"hsl(355, 65%, 65%)"},".rainbow-braces .token.token.punctuation.brace-level-5":{color:"hsl(355, 65%, 65%)"},".rainbow-braces .token.token.punctuation.brace-level-9":{color:"hsl(355, 65%, 65%)"},".rainbow-braces .token.token.punctuation.brace-level-2":{color:"hsl(95, 38%, 62%)"},".rainbow-braces .token.token.punctuation.brace-level-6":{color:"hsl(95, 38%, 62%)"},".rainbow-braces .token.token.punctuation.brace-level-10":{color:"hsl(95, 38%, 62%)"},".rainbow-braces .token.token.punctuation.brace-level-3":{color:"hsl(207, 82%, 66%)"},".rainbow-braces .token.token.punctuation.brace-level-7":{color:"hsl(207, 82%, 66%)"},".rainbow-braces .token.token.punctuation.brace-level-11":{color:"hsl(207, 82%, 66%)"},".rainbow-braces .token.token.punctuation.brace-level-4":{color:"hsl(286, 60%, 67%)"},".rainbow-braces .token.token.punctuation.brace-level-8":{color:"hsl(286, 60%, 67%)"},".rainbow-braces .token.token.punctuation.brace-level-12":{color:"hsl(286, 60%, 67%)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix)":{backgroundColor:"hsla(353, 100%, 66%, 0.15)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix)":{backgroundColor:"hsla(353, 100%, 66%, 0.15)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix)::-moz-selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix) *::-moz-selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix)::-moz-selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix) *::-moz-selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix)::selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix) *::selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix)::selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix) *::selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix)":{backgroundColor:"hsla(137, 100%, 55%, 0.15)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix)":{backgroundColor:"hsla(137, 100%, 55%, 0.15)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix)::-moz-selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix) *::-moz-selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix)::-moz-selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix) *::-moz-selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix)::selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix) *::selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix)::selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix) *::selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},".prism-previewer.prism-previewer:before":{borderColor:"hsl(224, 13%, 17%)"},".prism-previewer-gradient.prism-previewer-gradient div":{borderColor:"hsl(224, 13%, 17%)",borderRadius:"0.3em"},".prism-previewer-color.prism-previewer-color:before":{borderRadius:"0.3em"},".prism-previewer-easing.prism-previewer-easing:before":{borderRadius:"0.3em"},".prism-previewer.prism-previewer:after":{borderTopColor:"hsl(224, 13%, 17%)"},".prism-previewer-flipped.prism-previewer-flipped.after":{borderBottomColor:"hsl(224, 13%, 17%)"},".prism-previewer-angle.prism-previewer-angle:before":{background:"hsl(219, 13%, 22%)"},".prism-previewer-time.prism-previewer-time:before":{background:"hsl(219, 13%, 22%)"},".prism-previewer-easing.prism-previewer-easing":{background:"hsl(219, 13%, 22%)"},".prism-previewer-angle.prism-previewer-angle circle":{stroke:"hsl(220, 14%, 71%)",strokeOpacity:"1"},".prism-previewer-time.prism-previewer-time circle":{stroke:"hsl(220, 14%, 71%)",strokeOpacity:"1"},".prism-previewer-easing.prism-previewer-easing circle":{stroke:"hsl(220, 14%, 71%)",fill:"transparent"},".prism-previewer-easing.prism-previewer-easing path":{stroke:"hsl(220, 14%, 71%)"},".prism-previewer-easing.prism-previewer-easing line":{stroke:"hsl(220, 14%, 71%)"}};fn.registerLanguage("bash",Kf);fn.registerLanguage("css",gw);fn.registerLanguage("diff",xw);fn.registerLanguage("go",bw);fn.registerLanguage("html",Ol);fn.registerLanguage("javascript",pu);fn.registerLanguage("js",pu);fn.registerLanguage("json",vw);fn.registerLanguage("jsx",K0);fn.registerLanguage("markdown",W0);fn.registerLanguage("markup",Ol);fn.registerLanguage("md",W0);fn.registerLanguage("python",G0);fn.registerLanguage("py",G0);fn.registerLanguage("rust",Q0);fn.registerLanguage("rs",Q0);fn.registerLanguage("sh",Kf);fn.registerLanguage("shell",Kf);fn.registerLanguage("sql",yw);fn.registerLanguage("ts",Qf);fn.registerLanguage("tsx",ww);fn.registerLanguage("typescript",Qf);fn.registerLanguage("xml",Ol);fn.registerLanguage("yaml",Y0);fn.registerLanguage("yml",Y0);const $7=w.memo(({language:e,value:t})=>{const[n,r]=w.useState(!1),i=()=>{r(!0),navigator.clipboard.writeText(t),setTimeout(()=>r(!1),1e3)};return h.jsxs("div",{className:"codeblock border-input relative w-full overflow-hidden rounded border p-2 font-sans dark:bg-zinc-900",children:[h.jsxs("div",{className:"bg-secondary flex w-full items-center justify-between px-2 py-1",children:[h.jsx("span",{className:"text-primary text-lg font-bold lowercase italic",children:e}),h.jsx("div",{className:"flex items-center py-1",children:h.jsxs(ze,{className:"hover:bg-border text-xs focus-visible:ring-1 focus-visible:ring-offset-0",onClick:i,size:"xs",variant:"ghost",children:[n?h.jsx(Rl,{className:"h-4 w-4"}):h.jsx(Yq,{className:"h-4 w-4"}),h.jsx("span",{className:"sr-only",children:"Copy code"})]})})]}),h.jsx(fn,{codeTagProps:{style:{display:"block",fontFamily:"var(--font-mono)",fontSize:"0.75rem"}},customStyle:{background:"transparent",margin:0,padding:"0.5rem",width:"100%"},language:e,PreTag:"div",style:Sw,children:t})]})});$7.displayName="CodeBlock";const yue=w.memo(c7,(e,t)=>e.children===t.children),xue=e=>w.isValidElement(e)&&typeof e.type!="string"&&["h1","h2","h3","h4","h5","h6","p"].includes(e.type.name??""),bue=e=>Array.isArray(e)&&e.some(t=>t?.props?.className==="task-list-item"),vue=e=>w.Children.map(e,t=>xue(t)?h.jsx("div",{className:"mb-1 inline-flex",children:w.createElement(t.type,{...t.props})}):t),wue=[[hae,["yaml","toml"]],D7],Sue={a({children:e,href:t}){return t?h.jsx("a",{className:"underline",href:t,rel:"noopener noreferrer",target:"_blank",children:e}):h.jsx(h.Fragment,{children:e})},blockquote({children:e}){return h.jsx("blockquote",{className:"border-input border-l-4 pl-4 italic",children:e})},code({children:e,className:t}){const n=/language-(\w+)/.exec(t??""),r=n?n[1]:"",i=String(e).replace(/\n$/,""),s=i.includes(`
125
+ `);return r||s?h.jsx($7,{language:r,value:i}):h.jsx("code",{className:"border-input bg-secondary rounded border px-1 py-0.5 text-amber-500",children:i})},h1({children:e}){return h.jsx("h1",{className:"text-2xl font-bold",children:e})},h2({children:e}){return h.jsx("h2",{className:"text-xl font-bold",children:e})},h3({children:e}){return h.jsx("h3",{className:"text-lg font-bold",children:e})},h4({children:e}){return h.jsx("h4",{className:"text-base font-bold",children:e})},h5({children:e}){return h.jsx("h5",{className:"text-sm font-bold",children:e})},h6({children:e}){return h.jsx("h6",{className:"text-xs font-bold",children:e})},hr(){return h.jsx("hr",{className:"my-4"})},li({children:e}){return h.jsx("li",{className:"mt-1 [&>ol]:pl-4 [&>ul]:pl-4",children:vue(e)})},ol({children:e}){return h.jsx("ol",{className:"list-inside list-decimal",children:e})},p({children:e}){return h.jsx("p",{className:"mb-2 whitespace-pre-wrap last:mb-0",children:e})},pre({children:e}){return h.jsx("pre",{className:"rounded p-2",children:e})},table({children:e}){return h.jsx("div",{className:"border-input overflow-x-auto rounded text-xs",children:h.jsx("table",{className:"min-w-full divide-y",children:e})})},tbody({children:e}){return h.jsx("tbody",{className:"divide-border divide-y",children:e})},td({children:e}){return h.jsx("td",{className:"whitespace-nowrap px-4 py-2",children:e})},th({children:e}){return h.jsx("th",{className:"px-4 py-2 text-left text-xs font-medium uppercase tracking-wider",children:e})},thead({children:e}){return h.jsx("thead",{children:e})},tr({children:e}){return h.jsx("tr",{children:e})},ul({children:e}){return bue(e)?h.jsx("ul",{className:"list-none",children:e}):h.jsx("ul",{className:"list-inside list-disc",children:e})}};function Cue({content:e}){const t=e.split(`
126
+ `);let n="none";return h.jsx("pre",{className:"bg-card overflow-x-auto rounded-md py-2 font-mono text-xs leading-6",children:t.map((r,i)=>{let s="block px-3 whitespace-pre-wrap break-all";return r.startsWith("<<<<<<<")?(s+=" bg-[#4f3422] text-[#ffc53d] font-semibold",n="ours"):r.startsWith("=======")&&n!=="none"?(s+=" bg-[#4f3422] text-[#ffc53d] font-semibold",n="theirs"):r.startsWith(">>>>>>>")&&(s+=" bg-[#4f3422] text-[#ffc53d] font-semibold",n="none"),h.jsx("span",{className:s,children:r||" "},i)})})}function kue({className:e,content:t}){const n=e??"bg-card text-secondary-foreground mx-auto min-h-0 w-full flex-1 space-y-2 overflow-y-auto break-words text-sm leading-7";return Sce(t)?h.jsxs("div",{className:n,children:[h.jsxs("div",{className:"bg-[#4f3422] text-[#ffc53d] mb-2 flex items-center gap-2 rounded-md px-3 py-2 text-xs",children:[h.jsx(L$,{className:"size-3.5 shrink-0"}),h.jsx("span",{children:"Unresolved conflict markers — showing raw content with side highlighting."})]}),h.jsx(Cue,{content:t})]}):h.jsx("div",{className:n,children:h.jsx(yue,{components:Sue,remarkPlugins:wue,children:t})})}function Eue({onToggleHistory:e}){const{cancelEdit:t,editContent:n,enterEditMode:r,fileData:i,handleSelect:s,hasChanges:a,isEditMode:c,isFetchingFile:u,isUpdating:f,navigateHome:m,nodes:p,saveChanges:y,selectedNode:x,selectedPath:b,setEditContent:S}=uu(),{data:k,isPending:E}=E9({enabled:!!b&&$f(b),path:b}),T=k?.pages[0]?.commits[0],N=w.useMemo(()=>!x||x.type!=="tree"?x?[]:p:x.children??[],[x,p]),j=w.useMemo(()=>N.filter(B=>B.type==="blob").map(B=>B.path),[N]),{data:O}=_ne({enabled:j.length>0,paths:j}),A=w.useMemo(()=>{const B=new Map((O?.files??[]).map(I=>[I.path,I]));return N.map(I=>{const U=B.get(I.path);return{lastUpdatedBy:U?.lastUpdatedBy,lastUpdatedWhen:U?.lastUpdatedWhen?k4(new Date(U.lastUpdatedWhen),{addSuffix:!0}):void 0,name:I.name,path:I.path,type:I.type}})},[N,O]),R=B=>{const I=N.find(U=>U.path===B.path);I&&s(I)},L=()=>{if(!b)return;const B=b.split("/").filter(Boolean);if(B.length<=1){m();return}const I=B.slice(0,-1).join("/");s({children:[],name:"..",path:I,type:"tree"})};return x?.type==="blob"?h.jsxs("div",{className:"flex h-full flex-1 flex-col",children:[h.jsx("div",{className:"px-5 pt-5",children:h.jsx(N4,{})}),h.jsx(ote,{canEdit:!0,content:i?.content??"",contentView:!c&&i?.content?h.jsx(kue,{content:i.content}):void 0,editContent:n,fileName:i?.title??x.name,hasChanges:a,headerClassName:"pt-4 pb-0",isEditMode:c,isHistoryVisible:!1,isLoading:u,isUpdating:f,onCancelEdit:t,onContentChange:S,onEnterEditMode:r,onSaveChanges:y,onToggleHistory:e??yl,showTags:!1,tags:i?.tags,timeline:T?h.jsx(rte,{className:"mx-5 mb-5",description:`${T.author.name} updated ${x.name}`,name:T.author.name,timestamp:k4(new Date(T.timestamp),{addSuffix:!0})}):E?h.jsxs("div",{className:"border-border mx-5 mb-5 flex items-center gap-2 border-b py-2",children:[h.jsx(kr,{className:"size-6 shrink-0 rounded-full"}),h.jsx(kr,{className:"h-4 w-56"})]}):void 0})]}):h.jsxs("div",{className:"flex-1 h-full flex-col flex p-5 gap-4",children:[h.jsx(N4,{}),h.jsx(ste,{nodes:A,onBack:L,onNodeClick:R,showBack:!!b})]})}function jT({title:e,authorName:t,authorAvatar:n,isActive:r,isLast:i,variant:s="default",highlightColor:a="#ED9A00",onClick:c,className:u}){const f=s==="highlight";return h.jsxs("div",{role:c?"button":void 0,onClick:c,className:ae("relative flex gap-4 rounded-lg border border-transparent px-4",{"border-primary bg-primary/5":r,"cursor-pointer":!!c},f&&"bg-[#ED9A00]/5",c&&f&&"hover:bg-[#ED9A00]/10",u),children:[h.jsxs("div",{className:"relative top-3 flex flex-col items-center",children:[f?h.jsx("div",{className:"mt-2 size-2 rounded-full",style:{backgroundColor:a}}):r?h.jsx("div",{className:"bg-primary mt-2 size-2 rounded-full"}):h.jsx(QD,{className:"mt-2 size-2 text-neutral-500",strokeWidth:6}),!i&&!r&&!f&&h.jsx("div",{className:"absolute top-4 h-full w-px bg-neutral-800"})]}),h.jsxs("div",{className:"flex-1 space-y-1 py-3",children:[h.jsx(Ym,{className:"text-foreground mb-1 block text-sm font-medium",text:e}),h.jsxs("div",{className:"flex items-center gap-1.5",children:[h.jsxs(_f,{className:"size-4",children:[n&&h.jsx(O0,{src:n}),h.jsx(Lf,{className:"text-[10px]",children:t[0]})]}),h.jsx("p",{className:"text-muted-foreground text-xs font-medium",children:t})]})]})]})}function MT({isActive:e=!1,isLast:t=!1}){return h.jsxs("div",{className:"relative flex gap-4 rounded-lg px-4",children:[h.jsxs("div",{className:"relative top-3 flex flex-col items-center",children:[h.jsx(kr,{className:"mt-2 size-2 rounded-full"}),!t&&!e&&h.jsx("div",{className:"absolute top-4 h-full w-px bg-neutral-800"})]}),h.jsxs("div",{className:"flex-1 space-y-1 py-3",children:[h.jsx(kr,{className:"h-4 w-3/4"}),h.jsxs("div",{className:"flex items-center gap-1.5",children:[h.jsx(kr,{className:"size-4 rounded-full"}),h.jsx(kr,{className:"h-3 w-24"})]})]})]})}function Tue({showCurrent:e=!0,olderCount:t=3,currentLabel:n="Current",olderLabel:r="Older"}){return h.jsxs("div",{className:"space-y-6",children:[e&&h.jsxs("div",{className:"space-y-2",children:[h.jsx("p",{className:"text-xs font-medium text-neutral-400",children:n}),h.jsx(MT,{isActive:!0})]}),t>0&&h.jsxs("div",{className:"space-y-2",children:[h.jsx("p",{className:"text-xs font-medium text-neutral-400",children:r}),Array.from({length:t}).map((i,s)=>h.jsx(MT,{isLast:s===t-1},s))]})]})}function DT({label:e,children:t}){return h.jsxs("div",{className:"space-y-2",children:[h.jsx("p",{className:"text-xs font-medium text-neutral-400",children:e}),t]})}function Nue({title:e="Version history",isLoading:t,error:n,isEmpty:r,hasNextPage:i,isFetchingNextPage:s,onLoadMore:a,onClose:c,children:u}){return h.jsxs("div",{className:"flex h-full flex-col",children:[h.jsxs("div",{className:"bg-card flex flex-shrink-0 justify-between rounded-t-xl px-6 py-3 pr-3.5",children:[h.jsx("div",{className:"flex items-center gap-2",children:h.jsx("div",{className:"text-foreground text-sm font-semibold",children:e})}),h.jsx("div",{children:h.jsx(ze,{className:"bg-card hover:bg-muted h-9 w-9 rounded-lg p-2",onClick:c,children:h.jsx(n0,{className:"text-muted-foreground size-5"})})})]}),h.jsx("div",{className:"bg-card flex-1 space-y-6 overflow-y-auto rounded-b-xl p-6",children:t?h.jsx(Tue,{showCurrent:!0,olderCount:3}):n?h.jsx("div",{className:"flex items-center justify-center py-12",children:h.jsx("p",{className:"text-sm text-neutral-500",children:"Failed to load history"})}):r?h.jsx("div",{className:"flex items-center justify-center py-12",children:h.jsx("p",{className:"text-sm text-neutral-500",children:"No history available"})}):h.jsxs(h.Fragment,{children:[u,i&&h.jsx(ze,{onClick:a,disabled:s,className:"text-primary w-25 rounded-md bg-transparent text-sm font-medium hover:bg-transparent hover:underline",children:s?h.jsx(Yd,{className:"h-4 w-4 animate-spin"}):"View older"})]})})]})}function Rue({onClose:e}){const{selectedPath:t}=uu(),{data:n,error:r,fetchNextPage:i,hasNextPage:s,isFetchingNextPage:a,isLoading:c}=E9({enabled:!!t&&$f(t),path:t}),u=w.useMemo(()=>n?.pages.flatMap(p=>p.commits)??[],[n]),f=u[0],m=u.slice(1);return h.jsxs(Nue,{error:!!r,hasNextPage:s,isEmpty:!f,isFetchingNextPage:a,isLoading:c,onClose:e,onLoadMore:i,children:[f&&h.jsx(DT,{label:"Current",children:h.jsx(jT,{authorName:f.author.name,isActive:!0,title:_T(f.timestamp)})}),m.length>0&&h.jsx(DT,{label:"Older",children:m.map((p,y)=>h.jsx(jT,{authorName:p.author.name,isLast:y===m.length-1,title:_T(p.timestamp)},p.sha))})]})}function _T(e){try{return`Updated at ${ll(new Date(e),"MMM d, HH:mm")}`}catch{return"Updated"}}function Aue({nodes:e,expandedPaths:t,selectedPath:n,loadingPaths:r,onToggle:i,onSelect:s,disableFileSelect:a,header:c,className:u}){const f=(p,y)=>{p.stopPropagation(),y.type==="tree"&&i(y)},m=p=>{a&&p.type==="blob"||s(p)};return h.jsxs("div",{className:ae("flex h-full flex-col",u),children:[c,h.jsx("div",{className:"max-h-full w-full flex-1 overflow-y-auto",children:e.map(({node:p,depth:y})=>{const x=t.has(p.path),b=n===p.path,S=r?.has(p.path);return h.jsxs("div",{className:ae("text-muted-foreground relative flex h-9 cursor-pointer items-center gap-2 rounded text-sm transition-colors hover:bg-neutral-800",{"bg-secondary text-foreground":b}),style:{paddingLeft:`${String(y*12)}px`},onClick:()=>m(p),children:[Array.from({length:y}).map((k,E)=>h.jsx("div",{className:"absolute top-0 h-full border-l border-neutral-700",style:{left:`${String((E+1)*12)}px`}},E)),h.jsx("div",{className:ae("flex h-full items-center rounded px-1 transition-colors hover:bg-neutral-700",{"pointer-events-none":p.type==="blob"}),onClick:k=>f(k,p),children:h.jsx("span",{className:ae({invisible:p.type==="blob"}),children:S?h.jsx(Yd,{className:"size-4 animate-spin"}):h.jsx(e0,{className:ae("size-4 transition-transform",{"-rotate-90":!x}),size:16})})}),h.jsx("span",{className:"shrink-0",children:p.type==="tree"?h.jsx(Ry,{className:"size-4",strokeWidth:2}):h.jsx(c6,{className:ae("size-4",{"text-primary-foreground":b,"text-primary":!b}),strokeWidth:2})}),h.jsx(Ym,{text:p.name})]},p.path)})})]})}function Oue({count:e=5,className:t}){return h.jsx("div",{className:ae("flex flex-col gap-2",t),children:Array.from({length:e}).map((n,r)=>h.jsxs("div",{className:"flex h-9 items-center gap-4 rounded-lg px-4",children:[h.jsx(kr,{className:"size-5 shrink-0 rounded"}),h.jsx(kr,{className:"h-4",style:{width:`${String(60+r*17%30)}%`}})]},r))})}function jue({onCollapseClick:e}){const{navigateHome:t,selectedPath:n}=uu(),r=!n,i=s=>{s.stopPropagation(),e?.()};return h.jsxs("div",{className:ae("text-muted-foreground flex h-9 cursor-pointer items-center justify-between gap-2 rounded px-2 text-sm transition-colors hover:bg-neutral-800",{"bg-background text-foreground":r}),onClick:t,children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(kA,{className:"size-4",strokeWidth:2}),h.jsx("span",{className:"font-medium",children:"All context"})]}),e&&h.jsx("button",{className:"text-muted-foreground hover:text-foreground flex cursor-pointer items-center rounded p-0.5 transition-colors hover:bg-neutral-700",onClick:i,type:"button",children:h.jsx(Iq,{className:"size-5"})})]})}function Mue({onCollapse:e}){const{expandedPaths:t,flattenedNodes:n,handleSelect:r,handleToggle:i,isFetchingTree:s,selectedPath:a}=uu();return s&&n.length===0?h.jsx(Oue,{className:"p-2",count:8}):h.jsx(Aue,{expandedPaths:t,header:h.jsx(jue,{onCollapseClick:e}),nodes:n,onSelect:r,onToggle:i,selectedPath:a})}function Due(){const{closeRightPanel:e,isLeftPanelOpen:t,isRightPanelOpen:n,toggleLeftPanel:r,toggleRightPanel:i}=Wee(),{selectedPath:s}=uu(),a=n&&$f(s);return h.jsxs("div",{className:"flex h-full gap-4",children:[t?h.jsx("div",{className:"w-72 shrink-0 overflow-y-auto",children:h.jsx(Mue,{onCollapse:r})}):h.jsx("div",{className:"bg-card flex shrink-0 items-start rounded-xl p-2",children:h.jsx("button",{className:"text-muted-foreground hover:text-foreground flex cursor-pointer items-center rounded p-1 transition-colors hover:bg-neutral-800",onClick:r,type:"button",children:h.jsx(zq,{className:"size-5"})})}),h.jsx("div",{className:"bg-card flex min-w-0 flex-1 rounded-xl",children:h.jsx(Eue,{onToggleHistory:i})}),a&&h.jsx("div",{className:"w-80 shrink-0 overflow-y-auto",children:h.jsx(Rue,{onClose:e})})]})}function _ue(){return h.jsx(nte,{children:h.jsx(Due,{})})}function Lue(){return h.jsx(I6,{replace:!0,to:"/contexts"})}const Iue="/assets/not-found-N0eqX-Lm.svg";function LT(){return h.jsxs("div",{className:"flex h-full w-full flex-col items-center justify-center gap-6 p-8 text-center",children:[h.jsx("img",{alt:"",className:"w-30",src:Iue}),h.jsxs("div",{className:"flex flex-col gap-1.5",children:[h.jsx("h1",{className:"text-foreground text-xl font-medium",children:"This page isn't available"}),h.jsx("p",{className:"text-muted-foreground text-sm",children:"We can't find a page with the url you entered."})]}),h.jsx(ze,{className:"px-4",nativeButton:!1,render:h.jsx(cb,{to:"/"}),size:"sm",variant:"secondary",children:"Back to Home"})]})}function Pue(){return h.jsxs("div",{className:"flex flex-col items-center gap-2",children:[h.jsx("img",{alt:"Byterover",className:"size-10",src:Zb}),h.jsx("span",{className:"text-lg font-semibold text-foreground",children:"BYTEROVER"})]})}function zue(){const e=$e(y=>y.isConnected),t=$e(y=>y.setSelectedProject),n=$e(y=>y.version),r=vl(),s=Gi().state?.from?.pathname??"/",{data:a,isLoading:c}=XA({queryConfig:{enabled:e,refetchInterval:3e3,retry:1,staleTime:1e4}}),u=w.useMemo(()=>a?.locations??[],[a]),[f,m]=w.useState(!1);function p(y){t(y.projectPath),r(s,{replace:!0})}return h.jsxs("div",{className:"fixed inset-0 flex items-center justify-center",children:[h.jsxs("div",{className:"flex w-[400px] flex-col gap-4",children:[h.jsxs("div",{className:"flex flex-col items-center gap-2",children:[h.jsx(Pue,{}),h.jsx("div",{className:"flex items-center justify-center gap-1 text-xs font-medium leading-4",children:h.jsxs("span",{className:"text-muted-foreground",children:["Version ",n||"—"]})})]}),h.jsxs("div",{className:"flex flex-col gap-2",children:[h.jsxs("div",{className:"flex items-center gap-2.5 px-2",children:[h.jsx("span",{className:"flex-1 text-xs text-muted-foreground",children:"Recent Projects"}),u.length>0&&h.jsx("button",{className:"text-xs font-medium text-muted-foreground transition-colors hover:text-foreground cursor-pointer",onClick:()=>m(!0),type:"button",children:"See all"})]}),c&&h.jsx("p",{className:"px-2 py-2 text-xs text-muted-foreground",children:"Loading projects..."}),!c&&u.length===0&&h.jsxs("div",{className:"flex flex-col gap-1 px-2 py-2",children:[h.jsx("p",{className:"text-xs text-muted-foreground",children:"No projects found."}),h.jsxs("p",{className:"text-xs text-muted-foreground",children:["Run ",h.jsx("code",{className:"rounded bg-muted px-1.5 py-0.5 text-sm",children:"brv webui"})," in a project directory to get started."]})]}),h.jsx("div",{className:"flex flex-col",children:u.slice(0,5).map(y=>h.jsx(JA,{onClick:()=>p(y),project:y},y.projectPath))})]})]}),h.jsx(e8,{onOpenChange:m,onSelect:p,open:f,projects:u})]})}function Y7({...e}){return h.jsx(xA,{"data-slot":"sheet",...e})}function Fue({...e}){return h.jsx(mv,{"data-slot":"sheet-portal",...e})}function Bue({className:e,...t}){return h.jsx(uv,{"data-slot":"sheet-overlay",className:ae("fixed inset-0 z-50 bg-black/10 transition-opacity duration-150 data-ending-style:opacity-0 data-starting-style:opacity-0 supports-backdrop-filter:backdrop-blur-xs",e),...t})}function W7({className:e,children:t,side:n="right",showCloseButton:r=!0,...i}){return h.jsxs(Fue,{children:[h.jsx(Bue,{}),h.jsxs(hv,{"data-slot":"sheet-content","data-side":n,className:ae("fixed z-50 flex flex-col gap-4 bg-background bg-clip-padding text-sm shadow-lg transition duration-200 ease-in-out data-ending-style:opacity-0 data-starting-style:opacity-0 data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=bottom]:data-ending-style:translate-y-[2.5rem] data-[side=bottom]:data-starting-style:translate-y-[2.5rem] data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:border-r data-[side=left]:data-ending-style:translate-x-[-2.5rem] data-[side=left]:data-starting-style:translate-x-[-2.5rem] data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=right]:data-ending-style:translate-x-[2.5rem] data-[side=right]:data-starting-style:translate-x-[2.5rem] data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=top]:data-ending-style:translate-y-[-2.5rem] data-[side=top]:data-starting-style:translate-y-[-2.5rem] ",e),...i,children:[t,r&&h.jsxs(Of,{"data-slot":"sheet-close",render:h.jsx(ze,{variant:"ghost",className:"absolute top-4 right-4",size:"icon-sm"}),children:[h.jsx(n0,{}),h.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}const Hue="List the most important conventions and patterns used in this codebase — naming, file organization, testing approach, and any rules a new contributor should know before making changes.",Uue="What conventions should I follow when making changes?",Vue={curate:"Step 2 of 4",query:"Step 3 of 4"},que=async e=>{const{apiClient:t}=$e.getState();if(!t)throw new Error("Not connected");const n=await t.request(mr.CLEAR_COMPLETED,e);if(n.error)throw new Error(n.error);return n},$ue=({mutationConfig:e}={})=>dn({...e,mutationFn:que}),Yue=async e=>{const{apiClient:t}=$e.getState();if(!t)throw new Error("Not connected");const n=await t.request(mr.DELETE_BULK,e);if(n.error)throw new Error(n.error);return n},Wue=({mutationConfig:e}={})=>dn({...e,mutationFn:Yue}),Gue=async e=>{const{apiClient:t}=$e.getState();if(!t)throw new Error("Not connected");const n=await t.request(mr.DELETE,e);if(!n.success)throw new Error(n.error??"Delete failed");return n},Kue=({mutationConfig:e}={})=>dn({...e,mutationFn:Gue}),Que=e=>{const{apiClient:t}=$e.getState();return t?t.request(mr.LIST,e):Promise.reject(new Error("Not connected"))},IT=(e={})=>or({queryFn:()=>Que(e),queryKey:["tasks","list",e]});function Xue(e,t){const[n,r]=w.useState(e);return w.useEffect(()=>{const i=setTimeout(()=>r(e),t);return()=>clearTimeout(i)},[e,t]),n}const G7=[{label:"Any duration",value:"all"},{label:"< 5s",value:"short"},{label:"5s – 30s",value:"medium"},{label:"30s – 2m",value:"long"},{label:"> 2m",value:"very-long"}],Zue=new Set(G7.map(e=>e.value));function K7(e){return Zue.has(e)}const Jue={all:"Any duration",long:"30s – 2m",medium:"5s – 30s",short:"< 5s","very-long":"> 2m"},ede={all:{},long:{maxDurationMs:12e4,minDurationMs:3e4},medium:{maxDurationMs:3e4,minDurationMs:5e3},short:{maxDurationMs:5e3},"very-long":{minDurationMs:12e4}};function tde(e){return ede[e]}function nde(e){return Jue[e]}const rde=new Set(["all","cancelled","completed","failed","running"]),Yx=20,ide=["status","types","providers","models","from","to","duration","q","page","pageSize"];function ode(e){return e!==null&&rde.has(e)}function sde(){const[e,t]=a0(),n=w.useMemo(()=>ade(e),[e]),r=w.useCallback((s,a=!0)=>{t(c=>{const u=new URLSearchParams(c);for(const[f,m]of Object.entries(s))m===null||m===""||Array.isArray(m)&&m.length===0?u.delete(f):Array.isArray(m)?u.set(f,m.join(",")):u.set(f,m);return a&&u.delete("page"),u})},[t]),i=w.useMemo(()=>({clearAllFilters(){t(s=>{const a=new URLSearchParams(s);for(const c of ide)a.delete(c);return a})},setDurationPreset(s){r({duration:s==="all"?null:s})},setModelFilter(s){r({models:s})},setPage(s){r({page:s===1?null:String(s)},!1)},setPageSize(s){r({pageSize:s===Yx?null:String(s)})},setProviderFilter(s){r({providers:s})},setSearchQuery(s){r({q:s})},setStatusFilter(s){r({status:s==="all"?null:s})},setTimeRange(s){r({from:s.createdAfter===void 0?null:String(s.createdAfter),to:s.createdBefore===void 0?null:String(s.createdBefore)})},setTypeFilter(s){r({types:s})}}),[r,t]);return{filters:n,...i}}function ade(e){const t=e.get("status"),n=e.get("duration"),r=e.get("page"),i=e.get("pageSize"),s=e.get("from"),a=e.get("to");return{durationPreset:n!==null&&K7(n)?n:"all",modelFilter:xy(e.get("models")),page:r?Math.max(1,Number.parseInt(r,10)||1):1,pageSize:i?Math.max(1,Number.parseInt(i,10)||Yx):Yx,providerFilter:xy(e.get("providers")),searchQuery:e.get("q")??"",statusFilter:ode(t)?t:"all",typeFilter:xy(e.get("types")),...s&&Number.isFinite(Number(s))?{createdAfter:Number(s)}:{},...a&&Number.isFinite(Number(a))?{createdBefore:Number(a)}:{}}}function xy(e){return e?e.split(",").filter(Boolean):[]}function Q7(e,t=1e3){const[n,r]=w.useState(()=>Date.now());return w.useEffect(()=>{if(!e)return;const i=globalThis.setInterval(()=>r(Date.now()),t);return()=>{globalThis.clearInterval(i)}},[e,t]),n}const Wx=kl((e,t)=>({consume(){const{seed:n}=t();return n&&e({seed:null}),n},requestRetry:n=>e({seed:n}),seed:null})),lde={all:void 0,cancelled:["cancelled"],completed:["completed"],failed:["error"],running:["created","started"]};function cde(e){return lde[e]}const ude=e=>{const{apiClient:t}=$e.getState();return t?t.request(mr.CREATE,e):Promise.reject(new Error("Not connected"))},dde=({mutationConfig:e}={})=>dn({...e,mutationFn:ude});function fde(e){const t=dde(),n=e.content.trim().length>0,{isPending:r}=t;return{canSubmit:n,isPending:r,submit:async()=>{if(!n||r)return;if(!e.hasActiveProvider){e.onProviderRequired();return}const s=crypto.randomUUID(),a={...e.projectPath?{clientCwd:e.projectPath,projectPath:e.projectPath}:{},content:e.content.trim(),taskId:s,type:e.type};try{await t.mutateAsync(a);const c=e.type==="query"?"Query":"Curate";ht.success(`${c} task queued`),e.onSubmitted?.(s,e.openDetailAfter),e.onClose()}catch(c){ht.error(c instanceof Error?c.message:"Failed to create task")}}}}const PT={curate:"List the most important conventions and patterns used in this codebase — naming, file organization, testing approach, and any rules a new contributor should know before making changes.",query:"What conventions should I follow when making changes?"},hde={curate:"Plain text knowledge to capture into the project context tree.",query:"The agent searches the project context tree and synthesizes an answer."};function pde({type:e}){return h.jsx("p",{className:"text-muted-foreground/60 text-xs",children:hde[e]})}function mde(){return h.jsxs("p",{className:"text-muted-foreground/60 mt-2 flex items-center gap-1.5 text-xs",children:[h.jsx(h$,{className:"size-3 shrink-0"}),h.jsxs("span",{children:["For file or folder attachments, use"," ",h.jsx("code",{className:"bg-muted text-foreground/80 mono rounded px-1.5 py-0.5 text-[11px]",children:"brv curate -f <path>"})," ","from the CLI."]})]})}function gde({label:e}){return h.jsxs(uo,{className:"text-primary-foreground absolute bottom-2 left-3 gap-1.5 px-2 text-[10px] tracking-[0.08em] uppercase",variant:"secondary",children:[h.jsx("span",{"aria-hidden":!0,className:"bg-primary-foreground size-1.5 rounded-full"}),e]})}let zT=(function(e){return e.checked="data-checked",e.unchecked="data-unchecked",e.indeterminate="data-indeterminate",e.disabled="data-disabled",e.readonly="data-readonly",e.required="data-required",e.valid="data-valid",e.invalid="data-invalid",e.touched="data-touched",e.dirty="data-dirty",e.filled="data-filled",e.focused="data-focused",e})({});function X7(e){return w.useMemo(()=>({checked(t){return e.indeterminate?{}:t?{[zT.checked]:""}:{[zT.unchecked]:""}},...N0}),[e.indeterminate])}function yde(e,t,n,r=!0,i){const[s,a]=w.useState(),c=Si(i?`${i}-label`:void 0),u=e??t??s;return We(()=>{const f=e||t||!r?void 0:xde(n.current,c);s!==f&&a(f)}),u}function xde(e,t){const n=bde(e);if(n)return!n.id&&t&&(n.id=t),n.id||void 0}function bde(e){if(!e)return;const t=e.parentElement;if(t&&t.tagName==="LABEL")return t;const n=e.id;if(n){const i=e.nextElementSibling;if(i&&i.htmlFor===n)return i}const r=e.labels;return r&&r[0]}const Z7=w.createContext(void 0);function vde(){const e=w.useContext(Z7);if(e===void 0)throw new Error(Cn(14));return e}const wde="data-parent",Sde=w.forwardRef(function(t,n){const{checked:r,className:i,defaultChecked:s=!1,"aria-labelledby":a,disabled:c=!1,id:u,indeterminate:f=!1,inputRef:m,name:p,onCheckedChange:y,parent:x=!1,readOnly:b=!1,render:S,required:k=!1,uncheckedValue:E,value:T,nativeButton:N=!1,...j}=t,{clearErrors:O}=Cv(),{disabled:A,name:R,setDirty:L,setFilled:B,setFocused:I,setTouched:U,state:Y,validationMode:V,validityData:q,shouldValidateOnChange:H,validation:z}=Df(),$=uY(),{labelId:G,controlId:Q,registerControlId:_,getDescriptionProps:P}=R0(),W=fY(),D=W?.parent,Z=D&&W.allValues,ee=A||$.disabled||W?.disabled||c,J=R??p,he=T??J,fe=Si(),Se=Si();let Ae=Q;Z?Ae=x?Se:`${D.id}-${he}`:u&&(Ae=u);let Oe={};Z&&(x?Oe=W.parent.getParentProps():he&&(Oe=W.parent.getChildProps(he)));const Pe=tt(y),{checked:_e=r,indeterminate:De=f,onCheckedChange:xe,...Ge}=Oe,we=W?.value,Re=W?.setValue,pe=W?.defaultValue,be=w.useRef(null),ne=ir(()=>Symbol("checkbox-control")),ye=w.useRef(!1),{getButtonProps:Ce,buttonRef:Ve}=El({disabled:ee,native:N}),lt=W?.validation??z,[oe,ke]=$c({controlled:he&&we&&!x?we.includes(he):_e,default:he&&pe&&!x?pe.includes(he):s,name:"Checkbox",state:"checked"});We(()=>{_!==Cr&&(ye.current=!0,_(ne.current,Ae))},[Ae,W,_,x,ne]),w.useEffect(()=>{const Qe=ne.current;return()=>{!ye.current||_===Cr||(ye.current=!1,_(Qe,void 0))}},[_,ne]),Ev({enabled:!W,id:fe,commit:lt.commit,value:oe,controlRef:be,name:J,getValue:()=>oe});const Le=w.useRef(null),Me=ps(m,Le,lt.inputRef),He=yde(a,G,Le,!N,Ae??void 0);We(()=>{Le.current&&(Le.current.indeterminate=De,oe&&B(!0))},[oe,De,B]),yv(oe,()=>{W&&!x||(O(J),B(oe),L(oe!==q.initialValue),H()?lt.commit(oe):lt.commit(oe,!0))});const ut=jo({checked:oe,disabled:ee,name:x?void 0:J,id:N?void 0:Ae??void 0,required:k,ref:Me,style:J?CN:Sb,tabIndex:-1,type:"checkbox","aria-hidden":!0,onChange(Qe){if(Qe.nativeEvent.defaultPrevented)return;const Ct=Qe.target.checked,qe=Et(wl,Qe.nativeEvent);if(xe?.(Ct,qe),Pe(Ct,qe),!qe.isCanceled&&(ke(Ct),he&&we&&Re&&!x)){const ge=Ct?[...we,he]:we.filter(je=>je!==he);Re(ge,qe)}},onFocus(){be.current?.focus()}},T!==void 0?{value:(W?oe&&T:T)||""}:Fn,P,W?lt.getValidationProps:lt.getInputValidationProps),xt=Z?!!_e:oe,Je=Z&&De||f;w.useEffect(()=>{if(!D||!he)return;const Qe=D.disabledStatesRef.current;return Qe.set(he,ee),()=>{Qe.delete(he)}},[D,ee,he]);const Ke=w.useMemo(()=>({...Y,checked:xt,disabled:ee,readOnly:b,required:k,indeterminate:Je}),[Y,xt,ee,b,k,Je]),bt=X7(Ke),nt=jt("span",t,{state:Ke,ref:[Ve,be,n,W?.registerControlRef],props:[{id:N?Ae??void 0:fe,role:"checkbox","aria-checked":De?"mixed":oe,"aria-readonly":b||void 0,"aria-required":k||void 0,"aria-labelledby":He,[wde]:x?"":void 0,onFocus(){I(!0)},onBlur(){const Qe=Le.current;Qe&&(U(!0),I(!1),V==="onBlur"&&lt.commit(W?we:Qe.checked))},onClick(Qe){b||ee||(Qe.preventDefault(),Le.current?.dispatchEvent(new PointerEvent("click",{bubbles:!0,shiftKey:Qe.shiftKey,ctrlKey:Qe.ctrlKey,altKey:Qe.altKey,metaKey:Qe.metaKey})))}},P,lt.getValidationProps,j,Ge,Ce],stateAttributesMapping:bt});return h.jsxs(Z7.Provider,{value:Ke,children:[nt,!oe&&!W&&J&&!x&&E!==void 0&&h.jsx("input",{type:"hidden",name:J,value:E}),h.jsx("input",{...ut})]})}),Cde=w.forwardRef(function(t,n){const{render:r,className:i,keepMounted:s=!1,...a}=t,c=vde(),u=c.checked||c.indeterminate,{mounted:f,transitionStatus:m,setMounted:p}=Sa(u),y=w.useRef(null),x={...c,transitionStatus:m};Ki({open:u,ref:y,onComplete(){u||p(!1)}});const b=X7(c),S=w.useMemo(()=>({...b,...ws,...N0}),[b]),k=s||f,E=jt("span",t,{ref:[n,y],state:x,stateAttributesMapping:S,props:a});return k?E:null});function kde({className:e,...t}){return h.jsx(Sde,{"data-slot":"checkbox",className:ae("peer relative flex size-4 shrink-0 items-center justify-center rounded-[4px] border border-input shadow-xs transition-shadow outline-none group-has-disabled/field:opacity-50 after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-foreground dark:data-checked:bg-primary",e),...t,children:h.jsx(Cde,{"data-slot":"checkbox-indicator",className:"grid place-content-center text-current transition-none [&>svg]:size-3.5",children:h.jsx(bf,{})})})}function Ede({canSubmit:e,hasActiveProvider:t,inTour:n,isPending:r,onClose:i,onOpenDetailChange:s,onSubmit:a,openDetailAfter:c,type:u}){const y=r?u==="query"?"Querying…":"Curating…":n||t?u==="query"?"Query":"Curate":"Connect provider…";return h.jsxs("footer",{className:"border-border flex items-center justify-between gap-3 border-t px-7 py-3.5",children:[n?h.jsx("span",{}):h.jsxs("label",{className:"text-muted-foreground inline-flex cursor-pointer items-center gap-2 text-xs",children:[h.jsx(kde,{checked:c,onCheckedChange:s}),"Open after submit"]}),h.jsxs("div",{className:"ml-2 flex items-center gap-2",children:[h.jsx(ze,{onClick:i,size:"sm",variant:"ghost",children:"Cancel"}),h.jsx(ze,{disabled:!e||r,onClick:a,size:"sm",children:y})]})]})}function Tde({inTour:e,onTypeChange:t,projectPath:n,tourStepLabel:r,type:i}){return h.jsxs("header",{className:"border-border flex flex-col gap-2 border-b px-7 pt-5 pb-4",children:[r&&h.jsx(T0,{label:r}),h.jsxs("div",{className:"flex items-center justify-between gap-4 pr-10",children:[h.jsxs("h2",{className:"text-foreground flex items-baseline gap-1.5 text-lg font-medium tracking-tight",children:[h.jsx("span",{className:"text-muted-foreground/70 font-normal",children:"New"}),h.jsxs("span",{children:[i," task"]})]}),e?h.jsxs(ms,{children:[h.jsx(gs,{render:h.jsx(FT,{disabled:!0,onChange:t,value:i})}),h.jsx(ys,{children:"Locked during the tour — the next step covers the other mode."})]}):h.jsx(FT,{onChange:t,value:i})]}),h.jsxs("p",{className:"text-muted-foreground/70 text-xs",children:[i==="query"?"Searches":"Will dispatch to"," ",h.jsx("span",{className:"text-identifier mono",children:n||"(no project selected)"})]})]})}function FT({disabled:e=!1,onChange:t,value:n}){return h.jsxs("div",{"aria-disabled":e,className:ae("border-border bg-muted relative inline-flex rounded-md border p-0.5",e&&"opacity-60"),children:[h.jsx("span",{"aria-hidden":!0,className:ae("bg-background border-border absolute top-0.5 bottom-0.5 w-[calc(50%-2px)] rounded border transition-transform duration-200 ease-out",n==="query"?"translate-x-full":"translate-x-0")}),["curate","query"].map(r=>h.jsx("button",{className:ae("relative z-10 px-3 py-1 text-xs font-medium transition-colors",r===n?"text-foreground":"text-muted-foreground hover:text-foreground/80",e&&"cursor-not-allowed hover:text-muted-foreground"),disabled:e,onClick:()=>t(r),type:"button",children:r==="curate"?"Curate":"Query"},r))]})}function Nde({initialContent:e,initialType:t,onClose:n,onSubmitted:r,open:i,prefillNotice:s,tourStepLabel:a}){const c=!!a;return h.jsx(Y7,{onOpenChange:u=>!u&&n(),open:i,children:h.jsx(W7,{className:ae("data-[side=right]:w-full data-[side=right]:max-w-xl p-0 shadow-[inset_1px_0_0_rgba(96,165,250,0.18)]",!c&&"sheet-no-overlay"),side:"right",children:i&&h.jsx(Rde,{initialContent:e,initialType:t,onClose:n,onSubmitted:r,prefillNotice:s,tourStepLabel:a})})})}function Rde({initialContent:e,initialType:t,onClose:n,onSubmitted:r,prefillNotice:i,tourStepLabel:s}){const a=$e(U=>U.selectedProject),{data:c}=av(),[u,f]=w.useState(t??"curate"),[m,p]=w.useState(e??""),[y,x]=w.useState(!0),[b,S]=w.useState(!1),[k,E]=w.useState(!!e),T=w.useRef(null);w.useEffect(()=>{T.current?.focus()},[]);const N=!!c,j=!!s,{canSubmit:O,isPending:A,submit:R}=fde({content:m,hasActiveProvider:N,onClose:n,onProviderRequired:()=>S(!0),onSubmitted:r,openDetailAfter:y,projectPath:a,type:u}),L=U=>{if((U.metaKey||U.ctrlKey)&&U.key==="Enter"){U.preventDefault(),R().catch(()=>{});return}U.key==="Tab"&&!U.shiftKey&&!m&&(U.preventDefault(),p(PT[u]))},B=!!(i&&k&&m===(e??"")),I=U=>{k&&U!==(e??"")&&E(!1),p(U)};return h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[h.jsx(Tde,{inTour:j,onTypeChange:f,projectPath:a,tourStepLabel:s,type:u}),h.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-3 overflow-y-auto px-7 py-5",children:[h.jsxs("div",{className:"space-y-1.5",children:[h.jsxs("div",{className:"relative",children:[h.jsx(Iv,{className:"bg-card dark:bg-card text-foreground/90 mono min-h-64 pr-4 pb-7 text-sm leading-relaxed",onChange:U=>I(U.target.value),onKeyDown:L,placeholder:PT[u],ref:T,rows:u==="query"?4:6,value:m}),B&&i&&h.jsx(gde,{label:i}),h.jsxs("span",{className:"text-muted-foreground/40 mono pointer-events-none absolute right-3 bottom-2 flex items-center gap-2 text-[10px] tabular-nums",children:[h.jsx("span",{className:"text-muted-foreground/60",children:m?h.jsxs(h.Fragment,{children:[h.jsxs("kbd",{className:"bg-muted text-foreground/70 inline-flex items-center gap-1 rounded px-1.5 py-0.5 leading-none",children:[h.jsx(qq,{className:"size-2.5"})," · Ctrl + Enter"]})," ","to ",u]}):h.jsxs(h.Fragment,{children:[h.jsx("kbd",{className:"bg-muted text-foreground/70 inline-flex items-center rounded px-1.5 py-0.5 leading-none",children:"Tab"})," ","to use example"]})}),h.jsxs("span",{children:[m.length," chars"]})]})]}),h.jsx(pde,{type:u})]}),u==="curate"&&!j&&h.jsx(mde,{})]}),h.jsx(Ede,{canSubmit:O,hasActiveProvider:N,inTour:j,isPending:A,onClose:n,onOpenDetailChange:x,onSubmit:R,openDetailAfter:y,type:u})]}),h.jsx(A0,{onOpenChange:S,open:b})]})}const J7={curate:"Step 2 of 4",query:"Step 3 of 4"},Ade={curate:"Continue to query",query:"Continue to connector"},Ode={curate:"Watch the agent capture this knowledge into your context tree.",query:"Watch the agent search the context tree and synthesize an answer."},jde={curate:"Knowledge captured. Ready to ask a question about it?",query:"Answer synthesized. One last step — connect ByteRover to your AI tool."};function eO(e){const t=Ht(s=>s.tourActive),n=Ht(s=>s.tourStep),r=Ht(s=>s.tourTaskId);return t&&r===e.taskId&&(n==="curate"||n==="query")?n:null}function Mde(e,t){return e==="completed"?"Task done. Scroll for the Continue button.":e==="error"?"Task failed. Use Try again below or fix the provider config.":e==="cancelled"?"Task cancelled. Use Try again below to retry.":Ode[t]}function Dde({task:e}){const t=eO(e);return t?h.jsxs("div",{className:"border-primary-foreground/30 bg-primary/8 flex items-center gap-3 rounded-lg border px-4 py-2.5",children:[h.jsx(T0,{label:J7[t]}),h.jsx("span",{className:"text-muted-foreground text-sm",children:Mde(e.status,t)})]}):null}function _de({task:e}){const t=Ht(r=>r.advanceTour),n=eO(e);return!n||e.status!=="completed"?null:h.jsxs("div",{className:"border-primary-foreground/40 bg-primary/12 flex items-center gap-4 rounded-lg border px-4 py-3.5",children:[h.jsx("span",{className:"bg-primary-foreground/20 text-primary-foreground grid size-8 shrink-0 place-items-center rounded-full",children:h.jsx(Rl,{className:"size-4",strokeWidth:3})}),h.jsxs("div",{className:"flex-1",children:[h.jsx("p",{className:"text-foreground text-sm font-medium",children:jde[n]}),h.jsxs("p",{className:"text-muted-foreground text-xs",children:[J7[n]," complete"]})]}),h.jsxs(ze,{onClick:()=>t(),type:"button",children:[Ade[n],h.jsx(wA,{className:"size-4"})]})]})}const Lde=e=>{const{apiClient:t}=$e.getState();return t?t.request(mr.GET,{taskId:e}):Promise.reject(new Error("Not connected"))},Ide=(e,t)=>({enabled:t,queryFn:()=>Lde(e),queryKey:["tasks","detail",e],staleTime:Number.POSITIVE_INFINITY}),Pde=({enabled:e,queryConfig:t,taskId:n})=>or({...Ide(n,e),...t,enabled:e}),zde=80;function Fde(e,t=!0){const n=w.useRef(null),r=w.useRef(!0),i=w.useCallback(()=>{const s=n.current;if(!s)return;const a=s.scrollHeight-s.scrollTop-s.clientHeight;r.current=a<zde},[]);return w.useLayoutEffect(()=>{if(!t)return;const s=n.current;!s||!r.current||(s.scrollTop=s.scrollHeight)},[t,...e]),{onScroll:i,ref:n}}function Bde(e){const t={content:e.content,createdAt:e.createdAt,status:e.status,taskId:e.taskId,type:e.type,...e.files?{files:e.files}:{},...e.folderPath?{folderPath:e.folderPath}:{},...e.model?{model:e.model}:{},...e.projectPath?{projectPath:e.projectPath}:{},...e.provider?{provider:e.provider}:{},...e.reasoningContents?{reasoningContents:e.reasoningContents}:{},...e.responseContent?{responseContent:e.responseContent}:{},...e.sessionId?{sessionId:e.sessionId}:{},...e.toolCalls?{toolCalls:e.toolCalls}:{}};switch(e.status){case"cancelled":return{...t,completedAt:e.completedAt,...e.startedAt?{startedAt:e.startedAt}:{}};case"completed":return{...t,completedAt:e.completedAt,...e.result?{result:e.result}:{},...e.startedAt?{startedAt:e.startedAt}:{}};case"created":return t;case"error":return{...t,completedAt:e.completedAt,error:e.error,...e.startedAt?{startedAt:e.startedAt}:{}};case"started":return{...t,startedAt:e.startedAt}}}function Hde(e){const t=[];for(const n of e.reasoningContents??[])t.push({item:n,kind:"reasoning",timestamp:n.timestamp});for(const n of e.toolCalls??[])t.push({call:n,kind:"toolCall",timestamp:n.timestamp});return t.sort((n,r)=>n.timestamp-r.timestamp),t}const Pc=e=>String(e).padStart(2,"0");function tO(e,t){const n=Math.max(0,t-e),r=Math.round(n/1e3);if(r<60)return`${r}s`;const i=Math.round(r/60);if(i<60)return`${i}m`;const s=Math.round(i/60);return s<24?`${s}h`:`${Math.round(s/24)}d`}function Md(e){const t=Math.floor(Math.max(0,e)/1e3),n=Math.floor(t/3600),r=Math.floor(t%3600/60),i=t%60;return n>0?`${n}:${Pc(r)}:${Pc(i)}`:`${r}:${Pc(i)}`}function nO(e){const t=new Date(e);return`${Pc(t.getHours())}:${Pc(t.getMinutes())}:${Pc(t.getSeconds())}`}function rO(e){if(!e)return"";const t=e.replace(/^task[_-]?/,"");return t.length>8?t.slice(0,8):t}const ns=e=>On(e,"path")??On(e,"file_path")??On(e,"filePath")??"",Ude=e=>On(e,"command")??"",Vde=e=>On(e,"code")??"",kd=e=>On(e,"query")??"",Up=e=>On(e,"path")??On(e,"key")??On(e,"name")??"",qde=e=>{const t=On(e,"pattern")??"",n=On(e,"path");return n?`${t} in ${n}`:t},$de=e=>{const t=On(e,"pattern")??"",n=On(e,"path");return n?`${t} in ${n}`:t},BT=(e,t)=>n=>{const r=n[e];return Array.isArray(r)?`${r.length} ${t}${r.length===1?"":"s"}`:""},HT=(e,t=80)=>e.length>t?`${e.slice(0,t-1)}…`:e,Yde={agentic_map:e=>ns(e)||kd(e),bash_exec:Ude,bash_output:e=>On(e,"processId")??"",batch:BT("calls","call"),code_exec:Vde,create_knowledge_topic:e=>On(e,"path")??On(e,"topic")??"",curate:e=>On(e,"title")??On(e,"path")??"",delete_memory:Up,detect_domains:e=>HT(On(e,"data")??"",60),edit_file:ns,edit_memory:Up,expand_knowledge:e=>On(e,"stubPath")??ns(e),glob_files:$de,grep_content:qde,ingest_resource:e=>On(e,"source")??On(e,"url")??ns(e),kill_process:e=>On(e,"processId")??"",list_directory:ns,list_memories:ns,llm_map:e=>ns(e)||kd(e),read_file:ns,read_memory:Up,read_todos:()=>"",search_history:kd,search_knowledge:kd,swarm_query:kd,swarm_store:e=>HT(On(e,"content")??"",60),write_file:ns,write_memory:Up,write_todos:BT("todos","todo")};function Wde(e){const t=Object.entries(e).find(([,n])=>typeof n=="string"||typeof n=="number");return t?String(t[1]):""}function Cw(e){const t=Yde[e.toolName];return t?t(e.args):Wde(e.args)}function On(e,t){const n=e[t];return typeof n=="string"?n:void 0}const Gde={a({children:e,href:t}){return t?h.jsx("a",{className:"text-identifier underline-offset-2 hover:underline",href:t,rel:"noopener noreferrer",target:"_blank",children:e}):h.jsx(h.Fragment,{children:e})},blockquote({children:e}){return h.jsx("blockquote",{className:"border-border text-muted-foreground border-l-2 pl-3 italic",children:e})},code({children:e,className:t}){const n=String(e).replace(/\n$/,""),i=/language-(\w+)/.exec(t??"")?.[1];return n.includes(`
127
+ `)||i?h.jsx("div",{className:"border-border/50 bg-muted/40 my-2 overflow-x-auto rounded-md border",children:h.jsx(fn,{codeTagProps:{style:{fontFamily:"ui-monospace, SF Mono, Menlo, Consolas, monospace",fontSize:"0.75rem"}},customStyle:{background:"transparent",fontSize:"0.75rem",lineHeight:1.6,margin:0,padding:"0.75rem"},language:i??"plaintext",PreTag:"div",style:Sw,children:n})}):h.jsx("code",{className:"bg-muted/60 rounded px-1 py-0.5 mono text-[0.85em] text-zinc-200",children:e})},h1({children:e}){return h.jsx("h1",{className:"text-foreground mt-3 mb-2 text-base font-semibold",children:e})},h2({children:e}){return h.jsx("h2",{className:"text-foreground mt-3 mb-2 text-sm font-semibold",children:e})},h3({children:e}){return h.jsx("h3",{className:"text-foreground mt-3 mb-2 text-sm font-semibold",children:e})},li({children:e}){return h.jsx("li",{className:"my-0.5 leading-relaxed",children:e})},ol({children:e}){return h.jsx("ol",{className:"my-2 list-inside list-decimal space-y-1 pl-1",children:e})},p({children:e}){return h.jsx("p",{className:"my-1.5 leading-relaxed first:mt-0 last:mb-0",children:e})},ul({children:e}){return h.jsx("ul",{className:"my-2 list-inside list-disc space-y-1 pl-1",children:e})}},Kde=[D7],Xf=w.memo(({children:e,className:t})=>h.jsx("div",{className:t??"text-foreground/90 text-sm",children:h.jsx(c7,{components:Gde,remarkPlugins:Kde,children:e})}));Xf.displayName="MarkdownInline";function by(){return h.jsx("span",{"aria-hidden":!0,className:"text-muted-foreground/40",children:"·"})}function yf({children:e,count:t}){return h.jsxs("div",{className:"text-muted-foreground mono mb-3 flex items-baseline gap-2 text-[11px] uppercase tracking-wider",children:[h.jsx("span",{children:e}),h.jsx("span",{className:"bg-border/50 h-px flex-1"}),t!==void 0&&h.jsx("span",{className:"tabular-nums",children:t})]})}const Qde={completed:"bg-emerald-500",error:"bg-red-400",muted:"bg-muted-foreground/60",running:"bg-blue-400"},Xde={completed:"bg-emerald-500/70",error:"bg-red-400/70",muted:"bg-muted-foreground/30",running:"rail-running"};function kw({flash:e,tone:t,tooltip:n}){const r=h.jsxs("span",{className:"absolute top-1 left-0 grid size-3 place-items-center",children:[h.jsx("span",{className:ae("ring-background relative z-10 size-2 rounded-full ring-[1.5px]",Qde[t],e&&"animate-dot-flash")}),t==="running"&&h.jsx("span",{className:"bg-blue-400 absolute inset-0 rounded-full opacity-50 animate-dot-pulse"})]});return n?h.jsxs(ms,{children:[h.jsx(gs,{render:r}),h.jsx(ys,{children:n})]}):r}function iO({tone:e}){const t=e==="completed"?Rl:Sv,n=e==="completed"?"bg-emerald-500":"bg-red-400";return h.jsx("span",{className:"absolute -top-0.5 -left-1 grid size-5 place-items-center",children:h.jsx("span",{className:ae("ring-background relative grid size-4 place-items-center rounded-full ring-2",n),children:h.jsx(t,{className:"text-background absolute size-3 stroke-3"})})})}function Zde(e,t){const n=e.startedAt??e.createdAt,r=e.completedAt??t;return Math.max(0,r-n)}function UT(e,t){if(!e||!t)return e;const n=t.replaceAll("-","_"),r=new RegExp(`_${n}\\b`,"g");return e.replaceAll(r,"")}const Jde={completed:"text-emerald-500/80",error:"text-red-400/80",running:"text-blue-400/80"},Zm={bash_exec:{in:"bash",out:"bash"},bash_output:{in:"bash",out:"bash"},code_exec:{in:"javascript",out:"json"}},efe={agentic_map:"map",bash_exec:"bash",bash_output:"bash output",code_exec:"code exec",create_knowledge_topic:"new topic",delete_memory:"delete memory",detect_domains:"detect domains",edit_file:"edit",edit_memory:"edit memory",expand_knowledge:"expand",glob_files:"glob",grep_content:"grep",ingest_resource:"ingest",kill_process:"kill",list_directory:"list",list_memories:"memories",llm_map:"llm map",read_file:"read",read_memory:"read memory",read_todos:"todos",search_history:"history",search_knowledge:"search",swarm_query:"swarm query",swarm_store:"swarm store",write_file:"write",write_memory:"write memory",write_todos:"todos"};function tfe(e){return efe[e]??e.replaceAll("_"," ")}const nfe={bash:"bash",c:"c",cjs:"javascript",cpp:"cpp",cs:"csharp",css:"css",go:"go",h:"c",hpp:"cpp",htm:"html",html:"html",java:"java",js:"javascript",json:"json",jsx:"jsx",kt:"kotlin",less:"less",md:"markdown",mdx:"markdown",mjs:"javascript",php:"php",py:"python",rb:"ruby",rs:"rust",scss:"scss",sh:"bash",sql:"sql",swift:"swift",toml:"toml",ts:"typescript",tsx:"tsx",xml:"xml",yaml:"yaml",yml:"yaml",zsh:"bash"};function rfe(e){const t=typeof e.path=="string"&&e.path||typeof e.file_path=="string"&&e.file_path||typeof e.filePath=="string"&&e.filePath;if(!t)return;const n=t.lastIndexOf(".");if(n===-1||n===t.length-1)return;const r=t.slice(n+1).toLowerCase();return nfe[r]}const ife=new Set(["delete_memory","edit_memory","list_memories","read_memory","write_memory"]),ofe=new Set(["bash_output"]),sfe=new Set(["create_knowledge_topic","curate","detect_domains","expand_knowledge","ingest_resource","list_directory","list_memories","read_todos","search_history","search_knowledge","swarm_query","swarm_store","write_todos"]);function afe(e){return e in Zm?{format:"code",language:Zm[e].in}:ife.has(e)?{format:"keypath"}:{format:"markdown"}}function lfe(e,t){return ofe.has(e)?{format:"plain"}:t?{format:"code",language:t}:e in Zm?{format:"code",language:Zm[e].out}:sfe.has(e)?{format:"code",language:"json"}:{format:"markdown"}}const oO=w.memo(({content:e,language:t="bash"})=>h.jsx(fn,{codeTagProps:{style:{fontFamily:"ui-monospace, SF Mono, Menlo, Consolas, monospace",fontSize:"0.75rem"}},customStyle:{background:"transparent",fontSize:"0.75rem",lineHeight:1.6,margin:0,padding:0},language:t,PreTag:"div",style:Sw,children:e}));oO.displayName="CodeBlock";function cfe({call:e,flash:t,taskId:n,tooltip:r}){const[i,s]=w.useState(!1),a=w.useMemo(()=>UT(Cw(e),n),[e,n]),c=w.useMemo(()=>UT(pfe(e),n),[e,n]),u=w.useMemo(()=>rfe(e.args),[e.args]),f=afe(e.toolName),m=lfe(e.toolName,u),p=c.length>0,y=e.status==="running",x=()=>s(b=>!b);return h.jsxs(h.Fragment,{children:[h.jsx(kw,{flash:t,tone:e.status,tooltip:r}),h.jsxs("div",{className:"text-muted-foreground mb-2 flex flex-wrap items-baseline gap-2 text-[11px]",children:[h.jsx("span",{className:ae("mono uppercase tracking-wider",Jde[e.status]),children:tfe(e.toolName)}),y&&h.jsx("span",{className:"text-blue-400/80",children:"running"})]}),h.jsxs("button",{"aria-expanded":i,className:"border-border/50 bg-muted/30 hover:bg-muted/60 group/toolblock relative w-full cursor-pointer rounded-md border text-left transition",onClick:x,type:"button",children:[h.jsx(VT,{collapsedHeight:"max-h-5",collapsedLines:ufe,content:a||"—",empty:!a,expanded:i,format:f.format,label:"in",language:f.language}),h.jsx("div",{className:"border-border/50 border-t"}),h.jsx(VT,{collapsedHeight:"max-h-16",collapsedLines:dfe,content:c,empty:!p,expanded:i,format:m.format,label:"out",language:m.language,placeholder:y?"running…":"—"}),!i&&h.jsx("span",{"aria-hidden":!0,className:"from-background/95 via-background/60 pointer-events-none absolute inset-x-0 bottom-0 h-10 rounded-b-md bg-linear-to-t to-transparent"}),h.jsxs("span",{className:"border-border bg-background/80 text-foreground/80 group-hover/toolblock:text-foreground group-hover/toolblock:border-foreground/30 group-hover/toolblock:bg-muted absolute bottom-2 left-1/2 inline-flex -translate-x-1/2 items-center gap-1.5 rounded-full border px-3.5 py-1.5 text-xs font-medium shadow-lg backdrop-blur-md transition",children:[h.jsx("span",{children:i?"Click to collapse":"Click to expand"}),i?h.jsx(_q,{className:"size-3.5"}):h.jsx(Mf,{className:"size-3.5"})]})]})]})}const ufe=1,dfe=3;function VT({collapsedHeight:e,collapsedLines:t,content:n,empty:r,expanded:i,format:s,label:a,language:c,placeholder:u}){const f=w.useMemo(()=>i?0:Math.max(0,n.split(`
128
+ `).length-t),[n,t,i]),m=()=>{switch(s){case"code":return h.jsx(oO,{content:n,language:c});case"keypath":return h.jsx(hfe,{path:n});case"plain":return h.jsx(ffe,{content:n});default:return h.jsx(Xf,{className:"text-foreground/90 text-sm",children:n})}};return h.jsxs("div",{className:"flex items-start gap-3 px-3 py-2",children:[h.jsxs("span",{className:"text-muted-foreground mono mt-[3px] flex w-7 shrink-0 flex-col items-start text-[10px] uppercase tracking-wider",children:[h.jsx("span",{children:a}),f>0&&h.jsxs("span",{className:"text-muted-foreground/60 mt-1 text-[9px] normal-case tracking-normal",children:["+",f]})]}),h.jsx("div",{className:"min-w-0 flex-1 overflow-x-auto",children:r?h.jsx("span",{className:"text-muted-foreground/60 italic text-xs",children:u??"—"}):i?m():h.jsx("div",{className:ae("overflow-hidden",e),children:m()})})]})}function ffe({content:e}){return h.jsx("pre",{className:"text-foreground/85 mono m-0 text-xs leading-6 whitespace-pre-wrap",children:e})}function hfe({path:e}){const t=e.split("/");return h.jsx("span",{className:"text-foreground/90 mono text-sm",children:t.map((n,r)=>h.jsxs(w.Fragment,{children:[r>0&&h.jsx("span",{className:"text-muted-foreground/40 mx-0.5",children:"/"}),n]},r))})}function pfe(e){if(e.status==="error"&&e.error)return e.error;if(e.result===void 0||e.result===null)return"";if(typeof e.result=="string"){const t=e.result.trim();return t.length>1200?`${t.slice(0,1200)}
129
+ …`:t}try{const t=JSON.stringify(e.result,null,2);return t.length>1200?`${t.slice(0,1200)}
130
+ …`:t}catch{return String(e.result)}}const mfe={curate:"Curating","curate-folder":"Curating",query:"Querying"};function Vp(e,t){return`${e.kind}-${t}-${e.timestamp}`}function vy(e){return e.kind==="reasoning"?"muted":e.call.status==="error"?"error":e.call.status==="running"?"running":"completed"}function gfe({now:e,task:t}){const n=w.useMemo(()=>Hde(t),[t]),r=Vc(t.status),i=w.useRef(null),s=w.useRef(new Map);i.current===null&&(i.current=new Set(n.map((u,f)=>Vp(u,f))));const a=[],c=new Set;for(const[u,f]of n.entries()){const m=Vp(f,u);i.current.has(m)||a.push(m);const p=vy(f);s.current.get(m)==="running"&&(p==="completed"||p==="error")&&c.add(m)}return w.useEffect(()=>{if(i.current)for(const[u,f]of n.entries()){const m=Vp(f,u);i.current.add(m),s.current.set(m,vy(f))}}),n.length===0?h.jsxs("section",{children:[h.jsx(yf,{children:"Event log"}),r?h.jsx("ol",{className:"space-y-5",children:h.jsx(qT,{taskType:t.type})}):h.jsx("p",{className:"text-muted-foreground text-center text-sm py-6",children:"No events captured for this task."})]}):h.jsxs("section",{children:[h.jsx(yf,{count:n.length,children:"Event log"}),h.jsxs("ol",{className:"space-y-5",children:[n.map((u,f)=>{const m=Vp(u,f),p=a.indexOf(m),y=f===n.length-1,x=t.status==="completed"&&!!t.result,b=t.status==="error"&&!!t.error,k=!y||r||(x||b),E=n[f+1]?.timestamp??t.completedAt??e;let T=vy(u);return y&&(r?T="running":x?T="completed":b&&(T="error")),h.jsx(yfe,{endTimestamp:E,event:u,flash:c.has(m),hasNext:k,isNew:p!==-1,railTone:T,staggerIndex:Math.max(p,0),taskId:t.taskId,taskTerminal:aa(t.status),tooltip:xfe(u,E)},m)}),r&&h.jsx(qT,{taskType:t.type})]})]})}function qT({taskType:e}){const t=mfe[e]??"Working";return h.jsxs("li",{className:"relative pl-7",children:[h.jsx(kw,{tone:"running"}),h.jsx("span",{className:"bg-blue-400/70 absolute top-[9px] left-[13px] h-px w-5.5 rounded"}),h.jsx("span",{className:"text-blue-400/70 mono absolute top-[2px] left-10 text-[9px] uppercase tracking-wider",children:"now"}),h.jsxs("span",{className:"text-blue-400 italic text-sm ml-10",children:[t,"…"]})]})}function yfe({endTimestamp:e,event:t,flash:n,hasNext:r,isNew:i,railTone:s,staggerIndex:a,taskId:c,taskTerminal:u,tooltip:f}){return h.jsxs("li",{className:ae("relative pl-7",i&&"animate-in fade-in slide-in-from-bottom-1 duration-300 fill-mode-both"),style:i?{animationDelay:`${a*60}ms`}:void 0,children:[r&&h.jsx("div",{className:ae("absolute top-3 -bottom-7 left-[5px] w-0.5 rounded-full",Xde[s])}),t.kind==="reasoning"?h.jsx(vfe,{endTimestamp:e,flash:n,hasNext:r,item:t.item,taskTerminal:u,tooltip:f}):h.jsx(cfe,{call:t.call,flash:n,taskId:c,tooltip:f})]})}function xfe(e,t){const n=nO(e.timestamp),r=bfe(t-e.timestamp);if(e.kind==="reasoning")return h.jsxs("span",{className:"flex flex-col gap-0.5",children:[h.jsxs("span",{children:[h.jsx("span",{className:"mono text-muted-foreground tabular-nums",children:n}),h.jsxs("span",{className:"mono text-blue-400 ml-2 tabular-nums",children:["+",r]})]}),h.jsx("span",{className:"mono text-foreground/80 text-[10px]",children:"reasoning"})]});const i=Cw(e.call).slice(0,60);return h.jsxs("span",{className:"flex flex-col gap-0.5",children:[h.jsxs("span",{children:[h.jsx("span",{className:"mono text-muted-foreground tabular-nums",children:n}),h.jsxs("span",{className:"mono text-blue-400 ml-2 tabular-nums",children:["+",r]})]}),h.jsxs("span",{className:"mono text-foreground/80 text-[10px] wrap-break-word",children:[e.call.toolName,i&&` · ${i}`]})]})}function bfe(e){if(e<1e3)return`${Math.max(1,Math.round(e))}ms`;const t=e/1e3;return t<60?`${t.toFixed(t<10?1:0)}s`:`${Math.floor(t/60)}m ${Math.round(t%60)}s`}function vfe({endTimestamp:e,flash:t,hasNext:n,item:r,taskTerminal:i,tooltip:s}){const a=(r.isThinking||!r.content)&&!i&&!n,c=a?void 0:wfe(e-r.timestamp);return h.jsxs(h.Fragment,{children:[h.jsx(kw,{flash:t,tone:"muted",tooltip:s}),h.jsxs("div",{className:"text-muted-foreground mb-1.5 flex items-baseline gap-2 text-[11px]",children:[h.jsx("span",{className:"mono uppercase tracking-wider",children:"reasoning"}),a?h.jsxs("span",{className:"text-blue-400/80 inline-flex items-center gap-1.5 italic",children:[h.jsx("span",{className:"bg-blue-400 size-1 rounded-full animate-pulse"}),"thinking…"]}):c&&h.jsxs("span",{className:"italic",children:["Thought for ",c]})]}),r.content&&h.jsx(Xf,{className:"text-foreground/90 text-sm",children:r.content})]})}function wfe(e){const t=Math.max(1,Math.round(e/1e3));if(t<60)return`${t}s`;const n=Math.floor(t/60),r=t%60;return r>0?`${n}m ${r}s`:`${n}m`}const Sfe={cancelled:{dot:"bg-zinc-500",label:"cancelled",pulse:!1,tone:"border-zinc-500/30 bg-zinc-500/10 text-zinc-400"},completed:{dot:"bg-emerald-500",label:"done",pulse:!1,tone:"border-emerald-500/30 bg-emerald-500/10 text-emerald-500"},created:{dot:"bg-zinc-400",label:"pending",pulse:!0,tone:"border-zinc-400/30 bg-zinc-400/10 text-zinc-300"},error:{dot:"bg-red-400",label:"failed",pulse:!1,tone:"border-red-500/30 bg-red-500/10 text-red-400"},started:{dot:"bg-blue-400",label:"running",pulse:!0,tone:"border-blue-500/30 bg-blue-500/10 text-blue-400"}};function sO({className:e,showLabel:t=!0,size:n="sm",status:r}){const{dot:i,label:s,pulse:a,tone:c}=Sfe[r];return h.jsxs(uo,{className:ae(c,n==="md"?"text-xs":"text-[11px]","gap-1.5 font-medium tracking-normal",r==="started"&&"shadow-[inset_0_0_6px_rgba(96,165,250,0.2)]",e),variant:"outline",children:[h.jsx("span",{className:ae("size-1.5 shrink-0 rounded-full",i,a&&"animate-pill-ping")}),t&&h.jsx("span",{children:s})]})}const Cfe={cancelled:"cancelled",completed:"finished",created:"started",error:"finished",started:"started"};function kfe({now:e,task:t}){const n=aa(t.status),r=Zde(t,e),i=t.startedAt??t.createdAt,s=Cfe[t.status],a=n?"ran":"running";return h.jsxs("header",{className:"px-6 pt-5 pb-4",children:[h.jsxs("div",{className:"flex items-center gap-3 pr-12",children:[h.jsx(sO,{status:t.status}),h.jsx("h1",{className:"text-foreground min-w-0 flex-1 truncate text-lg leading-tight font-medium tracking-tight",children:t.content||h.jsx("span",{className:"text-muted-foreground italic",children:"(empty)"})})]}),h.jsxs("div",{className:"text-muted-foreground mt-2.5 flex flex-wrap items-center gap-x-3 gap-y-1 text-xs",children:[h.jsx(Efe,{taskId:t.taskId}),h.jsx(by,{}),h.jsx("span",{className:"mono uppercase tracking-wider",children:sA(t.type)}),h.jsx(by,{}),h.jsxs("span",{children:[s," ",tO(i,e)," ago"]}),h.jsx(by,{}),h.jsxs("span",{className:ae("mono tabular-nums",Vc(t.status)?"text-blue-400":"text-muted-foreground"),children:[a," ",Md(r)]})]})]})}function Efe({taskId:e}){const t=async()=>{try{await navigator.clipboard.writeText(e),ht.success("Task ID copied",{duration:2e3})}catch{ht.error("Failed to copy task ID",{duration:3e3})}};return h.jsxs(ms,{children:[h.jsx(gs,{render:h.jsx(ze,{"aria-label":"Copy task ID",className:"text-identifier hover:text-identifier hover:bg-identifier/10 mono px-1.5 font-normal",onClick:t,size:"xs",variant:"ghost"}),children:h.jsx("span",{className:"truncate",children:e})}),h.jsx(ys,{children:"Click to copy"})]})}function Tfe(e){return e==="query"||e==="search"?"query":"curate"}const Nfe=new Set(["ERR_LLM_ERROR","ERR_LLM_RATE_LIMIT","ERR_OAUTH_REFRESH_FAILED","ERR_OAUTH_TOKEN_EXPIRED","ERR_PROVIDER_NOT_CONFIGURED"]);function Rfe({error:e,hadLlmServiceError:t}){return!!(t||e?.code&&Nfe.has(e.code))}function $T({Icon:e,onRemove:t,path:n}){return h.jsxs(uo,{className:"bg-muted max-w-[20rem] gap-1.5 animate-in fade-in slide-in-from-bottom-1 duration-200",title:n,variant:"outline",children:[h.jsx(e,{className:"text-muted-foreground"}),h.jsx("span",{className:"mono truncate",children:n}),t&&h.jsx("button",{"aria-label":`Remove ${n}`,className:"text-muted-foreground/60 hover:bg-border hover:text-foreground inline-flex size-4 shrink-0 items-center justify-center rounded-full transition",onClick:t,type:"button",children:h.jsx(Sv,{className:"size-2.5"})})]})}function Afe({task:e}){const{folderPath:t}=e,n=e.files??[],r=!!t||n.length>0;return h.jsxs("section",{children:[h.jsx(yf,{children:"Input"}),h.jsx("div",{className:"border-blue-400 text-foreground/90 mono border-l-2 pl-3 text-sm leading-relaxed whitespace-pre-wrap",children:e.content||h.jsx("span",{className:"text-muted-foreground italic",children:"(empty)"})}),r&&h.jsxs("div",{className:"mt-3 flex flex-wrap gap-1.5 pl-3",children:[t&&h.jsx($T,{Icon:CA,path:t}),n.map(i=>h.jsx($T,{Icon:v$,path:i},i))]})]})}function Ofe({task:e}){const t=e.responseContent??e.streamingContent??"",n=e.isStreaming||!e.responseContent&&Vc(e.status);return h.jsxs("section",{children:[h.jsxs("div",{className:"mono mb-2 flex items-baseline gap-2 text-[11px] uppercase tracking-wider",children:[n?h.jsxs(h.Fragment,{children:[h.jsxs("span",{className:"text-blue-400 inline-flex items-center gap-1.5",children:[h.jsx("span",{className:"bg-blue-400 size-1 rounded-full animate-pulse"}),"live"]}),h.jsx("span",{className:"text-muted-foreground",children:"agent is responding"})]}):h.jsx("span",{className:"text-muted-foreground",children:"Response"}),h.jsx("span",{className:"bg-border/50 h-px flex-1"})]}),h.jsxs("div",{className:ae("pl-3 text-foreground/90 text-sm border-l-2",n?"border-blue-500/30":"border-border"),children:[h.jsx(Xf,{className:"text-foreground/90 text-sm",children:t||" "}),n&&h.jsx("span",{className:"bg-blue-400/70 ml-1 inline-block h-3 w-1.5 align-middle animate-pulse"})]})]})}function jfe({content:e}){return h.jsxs("section",{className:"relative pl-8",children:[h.jsx(iO,{tone:"completed"}),h.jsx(yf,{children:"Result"}),h.jsx(la,{className:"ring-border bg-card p-5",size:"sm",children:h.jsx(Xf,{className:"text-foreground/90 text-sm",children:e})})]})}function Mfe({task:e}){const{error:t}=e,n=jm(a=>a.openProviderDialog),r=Wx(a=>a.requestRetry),i=Rfe({error:t,hadLlmServiceError:!!e.hadLlmServiceError});if(!t)return null;function s(){r({content:e.content,type:Tfe(e.type)})}return h.jsxs("section",{className:"relative pl-8",children:[h.jsx(iO,{tone:"error"}),h.jsx(yf,{children:"Error"}),h.jsxs(la,{className:"bg-red-500/5 p-5 ring-1 ring-red-500/30",size:"sm",children:[h.jsx("p",{className:"text-red-400 text-sm",children:jn(t)}),t.code&&h.jsx("p",{className:"text-muted-foreground mono mt-1 text-[11px]",children:t.code}),h.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-2",children:[i&&h.jsx(ze,{onClick:n,size:"sm",children:"Configure provider"}),h.jsxs(ze,{onClick:s,size:"sm",variant:i?"secondary":"default",children:[h.jsx(k$,{className:"size-3.5"}),"Try again"]}),h.jsx("span",{className:"text-muted-foreground text-xs",children:"Your prompt is preserved."})]})]})]})}function YT({taskId:e}){return h.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-3 p-8 text-center",children:[h.jsx("h2",{className:"text-foreground text-base font-medium",children:"Task not found"}),h.jsxs("p",{className:"text-muted-foreground max-w-md text-sm",children:["Task ",h.jsx("span",{className:"mono",children:rO(e)})," isn't in the local cache. It may have completed before the page was loaded, or it belongs to a different project."]})]})}function Dfe(e){return e?!!(e.responseContent&&e.responseContent.length>0||e.toolCalls&&e.toolCalls.length>0):!1}function _fe({taskId:e}){const t=RV(e),n=t!==void 0&&Vc(t.status),r=!Dfe(t)&&!n,{data:i,isLoading:s}=Pde({enabled:r,taskId:e}),a=i?.task?Bde(i.task):void 0,c=r?a??t:t,u=c?Vc(c.status):!1,f=Q7(u),p=Ht(T=>T.tourTaskId)===e,y=c?.reasoningContents?.at(-1),{onScroll:x,ref:b}=Fde([c?.toolCalls?.length??0,c?.reasoningContents?.length??0,y?.content?.length??0,c?.streamingContent?.length??0,c?.responseContent,c?.result,c?.error?.message,c?.status],u||p);if(r&&s)return h.jsx(Lfe,{});if(r&&i&&i.task===null)return h.jsx(YT,{taskId:e});if(!c)return h.jsx(YT,{taskId:e});const S=u&&(c.streamingContent||c.responseContent),k=c.status==="completed"?c.result:void 0,E=c.status==="error"?c.error:void 0;return h.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[h.jsx(kfe,{now:f,task:c}),h.jsx("div",{className:"border-border/50 border-t"}),h.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-7 overflow-y-auto px-6 py-5",onScroll:x,ref:b,children:[h.jsx(Dde,{task:c}),h.jsx(Afe,{task:c}),h.jsx(gfe,{now:f,task:c}),S&&h.jsx(Ofe,{task:c}),k&&h.jsx(jfe,{content:k}),E&&h.jsx(Mfe,{task:c}),h.jsx(_de,{task:c})]})]})}function Lfe(){return h.jsx("div",{className:"text-muted-foreground flex h-full items-center justify-center text-sm",role:"status",children:"Loading task…"})}function qp(e){return ll(e,"d MMM yyyy")}function Gx(e){return e.createdAfter!==void 0&&e.createdBefore!==void 0?`${qp(e.createdAfter)} – ${qp(e.createdBefore)}`:e.createdAfter!==void 0?`Since ${qp(e.createdAfter)}`:e.createdBefore!==void 0?`Until ${qp(e.createdBefore)}`:"Any time"}function Ife(e,t,n="long"){return new Intl.DateTimeFormat("en-US",{hour:"numeric",timeZone:e,timeZoneName:n}).format(t).split(/\s/g).slice(2).join(" ")}const Pfe={},Dd={};function cl(e,t){try{const r=(Pfe[e]||=new Intl.DateTimeFormat("en-US",{timeZone:e,timeZoneName:"longOffset"}).format)(t).split("GMT")[1];return r in Dd?Dd[r]:WT(r,r.split(":"))}catch{if(e in Dd)return Dd[e];const n=e?.match(zfe);return n?WT(e,n.slice(1)):NaN}}const zfe=/([+-]\d\d):?(\d\d)?/;function WT(e,t){const n=+(t[0]||0),r=+(t[1]||0),i=+(t[2]||0)/60;return Dd[e]=n*60+r>0?n*60+r+i:n*60-r-i}class So extends Date{constructor(...t){super(),t.length>1&&typeof t[t.length-1]=="string"&&(this.timeZone=t.pop()),this.internal=new Date,isNaN(cl(this.timeZone,this))?this.setTime(NaN):t.length?typeof t[0]=="number"&&(t.length===1||t.length===2&&typeof t[1]!="number")?this.setTime(t[0]):typeof t[0]=="string"?this.setTime(+new Date(t[0])):t[0]instanceof Date?this.setTime(+t[0]):(this.setTime(+new Date(...t)),aO(this),Kx(this)):this.setTime(Date.now())}static tz(t,...n){return n.length?new So(...n,t):new So(Date.now(),t)}withTimeZone(t){return new So(+this,t)}getTimezoneOffset(){const t=-cl(this.timeZone,this);return t>0?Math.floor(t):Math.ceil(t)}setTime(t){return Date.prototype.setTime.apply(this,arguments),Kx(this),+this}[Symbol.for("constructDateFrom")](t){return new So(+new Date(t),this.timeZone)}}const GT=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(e=>{if(!GT.test(e))return;const t=e.replace(GT,"$1UTC");So.prototype[t]&&(e.startsWith("get")?So.prototype[e]=function(){return this.internal[t]()}:(So.prototype[e]=function(){return Date.prototype[t].apply(this.internal,arguments),Ffe(this),+this},So.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),Kx(this),+this}))});function Kx(e){e.internal.setTime(+e),e.internal.setUTCSeconds(e.internal.getUTCSeconds()-Math.round(-cl(e.timeZone,e)*60))}function Ffe(e){Date.prototype.setFullYear.call(e,e.internal.getUTCFullYear(),e.internal.getUTCMonth(),e.internal.getUTCDate()),Date.prototype.setHours.call(e,e.internal.getUTCHours(),e.internal.getUTCMinutes(),e.internal.getUTCSeconds(),e.internal.getUTCMilliseconds()),aO(e)}function aO(e){const t=cl(e.timeZone,e),n=t>0?Math.floor(t):Math.ceil(t),r=new Date(+e);r.setUTCHours(r.getUTCHours()-1);const i=-new Date(+e).getTimezoneOffset(),s=-new Date(+r).getTimezoneOffset(),a=i-s,c=Date.prototype.getHours.apply(e)!==e.internal.getUTCHours();a&&c&&e.internal.setUTCMinutes(e.internal.getUTCMinutes()+a);const u=i-n;u&&Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+u);const f=new Date(+e);f.setUTCSeconds(0);const m=i>0?f.getSeconds():(f.getSeconds()-60)%60,p=Math.round(-(cl(e.timeZone,e)*60))%60;(p||m)&&(e.internal.setUTCSeconds(e.internal.getUTCSeconds()+p),Date.prototype.setUTCSeconds.call(e,Date.prototype.getUTCSeconds.call(e)+p+m));const y=cl(e.timeZone,e),x=y>0?Math.floor(y):Math.ceil(y),S=-new Date(+e).getTimezoneOffset()-x,k=x!==n,E=S-u;if(k&&E){Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+E);const T=cl(e.timeZone,e),N=T>0?Math.floor(T):Math.ceil(T),j=x-N;j&&(e.internal.setUTCMinutes(e.internal.getUTCMinutes()+j),Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+j))}}class Ar extends So{static tz(t,...n){return n.length?new Ar(...n,t):new Ar(Date.now(),t)}toISOString(){const[t,n,r]=this.tzComponents(),i=`${t}${n}:${r}`;return this.internal.toISOString().slice(0,-1)+i}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){const[t,n,r,i]=this.internal.toUTCString().split(" ");return`${t?.slice(0,-1)} ${r} ${n} ${i}`}toTimeString(){const t=this.internal.toUTCString().split(" ")[4],[n,r,i]=this.tzComponents();return`${t} GMT${n}${r}${i} (${Ife(this.timeZone,this)})`}toLocaleString(t,n){return Date.prototype.toLocaleString.call(this,t,{...n,timeZone:n?.timeZone||this.timeZone})}toLocaleDateString(t,n){return Date.prototype.toLocaleDateString.call(this,t,{...n,timeZone:n?.timeZone||this.timeZone})}toLocaleTimeString(t,n){return Date.prototype.toLocaleTimeString.call(this,t,{...n,timeZone:n?.timeZone||this.timeZone})}tzComponents(){const t=this.getTimezoneOffset(),n=t>0?"-":"+",r=String(Math.floor(Math.abs(t)/60)).padStart(2,"0"),i=String(Math.abs(t)%60).padStart(2,"0");return[n,r,i]}withTimeZone(t){return new Ar(+this,t)}[Symbol.for("constructDateFrom")](t){return new Ar(+new Date(t),this.timeZone)}}const KT=5,Bfe=4;function Hfe(e,t){const n=t.startOfMonth(e),r=n.getDay()>0?n.getDay():7,i=t.addDays(e,-r+1),s=t.addDays(i,KT*7-1);return t.getMonth(e)===t.getMonth(s)?KT:Bfe}function lO(e,t){const n=t.startOfMonth(e),r=n.getDay();return r===1?n:r===0?t.addDays(n,-6):t.addDays(n,-1*(r-1))}function Ufe(e,t){const n=lO(e,t),r=Hfe(e,t);return t.addDays(n,r*7-1)}const cO={...nl,labels:{labelDayButton:(e,t,n,r)=>{let i;r&&typeof r.format=="function"?i=r.format.bind(r):i=(a,c)=>ll(a,c,{locale:nl,...n});let s=i(e,"PPPP");return t.today&&(s=`Today, ${s}`),t.selected&&(s=`${s}, selected`),s},labelMonthDropdown:"Choose the Month",labelNext:"Go to the Next Month",labelPrevious:"Go to the Previous Month",labelWeekNumber:e=>`Week ${e}`,labelYearDropdown:"Choose the Year",labelGrid:(e,t,n)=>{let r;return n&&typeof n.format=="function"?r=n.format.bind(n):r=(i,s)=>ll(i,s,{locale:nl,...t}),r(e,"LLLL yyyy")},labelGridcell:(e,t,n,r)=>{let i;r&&typeof r.format=="function"?i=r.format.bind(r):i=(a,c)=>ll(a,c,{locale:nl,...n});let s=i(e,"PPPP");return t?.today&&(s=`Today, ${s}`),s},labelNav:"Navigation bar",labelWeekNumberHeader:"Week Number",labelWeekday:(e,t,n)=>{let r;return n&&typeof n.format=="function"?r=n.format.bind(n):r=(i,s)=>ll(i,s,{locale:nl,...t}),r(e,"cccc")}}};class Ei{constructor(t,n){this.Date=Date,this.today=()=>this.overrides?.today?this.overrides.today():this.options.timeZone?Ar.tz(this.options.timeZone):new this.Date,this.newDate=(r,i,s)=>this.overrides?.newDate?this.overrides.newDate(r,i,s):this.options.timeZone?new Ar(r,i,s,this.options.timeZone):new Date(r,i,s),this.addDays=(r,i)=>this.overrides?.addDays?this.overrides.addDays(r,i):p9(r,i),this.addMonths=(r,i)=>this.overrides?.addMonths?this.overrides.addMonths(r,i):m9(r,i),this.addWeeks=(r,i)=>this.overrides?.addWeeks?this.overrides.addWeeks(r,i):ute(r,i),this.addYears=(r,i)=>this.overrides?.addYears?this.overrides.addYears(r,i):dte(r,i),this.differenceInCalendarDays=(r,i)=>this.overrides?.differenceInCalendarDays?this.overrides.differenceInCalendarDays(r,i):Kv(r,i),this.differenceInCalendarMonths=(r,i)=>this.overrides?.differenceInCalendarMonths?this.overrides.differenceInCalendarMonths(r,i):Qv(r,i),this.eachMonthOfInterval=r=>this.overrides?.eachMonthOfInterval?this.overrides.eachMonthOfInterval(r):Ste(r),this.eachYearOfInterval=r=>{const i=this.overrides?.eachYearOfInterval?this.overrides.eachYearOfInterval(r):Ete(r),s=new Set(i.map(c=>this.getYear(c)));if(s.size===i.length)return i;const a=[];return s.forEach(c=>{a.push(new Date(c,0,1))}),a},this.endOfBroadcastWeek=r=>this.overrides?.endOfBroadcastWeek?this.overrides.endOfBroadcastWeek(r):Ufe(r,this),this.endOfISOWeek=r=>this.overrides?.endOfISOWeek?this.overrides.endOfISOWeek(r):Tte(r),this.endOfMonth=r=>this.overrides?.endOfMonth?this.overrides.endOfMonth(r):b9(r),this.endOfWeek=(r,i)=>this.overrides?.endOfWeek?this.overrides.endOfWeek(r,i):S9(r,this.options),this.endOfYear=r=>this.overrides?.endOfYear?this.overrides.endOfYear(r):kte(r),this.format=(r,i,s)=>{const a=this.overrides?.format?this.overrides.format(r,i,this.options):ll(r,i,this.options);return this.options.numerals&&this.options.numerals!=="latn"?this.replaceDigits(a):a},this.getISOWeek=r=>this.overrides?.getISOWeek?this.overrides.getISOWeek(r):Xv(r),this.getMonth=(r,i)=>this.overrides?.getMonth?this.overrides.getMonth(r,this.options):kne(r,this.options),this.getYear=(r,i)=>this.overrides?.getYear?this.overrides.getYear(r,this.options):Ene(r,this.options),this.getWeek=(r,i)=>this.overrides?.getWeek?this.overrides.getWeek(r,this.options):Zv(r,this.options),this.isAfter=(r,i)=>this.overrides?.isAfter?this.overrides.isAfter(r,i):Tne(r,i),this.isBefore=(r,i)=>this.overrides?.isBefore?this.overrides.isBefore(r,i):Nne(r,i),this.isDate=r=>this.overrides?.isDate?this.overrides.isDate(r):y9(r),this.isSameDay=(r,i)=>this.overrides?.isSameDay?this.overrides.isSameDay(r,i):mte(r,i),this.isSameMonth=(r,i)=>this.overrides?.isSameMonth?this.overrides.isSameMonth(r,i):Rne(r,i),this.isSameYear=(r,i)=>this.overrides?.isSameYear?this.overrides.isSameYear(r,i):Ane(r,i),this.max=r=>this.overrides?.max?this.overrides.max(r):fte(r),this.min=r=>this.overrides?.min?this.overrides.min(r):hte(r),this.setMonth=(r,i)=>this.overrides?.setMonth?this.overrides.setMonth(r,i):One(r,i),this.setYear=(r,i)=>this.overrides?.setYear?this.overrides.setYear(r,i):jne(r,i),this.startOfBroadcastWeek=(r,i)=>this.overrides?.startOfBroadcastWeek?this.overrides.startOfBroadcastWeek(r,this):lO(r,this),this.startOfDay=r=>this.overrides?.startOfDay?this.overrides.startOfDay(r):Kc(r),this.startOfISOWeek=r=>this.overrides?.startOfISOWeek?this.overrides.startOfISOWeek(r):df(r),this.startOfMonth=r=>this.overrides?.startOfMonth?this.overrides.startOfMonth(r):Cte(r),this.startOfWeek=(r,i)=>this.overrides?.startOfWeek?this.overrides.startOfWeek(r,this.options):Gc(r,this.options),this.startOfYear=r=>this.overrides?.startOfYear?this.overrides.startOfYear(r):w9(r),this.options={locale:cO,...t},this.overrides=n}getDigitMap(){const{numerals:t="latn"}=this.options,n=new Intl.NumberFormat("en-US",{numberingSystem:t}),r={};for(let i=0;i<10;i++)r[i.toString()]=n.format(i);return r}replaceDigits(t){const n=this.getDigitMap();return t.replace(/\d/g,r=>n[r]||r)}formatNumber(t){return this.replaceDigits(t.toString())}getMonthYearOrder(){const t=this.options.locale?.code;return t&&Ei.yearFirstLocales.has(t)?"year-first":"month-first"}formatMonthYear(t){const{locale:n,timeZone:r,numerals:i}=this.options,s=n?.code;if(s&&Ei.yearFirstLocales.has(s))try{return new Intl.DateTimeFormat(s,{month:"long",year:"numeric",timeZone:r,numberingSystem:i}).format(t)}catch{}const a=this.getMonthYearOrder()==="year-first"?"y LLLL":"LLLL y";return this.format(t,a)}}Ei.yearFirstLocales=new Set(["eu","hu","ja","ja-Hira","ja-JP","ko","ko-KR","lt","lt-LT","lv","lv-LV","mn","mn-MN","zh","zh-CN","zh-HK","zh-TW"]);const Lo=new Ei;class uO{constructor(t,n,r=Lo){this.date=t,this.displayMonth=n,this.outside=!!(n&&!r.isSameMonth(t,n)),this.dateLib=r,this.isoDate=r.format(t,"yyyy-MM-dd"),this.displayMonthId=r.format(n,"yyyy-MM"),this.dateMonthId=r.format(t,"yyyy-MM")}isEqualTo(t){return this.dateLib.isSameDay(t.date,this.date)&&this.dateLib.isSameMonth(t.displayMonth,this.displayMonth)}}class Vfe{constructor(t,n){this.date=t,this.weeks=n}}class qfe{constructor(t,n){this.days=n,this.weekNumber=t}}function $fe(e){return le.createElement("button",{...e})}function Yfe(e){return le.createElement("span",{...e})}function Wfe(e){const{size:t=24,orientation:n="left",className:r}=e;return le.createElement("svg",{className:r,width:t,height:t,viewBox:"0 0 24 24"},n==="up"&&le.createElement("polygon",{points:"6.77 17 12.5 11.43 18.24 17 20 15.28 12.5 8 5 15.28"}),n==="down"&&le.createElement("polygon",{points:"6.77 8 12.5 13.57 18.24 8 20 9.72 12.5 17 5 9.72"}),n==="left"&&le.createElement("polygon",{points:"16 18.112 9.81111111 12 16 5.87733333 14.0888889 4 6 12 14.0888889 20"}),n==="right"&&le.createElement("polygon",{points:"8 18.112 14.18888889 12 8 5.87733333 9.91111111 4 18 12 9.91111111 20"}))}function Gfe(e){const{day:t,modifiers:n,...r}=e;return le.createElement("td",{...r})}function Kfe(e){const{day:t,modifiers:n,...r}=e,i=le.useRef(null);return le.useEffect(()=>{n.focused&&i.current?.focus()},[n.focused]),le.createElement("button",{ref:i,...r})}var ft;(function(e){e.Root="root",e.Chevron="chevron",e.Day="day",e.DayButton="day_button",e.CaptionLabel="caption_label",e.Dropdowns="dropdowns",e.Dropdown="dropdown",e.DropdownRoot="dropdown_root",e.Footer="footer",e.MonthGrid="month_grid",e.MonthCaption="month_caption",e.MonthsDropdown="months_dropdown",e.Month="month",e.Months="months",e.Nav="nav",e.NextMonthButton="button_next",e.PreviousMonthButton="button_previous",e.Week="week",e.Weeks="weeks",e.Weekday="weekday",e.Weekdays="weekdays",e.WeekNumber="week_number",e.WeekNumberHeader="week_number_header",e.YearsDropdown="years_dropdown"})(ft||(ft={}));var Dn;(function(e){e.disabled="disabled",e.hidden="hidden",e.outside="outside",e.focused="focused",e.today="today"})(Dn||(Dn={}));var so;(function(e){e.range_end="range_end",e.range_middle="range_middle",e.range_start="range_start",e.selected="selected"})(so||(so={}));var fi;(function(e){e.weeks_before_enter="weeks_before_enter",e.weeks_before_exit="weeks_before_exit",e.weeks_after_enter="weeks_after_enter",e.weeks_after_exit="weeks_after_exit",e.caption_after_enter="caption_after_enter",e.caption_after_exit="caption_after_exit",e.caption_before_enter="caption_before_enter",e.caption_before_exit="caption_before_exit"})(fi||(fi={}));function Qfe(e){const{options:t,className:n,components:r,classNames:i,...s}=e,a=[i[ft.Dropdown],n].join(" "),c=t?.find(({value:u})=>u===s.value);return le.createElement("span",{"data-disabled":s.disabled,className:i[ft.DropdownRoot]},le.createElement(r.Select,{className:a,...s},t?.map(({value:u,label:f,disabled:m})=>le.createElement(r.Option,{key:u,value:u,disabled:m},f))),le.createElement("span",{className:i[ft.CaptionLabel],"aria-hidden":!0},c?.label,le.createElement(r.Chevron,{orientation:"down",size:18,className:i[ft.Chevron]})))}function Xfe(e){return le.createElement("div",{...e})}function Zfe(e){return le.createElement("div",{...e})}function Jfe(e){const{calendarMonth:t,displayIndex:n,...r}=e;return le.createElement("div",{...r},e.children)}function ehe(e){const{calendarMonth:t,displayIndex:n,...r}=e;return le.createElement("div",{...r})}function the(e){return le.createElement("table",{...e})}function nhe(e){return le.createElement("div",{...e})}const dO=w.createContext(void 0);function Zf(){const e=w.useContext(dO);if(e===void 0)throw new Error("useDayPicker() must be used within a custom component.");return e}function rhe(e){const{components:t}=Zf();return le.createElement(t.Dropdown,{...e})}function ihe(e){const{onPreviousClick:t,onNextClick:n,previousMonth:r,nextMonth:i,...s}=e,{components:a,classNames:c,labels:{labelPrevious:u,labelNext:f}}=Zf(),m=w.useCallback(y=>{i&&n?.(y)},[i,n]),p=w.useCallback(y=>{r&&t?.(y)},[r,t]);return le.createElement("nav",{...s},le.createElement(a.PreviousMonthButton,{type:"button",className:c[ft.PreviousMonthButton],tabIndex:r?void 0:-1,"aria-disabled":r?void 0:!0,"aria-label":u(r),onClick:p},le.createElement(a.Chevron,{disabled:r?void 0:!0,className:c[ft.Chevron],orientation:"left"})),le.createElement(a.NextMonthButton,{type:"button",className:c[ft.NextMonthButton],tabIndex:i?void 0:-1,"aria-disabled":i?void 0:!0,"aria-label":f(i),onClick:m},le.createElement(a.Chevron,{disabled:i?void 0:!0,orientation:"right",className:c[ft.Chevron]})))}function ohe(e){const{components:t}=Zf();return le.createElement(t.Button,{...e})}function she(e){return le.createElement("option",{...e})}function ahe(e){const{components:t}=Zf();return le.createElement(t.Button,{...e})}function lhe(e){const{rootRef:t,...n}=e;return le.createElement("div",{...n,ref:t})}function che(e){return le.createElement("select",{...e})}function uhe(e){const{week:t,...n}=e;return le.createElement("tr",{...n})}function dhe(e){return le.createElement("th",{...e})}function fhe(e){return le.createElement("thead",{"aria-hidden":!0},le.createElement("tr",{...e}))}function hhe(e){const{week:t,...n}=e;return le.createElement("th",{...n})}function phe(e){return le.createElement("th",{...e})}function mhe(e){return le.createElement("tbody",{...e})}function ghe(e){const{components:t}=Zf();return le.createElement(t.Dropdown,{...e})}const yhe=Object.freeze(Object.defineProperty({__proto__:null,Button:$fe,CaptionLabel:Yfe,Chevron:Wfe,Day:Gfe,DayButton:Kfe,Dropdown:Qfe,DropdownNav:Xfe,Footer:Zfe,Month:Jfe,MonthCaption:ehe,MonthGrid:the,Months:nhe,MonthsDropdown:rhe,Nav:ihe,NextMonthButton:ohe,Option:she,PreviousMonthButton:ahe,Root:lhe,Select:che,Week:uhe,WeekNumber:hhe,WeekNumberHeader:phe,Weekday:dhe,Weekdays:fhe,Weeks:mhe,YearsDropdown:ghe},Symbol.toStringTag,{value:"Module"}));function cs(e,t,n=!1,r=Lo){let{from:i,to:s}=e;const{differenceInCalendarDays:a,isSameDay:c}=r;return i&&s?(a(s,i)<0&&([i,s]=[s,i]),a(t,i)>=(n?1:0)&&a(s,t)>=(n?1:0)):!n&&s?c(s,t):!n&&i?c(i,t):!1}function Ew(e){return!!(e&&typeof e=="object"&&"before"in e&&"after"in e)}function X0(e){return!!(e&&typeof e=="object"&&"from"in e)}function Tw(e){return!!(e&&typeof e=="object"&&"after"in e)}function Nw(e){return!!(e&&typeof e=="object"&&"before"in e)}function fO(e){return!!(e&&typeof e=="object"&&"dayOfWeek"in e)}function hO(e,t){return Array.isArray(e)&&e.every(t.isDate)}function us(e,t,n=Lo){const r=Array.isArray(t)?t:[t],{isSameDay:i,differenceInCalendarDays:s,isAfter:a}=n;return r.some(c=>{if(typeof c=="boolean")return c;if(n.isDate(c))return i(e,c);if(hO(c,n))return c.some(u=>i(e,u));if(X0(c))return cs(c,e,!1,n);if(fO(c))return Array.isArray(c.dayOfWeek)?c.dayOfWeek.includes(e.getDay()):c.dayOfWeek===e.getDay();if(Ew(c)){const u=s(c.before,e),f=s(c.after,e),m=u>0,p=f<0;return a(c.before,c.after)?p&&m:m||p}return Tw(c)?s(e,c.after)>0:Nw(c)?s(c.before,e)>0:typeof c=="function"?c(e):!1})}function xhe(e,t,n,r,i){const{disabled:s,hidden:a,modifiers:c,showOutsideDays:u,broadcastCalendar:f,today:m=i.today()}=t,{isSameDay:p,isSameMonth:y,startOfMonth:x,isBefore:b,endOfMonth:S,isAfter:k}=i,E=n&&x(n),T=r&&S(r),N={[Dn.focused]:[],[Dn.outside]:[],[Dn.disabled]:[],[Dn.hidden]:[],[Dn.today]:[]},j={};for(const O of e){const{date:A,displayMonth:R}=O,L=!!(R&&!y(A,R)),B=!!(E&&b(A,E)),I=!!(T&&k(A,T)),U=!!(s&&us(A,s,i)),Y=!!(a&&us(A,a,i))||B||I||!f&&!u&&L||f&&u===!1&&L,V=p(A,m);L&&N.outside.push(O),U&&N.disabled.push(O),Y&&N.hidden.push(O),V&&N.today.push(O),c&&Object.keys(c).forEach(q=>{const H=c?.[q];H&&us(A,H,i)&&(j[q]?j[q].push(O):j[q]=[O])})}return O=>{const A={[Dn.focused]:!1,[Dn.disabled]:!1,[Dn.hidden]:!1,[Dn.outside]:!1,[Dn.today]:!1},R={};for(const L in N){const B=N[L];A[L]=B.some(I=>I===O)}for(const L in j)R[L]=j[L].some(B=>B===O);return{...A,...R}}}function bhe(e,t,n={}){return Object.entries(e).filter(([,i])=>i===!0).reduce((i,[s])=>(n[s]?i.push(n[s]):t[Dn[s]]?i.push(t[Dn[s]]):t[so[s]]&&i.push(t[so[s]]),i),[t[ft.Day]])}function vhe(e){return{...yhe,...e}}function whe(e){const t={"data-mode":e.mode??void 0,"data-required":"required"in e?e.required:void 0,"data-multiple-months":e.numberOfMonths&&e.numberOfMonths>1||void 0,"data-week-numbers":e.showWeekNumber||void 0,"data-broadcast-calendar":e.broadcastCalendar||void 0,"data-nav-layout":e.navLayout||void 0};return Object.entries(e).forEach(([n,r])=>{n.startsWith("data-")&&(t[n]=r)}),t}function Rw(){const e={};for(const t in ft)e[ft[t]]=`rdp-${ft[t]}`;for(const t in Dn)e[Dn[t]]=`rdp-${Dn[t]}`;for(const t in so)e[so[t]]=`rdp-${so[t]}`;for(const t in fi)e[fi[t]]=`rdp-${fi[t]}`;return e}function pO(e,t,n){return(n??new Ei(t)).formatMonthYear(e)}const She=pO;function Che(e,t,n){return(n??new Ei(t)).format(e,"d")}function khe(e,t=Lo){return t.format(e,"LLLL")}function Ehe(e,t,n){return(n??new Ei(t)).format(e,"cccccc")}function The(e,t=Lo){return e<10?t.formatNumber(`0${e.toLocaleString()}`):t.formatNumber(`${e.toLocaleString()}`)}function Nhe(){return""}function mO(e,t=Lo){return t.format(e,"yyyy")}const Rhe=mO,Ahe=Object.freeze(Object.defineProperty({__proto__:null,formatCaption:pO,formatDay:Che,formatMonthCaption:She,formatMonthDropdown:khe,formatWeekNumber:The,formatWeekNumberHeader:Nhe,formatWeekdayName:Ehe,formatYearCaption:Rhe,formatYearDropdown:mO},Symbol.toStringTag,{value:"Module"}));function Ohe(e){return e?.formatMonthCaption&&!e.formatCaption&&(e.formatCaption=e.formatMonthCaption),e?.formatYearCaption&&!e.formatYearDropdown&&(e.formatYearDropdown=e.formatYearCaption),{...Ahe,...e}}function Aw(e,t,n,r){let i=(r??new Ei(n)).format(e,"PPPP");return t.today&&(i=`Today, ${i}`),t.selected&&(i=`${i}, selected`),i}const jhe=Aw;function Ow(e,t,n){return(n??new Ei(t)).formatMonthYear(e)}const Mhe=Ow;function gO(e,t,n,r){let i=(r??new Ei(n)).format(e,"PPPP");return t?.today&&(i=`Today, ${i}`),i}function yO(e){return"Choose the Month"}function xO(){return""}const Dhe="Go to the Next Month";function bO(e,t){return Dhe}function vO(e){return"Go to the Previous Month"}function wO(e,t,n){return(n??new Ei(t)).format(e,"cccc")}function SO(e,t){return`Week ${e}`}function CO(e){return"Week Number"}function kO(e){return"Choose the Year"}const _he=Object.freeze(Object.defineProperty({__proto__:null,labelCaption:Mhe,labelDay:jhe,labelDayButton:Aw,labelGrid:Ow,labelGridcell:gO,labelMonthDropdown:yO,labelNav:xO,labelNext:bO,labelPrevious:vO,labelWeekNumber:SO,labelWeekNumberHeader:CO,labelWeekday:wO,labelYearDropdown:kO},Symbol.toStringTag,{value:"Module"})),io=(e,t,n)=>t||(n?typeof n=="function"?n:(...r)=>n:e);function Lhe(e,t){const n=t.locale?.labels??{};return{..._he,...e??{},labelDayButton:io(Aw,e?.labelDayButton,n.labelDayButton),labelMonthDropdown:io(yO,e?.labelMonthDropdown,n.labelMonthDropdown),labelNext:io(bO,e?.labelNext,n.labelNext),labelPrevious:io(vO,e?.labelPrevious,n.labelPrevious),labelWeekNumber:io(SO,e?.labelWeekNumber,n.labelWeekNumber),labelYearDropdown:io(kO,e?.labelYearDropdown,n.labelYearDropdown),labelGrid:io(Ow,e?.labelGrid,n.labelGrid),labelGridcell:io(gO,e?.labelGridcell,n.labelGridcell),labelNav:io(xO,e?.labelNav,n.labelNav),labelWeekNumberHeader:io(CO,e?.labelWeekNumberHeader,n.labelWeekNumberHeader),labelWeekday:io(wO,e?.labelWeekday,n.labelWeekday)}}function Ihe(e,t,n,r,i){const{startOfMonth:s,startOfYear:a,endOfYear:c,eachMonthOfInterval:u,getMonth:f}=i;return u({start:a(e),end:c(e)}).map(y=>{const x=r.formatMonthDropdown(y,i),b=f(y),S=t&&y<s(t)||n&&y>s(n)||!1;return{value:b,label:x,disabled:S}})}function Phe(e,t={},n={}){let r={...t?.[ft.Day]};return Object.entries(e).filter(([,i])=>i===!0).forEach(([i])=>{r={...r,...n?.[i]}}),r}function zhe(e,t,n,r){const i=r??e.today(),s=n?e.startOfBroadcastWeek(i,e):t?e.startOfISOWeek(i):e.startOfWeek(i),a=[];for(let c=0;c<7;c++){const u=e.addDays(s,c);a.push(u)}return a}function Fhe(e,t,n,r,i=!1){if(!e||!t)return;const{startOfYear:s,endOfYear:a,eachYearOfInterval:c,getYear:u}=r,f=s(e),m=a(t),p=c({start:f,end:m});return i&&p.reverse(),p.map(y=>{const x=n.formatYearDropdown(y,r);return{value:u(y),label:x,disabled:!1}})}function Bhe(e,t={}){const{weekStartsOn:n,locale:r}=t,i=n??r?.options?.weekStartsOn??0,s=c=>{const u=typeof c=="number"||typeof c=="string"?new Date(c):c;return new Ar(u.getFullYear(),u.getMonth(),u.getDate(),12,0,0,e)},a=c=>{const u=s(c);return new Date(u.getFullYear(),u.getMonth(),u.getDate(),0,0,0,0)};return{today:()=>s(Ar.tz(e)),newDate:(c,u,f)=>new Ar(c,u,f,12,0,0,e),startOfDay:c=>s(c),startOfWeek:(c,u)=>{const f=s(c),m=u?.weekStartsOn??i,p=(f.getDay()-m+7)%7;return f.setDate(f.getDate()-p),f},startOfISOWeek:c=>{const u=s(c),f=(u.getDay()-1+7)%7;return u.setDate(u.getDate()-f),u},startOfMonth:c=>{const u=s(c);return u.setDate(1),u},startOfYear:c=>{const u=s(c);return u.setMonth(0,1),u},endOfWeek:(c,u)=>{const f=s(c),y=(((u?.weekStartsOn??i)+6)%7-f.getDay()+7)%7;return f.setDate(f.getDate()+y),f},endOfISOWeek:c=>{const u=s(c),f=(7-u.getDay())%7;return u.setDate(u.getDate()+f),u},endOfMonth:c=>{const u=s(c);return u.setMonth(u.getMonth()+1,0),u},endOfYear:c=>{const u=s(c);return u.setMonth(11,31),u},eachMonthOfInterval:c=>{const u=s(c.start),f=s(c.end),m=[],p=new Ar(u.getFullYear(),u.getMonth(),1,12,0,0,e),y=f.getFullYear()*12+f.getMonth();for(;p.getFullYear()*12+p.getMonth()<=y;)m.push(new Ar(p,e)),p.setMonth(p.getMonth()+1,1);return m},addDays:(c,u)=>{const f=s(c);return f.setDate(f.getDate()+u),f},addWeeks:(c,u)=>{const f=s(c);return f.setDate(f.getDate()+u*7),f},addMonths:(c,u)=>{const f=s(c);return f.setMonth(f.getMonth()+u),f},addYears:(c,u)=>{const f=s(c);return f.setFullYear(f.getFullYear()+u),f},eachYearOfInterval:c=>{const u=s(c.start),f=s(c.end),m=[],p=new Ar(u.getFullYear(),0,1,12,0,0,e);for(;p.getFullYear()<=f.getFullYear();)m.push(new Ar(p,e)),p.setFullYear(p.getFullYear()+1,0,1);return m},getWeek:(c,u)=>{const f=a(c);return Zv(f,{weekStartsOn:u?.weekStartsOn??i,firstWeekContainsDate:u?.firstWeekContainsDate??r?.options?.firstWeekContainsDate??1})},getISOWeek:c=>{const u=a(c);return Xv(u)},differenceInCalendarDays:(c,u)=>{const f=a(c),m=a(u);return Kv(f,m)},differenceInCalendarMonths:(c,u)=>{const f=a(c),m=a(u);return Qv(f,m)}}}const Jf=e=>e instanceof HTMLElement?e:null,wy=e=>[...e.querySelectorAll("[data-animated-month]")??[]],Hhe=e=>Jf(e.querySelector("[data-animated-month]")),Sy=e=>Jf(e.querySelector("[data-animated-caption]")),Cy=e=>Jf(e.querySelector("[data-animated-weeks]")),Uhe=e=>Jf(e.querySelector("[data-animated-nav]")),Vhe=e=>Jf(e.querySelector("[data-animated-weekdays]"));function qhe(e,t,{classNames:n,months:r,focused:i,dateLib:s}){const a=w.useRef(null),c=w.useRef(r),u=w.useRef(!1);w.useLayoutEffect(()=>{const f=c.current;if(c.current=r,!t||!e.current||!(e.current instanceof HTMLElement)||r.length===0||f.length===0||r.length!==f.length)return;const m=s.isSameMonth(r[0].date,f[0].date),p=s.isAfter(r[0].date,f[0].date),y=p?n[fi.caption_after_enter]:n[fi.caption_before_enter],x=p?n[fi.weeks_after_enter]:n[fi.weeks_before_enter],b=a.current,S=e.current.cloneNode(!0);if(S instanceof HTMLElement?(wy(S).forEach(N=>{if(!(N instanceof HTMLElement))return;const j=Hhe(N);j&&N.contains(j)&&N.removeChild(j);const O=Sy(N);O&&O.classList.remove(y);const A=Cy(N);A&&A.classList.remove(x)}),a.current=S):a.current=null,u.current||m||i)return;const k=b instanceof HTMLElement?wy(b):[],E=wy(e.current);if(E?.every(T=>T instanceof HTMLElement)&&k&&k.every(T=>T instanceof HTMLElement)){u.current=!0,e.current.style.isolation="isolate";const T=Uhe(e.current);T&&(T.style.zIndex="1"),E.forEach((N,j)=>{const O=k[j];if(!O)return;N.style.position="relative",N.style.overflow="hidden";const A=Sy(N);A&&A.classList.add(y);const R=Cy(N);R&&R.classList.add(x);const L=()=>{u.current=!1,e.current&&(e.current.style.isolation=""),T&&(T.style.zIndex=""),A&&A.classList.remove(y),R&&R.classList.remove(x),N.style.position="",N.style.overflow="",N.contains(O)&&N.removeChild(O)};O.style.pointerEvents="none",O.style.position="absolute",O.style.overflow="hidden",O.setAttribute("aria-hidden","true");const B=Vhe(O);B&&(B.style.opacity="0");const I=Sy(O);I&&(I.classList.add(p?n[fi.caption_before_exit]:n[fi.caption_after_exit]),I.addEventListener("animationend",L));const U=Cy(O);U&&U.classList.add(p?n[fi.weeks_before_exit]:n[fi.weeks_after_exit]),N.insertBefore(O,N.firstChild)})}})}function $he(e,t,n,r){const i=e[0],s=e[e.length-1],{ISOWeek:a,fixedWeeks:c,broadcastCalendar:u}=n??{},{addDays:f,differenceInCalendarDays:m,differenceInCalendarMonths:p,endOfBroadcastWeek:y,endOfISOWeek:x,endOfMonth:b,endOfWeek:S,isAfter:k,startOfBroadcastWeek:E,startOfISOWeek:T,startOfWeek:N}=r,j=u?E(i,r):a?T(i):N(i),O=u?y(s):a?x(b(s)):S(b(s)),A=t&&(u?y(t):a?x(t):S(t)),R=A&&k(O,A)?A:O,L=m(R,j),B=p(s,i)+1,I=[];for(let V=0;V<=L;V++){const q=f(j,V);I.push(q)}const Y=(u?35:42)*B;if(c&&I.length<Y){const V=Y-I.length;for(let q=0;q<V;q++){const H=f(I[I.length-1],1);I.push(H)}}return I}function Yhe(e){const t=[];return e.reduce((n,r)=>{const i=r.weeks.reduce((s,a)=>s.concat(a.days.slice()),t.slice());return n.concat(i.slice())},t.slice())}function Whe(e,t,n,r){const{numberOfMonths:i=1}=n,s=[];for(let a=0;a<i;a++){const c=r.addMonths(e,a);if(t&&c>t)break;s.push(c)}return s}function QT(e,t,n,r){const{month:i,defaultMonth:s,today:a=r.today(),numberOfMonths:c=1}=e;let u=i||s||a;const{differenceInCalendarMonths:f,addMonths:m,startOfMonth:p}=r;if(n&&f(n,u)<c-1){const y=-1*(c-1);u=m(n,y)}return t&&f(u,t)<0&&(u=t),p(u)}function Ghe(e,t,n,r){const{addDays:i,endOfBroadcastWeek:s,endOfISOWeek:a,endOfMonth:c,endOfWeek:u,getISOWeek:f,getWeek:m,startOfBroadcastWeek:p,startOfISOWeek:y,startOfWeek:x}=r,b=e.reduce((S,k)=>{const E=n.broadcastCalendar?p(k,r):n.ISOWeek?y(k):x(k),T=n.broadcastCalendar?s(k):n.ISOWeek?a(c(k)):u(c(k)),N=t.filter(R=>R>=E&&R<=T),j=n.broadcastCalendar?35:42;if(n.fixedWeeks&&N.length<j){const R=t.filter(L=>{const B=j-N.length;return L>T&&L<=i(T,B)});N.push(...R)}const O=N.reduce((R,L)=>{const B=n.ISOWeek?f(L):m(L),I=R.find(Y=>Y.weekNumber===B),U=new uO(L,k,r);return I?I.days.push(U):R.push(new qfe(B,[U])),R},[]),A=new Vfe(k,O);return S.push(A),S},[]);return n.reverseMonths?b.reverse():b}function Khe(e,t){let{startMonth:n,endMonth:r}=e;const{startOfYear:i,startOfDay:s,startOfMonth:a,endOfMonth:c,addYears:u,endOfYear:f,newDate:m,today:p}=t,{fromYear:y,toYear:x,fromMonth:b,toMonth:S}=e;!n&&b&&(n=b),!n&&y&&(n=t.newDate(y,0,1)),!r&&S&&(r=S),!r&&x&&(r=m(x,11,31));const k=e.captionLayout==="dropdown"||e.captionLayout==="dropdown-years";return n?n=a(n):y?n=m(y,0,1):!n&&k&&(n=i(u(e.today??p(),-100))),r?r=c(r):x?r=m(x,11,31):!r&&k&&(r=f(e.today??p())),[n&&s(n),r&&s(r)]}function Qhe(e,t,n,r){if(n.disableNavigation)return;const{pagedNavigation:i,numberOfMonths:s=1}=n,{startOfMonth:a,addMonths:c,differenceInCalendarMonths:u}=r,f=i?s:1,m=a(e);if(!t)return c(m,f);if(!(u(t,e)<s))return c(m,f)}function Xhe(e,t,n,r){if(n.disableNavigation)return;const{pagedNavigation:i,numberOfMonths:s}=n,{startOfMonth:a,addMonths:c,differenceInCalendarMonths:u}=r,f=i?s??1:1,m=a(e);if(!t)return c(m,-f);if(!(u(m,t)<=0))return c(m,-f)}function Zhe(e){const t=[];return e.reduce((n,r)=>n.concat(r.weeks.slice()),t.slice())}function Z0(e,t){const[n,r]=w.useState(e);return[t===void 0?n:t,r]}function Jhe(e,t){const[n,r]=Khe(e,t),{startOfMonth:i,endOfMonth:s}=t,a=QT(e,n,r,t),[c,u]=Z0(a,e.month?a:void 0);w.useEffect(()=>{const j=QT(e,n,r,t);u(j)},[e.timeZone]);const{months:f,weeks:m,days:p,previousMonth:y,nextMonth:x}=w.useMemo(()=>{const j=Whe(c,r,{numberOfMonths:e.numberOfMonths},t),O=$he(j,e.endMonth?s(e.endMonth):void 0,{ISOWeek:e.ISOWeek,fixedWeeks:e.fixedWeeks,broadcastCalendar:e.broadcastCalendar},t),A=Ghe(j,O,{broadcastCalendar:e.broadcastCalendar,fixedWeeks:e.fixedWeeks,ISOWeek:e.ISOWeek,reverseMonths:e.reverseMonths},t),R=Zhe(A),L=Yhe(A),B=Xhe(c,n,e,t),I=Qhe(c,r,e,t);return{months:A,weeks:R,days:L,previousMonth:B,nextMonth:I}},[t,c.getTime(),r?.getTime(),n?.getTime(),e.disableNavigation,e.broadcastCalendar,e.endMonth?.getTime(),e.fixedWeeks,e.ISOWeek,e.numberOfMonths,e.pagedNavigation,e.reverseMonths]),{disableNavigation:b,onMonthChange:S}=e,k=j=>m.some(O=>O.days.some(A=>A.isEqualTo(j))),E=j=>{if(b)return;let O=i(j);n&&O<i(n)&&(O=i(n)),r&&O>i(r)&&(O=i(r)),u(O),S?.(O)};return{months:f,weeks:m,days:p,navStart:n,navEnd:r,previousMonth:y,nextMonth:x,goToMonth:E,goToDay:j=>{k(j)||E(j.date)}}}var bo;(function(e){e[e.Today=0]="Today",e[e.Selected=1]="Selected",e[e.LastFocused=2]="LastFocused",e[e.FocusedModifier=3]="FocusedModifier"})(bo||(bo={}));function XT(e){return!e[Dn.disabled]&&!e[Dn.hidden]&&!e[Dn.outside]}function epe(e,t,n,r){let i,s=-1;for(const a of e){const c=t(a);XT(c)&&(c[Dn.focused]&&s<bo.FocusedModifier?(i=a,s=bo.FocusedModifier):r?.isEqualTo(a)&&s<bo.LastFocused?(i=a,s=bo.LastFocused):n(a.date)&&s<bo.Selected?(i=a,s=bo.Selected):c[Dn.today]&&s<bo.Today&&(i=a,s=bo.Today))}return i||(i=e.find(a=>XT(t(a)))),i}function tpe(e,t,n,r,i,s,a){const{ISOWeek:c,broadcastCalendar:u}=s,{addDays:f,addMonths:m,addWeeks:p,addYears:y,endOfBroadcastWeek:x,endOfISOWeek:b,endOfWeek:S,max:k,min:E,startOfBroadcastWeek:T,startOfISOWeek:N,startOfWeek:j}=a;let A={day:f,week:p,month:m,year:y,startOfWeek:R=>u?T(R,a):c?N(R):j(R),endOfWeek:R=>u?x(R):c?b(R):S(R)}[e](n,t==="after"?1:-1);return t==="before"&&r?A=k([r,A]):t==="after"&&i&&(A=E([i,A])),A}function EO(e,t,n,r,i,s,a,c=0){if(c>365)return;const u=tpe(e,t,n.date,r,i,s,a),f=!!(s.disabled&&us(u,s.disabled,a)),m=!!(s.hidden&&us(u,s.hidden,a)),p=u,y=new uO(u,p,a);return!f&&!m?y:EO(e,t,y,r,i,s,a,c+1)}function npe(e,t,n,r,i){const{autoFocus:s}=e,[a,c]=w.useState(),u=epe(t.days,n,r||(()=>!1),a),[f,m]=w.useState(s?u:void 0);return{isFocusTarget:S=>!!u?.isEqualTo(S),setFocused:m,focused:f,blur:()=>{c(f),m(void 0)},moveFocus:(S,k)=>{if(!f)return;const E=EO(S,k,f,t.navStart,t.navEnd,e,i);E&&(e.disableNavigation&&!t.days.some(N=>N.isEqualTo(E))||(t.goToDay(E),m(E)))}}}function rpe(e,t){const{selected:n,required:r,onSelect:i}=e,[s,a]=Z0(n,i?n:void 0),c=i?n:s,{isSameDay:u}=t,f=x=>c?.some(b=>u(b,x))??!1,{min:m,max:p}=e;return{selected:c,select:(x,b,S)=>{let k=[...c??[]];if(f(x)){if(c?.length===m||r&&c?.length===1)return;k=c?.filter(E=>!u(E,x))}else c?.length===p?k=[x]:k=[...k,x];return i||a(k),i?.(k,x,b,S),k},isSelected:f}}function ipe(e,t,n=0,r=0,i=!1,s=Lo){const{from:a,to:c}=t||{},{isSameDay:u,isAfter:f,isBefore:m}=s;let p;if(!a&&!c)p={from:e,to:n>0?void 0:e};else if(a&&!c)u(a,e)?n===0?p={from:a,to:e}:i?p={from:a,to:void 0}:p=void 0:m(e,a)?p={from:e,to:a}:p={from:a,to:e};else if(a&&c)if(u(a,e)&&u(c,e))i?p={from:a,to:c}:p=void 0;else if(u(a,e))p={from:a,to:n>0?void 0:e};else if(u(c,e))p={from:e,to:n>0?void 0:e};else if(m(e,a))p={from:e,to:c};else if(f(e,a))p={from:a,to:e};else if(f(e,c))p={from:a,to:e};else throw new Error("Invalid range");if(p?.from&&p?.to){const y=s.differenceInCalendarDays(p.to,p.from);r>0&&y>r?p={from:e,to:void 0}:n>1&&y<n&&(p={from:e,to:void 0})}return p}function ope(e,t,n=Lo){const r=Array.isArray(t)?t:[t];let i=e.from;const s=n.differenceInCalendarDays(e.to,e.from),a=Math.min(s,6);for(let c=0;c<=a;c++){if(r.includes(i.getDay()))return!0;i=n.addDays(i,1)}return!1}function ZT(e,t,n=Lo){return cs(e,t.from,!1,n)||cs(e,t.to,!1,n)||cs(t,e.from,!1,n)||cs(t,e.to,!1,n)}function spe(e,t,n=Lo){const r=Array.isArray(t)?t:[t];if(r.filter(c=>typeof c!="function").some(c=>typeof c=="boolean"?c:n.isDate(c)?cs(e,c,!1,n):hO(c,n)?c.some(u=>cs(e,u,!1,n)):X0(c)?c.from&&c.to?ZT(e,{from:c.from,to:c.to},n):!1:fO(c)?ope(e,c.dayOfWeek,n):Ew(c)?n.isAfter(c.before,c.after)?ZT(e,{from:n.addDays(c.after,1),to:n.addDays(c.before,-1)},n):us(e.from,c,n)||us(e.to,c,n):Tw(c)||Nw(c)?us(e.from,c,n)||us(e.to,c,n):!1))return!0;const a=r.filter(c=>typeof c=="function");if(a.length){let c=e.from;const u=n.differenceInCalendarDays(e.to,e.from);for(let f=0;f<=u;f++){if(a.some(m=>m(c)))return!0;c=n.addDays(c,1)}}return!1}function ape(e,t){const{disabled:n,excludeDisabled:r,resetOnSelect:i,selected:s,required:a,onSelect:c}=e,[u,f]=Z0(s,c?s:void 0),m=c?s:u;return{selected:m,select:(x,b,S)=>{const{min:k,max:E}=e;let T;if(x){const N=m?.from,j=m?.to,O=!!N&&!!j,A=!!N&&!!j&&t.isSameDay(N,j)&&t.isSameDay(x,N);i&&(O||!m?.from)?!a&&A?T=void 0:T={from:x,to:void 0}:T=ipe(x,m,k,E,a,t)}return r&&n&&T?.from&&T.to&&spe({from:T.from,to:T.to},n,t)&&(T.from=x,T.to=void 0),c||f(T),c?.(T,x,b,S),T},isSelected:x=>m&&cs(m,x,!1,t)}}function lpe(e,t){const{selected:n,required:r,onSelect:i}=e,[s,a]=Z0(n,i?n:void 0),c=i?n:s,{isSameDay:u}=t;return{selected:c,select:(p,y,x)=>{let b=p;return!r&&c&&c&&u(p,c)&&(b=void 0),i||a(b),i?.(b,p,y,x),b},isSelected:p=>c?u(c,p):!1}}function cpe(e,t){const n=lpe(e,t),r=rpe(e,t),i=ape(e,t);switch(e.mode){case"single":return n;case"multiple":return r;case"range":return i;default:return}}function Fi(e,t){return e instanceof Ar&&e.timeZone===t?e:new Ar(e,t)}function gc(e,t,n){return Fi(e,t)}function JT(e,t,n){return typeof e=="boolean"||typeof e=="function"?e:e instanceof Date?gc(e,t):Array.isArray(e)?e.map(r=>r instanceof Date?gc(r,t):r):X0(e)?{...e,from:e.from?Fi(e.from,t):e.from,to:e.to?Fi(e.to,t):e.to}:Ew(e)?{before:gc(e.before,t),after:gc(e.after,t)}:Tw(e)?{after:gc(e.after,t)}:Nw(e)?{before:gc(e.before,t)}:e}function ky(e,t,n){return e&&(Array.isArray(e)?e.map(r=>JT(r,t)):JT(e,t))}function upe(e){let t=e;const n=t.timeZone;if(n&&(t={...e,timeZone:n},t.today&&(t.today=Fi(t.today,n)),t.month&&(t.month=Fi(t.month,n)),t.defaultMonth&&(t.defaultMonth=Fi(t.defaultMonth,n)),t.startMonth&&(t.startMonth=Fi(t.startMonth,n)),t.endMonth&&(t.endMonth=Fi(t.endMonth,n)),t.mode==="single"&&t.selected?t.selected=Fi(t.selected,n):t.mode==="multiple"&&t.selected?t.selected=t.selected?.map(qe=>Fi(qe,n)):t.mode==="range"&&t.selected&&(t.selected={from:t.selected.from?Fi(t.selected.from,n):t.selected.from,to:t.selected.to?Fi(t.selected.to,n):t.selected.to}),t.disabled!==void 0&&(t.disabled=ky(t.disabled,n)),t.hidden!==void 0&&(t.hidden=ky(t.hidden,n)),t.modifiers)){const qe={};Object.keys(t.modifiers).forEach(ge=>{qe[ge]=ky(t.modifiers?.[ge],n)}),t.modifiers=qe}const{components:r,formatters:i,labels:s,dateLib:a,locale:c,classNames:u}=w.useMemo(()=>{const qe={...cO,...t.locale},ge=t.broadcastCalendar?1:t.weekStartsOn,je=t.noonSafe&&t.timeZone?Bhe(t.timeZone,{weekStartsOn:ge,locale:qe}):void 0,Ye=t.dateLib&&je?{...je,...t.dateLib}:t.dateLib??je,Rt=new Ei({locale:qe,weekStartsOn:ge,firstWeekContainsDate:t.firstWeekContainsDate,useAdditionalWeekYearTokens:t.useAdditionalWeekYearTokens,useAdditionalDayOfYearTokens:t.useAdditionalDayOfYearTokens,timeZone:t.timeZone,numerals:t.numerals},Ye);return{dateLib:Rt,components:vhe(t.components),formatters:Ohe(t.formatters),labels:Lhe(t.labels,Rt.options),locale:qe,classNames:{...Rw(),...t.classNames}}},[t.locale,t.broadcastCalendar,t.weekStartsOn,t.firstWeekContainsDate,t.useAdditionalWeekYearTokens,t.useAdditionalDayOfYearTokens,t.timeZone,t.numerals,t.dateLib,t.noonSafe,t.components,t.formatters,t.labels,t.classNames]);t.today||(t={...t,today:a.today()});const{captionLayout:f,mode:m,navLayout:p,numberOfMonths:y=1,onDayBlur:x,onDayClick:b,onDayFocus:S,onDayKeyDown:k,onDayMouseEnter:E,onDayMouseLeave:T,onNextClick:N,onPrevClick:j,showWeekNumber:O,styles:A}=t,{formatCaption:R,formatDay:L,formatMonthDropdown:B,formatWeekNumber:I,formatWeekNumberHeader:U,formatWeekdayName:Y,formatYearDropdown:V}=i,q=Jhe(t,a),{days:H,months:z,navStart:$,navEnd:G,previousMonth:Q,nextMonth:_,goToMonth:P}=q,W=xhe(H,t,$,G,a),{isSelected:D,select:Z,selected:ee}=cpe(t,a)??{},{blur:J,focused:he,isFocusTarget:fe,moveFocus:Se,setFocused:Ae}=npe(t,q,W,D??(()=>!1),a),{labelDayButton:Oe,labelGridcell:Pe,labelGrid:_e,labelMonthDropdown:De,labelNav:xe,labelPrevious:Ge,labelNext:we,labelWeekday:Re,labelWeekNumber:pe,labelWeekNumberHeader:be,labelYearDropdown:ne}=s,ye=w.useMemo(()=>zhe(a,t.ISOWeek,t.broadcastCalendar,t.today),[a,t.ISOWeek,t.broadcastCalendar,t.today]),Ce=m!==void 0||b!==void 0,Ve=w.useCallback(()=>{Q&&(P(Q),j?.(Q))},[Q,P,j]),lt=w.useCallback(()=>{_&&(P(_),N?.(_))},[P,_,N]),oe=w.useCallback((qe,ge)=>je=>{je.preventDefault(),je.stopPropagation(),Ae(qe),!ge.disabled&&(Z?.(qe.date,ge,je),b?.(qe.date,ge,je))},[Z,b,Ae]),ke=w.useCallback((qe,ge)=>je=>{Ae(qe),S?.(qe.date,ge,je)},[S,Ae]),Le=w.useCallback((qe,ge)=>je=>{J(),x?.(qe.date,ge,je)},[J,x]),Me=w.useCallback((qe,ge)=>je=>{const Ye={ArrowLeft:[je.shiftKey?"month":"day",t.dir==="rtl"?"after":"before"],ArrowRight:[je.shiftKey?"month":"day",t.dir==="rtl"?"before":"after"],ArrowDown:[je.shiftKey?"year":"week","after"],ArrowUp:[je.shiftKey?"year":"week","before"],PageUp:[je.shiftKey?"year":"month","before"],PageDown:[je.shiftKey?"year":"month","after"],Home:["startOfWeek","before"],End:["endOfWeek","after"]};if(Ye[je.key]){je.preventDefault(),je.stopPropagation();const[Rt,Ie]=Ye[je.key];Se(Rt,Ie)}k?.(qe.date,ge,je)},[Se,k,t.dir]),He=w.useCallback((qe,ge)=>je=>{E?.(qe.date,ge,je)},[E]),ut=w.useCallback((qe,ge)=>je=>{T?.(qe.date,ge,je)},[T]),xt=w.useCallback(qe=>ge=>{const je=Number(ge.target.value),Ye=a.setMonth(a.startOfMonth(qe),je);P(Ye)},[a,P]),Je=w.useCallback(qe=>ge=>{const je=Number(ge.target.value),Ye=a.setYear(a.startOfMonth(qe),je);P(Ye)},[a,P]),{className:Ke,style:bt}=w.useMemo(()=>({className:[u[ft.Root],t.className].filter(Boolean).join(" "),style:{...A?.[ft.Root],...t.style}}),[u,t.className,t.style,A]),nt=whe(t),Qe=w.useRef(null);qhe(Qe,!!t.animate,{classNames:u,months:z,focused:he,dateLib:a});const Ct={dayPickerProps:t,selected:ee,select:Z,isSelected:D,months:z,nextMonth:_,previousMonth:Q,goToMonth:P,getModifiers:W,components:r,classNames:u,styles:A,labels:s,formatters:i};return le.createElement(dO.Provider,{value:Ct},le.createElement(r.Root,{rootRef:t.animate?Qe:void 0,className:Ke,style:bt,dir:t.dir,id:t.id,lang:t.lang??c.code,nonce:t.nonce,title:t.title,role:t.role,"aria-label":t["aria-label"],"aria-labelledby":t["aria-labelledby"],...nt},le.createElement(r.Months,{className:u[ft.Months],style:A?.[ft.Months]},!t.hideNavigation&&!p&&le.createElement(r.Nav,{"data-animated-nav":t.animate?"true":void 0,className:u[ft.Nav],style:A?.[ft.Nav],"aria-label":xe(),onPreviousClick:Ve,onNextClick:lt,previousMonth:Q,nextMonth:_}),z.map((qe,ge)=>le.createElement(r.Month,{"data-animated-month":t.animate?"true":void 0,className:u[ft.Month],style:A?.[ft.Month],key:ge,displayIndex:ge,calendarMonth:qe},p==="around"&&!t.hideNavigation&&ge===0&&le.createElement(r.PreviousMonthButton,{type:"button",className:u[ft.PreviousMonthButton],tabIndex:Q?void 0:-1,"aria-disabled":Q?void 0:!0,"aria-label":Ge(Q),onClick:Ve,"data-animated-button":t.animate?"true":void 0},le.createElement(r.Chevron,{disabled:Q?void 0:!0,className:u[ft.Chevron],orientation:t.dir==="rtl"?"right":"left"})),le.createElement(r.MonthCaption,{"data-animated-caption":t.animate?"true":void 0,className:u[ft.MonthCaption],style:A?.[ft.MonthCaption],calendarMonth:qe,displayIndex:ge},f?.startsWith("dropdown")?le.createElement(r.DropdownNav,{className:u[ft.Dropdowns],style:A?.[ft.Dropdowns]},(()=>{const je=f==="dropdown"||f==="dropdown-months"?le.createElement(r.MonthsDropdown,{key:"month",className:u[ft.MonthsDropdown],"aria-label":De(),classNames:u,components:r,disabled:!!t.disableNavigation,onChange:xt(qe.date),options:Ihe(qe.date,$,G,i,a),style:A?.[ft.Dropdown],value:a.getMonth(qe.date)}):le.createElement("span",{key:"month"},B(qe.date,a)),Ye=f==="dropdown"||f==="dropdown-years"?le.createElement(r.YearsDropdown,{key:"year",className:u[ft.YearsDropdown],"aria-label":ne(a.options),classNames:u,components:r,disabled:!!t.disableNavigation,onChange:Je(qe.date),options:Fhe($,G,i,a,!!t.reverseYears),style:A?.[ft.Dropdown],value:a.getYear(qe.date)}):le.createElement("span",{key:"year"},V(qe.date,a));return a.getMonthYearOrder()==="year-first"?[Ye,je]:[je,Ye]})(),le.createElement("span",{role:"status","aria-live":"polite",style:{border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap",wordWrap:"normal"}},R(qe.date,a.options,a))):le.createElement(r.CaptionLabel,{className:u[ft.CaptionLabel],role:"status","aria-live":"polite"},R(qe.date,a.options,a))),p==="around"&&!t.hideNavigation&&ge===y-1&&le.createElement(r.NextMonthButton,{type:"button",className:u[ft.NextMonthButton],tabIndex:_?void 0:-1,"aria-disabled":_?void 0:!0,"aria-label":we(_),onClick:lt,"data-animated-button":t.animate?"true":void 0},le.createElement(r.Chevron,{disabled:_?void 0:!0,className:u[ft.Chevron],orientation:t.dir==="rtl"?"left":"right"})),ge===y-1&&p==="after"&&!t.hideNavigation&&le.createElement(r.Nav,{"data-animated-nav":t.animate?"true":void 0,className:u[ft.Nav],style:A?.[ft.Nav],"aria-label":xe(),onPreviousClick:Ve,onNextClick:lt,previousMonth:Q,nextMonth:_}),le.createElement(r.MonthGrid,{role:"grid","aria-multiselectable":m==="multiple"||m==="range","aria-label":_e(qe.date,a.options,a)||void 0,className:u[ft.MonthGrid],style:A?.[ft.MonthGrid]},!t.hideWeekdays&&le.createElement(r.Weekdays,{"data-animated-weekdays":t.animate?"true":void 0,className:u[ft.Weekdays],style:A?.[ft.Weekdays]},O&&le.createElement(r.WeekNumberHeader,{"aria-label":be(a.options),className:u[ft.WeekNumberHeader],style:A?.[ft.WeekNumberHeader],scope:"col"},U()),ye.map(je=>le.createElement(r.Weekday,{"aria-label":Re(je,a.options,a),className:u[ft.Weekday],key:String(je),style:A?.[ft.Weekday],scope:"col"},Y(je,a.options,a)))),le.createElement(r.Weeks,{"data-animated-weeks":t.animate?"true":void 0,className:u[ft.Weeks],style:A?.[ft.Weeks]},qe.weeks.map(je=>le.createElement(r.Week,{className:u[ft.Week],key:je.weekNumber,style:A?.[ft.Week],week:je},O&&le.createElement(r.WeekNumber,{week:je,style:A?.[ft.WeekNumber],"aria-label":pe(je.weekNumber,{locale:c}),className:u[ft.WeekNumber],scope:"row",role:"rowheader"},I(je.weekNumber,a)),je.days.map(Ye=>{const{date:Rt}=Ye,Ie=W(Ye);if(Ie[Dn.focused]=!Ie.hidden&&!!he?.isEqualTo(Ye),Ie[so.selected]=D?.(Rt)||Ie.selected,X0(ee)){const{from:vn,to:Ut}=ee;Ie[so.range_start]=!!(vn&&Ut&&a.isSameDay(Rt,vn)),Ie[so.range_end]=!!(vn&&Ut&&a.isSameDay(Rt,Ut)),Ie[so.range_middle]=cs(ee,Rt,!0,a)}const Pt=Phe(Ie,A,t.modifiersStyles),on=bhe(Ie,u,t.modifiersClassNames),tn=!Ce&&!Ie.hidden?Pe(Rt,Ie,a.options,a):void 0;return le.createElement(r.Day,{key:`${Ye.isoDate}_${Ye.displayMonthId}`,day:Ye,modifiers:Ie,className:on.join(" "),style:Pt,role:"gridcell","aria-selected":Ie.selected||void 0,"aria-label":tn,"data-day":Ye.isoDate,"data-month":Ye.outside?Ye.dateMonthId:void 0,"data-selected":Ie.selected||void 0,"data-disabled":Ie.disabled||void 0,"data-hidden":Ie.hidden||void 0,"data-outside":Ye.outside||void 0,"data-focused":Ie.focused||void 0,"data-today":Ie.today||void 0},!Ie.hidden&&Ce?le.createElement(r.DayButton,{className:u[ft.DayButton],style:A?.[ft.DayButton],type:"button",day:Ye,modifiers:Ie,disabled:!Ie.focused&&Ie.disabled||void 0,"aria-disabled":Ie.focused&&Ie.disabled||void 0,tabIndex:fe(Ye)?0:-1,"aria-label":Oe(Rt,Ie,a.options,a),onClick:oe(Ye,Ie),onBlur:Le(Ye,Ie),onFocus:ke(Ye,Ie),onKeyDown:Me(Ye,Ie),onMouseEnter:He(Ye,Ie),onMouseLeave:ut(Ye,Ie)},L(Rt,a.options,a)):!Ie.hidden&&L(Ye.date,a.options,a))})))))))),t.footer&&le.createElement(r.Footer,{className:u[ft.Footer],style:A?.[ft.Footer],role:"status","aria-live":"polite"},t.footer)))}function dpe({className:e,classNames:t,showOutsideDays:n=!0,captionLayout:r="label",buttonVariant:i="ghost",formatters:s,components:a,...c}){const u=Rw();return h.jsx(upe,{showOutsideDays:n,className:ae("bg-background group/calendar p-3 [--cell-size:2rem] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent",String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,e),captionLayout:r,formatters:{formatMonthDropdown:f=>f.toLocaleString("default",{month:"short"}),...s},classNames:{root:ae("w-fit",u.root),months:ae("relative flex flex-col gap-4 md:flex-row",u.months),month:ae("flex w-full flex-col gap-4",u.month),nav:ae("absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1",u.nav),button_previous:ae(ux({variant:i}),"h-[--cell-size] w-[--cell-size] select-none p-0 aria-disabled:opacity-50",u.button_previous),button_next:ae(ux({variant:i}),"h-[--cell-size] w-[--cell-size] select-none p-0 aria-disabled:opacity-50",u.button_next),month_caption:ae("flex h-[--cell-size] w-full items-center justify-center px-[--cell-size]",u.month_caption),dropdowns:ae("flex h-[--cell-size] w-full items-center justify-center gap-1.5 text-sm font-medium",u.dropdowns),dropdown_root:ae("has-focus:border-ring border-input shadow-xs has-focus:ring-ring/50 has-focus:ring-[3px] relative rounded-md border",u.dropdown_root),dropdown:ae("bg-popover absolute inset-0 opacity-0",u.dropdown),caption_label:ae("select-none font-medium",r==="label"?"text-sm":"[&>svg]:text-muted-foreground flex h-8 items-center gap-1 rounded-md pl-2 pr-1 text-sm [&>svg]:size-3.5",u.caption_label),table:"w-full border-collapse",weekdays:ae("flex",u.weekdays),weekday:ae("text-muted-foreground flex-1 select-none rounded-md text-[0.8rem] font-normal",u.weekday),week:ae("mt-2 flex w-full",u.week),week_number_header:ae("w-[--cell-size] select-none",u.week_number_header),week_number:ae("text-muted-foreground select-none text-[0.8rem]",u.week_number),day:ae("group/day relative aspect-square h-full w-full select-none p-0 text-center [&:first-child[data-selected=true]_button]:rounded-l-md [&:last-child[data-selected=true]_button]:rounded-r-md",u.day),range_start:ae("bg-accent rounded-l-md",u.range_start),range_middle:ae("rounded-none",u.range_middle),range_end:ae("bg-accent rounded-r-md",u.range_end),today:ae("bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none",u.today),outside:ae("text-muted-foreground aria-selected:text-muted-foreground",u.outside),disabled:ae("text-muted-foreground opacity-50",u.disabled),hidden:ae("invisible",u.hidden),...t},components:{Root:({className:f,rootRef:m,...p})=>h.jsx("div",{"data-slot":"calendar",ref:m,className:ae(f),...p}),Chevron:({className:f,orientation:m,...p})=>m==="left"?h.jsx(l6,{className:ae("size-4",f),...p}):m==="right"?h.jsx(t0,{className:ae("size-4",f),...p}):h.jsx(e0,{className:ae("size-4",f),...p}),DayButton:fpe,WeekNumber:({children:f,...m})=>h.jsx("td",{...m,children:h.jsx("div",{className:"flex size-[--cell-size] items-center justify-center text-center",children:f})}),...a},...c})}function fpe({className:e,day:t,modifiers:n,...r}){const i=Rw(),s=w.useRef(null);return w.useEffect(()=>{n.focused&&s.current?.focus()},[n.focused]),h.jsx(ze,{ref:s,variant:"ghost",size:"icon","data-day":t.date.toLocaleDateString(),"data-selected-single":n.selected&&!n.range_start&&!n.range_end&&!n.range_middle,"data-range-start":n.range_start,"data-range-end":n.range_end,"data-range-middle":n.range_middle,className:ae("data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 flex aspect-square h-auto w-full min-w-[--cell-size] flex-col gap-1 leading-none font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[3px] data-[range-end=true]:rounded-md data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-md [&>span]:text-xs [&>span]:opacity-70",i.day,e),...r})}function hpe({createdAfter:e,createdBefore:t,onChange:n}){const r=e6(e,t),[i,s]=w.useState(r);w.useEffect(()=>{s(e6(e,t))},[e,t]);const a=i?.from!==void 0&&i?.from!==null,c=e!==void 0||t!==void 0,u=a&&($p(i.from)!==e||$p(i.to??i.from)!==t),f=()=>{if(!i?.from)return;const p=Kc(i.from).getTime(),y=x9(i.to??i.from).getTime();n({createdAfter:p,createdBefore:y})},m=()=>{s(void 0),n({})};return h.jsxs("div",{onKeyDown:p=>p.stopPropagation(),children:[h.jsx(dpe,{className:"min-w-md bg-transparent p-2",mode:"range",numberOfMonths:2,onSelect:s,selected:i}),h.jsxs("div",{className:"border-border flex items-center justify-between border-t px-3 py-2",children:[c?h.jsx("span",{className:"text-foreground text-xs",children:Gx({createdAfter:e,createdBefore:t})}):a?h.jsx("span",{className:"text-muted-foreground text-xs",children:Gx({createdAfter:$p(i.from),createdBefore:$p(i.to??i.from)})}):h.jsx("span",{}),h.jsxs("div",{className:"flex items-center gap-2",children:[c&&h.jsx("button",{className:"text-muted-foreground hover:text-foreground text-xs transition",onClick:m,type:"button",children:"Clear"}),a&&u&&h.jsx("button",{className:"bg-primary text-foreground rounded px-2.5 py-1 text-xs font-medium",onClick:f,type:"button",children:"Apply"})]})]})]})}function e6(e,t){if(e!==void 0)return{from:new Date(e),...t===void 0?{}:{to:new Date(t)}}}function $p(e){return e?e.getTime():void 0}const ppe=[{label:"Curate",value:"curate"},{label:"Query",value:"query"}];function mpe({availableModels:e,availableProviders:t,createdAfter:n,createdBefore:r,durationPreset:i,modelFilter:s,onDurationChange:a,onModelChange:c,onProviderChange:u,onTimeRangeChange:f,onTypeChange:m,providerFilter:p,providers:y,typeFilter:x}){const b=w.useMemo(()=>new Map(y.map(T=>[T.id,T.name])),[y]),S=w.useMemo(()=>gpe(e,p),[e,p]),k=n!==void 0||r!==void 0,E=x.length>0||p.length>0||s.length>0||k||i!=="all";return h.jsxs(Na,{children:[h.jsxs(Ra,{className:"text-muted-foreground hover:text-foreground hover:bg-muted/60 border-border bg-background relative inline-flex h-8 cursor-pointer items-center gap-1.5 rounded-md border px-3 text-sm transition-colors",children:[h.jsx(N$,{className:"pointer-events-none size-3.5"}),h.jsx("span",{className:"pointer-events-none",children:"Filter"}),E&&h.jsx("span",{className:"bg-primary pointer-events-none absolute -top-1 -right-1 size-2 rounded-full"})]}),h.jsxs(ks,{align:"start",className:"w-48",children:[h.jsxs(na,{children:[h.jsx(ra,{className:"cursor-pointer",children:h.jsxs("span",{children:["Type",x.length>0&&h.jsxs("span",{className:"ml-1",children:["(",x.length,")"]})]})}),h.jsx(ia,{className:"w-48",sideOffset:8,children:ppe.map(T=>h.jsx(H2,{checked:x.includes(T.value),className:"cursor-pointer",onCheckedChange:()=>Ey(x,T.value,m),children:T.label},T.value))})]}),h.jsxs(na,{children:[h.jsx(ra,{className:"cursor-pointer",children:h.jsxs("span",{children:["Provider",p.length>0&&h.jsxs("span",{className:"ml-1",children:["(",p.length,")"]})]})}),h.jsx(ia,{className:"w-56",sideOffset:8,children:t.length===0?h.jsx("div",{className:"text-muted-foreground px-2 py-1.5 text-xs",children:"No providers yet"}):t.map(T=>h.jsx(H2,{checked:p.includes(T),className:"cursor-pointer",onCheckedChange:()=>Ey(p,T,u),children:b.get(T)??T},T))})]}),h.jsxs(na,{children:[h.jsx(ra,{className:"cursor-pointer",children:h.jsxs("span",{children:["Model",s.length>0&&h.jsxs("span",{className:"ml-1",children:["(",s.length,")"]})]})}),h.jsx(ia,{className:"w-56",sideOffset:8,children:S.length===0?h.jsx("div",{className:"text-muted-foreground px-2 py-1.5 text-xs",children:"No models yet"}):S.map(T=>h.jsx(H2,{checked:s.includes(T),className:"cursor-pointer",onCheckedChange:()=>Ey(s,T,c),children:T},T))})]}),h.jsxs(na,{children:[h.jsx(ra,{className:"cursor-pointer",children:h.jsxs("span",{children:["Time",k&&h.jsx("span",{className:"text-primary ml-1",children:"·"})]})}),h.jsx(ia,{className:"w-fit",sideOffset:8,children:h.jsx(hpe,{createdAfter:n,createdBefore:r,onChange:f})})]}),h.jsxs(na,{children:[h.jsx(ra,{className:"cursor-pointer",children:h.jsxs("span",{children:["Duration",i!=="all"&&h.jsx("span",{className:"text-primary ml-1",children:"·"})]})}),h.jsx(ia,{className:"w-48",sideOffset:8,children:h.jsx(WW,{onValueChange:T=>K7(T)&&a(T),value:i,children:G7.map(T=>h.jsx(GW,{className:"cursor-pointer",value:T.value,children:T.label},T.value))})})]})]})]})}function Ey(e,t,n){n(e.includes(t)?e.filter(r=>r!==t):[...e,t])}function gpe(e,t){const n=t.length===0?e:e.filter(s=>t.includes(s.providerId)),r=new Set,i=[];for(const s of n)r.has(s.modelId)||(r.add(s.modelId),i.push(s.modelId));return i}const jw={all:"All",cancelled:"Cancelled",completed:"Done",failed:"Failed",running:"Running"},ype={cancelled:"bg-zinc-500",completed:"bg-emerald-500",failed:"bg-red-400",running:"bg-blue-400"};function xpe({availableModels:e,availableProviders:t,breakdown:n,createdAfter:r,createdBefore:i,durationPreset:s,modelFilter:a,onDurationChange:c,onModelChange:u,onNewTask:f,onProviderChange:m,onSearchChange:p,onStatusChange:y,onTimeRangeChange:x,onTypeChange:b,providerFilter:S,providers:k,searchQuery:E,statusFilter:T,tourCue:N,typeFilter:j}){return h.jsxs("div",{className:"flex min-h-9 flex-wrap items-center gap-2",children:[NV.map(O=>{const A=n[O],R=T===O;return h.jsxs("button",{className:ae("inline-flex items-center gap-1.5 rounded-md px-2.5 py-1 text-xs transition",R?"bg-muted text-foreground font-medium":"text-muted-foreground hover:bg-muted/60 hover:text-foreground"),onClick:()=>y(O),type:"button",children:[O!=="all"&&h.jsx("span",{className:ae("inline-block size-1.5 rounded-full",ype[O])}),h.jsx("span",{children:jw[O]}),h.jsx("span",{className:"text-muted-foreground tabular-nums",children:A})]},O)}),h.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[h.jsx(mpe,{availableModels:e,availableProviders:t,createdAfter:r,createdBefore:i,durationPreset:s,modelFilter:a,onDurationChange:c,onModelChange:u,onProviderChange:m,onTimeRangeChange:x,onTypeChange:b,providerFilter:S,providers:k,typeFilter:j}),h.jsxs("div",{className:"relative",children:[h.jsx(au,{className:"text-muted-foreground pointer-events-none absolute top-1/2 left-2.5 size-3.5 -translate-y-1/2"}),h.jsx(Wi,{className:"dark:bg-background h-8 min-w-56 pl-8 text-xs border border-border",onChange:O=>p(O.target.value),placeholder:"Search input or id…",type:"text",value:E})]}),h.jsx(Nv,{active:!!N,align:"end",label:N??"",children:h.jsxs(ze,{className:"h-8",onClick:f,size:"sm",variant:"default",children:[h.jsx(Ta,{className:"size-4"}),"New task"]})})]})]})}const bpe={curate:"Curate",query:"Query"};function vpe({createdAfter:e,createdBefore:t,durationPreset:n,modelFilter:r,onClearAll:i,onDurationChange:s,onModelChange:a,onProviderChange:c,onSearchChange:u,onStatusChange:f,onTimeRangeChange:m,onTypeChange:p,providerFilter:y,providers:x,searchQuery:b,statusFilter:S,typeFilter:k}){const E=w.useMemo(()=>new Map(x.map(N=>[N.id,N.name])),[x]),T=w.useMemo(()=>{const N=[];S!=="all"&&N.push({key:`status:${S}`,label:`Status: ${jw[S]}`,onRemove:()=>f("all")});for(const j of k)N.push({key:`type:${j}`,label:`Type: ${bpe[j]??j}`,onRemove:()=>p(k.filter(O=>O!==j))});for(const j of y)N.push({key:`provider:${j}`,label:`Provider: ${E.get(j)??j}`,onRemove:()=>c(y.filter(O=>O!==j))});for(const j of r)N.push({key:`model:${j}`,label:`Model: ${j}`,onRemove:()=>a(r.filter(O=>O!==j))});return(e!==void 0||t!==void 0)&&N.push({key:"time",label:`Time: ${Gx({createdAfter:e,createdBefore:t})}`,onRemove:()=>m({})}),n!=="all"&&N.push({key:`duration:${n}`,label:`Duration: ${nde(n)}`,onRemove:()=>s("all")}),b.trim()&&N.push({key:"search",label:`“${b.trim()}”`,onRemove:()=>u("")}),N},[S,k,y,r,e,t,n,b,E,f,p,c,a,m,s,u]);return T.length===0?null:h.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 px-1",children:[T.map(N=>h.jsx(Rx,{closable:!0,onClose:N.onRemove,variant:"secondary",children:N.label},N.key)),h.jsxs("button",{className:"text-muted-foreground hover:text-foreground inline-flex cursor-pointer items-center gap-1 px-1.5 py-0.5 text-xs transition",onClick:i,type:"button",children:[h.jsx(Sv,{className:"size-3"}),"Clear filters"]})]})}function wpe({canDelete:e,count:t,onClear:n,onDelete:r}){return h.jsxs("div",{className:"border-border bg-muted/40 flex min-h-9 items-center gap-3 rounded-md border px-3 text-xs",children:[h.jsxs("span",{className:"text-foreground",children:[h.jsx("span",{className:"text-foreground mono tabular-nums font-medium",children:t})," selected"]}),h.jsx("span",{className:"bg-border h-4 w-px"}),h.jsx(ze,{disabled:!e,onClick:r,size:"xs",variant:"ghost",children:"Delete"}),h.jsx(ze,{className:"ml-auto",onClick:n,size:"xs",variant:"ghost",children:"Clear selection"})]})}function t6({children:e,withDots:t}){return h.jsx(la,{className:ae("ring-border/80 flex min-h-0 flex-1 items-center justify-center p-0",t&&"dot-grid"),size:"sm",children:e})}function Spe(){return h.jsx("div",{className:"text-muted-foreground flex h-32 items-center justify-center text-sm",children:"Loading tasks…"})}function Cpe({hasActiveFilters:e,onClearFilters:t,onNewTask:n,tourCue:r}){return e?h.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-4 p-8 text-center",children:[h.jsx(kE,{className:"text-muted-foreground/70 size-8"}),h.jsxs("div",{children:[h.jsx("h2",{className:"text-foreground text-base font-medium",children:"No matching tasks"}),h.jsx("p",{className:"text-muted-foreground mx-auto mt-1 max-w-sm text-sm leading-relaxed",children:"No tasks match the current filters. Try adjusting or clearing them."})]}),t&&h.jsx(ze,{className:"cursor-pointer",onClick:t,size:"sm",variant:"outline",children:"Clear filters"})]}):h.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-4 p-8 text-center",children:[h.jsx(kE,{className:"text-muted-foreground/70 size-8"}),h.jsxs("div",{children:[h.jsx("h2",{className:"text-foreground text-base font-medium",children:"No tasks yet"}),h.jsxs("p",{className:"text-muted-foreground mx-auto mt-1 max-w-sm text-sm leading-relaxed",children:["Capture knowledge with ",h.jsx("strong",{children:"Curate"})," or ask a question with ",h.jsx("strong",{children:"Query"}),"."]})]}),h.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[h.jsx(Nv,{active:!!r,label:r??"",side:"top",children:h.jsxs(ze,{onClick:n,size:"sm",variant:"default",children:[h.jsx(Ta,{className:"size-4"}),"New task"]})}),h.jsx("span",{className:"text-muted-foreground/60 ml-2 text-sm",children:"or run from the CLI"})]})]})}function kpe({onClearSearch:e,query:t,status:n}){return h.jsxs("div",{className:"text-muted-foreground flex h-32 flex-col items-center justify-center gap-2 p-4 text-sm",children:[h.jsxs("span",{children:["No ",n==="all"?"":`${jw[n].toLowerCase()} `,"tasks",t?` match "${t}"`:"","."]}),t&&h.jsx(ze,{onClick:e,size:"xs",variant:"link",children:"Clear search"})]})}function Epe({className:e,...t}){return h.jsx("nav",{role:"navigation","aria-label":"pagination","data-slot":"pagination",className:ae("mx-auto flex w-full justify-center",e),...t})}function Tpe({className:e,...t}){return h.jsx("ul",{"data-slot":"pagination-content",className:ae("flex items-center gap-1",e),...t})}function yc({...e}){return h.jsx("li",{"data-slot":"pagination-item",...e})}function J0({className:e,isActive:t,size:n="icon",...r}){return h.jsx(ze,{variant:t?"outline":"ghost",size:n,className:ae(e),nativeButton:!1,render:h.jsx("a",{"aria-current":t?"page":void 0,"data-slot":"pagination-link","data-active":t,...r})})}function Npe({className:e,...t}){return h.jsx(J0,{"aria-label":"Go to first page",size:"icon",className:ae(e),...t,children:h.jsx(qD,{})})}function Rpe({className:e,...t}){return h.jsx(J0,{"aria-label":"Go to previous page",size:"icon",className:ae(e),...t,children:h.jsx(l6,{})})}function Ape({className:e,...t}){return h.jsx(J0,{"aria-label":"Go to next page",size:"icon",className:ae(e),...t,children:h.jsx(t0,{})})}function Ope({className:e,...t}){return h.jsx(J0,{"aria-label":"Go to last page",size:"icon",className:ae(e),...t,children:h.jsx(YD,{})})}const TO=w.createContext(null),NO=w.createContext(null);function Io(){const e=w.useContext(TO);if(e===null)throw new Error(Cn(60));return e}function RO(){const e=w.useContext(NO);if(e===null)throw new Error(Cn(61));return e}const jpe=(e,t)=>Object.is(e,t);function Xc(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function Mpe(e,t,n){return!e||e.length===0?!1:e.some(r=>r===void 0?!1:Xc(t,r,n))}function $d(e,t,n){return!e||e.length===0?-1:e.findIndex(r=>r===void 0?!1:Xc(r,t,n))}function Dpe(e,t,n){return e.filter(r=>!Xc(t,r,n))}function Qx(e){if(e==null)return"";if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return String(e)}}function AO(e){return e!=null&&e.length>0&&typeof e[0]=="object"&&e[0]!=null&&"items"in e[0]}function _pe(e){if(!Array.isArray(e))return e!=null&&"null"in e;const t=e;if(AO(t)){for(const n of t)for(const r of n.items)if(r&&r.value==null&&r.label!=null)return!0;return!1}for(const n of t)if(n&&n.value==null&&n.label!=null)return!0;return!1}function Lpe(e,t){if(t&&e!=null)return t(e)??"";if(e&&typeof e=="object"){if("label"in e&&e.label!=null)return String(e.label);if("value"in e)return String(e.value)}return Qx(e)}function Sc(e,t){return t&&e!=null?t(e)??"":e&&typeof e=="object"&&"value"in e&&"label"in e?Qx(e.value):Qx(e)}function OO(e,t,n){function r(){return Lpe(e,n)}if(n&&e!=null)return n(e);if(e&&typeof e=="object"&&"label"in e&&e.label!=null)return e.label;if(t&&!Array.isArray(t))return t[e]??r();if(Array.isArray(t)){const i=t,s=AO(i)?i.flatMap(a=>a.items):i;if(e==null||typeof e!="object"){const a=s.find(c=>c.value===e);return a&&a.label!=null?a.label:r()}if("value"in e){const a=s.find(c=>c&&c.value===e.value);if(a&&a.label!=null)return a.label}}return r()}function Ipe(e,t,n){return e.reduce((r,i,s)=>(s>0&&r.push(", "),r.push(h.jsx(w.Fragment,{children:OO(i,t,n)},s)),r),[])}const St={id:Ue(e=>e.id),labelId:Ue(e=>e.labelId),modal:Ue(e=>e.modal),multiple:Ue(e=>e.multiple),items:Ue(e=>e.items),itemToStringLabel:Ue(e=>e.itemToStringLabel),itemToStringValue:Ue(e=>e.itemToStringValue),isItemEqualToValue:Ue(e=>e.isItemEqualToValue),value:Ue(e=>e.value),hasSelectedValue:Ue(e=>{const{value:t,multiple:n,itemToStringValue:r}=e;return t==null?!1:n&&Array.isArray(t)?t.length>0:Sc(t,r)!==""}),hasNullItemLabel:Ue((e,t)=>t?_pe(e.items):!1),open:Ue(e=>e.open),mounted:Ue(e=>e.mounted),forceMount:Ue(e=>e.forceMount),transitionStatus:Ue(e=>e.transitionStatus),openMethod:Ue(e=>e.openMethod),activeIndex:Ue(e=>e.activeIndex),selectedIndex:Ue(e=>e.selectedIndex),isActive:Ue((e,t)=>e.activeIndex===t),isSelected:Ue((e,t,n)=>{const r=e.isItemEqualToValue,i=e.value;return e.multiple?Array.isArray(i)&&i.some(s=>Xc(n,s,r)):e.selectedIndex===t&&e.selectedIndex!==null?!0:Xc(n,i,r)}),isSelectedByFocus:Ue((e,t)=>e.selectedIndex===t),popupProps:Ue(e=>e.popupProps),triggerProps:Ue(e=>e.triggerProps),triggerElement:Ue(e=>e.triggerElement),positionerElement:Ue(e=>e.positionerElement),listElement:Ue(e=>e.listElement),scrollUpArrowVisible:Ue(e=>e.scrollUpArrowVisible),scrollDownArrowVisible:Ue(e=>e.scrollDownArrowVisible),hasScrollArrows:Ue(e=>e.hasScrollArrows)};function Ppe(e){const{id:t,value:n,defaultValue:r=null,onValueChange:i,open:s,defaultOpen:a=!1,onOpenChange:c,name:u,autoComplete:f,disabled:m=!1,readOnly:p=!1,required:y=!1,modal:x=!0,actionsRef:b,inputRef:S,onOpenChangeComplete:k,items:E,multiple:T=!1,itemToStringLabel:N,itemToStringValue:j,isItemEqualToValue:O=jpe,highlightItemOnHover:A=!0,children:R}=e,{clearErrors:L}=Cv(),{setDirty:B,setTouched:I,setFocused:U,shouldValidateOnChange:Y,validityData:V,setFilled:q,name:H,disabled:z,validation:$,validationMode:G}=Df(),Q=kv({id:t}),_=z||m,P=H??u,[W,D]=$c({controlled:n,default:T?r??ef:r,name:"Select",state:"value"}),[Z,ee]=$c({controlled:s,default:a,name:"Select",state:"open"}),J=w.useRef([]),he=w.useRef([]),fe=w.useRef(null),Se=w.useRef(null),Ae=w.useRef(0),Oe=w.useRef(null),Pe=w.useRef([]),_e=w.useRef(!1),De=w.useRef(!1),xe=w.useRef(null),Ge=w.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1}),we=w.useRef(!1),{mounted:Re,setMounted:pe,transitionStatus:be}=Sa(Z),{openMethod:ne,triggerProps:ye}=xv(Z),Ce=ir(()=>new WN({id:Q,labelId:void 0,modal:x,multiple:T,itemToStringLabel:N,itemToStringValue:j,isItemEqualToValue:O,value:W,open:Z,mounted:Re,transitionStatus:be,items:E,forceMount:!1,openMethod:null,activeIndex:null,selectedIndex:null,popupProps:{},triggerProps:{},triggerElement:null,positionerElement:null,listElement:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1})).current,Ve=kt(Ce,St.activeIndex),lt=kt(Ce,St.selectedIndex),oe=kt(Ce,St.triggerElement),ke=kt(Ce,St.positionerElement),Le=w.useMemo(()=>T&&Array.isArray(W)&&W.length===0?"":Sc(W,j),[T,W,j]),Me=w.useMemo(()=>T&&Array.isArray(W)?W.map(yt=>Sc(yt,j)):Sc(W,j),[T,W,j]),He=gr(Ce.state.triggerElement);Ev({id:Q,commit:$.commit,value:W,controlRef:He,name:P,getValue:()=>Me});const ut=w.useRef(W);We(()=>{W!==ut.current&&Ce.set("forceMount",!0)},[Ce,W]),We(()=>{q(T?Array.isArray(W)&&W.length>0:W!=null)},[T,W,q]),We(function(){if(Z)return;const zt=Pe.current;if(T){const te=Array.isArray(W)?W:[];if(te.length===0){Ce.set("selectedIndex",null);return}const se=te[te.length-1],Te=$d(zt,se,O);Ce.set("selectedIndex",Te===-1?null:Te);return}const K=$d(zt,W,O);Ce.set("selectedIndex",K===-1?null:K)},[T,Z,W,Pe,O,Ce]),yv(W,()=>{L(P),B(W!==V.initialValue),Y()?$.commit(W):$.commit(W,!0)});const xt=tt((yt,zt)=>{if(c?.(yt,zt),!zt.isCanceled&&(ee(yt),!yt&&(zt.reason===fl||zt.reason===p0)&&(I(!0),U(!1),G==="onBlur"&&$.commit(W)),!yt&&Ce.state.activeIndex!==null)){const K=J.current[Ce.state.activeIndex];queueMicrotask(()=>{K?.setAttribute("tabindex","-1")})}}),Je=tt(()=>{pe(!1),Ce.set("activeIndex",null),k?.(!1)});Ki({enabled:!b,open:Z,ref:fe,onComplete(){Z||Je()}}),w.useImperativeHandle(b,()=>({unmount:Je}),[Je]);const Ke=tt((yt,zt)=>{i?.(yt,zt),!zt.isCanceled&&D(yt)}),bt=tt(()=>{const yt=Ce.state.listElement||fe.current;if(!yt)return;const zt=yt.scrollTop,K=yt.scrollTop+yt.clientHeight,te=zt>1,se=K<yt.scrollHeight-1;Ce.state.scrollUpArrowVisible!==te&&Ce.set("scrollUpArrowVisible",te),Ce.state.scrollDownArrowVisible!==se&&Ce.set("scrollDownArrowVisible",se)}),nt=XN({open:Z,onOpenChange:xt,elements:{reference:oe,floating:ke}}),Qe=Rb(nt,{enabled:!p&&!_,event:"mousedown"}),Ct=y0(nt,{bubbles:!1}),qe=tR(nt,{enabled:!p&&!_,listRef:J,activeIndex:Ve,selectedIndex:lt,disabledIndices:ef,onNavigate(yt){yt===null&&!Z||Ce.set("activeIndex",yt)},focusItemOnHover:!1}),ge=rR(nt,{enabled:!p&&!_&&(Z||!T),listRef:he,activeIndex:Ve,selectedIndex:lt,onMatch(yt){Z?Ce.set("activeIndex",yt):Ke(Pe.current[yt],Et("none"))},onTypingChange(yt){_e.current=yt}}),{getReferenceProps:je,getFloatingProps:Ye,getItemProps:Rt}=nu([Qe,Ct,qe,ge]),Ie=w.useMemo(()=>jo(je(),ye,Q?{id:Q}:Fn),[je,ye,Q]);l0(()=>{Ce.update({popupProps:Ye(),triggerProps:Ie})}),We(()=>{Ce.update({id:Q,modal:x,multiple:T,value:W,open:Z,mounted:Re,transitionStatus:be,popupProps:Ye(),triggerProps:Ie,items:E,itemToStringLabel:N,itemToStringValue:j,isItemEqualToValue:O,openMethod:ne})},[Ce,Q,x,T,W,Z,Re,be,Ye,Ie,E,N,j,O,ne]);const Pt=w.useMemo(()=>({store:Ce,name:P,required:y,disabled:_,readOnly:p,multiple:T,itemToStringLabel:N,itemToStringValue:j,highlightItemOnHover:A,setValue:Ke,setOpen:xt,listRef:J,popupRef:fe,scrollHandlerRef:Se,handleScrollArrowVisibility:bt,scrollArrowsMountedCountRef:Ae,getItemProps:Rt,events:nt.context.events,valueRef:Oe,valuesRef:Pe,labelsRef:he,typingRef:_e,selectionRef:Ge,selectedItemTextRef:xe,validation:$,onOpenChangeComplete:k,keyboardActiveRef:De,alignItemWithTriggerActiveRef:we,initialValueRef:ut}),[Ce,P,y,_,p,T,N,j,A,Ke,xt,Rt,nt.context.events,$,k,bt]),on=ps(S,$.inputRef),tn=T&&Array.isArray(W)&&W.length>0,vn=T?void 0:P,Ut=w.useMemo(()=>!T||!Array.isArray(W)||!P?null:W.map(yt=>{const zt=Sc(yt,j);return h.jsx("input",{type:"hidden",name:P,value:zt},zt)}),[T,W,P,j]);return h.jsx(TO.Provider,{value:Pt,children:h.jsxs(NO.Provider,{value:nt,children:[R,h.jsx("input",{...$.getInputValidationProps({onFocus(){Ce.state.triggerElement?.focus({focusVisible:!0})},onChange(yt){if(yt.nativeEvent.defaultPrevented)return;const zt=yt.target.value,K=Et(wl,yt.nativeEvent);function te(){if(T)return;const se=Pe.current.find(Te=>Sc(Te,j).toLowerCase()===zt.toLowerCase());se!=null&&(B(se!==V.initialValue),Ke(se,K),Y()&&$.commit(se))}Ce.set("forceMount",!0),queueMicrotask(te)}}),id:Q&&vn==null?`${Q}-hidden-input`:void 0,name:vn,autoComplete:f,value:Le,disabled:_,required:y&&!tn,readOnly:p,ref:on,style:P?CN:Sb,tabIndex:-1,"aria-hidden":!0}),Ut]})})}function zpe(e,t){return e??t}const Yp=2,Fpe=400,n6=200,Bpe={...Gy,...N0,value:()=>null},Hpe=w.forwardRef(function(t,n){const{render:r,className:i,id:s,disabled:a=!1,nativeButton:c=!0,...u}=t,{setTouched:f,setFocused:m,validationMode:p,state:y,disabled:x}=Df(),{labelId:b}=R0(),{store:S,setOpen:k,selectionRef:E,validation:T,readOnly:N,required:j,alignItemWithTriggerActiveRef:O,disabled:A,keyboardActiveRef:R}=Io(),L=x||A||a,B=kt(S,St.open),I=kt(S,St.value),U=kt(S,St.triggerProps),Y=kt(S,St.positionerElement),V=kt(S,St.listElement),q=kt(S,St.id),H=kt(S,St.labelId),z=kt(S,St.hasSelectedValue),$=!z&&B,G=kt(S,St.hasNullItemLabel,$),Q=s??q,_=zpe(b,H);kv({id:Q});const P=gr(Y),W=w.useRef(null),{getButtonProps:D,buttonRef:Z}=El({disabled:L,native:c}),ee=tt(De=>{S.set("triggerElement",De)}),J=ps(n,W,Z,ee),he=Bn(),fe=Bn(),Se=Bn(),Ae=Bn();w.useEffect(()=>{if(B)return!(z||G)?Se.start(Fpe,()=>{E.current.allowUnselectedMouseUp=!0,E.current.allowSelectedMouseUp=!0}):Ae.start(n6,()=>{E.current.allowUnselectedMouseUp=!0,Se.start(n6,()=>{E.current.allowSelectedMouseUp=!0})}),()=>{Se.clear(),Ae.clear()};E.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1},fe.clear()},[B,z,G,E,fe,Se,Ae]);const Oe=w.useMemo(()=>V?.id??Zd(Y)?.id,[V,Y]),Pe=jo(U,{id:Q,role:"combobox","aria-expanded":B?"true":"false","aria-haspopup":"listbox","aria-controls":B?Oe:void 0,"aria-labelledby":_,"aria-readonly":N||void 0,"aria-required":j||void 0,tabIndex:L?-1:0,ref:J,onFocus(De){m(!0),B&&O.current&&k(!1,Et(wl,De.nativeEvent)),he.start(0,()=>{S.set("forceMount",!0)})},onBlur(De){Nt(Y,De.relatedTarget)||(f(!0),m(!1),p==="onBlur"&&T.commit(I))},onPointerMove(){R.current=!1},onKeyDown(){R.current=!0},onMouseDown(De){if(B)return;const xe=Zt(De.currentTarget);function Ge(we){if(!W.current)return;const Re=we.target;if(Nt(W.current,Re)||Nt(P.current,Re)||Re===W.current)return;const pe=GA(W.current);we.clientX>=pe.left-Yp&&we.clientX<=pe.right+Yp&&we.clientY>=pe.top-Yp&&we.clientY<=pe.bottom+Yp||k(!1,Et(xN,we))}fe.start(0,()=>{xe.addEventListener("mouseup",Ge,{once:!0})})}},T.getValidationProps,u,D);Pe.role="combobox";const _e={...y,open:B,disabled:L,value:I,readOnly:N,placeholder:!z};return jt("button",t,{ref:[n,W],state:_e,stateAttributesMapping:Bpe,props:Pe})}),Upe={value:()=>null},Vpe=w.forwardRef(function(t,n){const{className:r,render:i,children:s,placeholder:a,...c}=t,{store:u,valueRef:f}=Io(),m=kt(u,St.value),p=kt(u,St.items),y=kt(u,St.itemToStringLabel),x=kt(u,St.hasSelectedValue),b=!x&&a!=null&&s==null,S=kt(u,St.hasNullItemLabel,b),k={value:m,placeholder:!x};let E=null;return typeof s=="function"?E=s(m):s!=null?E=s:!x&&a!=null&&!S?E=a:Array.isArray(m)?E=Ipe(m,p,y):E=OO(m,p,y),jt("span",t,{state:k,ref:[n,f],props:[{children:E},c],stateAttributesMapping:Upe})}),qpe=w.forwardRef(function(t,n){const{className:r,render:i,...s}=t,{store:a}=Io(),u={open:kt(a,St.open)};return jt("span",t,{state:u,ref:n,props:[{"aria-hidden":!0,children:"▼"},s],stateAttributesMapping:Hb})}),$pe=w.createContext(void 0),Ype=w.forwardRef(function(t,n){const{store:r}=Io(),i=kt(r,St.mounted),s=kt(r,St.forceMount);return i||s?h.jsx($pe.Provider,{value:!0,children:h.jsx(kb,{ref:n,...t})}):null}),jO=w.createContext(void 0);function Mw(){const e=w.useContext(jO);if(!e)throw new Error(Cn(59));return e}function Jm(e,t){e&&Object.assign(e.style,t)}const MO={position:"relative",maxHeight:"100%",overflowX:"hidden",overflowY:"auto"},Wpe={position:"fixed"},Gpe=w.forwardRef(function(t,n){const{anchor:r,positionMethod:i="absolute",className:s,render:a,side:c="bottom",align:u="center",sideOffset:f=0,alignOffset:m=0,collisionBoundary:p="clipping-ancestors",collisionPadding:y,arrowPadding:x=5,sticky:b=!1,disableAnchorTracking:S,alignItemWithTrigger:k=!0,collisionAvoidance:E=gN,...T}=t,{store:N,listRef:j,labelsRef:O,alignItemWithTriggerActiveRef:A,selectedItemTextRef:R,valuesRef:L,initialValueRef:B,popupRef:I,setValue:U}=Io(),Y=RO(),V=kt(N,St.open),q=kt(N,St.mounted),H=kt(N,St.modal),z=kt(N,St.value),$=kt(N,St.openMethod),G=kt(N,St.positionerElement),Q=kt(N,St.triggerElement),_=kt(N,St.isItemEqualToValue),P=kt(N,St.transitionStatus),W=w.useRef(null),D=w.useRef(null),[Z,ee]=w.useState(k),J=q&&Z&&$!=="touch";!q&&Z!==k&&ee(k),We(()=>{q||(St.scrollUpArrowVisible(N.state)&&N.set("scrollUpArrowVisible",!1),St.scrollDownArrowVisible(N.state)&&N.set("scrollDownArrowVisible",!1))},[N,q]),w.useImperativeHandle(A,()=>J),gv((J||H)&&V&&$!=="touch",Q);const he=Ub({anchor:r,floatingRootContext:Y,positionMethod:i,mounted:q,side:c,sideOffset:f,align:u,alignOffset:m,arrowPadding:x,collisionBoundary:p,collisionPadding:y,sticky:b,disableAnchorTracking:S??J,collisionAvoidance:E,keepMounted:!0}),fe=J?"none":he.side,Se=J?Wpe:he.positionerStyles,Ae=w.useMemo(()=>{const we={};return V||(we.pointerEvents="none"),{role:"presentation",hidden:!q,style:{...Se,...we}}},[V,q,Se]),Oe={open:V,side:fe,align:he.align,anchorHidden:he.anchorHidden},Pe=tt(we=>{N.set("positionerElement",we)}),_e=jt("div",t,{ref:[n,Pe],state:Oe,stateAttributesMapping:Ss,props:[Ae,ru(P),T]}),De=w.useRef(0),xe=tt(we=>{if(we.size===0&&De.current===0||L.current.length===0)return;const Re=De.current;if(De.current=we.size,we.size===Re)return;const pe=Et(wl);if(Re!==0&&!N.state.multiple&&z!==null&&$d(L.current,z,_)===-1){const ne=B.current,Ce=ne!=null&&$d(L.current,ne,_)!==-1?ne:null;U(Ce,pe),Ce===null&&(N.set("selectedIndex",null),R.current=null)}if(Re!==0&&N.state.multiple&&Array.isArray(z)){const be=ye=>$d(L.current,ye,_)!==-1,ne=z.filter(ye=>be(ye));(ne.length!==z.length||ne.some(ye=>!Mpe(z,ye,_)))&&(U(ne,pe),ne.length===0&&(N.set("selectedIndex",null),R.current=null))}if(V&&J){N.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});const be={height:""};Jm(G,be),Jm(I.current,be)}}),Ge=w.useMemo(()=>({...he,side:fe,alignItemWithTriggerActive:J,setControlledAlignItemWithTrigger:ee,scrollUpArrowRef:W,scrollDownArrowRef:D}),[he,fe,J,ee]);return h.jsx(HA,{elementsRef:j,labelsRef:O,onMapChange:xe,children:h.jsxs(jO.Provider,{value:Ge,children:[q&&H&&h.jsx(pv,{inert:Vb(!V),cutout:Q}),_e]})})});function DO(e){const t=e.currentTarget.getBoundingClientRect();return t.top+1<=e.clientY&&e.clientY<=t.bottom-1&&t.left+1<=e.clientX&&e.clientX<=t.right-1}const Wp="base-ui-disable-scrollbar",Xx={className:Wp,getElement(e){return h.jsx("style",{nonce:e,href:Wp,precedence:"base-ui:low",children:`.${Wp}{scrollbar-width:none}.${Wp}::-webkit-scrollbar{display:none}`})}};function Ty(e,t=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,n))}const Kpe=w.createContext(void 0),Qpe={disableStyleElements:!1};function Xpe(){return w.useContext(Kpe)??Qpe}const rs=1,Zpe={...Ss,...ws},Jpe=w.forwardRef(function(t,n){const{render:r,className:i,finalFocus:s,...a}=t,{store:c,popupRef:u,onOpenChangeComplete:f,setOpen:m,valueRef:p,selectedItemTextRef:y,keyboardActiveRef:x,multiple:b,handleScrollArrowVisibility:S,scrollHandlerRef:k,highlightItemOnHover:E}=Io(),{side:T,align:N,alignItemWithTriggerActive:j,setControlledAlignItemWithTrigger:O,scrollDownArrowRef:A,scrollUpArrowRef:R}=Mw(),L=FA()!=null,B=RO(),{nonce:I,disableStyleElements:U}=Xpe(),Y=Bn(),V=kt(c,St.id),q=kt(c,St.open),H=kt(c,St.mounted),z=kt(c,St.popupProps),$=kt(c,St.transitionStatus),G=kt(c,St.triggerElement),Q=kt(c,St.positionerElement),_=kt(c,St.listElement),P=w.useRef(0),W=w.useRef(!1),D=w.useRef(0),Z=w.useRef(!1),ee=w.useRef({}),J=g0(),he=tt(Oe=>{if(!Q||!u.current||!Z.current)return;if(W.current||!j){S();return}const Pe=Q.style.top==="0px",_e=Q.style.bottom==="0px",De=Q.getBoundingClientRect().height,xe=Zt(Q),Ge=getComputedStyle(Q),we=parseFloat(Ge.marginTop),Re=parseFloat(Ge.marginBottom),pe=r6(getComputedStyle(u.current)),be=Math.min(xe.documentElement.clientHeight-we-Re,pe),ne=Oe.scrollTop,ye=Gp(Oe);let Ce=0,Ve=null,lt=!1,oe=!1;const ke=Me=>{Q.style.height=`${Me}px`},Le=(Me,He)=>{const ut=Ty(Me,0,be-De);ut>0&&ke(De+ut),Oe.scrollTop=He,be-(De+ut)<=rs&&(W.current=!0),S()};if(Pe){const Me=ye-ne,He=De+Me,ut=Math.min(He,be);if(Ce=ut,Me<=rs){Le(Me,ye);return}be-ut>rs?oe=!0:lt=!0}else if(_e){const Me=ne,He=De+Me,ut=Math.min(He,be),xt=He-be;if(Ce=ut,Me<=rs){Le(Me,0);return}be-ut>rs?Ve=0:(lt=!0,ne<ye&&(Ve=ne-(Me-xt)))}if(Ce=Math.ceil(Ce),Ce!==0&&ke(Ce),oe||Ve!=null){const Me=Gp(Oe),He=oe?Me:Ty(Ve,0,Me);Math.abs(Oe.scrollTop-He)>rs&&(Oe.scrollTop=He)}(lt||Ce>=be-rs)&&(W.current=!0),S()});w.useImperativeHandle(k,()=>he,[he]),Ki({open:q,ref:u,onComplete(){q&&f?.(!0)}});const fe={open:q,transitionStatus:$,side:T,align:N};We(()=>{!Q||!u.current||Object.keys(ee.current).length||(ee.current={top:Q.style.top||"0",left:Q.style.left||"0",right:Q.style.right,height:Q.style.height,bottom:Q.style.bottom,minHeight:Q.style.minHeight,maxHeight:Q.style.maxHeight,marginTop:Q.style.marginTop,marginBottom:Q.style.marginBottom})},[u,Q]),We(()=>{q||j||(Z.current=!1,W.current=!1,P.current=0,D.current=0,Jm(Q,ee.current))},[q,j,Q,u]),We(()=>{const Oe=u.current;if(!(!q||!G||!Q||!Oe||c.state.transitionStatus==="ending")){if(!j){Z.current=!0,J.request(S),Oe.style.removeProperty("--transform-origin");return}queueMicrotask(()=>{const Pe=tme(Oe);Oe.style.removeProperty("--transform-origin");try{const _e=getComputedStyle(Q),De=getComputedStyle(Oe),xe=Zt(G),Ge=Un(Q),we=eme(G),Re=Kp(G.getBoundingClientRect(),we),pe=Kp(Q.getBoundingClientRect(),we),be=Re.left,ne=Re.height,ye=_||Oe,Ce=ye.scrollHeight,Ve=parseFloat(De.borderBottomWidth),lt=parseFloat(_e.marginTop)||10,oe=parseFloat(_e.marginBottom)||10,ke=parseFloat(_e.minHeight)||100,Le=r6(De),Me=5,He=5,ut=20,xt=xe.documentElement.clientHeight-lt-oe,Je=xe.documentElement.clientWidth,Ke=xt-Re.bottom+ne,bt=y.current,nt=p.current;let Qe,Ct=0,qe=0;if(bt&&nt){const zt=Kp(nt.getBoundingClientRect(),we);Qe=Kp(bt.getBoundingClientRect(),we);const K=zt.left-be,te=Qe.left-pe.left,se=zt.top-Re.top+zt.height/2,Te=Qe.top-pe.top+Qe.height/2;Ct=K-te,qe=Te-se}const ge=Ke+qe+oe+Ve;let je=Math.min(xt,ge);const Ye=xt-lt-oe,Rt=ge-je,Ie=Math.max(Me,be+Ct),Pt=Je-He,on=Math.max(0,Ie+pe.width-Pt);Q.style.left=`${Ie-on}px`,Q.style.height=`${je}px`,Q.style.maxHeight="auto",Q.style.marginTop=`${lt}px`,Q.style.marginBottom=`${oe}px`,Oe.style.height="100%";const tn=Gp(ye),vn=Rt>=tn-rs;vn&&(je=Math.min(xt,pe.height)-(Rt-tn));const Ut=Re.top<ut||Re.bottom>xt-ut||Math.ceil(je)+rs<Math.min(Ce,ke),yt=(Ge.visualViewport?.scale??1)!==1&&pb;if(Ut||yt){Z.current=!0,Jm(Q,ee.current),vi.flushSync(()=>O(!1));return}if(vn){const zt=Math.max(0,xt-ge);Q.style.top=pe.height>=Ye?"0":`${zt}px`,Q.style.height=`${je}px`,ye.scrollTop=Gp(ye),P.current=Math.max(ke,je)}else Q.style.bottom="0",P.current=Math.max(ke,je),ye.scrollTop=Rt;if(Qe){const zt=pe.top,K=pe.height,te=Qe.top+Qe.height/2,se=K>0?(te-zt)/K*100:50,Te=Ty(se,0,100);Oe.style.setProperty("--transform-origin",`50% ${Te}%`)}(P.current===xt||je>=Le)&&(W.current=!0),S(),setTimeout(()=>{Z.current=!0})}finally{Pe()}})}},[c,q,Q,G,p,y,u,S,j,O,J,A,R,_]),w.useEffect(()=>{if(!j||!Q||!q)return;const Oe=Un(Q);function Pe(_e){m(!1,Et(qP,_e))}return Oe.addEventListener("resize",Pe),()=>{Oe.removeEventListener("resize",Pe)}},[m,j,Q,q]);const Se={..._?{role:"presentation","aria-orientation":void 0}:{role:"listbox","aria-multiselectable":b||void 0,id:`${V}-list`},onKeyDown(Oe){x.current=!0,L&&fv.has(Oe.key)&&Oe.stopPropagation()},onMouseMove(){x.current=!1},onPointerLeave(Oe){if(!E||DO(Oe)||Oe.pointerType==="touch")return;const Pe=Oe.currentTarget;Y.start(0,()=>{c.set("activeIndex",null),Pe.focus({preventScroll:!0})})},onScroll(Oe){_||he(Oe.currentTarget)},...j&&{style:_?{height:"100%"}:MO}},Ae=jt("div",t,{ref:[n,u],state:fe,stateAttributesMapping:Zpe,props:[z,Se,ru($),{className:!_&&j?Xx.className:void 0},a]});return h.jsxs(w.Fragment,{children:[!U&&Xx.getElement(I),h.jsx(Nb,{context:B,modal:!1,disabled:!H,returnFocus:s,restoreFocus:!0,children:Ae})]})});function r6(e){const t=e.maxHeight||"";return t.endsWith("px")&&parseFloat(t)||1/0}function Gp(e){return Math.max(0,e.scrollHeight-e.clientHeight)}function eme(e){return BN.getScale(e)}function Kp(e,t){return Jd({x:e.x/t.x,y:e.y/t.y,width:e.width/t.x,height:e.height/t.y})}const i6=[["transform","none"],["scale","1"],["translate","0 0"]];function tme(e){const{style:t}=e,n={};for(const[r,i]of i6)n[r]=t.getPropertyValue(r),t.setProperty(r,i,"important");return()=>{for(const[r]of i6){const i=n[r];i?t.setProperty(r,i):t.removeProperty(r)}}}const nme=w.forwardRef(function(t,n){const{className:r,render:i,...s}=t,{store:a,scrollHandlerRef:c}=Io(),{alignItemWithTriggerActive:u}=Mw(),f=kt(a,St.hasScrollArrows),m=kt(a,St.openMethod),p=kt(a,St.multiple),x={id:`${kt(a,St.id)}-list`,role:"listbox","aria-multiselectable":p||void 0,onScroll(S){c.current?.(S.currentTarget)},...u&&{style:MO},className:f&&m!=="touch"?Xx.className:void 0},b=tt(S=>{a.set("listElement",S)});return jt("div",t,{ref:[n,b],props:[x,s]})}),_O=w.createContext(void 0);function Dw(){const e=w.useContext(_O);if(!e)throw new Error(Cn(57));return e}const rme=w.memo(w.forwardRef(function(t,n){const{render:r,className:i,value:s=null,label:a,disabled:c=!1,nativeButton:u=!1,...f}=t,m=w.useRef(null),p=lu({label:a,textRef:m,indexGuessBehavior:PA.GuessFromOrder}),{store:y,getItemProps:x,setOpen:b,setValue:S,selectionRef:k,typingRef:E,valuesRef:T,keyboardActiveRef:N,multiple:j,highlightItemOnHover:O}=Io(),A=Bn(),R=kt(y,St.isActive,p.index),L=kt(y,St.isSelected,p.index,s),B=kt(y,St.isSelectedByFocus,p.index),I=kt(y,St.isItemEqualToValue),U=p.index,Y=U!==-1,V=w.useRef(null),q=gr(U);We(()=>{if(!Y)return;const J=T.current;return J[U]=s,()=>{delete J[U]}},[Y,U,s,T]),We(()=>{if(!Y)return;const J=y.state.value;let he=J;j&&Array.isArray(J)&&J.length>0&&(he=J[J.length-1]),he!==void 0&&Xc(s,he,I)&&y.set("selectedIndex",U)},[Y,U,j,I,y,s]);const H={disabled:c,selected:L,highlighted:R},z=x({active:R,selected:L});z.onFocus=void 0,z.id=void 0;const $=w.useRef(null),G=w.useRef("mouse"),Q=w.useRef(!1),{getButtonProps:_,buttonRef:P}=El({disabled:c,focusableWhenDisabled:!0,native:u,composite:!0});function W(J){const he=y.state.value;if(j){const fe=Array.isArray(he)?he:[],Se=L?Dpe(fe,s,I):[...fe,s];S(Se,Et(ul,J))}else S(s,Et(ul,J)),b(!1,Et(ul,J))}const D={role:"option","aria-selected":L,tabIndex:R?0:-1,onFocus(){y.set("activeIndex",U)},onMouseEnter(){!N.current&&y.state.selectedIndex===null&&O&&y.set("activeIndex",U)},onMouseMove(){O&&y.set("activeIndex",U)},onMouseLeave(J){!O||N.current||DO(J)||A.start(0,()=>{y.state.activeIndex===U&&y.set("activeIndex",null)})},onTouchStart(){k.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1}},onKeyDown(J){$.current=J.key,y.set("activeIndex",U),J.key===" "&&E.current&&J.preventDefault()},onClick(J){Q.current=!1,!(J.type==="keydown"&&$.current===null)&&(c||J.type==="keydown"&&$.current===" "&&E.current||G.current!=="touch"&&!R||($.current=null,W(J.nativeEvent)))},onPointerEnter(J){G.current=J.pointerType},onPointerDown(J){G.current=J.pointerType,Q.current=!0},onMouseUp(){if(c)return;if(Q.current){Q.current=!1;return}const J=!k.current.allowSelectedMouseUp&&L,he=!k.current.allowUnselectedMouseUp&&!L;J||he||G.current!=="touch"&&!R||V.current?.click()}},Z=jt("div",t,{ref:[P,n,p.ref,V],state:H,props:[z,D,f,_]}),ee=w.useMemo(()=>({selected:L,indexRef:q,textRef:m,selectedByFocus:B,hasRegistered:Y}),[L,q,m,B,Y]);return h.jsx(_O.Provider,{value:ee,children:Z})})),ime=w.forwardRef(function(t,n){const r=t.keepMounted??!1,{selected:i}=Dw();return r||i?h.jsx(ome,{...t,ref:n}):null}),ome=w.memo(w.forwardRef((e,t)=>{const{render:n,className:r,keepMounted:i,...s}=e,{selected:a}=Dw(),c=w.useRef(null),{transitionStatus:u,setMounted:f}=Sa(a),p=jt("span",e,{ref:[t,c],state:{selected:a,transitionStatus:u},props:[{"aria-hidden":!0,children:"✔️"},s],stateAttributesMapping:ws});return Ki({open:a,ref:c,onComplete(){a||f(!1)}}),p})),sme=w.memo(w.forwardRef(function(t,n){const{indexRef:r,textRef:i,selectedByFocus:s,hasRegistered:a}=Dw(),{selectedItemTextRef:c}=Io(),{className:u,render:f,...m}=t,p=w.useCallback(x=>{if(!x||!a)return;const b=c.current===null||!c.current.isConnected;(s||b&&r.current===0)&&(c.current=x)},[c,r,s,a]);return jt("div",t,{ref:[p,n,i],props:m})})),LO=w.forwardRef(function(t,n){const{render:r,className:i,direction:s,keepMounted:a=!1,...c}=t,{store:u,popupRef:f,listRef:m,handleScrollArrowVisibility:p,scrollArrowsMountedCountRef:y}=Io(),{side:x,scrollDownArrowRef:b,scrollUpArrowRef:S}=Mw(),k=s==="up"?St.scrollUpArrowVisible:St.scrollDownArrowVisible,E=kt(u,k),T=kt(u,St.openMethod),N=E&&T!=="touch",j=Bn(),O=s==="up"?S:b,{transitionStatus:A,setMounted:R}=Sa(N);We(()=>(y.current+=1,u.state.hasScrollArrows||u.set("hasScrollArrows",!0),()=>{y.current=Math.max(0,y.current-1),y.current===0&&u.state.hasScrollArrows&&u.set("hasScrollArrows",!1)}),[u,y]),Ki({open:N,ref:O,onComplete(){N||R(!1)}});const I=jt("div",t,{ref:[n,O],state:{direction:s,visible:N,side:x,transitionStatus:A},props:[{"aria-hidden":!0,children:s==="up"?"▲":"▼",style:{position:"absolute"},onMouseMove(Y){if(Y.movementX===0&&Y.movementY===0||j.isStarted())return;u.set("activeIndex",null);function V(){const q=u.state.listElement??f.current;if(!q)return;u.set("activeIndex",null),p();const H=q.scrollTop===0,z=Math.round(q.scrollTop+q.clientHeight)>=q.scrollHeight;if(m.current.length===0&&(s==="up"?u.set("scrollUpArrowVisible",!H):u.set("scrollDownArrowVisible",!z)),s==="up"&&H||s==="down"&&z){j.clear();return}if((u.state.listElement||f.current)&&m.current&&m.current.length>0){const G=m.current,Q=O.current?.offsetHeight||0;if(s==="up"){let _=0;const P=q.scrollTop+Q;for(let D=0;D<G.length;D+=1){const Z=G[D];if(Z&&Z.offsetTop>=P){_=D;break}}const W=Math.max(0,_-1);if(W<_){const D=G[W];D&&(q.scrollTop=Math.max(0,D.offsetTop-Q))}else q.scrollTop=0}else{let _=G.length-1;const P=q.scrollTop+q.clientHeight-Q;for(let D=0;D<G.length;D+=1){const Z=G[D];if(Z&&Z.offsetTop+Z.offsetHeight>P){_=Math.max(0,D-1);break}}const W=Math.min(G.length-1,_+1);if(W>_){const D=G[W];D&&(q.scrollTop=D.offsetTop+D.offsetHeight-q.clientHeight+Q)}else q.scrollTop=q.scrollHeight-q.clientHeight}}j.start(40,V)}j.start(40,V)},onMouseLeave(){j.clear()}},c]});return N||a?I:null}),ame=w.forwardRef(function(t,n){return h.jsx(LO,{...t,ref:n,direction:"down"})}),lme=w.forwardRef(function(t,n){return h.jsx(LO,{...t,ref:n,direction:"up"})}),cme=Ppe;function ume({className:e,...t}){return h.jsx(Vpe,{"data-slot":"select-value",className:ae("flex flex-1 text-left",e),...t})}function dme({className:e,size:t="default",children:n,...r}){return h.jsxs(Hpe,{"data-slot":"select-trigger","data-size":t,className:ae("flex w-fit items-center justify-between gap-1.5 rounded-md border border-input bg-transparent py-2 pr-2 pl-2.5 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-placeholder:text-muted-foreground data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5 dark:bg-background dark:hover:bg-background dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...r,children:[n,h.jsx(qpe,{render:h.jsx(e0,{className:"pointer-events-none size-4 text-muted-foreground"})})]})}function fme({className:e,children:t,side:n="bottom",sideOffset:r=4,align:i="center",alignOffset:s=0,alignItemWithTrigger:a=!0,...c}){return h.jsx(Ype,{children:h.jsx(Gpe,{side:n,sideOffset:r,align:i,alignOffset:s,alignItemWithTrigger:a,className:"isolate z-50",children:h.jsxs(Jpe,{"data-slot":"select-content","data-align-trigger":a,className:ae("relative isolate z-50 max-h-(--available-height) w-(--anchor-width) min-w-36 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-md bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[align-trigger=true]:animate-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",e),...c,children:[h.jsx(pme,{}),h.jsx(nme,{children:t}),h.jsx(mme,{})]})})})}function hme({className:e,children:t,...n}){return h.jsxs(rme,{"data-slot":"select-item",className:ae("relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e),...n,children:[h.jsx(sme,{className:"flex flex-1 shrink-0 gap-2 whitespace-nowrap",children:t}),h.jsx(ime,{render:h.jsx("span",{className:"pointer-events-none absolute right-2 flex size-4 items-center justify-center"}),children:h.jsx(bf,{className:"pointer-events-none"})})]})}function pme({className:e,...t}){return h.jsx(lme,{"data-slot":"select-scroll-up-button",className:ae("top-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4",e),...t,children:h.jsx(UD,{})})}function mme({className:e,...t}){return h.jsx(ame,{"data-slot":"select-scroll-down-button",className:ae("bottom-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4",e),...t,children:h.jsx(e0,{})})}const o6=[20,50,100];function gme({onPageChange:e,onPageSizeChange:t,page:n,pageCount:r,pageSize:i,total:s}){if(r<=1&&s<=o6[0])return null;const a=n>1,c=n<r;return h.jsx(Epe,{className:"mx-0 w-auto",children:h.jsxs(Tpe,{children:[h.jsx(yc,{children:h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:"text-muted-foreground text-sm",children:"Rows per page"}),h.jsxs(cme,{onValueChange:u=>t(Number(u)),value:String(i),children:[h.jsx(dme,{className:"h-8 text-xs",size:"sm",children:h.jsx(ume,{})}),h.jsx(fme,{children:o6.map(u=>h.jsx(hme,{value:String(u),children:u},u))})]})]})}),h.jsx(yc,{children:h.jsxs("span",{className:"text-muted-foreground px-2 text-sm",children:["Page ",n," of ",Math.max(r,1)]})}),h.jsx(yc,{children:h.jsx(Npe,{"aria-disabled":!a,className:ae({"pointer-events-none opacity-50":!a}),onClick:()=>a&&e(1)})}),h.jsx(yc,{children:h.jsx(Rpe,{"aria-disabled":!a,className:ae({"pointer-events-none opacity-50":!a}),onClick:()=>a&&e(n-1)})}),h.jsx(yc,{children:h.jsx(Ape,{"aria-disabled":!c,className:ae({"pointer-events-none opacity-50":!c}),onClick:()=>c&&e(n+1)})}),h.jsx(yc,{children:h.jsx(Ope,{"aria-disabled":!c,className:ae({"pointer-events-none opacity-50":!c}),onClick:()=>c&&e(r)})})]})})}const yme=80;function xme(e){if(!Vc(e.status))return null;const t=e.toolCalls?.at(-1),n=e.reasoningContents?.at(-1),r=t?.timestamp??0,i=n?.timestamp??0;return t&&r>=i?{arg:Cw(t),kind:"tool",tool:t.toolName}:n&&n.content.trim()?{kind:"reasoning",text:n.content.trim().replaceAll(/\s+/g," ").slice(0,yme)}:"thinking"}function bme(e,t,n){if(!e)return;const r=n||e;return t?`${r}:${t}`:r}const vme="INTERRUPTED",wme="Interrupted (daemon terminated)";function Sme(e){return e.status!=="error"||!e.error?!1:e.error.code===vme||e.error.message===wme}const is={action:"w-12",checkbox:"w-10",duration:"w-24",id:"w-36",input:"min-w-72",provider:"w-44",started:"w-28",status:"w-36",type:"w-24"};function Cme(e,t){return e.completedAt&&e.startedAt?Md(e.completedAt-e.startedAt):e.startedAt?Md(t-e.startedAt):e.completedAt?Md(e.completedAt-e.createdAt):Md(t-e.createdAt)}function kme({allSelected:e,filtered:t,now:n,onClearSearch:r,onDelete:i,onRowClick:s,onToggleSelect:a,onToggleSelectAll:c,providerNames:u,searchQuery:f,selectedIds:m,statusFilter:p}){return h.jsxs(u9,{children:[h.jsx(d9,{children:h.jsxs(Lc,{children:[h.jsx(zi,{className:is.checkbox,children:h.jsx(IO,{checked:e,onChange:c})}),h.jsx(zi,{className:ae(is.id,"text-xs tracking-wider"),children:"ID"}),h.jsx(zi,{className:ae(is.type,"text-xs tracking-wider"),children:"Type"}),h.jsx(zi,{className:ae(is.provider,"text-xs tracking-wider"),children:"Provider"}),h.jsx(zi,{className:ae(is.input,"text-xs tracking-wider"),children:"Input"}),h.jsx(zi,{className:ae(is.status,"text-xs tracking-wider"),children:"Status"}),h.jsx(zi,{className:ae(is.started,"text-right text-xs tracking-wider"),children:"Started"}),h.jsx(zi,{className:ae(is.duration,"text-right text-xs tracking-wider"),children:"Duration"}),h.jsx(zi,{className:is.action})]})}),h.jsx(f9,{children:t.length===0?h.jsx(Lc,{children:h.jsx(Nr,{className:"text-muted-foreground py-10 text-center text-sm",colSpan:9,children:h.jsx(kpe,{onClearSearch:r,query:f,status:p})})}):t.map(y=>h.jsx(Eme,{isSelected:m.has(y.taskId),now:n,onDelete:i,onRowClick:s,onToggleSelect:a,providerNames:u,task:y},y.taskId))})]})}function Eme({isSelected:e,now:t,onDelete:n,onRowClick:r,onToggleSelect:i,providerNames:s,task:a}){const c=aa(a.status),u=!c,f=Sme(a),m=xme(a),p=h.jsxs(Lc,{className:ae("cursor-pointer [&>td]:align-middle",{"opacity-60":f}),"data-state":e?"selected":void 0,onClick:()=>r(a.taskId),children:[h.jsxs(Nr,{className:"relative",onClick:y=>y.stopPropagation(),children:[u&&h.jsx("span",{className:"bg-blue-400/70 pointer-events-none absolute top-2 bottom-2 left-0 w-0.5 rounded-full"}),h.jsx(IO,{checked:e,onChange:()=>i(a.taskId)})]}),h.jsx(Nr,{className:"text-identifier mono text-xs",title:a.taskId,children:rO(a.taskId)}),h.jsx(Nr,{children:h.jsx(Tme,{type:a.type})}),h.jsx(Nr,{children:h.jsx(Nme,{model:a.model,provider:a.provider,providerName:a.provider?s.get(a.provider):void 0})}),h.jsxs(Nr,{className:"text-foreground max-w-0",children:[h.jsx("div",{className:"truncate",title:a.content||void 0,children:a.content||h.jsx("span",{className:"text-muted-foreground italic",children:"(empty)"})}),m&&h.jsxs("div",{className:"text-muted-foreground mono mt-1 flex items-center gap-1.5 text-[11px]",children:[h.jsx("span",{className:"text-blue-400",children:"▸"}),m==="thinking"&&h.jsx("span",{className:"italic",children:"thinking…"}),m!=="thinking"&&m.kind==="tool"&&h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"text-foreground/80",children:m.tool}),m.arg&&h.jsxs("span",{className:"truncate",children:["· ",m.arg]})]}),m!=="thinking"&&m.kind==="reasoning"&&h.jsx("span",{className:"truncate italic",children:m.text})]})]}),h.jsx(Nr,{children:h.jsx(sO,{status:a.status})}),h.jsxs(Nr,{className:"text-muted-foreground text-right text-xs",title:nO(a.startedAt??a.createdAt),children:[tO(a.startedAt??a.createdAt,t)," ago"]}),h.jsx(Nr,{className:ae("text-right mono text-xs tabular-nums",u?"text-blue-400":"text-muted-foreground"),children:Cme(a,t)}),h.jsx(Nr,{className:"text-center",onClick:y=>y.stopPropagation(),children:c&&h.jsx(Rme,{onClick:()=>n(a.taskId)})})]});return f?h.jsxs(ms,{children:[h.jsx(gs,{render:p}),h.jsx(ys,{children:"Daemon was restarted while this task was running. The task did not complete."})]}):p}function Tme({type:e}){return h.jsx(uo,{className:"text-muted-foreground mono text-[10px] leading-none uppercase tracking-wider",variant:"outline",children:sA(e)})}function Nme({model:e,provider:t,providerName:n}){const r=bme(t,e,n);return r?h.jsx(uo,{className:"text-muted-foreground mono max-w-full truncate text-[10px] tracking-wider",title:r,variant:"outline",children:r}):null}function Rme({onClick:e}){return h.jsx(ze,{"aria-label":"Delete",onClick:e,size:"icon-xs",title:"Delete",variant:"ghost",children:h.jsx(D$,{className:"size-3.5"})})}function IO({checked:e,onChange:t}){return h.jsx("input",{checked:e,className:"border-border bg-transparent accent-blue-500 size-3.5 cursor-pointer rounded border",onChange:t,type:"checkbox"})}function Ame(){const[e,t]=a0(),n=e.get("task")??void 0,r=ge=>{t(je=>{const Ye=new URLSearchParams(je);return Ye.set("task",ge),Ye})},i=w.useCallback(()=>{t(ge=>{const je=new URLSearchParams(ge);return je.delete("task"),je})},[t]),s=$e(ge=>ge.selectedProject),a=qc(ge=>ge.clearCompleted),c=qc(ge=>ge.removeTask),{clearAllFilters:u,filters:f,setDurationPreset:m,setModelFilter:p,setPage:y,setPageSize:x,setProviderFilter:b,setSearchQuery:S,setStatusFilter:k,setTimeRange:E,setTypeFilter:T}=sde(),{data:N}=lv(),j=N?.providers??[],O=w.useMemo(()=>new Map((N?.providers??[]).map(ge=>[ge.id,ge.name])),[N]),{createdAfter:A,createdBefore:R,durationPreset:L,modelFilter:B,page:I,pageSize:U,providerFilter:Y,searchQuery:V,statusFilter:q,typeFilter:H}=f,z=w.useMemo(()=>tde(L),[L]),$=Xue(V,300),G=w.useMemo(()=>({projectPath:s||void 0,...H.length>0?{type:H}:{},...Y.length>0?{provider:Y}:{},...B.length>0?{model:B}:{},...A===void 0?{}:{createdAfter:A},...R===void 0?{}:{createdBefore:R},...z,...$.trim()?{searchText:$.trim()}:{}}),[s,H,Y,B,A,R,z,$]),Q=w.useMemo(()=>cde(q),[q]),{data:_,isLoading:P}=IT({page:I,pageSize:U,...G,...Q?{status:Q}:{}}),{data:W}=IT({page:1,pageSize:1,...G}),D=_?.tasks??[],Z=W?.counts??{all:0,cancelled:0,completed:0,failed:0,running:0},ee=_?.availableProviders??[],J=_?.availableModels??[],he=Q7(Z.running>0),fe=q!=="all"||H.length>0||Y.length>0||B.length>0||A!==void 0||R!==void 0||L!=="all"||V.trim().length>0,Se=Kue(),Ae=Wue(),Oe=$ue(),[Pe,_e]=w.useState(new Set),[De,xe]=w.useState({open:!1}),Ge=Ht(ge=>ge.tourActive),we=Ht(ge=>ge.tourStep),Re=Ht(ge=>ge.tourTaskId),pe=Ht(ge=>ge.setTourTaskId),ne=Ge&&(we==="curate"||we==="query"),ye=ne&&!Re?we==="curate"?"Click to capture knowledge":"Click to ask a question":void 0,Ce=()=>{if(ne){xe({initialContent:we==="curate"?Hue:Uue,initialType:we,open:!0});return}xe({open:!0})},Ve=()=>xe({open:!1}),lt=Wx(ge=>ge.seed),oe=Wx(ge=>ge.consume);w.useEffect(()=>{lt&&(xe({initialContent:lt.content,initialType:lt.type,open:!0}),i(),oe())},[lt,oe,i]);const ke=(ge,je)=>{ne&&pe(ge),je&&r(ge)},Le=w.useMemo(()=>new Map(D.map(ge=>[ge.taskId,ge])),[D]),Me=w.useMemo(()=>[...D].sort((ge,je)=>{const Ye=aa(ge.status)?1:0,Rt=aa(je.status)?1:0;if(Ye!==Rt)return Ye-Rt;const Ie=ge.completedAt??ge.startedAt??ge.createdAt;return(je.completedAt??je.startedAt??je.createdAt)-Ie}),[D]),He=Me.length>0&&Me.every(ge=>Pe.has(ge.taskId)),ut=Pe.size>0,xt=Z.completed+Z.failed+Z.cancelled,Je=w.useMemo(()=>{for(const ge of Pe){const je=Le.get(ge);if(je&&aa(je.status))return!0}return!1},[Pe,Le]),Ke=ge=>{_e(je=>{const Ye=new Set(je);return Ye.has(ge)?Ye.delete(ge):Ye.add(ge),Ye})},bt=()=>{_e(ge=>{if(He)return new Set;const je=new Set(ge);for(const Ye of Me)je.add(Ye.taskId);return je})},nt=()=>_e(new Set),Qe=ge=>{Se.mutate({taskId:ge},{onError:je=>ht.error(je.message),onSuccess:()=>c(ge)})},Ct=()=>{const ge=[...Pe].filter(je=>{const Ye=Le.get(je);return Ye!==void 0&&aa(Ye.status)});if(ge.length===0){nt();return}Ae.mutate({taskIds:ge},{onError:je=>ht.error(je.message),onSuccess(){for(const je of ge)c(je);nt()}})},qe=()=>{Oe.mutate(s?{projectPath:s}:{},{onError:ge=>ht.error(ge.message),onSuccess:()=>a()})};return h.jsxs("div",{className:"mx-auto flex h-full w-full min-h-0 max-w-7xl flex-col gap-3",children:[ut?h.jsx(wpe,{canDelete:Je,count:Pe.size,onClear:nt,onDelete:Ct}):h.jsx(xpe,{availableModels:J,availableProviders:ee,breakdown:Z,createdAfter:A,createdBefore:R,durationPreset:L,modelFilter:B,onDurationChange:ge=>{m(ge),nt()},onModelChange:ge=>{p(ge),nt()},onNewTask:Ce,onProviderChange:ge=>{b(ge),nt()},onSearchChange:S,onStatusChange:ge=>{k(ge),nt()},onTimeRangeChange:ge=>{E(ge),nt()},onTypeChange:ge=>{T(ge),nt()},providerFilter:Y,providers:j,searchQuery:V,statusFilter:q,tourCue:ye&&D.length>0?ye:void 0,typeFilter:H}),h.jsx(vpe,{createdAfter:A,createdBefore:R,durationPreset:L,modelFilter:B,onClearAll:u,onDurationChange:m,onModelChange:p,onProviderChange:b,onSearchChange:S,onStatusChange:k,onTimeRangeChange:E,onTypeChange:T,providerFilter:Y,providers:j,searchQuery:V,statusFilter:q,typeFilter:H}),P?h.jsx(t6,{children:h.jsx(Spe,{})}):D.length===0?h.jsx(t6,{withDots:!0,children:h.jsx(Cpe,{hasActiveFilters:fe,onClearFilters:u,onNewTask:Ce,tourCue:ye})}):h.jsx(kme,{allSelected:He,filtered:Me,now:he,onClearSearch:()=>S(""),onDelete:Qe,onRowClick:r,onToggleSelect:Ke,onToggleSelectAll:bt,providerNames:O,searchQuery:V,selectedIds:Pe,statusFilter:q}),(_||xt>0)&&h.jsxs("div",{className:"flex items-center justify-between gap-3 px-1",children:[_?h.jsx(gme,{onPageChange:y,onPageSizeChange:x,page:_.page,pageCount:_.pageCount,pageSize:_.pageSize,total:_.total}):h.jsx("span",{}),xt>0&&h.jsxs(ze,{onClick:qe,size:"xs",variant:"ghost",children:["Clear finished (",xt,")"]})]}),h.jsx(Y7,{onOpenChange:ge=>!ge&&i(),open:!!n,children:h.jsx(W7,{className:"data-[side=right]:w-full data-[side=right]:max-w-3xl p-0 shadow-[inset_1px_0_0_rgba(96,165,250,0.18)]",side:"right",children:n&&h.jsx(_fe,{taskId:n})})}),h.jsx(Nde,{initialContent:De.initialContent,initialType:De.initialType,onClose:Ve,onSubmitted:ke,open:De.open,prefillNotice:ne?"example":void 0,tourStepLabel:ne?Vue[we]:void 0})]})}function Ome(){return h.jsx(Ame,{})}const jme=jI([{element:h.jsx(zue,{}),path:"/projects"},{children:[{children:[{element:h.jsx(Lue,{}),index:!0},{element:h.jsx(VJ,{}),path:"changes"},{element:h.jsx(Yee,{}),path:"configuration"},{element:h.jsx(QG,{}),path:"analytics"},{element:h.jsx(_ue,{}),path:"contexts"},{element:h.jsx(Ome,{}),path:"tasks"},{element:h.jsx(LT,{}),path:"*"}],element:h.jsx(KG,{})}],element:h.jsx(DV,{}),path:"/"},{element:h.jsx(LT,{}),path:"*"}]);function Mme(){return h.jsxs(cV,{children:[h.jsx(UI,{router:jme}),h.jsx(y_,{position:"top-center"})]})}const PO=document.querySelector("#root");if(PO===null)throw new Error("Root element not found");const Dme=JM.createRoot(PO);Dme.render(h.jsx(Mme,{}));