codekin 0.3.7 → 0.4.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.
- package/README.md +2 -1
- package/dist/assets/index-BAdQqYEY.js +182 -0
- package/dist/assets/index-CeZYNLWt.css +1 -0
- package/dist/index.html +2 -2
- package/package.json +8 -2
- package/server/dist/approval-manager.d.ts +44 -8
- package/server/dist/approval-manager.js +262 -23
- package/server/dist/approval-manager.js.map +1 -1
- package/server/dist/claude-process.d.ts +16 -0
- package/server/dist/claude-process.js +35 -10
- package/server/dist/claude-process.js.map +1 -1
- package/server/dist/commit-event-handler.d.ts +41 -0
- package/server/dist/commit-event-handler.js +99 -0
- package/server/dist/commit-event-handler.js.map +1 -0
- package/server/dist/commit-event-hooks.d.ts +35 -0
- package/server/dist/commit-event-hooks.js +177 -0
- package/server/dist/commit-event-hooks.js.map +1 -0
- package/server/dist/crypto-utils.js +10 -5
- package/server/dist/crypto-utils.js.map +1 -1
- package/server/dist/diff-parser.d.ts +23 -0
- package/server/dist/diff-parser.js +236 -0
- package/server/dist/diff-parser.js.map +1 -0
- package/server/dist/session-manager.d.ts +25 -8
- package/server/dist/session-manager.js +364 -29
- package/server/dist/session-manager.js.map +1 -1
- package/server/dist/session-routes.js +101 -4
- package/server/dist/session-routes.js.map +1 -1
- package/server/dist/stepflow-handler.js +17 -3
- package/server/dist/stepflow-handler.js.map +1 -1
- package/server/dist/tsconfig.tsbuildinfo +1 -1
- package/server/dist/types.d.ts +62 -1
- package/server/dist/upload-routes.d.ts +1 -1
- package/server/dist/upload-routes.js +40 -13
- package/server/dist/upload-routes.js.map +1 -1
- package/server/dist/webhook-workspace.js +5 -2
- package/server/dist/webhook-workspace.js.map +1 -1
- package/server/dist/workflow-loader.d.ts +6 -0
- package/server/dist/workflow-loader.js +11 -0
- package/server/dist/workflow-loader.js.map +1 -1
- package/server/dist/workflow-routes.d.ts +5 -1
- package/server/dist/workflow-routes.js +48 -7
- package/server/dist/workflow-routes.js.map +1 -1
- package/server/dist/ws-message-handler.js +20 -0
- package/server/dist/ws-message-handler.js.map +1 -1
- package/server/dist/ws-server.js +19 -3
- package/server/dist/ws-server.js.map +1 -1
- package/server/workflows/commit-review.md +22 -0
- package/server/workflows/docs-audit.weekly.md +97 -0
- package/dist/assets/index-Dc76fIdG.js +0 -174
- package/dist/assets/index-DoL2Uppj.css +0 -1
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
function XE(e,n){for(var r=0;r<n.length;r++){const l=n[r];if(typeof l!="string"&&!Array.isArray(l)){for(const s in l)if(s!=="default"&&!(s in e)){const o=Object.getOwnPropertyDescriptor(l,s);o&&Object.defineProperty(e,s,o.get?o:{enumerable:!0,get:()=>l[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))l(s);new MutationObserver(s=>{for(const o of s)if(o.type==="childList")for(const u of o.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&l(u)}).observe(document,{childList:!0,subtree:!0});function r(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerPolicy&&(o.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?o.credentials="include":s.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function l(s){if(s.ep)return;s.ep=!0;const o=r(s);fetch(s.href,o)}})();function so(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ud={exports:{}},Ts={};var Kb;function KE(){if(Kb)return Ts;Kb=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function r(l,s,o){var u=null;if(o!==void 0&&(u=""+o),s.key!==void 0&&(u=""+s.key),"key"in s){o={};for(var f in s)f!=="key"&&(o[f]=s[f])}else o=s;return s=o.ref,{$$typeof:e,type:l,key:u,ref:s!==void 0?s:null,props:o}}return Ts.Fragment=n,Ts.jsx=r,Ts.jsxs=r,Ts}var Zb;function ZE(){return Zb||(Zb=1,Ud.exports=KE()),Ud.exports}var h=ZE(),$d={exports:{}},Ye={};var Qb;function QE(){if(Qb)return Ye;Qb=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),l=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),u=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),x=Symbol.for("react.lazy"),g=Symbol.for("react.activity"),y=Symbol.iterator;function v(D){return D===null||typeof D!="object"?null:(D=y&&D[y]||D["@@iterator"],typeof D=="function"?D:null)}var S={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},E=Object.assign,T={};function N(D,L,A){this.props=D,this.context=L,this.refs=T,this.updater=A||S}N.prototype.isReactComponent={},N.prototype.setState=function(D,L){if(typeof D!="object"&&typeof D!="function"&&D!=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,D,L,"setState")},N.prototype.forceUpdate=function(D){this.updater.enqueueForceUpdate(this,D,"forceUpdate")};function j(){}j.prototype=N.prototype;function C(D,L,A){this.props=D,this.context=L,this.refs=T,this.updater=A||S}var I=C.prototype=new j;I.constructor=C,E(I,N.prototype),I.isPureReactComponent=!0;var U=Array.isArray;function _(){}var z={H:null,A:null,T:null,S:null},P=Object.prototype.hasOwnProperty;function X(D,L,A){var se=A.ref;return{$$typeof:e,type:D,key:L,ref:se!==void 0?se:null,props:A}}function B(D,L){return X(D.type,L,D.props)}function q(D){return typeof D=="object"&&D!==null&&D.$$typeof===e}function Z(D){var L={"=":"=0",":":"=2"};return"$"+D.replace(/[=:]/g,function(A){return L[A]})}var ee=/\/+/g;function ae(D,L){return typeof D=="object"&&D!==null&&D.key!=null?Z(""+D.key):L.toString(36)}function Y(D){switch(D.status){case"fulfilled":return D.value;case"rejected":throw D.reason;default:switch(typeof D.status=="string"?D.then(_,_):(D.status="pending",D.then(function(L){D.status==="pending"&&(D.status="fulfilled",D.value=L)},function(L){D.status==="pending"&&(D.status="rejected",D.reason=L)})),D.status){case"fulfilled":return D.value;case"rejected":throw D.reason}}throw D}function M(D,L,A,se,te){var ie=typeof D;(ie==="undefined"||ie==="boolean")&&(D=null);var Se=!1;if(D===null)Se=!0;else switch(ie){case"bigint":case"string":case"number":Se=!0;break;case"object":switch(D.$$typeof){case e:case n:Se=!0;break;case x:return Se=D._init,M(Se(D._payload),L,A,se,te)}}if(Se)return te=te(D),Se=se===""?"."+ae(D,0):se,U(te)?(A="",Se!=null&&(A=Se.replace(ee,"$&/")+"/"),M(te,L,A,"",function(qe){return qe})):te!=null&&(q(te)&&(te=B(te,A+(te.key==null||D&&D.key===te.key?"":(""+te.key).replace(ee,"$&/")+"/")+Se)),L.push(te)),1;Se=0;var je=se===""?".":se+":";if(U(D))for(var Ae=0;Ae<D.length;Ae++)se=D[Ae],ie=je+ae(se,Ae),Se+=M(se,L,A,ie,te);else if(Ae=v(D),typeof Ae=="function")for(D=Ae.call(D),Ae=0;!(se=D.next()).done;)se=se.value,ie=je+ae(se,Ae++),Se+=M(se,L,A,ie,te);else if(ie==="object"){if(typeof D.then=="function")return M(Y(D),L,A,se,te);throw L=String(D),Error("Objects are not valid as a React child (found: "+(L==="[object Object]"?"object with keys {"+Object.keys(D).join(", ")+"}":L)+"). If you meant to render a collection of children, use an array instead.")}return Se}function K(D,L,A){if(D==null)return D;var se=[],te=0;return M(D,se,"","",function(ie){return L.call(A,ie,te++)}),se}function le(D){if(D._status===-1){var L=D._result;L=L(),L.then(function(A){(D._status===0||D._status===-1)&&(D._status=1,D._result=A)},function(A){(D._status===0||D._status===-1)&&(D._status=2,D._result=A)}),D._status===-1&&(D._status=0,D._result=L)}if(D._status===1)return D._result.default;throw D._result}var be=typeof reportError=="function"?reportError:function(D){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var L=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof D=="object"&&D!==null&&typeof D.message=="string"?String(D.message):String(D),error:D});if(!window.dispatchEvent(L))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",D);return}console.error(D)},O={map:K,forEach:function(D,L,A){K(D,function(){L.apply(this,arguments)},A)},count:function(D){var L=0;return K(D,function(){L++}),L},toArray:function(D){return K(D,function(L){return L})||[]},only:function(D){if(!q(D))throw Error("React.Children.only expected to receive a single React element child.");return D}};return Ye.Activity=g,Ye.Children=O,Ye.Component=N,Ye.Fragment=r,Ye.Profiler=s,Ye.PureComponent=C,Ye.StrictMode=l,Ye.Suspense=d,Ye.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=z,Ye.__COMPILER_RUNTIME={__proto__:null,c:function(D){return z.H.useMemoCache(D)}},Ye.cache=function(D){return function(){return D.apply(null,arguments)}},Ye.cacheSignal=function(){return null},Ye.cloneElement=function(D,L,A){if(D==null)throw Error("The argument must be a React element, but you passed "+D+".");var se=E({},D.props),te=D.key;if(L!=null)for(ie in L.key!==void 0&&(te=""+L.key),L)!P.call(L,ie)||ie==="key"||ie==="__self"||ie==="__source"||ie==="ref"&&L.ref===void 0||(se[ie]=L[ie]);var ie=arguments.length-2;if(ie===1)se.children=A;else if(1<ie){for(var Se=Array(ie),je=0;je<ie;je++)Se[je]=arguments[je+2];se.children=Se}return X(D.type,te,se)},Ye.createContext=function(D){return D={$$typeof:u,_currentValue:D,_currentValue2:D,_threadCount:0,Provider:null,Consumer:null},D.Provider=D,D.Consumer={$$typeof:o,_context:D},D},Ye.createElement=function(D,L,A){var se,te={},ie=null;if(L!=null)for(se in L.key!==void 0&&(ie=""+L.key),L)P.call(L,se)&&se!=="key"&&se!=="__self"&&se!=="__source"&&(te[se]=L[se]);var Se=arguments.length-2;if(Se===1)te.children=A;else if(1<Se){for(var je=Array(Se),Ae=0;Ae<Se;Ae++)je[Ae]=arguments[Ae+2];te.children=je}if(D&&D.defaultProps)for(se in Se=D.defaultProps,Se)te[se]===void 0&&(te[se]=Se[se]);return X(D,ie,te)},Ye.createRef=function(){return{current:null}},Ye.forwardRef=function(D){return{$$typeof:f,render:D}},Ye.isValidElement=q,Ye.lazy=function(D){return{$$typeof:x,_payload:{_status:-1,_result:D},_init:le}},Ye.memo=function(D,L){return{$$typeof:p,type:D,compare:L===void 0?null:L}},Ye.startTransition=function(D){var L=z.T,A={};z.T=A;try{var se=D(),te=z.S;te!==null&&te(A,se),typeof se=="object"&&se!==null&&typeof se.then=="function"&&se.then(_,be)}catch(ie){be(ie)}finally{L!==null&&A.types!==null&&(L.types=A.types),z.T=L}},Ye.unstable_useCacheRefresh=function(){return z.H.useCacheRefresh()},Ye.use=function(D){return z.H.use(D)},Ye.useActionState=function(D,L,A){return z.H.useActionState(D,L,A)},Ye.useCallback=function(D,L){return z.H.useCallback(D,L)},Ye.useContext=function(D){return z.H.useContext(D)},Ye.useDebugValue=function(){},Ye.useDeferredValue=function(D,L){return z.H.useDeferredValue(D,L)},Ye.useEffect=function(D,L){return z.H.useEffect(D,L)},Ye.useEffectEvent=function(D){return z.H.useEffectEvent(D)},Ye.useId=function(){return z.H.useId()},Ye.useImperativeHandle=function(D,L,A){return z.H.useImperativeHandle(D,L,A)},Ye.useInsertionEffect=function(D,L){return z.H.useInsertionEffect(D,L)},Ye.useLayoutEffect=function(D,L){return z.H.useLayoutEffect(D,L)},Ye.useMemo=function(D,L){return z.H.useMemo(D,L)},Ye.useOptimistic=function(D,L){return z.H.useOptimistic(D,L)},Ye.useReducer=function(D,L,A){return z.H.useReducer(D,L,A)},Ye.useRef=function(D){return z.H.useRef(D)},Ye.useState=function(D){return z.H.useState(D)},Ye.useSyncExternalStore=function(D,L,A){return z.H.useSyncExternalStore(D,L,A)},Ye.useTransition=function(){return z.H.useTransition()},Ye.version="19.2.4",Ye}var Wb;function yp(){return Wb||(Wb=1,$d.exports=QE()),$d.exports}var w=yp();const WE=so(w),vp=XE({__proto__:null,default:WE},[w]);var Hd={exports:{}},As={},Pd={exports:{}},Fd={};var Jb;function JE(){return Jb||(Jb=1,(function(e){function n(M,K){var le=M.length;M.push(K);e:for(;0<le;){var be=le-1>>>1,O=M[be];if(0<s(O,K))M[be]=K,M[le]=O,le=be;else break e}}function r(M){return M.length===0?null:M[0]}function l(M){if(M.length===0)return null;var K=M[0],le=M.pop();if(le!==K){M[0]=le;e:for(var be=0,O=M.length,D=O>>>1;be<D;){var L=2*(be+1)-1,A=M[L],se=L+1,te=M[se];if(0>s(A,le))se<O&&0>s(te,A)?(M[be]=te,M[se]=le,be=se):(M[be]=A,M[L]=le,be=L);else if(se<O&&0>s(te,le))M[be]=te,M[se]=le,be=se;else break e}}return K}function s(M,K){var le=M.sortIndex-K.sortIndex;return le!==0?le:M.id-K.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var u=Date,f=u.now();e.unstable_now=function(){return u.now()-f}}var d=[],p=[],x=1,g=null,y=3,v=!1,S=!1,E=!1,T=!1,N=typeof setTimeout=="function"?setTimeout:null,j=typeof clearTimeout=="function"?clearTimeout:null,C=typeof setImmediate<"u"?setImmediate:null;function I(M){for(var K=r(p);K!==null;){if(K.callback===null)l(p);else if(K.startTime<=M)l(p),K.sortIndex=K.expirationTime,n(d,K);else break;K=r(p)}}function U(M){if(E=!1,I(M),!S)if(r(d)!==null)S=!0,_||(_=!0,Z());else{var K=r(p);K!==null&&Y(U,K.startTime-M)}}var _=!1,z=-1,P=5,X=-1;function B(){return T?!0:!(e.unstable_now()-X<P)}function q(){if(T=!1,_){var M=e.unstable_now();X=M;var K=!0;try{e:{S=!1,E&&(E=!1,j(z),z=-1),v=!0;var le=y;try{t:{for(I(M),g=r(d);g!==null&&!(g.expirationTime>M&&B());){var be=g.callback;if(typeof be=="function"){g.callback=null,y=g.priorityLevel;var O=be(g.expirationTime<=M);if(M=e.unstable_now(),typeof O=="function"){g.callback=O,I(M),K=!0;break t}g===r(d)&&l(d),I(M)}else l(d);g=r(d)}if(g!==null)K=!0;else{var D=r(p);D!==null&&Y(U,D.startTime-M),K=!1}}break e}finally{g=null,y=le,v=!1}K=void 0}}finally{K?Z():_=!1}}}var Z;if(typeof C=="function")Z=function(){C(q)};else if(typeof MessageChannel<"u"){var ee=new MessageChannel,ae=ee.port2;ee.port1.onmessage=q,Z=function(){ae.postMessage(null)}}else Z=function(){N(q,0)};function Y(M,K){z=N(function(){M(e.unstable_now())},K)}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(M){M.callback=null},e.unstable_forceFrameRate=function(M){0>M||125<M?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):P=0<M?Math.floor(1e3/M):5},e.unstable_getCurrentPriorityLevel=function(){return y},e.unstable_next=function(M){switch(y){case 1:case 2:case 3:var K=3;break;default:K=y}var le=y;y=K;try{return M()}finally{y=le}},e.unstable_requestPaint=function(){T=!0},e.unstable_runWithPriority=function(M,K){switch(M){case 1:case 2:case 3:case 4:case 5:break;default:M=3}var le=y;y=M;try{return K()}finally{y=le}},e.unstable_scheduleCallback=function(M,K,le){var be=e.unstable_now();switch(typeof le=="object"&&le!==null?(le=le.delay,le=typeof le=="number"&&0<le?be+le:be):le=be,M){case 1:var O=-1;break;case 2:O=250;break;case 5:O=1073741823;break;case 4:O=1e4;break;default:O=5e3}return O=le+O,M={id:x++,callback:K,priorityLevel:M,startTime:le,expirationTime:O,sortIndex:-1},le>be?(M.sortIndex=le,n(p,M),r(d)===null&&M===r(p)&&(E?(j(z),z=-1):E=!0,Y(U,le-be))):(M.sortIndex=O,n(d,M),S||v||(S=!0,_||(_=!0,Z()))),M},e.unstable_shouldYield=B,e.unstable_wrapCallback=function(M){var K=y;return function(){var le=y;y=K;try{return M.apply(this,arguments)}finally{y=le}}}})(Fd)),Fd}var ey;function e2(){return ey||(ey=1,Pd.exports=JE()),Pd.exports}var Gd={exports:{}},Rn={};var ty;function t2(){if(ty)return Rn;ty=1;var e=yp();function n(d){var p="https://react.dev/errors/"+d;if(1<arguments.length){p+="?args[]="+encodeURIComponent(arguments[1]);for(var x=2;x<arguments.length;x++)p+="&args[]="+encodeURIComponent(arguments[x])}return"Minified React error #"+d+"; visit "+p+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(){}var l={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},s=Symbol.for("react.portal");function o(d,p,x){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:s,key:g==null?null:""+g,children:d,containerInfo:p,implementation:x}}var u=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function f(d,p){if(d==="font")return"";if(typeof p=="string")return p==="use-credentials"?p:""}return Rn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=l,Rn.createPortal=function(d,p){var x=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!p||p.nodeType!==1&&p.nodeType!==9&&p.nodeType!==11)throw Error(n(299));return o(d,p,null,x)},Rn.flushSync=function(d){var p=u.T,x=l.p;try{if(u.T=null,l.p=2,d)return d()}finally{u.T=p,l.p=x,l.d.f()}},Rn.preconnect=function(d,p){typeof d=="string"&&(p?(p=p.crossOrigin,p=typeof p=="string"?p==="use-credentials"?p:"":void 0):p=null,l.d.C(d,p))},Rn.prefetchDNS=function(d){typeof d=="string"&&l.d.D(d)},Rn.preinit=function(d,p){if(typeof d=="string"&&p&&typeof p.as=="string"){var x=p.as,g=f(x,p.crossOrigin),y=typeof p.integrity=="string"?p.integrity:void 0,v=typeof p.fetchPriority=="string"?p.fetchPriority:void 0;x==="style"?l.d.S(d,typeof p.precedence=="string"?p.precedence:void 0,{crossOrigin:g,integrity:y,fetchPriority:v}):x==="script"&&l.d.X(d,{crossOrigin:g,integrity:y,fetchPriority:v,nonce:typeof p.nonce=="string"?p.nonce:void 0})}},Rn.preinitModule=function(d,p){if(typeof d=="string")if(typeof p=="object"&&p!==null){if(p.as==null||p.as==="script"){var x=f(p.as,p.crossOrigin);l.d.M(d,{crossOrigin:x,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0})}}else p==null&&l.d.M(d)},Rn.preload=function(d,p){if(typeof d=="string"&&typeof p=="object"&&p!==null&&typeof p.as=="string"){var x=p.as,g=f(x,p.crossOrigin);l.d.L(d,x,{crossOrigin:g,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0,type:typeof p.type=="string"?p.type:void 0,fetchPriority:typeof p.fetchPriority=="string"?p.fetchPriority:void 0,referrerPolicy:typeof p.referrerPolicy=="string"?p.referrerPolicy:void 0,imageSrcSet:typeof p.imageSrcSet=="string"?p.imageSrcSet:void 0,imageSizes:typeof p.imageSizes=="string"?p.imageSizes:void 0,media:typeof p.media=="string"?p.media:void 0})}},Rn.preloadModule=function(d,p){if(typeof d=="string")if(p){var x=f(p.as,p.crossOrigin);l.d.m(d,{as:typeof p.as=="string"&&p.as!=="script"?p.as:void 0,crossOrigin:x,integrity:typeof p.integrity=="string"?p.integrity:void 0})}else l.d.m(d)},Rn.requestFormReset=function(d){l.d.r(d)},Rn.unstable_batchedUpdates=function(d,p){return d(p)},Rn.useFormState=function(d,p,x){return u.H.useFormState(d,p,x)},Rn.useFormStatus=function(){return u.H.useHostTransitionStatus()},Rn.version="19.2.4",Rn}var ny;function A0(){if(ny)return Gd.exports;ny=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(n){console.error(n)}}return e(),Gd.exports=t2(),Gd.exports}var ry;function n2(){if(ry)return As;ry=1;var e=e2(),n=yp(),r=A0();function l(t){var a="https://react.dev/errors/"+t;if(1<arguments.length){a+="?args[]="+encodeURIComponent(arguments[1]);for(var i=2;i<arguments.length;i++)a+="&args[]="+encodeURIComponent(arguments[i])}return"Minified React error #"+t+"; visit "+a+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function o(t){var a=t,i=t;if(t.alternate)for(;a.return;)a=a.return;else{t=a;do a=t,(a.flags&4098)!==0&&(i=a.return),t=a.return;while(t)}return a.tag===3?i:null}function u(t){if(t.tag===13){var a=t.memoizedState;if(a===null&&(t=t.alternate,t!==null&&(a=t.memoizedState)),a!==null)return a.dehydrated}return null}function f(t){if(t.tag===31){var a=t.memoizedState;if(a===null&&(t=t.alternate,t!==null&&(a=t.memoizedState)),a!==null)return a.dehydrated}return null}function d(t){if(o(t)!==t)throw Error(l(188))}function p(t){var a=t.alternate;if(!a){if(a=o(t),a===null)throw Error(l(188));return a!==t?null:t}for(var i=t,c=a;;){var m=i.return;if(m===null)break;var b=m.alternate;if(b===null){if(c=m.return,c!==null){i=c;continue}break}if(m.child===b.child){for(b=m.child;b;){if(b===i)return d(m),t;if(b===c)return d(m),a;b=b.sibling}throw Error(l(188))}if(i.return!==c.return)i=m,c=b;else{for(var k=!1,R=m.child;R;){if(R===i){k=!0,i=m,c=b;break}if(R===c){k=!0,c=m,i=b;break}R=R.sibling}if(!k){for(R=b.child;R;){if(R===i){k=!0,i=b,c=m;break}if(R===c){k=!0,c=b,i=m;break}R=R.sibling}if(!k)throw Error(l(189))}}if(i.alternate!==c)throw Error(l(190))}if(i.tag!==3)throw Error(l(188));return i.stateNode.current===i?t:a}function x(t){var a=t.tag;if(a===5||a===26||a===27||a===6)return t;for(t=t.child;t!==null;){if(a=x(t),a!==null)return a;t=t.sibling}return null}var g=Object.assign,y=Symbol.for("react.element"),v=Symbol.for("react.transitional.element"),S=Symbol.for("react.portal"),E=Symbol.for("react.fragment"),T=Symbol.for("react.strict_mode"),N=Symbol.for("react.profiler"),j=Symbol.for("react.consumer"),C=Symbol.for("react.context"),I=Symbol.for("react.forward_ref"),U=Symbol.for("react.suspense"),_=Symbol.for("react.suspense_list"),z=Symbol.for("react.memo"),P=Symbol.for("react.lazy"),X=Symbol.for("react.activity"),B=Symbol.for("react.memo_cache_sentinel"),q=Symbol.iterator;function Z(t){return t===null||typeof t!="object"?null:(t=q&&t[q]||t["@@iterator"],typeof t=="function"?t:null)}var ee=Symbol.for("react.client.reference");function ae(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===ee?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case E:return"Fragment";case N:return"Profiler";case T:return"StrictMode";case U:return"Suspense";case _:return"SuspenseList";case X:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case S:return"Portal";case C:return t.displayName||"Context";case j:return(t._context.displayName||"Context")+".Consumer";case I:var a=t.render;return t=t.displayName,t||(t=a.displayName||a.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case z:return a=t.displayName||null,a!==null?a:ae(t.type)||"Memo";case P:a=t._payload,t=t._init;try{return ae(t(a))}catch{}}return null}var Y=Array.isArray,M=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,K=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,le={pending:!1,data:null,method:null,action:null},be=[],O=-1;function D(t){return{current:t}}function L(t){0>O||(t.current=be[O],be[O]=null,O--)}function A(t,a){O++,be[O]=t.current,t.current=a}var se=D(null),te=D(null),ie=D(null),Se=D(null);function je(t,a){switch(A(ie,a),A(te,t),A(se,null),a.nodeType){case 9:case 11:t=(t=a.documentElement)&&(t=t.namespaceURI)?bb(t):0;break;default:if(t=a.tagName,a=a.namespaceURI)a=bb(a),t=yb(a,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}L(se),A(se,t)}function Ae(){L(se),L(te),L(ie)}function qe(t){t.memoizedState!==null&&A(Se,t);var a=se.current,i=yb(a,t.type);a!==i&&(A(te,t),A(se,i))}function we(t){te.current===t&&(L(se),L(te)),Se.current===t&&(L(Se),Ss._currentValue=le)}var Ve,Lt;function he(t){if(Ve===void 0)try{throw Error()}catch(i){var a=i.stack.trim().match(/\n( *(at )?)/);Ve=a&&a[1]||"",Lt=-1<i.stack.indexOf(`
|
|
2
|
+
at`)?" (<anonymous>)":-1<i.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
+
`+Ve+t+Lt}var xe=!1;function _e(t,a){if(!t||xe)return"";xe=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var c={DetermineComponentFrameRoot:function(){try{if(a){var fe=function(){throw Error()};if(Object.defineProperty(fe.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(fe,[])}catch(ne){var J=ne}Reflect.construct(t,[],fe)}else{try{fe.call()}catch(ne){J=ne}t.call(fe.prototype)}}else{try{throw Error()}catch(ne){J=ne}(fe=t())&&typeof fe.catch=="function"&&fe.catch(function(){})}}catch(ne){if(ne&&J&&typeof ne.stack=="string")return[ne.stack,J.stack]}return[null,null]}};c.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var m=Object.getOwnPropertyDescriptor(c.DetermineComponentFrameRoot,"name");m&&m.configurable&&Object.defineProperty(c.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var b=c.DetermineComponentFrameRoot(),k=b[0],R=b[1];if(k&&R){var $=k.split(`
|
|
4
|
+
`),W=R.split(`
|
|
5
|
+
`);for(m=c=0;c<$.length&&!$[c].includes("DetermineComponentFrameRoot");)c++;for(;m<W.length&&!W[m].includes("DetermineComponentFrameRoot");)m++;if(c===$.length||m===W.length)for(c=$.length-1,m=W.length-1;1<=c&&0<=m&&$[c]!==W[m];)m--;for(;1<=c&&0<=m;c--,m--)if($[c]!==W[m]){if(c!==1||m!==1)do if(c--,m--,0>m||$[c]!==W[m]){var oe=`
|
|
6
|
+
`+$[c].replace(" at new "," at ");return t.displayName&&oe.includes("<anonymous>")&&(oe=oe.replace("<anonymous>",t.displayName)),oe}while(1<=c&&0<=m);break}}}finally{xe=!1,Error.prepareStackTrace=i}return(i=t?t.displayName||t.name:"")?he(i):""}function et(t,a){switch(t.tag){case 26:case 27:case 5:return he(t.type);case 16:return he("Lazy");case 13:return t.child!==a&&a!==null?he("Suspense Fallback"):he("Suspense");case 19:return he("SuspenseList");case 0:case 15:return _e(t.type,!1);case 11:return _e(t.type.render,!1);case 1:return _e(t.type,!0);case 31:return he("Activity");default:return""}}function St(t){try{var a="",i=null;do a+=et(t,i),i=t,t=t.return;while(t);return a}catch(c){return`
|
|
7
|
+
Error generating stack: `+c.message+`
|
|
8
|
+
`+c.stack}}var xn=Object.prototype.hasOwnProperty,Ot=e.unstable_scheduleCallback,pr=e.unstable_cancelCallback,On=e.unstable_shouldYield,Dn=e.unstable_requestPaint,Et=e.unstable_now,bn=e.unstable_getCurrentPriorityLevel,re=e.unstable_ImmediatePriority,me=e.unstable_UserBlockingPriority,Me=e.unstable_NormalPriority,Ge=e.unstable_LowPriority,nt=e.unstable_IdlePriority,Jt=e.log,_n=e.unstable_setDisableYieldValue,qt=null,mt=null;function Ct(t){if(typeof Jt=="function"&&_n(t),mt&&typeof mt.setStrictMode=="function")try{mt.setStrictMode(qt,t)}catch{}}var Fe=Math.clz32?Math.clz32:Na,pn=Math.log,Xt=Math.LN2;function Na(t){return t>>>=0,t===0?32:31-(pn(t)/Xt|0)|0}var zn=256,er=262144,Ar=4194304;function Kt(t){var a=t&42;if(a!==0)return a;switch(t&-t){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 t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function H(t,a,i){var c=t.pendingLanes;if(c===0)return 0;var m=0,b=t.suspendedLanes,k=t.pingedLanes;t=t.warmLanes;var R=c&134217727;return R!==0?(c=R&~b,c!==0?m=Kt(c):(k&=R,k!==0?m=Kt(k):i||(i=R&~t,i!==0&&(m=Kt(i))))):(R=c&~b,R!==0?m=Kt(R):k!==0?m=Kt(k):i||(i=c&~t,i!==0&&(m=Kt(i)))),m===0?0:a!==0&&a!==m&&(a&b)===0&&(b=m&-m,i=a&-a,b>=i||b===32&&(i&4194048)!==0)?a:m}function ue(t,a){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&a)===0}function pe(t,a){switch(t){case 1:case 2:case 4:case 8:case 64:return a+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 a+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 Le(){var t=Ar;return Ar<<=1,(Ar&62914560)===0&&(Ar=4194304),t}function vt(t){for(var a=[],i=0;31>i;i++)a.push(t);return a}function ft(t,a){t.pendingLanes|=a,a!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function Ce(t,a,i,c,m,b){var k=t.pendingLanes;t.pendingLanes=i,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=i,t.entangledLanes&=i,t.errorRecoveryDisabledLanes&=i,t.shellSuspendCounter=0;var R=t.entanglements,$=t.expirationTimes,W=t.hiddenUpdates;for(i=k&~i;0<i;){var oe=31-Fe(i),fe=1<<oe;R[oe]=0,$[oe]=-1;var J=W[oe];if(J!==null)for(W[oe]=null,oe=0;oe<J.length;oe++){var ne=J[oe];ne!==null&&(ne.lane&=-536870913)}i&=~fe}c!==0&&Ee(t,c,0),b!==0&&m===0&&t.tag!==0&&(t.suspendedLanes|=b&~(k&~a))}function Ee(t,a,i){t.pendingLanes|=a,t.suspendedLanes&=~a;var c=31-Fe(a);t.entangledLanes|=a,t.entanglements[c]=t.entanglements[c]|1073741824|i&261930}function Ie(t,a){var i=t.entangledLanes|=a;for(t=t.entanglements;i;){var c=31-Fe(i),m=1<<c;m&a|t[c]&a&&(t[c]|=a),i&=~m}}function $t(t,a){var i=a&-a;return i=(i&42)!==0?1:rt(i),(i&(t.suspendedLanes|a))!==0?0:i}function rt(t){switch(t){case 2:t=1;break;case 8:t=4;break;case 32:t=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:t=128;break;case 268435456:t=134217728;break;default:t=0}return t}function fn(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function Cr(){var t=K.p;return t!==0?t:(t=window.event,t===void 0?32:Pb(t.type))}function Hr(t,a){var i=K.p;try{return K.p=t,a()}finally{K.p=i}}var Tn=Math.random().toString(36).slice(2),Bt="__reactFiber$"+Tn,ve="__reactProps$"+Tn,wt="__reactContainer$"+Tn,mr="__reactEvents$"+Tn,il="__reactListeners$"+Tn,ea="__reactHandles$"+Tn,Ll="__reactResources$"+Tn,Oe="__reactMarker$"+Tn;function F(t){delete t[Bt],delete t[ve],delete t[mr],delete t[il],delete t[ea]}function de(t){var a=t[Bt];if(a)return a;for(var i=t.parentNode;i;){if(a=i[wt]||i[Bt]){if(i=a.alternate,a.child!==null||i!==null&&i.child!==null)for(t=_b(t);t!==null;){if(i=t[Bt])return i;t=_b(t)}return a}t=i,i=t.parentNode}return null}function Te(t){if(t=t[Bt]||t[wt]){var a=t.tag;if(a===5||a===6||a===13||a===31||a===26||a===27||a===3)return t}return null}function pt(t){var a=t.tag;if(a===5||a===26||a===27||a===6)return t.stateNode;throw Error(l(33))}function Ht(t){var a=t[Ll];return a||(a=t[Ll]={hoistableStyles:new Map,hoistableScripts:new Map}),a}function Ze(t){t[Oe]=!0}var dn=new Set,yn={};function An(t,a){ge(t,a),ge(t+"Capture",a)}function ge(t,a){for(yn[t]=a,t=0;t<a.length;t++)dn.add(a[t])}var Ne=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]*$"),Qe={},gt={};function en(t){return xn.call(gt,t)?!0:xn.call(Qe,t)?!1:Ne.test(t)?gt[t]=!0:(Qe[t]=!0,!1)}function Cn(t,a,i){if(en(a))if(i===null)t.removeAttribute(a);else{switch(typeof i){case"undefined":case"function":case"symbol":t.removeAttribute(a);return;case"boolean":var c=a.toLowerCase().slice(0,5);if(c!=="data-"&&c!=="aria-"){t.removeAttribute(a);return}}t.setAttribute(a,""+i)}}function tr(t,a,i){if(i===null)t.removeAttribute(a);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(a);return}t.setAttribute(a,""+i)}}function Pn(t,a,i,c){if(c===null)t.removeAttribute(i);else{switch(typeof c){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(i);return}t.setAttributeNS(a,i,""+c)}}function It(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function nr(t){var a=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(a==="checkbox"||a==="radio")}function bo(t,a,i){var c=Object.getOwnPropertyDescriptor(t.constructor.prototype,a);if(!t.hasOwnProperty(a)&&typeof c<"u"&&typeof c.get=="function"&&typeof c.set=="function"){var m=c.get,b=c.set;return Object.defineProperty(t,a,{configurable:!0,get:function(){return m.call(this)},set:function(k){i=""+k,b.call(this,k)}}),Object.defineProperty(t,a,{enumerable:c.enumerable}),{getValue:function(){return i},setValue:function(k){i=""+k},stopTracking:function(){t._valueTracker=null,delete t[a]}}}}function Bl(t){if(!t._valueTracker){var a=nr(t)?"checked":"value";t._valueTracker=bo(t,a,""+t[a])}}function Li(t){if(!t)return!1;var a=t._valueTracker;if(!a)return!0;var i=a.getValue(),c="";return t&&(c=nr(t)?t.checked?"true":"false":t.value),t=c,t!==i?(a.setValue(t),!0):!1}function Il(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var Bc=/[\n"\\]/g;function Fn(t){return t.replace(Bc,function(a){return"\\"+a.charCodeAt(0).toString(16)+" "})}function Bi(t,a,i,c,m,b,k,R){t.name="",k!=null&&typeof k!="function"&&typeof k!="symbol"&&typeof k!="boolean"?t.type=k:t.removeAttribute("type"),a!=null?k==="number"?(a===0&&t.value===""||t.value!=a)&&(t.value=""+It(a)):t.value!==""+It(a)&&(t.value=""+It(a)):k!=="submit"&&k!=="reset"||t.removeAttribute("value"),a!=null?Ul(t,k,It(a)):i!=null?Ul(t,k,It(i)):c!=null&&t.removeAttribute("value"),m==null&&b!=null&&(t.defaultChecked=!!b),m!=null&&(t.checked=m&&typeof m!="function"&&typeof m!="symbol"),R!=null&&typeof R!="function"&&typeof R!="symbol"&&typeof R!="boolean"?t.name=""+It(R):t.removeAttribute("name")}function sl(t,a,i,c,m,b,k,R){if(b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"&&(t.type=b),a!=null||i!=null){if(!(b!=="submit"&&b!=="reset"||a!=null)){Bl(t);return}i=i!=null?""+It(i):"",a=a!=null?""+It(a):i,R||a===t.value||(t.value=a),t.defaultValue=a}c=c??m,c=typeof c!="function"&&typeof c!="symbol"&&!!c,t.checked=R?t.checked:!!c,t.defaultChecked=!!c,k!=null&&typeof k!="function"&&typeof k!="symbol"&&typeof k!="boolean"&&(t.name=k),Bl(t)}function Ul(t,a,i){a==="number"&&Il(t.ownerDocument)===t||t.defaultValue===""+i||(t.defaultValue=""+i)}function vn(t,a,i,c){if(t=t.options,a){a={};for(var m=0;m<i.length;m++)a["$"+i[m]]=!0;for(i=0;i<t.length;i++)m=a.hasOwnProperty("$"+t[i].value),t[i].selected!==m&&(t[i].selected=m),m&&c&&(t[i].defaultSelected=!0)}else{for(i=""+It(i),a=null,m=0;m<t.length;m++){if(t[m].value===i){t[m].selected=!0,c&&(t[m].defaultSelected=!0);return}a!==null||t[m].disabled||(a=t[m])}a!==null&&(a.selected=!0)}}function yo(t,a,i){if(a!=null&&(a=""+It(a),a!==t.value&&(t.value=a),i==null)){t.defaultValue!==a&&(t.defaultValue=a);return}t.defaultValue=i!=null?""+It(i):""}function $l(t,a,i,c){if(a==null){if(c!=null){if(i!=null)throw Error(l(92));if(Y(c)){if(1<c.length)throw Error(l(93));c=c[0]}i=c}i==null&&(i=""),a=i}i=It(a),t.defaultValue=i,c=t.textContent,c===i&&c!==""&&c!==null&&(t.value=c),Bl(t)}function Pe(t,a){if(a){var i=t.firstChild;if(i&&i===t.lastChild&&i.nodeType===3){i.nodeValue=a;return}}t.textContent=a}var vo=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 an(t,a,i){var c=a.indexOf("--")===0;i==null||typeof i=="boolean"||i===""?c?t.setProperty(a,""):a==="float"?t.cssFloat="":t[a]="":c?t.setProperty(a,i):typeof i!="number"||i===0||vo.has(a)?a==="float"?t.cssFloat=i:t[a]=(""+i).trim():t[a]=i+"px"}function Nt(t,a,i){if(a!=null&&typeof a!="object")throw Error(l(62));if(t=t.style,i!=null){for(var c in i)!i.hasOwnProperty(c)||a!=null&&a.hasOwnProperty(c)||(c.indexOf("--")===0?t.setProperty(c,""):c==="float"?t.cssFloat="":t[c]="");for(var m in a)c=a[m],a.hasOwnProperty(m)&&i[m]!==c&&an(t,m,c)}else for(var b in a)a.hasOwnProperty(b)&&an(t,b,a[b])}function _a(t){if(t.indexOf("-")===-1)return!1;switch(t){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 ta=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"]]),Ii=/^[\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 Ta(t){return Ii.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function ke(){}var De=null;function Xe(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var st=null,Vt=null;function gr(t){var a=Te(t);if(a&&(t=a.stateNode)){var i=t[ve]||null;e:switch(t=a.stateNode,a.type){case"input":if(Bi(t,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name),a=i.name,i.type==="radio"&&a!=null){for(i=t;i.parentNode;)i=i.parentNode;for(i=i.querySelectorAll('input[name="'+Fn(""+a)+'"][type="radio"]'),a=0;a<i.length;a++){var c=i[a];if(c!==t&&c.form===t.form){var m=c[ve]||null;if(!m)throw Error(l(90));Bi(c,m.value,m.defaultValue,m.defaultValue,m.checked,m.defaultChecked,m.type,m.name)}}for(a=0;a<i.length;a++)c=i[a],c.form===t.form&&Li(c)}break e;case"textarea":yo(t,i.value,i.defaultValue);break e;case"select":a=i.value,a!=null&&vn(t,!!i.multiple,a,!1)}}}var Ui=!1;function wo(t,a,i){if(Ui)return t(a,i);Ui=!0;try{var c=t(a);return c}finally{if(Ui=!1,(st!==null||Vt!==null)&&(ou(),st&&(a=st,t=Vt,Vt=st=null,gr(a),t)))for(a=0;a<t.length;a++)gr(t[a])}}function $i(t,a){var i=t.stateNode;if(i===null)return null;var c=i[ve]||null;if(c===null)return null;i=c[a];e:switch(a){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(c=!c.disabled)||(t=t.type,c=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!c;break e;default:t=!1}if(t)return null;if(i&&typeof i!="function")throw Error(l(231,a,typeof i));return i}var na=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ic=!1;if(na)try{var Hi={};Object.defineProperty(Hi,"passive",{get:function(){Ic=!0}}),window.addEventListener("test",Hi,Hi),window.removeEventListener("test",Hi,Hi)}catch{Ic=!1}var Aa=null,Uc=null,ko=null;function ym(){if(ko)return ko;var t,a=Uc,i=a.length,c,m="value"in Aa?Aa.value:Aa.textContent,b=m.length;for(t=0;t<i&&a[t]===m[t];t++);var k=i-t;for(c=1;c<=k&&a[i-c]===m[b-c];c++);return ko=m.slice(t,1<c?1-c:void 0)}function So(t){var a=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&a===13&&(t=13)):t=a,t===10&&(t=13),32<=t||t===13?t:0}function Eo(){return!0}function vm(){return!1}function Gn(t){function a(i,c,m,b,k){this._reactName=i,this._targetInst=m,this.type=c,this.nativeEvent=b,this.target=k,this.currentTarget=null;for(var R in t)t.hasOwnProperty(R)&&(i=t[R],this[R]=i?i(b):b[R]);return this.isDefaultPrevented=(b.defaultPrevented!=null?b.defaultPrevented:b.returnValue===!1)?Eo:vm,this.isPropagationStopped=vm,this}return g(a.prototype,{preventDefault:function(){this.defaultPrevented=!0;var i=this.nativeEvent;i&&(i.preventDefault?i.preventDefault():typeof i.returnValue!="unknown"&&(i.returnValue=!1),this.isDefaultPrevented=Eo)},stopPropagation:function(){var i=this.nativeEvent;i&&(i.stopPropagation?i.stopPropagation():typeof i.cancelBubble!="unknown"&&(i.cancelBubble=!0),this.isPropagationStopped=Eo)},persist:function(){},isPersistent:Eo}),a}var ol={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},No=Gn(ol),Pi=g({},ol,{view:0,detail:0}),Yk=Gn(Pi),$c,Hc,Fi,_o=g({},Pi,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Fc,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==Fi&&(Fi&&t.type==="mousemove"?($c=t.screenX-Fi.screenX,Hc=t.screenY-Fi.screenY):Hc=$c=0,Fi=t),$c)},movementY:function(t){return"movementY"in t?t.movementY:Hc}}),wm=Gn(_o),Vk=g({},_o,{dataTransfer:0}),Xk=Gn(Vk),Kk=g({},Pi,{relatedTarget:0}),Pc=Gn(Kk),Zk=g({},ol,{animationName:0,elapsedTime:0,pseudoElement:0}),Qk=Gn(Zk),Wk=g({},ol,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),Jk=Gn(Wk),eS=g({},ol,{data:0}),km=Gn(eS),tS={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},nS={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"},rS={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function aS(t){var a=this.nativeEvent;return a.getModifierState?a.getModifierState(t):(t=rS[t])?!!a[t]:!1}function Fc(){return aS}var lS=g({},Pi,{key:function(t){if(t.key){var a=tS[t.key]||t.key;if(a!=="Unidentified")return a}return t.type==="keypress"?(t=So(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?nS[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Fc,charCode:function(t){return t.type==="keypress"?So(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?So(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),iS=Gn(lS),sS=g({},_o,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Sm=Gn(sS),oS=g({},Pi,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Fc}),uS=Gn(oS),cS=g({},ol,{propertyName:0,elapsedTime:0,pseudoElement:0}),fS=Gn(cS),dS=g({},_o,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),hS=Gn(dS),pS=g({},ol,{newState:0,oldState:0}),mS=Gn(pS),gS=[9,13,27,32],Gc=na&&"CompositionEvent"in window,Gi=null;na&&"documentMode"in document&&(Gi=document.documentMode);var xS=na&&"TextEvent"in window&&!Gi,Em=na&&(!Gc||Gi&&8<Gi&&11>=Gi),Nm=" ",_m=!1;function Tm(t,a){switch(t){case"keyup":return gS.indexOf(a.keyCode)!==-1;case"keydown":return a.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Am(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Hl=!1;function bS(t,a){switch(t){case"compositionend":return Am(a);case"keypress":return a.which!==32?null:(_m=!0,Nm);case"textInput":return t=a.data,t===Nm&&_m?null:t;default:return null}}function yS(t,a){if(Hl)return t==="compositionend"||!Gc&&Tm(t,a)?(t=ym(),ko=Uc=Aa=null,Hl=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(a.ctrlKey||a.altKey||a.metaKey)||a.ctrlKey&&a.altKey){if(a.char&&1<a.char.length)return a.char;if(a.which)return String.fromCharCode(a.which)}return null;case"compositionend":return Em&&a.locale!=="ko"?null:a.data;default:return null}}var vS={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 Cm(t){var a=t&&t.nodeName&&t.nodeName.toLowerCase();return a==="input"?!!vS[t.type]:a==="textarea"}function Rm(t,a,i,c){st?Vt?Vt.push(c):Vt=[c]:st=c,a=mu(a,"onChange"),0<a.length&&(i=new No("onChange","change",null,i,c),t.push({event:i,listeners:a}))}var qi=null,Yi=null;function wS(t){db(t,0)}function To(t){var a=pt(t);if(Li(a))return t}function jm(t,a){if(t==="change")return a}var Mm=!1;if(na){var qc;if(na){var Yc="oninput"in document;if(!Yc){var Om=document.createElement("div");Om.setAttribute("oninput","return;"),Yc=typeof Om.oninput=="function"}qc=Yc}else qc=!1;Mm=qc&&(!document.documentMode||9<document.documentMode)}function Dm(){qi&&(qi.detachEvent("onpropertychange",zm),Yi=qi=null)}function zm(t){if(t.propertyName==="value"&&To(Yi)){var a=[];Rm(a,Yi,t,Xe(t)),wo(wS,a)}}function kS(t,a,i){t==="focusin"?(Dm(),qi=a,Yi=i,qi.attachEvent("onpropertychange",zm)):t==="focusout"&&Dm()}function SS(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return To(Yi)}function ES(t,a){if(t==="click")return To(a)}function NS(t,a){if(t==="input"||t==="change")return To(a)}function _S(t,a){return t===a&&(t!==0||1/t===1/a)||t!==t&&a!==a}var rr=typeof Object.is=="function"?Object.is:_S;function Vi(t,a){if(rr(t,a))return!0;if(typeof t!="object"||t===null||typeof a!="object"||a===null)return!1;var i=Object.keys(t),c=Object.keys(a);if(i.length!==c.length)return!1;for(c=0;c<i.length;c++){var m=i[c];if(!xn.call(a,m)||!rr(t[m],a[m]))return!1}return!0}function Lm(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function Bm(t,a){var i=Lm(t);t=0;for(var c;i;){if(i.nodeType===3){if(c=t+i.textContent.length,t<=a&&c>=a)return{node:i,offset:a-t};t=c}e:{for(;i;){if(i.nextSibling){i=i.nextSibling;break e}i=i.parentNode}i=void 0}i=Lm(i)}}function Im(t,a){return t&&a?t===a?!0:t&&t.nodeType===3?!1:a&&a.nodeType===3?Im(t,a.parentNode):"contains"in t?t.contains(a):t.compareDocumentPosition?!!(t.compareDocumentPosition(a)&16):!1:!1}function Um(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var a=Il(t.document);a instanceof t.HTMLIFrameElement;){try{var i=typeof a.contentWindow.location.href=="string"}catch{i=!1}if(i)t=a.contentWindow;else break;a=Il(t.document)}return a}function Vc(t){var a=t&&t.nodeName&&t.nodeName.toLowerCase();return a&&(a==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||a==="textarea"||t.contentEditable==="true")}var TS=na&&"documentMode"in document&&11>=document.documentMode,Pl=null,Xc=null,Xi=null,Kc=!1;function $m(t,a,i){var c=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;Kc||Pl==null||Pl!==Il(c)||(c=Pl,"selectionStart"in c&&Vc(c)?c={start:c.selectionStart,end:c.selectionEnd}:(c=(c.ownerDocument&&c.ownerDocument.defaultView||window).getSelection(),c={anchorNode:c.anchorNode,anchorOffset:c.anchorOffset,focusNode:c.focusNode,focusOffset:c.focusOffset}),Xi&&Vi(Xi,c)||(Xi=c,c=mu(Xc,"onSelect"),0<c.length&&(a=new No("onSelect","select",null,a,i),t.push({event:a,listeners:c}),a.target=Pl)))}function ul(t,a){var i={};return i[t.toLowerCase()]=a.toLowerCase(),i["Webkit"+t]="webkit"+a,i["Moz"+t]="moz"+a,i}var Fl={animationend:ul("Animation","AnimationEnd"),animationiteration:ul("Animation","AnimationIteration"),animationstart:ul("Animation","AnimationStart"),transitionrun:ul("Transition","TransitionRun"),transitionstart:ul("Transition","TransitionStart"),transitioncancel:ul("Transition","TransitionCancel"),transitionend:ul("Transition","TransitionEnd")},Zc={},Hm={};na&&(Hm=document.createElement("div").style,"AnimationEvent"in window||(delete Fl.animationend.animation,delete Fl.animationiteration.animation,delete Fl.animationstart.animation),"TransitionEvent"in window||delete Fl.transitionend.transition);function cl(t){if(Zc[t])return Zc[t];if(!Fl[t])return t;var a=Fl[t],i;for(i in a)if(a.hasOwnProperty(i)&&i in Hm)return Zc[t]=a[i];return t}var Pm=cl("animationend"),Fm=cl("animationiteration"),Gm=cl("animationstart"),AS=cl("transitionrun"),CS=cl("transitionstart"),RS=cl("transitioncancel"),qm=cl("transitionend"),Ym=new Map,Qc="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(" ");Qc.push("scrollEnd");function Rr(t,a){Ym.set(t,a),An(a,[t])}var Ao=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var a=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(a))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)},xr=[],Gl=0,Wc=0;function Co(){for(var t=Gl,a=Wc=Gl=0;a<t;){var i=xr[a];xr[a++]=null;var c=xr[a];xr[a++]=null;var m=xr[a];xr[a++]=null;var b=xr[a];if(xr[a++]=null,c!==null&&m!==null){var k=c.pending;k===null?m.next=m:(m.next=k.next,k.next=m),c.pending=m}b!==0&&Vm(i,m,b)}}function Ro(t,a,i,c){xr[Gl++]=t,xr[Gl++]=a,xr[Gl++]=i,xr[Gl++]=c,Wc|=c,t.lanes|=c,t=t.alternate,t!==null&&(t.lanes|=c)}function Jc(t,a,i,c){return Ro(t,a,i,c),jo(t)}function fl(t,a){return Ro(t,null,null,a),jo(t)}function Vm(t,a,i){t.lanes|=i;var c=t.alternate;c!==null&&(c.lanes|=i);for(var m=!1,b=t.return;b!==null;)b.childLanes|=i,c=b.alternate,c!==null&&(c.childLanes|=i),b.tag===22&&(t=b.stateNode,t===null||t._visibility&1||(m=!0)),t=b,b=b.return;return t.tag===3?(b=t.stateNode,m&&a!==null&&(m=31-Fe(i),t=b.hiddenUpdates,c=t[m],c===null?t[m]=[a]:c.push(a),a.lane=i|536870912),b):null}function jo(t){if(50<gs)throw gs=0,ud=null,Error(l(185));for(var a=t.return;a!==null;)t=a,a=t.return;return t.tag===3?t.stateNode:null}var ql={};function jS(t,a,i,c){this.tag=t,this.key=i,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=a,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=c,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ar(t,a,i,c){return new jS(t,a,i,c)}function ef(t){return t=t.prototype,!(!t||!t.isReactComponent)}function ra(t,a){var i=t.alternate;return i===null?(i=ar(t.tag,a,t.key,t.mode),i.elementType=t.elementType,i.type=t.type,i.stateNode=t.stateNode,i.alternate=t,t.alternate=i):(i.pendingProps=a,i.type=t.type,i.flags=0,i.subtreeFlags=0,i.deletions=null),i.flags=t.flags&65011712,i.childLanes=t.childLanes,i.lanes=t.lanes,i.child=t.child,i.memoizedProps=t.memoizedProps,i.memoizedState=t.memoizedState,i.updateQueue=t.updateQueue,a=t.dependencies,i.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext},i.sibling=t.sibling,i.index=t.index,i.ref=t.ref,i.refCleanup=t.refCleanup,i}function Xm(t,a){t.flags&=65011714;var i=t.alternate;return i===null?(t.childLanes=0,t.lanes=a,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=i.childLanes,t.lanes=i.lanes,t.child=i.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=i.memoizedProps,t.memoizedState=i.memoizedState,t.updateQueue=i.updateQueue,t.type=i.type,a=i.dependencies,t.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext}),t}function Mo(t,a,i,c,m,b){var k=0;if(c=t,typeof t=="function")ef(t)&&(k=1);else if(typeof t=="string")k=LE(t,i,se.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case X:return t=ar(31,i,a,m),t.elementType=X,t.lanes=b,t;case E:return dl(i.children,m,b,a);case T:k=8,m|=24;break;case N:return t=ar(12,i,a,m|2),t.elementType=N,t.lanes=b,t;case U:return t=ar(13,i,a,m),t.elementType=U,t.lanes=b,t;case _:return t=ar(19,i,a,m),t.elementType=_,t.lanes=b,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case C:k=10;break e;case j:k=9;break e;case I:k=11;break e;case z:k=14;break e;case P:k=16,c=null;break e}k=29,i=Error(l(130,t===null?"null":typeof t,"")),c=null}return a=ar(k,i,a,m),a.elementType=t,a.type=c,a.lanes=b,a}function dl(t,a,i,c){return t=ar(7,t,c,a),t.lanes=i,t}function tf(t,a,i){return t=ar(6,t,null,a),t.lanes=i,t}function Km(t){var a=ar(18,null,null,0);return a.stateNode=t,a}function nf(t,a,i){return a=ar(4,t.children!==null?t.children:[],t.key,a),a.lanes=i,a.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},a}var Zm=new WeakMap;function br(t,a){if(typeof t=="object"&&t!==null){var i=Zm.get(t);return i!==void 0?i:(a={value:t,source:a,stack:St(a)},Zm.set(t,a),a)}return{value:t,source:a,stack:St(a)}}var Yl=[],Vl=0,Oo=null,Ki=0,yr=[],vr=0,Ca=null,Pr=1,Fr="";function aa(t,a){Yl[Vl++]=Ki,Yl[Vl++]=Oo,Oo=t,Ki=a}function Qm(t,a,i){yr[vr++]=Pr,yr[vr++]=Fr,yr[vr++]=Ca,Ca=t;var c=Pr;t=Fr;var m=32-Fe(c)-1;c&=~(1<<m),i+=1;var b=32-Fe(a)+m;if(30<b){var k=m-m%5;b=(c&(1<<k)-1).toString(32),c>>=k,m-=k,Pr=1<<32-Fe(a)+m|i<<m|c,Fr=b+t}else Pr=1<<b|i<<m|c,Fr=t}function rf(t){t.return!==null&&(aa(t,1),Qm(t,1,0))}function af(t){for(;t===Oo;)Oo=Yl[--Vl],Yl[Vl]=null,Ki=Yl[--Vl],Yl[Vl]=null;for(;t===Ca;)Ca=yr[--vr],yr[vr]=null,Fr=yr[--vr],yr[vr]=null,Pr=yr[--vr],yr[vr]=null}function Wm(t,a){yr[vr++]=Pr,yr[vr++]=Fr,yr[vr++]=Ca,Pr=a.id,Fr=a.overflow,Ca=t}var wn=null,Pt=null,ct=!1,Ra=null,wr=!1,lf=Error(l(519));function ja(t){var a=Error(l(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Zi(br(a,t)),lf}function Jm(t){var a=t.stateNode,i=t.type,c=t.memoizedProps;switch(a[Bt]=t,a[ve]=c,i){case"dialog":lt("cancel",a),lt("close",a);break;case"iframe":case"object":case"embed":lt("load",a);break;case"video":case"audio":for(i=0;i<bs.length;i++)lt(bs[i],a);break;case"source":lt("error",a);break;case"img":case"image":case"link":lt("error",a),lt("load",a);break;case"details":lt("toggle",a);break;case"input":lt("invalid",a),sl(a,c.value,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name,!0);break;case"select":lt("invalid",a);break;case"textarea":lt("invalid",a),$l(a,c.value,c.defaultValue,c.children)}i=c.children,typeof i!="string"&&typeof i!="number"&&typeof i!="bigint"||a.textContent===""+i||c.suppressHydrationWarning===!0||gb(a.textContent,i)?(c.popover!=null&&(lt("beforetoggle",a),lt("toggle",a)),c.onScroll!=null&<("scroll",a),c.onScrollEnd!=null&<("scrollend",a),c.onClick!=null&&(a.onclick=ke),a=!0):a=!1,a||ja(t,!0)}function eg(t){for(wn=t.return;wn;)switch(wn.tag){case 5:case 31:case 13:wr=!1;return;case 27:case 3:wr=!0;return;default:wn=wn.return}}function Xl(t){if(t!==wn)return!1;if(!ct)return eg(t),ct=!0,!1;var a=t.tag,i;if((i=a!==3&&a!==27)&&((i=a===5)&&(i=t.type,i=!(i!=="form"&&i!=="button")||Ed(t.type,t.memoizedProps)),i=!i),i&&Pt&&ja(t),eg(t),a===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(l(317));Pt=Nb(t)}else if(a===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(l(317));Pt=Nb(t)}else a===27?(a=Pt,qa(t.type)?(t=Cd,Cd=null,Pt=t):Pt=a):Pt=wn?Sr(t.stateNode.nextSibling):null;return!0}function hl(){Pt=wn=null,ct=!1}function sf(){var t=Ra;return t!==null&&(Xn===null?Xn=t:Xn.push.apply(Xn,t),Ra=null),t}function Zi(t){Ra===null?Ra=[t]:Ra.push(t)}var of=D(null),pl=null,la=null;function Ma(t,a,i){A(of,a._currentValue),a._currentValue=i}function ia(t){t._currentValue=of.current,L(of)}function uf(t,a,i){for(;t!==null;){var c=t.alternate;if((t.childLanes&a)!==a?(t.childLanes|=a,c!==null&&(c.childLanes|=a)):c!==null&&(c.childLanes&a)!==a&&(c.childLanes|=a),t===i)break;t=t.return}}function cf(t,a,i,c){var m=t.child;for(m!==null&&(m.return=t);m!==null;){var b=m.dependencies;if(b!==null){var k=m.child;b=b.firstContext;e:for(;b!==null;){var R=b;b=m;for(var $=0;$<a.length;$++)if(R.context===a[$]){b.lanes|=i,R=b.alternate,R!==null&&(R.lanes|=i),uf(b.return,i,t),c||(k=null);break e}b=R.next}}else if(m.tag===18){if(k=m.return,k===null)throw Error(l(341));k.lanes|=i,b=k.alternate,b!==null&&(b.lanes|=i),uf(k,i,t),k=null}else k=m.child;if(k!==null)k.return=m;else for(k=m;k!==null;){if(k===t){k=null;break}if(m=k.sibling,m!==null){m.return=k.return,k=m;break}k=k.return}m=k}}function Kl(t,a,i,c){t=null;for(var m=a,b=!1;m!==null;){if(!b){if((m.flags&524288)!==0)b=!0;else if((m.flags&262144)!==0)break}if(m.tag===10){var k=m.alternate;if(k===null)throw Error(l(387));if(k=k.memoizedProps,k!==null){var R=m.type;rr(m.pendingProps.value,k.value)||(t!==null?t.push(R):t=[R])}}else if(m===Se.current){if(k=m.alternate,k===null)throw Error(l(387));k.memoizedState.memoizedState!==m.memoizedState.memoizedState&&(t!==null?t.push(Ss):t=[Ss])}m=m.return}t!==null&&cf(a,t,i,c),a.flags|=262144}function Do(t){for(t=t.firstContext;t!==null;){if(!rr(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function ml(t){pl=t,la=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function kn(t){return tg(pl,t)}function zo(t,a){return pl===null&&ml(t),tg(t,a)}function tg(t,a){var i=a._currentValue;if(a={context:a,memoizedValue:i,next:null},la===null){if(t===null)throw Error(l(308));la=a,t.dependencies={lanes:0,firstContext:a},t.flags|=524288}else la=la.next=a;return i}var MS=typeof AbortController<"u"?AbortController:function(){var t=[],a=this.signal={aborted:!1,addEventListener:function(i,c){t.push(c)}};this.abort=function(){a.aborted=!0,t.forEach(function(i){return i()})}},OS=e.unstable_scheduleCallback,DS=e.unstable_NormalPriority,ln={$$typeof:C,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ff(){return{controller:new MS,data:new Map,refCount:0}}function Qi(t){t.refCount--,t.refCount===0&&OS(DS,function(){t.controller.abort()})}var Wi=null,df=0,Zl=0,Ql=null;function zS(t,a){if(Wi===null){var i=Wi=[];df=0,Zl=md(),Ql={status:"pending",value:void 0,then:function(c){i.push(c)}}}return df++,a.then(ng,ng),a}function ng(){if(--df===0&&Wi!==null){Ql!==null&&(Ql.status="fulfilled");var t=Wi;Wi=null,Zl=0,Ql=null;for(var a=0;a<t.length;a++)(0,t[a])()}}function LS(t,a){var i=[],c={status:"pending",value:null,reason:null,then:function(m){i.push(m)}};return t.then(function(){c.status="fulfilled",c.value=a;for(var m=0;m<i.length;m++)(0,i[m])(a)},function(m){for(c.status="rejected",c.reason=m,m=0;m<i.length;m++)(0,i[m])(void 0)}),c}var rg=M.S;M.S=function(t,a){$x=Et(),typeof a=="object"&&a!==null&&typeof a.then=="function"&&zS(t,a),rg!==null&&rg(t,a)};var gl=D(null);function hf(){var t=gl.current;return t!==null?t:Dt.pooledCache}function Lo(t,a){a===null?A(gl,gl.current):A(gl,a.pool)}function ag(){var t=hf();return t===null?null:{parent:ln._currentValue,pool:t}}var Wl=Error(l(460)),pf=Error(l(474)),Bo=Error(l(542)),Io={then:function(){}};function lg(t){return t=t.status,t==="fulfilled"||t==="rejected"}function ig(t,a,i){switch(i=t[i],i===void 0?t.push(a):i!==a&&(a.then(ke,ke),a=i),a.status){case"fulfilled":return a.value;case"rejected":throw t=a.reason,og(t),t;default:if(typeof a.status=="string")a.then(ke,ke);else{if(t=Dt,t!==null&&100<t.shellSuspendCounter)throw Error(l(482));t=a,t.status="pending",t.then(function(c){if(a.status==="pending"){var m=a;m.status="fulfilled",m.value=c}},function(c){if(a.status==="pending"){var m=a;m.status="rejected",m.reason=c}})}switch(a.status){case"fulfilled":return a.value;case"rejected":throw t=a.reason,og(t),t}throw bl=a,Wl}}function xl(t){try{var a=t._init;return a(t._payload)}catch(i){throw i!==null&&typeof i=="object"&&typeof i.then=="function"?(bl=i,Wl):i}}var bl=null;function sg(){if(bl===null)throw Error(l(459));var t=bl;return bl=null,t}function og(t){if(t===Wl||t===Bo)throw Error(l(483))}var Jl=null,Ji=0;function Uo(t){var a=Ji;return Ji+=1,Jl===null&&(Jl=[]),ig(Jl,t,a)}function es(t,a){a=a.props.ref,t.ref=a!==void 0?a:null}function $o(t,a){throw a.$$typeof===y?Error(l(525)):(t=Object.prototype.toString.call(a),Error(l(31,t==="[object Object]"?"object with keys {"+Object.keys(a).join(", ")+"}":t)))}function ug(t){function a(V,G){if(t){var Q=V.deletions;Q===null?(V.deletions=[G],V.flags|=16):Q.push(G)}}function i(V,G){if(!t)return null;for(;G!==null;)a(V,G),G=G.sibling;return null}function c(V){for(var G=new Map;V!==null;)V.key!==null?G.set(V.key,V):G.set(V.index,V),V=V.sibling;return G}function m(V,G){return V=ra(V,G),V.index=0,V.sibling=null,V}function b(V,G,Q){return V.index=Q,t?(Q=V.alternate,Q!==null?(Q=Q.index,Q<G?(V.flags|=67108866,G):Q):(V.flags|=67108866,G)):(V.flags|=1048576,G)}function k(V){return t&&V.alternate===null&&(V.flags|=67108866),V}function R(V,G,Q,ce){return G===null||G.tag!==6?(G=tf(Q,V.mode,ce),G.return=V,G):(G=m(G,Q),G.return=V,G)}function $(V,G,Q,ce){var Ue=Q.type;return Ue===E?oe(V,G,Q.props.children,ce,Q.key):G!==null&&(G.elementType===Ue||typeof Ue=="object"&&Ue!==null&&Ue.$$typeof===P&&xl(Ue)===G.type)?(G=m(G,Q.props),es(G,Q),G.return=V,G):(G=Mo(Q.type,Q.key,Q.props,null,V.mode,ce),es(G,Q),G.return=V,G)}function W(V,G,Q,ce){return G===null||G.tag!==4||G.stateNode.containerInfo!==Q.containerInfo||G.stateNode.implementation!==Q.implementation?(G=nf(Q,V.mode,ce),G.return=V,G):(G=m(G,Q.children||[]),G.return=V,G)}function oe(V,G,Q,ce,Ue){return G===null||G.tag!==7?(G=dl(Q,V.mode,ce,Ue),G.return=V,G):(G=m(G,Q),G.return=V,G)}function fe(V,G,Q){if(typeof G=="string"&&G!==""||typeof G=="number"||typeof G=="bigint")return G=tf(""+G,V.mode,Q),G.return=V,G;if(typeof G=="object"&&G!==null){switch(G.$$typeof){case v:return Q=Mo(G.type,G.key,G.props,null,V.mode,Q),es(Q,G),Q.return=V,Q;case S:return G=nf(G,V.mode,Q),G.return=V,G;case P:return G=xl(G),fe(V,G,Q)}if(Y(G)||Z(G))return G=dl(G,V.mode,Q,null),G.return=V,G;if(typeof G.then=="function")return fe(V,Uo(G),Q);if(G.$$typeof===C)return fe(V,zo(V,G),Q);$o(V,G)}return null}function J(V,G,Q,ce){var Ue=G!==null?G.key:null;if(typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint")return Ue!==null?null:R(V,G,""+Q,ce);if(typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case v:return Q.key===Ue?$(V,G,Q,ce):null;case S:return Q.key===Ue?W(V,G,Q,ce):null;case P:return Q=xl(Q),J(V,G,Q,ce)}if(Y(Q)||Z(Q))return Ue!==null?null:oe(V,G,Q,ce,null);if(typeof Q.then=="function")return J(V,G,Uo(Q),ce);if(Q.$$typeof===C)return J(V,G,zo(V,Q),ce);$o(V,Q)}return null}function ne(V,G,Q,ce,Ue){if(typeof ce=="string"&&ce!==""||typeof ce=="number"||typeof ce=="bigint")return V=V.get(Q)||null,R(G,V,""+ce,Ue);if(typeof ce=="object"&&ce!==null){switch(ce.$$typeof){case v:return V=V.get(ce.key===null?Q:ce.key)||null,$(G,V,ce,Ue);case S:return V=V.get(ce.key===null?Q:ce.key)||null,W(G,V,ce,Ue);case P:return ce=xl(ce),ne(V,G,Q,ce,Ue)}if(Y(ce)||Z(ce))return V=V.get(Q)||null,oe(G,V,ce,Ue,null);if(typeof ce.then=="function")return ne(V,G,Q,Uo(ce),Ue);if(ce.$$typeof===C)return ne(V,G,Q,zo(G,ce),Ue);$o(G,ce)}return null}function Re(V,G,Q,ce){for(var Ue=null,xt=null,ze=G,We=G=0,ut=null;ze!==null&&We<Q.length;We++){ze.index>We?(ut=ze,ze=null):ut=ze.sibling;var bt=J(V,ze,Q[We],ce);if(bt===null){ze===null&&(ze=ut);break}t&&ze&&bt.alternate===null&&a(V,ze),G=b(bt,G,We),xt===null?Ue=bt:xt.sibling=bt,xt=bt,ze=ut}if(We===Q.length)return i(V,ze),ct&&aa(V,We),Ue;if(ze===null){for(;We<Q.length;We++)ze=fe(V,Q[We],ce),ze!==null&&(G=b(ze,G,We),xt===null?Ue=ze:xt.sibling=ze,xt=ze);return ct&&aa(V,We),Ue}for(ze=c(ze);We<Q.length;We++)ut=ne(ze,V,We,Q[We],ce),ut!==null&&(t&&ut.alternate!==null&&ze.delete(ut.key===null?We:ut.key),G=b(ut,G,We),xt===null?Ue=ut:xt.sibling=ut,xt=ut);return t&&ze.forEach(function(Za){return a(V,Za)}),ct&&aa(V,We),Ue}function He(V,G,Q,ce){if(Q==null)throw Error(l(151));for(var Ue=null,xt=null,ze=G,We=G=0,ut=null,bt=Q.next();ze!==null&&!bt.done;We++,bt=Q.next()){ze.index>We?(ut=ze,ze=null):ut=ze.sibling;var Za=J(V,ze,bt.value,ce);if(Za===null){ze===null&&(ze=ut);break}t&&ze&&Za.alternate===null&&a(V,ze),G=b(Za,G,We),xt===null?Ue=Za:xt.sibling=Za,xt=Za,ze=ut}if(bt.done)return i(V,ze),ct&&aa(V,We),Ue;if(ze===null){for(;!bt.done;We++,bt=Q.next())bt=fe(V,bt.value,ce),bt!==null&&(G=b(bt,G,We),xt===null?Ue=bt:xt.sibling=bt,xt=bt);return ct&&aa(V,We),Ue}for(ze=c(ze);!bt.done;We++,bt=Q.next())bt=ne(ze,V,We,bt.value,ce),bt!==null&&(t&&bt.alternate!==null&&ze.delete(bt.key===null?We:bt.key),G=b(bt,G,We),xt===null?Ue=bt:xt.sibling=bt,xt=bt);return t&&ze.forEach(function(VE){return a(V,VE)}),ct&&aa(V,We),Ue}function Mt(V,G,Q,ce){if(typeof Q=="object"&&Q!==null&&Q.type===E&&Q.key===null&&(Q=Q.props.children),typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case v:e:{for(var Ue=Q.key;G!==null;){if(G.key===Ue){if(Ue=Q.type,Ue===E){if(G.tag===7){i(V,G.sibling),ce=m(G,Q.props.children),ce.return=V,V=ce;break e}}else if(G.elementType===Ue||typeof Ue=="object"&&Ue!==null&&Ue.$$typeof===P&&xl(Ue)===G.type){i(V,G.sibling),ce=m(G,Q.props),es(ce,Q),ce.return=V,V=ce;break e}i(V,G);break}else a(V,G);G=G.sibling}Q.type===E?(ce=dl(Q.props.children,V.mode,ce,Q.key),ce.return=V,V=ce):(ce=Mo(Q.type,Q.key,Q.props,null,V.mode,ce),es(ce,Q),ce.return=V,V=ce)}return k(V);case S:e:{for(Ue=Q.key;G!==null;){if(G.key===Ue)if(G.tag===4&&G.stateNode.containerInfo===Q.containerInfo&&G.stateNode.implementation===Q.implementation){i(V,G.sibling),ce=m(G,Q.children||[]),ce.return=V,V=ce;break e}else{i(V,G);break}else a(V,G);G=G.sibling}ce=nf(Q,V.mode,ce),ce.return=V,V=ce}return k(V);case P:return Q=xl(Q),Mt(V,G,Q,ce)}if(Y(Q))return Re(V,G,Q,ce);if(Z(Q)){if(Ue=Z(Q),typeof Ue!="function")throw Error(l(150));return Q=Ue.call(Q),He(V,G,Q,ce)}if(typeof Q.then=="function")return Mt(V,G,Uo(Q),ce);if(Q.$$typeof===C)return Mt(V,G,zo(V,Q),ce);$o(V,Q)}return typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint"?(Q=""+Q,G!==null&&G.tag===6?(i(V,G.sibling),ce=m(G,Q),ce.return=V,V=ce):(i(V,G),ce=tf(Q,V.mode,ce),ce.return=V,V=ce),k(V)):i(V,G)}return function(V,G,Q,ce){try{Ji=0;var Ue=Mt(V,G,Q,ce);return Jl=null,Ue}catch(ze){if(ze===Wl||ze===Bo)throw ze;var xt=ar(29,ze,null,V.mode);return xt.lanes=ce,xt.return=V,xt}}}var yl=ug(!0),cg=ug(!1),Oa=!1;function mf(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function gf(t,a){t=t.updateQueue,a.updateQueue===t&&(a.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function Da(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function za(t,a,i){var c=t.updateQueue;if(c===null)return null;if(c=c.shared,(yt&2)!==0){var m=c.pending;return m===null?a.next=a:(a.next=m.next,m.next=a),c.pending=a,a=jo(t),Vm(t,null,i),a}return Ro(t,c,a,i),jo(t)}function ts(t,a,i){if(a=a.updateQueue,a!==null&&(a=a.shared,(i&4194048)!==0)){var c=a.lanes;c&=t.pendingLanes,i|=c,a.lanes=i,Ie(t,i)}}function xf(t,a){var i=t.updateQueue,c=t.alternate;if(c!==null&&(c=c.updateQueue,i===c)){var m=null,b=null;if(i=i.firstBaseUpdate,i!==null){do{var k={lane:i.lane,tag:i.tag,payload:i.payload,callback:null,next:null};b===null?m=b=k:b=b.next=k,i=i.next}while(i!==null);b===null?m=b=a:b=b.next=a}else m=b=a;i={baseState:c.baseState,firstBaseUpdate:m,lastBaseUpdate:b,shared:c.shared,callbacks:c.callbacks},t.updateQueue=i;return}t=i.lastBaseUpdate,t===null?i.firstBaseUpdate=a:t.next=a,i.lastBaseUpdate=a}var bf=!1;function ns(){if(bf){var t=Ql;if(t!==null)throw t}}function rs(t,a,i,c){bf=!1;var m=t.updateQueue;Oa=!1;var b=m.firstBaseUpdate,k=m.lastBaseUpdate,R=m.shared.pending;if(R!==null){m.shared.pending=null;var $=R,W=$.next;$.next=null,k===null?b=W:k.next=W,k=$;var oe=t.alternate;oe!==null&&(oe=oe.updateQueue,R=oe.lastBaseUpdate,R!==k&&(R===null?oe.firstBaseUpdate=W:R.next=W,oe.lastBaseUpdate=$))}if(b!==null){var fe=m.baseState;k=0,oe=W=$=null,R=b;do{var J=R.lane&-536870913,ne=J!==R.lane;if(ne?(ot&J)===J:(c&J)===J){J!==0&&J===Zl&&(bf=!0),oe!==null&&(oe=oe.next={lane:0,tag:R.tag,payload:R.payload,callback:null,next:null});e:{var Re=t,He=R;J=a;var Mt=i;switch(He.tag){case 1:if(Re=He.payload,typeof Re=="function"){fe=Re.call(Mt,fe,J);break e}fe=Re;break e;case 3:Re.flags=Re.flags&-65537|128;case 0:if(Re=He.payload,J=typeof Re=="function"?Re.call(Mt,fe,J):Re,J==null)break e;fe=g({},fe,J);break e;case 2:Oa=!0}}J=R.callback,J!==null&&(t.flags|=64,ne&&(t.flags|=8192),ne=m.callbacks,ne===null?m.callbacks=[J]:ne.push(J))}else ne={lane:J,tag:R.tag,payload:R.payload,callback:R.callback,next:null},oe===null?(W=oe=ne,$=fe):oe=oe.next=ne,k|=J;if(R=R.next,R===null){if(R=m.shared.pending,R===null)break;ne=R,R=ne.next,ne.next=null,m.lastBaseUpdate=ne,m.shared.pending=null}}while(!0);oe===null&&($=fe),m.baseState=$,m.firstBaseUpdate=W,m.lastBaseUpdate=oe,b===null&&(m.shared.lanes=0),$a|=k,t.lanes=k,t.memoizedState=fe}}function fg(t,a){if(typeof t!="function")throw Error(l(191,t));t.call(a)}function dg(t,a){var i=t.callbacks;if(i!==null)for(t.callbacks=null,t=0;t<i.length;t++)fg(i[t],a)}var ei=D(null),Ho=D(0);function hg(t,a){t=ma,A(Ho,t),A(ei,a),ma=t|a.baseLanes}function yf(){A(Ho,ma),A(ei,ei.current)}function vf(){ma=Ho.current,L(ei),L(Ho)}var lr=D(null),kr=null;function La(t){var a=t.alternate;A(tn,tn.current&1),A(lr,t),kr===null&&(a===null||ei.current!==null||a.memoizedState!==null)&&(kr=t)}function wf(t){A(tn,tn.current),A(lr,t),kr===null&&(kr=t)}function pg(t){t.tag===22?(A(tn,tn.current),A(lr,t),kr===null&&(kr=t)):Ba()}function Ba(){A(tn,tn.current),A(lr,lr.current)}function ir(t){L(lr),kr===t&&(kr=null),L(tn)}var tn=D(0);function Po(t){for(var a=t;a!==null;){if(a.tag===13){var i=a.memoizedState;if(i!==null&&(i=i.dehydrated,i===null||Td(i)||Ad(i)))return a}else if(a.tag===19&&(a.memoizedProps.revealOrder==="forwards"||a.memoizedProps.revealOrder==="backwards"||a.memoizedProps.revealOrder==="unstable_legacy-backwards"||a.memoizedProps.revealOrder==="together")){if((a.flags&128)!==0)return a}else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===t)break;for(;a.sibling===null;){if(a.return===null||a.return===t)return null;a=a.return}a.sibling.return=a.return,a=a.sibling}return null}var sa=0,Ke=null,Rt=null,sn=null,Fo=!1,ti=!1,vl=!1,Go=0,as=0,ni=null,BS=0;function Zt(){throw Error(l(321))}function kf(t,a){if(a===null)return!1;for(var i=0;i<a.length&&i<t.length;i++)if(!rr(t[i],a[i]))return!1;return!0}function Sf(t,a,i,c,m,b){return sa=b,Ke=a,a.memoizedState=null,a.updateQueue=null,a.lanes=0,M.H=t===null||t.memoizedState===null?Qg:If,vl=!1,b=i(c,m),vl=!1,ti&&(b=gg(a,i,c,m)),mg(t),b}function mg(t){M.H=ss;var a=Rt!==null&&Rt.next!==null;if(sa=0,sn=Rt=Ke=null,Fo=!1,as=0,ni=null,a)throw Error(l(300));t===null||on||(t=t.dependencies,t!==null&&Do(t)&&(on=!0))}function gg(t,a,i,c){Ke=t;var m=0;do{if(ti&&(ni=null),as=0,ti=!1,25<=m)throw Error(l(301));if(m+=1,sn=Rt=null,t.updateQueue!=null){var b=t.updateQueue;b.lastEffect=null,b.events=null,b.stores=null,b.memoCache!=null&&(b.memoCache.index=0)}M.H=Wg,b=a(i,c)}while(ti);return b}function IS(){var t=M.H,a=t.useState()[0];return a=typeof a.then=="function"?ls(a):a,t=t.useState()[0],(Rt!==null?Rt.memoizedState:null)!==t&&(Ke.flags|=1024),a}function Ef(){var t=Go!==0;return Go=0,t}function Nf(t,a,i){a.updateQueue=t.updateQueue,a.flags&=-2053,t.lanes&=~i}function _f(t){if(Fo){for(t=t.memoizedState;t!==null;){var a=t.queue;a!==null&&(a.pending=null),t=t.next}Fo=!1}sa=0,sn=Rt=Ke=null,ti=!1,as=Go=0,ni=null}function Ln(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return sn===null?Ke.memoizedState=sn=t:sn=sn.next=t,sn}function nn(){if(Rt===null){var t=Ke.alternate;t=t!==null?t.memoizedState:null}else t=Rt.next;var a=sn===null?Ke.memoizedState:sn.next;if(a!==null)sn=a,Rt=t;else{if(t===null)throw Ke.alternate===null?Error(l(467)):Error(l(310));Rt=t,t={memoizedState:Rt.memoizedState,baseState:Rt.baseState,baseQueue:Rt.baseQueue,queue:Rt.queue,next:null},sn===null?Ke.memoizedState=sn=t:sn=sn.next=t}return sn}function qo(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ls(t){var a=as;return as+=1,ni===null&&(ni=[]),t=ig(ni,t,a),a=Ke,(sn===null?a.memoizedState:sn.next)===null&&(a=a.alternate,M.H=a===null||a.memoizedState===null?Qg:If),t}function Yo(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return ls(t);if(t.$$typeof===C)return kn(t)}throw Error(l(438,String(t)))}function Tf(t){var a=null,i=Ke.updateQueue;if(i!==null&&(a=i.memoCache),a==null){var c=Ke.alternate;c!==null&&(c=c.updateQueue,c!==null&&(c=c.memoCache,c!=null&&(a={data:c.data.map(function(m){return m.slice()}),index:0})))}if(a==null&&(a={data:[],index:0}),i===null&&(i=qo(),Ke.updateQueue=i),i.memoCache=a,i=a.data[a.index],i===void 0)for(i=a.data[a.index]=Array(t),c=0;c<t;c++)i[c]=B;return a.index++,i}function oa(t,a){return typeof a=="function"?a(t):a}function Vo(t){var a=nn();return Af(a,Rt,t)}function Af(t,a,i){var c=t.queue;if(c===null)throw Error(l(311));c.lastRenderedReducer=i;var m=t.baseQueue,b=c.pending;if(b!==null){if(m!==null){var k=m.next;m.next=b.next,b.next=k}a.baseQueue=m=b,c.pending=null}if(b=t.baseState,m===null)t.memoizedState=b;else{a=m.next;var R=k=null,$=null,W=a,oe=!1;do{var fe=W.lane&-536870913;if(fe!==W.lane?(ot&fe)===fe:(sa&fe)===fe){var J=W.revertLane;if(J===0)$!==null&&($=$.next={lane:0,revertLane:0,gesture:null,action:W.action,hasEagerState:W.hasEagerState,eagerState:W.eagerState,next:null}),fe===Zl&&(oe=!0);else if((sa&J)===J){W=W.next,J===Zl&&(oe=!0);continue}else fe={lane:0,revertLane:W.revertLane,gesture:null,action:W.action,hasEagerState:W.hasEagerState,eagerState:W.eagerState,next:null},$===null?(R=$=fe,k=b):$=$.next=fe,Ke.lanes|=J,$a|=J;fe=W.action,vl&&i(b,fe),b=W.hasEagerState?W.eagerState:i(b,fe)}else J={lane:fe,revertLane:W.revertLane,gesture:W.gesture,action:W.action,hasEagerState:W.hasEagerState,eagerState:W.eagerState,next:null},$===null?(R=$=J,k=b):$=$.next=J,Ke.lanes|=fe,$a|=fe;W=W.next}while(W!==null&&W!==a);if($===null?k=b:$.next=R,!rr(b,t.memoizedState)&&(on=!0,oe&&(i=Ql,i!==null)))throw i;t.memoizedState=b,t.baseState=k,t.baseQueue=$,c.lastRenderedState=b}return m===null&&(c.lanes=0),[t.memoizedState,c.dispatch]}function Cf(t){var a=nn(),i=a.queue;if(i===null)throw Error(l(311));i.lastRenderedReducer=t;var c=i.dispatch,m=i.pending,b=a.memoizedState;if(m!==null){i.pending=null;var k=m=m.next;do b=t(b,k.action),k=k.next;while(k!==m);rr(b,a.memoizedState)||(on=!0),a.memoizedState=b,a.baseQueue===null&&(a.baseState=b),i.lastRenderedState=b}return[b,c]}function xg(t,a,i){var c=Ke,m=nn(),b=ct;if(b){if(i===void 0)throw Error(l(407));i=i()}else i=a();var k=!rr((Rt||m).memoizedState,i);if(k&&(m.memoizedState=i,on=!0),m=m.queue,Mf(vg.bind(null,c,m,t),[t]),m.getSnapshot!==a||k||sn!==null&&sn.memoizedState.tag&1){if(c.flags|=2048,ri(9,{destroy:void 0},yg.bind(null,c,m,i,a),null),Dt===null)throw Error(l(349));b||(sa&127)!==0||bg(c,a,i)}return i}function bg(t,a,i){t.flags|=16384,t={getSnapshot:a,value:i},a=Ke.updateQueue,a===null?(a=qo(),Ke.updateQueue=a,a.stores=[t]):(i=a.stores,i===null?a.stores=[t]:i.push(t))}function yg(t,a,i,c){a.value=i,a.getSnapshot=c,wg(a)&&kg(t)}function vg(t,a,i){return i(function(){wg(a)&&kg(t)})}function wg(t){var a=t.getSnapshot;t=t.value;try{var i=a();return!rr(t,i)}catch{return!0}}function kg(t){var a=fl(t,2);a!==null&&Kn(a,t,2)}function Rf(t){var a=Ln();if(typeof t=="function"){var i=t;if(t=i(),vl){Ct(!0);try{i()}finally{Ct(!1)}}}return a.memoizedState=a.baseState=t,a.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:oa,lastRenderedState:t},a}function Sg(t,a,i,c){return t.baseState=i,Af(t,Rt,typeof c=="function"?c:oa)}function US(t,a,i,c,m){if(Zo(t))throw Error(l(485));if(t=a.action,t!==null){var b={payload:m,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(k){b.listeners.push(k)}};M.T!==null?i(!0):b.isTransition=!1,c(b),i=a.pending,i===null?(b.next=a.pending=b,Eg(a,b)):(b.next=i.next,a.pending=i.next=b)}}function Eg(t,a){var i=a.action,c=a.payload,m=t.state;if(a.isTransition){var b=M.T,k={};M.T=k;try{var R=i(m,c),$=M.S;$!==null&&$(k,R),Ng(t,a,R)}catch(W){jf(t,a,W)}finally{b!==null&&k.types!==null&&(b.types=k.types),M.T=b}}else try{b=i(m,c),Ng(t,a,b)}catch(W){jf(t,a,W)}}function Ng(t,a,i){i!==null&&typeof i=="object"&&typeof i.then=="function"?i.then(function(c){_g(t,a,c)},function(c){return jf(t,a,c)}):_g(t,a,i)}function _g(t,a,i){a.status="fulfilled",a.value=i,Tg(a),t.state=i,a=t.pending,a!==null&&(i=a.next,i===a?t.pending=null:(i=i.next,a.next=i,Eg(t,i)))}function jf(t,a,i){var c=t.pending;if(t.pending=null,c!==null){c=c.next;do a.status="rejected",a.reason=i,Tg(a),a=a.next;while(a!==c)}t.action=null}function Tg(t){t=t.listeners;for(var a=0;a<t.length;a++)(0,t[a])()}function Ag(t,a){return a}function Cg(t,a){if(ct){var i=Dt.formState;if(i!==null){e:{var c=Ke;if(ct){if(Pt){t:{for(var m=Pt,b=wr;m.nodeType!==8;){if(!b){m=null;break t}if(m=Sr(m.nextSibling),m===null){m=null;break t}}b=m.data,m=b==="F!"||b==="F"?m:null}if(m){Pt=Sr(m.nextSibling),c=m.data==="F!";break e}}ja(c)}c=!1}c&&(a=i[0])}}return i=Ln(),i.memoizedState=i.baseState=a,c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ag,lastRenderedState:a},i.queue=c,i=Xg.bind(null,Ke,c),c.dispatch=i,c=Rf(!1),b=Bf.bind(null,Ke,!1,c.queue),c=Ln(),m={state:a,dispatch:null,action:t,pending:null},c.queue=m,i=US.bind(null,Ke,m,b,i),m.dispatch=i,c.memoizedState=t,[a,i,!1]}function Rg(t){var a=nn();return jg(a,Rt,t)}function jg(t,a,i){if(a=Af(t,a,Ag)[0],t=Vo(oa)[0],typeof a=="object"&&a!==null&&typeof a.then=="function")try{var c=ls(a)}catch(k){throw k===Wl?Bo:k}else c=a;a=nn();var m=a.queue,b=m.dispatch;return i!==a.memoizedState&&(Ke.flags|=2048,ri(9,{destroy:void 0},$S.bind(null,m,i),null)),[c,b,t]}function $S(t,a){t.action=a}function Mg(t){var a=nn(),i=Rt;if(i!==null)return jg(a,i,t);nn(),a=a.memoizedState,i=nn();var c=i.queue.dispatch;return i.memoizedState=t,[a,c,!1]}function ri(t,a,i,c){return t={tag:t,create:i,deps:c,inst:a,next:null},a=Ke.updateQueue,a===null&&(a=qo(),Ke.updateQueue=a),i=a.lastEffect,i===null?a.lastEffect=t.next=t:(c=i.next,i.next=t,t.next=c,a.lastEffect=t),t}function Og(){return nn().memoizedState}function Xo(t,a,i,c){var m=Ln();Ke.flags|=t,m.memoizedState=ri(1|a,{destroy:void 0},i,c===void 0?null:c)}function Ko(t,a,i,c){var m=nn();c=c===void 0?null:c;var b=m.memoizedState.inst;Rt!==null&&c!==null&&kf(c,Rt.memoizedState.deps)?m.memoizedState=ri(a,b,i,c):(Ke.flags|=t,m.memoizedState=ri(1|a,b,i,c))}function Dg(t,a){Xo(8390656,8,t,a)}function Mf(t,a){Ko(2048,8,t,a)}function HS(t){Ke.flags|=4;var a=Ke.updateQueue;if(a===null)a=qo(),Ke.updateQueue=a,a.events=[t];else{var i=a.events;i===null?a.events=[t]:i.push(t)}}function zg(t){var a=nn().memoizedState;return HS({ref:a,nextImpl:t}),function(){if((yt&2)!==0)throw Error(l(440));return a.impl.apply(void 0,arguments)}}function Lg(t,a){return Ko(4,2,t,a)}function Bg(t,a){return Ko(4,4,t,a)}function Ig(t,a){if(typeof a=="function"){t=t();var i=a(t);return function(){typeof i=="function"?i():a(null)}}if(a!=null)return t=t(),a.current=t,function(){a.current=null}}function Ug(t,a,i){i=i!=null?i.concat([t]):null,Ko(4,4,Ig.bind(null,a,t),i)}function Of(){}function $g(t,a){var i=nn();a=a===void 0?null:a;var c=i.memoizedState;return a!==null&&kf(a,c[1])?c[0]:(i.memoizedState=[t,a],t)}function Hg(t,a){var i=nn();a=a===void 0?null:a;var c=i.memoizedState;if(a!==null&&kf(a,c[1]))return c[0];if(c=t(),vl){Ct(!0);try{t()}finally{Ct(!1)}}return i.memoizedState=[c,a],c}function Df(t,a,i){return i===void 0||(sa&1073741824)!==0&&(ot&261930)===0?t.memoizedState=a:(t.memoizedState=i,t=Px(),Ke.lanes|=t,$a|=t,i)}function Pg(t,a,i,c){return rr(i,a)?i:ei.current!==null?(t=Df(t,i,c),rr(t,a)||(on=!0),t):(sa&42)===0||(sa&1073741824)!==0&&(ot&261930)===0?(on=!0,t.memoizedState=i):(t=Px(),Ke.lanes|=t,$a|=t,a)}function Fg(t,a,i,c,m){var b=K.p;K.p=b!==0&&8>b?b:8;var k=M.T,R={};M.T=R,Bf(t,!1,a,i);try{var $=m(),W=M.S;if(W!==null&&W(R,$),$!==null&&typeof $=="object"&&typeof $.then=="function"){var oe=LS($,c);is(t,a,oe,ur(t))}else is(t,a,c,ur(t))}catch(fe){is(t,a,{then:function(){},status:"rejected",reason:fe},ur())}finally{K.p=b,k!==null&&R.types!==null&&(k.types=R.types),M.T=k}}function PS(){}function zf(t,a,i,c){if(t.tag!==5)throw Error(l(476));var m=Gg(t).queue;Fg(t,m,a,le,i===null?PS:function(){return qg(t),i(c)})}function Gg(t){var a=t.memoizedState;if(a!==null)return a;a={memoizedState:le,baseState:le,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:oa,lastRenderedState:le},next:null};var i={};return a.next={memoizedState:i,baseState:i,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:oa,lastRenderedState:i},next:null},t.memoizedState=a,t=t.alternate,t!==null&&(t.memoizedState=a),a}function qg(t){var a=Gg(t);a.next===null&&(a=t.alternate.memoizedState),is(t,a.next.queue,{},ur())}function Lf(){return kn(Ss)}function Yg(){return nn().memoizedState}function Vg(){return nn().memoizedState}function FS(t){for(var a=t.return;a!==null;){switch(a.tag){case 24:case 3:var i=ur();t=Da(i);var c=za(a,t,i);c!==null&&(Kn(c,a,i),ts(c,a,i)),a={cache:ff()},t.payload=a;return}a=a.return}}function GS(t,a,i){var c=ur();i={lane:c,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},Zo(t)?Kg(a,i):(i=Jc(t,a,i,c),i!==null&&(Kn(i,t,c),Zg(i,a,c)))}function Xg(t,a,i){var c=ur();is(t,a,i,c)}function is(t,a,i,c){var m={lane:c,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null};if(Zo(t))Kg(a,m);else{var b=t.alternate;if(t.lanes===0&&(b===null||b.lanes===0)&&(b=a.lastRenderedReducer,b!==null))try{var k=a.lastRenderedState,R=b(k,i);if(m.hasEagerState=!0,m.eagerState=R,rr(R,k))return Ro(t,a,m,0),Dt===null&&Co(),!1}catch{}if(i=Jc(t,a,m,c),i!==null)return Kn(i,t,c),Zg(i,a,c),!0}return!1}function Bf(t,a,i,c){if(c={lane:2,revertLane:md(),gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null},Zo(t)){if(a)throw Error(l(479))}else a=Jc(t,i,c,2),a!==null&&Kn(a,t,2)}function Zo(t){var a=t.alternate;return t===Ke||a!==null&&a===Ke}function Kg(t,a){ti=Fo=!0;var i=t.pending;i===null?a.next=a:(a.next=i.next,i.next=a),t.pending=a}function Zg(t,a,i){if((i&4194048)!==0){var c=a.lanes;c&=t.pendingLanes,i|=c,a.lanes=i,Ie(t,i)}}var ss={readContext:kn,use:Yo,useCallback:Zt,useContext:Zt,useEffect:Zt,useImperativeHandle:Zt,useLayoutEffect:Zt,useInsertionEffect:Zt,useMemo:Zt,useReducer:Zt,useRef:Zt,useState:Zt,useDebugValue:Zt,useDeferredValue:Zt,useTransition:Zt,useSyncExternalStore:Zt,useId:Zt,useHostTransitionStatus:Zt,useFormState:Zt,useActionState:Zt,useOptimistic:Zt,useMemoCache:Zt,useCacheRefresh:Zt};ss.useEffectEvent=Zt;var Qg={readContext:kn,use:Yo,useCallback:function(t,a){return Ln().memoizedState=[t,a===void 0?null:a],t},useContext:kn,useEffect:Dg,useImperativeHandle:function(t,a,i){i=i!=null?i.concat([t]):null,Xo(4194308,4,Ig.bind(null,a,t),i)},useLayoutEffect:function(t,a){return Xo(4194308,4,t,a)},useInsertionEffect:function(t,a){Xo(4,2,t,a)},useMemo:function(t,a){var i=Ln();a=a===void 0?null:a;var c=t();if(vl){Ct(!0);try{t()}finally{Ct(!1)}}return i.memoizedState=[c,a],c},useReducer:function(t,a,i){var c=Ln();if(i!==void 0){var m=i(a);if(vl){Ct(!0);try{i(a)}finally{Ct(!1)}}}else m=a;return c.memoizedState=c.baseState=m,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:m},c.queue=t,t=t.dispatch=GS.bind(null,Ke,t),[c.memoizedState,t]},useRef:function(t){var a=Ln();return t={current:t},a.memoizedState=t},useState:function(t){t=Rf(t);var a=t.queue,i=Xg.bind(null,Ke,a);return a.dispatch=i,[t.memoizedState,i]},useDebugValue:Of,useDeferredValue:function(t,a){var i=Ln();return Df(i,t,a)},useTransition:function(){var t=Rf(!1);return t=Fg.bind(null,Ke,t.queue,!0,!1),Ln().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,a,i){var c=Ke,m=Ln();if(ct){if(i===void 0)throw Error(l(407));i=i()}else{if(i=a(),Dt===null)throw Error(l(349));(ot&127)!==0||bg(c,a,i)}m.memoizedState=i;var b={value:i,getSnapshot:a};return m.queue=b,Dg(vg.bind(null,c,b,t),[t]),c.flags|=2048,ri(9,{destroy:void 0},yg.bind(null,c,b,i,a),null),i},useId:function(){var t=Ln(),a=Dt.identifierPrefix;if(ct){var i=Fr,c=Pr;i=(c&~(1<<32-Fe(c)-1)).toString(32)+i,a="_"+a+"R_"+i,i=Go++,0<i&&(a+="H"+i.toString(32)),a+="_"}else i=BS++,a="_"+a+"r_"+i.toString(32)+"_";return t.memoizedState=a},useHostTransitionStatus:Lf,useFormState:Cg,useActionState:Cg,useOptimistic:function(t){var a=Ln();a.memoizedState=a.baseState=t;var i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return a.queue=i,a=Bf.bind(null,Ke,!0,i),i.dispatch=a,[t,a]},useMemoCache:Tf,useCacheRefresh:function(){return Ln().memoizedState=FS.bind(null,Ke)},useEffectEvent:function(t){var a=Ln(),i={impl:t};return a.memoizedState=i,function(){if((yt&2)!==0)throw Error(l(440));return i.impl.apply(void 0,arguments)}}},If={readContext:kn,use:Yo,useCallback:$g,useContext:kn,useEffect:Mf,useImperativeHandle:Ug,useInsertionEffect:Lg,useLayoutEffect:Bg,useMemo:Hg,useReducer:Vo,useRef:Og,useState:function(){return Vo(oa)},useDebugValue:Of,useDeferredValue:function(t,a){var i=nn();return Pg(i,Rt.memoizedState,t,a)},useTransition:function(){var t=Vo(oa)[0],a=nn().memoizedState;return[typeof t=="boolean"?t:ls(t),a]},useSyncExternalStore:xg,useId:Yg,useHostTransitionStatus:Lf,useFormState:Rg,useActionState:Rg,useOptimistic:function(t,a){var i=nn();return Sg(i,Rt,t,a)},useMemoCache:Tf,useCacheRefresh:Vg};If.useEffectEvent=zg;var Wg={readContext:kn,use:Yo,useCallback:$g,useContext:kn,useEffect:Mf,useImperativeHandle:Ug,useInsertionEffect:Lg,useLayoutEffect:Bg,useMemo:Hg,useReducer:Cf,useRef:Og,useState:function(){return Cf(oa)},useDebugValue:Of,useDeferredValue:function(t,a){var i=nn();return Rt===null?Df(i,t,a):Pg(i,Rt.memoizedState,t,a)},useTransition:function(){var t=Cf(oa)[0],a=nn().memoizedState;return[typeof t=="boolean"?t:ls(t),a]},useSyncExternalStore:xg,useId:Yg,useHostTransitionStatus:Lf,useFormState:Mg,useActionState:Mg,useOptimistic:function(t,a){var i=nn();return Rt!==null?Sg(i,Rt,t,a):(i.baseState=t,[t,i.queue.dispatch])},useMemoCache:Tf,useCacheRefresh:Vg};Wg.useEffectEvent=zg;function Uf(t,a,i,c){a=t.memoizedState,i=i(c,a),i=i==null?a:g({},a,i),t.memoizedState=i,t.lanes===0&&(t.updateQueue.baseState=i)}var $f={enqueueSetState:function(t,a,i){t=t._reactInternals;var c=ur(),m=Da(c);m.payload=a,i!=null&&(m.callback=i),a=za(t,m,c),a!==null&&(Kn(a,t,c),ts(a,t,c))},enqueueReplaceState:function(t,a,i){t=t._reactInternals;var c=ur(),m=Da(c);m.tag=1,m.payload=a,i!=null&&(m.callback=i),a=za(t,m,c),a!==null&&(Kn(a,t,c),ts(a,t,c))},enqueueForceUpdate:function(t,a){t=t._reactInternals;var i=ur(),c=Da(i);c.tag=2,a!=null&&(c.callback=a),a=za(t,c,i),a!==null&&(Kn(a,t,i),ts(a,t,i))}};function Jg(t,a,i,c,m,b,k){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(c,b,k):a.prototype&&a.prototype.isPureReactComponent?!Vi(i,c)||!Vi(m,b):!0}function ex(t,a,i,c){t=a.state,typeof a.componentWillReceiveProps=="function"&&a.componentWillReceiveProps(i,c),typeof a.UNSAFE_componentWillReceiveProps=="function"&&a.UNSAFE_componentWillReceiveProps(i,c),a.state!==t&&$f.enqueueReplaceState(a,a.state,null)}function wl(t,a){var i=a;if("ref"in a){i={};for(var c in a)c!=="ref"&&(i[c]=a[c])}if(t=t.defaultProps){i===a&&(i=g({},i));for(var m in t)i[m]===void 0&&(i[m]=t[m])}return i}function tx(t){Ao(t)}function nx(t){console.error(t)}function rx(t){Ao(t)}function Qo(t,a){try{var i=t.onUncaughtError;i(a.value,{componentStack:a.stack})}catch(c){setTimeout(function(){throw c})}}function ax(t,a,i){try{var c=t.onCaughtError;c(i.value,{componentStack:i.stack,errorBoundary:a.tag===1?a.stateNode:null})}catch(m){setTimeout(function(){throw m})}}function Hf(t,a,i){return i=Da(i),i.tag=3,i.payload={element:null},i.callback=function(){Qo(t,a)},i}function lx(t){return t=Da(t),t.tag=3,t}function ix(t,a,i,c){var m=i.type.getDerivedStateFromError;if(typeof m=="function"){var b=c.value;t.payload=function(){return m(b)},t.callback=function(){ax(a,i,c)}}var k=i.stateNode;k!==null&&typeof k.componentDidCatch=="function"&&(t.callback=function(){ax(a,i,c),typeof m!="function"&&(Ha===null?Ha=new Set([this]):Ha.add(this));var R=c.stack;this.componentDidCatch(c.value,{componentStack:R!==null?R:""})})}function qS(t,a,i,c,m){if(i.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){if(a=i.alternate,a!==null&&Kl(a,i,m,!0),i=lr.current,i!==null){switch(i.tag){case 31:case 13:return kr===null?uu():i.alternate===null&&Qt===0&&(Qt=3),i.flags&=-257,i.flags|=65536,i.lanes=m,c===Io?i.flags|=16384:(a=i.updateQueue,a===null?i.updateQueue=new Set([c]):a.add(c),dd(t,c,m)),!1;case 22:return i.flags|=65536,c===Io?i.flags|=16384:(a=i.updateQueue,a===null?(a={transitions:null,markerInstances:null,retryQueue:new Set([c])},i.updateQueue=a):(i=a.retryQueue,i===null?a.retryQueue=new Set([c]):i.add(c)),dd(t,c,m)),!1}throw Error(l(435,i.tag))}return dd(t,c,m),uu(),!1}if(ct)return a=lr.current,a!==null?((a.flags&65536)===0&&(a.flags|=256),a.flags|=65536,a.lanes=m,c!==lf&&(t=Error(l(422),{cause:c}),Zi(br(t,i)))):(c!==lf&&(a=Error(l(423),{cause:c}),Zi(br(a,i))),t=t.current.alternate,t.flags|=65536,m&=-m,t.lanes|=m,c=br(c,i),m=Hf(t.stateNode,c,m),xf(t,m),Qt!==4&&(Qt=2)),!1;var b=Error(l(520),{cause:c});if(b=br(b,i),ms===null?ms=[b]:ms.push(b),Qt!==4&&(Qt=2),a===null)return!0;c=br(c,i),i=a;do{switch(i.tag){case 3:return i.flags|=65536,t=m&-m,i.lanes|=t,t=Hf(i.stateNode,c,t),xf(i,t),!1;case 1:if(a=i.type,b=i.stateNode,(i.flags&128)===0&&(typeof a.getDerivedStateFromError=="function"||b!==null&&typeof b.componentDidCatch=="function"&&(Ha===null||!Ha.has(b))))return i.flags|=65536,m&=-m,i.lanes|=m,m=lx(m),ix(m,t,i,c),xf(i,m),!1}i=i.return}while(i!==null);return!1}var Pf=Error(l(461)),on=!1;function Sn(t,a,i,c){a.child=t===null?cg(a,null,i,c):yl(a,t.child,i,c)}function sx(t,a,i,c,m){i=i.render;var b=a.ref;if("ref"in c){var k={};for(var R in c)R!=="ref"&&(k[R]=c[R])}else k=c;return ml(a),c=Sf(t,a,i,k,b,m),R=Ef(),t!==null&&!on?(Nf(t,a,m),ua(t,a,m)):(ct&&R&&rf(a),a.flags|=1,Sn(t,a,c,m),a.child)}function ox(t,a,i,c,m){if(t===null){var b=i.type;return typeof b=="function"&&!ef(b)&&b.defaultProps===void 0&&i.compare===null?(a.tag=15,a.type=b,ux(t,a,b,c,m)):(t=Mo(i.type,null,c,a,a.mode,m),t.ref=a.ref,t.return=a,a.child=t)}if(b=t.child,!Zf(t,m)){var k=b.memoizedProps;if(i=i.compare,i=i!==null?i:Vi,i(k,c)&&t.ref===a.ref)return ua(t,a,m)}return a.flags|=1,t=ra(b,c),t.ref=a.ref,t.return=a,a.child=t}function ux(t,a,i,c,m){if(t!==null){var b=t.memoizedProps;if(Vi(b,c)&&t.ref===a.ref)if(on=!1,a.pendingProps=c=b,Zf(t,m))(t.flags&131072)!==0&&(on=!0);else return a.lanes=t.lanes,ua(t,a,m)}return Ff(t,a,i,c,m)}function cx(t,a,i,c){var m=c.children,b=t!==null?t.memoizedState:null;if(t===null&&a.stateNode===null&&(a.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),c.mode==="hidden"){if((a.flags&128)!==0){if(b=b!==null?b.baseLanes|i:i,t!==null){for(c=a.child=t.child,m=0;c!==null;)m=m|c.lanes|c.childLanes,c=c.sibling;c=m&~b}else c=0,a.child=null;return fx(t,a,b,i,c)}if((i&536870912)!==0)a.memoizedState={baseLanes:0,cachePool:null},t!==null&&Lo(a,b!==null?b.cachePool:null),b!==null?hg(a,b):yf(),pg(a);else return c=a.lanes=536870912,fx(t,a,b!==null?b.baseLanes|i:i,i,c)}else b!==null?(Lo(a,b.cachePool),hg(a,b),Ba(),a.memoizedState=null):(t!==null&&Lo(a,null),yf(),Ba());return Sn(t,a,m,i),a.child}function os(t,a){return t!==null&&t.tag===22||a.stateNode!==null||(a.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),a.sibling}function fx(t,a,i,c,m){var b=hf();return b=b===null?null:{parent:ln._currentValue,pool:b},a.memoizedState={baseLanes:i,cachePool:b},t!==null&&Lo(a,null),yf(),pg(a),t!==null&&Kl(t,a,c,!0),a.childLanes=m,null}function Wo(t,a){return a=eu({mode:a.mode,children:a.children},t.mode),a.ref=t.ref,t.child=a,a.return=t,a}function dx(t,a,i){return yl(a,t.child,null,i),t=Wo(a,a.pendingProps),t.flags|=2,ir(a),a.memoizedState=null,t}function YS(t,a,i){var c=a.pendingProps,m=(a.flags&128)!==0;if(a.flags&=-129,t===null){if(ct){if(c.mode==="hidden")return t=Wo(a,c),a.lanes=536870912,os(null,t);if(wf(a),(t=Pt)?(t=Eb(t,wr),t=t!==null&&t.data==="&"?t:null,t!==null&&(a.memoizedState={dehydrated:t,treeContext:Ca!==null?{id:Pr,overflow:Fr}:null,retryLane:536870912,hydrationErrors:null},i=Km(t),i.return=a,a.child=i,wn=a,Pt=null)):t=null,t===null)throw ja(a);return a.lanes=536870912,null}return Wo(a,c)}var b=t.memoizedState;if(b!==null){var k=b.dehydrated;if(wf(a),m)if(a.flags&256)a.flags&=-257,a=dx(t,a,i);else if(a.memoizedState!==null)a.child=t.child,a.flags|=128,a=null;else throw Error(l(558));else if(on||Kl(t,a,i,!1),m=(i&t.childLanes)!==0,on||m){if(c=Dt,c!==null&&(k=$t(c,i),k!==0&&k!==b.retryLane))throw b.retryLane=k,fl(t,k),Kn(c,t,k),Pf;uu(),a=dx(t,a,i)}else t=b.treeContext,Pt=Sr(k.nextSibling),wn=a,ct=!0,Ra=null,wr=!1,t!==null&&Wm(a,t),a=Wo(a,c),a.flags|=4096;return a}return t=ra(t.child,{mode:c.mode,children:c.children}),t.ref=a.ref,a.child=t,t.return=a,t}function Jo(t,a){var i=a.ref;if(i===null)t!==null&&t.ref!==null&&(a.flags|=4194816);else{if(typeof i!="function"&&typeof i!="object")throw Error(l(284));(t===null||t.ref!==i)&&(a.flags|=4194816)}}function Ff(t,a,i,c,m){return ml(a),i=Sf(t,a,i,c,void 0,m),c=Ef(),t!==null&&!on?(Nf(t,a,m),ua(t,a,m)):(ct&&c&&rf(a),a.flags|=1,Sn(t,a,i,m),a.child)}function hx(t,a,i,c,m,b){return ml(a),a.updateQueue=null,i=gg(a,c,i,m),mg(t),c=Ef(),t!==null&&!on?(Nf(t,a,b),ua(t,a,b)):(ct&&c&&rf(a),a.flags|=1,Sn(t,a,i,b),a.child)}function px(t,a,i,c,m){if(ml(a),a.stateNode===null){var b=ql,k=i.contextType;typeof k=="object"&&k!==null&&(b=kn(k)),b=new i(c,b),a.memoizedState=b.state!==null&&b.state!==void 0?b.state:null,b.updater=$f,a.stateNode=b,b._reactInternals=a,b=a.stateNode,b.props=c,b.state=a.memoizedState,b.refs={},mf(a),k=i.contextType,b.context=typeof k=="object"&&k!==null?kn(k):ql,b.state=a.memoizedState,k=i.getDerivedStateFromProps,typeof k=="function"&&(Uf(a,i,k,c),b.state=a.memoizedState),typeof i.getDerivedStateFromProps=="function"||typeof b.getSnapshotBeforeUpdate=="function"||typeof b.UNSAFE_componentWillMount!="function"&&typeof b.componentWillMount!="function"||(k=b.state,typeof b.componentWillMount=="function"&&b.componentWillMount(),typeof b.UNSAFE_componentWillMount=="function"&&b.UNSAFE_componentWillMount(),k!==b.state&&$f.enqueueReplaceState(b,b.state,null),rs(a,c,b,m),ns(),b.state=a.memoizedState),typeof b.componentDidMount=="function"&&(a.flags|=4194308),c=!0}else if(t===null){b=a.stateNode;var R=a.memoizedProps,$=wl(i,R);b.props=$;var W=b.context,oe=i.contextType;k=ql,typeof oe=="object"&&oe!==null&&(k=kn(oe));var fe=i.getDerivedStateFromProps;oe=typeof fe=="function"||typeof b.getSnapshotBeforeUpdate=="function",R=a.pendingProps!==R,oe||typeof b.UNSAFE_componentWillReceiveProps!="function"&&typeof b.componentWillReceiveProps!="function"||(R||W!==k)&&ex(a,b,c,k),Oa=!1;var J=a.memoizedState;b.state=J,rs(a,c,b,m),ns(),W=a.memoizedState,R||J!==W||Oa?(typeof fe=="function"&&(Uf(a,i,fe,c),W=a.memoizedState),($=Oa||Jg(a,i,$,c,J,W,k))?(oe||typeof b.UNSAFE_componentWillMount!="function"&&typeof b.componentWillMount!="function"||(typeof b.componentWillMount=="function"&&b.componentWillMount(),typeof b.UNSAFE_componentWillMount=="function"&&b.UNSAFE_componentWillMount()),typeof b.componentDidMount=="function"&&(a.flags|=4194308)):(typeof b.componentDidMount=="function"&&(a.flags|=4194308),a.memoizedProps=c,a.memoizedState=W),b.props=c,b.state=W,b.context=k,c=$):(typeof b.componentDidMount=="function"&&(a.flags|=4194308),c=!1)}else{b=a.stateNode,gf(t,a),k=a.memoizedProps,oe=wl(i,k),b.props=oe,fe=a.pendingProps,J=b.context,W=i.contextType,$=ql,typeof W=="object"&&W!==null&&($=kn(W)),R=i.getDerivedStateFromProps,(W=typeof R=="function"||typeof b.getSnapshotBeforeUpdate=="function")||typeof b.UNSAFE_componentWillReceiveProps!="function"&&typeof b.componentWillReceiveProps!="function"||(k!==fe||J!==$)&&ex(a,b,c,$),Oa=!1,J=a.memoizedState,b.state=J,rs(a,c,b,m),ns();var ne=a.memoizedState;k!==fe||J!==ne||Oa||t!==null&&t.dependencies!==null&&Do(t.dependencies)?(typeof R=="function"&&(Uf(a,i,R,c),ne=a.memoizedState),(oe=Oa||Jg(a,i,oe,c,J,ne,$)||t!==null&&t.dependencies!==null&&Do(t.dependencies))?(W||typeof b.UNSAFE_componentWillUpdate!="function"&&typeof b.componentWillUpdate!="function"||(typeof b.componentWillUpdate=="function"&&b.componentWillUpdate(c,ne,$),typeof b.UNSAFE_componentWillUpdate=="function"&&b.UNSAFE_componentWillUpdate(c,ne,$)),typeof b.componentDidUpdate=="function"&&(a.flags|=4),typeof b.getSnapshotBeforeUpdate=="function"&&(a.flags|=1024)):(typeof b.componentDidUpdate!="function"||k===t.memoizedProps&&J===t.memoizedState||(a.flags|=4),typeof b.getSnapshotBeforeUpdate!="function"||k===t.memoizedProps&&J===t.memoizedState||(a.flags|=1024),a.memoizedProps=c,a.memoizedState=ne),b.props=c,b.state=ne,b.context=$,c=oe):(typeof b.componentDidUpdate!="function"||k===t.memoizedProps&&J===t.memoizedState||(a.flags|=4),typeof b.getSnapshotBeforeUpdate!="function"||k===t.memoizedProps&&J===t.memoizedState||(a.flags|=1024),c=!1)}return b=c,Jo(t,a),c=(a.flags&128)!==0,b||c?(b=a.stateNode,i=c&&typeof i.getDerivedStateFromError!="function"?null:b.render(),a.flags|=1,t!==null&&c?(a.child=yl(a,t.child,null,m),a.child=yl(a,null,i,m)):Sn(t,a,i,m),a.memoizedState=b.state,t=a.child):t=ua(t,a,m),t}function mx(t,a,i,c){return hl(),a.flags|=256,Sn(t,a,i,c),a.child}var Gf={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function qf(t){return{baseLanes:t,cachePool:ag()}}function Yf(t,a,i){return t=t!==null?t.childLanes&~i:0,a&&(t|=or),t}function gx(t,a,i){var c=a.pendingProps,m=!1,b=(a.flags&128)!==0,k;if((k=b)||(k=t!==null&&t.memoizedState===null?!1:(tn.current&2)!==0),k&&(m=!0,a.flags&=-129),k=(a.flags&32)!==0,a.flags&=-33,t===null){if(ct){if(m?La(a):Ba(),(t=Pt)?(t=Eb(t,wr),t=t!==null&&t.data!=="&"?t:null,t!==null&&(a.memoizedState={dehydrated:t,treeContext:Ca!==null?{id:Pr,overflow:Fr}:null,retryLane:536870912,hydrationErrors:null},i=Km(t),i.return=a,a.child=i,wn=a,Pt=null)):t=null,t===null)throw ja(a);return Ad(t)?a.lanes=32:a.lanes=536870912,null}var R=c.children;return c=c.fallback,m?(Ba(),m=a.mode,R=eu({mode:"hidden",children:R},m),c=dl(c,m,i,null),R.return=a,c.return=a,R.sibling=c,a.child=R,c=a.child,c.memoizedState=qf(i),c.childLanes=Yf(t,k,i),a.memoizedState=Gf,os(null,c)):(La(a),Vf(a,R))}var $=t.memoizedState;if($!==null&&(R=$.dehydrated,R!==null)){if(b)a.flags&256?(La(a),a.flags&=-257,a=Xf(t,a,i)):a.memoizedState!==null?(Ba(),a.child=t.child,a.flags|=128,a=null):(Ba(),R=c.fallback,m=a.mode,c=eu({mode:"visible",children:c.children},m),R=dl(R,m,i,null),R.flags|=2,c.return=a,R.return=a,c.sibling=R,a.child=c,yl(a,t.child,null,i),c=a.child,c.memoizedState=qf(i),c.childLanes=Yf(t,k,i),a.memoizedState=Gf,a=os(null,c));else if(La(a),Ad(R)){if(k=R.nextSibling&&R.nextSibling.dataset,k)var W=k.dgst;k=W,c=Error(l(419)),c.stack="",c.digest=k,Zi({value:c,source:null,stack:null}),a=Xf(t,a,i)}else if(on||Kl(t,a,i,!1),k=(i&t.childLanes)!==0,on||k){if(k=Dt,k!==null&&(c=$t(k,i),c!==0&&c!==$.retryLane))throw $.retryLane=c,fl(t,c),Kn(k,t,c),Pf;Td(R)||uu(),a=Xf(t,a,i)}else Td(R)?(a.flags|=192,a.child=t.child,a=null):(t=$.treeContext,Pt=Sr(R.nextSibling),wn=a,ct=!0,Ra=null,wr=!1,t!==null&&Wm(a,t),a=Vf(a,c.children),a.flags|=4096);return a}return m?(Ba(),R=c.fallback,m=a.mode,$=t.child,W=$.sibling,c=ra($,{mode:"hidden",children:c.children}),c.subtreeFlags=$.subtreeFlags&65011712,W!==null?R=ra(W,R):(R=dl(R,m,i,null),R.flags|=2),R.return=a,c.return=a,c.sibling=R,a.child=c,os(null,c),c=a.child,R=t.child.memoizedState,R===null?R=qf(i):(m=R.cachePool,m!==null?($=ln._currentValue,m=m.parent!==$?{parent:$,pool:$}:m):m=ag(),R={baseLanes:R.baseLanes|i,cachePool:m}),c.memoizedState=R,c.childLanes=Yf(t,k,i),a.memoizedState=Gf,os(t.child,c)):(La(a),i=t.child,t=i.sibling,i=ra(i,{mode:"visible",children:c.children}),i.return=a,i.sibling=null,t!==null&&(k=a.deletions,k===null?(a.deletions=[t],a.flags|=16):k.push(t)),a.child=i,a.memoizedState=null,i)}function Vf(t,a){return a=eu({mode:"visible",children:a},t.mode),a.return=t,t.child=a}function eu(t,a){return t=ar(22,t,null,a),t.lanes=0,t}function Xf(t,a,i){return yl(a,t.child,null,i),t=Vf(a,a.pendingProps.children),t.flags|=2,a.memoizedState=null,t}function xx(t,a,i){t.lanes|=a;var c=t.alternate;c!==null&&(c.lanes|=a),uf(t.return,a,i)}function Kf(t,a,i,c,m,b){var k=t.memoizedState;k===null?t.memoizedState={isBackwards:a,rendering:null,renderingStartTime:0,last:c,tail:i,tailMode:m,treeForkCount:b}:(k.isBackwards=a,k.rendering=null,k.renderingStartTime=0,k.last=c,k.tail=i,k.tailMode=m,k.treeForkCount=b)}function bx(t,a,i){var c=a.pendingProps,m=c.revealOrder,b=c.tail;c=c.children;var k=tn.current,R=(k&2)!==0;if(R?(k=k&1|2,a.flags|=128):k&=1,A(tn,k),Sn(t,a,c,i),c=ct?Ki:0,!R&&t!==null&&(t.flags&128)!==0)e:for(t=a.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&xx(t,i,a);else if(t.tag===19)xx(t,i,a);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===a)break e;for(;t.sibling===null;){if(t.return===null||t.return===a)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}switch(m){case"forwards":for(i=a.child,m=null;i!==null;)t=i.alternate,t!==null&&Po(t)===null&&(m=i),i=i.sibling;i=m,i===null?(m=a.child,a.child=null):(m=i.sibling,i.sibling=null),Kf(a,!1,m,i,b,c);break;case"backwards":case"unstable_legacy-backwards":for(i=null,m=a.child,a.child=null;m!==null;){if(t=m.alternate,t!==null&&Po(t)===null){a.child=m;break}t=m.sibling,m.sibling=i,i=m,m=t}Kf(a,!0,i,null,b,c);break;case"together":Kf(a,!1,null,null,void 0,c);break;default:a.memoizedState=null}return a.child}function ua(t,a,i){if(t!==null&&(a.dependencies=t.dependencies),$a|=a.lanes,(i&a.childLanes)===0)if(t!==null){if(Kl(t,a,i,!1),(i&a.childLanes)===0)return null}else return null;if(t!==null&&a.child!==t.child)throw Error(l(153));if(a.child!==null){for(t=a.child,i=ra(t,t.pendingProps),a.child=i,i.return=a;t.sibling!==null;)t=t.sibling,i=i.sibling=ra(t,t.pendingProps),i.return=a;i.sibling=null}return a.child}function Zf(t,a){return(t.lanes&a)!==0?!0:(t=t.dependencies,!!(t!==null&&Do(t)))}function VS(t,a,i){switch(a.tag){case 3:je(a,a.stateNode.containerInfo),Ma(a,ln,t.memoizedState.cache),hl();break;case 27:case 5:qe(a);break;case 4:je(a,a.stateNode.containerInfo);break;case 10:Ma(a,a.type,a.memoizedProps.value);break;case 31:if(a.memoizedState!==null)return a.flags|=128,wf(a),null;break;case 13:var c=a.memoizedState;if(c!==null)return c.dehydrated!==null?(La(a),a.flags|=128,null):(i&a.child.childLanes)!==0?gx(t,a,i):(La(a),t=ua(t,a,i),t!==null?t.sibling:null);La(a);break;case 19:var m=(t.flags&128)!==0;if(c=(i&a.childLanes)!==0,c||(Kl(t,a,i,!1),c=(i&a.childLanes)!==0),m){if(c)return bx(t,a,i);a.flags|=128}if(m=a.memoizedState,m!==null&&(m.rendering=null,m.tail=null,m.lastEffect=null),A(tn,tn.current),c)break;return null;case 22:return a.lanes=0,cx(t,a,i,a.pendingProps);case 24:Ma(a,ln,t.memoizedState.cache)}return ua(t,a,i)}function yx(t,a,i){if(t!==null)if(t.memoizedProps!==a.pendingProps)on=!0;else{if(!Zf(t,i)&&(a.flags&128)===0)return on=!1,VS(t,a,i);on=(t.flags&131072)!==0}else on=!1,ct&&(a.flags&1048576)!==0&&Qm(a,Ki,a.index);switch(a.lanes=0,a.tag){case 16:e:{var c=a.pendingProps;if(t=xl(a.elementType),a.type=t,typeof t=="function")ef(t)?(c=wl(t,c),a.tag=1,a=px(null,a,t,c,i)):(a.tag=0,a=Ff(null,a,t,c,i));else{if(t!=null){var m=t.$$typeof;if(m===I){a.tag=11,a=sx(null,a,t,c,i);break e}else if(m===z){a.tag=14,a=ox(null,a,t,c,i);break e}}throw a=ae(t)||t,Error(l(306,a,""))}}return a;case 0:return Ff(t,a,a.type,a.pendingProps,i);case 1:return c=a.type,m=wl(c,a.pendingProps),px(t,a,c,m,i);case 3:e:{if(je(a,a.stateNode.containerInfo),t===null)throw Error(l(387));c=a.pendingProps;var b=a.memoizedState;m=b.element,gf(t,a),rs(a,c,null,i);var k=a.memoizedState;if(c=k.cache,Ma(a,ln,c),c!==b.cache&&cf(a,[ln],i,!0),ns(),c=k.element,b.isDehydrated)if(b={element:c,isDehydrated:!1,cache:k.cache},a.updateQueue.baseState=b,a.memoizedState=b,a.flags&256){a=mx(t,a,c,i);break e}else if(c!==m){m=br(Error(l(424)),a),Zi(m),a=mx(t,a,c,i);break e}else for(t=a.stateNode.containerInfo,t.nodeType===9?t=t.body:t=t.nodeName==="HTML"?t.ownerDocument.body:t,Pt=Sr(t.firstChild),wn=a,ct=!0,Ra=null,wr=!0,i=cg(a,null,c,i),a.child=i;i;)i.flags=i.flags&-3|4096,i=i.sibling;else{if(hl(),c===m){a=ua(t,a,i);break e}Sn(t,a,c,i)}a=a.child}return a;case 26:return Jo(t,a),t===null?(i=Rb(a.type,null,a.pendingProps,null))?a.memoizedState=i:ct||(i=a.type,t=a.pendingProps,c=gu(ie.current).createElement(i),c[Bt]=a,c[ve]=t,En(c,i,t),Ze(c),a.stateNode=c):a.memoizedState=Rb(a.type,t.memoizedProps,a.pendingProps,t.memoizedState),null;case 27:return qe(a),t===null&&ct&&(c=a.stateNode=Tb(a.type,a.pendingProps,ie.current),wn=a,wr=!0,m=Pt,qa(a.type)?(Cd=m,Pt=Sr(c.firstChild)):Pt=m),Sn(t,a,a.pendingProps.children,i),Jo(t,a),t===null&&(a.flags|=4194304),a.child;case 5:return t===null&&ct&&((m=c=Pt)&&(c=SE(c,a.type,a.pendingProps,wr),c!==null?(a.stateNode=c,wn=a,Pt=Sr(c.firstChild),wr=!1,m=!0):m=!1),m||ja(a)),qe(a),m=a.type,b=a.pendingProps,k=t!==null?t.memoizedProps:null,c=b.children,Ed(m,b)?c=null:k!==null&&Ed(m,k)&&(a.flags|=32),a.memoizedState!==null&&(m=Sf(t,a,IS,null,null,i),Ss._currentValue=m),Jo(t,a),Sn(t,a,c,i),a.child;case 6:return t===null&&ct&&((t=i=Pt)&&(i=EE(i,a.pendingProps,wr),i!==null?(a.stateNode=i,wn=a,Pt=null,t=!0):t=!1),t||ja(a)),null;case 13:return gx(t,a,i);case 4:return je(a,a.stateNode.containerInfo),c=a.pendingProps,t===null?a.child=yl(a,null,c,i):Sn(t,a,c,i),a.child;case 11:return sx(t,a,a.type,a.pendingProps,i);case 7:return Sn(t,a,a.pendingProps,i),a.child;case 8:return Sn(t,a,a.pendingProps.children,i),a.child;case 12:return Sn(t,a,a.pendingProps.children,i),a.child;case 10:return c=a.pendingProps,Ma(a,a.type,c.value),Sn(t,a,c.children,i),a.child;case 9:return m=a.type._context,c=a.pendingProps.children,ml(a),m=kn(m),c=c(m),a.flags|=1,Sn(t,a,c,i),a.child;case 14:return ox(t,a,a.type,a.pendingProps,i);case 15:return ux(t,a,a.type,a.pendingProps,i);case 19:return bx(t,a,i);case 31:return YS(t,a,i);case 22:return cx(t,a,i,a.pendingProps);case 24:return ml(a),c=kn(ln),t===null?(m=hf(),m===null&&(m=Dt,b=ff(),m.pooledCache=b,b.refCount++,b!==null&&(m.pooledCacheLanes|=i),m=b),a.memoizedState={parent:c,cache:m},mf(a),Ma(a,ln,m)):((t.lanes&i)!==0&&(gf(t,a),rs(a,null,null,i),ns()),m=t.memoizedState,b=a.memoizedState,m.parent!==c?(m={parent:c,cache:c},a.memoizedState=m,a.lanes===0&&(a.memoizedState=a.updateQueue.baseState=m),Ma(a,ln,c)):(c=b.cache,Ma(a,ln,c),c!==m.cache&&cf(a,[ln],i,!0))),Sn(t,a,a.pendingProps.children,i),a.child;case 29:throw a.pendingProps}throw Error(l(156,a.tag))}function ca(t){t.flags|=4}function Qf(t,a,i,c,m){if((a=(t.mode&32)!==0)&&(a=!1),a){if(t.flags|=16777216,(m&335544128)===m)if(t.stateNode.complete)t.flags|=8192;else if(Yx())t.flags|=8192;else throw bl=Io,pf}else t.flags&=-16777217}function vx(t,a){if(a.type!=="stylesheet"||(a.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!zb(a))if(Yx())t.flags|=8192;else throw bl=Io,pf}function tu(t,a){a!==null&&(t.flags|=4),t.flags&16384&&(a=t.tag!==22?Le():536870912,t.lanes|=a,si|=a)}function us(t,a){if(!ct)switch(t.tailMode){case"hidden":a=t.tail;for(var i=null;a!==null;)a.alternate!==null&&(i=a),a=a.sibling;i===null?t.tail=null:i.sibling=null;break;case"collapsed":i=t.tail;for(var c=null;i!==null;)i.alternate!==null&&(c=i),i=i.sibling;c===null?a||t.tail===null?t.tail=null:t.tail.sibling=null:c.sibling=null}}function Ft(t){var a=t.alternate!==null&&t.alternate.child===t.child,i=0,c=0;if(a)for(var m=t.child;m!==null;)i|=m.lanes|m.childLanes,c|=m.subtreeFlags&65011712,c|=m.flags&65011712,m.return=t,m=m.sibling;else for(m=t.child;m!==null;)i|=m.lanes|m.childLanes,c|=m.subtreeFlags,c|=m.flags,m.return=t,m=m.sibling;return t.subtreeFlags|=c,t.childLanes=i,a}function XS(t,a,i){var c=a.pendingProps;switch(af(a),a.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ft(a),null;case 1:return Ft(a),null;case 3:return i=a.stateNode,c=null,t!==null&&(c=t.memoizedState.cache),a.memoizedState.cache!==c&&(a.flags|=2048),ia(ln),Ae(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(t===null||t.child===null)&&(Xl(a)?ca(a):t===null||t.memoizedState.isDehydrated&&(a.flags&256)===0||(a.flags|=1024,sf())),Ft(a),null;case 26:var m=a.type,b=a.memoizedState;return t===null?(ca(a),b!==null?(Ft(a),vx(a,b)):(Ft(a),Qf(a,m,null,c,i))):b?b!==t.memoizedState?(ca(a),Ft(a),vx(a,b)):(Ft(a),a.flags&=-16777217):(t=t.memoizedProps,t!==c&&ca(a),Ft(a),Qf(a,m,t,c,i)),null;case 27:if(we(a),i=ie.current,m=a.type,t!==null&&a.stateNode!=null)t.memoizedProps!==c&&ca(a);else{if(!c){if(a.stateNode===null)throw Error(l(166));return Ft(a),null}t=se.current,Xl(a)?Jm(a):(t=Tb(m,c,i),a.stateNode=t,ca(a))}return Ft(a),null;case 5:if(we(a),m=a.type,t!==null&&a.stateNode!=null)t.memoizedProps!==c&&ca(a);else{if(!c){if(a.stateNode===null)throw Error(l(166));return Ft(a),null}if(b=se.current,Xl(a))Jm(a);else{var k=gu(ie.current);switch(b){case 1:b=k.createElementNS("http://www.w3.org/2000/svg",m);break;case 2:b=k.createElementNS("http://www.w3.org/1998/Math/MathML",m);break;default:switch(m){case"svg":b=k.createElementNS("http://www.w3.org/2000/svg",m);break;case"math":b=k.createElementNS("http://www.w3.org/1998/Math/MathML",m);break;case"script":b=k.createElement("div"),b.innerHTML="<script><\/script>",b=b.removeChild(b.firstChild);break;case"select":b=typeof c.is=="string"?k.createElement("select",{is:c.is}):k.createElement("select"),c.multiple?b.multiple=!0:c.size&&(b.size=c.size);break;default:b=typeof c.is=="string"?k.createElement(m,{is:c.is}):k.createElement(m)}}b[Bt]=a,b[ve]=c;e:for(k=a.child;k!==null;){if(k.tag===5||k.tag===6)b.appendChild(k.stateNode);else if(k.tag!==4&&k.tag!==27&&k.child!==null){k.child.return=k,k=k.child;continue}if(k===a)break e;for(;k.sibling===null;){if(k.return===null||k.return===a)break e;k=k.return}k.sibling.return=k.return,k=k.sibling}a.stateNode=b;e:switch(En(b,m,c),m){case"button":case"input":case"select":case"textarea":c=!!c.autoFocus;break e;case"img":c=!0;break e;default:c=!1}c&&ca(a)}}return Ft(a),Qf(a,a.type,t===null?null:t.memoizedProps,a.pendingProps,i),null;case 6:if(t&&a.stateNode!=null)t.memoizedProps!==c&&ca(a);else{if(typeof c!="string"&&a.stateNode===null)throw Error(l(166));if(t=ie.current,Xl(a)){if(t=a.stateNode,i=a.memoizedProps,c=null,m=wn,m!==null)switch(m.tag){case 27:case 5:c=m.memoizedProps}t[Bt]=a,t=!!(t.nodeValue===i||c!==null&&c.suppressHydrationWarning===!0||gb(t.nodeValue,i)),t||ja(a,!0)}else t=gu(t).createTextNode(c),t[Bt]=a,a.stateNode=t}return Ft(a),null;case 31:if(i=a.memoizedState,t===null||t.memoizedState!==null){if(c=Xl(a),i!==null){if(t===null){if(!c)throw Error(l(318));if(t=a.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(l(557));t[Bt]=a}else hl(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;Ft(a),t=!1}else i=sf(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=i),t=!0;if(!t)return a.flags&256?(ir(a),a):(ir(a),null);if((a.flags&128)!==0)throw Error(l(558))}return Ft(a),null;case 13:if(c=a.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(m=Xl(a),c!==null&&c.dehydrated!==null){if(t===null){if(!m)throw Error(l(318));if(m=a.memoizedState,m=m!==null?m.dehydrated:null,!m)throw Error(l(317));m[Bt]=a}else hl(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;Ft(a),m=!1}else m=sf(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=m),m=!0;if(!m)return a.flags&256?(ir(a),a):(ir(a),null)}return ir(a),(a.flags&128)!==0?(a.lanes=i,a):(i=c!==null,t=t!==null&&t.memoizedState!==null,i&&(c=a.child,m=null,c.alternate!==null&&c.alternate.memoizedState!==null&&c.alternate.memoizedState.cachePool!==null&&(m=c.alternate.memoizedState.cachePool.pool),b=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(b=c.memoizedState.cachePool.pool),b!==m&&(c.flags|=2048)),i!==t&&i&&(a.child.flags|=8192),tu(a,a.updateQueue),Ft(a),null);case 4:return Ae(),t===null&&yd(a.stateNode.containerInfo),Ft(a),null;case 10:return ia(a.type),Ft(a),null;case 19:if(L(tn),c=a.memoizedState,c===null)return Ft(a),null;if(m=(a.flags&128)!==0,b=c.rendering,b===null)if(m)us(c,!1);else{if(Qt!==0||t!==null&&(t.flags&128)!==0)for(t=a.child;t!==null;){if(b=Po(t),b!==null){for(a.flags|=128,us(c,!1),t=b.updateQueue,a.updateQueue=t,tu(a,t),a.subtreeFlags=0,t=i,i=a.child;i!==null;)Xm(i,t),i=i.sibling;return A(tn,tn.current&1|2),ct&&aa(a,c.treeForkCount),a.child}t=t.sibling}c.tail!==null&&Et()>iu&&(a.flags|=128,m=!0,us(c,!1),a.lanes=4194304)}else{if(!m)if(t=Po(b),t!==null){if(a.flags|=128,m=!0,t=t.updateQueue,a.updateQueue=t,tu(a,t),us(c,!0),c.tail===null&&c.tailMode==="hidden"&&!b.alternate&&!ct)return Ft(a),null}else 2*Et()-c.renderingStartTime>iu&&i!==536870912&&(a.flags|=128,m=!0,us(c,!1),a.lanes=4194304);c.isBackwards?(b.sibling=a.child,a.child=b):(t=c.last,t!==null?t.sibling=b:a.child=b,c.last=b)}return c.tail!==null?(t=c.tail,c.rendering=t,c.tail=t.sibling,c.renderingStartTime=Et(),t.sibling=null,i=tn.current,A(tn,m?i&1|2:i&1),ct&&aa(a,c.treeForkCount),t):(Ft(a),null);case 22:case 23:return ir(a),vf(),c=a.memoizedState!==null,t!==null?t.memoizedState!==null!==c&&(a.flags|=8192):c&&(a.flags|=8192),c?(i&536870912)!==0&&(a.flags&128)===0&&(Ft(a),a.subtreeFlags&6&&(a.flags|=8192)):Ft(a),i=a.updateQueue,i!==null&&tu(a,i.retryQueue),i=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(i=t.memoizedState.cachePool.pool),c=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(c=a.memoizedState.cachePool.pool),c!==i&&(a.flags|=2048),t!==null&&L(gl),null;case 24:return i=null,t!==null&&(i=t.memoizedState.cache),a.memoizedState.cache!==i&&(a.flags|=2048),ia(ln),Ft(a),null;case 25:return null;case 30:return null}throw Error(l(156,a.tag))}function KS(t,a){switch(af(a),a.tag){case 1:return t=a.flags,t&65536?(a.flags=t&-65537|128,a):null;case 3:return ia(ln),Ae(),t=a.flags,(t&65536)!==0&&(t&128)===0?(a.flags=t&-65537|128,a):null;case 26:case 27:case 5:return we(a),null;case 31:if(a.memoizedState!==null){if(ir(a),a.alternate===null)throw Error(l(340));hl()}return t=a.flags,t&65536?(a.flags=t&-65537|128,a):null;case 13:if(ir(a),t=a.memoizedState,t!==null&&t.dehydrated!==null){if(a.alternate===null)throw Error(l(340));hl()}return t=a.flags,t&65536?(a.flags=t&-65537|128,a):null;case 19:return L(tn),null;case 4:return Ae(),null;case 10:return ia(a.type),null;case 22:case 23:return ir(a),vf(),t!==null&&L(gl),t=a.flags,t&65536?(a.flags=t&-65537|128,a):null;case 24:return ia(ln),null;case 25:return null;default:return null}}function wx(t,a){switch(af(a),a.tag){case 3:ia(ln),Ae();break;case 26:case 27:case 5:we(a);break;case 4:Ae();break;case 31:a.memoizedState!==null&&ir(a);break;case 13:ir(a);break;case 19:L(tn);break;case 10:ia(a.type);break;case 22:case 23:ir(a),vf(),t!==null&&L(gl);break;case 24:ia(ln)}}function cs(t,a){try{var i=a.updateQueue,c=i!==null?i.lastEffect:null;if(c!==null){var m=c.next;i=m;do{if((i.tag&t)===t){c=void 0;var b=i.create,k=i.inst;c=b(),k.destroy=c}i=i.next}while(i!==m)}}catch(R){Tt(a,a.return,R)}}function Ia(t,a,i){try{var c=a.updateQueue,m=c!==null?c.lastEffect:null;if(m!==null){var b=m.next;c=b;do{if((c.tag&t)===t){var k=c.inst,R=k.destroy;if(R!==void 0){k.destroy=void 0,m=a;var $=i,W=R;try{W()}catch(oe){Tt(m,$,oe)}}}c=c.next}while(c!==b)}}catch(oe){Tt(a,a.return,oe)}}function kx(t){var a=t.updateQueue;if(a!==null){var i=t.stateNode;try{dg(a,i)}catch(c){Tt(t,t.return,c)}}}function Sx(t,a,i){i.props=wl(t.type,t.memoizedProps),i.state=t.memoizedState;try{i.componentWillUnmount()}catch(c){Tt(t,a,c)}}function fs(t,a){try{var i=t.ref;if(i!==null){switch(t.tag){case 26:case 27:case 5:var c=t.stateNode;break;case 30:c=t.stateNode;break;default:c=t.stateNode}typeof i=="function"?t.refCleanup=i(c):i.current=c}}catch(m){Tt(t,a,m)}}function Gr(t,a){var i=t.ref,c=t.refCleanup;if(i!==null)if(typeof c=="function")try{c()}catch(m){Tt(t,a,m)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof i=="function")try{i(null)}catch(m){Tt(t,a,m)}else i.current=null}function Ex(t){var a=t.type,i=t.memoizedProps,c=t.stateNode;try{e:switch(a){case"button":case"input":case"select":case"textarea":i.autoFocus&&c.focus();break e;case"img":i.src?c.src=i.src:i.srcSet&&(c.srcset=i.srcSet)}}catch(m){Tt(t,t.return,m)}}function Wf(t,a,i){try{var c=t.stateNode;xE(c,t.type,i,a),c[ve]=a}catch(m){Tt(t,t.return,m)}}function Nx(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&qa(t.type)||t.tag===4}function Jf(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||Nx(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&qa(t.type)||t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function ed(t,a,i){var c=t.tag;if(c===5||c===6)t=t.stateNode,a?(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i).insertBefore(t,a):(a=i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,a.appendChild(t),i=i._reactRootContainer,i!=null||a.onclick!==null||(a.onclick=ke));else if(c!==4&&(c===27&&qa(t.type)&&(i=t.stateNode,a=null),t=t.child,t!==null))for(ed(t,a,i),t=t.sibling;t!==null;)ed(t,a,i),t=t.sibling}function nu(t,a,i){var c=t.tag;if(c===5||c===6)t=t.stateNode,a?i.insertBefore(t,a):i.appendChild(t);else if(c!==4&&(c===27&&qa(t.type)&&(i=t.stateNode),t=t.child,t!==null))for(nu(t,a,i),t=t.sibling;t!==null;)nu(t,a,i),t=t.sibling}function _x(t){var a=t.stateNode,i=t.memoizedProps;try{for(var c=t.type,m=a.attributes;m.length;)a.removeAttributeNode(m[0]);En(a,c,i),a[Bt]=t,a[ve]=i}catch(b){Tt(t,t.return,b)}}var fa=!1,un=!1,td=!1,Tx=typeof WeakSet=="function"?WeakSet:Set,mn=null;function ZS(t,a){if(t=t.containerInfo,kd=Su,t=Um(t),Vc(t)){if("selectionStart"in t)var i={start:t.selectionStart,end:t.selectionEnd};else e:{i=(i=t.ownerDocument)&&i.defaultView||window;var c=i.getSelection&&i.getSelection();if(c&&c.rangeCount!==0){i=c.anchorNode;var m=c.anchorOffset,b=c.focusNode;c=c.focusOffset;try{i.nodeType,b.nodeType}catch{i=null;break e}var k=0,R=-1,$=-1,W=0,oe=0,fe=t,J=null;t:for(;;){for(var ne;fe!==i||m!==0&&fe.nodeType!==3||(R=k+m),fe!==b||c!==0&&fe.nodeType!==3||($=k+c),fe.nodeType===3&&(k+=fe.nodeValue.length),(ne=fe.firstChild)!==null;)J=fe,fe=ne;for(;;){if(fe===t)break t;if(J===i&&++W===m&&(R=k),J===b&&++oe===c&&($=k),(ne=fe.nextSibling)!==null)break;fe=J,J=fe.parentNode}fe=ne}i=R===-1||$===-1?null:{start:R,end:$}}else i=null}i=i||{start:0,end:0}}else i=null;for(Sd={focusedElem:t,selectionRange:i},Su=!1,mn=a;mn!==null;)if(a=mn,t=a.child,(a.subtreeFlags&1028)!==0&&t!==null)t.return=a,mn=t;else for(;mn!==null;){switch(a=mn,b=a.alternate,t=a.flags,a.tag){case 0:if((t&4)!==0&&(t=a.updateQueue,t=t!==null?t.events:null,t!==null))for(i=0;i<t.length;i++)m=t[i],m.ref.impl=m.nextImpl;break;case 11:case 15:break;case 1:if((t&1024)!==0&&b!==null){t=void 0,i=a,m=b.memoizedProps,b=b.memoizedState,c=i.stateNode;try{var Re=wl(i.type,m);t=c.getSnapshotBeforeUpdate(Re,b),c.__reactInternalSnapshotBeforeUpdate=t}catch(He){Tt(i,i.return,He)}}break;case 3:if((t&1024)!==0){if(t=a.stateNode.containerInfo,i=t.nodeType,i===9)_d(t);else if(i===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":_d(t);break;default:t.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((t&1024)!==0)throw Error(l(163))}if(t=a.sibling,t!==null){t.return=a.return,mn=t;break}mn=a.return}}function Ax(t,a,i){var c=i.flags;switch(i.tag){case 0:case 11:case 15:ha(t,i),c&4&&cs(5,i);break;case 1:if(ha(t,i),c&4)if(t=i.stateNode,a===null)try{t.componentDidMount()}catch(k){Tt(i,i.return,k)}else{var m=wl(i.type,a.memoizedProps);a=a.memoizedState;try{t.componentDidUpdate(m,a,t.__reactInternalSnapshotBeforeUpdate)}catch(k){Tt(i,i.return,k)}}c&64&&kx(i),c&512&&fs(i,i.return);break;case 3:if(ha(t,i),c&64&&(t=i.updateQueue,t!==null)){if(a=null,i.child!==null)switch(i.child.tag){case 27:case 5:a=i.child.stateNode;break;case 1:a=i.child.stateNode}try{dg(t,a)}catch(k){Tt(i,i.return,k)}}break;case 27:a===null&&c&4&&_x(i);case 26:case 5:ha(t,i),a===null&&c&4&&Ex(i),c&512&&fs(i,i.return);break;case 12:ha(t,i);break;case 31:ha(t,i),c&4&&jx(t,i);break;case 13:ha(t,i),c&4&&Mx(t,i),c&64&&(t=i.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(i=lE.bind(null,i),NE(t,i))));break;case 22:if(c=i.memoizedState!==null||fa,!c){a=a!==null&&a.memoizedState!==null||un,m=fa;var b=un;fa=c,(un=a)&&!b?pa(t,i,(i.subtreeFlags&8772)!==0):ha(t,i),fa=m,un=b}break;case 30:break;default:ha(t,i)}}function Cx(t){var a=t.alternate;a!==null&&(t.alternate=null,Cx(a)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(a=t.stateNode,a!==null&&F(a)),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}var Yt=null,qn=!1;function da(t,a,i){for(i=i.child;i!==null;)Rx(t,a,i),i=i.sibling}function Rx(t,a,i){if(mt&&typeof mt.onCommitFiberUnmount=="function")try{mt.onCommitFiberUnmount(qt,i)}catch{}switch(i.tag){case 26:un||Gr(i,a),da(t,a,i),i.memoizedState?i.memoizedState.count--:i.stateNode&&(i=i.stateNode,i.parentNode.removeChild(i));break;case 27:un||Gr(i,a);var c=Yt,m=qn;qa(i.type)&&(Yt=i.stateNode,qn=!1),da(t,a,i),vs(i.stateNode),Yt=c,qn=m;break;case 5:un||Gr(i,a);case 6:if(c=Yt,m=qn,Yt=null,da(t,a,i),Yt=c,qn=m,Yt!==null)if(qn)try{(Yt.nodeType===9?Yt.body:Yt.nodeName==="HTML"?Yt.ownerDocument.body:Yt).removeChild(i.stateNode)}catch(b){Tt(i,a,b)}else try{Yt.removeChild(i.stateNode)}catch(b){Tt(i,a,b)}break;case 18:Yt!==null&&(qn?(t=Yt,kb(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,i.stateNode),mi(t)):kb(Yt,i.stateNode));break;case 4:c=Yt,m=qn,Yt=i.stateNode.containerInfo,qn=!0,da(t,a,i),Yt=c,qn=m;break;case 0:case 11:case 14:case 15:Ia(2,i,a),un||Ia(4,i,a),da(t,a,i);break;case 1:un||(Gr(i,a),c=i.stateNode,typeof c.componentWillUnmount=="function"&&Sx(i,a,c)),da(t,a,i);break;case 21:da(t,a,i);break;case 22:un=(c=un)||i.memoizedState!==null,da(t,a,i),un=c;break;default:da(t,a,i)}}function jx(t,a){if(a.memoizedState===null&&(t=a.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{mi(t)}catch(i){Tt(a,a.return,i)}}}function Mx(t,a){if(a.memoizedState===null&&(t=a.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{mi(t)}catch(i){Tt(a,a.return,i)}}function QS(t){switch(t.tag){case 31:case 13:case 19:var a=t.stateNode;return a===null&&(a=t.stateNode=new Tx),a;case 22:return t=t.stateNode,a=t._retryCache,a===null&&(a=t._retryCache=new Tx),a;default:throw Error(l(435,t.tag))}}function ru(t,a){var i=QS(t);a.forEach(function(c){if(!i.has(c)){i.add(c);var m=iE.bind(null,t,c);c.then(m,m)}})}function Yn(t,a){var i=a.deletions;if(i!==null)for(var c=0;c<i.length;c++){var m=i[c],b=t,k=a,R=k;e:for(;R!==null;){switch(R.tag){case 27:if(qa(R.type)){Yt=R.stateNode,qn=!1;break e}break;case 5:Yt=R.stateNode,qn=!1;break e;case 3:case 4:Yt=R.stateNode.containerInfo,qn=!0;break e}R=R.return}if(Yt===null)throw Error(l(160));Rx(b,k,m),Yt=null,qn=!1,b=m.alternate,b!==null&&(b.return=null),m.return=null}if(a.subtreeFlags&13886)for(a=a.child;a!==null;)Ox(a,t),a=a.sibling}var jr=null;function Ox(t,a){var i=t.alternate,c=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:Yn(a,t),Vn(t),c&4&&(Ia(3,t,t.return),cs(3,t),Ia(5,t,t.return));break;case 1:Yn(a,t),Vn(t),c&512&&(un||i===null||Gr(i,i.return)),c&64&&fa&&(t=t.updateQueue,t!==null&&(c=t.callbacks,c!==null&&(i=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=i===null?c:i.concat(c))));break;case 26:var m=jr;if(Yn(a,t),Vn(t),c&512&&(un||i===null||Gr(i,i.return)),c&4){var b=i!==null?i.memoizedState:null;if(c=t.memoizedState,i===null)if(c===null)if(t.stateNode===null){e:{c=t.type,i=t.memoizedProps,m=m.ownerDocument||m;t:switch(c){case"title":b=m.getElementsByTagName("title")[0],(!b||b[Oe]||b[Bt]||b.namespaceURI==="http://www.w3.org/2000/svg"||b.hasAttribute("itemprop"))&&(b=m.createElement(c),m.head.insertBefore(b,m.querySelector("head > title"))),En(b,c,i),b[Bt]=t,Ze(b),c=b;break e;case"link":var k=Ob("link","href",m).get(c+(i.href||""));if(k){for(var R=0;R<k.length;R++)if(b=k[R],b.getAttribute("href")===(i.href==null||i.href===""?null:i.href)&&b.getAttribute("rel")===(i.rel==null?null:i.rel)&&b.getAttribute("title")===(i.title==null?null:i.title)&&b.getAttribute("crossorigin")===(i.crossOrigin==null?null:i.crossOrigin)){k.splice(R,1);break t}}b=m.createElement(c),En(b,c,i),m.head.appendChild(b);break;case"meta":if(k=Ob("meta","content",m).get(c+(i.content||""))){for(R=0;R<k.length;R++)if(b=k[R],b.getAttribute("content")===(i.content==null?null:""+i.content)&&b.getAttribute("name")===(i.name==null?null:i.name)&&b.getAttribute("property")===(i.property==null?null:i.property)&&b.getAttribute("http-equiv")===(i.httpEquiv==null?null:i.httpEquiv)&&b.getAttribute("charset")===(i.charSet==null?null:i.charSet)){k.splice(R,1);break t}}b=m.createElement(c),En(b,c,i),m.head.appendChild(b);break;default:throw Error(l(468,c))}b[Bt]=t,Ze(b),c=b}t.stateNode=c}else Db(m,t.type,t.stateNode);else t.stateNode=Mb(m,c,t.memoizedProps);else b!==c?(b===null?i.stateNode!==null&&(i=i.stateNode,i.parentNode.removeChild(i)):b.count--,c===null?Db(m,t.type,t.stateNode):Mb(m,c,t.memoizedProps)):c===null&&t.stateNode!==null&&Wf(t,t.memoizedProps,i.memoizedProps)}break;case 27:Yn(a,t),Vn(t),c&512&&(un||i===null||Gr(i,i.return)),i!==null&&c&4&&Wf(t,t.memoizedProps,i.memoizedProps);break;case 5:if(Yn(a,t),Vn(t),c&512&&(un||i===null||Gr(i,i.return)),t.flags&32){m=t.stateNode;try{Pe(m,"")}catch(Re){Tt(t,t.return,Re)}}c&4&&t.stateNode!=null&&(m=t.memoizedProps,Wf(t,m,i!==null?i.memoizedProps:m)),c&1024&&(td=!0);break;case 6:if(Yn(a,t),Vn(t),c&4){if(t.stateNode===null)throw Error(l(162));c=t.memoizedProps,i=t.stateNode;try{i.nodeValue=c}catch(Re){Tt(t,t.return,Re)}}break;case 3:if(yu=null,m=jr,jr=xu(a.containerInfo),Yn(a,t),jr=m,Vn(t),c&4&&i!==null&&i.memoizedState.isDehydrated)try{mi(a.containerInfo)}catch(Re){Tt(t,t.return,Re)}td&&(td=!1,Dx(t));break;case 4:c=jr,jr=xu(t.stateNode.containerInfo),Yn(a,t),Vn(t),jr=c;break;case 12:Yn(a,t),Vn(t);break;case 31:Yn(a,t),Vn(t),c&4&&(c=t.updateQueue,c!==null&&(t.updateQueue=null,ru(t,c)));break;case 13:Yn(a,t),Vn(t),t.child.flags&8192&&t.memoizedState!==null!=(i!==null&&i.memoizedState!==null)&&(lu=Et()),c&4&&(c=t.updateQueue,c!==null&&(t.updateQueue=null,ru(t,c)));break;case 22:m=t.memoizedState!==null;var $=i!==null&&i.memoizedState!==null,W=fa,oe=un;if(fa=W||m,un=oe||$,Yn(a,t),un=oe,fa=W,Vn(t),c&8192)e:for(a=t.stateNode,a._visibility=m?a._visibility&-2:a._visibility|1,m&&(i===null||$||fa||un||kl(t)),i=null,a=t;;){if(a.tag===5||a.tag===26){if(i===null){$=i=a;try{if(b=$.stateNode,m)k=b.style,typeof k.setProperty=="function"?k.setProperty("display","none","important"):k.display="none";else{R=$.stateNode;var fe=$.memoizedProps.style,J=fe!=null&&fe.hasOwnProperty("display")?fe.display:null;R.style.display=J==null||typeof J=="boolean"?"":(""+J).trim()}}catch(Re){Tt($,$.return,Re)}}}else if(a.tag===6){if(i===null){$=a;try{$.stateNode.nodeValue=m?"":$.memoizedProps}catch(Re){Tt($,$.return,Re)}}}else if(a.tag===18){if(i===null){$=a;try{var ne=$.stateNode;m?Sb(ne,!0):Sb($.stateNode,!1)}catch(Re){Tt($,$.return,Re)}}}else if((a.tag!==22&&a.tag!==23||a.memoizedState===null||a===t)&&a.child!==null){a.child.return=a,a=a.child;continue}if(a===t)break e;for(;a.sibling===null;){if(a.return===null||a.return===t)break e;i===a&&(i=null),a=a.return}i===a&&(i=null),a.sibling.return=a.return,a=a.sibling}c&4&&(c=t.updateQueue,c!==null&&(i=c.retryQueue,i!==null&&(c.retryQueue=null,ru(t,i))));break;case 19:Yn(a,t),Vn(t),c&4&&(c=t.updateQueue,c!==null&&(t.updateQueue=null,ru(t,c)));break;case 30:break;case 21:break;default:Yn(a,t),Vn(t)}}function Vn(t){var a=t.flags;if(a&2){try{for(var i,c=t.return;c!==null;){if(Nx(c)){i=c;break}c=c.return}if(i==null)throw Error(l(160));switch(i.tag){case 27:var m=i.stateNode,b=Jf(t);nu(t,b,m);break;case 5:var k=i.stateNode;i.flags&32&&(Pe(k,""),i.flags&=-33);var R=Jf(t);nu(t,R,k);break;case 3:case 4:var $=i.stateNode.containerInfo,W=Jf(t);ed(t,W,$);break;default:throw Error(l(161))}}catch(oe){Tt(t,t.return,oe)}t.flags&=-3}a&4096&&(t.flags&=-4097)}function Dx(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var a=t;Dx(a),a.tag===5&&a.flags&1024&&a.stateNode.reset(),t=t.sibling}}function ha(t,a){if(a.subtreeFlags&8772)for(a=a.child;a!==null;)Ax(t,a.alternate,a),a=a.sibling}function kl(t){for(t=t.child;t!==null;){var a=t;switch(a.tag){case 0:case 11:case 14:case 15:Ia(4,a,a.return),kl(a);break;case 1:Gr(a,a.return);var i=a.stateNode;typeof i.componentWillUnmount=="function"&&Sx(a,a.return,i),kl(a);break;case 27:vs(a.stateNode);case 26:case 5:Gr(a,a.return),kl(a);break;case 22:a.memoizedState===null&&kl(a);break;case 30:kl(a);break;default:kl(a)}t=t.sibling}}function pa(t,a,i){for(i=i&&(a.subtreeFlags&8772)!==0,a=a.child;a!==null;){var c=a.alternate,m=t,b=a,k=b.flags;switch(b.tag){case 0:case 11:case 15:pa(m,b,i),cs(4,b);break;case 1:if(pa(m,b,i),c=b,m=c.stateNode,typeof m.componentDidMount=="function")try{m.componentDidMount()}catch(W){Tt(c,c.return,W)}if(c=b,m=c.updateQueue,m!==null){var R=c.stateNode;try{var $=m.shared.hiddenCallbacks;if($!==null)for(m.shared.hiddenCallbacks=null,m=0;m<$.length;m++)fg($[m],R)}catch(W){Tt(c,c.return,W)}}i&&k&64&&kx(b),fs(b,b.return);break;case 27:_x(b);case 26:case 5:pa(m,b,i),i&&c===null&&k&4&&Ex(b),fs(b,b.return);break;case 12:pa(m,b,i);break;case 31:pa(m,b,i),i&&k&4&&jx(m,b);break;case 13:pa(m,b,i),i&&k&4&&Mx(m,b);break;case 22:b.memoizedState===null&&pa(m,b,i),fs(b,b.return);break;case 30:break;default:pa(m,b,i)}a=a.sibling}}function nd(t,a){var i=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(i=t.memoizedState.cachePool.pool),t=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(t=a.memoizedState.cachePool.pool),t!==i&&(t!=null&&t.refCount++,i!=null&&Qi(i))}function rd(t,a){t=null,a.alternate!==null&&(t=a.alternate.memoizedState.cache),a=a.memoizedState.cache,a!==t&&(a.refCount++,t!=null&&Qi(t))}function Mr(t,a,i,c){if(a.subtreeFlags&10256)for(a=a.child;a!==null;)zx(t,a,i,c),a=a.sibling}function zx(t,a,i,c){var m=a.flags;switch(a.tag){case 0:case 11:case 15:Mr(t,a,i,c),m&2048&&cs(9,a);break;case 1:Mr(t,a,i,c);break;case 3:Mr(t,a,i,c),m&2048&&(t=null,a.alternate!==null&&(t=a.alternate.memoizedState.cache),a=a.memoizedState.cache,a!==t&&(a.refCount++,t!=null&&Qi(t)));break;case 12:if(m&2048){Mr(t,a,i,c),t=a.stateNode;try{var b=a.memoizedProps,k=b.id,R=b.onPostCommit;typeof R=="function"&&R(k,a.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch($){Tt(a,a.return,$)}}else Mr(t,a,i,c);break;case 31:Mr(t,a,i,c);break;case 13:Mr(t,a,i,c);break;case 23:break;case 22:b=a.stateNode,k=a.alternate,a.memoizedState!==null?b._visibility&2?Mr(t,a,i,c):ds(t,a):b._visibility&2?Mr(t,a,i,c):(b._visibility|=2,ai(t,a,i,c,(a.subtreeFlags&10256)!==0||!1)),m&2048&&nd(k,a);break;case 24:Mr(t,a,i,c),m&2048&&rd(a.alternate,a);break;default:Mr(t,a,i,c)}}function ai(t,a,i,c,m){for(m=m&&((a.subtreeFlags&10256)!==0||!1),a=a.child;a!==null;){var b=t,k=a,R=i,$=c,W=k.flags;switch(k.tag){case 0:case 11:case 15:ai(b,k,R,$,m),cs(8,k);break;case 23:break;case 22:var oe=k.stateNode;k.memoizedState!==null?oe._visibility&2?ai(b,k,R,$,m):ds(b,k):(oe._visibility|=2,ai(b,k,R,$,m)),m&&W&2048&&nd(k.alternate,k);break;case 24:ai(b,k,R,$,m),m&&W&2048&&rd(k.alternate,k);break;default:ai(b,k,R,$,m)}a=a.sibling}}function ds(t,a){if(a.subtreeFlags&10256)for(a=a.child;a!==null;){var i=t,c=a,m=c.flags;switch(c.tag){case 22:ds(i,c),m&2048&&nd(c.alternate,c);break;case 24:ds(i,c),m&2048&&rd(c.alternate,c);break;default:ds(i,c)}a=a.sibling}}var hs=8192;function li(t,a,i){if(t.subtreeFlags&hs)for(t=t.child;t!==null;)Lx(t,a,i),t=t.sibling}function Lx(t,a,i){switch(t.tag){case 26:li(t,a,i),t.flags&hs&&t.memoizedState!==null&&BE(i,jr,t.memoizedState,t.memoizedProps);break;case 5:li(t,a,i);break;case 3:case 4:var c=jr;jr=xu(t.stateNode.containerInfo),li(t,a,i),jr=c;break;case 22:t.memoizedState===null&&(c=t.alternate,c!==null&&c.memoizedState!==null?(c=hs,hs=16777216,li(t,a,i),hs=c):li(t,a,i));break;default:li(t,a,i)}}function Bx(t){var a=t.alternate;if(a!==null&&(t=a.child,t!==null)){a.child=null;do a=t.sibling,t.sibling=null,t=a;while(t!==null)}}function ps(t){var a=t.deletions;if((t.flags&16)!==0){if(a!==null)for(var i=0;i<a.length;i++){var c=a[i];mn=c,Ux(c,t)}Bx(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Ix(t),t=t.sibling}function Ix(t){switch(t.tag){case 0:case 11:case 15:ps(t),t.flags&2048&&Ia(9,t,t.return);break;case 3:ps(t);break;case 12:ps(t);break;case 22:var a=t.stateNode;t.memoizedState!==null&&a._visibility&2&&(t.return===null||t.return.tag!==13)?(a._visibility&=-3,au(t)):ps(t);break;default:ps(t)}}function au(t){var a=t.deletions;if((t.flags&16)!==0){if(a!==null)for(var i=0;i<a.length;i++){var c=a[i];mn=c,Ux(c,t)}Bx(t)}for(t=t.child;t!==null;){switch(a=t,a.tag){case 0:case 11:case 15:Ia(8,a,a.return),au(a);break;case 22:i=a.stateNode,i._visibility&2&&(i._visibility&=-3,au(a));break;default:au(a)}t=t.sibling}}function Ux(t,a){for(;mn!==null;){var i=mn;switch(i.tag){case 0:case 11:case 15:Ia(8,i,a);break;case 23:case 22:if(i.memoizedState!==null&&i.memoizedState.cachePool!==null){var c=i.memoizedState.cachePool.pool;c!=null&&c.refCount++}break;case 24:Qi(i.memoizedState.cache)}if(c=i.child,c!==null)c.return=i,mn=c;else e:for(i=t;mn!==null;){c=mn;var m=c.sibling,b=c.return;if(Cx(c),c===i){mn=null;break e}if(m!==null){m.return=b,mn=m;break e}mn=b}}}var WS={getCacheForType:function(t){var a=kn(ln),i=a.data.get(t);return i===void 0&&(i=t(),a.data.set(t,i)),i},cacheSignal:function(){return kn(ln).controller.signal}},JS=typeof WeakMap=="function"?WeakMap:Map,yt=0,Dt=null,at=null,ot=0,_t=0,sr=null,Ua=!1,ii=!1,ad=!1,ma=0,Qt=0,$a=0,Sl=0,ld=0,or=0,si=0,ms=null,Xn=null,id=!1,lu=0,$x=0,iu=1/0,su=null,Ha=null,hn=0,Pa=null,oi=null,ga=0,sd=0,od=null,Hx=null,gs=0,ud=null;function ur(){return(yt&2)!==0&&ot!==0?ot&-ot:M.T!==null?md():Cr()}function Px(){if(or===0)if((ot&536870912)===0||ct){var t=er;er<<=1,(er&3932160)===0&&(er=262144),or=t}else or=536870912;return t=lr.current,t!==null&&(t.flags|=32),or}function Kn(t,a,i){(t===Dt&&(_t===2||_t===9)||t.cancelPendingCommit!==null)&&(ui(t,0),Fa(t,ot,or,!1)),ft(t,i),((yt&2)===0||t!==Dt)&&(t===Dt&&((yt&2)===0&&(Sl|=i),Qt===4&&Fa(t,ot,or,!1)),qr(t))}function Fx(t,a,i){if((yt&6)!==0)throw Error(l(327));var c=!i&&(a&127)===0&&(a&t.expiredLanes)===0||ue(t,a),m=c?nE(t,a):fd(t,a,!0),b=c;do{if(m===0){ii&&!c&&Fa(t,a,0,!1);break}else{if(i=t.current.alternate,b&&!eE(i)){m=fd(t,a,!1),b=!1;continue}if(m===2){if(b=a,t.errorRecoveryDisabledLanes&b)var k=0;else k=t.pendingLanes&-536870913,k=k!==0?k:k&536870912?536870912:0;if(k!==0){a=k;e:{var R=t;m=ms;var $=R.current.memoizedState.isDehydrated;if($&&(ui(R,k).flags|=256),k=fd(R,k,!1),k!==2){if(ad&&!$){R.errorRecoveryDisabledLanes|=b,Sl|=b,m=4;break e}b=Xn,Xn=m,b!==null&&(Xn===null?Xn=b:Xn.push.apply(Xn,b))}m=k}if(b=!1,m!==2)continue}}if(m===1){ui(t,0),Fa(t,a,0,!0);break}e:{switch(c=t,b=m,b){case 0:case 1:throw Error(l(345));case 4:if((a&4194048)!==a)break;case 6:Fa(c,a,or,!Ua);break e;case 2:Xn=null;break;case 3:case 5:break;default:throw Error(l(329))}if((a&62914560)===a&&(m=lu+300-Et(),10<m)){if(Fa(c,a,or,!Ua),H(c,0,!0)!==0)break e;ga=a,c.timeoutHandle=vb(Gx.bind(null,c,i,Xn,su,id,a,or,Sl,si,Ua,b,"Throttled",-0,0),m);break e}Gx(c,i,Xn,su,id,a,or,Sl,si,Ua,b,null,-0,0)}}break}while(!0);qr(t)}function Gx(t,a,i,c,m,b,k,R,$,W,oe,fe,J,ne){if(t.timeoutHandle=-1,fe=a.subtreeFlags,fe&8192||(fe&16785408)===16785408){fe={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:ke},Lx(a,b,fe);var Re=(b&62914560)===b?lu-Et():(b&4194048)===b?$x-Et():0;if(Re=IE(fe,Re),Re!==null){ga=b,t.cancelPendingCommit=Re(Wx.bind(null,t,a,b,i,c,m,k,R,$,oe,fe,null,J,ne)),Fa(t,b,k,!W);return}}Wx(t,a,b,i,c,m,k,R,$)}function eE(t){for(var a=t;;){var i=a.tag;if((i===0||i===11||i===15)&&a.flags&16384&&(i=a.updateQueue,i!==null&&(i=i.stores,i!==null)))for(var c=0;c<i.length;c++){var m=i[c],b=m.getSnapshot;m=m.value;try{if(!rr(b(),m))return!1}catch{return!1}}if(i=a.child,a.subtreeFlags&16384&&i!==null)i.return=a,a=i;else{if(a===t)break;for(;a.sibling===null;){if(a.return===null||a.return===t)return!0;a=a.return}a.sibling.return=a.return,a=a.sibling}}return!0}function Fa(t,a,i,c){a&=~ld,a&=~Sl,t.suspendedLanes|=a,t.pingedLanes&=~a,c&&(t.warmLanes|=a),c=t.expirationTimes;for(var m=a;0<m;){var b=31-Fe(m),k=1<<b;c[b]=-1,m&=~k}i!==0&&Ee(t,i,a)}function ou(){return(yt&6)===0?(xs(0),!1):!0}function cd(){if(at!==null){if(_t===0)var t=at.return;else t=at,la=pl=null,_f(t),Jl=null,Ji=0,t=at;for(;t!==null;)wx(t.alternate,t),t=t.return;at=null}}function ui(t,a){var i=t.timeoutHandle;i!==-1&&(t.timeoutHandle=-1,vE(i)),i=t.cancelPendingCommit,i!==null&&(t.cancelPendingCommit=null,i()),ga=0,cd(),Dt=t,at=i=ra(t.current,null),ot=a,_t=0,sr=null,Ua=!1,ii=ue(t,a),ad=!1,si=or=ld=Sl=$a=Qt=0,Xn=ms=null,id=!1,(a&8)!==0&&(a|=a&32);var c=t.entangledLanes;if(c!==0)for(t=t.entanglements,c&=a;0<c;){var m=31-Fe(c),b=1<<m;a|=t[m],c&=~b}return ma=a,Co(),i}function qx(t,a){Ke=null,M.H=ss,a===Wl||a===Bo?(a=sg(),_t=3):a===pf?(a=sg(),_t=4):_t=a===Pf?8:a!==null&&typeof a=="object"&&typeof a.then=="function"?6:1,sr=a,at===null&&(Qt=1,Qo(t,br(a,t.current)))}function Yx(){var t=lr.current;return t===null?!0:(ot&4194048)===ot?kr===null:(ot&62914560)===ot||(ot&536870912)!==0?t===kr:!1}function Vx(){var t=M.H;return M.H=ss,t===null?ss:t}function Xx(){var t=M.A;return M.A=WS,t}function uu(){Qt=4,Ua||(ot&4194048)!==ot&&lr.current!==null||(ii=!0),($a&134217727)===0&&(Sl&134217727)===0||Dt===null||Fa(Dt,ot,or,!1)}function fd(t,a,i){var c=yt;yt|=2;var m=Vx(),b=Xx();(Dt!==t||ot!==a)&&(su=null,ui(t,a)),a=!1;var k=Qt;e:do try{if(_t!==0&&at!==null){var R=at,$=sr;switch(_t){case 8:cd(),k=6;break e;case 3:case 2:case 9:case 6:lr.current===null&&(a=!0);var W=_t;if(_t=0,sr=null,ci(t,R,$,W),i&&ii){k=0;break e}break;default:W=_t,_t=0,sr=null,ci(t,R,$,W)}}tE(),k=Qt;break}catch(oe){qx(t,oe)}while(!0);return a&&t.shellSuspendCounter++,la=pl=null,yt=c,M.H=m,M.A=b,at===null&&(Dt=null,ot=0,Co()),k}function tE(){for(;at!==null;)Kx(at)}function nE(t,a){var i=yt;yt|=2;var c=Vx(),m=Xx();Dt!==t||ot!==a?(su=null,iu=Et()+500,ui(t,a)):ii=ue(t,a);e:do try{if(_t!==0&&at!==null){a=at;var b=sr;t:switch(_t){case 1:_t=0,sr=null,ci(t,a,b,1);break;case 2:case 9:if(lg(b)){_t=0,sr=null,Zx(a);break}a=function(){_t!==2&&_t!==9||Dt!==t||(_t=7),qr(t)},b.then(a,a);break e;case 3:_t=7;break e;case 4:_t=5;break e;case 7:lg(b)?(_t=0,sr=null,Zx(a)):(_t=0,sr=null,ci(t,a,b,7));break;case 5:var k=null;switch(at.tag){case 26:k=at.memoizedState;case 5:case 27:var R=at;if(k?zb(k):R.stateNode.complete){_t=0,sr=null;var $=R.sibling;if($!==null)at=$;else{var W=R.return;W!==null?(at=W,cu(W)):at=null}break t}}_t=0,sr=null,ci(t,a,b,5);break;case 6:_t=0,sr=null,ci(t,a,b,6);break;case 8:cd(),Qt=6;break e;default:throw Error(l(462))}}rE();break}catch(oe){qx(t,oe)}while(!0);return la=pl=null,M.H=c,M.A=m,yt=i,at!==null?0:(Dt=null,ot=0,Co(),Qt)}function rE(){for(;at!==null&&!On();)Kx(at)}function Kx(t){var a=yx(t.alternate,t,ma);t.memoizedProps=t.pendingProps,a===null?cu(t):at=a}function Zx(t){var a=t,i=a.alternate;switch(a.tag){case 15:case 0:a=hx(i,a,a.pendingProps,a.type,void 0,ot);break;case 11:a=hx(i,a,a.pendingProps,a.type.render,a.ref,ot);break;case 5:_f(a);default:wx(i,a),a=at=Xm(a,ma),a=yx(i,a,ma)}t.memoizedProps=t.pendingProps,a===null?cu(t):at=a}function ci(t,a,i,c){la=pl=null,_f(a),Jl=null,Ji=0;var m=a.return;try{if(qS(t,m,a,i,ot)){Qt=1,Qo(t,br(i,t.current)),at=null;return}}catch(b){if(m!==null)throw at=m,b;Qt=1,Qo(t,br(i,t.current)),at=null;return}a.flags&32768?(ct||c===1?t=!0:ii||(ot&536870912)!==0?t=!1:(Ua=t=!0,(c===2||c===9||c===3||c===6)&&(c=lr.current,c!==null&&c.tag===13&&(c.flags|=16384))),Qx(a,t)):cu(a)}function cu(t){var a=t;do{if((a.flags&32768)!==0){Qx(a,Ua);return}t=a.return;var i=XS(a.alternate,a,ma);if(i!==null){at=i;return}if(a=a.sibling,a!==null){at=a;return}at=a=t}while(a!==null);Qt===0&&(Qt=5)}function Qx(t,a){do{var i=KS(t.alternate,t);if(i!==null){i.flags&=32767,at=i;return}if(i=t.return,i!==null&&(i.flags|=32768,i.subtreeFlags=0,i.deletions=null),!a&&(t=t.sibling,t!==null)){at=t;return}at=t=i}while(t!==null);Qt=6,at=null}function Wx(t,a,i,c,m,b,k,R,$){t.cancelPendingCommit=null;do fu();while(hn!==0);if((yt&6)!==0)throw Error(l(327));if(a!==null){if(a===t.current)throw Error(l(177));if(b=a.lanes|a.childLanes,b|=Wc,Ce(t,i,b,k,R,$),t===Dt&&(at=Dt=null,ot=0),oi=a,Pa=t,ga=i,sd=b,od=m,Hx=c,(a.subtreeFlags&10256)!==0||(a.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,sE(Me,function(){return rb(),null})):(t.callbackNode=null,t.callbackPriority=0),c=(a.flags&13878)!==0,(a.subtreeFlags&13878)!==0||c){c=M.T,M.T=null,m=K.p,K.p=2,k=yt,yt|=4;try{ZS(t,a,i)}finally{yt=k,K.p=m,M.T=c}}hn=1,Jx(),eb(),tb()}}function Jx(){if(hn===1){hn=0;var t=Pa,a=oi,i=(a.flags&13878)!==0;if((a.subtreeFlags&13878)!==0||i){i=M.T,M.T=null;var c=K.p;K.p=2;var m=yt;yt|=4;try{Ox(a,t);var b=Sd,k=Um(t.containerInfo),R=b.focusedElem,$=b.selectionRange;if(k!==R&&R&&R.ownerDocument&&Im(R.ownerDocument.documentElement,R)){if($!==null&&Vc(R)){var W=$.start,oe=$.end;if(oe===void 0&&(oe=W),"selectionStart"in R)R.selectionStart=W,R.selectionEnd=Math.min(oe,R.value.length);else{var fe=R.ownerDocument||document,J=fe&&fe.defaultView||window;if(J.getSelection){var ne=J.getSelection(),Re=R.textContent.length,He=Math.min($.start,Re),Mt=$.end===void 0?He:Math.min($.end,Re);!ne.extend&&He>Mt&&(k=Mt,Mt=He,He=k);var V=Bm(R,He),G=Bm(R,Mt);if(V&&G&&(ne.rangeCount!==1||ne.anchorNode!==V.node||ne.anchorOffset!==V.offset||ne.focusNode!==G.node||ne.focusOffset!==G.offset)){var Q=fe.createRange();Q.setStart(V.node,V.offset),ne.removeAllRanges(),He>Mt?(ne.addRange(Q),ne.extend(G.node,G.offset)):(Q.setEnd(G.node,G.offset),ne.addRange(Q))}}}}for(fe=[],ne=R;ne=ne.parentNode;)ne.nodeType===1&&fe.push({element:ne,left:ne.scrollLeft,top:ne.scrollTop});for(typeof R.focus=="function"&&R.focus(),R=0;R<fe.length;R++){var ce=fe[R];ce.element.scrollLeft=ce.left,ce.element.scrollTop=ce.top}}Su=!!kd,Sd=kd=null}finally{yt=m,K.p=c,M.T=i}}t.current=a,hn=2}}function eb(){if(hn===2){hn=0;var t=Pa,a=oi,i=(a.flags&8772)!==0;if((a.subtreeFlags&8772)!==0||i){i=M.T,M.T=null;var c=K.p;K.p=2;var m=yt;yt|=4;try{Ax(t,a.alternate,a)}finally{yt=m,K.p=c,M.T=i}}hn=3}}function tb(){if(hn===4||hn===3){hn=0,Dn();var t=Pa,a=oi,i=ga,c=Hx;(a.subtreeFlags&10256)!==0||(a.flags&10256)!==0?hn=5:(hn=0,oi=Pa=null,nb(t,t.pendingLanes));var m=t.pendingLanes;if(m===0&&(Ha=null),fn(i),a=a.stateNode,mt&&typeof mt.onCommitFiberRoot=="function")try{mt.onCommitFiberRoot(qt,a,void 0,(a.current.flags&128)===128)}catch{}if(c!==null){a=M.T,m=K.p,K.p=2,M.T=null;try{for(var b=t.onRecoverableError,k=0;k<c.length;k++){var R=c[k];b(R.value,{componentStack:R.stack})}}finally{M.T=a,K.p=m}}(ga&3)!==0&&fu(),qr(t),m=t.pendingLanes,(i&261930)!==0&&(m&42)!==0?t===ud?gs++:(gs=0,ud=t):gs=0,xs(0)}}function nb(t,a){(t.pooledCacheLanes&=a)===0&&(a=t.pooledCache,a!=null&&(t.pooledCache=null,Qi(a)))}function fu(){return Jx(),eb(),tb(),rb()}function rb(){if(hn!==5)return!1;var t=Pa,a=sd;sd=0;var i=fn(ga),c=M.T,m=K.p;try{K.p=32>i?32:i,M.T=null,i=od,od=null;var b=Pa,k=ga;if(hn=0,oi=Pa=null,ga=0,(yt&6)!==0)throw Error(l(331));var R=yt;if(yt|=4,Ix(b.current),zx(b,b.current,k,i),yt=R,xs(0,!1),mt&&typeof mt.onPostCommitFiberRoot=="function")try{mt.onPostCommitFiberRoot(qt,b)}catch{}return!0}finally{K.p=m,M.T=c,nb(t,a)}}function ab(t,a,i){a=br(i,a),a=Hf(t.stateNode,a,2),t=za(t,a,2),t!==null&&(ft(t,2),qr(t))}function Tt(t,a,i){if(t.tag===3)ab(t,t,i);else for(;a!==null;){if(a.tag===3){ab(a,t,i);break}else if(a.tag===1){var c=a.stateNode;if(typeof a.type.getDerivedStateFromError=="function"||typeof c.componentDidCatch=="function"&&(Ha===null||!Ha.has(c))){t=br(i,t),i=lx(2),c=za(a,i,2),c!==null&&(ix(i,c,a,t),ft(c,2),qr(c));break}}a=a.return}}function dd(t,a,i){var c=t.pingCache;if(c===null){c=t.pingCache=new JS;var m=new Set;c.set(a,m)}else m=c.get(a),m===void 0&&(m=new Set,c.set(a,m));m.has(i)||(ad=!0,m.add(i),t=aE.bind(null,t,a,i),a.then(t,t))}function aE(t,a,i){var c=t.pingCache;c!==null&&c.delete(a),t.pingedLanes|=t.suspendedLanes&i,t.warmLanes&=~i,Dt===t&&(ot&i)===i&&(Qt===4||Qt===3&&(ot&62914560)===ot&&300>Et()-lu?(yt&2)===0&&ui(t,0):ld|=i,si===ot&&(si=0)),qr(t)}function lb(t,a){a===0&&(a=Le()),t=fl(t,a),t!==null&&(ft(t,a),qr(t))}function lE(t){var a=t.memoizedState,i=0;a!==null&&(i=a.retryLane),lb(t,i)}function iE(t,a){var i=0;switch(t.tag){case 31:case 13:var c=t.stateNode,m=t.memoizedState;m!==null&&(i=m.retryLane);break;case 19:c=t.stateNode;break;case 22:c=t.stateNode._retryCache;break;default:throw Error(l(314))}c!==null&&c.delete(a),lb(t,i)}function sE(t,a){return Ot(t,a)}var du=null,fi=null,hd=!1,hu=!1,pd=!1,Ga=0;function qr(t){t!==fi&&t.next===null&&(fi===null?du=fi=t:fi=fi.next=t),hu=!0,hd||(hd=!0,uE())}function xs(t,a){if(!pd&&hu){pd=!0;do for(var i=!1,c=du;c!==null;){if(t!==0){var m=c.pendingLanes;if(m===0)var b=0;else{var k=c.suspendedLanes,R=c.pingedLanes;b=(1<<31-Fe(42|t)+1)-1,b&=m&~(k&~R),b=b&201326741?b&201326741|1:b?b|2:0}b!==0&&(i=!0,ub(c,b))}else b=ot,b=H(c,c===Dt?b:0,c.cancelPendingCommit!==null||c.timeoutHandle!==-1),(b&3)===0||ue(c,b)||(i=!0,ub(c,b));c=c.next}while(i);pd=!1}}function oE(){ib()}function ib(){hu=hd=!1;var t=0;Ga!==0&&yE()&&(t=Ga);for(var a=Et(),i=null,c=du;c!==null;){var m=c.next,b=sb(c,a);b===0?(c.next=null,i===null?du=m:i.next=m,m===null&&(fi=i)):(i=c,(t!==0||(b&3)!==0)&&(hu=!0)),c=m}hn!==0&&hn!==5||xs(t),Ga!==0&&(Ga=0)}function sb(t,a){for(var i=t.suspendedLanes,c=t.pingedLanes,m=t.expirationTimes,b=t.pendingLanes&-62914561;0<b;){var k=31-Fe(b),R=1<<k,$=m[k];$===-1?((R&i)===0||(R&c)!==0)&&(m[k]=pe(R,a)):$<=a&&(t.expiredLanes|=R),b&=~R}if(a=Dt,i=ot,i=H(t,t===a?i:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),c=t.callbackNode,i===0||t===a&&(_t===2||_t===9)||t.cancelPendingCommit!==null)return c!==null&&c!==null&&pr(c),t.callbackNode=null,t.callbackPriority=0;if((i&3)===0||ue(t,i)){if(a=i&-i,a===t.callbackPriority)return a;switch(c!==null&&pr(c),fn(i)){case 2:case 8:i=me;break;case 32:i=Me;break;case 268435456:i=nt;break;default:i=Me}return c=ob.bind(null,t),i=Ot(i,c),t.callbackPriority=a,t.callbackNode=i,a}return c!==null&&c!==null&&pr(c),t.callbackPriority=2,t.callbackNode=null,2}function ob(t,a){if(hn!==0&&hn!==5)return t.callbackNode=null,t.callbackPriority=0,null;var i=t.callbackNode;if(fu()&&t.callbackNode!==i)return null;var c=ot;return c=H(t,t===Dt?c:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),c===0?null:(Fx(t,c,a),sb(t,Et()),t.callbackNode!=null&&t.callbackNode===i?ob.bind(null,t):null)}function ub(t,a){if(fu())return null;Fx(t,a,!0)}function uE(){wE(function(){(yt&6)!==0?Ot(re,oE):ib()})}function md(){if(Ga===0){var t=Zl;t===0&&(t=zn,zn<<=1,(zn&261888)===0&&(zn=256)),Ga=t}return Ga}function cb(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:Ta(""+t)}function fb(t,a){var i=a.ownerDocument.createElement("input");return i.name=a.name,i.value=a.value,t.id&&i.setAttribute("form",t.id),a.parentNode.insertBefore(i,a),t=new FormData(t),i.parentNode.removeChild(i),t}function cE(t,a,i,c,m){if(a==="submit"&&i&&i.stateNode===m){var b=cb((m[ve]||null).action),k=c.submitter;k&&(a=(a=k[ve]||null)?cb(a.formAction):k.getAttribute("formAction"),a!==null&&(b=a,k=null));var R=new No("action","action",null,c,m);t.push({event:R,listeners:[{instance:null,listener:function(){if(c.defaultPrevented){if(Ga!==0){var $=k?fb(m,k):new FormData(m);zf(i,{pending:!0,data:$,method:m.method,action:b},null,$)}}else typeof b=="function"&&(R.preventDefault(),$=k?fb(m,k):new FormData(m),zf(i,{pending:!0,data:$,method:m.method,action:b},b,$))},currentTarget:m}]})}}for(var gd=0;gd<Qc.length;gd++){var xd=Qc[gd],fE=xd.toLowerCase(),dE=xd[0].toUpperCase()+xd.slice(1);Rr(fE,"on"+dE)}Rr(Pm,"onAnimationEnd"),Rr(Fm,"onAnimationIteration"),Rr(Gm,"onAnimationStart"),Rr("dblclick","onDoubleClick"),Rr("focusin","onFocus"),Rr("focusout","onBlur"),Rr(AS,"onTransitionRun"),Rr(CS,"onTransitionStart"),Rr(RS,"onTransitionCancel"),Rr(qm,"onTransitionEnd"),ge("onMouseEnter",["mouseout","mouseover"]),ge("onMouseLeave",["mouseout","mouseover"]),ge("onPointerEnter",["pointerout","pointerover"]),ge("onPointerLeave",["pointerout","pointerover"]),An("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),An("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),An("onBeforeInput",["compositionend","keypress","textInput","paste"]),An("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),An("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),An("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var bs="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(" "),hE=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(bs));function db(t,a){a=(a&4)!==0;for(var i=0;i<t.length;i++){var c=t[i],m=c.event;c=c.listeners;e:{var b=void 0;if(a)for(var k=c.length-1;0<=k;k--){var R=c[k],$=R.instance,W=R.currentTarget;if(R=R.listener,$!==b&&m.isPropagationStopped())break e;b=R,m.currentTarget=W;try{b(m)}catch(oe){Ao(oe)}m.currentTarget=null,b=$}else for(k=0;k<c.length;k++){if(R=c[k],$=R.instance,W=R.currentTarget,R=R.listener,$!==b&&m.isPropagationStopped())break e;b=R,m.currentTarget=W;try{b(m)}catch(oe){Ao(oe)}m.currentTarget=null,b=$}}}}function lt(t,a){var i=a[mr];i===void 0&&(i=a[mr]=new Set);var c=t+"__bubble";i.has(c)||(hb(a,t,2,!1),i.add(c))}function bd(t,a,i){var c=0;a&&(c|=4),hb(i,t,c,a)}var pu="_reactListening"+Math.random().toString(36).slice(2);function yd(t){if(!t[pu]){t[pu]=!0,dn.forEach(function(i){i!=="selectionchange"&&(hE.has(i)||bd(i,!1,t),bd(i,!0,t))});var a=t.nodeType===9?t:t.ownerDocument;a===null||a[pu]||(a[pu]=!0,bd("selectionchange",!1,a))}}function hb(t,a,i,c){switch(Pb(a)){case 2:var m=HE;break;case 8:m=PE;break;default:m=Dd}i=m.bind(null,a,i,t),m=void 0,!Ic||a!=="touchstart"&&a!=="touchmove"&&a!=="wheel"||(m=!0),c?m!==void 0?t.addEventListener(a,i,{capture:!0,passive:m}):t.addEventListener(a,i,!0):m!==void 0?t.addEventListener(a,i,{passive:m}):t.addEventListener(a,i,!1)}function vd(t,a,i,c,m){var b=c;if((a&1)===0&&(a&2)===0&&c!==null)e:for(;;){if(c===null)return;var k=c.tag;if(k===3||k===4){var R=c.stateNode.containerInfo;if(R===m)break;if(k===4)for(k=c.return;k!==null;){var $=k.tag;if(($===3||$===4)&&k.stateNode.containerInfo===m)return;k=k.return}for(;R!==null;){if(k=de(R),k===null)return;if($=k.tag,$===5||$===6||$===26||$===27){c=b=k;continue e}R=R.parentNode}}c=c.return}wo(function(){var W=b,oe=Xe(i),fe=[];e:{var J=Ym.get(t);if(J!==void 0){var ne=No,Re=t;switch(t){case"keypress":if(So(i)===0)break e;case"keydown":case"keyup":ne=iS;break;case"focusin":Re="focus",ne=Pc;break;case"focusout":Re="blur",ne=Pc;break;case"beforeblur":case"afterblur":ne=Pc;break;case"click":if(i.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ne=wm;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ne=Xk;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ne=uS;break;case Pm:case Fm:case Gm:ne=Qk;break;case qm:ne=fS;break;case"scroll":case"scrollend":ne=Yk;break;case"wheel":ne=hS;break;case"copy":case"cut":case"paste":ne=Jk;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ne=Sm;break;case"toggle":case"beforetoggle":ne=mS}var He=(a&4)!==0,Mt=!He&&(t==="scroll"||t==="scrollend"),V=He?J!==null?J+"Capture":null:J;He=[];for(var G=W,Q;G!==null;){var ce=G;if(Q=ce.stateNode,ce=ce.tag,ce!==5&&ce!==26&&ce!==27||Q===null||V===null||(ce=$i(G,V),ce!=null&&He.push(ys(G,ce,Q))),Mt)break;G=G.return}0<He.length&&(J=new ne(J,Re,null,i,oe),fe.push({event:J,listeners:He}))}}if((a&7)===0){e:{if(J=t==="mouseover"||t==="pointerover",ne=t==="mouseout"||t==="pointerout",J&&i!==De&&(Re=i.relatedTarget||i.fromElement)&&(de(Re)||Re[wt]))break e;if((ne||J)&&(J=oe.window===oe?oe:(J=oe.ownerDocument)?J.defaultView||J.parentWindow:window,ne?(Re=i.relatedTarget||i.toElement,ne=W,Re=Re?de(Re):null,Re!==null&&(Mt=o(Re),He=Re.tag,Re!==Mt||He!==5&&He!==27&&He!==6)&&(Re=null)):(ne=null,Re=W),ne!==Re)){if(He=wm,ce="onMouseLeave",V="onMouseEnter",G="mouse",(t==="pointerout"||t==="pointerover")&&(He=Sm,ce="onPointerLeave",V="onPointerEnter",G="pointer"),Mt=ne==null?J:pt(ne),Q=Re==null?J:pt(Re),J=new He(ce,G+"leave",ne,i,oe),J.target=Mt,J.relatedTarget=Q,ce=null,de(oe)===W&&(He=new He(V,G+"enter",Re,i,oe),He.target=Q,He.relatedTarget=Mt,ce=He),Mt=ce,ne&&Re)t:{for(He=pE,V=ne,G=Re,Q=0,ce=V;ce;ce=He(ce))Q++;ce=0;for(var Ue=G;Ue;Ue=He(Ue))ce++;for(;0<Q-ce;)V=He(V),Q--;for(;0<ce-Q;)G=He(G),ce--;for(;Q--;){if(V===G||G!==null&&V===G.alternate){He=V;break t}V=He(V),G=He(G)}He=null}else He=null;ne!==null&&pb(fe,J,ne,He,!1),Re!==null&&Mt!==null&&pb(fe,Mt,Re,He,!0)}}e:{if(J=W?pt(W):window,ne=J.nodeName&&J.nodeName.toLowerCase(),ne==="select"||ne==="input"&&J.type==="file")var xt=jm;else if(Cm(J))if(Mm)xt=NS;else{xt=SS;var ze=kS}else ne=J.nodeName,!ne||ne.toLowerCase()!=="input"||J.type!=="checkbox"&&J.type!=="radio"?W&&_a(W.elementType)&&(xt=jm):xt=ES;if(xt&&(xt=xt(t,W))){Rm(fe,xt,i,oe);break e}ze&&ze(t,J,W),t==="focusout"&&W&&J.type==="number"&&W.memoizedProps.value!=null&&Ul(J,"number",J.value)}switch(ze=W?pt(W):window,t){case"focusin":(Cm(ze)||ze.contentEditable==="true")&&(Pl=ze,Xc=W,Xi=null);break;case"focusout":Xi=Xc=Pl=null;break;case"mousedown":Kc=!0;break;case"contextmenu":case"mouseup":case"dragend":Kc=!1,$m(fe,i,oe);break;case"selectionchange":if(TS)break;case"keydown":case"keyup":$m(fe,i,oe)}var We;if(Gc)e:{switch(t){case"compositionstart":var ut="onCompositionStart";break e;case"compositionend":ut="onCompositionEnd";break e;case"compositionupdate":ut="onCompositionUpdate";break e}ut=void 0}else Hl?Tm(t,i)&&(ut="onCompositionEnd"):t==="keydown"&&i.keyCode===229&&(ut="onCompositionStart");ut&&(Em&&i.locale!=="ko"&&(Hl||ut!=="onCompositionStart"?ut==="onCompositionEnd"&&Hl&&(We=ym()):(Aa=oe,Uc="value"in Aa?Aa.value:Aa.textContent,Hl=!0)),ze=mu(W,ut),0<ze.length&&(ut=new km(ut,t,null,i,oe),fe.push({event:ut,listeners:ze}),We?ut.data=We:(We=Am(i),We!==null&&(ut.data=We)))),(We=xS?bS(t,i):yS(t,i))&&(ut=mu(W,"onBeforeInput"),0<ut.length&&(ze=new km("onBeforeInput","beforeinput",null,i,oe),fe.push({event:ze,listeners:ut}),ze.data=We)),cE(fe,t,W,i,oe)}db(fe,a)})}function ys(t,a,i){return{instance:t,listener:a,currentTarget:i}}function mu(t,a){for(var i=a+"Capture",c=[];t!==null;){var m=t,b=m.stateNode;if(m=m.tag,m!==5&&m!==26&&m!==27||b===null||(m=$i(t,i),m!=null&&c.unshift(ys(t,m,b)),m=$i(t,a),m!=null&&c.push(ys(t,m,b))),t.tag===3)return c;t=t.return}return[]}function pE(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function pb(t,a,i,c,m){for(var b=a._reactName,k=[];i!==null&&i!==c;){var R=i,$=R.alternate,W=R.stateNode;if(R=R.tag,$!==null&&$===c)break;R!==5&&R!==26&&R!==27||W===null||($=W,m?(W=$i(i,b),W!=null&&k.unshift(ys(i,W,$))):m||(W=$i(i,b),W!=null&&k.push(ys(i,W,$)))),i=i.return}k.length!==0&&t.push({event:a,listeners:k})}var mE=/\r\n?/g,gE=/\u0000|\uFFFD/g;function mb(t){return(typeof t=="string"?t:""+t).replace(mE,`
|
|
9
|
+
`).replace(gE,"")}function gb(t,a){return a=mb(a),mb(t)===a}function jt(t,a,i,c,m,b){switch(i){case"children":typeof c=="string"?a==="body"||a==="textarea"&&c===""||Pe(t,c):(typeof c=="number"||typeof c=="bigint")&&a!=="body"&&Pe(t,""+c);break;case"className":tr(t,"class",c);break;case"tabIndex":tr(t,"tabindex",c);break;case"dir":case"role":case"viewBox":case"width":case"height":tr(t,i,c);break;case"style":Nt(t,c,b);break;case"data":if(a!=="object"){tr(t,"data",c);break}case"src":case"href":if(c===""&&(a!=="a"||i!=="href")){t.removeAttribute(i);break}if(c==null||typeof c=="function"||typeof c=="symbol"||typeof c=="boolean"){t.removeAttribute(i);break}c=Ta(""+c),t.setAttribute(i,c);break;case"action":case"formAction":if(typeof c=="function"){t.setAttribute(i,"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 b=="function"&&(i==="formAction"?(a!=="input"&&jt(t,a,"name",m.name,m,null),jt(t,a,"formEncType",m.formEncType,m,null),jt(t,a,"formMethod",m.formMethod,m,null),jt(t,a,"formTarget",m.formTarget,m,null)):(jt(t,a,"encType",m.encType,m,null),jt(t,a,"method",m.method,m,null),jt(t,a,"target",m.target,m,null)));if(c==null||typeof c=="symbol"||typeof c=="boolean"){t.removeAttribute(i);break}c=Ta(""+c),t.setAttribute(i,c);break;case"onClick":c!=null&&(t.onclick=ke);break;case"onScroll":c!=null&<("scroll",t);break;case"onScrollEnd":c!=null&<("scrollend",t);break;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error(l(61));if(i=c.__html,i!=null){if(m.children!=null)throw Error(l(60));t.innerHTML=i}}break;case"multiple":t.multiple=c&&typeof c!="function"&&typeof c!="symbol";break;case"muted":t.muted=c&&typeof c!="function"&&typeof c!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(c==null||typeof c=="function"||typeof c=="boolean"||typeof c=="symbol"){t.removeAttribute("xlink:href");break}i=Ta(""+c),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",i);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":c!=null&&typeof c!="function"&&typeof c!="symbol"?t.setAttribute(i,""+c):t.removeAttribute(i);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":c&&typeof c!="function"&&typeof c!="symbol"?t.setAttribute(i,""):t.removeAttribute(i);break;case"capture":case"download":c===!0?t.setAttribute(i,""):c!==!1&&c!=null&&typeof c!="function"&&typeof c!="symbol"?t.setAttribute(i,c):t.removeAttribute(i);break;case"cols":case"rows":case"size":case"span":c!=null&&typeof c!="function"&&typeof c!="symbol"&&!isNaN(c)&&1<=c?t.setAttribute(i,c):t.removeAttribute(i);break;case"rowSpan":case"start":c==null||typeof c=="function"||typeof c=="symbol"||isNaN(c)?t.removeAttribute(i):t.setAttribute(i,c);break;case"popover":lt("beforetoggle",t),lt("toggle",t),Cn(t,"popover",c);break;case"xlinkActuate":Pn(t,"http://www.w3.org/1999/xlink","xlink:actuate",c);break;case"xlinkArcrole":Pn(t,"http://www.w3.org/1999/xlink","xlink:arcrole",c);break;case"xlinkRole":Pn(t,"http://www.w3.org/1999/xlink","xlink:role",c);break;case"xlinkShow":Pn(t,"http://www.w3.org/1999/xlink","xlink:show",c);break;case"xlinkTitle":Pn(t,"http://www.w3.org/1999/xlink","xlink:title",c);break;case"xlinkType":Pn(t,"http://www.w3.org/1999/xlink","xlink:type",c);break;case"xmlBase":Pn(t,"http://www.w3.org/XML/1998/namespace","xml:base",c);break;case"xmlLang":Pn(t,"http://www.w3.org/XML/1998/namespace","xml:lang",c);break;case"xmlSpace":Pn(t,"http://www.w3.org/XML/1998/namespace","xml:space",c);break;case"is":Cn(t,"is",c);break;case"innerText":case"textContent":break;default:(!(2<i.length)||i[0]!=="o"&&i[0]!=="O"||i[1]!=="n"&&i[1]!=="N")&&(i=ta.get(i)||i,Cn(t,i,c))}}function wd(t,a,i,c,m,b){switch(i){case"style":Nt(t,c,b);break;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error(l(61));if(i=c.__html,i!=null){if(m.children!=null)throw Error(l(60));t.innerHTML=i}}break;case"children":typeof c=="string"?Pe(t,c):(typeof c=="number"||typeof c=="bigint")&&Pe(t,""+c);break;case"onScroll":c!=null&<("scroll",t);break;case"onScrollEnd":c!=null&<("scrollend",t);break;case"onClick":c!=null&&(t.onclick=ke);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!yn.hasOwnProperty(i))e:{if(i[0]==="o"&&i[1]==="n"&&(m=i.endsWith("Capture"),a=i.slice(2,m?i.length-7:void 0),b=t[ve]||null,b=b!=null?b[i]:null,typeof b=="function"&&t.removeEventListener(a,b,m),typeof c=="function")){typeof b!="function"&&b!==null&&(i in t?t[i]=null:t.hasAttribute(i)&&t.removeAttribute(i)),t.addEventListener(a,c,m);break e}i in t?t[i]=c:c===!0?t.setAttribute(i,""):Cn(t,i,c)}}}function En(t,a,i){switch(a){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":lt("error",t),lt("load",t);var c=!1,m=!1,b;for(b in i)if(i.hasOwnProperty(b)){var k=i[b];if(k!=null)switch(b){case"src":c=!0;break;case"srcSet":m=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(l(137,a));default:jt(t,a,b,k,i,null)}}m&&jt(t,a,"srcSet",i.srcSet,i,null),c&&jt(t,a,"src",i.src,i,null);return;case"input":lt("invalid",t);var R=b=k=m=null,$=null,W=null;for(c in i)if(i.hasOwnProperty(c)){var oe=i[c];if(oe!=null)switch(c){case"name":m=oe;break;case"type":k=oe;break;case"checked":$=oe;break;case"defaultChecked":W=oe;break;case"value":b=oe;break;case"defaultValue":R=oe;break;case"children":case"dangerouslySetInnerHTML":if(oe!=null)throw Error(l(137,a));break;default:jt(t,a,c,oe,i,null)}}sl(t,b,R,$,W,k,m,!1);return;case"select":lt("invalid",t),c=k=b=null;for(m in i)if(i.hasOwnProperty(m)&&(R=i[m],R!=null))switch(m){case"value":b=R;break;case"defaultValue":k=R;break;case"multiple":c=R;default:jt(t,a,m,R,i,null)}a=b,i=k,t.multiple=!!c,a!=null?vn(t,!!c,a,!1):i!=null&&vn(t,!!c,i,!0);return;case"textarea":lt("invalid",t),b=m=c=null;for(k in i)if(i.hasOwnProperty(k)&&(R=i[k],R!=null))switch(k){case"value":c=R;break;case"defaultValue":m=R;break;case"children":b=R;break;case"dangerouslySetInnerHTML":if(R!=null)throw Error(l(91));break;default:jt(t,a,k,R,i,null)}$l(t,c,m,b);return;case"option":for($ in i)i.hasOwnProperty($)&&(c=i[$],c!=null)&&($==="selected"?t.selected=c&&typeof c!="function"&&typeof c!="symbol":jt(t,a,$,c,i,null));return;case"dialog":lt("beforetoggle",t),lt("toggle",t),lt("cancel",t),lt("close",t);break;case"iframe":case"object":lt("load",t);break;case"video":case"audio":for(c=0;c<bs.length;c++)lt(bs[c],t);break;case"image":lt("error",t),lt("load",t);break;case"details":lt("toggle",t);break;case"embed":case"source":case"link":lt("error",t),lt("load",t);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(W in i)if(i.hasOwnProperty(W)&&(c=i[W],c!=null))switch(W){case"children":case"dangerouslySetInnerHTML":throw Error(l(137,a));default:jt(t,a,W,c,i,null)}return;default:if(_a(a)){for(oe in i)i.hasOwnProperty(oe)&&(c=i[oe],c!==void 0&&wd(t,a,oe,c,i,void 0));return}}for(R in i)i.hasOwnProperty(R)&&(c=i[R],c!=null&&jt(t,a,R,c,i,null))}function xE(t,a,i,c){switch(a){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var m=null,b=null,k=null,R=null,$=null,W=null,oe=null;for(ne in i){var fe=i[ne];if(i.hasOwnProperty(ne)&&fe!=null)switch(ne){case"checked":break;case"value":break;case"defaultValue":$=fe;default:c.hasOwnProperty(ne)||jt(t,a,ne,null,c,fe)}}for(var J in c){var ne=c[J];if(fe=i[J],c.hasOwnProperty(J)&&(ne!=null||fe!=null))switch(J){case"type":b=ne;break;case"name":m=ne;break;case"checked":W=ne;break;case"defaultChecked":oe=ne;break;case"value":k=ne;break;case"defaultValue":R=ne;break;case"children":case"dangerouslySetInnerHTML":if(ne!=null)throw Error(l(137,a));break;default:ne!==fe&&jt(t,a,J,ne,c,fe)}}Bi(t,k,R,$,W,oe,b,m);return;case"select":ne=k=R=J=null;for(b in i)if($=i[b],i.hasOwnProperty(b)&&$!=null)switch(b){case"value":break;case"multiple":ne=$;default:c.hasOwnProperty(b)||jt(t,a,b,null,c,$)}for(m in c)if(b=c[m],$=i[m],c.hasOwnProperty(m)&&(b!=null||$!=null))switch(m){case"value":J=b;break;case"defaultValue":R=b;break;case"multiple":k=b;default:b!==$&&jt(t,a,m,b,c,$)}a=R,i=k,c=ne,J!=null?vn(t,!!i,J,!1):!!c!=!!i&&(a!=null?vn(t,!!i,a,!0):vn(t,!!i,i?[]:"",!1));return;case"textarea":ne=J=null;for(R in i)if(m=i[R],i.hasOwnProperty(R)&&m!=null&&!c.hasOwnProperty(R))switch(R){case"value":break;case"children":break;default:jt(t,a,R,null,c,m)}for(k in c)if(m=c[k],b=i[k],c.hasOwnProperty(k)&&(m!=null||b!=null))switch(k){case"value":J=m;break;case"defaultValue":ne=m;break;case"children":break;case"dangerouslySetInnerHTML":if(m!=null)throw Error(l(91));break;default:m!==b&&jt(t,a,k,m,c,b)}yo(t,J,ne);return;case"option":for(var Re in i)J=i[Re],i.hasOwnProperty(Re)&&J!=null&&!c.hasOwnProperty(Re)&&(Re==="selected"?t.selected=!1:jt(t,a,Re,null,c,J));for($ in c)J=c[$],ne=i[$],c.hasOwnProperty($)&&J!==ne&&(J!=null||ne!=null)&&($==="selected"?t.selected=J&&typeof J!="function"&&typeof J!="symbol":jt(t,a,$,J,c,ne));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 He in i)J=i[He],i.hasOwnProperty(He)&&J!=null&&!c.hasOwnProperty(He)&&jt(t,a,He,null,c,J);for(W in c)if(J=c[W],ne=i[W],c.hasOwnProperty(W)&&J!==ne&&(J!=null||ne!=null))switch(W){case"children":case"dangerouslySetInnerHTML":if(J!=null)throw Error(l(137,a));break;default:jt(t,a,W,J,c,ne)}return;default:if(_a(a)){for(var Mt in i)J=i[Mt],i.hasOwnProperty(Mt)&&J!==void 0&&!c.hasOwnProperty(Mt)&&wd(t,a,Mt,void 0,c,J);for(oe in c)J=c[oe],ne=i[oe],!c.hasOwnProperty(oe)||J===ne||J===void 0&&ne===void 0||wd(t,a,oe,J,c,ne);return}}for(var V in i)J=i[V],i.hasOwnProperty(V)&&J!=null&&!c.hasOwnProperty(V)&&jt(t,a,V,null,c,J);for(fe in c)J=c[fe],ne=i[fe],!c.hasOwnProperty(fe)||J===ne||J==null&&ne==null||jt(t,a,fe,J,c,ne)}function xb(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function bE(){if(typeof performance.getEntriesByType=="function"){for(var t=0,a=0,i=performance.getEntriesByType("resource"),c=0;c<i.length;c++){var m=i[c],b=m.transferSize,k=m.initiatorType,R=m.duration;if(b&&R&&xb(k)){for(k=0,R=m.responseEnd,c+=1;c<i.length;c++){var $=i[c],W=$.startTime;if(W>R)break;var oe=$.transferSize,fe=$.initiatorType;oe&&xb(fe)&&($=$.responseEnd,k+=oe*($<R?1:(R-W)/($-W)))}if(--c,a+=8*(b+k)/(m.duration/1e3),t++,10<t)break}}if(0<t)return a/t/1e6}return navigator.connection&&(t=navigator.connection.downlink,typeof t=="number")?t:5}var kd=null,Sd=null;function gu(t){return t.nodeType===9?t:t.ownerDocument}function bb(t){switch(t){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function yb(t,a){if(t===0)switch(a){case"svg":return 1;case"math":return 2;default:return 0}return t===1&&a==="foreignObject"?0:t}function Ed(t,a){return t==="textarea"||t==="noscript"||typeof a.children=="string"||typeof a.children=="number"||typeof a.children=="bigint"||typeof a.dangerouslySetInnerHTML=="object"&&a.dangerouslySetInnerHTML!==null&&a.dangerouslySetInnerHTML.__html!=null}var Nd=null;function yE(){var t=window.event;return t&&t.type==="popstate"?t===Nd?!1:(Nd=t,!0):(Nd=null,!1)}var vb=typeof setTimeout=="function"?setTimeout:void 0,vE=typeof clearTimeout=="function"?clearTimeout:void 0,wb=typeof Promise=="function"?Promise:void 0,wE=typeof queueMicrotask=="function"?queueMicrotask:typeof wb<"u"?function(t){return wb.resolve(null).then(t).catch(kE)}:vb;function kE(t){setTimeout(function(){throw t})}function qa(t){return t==="head"}function kb(t,a){var i=a,c=0;do{var m=i.nextSibling;if(t.removeChild(i),m&&m.nodeType===8)if(i=m.data,i==="/$"||i==="/&"){if(c===0){t.removeChild(m),mi(a);return}c--}else if(i==="$"||i==="$?"||i==="$~"||i==="$!"||i==="&")c++;else if(i==="html")vs(t.ownerDocument.documentElement);else if(i==="head"){i=t.ownerDocument.head,vs(i);for(var b=i.firstChild;b;){var k=b.nextSibling,R=b.nodeName;b[Oe]||R==="SCRIPT"||R==="STYLE"||R==="LINK"&&b.rel.toLowerCase()==="stylesheet"||i.removeChild(b),b=k}}else i==="body"&&vs(t.ownerDocument.body);i=m}while(i);mi(a)}function Sb(t,a){var i=t;t=0;do{var c=i.nextSibling;if(i.nodeType===1?a?(i._stashedDisplay=i.style.display,i.style.display="none"):(i.style.display=i._stashedDisplay||"",i.getAttribute("style")===""&&i.removeAttribute("style")):i.nodeType===3&&(a?(i._stashedText=i.nodeValue,i.nodeValue=""):i.nodeValue=i._stashedText||""),c&&c.nodeType===8)if(i=c.data,i==="/$"){if(t===0)break;t--}else i!=="$"&&i!=="$?"&&i!=="$~"&&i!=="$!"||t++;i=c}while(i)}function _d(t){var a=t.firstChild;for(a&&a.nodeType===10&&(a=a.nextSibling);a;){var i=a;switch(a=a.nextSibling,i.nodeName){case"HTML":case"HEAD":case"BODY":_d(i),F(i);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(i.rel.toLowerCase()==="stylesheet")continue}t.removeChild(i)}}function SE(t,a,i,c){for(;t.nodeType===1;){var m=i;if(t.nodeName.toLowerCase()!==a.toLowerCase()){if(!c&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(c){if(!t[Oe])switch(a){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(b=t.getAttribute("rel"),b==="stylesheet"&&t.hasAttribute("data-precedence"))break;if(b!==m.rel||t.getAttribute("href")!==(m.href==null||m.href===""?null:m.href)||t.getAttribute("crossorigin")!==(m.crossOrigin==null?null:m.crossOrigin)||t.getAttribute("title")!==(m.title==null?null:m.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(b=t.getAttribute("src"),(b!==(m.src==null?null:m.src)||t.getAttribute("type")!==(m.type==null?null:m.type)||t.getAttribute("crossorigin")!==(m.crossOrigin==null?null:m.crossOrigin))&&b&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(a==="input"&&t.type==="hidden"){var b=m.name==null?null:""+m.name;if(m.type==="hidden"&&t.getAttribute("name")===b)return t}else return t;if(t=Sr(t.nextSibling),t===null)break}return null}function EE(t,a,i){if(a==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!i||(t=Sr(t.nextSibling),t===null))return null;return t}function Eb(t,a){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!a||(t=Sr(t.nextSibling),t===null))return null;return t}function Td(t){return t.data==="$?"||t.data==="$~"}function Ad(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function NE(t,a){var i=t.ownerDocument;if(t.data==="$~")t._reactRetry=a;else if(t.data!=="$?"||i.readyState!=="loading")a();else{var c=function(){a(),i.removeEventListener("DOMContentLoaded",c)};i.addEventListener("DOMContentLoaded",c),t._reactRetry=c}}function Sr(t){for(;t!=null;t=t.nextSibling){var a=t.nodeType;if(a===1||a===3)break;if(a===8){if(a=t.data,a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"||a==="F!"||a==="F")break;if(a==="/$"||a==="/&")return null}}return t}var Cd=null;function Nb(t){t=t.nextSibling;for(var a=0;t;){if(t.nodeType===8){var i=t.data;if(i==="/$"||i==="/&"){if(a===0)return Sr(t.nextSibling);a--}else i!=="$"&&i!=="$!"&&i!=="$?"&&i!=="$~"&&i!=="&"||a++}t=t.nextSibling}return null}function _b(t){t=t.previousSibling;for(var a=0;t;){if(t.nodeType===8){var i=t.data;if(i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"){if(a===0)return t;a--}else i!=="/$"&&i!=="/&"||a++}t=t.previousSibling}return null}function Tb(t,a,i){switch(a=gu(i),t){case"html":if(t=a.documentElement,!t)throw Error(l(452));return t;case"head":if(t=a.head,!t)throw Error(l(453));return t;case"body":if(t=a.body,!t)throw Error(l(454));return t;default:throw Error(l(451))}}function vs(t){for(var a=t.attributes;a.length;)t.removeAttributeNode(a[0]);F(t)}var Er=new Map,Ab=new Set;function xu(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var xa=K.d;K.d={f:_E,r:TE,D:AE,C:CE,L:RE,m:jE,X:OE,S:ME,M:DE};function _E(){var t=xa.f(),a=ou();return t||a}function TE(t){var a=Te(t);a!==null&&a.tag===5&&a.type==="form"?qg(a):xa.r(t)}var di=typeof document>"u"?null:document;function Cb(t,a,i){var c=di;if(c&&typeof a=="string"&&a){var m=Fn(a);m='link[rel="'+t+'"][href="'+m+'"]',typeof i=="string"&&(m+='[crossorigin="'+i+'"]'),Ab.has(m)||(Ab.add(m),t={rel:t,crossOrigin:i,href:a},c.querySelector(m)===null&&(a=c.createElement("link"),En(a,"link",t),Ze(a),c.head.appendChild(a)))}}function AE(t){xa.D(t),Cb("dns-prefetch",t,null)}function CE(t,a){xa.C(t,a),Cb("preconnect",t,a)}function RE(t,a,i){xa.L(t,a,i);var c=di;if(c&&t&&a){var m='link[rel="preload"][as="'+Fn(a)+'"]';a==="image"&&i&&i.imageSrcSet?(m+='[imagesrcset="'+Fn(i.imageSrcSet)+'"]',typeof i.imageSizes=="string"&&(m+='[imagesizes="'+Fn(i.imageSizes)+'"]')):m+='[href="'+Fn(t)+'"]';var b=m;switch(a){case"style":b=hi(t);break;case"script":b=pi(t)}Er.has(b)||(t=g({rel:"preload",href:a==="image"&&i&&i.imageSrcSet?void 0:t,as:a},i),Er.set(b,t),c.querySelector(m)!==null||a==="style"&&c.querySelector(ws(b))||a==="script"&&c.querySelector(ks(b))||(a=c.createElement("link"),En(a,"link",t),Ze(a),c.head.appendChild(a)))}}function jE(t,a){xa.m(t,a);var i=di;if(i&&t){var c=a&&typeof a.as=="string"?a.as:"script",m='link[rel="modulepreload"][as="'+Fn(c)+'"][href="'+Fn(t)+'"]',b=m;switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":b=pi(t)}if(!Er.has(b)&&(t=g({rel:"modulepreload",href:t},a),Er.set(b,t),i.querySelector(m)===null)){switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(i.querySelector(ks(b)))return}c=i.createElement("link"),En(c,"link",t),Ze(c),i.head.appendChild(c)}}}function ME(t,a,i){xa.S(t,a,i);var c=di;if(c&&t){var m=Ht(c).hoistableStyles,b=hi(t);a=a||"default";var k=m.get(b);if(!k){var R={loading:0,preload:null};if(k=c.querySelector(ws(b)))R.loading=5;else{t=g({rel:"stylesheet",href:t,"data-precedence":a},i),(i=Er.get(b))&&Rd(t,i);var $=k=c.createElement("link");Ze($),En($,"link",t),$._p=new Promise(function(W,oe){$.onload=W,$.onerror=oe}),$.addEventListener("load",function(){R.loading|=1}),$.addEventListener("error",function(){R.loading|=2}),R.loading|=4,bu(k,a,c)}k={type:"stylesheet",instance:k,count:1,state:R},m.set(b,k)}}}function OE(t,a){xa.X(t,a);var i=di;if(i&&t){var c=Ht(i).hoistableScripts,m=pi(t),b=c.get(m);b||(b=i.querySelector(ks(m)),b||(t=g({src:t,async:!0},a),(a=Er.get(m))&&jd(t,a),b=i.createElement("script"),Ze(b),En(b,"link",t),i.head.appendChild(b)),b={type:"script",instance:b,count:1,state:null},c.set(m,b))}}function DE(t,a){xa.M(t,a);var i=di;if(i&&t){var c=Ht(i).hoistableScripts,m=pi(t),b=c.get(m);b||(b=i.querySelector(ks(m)),b||(t=g({src:t,async:!0,type:"module"},a),(a=Er.get(m))&&jd(t,a),b=i.createElement("script"),Ze(b),En(b,"link",t),i.head.appendChild(b)),b={type:"script",instance:b,count:1,state:null},c.set(m,b))}}function Rb(t,a,i,c){var m=(m=ie.current)?xu(m):null;if(!m)throw Error(l(446));switch(t){case"meta":case"title":return null;case"style":return typeof i.precedence=="string"&&typeof i.href=="string"?(a=hi(i.href),i=Ht(m).hoistableStyles,c=i.get(a),c||(c={type:"style",instance:null,count:0,state:null},i.set(a,c)),c):{type:"void",instance:null,count:0,state:null};case"link":if(i.rel==="stylesheet"&&typeof i.href=="string"&&typeof i.precedence=="string"){t=hi(i.href);var b=Ht(m).hoistableStyles,k=b.get(t);if(k||(m=m.ownerDocument||m,k={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},b.set(t,k),(b=m.querySelector(ws(t)))&&!b._p&&(k.instance=b,k.state.loading=5),Er.has(t)||(i={rel:"preload",as:"style",href:i.href,crossOrigin:i.crossOrigin,integrity:i.integrity,media:i.media,hrefLang:i.hrefLang,referrerPolicy:i.referrerPolicy},Er.set(t,i),b||zE(m,t,i,k.state))),a&&c===null)throw Error(l(528,""));return k}if(a&&c!==null)throw Error(l(529,""));return null;case"script":return a=i.async,i=i.src,typeof i=="string"&&a&&typeof a!="function"&&typeof a!="symbol"?(a=pi(i),i=Ht(m).hoistableScripts,c=i.get(a),c||(c={type:"script",instance:null,count:0,state:null},i.set(a,c)),c):{type:"void",instance:null,count:0,state:null};default:throw Error(l(444,t))}}function hi(t){return'href="'+Fn(t)+'"'}function ws(t){return'link[rel="stylesheet"]['+t+"]"}function jb(t){return g({},t,{"data-precedence":t.precedence,precedence:null})}function zE(t,a,i,c){t.querySelector('link[rel="preload"][as="style"]['+a+"]")?c.loading=1:(a=t.createElement("link"),c.preload=a,a.addEventListener("load",function(){return c.loading|=1}),a.addEventListener("error",function(){return c.loading|=2}),En(a,"link",i),Ze(a),t.head.appendChild(a))}function pi(t){return'[src="'+Fn(t)+'"]'}function ks(t){return"script[async]"+t}function Mb(t,a,i){if(a.count++,a.instance===null)switch(a.type){case"style":var c=t.querySelector('style[data-href~="'+Fn(i.href)+'"]');if(c)return a.instance=c,Ze(c),c;var m=g({},i,{"data-href":i.href,"data-precedence":i.precedence,href:null,precedence:null});return c=(t.ownerDocument||t).createElement("style"),Ze(c),En(c,"style",m),bu(c,i.precedence,t),a.instance=c;case"stylesheet":m=hi(i.href);var b=t.querySelector(ws(m));if(b)return a.state.loading|=4,a.instance=b,Ze(b),b;c=jb(i),(m=Er.get(m))&&Rd(c,m),b=(t.ownerDocument||t).createElement("link"),Ze(b);var k=b;return k._p=new Promise(function(R,$){k.onload=R,k.onerror=$}),En(b,"link",c),a.state.loading|=4,bu(b,i.precedence,t),a.instance=b;case"script":return b=pi(i.src),(m=t.querySelector(ks(b)))?(a.instance=m,Ze(m),m):(c=i,(m=Er.get(b))&&(c=g({},i),jd(c,m)),t=t.ownerDocument||t,m=t.createElement("script"),Ze(m),En(m,"link",c),t.head.appendChild(m),a.instance=m);case"void":return null;default:throw Error(l(443,a.type))}else a.type==="stylesheet"&&(a.state.loading&4)===0&&(c=a.instance,a.state.loading|=4,bu(c,i.precedence,t));return a.instance}function bu(t,a,i){for(var c=i.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),m=c.length?c[c.length-1]:null,b=m,k=0;k<c.length;k++){var R=c[k];if(R.dataset.precedence===a)b=R;else if(b!==m)break}b?b.parentNode.insertBefore(t,b.nextSibling):(a=i.nodeType===9?i.head:i,a.insertBefore(t,a.firstChild))}function Rd(t,a){t.crossOrigin==null&&(t.crossOrigin=a.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=a.referrerPolicy),t.title==null&&(t.title=a.title)}function jd(t,a){t.crossOrigin==null&&(t.crossOrigin=a.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=a.referrerPolicy),t.integrity==null&&(t.integrity=a.integrity)}var yu=null;function Ob(t,a,i){if(yu===null){var c=new Map,m=yu=new Map;m.set(i,c)}else m=yu,c=m.get(i),c||(c=new Map,m.set(i,c));if(c.has(t))return c;for(c.set(t,null),i=i.getElementsByTagName(t),m=0;m<i.length;m++){var b=i[m];if(!(b[Oe]||b[Bt]||t==="link"&&b.getAttribute("rel")==="stylesheet")&&b.namespaceURI!=="http://www.w3.org/2000/svg"){var k=b.getAttribute(a)||"";k=t+k;var R=c.get(k);R?R.push(b):c.set(k,[b])}}return c}function Db(t,a,i){t=t.ownerDocument||t,t.head.insertBefore(i,a==="title"?t.querySelector("head > title"):null)}function LE(t,a,i){if(i===1||a.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof a.precedence!="string"||typeof a.href!="string"||a.href==="")break;return!0;case"link":if(typeof a.rel!="string"||typeof a.href!="string"||a.href===""||a.onLoad||a.onError)break;return a.rel==="stylesheet"?(t=a.disabled,typeof a.precedence=="string"&&t==null):!0;case"script":if(a.async&&typeof a.async!="function"&&typeof a.async!="symbol"&&!a.onLoad&&!a.onError&&a.src&&typeof a.src=="string")return!0}return!1}function zb(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function BE(t,a,i,c){if(i.type==="stylesheet"&&(typeof c.media!="string"||matchMedia(c.media).matches!==!1)&&(i.state.loading&4)===0){if(i.instance===null){var m=hi(c.href),b=a.querySelector(ws(m));if(b){a=b._p,a!==null&&typeof a=="object"&&typeof a.then=="function"&&(t.count++,t=vu.bind(t),a.then(t,t)),i.state.loading|=4,i.instance=b,Ze(b);return}b=a.ownerDocument||a,c=jb(c),(m=Er.get(m))&&Rd(c,m),b=b.createElement("link"),Ze(b);var k=b;k._p=new Promise(function(R,$){k.onload=R,k.onerror=$}),En(b,"link",c),i.instance=b}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(i,a),(a=i.state.preload)&&(i.state.loading&3)===0&&(t.count++,i=vu.bind(t),a.addEventListener("load",i),a.addEventListener("error",i))}}var Md=0;function IE(t,a){return t.stylesheets&&t.count===0&&ku(t,t.stylesheets),0<t.count||0<t.imgCount?function(i){var c=setTimeout(function(){if(t.stylesheets&&ku(t,t.stylesheets),t.unsuspend){var b=t.unsuspend;t.unsuspend=null,b()}},6e4+a);0<t.imgBytes&&Md===0&&(Md=62500*bE());var m=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&ku(t,t.stylesheets),t.unsuspend)){var b=t.unsuspend;t.unsuspend=null,b()}},(t.imgBytes>Md?50:800)+a);return t.unsuspend=i,function(){t.unsuspend=null,clearTimeout(c),clearTimeout(m)}}:null}function vu(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)ku(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var wu=null;function ku(t,a){t.stylesheets=null,t.unsuspend!==null&&(t.count++,wu=new Map,a.forEach(UE,t),wu=null,vu.call(t))}function UE(t,a){if(!(a.state.loading&4)){var i=wu.get(t);if(i)var c=i.get(null);else{i=new Map,wu.set(t,i);for(var m=t.querySelectorAll("link[data-precedence],style[data-precedence]"),b=0;b<m.length;b++){var k=m[b];(k.nodeName==="LINK"||k.getAttribute("media")!=="not all")&&(i.set(k.dataset.precedence,k),c=k)}c&&i.set(null,c)}m=a.instance,k=m.getAttribute("data-precedence"),b=i.get(k)||c,b===c&&i.set(null,m),i.set(k,m),this.count++,c=vu.bind(this),m.addEventListener("load",c),m.addEventListener("error",c),b?b.parentNode.insertBefore(m,b.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(m,t.firstChild)),a.state.loading|=4}}var Ss={$$typeof:C,Provider:null,Consumer:null,_currentValue:le,_currentValue2:le,_threadCount:0};function $E(t,a,i,c,m,b,k,R,$){this.tag=1,this.containerInfo=t,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=vt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=vt(0),this.hiddenUpdates=vt(null),this.identifierPrefix=c,this.onUncaughtError=m,this.onCaughtError=b,this.onRecoverableError=k,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=$,this.incompleteTransitions=new Map}function Lb(t,a,i,c,m,b,k,R,$,W,oe,fe){return t=new $E(t,a,i,k,$,W,oe,fe,R),a=1,b===!0&&(a|=24),b=ar(3,null,null,a),t.current=b,b.stateNode=t,a=ff(),a.refCount++,t.pooledCache=a,a.refCount++,b.memoizedState={element:c,isDehydrated:i,cache:a},mf(b),t}function Bb(t){return t?(t=ql,t):ql}function Ib(t,a,i,c,m,b){m=Bb(m),c.context===null?c.context=m:c.pendingContext=m,c=Da(a),c.payload={element:i},b=b===void 0?null:b,b!==null&&(c.callback=b),i=za(t,c,a),i!==null&&(Kn(i,t,a),ts(i,t,a))}function Ub(t,a){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var i=t.retryLane;t.retryLane=i!==0&&i<a?i:a}}function Od(t,a){Ub(t,a),(t=t.alternate)&&Ub(t,a)}function $b(t){if(t.tag===13||t.tag===31){var a=fl(t,67108864);a!==null&&Kn(a,t,67108864),Od(t,67108864)}}function Hb(t){if(t.tag===13||t.tag===31){var a=ur();a=rt(a);var i=fl(t,a);i!==null&&Kn(i,t,a),Od(t,a)}}var Su=!0;function HE(t,a,i,c){var m=M.T;M.T=null;var b=K.p;try{K.p=2,Dd(t,a,i,c)}finally{K.p=b,M.T=m}}function PE(t,a,i,c){var m=M.T;M.T=null;var b=K.p;try{K.p=8,Dd(t,a,i,c)}finally{K.p=b,M.T=m}}function Dd(t,a,i,c){if(Su){var m=zd(c);if(m===null)vd(t,a,c,Eu,i),Fb(t,c);else if(GE(m,t,a,i,c))c.stopPropagation();else if(Fb(t,c),a&4&&-1<FE.indexOf(t)){for(;m!==null;){var b=Te(m);if(b!==null)switch(b.tag){case 3:if(b=b.stateNode,b.current.memoizedState.isDehydrated){var k=Kt(b.pendingLanes);if(k!==0){var R=b;for(R.pendingLanes|=2,R.entangledLanes|=2;k;){var $=1<<31-Fe(k);R.entanglements[1]|=$,k&=~$}qr(b),(yt&6)===0&&(iu=Et()+500,xs(0))}}break;case 31:case 13:R=fl(b,2),R!==null&&Kn(R,b,2),ou(),Od(b,2)}if(b=zd(c),b===null&&vd(t,a,c,Eu,i),b===m)break;m=b}m!==null&&c.stopPropagation()}else vd(t,a,c,null,i)}}function zd(t){return t=Xe(t),Ld(t)}var Eu=null;function Ld(t){if(Eu=null,t=de(t),t!==null){var a=o(t);if(a===null)t=null;else{var i=a.tag;if(i===13){if(t=u(a),t!==null)return t;t=null}else if(i===31){if(t=f(a),t!==null)return t;t=null}else if(i===3){if(a.stateNode.current.memoizedState.isDehydrated)return a.tag===3?a.stateNode.containerInfo:null;t=null}else a!==t&&(t=null)}}return Eu=t,null}function Pb(t){switch(t){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(bn()){case re:return 2;case me:return 8;case Me:case Ge:return 32;case nt:return 268435456;default:return 32}default:return 32}}var Bd=!1,Ya=null,Va=null,Xa=null,Es=new Map,Ns=new Map,Ka=[],FE="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 Fb(t,a){switch(t){case"focusin":case"focusout":Ya=null;break;case"dragenter":case"dragleave":Va=null;break;case"mouseover":case"mouseout":Xa=null;break;case"pointerover":case"pointerout":Es.delete(a.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ns.delete(a.pointerId)}}function _s(t,a,i,c,m,b){return t===null||t.nativeEvent!==b?(t={blockedOn:a,domEventName:i,eventSystemFlags:c,nativeEvent:b,targetContainers:[m]},a!==null&&(a=Te(a),a!==null&&$b(a)),t):(t.eventSystemFlags|=c,a=t.targetContainers,m!==null&&a.indexOf(m)===-1&&a.push(m),t)}function GE(t,a,i,c,m){switch(a){case"focusin":return Ya=_s(Ya,t,a,i,c,m),!0;case"dragenter":return Va=_s(Va,t,a,i,c,m),!0;case"mouseover":return Xa=_s(Xa,t,a,i,c,m),!0;case"pointerover":var b=m.pointerId;return Es.set(b,_s(Es.get(b)||null,t,a,i,c,m)),!0;case"gotpointercapture":return b=m.pointerId,Ns.set(b,_s(Ns.get(b)||null,t,a,i,c,m)),!0}return!1}function Gb(t){var a=de(t.target);if(a!==null){var i=o(a);if(i!==null){if(a=i.tag,a===13){if(a=u(i),a!==null){t.blockedOn=a,Hr(t.priority,function(){Hb(i)});return}}else if(a===31){if(a=f(i),a!==null){t.blockedOn=a,Hr(t.priority,function(){Hb(i)});return}}else if(a===3&&i.stateNode.current.memoizedState.isDehydrated){t.blockedOn=i.tag===3?i.stateNode.containerInfo:null;return}}}t.blockedOn=null}function Nu(t){if(t.blockedOn!==null)return!1;for(var a=t.targetContainers;0<a.length;){var i=zd(t.nativeEvent);if(i===null){i=t.nativeEvent;var c=new i.constructor(i.type,i);De=c,i.target.dispatchEvent(c),De=null}else return a=Te(i),a!==null&&$b(a),t.blockedOn=i,!1;a.shift()}return!0}function qb(t,a,i){Nu(t)&&i.delete(a)}function qE(){Bd=!1,Ya!==null&&Nu(Ya)&&(Ya=null),Va!==null&&Nu(Va)&&(Va=null),Xa!==null&&Nu(Xa)&&(Xa=null),Es.forEach(qb),Ns.forEach(qb)}function _u(t,a){t.blockedOn===a&&(t.blockedOn=null,Bd||(Bd=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,qE)))}var Tu=null;function Yb(t){Tu!==t&&(Tu=t,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Tu===t&&(Tu=null);for(var a=0;a<t.length;a+=3){var i=t[a],c=t[a+1],m=t[a+2];if(typeof c!="function"){if(Ld(c||i)===null)continue;break}var b=Te(i);b!==null&&(t.splice(a,3),a-=3,zf(b,{pending:!0,data:m,method:i.method,action:c},c,m))}}))}function mi(t){function a($){return _u($,t)}Ya!==null&&_u(Ya,t),Va!==null&&_u(Va,t),Xa!==null&&_u(Xa,t),Es.forEach(a),Ns.forEach(a);for(var i=0;i<Ka.length;i++){var c=Ka[i];c.blockedOn===t&&(c.blockedOn=null)}for(;0<Ka.length&&(i=Ka[0],i.blockedOn===null);)Gb(i),i.blockedOn===null&&Ka.shift();if(i=(t.ownerDocument||t).$$reactFormReplay,i!=null)for(c=0;c<i.length;c+=3){var m=i[c],b=i[c+1],k=m[ve]||null;if(typeof b=="function")k||Yb(i);else if(k){var R=null;if(b&&b.hasAttribute("formAction")){if(m=b,k=b[ve]||null)R=k.formAction;else if(Ld(m)!==null)continue}else R=k.action;typeof R=="function"?i[c+1]=R:(i.splice(c,3),c-=3),Yb(i)}}}function Vb(){function t(b){b.canIntercept&&b.info==="react-transition"&&b.intercept({handler:function(){return new Promise(function(k){return m=k})},focusReset:"manual",scroll:"manual"})}function a(){m!==null&&(m(),m=null),c||setTimeout(i,20)}function i(){if(!c&&!navigation.transition){var b=navigation.currentEntry;b&&b.url!=null&&navigation.navigate(b.url,{state:b.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var c=!1,m=null;return navigation.addEventListener("navigate",t),navigation.addEventListener("navigatesuccess",a),navigation.addEventListener("navigateerror",a),setTimeout(i,100),function(){c=!0,navigation.removeEventListener("navigate",t),navigation.removeEventListener("navigatesuccess",a),navigation.removeEventListener("navigateerror",a),m!==null&&(m(),m=null)}}}function Id(t){this._internalRoot=t}Au.prototype.render=Id.prototype.render=function(t){var a=this._internalRoot;if(a===null)throw Error(l(409));var i=a.current,c=ur();Ib(i,c,t,a,null,null)},Au.prototype.unmount=Id.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var a=t.containerInfo;Ib(t.current,2,null,t,null,null),ou(),a[wt]=null}};function Au(t){this._internalRoot=t}Au.prototype.unstable_scheduleHydration=function(t){if(t){var a=Cr();t={blockedOn:null,target:t,priority:a};for(var i=0;i<Ka.length&&a!==0&&a<Ka[i].priority;i++);Ka.splice(i,0,t),i===0&&Gb(t)}};var Xb=n.version;if(Xb!=="19.2.4")throw Error(l(527,Xb,"19.2.4"));K.findDOMNode=function(t){var a=t._reactInternals;if(a===void 0)throw typeof t.render=="function"?Error(l(188)):(t=Object.keys(t).join(","),Error(l(268,t)));return t=p(a),t=t!==null?x(t):null,t=t===null?null:t.stateNode,t};var YE={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:M,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Cu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Cu.isDisabled&&Cu.supportsFiber)try{qt=Cu.inject(YE),mt=Cu}catch{}}return As.createRoot=function(t,a){if(!s(t))throw Error(l(299));var i=!1,c="",m=tx,b=nx,k=rx;return a!=null&&(a.unstable_strictMode===!0&&(i=!0),a.identifierPrefix!==void 0&&(c=a.identifierPrefix),a.onUncaughtError!==void 0&&(m=a.onUncaughtError),a.onCaughtError!==void 0&&(b=a.onCaughtError),a.onRecoverableError!==void 0&&(k=a.onRecoverableError)),a=Lb(t,1,!1,null,null,i,c,null,m,b,k,Vb),t[wt]=a.current,yd(t),new Id(a)},As.hydrateRoot=function(t,a,i){if(!s(t))throw Error(l(299));var c=!1,m="",b=tx,k=nx,R=rx,$=null;return i!=null&&(i.unstable_strictMode===!0&&(c=!0),i.identifierPrefix!==void 0&&(m=i.identifierPrefix),i.onUncaughtError!==void 0&&(b=i.onUncaughtError),i.onCaughtError!==void 0&&(k=i.onCaughtError),i.onRecoverableError!==void 0&&(R=i.onRecoverableError),i.formState!==void 0&&($=i.formState)),a=Lb(t,1,!0,a,i??null,c,m,$,b,k,R,Vb),a.context=Bb(null),i=a.current,c=ur(),c=rt(c),m=Da(c),m.callback=null,za(i,m,c),i=c,a.current.lanes=i,ft(a,i),qr(a),t[wt]=a.current,yd(t),new Au(a)},As.version="19.2.4",As}var ay;function r2(){if(ay)return Hd.exports;ay=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(n){console.error(n)}}return e(),Hd.exports=n2(),Hd.exports}var a2=r2();const Bh="codekin-settings",qd={token:"",fontSize:16,theme:"dark"};function l2(){try{const e=localStorage.getItem(Bh),n=e?JSON.parse(e):null,r={...qd,token:n?.token??qd.token,theme:n?.theme==="light"?"light":"dark"},l=new URL(window.location.href),s=l.searchParams.get("token");return s&&(r.token=s,localStorage.setItem(Bh,JSON.stringify(r)),l.searchParams.delete("token"),window.history.replaceState({},"",l.pathname+l.search+l.hash)),r}catch{return qd}}function i2(e){localStorage.setItem(Bh,JSON.stringify(e))}function s2(){const[e,n]=w.useState(l2),r=w.useCallback(l=>{n(s=>{const o={...s,...l};return i2(o),o})},[]);return{settings:e,updateSettings:r}}function C0(e){const[n,r]=w.useState([]),[l,s]=w.useState([]),[o,u]=w.useState([]),[f,d]=w.useState(!0),[p,x]=w.useState(null),[g,y]=w.useState(!1),v=n.flatMap(N=>N.repos),[S,E]=w.useState(0);w.useEffect(()=>{const N={};e&&(N.Authorization=`Bearer ${e}`),fetch("/cc/api/repos",{headers:N}).then(j=>{if(!j.ok)throw new Error(`Failed to load repos: ${j.status}`);return j.json()}).then(j=>{r(j.groups),s(j.globalSkills??[]),u(j.globalModules??[]),y(j.ghMissing??!1),x(null)}).catch(j=>x(j.message)).finally(()=>d(!1))},[e,S]);const T=w.useCallback(()=>E(N=>N+1),[]);return{groups:n,repos:v,globalSkills:l,globalModules:o,loading:f,error:p,ghMissing:g,refresh:T}}const Wt="/cc",o2="/authelia/login";function rl(e){return{"Content-Type":"application/json",Authorization:`Bearer ${e}`}}let ly=!1;function Gs(){ly||(ly=!0,window.location.href=o2)}function u2(e){if(e.redirected&&e.url.includes("/authelia"))return!0;if(e.status>=502&&e.status<=504)return!1;const n=e.headers.get("content-type")||"";return n.includes("application/json")?!1:!!(e.status===401||e.status===403||e.ok&&n.includes("text/html"))}async function Yd(){try{const e=await fetch(`${Wt}/auth-verify`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:""}),redirect:"manual"});return e.type==="opaqueredirect"?!1:e.status>=502&&e.status<=504?!0:!(e.headers.get("content-type")||"").includes("text/html")}catch{return!0}}async function rn(e,n){const r=n?await fetch(e,n):await fetch(e);if(u2(r))throw Gs(),new Error("Session expired");return r}async function c2(e){const n=await rn(`${Wt}/auth-verify`,{method:"POST",headers:rl(e),body:JSON.stringify({token:e})});return n.ok?(await n.json()).valid===!0:!1}async function f2(e){const n=await rn(`${Wt}/api/sessions/list`,{headers:{Authorization:`Bearer ${e}`}});if(!n.ok)throw new Error(`Failed to list sessions: ${n.status}`);return(await n.json()).sessions??[]}async function d2(e,n,r){const l=await rn(`${Wt}/api/sessions/create`,{method:"POST",headers:rl(e),body:JSON.stringify({name:n,workingDir:r})});if(!l.ok)throw new Error(`Failed to create session: ${l.status}`);return l.json()}async function h2(e,n,r){const l=await rn(`${Wt}/api/sessions/${n}/rename`,{method:"PATCH",headers:rl(e),body:JSON.stringify({name:r})});if(!l.ok)throw new Error(`Failed to rename session: ${l.status}`)}async function p2(e,n){const r=await rn(`${Wt}/api/sessions/${n}`,{method:"DELETE",headers:{Authorization:`Bearer ${e}`}});if(!r.ok)throw new Error(`Failed to delete session: ${r.status}`)}async function m2(e,n){const r=new FormData;r.append("file",n);const l=await rn(`${Wt}/api/upload`,{method:"POST",headers:{Authorization:`Bearer ${e}`},body:r});if(!l.ok)throw new Error(`Upload failed: ${l.status}`);return(await l.json()).path}async function Vd(e,n,r){const s=`[Attached files: ${(await Promise.all(n.map(o=>m2(e,o)))).join(", ")}]`;return r.trim()?`${s}
|
|
10
|
+
${r}`:s}async function Cs(e,n){const r=new URLSearchParams({path:n}),l=await rn(`${Wt}/api/approvals?${r}`,{headers:{Authorization:`Bearer ${e}`}});if(!l.ok)throw new Error(`Failed to fetch approvals: ${l.status}`);return l.json()}async function g2(e,n,r){const l=new URLSearchParams({path:n}),s=await rn(`${Wt}/api/approvals?${l}`,{method:"DELETE",headers:rl(e),body:JSON.stringify(r)});if(!s.ok)throw new Error(`Failed to remove approval: ${s.status}`)}async function x2(e,n,r){const l=new URLSearchParams({path:n}),s=await rn(`${Wt}/api/approvals?${l}`,{method:"DELETE",headers:rl(e),body:JSON.stringify({items:r})});if(!s.ok)throw new Error(`Failed to bulk remove approvals: ${s.status}`)}async function R0(e,n){const r=new URLSearchParams;n&&r.set("workingDir",n);const l=r.toString(),s=await rn(`${Wt}/api/sessions/archived${l?`?${l}`:""}`,{headers:{Authorization:`Bearer ${e}`}});if(!s.ok)throw new Error(`Failed to list archived sessions: ${s.status}`);return(await s.json()).sessions??[]}async function iy(e,n){const r=await rn(`${Wt}/api/sessions/archived/${n}`,{headers:{Authorization:`Bearer ${e}`}});if(!r.ok)throw new Error(`Failed to get archived session: ${r.status}`);return r.json()}async function b2(e,n){const r=await rn(`${Wt}/api/sessions/archived/${n}`,{method:"DELETE",headers:{Authorization:`Bearer ${e}`}});if(!r.ok)throw new Error(`Failed to delete archived session: ${r.status}`)}async function j0(e){const n=await rn(`${Wt}/api/settings/retention`,{headers:{Authorization:`Bearer ${e}`}});if(!n.ok)throw new Error(`Failed to get retention settings: ${n.status}`);return(await n.json()).days}async function M0(e,n){const r=await rn(`${Wt}/api/settings/retention`,{method:"PUT",headers:rl(e),body:JSON.stringify({days:n})});if(!r.ok)throw new Error(`Failed to update retention settings: ${r.status}`);return(await r.json()).days}async function O0(e){const n=await rn(`${Wt}/api/settings/repos-path`,{headers:{Authorization:`Bearer ${e}`}});if(!n.ok)throw new Error(`Failed to get repos path: ${n.status}`);return(await n.json()).path}async function D0(e,n){const r=await rn(`${Wt}/api/settings/repos-path`,{method:"PUT",headers:rl(e),body:JSON.stringify({path:n})});if(!r.ok){const s=await r.json().catch(()=>({error:"Failed to save repos path"}));throw new Error(s.error||`Failed to set repos path: ${r.status}`)}return(await r.json()).path}async function y2(e,n){const r=n?`?path=${encodeURIComponent(n)}`:"",l=await rn(`${Wt}/api/browse-dirs${r}`,{headers:{Authorization:`Bearer ${e}`}});if(!l.ok){const s=await l.json().catch(()=>({error:"Failed to browse directory"}));throw new Error(s.error||`Failed to browse: ${l.status}`)}return l.json()}async function v2(e){const n=await rn(`${Wt}/api/settings/support-provider`,{headers:{Authorization:`Bearer ${e}`}});if(!n.ok)throw new Error(`Failed to get support provider: ${n.status}`);return n.json()}async function w2(e){const n=await rn(`${Wt}/api/webhooks/config`,{headers:{Authorization:`Bearer ${e}`}});if(!n.ok)throw new Error(`Failed to get webhook config: ${n.status}`);return(await n.json()).config}async function k2(e){const n=await rn(`${Wt}/api/webhooks/events`,{headers:{Authorization:`Bearer ${e}`}});if(!n.ok)throw new Error(`Failed to get webhook events: ${n.status}`);return(await n.json()).events??[]}async function S2(e,n){const r=await rn(`${Wt}/api/settings/support-provider`,{method:"PUT",headers:rl(e),body:JSON.stringify({provider:n})});if(!r.ok)throw new Error(`Failed to set support provider: ${r.status}`)}function E2(){return`${location.protocol==="https:"?"wss:":"ws:"}//${location.host}/cc/`}function N2(e){const[n,r]=w.useState([]),[l,s]=w.useState(!1),[o,u]=w.useState(null),f=w.useRef(null),d=w.useCallback(async()=>{if(e)try{const y=await f2(e);r(y),u(null)}catch(y){u(y instanceof Error?y.message:"Failed to load sessions")}},[e]),p=w.useCallback(async(y,v)=>{if(!e)return null;s(!0);try{const S=await d2(e,y,v);return await d(),S.sessionId}catch(S){return u(S instanceof Error?S.message:"Failed to create session"),null}finally{s(!1)}},[e,d]),x=w.useCallback(async(y,v)=>{if(e)try{await h2(e,y,v),await d()}catch(S){u(S instanceof Error?S.message:"Failed to rename session")}},[e,d]),g=w.useCallback(async y=>{if(e)try{await p2(e,y),await d()}catch(v){u(v instanceof Error?v.message:"Failed to delete session")}},[e,d]);return w.useEffect(()=>{if(e)return d(),f.current=setInterval(()=>{d()},1e4),()=>{f.current&&clearInterval(f.current)}},[e,d]),{sessions:n,loading:l,error:o,refresh:d,create:p,rename:x,remove:g}}function _2(){const[e,n]=w.useState(new Map),r=w.useCallback(u=>{const f=u.requestId??crypto?.randomUUID?.()??`local-${Date.now()}-${Math.random().toString(36).slice(2,9)}`,d={requestId:f,options:u.options,question:u.question||null,multiSelect:u.multiSelect??!1,promptType:u.promptType??null,questions:u.questions,approvePattern:u.approvePattern};n(p=>{const x=new Map(p);return x.set(f,d),x})},[]),l=w.useCallback(u=>{n(f=>{if(u){if(!f.has(u))return f;const x=new Map(f);return x.delete(u),x}if(f.size===0)return f;const d=new Map(f),p=d.keys().next().value;return p!==void 0&&d.delete(p),d})},[]),s=w.useCallback(()=>{n(u=>u.size===0?u:new Map)},[]);return{active:e.size>0?e.values().next().value??null:null,queueSize:e.size,enqueue:r,dismiss:l,clearAll:s}}const T2=6e4;function A2({token:e,onMessageRef:n,onDisconnect:r,onHealthPong:l}){const s=w.useRef(null),[o,u]=w.useState("disconnected"),f=w.useRef(null),d=w.useRef(null),p=w.useRef(1e3),x=w.useRef(!1),g=w.useRef(()=>{}),y=w.useRef(!1),v=w.useRef(!1),S=w.useRef(null),E=w.useRef(r),T=w.useRef(l);w.useEffect(()=>{E.current=r},[r]),w.useEffect(()=>{T.current=l},[l]);const N=w.useCallback(()=>{d.current&&(clearInterval(d.current),d.current=null),f.current&&(clearTimeout(f.current),f.current=null),S.current&&(clearTimeout(S.current),S.current=null)},[]),j=w.useCallback(_=>{const z=s.current;z&&z.readyState===WebSocket.OPEN&&z.send(JSON.stringify(_))},[]),C=w.useCallback(()=>{if(!e)return;N(),u("connecting");const _=new WebSocket(E2());s.current=_,_.onopen=()=>{_.send(JSON.stringify({type:"auth",token:e})),u("connected"),p.current=1e3,d.current=setInterval(()=>{j({type:"ping"})},3e4)},_.onmessage=z=>{let P;try{P=JSON.parse(z.data)}catch{return}P.type==="pong"&&v.current&&(v.current=!1,S.current&&(clearTimeout(S.current),S.current=null),T.current?.(j)),n.current?.(P)},_.onclose=z=>{if(u("disconnected"),N(),s.current=null,E.current?.(),z.code===4001){Gs();return}x.current||Yd().then(P=>{if(!P){Gs();return}f.current=setTimeout(()=>{p.current=Math.min(p.current*2,3e4),g.current()},p.current)}).catch(()=>{f.current=setTimeout(g.current,p.current)})},_.onerror=()=>{}},[e,N,j,n]);w.useEffect(()=>{g.current=C},[C]);const I=w.useCallback(()=>{x.current=!0,N(),s.current?.close(),s.current=null,u("disconnected")},[N]),U=w.useCallback(()=>{if(y.current)return;y.current=!0,setTimeout(()=>{y.current=!1},3e3);const _=s.current;if(_&&_.readyState===WebSocket.OPEN){v.current=!0,S.current=setTimeout(()=>{v.current=!1,S.current=null,p.current=1e3,_.close()},2e3),j({type:"ping"});return}_&&_.readyState===WebSocket.CONNECTING||Yd().then(z=>{if(!z){Gs();return}p.current=1e3,f.current&&(clearTimeout(f.current),f.current=null),C()}).catch(()=>{f.current=setTimeout(g.current,p.current)})},[j,C]);return w.useEffect(()=>(e&&(x.current=!1,C()),()=>{I()}),[e]),w.useEffect(()=>{if(!e)return;const _=setInterval(async()=>{await Yd()||Gs()},T2);return()=>clearInterval(_)},[e]),{connState:o,send:j,disconnect:I,restoreSession:U,reconnect:C}}const sy=500;let C2=0;function Nr(){return`m${++C2}`}function z0(e,n){const r=e.length>0?e[e.length-1]:void 0;switch(n.type){case"output":return r&&r.type==="assistant"&&!r.complete?r.text+=n.data:e.push({type:"assistant",text:n.data,complete:!1,ts:Date.now(),key:Nr()}),!0;case"result":return r&&r.type==="assistant"&&!r.complete?(r.complete=!0,!0):!1;case"system_message":return e.push({type:"system",subtype:n.subtype,text:n.text,model:n.model,key:Nr()}),!0;case"user_echo":return e.push({type:"user",text:n.text,ts:Date.now(),key:Nr()}),!0;case"claude_started":return e.push({type:"system",subtype:"init",text:"Session started",key:Nr()}),!0;case"tool_active":return r&&r.type==="tool_group"?r.tools.push({name:n.toolName,active:!0}):e.push({type:"tool_group",tools:[{name:n.toolName,active:!0}],key:Nr()}),!0;case"tool_done":if(r&&r.type==="tool_group"){for(let l=r.tools.length-1;l>=0;l--)if(r.tools[l].name===n.toolName&&r.tools[l].active){r.tools[l]={name:n.toolName,summary:n.summary,active:!1};break}return!0}return!1;case"tool_output":return e.push({type:"tool_output",content:n.content,isError:n.isError,key:Nr()}),!0;case"image":return e.push({type:"image",base64:n.base64,mediaType:n.mediaType,key:Nr()}),!0;case"planning_mode":return e.push({type:"planning_mode",active:n.active,key:Nr()}),!0;default:return!1}}function ba(e,n){const r=[...e],l=r.length-1;if(l>=0){const o=r[l];o.type==="assistant"&&!o.complete?r[l]={...o}:o.type==="tool_group"&&(r[l]={...o,tools:[...o.tools]})}return z0(r,n)?r:e}function Zn(e){return e.length<=sy?e:[{type:"system",subtype:"trim",text:"Older messages trimmed",key:Nr()},...e.slice(-sy+1)]}function Ih(e){const n=[];for(const r of e)z0(n,r);return n}function R2({token:e,onSessionCreated:n,onSessionJoined:r,onSessionRenamed:l,onSessionsUpdated:s,onError:o,onRawMessage:u}){const f=w.useRef({onSessionCreated:n,onSessionJoined:r,onSessionRenamed:l,onSessionsUpdated:s,onError:o,onRawMessage:u});w.useEffect(()=>{f.current={onSessionCreated:n,onSessionJoined:r,onSessionRenamed:l,onSessionsUpdated:s,onError:o,onRawMessage:u}});const[d,p]=w.useState([]),[x,g]=w.useState(!1),[y,v]=w.useState(!1),[S,E]=w.useState([]),[T,N]=w.useState(()=>localStorage.getItem("claude-model")??null),[j,C]=w.useState(null),[I,U]=w.useState({}),{active:_,queueSize:z,enqueue:P,dismiss:X,clearAll:B}=_2(),q=w.useRef(z);w.useEffect(()=>{q.current=z},[z]);const Z=w.useRef(null),ee=w.useRef(""),ae=w.useRef(null),Y=w.useCallback(()=>{ae.current=null;const he=ee.current;he&&(ee.current="",p(xe=>{const _e=xe[xe.length-1];if(_e&&_e.type==="assistant"&&!_e.complete){const et=[...xe];return et[et.length-1]={..._e,text:_e.text+he},Zn(et)}return Zn([...xe,{type:"assistant",text:he,complete:!1,ts:Date.now(),key:Nr()}])}))},[]),M=w.useCallback(()=>{ee.current&&(ae.current&&(cancelAnimationFrame(ae.current),ae.current=null),Y())},[Y]),K=w.useCallback(he=>{switch(f.current.onRawMessage?.(he),he.type){case"thinking":C(he.summary),v(!0);break;case"output":{C(null),v(!0),ee.current+=he.data,ae.current||(ae.current=requestAnimationFrame(Y));break}case"result":v(!1),C(null),M(),p(xe=>Zn(ba(xe,he)));break;case"system_message":he.subtype==="init"&&he.model&&(N(he.model),localStorage.setItem("claude-model",he.model)),M(),p(xe=>Zn(ba(xe,he)));break;case"user_echo":M(),p(xe=>Zn(ba(xe,he)));break;case"tool_active":C(null),v(!0),M(),p(xe=>Zn(ba(xe,he)));break;case"tool_done":M(),p(xe=>Zn(ba(xe,he)));break;case"tool_output":M(),p(xe=>Zn(ba(xe,he)));break;case"image":M(),p(xe=>Zn(ba(xe,he)));break;case"planning_mode":g(he.active),p(xe=>Zn(ba(xe,he)));break;case"todo_update":E(he.tasks);break;case"prompt":{const xe=he.sessionId;if(xe&&xe!==Z.current){U(et=>({...et,[xe]:!0}));break}v(!1),C(null);const _e=Z.current;_e&&U(et=>({...et,[_e]:!0})),P(he);break}case"prompt_dismiss":{if(X(he.requestId),q.current<=1){const xe=Z.current;xe&&U(_e=>_e[xe]?{..._e,[xe]:!1}:_e)}break}case"session_created":Z.current=he.sessionId,p([]),E([]),v(!1),C(null),f.current.onSessionCreated?.(he.sessionId);break;case"session_joined":{Z.current=he.sessionId,v(!1),C(null);let xe=[],_e=!1,et=[];if(he.outputBuffer?.length){xe=Ih(he.outputBuffer);for(const St of he.outputBuffer)St.type==="planning_mode"&&(_e=St.active),St.type==="todo_update"&&(et=St.tasks)}g(_e),E(et),p(Zn(xe)),f.current.onSessionJoined?.(he.sessionId);break}case"claude_started":p(xe=>Zn(ba(xe,he)));break;case"claude_stopped":case"exit":{v(!1),C(null);const xe=Z.current;xe&&U(_e=>_e[xe]?{..._e,[xe]:!1}:_e),B();break}case"error":f.current.onError?.(he.message);break;case"session_deleted":p(xe=>Zn([...xe,{type:"system",subtype:"error",text:"Session was deleted",key:Nr()}]));break;case"connected":case"pong":break;case"session_name_update":f.current.onSessionRenamed?.(he.sessionId,he.name);break;case"sessions_updated":U(xe=>{const _e=Z.current;if(!Object.entries(xe).some(([xn,Ot])=>xn!==_e&&Ot))return xe;const St={};return _e&&xe[_e]&&(St[_e]=!0),St}),f.current.onSessionsUpdated?.();break}},[Y,M,P,X,B]),le=w.useRef(K);w.useEffect(()=>{le.current=K},[K]),w.useEffect(()=>{const he=Z.current;!he||!_||U(xe=>xe[he]?xe:{...xe,[he]:!0})},[_]);const be=w.useCallback(()=>{v(!1),C(null),ae.current&&(cancelAnimationFrame(ae.current),ae.current=null)},[]),O=w.useCallback(he=>{const xe=Z.current;xe&&he({type:"join_session",sessionId:xe})},[]),{connState:D,send:L,disconnect:A,restoreSession:se,reconnect:te}=A2({token:e,onMessageRef:le,onDisconnect:be,onHealthPong:O}),ie=w.useCallback(he=>{L({type:"join_session",sessionId:he})},[L]),Se=w.useCallback((he,xe)=>{L({type:"create_session",name:he,workingDir:xe})},[L]),je=w.useCallback((he,xe)=>{L({type:"input",data:he,...xe?{displayText:xe}:{}}),v(!0);const _e=Z.current;_e&&U(et=>et[_e]?{...et,[_e]:!1}:et),B()},[L,B]),Ae=w.useCallback(he=>{const xe=_?.requestId;L({type:"prompt_response",value:he,requestId:xe}),xe&&X(xe),v(!0);const _e=Z.current;_e&&z<=1&&U(et=>et[_e]?{...et,[_e]:!1}:et)},[L,_?.requestId,X,z]),qe=w.useCallback(()=>{L({type:"leave_session"}),Z.current=null,v(!1),C(null)},[L]),we=w.useCallback(()=>{p([])},[]),Ve=w.useCallback((he,xe="notification")=>{p(_e=>Zn([..._e,{type:"system",subtype:xe,text:he,key:Nr()}]))},[]),Lt=w.useCallback(he=>{L({type:"set_model",model:he}),N(he),localStorage.setItem("claude-model",he)},[L]);return{connState:D,messages:d,tasks:S,planningMode:x,isProcessing:y,thinkingSummary:j,waitingSessions:I,activePrompt:_,promptQueueSize:z,currentModel:T,send:L,joinSession:ie,createSession:Se,sendInput:je,sendPromptResponse:Ae,leaveSession:qe,clearMessages:we,addSystemMessage:Ve,disconnect:A,reconnect:te,restoreSession:se,setModel:Lt}}function j2(e){const n=w.useRef(e);w.useEffect(()=>{n.current=e}),w.useEffect(()=>{function r(){document.visibilityState==="visible"&&n.current()}return document.addEventListener("visibilitychange",r),()=>document.removeEventListener("visibilitychange",r)},[])}function Xd(e){if(e==="/workflows"||e==="/workflows/")return{path:e,sessionId:null,view:"workflows"};const n=e.match(/^\/s\/([a-f0-9-]+)\/?$/);return{path:e,sessionId:n?n[1]:null,view:"chat"}}function M2(){const[e,n]=w.useState(()=>Xd(window.location.pathname));w.useEffect(()=>{function l(){n(Xd(window.location.pathname))}return window.addEventListener("popstate",l),()=>window.removeEventListener("popstate",l)},[]);const r=w.useCallback((l,s=!1)=>{l!==window.location.pathname&&(s?history.replaceState(null,"",l):history.pushState(null,"",l),n(Xd(l)))},[]);return{...e,navigate:r}}const ec="codekin-tentative-";function oy(e,n){const r=`${ec}${e}`;n.length===0?localStorage.removeItem(r):localStorage.setItem(r,JSON.stringify(n.map(l=>l.text)))}function O2(e){try{const n=localStorage.getItem(`${ec}${e}`);if(n)return JSON.parse(n).map(l=>({text:l,files:[]}))}catch{}return[]}function D2(){const e={};try{for(let n=0;n<localStorage.length;n++){const r=localStorage.key(n);if(r?.startsWith(ec)){const l=r.slice(ec.length),s=O2(l);s.length>0&&(e[l]=s)}}}catch{}return e}function z2(){const[e,n]=w.useState(D2),r=w.useCallback((s,o,u=[])=>{n(f=>{const d={...f,[s]:[...f[s]??[],{text:o,files:u}]};return oy(s,d[s]),d})},[]),l=w.useCallback(s=>{n(o=>{if(!o[s])return o;const u={...o};return delete u[s],oy(s,[]),u})},[]);return{queues:e,addToQueue:r,clearQueue:l}}function Or(e){return e.groupDir??e.workingDir}function L2({sessions:e,repos:n,activeSessionId:r,setActiveSessionId:l,joinSession:s,leaveSession:o,clearMessages:u,wsCreateSession:f,removeSession:d,pendingContextRef:p}){const x=r?e.find(C=>C.id===r)??null:null,g=x?Or(x):null,y=w.useCallback(C=>{const I=e.filter(U=>Or(U)===C.workingDir);if(I.length>0){const U=I[I.length-1];u(),o(),s(U.id);return}u(),o(),f(`hub:${C.id}`,C.workingDir)},[e,s,f,o,u]),v=w.useCallback(C=>{C!==r&&(u(),o(),s(C))},[r,o,s,u]),S=w.useCallback(async C=>{if(C===r){u(),o();const I=e.find(_=>_.id===C),U=e.filter(_=>_.id!==C);if(U.length>0){const _=I?U.filter(P=>Or(P)===Or(I)):[],z=_.length>0?_[0]:U[0];s(z.id)}else l(null)}await d(C)},[r,e,u,o,s,l,d]),E=w.useCallback(C=>{if(C===g)return;const I=e.filter(U=>Or(U)===C);if(I.length>0){const U=I[I.length-1];u(),o(),s(U.id)}},[g,e,u,o,s]),T=w.useCallback(async C=>{const I=e.filter(_=>Or(_)===C);if(I.some(_=>_.id===r)){u(),o();const _=e.filter(z=>Or(z)!==C);_.length>0?s(_[0].id):l(null)}for(const _ of I)await d(_.id)},[e,r,u,o,s,l,d]),N=w.useCallback(()=>{if(!g)return;const I=n.find(U=>U.workingDir===g)?.id??g.split("/").pop()??"session";u(),o(),f(`hub:${I}`,g)},[g,n,u,o,f]),j=w.useCallback((C,I)=>{const U=n.find(_=>_.workingDir===C);U&&(p.current=I,u(),o(),f(`hub:${U.id}`,U.workingDir))},[n,u,o,f,p]);return{activeSession:x,activeWorkingDir:g,handleOpenSession:y,handleSelectSession:v,handleDeleteSession:S,handleSelectRepo:E,handleDeleteRepo:T,handleNewSessionForRepo:N,handleNewSessionFromArchive:j}}const uy="/cc",L0="codekin-starred-docs";function B2(){try{return JSON.parse(localStorage.getItem(L0)||"{}")}catch{return{}}}function I2(e){localStorage.setItem(L0,JSON.stringify(e))}function U2(){const[e,n]=w.useState(null),[r,l]=w.useState(null),[s,o]=w.useState(!1),[u,f]=w.useState(null),[d,p]=w.useState(!1),[x,g]=w.useState(null),[y,v]=w.useState(!1),[S,E]=w.useState([]),[T,N]=w.useState(!1),[j,C]=w.useState(null),[I,U]=w.useState(B2),_=w.useCallback(async(Y,M)=>{C(Y),v(!0),N(!0),E([]);try{const K=new URLSearchParams({repo:Y}),le=await fetch(`${uy}/api/docs?${K}`,{headers:{Authorization:`Bearer ${M}`}});if(!le.ok)throw new Error(`Failed to list docs: ${le.status}`);const be=await le.json();E(be.files??[])}catch{E([])}finally{N(!1)}},[]),z=w.useCallback(()=>{v(!1)},[]),P=w.useCallback(async(Y,M,K)=>{g(Y),n(M),l(null),f(null),o(!0),p(!1),v(!1);try{const le=new URLSearchParams({repo:Y,file:M}),be=await fetch(`${uy}/api/docs/file?${le}`,{headers:{Authorization:`Bearer ${K}`}});if(!be.ok)throw new Error(`Failed to load file: ${be.status}`);const O=await be.json();l(O.content)}catch(le){f(le instanceof Error?le.message:"Failed to load file")}finally{o(!1)}},[]),X=w.useCallback(()=>{n(null),l(null),f(null),o(!1),p(!1),g(null)},[]),B=w.useCallback(()=>{p(Y=>!Y)},[]),q=x?I[x]??[]:[],Z=e!==null&&q.includes(e),ee=w.useCallback(()=>{!x||!e||U(Y=>{const M=Y[x]??[],K=M.includes(e)?M.filter(be=>be!==e):[...M,e],le={...Y,[x]:K};return I2(le),le})},[x,e]),ae=j?I[j]??[]:[];return{isOpen:e!==null,selectedFile:e,content:r,loading:s,error:u,rawMode:d,toggleRawMode:B,openFile:P,close:X,repoWorkingDir:x,pickerOpen:y,pickerFiles:S,pickerLoading:T,openPicker:_,closePicker:z,pickerRepoDir:j,starredDocs:ae,isCurrentFileStarred:Z,toggleStarCurrentFile:ee}}const $2=1024;function H2(e=$2){const[n,r]=w.useState(()=>typeof window<"u"?window.innerWidth<e:!1);return w.useEffect(()=>{const l=window.matchMedia(`(max-width: ${e-1}px)`),s=o=>r(o.matches);return l.addEventListener("change",s),()=>l.removeEventListener("change",s)},[e]),n}const B0=[{command:"/clear",name:"Clear session",description:"Clear conversation and start fresh",category:"builtin",aliases:["/reset","/new"]},{command:"/compact",name:"Compact",description:"Compact conversation to save context",category:"builtin"},{command:"/model",name:"Model",description:"Change the active model",category:"builtin"},{command:"/help",name:"Help",description:"Show available commands",category:"builtin"},{command:"/cost",name:"Cost",description:"Show session cost info",category:"builtin"},{command:"/status",name:"Status",description:"Show session status",category:"builtin"}],Uh=new Map;for(const e of B0){Uh.set(e.command,e.command);for(const n of e.aliases??[])Uh.set(n,e.command)}function P2(e){return Uh.get(e)}const I0=[{command:"/commit",name:"Commit",description:"Create a git commit",category:"bundled"},{command:"/simplify",name:"Simplify",description:"Review and simplify changed code",category:"bundled"},{command:"/loop",name:"Loop",description:"Run a command on a recurring interval",category:"bundled"},{command:"/debug",name:"Debug",description:"Debug an issue step by step",category:"bundled"},{command:"/claude-api",name:"Claude API",description:"Help with Anthropic SDK usage",category:"bundled"}];function F2(e){const n=new Set,r=[];for(const l of e)n.has(l.command)||(n.add(l.command),r.push({command:l.command,name:l.name,description:l.description,category:"skill",content:l.content}));for(const l of I0)n.has(l.command)||(n.add(l.command),r.push(l));for(const l of B0)if(!n.has(l.command)){n.add(l.command);for(const s of l.aliases??[])n.add(s);r.push(l)}return r}const G2=new Set(I0.map(e=>e.command));function q2({token:e,activeSessionId:n,activeWorkingDir:r,sessions:l,allSkills:s,sendInput:o,onBuiltinCommand:u,tentativeQueues:f,addToQueue:d,clearQueue:p,docsContext:x}){const[g,y]=w.useState(null),[v,S]=w.useState({}),E=w.useMemo(()=>n?v[n]??[]:[],[n,v]),T=w.useCallback(P=>{n&&S(X=>({...X,[n]:[...X[n]??[],...P]}))},[n]),N=w.useCallback(P=>{n&&S(X=>({...X,[n]:(X[n]??[]).filter((B,q)=>q!==P)}))},[n]),j=w.useCallback(P=>{const X=P.trim();if(!X.startsWith("/"))return{expanded:P,handled:!1};const B=X.indexOf(" "),q=B===-1?X:X.slice(0,B),Z=B===-1?"":X.slice(B+1).trim(),ee=P2(q);if(ee)return u(ee,Z),{expanded:P,handled:!0};const ae=s.find(Y=>Y.command===q);if(ae?.content){const Y=ae.content.replace(/\$ARGUMENTS/g,Z||"(no arguments provided)"),M=[`[Skill: ${ae.name}]`,"",Y];return Z&&M.push("",`User instructions: ${Z}`),{expanded:M.join(`
|
|
11
|
+
`),displayText:P,handled:!1}}return G2.has(q)?{expanded:P,displayText:P,handled:!1}:{expanded:P,handled:!1}},[s,u]),C=w.useCallback(async P=>{if(!e)return;const{expanded:X,displayText:B,handled:q}=j(P);if(q)return;const Z=x.isOpen&&x.selectedFile&&x.repoWorkingDir?`[Viewing doc: ${x.selectedFile} in ${x.repoWorkingDir}]
|
|
12
|
+
|
|
13
|
+
`:"",ee=(f[n??""]?.length??0)>0,ae=!!r&&l.some(M=>Or(M)===r&&M.isProcessing&&M.id!==n);if(n&&(ee||ae)){if(E.length>0){S(M=>({...M,[n]:[]})),y("Uploading files...");try{const M=await Vd(e,E,Z+X);d(n,M),y(null)}catch(M){d(n,Z+X),y(`Upload failed: ${M instanceof Error?M.message:"unknown error"}`),setTimeout(()=>y(null),3e3)}}else d(n,Z+X);return}const Y=E;if(Y.length===0){o(Z+X,B);return}y("Uploading files...");try{const M=await Vd(e,Y,Z+X);n&&S(K=>({...K,[n]:[]})),y(null),o(M)}catch(M){y(`Upload failed: ${M instanceof Error?M.message:"unknown error"}`),setTimeout(()=>y(null),3e3)}},[e,n,r,l,f,d,E,j,o,x.isOpen,x.selectedFile,x.repoWorkingDir]),I=w.useCallback(async P=>{const X=f[P]??[];p(P);for(let B=0;B<X.length;B++){const q=X[B];if(B>0&&await new Promise(Z=>setTimeout(Z,100)),q.files.length>0&&e)try{const Z=await Vd(e,q.files,q.text);o(Z)}catch{o(q.text)}else o(q.text)}},[f,p,o,e]),U=w.useCallback(P=>{p(P)},[p]);w.useEffect(()=>{for(const[P,X]of Object.entries(f)){if(X.length===0)continue;const B=l.find(ee=>ee.id===P);if(!B)continue;const q=Or(B);l.filter(ee=>Or(ee)===q&&ee.isProcessing&&ee.id!==P).length===0&&P===n&&(I(P),setTimeout(()=>{y("Session finished — starting queued session."),setTimeout(()=>y(null),3e3)},0))}},[l]);const _=n?(f[n]??[]).map((P,X)=>({type:"tentative",text:P.files.length>0?`${P.text}
|
|
14
|
+
📎 ${P.files.length} file${P.files.length>1?"s":""} attached`:P.text,index:X,key:`tentative-${X}`})):[],z=n?f[n]?.length??0:0;return{handleSend:C,handleExecuteTentative:I,handleDiscardTentative:U,tentativeMessages:_,activeTentativeCount:z,pendingFiles:E,addFiles:T,removeFile:N,uploadStatus:g}}function Y2(e,n,r){const l=e[e.length-1];if(l&&l.type==="assistant"&&!l.complete)return"Writing...";for(let s=e.length-1;s>=0;s--){const o=e[s];if(o.type==="tool_group"){const u=o.tools.find(f=>f.active);if(u)return`Running ${u.name}...`;break}if(o.type!=="planning_mode"&&o.type!=="tool_output")break}if(n)return r?`Thinking: ${r}`:"Thinking..."}var V2={outline:{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"},filled:{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"currentColor",stroke:"none"}};const Be=(e,n,r,l)=>{const s=w.forwardRef(({color:o="currentColor",size:u=24,stroke:f=2,title:d,className:p,children:x,...g},y)=>w.createElement("svg",{ref:y,...V2[e],width:u,height:u,className:["tabler-icon",`tabler-icon-${n}`,p].join(" "),...e==="filled"?{fill:o}:{strokeWidth:f,stroke:o},...g},[d&&w.createElement("title",{key:"svg-title"},d),...l.map(([v,S])=>w.createElement(v,S)),...Array.isArray(x)?x:[x]]));return s.displayName=`${r}`,s};const X2=[["path",{d:"M3 6a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2",key:"svg-0"}],["path",{d:"M5 8v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2 -2v-10",key:"svg-1"}],["path",{d:"M10 12l4 0",key:"svg-2"}]],Zs=Be("outline","archive","Archive",X2);const K2=[["path",{d:"M12 5l0 14",key:"svg-0"}],["path",{d:"M18 13l-6 6",key:"svg-1"}],["path",{d:"M6 13l6 6",key:"svg-2"}]],Z2=Be("outline","arrow-down","ArrowDown",K2);const Q2=[["path",{d:"M5 12l14 0",key:"svg-0"}],["path",{d:"M5 12l6 6",key:"svg-1"}],["path",{d:"M5 12l6 -6",key:"svg-2"}]],W2=Be("outline","arrow-left","ArrowLeft",Q2);const J2=[["path",{d:"M5 12l14 0",key:"svg-0"}],["path",{d:"M13 18l6 -6",key:"svg-1"}],["path",{d:"M13 6l6 6",key:"svg-2"}]],U0=Be("outline","arrow-right","ArrowRight",J2);const eN=[["path",{d:"M12 5l0 14",key:"svg-0"}],["path",{d:"M18 11l-6 -6",key:"svg-1"}],["path",{d:"M6 11l6 -6",key:"svg-2"}]],tN=Be("outline","arrow-up","ArrowUp",eN);const nN=[["path",{d:"M3 19a9 9 0 0 1 9 0a9 9 0 0 1 9 0",key:"svg-0"}],["path",{d:"M3 6a9 9 0 0 1 9 0a9 9 0 0 1 9 0",key:"svg-1"}],["path",{d:"M3 6l0 13",key:"svg-2"}],["path",{d:"M12 6l0 13",key:"svg-3"}],["path",{d:"M21 6l0 13",key:"svg-4"}]],rN=Be("outline","book","Book",nN);const aN=[["path",{d:"M15.5 13a3.5 3.5 0 0 0 -3.5 3.5v1a3.5 3.5 0 0 0 7 0v-1.8",key:"svg-0"}],["path",{d:"M8.5 13a3.5 3.5 0 0 1 3.5 3.5v1a3.5 3.5 0 0 1 -7 0v-1.8",key:"svg-1"}],["path",{d:"M17.5 16a3.5 3.5 0 0 0 0 -7h-.5",key:"svg-2"}],["path",{d:"M19 9.3v-2.8a3.5 3.5 0 0 0 -7 0",key:"svg-3"}],["path",{d:"M6.5 16a3.5 3.5 0 0 1 0 -7h.5",key:"svg-4"}],["path",{d:"M5 9.3v-2.8a3.5 3.5 0 0 1 7 0v10",key:"svg-5"}]],lN=Be("outline","brain","Brain",aN);const iN=[["path",{d:"M9 19c-4.3 1.4 -4.3 -2.5 -6 -3m12 5v-3.5c0 -1 .1 -1.4 -.5 -2c2.8 -.3 5.5 -1.4 5.5 -6a4.6 4.6 0 0 0 -1.3 -3.2a4.2 4.2 0 0 0 -.1 -3.2s-1.1 -.3 -3.5 1.3a12.3 12.3 0 0 0 -6.2 0c-2.4 -1.6 -3.5 -1.3 -3.5 -1.3a4.2 4.2 0 0 0 -.1 3.2a4.6 4.6 0 0 0 -1.3 3.2c0 4.6 2.7 5.7 5.5 6c-.6 .6 -.6 1.2 -.5 2v3.5",key:"svg-0"}]],sN=Be("outline","brand-github","BrandGithub",iN);const oN=[["path",{d:"M4 7a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2l0 -12",key:"svg-0"}],["path",{d:"M16 3l0 4",key:"svg-1"}],["path",{d:"M8 3l0 4",key:"svg-2"}],["path",{d:"M4 11l16 0",key:"svg-3"}],["path",{d:"M8 15h2v2h-2l0 -2",key:"svg-4"}]],uN=Be("outline","calendar-event","CalendarEvent",oN);const cN=[["path",{d:"M5 12l5 5l10 -10",key:"svg-0"}]],oo=Be("outline","check","Check",cN);const fN=[["path",{d:"M6 9l6 6l6 -6",key:"svg-0"}]],Zr=Be("outline","chevron-down","ChevronDown",fN);const dN=[["path",{d:"M15 6l-6 6l6 6",key:"svg-0"}]],$0=Be("outline","chevron-left","ChevronLeft",dN);const hN=[["path",{d:"M9 6l6 6l-6 6",key:"svg-0"}]],va=Be("outline","chevron-right","ChevronRight",hN);const pN=[["path",{d:"M6 15l6 -6l6 6",key:"svg-0"}]],mN=Be("outline","chevron-up","ChevronUp",pN);const gN=[["path",{d:"M3 12a9 9 0 1 0 18 0a9 9 0 1 0 -18 0",key:"svg-0"}]],xN=Be("outline","circle","Circle",gN);const bN=[["path",{d:"M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0",key:"svg-0"}],["path",{d:"M12 7v5l3 3",key:"svg-1"}]],yN=Be("outline","clock","Clock",bN);const vN=[["path",{d:"M6.657 18c-2.572 0 -4.657 -2.007 -4.657 -4.483c0 -2.475 2.085 -4.482 4.657 -4.482c.393 -1.762 1.794 -3.2 3.675 -3.773c1.88 -.572 3.956 -.193 5.444 1c1.488 1.19 2.162 3.007 1.77 4.769h.99c1.913 0 3.464 1.56 3.464 3.486c0 1.927 -1.551 3.487 -3.465 3.487h-11.878",key:"svg-0"}]],wN=Be("outline","cloud","Cloud",vN);const kN=[["path",{d:"M7 9.667a2.667 2.667 0 0 1 2.667 -2.667h8.666a2.667 2.667 0 0 1 2.667 2.667v8.666a2.667 2.667 0 0 1 -2.667 2.667h-8.666a2.667 2.667 0 0 1 -2.667 -2.667l0 -8.666",key:"svg-0"}],["path",{d:"M4.012 16.737a2.005 2.005 0 0 1 -1.012 -1.737v-10c0 -1.1 .9 -2 2 -2h10c.75 0 1.158 .385 1.5 1",key:"svg-1"}]],H0=Be("outline","copy","Copy",kN);const SN=[["path",{d:"M4 12a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-0"}],["path",{d:"M11 12a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-1"}],["path",{d:"M18 12a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-2"}]],EN=Be("outline","dots","Dots",SN);const NN=[["path",{d:"M12 6h-6a2 2 0 0 0 -2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2 -2v-6",key:"svg-0"}],["path",{d:"M11 13l9 -9",key:"svg-1"}],["path",{d:"M15 4h5v5",key:"svg-2"}]],P0=Be("outline","external-link","ExternalLink",NN);const _N=[["path",{d:"M10 12a2 2 0 1 0 4 0a2 2 0 0 0 -4 0",key:"svg-0"}],["path",{d:"M21 12c-2.4 4 -5.4 6 -9 6c-3.6 0 -6.6 -2 -9 -6c2.4 -4 5.4 -6 9 -6c3.6 0 6.6 2 9 6",key:"svg-1"}]],TN=Be("outline","eye","Eye",_N);const AN=[["path",{d:"M14 3v4a1 1 0 0 0 1 1h4",key:"svg-0"}],["path",{d:"M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2",key:"svg-1"}],["path",{d:"M10 13l-1 2l1 2",key:"svg-2"}],["path",{d:"M14 13l1 2l-1 2",key:"svg-3"}]],CN=Be("outline","file-code","FileCode",AN);const RN=[["path",{d:"M14 3v4a1 1 0 0 0 1 1h4",key:"svg-0"}],["path",{d:"M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2",key:"svg-1"}],["path",{d:"M9 9l1 0",key:"svg-2"}],["path",{d:"M9 13l6 0",key:"svg-3"}],["path",{d:"M9 17l6 0",key:"svg-4"}]],$h=Be("outline","file-text","FileText",RN);const jN=[["path",{d:"M14 3v4a1 1 0 0 0 1 1h4",key:"svg-0"}],["path",{d:"M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2",key:"svg-1"}]],MN=Be("outline","file","File",jN);const ON=[["path",{d:"M5 19l2.757 -7.351a1 1 0 0 1 .936 -.649h12.307a1 1 0 0 1 .986 1.164l-.996 5.211a2 2 0 0 1 -1.964 1.625h-14.026a2 2 0 0 1 -2 -2v-11a2 2 0 0 1 2 -2h4l3 3h7a2 2 0 0 1 2 2v2",key:"svg-0"}]],DN=Be("outline","folder-open","FolderOpen",ON);const zN=[["path",{d:"M5 4h4l3 3h7a2 2 0 0 1 2 2v8a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-11a2 2 0 0 1 2 -2",key:"svg-0"}]],cy=Be("outline","folder","Folder",zN);const LN=[["path",{d:"M5 18a2 2 0 1 0 4 0a2 2 0 1 0 -4 0",key:"svg-0"}],["path",{d:"M5 6a2 2 0 1 0 4 0a2 2 0 1 0 -4 0",key:"svg-1"}],["path",{d:"M15 6a2 2 0 1 0 4 0a2 2 0 1 0 -4 0",key:"svg-2"}],["path",{d:"M7 8l0 8",key:"svg-3"}],["path",{d:"M9 18h6a2 2 0 0 0 2 -2v-5",key:"svg-4"}],["path",{d:"M14 14l3 -3l3 3",key:"svg-5"}]],wp=Be("outline","git-branch","GitBranch",LN);const BN=[["path",{d:"M16.555 3.843l3.602 3.602a2.877 2.877 0 0 1 0 4.069l-2.643 2.643a2.877 2.877 0 0 1 -4.069 0l-.301 -.301l-6.558 6.558a2 2 0 0 1 -1.239 .578l-.175 .008h-1.172a1 1 0 0 1 -.993 -.883l-.007 -.117v-1.172a2 2 0 0 1 .467 -1.284l.119 -.13l.414 -.414h2v-2h2v-2l2.144 -2.144l-.301 -.301a2.877 2.877 0 0 1 0 -4.069l2.643 -2.643a2.877 2.877 0 0 1 4.069 0",key:"svg-0"}],["path",{d:"M15 9h.01",key:"svg-1"}]],IN=Be("outline","key","Key",BN);const UN=[["path",{d:"M12 3a9 9 0 1 0 9 9",key:"svg-0"}]],Br=Be("outline","loader-2","Loader2",UN);const $N=[["path",{d:"M14 8v-2a2 2 0 0 0 -2 -2h-7a2 2 0 0 0 -2 2v12a2 2 0 0 0 2 2h7a2 2 0 0 0 2 -2v-2",key:"svg-0"}],["path",{d:"M9 12h12l-3 -3",key:"svg-1"}],["path",{d:"M18 15l3 -3",key:"svg-2"}]],HN=Be("outline","logout","Logout",$N);const PN=[["path",{d:"M4 6l16 0",key:"svg-0"}],["path",{d:"M4 12l16 0",key:"svg-1"}],["path",{d:"M4 18l16 0",key:"svg-2"}]],FN=Be("outline","menu-2","Menu2",PN);const GN=[["path",{d:"M8 9h8",key:"svg-0"}],["path",{d:"M8 13h6",key:"svg-1"}],["path",{d:"M12.01 18.594l-4.01 2.406v-3h-2a3 3 0 0 1 -3 -3v-8a3 3 0 0 1 3 -3h12a3 3 0 0 1 3 3v5.5",key:"svg-2"}],["path",{d:"M16 19h6",key:"svg-3"}],["path",{d:"M19 16v6",key:"svg-4"}]],qN=Be("outline","message-plus","MessagePlus",GN);const YN=[["path",{d:"M5 12l14 0",key:"svg-0"}]],F0=Be("outline","minus","Minus",YN);const VN=[["path",{d:"M12 3c.132 0 .263 0 .393 0a7.5 7.5 0 0 0 7.92 12.446a9 9 0 1 1 -8.313 -12.454l0 .008",key:"svg-0"}]],fy=Be("outline","moon","Moon",VN);const XN=[["path",{d:"M12 21a9 9 0 0 1 0 -18c4.97 0 9 3.582 9 8c0 1.06 -.474 2.078 -1.318 2.828c-.844 .75 -1.989 1.172 -3.182 1.172h-2.5a2 2 0 0 0 -1 3.75a1.3 1.3 0 0 1 -1 2.25",key:"svg-0"}],["path",{d:"M7.5 10.5a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-1"}],["path",{d:"M11.5 7.5a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-2"}],["path",{d:"M15.5 10.5a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-3"}]],KN=Be("outline","palette","Palette",XN);const ZN=[["path",{d:"M15 7l-6.5 6.5a1.5 1.5 0 0 0 3 3l6.5 -6.5a3 3 0 0 0 -6 -6l-6.5 6.5a4.5 4.5 0 0 0 9 9l6.5 -6.5",key:"svg-0"}]],dy=Be("outline","paperclip","Paperclip",ZN);const QN=[["path",{d:"M4 20h4l10.5 -10.5a2.828 2.828 0 1 0 -4 -4l-10.5 10.5v4",key:"svg-0"}],["path",{d:"M13.5 6.5l4 4",key:"svg-1"}]],G0=Be("outline","pencil","Pencil",QN);const WN=[["path",{d:"M6 6a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v12a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1l0 -12",key:"svg-0"}],["path",{d:"M14 6a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v12a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1l0 -12",key:"svg-1"}]],q0=Be("outline","player-pause","PlayerPause",WN);const JN=[["path",{d:"M7 4v16l13 -8l-13 -8",key:"svg-0"}]],hy=Be("outline","player-play","PlayerPlay",JN);const e_=[["path",{d:"M5 7a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v10a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2l0 -10",key:"svg-0"}]],t_=Be("outline","player-stop","PlayerStop",e_);const n_=[["path",{d:"M12 5l0 14",key:"svg-0"}],["path",{d:"M5 12l14 0",key:"svg-1"}]],Qs=Be("outline","plus","Plus",n_);const r_=[["path",{d:"M20 11a8.1 8.1 0 0 0 -15.5 -2m-.5 -4v4h4",key:"svg-0"}],["path",{d:"M4 13a8.1 8.1 0 0 0 15.5 2m.5 4v-4h-4",key:"svg-1"}]],a_=Be("outline","refresh","Refresh",r_);const l_=[["path",{d:"M6 6a2 2 0 0 1 2 -2h8a2 2 0 0 1 2 2v4a2 2 0 0 1 -2 2h-8a2 2 0 0 1 -2 -2l0 -4",key:"svg-0"}],["path",{d:"M12 2v2",key:"svg-1"}],["path",{d:"M9 12v9",key:"svg-2"}],["path",{d:"M15 12v9",key:"svg-3"}],["path",{d:"M5 16l4 -2",key:"svg-4"}],["path",{d:"M15 14l4 2",key:"svg-5"}],["path",{d:"M9 18h6",key:"svg-6"}],["path",{d:"M10 8v.01",key:"svg-7"}],["path",{d:"M14 8v.01",key:"svg-8"}]],tc=Be("outline","robot","Robot",l_);const i_=[["path",{d:"M10 14l11 -11",key:"svg-0"}],["path",{d:"M21 3l-6.5 18a.55 .55 0 0 1 -1 0l-3.5 -7l-7 -3.5a.55 .55 0 0 1 0 -1l18 -6.5",key:"svg-1"}]],py=Be("outline","send","Send",i_);const s_=[["path",{d:"M10.325 4.317c.426 -1.756 2.924 -1.756 3.35 0a1.724 1.724 0 0 0 2.573 1.066c1.543 -.94 3.31 .826 2.37 2.37a1.724 1.724 0 0 0 1.065 2.572c1.756 .426 1.756 2.924 0 3.35a1.724 1.724 0 0 0 -1.066 2.573c.94 1.543 -.826 3.31 -2.37 2.37a1.724 1.724 0 0 0 -2.572 1.065c-.426 1.756 -2.924 1.756 -3.35 0a1.724 1.724 0 0 0 -2.573 -1.066c-1.543 .94 -3.31 -.826 -2.37 -2.37a1.724 1.724 0 0 0 -1.065 -2.572c-1.756 -.426 -1.756 -2.924 0 -3.35a1.724 1.724 0 0 0 1.066 -2.573c-.94 -1.543 .826 -3.31 2.37 -2.37c1 .608 2.296 .07 2.572 -1.065",key:"svg-0"}],["path",{d:"M9 12a3 3 0 1 0 6 0a3 3 0 0 0 -6 0",key:"svg-1"}]],Y0=Be("outline","settings","Settings",s_);const o_=[["path",{d:"M11.46 20.846a12 12 0 0 1 -7.96 -14.846a12 12 0 0 0 8.5 -3a12 12 0 0 0 8.5 3a12 12 0 0 1 -.09 7.06",key:"svg-0"}],["path",{d:"M15 19l2 2l4 -4",key:"svg-1"}]],u_=Be("outline","shield-check","ShieldCheck",o_);const c_=[["path",{d:"M16 18a2 2 0 0 1 2 2a2 2 0 0 1 2 -2a2 2 0 0 1 -2 -2a2 2 0 0 1 -2 2m0 -12a2 2 0 0 1 2 2a2 2 0 0 1 2 -2a2 2 0 0 1 -2 -2a2 2 0 0 1 -2 2m-7 12a6 6 0 0 1 6 -6a6 6 0 0 1 -6 -6a6 6 0 0 1 -6 6a6 6 0 0 1 6 6",key:"svg-0"}]],V0=Be("outline","sparkles","Sparkles",c_);const f_=[["path",{d:"M12 17.75l-6.172 3.245l1.179 -6.873l-5 -4.867l6.9 -1l3.086 -6.253l3.086 6.253l6.9 1l-5 4.867l1.179 6.873l-6.158 -3.245",key:"svg-0"}]],d_=Be("outline","star","Star",f_);const h_=[["path",{d:"M8 12a4 4 0 1 0 8 0a4 4 0 1 0 -8 0",key:"svg-0"}],["path",{d:"M3 12h1m8 -9v1m8 8h1m-9 8v1m-6.4 -15.4l.7 .7m12.1 -.7l-.7 .7m0 11.4l.7 .7m-12.1 -.7l-.7 .7",key:"svg-1"}]],my=Be("outline","sun","Sun",h_);const p_=[["path",{d:"M8 9l3 3l-3 3",key:"svg-0"}],["path",{d:"M13 15l3 0",key:"svg-1"}],["path",{d:"M3 6a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2l0 -12",key:"svg-2"}]],gy=Be("outline","terminal-2","Terminal2",p_);const m_=[["path",{d:"M4 16l6 -7l5 5l5 -6",key:"svg-0"}],["path",{d:"M14 14a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-1"}],["path",{d:"M9 9a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-2"}],["path",{d:"M3 16a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-3"}],["path",{d:"M19 8a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-4"}]],g_=Be("outline","timeline","Timeline",m_);const x_=[["path",{d:"M4 7l16 0",key:"svg-0"}],["path",{d:"M10 11l0 6",key:"svg-1"}],["path",{d:"M14 11l0 6",key:"svg-2"}],["path",{d:"M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2l1 -12",key:"svg-3"}],["path",{d:"M9 7v-3a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v3",key:"svg-4"}]],gc=Be("outline","trash","Trash",x_);const b_=[["path",{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2",key:"svg-0"}],["path",{d:"M7 9l5 -5l5 5",key:"svg-1"}],["path",{d:"M12 4l0 12",key:"svg-2"}]],y_=Be("outline","upload","Upload",b_);const v_=[["path",{d:"M18 6l-12 12",key:"svg-0"}],["path",{d:"M6 6l12 12",key:"svg-1"}]],Wr=Be("outline","x","X",v_);const w_=[["path",{d:"M17 3.34a10 10 0 1 1 -14.995 8.984l-.005 -.324l.005 -.324a10 10 0 0 1 14.995 -8.336zm-1.293 5.953a1 1 0 0 0 -1.32 -.083l-.094 .083l-3.293 3.292l-1.293 -1.292l-.094 -.083a1 1 0 0 0 -1.403 1.403l.083 .094l2 2l.094 .083a1 1 0 0 0 1.226 0l.094 -.083l4 -4l.083 -.094a1 1 0 0 0 -.083 -1.32z",key:"svg-0"}]],k_=Be("filled","circle-check-filled","CircleCheckFilled",w_);const S_=[["path",{d:"M17 3.34a10 10 0 1 1 -14.995 8.984l-.005 -.324l.005 -.324a10 10 0 0 1 14.995 -8.336zm-6.489 5.8a1 1 0 0 0 -1.218 1.567l1.292 1.293l-1.292 1.293l-.083 .094a1 1 0 0 0 1.497 1.32l1.293 -1.292l1.293 1.292l.094 .083a1 1 0 0 0 1.32 -1.497l-1.292 -1.293l1.292 -1.293l.083 -.094a1 1 0 0 0 -1.497 -1.32l-1.293 1.292l-1.293 -1.292l-.094 -.083z",key:"svg-0"}]],E_=Be("filled","circle-x-filled","CircleXFilled",S_);const N_=[["path",{d:"M8.243 7.34l-6.38 .925l-.113 .023a1 1 0 0 0 -.44 1.684l4.622 4.499l-1.09 6.355l-.013 .11a1 1 0 0 0 1.464 .944l5.706 -3l5.693 3l.1 .046a1 1 0 0 0 1.352 -1.1l-1.091 -6.355l4.624 -4.5l.078 -.085a1 1 0 0 0 -.633 -1.62l-6.38 -.926l-2.852 -5.78a1 1 0 0 0 -1.794 0l-2.853 5.78z",key:"svg-0"}]],X0=Be("filled","star-filled","StarFilled",N_);function K0({value:e,token:n,placeholder:r="~/repos (default)",helpText:l,onSave:s,inputClass:o}){const[u,f]=w.useState(e),[d,p]=w.useState(e),[x,g]=w.useState(!1),[y,v]=w.useState(null),[S,E]=w.useState(!1),[T,N]=w.useState(null),[j,C]=w.useState([]),[I,U]=w.useState(!1),[_,z]=w.useState(null),P=w.useRef(null);w.useEffect(()=>{f(e),p(e)},[e]),w.useEffect(()=>{if(!S)return;function Y(M){P.current&&!P.current.contains(M.target)&&E(!1)}return document.addEventListener("mousedown",Y),()=>document.removeEventListener("mousedown",Y)},[S]);async function X(){if(!(!n||u===d)){g(!0),v(null);try{await s(u),p(u)}catch(Y){v(Y instanceof Error?Y.message:"Failed to save path")}finally{g(!1)}}}async function B(Y){if(n){U(!0),z(null);try{const M=await y2(n,Y);N(M.path),C(M.dirs),E(!0)}catch(M){z(M instanceof Error?M.message:"Failed to browse directory")}finally{U(!1)}}}function q(){if(!T)return;const Y=T.replace(/\/[^/]+\/?$/,"")||"/";B(Y)}function Z(Y){const M=T==="/"?`/${Y}`:`${T}/${Y}`;B(M)}function ee(){T&&(f(T),E(!1))}const ae=o??"text-[13px]";return h.jsxs("div",{className:"relative",children:[h.jsx("label",{className:"mb-1.5 block text-neutral-5",style:{fontSize:o?void 0:"13px"},children:h.jsxs("span",{className:"flex items-center gap-1.5",children:[h.jsx(cy,{size:13,className:"text-neutral-6"}),"Repositories Path"]})}),h.jsxs("div",{className:"flex gap-1.5",children:[h.jsx("input",{type:"text",value:u,onChange:Y=>{f(Y.target.value),v(null)},onBlur:()=>{X()},onKeyDown:Y=>{Y.key==="Enter"&&X()},placeholder:r,disabled:x,className:`flex-1 rounded border border-neutral-9 bg-neutral-10 px-3 py-2 ${ae} font-mono text-neutral-3 outline-none focus:border-primary-7 disabled:opacity-50`}),h.jsx("button",{type:"button",onClick:()=>S?E(!1):void B(u||void 0),disabled:!n||I,className:"flex items-center gap-1 rounded border border-neutral-9 bg-neutral-10 px-2.5 py-2 text-[13px] text-neutral-4 hover:border-neutral-7 hover:text-neutral-3 disabled:opacity-50",title:"Browse folders",children:I?h.jsx("span",{className:"h-4 w-4 animate-spin rounded-full border-2 border-neutral-6 border-t-transparent"}):h.jsx(DN,{size:16})})]}),(y||_)&&h.jsx("p",{className:"mt-1 text-[12px] text-red-400",children:y||_}),l&&!y&&!_&&h.jsx("p",{className:"mt-1 text-[12px] text-neutral-6",children:l}),S&&T!==null&&h.jsxs("div",{ref:P,className:"absolute z-50 mt-1 w-full rounded-lg border border-neutral-8 bg-neutral-10 shadow-lg",children:[h.jsxs("div",{className:"flex items-center gap-2 border-b border-neutral-8 px-3 py-2",children:[h.jsx("button",{type:"button",onClick:q,className:"rounded p-0.5 text-neutral-5 hover:bg-neutral-8 hover:text-neutral-3",title:"Go up",children:h.jsx(tN,{size:14})}),h.jsx("span",{className:"flex-1 truncate font-mono text-[12px] text-neutral-4",children:T}),h.jsx("button",{type:"button",onClick:()=>E(!1),className:"rounded p-0.5 text-neutral-5 hover:bg-neutral-8 hover:text-neutral-3",children:h.jsx(Wr,{size:14})})]}),h.jsx("div",{className:"max-h-48 overflow-y-auto py-1",children:j.length===0?h.jsx("p",{className:"px-3 py-2 text-[12px] text-neutral-6",children:"No subdirectories"}):j.map(Y=>h.jsxs("button",{type:"button",onClick:()=>Z(Y),className:"flex w-full items-center gap-2 px-3 py-1.5 text-left text-[13px] text-neutral-3 hover:bg-neutral-8",children:[h.jsx(cy,{size:14,className:"shrink-0 text-neutral-5"}),h.jsx("span",{className:"truncate",children:Y}),h.jsx(va,{size:12,className:"ml-auto shrink-0 text-neutral-6"})]},Y))}),h.jsx("div",{className:"border-t border-neutral-8 px-3 py-2",children:h.jsx("button",{type:"button",onClick:ee,className:"w-full rounded bg-primary-7 px-3 py-1.5 text-[13px] font-medium text-white hover:bg-primary-6",children:"Select this folder"})})]})]})}const xy={auto:"Auto (first available)",groq:"Groq",openai:"OpenAI",gemini:"Google Gemini",anthropic:"Anthropic"},__={groq:"meta-llama/llama-4-scout-17b-16e-instruct",openai:"gpt-5-nano",gemini:"gemini-2.5-flash",anthropic:"claude-haiku-4-5-20251001"};function Kd({icon:e,title:n,children:r}){return h.jsxs("section",{className:"settings-section-card rounded-lg border border-neutral-9/60 bg-neutral-10/30",children:[h.jsxs("div",{className:"flex items-center gap-2 px-4 py-3 border-b border-neutral-9/40",children:[h.jsx("span",{className:"text-neutral-5",children:e}),h.jsx("h3",{className:"text-[13px] font-semibold uppercase tracking-wide text-neutral-5",children:n})]}),h.jsx("div",{className:"px-4 py-4",children:r})]})}function T_({text:e}){const[n,r]=w.useState(!1),l=w.useCallback(()=>{navigator.clipboard.writeText(e),r(!0),setTimeout(()=>r(!1),2e3)},[e]);return h.jsx("button",{onClick:l,className:"rounded p-1.5 text-neutral-5 hover:bg-neutral-9 hover:text-neutral-2 transition-colors",title:"Copy to clipboard",children:n?h.jsx(oo,{size:14,className:"text-success-6"}):h.jsx(H0,{size:14})})}function A_({status:e}){const n={completed:"bg-success-9/30 text-success-5",session_created:"bg-primary-9/30 text-primary-5",processing:"bg-yellow-900/30 text-yellow-500",error:"bg-error-9/30 text-error-5",filtered:"bg-neutral-9/50 text-neutral-5",duplicate:"bg-neutral-9/50 text-neutral-5",received:"bg-neutral-9/50 text-neutral-4"};return h.jsx("span",{className:`rounded px-1.5 py-0.5 text-[11px] font-medium ${n[e]||n.received}`,children:e.replace("_"," ")})}function C_({open:e,onClose:n,settings:r,onUpdate:l,isMobile:s=!1}){const[o,u]=w.useState(r.token),[f,d]=w.useState(!1),[p,x]=w.useState("idle"),[g,y]=w.useState(7),[v,S]=w.useState("auto"),[E,T]=w.useState([]),[N,j]=w.useState(""),[C,I]=w.useState(null),[U,_]=w.useState(null),[z,P]=w.useState([]),[X,B]=w.useState(!1),[q,Z]=w.useState(!1);if(w.useEffect(()=>{u(r.token),x("idle"),I(null)},[r.token,e]),w.useEffect(()=>{!e||!r.token||(j0(r.token).then(y).catch(()=>{}),v2(r.token).then(({preferred:M,available:K})=>{S(M),T(K)}).catch(()=>{}),O0(r.token).then(j).catch(()=>{}),w2(r.token).then(_).catch(()=>{}),k2(r.token).then(P).catch(()=>{}))},[e,r.token]),!e)return null;const ee=`${location.protocol}//${location.host}/cc/api/webhooks/github`;async function ae(){if(o.trim()){d(!0),x("idle");try{const M=await c2(o.trim());x(M?"valid":"invalid"),M&&l({token:o.trim()})}catch{x("invalid")}finally{d(!1)}}}function Y(){l({token:o.trim()}),n()}return h.jsx("div",{className:`fixed inset-0 z-50 flex bg-black/60 ${s?"items-end":"items-center justify-center"}`,children:h.jsxs("div",{className:`w-full bg-neutral-11 shadow-xl flex flex-col ${s?"max-h-[95vh] rounded-t-xl":"max-w-2xl rounded-lg border border-neutral-10 max-h-[85vh]"}`,children:[h.jsx("div",{className:"flex-shrink-0 px-6 pt-5 pb-4 border-b border-neutral-10",children:h.jsx("h2",{className:"text-[19px] font-semibold text-neutral-2",children:"Settings"})}),h.jsxs("div",{className:"flex-1 overflow-y-auto px-6 py-5 space-y-4",children:[h.jsxs(Kd,{icon:h.jsx(IN,{size:15}),title:"Authentication",children:[h.jsx("label",{className:"mb-1 block text-[15px] text-neutral-4",children:"Claude Code Web Token"}),h.jsxs("div",{className:"flex gap-2",children:[h.jsx("input",{type:"password",value:o,onChange:M=>{u(M.target.value),x("idle")},placeholder:"Enter your auth token",className:"flex-1 rounded border border-neutral-9 bg-neutral-10 px-3 py-2 text-[15px] text-neutral-2 outline-none focus:border-primary-7",onKeyDown:M=>M.key==="Enter"&&ae()}),h.jsx("button",{onClick:ae,disabled:f||!o.trim(),className:"rounded bg-primary-8 px-3 py-2 text-[15px] font-medium text-neutral-1 hover:bg-primary-7 disabled:opacity-50",children:f?"...":"Verify"})]}),p==="valid"&&h.jsx("p",{className:"mt-1 text-[13px] text-success-6",children:"Token verified successfully"}),p==="invalid"&&h.jsx("p",{className:"mt-1 text-[13px] text-error-5",children:"Invalid token"})]}),h.jsx(Kd,{icon:h.jsx(KN,{size:15}),title:"Preferences",children:h.jsxs("div",{className:"grid grid-cols-2 gap-x-6 gap-y-4",children:[h.jsxs("div",{children:[h.jsx("label",{className:"mb-1.5 block text-[15px] text-neutral-4",children:"Theme"}),h.jsxs("div",{className:"flex gap-2",children:[h.jsx("button",{onClick:()=>l({theme:"dark"}),className:`rounded px-4 py-1.5 text-[15px] font-medium transition-colors ${r.theme!=="light"?"bg-primary-8 text-neutral-1":"border border-neutral-9 bg-neutral-10 text-neutral-3 hover:bg-neutral-9"}`,children:"Dark"}),h.jsx("button",{onClick:()=>l({theme:"light"}),className:`rounded px-4 py-1.5 text-[15px] font-medium transition-colors ${r.theme==="light"?"bg-primary-8 text-neutral-1":"border border-neutral-9 bg-neutral-10 text-neutral-3 hover:bg-neutral-9"}`,children:"Light"})]})]}),h.jsxs("div",{children:[h.jsx("label",{className:"mb-1.5 block text-[15px] text-neutral-4",children:h.jsxs("span",{className:"flex items-center gap-1.5",children:[h.jsx(Zs,{size:14,className:"text-neutral-5"}),"Archived Session Retention"]})}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("input",{type:"number",min:1,max:365,value:g,onChange:M=>{const K=Math.max(1,Math.min(365,Number(M.target.value)));y(K),M0(r.token,K).catch(()=>I("Failed to save retention setting"))},className:"w-20 rounded border border-neutral-9 bg-neutral-10 px-3 py-2 text-[15px] text-neutral-2 outline-none focus:border-primary-7"}),h.jsx("span",{className:"text-[15px] text-neutral-5",children:"days"})]}),h.jsx("p",{className:"mt-1 text-[13px] text-neutral-6",children:"Auto-delete archived sessions older than this"})]}),h.jsx("div",{className:"col-span-2",children:h.jsx(K0,{value:N,token:r.token,placeholder:"~/repos (default)",helpText:"Absolute path to your locally cloned repositories. Leave empty to use the server default.",inputClass:"text-[15px]",onSave:async M=>{await D0(r.token,M),j(M)}})}),h.jsxs("div",{className:"col-span-2",children:[h.jsx("label",{className:"mb-1.5 block text-[15px] text-neutral-4",children:h.jsxs("span",{className:"flex items-center gap-1.5",children:[h.jsx(lN,{size:14,className:"text-neutral-5"}),"Support LLM Provider"]})}),h.jsx("select",{value:v,onChange:M=>{const K=M.target.value;S(K),S2(r.token,K).catch(()=>I("Failed to save provider setting"))},className:"w-full rounded border border-neutral-9 bg-neutral-10 px-3 py-2 text-[15px] text-neutral-2 outline-none focus:border-primary-7",children:Object.keys(xy).map(M=>{const K=M!=="auto"&&!E.includes(M);return h.jsxs("option",{value:M,disabled:K,children:[xy[M],K?" (no API key)":""]},M)})}),v!=="auto"&&h.jsxs("div",{className:"mt-1.5 rounded border border-neutral-9 bg-neutral-10/50 px-3 py-1.5",children:[h.jsx("span",{className:"text-[13px] text-neutral-5",children:"Model: "}),h.jsx("span",{className:"text-[13px] font-mono text-neutral-3",children:__[v]})]}),h.jsx("p",{className:"mt-1 text-[13px] text-neutral-6",children:"Used for session naming and other background tasks"})]})]})}),h.jsxs(Kd,{icon:h.jsx(sN,{size:15}),title:"GitHub Webhooks",children:[h.jsx("div",{className:"flex items-center gap-2 mb-3",children:U?U.enabled?h.jsxs(h.Fragment,{children:[h.jsx(k_,{size:16,className:"text-success-6"}),h.jsx("span",{className:"text-[15px] text-success-5 font-medium",children:"Active"}),h.jsxs("span",{className:"text-[13px] text-neutral-6",children:["· max ",U.maxConcurrentSessions," concurrent sessions"]})]}):h.jsxs(h.Fragment,{children:[h.jsx(E_,{size:16,className:"text-neutral-6"}),h.jsx("span",{className:"text-[15px] text-neutral-5",children:"Disabled"})]}):h.jsx("span",{className:"text-[13px] text-neutral-6",children:"Loading..."})}),h.jsx("p",{className:"text-[13px] text-neutral-5 mb-3",children:"Automatically create Claude sessions to diagnose and fix CI failures. When a GitHub Actions workflow fails, a webhook triggers Codekin to analyze logs, identify the issue, and propose a fix."}),h.jsxs("div",{className:"mb-3",children:[h.jsx("label",{className:"mb-1 block text-[12px] font-medium text-neutral-5 uppercase tracking-wide",children:"Webhook URL"}),h.jsxs("div",{className:"flex items-center gap-1 rounded border border-neutral-9 bg-neutral-10 px-3 py-2",children:[h.jsx("code",{className:"flex-1 text-[13px] text-neutral-3 font-mono truncate select-all",children:ee}),h.jsx(T_,{text:ee})]})]}),h.jsxs("button",{onClick:()=>B(!X),className:"flex items-center gap-1.5 text-[13px] text-primary-6 hover:text-primary-5 mb-2 transition-colors",children:[X?h.jsx(Zr,{size:14}):h.jsx(va,{size:14}),"Setup instructions"]}),X&&h.jsxs("div",{className:"rounded border border-neutral-9 bg-neutral-10/50 px-4 py-3 mb-3 text-[13px] text-neutral-4 space-y-2.5",children:[h.jsxs("div",{className:"flex gap-2",children:[h.jsx("span",{className:"text-primary-6 font-semibold shrink-0",children:"1."}),h.jsxs("span",{children:["In your GitHub repo, go to ",h.jsx("strong",{className:"text-neutral-3",children:"Settings → Webhooks → Add webhook"})]})]}),h.jsxs("div",{className:"flex gap-2",children:[h.jsx("span",{className:"text-primary-6 font-semibold shrink-0",children:"2."}),h.jsxs("span",{children:["Set ",h.jsx("strong",{className:"text-neutral-3",children:"Payload URL"})," to the webhook URL above. Set ",h.jsx("strong",{className:"text-neutral-3",children:"Content type"})," to ",h.jsx("code",{className:"text-neutral-3 bg-neutral-9/50 px-1 rounded",children:"application/json"})]})]}),h.jsxs("div",{className:"flex gap-2",children:[h.jsx("span",{className:"text-primary-6 font-semibold shrink-0",children:"3."}),h.jsxs("span",{children:["Set a ",h.jsx("strong",{className:"text-neutral-3",children:"Secret"})," matching the server's ",h.jsx("code",{className:"text-neutral-3 bg-neutral-9/50 px-1 rounded",children:"GITHUB_WEBHOOK_SECRET"})," env var"]})]}),h.jsxs("div",{className:"flex gap-2",children:[h.jsx("span",{className:"text-primary-6 font-semibold shrink-0",children:"4."}),h.jsxs("span",{children:["Under ",h.jsx("strong",{className:"text-neutral-3",children:"“Which events?”"}),", select ",h.jsx("strong",{className:"text-neutral-3",children:"Let me select individual events"})," and check ",h.jsx("strong",{className:"text-neutral-3",children:"Workflow runs"})]})]}),h.jsxs("p",{className:"text-[13px] text-neutral-6 pt-1 border-t border-neutral-9/50",children:["Failed workflow runs will automatically spawn a ",h.jsx(tc,{size:12,className:"inline -mt-0.5"})," session that analyzes logs and proposes fixes."]})]}),z.length>0&&h.jsxs(h.Fragment,{children:[h.jsxs("button",{onClick:()=>Z(!q),className:"flex items-center gap-1.5 text-[13px] text-primary-6 hover:text-primary-5 transition-colors",children:[q?h.jsx(Zr,{size:14}):h.jsx(va,{size:14}),"Recent events (",z.length,")"]}),q&&h.jsx("div",{className:"mt-2 rounded border border-neutral-9 bg-neutral-10/50 divide-y divide-neutral-9/50 max-h-48 overflow-y-auto",children:z.slice(0,10).map(M=>h.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 text-[12px]",children:[h.jsx(tc,{size:13,className:"text-neutral-6 shrink-0"}),h.jsx("span",{className:"text-neutral-3 font-mono truncate flex-1",children:M.repo}),h.jsx("span",{className:"text-neutral-5 truncate max-w-24",children:M.workflow}),h.jsx(A_,{status:M.status})]},M.id))})]}),U&&!U.enabled&&h.jsxs("p",{className:"mt-3 text-[13px] text-neutral-6",children:["Set ",h.jsx("code",{className:"bg-neutral-9/50 px-1 rounded text-neutral-4",children:"GITHUB_WEBHOOK_ENABLED=true"})," and ",h.jsx("code",{className:"bg-neutral-9/50 px-1 rounded text-neutral-4",children:"GITHUB_WEBHOOK_SECRET"})," on the server to enable."]})]})]}),h.jsxs("div",{className:"flex-shrink-0 px-6 py-4 border-t border-neutral-10 flex items-center justify-between",children:[h.jsx("div",{children:C&&h.jsx("p",{className:"text-[13px] text-error-5",children:C})}),h.jsxs("div",{className:"flex gap-2",children:[r.token&&h.jsx("button",{onClick:n,className:"rounded px-4 py-2 text-[15px] text-neutral-6 hover:text-neutral-2",children:"Cancel"}),h.jsx("button",{onClick:Y,disabled:!o.trim(),className:"rounded bg-primary-8 px-4 py-2 text-[15px] font-medium text-neutral-1 hover:bg-primary-7 disabled:opacity-50",children:"Save"})]})]})]})})}function R_(e,n){const r={};return(e[e.length-1]===""?[...e,""]:e).join((r.padRight?" ":"")+","+(r.padLeft===!1?"":" ")).trim()}const j_=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,M_=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,O_={};function by(e,n){return(O_.jsx?M_:j_).test(e)}const D_=/[ \t\n\f\r]/g;function z_(e){return typeof e=="object"?e.type==="text"?yy(e.value):!1:yy(e)}function yy(e){return e.replace(D_,"")===""}class uo{constructor(n,r,l){this.normal=r,this.property=n,l&&(this.space=l)}}uo.prototype.normal={};uo.prototype.property={};uo.prototype.space=void 0;function Z0(e,n){const r={},l={};for(const s of e)Object.assign(r,s.property),Object.assign(l,s.normal);return new uo(r,l,n)}function Hh(e){return e.toLowerCase()}class Jn{constructor(n,r){this.attribute=r,this.property=n}}Jn.prototype.attribute="";Jn.prototype.booleanish=!1;Jn.prototype.boolean=!1;Jn.prototype.commaOrSpaceSeparated=!1;Jn.prototype.commaSeparated=!1;Jn.prototype.defined=!1;Jn.prototype.mustUseProperty=!1;Jn.prototype.number=!1;Jn.prototype.overloadedBoolean=!1;Jn.prototype.property="";Jn.prototype.spaceSeparated=!1;Jn.prototype.space=void 0;let L_=0;const Je=jl(),cn=jl(),Ph=jl(),ye=jl(),Ut=jl(),Ai=jl(),cr=jl();function jl(){return 2**++L_}const Fh=Object.freeze(Object.defineProperty({__proto__:null,boolean:Je,booleanish:cn,commaOrSpaceSeparated:cr,commaSeparated:Ai,number:ye,overloadedBoolean:Ph,spaceSeparated:Ut},Symbol.toStringTag,{value:"Module"})),Zd=Object.keys(Fh);class kp extends Jn{constructor(n,r,l,s){let o=-1;if(super(n,r),vy(this,"space",s),typeof l=="number")for(;++o<Zd.length;){const u=Zd[o];vy(this,Zd[o],(l&Fh[u])===Fh[u])}}}kp.prototype.defined=!0;function vy(e,n,r){r&&(e[n]=r)}function Oi(e){const n={},r={};for(const[l,s]of Object.entries(e.properties)){const o=new kp(l,e.transform(e.attributes||{},l),s,e.space);e.mustUseProperty&&e.mustUseProperty.includes(l)&&(o.mustUseProperty=!0),n[l]=o,r[Hh(l)]=l,r[Hh(o.attribute)]=l}return new uo(n,r,e.space)}const Q0=Oi({properties:{ariaActiveDescendant:null,ariaAtomic:cn,ariaAutoComplete:null,ariaBusy:cn,ariaChecked:cn,ariaColCount:ye,ariaColIndex:ye,ariaColSpan:ye,ariaControls:Ut,ariaCurrent:null,ariaDescribedBy:Ut,ariaDetails:null,ariaDisabled:cn,ariaDropEffect:Ut,ariaErrorMessage:null,ariaExpanded:cn,ariaFlowTo:Ut,ariaGrabbed:cn,ariaHasPopup:null,ariaHidden:cn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Ut,ariaLevel:ye,ariaLive:null,ariaModal:cn,ariaMultiLine:cn,ariaMultiSelectable:cn,ariaOrientation:null,ariaOwns:Ut,ariaPlaceholder:null,ariaPosInSet:ye,ariaPressed:cn,ariaReadOnly:cn,ariaRelevant:null,ariaRequired:cn,ariaRoleDescription:Ut,ariaRowCount:ye,ariaRowIndex:ye,ariaRowSpan:ye,ariaSelected:cn,ariaSetSize:ye,ariaSort:null,ariaValueMax:ye,ariaValueMin:ye,ariaValueNow:ye,ariaValueText:null,role:null},transform(e,n){return n==="role"?n:"aria-"+n.slice(4).toLowerCase()}});function W0(e,n){return n in e?e[n]:n}function J0(e,n){return W0(e,n.toLowerCase())}const B_=Oi({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Ai,acceptCharset:Ut,accessKey:Ut,action:null,allow:null,allowFullScreen:Je,allowPaymentRequest:Je,allowUserMedia:Je,alt:null,as:null,async:Je,autoCapitalize:null,autoComplete:Ut,autoFocus:Je,autoPlay:Je,blocking:Ut,capture:null,charSet:null,checked:Je,cite:null,className:Ut,cols:ye,colSpan:null,content:null,contentEditable:cn,controls:Je,controlsList:Ut,coords:ye|Ai,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Je,defer:Je,dir:null,dirName:null,disabled:Je,download:Ph,draggable:cn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Je,formTarget:null,headers:Ut,height:ye,hidden:Ph,high:ye,href:null,hrefLang:null,htmlFor:Ut,httpEquiv:Ut,id:null,imageSizes:null,imageSrcSet:null,inert:Je,inputMode:null,integrity:null,is:null,isMap:Je,itemId:null,itemProp:Ut,itemRef:Ut,itemScope:Je,itemType:Ut,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Je,low:ye,manifest:null,max:null,maxLength:ye,media:null,method:null,min:null,minLength:ye,multiple:Je,muted:Je,name:null,nonce:null,noModule:Je,noValidate:Je,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:Je,optimum:ye,pattern:null,ping:Ut,placeholder:null,playsInline:Je,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Je,referrerPolicy:null,rel:Ut,required:Je,reversed:Je,rows:ye,rowSpan:ye,sandbox:Ut,scope:null,scoped:Je,seamless:Je,selected:Je,shadowRootClonable:Je,shadowRootDelegatesFocus:Je,shadowRootMode:null,shape:null,size:ye,sizes:null,slot:null,span:ye,spellCheck:cn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:ye,step:null,style:null,tabIndex:ye,target:null,title:null,translate:null,type:null,typeMustMatch:Je,useMap:null,value:cn,width:ye,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Ut,axis:null,background:null,bgColor:null,border:ye,borderColor:null,bottomMargin:ye,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Je,declare:Je,event:null,face:null,frame:null,frameBorder:null,hSpace:ye,leftMargin:ye,link:null,longDesc:null,lowSrc:null,marginHeight:ye,marginWidth:ye,noResize:Je,noHref:Je,noShade:Je,noWrap:Je,object:null,profile:null,prompt:null,rev:null,rightMargin:ye,rules:null,scheme:null,scrolling:cn,standby:null,summary:null,text:null,topMargin:ye,valueType:null,version:null,vAlign:null,vLink:null,vSpace:ye,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Je,disableRemotePlayback:Je,prefix:null,property:null,results:ye,security:null,unselectable:null},space:"html",transform:J0}),I_=Oi({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:cr,accentHeight:ye,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:ye,amplitude:ye,arabicForm:null,ascent:ye,attributeName:null,attributeType:null,azimuth:ye,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:ye,by:null,calcMode:null,capHeight:ye,className:Ut,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:ye,diffuseConstant:ye,direction:null,display:null,dur:null,divisor:ye,dominantBaseline:null,download:Je,dx:null,dy:null,edgeMode:null,editable:null,elevation:ye,enableBackground:null,end:null,event:null,exponent:ye,externalResourcesRequired:null,fill:null,fillOpacity:ye,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:Ai,g2:Ai,glyphName:Ai,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:ye,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:ye,horizOriginX:ye,horizOriginY:ye,id:null,ideographic:ye,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:ye,k:ye,k1:ye,k2:ye,k3:ye,k4:ye,kernelMatrix:cr,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:ye,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:ye,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:ye,overlineThickness:ye,paintOrder:null,panose1:null,path:null,pathLength:ye,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Ut,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:ye,pointsAtY:ye,pointsAtZ:ye,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:cr,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:cr,rev:cr,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:cr,requiredFeatures:cr,requiredFonts:cr,requiredFormats:cr,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:ye,specularExponent:ye,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:ye,strikethroughThickness:ye,string:null,stroke:null,strokeDashArray:cr,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:ye,strokeOpacity:ye,strokeWidth:null,style:null,surfaceScale:ye,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:cr,tabIndex:ye,tableValues:null,target:null,targetX:ye,targetY:ye,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:cr,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:ye,underlineThickness:ye,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:ye,values:null,vAlphabetic:ye,vMathematical:ye,vectorEffect:null,vHanging:ye,vIdeographic:ye,version:null,vertAdvY:ye,vertOriginX:ye,vertOriginY:ye,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:ye,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:W0}),ev=Oi({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,n){return"xlink:"+n.slice(5).toLowerCase()}}),tv=Oi({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:J0}),nv=Oi({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,n){return"xml:"+n.slice(3).toLowerCase()}}),U_={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"},$_=/[A-Z]/g,wy=/-[a-z]/g,H_=/^data[-\w.:]+$/i;function P_(e,n){const r=Hh(n);let l=n,s=Jn;if(r in e.normal)return e.property[e.normal[r]];if(r.length>4&&r.slice(0,4)==="data"&&H_.test(n)){if(n.charAt(4)==="-"){const o=n.slice(5).replace(wy,G_);l="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=n.slice(4);if(!wy.test(o)){let u=o.replace($_,F_);u.charAt(0)!=="-"&&(u="-"+u),n="data"+u}}s=kp}return new s(l,n)}function F_(e){return"-"+e.toLowerCase()}function G_(e){return e.charAt(1).toUpperCase()}const q_=Z0([Q0,B_,ev,tv,nv],"html"),Sp=Z0([Q0,I_,ev,tv,nv],"svg");function Y_(e){return e.join(" ").trim()}var gi={},Qd,ky;function V_(){if(ky)return Qd;ky=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,n=/\n/g,r=/^\s*/,l=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,s=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,u=/^[;\s]*/,f=/^\s+|\s+$/g,d=`
|
|
15
|
+
`,p="/",x="*",g="",y="comment",v="declaration";function S(T,N){if(typeof T!="string")throw new TypeError("First argument must be a string");if(!T)return[];N=N||{};var j=1,C=1;function I(ae){var Y=ae.match(n);Y&&(j+=Y.length);var M=ae.lastIndexOf(d);C=~M?ae.length-M:C+ae.length}function U(){var ae={line:j,column:C};return function(Y){return Y.position=new _(ae),X(),Y}}function _(ae){this.start=ae,this.end={line:j,column:C},this.source=N.source}_.prototype.content=T;function z(ae){var Y=new Error(N.source+":"+j+":"+C+": "+ae);if(Y.reason=ae,Y.filename=N.source,Y.line=j,Y.column=C,Y.source=T,!N.silent)throw Y}function P(ae){var Y=ae.exec(T);if(Y){var M=Y[0];return I(M),T=T.slice(M.length),Y}}function X(){P(r)}function B(ae){var Y;for(ae=ae||[];Y=q();)Y!==!1&&ae.push(Y);return ae}function q(){var ae=U();if(!(p!=T.charAt(0)||x!=T.charAt(1))){for(var Y=2;g!=T.charAt(Y)&&(x!=T.charAt(Y)||p!=T.charAt(Y+1));)++Y;if(Y+=2,g===T.charAt(Y-1))return z("End of comment missing");var M=T.slice(2,Y-2);return C+=2,I(M),T=T.slice(Y),C+=2,ae({type:y,comment:M})}}function Z(){var ae=U(),Y=P(l);if(Y){if(q(),!P(s))return z("property missing ':'");var M=P(o),K=ae({type:v,property:E(Y[0].replace(e,g)),value:M?E(M[0].replace(e,g)):g});return P(u),K}}function ee(){var ae=[];B(ae);for(var Y;Y=Z();)Y!==!1&&(ae.push(Y),B(ae));return ae}return X(),ee()}function E(T){return T?T.replace(f,g):g}return Qd=S,Qd}var Sy;function X_(){if(Sy)return gi;Sy=1;var e=gi&&gi.__importDefault||function(l){return l&&l.__esModule?l:{default:l}};Object.defineProperty(gi,"__esModule",{value:!0}),gi.default=r;const n=e(V_());function r(l,s){let o=null;if(!l||typeof l!="string")return o;const u=(0,n.default)(l),f=typeof s=="function";return u.forEach(d=>{if(d.type!=="declaration")return;const{property:p,value:x}=d;f?s(p,x,d):x&&(o=o||{},o[p]=x)}),o}return gi}var Rs={},Ey;function K_(){if(Ey)return Rs;Ey=1,Object.defineProperty(Rs,"__esModule",{value:!0}),Rs.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,r=/^[^-]+$/,l=/^-(webkit|moz|ms|o|khtml)-/,s=/^-(ms)-/,o=function(p){return!p||r.test(p)||e.test(p)},u=function(p,x){return x.toUpperCase()},f=function(p,x){return"".concat(x,"-")},d=function(p,x){return x===void 0&&(x={}),o(p)?p:(p=p.toLowerCase(),x.reactCompat?p=p.replace(s,f):p=p.replace(l,f),p.replace(n,u))};return Rs.camelCase=d,Rs}var js,Ny;function Z_(){if(Ny)return js;Ny=1;var e=js&&js.__importDefault||function(s){return s&&s.__esModule?s:{default:s}},n=e(X_()),r=K_();function l(s,o){var u={};return!s||typeof s!="string"||(0,n.default)(s,function(f,d){f&&d&&(u[(0,r.camelCase)(f,o)]=d)}),u}return l.default=l,js=l,js}var Q_=Z_();const W_=so(Q_),rv=av("end"),Ep=av("start");function av(e){return n;function n(r){const l=r&&r.position&&r.position[e]||{};if(typeof l.line=="number"&&l.line>0&&typeof l.column=="number"&&l.column>0)return{line:l.line,column:l.column,offset:typeof l.offset=="number"&&l.offset>-1?l.offset:void 0}}}function J_(e){const n=Ep(e),r=rv(e);if(n&&r)return{start:n,end:r}}function Ys(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?_y(e.position):"start"in e||"end"in e?_y(e):"line"in e||"column"in e?Gh(e):""}function Gh(e){return Ty(e&&e.line)+":"+Ty(e&&e.column)}function _y(e){return Gh(e&&e.start)+"-"+Gh(e&&e.end)}function Ty(e){return e&&typeof e=="number"?e:1}class Mn extends Error{constructor(n,r,l){super(),typeof r=="string"&&(l=r,r=void 0);let s="",o={},u=!1;if(r&&("line"in r&&"column"in r?o={place:r}:"start"in r&&"end"in r?o={place:r}:"type"in r?o={ancestors:[r],place:r.position}:o={...r}),typeof n=="string"?s=n:!o.cause&&n&&(u=!0,s=n.message,o.cause=n),!o.ruleId&&!o.source&&typeof l=="string"){const d=l.indexOf(":");d===-1?o.ruleId=l:(o.source=l.slice(0,d),o.ruleId=l.slice(d+1))}if(!o.place&&o.ancestors&&o.ancestors){const d=o.ancestors[o.ancestors.length-1];d&&(o.place=d.position)}const f=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=f?f.column:void 0,this.fatal=void 0,this.file="",this.message=s,this.line=f?f.line:void 0,this.name=Ys(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=u&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Mn.prototype.file="";Mn.prototype.name="";Mn.prototype.reason="";Mn.prototype.message="";Mn.prototype.stack="";Mn.prototype.column=void 0;Mn.prototype.line=void 0;Mn.prototype.ancestors=void 0;Mn.prototype.cause=void 0;Mn.prototype.fatal=void 0;Mn.prototype.place=void 0;Mn.prototype.ruleId=void 0;Mn.prototype.source=void 0;const Np={}.hasOwnProperty,eT=new Map,tT=/[A-Z]/g,nT=new Set(["table","tbody","thead","tfoot","tr"]),rT=new Set(["td","th"]),lv="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function aT(e,n){if(!n||n.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const r=n.filePath||void 0;let l;if(n.development){if(typeof n.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");l=dT(r,n.jsxDEV)}else{if(typeof n.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof n.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");l=fT(r,n.jsx,n.jsxs)}const s={Fragment:n.Fragment,ancestors:[],components:n.components||{},create:l,elementAttributeNameCase:n.elementAttributeNameCase||"react",evaluater:n.createEvaluater?n.createEvaluater():void 0,filePath:r,ignoreInvalidStyle:n.ignoreInvalidStyle||!1,passKeys:n.passKeys!==!1,passNode:n.passNode||!1,schema:n.space==="svg"?Sp:q_,stylePropertyNameCase:n.stylePropertyNameCase||"dom",tableCellAlignToStyle:n.tableCellAlignToStyle!==!1},o=iv(s,e,void 0);return o&&typeof o!="string"?o:s.create(e,s.Fragment,{children:o||void 0},void 0)}function iv(e,n,r){if(n.type==="element")return lT(e,n,r);if(n.type==="mdxFlowExpression"||n.type==="mdxTextExpression")return iT(e,n);if(n.type==="mdxJsxFlowElement"||n.type==="mdxJsxTextElement")return oT(e,n,r);if(n.type==="mdxjsEsm")return sT(e,n);if(n.type==="root")return uT(e,n,r);if(n.type==="text")return cT(e,n)}function lT(e,n,r){const l=e.schema;let s=l;n.tagName.toLowerCase()==="svg"&&l.space==="html"&&(s=Sp,e.schema=s),e.ancestors.push(n);const o=ov(e,n.tagName,!1),u=hT(e,n);let f=Tp(e,n);return nT.has(n.tagName)&&(f=f.filter(function(d){return typeof d=="string"?!z_(d):!0})),sv(e,u,o,n),_p(u,f),e.ancestors.pop(),e.schema=l,e.create(n,o,u,r)}function iT(e,n){if(n.data&&n.data.estree&&e.evaluater){const l=n.data.estree.body[0];return l.type,e.evaluater.evaluateExpression(l.expression)}Ws(e,n.position)}function sT(e,n){if(n.data&&n.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(n.data.estree);Ws(e,n.position)}function oT(e,n,r){const l=e.schema;let s=l;n.name==="svg"&&l.space==="html"&&(s=Sp,e.schema=s),e.ancestors.push(n);const o=n.name===null?e.Fragment:ov(e,n.name,!0),u=pT(e,n),f=Tp(e,n);return sv(e,u,o,n),_p(u,f),e.ancestors.pop(),e.schema=l,e.create(n,o,u,r)}function uT(e,n,r){const l={};return _p(l,Tp(e,n)),e.create(n,e.Fragment,l,r)}function cT(e,n){return n.value}function sv(e,n,r,l){typeof r!="string"&&r!==e.Fragment&&e.passNode&&(n.node=l)}function _p(e,n){if(n.length>0){const r=n.length>1?n:n[0];r&&(e.children=r)}}function fT(e,n,r){return l;function l(s,o,u,f){const p=Array.isArray(u.children)?r:n;return f?p(o,u,f):p(o,u)}}function dT(e,n){return r;function r(l,s,o,u){const f=Array.isArray(o.children),d=Ep(l);return n(s,o,u,f,{columnNumber:d?d.column-1:void 0,fileName:e,lineNumber:d?d.line:void 0},void 0)}}function hT(e,n){const r={};let l,s;for(s in n.properties)if(s!=="children"&&Np.call(n.properties,s)){const o=mT(e,s,n.properties[s]);if(o){const[u,f]=o;e.tableCellAlignToStyle&&u==="align"&&typeof f=="string"&&rT.has(n.tagName)?l=f:r[u]=f}}if(l){const o=r.style||(r.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=l}return r}function pT(e,n){const r={};for(const l of n.attributes)if(l.type==="mdxJsxExpressionAttribute")if(l.data&&l.data.estree&&e.evaluater){const o=l.data.estree.body[0];o.type;const u=o.expression;u.type;const f=u.properties[0];f.type,Object.assign(r,e.evaluater.evaluateExpression(f.argument))}else Ws(e,n.position);else{const s=l.name;let o;if(l.value&&typeof l.value=="object")if(l.value.data&&l.value.data.estree&&e.evaluater){const f=l.value.data.estree.body[0];f.type,o=e.evaluater.evaluateExpression(f.expression)}else Ws(e,n.position);else o=l.value===null?!0:l.value;r[s]=o}return r}function Tp(e,n){const r=[];let l=-1;const s=e.passKeys?new Map:eT;for(;++l<n.children.length;){const o=n.children[l];let u;if(e.passKeys){const d=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(d){const p=s.get(d)||0;u=d+"-"+p,s.set(d,p+1)}}const f=iv(e,o,u);f!==void 0&&r.push(f)}return r}function mT(e,n,r){const l=P_(e.schema,n);if(!(r==null||typeof r=="number"&&Number.isNaN(r))){if(Array.isArray(r)&&(r=l.commaSeparated?R_(r):Y_(r)),l.property==="style"){let s=typeof r=="object"?r:gT(e,String(r));return e.stylePropertyNameCase==="css"&&(s=xT(s)),["style",s]}return[e.elementAttributeNameCase==="react"&&l.space?U_[l.property]||l.property:l.attribute,r]}}function gT(e,n){try{return W_(n,{reactCompat:!0})}catch(r){if(e.ignoreInvalidStyle)return{};const l=r,s=new Mn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:l,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw s.file=e.filePath||void 0,s.url=lv+"#cannot-parse-style-attribute",s}}function ov(e,n,r){let l;if(!r)l={type:"Literal",value:n};else if(n.includes(".")){const s=n.split(".");let o=-1,u;for(;++o<s.length;){const f=by(s[o])?{type:"Identifier",name:s[o]}:{type:"Literal",value:s[o]};u=u?{type:"MemberExpression",object:u,property:f,computed:!!(o&&f.type==="Literal"),optional:!1}:f}l=u}else l=by(n)&&!/^[a-z]/.test(n)?{type:"Identifier",name:n}:{type:"Literal",value:n};if(l.type==="Literal"){const s=l.value;return Np.call(e.components,s)?e.components[s]:s}if(e.evaluater)return e.evaluater.evaluateExpression(l);Ws(e)}function Ws(e,n){const r=new Mn("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:n,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw r.file=e.filePath||void 0,r.url=lv+"#cannot-handle-mdx-estrees-without-createevaluater",r}function xT(e){const n={};let r;for(r in e)Np.call(e,r)&&(n[bT(r)]=e[r]);return n}function bT(e){let n=e.replace(tT,yT);return n.slice(0,3)==="ms-"&&(n="-"+n),n}function yT(e){return"-"+e.toLowerCase()}const Wd={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"]},vT={};function Ap(e,n){const r=vT,l=typeof r.includeImageAlt=="boolean"?r.includeImageAlt:!0,s=typeof r.includeHtml=="boolean"?r.includeHtml:!0;return uv(e,l,s)}function uv(e,n,r){if(wT(e)){if("value"in e)return e.type==="html"&&!r?"":e.value;if(n&&"alt"in e&&e.alt)return e.alt;if("children"in e)return Ay(e.children,n,r)}return Array.isArray(e)?Ay(e,n,r):""}function Ay(e,n,r){const l=[];let s=-1;for(;++s<e.length;)l[s]=uv(e[s],n,r);return l.join("")}function wT(e){return!!(e&&typeof e=="object")}const Cy=document.createElement("i");function Cp(e){const n="&"+e+";";Cy.innerHTML=n;const r=Cy.textContent;return r.charCodeAt(r.length-1)===59&&e!=="semi"||r===n?!1:r}function hr(e,n,r,l){const s=e.length;let o=0,u;if(n<0?n=-n>s?0:s+n:n=n>s?s:n,r=r>0?r:0,l.length<1e4)u=Array.from(l),u.unshift(n,r),e.splice(...u);else for(r&&e.splice(n,r);o<l.length;)u=l.slice(o,o+1e4),u.unshift(n,0),e.splice(...u),o+=1e4,n+=1e4}function _r(e,n){return e.length>0?(hr(e,e.length,0,n),e):n}const Ry={}.hasOwnProperty;function cv(e){const n={};let r=-1;for(;++r<e.length;)kT(n,e[r]);return n}function kT(e,n){let r;for(r in n){const s=(Ry.call(e,r)?e[r]:void 0)||(e[r]={}),o=n[r];let u;if(o)for(u in o){Ry.call(s,u)||(s[u]=[]);const f=o[u];ST(s[u],Array.isArray(f)?f:f?[f]:[])}}}function ST(e,n){let r=-1;const l=[];for(;++r<n.length;)(n[r].add==="after"?e:l).push(n[r]);hr(e,0,0,l)}function fv(e,n){const r=Number.parseInt(e,n);return r<9||r===11||r>13&&r<32||r>126&&r<160||r>55295&&r<57344||r>64975&&r<65008||(r&65535)===65535||(r&65535)===65534||r>1114111?"�":String.fromCodePoint(r)}function Lr(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const In=al(/[A-Za-z]/),jn=al(/[\dA-Za-z]/),ET=al(/[#-'*+\--9=?A-Z^-~]/);function nc(e){return e!==null&&(e<32||e===127)}const qh=al(/\d/),NT=al(/[\dA-Fa-f]/),_T=al(/[!-/:-@[-`{-~]/);function $e(e){return e!==null&&e<-2}function zt(e){return e!==null&&(e<0||e===32)}function it(e){return e===-2||e===-1||e===32}const xc=al(new RegExp("\\p{P}|\\p{S}","u")),Tl=al(/\s/);function al(e){return n;function n(r){return r!==null&&r>-1&&e.test(String.fromCharCode(r))}}function Di(e){const n=[];let r=-1,l=0,s=0;for(;++r<e.length;){const o=e.charCodeAt(r);let u="";if(o===37&&jn(e.charCodeAt(r+1))&&jn(e.charCodeAt(r+2)))s=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(u=String.fromCharCode(o));else if(o>55295&&o<57344){const f=e.charCodeAt(r+1);o<56320&&f>56319&&f<57344?(u=String.fromCharCode(o,f),s=1):u="�"}else u=String.fromCharCode(o);u&&(n.push(e.slice(l,r),encodeURIComponent(u)),l=r+s+1,u=""),s&&(r+=s,s=0)}return n.join("")+e.slice(l)}function dt(e,n,r,l){const s=l?l-1:Number.POSITIVE_INFINITY;let o=0;return u;function u(d){return it(d)?(e.enter(r),f(d)):n(d)}function f(d){return it(d)&&o++<s?(e.consume(d),f):(e.exit(r),n(d))}}const TT={tokenize:AT};function AT(e){const n=e.attempt(this.parser.constructs.contentInitial,l,s);let r;return n;function l(f){if(f===null){e.consume(f);return}return e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),dt(e,n,"linePrefix")}function s(f){return e.enter("paragraph"),o(f)}function o(f){const d=e.enter("chunkText",{contentType:"text",previous:r});return r&&(r.next=d),r=d,u(f)}function u(f){if(f===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(f);return}return $e(f)?(e.consume(f),e.exit("chunkText"),o):(e.consume(f),u)}}const CT={tokenize:RT},jy={tokenize:jT};function RT(e){const n=this,r=[];let l=0,s,o,u;return f;function f(C){if(l<r.length){const I=r[l];return n.containerState=I[1],e.attempt(I[0].continuation,d,p)(C)}return p(C)}function d(C){if(l++,n.containerState._closeFlow){n.containerState._closeFlow=void 0,s&&j();const I=n.events.length;let U=I,_;for(;U--;)if(n.events[U][0]==="exit"&&n.events[U][1].type==="chunkFlow"){_=n.events[U][1].end;break}N(l);let z=I;for(;z<n.events.length;)n.events[z][1].end={..._},z++;return hr(n.events,U+1,0,n.events.slice(I)),n.events.length=z,p(C)}return f(C)}function p(C){if(l===r.length){if(!s)return y(C);if(s.currentConstruct&&s.currentConstruct.concrete)return S(C);n.interrupt=!!(s.currentConstruct&&!s._gfmTableDynamicInterruptHack)}return n.containerState={},e.check(jy,x,g)(C)}function x(C){return s&&j(),N(l),y(C)}function g(C){return n.parser.lazy[n.now().line]=l!==r.length,u=n.now().offset,S(C)}function y(C){return n.containerState={},e.attempt(jy,v,S)(C)}function v(C){return l++,r.push([n.currentConstruct,n.containerState]),y(C)}function S(C){if(C===null){s&&j(),N(0),e.consume(C);return}return s=s||n.parser.flow(n.now()),e.enter("chunkFlow",{_tokenizer:s,contentType:"flow",previous:o}),E(C)}function E(C){if(C===null){T(e.exit("chunkFlow"),!0),N(0),e.consume(C);return}return $e(C)?(e.consume(C),T(e.exit("chunkFlow")),l=0,n.interrupt=void 0,f):(e.consume(C),E)}function T(C,I){const U=n.sliceStream(C);if(I&&U.push(null),C.previous=o,o&&(o.next=C),o=C,s.defineSkip(C.start),s.write(U),n.parser.lazy[C.start.line]){let _=s.events.length;for(;_--;)if(s.events[_][1].start.offset<u&&(!s.events[_][1].end||s.events[_][1].end.offset>u))return;const z=n.events.length;let P=z,X,B;for(;P--;)if(n.events[P][0]==="exit"&&n.events[P][1].type==="chunkFlow"){if(X){B=n.events[P][1].end;break}X=!0}for(N(l),_=z;_<n.events.length;)n.events[_][1].end={...B},_++;hr(n.events,P+1,0,n.events.slice(z)),n.events.length=_}}function N(C){let I=r.length;for(;I-- >C;){const U=r[I];n.containerState=U[1],U[0].exit.call(n,e)}r.length=C}function j(){s.write([null]),o=void 0,s=void 0,n.containerState._closeFlow=void 0}}function jT(e,n,r){return dt(e,e.attempt(this.parser.constructs.document,n,r),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Ri(e){if(e===null||zt(e)||Tl(e))return 1;if(xc(e))return 2}function bc(e,n,r){const l=[];let s=-1;for(;++s<e.length;){const o=e[s].resolveAll;o&&!l.includes(o)&&(n=o(n,r),l.push(o))}return n}const Yh={name:"attention",resolveAll:MT,tokenize:OT};function MT(e,n){let r=-1,l,s,o,u,f,d,p,x;for(;++r<e.length;)if(e[r][0]==="enter"&&e[r][1].type==="attentionSequence"&&e[r][1]._close){for(l=r;l--;)if(e[l][0]==="exit"&&e[l][1].type==="attentionSequence"&&e[l][1]._open&&n.sliceSerialize(e[l][1]).charCodeAt(0)===n.sliceSerialize(e[r][1]).charCodeAt(0)){if((e[l][1]._close||e[r][1]._open)&&(e[r][1].end.offset-e[r][1].start.offset)%3&&!((e[l][1].end.offset-e[l][1].start.offset+e[r][1].end.offset-e[r][1].start.offset)%3))continue;d=e[l][1].end.offset-e[l][1].start.offset>1&&e[r][1].end.offset-e[r][1].start.offset>1?2:1;const g={...e[l][1].end},y={...e[r][1].start};My(g,-d),My(y,d),u={type:d>1?"strongSequence":"emphasisSequence",start:g,end:{...e[l][1].end}},f={type:d>1?"strongSequence":"emphasisSequence",start:{...e[r][1].start},end:y},o={type:d>1?"strongText":"emphasisText",start:{...e[l][1].end},end:{...e[r][1].start}},s={type:d>1?"strong":"emphasis",start:{...u.start},end:{...f.end}},e[l][1].end={...u.start},e[r][1].start={...f.end},p=[],e[l][1].end.offset-e[l][1].start.offset&&(p=_r(p,[["enter",e[l][1],n],["exit",e[l][1],n]])),p=_r(p,[["enter",s,n],["enter",u,n],["exit",u,n],["enter",o,n]]),p=_r(p,bc(n.parser.constructs.insideSpan.null,e.slice(l+1,r),n)),p=_r(p,[["exit",o,n],["enter",f,n],["exit",f,n],["exit",s,n]]),e[r][1].end.offset-e[r][1].start.offset?(x=2,p=_r(p,[["enter",e[r][1],n],["exit",e[r][1],n]])):x=0,hr(e,l-1,r-l+3,p),r=l+p.length-x-2;break}}for(r=-1;++r<e.length;)e[r][1].type==="attentionSequence"&&(e[r][1].type="data");return e}function OT(e,n){const r=this.parser.constructs.attentionMarkers.null,l=this.previous,s=Ri(l);let o;return u;function u(d){return o=d,e.enter("attentionSequence"),f(d)}function f(d){if(d===o)return e.consume(d),f;const p=e.exit("attentionSequence"),x=Ri(d),g=!x||x===2&&s||r.includes(d),y=!s||s===2&&x||r.includes(l);return p._open=!!(o===42?g:g&&(s||!y)),p._close=!!(o===42?y:y&&(x||!g)),n(d)}}function My(e,n){e.column+=n,e.offset+=n,e._bufferIndex+=n}const DT={name:"autolink",tokenize:zT};function zT(e,n,r){let l=0;return s;function s(v){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(v){return In(v)?(e.consume(v),u):v===64?r(v):p(v)}function u(v){return v===43||v===45||v===46||jn(v)?(l=1,f(v)):p(v)}function f(v){return v===58?(e.consume(v),l=0,d):(v===43||v===45||v===46||jn(v))&&l++<32?(e.consume(v),f):(l=0,p(v))}function d(v){return v===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.exit("autolink"),n):v===null||v===32||v===60||nc(v)?r(v):(e.consume(v),d)}function p(v){return v===64?(e.consume(v),x):ET(v)?(e.consume(v),p):r(v)}function x(v){return jn(v)?g(v):r(v)}function g(v){return v===46?(e.consume(v),l=0,x):v===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.exit("autolink"),n):y(v)}function y(v){if((v===45||jn(v))&&l++<63){const S=v===45?y:g;return e.consume(v),S}return r(v)}}const co={partial:!0,tokenize:LT};function LT(e,n,r){return l;function l(o){return it(o)?dt(e,s,"linePrefix")(o):s(o)}function s(o){return o===null||$e(o)?n(o):r(o)}}const dv={continuation:{tokenize:IT},exit:UT,name:"blockQuote",tokenize:BT};function BT(e,n,r){const l=this;return s;function s(u){if(u===62){const f=l.containerState;return f.open||(e.enter("blockQuote",{_container:!0}),f.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(u),e.exit("blockQuoteMarker"),o}return r(u)}function o(u){return it(u)?(e.enter("blockQuotePrefixWhitespace"),e.consume(u),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),n):(e.exit("blockQuotePrefix"),n(u))}}function IT(e,n,r){const l=this;return s;function s(u){return it(u)?dt(e,o,"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(u):o(u)}function o(u){return e.attempt(dv,n,r)(u)}}function UT(e){e.exit("blockQuote")}const hv={name:"characterEscape",tokenize:$T};function $T(e,n,r){return l;function l(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),s}function s(o){return _T(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),n):r(o)}}const pv={name:"characterReference",tokenize:HT};function HT(e,n,r){const l=this;let s=0,o,u;return f;function f(g){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(g),e.exit("characterReferenceMarker"),d}function d(g){return g===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(g),e.exit("characterReferenceMarkerNumeric"),p):(e.enter("characterReferenceValue"),o=31,u=jn,x(g))}function p(g){return g===88||g===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(g),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,u=NT,x):(e.enter("characterReferenceValue"),o=7,u=qh,x(g))}function x(g){if(g===59&&s){const y=e.exit("characterReferenceValue");return u===jn&&!Cp(l.sliceSerialize(y))?r(g):(e.enter("characterReferenceMarker"),e.consume(g),e.exit("characterReferenceMarker"),e.exit("characterReference"),n)}return u(g)&&s++<o?(e.consume(g),x):r(g)}}const Oy={partial:!0,tokenize:FT},Dy={concrete:!0,name:"codeFenced",tokenize:PT};function PT(e,n,r){const l=this,s={partial:!0,tokenize:U};let o=0,u=0,f;return d;function d(_){return p(_)}function p(_){const z=l.events[l.events.length-1];return o=z&&z[1].type==="linePrefix"?z[2].sliceSerialize(z[1],!0).length:0,f=_,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),x(_)}function x(_){return _===f?(u++,e.consume(_),x):u<3?r(_):(e.exit("codeFencedFenceSequence"),it(_)?dt(e,g,"whitespace")(_):g(_))}function g(_){return _===null||$e(_)?(e.exit("codeFencedFence"),l.interrupt?n(_):e.check(Oy,E,I)(_)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),y(_))}function y(_){return _===null||$e(_)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),g(_)):it(_)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),dt(e,v,"whitespace")(_)):_===96&&_===f?r(_):(e.consume(_),y)}function v(_){return _===null||$e(_)?g(_):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),S(_))}function S(_){return _===null||$e(_)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),g(_)):_===96&&_===f?r(_):(e.consume(_),S)}function E(_){return e.attempt(s,I,T)(_)}function T(_){return e.enter("lineEnding"),e.consume(_),e.exit("lineEnding"),N}function N(_){return o>0&&it(_)?dt(e,j,"linePrefix",o+1)(_):j(_)}function j(_){return _===null||$e(_)?e.check(Oy,E,I)(_):(e.enter("codeFlowValue"),C(_))}function C(_){return _===null||$e(_)?(e.exit("codeFlowValue"),j(_)):(e.consume(_),C)}function I(_){return e.exit("codeFenced"),n(_)}function U(_,z,P){let X=0;return B;function B(Y){return _.enter("lineEnding"),_.consume(Y),_.exit("lineEnding"),q}function q(Y){return _.enter("codeFencedFence"),it(Y)?dt(_,Z,"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(Y):Z(Y)}function Z(Y){return Y===f?(_.enter("codeFencedFenceSequence"),ee(Y)):P(Y)}function ee(Y){return Y===f?(X++,_.consume(Y),ee):X>=u?(_.exit("codeFencedFenceSequence"),it(Y)?dt(_,ae,"whitespace")(Y):ae(Y)):P(Y)}function ae(Y){return Y===null||$e(Y)?(_.exit("codeFencedFence"),z(Y)):P(Y)}}}function FT(e,n,r){const l=this;return s;function s(u){return u===null?r(u):(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),o)}function o(u){return l.parser.lazy[l.now().line]?r(u):n(u)}}const Jd={name:"codeIndented",tokenize:qT},GT={partial:!0,tokenize:YT};function qT(e,n,r){const l=this;return s;function s(p){return e.enter("codeIndented"),dt(e,o,"linePrefix",5)(p)}function o(p){const x=l.events[l.events.length-1];return x&&x[1].type==="linePrefix"&&x[2].sliceSerialize(x[1],!0).length>=4?u(p):r(p)}function u(p){return p===null?d(p):$e(p)?e.attempt(GT,u,d)(p):(e.enter("codeFlowValue"),f(p))}function f(p){return p===null||$e(p)?(e.exit("codeFlowValue"),u(p)):(e.consume(p),f)}function d(p){return e.exit("codeIndented"),n(p)}}function YT(e,n,r){const l=this;return s;function s(u){return l.parser.lazy[l.now().line]?r(u):$e(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),s):dt(e,o,"linePrefix",5)(u)}function o(u){const f=l.events[l.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?n(u):$e(u)?s(u):r(u)}}const VT={name:"codeText",previous:KT,resolve:XT,tokenize:ZT};function XT(e){let n=e.length-4,r=3,l,s;if((e[r][1].type==="lineEnding"||e[r][1].type==="space")&&(e[n][1].type==="lineEnding"||e[n][1].type==="space")){for(l=r;++l<n;)if(e[l][1].type==="codeTextData"){e[r][1].type="codeTextPadding",e[n][1].type="codeTextPadding",r+=2,n-=2;break}}for(l=r-1,n++;++l<=n;)s===void 0?l!==n&&e[l][1].type!=="lineEnding"&&(s=l):(l===n||e[l][1].type==="lineEnding")&&(e[s][1].type="codeTextData",l!==s+2&&(e[s][1].end=e[l-1][1].end,e.splice(s+2,l-s-2),n-=l-s-2,l=s+2),s=void 0);return e}function KT(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function ZT(e,n,r){let l=0,s,o;return u;function u(g){return e.enter("codeText"),e.enter("codeTextSequence"),f(g)}function f(g){return g===96?(e.consume(g),l++,f):(e.exit("codeTextSequence"),d(g))}function d(g){return g===null?r(g):g===32?(e.enter("space"),e.consume(g),e.exit("space"),d):g===96?(o=e.enter("codeTextSequence"),s=0,x(g)):$e(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),d):(e.enter("codeTextData"),p(g))}function p(g){return g===null||g===32||g===96||$e(g)?(e.exit("codeTextData"),d(g)):(e.consume(g),p)}function x(g){return g===96?(e.consume(g),s++,x):s===l?(e.exit("codeTextSequence"),e.exit("codeText"),n(g)):(o.type="codeTextData",p(g))}}class QT{constructor(n){this.left=n?[...n]:[],this.right=[]}get(n){if(n<0||n>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+n+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return n<this.left.length?this.left[n]:this.right[this.right.length-n+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(n,r){const l=r??Number.POSITIVE_INFINITY;return l<this.left.length?this.left.slice(n,l):n>this.left.length?this.right.slice(this.right.length-l+this.left.length,this.right.length-n+this.left.length).reverse():this.left.slice(n).concat(this.right.slice(this.right.length-l+this.left.length).reverse())}splice(n,r,l){const s=r||0;this.setCursor(Math.trunc(n));const o=this.right.splice(this.right.length-s,Number.POSITIVE_INFINITY);return l&&Ms(this.left,l),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(n){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(n)}pushMany(n){this.setCursor(Number.POSITIVE_INFINITY),Ms(this.left,n)}unshift(n){this.setCursor(0),this.right.push(n)}unshiftMany(n){this.setCursor(0),Ms(this.right,n.reverse())}setCursor(n){if(!(n===this.left.length||n>this.left.length&&this.right.length===0||n<0&&this.left.length===0))if(n<this.left.length){const r=this.left.splice(n,Number.POSITIVE_INFINITY);Ms(this.right,r.reverse())}else{const r=this.right.splice(this.left.length+this.right.length-n,Number.POSITIVE_INFINITY);Ms(this.left,r.reverse())}}}function Ms(e,n){let r=0;if(n.length<1e4)e.push(...n);else for(;r<n.length;)e.push(...n.slice(r,r+1e4)),r+=1e4}function mv(e){const n={};let r=-1,l,s,o,u,f,d,p;const x=new QT(e);for(;++r<x.length;){for(;r in n;)r=n[r];if(l=x.get(r),r&&l[1].type==="chunkFlow"&&x.get(r-1)[1].type==="listItemPrefix"&&(d=l[1]._tokenizer.events,o=0,o<d.length&&d[o][1].type==="lineEndingBlank"&&(o+=2),o<d.length&&d[o][1].type==="content"))for(;++o<d.length&&d[o][1].type!=="content";)d[o][1].type==="chunkText"&&(d[o][1]._isInFirstContentOfListItem=!0,o++);if(l[0]==="enter")l[1].contentType&&(Object.assign(n,WT(x,r)),r=n[r],p=!0);else if(l[1]._container){for(o=r,s=void 0;o--;)if(u=x.get(o),u[1].type==="lineEnding"||u[1].type==="lineEndingBlank")u[0]==="enter"&&(s&&(x.get(s)[1].type="lineEndingBlank"),u[1].type="lineEnding",s=o);else if(!(u[1].type==="linePrefix"||u[1].type==="listItemIndent"))break;s&&(l[1].end={...x.get(s)[1].start},f=x.slice(s,r),f.unshift(l),x.splice(s,r-s+1,f))}}return hr(e,0,Number.POSITIVE_INFINITY,x.slice(0)),!p}function WT(e,n){const r=e.get(n)[1],l=e.get(n)[2];let s=n-1;const o=[];let u=r._tokenizer;u||(u=l.parser[r.contentType](r.start),r._contentTypeTextTrailing&&(u._contentTypeTextTrailing=!0));const f=u.events,d=[],p={};let x,g,y=-1,v=r,S=0,E=0;const T=[E];for(;v;){for(;e.get(++s)[1]!==v;);o.push(s),v._tokenizer||(x=l.sliceStream(v),v.next||x.push(null),g&&u.defineSkip(v.start),v._isInFirstContentOfListItem&&(u._gfmTasklistFirstContentOfListItem=!0),u.write(x),v._isInFirstContentOfListItem&&(u._gfmTasklistFirstContentOfListItem=void 0)),g=v,v=v.next}for(v=r;++y<f.length;)f[y][0]==="exit"&&f[y-1][0]==="enter"&&f[y][1].type===f[y-1][1].type&&f[y][1].start.line!==f[y][1].end.line&&(E=y+1,T.push(E),v._tokenizer=void 0,v.previous=void 0,v=v.next);for(u.events=[],v?(v._tokenizer=void 0,v.previous=void 0):T.pop(),y=T.length;y--;){const N=f.slice(T[y],T[y+1]),j=o.pop();d.push([j,j+N.length-1]),e.splice(j,2,N)}for(d.reverse(),y=-1;++y<d.length;)p[S+d[y][0]]=S+d[y][1],S+=d[y][1]-d[y][0]-1;return p}const JT={resolve:tA,tokenize:nA},eA={partial:!0,tokenize:rA};function tA(e){return mv(e),e}function nA(e,n){let r;return l;function l(f){return e.enter("content"),r=e.enter("chunkContent",{contentType:"content"}),s(f)}function s(f){return f===null?o(f):$e(f)?e.check(eA,u,o)(f):(e.consume(f),s)}function o(f){return e.exit("chunkContent"),e.exit("content"),n(f)}function u(f){return e.consume(f),e.exit("chunkContent"),r.next=e.enter("chunkContent",{contentType:"content",previous:r}),r=r.next,s}}function rA(e,n,r){const l=this;return s;function s(u){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),dt(e,o,"linePrefix")}function o(u){if(u===null||$e(u))return r(u);const f=l.events[l.events.length-1];return!l.parser.constructs.disable.null.includes("codeIndented")&&f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?n(u):e.interrupt(l.parser.constructs.flow,r,n)(u)}}function gv(e,n,r,l,s,o,u,f,d){const p=d||Number.POSITIVE_INFINITY;let x=0;return g;function g(N){return N===60?(e.enter(l),e.enter(s),e.enter(o),e.consume(N),e.exit(o),y):N===null||N===32||N===41||nc(N)?r(N):(e.enter(l),e.enter(u),e.enter(f),e.enter("chunkString",{contentType:"string"}),E(N))}function y(N){return N===62?(e.enter(o),e.consume(N),e.exit(o),e.exit(s),e.exit(l),n):(e.enter(f),e.enter("chunkString",{contentType:"string"}),v(N))}function v(N){return N===62?(e.exit("chunkString"),e.exit(f),y(N)):N===null||N===60||$e(N)?r(N):(e.consume(N),N===92?S:v)}function S(N){return N===60||N===62||N===92?(e.consume(N),v):v(N)}function E(N){return!x&&(N===null||N===41||zt(N))?(e.exit("chunkString"),e.exit(f),e.exit(u),e.exit(l),n(N)):x<p&&N===40?(e.consume(N),x++,E):N===41?(e.consume(N),x--,E):N===null||N===32||N===40||nc(N)?r(N):(e.consume(N),N===92?T:E)}function T(N){return N===40||N===41||N===92?(e.consume(N),E):E(N)}}function xv(e,n,r,l,s,o){const u=this;let f=0,d;return p;function p(v){return e.enter(l),e.enter(s),e.consume(v),e.exit(s),e.enter(o),x}function x(v){return f>999||v===null||v===91||v===93&&!d||v===94&&!f&&"_hiddenFootnoteSupport"in u.parser.constructs?r(v):v===93?(e.exit(o),e.enter(s),e.consume(v),e.exit(s),e.exit(l),n):$e(v)?(e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),x):(e.enter("chunkString",{contentType:"string"}),g(v))}function g(v){return v===null||v===91||v===93||$e(v)||f++>999?(e.exit("chunkString"),x(v)):(e.consume(v),d||(d=!it(v)),v===92?y:g)}function y(v){return v===91||v===92||v===93?(e.consume(v),f++,g):g(v)}}function bv(e,n,r,l,s,o){let u;return f;function f(y){return y===34||y===39||y===40?(e.enter(l),e.enter(s),e.consume(y),e.exit(s),u=y===40?41:y,d):r(y)}function d(y){return y===u?(e.enter(s),e.consume(y),e.exit(s),e.exit(l),n):(e.enter(o),p(y))}function p(y){return y===u?(e.exit(o),d(u)):y===null?r(y):$e(y)?(e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),dt(e,p,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),x(y))}function x(y){return y===u||y===null||$e(y)?(e.exit("chunkString"),p(y)):(e.consume(y),y===92?g:x)}function g(y){return y===u||y===92?(e.consume(y),x):x(y)}}function Vs(e,n){let r;return l;function l(s){return $e(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),r=!0,l):it(s)?dt(e,l,r?"linePrefix":"lineSuffix")(s):n(s)}}const aA={name:"definition",tokenize:iA},lA={partial:!0,tokenize:sA};function iA(e,n,r){const l=this;let s;return o;function o(v){return e.enter("definition"),u(v)}function u(v){return xv.call(l,e,f,r,"definitionLabel","definitionLabelMarker","definitionLabelString")(v)}function f(v){return s=Lr(l.sliceSerialize(l.events[l.events.length-1][1]).slice(1,-1)),v===58?(e.enter("definitionMarker"),e.consume(v),e.exit("definitionMarker"),d):r(v)}function d(v){return zt(v)?Vs(e,p)(v):p(v)}function p(v){return gv(e,x,r,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(v)}function x(v){return e.attempt(lA,g,g)(v)}function g(v){return it(v)?dt(e,y,"whitespace")(v):y(v)}function y(v){return v===null||$e(v)?(e.exit("definition"),l.parser.defined.push(s),n(v)):r(v)}}function sA(e,n,r){return l;function l(f){return zt(f)?Vs(e,s)(f):r(f)}function s(f){return bv(e,o,r,"definitionTitle","definitionTitleMarker","definitionTitleString")(f)}function o(f){return it(f)?dt(e,u,"whitespace")(f):u(f)}function u(f){return f===null||$e(f)?n(f):r(f)}}const oA={name:"hardBreakEscape",tokenize:uA};function uA(e,n,r){return l;function l(o){return e.enter("hardBreakEscape"),e.consume(o),s}function s(o){return $e(o)?(e.exit("hardBreakEscape"),n(o)):r(o)}}const cA={name:"headingAtx",resolve:fA,tokenize:dA};function fA(e,n){let r=e.length-2,l=3,s,o;return e[l][1].type==="whitespace"&&(l+=2),r-2>l&&e[r][1].type==="whitespace"&&(r-=2),e[r][1].type==="atxHeadingSequence"&&(l===r-1||r-4>l&&e[r-2][1].type==="whitespace")&&(r-=l+1===r?2:4),r>l&&(s={type:"atxHeadingText",start:e[l][1].start,end:e[r][1].end},o={type:"chunkText",start:e[l][1].start,end:e[r][1].end,contentType:"text"},hr(e,l,r-l+1,[["enter",s,n],["enter",o,n],["exit",o,n],["exit",s,n]])),e}function dA(e,n,r){let l=0;return s;function s(x){return e.enter("atxHeading"),o(x)}function o(x){return e.enter("atxHeadingSequence"),u(x)}function u(x){return x===35&&l++<6?(e.consume(x),u):x===null||zt(x)?(e.exit("atxHeadingSequence"),f(x)):r(x)}function f(x){return x===35?(e.enter("atxHeadingSequence"),d(x)):x===null||$e(x)?(e.exit("atxHeading"),n(x)):it(x)?dt(e,f,"whitespace")(x):(e.enter("atxHeadingText"),p(x))}function d(x){return x===35?(e.consume(x),d):(e.exit("atxHeadingSequence"),f(x))}function p(x){return x===null||x===35||zt(x)?(e.exit("atxHeadingText"),f(x)):(e.consume(x),p)}}const hA=["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"],zy=["pre","script","style","textarea"],pA={concrete:!0,name:"htmlFlow",resolveTo:xA,tokenize:bA},mA={partial:!0,tokenize:vA},gA={partial:!0,tokenize:yA};function xA(e){let n=e.length;for(;n--&&!(e[n][0]==="enter"&&e[n][1].type==="htmlFlow"););return n>1&&e[n-2][1].type==="linePrefix"&&(e[n][1].start=e[n-2][1].start,e[n+1][1].start=e[n-2][1].start,e.splice(n-2,2)),e}function bA(e,n,r){const l=this;let s,o,u,f,d;return p;function p(A){return x(A)}function x(A){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(A),g}function g(A){return A===33?(e.consume(A),y):A===47?(e.consume(A),o=!0,E):A===63?(e.consume(A),s=3,l.interrupt?n:O):In(A)?(e.consume(A),u=String.fromCharCode(A),T):r(A)}function y(A){return A===45?(e.consume(A),s=2,v):A===91?(e.consume(A),s=5,f=0,S):In(A)?(e.consume(A),s=4,l.interrupt?n:O):r(A)}function v(A){return A===45?(e.consume(A),l.interrupt?n:O):r(A)}function S(A){const se="CDATA[";return A===se.charCodeAt(f++)?(e.consume(A),f===se.length?l.interrupt?n:Z:S):r(A)}function E(A){return In(A)?(e.consume(A),u=String.fromCharCode(A),T):r(A)}function T(A){if(A===null||A===47||A===62||zt(A)){const se=A===47,te=u.toLowerCase();return!se&&!o&&zy.includes(te)?(s=1,l.interrupt?n(A):Z(A)):hA.includes(u.toLowerCase())?(s=6,se?(e.consume(A),N):l.interrupt?n(A):Z(A)):(s=7,l.interrupt&&!l.parser.lazy[l.now().line]?r(A):o?j(A):C(A))}return A===45||jn(A)?(e.consume(A),u+=String.fromCharCode(A),T):r(A)}function N(A){return A===62?(e.consume(A),l.interrupt?n:Z):r(A)}function j(A){return it(A)?(e.consume(A),j):B(A)}function C(A){return A===47?(e.consume(A),B):A===58||A===95||In(A)?(e.consume(A),I):it(A)?(e.consume(A),C):B(A)}function I(A){return A===45||A===46||A===58||A===95||jn(A)?(e.consume(A),I):U(A)}function U(A){return A===61?(e.consume(A),_):it(A)?(e.consume(A),U):C(A)}function _(A){return A===null||A===60||A===61||A===62||A===96?r(A):A===34||A===39?(e.consume(A),d=A,z):it(A)?(e.consume(A),_):P(A)}function z(A){return A===d?(e.consume(A),d=null,X):A===null||$e(A)?r(A):(e.consume(A),z)}function P(A){return A===null||A===34||A===39||A===47||A===60||A===61||A===62||A===96||zt(A)?U(A):(e.consume(A),P)}function X(A){return A===47||A===62||it(A)?C(A):r(A)}function B(A){return A===62?(e.consume(A),q):r(A)}function q(A){return A===null||$e(A)?Z(A):it(A)?(e.consume(A),q):r(A)}function Z(A){return A===45&&s===2?(e.consume(A),M):A===60&&s===1?(e.consume(A),K):A===62&&s===4?(e.consume(A),D):A===63&&s===3?(e.consume(A),O):A===93&&s===5?(e.consume(A),be):$e(A)&&(s===6||s===7)?(e.exit("htmlFlowData"),e.check(mA,L,ee)(A)):A===null||$e(A)?(e.exit("htmlFlowData"),ee(A)):(e.consume(A),Z)}function ee(A){return e.check(gA,ae,L)(A)}function ae(A){return e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),Y}function Y(A){return A===null||$e(A)?ee(A):(e.enter("htmlFlowData"),Z(A))}function M(A){return A===45?(e.consume(A),O):Z(A)}function K(A){return A===47?(e.consume(A),u="",le):Z(A)}function le(A){if(A===62){const se=u.toLowerCase();return zy.includes(se)?(e.consume(A),D):Z(A)}return In(A)&&u.length<8?(e.consume(A),u+=String.fromCharCode(A),le):Z(A)}function be(A){return A===93?(e.consume(A),O):Z(A)}function O(A){return A===62?(e.consume(A),D):A===45&&s===2?(e.consume(A),O):Z(A)}function D(A){return A===null||$e(A)?(e.exit("htmlFlowData"),L(A)):(e.consume(A),D)}function L(A){return e.exit("htmlFlow"),n(A)}}function yA(e,n,r){const l=this;return s;function s(u){return $e(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),o):r(u)}function o(u){return l.parser.lazy[l.now().line]?r(u):n(u)}}function vA(e,n,r){return l;function l(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),e.attempt(co,n,r)}}const wA={name:"htmlText",tokenize:kA};function kA(e,n,r){const l=this;let s,o,u;return f;function f(O){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(O),d}function d(O){return O===33?(e.consume(O),p):O===47?(e.consume(O),U):O===63?(e.consume(O),C):In(O)?(e.consume(O),P):r(O)}function p(O){return O===45?(e.consume(O),x):O===91?(e.consume(O),o=0,S):In(O)?(e.consume(O),j):r(O)}function x(O){return O===45?(e.consume(O),v):r(O)}function g(O){return O===null?r(O):O===45?(e.consume(O),y):$e(O)?(u=g,K(O)):(e.consume(O),g)}function y(O){return O===45?(e.consume(O),v):g(O)}function v(O){return O===62?M(O):O===45?y(O):g(O)}function S(O){const D="CDATA[";return O===D.charCodeAt(o++)?(e.consume(O),o===D.length?E:S):r(O)}function E(O){return O===null?r(O):O===93?(e.consume(O),T):$e(O)?(u=E,K(O)):(e.consume(O),E)}function T(O){return O===93?(e.consume(O),N):E(O)}function N(O){return O===62?M(O):O===93?(e.consume(O),N):E(O)}function j(O){return O===null||O===62?M(O):$e(O)?(u=j,K(O)):(e.consume(O),j)}function C(O){return O===null?r(O):O===63?(e.consume(O),I):$e(O)?(u=C,K(O)):(e.consume(O),C)}function I(O){return O===62?M(O):C(O)}function U(O){return In(O)?(e.consume(O),_):r(O)}function _(O){return O===45||jn(O)?(e.consume(O),_):z(O)}function z(O){return $e(O)?(u=z,K(O)):it(O)?(e.consume(O),z):M(O)}function P(O){return O===45||jn(O)?(e.consume(O),P):O===47||O===62||zt(O)?X(O):r(O)}function X(O){return O===47?(e.consume(O),M):O===58||O===95||In(O)?(e.consume(O),B):$e(O)?(u=X,K(O)):it(O)?(e.consume(O),X):M(O)}function B(O){return O===45||O===46||O===58||O===95||jn(O)?(e.consume(O),B):q(O)}function q(O){return O===61?(e.consume(O),Z):$e(O)?(u=q,K(O)):it(O)?(e.consume(O),q):X(O)}function Z(O){return O===null||O===60||O===61||O===62||O===96?r(O):O===34||O===39?(e.consume(O),s=O,ee):$e(O)?(u=Z,K(O)):it(O)?(e.consume(O),Z):(e.consume(O),ae)}function ee(O){return O===s?(e.consume(O),s=void 0,Y):O===null?r(O):$e(O)?(u=ee,K(O)):(e.consume(O),ee)}function ae(O){return O===null||O===34||O===39||O===60||O===61||O===96?r(O):O===47||O===62||zt(O)?X(O):(e.consume(O),ae)}function Y(O){return O===47||O===62||zt(O)?X(O):r(O)}function M(O){return O===62?(e.consume(O),e.exit("htmlTextData"),e.exit("htmlText"),n):r(O)}function K(O){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),le}function le(O){return it(O)?dt(e,be,"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(O):be(O)}function be(O){return e.enter("htmlTextData"),u(O)}}const Rp={name:"labelEnd",resolveAll:_A,resolveTo:TA,tokenize:AA},SA={tokenize:CA},EA={tokenize:RA},NA={tokenize:jA};function _A(e){let n=-1;const r=[];for(;++n<e.length;){const l=e[n][1];if(r.push(e[n]),l.type==="labelImage"||l.type==="labelLink"||l.type==="labelEnd"){const s=l.type==="labelImage"?4:2;l.type="data",n+=s}}return e.length!==r.length&&hr(e,0,e.length,r),e}function TA(e,n){let r=e.length,l=0,s,o,u,f;for(;r--;)if(s=e[r][1],o){if(s.type==="link"||s.type==="labelLink"&&s._inactive)break;e[r][0]==="enter"&&s.type==="labelLink"&&(s._inactive=!0)}else if(u){if(e[r][0]==="enter"&&(s.type==="labelImage"||s.type==="labelLink")&&!s._balanced&&(o=r,s.type!=="labelLink")){l=2;break}}else s.type==="labelEnd"&&(u=r);const d={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},p={type:"label",start:{...e[o][1].start},end:{...e[u][1].end}},x={type:"labelText",start:{...e[o+l+2][1].end},end:{...e[u-2][1].start}};return f=[["enter",d,n],["enter",p,n]],f=_r(f,e.slice(o+1,o+l+3)),f=_r(f,[["enter",x,n]]),f=_r(f,bc(n.parser.constructs.insideSpan.null,e.slice(o+l+4,u-3),n)),f=_r(f,[["exit",x,n],e[u-2],e[u-1],["exit",p,n]]),f=_r(f,e.slice(u+1)),f=_r(f,[["exit",d,n]]),hr(e,o,e.length,f),e}function AA(e,n,r){const l=this;let s=l.events.length,o,u;for(;s--;)if((l.events[s][1].type==="labelImage"||l.events[s][1].type==="labelLink")&&!l.events[s][1]._balanced){o=l.events[s][1];break}return f;function f(y){return o?o._inactive?g(y):(u=l.parser.defined.includes(Lr(l.sliceSerialize({start:o.end,end:l.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(y),e.exit("labelMarker"),e.exit("labelEnd"),d):r(y)}function d(y){return y===40?e.attempt(SA,x,u?x:g)(y):y===91?e.attempt(EA,x,u?p:g)(y):u?x(y):g(y)}function p(y){return e.attempt(NA,x,g)(y)}function x(y){return n(y)}function g(y){return o._balanced=!0,r(y)}}function CA(e,n,r){return l;function l(g){return e.enter("resource"),e.enter("resourceMarker"),e.consume(g),e.exit("resourceMarker"),s}function s(g){return zt(g)?Vs(e,o)(g):o(g)}function o(g){return g===41?x(g):gv(e,u,f,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(g)}function u(g){return zt(g)?Vs(e,d)(g):x(g)}function f(g){return r(g)}function d(g){return g===34||g===39||g===40?bv(e,p,r,"resourceTitle","resourceTitleMarker","resourceTitleString")(g):x(g)}function p(g){return zt(g)?Vs(e,x)(g):x(g)}function x(g){return g===41?(e.enter("resourceMarker"),e.consume(g),e.exit("resourceMarker"),e.exit("resource"),n):r(g)}}function RA(e,n,r){const l=this;return s;function s(f){return xv.call(l,e,o,u,"reference","referenceMarker","referenceString")(f)}function o(f){return l.parser.defined.includes(Lr(l.sliceSerialize(l.events[l.events.length-1][1]).slice(1,-1)))?n(f):r(f)}function u(f){return r(f)}}function jA(e,n,r){return l;function l(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),s}function s(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),n):r(o)}}const MA={name:"labelStartImage",resolveAll:Rp.resolveAll,tokenize:OA};function OA(e,n,r){const l=this;return s;function s(f){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(f),e.exit("labelImageMarker"),o}function o(f){return f===91?(e.enter("labelMarker"),e.consume(f),e.exit("labelMarker"),e.exit("labelImage"),u):r(f)}function u(f){return f===94&&"_hiddenFootnoteSupport"in l.parser.constructs?r(f):n(f)}}const DA={name:"labelStartLink",resolveAll:Rp.resolveAll,tokenize:zA};function zA(e,n,r){const l=this;return s;function s(u){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(u),e.exit("labelMarker"),e.exit("labelLink"),o}function o(u){return u===94&&"_hiddenFootnoteSupport"in l.parser.constructs?r(u):n(u)}}const eh={name:"lineEnding",tokenize:LA};function LA(e,n){return r;function r(l){return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),dt(e,n,"linePrefix")}}const Vu={name:"thematicBreak",tokenize:BA};function BA(e,n,r){let l=0,s;return o;function o(p){return e.enter("thematicBreak"),u(p)}function u(p){return s=p,f(p)}function f(p){return p===s?(e.enter("thematicBreakSequence"),d(p)):l>=3&&(p===null||$e(p))?(e.exit("thematicBreak"),n(p)):r(p)}function d(p){return p===s?(e.consume(p),l++,d):(e.exit("thematicBreakSequence"),it(p)?dt(e,f,"whitespace")(p):f(p))}}const Qn={continuation:{tokenize:HA},exit:FA,name:"list",tokenize:$A},IA={partial:!0,tokenize:GA},UA={partial:!0,tokenize:PA};function $A(e,n,r){const l=this,s=l.events[l.events.length-1];let o=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0,u=0;return f;function f(v){const S=l.containerState.type||(v===42||v===43||v===45?"listUnordered":"listOrdered");if(S==="listUnordered"?!l.containerState.marker||v===l.containerState.marker:qh(v)){if(l.containerState.type||(l.containerState.type=S,e.enter(S,{_container:!0})),S==="listUnordered")return e.enter("listItemPrefix"),v===42||v===45?e.check(Vu,r,p)(v):p(v);if(!l.interrupt||v===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),d(v)}return r(v)}function d(v){return qh(v)&&++u<10?(e.consume(v),d):(!l.interrupt||u<2)&&(l.containerState.marker?v===l.containerState.marker:v===41||v===46)?(e.exit("listItemValue"),p(v)):r(v)}function p(v){return e.enter("listItemMarker"),e.consume(v),e.exit("listItemMarker"),l.containerState.marker=l.containerState.marker||v,e.check(co,l.interrupt?r:x,e.attempt(IA,y,g))}function x(v){return l.containerState.initialBlankLine=!0,o++,y(v)}function g(v){return it(v)?(e.enter("listItemPrefixWhitespace"),e.consume(v),e.exit("listItemPrefixWhitespace"),y):r(v)}function y(v){return l.containerState.size=o+l.sliceSerialize(e.exit("listItemPrefix"),!0).length,n(v)}}function HA(e,n,r){const l=this;return l.containerState._closeFlow=void 0,e.check(co,s,o);function s(f){return l.containerState.furtherBlankLines=l.containerState.furtherBlankLines||l.containerState.initialBlankLine,dt(e,n,"listItemIndent",l.containerState.size+1)(f)}function o(f){return l.containerState.furtherBlankLines||!it(f)?(l.containerState.furtherBlankLines=void 0,l.containerState.initialBlankLine=void 0,u(f)):(l.containerState.furtherBlankLines=void 0,l.containerState.initialBlankLine=void 0,e.attempt(UA,n,u)(f))}function u(f){return l.containerState._closeFlow=!0,l.interrupt=void 0,dt(e,e.attempt(Qn,n,r),"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(f)}}function PA(e,n,r){const l=this;return dt(e,s,"listItemIndent",l.containerState.size+1);function s(o){const u=l.events[l.events.length-1];return u&&u[1].type==="listItemIndent"&&u[2].sliceSerialize(u[1],!0).length===l.containerState.size?n(o):r(o)}}function FA(e){e.exit(this.containerState.type)}function GA(e,n,r){const l=this;return dt(e,s,"listItemPrefixWhitespace",l.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function s(o){const u=l.events[l.events.length-1];return!it(o)&&u&&u[1].type==="listItemPrefixWhitespace"?n(o):r(o)}}const Ly={name:"setextUnderline",resolveTo:qA,tokenize:YA};function qA(e,n){let r=e.length,l,s,o;for(;r--;)if(e[r][0]==="enter"){if(e[r][1].type==="content"){l=r;break}e[r][1].type==="paragraph"&&(s=r)}else e[r][1].type==="content"&&e.splice(r,1),!o&&e[r][1].type==="definition"&&(o=r);const u={type:"setextHeading",start:{...e[l][1].start},end:{...e[e.length-1][1].end}};return e[s][1].type="setextHeadingText",o?(e.splice(s,0,["enter",u,n]),e.splice(o+1,0,["exit",e[l][1],n]),e[l][1].end={...e[o][1].end}):e[l][1]=u,e.push(["exit",u,n]),e}function YA(e,n,r){const l=this;let s;return o;function o(p){let x=l.events.length,g;for(;x--;)if(l.events[x][1].type!=="lineEnding"&&l.events[x][1].type!=="linePrefix"&&l.events[x][1].type!=="content"){g=l.events[x][1].type==="paragraph";break}return!l.parser.lazy[l.now().line]&&(l.interrupt||g)?(e.enter("setextHeadingLine"),s=p,u(p)):r(p)}function u(p){return e.enter("setextHeadingLineSequence"),f(p)}function f(p){return p===s?(e.consume(p),f):(e.exit("setextHeadingLineSequence"),it(p)?dt(e,d,"lineSuffix")(p):d(p))}function d(p){return p===null||$e(p)?(e.exit("setextHeadingLine"),n(p)):r(p)}}const VA={tokenize:XA};function XA(e){const n=this,r=e.attempt(co,l,e.attempt(this.parser.constructs.flowInitial,s,dt(e,e.attempt(this.parser.constructs.flow,s,e.attempt(JT,s)),"linePrefix")));return r;function l(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),n.currentConstruct=void 0,r}function s(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),n.currentConstruct=void 0,r}}const KA={resolveAll:vv()},ZA=yv("string"),QA=yv("text");function yv(e){return{resolveAll:vv(e==="text"?WA:void 0),tokenize:n};function n(r){const l=this,s=this.parser.constructs[e],o=r.attempt(s,u,f);return u;function u(x){return p(x)?o(x):f(x)}function f(x){if(x===null){r.consume(x);return}return r.enter("data"),r.consume(x),d}function d(x){return p(x)?(r.exit("data"),o(x)):(r.consume(x),d)}function p(x){if(x===null)return!0;const g=s[x];let y=-1;if(g)for(;++y<g.length;){const v=g[y];if(!v.previous||v.previous.call(l,l.previous))return!0}return!1}}}function vv(e){return n;function n(r,l){let s=-1,o;for(;++s<=r.length;)o===void 0?r[s]&&r[s][1].type==="data"&&(o=s,s++):(!r[s]||r[s][1].type!=="data")&&(s!==o+2&&(r[o][1].end=r[s-1][1].end,r.splice(o+2,s-o-2),s=o+2),o=void 0);return e?e(r,l):r}}function WA(e,n){let r=0;for(;++r<=e.length;)if((r===e.length||e[r][1].type==="lineEnding")&&e[r-1][1].type==="data"){const l=e[r-1][1],s=n.sliceStream(l);let o=s.length,u=-1,f=0,d;for(;o--;){const p=s[o];if(typeof p=="string"){for(u=p.length;p.charCodeAt(u-1)===32;)f++,u--;if(u)break;u=-1}else if(p===-2)d=!0,f++;else if(p!==-1){o++;break}}if(n._contentTypeTextTrailing&&r===e.length&&(f=0),f){const p={type:r===e.length||d||f<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?u:l.start._bufferIndex+u,_index:l.start._index+o,line:l.end.line,column:l.end.column-f,offset:l.end.offset-f},end:{...l.end}};l.end={...p.start},l.start.offset===l.end.offset?Object.assign(l,p):(e.splice(r,0,["enter",p,n],["exit",p,n]),r+=2)}r++}return e}const JA={42:Qn,43:Qn,45:Qn,48:Qn,49:Qn,50:Qn,51:Qn,52:Qn,53:Qn,54:Qn,55:Qn,56:Qn,57:Qn,62:dv},eC={91:aA},tC={[-2]:Jd,[-1]:Jd,32:Jd},nC={35:cA,42:Vu,45:[Ly,Vu],60:pA,61:Ly,95:Vu,96:Dy,126:Dy},rC={38:pv,92:hv},aC={[-5]:eh,[-4]:eh,[-3]:eh,33:MA,38:pv,42:Yh,60:[DT,wA],91:DA,92:[oA,hv],93:Rp,95:Yh,96:VT},lC={null:[Yh,KA]},iC={null:[42,95]},sC={null:[]},oC=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:iC,contentInitial:eC,disable:sC,document:JA,flow:nC,flowInitial:tC,insideSpan:lC,string:rC,text:aC},Symbol.toStringTag,{value:"Module"}));function uC(e,n,r){let l={_bufferIndex:-1,_index:0,line:r&&r.line||1,column:r&&r.column||1,offset:r&&r.offset||0};const s={},o=[];let u=[],f=[];const d={attempt:z(U),check:z(_),consume:j,enter:C,exit:I,interrupt:z(_,{interrupt:!0})},p={code:null,containerState:{},defineSkip:E,events:[],now:S,parser:e,previous:null,sliceSerialize:y,sliceStream:v,write:g};let x=n.tokenize.call(p,d);return n.resolveAll&&o.push(n),p;function g(q){return u=_r(u,q),T(),u[u.length-1]!==null?[]:(P(n,0),p.events=bc(o,p.events,p),p.events)}function y(q,Z){return fC(v(q),Z)}function v(q){return cC(u,q)}function S(){const{_bufferIndex:q,_index:Z,line:ee,column:ae,offset:Y}=l;return{_bufferIndex:q,_index:Z,line:ee,column:ae,offset:Y}}function E(q){s[q.line]=q.column,B()}function T(){let q;for(;l._index<u.length;){const Z=u[l._index];if(typeof Z=="string")for(q=l._index,l._bufferIndex<0&&(l._bufferIndex=0);l._index===q&&l._bufferIndex<Z.length;)N(Z.charCodeAt(l._bufferIndex));else N(Z)}}function N(q){x=x(q)}function j(q){$e(q)?(l.line++,l.column=1,l.offset+=q===-3?2:1,B()):q!==-1&&(l.column++,l.offset++),l._bufferIndex<0?l._index++:(l._bufferIndex++,l._bufferIndex===u[l._index].length&&(l._bufferIndex=-1,l._index++)),p.previous=q}function C(q,Z){const ee=Z||{};return ee.type=q,ee.start=S(),p.events.push(["enter",ee,p]),f.push(ee),ee}function I(q){const Z=f.pop();return Z.end=S(),p.events.push(["exit",Z,p]),Z}function U(q,Z){P(q,Z.from)}function _(q,Z){Z.restore()}function z(q,Z){return ee;function ee(ae,Y,M){let K,le,be,O;return Array.isArray(ae)?L(ae):"tokenize"in ae?L([ae]):D(ae);function D(ie){return Se;function Se(je){const Ae=je!==null&&ie[je],qe=je!==null&&ie.null,we=[...Array.isArray(Ae)?Ae:Ae?[Ae]:[],...Array.isArray(qe)?qe:qe?[qe]:[]];return L(we)(je)}}function L(ie){return K=ie,le=0,ie.length===0?M:A(ie[le])}function A(ie){return Se;function Se(je){return O=X(),be=ie,ie.partial||(p.currentConstruct=ie),ie.name&&p.parser.constructs.disable.null.includes(ie.name)?te():ie.tokenize.call(Z?Object.assign(Object.create(p),Z):p,d,se,te)(je)}}function se(ie){return q(be,O),Y}function te(ie){return O.restore(),++le<K.length?A(K[le]):M}}}function P(q,Z){q.resolveAll&&!o.includes(q)&&o.push(q),q.resolve&&hr(p.events,Z,p.events.length-Z,q.resolve(p.events.slice(Z),p)),q.resolveTo&&(p.events=q.resolveTo(p.events,p))}function X(){const q=S(),Z=p.previous,ee=p.currentConstruct,ae=p.events.length,Y=Array.from(f);return{from:ae,restore:M};function M(){l=q,p.previous=Z,p.currentConstruct=ee,p.events.length=ae,f=Y,B()}}function B(){l.line in s&&l.column<2&&(l.column=s[l.line],l.offset+=s[l.line]-1)}}function cC(e,n){const r=n.start._index,l=n.start._bufferIndex,s=n.end._index,o=n.end._bufferIndex;let u;if(r===s)u=[e[r].slice(l,o)];else{if(u=e.slice(r,s),l>-1){const f=u[0];typeof f=="string"?u[0]=f.slice(l):u.shift()}o>0&&u.push(e[s].slice(0,o))}return u}function fC(e,n){let r=-1;const l=[];let s;for(;++r<e.length;){const o=e[r];let u;if(typeof o=="string")u=o;else switch(o){case-5:{u="\r";break}case-4:{u=`
|
|
16
|
+
`;break}case-3:{u=`\r
|
|
17
|
+
`;break}case-2:{u=n?" ":" ";break}case-1:{if(!n&&s)continue;u=" ";break}default:u=String.fromCharCode(o)}s=o===-2,l.push(u)}return l.join("")}function dC(e){const l={constructs:cv([oC,...(e||{}).extensions||[]]),content:s(TT),defined:[],document:s(CT),flow:s(VA),lazy:{},string:s(ZA),text:s(QA)};return l;function s(o){return u;function u(f){return uC(l,o,f)}}}function hC(e){for(;!mv(e););return e}const By=/[\0\t\n\r]/g;function pC(){let e=1,n="",r=!0,l;return s;function s(o,u,f){const d=[];let p,x,g,y,v;for(o=n+(typeof o=="string"?o.toString():new TextDecoder(u||void 0).decode(o)),g=0,n="",r&&(o.charCodeAt(0)===65279&&g++,r=void 0);g<o.length;){if(By.lastIndex=g,p=By.exec(o),y=p&&p.index!==void 0?p.index:o.length,v=o.charCodeAt(y),!p){n=o.slice(g);break}if(v===10&&g===y&&l)d.push(-3),l=void 0;else switch(l&&(d.push(-5),l=void 0),g<y&&(d.push(o.slice(g,y)),e+=y-g),v){case 0:{d.push(65533),e++;break}case 9:{for(x=Math.ceil(e/4)*4,d.push(-2);e++<x;)d.push(-1);break}case 10:{d.push(-4),e=1;break}default:l=!0,e=1}g=y+1}return f&&(l&&d.push(-5),n&&d.push(n),d.push(null)),d}}const mC=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function gC(e){return e.replace(mC,xC)}function xC(e,n,r){if(n)return n;if(r.charCodeAt(0)===35){const s=r.charCodeAt(1),o=s===120||s===88;return fv(r.slice(o?2:1),o?16:10)}return Cp(r)||e}const wv={}.hasOwnProperty;function bC(e,n,r){return n&&typeof n=="object"&&(r=n,n=void 0),yC(r)(hC(dC(r).document().write(pC()(e,n,!0))))}function yC(e){const n={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(xn),autolinkProtocol:X,autolinkEmail:X,atxHeading:o(xe),blockQuote:o(qe),characterEscape:X,characterReference:X,codeFenced:o(we),codeFencedFenceInfo:u,codeFencedFenceMeta:u,codeIndented:o(we,u),codeText:o(Ve,u),codeTextData:X,data:X,codeFlowValue:X,definition:o(Lt),definitionDestinationString:u,definitionLabelString:u,definitionTitleString:u,emphasis:o(he),hardBreakEscape:o(_e),hardBreakTrailing:o(_e),htmlFlow:o(et,u),htmlFlowData:X,htmlText:o(et,u),htmlTextData:X,image:o(St),label:u,link:o(xn),listItem:o(pr),listItemValue:y,listOrdered:o(Ot,g),listUnordered:o(Ot),paragraph:o(On),reference:A,referenceString:u,resourceDestinationString:u,resourceTitleString:u,setextHeading:o(xe),strong:o(Dn),thematicBreak:o(bn)},exit:{atxHeading:d(),atxHeadingSequence:U,autolink:d(),autolinkEmail:Ae,autolinkProtocol:je,blockQuote:d(),characterEscapeValue:B,characterReferenceMarkerHexadecimal:te,characterReferenceMarkerNumeric:te,characterReferenceValue:ie,characterReference:Se,codeFenced:d(T),codeFencedFence:E,codeFencedFenceInfo:v,codeFencedFenceMeta:S,codeFlowValue:B,codeIndented:d(N),codeText:d(Y),codeTextData:B,data:B,definition:d(),definitionDestinationString:I,definitionLabelString:j,definitionTitleString:C,emphasis:d(),hardBreakEscape:d(Z),hardBreakTrailing:d(Z),htmlFlow:d(ee),htmlFlowData:B,htmlText:d(ae),htmlTextData:B,image:d(K),label:be,labelText:le,lineEnding:q,link:d(M),listItem:d(),listOrdered:d(),listUnordered:d(),paragraph:d(),referenceString:se,resourceDestinationString:O,resourceTitleString:D,resource:L,setextHeading:d(P),setextHeadingLineSequence:z,setextHeadingText:_,strong:d(),thematicBreak:d()}};kv(n,(e||{}).mdastExtensions||[]);const r={};return l;function l(re){let me={type:"root",children:[]};const Me={stack:[me],tokenStack:[],config:n,enter:f,exit:p,buffer:u,resume:x,data:r},Ge=[];let nt=-1;for(;++nt<re.length;)if(re[nt][1].type==="listOrdered"||re[nt][1].type==="listUnordered")if(re[nt][0]==="enter")Ge.push(nt);else{const Jt=Ge.pop();nt=s(re,Jt,nt)}for(nt=-1;++nt<re.length;){const Jt=n[re[nt][0]];wv.call(Jt,re[nt][1].type)&&Jt[re[nt][1].type].call(Object.assign({sliceSerialize:re[nt][2].sliceSerialize},Me),re[nt][1])}if(Me.tokenStack.length>0){const Jt=Me.tokenStack[Me.tokenStack.length-1];(Jt[1]||Iy).call(Me,void 0,Jt[0])}for(me.position={start:Qa(re.length>0?re[0][1].start:{line:1,column:1,offset:0}),end:Qa(re.length>0?re[re.length-2][1].end:{line:1,column:1,offset:0})},nt=-1;++nt<n.transforms.length;)me=n.transforms[nt](me)||me;return me}function s(re,me,Me){let Ge=me-1,nt=-1,Jt=!1,_n,qt,mt,Ct;for(;++Ge<=Me;){const Fe=re[Ge];switch(Fe[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Fe[0]==="enter"?nt++:nt--,Ct=void 0;break}case"lineEndingBlank":{Fe[0]==="enter"&&(_n&&!Ct&&!nt&&!mt&&(mt=Ge),Ct=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Ct=void 0}if(!nt&&Fe[0]==="enter"&&Fe[1].type==="listItemPrefix"||nt===-1&&Fe[0]==="exit"&&(Fe[1].type==="listUnordered"||Fe[1].type==="listOrdered")){if(_n){let pn=Ge;for(qt=void 0;pn--;){const Xt=re[pn];if(Xt[1].type==="lineEnding"||Xt[1].type==="lineEndingBlank"){if(Xt[0]==="exit")continue;qt&&(re[qt][1].type="lineEndingBlank",Jt=!0),Xt[1].type="lineEnding",qt=pn}else if(!(Xt[1].type==="linePrefix"||Xt[1].type==="blockQuotePrefix"||Xt[1].type==="blockQuotePrefixWhitespace"||Xt[1].type==="blockQuoteMarker"||Xt[1].type==="listItemIndent"))break}mt&&(!qt||mt<qt)&&(_n._spread=!0),_n.end=Object.assign({},qt?re[qt][1].start:Fe[1].end),re.splice(qt||Ge,0,["exit",_n,Fe[2]]),Ge++,Me++}if(Fe[1].type==="listItemPrefix"){const pn={type:"listItem",_spread:!1,start:Object.assign({},Fe[1].start),end:void 0};_n=pn,re.splice(Ge,0,["enter",pn,Fe[2]]),Ge++,Me++,mt=void 0,Ct=!0}}}return re[me][1]._spread=Jt,Me}function o(re,me){return Me;function Me(Ge){f.call(this,re(Ge),Ge),me&&me.call(this,Ge)}}function u(){this.stack.push({type:"fragment",children:[]})}function f(re,me,Me){this.stack[this.stack.length-1].children.push(re),this.stack.push(re),this.tokenStack.push([me,Me||void 0]),re.position={start:Qa(me.start),end:void 0}}function d(re){return me;function me(Me){re&&re.call(this,Me),p.call(this,Me)}}function p(re,me){const Me=this.stack.pop(),Ge=this.tokenStack.pop();if(Ge)Ge[0].type!==re.type&&(me?me.call(this,re,Ge[0]):(Ge[1]||Iy).call(this,re,Ge[0]));else throw new Error("Cannot close `"+re.type+"` ("+Ys({start:re.start,end:re.end})+"): it’s not open");Me.position.end=Qa(re.end)}function x(){return Ap(this.stack.pop())}function g(){this.data.expectingFirstListItemValue=!0}function y(re){if(this.data.expectingFirstListItemValue){const me=this.stack[this.stack.length-2];me.start=Number.parseInt(this.sliceSerialize(re),10),this.data.expectingFirstListItemValue=void 0}}function v(){const re=this.resume(),me=this.stack[this.stack.length-1];me.lang=re}function S(){const re=this.resume(),me=this.stack[this.stack.length-1];me.meta=re}function E(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function T(){const re=this.resume(),me=this.stack[this.stack.length-1];me.value=re.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function N(){const re=this.resume(),me=this.stack[this.stack.length-1];me.value=re.replace(/(\r?\n|\r)$/g,"")}function j(re){const me=this.resume(),Me=this.stack[this.stack.length-1];Me.label=me,Me.identifier=Lr(this.sliceSerialize(re)).toLowerCase()}function C(){const re=this.resume(),me=this.stack[this.stack.length-1];me.title=re}function I(){const re=this.resume(),me=this.stack[this.stack.length-1];me.url=re}function U(re){const me=this.stack[this.stack.length-1];if(!me.depth){const Me=this.sliceSerialize(re).length;me.depth=Me}}function _(){this.data.setextHeadingSlurpLineEnding=!0}function z(re){const me=this.stack[this.stack.length-1];me.depth=this.sliceSerialize(re).codePointAt(0)===61?1:2}function P(){this.data.setextHeadingSlurpLineEnding=void 0}function X(re){const Me=this.stack[this.stack.length-1].children;let Ge=Me[Me.length-1];(!Ge||Ge.type!=="text")&&(Ge=Et(),Ge.position={start:Qa(re.start),end:void 0},Me.push(Ge)),this.stack.push(Ge)}function B(re){const me=this.stack.pop();me.value+=this.sliceSerialize(re),me.position.end=Qa(re.end)}function q(re){const me=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Me=me.children[me.children.length-1];Me.position.end=Qa(re.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&n.canContainEols.includes(me.type)&&(X.call(this,re),B.call(this,re))}function Z(){this.data.atHardBreak=!0}function ee(){const re=this.resume(),me=this.stack[this.stack.length-1];me.value=re}function ae(){const re=this.resume(),me=this.stack[this.stack.length-1];me.value=re}function Y(){const re=this.resume(),me=this.stack[this.stack.length-1];me.value=re}function M(){const re=this.stack[this.stack.length-1];if(this.data.inReference){const me=this.data.referenceType||"shortcut";re.type+="Reference",re.referenceType=me,delete re.url,delete re.title}else delete re.identifier,delete re.label;this.data.referenceType=void 0}function K(){const re=this.stack[this.stack.length-1];if(this.data.inReference){const me=this.data.referenceType||"shortcut";re.type+="Reference",re.referenceType=me,delete re.url,delete re.title}else delete re.identifier,delete re.label;this.data.referenceType=void 0}function le(re){const me=this.sliceSerialize(re),Me=this.stack[this.stack.length-2];Me.label=gC(me),Me.identifier=Lr(me).toLowerCase()}function be(){const re=this.stack[this.stack.length-1],me=this.resume(),Me=this.stack[this.stack.length-1];if(this.data.inReference=!0,Me.type==="link"){const Ge=re.children;Me.children=Ge}else Me.alt=me}function O(){const re=this.resume(),me=this.stack[this.stack.length-1];me.url=re}function D(){const re=this.resume(),me=this.stack[this.stack.length-1];me.title=re}function L(){this.data.inReference=void 0}function A(){this.data.referenceType="collapsed"}function se(re){const me=this.resume(),Me=this.stack[this.stack.length-1];Me.label=me,Me.identifier=Lr(this.sliceSerialize(re)).toLowerCase(),this.data.referenceType="full"}function te(re){this.data.characterReferenceType=re.type}function ie(re){const me=this.sliceSerialize(re),Me=this.data.characterReferenceType;let Ge;Me?(Ge=fv(me,Me==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ge=Cp(me);const nt=this.stack[this.stack.length-1];nt.value+=Ge}function Se(re){const me=this.stack.pop();me.position.end=Qa(re.end)}function je(re){B.call(this,re);const me=this.stack[this.stack.length-1];me.url=this.sliceSerialize(re)}function Ae(re){B.call(this,re);const me=this.stack[this.stack.length-1];me.url="mailto:"+this.sliceSerialize(re)}function qe(){return{type:"blockquote",children:[]}}function we(){return{type:"code",lang:null,meta:null,value:""}}function Ve(){return{type:"inlineCode",value:""}}function Lt(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function he(){return{type:"emphasis",children:[]}}function xe(){return{type:"heading",depth:0,children:[]}}function _e(){return{type:"break"}}function et(){return{type:"html",value:""}}function St(){return{type:"image",title:null,url:"",alt:null}}function xn(){return{type:"link",title:null,url:"",children:[]}}function Ot(re){return{type:"list",ordered:re.type==="listOrdered",start:null,spread:re._spread,children:[]}}function pr(re){return{type:"listItem",spread:re._spread,checked:null,children:[]}}function On(){return{type:"paragraph",children:[]}}function Dn(){return{type:"strong",children:[]}}function Et(){return{type:"text",value:""}}function bn(){return{type:"thematicBreak"}}}function Qa(e){return{line:e.line,column:e.column,offset:e.offset}}function kv(e,n){let r=-1;for(;++r<n.length;){const l=n[r];Array.isArray(l)?kv(e,l):vC(e,l)}}function vC(e,n){let r;for(r in n)if(wv.call(n,r))switch(r){case"canContainEols":{const l=n[r];l&&e[r].push(...l);break}case"transforms":{const l=n[r];l&&e[r].push(...l);break}case"enter":case"exit":{const l=n[r];l&&Object.assign(e[r],l);break}}}function Iy(e,n){throw e?new Error("Cannot close `"+e.type+"` ("+Ys({start:e.start,end:e.end})+"): a different token (`"+n.type+"`, "+Ys({start:n.start,end:n.end})+") is open"):new Error("Cannot close document, a token (`"+n.type+"`, "+Ys({start:n.start,end:n.end})+") is still open")}function wC(e){const n=this;n.parser=r;function r(l){return bC(l,{...n.data("settings"),...e,extensions:n.data("micromarkExtensions")||[],mdastExtensions:n.data("fromMarkdownExtensions")||[]})}}function kC(e,n){const r={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(n),!0)};return e.patch(n,r),e.applyData(n,r)}function SC(e,n){const r={type:"element",tagName:"br",properties:{},children:[]};return e.patch(n,r),[e.applyData(n,r),{type:"text",value:`
|
|
18
|
+
`}]}function EC(e,n){const r=n.value?n.value+`
|
|
19
|
+
`:"",l={},s=n.lang?n.lang.split(/\s+/):[];s.length>0&&(l.className=["language-"+s[0]]);let o={type:"element",tagName:"code",properties:l,children:[{type:"text",value:r}]};return n.meta&&(o.data={meta:n.meta}),e.patch(n,o),o=e.applyData(n,o),o={type:"element",tagName:"pre",properties:{},children:[o]},e.patch(n,o),o}function NC(e,n){const r={type:"element",tagName:"del",properties:{},children:e.all(n)};return e.patch(n,r),e.applyData(n,r)}function _C(e,n){const r={type:"element",tagName:"em",properties:{},children:e.all(n)};return e.patch(n,r),e.applyData(n,r)}function TC(e,n){const r=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",l=String(n.identifier).toUpperCase(),s=Di(l.toLowerCase()),o=e.footnoteOrder.indexOf(l);let u,f=e.footnoteCounts.get(l);f===void 0?(f=0,e.footnoteOrder.push(l),u=e.footnoteOrder.length):u=o+1,f+=1,e.footnoteCounts.set(l,f);const d={type:"element",tagName:"a",properties:{href:"#"+r+"fn-"+s,id:r+"fnref-"+s+(f>1?"-"+f:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(u)}]};e.patch(n,d);const p={type:"element",tagName:"sup",properties:{},children:[d]};return e.patch(n,p),e.applyData(n,p)}function AC(e,n){const r={type:"element",tagName:"h"+n.depth,properties:{},children:e.all(n)};return e.patch(n,r),e.applyData(n,r)}function CC(e,n){if(e.options.allowDangerousHtml){const r={type:"raw",value:n.value};return e.patch(n,r),e.applyData(n,r)}}function Sv(e,n){const r=n.referenceType;let l="]";if(r==="collapsed"?l+="[]":r==="full"&&(l+="["+(n.label||n.identifier)+"]"),n.type==="imageReference")return[{type:"text",value:"!["+n.alt+l}];const s=e.all(n),o=s[0];o&&o.type==="text"?o.value="["+o.value:s.unshift({type:"text",value:"["});const u=s[s.length-1];return u&&u.type==="text"?u.value+=l:s.push({type:"text",value:l}),s}function RC(e,n){const r=String(n.identifier).toUpperCase(),l=e.definitionById.get(r);if(!l)return Sv(e,n);const s={src:Di(l.url||""),alt:n.alt};l.title!==null&&l.title!==void 0&&(s.title=l.title);const o={type:"element",tagName:"img",properties:s,children:[]};return e.patch(n,o),e.applyData(n,o)}function jC(e,n){const r={src:Di(n.url)};n.alt!==null&&n.alt!==void 0&&(r.alt=n.alt),n.title!==null&&n.title!==void 0&&(r.title=n.title);const l={type:"element",tagName:"img",properties:r,children:[]};return e.patch(n,l),e.applyData(n,l)}function MC(e,n){const r={type:"text",value:n.value.replace(/\r?\n|\r/g," ")};e.patch(n,r);const l={type:"element",tagName:"code",properties:{},children:[r]};return e.patch(n,l),e.applyData(n,l)}function OC(e,n){const r=String(n.identifier).toUpperCase(),l=e.definitionById.get(r);if(!l)return Sv(e,n);const s={href:Di(l.url||"")};l.title!==null&&l.title!==void 0&&(s.title=l.title);const o={type:"element",tagName:"a",properties:s,children:e.all(n)};return e.patch(n,o),e.applyData(n,o)}function DC(e,n){const r={href:Di(n.url)};n.title!==null&&n.title!==void 0&&(r.title=n.title);const l={type:"element",tagName:"a",properties:r,children:e.all(n)};return e.patch(n,l),e.applyData(n,l)}function zC(e,n,r){const l=e.all(n),s=r?LC(r):Ev(n),o={},u=[];if(typeof n.checked=="boolean"){const x=l[0];let g;x&&x.type==="element"&&x.tagName==="p"?g=x:(g={type:"element",tagName:"p",properties:{},children:[]},l.unshift(g)),g.children.length>0&&g.children.unshift({type:"text",value:" "}),g.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:n.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let f=-1;for(;++f<l.length;){const x=l[f];(s||f!==0||x.type!=="element"||x.tagName!=="p")&&u.push({type:"text",value:`
|
|
20
|
+
`}),x.type==="element"&&x.tagName==="p"&&!s?u.push(...x.children):u.push(x)}const d=l[l.length-1];d&&(s||d.type!=="element"||d.tagName!=="p")&&u.push({type:"text",value:`
|
|
21
|
+
`});const p={type:"element",tagName:"li",properties:o,children:u};return e.patch(n,p),e.applyData(n,p)}function LC(e){let n=!1;if(e.type==="list"){n=e.spread||!1;const r=e.children;let l=-1;for(;!n&&++l<r.length;)n=Ev(r[l])}return n}function Ev(e){const n=e.spread;return n??e.children.length>1}function BC(e,n){const r={},l=e.all(n);let s=-1;for(typeof n.start=="number"&&n.start!==1&&(r.start=n.start);++s<l.length;){const u=l[s];if(u.type==="element"&&u.tagName==="li"&&u.properties&&Array.isArray(u.properties.className)&&u.properties.className.includes("task-list-item")){r.className=["contains-task-list"];break}}const o={type:"element",tagName:n.ordered?"ol":"ul",properties:r,children:e.wrap(l,!0)};return e.patch(n,o),e.applyData(n,o)}function IC(e,n){const r={type:"element",tagName:"p",properties:{},children:e.all(n)};return e.patch(n,r),e.applyData(n,r)}function UC(e,n){const r={type:"root",children:e.wrap(e.all(n))};return e.patch(n,r),e.applyData(n,r)}function $C(e,n){const r={type:"element",tagName:"strong",properties:{},children:e.all(n)};return e.patch(n,r),e.applyData(n,r)}function HC(e,n){const r=e.all(n),l=r.shift(),s=[];if(l){const u={type:"element",tagName:"thead",properties:{},children:e.wrap([l],!0)};e.patch(n.children[0],u),s.push(u)}if(r.length>0){const u={type:"element",tagName:"tbody",properties:{},children:e.wrap(r,!0)},f=Ep(n.children[1]),d=rv(n.children[n.children.length-1]);f&&d&&(u.position={start:f,end:d}),s.push(u)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(s,!0)};return e.patch(n,o),e.applyData(n,o)}function PC(e,n,r){const l=r?r.children:void 0,o=(l?l.indexOf(n):1)===0?"th":"td",u=r&&r.type==="table"?r.align:void 0,f=u?u.length:n.children.length;let d=-1;const p=[];for(;++d<f;){const g=n.children[d],y={},v=u?u[d]:void 0;v&&(y.align=v);let S={type:"element",tagName:o,properties:y,children:[]};g&&(S.children=e.all(g),e.patch(g,S),S=e.applyData(g,S)),p.push(S)}const x={type:"element",tagName:"tr",properties:{},children:e.wrap(p,!0)};return e.patch(n,x),e.applyData(n,x)}function FC(e,n){const r={type:"element",tagName:"td",properties:{},children:e.all(n)};return e.patch(n,r),e.applyData(n,r)}const Uy=9,$y=32;function GC(e){const n=String(e),r=/\r?\n|\r/g;let l=r.exec(n),s=0;const o=[];for(;l;)o.push(Hy(n.slice(s,l.index),s>0,!0),l[0]),s=l.index+l[0].length,l=r.exec(n);return o.push(Hy(n.slice(s),s>0,!1)),o.join("")}function Hy(e,n,r){let l=0,s=e.length;if(n){let o=e.codePointAt(l);for(;o===Uy||o===$y;)l++,o=e.codePointAt(l)}if(r){let o=e.codePointAt(s-1);for(;o===Uy||o===$y;)s--,o=e.codePointAt(s-1)}return s>l?e.slice(l,s):""}function qC(e,n){const r={type:"text",value:GC(String(n.value))};return e.patch(n,r),e.applyData(n,r)}function YC(e,n){const r={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(n,r),e.applyData(n,r)}const VC={blockquote:kC,break:SC,code:EC,delete:NC,emphasis:_C,footnoteReference:TC,heading:AC,html:CC,imageReference:RC,image:jC,inlineCode:MC,linkReference:OC,link:DC,listItem:zC,list:BC,paragraph:IC,root:UC,strong:$C,table:HC,tableCell:FC,tableRow:PC,text:qC,thematicBreak:YC,toml:Ru,yaml:Ru,definition:Ru,footnoteDefinition:Ru};function Ru(){}const Nv=-1,yc=0,Xs=1,rc=2,jp=3,Mp=4,Op=5,Dp=6,_v=7,Tv=8,Py=typeof self=="object"?self:globalThis,XC=(e,n)=>{const r=(s,o)=>(e.set(o,s),s),l=s=>{if(e.has(s))return e.get(s);const[o,u]=n[s];switch(o){case yc:case Nv:return r(u,s);case Xs:{const f=r([],s);for(const d of u)f.push(l(d));return f}case rc:{const f=r({},s);for(const[d,p]of u)f[l(d)]=l(p);return f}case jp:return r(new Date(u),s);case Mp:{const{source:f,flags:d}=u;return r(new RegExp(f,d),s)}case Op:{const f=r(new Map,s);for(const[d,p]of u)f.set(l(d),l(p));return f}case Dp:{const f=r(new Set,s);for(const d of u)f.add(l(d));return f}case _v:{const{name:f,message:d}=u;return r(new Py[f](d),s)}case Tv:return r(BigInt(u),s);case"BigInt":return r(Object(BigInt(u)),s);case"ArrayBuffer":return r(new Uint8Array(u).buffer,u);case"DataView":{const{buffer:f}=new Uint8Array(u);return r(new DataView(f),u)}}return r(new Py[o](u),s)};return l},Fy=e=>XC(new Map,e)(0),xi="",{toString:KC}={},{keys:ZC}=Object,Os=e=>{const n=typeof e;if(n!=="object"||!e)return[yc,n];const r=KC.call(e).slice(8,-1);switch(r){case"Array":return[Xs,xi];case"Object":return[rc,xi];case"Date":return[jp,xi];case"RegExp":return[Mp,xi];case"Map":return[Op,xi];case"Set":return[Dp,xi];case"DataView":return[Xs,r]}return r.includes("Array")?[Xs,r]:r.includes("Error")?[_v,r]:[rc,r]},ju=([e,n])=>e===yc&&(n==="function"||n==="symbol"),QC=(e,n,r,l)=>{const s=(u,f)=>{const d=l.push(u)-1;return r.set(f,d),d},o=u=>{if(r.has(u))return r.get(u);let[f,d]=Os(u);switch(f){case yc:{let x=u;switch(d){case"bigint":f=Tv,x=u.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+d);x=null;break;case"undefined":return s([Nv],u)}return s([f,x],u)}case Xs:{if(d){let y=u;return d==="DataView"?y=new Uint8Array(u.buffer):d==="ArrayBuffer"&&(y=new Uint8Array(u)),s([d,[...y]],u)}const x=[],g=s([f,x],u);for(const y of u)x.push(o(y));return g}case rc:{if(d)switch(d){case"BigInt":return s([d,u.toString()],u);case"Boolean":case"Number":case"String":return s([d,u.valueOf()],u)}if(n&&"toJSON"in u)return o(u.toJSON());const x=[],g=s([f,x],u);for(const y of ZC(u))(e||!ju(Os(u[y])))&&x.push([o(y),o(u[y])]);return g}case jp:return s([f,u.toISOString()],u);case Mp:{const{source:x,flags:g}=u;return s([f,{source:x,flags:g}],u)}case Op:{const x=[],g=s([f,x],u);for(const[y,v]of u)(e||!(ju(Os(y))||ju(Os(v))))&&x.push([o(y),o(v)]);return g}case Dp:{const x=[],g=s([f,x],u);for(const y of u)(e||!ju(Os(y)))&&x.push(o(y));return g}}const{message:p}=u;return s([f,{name:d,message:p}],u)};return o},Gy=(e,{json:n,lossy:r}={})=>{const l=[];return QC(!(n||r),!!n,new Map,l)(e),l},ac=typeof structuredClone=="function"?(e,n)=>n&&("json"in n||"lossy"in n)?Fy(Gy(e,n)):structuredClone(e):(e,n)=>Fy(Gy(e,n));function WC(e,n){const r=[{type:"text",value:"↩"}];return n>1&&r.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(n)}]}),r}function JC(e,n){return"Back to reference "+(e+1)+(n>1?"-"+n:"")}function eR(e){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=e.options.footnoteBackContent||WC,l=e.options.footnoteBackLabel||JC,s=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",u=e.options.footnoteLabelProperties||{className:["sr-only"]},f=[];let d=-1;for(;++d<e.footnoteOrder.length;){const p=e.footnoteById.get(e.footnoteOrder[d]);if(!p)continue;const x=e.all(p),g=String(p.identifier).toUpperCase(),y=Di(g.toLowerCase());let v=0;const S=[],E=e.footnoteCounts.get(g);for(;E!==void 0&&++v<=E;){S.length>0&&S.push({type:"text",value:" "});let j=typeof r=="string"?r:r(d,v);typeof j=="string"&&(j={type:"text",value:j}),S.push({type:"element",tagName:"a",properties:{href:"#"+n+"fnref-"+y+(v>1?"-"+v:""),dataFootnoteBackref:"",ariaLabel:typeof l=="string"?l:l(d,v),className:["data-footnote-backref"]},children:Array.isArray(j)?j:[j]})}const T=x[x.length-1];if(T&&T.type==="element"&&T.tagName==="p"){const j=T.children[T.children.length-1];j&&j.type==="text"?j.value+=" ":T.children.push({type:"text",value:" "}),T.children.push(...S)}else x.push(...S);const N={type:"element",tagName:"li",properties:{id:n+"fn-"+y},children:e.wrap(x,!0)};e.patch(p,N),f.push(N)}if(f.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...ac(u),id:"footnote-label"},children:[{type:"text",value:s}]},{type:"text",value:`
|
|
22
|
+
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(f,!0)},{type:"text",value:`
|
|
23
|
+
`}]}}const vc=(function(e){if(e==null)return aR;if(typeof e=="function")return wc(e);if(typeof e=="object")return Array.isArray(e)?tR(e):nR(e);if(typeof e=="string")return rR(e);throw new Error("Expected function, string, or object as test")});function tR(e){const n=[];let r=-1;for(;++r<e.length;)n[r]=vc(e[r]);return wc(l);function l(...s){let o=-1;for(;++o<n.length;)if(n[o].apply(this,s))return!0;return!1}}function nR(e){const n=e;return wc(r);function r(l){const s=l;let o;for(o in e)if(s[o]!==n[o])return!1;return!0}}function rR(e){return wc(n);function n(r){return r&&r.type===e}}function wc(e){return n;function n(r,l,s){return!!(lR(r)&&e.call(this,r,typeof l=="number"?l:void 0,s||void 0))}}function aR(){return!0}function lR(e){return e!==null&&typeof e=="object"&&"type"in e}const Av=[],iR=!0,Vh=!1,sR="skip";function Cv(e,n,r,l){let s;typeof n=="function"&&typeof r!="function"?(l=r,r=n):s=n;const o=vc(s),u=l?-1:1;f(e,void 0,[])();function f(d,p,x){const g=d&&typeof d=="object"?d:{};if(typeof g.type=="string"){const v=typeof g.tagName=="string"?g.tagName:typeof g.name=="string"?g.name:void 0;Object.defineProperty(y,"name",{value:"node ("+(d.type+(v?"<"+v+">":""))+")"})}return y;function y(){let v=Av,S,E,T;if((!n||o(d,p,x[x.length-1]||void 0))&&(v=oR(r(d,x)),v[0]===Vh))return v;if("children"in d&&d.children){const N=d;if(N.children&&v[0]!==sR)for(E=(l?N.children.length:-1)+u,T=x.concat(N);E>-1&&E<N.children.length;){const j=N.children[E];if(S=f(j,E,T)(),S[0]===Vh)return S;E=typeof S[1]=="number"?S[1]:E+u}}return v}}}function oR(e){return Array.isArray(e)?e:typeof e=="number"?[iR,e]:e==null?Av:[e]}function zp(e,n,r,l){let s,o,u;typeof n=="function"&&typeof r!="function"?(o=void 0,u=n,s=r):(o=n,u=r,s=l),Cv(e,o,f,s);function f(d,p){const x=p[p.length-1],g=x?x.children.indexOf(d):void 0;return u(d,g,x)}}const Xh={}.hasOwnProperty,uR={};function cR(e,n){const r=n||uR,l=new Map,s=new Map,o=new Map,u={...VC,...r.handlers},f={all:p,applyData:dR,definitionById:l,footnoteById:s,footnoteCounts:o,footnoteOrder:[],handlers:u,one:d,options:r,patch:fR,wrap:pR};return zp(e,function(x){if(x.type==="definition"||x.type==="footnoteDefinition"){const g=x.type==="definition"?l:s,y=String(x.identifier).toUpperCase();g.has(y)||g.set(y,x)}}),f;function d(x,g){const y=x.type,v=f.handlers[y];if(Xh.call(f.handlers,y)&&v)return v(f,x,g);if(f.options.passThrough&&f.options.passThrough.includes(y)){if("children"in x){const{children:E,...T}=x,N=ac(T);return N.children=f.all(x),N}return ac(x)}return(f.options.unknownHandler||hR)(f,x,g)}function p(x){const g=[];if("children"in x){const y=x.children;let v=-1;for(;++v<y.length;){const S=f.one(y[v],x);if(S){if(v&&y[v-1].type==="break"&&(!Array.isArray(S)&&S.type==="text"&&(S.value=qy(S.value)),!Array.isArray(S)&&S.type==="element")){const E=S.children[0];E&&E.type==="text"&&(E.value=qy(E.value))}Array.isArray(S)?g.push(...S):g.push(S)}}}return g}}function fR(e,n){e.position&&(n.position=J_(e))}function dR(e,n){let r=n;if(e&&e.data){const l=e.data.hName,s=e.data.hChildren,o=e.data.hProperties;if(typeof l=="string")if(r.type==="element")r.tagName=l;else{const u="children"in r?r.children:[r];r={type:"element",tagName:l,properties:{},children:u}}r.type==="element"&&o&&Object.assign(r.properties,ac(o)),"children"in r&&r.children&&s!==null&&s!==void 0&&(r.children=s)}return r}function hR(e,n){const r=n.data||{},l="value"in n&&!(Xh.call(r,"hProperties")||Xh.call(r,"hChildren"))?{type:"text",value:n.value}:{type:"element",tagName:"div",properties:{},children:e.all(n)};return e.patch(n,l),e.applyData(n,l)}function pR(e,n){const r=[];let l=-1;for(n&&r.push({type:"text",value:`
|
|
24
|
+
`});++l<e.length;)l&&r.push({type:"text",value:`
|
|
25
|
+
`}),r.push(e[l]);return n&&e.length>0&&r.push({type:"text",value:`
|
|
26
|
+
`}),r}function qy(e){let n=0,r=e.charCodeAt(n);for(;r===9||r===32;)n++,r=e.charCodeAt(n);return e.slice(n)}function Yy(e,n){const r=cR(e,n),l=r.one(e,void 0),s=eR(r),o=Array.isArray(l)?{type:"root",children:l}:l||{type:"root",children:[]};return s&&o.children.push({type:"text",value:`
|
|
27
|
+
`},s),o}function mR(e,n){return e&&"run"in e?async function(r,l){const s=Yy(r,{file:l,...n});await e.run(s,l)}:function(r,l){return Yy(r,{file:l,...e||n})}}function Vy(e){if(e)throw e}var th,Xy;function gR(){if(Xy)return th;Xy=1;var e=Object.prototype.hasOwnProperty,n=Object.prototype.toString,r=Object.defineProperty,l=Object.getOwnPropertyDescriptor,s=function(p){return typeof Array.isArray=="function"?Array.isArray(p):n.call(p)==="[object Array]"},o=function(p){if(!p||n.call(p)!=="[object Object]")return!1;var x=e.call(p,"constructor"),g=p.constructor&&p.constructor.prototype&&e.call(p.constructor.prototype,"isPrototypeOf");if(p.constructor&&!x&&!g)return!1;var y;for(y in p);return typeof y>"u"||e.call(p,y)},u=function(p,x){r&&x.name==="__proto__"?r(p,x.name,{enumerable:!0,configurable:!0,value:x.newValue,writable:!0}):p[x.name]=x.newValue},f=function(p,x){if(x==="__proto__")if(e.call(p,x)){if(l)return l(p,x).value}else return;return p[x]};return th=function d(){var p,x,g,y,v,S,E=arguments[0],T=1,N=arguments.length,j=!1;for(typeof E=="boolean"&&(j=E,E=arguments[1]||{},T=2),(E==null||typeof E!="object"&&typeof E!="function")&&(E={});T<N;++T)if(p=arguments[T],p!=null)for(x in p)g=f(E,x),y=f(p,x),E!==y&&(j&&y&&(o(y)||(v=s(y)))?(v?(v=!1,S=g&&s(g)?g:[]):S=g&&o(g)?g:{},u(E,{name:x,newValue:d(j,S,y)})):typeof y<"u"&&u(E,{name:x,newValue:y}));return E},th}var xR=gR();const nh=so(xR);function Kh(e){if(typeof e!="object"||e===null)return!1;const n=Object.getPrototypeOf(e);return(n===null||n===Object.prototype||Object.getPrototypeOf(n)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function bR(){const e=[],n={run:r,use:l};return n;function r(...s){let o=-1;const u=s.pop();if(typeof u!="function")throw new TypeError("Expected function as last argument, not "+u);f(null,...s);function f(d,...p){const x=e[++o];let g=-1;if(d){u(d);return}for(;++g<s.length;)(p[g]===null||p[g]===void 0)&&(p[g]=s[g]);s=p,x?yR(x,f)(...p):u(null,...p)}}function l(s){if(typeof s!="function")throw new TypeError("Expected `middelware` to be a function, not "+s);return e.push(s),n}}function yR(e,n){let r;return l;function l(...u){const f=e.length>u.length;let d;f&&u.push(s);try{d=e.apply(this,u)}catch(p){const x=p;if(f&&r)throw x;return s(x)}f||(d&&d.then&&typeof d.then=="function"?d.then(o,s):d instanceof Error?s(d):o(d))}function s(u,...f){r||(r=!0,n(u,...f))}function o(u){s(null,u)}}const Xr={basename:vR,dirname:wR,extname:kR,join:SR,sep:"/"};function vR(e,n){if(n!==void 0&&typeof n!="string")throw new TypeError('"ext" argument must be a string');fo(e);let r=0,l=-1,s=e.length,o;if(n===void 0||n.length===0||n.length>e.length){for(;s--;)if(e.codePointAt(s)===47){if(o){r=s+1;break}}else l<0&&(o=!0,l=s+1);return l<0?"":e.slice(r,l)}if(n===e)return"";let u=-1,f=n.length-1;for(;s--;)if(e.codePointAt(s)===47){if(o){r=s+1;break}}else u<0&&(o=!0,u=s+1),f>-1&&(e.codePointAt(s)===n.codePointAt(f--)?f<0&&(l=s):(f=-1,l=u));return r===l?l=u:l<0&&(l=e.length),e.slice(r,l)}function wR(e){if(fo(e),e.length===0)return".";let n=-1,r=e.length,l;for(;--r;)if(e.codePointAt(r)===47){if(l){n=r;break}}else l||(l=!0);return n<0?e.codePointAt(0)===47?"/":".":n===1&&e.codePointAt(0)===47?"//":e.slice(0,n)}function kR(e){fo(e);let n=e.length,r=-1,l=0,s=-1,o=0,u;for(;n--;){const f=e.codePointAt(n);if(f===47){if(u){l=n+1;break}continue}r<0&&(u=!0,r=n+1),f===46?s<0?s=n:o!==1&&(o=1):s>-1&&(o=-1)}return s<0||r<0||o===0||o===1&&s===r-1&&s===l+1?"":e.slice(s,r)}function SR(...e){let n=-1,r;for(;++n<e.length;)fo(e[n]),e[n]&&(r=r===void 0?e[n]:r+"/"+e[n]);return r===void 0?".":ER(r)}function ER(e){fo(e);const n=e.codePointAt(0)===47;let r=NR(e,!n);return r.length===0&&!n&&(r="."),r.length>0&&e.codePointAt(e.length-1)===47&&(r+="/"),n?"/"+r:r}function NR(e,n){let r="",l=0,s=-1,o=0,u=-1,f,d;for(;++u<=e.length;){if(u<e.length)f=e.codePointAt(u);else{if(f===47)break;f=47}if(f===47){if(!(s===u-1||o===1))if(s!==u-1&&o===2){if(r.length<2||l!==2||r.codePointAt(r.length-1)!==46||r.codePointAt(r.length-2)!==46){if(r.length>2){if(d=r.lastIndexOf("/"),d!==r.length-1){d<0?(r="",l=0):(r=r.slice(0,d),l=r.length-1-r.lastIndexOf("/")),s=u,o=0;continue}}else if(r.length>0){r="",l=0,s=u,o=0;continue}}n&&(r=r.length>0?r+"/..":"..",l=2)}else r.length>0?r+="/"+e.slice(s+1,u):r=e.slice(s+1,u),l=u-s-1;s=u,o=0}else f===46&&o>-1?o++:o=-1}return r}function fo(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const _R={cwd:TR};function TR(){return"/"}function Zh(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function AR(e){if(typeof e=="string")e=new URL(e);else if(!Zh(e)){const n=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw n.code="ERR_INVALID_ARG_TYPE",n}if(e.protocol!=="file:"){const n=new TypeError("The URL must be of scheme file");throw n.code="ERR_INVALID_URL_SCHEME",n}return CR(e)}function CR(e){if(e.hostname!==""){const l=new TypeError('File URL host must be "localhost" or empty on darwin');throw l.code="ERR_INVALID_FILE_URL_HOST",l}const n=e.pathname;let r=-1;for(;++r<n.length;)if(n.codePointAt(r)===37&&n.codePointAt(r+1)===50){const l=n.codePointAt(r+2);if(l===70||l===102){const s=new TypeError("File URL path must not include encoded / characters");throw s.code="ERR_INVALID_FILE_URL_PATH",s}}return decodeURIComponent(n)}const rh=["history","path","basename","stem","extname","dirname"];class Rv{constructor(n){let r;n?Zh(n)?r={path:n}:typeof n=="string"||RR(n)?r={value:n}:r=n:r={},this.cwd="cwd"in r?"":_R.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let l=-1;for(;++l<rh.length;){const o=rh[l];o in r&&r[o]!==void 0&&r[o]!==null&&(this[o]=o==="history"?[...r[o]]:r[o])}let s;for(s in r)rh.includes(s)||(this[s]=r[s])}get basename(){return typeof this.path=="string"?Xr.basename(this.path):void 0}set basename(n){lh(n,"basename"),ah(n,"basename"),this.path=Xr.join(this.dirname||"",n)}get dirname(){return typeof this.path=="string"?Xr.dirname(this.path):void 0}set dirname(n){Ky(this.basename,"dirname"),this.path=Xr.join(n||"",this.basename)}get extname(){return typeof this.path=="string"?Xr.extname(this.path):void 0}set extname(n){if(ah(n,"extname"),Ky(this.dirname,"extname"),n){if(n.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(n.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Xr.join(this.dirname,this.stem+(n||""))}get path(){return this.history[this.history.length-1]}set path(n){Zh(n)&&(n=AR(n)),lh(n,"path"),this.path!==n&&this.history.push(n)}get stem(){return typeof this.path=="string"?Xr.basename(this.path,this.extname):void 0}set stem(n){lh(n,"stem"),ah(n,"stem"),this.path=Xr.join(this.dirname||"",n+(this.extname||""))}fail(n,r,l){const s=this.message(n,r,l);throw s.fatal=!0,s}info(n,r,l){const s=this.message(n,r,l);return s.fatal=void 0,s}message(n,r,l){const s=new Mn(n,r,l);return this.path&&(s.name=this.path+":"+s.name,s.file=this.path),s.fatal=!1,this.messages.push(s),s}toString(n){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(n||void 0).decode(this.value)}}function ah(e,n){if(e&&e.includes(Xr.sep))throw new Error("`"+n+"` cannot be a path: did not expect `"+Xr.sep+"`")}function lh(e,n){if(!e)throw new Error("`"+n+"` cannot be empty")}function Ky(e,n){if(!e)throw new Error("Setting `"+n+"` requires `path` to be set too")}function RR(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const jR=(function(e){const l=this.constructor.prototype,s=l[e],o=function(){return s.apply(o,arguments)};return Object.setPrototypeOf(o,l),o}),MR={}.hasOwnProperty;class Lp extends jR{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=bR()}copy(){const n=new Lp;let r=-1;for(;++r<this.attachers.length;){const l=this.attachers[r];n.use(...l)}return n.data(nh(!0,{},this.namespace)),n}data(n,r){return typeof n=="string"?arguments.length===2?(oh("data",this.frozen),this.namespace[n]=r,this):MR.call(this.namespace,n)&&this.namespace[n]||void 0:n?(oh("data",this.frozen),this.namespace=n,this):this.namespace}freeze(){if(this.frozen)return this;const n=this;for(;++this.freezeIndex<this.attachers.length;){const[r,...l]=this.attachers[this.freezeIndex];if(l[0]===!1)continue;l[0]===!0&&(l[0]=void 0);const s=r.call(n,...l);typeof s=="function"&&this.transformers.use(s)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(n){this.freeze();const r=Mu(n),l=this.parser||this.Parser;return ih("parse",l),l(String(r),r)}process(n,r){const l=this;return this.freeze(),ih("process",this.parser||this.Parser),sh("process",this.compiler||this.Compiler),r?s(void 0,r):new Promise(s);function s(o,u){const f=Mu(n),d=l.parse(f);l.run(d,f,function(x,g,y){if(x||!g||!y)return p(x);const v=g,S=l.stringify(v,y);zR(S)?y.value=S:y.result=S,p(x,y)});function p(x,g){x||!g?u(x):o?o(g):r(void 0,g)}}}processSync(n){let r=!1,l;return this.freeze(),ih("processSync",this.parser||this.Parser),sh("processSync",this.compiler||this.Compiler),this.process(n,s),Qy("processSync","process",r),l;function s(o,u){r=!0,Vy(o),l=u}}run(n,r,l){Zy(n),this.freeze();const s=this.transformers;return!l&&typeof r=="function"&&(l=r,r=void 0),l?o(void 0,l):new Promise(o);function o(u,f){const d=Mu(r);s.run(n,d,p);function p(x,g,y){const v=g||n;x?f(x):u?u(v):l(void 0,v,y)}}}runSync(n,r){let l=!1,s;return this.run(n,r,o),Qy("runSync","run",l),s;function o(u,f){Vy(u),s=f,l=!0}}stringify(n,r){this.freeze();const l=Mu(r),s=this.compiler||this.Compiler;return sh("stringify",s),Zy(n),s(n,l)}use(n,...r){const l=this.attachers,s=this.namespace;if(oh("use",this.frozen),n!=null)if(typeof n=="function")d(n,r);else if(typeof n=="object")Array.isArray(n)?f(n):u(n);else throw new TypeError("Expected usable value, not `"+n+"`");return this;function o(p){if(typeof p=="function")d(p,[]);else if(typeof p=="object")if(Array.isArray(p)){const[x,...g]=p;d(x,g)}else u(p);else throw new TypeError("Expected usable value, not `"+p+"`")}function u(p){if(!("plugins"in p)&&!("settings"in p))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");f(p.plugins),p.settings&&(s.settings=nh(!0,s.settings,p.settings))}function f(p){let x=-1;if(p!=null)if(Array.isArray(p))for(;++x<p.length;){const g=p[x];o(g)}else throw new TypeError("Expected a list of plugins, not `"+p+"`")}function d(p,x){let g=-1,y=-1;for(;++g<l.length;)if(l[g][0]===p){y=g;break}if(y===-1)l.push([p,...x]);else if(x.length>0){let[v,...S]=x;const E=l[y][1];Kh(E)&&Kh(v)&&(v=nh(!0,E,v)),l[y]=[p,v,...S]}}}}const OR=new Lp().freeze();function ih(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function sh(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function oh(e,n){if(n)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Zy(e){if(!Kh(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Qy(e,n,r){if(!r)throw new Error("`"+e+"` finished async. Use `"+n+"` instead")}function Mu(e){return DR(e)?e:new Rv(e)}function DR(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function zR(e){return typeof e=="string"||LR(e)}function LR(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const BR="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Wy=[],Jy={allowDangerousHtml:!0},IR=/^(https?|ircs?|mailto|xmpp)$/i,UR=[{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 $R(e){const n=HR(e),r=PR(e);return FR(n.runSync(n.parse(r),r),e)}function HR(e){const n=e.rehypePlugins||Wy,r=e.remarkPlugins||Wy,l=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Jy}:Jy;return OR().use(wC).use(r).use(mR,l).use(n)}function PR(e){const n=e.children||"",r=new Rv;return typeof n=="string"&&(r.value=n),r}function FR(e,n){const r=n.allowedElements,l=n.allowElement,s=n.components,o=n.disallowedElements,u=n.skipHtml,f=n.unwrapDisallowed,d=n.urlTransform||GR;for(const x of UR)Object.hasOwn(n,x.from)&&(""+x.from+(x.to?"use `"+x.to+"` instead":"remove it")+BR+x.id,void 0);return zp(e,p),aT(e,{Fragment:h.Fragment,components:s,ignoreInvalidStyle:!0,jsx:h.jsx,jsxs:h.jsxs,passKeys:!0,passNode:!0});function p(x,g,y){if(x.type==="raw"&&y&&typeof g=="number")return u?y.children.splice(g,1):y.children[g]={type:"text",value:x.value},g;if(x.type==="element"){let v;for(v in Wd)if(Object.hasOwn(Wd,v)&&Object.hasOwn(x.properties,v)){const S=x.properties[v],E=Wd[v];(E===null||E.includes(x.tagName))&&(x.properties[v]=d(String(S||""),v,x))}}if(x.type==="element"){let v=r?!r.includes(x.tagName):o?o.includes(x.tagName):!1;if(!v&&l&&typeof g=="number"&&(v=!l(x,g,y)),v&&y&&typeof g=="number")return f&&x.children?y.children.splice(g,1,...x.children):y.children.splice(g,1),g}}}function GR(e){const n=e.indexOf(":"),r=e.indexOf("?"),l=e.indexOf("#"),s=e.indexOf("/");return n===-1||s!==-1&&n>s||r!==-1&&n>r||l!==-1&&n>l||IR.test(e.slice(0,n))?e:""}function e1(e,n){const r=String(e);if(typeof n!="string")throw new TypeError("Expected character");let l=0,s=r.indexOf(n);for(;s!==-1;)l++,s=r.indexOf(n,s+n.length);return l}function qR(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function YR(e,n,r){const s=vc((r||{}).ignore||[]),o=VR(n);let u=-1;for(;++u<o.length;)Cv(e,"text",f);function f(p,x){let g=-1,y;for(;++g<x.length;){const v=x[g],S=y?y.children:void 0;if(s(v,S?S.indexOf(v):void 0,y))return;y=v}if(y)return d(p,x)}function d(p,x){const g=x[x.length-1],y=o[u][0],v=o[u][1];let S=0;const T=g.children.indexOf(p);let N=!1,j=[];y.lastIndex=0;let C=y.exec(p.value);for(;C;){const I=C.index,U={index:C.index,input:C.input,stack:[...x,p]};let _=v(...C,U);if(typeof _=="string"&&(_=_.length>0?{type:"text",value:_}:void 0),_===!1?y.lastIndex=I+1:(S!==I&&j.push({type:"text",value:p.value.slice(S,I)}),Array.isArray(_)?j.push(..._):_&&j.push(_),S=I+C[0].length,N=!0),!y.global)break;C=y.exec(p.value)}return N?(S<p.value.length&&j.push({type:"text",value:p.value.slice(S)}),g.children.splice(T,1,...j)):j=[p],T+j.length}}function VR(e){const n=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const r=!e[0]||Array.isArray(e[0])?e:[e];let l=-1;for(;++l<r.length;){const s=r[l];n.push([XR(s[0]),KR(s[1])])}return n}function XR(e){return typeof e=="string"?new RegExp(qR(e),"g"):e}function KR(e){return typeof e=="function"?e:function(){return e}}const uh="phrasing",ch=["autolink","link","image","label"];function ZR(){return{transforms:[r3],enter:{literalAutolink:WR,literalAutolinkEmail:fh,literalAutolinkHttp:fh,literalAutolinkWww:fh},exit:{literalAutolink:n3,literalAutolinkEmail:t3,literalAutolinkHttp:JR,literalAutolinkWww:e3}}}function QR(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:uh,notInConstruct:ch},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:uh,notInConstruct:ch},{character:":",before:"[ps]",after:"\\/",inConstruct:uh,notInConstruct:ch}]}}function WR(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function fh(e){this.config.enter.autolinkProtocol.call(this,e)}function JR(e){this.config.exit.autolinkProtocol.call(this,e)}function e3(e){this.config.exit.data.call(this,e);const n=this.stack[this.stack.length-1];n.type,n.url="http://"+this.sliceSerialize(e)}function t3(e){this.config.exit.autolinkEmail.call(this,e)}function n3(e){this.exit(e)}function r3(e){YR(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,a3],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),l3]],{ignore:["link","linkReference"]})}function a3(e,n,r,l,s){let o="";if(!jv(s)||(/^w/i.test(n)&&(r=n+r,n="",o="http://"),!i3(r)))return!1;const u=s3(r+l);if(!u[0])return!1;const f={type:"link",title:null,url:o+n+u[0],children:[{type:"text",value:n+u[0]}]};return u[1]?[f,{type:"text",value:u[1]}]:f}function l3(e,n,r,l){return!jv(l,!0)||/[-\d_]$/.test(r)?!1:{type:"link",title:null,url:"mailto:"+n+"@"+r,children:[{type:"text",value:n+"@"+r}]}}function i3(e){const n=e.split(".");return!(n.length<2||n[n.length-1]&&(/_/.test(n[n.length-1])||!/[a-zA-Z\d]/.test(n[n.length-1]))||n[n.length-2]&&(/_/.test(n[n.length-2])||!/[a-zA-Z\d]/.test(n[n.length-2])))}function s3(e){const n=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!n)return[e,void 0];e=e.slice(0,n.index);let r=n[0],l=r.indexOf(")");const s=e1(e,"(");let o=e1(e,")");for(;l!==-1&&s>o;)e+=r.slice(0,l+1),r=r.slice(l+1),l=r.indexOf(")"),o++;return[e,r]}function jv(e,n){const r=e.input.charCodeAt(e.index-1);return(e.index===0||Tl(r)||xc(r))&&(!n||r!==47)}Mv.peek=g3;function o3(){this.buffer()}function u3(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function c3(){this.buffer()}function f3(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function d3(e){const n=this.resume(),r=this.stack[this.stack.length-1];r.type,r.identifier=Lr(this.sliceSerialize(e)).toLowerCase(),r.label=n}function h3(e){this.exit(e)}function p3(e){const n=this.resume(),r=this.stack[this.stack.length-1];r.type,r.identifier=Lr(this.sliceSerialize(e)).toLowerCase(),r.label=n}function m3(e){this.exit(e)}function g3(){return"["}function Mv(e,n,r,l){const s=r.createTracker(l);let o=s.move("[^");const u=r.enter("footnoteReference"),f=r.enter("reference");return o+=s.move(r.safe(r.associationId(e),{after:"]",before:o})),f(),u(),o+=s.move("]"),o}function x3(){return{enter:{gfmFootnoteCallString:o3,gfmFootnoteCall:u3,gfmFootnoteDefinitionLabelString:c3,gfmFootnoteDefinition:f3},exit:{gfmFootnoteCallString:d3,gfmFootnoteCall:h3,gfmFootnoteDefinitionLabelString:p3,gfmFootnoteDefinition:m3}}}function b3(e){let n=!1;return e&&e.firstLineBlank&&(n=!0),{handlers:{footnoteDefinition:r,footnoteReference:Mv},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function r(l,s,o,u){const f=o.createTracker(u);let d=f.move("[^");const p=o.enter("footnoteDefinition"),x=o.enter("label");return d+=f.move(o.safe(o.associationId(l),{before:d,after:"]"})),x(),d+=f.move("]:"),l.children&&l.children.length>0&&(f.shift(4),d+=f.move((n?`
|
|
28
|
+
`:" ")+o.indentLines(o.containerFlow(l,f.current()),n?Ov:y3))),p(),d}}function y3(e,n,r){return n===0?e:Ov(e,n,r)}function Ov(e,n,r){return(r?"":" ")+e}const v3=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Dv.peek=N3;function w3(){return{canContainEols:["delete"],enter:{strikethrough:S3},exit:{strikethrough:E3}}}function k3(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:v3}],handlers:{delete:Dv}}}function S3(e){this.enter({type:"delete",children:[]},e)}function E3(e){this.exit(e)}function Dv(e,n,r,l){const s=r.createTracker(l),o=r.enter("strikethrough");let u=s.move("~~");return u+=r.containerPhrasing(e,{...s.current(),before:u,after:"~"}),u+=s.move("~~"),o(),u}function N3(){return"~"}function _3(e){return e.length}function T3(e,n){const r=n||{},l=(r.align||[]).concat(),s=r.stringLength||_3,o=[],u=[],f=[],d=[];let p=0,x=-1;for(;++x<e.length;){const E=[],T=[];let N=-1;for(e[x].length>p&&(p=e[x].length);++N<e[x].length;){const j=A3(e[x][N]);if(r.alignDelimiters!==!1){const C=s(j);T[N]=C,(d[N]===void 0||C>d[N])&&(d[N]=C)}E.push(j)}u[x]=E,f[x]=T}let g=-1;if(typeof l=="object"&&"length"in l)for(;++g<p;)o[g]=t1(l[g]);else{const E=t1(l);for(;++g<p;)o[g]=E}g=-1;const y=[],v=[];for(;++g<p;){const E=o[g];let T="",N="";E===99?(T=":",N=":"):E===108?T=":":E===114&&(N=":");let j=r.alignDelimiters===!1?1:Math.max(1,d[g]-T.length-N.length);const C=T+"-".repeat(j)+N;r.alignDelimiters!==!1&&(j=T.length+j+N.length,j>d[g]&&(d[g]=j),v[g]=j),y[g]=C}u.splice(1,0,y),f.splice(1,0,v),x=-1;const S=[];for(;++x<u.length;){const E=u[x],T=f[x];g=-1;const N=[];for(;++g<p;){const j=E[g]||"";let C="",I="";if(r.alignDelimiters!==!1){const U=d[g]-(T[g]||0),_=o[g];_===114?C=" ".repeat(U):_===99?U%2?(C=" ".repeat(U/2+.5),I=" ".repeat(U/2-.5)):(C=" ".repeat(U/2),I=C):I=" ".repeat(U)}r.delimiterStart!==!1&&!g&&N.push("|"),r.padding!==!1&&!(r.alignDelimiters===!1&&j==="")&&(r.delimiterStart!==!1||g)&&N.push(" "),r.alignDelimiters!==!1&&N.push(C),N.push(j),r.alignDelimiters!==!1&&N.push(I),r.padding!==!1&&N.push(" "),(r.delimiterEnd!==!1||g!==p-1)&&N.push("|")}S.push(r.delimiterEnd===!1?N.join("").replace(/ +$/,""):N.join(""))}return S.join(`
|
|
29
|
+
`)}function A3(e){return e==null?"":String(e)}function t1(e){const n=typeof e=="string"?e.codePointAt(0):0;return n===67||n===99?99:n===76||n===108?108:n===82||n===114?114:0}function C3(e,n,r,l){const s=r.enter("blockquote"),o=r.createTracker(l);o.move("> "),o.shift(2);const u=r.indentLines(r.containerFlow(e,o.current()),R3);return s(),u}function R3(e,n,r){return">"+(r?"":" ")+e}function j3(e,n){return n1(e,n.inConstruct,!0)&&!n1(e,n.notInConstruct,!1)}function n1(e,n,r){if(typeof n=="string"&&(n=[n]),!n||n.length===0)return r;let l=-1;for(;++l<n.length;)if(e.includes(n[l]))return!0;return!1}function r1(e,n,r,l){let s=-1;for(;++s<r.unsafe.length;)if(r.unsafe[s].character===`
|
|
30
|
+
`&&j3(r.stack,r.unsafe[s]))return/[ \t]/.test(l.before)?"":" ";return`\\
|
|
31
|
+
`}function M3(e,n){const r=String(e);let l=r.indexOf(n),s=l,o=0,u=0;if(typeof n!="string")throw new TypeError("Expected substring");for(;l!==-1;)l===s?++o>u&&(u=o):o=1,s=l+n.length,l=r.indexOf(n,s);return u}function O3(e,n){return!!(n.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function D3(e){const n=e.options.fence||"`";if(n!=="`"&&n!=="~")throw new Error("Cannot serialize code with `"+n+"` for `options.fence`, expected `` ` `` or `~`");return n}function z3(e,n,r,l){const s=D3(r),o=e.value||"",u=s==="`"?"GraveAccent":"Tilde";if(O3(e,r)){const g=r.enter("codeIndented"),y=r.indentLines(o,L3);return g(),y}const f=r.createTracker(l),d=s.repeat(Math.max(M3(o,s)+1,3)),p=r.enter("codeFenced");let x=f.move(d);if(e.lang){const g=r.enter(`codeFencedLang${u}`);x+=f.move(r.safe(e.lang,{before:x,after:" ",encode:["`"],...f.current()})),g()}if(e.lang&&e.meta){const g=r.enter(`codeFencedMeta${u}`);x+=f.move(" "),x+=f.move(r.safe(e.meta,{before:x,after:`
|
|
32
|
+
`,encode:["`"],...f.current()})),g()}return x+=f.move(`
|
|
33
|
+
`),o&&(x+=f.move(o+`
|
|
34
|
+
`)),x+=f.move(d),p(),x}function L3(e,n,r){return(r?"":" ")+e}function Bp(e){const n=e.options.quote||'"';if(n!=='"'&&n!=="'")throw new Error("Cannot serialize title with `"+n+"` for `options.quote`, expected `\"`, or `'`");return n}function B3(e,n,r,l){const s=Bp(r),o=s==='"'?"Quote":"Apostrophe",u=r.enter("definition");let f=r.enter("label");const d=r.createTracker(l);let p=d.move("[");return p+=d.move(r.safe(r.associationId(e),{before:p,after:"]",...d.current()})),p+=d.move("]: "),f(),!e.url||/[\0- \u007F]/.test(e.url)?(f=r.enter("destinationLiteral"),p+=d.move("<"),p+=d.move(r.safe(e.url,{before:p,after:">",...d.current()})),p+=d.move(">")):(f=r.enter("destinationRaw"),p+=d.move(r.safe(e.url,{before:p,after:e.title?" ":`
|
|
35
|
+
`,...d.current()}))),f(),e.title&&(f=r.enter(`title${o}`),p+=d.move(" "+s),p+=d.move(r.safe(e.title,{before:p,after:s,...d.current()})),p+=d.move(s),f()),u(),p}function I3(e){const n=e.options.emphasis||"*";if(n!=="*"&&n!=="_")throw new Error("Cannot serialize emphasis with `"+n+"` for `options.emphasis`, expected `*`, or `_`");return n}function Js(e){return"&#x"+e.toString(16).toUpperCase()+";"}function lc(e,n,r){const l=Ri(e),s=Ri(n);return l===void 0?s===void 0?r==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:l===1?s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}zv.peek=U3;function zv(e,n,r,l){const s=I3(r),o=r.enter("emphasis"),u=r.createTracker(l),f=u.move(s);let d=u.move(r.containerPhrasing(e,{after:s,before:f,...u.current()}));const p=d.charCodeAt(0),x=lc(l.before.charCodeAt(l.before.length-1),p,s);x.inside&&(d=Js(p)+d.slice(1));const g=d.charCodeAt(d.length-1),y=lc(l.after.charCodeAt(0),g,s);y.inside&&(d=d.slice(0,-1)+Js(g));const v=u.move(s);return o(),r.attentionEncodeSurroundingInfo={after:y.outside,before:x.outside},f+d+v}function U3(e,n,r){return r.options.emphasis||"*"}function $3(e,n){let r=!1;return zp(e,function(l){if("value"in l&&/\r?\n|\r/.test(l.value)||l.type==="break")return r=!0,Vh}),!!((!e.depth||e.depth<3)&&Ap(e)&&(n.options.setext||r))}function H3(e,n,r,l){const s=Math.max(Math.min(6,e.depth||1),1),o=r.createTracker(l);if($3(e,r)){const x=r.enter("headingSetext"),g=r.enter("phrasing"),y=r.containerPhrasing(e,{...o.current(),before:`
|
|
36
|
+
`,after:`
|
|
37
|
+
`});return g(),x(),y+`
|
|
38
|
+
`+(s===1?"=":"-").repeat(y.length-(Math.max(y.lastIndexOf("\r"),y.lastIndexOf(`
|
|
39
|
+
`))+1))}const u="#".repeat(s),f=r.enter("headingAtx"),d=r.enter("phrasing");o.move(u+" ");let p=r.containerPhrasing(e,{before:"# ",after:`
|
|
40
|
+
`,...o.current()});return/^[\t ]/.test(p)&&(p=Js(p.charCodeAt(0))+p.slice(1)),p=p?u+" "+p:u,r.options.closeAtx&&(p+=" "+u),d(),f(),p}Lv.peek=P3;function Lv(e){return e.value||""}function P3(){return"<"}Bv.peek=F3;function Bv(e,n,r,l){const s=Bp(r),o=s==='"'?"Quote":"Apostrophe",u=r.enter("image");let f=r.enter("label");const d=r.createTracker(l);let p=d.move("![");return p+=d.move(r.safe(e.alt,{before:p,after:"]",...d.current()})),p+=d.move("]("),f(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(f=r.enter("destinationLiteral"),p+=d.move("<"),p+=d.move(r.safe(e.url,{before:p,after:">",...d.current()})),p+=d.move(">")):(f=r.enter("destinationRaw"),p+=d.move(r.safe(e.url,{before:p,after:e.title?" ":")",...d.current()}))),f(),e.title&&(f=r.enter(`title${o}`),p+=d.move(" "+s),p+=d.move(r.safe(e.title,{before:p,after:s,...d.current()})),p+=d.move(s),f()),p+=d.move(")"),u(),p}function F3(){return"!"}Iv.peek=G3;function Iv(e,n,r,l){const s=e.referenceType,o=r.enter("imageReference");let u=r.enter("label");const f=r.createTracker(l);let d=f.move("![");const p=r.safe(e.alt,{before:d,after:"]",...f.current()});d+=f.move(p+"]["),u();const x=r.stack;r.stack=[],u=r.enter("reference");const g=r.safe(r.associationId(e),{before:d,after:"]",...f.current()});return u(),r.stack=x,o(),s==="full"||!p||p!==g?d+=f.move(g+"]"):s==="shortcut"?d=d.slice(0,-1):d+=f.move("]"),d}function G3(){return"!"}Uv.peek=q3;function Uv(e,n,r){let l=e.value||"",s="`",o=-1;for(;new RegExp("(^|[^`])"+s+"([^`]|$)").test(l);)s+="`";for(/[^ \r\n]/.test(l)&&(/^[ \r\n]/.test(l)&&/[ \r\n]$/.test(l)||/^`|`$/.test(l))&&(l=" "+l+" ");++o<r.unsafe.length;){const u=r.unsafe[o],f=r.compilePattern(u);let d;if(u.atBreak)for(;d=f.exec(l);){let p=d.index;l.charCodeAt(p)===10&&l.charCodeAt(p-1)===13&&p--,l=l.slice(0,p)+" "+l.slice(d.index+1)}}return s+l+s}function q3(){return"`"}function $v(e,n){const r=Ap(e);return!!(!n.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(r===e.url||"mailto:"+r===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}Hv.peek=Y3;function Hv(e,n,r,l){const s=Bp(r),o=s==='"'?"Quote":"Apostrophe",u=r.createTracker(l);let f,d;if($v(e,r)){const x=r.stack;r.stack=[],f=r.enter("autolink");let g=u.move("<");return g+=u.move(r.containerPhrasing(e,{before:g,after:">",...u.current()})),g+=u.move(">"),f(),r.stack=x,g}f=r.enter("link"),d=r.enter("label");let p=u.move("[");return p+=u.move(r.containerPhrasing(e,{before:p,after:"](",...u.current()})),p+=u.move("]("),d(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(d=r.enter("destinationLiteral"),p+=u.move("<"),p+=u.move(r.safe(e.url,{before:p,after:">",...u.current()})),p+=u.move(">")):(d=r.enter("destinationRaw"),p+=u.move(r.safe(e.url,{before:p,after:e.title?" ":")",...u.current()}))),d(),e.title&&(d=r.enter(`title${o}`),p+=u.move(" "+s),p+=u.move(r.safe(e.title,{before:p,after:s,...u.current()})),p+=u.move(s),d()),p+=u.move(")"),f(),p}function Y3(e,n,r){return $v(e,r)?"<":"["}Pv.peek=V3;function Pv(e,n,r,l){const s=e.referenceType,o=r.enter("linkReference");let u=r.enter("label");const f=r.createTracker(l);let d=f.move("[");const p=r.containerPhrasing(e,{before:d,after:"]",...f.current()});d+=f.move(p+"]["),u();const x=r.stack;r.stack=[],u=r.enter("reference");const g=r.safe(r.associationId(e),{before:d,after:"]",...f.current()});return u(),r.stack=x,o(),s==="full"||!p||p!==g?d+=f.move(g+"]"):s==="shortcut"?d=d.slice(0,-1):d+=f.move("]"),d}function V3(){return"["}function Ip(e){const n=e.options.bullet||"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bullet`, expected `*`, `+`, or `-`");return n}function X3(e){const n=Ip(e),r=e.options.bulletOther;if(!r)return n==="*"?"-":"*";if(r!=="*"&&r!=="+"&&r!=="-")throw new Error("Cannot serialize items with `"+r+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(r===n)throw new Error("Expected `bullet` (`"+n+"`) and `bulletOther` (`"+r+"`) to be different");return r}function K3(e){const n=e.options.bulletOrdered||".";if(n!=="."&&n!==")")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOrdered`, expected `.` or `)`");return n}function Fv(e){const n=e.options.rule||"*";if(n!=="*"&&n!=="-"&&n!=="_")throw new Error("Cannot serialize rules with `"+n+"` for `options.rule`, expected `*`, `-`, or `_`");return n}function Z3(e,n,r,l){const s=r.enter("list"),o=r.bulletCurrent;let u=e.ordered?K3(r):Ip(r);const f=e.ordered?u==="."?")":".":X3(r);let d=n&&r.bulletLastUsed?u===r.bulletLastUsed:!1;if(!e.ordered){const x=e.children?e.children[0]:void 0;if((u==="*"||u==="-")&&x&&(!x.children||!x.children[0])&&r.stack[r.stack.length-1]==="list"&&r.stack[r.stack.length-2]==="listItem"&&r.stack[r.stack.length-3]==="list"&&r.stack[r.stack.length-4]==="listItem"&&r.indexStack[r.indexStack.length-1]===0&&r.indexStack[r.indexStack.length-2]===0&&r.indexStack[r.indexStack.length-3]===0&&(d=!0),Fv(r)===u&&x){let g=-1;for(;++g<e.children.length;){const y=e.children[g];if(y&&y.type==="listItem"&&y.children&&y.children[0]&&y.children[0].type==="thematicBreak"){d=!0;break}}}}d&&(u=f),r.bulletCurrent=u;const p=r.containerFlow(e,l);return r.bulletLastUsed=u,r.bulletCurrent=o,s(),p}function Q3(e){const n=e.options.listItemIndent||"one";if(n!=="tab"&&n!=="one"&&n!=="mixed")throw new Error("Cannot serialize items with `"+n+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return n}function W3(e,n,r,l){const s=Q3(r);let o=r.bulletCurrent||Ip(r);n&&n.type==="list"&&n.ordered&&(o=(typeof n.start=="number"&&n.start>-1?n.start:1)+(r.options.incrementListMarker===!1?0:n.children.indexOf(e))+o);let u=o.length+1;(s==="tab"||s==="mixed"&&(n&&n.type==="list"&&n.spread||e.spread))&&(u=Math.ceil(u/4)*4);const f=r.createTracker(l);f.move(o+" ".repeat(u-o.length)),f.shift(u);const d=r.enter("listItem"),p=r.indentLines(r.containerFlow(e,f.current()),x);return d(),p;function x(g,y,v){return y?(v?"":" ".repeat(u))+g:(v?o:o+" ".repeat(u-o.length))+g}}function J3(e,n,r,l){const s=r.enter("paragraph"),o=r.enter("phrasing"),u=r.containerPhrasing(e,l);return o(),s(),u}const ej=vc(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function tj(e,n,r,l){return(e.children.some(function(u){return ej(u)})?r.containerPhrasing:r.containerFlow).call(r,e,l)}function nj(e){const n=e.options.strong||"*";if(n!=="*"&&n!=="_")throw new Error("Cannot serialize strong with `"+n+"` for `options.strong`, expected `*`, or `_`");return n}Gv.peek=rj;function Gv(e,n,r,l){const s=nj(r),o=r.enter("strong"),u=r.createTracker(l),f=u.move(s+s);let d=u.move(r.containerPhrasing(e,{after:s,before:f,...u.current()}));const p=d.charCodeAt(0),x=lc(l.before.charCodeAt(l.before.length-1),p,s);x.inside&&(d=Js(p)+d.slice(1));const g=d.charCodeAt(d.length-1),y=lc(l.after.charCodeAt(0),g,s);y.inside&&(d=d.slice(0,-1)+Js(g));const v=u.move(s+s);return o(),r.attentionEncodeSurroundingInfo={after:y.outside,before:x.outside},f+d+v}function rj(e,n,r){return r.options.strong||"*"}function aj(e,n,r,l){return r.safe(e.value,l)}function lj(e){const n=e.options.ruleRepetition||3;if(n<3)throw new Error("Cannot serialize rules with repetition `"+n+"` for `options.ruleRepetition`, expected `3` or more");return n}function ij(e,n,r){const l=(Fv(r)+(r.options.ruleSpaces?" ":"")).repeat(lj(r));return r.options.ruleSpaces?l.slice(0,-1):l}const qv={blockquote:C3,break:r1,code:z3,definition:B3,emphasis:zv,hardBreak:r1,heading:H3,html:Lv,image:Bv,imageReference:Iv,inlineCode:Uv,link:Hv,linkReference:Pv,list:Z3,listItem:W3,paragraph:J3,root:tj,strong:Gv,text:aj,thematicBreak:ij};function sj(){return{enter:{table:oj,tableData:a1,tableHeader:a1,tableRow:cj},exit:{codeText:fj,table:uj,tableData:dh,tableHeader:dh,tableRow:dh}}}function oj(e){const n=e._align;this.enter({type:"table",align:n.map(function(r){return r==="none"?null:r}),children:[]},e),this.data.inTable=!0}function uj(e){this.exit(e),this.data.inTable=void 0}function cj(e){this.enter({type:"tableRow",children:[]},e)}function dh(e){this.exit(e)}function a1(e){this.enter({type:"tableCell",children:[]},e)}function fj(e){let n=this.resume();this.data.inTable&&(n=n.replace(/\\([\\|])/g,dj));const r=this.stack[this.stack.length-1];r.type,r.value=n,this.exit(e)}function dj(e,n){return n==="|"?n:e}function hj(e){const n=e||{},r=n.tableCellPadding,l=n.tablePipeAlign,s=n.stringLength,o=r?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
41
|
+
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:y,table:u,tableCell:d,tableRow:f}};function u(v,S,E,T){return p(x(v,E,T),v.align)}function f(v,S,E,T){const N=g(v,E,T),j=p([N]);return j.slice(0,j.indexOf(`
|
|
42
|
+
`))}function d(v,S,E,T){const N=E.enter("tableCell"),j=E.enter("phrasing"),C=E.containerPhrasing(v,{...T,before:o,after:o});return j(),N(),C}function p(v,S){return T3(v,{align:S,alignDelimiters:l,padding:r,stringLength:s})}function x(v,S,E){const T=v.children;let N=-1;const j=[],C=S.enter("table");for(;++N<T.length;)j[N]=g(T[N],S,E);return C(),j}function g(v,S,E){const T=v.children;let N=-1;const j=[],C=S.enter("tableRow");for(;++N<T.length;)j[N]=d(T[N],v,S,E);return C(),j}function y(v,S,E){let T=qv.inlineCode(v,S,E);return E.stack.includes("tableCell")&&(T=T.replace(/\|/g,"\\$&")),T}}function pj(){return{exit:{taskListCheckValueChecked:l1,taskListCheckValueUnchecked:l1,paragraph:gj}}}function mj(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:xj}}}function l1(e){const n=this.stack[this.stack.length-2];n.type,n.checked=e.type==="taskListCheckValueChecked"}function gj(e){const n=this.stack[this.stack.length-2];if(n&&n.type==="listItem"&&typeof n.checked=="boolean"){const r=this.stack[this.stack.length-1];r.type;const l=r.children[0];if(l&&l.type==="text"){const s=n.children;let o=-1,u;for(;++o<s.length;){const f=s[o];if(f.type==="paragraph"){u=f;break}}u===r&&(l.value=l.value.slice(1),l.value.length===0?r.children.shift():r.position&&l.position&&typeof l.position.start.offset=="number"&&(l.position.start.column++,l.position.start.offset++,r.position.start=Object.assign({},l.position.start)))}}this.exit(e)}function xj(e,n,r,l){const s=e.children[0],o=typeof e.checked=="boolean"&&s&&s.type==="paragraph",u="["+(e.checked?"x":" ")+"] ",f=r.createTracker(l);o&&f.move(u);let d=qv.listItem(e,n,r,{...l,...f.current()});return o&&(d=d.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,p)),d;function p(x){return x+u}}function bj(){return[ZR(),x3(),w3(),sj(),pj()]}function yj(e){return{extensions:[QR(),b3(e),k3(),hj(e),mj()]}}const vj={tokenize:_j,partial:!0},Yv={tokenize:Tj,partial:!0},Vv={tokenize:Aj,partial:!0},Xv={tokenize:Cj,partial:!0},wj={tokenize:Rj,partial:!0},Kv={name:"wwwAutolink",tokenize:Ej,previous:Qv},Zv={name:"protocolAutolink",tokenize:Nj,previous:Wv},Sa={name:"emailAutolink",tokenize:Sj,previous:Jv},Jr={};function kj(){return{text:Jr}}let El=48;for(;El<123;)Jr[El]=Sa,El++,El===58?El=65:El===91&&(El=97);Jr[43]=Sa;Jr[45]=Sa;Jr[46]=Sa;Jr[95]=Sa;Jr[72]=[Sa,Zv];Jr[104]=[Sa,Zv];Jr[87]=[Sa,Kv];Jr[119]=[Sa,Kv];function Sj(e,n,r){const l=this;let s,o;return u;function u(g){return!Qh(g)||!Jv.call(l,l.previous)||Up(l.events)?r(g):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),f(g))}function f(g){return Qh(g)?(e.consume(g),f):g===64?(e.consume(g),d):r(g)}function d(g){return g===46?e.check(wj,x,p)(g):g===45||g===95||jn(g)?(o=!0,e.consume(g),d):x(g)}function p(g){return e.consume(g),s=!0,d}function x(g){return o&&s&&In(l.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),n(g)):r(g)}}function Ej(e,n,r){const l=this;return s;function s(u){return u!==87&&u!==119||!Qv.call(l,l.previous)||Up(l.events)?r(u):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(vj,e.attempt(Yv,e.attempt(Vv,o),r),r)(u))}function o(u){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),n(u)}}function Nj(e,n,r){const l=this;let s="",o=!1;return u;function u(g){return(g===72||g===104)&&Wv.call(l,l.previous)&&!Up(l.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),s+=String.fromCodePoint(g),e.consume(g),f):r(g)}function f(g){if(In(g)&&s.length<5)return s+=String.fromCodePoint(g),e.consume(g),f;if(g===58){const y=s.toLowerCase();if(y==="http"||y==="https")return e.consume(g),d}return r(g)}function d(g){return g===47?(e.consume(g),o?p:(o=!0,d)):r(g)}function p(g){return g===null||nc(g)||zt(g)||Tl(g)||xc(g)?r(g):e.attempt(Yv,e.attempt(Vv,x),r)(g)}function x(g){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),n(g)}}function _j(e,n,r){let l=0;return s;function s(u){return(u===87||u===119)&&l<3?(l++,e.consume(u),s):u===46&&l===3?(e.consume(u),o):r(u)}function o(u){return u===null?r(u):n(u)}}function Tj(e,n,r){let l,s,o;return u;function u(p){return p===46||p===95?e.check(Xv,d,f)(p):p===null||zt(p)||Tl(p)||p!==45&&xc(p)?d(p):(o=!0,e.consume(p),u)}function f(p){return p===95?l=!0:(s=l,l=void 0),e.consume(p),u}function d(p){return s||l||!o?r(p):n(p)}}function Aj(e,n){let r=0,l=0;return s;function s(u){return u===40?(r++,e.consume(u),s):u===41&&l<r?o(u):u===33||u===34||u===38||u===39||u===41||u===42||u===44||u===46||u===58||u===59||u===60||u===63||u===93||u===95||u===126?e.check(Xv,n,o)(u):u===null||zt(u)||Tl(u)?n(u):(e.consume(u),s)}function o(u){return u===41&&l++,e.consume(u),s}}function Cj(e,n,r){return l;function l(f){return f===33||f===34||f===39||f===41||f===42||f===44||f===46||f===58||f===59||f===63||f===95||f===126?(e.consume(f),l):f===38?(e.consume(f),o):f===93?(e.consume(f),s):f===60||f===null||zt(f)||Tl(f)?n(f):r(f)}function s(f){return f===null||f===40||f===91||zt(f)||Tl(f)?n(f):l(f)}function o(f){return In(f)?u(f):r(f)}function u(f){return f===59?(e.consume(f),l):In(f)?(e.consume(f),u):r(f)}}function Rj(e,n,r){return l;function l(o){return e.consume(o),s}function s(o){return jn(o)?r(o):n(o)}}function Qv(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||zt(e)}function Wv(e){return!In(e)}function Jv(e){return!(e===47||Qh(e))}function Qh(e){return e===43||e===45||e===46||e===95||jn(e)}function Up(e){let n=e.length,r=!1;for(;n--;){const l=e[n][1];if((l.type==="labelLink"||l.type==="labelImage")&&!l._balanced){r=!0;break}if(l._gfmAutolinkLiteralWalkedInto){r=!1;break}}return e.length>0&&!r&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),r}const jj={tokenize:Uj,partial:!0};function Mj(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:Lj,continuation:{tokenize:Bj},exit:Ij}},text:{91:{name:"gfmFootnoteCall",tokenize:zj},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:Oj,resolveTo:Dj}}}}function Oj(e,n,r){const l=this;let s=l.events.length;const o=l.parser.gfmFootnotes||(l.parser.gfmFootnotes=[]);let u;for(;s--;){const d=l.events[s][1];if(d.type==="labelImage"){u=d;break}if(d.type==="gfmFootnoteCall"||d.type==="labelLink"||d.type==="label"||d.type==="image"||d.type==="link")break}return f;function f(d){if(!u||!u._balanced)return r(d);const p=Lr(l.sliceSerialize({start:u.end,end:l.now()}));return p.codePointAt(0)!==94||!o.includes(p.slice(1))?r(d):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),n(d))}}function Dj(e,n){let r=e.length;for(;r--;)if(e[r][1].type==="labelImage"&&e[r][0]==="enter"){e[r][1];break}e[r+1][1].type="data",e[r+3][1].type="gfmFootnoteCallLabelMarker";const l={type:"gfmFootnoteCall",start:Object.assign({},e[r+3][1].start),end:Object.assign({},e[e.length-1][1].end)},s={type:"gfmFootnoteCallMarker",start:Object.assign({},e[r+3][1].end),end:Object.assign({},e[r+3][1].end)};s.end.column++,s.end.offset++,s.end._bufferIndex++;const o={type:"gfmFootnoteCallString",start:Object.assign({},s.end),end:Object.assign({},e[e.length-1][1].start)},u={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},f=[e[r+1],e[r+2],["enter",l,n],e[r+3],e[r+4],["enter",s,n],["exit",s,n],["enter",o,n],["enter",u,n],["exit",u,n],["exit",o,n],e[e.length-2],e[e.length-1],["exit",l,n]];return e.splice(r,e.length-r+1,...f),e}function zj(e,n,r){const l=this,s=l.parser.gfmFootnotes||(l.parser.gfmFootnotes=[]);let o=0,u;return f;function f(g){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(g),e.exit("gfmFootnoteCallLabelMarker"),d}function d(g){return g!==94?r(g):(e.enter("gfmFootnoteCallMarker"),e.consume(g),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",p)}function p(g){if(o>999||g===93&&!u||g===null||g===91||zt(g))return r(g);if(g===93){e.exit("chunkString");const y=e.exit("gfmFootnoteCallString");return s.includes(Lr(l.sliceSerialize(y)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(g),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),n):r(g)}return zt(g)||(u=!0),o++,e.consume(g),g===92?x:p}function x(g){return g===91||g===92||g===93?(e.consume(g),o++,p):p(g)}}function Lj(e,n,r){const l=this,s=l.parser.gfmFootnotes||(l.parser.gfmFootnotes=[]);let o,u=0,f;return d;function d(S){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(S),e.exit("gfmFootnoteDefinitionLabelMarker"),p}function p(S){return S===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(S),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",x):r(S)}function x(S){if(u>999||S===93&&!f||S===null||S===91||zt(S))return r(S);if(S===93){e.exit("chunkString");const E=e.exit("gfmFootnoteDefinitionLabelString");return o=Lr(l.sliceSerialize(E)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(S),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),y}return zt(S)||(f=!0),u++,e.consume(S),S===92?g:x}function g(S){return S===91||S===92||S===93?(e.consume(S),u++,x):x(S)}function y(S){return S===58?(e.enter("definitionMarker"),e.consume(S),e.exit("definitionMarker"),s.includes(o)||s.push(o),dt(e,v,"gfmFootnoteDefinitionWhitespace")):r(S)}function v(S){return n(S)}}function Bj(e,n,r){return e.check(co,n,e.attempt(jj,n,r))}function Ij(e){e.exit("gfmFootnoteDefinition")}function Uj(e,n,r){const l=this;return dt(e,s,"gfmFootnoteDefinitionIndent",5);function s(o){const u=l.events[l.events.length-1];return u&&u[1].type==="gfmFootnoteDefinitionIndent"&&u[2].sliceSerialize(u[1],!0).length===4?n(o):r(o)}}function $j(e){let r=(e||{}).singleTilde;const l={name:"strikethrough",tokenize:o,resolveAll:s};return r==null&&(r=!0),{text:{126:l},insideSpan:{null:[l]},attentionMarkers:{null:[126]}};function s(u,f){let d=-1;for(;++d<u.length;)if(u[d][0]==="enter"&&u[d][1].type==="strikethroughSequenceTemporary"&&u[d][1]._close){let p=d;for(;p--;)if(u[p][0]==="exit"&&u[p][1].type==="strikethroughSequenceTemporary"&&u[p][1]._open&&u[d][1].end.offset-u[d][1].start.offset===u[p][1].end.offset-u[p][1].start.offset){u[d][1].type="strikethroughSequence",u[p][1].type="strikethroughSequence";const x={type:"strikethrough",start:Object.assign({},u[p][1].start),end:Object.assign({},u[d][1].end)},g={type:"strikethroughText",start:Object.assign({},u[p][1].end),end:Object.assign({},u[d][1].start)},y=[["enter",x,f],["enter",u[p][1],f],["exit",u[p][1],f],["enter",g,f]],v=f.parser.constructs.insideSpan.null;v&&hr(y,y.length,0,bc(v,u.slice(p+1,d),f)),hr(y,y.length,0,[["exit",g,f],["enter",u[d][1],f],["exit",u[d][1],f],["exit",x,f]]),hr(u,p-1,d-p+3,y),d=p+y.length-2;break}}for(d=-1;++d<u.length;)u[d][1].type==="strikethroughSequenceTemporary"&&(u[d][1].type="data");return u}function o(u,f,d){const p=this.previous,x=this.events;let g=0;return y;function y(S){return p===126&&x[x.length-1][1].type!=="characterEscape"?d(S):(u.enter("strikethroughSequenceTemporary"),v(S))}function v(S){const E=Ri(p);if(S===126)return g>1?d(S):(u.consume(S),g++,v);if(g<2&&!r)return d(S);const T=u.exit("strikethroughSequenceTemporary"),N=Ri(S);return T._open=!N||N===2&&!!E,T._close=!E||E===2&&!!N,f(S)}}}class Hj{constructor(){this.map=[]}add(n,r,l){Pj(this,n,r,l)}consume(n){if(this.map.sort(function(o,u){return o[0]-u[0]}),this.map.length===0)return;let r=this.map.length;const l=[];for(;r>0;)r-=1,l.push(n.slice(this.map[r][0]+this.map[r][1]),this.map[r][2]),n.length=this.map[r][0];l.push(n.slice()),n.length=0;let s=l.pop();for(;s;){for(const o of s)n.push(o);s=l.pop()}this.map.length=0}}function Pj(e,n,r,l){let s=0;if(!(r===0&&l.length===0)){for(;s<e.map.length;){if(e.map[s][0]===n){e.map[s][1]+=r,e.map[s][2].push(...l);return}s+=1}e.map.push([n,r,l])}}function Fj(e,n){let r=!1;const l=[];for(;n<e.length;){const s=e[n];if(r){if(s[0]==="enter")s[1].type==="tableContent"&&l.push(e[n+1][1].type==="tableDelimiterMarker"?"left":"none");else if(s[1].type==="tableContent"){if(e[n-1][1].type==="tableDelimiterMarker"){const o=l.length-1;l[o]=l[o]==="left"?"center":"right"}}else if(s[1].type==="tableDelimiterRow")break}else s[0]==="enter"&&s[1].type==="tableDelimiterRow"&&(r=!0);n+=1}return l}function Gj(){return{flow:{null:{name:"table",tokenize:qj,resolveAll:Yj}}}}function qj(e,n,r){const l=this;let s=0,o=0,u;return f;function f(B){let q=l.events.length-1;for(;q>-1;){const ae=l.events[q][1].type;if(ae==="lineEnding"||ae==="linePrefix")q--;else break}const Z=q>-1?l.events[q][1].type:null,ee=Z==="tableHead"||Z==="tableRow"?_:d;return ee===_&&l.parser.lazy[l.now().line]?r(B):ee(B)}function d(B){return e.enter("tableHead"),e.enter("tableRow"),p(B)}function p(B){return B===124||(u=!0,o+=1),x(B)}function x(B){return B===null?r(B):$e(B)?o>1?(o=0,l.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(B),e.exit("lineEnding"),v):r(B):it(B)?dt(e,x,"whitespace")(B):(o+=1,u&&(u=!1,s+=1),B===124?(e.enter("tableCellDivider"),e.consume(B),e.exit("tableCellDivider"),u=!0,x):(e.enter("data"),g(B)))}function g(B){return B===null||B===124||zt(B)?(e.exit("data"),x(B)):(e.consume(B),B===92?y:g)}function y(B){return B===92||B===124?(e.consume(B),g):g(B)}function v(B){return l.interrupt=!1,l.parser.lazy[l.now().line]?r(B):(e.enter("tableDelimiterRow"),u=!1,it(B)?dt(e,S,"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(B):S(B))}function S(B){return B===45||B===58?T(B):B===124?(u=!0,e.enter("tableCellDivider"),e.consume(B),e.exit("tableCellDivider"),E):U(B)}function E(B){return it(B)?dt(e,T,"whitespace")(B):T(B)}function T(B){return B===58?(o+=1,u=!0,e.enter("tableDelimiterMarker"),e.consume(B),e.exit("tableDelimiterMarker"),N):B===45?(o+=1,N(B)):B===null||$e(B)?I(B):U(B)}function N(B){return B===45?(e.enter("tableDelimiterFiller"),j(B)):U(B)}function j(B){return B===45?(e.consume(B),j):B===58?(u=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(B),e.exit("tableDelimiterMarker"),C):(e.exit("tableDelimiterFiller"),C(B))}function C(B){return it(B)?dt(e,I,"whitespace")(B):I(B)}function I(B){return B===124?S(B):B===null||$e(B)?!u||s!==o?U(B):(e.exit("tableDelimiterRow"),e.exit("tableHead"),n(B)):U(B)}function U(B){return r(B)}function _(B){return e.enter("tableRow"),z(B)}function z(B){return B===124?(e.enter("tableCellDivider"),e.consume(B),e.exit("tableCellDivider"),z):B===null||$e(B)?(e.exit("tableRow"),n(B)):it(B)?dt(e,z,"whitespace")(B):(e.enter("data"),P(B))}function P(B){return B===null||B===124||zt(B)?(e.exit("data"),z(B)):(e.consume(B),B===92?X:P)}function X(B){return B===92||B===124?(e.consume(B),P):P(B)}}function Yj(e,n){let r=-1,l=!0,s=0,o=[0,0,0,0],u=[0,0,0,0],f=!1,d=0,p,x,g;const y=new Hj;for(;++r<e.length;){const v=e[r],S=v[1];v[0]==="enter"?S.type==="tableHead"?(f=!1,d!==0&&(i1(y,n,d,p,x),x=void 0,d=0),p={type:"table",start:Object.assign({},S.start),end:Object.assign({},S.end)},y.add(r,0,[["enter",p,n]])):S.type==="tableRow"||S.type==="tableDelimiterRow"?(l=!0,g=void 0,o=[0,0,0,0],u=[0,r+1,0,0],f&&(f=!1,x={type:"tableBody",start:Object.assign({},S.start),end:Object.assign({},S.end)},y.add(r,0,[["enter",x,n]])),s=S.type==="tableDelimiterRow"?2:x?3:1):s&&(S.type==="data"||S.type==="tableDelimiterMarker"||S.type==="tableDelimiterFiller")?(l=!1,u[2]===0&&(o[1]!==0&&(u[0]=u[1],g=Ou(y,n,o,s,void 0,g),o=[0,0,0,0]),u[2]=r)):S.type==="tableCellDivider"&&(l?l=!1:(o[1]!==0&&(u[0]=u[1],g=Ou(y,n,o,s,void 0,g)),o=u,u=[o[1],r,0,0])):S.type==="tableHead"?(f=!0,d=r):S.type==="tableRow"||S.type==="tableDelimiterRow"?(d=r,o[1]!==0?(u[0]=u[1],g=Ou(y,n,o,s,r,g)):u[1]!==0&&(g=Ou(y,n,u,s,r,g)),s=0):s&&(S.type==="data"||S.type==="tableDelimiterMarker"||S.type==="tableDelimiterFiller")&&(u[3]=r)}for(d!==0&&i1(y,n,d,p,x),y.consume(n.events),r=-1;++r<n.events.length;){const v=n.events[r];v[0]==="enter"&&v[1].type==="table"&&(v[1]._align=Fj(n.events,r))}return e}function Ou(e,n,r,l,s,o){const u=l===1?"tableHeader":l===2?"tableDelimiter":"tableData",f="tableContent";r[0]!==0&&(o.end=Object.assign({},wi(n.events,r[0])),e.add(r[0],0,[["exit",o,n]]));const d=wi(n.events,r[1]);if(o={type:u,start:Object.assign({},d),end:Object.assign({},d)},e.add(r[1],0,[["enter",o,n]]),r[2]!==0){const p=wi(n.events,r[2]),x=wi(n.events,r[3]),g={type:f,start:Object.assign({},p),end:Object.assign({},x)};if(e.add(r[2],0,[["enter",g,n]]),l!==2){const y=n.events[r[2]],v=n.events[r[3]];if(y[1].end=Object.assign({},v[1].end),y[1].type="chunkText",y[1].contentType="text",r[3]>r[2]+1){const S=r[2]+1,E=r[3]-r[2]-1;e.add(S,E,[])}}e.add(r[3]+1,0,[["exit",g,n]])}return s!==void 0&&(o.end=Object.assign({},wi(n.events,s)),e.add(s,0,[["exit",o,n]]),o=void 0),o}function i1(e,n,r,l,s){const o=[],u=wi(n.events,r);s&&(s.end=Object.assign({},u),o.push(["exit",s,n])),l.end=Object.assign({},u),o.push(["exit",l,n]),e.add(r+1,0,o)}function wi(e,n){const r=e[n],l=r[0]==="enter"?"start":"end";return r[1][l]}const Vj={name:"tasklistCheck",tokenize:Kj};function Xj(){return{text:{91:Vj}}}function Kj(e,n,r){const l=this;return s;function s(d){return l.previous!==null||!l._gfmTasklistFirstContentOfListItem?r(d):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(d),e.exit("taskListCheckMarker"),o)}function o(d){return zt(d)?(e.enter("taskListCheckValueUnchecked"),e.consume(d),e.exit("taskListCheckValueUnchecked"),u):d===88||d===120?(e.enter("taskListCheckValueChecked"),e.consume(d),e.exit("taskListCheckValueChecked"),u):r(d)}function u(d){return d===93?(e.enter("taskListCheckMarker"),e.consume(d),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),f):r(d)}function f(d){return $e(d)?n(d):it(d)?e.check({tokenize:Zj},n,r)(d):r(d)}}function Zj(e,n,r){return dt(e,l,"whitespace");function l(s){return s===null?r(s):n(s)}}function Qj(e){return cv([kj(),Mj(),$j(e),Gj(),Xj()])}const Wj={};function Jj(e){const n=this,r=e||Wj,l=n.data(),s=l.micromarkExtensions||(l.micromarkExtensions=[]),o=l.fromMarkdownExtensions||(l.fromMarkdownExtensions=[]),u=l.toMarkdownExtensions||(l.toMarkdownExtensions=[]);s.push(Qj(r)),o.push(bj()),u.push(yj(r))}var hh,s1;function eM(){if(s1)return hh;s1=1;function e(H){return H instanceof Map?H.clear=H.delete=H.set=function(){throw new Error("map is read-only")}:H instanceof Set&&(H.add=H.clear=H.delete=function(){throw new Error("set is read-only")}),Object.freeze(H),Object.getOwnPropertyNames(H).forEach(ue=>{const pe=H[ue],Le=typeof pe;(Le==="object"||Le==="function")&&!Object.isFrozen(pe)&&e(pe)}),H}class n{constructor(ue){ue.data===void 0&&(ue.data={}),this.data=ue.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function r(H){return H.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function l(H,...ue){const pe=Object.create(null);for(const Le in H)pe[Le]=H[Le];return ue.forEach(function(Le){for(const vt in Le)pe[vt]=Le[vt]}),pe}const s="</span>",o=H=>!!H.scope,u=(H,{prefix:ue})=>{if(H.startsWith("language:"))return H.replace("language:","language-");if(H.includes(".")){const pe=H.split(".");return[`${ue}${pe.shift()}`,...pe.map((Le,vt)=>`${Le}${"_".repeat(vt+1)}`)].join(" ")}return`${ue}${H}`};class f{constructor(ue,pe){this.buffer="",this.classPrefix=pe.classPrefix,ue.walk(this)}addText(ue){this.buffer+=r(ue)}openNode(ue){if(!o(ue))return;const pe=u(ue.scope,{prefix:this.classPrefix});this.span(pe)}closeNode(ue){o(ue)&&(this.buffer+=s)}value(){return this.buffer}span(ue){this.buffer+=`<span class="${ue}">`}}const d=(H={})=>{const ue={children:[]};return Object.assign(ue,H),ue};class p{constructor(){this.rootNode=d(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(ue){this.top.children.push(ue)}openNode(ue){const pe=d({scope:ue});this.add(pe),this.stack.push(pe)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(ue){return this.constructor._walk(ue,this.rootNode)}static _walk(ue,pe){return typeof pe=="string"?ue.addText(pe):pe.children&&(ue.openNode(pe),pe.children.forEach(Le=>this._walk(ue,Le)),ue.closeNode(pe)),ue}static _collapse(ue){typeof ue!="string"&&ue.children&&(ue.children.every(pe=>typeof pe=="string")?ue.children=[ue.children.join("")]:ue.children.forEach(pe=>{p._collapse(pe)}))}}class x extends p{constructor(ue){super(),this.options=ue}addText(ue){ue!==""&&this.add(ue)}startScope(ue){this.openNode(ue)}endScope(){this.closeNode()}__addSublanguage(ue,pe){const Le=ue.root;pe&&(Le.scope=`language:${pe}`),this.add(Le)}toHTML(){return new f(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function g(H){return H?typeof H=="string"?H:H.source:null}function y(H){return E("(?=",H,")")}function v(H){return E("(?:",H,")*")}function S(H){return E("(?:",H,")?")}function E(...H){return H.map(pe=>g(pe)).join("")}function T(H){const ue=H[H.length-1];return typeof ue=="object"&&ue.constructor===Object?(H.splice(H.length-1,1),ue):{}}function N(...H){return"("+(T(H).capture?"":"?:")+H.map(Le=>g(Le)).join("|")+")"}function j(H){return new RegExp(H.toString()+"|").exec("").length-1}function C(H,ue){const pe=H&&H.exec(ue);return pe&&pe.index===0}const I=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function U(H,{joinWith:ue}){let pe=0;return H.map(Le=>{pe+=1;const vt=pe;let ft=g(Le),Ce="";for(;ft.length>0;){const Ee=I.exec(ft);if(!Ee){Ce+=ft;break}Ce+=ft.substring(0,Ee.index),ft=ft.substring(Ee.index+Ee[0].length),Ee[0][0]==="\\"&&Ee[1]?Ce+="\\"+String(Number(Ee[1])+vt):(Ce+=Ee[0],Ee[0]==="("&&pe++)}return Ce}).map(Le=>`(${Le})`).join(ue)}const _=/\b\B/,z="[a-zA-Z]\\w*",P="[a-zA-Z_]\\w*",X="\\b\\d+(\\.\\d+)?",B="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",q="\\b(0b[01]+)",Z="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",ee=(H={})=>{const ue=/^#![ ]*\//;return H.binary&&(H.begin=E(ue,/.*\b/,H.binary,/\b.*/)),l({scope:"meta",begin:ue,end:/$/,relevance:0,"on:begin":(pe,Le)=>{pe.index!==0&&Le.ignoreMatch()}},H)},ae={begin:"\\\\[\\s\\S]",relevance:0},Y={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[ae]},M={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[ae]},K={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},le=function(H,ue,pe={}){const Le=l({scope:"comment",begin:H,end:ue,contains:[]},pe);Le.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const vt=N("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return Le.contains.push({begin:E(/[ ]+/,"(",vt,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),Le},be=le("//","$"),O=le("/\\*","\\*/"),D=le("#","$"),L={scope:"number",begin:X,relevance:0},A={scope:"number",begin:B,relevance:0},se={scope:"number",begin:q,relevance:0},te={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[ae,{begin:/\[/,end:/\]/,relevance:0,contains:[ae]}]},ie={scope:"title",begin:z,relevance:0},Se={scope:"title",begin:P,relevance:0},je={begin:"\\.\\s*"+P,relevance:0};var qe=Object.freeze({__proto__:null,APOS_STRING_MODE:Y,BACKSLASH_ESCAPE:ae,BINARY_NUMBER_MODE:se,BINARY_NUMBER_RE:q,COMMENT:le,C_BLOCK_COMMENT_MODE:O,C_LINE_COMMENT_MODE:be,C_NUMBER_MODE:A,C_NUMBER_RE:B,END_SAME_AS_BEGIN:function(H){return Object.assign(H,{"on:begin":(ue,pe)=>{pe.data._beginMatch=ue[1]},"on:end":(ue,pe)=>{pe.data._beginMatch!==ue[1]&&pe.ignoreMatch()}})},HASH_COMMENT_MODE:D,IDENT_RE:z,MATCH_NOTHING_RE:_,METHOD_GUARD:je,NUMBER_MODE:L,NUMBER_RE:X,PHRASAL_WORDS_MODE:K,QUOTE_STRING_MODE:M,REGEXP_MODE:te,RE_STARTERS_RE:Z,SHEBANG:ee,TITLE_MODE:ie,UNDERSCORE_IDENT_RE:P,UNDERSCORE_TITLE_MODE:Se});function we(H,ue){H.input[H.index-1]==="."&&ue.ignoreMatch()}function Ve(H,ue){H.className!==void 0&&(H.scope=H.className,delete H.className)}function Lt(H,ue){ue&&H.beginKeywords&&(H.begin="\\b("+H.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",H.__beforeBegin=we,H.keywords=H.keywords||H.beginKeywords,delete H.beginKeywords,H.relevance===void 0&&(H.relevance=0))}function he(H,ue){Array.isArray(H.illegal)&&(H.illegal=N(...H.illegal))}function xe(H,ue){if(H.match){if(H.begin||H.end)throw new Error("begin & end are not supported with match");H.begin=H.match,delete H.match}}function _e(H,ue){H.relevance===void 0&&(H.relevance=1)}const et=(H,ue)=>{if(!H.beforeMatch)return;if(H.starts)throw new Error("beforeMatch cannot be used with starts");const pe=Object.assign({},H);Object.keys(H).forEach(Le=>{delete H[Le]}),H.keywords=pe.keywords,H.begin=E(pe.beforeMatch,y(pe.begin)),H.starts={relevance:0,contains:[Object.assign(pe,{endsParent:!0})]},H.relevance=0,delete pe.beforeMatch},St=["of","and","for","in","not","or","if","then","parent","list","value"],xn="keyword";function Ot(H,ue,pe=xn){const Le=Object.create(null);return typeof H=="string"?vt(pe,H.split(" ")):Array.isArray(H)?vt(pe,H):Object.keys(H).forEach(function(ft){Object.assign(Le,Ot(H[ft],ue,ft))}),Le;function vt(ft,Ce){ue&&(Ce=Ce.map(Ee=>Ee.toLowerCase())),Ce.forEach(function(Ee){const Ie=Ee.split("|");Le[Ie[0]]=[ft,pr(Ie[0],Ie[1])]})}}function pr(H,ue){return ue?Number(ue):On(H)?0:1}function On(H){return St.includes(H.toLowerCase())}const Dn={},Et=H=>{console.error(H)},bn=(H,...ue)=>{console.log(`WARN: ${H}`,...ue)},re=(H,ue)=>{Dn[`${H}/${ue}`]||(console.log(`Deprecated as of ${H}. ${ue}`),Dn[`${H}/${ue}`]=!0)},me=new Error;function Me(H,ue,{key:pe}){let Le=0;const vt=H[pe],ft={},Ce={};for(let Ee=1;Ee<=ue.length;Ee++)Ce[Ee+Le]=vt[Ee],ft[Ee+Le]=!0,Le+=j(ue[Ee-1]);H[pe]=Ce,H[pe]._emit=ft,H[pe]._multi=!0}function Ge(H){if(Array.isArray(H.begin)){if(H.skip||H.excludeBegin||H.returnBegin)throw Et("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),me;if(typeof H.beginScope!="object"||H.beginScope===null)throw Et("beginScope must be object"),me;Me(H,H.begin,{key:"beginScope"}),H.begin=U(H.begin,{joinWith:""})}}function nt(H){if(Array.isArray(H.end)){if(H.skip||H.excludeEnd||H.returnEnd)throw Et("skip, excludeEnd, returnEnd not compatible with endScope: {}"),me;if(typeof H.endScope!="object"||H.endScope===null)throw Et("endScope must be object"),me;Me(H,H.end,{key:"endScope"}),H.end=U(H.end,{joinWith:""})}}function Jt(H){H.scope&&typeof H.scope=="object"&&H.scope!==null&&(H.beginScope=H.scope,delete H.scope)}function _n(H){Jt(H),typeof H.beginScope=="string"&&(H.beginScope={_wrap:H.beginScope}),typeof H.endScope=="string"&&(H.endScope={_wrap:H.endScope}),Ge(H),nt(H)}function qt(H){function ue(Ce,Ee){return new RegExp(g(Ce),"m"+(H.case_insensitive?"i":"")+(H.unicodeRegex?"u":"")+(Ee?"g":""))}class pe{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(Ee,Ie){Ie.position=this.position++,this.matchIndexes[this.matchAt]=Ie,this.regexes.push([Ie,Ee]),this.matchAt+=j(Ee)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const Ee=this.regexes.map(Ie=>Ie[1]);this.matcherRe=ue(U(Ee,{joinWith:"|"}),!0),this.lastIndex=0}exec(Ee){this.matcherRe.lastIndex=this.lastIndex;const Ie=this.matcherRe.exec(Ee);if(!Ie)return null;const $t=Ie.findIndex((fn,Cr)=>Cr>0&&fn!==void 0),rt=this.matchIndexes[$t];return Ie.splice(0,$t),Object.assign(Ie,rt)}}class Le{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(Ee){if(this.multiRegexes[Ee])return this.multiRegexes[Ee];const Ie=new pe;return this.rules.slice(Ee).forEach(([$t,rt])=>Ie.addRule($t,rt)),Ie.compile(),this.multiRegexes[Ee]=Ie,Ie}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(Ee,Ie){this.rules.push([Ee,Ie]),Ie.type==="begin"&&this.count++}exec(Ee){const Ie=this.getMatcher(this.regexIndex);Ie.lastIndex=this.lastIndex;let $t=Ie.exec(Ee);if(this.resumingScanAtSamePosition()&&!($t&&$t.index===this.lastIndex)){const rt=this.getMatcher(0);rt.lastIndex=this.lastIndex+1,$t=rt.exec(Ee)}return $t&&(this.regexIndex+=$t.position+1,this.regexIndex===this.count&&this.considerAll()),$t}}function vt(Ce){const Ee=new Le;return Ce.contains.forEach(Ie=>Ee.addRule(Ie.begin,{rule:Ie,type:"begin"})),Ce.terminatorEnd&&Ee.addRule(Ce.terminatorEnd,{type:"end"}),Ce.illegal&&Ee.addRule(Ce.illegal,{type:"illegal"}),Ee}function ft(Ce,Ee){const Ie=Ce;if(Ce.isCompiled)return Ie;[Ve,xe,_n,et].forEach(rt=>rt(Ce,Ee)),H.compilerExtensions.forEach(rt=>rt(Ce,Ee)),Ce.__beforeBegin=null,[Lt,he,_e].forEach(rt=>rt(Ce,Ee)),Ce.isCompiled=!0;let $t=null;return typeof Ce.keywords=="object"&&Ce.keywords.$pattern&&(Ce.keywords=Object.assign({},Ce.keywords),$t=Ce.keywords.$pattern,delete Ce.keywords.$pattern),$t=$t||/\w+/,Ce.keywords&&(Ce.keywords=Ot(Ce.keywords,H.case_insensitive)),Ie.keywordPatternRe=ue($t,!0),Ee&&(Ce.begin||(Ce.begin=/\B|\b/),Ie.beginRe=ue(Ie.begin),!Ce.end&&!Ce.endsWithParent&&(Ce.end=/\B|\b/),Ce.end&&(Ie.endRe=ue(Ie.end)),Ie.terminatorEnd=g(Ie.end)||"",Ce.endsWithParent&&Ee.terminatorEnd&&(Ie.terminatorEnd+=(Ce.end?"|":"")+Ee.terminatorEnd)),Ce.illegal&&(Ie.illegalRe=ue(Ce.illegal)),Ce.contains||(Ce.contains=[]),Ce.contains=[].concat(...Ce.contains.map(function(rt){return Ct(rt==="self"?Ce:rt)})),Ce.contains.forEach(function(rt){ft(rt,Ie)}),Ce.starts&&ft(Ce.starts,Ee),Ie.matcher=vt(Ie),Ie}if(H.compilerExtensions||(H.compilerExtensions=[]),H.contains&&H.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return H.classNameAliases=l(H.classNameAliases||{}),ft(H)}function mt(H){return H?H.endsWithParent||mt(H.starts):!1}function Ct(H){return H.variants&&!H.cachedVariants&&(H.cachedVariants=H.variants.map(function(ue){return l(H,{variants:null},ue)})),H.cachedVariants?H.cachedVariants:mt(H)?l(H,{starts:H.starts?l(H.starts):null}):Object.isFrozen(H)?l(H):H}var Fe="11.11.1";class pn extends Error{constructor(ue,pe){super(ue),this.name="HTMLInjectionError",this.html=pe}}const Xt=r,Na=l,zn=Symbol("nomatch"),er=7,Ar=function(H){const ue=Object.create(null),pe=Object.create(null),Le=[];let vt=!0;const ft="Could not find the language '{}', did you forget to load/include a language module?",Ce={disableAutodetect:!0,name:"Plain text",contains:[]};let Ee={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:x};function Ie(ge){return Ee.noHighlightRe.test(ge)}function $t(ge){let Ne=ge.className+" ";Ne+=ge.parentNode?ge.parentNode.className:"";const Qe=Ee.languageDetectRe.exec(Ne);if(Qe){const gt=de(Qe[1]);return gt||(bn(ft.replace("{}",Qe[1])),bn("Falling back to no-highlight mode for this block.",ge)),gt?Qe[1]:"no-highlight"}return Ne.split(/\s+/).find(gt=>Ie(gt)||de(gt))}function rt(ge,Ne,Qe){let gt="",en="";typeof Ne=="object"?(gt=ge,Qe=Ne.ignoreIllegals,en=Ne.language):(re("10.7.0","highlight(lang, code, ...args) has been deprecated."),re("10.7.0",`Please use highlight(code, options) instead.
|
|
43
|
+
https://github.com/highlightjs/highlight.js/issues/2277`),en=ge,gt=Ne),Qe===void 0&&(Qe=!0);const Cn={code:gt,language:en};yn("before:highlight",Cn);const tr=Cn.result?Cn.result:fn(Cn.language,Cn.code,Qe);return tr.code=Cn.code,yn("after:highlight",tr),tr}function fn(ge,Ne,Qe,gt){const en=Object.create(null);function Cn(ke,De){return ke.keywords[De]}function tr(){if(!Pe.keywords){an.addText(Nt);return}let ke=0;Pe.keywordPatternRe.lastIndex=0;let De=Pe.keywordPatternRe.exec(Nt),Xe="";for(;De;){Xe+=Nt.substring(ke,De.index);const st=vn.case_insensitive?De[0].toLowerCase():De[0],Vt=Cn(Pe,st);if(Vt){const[gr,Ui]=Vt;if(an.addText(Xe),Xe="",en[st]=(en[st]||0)+1,en[st]<=er&&(_a+=Ui),gr.startsWith("_"))Xe+=De[0];else{const wo=vn.classNameAliases[gr]||gr;nr(De[0],wo)}}else Xe+=De[0];ke=Pe.keywordPatternRe.lastIndex,De=Pe.keywordPatternRe.exec(Nt)}Xe+=Nt.substring(ke),an.addText(Xe)}function Pn(){if(Nt==="")return;let ke=null;if(typeof Pe.subLanguage=="string"){if(!ue[Pe.subLanguage]){an.addText(Nt);return}ke=fn(Pe.subLanguage,Nt,!0,vo[Pe.subLanguage]),vo[Pe.subLanguage]=ke._top}else ke=Hr(Nt,Pe.subLanguage.length?Pe.subLanguage:null);Pe.relevance>0&&(_a+=ke.relevance),an.__addSublanguage(ke._emitter,ke.language)}function It(){Pe.subLanguage!=null?Pn():tr(),Nt=""}function nr(ke,De){ke!==""&&(an.startScope(De),an.addText(ke),an.endScope())}function bo(ke,De){let Xe=1;const st=De.length-1;for(;Xe<=st;){if(!ke._emit[Xe]){Xe++;continue}const Vt=vn.classNameAliases[ke[Xe]]||ke[Xe],gr=De[Xe];Vt?nr(gr,Vt):(Nt=gr,tr(),Nt=""),Xe++}}function Bl(ke,De){return ke.scope&&typeof ke.scope=="string"&&an.openNode(vn.classNameAliases[ke.scope]||ke.scope),ke.beginScope&&(ke.beginScope._wrap?(nr(Nt,vn.classNameAliases[ke.beginScope._wrap]||ke.beginScope._wrap),Nt=""):ke.beginScope._multi&&(bo(ke.beginScope,De),Nt="")),Pe=Object.create(ke,{parent:{value:Pe}}),Pe}function Li(ke,De,Xe){let st=C(ke.endRe,Xe);if(st){if(ke["on:end"]){const Vt=new n(ke);ke["on:end"](De,Vt),Vt.isMatchIgnored&&(st=!1)}if(st){for(;ke.endsParent&&ke.parent;)ke=ke.parent;return ke}}if(ke.endsWithParent)return Li(ke.parent,De,Xe)}function Il(ke){return Pe.matcher.regexIndex===0?(Nt+=ke[0],1):(Ta=!0,0)}function Bc(ke){const De=ke[0],Xe=ke.rule,st=new n(Xe),Vt=[Xe.__beforeBegin,Xe["on:begin"]];for(const gr of Vt)if(gr&&(gr(ke,st),st.isMatchIgnored))return Il(De);return Xe.skip?Nt+=De:(Xe.excludeBegin&&(Nt+=De),It(),!Xe.returnBegin&&!Xe.excludeBegin&&(Nt=De)),Bl(Xe,ke),Xe.returnBegin?0:De.length}function Fn(ke){const De=ke[0],Xe=Ne.substring(ke.index),st=Li(Pe,ke,Xe);if(!st)return zn;const Vt=Pe;Pe.endScope&&Pe.endScope._wrap?(It(),nr(De,Pe.endScope._wrap)):Pe.endScope&&Pe.endScope._multi?(It(),bo(Pe.endScope,ke)):Vt.skip?Nt+=De:(Vt.returnEnd||Vt.excludeEnd||(Nt+=De),It(),Vt.excludeEnd&&(Nt=De));do Pe.scope&&an.closeNode(),!Pe.skip&&!Pe.subLanguage&&(_a+=Pe.relevance),Pe=Pe.parent;while(Pe!==st.parent);return st.starts&&Bl(st.starts,ke),Vt.returnEnd?0:De.length}function Bi(){const ke=[];for(let De=Pe;De!==vn;De=De.parent)De.scope&&ke.unshift(De.scope);ke.forEach(De=>an.openNode(De))}let sl={};function Ul(ke,De){const Xe=De&&De[0];if(Nt+=ke,Xe==null)return It(),0;if(sl.type==="begin"&&De.type==="end"&&sl.index===De.index&&Xe===""){if(Nt+=Ne.slice(De.index,De.index+1),!vt){const st=new Error(`0 width match regex (${ge})`);throw st.languageName=ge,st.badRule=sl.rule,st}return 1}if(sl=De,De.type==="begin")return Bc(De);if(De.type==="illegal"&&!Qe){const st=new Error('Illegal lexeme "'+Xe+'" for mode "'+(Pe.scope||"<unnamed>")+'"');throw st.mode=Pe,st}else if(De.type==="end"){const st=Fn(De);if(st!==zn)return st}if(De.type==="illegal"&&Xe==="")return Nt+=`
|
|
44
|
+
`,1;if(Ii>1e5&&Ii>De.index*3)throw new Error("potential infinite loop, way more iterations than matches");return Nt+=Xe,Xe.length}const vn=de(ge);if(!vn)throw Et(ft.replace("{}",ge)),new Error('Unknown language: "'+ge+'"');const yo=qt(vn);let $l="",Pe=gt||yo;const vo={},an=new Ee.__emitter(Ee);Bi();let Nt="",_a=0,ta=0,Ii=0,Ta=!1;try{if(vn.__emitTokens)vn.__emitTokens(Ne,an);else{for(Pe.matcher.considerAll();;){Ii++,Ta?Ta=!1:Pe.matcher.considerAll(),Pe.matcher.lastIndex=ta;const ke=Pe.matcher.exec(Ne);if(!ke)break;const De=Ne.substring(ta,ke.index),Xe=Ul(De,ke);ta=ke.index+Xe}Ul(Ne.substring(ta))}return an.finalize(),$l=an.toHTML(),{language:ge,value:$l,relevance:_a,illegal:!1,_emitter:an,_top:Pe}}catch(ke){if(ke.message&&ke.message.includes("Illegal"))return{language:ge,value:Xt(Ne),illegal:!0,relevance:0,_illegalBy:{message:ke.message,index:ta,context:Ne.slice(ta-100,ta+100),mode:ke.mode,resultSoFar:$l},_emitter:an};if(vt)return{language:ge,value:Xt(Ne),illegal:!1,relevance:0,errorRaised:ke,_emitter:an,_top:Pe};throw ke}}function Cr(ge){const Ne={value:Xt(ge),illegal:!1,relevance:0,_top:Ce,_emitter:new Ee.__emitter(Ee)};return Ne._emitter.addText(ge),Ne}function Hr(ge,Ne){Ne=Ne||Ee.languages||Object.keys(ue);const Qe=Cr(ge),gt=Ne.filter(de).filter(pt).map(It=>fn(It,ge,!1));gt.unshift(Qe);const en=gt.sort((It,nr)=>{if(It.relevance!==nr.relevance)return nr.relevance-It.relevance;if(It.language&&nr.language){if(de(It.language).supersetOf===nr.language)return 1;if(de(nr.language).supersetOf===It.language)return-1}return 0}),[Cn,tr]=en,Pn=Cn;return Pn.secondBest=tr,Pn}function Tn(ge,Ne,Qe){const gt=Ne&&pe[Ne]||Qe;ge.classList.add("hljs"),ge.classList.add(`language-${gt}`)}function Bt(ge){let Ne=null;const Qe=$t(ge);if(Ie(Qe))return;if(yn("before:highlightElement",{el:ge,language:Qe}),ge.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",ge);return}if(ge.children.length>0&&(Ee.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(ge)),Ee.throwUnescapedHTML))throw new pn("One of your code blocks includes unescaped HTML.",ge.innerHTML);Ne=ge;const gt=Ne.textContent,en=Qe?rt(gt,{language:Qe,ignoreIllegals:!0}):Hr(gt);ge.innerHTML=en.value,ge.dataset.highlighted="yes",Tn(ge,Qe,en.language),ge.result={language:en.language,re:en.relevance,relevance:en.relevance},en.secondBest&&(ge.secondBest={language:en.secondBest.language,relevance:en.secondBest.relevance}),yn("after:highlightElement",{el:ge,result:en,text:gt})}function ve(ge){Ee=Na(Ee,ge)}const wt=()=>{ea(),re("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function mr(){ea(),re("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let il=!1;function ea(){function ge(){ea()}if(document.readyState==="loading"){il||window.addEventListener("DOMContentLoaded",ge,!1),il=!0;return}document.querySelectorAll(Ee.cssSelector).forEach(Bt)}function Ll(ge,Ne){let Qe=null;try{Qe=Ne(H)}catch(gt){if(Et("Language definition for '{}' could not be registered.".replace("{}",ge)),vt)Et(gt);else throw gt;Qe=Ce}Qe.name||(Qe.name=ge),ue[ge]=Qe,Qe.rawDefinition=Ne.bind(null,H),Qe.aliases&&Te(Qe.aliases,{languageName:ge})}function Oe(ge){delete ue[ge];for(const Ne of Object.keys(pe))pe[Ne]===ge&&delete pe[Ne]}function F(){return Object.keys(ue)}function de(ge){return ge=(ge||"").toLowerCase(),ue[ge]||ue[pe[ge]]}function Te(ge,{languageName:Ne}){typeof ge=="string"&&(ge=[ge]),ge.forEach(Qe=>{pe[Qe.toLowerCase()]=Ne})}function pt(ge){const Ne=de(ge);return Ne&&!Ne.disableAutodetect}function Ht(ge){ge["before:highlightBlock"]&&!ge["before:highlightElement"]&&(ge["before:highlightElement"]=Ne=>{ge["before:highlightBlock"](Object.assign({block:Ne.el},Ne))}),ge["after:highlightBlock"]&&!ge["after:highlightElement"]&&(ge["after:highlightElement"]=Ne=>{ge["after:highlightBlock"](Object.assign({block:Ne.el},Ne))})}function Ze(ge){Ht(ge),Le.push(ge)}function dn(ge){const Ne=Le.indexOf(ge);Ne!==-1&&Le.splice(Ne,1)}function yn(ge,Ne){const Qe=ge;Le.forEach(function(gt){gt[Qe]&>[Qe](Ne)})}function An(ge){return re("10.7.0","highlightBlock will be removed entirely in v12.0"),re("10.7.0","Please use highlightElement now."),Bt(ge)}Object.assign(H,{highlight:rt,highlightAuto:Hr,highlightAll:ea,highlightElement:Bt,highlightBlock:An,configure:ve,initHighlighting:wt,initHighlightingOnLoad:mr,registerLanguage:Ll,unregisterLanguage:Oe,listLanguages:F,getLanguage:de,registerAliases:Te,autoDetection:pt,inherit:Na,addPlugin:Ze,removePlugin:dn}),H.debugMode=function(){vt=!1},H.safeMode=function(){vt=!0},H.versionString=Fe,H.regex={concat:E,lookahead:y,either:N,optional:S,anyNumberOfTimes:v};for(const ge in qe)typeof qe[ge]=="object"&&e(qe[ge]);return Object.assign(H,qe),H},Kt=Ar({});return Kt.newInstance=()=>Ar({}),hh=Kt,Kt.HighlightJS=Kt,Kt.default=Kt,hh}var tM=eM();const At=so(tM),ic="[A-Za-z$_][0-9A-Za-z$_]*",ew=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],tw=["true","false","null","undefined","NaN","Infinity"],nw=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],rw=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],aw=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],lw=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],iw=[].concat(aw,nw,rw);function nM(e){const n=e.regex,r=(le,{after:be})=>{const O="</"+le[0].slice(1);return le.input.indexOf(O,be)!==-1},l=ic,s={begin:"<>",end:"</>"},o=/<[A-Za-z0-9\\._:-]+\s*\/>/,u={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(le,be)=>{const O=le[0].length+le.index,D=le.input[O];if(D==="<"||D===","){be.ignoreMatch();return}D===">"&&(r(le,{after:O})||be.ignoreMatch());let L;const A=le.input.substring(O);if(L=A.match(/^\s*=/)){be.ignoreMatch();return}if((L=A.match(/^\s+extends\s+/))&&L.index===0){be.ignoreMatch();return}}},f={$pattern:ic,keyword:ew,literal:tw,built_in:iw,"variable.language":lw},d="[0-9](_?[0-9])*",p=`\\.(${d})`,x="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",g={className:"number",variants:[{begin:`(\\b(${x})((${p})|\\.)?|(${p}))[eE][+-]?(${d})\\b`},{begin:`\\b(${x})\\b((${p})\\b|\\.)?|(${p})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},y={className:"subst",begin:"\\$\\{",end:"\\}",keywords:f,contains:[]},v={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,y],subLanguage:"xml"}},S={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,y],subLanguage:"css"}},E={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,y],subLanguage:"graphql"}},T={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,y]},j={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:l+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},C=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,v,S,E,T,{match:/\$\d+/},g];y.contains=C.concat({begin:/\{/,end:/\}/,keywords:f,contains:["self"].concat(C)});const I=[].concat(j,y.contains),U=I.concat([{begin:/(\s*)\(/,end:/\)/,keywords:f,contains:["self"].concat(I)}]),_={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:f,contains:U},z={variants:[{match:[/class/,/\s+/,l,/\s+/,/extends/,/\s+/,n.concat(l,"(",n.concat(/\./,l),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,l],scope:{1:"keyword",3:"title.class"}}]},P={relevance:0,match:n.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...nw,...rw]}},X={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},B={variants:[{match:[/function/,/\s+/,l,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[_],illegal:/%/},q={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function Z(le){return n.concat("(?!",le.join("|"),")")}const ee={match:n.concat(/\b/,Z([...aw,"super","import"].map(le=>`${le}\\s*\\(`)),l,n.lookahead(/\s*\(/)),className:"title.function",relevance:0},ae={begin:n.concat(/\./,n.lookahead(n.concat(l,/(?![0-9A-Za-z$_(])/))),end:l,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},Y={match:[/get|set/,/\s+/,l,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},_]},M="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",K={match:[/const|var|let/,/\s+/,l,/\s*/,/=\s*/,/(async\s*)?/,n.lookahead(M)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[_]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:f,exports:{PARAMS_CONTAINS:U,CLASS_REFERENCE:P},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),X,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,v,S,E,T,j,{match:/\$\d+/},g,P,{scope:"attr",match:l+n.lookahead(":"),relevance:0},K,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[j,e.REGEXP_MODE,{className:"function",begin:M,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:f,contains:U}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:s.begin,end:s.end},{match:o},{begin:u.begin,"on:begin":u.isTrulyOpeningTag,end:u.end}],subLanguage:"xml",contains:[{begin:u.begin,end:u.end,skip:!0,contains:["self"]}]}]},B,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[_,e.inherit(e.TITLE_MODE,{begin:l,className:"title.function"})]},{match:/\.\.\./,relevance:0},ae,{match:"\\$"+l,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[_]},ee,q,z,Y,{match:/\$[(.]/}]}}function $p(e){const n=e.regex,r=nM(e),l=ic,s=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],o={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},u={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:s},contains:[r.exports.CLASS_REFERENCE]},f={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},d=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],p={$pattern:ic,keyword:ew.concat(d),literal:tw,built_in:iw.concat(s),"variable.language":lw},x={className:"meta",begin:"@"+l},g=(E,T,N)=>{const j=E.contains.findIndex(C=>C.label===T);if(j===-1)throw new Error("can not find mode to replace");E.contains.splice(j,1,N)};Object.assign(r.keywords,p),r.exports.PARAMS_CONTAINS.push(x);const y=r.contains.find(E=>E.scope==="attr"),v=Object.assign({},y,{match:n.concat(l,n.lookahead(/\s*\?:/))});r.exports.PARAMS_CONTAINS.push([r.exports.CLASS_REFERENCE,y,v]),r.contains=r.contains.concat([x,o,u,v]),g(r,"shebang",e.SHEBANG()),g(r,"use_strict",f);const S=r.contains.find(E=>E.label==="func.def");return S.relevance=0,Object.assign(r,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),r}const o1="[A-Za-z$_][0-9A-Za-z$_]*",rM=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],aM=["true","false","null","undefined","NaN","Infinity"],sw=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],ow=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],uw=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],lM=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],iM=[].concat(uw,sw,ow);function Hp(e){const n=e.regex,r=(le,{after:be})=>{const O="</"+le[0].slice(1);return le.input.indexOf(O,be)!==-1},l=o1,s={begin:"<>",end:"</>"},o=/<[A-Za-z0-9\\._:-]+\s*\/>/,u={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(le,be)=>{const O=le[0].length+le.index,D=le.input[O];if(D==="<"||D===","){be.ignoreMatch();return}D===">"&&(r(le,{after:O})||be.ignoreMatch());let L;const A=le.input.substring(O);if(L=A.match(/^\s*=/)){be.ignoreMatch();return}if((L=A.match(/^\s+extends\s+/))&&L.index===0){be.ignoreMatch();return}}},f={$pattern:o1,keyword:rM,literal:aM,built_in:iM,"variable.language":lM},d="[0-9](_?[0-9])*",p=`\\.(${d})`,x="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",g={className:"number",variants:[{begin:`(\\b(${x})((${p})|\\.)?|(${p}))[eE][+-]?(${d})\\b`},{begin:`\\b(${x})\\b((${p})\\b|\\.)?|(${p})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},y={className:"subst",begin:"\\$\\{",end:"\\}",keywords:f,contains:[]},v={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,y],subLanguage:"xml"}},S={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,y],subLanguage:"css"}},E={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,y],subLanguage:"graphql"}},T={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,y]},j={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:l+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},C=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,v,S,E,T,{match:/\$\d+/},g];y.contains=C.concat({begin:/\{/,end:/\}/,keywords:f,contains:["self"].concat(C)});const I=[].concat(j,y.contains),U=I.concat([{begin:/(\s*)\(/,end:/\)/,keywords:f,contains:["self"].concat(I)}]),_={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:f,contains:U},z={variants:[{match:[/class/,/\s+/,l,/\s+/,/extends/,/\s+/,n.concat(l,"(",n.concat(/\./,l),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,l],scope:{1:"keyword",3:"title.class"}}]},P={relevance:0,match:n.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...sw,...ow]}},X={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},B={variants:[{match:[/function/,/\s+/,l,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[_],illegal:/%/},q={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function Z(le){return n.concat("(?!",le.join("|"),")")}const ee={match:n.concat(/\b/,Z([...uw,"super","import"].map(le=>`${le}\\s*\\(`)),l,n.lookahead(/\s*\(/)),className:"title.function",relevance:0},ae={begin:n.concat(/\./,n.lookahead(n.concat(l,/(?![0-9A-Za-z$_(])/))),end:l,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},Y={match:[/get|set/,/\s+/,l,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},_]},M="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",K={match:[/const|var|let/,/\s+/,l,/\s*/,/=\s*/,/(async\s*)?/,n.lookahead(M)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[_]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:f,exports:{PARAMS_CONTAINS:U,CLASS_REFERENCE:P},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),X,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,v,S,E,T,j,{match:/\$\d+/},g,P,{scope:"attr",match:l+n.lookahead(":"),relevance:0},K,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[j,e.REGEXP_MODE,{className:"function",begin:M,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:f,contains:U}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:s.begin,end:s.end},{match:o},{begin:u.begin,"on:begin":u.isTrulyOpeningTag,end:u.end}],subLanguage:"xml",contains:[{begin:u.begin,end:u.end,skip:!0,contains:["self"]}]}]},B,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[_,e.inherit(e.TITLE_MODE,{begin:l,className:"title.function"})]},{match:/\.\.\./,relevance:0},ae,{match:"\\$"+l,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[_]},ee,q,z,Y,{match:/\$[(.]/}]}}function sM(e){const n={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},r={match:/[{}[\],:]/,className:"punctuation",relevance:0},l=["true","false","null"],s={scope:"literal",beginKeywords:l.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:l},contains:[n,r,e.QUOTE_STRING_MODE,s,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}function kc(e){const n=e.regex,r={},l={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[r]}]};Object.assign(r,{className:"variable",variants:[{begin:n.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},l]});const s={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},o=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),u={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},f={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,r,s]};s.contains.push(f);const d={match:/\\"/},p={className:"string",begin:/'/,end:/'/},x={match:/\\'/},g={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,r]},y=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],v=e.SHEBANG({binary:`(${y.join("|")})`,relevance:10}),S={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},E=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],T=["true","false"],N={match:/(\/[a-z._-]+)+/},j=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],C=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],I=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],U=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:E,literal:T,built_in:[...j,...C,"set","shopt",...I,...U]},contains:[v,e.SHEBANG(),S,g,o,u,N,f,d,p,x,r]}}function cw(e){const n=e.regex,r=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),l=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],f={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:l,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},d={className:"meta",begin:/^(>>>|\.\.\.) /},p={className:"subst",begin:/\{/,end:/\}/,keywords:f,illegal:/#/},x={begin:/\{\{/,relevance:0},g={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,d],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,d],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,d,x,p]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,d,x,p]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,x,p]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,x,p]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},y="[0-9](_?[0-9])*",v=`(\\b(${y}))?\\.(${y})|\\b(${y})\\.`,S=`\\b|${l.join("|")}`,E={className:"number",relevance:0,variants:[{begin:`(\\b(${y})|(${v}))[eE][+-]?(${y})[jJ]?(?=${S})`},{begin:`(${v})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${S})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${S})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${S})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${S})`},{begin:`\\b(${y})[jJ](?=${S})`}]},T={className:"comment",begin:n.lookahead(/# type:/),end:/$/,keywords:f,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},N={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:f,contains:["self",d,E,g,e.HASH_COMMENT_MODE]}]};return p.contains=[g,E,d],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:f,illegal:/(<\/|\?)|=>/,contains:[d,E,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},g,T,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,r],scope:{1:"keyword",3:"title.function"},contains:[N]},{variants:[{match:[/\bclass/,/\s+/,r,/\s*/,/\(\s*/,r,/\s*\)/]},{match:[/\bclass/,/\s+/,r]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[E,N,g]}]}}function oM(e){const o={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:o,illegal:"</",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"string",variants:[e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,{begin:"`",end:"`"}]},{className:"number",variants:[{match:/-?\b0[xX]\.[a-fA-F0-9](_?[a-fA-F0-9])*[pP][+-]?\d(_?\d)*i?/,relevance:0},{match:/-?\b0[xX](_?[a-fA-F0-9])+((\.([a-fA-F0-9](_?[a-fA-F0-9])*)?)?[pP][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b0[oO](_?[0-7])*i?/,relevance:0},{match:/-?\.\d(_?\d)*([eE][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b\d(_?\d)*(\.(\d(_?\d)*)?)?([eE][+-]?\d(_?\d)*)?i?/,relevance:0}]},{begin:/:=/},{className:"function",beginKeywords:"func",end:"\\s*(\\{|$)",excludeEnd:!0,contains:[e.TITLE_MODE,{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:o,illegal:/["']/}]}]}}function fw(e){const n="true false yes no null",r="[\\w#;/?:@&=+$,.~*'()[\\]]+",l={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},s={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},o={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},u={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,s]},f=e.inherit(u,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),y={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},v={end:",",endsWithParent:!0,excludeEnd:!0,keywords:n,relevance:0},S={begin:/\{/,end:/\}/,contains:[v],illegal:"\\n",relevance:0},E={begin:"\\[",end:"\\]",contains:[v],illegal:"\\n",relevance:0},T=[l,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+r},{className:"type",begin:"!<"+r+">"},{className:"type",begin:"!"+r},{className:"type",begin:"!!"+r},{className:"meta",begin:"&"+e.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+e.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:n,keywords:{literal:n}},y,{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},S,E,o,u],N=[...T];return N.pop(),N.push(f),v.contains=N,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:T}}function dw(e){const n=e.regex,r={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},l={begin:"^[-\\*]{3,}",end:"$"},s={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},o={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},u={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},f=/[A-Za-z][A-Za-z0-9+.-]*/,d={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:n.concat(/\[.+?\]\(/,f,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},p={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},x={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},g=e.inherit(p,{contains:[]}),y=e.inherit(x,{contains:[]});p.contains.push(y),x.contains.push(g);let v=[r,d];return[p,x,g,y].forEach(N=>{N.contains=N.contains.concat(v)}),v=v.concat(p,x),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:v},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:v}]}]},r,o,p,x,{className:"quote",begin:"^>\\s+",contains:v,end:"$"},s,l,d,u,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function hw(e){const n=e.regex,r=n.concat(/[\p{L}_]/u,n.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),l=/[\p{L}0-9._:-]+/u,s={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},o={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},u=e.inherit(o,{begin:/\(/,end:/\)/}),f=e.inherit(e.APOS_STRING_MODE,{className:"string"}),d=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),p={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:l,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[s]},{begin:/'/,end:/'/,contains:[s]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[o,d,f,u,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[o,u,d,f]}]}]},e.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},s,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[d]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[p],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[p],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:n.concat(/</,n.lookahead(n.concat(r,n.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:r,relevance:0,starts:p}]},{className:"tag",begin:n.concat(/<\//,n.lookahead(n.concat(r,/>/))),contains:[{className:"name",begin:r,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}const uM=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),cM=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],fM=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],dM=[...cM,...fM],hM=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),pM=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),mM=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),gM=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function xM(e){const n=e.regex,r=uM(e),l={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},s="and or not only",o=/@-?\w[\w]*(-\w+)*/,u="[a-zA-Z-][a-zA-Z0-9_-]*",f=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[r.BLOCK_COMMENT,l,r.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+u,relevance:0},r.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+pM.join("|")+")"},{begin:":(:)?("+mM.join("|")+")"}]},r.CSS_VARIABLE,{className:"attribute",begin:"\\b("+gM.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[r.BLOCK_COMMENT,r.HEXCOLOR,r.IMPORTANT,r.CSS_NUMBER_MODE,...f,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...f,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},r.FUNCTION_DISPATCH]},{begin:n.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:o},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:s,attribute:hM.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...f,r.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+dM.join("|")+")\\b"}]}}function pw(e){const n=e.regex,r=/(r#)?/,l=n.concat(r,e.UNDERSCORE_IDENT_RE),s=n.concat(r,e.IDENT_RE),o={className:"title.function.invoke",relevance:0,begin:n.concat(/\b/,/(?!let|for|while|if|else|match\b)/,s,n.lookahead(/\s*\(/))},u="([ui](8|16|32|64|128|size)|f(32|64))?",f=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","union","unsafe","unsized","use","virtual","where","while","yield"],d=["true","false","Some","None","Ok","Err"],p=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],x=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:e.IDENT_RE+"!?",type:x,keyword:f,literal:d,built_in:p},illegal:"</",contains:[e.C_LINE_COMMENT_MODE,e.COMMENT("/\\*","\\*/",{contains:["self"]}),e.inherit(e.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{className:"symbol",begin:/'[a-zA-Z_][a-zA-Z0-9_]*(?!')/},{scope:"string",variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'/,end:/'/,contains:[{scope:"char.escape",match:/\\('|\w|x\w{2}|u\w{4}|U\w{8})/}]}]},{className:"number",variants:[{begin:"\\b0b([01_]+)"+u},{begin:"\\b0o([0-7_]+)"+u},{begin:"\\b0x([A-Fa-f0-9_]+)"+u},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+u}],relevance:0},{begin:[/fn/,/\s+/,l],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,l],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,l,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,l],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,l],className:{1:"keyword",3:"title.class"}},{begin:e.IDENT_RE+"::",keywords:{keyword:"Self",built_in:p,type:x}},{className:"punctuation",begin:"->"},o]}}function bM(e){const n=e.regex,r=e.COMMENT("--","$"),l={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},s={begin:/"/,end:/"/,contains:[{match:/""/}]},o=["true","false","unknown"],u=["double precision","large object","with timezone","without timezone"],f=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],d=["add","asc","collation","desc","final","first","last","view"],p=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],x=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],g=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],y=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],v=x,S=[...p,...d].filter(U=>!x.includes(U)),E={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},T={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},N={match:n.concat(/\b/,n.either(...v),/\s*\(/),relevance:0,keywords:{built_in:v}};function j(U){return n.concat(/\b/,n.either(...U.map(_=>_.replace(/\s+/,"\\s+"))),/\b/)}const C={scope:"keyword",match:j(y),relevance:0};function I(U,{exceptions:_,when:z}={}){const P=z;return _=_||[],U.map(X=>X.match(/\|\d+$/)||_.includes(X)?X:P(X)?`${X}|0`:X)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:I(S,{when:U=>U.length<3}),literal:o,type:f,built_in:g},contains:[{scope:"type",match:j(u)},C,N,E,l,s,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,r,T]}}function yM(e){const n=e.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:n.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:n.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}}At.registerLanguage("typescript",$p);At.registerLanguage("ts",$p);At.registerLanguage("tsx",$p);At.registerLanguage("javascript",Hp);At.registerLanguage("js",Hp);At.registerLanguage("jsx",Hp);At.registerLanguage("json",sM);At.registerLanguage("bash",kc);At.registerLanguage("sh",kc);At.registerLanguage("shell",kc);At.registerLanguage("zsh",kc);At.registerLanguage("python",cw);At.registerLanguage("py",cw);At.registerLanguage("go",oM);At.registerLanguage("yaml",fw);At.registerLanguage("yml",fw);At.registerLanguage("markdown",dw);At.registerLanguage("md",dw);At.registerLanguage("html",hw);At.registerLanguage("xml",hw);At.registerLanguage("css",xM);At.registerLanguage("rust",pw);At.registerLanguage("rs",pw);At.registerLanguage("sql",bM);At.registerLanguage("diff",yM);function vM(e){const n=e.match(/^claude-(\w+)-(\d+)-(\d+)/);return n?`${n[1].charAt(0).toUpperCase()+n[1].slice(1)} ${n[2]}.${n[3]}`:e}function wM(e){return e.replace(/\[Attached files?: ([^\]]+)\]/g,(n,r)=>`📎 ${r.split(", ").map(s=>s.split("/").pop()||s).join(", ")}`)}function kM({msg:e}){const n=e.subtype==="init"?"text-success-5":e.subtype==="exit"||e.subtype==="stall"||e.subtype==="restart"?"text-warning-5":"text-error-5",r=e.subtype==="init"?"bg-success-5":e.subtype==="exit"||e.subtype==="stall"||e.subtype==="restart"?"bg-warning-5":"bg-error-5",l=e.model?` (${vM(e.model)})`:"";return h.jsxs("div",{className:`px-4 py-1.5 text-[15px] ${n} flex items-center gap-2`,children:[h.jsx("span",{className:`inline-block h-1.5 w-1.5 rounded-full ${r} flex-shrink-0`}),e.text,l]})}function SM({msg:e,fontSize:n,isMobile:r}){return h.jsx("div",{className:"px-4 py-2",children:h.jsx("div",{className:`user-bubble rounded-lg bg-neutral-10/60 px-3 py-2 text-neutral-3 whitespace-pre-wrap ${r?"max-w-[95%]":"max-w-[80%]"}`,style:{fontSize:`${n}px`},children:wM(e.text)})})}function EM({code:e}){const[n,r]=w.useState(!1),l=w.useCallback(()=>{navigator.clipboard.writeText(e).then(()=>{r(!0),setTimeout(()=>r(!1),1500)})},[e]);return h.jsx("button",{onClick:l,className:"absolute top-2 right-2 rounded p-1 opacity-0 transition-opacity group-hover/codeblock:opacity-100 bg-neutral-8/80 hover:bg-neutral-7 text-neutral-4 hover:text-neutral-2 cursor-pointer",title:"Copy to clipboard",children:n?h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:h.jsx("path",{d:"M20 6L9 17l-5-5"})}):h.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[h.jsx("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),h.jsx("path",{d:"M5 15H4a2 2 0 01-2-2V4a2 2 0 012-2h9a2 2 0 012 2v1"})]})})}function NM(e,n){return At.getLanguage(n)?At.highlight(e,{language:n}).value:e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}function _M({msg:e,fontSize:n}){return h.jsx("div",{className:"px-4 py-2",children:h.jsx("div",{className:"prose prose-themed max-w-none",style:{fontSize:`${n}px`},children:h.jsx($R,{remarkPlugins:[Jj],components:{code({className:r,children:l,...s}){const o=/language-(\w+)/.exec(r||""),u=String(l).replace(/\n$/,"");return o?h.jsxs("div",{className:"group/codeblock relative",children:[h.jsx("div",{className:"hljs",style:{margin:"0.5em 0",borderRadius:"6px",fontSize:`${n-1}px`,padding:"1em",overflowX:"auto"},dangerouslySetInnerHTML:{__html:NM(u,o[1])}}),h.jsx(EM,{code:u})]}):h.jsx("code",{className:`${r||""} rounded bg-neutral-10 px-1.5 py-0.5`,...s,children:l})},a({href:r,children:l,...s}){const o=r&&/^(https?:|mailto:|\/|#)/i.test(r)?r:"#";return h.jsx("a",{href:o,target:"_blank",rel:"noopener noreferrer",...s,children:l})},img({src:r,alt:l,...s}){return h.jsx("img",{src:r,alt:l||"Image",className:"max-w-full max-h-96 rounded-lg border border-neutral-8 my-2",loading:"lazy",...s})}},children:e.text})})})}function TM({msg:e,fontSize:n}){const r=n-1;return h.jsx("div",{className:"flex flex-wrap gap-x-4 gap-y-0.5 text-neutral-4",style:{fontSize:`${r}px`,fontFamily:"'Inconsolata', monospace"},children:e.tools.map((l,s)=>h.jsxs("span",{className:"flex items-center gap-1.5 whitespace-nowrap overflow-hidden",children:[l.active?h.jsx("span",{className:"inline-block h-1.5 w-1.5 rounded-full bg-primary-5 animate-pulse flex-shrink-0"}):h.jsx("span",{className:"inline-block h-1.5 w-1.5 rounded-full bg-neutral-6 flex-shrink-0"}),h.jsx("span",{className:"text-accent-6",children:l.name}),l.summary&&h.jsx("span",{className:"text-neutral-5 truncate max-w-[400px]",children:l.summary})]},s))})}function AM({msg:e,fontSize:n}){const[r,l]=w.useState(!1),s=n-1,o=e.isError?"text-error-5":"text-neutral-5",u=e.content.split(`
|
|
45
|
+
`),f=u.length>3,d=f&&!r?u.slice(0,3).join(`
|
|
46
|
+
`):e.content;return h.jsxs("div",{className:`pl-4 py-0.5 ${o}`,style:{fontSize:`${s}px`,fontFamily:"'Inconsolata', monospace"},children:[h.jsx("div",{className:"whitespace-pre-wrap break-all",children:d}),f&&h.jsx("button",{onClick:()=>l(!r),className:"text-neutral-6 hover:text-neutral-3 transition-colors mt-0.5",style:{fontSize:`${s}px`},children:r?"▴ collapse":`▾ ${u.length-3} more lines`})]})}function CM({run:e,fontSize:n}){const r=e.groups.some(g=>g.tools.some(y=>y.active)),[l,s]=w.useState(!1),o=r||l,u=n-1,f=e.groups.flatMap(g=>g.tools),d=[...new Set(f.map(g=>g.name))],p=f.length,x=e.outputs.filter(g=>g.isError).length;return h.jsxs("div",{className:"px-4 py-0.5",children:[h.jsxs("button",{onClick:()=>s(!o),className:"flex items-center gap-1.5 text-neutral-5 hover:text-neutral-3 transition-colors w-full text-left",style:{fontSize:`${u}px`,fontFamily:"'Inconsolata', monospace"},children:[r?h.jsx("span",{className:"inline-block h-1.5 w-1.5 rounded-full bg-primary-5 animate-pulse flex-shrink-0"}):h.jsx("span",{className:"text-neutral-6 flex-shrink-0",children:o?"▾":"▸"}),h.jsxs("span",{className:"text-neutral-5",children:[p," tool",p!==1?" calls":" call"," — ",h.jsxs("span",{className:"text-accent-6",children:[d.slice(0,4).join(", "),d.length>4?` +${d.length-4}`:""]}),x>0&&h.jsxs("span",{className:"text-error-5 ml-1",children:["(",x," error",x!==1?"s":"",")"]})]})]}),o&&h.jsxs("div",{className:"pl-3 mt-0.5 border-l border-neutral-9/50",children:[e.groups.map((g,y)=>h.jsx("div",{children:h.jsx(TM,{msg:g,fontSize:n})},`g-${y}`)),e.outputs.map((g,y)=>h.jsx(AM,{msg:g,fontSize:n},`o-${y}`))]}),e.images.map((g,y)=>h.jsx(RM,{msg:g},`img-${y}`))]})}function RM({msg:e}){const[n,r]=w.useState(!1),o=`data:${new Set(["image/png","image/jpeg","image/gif","image/webp","image/svg+xml"]).has(e.mediaType)?e.mediaType:"image/png"};base64,${e.base64}`;return h.jsx("div",{className:"pl-4 py-1",children:h.jsx("img",{src:o,alt:"Tool output",className:`rounded-lg border border-neutral-8 cursor-pointer transition-all ${n?"max-w-full":"max-w-xs max-h-48 object-contain"}`,onClick:()=>r(!n)})})}function jM({msg:e,fontSize:n}){return h.jsx("div",{className:"px-4 py-2",children:h.jsxs("div",{className:"max-w-[80%] rounded-lg border-l-2 border-warning-6 bg-warning-11/20 px-3 py-2 text-neutral-4 whitespace-pre-wrap",style:{fontSize:`${n}px`},children:[h.jsx("div",{className:"mb-1 text-[13px] text-warning-5 uppercase tracking-wider",children:"queued"}),e.text]})})}function MM({msg:e}){return h.jsxs("div",{className:"px-4 py-1.5 text-[15px] text-primary-5 flex items-center gap-2",children:[h.jsx("span",{className:"inline-block h-1.5 w-1.5 rounded-full bg-primary-5 flex-shrink-0"}),e.active?"Entered plan mode":"Exited plan mode"]})}function OM({label:e}){const[n,r]=w.useState(0),l=w.useRef(0);return w.useEffect(()=>{l.current=Date.now(),r(0);const s=setInterval(()=>{r(Math.floor((Date.now()-l.current)/1e3))},1e3);return()=>clearInterval(s)},[e]),h.jsx("div",{className:"px-4 pt-4 pb-2",children:h.jsxs("div",{className:"app-thinking-badge inline-flex items-center gap-2 rounded-lg bg-neutral-9/80 px-3.5 py-2",children:[h.jsxs("svg",{className:"h-4 w-4 animate-[spin_3s_linear_infinite]",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round",style:{color:"var(--color-primary-7)"},children:[h.jsx("path",{d:"M9 12a3 3 0 1 0 6 0a3 3 0 1 0 -6 0"}),h.jsx("path",{d:"M12 21l0 .01"}),h.jsx("path",{d:"M3 9l0 .01"}),h.jsx("path",{d:"M21 9l0 .01"}),h.jsx("path",{d:"M8 20.1a9 9 0 0 1 -5 -7.1"}),h.jsx("path",{d:"M16 20.1a9 9 0 0 0 5 -7.1"}),h.jsx("path",{d:"M6.2 5a9 9 0 0 1 11.4 0"})]}),h.jsx("span",{className:"text-[13px] text-neutral-4 tracking-wide",children:e}),n>=10&&h.jsxs("span",{className:"text-[12px] text-neutral-5",children:[n,"s"]})]})})}function mw({messages:e,fontSize:n,disabled:r,planningMode:l,activityLabel:s,isMobile:o}){const u=w.useRef(null),[f,d]=w.useState(!1),p=w.useRef(!0),x=w.useCallback(()=>{const y=u.current;if(!y)return;const S=y.scrollHeight-y.scrollTop-y.clientHeight<100;p.current=S,d(!S)},[]);w.useEffect(()=>{p.current&&u.current&&(u.current.scrollTop=u.current.scrollHeight)},[e]);const g=w.useCallback(()=>{u.current&&(u.current.scrollTop=u.current.scrollHeight,d(!1),p.current=!0)},[]);return h.jsxs("div",{className:"relative flex flex-1 min-h-0 w-full flex-col",children:[l&&h.jsxs("div",{className:"z-10 flex items-center gap-2 border-b border-primary-9/50 bg-primary-11/80 px-4 py-1.5 text-[15px] text-primary-5 backdrop-blur-sm flex-shrink-0",children:[h.jsx("span",{className:"inline-block h-2 w-2 rounded-full bg-primary-5 animate-pulse"}),"Plan Mode"]}),h.jsx("div",{ref:u,className:"chat-scroll flex-1 overflow-y-auto overflow-x-hidden min-h-0",onScroll:x,children:h.jsxs("div",{className:"flex flex-col py-2",children:[(()=>{let y=0;const v=[];let S=0;for(;S<e.length;){const E=e[S],T=E.ts;if(T&&(E.type==="user"||E.type==="assistant")&&T-y>=6e4){y=T;const j=new Date(T),C=String(j.getHours()).padStart(2,"0"),I=String(j.getMinutes()).padStart(2,"0");v.push(h.jsxs("div",{className:"px-4 pt-3 pb-0.5 text-[13px] text-neutral-6",children:[C,":",I]},`ts-${E.key||S}`))}if(E.type==="tool_group"||E.type==="tool_output"||E.type==="image"){const j={groups:[],outputs:[],images:[]},C=S;for(;S<e.length&&(e[S].type==="tool_group"||e[S].type==="tool_output"||e[S].type==="image");){const U=e[S];U.type==="tool_group"&&j.groups.push(U),U.type==="tool_output"&&j.outputs.push(U),U.type==="image"&&j.images.push(U),S++}const I=j.groups[0]?.key||j.outputs[0]?.key||`ta-${C}`;v.push(h.jsx(CM,{run:j,fontSize:n},I));continue}let N;switch(E.type){case"system":if(E.subtype==="trim"){N=h.jsxs("div",{className:"px-4 py-1.5 text-[15px] text-neutral-6 flex items-center gap-2",children:[h.jsx("span",{className:"inline-block h-1.5 w-1.5 rounded-full bg-neutral-6 flex-shrink-0"}),"Older messages trimmed"]},E.key||S);break}N=h.jsx(kM,{msg:E},E.key||S);break;case"user":N=h.jsx(SM,{msg:E,fontSize:n,isMobile:o},E.key||S);break;case"assistant":N=h.jsx(_M,{msg:E,fontSize:n},E.key||S);break;case"planning_mode":N=h.jsx(MM,{msg:E},E.key||S);break;case"todo_list":N=null;break;case"tentative":N=h.jsx(jM,{msg:E,fontSize:n},E.key||`tentative-${E.index}`);break}v.push(N),S++}return v})(),s&&h.jsx(OM,{label:s})]})}),f&&h.jsx("button",{onClick:g,className:"absolute bottom-3 left-1/2 -translate-x-1/2 rounded-full bg-neutral-8/90 p-2 text-neutral-3 shadow-lg transition hover:bg-neutral-7 hover:text-neutral-1",title:"Scroll to bottom",children:h.jsx(Z2,{size:16,stroke:2})}),r&&h.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-neutral-12/80",children:h.jsx("p",{className:"text-[15px] text-neutral-3",children:"Configure token in Settings to use chat"})})]})}function Pp(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Ml=Pp();function gw(e){Ml=e}var _l={exec:()=>null};function ht(e,n=""){let r=typeof e=="string"?e:e.source,l={replace:(s,o)=>{let u=typeof o=="string"?o:o.source;return u=u.replace(Un.caret,"$1"),r=r.replace(s,u),l},getRegex:()=>new RegExp(r,n)};return l}var DM=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),Un={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i"),blockquoteBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}>`)},zM=/^(?:[ \t]*(?:\n|$))+/,LM=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,BM=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,ho=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,IM=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Fp=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,xw=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,bw=ht(xw).replace(/bull/g,Fp).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),UM=ht(xw).replace(/bull/g,Fp).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Gp=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,$M=/^[^\n]+/,qp=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,HM=ht(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",qp).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),PM=ht(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Fp).getRegex(),Sc="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|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Yp=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,FM=ht("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Yp).replace("tag",Sc).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),yw=ht(Gp).replace("hr",ho).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Sc).getRegex(),GM=ht(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",yw).getRegex(),Vp={blockquote:GM,code:LM,def:HM,fences:BM,heading:IM,hr:ho,html:FM,lheading:bw,list:PM,newline:zM,paragraph:yw,table:_l,text:$M},u1=ht("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",ho).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Sc).getRegex(),qM={...Vp,lheading:UM,table:u1,paragraph:ht(Gp).replace("hr",ho).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",u1).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Sc).getRegex()},YM={...Vp,html:ht(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Yp).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:_l,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:ht(Gp).replace("hr",ho).replace("heading",` *#{1,6} *[^
|
|
47
|
+
]`).replace("lheading",bw).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},VM=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,XM=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,vw=/^( {2,}|\\)\n(?!\s*$)/,KM=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Ec=/[\p{P}\p{S}]/u,Xp=/[\s\p{P}\p{S}]/u,ww=/[^\s\p{P}\p{S}]/u,ZM=ht(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Xp).getRegex(),kw=/(?!~)[\p{P}\p{S}]/u,QM=/(?!~)[\s\p{P}\p{S}]/u,WM=/(?:[^\s\p{P}\p{S}]|~)/u,Sw=/(?![*_])[\p{P}\p{S}]/u,JM=/(?![*_])[\s\p{P}\p{S}]/u,eO=/(?:[^\s\p{P}\p{S}]|[*_])/u,tO=ht(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",DM?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),Ew=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,nO=ht(Ew,"u").replace(/punct/g,Ec).getRegex(),rO=ht(Ew,"u").replace(/punct/g,kw).getRegex(),Nw="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",aO=ht(Nw,"gu").replace(/notPunctSpace/g,ww).replace(/punctSpace/g,Xp).replace(/punct/g,Ec).getRegex(),lO=ht(Nw,"gu").replace(/notPunctSpace/g,WM).replace(/punctSpace/g,QM).replace(/punct/g,kw).getRegex(),iO=ht("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,ww).replace(/punctSpace/g,Xp).replace(/punct/g,Ec).getRegex(),sO=ht(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,Sw).getRegex(),oO="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",uO=ht(oO,"gu").replace(/notPunctSpace/g,eO).replace(/punctSpace/g,JM).replace(/punct/g,Sw).getRegex(),cO=ht(/\\(punct)/,"gu").replace(/punct/g,Ec).getRegex(),fO=ht(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),dO=ht(Yp).replace("(?:-->|$)","-->").getRegex(),hO=ht("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",dO).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),sc=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,pO=ht(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",sc).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),_w=ht(/^!?\[(label)\]\[(ref)\]/).replace("label",sc).replace("ref",qp).getRegex(),Tw=ht(/^!?\[(ref)\](?:\[\])?/).replace("ref",qp).getRegex(),mO=ht("reflink|nolink(?!\\()","g").replace("reflink",_w).replace("nolink",Tw).getRegex(),c1=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Kp={_backpedal:_l,anyPunctuation:cO,autolink:fO,blockSkip:tO,br:vw,code:XM,del:_l,delLDelim:_l,delRDelim:_l,emStrongLDelim:nO,emStrongRDelimAst:aO,emStrongRDelimUnd:iO,escape:VM,link:pO,nolink:Tw,punctuation:ZM,reflink:_w,reflinkSearch:mO,tag:hO,text:KM,url:_l},gO={...Kp,link:ht(/^!?\[(label)\]\((.*?)\)/).replace("label",sc).getRegex(),reflink:ht(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",sc).getRegex()},Wh={...Kp,emStrongRDelimAst:lO,emStrongLDelim:rO,delLDelim:sO,delRDelim:uO,url:ht(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",c1).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:ht(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",c1).getRegex()},xO={...Wh,br:ht(vw).replace("{2,}","*").getRegex(),text:ht(Wh.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Du={normal:Vp,gfm:qM,pedantic:YM},Ds={normal:Kp,gfm:Wh,breaks:xO,pedantic:gO},bO={"&":"&","<":"<",">":">",'"':""","'":"'"},f1=e=>bO[e];function Yr(e,n){if(n){if(Un.escapeTest.test(e))return e.replace(Un.escapeReplace,f1)}else if(Un.escapeTestNoEncode.test(e))return e.replace(Un.escapeReplaceNoEncode,f1);return e}function d1(e){try{e=encodeURI(e).replace(Un.percentDecode,"%")}catch{return null}return e}function h1(e,n){let r=e.replace(Un.findPipe,(o,u,f)=>{let d=!1,p=u;for(;--p>=0&&f[p]==="\\";)d=!d;return d?"|":" |"}),l=r.split(Un.splitPipe),s=0;if(l[0].trim()||l.shift(),l.length>0&&!l.at(-1)?.trim()&&l.pop(),n)if(l.length>n)l.splice(n);else for(;l.length<n;)l.push("");for(;s<l.length;s++)l[s]=l[s].trim().replace(Un.slashPipe,"|");return l}function zs(e,n,r){let l=e.length;if(l===0)return"";let s=0;for(;s<l&&e.charAt(l-s-1)===n;)s++;return e.slice(0,l-s)}function yO(e,n){if(e.indexOf(n[1])===-1)return-1;let r=0;for(let l=0;l<e.length;l++)if(e[l]==="\\")l++;else if(e[l]===n[0])r++;else if(e[l]===n[1]&&(r--,r<0))return l;return r>0?-2:-1}function vO(e,n=0){let r=n,l="";for(let s of e)if(s===" "){let o=4-r%4;l+=" ".repeat(o),r+=o}else l+=s,r++;return l}function p1(e,n,r,l,s){let o=n.href,u=n.title||null,f=e[1].replace(s.other.outputLinkReplace,"$1");l.state.inLink=!0;let d={type:e[0].charAt(0)==="!"?"image":"link",raw:r,href:o,title:u,text:f,tokens:l.inlineTokens(f)};return l.state.inLink=!1,d}function wO(e,n,r){let l=e.match(r.other.indentCodeCompensation);if(l===null)return n;let s=l[1];return n.split(`
|
|
48
|
+
`).map(o=>{let u=o.match(r.other.beginningSpace);if(u===null)return o;let[f]=u;return f.length>=s.length?o.slice(s.length):o}).join(`
|
|
49
|
+
`)}var oc=class{options;rules;lexer;constructor(e){this.options=e||Ml}space(e){let n=this.rules.block.newline.exec(e);if(n&&n[0].length>0)return{type:"space",raw:n[0]}}code(e){let n=this.rules.block.code.exec(e);if(n){let r=n[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:n[0],codeBlockStyle:"indented",text:this.options.pedantic?r:zs(r,`
|
|
50
|
+
`)}}}fences(e){let n=this.rules.block.fences.exec(e);if(n){let r=n[0],l=wO(r,n[3]||"",this.rules);return{type:"code",raw:r,lang:n[2]?n[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):n[2],text:l}}}heading(e){let n=this.rules.block.heading.exec(e);if(n){let r=n[2].trim();if(this.rules.other.endingHash.test(r)){let l=zs(r,"#");(this.options.pedantic||!l||this.rules.other.endingSpaceChar.test(l))&&(r=l.trim())}return{type:"heading",raw:n[0],depth:n[1].length,text:r,tokens:this.lexer.inline(r)}}}hr(e){let n=this.rules.block.hr.exec(e);if(n)return{type:"hr",raw:zs(n[0],`
|
|
51
|
+
`)}}blockquote(e){let n=this.rules.block.blockquote.exec(e);if(n){let r=zs(n[0],`
|
|
52
|
+
`).split(`
|
|
53
|
+
`),l="",s="",o=[];for(;r.length>0;){let u=!1,f=[],d;for(d=0;d<r.length;d++)if(this.rules.other.blockquoteStart.test(r[d]))f.push(r[d]),u=!0;else if(!u)f.push(r[d]);else break;r=r.slice(d);let p=f.join(`
|
|
54
|
+
`),x=p.replace(this.rules.other.blockquoteSetextReplace,`
|
|
55
|
+
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");l=l?`${l}
|
|
56
|
+
${p}`:p,s=s?`${s}
|
|
57
|
+
${x}`:x;let g=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(x,o,!0),this.lexer.state.top=g,r.length===0)break;let y=o.at(-1);if(y?.type==="code")break;if(y?.type==="blockquote"){let v=y,S=v.raw+`
|
|
58
|
+
`+r.join(`
|
|
59
|
+
`),E=this.blockquote(S);o[o.length-1]=E,l=l.substring(0,l.length-v.raw.length)+E.raw,s=s.substring(0,s.length-v.text.length)+E.text;break}else if(y?.type==="list"){let v=y,S=v.raw+`
|
|
60
|
+
`+r.join(`
|
|
61
|
+
`),E=this.list(S);o[o.length-1]=E,l=l.substring(0,l.length-y.raw.length)+E.raw,s=s.substring(0,s.length-v.raw.length)+E.raw,r=S.substring(o.at(-1).raw.length).split(`
|
|
62
|
+
`);continue}}return{type:"blockquote",raw:l,tokens:o,text:s}}}list(e){let n=this.rules.block.list.exec(e);if(n){let r=n[1].trim(),l=r.length>1,s={type:"list",raw:"",ordered:l,start:l?+r.slice(0,-1):"",loose:!1,items:[]};r=l?`\\d{1,9}\\${r.slice(-1)}`:`\\${r}`,this.options.pedantic&&(r=l?r:"[*+-]");let o=this.rules.other.listItemRegex(r),u=!1;for(;e;){let d=!1,p="",x="";if(!(n=o.exec(e))||this.rules.block.hr.test(e))break;p=n[0],e=e.substring(p.length);let g=vO(n[2].split(`
|
|
63
|
+
`,1)[0],n[1].length),y=e.split(`
|
|
64
|
+
`,1)[0],v=!g.trim(),S=0;if(this.options.pedantic?(S=2,x=g.trimStart()):v?S=n[1].length+1:(S=g.search(this.rules.other.nonSpaceChar),S=S>4?1:S,x=g.slice(S),S+=n[1].length),v&&this.rules.other.blankLine.test(y)&&(p+=y+`
|
|
65
|
+
`,e=e.substring(y.length+1),d=!0),!d){let E=this.rules.other.nextBulletRegex(S),T=this.rules.other.hrRegex(S),N=this.rules.other.fencesBeginRegex(S),j=this.rules.other.headingBeginRegex(S),C=this.rules.other.htmlBeginRegex(S),I=this.rules.other.blockquoteBeginRegex(S);for(;e;){let U=e.split(`
|
|
66
|
+
`,1)[0],_;if(y=U,this.options.pedantic?(y=y.replace(this.rules.other.listReplaceNesting," "),_=y):_=y.replace(this.rules.other.tabCharGlobal," "),N.test(y)||j.test(y)||C.test(y)||I.test(y)||E.test(y)||T.test(y))break;if(_.search(this.rules.other.nonSpaceChar)>=S||!y.trim())x+=`
|
|
67
|
+
`+_.slice(S);else{if(v||g.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||N.test(g)||j.test(g)||T.test(g))break;x+=`
|
|
68
|
+
`+y}v=!y.trim(),p+=U+`
|
|
69
|
+
`,e=e.substring(U.length+1),g=_.slice(S)}}s.loose||(u?s.loose=!0:this.rules.other.doubleBlankLine.test(p)&&(u=!0)),s.items.push({type:"list_item",raw:p,task:!!this.options.gfm&&this.rules.other.listIsTask.test(x),loose:!1,text:x,tokens:[]}),s.raw+=p}let f=s.items.at(-1);if(f)f.raw=f.raw.trimEnd(),f.text=f.text.trimEnd();else return;s.raw=s.raw.trimEnd();for(let d of s.items){if(this.lexer.state.top=!1,d.tokens=this.lexer.blockTokens(d.text,[]),d.task){if(d.text=d.text.replace(this.rules.other.listReplaceTask,""),d.tokens[0]?.type==="text"||d.tokens[0]?.type==="paragraph"){d.tokens[0].raw=d.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),d.tokens[0].text=d.tokens[0].text.replace(this.rules.other.listReplaceTask,"");for(let x=this.lexer.inlineQueue.length-1;x>=0;x--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[x].src)){this.lexer.inlineQueue[x].src=this.lexer.inlineQueue[x].src.replace(this.rules.other.listReplaceTask,"");break}}let p=this.rules.other.listTaskCheckbox.exec(d.raw);if(p){let x={type:"checkbox",raw:p[0]+" ",checked:p[0]!=="[ ]"};d.checked=x.checked,s.loose?d.tokens[0]&&["paragraph","text"].includes(d.tokens[0].type)&&"tokens"in d.tokens[0]&&d.tokens[0].tokens?(d.tokens[0].raw=x.raw+d.tokens[0].raw,d.tokens[0].text=x.raw+d.tokens[0].text,d.tokens[0].tokens.unshift(x)):d.tokens.unshift({type:"paragraph",raw:x.raw,text:x.raw,tokens:[x]}):d.tokens.unshift(x)}}if(!s.loose){let p=d.tokens.filter(g=>g.type==="space"),x=p.length>0&&p.some(g=>this.rules.other.anyLine.test(g.raw));s.loose=x}}if(s.loose)for(let d of s.items){d.loose=!0;for(let p of d.tokens)p.type==="text"&&(p.type="paragraph")}return s}}html(e){let n=this.rules.block.html.exec(e);if(n)return{type:"html",block:!0,raw:n[0],pre:n[1]==="pre"||n[1]==="script"||n[1]==="style",text:n[0]}}def(e){let n=this.rules.block.def.exec(e);if(n){let r=n[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),l=n[2]?n[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",s=n[3]?n[3].substring(1,n[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):n[3];return{type:"def",tag:r,raw:n[0],href:l,title:s}}}table(e){let n=this.rules.block.table.exec(e);if(!n||!this.rules.other.tableDelimiter.test(n[2]))return;let r=h1(n[1]),l=n[2].replace(this.rules.other.tableAlignChars,"").split("|"),s=n[3]?.trim()?n[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
70
|
+
`):[],o={type:"table",raw:n[0],header:[],align:[],rows:[]};if(r.length===l.length){for(let u of l)this.rules.other.tableAlignRight.test(u)?o.align.push("right"):this.rules.other.tableAlignCenter.test(u)?o.align.push("center"):this.rules.other.tableAlignLeft.test(u)?o.align.push("left"):o.align.push(null);for(let u=0;u<r.length;u++)o.header.push({text:r[u],tokens:this.lexer.inline(r[u]),header:!0,align:o.align[u]});for(let u of s)o.rows.push(h1(u,o.header.length).map((f,d)=>({text:f,tokens:this.lexer.inline(f),header:!1,align:o.align[d]})));return o}}lheading(e){let n=this.rules.block.lheading.exec(e);if(n)return{type:"heading",raw:n[0],depth:n[2].charAt(0)==="="?1:2,text:n[1],tokens:this.lexer.inline(n[1])}}paragraph(e){let n=this.rules.block.paragraph.exec(e);if(n){let r=n[1].charAt(n[1].length-1)===`
|
|
71
|
+
`?n[1].slice(0,-1):n[1];return{type:"paragraph",raw:n[0],text:r,tokens:this.lexer.inline(r)}}}text(e){let n=this.rules.block.text.exec(e);if(n)return{type:"text",raw:n[0],text:n[0],tokens:this.lexer.inline(n[0])}}escape(e){let n=this.rules.inline.escape.exec(e);if(n)return{type:"escape",raw:n[0],text:n[1]}}tag(e){let n=this.rules.inline.tag.exec(e);if(n)return!this.lexer.state.inLink&&this.rules.other.startATag.test(n[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(n[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(n[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(n[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:n[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:n[0]}}link(e){let n=this.rules.inline.link.exec(e);if(n){let r=n[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;let o=zs(r.slice(0,-1),"\\");if((r.length-o.length)%2===0)return}else{let o=yO(n[2],"()");if(o===-2)return;if(o>-1){let u=(n[0].indexOf("!")===0?5:4)+n[1].length+o;n[2]=n[2].substring(0,o),n[0]=n[0].substring(0,u).trim(),n[3]=""}}let l=n[2],s="";if(this.options.pedantic){let o=this.rules.other.pedanticHrefTitle.exec(l);o&&(l=o[1],s=o[3])}else s=n[3]?n[3].slice(1,-1):"";return l=l.trim(),this.rules.other.startAngleBracket.test(l)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?l=l.slice(1):l=l.slice(1,-1)),p1(n,{href:l&&l.replace(this.rules.inline.anyPunctuation,"$1"),title:s&&s.replace(this.rules.inline.anyPunctuation,"$1")},n[0],this.lexer,this.rules)}}reflink(e,n){let r;if((r=this.rules.inline.reflink.exec(e))||(r=this.rules.inline.nolink.exec(e))){let l=(r[2]||r[1]).replace(this.rules.other.multipleSpaceGlobal," "),s=n[l.toLowerCase()];if(!s){let o=r[0].charAt(0);return{type:"text",raw:o,text:o}}return p1(r,s,r[0],this.lexer,this.rules)}}emStrong(e,n,r=""){let l=this.rules.inline.emStrongLDelim.exec(e);if(!(!l||l[3]&&r.match(this.rules.other.unicodeAlphaNumeric))&&(!(l[1]||l[2])||!r||this.rules.inline.punctuation.exec(r))){let s=[...l[0]].length-1,o,u,f=s,d=0,p=l[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(p.lastIndex=0,n=n.slice(-1*e.length+s);(l=p.exec(n))!=null;){if(o=l[1]||l[2]||l[3]||l[4]||l[5]||l[6],!o)continue;if(u=[...o].length,l[3]||l[4]){f+=u;continue}else if((l[5]||l[6])&&s%3&&!((s+u)%3)){d+=u;continue}if(f-=u,f>0)continue;u=Math.min(u,u+f+d);let x=[...l[0]][0].length,g=e.slice(0,s+l.index+x+u);if(Math.min(s,u)%2){let v=g.slice(1,-1);return{type:"em",raw:g,text:v,tokens:this.lexer.inlineTokens(v)}}let y=g.slice(2,-2);return{type:"strong",raw:g,text:y,tokens:this.lexer.inlineTokens(y)}}}}codespan(e){let n=this.rules.inline.code.exec(e);if(n){let r=n[2].replace(this.rules.other.newLineCharGlobal," "),l=this.rules.other.nonSpaceChar.test(r),s=this.rules.other.startingSpaceChar.test(r)&&this.rules.other.endingSpaceChar.test(r);return l&&s&&(r=r.substring(1,r.length-1)),{type:"codespan",raw:n[0],text:r}}}br(e){let n=this.rules.inline.br.exec(e);if(n)return{type:"br",raw:n[0]}}del(e,n,r=""){let l=this.rules.inline.delLDelim.exec(e);if(l&&(!l[1]||!r||this.rules.inline.punctuation.exec(r))){let s=[...l[0]].length-1,o,u,f=s,d=this.rules.inline.delRDelim;for(d.lastIndex=0,n=n.slice(-1*e.length+s);(l=d.exec(n))!=null;){if(o=l[1]||l[2]||l[3]||l[4]||l[5]||l[6],!o||(u=[...o].length,u!==s))continue;if(l[3]||l[4]){f+=u;continue}if(f-=u,f>0)continue;u=Math.min(u,u+f);let p=[...l[0]][0].length,x=e.slice(0,s+l.index+p+u),g=x.slice(s,-s);return{type:"del",raw:x,text:g,tokens:this.lexer.inlineTokens(g)}}}}autolink(e){let n=this.rules.inline.autolink.exec(e);if(n){let r,l;return n[2]==="@"?(r=n[1],l="mailto:"+r):(r=n[1],l=r),{type:"link",raw:n[0],text:r,href:l,tokens:[{type:"text",raw:r,text:r}]}}}url(e){let n;if(n=this.rules.inline.url.exec(e)){let r,l;if(n[2]==="@")r=n[0],l="mailto:"+r;else{let s;do s=n[0],n[0]=this.rules.inline._backpedal.exec(n[0])?.[0]??"";while(s!==n[0]);r=n[0],n[1]==="www."?l="http://"+n[0]:l=n[0]}return{type:"link",raw:n[0],text:r,href:l,tokens:[{type:"text",raw:r,text:r}]}}}inlineText(e){let n=this.rules.inline.text.exec(e);if(n){let r=this.lexer.state.inRawBlock;return{type:"text",raw:n[0],text:n[0],escaped:r}}}},Dr=class Jh{tokens;options;state;inlineQueue;tokenizer;constructor(n){this.tokens=[],this.tokens.links=Object.create(null),this.options=n||Ml,this.options.tokenizer=this.options.tokenizer||new oc,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let r={other:Un,block:Du.normal,inline:Ds.normal};this.options.pedantic?(r.block=Du.pedantic,r.inline=Ds.pedantic):this.options.gfm&&(r.block=Du.gfm,this.options.breaks?r.inline=Ds.breaks:r.inline=Ds.gfm),this.tokenizer.rules=r}static get rules(){return{block:Du,inline:Ds}}static lex(n,r){return new Jh(r).lex(n)}static lexInline(n,r){return new Jh(r).inlineTokens(n)}lex(n){n=n.replace(Un.carriageReturn,`
|
|
72
|
+
`),this.blockTokens(n,this.tokens);for(let r=0;r<this.inlineQueue.length;r++){let l=this.inlineQueue[r];this.inlineTokens(l.src,l.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(n,r=[],l=!1){for(this.options.pedantic&&(n=n.replace(Un.tabCharGlobal," ").replace(Un.spaceLine,""));n;){let s;if(this.options.extensions?.block?.some(u=>(s=u.call({lexer:this},n,r))?(n=n.substring(s.raw.length),r.push(s),!0):!1))continue;if(s=this.tokenizer.space(n)){n=n.substring(s.raw.length);let u=r.at(-1);s.raw.length===1&&u!==void 0?u.raw+=`
|
|
73
|
+
`:r.push(s);continue}if(s=this.tokenizer.code(n)){n=n.substring(s.raw.length);let u=r.at(-1);u?.type==="paragraph"||u?.type==="text"?(u.raw+=(u.raw.endsWith(`
|
|
74
|
+
`)?"":`
|
|
75
|
+
`)+s.raw,u.text+=`
|
|
76
|
+
`+s.text,this.inlineQueue.at(-1).src=u.text):r.push(s);continue}if(s=this.tokenizer.fences(n)){n=n.substring(s.raw.length),r.push(s);continue}if(s=this.tokenizer.heading(n)){n=n.substring(s.raw.length),r.push(s);continue}if(s=this.tokenizer.hr(n)){n=n.substring(s.raw.length),r.push(s);continue}if(s=this.tokenizer.blockquote(n)){n=n.substring(s.raw.length),r.push(s);continue}if(s=this.tokenizer.list(n)){n=n.substring(s.raw.length),r.push(s);continue}if(s=this.tokenizer.html(n)){n=n.substring(s.raw.length),r.push(s);continue}if(s=this.tokenizer.def(n)){n=n.substring(s.raw.length);let u=r.at(-1);u?.type==="paragraph"||u?.type==="text"?(u.raw+=(u.raw.endsWith(`
|
|
77
|
+
`)?"":`
|
|
78
|
+
`)+s.raw,u.text+=`
|
|
79
|
+
`+s.raw,this.inlineQueue.at(-1).src=u.text):this.tokens.links[s.tag]||(this.tokens.links[s.tag]={href:s.href,title:s.title},r.push(s));continue}if(s=this.tokenizer.table(n)){n=n.substring(s.raw.length),r.push(s);continue}if(s=this.tokenizer.lheading(n)){n=n.substring(s.raw.length),r.push(s);continue}let o=n;if(this.options.extensions?.startBlock){let u=1/0,f=n.slice(1),d;this.options.extensions.startBlock.forEach(p=>{d=p.call({lexer:this},f),typeof d=="number"&&d>=0&&(u=Math.min(u,d))}),u<1/0&&u>=0&&(o=n.substring(0,u+1))}if(this.state.top&&(s=this.tokenizer.paragraph(o))){let u=r.at(-1);l&&u?.type==="paragraph"?(u.raw+=(u.raw.endsWith(`
|
|
80
|
+
`)?"":`
|
|
81
|
+
`)+s.raw,u.text+=`
|
|
82
|
+
`+s.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=u.text):r.push(s),l=o.length!==n.length,n=n.substring(s.raw.length);continue}if(s=this.tokenizer.text(n)){n=n.substring(s.raw.length);let u=r.at(-1);u?.type==="text"?(u.raw+=(u.raw.endsWith(`
|
|
83
|
+
`)?"":`
|
|
84
|
+
`)+s.raw,u.text+=`
|
|
85
|
+
`+s.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=u.text):r.push(s);continue}if(n){let u="Infinite loop on byte: "+n.charCodeAt(0);if(this.options.silent){console.error(u);break}else throw new Error(u)}}return this.state.top=!0,r}inline(n,r=[]){return this.inlineQueue.push({src:n,tokens:r}),r}inlineTokens(n,r=[]){let l=n,s=null;if(this.tokens.links){let d=Object.keys(this.tokens.links);if(d.length>0)for(;(s=this.tokenizer.rules.inline.reflinkSearch.exec(l))!=null;)d.includes(s[0].slice(s[0].lastIndexOf("[")+1,-1))&&(l=l.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(s=this.tokenizer.rules.inline.anyPunctuation.exec(l))!=null;)l=l.slice(0,s.index)+"++"+l.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let o;for(;(s=this.tokenizer.rules.inline.blockSkip.exec(l))!=null;)o=s[2]?s[2].length:0,l=l.slice(0,s.index+o)+"["+"a".repeat(s[0].length-o-2)+"]"+l.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);l=this.options.hooks?.emStrongMask?.call({lexer:this},l)??l;let u=!1,f="";for(;n;){u||(f=""),u=!1;let d;if(this.options.extensions?.inline?.some(x=>(d=x.call({lexer:this},n,r))?(n=n.substring(d.raw.length),r.push(d),!0):!1))continue;if(d=this.tokenizer.escape(n)){n=n.substring(d.raw.length),r.push(d);continue}if(d=this.tokenizer.tag(n)){n=n.substring(d.raw.length),r.push(d);continue}if(d=this.tokenizer.link(n)){n=n.substring(d.raw.length),r.push(d);continue}if(d=this.tokenizer.reflink(n,this.tokens.links)){n=n.substring(d.raw.length);let x=r.at(-1);d.type==="text"&&x?.type==="text"?(x.raw+=d.raw,x.text+=d.text):r.push(d);continue}if(d=this.tokenizer.emStrong(n,l,f)){n=n.substring(d.raw.length),r.push(d);continue}if(d=this.tokenizer.codespan(n)){n=n.substring(d.raw.length),r.push(d);continue}if(d=this.tokenizer.br(n)){n=n.substring(d.raw.length),r.push(d);continue}if(d=this.tokenizer.del(n,l,f)){n=n.substring(d.raw.length),r.push(d);continue}if(d=this.tokenizer.autolink(n)){n=n.substring(d.raw.length),r.push(d);continue}if(!this.state.inLink&&(d=this.tokenizer.url(n))){n=n.substring(d.raw.length),r.push(d);continue}let p=n;if(this.options.extensions?.startInline){let x=1/0,g=n.slice(1),y;this.options.extensions.startInline.forEach(v=>{y=v.call({lexer:this},g),typeof y=="number"&&y>=0&&(x=Math.min(x,y))}),x<1/0&&x>=0&&(p=n.substring(0,x+1))}if(d=this.tokenizer.inlineText(p)){n=n.substring(d.raw.length),d.raw.slice(-1)!=="_"&&(f=d.raw.slice(-1)),u=!0;let x=r.at(-1);x?.type==="text"?(x.raw+=d.raw,x.text+=d.text):r.push(d);continue}if(n){let x="Infinite loop on byte: "+n.charCodeAt(0);if(this.options.silent){console.error(x);break}else throw new Error(x)}}return r}},uc=class{options;parser;constructor(e){this.options=e||Ml}space(e){return""}code({text:e,lang:n,escaped:r}){let l=(n||"").match(Un.notSpaceStart)?.[0],s=e.replace(Un.endingNewline,"")+`
|
|
86
|
+
`;return l?'<pre><code class="language-'+Yr(l)+'">'+(r?s:Yr(s,!0))+`</code></pre>
|
|
87
|
+
`:"<pre><code>"+(r?s:Yr(s,!0))+`</code></pre>
|
|
88
|
+
`}blockquote({tokens:e}){return`<blockquote>
|
|
89
|
+
${this.parser.parse(e)}</blockquote>
|
|
90
|
+
`}html({text:e}){return e}def(e){return""}heading({tokens:e,depth:n}){return`<h${n}>${this.parser.parseInline(e)}</h${n}>
|
|
91
|
+
`}hr(e){return`<hr>
|
|
92
|
+
`}list(e){let n=e.ordered,r=e.start,l="";for(let u=0;u<e.items.length;u++){let f=e.items[u];l+=this.listitem(f)}let s=n?"ol":"ul",o=n&&r!==1?' start="'+r+'"':"";return"<"+s+o+`>
|
|
93
|
+
`+l+"</"+s+`>
|
|
94
|
+
`}listitem(e){return`<li>${this.parser.parse(e.tokens)}</li>
|
|
95
|
+
`}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
|
|
96
|
+
`}table(e){let n="",r="";for(let s=0;s<e.header.length;s++)r+=this.tablecell(e.header[s]);n+=this.tablerow({text:r});let l="";for(let s=0;s<e.rows.length;s++){let o=e.rows[s];r="";for(let u=0;u<o.length;u++)r+=this.tablecell(o[u]);l+=this.tablerow({text:r})}return l&&(l=`<tbody>${l}</tbody>`),`<table>
|
|
97
|
+
<thead>
|
|
98
|
+
`+n+`</thead>
|
|
99
|
+
`+l+`</table>
|
|
100
|
+
`}tablerow({text:e}){return`<tr>
|
|
101
|
+
${e}</tr>
|
|
102
|
+
`}tablecell(e){let n=this.parser.parseInline(e.tokens),r=e.header?"th":"td";return(e.align?`<${r} align="${e.align}">`:`<${r}>`)+n+`</${r}>
|
|
103
|
+
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${Yr(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:n,tokens:r}){let l=this.parser.parseInline(r),s=d1(e);if(s===null)return l;e=s;let o='<a href="'+e+'"';return n&&(o+=' title="'+Yr(n)+'"'),o+=">"+l+"</a>",o}image({href:e,title:n,text:r,tokens:l}){l&&(r=this.parser.parseInline(l,this.parser.textRenderer));let s=d1(e);if(s===null)return Yr(r);e=s;let o=`<img src="${e}" alt="${Yr(r)}"`;return n&&(o+=` title="${Yr(n)}"`),o+=">",o}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:Yr(e.text)}},Zp=class{strong({text:n}){return n}em({text:n}){return n}codespan({text:n}){return n}del({text:n}){return n}html({text:n}){return n}text({text:n}){return n}link({text:n}){return""+n}image({text:n}){return""+n}br(){return""}checkbox({raw:n}){return n}},zr=class ep{options;renderer;textRenderer;constructor(n){this.options=n||Ml,this.options.renderer=this.options.renderer||new uc,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Zp}static parse(n,r){return new ep(r).parse(n)}static parseInline(n,r){return new ep(r).parseInline(n)}parse(n){let r="";for(let l=0;l<n.length;l++){let s=n[l];if(this.options.extensions?.renderers?.[s.type]){let u=s,f=this.options.extensions.renderers[u.type].call({parser:this},u);if(f!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(u.type)){r+=f||"";continue}}let o=s;switch(o.type){case"space":{r+=this.renderer.space(o);break}case"hr":{r+=this.renderer.hr(o);break}case"heading":{r+=this.renderer.heading(o);break}case"code":{r+=this.renderer.code(o);break}case"table":{r+=this.renderer.table(o);break}case"blockquote":{r+=this.renderer.blockquote(o);break}case"list":{r+=this.renderer.list(o);break}case"checkbox":{r+=this.renderer.checkbox(o);break}case"html":{r+=this.renderer.html(o);break}case"def":{r+=this.renderer.def(o);break}case"paragraph":{r+=this.renderer.paragraph(o);break}case"text":{r+=this.renderer.text(o);break}default:{let u='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(u),"";throw new Error(u)}}}return r}parseInline(n,r=this.renderer){let l="";for(let s=0;s<n.length;s++){let o=n[s];if(this.options.extensions?.renderers?.[o.type]){let f=this.options.extensions.renderers[o.type].call({parser:this},o);if(f!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(o.type)){l+=f||"";continue}}let u=o;switch(u.type){case"escape":{l+=r.text(u);break}case"html":{l+=r.html(u);break}case"link":{l+=r.link(u);break}case"image":{l+=r.image(u);break}case"checkbox":{l+=r.checkbox(u);break}case"strong":{l+=r.strong(u);break}case"em":{l+=r.em(u);break}case"codespan":{l+=r.codespan(u);break}case"br":{l+=r.br(u);break}case"del":{l+=r.del(u);break}case"text":{l+=r.text(u);break}default:{let f='Token with "'+u.type+'" type was not found.';if(this.options.silent)return console.error(f),"";throw new Error(f)}}}return l}},qs=class{options;block;constructor(n){this.options=n||Ml}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(n){return n}postprocess(n){return n}processAllTokens(n){return n}emStrongMask(n){return n}provideLexer(){return this.block?Dr.lex:Dr.lexInline}provideParser(){return this.block?zr.parse:zr.parseInline}},kO=class{defaults=Pp();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=zr;Renderer=uc;TextRenderer=Zp;Lexer=Dr;Tokenizer=oc;Hooks=qs;constructor(...n){this.use(...n)}walkTokens(n,r){let l=[];for(let s of n)switch(l=l.concat(r.call(this,s)),s.type){case"table":{let o=s;for(let u of o.header)l=l.concat(this.walkTokens(u.tokens,r));for(let u of o.rows)for(let f of u)l=l.concat(this.walkTokens(f.tokens,r));break}case"list":{let o=s;l=l.concat(this.walkTokens(o.items,r));break}default:{let o=s;this.defaults.extensions?.childTokens?.[o.type]?this.defaults.extensions.childTokens[o.type].forEach(u=>{let f=o[u].flat(1/0);l=l.concat(this.walkTokens(f,r))}):o.tokens&&(l=l.concat(this.walkTokens(o.tokens,r)))}}return l}use(...n){let r=this.defaults.extensions||{renderers:{},childTokens:{}};return n.forEach(l=>{let s={...l};if(s.async=this.defaults.async||s.async||!1,l.extensions&&(l.extensions.forEach(o=>{if(!o.name)throw new Error("extension name required");if("renderer"in o){let u=r.renderers[o.name];u?r.renderers[o.name]=function(...f){let d=o.renderer.apply(this,f);return d===!1&&(d=u.apply(this,f)),d}:r.renderers[o.name]=o.renderer}if("tokenizer"in o){if(!o.level||o.level!=="block"&&o.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let u=r[o.level];u?u.unshift(o.tokenizer):r[o.level]=[o.tokenizer],o.start&&(o.level==="block"?r.startBlock?r.startBlock.push(o.start):r.startBlock=[o.start]:o.level==="inline"&&(r.startInline?r.startInline.push(o.start):r.startInline=[o.start]))}"childTokens"in o&&o.childTokens&&(r.childTokens[o.name]=o.childTokens)}),s.extensions=r),l.renderer){let o=this.defaults.renderer||new uc(this.defaults);for(let u in l.renderer){if(!(u in o))throw new Error(`renderer '${u}' does not exist`);if(["options","parser"].includes(u))continue;let f=u,d=l.renderer[f],p=o[f];o[f]=(...x)=>{let g=d.apply(o,x);return g===!1&&(g=p.apply(o,x)),g||""}}s.renderer=o}if(l.tokenizer){let o=this.defaults.tokenizer||new oc(this.defaults);for(let u in l.tokenizer){if(!(u in o))throw new Error(`tokenizer '${u}' does not exist`);if(["options","rules","lexer"].includes(u))continue;let f=u,d=l.tokenizer[f],p=o[f];o[f]=(...x)=>{let g=d.apply(o,x);return g===!1&&(g=p.apply(o,x)),g}}s.tokenizer=o}if(l.hooks){let o=this.defaults.hooks||new qs;for(let u in l.hooks){if(!(u in o))throw new Error(`hook '${u}' does not exist`);if(["options","block"].includes(u))continue;let f=u,d=l.hooks[f],p=o[f];qs.passThroughHooks.has(u)?o[f]=x=>{if(this.defaults.async&&qs.passThroughHooksRespectAsync.has(u))return(async()=>{let y=await d.call(o,x);return p.call(o,y)})();let g=d.call(o,x);return p.call(o,g)}:o[f]=(...x)=>{if(this.defaults.async)return(async()=>{let y=await d.apply(o,x);return y===!1&&(y=await p.apply(o,x)),y})();let g=d.apply(o,x);return g===!1&&(g=p.apply(o,x)),g}}s.hooks=o}if(l.walkTokens){let o=this.defaults.walkTokens,u=l.walkTokens;s.walkTokens=function(f){let d=[];return d.push(u.call(this,f)),o&&(d=d.concat(o.call(this,f))),d}}this.defaults={...this.defaults,...s}}),this}setOptions(n){return this.defaults={...this.defaults,...n},this}lexer(n,r){return Dr.lex(n,r??this.defaults)}parser(n,r){return zr.parse(n,r??this.defaults)}parseMarkdown(n){return(r,l)=>{let s={...l},o={...this.defaults,...s},u=this.onError(!!o.silent,!!o.async);if(this.defaults.async===!0&&s.async===!1)return u(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof r>"u"||r===null)return u(new Error("marked(): input parameter is undefined or null"));if(typeof r!="string")return u(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(r)+", string expected"));if(o.hooks&&(o.hooks.options=o,o.hooks.block=n),o.async)return(async()=>{let f=o.hooks?await o.hooks.preprocess(r):r,d=await(o.hooks?await o.hooks.provideLexer():n?Dr.lex:Dr.lexInline)(f,o),p=o.hooks?await o.hooks.processAllTokens(d):d;o.walkTokens&&await Promise.all(this.walkTokens(p,o.walkTokens));let x=await(o.hooks?await o.hooks.provideParser():n?zr.parse:zr.parseInline)(p,o);return o.hooks?await o.hooks.postprocess(x):x})().catch(u);try{o.hooks&&(r=o.hooks.preprocess(r));let f=(o.hooks?o.hooks.provideLexer():n?Dr.lex:Dr.lexInline)(r,o);o.hooks&&(f=o.hooks.processAllTokens(f)),o.walkTokens&&this.walkTokens(f,o.walkTokens);let d=(o.hooks?o.hooks.provideParser():n?zr.parse:zr.parseInline)(f,o);return o.hooks&&(d=o.hooks.postprocess(d)),d}catch(f){return u(f)}}}onError(n,r){return l=>{if(l.message+=`
|
|
104
|
+
Please report this to https://github.com/markedjs/marked.`,n){let s="<p>An error occurred:</p><pre>"+Yr(l.message+"",!0)+"</pre>";return r?Promise.resolve(s):s}if(r)return Promise.reject(l);throw l}}},Al=new kO;function kt(e,n){return Al.parse(e,n)}kt.options=kt.setOptions=function(e){return Al.setOptions(e),kt.defaults=Al.defaults,gw(kt.defaults),kt};kt.getDefaults=Pp;kt.defaults=Ml;kt.use=function(...e){return Al.use(...e),kt.defaults=Al.defaults,gw(kt.defaults),kt};kt.walkTokens=function(e,n){return Al.walkTokens(e,n)};kt.parseInline=Al.parseInline;kt.Parser=zr;kt.parser=zr.parse;kt.Renderer=uc;kt.TextRenderer=Zp;kt.Lexer=Dr;kt.lexer=Dr.lex;kt.Tokenizer=oc;kt.Hooks=qs;kt.parse=kt;kt.options;kt.setOptions;kt.use;kt.walkTokens;kt.parseInline;zr.parse;Dr.lex;function SO(e){if(typeof e=="function"&&(e={highlight:e}),!e||typeof e.highlight!="function")throw new Error("Must provide highlight function");return typeof e.langPrefix!="string"&&(e.langPrefix="language-"),typeof e.emptyLangClass!="string"&&(e.emptyLangClass=""),{async:!!e.async,walkTokens(n){if(n.type!=="code")return;const r=m1(n.lang);if(e.async)return Promise.resolve(e.highlight(n.text,r,n.lang||"")).then(g1(n));const l=e.highlight(n.text,r,n.lang||"");if(l instanceof Promise)throw new Error("markedHighlight is not set to async but the highlight function is async. Set the async option to true on markedHighlight to await the async highlight function.");g1(n)(l)},useNewRenderer:!0,renderer:{code(n,r,l){typeof n=="object"&&(l=n.escaped,r=n.lang,n=n.text);const s=m1(r),o=s?e.langPrefix+b1(s):e.emptyLangClass,u=o?` class="${o}"`:"";return n=n.replace(/\n$/,""),`<pre><code${u}>${l?n:b1(n,!0)}
|
|
105
|
+
</code></pre>`}}}}function m1(e){return(e||"").match(/\S*/)[0]}function g1(e){return n=>{typeof n=="string"&&n!==e.text&&(e.escaped=!0,e.text=n)}}const Aw=/[&<>"']/,EO=new RegExp(Aw.source,"g"),Cw=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,NO=new RegExp(Cw.source,"g"),_O={"&":"&","<":"<",">":">",'"':""","'":"'"},x1=e=>_O[e];function b1(e,n){if(n){if(Aw.test(e))return e.replace(EO,x1)}else if(Cw.test(e))return e.replace(NO,x1);return e}const{entries:Rw,setPrototypeOf:y1,isFrozen:TO,getPrototypeOf:AO,getOwnPropertyDescriptor:CO}=Object;let{freeze:$n,seal:Tr,create:Xu}=Object,{apply:tp,construct:np}=typeof Reflect<"u"&&Reflect;$n||($n=function(n){return n});Tr||(Tr=function(n){return n});tp||(tp=function(n,r){for(var l=arguments.length,s=new Array(l>2?l-2:0),o=2;o<l;o++)s[o-2]=arguments[o];return n.apply(r,s)});np||(np=function(n){for(var r=arguments.length,l=new Array(r>1?r-1:0),s=1;s<r;s++)l[s-1]=arguments[s];return new n(...l)});const zu=Hn(Array.prototype.forEach),RO=Hn(Array.prototype.lastIndexOf),v1=Hn(Array.prototype.pop),Ls=Hn(Array.prototype.push),jO=Hn(Array.prototype.splice),Ku=Hn(String.prototype.toLowerCase),ph=Hn(String.prototype.toString),mh=Hn(String.prototype.match),Bs=Hn(String.prototype.replace),MO=Hn(String.prototype.indexOf),OO=Hn(String.prototype.trim),fr=Hn(Object.prototype.hasOwnProperty),Bn=Hn(RegExp.prototype.test),Is=DO(TypeError);function Hn(e){return function(n){n instanceof RegExp&&(n.lastIndex=0);for(var r=arguments.length,l=new Array(r>1?r-1:0),s=1;s<r;s++)l[s-1]=arguments[s];return tp(e,n,l)}}function DO(e){return function(){for(var n=arguments.length,r=new Array(n),l=0;l<n;l++)r[l]=arguments[l];return np(e,r)}}function tt(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Ku;y1&&y1(e,null);let l=n.length;for(;l--;){let s=n[l];if(typeof s=="string"){const o=r(s);o!==s&&(TO(n)||(n[l]=o),s=o)}e[s]=!0}return e}function zO(e){for(let n=0;n<e.length;n++)fr(e,n)||(e[n]=null);return e}function Vr(e){const n=Xu(null);for(const[r,l]of Rw(e))fr(e,r)&&(Array.isArray(l)?n[r]=zO(l):l&&typeof l=="object"&&l.constructor===Object?n[r]=Vr(l):n[r]=l);return n}function Us(e,n){for(;e!==null;){const l=CO(e,n);if(l){if(l.get)return Hn(l.get);if(typeof l.value=="function")return Hn(l.value)}e=AO(e)}function r(){return null}return r}const w1=$n(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),gh=$n(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),xh=$n(["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"]),LO=$n(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),bh=$n(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),BO=$n(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),k1=$n(["#text"]),S1=$n(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),yh=$n(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),E1=$n(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Lu=$n(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),IO=Tr(/\{\{[\w\W]*|[\w\W]*\}\}/gm),UO=Tr(/<%[\w\W]*|[\w\W]*%>/gm),$O=Tr(/\$\{[\w\W]*/gm),HO=Tr(/^data-[\-\w.\u00B7-\uFFFF]+$/),PO=Tr(/^aria-[\-\w]+$/),jw=Tr(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),FO=Tr(/^(?:\w+script|data):/i),GO=Tr(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Mw=Tr(/^html$/i),qO=Tr(/^[a-z][.\w]*(-[.\w]+)+$/i);var N1=Object.freeze({__proto__:null,ARIA_ATTR:PO,ATTR_WHITESPACE:GO,CUSTOM_ELEMENT:qO,DATA_ATTR:HO,DOCTYPE_NAME:Mw,ERB_EXPR:UO,IS_ALLOWED_URI:jw,IS_SCRIPT_OR_DATA:FO,MUSTACHE_EXPR:IO,TMPLIT_EXPR:$O});const $s={element:1,text:3,progressingInstruction:7,comment:8,document:9},YO=function(){return typeof window>"u"?null:window},VO=function(n,r){if(typeof n!="object"||typeof n.createPolicy!="function")return null;let l=null;const s="data-tt-policy-suffix";r&&r.hasAttribute(s)&&(l=r.getAttribute(s));const o="dompurify"+(l?"#"+l:"");try{return n.createPolicy(o,{createHTML(u){return u},createScriptURL(u){return u}})}catch{return console.warn("TrustedTypes policy "+o+" could not be created."),null}},_1=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Ow(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:YO();const n=Oe=>Ow(Oe);if(n.version="3.3.2",n.removed=[],!e||!e.document||e.document.nodeType!==$s.document||!e.Element)return n.isSupported=!1,n;let{document:r}=e;const l=r,s=l.currentScript,{DocumentFragment:o,HTMLTemplateElement:u,Node:f,Element:d,NodeFilter:p,NamedNodeMap:x=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:g,DOMParser:y,trustedTypes:v}=e,S=d.prototype,E=Us(S,"cloneNode"),T=Us(S,"remove"),N=Us(S,"nextSibling"),j=Us(S,"childNodes"),C=Us(S,"parentNode");if(typeof u=="function"){const Oe=r.createElement("template");Oe.content&&Oe.content.ownerDocument&&(r=Oe.content.ownerDocument)}let I,U="";const{implementation:_,createNodeIterator:z,createDocumentFragment:P,getElementsByTagName:X}=r,{importNode:B}=l;let q=_1();n.isSupported=typeof Rw=="function"&&typeof C=="function"&&_&&_.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:Z,ERB_EXPR:ee,TMPLIT_EXPR:ae,DATA_ATTR:Y,ARIA_ATTR:M,IS_SCRIPT_OR_DATA:K,ATTR_WHITESPACE:le,CUSTOM_ELEMENT:be}=N1;let{IS_ALLOWED_URI:O}=N1,D=null;const L=tt({},[...w1,...gh,...xh,...bh,...k1]);let A=null;const se=tt({},[...S1,...yh,...E1,...Lu]);let te=Object.seal(Xu(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),ie=null,Se=null;const je=Object.seal(Xu(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Ae=!0,qe=!0,we=!1,Ve=!0,Lt=!1,he=!0,xe=!1,_e=!1,et=!1,St=!1,xn=!1,Ot=!1,pr=!0,On=!1;const Dn="user-content-";let Et=!0,bn=!1,re={},me=null;const Me=tt({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Ge=null;const nt=tt({},["audio","video","img","source","image","track"]);let Jt=null;const _n=tt({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),qt="http://www.w3.org/1998/Math/MathML",mt="http://www.w3.org/2000/svg",Ct="http://www.w3.org/1999/xhtml";let Fe=Ct,pn=!1,Xt=null;const Na=tt({},[qt,mt,Ct],ph);let zn=tt({},["mi","mo","mn","ms","mtext"]),er=tt({},["annotation-xml"]);const Ar=tt({},["title","style","font","a","script"]);let Kt=null;const H=["application/xhtml+xml","text/html"],ue="text/html";let pe=null,Le=null;const vt=r.createElement("form"),ft=function(F){return F instanceof RegExp||F instanceof Function},Ce=function(){let F=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Le&&Le===F)){if((!F||typeof F!="object")&&(F={}),F=Vr(F),Kt=H.indexOf(F.PARSER_MEDIA_TYPE)===-1?ue:F.PARSER_MEDIA_TYPE,pe=Kt==="application/xhtml+xml"?ph:Ku,D=fr(F,"ALLOWED_TAGS")?tt({},F.ALLOWED_TAGS,pe):L,A=fr(F,"ALLOWED_ATTR")?tt({},F.ALLOWED_ATTR,pe):se,Xt=fr(F,"ALLOWED_NAMESPACES")?tt({},F.ALLOWED_NAMESPACES,ph):Na,Jt=fr(F,"ADD_URI_SAFE_ATTR")?tt(Vr(_n),F.ADD_URI_SAFE_ATTR,pe):_n,Ge=fr(F,"ADD_DATA_URI_TAGS")?tt(Vr(nt),F.ADD_DATA_URI_TAGS,pe):nt,me=fr(F,"FORBID_CONTENTS")?tt({},F.FORBID_CONTENTS,pe):Me,ie=fr(F,"FORBID_TAGS")?tt({},F.FORBID_TAGS,pe):Vr({}),Se=fr(F,"FORBID_ATTR")?tt({},F.FORBID_ATTR,pe):Vr({}),re=fr(F,"USE_PROFILES")?F.USE_PROFILES:!1,Ae=F.ALLOW_ARIA_ATTR!==!1,qe=F.ALLOW_DATA_ATTR!==!1,we=F.ALLOW_UNKNOWN_PROTOCOLS||!1,Ve=F.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Lt=F.SAFE_FOR_TEMPLATES||!1,he=F.SAFE_FOR_XML!==!1,xe=F.WHOLE_DOCUMENT||!1,St=F.RETURN_DOM||!1,xn=F.RETURN_DOM_FRAGMENT||!1,Ot=F.RETURN_TRUSTED_TYPE||!1,et=F.FORCE_BODY||!1,pr=F.SANITIZE_DOM!==!1,On=F.SANITIZE_NAMED_PROPS||!1,Et=F.KEEP_CONTENT!==!1,bn=F.IN_PLACE||!1,O=F.ALLOWED_URI_REGEXP||jw,Fe=F.NAMESPACE||Ct,zn=F.MATHML_TEXT_INTEGRATION_POINTS||zn,er=F.HTML_INTEGRATION_POINTS||er,te=F.CUSTOM_ELEMENT_HANDLING||{},F.CUSTOM_ELEMENT_HANDLING&&ft(F.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(te.tagNameCheck=F.CUSTOM_ELEMENT_HANDLING.tagNameCheck),F.CUSTOM_ELEMENT_HANDLING&&ft(F.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(te.attributeNameCheck=F.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),F.CUSTOM_ELEMENT_HANDLING&&typeof F.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(te.allowCustomizedBuiltInElements=F.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Lt&&(qe=!1),xn&&(St=!0),re&&(D=tt({},k1),A=Xu(null),re.html===!0&&(tt(D,w1),tt(A,S1)),re.svg===!0&&(tt(D,gh),tt(A,yh),tt(A,Lu)),re.svgFilters===!0&&(tt(D,xh),tt(A,yh),tt(A,Lu)),re.mathMl===!0&&(tt(D,bh),tt(A,E1),tt(A,Lu))),fr(F,"ADD_TAGS")||(je.tagCheck=null),fr(F,"ADD_ATTR")||(je.attributeCheck=null),F.ADD_TAGS&&(typeof F.ADD_TAGS=="function"?je.tagCheck=F.ADD_TAGS:(D===L&&(D=Vr(D)),tt(D,F.ADD_TAGS,pe))),F.ADD_ATTR&&(typeof F.ADD_ATTR=="function"?je.attributeCheck=F.ADD_ATTR:(A===se&&(A=Vr(A)),tt(A,F.ADD_ATTR,pe))),F.ADD_URI_SAFE_ATTR&&tt(Jt,F.ADD_URI_SAFE_ATTR,pe),F.FORBID_CONTENTS&&(me===Me&&(me=Vr(me)),tt(me,F.FORBID_CONTENTS,pe)),F.ADD_FORBID_CONTENTS&&(me===Me&&(me=Vr(me)),tt(me,F.ADD_FORBID_CONTENTS,pe)),Et&&(D["#text"]=!0),xe&&tt(D,["html","head","body"]),D.table&&(tt(D,["tbody"]),delete ie.tbody),F.TRUSTED_TYPES_POLICY){if(typeof F.TRUSTED_TYPES_POLICY.createHTML!="function")throw Is('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof F.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Is('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');I=F.TRUSTED_TYPES_POLICY,U=I.createHTML("")}else I===void 0&&(I=VO(v,s)),I!==null&&typeof U=="string"&&(U=I.createHTML(""));$n&&$n(F),Le=F}},Ee=tt({},[...gh,...xh,...LO]),Ie=tt({},[...bh,...BO]),$t=function(F){let de=C(F);(!de||!de.tagName)&&(de={namespaceURI:Fe,tagName:"template"});const Te=Ku(F.tagName),pt=Ku(de.tagName);return Xt[F.namespaceURI]?F.namespaceURI===mt?de.namespaceURI===Ct?Te==="svg":de.namespaceURI===qt?Te==="svg"&&(pt==="annotation-xml"||zn[pt]):!!Ee[Te]:F.namespaceURI===qt?de.namespaceURI===Ct?Te==="math":de.namespaceURI===mt?Te==="math"&&er[pt]:!!Ie[Te]:F.namespaceURI===Ct?de.namespaceURI===mt&&!er[pt]||de.namespaceURI===qt&&!zn[pt]?!1:!Ie[Te]&&(Ar[Te]||!Ee[Te]):!!(Kt==="application/xhtml+xml"&&Xt[F.namespaceURI]):!1},rt=function(F){Ls(n.removed,{element:F});try{C(F).removeChild(F)}catch{T(F)}},fn=function(F,de){try{Ls(n.removed,{attribute:de.getAttributeNode(F),from:de})}catch{Ls(n.removed,{attribute:null,from:de})}if(de.removeAttribute(F),F==="is")if(St||xn)try{rt(de)}catch{}else try{de.setAttribute(F,"")}catch{}},Cr=function(F){let de=null,Te=null;if(et)F="<remove></remove>"+F;else{const Ze=mh(F,/^[\r\n\t ]+/);Te=Ze&&Ze[0]}Kt==="application/xhtml+xml"&&Fe===Ct&&(F='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+F+"</body></html>");const pt=I?I.createHTML(F):F;if(Fe===Ct)try{de=new y().parseFromString(pt,Kt)}catch{}if(!de||!de.documentElement){de=_.createDocument(Fe,"template",null);try{de.documentElement.innerHTML=pn?U:pt}catch{}}const Ht=de.body||de.documentElement;return F&&Te&&Ht.insertBefore(r.createTextNode(Te),Ht.childNodes[0]||null),Fe===Ct?X.call(de,xe?"html":"body")[0]:xe?de.documentElement:Ht},Hr=function(F){return z.call(F.ownerDocument||F,F,p.SHOW_ELEMENT|p.SHOW_COMMENT|p.SHOW_TEXT|p.SHOW_PROCESSING_INSTRUCTION|p.SHOW_CDATA_SECTION,null)},Tn=function(F){return F instanceof g&&(typeof F.nodeName!="string"||typeof F.textContent!="string"||typeof F.removeChild!="function"||!(F.attributes instanceof x)||typeof F.removeAttribute!="function"||typeof F.setAttribute!="function"||typeof F.namespaceURI!="string"||typeof F.insertBefore!="function"||typeof F.hasChildNodes!="function")},Bt=function(F){return typeof f=="function"&&F instanceof f};function ve(Oe,F,de){zu(Oe,Te=>{Te.call(n,F,de,Le)})}const wt=function(F){let de=null;if(ve(q.beforeSanitizeElements,F,null),Tn(F))return rt(F),!0;const Te=pe(F.nodeName);if(ve(q.uponSanitizeElement,F,{tagName:Te,allowedTags:D}),he&&F.hasChildNodes()&&!Bt(F.firstElementChild)&&Bn(/<[/\w!]/g,F.innerHTML)&&Bn(/<[/\w!]/g,F.textContent)||F.nodeType===$s.progressingInstruction||he&&F.nodeType===$s.comment&&Bn(/<[/\w]/g,F.data))return rt(F),!0;if(!(je.tagCheck instanceof Function&&je.tagCheck(Te))&&(!D[Te]||ie[Te])){if(!ie[Te]&&il(Te)&&(te.tagNameCheck instanceof RegExp&&Bn(te.tagNameCheck,Te)||te.tagNameCheck instanceof Function&&te.tagNameCheck(Te)))return!1;if(Et&&!me[Te]){const pt=C(F)||F.parentNode,Ht=j(F)||F.childNodes;if(Ht&&pt){const Ze=Ht.length;for(let dn=Ze-1;dn>=0;--dn){const yn=E(Ht[dn],!0);yn.__removalCount=(F.__removalCount||0)+1,pt.insertBefore(yn,N(F))}}}return rt(F),!0}return F instanceof d&&!$t(F)||(Te==="noscript"||Te==="noembed"||Te==="noframes")&&Bn(/<\/no(script|embed|frames)/i,F.innerHTML)?(rt(F),!0):(Lt&&F.nodeType===$s.text&&(de=F.textContent,zu([Z,ee,ae],pt=>{de=Bs(de,pt," ")}),F.textContent!==de&&(Ls(n.removed,{element:F.cloneNode()}),F.textContent=de)),ve(q.afterSanitizeElements,F,null),!1)},mr=function(F,de,Te){if(Se[de]||pr&&(de==="id"||de==="name")&&(Te in r||Te in vt))return!1;if(!(qe&&!Se[de]&&Bn(Y,de))){if(!(Ae&&Bn(M,de))){if(!(je.attributeCheck instanceof Function&&je.attributeCheck(de,F))){if(!A[de]||Se[de]){if(!(il(F)&&(te.tagNameCheck instanceof RegExp&&Bn(te.tagNameCheck,F)||te.tagNameCheck instanceof Function&&te.tagNameCheck(F))&&(te.attributeNameCheck instanceof RegExp&&Bn(te.attributeNameCheck,de)||te.attributeNameCheck instanceof Function&&te.attributeNameCheck(de,F))||de==="is"&&te.allowCustomizedBuiltInElements&&(te.tagNameCheck instanceof RegExp&&Bn(te.tagNameCheck,Te)||te.tagNameCheck instanceof Function&&te.tagNameCheck(Te))))return!1}else if(!Jt[de]){if(!Bn(O,Bs(Te,le,""))){if(!((de==="src"||de==="xlink:href"||de==="href")&&F!=="script"&&MO(Te,"data:")===0&&Ge[F])){if(!(we&&!Bn(K,Bs(Te,le,"")))){if(Te)return!1}}}}}}}return!0},il=function(F){return F!=="annotation-xml"&&mh(F,be)},ea=function(F){ve(q.beforeSanitizeAttributes,F,null);const{attributes:de}=F;if(!de||Tn(F))return;const Te={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:A,forceKeepAttr:void 0};let pt=de.length;for(;pt--;){const Ht=de[pt],{name:Ze,namespaceURI:dn,value:yn}=Ht,An=pe(Ze),ge=yn;let Ne=Ze==="value"?ge:OO(ge);if(Te.attrName=An,Te.attrValue=Ne,Te.keepAttr=!0,Te.forceKeepAttr=void 0,ve(q.uponSanitizeAttribute,F,Te),Ne=Te.attrValue,On&&(An==="id"||An==="name")&&(fn(Ze,F),Ne=Dn+Ne),he&&Bn(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Ne)){fn(Ze,F);continue}if(An==="attributename"&&mh(Ne,"href")){fn(Ze,F);continue}if(Te.forceKeepAttr)continue;if(!Te.keepAttr){fn(Ze,F);continue}if(!Ve&&Bn(/\/>/i,Ne)){fn(Ze,F);continue}Lt&&zu([Z,ee,ae],gt=>{Ne=Bs(Ne,gt," ")});const Qe=pe(F.nodeName);if(!mr(Qe,An,Ne)){fn(Ze,F);continue}if(I&&typeof v=="object"&&typeof v.getAttributeType=="function"&&!dn)switch(v.getAttributeType(Qe,An)){case"TrustedHTML":{Ne=I.createHTML(Ne);break}case"TrustedScriptURL":{Ne=I.createScriptURL(Ne);break}}if(Ne!==ge)try{dn?F.setAttributeNS(dn,Ze,Ne):F.setAttribute(Ze,Ne),Tn(F)?rt(F):v1(n.removed)}catch{fn(Ze,F)}}ve(q.afterSanitizeAttributes,F,null)},Ll=function Oe(F){let de=null;const Te=Hr(F);for(ve(q.beforeSanitizeShadowDOM,F,null);de=Te.nextNode();)ve(q.uponSanitizeShadowNode,de,null),wt(de),ea(de),de.content instanceof o&&Oe(de.content);ve(q.afterSanitizeShadowDOM,F,null)};return n.sanitize=function(Oe){let F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},de=null,Te=null,pt=null,Ht=null;if(pn=!Oe,pn&&(Oe="<!-->"),typeof Oe!="string"&&!Bt(Oe))if(typeof Oe.toString=="function"){if(Oe=Oe.toString(),typeof Oe!="string")throw Is("dirty is not a string, aborting")}else throw Is("toString is not a function");if(!n.isSupported)return Oe;if(_e||Ce(F),n.removed=[],typeof Oe=="string"&&(bn=!1),bn){if(Oe.nodeName){const yn=pe(Oe.nodeName);if(!D[yn]||ie[yn])throw Is("root node is forbidden and cannot be sanitized in-place")}}else if(Oe instanceof f)de=Cr("<!---->"),Te=de.ownerDocument.importNode(Oe,!0),Te.nodeType===$s.element&&Te.nodeName==="BODY"||Te.nodeName==="HTML"?de=Te:de.appendChild(Te);else{if(!St&&!Lt&&!xe&&Oe.indexOf("<")===-1)return I&&Ot?I.createHTML(Oe):Oe;if(de=Cr(Oe),!de)return St?null:Ot?U:""}de&&et&&rt(de.firstChild);const Ze=Hr(bn?Oe:de);for(;pt=Ze.nextNode();)wt(pt),ea(pt),pt.content instanceof o&&Ll(pt.content);if(bn)return Oe;if(St){if(xn)for(Ht=P.call(de.ownerDocument);de.firstChild;)Ht.appendChild(de.firstChild);else Ht=de;return(A.shadowroot||A.shadowrootmode)&&(Ht=B.call(l,Ht,!0)),Ht}let dn=xe?de.outerHTML:de.innerHTML;return xe&&D["!doctype"]&&de.ownerDocument&&de.ownerDocument.doctype&&de.ownerDocument.doctype.name&&Bn(Mw,de.ownerDocument.doctype.name)&&(dn="<!DOCTYPE "+de.ownerDocument.doctype.name+`>
|
|
106
|
+
`+dn),Lt&&zu([Z,ee,ae],yn=>{dn=Bs(dn,yn," ")}),I&&Ot?I.createHTML(dn):dn},n.setConfig=function(){let Oe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Ce(Oe),_e=!0},n.clearConfig=function(){Le=null,_e=!1},n.isValidAttribute=function(Oe,F,de){Le||Ce({});const Te=pe(Oe),pt=pe(F);return mr(Te,pt,de)},n.addHook=function(Oe,F){typeof F=="function"&&Ls(q[Oe],F)},n.removeHook=function(Oe,F){if(F!==void 0){const de=RO(q[Oe],F);return de===-1?void 0:jO(q[Oe],de,1)[0]}return v1(q[Oe])},n.removeHooks=function(Oe){q[Oe]=[]},n.removeAllHooks=function(){q=_1()},n}var Dw=Ow();kt.use(SO({langPrefix:"hljs language-",highlight(e,n){return n&&At.getLanguage(n)?At.highlight(e,{language:n}).value:e}}));Dw.addHook("afterSanitizeAttributes",e=>{e.tagName==="A"&&e.getAttribute("href")?.startsWith("http")&&(e.setAttribute("target","_blank"),e.setAttribute("rel","noopener noreferrer"))});function XO({content:e}){const n=w.useMemo(()=>Dw.sanitize(kt.parse(e,{gfm:!0})),[e]);return h.jsx("div",{className:"docs-prose",dangerouslySetInnerHTML:{__html:n}})}function KO({repoName:e,filePath:n,content:r,loading:l,error:s,rawMode:o,isStarred:u,onToggleRaw:f,onToggleStar:d,onClose:p}){return h.jsxs("div",{className:"relative flex flex-1 min-h-0 w-full flex-col",children:[h.jsxs("div",{className:"docs-header flex items-center gap-2 px-4 py-2 border-b flex-shrink-0",children:[h.jsxs("button",{onClick:p,className:"docs-header-back flex items-center gap-1 text-[13px] transition-colors cursor-pointer",children:[h.jsx($0,{size:14,stroke:2.5}),"Back"]}),h.jsxs("span",{className:"docs-header-path flex-1 text-[13px] text-center truncate",children:[e," ",h.jsx("span",{className:"docs-header-slash",children:"/"})," ",n]}),h.jsx("button",{onClick:d,className:`docs-header-star transition-colors cursor-pointer ${u?"is-starred":""}`,title:u?"Remove from favourites":"Add to favourites",children:u?h.jsx(X0,{size:15}):h.jsx(d_,{size:15})}),h.jsx("button",{onClick:f,className:`docs-header-toggle rounded px-2 py-0.5 text-[13px] transition-colors cursor-pointer ${o?"is-active":""}`,children:o?"Rendered":"Raw"})]}),h.jsxs("div",{className:"chat-scroll flex-1 overflow-y-auto min-h-0",children:[h.jsx("div",{className:"border-t-2 border-accent-8/40"}),l?h.jsx("div",{className:"flex items-center justify-center py-12",children:h.jsx(Br,{size:20,className:"animate-spin text-neutral-5"})}):s?h.jsx("div",{className:"rounded-md bg-error-10/50 px-3 py-2 text-[13px] text-error-4 mx-4 mt-4",children:s}):r!==null?o?h.jsx("pre",{className:"px-6 py-4 text-[14px] text-neutral-3 whitespace-pre-wrap",style:{fontFamily:"'Inconsolata', monospace"},children:r}):h.jsx("div",{className:"mx-auto max-w-[720px] px-6 py-4",children:h.jsx(XO,{content:r})}):null]})]})}function ZO({tasks:e}){const[n,r]=w.useState(!1),[l,s]=w.useState(!1),o=w.useRef(0),u=w.useRef(!1),f=w.useRef(0),d=w.useRef(new Map),p=e.filter(g=>g.status==="completed").length,x=e.length>0&&p===e.length;return w.useEffect(()=>{e.length>o.current&&(r(!0),s(!1)),o.current=e.length},[e.length]),w.useEffect(()=>{!x&&e.length>0&&(u.current=!0)},[e,x]),w.useEffect(()=>{if(x){const g=u.current?1e4:0,y=setTimeout(()=>s(!0),g);return()=>clearTimeout(y)}s(!1)},[x]),w.useEffect(()=>{if(p>f.current&&!x){const g=e.find(y=>y.status!=="completed");g&&d.current.get(g.id)?.scrollIntoView({behavior:"smooth",block:"nearest"})}f.current=p},[p,x,e]),e.length===0||l?null:n?h.jsxs("div",{className:"absolute top-14 right-3 z-20 w-64 rounded-lg bg-neutral-9/90 backdrop-blur border border-neutral-8/60 shadow-lg",children:[h.jsxs("div",{className:"flex items-center justify-between px-3 py-2 border-b border-neutral-8/40",children:[h.jsxs("span",{className:"text-[13px] font-semibold text-neutral-1 uppercase tracking-wider flex items-center gap-1.5",children:[!x&&h.jsx("span",{className:"inline-block h-1.5 w-1.5 rounded-full bg-primary-5 animate-pulse"}),"Tasks",h.jsxs("span",{className:`text-[13px] font-medium ml-1 ${x?"text-success-5":"text-neutral-5"}`,children:[p,"/",e.length]})]}),h.jsxs("div",{className:"flex items-center gap-0.5",children:[h.jsx("button",{onClick:()=>r(!1),className:"rounded p-0.5 text-neutral-4 hover:text-neutral-2 hover:bg-neutral-8/60 transition-colors",title:"Collapse",children:h.jsx(mN,{size:14})}),h.jsx("button",{onClick:()=>s(!0),className:"rounded p-0.5 text-neutral-4 hover:text-neutral-2 hover:bg-neutral-8/60 transition-colors",title:"Dismiss",children:h.jsx(Wr,{size:14})})]})]}),h.jsx("div",{className:"flex flex-col gap-1 px-3 py-2 max-h-[50vh] overflow-y-auto",children:e.map(g=>h.jsxs("div",{ref:y=>{y?d.current.set(g.id,y):d.current.delete(g.id)},className:"flex items-start gap-2 text-[15px]",children:[g.status==="completed"?h.jsx("span",{className:"flex-shrink-0 text-success-5 text-[13px] mt-[3px]",children:"✓"}):g.status==="in_progress"?h.jsx("span",{className:"inline-block h-2 w-2 mt-[7px] rounded-full bg-primary-5 animate-pulse flex-shrink-0"}):h.jsx("span",{className:"inline-block h-2 w-2 mt-[7px] rounded-full border border-neutral-5 flex-shrink-0"}),h.jsx("span",{className:g.status==="completed"?"text-neutral-4 line-through":"text-neutral-2",children:g.status==="in_progress"&&g.activeForm?g.activeForm:g.subject})]},g.id))})]}):h.jsx("div",{className:"absolute top-14 right-3 z-20",children:h.jsxs("button",{onClick:()=>r(!0),className:"flex items-center gap-1.5 rounded-lg bg-neutral-9/90 backdrop-blur border border-neutral-8/60 px-2.5 py-1.5 shadow-lg hover:bg-neutral-8/90 transition-colors",children:[!x&&h.jsx("span",{className:"inline-block h-1.5 w-1.5 rounded-full bg-primary-5 animate-pulse"}),h.jsxs("span",{className:"text-[13px] font-semibold text-neutral-2",children:[p,"/",e.length]}),h.jsx(Zr,{size:14,className:"text-neutral-4"})]})})}function rp({size:e=24,className:n=""}){return h.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:n,children:[h.jsx("circle",{cx:"12",cy:"12",r:"2.5"}),h.jsx("circle",{cx:"12",cy:"12",r:"0.75",fill:"currentColor",stroke:"none"}),h.jsx("path",{d:"M8 20.1a9 9 0 0 1 -5 -7.1"}),h.jsx("path",{d:"M16 20.1a9 9 0 0 0 5 -7.1"}),h.jsx("path",{d:"M6.2 5a9 9 0 0 1 11.4 0"}),h.jsx("circle",{cx:"12",cy:"21",r:"1",fill:"currentColor",stroke:"none"}),h.jsx("circle",{cx:"3",cy:"9",r:"1",fill:"currentColor",stroke:"none"}),h.jsx("circle",{cx:"21",cy:"9",r:"1",fill:"currentColor",stroke:"none"})]})}function Qp({groups:e,selectedId:n,onSelect:r,cloningId:l,maxHeight:s="240px",autoFocus:o}){const[u,f]=w.useState(""),d=w.useRef(null);w.useEffect(()=>{o&&d.current?.focus()},[o]);const p=u.trim()?e.map(g=>({...g,repos:g.repos.filter(y=>y.name.toLowerCase().includes(u.toLowerCase())||y.description?.toLowerCase().includes(u.toLowerCase()))})).filter(g=>g.repos.length>0):e;return e.reduce((g,y)=>g+y.repos.length,0)===0?h.jsx("p",{className:"text-center text-[15px] text-neutral-6 py-2",children:"No repositories available"}):h.jsxs(h.Fragment,{children:[h.jsx("input",{ref:d,type:"text",value:u,onChange:g=>f(g.target.value),placeholder:"Search repos…",className:"mb-2 w-full rounded-lg border border-neutral-7 bg-neutral-11/50 px-3 py-2 text-[15px] text-neutral-2 placeholder-neutral-5 focus:border-accent-6 focus:outline-none"}),h.jsx("div",{className:"overflow-y-auto rounded-lg border border-neutral-7 bg-neutral-11/50",style:{maxHeight:s},children:p.length===0?h.jsx("p",{className:"px-3 py-3 text-[13px] text-neutral-5 text-center",children:"No matching repos"}):p.map(g=>h.jsxs("div",{children:[h.jsx("div",{className:"sticky top-0 z-10 bg-neutral-8 backdrop-blur-sm px-3 py-1.5 text-[13px] font-medium uppercase tracking-wider text-neutral-4 border-b border-neutral-7",children:g.owner}),g.repos.map(y=>{const v=l===y.id,S=n===y.id;return h.jsxs("button",{type:"button",onClick:()=>r(y),disabled:!!l,className:`group flex w-full items-start gap-3 border-b border-neutral-7/50 px-3 py-2.5 text-left transition last:border-b-0 ${S?"bg-accent-9/20 border-l-2 border-l-accent-6":l?"cursor-wait opacity-60":"hover:bg-neutral-7/20"}`,children:[h.jsx("div",{className:"mt-0.5 flex-shrink-0 text-neutral-4 group-hover:text-neutral-3 transition-colors",children:y.cloned?h.jsx(wp,{size:16,stroke:1.5}):h.jsx(wN,{size:16,stroke:1.5})}),h.jsxs("div",{className:"min-w-0 flex-1",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:"text-[15px] font-medium text-neutral-2 group-hover:text-neutral-1 transition-colors truncate",children:y.name}),v&&h.jsx("span",{className:"flex-shrink-0 rounded bg-primary-9/30 px-1.5 py-0.5 text-[13px] text-primary-4 animate-pulse",children:"cloning..."}),!y.cloned&&!v&&h.jsx("span",{className:"flex-shrink-0 rounded border border-neutral-6 bg-neutral-8/50 px-1.5 py-0.5 text-[13px] text-neutral-3",children:"remote"})]}),y.description&&h.jsx("div",{className:"mt-0.5 text-[13px] text-neutral-6 truncate",children:y.description})]})]},y.id)})]},g.owner))})]})}function QO({groups:e,token:n,onOpen:r}){const[l,s]=w.useState(!1),[o,u]=w.useState(null),f=w.useRef(null),d=w.useRef(null);w.useLayoutEffect(()=>{if(!l||!f.current||!d.current)return;const x=f.current.getBoundingClientRect(),g=d.current,y=288,v=x.bottom+6,S=Math.max(8,Math.min(x.right-y,window.innerWidth-y-8));g.style.top=`${v}px`,g.style.left=`${S}px`},[l]),w.useEffect(()=>{if(!l)return;function x(y){y.key==="Escape"&&s(!1)}function g(y){const v=y.target;f.current&&!f.current.contains(v)&&d.current&&!d.current.contains(v)&&s(!1)}return document.addEventListener("keydown",x),document.addEventListener("mousedown",g),()=>{document.removeEventListener("keydown",x),document.removeEventListener("mousedown",g)}},[l]);async function p(x){if(!o){if(!x.cloned){u(x.id);try{const g={"Content-Type":"application/json"};n&&(g.Authorization=`Bearer ${n}`);const y=await fetch("/cc/api/clone",{method:"POST",headers:g,body:JSON.stringify({owner:x.owner,name:x.name})});if(!y.ok){const v=await y.json();throw new Error(v.error||"Clone failed")}x.cloned=!0}catch{u(null);return}u(null)}s(!1),r(x)}}return h.jsxs("div",{ref:f,className:"relative h-full flex items-center",children:[h.jsx("button",{onClick:()=>s(!l),className:`app-new-session-btn rounded p-1.5 transition ${l?"bg-neutral-6 text-neutral-1":"text-neutral-3 hover:bg-neutral-6 hover:text-neutral-1"}`,title:"New session",children:h.jsx(Qs,{size:16,stroke:2})}),l&&h.jsxs("div",{ref:d,className:"fixed z-50 w-72 rounded-md border border-neutral-10 bg-neutral-12 shadow-lg",children:[h.jsxs("div",{className:"px-3 pt-3 pb-1",children:[h.jsx("h3",{className:"text-[15px] font-medium text-neutral-3",children:"New Session"}),h.jsx("p",{className:"mt-0.5 text-[13px] text-neutral-6",children:"Choose a repository to work on"})]}),h.jsx("div",{className:"px-2 pb-2",children:h.jsx(Qp,{groups:e,onSelect:p,cloningId:o,maxHeight:"240px",autoFocus:!0})})]})]})}function WO({token:e,workingDir:n,visible:r}){const[l,s]=w.useState(null),[o,u]=w.useState(!1),[f,d]=w.useState(!1);if(w.useEffect(()=>{if(!r||!n||!e)return;let y=!1;return u(!0),d(!1),Cs(e,n).then(v=>{y||s(v)}).catch(()=>{y||(s(null),d(!0))}).finally(()=>{y||u(!1)}),()=>{y=!0}},[r,n,e]),!r)return null;async function p(y){if(!(!n||!e))try{await g2(e,n,y);const v=await Cs(e,n);s(v)}catch{Cs(e,n).then(s).catch(()=>{})}}async function x(y){if(!(!n||!e||y.length===0))try{await x2(e,n,y);const v=await Cs(e,n);s(v)}catch{Cs(e,n).then(s).catch(()=>{})}}if(!n)return h.jsx("div",{className:"border-t border-neutral-8/30 px-3 py-3",children:h.jsx("p",{className:"text-[13px] text-neutral-5",children:"Select a session to manage approvals."})});if(o)return h.jsx("div",{className:"border-t border-neutral-8/30 px-3 py-3",children:h.jsx("p",{className:"text-[13px] text-neutral-5",children:"Loading..."})});if(f||!l)return h.jsx("div",{className:"border-t border-neutral-8/30 px-3 py-3",children:h.jsx("p",{className:"text-[13px] text-neutral-5",children:"Could not load approvals."})});const g=n.split("/").pop()||n;return h.jsx("div",{className:"border-t border-neutral-8/30 flex flex-col min-h-0",children:h.jsxs("div",{className:"ml-3 border-l border-neutral-7/30 flex flex-col min-h-0",children:[h.jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5 flex-shrink-0",children:[h.jsx("span",{className:"text-[13px] font-medium text-neutral-5 uppercase tracking-wider flex-shrink-0",children:"Approvals"}),h.jsx("span",{className:"text-[12px] font-mono text-neutral-6 truncate",title:n,children:g})]}),h.jsx(JO,{approvals:l,onRemove:p,onRevokeMultiple:x})]})})}function JO({approvals:e,onRemove:n,onRevokeMultiple:r}){const[l,s]=w.useState(new Set(["__tools__","__commands__","__patterns__"])),o=e.tools.length+e.commands.length+e.patterns.length,u=o===0;function f(E){s(T=>{const N=new Set(T);return N.has(E)?N.delete(E):N.add(E),N})}const d=w.useMemo(()=>[...e.tools].sort(),[e.tools]),p=w.useMemo(()=>[...e.patterns??[]].sort(),[e.patterns]),x=w.useMemo(()=>eD(e.commands),[e.commands]),g=Object.entries(x),y=d.length>0,v=p.length>0,S=g.length>0;return h.jsxs(h.Fragment,{children:[!u&&h.jsx("div",{className:"flex-shrink-0 px-3 pb-1.5",children:h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsxs("span",{className:"text-[13px] text-neutral-5",children:[o," rule",o!==1?"s":""]}),h.jsx("button",{onClick:()=>{const E=[...e.tools.map(T=>({tool:T})),...e.commands.map(T=>({command:T})),...(e.patterns??[]).map(T=>({pattern:T}))];confirm(`Revoke all ${o} approval rules?`)&&r(E)},className:"text-[13px] text-neutral-5 hover:text-error-5 transition-colors",children:"Revoke All"})]})}),h.jsxs("div",{className:"overflow-y-auto min-h-0 flex-1 px-2 py-1 approvals-scroll",children:[!y&&!v&&!S&&h.jsx("p",{className:"text-[13px] text-neutral-6 py-2 text-center",children:"No auto-approval rules yet."}),h.jsxs("div",{className:"space-y-2",children:[v&&h.jsx(vh,{title:"Patterns",count:p.length,collapsed:l.has("__patterns__"),onToggle:()=>f("__patterns__"),onRevokeAll:()=>{confirm(`Revoke all ${p.length} pattern approvals?`)&&r(p.map(E=>({pattern:E})))},children:h.jsx("ul",{className:"space-y-0.5",children:p.map(E=>h.jsxs("li",{className:"group flex items-center justify-between rounded-md px-2 py-1 text-[13px] text-neutral-3 hover:bg-neutral-6/50 hover:text-neutral-1 transition-colors",children:[h.jsx("code",{className:"truncate font-mono",children:E}),h.jsx("button",{onClick:()=>n({pattern:E}),className:"ml-2 flex-shrink-0 text-neutral-5 opacity-0 group-hover:opacity-100 hover:text-error-5 transition-all",children:"×"})]},E))})}),y&&h.jsx(vh,{title:"Tools",count:d.length,collapsed:l.has("__tools__"),onToggle:()=>f("__tools__"),onRevokeAll:()=>{confirm(`Revoke all ${d.length} tool approvals?`)&&r(d.map(E=>({tool:E})))},children:h.jsx("ul",{className:"space-y-0.5",children:d.map(E=>h.jsxs("li",{className:"group flex items-center justify-between rounded-md px-2 py-1 text-[13px] text-neutral-3 hover:bg-neutral-6/50 hover:text-neutral-1 transition-colors",children:[h.jsx("span",{className:"truncate",children:E}),h.jsx("button",{onClick:()=>n({tool:E}),className:"ml-2 flex-shrink-0 text-neutral-5 opacity-0 group-hover:opacity-100 hover:text-error-5 transition-all",children:"×"})]},E))})}),S&&h.jsx(vh,{title:"Commands",count:e.commands.length,collapsed:l.has("__commands__"),onToggle:()=>f("__commands__"),onRevokeAll:()=>{const E=e.commands;confirm(`Revoke all ${E.length} command approvals?`)&&r(E.map(T=>({command:T})))},children:h.jsx("div",{className:"space-y-1.5",children:g.map(([E,T])=>h.jsx(tD,{prefix:E,commands:T,collapsed:l.has(`cmd:${E}`),onToggle:()=>f(`cmd:${E}`),onRemove:N=>n({command:N}),onRevokeAll:()=>{confirm(`Revoke all ${T.length} "${E}" approvals?`)&&r(T.map(N=>({command:N})))}},E))})})]})]})]})}function eD(e){const n={};for(const l of e){const s=l.split(/\s+/)[0]||"other";n[s]||(n[s]=[]),n[s].push(l)}const r={};for(const l of Object.keys(n).sort())r[l]=n[l].sort();return r}function vh({title:e,count:n,collapsed:r,onToggle:l,onRevokeAll:s,children:o}){return h.jsxs("div",{children:[h.jsxs("div",{className:"flex items-center justify-between mb-1",children:[h.jsxs("button",{onClick:l,className:"flex items-center gap-1.5 text-[15px] text-neutral-4 hover:text-neutral-2 transition-colors",children:[h.jsx("svg",{className:`w-2.5 h-2.5 transition-transform flex-shrink-0 ${r?"":"rotate-90"}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5l7 7-7 7"})}),h.jsx("span",{className:"font-medium",children:e}),h.jsx("span",{className:"text-[13px] text-neutral-5",children:n})]}),!r&&n>1&&h.jsx("button",{onClick:s,className:"text-[13px] text-neutral-5 hover:text-error-5 transition-colors",children:"revoke all"})]}),!r&&o]})}function tD({prefix:e,commands:n,collapsed:r,onToggle:l,onRemove:s,onRevokeAll:o}){return n.length===1?h.jsxs("div",{className:"group flex items-center justify-between rounded-md px-2 py-1 hover:bg-neutral-6/50 transition-colors",children:[h.jsxs("code",{className:"truncate font-mono text-[13px] text-neutral-3",title:n[0],children:["$ ",n[0]]}),h.jsx("button",{onClick:()=>s(n[0]),className:"ml-2 flex-shrink-0 text-neutral-5 opacity-0 group-hover:opacity-100 hover:text-error-5 transition-all",children:"×"})]}):h.jsxs("div",{className:"rounded-md overflow-hidden",children:[h.jsxs("div",{className:"flex items-center justify-between px-2 py-0.5",children:[h.jsxs("button",{onClick:l,className:"flex items-center gap-1 text-[13px] text-neutral-4 hover:text-neutral-2 transition-colors",children:[h.jsx("svg",{className:`w-2 h-2 transition-transform flex-shrink-0 ${r?"":"rotate-90"}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5l7 7-7 7"})}),h.jsx("code",{className:"font-mono font-medium",children:e}),h.jsx("span",{className:"text-[13px] text-neutral-5",children:n.length})]}),!r&&h.jsx("button",{onClick:o,className:"text-[13px] text-neutral-5 hover:text-error-5 transition-colors",children:"revoke all"})]}),!r&&h.jsx("ul",{className:"pl-3",children:n.map(u=>h.jsxs("li",{className:"group flex items-center justify-between rounded-md px-2 py-1 hover:bg-neutral-6/50 transition-colors",children:[h.jsxs("code",{className:"truncate font-mono text-[13px] text-neutral-3",title:u,children:["$ ",u]}),h.jsx("button",{onClick:()=>s(u),className:"ml-2 flex-shrink-0 text-neutral-5 opacity-0 group-hover:opacity-100 hover:text-error-5 transition-all",children:"×"})]},u))})]})}function nD({files:e,loading:n,starredDocs:r,onSelect:l,onClose:s}){const[o,u]=w.useState(""),f=w.useRef(null);w.useEffect(()=>{function S(E){E.key==="Escape"&&s()}return document.addEventListener("keydown",S),()=>document.removeEventListener("keydown",S)},[s]);const d=new Set(r),p=o.trim()?e.filter(S=>S.path.toLowerCase().includes(o.toLowerCase())):e,x=p.filter(S=>d.has(S.path)),g=p.filter(S=>S.pinned&&!d.has(S.path)),y=p.filter(S=>!S.pinned&&!d.has(S.path)),v=(x.length>0?1:0)+(g.length>0?1:0)+(y.length>0?1:0)>1;return h.jsx("div",{ref:f,className:"mt-1 border-t border-neutral-8/30 pt-1",children:n?h.jsx("div",{className:"flex items-center justify-center py-3",children:h.jsx(Br,{size:14,className:"animate-spin text-neutral-5"})}):e.length===0?h.jsx("div",{className:"pl-10 pr-2 py-1 text-[13px] text-neutral-5",children:"No markdown files found"}):h.jsxs(h.Fragment,{children:[e.length>5&&h.jsx("div",{className:"px-2 pb-1",children:h.jsx("input",{type:"text",value:o,onChange:S=>u(S.target.value),placeholder:"Filter docs...",autoFocus:!0,className:"w-full rounded border border-neutral-7 bg-neutral-10/50 px-2 py-1 text-[13px] text-neutral-2 placeholder-neutral-5 focus:border-accent-6 focus:outline-none"})}),h.jsx("div",{className:"overflow-y-auto",style:{maxHeight:"320px"},children:p.length===0?h.jsx("div",{className:"pl-10 pr-2 py-1 text-[13px] text-neutral-5",children:"No matching files"}):h.jsxs(h.Fragment,{children:[x.map(S=>h.jsxs("button",{onClick:()=>l(S.path),className:"group w-full flex items-center gap-2 pl-10 pr-2 py-1 text-left text-[15px] text-neutral-2 font-medium hover:bg-neutral-6/50 hover:text-neutral-1 transition-colors cursor-pointer rounded-md",children:[h.jsx(X0,{size:13,className:"flex-shrink-0 text-primary-5"}),h.jsx("span",{className:"flex-1 truncate",children:S.path})]},S.path)),x.length>0&&v&&h.jsx("div",{className:"border-t border-neutral-8/30 my-0.5 mx-10"}),g.map(S=>h.jsxs("button",{onClick:()=>l(S.path),className:"group w-full flex items-center gap-2 pl-10 pr-2 py-1 text-left text-[15px] text-neutral-2 font-medium hover:bg-neutral-6/50 hover:text-neutral-1 transition-colors cursor-pointer rounded-md",children:[h.jsx($h,{size:13,className:"flex-shrink-0 text-neutral-5"}),h.jsx("span",{className:"flex-1 truncate",children:S.path})]},S.path)),g.length>0&&y.length>0&&h.jsx("div",{className:"border-t border-neutral-8/30 my-0.5 mx-10"}),y.map(S=>h.jsxs("button",{onClick:()=>l(S.path),className:"group w-full flex items-center gap-2 pl-10 pr-2 py-1 text-left text-[15px] text-neutral-4 hover:bg-neutral-6/50 hover:text-neutral-2 transition-colors cursor-pointer rounded-md",children:[h.jsx($h,{size:13,className:"flex-shrink-0 text-neutral-6"}),h.jsx("span",{className:"flex-1 truncate",children:S.path})]},S.path))]})})]})})}const T1=5;function A1(e){const n=e.name||e.id.slice(0,8);return n.startsWith("hub:")?"new session":n}function rD(e){const n=e.name||e.id.slice(0,8);return n.startsWith("hub:")?"unnamed session":n}function aD(e){const n=Math.floor((Date.now()-new Date(e).getTime())/1e3);if(n<60)return`${n}s`;const r=Math.floor(n/60);if(r<60)return`${r}m`;const l=Math.floor(r/60);return l<24?`${l}h`:`${Math.floor(l/24)}d`}function lD(e){return!e.includes("T")&&!e.includes("Z")&&!e.includes("+")?new Date(e.replace(" ","T")+"Z"):new Date(e)}function iD(e){const n=Math.floor((Date.now()-lD(e).getTime())/1e3);if(n<60)return`${n}s`;const r=Math.floor(n/60);if(r<60)return`${r}m`;const l=Math.floor(r/60);return l<24?`${l}h`:`${Math.floor(l/24)}d`}function sD({node:e,isActive:n,activeSessionId:r,waitingSessions:l,tentativeQueues:s,token:o,archiveRefreshKey:u,onSelectSession:f,onDeleteSession:d,onRenameSession:p,onNewSession:x,onSelectRepo:g,onDeleteRepo:y,onViewArchivedSession:v,onBrowseDocs:S,docsPickerOpen:E,docsPickerRepoDir:T,docsPickerFiles:N,docsPickerLoading:j,onDocsPickerSelect:C,onDocsPickerClose:I,docsStarredDocs:U,isMobile:_}){const[z,P]=w.useState(n||!!_),[X,B]=w.useState(!1),[q,Z]=w.useState(!1),[ee,ae]=w.useState(!1),[Y,M]=w.useState([]),[K,le]=w.useState(null),[be,O]=w.useState("");w.useEffect(()=>{n&&P(!0)},[n]),w.useEffect(()=>{!q||!o||R0(o,e.workingDir).then(M).catch(()=>{})},[q,o,e.workingDir,u]);const D=e.hasTentative?"bg-accent-6 animate-pulse":e.hasWaiting?"bg-warning-5 animate-pulse":e.hasActive?"bg-success-6 animate-pulse":"bg-neutral-6",L=ee?Y:Y.slice(0,T1),A=Y.length>T1,se=ie=>{le(ie.id),O(A1(ie))},te=()=>{K&&be.trim()&&p(K,be.trim()),le(null)};return h.jsxs("div",{className:"group/repo",children:[h.jsxs("div",{className:"group flex items-center gap-1.5 px-2 py-1",children:[h.jsxs("button",{onClick:()=>{P(!z),n||g(e.workingDir)},className:"flex flex-1 items-center gap-2 min-w-0 rounded px-2 py-0.5 text-left transition-colors text-neutral-3 hover:text-neutral-2",children:[z?h.jsx(Zr,{size:14,stroke:2.5,className:"flex-shrink-0 text-neutral-5 opacity-0 group-hover/repo:opacity-100 transition-opacity"}):h.jsx(va,{size:14,stroke:2.5,className:"flex-shrink-0 text-neutral-5 opacity-0 group-hover/repo:opacity-100 transition-opacity"}),h.jsx("span",{className:`inline-block h-1.5 w-1.5 rounded-full flex-shrink-0 ${D}`}),h.jsx("span",{className:`truncate font-semibold tracking-wide ${_?"text-[17px]":"text-[15px]"}`,children:e.displayName}),!z&&e.sessions.length>1&&h.jsxs("span",{className:"text-[12px] text-neutral-6 flex-shrink-0",children:["(",e.sessions.length,")"]})]}),S&&h.jsx("button",{onClick:ie=>{ie.stopPropagation(),S(e.workingDir)},className:`flex-shrink-0 rounded p-0.5 transition-colors opacity-0 group-hover:opacity-100 ${E&&T===e.workingDir?"text-primary-5 opacity-100!":"text-neutral-5 hover:text-neutral-2"}`,title:"Browse docs",children:h.jsx($h,{size:14,stroke:2})}),h.jsx("button",{onClick:()=>B(!X),className:`flex-shrink-0 rounded p-0.5 transition-colors opacity-0 group-hover:opacity-100 ${X?"text-primary-5 opacity-100!":"text-neutral-5 hover:text-neutral-2"}`,title:"Repo approvals",children:h.jsx(u_,{size:16,stroke:2})}),h.jsx("button",{onClick:()=>Z(!q),className:`flex-shrink-0 rounded p-0.5 transition-colors opacity-0 group-hover:opacity-100 ${q?"text-primary-5 opacity-100!":"text-neutral-5 hover:text-neutral-2"}`,title:"Archived sessions",children:h.jsx(Zs,{size:16,stroke:2})}),h.jsx("span",{onClick:ie=>{ie.stopPropagation(),y(e.workingDir)},className:"cursor-pointer text-[15px] text-transparent hover:text-error-5 group-hover:text-neutral-6 flex-shrink-0 px-0.5",children:"×"})]}),z&&h.jsxs("div",{className:"px-2 pb-1",children:[e.sessions.map(ie=>{const Se=ie.id===r,Ae=(s[ie.id]?.length??0)>0?"bg-accent-6 animate-pulse":l[ie.id]?"bg-warning-5 animate-pulse":ie.isProcessing?"bg-success-6 animate-pulse":ie.active?"bg-neutral-5":"bg-neutral-7",qe=K===ie.id;return h.jsxs("div",{onClick:()=>{qe||f(ie.id)},className:`group w-full flex items-baseline gap-2 pl-10 pr-2 py-1 text-left ${_?"text-[17px]":"text-[15px]"} transition-colors rounded-md cursor-pointer ${Se?"bg-accent-9/30 text-accent-2":"text-neutral-3 hover:bg-neutral-6/50 hover:text-neutral-1"}`,children:[ie.source==="workflow"?h.jsx(V0,{size:12,className:`flex-shrink-0 self-center ${Ae.replace(/bg-/g,"text-")}`}):ie.source==="webhook"?h.jsx(tc,{size:12,className:`flex-shrink-0 self-center ${Ae.replace(/bg-/g,"text-")}`}):h.jsx("span",{className:"inline-flex items-center justify-center w-[12px] flex-shrink-0 self-center",children:h.jsx("span",{className:`inline-block h-1.5 w-1.5 rounded-full ${Ae}`})}),qe?h.jsx("input",{autoFocus:!0,value:be,onChange:we=>O(we.target.value),onBlur:te,onKeyDown:we=>{we.key==="Enter"&&te(),we.key==="Escape"&&le(null)},onClick:we=>we.stopPropagation(),className:"flex-1 min-w-0 bg-neutral-10 border border-neutral-7 rounded px-1 py-0 text-[15px] text-neutral-1 outline-none focus:border-primary-6"}):h.jsx("span",{className:"flex-1 truncate font-normal",children:A1(ie)}),!qe&&h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"text-[13px] text-neutral-6 tabular-nums flex-shrink-0",children:aD(ie.created)}),h.jsx("span",{onClick:we=>{we.stopPropagation(),se(ie)},className:"cursor-pointer flex-shrink-0 text-transparent group-hover:text-neutral-5 hover:text-neutral-2! transition-colors",title:"Rename session",children:h.jsx(G0,{size:13,stroke:2})}),h.jsx("span",{onClick:we=>{we.stopPropagation(),d(ie.id)},className:"cursor-pointer text-[15px] text-transparent hover:text-error-5 group-hover:text-neutral-6 flex-shrink-0",children:"×"})]})]},ie.id)}),x&&h.jsx("div",{className:"pl-10 opacity-0 group-hover/repo:opacity-100",children:h.jsxs("button",{onClick:x,className:"inline-flex items-center gap-1.5 px-2 py-0.5 rounded-md text-[13px] text-neutral-5 hover:text-neutral-2 hover:bg-neutral-6/50 transition-colors",children:[h.jsx(Qs,{size:12,stroke:2,className:"flex-shrink-0"}),h.jsx("span",{children:"New session"})]})}),E&&T===e.workingDir&&C&&I&&h.jsx(nD,{files:N??[],loading:j??!1,starredDocs:U??[],onSelect:C,onClose:I}),X&&h.jsx("div",{className:"mt-1 border-t border-neutral-8/30",children:h.jsx(WO,{token:o,workingDir:e.workingDir,visible:X})}),q&&h.jsx("div",{className:"mt-1 border-t border-neutral-8/30 pt-1",children:Y.length===0?h.jsx("div",{className:"pl-12 pr-2 py-1 text-[13px] text-neutral-5",children:"No archived sessions"}):h.jsxs(h.Fragment,{children:[L.map(ie=>h.jsxs("button",{onClick:()=>v(ie.id),className:"group w-full flex items-baseline gap-2 pl-12 pr-2 py-0.5 text-left text-[15px] text-neutral-4 hover:bg-neutral-6/50 hover:text-neutral-2 transition-colors",children:[h.jsx(Zs,{size:12,className:"flex-shrink-0 self-center opacity-40"}),h.jsx("span",{className:"flex-1 truncate",children:rD(ie)}),h.jsx("span",{className:"shrink-0 text-[13px] text-neutral-6 tabular-nums",children:iD(ie.archivedAt)})]},ie.id)),A&&!ee&&h.jsxs("button",{onClick:()=>ae(!0),className:"w-full pl-12 pr-2 py-0.5 text-left text-[13px] text-neutral-5 hover:text-neutral-2 transition-colors",children:["Show all ",Y.length," archived..."]}),ee&&A&&h.jsx("button",{onClick:()=>ae(!1),className:"w-full pl-12 pr-2 py-0.5 text-left text-[13px] text-neutral-5 hover:text-neutral-2 transition-colors",children:"Show less"})]})})]})]})}function oD(e){return!e.includes("T")&&!e.includes("Z")&&!e.includes("+")?new Date(e.replace(" ","T")+"Z"):new Date(e)}function C1(e){const n=Math.floor((Date.now()-oD(e).getTime())/1e3);if(n<60)return`${n}s`;const r=Math.floor(n/60);if(r<60)return`${r}m`;const l=Math.floor(r/60);return l<24?`${l}h`:`${Math.floor(l/24)}d`}function wh(e){const n=e.name||e.id.slice(0,8);return n.startsWith("hub:")?"unnamed session":n}function uD(e,n){const r=[];r.push(`Here is the conversation from a previous session "${n}" for context:
|
|
107
|
+
`);for(const l of e)l.type==="user"?r.push(`**User:** ${l.text}`):l.type==="assistant"&&r.push(`**Assistant:** ${l.text}`);return r.push(`
|
|
108
|
+
---
|
|
109
|
+
Please continue from where this conversation left off. What would you like to work on?`),r.join(`
|
|
110
|
+
|
|
111
|
+
`)}function cD({token:e,visible:n,fontSize:r,workingDir:l,refreshKey:s,onNewSessionFromArchive:o,initialViewId:u,onClose:f}){const[d,p]=w.useState([]),[x,g]=w.useState(null),[y,v]=w.useState(!1),[S,E]=w.useState(7),T=w.useCallback(async()=>{if(e)try{const[_,z]=await Promise.all([R0(e,l??void 0),j0(e)]);p(_),E(z)}catch(_){console.error("Failed to load archived sessions:",_)}},[e,l]);w.useEffect(()=>{n&&!u&&T()},[n,u,T,s]),w.useEffect(()=>{!n||!u||!e||(v(!0),iy(e,u).then(g).catch(_=>console.error("Failed to load archived session:",_)).finally(()=>v(!1)))},[n,u,e]);const N=w.useCallback(async _=>{v(!0);try{const z=await iy(e,_);g(z)}catch(z){console.error("Failed to load archived session:",z)}finally{v(!1)}},[e]),j=w.useCallback(async(_,z)=>{z.stopPropagation();try{await b2(e,_),p(P=>P.filter(X=>X.id!==_)),x?.id===_&&g(null)}catch(P){console.error("Failed to delete archived session:",P)}},[e,x]),C=w.useCallback(async _=>{try{const z=await M0(e,_);E(z)}catch(z){console.error("Failed to update retention:",z)}},[e]),I=w.useCallback(()=>{if(!x||!o)return;const _=Ih(x.outputHistory),z=uD(_,wh(x));o(x.workingDir,z),g(null),f?.()},[x,o,f]),U=w.useCallback(()=>{g(null),f?.()},[f]);if(!n)return null;if(u&&y&&!x)return h.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-neutral-12",children:h.jsx(Br,{size:24,className:"text-neutral-4 animate-spin"})});if(x){const _=Ih(x.outputHistory);return h.jsxs("div",{className:"fixed inset-0 z-50 flex flex-col bg-neutral-12",children:[h.jsxs("div",{className:"flex items-center gap-3 px-4 py-2 bg-neutral-9/70 border-b border-neutral-8/40 flex-shrink-0",children:[h.jsx(Zs,{size:16,className:"text-neutral-4"}),h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsx("span",{className:"text-[15px] font-medium text-neutral-1 truncate block",children:wh(x)}),h.jsxs("span",{className:"text-[13px] text-neutral-5",children:["Archived ",C1(x.archivedAt)," ago · ",x.messageCount," messages"]})]}),o&&h.jsxs("button",{onClick:I,className:"flex items-center gap-1.5 rounded px-2.5 py-1.5 text-[13px] font-medium text-primary-4 bg-primary-10/30 hover:bg-primary-9/40 hover:text-primary-3 transition-colors",title:"Start a new session with this conversation as context",children:[h.jsx(qN,{size:16,stroke:2}),h.jsx("span",{children:"Continue in new session"})]}),h.jsx("button",{onClick:U,className:"rounded p-1 text-neutral-4 hover:text-neutral-1 hover:bg-neutral-8 transition-colors",title:"Close",children:h.jsx(Wr,{size:16,stroke:2})})]}),h.jsx("div",{className:"flex-1 overflow-hidden flex flex-col",children:h.jsx(mw,{messages:_,fontSize:r,planningMode:!1,activityLabel:void 0})})]})}return u?null:h.jsxs("div",{className:"flex flex-col min-h-0 flex-1",children:[h.jsxs("div",{className:"flex items-center justify-between px-3 py-2 bg-neutral-9/70 border-b border-neutral-8/40 flex-shrink-0",children:[h.jsx("span",{className:"text-[13px] font-semibold text-neutral-1 uppercase tracking-wider",children:"Archived Sessions"}),h.jsxs("div",{className:"flex items-center gap-1",children:[h.jsx("label",{className:"text-[12px] text-neutral-5",title:"Auto-delete after this many days",children:"Keep"}),h.jsx("input",{type:"number",min:1,max:365,value:S,onChange:_=>C(Number(_.target.value)),className:"w-10 text-[13px] text-neutral-2 bg-neutral-8 border border-neutral-7 rounded px-1 py-0.5 text-center"}),h.jsx("span",{className:"text-[12px] text-neutral-5",children:"d"})]})]}),d.length===0?h.jsx("div",{className:"px-3 py-4 text-[13px] text-neutral-5 text-center",children:"No archived sessions"}):h.jsx("div",{className:"flex flex-col py-0.5 overflow-y-auto flex-1 min-h-0",children:d.map(_=>h.jsxs("button",{onClick:()=>N(_.id),className:"group flex items-center gap-2 px-3 py-1 text-left transition-colors text-neutral-3 hover:bg-neutral-8/50 hover:text-neutral-1",children:[_.source==="workflow"?h.jsx(g_,{size:12,className:"shrink-0 opacity-50"}):_.source==="webhook"?h.jsx(tc,{size:12,className:"shrink-0 opacity-50"}):h.jsx(Zs,{size:12,className:"shrink-0 opacity-50"}),h.jsx("span",{className:"flex-1 truncate text-[15px]",children:wh(_)}),h.jsx("span",{className:"shrink-0 text-[13px] text-neutral-5 tabular-nums",children:C1(_.archivedAt)}),y?h.jsx(Br,{size:14,className:"shrink-0 text-neutral-5 animate-spin"}):h.jsx("span",{onClick:z=>j(_.id,z),className:"cursor-pointer text-transparent hover:text-error-5 group-hover:text-neutral-5 flex-shrink-0",children:h.jsx(gc,{size:14})})]},_.id))})]})}function fD({repo:e,globalModules:n=[],onSendModule:r,disabled:l}){const s=e?.modules??[];return n.length===0&&s.length===0?null:h.jsxs("div",{className:"mt-3 border-t border-neutral-10 pt-3",children:[h.jsx("h3",{className:"mb-2 text-[15px] font-medium uppercase tracking-wider text-neutral-5",children:"Modules"}),n.length>0&&h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"mb-1 px-2 text-[12px] font-medium uppercase tracking-wider text-neutral-5",children:"Global"}),h.jsx("div",{className:"flex flex-col gap-1",children:n.map(o=>h.jsxs("button",{onClick:()=>r(o),disabled:l,className:"group rounded px-2 py-1.5 text-left transition hover:bg-neutral-10/50 disabled:opacity-50 disabled:pointer-events-none",children:[h.jsx("div",{className:"text-[15px] font-medium text-primary-6 group-hover:text-primary-5",children:o.name}),o.description&&h.jsx("div",{className:"text-[13px] text-neutral-4 group-hover:text-neutral-4",children:o.description})]},o.id))})]}),s.length>0&&h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"mb-1 mt-2 px-2 text-[12px] font-medium uppercase tracking-wider text-neutral-5",children:e?.name}),h.jsx("div",{className:"flex flex-col gap-1",children:s.map(o=>h.jsxs("button",{onClick:()=>r(o),disabled:l,className:"group rounded px-2 py-1.5 text-left transition hover:bg-neutral-10/50 disabled:opacity-50 disabled:pointer-events-none",children:[h.jsx("div",{className:"text-[15px] font-medium text-primary-6 group-hover:text-primary-5",children:o.name}),o.description&&h.jsx("div",{className:"text-[13px] text-neutral-4 group-hover:text-neutral-4",children:o.description})]},o.id))})]})]})}const R1="codekin-left-sidebar-width",dD=224,j1=160,M1=480;function hD(e){const n=e.replace(/\/+$/,"").split("/");return n[n.length-1]||e}function pD(e,n,r){const l=new Map;for(const s of e){const o=Or(s),u=l.get(o)??[];u.push(s),l.set(o,u)}return Array.from(l.entries()).sort((s,o)=>{const u=s[0].replace(/\/+$/,"").split("/").pop()??s[0],f=o[0].replace(/\/+$/,"").split("/").pop()??o[0];return u.localeCompare(f)}).map(([s,o])=>({workingDir:s,displayName:hD(s),sessions:o,hasWaiting:o.some(u=>n[u.id]),hasActive:o.some(u=>u.isProcessing),hasTentative:o.some(u=>(r[u.id]?.length??0)>0)}))}function mD({sessions:e,activeSessionId:n,activeWorkingDir:r,waitingSessions:l,tentativeQueues:s,groups:o,globalModules:u,activeRepo:f,token:d,theme:p,fontSize:x,connState:g,view:y,archiveRefreshKey:v,onSelectSession:S,onDeleteSession:E,onRenameSession:T,onNewSession:N,onNewSessionFromArchive:j,onOpenSession:C,onSelectRepo:I,onDeleteRepo:U,onSettingsOpen:_,onUpdateTheme:z,onSendModule:P,onNavigateToWorkflows:X,onBrowseDocs:B,docsPicker:q={},mobile:Z={}}){const{isMobile:ee=!1,mobileOpen:ae=!1,onMobileClose:Y}=Z,[M,K]=w.useState(()=>localStorage.getItem("codekin-left-sidebar-collapsed")==="true"),[le,be]=w.useState(()=>{const he=localStorage.getItem(R1);return he?Math.max(j1,Math.min(M1,Number(he))):dD}),[O,D]=w.useState(!1),[L,A]=w.useState(null),se=w.useRef(null),te=w.useRef(!1),ie=w.useRef(0),Se=w.useRef(0);w.useEffect(()=>{localStorage.setItem("codekin-left-sidebar-collapsed",String(M))},[M]),w.useEffect(()=>{localStorage.setItem(R1,String(le))},[le]),w.useEffect(()=>{if(!O)return;function he(xe){se.current&&!se.current.contains(xe.target)&&D(!1)}return document.addEventListener("mousedown",he),()=>document.removeEventListener("mousedown",he)},[O]);const je=w.useCallback(he=>{he.preventDefault(),te.current=!0,ie.current=he.clientX,Se.current=le;const xe=et=>{if(!te.current)return;const St=et.clientX-ie.current;be(Math.max(j1,Math.min(M1,Se.current+St)))},_e=()=>{te.current=!1,document.removeEventListener("mousemove",xe),document.removeEventListener("mouseup",_e),document.body.style.cursor="",document.body.style.userSelect=""};document.body.style.cursor="col-resize",document.body.style.userSelect="none",document.addEventListener("mousemove",xe),document.addEventListener("mouseup",_e)},[le]),Ae=pD(e,l,s),qe=g==="connected"?"bg-success-7":g==="connecting"?"bg-warning-6":"bg-error-7",we=u.length>0||f&&f.modules.length>0,Ve=w.useCallback(he=>{S(he),ee&&Y?.()},[S,ee,Y]);if(!ee&&M)return h.jsxs("div",{className:"app-left-sidebar flex flex-col items-center w-12 flex-shrink-0 bg-neutral-12 py-3 gap-3 border-r border-neutral-8/30",children:[h.jsx("div",{className:"app-logo-circle flex items-center justify-center rounded-full",style:{width:28,height:28},children:h.jsx(rp,{size:26,className:"text-primary-7"})}),h.jsx("button",{onClick:()=>K(!1),className:"rounded-lg p-1.5 text-neutral-3 hover:bg-neutral-6 hover:text-neutral-1",title:"Expand sidebar",children:h.jsx(va,{size:14,stroke:2})}),h.jsxs("div",{className:"mt-auto flex flex-col items-center gap-2",children:[h.jsx("button",{onClick:()=>z(p==="dark"?"light":"dark"),className:"rounded-lg p-1.5 text-neutral-3 hover:bg-neutral-6 hover:text-neutral-1",title:p==="dark"?"Switch to light mode":"Switch to dark mode",children:p==="dark"?h.jsx(my,{size:14,stroke:2}):h.jsx(fy,{size:14,stroke:2})}),h.jsx("div",{title:g.charAt(0).toUpperCase()+g.slice(1),children:h.jsx("span",{className:`inline-block h-2 w-2 rounded-full ${qe}`})})]})]});const Lt=h.jsxs("div",{className:`app-left-sidebar relative flex flex-col bg-neutral-12 min-h-0 h-full ${ee?"w-[280px] max-w-[85vw]":"flex-shrink-0 border-r border-neutral-8/30"}`,style:ee?void 0:{width:le},children:[!ee&&h.jsx("div",{className:"absolute right-0 top-0 bottom-0 w-1 cursor-col-resize hover:bg-primary-7/50 active:bg-primary-6/60 z-10",onMouseDown:je}),h.jsxs("div",{className:"group/header flex items-center gap-2 px-3 py-2.5 border-b border-neutral-8/30 flex-shrink-0",children:[h.jsx("div",{className:"app-logo-circle flex items-center justify-center rounded-full flex-shrink-0",style:{width:26,height:26},children:h.jsx(rp,{size:24,className:"text-primary-7"})}),h.jsx("span",{className:"flex-1 text-[17px] font-semibold text-neutral-2 truncate",children:"Codekin"}),ee?h.jsx("button",{onClick:Y,className:"rounded p-1 text-neutral-3 hover:text-neutral-2 hover:bg-neutral-6 transition-colors flex-shrink-0",title:"Close menu",children:h.jsx(Wr,{size:18,stroke:2})}):h.jsx("button",{onClick:()=>K(!0),className:"rounded p-1 text-neutral-3 hover:text-neutral-2 hover:bg-neutral-6 transition-colors flex-shrink-0 opacity-0 group-hover/header:opacity-100",title:"Collapse sidebar",children:h.jsx($0,{size:16,stroke:2})}),h.jsx(QO,{groups:o,token:d,onOpen:he=>{C(he),ee&&Y?.()}})]}),h.jsxs("div",{className:"flex-1 overflow-y-auto py-1 min-h-0",children:[h.jsxs("div",{className:"px-2 py-1",children:[h.jsxs("button",{onClick:()=>{X(),ee&&Y?.()},className:`w-full flex items-center gap-2 px-2 py-1.5 rounded-md text-[15px] transition-colors ${y==="workflows"?"text-accent-3 bg-accent-11/20":"text-neutral-3 hover:text-neutral-1 hover:bg-neutral-6"}`,children:[h.jsx(V0,{size:16,stroke:2,className:"flex-shrink-0"}),h.jsx("span",{className:"flex-1 text-left",children:"AI Workflows"})]}),we&&h.jsxs("div",{ref:se,className:"relative",children:[h.jsxs("button",{onClick:()=>D(!O),className:`w-full flex items-center gap-2 px-2 py-1.5 rounded-md text-[15px] transition-colors ${O?"text-accent-3 bg-accent-11/20":"text-neutral-3 hover:text-neutral-1 hover:bg-neutral-6/50"}`,children:[h.jsx(rN,{size:16,stroke:2,className:"flex-shrink-0"}),h.jsx("span",{className:"flex-1",children:"Modules"})]}),O&&h.jsx("div",{className:"absolute left-full top-0 ml-1 w-64 z-50 rounded-md border border-neutral-10 bg-neutral-12 px-3 pb-3 shadow-lg",children:h.jsx(fD,{repo:f,globalModules:u,onSendModule:he=>{P(he),D(!1)},disabled:!n})})]})]}),h.jsx("div",{className:"mx-3 my-1 border-t border-neutral-8/40"}),Ae.length>0&&h.jsx("div",{className:"px-4 pt-1.5 pb-0.5 text-[11px] font-medium uppercase tracking-wider text-neutral-6",children:"Active sessions"}),Ae.map(he=>h.jsx(sD,{node:he,isActive:he.workingDir===r,activeSessionId:n,waitingSessions:l,tentativeQueues:s,token:d,archiveRefreshKey:v,onSelectSession:Ve,onDeleteSession:E,onRenameSession:T,onNewSession:he.workingDir===r?N:void 0,onSelectRepo:xe=>{I(xe),ee&&Y?.()},onDeleteRepo:U,onViewArchivedSession:A,onBrowseDocs:B,docsPickerOpen:q.open,docsPickerRepoDir:q.repoDir,docsPickerFiles:q.files,docsPickerLoading:q.loading,onDocsPickerSelect:q.onSelect,onDocsPickerClose:q.onClose,docsStarredDocs:q.starredDocs,isMobile:ee},he.workingDir)),Ae.length===0&&h.jsxs("div",{className:"px-4 py-6 text-center text-[13px] text-neutral-5",children:["No sessions yet.",h.jsx("br",{}),"Click + to start one."]}),h.jsx(cD,{token:d,visible:L!==null,fontSize:x,workingDir:r,refreshKey:v,onNewSessionFromArchive:j,initialViewId:L,onClose:()=>A(null)})]}),h.jsx("div",{className:"flex flex-col border-t border-neutral-8/30 flex-shrink-0",children:h.jsxs("div",{className:`flex items-center gap-0.5 px-2 ${ee?"gap-1 py-3":"py-2"}`,children:[h.jsx("div",{className:"flex items-center justify-center px-1 py-1",title:g.charAt(0).toUpperCase()+g.slice(1),children:h.jsx("span",{className:`inline-block h-2 w-2 rounded-full ${qe}`})}),h.jsx("button",{onClick:_,className:`flex items-center gap-1 rounded text-[13px] text-neutral-3 hover:text-neutral-1 hover:bg-neutral-6 transition-colors ${ee?"px-2 py-2":"px-1.5 py-1"}`,title:"Settings",children:h.jsx(Y0,{size:ee?24:20,stroke:2})}),h.jsx("div",{className:"flex-1"}),h.jsx("button",{onClick:()=>z(p==="dark"?"light":"dark"),className:`rounded text-neutral-3 hover:bg-neutral-6 hover:text-neutral-1 transition-colors ${ee?"px-2 py-2":"px-1.5 py-1"}`,title:p==="dark"?"Switch to light mode":"Switch to dark mode",children:p==="dark"?h.jsx(my,{size:ee?24:20,stroke:2}):h.jsx(fy,{size:ee?24:20,stroke:2})}),h.jsx("button",{onClick:()=>{window.location.href="/authelia/logout"},className:`rounded text-neutral-3 hover:bg-neutral-6 hover:text-neutral-1 transition-colors ${ee?"px-2 py-2":"px-1.5 py-1"}`,title:"Logout",children:h.jsx(HN,{size:ee?24:20,stroke:2})})]})})]});return ee?h.jsx("div",{className:`fixed inset-0 z-40 transition-colors duration-200 ${ae?"bg-black/50":"bg-transparent pointer-events-none"}`,onClick:Y,children:h.jsx("div",{className:`h-full w-fit transition-transform duration-200 ease-out ${ae?"translate-x-0":"-translate-x-full"}`,onClick:he=>he.stopPropagation(),children:Lt})}):Lt}function gD({repoName:e,sessionName:n,onMenuOpen:r,onNewSession:l,onSettingsOpen:s}){return h.jsxs("div",{className:"app-left-sidebar mobile-top-bar-safe flex items-center h-12 px-1.5 border-b border-neutral-8/30 bg-neutral-12 flex-shrink-0",children:[h.jsx("button",{onClick:r,className:"flex items-center justify-center rounded-lg size-[34px] text-neutral-3 hover:text-neutral-1 hover:bg-neutral-6 transition-colors","aria-label":"Open menu",children:h.jsx(FN,{size:24,stroke:2})}),h.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0 px-1.5",children:[h.jsx(rp,{size:24,className:"text-primary-7 flex-shrink-0"}),h.jsx("div",{className:"flex-1 min-w-0 truncate text-[16px] text-neutral-2",children:e?h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"font-semibold",children:e}),n&&h.jsxs("span",{className:"text-neutral-5 ml-1.5",children:["/ ",n]})]}):h.jsx("span",{className:"font-semibold",children:"Codekin"})})]}),h.jsxs("div",{className:"flex items-center gap-0.5",children:[h.jsx("button",{onClick:s,className:"flex items-center justify-center rounded-lg size-[34px] text-neutral-4 hover:text-neutral-1 hover:bg-neutral-6 transition-colors","aria-label":"Settings",children:h.jsx(Y0,{size:24,stroke:2})}),h.jsx("button",{onClick:l,className:"flex items-center justify-center rounded-lg size-[34px] text-neutral-4 hover:text-neutral-1 hover:bg-neutral-6 transition-colors","aria-label":"New session",children:h.jsx(Qs,{size:24,stroke:2})})]})]})}function xD({count:e,repoName:n,onExecute:r,onDiscard:l}){return h.jsxs("div",{className:"flex items-center justify-between border-t border-warning-8/50 bg-warning-11/30 px-4 py-2 flex-shrink-0",children:[h.jsxs("span",{className:"text-[15px] text-warning-4",children:["⏸ ",e," message",e!==1?"s":""," queued — waiting for"," ",h.jsx("span",{className:"font-medium text-warning-3",children:n})," session to finish"]}),h.jsxs("div",{className:"flex gap-2",children:[h.jsx("button",{onClick:r,className:"rounded px-2.5 py-1 text-[13px] bg-warning-9/30 hover:bg-warning-8/50 text-warning-3 transition-colors",children:"Execute now"}),h.jsx("button",{onClick:l,className:"rounded px-2.5 py-1 text-[13px] text-neutral-4 hover:text-neutral-2 hover:bg-neutral-8/50 transition-colors",children:"Discard"})]})]})}const Ir="/cc/api/workflows";function Ur(e){return{"Content-Type":"application/json",Authorization:`Bearer ${e}`}}async function bD(e,n){const r=new URLSearchParams;n&&r.set("repoPath",n);const l=r.toString(),s=await fetch(`${Ir}/kinds${l?`?${l}`:""}`,{headers:Ur(e)});if(!s.ok)throw new Error(`Failed to list kinds: ${s.status}`);return(await s.json()).kinds}async function yD(e,n){const r=new URLSearchParams;n?.kind&&r.set("kind",n.kind),n?.status&&r.set("status",n.status),r.set("limit",String(n.limit)),n?.offset&&r.set("offset",String(n.offset));const l=r.toString(),s=await fetch(`${Ir}/runs${l?`?${l}`:""}`,{headers:Ur(e)});if(!s.ok)throw new Error(`Failed to list runs: ${s.status}`);return(await s.json()).runs}async function O1(e,n){const r=await fetch(`${Ir}/runs/${n}`,{headers:Ur(e)});if(!r.ok)throw new Error(`Failed to get run: ${r.status}`);return(await r.json()).run}async function vD(e,n,r={}){const l=await fetch(`${Ir}/runs`,{method:"POST",headers:Ur(e),body:JSON.stringify({kind:n,input:r})});if(!l.ok)throw new Error(`Failed to trigger run: ${l.status}`);return(await l.json()).run}async function wD(e,n){const r=await fetch(`${Ir}/runs/${n}/cancel`,{method:"POST",headers:Ur(e)});if(!r.ok)throw new Error(`Failed to cancel run: ${r.status}`)}async function kD(e){const n=await fetch(`${Ir}/schedules`,{headers:Ur(e)});if(!n.ok)throw new Error(`Failed to list schedules: ${n.status}`);return(await n.json()).schedules}async function SD(e,n){const r=await fetch(`${Ir}/schedules/${n}/trigger`,{method:"POST",headers:Ur(e)});if(!r.ok)throw new Error(`Failed to trigger schedule: ${r.status}`);return(await r.json()).run}async function ED(e){const n=await fetch(`${Ir}/config`,{headers:Ur(e)});if(!n.ok)throw new Error(`Failed to get config: ${n.status}`);return(await n.json()).config}async function ND(e,n){const r=await fetch(`${Ir}/config/repos`,{method:"POST",headers:Ur(e),body:JSON.stringify(n)});if(!r.ok)throw new Error(`Failed to add repo config: ${r.status}`);return(await r.json()).config}async function _D(e,n){const r=await fetch(`${Ir}/config/repos/${n}`,{method:"DELETE",headers:Ur(e)});if(!r.ok)throw new Error(`Failed to remove repo config: ${r.status}`);return(await r.json()).config}async function D1(e,n,r){const l=await fetch(`${Ir}/config/repos/${n}`,{method:"PATCH",headers:Ur(e),body:JSON.stringify(r)});if(!l.ok)throw new Error(`Failed to update repo config: ${l.status}`);return(await l.json()).config}const TD=5e3,AD=15e3;function CD(e){const[n,r]=w.useState([]),[l,s]=w.useState([]),[o,u]=w.useState(null),[f,d]=w.useState(!0),[p,x]=w.useState(null),g=w.useRef(null),y=w.useCallback(async()=>{if(e)try{const[_,z,P]=await Promise.all([yD(e,{limit:50}),kD(e),ED(e)]);r(_),s(z),u(P),x(null)}catch(_){x(_ instanceof Error?_.message:"Failed to load workflow data")}finally{d(!1)}},[e]),S=n.some(_=>_.status==="running"||_.status==="queued")?TD:AD;w.useEffect(()=>(y(),g.current=setInterval(y,S),()=>{g.current&&clearInterval(g.current)}),[y,S]);const E=w.useCallback(async(_,z)=>{try{await vD(e,_,z),await y()}catch(P){x(P instanceof Error?P.message:"Failed to trigger run")}},[e,y]),T=w.useCallback(async _=>{try{await wD(e,_),await y()}catch(z){x(z instanceof Error?z.message:"Failed to cancel run")}},[e,y]),N=w.useCallback(async _=>{try{await SD(e,_),await y()}catch(z){x(z instanceof Error?z.message:"Failed to trigger schedule")}},[e,y]),j=w.useCallback(async _=>{await ND(e,_),await y()},[e,y]),C=w.useCallback(async _=>{await _D(e,_),await y()},[e,y]),I=w.useCallback(async(_,z)=>{await D1(e,_,z),await y()},[e,y]),U=w.useCallback(async(_,z)=>{await D1(e,_,{enabled:z}),await y()},[e,y]);return{runs:n,schedules:l,config:o,loading:f,error:p,refresh:y,triggerRun:E,cancelRun:T,triggerSchedule:N,addRepo:j,removeRepo:C,updateRepo:I,toggleScheduleEnabled:U}}const Nc=[{value:"coverage.daily",label:"Coverage Assessment",category:"assessment"},{value:"code-review.daily",label:"Code Review",category:"assessment"},{value:"commit-review",label:"Commit Review",category:"event"},{value:"comment-assessment.daily",label:"Comment Assessment",category:"assessment"},{value:"dependency-health.daily",label:"Dependency Health",category:"assessment"},{value:"security-audit.weekly",label:"Security Audit",category:"assessment"},{value:"complexity.weekly",label:"Complexity Report",category:"assessment"},{value:"repo-health.weekly",label:"Repository Health",category:"assessment"},{value:"docs-audit.weekly",label:"Documentation Audit",category:"assessment"}],RD=new Set(["commit-review"]);function _c(e){return RD.has(e)}const Wp=[{value:"",label:"Default (Opus)"},{value:"claude-sonnet-4-6",label:"Sonnet 4.6"},{value:"claude-haiku-4-5-20251001",label:"Haiku 4.5"}],zw=[{label:"Daily",dow:"*"},{label:"Weekdays",dow:"1-5"}],cc=[{label:"Mon",dow:"1"},{label:"Tue",dow:"2"},{label:"Wed",dow:"3"},{label:"Thu",dow:"4"},{label:"Fri",dow:"5"},{label:"Sat",dow:"6"},{label:"Sun",dow:"0"}];function Ks(e){return e.startsWith("biweekly")}function jD(e){const n=e.split("-");return n.length>=2?n.slice(1).join("-"):"*"}function fc(e,n,r=0){return Ks(n)?`${r} ${e} */14 * ${jD(n)}`:`${r} ${e} * * ${n}`}function MD(e){const n=e.trim().split(/\s+/);if(n.length===5){const l=n[2]==="*/14"?n[4]==="*"?"biweekly":`biweekly-${n[4]}`:n[4];return{hour:parseInt(n[1])||0,minute:parseInt(n[0])||0,dow:l}}return{hour:6,minute:0,dow:"*"}}const Jp="event";function dc(e){if(e===Jp)return"On commit";const n=e.trim().split(/\s+/);if(n.length!==5)return e;const[r,l,s,,o]=n,u=x=>x.length===1?`0${x}`:x,f=`${u(l)}:${u(r)}`,d=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];return s==="*/14"?`Bi-weekly${o!=="*"?` ${d[parseInt(o)]??o}`:""} at ${f}`:o==="*"?`Daily at ${f}`:o==="1-5"?`Weekdays at ${f}`:`Weekly ${d[parseInt(o)]??o} at ${f}`}function z1(e){return e?Wp.find(n=>n.value===e)?.label??e:null}function em(e){return Nc.find(n=>n.value===e)?.label??e}function Lw(e){return Nc.find(n=>n.value===e)?.category??"assessment"}function L1(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")}function tm(e,n){if(!e)return"—";const l=(n?new Date(n):new Date).getTime()-new Date(e).getTime();return l<1e3?"<1s":l<6e4?`${Math.round(l/1e3)}s`:`${Math.round(l/6e4)}m`}function nm(e){return e?new Date(e).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):"—"}function OD(e){return e.input.repoName||e.input.repoPath?.split("/").pop()||e.kind}function DD(e){switch(e){case"succeeded":return"bg-success-7 text-success-2";case"failed":return"bg-error-8 text-error-2";case"running":return"bg-accent-8 text-accent-2 animate-pulse";case"queued":return"bg-neutral-8 text-neutral-3";case"canceled":return"bg-warning-8 text-warning-2";case"skipped":return"bg-neutral-8 text-neutral-5";default:return"bg-neutral-8 text-neutral-3"}}function Bw({kind:e}){const n=Lw(e),r={assessment:"border-accent-7/60 bg-accent-9/30 text-accent-4",organizer:"border-success-7/60 bg-success-9/30 text-success-4",executor:"border-warning-7/60 bg-warning-9/30 text-warning-4",event:"border-purple-700/60 bg-purple-900/30 text-purple-400"};return h.jsx("span",{className:`inline-flex items-center rounded-full border px-2.5 py-0.5 text-[13px] font-medium capitalize ${r[n]}`,children:n})}function rm({status:e}){switch(e){case"succeeded":return h.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-full border border-success-7/60 bg-success-8/40 px-2.5 py-0.5 text-[13px] font-medium text-success-4",children:[h.jsx(oo,{size:12,stroke:2.5}),"succeeded"]});case"failed":return h.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-full border border-error-7/60 bg-error-9/40 px-2.5 py-0.5 text-[13px] font-medium text-error-4",children:[h.jsx(Wr,{size:12,stroke:2.5}),"failed"]});case"running":return h.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-full border border-accent-7/60 bg-accent-9/40 px-2.5 py-0.5 text-[13px] font-medium text-accent-4",children:[h.jsx(Br,{size:12,stroke:2,className:"animate-spin"}),"running"]});case"queued":return h.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-full border border-neutral-7/60 bg-neutral-9/40 px-2.5 py-0.5 text-[13px] font-medium text-neutral-4",children:[h.jsx(yN,{size:12,stroke:2}),"queued"]});case"canceled":return h.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-full border border-warning-7/60 bg-warning-9/40 px-2.5 py-0.5 text-[13px] font-medium text-warning-4",children:[h.jsx(F0,{size:12,stroke:2}),"canceled"]});case"skipped":return h.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-full border border-neutral-7/60 bg-neutral-9/40 px-2.5 py-0.5 text-[13px] font-medium text-neutral-5",children:[h.jsx(q0,{size:12,stroke:2}),"skipped"]});default:return h.jsx("span",{className:"inline-flex items-center gap-1.5 rounded-full border border-neutral-7/60 bg-neutral-9/40 px-2.5 py-0.5 text-[13px] font-medium text-neutral-4",children:e})}}const zD=Array.from({length:24},(e,n)=>n);function Iw({hour:e,minute:n,onChange:r,step:l=15,className:s=""}){const[o,u]=w.useState(!1),f=w.useRef(null),d=w.useRef(null),p=w.useRef(null),x=Array.from({length:60/l},(v,S)=>S*l),g=v=>String(v).padStart(2,"0");w.useEffect(()=>{if(!o)return;const v=S=>{f.current&&!f.current.contains(S.target)&&u(!1)};return document.addEventListener("mousedown",v),()=>document.removeEventListener("mousedown",v)},[o]),w.useEffect(()=>{o&&requestAnimationFrame(()=>{d.current?.querySelector('[data-selected="true"]')?.scrollIntoView({block:"nearest"}),p.current?.querySelector('[data-selected="true"]')?.scrollIntoView({block:"nearest"})})},[o]);const y=w.useCallback(v=>{v.key==="Escape"&&u(!1)},[]);return h.jsxs("div",{ref:f,className:`relative inline-block ${s}`,onKeyDown:y,children:[h.jsxs("button",{type:"button",onClick:()=>u(v=>!v),className:"flex items-center gap-2 rounded-md border border-neutral-7 bg-neutral-10 px-3 py-2 text-[15px] font-mono text-neutral-1 focus:border-accent-6 focus:outline-none w-40 cursor-pointer hover:border-neutral-5 transition-colors",children:[h.jsxs("span",{className:"flex-1 text-left",children:[g(e),":",g(n)]}),h.jsxs("svg",{className:"w-4 h-4 text-neutral-3",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[h.jsx("circle",{cx:"12",cy:"12",r:"10"}),h.jsx("polyline",{points:"12 6 12 12 16 14"})]})]}),o&&h.jsxs("div",{className:"absolute top-full left-0 z-50 mt-1 flex rounded-md border border-neutral-7 bg-neutral-10 shadow-lg overflow-hidden",children:[h.jsx("div",{ref:d,className:"h-52 overflow-y-auto scrollbar-thin",children:zD.map(v=>h.jsx("button",{type:"button","data-selected":v===e,onClick:()=>{r(v,n)},className:`block w-full px-4 py-1.5 text-center font-mono text-[14px] transition-colors cursor-pointer
|
|
112
|
+
${v===e?"bg-accent-8 text-accent-2":"text-neutral-2 hover:bg-neutral-8"}`,children:g(v)},v))}),h.jsx("div",{className:"w-px bg-neutral-7"}),h.jsx("div",{ref:p,className:"h-52 overflow-y-auto scrollbar-thin",children:x.map(v=>h.jsx("button",{type:"button","data-selected":v===n,onClick:()=>{r(e,v)},className:`block w-full px-4 py-1.5 text-center font-mono text-[14px] transition-colors cursor-pointer
|
|
113
|
+
${v===n?"bg-accent-8 text-accent-2":"text-neutral-2 hover:bg-neutral-8"}`,children:g(v)},v))})]})]})}function LD({current:e,eventDriven:n}){const r=[{num:1,label:"Repository"},{num:2,label:"Workflow"},{num:3,label:n?"Configure":"Schedule"}];return h.jsx("div",{className:"flex items-center gap-1 mb-5",children:r.map((l,s)=>h.jsxs("div",{className:"flex items-center gap-1 flex-1",children:[h.jsxs("div",{className:"flex items-center gap-2 flex-1",children:[h.jsx("span",{className:`w-6 h-6 rounded-full flex items-center justify-center text-[12px] font-semibold shrink-0 ${l.num<e?"bg-success-7 text-white":l.num===e?"bg-accent-7 text-white":"bg-neutral-9 text-neutral-5"}`,children:l.num<e?h.jsx(oo,{size:12,stroke:3}):l.num}),h.jsx("span",{className:`text-[13px] font-medium ${l.num===e?"text-neutral-1":"text-neutral-5"}`,children:l.label})]}),s<r.length-1&&h.jsx("div",{className:`h-px flex-1 mx-1 ${l.num<e?"bg-success-7":"bg-neutral-8"}`})]},l.num))})}function BD({token:e,selectedRepoId:n,onSelect:r}){const{groups:l,loading:s,error:o}=C0(e),u=l.flatMap(f=>f.repos);return s?h.jsxs("div",{className:"flex items-center gap-2 py-8 justify-center text-[13px] text-neutral-5",children:[h.jsx(Br,{size:16,stroke:2,className:"animate-spin"}),"Loading repositories…"]}):o?h.jsxs("div",{className:"rounded-md bg-error-10/50 px-3 py-2 text-[13px] text-error-4",children:["Failed to load repos: ",o]}):h.jsxs("div",{children:[h.jsx("p",{className:"text-[13px] text-neutral-4 mb-3",children:"Choose which repository this workflow will run against."}),h.jsx(Qp,{groups:l,selectedId:n,onSelect:f=>{const d=u.find(p=>p.id===f.id);d&&r(d.id,d.path,d.name)},maxHeight:"320px"})]})}function ID({token:e,repoPath:n,selectedKind:r,onSelect:l}){const[s,o]=w.useState(Nc.map(p=>({kind:p.value,name:p.label,source:"builtin"}))),[u,f]=w.useState(!0);w.useEffect(()=>{let p=!1;return bD(e,n||void 0).then(x=>{p||x.length>0&&o(x)}).catch(()=>{}).finally(()=>{p||f(!1)}),()=>{p=!0}},[e,n]);const d=new Map;for(const p of s){const x=Lw(p.kind);d.has(x)||d.set(x,[]),d.get(x).push(p)}return h.jsxs("div",{children:[h.jsx("p",{className:"text-[13px] text-neutral-4 mb-3",children:"Select the type of automated workflow to run."}),u&&h.jsxs("div",{className:"flex items-center gap-2 py-2 text-[13px] text-neutral-5 mb-2",children:[h.jsx(Br,{size:14,stroke:2,className:"animate-spin"}),"Checking for repo-specific workflows…"]}),h.jsx("div",{className:"space-y-4",children:Array.from(d.entries()).map(([p,x])=>h.jsxs("div",{children:[h.jsx("div",{className:"flex items-center gap-2 mb-2",children:h.jsx(Bw,{kind:x[0].kind})}),h.jsx("div",{className:"grid grid-cols-2 gap-2",children:x.map(g=>h.jsxs("button",{type:"button",onClick:()=>l(g.kind),className:`rounded-lg border px-3 py-2.5 text-left transition-colors ${r===g.kind?"border-accent-6 bg-accent-9/30 ring-1 ring-accent-6/30":"border-neutral-7 bg-neutral-10 hover:border-neutral-6"}`,children:[h.jsx("span",{className:`block text-[15px] font-medium ${r===g.kind?"text-accent-2":"text-neutral-2"}`,children:g.name}),g.source==="repo"&&h.jsx("span",{className:"block text-[11px] text-neutral-5 mt-0.5",children:"repo-specific"})]},g.kind))})]},p))}),!u&&h.jsxs("p",{className:"mt-4 text-[12px] text-neutral-5 leading-relaxed",children:["You can define custom workflow types by adding ",h.jsx("code",{className:"text-neutral-4",children:".md"})," files to ",h.jsxs("code",{className:"text-neutral-4",children:[n,"/.codekin/workflows/"]}),". See the guide on the Workflows page for details."]})]})}function Bu({label:e,dow:n,selected:r,onSelect:l}){return h.jsx("button",{type:"button",onClick:()=>l(n),className:`rounded-md border px-3 py-1.5 text-[13px] font-medium transition-colors ${r?"border-accent-6 bg-accent-9/40 text-accent-2":"border-neutral-7 bg-neutral-10 text-neutral-3 hover:border-neutral-6 hover:text-neutral-2"}`,children:e})}function UD({form:e,onChange:n}){const r=_c(e.kind);return h.jsxs("div",{className:"space-y-5",children:[r?h.jsxs("div",{children:[h.jsx("p",{className:"text-[13px] text-neutral-4 mb-3",children:"This workflow runs automatically on every commit via a post-commit hook."}),h.jsxs("div",{className:"rounded-lg border border-purple-700/40 bg-purple-900/20 px-4 py-3",children:[h.jsx("span",{className:"text-[14px] font-medium text-purple-400",children:"Trigger: On commit"}),h.jsx("p",{className:"text-[13px] text-neutral-4 mt-1",children:"Each commit will be reviewed automatically. No schedule needed."})]})]}):h.jsxs(h.Fragment,{children:[h.jsxs("div",{children:[h.jsx("p",{className:"text-[13px] text-neutral-4 mb-3",children:"Choose when this workflow should run automatically."}),h.jsx("label",{className:"block text-[13px] font-medium text-neutral-3 mb-2",children:"Time"}),h.jsx(Iw,{hour:e.cronHour,minute:e.cronMinute,onChange:(l,s)=>n({cronHour:l,cronMinute:s})})]}),h.jsxs("div",{children:[h.jsx("label",{className:"block text-[13px] font-medium text-neutral-3 mb-2",children:"Frequency"}),h.jsx("div",{className:"flex flex-wrap gap-1.5 mb-2",children:zw.map(l=>{const s=e.cronDow===l.dow;return h.jsx(Bu,{label:l.label,dow:l.dow,selected:s,onSelect:o=>n({cronDow:o})},l.dow)})}),h.jsx("div",{className:"flex gap-1.5",children:cc.map(l=>{const o=(Ks(e.cronDow)?e.cronDow.split("-").slice(1).join("-"):e.cronDow)===l.dow;return h.jsx(Bu,{label:l.label,dow:l.dow,selected:o,onSelect:u=>{const f=Ks(e.cronDow);n({cronDow:f?`biweekly-${u}`:u})}},l.dow)})}),(()=>{if(!cc.some(u=>u.dow===e.cronDow||e.cronDow===`biweekly-${u.dow}`))return null;const s=Ks(e.cronDow),o=s?e.cronDow.split("-").slice(1).join("-"):e.cronDow;return h.jsxs("div",{className:"flex gap-1.5 mt-2",children:[h.jsx(Bu,{label:"Every week",dow:o,selected:!s,onSelect:u=>n({cronDow:u})}),h.jsx(Bu,{label:"Every 2 weeks",dow:`biweekly-${o}`,selected:s,onSelect:u=>n({cronDow:u})})]})})(),h.jsx("div",{className:"mt-2 text-[13px] text-neutral-5",children:dc(fc(e.cronHour,e.cronDow,e.cronMinute))})]})]}),h.jsxs("div",{children:[h.jsx("label",{className:"block text-[13px] font-medium text-neutral-3 mb-2",children:"Model"}),h.jsx("div",{className:"flex gap-1.5",children:Wp.map(l=>h.jsx("button",{type:"button",onClick:()=>n({model:l.value}),className:`rounded-md border px-3 py-1.5 text-[13px] font-medium transition-colors ${e.model===l.value?"border-accent-6 bg-accent-9/40 text-accent-2":"border-neutral-7 bg-neutral-10 text-neutral-3 hover:border-neutral-6 hover:text-neutral-2"}`,children:l.label},l.value))})]}),h.jsxs("div",{children:[h.jsxs("label",{className:"block text-[13px] font-medium text-neutral-3 mb-1.5",children:["Focus areas ",h.jsx("span",{className:"text-neutral-5 font-normal",children:"(optional)"})]}),h.jsx("textarea",{value:e.customPrompt,onChange:l=>n({customPrompt:l.target.value}),rows:3,placeholder:"e.g. Focus on the auth module and payment flows",className:"w-full rounded-md border border-neutral-7 bg-neutral-10 px-3 py-2 text-[15px] text-neutral-1 placeholder-neutral-5 focus:border-accent-6 focus:outline-none resize-none"})]})]})}function $D({token:e,onClose:n,onAdd:r}){const[l,s]=w.useState(1),[o,u]=w.useState(""),[f,d]=w.useState({kind:"",repoPath:"",repoName:"",cronHour:6,cronMinute:0,cronDow:"*",customPrompt:"",model:""}),[p,x]=w.useState(!1),[g,y]=w.useState(null),v=_c(f.kind),S=C=>d(I=>({...I,...C})),E=()=>l===1?!!f.repoPath:l===2?!!f.kind:!0,T=()=>{if(y(null),l===1&&!f.repoPath){y("Please select a repository");return}if(l===2&&!f.kind){y("Please select a workflow");return}l<3&&s(l+1)},N=()=>{y(null),l>1&&s(l-1)},j=async()=>{x(!0),y(null);try{const C=f.repoName||f.repoPath.split("/").pop()||"workflow",I=v?Jp:fc(f.cronHour,f.cronDow,f.cronMinute);await r({id:`${L1(C)}-${L1(f.kind)}`,name:C,repoPath:f.repoPath.trim(),cronExpression:I,kind:f.kind,enabled:!0,customPrompt:f.customPrompt.trim()||void 0,model:f.model||void 0}),n()}catch(C){y(C instanceof Error?C.message:"Failed to add workflow")}finally{x(!1)}};return h.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60",onClick:n,children:h.jsxs("div",{className:"w-[520px] max-h-[90vh] overflow-y-auto rounded-xl border border-neutral-7 bg-neutral-11 p-6 shadow-2xl",onClick:C=>C.stopPropagation(),children:[h.jsxs("div",{className:"flex items-center justify-between mb-1",children:[h.jsx("h2",{className:"text-[19px] font-semibold text-neutral-1",children:"New Workflow"}),h.jsx("button",{onClick:n,className:"rounded p-1 text-neutral-4 hover:text-neutral-1 hover:bg-neutral-9",children:h.jsx(Wr,{size:16,stroke:2})})]}),h.jsx(LD,{current:l,eventDriven:v}),h.jsxs("div",{className:"min-h-[200px]",children:[l===1&&h.jsx(BD,{token:e,selectedRepoId:o,onSelect:(C,I,U)=>{u(C),S({repoPath:I,repoName:U})}}),l===2&&h.jsx(ID,{token:e,repoPath:f.repoPath,selectedKind:f.kind,onSelect:C=>S({kind:C})}),l===3&&h.jsx(UD,{form:f,onChange:S})]}),g&&h.jsx("div",{className:"rounded-md bg-error-10/50 px-3 py-2 text-[13px] text-error-4 mt-3",children:g}),h.jsxs("div",{className:"flex gap-2 mt-5 pt-4 border-t border-neutral-8/50",children:[l>1?h.jsxs("button",{type:"button",onClick:N,className:"flex items-center gap-1.5 rounded-md border border-neutral-7 bg-neutral-10 px-4 py-2 text-[15px] text-neutral-3 hover:bg-neutral-9 hover:text-neutral-1 transition-colors",children:[h.jsx(W2,{size:14,stroke:2}),"Back"]}):h.jsx("button",{type:"button",onClick:n,className:"rounded-md border border-neutral-7 bg-neutral-10 px-4 py-2 text-[15px] text-neutral-3 hover:bg-neutral-9 hover:text-neutral-1 transition-colors",children:"Cancel"}),h.jsx("div",{className:"flex-1"}),l<3?h.jsxs("button",{type:"button",onClick:T,disabled:!E(),className:"flex items-center gap-1.5 rounded-md bg-primary-8 px-4 py-2 text-[15px] font-medium text-neutral-1 hover:bg-primary-7 disabled:opacity-40 transition-colors",children:["Next",h.jsx(U0,{size:14,stroke:2})]}):h.jsx("button",{type:"button",onClick:j,disabled:p,className:"flex items-center gap-1.5 rounded-md bg-primary-8 px-4 py-2 text-[15px] font-medium text-neutral-1 hover:bg-primary-7 disabled:opacity-50 transition-colors",children:p?h.jsxs(h.Fragment,{children:[h.jsx(Br,{size:14,stroke:2,className:"animate-spin"}),"Creating…"]}):h.jsxs(h.Fragment,{children:[h.jsx(oo,{size:14,stroke:2}),"Create Workflow"]})})]})]})})}const Hs=e=>`rounded-md border px-3 py-1.5 text-[13px] font-medium transition-colors ${e?"border-accent-6 bg-accent-9/40 text-accent-2":"border-neutral-7 bg-neutral-10 text-neutral-3 hover:border-neutral-6 hover:text-neutral-2"}`;function HD({repo:e,onClose:n,onSave:r}){const l=MD(e.cronExpression),[s,o]=w.useState({kind:e.kind??"coverage.daily",cronHour:l.hour,cronMinute:l.minute,cronDow:l.dow,customPrompt:e.customPrompt??"",model:e.model??""}),[u,f]=w.useState(!1),[d,p]=w.useState(null),x=_c(s.kind),g=async T=>{T.preventDefault(),f(!0),p(null);try{const N=x?Jp:fc(s.cronHour,s.cronDow,s.cronMinute);await r(e.id,{kind:s.kind,cronExpression:N,customPrompt:s.customPrompt.trim()||void 0,model:s.model||void 0}),n()}catch(N){p(N instanceof Error?N.message:"Failed to save workflow")}finally{f(!1)}},y=e.repoPath.split("/").pop()||e.name,v=Ks(s.cronDow),S=v?s.cronDow.split("-").slice(1).join("-"):s.cronDow,E=cc.some(T=>T.dow===S);return h.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60",onClick:n,children:h.jsxs("div",{className:"w-[480px] max-h-[90vh] overflow-y-auto rounded-xl border border-neutral-7 bg-neutral-11 p-6 shadow-2xl",onClick:T=>T.stopPropagation(),children:[h.jsxs("div",{className:"flex items-center justify-between mb-5",children:[h.jsxs("div",{children:[h.jsx("h2",{className:"text-[19px] font-semibold text-neutral-1",children:"Edit Workflow"}),h.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[h.jsx("span",{className:"text-[13px] text-neutral-4",children:y}),h.jsx("span",{className:"text-neutral-7",children:"·"}),h.jsx("span",{className:"text-[13px] text-neutral-4",children:em(e.kind??"")})]})]}),h.jsx("button",{onClick:n,className:"rounded p-1 text-neutral-4 hover:text-neutral-1 hover:bg-neutral-9",children:h.jsx(Wr,{size:16,stroke:2})})]}),h.jsxs("form",{onSubmit:g,className:"space-y-5",children:[h.jsxs("div",{children:[h.jsxs("div",{className:"flex items-center justify-between mb-2",children:[h.jsx("label",{className:"text-[13px] font-medium text-neutral-3",children:"Workflow type"}),h.jsx(Bw,{kind:s.kind})]}),h.jsx("div",{className:"grid grid-cols-2 gap-2",children:Nc.map(T=>h.jsx("button",{type:"button",onClick:()=>o(N=>({...N,kind:T.value})),className:`rounded-lg border px-3 py-2.5 text-left transition-colors ${s.kind===T.value?"border-accent-6 bg-accent-9/30 ring-1 ring-accent-6/30":"border-neutral-7 bg-neutral-10 hover:border-neutral-6"}`,children:h.jsx("span",{className:`block text-[15px] font-medium ${s.kind===T.value?"text-accent-2":"text-neutral-2"}`,children:T.label})},T.value))})]}),x?h.jsxs("div",{className:"rounded-lg border border-purple-700/40 bg-purple-900/20 px-4 py-3",children:[h.jsx("span",{className:"text-[14px] font-medium text-purple-400",children:"Trigger: On commit"}),h.jsx("p",{className:"text-[13px] text-neutral-4 mt-1",children:"Each commit will be reviewed automatically. No schedule needed."})]}):h.jsxs("div",{children:[h.jsx("label",{className:"block text-[13px] font-medium text-neutral-3 mb-2",children:"Time"}),h.jsx(Iw,{hour:s.cronHour,minute:s.cronMinute,onChange:(T,N)=>o(j=>({...j,cronHour:T,cronMinute:N})),className:"mb-3"}),h.jsx("label",{className:"block text-[13px] font-medium text-neutral-3 mb-2",children:"Frequency"}),h.jsx("div",{className:"flex flex-wrap gap-1.5 mb-2",children:zw.map(T=>h.jsx("button",{type:"button",onClick:()=>o(N=>({...N,cronDow:T.dow})),className:Hs(s.cronDow===T.dow),children:T.label},T.dow))}),h.jsx("div",{className:"flex gap-1.5",children:cc.map(T=>h.jsx("button",{type:"button",onClick:()=>o(N=>({...N,cronDow:v?`biweekly-${T.dow}`:T.dow})),className:Hs(S===T.dow),children:T.label},T.dow))}),E&&h.jsxs("div",{className:"flex gap-1.5 mt-2",children:[h.jsx("button",{type:"button",onClick:()=>o(T=>({...T,cronDow:S})),className:Hs(!v),children:"Every week"}),h.jsx("button",{type:"button",onClick:()=>o(T=>({...T,cronDow:`biweekly-${S}`})),className:Hs(v),children:"Every 2 weeks"})]}),h.jsx("div",{className:"mt-2 text-[13px] text-neutral-5",children:dc(fc(s.cronHour,s.cronDow,s.cronMinute))})]}),h.jsxs("div",{children:[h.jsx("label",{className:"block text-[13px] font-medium text-neutral-3 mb-2",children:"Model"}),h.jsx("div",{className:"flex gap-1.5",children:Wp.map(T=>h.jsx("button",{type:"button",onClick:()=>o(N=>({...N,model:T.value})),className:Hs(s.model===T.value),children:T.label},T.value))})]}),h.jsxs("div",{children:[h.jsxs("label",{className:"block text-[13px] font-medium text-neutral-3 mb-1.5",children:["Focus areas ",h.jsx("span",{className:"text-neutral-5 font-normal",children:"(optional)"})]}),h.jsx("textarea",{value:s.customPrompt,onChange:T=>o(N=>({...N,customPrompt:T.target.value})),rows:3,placeholder:"e.g. Focus on the auth module and payment flows",className:"w-full rounded-md border border-neutral-7 bg-neutral-10 px-3 py-2 text-[15px] text-neutral-1 placeholder-neutral-5 focus:border-accent-6 focus:outline-none resize-none"})]}),d&&h.jsx("div",{className:"rounded-md bg-error-10/50 px-3 py-2 text-[13px] text-error-4",children:d}),h.jsxs("div",{className:"flex gap-2 pt-2 border-t border-neutral-8/50",children:[h.jsx("button",{type:"button",onClick:n,className:"flex-1 rounded-md border border-neutral-7 bg-neutral-10 py-2 text-[15px] text-neutral-3 hover:bg-neutral-9 hover:text-neutral-1 transition-colors",children:"Cancel"}),h.jsx("button",{type:"submit",disabled:u,className:"flex-1 rounded-md bg-primary-8 py-2 text-[15px] font-medium text-neutral-1 hover:bg-primary-7 disabled:opacity-50 transition-colors flex items-center justify-center gap-1.5",children:u?h.jsxs(h.Fragment,{children:[h.jsx(Br,{size:14,stroke:2,className:"animate-spin"}),"Saving…"]}):"Save Changes"})]})]})]})})}function ap({status:e}){if(!e)return h.jsx("span",{className:"w-2.5 h-2.5 rounded-full bg-neutral-7 shrink-0",title:"No runs yet"});const n={succeeded:"bg-success-5",failed:"bg-error-5",running:"bg-accent-5 animate-pulse",queued:"bg-neutral-5 animate-pulse",canceled:"bg-warning-5",skipped:"bg-neutral-6"};return h.jsx("span",{className:`w-2.5 h-2.5 rounded-full shrink-0 ${n[e]||"bg-neutral-7"}`,title:e})}function PD({status:e}){const n="shrink-0";switch(e){case"succeeded":return h.jsx(oo,{size:14,stroke:2.5,className:`${n} text-success-4`});case"failed":return h.jsx(Wr,{size:14,stroke:2.5,className:`${n} text-error-4`});case"running":return h.jsx(Br,{size:14,stroke:2,className:`${n} text-accent-4 animate-spin`});case"skipped":return h.jsx(F0,{size:14,stroke:2,className:`${n} text-neutral-6`});default:return h.jsx(xN,{size:14,stroke:2,className:`${n} text-neutral-6`})}}function lp({label:e,data:n,defaultOpen:r=!1}){if(!n||Object.keys(n).length===0)return null;const l=JSON.stringify(n,null,2),s=l.length>4e3?l.slice(0,4e3)+`
|
|
114
|
+
… (truncated)`:l;return h.jsxs("details",{open:r,className:"mt-1.5",children:[h.jsxs("summary",{className:"cursor-pointer select-none text-[14px] text-neutral-5 hover:text-neutral-3 list-none flex items-center gap-1",children:[h.jsx(va,{size:12,stroke:2,className:"details-arrow transition-transform"}),e,h.jsxs("span",{className:"text-neutral-6",children:["(",Object.keys(n).length," fields)"]})]}),h.jsx("pre",{className:"mt-1 overflow-x-auto rounded-md bg-neutral-12 p-2.5 text-[14px] text-neutral-3 font-mono leading-relaxed max-h-64 overflow-y-auto",children:s})]})}function FD({step:e}){return h.jsxs("div",{className:"rounded-md border border-neutral-8/40 bg-neutral-11/60 px-3 py-2",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(PD,{status:e.status}),h.jsx("span",{className:"font-mono text-[14px] text-neutral-2 font-medium",children:e.key}),h.jsx("span",{className:`ml-auto inline-flex items-center rounded px-1.5 py-0.5 text-[13px] font-medium ${DD(e.status)}`,children:e.status}),h.jsx("span",{className:"text-[14px] text-neutral-5 tabular-nums",children:tm(e.startedAt,e.completedAt)})]}),e.error&&h.jsx("div",{className:"mt-1.5 rounded bg-error-10/50 px-2 py-1 text-[14px] text-error-4 font-mono",children:e.error}),h.jsxs("div",{className:"mt-0.5",children:[h.jsx(lp,{label:"input",data:e.input}),h.jsx(lp,{label:"output",data:e.output})]})]})}function GD({run:e}){return h.jsxs("div",{className:"mt-2 space-y-1.5 border-l-2 border-neutral-8/50 pl-3",children:[h.jsx("div",{className:"text-[14px] font-medium text-neutral-5 uppercase tracking-wider mb-2",children:"Steps"}),e.steps.length===0?h.jsx("div",{className:"text-[14px] text-neutral-5 py-1",children:"No steps recorded yet."}):e.steps.map(n=>h.jsx(FD,{step:n},n.id)),e.output&&Object.keys(e.output).length>0&&h.jsx("div",{className:"pt-1",children:h.jsx(lp,{label:"run output",data:e.output,defaultOpen:!0})}),e.error&&h.jsx("div",{className:"rounded-md bg-error-10/50 px-3 py-2 text-[14px] text-error-4 font-mono",children:e.error})]})}function qD({run:e,selected:n,detail:r,detailLoading:l,onToggle:s,onCancel:o,onNavigateToSession:u}){const f=e.output?.sessionId||e.input?.sessionId;return h.jsxs("div",{children:[h.jsxs("div",{onClick:s,className:`flex items-center gap-3 px-3 py-2 cursor-pointer transition-colors rounded-md ${n?"bg-neutral-10":"hover:bg-neutral-10/50"}`,children:[h.jsx("span",{className:"text-neutral-5 w-4 shrink-0",children:n?h.jsx(Zr,{size:13,stroke:2}):h.jsx(va,{size:13,stroke:2})}),h.jsx("span",{className:"text-[14px] text-neutral-4 tabular-nums whitespace-nowrap",children:nm(e.createdAt)}),h.jsx("span",{className:"text-[14px] text-neutral-4 tabular-nums whitespace-nowrap",children:tm(e.startedAt,e.completedAt)}),h.jsx("span",{className:"ml-auto",children:h.jsx(rm,{status:e.status})}),h.jsxs("div",{className:"flex items-center gap-0.5 shrink-0",onClick:d=>d.stopPropagation(),children:[e.status==="running"&&h.jsx("button",{onClick:()=>o(e.id),className:"rounded p-1 text-neutral-4 hover:text-error-4 hover:bg-neutral-9 transition-colors",title:"Cancel",children:h.jsx(t_,{size:13,stroke:2})}),f&&u&&h.jsx("button",{onClick:()=>u(f),className:"rounded p-1 text-neutral-4 hover:text-accent-3 hover:bg-neutral-9 transition-colors",title:"View session",children:h.jsx(P0,{size:13,stroke:2})})]})]}),n&&h.jsx("div",{className:"px-3 pb-2",children:l?h.jsxs("div",{className:"flex items-center gap-2 py-3 text-[14px] text-neutral-5",children:[h.jsx(Br,{size:16,stroke:2,className:"animate-spin"}),"Loading steps…"]}):r?h.jsx(GD,{run:r}):null})]})}function YD({repo:e,schedule:n,recentRuns:r,selectedRunId:l,runDetail:s,detailLoading:o,onTrigger:u,onToggleEnabled:f,onEdit:d,onDelete:p,onToggleRun:x,onCancel:g,onNavigateToSession:y}){const[v,S]=w.useState(!1),E=_c(e.kind??""),T=n?!n.enabled:!1,N=r[0];return h.jsxs("div",{children:[h.jsxs("div",{className:`group flex items-center gap-3 px-3 py-2 rounded-md transition-colors hover:bg-neutral-10/50 ${T&&!E?"opacity-60":""}`,children:[h.jsx(ap,{status:N?.status}),h.jsx("span",{className:`text-[14px] font-medium min-w-0 truncate ${T&&!E?"text-neutral-5":"text-neutral-2"}`,children:em(e.kind??"")}),T&&!E&&h.jsx("span",{className:"text-[12px] text-warning-5 shrink-0",children:"paused"}),h.jsx("span",{className:`text-[14px] whitespace-nowrap shrink-0 ${E?"text-purple-400":"text-neutral-5"}`,children:E?"On commit":dc(n?n.cronExpression:e.cronExpression)}),z1(e.model)&&h.jsx("span",{className:"text-[12px] text-neutral-5 bg-neutral-9 rounded px-1.5 py-0.5 shrink-0",children:z1(e.model)}),N&&h.jsxs(h.Fragment,{children:[h.jsx(rm,{status:N.status}),h.jsx("span",{className:"text-[13px] text-neutral-5 tabular-nums whitespace-nowrap shrink-0",children:nm(N.createdAt)})]}),r.length>0&&h.jsx("button",{onClick:()=>S(!v),className:"flex items-center gap-0.5 shrink-0 rounded px-1 py-0.5 hover:bg-neutral-9 transition-colors",title:`${r.length} recent runs`,children:r.slice(0,5).map(j=>h.jsx(ap,{status:j.status},j.id))}),h.jsxs("div",{className:"flex items-center gap-0.5 shrink-0 ml-auto opacity-0 group-hover:opacity-100 transition-opacity",children:[!E&&h.jsx("button",{onClick:()=>u(e.id),className:"rounded p-1 text-neutral-5 hover:text-accent-3 hover:bg-neutral-9 transition-colors",title:"Run now",children:h.jsx(hy,{size:14,stroke:2})}),!E&&h.jsx("button",{onClick:()=>f(e.id,!n?.enabled),className:`rounded p-1 transition-colors ${T?"text-success-5 hover:text-success-3 hover:bg-neutral-9":"text-neutral-5 hover:text-warning-4 hover:bg-neutral-9"}`,title:T?"Resume":"Pause",children:T?h.jsx(hy,{size:14,stroke:2}):h.jsx(q0,{size:14,stroke:2})}),h.jsx("button",{onClick:()=>d(e),className:"rounded p-1 text-neutral-5 hover:text-neutral-2 hover:bg-neutral-9 transition-colors",title:"Edit",children:h.jsx(G0,{size:14,stroke:2})}),h.jsx("button",{onClick:()=>p(e.id),className:"rounded p-1 text-neutral-6 hover:text-error-4 hover:bg-neutral-9 transition-colors",title:"Delete",children:h.jsx(gc,{size:14,stroke:2})})]})]}),v&&r.length>0&&h.jsx("div",{className:"ml-6 border-l border-neutral-8/40 pl-2 pb-1",children:r.map(j=>h.jsx(qD,{run:j,selected:l===j.id,detail:l===j.id?s:null,detailLoading:l===j.id?o:!1,onToggle:()=>x(j.id),onCancel:g,onNavigateToSession:y},j.id))})]})}function VD({repoPath:e,workflows:n,scheduleMap:r,runsPerRepo:l,selectedRunId:s,runDetail:o,detailLoading:u,onTrigger:f,onToggleEnabled:d,onEdit:p,onDelete:x,onToggleRun:g,onCancel:y,onNavigateToSession:v}){const S=e.split("/").pop()||e;return h.jsxs("div",{className:"workflow-card rounded-lg border border-neutral-9/60 bg-neutral-10/30 overflow-hidden",children:[h.jsxs("div",{className:"flex items-baseline gap-2 px-4 py-2.5 border-b border-neutral-9/40 bg-neutral-10/20",children:[h.jsx("span",{className:"text-[15px] font-semibold text-neutral-2",children:S}),h.jsx("span",{className:"text-[13px] text-neutral-6",children:n.length})]}),h.jsx("div",{className:"py-1 px-1",children:n.map(E=>h.jsx(YD,{repo:E,schedule:r.get(E.id),recentRuns:l.get(E.id)??[],selectedRunId:s,runDetail:o,detailLoading:u,onTrigger:f,onToggleEnabled:d,onEdit:p,onDelete:x,onToggleRun:g,onCancel:y,onNavigateToSession:v},E.id))})]})}function XD({run:e,onNavigateToSession:n}){const r=e.output?.sessionId||e.input?.sessionId;return h.jsxs("div",{className:"flex items-center gap-3 px-4 py-2 hover:bg-neutral-10/30 transition-colors rounded-md",children:[h.jsx(ap,{status:e.status}),h.jsx("span",{className:"text-[15px] font-medium text-neutral-2 min-w-0 truncate max-w-[140px]",children:OD(e)}),h.jsx("span",{className:"text-[14px] text-neutral-4",children:em(e.kind)}),h.jsx("span",{className:"text-[14px] text-neutral-5 tabular-nums ml-auto whitespace-nowrap",children:nm(e.createdAt)}),h.jsx("span",{className:"text-[14px] text-neutral-5 tabular-nums whitespace-nowrap",children:tm(e.startedAt,e.completedAt)}),h.jsx(rm,{status:e.status}),r&&n&&h.jsx("button",{onClick:()=>n(r),className:"rounded p-1 text-neutral-5 hover:text-accent-3 hover:bg-neutral-9 transition-colors shrink-0",title:"View session",children:h.jsx(P0,{size:13,stroke:2})})]})}function KD(){const[e,n]=w.useState(!1);return h.jsxs("div",{className:"workflow-card mt-6 rounded-lg border border-neutral-9/60 bg-neutral-10/30",children:[h.jsxs("button",{onClick:()=>n(!e),className:"w-full flex items-center gap-2 px-4 py-3 text-left text-[15px] font-medium text-neutral-3 hover:text-neutral-1 transition-colors",children:[e?h.jsx(Zr,{size:14,stroke:2,className:"text-neutral-5"}):h.jsx(va,{size:14,stroke:2,className:"text-neutral-5"}),"Defining Custom Workflows",h.jsx("span",{className:"text-[13px] text-neutral-5 font-normal ml-1",children:"via workflow.md files"})]}),e&&h.jsxs("div",{className:"px-4 pb-4 text-[14px] text-neutral-4 space-y-3 border-t border-neutral-9/40 pt-3",children:[h.jsxs("p",{children:["You can define custom workflow types per-repo by adding ",h.jsx("code",{className:"text-accent-3 bg-neutral-10 px-1 rounded",children:".md"})," files to:"]}),h.jsx("pre",{className:"rounded-md bg-neutral-12 px-3 py-2 text-[14px] text-neutral-3 font-mono overflow-x-auto",children:"<repo>/.codekin/workflows/<kind>.md"}),h.jsx("p",{children:"Each file uses YAML frontmatter + a prompt body:"}),h.jsx("pre",{className:"rounded-md bg-neutral-12 px-3 py-2 text-[14px] text-neutral-3 font-mono overflow-x-auto leading-relaxed",children:`---
|
|
115
|
+
kind: api-docs.weekly
|
|
116
|
+
name: API Documentation Check
|
|
117
|
+
sessionPrefix: api-docs
|
|
118
|
+
outputDir: .codekin/reports/api-docs
|
|
119
|
+
filenameSuffix: _api-docs.md
|
|
120
|
+
commitMessage: chore: api docs check
|
|
121
|
+
---
|
|
122
|
+
You are reviewing the API documentation for this project.
|
|
123
|
+
|
|
124
|
+
1. Find all REST endpoints and verify they have docs
|
|
125
|
+
2. Check for outdated examples or missing parameters
|
|
126
|
+
3. Produce a Markdown report
|
|
127
|
+
|
|
128
|
+
Important: Do NOT modify any source files.`}),h.jsxs("div",{className:"space-y-1.5 text-[14px]",children:[h.jsx("p",{className:"font-medium text-neutral-3",children:"Frontmatter fields:"}),h.jsxs("ul",{className:"list-disc list-inside space-y-0.5 text-neutral-4 ml-1",children:[h.jsxs("li",{children:[h.jsx("code",{className:"text-neutral-3",children:"kind"})," — unique ID, e.g. ",h.jsx("code",{className:"text-neutral-3",children:"code-review.daily"})]}),h.jsxs("li",{children:[h.jsx("code",{className:"text-neutral-3",children:"name"})," — display name shown in the UI"]}),h.jsxs("li",{children:[h.jsx("code",{className:"text-neutral-3",children:"sessionPrefix"})," — prefix for the session name"]}),h.jsxs("li",{children:[h.jsx("code",{className:"text-neutral-3",children:"outputDir"})," — where reports are saved in the repo"]}),h.jsxs("li",{children:[h.jsx("code",{className:"text-neutral-3",children:"filenameSuffix"})," — appended to the date for the report filename"]}),h.jsxs("li",{children:[h.jsx("code",{className:"text-neutral-3",children:"commitMessage"})," — git commit message prefix"]})]})]}),h.jsxs("p",{className:"text-neutral-5",children:["Custom workflows appear automatically when adding a new workflow for that repo. To override a built-in workflow","'","s prompt, use the same ",h.jsx("code",{className:"text-neutral-3",children:"kind"})," value."]})]})]})}function ZD({token:e,onNavigateToSession:n}){const{runs:r,schedules:l,config:s,error:o,cancelRun:u,triggerSchedule:f,addRepo:d,removeRepo:p,updateRepo:x,toggleScheduleEnabled:g}=CD(e),[y,v]=w.useState(null),[S,E]=w.useState(null),[T,N]=w.useState(!1),[j,C]=w.useState(null),[I,U]=w.useState(!1),_=y!==null&&(S===null||S.id!==y),z=new Map;if(s)for(const M of s.reviewRepos)z.set(M.id,M);const P=new Map;for(const M of l)P.set(M.id,M);const X=new Map;for(const M of r){const K=M.input.repoPath;if(!K)continue;const le=s?.reviewRepos.find(be=>be.repoPath===K&&be.kind===M.kind);if(le){const be=le.id;X.has(be)||X.set(be,[]),X.get(be).push(M)}}const B=new Set;for(const M of X.values())for(const K of M)B.add(K.id);w.useEffect(()=>{if(!y)return;let M=!1;return O1(e,y).then(K=>{M||E(K)}).catch(()=>{M||E(null)}),()=>{M=!0}},[y,e]),w.useEffect(()=>{!y||!S||(S.status==="running"||S.status==="queued")&&O1(e,y).then(E).catch(()=>{})},[r]);const q=w.useCallback(M=>{v(K=>K===M?null:M)},[]),Z=w.useCallback(async M=>{try{await p(M)}catch{}},[p]),ee=w.useCallback(async(M,K)=>{try{await g(M,K)}catch{}},[g]),ae=s?.reviewRepos??[],Y=new Map;for(const M of ae)Y.has(M.repoPath)||Y.set(M.repoPath,[]),Y.get(M.repoPath).push(M);return h.jsxs("div",{className:"flex h-full flex-col overflow-hidden",children:[h.jsxs("div",{className:"flex items-center justify-between border-b border-neutral-8/50 px-5 py-3",children:[h.jsx("h1",{className:"text-[18px] font-medium text-neutral-1",children:"Workflows"}),h.jsx("div",{className:"flex items-center gap-1.5",children:h.jsxs("button",{onClick:()=>N(!0),className:"flex items-center gap-1.5 rounded-md bg-primary-8 px-3 py-1.5 text-[15px] font-medium text-neutral-1 hover:bg-primary-7 transition-colors",children:[h.jsx(Qs,{size:14,stroke:2}),"New Workflow"]})})]}),h.jsxs("div",{className:"flex-1 overflow-y-auto p-5",children:[o&&h.jsx("div",{className:"rounded-lg border border-error-8/50 bg-error-10/30 px-4 py-2 text-[16px] text-error-4 mb-4",children:o}),ae.length===0?h.jsxs("div",{className:"rounded-xl border border-dashed border-neutral-8 px-6 py-10 text-center",children:[h.jsxs("div",{className:"text-neutral-5 mb-1",children:[h.jsx(uN,{size:32,stroke:1.5,className:"mx-auto mb-3 text-neutral-6"}),h.jsx("div",{className:"text-[16px] text-neutral-3 font-medium mb-1",children:"No workflows configured"}),h.jsx("div",{className:"text-[14px] text-neutral-5",children:"Set up automated code reviews, security audits, and more."})]}),h.jsxs("button",{onClick:()=>N(!0),className:"mt-4 inline-flex items-center gap-1.5 rounded-md bg-primary-8 px-4 py-2 text-[15px] font-medium text-neutral-1 hover:bg-primary-7 transition-colors",children:[h.jsx(Qs,{size:14,stroke:2}),"Create your first workflow"]})]}):h.jsx("div",{className:"space-y-3",children:Array.from(Y.entries()).map(([M,K])=>h.jsx(VD,{repoPath:M,workflows:K,scheduleMap:P,runsPerRepo:X,selectedRunId:y,runDetail:S,detailLoading:_,onTrigger:f,onToggleEnabled:ee,onEdit:C,onDelete:Z,onToggleRun:q,onCancel:u,onNavigateToSession:n},M))}),r.length>0&&h.jsxs("div",{className:"mt-6",children:[h.jsxs("button",{onClick:()=>U(!I),className:"flex items-center gap-2 text-[15px] font-medium text-neutral-3 hover:text-neutral-1 transition-colors mb-2",children:[I?h.jsx(Zr,{size:14,stroke:2}):h.jsx(U0,{size:14,stroke:2}),"Recent Activity",h.jsxs("span",{className:"text-[13px] text-neutral-5 font-normal",children:["(",r.length," runs)"]})]}),I&&h.jsx("div",{className:"workflow-card rounded-lg border border-neutral-9/60 bg-neutral-10/30 py-1 divide-y divide-neutral-9/30",children:r.slice(0,20).map(M=>h.jsx(XD,{run:M,onNavigateToSession:n},M.id))})]}),h.jsx(KD,{})]}),T&&h.jsx($D,{token:e,onClose:()=>N(!1),onAdd:d}),j&&h.jsx(HD,{repo:j,schedules:l.filter(M=>M.id===j.id),recentRuns:r.filter(M=>M.input.repoPath===j.repoPath||M.input.repoName===j.name),onClose:()=>C(null),onSave:x})]})}var B1=1,QD=.9,WD=.8,JD=.17,kh=.1,Sh=.999,e5=.9999,t5=.99,n5=/[\\\/_+.#"@\[\(\{&]/,r5=/[\\\/_+.#"@\[\(\{&]/g,a5=/[\s-]/,Uw=/[\s-]/g;function ip(e,n,r,l,s,o,u){if(o===n.length)return s===e.length?B1:t5;var f=`${s},${o}`;if(u[f]!==void 0)return u[f];for(var d=l.charAt(o),p=r.indexOf(d,s),x=0,g,y,v,S;p>=0;)g=ip(e,n,r,l,p+1,o+1,u),g>x&&(p===s?g*=B1:n5.test(e.charAt(p-1))?(g*=WD,v=e.slice(s,p-1).match(r5),v&&s>0&&(g*=Math.pow(Sh,v.length))):a5.test(e.charAt(p-1))?(g*=QD,S=e.slice(s,p-1).match(Uw),S&&s>0&&(g*=Math.pow(Sh,S.length))):(g*=JD,s>0&&(g*=Math.pow(Sh,p-s))),e.charAt(p)!==n.charAt(o)&&(g*=e5)),(g<kh&&r.charAt(p-1)===l.charAt(o+1)||l.charAt(o+1)===l.charAt(o)&&r.charAt(p-1)!==l.charAt(o))&&(y=ip(e,n,r,l,p+1,o+2,u),y*kh>g&&(g=y*kh)),g>x&&(x=g),p=r.indexOf(d,p+1);return u[f]=x,x}function I1(e){return e.toLowerCase().replace(Uw," ")}function l5(e,n,r){return e=r&&r.length>0?`${e+" "+r.join(" ")}`:e,ip(e,n,I1(e),I1(n),0,0,{})}function Ja(e,n,{checkForDefaultPrevented:r=!0}={}){return function(s){if(e?.(s),r===!1||!s.defaultPrevented)return n?.(s)}}function U1(e,n){if(typeof e=="function")return e(n);e!=null&&(e.current=n)}function tl(...e){return n=>{let r=!1;const l=e.map(s=>{const o=U1(s,n);return!r&&typeof o=="function"&&(r=!0),o});if(r)return()=>{for(let s=0;s<l.length;s++){const o=l[s];typeof o=="function"?o():U1(e[s],null)}}}}function Ol(...e){return w.useCallback(tl(...e),e)}function i5(e,n){const r=w.createContext(n),l=o=>{const{children:u,...f}=o,d=w.useMemo(()=>f,Object.values(f));return h.jsx(r.Provider,{value:d,children:u})};l.displayName=e+"Provider";function s(o){const u=w.useContext(r);if(u)return u;if(n!==void 0)return n;throw new Error(`\`${o}\` must be used within \`${e}\``)}return[l,s]}function s5(e,n=[]){let r=[];function l(o,u){const f=w.createContext(u),d=r.length;r=[...r,u];const p=g=>{const{scope:y,children:v,...S}=g,E=y?.[e]?.[d]||f,T=w.useMemo(()=>S,Object.values(S));return h.jsx(E.Provider,{value:T,children:v})};p.displayName=o+"Provider";function x(g,y){const v=y?.[e]?.[d]||f,S=w.useContext(v);if(S)return S;if(u!==void 0)return u;throw new Error(`\`${g}\` must be used within \`${o}\``)}return[p,x]}const s=()=>{const o=r.map(u=>w.createContext(u));return function(f){const d=f?.[e]||o;return w.useMemo(()=>({[`__scope${e}`]:{...f,[e]:d}}),[f,d])}};return s.scopeName=e,[l,o5(s,...n)]}function o5(...e){const n=e[0];if(e.length===1)return n;const r=()=>{const l=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(o){const u=l.reduce((f,{useScope:d,scopeName:p})=>{const g=d(o)[`__scope${p}`];return{...f,...g}},{});return w.useMemo(()=>({[`__scope${n.scopeName}`]:u}),[u])}};return r.scopeName=n.scopeName,r}var eo=globalThis?.document?w.useLayoutEffect:()=>{},u5=vp[" useId ".trim().toString()]||(()=>{}),c5=0;function ya(e){const[n,r]=w.useState(u5());return eo(()=>{r(l=>l??String(c5++))},[e]),n?`radix-${n}`:""}var f5=vp[" useInsertionEffect ".trim().toString()]||eo;function d5({prop:e,defaultProp:n,onChange:r=()=>{},caller:l}){const[s,o,u]=h5({defaultProp:n,onChange:r}),f=e!==void 0,d=f?e:s;{const x=w.useRef(e!==void 0);w.useEffect(()=>{const g=x.current;g!==f&&console.warn(`${l} is changing from ${g?"controlled":"uncontrolled"} to ${f?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),x.current=f},[f,l])}const p=w.useCallback(x=>{if(f){const g=p5(x)?x(e):x;g!==e&&u.current?.(g)}else o(x)},[f,e,o,u]);return[d,p]}function h5({defaultProp:e,onChange:n}){const[r,l]=w.useState(e),s=w.useRef(r),o=w.useRef(n);return f5(()=>{o.current=n},[n]),w.useEffect(()=>{s.current!==r&&(o.current?.(r),s.current=r)},[r,s]),[r,l,o]}function p5(e){return typeof e=="function"}var $w=A0();const m5=so($w);function po(e){const n=g5(e),r=w.forwardRef((l,s)=>{const{children:o,...u}=l,f=w.Children.toArray(o),d=f.find(b5);if(d){const p=d.props.children,x=f.map(g=>g===d?w.Children.count(p)>1?w.Children.only(null):w.isValidElement(p)?p.props.children:null:g);return h.jsx(n,{...u,ref:s,children:w.isValidElement(p)?w.cloneElement(p,void 0,x):null})}return h.jsx(n,{...u,ref:s,children:o})});return r.displayName=`${e}.Slot`,r}function g5(e){const n=w.forwardRef((r,l)=>{const{children:s,...o}=r;if(w.isValidElement(s)){const u=v5(s),f=y5(o,s.props);return s.type!==w.Fragment&&(f.ref=l?tl(l,u):u),w.cloneElement(s,f)}return w.Children.count(s)>1?w.Children.only(null):null});return n.displayName=`${e}.SlotClone`,n}var x5=Symbol("radix.slottable");function b5(e){return w.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===x5}function y5(e,n){const r={...n};for(const l in n){const s=e[l],o=n[l];/^on[A-Z]/.test(l)?s&&o?r[l]=(...f)=>{const d=o(...f);return s(...f),d}:s&&(r[l]=s):l==="style"?r[l]={...s,...o}:l==="className"&&(r[l]=[s,o].filter(Boolean).join(" "))}return{...e,...r}}function v5(e){let n=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=n&&"isReactWarning"in n&&n.isReactWarning;return r?e.ref:(n=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=n&&"isReactWarning"in n&&n.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var w5=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Hw=w5.reduce((e,n)=>{const r=po(`Primitive.${n}`),l=w.forwardRef((s,o)=>{const{asChild:u,...f}=s,d=u?r:n;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),h.jsx(d,{...f,ref:o})});return l.displayName=`Primitive.${n}`,{...e,[n]:l}},{});function k5(e,n){e&&$w.flushSync(()=>e.dispatchEvent(n))}function to(e){const n=w.useRef(e);return w.useEffect(()=>{n.current=e}),w.useMemo(()=>(...r)=>n.current?.(...r),[])}function S5(e,n=globalThis?.document){const r=to(e);w.useEffect(()=>{const l=s=>{s.key==="Escape"&&r(s)};return n.addEventListener("keydown",l,{capture:!0}),()=>n.removeEventListener("keydown",l,{capture:!0})},[r,n])}var E5="DismissableLayer",sp="dismissableLayer.update",N5="dismissableLayer.pointerDownOutside",_5="dismissableLayer.focusOutside",$1,Pw=w.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Fw=w.forwardRef((e,n)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:l,onPointerDownOutside:s,onFocusOutside:o,onInteractOutside:u,onDismiss:f,...d}=e,p=w.useContext(Pw),[x,g]=w.useState(null),y=x?.ownerDocument??globalThis?.document,[,v]=w.useState({}),S=Ol(n,z=>g(z)),E=Array.from(p.layers),[T]=[...p.layersWithOutsidePointerEventsDisabled].slice(-1),N=E.indexOf(T),j=x?E.indexOf(x):-1,C=p.layersWithOutsidePointerEventsDisabled.size>0,I=j>=N,U=C5(z=>{const P=z.target,X=[...p.branches].some(B=>B.contains(P));!I||X||(s?.(z),u?.(z),z.defaultPrevented||f?.())},y),_=R5(z=>{const P=z.target;[...p.branches].some(B=>B.contains(P))||(o?.(z),u?.(z),z.defaultPrevented||f?.())},y);return S5(z=>{j===p.layers.size-1&&(l?.(z),!z.defaultPrevented&&f&&(z.preventDefault(),f()))},y),w.useEffect(()=>{if(x)return r&&(p.layersWithOutsidePointerEventsDisabled.size===0&&($1=y.body.style.pointerEvents,y.body.style.pointerEvents="none"),p.layersWithOutsidePointerEventsDisabled.add(x)),p.layers.add(x),H1(),()=>{r&&p.layersWithOutsidePointerEventsDisabled.size===1&&(y.body.style.pointerEvents=$1)}},[x,y,r,p]),w.useEffect(()=>()=>{x&&(p.layers.delete(x),p.layersWithOutsidePointerEventsDisabled.delete(x),H1())},[x,p]),w.useEffect(()=>{const z=()=>v({});return document.addEventListener(sp,z),()=>document.removeEventListener(sp,z)},[]),h.jsx(Hw.div,{...d,ref:S,style:{pointerEvents:C?I?"auto":"none":void 0,...e.style},onFocusCapture:Ja(e.onFocusCapture,_.onFocusCapture),onBlurCapture:Ja(e.onBlurCapture,_.onBlurCapture),onPointerDownCapture:Ja(e.onPointerDownCapture,U.onPointerDownCapture)})});Fw.displayName=E5;var T5="DismissableLayerBranch",A5=w.forwardRef((e,n)=>{const r=w.useContext(Pw),l=w.useRef(null),s=Ol(n,l);return w.useEffect(()=>{const o=l.current;if(o)return r.branches.add(o),()=>{r.branches.delete(o)}},[r.branches]),h.jsx(Hw.div,{...e,ref:s})});A5.displayName=T5;function C5(e,n=globalThis?.document){const r=to(e),l=w.useRef(!1),s=w.useRef(()=>{});return w.useEffect(()=>{const o=f=>{if(f.target&&!l.current){let d=function(){Gw(N5,r,p,{discrete:!0})};const p={originalEvent:f};f.pointerType==="touch"?(n.removeEventListener("click",s.current),s.current=d,n.addEventListener("click",s.current,{once:!0})):d()}else n.removeEventListener("click",s.current);l.current=!1},u=window.setTimeout(()=>{n.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(u),n.removeEventListener("pointerdown",o),n.removeEventListener("click",s.current)}},[n,r]),{onPointerDownCapture:()=>l.current=!0}}function R5(e,n=globalThis?.document){const r=to(e),l=w.useRef(!1);return w.useEffect(()=>{const s=o=>{o.target&&!l.current&&Gw(_5,r,{originalEvent:o},{discrete:!1})};return n.addEventListener("focusin",s),()=>n.removeEventListener("focusin",s)},[n,r]),{onFocusCapture:()=>l.current=!0,onBlurCapture:()=>l.current=!1}}function H1(){const e=new CustomEvent(sp);document.dispatchEvent(e)}function Gw(e,n,r,{discrete:l}){const s=r.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});n&&s.addEventListener(e,n,{once:!0}),l?k5(s,o):s.dispatchEvent(o)}var j5=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],M5=j5.reduce((e,n)=>{const r=po(`Primitive.${n}`),l=w.forwardRef((s,o)=>{const{asChild:u,...f}=s,d=u?r:n;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),h.jsx(d,{...f,ref:o})});return l.displayName=`Primitive.${n}`,{...e,[n]:l}},{}),Eh="focusScope.autoFocusOnMount",Nh="focusScope.autoFocusOnUnmount",P1={bubbles:!1,cancelable:!0},O5="FocusScope",qw=w.forwardRef((e,n)=>{const{loop:r=!1,trapped:l=!1,onMountAutoFocus:s,onUnmountAutoFocus:o,...u}=e,[f,d]=w.useState(null),p=to(s),x=to(o),g=w.useRef(null),y=Ol(n,E=>d(E)),v=w.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;w.useEffect(()=>{if(l){let E=function(C){if(v.paused||!f)return;const I=C.target;f.contains(I)?g.current=I:Wa(g.current,{select:!0})},T=function(C){if(v.paused||!f)return;const I=C.relatedTarget;I!==null&&(f.contains(I)||Wa(g.current,{select:!0}))},N=function(C){if(document.activeElement===document.body)for(const U of C)U.removedNodes.length>0&&Wa(f)};document.addEventListener("focusin",E),document.addEventListener("focusout",T);const j=new MutationObserver(N);return f&&j.observe(f,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",E),document.removeEventListener("focusout",T),j.disconnect()}}},[l,f,v.paused]),w.useEffect(()=>{if(f){G1.add(v);const E=document.activeElement;if(!f.contains(E)){const N=new CustomEvent(Eh,P1);f.addEventListener(Eh,p),f.dispatchEvent(N),N.defaultPrevented||(D5(U5(Yw(f)),{select:!0}),document.activeElement===E&&Wa(f))}return()=>{f.removeEventListener(Eh,p),setTimeout(()=>{const N=new CustomEvent(Nh,P1);f.addEventListener(Nh,x),f.dispatchEvent(N),N.defaultPrevented||Wa(E??document.body,{select:!0}),f.removeEventListener(Nh,x),G1.remove(v)},0)}}},[f,p,x,v]);const S=w.useCallback(E=>{if(!r&&!l||v.paused)return;const T=E.key==="Tab"&&!E.altKey&&!E.ctrlKey&&!E.metaKey,N=document.activeElement;if(T&&N){const j=E.currentTarget,[C,I]=z5(j);C&&I?!E.shiftKey&&N===I?(E.preventDefault(),r&&Wa(C,{select:!0})):E.shiftKey&&N===C&&(E.preventDefault(),r&&Wa(I,{select:!0})):N===j&&E.preventDefault()}},[r,l,v.paused]);return h.jsx(M5.div,{tabIndex:-1,...u,ref:y,onKeyDown:S})});qw.displayName=O5;function D5(e,{select:n=!1}={}){const r=document.activeElement;for(const l of e)if(Wa(l,{select:n}),document.activeElement!==r)return}function z5(e){const n=Yw(e),r=F1(n,e),l=F1(n.reverse(),e);return[r,l]}function Yw(e){const n=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:l=>{const s=l.tagName==="INPUT"&&l.type==="hidden";return l.disabled||l.hidden||s?NodeFilter.FILTER_SKIP:l.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)n.push(r.currentNode);return n}function F1(e,n){for(const r of e)if(!L5(r,{upTo:n}))return r}function L5(e,{upTo:n}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(n!==void 0&&e===n)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function B5(e){return e instanceof HTMLInputElement&&"select"in e}function Wa(e,{select:n=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&B5(e)&&n&&e.select()}}var G1=I5();function I5(){let e=[];return{add(n){const r=e[0];n!==r&&r?.pause(),e=q1(e,n),e.unshift(n)},remove(n){e=q1(e,n),e[0]?.resume()}}}function q1(e,n){const r=[...e],l=r.indexOf(n);return l!==-1&&r.splice(l,1),r}function U5(e){return e.filter(n=>n.tagName!=="A")}var $5=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],H5=$5.reduce((e,n)=>{const r=po(`Primitive.${n}`),l=w.forwardRef((s,o)=>{const{asChild:u,...f}=s,d=u?r:n;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),h.jsx(d,{...f,ref:o})});return l.displayName=`Primitive.${n}`,{...e,[n]:l}},{}),P5="Portal",Vw=w.forwardRef((e,n)=>{const{container:r,...l}=e,[s,o]=w.useState(!1);eo(()=>o(!0),[]);const u=r||s&&globalThis?.document?.body;return u?m5.createPortal(h.jsx(H5.div,{...l,ref:n}),u):null});Vw.displayName=P5;function F5(e,n){return w.useReducer((r,l)=>n[r][l]??r,e)}var Tc=e=>{const{present:n,children:r}=e,l=G5(n),s=typeof r=="function"?r({present:l.isPresent}):w.Children.only(r),o=Ol(l.ref,q5(s));return typeof r=="function"||l.isPresent?w.cloneElement(s,{ref:o}):null};Tc.displayName="Presence";function G5(e){const[n,r]=w.useState(),l=w.useRef(null),s=w.useRef(e),o=w.useRef("none"),u=e?"mounted":"unmounted",[f,d]=F5(u,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return w.useEffect(()=>{const p=Iu(l.current);o.current=f==="mounted"?p:"none"},[f]),eo(()=>{const p=l.current,x=s.current;if(x!==e){const y=o.current,v=Iu(p);e?d("MOUNT"):v==="none"||p?.display==="none"?d("UNMOUNT"):d(x&&y!==v?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,d]),eo(()=>{if(n){let p;const x=n.ownerDocument.defaultView??window,g=v=>{const E=Iu(l.current).includes(CSS.escape(v.animationName));if(v.target===n&&E&&(d("ANIMATION_END"),!s.current)){const T=n.style.animationFillMode;n.style.animationFillMode="forwards",p=x.setTimeout(()=>{n.style.animationFillMode==="forwards"&&(n.style.animationFillMode=T)})}},y=v=>{v.target===n&&(o.current=Iu(l.current))};return n.addEventListener("animationstart",y),n.addEventListener("animationcancel",g),n.addEventListener("animationend",g),()=>{x.clearTimeout(p),n.removeEventListener("animationstart",y),n.removeEventListener("animationcancel",g),n.removeEventListener("animationend",g)}}else d("ANIMATION_END")},[n,d]),{isPresent:["mounted","unmountSuspended"].includes(f),ref:w.useCallback(p=>{l.current=p?getComputedStyle(p):null,r(p)},[])}}function Iu(e){return e?.animationName||"none"}function q5(e){let n=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=n&&"isReactWarning"in n&&n.isReactWarning;return r?e.ref:(n=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=n&&"isReactWarning"in n&&n.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var Y5=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],mo=Y5.reduce((e,n)=>{const r=po(`Primitive.${n}`),l=w.forwardRef((s,o)=>{const{asChild:u,...f}=s,d=u?r:n;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),h.jsx(d,{...f,ref:o})});return l.displayName=`Primitive.${n}`,{...e,[n]:l}},{}),_h=0;function V5(){w.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Y1()),document.body.insertAdjacentElement("beforeend",e[1]??Y1()),_h++,()=>{_h===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(n=>n.remove()),_h--}},[])}function Y1(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Kr=function(){return Kr=Object.assign||function(n){for(var r,l=1,s=arguments.length;l<s;l++){r=arguments[l];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[o]=r[o])}return n},Kr.apply(this,arguments)};function Xw(e,n){var r={};for(var l in e)Object.prototype.hasOwnProperty.call(e,l)&&n.indexOf(l)<0&&(r[l]=e[l]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,l=Object.getOwnPropertySymbols(e);s<l.length;s++)n.indexOf(l[s])<0&&Object.prototype.propertyIsEnumerable.call(e,l[s])&&(r[l[s]]=e[l[s]]);return r}function X5(e,n,r){if(r||arguments.length===2)for(var l=0,s=n.length,o;l<s;l++)(o||!(l in n))&&(o||(o=Array.prototype.slice.call(n,0,l)),o[l]=n[l]);return e.concat(o||Array.prototype.slice.call(n))}var Zu="right-scroll-bar-position",Qu="width-before-scroll-bar",K5="with-scroll-bars-hidden",Z5="--removed-body-scroll-bar-size";function Th(e,n){return typeof e=="function"?e(n):e&&(e.current=n),e}function Q5(e,n){var r=w.useState(function(){return{value:e,callback:n,facade:{get current(){return r.value},set current(l){var s=r.value;s!==l&&(r.value=l,r.callback(l,s))}}}})[0];return r.callback=n,r.facade}var W5=typeof window<"u"?w.useLayoutEffect:w.useEffect,V1=new WeakMap;function J5(e,n){var r=Q5(null,function(l){return e.forEach(function(s){return Th(s,l)})});return W5(function(){var l=V1.get(r);if(l){var s=new Set(l),o=new Set(e),u=r.current;s.forEach(function(f){o.has(f)||Th(f,null)}),o.forEach(function(f){s.has(f)||Th(f,u)})}V1.set(r,e)},[e]),r}function e4(e){return e}function t4(e,n){n===void 0&&(n=e4);var r=[],l=!1,s={read:function(){if(l)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(o){var u=n(o,l);return r.push(u),function(){r=r.filter(function(f){return f!==u})}},assignSyncMedium:function(o){for(l=!0;r.length;){var u=r;r=[],u.forEach(o)}r={push:function(f){return o(f)},filter:function(){return r}}},assignMedium:function(o){l=!0;var u=[];if(r.length){var f=r;r=[],f.forEach(o),u=r}var d=function(){var x=u;u=[],x.forEach(o)},p=function(){return Promise.resolve().then(d)};p(),r={push:function(x){u.push(x),p()},filter:function(x){return u=u.filter(x),r}}}};return s}function n4(e){e===void 0&&(e={});var n=t4(null);return n.options=Kr({async:!0,ssr:!1},e),n}var Kw=function(e){var n=e.sideCar,r=Xw(e,["sideCar"]);if(!n)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var l=n.read();if(!l)throw new Error("Sidecar medium not found");return w.createElement(l,Kr({},r))};Kw.isSideCarExport=!0;function r4(e,n){return e.useMedium(n),Kw}var Zw=n4(),Ah=function(){},Ac=w.forwardRef(function(e,n){var r=w.useRef(null),l=w.useState({onScrollCapture:Ah,onWheelCapture:Ah,onTouchMoveCapture:Ah}),s=l[0],o=l[1],u=e.forwardProps,f=e.children,d=e.className,p=e.removeScrollBar,x=e.enabled,g=e.shards,y=e.sideCar,v=e.noRelative,S=e.noIsolation,E=e.inert,T=e.allowPinchZoom,N=e.as,j=N===void 0?"div":N,C=e.gapMode,I=Xw(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),U=y,_=J5([r,n]),z=Kr(Kr({},I),s);return w.createElement(w.Fragment,null,x&&w.createElement(U,{sideCar:Zw,removeScrollBar:p,shards:g,noRelative:v,noIsolation:S,inert:E,setCallbacks:o,allowPinchZoom:!!T,lockRef:r,gapMode:C}),u?w.cloneElement(w.Children.only(f),Kr(Kr({},z),{ref:_})):w.createElement(j,Kr({},z,{className:d,ref:_}),f))});Ac.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Ac.classNames={fullWidth:Qu,zeroRight:Zu};var a4=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function l4(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var n=a4();return n&&e.setAttribute("nonce",n),e}function i4(e,n){e.styleSheet?e.styleSheet.cssText=n:e.appendChild(document.createTextNode(n))}function s4(e){var n=document.head||document.getElementsByTagName("head")[0];n.appendChild(e)}var o4=function(){var e=0,n=null;return{add:function(r){e==0&&(n=l4())&&(i4(n,r),s4(n)),e++},remove:function(){e--,!e&&n&&(n.parentNode&&n.parentNode.removeChild(n),n=null)}}},u4=function(){var e=o4();return function(n,r){w.useEffect(function(){return e.add(n),function(){e.remove()}},[n&&r])}},Qw=function(){var e=u4(),n=function(r){var l=r.styles,s=r.dynamic;return e(l,s),null};return n},c4={left:0,top:0,right:0,gap:0},Ch=function(e){return parseInt(e||"",10)||0},f4=function(e){var n=window.getComputedStyle(document.body),r=n[e==="padding"?"paddingLeft":"marginLeft"],l=n[e==="padding"?"paddingTop":"marginTop"],s=n[e==="padding"?"paddingRight":"marginRight"];return[Ch(r),Ch(l),Ch(s)]},d4=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return c4;var n=f4(e),r=document.documentElement.clientWidth,l=window.innerWidth;return{left:n[0],top:n[1],right:n[2],gap:Math.max(0,l-r+n[2]-n[0])}},h4=Qw(),Ci="data-scroll-locked",p4=function(e,n,r,l){var s=e.left,o=e.top,u=e.right,f=e.gap;return r===void 0&&(r="margin"),`
|
|
129
|
+
.`.concat(K5,` {
|
|
130
|
+
overflow: hidden `).concat(l,`;
|
|
131
|
+
padding-right: `).concat(f,"px ").concat(l,`;
|
|
132
|
+
}
|
|
133
|
+
body[`).concat(Ci,`] {
|
|
134
|
+
overflow: hidden `).concat(l,`;
|
|
135
|
+
overscroll-behavior: contain;
|
|
136
|
+
`).concat([n&&"position: relative ".concat(l,";"),r==="margin"&&`
|
|
137
|
+
padding-left: `.concat(s,`px;
|
|
138
|
+
padding-top: `).concat(o,`px;
|
|
139
|
+
padding-right: `).concat(u,`px;
|
|
140
|
+
margin-left:0;
|
|
141
|
+
margin-top:0;
|
|
142
|
+
margin-right: `).concat(f,"px ").concat(l,`;
|
|
143
|
+
`),r==="padding"&&"padding-right: ".concat(f,"px ").concat(l,";")].filter(Boolean).join(""),`
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.`).concat(Zu,` {
|
|
147
|
+
right: `).concat(f,"px ").concat(l,`;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.`).concat(Qu,` {
|
|
151
|
+
margin-right: `).concat(f,"px ").concat(l,`;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
.`).concat(Zu," .").concat(Zu,` {
|
|
155
|
+
right: 0 `).concat(l,`;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
.`).concat(Qu," .").concat(Qu,` {
|
|
159
|
+
margin-right: 0 `).concat(l,`;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
body[`).concat(Ci,`] {
|
|
163
|
+
`).concat(Z5,": ").concat(f,`px;
|
|
164
|
+
}
|
|
165
|
+
`)},X1=function(){var e=parseInt(document.body.getAttribute(Ci)||"0",10);return isFinite(e)?e:0},m4=function(){w.useEffect(function(){return document.body.setAttribute(Ci,(X1()+1).toString()),function(){var e=X1()-1;e<=0?document.body.removeAttribute(Ci):document.body.setAttribute(Ci,e.toString())}},[])},g4=function(e){var n=e.noRelative,r=e.noImportant,l=e.gapMode,s=l===void 0?"margin":l;m4();var o=w.useMemo(function(){return d4(s)},[s]);return w.createElement(h4,{styles:p4(o,!n,s,r?"":"!important")})},op=!1;if(typeof window<"u")try{var Uu=Object.defineProperty({},"passive",{get:function(){return op=!0,!0}});window.addEventListener("test",Uu,Uu),window.removeEventListener("test",Uu,Uu)}catch{op=!1}var bi=op?{passive:!1}:!1,x4=function(e){return e.tagName==="TEXTAREA"},Ww=function(e,n){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[n]!=="hidden"&&!(r.overflowY===r.overflowX&&!x4(e)&&r[n]==="visible")},b4=function(e){return Ww(e,"overflowY")},y4=function(e){return Ww(e,"overflowX")},K1=function(e,n){var r=n.ownerDocument,l=n;do{typeof ShadowRoot<"u"&&l instanceof ShadowRoot&&(l=l.host);var s=Jw(e,l);if(s){var o=ek(e,l),u=o[1],f=o[2];if(u>f)return!0}l=l.parentNode}while(l&&l!==r.body);return!1},v4=function(e){var n=e.scrollTop,r=e.scrollHeight,l=e.clientHeight;return[n,r,l]},w4=function(e){var n=e.scrollLeft,r=e.scrollWidth,l=e.clientWidth;return[n,r,l]},Jw=function(e,n){return e==="v"?b4(n):y4(n)},ek=function(e,n){return e==="v"?v4(n):w4(n)},k4=function(e,n){return e==="h"&&n==="rtl"?-1:1},S4=function(e,n,r,l,s){var o=k4(e,window.getComputedStyle(n).direction),u=o*l,f=r.target,d=n.contains(f),p=!1,x=u>0,g=0,y=0;do{if(!f)break;var v=ek(e,f),S=v[0],E=v[1],T=v[2],N=E-T-o*S;(S||N)&&Jw(e,f)&&(g+=N,y+=S);var j=f.parentNode;f=j&&j.nodeType===Node.DOCUMENT_FRAGMENT_NODE?j.host:j}while(!d&&f!==document.body||d&&(n.contains(f)||n===f));return(x&&Math.abs(g)<1||!x&&Math.abs(y)<1)&&(p=!0),p},$u=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Z1=function(e){return[e.deltaX,e.deltaY]},Q1=function(e){return e&&"current"in e?e.current:e},E4=function(e,n){return e[0]===n[0]&&e[1]===n[1]},N4=function(e){return`
|
|
166
|
+
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
167
|
+
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
168
|
+
`)},_4=0,yi=[];function T4(e){var n=w.useRef([]),r=w.useRef([0,0]),l=w.useRef(),s=w.useState(_4++)[0],o=w.useState(Qw)[0],u=w.useRef(e);w.useEffect(function(){u.current=e},[e]),w.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var E=X5([e.lockRef.current],(e.shards||[]).map(Q1),!0).filter(Boolean);return E.forEach(function(T){return T.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),E.forEach(function(T){return T.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var f=w.useCallback(function(E,T){if("touches"in E&&E.touches.length===2||E.type==="wheel"&&E.ctrlKey)return!u.current.allowPinchZoom;var N=$u(E),j=r.current,C="deltaX"in E?E.deltaX:j[0]-N[0],I="deltaY"in E?E.deltaY:j[1]-N[1],U,_=E.target,z=Math.abs(C)>Math.abs(I)?"h":"v";if("touches"in E&&z==="h"&&_.type==="range")return!1;var P=window.getSelection(),X=P&&P.anchorNode,B=X?X===_||X.contains(_):!1;if(B)return!1;var q=K1(z,_);if(!q)return!0;if(q?U=z:(U=z==="v"?"h":"v",q=K1(z,_)),!q)return!1;if(!l.current&&"changedTouches"in E&&(C||I)&&(l.current=U),!U)return!0;var Z=l.current||U;return S4(Z,T,E,Z==="h"?C:I)},[]),d=w.useCallback(function(E){var T=E;if(!(!yi.length||yi[yi.length-1]!==o)){var N="deltaY"in T?Z1(T):$u(T),j=n.current.filter(function(U){return U.name===T.type&&(U.target===T.target||T.target===U.shadowParent)&&E4(U.delta,N)})[0];if(j&&j.should){T.cancelable&&T.preventDefault();return}if(!j){var C=(u.current.shards||[]).map(Q1).filter(Boolean).filter(function(U){return U.contains(T.target)}),I=C.length>0?f(T,C[0]):!u.current.noIsolation;I&&T.cancelable&&T.preventDefault()}}},[]),p=w.useCallback(function(E,T,N,j){var C={name:E,delta:T,target:N,should:j,shadowParent:A4(N)};n.current.push(C),setTimeout(function(){n.current=n.current.filter(function(I){return I!==C})},1)},[]),x=w.useCallback(function(E){r.current=$u(E),l.current=void 0},[]),g=w.useCallback(function(E){p(E.type,Z1(E),E.target,f(E,e.lockRef.current))},[]),y=w.useCallback(function(E){p(E.type,$u(E),E.target,f(E,e.lockRef.current))},[]);w.useEffect(function(){return yi.push(o),e.setCallbacks({onScrollCapture:g,onWheelCapture:g,onTouchMoveCapture:y}),document.addEventListener("wheel",d,bi),document.addEventListener("touchmove",d,bi),document.addEventListener("touchstart",x,bi),function(){yi=yi.filter(function(E){return E!==o}),document.removeEventListener("wheel",d,bi),document.removeEventListener("touchmove",d,bi),document.removeEventListener("touchstart",x,bi)}},[]);var v=e.removeScrollBar,S=e.inert;return w.createElement(w.Fragment,null,S?w.createElement(o,{styles:N4(s)}):null,v?w.createElement(g4,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function A4(e){for(var n=null;e!==null;)e instanceof ShadowRoot&&(n=e.host,e=e.host),e=e.parentNode;return n}const C4=r4(Zw,T4);var tk=w.forwardRef(function(e,n){return w.createElement(Ac,Kr({},e,{ref:n,sideCar:C4}))});tk.classNames=Ac.classNames;var R4=function(e){if(typeof document>"u")return null;var n=Array.isArray(e)?e[0]:e;return n.ownerDocument.body},vi=new WeakMap,Hu=new WeakMap,Pu={},Rh=0,nk=function(e){return e&&(e.host||nk(e.parentNode))},j4=function(e,n){return n.map(function(r){if(e.contains(r))return r;var l=nk(r);return l&&e.contains(l)?l:(console.error("aria-hidden",r,"in not contained inside",e,". Doing nothing"),null)}).filter(function(r){return!!r})},M4=function(e,n,r,l){var s=j4(n,Array.isArray(e)?e:[e]);Pu[r]||(Pu[r]=new WeakMap);var o=Pu[r],u=[],f=new Set,d=new Set(s),p=function(g){!g||f.has(g)||(f.add(g),p(g.parentNode))};s.forEach(p);var x=function(g){!g||d.has(g)||Array.prototype.forEach.call(g.children,function(y){if(f.has(y))x(y);else try{var v=y.getAttribute(l),S=v!==null&&v!=="false",E=(vi.get(y)||0)+1,T=(o.get(y)||0)+1;vi.set(y,E),o.set(y,T),u.push(y),E===1&&S&&Hu.set(y,!0),T===1&&y.setAttribute(r,"true"),S||y.setAttribute(l,"true")}catch(N){console.error("aria-hidden: cannot operate on ",y,N)}})};return x(n),f.clear(),Rh++,function(){u.forEach(function(g){var y=vi.get(g)-1,v=o.get(g)-1;vi.set(g,y),o.set(g,v),y||(Hu.has(g)||g.removeAttribute(l),Hu.delete(g)),v||g.removeAttribute(r)}),Rh--,Rh||(vi=new WeakMap,vi=new WeakMap,Hu=new WeakMap,Pu={})}},O4=function(e,n,r){r===void 0&&(r="data-aria-hidden");var l=Array.from(Array.isArray(e)?e:[e]),s=R4(e);return s?(l.push.apply(l,Array.from(s.querySelectorAll("[aria-live], script"))),M4(l,s,r,"aria-hidden")):function(){return null}},Cc="Dialog",[rk]=s5(Cc),[D4,$r]=rk(Cc),ak=e=>{const{__scopeDialog:n,children:r,open:l,defaultOpen:s,onOpenChange:o,modal:u=!0}=e,f=w.useRef(null),d=w.useRef(null),[p,x]=d5({prop:l,defaultProp:s??!1,onChange:o,caller:Cc});return h.jsx(D4,{scope:n,triggerRef:f,contentRef:d,contentId:ya(),titleId:ya(),descriptionId:ya(),open:p,onOpenChange:x,onOpenToggle:w.useCallback(()=>x(g=>!g),[x]),modal:u,children:r})};ak.displayName=Cc;var lk="DialogTrigger",z4=w.forwardRef((e,n)=>{const{__scopeDialog:r,...l}=e,s=$r(lk,r),o=Ol(n,s.triggerRef);return h.jsx(mo.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":im(s.open),...l,ref:o,onClick:Ja(e.onClick,s.onOpenToggle)})});z4.displayName=lk;var am="DialogPortal",[L4,ik]=rk(am,{forceMount:void 0}),sk=e=>{const{__scopeDialog:n,forceMount:r,children:l,container:s}=e,o=$r(am,n);return h.jsx(L4,{scope:n,forceMount:r,children:w.Children.map(l,u=>h.jsx(Tc,{present:r||o.open,children:h.jsx(Vw,{asChild:!0,container:s,children:u})}))})};sk.displayName=am;var hc="DialogOverlay",ok=w.forwardRef((e,n)=>{const r=ik(hc,e.__scopeDialog),{forceMount:l=r.forceMount,...s}=e,o=$r(hc,e.__scopeDialog);return o.modal?h.jsx(Tc,{present:l||o.open,children:h.jsx(I4,{...s,ref:n})}):null});ok.displayName=hc;var B4=po("DialogOverlay.RemoveScroll"),I4=w.forwardRef((e,n)=>{const{__scopeDialog:r,...l}=e,s=$r(hc,r);return h.jsx(tk,{as:B4,allowPinchZoom:!0,shards:[s.contentRef],children:h.jsx(mo.div,{"data-state":im(s.open),...l,ref:n,style:{pointerEvents:"auto",...l.style}})})}),Cl="DialogContent",uk=w.forwardRef((e,n)=>{const r=ik(Cl,e.__scopeDialog),{forceMount:l=r.forceMount,...s}=e,o=$r(Cl,e.__scopeDialog);return h.jsx(Tc,{present:l||o.open,children:o.modal?h.jsx(U4,{...s,ref:n}):h.jsx($4,{...s,ref:n})})});uk.displayName=Cl;var U4=w.forwardRef((e,n)=>{const r=$r(Cl,e.__scopeDialog),l=w.useRef(null),s=Ol(n,r.contentRef,l);return w.useEffect(()=>{const o=l.current;if(o)return O4(o)},[]),h.jsx(ck,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ja(e.onCloseAutoFocus,o=>{o.preventDefault(),r.triggerRef.current?.focus()}),onPointerDownOutside:Ja(e.onPointerDownOutside,o=>{const u=o.detail.originalEvent,f=u.button===0&&u.ctrlKey===!0;(u.button===2||f)&&o.preventDefault()}),onFocusOutside:Ja(e.onFocusOutside,o=>o.preventDefault())})}),$4=w.forwardRef((e,n)=>{const r=$r(Cl,e.__scopeDialog),l=w.useRef(!1),s=w.useRef(!1);return h.jsx(ck,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{e.onCloseAutoFocus?.(o),o.defaultPrevented||(l.current||r.triggerRef.current?.focus(),o.preventDefault()),l.current=!1,s.current=!1},onInteractOutside:o=>{e.onInteractOutside?.(o),o.defaultPrevented||(l.current=!0,o.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const u=o.target;r.triggerRef.current?.contains(u)&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&s.current&&o.preventDefault()}})}),ck=w.forwardRef((e,n)=>{const{__scopeDialog:r,trapFocus:l,onOpenAutoFocus:s,onCloseAutoFocus:o,...u}=e,f=$r(Cl,r),d=w.useRef(null),p=Ol(n,d);return V5(),h.jsxs(h.Fragment,{children:[h.jsx(qw,{asChild:!0,loop:!0,trapped:l,onMountAutoFocus:s,onUnmountAutoFocus:o,children:h.jsx(Fw,{role:"dialog",id:f.contentId,"aria-describedby":f.descriptionId,"aria-labelledby":f.titleId,"data-state":im(f.open),...u,ref:p,onDismiss:()=>f.onOpenChange(!1)})}),h.jsxs(h.Fragment,{children:[h.jsx(G4,{titleId:f.titleId}),h.jsx(Y4,{contentRef:d,descriptionId:f.descriptionId})]})]})}),lm="DialogTitle",H4=w.forwardRef((e,n)=>{const{__scopeDialog:r,...l}=e,s=$r(lm,r);return h.jsx(mo.h2,{id:s.titleId,...l,ref:n})});H4.displayName=lm;var fk="DialogDescription",P4=w.forwardRef((e,n)=>{const{__scopeDialog:r,...l}=e,s=$r(fk,r);return h.jsx(mo.p,{id:s.descriptionId,...l,ref:n})});P4.displayName=fk;var dk="DialogClose",F4=w.forwardRef((e,n)=>{const{__scopeDialog:r,...l}=e,s=$r(dk,r);return h.jsx(mo.button,{type:"button",...l,ref:n,onClick:Ja(e.onClick,()=>s.onOpenChange(!1))})});F4.displayName=dk;function im(e){return e?"open":"closed"}var hk="DialogTitleWarning",[m9,pk]=i5(hk,{contentName:Cl,titleName:lm,docsSlug:"dialog"}),G4=({titleId:e})=>{const n=pk(hk),r=`\`${n.contentName}\` requires a \`${n.titleName}\` for the component to be accessible for screen reader users.
|
|
169
|
+
|
|
170
|
+
If you want to hide the \`${n.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
171
|
+
|
|
172
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${n.docsSlug}`;return w.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},q4="DialogDescriptionWarning",Y4=({contentRef:e,descriptionId:n})=>{const l=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${pk(q4).contentName}}.`;return w.useEffect(()=>{const s=e.current?.getAttribute("aria-describedby");n&&s&&(document.getElementById(n)||console.warn(l))},[l,e,n]),null},V4=ak,X4=sk,K4=ok,Z4=uk,Q4=Symbol.for("react.lazy"),pc=vp[" use ".trim().toString()];function W4(e){return typeof e=="object"&&e!==null&&"then"in e}function mk(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===Q4&&"_payload"in e&&W4(e._payload)}function J4(e){const n=ez(e),r=w.forwardRef((l,s)=>{let{children:o,...u}=l;mk(o)&&typeof pc=="function"&&(o=pc(o._payload));const f=w.Children.toArray(o),d=f.find(nz);if(d){const p=d.props.children,x=f.map(g=>g===d?w.Children.count(p)>1?w.Children.only(null):w.isValidElement(p)?p.props.children:null:g);return h.jsx(n,{...u,ref:s,children:w.isValidElement(p)?w.cloneElement(p,void 0,x):null})}return h.jsx(n,{...u,ref:s,children:o})});return r.displayName=`${e}.Slot`,r}function ez(e){const n=w.forwardRef((r,l)=>{let{children:s,...o}=r;if(mk(s)&&typeof pc=="function"&&(s=pc(s._payload)),w.isValidElement(s)){const u=az(s),f=rz(o,s.props);return s.type!==w.Fragment&&(f.ref=l?tl(l,u):u),w.cloneElement(s,f)}return w.Children.count(s)>1?w.Children.only(null):null});return n.displayName=`${e}.SlotClone`,n}var tz=Symbol("radix.slottable");function nz(e){return w.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===tz}function rz(e,n){const r={...n};for(const l in n){const s=e[l],o=n[l];/^on[A-Z]/.test(l)?s&&o?r[l]=(...f)=>{const d=o(...f);return s(...f),d}:s&&(r[l]=s):l==="style"?r[l]={...s,...o}:l==="className"&&(r[l]=[s,o].filter(Boolean).join(" "))}return{...e,...r}}function az(e){let n=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=n&&"isReactWarning"in n&&n.isReactWarning;return r?e.ref:(n=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=n&&"isReactWarning"in n&&n.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var lz=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ll=lz.reduce((e,n)=>{const r=J4(`Primitive.${n}`),l=w.forwardRef((s,o)=>{const{asChild:u,...f}=s,d=u?r:n;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),h.jsx(d,{...f,ref:o})});return l.displayName=`Primitive.${n}`,{...e,[n]:l}},{}),Ps='[cmdk-group=""]',jh='[cmdk-group-items=""]',iz='[cmdk-group-heading=""]',gk='[cmdk-item=""]',W1=`${gk}:not([aria-disabled="true"])`,up="cmdk-item-select",ki="data-value",sz=(e,n,r)=>l5(e,n,r),xk=w.createContext(void 0),go=()=>w.useContext(xk),bk=w.createContext(void 0),sm=()=>w.useContext(bk),yk=w.createContext(void 0),vk=w.forwardRef((e,n)=>{let r=Si(()=>{var L,A;return{search:"",value:(A=(L=e.value)!=null?L:e.defaultValue)!=null?A:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),l=Si(()=>new Set),s=Si(()=>new Map),o=Si(()=>new Map),u=Si(()=>new Set),f=wk(e),{label:d,children:p,value:x,onValueChange:g,filter:y,shouldFilter:v,loop:S,disablePointerSelection:E=!1,vimBindings:T=!0,...N}=e,j=ya(),C=ya(),I=ya(),U=w.useRef(null),_=bz();Rl(()=>{if(x!==void 0){let L=x.trim();r.current.value=L,z.emit()}},[x]),Rl(()=>{_(6,ee)},[]);let z=w.useMemo(()=>({subscribe:L=>(u.current.add(L),()=>u.current.delete(L)),snapshot:()=>r.current,setState:(L,A,se)=>{var te,ie,Se,je;if(!Object.is(r.current[L],A)){if(r.current[L]=A,L==="search")Z(),B(),_(1,q);else if(L==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let Ae=document.getElementById(I);Ae?Ae.focus():(te=document.getElementById(j))==null||te.focus()}if(_(7,()=>{var Ae;r.current.selectedItemId=(Ae=ae())==null?void 0:Ae.id,z.emit()}),se||_(5,ee),((ie=f.current)==null?void 0:ie.value)!==void 0){let Ae=A??"";(je=(Se=f.current).onValueChange)==null||je.call(Se,Ae);return}}z.emit()}},emit:()=>{u.current.forEach(L=>L())}}),[]),P=w.useMemo(()=>({value:(L,A,se)=>{var te;A!==((te=o.current.get(L))==null?void 0:te.value)&&(o.current.set(L,{value:A,keywords:se}),r.current.filtered.items.set(L,X(A,se)),_(2,()=>{B(),z.emit()}))},item:(L,A)=>(l.current.add(L),A&&(s.current.has(A)?s.current.get(A).add(L):s.current.set(A,new Set([L]))),_(3,()=>{Z(),B(),r.current.value||q(),z.emit()}),()=>{o.current.delete(L),l.current.delete(L),r.current.filtered.items.delete(L);let se=ae();_(4,()=>{Z(),se?.getAttribute("id")===L&&q(),z.emit()})}),group:L=>(s.current.has(L)||s.current.set(L,new Set),()=>{o.current.delete(L),s.current.delete(L)}),filter:()=>f.current.shouldFilter,label:d||e["aria-label"],getDisablePointerSelection:()=>f.current.disablePointerSelection,listId:j,inputId:I,labelId:C,listInnerRef:U}),[]);function X(L,A){var se,te;let ie=(te=(se=f.current)==null?void 0:se.filter)!=null?te:sz;return L?ie(L,r.current.search,A):0}function B(){if(!r.current.search||f.current.shouldFilter===!1)return;let L=r.current.filtered.items,A=[];r.current.filtered.groups.forEach(te=>{let ie=s.current.get(te),Se=0;ie.forEach(je=>{let Ae=L.get(je);Se=Math.max(Ae,Se)}),A.push([te,Se])});let se=U.current;Y().sort((te,ie)=>{var Se,je;let Ae=te.getAttribute("id"),qe=ie.getAttribute("id");return((Se=L.get(qe))!=null?Se:0)-((je=L.get(Ae))!=null?je:0)}).forEach(te=>{let ie=te.closest(jh);ie?ie.appendChild(te.parentElement===ie?te:te.closest(`${jh} > *`)):se.appendChild(te.parentElement===se?te:te.closest(`${jh} > *`))}),A.sort((te,ie)=>ie[1]-te[1]).forEach(te=>{var ie;let Se=(ie=U.current)==null?void 0:ie.querySelector(`${Ps}[${ki}="${encodeURIComponent(te[0])}"]`);Se?.parentElement.appendChild(Se)})}function q(){let L=Y().find(se=>se.getAttribute("aria-disabled")!=="true"),A=L?.getAttribute(ki);z.setState("value",A||void 0)}function Z(){var L,A,se,te;if(!r.current.search||f.current.shouldFilter===!1){r.current.filtered.count=l.current.size;return}r.current.filtered.groups=new Set;let ie=0;for(let Se of l.current){let je=(A=(L=o.current.get(Se))==null?void 0:L.value)!=null?A:"",Ae=(te=(se=o.current.get(Se))==null?void 0:se.keywords)!=null?te:[],qe=X(je,Ae);r.current.filtered.items.set(Se,qe),qe>0&&ie++}for(let[Se,je]of s.current)for(let Ae of je)if(r.current.filtered.items.get(Ae)>0){r.current.filtered.groups.add(Se);break}r.current.filtered.count=ie}function ee(){var L,A,se;let te=ae();te&&(((L=te.parentElement)==null?void 0:L.firstChild)===te&&((se=(A=te.closest(Ps))==null?void 0:A.querySelector(iz))==null||se.scrollIntoView({block:"nearest"})),te.scrollIntoView({block:"nearest"}))}function ae(){var L;return(L=U.current)==null?void 0:L.querySelector(`${gk}[aria-selected="true"]`)}function Y(){var L;return Array.from(((L=U.current)==null?void 0:L.querySelectorAll(W1))||[])}function M(L){let A=Y()[L];A&&z.setState("value",A.getAttribute(ki))}function K(L){var A;let se=ae(),te=Y(),ie=te.findIndex(je=>je===se),Se=te[ie+L];(A=f.current)!=null&&A.loop&&(Se=ie+L<0?te[te.length-1]:ie+L===te.length?te[0]:te[ie+L]),Se&&z.setState("value",Se.getAttribute(ki))}function le(L){let A=ae(),se=A?.closest(Ps),te;for(;se&&!te;)se=L>0?gz(se,Ps):xz(se,Ps),te=se?.querySelector(W1);te?z.setState("value",te.getAttribute(ki)):K(L)}let be=()=>M(Y().length-1),O=L=>{L.preventDefault(),L.metaKey?be():L.altKey?le(1):K(1)},D=L=>{L.preventDefault(),L.metaKey?M(0):L.altKey?le(-1):K(-1)};return w.createElement(ll.div,{ref:n,tabIndex:-1,...N,"cmdk-root":"",onKeyDown:L=>{var A;(A=N.onKeyDown)==null||A.call(N,L);let se=L.nativeEvent.isComposing||L.keyCode===229;if(!(L.defaultPrevented||se))switch(L.key){case"n":case"j":{T&&L.ctrlKey&&O(L);break}case"ArrowDown":{O(L);break}case"p":case"k":{T&&L.ctrlKey&&D(L);break}case"ArrowUp":{D(L);break}case"Home":{L.preventDefault(),M(0);break}case"End":{L.preventDefault(),be();break}case"Enter":{L.preventDefault();let te=ae();if(te){let ie=new Event(up);te.dispatchEvent(ie)}}}}},w.createElement("label",{"cmdk-label":"",htmlFor:P.inputId,id:P.labelId,style:vz},d),Rc(e,L=>w.createElement(bk.Provider,{value:z},w.createElement(xk.Provider,{value:P},L))))}),oz=w.forwardRef((e,n)=>{var r,l;let s=ya(),o=w.useRef(null),u=w.useContext(yk),f=go(),d=wk(e),p=(l=(r=d.current)==null?void 0:r.forceMount)!=null?l:u?.forceMount;Rl(()=>{if(!p)return f.item(s,u?.id)},[p]);let x=kk(s,o,[e.value,e.children,o],e.keywords),g=sm(),y=nl(_=>_.value&&_.value===x.current),v=nl(_=>p||f.filter()===!1?!0:_.search?_.filtered.items.get(s)>0:!0);w.useEffect(()=>{let _=o.current;if(!(!_||e.disabled))return _.addEventListener(up,S),()=>_.removeEventListener(up,S)},[v,e.onSelect,e.disabled]);function S(){var _,z;E(),(z=(_=d.current).onSelect)==null||z.call(_,x.current)}function E(){g.setState("value",x.current,!0)}if(!v)return null;let{disabled:T,value:N,onSelect:j,forceMount:C,keywords:I,...U}=e;return w.createElement(ll.div,{ref:tl(o,n),...U,id:s,"cmdk-item":"",role:"option","aria-disabled":!!T,"aria-selected":!!y,"data-disabled":!!T,"data-selected":!!y,onPointerMove:T||f.getDisablePointerSelection()?void 0:E,onClick:T?void 0:S},e.children)}),uz=w.forwardRef((e,n)=>{let{heading:r,children:l,forceMount:s,...o}=e,u=ya(),f=w.useRef(null),d=w.useRef(null),p=ya(),x=go(),g=nl(v=>s||x.filter()===!1?!0:v.search?v.filtered.groups.has(u):!0);Rl(()=>x.group(u),[]),kk(u,f,[e.value,e.heading,d]);let y=w.useMemo(()=>({id:u,forceMount:s}),[s]);return w.createElement(ll.div,{ref:tl(f,n),...o,"cmdk-group":"",role:"presentation",hidden:g?void 0:!0},r&&w.createElement("div",{ref:d,"cmdk-group-heading":"","aria-hidden":!0,id:p},r),Rc(e,v=>w.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?p:void 0},w.createElement(yk.Provider,{value:y},v))))}),cz=w.forwardRef((e,n)=>{let{alwaysRender:r,...l}=e,s=w.useRef(null),o=nl(u=>!u.search);return!r&&!o?null:w.createElement(ll.div,{ref:tl(s,n),...l,"cmdk-separator":"",role:"separator"})}),fz=w.forwardRef((e,n)=>{let{onValueChange:r,...l}=e,s=e.value!=null,o=sm(),u=nl(p=>p.search),f=nl(p=>p.selectedItemId),d=go();return w.useEffect(()=>{e.value!=null&&o.setState("search",e.value)},[e.value]),w.createElement(ll.input,{ref:n,...l,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":d.listId,"aria-labelledby":d.labelId,"aria-activedescendant":f,id:d.inputId,type:"text",value:s?e.value:u,onChange:p=>{s||o.setState("search",p.target.value),r?.(p.target.value)}})}),dz=w.forwardRef((e,n)=>{let{children:r,label:l="Suggestions",...s}=e,o=w.useRef(null),u=w.useRef(null),f=nl(p=>p.selectedItemId),d=go();return w.useEffect(()=>{if(u.current&&o.current){let p=u.current,x=o.current,g,y=new ResizeObserver(()=>{g=requestAnimationFrame(()=>{let v=p.offsetHeight;x.style.setProperty("--cmdk-list-height",v.toFixed(1)+"px")})});return y.observe(p),()=>{cancelAnimationFrame(g),y.unobserve(p)}}},[]),w.createElement(ll.div,{ref:tl(o,n),...s,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":f,"aria-label":l,id:d.listId},Rc(e,p=>w.createElement("div",{ref:tl(u,d.listInnerRef),"cmdk-list-sizer":""},p)))}),hz=w.forwardRef((e,n)=>{let{open:r,onOpenChange:l,overlayClassName:s,contentClassName:o,container:u,...f}=e;return w.createElement(V4,{open:r,onOpenChange:l},w.createElement(X4,{container:u},w.createElement(K4,{"cmdk-overlay":"",className:s}),w.createElement(Z4,{"aria-label":e.label,"cmdk-dialog":"",className:o},w.createElement(vk,{ref:n,...f}))))}),pz=w.forwardRef((e,n)=>nl(r=>r.filtered.count===0)?w.createElement(ll.div,{ref:n,...e,"cmdk-empty":"",role:"presentation"}):null),mz=w.forwardRef((e,n)=>{let{progress:r,children:l,label:s="Loading...",...o}=e;return w.createElement(ll.div,{ref:n,...o,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":s},Rc(e,u=>w.createElement("div",{"aria-hidden":!0},u)))}),gn=Object.assign(vk,{List:dz,Item:oz,Input:fz,Group:uz,Separator:cz,Dialog:hz,Empty:pz,Loading:mz});function gz(e,n){let r=e.nextElementSibling;for(;r;){if(r.matches(n))return r;r=r.nextElementSibling}}function xz(e,n){let r=e.previousElementSibling;for(;r;){if(r.matches(n))return r;r=r.previousElementSibling}}function wk(e){let n=w.useRef(e);return Rl(()=>{n.current=e}),n}var Rl=typeof window>"u"?w.useEffect:w.useLayoutEffect;function Si(e){let n=w.useRef();return n.current===void 0&&(n.current=e()),n}function nl(e){let n=sm(),r=()=>e(n.snapshot());return w.useSyncExternalStore(n.subscribe,r,r)}function kk(e,n,r,l=[]){let s=w.useRef(),o=go();return Rl(()=>{var u;let f=(()=>{var p;for(let x of r){if(typeof x=="string")return x.trim();if(typeof x=="object"&&"current"in x)return x.current?(p=x.current.textContent)==null?void 0:p.trim():s.current}})(),d=l.map(p=>p.trim());o.value(e,f,d),(u=n.current)==null||u.setAttribute(ki,f),s.current=f}),s}var bz=()=>{let[e,n]=w.useState(),r=Si(()=>new Map);return Rl(()=>{r.current.forEach(l=>l()),r.current=new Map},[e]),(l,s)=>{r.current.set(l,s),n({})}};function yz(e){let n=e.type;return typeof n=="function"?n(e.props):"render"in n?n.render(e.props):e}function Rc({asChild:e,children:n},r){return e&&w.isValidElement(n)?w.cloneElement(yz(n),{ref:n.ref},r(n.props.children)):r(n)}var vz={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};function wz({open:e,onClose:n,repos:r,globalSkills:l=[],globalModules:s=[],onOpenRepo:o,onSendSkill:u,onSendModule:f,onOpenSettings:d,isMobile:p=!1}){return e?h.jsx("div",{className:`fixed inset-0 z-50 flex bg-black/60 ${p?"items-end":"items-start justify-center pt-[20vh]"}`,onClick:n,children:h.jsx("div",{onClick:x=>x.stopPropagation(),className:`w-full ${p?"":"max-w-lg"}`,children:h.jsxs(gn,{className:"rounded-lg border border-neutral-10 bg-neutral-11 shadow-2xl",label:"Command palette",children:[h.jsx(gn.Input,{placeholder:"Search repos, skills, modules, actions...",className:"w-full border-b border-neutral-10 bg-transparent px-4 py-3 text-[15px] text-neutral-2 outline-none placeholder:text-neutral-5",autoFocus:!0}),h.jsxs(gn.List,{className:"max-h-72 overflow-y-auto p-2",children:[h.jsx(gn.Empty,{className:"px-4 py-8 text-center text-[15px] text-neutral-5",children:"No results found."}),h.jsx(gn.Group,{heading:"Repos",className:"[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:pb-1 [&_[cmdk-group-heading]]:text-[12px] [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:uppercase [&_[cmdk-group-heading]]:tracking-wider [&_[cmdk-group-heading]]:text-neutral-5",children:r.map(x=>h.jsxs(gn.Item,{value:`repo ${x.name} ${x.tags.join(" ")}`,onSelect:()=>{o(x),n()},className:"flex cursor-pointer items-center gap-2 rounded px-2 py-1.5 text-[15px] text-neutral-4 aria-selected:bg-primary-8/20 aria-selected:text-primary-4",children:[h.jsx("span",{className:"text-neutral-5",children:"▢"}),x.name,h.jsx("span",{className:"ml-auto text-[12px] text-neutral-5",children:x.tags.join(", ")})]},x.id))}),h.jsxs(gn.Group,{heading:"Skills",className:"[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:pb-1 [&_[cmdk-group-heading]]:pt-2 [&_[cmdk-group-heading]]:text-[12px] [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:uppercase [&_[cmdk-group-heading]]:tracking-wider [&_[cmdk-group-heading]]:text-neutral-5",children:[l.map(x=>h.jsxs(gn.Item,{value:`skill ${x.name} ${x.command} global`,onSelect:()=>{u(x.command),n()},className:"flex cursor-pointer items-center gap-2 rounded px-2 py-1.5 text-[15px] text-neutral-4 aria-selected:bg-primary-8/20 aria-selected:text-primary-4",children:[h.jsx("span",{className:"text-accent-6",children:"/"}),h.jsx("span",{children:x.name}),h.jsx("span",{className:"ml-auto text-[12px] text-neutral-5",children:"global"})]},`global-${x.id}`)),r.flatMap(x=>x.skills.map(g=>h.jsxs(gn.Item,{value:`skill ${g.name} ${g.command} ${x.name}`,onSelect:()=>{u(g.command),n()},className:"flex cursor-pointer items-center gap-2 rounded px-2 py-1.5 text-[15px] text-neutral-4 aria-selected:bg-primary-8/20 aria-selected:text-primary-4",children:[h.jsx("span",{className:"text-accent-6",children:"/"}),h.jsx("span",{children:g.name}),h.jsx("span",{className:"ml-auto text-[12px] text-neutral-5",children:x.name})]},`${x.id}-${g.id}`)))]}),h.jsx(gn.Group,{heading:"Modules",className:"[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:pb-1 [&_[cmdk-group-heading]]:pt-2 [&_[cmdk-group-heading]]:text-[12px] [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:uppercase [&_[cmdk-group-heading]]:tracking-wider [&_[cmdk-group-heading]]:text-neutral-5",children:s.map(x=>h.jsxs(gn.Item,{value:`module ${x.name} ${x.description} global`,onSelect:()=>{f(x),n()},className:"flex cursor-pointer items-center gap-2 rounded px-2 py-1.5 text-[15px] text-neutral-4 aria-selected:bg-primary-8/20 aria-selected:text-primary-4",children:[h.jsx("span",{className:"text-primary-6",children:"◆"}),h.jsx("span",{children:x.name}),h.jsx("span",{className:"ml-auto text-[12px] text-neutral-5",children:"global"})]},`module-${x.id}`))}),h.jsx(gn.Group,{heading:"Actions",className:"[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:pb-1 [&_[cmdk-group-heading]]:pt-2 [&_[cmdk-group-heading]]:text-[12px] [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:uppercase [&_[cmdk-group-heading]]:tracking-wider [&_[cmdk-group-heading]]:text-neutral-5",children:h.jsxs(gn.Item,{value:"settings token configure",onSelect:()=>{d(),n()},className:"flex cursor-pointer items-center gap-2 rounded px-2 py-1.5 text-[15px] text-neutral-4 aria-selected:bg-primary-8/20 aria-selected:text-primary-4",children:[h.jsx("span",{className:"text-neutral-5",children:"⚙"}),"Settings"]})})]})]})})}):null}function J1({groups:e,onSelectSkill:n,onClose:r}){const l=w.useRef(null);w.useEffect(()=>{function o(f){l.current&&!l.current.contains(f.target)&&r()}function u(f){f.key==="Escape"&&r()}return document.addEventListener("mousedown",o),document.addEventListener("keydown",u),()=>{document.removeEventListener("mousedown",o),document.removeEventListener("keydown",u)}},[r]);const s=e.filter(o=>o.skills.length>0);return s.length===0?null:h.jsxs("div",{ref:l,className:"absolute bottom-full right-0 mb-2 w-56 rounded-md border border-neutral-10 bg-neutral-12 py-1 shadow-lg z-50",children:[h.jsx("div",{className:"px-3 py-1.5 text-[13px] font-semibold text-neutral-3 border-b border-neutral-10 mb-1",children:"Claude Skills"}),s.map((o,u)=>h.jsxs("div",{children:[u>0&&h.jsx("div",{className:"my-1 border-t border-neutral-10"}),h.jsx("div",{className:"px-3 py-1 text-[12px] font-medium uppercase tracking-wider text-neutral-5",children:o.label}),o.skills.map(f=>h.jsxs("button",{onClick:()=>n(f.command),className:"flex w-full flex-col px-3 py-1.5 text-left hover:bg-neutral-10/50",children:[h.jsx("span",{className:"text-[15px] font-medium text-accent-6",children:f.command}),f.description&&h.jsx("span",{className:"text-[13px] text-neutral-4",children:f.description})]},f.id))]},o.label))]})}const kz={skill:{label:"skill",className:"bg-accent-9/30 text-accent-5"},bundled:{label:"built-in",className:"bg-primary-9/30 text-primary-5"},builtin:{label:"command",className:"bg-neutral-8 text-neutral-4"}},Sz={skill:"text-accent-6",bundled:"text-primary-5",builtin:"text-neutral-5"};function Ez({commands:e,filter:n,onSelect:r,onClose:l}){const s=w.useRef(null),o=w.useRef(null);w.useEffect(()=>{function f(d){s.current&&!s.current.contains(d.target)&&l()}return document.addEventListener("mousedown",f),()=>document.removeEventListener("mousedown",f)},[l]);const u=w.useCallback(f=>{const d=e.find(p=>p.command===f);d&&r(d)},[e,r]);return h.jsx("div",{ref:s,className:"absolute bottom-full left-0 mb-1 z-50 w-72",children:h.jsxs(gn,{className:"rounded-lg border border-neutral-10 bg-neutral-11 shadow-2xl",label:"Slash commands",filter:(f,d)=>{const p=d.toLowerCase();return f.toLowerCase().includes(p)?1:0},children:[h.jsx(gn.Input,{value:n,className:"sr-only","aria-hidden":!0,tabIndex:-1,readOnly:!0}),h.jsxs(gn.List,{ref:o,className:"max-h-64 overflow-y-auto p-1",children:[h.jsx(gn.Empty,{className:"px-3 py-4 text-center text-[13px] text-neutral-5",children:"No matching commands."}),e.map(f=>{const d=kz[f.category],p=Sz[f.category];return h.jsxs(gn.Item,{value:`${f.command.slice(1)} ${f.name}`,onSelect:()=>u(f.command),className:"flex cursor-pointer items-center gap-2 rounded px-2 py-1.5 text-[14px] text-neutral-3 aria-selected:bg-primary-8/20 aria-selected:text-primary-4",children:[h.jsx("span",{className:`font-mono text-[13px] ${p}`,children:"/"}),h.jsxs("span",{className:"flex-1 truncate",children:[h.jsx("span",{className:"font-medium",children:f.name}),h.jsx("span",{className:"ml-1.5 text-[12px] text-neutral-5",children:f.description})]}),h.jsx("span",{className:`flex-shrink-0 rounded-full px-1.5 py-0.5 text-[10px] font-medium ${d.className}`,children:d.label})]},f.command)})]})]})})}function e0(e){const n=[];for(const r of Array.from(e.items)){const l=r.getAsFile();l&&n.push(l)}if(n.length===0)for(const r of Array.from(e.files))n.push(r);return n}function Nz({onUpload:e,disabled:n}){const[r,l]=w.useState(!1),s=w.useRef(0);return w.useEffect(()=>{if(n)return;function o(p){p.preventDefault(),s.current++,s.current===1&&l(!0)}function u(p){p.preventDefault(),s.current--,s.current===0&&l(!1)}function f(p){p.preventDefault()}function d(p){if(p.preventDefault(),s.current=0,l(!1),p.dataTransfer){const x=e0(p.dataTransfer);x.length>0&&e(x)}}return window.addEventListener("dragenter",o),window.addEventListener("dragleave",u),window.addEventListener("dragover",f),window.addEventListener("drop",d),()=>{window.removeEventListener("dragenter",o),window.removeEventListener("dragleave",u),window.removeEventListener("dragover",f),window.removeEventListener("drop",d)}},[e,n]),w.useEffect(()=>{if(n)return;function o(u){if(!u.clipboardData)return;const f=e0(u.clipboardData);f.length>0&&(u.preventDefault(),e(f))}return window.addEventListener("paste",o),()=>window.removeEventListener("paste",o)},[e,n]),!r||n?null:h.jsx("div",{className:"absolute inset-0 z-50 flex items-center justify-center rounded border-2 border-dashed border-primary-7 bg-primary-11/60 backdrop-blur-sm pointer-events-none",children:h.jsxs("div",{className:"text-center",children:[h.jsx(y_,{className:"mx-auto mb-2 text-primary-6",size:40,stroke:1.5}),h.jsx("p",{className:"text-[15px] font-medium text-primary-5",children:"Drop files here"})]})})}const cp=[{id:"claude-opus-4-6",label:"Opus 4.6"},{id:"claude-sonnet-4-6",label:"Sonnet 4.6"},{id:"claude-haiku-4-5-20251001",label:"Haiku 4.5"}];function _z(e){return cp.find(n=>n.id===e)?.label??e.replace(/^claude-/,"")}const t0="inputBarHeight",Tz=120,n0=60,r0=600,a0=w.forwardRef(function({onSendInput:n,isWaiting:r,disabled:l,onEscape:s,pendingFiles:o,onAddFiles:u,onRemoveFile:f,skillGroups:d,slashCommands:p,initialValue:x="",onValueChange:g,currentModel:y,onModelChange:v,placeholder:S,isMobile:E=!1},T){const[N,j]=w.useState(x),[C,I]=w.useState(!1),[U,_]=w.useState(!1),[z,P]=w.useState(!1),[X,B]=w.useState(!1),[q,Z]=w.useState(""),ee=w.useRef(null),ae=100,[Y,M]=w.useState(()=>{if(E)return ae;const we=localStorage.getItem(t0);return we?Math.max(n0,Math.min(r0,parseInt(we,10))):Tz}),K=w.useRef(null),le=w.useRef(null),be=w.useRef(!1),O=w.useRef(Y);w.useImperativeHandle(T,()=>({insertText(we){j(we),setTimeout(()=>K.current?.focus(),0)}})),w.useEffect(()=>{r&&!be.current&&!E&&K.current?.focus(),be.current=r},[r,E]),w.useEffect(()=>{if(!z)return;const we=Ve=>{ee.current&&!ee.current.contains(Ve.target)&&P(!1)};return document.addEventListener("mousedown",we),()=>document.removeEventListener("mousedown",we)},[z]);const D=w.useCallback(we=>{we.preventDefault();const Ve=we.clientY,Lt=O.current,he=_e=>{const et=Math.max(n0,Math.min(r0,Lt+(Ve-_e.clientY)));O.current=et,M(et),localStorage.setItem(t0,String(et))},xe=()=>{document.removeEventListener("mousemove",he),document.removeEventListener("mouseup",xe)};document.addEventListener("mousemove",he),document.addEventListener("mouseup",xe)},[]),L=w.useCallback(()=>{!N.trim()&&o.length===0||(B(!1),n(N),j(""),g?.(""))},[N,o,n,g]),A=w.useCallback(we=>{const Ve=we.trimStart();if(Ve.startsWith("/")&&Ve.indexOf(" ")===-1){Z(Ve.slice(1)),B(!0);return}B(!1),Z("")},[]),se=w.useCallback(we=>{const Ve=we.target.value;j(Ve),g?.(Ve),A(Ve)},[g,A]),te=w.useCallback(we=>{const Ve=we.command+" ";j(Ve),g?.(Ve),B(!1),Z(""),setTimeout(()=>K.current?.focus(),0)},[g]),ie=w.useCallback(we=>{if(!we.nativeEvent.isComposing){if(X&&we.key==="Escape"){we.preventDefault(),B(!1);return}we.key==="Enter"&&!we.shiftKey?X||(we.preventDefault(),L()):we.key==="c"&&we.ctrlKey?(we.preventDefault(),n("")):we.key==="Escape"&&(we.preventDefault(),K.current?.blur(),s())}},[X,L,n,s]),Se=w.useCallback(()=>{le.current?.click()},[]),je=w.useCallback(we=>{const Ve=we.target.files;Ve&&Ve.length>0&&u(Array.from(Ve)),we.target.value=""},[u]),Ae=d&&d.some(we=>we.skills.length>0),qe=p&&p.length>0;return h.jsxs("div",{className:"app-input-bar relative flex flex-col border-t border-l border-neutral-9 bg-neutral-10",style:E?{minHeight:ae}:{height:Y},children:[h.jsx(Nz,{onUpload:u,disabled:l}),X&&qe&&h.jsx(Ez,{commands:p,filter:q,onSelect:te,onClose:()=>B(!1)}),!E&&h.jsx("div",{className:"h-1 flex-shrink-0 cursor-row-resize hover:bg-primary-7/40 active:bg-primary-7/60 transition-colors",onMouseDown:D}),o.length>0&&h.jsx("div",{className:"flex flex-wrap gap-1.5 px-3 pt-1.5 flex-shrink-0",children:o.map((we,Ve)=>h.jsxs("span",{className:"flex items-center gap-1 rounded bg-neutral-7 px-2 py-0.5 text-[13px] text-neutral-2",children:[h.jsx("span",{className:"max-w-[150px] truncate",children:we.name}),h.jsx("button",{onClick:()=>f(Ve),className:"flex-shrink-0 rounded p-0.5 text-neutral-4 hover:text-neutral-1",children:h.jsx(Wr,{size:12,stroke:2})})]},`${we.name}-${Ve}`))}),h.jsxs("div",{className:"flex flex-1 min-h-0 gap-2 px-3 py-2",children:[r&&h.jsx("span",{className:"mt-1 h-2 w-2 flex-shrink-0 rounded-full bg-primary-5 animate-pulse"}),h.jsx("textarea",{ref:K,value:N,onChange:se,onKeyDown:ie,disabled:l,autoFocus:!0,placeholder:S??(r?"Type response...":"What do you want to build?"),className:`flex-1 min-h-0 resize-none bg-transparent ${E?"text-[16px]":"text-[15px]"} leading-snug text-neutral-1 placeholder:text-neutral-5 outline-none disabled:opacity-50 overflow-y-auto`}),h.jsx("input",{ref:le,type:"file",multiple:!0,accept:"image/png,image/jpeg,image/gif,image/webp,text/markdown,.md",onChange:je,className:"hidden"}),h.jsxs("div",{className:`flex flex-shrink-0 flex-row items-end ${E?"gap-1.5":"gap-1"} pb-0.5`,children:[!E&&h.jsxs(h.Fragment,{children:[y&&v&&h.jsxs("div",{className:"relative",children:[h.jsxs("button",{onClick:()=>_(!U),className:"flex items-center gap-0.5 rounded px-1.5 pb-1 pt-0.5 text-[13px] font-medium text-neutral-4 hover:text-neutral-2 hover:bg-neutral-7 transition-colors",title:"Change model",children:[_z(y),h.jsx(Zr,{size:12,stroke:2})]}),U&&h.jsx("div",{className:"absolute bottom-full mb-1 right-0 z-50 min-w-[160px] rounded border border-neutral-6 bg-neutral-8 shadow-lg py-1",children:cp.map(we=>h.jsx("button",{onClick:()=>{v(we.id),_(!1)},className:`w-full text-left px-3 py-1.5 text-[13px] hover:bg-neutral-7 transition-colors ${we.id===y?"text-primary-4":"text-neutral-2"}`,children:we.label},we.id))})]}),Ae&&h.jsxs("div",{className:"relative",children:[h.jsx("button",{onClick:()=>I(!C),disabled:l,className:"flex items-center justify-center rounded p-1 text-neutral-3 hover:text-neutral-1 hover:bg-neutral-7 transition-colors disabled:opacity-30",title:"Claude Skills",children:h.jsx(gy,{size:20,stroke:2})}),C&&h.jsx(J1,{groups:d,onSelectSkill:we=>{j(we+" "),I(!1),setTimeout(()=>K.current?.focus(),0)},onClose:()=>I(!1)})]}),h.jsx("button",{onClick:Se,disabled:l,className:"flex items-center justify-center rounded p-1 text-neutral-3 hover:text-neutral-1 hover:bg-neutral-7 transition-colors disabled:opacity-30",title:"Attach files",children:h.jsx(dy,{size:20,stroke:2})}),h.jsx("button",{onClick:L,disabled:l||!N.trim()&&o.length===0,className:`flex items-center justify-center rounded p-1 transition-colors disabled:opacity-30 ${N.trim()||o.length>0?"bg-primary-8 text-neutral-1 hover:bg-primary-7":"text-neutral-5"}`,title:"Send (Enter)",children:h.jsx(py,{size:20,stroke:2})})]}),E&&h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:"relative",ref:ee,children:[h.jsx("button",{onClick:()=>P(!z),disabled:l,className:"flex items-center justify-center rounded min-w-[34px] min-h-[34px] p-1.5 text-neutral-3 hover:text-neutral-1 hover:bg-neutral-7 transition-colors disabled:opacity-30",title:"More options",children:h.jsx(EN,{size:24,stroke:2})}),z&&h.jsxs("div",{className:"absolute bottom-full mb-1 right-0 z-50 min-w-[180px] rounded-lg border border-neutral-6 bg-neutral-8 shadow-lg py-1",children:[y&&v&&h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"px-3 py-1.5 text-[12px] text-neutral-5 uppercase tracking-wider",children:"Model"}),cp.map(we=>h.jsx("button",{onClick:()=>{v(we.id),P(!1)},className:`w-full text-left px-3 py-2 text-[14px] hover:bg-neutral-7 transition-colors ${we.id===y?"text-primary-4":"text-neutral-2"}`,children:we.label},we.id)),h.jsx("div",{className:"my-1 border-t border-neutral-7"})]}),Ae&&h.jsxs("button",{onClick:()=>{P(!1),I(!C)},className:"flex items-center gap-2 w-full text-left px-3 py-2 text-[14px] text-neutral-2 hover:bg-neutral-7 transition-colors",children:[h.jsx(gy,{size:18,stroke:2,className:"text-neutral-4"}),"Skills"]}),h.jsxs("button",{onClick:()=>{P(!1),Se()},className:"flex items-center gap-2 w-full text-left px-3 py-2 text-[14px] text-neutral-2 hover:bg-neutral-7 transition-colors",children:[h.jsx(dy,{size:18,stroke:2,className:"text-neutral-4"}),"Attach files"]})]}),C&&h.jsx(J1,{groups:d,onSelectSkill:we=>{j(we+" "),I(!1),setTimeout(()=>K.current?.focus(),0)},onClose:()=>I(!1)})]}),h.jsx("button",{onClick:L,disabled:l||!N.trim()&&o.length===0,className:`flex items-center justify-center rounded min-w-[34px] min-h-[34px] p-1.5 transition-colors disabled:opacity-30 ${N.trim()||o.length>0?"bg-primary-8 text-neutral-1 hover:bg-primary-7":"text-neutral-5"}`,title:"Send (Enter)",children:h.jsx(py,{size:24,stroke:2})})]})]})]})]})});function Az({options:e,question:n,multiSelect:r,promptType:l,questions:s,approvePattern:o,onSelect:u,isMobile:f=!1}){const d=l==="permission",p=f?"px-4 py-2.5 text-[16px] min-h-[34px]":"px-3 py-0.5 text-[13px]",[x,g]=w.useState(15),y=s&&s.length>1,[v,S]=w.useState(0),[E,T]=w.useState({}),[N,j]=w.useState(new Set),C=y?s[v]:null,I=C?C.question:n,U=C?C.options:e,_=C?C.multiSelect:r,z=w.useCallback(q=>{if(!y||!C){u(q);return}const Z={...E,[C.question]:q};v+1<s.length?(T(Z),S(v+1),j(new Set)):u(JSON.stringify(Z))},[y,C,E,v,s,u]),P=w.useRef(z);P.current=z,w.useEffect(()=>{if(!d||!e.find(ae=>ae.value==="allow"))return;let Z=15;const ee=setInterval(()=>{Z--,g(Z),Z<=0&&(clearInterval(ee),P.current("allow"))},1e3);return()=>clearInterval(ee)},[d,e]);const X=w.useCallback(q=>{const Z=q.join(", ");if(!y||!C){u(q);return}const ee={...E,[C.question]:Z};v+1<s.length?(T(ee),S(v+1),j(new Set)):u(JSON.stringify(ee))},[y,C,E,v,s,u]),B=y?`(${v+1}/${s.length})`:null;if(_){const q=ee=>{j(ae=>{const Y=new Set(ae);return Y.has(ee)?Y.delete(ee):Y.add(ee),Y})},Z=()=>{X(Array.from(N)),j(new Set)};return h.jsxs("div",{className:`border-t px-3 py-2 ${d?"border-warning-9/50 bg-warning-11/30":"border-neutral-10 bg-neutral-11"}`,children:[I&&h.jsxs("p",{className:`text-[13px] mb-1.5 ${d?"text-warning-4":"text-neutral-3"}`,children:[B&&h.jsx("span",{className:"text-neutral-5 mr-1",children:B}),I]}),h.jsxs("div",{className:`flex flex-wrap items-center ${f?"gap-2.5":"gap-1.5"}`,children:[U.map(ee=>h.jsx("button",{onClick:()=>q(ee.value),title:ee.description,className:`rounded-full border ${p} transition-colors ${N.has(ee.value)?"border-primary-6 bg-primary-9 text-primary-3":"border-neutral-8 bg-neutral-10 text-neutral-2 hover:border-primary-7 hover:bg-neutral-9 hover:text-neutral-1"}`,children:ee.label},ee.value)),N.size>0&&h.jsxs("button",{onClick:Z,className:`rounded-full border border-primary-7 bg-primary-9 ${p} text-primary-3 hover:bg-primary-8 transition-colors`,children:["Confirm (",N.size,")"]})]})]})}return h.jsxs("div",{className:`border-t px-3 py-2 ${d?"border-warning-9/50 bg-warning-11/30":"border-neutral-10 bg-neutral-11"}`,children:[I&&h.jsxs("p",{className:`text-[13px] mb-1.5 ${d?"text-warning-4":"text-neutral-3"}`,children:[B&&h.jsx("span",{className:"text-neutral-5 mr-1",children:B}),I]}),h.jsx("div",{className:"flex flex-wrap items-center gap-1.5",children:U.map(q=>{const Z=d&&q.value==="allow",ee=d&&q.value==="always_allow",ae=ee?o?`Auto-approve: ${o}`:"Auto-approve this exact command":void 0,Y=d&&q.value==="deny";let M=`rounded-full border ${p} transition-colors `;return Z?M+="border-success-7 bg-success-10/50 text-success-4 hover:bg-success-9/50":ee?M+="border-primary-7 bg-primary-10/50 text-primary-4 hover:bg-primary-9/50":Y?M+="border-error-7 bg-error-10/50 text-error-4 hover:bg-error-9/50":M+="border-neutral-8 bg-neutral-10 text-neutral-2 hover:border-primary-7 hover:bg-neutral-9 hover:text-neutral-1",h.jsxs("button",{onClick:()=>z(q.value),title:ae??q.description,className:M,children:[q.label,Z&&` (${x}s)`]},q.value)})})]})}function Cz({groups:e,token:n,ghMissing:r,onOpen:l,onRefreshRepos:s}){const[o,u]=w.useState(null),[f,d]=w.useState("");w.useEffect(()=>{n&&O0(n).then(y=>{d(y)}).catch(()=>{})},[n]);async function p(y){n&&(await D0(n,y),d(y),s?.())}async function x(y){if(!o){if(!y.cloned){u(y.id);try{const v={"Content-Type":"application/json"};n&&(v.Authorization=`Bearer ${n}`);const S=await fetch("/cc/api/clone",{method:"POST",headers:v,body:JSON.stringify({owner:y.owner,name:y.name})});if(!S.ok){const E=await S.json();throw new Error(E.error||"Clone failed")}y.cloned=!0}catch{u(null);return}u(null)}l(y)}}const g=e.reduce((y,v)=>y+v.repos.length,0);return h.jsx("div",{className:"flex flex-1 items-center justify-center p-8",children:h.jsxs("div",{className:"w-full max-w-md",children:[h.jsxs("div",{className:"mb-6 text-center",children:[h.jsx("div",{className:"mx-auto mb-3 flex h-10 w-10 items-center justify-center rounded-full bg-neutral-7/50",children:h.jsx(wp,{size:24,stroke:1.5,className:"text-neutral-3"})}),h.jsx("h2",{className:"text-[19px] font-medium text-neutral-2",children:"Choose a repository to start a Claude Code session"})]}),r?h.jsxs("div",{className:"rounded-lg border border-amber-500/30 bg-amber-500/10 px-4 py-3 text-[13px] leading-relaxed text-neutral-3",children:[h.jsx("p",{className:"mb-2 font-medium text-amber-400",children:"GitHub CLI (gh) not found"}),h.jsxs("p",{className:"text-neutral-4",children:["The repo browser needs ",h.jsx("code",{className:"rounded bg-neutral-8 px-1 py-0.5 text-neutral-3",children:"gh"})," to list and clone your repositories."]}),h.jsxs("p",{className:"mt-2 text-neutral-4",children:["Install it:"," ",h.jsx("a",{href:"https://cli.github.com",target:"_blank",rel:"noreferrer",className:"text-amber-400 underline underline-offset-2 hover:text-amber-300",children:"https://cli.github.com"})]}),h.jsxs("p",{className:"mt-1 text-neutral-4",children:["Then run: ",h.jsx("code",{className:"rounded bg-neutral-8 px-1 py-0.5 text-neutral-3",children:"gh auth login"})]})]}):g===0?h.jsx("p",{className:"text-center text-[17px] text-neutral-6",children:"No repositories configured"}):h.jsx(Qp,{groups:e,onSelect:x,cloningId:o,autoFocus:!0}),h.jsx("div",{className:"mt-6 border-t border-neutral-8 pt-5",children:h.jsx(K0,{value:f,token:n,helpText:"Absolute path to your locally cloned repositories",onSave:p})})]})})}const Rz=["ls","cat","echo","grep","git log","git status","pwd","which","node -e","head","tail","wc","file","stat","find","type","env","printenv"];function jz({send:e,isOpen:n}){const[r,l]=w.useState([]),[s,o]=w.useState({filesChanged:0,insertions:0,deletions:0,truncated:!1}),[u,f]=w.useState(""),[d,p]=w.useState("all"),[x,g]=w.useState(!1),[y,v]=w.useState(null),S=w.useRef(d),E=w.useRef(n),T=w.useRef(null);w.useEffect(()=>{S.current=d},[d]),w.useEffect(()=>{E.current=n},[n]);const N=w.useCallback(()=>{E.current&&(g(!0),v(null),e({type:"get_diff",scope:S.current}))},[e]),j=w.useCallback(P=>{p(P),S.current=P,E.current&&(g(!0),v(null),e({type:"get_diff",scope:P}))},[e]),C=w.useCallback((P,X)=>{g(!0),e({type:"discard_changes",scope:S.current,paths:P,statuses:X})},[e]),I=w.useCallback(P=>{P.type==="diff_result"?(l(P.files),o(P.summary),f(P.branch),p(P.scope),S.current=P.scope,g(!1),v(null)):P.type==="diff_error"&&(v(P.message),g(!1))},[]),U=w.useCallback(()=>{T.current&&clearTimeout(T.current),T.current=setTimeout(()=>{T.current=null,N()},500)},[N]),_=w.useCallback((P,X)=>{if(E.current){if(P==="Edit"||P==="Write"){U();return}if(P==="Bash"&&X){const B=X.trim().toLowerCase();if(Rz.some(Z=>B.startsWith(Z)))return}P==="Bash"&&U()}},[U]),z=w.useRef(!1);return w.useEffect(()=>{n&&!z.current&&e({type:"get_diff",scope:S.current}),z.current=n},[n,e]),w.useEffect(()=>()=>{T.current&&clearTimeout(T.current)},[]),{files:r,summary:s,branch:u,scope:d,loading:x,error:y,refresh:N,changeScope:j,discard:C,handleMessage:I,handleToolDone:_}}const l0={all:"Uncommitted changes",staged:"Staged",unstaged:"Unstaged"};function Mz({branch:e,scope:n,summary:r,loading:l,hasUntrackedFiles:s,onScopeChange:o,onRefresh:u,onDiscardAll:f}){const[d,p]=w.useState(!1),[x,g]=w.useState(!1),y=()=>{if(!x){g(!0),setTimeout(()=>g(!1),3e3);return}f(),g(!1)};return h.jsxs("div",{className:"sticky top-0 z-10 bg-neutral-10 border-b border-neutral-9 px-3 py-2 flex flex-col gap-2",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsxs("div",{className:"flex items-center gap-1 text-xs text-neutral-4 shrink-0",children:[h.jsx(wp,{size:13}),h.jsx("span",{className:"truncate max-w-[120px]",title:e,children:e})]}),h.jsxs("div",{className:"relative flex-1",children:[h.jsxs("button",{className:"flex items-center gap-1 text-xs text-neutral-2 bg-neutral-10 hover:bg-neutral-9 rounded px-2 py-1",onClick:()=>p(!d),children:[h.jsx("span",{children:l0[n]}),r.filesChanged>0&&h.jsxs("span",{className:"text-neutral-5",children:["(",r.filesChanged,")"]}),h.jsx(Zr,{size:12})]}),d&&h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"fixed inset-0 z-10",onClick:()=>p(!1)}),h.jsx("div",{className:"absolute top-full left-0 mt-1 bg-neutral-10 border border-neutral-8 rounded shadow-lg z-20 min-w-[160px]",children:["all","staged","unstaged"].map(v=>h.jsx("button",{className:`block w-full text-left px-3 py-1.5 text-xs hover:bg-neutral-9 ${v===n?"text-primary-5":"text-neutral-2"}`,onClick:()=>{o(v),p(!1)},children:l0[v]},v))})]})]}),h.jsx("button",{className:`p-1 rounded hover:bg-neutral-9 text-neutral-4 hover:text-neutral-2 ${l?"animate-spin":""}`,onClick:u,title:"Refresh diff",disabled:l,children:h.jsx(a_,{size:14})}),h.jsx("button",{className:`p-1 rounded text-xs ${r.filesChanged===0?"text-neutral-7 cursor-not-allowed":x?"text-error-4 bg-error-950/30 hover:bg-error-950/50":"text-error-5 hover:bg-error-950/30"}`,onClick:y,disabled:r.filesChanged===0,title:x?s?"Click again — untracked files will be deleted!":"Click again to confirm discard all":"Discard all changes",children:h.jsx(gc,{size:14})})]}),r.filesChanged>0&&h.jsxs("div",{className:"flex items-center gap-2 text-xs text-neutral-4",children:[h.jsxs("span",{className:"flex items-center gap-1",children:[r.truncated&&h.jsx("span",{className:"text-warning-5",title:r.truncationReason,children:"truncated"}),h.jsxs("span",{children:[r.filesChanged," file",r.filesChanged!==1?"s":""," changed"]})]}),h.jsxs("span",{className:"text-success-5",children:["+",r.insertions]}),h.jsxs("span",{className:"text-error-5",children:["−",r.deletions]})]})]})}const Oz={modified:{label:"M",color:"text-warning-5 bg-warning-950/40"},added:{label:"A",color:"text-success-5 bg-success-950/40"},deleted:{label:"D",color:"text-error-5 bg-error-950/40"},renamed:{label:"R",color:"text-accent-5 bg-accent-950/40"}};function Dz({files:e,activeFile:n,onSelectFile:r}){return e.length===0?null:h.jsx("div",{className:"flex flex-col text-xs",children:e.map(l=>{const s=Oz[l.status],o=l.path===n,u=l.status==="renamed"&&l.oldPath?`${l.oldPath} → ${l.path}`:l.path;return h.jsxs("button",{className:`flex items-center gap-2 px-3 py-1.5 text-left hover:bg-neutral-10 transition-colors ${o?"bg-neutral-10 text-neutral-1":"text-neutral-3"}`,onClick:()=>r(l.path),children:[h.jsx("span",{className:`inline-flex items-center justify-center w-4 h-4 rounded text-[10px] font-bold shrink-0 ${s.color}`,children:s.label}),h.jsx("span",{className:"font-mono truncate flex-1",title:u,children:u}),!l.isBinary&&(l.additions>0||l.deletions>0)&&h.jsxs("span",{className:"whitespace-nowrap shrink-0",children:[l.additions>0&&h.jsxs("span",{className:"text-success-5",children:["+",l.additions]}),l.additions>0&&l.deletions>0&&" ",l.deletions>0&&h.jsxs("span",{className:"text-error-5",children:["−",l.deletions]})]}),l.isBinary&&h.jsx("span",{className:"text-neutral-6 italic shrink-0",children:"binary"})]},l.path)})})}function i0(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);n&&(l=l.filter((function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable}))),r.push.apply(r,l)}return r}function Nn(e){for(var n=1;n<arguments.length;n++){var r=arguments[n]!=null?arguments[n]:{};n%2?i0(Object(r),!0).forEach((function(l){fp(e,l,r[l])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):i0(Object(r)).forEach((function(l){Object.defineProperty(e,l,Object.getOwnPropertyDescriptor(r,l))}))}return e}function fp(e,n,r){return(n=(function(l){var s=(function(o,u){if(typeof o!="object"||o===null)return o;var f=o[Symbol.toPrimitive];if(f!==void 0){var d=f.call(o,u);if(typeof d!="object")return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return(u==="string"?String:Number)(o)})(l,"string");return typeof s=="symbol"?s:String(s)})(n))in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function ji(e,n){if(e==null)return{};var r,l,s=(function(u,f){if(u==null)return{};var d,p,x={},g=Object.keys(u);for(p=0;p<g.length;p++)d=g[p],f.indexOf(d)>=0||(x[d]=u[d]);return x})(e,n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(l=0;l<o.length;l++)r=o[l],n.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function wa(e,n){return Lz(e)||(function(r,l){var s=r==null?null:typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(s!=null){var o,u,f,d,p=[],x=!0,g=!1;try{if(f=(s=s.call(r)).next,l===0){if(Object(s)!==s)return;x=!1}else for(;!(x=(o=f.call(s)).done)&&(p.push(o.value),p.length!==l);x=!0);}catch(y){g=!0,u=y}finally{try{if(!x&&s.return!=null&&(d=s.return(),Object(d)!==d))return}finally{if(g)throw u}}return p}})(e,n)||om(e,n)||Iz()}function zz(e){return(function(n){if(Array.isArray(n))return dp(n)})(e)||Bz(e)||om(e)||(function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
173
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function Lz(e){if(Array.isArray(e))return e}function Bz(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function om(e,n){if(e){if(typeof e=="string")return dp(e,n);var r=Object.prototype.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?dp(e,n):void 0}}function dp(e,n){(n==null||n>e.length)&&(n=e.length);for(var r=0,l=new Array(n);r<n;r++)l[r]=e[r];return l}function Iz(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
174
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Uz(e,n){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=om(e))||n){r&&(e=r);var l=0,s=function(){};return{s,n:function(){return l>=e.length?{done:!0}:{done:!1,value:e[l++]}},e:function(d){throw d},f:s}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
175
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o,u=!0,f=!1;return{s:function(){r=r.call(e)},n:function(){var d=r.next();return u=d.done,d},e:function(d){f=!0,o=d},f:function(){try{u||r.return==null||r.return()}finally{if(f)throw o}}}}var Fu=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function xo(e,n){return e(n={exports:{}},n.exports),n.exports}var dr=xo((function(e){(function(){var n={}.hasOwnProperty;function r(){for(var l=[],s=0;s<arguments.length;s++){var o=arguments[s];if(o){var u=typeof o;if(u==="string"||u==="number")l.push(o);else if(Array.isArray(o)){if(o.length){var f=r.apply(null,o);f&&l.push(f)}}else if(u==="object"){if(o.toString!==Object.prototype.toString&&!o.toString.toString().includes("[native code]")){l.push(o.toString());continue}for(var d in o)n.call(o,d)&&o[d]&&l.push(d)}}}return l.join(" ")}e.exports?(r.default=r,e.exports=r):window.classNames=r})()})),Wn={hunkClassName:"",lineClassName:"",gutterClassName:"",codeClassName:"",monotonous:!1,gutterType:"default",viewType:"split",widgets:{},hideGutter:!1,selectedChanges:[],generateAnchorID:function(){},generateLineClassName:function(){},renderGutter:function(e){var n=e.renderDefault;return(0,e.wrapInAnchor)(n())},codeEvents:{},gutterEvents:{}},Sk=w.createContext(Wn),$z=Sk.Provider,Hz=function(){return w.useContext(Sk)};xo((function(e,n){(function(r){function l(o){var u=o.slice(11),f=null,d=null;switch(u.indexOf('"')){case-1:f=(g=u.split(" "))[0].slice(2),d=g[1].slice(2);break;case 0:var p=u.indexOf('"',2);f=u.slice(3,p);var x=u.indexOf('"',p+1);d=x<0?u.slice(p+4):u.slice(x+3,-1);break;default:var g;f=(g=u.split(" "))[0].slice(2),d=g[1].slice(3,-1)}return{oldPath:f,newPath:d}}var s={parse:function(o){for(var u,f,d,p,x,g=[],y=2,v=o.split(`
|
|
176
|
+
`),S=v.length,E=0;E<S;){var T=v[E];if(T.indexOf("diff --git")===0){u={hunks:[],oldEndingNewLine:!0,newEndingNewLine:!0,oldPath:(x=l(T)).oldPath,newPath:x.newPath},g.push(u);var N,j=null;e:for(;N=v[++E];){var C=N.indexOf(" "),I=C>-1?N.slice(0,C):I;switch(I){case"diff":E--;break e;case"deleted":case"new":var U=N.slice(C+1);U.indexOf("file mode")===0&&(u[I==="new"?"newMode":"oldMode"]=U.slice(10));break;case"similarity":u.similarity=parseInt(N.split(" ")[2],10);break;case"index":var _=N.slice(C+1).split(" "),z=_[0].split("..");u.oldRevision=z[0],u.newRevision=z[1],_[1]&&(u.oldMode=u.newMode=_[1]);break;case"copy":case"rename":var P=N.slice(C+1);P.indexOf("from")===0?u.oldPath=P.slice(5):u.newPath=P.slice(3),j=I;break;case"---":var X=N.slice(C+1),B=v[++E].slice(4);X==="/dev/null"?(B=B.slice(2),j="add"):B==="/dev/null"?(X=X.slice(2),j="delete"):(j="modify",X=X.slice(2),B=B.slice(2)),X&&(u.oldPath=X),B&&(u.newPath=B),y=5;break e}}u.type=j||"modify"}else if(T.indexOf("Binary")===0)u.isBinary=!0,u.type=T.indexOf("/dev/null and")>=0?"add":T.indexOf("and /dev/null")>=0?"delete":"modify",y=2,u=null;else if(y===5)if(T.indexOf("@@")===0){var q=/^@@\s+-([0-9]+)(,([0-9]+))?\s+\+([0-9]+)(,([0-9]+))?/.exec(T);f={content:T,oldStart:q[1]-0,newStart:q[4]-0,oldLines:q[3]-0||1,newLines:q[6]-0||1,changes:[]},u.hunks.push(f),d=f.oldStart,p=f.newStart}else{var Z=T.slice(0,1),ee={content:T.slice(1)};switch(Z){case"+":ee.type="insert",ee.isInsert=!0,ee.lineNumber=p,p++;break;case"-":ee.type="delete",ee.isDelete=!0,ee.lineNumber=d,d++;break;case" ":ee.type="normal",ee.isNormal=!0,ee.oldLineNumber=d,ee.newLineNumber=p,d++,p++;break;case"\\":var ae=f.changes[f.changes.length-1];ae.isDelete||(u.newEndingNewLine=!1),ae.isInsert||(u.oldEndingNewLine=!1)}ee.type&&f.changes.push(ee)}E++}return g}};e.exports=s})()}));function jc(e){return e.type==="insert"}function no(e){return e.type==="delete"}function ro(e){return e.type==="normal"}function Pz(e){return e[0]}function Fz(e){return e[e.length-1]}function hp(e){return["".concat(e,"Start"),"".concat(e,"Lines")]}function ao(e){return e==="old"?function(n){return jc(n)?-1:ro(n)?n.oldLineNumber:n.lineNumber}:function(n){return no(n)?-1:ro(n)?n.newLineNumber:n.lineNumber}}function Ek(e,n){return function(r,l){var s=r[e],o=s+r[n];return l>=s&&l<o}}function Gz(e,n){return function(r,l,s){var o=r[e]+r[n],u=l[e];return s>=o&&s<u}}function Nk(e){var n=ao(e),r=(function(l){var s=wa(hp(l),2),o=Ek(s[0],s[1]);return function(u,f){return u.find((function(d){return o(d,f)}))}})(e);return function(l,s){var o=r(l,s);if(o)return o.changes.find((function(u){return n(u)===s}))}}function um(e){var n=e==="old"?"new":"old",r=wa(hp(e),2),l=r[0],s=r[1],o=wa(hp(n),2),u=o[0],f=o[1],d=ao(e),p=ao(n),x=Ek(l,s),g=Gz(l,s);return function(y,v){var S=Pz(y);if(v<S[l]){var E=S[l]-v;return S[u]-E}var T=Fz(y);if(T[l]+T[s]<=v){var N=v-T[l]-T[s];return T[u]+T[f]+N}for(var j=0;j<y.length;j++){var C=y[j],I=y[j+1];if(x(C,v)){var U=C.changes.findIndex((function(q){return d(q)===v})),_=C.changes[U];if(ro(_))return p(_);var z=no(_)?U+1:U-1,P=C.changes[z];if(!P)return-1;var X=jc(_)?"delete":"insert";return P.type===X?p(P):-1}if(g(C,I,v)){var B=v-C[l]-C[s];return C[u]+C[f]+B}}throw new Error("Unexpected line position ".concat(v))}}var qz=function(){this.__data__=[],this.size=0},_k=function(e,n){return e===n||e!=e&&n!=n},Mc=function(e,n){for(var r=e.length;r--;)if(_k(e[r][0],n))return r;return-1},Yz=Array.prototype.splice,Vz=function(e){var n=this.__data__,r=Mc(n,e);return!(r<0)&&(r==n.length-1?n.pop():Yz.call(n,r,1),--this.size,!0)},Xz=function(e){var n=this.__data__,r=Mc(n,e);return r<0?void 0:n[r][1]},Kz=function(e){return Mc(this.__data__,e)>-1},Zz=function(e,n){var r=this.__data__,l=Mc(r,e);return l<0?(++this.size,r.push([e,n])):r[l][1]=n,this};function Ei(e){var n=-1,r=e==null?0:e.length;for(this.clear();++n<r;){var l=e[n];this.set(l[0],l[1])}}Ei.prototype.clear=qz,Ei.prototype.delete=Vz,Ei.prototype.get=Xz,Ei.prototype.has=Kz,Ei.prototype.set=Zz;var Oc=Ei,Qz=function(){this.__data__=new Oc,this.size=0},Wz=function(e){var n=this.__data__,r=n.delete(e);return this.size=n.size,r},Jz=function(e){return this.__data__.get(e)},e6=function(e){return this.__data__.has(e)},Tk=typeof Fu=="object"&&Fu&&Fu.Object===Object&&Fu,t6=typeof self=="object"&&self&&self.Object===Object&&self,Ea=Tk||t6||Function("return this")(),Qr=Ea.Symbol,Ak=Object.prototype,n6=Ak.hasOwnProperty,r6=Ak.toString,Fs=Qr?Qr.toStringTag:void 0,a6=function(e){var n=n6.call(e,Fs),r=e[Fs];try{e[Fs]=void 0;var l=!0}catch{}var s=r6.call(e);return l&&(n?e[Fs]=r:delete e[Fs]),s},l6=Object.prototype.toString,i6=function(e){return l6.call(e)},s0=Qr?Qr.toStringTag:void 0,zi=function(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":s0&&s0 in Object(e)?a6(e):i6(e)},cm=function(e){var n=typeof e;return e!=null&&(n=="object"||n=="function")},Ck=function(e){if(!cm(e))return!1;var n=zi(e);return n=="[object Function]"||n=="[object GeneratorFunction]"||n=="[object AsyncFunction]"||n=="[object Proxy]"},Mh=Ea["__core-js_shared__"],o0=(function(){var e=/[^.]+$/.exec(Mh&&Mh.keys&&Mh.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""})(),s6=function(e){return!!o0&&o0 in e},o6=Function.prototype.toString,Dl=function(e){if(e!=null){try{return o6.call(e)}catch{}try{return e+""}catch{}}return""},u6=/^\[object .+?Constructor\]$/,c6=Function.prototype,f6=Object.prototype,d6=c6.toString,h6=f6.hasOwnProperty,p6=RegExp("^"+d6.call(h6).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),m6=function(e){return!(!cm(e)||s6(e))&&(Ck(e)?p6:u6).test(Dl(e))},g6=function(e,n){return e?.[n]},zl=function(e,n){var r=g6(e,n);return m6(r)?r:void 0},lo=zl(Ea,"Map"),io=zl(Object,"create"),x6=function(){this.__data__=io?io(null):{},this.size=0},b6=function(e){var n=this.has(e)&&delete this.__data__[e];return this.size-=n?1:0,n},y6=Object.prototype.hasOwnProperty,v6=function(e){var n=this.__data__;if(io){var r=n[e];return r==="__lodash_hash_undefined__"?void 0:r}return y6.call(n,e)?n[e]:void 0},w6=Object.prototype.hasOwnProperty,k6=function(e){var n=this.__data__;return io?n[e]!==void 0:w6.call(n,e)},S6=function(e,n){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=io&&n===void 0?"__lodash_hash_undefined__":n,this};function Ni(e){var n=-1,r=e==null?0:e.length;for(this.clear();++n<r;){var l=e[n];this.set(l[0],l[1])}}Ni.prototype.clear=x6,Ni.prototype.delete=b6,Ni.prototype.get=v6,Ni.prototype.has=k6,Ni.prototype.set=S6;var u0=Ni,E6=function(){this.size=0,this.__data__={hash:new u0,map:new(lo||Oc),string:new u0}},N6=function(e){var n=typeof e;return n=="string"||n=="number"||n=="symbol"||n=="boolean"?e!=="__proto__":e===null},Dc=function(e,n){var r=e.__data__;return N6(n)?r[typeof n=="string"?"string":"hash"]:r.map},_6=function(e){var n=Dc(this,e).delete(e);return this.size-=n?1:0,n},T6=function(e){return Dc(this,e).get(e)},A6=function(e){return Dc(this,e).has(e)},C6=function(e,n){var r=Dc(this,e),l=r.size;return r.set(e,n),this.size+=r.size==l?0:1,this};function _i(e){var n=-1,r=e==null?0:e.length;for(this.clear();++n<r;){var l=e[n];this.set(l[0],l[1])}}_i.prototype.clear=E6,_i.prototype.delete=_6,_i.prototype.get=T6,_i.prototype.has=A6,_i.prototype.set=C6;var zc=_i,R6=function(e,n){var r=this.__data__;if(r instanceof Oc){var l=r.__data__;if(!lo||l.length<199)return l.push([e,n]),this.size=++r.size,this;r=this.__data__=new zc(l)}return r.set(e,n),this.size=r.size,this};function Ti(e){var n=this.__data__=new Oc(e);this.size=n.size}Ti.prototype.clear=Qz,Ti.prototype.delete=Wz,Ti.prototype.get=Jz,Ti.prototype.has=e6,Ti.prototype.set=R6;var Wu=Ti,j6=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},M6=function(e){return this.__data__.has(e)};function Ju(e){var n=-1,r=e==null?0:e.length;for(this.__data__=new zc;++n<r;)this.add(e[n])}Ju.prototype.add=Ju.prototype.push=j6,Ju.prototype.has=M6;var O6=Ju,D6=function(e,n){for(var r=-1,l=e==null?0:e.length;++r<l;)if(n(e[r],r,e))return!0;return!1},z6=function(e,n){return e.has(n)},Rk=function(e,n,r,l,s,o){var u=1&r,f=e.length,d=n.length;if(f!=d&&!(u&&d>f))return!1;var p=o.get(e),x=o.get(n);if(p&&x)return p==n&&x==e;var g=-1,y=!0,v=2&r?new O6:void 0;for(o.set(e,n),o.set(n,e);++g<f;){var S=e[g],E=n[g];if(l)var T=u?l(E,S,g,n,e,o):l(S,E,g,e,n,o);if(T!==void 0){if(T)continue;y=!1;break}if(v){if(!D6(n,(function(N,j){if(!z6(v,j)&&(S===N||s(S,N,r,l,o)))return v.push(j)}))){y=!1;break}}else if(S!==E&&!s(S,E,r,l,o)){y=!1;break}}return o.delete(e),o.delete(n),y},c0=Ea.Uint8Array,L6=function(e){var n=-1,r=Array(e.size);return e.forEach((function(l,s){r[++n]=[s,l]})),r},B6=function(e){var n=-1,r=Array(e.size);return e.forEach((function(l){r[++n]=l})),r},f0=Qr?Qr.prototype:void 0,Oh=f0?f0.valueOf:void 0,I6=function(e,n,r,l,s,o,u){switch(r){case"[object DataView]":if(e.byteLength!=n.byteLength||e.byteOffset!=n.byteOffset)return!1;e=e.buffer,n=n.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=n.byteLength||!o(new c0(e),new c0(n)));case"[object Boolean]":case"[object Date]":case"[object Number]":return _k(+e,+n);case"[object Error]":return e.name==n.name&&e.message==n.message;case"[object RegExp]":case"[object String]":return e==n+"";case"[object Map]":var f=L6;case"[object Set]":var d=1&l;if(f||(f=B6),e.size!=n.size&&!d)return!1;var p=u.get(e);if(p)return p==n;l|=2,u.set(e,n);var x=Rk(f(e),f(n),l,s,o,u);return u.delete(e),x;case"[object Symbol]":if(Oh)return Oh.call(e)==Oh.call(n)}return!1},U6=function(e,n){for(var r=-1,l=n.length,s=e.length;++r<l;)e[s+r]=n[r];return e},ka=Array.isArray,$6=function(e,n,r){var l=n(e);return ka(e)?l:U6(l,r(e))},H6=function(e,n){for(var r=-1,l=e==null?0:e.length,s=0,o=[];++r<l;){var u=e[r];n(u,r,e)&&(o[s++]=u)}return o},P6=function(){return[]},F6=Object.prototype.propertyIsEnumerable,d0=Object.getOwnPropertySymbols,G6=d0?function(e){return e==null?[]:(e=Object(e),H6(d0(e),(function(n){return F6.call(e,n)})))}:P6,q6=function(e,n){for(var r=-1,l=Array(e);++r<e;)l[r]=n(r);return l},Mi=function(e){return e!=null&&typeof e=="object"},h0=function(e){return Mi(e)&&zi(e)=="[object Arguments]"},jk=Object.prototype,Y6=jk.hasOwnProperty,V6=jk.propertyIsEnumerable,Mk=h0((function(){return arguments})())?h0:function(e){return Mi(e)&&Y6.call(e,"callee")&&!V6.call(e,"callee")},X6=function(){return!1},pp=xo((function(e,n){var r=n&&!n.nodeType&&n,l=r&&e&&!e.nodeType&&e,s=l&&l.exports===r?Ea.Buffer:void 0,o=(s?s.isBuffer:void 0)||X6;e.exports=o})),K6=/^(?:0|[1-9]\d*)$/,Ok=function(e,n){var r=typeof e;return!!(n=n??9007199254740991)&&(r=="number"||r!="symbol"&&K6.test(e))&&e>-1&&e%1==0&&e<n},fm=function(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=9007199254740991},Gt={};Gt["[object Float32Array]"]=Gt["[object Float64Array]"]=Gt["[object Int8Array]"]=Gt["[object Int16Array]"]=Gt["[object Int32Array]"]=Gt["[object Uint8Array]"]=Gt["[object Uint8ClampedArray]"]=Gt["[object Uint16Array]"]=Gt["[object Uint32Array]"]=!0,Gt["[object Arguments]"]=Gt["[object Array]"]=Gt["[object ArrayBuffer]"]=Gt["[object Boolean]"]=Gt["[object DataView]"]=Gt["[object Date]"]=Gt["[object Error]"]=Gt["[object Function]"]=Gt["[object Map]"]=Gt["[object Number]"]=Gt["[object Object]"]=Gt["[object RegExp]"]=Gt["[object Set]"]=Gt["[object String]"]=Gt["[object WeakMap]"]=!1;var Z6=function(e){return Mi(e)&&fm(e.length)&&!!Gt[zi(e)]},Q6=function(e){return function(n){return e(n)}},p0=xo((function(e,n){var r=n&&!n.nodeType&&n,l=r&&e&&!e.nodeType&&e,s=l&&l.exports===r&&Tk.process,o=(function(){try{var u=l&&l.require&&l.require("util").types;return u||s&&s.binding&&s.binding("util")}catch{}})();e.exports=o})),m0=p0&&p0.isTypedArray,Dk=m0?Q6(m0):Z6,W6=Object.prototype.hasOwnProperty,J6=function(e,n){var r=ka(e),l=!r&&Mk(e),s=!r&&!l&&pp(e),o=!r&&!l&&!s&&Dk(e),u=r||l||s||o,f=u?q6(e.length,String):[],d=f.length;for(var p in e)!W6.call(e,p)||u&&(p=="length"||s&&(p=="offset"||p=="parent")||o&&(p=="buffer"||p=="byteLength"||p=="byteOffset")||Ok(p,d))||f.push(p);return f},eL=Object.prototype,tL=function(e){var n=e&&e.constructor;return e===(typeof n=="function"&&n.prototype||eL)},nL=(function(e,n){return function(r){return e(n(r))}})(Object.keys,Object),rL=Object.prototype.hasOwnProperty,aL=function(e){if(!tL(e))return nL(e);var n=[];for(var r in Object(e))rL.call(e,r)&&r!="constructor"&&n.push(r);return n},lL=function(e){return e!=null&&fm(e.length)&&!Ck(e)},dm=function(e){return lL(e)?J6(e):aL(e)},g0=function(e){return $6(e,dm,G6)},iL=Object.prototype.hasOwnProperty,sL=function(e,n,r,l,s,o){var u=1&r,f=g0(e),d=f.length;if(d!=g0(n).length&&!u)return!1;for(var p=d;p--;){var x=f[p];if(!(u?x in n:iL.call(n,x)))return!1}var g=o.get(e),y=o.get(n);if(g&&y)return g==n&&y==e;var v=!0;o.set(e,n),o.set(n,e);for(var S=u;++p<d;){var E=e[x=f[p]],T=n[x];if(l)var N=u?l(T,E,x,n,e,o):l(E,T,x,e,n,o);if(!(N===void 0?E===T||s(E,T,r,l,o):N)){v=!1;break}S||(S=x=="constructor")}if(v&&!S){var j=e.constructor,C=n.constructor;j==C||!("constructor"in e)||!("constructor"in n)||typeof j=="function"&&j instanceof j&&typeof C=="function"&&C instanceof C||(v=!1)}return o.delete(e),o.delete(n),v},mp=zl(Ea,"DataView"),gp=zl(Ea,"Promise"),xp=zl(Ea,"Set"),bp=zl(Ea,"WeakMap"),oL=Dl(mp),uL=Dl(lo),cL=Dl(gp),fL=Dl(xp),dL=Dl(bp),Nl=zi;(mp&&Nl(new mp(new ArrayBuffer(1)))!="[object DataView]"||lo&&Nl(new lo)!="[object Map]"||gp&&Nl(gp.resolve())!="[object Promise]"||xp&&Nl(new xp)!="[object Set]"||bp&&Nl(new bp)!="[object WeakMap]")&&(Nl=function(e){var n=zi(e),r=n=="[object Object]"?e.constructor:void 0,l=r?Dl(r):"";if(l)switch(l){case oL:return"[object DataView]";case uL:return"[object Map]";case cL:return"[object Promise]";case fL:return"[object Set]";case dL:return"[object WeakMap]"}return n});var x0=Nl,Gu="[object Object]",b0=Object.prototype.hasOwnProperty,hL=function(e,n,r,l,s,o){var u=ka(e),f=ka(n),d=u?"[object Array]":x0(e),p=f?"[object Array]":x0(n),x=(d=d=="[object Arguments]"?Gu:d)==Gu,g=(p=p=="[object Arguments]"?Gu:p)==Gu,y=d==p;if(y&&pp(e)){if(!pp(n))return!1;u=!0,x=!1}if(y&&!x)return o||(o=new Wu),u||Dk(e)?Rk(e,n,r,l,s,o):I6(e,n,d,r,l,s,o);if(!(1&r)){var v=x&&b0.call(e,"__wrapped__"),S=g&&b0.call(n,"__wrapped__");if(v||S){var E=v?e.value():e,T=S?n.value():n;return o||(o=new Wu),s(E,T,r,l,o)}}return!!y&&(o||(o=new Wu),sL(e,n,r,l,s,o))},zk=function e(n,r,l,s,o){return n===r||(n==null||r==null||!Mi(n)&&!Mi(r)?n!=n&&r!=r:hL(n,r,l,s,e,o))},pL=function(e,n,r,l){var s=r.length,o=s;if(e==null)return!o;for(e=Object(e);s--;){var u=r[s];if(u[2]?u[1]!==e[u[0]]:!(u[0]in e))return!1}for(;++s<o;){var f=(u=r[s])[0],d=e[f],p=u[1];if(u[2]){if(d===void 0&&!(f in e))return!1}else{var x=new Wu,g;if(!(g===void 0?zk(p,d,3,l,x):g))return!1}}return!0},Lk=function(e){return e==e&&!cm(e)},mL=function(e){for(var n=dm(e),r=n.length;r--;){var l=n[r],s=e[l];n[r]=[l,s,Lk(s)]}return n},Bk=function(e,n){return function(r){return r!=null&&r[e]===n&&(n!==void 0||e in Object(r))}},gL=function(e){var n=mL(e);return n.length==1&&n[0][2]?Bk(n[0][0],n[0][1]):function(r){return r===e||pL(r,e,n)}},hm=function(e){return typeof e=="symbol"||Mi(e)&&zi(e)=="[object Symbol]"},xL=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,bL=/^\w*$/,pm=function(e,n){if(ka(e))return!1;var r=typeof e;return!(r!="number"&&r!="symbol"&&r!="boolean"&&e!=null&&!hm(e))||bL.test(e)||!xL.test(e)||n!=null&&e in Object(n)};function mm(e,n){if(typeof e!="function"||n!=null&&typeof n!="function")throw new TypeError("Expected a function");var r=function(){var l=arguments,s=n?n.apply(this,l):l[0],o=r.cache;if(o.has(s))return o.get(s);var u=e.apply(this,l);return r.cache=o.set(s,u)||o,u};return r.cache=new(mm.Cache||zc),r}mm.Cache=zc;var yL=mm,vL=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,wL=/\\(\\)?/g,kL=(function(e){var n=yL(e,(function(l){return r.size===500&&r.clear(),l})),r=n.cache;return n})((function(e){var n=[];return e.charCodeAt(0)===46&&n.push(""),e.replace(vL,(function(r,l,s,o){n.push(s?o.replace(wL,"$1"):l||r)})),n})),SL=function(e,n){for(var r=-1,l=e==null?0:e.length,s=Array(l);++r<l;)s[r]=n(e[r],r,e);return s},y0=Qr?Qr.prototype:void 0,v0=y0?y0.toString:void 0,EL=function e(n){if(typeof n=="string")return n;if(ka(n))return SL(n,e)+"";if(hm(n))return v0?v0.call(n):"";var r=n+"";return r=="0"&&1/n==-1/0?"-0":r},NL=function(e){return e==null?"":EL(e)},Ik=function(e,n){return ka(e)?e:pm(e,n)?[e]:kL(NL(e))},Lc=function(e){if(typeof e=="string"||hm(e))return e;var n=e+"";return n=="0"&&1/e==-1/0?"-0":n},Uk=function(e,n){for(var r=0,l=(n=Ik(n,e)).length;e!=null&&r<l;)e=e[Lc(n[r++])];return r&&r==l?e:void 0},_L=function(e,n,r){var l=e==null?void 0:Uk(e,n);return l===void 0?r:l},TL=function(e,n){return e!=null&&n in Object(e)},AL=function(e,n,r){for(var l=-1,s=(n=Ik(n,e)).length,o=!1;++l<s;){var u=Lc(n[l]);if(!(o=e!=null&&r(e,u)))break;e=e[u]}return o||++l!=s?o:!!(s=e==null?0:e.length)&&fm(s)&&Ok(u,s)&&(ka(e)||Mk(e))},CL=function(e,n){return e!=null&&AL(e,n,TL)},RL=function(e,n){return pm(e)&&Lk(n)?Bk(Lc(e),n):function(r){var l=_L(r,e);return l===void 0&&l===n?CL(r,e):zk(n,l,3)}},jL=function(e){return e},ML=function(e){return function(n){return n?.[e]}},OL=function(e){return function(n){return Uk(n,e)}},DL=function(e){return pm(e)?ML(Lc(e)):OL(e)},zL=function(e){return typeof e=="function"?e:e==null?jL:typeof e=="object"?ka(e)?RL(e[0],e[1]):gL(e):DL(e)};function el(e){if(!e)throw new Error("change is not provided");if(ro(e))return"N".concat(e.oldLineNumber);var n=jc(e)?"I":"D";return"".concat(n).concat(e.lineNumber)}um("old");var gm=ao("old"),xm=ao("new");Nk("old");Nk("new");um("new");um("old");var w0=(function(){try{var e=zl(Object,"defineProperty");return e({},"",{}),e}catch{}})(),LL=function(e,n,r){n=="__proto__"&&w0?w0(e,n,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[n]=r},BL=function(e){return function(n,r,l){for(var s=-1,o=Object(n),u=l(n),f=u.length;f--;){var d=u[++s];if(r(o[d],d,o)===!1)break}return n}},IL=BL(),UL=function(e,n){return e&&IL(e,n,dm)},$k=function(e,n){var r={};return n=zL(n),UL(e,(function(l,s,o){LL(r,s,n(l,s,o))})),r},$L=["changeKey","text","tokens","renderToken"],k0=function e(n,r){var l=n.type,s=n.value,o=n.markType,u=n.properties,f=n.className,d=n.children,p=function(g){return h.jsx("span",{className:g,children:s||d&&d.map(e)},r)};switch(l){case"text":return s;case"mark":return p("diff-code-mark diff-code-mark-".concat(o));case"edit":return p("diff-code-edit");default:var x=u&&u.className;return p(dr(f||x))}};function HL(e){if(!Array.isArray(e))return!0;if(e.length>1)return!1;if(e.length===1){var n=wa(e,1)[0];return n.type==="text"&&!n.value}return!0}function PL(e){var n=e.changeKey,r=e.text,l=e.tokens,s=e.renderToken,o=ji(e,$L),u=s?function(f,d){return s(f,k0,d)}:k0;return h.jsx("td",Nn(Nn({},o),{},{"data-change-key":n,children:l?HL(l)?" ":l.map(u):r||" "}))}var Hk=w.memo(PL);function Pk(e,n){return function(){var r=n==="old"?gm(e):xm(e);return r===-1?void 0:r}}function Fk(e,n){return function(r){return e&&r?h.jsx("a",{href:n?"#"+n:void 0,children:r}):r}}function mc(e,n){return n?function(r){e(),n(r)}:e}function S0(e,n,r,l){return w.useMemo((function(){var s=$k(e,(function(o){return function(u){return o&&o(n,u)}}));return s.onMouseEnter=mc(r,s.onMouseEnter),s.onMouseLeave=mc(l,s.onMouseLeave),s}),[e,r,l,n])}function E0(e,n,r,l,s,o,u,f,d){var p={change:n,side:l,inHoverState:f,renderDefault:Pk(n,l),wrapInAnchor:Fk(s,o)};return h.jsx("td",Nn(Nn({className:e},u),{},{"data-change-key":r,children:d(p)}))}function FL(e){var n,r,l,s=e.change,o=e.selected,u=e.tokens,f=e.className,d=e.generateLineClassName,p=e.gutterClassName,x=e.codeClassName,g=e.gutterEvents,y=e.codeEvents,v=e.hideGutter,S=e.gutterAnchor,E=e.generateAnchorID,T=e.renderToken,N=e.renderGutter,j=s.type,C=s.content,I=el(s),U=(n=wa(w.useState(!1),2),r=n[0],l=n[1],[r,w.useCallback((function(){return l(!0)}),[]),w.useCallback((function(){return l(!1)}),[])]),_=wa(U,3),z=_[0],P=_[1],X=_[2],B=w.useMemo((function(){return{change:s}}),[s]),q=S0(g,B,P,X),Z=S0(y,B,P,X),ee=E(s),ae=d({changes:[s],defaultGenerate:function(){return f}}),Y=dr("diff-gutter","diff-gutter-".concat(j),p,{"diff-gutter-selected":o}),M=dr("diff-code","diff-code-".concat(j),x,{"diff-code-selected":o});return h.jsxs("tr",{id:ee,className:dr("diff-line",ae),children:[!v&&E0(Y,s,I,"old",S,ee,q,z,N),!v&&E0(Y,s,I,"new",S,ee,q,z,N),h.jsx(Hk,Nn({className:M,changeKey:I,text:C,tokens:u,renderToken:T},Z))]})}var GL=w.memo(FL);function qL(e){var n=e.hideGutter,r=e.element;return h.jsx("tr",{className:"diff-widget",children:h.jsx("td",{colSpan:n?1:3,className:"diff-widget-content",children:r})})}var YL=["hideGutter","selectedChanges","tokens","lineClassName"],VL=["hunk","widgets","className"];function XL(e){var n=e.hunk,r=e.widgets,l=e.className,s=ji(e,VL),o=(function(u,f){return u.reduce((function(d,p){var x=el(p);d.push(["change",x,p]);var g=f[x];return g&&d.push(["widget",x,g]),d}),[])})(n.changes,r);return h.jsx("tbody",{className:dr("diff-hunk",l),children:o.map((function(u){return(function(f,d){var p=wa(f,3),x=p[0],g=p[1],y=p[2],v=d.hideGutter,S=d.selectedChanges,E=d.tokens,T=d.lineClassName,N=ji(d,YL);if(x==="change"){var j=no(y)?"old":"new",C=no(y)?gm(y):xm(y),I=E?E[j][C-1]:null;return h.jsx(GL,Nn({className:T,change:y,hideGutter:v,selected:S.includes(g),tokens:I},N),"change".concat(g))}return x==="widget"?h.jsx(qL,{hideGutter:v,element:y},"widget".concat(g)):null})(u,s)}))})}var Gk=0;function qu(e,n,r,l){var s=w.useCallback((function(){return n(e)}),[e,n]),o=w.useCallback((function(){return n("")}),[n]);return w.useMemo((function(){var u=$k(l,(function(f){return function(d){return f&&f({side:e,change:r},d)}}));return u.onMouseEnter=mc(s,u.onMouseEnter),u.onMouseLeave=mc(o,u.onMouseLeave),u}),[r,l,s,e,o])}function Dh(e){var n=e.change,r=e.side,l=e.selected,s=e.tokens,o=e.gutterClassName,u=e.codeClassName,f=e.gutterEvents,d=e.codeEvents,p=e.anchorID,x=e.gutterAnchor,g=e.gutterAnchorTarget,y=e.hideGutter,v=e.hover,S=e.renderToken,E=e.renderGutter;if(!n){var T=dr("diff-gutter","diff-gutter-omit",o),N=dr("diff-code","diff-code-omit",u);return[!y&&h.jsx("td",{className:T},"gutter"),h.jsx("td",{className:N},"code")]}var j=n.type,C=n.content,I=el(n),U=r===Gk?"old":"new",_=Nn({id:p||void 0,className:dr("diff-gutter","diff-gutter-".concat(j),fp({"diff-gutter-selected":l},"diff-line-hover-"+U,v),o),children:E({change:n,side:U,inHoverState:v,renderDefault:Pk(n,U),wrapInAnchor:Fk(x,g)})},f),z=dr("diff-code","diff-code-".concat(j),fp({"diff-code-selected":l},"diff-line-hover-"+U,v),u);return[!y&&h.jsx("td",Nn(Nn({},_),{},{"data-change-key":I}),"gutter"),h.jsx(Hk,Nn({className:z,changeKey:I,text:C,tokens:s,renderToken:S},d),"code")]}function KL(e){var n=e.className,r=e.oldChange,l=e.newChange,s=e.oldSelected,o=e.newSelected,u=e.oldTokens,f=e.newTokens,d=e.monotonous,p=e.gutterClassName,x=e.codeClassName,g=e.gutterEvents,y=e.codeEvents,v=e.hideGutter,S=e.generateAnchorID,E=e.generateLineClassName,T=e.gutterAnchor,N=e.renderToken,j=e.renderGutter,C=wa(w.useState(""),2),I=C[0],U=C[1],_=qu("old",U,r,g),z=qu("new",U,l,g),P=qu("old",U,r,y),X=qu("new",U,l,y),B=r&&S(r),q=l&&S(l),Z=E({changes:[r,l],defaultGenerate:function(){return n}}),ee={monotonous:d,hideGutter:v,gutterClassName:p,codeClassName:x,gutterEvents:g,codeEvents:y,renderToken:N,renderGutter:j},ae=Nn(Nn({},ee),{},{change:r,side:Gk,selected:s,tokens:u,gutterEvents:_,codeEvents:P,anchorID:B,gutterAnchor:T,gutterAnchorTarget:B,hover:I==="old"}),Y=Nn(Nn({},ee),{},{change:l,side:1,selected:o,tokens:f,gutterEvents:z,codeEvents:X,anchorID:r===l?null:q,gutterAnchor:T,gutterAnchorTarget:r===l?B:q,hover:I==="new"});if(d)return h.jsx("tr",{className:dr("diff-line",Z),children:Dh(r?ae:Y)});var M=(function(K,le){return K&&!le?"diff-line-old-only":!K&&le?"diff-line-new-only":K===le?"diff-line-normal":"diff-line-compare"})(r,l);return h.jsxs("tr",{className:dr("diff-line",M,Z),children:[Dh(ae),Dh(Y)]})}var ZL=w.memo(KL);function QL(e){var n=e.hideGutter,r=e.oldElement,l=e.newElement;return e.monotonous?h.jsx("tr",{className:"diff-widget",children:h.jsx("td",{colSpan:n?1:2,className:"diff-widget-content",children:r||l})}):r===l?h.jsx("tr",{className:"diff-widget",children:h.jsx("td",{colSpan:n?2:4,className:"diff-widget-content",children:r})}):h.jsxs("tr",{className:"diff-widget",children:[h.jsx("td",{colSpan:n?1:2,className:"diff-widget-content",children:r}),h.jsx("td",{colSpan:n?1:2,className:"diff-widget-content",children:l})]})}var WL=["selectedChanges","monotonous","hideGutter","tokens","lineClassName"],JL=["hunk","widgets","className"];function Yu(e,n){return(e?el(e):"00")+(n?el(n):"00")}function e9(e){var n=e.hunk,r=e.widgets,l=e.className,s=ji(e,JL),o=(function(u,f){for(var d=function(N){if(!N)return null;var j=el(N);return f[j]||null},p=[],x=0;x<u.length;x++){var g=u[x];if(ro(g))p.push(["change",Yu(g,g),g,g]);else if(no(g)){var y=u[x+1];y&&jc(y)?(x+=1,p.push(["change",Yu(g,y),g,y])):p.push(["change",Yu(g,null),g,null])}else p.push(["change",Yu(null,g),null,g]);var v=p[p.length-1],S=d(v[2]),E=d(v[3]);if(S||E){var T=v[1];p.push(["widget",T,S,E])}}return p})(n.changes,r);return h.jsx("tbody",{className:dr("diff-hunk",l),children:o.map((function(u){return(function(f,d){var p=wa(f,4),x=p[0],g=p[1],y=p[2],v=p[3],S=d.selectedChanges,E=d.monotonous,T=d.hideGutter,N=d.tokens,j=d.lineClassName,C=ji(d,WL);if(x==="change"){var I=!!y&&S.includes(el(y)),U=!!v&&S.includes(el(v)),_=y&&N?N.old[gm(y)-1]:null,z=v&&N?N.new[xm(v)-1]:null;return h.jsx(ZL,Nn({className:j,oldChange:y,newChange:v,monotonous:E,hideGutter:T,oldSelected:I,newSelected:U,oldTokens:_,newTokens:z},C),"change".concat(g))}return x==="widget"?h.jsx(QL,{monotonous:E,hideGutter:T,oldElement:y,newElement:v},"widget".concat(g)):null})(u,s)}))})}var t9=["gutterType","hunkClassName"];function qk(e){var n=e.hunk,r=Hz(),l=r.gutterType,s=r.hunkClassName,o=ji(r,t9),u=l==="none",f=l==="anchor",d=o.viewType==="unified"?XL:e9;return h.jsx(d,Nn(Nn({},o),{},{hunk:n,hideGutter:u,gutterAnchor:f,className:s}))}function n9(){}function N0(e,n){var r=n?"auto":"none";e instanceof HTMLElement&&e.style.userSelect!==r&&(e.style.userSelect=r)}function r9(e){return e.map((function(n){return h.jsx(qk,{hunk:n},(function(r){return"-".concat(r.oldStart,",").concat(r.oldLines," +").concat(r.newStart,",").concat(r.newLines)})(n))}))}function a9(e){var n=e.diffType,r=e.hunks,l=e.optimizeSelection,s=e.className,o=e.hunkClassName,u=o===void 0?Wn.hunkClassName:o,f=e.lineClassName,d=f===void 0?Wn.lineClassName:f,p=e.generateLineClassName,x=p===void 0?Wn.generateLineClassName:p,g=e.gutterClassName,y=g===void 0?Wn.gutterClassName:g,v=e.codeClassName,S=v===void 0?Wn.codeClassName:v,E=e.gutterType,T=E===void 0?Wn.gutterType:E,N=e.viewType,j=N===void 0?Wn.viewType:N,C=e.gutterEvents,I=C===void 0?Wn.gutterEvents:C,U=e.codeEvents,_=U===void 0?Wn.codeEvents:U,z=e.generateAnchorID,P=z===void 0?Wn.generateAnchorID:z,X=e.selectedChanges,B=X===void 0?Wn.selectedChanges:X,q=e.widgets,Z=q===void 0?Wn.widgets:q,ee=e.renderGutter,ae=ee===void 0?Wn.renderGutter:ee,Y=e.tokens,M=e.renderToken,K=e.children,le=K===void 0?r9:K,be=w.useRef(null),O=w.useCallback((function(ie){var Se=ie.target;if(ie.button===0){var je=(function(he,xe){for(var _e=he;_e&&_e!==document.documentElement&&!_e.classList.contains(xe);)_e=_e.parentElement;return _e===document.documentElement?null:_e})(Se,"diff-code");if(je&&je.parentElement){var Ae=window.getSelection();Ae&&Ae.removeAllRanges();var qe=zz(je.parentElement.children).indexOf(je);if(qe===1||qe===3){var we,Ve=Uz(be.current?be.current.querySelectorAll(".diff-line"):[]);try{for(Ve.s();!(we=Ve.n()).done;){var Lt=we.value.children;N0(Lt[1],qe===1),N0(Lt[3],qe===3)}}catch(he){Ve.e(he)}finally{Ve.f()}}}}}),[]),D=T==="none",L=n==="add"||n==="delete",A=j==="split"&&!L&&l?O:n9,se=w.useMemo((function(){return h.jsxs("colgroup",j==="unified"?{children:[!D&&h.jsx("col",{className:"diff-gutter-col"}),!D&&h.jsx("col",{className:"diff-gutter-col"}),h.jsx("col",{})]}:L?{children:[!D&&h.jsx("col",{className:"diff-gutter-col"}),h.jsx("col",{})]}:{children:[!D&&h.jsx("col",{className:"diff-gutter-col"}),h.jsx("col",{}),!D&&h.jsx("col",{className:"diff-gutter-col"}),h.jsx("col",{})]})}),[j,L,D]),te=w.useMemo((function(){return{hunkClassName:u,lineClassName:d,generateLineClassName:x,gutterClassName:y,codeClassName:S,monotonous:L,hideGutter:D,viewType:j,gutterType:T,codeEvents:_,gutterEvents:I,generateAnchorID:P,selectedChanges:B,widgets:Z,renderGutter:ae,tokens:Y,renderToken:M}}),[S,_,P,y,I,T,D,u,d,x,L,ae,M,B,Y,j,Z]);return h.jsx($z,{value:te,children:h.jsxs("table",{ref:be,className:dr("diff","diff-".concat(j),s),onMouseDown:A,children:[se,le(r)]})})}var l9=w.memo(a9);Qr&&Qr.isConcatSpreadable;var bm=xo((function(e){var n=function(){this.Diff_Timeout=1,this.Diff_EditCost=4,this.Match_Threshold=.5,this.Match_Distance=1e3,this.Patch_DeleteThreshold=.5,this.Patch_Margin=4,this.Match_MaxBits=32};n.Diff=function(r,l){return[r,l]},n.prototype.diff_main=function(r,l,s,o){o===void 0&&(o=this.Diff_Timeout<=0?Number.MAX_VALUE:new Date().getTime()+1e3*this.Diff_Timeout);var u=o;if(r==null||l==null)throw new Error("Null input. (diff_main)");if(r==l)return r?[new n.Diff(0,r)]:[];s===void 0&&(s=!0);var f=s,d=this.diff_commonPrefix(r,l),p=r.substring(0,d);r=r.substring(d),l=l.substring(d),d=this.diff_commonSuffix(r,l);var x=r.substring(r.length-d);r=r.substring(0,r.length-d),l=l.substring(0,l.length-d);var g=this.diff_compute_(r,l,f,u);return p&&g.unshift(new n.Diff(0,p)),x&&g.push(new n.Diff(0,x)),this.diff_cleanupMerge(g),g},n.prototype.diff_compute_=function(r,l,s,o){var u;if(!r)return[new n.Diff(1,l)];if(!l)return[new n.Diff(-1,r)];var f=r.length>l.length?r:l,d=r.length>l.length?l:r,p=f.indexOf(d);if(p!=-1)return u=[new n.Diff(1,f.substring(0,p)),new n.Diff(0,d),new n.Diff(1,f.substring(p+d.length))],r.length>l.length&&(u[0][0]=u[2][0]=-1),u;if(d.length==1)return[new n.Diff(-1,r),new n.Diff(1,l)];var x=this.diff_halfMatch_(r,l);if(x){var g=x[0],y=x[1],v=x[2],S=x[3],E=x[4],T=this.diff_main(g,v,s,o),N=this.diff_main(y,S,s,o);return T.concat([new n.Diff(0,E)],N)}return s&&r.length>100&&l.length>100?this.diff_lineMode_(r,l,o):this.diff_bisect_(r,l,o)},n.prototype.diff_lineMode_=function(r,l,s){var o=this.diff_linesToChars_(r,l);r=o.chars1,l=o.chars2;var u=o.lineArray,f=this.diff_main(r,l,!1,s);this.diff_charsToLines_(f,u),this.diff_cleanupSemantic(f),f.push(new n.Diff(0,""));for(var d=0,p=0,x=0,g="",y="";d<f.length;){switch(f[d][0]){case 1:x++,y+=f[d][1];break;case-1:p++,g+=f[d][1];break;case 0:if(p>=1&&x>=1){f.splice(d-p-x,p+x),d=d-p-x;for(var v=this.diff_main(g,y,!1,s),S=v.length-1;S>=0;S--)f.splice(d,0,v[S]);d+=v.length}x=0,p=0,g="",y=""}d++}return f.pop(),f},n.prototype.diff_bisect_=function(r,l,s){for(var o=r.length,u=l.length,f=Math.ceil((o+u)/2),d=f,p=2*f,x=new Array(p),g=new Array(p),y=0;y<p;y++)x[y]=-1,g[y]=-1;x[d+1]=0,g[d+1]=0;for(var v=o-u,S=v%2!=0,E=0,T=0,N=0,j=0,C=0;C<f&&!(new Date().getTime()>s);C++){for(var I=-C+E;I<=C-T;I+=2){for(var U=d+I,_=(q=I==-C||I!=C&&x[U-1]<x[U+1]?x[U+1]:x[U-1]+1)-I;q<o&&_<u&&r.charAt(q)==l.charAt(_);)q++,_++;if(x[U]=q,q>o)T+=2;else if(_>u)E+=2;else if(S&&(X=d+v-I)>=0&&X<p&&g[X]!=-1&&q>=(P=o-g[X]))return this.diff_bisectSplit_(r,l,q,_,s)}for(var z=-C+N;z<=C-j;z+=2){for(var P,X=d+z,B=(P=z==-C||z!=C&&g[X-1]<g[X+1]?g[X+1]:g[X-1]+1)-z;P<o&&B<u&&r.charAt(o-P-1)==l.charAt(u-B-1);)P++,B++;if(g[X]=P,P>o)j+=2;else if(B>u)N+=2;else if(!S&&(U=d+v-z)>=0&&U<p&&x[U]!=-1){var q;if(_=d+(q=x[U])-U,q>=(P=o-P))return this.diff_bisectSplit_(r,l,q,_,s)}}}return[new n.Diff(-1,r),new n.Diff(1,l)]},n.prototype.diff_bisectSplit_=function(r,l,s,o,u){var f=r.substring(0,s),d=l.substring(0,o),p=r.substring(s),x=l.substring(o),g=this.diff_main(f,d,!1,u),y=this.diff_main(p,x,!1,u);return g.concat(y)},n.prototype.diff_linesToChars_=function(r,l){var s=[],o={};function u(p){for(var x="",g=0,y=-1,v=s.length;y<p.length-1;){(y=p.indexOf(`
|
|
177
|
+
`,g))==-1&&(y=p.length-1);var S=p.substring(g,y+1);(o.hasOwnProperty?o.hasOwnProperty(S):o[S]!==void 0)?x+=String.fromCharCode(o[S]):(v==f&&(S=p.substring(g),y=p.length),x+=String.fromCharCode(v),o[S]=v,s[v++]=S),g=y+1}return x}s[0]="";var f=4e4,d=u(r);return f=65535,{chars1:d,chars2:u(l),lineArray:s}},n.prototype.diff_charsToLines_=function(r,l){for(var s=0;s<r.length;s++){for(var o=r[s][1],u=[],f=0;f<o.length;f++)u[f]=l[o.charCodeAt(f)];r[s][1]=u.join("")}},n.prototype.diff_commonPrefix=function(r,l){if(!r||!l||r.charAt(0)!=l.charAt(0))return 0;for(var s=0,o=Math.min(r.length,l.length),u=o,f=0;s<u;)r.substring(f,u)==l.substring(f,u)?f=s=u:o=u,u=Math.floor((o-s)/2+s);return u},n.prototype.diff_commonSuffix=function(r,l){if(!r||!l||r.charAt(r.length-1)!=l.charAt(l.length-1))return 0;for(var s=0,o=Math.min(r.length,l.length),u=o,f=0;s<u;)r.substring(r.length-u,r.length-f)==l.substring(l.length-u,l.length-f)?f=s=u:o=u,u=Math.floor((o-s)/2+s);return u},n.prototype.diff_commonOverlap_=function(r,l){var s=r.length,o=l.length;if(s==0||o==0)return 0;s>o?r=r.substring(s-o):s<o&&(l=l.substring(0,s));var u=Math.min(s,o);if(r==l)return u;for(var f=0,d=1;;){var p=r.substring(u-d),x=l.indexOf(p);if(x==-1)return f;d+=x,x!=0&&r.substring(u-d)!=l.substring(0,d)||(f=d,d++)}},n.prototype.diff_halfMatch_=function(r,l){if(this.Diff_Timeout<=0)return null;var s=r.length>l.length?r:l,o=r.length>l.length?l:r;if(s.length<4||2*o.length<s.length)return null;var u=this;function f(E,T,N){for(var j,C,I,U,_=E.substring(N,N+Math.floor(E.length/4)),z=-1,P="";(z=T.indexOf(_,z+1))!=-1;){var X=u.diff_commonPrefix(E.substring(N),T.substring(z)),B=u.diff_commonSuffix(E.substring(0,N),T.substring(0,z));P.length<B+X&&(P=T.substring(z-B,z)+T.substring(z,z+X),j=E.substring(0,N-B),C=E.substring(N+X),I=T.substring(0,z-B),U=T.substring(z+X))}return 2*P.length>=E.length?[j,C,I,U,P]:null}var d,p,x,g,y,v=f(s,o,Math.ceil(s.length/4)),S=f(s,o,Math.ceil(s.length/2));return v||S?(d=S?v&&v[4].length>S[4].length?v:S:v,r.length>l.length?(p=d[0],x=d[1],g=d[2],y=d[3]):(g=d[0],y=d[1],p=d[2],x=d[3]),[p,x,g,y,d[4]]):null},n.prototype.diff_cleanupSemantic=function(r){for(var l=!1,s=[],o=0,u=null,f=0,d=0,p=0,x=0,g=0;f<r.length;)r[f][0]==0?(s[o++]=f,d=x,p=g,x=0,g=0,u=r[f][1]):(r[f][0]==1?x+=r[f][1].length:g+=r[f][1].length,u&&u.length<=Math.max(d,p)&&u.length<=Math.max(x,g)&&(r.splice(s[o-1],0,new n.Diff(-1,u)),r[s[o-1]+1][0]=1,o--,f=--o>0?s[o-1]:-1,d=0,p=0,x=0,g=0,u=null,l=!0)),f++;for(l&&this.diff_cleanupMerge(r),this.diff_cleanupSemanticLossless(r),f=1;f<r.length;){if(r[f-1][0]==-1&&r[f][0]==1){var y=r[f-1][1],v=r[f][1],S=this.diff_commonOverlap_(y,v),E=this.diff_commonOverlap_(v,y);S>=E?(S>=y.length/2||S>=v.length/2)&&(r.splice(f,0,new n.Diff(0,v.substring(0,S))),r[f-1][1]=y.substring(0,y.length-S),r[f+1][1]=v.substring(S),f++):(E>=y.length/2||E>=v.length/2)&&(r.splice(f,0,new n.Diff(0,y.substring(0,E))),r[f-1][0]=1,r[f-1][1]=v.substring(0,v.length-E),r[f+1][0]=-1,r[f+1][1]=y.substring(E),f++),f++}f++}},n.prototype.diff_cleanupSemanticLossless=function(r){function l(E,T){if(!E||!T)return 6;var N=E.charAt(E.length-1),j=T.charAt(0),C=N.match(n.nonAlphaNumericRegex_),I=j.match(n.nonAlphaNumericRegex_),U=C&&N.match(n.whitespaceRegex_),_=I&&j.match(n.whitespaceRegex_),z=U&&N.match(n.linebreakRegex_),P=_&&j.match(n.linebreakRegex_),X=z&&E.match(n.blanklineEndRegex_),B=P&&T.match(n.blanklineStartRegex_);return X||B?5:z||P?4:C&&!U&&_?3:U||_?2:C||I?1:0}for(var s=1;s<r.length-1;){if(r[s-1][0]==0&&r[s+1][0]==0){var o=r[s-1][1],u=r[s][1],f=r[s+1][1],d=this.diff_commonSuffix(o,u);if(d){var p=u.substring(u.length-d);o=o.substring(0,o.length-d),u=p+u.substring(0,u.length-d),f=p+f}for(var x=o,g=u,y=f,v=l(o,u)+l(u,f);u.charAt(0)===f.charAt(0);){o+=u.charAt(0),u=u.substring(1)+f.charAt(0),f=f.substring(1);var S=l(o,u)+l(u,f);S>=v&&(v=S,x=o,g=u,y=f)}r[s-1][1]!=x&&(x?r[s-1][1]=x:(r.splice(s-1,1),s--),r[s][1]=g,y?r[s+1][1]=y:(r.splice(s+1,1),s--))}s++}},n.nonAlphaNumericRegex_=/[^a-zA-Z0-9]/,n.whitespaceRegex_=/\s/,n.linebreakRegex_=/[\r\n]/,n.blanklineEndRegex_=/\n\r?\n$/,n.blanklineStartRegex_=/^\r?\n\r?\n/,n.prototype.diff_cleanupEfficiency=function(r){for(var l=!1,s=[],o=0,u=null,f=0,d=!1,p=!1,x=!1,g=!1;f<r.length;)r[f][0]==0?(r[f][1].length<this.Diff_EditCost&&(x||g)?(s[o++]=f,d=x,p=g,u=r[f][1]):(o=0,u=null),x=g=!1):(r[f][0]==-1?g=!0:x=!0,u&&(d&&p&&x&&g||u.length<this.Diff_EditCost/2&&d+p+x+g==3)&&(r.splice(s[o-1],0,new n.Diff(-1,u)),r[s[o-1]+1][0]=1,o--,u=null,d&&p?(x=g=!0,o=0):(f=--o>0?s[o-1]:-1,x=g=!1),l=!0)),f++;l&&this.diff_cleanupMerge(r)},n.prototype.diff_cleanupMerge=function(r){r.push(new n.Diff(0,""));for(var l,s=0,o=0,u=0,f="",d="";s<r.length;)switch(r[s][0]){case 1:u++,d+=r[s][1],s++;break;case-1:o++,f+=r[s][1],s++;break;case 0:o+u>1?(o!==0&&u!==0&&((l=this.diff_commonPrefix(d,f))!==0&&(s-o-u>0&&r[s-o-u-1][0]==0?r[s-o-u-1][1]+=d.substring(0,l):(r.splice(0,0,new n.Diff(0,d.substring(0,l))),s++),d=d.substring(l),f=f.substring(l)),(l=this.diff_commonSuffix(d,f))!==0&&(r[s][1]=d.substring(d.length-l)+r[s][1],d=d.substring(0,d.length-l),f=f.substring(0,f.length-l))),s-=o+u,r.splice(s,o+u),f.length&&(r.splice(s,0,new n.Diff(-1,f)),s++),d.length&&(r.splice(s,0,new n.Diff(1,d)),s++),s++):s!==0&&r[s-1][0]==0?(r[s-1][1]+=r[s][1],r.splice(s,1)):s++,u=0,o=0,f="",d=""}r[r.length-1][1]===""&&r.pop();var p=!1;for(s=1;s<r.length-1;)r[s-1][0]==0&&r[s+1][0]==0&&(r[s][1].substring(r[s][1].length-r[s-1][1].length)==r[s-1][1]?(r[s][1]=r[s-1][1]+r[s][1].substring(0,r[s][1].length-r[s-1][1].length),r[s+1][1]=r[s-1][1]+r[s+1][1],r.splice(s-1,1),p=!0):r[s][1].substring(0,r[s+1][1].length)==r[s+1][1]&&(r[s-1][1]+=r[s+1][1],r[s][1]=r[s][1].substring(r[s+1][1].length)+r[s+1][1],r.splice(s+1,1),p=!0)),s++;p&&this.diff_cleanupMerge(r)},n.prototype.diff_xIndex=function(r,l){var s,o=0,u=0,f=0,d=0;for(s=0;s<r.length&&(r[s][0]!==1&&(o+=r[s][1].length),r[s][0]!==-1&&(u+=r[s][1].length),!(o>l));s++)f=o,d=u;return r.length!=s&&r[s][0]===-1?d:d+(l-f)},n.prototype.diff_prettyHtml=function(r){for(var l=[],s=/&/g,o=/</g,u=/>/g,f=/\n/g,d=0;d<r.length;d++){var p=r[d][0],x=r[d][1].replace(s,"&").replace(o,"<").replace(u,">").replace(f,"¶<br>");switch(p){case 1:l[d]='<ins style="background:#e6ffe6;">'+x+"</ins>";break;case-1:l[d]='<del style="background:#ffe6e6;">'+x+"</del>";break;case 0:l[d]="<span>"+x+"</span>"}}return l.join("")},n.prototype.diff_text1=function(r){for(var l=[],s=0;s<r.length;s++)r[s][0]!==1&&(l[s]=r[s][1]);return l.join("")},n.prototype.diff_text2=function(r){for(var l=[],s=0;s<r.length;s++)r[s][0]!==-1&&(l[s]=r[s][1]);return l.join("")},n.prototype.diff_levenshtein=function(r){for(var l=0,s=0,o=0,u=0;u<r.length;u++){var f=r[u][0],d=r[u][1];switch(f){case 1:s+=d.length;break;case-1:o+=d.length;break;case 0:l+=Math.max(s,o),s=0,o=0}}return l+=Math.max(s,o)},n.prototype.diff_toDelta=function(r){for(var l=[],s=0;s<r.length;s++)switch(r[s][0]){case 1:l[s]="+"+encodeURI(r[s][1]);break;case-1:l[s]="-"+r[s][1].length;break;case 0:l[s]="="+r[s][1].length}return l.join(" ").replace(/%20/g," ")},n.prototype.diff_fromDelta=function(r,l){for(var s=[],o=0,u=0,f=l.split(/\t/g),d=0;d<f.length;d++){var p=f[d].substring(1);switch(f[d].charAt(0)){case"+":try{s[o++]=new n.Diff(1,decodeURI(p))}catch{throw new Error("Illegal escape in diff_fromDelta: "+p)}break;case"-":case"=":var x=parseInt(p,10);if(isNaN(x)||x<0)throw new Error("Invalid number in diff_fromDelta: "+p);var g=r.substring(u,u+=x);f[d].charAt(0)=="="?s[o++]=new n.Diff(0,g):s[o++]=new n.Diff(-1,g);break;default:if(f[d])throw new Error("Invalid diff operation in diff_fromDelta: "+f[d])}}if(u!=r.length)throw new Error("Delta length ("+u+") does not equal source text length ("+r.length+").");return s},n.prototype.match_main=function(r,l,s){if(r==null||l==null||s==null)throw new Error("Null input. (match_main)");return s=Math.max(0,Math.min(s,r.length)),r==l?0:r.length?r.substring(s,s+l.length)==l?s:this.match_bitap_(r,l,s):-1},n.prototype.match_bitap_=function(r,l,s){if(l.length>this.Match_MaxBits)throw new Error("Pattern too long for this browser.");var o=this.match_alphabet_(l),u=this;function f(_,z){var P=_/l.length,X=Math.abs(s-z);return u.Match_Distance?P+X/u.Match_Distance:X?1:P}var d=this.Match_Threshold,p=r.indexOf(l,s);p!=-1&&(d=Math.min(f(0,p),d),(p=r.lastIndexOf(l,s+l.length))!=-1&&(d=Math.min(f(0,p),d)));var x,g,y=1<<l.length-1;p=-1;for(var v,S=l.length+r.length,E=0;E<l.length;E++){for(x=0,g=S;x<g;)f(E,s+g)<=d?x=g:S=g,g=Math.floor((S-x)/2+x);S=g;var T=Math.max(1,s-g+1),N=Math.min(s+g,r.length)+l.length,j=Array(N+2);j[N+1]=(1<<E)-1;for(var C=N;C>=T;C--){var I=o[r.charAt(C-1)];if(j[C]=E===0?(j[C+1]<<1|1)&I:(j[C+1]<<1|1)&I|(v[C+1]|v[C])<<1|1|v[C+1],j[C]&y){var U=f(E,C-1);if(U<=d){if(d=U,!((p=C-1)>s))break;T=Math.max(1,2*s-p)}}}if(f(E+1,s)>d)break;v=j}return p},n.prototype.match_alphabet_=function(r){for(var l={},s=0;s<r.length;s++)l[r.charAt(s)]=0;for(s=0;s<r.length;s++)l[r.charAt(s)]|=1<<r.length-s-1;return l},n.prototype.patch_addContext_=function(r,l){if(l.length!=0){if(r.start2===null)throw Error("patch not initialized");for(var s=l.substring(r.start2,r.start2+r.length1),o=0;l.indexOf(s)!=l.lastIndexOf(s)&&s.length<this.Match_MaxBits-this.Patch_Margin-this.Patch_Margin;)o+=this.Patch_Margin,s=l.substring(r.start2-o,r.start2+r.length1+o);o+=this.Patch_Margin;var u=l.substring(r.start2-o,r.start2);u&&r.diffs.unshift(new n.Diff(0,u));var f=l.substring(r.start2+r.length1,r.start2+r.length1+o);f&&r.diffs.push(new n.Diff(0,f)),r.start1-=u.length,r.start2-=u.length,r.length1+=u.length+f.length,r.length2+=u.length+f.length}},n.prototype.patch_make=function(r,l,s){var o,u;if(typeof r=="string"&&typeof l=="string"&&s===void 0)o=r,(u=this.diff_main(o,l,!0)).length>2&&(this.diff_cleanupSemantic(u),this.diff_cleanupEfficiency(u));else if(r&&typeof r=="object"&&l===void 0&&s===void 0)u=r,o=this.diff_text1(u);else if(typeof r=="string"&&l&&typeof l=="object"&&s===void 0)o=r,u=l;else{if(typeof r!="string"||typeof l!="string"||!s||typeof s!="object")throw new Error("Unknown call format to patch_make.");o=r,u=s}if(u.length===0)return[];for(var f=[],d=new n.patch_obj,p=0,x=0,g=0,y=o,v=o,S=0;S<u.length;S++){var E=u[S][0],T=u[S][1];switch(p||E===0||(d.start1=x,d.start2=g),E){case 1:d.diffs[p++]=u[S],d.length2+=T.length,v=v.substring(0,g)+T+v.substring(g);break;case-1:d.length1+=T.length,d.diffs[p++]=u[S],v=v.substring(0,g)+v.substring(g+T.length);break;case 0:T.length<=2*this.Patch_Margin&&p&&u.length!=S+1?(d.diffs[p++]=u[S],d.length1+=T.length,d.length2+=T.length):T.length>=2*this.Patch_Margin&&p&&(this.patch_addContext_(d,y),f.push(d),d=new n.patch_obj,p=0,y=v,x=g)}E!==1&&(x+=T.length),E!==-1&&(g+=T.length)}return p&&(this.patch_addContext_(d,y),f.push(d)),f},n.prototype.patch_deepCopy=function(r){for(var l=[],s=0;s<r.length;s++){var o=r[s],u=new n.patch_obj;u.diffs=[];for(var f=0;f<o.diffs.length;f++)u.diffs[f]=new n.Diff(o.diffs[f][0],o.diffs[f][1]);u.start1=o.start1,u.start2=o.start2,u.length1=o.length1,u.length2=o.length2,l[s]=u}return l},n.prototype.patch_apply=function(r,l){if(r.length==0)return[l,[]];r=this.patch_deepCopy(r);var s=this.patch_addPadding(r);l=s+l+s,this.patch_splitMax(r);for(var o=0,u=[],f=0;f<r.length;f++){var d,p,x=r[f].start2+o,g=this.diff_text1(r[f].diffs),y=-1;if(g.length>this.Match_MaxBits?(d=this.match_main(l,g.substring(0,this.Match_MaxBits),x))!=-1&&((y=this.match_main(l,g.substring(g.length-this.Match_MaxBits),x+g.length-this.Match_MaxBits))==-1||d>=y)&&(d=-1):d=this.match_main(l,g,x),d==-1)u[f]=!1,o-=r[f].length2-r[f].length1;else if(u[f]=!0,o=d-x,g==(p=y==-1?l.substring(d,d+g.length):l.substring(d,y+this.Match_MaxBits)))l=l.substring(0,d)+this.diff_text2(r[f].diffs)+l.substring(d+g.length);else{var v=this.diff_main(g,p,!1);if(g.length>this.Match_MaxBits&&this.diff_levenshtein(v)/g.length>this.Patch_DeleteThreshold)u[f]=!1;else{this.diff_cleanupSemanticLossless(v);for(var S,E=0,T=0;T<r[f].diffs.length;T++){var N=r[f].diffs[T];N[0]!==0&&(S=this.diff_xIndex(v,E)),N[0]===1?l=l.substring(0,d+S)+N[1]+l.substring(d+S):N[0]===-1&&(l=l.substring(0,d+S)+l.substring(d+this.diff_xIndex(v,E+N[1].length))),N[0]!==-1&&(E+=N[1].length)}}}}return[l=l.substring(s.length,l.length-s.length),u]},n.prototype.patch_addPadding=function(r){for(var l=this.Patch_Margin,s="",o=1;o<=l;o++)s+=String.fromCharCode(o);for(o=0;o<r.length;o++)r[o].start1+=l,r[o].start2+=l;var u=r[0],f=u.diffs;if(f.length==0||f[0][0]!=0)f.unshift(new n.Diff(0,s)),u.start1-=l,u.start2-=l,u.length1+=l,u.length2+=l;else if(l>f[0][1].length){var d=l-f[0][1].length;f[0][1]=s.substring(f[0][1].length)+f[0][1],u.start1-=d,u.start2-=d,u.length1+=d,u.length2+=d}return(f=(u=r[r.length-1]).diffs).length==0||f[f.length-1][0]!=0?(f.push(new n.Diff(0,s)),u.length1+=l,u.length2+=l):l>f[f.length-1][1].length&&(d=l-f[f.length-1][1].length,f[f.length-1][1]+=s.substring(0,d),u.length1+=d,u.length2+=d),s},n.prototype.patch_splitMax=function(r){for(var l=this.Match_MaxBits,s=0;s<r.length;s++)if(!(r[s].length1<=l)){var o=r[s];r.splice(s--,1);for(var u=o.start1,f=o.start2,d="";o.diffs.length!==0;){var p=new n.patch_obj,x=!0;for(p.start1=u-d.length,p.start2=f-d.length,d!==""&&(p.length1=p.length2=d.length,p.diffs.push(new n.Diff(0,d)));o.diffs.length!==0&&p.length1<l-this.Patch_Margin;){var g=o.diffs[0][0],y=o.diffs[0][1];g===1?(p.length2+=y.length,f+=y.length,p.diffs.push(o.diffs.shift()),x=!1):g===-1&&p.diffs.length==1&&p.diffs[0][0]==0&&y.length>2*l?(p.length1+=y.length,u+=y.length,x=!1,p.diffs.push(new n.Diff(g,y)),o.diffs.shift()):(y=y.substring(0,l-p.length1-this.Patch_Margin),p.length1+=y.length,u+=y.length,g===0?(p.length2+=y.length,f+=y.length):x=!1,p.diffs.push(new n.Diff(g,y)),y==o.diffs[0][1]?o.diffs.shift():o.diffs[0][1]=o.diffs[0][1].substring(y.length))}d=(d=this.diff_text2(p.diffs)).substring(d.length-this.Patch_Margin);var v=this.diff_text1(o.diffs).substring(0,this.Patch_Margin);v!==""&&(p.length1+=v.length,p.length2+=v.length,p.diffs.length!==0&&p.diffs[p.diffs.length-1][0]===0?p.diffs[p.diffs.length-1][1]+=v:p.diffs.push(new n.Diff(0,v))),x||r.splice(++s,0,p)}}},n.prototype.patch_toText=function(r){for(var l=[],s=0;s<r.length;s++)l[s]=r[s];return l.join("")},n.prototype.patch_fromText=function(r){var l=[];if(!r)return l;for(var s=r.split(`
|
|
178
|
+
`),o=0,u=/^@@ -(\d+),?(\d*) \+(\d+),?(\d*) @@$/;o<s.length;){var f=s[o].match(u);if(!f)throw new Error("Invalid patch string: "+s[o]);var d=new n.patch_obj;for(l.push(d),d.start1=parseInt(f[1],10),f[2]===""?(d.start1--,d.length1=1):f[2]=="0"?d.length1=0:(d.start1--,d.length1=parseInt(f[2],10)),d.start2=parseInt(f[3],10),f[4]===""?(d.start2--,d.length2=1):f[4]=="0"?d.length2=0:(d.start2--,d.length2=parseInt(f[4],10)),o++;o<s.length;){var p=s[o].charAt(0);try{var x=decodeURI(s[o].substring(1))}catch{throw new Error("Illegal escape in patch_fromText: "+x)}if(p=="-")d.diffs.push(new n.Diff(-1,x));else if(p=="+")d.diffs.push(new n.Diff(1,x));else if(p==" ")d.diffs.push(new n.Diff(0,x));else{if(p=="@")break;if(p!=="")throw new Error('Invalid patch mode "'+p+'" in: '+x)}o++}}return l},(n.patch_obj=function(){this.diffs=[],this.start1=null,this.start2=null,this.length1=0,this.length2=0}).prototype.toString=function(){for(var r,l=["@@ -"+(this.length1===0?this.start1+",0":this.length1==1?this.start1+1:this.start1+1+","+this.length1)+" +"+(this.length2===0?this.start2+",0":this.length2==1?this.start2+1:this.start2+1+","+this.length2)+` @@
|
|
179
|
+
`],s=0;s<this.diffs.length;s++){switch(this.diffs[s][0]){case 1:r="+";break;case-1:r="-";break;case 0:r=" "}l[s+1]=r+encodeURI(this.diffs[s][1])+`
|
|
180
|
+
`}return l.join("").replace(/%20/g," ")},e.exports=n,e.exports.diff_match_patch=n,e.exports.DIFF_DELETE=-1,e.exports.DIFF_INSERT=1,e.exports.DIFF_EQUAL=0}));bm.DIFF_EQUAL;bm.DIFF_DELETE;bm.DIFF_INSERT;function i9(e){return e.map(n=>{const r=n.lines.map(l=>l.type==="add"?{type:"insert",isInsert:!0,lineNumber:l.newLineNo??0,content:l.content}:l.type==="delete"?{type:"delete",isDelete:!0,lineNumber:l.oldLineNo??0,content:l.content}:{type:"normal",isNormal:!0,oldLineNumber:l.oldLineNo??0,newLineNumber:l.newLineNo??0,content:l.content});return{content:n.header,oldStart:n.oldStart,oldLines:n.oldLines,newStart:n.newStart,newLines:n.newLines,changes:r}})}function _0({hunks:e}){if(e.length===0)return null;const n=i9(e);return h.jsx("div",{className:"diff-hunk-view text-xs font-mono overflow-x-auto",children:h.jsx(l9,{viewType:"unified",diffType:"modify",hunks:n,children:r=>r.map((l,s)=>h.jsx(qk,{hunk:l},`${l.oldStart}:${l.newStart}:${s}`))})})}const s9=300;function o9({file:e,isActive:n,onDiscard:r,onScrollRef:l}){const s=e.additions+e.deletions,o=s>s9,[u,f]=w.useState(!o),[d,p]=w.useState(!1),x=e.status==="renamed"&&e.oldPath?`${e.oldPath} → ${e.path}`:e.path,g=()=>{navigator.clipboard.writeText(e.path)},y=()=>{if(!d){p(!0),setTimeout(()=>p(!1),3e3);return}r(e.path,e.status),p(!1)};return h.jsxs("div",{ref:l,className:`border rounded-lg overflow-hidden ${n?"border-primary-6":"border-neutral-9"}`,children:[h.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 bg-neutral-9 cursor-pointer select-none",onClick:()=>f(!u),children:[u?h.jsx(Zr,{size:14,className:"text-neutral-5 shrink-0"}):h.jsx(va,{size:14,className:"text-neutral-5 shrink-0"}),h.jsx("span",{className:"font-mono text-xs text-neutral-2 truncate flex-1",title:x,children:x}),!e.isBinary&&h.jsxs("span",{className:"text-xs whitespace-nowrap",children:[e.additions>0&&h.jsxs("span",{className:"text-success-5",children:["+",e.additions]}),e.additions>0&&e.deletions>0&&h.jsx("span",{className:"text-neutral-5 mx-0.5",children:" "}),e.deletions>0&&h.jsxs("span",{className:"text-error-5",children:["−",e.deletions]})]}),e.isBinary&&h.jsx("span",{className:"text-xs text-neutral-5 italic",children:"binary"}),h.jsxs("div",{className:"flex items-center gap-1 ml-1",onClick:v=>v.stopPropagation(),children:[h.jsx("button",{className:"p-1 rounded hover:bg-neutral-8 text-neutral-4 hover:text-neutral-2",onClick:g,title:"Copy path",children:h.jsx(H0,{size:13})}),h.jsx("button",{className:`p-1 rounded hover:bg-error-950/50 ${d?"text-error-5":"text-neutral-4 hover:text-error-5"}`,onClick:y,title:d?"Click again to confirm":"Discard file changes",children:h.jsx(gc,{size:13})})]})]}),u&&h.jsx("div",{className:"border-t border-neutral-9",children:e.isBinary?h.jsxs("div",{className:"flex items-center gap-2 px-4 py-3 text-neutral-5 text-xs italic",children:[h.jsx(MN,{size:14}),"Binary file"]}):o&&e.hunks.length>0?h.jsx("div",{className:"px-4 py-3",children:h.jsx(_0,{hunks:e.hunks})}):e.hunks.length>0?h.jsx("div",{className:"px-0",children:h.jsx(_0,{hunks:e.hunks})}):h.jsx("div",{className:"px-4 py-3 text-neutral-5 text-xs italic",children:"No changes"})}),!u&&o&&h.jsxs("div",{className:"border-t border-neutral-9 px-4 py-2 text-xs text-neutral-5 italic cursor-pointer hover:text-neutral-3",onClick:()=>f(!0),children:["Large diff (",s," lines) — click to expand"]})]})}const zh=280,Lh=600,u9=400,T0="codekin-diff-panel-width";function c9({isOpen:e,onClose:n,send:r,onHandleMessage:l,onHandleToolDone:s}){const[o,u]=w.useState(()=>{const C=localStorage.getItem(T0);return C?Math.max(zh,Math.min(Lh,Number(C))):u9}),f=jz({send:r,isOpen:e}),d=w.useRef(new Map),[p,x]=w.useState(null),g=w.useRef(!1),y=w.useRef(0),v=w.useRef(0);w.useEffect(()=>{l(f.handleMessage)},[f.handleMessage,l]),w.useEffect(()=>{s(f.handleToolDone)},[f.handleToolDone,s]),w.useEffect(()=>{localStorage.setItem(T0,String(o))},[o]);const S=w.useCallback(C=>{C.preventDefault(),g.current=!0,y.current=C.clientX,v.current=o;const I=_=>{if(!g.current)return;const z=y.current-_.clientX;u(Math.max(zh,Math.min(Lh,v.current+z)))},U=()=>{g.current=!1,document.body.style.cursor="",document.removeEventListener("mousemove",I),document.removeEventListener("mouseup",U)};document.body.style.cursor="col-resize",document.addEventListener("mousemove",I),document.addEventListener("mouseup",U)},[o]),E=w.useCallback(C=>{x(C);const I=d.current.get(C);I&&I.scrollIntoView({behavior:"smooth",block:"nearest"})},[]),T=w.useCallback((C,I)=>{f.discard([C],{[C]:I})},[f]),N=w.useCallback(()=>{f.discard()},[f]);if(w.useEffect(()=>{if(!e)return;const C=I=>{I.key==="Escape"&&n()};return document.addEventListener("keydown",C),()=>document.removeEventListener("keydown",C)},[e,n]),!e)return null;const j=f.files.some(C=>C.status==="added");return h.jsxs("div",{className:"relative flex flex-col h-full bg-neutral-12 border-l border-neutral-9 overflow-hidden transition-[width] duration-150",style:{width:o,minWidth:zh,maxWidth:Lh},children:[h.jsx("div",{className:"absolute left-0 top-0 bottom-0 w-1 cursor-col-resize hover:bg-primary-6/40 z-20",onMouseDown:S}),h.jsxs("div",{className:"flex items-center justify-between px-3 py-2 border-b border-neutral-9 shrink-0",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[f.summary.filesChanged>0&&h.jsx("span",{className:"w-2 h-2 rounded-full bg-success-5"}),h.jsx("span",{className:"text-sm font-medium text-neutral-2",children:"Changes"})]}),h.jsx("button",{className:"p-1 rounded hover:bg-neutral-9 text-neutral-4 hover:text-neutral-2",onClick:n,title:"Close diff panel",children:h.jsx(Wr,{size:14})})]}),h.jsx(Mz,{branch:f.branch,scope:f.scope,summary:f.summary,loading:f.loading,hasUntrackedFiles:j,onScopeChange:f.changeScope,onRefresh:f.refresh,onDiscardAll:N}),f.error&&h.jsx("div",{className:"px-3 py-2 text-xs text-error-5 bg-error-950/20",children:f.error}),h.jsxs("div",{className:"flex-1 overflow-y-auto min-h-0",children:[f.files.length>0&&h.jsx("div",{className:"border-b border-neutral-9",children:h.jsx(Dz,{files:f.files,activeFile:p,onSelectFile:E})}),h.jsxs("div",{className:"px-2 py-2 flex flex-col gap-2",children:[f.files.length===0&&!f.loading&&!f.error&&h.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-neutral-6",children:[h.jsx(CN,{size:32,className:"mb-2 opacity-50"}),h.jsx("span",{className:"text-xs",children:"No changes detected"})]}),f.summary.truncated&&h.jsx("div",{className:"px-3 py-2 text-xs text-warning-5 bg-warning-950/20 rounded",children:"Diff truncated — showing partial results"}),f.files.map(C=>h.jsx(o9,{file:C,isActive:C.path===p,onDiscard:T,onScrollRef:I=>{I?d.current.set(C.path,I):d.current.delete(C.path)}},C.path))]})]})]})}function f9(){const{settings:e,updateSettings:n}=s2(),{groups:r,repos:l,globalSkills:s,globalModules:o,ghMissing:u,refresh:f}=C0(e.token),{sessions:d,rename:p,remove:x,refresh:g}=N2(e.token),{queues:y,addToQueue:v,clearQueue:S}=z2(),{sessionId:E,view:T,navigate:N}=M2(),j=U2(),C=H2(),[I,U]=w.useState(!1),[_,z]=w.useState(()=>E??localStorage.getItem("codekin-active-session")),P=w.useCallback(ve=>{z(ve),ve?N(`/s/${ve}`):N("/",!0)},[N]),[X,B]=w.useState(!e.token),[q,Z]=w.useState(!1),[ee,ae]=w.useState(!1),Y=w.useRef(()=>{}),M=w.useRef(()=>{}),[K,le]=w.useState(!1),[be,O]=w.useState(0),[D,L]=w.useState(null),A=w.useRef(null),se=w.useRef(null),te=w.useRef(()=>{}),ie=w.useRef(null),[Se,je]=w.useState({}),{connState:Ae,messages:qe,tasks:we,planningMode:Ve,isProcessing:Lt,thinkingSummary:he,waitingSessions:xe,activePrompt:_e,promptQueueSize:et,joinSession:St,createSession:xn,sendInput:Ot,sendPromptResponse:pr,leaveSession:On,clearMessages:Dn,restoreSession:Et,currentModel:bn,setModel:re,send:me}=R2({token:e.token,onSessionCreated:ve=>{if(P(ve),g(),se.current){const wt=se.current;se.current=null,setTimeout(()=>te.current(wt),500)}},onSessionJoined:ve=>{P(ve)},onSessionRenamed:()=>{g()},onSessionsUpdated:()=>{g(),O(ve=>ve+1)},onError:ve=>{A.current&&clearTimeout(A.current),L(ve),A.current=setTimeout(()=>L(null),5e3),ve.toLowerCase().includes("not found")&&P(null)},onRawMessage:ve=>{ve.type==="diff_result"||ve.type==="diff_error"?Y.current(ve):ve.type==="tool_done"&&(M.current(ve.toolName,ve.summary),(ve.toolName==="Edit"||ve.toolName==="Write")&&le(!0))}});w.useEffect(()=>{le(!1)},[_]);const{activeWorkingDir:Me,handleOpenSession:Ge,handleSelectSession:nt,handleDeleteSession:Jt,handleSelectRepo:_n,handleDeleteRepo:qt,handleNewSessionForRepo:mt,handleNewSessionFromArchive:Ct}=L2({sessions:d,repos:l,activeSessionId:_,setActiveSessionId:P,joinSession:St,leaveSession:On,clearMessages:Dn,wsCreateSession:xn,removeSession:x,pendingContextRef:se}),Fe=Me?l.find(ve=>ve.workingDir===Me)??null:null,pn=w.useMemo(()=>[...s,...Fe?.skills??[]],[s,Fe?.skills]),Xt=w.useMemo(()=>F2(pn),[pn]),Na=w.useCallback((ve,wt)=>{switch(ve){case"/clear":case"/reset":case"/new":On(),Dn(),Me&&mt();break;case"/compact":Ot("Please compact the conversation context to save tokens while preserving important context.");break;case"/model":wt?re(wt):Ot(`Current model: ${bn??"default"}. To change, use the model selector in the input bar.`);break;case"/help":Ot("[Codekin] Available commands: /clear, /compact, /model, /cost, /status, /help. Skills: type / to see autocomplete.");break;default:Ot(`[Codekin] Command ${ve} is not available in the web UI.`);break}},[On,Dn,Me,mt,Ot,bn,re]),{handleSend:zn,handleExecuteTentative:er,handleDiscardTentative:Ar,tentativeMessages:Kt,activeTentativeCount:H,pendingFiles:ue,addFiles:pe,removeFile:Le,uploadStatus:vt}=q2({token:e.token,activeSessionId:_,activeWorkingDir:Me,sessions:d,allSkills:pn,sendInput:Ot,onBuiltinCommand:Na,tentativeQueues:y,addToQueue:v,clearQueue:S,docsContext:{isOpen:j.isOpen,selectedFile:j.selectedFile,repoWorkingDir:j.repoWorkingDir}});w.useEffect(()=>{te.current=Ot},[Ot]),w.useEffect(()=>{function ve(wt){(wt.metaKey||wt.ctrlKey)&&wt.key==="k"&&(wt.preventDefault(),Z(mr=>!mr)),(wt.metaKey||wt.ctrlKey)&&wt.shiftKey&&wt.key==="D"&&(wt.preventDefault(),ae(mr=>!mr))}return window.addEventListener("keydown",ve),()=>window.removeEventListener("keydown",ve)},[]),w.useEffect(()=>{_?localStorage.setItem("codekin-active-session",_):localStorage.removeItem("codekin-active-session")},[_]);const ft=w.useRef(!1);w.useEffect(()=>{Ae==="disconnected"&&(ft.current=!1)},[Ae]),w.useEffect(()=>{ft.current||!_||Ae!=="connected"||(ft.current=!0,St(_))},[_,Ae,St]),w.useEffect(()=>{E!==_&&(E?(Dn(),On(),St(E),z(E)):(Dn(),On(),z(null)))},[E]),w.useEffect(()=>{_&&window.location.pathname==="/"&&N(`/s/${_}`,!0)},[]),j2(()=>{Et()}),w.useEffect(()=>{e.token||B(!0)},[e.token]),w.useEffect(()=>{j.isOpen&&j.close()},[_]);const Ce=w.useCallback(ve=>{ie.current?.insertText(ve+" ")},[]),Ee=w.useCallback(ve=>{Ot(`[Module: ${ve.name}]
|
|
181
|
+
|
|
182
|
+
${ve.content}`)},[Ot]),Ie=[{label:"Global",skills:s},...Fe&&Fe.skills.length>0?[{label:Fe.name,skills:Fe.skills}]:[]],$t=Y2(qe,Lt,he),rt=w.useMemo(()=>{if(!j.repoWorkingDir)return"";const ve=j.repoWorkingDir.replace(/\/+$/,"").split("/");return ve[ve.length-1]||j.repoWorkingDir},[j.repoWorkingDir]),fn=w.useCallback(ve=>{j.pickerOpen&&j.pickerRepoDir===ve?j.closePicker():j.openPicker(ve,e.token)},[j,e.token]),Cr=w.useCallback(ve=>{j.pickerRepoDir&&j.openFile(j.pickerRepoDir,ve,e.token)},[j,e.token]);w.useEffect(()=>{document.documentElement.dataset.theme=e.theme},[e.theme]);const Tn=d.find(ve=>ve.id===_)?.name??null,Bt=Fe?.name??Me?.split("/").pop()??null;return h.jsxs("div",{className:"flex h-full bg-neutral-7",children:[h.jsx(mD,{sessions:d,activeSessionId:_,activeWorkingDir:Me,waitingSessions:xe,tentativeQueues:y,groups:r,globalModules:o,activeRepo:Fe,token:e.token,theme:e.theme,fontSize:e.fontSize,connState:Ae,view:T,archiveRefreshKey:be,onSelectSession:ve=>{j.close(),nt(ve)},onDeleteSession:Jt,onRenameSession:p,onNewSession:mt,onNewSessionFromArchive:Ct,onOpenSession:Ge,onSelectRepo:_n,onDeleteRepo:qt,onSettingsOpen:()=>B(!0),onUpdateTheme:ve=>n({theme:ve}),onSendModule:Ee,onNavigateToWorkflows:()=>N("/workflows"),onBrowseDocs:fn,docsPicker:{open:j.pickerOpen,repoDir:j.pickerRepoDir,files:j.pickerFiles,loading:j.pickerLoading,onSelect:Cr,onClose:j.closePicker,starredDocs:j.starredDocs},mobile:{isMobile:C,mobileOpen:I,onMobileClose:()=>U(!1)}}),h.jsxs("div",{className:"terminal-area flex flex-1 flex-col overflow-hidden bg-neutral-12",children:[C&&h.jsx(gD,{repoName:Bt,sessionName:Tn,onMenuOpen:()=>U(!0),onNewSession:mt,onSettingsOpen:()=>B(!0),activeRepo:Fe}),D&&h.jsx("div",{className:"border-b border-error-9/50 bg-error-10/50 px-4 py-2 text-[15px] text-error-5",children:D}),vt&&h.jsx("div",{className:"border-b border-primary-9/50 bg-primary-10/50 px-4 py-2 text-[15px] text-primary-5",children:vt}),T==="workflows"?h.jsx(ZD,{token:e.token,onNavigateToSession:ve=>{Dn(),On(),St(ve),N(`/s/${ve}`)}}):j.isOpen?h.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden min-h-0",children:[h.jsx(KO,{repoName:rt,filePath:j.selectedFile,content:j.content,loading:j.loading,error:j.error,rawMode:j.rawMode,isStarred:j.isCurrentFileStarred,onToggleRaw:j.toggleRawMode,onToggleStar:j.toggleStarCurrentFile,onClose:j.close}),_?h.jsx(a0,{ref:ie,onSendInput:zn,isWaiting:!!_e,disabled:!e.token,onEscape:j.close,pendingFiles:ue,onAddFiles:pe,onRemoveFile:Le,skillGroups:Ie,slashCommands:Xt,placeholder:"Ask Claude about this doc, or request changes...",initialValue:_?Se[_]??"":"",onValueChange:ve=>{_&&je(wt=>({...wt,[_]:ve}))},currentModel:bn,onModelChange:re,isMobile:C},`docs-${_}`):h.jsx("div",{className:"px-4 py-3 border-t border-neutral-10",children:h.jsx("div",{className:"rounded-lg bg-neutral-11 px-3 py-2 text-[15px] text-neutral-5 opacity-40",children:"Start a session to edit this doc"})})]}):_?h.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden min-h-0",children:[h.jsxs("div",{className:"relative flex-1 min-h-0 flex flex-col",children:[h.jsx(mw,{messages:[...qe,...Kt],fontSize:e.fontSize+(C?1:0),disabled:!e.token,planningMode:Ve,activityLabel:$t,isMobile:C}),h.jsx(ZO,{tasks:we}),K&&!ee&&h.jsxs("button",{className:"absolute top-3 right-3 z-10 flex items-center gap-1.5 rounded-lg bg-primary-8 px-3 py-1.5 text-[13px] font-medium text-neutral-1 shadow-lg backdrop-blur-sm transition-colors hover:bg-primary-7",onClick:()=>ae(!0),title:"Review code changes (Ctrl+Shift+D)",children:[h.jsx(TN,{size:15}),"Diff view"]})]}),_e&&h.jsx(Az,{options:_e.options,question:_e.question,multiSelect:_e.multiSelect,promptType:_e.promptType,questions:_e.questions,approvePattern:_e.approvePattern,onSelect:pr,isMobile:C},_e.requestId),et>1&&h.jsxs("div",{className:"px-3 py-1 text-[12px] text-neutral-5 bg-neutral-11 border-t border-neutral-10",children:[et-1," more pending"]}),H>0&&h.jsx(xD,{count:H,repoName:Fe?.name??Me?.split("/").pop()??"this repo",onExecute:()=>er(_),onDiscard:()=>Ar(_)}),h.jsx(a0,{ref:ie,onSendInput:zn,isWaiting:!!_e,disabled:!e.token,onEscape:()=>{},pendingFiles:ue,onAddFiles:pe,onRemoveFile:Le,skillGroups:Ie,slashCommands:Xt,initialValue:_?Se[_]??"":"",onValueChange:ve=>{_&&je(wt=>({...wt,[_]:ve}))},currentModel:bn,onModelChange:re,isMobile:C},_??"no-session")]}):h.jsx(Cz,{groups:r,token:e.token,ghMissing:u,onOpen:Ge,onRefreshRepos:f})]}),_&&h.jsx(c9,{isOpen:ee,onClose:()=>ae(!1),send:me,onHandleMessage:ve=>{Y.current=ve},onHandleToolDone:ve=>{M.current=ve}}),h.jsx(C_,{open:X,onClose:()=>B(!1),settings:e,onUpdate:n,isMobile:C}),h.jsx(wz,{open:q,onClose:()=>Z(!1),repos:l,globalSkills:s,globalModules:o,onOpenRepo:Ge,onSendSkill:Ce,onSendModule:Ee,onOpenSettings:()=>B(!0),isMobile:C})]})}a2.createRoot(document.getElementById("root")).render(h.jsx(w.StrictMode,{children:h.jsx(f9,{})}));
|