figranium 0.11.3 → 0.12.1

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.
@@ -1,43 +0,0 @@
1
- (function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))l(o);new MutationObserver(o=>{for(const u of o)if(u.type==="childList")for(const c of u.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&l(c)}).observe(document,{childList:!0,subtree:!0});function i(o){const u={};return o.integrity&&(u.integrity=o.integrity),o.referrerPolicy&&(u.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?u.credentials="include":o.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function l(o){if(o.ep)return;o.ep=!0;const u=i(o);fetch(o.href,u)}})();var Rs=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function dl(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var wc={exports:{}},Xr={};var Om;function Wy(){if(Om)return Xr;Om=1;var t=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function i(l,o,u){var c=null;if(u!==void 0&&(c=""+u),o.key!==void 0&&(c=""+o.key),"key"in o){u={};for(var f in o)f!=="key"&&(u[f]=o[f])}else u=o;return o=u.ref,{$$typeof:t,type:l,key:c,ref:o!==void 0?o:null,props:u}}return Xr.Fragment=r,Xr.jsx=i,Xr.jsxs=i,Xr}var Dm;function ev(){return Dm||(Dm=1,wc.exports=Wy()),wc.exports}var d=ev(),Sc={exports:{}},$e={};var Mm;function tv(){if(Mm)return $e;Mm=1;var t=Symbol.for("react.transitional.element"),r=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),l=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),u=Symbol.for("react.consumer"),c=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),b=Symbol.for("react.lazy"),x=Symbol.for("react.activity"),w=Symbol.iterator;function y(O){return O===null||typeof O!="object"?null:(O=w&&O[w]||O["@@iterator"],typeof O=="function"?O:null)}var j={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},v=Object.assign,k={};function S(O,H,M){this.props=O,this.context=H,this.refs=k,this.updater=M||j}S.prototype.isReactComponent={},S.prototype.setState=function(O,H){if(typeof O!="object"&&typeof O!="function"&&O!=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,O,H,"setState")},S.prototype.forceUpdate=function(O){this.updater.enqueueForceUpdate(this,O,"forceUpdate")};function _(){}_.prototype=S.prototype;function N(O,H,M){this.props=O,this.context=H,this.refs=k,this.updater=M||j}var B=N.prototype=new _;B.constructor=N,v(B,S.prototype),B.isPureReactComponent=!0;var D=Array.isArray;function z(){}var R={H:null,A:null,T:null,S:null},G=Object.prototype.hasOwnProperty;function P(O,H,M){var ie=M.ref;return{$$typeof:t,type:O,key:H,ref:ie!==void 0?ie:null,props:M}}function q(O,H){return P(O.type,H,O.props)}function W(O){return typeof O=="object"&&O!==null&&O.$$typeof===t}function I(O){var H={"=":"=0",":":"=2"};return"$"+O.replace(/[=:]/g,function(M){return H[M]})}var X=/\/+/g;function E(O,H){return typeof O=="object"&&O!==null&&O.key!=null?I(""+O.key):H.toString(36)}function Q(O){switch(O.status){case"fulfilled":return O.value;case"rejected":throw O.reason;default:switch(typeof O.status=="string"?O.then(z,z):(O.status="pending",O.then(function(H){O.status==="pending"&&(O.status="fulfilled",O.value=H)},function(H){O.status==="pending"&&(O.status="rejected",O.reason=H)})),O.status){case"fulfilled":return O.value;case"rejected":throw O.reason}}throw O}function $(O,H,M,ie,V){var se=typeof O;(se==="undefined"||se==="boolean")&&(O=null);var ze=!1;if(O===null)ze=!0;else switch(se){case"bigint":case"string":case"number":ze=!0;break;case"object":switch(O.$$typeof){case t:case r:ze=!0;break;case b:return ze=O._init,$(ze(O._payload),H,M,ie,V)}}if(ze)return V=V(O),ze=ie===""?"."+E(O,0):ie,D(V)?(M="",ze!=null&&(M=ze.replace(X,"$&/")+"/"),$(V,H,M,"",function(Pe){return Pe})):V!=null&&(W(V)&&(V=q(V,M+(V.key==null||O&&O.key===V.key?"":(""+V.key).replace(X,"$&/")+"/")+ze)),H.push(V)),1;ze=0;var Re=ie===""?".":ie+":";if(D(O))for(var De=0;De<O.length;De++)ie=O[De],se=Re+E(ie,De),ze+=$(ie,H,M,se,V);else if(De=y(O),typeof De=="function")for(O=De.call(O),De=0;!(ie=O.next()).done;)ie=ie.value,se=Re+E(ie,De++),ze+=$(ie,H,M,se,V);else if(se==="object"){if(typeof O.then=="function")return $(Q(O),H,M,ie,V);throw H=String(O),Error("Objects are not valid as a React child (found: "+(H==="[object Object]"?"object with keys {"+Object.keys(O).join(", ")+"}":H)+"). If you meant to render a collection of children, use an array instead.")}return ze}function J(O,H,M){if(O==null)return O;var ie=[],V=0;return $(O,ie,"","",function(se){return H.call(M,se,V++)}),ie}function ve(O){if(O._status===-1){var H=O._result;H=H(),H.then(function(M){(O._status===0||O._status===-1)&&(O._status=1,O._result=M)},function(M){(O._status===0||O._status===-1)&&(O._status=2,O._result=M)}),O._status===-1&&(O._status=0,O._result=H)}if(O._status===1)return O._result.default;throw O._result}var ee=typeof reportError=="function"?reportError:function(O){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var H=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof O=="object"&&O!==null&&typeof O.message=="string"?String(O.message):String(O),error:O});if(!window.dispatchEvent(H))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",O);return}console.error(O)},L={map:J,forEach:function(O,H,M){J(O,function(){H.apply(this,arguments)},M)},count:function(O){var H=0;return J(O,function(){H++}),H},toArray:function(O){return J(O,function(H){return H})||[]},only:function(O){if(!W(O))throw Error("React.Children.only expected to receive a single React element child.");return O}};return $e.Activity=x,$e.Children=L,$e.Component=S,$e.Fragment=i,$e.Profiler=o,$e.PureComponent=N,$e.StrictMode=l,$e.Suspense=h,$e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=R,$e.__COMPILER_RUNTIME={__proto__:null,c:function(O){return R.H.useMemoCache(O)}},$e.cache=function(O){return function(){return O.apply(null,arguments)}},$e.cacheSignal=function(){return null},$e.cloneElement=function(O,H,M){if(O==null)throw Error("The argument must be a React element, but you passed "+O+".");var ie=v({},O.props),V=O.key;if(H!=null)for(se in H.key!==void 0&&(V=""+H.key),H)!G.call(H,se)||se==="key"||se==="__self"||se==="__source"||se==="ref"&&H.ref===void 0||(ie[se]=H[se]);var se=arguments.length-2;if(se===1)ie.children=M;else if(1<se){for(var ze=Array(se),Re=0;Re<se;Re++)ze[Re]=arguments[Re+2];ie.children=ze}return P(O.type,V,ie)},$e.createContext=function(O){return O={$$typeof:c,_currentValue:O,_currentValue2:O,_threadCount:0,Provider:null,Consumer:null},O.Provider=O,O.Consumer={$$typeof:u,_context:O},O},$e.createElement=function(O,H,M){var ie,V={},se=null;if(H!=null)for(ie in H.key!==void 0&&(se=""+H.key),H)G.call(H,ie)&&ie!=="key"&&ie!=="__self"&&ie!=="__source"&&(V[ie]=H[ie]);var ze=arguments.length-2;if(ze===1)V.children=M;else if(1<ze){for(var Re=Array(ze),De=0;De<ze;De++)Re[De]=arguments[De+2];V.children=Re}if(O&&O.defaultProps)for(ie in ze=O.defaultProps,ze)V[ie]===void 0&&(V[ie]=ze[ie]);return P(O,se,V)},$e.createRef=function(){return{current:null}},$e.forwardRef=function(O){return{$$typeof:f,render:O}},$e.isValidElement=W,$e.lazy=function(O){return{$$typeof:b,_payload:{_status:-1,_result:O},_init:ve}},$e.memo=function(O,H){return{$$typeof:p,type:O,compare:H===void 0?null:H}},$e.startTransition=function(O){var H=R.T,M={};R.T=M;try{var ie=O(),V=R.S;V!==null&&V(M,ie),typeof ie=="object"&&ie!==null&&typeof ie.then=="function"&&ie.then(z,ee)}catch(se){ee(se)}finally{H!==null&&M.types!==null&&(H.types=M.types),R.T=H}},$e.unstable_useCacheRefresh=function(){return R.H.useCacheRefresh()},$e.use=function(O){return R.H.use(O)},$e.useActionState=function(O,H,M){return R.H.useActionState(O,H,M)},$e.useCallback=function(O,H){return R.H.useCallback(O,H)},$e.useContext=function(O){return R.H.useContext(O)},$e.useDebugValue=function(){},$e.useDeferredValue=function(O,H){return R.H.useDeferredValue(O,H)},$e.useEffect=function(O,H){return R.H.useEffect(O,H)},$e.useEffectEvent=function(O){return R.H.useEffectEvent(O)},$e.useId=function(){return R.H.useId()},$e.useImperativeHandle=function(O,H,M){return R.H.useImperativeHandle(O,H,M)},$e.useInsertionEffect=function(O,H){return R.H.useInsertionEffect(O,H)},$e.useLayoutEffect=function(O,H){return R.H.useLayoutEffect(O,H)},$e.useMemo=function(O,H){return R.H.useMemo(O,H)},$e.useOptimistic=function(O,H){return R.H.useOptimistic(O,H)},$e.useReducer=function(O,H,M){return R.H.useReducer(O,H,M)},$e.useRef=function(O){return R.H.useRef(O)},$e.useState=function(O){return R.H.useState(O)},$e.useSyncExternalStore=function(O,H,M){return R.H.useSyncExternalStore(O,H,M)},$e.useTransition=function(){return R.H.useTransition()},$e.version="19.2.3",$e}var Lm;function bd(){return Lm||(Lm=1,Sc.exports=tv()),Sc.exports}var T=bd();const ft=dl(T);var kc={exports:{}},Zr={},jc={exports:{}},_c={};var Bm;function nv(){return Bm||(Bm=1,(function(t){function r($,J){var ve=$.length;$.push(J);e:for(;0<ve;){var ee=ve-1>>>1,L=$[ee];if(0<o(L,J))$[ee]=J,$[ve]=L,ve=ee;else break e}}function i($){return $.length===0?null:$[0]}function l($){if($.length===0)return null;var J=$[0],ve=$.pop();if(ve!==J){$[0]=ve;e:for(var ee=0,L=$.length,O=L>>>1;ee<O;){var H=2*(ee+1)-1,M=$[H],ie=H+1,V=$[ie];if(0>o(M,ve))ie<L&&0>o(V,M)?($[ee]=V,$[ie]=ve,ee=ie):($[ee]=M,$[H]=ve,ee=H);else if(ie<L&&0>o(V,ve))$[ee]=V,$[ie]=ve,ee=ie;else break e}}return J}function o($,J){var ve=$.sortIndex-J.sortIndex;return ve!==0?ve:$.id-J.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var u=performance;t.unstable_now=function(){return u.now()}}else{var c=Date,f=c.now();t.unstable_now=function(){return c.now()-f}}var h=[],p=[],b=1,x=null,w=3,y=!1,j=!1,v=!1,k=!1,S=typeof setTimeout=="function"?setTimeout:null,_=typeof clearTimeout=="function"?clearTimeout:null,N=typeof setImmediate<"u"?setImmediate:null;function B($){for(var J=i(p);J!==null;){if(J.callback===null)l(p);else if(J.startTime<=$)l(p),J.sortIndex=J.expirationTime,r(h,J);else break;J=i(p)}}function D($){if(v=!1,B($),!j)if(i(h)!==null)j=!0,z||(z=!0,I());else{var J=i(p);J!==null&&Q(D,J.startTime-$)}}var z=!1,R=-1,G=5,P=-1;function q(){return k?!0:!(t.unstable_now()-P<G)}function W(){if(k=!1,z){var $=t.unstable_now();P=$;var J=!0;try{e:{j=!1,v&&(v=!1,_(R),R=-1),y=!0;var ve=w;try{t:{for(B($),x=i(h);x!==null&&!(x.expirationTime>$&&q());){var ee=x.callback;if(typeof ee=="function"){x.callback=null,w=x.priorityLevel;var L=ee(x.expirationTime<=$);if($=t.unstable_now(),typeof L=="function"){x.callback=L,B($),J=!0;break t}x===i(h)&&l(h),B($)}else l(h);x=i(h)}if(x!==null)J=!0;else{var O=i(p);O!==null&&Q(D,O.startTime-$),J=!1}}break e}finally{x=null,w=ve,y=!1}J=void 0}}finally{J?I():z=!1}}}var I;if(typeof N=="function")I=function(){N(W)};else if(typeof MessageChannel<"u"){var X=new MessageChannel,E=X.port2;X.port1.onmessage=W,I=function(){E.postMessage(null)}}else I=function(){S(W,0)};function Q($,J){R=S(function(){$(t.unstable_now())},J)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function($){$.callback=null},t.unstable_forceFrameRate=function($){0>$||125<$?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):G=0<$?Math.floor(1e3/$):5},t.unstable_getCurrentPriorityLevel=function(){return w},t.unstable_next=function($){switch(w){case 1:case 2:case 3:var J=3;break;default:J=w}var ve=w;w=J;try{return $()}finally{w=ve}},t.unstable_requestPaint=function(){k=!0},t.unstable_runWithPriority=function($,J){switch($){case 1:case 2:case 3:case 4:case 5:break;default:$=3}var ve=w;w=$;try{return J()}finally{w=ve}},t.unstable_scheduleCallback=function($,J,ve){var ee=t.unstable_now();switch(typeof ve=="object"&&ve!==null?(ve=ve.delay,ve=typeof ve=="number"&&0<ve?ee+ve:ee):ve=ee,$){case 1:var L=-1;break;case 2:L=250;break;case 5:L=1073741823;break;case 4:L=1e4;break;default:L=5e3}return L=ve+L,$={id:b++,callback:J,priorityLevel:$,startTime:ve,expirationTime:L,sortIndex:-1},ve>ee?($.sortIndex=ve,r(p,$),i(h)===null&&$===i(p)&&(v?(_(R),R=-1):v=!0,Q(D,ve-ee))):($.sortIndex=L,r(h,$),j||y||(j=!0,z||(z=!0,I()))),$},t.unstable_shouldYield=q,t.unstable_wrapCallback=function($){var J=w;return function(){var ve=w;w=J;try{return $.apply(this,arguments)}finally{w=ve}}}})(_c)),_c}var Um;function iv(){return Um||(Um=1,jc.exports=nv()),jc.exports}var Cc={exports:{}},qt={};var Im;function av(){if(Im)return qt;Im=1;var t=bd();function r(h){var p="https://react.dev/errors/"+h;if(1<arguments.length){p+="?args[]="+encodeURIComponent(arguments[1]);for(var b=2;b<arguments.length;b++)p+="&args[]="+encodeURIComponent(arguments[b])}return"Minified React error #"+h+"; visit "+p+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(){}var l={d:{f:i,r:function(){throw Error(r(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},p:0,findDOMNode:null},o=Symbol.for("react.portal");function u(h,p,b){var x=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:x==null?null:""+x,children:h,containerInfo:p,implementation:b}}var c=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function f(h,p){if(h==="font")return"";if(typeof p=="string")return p==="use-credentials"?p:""}return qt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=l,qt.createPortal=function(h,p){var b=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!p||p.nodeType!==1&&p.nodeType!==9&&p.nodeType!==11)throw Error(r(299));return u(h,p,null,b)},qt.flushSync=function(h){var p=c.T,b=l.p;try{if(c.T=null,l.p=2,h)return h()}finally{c.T=p,l.p=b,l.d.f()}},qt.preconnect=function(h,p){typeof h=="string"&&(p?(p=p.crossOrigin,p=typeof p=="string"?p==="use-credentials"?p:"":void 0):p=null,l.d.C(h,p))},qt.prefetchDNS=function(h){typeof h=="string"&&l.d.D(h)},qt.preinit=function(h,p){if(typeof h=="string"&&p&&typeof p.as=="string"){var b=p.as,x=f(b,p.crossOrigin),w=typeof p.integrity=="string"?p.integrity:void 0,y=typeof p.fetchPriority=="string"?p.fetchPriority:void 0;b==="style"?l.d.S(h,typeof p.precedence=="string"?p.precedence:void 0,{crossOrigin:x,integrity:w,fetchPriority:y}):b==="script"&&l.d.X(h,{crossOrigin:x,integrity:w,fetchPriority:y,nonce:typeof p.nonce=="string"?p.nonce:void 0})}},qt.preinitModule=function(h,p){if(typeof h=="string")if(typeof p=="object"&&p!==null){if(p.as==null||p.as==="script"){var b=f(p.as,p.crossOrigin);l.d.M(h,{crossOrigin:b,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0})}}else p==null&&l.d.M(h)},qt.preload=function(h,p){if(typeof h=="string"&&typeof p=="object"&&p!==null&&typeof p.as=="string"){var b=p.as,x=f(b,p.crossOrigin);l.d.L(h,b,{crossOrigin:x,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})}},qt.preloadModule=function(h,p){if(typeof h=="string")if(p){var b=f(p.as,p.crossOrigin);l.d.m(h,{as:typeof p.as=="string"&&p.as!=="script"?p.as:void 0,crossOrigin:b,integrity:typeof p.integrity=="string"?p.integrity:void 0})}else l.d.m(h)},qt.requestFormReset=function(h){l.d.r(h)},qt.unstable_batchedUpdates=function(h,p){return h(p)},qt.useFormState=function(h,p,b){return c.H.useFormState(h,p,b)},qt.useFormStatus=function(){return c.H.useHostTransitionStatus()},qt.version="19.2.3",qt}var Hm;function ix(){if(Hm)return Cc.exports;Hm=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(r){console.error(r)}}return t(),Cc.exports=av(),Cc.exports}var Pm;function rv(){if(Pm)return Zr;Pm=1;var t=iv(),r=bd(),i=ix();function l(e){var n="https://react.dev/errors/"+e;if(1<arguments.length){n+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)n+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+e+"; visit "+n+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function u(e){var n=e,a=e;if(e.alternate)for(;n.return;)n=n.return;else{e=n;do n=e,(n.flags&4098)!==0&&(a=n.return),e=n.return;while(e)}return n.tag===3?a:null}function c(e){if(e.tag===13){var n=e.memoizedState;if(n===null&&(e=e.alternate,e!==null&&(n=e.memoizedState)),n!==null)return n.dehydrated}return null}function f(e){if(e.tag===31){var n=e.memoizedState;if(n===null&&(e=e.alternate,e!==null&&(n=e.memoizedState)),n!==null)return n.dehydrated}return null}function h(e){if(u(e)!==e)throw Error(l(188))}function p(e){var n=e.alternate;if(!n){if(n=u(e),n===null)throw Error(l(188));return n!==e?null:e}for(var a=e,s=n;;){var m=a.return;if(m===null)break;var g=m.alternate;if(g===null){if(s=m.return,s!==null){a=s;continue}break}if(m.child===g.child){for(g=m.child;g;){if(g===a)return h(m),e;if(g===s)return h(m),n;g=g.sibling}throw Error(l(188))}if(a.return!==s.return)a=m,s=g;else{for(var C=!1,U=m.child;U;){if(U===a){C=!0,a=m,s=g;break}if(U===s){C=!0,s=m,a=g;break}U=U.sibling}if(!C){for(U=g.child;U;){if(U===a){C=!0,a=g,s=m;break}if(U===s){C=!0,s=g,a=m;break}U=U.sibling}if(!C)throw Error(l(189))}}if(a.alternate!==s)throw Error(l(190))}if(a.tag!==3)throw Error(l(188));return a.stateNode.current===a?e:n}function b(e){var n=e.tag;if(n===5||n===26||n===27||n===6)return e;for(e=e.child;e!==null;){if(n=b(e),n!==null)return n;e=e.sibling}return null}var x=Object.assign,w=Symbol.for("react.element"),y=Symbol.for("react.transitional.element"),j=Symbol.for("react.portal"),v=Symbol.for("react.fragment"),k=Symbol.for("react.strict_mode"),S=Symbol.for("react.profiler"),_=Symbol.for("react.consumer"),N=Symbol.for("react.context"),B=Symbol.for("react.forward_ref"),D=Symbol.for("react.suspense"),z=Symbol.for("react.suspense_list"),R=Symbol.for("react.memo"),G=Symbol.for("react.lazy"),P=Symbol.for("react.activity"),q=Symbol.for("react.memo_cache_sentinel"),W=Symbol.iterator;function I(e){return e===null||typeof e!="object"?null:(e=W&&e[W]||e["@@iterator"],typeof e=="function"?e:null)}var X=Symbol.for("react.client.reference");function E(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===X?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case v:return"Fragment";case S:return"Profiler";case k:return"StrictMode";case D:return"Suspense";case z:return"SuspenseList";case P:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case j:return"Portal";case N:return e.displayName||"Context";case _:return(e._context.displayName||"Context")+".Consumer";case B:var n=e.render;return e=e.displayName,e||(e=n.displayName||n.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case R:return n=e.displayName||null,n!==null?n:E(e.type)||"Memo";case G:n=e._payload,e=e._init;try{return E(e(n))}catch{}}return null}var Q=Array.isArray,$=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,J=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ve={pending:!1,data:null,method:null,action:null},ee=[],L=-1;function O(e){return{current:e}}function H(e){0>L||(e.current=ee[L],ee[L]=null,L--)}function M(e,n){L++,ee[L]=e.current,e.current=n}var ie=O(null),V=O(null),se=O(null),ze=O(null);function Re(e,n){switch(M(se,n),M(V,e),M(ie,null),n.nodeType){case 9:case 11:e=(e=n.documentElement)&&(e=e.namespaceURI)?nm(e):0;break;default:if(e=n.tagName,n=n.namespaceURI)n=nm(n),e=im(n,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}H(ie),M(ie,e)}function De(){H(ie),H(V),H(se)}function Pe(e){e.memoizedState!==null&&M(ze,e);var n=ie.current,a=im(n,e.type);n!==a&&(M(V,e),M(ie,a))}function Ge(e){V.current===e&&(H(ie),H(V)),ze.current===e&&(H(ze),Yr._currentValue=ve)}var nt,ht;function A(e){if(nt===void 0)try{throw Error()}catch(a){var n=a.stack.trim().match(/\n( *(at )?)/);nt=n&&n[1]||"",ht=-1<a.stack.indexOf(`
2
- at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
3
- `+nt+e+ht}var pe=!1;function re(e,n){if(!e||pe)return"";pe=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var s={DetermineComponentFrameRoot:function(){try{if(n){var _e=function(){throw Error()};if(Object.defineProperty(_e.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(_e,[])}catch(he){var ce=he}Reflect.construct(e,[],_e)}else{try{_e.call()}catch(he){ce=he}e.call(_e.prototype)}}else{try{throw Error()}catch(he){ce=he}(_e=e())&&typeof _e.catch=="function"&&_e.catch(function(){})}}catch(he){if(he&&ce&&typeof he.stack=="string")return[he.stack,ce.stack]}return[null,null]}};s.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var m=Object.getOwnPropertyDescriptor(s.DetermineComponentFrameRoot,"name");m&&m.configurable&&Object.defineProperty(s.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var g=s.DetermineComponentFrameRoot(),C=g[0],U=g[1];if(C&&U){var Z=C.split(`
4
- `),ue=U.split(`
5
- `);for(m=s=0;s<Z.length&&!Z[s].includes("DetermineComponentFrameRoot");)s++;for(;m<ue.length&&!ue[m].includes("DetermineComponentFrameRoot");)m++;if(s===Z.length||m===ue.length)for(s=Z.length-1,m=ue.length-1;1<=s&&0<=m&&Z[s]!==ue[m];)m--;for(;1<=s&&0<=m;s--,m--)if(Z[s]!==ue[m]){if(s!==1||m!==1)do if(s--,m--,0>m||Z[s]!==ue[m]){var ge=`
6
- `+Z[s].replace(" at new "," at ");return e.displayName&&ge.includes("<anonymous>")&&(ge=ge.replace("<anonymous>",e.displayName)),ge}while(1<=s&&0<=m);break}}}finally{pe=!1,Error.prepareStackTrace=a}return(a=e?e.displayName||e.name:"")?A(a):""}function Y(e,n){switch(e.tag){case 26:case 27:case 5:return A(e.type);case 16:return A("Lazy");case 13:return e.child!==n&&n!==null?A("Suspense Fallback"):A("Suspense");case 19:return A("SuspenseList");case 0:case 15:return re(e.type,!1);case 11:return re(e.type.render,!1);case 1:return re(e.type,!0);case 31:return A("Activity");default:return""}}function F(e){try{var n="",a=null;do n+=Y(e,a),a=e,e=e.return;while(e);return n}catch(s){return`
7
- Error generating stack: `+s.message+`
8
- `+s.stack}}var ne=Object.prototype.hasOwnProperty,me=t.unstable_scheduleCallback,de=t.unstable_cancelCallback,K=t.unstable_shouldYield,xe=t.unstable_requestPaint,Ee=t.unstable_now,ke=t.unstable_getCurrentPriorityLevel,ae=t.unstable_ImmediatePriority,ye=t.unstable_UserBlockingPriority,Ae=t.unstable_NormalPriority,Ie=t.unstable_LowPriority,fe=t.unstable_IdlePriority,we=t.log,Me=t.unstable_setDisableYieldValue,Be=null,Ve=null;function Ke(e){if(typeof we=="function"&&Me(e),Ve&&typeof Ve.setStrictMode=="function")try{Ve.setStrictMode(Be,e)}catch{}}var Le=Math.clz32?Math.clz32:En,Je=Math.log,ct=Math.LN2;function En(e){return e>>>=0,e===0?32:31-(Je(e)/ct|0)|0}var On=256,Vn=262144,pn=4194304;function Xt(e){var n=e&42;if(n!==0)return n;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64: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 e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function hi(e,n,a){var s=e.pendingLanes;if(s===0)return 0;var m=0,g=e.suspendedLanes,C=e.pingedLanes;e=e.warmLanes;var U=s&134217727;return U!==0?(s=U&~g,s!==0?m=Xt(s):(C&=U,C!==0?m=Xt(C):a||(a=U&~e,a!==0&&(m=Xt(a))))):(U=s&~g,U!==0?m=Xt(U):C!==0?m=Xt(C):a||(a=s&~e,a!==0&&(m=Xt(a)))),m===0?0:n!==0&&n!==m&&(n&g)===0&&(g=m&-m,a=n&-n,g>=a||g===32&&(a&4194048)!==0)?n:m}function Yn(e,n){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&n)===0}function nr(e,n){switch(e){case 1:case 2:case 4:case 8:case 64:return n+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 n+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 bl(){var e=pn;return pn<<=1,(pn&62914560)===0&&(pn=4194304),e}function ir(e){for(var n=[],a=0;31>a;a++)n.push(e);return n}function Pi(e,n){e.pendingLanes|=n,n!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Dn(e,n,a,s,m,g){var C=e.pendingLanes;e.pendingLanes=a,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=a,e.entangledLanes&=a,e.errorRecoveryDisabledLanes&=a,e.shellSuspendCounter=0;var U=e.entanglements,Z=e.expirationTimes,ue=e.hiddenUpdates;for(a=C&~a;0<a;){var ge=31-Le(a),_e=1<<ge;U[ge]=0,Z[ge]=-1;var ce=ue[ge];if(ce!==null)for(ue[ge]=null,ge=0;ge<ce.length;ge++){var he=ce[ge];he!==null&&(he.lane&=-536870913)}a&=~_e}s!==0&&uo(e,s,0),g!==0&&m===0&&e.tag!==0&&(e.suspendedLanes|=g&~(C&~n))}function uo(e,n,a){e.pendingLanes|=n,e.suspendedLanes&=~n;var s=31-Le(n);e.entangledLanes|=n,e.entanglements[s]=e.entanglements[s]|1073741824|a&261930}function co(e,n){var a=e.entangledLanes|=n;for(e=e.entanglements;a;){var s=31-Le(a),m=1<<s;m&n|e[s]&n&&(e[s]|=n),a&=~m}}function fo(e,n){var a=n&-n;return a=(a&42)!==0?1:ar(a),(a&(e.suspendedLanes|n))!==0?0:a}function ar(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=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:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function rr(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function yl(){var e=J.p;return e!==0?e:(e=window.event,e===void 0?32:Cm(e.type))}function be(e,n){var a=J.p;try{return J.p=e,n()}finally{J.p=a}}var je=Math.random().toString(36).slice(2),Ne="__reactFiber$"+je,Te="__reactProps$"+je,st="__reactContainer$"+je,Gt="__reactEvents$"+je,Fb="__reactListeners$"+je,qb="__reactHandles$"+je,Fd="__reactResources$"+je,lr="__reactMarker$"+je;function ho(e){delete e[Ne],delete e[Te],delete e[Gt],delete e[Fb],delete e[qb]}function ua(e){var n=e[Ne];if(n)return n;for(var a=e.parentNode;a;){if(n=a[st]||a[Ne]){if(a=n.alternate,n.child!==null||a!==null&&a.child!==null)for(e=cm(e);e!==null;){if(a=e[Ne])return a;e=cm(e)}return n}e=a,a=e.parentNode}return null}function ca(e){if(e=e[Ne]||e[st]){var n=e.tag;if(n===5||n===6||n===13||n===31||n===26||n===27||n===3)return e}return null}function sr(e){var n=e.tag;if(n===5||n===26||n===27||n===6)return e.stateNode;throw Error(l(33))}function da(e){var n=e[Fd];return n||(n=e[Fd]={hoistableStyles:new Map,hoistableScripts:new Map}),n}function Bt(e){e[lr]=!0}var qd=new Set,Vd={};function Fi(e,n){fa(e,n),fa(e+"Capture",n)}function fa(e,n){for(Vd[e]=n,e=0;e<n.length;e++)qd.add(n[e])}var Vb=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]*$"),Yd={},Gd={};function Yb(e){return ne.call(Gd,e)?!0:ne.call(Yd,e)?!1:Vb.test(e)?Gd[e]=!0:(Yd[e]=!0,!1)}function vl(e,n,a){if(Yb(n))if(a===null)e.removeAttribute(n);else{switch(typeof a){case"undefined":case"function":case"symbol":e.removeAttribute(n);return;case"boolean":var s=n.toLowerCase().slice(0,5);if(s!=="data-"&&s!=="aria-"){e.removeAttribute(n);return}}e.setAttribute(n,""+a)}}function wl(e,n,a){if(a===null)e.removeAttribute(n);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttribute(n,""+a)}}function Gn(e,n,a,s){if(s===null)e.removeAttribute(a);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(a);return}e.setAttributeNS(n,a,""+s)}}function mn(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Kd(e){var n=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function Gb(e,n,a){var s=Object.getOwnPropertyDescriptor(e.constructor.prototype,n);if(!e.hasOwnProperty(n)&&typeof s<"u"&&typeof s.get=="function"&&typeof s.set=="function"){var m=s.get,g=s.set;return Object.defineProperty(e,n,{configurable:!0,get:function(){return m.call(this)},set:function(C){a=""+C,g.call(this,C)}}),Object.defineProperty(e,n,{enumerable:s.enumerable}),{getValue:function(){return a},setValue:function(C){a=""+C},stopTracking:function(){e._valueTracker=null,delete e[n]}}}}function po(e){if(!e._valueTracker){var n=Kd(e)?"checked":"value";e._valueTracker=Gb(e,n,""+e[n])}}function $d(e){if(!e)return!1;var n=e._valueTracker;if(!n)return!0;var a=n.getValue(),s="";return e&&(s=Kd(e)?e.checked?"true":"false":e.value),e=s,e!==a?(n.setValue(e),!0):!1}function Sl(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var Kb=/[\n"\\]/g;function gn(e){return e.replace(Kb,function(n){return"\\"+n.charCodeAt(0).toString(16)+" "})}function mo(e,n,a,s,m,g,C,U){e.name="",C!=null&&typeof C!="function"&&typeof C!="symbol"&&typeof C!="boolean"?e.type=C:e.removeAttribute("type"),n!=null?C==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+mn(n)):e.value!==""+mn(n)&&(e.value=""+mn(n)):C!=="submit"&&C!=="reset"||e.removeAttribute("value"),n!=null?go(e,C,mn(n)):a!=null?go(e,C,mn(a)):s!=null&&e.removeAttribute("value"),m==null&&g!=null&&(e.defaultChecked=!!g),m!=null&&(e.checked=m&&typeof m!="function"&&typeof m!="symbol"),U!=null&&typeof U!="function"&&typeof U!="symbol"&&typeof U!="boolean"?e.name=""+mn(U):e.removeAttribute("name")}function Xd(e,n,a,s,m,g,C,U){if(g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"&&(e.type=g),n!=null||a!=null){if(!(g!=="submit"&&g!=="reset"||n!=null)){po(e);return}a=a!=null?""+mn(a):"",n=n!=null?""+mn(n):a,U||n===e.value||(e.value=n),e.defaultValue=n}s=s??m,s=typeof s!="function"&&typeof s!="symbol"&&!!s,e.checked=U?e.checked:!!s,e.defaultChecked=!!s,C!=null&&typeof C!="function"&&typeof C!="symbol"&&typeof C!="boolean"&&(e.name=C),po(e)}function go(e,n,a){n==="number"&&Sl(e.ownerDocument)===e||e.defaultValue===""+a||(e.defaultValue=""+a)}function ha(e,n,a,s){if(e=e.options,n){n={};for(var m=0;m<a.length;m++)n["$"+a[m]]=!0;for(a=0;a<e.length;a++)m=n.hasOwnProperty("$"+e[a].value),e[a].selected!==m&&(e[a].selected=m),m&&s&&(e[a].defaultSelected=!0)}else{for(a=""+mn(a),n=null,m=0;m<e.length;m++){if(e[m].value===a){e[m].selected=!0,s&&(e[m].defaultSelected=!0);return}n!==null||e[m].disabled||(n=e[m])}n!==null&&(n.selected=!0)}}function Zd(e,n,a){if(n!=null&&(n=""+mn(n),n!==e.value&&(e.value=n),a==null)){e.defaultValue!==n&&(e.defaultValue=n);return}e.defaultValue=a!=null?""+mn(a):""}function Qd(e,n,a,s){if(n==null){if(s!=null){if(a!=null)throw Error(l(92));if(Q(s)){if(1<s.length)throw Error(l(93));s=s[0]}a=s}a==null&&(a=""),n=a}a=mn(n),e.defaultValue=a,s=e.textContent,s===a&&s!==""&&s!==null&&(e.value=s),po(e)}function pa(e,n){if(n){var a=e.firstChild;if(a&&a===e.lastChild&&a.nodeType===3){a.nodeValue=n;return}}e.textContent=n}var $b=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 Jd(e,n,a){var s=n.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?s?e.setProperty(n,""):n==="float"?e.cssFloat="":e[n]="":s?e.setProperty(n,a):typeof a!="number"||a===0||$b.has(n)?n==="float"?e.cssFloat=a:e[n]=(""+a).trim():e[n]=a+"px"}function Wd(e,n,a){if(n!=null&&typeof n!="object")throw Error(l(62));if(e=e.style,a!=null){for(var s in a)!a.hasOwnProperty(s)||n!=null&&n.hasOwnProperty(s)||(s.indexOf("--")===0?e.setProperty(s,""):s==="float"?e.cssFloat="":e[s]="");for(var m in n)s=n[m],n.hasOwnProperty(m)&&a[m]!==s&&Jd(e,m,s)}else for(var g in n)n.hasOwnProperty(g)&&Jd(e,g,n[g])}function xo(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Xb=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"]]),Zb=/^[\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 kl(e){return Zb.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Kn(){}var bo=null;function yo(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var ma=null,ga=null;function ef(e){var n=ca(e);if(n&&(e=n.stateNode)){var a=e[Te]||null;e:switch(e=n.stateNode,n.type){case"input":if(mo(e,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),n=a.name,a.type==="radio"&&n!=null){for(a=e;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+gn(""+n)+'"][type="radio"]'),n=0;n<a.length;n++){var s=a[n];if(s!==e&&s.form===e.form){var m=s[Te]||null;if(!m)throw Error(l(90));mo(s,m.value,m.defaultValue,m.defaultValue,m.checked,m.defaultChecked,m.type,m.name)}}for(n=0;n<a.length;n++)s=a[n],s.form===e.form&&$d(s)}break e;case"textarea":Zd(e,a.value,a.defaultValue);break e;case"select":n=a.value,n!=null&&ha(e,!!a.multiple,n,!1)}}}var vo=!1;function tf(e,n,a){if(vo)return e(n,a);vo=!0;try{var s=e(n);return s}finally{if(vo=!1,(ma!==null||ga!==null)&&(cs(),ma&&(n=ma,e=ga,ga=ma=null,ef(n),e)))for(n=0;n<e.length;n++)ef(e[n])}}function or(e,n){var a=e.stateNode;if(a===null)return null;var s=a[Te]||null;if(s===null)return null;a=s[n];e:switch(n){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(s=!s.disabled)||(e=e.type,s=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!s;break e;default:e=!1}if(e)return null;if(a&&typeof a!="function")throw Error(l(231,n,typeof a));return a}var $n=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),wo=!1;if($n)try{var ur={};Object.defineProperty(ur,"passive",{get:function(){wo=!0}}),window.addEventListener("test",ur,ur),window.removeEventListener("test",ur,ur)}catch{wo=!1}var pi=null,So=null,jl=null;function nf(){if(jl)return jl;var e,n=So,a=n.length,s,m="value"in pi?pi.value:pi.textContent,g=m.length;for(e=0;e<a&&n[e]===m[e];e++);var C=a-e;for(s=1;s<=C&&n[a-s]===m[g-s];s++);return jl=m.slice(e,1<s?1-s:void 0)}function _l(e){var n=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&n===13&&(e=13)):e=n,e===10&&(e=13),32<=e||e===13?e:0}function Cl(){return!0}function af(){return!1}function Zt(e){function n(a,s,m,g,C){this._reactName=a,this._targetInst=m,this.type=s,this.nativeEvent=g,this.target=C,this.currentTarget=null;for(var U in e)e.hasOwnProperty(U)&&(a=e[U],this[U]=a?a(g):g[U]);return this.isDefaultPrevented=(g.defaultPrevented!=null?g.defaultPrevented:g.returnValue===!1)?Cl:af,this.isPropagationStopped=af,this}return x(n.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=Cl)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=Cl)},persist:function(){},isPersistent:Cl}),n}var qi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Nl=Zt(qi),cr=x({},qi,{view:0,detail:0}),Qb=Zt(cr),ko,jo,dr,El=x({},cr,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Co,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==dr&&(dr&&e.type==="mousemove"?(ko=e.screenX-dr.screenX,jo=e.screenY-dr.screenY):jo=ko=0,dr=e),ko)},movementY:function(e){return"movementY"in e?e.movementY:jo}}),rf=Zt(El),Jb=x({},El,{dataTransfer:0}),Wb=Zt(Jb),e0=x({},cr,{relatedTarget:0}),_o=Zt(e0),t0=x({},qi,{animationName:0,elapsedTime:0,pseudoElement:0}),n0=Zt(t0),i0=x({},qi,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),a0=Zt(i0),r0=x({},qi,{data:0}),lf=Zt(r0),l0={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},s0={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"},o0={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function u0(e){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(e):(e=o0[e])?!!n[e]:!1}function Co(){return u0}var c0=x({},cr,{key:function(e){if(e.key){var n=l0[e.key]||e.key;if(n!=="Unidentified")return n}return e.type==="keypress"?(e=_l(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?s0[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Co,charCode:function(e){return e.type==="keypress"?_l(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?_l(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),d0=Zt(c0),f0=x({},El,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),sf=Zt(f0),h0=x({},cr,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Co}),p0=Zt(h0),m0=x({},qi,{propertyName:0,elapsedTime:0,pseudoElement:0}),g0=Zt(m0),x0=x({},El,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),b0=Zt(x0),y0=x({},qi,{newState:0,oldState:0}),v0=Zt(y0),w0=[9,13,27,32],No=$n&&"CompositionEvent"in window,fr=null;$n&&"documentMode"in document&&(fr=document.documentMode);var S0=$n&&"TextEvent"in window&&!fr,of=$n&&(!No||fr&&8<fr&&11>=fr),uf=" ",cf=!1;function df(e,n){switch(e){case"keyup":return w0.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ff(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var xa=!1;function k0(e,n){switch(e){case"compositionend":return ff(n);case"keypress":return n.which!==32?null:(cf=!0,uf);case"textInput":return e=n.data,e===uf&&cf?null:e;default:return null}}function j0(e,n){if(xa)return e==="compositionend"||!No&&df(e,n)?(e=nf(),jl=So=pi=null,xa=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1<n.char.length)return n.char;if(n.which)return String.fromCharCode(n.which)}return null;case"compositionend":return of&&n.locale!=="ko"?null:n.data;default:return null}}var _0={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 hf(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n==="input"?!!_0[e.type]:n==="textarea"}function pf(e,n,a,s){ma?ga?ga.push(s):ga=[s]:ma=s,n=xs(n,"onChange"),0<n.length&&(a=new Nl("onChange","change",null,a,s),e.push({event:a,listeners:n}))}var hr=null,pr=null;function C0(e){Zp(e,0)}function Al(e){var n=sr(e);if($d(n))return e}function mf(e,n){if(e==="change")return n}var gf=!1;if($n){var Eo;if($n){var Ao="oninput"in document;if(!Ao){var xf=document.createElement("div");xf.setAttribute("oninput","return;"),Ao=typeof xf.oninput=="function"}Eo=Ao}else Eo=!1;gf=Eo&&(!document.documentMode||9<document.documentMode)}function bf(){hr&&(hr.detachEvent("onpropertychange",yf),pr=hr=null)}function yf(e){if(e.propertyName==="value"&&Al(pr)){var n=[];pf(n,pr,e,yo(e)),tf(C0,n)}}function N0(e,n,a){e==="focusin"?(bf(),hr=n,pr=a,hr.attachEvent("onpropertychange",yf)):e==="focusout"&&bf()}function E0(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Al(pr)}function A0(e,n){if(e==="click")return Al(n)}function z0(e,n){if(e==="input"||e==="change")return Al(n)}function T0(e,n){return e===n&&(e!==0||1/e===1/n)||e!==e&&n!==n}var rn=typeof Object.is=="function"?Object.is:T0;function mr(e,n){if(rn(e,n))return!0;if(typeof e!="object"||e===null||typeof n!="object"||n===null)return!1;var a=Object.keys(e),s=Object.keys(n);if(a.length!==s.length)return!1;for(s=0;s<a.length;s++){var m=a[s];if(!ne.call(n,m)||!rn(e[m],n[m]))return!1}return!0}function vf(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function wf(e,n){var a=vf(e);e=0;for(var s;a;){if(a.nodeType===3){if(s=e+a.textContent.length,e<=n&&s>=n)return{node:a,offset:n-e};e=s}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=vf(a)}}function Sf(e,n){return e&&n?e===n?!0:e&&e.nodeType===3?!1:n&&n.nodeType===3?Sf(e,n.parentNode):"contains"in e?e.contains(n):e.compareDocumentPosition?!!(e.compareDocumentPosition(n)&16):!1:!1}function kf(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var n=Sl(e.document);n instanceof e.HTMLIFrameElement;){try{var a=typeof n.contentWindow.location.href=="string"}catch{a=!1}if(a)e=n.contentWindow;else break;n=Sl(e.document)}return n}function zo(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n&&(n==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||n==="textarea"||e.contentEditable==="true")}var R0=$n&&"documentMode"in document&&11>=document.documentMode,ba=null,To=null,gr=null,Ro=!1;function jf(e,n,a){var s=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;Ro||ba==null||ba!==Sl(s)||(s=ba,"selectionStart"in s&&zo(s)?s={start:s.selectionStart,end:s.selectionEnd}:(s=(s.ownerDocument&&s.ownerDocument.defaultView||window).getSelection(),s={anchorNode:s.anchorNode,anchorOffset:s.anchorOffset,focusNode:s.focusNode,focusOffset:s.focusOffset}),gr&&mr(gr,s)||(gr=s,s=xs(To,"onSelect"),0<s.length&&(n=new Nl("onSelect","select",null,n,a),e.push({event:n,listeners:s}),n.target=ba)))}function Vi(e,n){var a={};return a[e.toLowerCase()]=n.toLowerCase(),a["Webkit"+e]="webkit"+n,a["Moz"+e]="moz"+n,a}var ya={animationend:Vi("Animation","AnimationEnd"),animationiteration:Vi("Animation","AnimationIteration"),animationstart:Vi("Animation","AnimationStart"),transitionrun:Vi("Transition","TransitionRun"),transitionstart:Vi("Transition","TransitionStart"),transitioncancel:Vi("Transition","TransitionCancel"),transitionend:Vi("Transition","TransitionEnd")},Oo={},_f={};$n&&(_f=document.createElement("div").style,"AnimationEvent"in window||(delete ya.animationend.animation,delete ya.animationiteration.animation,delete ya.animationstart.animation),"TransitionEvent"in window||delete ya.transitionend.transition);function Yi(e){if(Oo[e])return Oo[e];if(!ya[e])return e;var n=ya[e],a;for(a in n)if(n.hasOwnProperty(a)&&a in _f)return Oo[e]=n[a];return e}var Cf=Yi("animationend"),Nf=Yi("animationiteration"),Ef=Yi("animationstart"),O0=Yi("transitionrun"),D0=Yi("transitionstart"),M0=Yi("transitioncancel"),Af=Yi("transitionend"),zf=new Map,Do="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(" ");Do.push("scrollEnd");function An(e,n){zf.set(e,n),Fi(n,[e])}var zl=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var n=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(n))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},xn=[],va=0,Mo=0;function Tl(){for(var e=va,n=Mo=va=0;n<e;){var a=xn[n];xn[n++]=null;var s=xn[n];xn[n++]=null;var m=xn[n];xn[n++]=null;var g=xn[n];if(xn[n++]=null,s!==null&&m!==null){var C=s.pending;C===null?m.next=m:(m.next=C.next,C.next=m),s.pending=m}g!==0&&Tf(a,m,g)}}function Rl(e,n,a,s){xn[va++]=e,xn[va++]=n,xn[va++]=a,xn[va++]=s,Mo|=s,e.lanes|=s,e=e.alternate,e!==null&&(e.lanes|=s)}function Lo(e,n,a,s){return Rl(e,n,a,s),Ol(e)}function Gi(e,n){return Rl(e,null,null,n),Ol(e)}function Tf(e,n,a){e.lanes|=a;var s=e.alternate;s!==null&&(s.lanes|=a);for(var m=!1,g=e.return;g!==null;)g.childLanes|=a,s=g.alternate,s!==null&&(s.childLanes|=a),g.tag===22&&(e=g.stateNode,e===null||e._visibility&1||(m=!0)),e=g,g=g.return;return e.tag===3?(g=e.stateNode,m&&n!==null&&(m=31-Le(a),e=g.hiddenUpdates,s=e[m],s===null?e[m]=[n]:s.push(n),n.lane=a|536870912),g):null}function Ol(e){if(50<Ur)throw Ur=0,Yu=null,Error(l(185));for(var n=e.return;n!==null;)e=n,n=e.return;return e.tag===3?e.stateNode:null}var wa={};function L0(e,n,a,s){this.tag=e,this.key=a,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=n,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=s,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ln(e,n,a,s){return new L0(e,n,a,s)}function Bo(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Xn(e,n){var a=e.alternate;return a===null?(a=ln(e.tag,n,e.key,e.mode),a.elementType=e.elementType,a.type=e.type,a.stateNode=e.stateNode,a.alternate=e,e.alternate=a):(a.pendingProps=n,a.type=e.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=e.flags&65011712,a.childLanes=e.childLanes,a.lanes=e.lanes,a.child=e.child,a.memoizedProps=e.memoizedProps,a.memoizedState=e.memoizedState,a.updateQueue=e.updateQueue,n=e.dependencies,a.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},a.sibling=e.sibling,a.index=e.index,a.ref=e.ref,a.refCleanup=e.refCleanup,a}function Rf(e,n){e.flags&=65011714;var a=e.alternate;return a===null?(e.childLanes=0,e.lanes=n,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=a.childLanes,e.lanes=a.lanes,e.child=a.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=a.memoizedProps,e.memoizedState=a.memoizedState,e.updateQueue=a.updateQueue,e.type=a.type,n=a.dependencies,e.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext}),e}function Dl(e,n,a,s,m,g){var C=0;if(s=e,typeof e=="function")Bo(e)&&(C=1);else if(typeof e=="string")C=Py(e,a,ie.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case P:return e=ln(31,a,n,m),e.elementType=P,e.lanes=g,e;case v:return Ki(a.children,m,g,n);case k:C=8,m|=24;break;case S:return e=ln(12,a,n,m|2),e.elementType=S,e.lanes=g,e;case D:return e=ln(13,a,n,m),e.elementType=D,e.lanes=g,e;case z:return e=ln(19,a,n,m),e.elementType=z,e.lanes=g,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case N:C=10;break e;case _:C=9;break e;case B:C=11;break e;case R:C=14;break e;case G:C=16,s=null;break e}C=29,a=Error(l(130,e===null?"null":typeof e,"")),s=null}return n=ln(C,a,n,m),n.elementType=e,n.type=s,n.lanes=g,n}function Ki(e,n,a,s){return e=ln(7,e,s,n),e.lanes=a,e}function Uo(e,n,a){return e=ln(6,e,null,n),e.lanes=a,e}function Of(e){var n=ln(18,null,null,0);return n.stateNode=e,n}function Io(e,n,a){return n=ln(4,e.children!==null?e.children:[],e.key,n),n.lanes=a,n.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},n}var Df=new WeakMap;function bn(e,n){if(typeof e=="object"&&e!==null){var a=Df.get(e);return a!==void 0?a:(n={value:e,source:n,stack:F(n)},Df.set(e,n),n)}return{value:e,source:n,stack:F(n)}}var Sa=[],ka=0,Ml=null,xr=0,yn=[],vn=0,mi=null,Mn=1,Ln="";function Zn(e,n){Sa[ka++]=xr,Sa[ka++]=Ml,Ml=e,xr=n}function Mf(e,n,a){yn[vn++]=Mn,yn[vn++]=Ln,yn[vn++]=mi,mi=e;var s=Mn;e=Ln;var m=32-Le(s)-1;s&=~(1<<m),a+=1;var g=32-Le(n)+m;if(30<g){var C=m-m%5;g=(s&(1<<C)-1).toString(32),s>>=C,m-=C,Mn=1<<32-Le(n)+m|a<<m|s,Ln=g+e}else Mn=1<<g|a<<m|s,Ln=e}function Ho(e){e.return!==null&&(Zn(e,1),Mf(e,1,0))}function Po(e){for(;e===Ml;)Ml=Sa[--ka],Sa[ka]=null,xr=Sa[--ka],Sa[ka]=null;for(;e===mi;)mi=yn[--vn],yn[vn]=null,Ln=yn[--vn],yn[vn]=null,Mn=yn[--vn],yn[vn]=null}function Lf(e,n){yn[vn++]=Mn,yn[vn++]=Ln,yn[vn++]=mi,Mn=n.id,Ln=n.overflow,mi=e}var It=null,St=null,rt=!1,gi=null,wn=!1,Fo=Error(l(519));function xi(e){var n=Error(l(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw br(bn(n,e)),Fo}function Bf(e){var n=e.stateNode,a=e.type,s=e.memoizedProps;switch(n[Ne]=e,n[Te]=s,a){case"dialog":et("cancel",n),et("close",n);break;case"iframe":case"object":case"embed":et("load",n);break;case"video":case"audio":for(a=0;a<Hr.length;a++)et(Hr[a],n);break;case"source":et("error",n);break;case"img":case"image":case"link":et("error",n),et("load",n);break;case"details":et("toggle",n);break;case"input":et("invalid",n),Xd(n,s.value,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name,!0);break;case"select":et("invalid",n);break;case"textarea":et("invalid",n),Qd(n,s.value,s.defaultValue,s.children)}a=s.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||n.textContent===""+a||s.suppressHydrationWarning===!0||em(n.textContent,a)?(s.popover!=null&&(et("beforetoggle",n),et("toggle",n)),s.onScroll!=null&&et("scroll",n),s.onScrollEnd!=null&&et("scrollend",n),s.onClick!=null&&(n.onclick=Kn),n=!0):n=!1,n||xi(e,!0)}function Uf(e){for(It=e.return;It;)switch(It.tag){case 5:case 31:case 13:wn=!1;return;case 27:case 3:wn=!0;return;default:It=It.return}}function ja(e){if(e!==It)return!1;if(!rt)return Uf(e),rt=!0,!1;var n=e.tag,a;if((a=n!==3&&n!==27)&&((a=n===5)&&(a=e.type,a=!(a!=="form"&&a!=="button")||lc(e.type,e.memoizedProps)),a=!a),a&&St&&xi(e),Uf(e),n===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(l(317));St=um(e)}else if(n===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(l(317));St=um(e)}else n===27?(n=St,Ti(e.type)?(e=dc,dc=null,St=e):St=n):St=It?kn(e.stateNode.nextSibling):null;return!0}function $i(){St=It=null,rt=!1}function qo(){var e=gi;return e!==null&&(en===null?en=e:en.push.apply(en,e),gi=null),e}function br(e){gi===null?gi=[e]:gi.push(e)}var Vo=O(null),Xi=null,Qn=null;function bi(e,n,a){M(Vo,n._currentValue),n._currentValue=a}function Jn(e){e._currentValue=Vo.current,H(Vo)}function Yo(e,n,a){for(;e!==null;){var s=e.alternate;if((e.childLanes&n)!==n?(e.childLanes|=n,s!==null&&(s.childLanes|=n)):s!==null&&(s.childLanes&n)!==n&&(s.childLanes|=n),e===a)break;e=e.return}}function Go(e,n,a,s){var m=e.child;for(m!==null&&(m.return=e);m!==null;){var g=m.dependencies;if(g!==null){var C=m.child;g=g.firstContext;e:for(;g!==null;){var U=g;g=m;for(var Z=0;Z<n.length;Z++)if(U.context===n[Z]){g.lanes|=a,U=g.alternate,U!==null&&(U.lanes|=a),Yo(g.return,a,e),s||(C=null);break e}g=U.next}}else if(m.tag===18){if(C=m.return,C===null)throw Error(l(341));C.lanes|=a,g=C.alternate,g!==null&&(g.lanes|=a),Yo(C,a,e),C=null}else C=m.child;if(C!==null)C.return=m;else for(C=m;C!==null;){if(C===e){C=null;break}if(m=C.sibling,m!==null){m.return=C.return,C=m;break}C=C.return}m=C}}function _a(e,n,a,s){e=null;for(var m=n,g=!1;m!==null;){if(!g){if((m.flags&524288)!==0)g=!0;else if((m.flags&262144)!==0)break}if(m.tag===10){var C=m.alternate;if(C===null)throw Error(l(387));if(C=C.memoizedProps,C!==null){var U=m.type;rn(m.pendingProps.value,C.value)||(e!==null?e.push(U):e=[U])}}else if(m===ze.current){if(C=m.alternate,C===null)throw Error(l(387));C.memoizedState.memoizedState!==m.memoizedState.memoizedState&&(e!==null?e.push(Yr):e=[Yr])}m=m.return}e!==null&&Go(n,e,a,s),n.flags|=262144}function Ll(e){for(e=e.firstContext;e!==null;){if(!rn(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Zi(e){Xi=e,Qn=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Ht(e){return If(Xi,e)}function Bl(e,n){return Xi===null&&Zi(e),If(e,n)}function If(e,n){var a=n._currentValue;if(n={context:n,memoizedValue:a,next:null},Qn===null){if(e===null)throw Error(l(308));Qn=n,e.dependencies={lanes:0,firstContext:n},e.flags|=524288}else Qn=Qn.next=n;return a}var B0=typeof AbortController<"u"?AbortController:function(){var e=[],n=this.signal={aborted:!1,addEventListener:function(a,s){e.push(s)}};this.abort=function(){n.aborted=!0,e.forEach(function(a){return a()})}},U0=t.unstable_scheduleCallback,I0=t.unstable_NormalPriority,Tt={$$typeof:N,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Ko(){return{controller:new B0,data:new Map,refCount:0}}function yr(e){e.refCount--,e.refCount===0&&U0(I0,function(){e.controller.abort()})}var vr=null,$o=0,Ca=0,Na=null;function H0(e,n){if(vr===null){var a=vr=[];$o=0,Ca=Qu(),Na={status:"pending",value:void 0,then:function(s){a.push(s)}}}return $o++,n.then(Hf,Hf),n}function Hf(){if(--$o===0&&vr!==null){Na!==null&&(Na.status="fulfilled");var e=vr;vr=null,Ca=0,Na=null;for(var n=0;n<e.length;n++)(0,e[n])()}}function P0(e,n){var a=[],s={status:"pending",value:null,reason:null,then:function(m){a.push(m)}};return e.then(function(){s.status="fulfilled",s.value=n;for(var m=0;m<a.length;m++)(0,a[m])(n)},function(m){for(s.status="rejected",s.reason=m,m=0;m<a.length;m++)(0,a[m])(void 0)}),s}var Pf=$.S;$.S=function(e,n){jp=Ee(),typeof n=="object"&&n!==null&&typeof n.then=="function"&&H0(e,n),Pf!==null&&Pf(e,n)};var Qi=O(null);function Xo(){var e=Qi.current;return e!==null?e:yt.pooledCache}function Ul(e,n){n===null?M(Qi,Qi.current):M(Qi,n.pool)}function Ff(){var e=Xo();return e===null?null:{parent:Tt._currentValue,pool:e}}var Ea=Error(l(460)),Zo=Error(l(474)),Il=Error(l(542)),Hl={then:function(){}};function qf(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Vf(e,n,a){switch(a=e[a],a===void 0?e.push(n):a!==n&&(n.then(Kn,Kn),n=a),n.status){case"fulfilled":return n.value;case"rejected":throw e=n.reason,Gf(e),e;default:if(typeof n.status=="string")n.then(Kn,Kn);else{if(e=yt,e!==null&&100<e.shellSuspendCounter)throw Error(l(482));e=n,e.status="pending",e.then(function(s){if(n.status==="pending"){var m=n;m.status="fulfilled",m.value=s}},function(s){if(n.status==="pending"){var m=n;m.status="rejected",m.reason=s}})}switch(n.status){case"fulfilled":return n.value;case"rejected":throw e=n.reason,Gf(e),e}throw Wi=n,Ea}}function Ji(e){try{var n=e._init;return n(e._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(Wi=a,Ea):a}}var Wi=null;function Yf(){if(Wi===null)throw Error(l(459));var e=Wi;return Wi=null,e}function Gf(e){if(e===Ea||e===Il)throw Error(l(483))}var Aa=null,wr=0;function Pl(e){var n=wr;return wr+=1,Aa===null&&(Aa=[]),Vf(Aa,e,n)}function Sr(e,n){n=n.props.ref,e.ref=n!==void 0?n:null}function Fl(e,n){throw n.$$typeof===w?Error(l(525)):(e=Object.prototype.toString.call(n),Error(l(31,e==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":e)))}function Kf(e){function n(le,te){if(e){var oe=le.deletions;oe===null?(le.deletions=[te],le.flags|=16):oe.push(te)}}function a(le,te){if(!e)return null;for(;te!==null;)n(le,te),te=te.sibling;return null}function s(le){for(var te=new Map;le!==null;)le.key!==null?te.set(le.key,le):te.set(le.index,le),le=le.sibling;return te}function m(le,te){return le=Xn(le,te),le.index=0,le.sibling=null,le}function g(le,te,oe){return le.index=oe,e?(oe=le.alternate,oe!==null?(oe=oe.index,oe<te?(le.flags|=67108866,te):oe):(le.flags|=67108866,te)):(le.flags|=1048576,te)}function C(le){return e&&le.alternate===null&&(le.flags|=67108866),le}function U(le,te,oe,Se){return te===null||te.tag!==6?(te=Uo(oe,le.mode,Se),te.return=le,te):(te=m(te,oe),te.return=le,te)}function Z(le,te,oe,Se){var Fe=oe.type;return Fe===v?ge(le,te,oe.props.children,Se,oe.key):te!==null&&(te.elementType===Fe||typeof Fe=="object"&&Fe!==null&&Fe.$$typeof===G&&Ji(Fe)===te.type)?(te=m(te,oe.props),Sr(te,oe),te.return=le,te):(te=Dl(oe.type,oe.key,oe.props,null,le.mode,Se),Sr(te,oe),te.return=le,te)}function ue(le,te,oe,Se){return te===null||te.tag!==4||te.stateNode.containerInfo!==oe.containerInfo||te.stateNode.implementation!==oe.implementation?(te=Io(oe,le.mode,Se),te.return=le,te):(te=m(te,oe.children||[]),te.return=le,te)}function ge(le,te,oe,Se,Fe){return te===null||te.tag!==7?(te=Ki(oe,le.mode,Se,Fe),te.return=le,te):(te=m(te,oe),te.return=le,te)}function _e(le,te,oe){if(typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint")return te=Uo(""+te,le.mode,oe),te.return=le,te;if(typeof te=="object"&&te!==null){switch(te.$$typeof){case y:return oe=Dl(te.type,te.key,te.props,null,le.mode,oe),Sr(oe,te),oe.return=le,oe;case j:return te=Io(te,le.mode,oe),te.return=le,te;case G:return te=Ji(te),_e(le,te,oe)}if(Q(te)||I(te))return te=Ki(te,le.mode,oe,null),te.return=le,te;if(typeof te.then=="function")return _e(le,Pl(te),oe);if(te.$$typeof===N)return _e(le,Bl(le,te),oe);Fl(le,te)}return null}function ce(le,te,oe,Se){var Fe=te!==null?te.key:null;if(typeof oe=="string"&&oe!==""||typeof oe=="number"||typeof oe=="bigint")return Fe!==null?null:U(le,te,""+oe,Se);if(typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case y:return oe.key===Fe?Z(le,te,oe,Se):null;case j:return oe.key===Fe?ue(le,te,oe,Se):null;case G:return oe=Ji(oe),ce(le,te,oe,Se)}if(Q(oe)||I(oe))return Fe!==null?null:ge(le,te,oe,Se,null);if(typeof oe.then=="function")return ce(le,te,Pl(oe),Se);if(oe.$$typeof===N)return ce(le,te,Bl(le,oe),Se);Fl(le,oe)}return null}function he(le,te,oe,Se,Fe){if(typeof Se=="string"&&Se!==""||typeof Se=="number"||typeof Se=="bigint")return le=le.get(oe)||null,U(te,le,""+Se,Fe);if(typeof Se=="object"&&Se!==null){switch(Se.$$typeof){case y:return le=le.get(Se.key===null?oe:Se.key)||null,Z(te,le,Se,Fe);case j:return le=le.get(Se.key===null?oe:Se.key)||null,ue(te,le,Se,Fe);case G:return Se=Ji(Se),he(le,te,oe,Se,Fe)}if(Q(Se)||I(Se))return le=le.get(oe)||null,ge(te,le,Se,Fe,null);if(typeof Se.then=="function")return he(le,te,oe,Pl(Se),Fe);if(Se.$$typeof===N)return he(le,te,oe,Bl(te,Se),Fe);Fl(te,Se)}return null}function Ue(le,te,oe,Se){for(var Fe=null,ot=null,He=te,Ze=te=0,at=null;He!==null&&Ze<oe.length;Ze++){He.index>Ze?(at=He,He=null):at=He.sibling;var ut=ce(le,He,oe[Ze],Se);if(ut===null){He===null&&(He=at);break}e&&He&&ut.alternate===null&&n(le,He),te=g(ut,te,Ze),ot===null?Fe=ut:ot.sibling=ut,ot=ut,He=at}if(Ze===oe.length)return a(le,He),rt&&Zn(le,Ze),Fe;if(He===null){for(;Ze<oe.length;Ze++)He=_e(le,oe[Ze],Se),He!==null&&(te=g(He,te,Ze),ot===null?Fe=He:ot.sibling=He,ot=He);return rt&&Zn(le,Ze),Fe}for(He=s(He);Ze<oe.length;Ze++)at=he(He,le,Ze,oe[Ze],Se),at!==null&&(e&&at.alternate!==null&&He.delete(at.key===null?Ze:at.key),te=g(at,te,Ze),ot===null?Fe=at:ot.sibling=at,ot=at);return e&&He.forEach(function(Li){return n(le,Li)}),rt&&Zn(le,Ze),Fe}function Ye(le,te,oe,Se){if(oe==null)throw Error(l(151));for(var Fe=null,ot=null,He=te,Ze=te=0,at=null,ut=oe.next();He!==null&&!ut.done;Ze++,ut=oe.next()){He.index>Ze?(at=He,He=null):at=He.sibling;var Li=ce(le,He,ut.value,Se);if(Li===null){He===null&&(He=at);break}e&&He&&Li.alternate===null&&n(le,He),te=g(Li,te,Ze),ot===null?Fe=Li:ot.sibling=Li,ot=Li,He=at}if(ut.done)return a(le,He),rt&&Zn(le,Ze),Fe;if(He===null){for(;!ut.done;Ze++,ut=oe.next())ut=_e(le,ut.value,Se),ut!==null&&(te=g(ut,te,Ze),ot===null?Fe=ut:ot.sibling=ut,ot=ut);return rt&&Zn(le,Ze),Fe}for(He=s(He);!ut.done;Ze++,ut=oe.next())ut=he(He,le,Ze,ut.value,Se),ut!==null&&(e&&ut.alternate!==null&&He.delete(ut.key===null?Ze:ut.key),te=g(ut,te,Ze),ot===null?Fe=ut:ot.sibling=ut,ot=ut);return e&&He.forEach(function(Jy){return n(le,Jy)}),rt&&Zn(le,Ze),Fe}function bt(le,te,oe,Se){if(typeof oe=="object"&&oe!==null&&oe.type===v&&oe.key===null&&(oe=oe.props.children),typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case y:e:{for(var Fe=oe.key;te!==null;){if(te.key===Fe){if(Fe=oe.type,Fe===v){if(te.tag===7){a(le,te.sibling),Se=m(te,oe.props.children),Se.return=le,le=Se;break e}}else if(te.elementType===Fe||typeof Fe=="object"&&Fe!==null&&Fe.$$typeof===G&&Ji(Fe)===te.type){a(le,te.sibling),Se=m(te,oe.props),Sr(Se,oe),Se.return=le,le=Se;break e}a(le,te);break}else n(le,te);te=te.sibling}oe.type===v?(Se=Ki(oe.props.children,le.mode,Se,oe.key),Se.return=le,le=Se):(Se=Dl(oe.type,oe.key,oe.props,null,le.mode,Se),Sr(Se,oe),Se.return=le,le=Se)}return C(le);case j:e:{for(Fe=oe.key;te!==null;){if(te.key===Fe)if(te.tag===4&&te.stateNode.containerInfo===oe.containerInfo&&te.stateNode.implementation===oe.implementation){a(le,te.sibling),Se=m(te,oe.children||[]),Se.return=le,le=Se;break e}else{a(le,te);break}else n(le,te);te=te.sibling}Se=Io(oe,le.mode,Se),Se.return=le,le=Se}return C(le);case G:return oe=Ji(oe),bt(le,te,oe,Se)}if(Q(oe))return Ue(le,te,oe,Se);if(I(oe)){if(Fe=I(oe),typeof Fe!="function")throw Error(l(150));return oe=Fe.call(oe),Ye(le,te,oe,Se)}if(typeof oe.then=="function")return bt(le,te,Pl(oe),Se);if(oe.$$typeof===N)return bt(le,te,Bl(le,oe),Se);Fl(le,oe)}return typeof oe=="string"&&oe!==""||typeof oe=="number"||typeof oe=="bigint"?(oe=""+oe,te!==null&&te.tag===6?(a(le,te.sibling),Se=m(te,oe),Se.return=le,le=Se):(a(le,te),Se=Uo(oe,le.mode,Se),Se.return=le,le=Se),C(le)):a(le,te)}return function(le,te,oe,Se){try{wr=0;var Fe=bt(le,te,oe,Se);return Aa=null,Fe}catch(He){if(He===Ea||He===Il)throw He;var ot=ln(29,He,null,le.mode);return ot.lanes=Se,ot.return=le,ot}}}var ea=Kf(!0),$f=Kf(!1),yi=!1;function Qo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Jo(e,n){e=e.updateQueue,n.updateQueue===e&&(n.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function vi(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function wi(e,n,a){var s=e.updateQueue;if(s===null)return null;if(s=s.shared,(dt&2)!==0){var m=s.pending;return m===null?n.next=n:(n.next=m.next,m.next=n),s.pending=n,n=Ol(e),Tf(e,null,a),n}return Rl(e,s,n,a),Ol(e)}function kr(e,n,a){if(n=n.updateQueue,n!==null&&(n=n.shared,(a&4194048)!==0)){var s=n.lanes;s&=e.pendingLanes,a|=s,n.lanes=a,co(e,a)}}function Wo(e,n){var a=e.updateQueue,s=e.alternate;if(s!==null&&(s=s.updateQueue,a===s)){var m=null,g=null;if(a=a.firstBaseUpdate,a!==null){do{var C={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};g===null?m=g=C:g=g.next=C,a=a.next}while(a!==null);g===null?m=g=n:g=g.next=n}else m=g=n;a={baseState:s.baseState,firstBaseUpdate:m,lastBaseUpdate:g,shared:s.shared,callbacks:s.callbacks},e.updateQueue=a;return}e=a.lastBaseUpdate,e===null?a.firstBaseUpdate=n:e.next=n,a.lastBaseUpdate=n}var eu=!1;function jr(){if(eu){var e=Na;if(e!==null)throw e}}function _r(e,n,a,s){eu=!1;var m=e.updateQueue;yi=!1;var g=m.firstBaseUpdate,C=m.lastBaseUpdate,U=m.shared.pending;if(U!==null){m.shared.pending=null;var Z=U,ue=Z.next;Z.next=null,C===null?g=ue:C.next=ue,C=Z;var ge=e.alternate;ge!==null&&(ge=ge.updateQueue,U=ge.lastBaseUpdate,U!==C&&(U===null?ge.firstBaseUpdate=ue:U.next=ue,ge.lastBaseUpdate=Z))}if(g!==null){var _e=m.baseState;C=0,ge=ue=Z=null,U=g;do{var ce=U.lane&-536870913,he=ce!==U.lane;if(he?(it&ce)===ce:(s&ce)===ce){ce!==0&&ce===Ca&&(eu=!0),ge!==null&&(ge=ge.next={lane:0,tag:U.tag,payload:U.payload,callback:null,next:null});e:{var Ue=e,Ye=U;ce=n;var bt=a;switch(Ye.tag){case 1:if(Ue=Ye.payload,typeof Ue=="function"){_e=Ue.call(bt,_e,ce);break e}_e=Ue;break e;case 3:Ue.flags=Ue.flags&-65537|128;case 0:if(Ue=Ye.payload,ce=typeof Ue=="function"?Ue.call(bt,_e,ce):Ue,ce==null)break e;_e=x({},_e,ce);break e;case 2:yi=!0}}ce=U.callback,ce!==null&&(e.flags|=64,he&&(e.flags|=8192),he=m.callbacks,he===null?m.callbacks=[ce]:he.push(ce))}else he={lane:ce,tag:U.tag,payload:U.payload,callback:U.callback,next:null},ge===null?(ue=ge=he,Z=_e):ge=ge.next=he,C|=ce;if(U=U.next,U===null){if(U=m.shared.pending,U===null)break;he=U,U=he.next,he.next=null,m.lastBaseUpdate=he,m.shared.pending=null}}while(!0);ge===null&&(Z=_e),m.baseState=Z,m.firstBaseUpdate=ue,m.lastBaseUpdate=ge,g===null&&(m.shared.lanes=0),Ci|=C,e.lanes=C,e.memoizedState=_e}}function Xf(e,n){if(typeof e!="function")throw Error(l(191,e));e.call(n)}function Zf(e,n){var a=e.callbacks;if(a!==null)for(e.callbacks=null,e=0;e<a.length;e++)Xf(a[e],n)}var za=O(null),ql=O(0);function Qf(e,n){e=si,M(ql,e),M(za,n),si=e|n.baseLanes}function tu(){M(ql,si),M(za,za.current)}function nu(){si=ql.current,H(za),H(ql)}var sn=O(null),Sn=null;function Si(e){var n=e.alternate;M(Et,Et.current&1),M(sn,e),Sn===null&&(n===null||za.current!==null||n.memoizedState!==null)&&(Sn=e)}function iu(e){M(Et,Et.current),M(sn,e),Sn===null&&(Sn=e)}function Jf(e){e.tag===22?(M(Et,Et.current),M(sn,e),Sn===null&&(Sn=e)):ki()}function ki(){M(Et,Et.current),M(sn,sn.current)}function on(e){H(sn),Sn===e&&(Sn=null),H(Et)}var Et=O(0);function Vl(e){for(var n=e;n!==null;){if(n.tag===13){var a=n.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||uc(a)||cc(a)))return n}else if(n.tag===19&&(n.memoizedProps.revealOrder==="forwards"||n.memoizedProps.revealOrder==="backwards"||n.memoizedProps.revealOrder==="unstable_legacy-backwards"||n.memoizedProps.revealOrder==="together")){if((n.flags&128)!==0)return n}else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return null;n=n.return}n.sibling.return=n.return,n=n.sibling}return null}var Wn=0,Xe=null,gt=null,Rt=null,Yl=!1,Ta=!1,ta=!1,Gl=0,Cr=0,Ra=null,F0=0;function Ct(){throw Error(l(321))}function au(e,n){if(n===null)return!1;for(var a=0;a<n.length&&a<e.length;a++)if(!rn(e[a],n[a]))return!1;return!0}function ru(e,n,a,s,m,g){return Wn=g,Xe=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,$.H=e===null||e.memoizedState===null?Mh:vu,ta=!1,g=a(s,m),ta=!1,Ta&&(g=eh(n,a,s,m)),Wf(e),g}function Wf(e){$.H=Ar;var n=gt!==null&&gt.next!==null;if(Wn=0,Rt=gt=Xe=null,Yl=!1,Cr=0,Ra=null,n)throw Error(l(300));e===null||Ot||(e=e.dependencies,e!==null&&Ll(e)&&(Ot=!0))}function eh(e,n,a,s){Xe=e;var m=0;do{if(Ta&&(Ra=null),Cr=0,Ta=!1,25<=m)throw Error(l(301));if(m+=1,Rt=gt=null,e.updateQueue!=null){var g=e.updateQueue;g.lastEffect=null,g.events=null,g.stores=null,g.memoCache!=null&&(g.memoCache.index=0)}$.H=Lh,g=n(a,s)}while(Ta);return g}function q0(){var e=$.H,n=e.useState()[0];return n=typeof n.then=="function"?Nr(n):n,e=e.useState()[0],(gt!==null?gt.memoizedState:null)!==e&&(Xe.flags|=1024),n}function lu(){var e=Gl!==0;return Gl=0,e}function su(e,n,a){n.updateQueue=e.updateQueue,n.flags&=-2053,e.lanes&=~a}function ou(e){if(Yl){for(e=e.memoizedState;e!==null;){var n=e.queue;n!==null&&(n.pending=null),e=e.next}Yl=!1}Wn=0,Rt=gt=Xe=null,Ta=!1,Cr=Gl=0,Ra=null}function Kt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Rt===null?Xe.memoizedState=Rt=e:Rt=Rt.next=e,Rt}function At(){if(gt===null){var e=Xe.alternate;e=e!==null?e.memoizedState:null}else e=gt.next;var n=Rt===null?Xe.memoizedState:Rt.next;if(n!==null)Rt=n,gt=e;else{if(e===null)throw Xe.alternate===null?Error(l(467)):Error(l(310));gt=e,e={memoizedState:gt.memoizedState,baseState:gt.baseState,baseQueue:gt.baseQueue,queue:gt.queue,next:null},Rt===null?Xe.memoizedState=Rt=e:Rt=Rt.next=e}return Rt}function Kl(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Nr(e){var n=Cr;return Cr+=1,Ra===null&&(Ra=[]),e=Vf(Ra,e,n),n=Xe,(Rt===null?n.memoizedState:Rt.next)===null&&(n=n.alternate,$.H=n===null||n.memoizedState===null?Mh:vu),e}function $l(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Nr(e);if(e.$$typeof===N)return Ht(e)}throw Error(l(438,String(e)))}function uu(e){var n=null,a=Xe.updateQueue;if(a!==null&&(n=a.memoCache),n==null){var s=Xe.alternate;s!==null&&(s=s.updateQueue,s!==null&&(s=s.memoCache,s!=null&&(n={data:s.data.map(function(m){return m.slice()}),index:0})))}if(n==null&&(n={data:[],index:0}),a===null&&(a=Kl(),Xe.updateQueue=a),a.memoCache=n,a=n.data[n.index],a===void 0)for(a=n.data[n.index]=Array(e),s=0;s<e;s++)a[s]=q;return n.index++,a}function ei(e,n){return typeof n=="function"?n(e):n}function Xl(e){var n=At();return cu(n,gt,e)}function cu(e,n,a){var s=e.queue;if(s===null)throw Error(l(311));s.lastRenderedReducer=a;var m=e.baseQueue,g=s.pending;if(g!==null){if(m!==null){var C=m.next;m.next=g.next,g.next=C}n.baseQueue=m=g,s.pending=null}if(g=e.baseState,m===null)e.memoizedState=g;else{n=m.next;var U=C=null,Z=null,ue=n,ge=!1;do{var _e=ue.lane&-536870913;if(_e!==ue.lane?(it&_e)===_e:(Wn&_e)===_e){var ce=ue.revertLane;if(ce===0)Z!==null&&(Z=Z.next={lane:0,revertLane:0,gesture:null,action:ue.action,hasEagerState:ue.hasEagerState,eagerState:ue.eagerState,next:null}),_e===Ca&&(ge=!0);else if((Wn&ce)===ce){ue=ue.next,ce===Ca&&(ge=!0);continue}else _e={lane:0,revertLane:ue.revertLane,gesture:null,action:ue.action,hasEagerState:ue.hasEagerState,eagerState:ue.eagerState,next:null},Z===null?(U=Z=_e,C=g):Z=Z.next=_e,Xe.lanes|=ce,Ci|=ce;_e=ue.action,ta&&a(g,_e),g=ue.hasEagerState?ue.eagerState:a(g,_e)}else ce={lane:_e,revertLane:ue.revertLane,gesture:ue.gesture,action:ue.action,hasEagerState:ue.hasEagerState,eagerState:ue.eagerState,next:null},Z===null?(U=Z=ce,C=g):Z=Z.next=ce,Xe.lanes|=_e,Ci|=_e;ue=ue.next}while(ue!==null&&ue!==n);if(Z===null?C=g:Z.next=U,!rn(g,e.memoizedState)&&(Ot=!0,ge&&(a=Na,a!==null)))throw a;e.memoizedState=g,e.baseState=C,e.baseQueue=Z,s.lastRenderedState=g}return m===null&&(s.lanes=0),[e.memoizedState,s.dispatch]}function du(e){var n=At(),a=n.queue;if(a===null)throw Error(l(311));a.lastRenderedReducer=e;var s=a.dispatch,m=a.pending,g=n.memoizedState;if(m!==null){a.pending=null;var C=m=m.next;do g=e(g,C.action),C=C.next;while(C!==m);rn(g,n.memoizedState)||(Ot=!0),n.memoizedState=g,n.baseQueue===null&&(n.baseState=g),a.lastRenderedState=g}return[g,s]}function th(e,n,a){var s=Xe,m=At(),g=rt;if(g){if(a===void 0)throw Error(l(407));a=a()}else a=n();var C=!rn((gt||m).memoizedState,a);if(C&&(m.memoizedState=a,Ot=!0),m=m.queue,pu(ah.bind(null,s,m,e),[e]),m.getSnapshot!==n||C||Rt!==null&&Rt.memoizedState.tag&1){if(s.flags|=2048,Oa(9,{destroy:void 0},ih.bind(null,s,m,a,n),null),yt===null)throw Error(l(349));g||(Wn&127)!==0||nh(s,n,a)}return a}function nh(e,n,a){e.flags|=16384,e={getSnapshot:n,value:a},n=Xe.updateQueue,n===null?(n=Kl(),Xe.updateQueue=n,n.stores=[e]):(a=n.stores,a===null?n.stores=[e]:a.push(e))}function ih(e,n,a,s){n.value=a,n.getSnapshot=s,rh(n)&&lh(e)}function ah(e,n,a){return a(function(){rh(n)&&lh(e)})}function rh(e){var n=e.getSnapshot;e=e.value;try{var a=n();return!rn(e,a)}catch{return!0}}function lh(e){var n=Gi(e,2);n!==null&&tn(n,e,2)}function fu(e){var n=Kt();if(typeof e=="function"){var a=e;if(e=a(),ta){Ke(!0);try{a()}finally{Ke(!1)}}}return n.memoizedState=n.baseState=e,n.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ei,lastRenderedState:e},n}function sh(e,n,a,s){return e.baseState=a,cu(e,gt,typeof s=="function"?s:ei)}function V0(e,n,a,s,m){if(Jl(e))throw Error(l(485));if(e=n.action,e!==null){var g={payload:m,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(C){g.listeners.push(C)}};$.T!==null?a(!0):g.isTransition=!1,s(g),a=n.pending,a===null?(g.next=n.pending=g,oh(n,g)):(g.next=a.next,n.pending=a.next=g)}}function oh(e,n){var a=n.action,s=n.payload,m=e.state;if(n.isTransition){var g=$.T,C={};$.T=C;try{var U=a(m,s),Z=$.S;Z!==null&&Z(C,U),uh(e,n,U)}catch(ue){hu(e,n,ue)}finally{g!==null&&C.types!==null&&(g.types=C.types),$.T=g}}else try{g=a(m,s),uh(e,n,g)}catch(ue){hu(e,n,ue)}}function uh(e,n,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(s){ch(e,n,s)},function(s){return hu(e,n,s)}):ch(e,n,a)}function ch(e,n,a){n.status="fulfilled",n.value=a,dh(n),e.state=a,n=e.pending,n!==null&&(a=n.next,a===n?e.pending=null:(a=a.next,n.next=a,oh(e,a)))}function hu(e,n,a){var s=e.pending;if(e.pending=null,s!==null){s=s.next;do n.status="rejected",n.reason=a,dh(n),n=n.next;while(n!==s)}e.action=null}function dh(e){e=e.listeners;for(var n=0;n<e.length;n++)(0,e[n])()}function fh(e,n){return n}function hh(e,n){if(rt){var a=yt.formState;if(a!==null){e:{var s=Xe;if(rt){if(St){t:{for(var m=St,g=wn;m.nodeType!==8;){if(!g){m=null;break t}if(m=kn(m.nextSibling),m===null){m=null;break t}}g=m.data,m=g==="F!"||g==="F"?m:null}if(m){St=kn(m.nextSibling),s=m.data==="F!";break e}}xi(s)}s=!1}s&&(n=a[0])}}return a=Kt(),a.memoizedState=a.baseState=n,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:fh,lastRenderedState:n},a.queue=s,a=Rh.bind(null,Xe,s),s.dispatch=a,s=fu(!1),g=yu.bind(null,Xe,!1,s.queue),s=Kt(),m={state:n,dispatch:null,action:e,pending:null},s.queue=m,a=V0.bind(null,Xe,m,g,a),m.dispatch=a,s.memoizedState=e,[n,a,!1]}function ph(e){var n=At();return mh(n,gt,e)}function mh(e,n,a){if(n=cu(e,n,fh)[0],e=Xl(ei)[0],typeof n=="object"&&n!==null&&typeof n.then=="function")try{var s=Nr(n)}catch(C){throw C===Ea?Il:C}else s=n;n=At();var m=n.queue,g=m.dispatch;return a!==n.memoizedState&&(Xe.flags|=2048,Oa(9,{destroy:void 0},Y0.bind(null,m,a),null)),[s,g,e]}function Y0(e,n){e.action=n}function gh(e){var n=At(),a=gt;if(a!==null)return mh(n,a,e);At(),n=n.memoizedState,a=At();var s=a.queue.dispatch;return a.memoizedState=e,[n,s,!1]}function Oa(e,n,a,s){return e={tag:e,create:a,deps:s,inst:n,next:null},n=Xe.updateQueue,n===null&&(n=Kl(),Xe.updateQueue=n),a=n.lastEffect,a===null?n.lastEffect=e.next=e:(s=a.next,a.next=e,e.next=s,n.lastEffect=e),e}function xh(){return At().memoizedState}function Zl(e,n,a,s){var m=Kt();Xe.flags|=e,m.memoizedState=Oa(1|n,{destroy:void 0},a,s===void 0?null:s)}function Ql(e,n,a,s){var m=At();s=s===void 0?null:s;var g=m.memoizedState.inst;gt!==null&&s!==null&&au(s,gt.memoizedState.deps)?m.memoizedState=Oa(n,g,a,s):(Xe.flags|=e,m.memoizedState=Oa(1|n,g,a,s))}function bh(e,n){Zl(8390656,8,e,n)}function pu(e,n){Ql(2048,8,e,n)}function G0(e){Xe.flags|=4;var n=Xe.updateQueue;if(n===null)n=Kl(),Xe.updateQueue=n,n.events=[e];else{var a=n.events;a===null?n.events=[e]:a.push(e)}}function yh(e){var n=At().memoizedState;return G0({ref:n,nextImpl:e}),function(){if((dt&2)!==0)throw Error(l(440));return n.impl.apply(void 0,arguments)}}function vh(e,n){return Ql(4,2,e,n)}function wh(e,n){return Ql(4,4,e,n)}function Sh(e,n){if(typeof n=="function"){e=e();var a=n(e);return function(){typeof a=="function"?a():n(null)}}if(n!=null)return e=e(),n.current=e,function(){n.current=null}}function kh(e,n,a){a=a!=null?a.concat([e]):null,Ql(4,4,Sh.bind(null,n,e),a)}function mu(){}function jh(e,n){var a=At();n=n===void 0?null:n;var s=a.memoizedState;return n!==null&&au(n,s[1])?s[0]:(a.memoizedState=[e,n],e)}function _h(e,n){var a=At();n=n===void 0?null:n;var s=a.memoizedState;if(n!==null&&au(n,s[1]))return s[0];if(s=e(),ta){Ke(!0);try{e()}finally{Ke(!1)}}return a.memoizedState=[s,n],s}function gu(e,n,a){return a===void 0||(Wn&1073741824)!==0&&(it&261930)===0?e.memoizedState=n:(e.memoizedState=a,e=Cp(),Xe.lanes|=e,Ci|=e,a)}function Ch(e,n,a,s){return rn(a,n)?a:za.current!==null?(e=gu(e,a,s),rn(e,n)||(Ot=!0),e):(Wn&42)===0||(Wn&1073741824)!==0&&(it&261930)===0?(Ot=!0,e.memoizedState=a):(e=Cp(),Xe.lanes|=e,Ci|=e,n)}function Nh(e,n,a,s,m){var g=J.p;J.p=g!==0&&8>g?g:8;var C=$.T,U={};$.T=U,yu(e,!1,n,a);try{var Z=m(),ue=$.S;if(ue!==null&&ue(U,Z),Z!==null&&typeof Z=="object"&&typeof Z.then=="function"){var ge=P0(Z,s);Er(e,n,ge,dn(e))}else Er(e,n,s,dn(e))}catch(_e){Er(e,n,{then:function(){},status:"rejected",reason:_e},dn())}finally{J.p=g,C!==null&&U.types!==null&&(C.types=U.types),$.T=C}}function K0(){}function xu(e,n,a,s){if(e.tag!==5)throw Error(l(476));var m=Eh(e).queue;Nh(e,m,n,ve,a===null?K0:function(){return Ah(e),a(s)})}function Eh(e){var n=e.memoizedState;if(n!==null)return n;n={memoizedState:ve,baseState:ve,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ei,lastRenderedState:ve},next:null};var a={};return n.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ei,lastRenderedState:a},next:null},e.memoizedState=n,e=e.alternate,e!==null&&(e.memoizedState=n),n}function Ah(e){var n=Eh(e);n.next===null&&(n=e.alternate.memoizedState),Er(e,n.next.queue,{},dn())}function bu(){return Ht(Yr)}function zh(){return At().memoizedState}function Th(){return At().memoizedState}function $0(e){for(var n=e.return;n!==null;){switch(n.tag){case 24:case 3:var a=dn();e=vi(a);var s=wi(n,e,a);s!==null&&(tn(s,n,a),kr(s,n,a)),n={cache:Ko()},e.payload=n;return}n=n.return}}function X0(e,n,a){var s=dn();a={lane:s,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Jl(e)?Oh(n,a):(a=Lo(e,n,a,s),a!==null&&(tn(a,e,s),Dh(a,n,s)))}function Rh(e,n,a){var s=dn();Er(e,n,a,s)}function Er(e,n,a,s){var m={lane:s,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(Jl(e))Oh(n,m);else{var g=e.alternate;if(e.lanes===0&&(g===null||g.lanes===0)&&(g=n.lastRenderedReducer,g!==null))try{var C=n.lastRenderedState,U=g(C,a);if(m.hasEagerState=!0,m.eagerState=U,rn(U,C))return Rl(e,n,m,0),yt===null&&Tl(),!1}catch{}if(a=Lo(e,n,m,s),a!==null)return tn(a,e,s),Dh(a,n,s),!0}return!1}function yu(e,n,a,s){if(s={lane:2,revertLane:Qu(),gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},Jl(e)){if(n)throw Error(l(479))}else n=Lo(e,a,s,2),n!==null&&tn(n,e,2)}function Jl(e){var n=e.alternate;return e===Xe||n!==null&&n===Xe}function Oh(e,n){Ta=Yl=!0;var a=e.pending;a===null?n.next=n:(n.next=a.next,a.next=n),e.pending=n}function Dh(e,n,a){if((a&4194048)!==0){var s=n.lanes;s&=e.pendingLanes,a|=s,n.lanes=a,co(e,a)}}var Ar={readContext:Ht,use:$l,useCallback:Ct,useContext:Ct,useEffect:Ct,useImperativeHandle:Ct,useLayoutEffect:Ct,useInsertionEffect:Ct,useMemo:Ct,useReducer:Ct,useRef:Ct,useState:Ct,useDebugValue:Ct,useDeferredValue:Ct,useTransition:Ct,useSyncExternalStore:Ct,useId:Ct,useHostTransitionStatus:Ct,useFormState:Ct,useActionState:Ct,useOptimistic:Ct,useMemoCache:Ct,useCacheRefresh:Ct};Ar.useEffectEvent=Ct;var Mh={readContext:Ht,use:$l,useCallback:function(e,n){return Kt().memoizedState=[e,n===void 0?null:n],e},useContext:Ht,useEffect:bh,useImperativeHandle:function(e,n,a){a=a!=null?a.concat([e]):null,Zl(4194308,4,Sh.bind(null,n,e),a)},useLayoutEffect:function(e,n){return Zl(4194308,4,e,n)},useInsertionEffect:function(e,n){Zl(4,2,e,n)},useMemo:function(e,n){var a=Kt();n=n===void 0?null:n;var s=e();if(ta){Ke(!0);try{e()}finally{Ke(!1)}}return a.memoizedState=[s,n],s},useReducer:function(e,n,a){var s=Kt();if(a!==void 0){var m=a(n);if(ta){Ke(!0);try{a(n)}finally{Ke(!1)}}}else m=n;return s.memoizedState=s.baseState=m,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:m},s.queue=e,e=e.dispatch=X0.bind(null,Xe,e),[s.memoizedState,e]},useRef:function(e){var n=Kt();return e={current:e},n.memoizedState=e},useState:function(e){e=fu(e);var n=e.queue,a=Rh.bind(null,Xe,n);return n.dispatch=a,[e.memoizedState,a]},useDebugValue:mu,useDeferredValue:function(e,n){var a=Kt();return gu(a,e,n)},useTransition:function(){var e=fu(!1);return e=Nh.bind(null,Xe,e.queue,!0,!1),Kt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,n,a){var s=Xe,m=Kt();if(rt){if(a===void 0)throw Error(l(407));a=a()}else{if(a=n(),yt===null)throw Error(l(349));(it&127)!==0||nh(s,n,a)}m.memoizedState=a;var g={value:a,getSnapshot:n};return m.queue=g,bh(ah.bind(null,s,g,e),[e]),s.flags|=2048,Oa(9,{destroy:void 0},ih.bind(null,s,g,a,n),null),a},useId:function(){var e=Kt(),n=yt.identifierPrefix;if(rt){var a=Ln,s=Mn;a=(s&~(1<<32-Le(s)-1)).toString(32)+a,n="_"+n+"R_"+a,a=Gl++,0<a&&(n+="H"+a.toString(32)),n+="_"}else a=F0++,n="_"+n+"r_"+a.toString(32)+"_";return e.memoizedState=n},useHostTransitionStatus:bu,useFormState:hh,useActionState:hh,useOptimistic:function(e){var n=Kt();n.memoizedState=n.baseState=e;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return n.queue=a,n=yu.bind(null,Xe,!0,a),a.dispatch=n,[e,n]},useMemoCache:uu,useCacheRefresh:function(){return Kt().memoizedState=$0.bind(null,Xe)},useEffectEvent:function(e){var n=Kt(),a={impl:e};return n.memoizedState=a,function(){if((dt&2)!==0)throw Error(l(440));return a.impl.apply(void 0,arguments)}}},vu={readContext:Ht,use:$l,useCallback:jh,useContext:Ht,useEffect:pu,useImperativeHandle:kh,useInsertionEffect:vh,useLayoutEffect:wh,useMemo:_h,useReducer:Xl,useRef:xh,useState:function(){return Xl(ei)},useDebugValue:mu,useDeferredValue:function(e,n){var a=At();return Ch(a,gt.memoizedState,e,n)},useTransition:function(){var e=Xl(ei)[0],n=At().memoizedState;return[typeof e=="boolean"?e:Nr(e),n]},useSyncExternalStore:th,useId:zh,useHostTransitionStatus:bu,useFormState:ph,useActionState:ph,useOptimistic:function(e,n){var a=At();return sh(a,gt,e,n)},useMemoCache:uu,useCacheRefresh:Th};vu.useEffectEvent=yh;var Lh={readContext:Ht,use:$l,useCallback:jh,useContext:Ht,useEffect:pu,useImperativeHandle:kh,useInsertionEffect:vh,useLayoutEffect:wh,useMemo:_h,useReducer:du,useRef:xh,useState:function(){return du(ei)},useDebugValue:mu,useDeferredValue:function(e,n){var a=At();return gt===null?gu(a,e,n):Ch(a,gt.memoizedState,e,n)},useTransition:function(){var e=du(ei)[0],n=At().memoizedState;return[typeof e=="boolean"?e:Nr(e),n]},useSyncExternalStore:th,useId:zh,useHostTransitionStatus:bu,useFormState:gh,useActionState:gh,useOptimistic:function(e,n){var a=At();return gt!==null?sh(a,gt,e,n):(a.baseState=e,[e,a.queue.dispatch])},useMemoCache:uu,useCacheRefresh:Th};Lh.useEffectEvent=yh;function wu(e,n,a,s){n=e.memoizedState,a=a(s,n),a=a==null?n:x({},n,a),e.memoizedState=a,e.lanes===0&&(e.updateQueue.baseState=a)}var Su={enqueueSetState:function(e,n,a){e=e._reactInternals;var s=dn(),m=vi(s);m.payload=n,a!=null&&(m.callback=a),n=wi(e,m,s),n!==null&&(tn(n,e,s),kr(n,e,s))},enqueueReplaceState:function(e,n,a){e=e._reactInternals;var s=dn(),m=vi(s);m.tag=1,m.payload=n,a!=null&&(m.callback=a),n=wi(e,m,s),n!==null&&(tn(n,e,s),kr(n,e,s))},enqueueForceUpdate:function(e,n){e=e._reactInternals;var a=dn(),s=vi(a);s.tag=2,n!=null&&(s.callback=n),n=wi(e,s,a),n!==null&&(tn(n,e,a),kr(n,e,a))}};function Bh(e,n,a,s,m,g,C){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(s,g,C):n.prototype&&n.prototype.isPureReactComponent?!mr(a,s)||!mr(m,g):!0}function Uh(e,n,a,s){e=n.state,typeof n.componentWillReceiveProps=="function"&&n.componentWillReceiveProps(a,s),typeof n.UNSAFE_componentWillReceiveProps=="function"&&n.UNSAFE_componentWillReceiveProps(a,s),n.state!==e&&Su.enqueueReplaceState(n,n.state,null)}function na(e,n){var a=n;if("ref"in n){a={};for(var s in n)s!=="ref"&&(a[s]=n[s])}if(e=e.defaultProps){a===n&&(a=x({},a));for(var m in e)a[m]===void 0&&(a[m]=e[m])}return a}function Ih(e){zl(e)}function Hh(e){console.error(e)}function Ph(e){zl(e)}function Wl(e,n){try{var a=e.onUncaughtError;a(n.value,{componentStack:n.stack})}catch(s){setTimeout(function(){throw s})}}function Fh(e,n,a){try{var s=e.onCaughtError;s(a.value,{componentStack:a.stack,errorBoundary:n.tag===1?n.stateNode:null})}catch(m){setTimeout(function(){throw m})}}function ku(e,n,a){return a=vi(a),a.tag=3,a.payload={element:null},a.callback=function(){Wl(e,n)},a}function qh(e){return e=vi(e),e.tag=3,e}function Vh(e,n,a,s){var m=a.type.getDerivedStateFromError;if(typeof m=="function"){var g=s.value;e.payload=function(){return m(g)},e.callback=function(){Fh(n,a,s)}}var C=a.stateNode;C!==null&&typeof C.componentDidCatch=="function"&&(e.callback=function(){Fh(n,a,s),typeof m!="function"&&(Ni===null?Ni=new Set([this]):Ni.add(this));var U=s.stack;this.componentDidCatch(s.value,{componentStack:U!==null?U:""})})}function Z0(e,n,a,s,m){if(a.flags|=32768,s!==null&&typeof s=="object"&&typeof s.then=="function"){if(n=a.alternate,n!==null&&_a(n,a,m,!0),a=sn.current,a!==null){switch(a.tag){case 31:case 13:return Sn===null?ds():a.alternate===null&&Nt===0&&(Nt=3),a.flags&=-257,a.flags|=65536,a.lanes=m,s===Hl?a.flags|=16384:(n=a.updateQueue,n===null?a.updateQueue=new Set([s]):n.add(s),$u(e,s,m)),!1;case 22:return a.flags|=65536,s===Hl?a.flags|=16384:(n=a.updateQueue,n===null?(n={transitions:null,markerInstances:null,retryQueue:new Set([s])},a.updateQueue=n):(a=n.retryQueue,a===null?n.retryQueue=new Set([s]):a.add(s)),$u(e,s,m)),!1}throw Error(l(435,a.tag))}return $u(e,s,m),ds(),!1}if(rt)return n=sn.current,n!==null?((n.flags&65536)===0&&(n.flags|=256),n.flags|=65536,n.lanes=m,s!==Fo&&(e=Error(l(422),{cause:s}),br(bn(e,a)))):(s!==Fo&&(n=Error(l(423),{cause:s}),br(bn(n,a))),e=e.current.alternate,e.flags|=65536,m&=-m,e.lanes|=m,s=bn(s,a),m=ku(e.stateNode,s,m),Wo(e,m),Nt!==4&&(Nt=2)),!1;var g=Error(l(520),{cause:s});if(g=bn(g,a),Br===null?Br=[g]:Br.push(g),Nt!==4&&(Nt=2),n===null)return!0;s=bn(s,a),a=n;do{switch(a.tag){case 3:return a.flags|=65536,e=m&-m,a.lanes|=e,e=ku(a.stateNode,s,e),Wo(a,e),!1;case 1:if(n=a.type,g=a.stateNode,(a.flags&128)===0&&(typeof n.getDerivedStateFromError=="function"||g!==null&&typeof g.componentDidCatch=="function"&&(Ni===null||!Ni.has(g))))return a.flags|=65536,m&=-m,a.lanes|=m,m=qh(m),Vh(m,e,a,s),Wo(a,m),!1}a=a.return}while(a!==null);return!1}var ju=Error(l(461)),Ot=!1;function Pt(e,n,a,s){n.child=e===null?$f(n,null,a,s):ea(n,e.child,a,s)}function Yh(e,n,a,s,m){a=a.render;var g=n.ref;if("ref"in s){var C={};for(var U in s)U!=="ref"&&(C[U]=s[U])}else C=s;return Zi(n),s=ru(e,n,a,C,g,m),U=lu(),e!==null&&!Ot?(su(e,n,m),ti(e,n,m)):(rt&&U&&Ho(n),n.flags|=1,Pt(e,n,s,m),n.child)}function Gh(e,n,a,s,m){if(e===null){var g=a.type;return typeof g=="function"&&!Bo(g)&&g.defaultProps===void 0&&a.compare===null?(n.tag=15,n.type=g,Kh(e,n,g,s,m)):(e=Dl(a.type,null,s,n,n.mode,m),e.ref=n.ref,e.return=n,n.child=e)}if(g=e.child,!Ru(e,m)){var C=g.memoizedProps;if(a=a.compare,a=a!==null?a:mr,a(C,s)&&e.ref===n.ref)return ti(e,n,m)}return n.flags|=1,e=Xn(g,s),e.ref=n.ref,e.return=n,n.child=e}function Kh(e,n,a,s,m){if(e!==null){var g=e.memoizedProps;if(mr(g,s)&&e.ref===n.ref)if(Ot=!1,n.pendingProps=s=g,Ru(e,m))(e.flags&131072)!==0&&(Ot=!0);else return n.lanes=e.lanes,ti(e,n,m)}return _u(e,n,a,s,m)}function $h(e,n,a,s){var m=s.children,g=e!==null?e.memoizedState:null;if(e===null&&n.stateNode===null&&(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),s.mode==="hidden"){if((n.flags&128)!==0){if(g=g!==null?g.baseLanes|a:a,e!==null){for(s=n.child=e.child,m=0;s!==null;)m=m|s.lanes|s.childLanes,s=s.sibling;s=m&~g}else s=0,n.child=null;return Xh(e,n,g,a,s)}if((a&536870912)!==0)n.memoizedState={baseLanes:0,cachePool:null},e!==null&&Ul(n,g!==null?g.cachePool:null),g!==null?Qf(n,g):tu(),Jf(n);else return s=n.lanes=536870912,Xh(e,n,g!==null?g.baseLanes|a:a,a,s)}else g!==null?(Ul(n,g.cachePool),Qf(n,g),ki(),n.memoizedState=null):(e!==null&&Ul(n,null),tu(),ki());return Pt(e,n,m,a),n.child}function zr(e,n){return e!==null&&e.tag===22||n.stateNode!==null||(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.sibling}function Xh(e,n,a,s,m){var g=Xo();return g=g===null?null:{parent:Tt._currentValue,pool:g},n.memoizedState={baseLanes:a,cachePool:g},e!==null&&Ul(n,null),tu(),Jf(n),e!==null&&_a(e,n,s,!0),n.childLanes=m,null}function es(e,n){return n=ns({mode:n.mode,children:n.children},e.mode),n.ref=e.ref,e.child=n,n.return=e,n}function Zh(e,n,a){return ea(n,e.child,null,a),e=es(n,n.pendingProps),e.flags|=2,on(n),n.memoizedState=null,e}function Q0(e,n,a){var s=n.pendingProps,m=(n.flags&128)!==0;if(n.flags&=-129,e===null){if(rt){if(s.mode==="hidden")return e=es(n,s),n.lanes=536870912,zr(null,e);if(iu(n),(e=St)?(e=om(e,wn),e=e!==null&&e.data==="&"?e:null,e!==null&&(n.memoizedState={dehydrated:e,treeContext:mi!==null?{id:Mn,overflow:Ln}:null,retryLane:536870912,hydrationErrors:null},a=Of(e),a.return=n,n.child=a,It=n,St=null)):e=null,e===null)throw xi(n);return n.lanes=536870912,null}return es(n,s)}var g=e.memoizedState;if(g!==null){var C=g.dehydrated;if(iu(n),m)if(n.flags&256)n.flags&=-257,n=Zh(e,n,a);else if(n.memoizedState!==null)n.child=e.child,n.flags|=128,n=null;else throw Error(l(558));else if(Ot||_a(e,n,a,!1),m=(a&e.childLanes)!==0,Ot||m){if(s=yt,s!==null&&(C=fo(s,a),C!==0&&C!==g.retryLane))throw g.retryLane=C,Gi(e,C),tn(s,e,C),ju;ds(),n=Zh(e,n,a)}else e=g.treeContext,St=kn(C.nextSibling),It=n,rt=!0,gi=null,wn=!1,e!==null&&Lf(n,e),n=es(n,s),n.flags|=4096;return n}return e=Xn(e.child,{mode:s.mode,children:s.children}),e.ref=n.ref,n.child=e,e.return=n,e}function ts(e,n){var a=n.ref;if(a===null)e!==null&&e.ref!==null&&(n.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(l(284));(e===null||e.ref!==a)&&(n.flags|=4194816)}}function _u(e,n,a,s,m){return Zi(n),a=ru(e,n,a,s,void 0,m),s=lu(),e!==null&&!Ot?(su(e,n,m),ti(e,n,m)):(rt&&s&&Ho(n),n.flags|=1,Pt(e,n,a,m),n.child)}function Qh(e,n,a,s,m,g){return Zi(n),n.updateQueue=null,a=eh(n,s,a,m),Wf(e),s=lu(),e!==null&&!Ot?(su(e,n,g),ti(e,n,g)):(rt&&s&&Ho(n),n.flags|=1,Pt(e,n,a,g),n.child)}function Jh(e,n,a,s,m){if(Zi(n),n.stateNode===null){var g=wa,C=a.contextType;typeof C=="object"&&C!==null&&(g=Ht(C)),g=new a(s,g),n.memoizedState=g.state!==null&&g.state!==void 0?g.state:null,g.updater=Su,n.stateNode=g,g._reactInternals=n,g=n.stateNode,g.props=s,g.state=n.memoizedState,g.refs={},Qo(n),C=a.contextType,g.context=typeof C=="object"&&C!==null?Ht(C):wa,g.state=n.memoizedState,C=a.getDerivedStateFromProps,typeof C=="function"&&(wu(n,a,C,s),g.state=n.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof g.getSnapshotBeforeUpdate=="function"||typeof g.UNSAFE_componentWillMount!="function"&&typeof g.componentWillMount!="function"||(C=g.state,typeof g.componentWillMount=="function"&&g.componentWillMount(),typeof g.UNSAFE_componentWillMount=="function"&&g.UNSAFE_componentWillMount(),C!==g.state&&Su.enqueueReplaceState(g,g.state,null),_r(n,s,g,m),jr(),g.state=n.memoizedState),typeof g.componentDidMount=="function"&&(n.flags|=4194308),s=!0}else if(e===null){g=n.stateNode;var U=n.memoizedProps,Z=na(a,U);g.props=Z;var ue=g.context,ge=a.contextType;C=wa,typeof ge=="object"&&ge!==null&&(C=Ht(ge));var _e=a.getDerivedStateFromProps;ge=typeof _e=="function"||typeof g.getSnapshotBeforeUpdate=="function",U=n.pendingProps!==U,ge||typeof g.UNSAFE_componentWillReceiveProps!="function"&&typeof g.componentWillReceiveProps!="function"||(U||ue!==C)&&Uh(n,g,s,C),yi=!1;var ce=n.memoizedState;g.state=ce,_r(n,s,g,m),jr(),ue=n.memoizedState,U||ce!==ue||yi?(typeof _e=="function"&&(wu(n,a,_e,s),ue=n.memoizedState),(Z=yi||Bh(n,a,Z,s,ce,ue,C))?(ge||typeof g.UNSAFE_componentWillMount!="function"&&typeof g.componentWillMount!="function"||(typeof g.componentWillMount=="function"&&g.componentWillMount(),typeof g.UNSAFE_componentWillMount=="function"&&g.UNSAFE_componentWillMount()),typeof g.componentDidMount=="function"&&(n.flags|=4194308)):(typeof g.componentDidMount=="function"&&(n.flags|=4194308),n.memoizedProps=s,n.memoizedState=ue),g.props=s,g.state=ue,g.context=C,s=Z):(typeof g.componentDidMount=="function"&&(n.flags|=4194308),s=!1)}else{g=n.stateNode,Jo(e,n),C=n.memoizedProps,ge=na(a,C),g.props=ge,_e=n.pendingProps,ce=g.context,ue=a.contextType,Z=wa,typeof ue=="object"&&ue!==null&&(Z=Ht(ue)),U=a.getDerivedStateFromProps,(ue=typeof U=="function"||typeof g.getSnapshotBeforeUpdate=="function")||typeof g.UNSAFE_componentWillReceiveProps!="function"&&typeof g.componentWillReceiveProps!="function"||(C!==_e||ce!==Z)&&Uh(n,g,s,Z),yi=!1,ce=n.memoizedState,g.state=ce,_r(n,s,g,m),jr();var he=n.memoizedState;C!==_e||ce!==he||yi||e!==null&&e.dependencies!==null&&Ll(e.dependencies)?(typeof U=="function"&&(wu(n,a,U,s),he=n.memoizedState),(ge=yi||Bh(n,a,ge,s,ce,he,Z)||e!==null&&e.dependencies!==null&&Ll(e.dependencies))?(ue||typeof g.UNSAFE_componentWillUpdate!="function"&&typeof g.componentWillUpdate!="function"||(typeof g.componentWillUpdate=="function"&&g.componentWillUpdate(s,he,Z),typeof g.UNSAFE_componentWillUpdate=="function"&&g.UNSAFE_componentWillUpdate(s,he,Z)),typeof g.componentDidUpdate=="function"&&(n.flags|=4),typeof g.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof g.componentDidUpdate!="function"||C===e.memoizedProps&&ce===e.memoizedState||(n.flags|=4),typeof g.getSnapshotBeforeUpdate!="function"||C===e.memoizedProps&&ce===e.memoizedState||(n.flags|=1024),n.memoizedProps=s,n.memoizedState=he),g.props=s,g.state=he,g.context=Z,s=ge):(typeof g.componentDidUpdate!="function"||C===e.memoizedProps&&ce===e.memoizedState||(n.flags|=4),typeof g.getSnapshotBeforeUpdate!="function"||C===e.memoizedProps&&ce===e.memoizedState||(n.flags|=1024),s=!1)}return g=s,ts(e,n),s=(n.flags&128)!==0,g||s?(g=n.stateNode,a=s&&typeof a.getDerivedStateFromError!="function"?null:g.render(),n.flags|=1,e!==null&&s?(n.child=ea(n,e.child,null,m),n.child=ea(n,null,a,m)):Pt(e,n,a,m),n.memoizedState=g.state,e=n.child):e=ti(e,n,m),e}function Wh(e,n,a,s){return $i(),n.flags|=256,Pt(e,n,a,s),n.child}var Cu={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Nu(e){return{baseLanes:e,cachePool:Ff()}}function Eu(e,n,a){return e=e!==null?e.childLanes&~a:0,n&&(e|=cn),e}function ep(e,n,a){var s=n.pendingProps,m=!1,g=(n.flags&128)!==0,C;if((C=g)||(C=e!==null&&e.memoizedState===null?!1:(Et.current&2)!==0),C&&(m=!0,n.flags&=-129),C=(n.flags&32)!==0,n.flags&=-33,e===null){if(rt){if(m?Si(n):ki(),(e=St)?(e=om(e,wn),e=e!==null&&e.data!=="&"?e:null,e!==null&&(n.memoizedState={dehydrated:e,treeContext:mi!==null?{id:Mn,overflow:Ln}:null,retryLane:536870912,hydrationErrors:null},a=Of(e),a.return=n,n.child=a,It=n,St=null)):e=null,e===null)throw xi(n);return cc(e)?n.lanes=32:n.lanes=536870912,null}var U=s.children;return s=s.fallback,m?(ki(),m=n.mode,U=ns({mode:"hidden",children:U},m),s=Ki(s,m,a,null),U.return=n,s.return=n,U.sibling=s,n.child=U,s=n.child,s.memoizedState=Nu(a),s.childLanes=Eu(e,C,a),n.memoizedState=Cu,zr(null,s)):(Si(n),Au(n,U))}var Z=e.memoizedState;if(Z!==null&&(U=Z.dehydrated,U!==null)){if(g)n.flags&256?(Si(n),n.flags&=-257,n=zu(e,n,a)):n.memoizedState!==null?(ki(),n.child=e.child,n.flags|=128,n=null):(ki(),U=s.fallback,m=n.mode,s=ns({mode:"visible",children:s.children},m),U=Ki(U,m,a,null),U.flags|=2,s.return=n,U.return=n,s.sibling=U,n.child=s,ea(n,e.child,null,a),s=n.child,s.memoizedState=Nu(a),s.childLanes=Eu(e,C,a),n.memoizedState=Cu,n=zr(null,s));else if(Si(n),cc(U)){if(C=U.nextSibling&&U.nextSibling.dataset,C)var ue=C.dgst;C=ue,s=Error(l(419)),s.stack="",s.digest=C,br({value:s,source:null,stack:null}),n=zu(e,n,a)}else if(Ot||_a(e,n,a,!1),C=(a&e.childLanes)!==0,Ot||C){if(C=yt,C!==null&&(s=fo(C,a),s!==0&&s!==Z.retryLane))throw Z.retryLane=s,Gi(e,s),tn(C,e,s),ju;uc(U)||ds(),n=zu(e,n,a)}else uc(U)?(n.flags|=192,n.child=e.child,n=null):(e=Z.treeContext,St=kn(U.nextSibling),It=n,rt=!0,gi=null,wn=!1,e!==null&&Lf(n,e),n=Au(n,s.children),n.flags|=4096);return n}return m?(ki(),U=s.fallback,m=n.mode,Z=e.child,ue=Z.sibling,s=Xn(Z,{mode:"hidden",children:s.children}),s.subtreeFlags=Z.subtreeFlags&65011712,ue!==null?U=Xn(ue,U):(U=Ki(U,m,a,null),U.flags|=2),U.return=n,s.return=n,s.sibling=U,n.child=s,zr(null,s),s=n.child,U=e.child.memoizedState,U===null?U=Nu(a):(m=U.cachePool,m!==null?(Z=Tt._currentValue,m=m.parent!==Z?{parent:Z,pool:Z}:m):m=Ff(),U={baseLanes:U.baseLanes|a,cachePool:m}),s.memoizedState=U,s.childLanes=Eu(e,C,a),n.memoizedState=Cu,zr(e.child,s)):(Si(n),a=e.child,e=a.sibling,a=Xn(a,{mode:"visible",children:s.children}),a.return=n,a.sibling=null,e!==null&&(C=n.deletions,C===null?(n.deletions=[e],n.flags|=16):C.push(e)),n.child=a,n.memoizedState=null,a)}function Au(e,n){return n=ns({mode:"visible",children:n},e.mode),n.return=e,e.child=n}function ns(e,n){return e=ln(22,e,null,n),e.lanes=0,e}function zu(e,n,a){return ea(n,e.child,null,a),e=Au(n,n.pendingProps.children),e.flags|=2,n.memoizedState=null,e}function tp(e,n,a){e.lanes|=n;var s=e.alternate;s!==null&&(s.lanes|=n),Yo(e.return,n,a)}function Tu(e,n,a,s,m,g){var C=e.memoizedState;C===null?e.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:s,tail:a,tailMode:m,treeForkCount:g}:(C.isBackwards=n,C.rendering=null,C.renderingStartTime=0,C.last=s,C.tail=a,C.tailMode=m,C.treeForkCount=g)}function np(e,n,a){var s=n.pendingProps,m=s.revealOrder,g=s.tail;s=s.children;var C=Et.current,U=(C&2)!==0;if(U?(C=C&1|2,n.flags|=128):C&=1,M(Et,C),Pt(e,n,s,a),s=rt?xr:0,!U&&e!==null&&(e.flags&128)!==0)e:for(e=n.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&tp(e,a,n);else if(e.tag===19)tp(e,a,n);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===n)break e;for(;e.sibling===null;){if(e.return===null||e.return===n)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(m){case"forwards":for(a=n.child,m=null;a!==null;)e=a.alternate,e!==null&&Vl(e)===null&&(m=a),a=a.sibling;a=m,a===null?(m=n.child,n.child=null):(m=a.sibling,a.sibling=null),Tu(n,!1,m,a,g,s);break;case"backwards":case"unstable_legacy-backwards":for(a=null,m=n.child,n.child=null;m!==null;){if(e=m.alternate,e!==null&&Vl(e)===null){n.child=m;break}e=m.sibling,m.sibling=a,a=m,m=e}Tu(n,!0,a,null,g,s);break;case"together":Tu(n,!1,null,null,void 0,s);break;default:n.memoizedState=null}return n.child}function ti(e,n,a){if(e!==null&&(n.dependencies=e.dependencies),Ci|=n.lanes,(a&n.childLanes)===0)if(e!==null){if(_a(e,n,a,!1),(a&n.childLanes)===0)return null}else return null;if(e!==null&&n.child!==e.child)throw Error(l(153));if(n.child!==null){for(e=n.child,a=Xn(e,e.pendingProps),n.child=a,a.return=n;e.sibling!==null;)e=e.sibling,a=a.sibling=Xn(e,e.pendingProps),a.return=n;a.sibling=null}return n.child}function Ru(e,n){return(e.lanes&n)!==0?!0:(e=e.dependencies,!!(e!==null&&Ll(e)))}function J0(e,n,a){switch(n.tag){case 3:Re(n,n.stateNode.containerInfo),bi(n,Tt,e.memoizedState.cache),$i();break;case 27:case 5:Pe(n);break;case 4:Re(n,n.stateNode.containerInfo);break;case 10:bi(n,n.type,n.memoizedProps.value);break;case 31:if(n.memoizedState!==null)return n.flags|=128,iu(n),null;break;case 13:var s=n.memoizedState;if(s!==null)return s.dehydrated!==null?(Si(n),n.flags|=128,null):(a&n.child.childLanes)!==0?ep(e,n,a):(Si(n),e=ti(e,n,a),e!==null?e.sibling:null);Si(n);break;case 19:var m=(e.flags&128)!==0;if(s=(a&n.childLanes)!==0,s||(_a(e,n,a,!1),s=(a&n.childLanes)!==0),m){if(s)return np(e,n,a);n.flags|=128}if(m=n.memoizedState,m!==null&&(m.rendering=null,m.tail=null,m.lastEffect=null),M(Et,Et.current),s)break;return null;case 22:return n.lanes=0,$h(e,n,a,n.pendingProps);case 24:bi(n,Tt,e.memoizedState.cache)}return ti(e,n,a)}function ip(e,n,a){if(e!==null)if(e.memoizedProps!==n.pendingProps)Ot=!0;else{if(!Ru(e,a)&&(n.flags&128)===0)return Ot=!1,J0(e,n,a);Ot=(e.flags&131072)!==0}else Ot=!1,rt&&(n.flags&1048576)!==0&&Mf(n,xr,n.index);switch(n.lanes=0,n.tag){case 16:e:{var s=n.pendingProps;if(e=Ji(n.elementType),n.type=e,typeof e=="function")Bo(e)?(s=na(e,s),n.tag=1,n=Jh(null,n,e,s,a)):(n.tag=0,n=_u(null,n,e,s,a));else{if(e!=null){var m=e.$$typeof;if(m===B){n.tag=11,n=Yh(null,n,e,s,a);break e}else if(m===R){n.tag=14,n=Gh(null,n,e,s,a);break e}}throw n=E(e)||e,Error(l(306,n,""))}}return n;case 0:return _u(e,n,n.type,n.pendingProps,a);case 1:return s=n.type,m=na(s,n.pendingProps),Jh(e,n,s,m,a);case 3:e:{if(Re(n,n.stateNode.containerInfo),e===null)throw Error(l(387));s=n.pendingProps;var g=n.memoizedState;m=g.element,Jo(e,n),_r(n,s,null,a);var C=n.memoizedState;if(s=C.cache,bi(n,Tt,s),s!==g.cache&&Go(n,[Tt],a,!0),jr(),s=C.element,g.isDehydrated)if(g={element:s,isDehydrated:!1,cache:C.cache},n.updateQueue.baseState=g,n.memoizedState=g,n.flags&256){n=Wh(e,n,s,a);break e}else if(s!==m){m=bn(Error(l(424)),n),br(m),n=Wh(e,n,s,a);break e}else for(e=n.stateNode.containerInfo,e.nodeType===9?e=e.body:e=e.nodeName==="HTML"?e.ownerDocument.body:e,St=kn(e.firstChild),It=n,rt=!0,gi=null,wn=!0,a=$f(n,null,s,a),n.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling;else{if($i(),s===m){n=ti(e,n,a);break e}Pt(e,n,s,a)}n=n.child}return n;case 26:return ts(e,n),e===null?(a=pm(n.type,null,n.pendingProps,null))?n.memoizedState=a:rt||(a=n.type,e=n.pendingProps,s=bs(se.current).createElement(a),s[Ne]=n,s[Te]=e,Ft(s,a,e),Bt(s),n.stateNode=s):n.memoizedState=pm(n.type,e.memoizedProps,n.pendingProps,e.memoizedState),null;case 27:return Pe(n),e===null&&rt&&(s=n.stateNode=dm(n.type,n.pendingProps,se.current),It=n,wn=!0,m=St,Ti(n.type)?(dc=m,St=kn(s.firstChild)):St=m),Pt(e,n,n.pendingProps.children,a),ts(e,n),e===null&&(n.flags|=4194304),n.child;case 5:return e===null&&rt&&((m=s=St)&&(s=Ey(s,n.type,n.pendingProps,wn),s!==null?(n.stateNode=s,It=n,St=kn(s.firstChild),wn=!1,m=!0):m=!1),m||xi(n)),Pe(n),m=n.type,g=n.pendingProps,C=e!==null?e.memoizedProps:null,s=g.children,lc(m,g)?s=null:C!==null&&lc(m,C)&&(n.flags|=32),n.memoizedState!==null&&(m=ru(e,n,q0,null,null,a),Yr._currentValue=m),ts(e,n),Pt(e,n,s,a),n.child;case 6:return e===null&&rt&&((e=a=St)&&(a=Ay(a,n.pendingProps,wn),a!==null?(n.stateNode=a,It=n,St=null,e=!0):e=!1),e||xi(n)),null;case 13:return ep(e,n,a);case 4:return Re(n,n.stateNode.containerInfo),s=n.pendingProps,e===null?n.child=ea(n,null,s,a):Pt(e,n,s,a),n.child;case 11:return Yh(e,n,n.type,n.pendingProps,a);case 7:return Pt(e,n,n.pendingProps,a),n.child;case 8:return Pt(e,n,n.pendingProps.children,a),n.child;case 12:return Pt(e,n,n.pendingProps.children,a),n.child;case 10:return s=n.pendingProps,bi(n,n.type,s.value),Pt(e,n,s.children,a),n.child;case 9:return m=n.type._context,s=n.pendingProps.children,Zi(n),m=Ht(m),s=s(m),n.flags|=1,Pt(e,n,s,a),n.child;case 14:return Gh(e,n,n.type,n.pendingProps,a);case 15:return Kh(e,n,n.type,n.pendingProps,a);case 19:return np(e,n,a);case 31:return Q0(e,n,a);case 22:return $h(e,n,a,n.pendingProps);case 24:return Zi(n),s=Ht(Tt),e===null?(m=Xo(),m===null&&(m=yt,g=Ko(),m.pooledCache=g,g.refCount++,g!==null&&(m.pooledCacheLanes|=a),m=g),n.memoizedState={parent:s,cache:m},Qo(n),bi(n,Tt,m)):((e.lanes&a)!==0&&(Jo(e,n),_r(n,null,null,a),jr()),m=e.memoizedState,g=n.memoizedState,m.parent!==s?(m={parent:s,cache:s},n.memoizedState=m,n.lanes===0&&(n.memoizedState=n.updateQueue.baseState=m),bi(n,Tt,s)):(s=g.cache,bi(n,Tt,s),s!==m.cache&&Go(n,[Tt],a,!0))),Pt(e,n,n.pendingProps.children,a),n.child;case 29:throw n.pendingProps}throw Error(l(156,n.tag))}function ni(e){e.flags|=4}function Ou(e,n,a,s,m){if((n=(e.mode&32)!==0)&&(n=!1),n){if(e.flags|=16777216,(m&335544128)===m)if(e.stateNode.complete)e.flags|=8192;else if(zp())e.flags|=8192;else throw Wi=Hl,Zo}else e.flags&=-16777217}function ap(e,n){if(n.type!=="stylesheet"||(n.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!ym(n))if(zp())e.flags|=8192;else throw Wi=Hl,Zo}function is(e,n){n!==null&&(e.flags|=4),e.flags&16384&&(n=e.tag!==22?bl():536870912,e.lanes|=n,Ba|=n)}function Tr(e,n){if(!rt)switch(e.tailMode){case"hidden":n=e.tail;for(var a=null;n!==null;)n.alternate!==null&&(a=n),n=n.sibling;a===null?e.tail=null:a.sibling=null;break;case"collapsed":a=e.tail;for(var s=null;a!==null;)a.alternate!==null&&(s=a),a=a.sibling;s===null?n||e.tail===null?e.tail=null:e.tail.sibling=null:s.sibling=null}}function kt(e){var n=e.alternate!==null&&e.alternate.child===e.child,a=0,s=0;if(n)for(var m=e.child;m!==null;)a|=m.lanes|m.childLanes,s|=m.subtreeFlags&65011712,s|=m.flags&65011712,m.return=e,m=m.sibling;else for(m=e.child;m!==null;)a|=m.lanes|m.childLanes,s|=m.subtreeFlags,s|=m.flags,m.return=e,m=m.sibling;return e.subtreeFlags|=s,e.childLanes=a,n}function W0(e,n,a){var s=n.pendingProps;switch(Po(n),n.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return kt(n),null;case 1:return kt(n),null;case 3:return a=n.stateNode,s=null,e!==null&&(s=e.memoizedState.cache),n.memoizedState.cache!==s&&(n.flags|=2048),Jn(Tt),De(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(e===null||e.child===null)&&(ja(n)?ni(n):e===null||e.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,qo())),kt(n),null;case 26:var m=n.type,g=n.memoizedState;return e===null?(ni(n),g!==null?(kt(n),ap(n,g)):(kt(n),Ou(n,m,null,s,a))):g?g!==e.memoizedState?(ni(n),kt(n),ap(n,g)):(kt(n),n.flags&=-16777217):(e=e.memoizedProps,e!==s&&ni(n),kt(n),Ou(n,m,e,s,a)),null;case 27:if(Ge(n),a=se.current,m=n.type,e!==null&&n.stateNode!=null)e.memoizedProps!==s&&ni(n);else{if(!s){if(n.stateNode===null)throw Error(l(166));return kt(n),null}e=ie.current,ja(n)?Bf(n):(e=dm(m,s,a),n.stateNode=e,ni(n))}return kt(n),null;case 5:if(Ge(n),m=n.type,e!==null&&n.stateNode!=null)e.memoizedProps!==s&&ni(n);else{if(!s){if(n.stateNode===null)throw Error(l(166));return kt(n),null}if(g=ie.current,ja(n))Bf(n);else{var C=bs(se.current);switch(g){case 1:g=C.createElementNS("http://www.w3.org/2000/svg",m);break;case 2:g=C.createElementNS("http://www.w3.org/1998/Math/MathML",m);break;default:switch(m){case"svg":g=C.createElementNS("http://www.w3.org/2000/svg",m);break;case"math":g=C.createElementNS("http://www.w3.org/1998/Math/MathML",m);break;case"script":g=C.createElement("div"),g.innerHTML="<script><\/script>",g=g.removeChild(g.firstChild);break;case"select":g=typeof s.is=="string"?C.createElement("select",{is:s.is}):C.createElement("select"),s.multiple?g.multiple=!0:s.size&&(g.size=s.size);break;default:g=typeof s.is=="string"?C.createElement(m,{is:s.is}):C.createElement(m)}}g[Ne]=n,g[Te]=s;e:for(C=n.child;C!==null;){if(C.tag===5||C.tag===6)g.appendChild(C.stateNode);else if(C.tag!==4&&C.tag!==27&&C.child!==null){C.child.return=C,C=C.child;continue}if(C===n)break e;for(;C.sibling===null;){if(C.return===null||C.return===n)break e;C=C.return}C.sibling.return=C.return,C=C.sibling}n.stateNode=g;e:switch(Ft(g,m,s),m){case"button":case"input":case"select":case"textarea":s=!!s.autoFocus;break e;case"img":s=!0;break e;default:s=!1}s&&ni(n)}}return kt(n),Ou(n,n.type,e===null?null:e.memoizedProps,n.pendingProps,a),null;case 6:if(e&&n.stateNode!=null)e.memoizedProps!==s&&ni(n);else{if(typeof s!="string"&&n.stateNode===null)throw Error(l(166));if(e=se.current,ja(n)){if(e=n.stateNode,a=n.memoizedProps,s=null,m=It,m!==null)switch(m.tag){case 27:case 5:s=m.memoizedProps}e[Ne]=n,e=!!(e.nodeValue===a||s!==null&&s.suppressHydrationWarning===!0||em(e.nodeValue,a)),e||xi(n,!0)}else e=bs(e).createTextNode(s),e[Ne]=n,n.stateNode=e}return kt(n),null;case 31:if(a=n.memoizedState,e===null||e.memoizedState!==null){if(s=ja(n),a!==null){if(e===null){if(!s)throw Error(l(318));if(e=n.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(l(557));e[Ne]=n}else $i(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;kt(n),e=!1}else a=qo(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),e=!0;if(!e)return n.flags&256?(on(n),n):(on(n),null);if((n.flags&128)!==0)throw Error(l(558))}return kt(n),null;case 13:if(s=n.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(m=ja(n),s!==null&&s.dehydrated!==null){if(e===null){if(!m)throw Error(l(318));if(m=n.memoizedState,m=m!==null?m.dehydrated:null,!m)throw Error(l(317));m[Ne]=n}else $i(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;kt(n),m=!1}else m=qo(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=m),m=!0;if(!m)return n.flags&256?(on(n),n):(on(n),null)}return on(n),(n.flags&128)!==0?(n.lanes=a,n):(a=s!==null,e=e!==null&&e.memoizedState!==null,a&&(s=n.child,m=null,s.alternate!==null&&s.alternate.memoizedState!==null&&s.alternate.memoizedState.cachePool!==null&&(m=s.alternate.memoizedState.cachePool.pool),g=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(g=s.memoizedState.cachePool.pool),g!==m&&(s.flags|=2048)),a!==e&&a&&(n.child.flags|=8192),is(n,n.updateQueue),kt(n),null);case 4:return De(),e===null&&tc(n.stateNode.containerInfo),kt(n),null;case 10:return Jn(n.type),kt(n),null;case 19:if(H(Et),s=n.memoizedState,s===null)return kt(n),null;if(m=(n.flags&128)!==0,g=s.rendering,g===null)if(m)Tr(s,!1);else{if(Nt!==0||e!==null&&(e.flags&128)!==0)for(e=n.child;e!==null;){if(g=Vl(e),g!==null){for(n.flags|=128,Tr(s,!1),e=g.updateQueue,n.updateQueue=e,is(n,e),n.subtreeFlags=0,e=a,a=n.child;a!==null;)Rf(a,e),a=a.sibling;return M(Et,Et.current&1|2),rt&&Zn(n,s.treeForkCount),n.child}e=e.sibling}s.tail!==null&&Ee()>os&&(n.flags|=128,m=!0,Tr(s,!1),n.lanes=4194304)}else{if(!m)if(e=Vl(g),e!==null){if(n.flags|=128,m=!0,e=e.updateQueue,n.updateQueue=e,is(n,e),Tr(s,!0),s.tail===null&&s.tailMode==="hidden"&&!g.alternate&&!rt)return kt(n),null}else 2*Ee()-s.renderingStartTime>os&&a!==536870912&&(n.flags|=128,m=!0,Tr(s,!1),n.lanes=4194304);s.isBackwards?(g.sibling=n.child,n.child=g):(e=s.last,e!==null?e.sibling=g:n.child=g,s.last=g)}return s.tail!==null?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=Ee(),e.sibling=null,a=Et.current,M(Et,m?a&1|2:a&1),rt&&Zn(n,s.treeForkCount),e):(kt(n),null);case 22:case 23:return on(n),nu(),s=n.memoizedState!==null,e!==null?e.memoizedState!==null!==s&&(n.flags|=8192):s&&(n.flags|=8192),s?(a&536870912)!==0&&(n.flags&128)===0&&(kt(n),n.subtreeFlags&6&&(n.flags|=8192)):kt(n),a=n.updateQueue,a!==null&&is(n,a.retryQueue),a=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),s=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(s=n.memoizedState.cachePool.pool),s!==a&&(n.flags|=2048),e!==null&&H(Qi),null;case 24:return a=null,e!==null&&(a=e.memoizedState.cache),n.memoizedState.cache!==a&&(n.flags|=2048),Jn(Tt),kt(n),null;case 25:return null;case 30:return null}throw Error(l(156,n.tag))}function ey(e,n){switch(Po(n),n.tag){case 1:return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 3:return Jn(Tt),De(),e=n.flags,(e&65536)!==0&&(e&128)===0?(n.flags=e&-65537|128,n):null;case 26:case 27:case 5:return Ge(n),null;case 31:if(n.memoizedState!==null){if(on(n),n.alternate===null)throw Error(l(340));$i()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 13:if(on(n),e=n.memoizedState,e!==null&&e.dehydrated!==null){if(n.alternate===null)throw Error(l(340));$i()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 19:return H(Et),null;case 4:return De(),null;case 10:return Jn(n.type),null;case 22:case 23:return on(n),nu(),e!==null&&H(Qi),e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 24:return Jn(Tt),null;case 25:return null;default:return null}}function rp(e,n){switch(Po(n),n.tag){case 3:Jn(Tt),De();break;case 26:case 27:case 5:Ge(n);break;case 4:De();break;case 31:n.memoizedState!==null&&on(n);break;case 13:on(n);break;case 19:H(Et);break;case 10:Jn(n.type);break;case 22:case 23:on(n),nu(),e!==null&&H(Qi);break;case 24:Jn(Tt)}}function Rr(e,n){try{var a=n.updateQueue,s=a!==null?a.lastEffect:null;if(s!==null){var m=s.next;a=m;do{if((a.tag&e)===e){s=void 0;var g=a.create,C=a.inst;s=g(),C.destroy=s}a=a.next}while(a!==m)}}catch(U){mt(n,n.return,U)}}function ji(e,n,a){try{var s=n.updateQueue,m=s!==null?s.lastEffect:null;if(m!==null){var g=m.next;s=g;do{if((s.tag&e)===e){var C=s.inst,U=C.destroy;if(U!==void 0){C.destroy=void 0,m=n;var Z=a,ue=U;try{ue()}catch(ge){mt(m,Z,ge)}}}s=s.next}while(s!==g)}}catch(ge){mt(n,n.return,ge)}}function lp(e){var n=e.updateQueue;if(n!==null){var a=e.stateNode;try{Zf(n,a)}catch(s){mt(e,e.return,s)}}}function sp(e,n,a){a.props=na(e.type,e.memoizedProps),a.state=e.memoizedState;try{a.componentWillUnmount()}catch(s){mt(e,n,s)}}function Or(e,n){try{var a=e.ref;if(a!==null){switch(e.tag){case 26:case 27:case 5:var s=e.stateNode;break;case 30:s=e.stateNode;break;default:s=e.stateNode}typeof a=="function"?e.refCleanup=a(s):a.current=s}}catch(m){mt(e,n,m)}}function Bn(e,n){var a=e.ref,s=e.refCleanup;if(a!==null)if(typeof s=="function")try{s()}catch(m){mt(e,n,m)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(m){mt(e,n,m)}else a.current=null}function op(e){var n=e.type,a=e.memoizedProps,s=e.stateNode;try{e:switch(n){case"button":case"input":case"select":case"textarea":a.autoFocus&&s.focus();break e;case"img":a.src?s.src=a.src:a.srcSet&&(s.srcset=a.srcSet)}}catch(m){mt(e,e.return,m)}}function Du(e,n,a){try{var s=e.stateNode;Sy(s,e.type,a,n),s[Te]=n}catch(m){mt(e,e.return,m)}}function up(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Ti(e.type)||e.tag===4}function Mu(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||up(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Ti(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Lu(e,n,a){var s=e.tag;if(s===5||s===6)e=e.stateNode,n?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(e,n):(n=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,n.appendChild(e),a=a._reactRootContainer,a!=null||n.onclick!==null||(n.onclick=Kn));else if(s!==4&&(s===27&&Ti(e.type)&&(a=e.stateNode,n=null),e=e.child,e!==null))for(Lu(e,n,a),e=e.sibling;e!==null;)Lu(e,n,a),e=e.sibling}function as(e,n,a){var s=e.tag;if(s===5||s===6)e=e.stateNode,n?a.insertBefore(e,n):a.appendChild(e);else if(s!==4&&(s===27&&Ti(e.type)&&(a=e.stateNode),e=e.child,e!==null))for(as(e,n,a),e=e.sibling;e!==null;)as(e,n,a),e=e.sibling}function cp(e){var n=e.stateNode,a=e.memoizedProps;try{for(var s=e.type,m=n.attributes;m.length;)n.removeAttributeNode(m[0]);Ft(n,s,a),n[Ne]=e,n[Te]=a}catch(g){mt(e,e.return,g)}}var ii=!1,Dt=!1,Bu=!1,dp=typeof WeakSet=="function"?WeakSet:Set,Ut=null;function ty(e,n){if(e=e.containerInfo,ac=_s,e=kf(e),zo(e)){if("selectionStart"in e)var a={start:e.selectionStart,end:e.selectionEnd};else e:{a=(a=e.ownerDocument)&&a.defaultView||window;var s=a.getSelection&&a.getSelection();if(s&&s.rangeCount!==0){a=s.anchorNode;var m=s.anchorOffset,g=s.focusNode;s=s.focusOffset;try{a.nodeType,g.nodeType}catch{a=null;break e}var C=0,U=-1,Z=-1,ue=0,ge=0,_e=e,ce=null;t:for(;;){for(var he;_e!==a||m!==0&&_e.nodeType!==3||(U=C+m),_e!==g||s!==0&&_e.nodeType!==3||(Z=C+s),_e.nodeType===3&&(C+=_e.nodeValue.length),(he=_e.firstChild)!==null;)ce=_e,_e=he;for(;;){if(_e===e)break t;if(ce===a&&++ue===m&&(U=C),ce===g&&++ge===s&&(Z=C),(he=_e.nextSibling)!==null)break;_e=ce,ce=_e.parentNode}_e=he}a=U===-1||Z===-1?null:{start:U,end:Z}}else a=null}a=a||{start:0,end:0}}else a=null;for(rc={focusedElem:e,selectionRange:a},_s=!1,Ut=n;Ut!==null;)if(n=Ut,e=n.child,(n.subtreeFlags&1028)!==0&&e!==null)e.return=n,Ut=e;else for(;Ut!==null;){switch(n=Ut,g=n.alternate,e=n.flags,n.tag){case 0:if((e&4)!==0&&(e=n.updateQueue,e=e!==null?e.events:null,e!==null))for(a=0;a<e.length;a++)m=e[a],m.ref.impl=m.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&g!==null){e=void 0,a=n,m=g.memoizedProps,g=g.memoizedState,s=a.stateNode;try{var Ue=na(a.type,m);e=s.getSnapshotBeforeUpdate(Ue,g),s.__reactInternalSnapshotBeforeUpdate=e}catch(Ye){mt(a,a.return,Ye)}}break;case 3:if((e&1024)!==0){if(e=n.stateNode.containerInfo,a=e.nodeType,a===9)oc(e);else if(a===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":oc(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(l(163))}if(e=n.sibling,e!==null){e.return=n.return,Ut=e;break}Ut=n.return}}function fp(e,n,a){var s=a.flags;switch(a.tag){case 0:case 11:case 15:ri(e,a),s&4&&Rr(5,a);break;case 1:if(ri(e,a),s&4)if(e=a.stateNode,n===null)try{e.componentDidMount()}catch(C){mt(a,a.return,C)}else{var m=na(a.type,n.memoizedProps);n=n.memoizedState;try{e.componentDidUpdate(m,n,e.__reactInternalSnapshotBeforeUpdate)}catch(C){mt(a,a.return,C)}}s&64&&lp(a),s&512&&Or(a,a.return);break;case 3:if(ri(e,a),s&64&&(e=a.updateQueue,e!==null)){if(n=null,a.child!==null)switch(a.child.tag){case 27:case 5:n=a.child.stateNode;break;case 1:n=a.child.stateNode}try{Zf(e,n)}catch(C){mt(a,a.return,C)}}break;case 27:n===null&&s&4&&cp(a);case 26:case 5:ri(e,a),n===null&&s&4&&op(a),s&512&&Or(a,a.return);break;case 12:ri(e,a);break;case 31:ri(e,a),s&4&&mp(e,a);break;case 13:ri(e,a),s&4&&gp(e,a),s&64&&(e=a.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(a=cy.bind(null,a),zy(e,a))));break;case 22:if(s=a.memoizedState!==null||ii,!s){n=n!==null&&n.memoizedState!==null||Dt,m=ii;var g=Dt;ii=s,(Dt=n)&&!g?li(e,a,(a.subtreeFlags&8772)!==0):ri(e,a),ii=m,Dt=g}break;case 30:break;default:ri(e,a)}}function hp(e){var n=e.alternate;n!==null&&(e.alternate=null,hp(n)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(n=e.stateNode,n!==null&&ho(n)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var jt=null,Qt=!1;function ai(e,n,a){for(a=a.child;a!==null;)pp(e,n,a),a=a.sibling}function pp(e,n,a){if(Ve&&typeof Ve.onCommitFiberUnmount=="function")try{Ve.onCommitFiberUnmount(Be,a)}catch{}switch(a.tag){case 26:Dt||Bn(a,n),ai(e,n,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:Dt||Bn(a,n);var s=jt,m=Qt;Ti(a.type)&&(jt=a.stateNode,Qt=!1),ai(e,n,a),Fr(a.stateNode),jt=s,Qt=m;break;case 5:Dt||Bn(a,n);case 6:if(s=jt,m=Qt,jt=null,ai(e,n,a),jt=s,Qt=m,jt!==null)if(Qt)try{(jt.nodeType===9?jt.body:jt.nodeName==="HTML"?jt.ownerDocument.body:jt).removeChild(a.stateNode)}catch(g){mt(a,n,g)}else try{jt.removeChild(a.stateNode)}catch(g){mt(a,n,g)}break;case 18:jt!==null&&(Qt?(e=jt,lm(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,a.stateNode),Ya(e)):lm(jt,a.stateNode));break;case 4:s=jt,m=Qt,jt=a.stateNode.containerInfo,Qt=!0,ai(e,n,a),jt=s,Qt=m;break;case 0:case 11:case 14:case 15:ji(2,a,n),Dt||ji(4,a,n),ai(e,n,a);break;case 1:Dt||(Bn(a,n),s=a.stateNode,typeof s.componentWillUnmount=="function"&&sp(a,n,s)),ai(e,n,a);break;case 21:ai(e,n,a);break;case 22:Dt=(s=Dt)||a.memoizedState!==null,ai(e,n,a),Dt=s;break;default:ai(e,n,a)}}function mp(e,n){if(n.memoizedState===null&&(e=n.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Ya(e)}catch(a){mt(n,n.return,a)}}}function gp(e,n){if(n.memoizedState===null&&(e=n.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Ya(e)}catch(a){mt(n,n.return,a)}}function ny(e){switch(e.tag){case 31:case 13:case 19:var n=e.stateNode;return n===null&&(n=e.stateNode=new dp),n;case 22:return e=e.stateNode,n=e._retryCache,n===null&&(n=e._retryCache=new dp),n;default:throw Error(l(435,e.tag))}}function rs(e,n){var a=ny(e);n.forEach(function(s){if(!a.has(s)){a.add(s);var m=dy.bind(null,e,s);s.then(m,m)}})}function Jt(e,n){var a=n.deletions;if(a!==null)for(var s=0;s<a.length;s++){var m=a[s],g=e,C=n,U=C;e:for(;U!==null;){switch(U.tag){case 27:if(Ti(U.type)){jt=U.stateNode,Qt=!1;break e}break;case 5:jt=U.stateNode,Qt=!1;break e;case 3:case 4:jt=U.stateNode.containerInfo,Qt=!0;break e}U=U.return}if(jt===null)throw Error(l(160));pp(g,C,m),jt=null,Qt=!1,g=m.alternate,g!==null&&(g.return=null),m.return=null}if(n.subtreeFlags&13886)for(n=n.child;n!==null;)xp(n,e),n=n.sibling}var zn=null;function xp(e,n){var a=e.alternate,s=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Jt(n,e),Wt(e),s&4&&(ji(3,e,e.return),Rr(3,e),ji(5,e,e.return));break;case 1:Jt(n,e),Wt(e),s&512&&(Dt||a===null||Bn(a,a.return)),s&64&&ii&&(e=e.updateQueue,e!==null&&(s=e.callbacks,s!==null&&(a=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=a===null?s:a.concat(s))));break;case 26:var m=zn;if(Jt(n,e),Wt(e),s&512&&(Dt||a===null||Bn(a,a.return)),s&4){var g=a!==null?a.memoizedState:null;if(s=e.memoizedState,a===null)if(s===null)if(e.stateNode===null){e:{s=e.type,a=e.memoizedProps,m=m.ownerDocument||m;t:switch(s){case"title":g=m.getElementsByTagName("title")[0],(!g||g[lr]||g[Ne]||g.namespaceURI==="http://www.w3.org/2000/svg"||g.hasAttribute("itemprop"))&&(g=m.createElement(s),m.head.insertBefore(g,m.querySelector("head > title"))),Ft(g,s,a),g[Ne]=e,Bt(g),s=g;break e;case"link":var C=xm("link","href",m).get(s+(a.href||""));if(C){for(var U=0;U<C.length;U++)if(g=C[U],g.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&g.getAttribute("rel")===(a.rel==null?null:a.rel)&&g.getAttribute("title")===(a.title==null?null:a.title)&&g.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){C.splice(U,1);break t}}g=m.createElement(s),Ft(g,s,a),m.head.appendChild(g);break;case"meta":if(C=xm("meta","content",m).get(s+(a.content||""))){for(U=0;U<C.length;U++)if(g=C[U],g.getAttribute("content")===(a.content==null?null:""+a.content)&&g.getAttribute("name")===(a.name==null?null:a.name)&&g.getAttribute("property")===(a.property==null?null:a.property)&&g.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&g.getAttribute("charset")===(a.charSet==null?null:a.charSet)){C.splice(U,1);break t}}g=m.createElement(s),Ft(g,s,a),m.head.appendChild(g);break;default:throw Error(l(468,s))}g[Ne]=e,Bt(g),s=g}e.stateNode=s}else bm(m,e.type,e.stateNode);else e.stateNode=gm(m,s,e.memoizedProps);else g!==s?(g===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):g.count--,s===null?bm(m,e.type,e.stateNode):gm(m,s,e.memoizedProps)):s===null&&e.stateNode!==null&&Du(e,e.memoizedProps,a.memoizedProps)}break;case 27:Jt(n,e),Wt(e),s&512&&(Dt||a===null||Bn(a,a.return)),a!==null&&s&4&&Du(e,e.memoizedProps,a.memoizedProps);break;case 5:if(Jt(n,e),Wt(e),s&512&&(Dt||a===null||Bn(a,a.return)),e.flags&32){m=e.stateNode;try{pa(m,"")}catch(Ue){mt(e,e.return,Ue)}}s&4&&e.stateNode!=null&&(m=e.memoizedProps,Du(e,m,a!==null?a.memoizedProps:m)),s&1024&&(Bu=!0);break;case 6:if(Jt(n,e),Wt(e),s&4){if(e.stateNode===null)throw Error(l(162));s=e.memoizedProps,a=e.stateNode;try{a.nodeValue=s}catch(Ue){mt(e,e.return,Ue)}}break;case 3:if(ws=null,m=zn,zn=ys(n.containerInfo),Jt(n,e),zn=m,Wt(e),s&4&&a!==null&&a.memoizedState.isDehydrated)try{Ya(n.containerInfo)}catch(Ue){mt(e,e.return,Ue)}Bu&&(Bu=!1,bp(e));break;case 4:s=zn,zn=ys(e.stateNode.containerInfo),Jt(n,e),Wt(e),zn=s;break;case 12:Jt(n,e),Wt(e);break;case 31:Jt(n,e),Wt(e),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,rs(e,s)));break;case 13:Jt(n,e),Wt(e),e.child.flags&8192&&e.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(ss=Ee()),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,rs(e,s)));break;case 22:m=e.memoizedState!==null;var Z=a!==null&&a.memoizedState!==null,ue=ii,ge=Dt;if(ii=ue||m,Dt=ge||Z,Jt(n,e),Dt=ge,ii=ue,Wt(e),s&8192)e:for(n=e.stateNode,n._visibility=m?n._visibility&-2:n._visibility|1,m&&(a===null||Z||ii||Dt||ia(e)),a=null,n=e;;){if(n.tag===5||n.tag===26){if(a===null){Z=a=n;try{if(g=Z.stateNode,m)C=g.style,typeof C.setProperty=="function"?C.setProperty("display","none","important"):C.display="none";else{U=Z.stateNode;var _e=Z.memoizedProps.style,ce=_e!=null&&_e.hasOwnProperty("display")?_e.display:null;U.style.display=ce==null||typeof ce=="boolean"?"":(""+ce).trim()}}catch(Ue){mt(Z,Z.return,Ue)}}}else if(n.tag===6){if(a===null){Z=n;try{Z.stateNode.nodeValue=m?"":Z.memoizedProps}catch(Ue){mt(Z,Z.return,Ue)}}}else if(n.tag===18){if(a===null){Z=n;try{var he=Z.stateNode;m?sm(he,!0):sm(Z.stateNode,!1)}catch(Ue){mt(Z,Z.return,Ue)}}}else if((n.tag!==22&&n.tag!==23||n.memoizedState===null||n===e)&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break e;for(;n.sibling===null;){if(n.return===null||n.return===e)break e;a===n&&(a=null),n=n.return}a===n&&(a=null),n.sibling.return=n.return,n=n.sibling}s&4&&(s=e.updateQueue,s!==null&&(a=s.retryQueue,a!==null&&(s.retryQueue=null,rs(e,a))));break;case 19:Jt(n,e),Wt(e),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,rs(e,s)));break;case 30:break;case 21:break;default:Jt(n,e),Wt(e)}}function Wt(e){var n=e.flags;if(n&2){try{for(var a,s=e.return;s!==null;){if(up(s)){a=s;break}s=s.return}if(a==null)throw Error(l(160));switch(a.tag){case 27:var m=a.stateNode,g=Mu(e);as(e,g,m);break;case 5:var C=a.stateNode;a.flags&32&&(pa(C,""),a.flags&=-33);var U=Mu(e);as(e,U,C);break;case 3:case 4:var Z=a.stateNode.containerInfo,ue=Mu(e);Lu(e,ue,Z);break;default:throw Error(l(161))}}catch(ge){mt(e,e.return,ge)}e.flags&=-3}n&4096&&(e.flags&=-4097)}function bp(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var n=e;bp(n),n.tag===5&&n.flags&1024&&n.stateNode.reset(),e=e.sibling}}function ri(e,n){if(n.subtreeFlags&8772)for(n=n.child;n!==null;)fp(e,n.alternate,n),n=n.sibling}function ia(e){for(e=e.child;e!==null;){var n=e;switch(n.tag){case 0:case 11:case 14:case 15:ji(4,n,n.return),ia(n);break;case 1:Bn(n,n.return);var a=n.stateNode;typeof a.componentWillUnmount=="function"&&sp(n,n.return,a),ia(n);break;case 27:Fr(n.stateNode);case 26:case 5:Bn(n,n.return),ia(n);break;case 22:n.memoizedState===null&&ia(n);break;case 30:ia(n);break;default:ia(n)}e=e.sibling}}function li(e,n,a){for(a=a&&(n.subtreeFlags&8772)!==0,n=n.child;n!==null;){var s=n.alternate,m=e,g=n,C=g.flags;switch(g.tag){case 0:case 11:case 15:li(m,g,a),Rr(4,g);break;case 1:if(li(m,g,a),s=g,m=s.stateNode,typeof m.componentDidMount=="function")try{m.componentDidMount()}catch(ue){mt(s,s.return,ue)}if(s=g,m=s.updateQueue,m!==null){var U=s.stateNode;try{var Z=m.shared.hiddenCallbacks;if(Z!==null)for(m.shared.hiddenCallbacks=null,m=0;m<Z.length;m++)Xf(Z[m],U)}catch(ue){mt(s,s.return,ue)}}a&&C&64&&lp(g),Or(g,g.return);break;case 27:cp(g);case 26:case 5:li(m,g,a),a&&s===null&&C&4&&op(g),Or(g,g.return);break;case 12:li(m,g,a);break;case 31:li(m,g,a),a&&C&4&&mp(m,g);break;case 13:li(m,g,a),a&&C&4&&gp(m,g);break;case 22:g.memoizedState===null&&li(m,g,a),Or(g,g.return);break;case 30:break;default:li(m,g,a)}n=n.sibling}}function Uu(e,n){var a=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),e=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(e=n.memoizedState.cachePool.pool),e!==a&&(e!=null&&e.refCount++,a!=null&&yr(a))}function Iu(e,n){e=null,n.alternate!==null&&(e=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==e&&(n.refCount++,e!=null&&yr(e))}function Tn(e,n,a,s){if(n.subtreeFlags&10256)for(n=n.child;n!==null;)yp(e,n,a,s),n=n.sibling}function yp(e,n,a,s){var m=n.flags;switch(n.tag){case 0:case 11:case 15:Tn(e,n,a,s),m&2048&&Rr(9,n);break;case 1:Tn(e,n,a,s);break;case 3:Tn(e,n,a,s),m&2048&&(e=null,n.alternate!==null&&(e=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==e&&(n.refCount++,e!=null&&yr(e)));break;case 12:if(m&2048){Tn(e,n,a,s),e=n.stateNode;try{var g=n.memoizedProps,C=g.id,U=g.onPostCommit;typeof U=="function"&&U(C,n.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(Z){mt(n,n.return,Z)}}else Tn(e,n,a,s);break;case 31:Tn(e,n,a,s);break;case 13:Tn(e,n,a,s);break;case 23:break;case 22:g=n.stateNode,C=n.alternate,n.memoizedState!==null?g._visibility&2?Tn(e,n,a,s):Dr(e,n):g._visibility&2?Tn(e,n,a,s):(g._visibility|=2,Da(e,n,a,s,(n.subtreeFlags&10256)!==0||!1)),m&2048&&Uu(C,n);break;case 24:Tn(e,n,a,s),m&2048&&Iu(n.alternate,n);break;default:Tn(e,n,a,s)}}function Da(e,n,a,s,m){for(m=m&&((n.subtreeFlags&10256)!==0||!1),n=n.child;n!==null;){var g=e,C=n,U=a,Z=s,ue=C.flags;switch(C.tag){case 0:case 11:case 15:Da(g,C,U,Z,m),Rr(8,C);break;case 23:break;case 22:var ge=C.stateNode;C.memoizedState!==null?ge._visibility&2?Da(g,C,U,Z,m):Dr(g,C):(ge._visibility|=2,Da(g,C,U,Z,m)),m&&ue&2048&&Uu(C.alternate,C);break;case 24:Da(g,C,U,Z,m),m&&ue&2048&&Iu(C.alternate,C);break;default:Da(g,C,U,Z,m)}n=n.sibling}}function Dr(e,n){if(n.subtreeFlags&10256)for(n=n.child;n!==null;){var a=e,s=n,m=s.flags;switch(s.tag){case 22:Dr(a,s),m&2048&&Uu(s.alternate,s);break;case 24:Dr(a,s),m&2048&&Iu(s.alternate,s);break;default:Dr(a,s)}n=n.sibling}}var Mr=8192;function Ma(e,n,a){if(e.subtreeFlags&Mr)for(e=e.child;e!==null;)vp(e,n,a),e=e.sibling}function vp(e,n,a){switch(e.tag){case 26:Ma(e,n,a),e.flags&Mr&&e.memoizedState!==null&&Fy(a,zn,e.memoizedState,e.memoizedProps);break;case 5:Ma(e,n,a);break;case 3:case 4:var s=zn;zn=ys(e.stateNode.containerInfo),Ma(e,n,a),zn=s;break;case 22:e.memoizedState===null&&(s=e.alternate,s!==null&&s.memoizedState!==null?(s=Mr,Mr=16777216,Ma(e,n,a),Mr=s):Ma(e,n,a));break;default:Ma(e,n,a)}}function wp(e){var n=e.alternate;if(n!==null&&(e=n.child,e!==null)){n.child=null;do n=e.sibling,e.sibling=null,e=n;while(e!==null)}}function Lr(e){var n=e.deletions;if((e.flags&16)!==0){if(n!==null)for(var a=0;a<n.length;a++){var s=n[a];Ut=s,kp(s,e)}wp(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Sp(e),e=e.sibling}function Sp(e){switch(e.tag){case 0:case 11:case 15:Lr(e),e.flags&2048&&ji(9,e,e.return);break;case 3:Lr(e);break;case 12:Lr(e);break;case 22:var n=e.stateNode;e.memoizedState!==null&&n._visibility&2&&(e.return===null||e.return.tag!==13)?(n._visibility&=-3,ls(e)):Lr(e);break;default:Lr(e)}}function ls(e){var n=e.deletions;if((e.flags&16)!==0){if(n!==null)for(var a=0;a<n.length;a++){var s=n[a];Ut=s,kp(s,e)}wp(e)}for(e=e.child;e!==null;){switch(n=e,n.tag){case 0:case 11:case 15:ji(8,n,n.return),ls(n);break;case 22:a=n.stateNode,a._visibility&2&&(a._visibility&=-3,ls(n));break;default:ls(n)}e=e.sibling}}function kp(e,n){for(;Ut!==null;){var a=Ut;switch(a.tag){case 0:case 11:case 15:ji(8,a,n);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var s=a.memoizedState.cachePool.pool;s!=null&&s.refCount++}break;case 24:yr(a.memoizedState.cache)}if(s=a.child,s!==null)s.return=a,Ut=s;else e:for(a=e;Ut!==null;){s=Ut;var m=s.sibling,g=s.return;if(hp(s),s===a){Ut=null;break e}if(m!==null){m.return=g,Ut=m;break e}Ut=g}}}var iy={getCacheForType:function(e){var n=Ht(Tt),a=n.data.get(e);return a===void 0&&(a=e(),n.data.set(e,a)),a},cacheSignal:function(){return Ht(Tt).controller.signal}},ay=typeof WeakMap=="function"?WeakMap:Map,dt=0,yt=null,We=null,it=0,pt=0,un=null,_i=!1,La=!1,Hu=!1,si=0,Nt=0,Ci=0,aa=0,Pu=0,cn=0,Ba=0,Br=null,en=null,Fu=!1,ss=0,jp=0,os=1/0,us=null,Ni=null,Lt=0,Ei=null,Ua=null,oi=0,qu=0,Vu=null,_p=null,Ur=0,Yu=null;function dn(){return(dt&2)!==0&&it!==0?it&-it:$.T!==null?Qu():yl()}function Cp(){if(cn===0)if((it&536870912)===0||rt){var e=Vn;Vn<<=1,(Vn&3932160)===0&&(Vn=262144),cn=e}else cn=536870912;return e=sn.current,e!==null&&(e.flags|=32),cn}function tn(e,n,a){(e===yt&&(pt===2||pt===9)||e.cancelPendingCommit!==null)&&(Ia(e,0),Ai(e,it,cn,!1)),Pi(e,a),((dt&2)===0||e!==yt)&&(e===yt&&((dt&2)===0&&(aa|=a),Nt===4&&Ai(e,it,cn,!1)),Un(e))}function Np(e,n,a){if((dt&6)!==0)throw Error(l(327));var s=!a&&(n&127)===0&&(n&e.expiredLanes)===0||Yn(e,n),m=s?sy(e,n):Ku(e,n,!0),g=s;do{if(m===0){La&&!s&&Ai(e,n,0,!1);break}else{if(a=e.current.alternate,g&&!ry(a)){m=Ku(e,n,!1),g=!1;continue}if(m===2){if(g=n,e.errorRecoveryDisabledLanes&g)var C=0;else C=e.pendingLanes&-536870913,C=C!==0?C:C&536870912?536870912:0;if(C!==0){n=C;e:{var U=e;m=Br;var Z=U.current.memoizedState.isDehydrated;if(Z&&(Ia(U,C).flags|=256),C=Ku(U,C,!1),C!==2){if(Hu&&!Z){U.errorRecoveryDisabledLanes|=g,aa|=g,m=4;break e}g=en,en=m,g!==null&&(en===null?en=g:en.push.apply(en,g))}m=C}if(g=!1,m!==2)continue}}if(m===1){Ia(e,0),Ai(e,n,0,!0);break}e:{switch(s=e,g=m,g){case 0:case 1:throw Error(l(345));case 4:if((n&4194048)!==n)break;case 6:Ai(s,n,cn,!_i);break e;case 2:en=null;break;case 3:case 5:break;default:throw Error(l(329))}if((n&62914560)===n&&(m=ss+300-Ee(),10<m)){if(Ai(s,n,cn,!_i),hi(s,0,!0)!==0)break e;oi=n,s.timeoutHandle=am(Ep.bind(null,s,a,en,us,Fu,n,cn,aa,Ba,_i,g,"Throttled",-0,0),m);break e}Ep(s,a,en,us,Fu,n,cn,aa,Ba,_i,g,null,-0,0)}}break}while(!0);Un(e)}function Ep(e,n,a,s,m,g,C,U,Z,ue,ge,_e,ce,he){if(e.timeoutHandle=-1,_e=n.subtreeFlags,_e&8192||(_e&16785408)===16785408){_e={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Kn},vp(n,g,_e);var Ue=(g&62914560)===g?ss-Ee():(g&4194048)===g?jp-Ee():0;if(Ue=qy(_e,Ue),Ue!==null){oi=g,e.cancelPendingCommit=Ue(Lp.bind(null,e,n,g,a,s,m,C,U,Z,ge,_e,null,ce,he)),Ai(e,g,C,!ue);return}}Lp(e,n,g,a,s,m,C,U,Z)}function ry(e){for(var n=e;;){var a=n.tag;if((a===0||a===11||a===15)&&n.flags&16384&&(a=n.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var s=0;s<a.length;s++){var m=a[s],g=m.getSnapshot;m=m.value;try{if(!rn(g(),m))return!1}catch{return!1}}if(a=n.child,n.subtreeFlags&16384&&a!==null)a.return=n,n=a;else{if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return!0;n=n.return}n.sibling.return=n.return,n=n.sibling}}return!0}function Ai(e,n,a,s){n&=~Pu,n&=~aa,e.suspendedLanes|=n,e.pingedLanes&=~n,s&&(e.warmLanes|=n),s=e.expirationTimes;for(var m=n;0<m;){var g=31-Le(m),C=1<<g;s[g]=-1,m&=~C}a!==0&&uo(e,a,n)}function cs(){return(dt&6)===0?(Ir(0),!1):!0}function Gu(){if(We!==null){if(pt===0)var e=We.return;else e=We,Qn=Xi=null,ou(e),Aa=null,wr=0,e=We;for(;e!==null;)rp(e.alternate,e),e=e.return;We=null}}function Ia(e,n){var a=e.timeoutHandle;a!==-1&&(e.timeoutHandle=-1,_y(a)),a=e.cancelPendingCommit,a!==null&&(e.cancelPendingCommit=null,a()),oi=0,Gu(),yt=e,We=a=Xn(e.current,null),it=n,pt=0,un=null,_i=!1,La=Yn(e,n),Hu=!1,Ba=cn=Pu=aa=Ci=Nt=0,en=Br=null,Fu=!1,(n&8)!==0&&(n|=n&32);var s=e.entangledLanes;if(s!==0)for(e=e.entanglements,s&=n;0<s;){var m=31-Le(s),g=1<<m;n|=e[m],s&=~g}return si=n,Tl(),a}function Ap(e,n){Xe=null,$.H=Ar,n===Ea||n===Il?(n=Yf(),pt=3):n===Zo?(n=Yf(),pt=4):pt=n===ju?8:n!==null&&typeof n=="object"&&typeof n.then=="function"?6:1,un=n,We===null&&(Nt=1,Wl(e,bn(n,e.current)))}function zp(){var e=sn.current;return e===null?!0:(it&4194048)===it?Sn===null:(it&62914560)===it||(it&536870912)!==0?e===Sn:!1}function Tp(){var e=$.H;return $.H=Ar,e===null?Ar:e}function Rp(){var e=$.A;return $.A=iy,e}function ds(){Nt=4,_i||(it&4194048)!==it&&sn.current!==null||(La=!0),(Ci&134217727)===0&&(aa&134217727)===0||yt===null||Ai(yt,it,cn,!1)}function Ku(e,n,a){var s=dt;dt|=2;var m=Tp(),g=Rp();(yt!==e||it!==n)&&(us=null,Ia(e,n)),n=!1;var C=Nt;e:do try{if(pt!==0&&We!==null){var U=We,Z=un;switch(pt){case 8:Gu(),C=6;break e;case 3:case 2:case 9:case 6:sn.current===null&&(n=!0);var ue=pt;if(pt=0,un=null,Ha(e,U,Z,ue),a&&La){C=0;break e}break;default:ue=pt,pt=0,un=null,Ha(e,U,Z,ue)}}ly(),C=Nt;break}catch(ge){Ap(e,ge)}while(!0);return n&&e.shellSuspendCounter++,Qn=Xi=null,dt=s,$.H=m,$.A=g,We===null&&(yt=null,it=0,Tl()),C}function ly(){for(;We!==null;)Op(We)}function sy(e,n){var a=dt;dt|=2;var s=Tp(),m=Rp();yt!==e||it!==n?(us=null,os=Ee()+500,Ia(e,n)):La=Yn(e,n);e:do try{if(pt!==0&&We!==null){n=We;var g=un;t:switch(pt){case 1:pt=0,un=null,Ha(e,n,g,1);break;case 2:case 9:if(qf(g)){pt=0,un=null,Dp(n);break}n=function(){pt!==2&&pt!==9||yt!==e||(pt=7),Un(e)},g.then(n,n);break e;case 3:pt=7;break e;case 4:pt=5;break e;case 7:qf(g)?(pt=0,un=null,Dp(n)):(pt=0,un=null,Ha(e,n,g,7));break;case 5:var C=null;switch(We.tag){case 26:C=We.memoizedState;case 5:case 27:var U=We;if(C?ym(C):U.stateNode.complete){pt=0,un=null;var Z=U.sibling;if(Z!==null)We=Z;else{var ue=U.return;ue!==null?(We=ue,fs(ue)):We=null}break t}}pt=0,un=null,Ha(e,n,g,5);break;case 6:pt=0,un=null,Ha(e,n,g,6);break;case 8:Gu(),Nt=6;break e;default:throw Error(l(462))}}oy();break}catch(ge){Ap(e,ge)}while(!0);return Qn=Xi=null,$.H=s,$.A=m,dt=a,We!==null?0:(yt=null,it=0,Tl(),Nt)}function oy(){for(;We!==null&&!K();)Op(We)}function Op(e){var n=ip(e.alternate,e,si);e.memoizedProps=e.pendingProps,n===null?fs(e):We=n}function Dp(e){var n=e,a=n.alternate;switch(n.tag){case 15:case 0:n=Qh(a,n,n.pendingProps,n.type,void 0,it);break;case 11:n=Qh(a,n,n.pendingProps,n.type.render,n.ref,it);break;case 5:ou(n);default:rp(a,n),n=We=Rf(n,si),n=ip(a,n,si)}e.memoizedProps=e.pendingProps,n===null?fs(e):We=n}function Ha(e,n,a,s){Qn=Xi=null,ou(n),Aa=null,wr=0;var m=n.return;try{if(Z0(e,m,n,a,it)){Nt=1,Wl(e,bn(a,e.current)),We=null;return}}catch(g){if(m!==null)throw We=m,g;Nt=1,Wl(e,bn(a,e.current)),We=null;return}n.flags&32768?(rt||s===1?e=!0:La||(it&536870912)!==0?e=!1:(_i=e=!0,(s===2||s===9||s===3||s===6)&&(s=sn.current,s!==null&&s.tag===13&&(s.flags|=16384))),Mp(n,e)):fs(n)}function fs(e){var n=e;do{if((n.flags&32768)!==0){Mp(n,_i);return}e=n.return;var a=W0(n.alternate,n,si);if(a!==null){We=a;return}if(n=n.sibling,n!==null){We=n;return}We=n=e}while(n!==null);Nt===0&&(Nt=5)}function Mp(e,n){do{var a=ey(e.alternate,e);if(a!==null){a.flags&=32767,We=a;return}if(a=e.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!n&&(e=e.sibling,e!==null)){We=e;return}We=e=a}while(e!==null);Nt=6,We=null}function Lp(e,n,a,s,m,g,C,U,Z){e.cancelPendingCommit=null;do hs();while(Lt!==0);if((dt&6)!==0)throw Error(l(327));if(n!==null){if(n===e.current)throw Error(l(177));if(g=n.lanes|n.childLanes,g|=Mo,Dn(e,a,g,C,U,Z),e===yt&&(We=yt=null,it=0),Ua=n,Ei=e,oi=a,qu=g,Vu=m,_p=s,(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,fy(Ae,function(){return Pp(),null})):(e.callbackNode=null,e.callbackPriority=0),s=(n.flags&13878)!==0,(n.subtreeFlags&13878)!==0||s){s=$.T,$.T=null,m=J.p,J.p=2,C=dt,dt|=4;try{ty(e,n,a)}finally{dt=C,J.p=m,$.T=s}}Lt=1,Bp(),Up(),Ip()}}function Bp(){if(Lt===1){Lt=0;var e=Ei,n=Ua,a=(n.flags&13878)!==0;if((n.subtreeFlags&13878)!==0||a){a=$.T,$.T=null;var s=J.p;J.p=2;var m=dt;dt|=4;try{xp(n,e);var g=rc,C=kf(e.containerInfo),U=g.focusedElem,Z=g.selectionRange;if(C!==U&&U&&U.ownerDocument&&Sf(U.ownerDocument.documentElement,U)){if(Z!==null&&zo(U)){var ue=Z.start,ge=Z.end;if(ge===void 0&&(ge=ue),"selectionStart"in U)U.selectionStart=ue,U.selectionEnd=Math.min(ge,U.value.length);else{var _e=U.ownerDocument||document,ce=_e&&_e.defaultView||window;if(ce.getSelection){var he=ce.getSelection(),Ue=U.textContent.length,Ye=Math.min(Z.start,Ue),bt=Z.end===void 0?Ye:Math.min(Z.end,Ue);!he.extend&&Ye>bt&&(C=bt,bt=Ye,Ye=C);var le=wf(U,Ye),te=wf(U,bt);if(le&&te&&(he.rangeCount!==1||he.anchorNode!==le.node||he.anchorOffset!==le.offset||he.focusNode!==te.node||he.focusOffset!==te.offset)){var oe=_e.createRange();oe.setStart(le.node,le.offset),he.removeAllRanges(),Ye>bt?(he.addRange(oe),he.extend(te.node,te.offset)):(oe.setEnd(te.node,te.offset),he.addRange(oe))}}}}for(_e=[],he=U;he=he.parentNode;)he.nodeType===1&&_e.push({element:he,left:he.scrollLeft,top:he.scrollTop});for(typeof U.focus=="function"&&U.focus(),U=0;U<_e.length;U++){var Se=_e[U];Se.element.scrollLeft=Se.left,Se.element.scrollTop=Se.top}}_s=!!ac,rc=ac=null}finally{dt=m,J.p=s,$.T=a}}e.current=n,Lt=2}}function Up(){if(Lt===2){Lt=0;var e=Ei,n=Ua,a=(n.flags&8772)!==0;if((n.subtreeFlags&8772)!==0||a){a=$.T,$.T=null;var s=J.p;J.p=2;var m=dt;dt|=4;try{fp(e,n.alternate,n)}finally{dt=m,J.p=s,$.T=a}}Lt=3}}function Ip(){if(Lt===4||Lt===3){Lt=0,xe();var e=Ei,n=Ua,a=oi,s=_p;(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?Lt=5:(Lt=0,Ua=Ei=null,Hp(e,e.pendingLanes));var m=e.pendingLanes;if(m===0&&(Ni=null),rr(a),n=n.stateNode,Ve&&typeof Ve.onCommitFiberRoot=="function")try{Ve.onCommitFiberRoot(Be,n,void 0,(n.current.flags&128)===128)}catch{}if(s!==null){n=$.T,m=J.p,J.p=2,$.T=null;try{for(var g=e.onRecoverableError,C=0;C<s.length;C++){var U=s[C];g(U.value,{componentStack:U.stack})}}finally{$.T=n,J.p=m}}(oi&3)!==0&&hs(),Un(e),m=e.pendingLanes,(a&261930)!==0&&(m&42)!==0?e===Yu?Ur++:(Ur=0,Yu=e):Ur=0,Ir(0)}}function Hp(e,n){(e.pooledCacheLanes&=n)===0&&(n=e.pooledCache,n!=null&&(e.pooledCache=null,yr(n)))}function hs(){return Bp(),Up(),Ip(),Pp()}function Pp(){if(Lt!==5)return!1;var e=Ei,n=qu;qu=0;var a=rr(oi),s=$.T,m=J.p;try{J.p=32>a?32:a,$.T=null,a=Vu,Vu=null;var g=Ei,C=oi;if(Lt=0,Ua=Ei=null,oi=0,(dt&6)!==0)throw Error(l(331));var U=dt;if(dt|=4,Sp(g.current),yp(g,g.current,C,a),dt=U,Ir(0,!1),Ve&&typeof Ve.onPostCommitFiberRoot=="function")try{Ve.onPostCommitFiberRoot(Be,g)}catch{}return!0}finally{J.p=m,$.T=s,Hp(e,n)}}function Fp(e,n,a){n=bn(a,n),n=ku(e.stateNode,n,2),e=wi(e,n,2),e!==null&&(Pi(e,2),Un(e))}function mt(e,n,a){if(e.tag===3)Fp(e,e,a);else for(;n!==null;){if(n.tag===3){Fp(n,e,a);break}else if(n.tag===1){var s=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(Ni===null||!Ni.has(s))){e=bn(a,e),a=qh(2),s=wi(n,a,2),s!==null&&(Vh(a,s,n,e),Pi(s,2),Un(s));break}}n=n.return}}function $u(e,n,a){var s=e.pingCache;if(s===null){s=e.pingCache=new ay;var m=new Set;s.set(n,m)}else m=s.get(n),m===void 0&&(m=new Set,s.set(n,m));m.has(a)||(Hu=!0,m.add(a),e=uy.bind(null,e,n,a),n.then(e,e))}function uy(e,n,a){var s=e.pingCache;s!==null&&s.delete(n),e.pingedLanes|=e.suspendedLanes&a,e.warmLanes&=~a,yt===e&&(it&a)===a&&(Nt===4||Nt===3&&(it&62914560)===it&&300>Ee()-ss?(dt&2)===0&&Ia(e,0):Pu|=a,Ba===it&&(Ba=0)),Un(e)}function qp(e,n){n===0&&(n=bl()),e=Gi(e,n),e!==null&&(Pi(e,n),Un(e))}function cy(e){var n=e.memoizedState,a=0;n!==null&&(a=n.retryLane),qp(e,a)}function dy(e,n){var a=0;switch(e.tag){case 31:case 13:var s=e.stateNode,m=e.memoizedState;m!==null&&(a=m.retryLane);break;case 19:s=e.stateNode;break;case 22:s=e.stateNode._retryCache;break;default:throw Error(l(314))}s!==null&&s.delete(n),qp(e,a)}function fy(e,n){return me(e,n)}var ps=null,Pa=null,Xu=!1,ms=!1,Zu=!1,zi=0;function Un(e){e!==Pa&&e.next===null&&(Pa===null?ps=Pa=e:Pa=Pa.next=e),ms=!0,Xu||(Xu=!0,py())}function Ir(e,n){if(!Zu&&ms){Zu=!0;do for(var a=!1,s=ps;s!==null;){if(e!==0){var m=s.pendingLanes;if(m===0)var g=0;else{var C=s.suspendedLanes,U=s.pingedLanes;g=(1<<31-Le(42|e)+1)-1,g&=m&~(C&~U),g=g&201326741?g&201326741|1:g?g|2:0}g!==0&&(a=!0,Kp(s,g))}else g=it,g=hi(s,s===yt?g:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),(g&3)===0||Yn(s,g)||(a=!0,Kp(s,g));s=s.next}while(a);Zu=!1}}function hy(){Vp()}function Vp(){ms=Xu=!1;var e=0;zi!==0&&jy()&&(e=zi);for(var n=Ee(),a=null,s=ps;s!==null;){var m=s.next,g=Yp(s,n);g===0?(s.next=null,a===null?ps=m:a.next=m,m===null&&(Pa=a)):(a=s,(e!==0||(g&3)!==0)&&(ms=!0)),s=m}Lt!==0&&Lt!==5||Ir(e),zi!==0&&(zi=0)}function Yp(e,n){for(var a=e.suspendedLanes,s=e.pingedLanes,m=e.expirationTimes,g=e.pendingLanes&-62914561;0<g;){var C=31-Le(g),U=1<<C,Z=m[C];Z===-1?((U&a)===0||(U&s)!==0)&&(m[C]=nr(U,n)):Z<=n&&(e.expiredLanes|=U),g&=~U}if(n=yt,a=it,a=hi(e,e===n?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s=e.callbackNode,a===0||e===n&&(pt===2||pt===9)||e.cancelPendingCommit!==null)return s!==null&&s!==null&&de(s),e.callbackNode=null,e.callbackPriority=0;if((a&3)===0||Yn(e,a)){if(n=a&-a,n===e.callbackPriority)return n;switch(s!==null&&de(s),rr(a)){case 2:case 8:a=ye;break;case 32:a=Ae;break;case 268435456:a=fe;break;default:a=Ae}return s=Gp.bind(null,e),a=me(a,s),e.callbackPriority=n,e.callbackNode=a,n}return s!==null&&s!==null&&de(s),e.callbackPriority=2,e.callbackNode=null,2}function Gp(e,n){if(Lt!==0&&Lt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var a=e.callbackNode;if(hs()&&e.callbackNode!==a)return null;var s=it;return s=hi(e,e===yt?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s===0?null:(Np(e,s,n),Yp(e,Ee()),e.callbackNode!=null&&e.callbackNode===a?Gp.bind(null,e):null)}function Kp(e,n){if(hs())return null;Np(e,n,!0)}function py(){Cy(function(){(dt&6)!==0?me(ae,hy):Vp()})}function Qu(){if(zi===0){var e=Ca;e===0&&(e=On,On<<=1,(On&261888)===0&&(On=256)),zi=e}return zi}function $p(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:kl(""+e)}function Xp(e,n){var a=n.ownerDocument.createElement("input");return a.name=n.name,a.value=n.value,e.id&&a.setAttribute("form",e.id),n.parentNode.insertBefore(a,n),e=new FormData(e),a.parentNode.removeChild(a),e}function my(e,n,a,s,m){if(n==="submit"&&a&&a.stateNode===m){var g=$p((m[Te]||null).action),C=s.submitter;C&&(n=(n=C[Te]||null)?$p(n.formAction):C.getAttribute("formAction"),n!==null&&(g=n,C=null));var U=new Nl("action","action",null,s,m);e.push({event:U,listeners:[{instance:null,listener:function(){if(s.defaultPrevented){if(zi!==0){var Z=C?Xp(m,C):new FormData(m);xu(a,{pending:!0,data:Z,method:m.method,action:g},null,Z)}}else typeof g=="function"&&(U.preventDefault(),Z=C?Xp(m,C):new FormData(m),xu(a,{pending:!0,data:Z,method:m.method,action:g},g,Z))},currentTarget:m}]})}}for(var Ju=0;Ju<Do.length;Ju++){var Wu=Do[Ju],gy=Wu.toLowerCase(),xy=Wu[0].toUpperCase()+Wu.slice(1);An(gy,"on"+xy)}An(Cf,"onAnimationEnd"),An(Nf,"onAnimationIteration"),An(Ef,"onAnimationStart"),An("dblclick","onDoubleClick"),An("focusin","onFocus"),An("focusout","onBlur"),An(O0,"onTransitionRun"),An(D0,"onTransitionStart"),An(M0,"onTransitionCancel"),An(Af,"onTransitionEnd"),fa("onMouseEnter",["mouseout","mouseover"]),fa("onMouseLeave",["mouseout","mouseover"]),fa("onPointerEnter",["pointerout","pointerover"]),fa("onPointerLeave",["pointerout","pointerover"]),Fi("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Fi("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Fi("onBeforeInput",["compositionend","keypress","textInput","paste"]),Fi("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Fi("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Fi("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Hr="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(" "),by=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Hr));function Zp(e,n){n=(n&4)!==0;for(var a=0;a<e.length;a++){var s=e[a],m=s.event;s=s.listeners;e:{var g=void 0;if(n)for(var C=s.length-1;0<=C;C--){var U=s[C],Z=U.instance,ue=U.currentTarget;if(U=U.listener,Z!==g&&m.isPropagationStopped())break e;g=U,m.currentTarget=ue;try{g(m)}catch(ge){zl(ge)}m.currentTarget=null,g=Z}else for(C=0;C<s.length;C++){if(U=s[C],Z=U.instance,ue=U.currentTarget,U=U.listener,Z!==g&&m.isPropagationStopped())break e;g=U,m.currentTarget=ue;try{g(m)}catch(ge){zl(ge)}m.currentTarget=null,g=Z}}}}function et(e,n){var a=n[Gt];a===void 0&&(a=n[Gt]=new Set);var s=e+"__bubble";a.has(s)||(Qp(n,e,2,!1),a.add(s))}function ec(e,n,a){var s=0;n&&(s|=4),Qp(a,e,s,n)}var gs="_reactListening"+Math.random().toString(36).slice(2);function tc(e){if(!e[gs]){e[gs]=!0,qd.forEach(function(a){a!=="selectionchange"&&(by.has(a)||ec(a,!1,e),ec(a,!0,e))});var n=e.nodeType===9?e:e.ownerDocument;n===null||n[gs]||(n[gs]=!0,ec("selectionchange",!1,n))}}function Qp(e,n,a,s){switch(Cm(n)){case 2:var m=Gy;break;case 8:m=Ky;break;default:m=gc}a=m.bind(null,n,a,e),m=void 0,!wo||n!=="touchstart"&&n!=="touchmove"&&n!=="wheel"||(m=!0),s?m!==void 0?e.addEventListener(n,a,{capture:!0,passive:m}):e.addEventListener(n,a,!0):m!==void 0?e.addEventListener(n,a,{passive:m}):e.addEventListener(n,a,!1)}function nc(e,n,a,s,m){var g=s;if((n&1)===0&&(n&2)===0&&s!==null)e:for(;;){if(s===null)return;var C=s.tag;if(C===3||C===4){var U=s.stateNode.containerInfo;if(U===m)break;if(C===4)for(C=s.return;C!==null;){var Z=C.tag;if((Z===3||Z===4)&&C.stateNode.containerInfo===m)return;C=C.return}for(;U!==null;){if(C=ua(U),C===null)return;if(Z=C.tag,Z===5||Z===6||Z===26||Z===27){s=g=C;continue e}U=U.parentNode}}s=s.return}tf(function(){var ue=g,ge=yo(a),_e=[];e:{var ce=zf.get(e);if(ce!==void 0){var he=Nl,Ue=e;switch(e){case"keypress":if(_l(a)===0)break e;case"keydown":case"keyup":he=d0;break;case"focusin":Ue="focus",he=_o;break;case"focusout":Ue="blur",he=_o;break;case"beforeblur":case"afterblur":he=_o;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":he=rf;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":he=Wb;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":he=p0;break;case Cf:case Nf:case Ef:he=n0;break;case Af:he=g0;break;case"scroll":case"scrollend":he=Qb;break;case"wheel":he=b0;break;case"copy":case"cut":case"paste":he=a0;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":he=sf;break;case"toggle":case"beforetoggle":he=v0}var Ye=(n&4)!==0,bt=!Ye&&(e==="scroll"||e==="scrollend"),le=Ye?ce!==null?ce+"Capture":null:ce;Ye=[];for(var te=ue,oe;te!==null;){var Se=te;if(oe=Se.stateNode,Se=Se.tag,Se!==5&&Se!==26&&Se!==27||oe===null||le===null||(Se=or(te,le),Se!=null&&Ye.push(Pr(te,Se,oe))),bt)break;te=te.return}0<Ye.length&&(ce=new he(ce,Ue,null,a,ge),_e.push({event:ce,listeners:Ye}))}}if((n&7)===0){e:{if(ce=e==="mouseover"||e==="pointerover",he=e==="mouseout"||e==="pointerout",ce&&a!==bo&&(Ue=a.relatedTarget||a.fromElement)&&(ua(Ue)||Ue[st]))break e;if((he||ce)&&(ce=ge.window===ge?ge:(ce=ge.ownerDocument)?ce.defaultView||ce.parentWindow:window,he?(Ue=a.relatedTarget||a.toElement,he=ue,Ue=Ue?ua(Ue):null,Ue!==null&&(bt=u(Ue),Ye=Ue.tag,Ue!==bt||Ye!==5&&Ye!==27&&Ye!==6)&&(Ue=null)):(he=null,Ue=ue),he!==Ue)){if(Ye=rf,Se="onMouseLeave",le="onMouseEnter",te="mouse",(e==="pointerout"||e==="pointerover")&&(Ye=sf,Se="onPointerLeave",le="onPointerEnter",te="pointer"),bt=he==null?ce:sr(he),oe=Ue==null?ce:sr(Ue),ce=new Ye(Se,te+"leave",he,a,ge),ce.target=bt,ce.relatedTarget=oe,Se=null,ua(ge)===ue&&(Ye=new Ye(le,te+"enter",Ue,a,ge),Ye.target=oe,Ye.relatedTarget=bt,Se=Ye),bt=Se,he&&Ue)t:{for(Ye=yy,le=he,te=Ue,oe=0,Se=le;Se;Se=Ye(Se))oe++;Se=0;for(var Fe=te;Fe;Fe=Ye(Fe))Se++;for(;0<oe-Se;)le=Ye(le),oe--;for(;0<Se-oe;)te=Ye(te),Se--;for(;oe--;){if(le===te||te!==null&&le===te.alternate){Ye=le;break t}le=Ye(le),te=Ye(te)}Ye=null}else Ye=null;he!==null&&Jp(_e,ce,he,Ye,!1),Ue!==null&&bt!==null&&Jp(_e,bt,Ue,Ye,!0)}}e:{if(ce=ue?sr(ue):window,he=ce.nodeName&&ce.nodeName.toLowerCase(),he==="select"||he==="input"&&ce.type==="file")var ot=mf;else if(hf(ce))if(gf)ot=z0;else{ot=E0;var He=N0}else he=ce.nodeName,!he||he.toLowerCase()!=="input"||ce.type!=="checkbox"&&ce.type!=="radio"?ue&&xo(ue.elementType)&&(ot=mf):ot=A0;if(ot&&(ot=ot(e,ue))){pf(_e,ot,a,ge);break e}He&&He(e,ce,ue),e==="focusout"&&ue&&ce.type==="number"&&ue.memoizedProps.value!=null&&go(ce,"number",ce.value)}switch(He=ue?sr(ue):window,e){case"focusin":(hf(He)||He.contentEditable==="true")&&(ba=He,To=ue,gr=null);break;case"focusout":gr=To=ba=null;break;case"mousedown":Ro=!0;break;case"contextmenu":case"mouseup":case"dragend":Ro=!1,jf(_e,a,ge);break;case"selectionchange":if(R0)break;case"keydown":case"keyup":jf(_e,a,ge)}var Ze;if(No)e:{switch(e){case"compositionstart":var at="onCompositionStart";break e;case"compositionend":at="onCompositionEnd";break e;case"compositionupdate":at="onCompositionUpdate";break e}at=void 0}else xa?df(e,a)&&(at="onCompositionEnd"):e==="keydown"&&a.keyCode===229&&(at="onCompositionStart");at&&(of&&a.locale!=="ko"&&(xa||at!=="onCompositionStart"?at==="onCompositionEnd"&&xa&&(Ze=nf()):(pi=ge,So="value"in pi?pi.value:pi.textContent,xa=!0)),He=xs(ue,at),0<He.length&&(at=new lf(at,e,null,a,ge),_e.push({event:at,listeners:He}),Ze?at.data=Ze:(Ze=ff(a),Ze!==null&&(at.data=Ze)))),(Ze=S0?k0(e,a):j0(e,a))&&(at=xs(ue,"onBeforeInput"),0<at.length&&(He=new lf("onBeforeInput","beforeinput",null,a,ge),_e.push({event:He,listeners:at}),He.data=Ze)),my(_e,e,ue,a,ge)}Zp(_e,n)})}function Pr(e,n,a){return{instance:e,listener:n,currentTarget:a}}function xs(e,n){for(var a=n+"Capture",s=[];e!==null;){var m=e,g=m.stateNode;if(m=m.tag,m!==5&&m!==26&&m!==27||g===null||(m=or(e,a),m!=null&&s.unshift(Pr(e,m,g)),m=or(e,n),m!=null&&s.push(Pr(e,m,g))),e.tag===3)return s;e=e.return}return[]}function yy(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Jp(e,n,a,s,m){for(var g=n._reactName,C=[];a!==null&&a!==s;){var U=a,Z=U.alternate,ue=U.stateNode;if(U=U.tag,Z!==null&&Z===s)break;U!==5&&U!==26&&U!==27||ue===null||(Z=ue,m?(ue=or(a,g),ue!=null&&C.unshift(Pr(a,ue,Z))):m||(ue=or(a,g),ue!=null&&C.push(Pr(a,ue,Z)))),a=a.return}C.length!==0&&e.push({event:n,listeners:C})}var vy=/\r\n?/g,wy=/\u0000|\uFFFD/g;function Wp(e){return(typeof e=="string"?e:""+e).replace(vy,`
9
- `).replace(wy,"")}function em(e,n){return n=Wp(n),Wp(e)===n}function xt(e,n,a,s,m,g){switch(a){case"children":typeof s=="string"?n==="body"||n==="textarea"&&s===""||pa(e,s):(typeof s=="number"||typeof s=="bigint")&&n!=="body"&&pa(e,""+s);break;case"className":wl(e,"class",s);break;case"tabIndex":wl(e,"tabindex",s);break;case"dir":case"role":case"viewBox":case"width":case"height":wl(e,a,s);break;case"style":Wd(e,s,g);break;case"data":if(n!=="object"){wl(e,"data",s);break}case"src":case"href":if(s===""&&(n!=="a"||a!=="href")){e.removeAttribute(a);break}if(s==null||typeof s=="function"||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(a);break}s=kl(""+s),e.setAttribute(a,s);break;case"action":case"formAction":if(typeof s=="function"){e.setAttribute(a,"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 g=="function"&&(a==="formAction"?(n!=="input"&&xt(e,n,"name",m.name,m,null),xt(e,n,"formEncType",m.formEncType,m,null),xt(e,n,"formMethod",m.formMethod,m,null),xt(e,n,"formTarget",m.formTarget,m,null)):(xt(e,n,"encType",m.encType,m,null),xt(e,n,"method",m.method,m,null),xt(e,n,"target",m.target,m,null)));if(s==null||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(a);break}s=kl(""+s),e.setAttribute(a,s);break;case"onClick":s!=null&&(e.onclick=Kn);break;case"onScroll":s!=null&&et("scroll",e);break;case"onScrollEnd":s!=null&&et("scrollend",e);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(l(61));if(a=s.__html,a!=null){if(m.children!=null)throw Error(l(60));e.innerHTML=a}}break;case"multiple":e.multiple=s&&typeof s!="function"&&typeof s!="symbol";break;case"muted":e.muted=s&&typeof s!="function"&&typeof s!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(s==null||typeof s=="function"||typeof s=="boolean"||typeof s=="symbol"){e.removeAttribute("xlink:href");break}a=kl(""+s),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(a,""+s):e.removeAttribute(a);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":s&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(a,""):e.removeAttribute(a);break;case"capture":case"download":s===!0?e.setAttribute(a,""):s!==!1&&s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(a,s):e.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":s!=null&&typeof s!="function"&&typeof s!="symbol"&&!isNaN(s)&&1<=s?e.setAttribute(a,s):e.removeAttribute(a);break;case"rowSpan":case"start":s==null||typeof s=="function"||typeof s=="symbol"||isNaN(s)?e.removeAttribute(a):e.setAttribute(a,s);break;case"popover":et("beforetoggle",e),et("toggle",e),vl(e,"popover",s);break;case"xlinkActuate":Gn(e,"http://www.w3.org/1999/xlink","xlink:actuate",s);break;case"xlinkArcrole":Gn(e,"http://www.w3.org/1999/xlink","xlink:arcrole",s);break;case"xlinkRole":Gn(e,"http://www.w3.org/1999/xlink","xlink:role",s);break;case"xlinkShow":Gn(e,"http://www.w3.org/1999/xlink","xlink:show",s);break;case"xlinkTitle":Gn(e,"http://www.w3.org/1999/xlink","xlink:title",s);break;case"xlinkType":Gn(e,"http://www.w3.org/1999/xlink","xlink:type",s);break;case"xmlBase":Gn(e,"http://www.w3.org/XML/1998/namespace","xml:base",s);break;case"xmlLang":Gn(e,"http://www.w3.org/XML/1998/namespace","xml:lang",s);break;case"xmlSpace":Gn(e,"http://www.w3.org/XML/1998/namespace","xml:space",s);break;case"is":vl(e,"is",s);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=Xb.get(a)||a,vl(e,a,s))}}function ic(e,n,a,s,m,g){switch(a){case"style":Wd(e,s,g);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(l(61));if(a=s.__html,a!=null){if(m.children!=null)throw Error(l(60));e.innerHTML=a}}break;case"children":typeof s=="string"?pa(e,s):(typeof s=="number"||typeof s=="bigint")&&pa(e,""+s);break;case"onScroll":s!=null&&et("scroll",e);break;case"onScrollEnd":s!=null&&et("scrollend",e);break;case"onClick":s!=null&&(e.onclick=Kn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Vd.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(m=a.endsWith("Capture"),n=a.slice(2,m?a.length-7:void 0),g=e[Te]||null,g=g!=null?g[a]:null,typeof g=="function"&&e.removeEventListener(n,g,m),typeof s=="function")){typeof g!="function"&&g!==null&&(a in e?e[a]=null:e.hasAttribute(a)&&e.removeAttribute(a)),e.addEventListener(n,s,m);break e}a in e?e[a]=s:s===!0?e.setAttribute(a,""):vl(e,a,s)}}}function Ft(e,n,a){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":et("error",e),et("load",e);var s=!1,m=!1,g;for(g in a)if(a.hasOwnProperty(g)){var C=a[g];if(C!=null)switch(g){case"src":s=!0;break;case"srcSet":m=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(l(137,n));default:xt(e,n,g,C,a,null)}}m&&xt(e,n,"srcSet",a.srcSet,a,null),s&&xt(e,n,"src",a.src,a,null);return;case"input":et("invalid",e);var U=g=C=m=null,Z=null,ue=null;for(s in a)if(a.hasOwnProperty(s)){var ge=a[s];if(ge!=null)switch(s){case"name":m=ge;break;case"type":C=ge;break;case"checked":Z=ge;break;case"defaultChecked":ue=ge;break;case"value":g=ge;break;case"defaultValue":U=ge;break;case"children":case"dangerouslySetInnerHTML":if(ge!=null)throw Error(l(137,n));break;default:xt(e,n,s,ge,a,null)}}Xd(e,g,U,Z,ue,C,m,!1);return;case"select":et("invalid",e),s=C=g=null;for(m in a)if(a.hasOwnProperty(m)&&(U=a[m],U!=null))switch(m){case"value":g=U;break;case"defaultValue":C=U;break;case"multiple":s=U;default:xt(e,n,m,U,a,null)}n=g,a=C,e.multiple=!!s,n!=null?ha(e,!!s,n,!1):a!=null&&ha(e,!!s,a,!0);return;case"textarea":et("invalid",e),g=m=s=null;for(C in a)if(a.hasOwnProperty(C)&&(U=a[C],U!=null))switch(C){case"value":s=U;break;case"defaultValue":m=U;break;case"children":g=U;break;case"dangerouslySetInnerHTML":if(U!=null)throw Error(l(91));break;default:xt(e,n,C,U,a,null)}Qd(e,s,m,g);return;case"option":for(Z in a)a.hasOwnProperty(Z)&&(s=a[Z],s!=null)&&(Z==="selected"?e.selected=s&&typeof s!="function"&&typeof s!="symbol":xt(e,n,Z,s,a,null));return;case"dialog":et("beforetoggle",e),et("toggle",e),et("cancel",e),et("close",e);break;case"iframe":case"object":et("load",e);break;case"video":case"audio":for(s=0;s<Hr.length;s++)et(Hr[s],e);break;case"image":et("error",e),et("load",e);break;case"details":et("toggle",e);break;case"embed":case"source":case"link":et("error",e),et("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(ue in a)if(a.hasOwnProperty(ue)&&(s=a[ue],s!=null))switch(ue){case"children":case"dangerouslySetInnerHTML":throw Error(l(137,n));default:xt(e,n,ue,s,a,null)}return;default:if(xo(n)){for(ge in a)a.hasOwnProperty(ge)&&(s=a[ge],s!==void 0&&ic(e,n,ge,s,a,void 0));return}}for(U in a)a.hasOwnProperty(U)&&(s=a[U],s!=null&&xt(e,n,U,s,a,null))}function Sy(e,n,a,s){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var m=null,g=null,C=null,U=null,Z=null,ue=null,ge=null;for(he in a){var _e=a[he];if(a.hasOwnProperty(he)&&_e!=null)switch(he){case"checked":break;case"value":break;case"defaultValue":Z=_e;default:s.hasOwnProperty(he)||xt(e,n,he,null,s,_e)}}for(var ce in s){var he=s[ce];if(_e=a[ce],s.hasOwnProperty(ce)&&(he!=null||_e!=null))switch(ce){case"type":g=he;break;case"name":m=he;break;case"checked":ue=he;break;case"defaultChecked":ge=he;break;case"value":C=he;break;case"defaultValue":U=he;break;case"children":case"dangerouslySetInnerHTML":if(he!=null)throw Error(l(137,n));break;default:he!==_e&&xt(e,n,ce,he,s,_e)}}mo(e,C,U,Z,ue,ge,g,m);return;case"select":he=C=U=ce=null;for(g in a)if(Z=a[g],a.hasOwnProperty(g)&&Z!=null)switch(g){case"value":break;case"multiple":he=Z;default:s.hasOwnProperty(g)||xt(e,n,g,null,s,Z)}for(m in s)if(g=s[m],Z=a[m],s.hasOwnProperty(m)&&(g!=null||Z!=null))switch(m){case"value":ce=g;break;case"defaultValue":U=g;break;case"multiple":C=g;default:g!==Z&&xt(e,n,m,g,s,Z)}n=U,a=C,s=he,ce!=null?ha(e,!!a,ce,!1):!!s!=!!a&&(n!=null?ha(e,!!a,n,!0):ha(e,!!a,a?[]:"",!1));return;case"textarea":he=ce=null;for(U in a)if(m=a[U],a.hasOwnProperty(U)&&m!=null&&!s.hasOwnProperty(U))switch(U){case"value":break;case"children":break;default:xt(e,n,U,null,s,m)}for(C in s)if(m=s[C],g=a[C],s.hasOwnProperty(C)&&(m!=null||g!=null))switch(C){case"value":ce=m;break;case"defaultValue":he=m;break;case"children":break;case"dangerouslySetInnerHTML":if(m!=null)throw Error(l(91));break;default:m!==g&&xt(e,n,C,m,s,g)}Zd(e,ce,he);return;case"option":for(var Ue in a)ce=a[Ue],a.hasOwnProperty(Ue)&&ce!=null&&!s.hasOwnProperty(Ue)&&(Ue==="selected"?e.selected=!1:xt(e,n,Ue,null,s,ce));for(Z in s)ce=s[Z],he=a[Z],s.hasOwnProperty(Z)&&ce!==he&&(ce!=null||he!=null)&&(Z==="selected"?e.selected=ce&&typeof ce!="function"&&typeof ce!="symbol":xt(e,n,Z,ce,s,he));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 Ye in a)ce=a[Ye],a.hasOwnProperty(Ye)&&ce!=null&&!s.hasOwnProperty(Ye)&&xt(e,n,Ye,null,s,ce);for(ue in s)if(ce=s[ue],he=a[ue],s.hasOwnProperty(ue)&&ce!==he&&(ce!=null||he!=null))switch(ue){case"children":case"dangerouslySetInnerHTML":if(ce!=null)throw Error(l(137,n));break;default:xt(e,n,ue,ce,s,he)}return;default:if(xo(n)){for(var bt in a)ce=a[bt],a.hasOwnProperty(bt)&&ce!==void 0&&!s.hasOwnProperty(bt)&&ic(e,n,bt,void 0,s,ce);for(ge in s)ce=s[ge],he=a[ge],!s.hasOwnProperty(ge)||ce===he||ce===void 0&&he===void 0||ic(e,n,ge,ce,s,he);return}}for(var le in a)ce=a[le],a.hasOwnProperty(le)&&ce!=null&&!s.hasOwnProperty(le)&&xt(e,n,le,null,s,ce);for(_e in s)ce=s[_e],he=a[_e],!s.hasOwnProperty(_e)||ce===he||ce==null&&he==null||xt(e,n,_e,ce,s,he)}function tm(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function ky(){if(typeof performance.getEntriesByType=="function"){for(var e=0,n=0,a=performance.getEntriesByType("resource"),s=0;s<a.length;s++){var m=a[s],g=m.transferSize,C=m.initiatorType,U=m.duration;if(g&&U&&tm(C)){for(C=0,U=m.responseEnd,s+=1;s<a.length;s++){var Z=a[s],ue=Z.startTime;if(ue>U)break;var ge=Z.transferSize,_e=Z.initiatorType;ge&&tm(_e)&&(Z=Z.responseEnd,C+=ge*(Z<U?1:(U-ue)/(Z-ue)))}if(--s,n+=8*(g+C)/(m.duration/1e3),e++,10<e)break}}if(0<e)return n/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var ac=null,rc=null;function bs(e){return e.nodeType===9?e:e.ownerDocument}function nm(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function im(e,n){if(e===0)switch(n){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&n==="foreignObject"?0:e}function lc(e,n){return e==="textarea"||e==="noscript"||typeof n.children=="string"||typeof n.children=="number"||typeof n.children=="bigint"||typeof n.dangerouslySetInnerHTML=="object"&&n.dangerouslySetInnerHTML!==null&&n.dangerouslySetInnerHTML.__html!=null}var sc=null;function jy(){var e=window.event;return e&&e.type==="popstate"?e===sc?!1:(sc=e,!0):(sc=null,!1)}var am=typeof setTimeout=="function"?setTimeout:void 0,_y=typeof clearTimeout=="function"?clearTimeout:void 0,rm=typeof Promise=="function"?Promise:void 0,Cy=typeof queueMicrotask=="function"?queueMicrotask:typeof rm<"u"?function(e){return rm.resolve(null).then(e).catch(Ny)}:am;function Ny(e){setTimeout(function(){throw e})}function Ti(e){return e==="head"}function lm(e,n){var a=n,s=0;do{var m=a.nextSibling;if(e.removeChild(a),m&&m.nodeType===8)if(a=m.data,a==="/$"||a==="/&"){if(s===0){e.removeChild(m),Ya(n);return}s--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")s++;else if(a==="html")Fr(e.ownerDocument.documentElement);else if(a==="head"){a=e.ownerDocument.head,Fr(a);for(var g=a.firstChild;g;){var C=g.nextSibling,U=g.nodeName;g[lr]||U==="SCRIPT"||U==="STYLE"||U==="LINK"&&g.rel.toLowerCase()==="stylesheet"||a.removeChild(g),g=C}}else a==="body"&&Fr(e.ownerDocument.body);a=m}while(a);Ya(n)}function sm(e,n){var a=e;e=0;do{var s=a.nextSibling;if(a.nodeType===1?n?(a._stashedDisplay=a.style.display,a.style.display="none"):(a.style.display=a._stashedDisplay||"",a.getAttribute("style")===""&&a.removeAttribute("style")):a.nodeType===3&&(n?(a._stashedText=a.nodeValue,a.nodeValue=""):a.nodeValue=a._stashedText||""),s&&s.nodeType===8)if(a=s.data,a==="/$"){if(e===0)break;e--}else a!=="$"&&a!=="$?"&&a!=="$~"&&a!=="$!"||e++;a=s}while(a)}function oc(e){var n=e.firstChild;for(n&&n.nodeType===10&&(n=n.nextSibling);n;){var a=n;switch(n=n.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":oc(a),ho(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}e.removeChild(a)}}function Ey(e,n,a,s){for(;e.nodeType===1;){var m=a;if(e.nodeName.toLowerCase()!==n.toLowerCase()){if(!s&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(s){if(!e[lr])switch(n){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(g=e.getAttribute("rel"),g==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(g!==m.rel||e.getAttribute("href")!==(m.href==null||m.href===""?null:m.href)||e.getAttribute("crossorigin")!==(m.crossOrigin==null?null:m.crossOrigin)||e.getAttribute("title")!==(m.title==null?null:m.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(g=e.getAttribute("src"),(g!==(m.src==null?null:m.src)||e.getAttribute("type")!==(m.type==null?null:m.type)||e.getAttribute("crossorigin")!==(m.crossOrigin==null?null:m.crossOrigin))&&g&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(n==="input"&&e.type==="hidden"){var g=m.name==null?null:""+m.name;if(m.type==="hidden"&&e.getAttribute("name")===g)return e}else return e;if(e=kn(e.nextSibling),e===null)break}return null}function Ay(e,n,a){if(n==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!a||(e=kn(e.nextSibling),e===null))return null;return e}function om(e,n){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=kn(e.nextSibling),e===null))return null;return e}function uc(e){return e.data==="$?"||e.data==="$~"}function cc(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function zy(e,n){var a=e.ownerDocument;if(e.data==="$~")e._reactRetry=n;else if(e.data!=="$?"||a.readyState!=="loading")n();else{var s=function(){n(),a.removeEventListener("DOMContentLoaded",s)};a.addEventListener("DOMContentLoaded",s),e._reactRetry=s}}function kn(e){for(;e!=null;e=e.nextSibling){var n=e.nodeType;if(n===1||n===3)break;if(n===8){if(n=e.data,n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"||n==="F!"||n==="F")break;if(n==="/$"||n==="/&")return null}}return e}var dc=null;function um(e){e=e.nextSibling;for(var n=0;e;){if(e.nodeType===8){var a=e.data;if(a==="/$"||a==="/&"){if(n===0)return kn(e.nextSibling);n--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||n++}e=e.nextSibling}return null}function cm(e){e=e.previousSibling;for(var n=0;e;){if(e.nodeType===8){var a=e.data;if(a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"){if(n===0)return e;n--}else a!=="/$"&&a!=="/&"||n++}e=e.previousSibling}return null}function dm(e,n,a){switch(n=bs(a),e){case"html":if(e=n.documentElement,!e)throw Error(l(452));return e;case"head":if(e=n.head,!e)throw Error(l(453));return e;case"body":if(e=n.body,!e)throw Error(l(454));return e;default:throw Error(l(451))}}function Fr(e){for(var n=e.attributes;n.length;)e.removeAttributeNode(n[0]);ho(e)}var jn=new Map,fm=new Set;function ys(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var ui=J.d;J.d={f:Ty,r:Ry,D:Oy,C:Dy,L:My,m:Ly,X:Uy,S:By,M:Iy};function Ty(){var e=ui.f(),n=cs();return e||n}function Ry(e){var n=ca(e);n!==null&&n.tag===5&&n.type==="form"?Ah(n):ui.r(e)}var Fa=typeof document>"u"?null:document;function hm(e,n,a){var s=Fa;if(s&&typeof n=="string"&&n){var m=gn(n);m='link[rel="'+e+'"][href="'+m+'"]',typeof a=="string"&&(m+='[crossorigin="'+a+'"]'),fm.has(m)||(fm.add(m),e={rel:e,crossOrigin:a,href:n},s.querySelector(m)===null&&(n=s.createElement("link"),Ft(n,"link",e),Bt(n),s.head.appendChild(n)))}}function Oy(e){ui.D(e),hm("dns-prefetch",e,null)}function Dy(e,n){ui.C(e,n),hm("preconnect",e,n)}function My(e,n,a){ui.L(e,n,a);var s=Fa;if(s&&e&&n){var m='link[rel="preload"][as="'+gn(n)+'"]';n==="image"&&a&&a.imageSrcSet?(m+='[imagesrcset="'+gn(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(m+='[imagesizes="'+gn(a.imageSizes)+'"]')):m+='[href="'+gn(e)+'"]';var g=m;switch(n){case"style":g=qa(e);break;case"script":g=Va(e)}jn.has(g)||(e=x({rel:"preload",href:n==="image"&&a&&a.imageSrcSet?void 0:e,as:n},a),jn.set(g,e),s.querySelector(m)!==null||n==="style"&&s.querySelector(qr(g))||n==="script"&&s.querySelector(Vr(g))||(n=s.createElement("link"),Ft(n,"link",e),Bt(n),s.head.appendChild(n)))}}function Ly(e,n){ui.m(e,n);var a=Fa;if(a&&e){var s=n&&typeof n.as=="string"?n.as:"script",m='link[rel="modulepreload"][as="'+gn(s)+'"][href="'+gn(e)+'"]',g=m;switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":g=Va(e)}if(!jn.has(g)&&(e=x({rel:"modulepreload",href:e},n),jn.set(g,e),a.querySelector(m)===null)){switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(Vr(g)))return}s=a.createElement("link"),Ft(s,"link",e),Bt(s),a.head.appendChild(s)}}}function By(e,n,a){ui.S(e,n,a);var s=Fa;if(s&&e){var m=da(s).hoistableStyles,g=qa(e);n=n||"default";var C=m.get(g);if(!C){var U={loading:0,preload:null};if(C=s.querySelector(qr(g)))U.loading=5;else{e=x({rel:"stylesheet",href:e,"data-precedence":n},a),(a=jn.get(g))&&fc(e,a);var Z=C=s.createElement("link");Bt(Z),Ft(Z,"link",e),Z._p=new Promise(function(ue,ge){Z.onload=ue,Z.onerror=ge}),Z.addEventListener("load",function(){U.loading|=1}),Z.addEventListener("error",function(){U.loading|=2}),U.loading|=4,vs(C,n,s)}C={type:"stylesheet",instance:C,count:1,state:U},m.set(g,C)}}}function Uy(e,n){ui.X(e,n);var a=Fa;if(a&&e){var s=da(a).hoistableScripts,m=Va(e),g=s.get(m);g||(g=a.querySelector(Vr(m)),g||(e=x({src:e,async:!0},n),(n=jn.get(m))&&hc(e,n),g=a.createElement("script"),Bt(g),Ft(g,"link",e),a.head.appendChild(g)),g={type:"script",instance:g,count:1,state:null},s.set(m,g))}}function Iy(e,n){ui.M(e,n);var a=Fa;if(a&&e){var s=da(a).hoistableScripts,m=Va(e),g=s.get(m);g||(g=a.querySelector(Vr(m)),g||(e=x({src:e,async:!0,type:"module"},n),(n=jn.get(m))&&hc(e,n),g=a.createElement("script"),Bt(g),Ft(g,"link",e),a.head.appendChild(g)),g={type:"script",instance:g,count:1,state:null},s.set(m,g))}}function pm(e,n,a,s){var m=(m=se.current)?ys(m):null;if(!m)throw Error(l(446));switch(e){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(n=qa(a.href),a=da(m).hoistableStyles,s=a.get(n),s||(s={type:"style",instance:null,count:0,state:null},a.set(n,s)),s):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){e=qa(a.href);var g=da(m).hoistableStyles,C=g.get(e);if(C||(m=m.ownerDocument||m,C={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},g.set(e,C),(g=m.querySelector(qr(e)))&&!g._p&&(C.instance=g,C.state.loading=5),jn.has(e)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},jn.set(e,a),g||Hy(m,e,a,C.state))),n&&s===null)throw Error(l(528,""));return C}if(n&&s!==null)throw Error(l(529,""));return null;case"script":return n=a.async,a=a.src,typeof a=="string"&&n&&typeof n!="function"&&typeof n!="symbol"?(n=Va(a),a=da(m).hoistableScripts,s=a.get(n),s||(s={type:"script",instance:null,count:0,state:null},a.set(n,s)),s):{type:"void",instance:null,count:0,state:null};default:throw Error(l(444,e))}}function qa(e){return'href="'+gn(e)+'"'}function qr(e){return'link[rel="stylesheet"]['+e+"]"}function mm(e){return x({},e,{"data-precedence":e.precedence,precedence:null})}function Hy(e,n,a,s){e.querySelector('link[rel="preload"][as="style"]['+n+"]")?s.loading=1:(n=e.createElement("link"),s.preload=n,n.addEventListener("load",function(){return s.loading|=1}),n.addEventListener("error",function(){return s.loading|=2}),Ft(n,"link",a),Bt(n),e.head.appendChild(n))}function Va(e){return'[src="'+gn(e)+'"]'}function Vr(e){return"script[async]"+e}function gm(e,n,a){if(n.count++,n.instance===null)switch(n.type){case"style":var s=e.querySelector('style[data-href~="'+gn(a.href)+'"]');if(s)return n.instance=s,Bt(s),s;var m=x({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return s=(e.ownerDocument||e).createElement("style"),Bt(s),Ft(s,"style",m),vs(s,a.precedence,e),n.instance=s;case"stylesheet":m=qa(a.href);var g=e.querySelector(qr(m));if(g)return n.state.loading|=4,n.instance=g,Bt(g),g;s=mm(a),(m=jn.get(m))&&fc(s,m),g=(e.ownerDocument||e).createElement("link"),Bt(g);var C=g;return C._p=new Promise(function(U,Z){C.onload=U,C.onerror=Z}),Ft(g,"link",s),n.state.loading|=4,vs(g,a.precedence,e),n.instance=g;case"script":return g=Va(a.src),(m=e.querySelector(Vr(g)))?(n.instance=m,Bt(m),m):(s=a,(m=jn.get(g))&&(s=x({},a),hc(s,m)),e=e.ownerDocument||e,m=e.createElement("script"),Bt(m),Ft(m,"link",s),e.head.appendChild(m),n.instance=m);case"void":return null;default:throw Error(l(443,n.type))}else n.type==="stylesheet"&&(n.state.loading&4)===0&&(s=n.instance,n.state.loading|=4,vs(s,a.precedence,e));return n.instance}function vs(e,n,a){for(var s=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),m=s.length?s[s.length-1]:null,g=m,C=0;C<s.length;C++){var U=s[C];if(U.dataset.precedence===n)g=U;else if(g!==m)break}g?g.parentNode.insertBefore(e,g.nextSibling):(n=a.nodeType===9?a.head:a,n.insertBefore(e,n.firstChild))}function fc(e,n){e.crossOrigin==null&&(e.crossOrigin=n.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=n.referrerPolicy),e.title==null&&(e.title=n.title)}function hc(e,n){e.crossOrigin==null&&(e.crossOrigin=n.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=n.referrerPolicy),e.integrity==null&&(e.integrity=n.integrity)}var ws=null;function xm(e,n,a){if(ws===null){var s=new Map,m=ws=new Map;m.set(a,s)}else m=ws,s=m.get(a),s||(s=new Map,m.set(a,s));if(s.has(e))return s;for(s.set(e,null),a=a.getElementsByTagName(e),m=0;m<a.length;m++){var g=a[m];if(!(g[lr]||g[Ne]||e==="link"&&g.getAttribute("rel")==="stylesheet")&&g.namespaceURI!=="http://www.w3.org/2000/svg"){var C=g.getAttribute(n)||"";C=e+C;var U=s.get(C);U?U.push(g):s.set(C,[g])}}return s}function bm(e,n,a){e=e.ownerDocument||e,e.head.insertBefore(a,n==="title"?e.querySelector("head > title"):null)}function Py(e,n,a){if(a===1||n.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof n.precedence!="string"||typeof n.href!="string"||n.href==="")break;return!0;case"link":if(typeof n.rel!="string"||typeof n.href!="string"||n.href===""||n.onLoad||n.onError)break;return n.rel==="stylesheet"?(e=n.disabled,typeof n.precedence=="string"&&e==null):!0;case"script":if(n.async&&typeof n.async!="function"&&typeof n.async!="symbol"&&!n.onLoad&&!n.onError&&n.src&&typeof n.src=="string")return!0}return!1}function ym(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function Fy(e,n,a,s){if(a.type==="stylesheet"&&(typeof s.media!="string"||matchMedia(s.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var m=qa(s.href),g=n.querySelector(qr(m));if(g){n=g._p,n!==null&&typeof n=="object"&&typeof n.then=="function"&&(e.count++,e=Ss.bind(e),n.then(e,e)),a.state.loading|=4,a.instance=g,Bt(g);return}g=n.ownerDocument||n,s=mm(s),(m=jn.get(m))&&fc(s,m),g=g.createElement("link"),Bt(g);var C=g;C._p=new Promise(function(U,Z){C.onload=U,C.onerror=Z}),Ft(g,"link",s),a.instance=g}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(a,n),(n=a.state.preload)&&(a.state.loading&3)===0&&(e.count++,a=Ss.bind(e),n.addEventListener("load",a),n.addEventListener("error",a))}}var pc=0;function qy(e,n){return e.stylesheets&&e.count===0&&js(e,e.stylesheets),0<e.count||0<e.imgCount?function(a){var s=setTimeout(function(){if(e.stylesheets&&js(e,e.stylesheets),e.unsuspend){var g=e.unsuspend;e.unsuspend=null,g()}},6e4+n);0<e.imgBytes&&pc===0&&(pc=62500*ky());var m=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&js(e,e.stylesheets),e.unsuspend)){var g=e.unsuspend;e.unsuspend=null,g()}},(e.imgBytes>pc?50:800)+n);return e.unsuspend=a,function(){e.unsuspend=null,clearTimeout(s),clearTimeout(m)}}:null}function Ss(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)js(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var ks=null;function js(e,n){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ks=new Map,n.forEach(Vy,e),ks=null,Ss.call(e))}function Vy(e,n){if(!(n.state.loading&4)){var a=ks.get(e);if(a)var s=a.get(null);else{a=new Map,ks.set(e,a);for(var m=e.querySelectorAll("link[data-precedence],style[data-precedence]"),g=0;g<m.length;g++){var C=m[g];(C.nodeName==="LINK"||C.getAttribute("media")!=="not all")&&(a.set(C.dataset.precedence,C),s=C)}s&&a.set(null,s)}m=n.instance,C=m.getAttribute("data-precedence"),g=a.get(C)||s,g===s&&a.set(null,m),a.set(C,m),this.count++,s=Ss.bind(this),m.addEventListener("load",s),m.addEventListener("error",s),g?g.parentNode.insertBefore(m,g.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(m,e.firstChild)),n.state.loading|=4}}var Yr={$$typeof:N,Provider:null,Consumer:null,_currentValue:ve,_currentValue2:ve,_threadCount:0};function Yy(e,n,a,s,m,g,C,U,Z){this.tag=1,this.containerInfo=e,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=ir(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ir(0),this.hiddenUpdates=ir(null),this.identifierPrefix=s,this.onUncaughtError=m,this.onCaughtError=g,this.onRecoverableError=C,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=Z,this.incompleteTransitions=new Map}function vm(e,n,a,s,m,g,C,U,Z,ue,ge,_e){return e=new Yy(e,n,a,C,Z,ue,ge,_e,U),n=1,g===!0&&(n|=24),g=ln(3,null,null,n),e.current=g,g.stateNode=e,n=Ko(),n.refCount++,e.pooledCache=n,n.refCount++,g.memoizedState={element:s,isDehydrated:a,cache:n},Qo(g),e}function wm(e){return e?(e=wa,e):wa}function Sm(e,n,a,s,m,g){m=wm(m),s.context===null?s.context=m:s.pendingContext=m,s=vi(n),s.payload={element:a},g=g===void 0?null:g,g!==null&&(s.callback=g),a=wi(e,s,n),a!==null&&(tn(a,e,n),kr(a,e,n))}function km(e,n){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var a=e.retryLane;e.retryLane=a!==0&&a<n?a:n}}function mc(e,n){km(e,n),(e=e.alternate)&&km(e,n)}function jm(e){if(e.tag===13||e.tag===31){var n=Gi(e,67108864);n!==null&&tn(n,e,67108864),mc(e,67108864)}}function _m(e){if(e.tag===13||e.tag===31){var n=dn();n=ar(n);var a=Gi(e,n);a!==null&&tn(a,e,n),mc(e,n)}}var _s=!0;function Gy(e,n,a,s){var m=$.T;$.T=null;var g=J.p;try{J.p=2,gc(e,n,a,s)}finally{J.p=g,$.T=m}}function Ky(e,n,a,s){var m=$.T;$.T=null;var g=J.p;try{J.p=8,gc(e,n,a,s)}finally{J.p=g,$.T=m}}function gc(e,n,a,s){if(_s){var m=xc(s);if(m===null)nc(e,n,s,Cs,a),Nm(e,s);else if(Xy(m,e,n,a,s))s.stopPropagation();else if(Nm(e,s),n&4&&-1<$y.indexOf(e)){for(;m!==null;){var g=ca(m);if(g!==null)switch(g.tag){case 3:if(g=g.stateNode,g.current.memoizedState.isDehydrated){var C=Xt(g.pendingLanes);if(C!==0){var U=g;for(U.pendingLanes|=2,U.entangledLanes|=2;C;){var Z=1<<31-Le(C);U.entanglements[1]|=Z,C&=~Z}Un(g),(dt&6)===0&&(os=Ee()+500,Ir(0))}}break;case 31:case 13:U=Gi(g,2),U!==null&&tn(U,g,2),cs(),mc(g,2)}if(g=xc(s),g===null&&nc(e,n,s,Cs,a),g===m)break;m=g}m!==null&&s.stopPropagation()}else nc(e,n,s,null,a)}}function xc(e){return e=yo(e),bc(e)}var Cs=null;function bc(e){if(Cs=null,e=ua(e),e!==null){var n=u(e);if(n===null)e=null;else{var a=n.tag;if(a===13){if(e=c(n),e!==null)return e;e=null}else if(a===31){if(e=f(n),e!==null)return e;e=null}else if(a===3){if(n.stateNode.current.memoizedState.isDehydrated)return n.tag===3?n.stateNode.containerInfo:null;e=null}else n!==e&&(e=null)}}return Cs=e,null}function Cm(e){switch(e){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(ke()){case ae:return 2;case ye:return 8;case Ae:case Ie:return 32;case fe:return 268435456;default:return 32}default:return 32}}var yc=!1,Ri=null,Oi=null,Di=null,Gr=new Map,Kr=new Map,Mi=[],$y="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 Nm(e,n){switch(e){case"focusin":case"focusout":Ri=null;break;case"dragenter":case"dragleave":Oi=null;break;case"mouseover":case"mouseout":Di=null;break;case"pointerover":case"pointerout":Gr.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":Kr.delete(n.pointerId)}}function $r(e,n,a,s,m,g){return e===null||e.nativeEvent!==g?(e={blockedOn:n,domEventName:a,eventSystemFlags:s,nativeEvent:g,targetContainers:[m]},n!==null&&(n=ca(n),n!==null&&jm(n)),e):(e.eventSystemFlags|=s,n=e.targetContainers,m!==null&&n.indexOf(m)===-1&&n.push(m),e)}function Xy(e,n,a,s,m){switch(n){case"focusin":return Ri=$r(Ri,e,n,a,s,m),!0;case"dragenter":return Oi=$r(Oi,e,n,a,s,m),!0;case"mouseover":return Di=$r(Di,e,n,a,s,m),!0;case"pointerover":var g=m.pointerId;return Gr.set(g,$r(Gr.get(g)||null,e,n,a,s,m)),!0;case"gotpointercapture":return g=m.pointerId,Kr.set(g,$r(Kr.get(g)||null,e,n,a,s,m)),!0}return!1}function Em(e){var n=ua(e.target);if(n!==null){var a=u(n);if(a!==null){if(n=a.tag,n===13){if(n=c(a),n!==null){e.blockedOn=n,be(e.priority,function(){_m(a)});return}}else if(n===31){if(n=f(a),n!==null){e.blockedOn=n,be(e.priority,function(){_m(a)});return}}else if(n===3&&a.stateNode.current.memoizedState.isDehydrated){e.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Ns(e){if(e.blockedOn!==null)return!1;for(var n=e.targetContainers;0<n.length;){var a=xc(e.nativeEvent);if(a===null){a=e.nativeEvent;var s=new a.constructor(a.type,a);bo=s,a.target.dispatchEvent(s),bo=null}else return n=ca(a),n!==null&&jm(n),e.blockedOn=a,!1;n.shift()}return!0}function Am(e,n,a){Ns(e)&&a.delete(n)}function Zy(){yc=!1,Ri!==null&&Ns(Ri)&&(Ri=null),Oi!==null&&Ns(Oi)&&(Oi=null),Di!==null&&Ns(Di)&&(Di=null),Gr.forEach(Am),Kr.forEach(Am)}function Es(e,n){e.blockedOn===n&&(e.blockedOn=null,yc||(yc=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Zy)))}var As=null;function zm(e){As!==e&&(As=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){As===e&&(As=null);for(var n=0;n<e.length;n+=3){var a=e[n],s=e[n+1],m=e[n+2];if(typeof s!="function"){if(bc(s||a)===null)continue;break}var g=ca(a);g!==null&&(e.splice(n,3),n-=3,xu(g,{pending:!0,data:m,method:a.method,action:s},s,m))}}))}function Ya(e){function n(Z){return Es(Z,e)}Ri!==null&&Es(Ri,e),Oi!==null&&Es(Oi,e),Di!==null&&Es(Di,e),Gr.forEach(n),Kr.forEach(n);for(var a=0;a<Mi.length;a++){var s=Mi[a];s.blockedOn===e&&(s.blockedOn=null)}for(;0<Mi.length&&(a=Mi[0],a.blockedOn===null);)Em(a),a.blockedOn===null&&Mi.shift();if(a=(e.ownerDocument||e).$$reactFormReplay,a!=null)for(s=0;s<a.length;s+=3){var m=a[s],g=a[s+1],C=m[Te]||null;if(typeof g=="function")C||zm(a);else if(C){var U=null;if(g&&g.hasAttribute("formAction")){if(m=g,C=g[Te]||null)U=C.formAction;else if(bc(m)!==null)continue}else U=C.action;typeof U=="function"?a[s+1]=U:(a.splice(s,3),s-=3),zm(a)}}}function Tm(){function e(g){g.canIntercept&&g.info==="react-transition"&&g.intercept({handler:function(){return new Promise(function(C){return m=C})},focusReset:"manual",scroll:"manual"})}function n(){m!==null&&(m(),m=null),s||setTimeout(a,20)}function a(){if(!s&&!navigation.transition){var g=navigation.currentEntry;g&&g.url!=null&&navigation.navigate(g.url,{state:g.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var s=!1,m=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",n),navigation.addEventListener("navigateerror",n),setTimeout(a,100),function(){s=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",n),navigation.removeEventListener("navigateerror",n),m!==null&&(m(),m=null)}}}function vc(e){this._internalRoot=e}zs.prototype.render=vc.prototype.render=function(e){var n=this._internalRoot;if(n===null)throw Error(l(409));var a=n.current,s=dn();Sm(a,s,e,n,null,null)},zs.prototype.unmount=vc.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var n=e.containerInfo;Sm(e.current,2,null,e,null,null),cs(),n[st]=null}};function zs(e){this._internalRoot=e}zs.prototype.unstable_scheduleHydration=function(e){if(e){var n=yl();e={blockedOn:null,target:e,priority:n};for(var a=0;a<Mi.length&&n!==0&&n<Mi[a].priority;a++);Mi.splice(a,0,e),a===0&&Em(e)}};var Rm=r.version;if(Rm!=="19.2.3")throw Error(l(527,Rm,"19.2.3"));J.findDOMNode=function(e){var n=e._reactInternals;if(n===void 0)throw typeof e.render=="function"?Error(l(188)):(e=Object.keys(e).join(","),Error(l(268,e)));return e=p(n),e=e!==null?b(e):null,e=e===null?null:e.stateNode,e};var Qy={bundleType:0,version:"19.2.3",rendererPackageName:"react-dom",currentDispatcherRef:$,reconcilerVersion:"19.2.3"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Ts=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ts.isDisabled&&Ts.supportsFiber)try{Be=Ts.inject(Qy),Ve=Ts}catch{}}return Zr.createRoot=function(e,n){if(!o(e))throw Error(l(299));var a=!1,s="",m=Ih,g=Hh,C=Ph;return n!=null&&(n.unstable_strictMode===!0&&(a=!0),n.identifierPrefix!==void 0&&(s=n.identifierPrefix),n.onUncaughtError!==void 0&&(m=n.onUncaughtError),n.onCaughtError!==void 0&&(g=n.onCaughtError),n.onRecoverableError!==void 0&&(C=n.onRecoverableError)),n=vm(e,1,!1,null,null,a,s,null,m,g,C,Tm),e[st]=n.current,tc(e),new vc(n)},Zr.hydrateRoot=function(e,n,a){if(!o(e))throw Error(l(299));var s=!1,m="",g=Ih,C=Hh,U=Ph,Z=null;return a!=null&&(a.unstable_strictMode===!0&&(s=!0),a.identifierPrefix!==void 0&&(m=a.identifierPrefix),a.onUncaughtError!==void 0&&(g=a.onUncaughtError),a.onCaughtError!==void 0&&(C=a.onCaughtError),a.onRecoverableError!==void 0&&(U=a.onRecoverableError),a.formState!==void 0&&(Z=a.formState)),n=vm(e,1,!0,n,a??null,s,m,Z,g,C,U,Tm),n.context=wm(null),a=n.current,s=dn(),s=ar(s),m=vi(s),m.callback=null,wi(a,m,s),a=s,n.current.lanes=a,Pi(n,a),Un(n),e[st]=n.current,tc(e),new zs(n)},Zr.version="19.2.3",Zr}var Fm;function lv(){if(Fm)return kc.exports;Fm=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(r){console.error(r)}}return t(),kc.exports=rv(),kc.exports}var sv=lv();const ov=dl(sv);var qm="popstate";function uv(t={}){function r(l,o){let{pathname:u,search:c,hash:f}=l.location;return ed("",{pathname:u,search:c,hash:f},o.state&&o.state.usr||null,o.state&&o.state.key||"default")}function i(l,o){return typeof o=="string"?o:ll(o)}return dv(r,i,null,t)}function _t(t,r){if(t===!1||t===null||typeof t>"u")throw new Error(r)}function Pn(t,r){if(!t){typeof console<"u"&&console.warn(r);try{throw new Error(r)}catch{}}}function cv(){return Math.random().toString(36).substring(2,10)}function Vm(t,r){return{usr:t.state,key:t.key,idx:r}}function ed(t,r,i=null,l){return{pathname:typeof t=="string"?t:t.pathname,search:"",hash:"",...typeof r=="string"?Ja(r):r,state:i,key:r&&r.key||l||cv()}}function ll({pathname:t="/",search:r="",hash:i=""}){return r&&r!=="?"&&(t+=r.charAt(0)==="?"?r:"?"+r),i&&i!=="#"&&(t+=i.charAt(0)==="#"?i:"#"+i),t}function Ja(t){let r={};if(t){let i=t.indexOf("#");i>=0&&(r.hash=t.substring(i),t=t.substring(0,i));let l=t.indexOf("?");l>=0&&(r.search=t.substring(l),t=t.substring(0,l)),t&&(r.pathname=t)}return r}function dv(t,r,i,l={}){let{window:o=document.defaultView,v5Compat:u=!1}=l,c=o.history,f="POP",h=null,p=b();p==null&&(p=0,c.replaceState({...c.state,idx:p},""));function b(){return(c.state||{idx:null}).idx}function x(){f="POP";let k=b(),S=k==null?null:k-p;p=k,h&&h({action:f,location:v.location,delta:S})}function w(k,S){f="PUSH";let _=ed(v.location,k,S);p=b()+1;let N=Vm(_,p),B=v.createHref(_);try{c.pushState(N,"",B)}catch(D){if(D instanceof DOMException&&D.name==="DataCloneError")throw D;o.location.assign(B)}u&&h&&h({action:f,location:v.location,delta:1})}function y(k,S){f="REPLACE";let _=ed(v.location,k,S);p=b();let N=Vm(_,p),B=v.createHref(_);c.replaceState(N,"",B),u&&h&&h({action:f,location:v.location,delta:0})}function j(k){return fv(k)}let v={get action(){return f},get location(){return t(o,c)},listen(k){if(h)throw new Error("A history only accepts one active listener");return o.addEventListener(qm,x),h=k,()=>{o.removeEventListener(qm,x),h=null}},createHref(k){return r(o,k)},createURL:j,encodeLocation(k){let S=j(k);return{pathname:S.pathname,search:S.search,hash:S.hash}},push:w,replace:y,go(k){return c.go(k)}};return v}function fv(t,r=!1){let i="http://localhost";typeof window<"u"&&(i=window.location.origin!=="null"?window.location.origin:window.location.href),_t(i,"No window.location.(origin|href) available to create URL");let l=typeof t=="string"?t:ll(t);return l=l.replace(/ $/,"%20"),!r&&l.startsWith("//")&&(l=i+l),new URL(l,i)}function ax(t,r,i="/"){return hv(t,r,i,!1)}function hv(t,r,i,l){let o=typeof r=="string"?Ja(r):r,u=di(o.pathname||"/",i);if(u==null)return null;let c=rx(t);pv(c);let f=null;for(let h=0;f==null&&h<c.length;++h){let p=_v(u);f=kv(c[h],p,l)}return f}function rx(t,r=[],i=[],l="",o=!1){let u=(c,f,h=o,p)=>{let b={relativePath:p===void 0?c.path||"":p,caseSensitive:c.caseSensitive===!0,childrenIndex:f,route:c};if(b.relativePath.startsWith("/")){if(!b.relativePath.startsWith(l)&&h)return;_t(b.relativePath.startsWith(l),`Absolute route path "${b.relativePath}" nested under path "${l}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),b.relativePath=b.relativePath.slice(l.length)}let x=ci([l,b.relativePath]),w=i.concat(b);c.children&&c.children.length>0&&(_t(c.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${x}".`),rx(c.children,r,w,x,h)),!(c.path==null&&!c.index)&&r.push({path:x,score:wv(x,c.index),routesMeta:w})};return t.forEach((c,f)=>{if(c.path===""||!c.path?.includes("?"))u(c,f);else for(let h of lx(c.path))u(c,f,!0,h)}),r}function lx(t){let r=t.split("/");if(r.length===0)return[];let[i,...l]=r,o=i.endsWith("?"),u=i.replace(/\?$/,"");if(l.length===0)return o?[u,""]:[u];let c=lx(l.join("/")),f=[];return f.push(...c.map(h=>h===""?u:[u,h].join("/"))),o&&f.push(...c),f.map(h=>t.startsWith("/")&&h===""?"/":h)}function pv(t){t.sort((r,i)=>r.score!==i.score?i.score-r.score:Sv(r.routesMeta.map(l=>l.childrenIndex),i.routesMeta.map(l=>l.childrenIndex)))}var mv=/^:[\w-]+$/,gv=3,xv=2,bv=1,yv=10,vv=-2,Ym=t=>t==="*";function wv(t,r){let i=t.split("/"),l=i.length;return i.some(Ym)&&(l+=vv),r&&(l+=xv),i.filter(o=>!Ym(o)).reduce((o,u)=>o+(mv.test(u)?gv:u===""?bv:yv),l)}function Sv(t,r){return t.length===r.length&&t.slice(0,-1).every((l,o)=>l===r[o])?t[t.length-1]-r[r.length-1]:0}function kv(t,r,i=!1){let{routesMeta:l}=t,o={},u="/",c=[];for(let f=0;f<l.length;++f){let h=l[f],p=f===l.length-1,b=u==="/"?r:r.slice(u.length)||"/",x=Xs({path:h.relativePath,caseSensitive:h.caseSensitive,end:p},b),w=h.route;if(!x&&p&&i&&!l[l.length-1].route.index&&(x=Xs({path:h.relativePath,caseSensitive:h.caseSensitive,end:!1},b)),!x)return null;Object.assign(o,x.params),c.push({params:o,pathname:ci([u,x.pathname]),pathnameBase:Av(ci([u,x.pathnameBase])),route:w}),x.pathnameBase!=="/"&&(u=ci([u,x.pathnameBase]))}return c}function Xs(t,r){typeof t=="string"&&(t={path:t,caseSensitive:!1,end:!0});let[i,l]=jv(t.path,t.caseSensitive,t.end),o=r.match(i);if(!o)return null;let u=o[0],c=u.replace(/(.)\/+$/,"$1"),f=o.slice(1);return{params:l.reduce((p,{paramName:b,isOptional:x},w)=>{if(b==="*"){let j=f[w]||"";c=u.slice(0,u.length-j.length).replace(/(.)\/+$/,"$1")}const y=f[w];return x&&!y?p[b]=void 0:p[b]=(y||"").replace(/%2F/g,"/"),p},{}),pathname:u,pathnameBase:c,pattern:t}}function jv(t,r=!1,i=!0){Pn(t==="*"||!t.endsWith("*")||t.endsWith("/*"),`Route path "${t}" will be treated as if it were "${t.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${t.replace(/\*$/,"/*")}".`);let l=[],o="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(c,f,h)=>(l.push({paramName:f,isOptional:h!=null}),h?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return t.endsWith("*")?(l.push({paramName:"*"}),o+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):i?o+="\\/*$":t!==""&&t!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,r?void 0:"i"),l]}function _v(t){try{return t.split("/").map(r=>decodeURIComponent(r).replace(/\//g,"%2F")).join("/")}catch(r){return Pn(!1,`The URL path "${t}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${r}).`),t}}function di(t,r){if(r==="/")return t;if(!t.toLowerCase().startsWith(r.toLowerCase()))return null;let i=r.endsWith("/")?r.length-1:r.length,l=t.charAt(i);return l&&l!=="/"?null:t.slice(i)||"/"}var Cv=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function Nv(t,r="/"){let{pathname:i,search:l="",hash:o=""}=typeof t=="string"?Ja(t):t,u;return i?(i=i.replace(/\/\/+/g,"/"),i.startsWith("/")?u=Gm(i.substring(1),"/"):u=Gm(i,r)):u=r,{pathname:u,search:zv(l),hash:Tv(o)}}function Gm(t,r){let i=r.replace(/\/+$/,"").split("/");return t.split("/").forEach(o=>{o===".."?i.length>1&&i.pop():o!=="."&&i.push(o)}),i.length>1?i.join("/"):"/"}function Nc(t,r,i,l){return`Cannot include a '${t}' character in a manually specified \`to.${r}\` field [${JSON.stringify(l)}]. Please separate it out to the \`to.${i}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function Ev(t){return t.filter((r,i)=>i===0||r.route.path&&r.route.path.length>0)}function sx(t){let r=Ev(t);return r.map((i,l)=>l===r.length-1?i.pathname:i.pathnameBase)}function ox(t,r,i,l=!1){let o;typeof t=="string"?o=Ja(t):(o={...t},_t(!o.pathname||!o.pathname.includes("?"),Nc("?","pathname","search",o)),_t(!o.pathname||!o.pathname.includes("#"),Nc("#","pathname","hash",o)),_t(!o.search||!o.search.includes("#"),Nc("#","search","hash",o)));let u=t===""||o.pathname==="",c=u?"/":o.pathname,f;if(c==null)f=i;else{let x=r.length-1;if(!l&&c.startsWith("..")){let w=c.split("/");for(;w[0]==="..";)w.shift(),x-=1;o.pathname=w.join("/")}f=x>=0?r[x]:"/"}let h=Nv(o,f),p=c&&c!=="/"&&c.endsWith("/"),b=(u||c===".")&&i.endsWith("/");return!h.pathname.endsWith("/")&&(p||b)&&(h.pathname+="/"),h}var ci=t=>t.join("/").replace(/\/\/+/g,"/"),Av=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),zv=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,Tv=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t,Rv=class{constructor(t,r,i,l=!1){this.status=t,this.statusText=r||"",this.internal=l,i instanceof Error?(this.data=i.toString(),this.error=i):this.data=i}};function Ov(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}function Dv(t){return t.map(r=>r.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var ux=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function cx(t,r){let i=t;if(typeof i!="string"||!Cv.test(i))return{absoluteURL:void 0,isExternal:!1,to:i};let l=i,o=!1;if(ux)try{let u=new URL(window.location.href),c=i.startsWith("//")?new URL(u.protocol+i):new URL(i),f=di(c.pathname,r);c.origin===u.origin&&f!=null?i=f+c.search+c.hash:o=!0}catch{Pn(!1,`<Link to="${i}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:l,isExternal:o,to:i}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var dx=["POST","PUT","PATCH","DELETE"];new Set(dx);var Mv=["GET",...dx];new Set(Mv);var Wa=T.createContext(null);Wa.displayName="DataRouter";var to=T.createContext(null);to.displayName="DataRouterState";var Lv=T.createContext(!1),fx=T.createContext({isTransitioning:!1});fx.displayName="ViewTransition";var Bv=T.createContext(new Map);Bv.displayName="Fetchers";var Uv=T.createContext(null);Uv.displayName="Await";var Nn=T.createContext(null);Nn.displayName="Navigation";var fl=T.createContext(null);fl.displayName="Location";var Fn=T.createContext({outlet:null,matches:[],isDataRoute:!1});Fn.displayName="Route";var yd=T.createContext(null);yd.displayName="RouteError";var hx="REACT_ROUTER_ERROR",Iv="REDIRECT",Hv="ROUTE_ERROR_RESPONSE";function Pv(t){if(t.startsWith(`${hx}:${Iv}:{`))try{let r=JSON.parse(t.slice(28));if(typeof r=="object"&&r&&typeof r.status=="number"&&typeof r.statusText=="string"&&typeof r.location=="string"&&typeof r.reloadDocument=="boolean"&&typeof r.replace=="boolean")return r}catch{}}function Fv(t){if(t.startsWith(`${hx}:${Hv}:{`))try{let r=JSON.parse(t.slice(40));if(typeof r=="object"&&r&&typeof r.status=="number"&&typeof r.statusText=="string")return new Rv(r.status,r.statusText,r.data)}catch{}}function qv(t,{relative:r}={}){_t(hl(),"useHref() may be used only in the context of a <Router> component.");let{basename:i,navigator:l}=T.useContext(Nn),{hash:o,pathname:u,search:c}=pl(t,{relative:r}),f=u;return i!=="/"&&(f=u==="/"?i:ci([i,u])),l.createHref({pathname:f,search:c,hash:o})}function hl(){return T.useContext(fl)!=null}function Ii(){return _t(hl(),"useLocation() may be used only in the context of a <Router> component."),T.useContext(fl).location}var px="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function mx(t){T.useContext(Nn).static||T.useLayoutEffect(t)}function sa(){let{isDataRoute:t}=T.useContext(Fn);return t?nw():Vv()}function Vv(){_t(hl(),"useNavigate() may be used only in the context of a <Router> component.");let t=T.useContext(Wa),{basename:r,navigator:i}=T.useContext(Nn),{matches:l}=T.useContext(Fn),{pathname:o}=Ii(),u=JSON.stringify(sx(l)),c=T.useRef(!1);return mx(()=>{c.current=!0}),T.useCallback((h,p={})=>{if(Pn(c.current,px),!c.current)return;if(typeof h=="number"){i.go(h);return}let b=ox(h,JSON.parse(u),o,p.relative==="path");t==null&&r!=="/"&&(b.pathname=b.pathname==="/"?r:ci([r,b.pathname])),(p.replace?i.replace:i.push)(b,p.state,p)},[r,i,u,o,t])}T.createContext(null);function gx(){let{matches:t}=T.useContext(Fn),r=t[t.length-1];return r?r.params:{}}function pl(t,{relative:r}={}){let{matches:i}=T.useContext(Fn),{pathname:l}=Ii(),o=JSON.stringify(sx(i));return T.useMemo(()=>ox(t,JSON.parse(o),l,r==="path"),[t,o,l,r])}function Yv(t,r){return xx(t,r)}function xx(t,r,i,l,o){_t(hl(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:u}=T.useContext(Nn),{matches:c}=T.useContext(Fn),f=c[c.length-1],h=f?f.params:{},p=f?f.pathname:"/",b=f?f.pathnameBase:"/",x=f&&f.route;{let _=x&&x.path||"";yx(p,!x||_.endsWith("*")||_.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${p}" (under <Route path="${_}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
10
-
11
- Please change the parent <Route path="${_}"> to <Route path="${_==="/"?"*":`${_}/*`}">.`)}let w=Ii(),y;if(r){let _=typeof r=="string"?Ja(r):r;_t(b==="/"||_.pathname?.startsWith(b),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${b}" but pathname "${_.pathname}" was given in the \`location\` prop.`),y=_}else y=w;let j=y.pathname||"/",v=j;if(b!=="/"){let _=b.replace(/^\//,"").split("/");v="/"+j.replace(/^\//,"").split("/").slice(_.length).join("/")}let k=ax(t,{pathname:v});Pn(x||k!=null,`No routes matched location "${y.pathname}${y.search}${y.hash}" `),Pn(k==null||k[k.length-1].route.element!==void 0||k[k.length-1].route.Component!==void 0||k[k.length-1].route.lazy!==void 0,`Matched leaf route at location "${y.pathname}${y.search}${y.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let S=Zv(k&&k.map(_=>Object.assign({},_,{params:Object.assign({},h,_.params),pathname:ci([b,u.encodeLocation?u.encodeLocation(_.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:_.pathname]),pathnameBase:_.pathnameBase==="/"?b:ci([b,u.encodeLocation?u.encodeLocation(_.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:_.pathnameBase])})),c,i,l,o);return r&&S?T.createElement(fl.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...y},navigationType:"POP"}},S):S}function Gv(){let t=tw(),r=Ov(t)?`${t.status} ${t.statusText}`:t instanceof Error?t.message:JSON.stringify(t),i=t instanceof Error?t.stack:null,l="rgba(200,200,200, 0.5)",o={padding:"0.5rem",backgroundColor:l},u={padding:"2px 4px",backgroundColor:l},c=null;return console.error("Error handled by React Router default ErrorBoundary:",t),c=T.createElement(T.Fragment,null,T.createElement("p",null,"💿 Hey developer 👋"),T.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",T.createElement("code",{style:u},"ErrorBoundary")," or"," ",T.createElement("code",{style:u},"errorElement")," prop on your route.")),T.createElement(T.Fragment,null,T.createElement("h2",null,"Unexpected Application Error!"),T.createElement("h3",{style:{fontStyle:"italic"}},r),i?T.createElement("pre",{style:o},i):null,c)}var Kv=T.createElement(Gv,null),bx=class extends T.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,r){return r.location!==t.location||r.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:r.error,location:r.location,revalidation:t.revalidation||r.revalidation}}componentDidCatch(t,r){this.props.onError?this.props.onError(t,r):console.error("React Router caught the following error during render",t)}render(){let t=this.state.error;if(this.context&&typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){const i=Fv(t.digest);i&&(t=i)}let r=t!==void 0?T.createElement(Fn.Provider,{value:this.props.routeContext},T.createElement(yd.Provider,{value:t,children:this.props.component})):this.props.children;return this.context?T.createElement($v,{error:t},r):r}};bx.contextType=Lv;var Ec=new WeakMap;function $v({children:t,error:r}){let{basename:i}=T.useContext(Nn);if(typeof r=="object"&&r&&"digest"in r&&typeof r.digest=="string"){let l=Pv(r.digest);if(l){let o=Ec.get(r);if(o)throw o;let u=cx(l.location,i);if(ux&&!Ec.get(r))if(u.isExternal||l.reloadDocument)window.location.href=u.absoluteURL||u.to;else{const c=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(u.to,{replace:l.replace}));throw Ec.set(r,c),c}return T.createElement("meta",{httpEquiv:"refresh",content:`0;url=${u.absoluteURL||u.to}`})}}return t}function Xv({routeContext:t,match:r,children:i}){let l=T.useContext(Wa);return l&&l.static&&l.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(l.staticContext._deepestRenderedBoundaryId=r.route.id),T.createElement(Fn.Provider,{value:t},i)}function Zv(t,r=[],i=null,l=null,o=null){if(t==null){if(!i)return null;if(i.errors)t=i.matches;else if(r.length===0&&!i.initialized&&i.matches.length>0)t=i.matches;else return null}let u=t,c=i?.errors;if(c!=null){let b=u.findIndex(x=>x.route.id&&c?.[x.route.id]!==void 0);_t(b>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(c).join(",")}`),u=u.slice(0,Math.min(u.length,b+1))}let f=!1,h=-1;if(i)for(let b=0;b<u.length;b++){let x=u[b];if((x.route.HydrateFallback||x.route.hydrateFallbackElement)&&(h=b),x.route.id){let{loaderData:w,errors:y}=i,j=x.route.loader&&!w.hasOwnProperty(x.route.id)&&(!y||y[x.route.id]===void 0);if(x.route.lazy||j){f=!0,h>=0?u=u.slice(0,h+1):u=[u[0]];break}}}let p=i&&l?(b,x)=>{l(b,{location:i.location,params:i.matches?.[0]?.params??{},unstable_pattern:Dv(i.matches),errorInfo:x})}:void 0;return u.reduceRight((b,x,w)=>{let y,j=!1,v=null,k=null;i&&(y=c&&x.route.id?c[x.route.id]:void 0,v=x.route.errorElement||Kv,f&&(h<0&&w===0?(yx("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),j=!0,k=null):h===w&&(j=!0,k=x.route.hydrateFallbackElement||null)));let S=r.concat(u.slice(0,w+1)),_=()=>{let N;return y?N=v:j?N=k:x.route.Component?N=T.createElement(x.route.Component,null):x.route.element?N=x.route.element:N=b,T.createElement(Xv,{match:x,routeContext:{outlet:b,matches:S,isDataRoute:i!=null},children:N})};return i&&(x.route.ErrorBoundary||x.route.errorElement||w===0)?T.createElement(bx,{location:i.location,revalidation:i.revalidation,component:v,error:y,children:_(),routeContext:{outlet:null,matches:S,isDataRoute:!0},onError:p}):_()},null)}function vd(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Qv(t){let r=T.useContext(Wa);return _t(r,vd(t)),r}function Jv(t){let r=T.useContext(to);return _t(r,vd(t)),r}function Wv(t){let r=T.useContext(Fn);return _t(r,vd(t)),r}function wd(t){let r=Wv(t),i=r.matches[r.matches.length-1];return _t(i.route.id,`${t} can only be used on routes that contain a unique "id"`),i.route.id}function ew(){return wd("useRouteId")}function tw(){let t=T.useContext(yd),r=Jv("useRouteError"),i=wd("useRouteError");return t!==void 0?t:r.errors?.[i]}function nw(){let{router:t}=Qv("useNavigate"),r=wd("useNavigate"),i=T.useRef(!1);return mx(()=>{i.current=!0}),T.useCallback(async(o,u={})=>{Pn(i.current,px),i.current&&(typeof o=="number"?await t.navigate(o):await t.navigate(o,{fromRouteId:r,...u}))},[t,r])}var Km={};function yx(t,r,i){!r&&!Km[t]&&(Km[t]=!0,Pn(!1,i))}T.memo(iw);function iw({routes:t,future:r,state:i,onError:l}){return xx(t,void 0,i,l,r)}function In(t){_t(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function aw({basename:t="/",children:r=null,location:i,navigationType:l="POP",navigator:o,static:u=!1,unstable_useTransitions:c}){_t(!hl(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let f=t.replace(/^\/*/,"/"),h=T.useMemo(()=>({basename:f,navigator:o,static:u,unstable_useTransitions:c,future:{}}),[f,o,u,c]);typeof i=="string"&&(i=Ja(i));let{pathname:p="/",search:b="",hash:x="",state:w=null,key:y="default"}=i,j=T.useMemo(()=>{let v=di(p,f);return v==null?null:{location:{pathname:v,search:b,hash:x,state:w,key:y},navigationType:l}},[f,p,b,x,w,y,l]);return Pn(j!=null,`<Router basename="${f}"> is not able to match the URL "${p}${b}${x}" because it does not start with the basename, so the <Router> won't render anything.`),j==null?null:T.createElement(Nn.Provider,{value:h},T.createElement(fl.Provider,{children:r,value:j}))}function rw({children:t,location:r}){return Yv(td(t),r)}function td(t,r=[]){let i=[];return T.Children.forEach(t,(l,o)=>{if(!T.isValidElement(l))return;let u=[...r,o];if(l.type===T.Fragment){i.push.apply(i,td(l.props.children,u));return}_t(l.type===In,`[${typeof l.type=="string"?l.type:l.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),_t(!l.props.index||!l.props.children,"An index route cannot have child routes.");let c={id:l.props.id||u.join("-"),caseSensitive:l.props.caseSensitive,element:l.props.element,Component:l.props.Component,index:l.props.index,path:l.props.path,middleware:l.props.middleware,loader:l.props.loader,action:l.props.action,hydrateFallbackElement:l.props.hydrateFallbackElement,HydrateFallback:l.props.HydrateFallback,errorElement:l.props.errorElement,ErrorBoundary:l.props.ErrorBoundary,hasErrorBoundary:l.props.hasErrorBoundary===!0||l.props.ErrorBoundary!=null||l.props.errorElement!=null,shouldRevalidate:l.props.shouldRevalidate,handle:l.props.handle,lazy:l.props.lazy};l.props.children&&(c.children=td(l.props.children,u)),i.push(c)}),i}var Gs="get",Ks="application/x-www-form-urlencoded";function no(t){return typeof HTMLElement<"u"&&t instanceof HTMLElement}function lw(t){return no(t)&&t.tagName.toLowerCase()==="button"}function sw(t){return no(t)&&t.tagName.toLowerCase()==="form"}function ow(t){return no(t)&&t.tagName.toLowerCase()==="input"}function uw(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function cw(t,r){return t.button===0&&(!r||r==="_self")&&!uw(t)}var Os=null;function dw(){if(Os===null)try{new FormData(document.createElement("form"),0),Os=!1}catch{Os=!0}return Os}var fw=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Ac(t){return t!=null&&!fw.has(t)?(Pn(!1,`"${t}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Ks}"`),null):t}function hw(t,r){let i,l,o,u,c;if(sw(t)){let f=t.getAttribute("action");l=f?di(f,r):null,i=t.getAttribute("method")||Gs,o=Ac(t.getAttribute("enctype"))||Ks,u=new FormData(t)}else if(lw(t)||ow(t)&&(t.type==="submit"||t.type==="image")){let f=t.form;if(f==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let h=t.getAttribute("formaction")||f.getAttribute("action");if(l=h?di(h,r):null,i=t.getAttribute("formmethod")||f.getAttribute("method")||Gs,o=Ac(t.getAttribute("formenctype"))||Ac(f.getAttribute("enctype"))||Ks,u=new FormData(f,t),!dw()){let{name:p,type:b,value:x}=t;if(b==="image"){let w=p?`${p}.`:"";u.append(`${w}x`,"0"),u.append(`${w}y`,"0")}else p&&u.append(p,x)}}else{if(no(t))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');i=Gs,l=null,o=Ks,c=t}return u&&o==="text/plain"&&(c=u,u=void 0),{action:l,method:i.toLowerCase(),encType:o,formData:u,body:c}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Sd(t,r){if(t===!1||t===null||typeof t>"u")throw new Error(r)}function pw(t,r,i,l){let o=typeof t=="string"?new URL(t,typeof window>"u"?"server://singlefetch/":window.location.origin):t;return i?o.pathname.endsWith("/")?o.pathname=`${o.pathname}_.${l}`:o.pathname=`${o.pathname}.${l}`:o.pathname==="/"?o.pathname=`_root.${l}`:r&&di(o.pathname,r)==="/"?o.pathname=`${r.replace(/\/$/,"")}/_root.${l}`:o.pathname=`${o.pathname.replace(/\/$/,"")}.${l}`,o}async function mw(t,r){if(t.id in r)return r[t.id];try{let i=await import(t.module);return r[t.id]=i,i}catch(i){return console.error(`Error loading route module \`${t.module}\`, reloading page...`),console.error(i),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function gw(t){return t==null?!1:t.href==null?t.rel==="preload"&&typeof t.imageSrcSet=="string"&&typeof t.imageSizes=="string":typeof t.rel=="string"&&typeof t.href=="string"}async function xw(t,r,i){let l=await Promise.all(t.map(async o=>{let u=r.routes[o.route.id];if(u){let c=await mw(u,i);return c.links?c.links():[]}return[]}));return ww(l.flat(1).filter(gw).filter(o=>o.rel==="stylesheet"||o.rel==="preload").map(o=>o.rel==="stylesheet"?{...o,rel:"prefetch",as:"style"}:{...o,rel:"prefetch"}))}function $m(t,r,i,l,o,u){let c=(h,p)=>i[p]?h.route.id!==i[p].route.id:!0,f=(h,p)=>i[p].pathname!==h.pathname||i[p].route.path?.endsWith("*")&&i[p].params["*"]!==h.params["*"];return u==="assets"?r.filter((h,p)=>c(h,p)||f(h,p)):u==="data"?r.filter((h,p)=>{let b=l.routes[h.route.id];if(!b||!b.hasLoader)return!1;if(c(h,p)||f(h,p))return!0;if(h.route.shouldRevalidate){let x=h.route.shouldRevalidate({currentUrl:new URL(o.pathname+o.search+o.hash,window.origin),currentParams:i[0]?.params||{},nextUrl:new URL(t,window.origin),nextParams:h.params,defaultShouldRevalidate:!0});if(typeof x=="boolean")return x}return!0}):[]}function bw(t,r,{includeHydrateFallback:i}={}){return yw(t.map(l=>{let o=r.routes[l.route.id];if(!o)return[];let u=[o.module];return o.clientActionModule&&(u=u.concat(o.clientActionModule)),o.clientLoaderModule&&(u=u.concat(o.clientLoaderModule)),i&&o.hydrateFallbackModule&&(u=u.concat(o.hydrateFallbackModule)),o.imports&&(u=u.concat(o.imports)),u}).flat(1))}function yw(t){return[...new Set(t)]}function vw(t){let r={},i=Object.keys(t).sort();for(let l of i)r[l]=t[l];return r}function ww(t,r){let i=new Set;return new Set(r),t.reduce((l,o)=>{let u=JSON.stringify(vw(o));return i.has(u)||(i.add(u),l.push({key:u,link:o})),l},[])}function vx(){let t=T.useContext(Wa);return Sd(t,"You must render this element inside a <DataRouterContext.Provider> element"),t}function Sw(){let t=T.useContext(to);return Sd(t,"You must render this element inside a <DataRouterStateContext.Provider> element"),t}var kd=T.createContext(void 0);kd.displayName="FrameworkContext";function wx(){let t=T.useContext(kd);return Sd(t,"You must render this element inside a <HydratedRouter> element"),t}function kw(t,r){let i=T.useContext(kd),[l,o]=T.useState(!1),[u,c]=T.useState(!1),{onFocus:f,onBlur:h,onMouseEnter:p,onMouseLeave:b,onTouchStart:x}=r,w=T.useRef(null);T.useEffect(()=>{if(t==="render"&&c(!0),t==="viewport"){let v=S=>{S.forEach(_=>{c(_.isIntersecting)})},k=new IntersectionObserver(v,{threshold:.5});return w.current&&k.observe(w.current),()=>{k.disconnect()}}},[t]),T.useEffect(()=>{if(l){let v=setTimeout(()=>{c(!0)},100);return()=>{clearTimeout(v)}}},[l]);let y=()=>{o(!0)},j=()=>{o(!1),c(!1)};return i?t!=="intent"?[u,w,{}]:[u,w,{onFocus:Qr(f,y),onBlur:Qr(h,j),onMouseEnter:Qr(p,y),onMouseLeave:Qr(b,j),onTouchStart:Qr(x,y)}]:[!1,w,{}]}function Qr(t,r){return i=>{t&&t(i),i.defaultPrevented||r(i)}}function jw({page:t,...r}){let{router:i}=vx(),l=T.useMemo(()=>ax(i.routes,t,i.basename),[i.routes,t,i.basename]);return l?T.createElement(Cw,{page:t,matches:l,...r}):null}function _w(t){let{manifest:r,routeModules:i}=wx(),[l,o]=T.useState([]);return T.useEffect(()=>{let u=!1;return xw(t,r,i).then(c=>{u||o(c)}),()=>{u=!0}},[t,r,i]),l}function Cw({page:t,matches:r,...i}){let l=Ii(),{future:o,manifest:u,routeModules:c}=wx(),{basename:f}=vx(),{loaderData:h,matches:p}=Sw(),b=T.useMemo(()=>$m(t,r,p,u,l,"data"),[t,r,p,u,l]),x=T.useMemo(()=>$m(t,r,p,u,l,"assets"),[t,r,p,u,l]),w=T.useMemo(()=>{if(t===l.pathname+l.search+l.hash)return[];let v=new Set,k=!1;if(r.forEach(_=>{let N=u.routes[_.route.id];!N||!N.hasLoader||(!b.some(B=>B.route.id===_.route.id)&&_.route.id in h&&c[_.route.id]?.shouldRevalidate||N.hasClientLoader?k=!0:v.add(_.route.id))}),v.size===0)return[];let S=pw(t,f,o.unstable_trailingSlashAwareDataRequests,"data");return k&&v.size>0&&S.searchParams.set("_routes",r.filter(_=>v.has(_.route.id)).map(_=>_.route.id).join(",")),[S.pathname+S.search]},[f,o.unstable_trailingSlashAwareDataRequests,h,l,u,b,r,t,c]),y=T.useMemo(()=>bw(x,u),[x,u]),j=_w(x);return T.createElement(T.Fragment,null,w.map(v=>T.createElement("link",{key:v,rel:"prefetch",as:"fetch",href:v,...i})),y.map(v=>T.createElement("link",{key:v,rel:"modulepreload",href:v,...i})),j.map(({key:v,link:k})=>T.createElement("link",{key:v,nonce:i.nonce,...k,crossOrigin:k.crossOrigin??i.crossOrigin})))}function Nw(...t){return r=>{t.forEach(i=>{typeof i=="function"?i(r):i!=null&&(i.current=r)})}}var Ew=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{Ew&&(window.__reactRouterVersion="7.13.0")}catch{}function Aw({basename:t,children:r,unstable_useTransitions:i,window:l}){let o=T.useRef();o.current==null&&(o.current=uv({window:l,v5Compat:!0}));let u=o.current,[c,f]=T.useState({action:u.action,location:u.location}),h=T.useCallback(p=>{i===!1?f(p):T.startTransition(()=>f(p))},[i]);return T.useLayoutEffect(()=>u.listen(h),[u,h]),T.createElement(aw,{basename:t,children:r,location:c.location,navigationType:c.action,navigator:u,unstable_useTransitions:i})}var Sx=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,kx=T.forwardRef(function({onClick:r,discover:i="render",prefetch:l="none",relative:o,reloadDocument:u,replace:c,state:f,target:h,to:p,preventScrollReset:b,viewTransition:x,unstable_defaultShouldRevalidate:w,...y},j){let{basename:v,unstable_useTransitions:k}=T.useContext(Nn),S=typeof p=="string"&&Sx.test(p),_=cx(p,v);p=_.to;let N=qv(p,{relative:o}),[B,D,z]=kw(l,y),R=Ow(p,{replace:c,state:f,target:h,preventScrollReset:b,relative:o,viewTransition:x,unstable_defaultShouldRevalidate:w,unstable_useTransitions:k});function G(q){r&&r(q),q.defaultPrevented||R(q)}let P=T.createElement("a",{...y,...z,href:_.absoluteURL||N,onClick:_.isExternal||u?r:G,ref:Nw(j,D),target:h,"data-discover":!S&&i==="render"?"true":void 0});return B&&!S?T.createElement(T.Fragment,null,P,T.createElement(jw,{page:N})):P});kx.displayName="Link";var zw=T.forwardRef(function({"aria-current":r="page",caseSensitive:i=!1,className:l="",end:o=!1,style:u,to:c,viewTransition:f,children:h,...p},b){let x=pl(c,{relative:p.relative}),w=Ii(),y=T.useContext(to),{navigator:j,basename:v}=T.useContext(Nn),k=y!=null&&Uw(x)&&f===!0,S=j.encodeLocation?j.encodeLocation(x).pathname:x.pathname,_=w.pathname,N=y&&y.navigation&&y.navigation.location?y.navigation.location.pathname:null;i||(_=_.toLowerCase(),N=N?N.toLowerCase():null,S=S.toLowerCase()),N&&v&&(N=di(N,v)||N);const B=S!=="/"&&S.endsWith("/")?S.length-1:S.length;let D=_===S||!o&&_.startsWith(S)&&_.charAt(B)==="/",z=N!=null&&(N===S||!o&&N.startsWith(S)&&N.charAt(S.length)==="/"),R={isActive:D,isPending:z,isTransitioning:k},G=D?r:void 0,P;typeof l=="function"?P=l(R):P=[l,D?"active":null,z?"pending":null,k?"transitioning":null].filter(Boolean).join(" ");let q=typeof u=="function"?u(R):u;return T.createElement(kx,{...p,"aria-current":G,className:P,ref:b,style:q,to:c,viewTransition:f},typeof h=="function"?h(R):h)});zw.displayName="NavLink";var Tw=T.forwardRef(({discover:t="render",fetcherKey:r,navigate:i,reloadDocument:l,replace:o,state:u,method:c=Gs,action:f,onSubmit:h,relative:p,preventScrollReset:b,viewTransition:x,unstable_defaultShouldRevalidate:w,...y},j)=>{let{unstable_useTransitions:v}=T.useContext(Nn),k=Lw(),S=Bw(f,{relative:p}),_=c.toLowerCase()==="get"?"get":"post",N=typeof f=="string"&&Sx.test(f),B=D=>{if(h&&h(D),D.defaultPrevented)return;D.preventDefault();let z=D.nativeEvent.submitter,R=z?.getAttribute("formmethod")||c,G=()=>k(z||D.currentTarget,{fetcherKey:r,method:R,navigate:i,replace:o,state:u,relative:p,preventScrollReset:b,viewTransition:x,unstable_defaultShouldRevalidate:w});v&&i!==!1?T.startTransition(()=>G()):G()};return T.createElement("form",{ref:j,method:_,action:S,onSubmit:l?h:B,...y,"data-discover":!N&&t==="render"?"true":void 0})});Tw.displayName="Form";function Rw(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function jx(t){let r=T.useContext(Wa);return _t(r,Rw(t)),r}function Ow(t,{target:r,replace:i,state:l,preventScrollReset:o,relative:u,viewTransition:c,unstable_defaultShouldRevalidate:f,unstable_useTransitions:h}={}){let p=sa(),b=Ii(),x=pl(t,{relative:u});return T.useCallback(w=>{if(cw(w,r)){w.preventDefault();let y=i!==void 0?i:ll(b)===ll(x),j=()=>p(t,{replace:y,state:l,preventScrollReset:o,relative:u,viewTransition:c,unstable_defaultShouldRevalidate:f});h?T.startTransition(()=>j()):j()}},[b,p,x,i,l,r,t,o,u,c,f,h])}var Dw=0,Mw=()=>`__${String(++Dw)}__`;function Lw(){let{router:t}=jx("useSubmit"),{basename:r}=T.useContext(Nn),i=ew(),l=t.fetch,o=t.navigate;return T.useCallback(async(u,c={})=>{let{action:f,method:h,encType:p,formData:b,body:x}=hw(u,r);if(c.navigate===!1){let w=c.fetcherKey||Mw();await l(w,i,c.action||f,{unstable_defaultShouldRevalidate:c.unstable_defaultShouldRevalidate,preventScrollReset:c.preventScrollReset,formData:b,body:x,formMethod:c.method||h,formEncType:c.encType||p,flushSync:c.flushSync})}else await o(c.action||f,{unstable_defaultShouldRevalidate:c.unstable_defaultShouldRevalidate,preventScrollReset:c.preventScrollReset,formData:b,body:x,formMethod:c.method||h,formEncType:c.encType||p,replace:c.replace,state:c.state,fromRouteId:i,flushSync:c.flushSync,viewTransition:c.viewTransition})},[l,o,r,i])}function Bw(t,{relative:r}={}){let{basename:i}=T.useContext(Nn),l=T.useContext(Fn);_t(l,"useFormAction must be used inside a RouteContext");let[o]=l.matches.slice(-1),u={...pl(t||".",{relative:r})},c=Ii();if(t==null){u.search=c.search;let f=new URLSearchParams(u.search),h=f.getAll("index");if(h.some(b=>b==="")){f.delete("index"),h.filter(x=>x).forEach(x=>f.append("index",x));let b=f.toString();u.search=b?`?${b}`:""}}return(!t||t===".")&&o.route.index&&(u.search=u.search?u.search.replace(/^\?/,"?index&"):"?index"),i!=="/"&&(u.pathname=u.pathname==="/"?i:ci([i,u.pathname])),ll(u)}function Uw(t,{relative:r}={}){let i=T.useContext(fx);_t(i!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:l}=jx("useViewTransitionState"),o=pl(t,{relative:r});if(!i.isTransitioning)return!1;let u=di(i.currentLocation.pathname,l)||i.currentLocation.pathname,c=di(i.nextLocation.pathname,l)||i.nextLocation.pathname;return Xs(o.pathname,c)!=null||Xs(o.pathname,u)!=null}var _x=ix();const Ce=ft.memo(({name:t,className:r="",fill:i=!1})=>d.jsx("span",{className:`material-symbols-outlined ${r}`,style:{fontVariationSettings:i?"'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24":"'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24"},"aria-hidden":"true",children:t})),Iw=({onNavigate:t,onNewTask:r,onLogout:i,currentScreen:l})=>d.jsxs("aside",{className:"w-20 h-full border-r border-white/10 glass flex flex-col items-center py-8 shrink-0 z-50",children:[d.jsx("button",{onClick:()=>t("dashboard"),className:"mb-12 hover:opacity-80 transition-opacity focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50 rounded-lg","aria-label":"Go to Dashboard",title:"Go to Dashboard",children:d.jsx("img",{src:"/figranium_icon.svg",alt:"Figranium Logo",className:"w-10 h-10",onError:o=>{o.currentTarget.src="/figranium_icon.svg"}})}),d.jsxs("div",{className:"flex-1 flex flex-col gap-6",children:[d.jsx("button",{onClick:r,className:"w-12 h-12 rounded-2xl flex items-center justify-center text-white bg-white/5 hover:bg-white/10 transition-all focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50",title:"New Task","aria-label":"New Task",children:d.jsx(Ce,{name:"add",className:"text-2xl"})}),d.jsx("button",{onClick:()=>t("dashboard"),className:`w-12 h-12 rounded-2xl flex items-center justify-center transition-all focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50 ${l==="dashboard"?"bg-white/10 text-white":"text-gray-500 hover:bg-white/5 hover:text-white"}`,title:"Dashboard","aria-label":"Dashboard",children:d.jsx(Ce,{name:"home",className:"text-2xl"})}),d.jsx("button",{onClick:()=>t("settings"),className:`w-12 h-12 rounded-2xl flex items-center justify-center transition-all focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50 ${l==="settings"?"bg-white/10 text-white":"text-gray-500 hover:bg-white/5 hover:text-white"}`,title:"Settings","aria-label":"Settings",children:d.jsx(Ce,{name:"settings",className:"text-2xl"})}),d.jsx("button",{onClick:()=>t("executions"),className:`w-12 h-12 rounded-2xl flex items-center justify-center transition-all focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50 ${l==="executions"?"bg-white/10 text-white":"text-gray-500 hover:bg-white/5 hover:text-white"}`,title:"Executions","aria-label":"Executions",children:d.jsx(Ce,{name:"history",className:"text-2xl"})}),d.jsx("button",{onClick:()=>t("captures"),className:`w-12 h-12 rounded-2xl flex items-center justify-center transition-all focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50 ${l==="captures"?"bg-white/10 text-white":"text-gray-500 hover:bg-white/5 hover:text-white"}`,title:"Captures","aria-label":"Captures",children:d.jsx(Ce,{name:"photo_camera",className:"text-2xl"})})]}),d.jsx("button",{onClick:i,className:"w-12 h-12 rounded-2xl flex items-center justify-center text-gray-500 hover:bg-red-500/10 hover:text-red-500 transition-all focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50",title:"Logout","aria-label":"Logout",children:d.jsx(Ce,{name:"logout",className:"text-2xl"})})]}),Hw=ft.memo(Iw),Pw=({status:t,onSubmit:r,error:i,busy:l=!1})=>{const[o,u]=T.useState(""),[c,f]=T.useState(""),[h,p]=T.useState(""),[b,x]=T.useState(""),[w,y]=T.useState(!1),[j,v]=T.useState(!1),k=_=>{_.preventDefault(),r(c,h,o,b)},S=t==="setup"?l?"Creating account...":"Create Account":l?"Authenticating...":"Authenticate";return d.jsxs("div",{className:"fixed inset-0 z-[100] bg-[#020202] flex items-center justify-center",children:[d.jsx("div",{className:"absolute inset-0 opacity-[0.03] pointer-events-none",style:{backgroundImage:"radial-gradient(#fff 1px, transparent 1px)",backgroundSize:"40px 40px"}}),d.jsxs("div",{className:"w-[400px] glass-card p-10 rounded-[48px] space-y-8 relative",children:[d.jsxs("div",{className:"text-center space-y-3",children:[d.jsx("img",{src:"/figranium_logo.svg",alt:"Figranium",className:"h-24 mx-auto object-contain"}),d.jsx("p",{className:"text-[9px] font-bold text-gray-500 uppercase tracking-[0.2em] leading-relaxed max-w-[200px] mx-auto",children:"Deterministic Control for an Agentic World"})]}),d.jsxs("form",{onSubmit:k,className:"space-y-8",children:[d.jsxs("div",{className:"space-y-4",children:[t==="setup"&&d.jsxs("div",{className:"space-y-2",children:[d.jsx("label",{htmlFor:"auth-name",className:"text-[9px] font-bold text-gray-400 uppercase tracking-[0.2em]",children:"Name"}),d.jsx("input",{id:"auth-name",type:"text",value:o,onChange:_=>u(_.target.value),placeholder:"Full Name",className:"w-full bg-white/[0.05] border border-white/10 rounded-2xl px-5 py-4 text-sm focus:outline-none focus:border-white/30 focus-visible:ring-2 focus-visible:ring-white/50 transition-all placeholder:text-gray-600",autoComplete:"name"})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx("label",{htmlFor:"auth-email",className:"text-[9px] font-bold text-gray-400 uppercase tracking-[0.2em]",children:"Email"}),d.jsx("input",{id:"auth-email",type:"email",value:c,onChange:_=>f(_.target.value),placeholder:"user@example.com",className:"w-full bg-white/[0.05] border border-white/10 rounded-2xl px-5 py-4 text-sm focus:outline-none focus:border-white/30 focus-visible:ring-2 focus-visible:ring-white/50 transition-all placeholder:text-gray-600",required:!0,autoComplete:"email"})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx("label",{htmlFor:"auth-pass",className:"text-[9px] font-bold text-gray-400 uppercase tracking-[0.2em]",children:"Password"}),d.jsxs("div",{className:"relative",children:[d.jsx("input",{id:"auth-pass",type:w?"text":"password",value:h,onChange:_=>p(_.target.value),placeholder:"••••••••",className:"w-full bg-white/[0.05] border border-white/10 rounded-2xl px-5 py-4 pr-12 text-sm focus:outline-none focus:border-white/30 focus-visible:ring-2 focus-visible:ring-white/50 transition-all placeholder:text-gray-600",required:!0,autoComplete:t==="setup"?"new-password":"current-password"}),d.jsx("button",{type:"button",onClick:()=>y(!w),className:"absolute right-4 top-1/2 -translate-y-1/2 p-1.5 rounded-lg text-white/30 hover:text-white hover:bg-white/10 transition-all focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50","aria-label":w?"Hide password":"Show password",title:w?"Hide password":"Show password",children:d.jsx(Ce,{name:w?"visibility_off":"visibility",className:"text-lg"})})]})]}),t==="setup"&&d.jsxs("div",{className:"space-y-2",children:[d.jsx("label",{htmlFor:"auth-pass-confirm",className:"text-[9px] font-bold text-gray-400 uppercase tracking-[0.2em]",children:"Confirm Password"}),d.jsxs("div",{className:"relative",children:[d.jsx("input",{id:"auth-pass-confirm",type:j?"text":"password",value:b,onChange:_=>x(_.target.value),placeholder:"••••••••",className:"w-full bg-white/[0.05] border border-white/10 rounded-2xl px-5 py-4 pr-12 text-sm focus:outline-none focus:border-white/30 focus-visible:ring-2 focus-visible:ring-white/50 transition-all placeholder:text-gray-600",required:!0,autoComplete:"new-password"}),d.jsx("button",{type:"button",onClick:()=>v(!j),className:"absolute right-4 top-1/2 -translate-y-1/2 p-1.5 rounded-lg text-white/30 hover:text-white hover:bg-white/10 transition-all focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50","aria-label":j?"Hide password confirmation":"Show password confirmation",title:j?"Hide password confirmation":"Show password confirmation",children:d.jsx(Ce,{name:j?"visibility_off":"visibility",className:"text-lg"})})]})]})]}),d.jsxs("button",{type:"submit",disabled:l,"aria-busy":l,className:"shine-effect w-full bg-white text-black py-4 rounded-2xl font-bold text-[10px] tracking-[0.3em] uppercase hover:scale-[1.02] active:scale-[0.98] transition-all disabled:opacity-60 disabled:cursor-default flex items-center justify-center gap-3 focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-500",children:[l&&d.jsx("div",{className:"w-4 h-4 border-2 border-black/10 border-t-black rounded-full animate-spin"}),S]}),i&&d.jsx("div",{role:"alert",className:"text-[9px] font-bold text-red-500 text-center uppercase tracking-widest",children:i})]})]})]})};function Fw(t){return t>=1e6?`${(t/1e6).toFixed(1).replace(/\.0$/,"")}m`:t>=1e3?`${(t/1e3).toFixed(1).replace(/\.0$/,"")}k`:String(t)}const qw=({className:t})=>d.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:t,"aria-hidden":"true",children:d.jsx("path",{d:"M12 2C6.477 2 2 6.477 2 12c0 4.42 2.865 8.166 6.839 9.489.5.092.682-.217.682-.482 0-.237-.008-.866-.013-1.699-2.782.603-3.369-1.34-3.369-1.34-.454-1.156-1.11-1.463-1.11-1.463-.908-.62.069-.608.069-.608 1.003.07 1.531 1.03 1.531 1.03.892 1.529 2.341 1.087 2.91.831.092-.646.35-1.086.636-1.336-2.22-.253-4.555-1.11-4.555-4.943 0-1.091.39-1.984 1.029-2.683-.103-.253-.446-1.27.098-2.647 0 0 .84-.269 2.75 1.025A9.564 9.564 0 0112 6.844c.85.004 1.705.114 2.504.336 1.909-1.294 2.747-1.025 2.747-1.025.546 1.379.202 2.394.1 2.647.64.699 1.028 1.592 1.028 2.683 0 3.842-2.339 4.687-4.566 4.935.359.309.678.919.678 1.852 0 1.336-.012 2.415-.012 2.743 0 .267.18.578.688.48C19.138 20.161 22 16.418 22 12c0-5.523-4.477-10-10-10z"})});function Cx({className:t=""}){const[r,i]=T.useState("—"),l=u=>{const c=u.currentTarget.getBoundingClientRect(),f=Math.min(1,Math.max(0,(u.clientX-c.left)/c.width)),h=Math.min(1,Math.max(0,(u.clientY-c.top)/c.height));u.currentTarget.style.setProperty("--beam-x",`${(f*100).toFixed(2)}%`),u.currentTarget.style.setProperty("--beam-y",`${(h*100).toFixed(2)}%`)},o=u=>{u.currentTarget.style.setProperty("--beam-x","50%"),u.currentTarget.style.setProperty("--beam-y","50%")};return T.useEffect(()=>{let u=!0;return fetch("https://api.github.com/repos/figranium/figranium").then(c=>c.ok?c.json():null).then(c=>{!u||!c?.stargazers_count||i(Fw(Number(c.stargazers_count)))}).catch(()=>{u&&i("—")}),()=>{u=!1}},[]),d.jsxs("a",{href:"https://github.com/figranium/figranium",target:"_blank",rel:"noreferrer",onPointerMove:l,onPointerLeave:o,className:`gh-pill beam-follow inline-flex items-center gap-2 rounded-full border border-white/10 bg-white/5 px-4 py-2 text-[11px] uppercase tracking-[0.25em] text-white/70 transition hover:border-white/20 hover:bg-white/10 hover:text-white ${t}`,"aria-label":"Star Figranium on GitHub",children:[d.jsx(qw,{className:"h-4 w-4"}),"GitHub",d.jsx("span",{className:"mx-1 h-3 w-px bg-white/20","aria-hidden":"true"}),d.jsx(Ce,{name:"star",className:"text-base",fill:!0}),r]})}const Vw=({tasks:t,onNewTask:r,onEditTask:i,onDeleteTask:l,onExportTasks:o,onImportTasks:u})=>{const c=T.useRef(null),[f,h]=ft.useState(!1),[p,b]=ft.useState([]),x=v=>{try{return v?`https://www.google.com/s2/favicons?domain=${new URL(v).hostname}&sz=64`:null}catch{return null}},w=()=>{c.current?.click()},y=v=>{const k=Array.from(v.target.files||[]);k.length>0&&k.forEach(S=>u(S)),v.target.value=""},j=v=>{b(k=>k.includes(v)?k.filter(S=>S!==v):[...k,v])};return d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"flex-1 overflow-hidden animate-in fade-in duration-500 bg-black",children:d.jsxs("div",{className:"h-full flex flex-col px-12 py-12 max-w-7xl mx-auto space-y-12 w-full",children:[d.jsxs("div",{className:"flex items-end justify-between",children:[d.jsx("div",{className:"space-y-2",children:d.jsx("h2",{className:"text-2xl font-medium tracking-[0.25em] text-white uppercase",children:"Dashboard"})}),d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx(Cx,{}),d.jsxs("button",{onClick:()=>{b([]),h(!0)},className:"px-4 py-3 rounded-2xl border border-white/10 text-white text-[9px] font-bold uppercase tracking-[0.3em] hover:bg-white/5 transition-all focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50",children:[d.jsx(Ce,{name:"download",className:"w-4 h-4 inline-block mr-2 text-[16px] align-sub"}),"Export"]}),d.jsxs("button",{onClick:w,className:"px-4 py-3 rounded-2xl border border-white/10 text-white text-[9px] font-bold uppercase tracking-[0.3em] hover:bg-white/5 transition-all focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50",children:[d.jsx(Ce,{name:"upload",className:"w-4 h-4 inline-block mr-2 text-[16px] align-sub"}),"Import"]}),d.jsx("button",{onClick:r,className:"shine-effect bg-white text-black px-8 py-3 rounded-2xl font-bold text-[10px] tracking-[0.2em] uppercase transition-all hover:scale-105 active:scale-95 focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-500","aria-label":"Create new task",children:"+ New Task"}),d.jsx("input",{ref:c,type:"file",accept:"application/json",multiple:!0,className:"hidden",onChange:y})]})]}),d.jsxs("div",{className:"relative flex-1 min-h-0",children:[d.jsx("div",{className:"pointer-events-none absolute top-0 left-0 right-0 h-10 bg-gradient-to-b from-[#050505] via-[#050505]/50 to-transparent z-10"}),d.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 content-start gap-6 overflow-y-auto custom-scrollbar pb-12 pr-4 h-full",children:t.map(v=>{const k=x(v.url);return d.jsxs("div",{className:"bg-[#050505] border border-white/10 p-6 rounded-2xl flex flex-col gap-6 group hover:-translate-y-1 hover:border-white/30 transition-all shadow-xl hover:bg-[#0a0a0a]",children:[d.jsxs("div",{className:"flex justify-between items-start",children:[d.jsx("div",{className:"w-12 h-12 rounded-xl bg-white/5 border border-white/10 flex items-center justify-center overflow-hidden",children:k?d.jsx("img",{src:k,alt:"",className:"w-6 h-6 object-contain grayscale opacity-100 group-hover:grayscale-0 transition-all duration-300",onError:S=>{S.target.style.display="none"}}):d.jsx(Ce,{name:"public",className:"text-gray-500 text-xl"})}),d.jsx("div",{className:"px-3 py-1 rounded-lg bg-white/5 text-[7px] font-bold uppercase tracking-widest text-white/60",children:v.mode})]}),d.jsxs("div",{children:[d.jsx("h3",{className:"text-lg font-bold text-white truncate",children:v.name||"Untitled"}),d.jsx("p",{className:"text-[10px] text-gray-600 font-mono truncate mt-1",children:v.url||"Target undefined"})]}),d.jsxs("div",{className:"flex gap-3 pt-4 border-t border-white/5",children:[d.jsx("button",{onClick:()=>i(v),className:"flex-1 py-2 rounded-lg bg-white text-black text-[9px] font-bold uppercase tracking-widest hover:scale-105 transition-all focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-500",children:"Edit Task"}),d.jsx("button",{onClick:()=>l(v.id),className:"w-10 h-10 rounded-lg bg-transparent border border-white/10 flex items-center justify-center hover:bg-red-500/10 hover:text-red-500 hover:border-red-500/30 transition-all focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50","aria-label":"Delete task",title:"Delete task",children:d.jsx(Ce,{name:"close",className:"text-base"})})]})]},v.id)})})]}),t.length===0&&d.jsx("div",{className:"flex-1 flex flex-col items-center justify-center",children:d.jsxs("button",{onClick:r,className:"w-full max-w-[400px] bg-[#0a0a0a] border border-dashed border-white/15 rounded-2xl p-8 hover:border-white/30 hover:bg-white/[0.03] transition-all flex flex-col items-center justify-center gap-4 group cursor-pointer focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50",children:[d.jsx("div",{className:"w-12 h-12 rounded-xl bg-white/5 group-hover:bg-white/10 transition-all flex items-center justify-center border border-white/5",children:d.jsx(Ce,{name:"add",className:"text-3xl text-gray-500 group-hover:text-white transition-colors"})}),d.jsxs("div",{className:"text-center space-y-2",children:[d.jsx("p",{className:"text-[10px] font-bold uppercase tracking-[0.2em] text-white/70 group-hover:text-white transition-colors",children:"Create First Task"}),d.jsx("p",{className:"text-[10px] text-gray-500 max-w-[250px] mx-auto leading-relaxed group-hover:text-gray-400 transition-colors",children:"Get started by creating your first automation task. This will open the visual editor."})]})]})})]})}),f&&d.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4 sm:p-6 pb-20 sm:pb-6",children:[d.jsx("div",{className:"absolute inset-0 bg-black/80 backdrop-blur-sm",onClick:()=>h(!1)}),d.jsxs("div",{className:"relative w-full max-w-lg bg-[#0a0a0a] border border-white/10 rounded-2xl shadow-2xl overflow-hidden flex flex-col max-h-full slide-up",children:[d.jsxs("div",{className:"p-6 sm:p-8 shrink-0",children:[d.jsx("h3",{className:"text-xl font-bold text-white tracking-tight",children:"Export Tasks"}),d.jsx("p",{className:"text-[11px] text-white/50 mt-2 font-mono",children:"Select the tasks you want to export."})]}),d.jsxs("div",{className:"px-6 sm:px-8 pb-4 flex items-center gap-3 shrink-0 border-b border-white/5",children:[d.jsx("button",{onClick:()=>b(t.map(v=>v.id)),className:"text-[10px] font-bold uppercase tracking-widest text-blue-400 hover:text-blue-300 transition-colors",children:"Select All"}),d.jsx("span",{className:"text-white/20",children:"|"}),d.jsx("button",{onClick:()=>b([]),className:"text-[10px] font-bold uppercase tracking-widest text-white/40 hover:text-white/80 transition-colors",children:"Deselect All"}),d.jsx("div",{className:"flex-1"}),d.jsxs("span",{className:"text-[10px] font-mono text-white/30",children:[p.length," selected"]})]}),d.jsx("div",{className:"flex-1 overflow-y-auto custom-scrollbar p-6 sm:p-8 space-y-2",children:t.map(v=>d.jsxs("button",{onClick:()=>j(v.id),className:`w-full text-left p-4 rounded-2xl border transition-all flex items-center gap-4 ${p.includes(v.id)?"bg-blue-500/10 border-blue-500/30":"bg-white/5 border-white/5 hover:border-white/10"}`,children:[d.jsx("div",{className:`w-5 h-5 rounded flex items-center justify-center border transition-colors ${p.includes(v.id)?"bg-blue-500 border-blue-400 text-white":"border-white/20"}`,children:p.includes(v.id)&&d.jsx(Ce,{name:"check",className:"text-[14px]"})}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsx("div",{className:"text-sm font-bold text-white truncate",children:v.name||"Untitled"}),d.jsx("div",{className:"text-[10px] text-white/40 font-mono truncate",children:v.url||"No URL"})]})]},v.id))}),d.jsxs("div",{className:"p-6 sm:p-8 bg-black/40 border-t border-white/5 flex gap-3 shrink-0",children:[d.jsx("button",{onClick:()=>h(!1),className:"flex-1 px-4 py-3 rounded-xl border border-white/10 text-white text-[10px] font-bold uppercase tracking-widest hover:bg-white/5 transition-all",children:"Cancel"}),d.jsxs("button",{onClick:()=>{o(p),h(!1)},disabled:p.length===0,className:`flex-1 px-4 py-3 rounded-xl text-[10px] font-bold uppercase tracking-widest transition-all focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 ${p.length>0?"bg-white text-black hover:scale-105":"bg-white/10 text-white/30 cursor-not-allowed"}`,children:["Export (",p.length,")"]})]})]})]})]})},Xm=T.memo(Vw),nd=[{type:"click",label:"Click",description:"Click an element",icon:"ads_click"},{type:"type",label:"Type",description:"Type text into a field",icon:"text_format"},{type:"hover",label:"Hover",description:"Hover an element",icon:"my_location"},{type:"press",label:"Press",description:"Press a key",icon:"keyboard"},{type:"wait",label:"Wait",description:"Pause for seconds",icon:"schedule"},{type:"wait_selector",label:"Wait for Selector",description:"Wait until element appears",icon:"schedule"},{type:"wait_downloads",label:"Wait for Downloads",description:"Wait until downloads finish",icon:"download"},{type:"scroll",label:"Scroll",description:"Scroll the page or container",icon:"swap_vert"},{type:"javascript",label:"JavaScript",description:"Run custom JS",icon:"code"},{type:"csv",label:"CSV",description:"Parse CSV into rows",icon:"table_chart"},{type:"merge",label:"Merge",description:"Merge inputs into a single output",icon:"layers"},{type:"screenshot",label:"Screenshot",description:"Capture a screenshot",icon:"photo_camera"},{type:"navigate",label:"Navigate To",description:"Navigate to a URL",icon:"navigation"},{type:"if",label:"If",description:"Conditional block start",icon:"call_split"},{type:"else",label:"Else",description:"Conditional alternate path",icon:"call_split"},{type:"end",label:"End Block",description:"Close a block",icon:"subdirectory_arrow_right"},{type:"while",label:"While",description:"Loop while condition true",icon:"repeat"},{type:"repeat",label:"Repeat N",description:"Repeat block N times",icon:"repeat"},{type:"foreach",label:"For Each",description:"Loop through items",icon:"list"},{type:"set",label:"Set Variable",description:"Update variable value",icon:"data_object"},{type:"stop",label:"Stop Task",description:"Stop task with status",icon:"stop"},{type:"on_error",label:"On Error",description:"Run on failure",icon:"warning"},{type:"start",label:"Start Task",description:"Run another task",icon:"play_circle"}],Yw=({open:t,query:r,onQueryChange:i,onClose:l,onSelect:o})=>{const u=T.useRef(null),c=T.useMemo(()=>{const f=r.trim().toLowerCase();return f?nd.filter(h=>h.label.toLowerCase().includes(f)||h.description.toLowerCase().includes(f)):nd},[r]);return t?d.jsx("div",{className:"fixed inset-0 z-[190] flex items-center justify-center bg-black/70 backdrop-blur-sm px-6",onClick:l,children:d.jsxs("div",{className:"glass-card w-full max-w-xl rounded-[28px] border border-white/10 p-6 shadow-2xl",onClick:f=>f.stopPropagation(),children:[d.jsxs("div",{className:"flex items-center justify-between mb-4",children:[d.jsxs("div",{children:[d.jsx("p",{className:"text-[9px] font-bold uppercase tracking-[0.4em] text-gray-500",children:"Add Block"}),d.jsx("p",{className:"text-xs text-gray-400 mt-1",children:"Search actions and control flow blocks."})]}),d.jsx("button",{onClick:l,className:"p-2 rounded-xl border border-white/10 text-white/70 hover:text-white hover:bg-white/5 transition-all","aria-label":"Close",children:d.jsx(Ce,{name:"close",className:"text-base"})})]}),d.jsx("input",{ref:f=>{u.current=f,f&&f.focus()},value:r,onChange:f=>i(f.target.value),placeholder:"Type to filter (e.g., if, click, loop)",className:"w-full rounded-xl bg-black/40 border border-white/10 px-4 py-3 text-sm text-white placeholder:text-gray-600 focus:outline-none focus:border-white/30"}),d.jsxs("div",{className:"mt-4 max-h-[400px] overflow-y-auto custom-scrollbar pr-2",children:[d.jsx("div",{className:"grid grid-cols-2 gap-3 pb-2",children:c.map(f=>d.jsxs("button",{onClick:()=>o(f.type),className:"flex flex-col items-start gap-2 text-left p-4 rounded-2xl border border-white/5 bg-white/[0.02] hover:bg-white/[0.08] hover:border-white/20 transition-all hover:scale-[1.02] active:scale-95 group focus:outline-none focus:ring-2 focus:ring-blue-500/50",children:[d.jsx(Ce,{name:f.icon||"extension",className:"text-2xl text-white/80 group-hover:text-white transition-colors shrink-0 mb-1"}),d.jsxs("div",{children:[d.jsx("div",{className:"text-[11px] font-bold uppercase tracking-widest text-white/90 group-hover:text-white mb-1",children:f.label}),d.jsx("div",{className:"text-[10px] text-gray-500 line-clamp-2 leading-relaxed",children:f.description})]})]},f.type))}),c.length===0&&d.jsx("div",{className:"text-[9px] text-gray-600 uppercase tracking-widest",children:"No matches."})]})]})}):null},zt=t=>t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;"),Gw=new Set(["const","let","var","function","return","if","else","for","while","do","switch","case","break","continue","try","catch","finally","throw","new","class","extends","super","import","from","export","default","await","async","typeof","instanceof","in","of","this"]),Nx=(t,r)=>{const i=/\{\$(\w+)\}/g;let l="",o=0,u;const c=h=>!!r&&(h in r||h==="now"),f=h=>{if(h==="now")return!0;const p=r?r[h]:void 0;return p&&p.value!==""&&p.value!==void 0&&p.value!==null};for(;(u=i.exec(t))!==null;){u.index>o&&(l+=zt(t.substring(o,u.index)));const h=u[1],p=c(h),b=f(h);l+=`<span class="${p?b?"var-highlight-default":"var-highlight":"var-highlight-undefined"}">${zt(u[0])}</span>`,o=i.lastIndex}return l+=zt(t.substring(o)),l},Kw=t=>{const r=/("(?:\\.|[^"\\])*")|(-?\b\d+(?:\.\d+)?(?:[eE][+-]?\d+)?\b)|\b(true|false|null)\b/g;let i="",l=0,o;for(;(o=r.exec(t))!==null;){o.index>l&&(i+=zt(t.substring(l,o.index)));const u=o[0];if(o[1]){let c=!1,f=o.index+u.length;for(;f<t.length&&/\s/.test(t[f]);)f+=1;t[f]===":"&&(c=!0),i+=`<span class="${c?"code-token-key":"code-token-string"}">${zt(u)}</span>`}else o[2]?i+=`<span class="code-token-number">${zt(u)}</span>`:i+=`<span class="code-token-boolean">${zt(u)}</span>`;l=r.lastIndex}return i+=zt(t.substring(l)),i},$w=(t,r)=>{const i=/(\{\$\w+\})|(\/\/[^\n]*|\/\*[\s\S]*?\*\/)|("(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|`(?:\\.|[^`\\])*`)|(\b\d+(?:\.\d+)?(?:[eE][+-]?\d+)?\b)|(\btrue\b|\bfalse\b|\bnull\b|\bundefined\b)|(\b[A-Za-z_]\w*\b)/g;let l="",o=0,u;for(;(u=i.exec(t))!==null;){u.index>o&&(l+=zt(t.substring(o,u.index)));const c=u[0];if(u[1])l+=Nx(c,r);else if(u[2])l+=`<span class="code-token-comment">${zt(c)}</span>`;else if(u[3])l+=`<span class="code-token-string">${zt(c)}</span>`;else if(u[4])l+=`<span class="code-token-number">${zt(c)}</span>`;else if(u[5])l+=`<span class="code-token-boolean">${zt(c)}</span>`;else if(u[6]){const f=Gw.has(c)?"code-token-keyword":"code-token-identifier";l+=`<span class="${f}">${zt(c)}</span>`}else l+=zt(c);o=i.lastIndex}return l+=zt(t.substring(o)),l},Xw=t=>{const r=/<\/?[^>]+>/g;let i="",l=0,o;for(;(o=r.exec(t))!==null;){o.index>l&&(i+=zt(t.substring(l,o.index)));const u=o[0],c=u.match(/^<(\/?[A-Za-z0-9-]+)([\s\S]*?)>$/);if(c){const f=c[1],h=c[2];let p=zt(f);p.startsWith("/")?p=`/<span class="code-token-tag">${p.substring(1)}</span>`:p=`<span class="code-token-tag">${p}</span>`;let b=zt(h);b=b.replace(/(\s)([A-Za-z0-9-:]+)(=)/g,'$1<span class="code-token-attr">$2</span>$3'),b=b.replace(/(&quot;.*?&quot;|&#39;.*?&#39;)/g,'<span class="code-token-string">$1</span>'),i+=`<span class="code-token-punct">&lt;${p}${b}&gt;</span>`}else i+=`<span class="code-token-punct">${zt(u)}</span>`;l=r.lastIndex}return i+=zt(t.substring(l)),i},Ex=(t,r,i)=>r==="javascript"?$w(t,i):r==="json"?Kw(t):r==="html"?Xw(t):Nx(t,i),sl=({value:t,onChange:r,onBlur:i,language:l,placeholder:o,className:u,readOnly:c,variables:f})=>{const h=T.useRef(null),p=T.useRef(null),b=t||o||"",x=!t&&!!o,w=T.useMemo(()=>Ex(b,l,f),[b,l,f]);return T.useEffect(()=>{const y=h.current,j=p.current;if(!y||!j)return;const v=()=>{j.scrollTop=y.scrollTop,j.scrollLeft=y.scrollLeft};return y.addEventListener("scroll",v),()=>{y.removeEventListener("scroll",v)}},[]),d.jsxs("div",{className:`code-editor ${u||""}`,onWheel:y=>{const j=h.current;j&&(j.scrollHeight<=j.clientHeight||(j.scrollTop+=y.deltaY,j.scrollLeft+=y.deltaX,j.focus(),y.preventDefault()))},children:[d.jsx("pre",{ref:p,className:`code-editor-pre ${x?"code-editor-placeholder":""}`,"aria-hidden":!0,dangerouslySetInnerHTML:{__html:w}}),d.jsx("textarea",{ref:h,value:t,onChange:y=>r?.(y.target.value),onBlur:y=>i?.(y.target.value),spellCheck:!1,wrap:"off",readOnly:c,className:`code-editor-textarea ${c?"code-editor-textarea-readonly":""}`,"aria-label":"Code editor",tabIndex:c?-1:0})]})},Zw=async t=>{try{if(navigator.clipboard&&window.isSecureContext)return await navigator.clipboard.writeText(t),!0;{const r=document.createElement("textarea");r.value=t,r.style.position="fixed",r.style.left="-999999px",r.style.top="-999999px",document.body.appendChild(r),r.focus(),r.select();const i=document.execCommand("copy");return r.remove(),i}}catch(r){return console.error("Copy failed:",r),!1}},ol=({text:t,label:r,className:i,iconClassName:l,onCopy:o,title:u,disabled:c=!1})=>{const[f,h]=T.useState(!1),p=async j=>{if(j.stopPropagation(),c)return;await Zw(t)&&(h(!0),o?.(),setTimeout(()=>h(!1),2e3))},b="flex items-center gap-2 px-3 py-2 rounded-xl bg-white/5 border border-white/10 text-white hover:bg-white/10 transition-all text-[9px] font-bold uppercase tracking-widest disabled:opacity-50 disabled:cursor-not-allowed",x="focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50",w=i?`${i} ${x}`:`${b} ${x}`,y=f?w.replace("border-white/10","border-green-400 text-green-400"):w;return d.jsxs("button",{onClick:p,disabled:c,className:y,title:u||(f?"Copied":"Copy"),type:"button","aria-label":r||u||"Copy to clipboard",children:[f?d.jsx(Ce,{name:"check",className:`${l||"text-sm"} text-green-400`}):d.jsx(Ce,{name:"content_copy",className:l||"text-sm"}),r&&d.jsx("span",{children:f?"Copied":r})]})},Qw=({currentTask:t,onUpdateTask:r})=>{if(!t.id)return d.jsxs("div",{className:"flex flex-col items-center justify-center h-64 text-center space-y-4 animate-in fade-in duration-300",children:[d.jsx("div",{className:"w-12 h-12 rounded-full bg-white/5 flex items-center justify-center",children:d.jsx(Ce,{name:"save",className:"text-gray-500"})}),d.jsxs("div",{children:[d.jsx("p",{className:"text-xs text-white font-medium",children:"Save Required"}),d.jsx("p",{className:"text-[10px] text-gray-500 mt-1 max-w-[200px]",children:"You must save this task before you can set an execution schedule."})]})]});const i=t.schedule||{enabled:!1},[l,o]=ft.useState(!!i.cron&&!i.frequency);ft.useEffect(()=>{i.cron&&!i.frequency&&o(!0),i.frequency&&!i.cron&&o(!1)},[i.cron,i.frequency]);const[u,c]=ft.useState(null),[f,h]=ft.useState(i.nextRun||null),[p,b]=ft.useState(!1),[x,w]=ft.useState(null),[y,j]=ft.useState(!1),v=D=>{const z={...i,...D};z.enabled&&!z.frequency&&!z.cron&&(z.frequency="daily",z.hour=9,z.minute=0),r({schedule:z}),fetch(`/api/schedules/${t.id}/describe`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(z)}).then(R=>R.json()).then(R=>{c(R.description||null),h(R.nextRun||null)}).catch(()=>{})};ft.useEffect(()=>{(i.enabled||i.frequency||i.cron)&&fetch(`/api/schedules/${t.id}/describe`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(i)}).then(D=>D.json()).then(D=>{c(D.description||null),h(D.nextRun||null)}).catch(()=>{})},[]);const k=D=>{b(!0),w(null),j(!1);const z=D||{...i};fetch(`/api/schedules/${t.id}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(z)}).then(async R=>{const G=await R.json();if(!R.ok)throw new Error(G.message||G.error||"Failed to save");return G}).then(R=>{R.schedule&&(r({schedule:R.schedule}),c(R.description||null),h(R.schedule?.nextRun||null),j(!0),setTimeout(()=>j(!1),2e3))}).catch(R=>{w(R.message)}).finally(()=>{b(!1)})},S=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],_=i.frequency||(l?void 0:"daily"),N=i.daysOfWeek||[],B=D=>{const z=D-Date.now();if(z<0)return"now";const R=Math.floor(z/6e4);if(R<1)return"less than a minute";if(R<60)return`${R}m`;const G=Math.floor(R/60);return G<24?`${G}h ${R%60}m`:`${Math.floor(G/24)}d ${G%24}h`};return d.jsxs("div",{className:"space-y-6 animate-in fade-in slide-in-from-bottom-2 duration-300",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("label",{className:"text-[10px] font-bold text-gray-500 uppercase tracking-[0.2em]",children:"Scheduled Execution"}),d.jsxs("button",{role:"switch","aria-checked":i.enabled,onClick:()=>{const D=!i.enabled,z={...i,enabled:D};D&&!z.frequency&&!z.cron&&(z.frequency="daily",z.hour=9,z.minute=0),v(z),k(z)},className:`flex items-center gap-2 px-3 py-1.5 rounded-lg text-[10px] font-bold uppercase tracking-wider transition-all border focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50 ${i.enabled?"bg-emerald-500/20 border-emerald-500/40 text-emerald-400":"bg-white/5 border-white/10 text-gray-500 hover:text-white hover:border-white/20"}`,children:[d.jsx("div",{className:`w-2 h-2 rounded-full ${i.enabled?"bg-emerald-400 animate-pulse":"bg-gray-600"}`}),i.enabled?"Active":"Inactive"]})]}),d.jsxs("div",{role:"tablist",className:"flex items-center gap-2 bg-black/40 p-1 rounded-xl border border-white/5",children:[d.jsx("button",{role:"tab","aria-selected":!l,onClick:()=>{o(!1),v({cron:void 0,frequency:i.frequency||"daily"})},className:`flex-1 px-3 py-1.5 rounded-lg text-[10px] font-bold uppercase tracking-wider transition-all focus:outline-none focus-visible:ring-2 ${l?"text-gray-500 hover:text-white focus-visible:ring-white/50":"bg-white text-black focus-visible:ring-blue-500"}`,children:"Visual"}),d.jsx("button",{role:"tab","aria-selected":l,onClick:()=>{o(!0),v({frequency:void 0,cron:i.cron||"0 9 * * *"})},className:`flex-1 px-3 py-1.5 rounded-lg text-[10px] font-bold uppercase tracking-wider transition-all focus:outline-none focus-visible:ring-2 ${l?"bg-white text-black focus-visible:ring-blue-500":"text-gray-500 hover:text-white focus-visible:ring-white/50"}`,children:"Advanced"})]}),l?d.jsxs("div",{className:"space-y-3",children:[d.jsx("label",{className:"text-[10px] font-bold text-gray-500 uppercase tracking-[0.2em]",children:"Cron Expression"}),d.jsx("input",{type:"text","aria-label":"Cron Expression",value:i.cron||"",onChange:D=>v({cron:D.target.value,frequency:void 0}),placeholder:"*/5 * * * *",className:"w-full bg-black/40 border border-white/10 rounded-xl px-4 py-3 text-sm text-white font-mono placeholder:text-gray-700 focus:outline-none focus:border-white/30 transition-all focus-visible:ring-2 focus-visible:ring-white/50"}),d.jsx("p",{className:"text-[9px] text-gray-600 font-mono",children:"minute hour day-of-month month day-of-week"})]}):d.jsxs("div",{className:"space-y-6",children:[d.jsxs("div",{className:"space-y-3",children:[d.jsx("label",{className:"text-[10px] font-bold text-gray-500 uppercase tracking-[0.2em]",children:"Frequency"}),d.jsx("div",{role:"tablist",className:"grid grid-cols-3 gap-2",children:["interval","hourly","daily","weekly","monthly"].map(D=>d.jsx("button",{role:"tab","aria-selected":_===D,onClick:()=>v({frequency:D,cron:void 0}),className:`px-3 py-2.5 rounded-xl text-[10px] font-bold uppercase tracking-wider border transition-all focus:outline-none focus-visible:ring-2 ${_===D?"bg-white/15 border-white/40 text-white focus-visible:ring-blue-500":"bg-white/5 border-white/5 text-gray-500 hover:text-white hover:border-white/15 focus-visible:ring-white/50"}`,children:D==="interval"?"Every X min":D},D))})]}),_==="interval"&&d.jsxs("div",{className:"space-y-3",children:[d.jsx("label",{className:"text-[10px] font-bold text-gray-500 uppercase tracking-[0.2em]",children:"Run every"}),d.jsx("div",{role:"tablist",className:"grid grid-cols-6 gap-2",children:[1,5,10,15,30,60].map(D=>d.jsxs("button",{role:"tab","aria-selected":(i.intervalMinutes||5)===D,onClick:()=>v({intervalMinutes:D}),className:`py-2 rounded-xl text-xs font-bold border transition-all focus:outline-none focus-visible:ring-2 ${(i.intervalMinutes||5)===D?"bg-white/15 border-white/40 text-white focus-visible:ring-blue-500":"bg-white/5 border-white/5 text-gray-500 hover:text-white hover:border-white/15 focus-visible:ring-white/50"}`,children:[D,"m"]},D))})]}),_==="hourly"&&d.jsxs("div",{className:"space-y-3",children:[d.jsx("label",{className:"text-[10px] font-bold text-gray-500 uppercase tracking-[0.2em]",children:"At minute"}),d.jsx("div",{role:"tablist",className:"grid grid-cols-4 gap-2",children:[0,15,30,45].map(D=>d.jsxs("button",{role:"tab","aria-selected":(i.minute??0)===D,onClick:()=>v({minute:D}),className:`py-2 rounded-xl text-xs font-bold border transition-all focus:outline-none focus-visible:ring-2 ${(i.minute??0)===D?"bg-white/15 border-white/40 text-white focus-visible:ring-blue-500":"bg-white/5 border-white/5 text-gray-500 hover:text-white hover:border-white/15 focus-visible:ring-white/50"}`,children:[":",String(D).padStart(2,"0")]},D))})]}),(_==="daily"||_==="weekly"||_==="monthly")&&d.jsxs("div",{className:"space-y-3",children:[d.jsx("label",{className:"text-[10px] font-bold text-gray-500 uppercase tracking-[0.2em]",children:"Time"}),d.jsxs("div",{className:"flex gap-2",children:[d.jsx("select",{"aria-label":"Hour",value:i.hour??9,onChange:D=>v({hour:parseInt(D.target.value)}),className:"flex-1 bg-black/40 border border-white/10 rounded-xl px-3 py-2.5 text-xs text-white focus:outline-none focus:border-white/30 transition-all focus-visible:ring-2 focus-visible:ring-white/50",children:Array.from({length:24},(D,z)=>d.jsx("option",{value:z,children:z===0?"12 AM":z<12?`${z} AM`:z===12?"12 PM":`${z-12} PM`},z))}),d.jsx("select",{"aria-label":"Minute",value:i.minute??0,onChange:D=>v({minute:parseInt(D.target.value)}),className:"flex-1 bg-black/40 border border-white/10 rounded-xl px-3 py-2.5 text-xs text-white focus:outline-none focus:border-white/30 transition-all focus-visible:ring-2 focus-visible:ring-white/50",children:Array.from({length:60},(D,z)=>d.jsxs("option",{value:z,children:[":",String(z).padStart(2,"0")]},z))})]})]}),_==="weekly"&&d.jsxs("div",{className:"space-y-3",children:[d.jsx("label",{className:"text-[10px] font-bold text-gray-500 uppercase tracking-[0.2em]",children:"Days"}),d.jsx("div",{className:"grid grid-cols-7 gap-1.5",children:S.map((D,z)=>d.jsx("button",{"aria-pressed":N.includes(z),onClick:()=>{const R=N.includes(z)?N.filter(G=>G!==z):[...N,z].sort();v({daysOfWeek:R})},className:`py-2 rounded-xl text-[10px] font-bold uppercase border transition-all focus:outline-none focus-visible:ring-2 ${N.includes(z)?"bg-white/20 border-white/40 text-white focus-visible:ring-blue-500":"bg-white/5 border-white/5 text-gray-600 hover:text-white hover:border-white/15 focus-visible:ring-white/50"}`,children:D},z))})]}),_==="monthly"&&d.jsxs("div",{className:"space-y-3",children:[d.jsx("label",{className:"text-[10px] font-bold text-gray-500 uppercase tracking-[0.2em]",children:"Day of Month"}),d.jsx("select",{"aria-label":"Day of Month",value:i.dayOfMonth??1,onChange:D=>v({dayOfMonth:parseInt(D.target.value)}),className:"w-full bg-black/40 border border-white/10 rounded-xl px-3 py-2.5 text-xs text-white focus:outline-none focus:border-white/30 transition-all focus-visible:ring-2 focus-visible:ring-white/50",children:Array.from({length:31},(D,z)=>d.jsx("option",{value:z+1,children:z+1},z+1))})]})]}),u&&d.jsxs("div",{className:"bg-white/5 border border-white/10 rounded-2xl p-4",children:[d.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[d.jsx(Ce,{name:"event_repeat",className:"text-sm text-white/40"}),d.jsx("span",{className:"text-[10px] font-bold text-gray-500 uppercase tracking-[0.2em]",children:"Schedule"})]}),d.jsx("p",{className:"text-sm text-white font-medium",children:u})]}),f&&d.jsxs("div",{className:"flex items-center justify-between bg-white/5 border border-white/10 rounded-2xl p-4",children:[d.jsxs("div",{children:[d.jsx("span",{className:"text-[10px] font-bold text-gray-500 uppercase tracking-[0.2em]",children:"Next Run"}),d.jsx("p",{className:"text-xs text-white mt-1",children:new Date(f).toLocaleString()})]}),d.jsxs("span",{className:"text-xs text-gray-400",children:["in ",B(f)]})]}),i.lastRun&&d.jsxs("div",{className:"flex items-center justify-between bg-white/5 border border-white/10 rounded-2xl p-4",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("div",{className:`w-2 h-2 rounded-full ${i.lastRunStatus==="success"?"bg-emerald-400":"bg-red-400"}`}),d.jsxs("div",{children:[d.jsx("span",{className:"text-[10px] font-bold text-gray-500 uppercase tracking-[0.2em]",children:"Last Run"}),d.jsx("p",{className:"text-xs text-white mt-0.5",children:new Date(i.lastRun).toLocaleString()})]})]}),i.lastRunDurationMs!=null&&d.jsxs("span",{className:"text-[10px] text-gray-500",children:[(i.lastRunDurationMs/1e3).toFixed(1),"s"]})]}),x&&d.jsx("div",{className:"p-3 rounded-xl bg-red-500/10 border border-red-500/20 text-red-400 text-[10px] font-bold uppercase tracking-widest text-center",children:x}),d.jsxs("button",{onClick:()=>k(),disabled:p,className:`w-full py-3 rounded-2xl text-[10px] font-bold uppercase tracking-[0.2em] transition-all flex items-center justify-center gap-3 focus:outline-none focus-visible:ring-2 ${y?"bg-emerald-500 text-white shadow-lg shadow-emerald-500/20 focus-visible:ring-white":"bg-white text-black hover:bg-gray-200 shadow-xl shadow-white/5 focus-visible:ring-blue-500"} disabled:opacity-50`,children:[p?d.jsx("div",{className:"w-3 h-3 border-2 border-black/20 border-t-black rounded-full animate-spin"}):y?d.jsx(Ce,{name:"check",className:"text-sm"}):null,y?"Schedule Saved":p?"Saving...":"Save Schedule"]})]})},Jw=({isOpen:t,onClose:r,currentTask:i,onUpdateTask:l,proxyListLoaded:o,proxyList:u,initialTab:c="mode",versions:f,versionsLoading:h,onRollback:p,onPreview:b})=>{const[x,w]=ft.useState(c),[y,j]=ft.useState([]),[v,k]=ft.useState({name:"",baseUrl:"https://api.baserow.io",token:""}),[S,_]=ft.useState(!1),[N,B]=ft.useState(!1),[D,z]=ft.useState([]),[R,G]=ft.useState([]),[P,q]=ft.useState(!1),[W,I]=ft.useState(!1),[X,E]=ft.useState(!0);ft.useEffect(()=>{t&&w(c)},[t,c]),ft.useEffect(()=>{t&&x==="output"&&fetch("/api/credentials").then(V=>V.json()).then(j).catch(()=>{})},[t,x]);const Q=ft.useCallback(async V=>{if(!V){z([]),G([]),E(!0);return}q(!0),E(!0);try{const se=await fetch(`/api/credentials/${V}/proxy/baserow/databases`);if(se.ok){const ze=await se.json();z(ze),E(!0)}else z([]),E(!1)}catch{z([]),E(!1)}finally{q(!1)}},[]),$=ft.useCallback(async(V,se)=>{if(!V||!se){G([]);return}I(!0);try{const ze=await fetch(`/api/credentials/${V}/proxy/baserow/databases/${se}/tables`);ze.ok?G(await ze.json()):G([])}catch{G([])}finally{I(!1)}},[]);ft.useEffect(()=>{i.output?.credentialId?Q(i.output.credentialId):(z([]),G([]))},[i.output?.credentialId,Q]),ft.useEffect(()=>{i.output?.credentialId&&i.output?.databaseId?$(i.output.credentialId,i.output.databaseId):G([])},[i.output?.databaseId,i.output?.credentialId,$]);const J=async()=>{if(!(!v.name||!v.token)){B(!0);try{const V=await fetch("/api/credentials",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:v.name,provider:"baserow",config:{baseUrl:v.baseUrl,token:v.token}})});if(V.ok){const se=await V.json();j(ze=>[...ze,se]),k({name:"",baseUrl:"https://api.baserow.io",token:""}),_(!1),i.output?.credentialId||l({output:{...i.output,credentialId:se.id,provider:"baserow",tableId:i.output?.tableId||"",onError:i.output?.onError||"ignore"}})}}finally{B(!1)}}},ve=async V=>{await fetch(`/api/credentials/${V}`,{method:"DELETE"}),j(se=>se.filter(ze=>ze.id!==V)),i.output?.credentialId===V&&l({output:{...i.output,credentialId:""}})};if(!t)return null;const ee=o&&u.length===1&&u[0]?.id==="host",L=(V,se,ze,Re)=>{const De={...i.variables};V!==se&&delete De[V],De[se]={type:ze,value:Re},l({variables:De})},O=V=>{const se={...i.variables};delete se[V],l({variables:se})},H=()=>{const V=`var_${Object.keys(i.variables||{}).length+1}`;L(V,V,"string","")},M=V=>{l({stealth:{...i.stealth,[V]:!i.stealth[V]}})},ie=(V,se,ze)=>d.jsxs("button",{role:"tab","aria-selected":x===V,onClick:()=>w(V),className:`flex items-center gap-2 px-4 py-2 rounded-xl text-[10px] font-bold uppercase tracking-widest transition-all focus:outline-none focus-visible:ring-2 ${x===V?"bg-white text-black shadow-lg shadow-white/10 focus-visible:ring-blue-500":"text-gray-500 hover:text-white hover:bg-white/5 focus-visible:ring-white/50"}`,children:[d.jsx(Ce,{name:ze,className:"text-sm"}),se]});return d.jsxs("div",{className:"fixed inset-y-0 right-0 w-[450px] z-[100] flex",children:[d.jsx("div",{className:"fixed inset-0 bg-black/40 backdrop-blur-[2px]",onClick:r}),d.jsxs("div",{className:"relative h-full w-full bg-[#080808]/90 border-l border-white/10 backdrop-blur-2xl shadow-[-20px_0_50px_rgba(0,0,0,0.5)] flex flex-col animate-in slide-in-from-right duration-300 ease-out p-8",children:[d.jsxs("div",{className:"flex items-center justify-between mb-8",children:[d.jsxs("div",{children:[d.jsx("h2",{className:"text-xl font-bold text-white tracking-tight",children:"Task Settings"}),d.jsx("p",{className:"text-[10px] text-gray-500 uppercase tracking-[0.2em] mt-1",children:i.name||"Untitled Task"})]}),d.jsx("button",{onClick:r,className:"w-10 h-10 rounded-full flex items-center justify-center hover:bg-white/5 text-gray-400 hover:text-white transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50","aria-label":"Close settings",title:"Close settings",children:d.jsx(Ce,{name:"close"})})]}),d.jsxs("div",{className:"mb-6",children:[d.jsx("label",{className:"text-[10px] font-bold text-gray-500 uppercase tracking-[0.2em] block mb-2",children:"Description"}),d.jsx("textarea",{value:i.description||"",onChange:V=>l({description:V.target.value}),placeholder:"What does this task do? Give AI agents and operators context...",rows:3,className:"w-full bg-black/40 border border-white/10 rounded-xl px-3 py-2.5 text-xs text-white placeholder:text-gray-600 focus:outline-none focus:border-white/30 resize-none transition-all custom-scrollbar"})]}),d.jsxs("div",{role:"tablist",className:"flex flex-wrap gap-2 mb-8 bg-black/40 p-1 rounded-2xl border border-white/5",children:[ie("mode","Mode","settings_input_component"),ie("variables","Vars","data_object"),ie("behavior","Behavior","psychology"),ie("extraction","Extract","terminal"),ie("api","API","api"),ie("output","Output","table"),ie("schedule","Schedule","event_repeat"),ie("history","History","history")]}),d.jsxs("div",{className:"flex-1 overflow-y-auto custom-scrollbar pr-2 -mr-2",children:[x==="mode"&&d.jsx("div",{className:"space-y-8 animate-in fade-in slide-in-from-bottom-2 duration-300",children:d.jsxs("div",{className:"space-y-4",children:[d.jsx("label",{className:"text-[10px] font-bold text-gray-500 uppercase tracking-[0.2em]",children:"Execution Mode"}),d.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[d.jsxs("button",{onClick:()=>l({mode:"agent"}),className:`p-4 rounded-2xl border transition-all text-left space-y-2 focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50 ${i.mode==="agent"?"bg-white/10 border-white/30 ring-1 ring-white/20":"bg-white/5 border-white/5 opacity-50 hover:opacity-100 hover:border-white/10"}`,children:[d.jsx("div",{className:"w-8 h-8 rounded-full bg-white/10 flex items-center justify-center",children:d.jsx(Ce,{name:"smart_toy",className:"text-white/60"})}),d.jsxs("div",{children:[d.jsx("div",{className:"text-xs font-bold text-white",children:"Agent Mode"}),d.jsx("div",{className:"text-[9px] text-gray-500",children:"Autonomous decision making"})]})]}),d.jsxs("button",{onClick:()=>l({mode:"scrape"}),className:`p-4 rounded-2xl border transition-all text-left space-y-2 focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50 ${i.mode==="scrape"?"bg-white/10 border-white/30 ring-1 ring-white/20":"bg-white/5 border-white/5 opacity-50 hover:opacity-100 hover:border-white/10"}`,children:[d.jsx("div",{className:"w-8 h-8 rounded-full bg-white/10 flex items-center justify-center",children:d.jsx(Ce,{name:"api",className:"text-white/60"})}),d.jsxs("div",{children:[d.jsx("div",{className:"text-xs font-bold text-white",children:"Scrape Mode"}),d.jsx("div",{className:"text-[9px] text-gray-500",children:"Fixed data extraction flow"})]})]})]})]})}),x==="variables"&&d.jsxs("div",{className:"space-y-6 animate-in fade-in slide-in-from-bottom-2 duration-300",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("label",{className:"text-[10px] font-bold text-gray-500 uppercase tracking-[0.2em]",children:"Task Variables"}),d.jsx("button",{onClick:H,className:"px-3 py-1 rounded-lg bg-white/10 text-white text-[10px] font-bold uppercase tracking-wider hover:bg-white/20 transition-all border border-white/10 focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50",children:"+ Add Var"})]}),d.jsxs("div",{className:"space-y-3",children:[Object.entries(i.variables||{}).map(([V,se])=>d.jsxs("div",{className:"bg-white/5 border border-white/10 rounded-2xl p-4 space-y-3",children:[d.jsxs("div",{className:"flex gap-2",children:[d.jsx("input",{type:"text",defaultValue:V,onBlur:ze=>{ze.target.value!==V&&L(V,ze.target.value,se.type,se.value)},placeholder:"Name",className:"flex-1 bg-black/40 border border-white/5 rounded-xl px-3 py-2 text-xs text-white placeholder:text-gray-700"}),d.jsxs("select",{value:se.type,onChange:ze=>L(V,V,ze.target.value,se.value),className:"bg-black/40 border border-white/5 rounded-xl px-2 py-2 text-[10px] font-bold uppercase text-gray-500",children:[d.jsx("option",{value:"string",children:"String"}),d.jsx("option",{value:"number",children:"Number"}),d.jsx("option",{value:"boolean",children:"Bool"})]}),d.jsx("button",{onClick:()=>O(V),className:"text-red-500/50 hover:text-red-500 p-2 focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50 rounded-lg","aria-label":"Remove variable",title:"Remove variable",children:d.jsx(Ce,{name:"delete",className:"text-sm"})})]}),d.jsx("div",{className:"pl-1",children:se.type==="boolean"?d.jsxs("select",{value:String(se.value),onChange:ze=>L(V,V,se.type,ze.target.value==="true"),className:"w-full bg-black/40 border border-white/5 rounded-xl px-3 py-2 text-xs text-white",children:[d.jsx("option",{value:"true",children:"True"}),d.jsx("option",{value:"false",children:"False"})]}):d.jsx("input",{type:se.type==="number"?"number":"text",value:se.value,onChange:ze=>L(V,V,se.type,se.type==="number"?parseFloat(ze.target.value):ze.target.value),placeholder:"Default Value",className:"w-full bg-black/40 border border-white/5 rounded-xl px-3 py-2 text-xs text-white"})})]},V)),Object.keys(i.variables||{}).length===0&&d.jsx("div",{className:"text-center py-12 border border-dashed border-white/10 rounded-3xl",children:d.jsx("p",{className:"text-[10px] text-gray-600 uppercase tracking-widest",children:"No variables defined"})})]})]}),x==="behavior"&&d.jsxs("div",{className:"space-y-8 animate-in fade-in slide-in-from-bottom-2 duration-300",children:[d.jsxs("div",{className:"space-y-4",children:[d.jsx("label",{className:"text-[10px] font-bold text-gray-500 uppercase tracking-[0.2em]",children:"Runtime Flags"}),d.jsx("div",{className:"grid grid-cols-1 gap-2",children:[{label:"Stateless Execution",key:"statelessExecution",icon:"auto_delete"},{label:"Disable Recording",key:"disableRecording",icon:"videocam_off"},{label:"Rotate Proxies",key:"rotateProxies",icon:"vpn_lock",disabled:ee},{label:"Rotate User Agents",key:"rotateUserAgents",icon:"person_search"},{label:"Rotate Viewport",key:"rotateViewport",icon:"screenshot_monitor"},{label:"Include Shadow DOM",key:"includeShadowDom",icon:"layers"}].map(V=>d.jsxs("button",{disabled:V.disabled,role:"switch","aria-checked":!!i[V.key],onClick:()=>l({[V.key]:!i[V.key]}),className:`flex items-center justify-between p-4 rounded-2xl border transition-all focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50 ${i[V.key]?"bg-white/10 border-white/30 text-white":"bg-white/5 border-white/5 text-gray-400 opacity-60 hover:opacity-100"} ${V.disabled?"opacity-20 cursor-not-allowed":""}`,children:[d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx(Ce,{name:V.icon,className:"text-sm opacity-70"}),d.jsx("span",{className:"text-xs font-medium",children:V.label})]}),d.jsx("div",{className:`w-8 h-4 rounded-full relative transition-colors ${i[V.key]?"bg-white":"bg-white/10"}`,children:d.jsx("div",{className:`absolute top-1 w-2 h-2 rounded-full transition-all ${i[V.key]?"right-1 bg-black":"left-1 bg-white/20"}`})})]},V.key))})]}),d.jsxs("div",{className:"space-y-4",children:[d.jsx("label",{className:"text-[10px] font-bold text-gray-500 uppercase tracking-[0.2em]",children:"Stealth & Behavior"}),d.jsx("div",{className:"grid grid-cols-2 gap-2",children:[{label:"Human Typing",key:"naturalTyping",icon:"keyboard"},{label:"Cursor Glide",key:"cursorGlide",icon:"near_me"},{label:"Idle Moves",key:"idleMovements",icon:"mouse"},{label:"Dead Clicks",key:"deadClicks",icon:"ads_click"},{label:"Fatigue Sim",key:"fatigue",icon:"hourglass_empty"},{label:"Allow Typos",key:"allowTypos",icon:"spellcheck"},{label:"Random Clicks",key:"randomizeClicks",icon:"shuffle"},{label:"Overscroll",key:"overscroll",icon:"unfold_more"}].map(V=>d.jsxs("button",{role:"switch","aria-checked":!!i.stealth[V.key],onClick:()=>M(V.key),className:`flex flex-col gap-2 p-4 rounded-2xl border transition-all text-left focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50 ${i.stealth[V.key]?"bg-white/15 border-white/40 text-white":"bg-white/5 border-white/5 text-gray-500 opacity-60 hover:opacity-100"}`,children:[d.jsx(Ce,{name:V.icon,className:"text-sm opacity-70"}),d.jsx("span",{className:"text-[10px] font-bold uppercase tracking-tight",children:V.label})]},V.key))})]})]}),x==="extraction"&&d.jsx("div",{className:"space-y-6 h-full flex flex-col animate-in fade-in slide-in-from-bottom-2 duration-300",children:d.jsxs("div",{className:"space-y-4 flex-1 flex flex-col",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("label",{className:"text-[10px] font-bold text-gray-500 uppercase tracking-[0.2em]",children:"Post-Execution Script"}),d.jsxs("select",{value:i.extractionFormat||"json",onChange:V=>l({extractionFormat:V.target.value}),className:"bg-black/40 border border-white/5 rounded-lg px-2 py-1 text-[8px] font-bold uppercase text-gray-500",children:[d.jsx("option",{value:"json",children:"JSON"}),d.jsx("option",{value:"csv",children:"CSV"})]})]}),d.jsx("div",{className:"flex-1 bg-black/40 border border-white/5 rounded-2xl overflow-hidden min-h-[300px]",children:d.jsx(sl,{language:"javascript",value:i.extractionScript||"",onChange:V=>l({extractionScript:V}),placeholder:"// Example: return { title: document.title };",className:"h-full text-[11px]"})})]})}),x==="api"&&d.jsxs("div",{className:"space-y-6 animate-in fade-in slide-in-from-bottom-2 duration-300",children:[d.jsxs("div",{className:"space-y-4",children:[d.jsx("label",{className:"text-[10px] font-bold text-gray-500 uppercase tracking-[0.2em]",children:"Trigger via API"}),d.jsxs("div",{className:"space-y-2",children:[d.jsx("p",{className:"text-[10px] text-gray-500",children:"Run this task from external tools using the endpoint below:"}),d.jsxs("div",{className:"relative group",children:[d.jsxs("div",{className:"bg-black/40 border border-white/10 rounded-xl p-4 pr-12 font-mono text-[10px] text-white/80 break-all border-dashed",children:["POST /api/tasks/",i.id,"/api"]}),d.jsx(ol,{text:`POST /api/tasks/${i.id}/api`,className:"absolute right-2 top-2 p-2 rounded-lg bg-white/5 border border-white/10 text-white opacity-0 group-hover:opacity-100 focus-visible:opacity-100 transition-all",iconClassName:"text-xs",title:"Copy Endpoint"})]})]})]}),d.jsxs("div",{className:"space-y-4",children:[d.jsx("label",{className:"text-[10px] font-bold text-gray-500 uppercase tracking-[0.2em]",children:"Response Options"}),d.jsxs("button",{role:"switch","aria-checked":i.includeHtml,onClick:()=>l({includeHtml:!i.includeHtml}),className:"w-full flex items-center justify-between p-3 rounded-xl bg-black/20 border border-white/5 hover:bg-white/5 transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50",children:[d.jsxs("div",{className:"text-left",children:[d.jsx("span",{className:"text-xs font-medium",children:"Include HTML in response"}),d.jsx("p",{className:"text-[9px] text-gray-500 mt-0.5",children:"When an extraction script is set, also return the raw HTML"})]}),d.jsx("div",{className:`w-8 h-4 rounded-full relative transition-colors flex-shrink-0 ${i.includeHtml?"bg-white":"bg-white/10"}`,children:d.jsx("div",{className:`absolute top-1 w-2 h-2 rounded-full transition-all ${i.includeHtml?"right-1 bg-black":"left-1 bg-white/20"}`})})]})]}),d.jsxs("div",{className:"space-y-4",children:[d.jsx("label",{className:"text-[10px] font-bold text-gray-500 uppercase tracking-[0.2em]",children:"Passing Variables"}),d.jsxs("div",{className:"space-y-2",children:[d.jsx("p",{className:"text-[10px] text-gray-500",children:"You can override task variables in the request body:"}),d.jsxs("div",{className:"relative group",children:[d.jsx("div",{className:"bg-black/40 border border-white/5 rounded-xl p-4 pr-12 font-mono text-[10px] text-white/60",children:d.jsx("pre",{children:JSON.stringify({variables:Object.fromEntries(Object.entries(i.variables||{}).slice(0,2).map(([V,se])=>[V,se.value]))},null,2)})}),d.jsx(ol,{text:JSON.stringify({variables:Object.fromEntries(Object.entries(i.variables||{}).slice(0,2).map(([V,se])=>[V,se.value]))},null,2),className:"absolute right-2 top-2 p-2 rounded-lg bg-white/5 border border-white/10 text-white opacity-0 group-hover:opacity-100 focus-visible:opacity-100 transition-all",iconClassName:"text-xs",title:"Copy Payload"})]})]})]})]}),x==="output"&&d.jsxs("div",{className:"space-y-6 animate-in fade-in slide-in-from-bottom-2 duration-300",children:[d.jsxs("button",{role:"switch","aria-checked":!!i.output,onClick:()=>l({output:i.output?void 0:{provider:"baserow",credentialId:"",tableId:"",onError:"ignore"}}),className:"w-full flex items-center justify-between p-3 rounded-xl bg-black/20 border border-white/5 hover:bg-white/5 transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50",children:[d.jsxs("div",{className:"text-left",children:[d.jsx("span",{className:"text-xs font-medium",children:"Push results to destination"}),d.jsx("p",{className:"text-[9px] text-gray-500 mt-0.5",children:"Send extracted data to an external table after each run"})]}),d.jsx("div",{className:`w-8 h-4 rounded-full relative transition-colors flex-shrink-0 ${i.output?"bg-white":"bg-white/10"}`,children:d.jsx("div",{className:`absolute top-1 w-2 h-2 rounded-full transition-all ${i.output?"right-1 bg-black":"left-1 bg-white/20"}`})})]}),i.output&&d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx("label",{className:"text-[10px] font-bold text-gray-500 uppercase tracking-[0.2em]",children:"Provider"}),d.jsx("select",{value:i.output.provider,onChange:V=>l({output:{...i.output,provider:V.target.value,credentialId:"",tableId:""}}),className:"w-full bg-black/40 border border-white/5 rounded-lg px-3 py-2 text-xs text-white focus:outline-none focus:border-white/20",children:d.jsx("option",{value:"baserow",children:"Baserow"})})]}),d.jsxs("div",{className:"space-y-3",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("label",{className:"text-[10px] font-bold text-gray-500 uppercase tracking-[0.2em]",children:"Credential"}),d.jsxs("button",{onClick:()=>_(V=>!V),className:"text-[9px] font-bold text-gray-400 hover:text-white transition-colors flex items-center gap-1 focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50 rounded",children:[d.jsx(Ce,{name:"add",className:"text-xs"}),"New"]})]}),S&&d.jsxs("div",{className:"space-y-2 p-3 rounded-xl bg-black/40 border border-white/5",children:[d.jsx("input",{className:"w-full bg-black/40 border border-white/5 rounded-lg px-3 py-2 text-xs text-white placeholder-gray-600 focus:outline-none focus:border-white/20",placeholder:"Name (e.g. My Baserow)",value:v.name,onChange:V=>k(se=>({...se,name:V.target.value}))}),d.jsx("input",{className:"w-full bg-black/40 border border-white/5 rounded-lg px-3 py-2 text-xs text-white placeholder-gray-600 focus:outline-none focus:border-white/20",placeholder:"Base URL",value:v.baseUrl,onChange:V=>k(se=>({...se,baseUrl:V.target.value}))}),d.jsx("input",{className:"w-full bg-black/40 border border-white/5 rounded-lg px-3 py-2 text-xs text-white placeholder-gray-600 focus:outline-none focus:border-white/20",placeholder:"API Token",type:"password",value:v.token,onChange:V=>k(se=>({...se,token:V.target.value}))}),d.jsxs("div",{className:"flex gap-2",children:[d.jsx("button",{onClick:J,disabled:N||!v.name||!v.token,className:"flex-1 py-1.5 rounded-lg bg-white text-black text-[10px] font-bold disabled:opacity-40 transition-opacity focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-500",children:N?"Saving…":"Save"}),d.jsx("button",{onClick:()=>_(!1),className:"px-3 py-1.5 rounded-lg bg-white/5 text-gray-400 text-[10px] font-bold hover:text-white transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50",children:"Cancel"})]})]}),(()=>{const V=y.filter(se=>se.provider===i.output?.provider);return V.length===0&&!S?d.jsxs("p",{className:"text-[10px] text-gray-600",children:["No credentials yet. Click ",d.jsx("span",{className:"text-gray-400",children:"+ New"})," to add one."]}):d.jsxs("select",{value:i.output.credentialId,onChange:se=>l({output:{...i.output,credentialId:se.target.value}}),className:"w-full bg-black/40 border border-white/5 rounded-lg px-3 py-2 text-xs text-white focus:outline-none focus:border-white/20",children:[d.jsx("option",{value:"",children:"Select credential…"}),V.map(se=>d.jsx("option",{value:se.id,children:se.name},se.id))]})})(),y.filter(V=>V.provider===i.output?.provider).length>0&&d.jsx("div",{className:"space-y-1",children:y.filter(V=>V.provider===i.output?.provider).map(V=>d.jsxs("div",{className:"flex items-center justify-between px-3 py-1.5 rounded-lg bg-black/20 border border-white/5",children:[d.jsxs("div",{children:[d.jsx("span",{className:"text-[10px] text-white",children:V.name}),d.jsx("span",{className:"text-[9px] text-gray-600 ml-2",children:V.config.baseUrl})]}),d.jsx("button",{onClick:()=>ve(V.id),className:"text-gray-600 hover:text-red-400 transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50 rounded",children:d.jsx(Ce,{name:"delete",className:"text-sm"})})]},V.id))})]}),i.output.credentialId&&X&&d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"space-y-2",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("label",{className:"text-[10px] font-bold text-gray-500 uppercase tracking-[0.2em]",children:"Database"}),P&&d.jsx("div",{className:"w-3 h-3 border-2 border-white/20 border-t-white rounded-full animate-spin"})]}),d.jsxs("select",{value:i.output.databaseId||"",onChange:V=>l({output:{...i.output,databaseId:V.target.value,tableId:""}}),className:"w-full bg-black/40 border border-white/5 rounded-lg px-3 py-2 text-xs text-white focus:outline-none focus:border-white/20",disabled:P,children:[d.jsx("option",{value:"",children:"Select database…"}),D.map(V=>d.jsx("option",{value:V.id,children:V.name},V.id))]})]}),i.output.databaseId&&d.jsxs("div",{className:"space-y-2",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("label",{className:"text-[10px] font-bold text-gray-500 uppercase tracking-[0.2em]",children:"Table"}),W&&d.jsx("div",{className:"w-3 h-3 border-2 border-white/20 border-t-white rounded-full animate-spin"})]}),d.jsxs("select",{value:i.output.tableId,onChange:V=>l({output:{...i.output,tableId:V.target.value}}),className:"w-full bg-black/40 border border-white/5 rounded-lg px-3 py-2 text-xs text-white focus:outline-none focus:border-white/20",disabled:W,children:[d.jsx("option",{value:"",children:"Select table…"}),R.map(V=>d.jsx("option",{value:V.id,children:V.name},V.id))]})]})]}),i.output.credentialId&&!X&&d.jsxs("div",{className:"space-y-2",children:[d.jsx("label",{className:"text-[10px] font-bold text-gray-500 uppercase tracking-[0.2em]",children:"Table ID"}),d.jsx("input",{className:"w-full bg-black/40 border border-white/5 rounded-lg px-3 py-2 text-xs text-white placeholder-gray-600 focus:outline-none focus:border-white/20",placeholder:"e.g. 1234",value:i.output.tableId,onChange:V=>l({output:{...i.output,tableId:V.target.value}})}),d.jsxs("p",{className:"text-[9px] text-gray-600",children:["Your token doesn't support browsing. Use a ",d.jsx("span",{className:"text-gray-400",children:"Personal API Token"})," for dropdowns, or enter the Table ID from the Baserow URL."]})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx("label",{className:"text-[10px] font-bold text-gray-500 uppercase tracking-[0.2em]",children:"On Push Error"}),d.jsx("div",{className:"flex gap-2",children:["ignore","fail"].map(V=>d.jsx("button",{onClick:()=>l({output:{...i.output,onError:V}}),className:`flex-1 py-2 rounded-lg text-[10px] font-bold uppercase tracking-widest transition-all focus:outline-none focus-visible:ring-2 ${i.output?.onError===V?"bg-white text-black focus-visible:ring-blue-500":"bg-white/5 text-gray-500 hover:text-white focus-visible:ring-white/50"}`,children:V==="ignore"?"Ignore":"Log Error"},V))}),d.jsx("p",{className:"text-[9px] text-gray-600",children:i.output.onError==="fail"?"Push errors will be logged prominently in the server console.":"Push errors will be silently suppressed."})]})]})]}),x==="schedule"&&d.jsx(Qw,{currentTask:i,onUpdateTask:l}),x==="history"&&d.jsxs("div",{className:"space-y-6 animate-in fade-in slide-in-from-bottom-2 duration-300",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("label",{className:"text-[10px] font-bold text-gray-500 uppercase tracking-[0.2em]",children:"Version History"}),h&&d.jsx("div",{className:"w-3 h-3 border-2 border-white/20 border-t-white rounded-full animate-spin"})]}),d.jsxs("div",{className:"space-y-2",children:[f.map(V=>d.jsxs("div",{className:"bg-white/5 border border-white/10 rounded-2xl p-4 flex items-center justify-between group hover:border-white/20 transition-all",children:[d.jsxs("div",{className:"flex flex-col gap-1",children:[d.jsx("div",{className:"text-xs font-bold text-white mb-0.5",children:new Date(V.timestamp).toLocaleString()}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:"text-[9px] px-1.5 py-0.5 rounded bg-white/10 text-gray-400 font-bold uppercase tracking-widest",children:V.mode}),d.jsx("span",{className:"text-[9px] text-gray-600 truncate max-w-[150px]",children:V.name||"Untitled"})]})]}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("button",{onClick:()=>b(V.id),className:"w-8 h-8 rounded-lg flex items-center justify-center text-white/30 hover:text-white hover:bg-white/10 transition-all focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50",title:"Preview version","aria-label":"Preview version",children:d.jsx(Ce,{name:"visibility",className:"text-sm"})}),d.jsx("button",{onClick:()=>p(V.id),className:"w-8 h-8 rounded-lg flex items-center justify-center text-white/30 hover:text-white hover:bg-white/10 transition-all focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50",title:"Rollback to this version","aria-label":"Rollback to this version",children:d.jsx(Ce,{name:"restore",className:"text-sm"})})]})]},V.id)),f.length===0&&!h&&d.jsx("div",{className:"text-center py-12 border border-dashed border-white/10 rounded-3xl",children:d.jsx("p",{className:"text-[10px] text-gray-600 uppercase tracking-widest",children:"No previous versions found"})})]})]})]})]})]})},Ww=()=>{const[t,r]=T.useState({x:0,y:0}),[i,l]=T.useState(1),o=T.useRef(!1),u=T.useRef({x:0,y:0,offsetX:0,offsetY:0}),c=T.useRef(!1),f=T.useRef(null),h=T.useRef(!1),p=T.useRef(i);T.useEffect(()=>{p.current=i},[i]),T.useEffect(()=>{if(h.current)return;h.current=!0;const y=f.current;if(!y)return;const j=y.clientWidth;r({x:(j-400)/2,y:20})},[]),T.useEffect(()=>{const y=f.current;if(!y)return;const j=v=>{if(v.preventDefault(),v.ctrlKey||v.metaKey){const k=y.getBoundingClientRect(),S=v.clientX-k.left,_=v.clientY-k.top,N=p.current,B=v.deltaY<0?1.1:.9,D=Math.min(2,Math.max(.25,N*B)),z=D/N;r(R=>({x:S-z*(S-R.x),y:_-z*(_-R.y)})),l(D)}else r(k=>({x:k.x-v.deltaX,y:k.y-v.deltaY}))};return y.addEventListener("wheel",j,{passive:!1}),()=>y.removeEventListener("wheel",j)},[]);const b=T.useCallback(y=>{o.current=!0,u.current={x:y.clientX,y:y.clientY,offsetX:t.x,offsetY:t.y},y.target.setPointerCapture?.(y.pointerId)},[t]),x=T.useCallback(y=>{if(!o.current)return;const j=y.clientX-u.current.x,v=y.clientY-u.current.y;r({x:u.current.offsetX+j,y:u.current.offsetY+v})},[]),w=T.useCallback(()=>{o.current=!1},[]);return{canvasOffset:t,setCanvasOffset:r,canvasScale:i,setCanvasScale:l,canvasViewportRef:f,spaceHeldRef:c,isPanning:o,startPanning:b,handlePanning:x,stopPanning:w}},e1=(t,r,i)=>{const l=T.useRef([]),o=T.useRef(-1),u=T.useRef(!1),c=T.useRef("");T.useEffect(()=>{if(u.current){u.current=!1;return}const p=JSON.stringify(t);if(p===c.current)return;const b=setTimeout(()=>{c.current=p,o.current<l.current.length-1&&(l.current=l.current.slice(0,o.current+1)),l.current.push(JSON.parse(p)),o.current=l.current.length-1,l.current.length>50&&(l.current.shift(),o.current-=1)},300);return()=>clearTimeout(b)},[t]);const f=T.useCallback(()=>{if(o.current>0){o.current-=1;const p=l.current[o.current];u.current=!0,c.current=JSON.stringify(p),r(p),i(p,!1)}},[r,i]),h=T.useCallback(()=>{if(o.current<l.current.length-1){o.current+=1;const p=l.current[o.current];u.current=!0,c.current=JSON.stringify(p),r(p),i(p,!1)}},[r,i]);return T.useEffect(()=>{const p=b=>{const x=document.activeElement;if(x){const y=x.tagName.toLowerCase(),j=x.getAttribute("contenteditable")==="true";if(y==="input"||y==="textarea"||j)return}const w=b.metaKey||b.ctrlKey;w&&b.key.toLowerCase()==="z"?(b.preventDefault(),b.shiftKey?h():f()):w&&!b.shiftKey&&b.key.toLowerCase()==="y"&&(b.preventDefault(),h())};return window.addEventListener("keydown",p),()=>window.removeEventListener("keydown",p)},[f,h]),{undo:f,redo:h}},t1=(t,r,i)=>{const[l,o]=T.useState(new Set),[u,c]=T.useState(null),[f,h]=T.useState(null),p=T.useRef(null),b=T.useCallback((k,S,_=!1)=>{r(_?N=>{if(!N)return null;const B={...N,actions:N.actions.map(D=>D.id===k?{...D,...S}:D)};return i(B,!1),B}:N=>N?{...N,actions:N.actions.map(B=>B.id===k?{...B,...S}:B)}:null)},[r,i]),x=T.useCallback((k,S)=>{k!==S&&r(_=>{if(!_)return null;const N=[..._.actions],B=N.findIndex(G=>G.id===k),D=N.findIndex(G=>G.id===S);if(B===-1||D===-1)return _;const[z]=N.splice(B,1);N.splice(D,0,z);const R={..._,actions:N};return i(R,!1),R})},[r,i]),w=T.useCallback(k=>{r(S=>{if(!S)return null;const _={...S,actions:S.actions.filter(N=>N.id!==k)};return i(_,!1),_})},[r,i]),y=T.useCallback((k,S,_,N)=>{if(_!==void 0&&N!==void 0&&Math.abs(k-N)<14)return _;const B=t.actions;let D=B.length-1;for(let z=0;z<B.length;z++){if(B[z].id===S)continue;const R=document.getElementById(`action-${B[z].id}`);if(!R)continue;const G=R.getBoundingClientRect(),P=G.top+G.height*.4;if(k<P){D=z;break}}return D},[t.actions]),j=T.useCallback(()=>{if(u){if(f!==null&&f!==u.index){const k=t.actions[f]?.id;k&&x(u.id,k)}c(null),h(null),p.current=null}},[u,f,t.actions,x]),v=T.useCallback((k,S,_)=>{if(k.shiftKey||k.ctrlKey||k.metaKey){o(D=>{const z=new Set(D);return z.has(S)?z.delete(S):z.add(S),z});return}o(new Set([S]));const N=document.getElementById(`action-${S}`);if(!N)return;const B=N.getBoundingClientRect();p.current=k.pointerId,c({id:S,startY:k.clientY,currentY:k.clientY,height:B.height,index:_,originTop:B.top,pointerOffset:k.clientY-B.top}),h(_)},[]);return T.useEffect(()=>{if(!u)return;const k=_=>{if(p.current!==null&&_.pointerId!==p.current)return;const N=u.originTop+u.height/2,B=y(_.clientY,u.id,u.index,N);c(D=>D&&{...D,currentY:_.clientY}),h(B)},S=_=>{p.current!==null&&_.pointerId!==p.current||j()};return window.addEventListener("pointermove",k),window.addEventListener("pointerup",S),window.addEventListener("pointercancel",S),()=>{window.removeEventListener("pointermove",k),window.removeEventListener("pointerup",S),window.removeEventListener("pointercancel",S)}},[u,y,j]),{selectedActionIds:l,setSelectedActionIds:o,dragState:u,dragOverIndex:f,updateAction:b,moveAction:x,removeAction:w,handleActionPointerDown:v}},n1=(t,r,i,l)=>{const[o,u]=T.useState([]),[c,f]=T.useState(!1),[h,p]=T.useState(null),b=T.useCallback(async()=>{if(t.id){f(!0);try{const y=await fetch(`/api/tasks/${t.id}/versions`);if(!y.ok)throw new Error("Failed to load versions");const j=await y.json();u(Array.isArray(j.versions)?j.versions:[])}catch{u([])}finally{f(!1)}}},[t.id]),x=T.useCallback(async y=>{if(!(!t.id||!await i("Rollback to this version? Current changes will be saved as a new version.")))try{const v=await fetch(`/api/tasks/${t.id}/rollback`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({versionId:y})});if(!v.ok)throw new Error("Rollback failed");const k=await v.json();l(k),r("Rolled back to selected version.","success"),b()}catch{r("Rollback failed.","error")}},[t.id,i,r,l,b]),w=T.useCallback(async y=>{if(t.id)try{const j=await fetch(`/api/tasks/${t.id}/versions/${y}`);if(!j.ok)throw new Error("Failed to load version");const v=await j.json();if(!v?.snapshot)throw new Error("Missing snapshot");p({id:v.metadata?.id||y,timestamp:v.metadata?.timestamp||Date.now(),snapshot:v.snapshot})}catch{r("Failed to load version snapshot.","error")}},[t.id,r]);return{versions:o,versionsLoading:c,versionPreview:h,setVersionPreview:p,loadVersions:b,rollbackToVersion:x,openVersionPreview:w}},i1=(t,r,i,l,o)=>{const[u,c]=T.useState(!1),[f,h]=T.useState(!1),[p,b]=T.useState(null),[x,w]=T.useState({}),y=T.useRef(null);T.useEffect(()=>{y.current=p},[p]);const j=T.useRef(o);T.useEffect(()=>{j.current=o},[o]),T.useEffect(()=>{r?y.current&&c(!0):(c(!1),h(!1))},[r]),T.useEffect(()=>{let k=null;return r&&(k=new EventSource("/api/headful/selector_stream"),k.onmessage=S=>{try{const _=JSON.parse(S.data),N=y.current;if(_.selector&&N){try{const B=JSON.parse(_.selector);Array.isArray(B)&&B.length>0?(w(D=>({...D,[N]:B})),i(N,{selector:B[0]},!0)):i(N,{selector:_.selector},!0)}catch{i(N,{selector:_.selector},!0)}b(null),j.current?.()}}catch{}}),()=>{k&&k.close()}},[r,i]);const v=T.useCallback(async()=>{const k=!u;h(!0);try{if(!(await fetch("/api/headful/inspect",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({enabled:k})})).ok)throw new Error("Failed to toggle inspect mode");c(k),l(`Inspect mode ${k?"enabled":"disabled"}`,"success")}catch{l("Failed to toggle inspect mode","error")}finally{h(!1)}},[u,l]);return{isInspectMode:u,isInspectLoading:f,activeInspectActionId:p,setActiveInspectActionId:b,selectorOptionsById:x,handleToggleInspect:v}},a1=()=>{const[t,r]=T.useState([]),[i,l]=T.useState(!1);return T.useEffect(()=>{let o=!1;return(async()=>{try{const c=await fetch("/api/settings/proxies",{credentials:"include"});if(!c.ok)throw new Error("Failed to load proxies");const f=await c.json();if(o)return;r(Array.isArray(f.proxies)?f.proxies:[])}catch{o||r([])}finally{o||l(!0)}})(),()=>{o=!0}},[]),{proxyList:t,proxyListLoaded:i}},r1=({currentTask:t,onUpdateTaskName:r,onAutoSave:i,onOpenHistory:l})=>d.jsx("div",{className:"fixed top-0 left-0 right-0 z-40 w-full pointer-events-none",children:d.jsxs("div",{className:"glass-card flex items-center justify-between p-1 px-6 border-b border-white/10 backdrop-blur-xl pointer-events-auto",children:[d.jsx("div",{className:"flex-1 overflow-hidden flex justify-center",children:d.jsx("input",{type:"text",value:t.name||"",onChange:o=>r(o.target.value),onBlur:()=>i(),placeholder:"Task name",className:"bg-transparent border-none text-[11px] font-bold text-white uppercase tracking-[0.25em] focus:outline-none w-full max-w-[400px] text-center placeholder:text-white/20 py-1"})}),d.jsx("div",{className:"flex items-center gap-1",children:d.jsx("button",{onClick:l,className:"w-8 h-8 rounded-lg flex items-center justify-center text-white/30 hover:text-white hover:bg-white/5 transition-all focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50",title:"Version History","aria-label":"Version History",children:d.jsx(Ce,{name:"history",className:"text-base"})})})]})}),l1=({isExecuting:t,isHeadfulOpen:r,onRun:i,onStop:l,onOpenHeadful:o,onStopHeadful:u})=>d.jsxs("div",{className:"fixed bottom-8 left-1/2 -translate-x-1/2 z-50 flex items-center gap-3 bg-[#111] border border-white/10 p-2 rounded-3xl shadow-2xl backdrop-blur-xl",children:[d.jsxs("button",{onClick:i,disabled:t||r,className:"shine-effect bg-white text-black px-8 py-4 rounded-2xl font-bold text-[10px] tracking-[0.3em] uppercase transition-all shadow-xl shadow-white/5 flex items-center justify-center gap-3 disabled:opacity-50 disabled:cursor-not-allowed min-w-[200px] focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-500",children:[t?d.jsx("div",{className:"w-3 h-3 border-2 border-black/20 border-t-black rounded-full animate-spin"}):d.jsx(Ce,{name:"play_arrow",className:"text-sm text-black"}),d.jsx("span",{children:t?"Running...":"Run Task"})]}),t&&d.jsx("button",{onClick:()=>l?.(),className:"w-12 h-12 rounded-2xl border border-white/10 text-white/80 hover:text-white hover:bg-white/10 transition-all flex items-center justify-center",title:"Stop task","aria-label":"Stop task",children:d.jsx(Ce,{name:"stop",className:"text-base"})}),d.jsxs("button",{onClick:()=>{r?u?.():o()},disabled:t,className:`px-4 h-12 rounded-2xl border text-[9px] font-bold uppercase tracking-widest transition-all flex items-center gap-2 disabled:opacity-30 disabled:cursor-not-allowed ${r?"border-blue-500/30 bg-blue-500/20 text-blue-400 hover:bg-blue-500/30":"border-white/10 text-white/80 hover:text-white hover:bg-white/10"}`,title:r?"Stop headful browser":"Open browser to log in",children:[d.jsx(Ce,{name:r?"stop":"open_in_browser",className:"text-base"}),r?"Close Browser":"Open Browser"]})]});function id(){return id=Object.assign?Object.assign.bind():function(t){for(var r=1;r<arguments.length;r++){var i=arguments[r];for(var l in i)({}).hasOwnProperty.call(i,l)&&(t[l]=i[l])}return t},id.apply(null,arguments)}function Zm(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function ad(t,r){return ad=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,l){return i.__proto__=l,i},ad(t,r)}function s1(t,r){t.prototype=Object.create(r.prototype),t.prototype.constructor=t,ad(t,r)}var Qm=Number.isNaN||function(r){return typeof r=="number"&&r!==r};function o1(t,r){return!!(t===r||Qm(t)&&Qm(r))}function u1(t,r){if(t.length!==r.length)return!1;for(var i=0;i<t.length;i++)if(!o1(t[i],r[i]))return!1;return!0}function zc(t,r){r===void 0&&(r=u1);var i,l=[],o,u=!1;function c(){for(var f=[],h=0;h<arguments.length;h++)f[h]=arguments[h];return u&&i===this&&r(f,l)||(o=t.apply(this,f),u=!0,i=this,l=f),o}return c}var c1=typeof performance=="object"&&typeof performance.now=="function",Jm=c1?function(){return performance.now()}:function(){return Date.now()};function Wm(t){cancelAnimationFrame(t.id)}function d1(t,r){var i=Jm();function l(){Jm()-i>=r?t.call(null):o.id=requestAnimationFrame(l)}var o={id:requestAnimationFrame(l)};return o}var Tc=-1;function eg(t){if(t===void 0&&(t=!1),Tc===-1||t){var r=document.createElement("div"),i=r.style;i.width="50px",i.height="50px",i.overflow="scroll",document.body.appendChild(r),Tc=r.offsetWidth-r.clientWidth,document.body.removeChild(r)}return Tc}var Ga=null;function tg(t){if(t===void 0&&(t=!1),Ga===null||t){var r=document.createElement("div"),i=r.style;i.width="50px",i.height="50px",i.overflow="scroll",i.direction="rtl";var l=document.createElement("div"),o=l.style;return o.width="100px",o.height="100px",r.appendChild(l),document.body.appendChild(r),r.scrollLeft>0?Ga="positive-descending":(r.scrollLeft=1,r.scrollLeft===0?Ga="negative":Ga="positive-ascending"),document.body.removeChild(r),Ga}return Ga}var f1=150,h1=function(r,i){return r};function p1(t){var r,i=t.getItemOffset,l=t.getEstimatedTotalSize,o=t.getItemSize,u=t.getOffsetForIndexAndAlignment,c=t.getStartIndexForOffset,f=t.getStopIndexForStartIndex,h=t.initInstanceProps,p=t.shouldResetStyleCacheOnItemSizeChange,b=t.validateProps;return r=(function(x){s1(w,x);function w(j){var v;return v=x.call(this,j)||this,v._instanceProps=h(v.props,Zm(v)),v._outerRef=void 0,v._resetIsScrollingTimeoutId=null,v.state={instance:Zm(v),isScrolling:!1,scrollDirection:"forward",scrollOffset:typeof v.props.initialScrollOffset=="number"?v.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},v._callOnItemsRendered=void 0,v._callOnItemsRendered=zc(function(k,S,_,N){return v.props.onItemsRendered({overscanStartIndex:k,overscanStopIndex:S,visibleStartIndex:_,visibleStopIndex:N})}),v._callOnScroll=void 0,v._callOnScroll=zc(function(k,S,_){return v.props.onScroll({scrollDirection:k,scrollOffset:S,scrollUpdateWasRequested:_})}),v._getItemStyle=void 0,v._getItemStyle=function(k){var S=v.props,_=S.direction,N=S.itemSize,B=S.layout,D=v._getItemStyleCache(p&&N,p&&B,p&&_),z;if(D.hasOwnProperty(k))z=D[k];else{var R=i(v.props,k,v._instanceProps),G=o(v.props,k,v._instanceProps),P=_==="horizontal"||B==="horizontal",q=_==="rtl",W=P?R:0;D[k]=z={position:"absolute",left:q?void 0:W,right:q?W:void 0,top:P?0:R,height:P?"100%":G,width:P?G:"100%"}}return z},v._getItemStyleCache=void 0,v._getItemStyleCache=zc(function(k,S,_){return{}}),v._onScrollHorizontal=function(k){var S=k.currentTarget,_=S.clientWidth,N=S.scrollLeft,B=S.scrollWidth;v.setState(function(D){if(D.scrollOffset===N)return null;var z=v.props.direction,R=N;if(z==="rtl")switch(tg()){case"negative":R=-N;break;case"positive-descending":R=B-_-N;break}return R=Math.max(0,Math.min(R,B-_)),{isScrolling:!0,scrollDirection:D.scrollOffset<R?"forward":"backward",scrollOffset:R,scrollUpdateWasRequested:!1}},v._resetIsScrollingDebounced)},v._onScrollVertical=function(k){var S=k.currentTarget,_=S.clientHeight,N=S.scrollHeight,B=S.scrollTop;v.setState(function(D){if(D.scrollOffset===B)return null;var z=Math.max(0,Math.min(B,N-_));return{isScrolling:!0,scrollDirection:D.scrollOffset<z?"forward":"backward",scrollOffset:z,scrollUpdateWasRequested:!1}},v._resetIsScrollingDebounced)},v._outerRefSetter=function(k){var S=v.props.outerRef;v._outerRef=k,typeof S=="function"?S(k):S!=null&&typeof S=="object"&&S.hasOwnProperty("current")&&(S.current=k)},v._resetIsScrollingDebounced=function(){v._resetIsScrollingTimeoutId!==null&&Wm(v._resetIsScrollingTimeoutId),v._resetIsScrollingTimeoutId=d1(v._resetIsScrolling,f1)},v._resetIsScrolling=function(){v._resetIsScrollingTimeoutId=null,v.setState({isScrolling:!1},function(){v._getItemStyleCache(-1,null)})},v}w.getDerivedStateFromProps=function(v,k){return m1(v,k),b(v),null};var y=w.prototype;return y.scrollTo=function(v){v=Math.max(0,v),this.setState(function(k){return k.scrollOffset===v?null:{scrollDirection:k.scrollOffset<v?"forward":"backward",scrollOffset:v,scrollUpdateWasRequested:!0}},this._resetIsScrollingDebounced)},y.scrollToItem=function(v,k){k===void 0&&(k="auto");var S=this.props,_=S.itemCount,N=S.layout,B=this.state.scrollOffset;v=Math.max(0,Math.min(v,_-1));var D=0;if(this._outerRef){var z=this._outerRef;N==="vertical"?D=z.scrollWidth>z.clientWidth?eg():0:D=z.scrollHeight>z.clientHeight?eg():0}this.scrollTo(u(this.props,v,k,B,this._instanceProps,D))},y.componentDidMount=function(){var v=this.props,k=v.direction,S=v.initialScrollOffset,_=v.layout;if(typeof S=="number"&&this._outerRef!=null){var N=this._outerRef;k==="horizontal"||_==="horizontal"?N.scrollLeft=S:N.scrollTop=S}this._callPropsCallbacks()},y.componentDidUpdate=function(){var v=this.props,k=v.direction,S=v.layout,_=this.state,N=_.scrollOffset,B=_.scrollUpdateWasRequested;if(B&&this._outerRef!=null){var D=this._outerRef;if(k==="horizontal"||S==="horizontal")if(k==="rtl")switch(tg()){case"negative":D.scrollLeft=-N;break;case"positive-ascending":D.scrollLeft=N;break;default:var z=D.clientWidth,R=D.scrollWidth;D.scrollLeft=R-z-N;break}else D.scrollLeft=N;else D.scrollTop=N}this._callPropsCallbacks()},y.componentWillUnmount=function(){this._resetIsScrollingTimeoutId!==null&&Wm(this._resetIsScrollingTimeoutId)},y.render=function(){var v=this.props,k=v.children,S=v.className,_=v.direction,N=v.height,B=v.innerRef,D=v.innerElementType,z=v.innerTagName,R=v.itemCount,G=v.itemData,P=v.itemKey,q=P===void 0?h1:P,W=v.layout,I=v.outerElementType,X=v.outerTagName,E=v.style,Q=v.useIsScrolling,$=v.width,J=this.state.isScrolling,ve=_==="horizontal"||W==="horizontal",ee=ve?this._onScrollHorizontal:this._onScrollVertical,L=this._getRangeToRender(),O=L[0],H=L[1],M=[];if(R>0)for(var ie=O;ie<=H;ie++)M.push(T.createElement(k,{data:G,key:q(ie,G),index:ie,isScrolling:Q?J:void 0,style:this._getItemStyle(ie)}));var V=l(this.props,this._instanceProps);return T.createElement(I||X||"div",{className:S,onScroll:ee,ref:this._outerRefSetter,style:id({position:"relative",height:N,width:$,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:_},E)},T.createElement(D||z||"div",{children:M,ref:B,style:{height:ve?"100%":V,pointerEvents:J?"none":void 0,width:ve?V:"100%"}}))},y._callPropsCallbacks=function(){if(typeof this.props.onItemsRendered=="function"){var v=this.props.itemCount;if(v>0){var k=this._getRangeToRender(),S=k[0],_=k[1],N=k[2],B=k[3];this._callOnItemsRendered(S,_,N,B)}}if(typeof this.props.onScroll=="function"){var D=this.state,z=D.scrollDirection,R=D.scrollOffset,G=D.scrollUpdateWasRequested;this._callOnScroll(z,R,G)}},y._getRangeToRender=function(){var v=this.props,k=v.itemCount,S=v.overscanCount,_=this.state,N=_.isScrolling,B=_.scrollDirection,D=_.scrollOffset;if(k===0)return[0,0,0,0];var z=c(this.props,D,this._instanceProps),R=f(this.props,z,D,this._instanceProps),G=!N||B==="backward"?Math.max(1,S):1,P=!N||B==="forward"?Math.max(1,S):1;return[Math.max(0,z-G),Math.max(0,Math.min(k-1,R+P)),z,R]},w})(T.PureComponent),r.defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},r}var m1=function(r,i){r.children,r.direction,r.height,r.layout,r.innerTagName,r.outerTagName,r.width,i.instance},io=p1({getItemOffset:function(r,i){var l=r.itemSize;return i*l},getItemSize:function(r,i){var l=r.itemSize;return l},getEstimatedTotalSize:function(r){var i=r.itemCount,l=r.itemSize;return l*i},getOffsetForIndexAndAlignment:function(r,i,l,o,u,c){var f=r.direction,h=r.height,p=r.itemCount,b=r.itemSize,x=r.layout,w=r.width,y=f==="horizontal"||x==="horizontal",j=y?w:h,v=Math.max(0,p*b-j),k=Math.min(v,i*b),S=Math.max(0,i*b-j+b+c);switch(l==="smart"&&(o>=S-j&&o<=k+j?l="auto":l="center"),l){case"start":return k;case"end":return S;case"center":{var _=Math.round(S+(k-S)/2);return _<Math.ceil(j/2)?0:_>v+Math.floor(j/2)?v:_}default:return o>=S&&o<=k?o:o<S?S:k}},getStartIndexForOffset:function(r,i){var l=r.itemCount,o=r.itemSize;return Math.max(0,Math.min(l-1,Math.floor(i/o)))},getStopIndexForStartIndex:function(r,i,l){var o=r.direction,u=r.height,c=r.itemCount,f=r.itemSize,h=r.layout,p=r.width,b=o==="horizontal"||h==="horizontal",x=i*f,w=b?p:u,y=Math.ceil((w+l-x)/f);return Math.max(0,Math.min(c-1,i+y-1))},initInstanceProps:function(r){},shouldResetStyleCacheOnItemSizeChange:!0,validateProps:function(r){r.itemSize}});const g1=(t,r=2)=>{if(t===0)return"0 B";const i=1024,l=r<0?0:r,o=["B","KB","MB","GB","TB","PB","EB","ZB","YB"],u=Math.floor(Math.log(t)/Math.log(i));return parseFloat((t/Math.pow(i,u)).toFixed(l))+" "+o[u]},x1=({capture:t,onDelete:r})=>{const i=new URL(t.url,window.location.origin).toString();return d.jsxs("div",{className:"rounded-2xl border border-white/10 bg-white/[0.02] overflow-hidden",children:[d.jsxs("div",{className:"p-3 border-b border-white/10 flex items-center justify-between",children:[d.jsx("div",{className:"text-[9px] font-bold text-white uppercase tracking-widest",children:t.type==="recording"?"Recording":"Screenshot"}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(ol,{text:i,title:"Copy URL",className:"p-1.5 rounded-lg text-white/50 hover:text-white hover:bg-white/10 transition-all",iconClassName:"text-sm"}),d.jsx("a",{href:t.url,target:"_blank",rel:"noreferrer",className:"text-[9px] font-bold uppercase tracking-widest text-blue-300 hover:text-blue-200 rounded focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50",children:"Open"}),r&&d.jsx("button",{onClick:()=>r(t.name),className:"text-[9px] font-bold uppercase tracking-widest text-red-300 hover:text-red-200 rounded focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50",children:"Delete"})]})]}),d.jsx("div",{className:"bg-black relative group",children:t.type==="recording"?d.jsx("video",{src:t.url,controls:!0,className:"w-full h-64 object-contain bg-black"}):d.jsx("img",{src:t.url,className:"w-full h-64 object-contain bg-black",alt:`Screenshot of ${t.name}`})}),d.jsxs("div",{className:"p-3 border-t border-white/5 bg-white/[0.01]",children:[d.jsx("div",{className:"text-[9px] text-white font-bold uppercase tracking-widest truncate",title:t.name,children:t.name}),d.jsxs("div",{className:"flex items-center justify-between mt-1 text-[8px] text-gray-500 uppercase tracking-widest",children:[d.jsx("span",{children:g1(t.size)}),d.jsx("span",{children:new Date(t.modified).toLocaleDateString()})]})]})]})},Ax=ft.memo(x1);function Ds(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Rc={exports:{}};var ng;function b1(){return ng||(ng=1,(function(t,r){(function(i){t.exports=i()})(function(){return(function i(l,o,u){function c(p,b){if(!o[p]){if(!l[p]){var x=typeof Ds=="function"&&Ds;if(!b&&x)return x(p,!0);if(f)return f(p,!0);var w=new Error("Cannot find module '"+p+"'");throw w.code="MODULE_NOT_FOUND",w}var y=o[p]={exports:{}};l[p][0].call(y.exports,function(j){var v=l[p][1][j];return c(v||j)},y,y.exports,i,l,o,u)}return o[p].exports}for(var f=typeof Ds=="function"&&Ds,h=0;h<u.length;h++)c(u[h]);return c})({1:[function(i,l,o){var u=i("./utils"),c=i("./support"),f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";o.encode=function(h){for(var p,b,x,w,y,j,v,k=[],S=0,_=h.length,N=_,B=u.getTypeOf(h)!=="string";S<h.length;)N=_-S,x=B?(p=h[S++],b=S<_?h[S++]:0,S<_?h[S++]:0):(p=h.charCodeAt(S++),b=S<_?h.charCodeAt(S++):0,S<_?h.charCodeAt(S++):0),w=p>>2,y=(3&p)<<4|b>>4,j=1<N?(15&b)<<2|x>>6:64,v=2<N?63&x:64,k.push(f.charAt(w)+f.charAt(y)+f.charAt(j)+f.charAt(v));return k.join("")},o.decode=function(h){var p,b,x,w,y,j,v=0,k=0,S="data:";if(h.substr(0,S.length)===S)throw new Error("Invalid base64 input, it looks like a data url.");var _,N=3*(h=h.replace(/[^A-Za-z0-9+/=]/g,"")).length/4;if(h.charAt(h.length-1)===f.charAt(64)&&N--,h.charAt(h.length-2)===f.charAt(64)&&N--,N%1!=0)throw new Error("Invalid base64 input, bad content length.");for(_=c.uint8array?new Uint8Array(0|N):new Array(0|N);v<h.length;)p=f.indexOf(h.charAt(v++))<<2|(w=f.indexOf(h.charAt(v++)))>>4,b=(15&w)<<4|(y=f.indexOf(h.charAt(v++)))>>2,x=(3&y)<<6|(j=f.indexOf(h.charAt(v++))),_[k++]=p,y!==64&&(_[k++]=b),j!==64&&(_[k++]=x);return _}},{"./support":30,"./utils":32}],2:[function(i,l,o){var u=i("./external"),c=i("./stream/DataWorker"),f=i("./stream/Crc32Probe"),h=i("./stream/DataLengthProbe");function p(b,x,w,y,j){this.compressedSize=b,this.uncompressedSize=x,this.crc32=w,this.compression=y,this.compressedContent=j}p.prototype={getContentWorker:function(){var b=new c(u.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new h("data_length")),x=this;return b.on("end",function(){if(this.streamInfo.data_length!==x.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),b},getCompressedWorker:function(){return new c(u.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},p.createWorkerFrom=function(b,x,w){return b.pipe(new f).pipe(new h("uncompressedSize")).pipe(x.compressWorker(w)).pipe(new h("compressedSize")).withStreamInfo("compression",x)},l.exports=p},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(i,l,o){var u=i("./stream/GenericWorker");o.STORE={magic:"\0\0",compressWorker:function(){return new u("STORE compression")},uncompressWorker:function(){return new u("STORE decompression")}},o.DEFLATE=i("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(i,l,o){var u=i("./utils"),c=(function(){for(var f,h=[],p=0;p<256;p++){f=p;for(var b=0;b<8;b++)f=1&f?3988292384^f>>>1:f>>>1;h[p]=f}return h})();l.exports=function(f,h){return f!==void 0&&f.length?u.getTypeOf(f)!=="string"?(function(p,b,x,w){var y=c,j=w+x;p^=-1;for(var v=w;v<j;v++)p=p>>>8^y[255&(p^b[v])];return-1^p})(0|h,f,f.length,0):(function(p,b,x,w){var y=c,j=w+x;p^=-1;for(var v=w;v<j;v++)p=p>>>8^y[255&(p^b.charCodeAt(v))];return-1^p})(0|h,f,f.length,0):0}},{"./utils":32}],5:[function(i,l,o){o.base64=!1,o.binary=!1,o.dir=!1,o.createFolders=!0,o.date=null,o.compression=null,o.compressionOptions=null,o.comment=null,o.unixPermissions=null,o.dosPermissions=null},{}],6:[function(i,l,o){var u=null;u=typeof Promise<"u"?Promise:i("lie"),l.exports={Promise:u}},{lie:37}],7:[function(i,l,o){var u=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",c=i("pako"),f=i("./utils"),h=i("./stream/GenericWorker"),p=u?"uint8array":"array";function b(x,w){h.call(this,"FlateWorker/"+x),this._pako=null,this._pakoAction=x,this._pakoOptions=w,this.meta={}}o.magic="\b\0",f.inherits(b,h),b.prototype.processChunk=function(x){this.meta=x.meta,this._pako===null&&this._createPako(),this._pako.push(f.transformTo(p,x.data),!1)},b.prototype.flush=function(){h.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},b.prototype.cleanUp=function(){h.prototype.cleanUp.call(this),this._pako=null},b.prototype._createPako=function(){this._pako=new c[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var x=this;this._pako.onData=function(w){x.push({data:w,meta:x.meta})}},o.compressWorker=function(x){return new b("Deflate",x)},o.uncompressWorker=function(){return new b("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(i,l,o){function u(y,j){var v,k="";for(v=0;v<j;v++)k+=String.fromCharCode(255&y),y>>>=8;return k}function c(y,j,v,k,S,_){var N,B,D=y.file,z=y.compression,R=_!==p.utf8encode,G=f.transformTo("string",_(D.name)),P=f.transformTo("string",p.utf8encode(D.name)),q=D.comment,W=f.transformTo("string",_(q)),I=f.transformTo("string",p.utf8encode(q)),X=P.length!==D.name.length,E=I.length!==q.length,Q="",$="",J="",ve=D.dir,ee=D.date,L={crc32:0,compressedSize:0,uncompressedSize:0};j&&!v||(L.crc32=y.crc32,L.compressedSize=y.compressedSize,L.uncompressedSize=y.uncompressedSize);var O=0;j&&(O|=8),R||!X&&!E||(O|=2048);var H=0,M=0;ve&&(H|=16),S==="UNIX"?(M=798,H|=(function(V,se){var ze=V;return V||(ze=se?16893:33204),(65535&ze)<<16})(D.unixPermissions,ve)):(M=20,H|=(function(V){return 63&(V||0)})(D.dosPermissions)),N=ee.getUTCHours(),N<<=6,N|=ee.getUTCMinutes(),N<<=5,N|=ee.getUTCSeconds()/2,B=ee.getUTCFullYear()-1980,B<<=4,B|=ee.getUTCMonth()+1,B<<=5,B|=ee.getUTCDate(),X&&($=u(1,1)+u(b(G),4)+P,Q+="up"+u($.length,2)+$),E&&(J=u(1,1)+u(b(W),4)+I,Q+="uc"+u(J.length,2)+J);var ie="";return ie+=`
12
- \0`,ie+=u(O,2),ie+=z.magic,ie+=u(N,2),ie+=u(B,2),ie+=u(L.crc32,4),ie+=u(L.compressedSize,4),ie+=u(L.uncompressedSize,4),ie+=u(G.length,2),ie+=u(Q.length,2),{fileRecord:x.LOCAL_FILE_HEADER+ie+G+Q,dirRecord:x.CENTRAL_FILE_HEADER+u(M,2)+ie+u(W.length,2)+"\0\0\0\0"+u(H,4)+u(k,4)+G+Q+W}}var f=i("../utils"),h=i("../stream/GenericWorker"),p=i("../utf8"),b=i("../crc32"),x=i("../signature");function w(y,j,v,k){h.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=j,this.zipPlatform=v,this.encodeFileName=k,this.streamFiles=y,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}f.inherits(w,h),w.prototype.push=function(y){var j=y.meta.percent||0,v=this.entriesCount,k=this._sources.length;this.accumulate?this.contentBuffer.push(y):(this.bytesWritten+=y.data.length,h.prototype.push.call(this,{data:y.data,meta:{currentFile:this.currentFile,percent:v?(j+100*(v-k-1))/v:100}}))},w.prototype.openedSource=function(y){this.currentSourceOffset=this.bytesWritten,this.currentFile=y.file.name;var j=this.streamFiles&&!y.file.dir;if(j){var v=c(y,j,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:v.fileRecord,meta:{percent:0}})}else this.accumulate=!0},w.prototype.closedSource=function(y){this.accumulate=!1;var j=this.streamFiles&&!y.file.dir,v=c(y,j,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(v.dirRecord),j)this.push({data:(function(k){return x.DATA_DESCRIPTOR+u(k.crc32,4)+u(k.compressedSize,4)+u(k.uncompressedSize,4)})(y),meta:{percent:100}});else for(this.push({data:v.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},w.prototype.flush=function(){for(var y=this.bytesWritten,j=0;j<this.dirRecords.length;j++)this.push({data:this.dirRecords[j],meta:{percent:100}});var v=this.bytesWritten-y,k=(function(S,_,N,B,D){var z=f.transformTo("string",D(B));return x.CENTRAL_DIRECTORY_END+"\0\0\0\0"+u(S,2)+u(S,2)+u(_,4)+u(N,4)+u(z.length,2)+z})(this.dirRecords.length,v,y,this.zipComment,this.encodeFileName);this.push({data:k,meta:{percent:100}})},w.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},w.prototype.registerPrevious=function(y){this._sources.push(y);var j=this;return y.on("data",function(v){j.processChunk(v)}),y.on("end",function(){j.closedSource(j.previous.streamInfo),j._sources.length?j.prepareNextSource():j.end()}),y.on("error",function(v){j.error(v)}),this},w.prototype.resume=function(){return!!h.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},w.prototype.error=function(y){var j=this._sources;if(!h.prototype.error.call(this,y))return!1;for(var v=0;v<j.length;v++)try{j[v].error(y)}catch{}return!0},w.prototype.lock=function(){h.prototype.lock.call(this);for(var y=this._sources,j=0;j<y.length;j++)y[j].lock()},l.exports=w},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(i,l,o){var u=i("../compressions"),c=i("./ZipFileWorker");o.generateWorker=function(f,h,p){var b=new c(h.streamFiles,p,h.platform,h.encodeFileName),x=0;try{f.forEach(function(w,y){x++;var j=(function(_,N){var B=_||N,D=u[B];if(!D)throw new Error(B+" is not a valid compression method !");return D})(y.options.compression,h.compression),v=y.options.compressionOptions||h.compressionOptions||{},k=y.dir,S=y.date;y._compressWorker(j,v).withStreamInfo("file",{name:w,dir:k,date:S,comment:y.comment||"",unixPermissions:y.unixPermissions,dosPermissions:y.dosPermissions}).pipe(b)}),b.entriesCount=x}catch(w){b.error(w)}return b}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(i,l,o){function u(){if(!(this instanceof u))return new u;if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files=Object.create(null),this.comment=null,this.root="",this.clone=function(){var c=new u;for(var f in this)typeof this[f]!="function"&&(c[f]=this[f]);return c}}(u.prototype=i("./object")).loadAsync=i("./load"),u.support=i("./support"),u.defaults=i("./defaults"),u.version="3.10.1",u.loadAsync=function(c,f){return new u().loadAsync(c,f)},u.external=i("./external"),l.exports=u},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(i,l,o){var u=i("./utils"),c=i("./external"),f=i("./utf8"),h=i("./zipEntries"),p=i("./stream/Crc32Probe"),b=i("./nodejsUtils");function x(w){return new c.Promise(function(y,j){var v=w.decompressed.getContentWorker().pipe(new p);v.on("error",function(k){j(k)}).on("end",function(){v.streamInfo.crc32!==w.decompressed.crc32?j(new Error("Corrupted zip : CRC32 mismatch")):y()}).resume()})}l.exports=function(w,y){var j=this;return y=u.extend(y||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:f.utf8decode}),b.isNode&&b.isStream(w)?c.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):u.prepareContent("the loaded zip file",w,!0,y.optimizedBinaryString,y.base64).then(function(v){var k=new h(y);return k.load(v),k}).then(function(v){var k=[c.Promise.resolve(v)],S=v.files;if(y.checkCRC32)for(var _=0;_<S.length;_++)k.push(x(S[_]));return c.Promise.all(k)}).then(function(v){for(var k=v.shift(),S=k.files,_=0;_<S.length;_++){var N=S[_],B=N.fileNameStr,D=u.resolve(N.fileNameStr);j.file(D,N.decompressed,{binary:!0,optimizedBinaryString:!0,date:N.date,dir:N.dir,comment:N.fileCommentStr.length?N.fileCommentStr:null,unixPermissions:N.unixPermissions,dosPermissions:N.dosPermissions,createFolders:y.createFolders}),N.dir||(j.file(D).unsafeOriginalName=B)}return k.zipComment.length&&(j.comment=k.zipComment),j})}},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(i,l,o){var u=i("../utils"),c=i("../stream/GenericWorker");function f(h,p){c.call(this,"Nodejs stream input adapter for "+h),this._upstreamEnded=!1,this._bindStream(p)}u.inherits(f,c),f.prototype._bindStream=function(h){var p=this;(this._stream=h).pause(),h.on("data",function(b){p.push({data:b,meta:{percent:0}})}).on("error",function(b){p.isPaused?this.generatedError=b:p.error(b)}).on("end",function(){p.isPaused?p._upstreamEnded=!0:p.end()})},f.prototype.pause=function(){return!!c.prototype.pause.call(this)&&(this._stream.pause(),!0)},f.prototype.resume=function(){return!!c.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},l.exports=f},{"../stream/GenericWorker":28,"../utils":32}],13:[function(i,l,o){var u=i("readable-stream").Readable;function c(f,h,p){u.call(this,h),this._helper=f;var b=this;f.on("data",function(x,w){b.push(x)||b._helper.pause(),p&&p(w)}).on("error",function(x){b.emit("error",x)}).on("end",function(){b.push(null)})}i("../utils").inherits(c,u),c.prototype._read=function(){this._helper.resume()},l.exports=c},{"../utils":32,"readable-stream":16}],14:[function(i,l,o){l.exports={isNode:typeof Buffer<"u",newBufferFrom:function(u,c){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from(u,c);if(typeof u=="number")throw new Error('The "data" argument must not be a number');return new Buffer(u,c)},allocBuffer:function(u){if(Buffer.alloc)return Buffer.alloc(u);var c=new Buffer(u);return c.fill(0),c},isBuffer:function(u){return Buffer.isBuffer(u)},isStream:function(u){return u&&typeof u.on=="function"&&typeof u.pause=="function"&&typeof u.resume=="function"}}},{}],15:[function(i,l,o){function u(D,z,R){var G,P=f.getTypeOf(z),q=f.extend(R||{},b);q.date=q.date||new Date,q.compression!==null&&(q.compression=q.compression.toUpperCase()),typeof q.unixPermissions=="string"&&(q.unixPermissions=parseInt(q.unixPermissions,8)),q.unixPermissions&&16384&q.unixPermissions&&(q.dir=!0),q.dosPermissions&&16&q.dosPermissions&&(q.dir=!0),q.dir&&(D=S(D)),q.createFolders&&(G=k(D))&&_.call(this,G,!0);var W=P==="string"&&q.binary===!1&&q.base64===!1;R&&R.binary!==void 0||(q.binary=!W),(z instanceof x&&z.uncompressedSize===0||q.dir||!z||z.length===0)&&(q.base64=!1,q.binary=!0,z="",q.compression="STORE",P="string");var I=null;I=z instanceof x||z instanceof h?z:j.isNode&&j.isStream(z)?new v(D,z):f.prepareContent(D,z,q.binary,q.optimizedBinaryString,q.base64);var X=new w(D,I,q);this.files[D]=X}var c=i("./utf8"),f=i("./utils"),h=i("./stream/GenericWorker"),p=i("./stream/StreamHelper"),b=i("./defaults"),x=i("./compressedObject"),w=i("./zipObject"),y=i("./generate"),j=i("./nodejsUtils"),v=i("./nodejs/NodejsStreamInputAdapter"),k=function(D){D.slice(-1)==="/"&&(D=D.substring(0,D.length-1));var z=D.lastIndexOf("/");return 0<z?D.substring(0,z):""},S=function(D){return D.slice(-1)!=="/"&&(D+="/"),D},_=function(D,z){return z=z!==void 0?z:b.createFolders,D=S(D),this.files[D]||u.call(this,D,null,{dir:!0,createFolders:z}),this.files[D]};function N(D){return Object.prototype.toString.call(D)==="[object RegExp]"}var B={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(D){var z,R,G;for(z in this.files)G=this.files[z],(R=z.slice(this.root.length,z.length))&&z.slice(0,this.root.length)===this.root&&D(R,G)},filter:function(D){var z=[];return this.forEach(function(R,G){D(R,G)&&z.push(G)}),z},file:function(D,z,R){if(arguments.length!==1)return D=this.root+D,u.call(this,D,z,R),this;if(N(D)){var G=D;return this.filter(function(q,W){return!W.dir&&G.test(q)})}var P=this.files[this.root+D];return P&&!P.dir?P:null},folder:function(D){if(!D)return this;if(N(D))return this.filter(function(P,q){return q.dir&&D.test(P)});var z=this.root+D,R=_.call(this,z),G=this.clone();return G.root=R.name,G},remove:function(D){D=this.root+D;var z=this.files[D];if(z||(D.slice(-1)!=="/"&&(D+="/"),z=this.files[D]),z&&!z.dir)delete this.files[D];else for(var R=this.filter(function(P,q){return q.name.slice(0,D.length)===D}),G=0;G<R.length;G++)delete this.files[R[G].name];return this},generate:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(D){var z,R={};try{if((R=f.extend(D||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:c.utf8encode})).type=R.type.toLowerCase(),R.compression=R.compression.toUpperCase(),R.type==="binarystring"&&(R.type="string"),!R.type)throw new Error("No output type specified.");f.checkSupport(R.type),R.platform!=="darwin"&&R.platform!=="freebsd"&&R.platform!=="linux"&&R.platform!=="sunos"||(R.platform="UNIX"),R.platform==="win32"&&(R.platform="DOS");var G=R.comment||this.comment||"";z=y.generateWorker(this,R,G)}catch(P){(z=new h("error")).error(P)}return new p(z,R.type||"string",R.mimeType)},generateAsync:function(D,z){return this.generateInternalStream(D).accumulate(z)},generateNodeStream:function(D,z){return(D=D||{}).type||(D.type="nodebuffer"),this.generateInternalStream(D).toNodejsStream(z)}};l.exports=B},{"./compressedObject":2,"./defaults":5,"./generate":9,"./nodejs/NodejsStreamInputAdapter":12,"./nodejsUtils":14,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31,"./utils":32,"./zipObject":35}],16:[function(i,l,o){l.exports=i("stream")},{stream:void 0}],17:[function(i,l,o){var u=i("./DataReader");function c(f){u.call(this,f);for(var h=0;h<this.data.length;h++)f[h]=255&f[h]}i("../utils").inherits(c,u),c.prototype.byteAt=function(f){return this.data[this.zero+f]},c.prototype.lastIndexOfSignature=function(f){for(var h=f.charCodeAt(0),p=f.charCodeAt(1),b=f.charCodeAt(2),x=f.charCodeAt(3),w=this.length-4;0<=w;--w)if(this.data[w]===h&&this.data[w+1]===p&&this.data[w+2]===b&&this.data[w+3]===x)return w-this.zero;return-1},c.prototype.readAndCheckSignature=function(f){var h=f.charCodeAt(0),p=f.charCodeAt(1),b=f.charCodeAt(2),x=f.charCodeAt(3),w=this.readData(4);return h===w[0]&&p===w[1]&&b===w[2]&&x===w[3]},c.prototype.readData=function(f){if(this.checkOffset(f),f===0)return[];var h=this.data.slice(this.zero+this.index,this.zero+this.index+f);return this.index+=f,h},l.exports=c},{"../utils":32,"./DataReader":18}],18:[function(i,l,o){var u=i("../utils");function c(f){this.data=f,this.length=f.length,this.index=0,this.zero=0}c.prototype={checkOffset:function(f){this.checkIndex(this.index+f)},checkIndex:function(f){if(this.length<this.zero+f||f<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+f+"). Corrupted zip ?")},setIndex:function(f){this.checkIndex(f),this.index=f},skip:function(f){this.setIndex(this.index+f)},byteAt:function(){},readInt:function(f){var h,p=0;for(this.checkOffset(f),h=this.index+f-1;h>=this.index;h--)p=(p<<8)+this.byteAt(h);return this.index+=f,p},readString:function(f){return u.transformTo("string",this.readData(f))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var f=this.readInt(4);return new Date(Date.UTC(1980+(f>>25&127),(f>>21&15)-1,f>>16&31,f>>11&31,f>>5&63,(31&f)<<1))}},l.exports=c},{"../utils":32}],19:[function(i,l,o){var u=i("./Uint8ArrayReader");function c(f){u.call(this,f)}i("../utils").inherits(c,u),c.prototype.readData=function(f){this.checkOffset(f);var h=this.data.slice(this.zero+this.index,this.zero+this.index+f);return this.index+=f,h},l.exports=c},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(i,l,o){var u=i("./DataReader");function c(f){u.call(this,f)}i("../utils").inherits(c,u),c.prototype.byteAt=function(f){return this.data.charCodeAt(this.zero+f)},c.prototype.lastIndexOfSignature=function(f){return this.data.lastIndexOf(f)-this.zero},c.prototype.readAndCheckSignature=function(f){return f===this.readData(4)},c.prototype.readData=function(f){this.checkOffset(f);var h=this.data.slice(this.zero+this.index,this.zero+this.index+f);return this.index+=f,h},l.exports=c},{"../utils":32,"./DataReader":18}],21:[function(i,l,o){var u=i("./ArrayReader");function c(f){u.call(this,f)}i("../utils").inherits(c,u),c.prototype.readData=function(f){if(this.checkOffset(f),f===0)return new Uint8Array(0);var h=this.data.subarray(this.zero+this.index,this.zero+this.index+f);return this.index+=f,h},l.exports=c},{"../utils":32,"./ArrayReader":17}],22:[function(i,l,o){var u=i("../utils"),c=i("../support"),f=i("./ArrayReader"),h=i("./StringReader"),p=i("./NodeBufferReader"),b=i("./Uint8ArrayReader");l.exports=function(x){var w=u.getTypeOf(x);return u.checkSupport(w),w!=="string"||c.uint8array?w==="nodebuffer"?new p(x):c.uint8array?new b(u.transformTo("uint8array",x)):new f(u.transformTo("array",x)):new h(x)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(i,l,o){o.LOCAL_FILE_HEADER="PK",o.CENTRAL_FILE_HEADER="PK",o.CENTRAL_DIRECTORY_END="PK",o.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",o.ZIP64_CENTRAL_DIRECTORY_END="PK",o.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(i,l,o){var u=i("./GenericWorker"),c=i("../utils");function f(h){u.call(this,"ConvertWorker to "+h),this.destType=h}c.inherits(f,u),f.prototype.processChunk=function(h){this.push({data:c.transformTo(this.destType,h.data),meta:h.meta})},l.exports=f},{"../utils":32,"./GenericWorker":28}],25:[function(i,l,o){var u=i("./GenericWorker"),c=i("../crc32");function f(){u.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}i("../utils").inherits(f,u),f.prototype.processChunk=function(h){this.streamInfo.crc32=c(h.data,this.streamInfo.crc32||0),this.push(h)},l.exports=f},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(i,l,o){var u=i("../utils"),c=i("./GenericWorker");function f(h){c.call(this,"DataLengthProbe for "+h),this.propName=h,this.withStreamInfo(h,0)}u.inherits(f,c),f.prototype.processChunk=function(h){if(h){var p=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=p+h.data.length}c.prototype.processChunk.call(this,h)},l.exports=f},{"../utils":32,"./GenericWorker":28}],27:[function(i,l,o){var u=i("../utils"),c=i("./GenericWorker");function f(h){c.call(this,"DataWorker");var p=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,h.then(function(b){p.dataIsReady=!0,p.data=b,p.max=b&&b.length||0,p.type=u.getTypeOf(b),p.isPaused||p._tickAndRepeat()},function(b){p.error(b)})}u.inherits(f,c),f.prototype.cleanUp=function(){c.prototype.cleanUp.call(this),this.data=null},f.prototype.resume=function(){return!!c.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,u.delay(this._tickAndRepeat,[],this)),!0)},f.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(u.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},f.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var h=null,p=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":h=this.data.substring(this.index,p);break;case"uint8array":h=this.data.subarray(this.index,p);break;case"array":case"nodebuffer":h=this.data.slice(this.index,p)}return this.index=p,this.push({data:h,meta:{percent:this.max?this.index/this.max*100:0}})},l.exports=f},{"../utils":32,"./GenericWorker":28}],28:[function(i,l,o){function u(c){this.name=c||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}u.prototype={push:function(c){this.emit("data",c)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(c){this.emit("error",c)}return!0},error:function(c){return!this.isFinished&&(this.isPaused?this.generatedError=c:(this.isFinished=!0,this.emit("error",c),this.previous&&this.previous.error(c),this.cleanUp()),!0)},on:function(c,f){return this._listeners[c].push(f),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(c,f){if(this._listeners[c])for(var h=0;h<this._listeners[c].length;h++)this._listeners[c][h].call(this,f)},pipe:function(c){return c.registerPrevious(this)},registerPrevious:function(c){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=c.streamInfo,this.mergeStreamInfo(),this.previous=c;var f=this;return c.on("data",function(h){f.processChunk(h)}),c.on("end",function(){f.end()}),c.on("error",function(h){f.error(h)}),this},pause:function(){return!this.isPaused&&!this.isFinished&&(this.isPaused=!0,this.previous&&this.previous.pause(),!0)},resume:function(){if(!this.isPaused||this.isFinished)return!1;var c=this.isPaused=!1;return this.generatedError&&(this.error(this.generatedError),c=!0),this.previous&&this.previous.resume(),!c},flush:function(){},processChunk:function(c){this.push(c)},withStreamInfo:function(c,f){return this.extraStreamInfo[c]=f,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var c in this.extraStreamInfo)Object.prototype.hasOwnProperty.call(this.extraStreamInfo,c)&&(this.streamInfo[c]=this.extraStreamInfo[c])},lock:function(){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.isLocked=!0,this.previous&&this.previous.lock()},toString:function(){var c="Worker "+this.name;return this.previous?this.previous+" -> "+c:c}},l.exports=u},{}],29:[function(i,l,o){var u=i("../utils"),c=i("./ConvertWorker"),f=i("./GenericWorker"),h=i("../base64"),p=i("../support"),b=i("../external"),x=null;if(p.nodestream)try{x=i("../nodejs/NodejsStreamOutputAdapter")}catch{}function w(j,v){return new b.Promise(function(k,S){var _=[],N=j._internalType,B=j._outputType,D=j._mimeType;j.on("data",function(z,R){_.push(z),v&&v(R)}).on("error",function(z){_=[],S(z)}).on("end",function(){try{var z=(function(R,G,P){switch(R){case"blob":return u.newBlob(u.transformTo("arraybuffer",G),P);case"base64":return h.encode(G);default:return u.transformTo(R,G)}})(B,(function(R,G){var P,q=0,W=null,I=0;for(P=0;P<G.length;P++)I+=G[P].length;switch(R){case"string":return G.join("");case"array":return Array.prototype.concat.apply([],G);case"uint8array":for(W=new Uint8Array(I),P=0;P<G.length;P++)W.set(G[P],q),q+=G[P].length;return W;case"nodebuffer":return Buffer.concat(G);default:throw new Error("concat : unsupported type '"+R+"'")}})(N,_),D);k(z)}catch(R){S(R)}_=[]}).resume()})}function y(j,v,k){var S=v;switch(v){case"blob":case"arraybuffer":S="uint8array";break;case"base64":S="string"}try{this._internalType=S,this._outputType=v,this._mimeType=k,u.checkSupport(S),this._worker=j.pipe(new c(S)),j.lock()}catch(_){this._worker=new f("error"),this._worker.error(_)}}y.prototype={accumulate:function(j){return w(this,j)},on:function(j,v){var k=this;return j==="data"?this._worker.on(j,function(S){v.call(k,S.data,S.meta)}):this._worker.on(j,function(){u.delay(v,arguments,k)}),this},resume:function(){return u.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(j){if(u.checkSupport("nodestream"),this._outputType!=="nodebuffer")throw new Error(this._outputType+" is not supported by this method");return new x(this,{objectMode:this._outputType!=="nodebuffer"},j)}},l.exports=y},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(i,l,o){if(o.base64=!0,o.array=!0,o.string=!0,o.arraybuffer=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",o.nodebuffer=typeof Buffer<"u",o.uint8array=typeof Uint8Array<"u",typeof ArrayBuffer>"u")o.blob=!1;else{var u=new ArrayBuffer(0);try{o.blob=new Blob([u],{type:"application/zip"}).size===0}catch{try{var c=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);c.append(u),o.blob=c.getBlob("application/zip").size===0}catch{o.blob=!1}}}try{o.nodestream=!!i("readable-stream").Readable}catch{o.nodestream=!1}},{"readable-stream":16}],31:[function(i,l,o){for(var u=i("./utils"),c=i("./support"),f=i("./nodejsUtils"),h=i("./stream/GenericWorker"),p=new Array(256),b=0;b<256;b++)p[b]=252<=b?6:248<=b?5:240<=b?4:224<=b?3:192<=b?2:1;p[254]=p[254]=1;function x(){h.call(this,"utf-8 decode"),this.leftOver=null}function w(){h.call(this,"utf-8 encode")}o.utf8encode=function(y){return c.nodebuffer?f.newBufferFrom(y,"utf-8"):(function(j){var v,k,S,_,N,B=j.length,D=0;for(_=0;_<B;_++)(64512&(k=j.charCodeAt(_)))==55296&&_+1<B&&(64512&(S=j.charCodeAt(_+1)))==56320&&(k=65536+(k-55296<<10)+(S-56320),_++),D+=k<128?1:k<2048?2:k<65536?3:4;for(v=c.uint8array?new Uint8Array(D):new Array(D),_=N=0;N<D;_++)(64512&(k=j.charCodeAt(_)))==55296&&_+1<B&&(64512&(S=j.charCodeAt(_+1)))==56320&&(k=65536+(k-55296<<10)+(S-56320),_++),k<128?v[N++]=k:(k<2048?v[N++]=192|k>>>6:(k<65536?v[N++]=224|k>>>12:(v[N++]=240|k>>>18,v[N++]=128|k>>>12&63),v[N++]=128|k>>>6&63),v[N++]=128|63&k);return v})(y)},o.utf8decode=function(y){return c.nodebuffer?u.transformTo("nodebuffer",y).toString("utf-8"):(function(j){var v,k,S,_,N=j.length,B=new Array(2*N);for(v=k=0;v<N;)if((S=j[v++])<128)B[k++]=S;else if(4<(_=p[S]))B[k++]=65533,v+=_-1;else{for(S&=_===2?31:_===3?15:7;1<_&&v<N;)S=S<<6|63&j[v++],_--;1<_?B[k++]=65533:S<65536?B[k++]=S:(S-=65536,B[k++]=55296|S>>10&1023,B[k++]=56320|1023&S)}return B.length!==k&&(B.subarray?B=B.subarray(0,k):B.length=k),u.applyFromCharCode(B)})(y=u.transformTo(c.uint8array?"uint8array":"array",y))},u.inherits(x,h),x.prototype.processChunk=function(y){var j=u.transformTo(c.uint8array?"uint8array":"array",y.data);if(this.leftOver&&this.leftOver.length){if(c.uint8array){var v=j;(j=new Uint8Array(v.length+this.leftOver.length)).set(this.leftOver,0),j.set(v,this.leftOver.length)}else j=this.leftOver.concat(j);this.leftOver=null}var k=(function(_,N){var B;for((N=N||_.length)>_.length&&(N=_.length),B=N-1;0<=B&&(192&_[B])==128;)B--;return B<0||B===0?N:B+p[_[B]]>N?B:N})(j),S=j;k!==j.length&&(c.uint8array?(S=j.subarray(0,k),this.leftOver=j.subarray(k,j.length)):(S=j.slice(0,k),this.leftOver=j.slice(k,j.length))),this.push({data:o.utf8decode(S),meta:y.meta})},x.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:o.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},o.Utf8DecodeWorker=x,u.inherits(w,h),w.prototype.processChunk=function(y){this.push({data:o.utf8encode(y.data),meta:y.meta})},o.Utf8EncodeWorker=w},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(i,l,o){var u=i("./support"),c=i("./base64"),f=i("./nodejsUtils"),h=i("./external");function p(v){return v}function b(v,k){for(var S=0;S<v.length;++S)k[S]=255&v.charCodeAt(S);return k}i("setimmediate"),o.newBlob=function(v,k){o.checkSupport("blob");try{return new Blob([v],{type:k})}catch{try{var S=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return S.append(v),S.getBlob(k)}catch{throw new Error("Bug : can't construct the Blob.")}}};var x={stringifyByChunk:function(v,k,S){var _=[],N=0,B=v.length;if(B<=S)return String.fromCharCode.apply(null,v);for(;N<B;)k==="array"||k==="nodebuffer"?_.push(String.fromCharCode.apply(null,v.slice(N,Math.min(N+S,B)))):_.push(String.fromCharCode.apply(null,v.subarray(N,Math.min(N+S,B)))),N+=S;return _.join("")},stringifyByChar:function(v){for(var k="",S=0;S<v.length;S++)k+=String.fromCharCode(v[S]);return k},applyCanBeUsed:{uint8array:(function(){try{return u.uint8array&&String.fromCharCode.apply(null,new Uint8Array(1)).length===1}catch{return!1}})(),nodebuffer:(function(){try{return u.nodebuffer&&String.fromCharCode.apply(null,f.allocBuffer(1)).length===1}catch{return!1}})()}};function w(v){var k=65536,S=o.getTypeOf(v),_=!0;if(S==="uint8array"?_=x.applyCanBeUsed.uint8array:S==="nodebuffer"&&(_=x.applyCanBeUsed.nodebuffer),_)for(;1<k;)try{return x.stringifyByChunk(v,S,k)}catch{k=Math.floor(k/2)}return x.stringifyByChar(v)}function y(v,k){for(var S=0;S<v.length;S++)k[S]=v[S];return k}o.applyFromCharCode=w;var j={};j.string={string:p,array:function(v){return b(v,new Array(v.length))},arraybuffer:function(v){return j.string.uint8array(v).buffer},uint8array:function(v){return b(v,new Uint8Array(v.length))},nodebuffer:function(v){return b(v,f.allocBuffer(v.length))}},j.array={string:w,array:p,arraybuffer:function(v){return new Uint8Array(v).buffer},uint8array:function(v){return new Uint8Array(v)},nodebuffer:function(v){return f.newBufferFrom(v)}},j.arraybuffer={string:function(v){return w(new Uint8Array(v))},array:function(v){return y(new Uint8Array(v),new Array(v.byteLength))},arraybuffer:p,uint8array:function(v){return new Uint8Array(v)},nodebuffer:function(v){return f.newBufferFrom(new Uint8Array(v))}},j.uint8array={string:w,array:function(v){return y(v,new Array(v.length))},arraybuffer:function(v){return v.buffer},uint8array:p,nodebuffer:function(v){return f.newBufferFrom(v)}},j.nodebuffer={string:w,array:function(v){return y(v,new Array(v.length))},arraybuffer:function(v){return j.nodebuffer.uint8array(v).buffer},uint8array:function(v){return y(v,new Uint8Array(v.length))},nodebuffer:p},o.transformTo=function(v,k){if(k=k||"",!v)return k;o.checkSupport(v);var S=o.getTypeOf(k);return j[S][v](k)},o.resolve=function(v){for(var k=v.split("/"),S=[],_=0;_<k.length;_++){var N=k[_];N==="."||N===""&&_!==0&&_!==k.length-1||(N===".."?S.pop():S.push(N))}return S.join("/")},o.getTypeOf=function(v){return typeof v=="string"?"string":Object.prototype.toString.call(v)==="[object Array]"?"array":u.nodebuffer&&f.isBuffer(v)?"nodebuffer":u.uint8array&&v instanceof Uint8Array?"uint8array":u.arraybuffer&&v instanceof ArrayBuffer?"arraybuffer":void 0},o.checkSupport=function(v){if(!u[v.toLowerCase()])throw new Error(v+" is not supported by this platform")},o.MAX_VALUE_16BITS=65535,o.MAX_VALUE_32BITS=-1,o.pretty=function(v){var k,S,_="";for(S=0;S<(v||"").length;S++)_+="\\x"+((k=v.charCodeAt(S))<16?"0":"")+k.toString(16).toUpperCase();return _},o.delay=function(v,k,S){setImmediate(function(){v.apply(S||null,k||[])})},o.inherits=function(v,k){function S(){}S.prototype=k.prototype,v.prototype=new S},o.extend=function(){var v,k,S={};for(v=0;v<arguments.length;v++)for(k in arguments[v])Object.prototype.hasOwnProperty.call(arguments[v],k)&&S[k]===void 0&&(S[k]=arguments[v][k]);return S},o.prepareContent=function(v,k,S,_,N){return h.Promise.resolve(k).then(function(B){return u.blob&&(B instanceof Blob||["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(B))!==-1)&&typeof FileReader<"u"?new h.Promise(function(D,z){var R=new FileReader;R.onload=function(G){D(G.target.result)},R.onerror=function(G){z(G.target.error)},R.readAsArrayBuffer(B)}):B}).then(function(B){var D=o.getTypeOf(B);return D?(D==="arraybuffer"?B=o.transformTo("uint8array",B):D==="string"&&(N?B=c.decode(B):S&&_!==!0&&(B=(function(z){return b(z,u.uint8array?new Uint8Array(z.length):new Array(z.length))})(B))),B):h.Promise.reject(new Error("Can't read the data of '"+v+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))})}},{"./base64":1,"./external":6,"./nodejsUtils":14,"./support":30,setimmediate:54}],33:[function(i,l,o){var u=i("./reader/readerFor"),c=i("./utils"),f=i("./signature"),h=i("./zipEntry"),p=i("./support");function b(x){this.files=[],this.loadOptions=x}b.prototype={checkSignature:function(x){if(!this.reader.readAndCheckSignature(x)){this.reader.index-=4;var w=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+c.pretty(w)+", expected "+c.pretty(x)+")")}},isSignature:function(x,w){var y=this.reader.index;this.reader.setIndex(x);var j=this.reader.readString(4)===w;return this.reader.setIndex(y),j},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var x=this.reader.readData(this.zipCommentLength),w=p.uint8array?"uint8array":"array",y=c.transformTo(w,x);this.zipComment=this.loadOptions.decodeFileName(y)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var x,w,y,j=this.zip64EndOfCentralSize-44;0<j;)x=this.reader.readInt(2),w=this.reader.readInt(4),y=this.reader.readData(w),this.zip64ExtensibleData[x]={id:x,length:w,value:y}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),1<this.disksCount)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var x,w;for(x=0;x<this.files.length;x++)w=this.files[x],this.reader.setIndex(w.localHeaderOffset),this.checkSignature(f.LOCAL_FILE_HEADER),w.readLocalPart(this.reader),w.handleUTF8(),w.processAttributes()},readCentralDir:function(){var x;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(f.CENTRAL_FILE_HEADER);)(x=new h({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(x);if(this.centralDirRecords!==this.files.length&&this.centralDirRecords!==0&&this.files.length===0)throw new Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)},readEndOfCentral:function(){var x=this.reader.lastIndexOfSignature(f.CENTRAL_DIRECTORY_END);if(x<0)throw this.isSignature(0,f.LOCAL_FILE_HEADER)?new Error("Corrupted zip: can't find end of central directory"):new Error("Can't find end of central directory : is this a zip file ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html");this.reader.setIndex(x);var w=x;if(this.checkSignature(f.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===c.MAX_VALUE_16BITS||this.diskWithCentralDirStart===c.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===c.MAX_VALUE_16BITS||this.centralDirRecords===c.MAX_VALUE_16BITS||this.centralDirSize===c.MAX_VALUE_32BITS||this.centralDirOffset===c.MAX_VALUE_32BITS){if(this.zip64=!0,(x=this.reader.lastIndexOfSignature(f.ZIP64_CENTRAL_DIRECTORY_LOCATOR))<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(x),this.checkSignature(f.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,f.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(f.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0))throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(f.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var y=this.centralDirOffset+this.centralDirSize;this.zip64&&(y+=20,y+=12+this.zip64EndOfCentralSize);var j=w-y;if(0<j)this.isSignature(w,f.CENTRAL_FILE_HEADER)||(this.reader.zero=j);else if(j<0)throw new Error("Corrupted zip: missing "+Math.abs(j)+" bytes.")},prepareReader:function(x){this.reader=u(x)},load:function(x){this.prepareReader(x),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},l.exports=b},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utils":32,"./zipEntry":34}],34:[function(i,l,o){var u=i("./reader/readerFor"),c=i("./utils"),f=i("./compressedObject"),h=i("./crc32"),p=i("./utf8"),b=i("./compressions"),x=i("./support");function w(y,j){this.options=y,this.loadOptions=j}w.prototype={isEncrypted:function(){return(1&this.bitFlag)==1},useUTF8:function(){return(2048&this.bitFlag)==2048},readLocalPart:function(y){var j,v;if(y.skip(22),this.fileNameLength=y.readInt(2),v=y.readInt(2),this.fileName=y.readData(this.fileNameLength),y.skip(v),this.compressedSize===-1||this.uncompressedSize===-1)throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if((j=(function(k){for(var S in b)if(Object.prototype.hasOwnProperty.call(b,S)&&b[S].magic===k)return b[S];return null})(this.compressionMethod))===null)throw new Error("Corrupted zip : compression "+c.pretty(this.compressionMethod)+" unknown (inner file : "+c.transformTo("string",this.fileName)+")");this.decompressed=new f(this.compressedSize,this.uncompressedSize,this.crc32,j,y.readData(this.compressedSize))},readCentralPart:function(y){this.versionMadeBy=y.readInt(2),y.skip(2),this.bitFlag=y.readInt(2),this.compressionMethod=y.readString(2),this.date=y.readDate(),this.crc32=y.readInt(4),this.compressedSize=y.readInt(4),this.uncompressedSize=y.readInt(4);var j=y.readInt(2);if(this.extraFieldsLength=y.readInt(2),this.fileCommentLength=y.readInt(2),this.diskNumberStart=y.readInt(2),this.internalFileAttributes=y.readInt(2),this.externalFileAttributes=y.readInt(4),this.localHeaderOffset=y.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");y.skip(j),this.readExtraFields(y),this.parseZIP64ExtraField(y),this.fileComment=y.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var y=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),y==0&&(this.dosPermissions=63&this.externalFileAttributes),y==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var y=u(this.extraFields[1].value);this.uncompressedSize===c.MAX_VALUE_32BITS&&(this.uncompressedSize=y.readInt(8)),this.compressedSize===c.MAX_VALUE_32BITS&&(this.compressedSize=y.readInt(8)),this.localHeaderOffset===c.MAX_VALUE_32BITS&&(this.localHeaderOffset=y.readInt(8)),this.diskNumberStart===c.MAX_VALUE_32BITS&&(this.diskNumberStart=y.readInt(4))}},readExtraFields:function(y){var j,v,k,S=y.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});y.index+4<S;)j=y.readInt(2),v=y.readInt(2),k=y.readData(v),this.extraFields[j]={id:j,length:v,value:k};y.setIndex(S)},handleUTF8:function(){var y=x.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=p.utf8decode(this.fileName),this.fileCommentStr=p.utf8decode(this.fileComment);else{var j=this.findExtraFieldUnicodePath();if(j!==null)this.fileNameStr=j;else{var v=c.transformTo(y,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(v)}var k=this.findExtraFieldUnicodeComment();if(k!==null)this.fileCommentStr=k;else{var S=c.transformTo(y,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(S)}}},findExtraFieldUnicodePath:function(){var y=this.extraFields[28789];if(y){var j=u(y.value);return j.readInt(1)!==1||h(this.fileName)!==j.readInt(4)?null:p.utf8decode(j.readData(y.length-5))}return null},findExtraFieldUnicodeComment:function(){var y=this.extraFields[25461];if(y){var j=u(y.value);return j.readInt(1)!==1||h(this.fileComment)!==j.readInt(4)?null:p.utf8decode(j.readData(y.length-5))}return null}},l.exports=w},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(i,l,o){function u(j,v,k){this.name=j,this.dir=k.dir,this.date=k.date,this.comment=k.comment,this.unixPermissions=k.unixPermissions,this.dosPermissions=k.dosPermissions,this._data=v,this._dataBinary=k.binary,this.options={compression:k.compression,compressionOptions:k.compressionOptions}}var c=i("./stream/StreamHelper"),f=i("./stream/DataWorker"),h=i("./utf8"),p=i("./compressedObject"),b=i("./stream/GenericWorker");u.prototype={internalStream:function(j){var v=null,k="string";try{if(!j)throw new Error("No output type specified.");var S=(k=j.toLowerCase())==="string"||k==="text";k!=="binarystring"&&k!=="text"||(k="string"),v=this._decompressWorker();var _=!this._dataBinary;_&&!S&&(v=v.pipe(new h.Utf8EncodeWorker)),!_&&S&&(v=v.pipe(new h.Utf8DecodeWorker))}catch(N){(v=new b("error")).error(N)}return new c(v,k,"")},async:function(j,v){return this.internalStream(j).accumulate(v)},nodeStream:function(j,v){return this.internalStream(j||"nodebuffer").toNodejsStream(v)},_compressWorker:function(j,v){if(this._data instanceof p&&this._data.compression.magic===j.magic)return this._data.getCompressedWorker();var k=this._decompressWorker();return this._dataBinary||(k=k.pipe(new h.Utf8EncodeWorker)),p.createWorkerFrom(k,j,v)},_decompressWorker:function(){return this._data instanceof p?this._data.getContentWorker():this._data instanceof b?this._data:new f(this._data)}};for(var x=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],w=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},y=0;y<x.length;y++)u.prototype[x[y]]=w;l.exports=u},{"./compressedObject":2,"./stream/DataWorker":27,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31}],36:[function(i,l,o){(function(u){var c,f,h=u.MutationObserver||u.WebKitMutationObserver;if(h){var p=0,b=new h(j),x=u.document.createTextNode("");b.observe(x,{characterData:!0}),c=function(){x.data=p=++p%2}}else if(u.setImmediate||u.MessageChannel===void 0)c="document"in u&&"onreadystatechange"in u.document.createElement("script")?function(){var v=u.document.createElement("script");v.onreadystatechange=function(){j(),v.onreadystatechange=null,v.parentNode.removeChild(v),v=null},u.document.documentElement.appendChild(v)}:function(){setTimeout(j,0)};else{var w=new u.MessageChannel;w.port1.onmessage=j,c=function(){w.port2.postMessage(0)}}var y=[];function j(){var v,k;f=!0;for(var S=y.length;S;){for(k=y,y=[],v=-1;++v<S;)k[v]();S=y.length}f=!1}l.exports=function(v){y.push(v)!==1||f||c()}}).call(this,typeof Rs<"u"?Rs:typeof self<"u"?self:typeof window<"u"?window:{})},{}],37:[function(i,l,o){var u=i("immediate");function c(){}var f={},h=["REJECTED"],p=["FULFILLED"],b=["PENDING"];function x(S){if(typeof S!="function")throw new TypeError("resolver must be a function");this.state=b,this.queue=[],this.outcome=void 0,S!==c&&v(this,S)}function w(S,_,N){this.promise=S,typeof _=="function"&&(this.onFulfilled=_,this.callFulfilled=this.otherCallFulfilled),typeof N=="function"&&(this.onRejected=N,this.callRejected=this.otherCallRejected)}function y(S,_,N){u(function(){var B;try{B=_(N)}catch(D){return f.reject(S,D)}B===S?f.reject(S,new TypeError("Cannot resolve promise with itself")):f.resolve(S,B)})}function j(S){var _=S&&S.then;if(S&&(typeof S=="object"||typeof S=="function")&&typeof _=="function")return function(){_.apply(S,arguments)}}function v(S,_){var N=!1;function B(R){N||(N=!0,f.reject(S,R))}function D(R){N||(N=!0,f.resolve(S,R))}var z=k(function(){_(D,B)});z.status==="error"&&B(z.value)}function k(S,_){var N={};try{N.value=S(_),N.status="success"}catch(B){N.status="error",N.value=B}return N}(l.exports=x).prototype.finally=function(S){if(typeof S!="function")return this;var _=this.constructor;return this.then(function(N){return _.resolve(S()).then(function(){return N})},function(N){return _.resolve(S()).then(function(){throw N})})},x.prototype.catch=function(S){return this.then(null,S)},x.prototype.then=function(S,_){if(typeof S!="function"&&this.state===p||typeof _!="function"&&this.state===h)return this;var N=new this.constructor(c);return this.state!==b?y(N,this.state===p?S:_,this.outcome):this.queue.push(new w(N,S,_)),N},w.prototype.callFulfilled=function(S){f.resolve(this.promise,S)},w.prototype.otherCallFulfilled=function(S){y(this.promise,this.onFulfilled,S)},w.prototype.callRejected=function(S){f.reject(this.promise,S)},w.prototype.otherCallRejected=function(S){y(this.promise,this.onRejected,S)},f.resolve=function(S,_){var N=k(j,_);if(N.status==="error")return f.reject(S,N.value);var B=N.value;if(B)v(S,B);else{S.state=p,S.outcome=_;for(var D=-1,z=S.queue.length;++D<z;)S.queue[D].callFulfilled(_)}return S},f.reject=function(S,_){S.state=h,S.outcome=_;for(var N=-1,B=S.queue.length;++N<B;)S.queue[N].callRejected(_);return S},x.resolve=function(S){return S instanceof this?S:f.resolve(new this(c),S)},x.reject=function(S){var _=new this(c);return f.reject(_,S)},x.all=function(S){var _=this;if(Object.prototype.toString.call(S)!=="[object Array]")return this.reject(new TypeError("must be an array"));var N=S.length,B=!1;if(!N)return this.resolve([]);for(var D=new Array(N),z=0,R=-1,G=new this(c);++R<N;)P(S[R],R);return G;function P(q,W){_.resolve(q).then(function(I){D[W]=I,++z!==N||B||(B=!0,f.resolve(G,D))},function(I){B||(B=!0,f.reject(G,I))})}},x.race=function(S){var _=this;if(Object.prototype.toString.call(S)!=="[object Array]")return this.reject(new TypeError("must be an array"));var N=S.length,B=!1;if(!N)return this.resolve([]);for(var D=-1,z=new this(c);++D<N;)R=S[D],_.resolve(R).then(function(G){B||(B=!0,f.resolve(z,G))},function(G){B||(B=!0,f.reject(z,G))});var R;return z}},{immediate:36}],38:[function(i,l,o){var u={};(0,i("./lib/utils/common").assign)(u,i("./lib/deflate"),i("./lib/inflate"),i("./lib/zlib/constants")),l.exports=u},{"./lib/deflate":39,"./lib/inflate":40,"./lib/utils/common":41,"./lib/zlib/constants":44}],39:[function(i,l,o){var u=i("./zlib/deflate"),c=i("./utils/common"),f=i("./utils/strings"),h=i("./zlib/messages"),p=i("./zlib/zstream"),b=Object.prototype.toString,x=0,w=-1,y=0,j=8;function v(S){if(!(this instanceof v))return new v(S);this.options=c.assign({level:w,method:j,chunkSize:16384,windowBits:15,memLevel:8,strategy:y,to:""},S||{});var _=this.options;_.raw&&0<_.windowBits?_.windowBits=-_.windowBits:_.gzip&&0<_.windowBits&&_.windowBits<16&&(_.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new p,this.strm.avail_out=0;var N=u.deflateInit2(this.strm,_.level,_.method,_.windowBits,_.memLevel,_.strategy);if(N!==x)throw new Error(h[N]);if(_.header&&u.deflateSetHeader(this.strm,_.header),_.dictionary){var B;if(B=typeof _.dictionary=="string"?f.string2buf(_.dictionary):b.call(_.dictionary)==="[object ArrayBuffer]"?new Uint8Array(_.dictionary):_.dictionary,(N=u.deflateSetDictionary(this.strm,B))!==x)throw new Error(h[N]);this._dict_set=!0}}function k(S,_){var N=new v(_);if(N.push(S,!0),N.err)throw N.msg||h[N.err];return N.result}v.prototype.push=function(S,_){var N,B,D=this.strm,z=this.options.chunkSize;if(this.ended)return!1;B=_===~~_?_:_===!0?4:0,typeof S=="string"?D.input=f.string2buf(S):b.call(S)==="[object ArrayBuffer]"?D.input=new Uint8Array(S):D.input=S,D.next_in=0,D.avail_in=D.input.length;do{if(D.avail_out===0&&(D.output=new c.Buf8(z),D.next_out=0,D.avail_out=z),(N=u.deflate(D,B))!==1&&N!==x)return this.onEnd(N),!(this.ended=!0);D.avail_out!==0&&(D.avail_in!==0||B!==4&&B!==2)||(this.options.to==="string"?this.onData(f.buf2binstring(c.shrinkBuf(D.output,D.next_out))):this.onData(c.shrinkBuf(D.output,D.next_out)))}while((0<D.avail_in||D.avail_out===0)&&N!==1);return B===4?(N=u.deflateEnd(this.strm),this.onEnd(N),this.ended=!0,N===x):B!==2||(this.onEnd(x),!(D.avail_out=0))},v.prototype.onData=function(S){this.chunks.push(S)},v.prototype.onEnd=function(S){S===x&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=c.flattenChunks(this.chunks)),this.chunks=[],this.err=S,this.msg=this.strm.msg},o.Deflate=v,o.deflate=k,o.deflateRaw=function(S,_){return(_=_||{}).raw=!0,k(S,_)},o.gzip=function(S,_){return(_=_||{}).gzip=!0,k(S,_)}},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(i,l,o){var u=i("./zlib/inflate"),c=i("./utils/common"),f=i("./utils/strings"),h=i("./zlib/constants"),p=i("./zlib/messages"),b=i("./zlib/zstream"),x=i("./zlib/gzheader"),w=Object.prototype.toString;function y(v){if(!(this instanceof y))return new y(v);this.options=c.assign({chunkSize:16384,windowBits:0,to:""},v||{});var k=this.options;k.raw&&0<=k.windowBits&&k.windowBits<16&&(k.windowBits=-k.windowBits,k.windowBits===0&&(k.windowBits=-15)),!(0<=k.windowBits&&k.windowBits<16)||v&&v.windowBits||(k.windowBits+=32),15<k.windowBits&&k.windowBits<48&&(15&k.windowBits)==0&&(k.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new b,this.strm.avail_out=0;var S=u.inflateInit2(this.strm,k.windowBits);if(S!==h.Z_OK)throw new Error(p[S]);this.header=new x,u.inflateGetHeader(this.strm,this.header)}function j(v,k){var S=new y(k);if(S.push(v,!0),S.err)throw S.msg||p[S.err];return S.result}y.prototype.push=function(v,k){var S,_,N,B,D,z,R=this.strm,G=this.options.chunkSize,P=this.options.dictionary,q=!1;if(this.ended)return!1;_=k===~~k?k:k===!0?h.Z_FINISH:h.Z_NO_FLUSH,typeof v=="string"?R.input=f.binstring2buf(v):w.call(v)==="[object ArrayBuffer]"?R.input=new Uint8Array(v):R.input=v,R.next_in=0,R.avail_in=R.input.length;do{if(R.avail_out===0&&(R.output=new c.Buf8(G),R.next_out=0,R.avail_out=G),(S=u.inflate(R,h.Z_NO_FLUSH))===h.Z_NEED_DICT&&P&&(z=typeof P=="string"?f.string2buf(P):w.call(P)==="[object ArrayBuffer]"?new Uint8Array(P):P,S=u.inflateSetDictionary(this.strm,z)),S===h.Z_BUF_ERROR&&q===!0&&(S=h.Z_OK,q=!1),S!==h.Z_STREAM_END&&S!==h.Z_OK)return this.onEnd(S),!(this.ended=!0);R.next_out&&(R.avail_out!==0&&S!==h.Z_STREAM_END&&(R.avail_in!==0||_!==h.Z_FINISH&&_!==h.Z_SYNC_FLUSH)||(this.options.to==="string"?(N=f.utf8border(R.output,R.next_out),B=R.next_out-N,D=f.buf2string(R.output,N),R.next_out=B,R.avail_out=G-B,B&&c.arraySet(R.output,R.output,N,B,0),this.onData(D)):this.onData(c.shrinkBuf(R.output,R.next_out)))),R.avail_in===0&&R.avail_out===0&&(q=!0)}while((0<R.avail_in||R.avail_out===0)&&S!==h.Z_STREAM_END);return S===h.Z_STREAM_END&&(_=h.Z_FINISH),_===h.Z_FINISH?(S=u.inflateEnd(this.strm),this.onEnd(S),this.ended=!0,S===h.Z_OK):_!==h.Z_SYNC_FLUSH||(this.onEnd(h.Z_OK),!(R.avail_out=0))},y.prototype.onData=function(v){this.chunks.push(v)},y.prototype.onEnd=function(v){v===h.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=c.flattenChunks(this.chunks)),this.chunks=[],this.err=v,this.msg=this.strm.msg},o.Inflate=y,o.inflate=j,o.inflateRaw=function(v,k){return(k=k||{}).raw=!0,j(v,k)},o.ungzip=j},{"./utils/common":41,"./utils/strings":42,"./zlib/constants":44,"./zlib/gzheader":47,"./zlib/inflate":49,"./zlib/messages":51,"./zlib/zstream":53}],41:[function(i,l,o){var u=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";o.assign=function(h){for(var p=Array.prototype.slice.call(arguments,1);p.length;){var b=p.shift();if(b){if(typeof b!="object")throw new TypeError(b+"must be non-object");for(var x in b)b.hasOwnProperty(x)&&(h[x]=b[x])}}return h},o.shrinkBuf=function(h,p){return h.length===p?h:h.subarray?h.subarray(0,p):(h.length=p,h)};var c={arraySet:function(h,p,b,x,w){if(p.subarray&&h.subarray)h.set(p.subarray(b,b+x),w);else for(var y=0;y<x;y++)h[w+y]=p[b+y]},flattenChunks:function(h){var p,b,x,w,y,j;for(p=x=0,b=h.length;p<b;p++)x+=h[p].length;for(j=new Uint8Array(x),p=w=0,b=h.length;p<b;p++)y=h[p],j.set(y,w),w+=y.length;return j}},f={arraySet:function(h,p,b,x,w){for(var y=0;y<x;y++)h[w+y]=p[b+y]},flattenChunks:function(h){return[].concat.apply([],h)}};o.setTyped=function(h){h?(o.Buf8=Uint8Array,o.Buf16=Uint16Array,o.Buf32=Int32Array,o.assign(o,c)):(o.Buf8=Array,o.Buf16=Array,o.Buf32=Array,o.assign(o,f))},o.setTyped(u)},{}],42:[function(i,l,o){var u=i("./common"),c=!0,f=!0;try{String.fromCharCode.apply(null,[0])}catch{c=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{f=!1}for(var h=new u.Buf8(256),p=0;p<256;p++)h[p]=252<=p?6:248<=p?5:240<=p?4:224<=p?3:192<=p?2:1;function b(x,w){if(w<65537&&(x.subarray&&f||!x.subarray&&c))return String.fromCharCode.apply(null,u.shrinkBuf(x,w));for(var y="",j=0;j<w;j++)y+=String.fromCharCode(x[j]);return y}h[254]=h[254]=1,o.string2buf=function(x){var w,y,j,v,k,S=x.length,_=0;for(v=0;v<S;v++)(64512&(y=x.charCodeAt(v)))==55296&&v+1<S&&(64512&(j=x.charCodeAt(v+1)))==56320&&(y=65536+(y-55296<<10)+(j-56320),v++),_+=y<128?1:y<2048?2:y<65536?3:4;for(w=new u.Buf8(_),v=k=0;k<_;v++)(64512&(y=x.charCodeAt(v)))==55296&&v+1<S&&(64512&(j=x.charCodeAt(v+1)))==56320&&(y=65536+(y-55296<<10)+(j-56320),v++),y<128?w[k++]=y:(y<2048?w[k++]=192|y>>>6:(y<65536?w[k++]=224|y>>>12:(w[k++]=240|y>>>18,w[k++]=128|y>>>12&63),w[k++]=128|y>>>6&63),w[k++]=128|63&y);return w},o.buf2binstring=function(x){return b(x,x.length)},o.binstring2buf=function(x){for(var w=new u.Buf8(x.length),y=0,j=w.length;y<j;y++)w[y]=x.charCodeAt(y);return w},o.buf2string=function(x,w){var y,j,v,k,S=w||x.length,_=new Array(2*S);for(y=j=0;y<S;)if((v=x[y++])<128)_[j++]=v;else if(4<(k=h[v]))_[j++]=65533,y+=k-1;else{for(v&=k===2?31:k===3?15:7;1<k&&y<S;)v=v<<6|63&x[y++],k--;1<k?_[j++]=65533:v<65536?_[j++]=v:(v-=65536,_[j++]=55296|v>>10&1023,_[j++]=56320|1023&v)}return b(_,j)},o.utf8border=function(x,w){var y;for((w=w||x.length)>x.length&&(w=x.length),y=w-1;0<=y&&(192&x[y])==128;)y--;return y<0||y===0?w:y+h[x[y]]>w?y:w}},{"./common":41}],43:[function(i,l,o){l.exports=function(u,c,f,h){for(var p=65535&u|0,b=u>>>16&65535|0,x=0;f!==0;){for(f-=x=2e3<f?2e3:f;b=b+(p=p+c[h++]|0)|0,--x;);p%=65521,b%=65521}return p|b<<16|0}},{}],44:[function(i,l,o){l.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],45:[function(i,l,o){var u=(function(){for(var c,f=[],h=0;h<256;h++){c=h;for(var p=0;p<8;p++)c=1&c?3988292384^c>>>1:c>>>1;f[h]=c}return f})();l.exports=function(c,f,h,p){var b=u,x=p+h;c^=-1;for(var w=p;w<x;w++)c=c>>>8^b[255&(c^f[w])];return-1^c}},{}],46:[function(i,l,o){var u,c=i("../utils/common"),f=i("./trees"),h=i("./adler32"),p=i("./crc32"),b=i("./messages"),x=0,w=4,y=0,j=-2,v=-1,k=4,S=2,_=8,N=9,B=286,D=30,z=19,R=2*B+1,G=15,P=3,q=258,W=q+P+1,I=42,X=113,E=1,Q=2,$=3,J=4;function ve(A,pe){return A.msg=b[pe],pe}function ee(A){return(A<<1)-(4<A?9:0)}function L(A){for(var pe=A.length;0<=--pe;)A[pe]=0}function O(A){var pe=A.state,re=pe.pending;re>A.avail_out&&(re=A.avail_out),re!==0&&(c.arraySet(A.output,pe.pending_buf,pe.pending_out,re,A.next_out),A.next_out+=re,pe.pending_out+=re,A.total_out+=re,A.avail_out-=re,pe.pending-=re,pe.pending===0&&(pe.pending_out=0))}function H(A,pe){f._tr_flush_block(A,0<=A.block_start?A.block_start:-1,A.strstart-A.block_start,pe),A.block_start=A.strstart,O(A.strm)}function M(A,pe){A.pending_buf[A.pending++]=pe}function ie(A,pe){A.pending_buf[A.pending++]=pe>>>8&255,A.pending_buf[A.pending++]=255&pe}function V(A,pe){var re,Y,F=A.max_chain_length,ne=A.strstart,me=A.prev_length,de=A.nice_match,K=A.strstart>A.w_size-W?A.strstart-(A.w_size-W):0,xe=A.window,Ee=A.w_mask,ke=A.prev,ae=A.strstart+q,ye=xe[ne+me-1],Ae=xe[ne+me];A.prev_length>=A.good_match&&(F>>=2),de>A.lookahead&&(de=A.lookahead);do if(xe[(re=pe)+me]===Ae&&xe[re+me-1]===ye&&xe[re]===xe[ne]&&xe[++re]===xe[ne+1]){ne+=2,re++;do;while(xe[++ne]===xe[++re]&&xe[++ne]===xe[++re]&&xe[++ne]===xe[++re]&&xe[++ne]===xe[++re]&&xe[++ne]===xe[++re]&&xe[++ne]===xe[++re]&&xe[++ne]===xe[++re]&&xe[++ne]===xe[++re]&&ne<ae);if(Y=q-(ae-ne),ne=ae-q,me<Y){if(A.match_start=pe,de<=(me=Y))break;ye=xe[ne+me-1],Ae=xe[ne+me]}}while((pe=ke[pe&Ee])>K&&--F!=0);return me<=A.lookahead?me:A.lookahead}function se(A){var pe,re,Y,F,ne,me,de,K,xe,Ee,ke=A.w_size;do{if(F=A.window_size-A.lookahead-A.strstart,A.strstart>=ke+(ke-W)){for(c.arraySet(A.window,A.window,ke,ke,0),A.match_start-=ke,A.strstart-=ke,A.block_start-=ke,pe=re=A.hash_size;Y=A.head[--pe],A.head[pe]=ke<=Y?Y-ke:0,--re;);for(pe=re=ke;Y=A.prev[--pe],A.prev[pe]=ke<=Y?Y-ke:0,--re;);F+=ke}if(A.strm.avail_in===0)break;if(me=A.strm,de=A.window,K=A.strstart+A.lookahead,xe=F,Ee=void 0,Ee=me.avail_in,xe<Ee&&(Ee=xe),re=Ee===0?0:(me.avail_in-=Ee,c.arraySet(de,me.input,me.next_in,Ee,K),me.state.wrap===1?me.adler=h(me.adler,de,Ee,K):me.state.wrap===2&&(me.adler=p(me.adler,de,Ee,K)),me.next_in+=Ee,me.total_in+=Ee,Ee),A.lookahead+=re,A.lookahead+A.insert>=P)for(ne=A.strstart-A.insert,A.ins_h=A.window[ne],A.ins_h=(A.ins_h<<A.hash_shift^A.window[ne+1])&A.hash_mask;A.insert&&(A.ins_h=(A.ins_h<<A.hash_shift^A.window[ne+P-1])&A.hash_mask,A.prev[ne&A.w_mask]=A.head[A.ins_h],A.head[A.ins_h]=ne,ne++,A.insert--,!(A.lookahead+A.insert<P)););}while(A.lookahead<W&&A.strm.avail_in!==0)}function ze(A,pe){for(var re,Y;;){if(A.lookahead<W){if(se(A),A.lookahead<W&&pe===x)return E;if(A.lookahead===0)break}if(re=0,A.lookahead>=P&&(A.ins_h=(A.ins_h<<A.hash_shift^A.window[A.strstart+P-1])&A.hash_mask,re=A.prev[A.strstart&A.w_mask]=A.head[A.ins_h],A.head[A.ins_h]=A.strstart),re!==0&&A.strstart-re<=A.w_size-W&&(A.match_length=V(A,re)),A.match_length>=P)if(Y=f._tr_tally(A,A.strstart-A.match_start,A.match_length-P),A.lookahead-=A.match_length,A.match_length<=A.max_lazy_match&&A.lookahead>=P){for(A.match_length--;A.strstart++,A.ins_h=(A.ins_h<<A.hash_shift^A.window[A.strstart+P-1])&A.hash_mask,re=A.prev[A.strstart&A.w_mask]=A.head[A.ins_h],A.head[A.ins_h]=A.strstart,--A.match_length!=0;);A.strstart++}else A.strstart+=A.match_length,A.match_length=0,A.ins_h=A.window[A.strstart],A.ins_h=(A.ins_h<<A.hash_shift^A.window[A.strstart+1])&A.hash_mask;else Y=f._tr_tally(A,0,A.window[A.strstart]),A.lookahead--,A.strstart++;if(Y&&(H(A,!1),A.strm.avail_out===0))return E}return A.insert=A.strstart<P-1?A.strstart:P-1,pe===w?(H(A,!0),A.strm.avail_out===0?$:J):A.last_lit&&(H(A,!1),A.strm.avail_out===0)?E:Q}function Re(A,pe){for(var re,Y,F;;){if(A.lookahead<W){if(se(A),A.lookahead<W&&pe===x)return E;if(A.lookahead===0)break}if(re=0,A.lookahead>=P&&(A.ins_h=(A.ins_h<<A.hash_shift^A.window[A.strstart+P-1])&A.hash_mask,re=A.prev[A.strstart&A.w_mask]=A.head[A.ins_h],A.head[A.ins_h]=A.strstart),A.prev_length=A.match_length,A.prev_match=A.match_start,A.match_length=P-1,re!==0&&A.prev_length<A.max_lazy_match&&A.strstart-re<=A.w_size-W&&(A.match_length=V(A,re),A.match_length<=5&&(A.strategy===1||A.match_length===P&&4096<A.strstart-A.match_start)&&(A.match_length=P-1)),A.prev_length>=P&&A.match_length<=A.prev_length){for(F=A.strstart+A.lookahead-P,Y=f._tr_tally(A,A.strstart-1-A.prev_match,A.prev_length-P),A.lookahead-=A.prev_length-1,A.prev_length-=2;++A.strstart<=F&&(A.ins_h=(A.ins_h<<A.hash_shift^A.window[A.strstart+P-1])&A.hash_mask,re=A.prev[A.strstart&A.w_mask]=A.head[A.ins_h],A.head[A.ins_h]=A.strstart),--A.prev_length!=0;);if(A.match_available=0,A.match_length=P-1,A.strstart++,Y&&(H(A,!1),A.strm.avail_out===0))return E}else if(A.match_available){if((Y=f._tr_tally(A,0,A.window[A.strstart-1]))&&H(A,!1),A.strstart++,A.lookahead--,A.strm.avail_out===0)return E}else A.match_available=1,A.strstart++,A.lookahead--}return A.match_available&&(Y=f._tr_tally(A,0,A.window[A.strstart-1]),A.match_available=0),A.insert=A.strstart<P-1?A.strstart:P-1,pe===w?(H(A,!0),A.strm.avail_out===0?$:J):A.last_lit&&(H(A,!1),A.strm.avail_out===0)?E:Q}function De(A,pe,re,Y,F){this.good_length=A,this.max_lazy=pe,this.nice_length=re,this.max_chain=Y,this.func=F}function Pe(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=_,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new c.Buf16(2*R),this.dyn_dtree=new c.Buf16(2*(2*D+1)),this.bl_tree=new c.Buf16(2*(2*z+1)),L(this.dyn_ltree),L(this.dyn_dtree),L(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new c.Buf16(G+1),this.heap=new c.Buf16(2*B+1),L(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new c.Buf16(2*B+1),L(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function Ge(A){var pe;return A&&A.state?(A.total_in=A.total_out=0,A.data_type=S,(pe=A.state).pending=0,pe.pending_out=0,pe.wrap<0&&(pe.wrap=-pe.wrap),pe.status=pe.wrap?I:X,A.adler=pe.wrap===2?0:1,pe.last_flush=x,f._tr_init(pe),y):ve(A,j)}function nt(A){var pe=Ge(A);return pe===y&&(function(re){re.window_size=2*re.w_size,L(re.head),re.max_lazy_match=u[re.level].max_lazy,re.good_match=u[re.level].good_length,re.nice_match=u[re.level].nice_length,re.max_chain_length=u[re.level].max_chain,re.strstart=0,re.block_start=0,re.lookahead=0,re.insert=0,re.match_length=re.prev_length=P-1,re.match_available=0,re.ins_h=0})(A.state),pe}function ht(A,pe,re,Y,F,ne){if(!A)return j;var me=1;if(pe===v&&(pe=6),Y<0?(me=0,Y=-Y):15<Y&&(me=2,Y-=16),F<1||N<F||re!==_||Y<8||15<Y||pe<0||9<pe||ne<0||k<ne)return ve(A,j);Y===8&&(Y=9);var de=new Pe;return(A.state=de).strm=A,de.wrap=me,de.gzhead=null,de.w_bits=Y,de.w_size=1<<de.w_bits,de.w_mask=de.w_size-1,de.hash_bits=F+7,de.hash_size=1<<de.hash_bits,de.hash_mask=de.hash_size-1,de.hash_shift=~~((de.hash_bits+P-1)/P),de.window=new c.Buf8(2*de.w_size),de.head=new c.Buf16(de.hash_size),de.prev=new c.Buf16(de.w_size),de.lit_bufsize=1<<F+6,de.pending_buf_size=4*de.lit_bufsize,de.pending_buf=new c.Buf8(de.pending_buf_size),de.d_buf=1*de.lit_bufsize,de.l_buf=3*de.lit_bufsize,de.level=pe,de.strategy=ne,de.method=re,nt(A)}u=[new De(0,0,0,0,function(A,pe){var re=65535;for(re>A.pending_buf_size-5&&(re=A.pending_buf_size-5);;){if(A.lookahead<=1){if(se(A),A.lookahead===0&&pe===x)return E;if(A.lookahead===0)break}A.strstart+=A.lookahead,A.lookahead=0;var Y=A.block_start+re;if((A.strstart===0||A.strstart>=Y)&&(A.lookahead=A.strstart-Y,A.strstart=Y,H(A,!1),A.strm.avail_out===0)||A.strstart-A.block_start>=A.w_size-W&&(H(A,!1),A.strm.avail_out===0))return E}return A.insert=0,pe===w?(H(A,!0),A.strm.avail_out===0?$:J):(A.strstart>A.block_start&&(H(A,!1),A.strm.avail_out),E)}),new De(4,4,8,4,ze),new De(4,5,16,8,ze),new De(4,6,32,32,ze),new De(4,4,16,16,Re),new De(8,16,32,32,Re),new De(8,16,128,128,Re),new De(8,32,128,256,Re),new De(32,128,258,1024,Re),new De(32,258,258,4096,Re)],o.deflateInit=function(A,pe){return ht(A,pe,_,15,8,0)},o.deflateInit2=ht,o.deflateReset=nt,o.deflateResetKeep=Ge,o.deflateSetHeader=function(A,pe){return A&&A.state?A.state.wrap!==2?j:(A.state.gzhead=pe,y):j},o.deflate=function(A,pe){var re,Y,F,ne;if(!A||!A.state||5<pe||pe<0)return A?ve(A,j):j;if(Y=A.state,!A.output||!A.input&&A.avail_in!==0||Y.status===666&&pe!==w)return ve(A,A.avail_out===0?-5:j);if(Y.strm=A,re=Y.last_flush,Y.last_flush=pe,Y.status===I)if(Y.wrap===2)A.adler=0,M(Y,31),M(Y,139),M(Y,8),Y.gzhead?(M(Y,(Y.gzhead.text?1:0)+(Y.gzhead.hcrc?2:0)+(Y.gzhead.extra?4:0)+(Y.gzhead.name?8:0)+(Y.gzhead.comment?16:0)),M(Y,255&Y.gzhead.time),M(Y,Y.gzhead.time>>8&255),M(Y,Y.gzhead.time>>16&255),M(Y,Y.gzhead.time>>24&255),M(Y,Y.level===9?2:2<=Y.strategy||Y.level<2?4:0),M(Y,255&Y.gzhead.os),Y.gzhead.extra&&Y.gzhead.extra.length&&(M(Y,255&Y.gzhead.extra.length),M(Y,Y.gzhead.extra.length>>8&255)),Y.gzhead.hcrc&&(A.adler=p(A.adler,Y.pending_buf,Y.pending,0)),Y.gzindex=0,Y.status=69):(M(Y,0),M(Y,0),M(Y,0),M(Y,0),M(Y,0),M(Y,Y.level===9?2:2<=Y.strategy||Y.level<2?4:0),M(Y,3),Y.status=X);else{var me=_+(Y.w_bits-8<<4)<<8;me|=(2<=Y.strategy||Y.level<2?0:Y.level<6?1:Y.level===6?2:3)<<6,Y.strstart!==0&&(me|=32),me+=31-me%31,Y.status=X,ie(Y,me),Y.strstart!==0&&(ie(Y,A.adler>>>16),ie(Y,65535&A.adler)),A.adler=1}if(Y.status===69)if(Y.gzhead.extra){for(F=Y.pending;Y.gzindex<(65535&Y.gzhead.extra.length)&&(Y.pending!==Y.pending_buf_size||(Y.gzhead.hcrc&&Y.pending>F&&(A.adler=p(A.adler,Y.pending_buf,Y.pending-F,F)),O(A),F=Y.pending,Y.pending!==Y.pending_buf_size));)M(Y,255&Y.gzhead.extra[Y.gzindex]),Y.gzindex++;Y.gzhead.hcrc&&Y.pending>F&&(A.adler=p(A.adler,Y.pending_buf,Y.pending-F,F)),Y.gzindex===Y.gzhead.extra.length&&(Y.gzindex=0,Y.status=73)}else Y.status=73;if(Y.status===73)if(Y.gzhead.name){F=Y.pending;do{if(Y.pending===Y.pending_buf_size&&(Y.gzhead.hcrc&&Y.pending>F&&(A.adler=p(A.adler,Y.pending_buf,Y.pending-F,F)),O(A),F=Y.pending,Y.pending===Y.pending_buf_size)){ne=1;break}ne=Y.gzindex<Y.gzhead.name.length?255&Y.gzhead.name.charCodeAt(Y.gzindex++):0,M(Y,ne)}while(ne!==0);Y.gzhead.hcrc&&Y.pending>F&&(A.adler=p(A.adler,Y.pending_buf,Y.pending-F,F)),ne===0&&(Y.gzindex=0,Y.status=91)}else Y.status=91;if(Y.status===91)if(Y.gzhead.comment){F=Y.pending;do{if(Y.pending===Y.pending_buf_size&&(Y.gzhead.hcrc&&Y.pending>F&&(A.adler=p(A.adler,Y.pending_buf,Y.pending-F,F)),O(A),F=Y.pending,Y.pending===Y.pending_buf_size)){ne=1;break}ne=Y.gzindex<Y.gzhead.comment.length?255&Y.gzhead.comment.charCodeAt(Y.gzindex++):0,M(Y,ne)}while(ne!==0);Y.gzhead.hcrc&&Y.pending>F&&(A.adler=p(A.adler,Y.pending_buf,Y.pending-F,F)),ne===0&&(Y.status=103)}else Y.status=103;if(Y.status===103&&(Y.gzhead.hcrc?(Y.pending+2>Y.pending_buf_size&&O(A),Y.pending+2<=Y.pending_buf_size&&(M(Y,255&A.adler),M(Y,A.adler>>8&255),A.adler=0,Y.status=X)):Y.status=X),Y.pending!==0){if(O(A),A.avail_out===0)return Y.last_flush=-1,y}else if(A.avail_in===0&&ee(pe)<=ee(re)&&pe!==w)return ve(A,-5);if(Y.status===666&&A.avail_in!==0)return ve(A,-5);if(A.avail_in!==0||Y.lookahead!==0||pe!==x&&Y.status!==666){var de=Y.strategy===2?(function(K,xe){for(var Ee;;){if(K.lookahead===0&&(se(K),K.lookahead===0)){if(xe===x)return E;break}if(K.match_length=0,Ee=f._tr_tally(K,0,K.window[K.strstart]),K.lookahead--,K.strstart++,Ee&&(H(K,!1),K.strm.avail_out===0))return E}return K.insert=0,xe===w?(H(K,!0),K.strm.avail_out===0?$:J):K.last_lit&&(H(K,!1),K.strm.avail_out===0)?E:Q})(Y,pe):Y.strategy===3?(function(K,xe){for(var Ee,ke,ae,ye,Ae=K.window;;){if(K.lookahead<=q){if(se(K),K.lookahead<=q&&xe===x)return E;if(K.lookahead===0)break}if(K.match_length=0,K.lookahead>=P&&0<K.strstart&&(ke=Ae[ae=K.strstart-1])===Ae[++ae]&&ke===Ae[++ae]&&ke===Ae[++ae]){ye=K.strstart+q;do;while(ke===Ae[++ae]&&ke===Ae[++ae]&&ke===Ae[++ae]&&ke===Ae[++ae]&&ke===Ae[++ae]&&ke===Ae[++ae]&&ke===Ae[++ae]&&ke===Ae[++ae]&&ae<ye);K.match_length=q-(ye-ae),K.match_length>K.lookahead&&(K.match_length=K.lookahead)}if(K.match_length>=P?(Ee=f._tr_tally(K,1,K.match_length-P),K.lookahead-=K.match_length,K.strstart+=K.match_length,K.match_length=0):(Ee=f._tr_tally(K,0,K.window[K.strstart]),K.lookahead--,K.strstart++),Ee&&(H(K,!1),K.strm.avail_out===0))return E}return K.insert=0,xe===w?(H(K,!0),K.strm.avail_out===0?$:J):K.last_lit&&(H(K,!1),K.strm.avail_out===0)?E:Q})(Y,pe):u[Y.level].func(Y,pe);if(de!==$&&de!==J||(Y.status=666),de===E||de===$)return A.avail_out===0&&(Y.last_flush=-1),y;if(de===Q&&(pe===1?f._tr_align(Y):pe!==5&&(f._tr_stored_block(Y,0,0,!1),pe===3&&(L(Y.head),Y.lookahead===0&&(Y.strstart=0,Y.block_start=0,Y.insert=0))),O(A),A.avail_out===0))return Y.last_flush=-1,y}return pe!==w?y:Y.wrap<=0?1:(Y.wrap===2?(M(Y,255&A.adler),M(Y,A.adler>>8&255),M(Y,A.adler>>16&255),M(Y,A.adler>>24&255),M(Y,255&A.total_in),M(Y,A.total_in>>8&255),M(Y,A.total_in>>16&255),M(Y,A.total_in>>24&255)):(ie(Y,A.adler>>>16),ie(Y,65535&A.adler)),O(A),0<Y.wrap&&(Y.wrap=-Y.wrap),Y.pending!==0?y:1)},o.deflateEnd=function(A){var pe;return A&&A.state?(pe=A.state.status)!==I&&pe!==69&&pe!==73&&pe!==91&&pe!==103&&pe!==X&&pe!==666?ve(A,j):(A.state=null,pe===X?ve(A,-3):y):j},o.deflateSetDictionary=function(A,pe){var re,Y,F,ne,me,de,K,xe,Ee=pe.length;if(!A||!A.state||(ne=(re=A.state).wrap)===2||ne===1&&re.status!==I||re.lookahead)return j;for(ne===1&&(A.adler=h(A.adler,pe,Ee,0)),re.wrap=0,Ee>=re.w_size&&(ne===0&&(L(re.head),re.strstart=0,re.block_start=0,re.insert=0),xe=new c.Buf8(re.w_size),c.arraySet(xe,pe,Ee-re.w_size,re.w_size,0),pe=xe,Ee=re.w_size),me=A.avail_in,de=A.next_in,K=A.input,A.avail_in=Ee,A.next_in=0,A.input=pe,se(re);re.lookahead>=P;){for(Y=re.strstart,F=re.lookahead-(P-1);re.ins_h=(re.ins_h<<re.hash_shift^re.window[Y+P-1])&re.hash_mask,re.prev[Y&re.w_mask]=re.head[re.ins_h],re.head[re.ins_h]=Y,Y++,--F;);re.strstart=Y,re.lookahead=P-1,se(re)}return re.strstart+=re.lookahead,re.block_start=re.strstart,re.insert=re.lookahead,re.lookahead=0,re.match_length=re.prev_length=P-1,re.match_available=0,A.next_in=de,A.input=K,A.avail_in=me,re.wrap=ne,y},o.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./messages":51,"./trees":52}],47:[function(i,l,o){l.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},{}],48:[function(i,l,o){l.exports=function(u,c){var f,h,p,b,x,w,y,j,v,k,S,_,N,B,D,z,R,G,P,q,W,I,X,E,Q;f=u.state,h=u.next_in,E=u.input,p=h+(u.avail_in-5),b=u.next_out,Q=u.output,x=b-(c-u.avail_out),w=b+(u.avail_out-257),y=f.dmax,j=f.wsize,v=f.whave,k=f.wnext,S=f.window,_=f.hold,N=f.bits,B=f.lencode,D=f.distcode,z=(1<<f.lenbits)-1,R=(1<<f.distbits)-1;e:do{N<15&&(_+=E[h++]<<N,N+=8,_+=E[h++]<<N,N+=8),G=B[_&z];t:for(;;){if(_>>>=P=G>>>24,N-=P,(P=G>>>16&255)===0)Q[b++]=65535&G;else{if(!(16&P)){if((64&P)==0){G=B[(65535&G)+(_&(1<<P)-1)];continue t}if(32&P){f.mode=12;break e}u.msg="invalid literal/length code",f.mode=30;break e}q=65535&G,(P&=15)&&(N<P&&(_+=E[h++]<<N,N+=8),q+=_&(1<<P)-1,_>>>=P,N-=P),N<15&&(_+=E[h++]<<N,N+=8,_+=E[h++]<<N,N+=8),G=D[_&R];n:for(;;){if(_>>>=P=G>>>24,N-=P,!(16&(P=G>>>16&255))){if((64&P)==0){G=D[(65535&G)+(_&(1<<P)-1)];continue n}u.msg="invalid distance code",f.mode=30;break e}if(W=65535&G,N<(P&=15)&&(_+=E[h++]<<N,(N+=8)<P&&(_+=E[h++]<<N,N+=8)),y<(W+=_&(1<<P)-1)){u.msg="invalid distance too far back",f.mode=30;break e}if(_>>>=P,N-=P,(P=b-x)<W){if(v<(P=W-P)&&f.sane){u.msg="invalid distance too far back",f.mode=30;break e}if(X=S,(I=0)===k){if(I+=j-P,P<q){for(q-=P;Q[b++]=S[I++],--P;);I=b-W,X=Q}}else if(k<P){if(I+=j+k-P,(P-=k)<q){for(q-=P;Q[b++]=S[I++],--P;);if(I=0,k<q){for(q-=P=k;Q[b++]=S[I++],--P;);I=b-W,X=Q}}}else if(I+=k-P,P<q){for(q-=P;Q[b++]=S[I++],--P;);I=b-W,X=Q}for(;2<q;)Q[b++]=X[I++],Q[b++]=X[I++],Q[b++]=X[I++],q-=3;q&&(Q[b++]=X[I++],1<q&&(Q[b++]=X[I++]))}else{for(I=b-W;Q[b++]=Q[I++],Q[b++]=Q[I++],Q[b++]=Q[I++],2<(q-=3););q&&(Q[b++]=Q[I++],1<q&&(Q[b++]=Q[I++]))}break}}break}}while(h<p&&b<w);h-=q=N>>3,_&=(1<<(N-=q<<3))-1,u.next_in=h,u.next_out=b,u.avail_in=h<p?p-h+5:5-(h-p),u.avail_out=b<w?w-b+257:257-(b-w),f.hold=_,f.bits=N}},{}],49:[function(i,l,o){var u=i("../utils/common"),c=i("./adler32"),f=i("./crc32"),h=i("./inffast"),p=i("./inftrees"),b=1,x=2,w=0,y=-2,j=1,v=852,k=592;function S(I){return(I>>>24&255)+(I>>>8&65280)+((65280&I)<<8)+((255&I)<<24)}function _(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new u.Buf16(320),this.work=new u.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function N(I){var X;return I&&I.state?(X=I.state,I.total_in=I.total_out=X.total=0,I.msg="",X.wrap&&(I.adler=1&X.wrap),X.mode=j,X.last=0,X.havedict=0,X.dmax=32768,X.head=null,X.hold=0,X.bits=0,X.lencode=X.lendyn=new u.Buf32(v),X.distcode=X.distdyn=new u.Buf32(k),X.sane=1,X.back=-1,w):y}function B(I){var X;return I&&I.state?((X=I.state).wsize=0,X.whave=0,X.wnext=0,N(I)):y}function D(I,X){var E,Q;return I&&I.state?(Q=I.state,X<0?(E=0,X=-X):(E=1+(X>>4),X<48&&(X&=15)),X&&(X<8||15<X)?y:(Q.window!==null&&Q.wbits!==X&&(Q.window=null),Q.wrap=E,Q.wbits=X,B(I))):y}function z(I,X){var E,Q;return I?(Q=new _,(I.state=Q).window=null,(E=D(I,X))!==w&&(I.state=null),E):y}var R,G,P=!0;function q(I){if(P){var X;for(R=new u.Buf32(512),G=new u.Buf32(32),X=0;X<144;)I.lens[X++]=8;for(;X<256;)I.lens[X++]=9;for(;X<280;)I.lens[X++]=7;for(;X<288;)I.lens[X++]=8;for(p(b,I.lens,0,288,R,0,I.work,{bits:9}),X=0;X<32;)I.lens[X++]=5;p(x,I.lens,0,32,G,0,I.work,{bits:5}),P=!1}I.lencode=R,I.lenbits=9,I.distcode=G,I.distbits=5}function W(I,X,E,Q){var $,J=I.state;return J.window===null&&(J.wsize=1<<J.wbits,J.wnext=0,J.whave=0,J.window=new u.Buf8(J.wsize)),Q>=J.wsize?(u.arraySet(J.window,X,E-J.wsize,J.wsize,0),J.wnext=0,J.whave=J.wsize):(Q<($=J.wsize-J.wnext)&&($=Q),u.arraySet(J.window,X,E-Q,$,J.wnext),(Q-=$)?(u.arraySet(J.window,X,E-Q,Q,0),J.wnext=Q,J.whave=J.wsize):(J.wnext+=$,J.wnext===J.wsize&&(J.wnext=0),J.whave<J.wsize&&(J.whave+=$))),0}o.inflateReset=B,o.inflateReset2=D,o.inflateResetKeep=N,o.inflateInit=function(I){return z(I,15)},o.inflateInit2=z,o.inflate=function(I,X){var E,Q,$,J,ve,ee,L,O,H,M,ie,V,se,ze,Re,De,Pe,Ge,nt,ht,A,pe,re,Y,F=0,ne=new u.Buf8(4),me=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!I||!I.state||!I.output||!I.input&&I.avail_in!==0)return y;(E=I.state).mode===12&&(E.mode=13),ve=I.next_out,$=I.output,L=I.avail_out,J=I.next_in,Q=I.input,ee=I.avail_in,O=E.hold,H=E.bits,M=ee,ie=L,pe=w;e:for(;;)switch(E.mode){case j:if(E.wrap===0){E.mode=13;break}for(;H<16;){if(ee===0)break e;ee--,O+=Q[J++]<<H,H+=8}if(2&E.wrap&&O===35615){ne[E.check=0]=255&O,ne[1]=O>>>8&255,E.check=f(E.check,ne,2,0),H=O=0,E.mode=2;break}if(E.flags=0,E.head&&(E.head.done=!1),!(1&E.wrap)||(((255&O)<<8)+(O>>8))%31){I.msg="incorrect header check",E.mode=30;break}if((15&O)!=8){I.msg="unknown compression method",E.mode=30;break}if(H-=4,A=8+(15&(O>>>=4)),E.wbits===0)E.wbits=A;else if(A>E.wbits){I.msg="invalid window size",E.mode=30;break}E.dmax=1<<A,I.adler=E.check=1,E.mode=512&O?10:12,H=O=0;break;case 2:for(;H<16;){if(ee===0)break e;ee--,O+=Q[J++]<<H,H+=8}if(E.flags=O,(255&E.flags)!=8){I.msg="unknown compression method",E.mode=30;break}if(57344&E.flags){I.msg="unknown header flags set",E.mode=30;break}E.head&&(E.head.text=O>>8&1),512&E.flags&&(ne[0]=255&O,ne[1]=O>>>8&255,E.check=f(E.check,ne,2,0)),H=O=0,E.mode=3;case 3:for(;H<32;){if(ee===0)break e;ee--,O+=Q[J++]<<H,H+=8}E.head&&(E.head.time=O),512&E.flags&&(ne[0]=255&O,ne[1]=O>>>8&255,ne[2]=O>>>16&255,ne[3]=O>>>24&255,E.check=f(E.check,ne,4,0)),H=O=0,E.mode=4;case 4:for(;H<16;){if(ee===0)break e;ee--,O+=Q[J++]<<H,H+=8}E.head&&(E.head.xflags=255&O,E.head.os=O>>8),512&E.flags&&(ne[0]=255&O,ne[1]=O>>>8&255,E.check=f(E.check,ne,2,0)),H=O=0,E.mode=5;case 5:if(1024&E.flags){for(;H<16;){if(ee===0)break e;ee--,O+=Q[J++]<<H,H+=8}E.length=O,E.head&&(E.head.extra_len=O),512&E.flags&&(ne[0]=255&O,ne[1]=O>>>8&255,E.check=f(E.check,ne,2,0)),H=O=0}else E.head&&(E.head.extra=null);E.mode=6;case 6:if(1024&E.flags&&(ee<(V=E.length)&&(V=ee),V&&(E.head&&(A=E.head.extra_len-E.length,E.head.extra||(E.head.extra=new Array(E.head.extra_len)),u.arraySet(E.head.extra,Q,J,V,A)),512&E.flags&&(E.check=f(E.check,Q,V,J)),ee-=V,J+=V,E.length-=V),E.length))break e;E.length=0,E.mode=7;case 7:if(2048&E.flags){if(ee===0)break e;for(V=0;A=Q[J+V++],E.head&&A&&E.length<65536&&(E.head.name+=String.fromCharCode(A)),A&&V<ee;);if(512&E.flags&&(E.check=f(E.check,Q,V,J)),ee-=V,J+=V,A)break e}else E.head&&(E.head.name=null);E.length=0,E.mode=8;case 8:if(4096&E.flags){if(ee===0)break e;for(V=0;A=Q[J+V++],E.head&&A&&E.length<65536&&(E.head.comment+=String.fromCharCode(A)),A&&V<ee;);if(512&E.flags&&(E.check=f(E.check,Q,V,J)),ee-=V,J+=V,A)break e}else E.head&&(E.head.comment=null);E.mode=9;case 9:if(512&E.flags){for(;H<16;){if(ee===0)break e;ee--,O+=Q[J++]<<H,H+=8}if(O!==(65535&E.check)){I.msg="header crc mismatch",E.mode=30;break}H=O=0}E.head&&(E.head.hcrc=E.flags>>9&1,E.head.done=!0),I.adler=E.check=0,E.mode=12;break;case 10:for(;H<32;){if(ee===0)break e;ee--,O+=Q[J++]<<H,H+=8}I.adler=E.check=S(O),H=O=0,E.mode=11;case 11:if(E.havedict===0)return I.next_out=ve,I.avail_out=L,I.next_in=J,I.avail_in=ee,E.hold=O,E.bits=H,2;I.adler=E.check=1,E.mode=12;case 12:if(X===5||X===6)break e;case 13:if(E.last){O>>>=7&H,H-=7&H,E.mode=27;break}for(;H<3;){if(ee===0)break e;ee--,O+=Q[J++]<<H,H+=8}switch(E.last=1&O,H-=1,3&(O>>>=1)){case 0:E.mode=14;break;case 1:if(q(E),E.mode=20,X!==6)break;O>>>=2,H-=2;break e;case 2:E.mode=17;break;case 3:I.msg="invalid block type",E.mode=30}O>>>=2,H-=2;break;case 14:for(O>>>=7&H,H-=7&H;H<32;){if(ee===0)break e;ee--,O+=Q[J++]<<H,H+=8}if((65535&O)!=(O>>>16^65535)){I.msg="invalid stored block lengths",E.mode=30;break}if(E.length=65535&O,H=O=0,E.mode=15,X===6)break e;case 15:E.mode=16;case 16:if(V=E.length){if(ee<V&&(V=ee),L<V&&(V=L),V===0)break e;u.arraySet($,Q,J,V,ve),ee-=V,J+=V,L-=V,ve+=V,E.length-=V;break}E.mode=12;break;case 17:for(;H<14;){if(ee===0)break e;ee--,O+=Q[J++]<<H,H+=8}if(E.nlen=257+(31&O),O>>>=5,H-=5,E.ndist=1+(31&O),O>>>=5,H-=5,E.ncode=4+(15&O),O>>>=4,H-=4,286<E.nlen||30<E.ndist){I.msg="too many length or distance symbols",E.mode=30;break}E.have=0,E.mode=18;case 18:for(;E.have<E.ncode;){for(;H<3;){if(ee===0)break e;ee--,O+=Q[J++]<<H,H+=8}E.lens[me[E.have++]]=7&O,O>>>=3,H-=3}for(;E.have<19;)E.lens[me[E.have++]]=0;if(E.lencode=E.lendyn,E.lenbits=7,re={bits:E.lenbits},pe=p(0,E.lens,0,19,E.lencode,0,E.work,re),E.lenbits=re.bits,pe){I.msg="invalid code lengths set",E.mode=30;break}E.have=0,E.mode=19;case 19:for(;E.have<E.nlen+E.ndist;){for(;De=(F=E.lencode[O&(1<<E.lenbits)-1])>>>16&255,Pe=65535&F,!((Re=F>>>24)<=H);){if(ee===0)break e;ee--,O+=Q[J++]<<H,H+=8}if(Pe<16)O>>>=Re,H-=Re,E.lens[E.have++]=Pe;else{if(Pe===16){for(Y=Re+2;H<Y;){if(ee===0)break e;ee--,O+=Q[J++]<<H,H+=8}if(O>>>=Re,H-=Re,E.have===0){I.msg="invalid bit length repeat",E.mode=30;break}A=E.lens[E.have-1],V=3+(3&O),O>>>=2,H-=2}else if(Pe===17){for(Y=Re+3;H<Y;){if(ee===0)break e;ee--,O+=Q[J++]<<H,H+=8}H-=Re,A=0,V=3+(7&(O>>>=Re)),O>>>=3,H-=3}else{for(Y=Re+7;H<Y;){if(ee===0)break e;ee--,O+=Q[J++]<<H,H+=8}H-=Re,A=0,V=11+(127&(O>>>=Re)),O>>>=7,H-=7}if(E.have+V>E.nlen+E.ndist){I.msg="invalid bit length repeat",E.mode=30;break}for(;V--;)E.lens[E.have++]=A}}if(E.mode===30)break;if(E.lens[256]===0){I.msg="invalid code -- missing end-of-block",E.mode=30;break}if(E.lenbits=9,re={bits:E.lenbits},pe=p(b,E.lens,0,E.nlen,E.lencode,0,E.work,re),E.lenbits=re.bits,pe){I.msg="invalid literal/lengths set",E.mode=30;break}if(E.distbits=6,E.distcode=E.distdyn,re={bits:E.distbits},pe=p(x,E.lens,E.nlen,E.ndist,E.distcode,0,E.work,re),E.distbits=re.bits,pe){I.msg="invalid distances set",E.mode=30;break}if(E.mode=20,X===6)break e;case 20:E.mode=21;case 21:if(6<=ee&&258<=L){I.next_out=ve,I.avail_out=L,I.next_in=J,I.avail_in=ee,E.hold=O,E.bits=H,h(I,ie),ve=I.next_out,$=I.output,L=I.avail_out,J=I.next_in,Q=I.input,ee=I.avail_in,O=E.hold,H=E.bits,E.mode===12&&(E.back=-1);break}for(E.back=0;De=(F=E.lencode[O&(1<<E.lenbits)-1])>>>16&255,Pe=65535&F,!((Re=F>>>24)<=H);){if(ee===0)break e;ee--,O+=Q[J++]<<H,H+=8}if(De&&(240&De)==0){for(Ge=Re,nt=De,ht=Pe;De=(F=E.lencode[ht+((O&(1<<Ge+nt)-1)>>Ge)])>>>16&255,Pe=65535&F,!(Ge+(Re=F>>>24)<=H);){if(ee===0)break e;ee--,O+=Q[J++]<<H,H+=8}O>>>=Ge,H-=Ge,E.back+=Ge}if(O>>>=Re,H-=Re,E.back+=Re,E.length=Pe,De===0){E.mode=26;break}if(32&De){E.back=-1,E.mode=12;break}if(64&De){I.msg="invalid literal/length code",E.mode=30;break}E.extra=15&De,E.mode=22;case 22:if(E.extra){for(Y=E.extra;H<Y;){if(ee===0)break e;ee--,O+=Q[J++]<<H,H+=8}E.length+=O&(1<<E.extra)-1,O>>>=E.extra,H-=E.extra,E.back+=E.extra}E.was=E.length,E.mode=23;case 23:for(;De=(F=E.distcode[O&(1<<E.distbits)-1])>>>16&255,Pe=65535&F,!((Re=F>>>24)<=H);){if(ee===0)break e;ee--,O+=Q[J++]<<H,H+=8}if((240&De)==0){for(Ge=Re,nt=De,ht=Pe;De=(F=E.distcode[ht+((O&(1<<Ge+nt)-1)>>Ge)])>>>16&255,Pe=65535&F,!(Ge+(Re=F>>>24)<=H);){if(ee===0)break e;ee--,O+=Q[J++]<<H,H+=8}O>>>=Ge,H-=Ge,E.back+=Ge}if(O>>>=Re,H-=Re,E.back+=Re,64&De){I.msg="invalid distance code",E.mode=30;break}E.offset=Pe,E.extra=15&De,E.mode=24;case 24:if(E.extra){for(Y=E.extra;H<Y;){if(ee===0)break e;ee--,O+=Q[J++]<<H,H+=8}E.offset+=O&(1<<E.extra)-1,O>>>=E.extra,H-=E.extra,E.back+=E.extra}if(E.offset>E.dmax){I.msg="invalid distance too far back",E.mode=30;break}E.mode=25;case 25:if(L===0)break e;if(V=ie-L,E.offset>V){if((V=E.offset-V)>E.whave&&E.sane){I.msg="invalid distance too far back",E.mode=30;break}se=V>E.wnext?(V-=E.wnext,E.wsize-V):E.wnext-V,V>E.length&&(V=E.length),ze=E.window}else ze=$,se=ve-E.offset,V=E.length;for(L<V&&(V=L),L-=V,E.length-=V;$[ve++]=ze[se++],--V;);E.length===0&&(E.mode=21);break;case 26:if(L===0)break e;$[ve++]=E.length,L--,E.mode=21;break;case 27:if(E.wrap){for(;H<32;){if(ee===0)break e;ee--,O|=Q[J++]<<H,H+=8}if(ie-=L,I.total_out+=ie,E.total+=ie,ie&&(I.adler=E.check=E.flags?f(E.check,$,ie,ve-ie):c(E.check,$,ie,ve-ie)),ie=L,(E.flags?O:S(O))!==E.check){I.msg="incorrect data check",E.mode=30;break}H=O=0}E.mode=28;case 28:if(E.wrap&&E.flags){for(;H<32;){if(ee===0)break e;ee--,O+=Q[J++]<<H,H+=8}if(O!==(4294967295&E.total)){I.msg="incorrect length check",E.mode=30;break}H=O=0}E.mode=29;case 29:pe=1;break e;case 30:pe=-3;break e;case 31:return-4;default:return y}return I.next_out=ve,I.avail_out=L,I.next_in=J,I.avail_in=ee,E.hold=O,E.bits=H,(E.wsize||ie!==I.avail_out&&E.mode<30&&(E.mode<27||X!==4))&&W(I,I.output,I.next_out,ie-I.avail_out)?(E.mode=31,-4):(M-=I.avail_in,ie-=I.avail_out,I.total_in+=M,I.total_out+=ie,E.total+=ie,E.wrap&&ie&&(I.adler=E.check=E.flags?f(E.check,$,ie,I.next_out-ie):c(E.check,$,ie,I.next_out-ie)),I.data_type=E.bits+(E.last?64:0)+(E.mode===12?128:0)+(E.mode===20||E.mode===15?256:0),(M==0&&ie===0||X===4)&&pe===w&&(pe=-5),pe)},o.inflateEnd=function(I){if(!I||!I.state)return y;var X=I.state;return X.window&&(X.window=null),I.state=null,w},o.inflateGetHeader=function(I,X){var E;return I&&I.state?(2&(E=I.state).wrap)==0?y:((E.head=X).done=!1,w):y},o.inflateSetDictionary=function(I,X){var E,Q=X.length;return I&&I.state?(E=I.state).wrap!==0&&E.mode!==11?y:E.mode===11&&c(1,X,Q,0)!==E.check?-3:W(I,X,Q,Q)?(E.mode=31,-4):(E.havedict=1,w):y},o.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./inffast":48,"./inftrees":50}],50:[function(i,l,o){var u=i("../utils/common"),c=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],f=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],h=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],p=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];l.exports=function(b,x,w,y,j,v,k,S){var _,N,B,D,z,R,G,P,q,W=S.bits,I=0,X=0,E=0,Q=0,$=0,J=0,ve=0,ee=0,L=0,O=0,H=null,M=0,ie=new u.Buf16(16),V=new u.Buf16(16),se=null,ze=0;for(I=0;I<=15;I++)ie[I]=0;for(X=0;X<y;X++)ie[x[w+X]]++;for($=W,Q=15;1<=Q&&ie[Q]===0;Q--);if(Q<$&&($=Q),Q===0)return j[v++]=20971520,j[v++]=20971520,S.bits=1,0;for(E=1;E<Q&&ie[E]===0;E++);for($<E&&($=E),I=ee=1;I<=15;I++)if(ee<<=1,(ee-=ie[I])<0)return-1;if(0<ee&&(b===0||Q!==1))return-1;for(V[1]=0,I=1;I<15;I++)V[I+1]=V[I]+ie[I];for(X=0;X<y;X++)x[w+X]!==0&&(k[V[x[w+X]]++]=X);if(R=b===0?(H=se=k,19):b===1?(H=c,M-=257,se=f,ze-=257,256):(H=h,se=p,-1),I=E,z=v,ve=X=O=0,B=-1,D=(L=1<<(J=$))-1,b===1&&852<L||b===2&&592<L)return 1;for(;;){for(G=I-ve,q=k[X]<R?(P=0,k[X]):k[X]>R?(P=se[ze+k[X]],H[M+k[X]]):(P=96,0),_=1<<I-ve,E=N=1<<J;j[z+(O>>ve)+(N-=_)]=G<<24|P<<16|q|0,N!==0;);for(_=1<<I-1;O&_;)_>>=1;if(_!==0?(O&=_-1,O+=_):O=0,X++,--ie[I]==0){if(I===Q)break;I=x[w+k[X]]}if($<I&&(O&D)!==B){for(ve===0&&(ve=$),z+=E,ee=1<<(J=I-ve);J+ve<Q&&!((ee-=ie[J+ve])<=0);)J++,ee<<=1;if(L+=1<<J,b===1&&852<L||b===2&&592<L)return 1;j[B=O&D]=$<<24|J<<16|z-v|0}}return O!==0&&(j[z+O]=I-ve<<24|64<<16|0),S.bits=$,0}},{"../utils/common":41}],51:[function(i,l,o){l.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],52:[function(i,l,o){var u=i("../utils/common"),c=0,f=1;function h(F){for(var ne=F.length;0<=--ne;)F[ne]=0}var p=0,b=29,x=256,w=x+1+b,y=30,j=19,v=2*w+1,k=15,S=16,_=7,N=256,B=16,D=17,z=18,R=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],G=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],P=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],q=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],W=new Array(2*(w+2));h(W);var I=new Array(2*y);h(I);var X=new Array(512);h(X);var E=new Array(256);h(E);var Q=new Array(b);h(Q);var $,J,ve,ee=new Array(y);function L(F,ne,me,de,K){this.static_tree=F,this.extra_bits=ne,this.extra_base=me,this.elems=de,this.max_length=K,this.has_stree=F&&F.length}function O(F,ne){this.dyn_tree=F,this.max_code=0,this.stat_desc=ne}function H(F){return F<256?X[F]:X[256+(F>>>7)]}function M(F,ne){F.pending_buf[F.pending++]=255&ne,F.pending_buf[F.pending++]=ne>>>8&255}function ie(F,ne,me){F.bi_valid>S-me?(F.bi_buf|=ne<<F.bi_valid&65535,M(F,F.bi_buf),F.bi_buf=ne>>S-F.bi_valid,F.bi_valid+=me-S):(F.bi_buf|=ne<<F.bi_valid&65535,F.bi_valid+=me)}function V(F,ne,me){ie(F,me[2*ne],me[2*ne+1])}function se(F,ne){for(var me=0;me|=1&F,F>>>=1,me<<=1,0<--ne;);return me>>>1}function ze(F,ne,me){var de,K,xe=new Array(k+1),Ee=0;for(de=1;de<=k;de++)xe[de]=Ee=Ee+me[de-1]<<1;for(K=0;K<=ne;K++){var ke=F[2*K+1];ke!==0&&(F[2*K]=se(xe[ke]++,ke))}}function Re(F){var ne;for(ne=0;ne<w;ne++)F.dyn_ltree[2*ne]=0;for(ne=0;ne<y;ne++)F.dyn_dtree[2*ne]=0;for(ne=0;ne<j;ne++)F.bl_tree[2*ne]=0;F.dyn_ltree[2*N]=1,F.opt_len=F.static_len=0,F.last_lit=F.matches=0}function De(F){8<F.bi_valid?M(F,F.bi_buf):0<F.bi_valid&&(F.pending_buf[F.pending++]=F.bi_buf),F.bi_buf=0,F.bi_valid=0}function Pe(F,ne,me,de){var K=2*ne,xe=2*me;return F[K]<F[xe]||F[K]===F[xe]&&de[ne]<=de[me]}function Ge(F,ne,me){for(var de=F.heap[me],K=me<<1;K<=F.heap_len&&(K<F.heap_len&&Pe(ne,F.heap[K+1],F.heap[K],F.depth)&&K++,!Pe(ne,de,F.heap[K],F.depth));)F.heap[me]=F.heap[K],me=K,K<<=1;F.heap[me]=de}function nt(F,ne,me){var de,K,xe,Ee,ke=0;if(F.last_lit!==0)for(;de=F.pending_buf[F.d_buf+2*ke]<<8|F.pending_buf[F.d_buf+2*ke+1],K=F.pending_buf[F.l_buf+ke],ke++,de===0?V(F,K,ne):(V(F,(xe=E[K])+x+1,ne),(Ee=R[xe])!==0&&ie(F,K-=Q[xe],Ee),V(F,xe=H(--de),me),(Ee=G[xe])!==0&&ie(F,de-=ee[xe],Ee)),ke<F.last_lit;);V(F,N,ne)}function ht(F,ne){var me,de,K,xe=ne.dyn_tree,Ee=ne.stat_desc.static_tree,ke=ne.stat_desc.has_stree,ae=ne.stat_desc.elems,ye=-1;for(F.heap_len=0,F.heap_max=v,me=0;me<ae;me++)xe[2*me]!==0?(F.heap[++F.heap_len]=ye=me,F.depth[me]=0):xe[2*me+1]=0;for(;F.heap_len<2;)xe[2*(K=F.heap[++F.heap_len]=ye<2?++ye:0)]=1,F.depth[K]=0,F.opt_len--,ke&&(F.static_len-=Ee[2*K+1]);for(ne.max_code=ye,me=F.heap_len>>1;1<=me;me--)Ge(F,xe,me);for(K=ae;me=F.heap[1],F.heap[1]=F.heap[F.heap_len--],Ge(F,xe,1),de=F.heap[1],F.heap[--F.heap_max]=me,F.heap[--F.heap_max]=de,xe[2*K]=xe[2*me]+xe[2*de],F.depth[K]=(F.depth[me]>=F.depth[de]?F.depth[me]:F.depth[de])+1,xe[2*me+1]=xe[2*de+1]=K,F.heap[1]=K++,Ge(F,xe,1),2<=F.heap_len;);F.heap[--F.heap_max]=F.heap[1],(function(Ae,Ie){var fe,we,Me,Be,Ve,Ke,Le=Ie.dyn_tree,Je=Ie.max_code,ct=Ie.stat_desc.static_tree,En=Ie.stat_desc.has_stree,On=Ie.stat_desc.extra_bits,Vn=Ie.stat_desc.extra_base,pn=Ie.stat_desc.max_length,Xt=0;for(Be=0;Be<=k;Be++)Ae.bl_count[Be]=0;for(Le[2*Ae.heap[Ae.heap_max]+1]=0,fe=Ae.heap_max+1;fe<v;fe++)pn<(Be=Le[2*Le[2*(we=Ae.heap[fe])+1]+1]+1)&&(Be=pn,Xt++),Le[2*we+1]=Be,Je<we||(Ae.bl_count[Be]++,Ve=0,Vn<=we&&(Ve=On[we-Vn]),Ke=Le[2*we],Ae.opt_len+=Ke*(Be+Ve),En&&(Ae.static_len+=Ke*(ct[2*we+1]+Ve)));if(Xt!==0){do{for(Be=pn-1;Ae.bl_count[Be]===0;)Be--;Ae.bl_count[Be]--,Ae.bl_count[Be+1]+=2,Ae.bl_count[pn]--,Xt-=2}while(0<Xt);for(Be=pn;Be!==0;Be--)for(we=Ae.bl_count[Be];we!==0;)Je<(Me=Ae.heap[--fe])||(Le[2*Me+1]!==Be&&(Ae.opt_len+=(Be-Le[2*Me+1])*Le[2*Me],Le[2*Me+1]=Be),we--)}})(F,ne),ze(xe,ye,F.bl_count)}function A(F,ne,me){var de,K,xe=-1,Ee=ne[1],ke=0,ae=7,ye=4;for(Ee===0&&(ae=138,ye=3),ne[2*(me+1)+1]=65535,de=0;de<=me;de++)K=Ee,Ee=ne[2*(de+1)+1],++ke<ae&&K===Ee||(ke<ye?F.bl_tree[2*K]+=ke:K!==0?(K!==xe&&F.bl_tree[2*K]++,F.bl_tree[2*B]++):ke<=10?F.bl_tree[2*D]++:F.bl_tree[2*z]++,xe=K,ye=(ke=0)===Ee?(ae=138,3):K===Ee?(ae=6,3):(ae=7,4))}function pe(F,ne,me){var de,K,xe=-1,Ee=ne[1],ke=0,ae=7,ye=4;for(Ee===0&&(ae=138,ye=3),de=0;de<=me;de++)if(K=Ee,Ee=ne[2*(de+1)+1],!(++ke<ae&&K===Ee)){if(ke<ye)for(;V(F,K,F.bl_tree),--ke!=0;);else K!==0?(K!==xe&&(V(F,K,F.bl_tree),ke--),V(F,B,F.bl_tree),ie(F,ke-3,2)):ke<=10?(V(F,D,F.bl_tree),ie(F,ke-3,3)):(V(F,z,F.bl_tree),ie(F,ke-11,7));xe=K,ye=(ke=0)===Ee?(ae=138,3):K===Ee?(ae=6,3):(ae=7,4)}}h(ee);var re=!1;function Y(F,ne,me,de){ie(F,(p<<1)+(de?1:0),3),(function(K,xe,Ee,ke){De(K),M(K,Ee),M(K,~Ee),u.arraySet(K.pending_buf,K.window,xe,Ee,K.pending),K.pending+=Ee})(F,ne,me)}o._tr_init=function(F){re||((function(){var ne,me,de,K,xe,Ee=new Array(k+1);for(K=de=0;K<b-1;K++)for(Q[K]=de,ne=0;ne<1<<R[K];ne++)E[de++]=K;for(E[de-1]=K,K=xe=0;K<16;K++)for(ee[K]=xe,ne=0;ne<1<<G[K];ne++)X[xe++]=K;for(xe>>=7;K<y;K++)for(ee[K]=xe<<7,ne=0;ne<1<<G[K]-7;ne++)X[256+xe++]=K;for(me=0;me<=k;me++)Ee[me]=0;for(ne=0;ne<=143;)W[2*ne+1]=8,ne++,Ee[8]++;for(;ne<=255;)W[2*ne+1]=9,ne++,Ee[9]++;for(;ne<=279;)W[2*ne+1]=7,ne++,Ee[7]++;for(;ne<=287;)W[2*ne+1]=8,ne++,Ee[8]++;for(ze(W,w+1,Ee),ne=0;ne<y;ne++)I[2*ne+1]=5,I[2*ne]=se(ne,5);$=new L(W,R,x+1,w,k),J=new L(I,G,0,y,k),ve=new L(new Array(0),P,0,j,_)})(),re=!0),F.l_desc=new O(F.dyn_ltree,$),F.d_desc=new O(F.dyn_dtree,J),F.bl_desc=new O(F.bl_tree,ve),F.bi_buf=0,F.bi_valid=0,Re(F)},o._tr_stored_block=Y,o._tr_flush_block=function(F,ne,me,de){var K,xe,Ee=0;0<F.level?(F.strm.data_type===2&&(F.strm.data_type=(function(ke){var ae,ye=4093624447;for(ae=0;ae<=31;ae++,ye>>>=1)if(1&ye&&ke.dyn_ltree[2*ae]!==0)return c;if(ke.dyn_ltree[18]!==0||ke.dyn_ltree[20]!==0||ke.dyn_ltree[26]!==0)return f;for(ae=32;ae<x;ae++)if(ke.dyn_ltree[2*ae]!==0)return f;return c})(F)),ht(F,F.l_desc),ht(F,F.d_desc),Ee=(function(ke){var ae;for(A(ke,ke.dyn_ltree,ke.l_desc.max_code),A(ke,ke.dyn_dtree,ke.d_desc.max_code),ht(ke,ke.bl_desc),ae=j-1;3<=ae&&ke.bl_tree[2*q[ae]+1]===0;ae--);return ke.opt_len+=3*(ae+1)+5+5+4,ae})(F),K=F.opt_len+3+7>>>3,(xe=F.static_len+3+7>>>3)<=K&&(K=xe)):K=xe=me+5,me+4<=K&&ne!==-1?Y(F,ne,me,de):F.strategy===4||xe===K?(ie(F,2+(de?1:0),3),nt(F,W,I)):(ie(F,4+(de?1:0),3),(function(ke,ae,ye,Ae){var Ie;for(ie(ke,ae-257,5),ie(ke,ye-1,5),ie(ke,Ae-4,4),Ie=0;Ie<Ae;Ie++)ie(ke,ke.bl_tree[2*q[Ie]+1],3);pe(ke,ke.dyn_ltree,ae-1),pe(ke,ke.dyn_dtree,ye-1)})(F,F.l_desc.max_code+1,F.d_desc.max_code+1,Ee+1),nt(F,F.dyn_ltree,F.dyn_dtree)),Re(F),de&&De(F)},o._tr_tally=function(F,ne,me){return F.pending_buf[F.d_buf+2*F.last_lit]=ne>>>8&255,F.pending_buf[F.d_buf+2*F.last_lit+1]=255&ne,F.pending_buf[F.l_buf+F.last_lit]=255&me,F.last_lit++,ne===0?F.dyn_ltree[2*me]++:(F.matches++,ne--,F.dyn_ltree[2*(E[me]+x+1)]++,F.dyn_dtree[2*H(ne)]++),F.last_lit===F.lit_bufsize-1},o._tr_align=function(F){ie(F,2,3),V(F,N,W),(function(ne){ne.bi_valid===16?(M(ne,ne.bi_buf),ne.bi_buf=0,ne.bi_valid=0):8<=ne.bi_valid&&(ne.pending_buf[ne.pending++]=255&ne.bi_buf,ne.bi_buf>>=8,ne.bi_valid-=8)})(F)}},{"../utils/common":41}],53:[function(i,l,o){l.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(i,l,o){(function(u){(function(c,f){if(!c.setImmediate){var h,p,b,x,w=1,y={},j=!1,v=c.document,k=Object.getPrototypeOf&&Object.getPrototypeOf(c);k=k&&k.setTimeout?k:c,h={}.toString.call(c.process)==="[object process]"?function(B){process.nextTick(function(){_(B)})}:(function(){if(c.postMessage&&!c.importScripts){var B=!0,D=c.onmessage;return c.onmessage=function(){B=!1},c.postMessage("","*"),c.onmessage=D,B}})()?(x="setImmediate$"+Math.random()+"$",c.addEventListener?c.addEventListener("message",N,!1):c.attachEvent("onmessage",N),function(B){c.postMessage(x+B,"*")}):c.MessageChannel?((b=new MessageChannel).port1.onmessage=function(B){_(B.data)},function(B){b.port2.postMessage(B)}):v&&"onreadystatechange"in v.createElement("script")?(p=v.documentElement,function(B){var D=v.createElement("script");D.onreadystatechange=function(){_(B),D.onreadystatechange=null,p.removeChild(D),D=null},p.appendChild(D)}):function(B){setTimeout(_,0,B)},k.setImmediate=function(B){typeof B!="function"&&(B=new Function(""+B));for(var D=new Array(arguments.length-1),z=0;z<D.length;z++)D[z]=arguments[z+1];var R={callback:B,args:D};return y[w]=R,h(w),w++},k.clearImmediate=S}function S(B){delete y[B]}function _(B){if(j)setTimeout(_,0,B);else{var D=y[B];if(D){j=!0;try{(function(z){var R=z.callback,G=z.args;switch(G.length){case 0:R();break;case 1:R(G[0]);break;case 2:R(G[0],G[1]);break;case 3:R(G[0],G[1],G[2]);break;default:R.apply(f,G)}})(D)}finally{S(B),j=!1}}}}function N(B){B.source===c&&typeof B.data=="string"&&B.data.indexOf(x)===0&&_(+B.data.slice(x.length))}})(typeof self>"u"?u===void 0?this:u:self)}).call(this,typeof Rs<"u"?Rs:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})})(Rc)),Rc.exports}var y1=b1();const v1=dl(y1),w1=t=>{switch(t.split(".").pop()?.toLowerCase()||""){case"pdf":return"picture_as_pdf";case"csv":case"xls":case"xlsx":return"table_view";case"png":case"jpg":case"jpeg":case"gif":case"svg":return"image";case"txt":case"md":return"description";case"json":return"data_object";case"zip":case"tar":case"gz":return"folder_zip";default:return"insert_drive_file"}},Ms=6e4,Oc=200,ig=200,nl=1e6,Dc=2e3,Mc=2e3,S1=360,zx=12,Ls=S1+zx,k1=4,j1=4,_1=({index:t,style:r,data:i})=>{const l=i[t];return l?d.jsx("div",{style:{...r,paddingBottom:zx},children:d.jsx(Ax,{capture:l})}):null},C1=t=>`${(t/(1024*1024)).toFixed(2)} MB`,N1=t=>{if(typeof t=="boolean")return t;if(typeof t=="string"){const r=t.trim().toLowerCase();if(r==="true")return!0;if(r==="false")return!1}return null},Bs=(t,r)=>t.length<=r?{text:t,truncated:!1}:{text:t.slice(0,r),truncated:!0},E1=t=>!t||t.data===void 0||t.data===null?{reason:"No data to copy."}:{raw:t.data},Us=(t,r,i)=>t.length<=r?t:(i.push(`first ${r.toLocaleString()} chars`),t.slice(0,r)),A1=t=>{const r=[];if(typeof t=="string")return{text:Us(t,nl,r),truncated:r.length>0,reason:r.join(", ")};if(Array.isArray(t)){let l=t;t.length>Dc&&(l=t.slice(0,Dc),r.push(`first ${Dc.toLocaleString()} items`));let o="";try{o=JSON.stringify(l,null,2)}catch{o=String(l)}return o=Us(o,nl,r),{text:o,truncated:r.length>0,reason:r.join(", ")}}if(t&&typeof t=="object"){let l=t;const o=Object.keys(t);o.length>Mc&&(l=o.slice(0,Mc).reduce((c,f)=>(c[f]=t[f],c),{}),r.push(`first ${Mc.toLocaleString()} keys`));let u="";try{u=JSON.stringify(l,null,2)}catch{u=String(l)}return u=Us(u,nl,r),{text:u,truncated:r.length>0,reason:r.join(", ")}}return{text:Us(String(t),nl,r),truncated:r.length>0,reason:r.join(", ")}},z1=t=>{if(typeof t=="string")return t;try{return JSON.stringify(t,null,2)}catch{return String(t)}},ag=t=>{if(!t||t.data===void 0||t.data===null||t.data==="")return{text:"",truncated:!1,language:"plain"};const r=t.data;if(typeof r=="string"){const l=r.trim(),o=l.startsWith("<")&&l.includes(">")?"html":l.startsWith("{")||l.startsWith("[")?"json":"plain",u=Bs(r,Ms);return{text:u.text,truncated:u.truncated,language:o}}if(Array.isArray(r)){const l=r.length>Oc?r.slice(0,Oc):r,o=JSON.stringify(l,null,2),u=Bs(o,Ms);return{text:u.text,truncated:u.truncated||r.length>Oc,language:"json"}}if(r&&typeof r=="object"){const l=Object.keys(r);let o=r,u=!1;l.length>ig&&(u=!0,o=l.slice(0,ig).reduce((h,p)=>(h[p]=r[p],h),{}));const c=JSON.stringify(o,null,2),f=Bs(c,Ms);return{text:f.text,truncated:f.truncated||u,language:"json"}}const i=Bs(String(r),Ms);return{text:i.text,truncated:i.truncated,language:"plain"}},T1=t=>{const r=[];let i=[],l="",o=!1;for(let u=0;u<t.length;u+=1){const c=t[u];o?c==='"'?t[u+1]==='"'?(l+='"',u+=1):o=!1:l+=c:c==='"'?o=!0:c===","?(i.push(l),l=""):c===`
13
- `?(i.push(l),r.push(i),i=[],l=""):c==="\r"||(l+=c)}return i.push(l),(i.length>1||i[0]!==""||r.length>0)&&r.push(i),r},R1=t=>{if(!t)return null;if(typeof t=="string"){const r=t.trim();if(!r.includes(",")||!r.includes(`
14
- `))return null;const i=T1(r).filter(u=>u.some(c=>String(c||"").trim()!==""));if(i.length<2)return null;const l=i[0].map((u,c)=>String(u||"").trim()||`column_${c+1}`),o=i.slice(1);return l.length<2?null:{headers:l,rows:o}}if(Array.isArray(t)){if(t.length===0)return null;if(t.every(r=>r&&typeof r=="object"&&!Array.isArray(r))){const r=[];if(t.forEach(l=>{Object.keys(l).forEach(o=>{r.includes(o)||r.push(o)})}),r.length===0)return null;const i=t.map(l=>r.map(o=>l[o]??""));return{headers:r,rows:i}}if(t.every(r=>Array.isArray(r))){const r=Math.max(...t.map(l=>l.length));return{headers:Array.from({length:r},(l,o)=>`column_${o+1}`),rows:t}}return null}if(t&&typeof t=="object"){const r=Object.keys(t);return r.length===0?null:{headers:r,rows:[r.map(i=>t[i]??"")]}}return null},O1=(t,r)=>t==null?null:typeof t=="string"?r?{content:t,mime:"text/csv",ext:"csv"}:{content:t,mime:"application/json",ext:"json"}:{content:JSON.stringify(t,null,2),mime:"application/json",ext:"json"},D1=(t,r,i)=>{const l=new Blob([r],{type:i}),o=URL.createObjectURL(l),u=document.createElement("a");u.href=o,u.download=t,document.body.appendChild(u),u.click(),u.remove(),URL.revokeObjectURL(o)},M1=({results:t,pinnedResults:r,isExecuting:i,isHeadful:l,runId:o,onConfirm:u,onNotify:c,onPin:f,onUnpin:h,fullWidth:p,useNovnc:b})=>{const[x,w]=T.useState(null),[y,j]=T.useState("raw"),[v,k]=T.useState("data"),[S,_]=T.useState(()=>r&&!t?"pinned":"latest"),N=T.useMemo(()=>b===null?"checking":b?"novnc":"native",[b]),[B,D]=T.useState(!1),[z,R]=T.useState(!1),[G,P]=T.useState([]),q=T.useRef(null),W=S==="pinned"&&r?r:t,I=T.useMemo(()=>R1(W?.data),[W?.data]),X=T.useMemo(()=>W&&W.data!==void 0&&W.data!==null&&W.data!==""?ag(W):null,[W]),E=T.useMemo(()=>W?.screenshotUrl?`${W.screenshotUrl}${S==="latest"?`?t=${Date.now()}`:""}`:null,[W?.screenshotUrl,S]),Q=ee=>{const L=N1(ee);return L!==null?L?d.jsx(Ce,{name:"check",className:"text-xs text-blue-400"}):"":ee??""},$=async()=>{R(!0);try{const ee=o?`?runId=${encodeURIComponent(o)}`:"",L=await fetch(`/api/data/captures${ee}`),O=L.ok?await L.json():{captures:[]};P(Array.isArray(O.captures)?O.captures:[])}catch{P([])}finally{R(!1)}};T.useEffect(()=>{j(I?"table":"raw"),!W?.downloads||W.downloads.length===0?k("data"):W?.data||k("downloads")},[W]),T.useEffect(()=>{if(t){_("latest");return}r&&_("pinned")},[t,r]),T.useEffect(()=>{!r&&S==="pinned"&&_("latest")},[r,S]);const J=async(ee,L,O)=>{if(!ee){c("Nothing to copy.","error");return}let H=ee;try{if(navigator.clipboard&&window.isSecureContext)await navigator.clipboard.writeText(H);else{const M=document.createElement("textarea");M.value=H,M.style.position="fixed",M.style.left="-999999px",M.style.top="-999999px",document.body.appendChild(M),M.focus(),M.select(),document.execCommand("copy"),M.remove()}w(L),setTimeout(()=>w(null),2e3),O?.truncatedNotice?c("Copied truncated data.","success"):H.length!==ee.length&&c("Copied a truncated preview.","success")}catch(M){console.error("Copy failed:",M),c("Copy failed.","error")}};if(l&&S==="latest"){const{origin:ee,hostname:L}=window.location,O=`${ee}/novnc.html?host=${L}&path=websockify`,H=()=>{const M=q.current;if(M){if(document.fullscreenElement){document.exitFullscreen().catch(()=>{});return}M.requestFullscreen?.().catch(()=>{})}};return N==="native"?d.jsxs("div",{className:"glass-card rounded-[32px] overflow-hidden h-[80vh] w-full relative flex flex-col items-center justify-center p-8 text-center gap-4",children:[d.jsx("div",{className:"text-[12px] font-bold uppercase tracking-widest text-white",children:"Headful Session Active"}),d.jsx("div",{className:"text-[10px] font-bold uppercase tracking-widest text-amber-500/80 max-w-lg leading-relaxed",children:"Figranium is not optimized for native browser windows. Please install the proper tools for stability (Xvfb, x11vnc, websockify) or simply use the Docker version."})]}):N==="checking"?d.jsx("div",{className:"glass-card rounded-[32px] overflow-hidden h-[80vh] w-full relative flex items-center justify-center",children:d.jsx("div",{className:"text-[10px] font-bold uppercase tracking-widest text-gray-500",children:"Checking headful viewer..."})}):d.jsxs("div",{ref:q,className:"glass-card rounded-[32px] overflow-hidden h-[80vh] w-full relative",children:[d.jsx("button",{type:"button",onClick:H,className:"absolute top-4 right-4 z-10 px-3 py-2 rounded-xl border border-white/20 bg-black/40 text-[9px] font-bold uppercase tracking-widest text-white/80 hover:bg-black/60 transition-all",title:"Toggle fullscreen",children:"Fullscreen"}),d.jsx("iframe",{src:O,className:"absolute inset-0 w-full h-full",title:"Headful Browser"})]})}if(!W&&!(i&&S==="latest"))return d.jsxs("div",{className:"h-full flex flex-col items-center justify-center text-center space-y-4 opacity-20",children:[d.jsx("div",{className:"w-16 h-16 border border-white/10 rounded-full flex items-center justify-center",children:d.jsx(Ce,{name:"terminal",className:"text-2xl text-white"})}),d.jsx("p",{className:"text-[9px] font-bold uppercase tracking-[0.3em]",children:"Ready"})]});const ve=p?"space-y-12 relative z-10 w-full":"space-y-12 relative z-10 max-w-5xl mx-auto";return d.jsxs("div",{className:ve,children:[d.jsxs("div",{className:"flex items-end justify-between border-b border-white/5 pb-10",children:[d.jsxs("div",{className:"space-y-4",children:[d.jsx("p",{className:"text-[9px] font-bold text-gray-500 uppercase tracking-[0.3em]",children:"Preview"}),d.jsx("h2",{className:"text-xl font-mono text-white truncate max-w-xl tracking-tight italic",children:W?.finalUrl||W?.url||""})]}),d.jsx("div",{className:`px-4 py-2 rounded-xl text-[9px] font-bold uppercase tracking-[0.2em] ${S==="pinned"?"bg-amber-500/10 text-amber-300":i?"bg-blue-500/10 text-blue-400 animate-pulse":"bg-green-500/10 text-green-400"}`,children:S==="pinned"?"Pinned":i?"Running":"Finished"})]}),d.jsxs("div",{className:"grid grid-cols-1 xl:grid-cols-2 gap-8",children:[d.jsxs("div",{className:"glass-card rounded-[32px] overflow-hidden flex flex-col min-h-[400px]",children:[d.jsxs("div",{className:"p-6 border-b border-white/5 flex items-center justify-between text-[8px] font-bold text-gray-500 uppercase tracking-widest",children:[d.jsx("span",{children:"Screenshot"}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:"text-white/20",children:W?.timestamp||"--:--:--"}),d.jsx("button",{type:"button",onClick:()=>{D(!0),$()},className:"px-3 py-2 rounded-xl border border-white/10 text-[8px] font-bold uppercase tracking-widest text-white/70 hover:text-white hover:bg-white/5 transition-all",children:"View All Captures"})]})]}),d.jsx("div",{className:"relative bg-black flex-1 flex items-center justify-center overflow-hidden",children:E?d.jsx("img",{src:E,className:"absolute inset-0 w-full h-full object-contain transition-opacity duration-1000"}):d.jsx("div",{className:"text-[8px] font-bold text-white/5 uppercase tracking-widest",children:"Waiting for Frame..."})})]}),d.jsxs("div",{className:"glass-card rounded-[32px] p-8 flex flex-col h-[400px]",children:[d.jsx("span",{className:"text-[8px] font-bold text-gray-500 uppercase tracking-widest mb-6 border-b border-white/5 pb-4",children:"Activity Log"}),d.jsxs("div",{className:"flex-1 font-mono text-[10px] text-gray-400 space-y-2 overflow-y-auto custom-scrollbar pr-2",children:[W?.logs?.map((ee,L)=>d.jsxs("div",{className:"flex gap-2",children:[d.jsx("span",{className:"text-white/10 shrink-0",children:"›"})," ",d.jsx("span",{children:ee})]},L)),i&&S==="latest"&&(!W?.logs||W?.logs.length===0)&&d.jsx("div",{className:"animate-pulse",children:"Connecting to kernel..."})]})]})]}),B&&d.jsx("div",{className:"fixed inset-0 z-50 bg-black/70 flex items-center justify-center p-6",children:d.jsxs("div",{className:"glass-card rounded-[32px] w-full max-w-5xl max-h-[85vh] overflow-hidden flex flex-col",children:[d.jsxs("div",{className:"p-6 border-b border-white/10 flex items-center justify-between",children:[d.jsxs("div",{children:[d.jsx("div",{className:"text-[9px] font-bold text-gray-500 uppercase tracking-widest",children:"Captures"}),d.jsx("div",{className:"text-sm font-bold text-white",children:"Recordings and Screenshots"})]}),d.jsx("button",{onClick:()=>D(!1),className:"px-3 py-2 border text-[9px] font-bold rounded-xl uppercase transition-all bg-white/5 border-white/10 text-white hover:bg-white/10",children:"Close"})]}),d.jsxs("div",{className:"p-6 overflow-y-auto custom-scrollbar",children:[z&&d.jsx("div",{className:"text-[9px] text-gray-500 uppercase tracking-widest",children:"Loading captures..."}),!z&&G.length===0&&d.jsx("div",{className:"text-[9px] text-gray-600 uppercase tracking-widest",children:"No captures found."}),!z&&G.length>0&&d.jsx(io,{height:Math.min(Math.max(Ls,G.length*Ls),Ls*k1),width:"100%",itemCount:G.length,itemSize:Ls,overscanCount:j1,itemData:G,className:"custom-scrollbar",children:_1})]})]})}),d.jsxs("div",{className:"glass-card rounded-[32px] p-8 flex flex-col relative",children:[d.jsxs("div",{className:"flex items-center justify-between border-b border-white/5 pb-4 mb-6",children:[d.jsx("span",{className:"text-[8px] font-bold text-gray-500 uppercase tracking-widest",children:v==="downloads"?"Downloads":"Data"}),d.jsxs("div",{className:"flex items-center gap-2",children:[W?.downloads&&W.downloads.length>0&&d.jsx("div",{role:"tablist",className:"flex bg-white/5 rounded-lg p-0.5 border border-white/10",children:["data","downloads"].map(ee=>d.jsx("button",{role:"tab","aria-selected":v===ee,onClick:()=>k(ee),className:`px-3 py-1 rounded text-[8px] font-bold uppercase tracking-widest transition-all focus:outline-none focus-visible:ring-2 ${v===ee?"bg-white text-black focus-visible:ring-blue-500":"text-gray-500 hover:text-white focus-visible:ring-white/50"}`,children:ee},ee))}),r&&d.jsx("div",{role:"tablist",className:"flex bg-white/5 rounded-lg p-0.5 border border-white/10",children:["latest","pinned"].map(ee=>d.jsx("button",{role:"tab","aria-selected":S===ee,onClick:()=>_(ee),className:`px-3 py-1 rounded text-[8px] font-bold uppercase tracking-widest transition-all focus:outline-none focus-visible:ring-2 ${S===ee?"bg-white text-black focus-visible:ring-blue-500":"text-gray-500 hover:text-white focus-visible:ring-white/50"}`,children:ee},ee))}),I&&v==="data"&&d.jsx("div",{role:"tablist",className:"flex bg-white/5 rounded-lg p-0.5 border border-white/10",children:["table","raw"].map(ee=>d.jsx("button",{role:"tab","aria-selected":y===ee,onClick:()=>j(ee),className:`px-3 py-1 rounded text-[8px] font-bold uppercase tracking-widest transition-all focus:outline-none focus-visible:ring-2 ${y===ee?"bg-white text-black focus-visible:ring-blue-500":"text-gray-500 hover:text-white focus-visible:ring-white/50"}`,children:ee},ee))}),S==="pinned"?d.jsx("button",{onClick:()=>{h?.(),_("latest")},className:"px-3 py-2 border text-[9px] font-bold rounded-xl uppercase transition-all flex items-center gap-2 bg-white/5 border-white/10 text-amber-200 hover:bg-white/10",title:"Unpin data",children:"Unpin"}):d.jsx("button",{onClick:()=>{if(!W){c("No data to pin.","error");return}f?.(W),_("pinned")},className:"px-3 py-2 border text-[9px] font-bold rounded-xl uppercase transition-all flex items-center gap-2 bg-white/5 border-white/10 text-white hover:bg-white/10",title:"Pin data",children:r?"Update Pin":"Pin"}),v==="data"&&d.jsx("button",{onClick:()=>{const ee=O1(W?.data,I);if(!ee){c("No data to export.","error");return}const L=`doppelganger-data-${new Date().toISOString().replace(/[:.]/g,"-")}.${ee.ext}`;D1(L,ee.content,ee.mime),c(`Exported ${ee.ext.toUpperCase()}.`,"success")},className:"px-3 py-2 border text-[9px] font-bold rounded-xl uppercase transition-all flex items-center gap-2 bg-white/5 border-white/10 text-white hover:bg-white/10",title:"Export extracted data",children:"Export"}),v==="downloads"&&d.jsxs("button",{onClick:async()=>{if(!(!W?.downloads||W.downloads.length===0)){if(W.downloads.length===1){const ee=W.downloads[0],L=document.createElement("a");L.href=ee.path,L.download=ee.name,document.body.appendChild(L),L.click(),L.remove(),c(`Downloading ${ee.name}`,"success");return}c("Generating ZIP...","success");try{const ee=new v1;for(const M of W.downloads){const V=await(await fetch(M.path)).blob();ee.file(M.name,V)}const L=await ee.generateAsync({type:"blob"}),O=URL.createObjectURL(L),H=document.createElement("a");H.href=O,H.download=`doppelganger-downloads-${new Date().toISOString().replace(/[:.]/g,"-")}.zip`,document.body.appendChild(H),H.click(),H.remove(),URL.revokeObjectURL(O)}catch(ee){console.error("Failed to zip files:",ee),c("Failed to zip files.","error")}}},className:"px-3 py-2 border text-[9px] font-bold rounded-xl uppercase transition-all flex items-center gap-2 bg-white/5 border-white/10 text-white hover:bg-white/10",title:W?.downloads?.length===1?"Download File":"Download ZIP",children:[d.jsx(Ce,{name:"folder_zip",className:"text-[14px]"}),W?.downloads?.length===1?"Download":"Download ZIP"]}),v==="data"&&d.jsxs("button",{onClick:async()=>{const ee=E1(W);if(ee.reason){c(ee.reason||"Data too large to copy safely.","error");return}const L=ag(W);let H=z1(ee.raw),M=!1;L.truncated&&(await u({message:"Preview is truncated for performance.",confirmLabel:"Copy full",cancelLabel:"Copy preview"})||(H=L.text||"",M=!0)),H.length>nl&&(await u({message:`Copying ${C1(H.length)} may freeze your browser.`,confirmLabel:"Copy full",cancelLabel:M?"Copy preview":"Copy truncated"})||(H=A1(ee.raw).text,M=!0)),J(H,"data",{skipSizeConfirm:!0,truncatedNotice:M})},className:`px-3 py-2 border text-[9px] font-bold rounded-xl uppercase transition-all flex items-center gap-2 ${x==="data"?"bg-green-500/10 border-green-500/20 text-green-400":"bg-white/5 border-white/10 text-white hover:bg-white/10"}`,title:"Copy extracted data",children:[x==="data"?d.jsx(Ce,{name:"check",className:"text-sm"}):d.jsx(Ce,{name:"content_copy",className:"text-sm"}),x==="data"?"Copied":"Copy"]})]})]}),X?.truncated&&d.jsx("button",{type:"button",onClick:()=>c("Preview truncated for performance.","error"),className:"absolute top-5 right-5 h-2.5 w-2.5 rounded-full bg-amber-400 shadow-[0_0_8px_rgba(251,191,36,0.6)]",title:"Preview truncated","aria-label":"Preview truncated"}),d.jsx("div",{className:"max-h-[70vh] overflow-y-auto custom-scrollbar pr-2 relative",children:(()=>{const ee=W&&W.data!==void 0&&W.data!==null&&W.data!=="",L=W&&W.downloads&&W.downloads.length>0;return i&&S==="latest"&&(!W||!ee&&!L)?d.jsx("pre",{className:"font-mono text-[10px] text-blue-300/60 whitespace-pre-wrap leading-relaxed",children:"Buffering data stream..."}):!W||!ee&&!L?d.jsx("pre",{className:"font-mono text-[10px] text-blue-300/60 whitespace-pre-wrap leading-relaxed",children:"No data available."}):d.jsx("div",{className:"h-full",children:v==="downloads"?d.jsx("div",{className:"space-y-2",children:W.downloads.map((O,H)=>d.jsxs("div",{className:"flex items-center justify-between bg-white/[0.02] border border-white/5 rounded-xl p-4 hover:bg-white/[0.04] transition-colors",children:[d.jsxs("div",{className:"flex items-center gap-4 overflow-hidden pr-4",children:[d.jsx("div",{className:"p-3 bg-white/5 rounded-lg border border-white/10 shrink-0",children:d.jsx(Ce,{name:w1(O.name),className:"text-2xl text-white/70"})}),d.jsxs("div",{className:"min-w-0",children:[d.jsx("h4",{className:"text-sm font-bold text-white truncate",children:O.name}),d.jsx("p",{className:"text-[10px] text-gray-500 truncate mt-1",children:O.url})]})]}),d.jsx("a",{href:O.path,download:O.name,className:"shrink-0 p-3 rounded-lg border border-white/10 bg-white/5 text-white/80 hover:bg-white/10 hover:text-white transition-all flex items-center justify-center",title:"Download file","aria-label":"Download file",children:d.jsx(Ce,{name:"download",className:"text-[18px]"})})]},H))}):I&&y==="table"?d.jsx("div",{className:"overflow-auto custom-scrollbar rounded-2xl border border-white/10",children:d.jsxs("table",{className:"min-w-full table-auto text-[10px] text-left text-white/80 font-mono",children:[d.jsx("thead",{className:"bg-white/5 text-[9px] uppercase tracking-widest text-white/50",children:d.jsx("tr",{children:I.headers.map(O=>d.jsx("th",{className:"px-3 py-2 border-b border-white/10 whitespace-nowrap",children:O},O))})}),d.jsx("tbody",{children:I.rows.map((O,H)=>d.jsx("tr",{className:"odd:bg-white/[0.02]",children:I.headers.map((M,ie)=>d.jsx("td",{className:"px-3 py-2 border-b border-white/5 align-top whitespace-normal break-words",children:Q(O[ie])},`${H}-${ie}`))},H))})]})}):d.jsx(sl,{readOnly:!0,value:X?.text||"",language:X?.language||"plain"})})})()})]})]})},Tx=T.memo(M1),L1=({isOpen:t,onToggle:r,results:i,pinnedResults:l,isExecuting:o,isHeadfulOpen:u,runId:c,onConfirm:f,onNotify:h,onPinResults:p,onUnpinResults:b,useNovnc:x})=>d.jsxs("div",{className:`fixed top-0 right-0 h-full w-[600px] max-w-[90vw] bg-[#080808] border-l border-white/10 shadow-2xl transition-transform duration-500 ease-in-out z-40 transform ${t?"translate-x-0":"translate-x-full"}`,children:[d.jsx("button",{onClick:r,className:"absolute top-1/2 -left-8 -translate-y-1/2 w-8 h-24 bg-[#111] border border-r-0 border-white/10 rounded-l-xl flex items-center justify-center cursor-pointer shadow-[-8px_0_15px_rgba(0,0,0,0.5)] transition-all hover:bg-white/5 hover:w-10 hover:-left-10 focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50","aria-label":t?"Close Results Drawer":"Open Results Drawer",title:t?"Close Results Drawer":"Open Results Drawer",children:d.jsx(Ce,{name:"drag_indicator",className:`text-white/30 text-xl transition-transform duration-500 ${t?"rotate-180":""}`})}),d.jsx("div",{className:"h-full w-full overflow-y-auto custom-scrollbar p-6",children:d.jsx(Tx,{results:i,pinnedResults:l,isExecuting:o,isHeadful:u,runId:c,onConfirm:f,onNotify:h,onPin:p,onUnpin:b,fullWidth:!0,useNovnc:x})})]}),B1=({versionPreview:t,onClose:r,onRunSnapshot:i})=>t?d.jsx("div",{className:"fixed inset-0 z-[210] flex items-center justify-center bg-black/70 backdrop-blur-sm px-6",children:d.jsxs("div",{className:"glass-card w-full max-w-6xl rounded-[32px] border border-white/10 p-8 shadow-2xl flex flex-col max-h-[90vh]",children:[d.jsxs("div",{className:"flex items-center justify-between border-b border-white/5 pb-4 mb-6",children:[d.jsxs("div",{className:"space-y-1",children:[d.jsx("div",{className:"text-[9px] font-bold text-gray-500 uppercase tracking-[0.3em]",children:"Task Snapshot"}),d.jsx("div",{className:"text-lg font-bold text-white",children:t.snapshot.name}),d.jsxs("div",{className:"text-[8px] text-gray-500 uppercase tracking-[0.2em]",children:[new Date(t.timestamp).toLocaleString()," | ",t.snapshot.mode]})]}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("button",{onClick:r,className:"px-4 py-2 text-[9px] font-bold uppercase tracking-widest rounded-xl bg-white/5 border border-white/10 text-white hover:bg-white/10 transition-all focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50",children:"Close"}),d.jsx("button",{onClick:()=>{i(t.snapshot),r()},className:"px-4 py-2 text-[9px] font-bold uppercase tracking-widest rounded-xl bg-white text-black hover:bg-white/90 transition-all focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-500",children:"Run Version"})]})]}),d.jsxs("div",{className:"grid grid-cols-1 xl:grid-cols-2 gap-6 overflow-y-auto custom-scrollbar pr-2 flex-1 min-h-0",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx("div",{className:"text-[8px] font-bold text-gray-500 uppercase tracking-widest",children:"Snapshot JSON"}),d.jsx(sl,{readOnly:!0,value:JSON.stringify(t.snapshot,null,2),language:"json",className:"min-h-[320px]"})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx("div",{className:"text-[8px] font-bold text-gray-500 uppercase tracking-widest",children:"Output"}),d.jsx("div",{className:"glass-card rounded-2xl p-6 border border-white/10 text-[10px] text-gray-500",children:"No output captured for this snapshot yet. Run this version to see results."})]})]})]})}):null,U1=({isHeadfulOpen:t,isInspectMode:r,isInspectLoading:i,isExecuting:l,useNovnc:o,onToggleInspect:u,onStopHeadful:c})=>{const f=T.useRef(null);if(!t)return null;const{origin:h,hostname:p}=window.location,b=`${h}/novnc.html?host=${p}&path=websockify`,x=()=>{const w=f.current;if(w){if(document.fullscreenElement){document.exitFullscreen().catch(()=>{});return}w.requestFullscreen?.().catch(()=>{})}};return d.jsx("div",{className:"fixed inset-0 z-[100] bg-black/40 backdrop-blur-md flex items-center justify-center p-8 pointer-events-auto",children:d.jsxs("div",{className:"w-full max-w-6xl bg-black/60 backdrop-blur-3xl border border-white/20 rounded-[32px] shadow-2xl overflow-hidden flex flex-col",children:[d.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between px-6 py-4 border-b border-white/10 bg-black/20 gap-4",children:[d.jsx("div",{className:"flex flex-col gap-1",children:d.jsx("div",{className:"flex items-center gap-3",children:d.jsx("span",{className:"text-[10px] font-bold uppercase tracking-widest text-white",children:"Active Browser Session"})})}),d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsxs("button",{type:"button",onClick:u,disabled:i||l,className:`px-3 py-1.5 rounded-xl border text-[9px] font-bold uppercase tracking-widest transition-all flex items-center gap-2 disabled:opacity-30 disabled:cursor-not-allowed focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50 ${r?"border-green-500/30 bg-green-500/20 text-green-400 hover:bg-green-500/30":"border-white/10 text-white/60 hover:text-white hover:bg-white/10"}`,title:r?"Stop inspecting elements":"Highlight elements on hover","aria-label":r?"Stop inspecting elements":"Highlight elements on hover",children:[i?d.jsx("div",{className:"w-4 h-4 border-2 border-white/20 border-t-white rounded-full animate-spin"}):d.jsx(Ce,{name:r?"visibility_off":"center_focus_strong",className:"text-[14px]"}),r?"Stop Inspect":"Inspect UI"]}),d.jsx("button",{type:"button",onClick:x,className:"p-2 text-white/60 hover:text-white transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50 rounded-lg",title:"Toggle fullscreen","aria-label":"Toggle fullscreen",children:d.jsx(Ce,{name:"fullscreen",className:"text-[16px]"})}),d.jsx("button",{type:"button",onClick:c,className:"p-2 text-white/60 hover:text-white transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50 rounded-lg",title:"Close Browser","aria-label":"Close Browser",children:d.jsx(Ce,{name:"close",className:"text-[16px]"})})]})]}),d.jsx("div",{ref:f,className:"w-full aspect-video relative bg-black flex items-center justify-center",children:o===!1?d.jsxs("div",{className:"text-center p-8",children:[d.jsx(Ce,{name:"open_in_new",className:"text-6xl text-white/20 mb-4 block"}),d.jsx("h3",{className:"text-white text-lg font-bold mb-2",children:"Browser Opened Natively"}),d.jsx("p",{className:"text-white/60 text-sm max-w-md mx-auto leading-relaxed mb-6",children:"The headful browser has been launched in a separate window on your desktop. Use that window to pick selectors. It will automatically sync back here."}),d.jsxs("div",{className:"text-[11px] text-amber-500/80 max-w-md mx-auto bg-amber-500/10 p-4 rounded-xl border border-amber-500/20 text-left",children:[d.jsxs("div",{className:"flex items-center gap-2 mb-2 font-bold uppercase tracking-widest text-amber-500",children:[d.jsx(Ce,{name:"warning",className:"text-base"}),d.jsx("span",{children:"Warning"})]}),"Figranium is not optimized for native browser windows. On ",d.jsx("strong",{children:"Wayland displays"}),", you ",d.jsx("strong",{children:"HAVE TO use Docker"}),", or you will have to deal with the problems of a physical browser losing focus or failing to capture clicks.",d.jsx("br",{}),d.jsx("br",{}),"For maximum stability, please install the proper tools (Xvfb, x11vnc, websockify) or use the official Docker image."]})]}):d.jsx("iframe",{src:b,className:"absolute inset-0 w-full h-full border-0",title:"Headful Browser"})})]})})},_n=({value:t,onChange:r,onBlur:i,placeholder:l,variables:o,className:u,syntax:c="plain"})=>{const f=T.useRef(null);return T.useEffect(()=>{if(f.current){const h=f.current.innerHTML,p=Ex(t,c,o);if(h!==p){const b=window.getSelection();let x=0;if(b&&b.rangeCount>0){const w=b.getRangeAt(0),y=w.cloneRange();y.selectNodeContents(f.current),y.setEnd(w.endContainer,w.endOffset),x=y.toString().length}if(f.current.innerHTML=p,x>0){const w=document.createTreeWalker(f.current,NodeFilter.SHOW_TEXT);let y=0,j=w.nextNode();for(;j;){const v=j.textContent?.length||0;if(y+v>=x){const k=document.createRange();k.setStart(j,x-y),k.collapse(!0),b?.removeAllRanges(),b?.addRange(k);break}y+=v,j=w.nextNode()}}}}},[t,o]),d.jsx("div",{ref:f,contentEditable:!0,className:`rich-input-content w-full bg-transparent focus:outline-none text-white min-h-[1.5rem] ${u}`,"data-placeholder":l,onInput:h=>r(h.currentTarget.textContent||""),onBlur:h=>{const p=h.currentTarget.textContent||"";r(p),i?.(p)}})},I1=[{value:"Control",label:"Ctrl"},{value:"Shift",label:"Shift"},{value:"Alt",label:"Alt"},{value:"Meta",label:"Meta"}],H1=["Enter","Tab","Escape","Space","Backspace","Delete","ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Home","End","PageUp","PageDown","F1","F2","F3","F4","F5"].concat([...Array(10)].map((t,r)=>`${r}`)).concat(Array.from({length:26},(t,r)=>String.fromCharCode(65+r))),P1=[{value:"replace",label:"Replace Text"},{value:"append",label:"Append Text"}],F1=t=>{if(!t)return{modifiers:[],baseKey:""};const r=t.split("+"),i=r.pop()||"";return{modifiers:r,baseKey:i}},rg=(t,r)=>[...t.filter(Boolean),r].filter(Boolean).join("+"),lg=t=>{const r=(t||"").trim(),i=r.match(/^\{\$([\w.]+)\}$/);return i?i[1]:r},q1=t=>{let r="";return t.type==="click"||t.type==="hover"||t.type==="scroll"||t.type==="wait_selector"?r=t.selector||"":t.type==="type"||t.type==="navigate"||t.type==="wait"||t.type==="javascript"||t.type==="repeat"||t.type==="start"||t.type==="screenshot"||t.type==="wait_downloads"||t.type==="stop"?r=t.value||"":t.type==="set"||t.type==="foreach"||t.type==="merge"?r=t.varName||"":t.type==="press"?r=t.key||"":(t.type==="if"||t.type==="while")&&(r=t.conditionVar||""),r.trim()},Bi={string:[{value:"equals",label:"Equals"},{value:"not_equals",label:"Not equal"},{value:"contains",label:"Contains"},{value:"starts_with",label:"Starts with"},{value:"ends_with",label:"Ends with"},{value:"matches",label:"Matches regex"}],number:[{value:"equals",label:"Equals"},{value:"not_equals",label:"Not equal"},{value:"gt",label:"Greater than"},{value:"gte",label:"Greater or equal"},{value:"lt",label:"Less than"},{value:"lte",label:"Less or equal"}],boolean:[{value:"is_true",label:"Is true"},{value:"is_false",label:"Is false"}]},sg=ft.memo(({action:t,index:r,status:i,isDragging:l,isDragOver:o,translateY:u,variables:c,availableTasks:f,onUpdate:h,onAutoSave:p,onOpenPalette:b,onOpenContextMenu:x,onPointerDown:w,dragTransformY:y,onStartInspect:j,isSelected:v,selectorOptions:k})=>{const[S,_]=T.useState(!1),N=i==="running"?"border-yellow-400/60":i==="success"?"border-green-400/60":i==="error"?"border-red-400/70":i==="skipped"?"border-gray-500/40":"",B=R=>{const G="text-[12px]";return R==="if"||R==="else"?d.jsx(Ce,{name:"call_split",className:`${G} text-white`}):R==="end"?d.jsx(Ce,{name:"subdirectory_arrow_right",className:`${G} text-gray-500`}):R==="while"||R==="repeat"?d.jsx(Ce,{name:"repeat",className:`${G} text-white`}):R==="foreach"?d.jsx(Ce,{name:"list",className:`${G} text-white`}):R==="on_error"?d.jsx(Ce,{name:"warning",className:`${G} text-red-400`}):R==="set"?d.jsx(Ce,{name:"data_object",className:`${G} text-white`}):R==="stop"?d.jsx(Ce,{name:"stop",className:`${G} text-white`}):R==="click"?d.jsx(Ce,{name:"ads_click",className:`${G} text-white`}):R==="type"?d.jsx(Ce,{name:"text_format",className:`${G} text-white`}):R==="hover"?d.jsx(Ce,{name:"my_location",className:`${G} text-white`}):R==="press"?d.jsx(Ce,{name:"keyboard",className:`${G} text-white`}):R==="wait"?d.jsx(Ce,{name:"schedule",className:`${G} text-white`}):R==="wait_selector"?d.jsx(Ce,{name:"schedule",className:`${G} text-white`}):R==="scroll"?d.jsx(Ce,{name:"swap_vert",className:`${G} text-white`}):R==="javascript"?d.jsx(Ce,{name:"code",className:`${G} text-white`}):R==="csv"?d.jsx(Ce,{name:"table_chart",className:`${G} text-white`}):R==="merge"?d.jsx(Ce,{name:"layers",className:`${G} text-white`}):R==="screenshot"?d.jsx(Ce,{name:"photo_camera",className:`${G} text-white`}):R==="start"?d.jsx(Ce,{name:"play_circle",className:`${G} text-white`}):R==="navigate"?d.jsx(Ce,{name:"navigation",className:`${G} text-white`}):d.jsx("span",{className:"text-[9px] text-white/20",children:"|"})},D=R=>!R||!(R instanceof HTMLElement)?!1:!!R.closest('input, textarea, select, button, a, [contenteditable="true"], [data-no-drag="true"], [role="button"]'),z=l?`translateY(${y||0}px)`:u?`translateY(${u}px)`:void 0;return d.jsxs("div",{id:`action-${t.id}`,"data-action-id":t.id,onPointerDown:R=>{D(R.target)||R.button===0&&(R.preventDefault(),w(R,t.id,r))},onContextMenu:R=>x(R,t.id),className:`bg-black min-w-[280px] w-full max-w-sm mx-auto border p-5 rounded-2xl space-y-4 group/item relative transition-[transform,box-shadow,opacity,filter,background-color,border-color] duration-150 ease-[cubic-bezier(0.22,1,0.36,1)] will-change-transform select-none touch-none ${N||(v?"border-blue-500 ring-2 ring-blue-500/50":"border-white/20")} ${l?"ring-2 ring-white/40 scale-[1.02] shadow-[0_30px_80px_rgba(0,0,0,0.45)] opacity-85 z-20 mx-auto":""} ${o&&!l?"ring-2 ring-blue-400/60 bg-blue-500/5":""} ${t.disabled?"opacity-40 grayscale":""}`,style:{transform:z},children:[d.jsxs("div",{role:"button",tabIndex:0,"aria-expanded":S,"aria-label":S?"Collapse action":"Expand action",title:S?"Collapse":"Expand",onKeyDown:R=>{(R.key==="Enter"||R.key===" ")&&(R.preventDefault(),_(!S))},className:"flex items-center justify-between cursor-pointer focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50 rounded-xl",onClick:()=>_(!S),children:[d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx("div",{className:"text-[8px] font-bold text-white/20 font-mono tracking-tighter",children:(r+1).toString().padStart(2,"0")}),d.jsx("div",{className:"w-4 h-4 flex items-center justify-center",children:B(t.type)}),d.jsx("button",{onClick:R=>{R.stopPropagation(),b(t.id)},className:"action-type-select text-[10px] font-bold uppercase tracking-[0.2em] text-white focus:outline-none cursor-pointer rounded focus-visible:ring-2 focus-visible:ring-white/50","aria-label":`Change action type: ${t.type}`,children:nd.find(R=>R.type===t.type)?.label||t.type}),!S&&d.jsx("span",{className:"ml-2 text-white/40 text-[9px] font-mono truncate max-w-[150px] pointer-events-none",children:q1(t)})]}),d.jsx("div",{className:"flex items-center gap-2",children:d.jsx(Ce,{name:S?"expand_less":"expand_more",className:"text-base text-gray-600"})})]}),S&&d.jsxs(d.Fragment,{children:[(t.type==="click"||t.type==="type"||t.type==="hover"||t.type==="wait_selector"||t.type==="scroll")&&d.jsxs("div",{className:"space-y-1.5 relative",children:[d.jsx("label",{className:"text-[7px] font-bold text-gray-600 uppercase tracking-widest pl-1 block",children:t.type==="scroll"?"Selector (Optional)":"Selector"}),d.jsxs("div",{className:"bg-white/[0.03] border border-white/5 rounded-xl px-3 py-2 text-[11px] focus-within:border-white/20 transition-all flex items-center gap-2 relative",children:[d.jsxs("div",{className:"flex-1 min-w-0 flex flex-col gap-1",children:[d.jsx(_n,{value:t.selector||"",onChange:R=>h(t.id,{selector:R}),onBlur:()=>p(),variables:c,placeholder:t.type==="scroll"?".scroll-container or leave empty":".btn-primary"}),k&&k.length>1&&d.jsx("div",{className:"flex flex-wrap gap-1 mt-1",children:k.map((R,G)=>d.jsx("button",{onClick:P=>{P.stopPropagation(),h(t.id,{selector:R},!0)},className:`text-[9px] px-1.5 py-0.5 rounded border transition-colors ${t.selector===R?"bg-blue-500/20 border-blue-500/50 text-blue-300":"bg-white/[0.02] border-white/10 text-white/40 hover:text-white/80 hover:bg-white/[0.05]"}`,title:"Use this alternative selector",children:R},G))})]}),d.jsx("button",{onClick:()=>{j&&j(t.id)},disabled:t.disabled,className:"text-white transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50 flex items-center justify-center opacity-50 hover:opacity-100 shrink-0 disabled:opacity-20 disabled:hover:opacity-20 disabled:cursor-not-allowed rounded",title:"Pick Selector in Browser","aria-label":"Pick Selector in Browser",children:d.jsx(Ce,{name:"my_location",className:"text-lg"})})]})]}),t.type==="scroll"&&d.jsxs("div",{className:"space-y-1.5",children:[d.jsx("label",{className:"text-[7px] font-bold text-gray-600 uppercase tracking-widest pl-1",children:"Scroll Speed (ms)"}),d.jsx("div",{className:"bg-white/[0.03] border border-white/5 rounded-xl px-3 py-2 text-[11px] focus-within:border-white/20 transition-all",children:d.jsx(_n,{value:t.key||"",onChange:R=>h(t.id,{key:R}),onBlur:()=>p(),variables:c,placeholder:"500"})})]}),(t.type==="navigate"||t.type==="type"||t.type==="wait"||t.type==="wait_selector"||t.type==="javascript"||t.type==="csv")&&d.jsxs("div",{className:"space-y-1.5",children:[d.jsx("label",{className:"text-[7px] font-bold text-gray-600 uppercase tracking-widest pl-1",children:t.type==="navigate"?"URL":t.type==="type"?"Content":t.type==="wait"?"Seconds":t.type==="wait_selector"?"Timeout (Sec)":t.type==="csv"?"CSV Input":"Script"}),d.jsx("div",{className:"bg-white/[0.03] border border-white/5 rounded-xl px-3 py-2 text-[11px] focus-within:border-white/20 transition-all",children:t.type==="javascript"?d.jsx(sl,{value:t.value||"",onChange:R=>h(t.id,{value:R}),onBlur:()=>p(),language:"javascript",variables:c,className:"min-h-[120px]",placeholder:"return document.title"}):t.type==="csv"?d.jsx(sl,{value:t.value||"",onChange:R=>h(t.id,{value:R}),onBlur:()=>p(),language:"plain",variables:c,className:"min-h-[120px]",placeholder:"name,age\\nAda,31"}):d.jsx(_n,{value:t.value||"",onChange:R=>h(t.id,{value:R}),onBlur:()=>p(),variables:c,placeholder:t.type==="navigate"?"https://example.com":t.type==="type"?"Search keywords":t.type==="wait"?"3":t.type==="wait_selector"?"10":"400"})}),t.type==="type"&&d.jsxs("div",{className:"space-y-1.5",children:[d.jsx("label",{className:"text-[7px] font-bold text-gray-600 uppercase tracking-widest pl-1",children:"Mode"}),d.jsx("div",{className:"bg-white/[0.03] border border-white/5 rounded-xl px-3 py-2 text-[11px] focus-within:border-white/20 transition-all",children:d.jsx("select",{value:t.typeMode||"replace",onChange:R=>{h(t.id,{typeMode:R.target.value},!0)},className:"custom-select w-full bg-transparent border-none px-0 py-0 text-[11px] text-white",children:P1.map(R=>d.jsx("option",{value:R.value,children:R.label},R.value))})})]})]}),t.type==="screenshot"&&d.jsxs("div",{className:"space-y-1.5",children:[d.jsx("label",{className:"text-[7px] font-bold text-gray-600 uppercase tracking-widest pl-1",children:"Label (Optional)"}),d.jsx("div",{className:"bg-white/[0.03] border border-white/5 rounded-xl px-3 py-2 text-[11px] focus-within:border-white/20 transition-all",children:d.jsx(_n,{value:t.value||"",onChange:R=>h(t.id,{value:R}),onBlur:()=>p(),variables:c,placeholder:"checkout-step"})})]}),t.type==="press"&&(()=>{const{modifiers:R,baseKey:G}=F1(t.key);return d.jsxs("div",{className:"space-y-2",children:[d.jsx("label",{className:"text-[7px] font-bold text-gray-600 uppercase tracking-widest pl-1",children:"Key"}),d.jsx("div",{className:"grid grid-cols-2 gap-1 text-[10px] text-white",children:I1.map(P=>d.jsxs("label",{className:"inline-flex items-center space-x-1",children:[d.jsx("input",{type:"checkbox",checked:R.includes(P.value),onChange:q=>{const W=q.target.checked?[...R,P.value]:R.filter(I=>I!==P.value);h(t.id,{key:rg(W,G)},!0)},className:"h-3 w-3 rounded border border-white/30 bg-black/80"}),d.jsx("span",{className:"uppercase text-[9px] text-white/70",children:P.label})]},P.value))}),d.jsx("div",{className:"bg-white/[0.03] border border-white/5 rounded-xl px-3 py-2 text-[11px] focus-within:border-white/20 transition-all",children:d.jsxs("select",{value:G,onChange:P=>h(t.id,{key:rg(R,P.target.value)},!0),className:"custom-select w-full bg-transparent border-none px-0 py-0 text-[11px] text-white",children:[d.jsx("option",{value:"",children:"Select key"}),H1.map(P=>d.jsx("option",{value:P,children:P},P))]})})]})})(),t.type==="if"&&(()=>{const R=Object.keys(c||{}),G=lg(t.conditionVar||""),P=G&&c?.[G]?.type,q=t.conditionVarType||P||"string",W=Bi[q]||Bi.string,I=t.conditionOp||W[0].value;return d.jsxs("div",{className:"space-y-2",children:[d.jsx("label",{className:"text-[7px] font-bold text-gray-600 uppercase tracking-widest pl-1",children:"Condition"}),d.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-2",children:[d.jsxs("div",{className:"space-y-1",children:[d.jsx("span",{className:"text-[7px] font-bold text-gray-500 uppercase tracking-widest pl-1",children:"Variable"}),d.jsx("input",{type:"text",list:`if-var-${t.id}`,value:t.conditionVar||"",onChange:X=>h(t.id,{conditionVar:X.target.value}),onBlur:()=>p(),placeholder:"variable name",className:"w-full bg-white/[0.05] border border-white/10 rounded-lg px-3 py-2 text-[10px] text-white"}),R.length>0&&d.jsx("datalist",{id:`if-var-${t.id}`,children:R.map(X=>d.jsx("option",{value:X},X))})]}),d.jsxs("div",{className:"space-y-1",children:[d.jsx("span",{className:"text-[7px] font-bold text-gray-500 uppercase tracking-widest pl-1",children:"Type"}),d.jsxs("select",{value:q,onChange:X=>{const E=X.target.value,Q=Bi[E]||Bi.string;h(t.id,{conditionVarType:E,conditionOp:Q[0].value,conditionValue:E==="boolean"?"":t.conditionValue||""},!0)},className:"custom-select w-full bg-white/[0.05] border border-white/10 rounded-xl px-3 py-2 text-[8px] font-bold uppercase text-white/60",children:[d.jsx("option",{value:"string",children:"String"}),d.jsx("option",{value:"number",children:"Number"}),d.jsx("option",{value:"boolean",children:"Boolean"})]})]}),d.jsxs("div",{className:"space-y-1",children:[d.jsx("span",{className:"text-[7px] font-bold text-gray-500 uppercase tracking-widest pl-1",children:"Relation"}),d.jsx("select",{value:I,onChange:X=>h(t.id,{conditionOp:X.target.value},!0),className:"custom-select w-full bg-white/[0.05] border border-white/10 rounded-xl px-3 py-2 text-[8px] font-bold uppercase text-white/60",children:W.map(X=>d.jsx("option",{value:X.value,children:X.label},X.value))})]})]}),q!=="boolean"&&d.jsxs("div",{className:"space-y-1",children:[d.jsx("span",{className:"text-[7px] font-bold text-gray-500 uppercase tracking-widest pl-1",children:"Value"}),d.jsx("input",{type:q==="number"?"number":"text",value:t.conditionValue||"",onChange:X=>h(t.id,{conditionValue:X.target.value}),onBlur:()=>p(),placeholder:q==="number"?"0":"value",className:"w-full bg-white/[0.05] border border-white/10 rounded-lg px-3 py-2 text-[10px] text-white"})]})]})})(),t.type==="while"&&(()=>{const R=Object.keys(c||{}),G=lg(t.conditionVar||""),P=G&&c?.[G]?.type,q=t.conditionVarType||P||"string",W=Bi[q]||Bi.string,I=t.conditionOp||W[0].value;return d.jsxs("div",{className:"space-y-2",children:[d.jsx("label",{className:"text-[7px] font-bold text-gray-600 uppercase tracking-widest pl-1",children:"Condition"}),d.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-2",children:[d.jsxs("div",{className:"space-y-1",children:[d.jsx("span",{className:"text-[7px] font-bold text-gray-500 uppercase tracking-widest pl-1",children:"Variable"}),d.jsx("input",{type:"text",list:`while-var-${t.id}`,value:t.conditionVar||"",onChange:X=>h(t.id,{conditionVar:X.target.value}),onBlur:()=>p(),placeholder:"variable name",className:"w-full bg-white/[0.05] border border-white/10 rounded-lg px-3 py-2 text-[10px] text-white"}),R.length>0&&d.jsx("datalist",{id:`while-var-${t.id}`,children:R.map(X=>d.jsx("option",{value:X},X))})]}),d.jsxs("div",{className:"space-y-1",children:[d.jsx("span",{className:"text-[7px] font-bold text-gray-500 uppercase tracking-widest pl-1",children:"Type"}),d.jsxs("select",{value:q,onChange:X=>{const E=X.target.value,Q=Bi[E]||Bi.string;h(t.id,{conditionVarType:E,conditionOp:Q[0].value,conditionValue:E==="boolean"?"":t.conditionValue||""},!0)},className:"custom-select w-full bg-white/[0.05] border border-white/10 rounded-xl px-3 py-2 text-[8px] font-bold uppercase text-white/60",children:[d.jsx("option",{value:"string",children:"String"}),d.jsx("option",{value:"number",children:"Number"}),d.jsx("option",{value:"boolean",children:"Boolean"})]})]}),d.jsxs("div",{className:"space-y-1",children:[d.jsx("span",{className:"text-[7px] font-bold text-gray-500 uppercase tracking-widest pl-1",children:"Relation"}),d.jsx("select",{value:I,onChange:X=>h(t.id,{conditionOp:X.target.value},!0),className:"custom-select w-full bg-white/[0.05] border border-white/10 rounded-xl px-3 py-2 text-[8px] font-bold uppercase text-white/60",children:W.map(X=>d.jsx("option",{value:X.value,children:X.label},X.value))})]})]}),q!=="boolean"&&d.jsxs("div",{className:"space-y-1",children:[d.jsx("span",{className:"text-[7px] font-bold text-gray-500 uppercase tracking-widest pl-1",children:"Value"}),d.jsx("input",{type:q==="number"?"number":"text",value:t.conditionValue||"",onChange:X=>h(t.id,{conditionValue:X.target.value}),onBlur:()=>p(),placeholder:q==="number"?"0":"value",className:"w-full bg-white/[0.05] border border-white/10 rounded-lg px-3 py-2 text-[10px] text-white"})]})]})})(),t.type==="repeat"&&d.jsxs("div",{className:"space-y-1.5",children:[d.jsx("label",{className:"text-[7px] font-bold text-gray-600 uppercase tracking-widest pl-1",children:"Times"}),d.jsx("div",{className:"bg-white/[0.03] border border-white/5 rounded-xl px-3 py-2 text-[11px] focus-within:border-white/20 transition-all",children:d.jsx(_n,{value:t.value||"",onChange:R=>h(t.id,{value:R}),variables:c,placeholder:"3"})})]}),t.type==="foreach"&&d.jsxs("div",{className:"space-y-3",children:[d.jsxs("div",{className:"space-y-1.5",children:[d.jsx("label",{className:"text-[7px] font-bold text-gray-600 uppercase tracking-widest pl-1",children:"Selector (Optional)"}),d.jsx("div",{className:"bg-white/[0.03] border border-white/5 rounded-xl px-3 py-2 text-[11px] focus-within:border-white/20 transition-all",children:d.jsx(_n,{value:t.selector||"",onChange:R=>h(t.id,{selector:R}),variables:c,placeholder:".list-item"})})]}),d.jsxs("div",{className:"space-y-1.5",children:[d.jsx("label",{className:"text-[7px] font-bold text-gray-600 uppercase tracking-widest pl-1",children:"Variable (Array Name)"}),d.jsx("div",{className:"bg-white/[0.03] border border-white/5 rounded-xl px-3 py-2 text-[11px] focus-within:border-white/20 transition-all",children:d.jsx(_n,{value:t.varName||"",onChange:R=>h(t.id,{varName:R}),variables:c,placeholder:"items"})})]})]}),t.type==="set"&&d.jsxs("div",{className:"space-y-3",children:[d.jsxs("div",{className:"space-y-1.5",children:[d.jsx("label",{className:"text-[7px] font-bold text-gray-600 uppercase tracking-widest pl-1",children:"Variable Name"}),d.jsx("div",{className:"bg-white/[0.03] border border-white/5 rounded-xl px-3 py-2 text-[11px] focus-within:border-white/20 transition-all",children:d.jsx(_n,{value:t.varName||"",onChange:R=>h(t.id,{varName:R}),variables:c,placeholder:"status"})})]}),d.jsxs("div",{className:"space-y-1.5",children:[d.jsx("label",{className:"text-[7px] font-bold text-gray-600 uppercase tracking-widest pl-1",children:"Value"}),d.jsx("div",{className:"bg-white/[0.03] border border-white/5 rounded-xl px-3 py-2 text-[11px] focus-within:border-white/20 transition-all",children:d.jsx(_n,{value:t.value||"",onChange:R=>h(t.id,{value:R}),variables:c,placeholder:"ready"})})]})]}),t.type==="merge"&&d.jsxs("div",{className:"space-y-3",children:[d.jsxs("div",{className:"space-y-1.5",children:[d.jsx("label",{className:"text-[7px] font-bold text-gray-600 uppercase tracking-widest pl-1",children:"Sources"}),d.jsx("div",{className:"bg-white/[0.03] border border-white/5 rounded-xl px-3 py-2 text-[11px] focus-within:border-white/20 transition-all",children:d.jsx(_n,{value:t.value||"",onChange:R=>h(t.id,{value:R}),variables:c,placeholder:"items, extraItems, {$block.output}"})})]}),d.jsxs("div",{className:"space-y-1.5",children:[d.jsx("label",{className:"text-[7px] font-bold text-gray-600 uppercase tracking-widest pl-1",children:"Target Variable (Optional)"}),d.jsx("div",{className:"bg-white/[0.03] border border-white/5 rounded-xl px-3 py-2 text-[11px] focus-within:border-white/20 transition-all",children:d.jsx(_n,{value:t.varName||"",onChange:R=>h(t.id,{varName:R}),variables:c,placeholder:"allItems"})})]})]}),t.type==="stop"&&d.jsxs("div",{className:"space-y-1.5",children:[d.jsx("label",{className:"text-[7px] font-bold text-gray-600 uppercase tracking-widest pl-1",children:"Outcome"}),d.jsxs("select",{value:t.value||"success",onChange:R=>h(t.id,{value:R.target.value},!0),className:"custom-select w-full bg-white/[0.03] border border-white/5 rounded-xl px-3 py-2 text-[9px] font-bold uppercase tracking-[0.2em] text-white/70 focus:outline-none",children:[d.jsx("option",{value:"success",children:"Success"}),d.jsx("option",{value:"error",children:"Error"})]})]}),t.type==="on_error"&&d.jsx("div",{className:"text-[8px] text-gray-600 uppercase tracking-widest",children:"Runs if any action fails."}),t.type==="start"&&d.jsxs("div",{className:"space-y-1.5",children:[d.jsx("label",{className:"text-[7px] font-bold text-gray-600 uppercase tracking-widest pl-1",children:"Task"}),d.jsxs("select",{value:t.value||"",onChange:R=>h(t.id,{value:R.target.value},!0),className:"custom-select w-full bg-white/[0.03] border border-white/5 rounded-xl px-3 py-2 text-[9px] font-bold uppercase tracking-[0.2em] text-white/70 focus:outline-none",children:[d.jsx("option",{value:"",disabled:!0,children:"Select task"}),f.length===0&&d.jsx("option",{value:"",disabled:!0,children:"No other tasks"}),f.map(R=>d.jsx("option",{value:R.id,children:R.name||R.id},R.id))]})]})]})]})});function V1(t,r){const i={};return(t[t.length-1]===""?[...t,""]:t).join((i.padRight?" ":"")+","+(i.padLeft===!1?"":" ")).trim()}const Y1=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,G1=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,K1={};function og(t,r){return(K1.jsx?G1:Y1).test(t)}const $1=/[ \t\n\f\r]/g;function X1(t){return typeof t=="object"?t.type==="text"?ug(t.value):!1:ug(t)}function ug(t){return t.replace($1,"")===""}class ml{constructor(r,i,l){this.normal=i,this.property=r,l&&(this.space=l)}}ml.prototype.normal={};ml.prototype.property={};ml.prototype.space=void 0;function Rx(t,r){const i={},l={};for(const o of t)Object.assign(i,o.property),Object.assign(l,o.normal);return new ml(i,l,r)}function rd(t){return t.toLowerCase()}class an{constructor(r,i){this.attribute=i,this.property=r}}an.prototype.attribute="";an.prototype.booleanish=!1;an.prototype.boolean=!1;an.prototype.commaOrSpaceSeparated=!1;an.prototype.commaSeparated=!1;an.prototype.defined=!1;an.prototype.mustUseProperty=!1;an.prototype.number=!1;an.prototype.overloadedBoolean=!1;an.prototype.property="";an.prototype.spaceSeparated=!1;an.prototype.space=void 0;let Z1=0;const Qe=oa(),Mt=oa(),ld=oa(),Oe=oa(),wt=oa(),Za=oa(),fn=oa();function oa(){return 2**++Z1}const sd=Object.freeze(Object.defineProperty({__proto__:null,boolean:Qe,booleanish:Mt,commaOrSpaceSeparated:fn,commaSeparated:Za,number:Oe,overloadedBoolean:ld,spaceSeparated:wt},Symbol.toStringTag,{value:"Module"})),Lc=Object.keys(sd);class jd extends an{constructor(r,i,l,o){let u=-1;if(super(r,i),cg(this,"space",o),typeof l=="number")for(;++u<Lc.length;){const c=Lc[u];cg(this,Lc[u],(l&sd[c])===sd[c])}}}jd.prototype.defined=!0;function cg(t,r,i){i&&(t[r]=i)}function er(t){const r={},i={};for(const[l,o]of Object.entries(t.properties)){const u=new jd(l,t.transform(t.attributes||{},l),o,t.space);t.mustUseProperty&&t.mustUseProperty.includes(l)&&(u.mustUseProperty=!0),r[l]=u,i[rd(l)]=l,i[rd(u.attribute)]=l}return new ml(r,i,t.space)}const Ox=er({properties:{ariaActiveDescendant:null,ariaAtomic:Mt,ariaAutoComplete:null,ariaBusy:Mt,ariaChecked:Mt,ariaColCount:Oe,ariaColIndex:Oe,ariaColSpan:Oe,ariaControls:wt,ariaCurrent:null,ariaDescribedBy:wt,ariaDetails:null,ariaDisabled:Mt,ariaDropEffect:wt,ariaErrorMessage:null,ariaExpanded:Mt,ariaFlowTo:wt,ariaGrabbed:Mt,ariaHasPopup:null,ariaHidden:Mt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:wt,ariaLevel:Oe,ariaLive:null,ariaModal:Mt,ariaMultiLine:Mt,ariaMultiSelectable:Mt,ariaOrientation:null,ariaOwns:wt,ariaPlaceholder:null,ariaPosInSet:Oe,ariaPressed:Mt,ariaReadOnly:Mt,ariaRelevant:null,ariaRequired:Mt,ariaRoleDescription:wt,ariaRowCount:Oe,ariaRowIndex:Oe,ariaRowSpan:Oe,ariaSelected:Mt,ariaSetSize:Oe,ariaSort:null,ariaValueMax:Oe,ariaValueMin:Oe,ariaValueNow:Oe,ariaValueText:null,role:null},transform(t,r){return r==="role"?r:"aria-"+r.slice(4).toLowerCase()}});function Dx(t,r){return r in t?t[r]:r}function Mx(t,r){return Dx(t,r.toLowerCase())}const Q1=er({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Za,acceptCharset:wt,accessKey:wt,action:null,allow:null,allowFullScreen:Qe,allowPaymentRequest:Qe,allowUserMedia:Qe,alt:null,as:null,async:Qe,autoCapitalize:null,autoComplete:wt,autoFocus:Qe,autoPlay:Qe,blocking:wt,capture:null,charSet:null,checked:Qe,cite:null,className:wt,cols:Oe,colSpan:null,content:null,contentEditable:Mt,controls:Qe,controlsList:wt,coords:Oe|Za,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Qe,defer:Qe,dir:null,dirName:null,disabled:Qe,download:ld,draggable:Mt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Qe,formTarget:null,headers:wt,height:Oe,hidden:ld,high:Oe,href:null,hrefLang:null,htmlFor:wt,httpEquiv:wt,id:null,imageSizes:null,imageSrcSet:null,inert:Qe,inputMode:null,integrity:null,is:null,isMap:Qe,itemId:null,itemProp:wt,itemRef:wt,itemScope:Qe,itemType:wt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Qe,low:Oe,manifest:null,max:null,maxLength:Oe,media:null,method:null,min:null,minLength:Oe,multiple:Qe,muted:Qe,name:null,nonce:null,noModule:Qe,noValidate:Qe,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:Qe,optimum:Oe,pattern:null,ping:wt,placeholder:null,playsInline:Qe,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Qe,referrerPolicy:null,rel:wt,required:Qe,reversed:Qe,rows:Oe,rowSpan:Oe,sandbox:wt,scope:null,scoped:Qe,seamless:Qe,selected:Qe,shadowRootClonable:Qe,shadowRootDelegatesFocus:Qe,shadowRootMode:null,shape:null,size:Oe,sizes:null,slot:null,span:Oe,spellCheck:Mt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Oe,step:null,style:null,tabIndex:Oe,target:null,title:null,translate:null,type:null,typeMustMatch:Qe,useMap:null,value:Mt,width:Oe,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:wt,axis:null,background:null,bgColor:null,border:Oe,borderColor:null,bottomMargin:Oe,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Qe,declare:Qe,event:null,face:null,frame:null,frameBorder:null,hSpace:Oe,leftMargin:Oe,link:null,longDesc:null,lowSrc:null,marginHeight:Oe,marginWidth:Oe,noResize:Qe,noHref:Qe,noShade:Qe,noWrap:Qe,object:null,profile:null,prompt:null,rev:null,rightMargin:Oe,rules:null,scheme:null,scrolling:Mt,standby:null,summary:null,text:null,topMargin:Oe,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Oe,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Qe,disableRemotePlayback:Qe,prefix:null,property:null,results:Oe,security:null,unselectable:null},space:"html",transform:Mx}),J1=er({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:fn,accentHeight:Oe,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Oe,amplitude:Oe,arabicForm:null,ascent:Oe,attributeName:null,attributeType:null,azimuth:Oe,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Oe,by:null,calcMode:null,capHeight:Oe,className:wt,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:Oe,diffuseConstant:Oe,direction:null,display:null,dur:null,divisor:Oe,dominantBaseline:null,download:Qe,dx:null,dy:null,edgeMode:null,editable:null,elevation:Oe,enableBackground:null,end:null,event:null,exponent:Oe,externalResourcesRequired:null,fill:null,fillOpacity:Oe,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:Za,g2:Za,glyphName:Za,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Oe,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Oe,horizOriginX:Oe,horizOriginY:Oe,id:null,ideographic:Oe,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Oe,k:Oe,k1:Oe,k2:Oe,k3:Oe,k4:Oe,kernelMatrix:fn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Oe,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:Oe,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:Oe,overlineThickness:Oe,paintOrder:null,panose1:null,path:null,pathLength:Oe,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:wt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Oe,pointsAtY:Oe,pointsAtZ:Oe,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:fn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:fn,rev:fn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:fn,requiredFeatures:fn,requiredFonts:fn,requiredFormats:fn,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:Oe,specularExponent:Oe,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Oe,strikethroughThickness:Oe,string:null,stroke:null,strokeDashArray:fn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Oe,strokeOpacity:Oe,strokeWidth:null,style:null,surfaceScale:Oe,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:fn,tabIndex:Oe,tableValues:null,target:null,targetX:Oe,targetY:Oe,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:fn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Oe,underlineThickness:Oe,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Oe,values:null,vAlphabetic:Oe,vMathematical:Oe,vectorEffect:null,vHanging:Oe,vIdeographic:Oe,version:null,vertAdvY:Oe,vertOriginX:Oe,vertOriginY:Oe,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Oe,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Dx}),Lx=er({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(t,r){return"xlink:"+r.slice(5).toLowerCase()}}),Bx=er({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Mx}),Ux=er({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(t,r){return"xml:"+r.slice(3).toLowerCase()}}),W1={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"},e2=/[A-Z]/g,dg=/-[a-z]/g,t2=/^data[-\w.:]+$/i;function n2(t,r){const i=rd(r);let l=r,o=an;if(i in t.normal)return t.property[t.normal[i]];if(i.length>4&&i.slice(0,4)==="data"&&t2.test(r)){if(r.charAt(4)==="-"){const u=r.slice(5).replace(dg,a2);l="data"+u.charAt(0).toUpperCase()+u.slice(1)}else{const u=r.slice(4);if(!dg.test(u)){let c=u.replace(e2,i2);c.charAt(0)!=="-"&&(c="-"+c),r="data"+c}}o=jd}return new o(l,r)}function i2(t){return"-"+t.toLowerCase()}function a2(t){return t.charAt(1).toUpperCase()}const r2=Rx([Ox,Q1,Lx,Bx,Ux],"html"),_d=Rx([Ox,J1,Lx,Bx,Ux],"svg");function l2(t){return t.join(" ").trim()}var Ka={},Bc,fg;function s2(){if(fg)return Bc;fg=1;var t=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,i=/^\s*/,l=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,u=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,f=/^\s+|\s+$/g,h=`
15
- `,p="/",b="*",x="",w="comment",y="declaration";function j(k,S){if(typeof k!="string")throw new TypeError("First argument must be a string");if(!k)return[];S=S||{};var _=1,N=1;function B(E){var Q=E.match(r);Q&&(_+=Q.length);var $=E.lastIndexOf(h);N=~$?E.length-$:N+E.length}function D(){var E={line:_,column:N};return function(Q){return Q.position=new z(E),P(),Q}}function z(E){this.start=E,this.end={line:_,column:N},this.source=S.source}z.prototype.content=k;function R(E){var Q=new Error(S.source+":"+_+":"+N+": "+E);if(Q.reason=E,Q.filename=S.source,Q.line=_,Q.column=N,Q.source=k,!S.silent)throw Q}function G(E){var Q=E.exec(k);if(Q){var $=Q[0];return B($),k=k.slice($.length),Q}}function P(){G(i)}function q(E){var Q;for(E=E||[];Q=W();)Q!==!1&&E.push(Q);return E}function W(){var E=D();if(!(p!=k.charAt(0)||b!=k.charAt(1))){for(var Q=2;x!=k.charAt(Q)&&(b!=k.charAt(Q)||p!=k.charAt(Q+1));)++Q;if(Q+=2,x===k.charAt(Q-1))return R("End of comment missing");var $=k.slice(2,Q-2);return N+=2,B($),k=k.slice(Q),N+=2,E({type:w,comment:$})}}function I(){var E=D(),Q=G(l);if(Q){if(W(),!G(o))return R("property missing ':'");var $=G(u),J=E({type:y,property:v(Q[0].replace(t,x)),value:$?v($[0].replace(t,x)):x});return G(c),J}}function X(){var E=[];q(E);for(var Q;Q=I();)Q!==!1&&(E.push(Q),q(E));return E}return P(),X()}function v(k){return k?k.replace(f,x):x}return Bc=j,Bc}var hg;function o2(){if(hg)return Ka;hg=1;var t=Ka&&Ka.__importDefault||function(l){return l&&l.__esModule?l:{default:l}};Object.defineProperty(Ka,"__esModule",{value:!0}),Ka.default=i;const r=t(s2());function i(l,o){let u=null;if(!l||typeof l!="string")return u;const c=(0,r.default)(l),f=typeof o=="function";return c.forEach(h=>{if(h.type!=="declaration")return;const{property:p,value:b}=h;f?o(p,b,h):b&&(u=u||{},u[p]=b)}),u}return Ka}var Jr={},pg;function u2(){if(pg)return Jr;pg=1,Object.defineProperty(Jr,"__esModule",{value:!0}),Jr.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,r=/-([a-z])/g,i=/^[^-]+$/,l=/^-(webkit|moz|ms|o|khtml)-/,o=/^-(ms)-/,u=function(p){return!p||i.test(p)||t.test(p)},c=function(p,b){return b.toUpperCase()},f=function(p,b){return"".concat(b,"-")},h=function(p,b){return b===void 0&&(b={}),u(p)?p:(p=p.toLowerCase(),b.reactCompat?p=p.replace(o,f):p=p.replace(l,f),p.replace(r,c))};return Jr.camelCase=h,Jr}var Wr,mg;function c2(){if(mg)return Wr;mg=1;var t=Wr&&Wr.__importDefault||function(o){return o&&o.__esModule?o:{default:o}},r=t(o2()),i=u2();function l(o,u){var c={};return!o||typeof o!="string"||(0,r.default)(o,function(f,h){f&&h&&(c[(0,i.camelCase)(f,u)]=h)}),c}return l.default=l,Wr=l,Wr}var d2=c2();const f2=dl(d2),Ix=Hx("end"),Cd=Hx("start");function Hx(t){return r;function r(i){const l=i&&i.position&&i.position[t]||{};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 h2(t){const r=Cd(t),i=Ix(t);if(r&&i)return{start:r,end:i}}function il(t){return!t||typeof t!="object"?"":"position"in t||"type"in t?gg(t.position):"start"in t||"end"in t?gg(t):"line"in t||"column"in t?od(t):""}function od(t){return xg(t&&t.line)+":"+xg(t&&t.column)}function gg(t){return od(t&&t.start)+"-"+od(t&&t.end)}function xg(t){return t&&typeof t=="number"?t:1}class Yt extends Error{constructor(r,i,l){super(),typeof i=="string"&&(l=i,i=void 0);let o="",u={},c=!1;if(i&&("line"in i&&"column"in i?u={place:i}:"start"in i&&"end"in i?u={place:i}:"type"in i?u={ancestors:[i],place:i.position}:u={...i}),typeof r=="string"?o=r:!u.cause&&r&&(c=!0,o=r.message,u.cause=r),!u.ruleId&&!u.source&&typeof l=="string"){const h=l.indexOf(":");h===-1?u.ruleId=l:(u.source=l.slice(0,h),u.ruleId=l.slice(h+1))}if(!u.place&&u.ancestors&&u.ancestors){const h=u.ancestors[u.ancestors.length-1];h&&(u.place=h.position)}const f=u.place&&"start"in u.place?u.place.start:u.place;this.ancestors=u.ancestors||void 0,this.cause=u.cause||void 0,this.column=f?f.column:void 0,this.fatal=void 0,this.file="",this.message=o,this.line=f?f.line:void 0,this.name=il(u.place)||"1:1",this.place=u.place||void 0,this.reason=this.message,this.ruleId=u.ruleId||void 0,this.source=u.source||void 0,this.stack=c&&u.cause&&typeof u.cause.stack=="string"?u.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Yt.prototype.file="";Yt.prototype.name="";Yt.prototype.reason="";Yt.prototype.message="";Yt.prototype.stack="";Yt.prototype.column=void 0;Yt.prototype.line=void 0;Yt.prototype.ancestors=void 0;Yt.prototype.cause=void 0;Yt.prototype.fatal=void 0;Yt.prototype.place=void 0;Yt.prototype.ruleId=void 0;Yt.prototype.source=void 0;const Nd={}.hasOwnProperty,p2=new Map,m2=/[A-Z]/g,g2=new Set(["table","tbody","thead","tfoot","tr"]),x2=new Set(["td","th"]),Px="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function b2(t,r){if(!r||r.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const i=r.filePath||void 0;let l;if(r.development){if(typeof r.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");l=C2(i,r.jsxDEV)}else{if(typeof r.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof r.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");l=_2(i,r.jsx,r.jsxs)}const o={Fragment:r.Fragment,ancestors:[],components:r.components||{},create:l,elementAttributeNameCase:r.elementAttributeNameCase||"react",evaluater:r.createEvaluater?r.createEvaluater():void 0,filePath:i,ignoreInvalidStyle:r.ignoreInvalidStyle||!1,passKeys:r.passKeys!==!1,passNode:r.passNode||!1,schema:r.space==="svg"?_d:r2,stylePropertyNameCase:r.stylePropertyNameCase||"dom",tableCellAlignToStyle:r.tableCellAlignToStyle!==!1},u=Fx(o,t,void 0);return u&&typeof u!="string"?u:o.create(t,o.Fragment,{children:u||void 0},void 0)}function Fx(t,r,i){if(r.type==="element")return y2(t,r,i);if(r.type==="mdxFlowExpression"||r.type==="mdxTextExpression")return v2(t,r);if(r.type==="mdxJsxFlowElement"||r.type==="mdxJsxTextElement")return S2(t,r,i);if(r.type==="mdxjsEsm")return w2(t,r);if(r.type==="root")return k2(t,r,i);if(r.type==="text")return j2(t,r)}function y2(t,r,i){const l=t.schema;let o=l;r.tagName.toLowerCase()==="svg"&&l.space==="html"&&(o=_d,t.schema=o),t.ancestors.push(r);const u=Vx(t,r.tagName,!1),c=N2(t,r);let f=Ad(t,r);return g2.has(r.tagName)&&(f=f.filter(function(h){return typeof h=="string"?!X1(h):!0})),qx(t,c,u,r),Ed(c,f),t.ancestors.pop(),t.schema=l,t.create(r,u,c,i)}function v2(t,r){if(r.data&&r.data.estree&&t.evaluater){const l=r.data.estree.body[0];return l.type,t.evaluater.evaluateExpression(l.expression)}ul(t,r.position)}function w2(t,r){if(r.data&&r.data.estree&&t.evaluater)return t.evaluater.evaluateProgram(r.data.estree);ul(t,r.position)}function S2(t,r,i){const l=t.schema;let o=l;r.name==="svg"&&l.space==="html"&&(o=_d,t.schema=o),t.ancestors.push(r);const u=r.name===null?t.Fragment:Vx(t,r.name,!0),c=E2(t,r),f=Ad(t,r);return qx(t,c,u,r),Ed(c,f),t.ancestors.pop(),t.schema=l,t.create(r,u,c,i)}function k2(t,r,i){const l={};return Ed(l,Ad(t,r)),t.create(r,t.Fragment,l,i)}function j2(t,r){return r.value}function qx(t,r,i,l){typeof i!="string"&&i!==t.Fragment&&t.passNode&&(r.node=l)}function Ed(t,r){if(r.length>0){const i=r.length>1?r:r[0];i&&(t.children=i)}}function _2(t,r,i){return l;function l(o,u,c,f){const p=Array.isArray(c.children)?i:r;return f?p(u,c,f):p(u,c)}}function C2(t,r){return i;function i(l,o,u,c){const f=Array.isArray(u.children),h=Cd(l);return r(o,u,c,f,{columnNumber:h?h.column-1:void 0,fileName:t,lineNumber:h?h.line:void 0},void 0)}}function N2(t,r){const i={};let l,o;for(o in r.properties)if(o!=="children"&&Nd.call(r.properties,o)){const u=A2(t,o,r.properties[o]);if(u){const[c,f]=u;t.tableCellAlignToStyle&&c==="align"&&typeof f=="string"&&x2.has(r.tagName)?l=f:i[c]=f}}if(l){const u=i.style||(i.style={});u[t.stylePropertyNameCase==="css"?"text-align":"textAlign"]=l}return i}function E2(t,r){const i={};for(const l of r.attributes)if(l.type==="mdxJsxExpressionAttribute")if(l.data&&l.data.estree&&t.evaluater){const u=l.data.estree.body[0];u.type;const c=u.expression;c.type;const f=c.properties[0];f.type,Object.assign(i,t.evaluater.evaluateExpression(f.argument))}else ul(t,r.position);else{const o=l.name;let u;if(l.value&&typeof l.value=="object")if(l.value.data&&l.value.data.estree&&t.evaluater){const f=l.value.data.estree.body[0];f.type,u=t.evaluater.evaluateExpression(f.expression)}else ul(t,r.position);else u=l.value===null?!0:l.value;i[o]=u}return i}function Ad(t,r){const i=[];let l=-1;const o=t.passKeys?new Map:p2;for(;++l<r.children.length;){const u=r.children[l];let c;if(t.passKeys){const h=u.type==="element"?u.tagName:u.type==="mdxJsxFlowElement"||u.type==="mdxJsxTextElement"?u.name:void 0;if(h){const p=o.get(h)||0;c=h+"-"+p,o.set(h,p+1)}}const f=Fx(t,u,c);f!==void 0&&i.push(f)}return i}function A2(t,r,i){const l=n2(t.schema,r);if(!(i==null||typeof i=="number"&&Number.isNaN(i))){if(Array.isArray(i)&&(i=l.commaSeparated?V1(i):l2(i)),l.property==="style"){let o=typeof i=="object"?i:z2(t,String(i));return t.stylePropertyNameCase==="css"&&(o=T2(o)),["style",o]}return[t.elementAttributeNameCase==="react"&&l.space?W1[l.property]||l.property:l.attribute,i]}}function z2(t,r){try{return f2(r,{reactCompat:!0})}catch(i){if(t.ignoreInvalidStyle)return{};const l=i,o=new Yt("Cannot parse `style` attribute",{ancestors:t.ancestors,cause:l,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw o.file=t.filePath||void 0,o.url=Px+"#cannot-parse-style-attribute",o}}function Vx(t,r,i){let l;if(!i)l={type:"Literal",value:r};else if(r.includes(".")){const o=r.split(".");let u=-1,c;for(;++u<o.length;){const f=og(o[u])?{type:"Identifier",name:o[u]}:{type:"Literal",value:o[u]};c=c?{type:"MemberExpression",object:c,property:f,computed:!!(u&&f.type==="Literal"),optional:!1}:f}l=c}else l=og(r)&&!/^[a-z]/.test(r)?{type:"Identifier",name:r}:{type:"Literal",value:r};if(l.type==="Literal"){const o=l.value;return Nd.call(t.components,o)?t.components[o]:o}if(t.evaluater)return t.evaluater.evaluateExpression(l);ul(t)}function ul(t,r){const i=new Yt("Cannot handle MDX estrees without `createEvaluater`",{ancestors:t.ancestors,place:r,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw i.file=t.filePath||void 0,i.url=Px+"#cannot-handle-mdx-estrees-without-createevaluater",i}function T2(t){const r={};let i;for(i in t)Nd.call(t,i)&&(r[R2(i)]=t[i]);return r}function R2(t){let r=t.replace(m2,O2);return r.slice(0,3)==="ms-"&&(r="-"+r),r}function O2(t){return"-"+t.toLowerCase()}const Uc={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"]},D2={};function zd(t,r){const i=D2,l=typeof i.includeImageAlt=="boolean"?i.includeImageAlt:!0,o=typeof i.includeHtml=="boolean"?i.includeHtml:!0;return Yx(t,l,o)}function Yx(t,r,i){if(M2(t)){if("value"in t)return t.type==="html"&&!i?"":t.value;if(r&&"alt"in t&&t.alt)return t.alt;if("children"in t)return bg(t.children,r,i)}return Array.isArray(t)?bg(t,r,i):""}function bg(t,r,i){const l=[];let o=-1;for(;++o<t.length;)l[o]=Yx(t[o],r,i);return l.join("")}function M2(t){return!!(t&&typeof t=="object")}const yg=document.createElement("i");function Td(t){const r="&"+t+";";yg.innerHTML=r;const i=yg.textContent;return i.charCodeAt(i.length-1)===59&&t!=="semi"||i===r?!1:i}function hn(t,r,i,l){const o=t.length;let u=0,c;if(r<0?r=-r>o?0:o+r:r=r>o?o:r,i=i>0?i:0,l.length<1e4)c=Array.from(l),c.unshift(r,i),t.splice(...c);else for(i&&t.splice(r,i);u<l.length;)c=l.slice(u,u+1e4),c.unshift(r,0),t.splice(...c),u+=1e4,r+=1e4}function Cn(t,r){return t.length>0?(hn(t,t.length,0,r),t):r}const vg={}.hasOwnProperty;function Gx(t){const r={};let i=-1;for(;++i<t.length;)L2(r,t[i]);return r}function L2(t,r){let i;for(i in r){const o=(vg.call(t,i)?t[i]:void 0)||(t[i]={}),u=r[i];let c;if(u)for(c in u){vg.call(o,c)||(o[c]=[]);const f=u[c];B2(o[c],Array.isArray(f)?f:f?[f]:[])}}}function B2(t,r){let i=-1;const l=[];for(;++i<r.length;)(r[i].add==="after"?t:l).push(r[i]);hn(t,0,0,l)}function Kx(t,r){const i=Number.parseInt(t,r);return i<9||i===11||i>13&&i<32||i>126&&i<160||i>55295&&i<57344||i>64975&&i<65008||(i&65535)===65535||(i&65535)===65534||i>1114111?"�":String.fromCodePoint(i)}function Rn(t){return t.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const $t=Hi(/[A-Za-z]/),Vt=Hi(/[\dA-Za-z]/),U2=Hi(/[#-'*+\--9=?A-Z^-~]/);function Zs(t){return t!==null&&(t<32||t===127)}const ud=Hi(/\d/),I2=Hi(/[\dA-Fa-f]/),H2=Hi(/[!-/:-@[-`{-~]/);function qe(t){return t!==null&&t<-2}function vt(t){return t!==null&&(t<0||t===32)}function tt(t){return t===-2||t===-1||t===32}const ao=Hi(new RegExp("\\p{P}|\\p{S}","u")),la=Hi(/\s/);function Hi(t){return r;function r(i){return i!==null&&i>-1&&t.test(String.fromCharCode(i))}}function tr(t){const r=[];let i=-1,l=0,o=0;for(;++i<t.length;){const u=t.charCodeAt(i);let c="";if(u===37&&Vt(t.charCodeAt(i+1))&&Vt(t.charCodeAt(i+2)))o=2;else if(u<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(u))||(c=String.fromCharCode(u));else if(u>55295&&u<57344){const f=t.charCodeAt(i+1);u<56320&&f>56319&&f<57344?(c=String.fromCharCode(u,f),o=1):c="�"}else c=String.fromCharCode(u);c&&(r.push(t.slice(l,i),encodeURIComponent(c)),l=i+o+1,c=""),o&&(i+=o,o=0)}return r.join("")+t.slice(l)}function lt(t,r,i,l){const o=l?l-1:Number.POSITIVE_INFINITY;let u=0;return c;function c(h){return tt(h)?(t.enter(i),f(h)):r(h)}function f(h){return tt(h)&&u++<o?(t.consume(h),f):(t.exit(i),r(h))}}const P2={tokenize:F2};function F2(t){const r=t.attempt(this.parser.constructs.contentInitial,l,o);let i;return r;function l(f){if(f===null){t.consume(f);return}return t.enter("lineEnding"),t.consume(f),t.exit("lineEnding"),lt(t,r,"linePrefix")}function o(f){return t.enter("paragraph"),u(f)}function u(f){const h=t.enter("chunkText",{contentType:"text",previous:i});return i&&(i.next=h),i=h,c(f)}function c(f){if(f===null){t.exit("chunkText"),t.exit("paragraph"),t.consume(f);return}return qe(f)?(t.consume(f),t.exit("chunkText"),u):(t.consume(f),c)}}const q2={tokenize:V2},wg={tokenize:Y2};function V2(t){const r=this,i=[];let l=0,o,u,c;return f;function f(N){if(l<i.length){const B=i[l];return r.containerState=B[1],t.attempt(B[0].continuation,h,p)(N)}return p(N)}function h(N){if(l++,r.containerState._closeFlow){r.containerState._closeFlow=void 0,o&&_();const B=r.events.length;let D=B,z;for(;D--;)if(r.events[D][0]==="exit"&&r.events[D][1].type==="chunkFlow"){z=r.events[D][1].end;break}S(l);let R=B;for(;R<r.events.length;)r.events[R][1].end={...z},R++;return hn(r.events,D+1,0,r.events.slice(B)),r.events.length=R,p(N)}return f(N)}function p(N){if(l===i.length){if(!o)return w(N);if(o.currentConstruct&&o.currentConstruct.concrete)return j(N);r.interrupt=!!(o.currentConstruct&&!o._gfmTableDynamicInterruptHack)}return r.containerState={},t.check(wg,b,x)(N)}function b(N){return o&&_(),S(l),w(N)}function x(N){return r.parser.lazy[r.now().line]=l!==i.length,c=r.now().offset,j(N)}function w(N){return r.containerState={},t.attempt(wg,y,j)(N)}function y(N){return l++,i.push([r.currentConstruct,r.containerState]),w(N)}function j(N){if(N===null){o&&_(),S(0),t.consume(N);return}return o=o||r.parser.flow(r.now()),t.enter("chunkFlow",{_tokenizer:o,contentType:"flow",previous:u}),v(N)}function v(N){if(N===null){k(t.exit("chunkFlow"),!0),S(0),t.consume(N);return}return qe(N)?(t.consume(N),k(t.exit("chunkFlow")),l=0,r.interrupt=void 0,f):(t.consume(N),v)}function k(N,B){const D=r.sliceStream(N);if(B&&D.push(null),N.previous=u,u&&(u.next=N),u=N,o.defineSkip(N.start),o.write(D),r.parser.lazy[N.start.line]){let z=o.events.length;for(;z--;)if(o.events[z][1].start.offset<c&&(!o.events[z][1].end||o.events[z][1].end.offset>c))return;const R=r.events.length;let G=R,P,q;for(;G--;)if(r.events[G][0]==="exit"&&r.events[G][1].type==="chunkFlow"){if(P){q=r.events[G][1].end;break}P=!0}for(S(l),z=R;z<r.events.length;)r.events[z][1].end={...q},z++;hn(r.events,G+1,0,r.events.slice(R)),r.events.length=z}}function S(N){let B=i.length;for(;B-- >N;){const D=i[B];r.containerState=D[1],D[0].exit.call(r,t)}i.length=N}function _(){o.write([null]),u=void 0,o=void 0,r.containerState._closeFlow=void 0}}function Y2(t,r,i){return lt(t,t.attempt(this.parser.constructs.document,r,i),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Qa(t){if(t===null||vt(t)||la(t))return 1;if(ao(t))return 2}function ro(t,r,i){const l=[];let o=-1;for(;++o<t.length;){const u=t[o].resolveAll;u&&!l.includes(u)&&(r=u(r,i),l.push(u))}return r}const cd={name:"attention",resolveAll:G2,tokenize:K2};function G2(t,r){let i=-1,l,o,u,c,f,h,p,b;for(;++i<t.length;)if(t[i][0]==="enter"&&t[i][1].type==="attentionSequence"&&t[i][1]._close){for(l=i;l--;)if(t[l][0]==="exit"&&t[l][1].type==="attentionSequence"&&t[l][1]._open&&r.sliceSerialize(t[l][1]).charCodeAt(0)===r.sliceSerialize(t[i][1]).charCodeAt(0)){if((t[l][1]._close||t[i][1]._open)&&(t[i][1].end.offset-t[i][1].start.offset)%3&&!((t[l][1].end.offset-t[l][1].start.offset+t[i][1].end.offset-t[i][1].start.offset)%3))continue;h=t[l][1].end.offset-t[l][1].start.offset>1&&t[i][1].end.offset-t[i][1].start.offset>1?2:1;const x={...t[l][1].end},w={...t[i][1].start};Sg(x,-h),Sg(w,h),c={type:h>1?"strongSequence":"emphasisSequence",start:x,end:{...t[l][1].end}},f={type:h>1?"strongSequence":"emphasisSequence",start:{...t[i][1].start},end:w},u={type:h>1?"strongText":"emphasisText",start:{...t[l][1].end},end:{...t[i][1].start}},o={type:h>1?"strong":"emphasis",start:{...c.start},end:{...f.end}},t[l][1].end={...c.start},t[i][1].start={...f.end},p=[],t[l][1].end.offset-t[l][1].start.offset&&(p=Cn(p,[["enter",t[l][1],r],["exit",t[l][1],r]])),p=Cn(p,[["enter",o,r],["enter",c,r],["exit",c,r],["enter",u,r]]),p=Cn(p,ro(r.parser.constructs.insideSpan.null,t.slice(l+1,i),r)),p=Cn(p,[["exit",u,r],["enter",f,r],["exit",f,r],["exit",o,r]]),t[i][1].end.offset-t[i][1].start.offset?(b=2,p=Cn(p,[["enter",t[i][1],r],["exit",t[i][1],r]])):b=0,hn(t,l-1,i-l+3,p),i=l+p.length-b-2;break}}for(i=-1;++i<t.length;)t[i][1].type==="attentionSequence"&&(t[i][1].type="data");return t}function K2(t,r){const i=this.parser.constructs.attentionMarkers.null,l=this.previous,o=Qa(l);let u;return c;function c(h){return u=h,t.enter("attentionSequence"),f(h)}function f(h){if(h===u)return t.consume(h),f;const p=t.exit("attentionSequence"),b=Qa(h),x=!b||b===2&&o||i.includes(h),w=!o||o===2&&b||i.includes(l);return p._open=!!(u===42?x:x&&(o||!w)),p._close=!!(u===42?w:w&&(b||!x)),r(h)}}function Sg(t,r){t.column+=r,t.offset+=r,t._bufferIndex+=r}const $2={name:"autolink",tokenize:X2};function X2(t,r,i){let l=0;return o;function o(y){return t.enter("autolink"),t.enter("autolinkMarker"),t.consume(y),t.exit("autolinkMarker"),t.enter("autolinkProtocol"),u}function u(y){return $t(y)?(t.consume(y),c):y===64?i(y):p(y)}function c(y){return y===43||y===45||y===46||Vt(y)?(l=1,f(y)):p(y)}function f(y){return y===58?(t.consume(y),l=0,h):(y===43||y===45||y===46||Vt(y))&&l++<32?(t.consume(y),f):(l=0,p(y))}function h(y){return y===62?(t.exit("autolinkProtocol"),t.enter("autolinkMarker"),t.consume(y),t.exit("autolinkMarker"),t.exit("autolink"),r):y===null||y===32||y===60||Zs(y)?i(y):(t.consume(y),h)}function p(y){return y===64?(t.consume(y),b):U2(y)?(t.consume(y),p):i(y)}function b(y){return Vt(y)?x(y):i(y)}function x(y){return y===46?(t.consume(y),l=0,b):y===62?(t.exit("autolinkProtocol").type="autolinkEmail",t.enter("autolinkMarker"),t.consume(y),t.exit("autolinkMarker"),t.exit("autolink"),r):w(y)}function w(y){if((y===45||Vt(y))&&l++<63){const j=y===45?w:x;return t.consume(y),j}return i(y)}}const gl={partial:!0,tokenize:Z2};function Z2(t,r,i){return l;function l(u){return tt(u)?lt(t,o,"linePrefix")(u):o(u)}function o(u){return u===null||qe(u)?r(u):i(u)}}const $x={continuation:{tokenize:J2},exit:W2,name:"blockQuote",tokenize:Q2};function Q2(t,r,i){const l=this;return o;function o(c){if(c===62){const f=l.containerState;return f.open||(t.enter("blockQuote",{_container:!0}),f.open=!0),t.enter("blockQuotePrefix"),t.enter("blockQuoteMarker"),t.consume(c),t.exit("blockQuoteMarker"),u}return i(c)}function u(c){return tt(c)?(t.enter("blockQuotePrefixWhitespace"),t.consume(c),t.exit("blockQuotePrefixWhitespace"),t.exit("blockQuotePrefix"),r):(t.exit("blockQuotePrefix"),r(c))}}function J2(t,r,i){const l=this;return o;function o(c){return tt(c)?lt(t,u,"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c):u(c)}function u(c){return t.attempt($x,r,i)(c)}}function W2(t){t.exit("blockQuote")}const Xx={name:"characterEscape",tokenize:eS};function eS(t,r,i){return l;function l(u){return t.enter("characterEscape"),t.enter("escapeMarker"),t.consume(u),t.exit("escapeMarker"),o}function o(u){return H2(u)?(t.enter("characterEscapeValue"),t.consume(u),t.exit("characterEscapeValue"),t.exit("characterEscape"),r):i(u)}}const Zx={name:"characterReference",tokenize:tS};function tS(t,r,i){const l=this;let o=0,u,c;return f;function f(x){return t.enter("characterReference"),t.enter("characterReferenceMarker"),t.consume(x),t.exit("characterReferenceMarker"),h}function h(x){return x===35?(t.enter("characterReferenceMarkerNumeric"),t.consume(x),t.exit("characterReferenceMarkerNumeric"),p):(t.enter("characterReferenceValue"),u=31,c=Vt,b(x))}function p(x){return x===88||x===120?(t.enter("characterReferenceMarkerHexadecimal"),t.consume(x),t.exit("characterReferenceMarkerHexadecimal"),t.enter("characterReferenceValue"),u=6,c=I2,b):(t.enter("characterReferenceValue"),u=7,c=ud,b(x))}function b(x){if(x===59&&o){const w=t.exit("characterReferenceValue");return c===Vt&&!Td(l.sliceSerialize(w))?i(x):(t.enter("characterReferenceMarker"),t.consume(x),t.exit("characterReferenceMarker"),t.exit("characterReference"),r)}return c(x)&&o++<u?(t.consume(x),b):i(x)}}const kg={partial:!0,tokenize:iS},jg={concrete:!0,name:"codeFenced",tokenize:nS};function nS(t,r,i){const l=this,o={partial:!0,tokenize:D};let u=0,c=0,f;return h;function h(z){return p(z)}function p(z){const R=l.events[l.events.length-1];return u=R&&R[1].type==="linePrefix"?R[2].sliceSerialize(R[1],!0).length:0,f=z,t.enter("codeFenced"),t.enter("codeFencedFence"),t.enter("codeFencedFenceSequence"),b(z)}function b(z){return z===f?(c++,t.consume(z),b):c<3?i(z):(t.exit("codeFencedFenceSequence"),tt(z)?lt(t,x,"whitespace")(z):x(z))}function x(z){return z===null||qe(z)?(t.exit("codeFencedFence"),l.interrupt?r(z):t.check(kg,v,B)(z)):(t.enter("codeFencedFenceInfo"),t.enter("chunkString",{contentType:"string"}),w(z))}function w(z){return z===null||qe(z)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),x(z)):tt(z)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),lt(t,y,"whitespace")(z)):z===96&&z===f?i(z):(t.consume(z),w)}function y(z){return z===null||qe(z)?x(z):(t.enter("codeFencedFenceMeta"),t.enter("chunkString",{contentType:"string"}),j(z))}function j(z){return z===null||qe(z)?(t.exit("chunkString"),t.exit("codeFencedFenceMeta"),x(z)):z===96&&z===f?i(z):(t.consume(z),j)}function v(z){return t.attempt(o,B,k)(z)}function k(z){return t.enter("lineEnding"),t.consume(z),t.exit("lineEnding"),S}function S(z){return u>0&&tt(z)?lt(t,_,"linePrefix",u+1)(z):_(z)}function _(z){return z===null||qe(z)?t.check(kg,v,B)(z):(t.enter("codeFlowValue"),N(z))}function N(z){return z===null||qe(z)?(t.exit("codeFlowValue"),_(z)):(t.consume(z),N)}function B(z){return t.exit("codeFenced"),r(z)}function D(z,R,G){let P=0;return q;function q(Q){return z.enter("lineEnding"),z.consume(Q),z.exit("lineEnding"),W}function W(Q){return z.enter("codeFencedFence"),tt(Q)?lt(z,I,"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(Q):I(Q)}function I(Q){return Q===f?(z.enter("codeFencedFenceSequence"),X(Q)):G(Q)}function X(Q){return Q===f?(P++,z.consume(Q),X):P>=c?(z.exit("codeFencedFenceSequence"),tt(Q)?lt(z,E,"whitespace")(Q):E(Q)):G(Q)}function E(Q){return Q===null||qe(Q)?(z.exit("codeFencedFence"),R(Q)):G(Q)}}}function iS(t,r,i){const l=this;return o;function o(c){return c===null?i(c):(t.enter("lineEnding"),t.consume(c),t.exit("lineEnding"),u)}function u(c){return l.parser.lazy[l.now().line]?i(c):r(c)}}const Ic={name:"codeIndented",tokenize:rS},aS={partial:!0,tokenize:lS};function rS(t,r,i){const l=this;return o;function o(p){return t.enter("codeIndented"),lt(t,u,"linePrefix",5)(p)}function u(p){const b=l.events[l.events.length-1];return b&&b[1].type==="linePrefix"&&b[2].sliceSerialize(b[1],!0).length>=4?c(p):i(p)}function c(p){return p===null?h(p):qe(p)?t.attempt(aS,c,h)(p):(t.enter("codeFlowValue"),f(p))}function f(p){return p===null||qe(p)?(t.exit("codeFlowValue"),c(p)):(t.consume(p),f)}function h(p){return t.exit("codeIndented"),r(p)}}function lS(t,r,i){const l=this;return o;function o(c){return l.parser.lazy[l.now().line]?i(c):qe(c)?(t.enter("lineEnding"),t.consume(c),t.exit("lineEnding"),o):lt(t,u,"linePrefix",5)(c)}function u(c){const f=l.events[l.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?r(c):qe(c)?o(c):i(c)}}const sS={name:"codeText",previous:uS,resolve:oS,tokenize:cS};function oS(t){let r=t.length-4,i=3,l,o;if((t[i][1].type==="lineEnding"||t[i][1].type==="space")&&(t[r][1].type==="lineEnding"||t[r][1].type==="space")){for(l=i;++l<r;)if(t[l][1].type==="codeTextData"){t[i][1].type="codeTextPadding",t[r][1].type="codeTextPadding",i+=2,r-=2;break}}for(l=i-1,r++;++l<=r;)o===void 0?l!==r&&t[l][1].type!=="lineEnding"&&(o=l):(l===r||t[l][1].type==="lineEnding")&&(t[o][1].type="codeTextData",l!==o+2&&(t[o][1].end=t[l-1][1].end,t.splice(o+2,l-o-2),r-=l-o-2,l=o+2),o=void 0);return t}function uS(t){return t!==96||this.events[this.events.length-1][1].type==="characterEscape"}function cS(t,r,i){let l=0,o,u;return c;function c(x){return t.enter("codeText"),t.enter("codeTextSequence"),f(x)}function f(x){return x===96?(t.consume(x),l++,f):(t.exit("codeTextSequence"),h(x))}function h(x){return x===null?i(x):x===32?(t.enter("space"),t.consume(x),t.exit("space"),h):x===96?(u=t.enter("codeTextSequence"),o=0,b(x)):qe(x)?(t.enter("lineEnding"),t.consume(x),t.exit("lineEnding"),h):(t.enter("codeTextData"),p(x))}function p(x){return x===null||x===32||x===96||qe(x)?(t.exit("codeTextData"),h(x)):(t.consume(x),p)}function b(x){return x===96?(t.consume(x),o++,b):o===l?(t.exit("codeTextSequence"),t.exit("codeText"),r(x)):(u.type="codeTextData",p(x))}}class dS{constructor(r){this.left=r?[...r]:[],this.right=[]}get(r){if(r<0||r>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+r+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return r<this.left.length?this.left[r]:this.right[this.right.length-r+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(r,i){const l=i??Number.POSITIVE_INFINITY;return l<this.left.length?this.left.slice(r,l):r>this.left.length?this.right.slice(this.right.length-l+this.left.length,this.right.length-r+this.left.length).reverse():this.left.slice(r).concat(this.right.slice(this.right.length-l+this.left.length).reverse())}splice(r,i,l){const o=i||0;this.setCursor(Math.trunc(r));const u=this.right.splice(this.right.length-o,Number.POSITIVE_INFINITY);return l&&el(this.left,l),u.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(r){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(r)}pushMany(r){this.setCursor(Number.POSITIVE_INFINITY),el(this.left,r)}unshift(r){this.setCursor(0),this.right.push(r)}unshiftMany(r){this.setCursor(0),el(this.right,r.reverse())}setCursor(r){if(!(r===this.left.length||r>this.left.length&&this.right.length===0||r<0&&this.left.length===0))if(r<this.left.length){const i=this.left.splice(r,Number.POSITIVE_INFINITY);el(this.right,i.reverse())}else{const i=this.right.splice(this.left.length+this.right.length-r,Number.POSITIVE_INFINITY);el(this.left,i.reverse())}}}function el(t,r){let i=0;if(r.length<1e4)t.push(...r);else for(;i<r.length;)t.push(...r.slice(i,i+1e4)),i+=1e4}function Qx(t){const r={};let i=-1,l,o,u,c,f,h,p;const b=new dS(t);for(;++i<b.length;){for(;i in r;)i=r[i];if(l=b.get(i),i&&l[1].type==="chunkFlow"&&b.get(i-1)[1].type==="listItemPrefix"&&(h=l[1]._tokenizer.events,u=0,u<h.length&&h[u][1].type==="lineEndingBlank"&&(u+=2),u<h.length&&h[u][1].type==="content"))for(;++u<h.length&&h[u][1].type!=="content";)h[u][1].type==="chunkText"&&(h[u][1]._isInFirstContentOfListItem=!0,u++);if(l[0]==="enter")l[1].contentType&&(Object.assign(r,fS(b,i)),i=r[i],p=!0);else if(l[1]._container){for(u=i,o=void 0;u--;)if(c=b.get(u),c[1].type==="lineEnding"||c[1].type==="lineEndingBlank")c[0]==="enter"&&(o&&(b.get(o)[1].type="lineEndingBlank"),c[1].type="lineEnding",o=u);else if(!(c[1].type==="linePrefix"||c[1].type==="listItemIndent"))break;o&&(l[1].end={...b.get(o)[1].start},f=b.slice(o,i),f.unshift(l),b.splice(o,i-o+1,f))}}return hn(t,0,Number.POSITIVE_INFINITY,b.slice(0)),!p}function fS(t,r){const i=t.get(r)[1],l=t.get(r)[2];let o=r-1;const u=[];let c=i._tokenizer;c||(c=l.parser[i.contentType](i.start),i._contentTypeTextTrailing&&(c._contentTypeTextTrailing=!0));const f=c.events,h=[],p={};let b,x,w=-1,y=i,j=0,v=0;const k=[v];for(;y;){for(;t.get(++o)[1]!==y;);u.push(o),y._tokenizer||(b=l.sliceStream(y),y.next||b.push(null),x&&c.defineSkip(y.start),y._isInFirstContentOfListItem&&(c._gfmTasklistFirstContentOfListItem=!0),c.write(b),y._isInFirstContentOfListItem&&(c._gfmTasklistFirstContentOfListItem=void 0)),x=y,y=y.next}for(y=i;++w<f.length;)f[w][0]==="exit"&&f[w-1][0]==="enter"&&f[w][1].type===f[w-1][1].type&&f[w][1].start.line!==f[w][1].end.line&&(v=w+1,k.push(v),y._tokenizer=void 0,y.previous=void 0,y=y.next);for(c.events=[],y?(y._tokenizer=void 0,y.previous=void 0):k.pop(),w=k.length;w--;){const S=f.slice(k[w],k[w+1]),_=u.pop();h.push([_,_+S.length-1]),t.splice(_,2,S)}for(h.reverse(),w=-1;++w<h.length;)p[j+h[w][0]]=j+h[w][1],j+=h[w][1]-h[w][0]-1;return p}const hS={resolve:mS,tokenize:gS},pS={partial:!0,tokenize:xS};function mS(t){return Qx(t),t}function gS(t,r){let i;return l;function l(f){return t.enter("content"),i=t.enter("chunkContent",{contentType:"content"}),o(f)}function o(f){return f===null?u(f):qe(f)?t.check(pS,c,u)(f):(t.consume(f),o)}function u(f){return t.exit("chunkContent"),t.exit("content"),r(f)}function c(f){return t.consume(f),t.exit("chunkContent"),i.next=t.enter("chunkContent",{contentType:"content",previous:i}),i=i.next,o}}function xS(t,r,i){const l=this;return o;function o(c){return t.exit("chunkContent"),t.enter("lineEnding"),t.consume(c),t.exit("lineEnding"),lt(t,u,"linePrefix")}function u(c){if(c===null||qe(c))return i(c);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?r(c):t.interrupt(l.parser.constructs.flow,i,r)(c)}}function Jx(t,r,i,l,o,u,c,f,h){const p=h||Number.POSITIVE_INFINITY;let b=0;return x;function x(S){return S===60?(t.enter(l),t.enter(o),t.enter(u),t.consume(S),t.exit(u),w):S===null||S===32||S===41||Zs(S)?i(S):(t.enter(l),t.enter(c),t.enter(f),t.enter("chunkString",{contentType:"string"}),v(S))}function w(S){return S===62?(t.enter(u),t.consume(S),t.exit(u),t.exit(o),t.exit(l),r):(t.enter(f),t.enter("chunkString",{contentType:"string"}),y(S))}function y(S){return S===62?(t.exit("chunkString"),t.exit(f),w(S)):S===null||S===60||qe(S)?i(S):(t.consume(S),S===92?j:y)}function j(S){return S===60||S===62||S===92?(t.consume(S),y):y(S)}function v(S){return!b&&(S===null||S===41||vt(S))?(t.exit("chunkString"),t.exit(f),t.exit(c),t.exit(l),r(S)):b<p&&S===40?(t.consume(S),b++,v):S===41?(t.consume(S),b--,v):S===null||S===32||S===40||Zs(S)?i(S):(t.consume(S),S===92?k:v)}function k(S){return S===40||S===41||S===92?(t.consume(S),v):v(S)}}function Wx(t,r,i,l,o,u){const c=this;let f=0,h;return p;function p(y){return t.enter(l),t.enter(o),t.consume(y),t.exit(o),t.enter(u),b}function b(y){return f>999||y===null||y===91||y===93&&!h||y===94&&!f&&"_hiddenFootnoteSupport"in c.parser.constructs?i(y):y===93?(t.exit(u),t.enter(o),t.consume(y),t.exit(o),t.exit(l),r):qe(y)?(t.enter("lineEnding"),t.consume(y),t.exit("lineEnding"),b):(t.enter("chunkString",{contentType:"string"}),x(y))}function x(y){return y===null||y===91||y===93||qe(y)||f++>999?(t.exit("chunkString"),b(y)):(t.consume(y),h||(h=!tt(y)),y===92?w:x)}function w(y){return y===91||y===92||y===93?(t.consume(y),f++,x):x(y)}}function eb(t,r,i,l,o,u){let c;return f;function f(w){return w===34||w===39||w===40?(t.enter(l),t.enter(o),t.consume(w),t.exit(o),c=w===40?41:w,h):i(w)}function h(w){return w===c?(t.enter(o),t.consume(w),t.exit(o),t.exit(l),r):(t.enter(u),p(w))}function p(w){return w===c?(t.exit(u),h(c)):w===null?i(w):qe(w)?(t.enter("lineEnding"),t.consume(w),t.exit("lineEnding"),lt(t,p,"linePrefix")):(t.enter("chunkString",{contentType:"string"}),b(w))}function b(w){return w===c||w===null||qe(w)?(t.exit("chunkString"),p(w)):(t.consume(w),w===92?x:b)}function x(w){return w===c||w===92?(t.consume(w),b):b(w)}}function al(t,r){let i;return l;function l(o){return qe(o)?(t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),i=!0,l):tt(o)?lt(t,l,i?"linePrefix":"lineSuffix")(o):r(o)}}const bS={name:"definition",tokenize:vS},yS={partial:!0,tokenize:wS};function vS(t,r,i){const l=this;let o;return u;function u(y){return t.enter("definition"),c(y)}function c(y){return Wx.call(l,t,f,i,"definitionLabel","definitionLabelMarker","definitionLabelString")(y)}function f(y){return o=Rn(l.sliceSerialize(l.events[l.events.length-1][1]).slice(1,-1)),y===58?(t.enter("definitionMarker"),t.consume(y),t.exit("definitionMarker"),h):i(y)}function h(y){return vt(y)?al(t,p)(y):p(y)}function p(y){return Jx(t,b,i,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(y)}function b(y){return t.attempt(yS,x,x)(y)}function x(y){return tt(y)?lt(t,w,"whitespace")(y):w(y)}function w(y){return y===null||qe(y)?(t.exit("definition"),l.parser.defined.push(o),r(y)):i(y)}}function wS(t,r,i){return l;function l(f){return vt(f)?al(t,o)(f):i(f)}function o(f){return eb(t,u,i,"definitionTitle","definitionTitleMarker","definitionTitleString")(f)}function u(f){return tt(f)?lt(t,c,"whitespace")(f):c(f)}function c(f){return f===null||qe(f)?r(f):i(f)}}const SS={name:"hardBreakEscape",tokenize:kS};function kS(t,r,i){return l;function l(u){return t.enter("hardBreakEscape"),t.consume(u),o}function o(u){return qe(u)?(t.exit("hardBreakEscape"),r(u)):i(u)}}const jS={name:"headingAtx",resolve:_S,tokenize:CS};function _S(t,r){let i=t.length-2,l=3,o,u;return t[l][1].type==="whitespace"&&(l+=2),i-2>l&&t[i][1].type==="whitespace"&&(i-=2),t[i][1].type==="atxHeadingSequence"&&(l===i-1||i-4>l&&t[i-2][1].type==="whitespace")&&(i-=l+1===i?2:4),i>l&&(o={type:"atxHeadingText",start:t[l][1].start,end:t[i][1].end},u={type:"chunkText",start:t[l][1].start,end:t[i][1].end,contentType:"text"},hn(t,l,i-l+1,[["enter",o,r],["enter",u,r],["exit",u,r],["exit",o,r]])),t}function CS(t,r,i){let l=0;return o;function o(b){return t.enter("atxHeading"),u(b)}function u(b){return t.enter("atxHeadingSequence"),c(b)}function c(b){return b===35&&l++<6?(t.consume(b),c):b===null||vt(b)?(t.exit("atxHeadingSequence"),f(b)):i(b)}function f(b){return b===35?(t.enter("atxHeadingSequence"),h(b)):b===null||qe(b)?(t.exit("atxHeading"),r(b)):tt(b)?lt(t,f,"whitespace")(b):(t.enter("atxHeadingText"),p(b))}function h(b){return b===35?(t.consume(b),h):(t.exit("atxHeadingSequence"),f(b))}function p(b){return b===null||b===35||vt(b)?(t.exit("atxHeadingText"),f(b)):(t.consume(b),p)}}const NS=["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"],_g=["pre","script","style","textarea"],ES={concrete:!0,name:"htmlFlow",resolveTo:TS,tokenize:RS},AS={partial:!0,tokenize:DS},zS={partial:!0,tokenize:OS};function TS(t){let r=t.length;for(;r--&&!(t[r][0]==="enter"&&t[r][1].type==="htmlFlow"););return r>1&&t[r-2][1].type==="linePrefix"&&(t[r][1].start=t[r-2][1].start,t[r+1][1].start=t[r-2][1].start,t.splice(r-2,2)),t}function RS(t,r,i){const l=this;let o,u,c,f,h;return p;function p(M){return b(M)}function b(M){return t.enter("htmlFlow"),t.enter("htmlFlowData"),t.consume(M),x}function x(M){return M===33?(t.consume(M),w):M===47?(t.consume(M),u=!0,v):M===63?(t.consume(M),o=3,l.interrupt?r:L):$t(M)?(t.consume(M),c=String.fromCharCode(M),k):i(M)}function w(M){return M===45?(t.consume(M),o=2,y):M===91?(t.consume(M),o=5,f=0,j):$t(M)?(t.consume(M),o=4,l.interrupt?r:L):i(M)}function y(M){return M===45?(t.consume(M),l.interrupt?r:L):i(M)}function j(M){const ie="CDATA[";return M===ie.charCodeAt(f++)?(t.consume(M),f===ie.length?l.interrupt?r:I:j):i(M)}function v(M){return $t(M)?(t.consume(M),c=String.fromCharCode(M),k):i(M)}function k(M){if(M===null||M===47||M===62||vt(M)){const ie=M===47,V=c.toLowerCase();return!ie&&!u&&_g.includes(V)?(o=1,l.interrupt?r(M):I(M)):NS.includes(c.toLowerCase())?(o=6,ie?(t.consume(M),S):l.interrupt?r(M):I(M)):(o=7,l.interrupt&&!l.parser.lazy[l.now().line]?i(M):u?_(M):N(M))}return M===45||Vt(M)?(t.consume(M),c+=String.fromCharCode(M),k):i(M)}function S(M){return M===62?(t.consume(M),l.interrupt?r:I):i(M)}function _(M){return tt(M)?(t.consume(M),_):q(M)}function N(M){return M===47?(t.consume(M),q):M===58||M===95||$t(M)?(t.consume(M),B):tt(M)?(t.consume(M),N):q(M)}function B(M){return M===45||M===46||M===58||M===95||Vt(M)?(t.consume(M),B):D(M)}function D(M){return M===61?(t.consume(M),z):tt(M)?(t.consume(M),D):N(M)}function z(M){return M===null||M===60||M===61||M===62||M===96?i(M):M===34||M===39?(t.consume(M),h=M,R):tt(M)?(t.consume(M),z):G(M)}function R(M){return M===h?(t.consume(M),h=null,P):M===null||qe(M)?i(M):(t.consume(M),R)}function G(M){return M===null||M===34||M===39||M===47||M===60||M===61||M===62||M===96||vt(M)?D(M):(t.consume(M),G)}function P(M){return M===47||M===62||tt(M)?N(M):i(M)}function q(M){return M===62?(t.consume(M),W):i(M)}function W(M){return M===null||qe(M)?I(M):tt(M)?(t.consume(M),W):i(M)}function I(M){return M===45&&o===2?(t.consume(M),$):M===60&&o===1?(t.consume(M),J):M===62&&o===4?(t.consume(M),O):M===63&&o===3?(t.consume(M),L):M===93&&o===5?(t.consume(M),ee):qe(M)&&(o===6||o===7)?(t.exit("htmlFlowData"),t.check(AS,H,X)(M)):M===null||qe(M)?(t.exit("htmlFlowData"),X(M)):(t.consume(M),I)}function X(M){return t.check(zS,E,H)(M)}function E(M){return t.enter("lineEnding"),t.consume(M),t.exit("lineEnding"),Q}function Q(M){return M===null||qe(M)?X(M):(t.enter("htmlFlowData"),I(M))}function $(M){return M===45?(t.consume(M),L):I(M)}function J(M){return M===47?(t.consume(M),c="",ve):I(M)}function ve(M){if(M===62){const ie=c.toLowerCase();return _g.includes(ie)?(t.consume(M),O):I(M)}return $t(M)&&c.length<8?(t.consume(M),c+=String.fromCharCode(M),ve):I(M)}function ee(M){return M===93?(t.consume(M),L):I(M)}function L(M){return M===62?(t.consume(M),O):M===45&&o===2?(t.consume(M),L):I(M)}function O(M){return M===null||qe(M)?(t.exit("htmlFlowData"),H(M)):(t.consume(M),O)}function H(M){return t.exit("htmlFlow"),r(M)}}function OS(t,r,i){const l=this;return o;function o(c){return qe(c)?(t.enter("lineEnding"),t.consume(c),t.exit("lineEnding"),u):i(c)}function u(c){return l.parser.lazy[l.now().line]?i(c):r(c)}}function DS(t,r,i){return l;function l(o){return t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),t.attempt(gl,r,i)}}const MS={name:"htmlText",tokenize:LS};function LS(t,r,i){const l=this;let o,u,c;return f;function f(L){return t.enter("htmlText"),t.enter("htmlTextData"),t.consume(L),h}function h(L){return L===33?(t.consume(L),p):L===47?(t.consume(L),D):L===63?(t.consume(L),N):$t(L)?(t.consume(L),G):i(L)}function p(L){return L===45?(t.consume(L),b):L===91?(t.consume(L),u=0,j):$t(L)?(t.consume(L),_):i(L)}function b(L){return L===45?(t.consume(L),y):i(L)}function x(L){return L===null?i(L):L===45?(t.consume(L),w):qe(L)?(c=x,J(L)):(t.consume(L),x)}function w(L){return L===45?(t.consume(L),y):x(L)}function y(L){return L===62?$(L):L===45?w(L):x(L)}function j(L){const O="CDATA[";return L===O.charCodeAt(u++)?(t.consume(L),u===O.length?v:j):i(L)}function v(L){return L===null?i(L):L===93?(t.consume(L),k):qe(L)?(c=v,J(L)):(t.consume(L),v)}function k(L){return L===93?(t.consume(L),S):v(L)}function S(L){return L===62?$(L):L===93?(t.consume(L),S):v(L)}function _(L){return L===null||L===62?$(L):qe(L)?(c=_,J(L)):(t.consume(L),_)}function N(L){return L===null?i(L):L===63?(t.consume(L),B):qe(L)?(c=N,J(L)):(t.consume(L),N)}function B(L){return L===62?$(L):N(L)}function D(L){return $t(L)?(t.consume(L),z):i(L)}function z(L){return L===45||Vt(L)?(t.consume(L),z):R(L)}function R(L){return qe(L)?(c=R,J(L)):tt(L)?(t.consume(L),R):$(L)}function G(L){return L===45||Vt(L)?(t.consume(L),G):L===47||L===62||vt(L)?P(L):i(L)}function P(L){return L===47?(t.consume(L),$):L===58||L===95||$t(L)?(t.consume(L),q):qe(L)?(c=P,J(L)):tt(L)?(t.consume(L),P):$(L)}function q(L){return L===45||L===46||L===58||L===95||Vt(L)?(t.consume(L),q):W(L)}function W(L){return L===61?(t.consume(L),I):qe(L)?(c=W,J(L)):tt(L)?(t.consume(L),W):P(L)}function I(L){return L===null||L===60||L===61||L===62||L===96?i(L):L===34||L===39?(t.consume(L),o=L,X):qe(L)?(c=I,J(L)):tt(L)?(t.consume(L),I):(t.consume(L),E)}function X(L){return L===o?(t.consume(L),o=void 0,Q):L===null?i(L):qe(L)?(c=X,J(L)):(t.consume(L),X)}function E(L){return L===null||L===34||L===39||L===60||L===61||L===96?i(L):L===47||L===62||vt(L)?P(L):(t.consume(L),E)}function Q(L){return L===47||L===62||vt(L)?P(L):i(L)}function $(L){return L===62?(t.consume(L),t.exit("htmlTextData"),t.exit("htmlText"),r):i(L)}function J(L){return t.exit("htmlTextData"),t.enter("lineEnding"),t.consume(L),t.exit("lineEnding"),ve}function ve(L){return tt(L)?lt(t,ee,"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(L):ee(L)}function ee(L){return t.enter("htmlTextData"),c(L)}}const Rd={name:"labelEnd",resolveAll:HS,resolveTo:PS,tokenize:FS},BS={tokenize:qS},US={tokenize:VS},IS={tokenize:YS};function HS(t){let r=-1;const i=[];for(;++r<t.length;){const l=t[r][1];if(i.push(t[r]),l.type==="labelImage"||l.type==="labelLink"||l.type==="labelEnd"){const o=l.type==="labelImage"?4:2;l.type="data",r+=o}}return t.length!==i.length&&hn(t,0,t.length,i),t}function PS(t,r){let i=t.length,l=0,o,u,c,f;for(;i--;)if(o=t[i][1],u){if(o.type==="link"||o.type==="labelLink"&&o._inactive)break;t[i][0]==="enter"&&o.type==="labelLink"&&(o._inactive=!0)}else if(c){if(t[i][0]==="enter"&&(o.type==="labelImage"||o.type==="labelLink")&&!o._balanced&&(u=i,o.type!=="labelLink")){l=2;break}}else o.type==="labelEnd"&&(c=i);const h={type:t[u][1].type==="labelLink"?"link":"image",start:{...t[u][1].start},end:{...t[t.length-1][1].end}},p={type:"label",start:{...t[u][1].start},end:{...t[c][1].end}},b={type:"labelText",start:{...t[u+l+2][1].end},end:{...t[c-2][1].start}};return f=[["enter",h,r],["enter",p,r]],f=Cn(f,t.slice(u+1,u+l+3)),f=Cn(f,[["enter",b,r]]),f=Cn(f,ro(r.parser.constructs.insideSpan.null,t.slice(u+l+4,c-3),r)),f=Cn(f,[["exit",b,r],t[c-2],t[c-1],["exit",p,r]]),f=Cn(f,t.slice(c+1)),f=Cn(f,[["exit",h,r]]),hn(t,u,t.length,f),t}function FS(t,r,i){const l=this;let o=l.events.length,u,c;for(;o--;)if((l.events[o][1].type==="labelImage"||l.events[o][1].type==="labelLink")&&!l.events[o][1]._balanced){u=l.events[o][1];break}return f;function f(w){return u?u._inactive?x(w):(c=l.parser.defined.includes(Rn(l.sliceSerialize({start:u.end,end:l.now()}))),t.enter("labelEnd"),t.enter("labelMarker"),t.consume(w),t.exit("labelMarker"),t.exit("labelEnd"),h):i(w)}function h(w){return w===40?t.attempt(BS,b,c?b:x)(w):w===91?t.attempt(US,b,c?p:x)(w):c?b(w):x(w)}function p(w){return t.attempt(IS,b,x)(w)}function b(w){return r(w)}function x(w){return u._balanced=!0,i(w)}}function qS(t,r,i){return l;function l(x){return t.enter("resource"),t.enter("resourceMarker"),t.consume(x),t.exit("resourceMarker"),o}function o(x){return vt(x)?al(t,u)(x):u(x)}function u(x){return x===41?b(x):Jx(t,c,f,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(x)}function c(x){return vt(x)?al(t,h)(x):b(x)}function f(x){return i(x)}function h(x){return x===34||x===39||x===40?eb(t,p,i,"resourceTitle","resourceTitleMarker","resourceTitleString")(x):b(x)}function p(x){return vt(x)?al(t,b)(x):b(x)}function b(x){return x===41?(t.enter("resourceMarker"),t.consume(x),t.exit("resourceMarker"),t.exit("resource"),r):i(x)}}function VS(t,r,i){const l=this;return o;function o(f){return Wx.call(l,t,u,c,"reference","referenceMarker","referenceString")(f)}function u(f){return l.parser.defined.includes(Rn(l.sliceSerialize(l.events[l.events.length-1][1]).slice(1,-1)))?r(f):i(f)}function c(f){return i(f)}}function YS(t,r,i){return l;function l(u){return t.enter("reference"),t.enter("referenceMarker"),t.consume(u),t.exit("referenceMarker"),o}function o(u){return u===93?(t.enter("referenceMarker"),t.consume(u),t.exit("referenceMarker"),t.exit("reference"),r):i(u)}}const GS={name:"labelStartImage",resolveAll:Rd.resolveAll,tokenize:KS};function KS(t,r,i){const l=this;return o;function o(f){return t.enter("labelImage"),t.enter("labelImageMarker"),t.consume(f),t.exit("labelImageMarker"),u}function u(f){return f===91?(t.enter("labelMarker"),t.consume(f),t.exit("labelMarker"),t.exit("labelImage"),c):i(f)}function c(f){return f===94&&"_hiddenFootnoteSupport"in l.parser.constructs?i(f):r(f)}}const $S={name:"labelStartLink",resolveAll:Rd.resolveAll,tokenize:XS};function XS(t,r,i){const l=this;return o;function o(c){return t.enter("labelLink"),t.enter("labelMarker"),t.consume(c),t.exit("labelMarker"),t.exit("labelLink"),u}function u(c){return c===94&&"_hiddenFootnoteSupport"in l.parser.constructs?i(c):r(c)}}const Hc={name:"lineEnding",tokenize:ZS};function ZS(t,r){return i;function i(l){return t.enter("lineEnding"),t.consume(l),t.exit("lineEnding"),lt(t,r,"linePrefix")}}const $s={name:"thematicBreak",tokenize:QS};function QS(t,r,i){let l=0,o;return u;function u(p){return t.enter("thematicBreak"),c(p)}function c(p){return o=p,f(p)}function f(p){return p===o?(t.enter("thematicBreakSequence"),h(p)):l>=3&&(p===null||qe(p))?(t.exit("thematicBreak"),r(p)):i(p)}function h(p){return p===o?(t.consume(p),l++,h):(t.exit("thematicBreakSequence"),tt(p)?lt(t,f,"whitespace")(p):f(p))}}const nn={continuation:{tokenize:tk},exit:ik,name:"list",tokenize:ek},JS={partial:!0,tokenize:ak},WS={partial:!0,tokenize:nk};function ek(t,r,i){const l=this,o=l.events[l.events.length-1];let u=o&&o[1].type==="linePrefix"?o[2].sliceSerialize(o[1],!0).length:0,c=0;return f;function f(y){const j=l.containerState.type||(y===42||y===43||y===45?"listUnordered":"listOrdered");if(j==="listUnordered"?!l.containerState.marker||y===l.containerState.marker:ud(y)){if(l.containerState.type||(l.containerState.type=j,t.enter(j,{_container:!0})),j==="listUnordered")return t.enter("listItemPrefix"),y===42||y===45?t.check($s,i,p)(y):p(y);if(!l.interrupt||y===49)return t.enter("listItemPrefix"),t.enter("listItemValue"),h(y)}return i(y)}function h(y){return ud(y)&&++c<10?(t.consume(y),h):(!l.interrupt||c<2)&&(l.containerState.marker?y===l.containerState.marker:y===41||y===46)?(t.exit("listItemValue"),p(y)):i(y)}function p(y){return t.enter("listItemMarker"),t.consume(y),t.exit("listItemMarker"),l.containerState.marker=l.containerState.marker||y,t.check(gl,l.interrupt?i:b,t.attempt(JS,w,x))}function b(y){return l.containerState.initialBlankLine=!0,u++,w(y)}function x(y){return tt(y)?(t.enter("listItemPrefixWhitespace"),t.consume(y),t.exit("listItemPrefixWhitespace"),w):i(y)}function w(y){return l.containerState.size=u+l.sliceSerialize(t.exit("listItemPrefix"),!0).length,r(y)}}function tk(t,r,i){const l=this;return l.containerState._closeFlow=void 0,t.check(gl,o,u);function o(f){return l.containerState.furtherBlankLines=l.containerState.furtherBlankLines||l.containerState.initialBlankLine,lt(t,r,"listItemIndent",l.containerState.size+1)(f)}function u(f){return l.containerState.furtherBlankLines||!tt(f)?(l.containerState.furtherBlankLines=void 0,l.containerState.initialBlankLine=void 0,c(f)):(l.containerState.furtherBlankLines=void 0,l.containerState.initialBlankLine=void 0,t.attempt(WS,r,c)(f))}function c(f){return l.containerState._closeFlow=!0,l.interrupt=void 0,lt(t,t.attempt(nn,r,i),"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(f)}}function nk(t,r,i){const l=this;return lt(t,o,"listItemIndent",l.containerState.size+1);function o(u){const c=l.events[l.events.length-1];return c&&c[1].type==="listItemIndent"&&c[2].sliceSerialize(c[1],!0).length===l.containerState.size?r(u):i(u)}}function ik(t){t.exit(this.containerState.type)}function ak(t,r,i){const l=this;return lt(t,o,"listItemPrefixWhitespace",l.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function o(u){const c=l.events[l.events.length-1];return!tt(u)&&c&&c[1].type==="listItemPrefixWhitespace"?r(u):i(u)}}const Cg={name:"setextUnderline",resolveTo:rk,tokenize:lk};function rk(t,r){let i=t.length,l,o,u;for(;i--;)if(t[i][0]==="enter"){if(t[i][1].type==="content"){l=i;break}t[i][1].type==="paragraph"&&(o=i)}else t[i][1].type==="content"&&t.splice(i,1),!u&&t[i][1].type==="definition"&&(u=i);const c={type:"setextHeading",start:{...t[l][1].start},end:{...t[t.length-1][1].end}};return t[o][1].type="setextHeadingText",u?(t.splice(o,0,["enter",c,r]),t.splice(u+1,0,["exit",t[l][1],r]),t[l][1].end={...t[u][1].end}):t[l][1]=c,t.push(["exit",c,r]),t}function lk(t,r,i){const l=this;let o;return u;function u(p){let b=l.events.length,x;for(;b--;)if(l.events[b][1].type!=="lineEnding"&&l.events[b][1].type!=="linePrefix"&&l.events[b][1].type!=="content"){x=l.events[b][1].type==="paragraph";break}return!l.parser.lazy[l.now().line]&&(l.interrupt||x)?(t.enter("setextHeadingLine"),o=p,c(p)):i(p)}function c(p){return t.enter("setextHeadingLineSequence"),f(p)}function f(p){return p===o?(t.consume(p),f):(t.exit("setextHeadingLineSequence"),tt(p)?lt(t,h,"lineSuffix")(p):h(p))}function h(p){return p===null||qe(p)?(t.exit("setextHeadingLine"),r(p)):i(p)}}const sk={tokenize:ok};function ok(t){const r=this,i=t.attempt(gl,l,t.attempt(this.parser.constructs.flowInitial,o,lt(t,t.attempt(this.parser.constructs.flow,o,t.attempt(hS,o)),"linePrefix")));return i;function l(u){if(u===null){t.consume(u);return}return t.enter("lineEndingBlank"),t.consume(u),t.exit("lineEndingBlank"),r.currentConstruct=void 0,i}function o(u){if(u===null){t.consume(u);return}return t.enter("lineEnding"),t.consume(u),t.exit("lineEnding"),r.currentConstruct=void 0,i}}const uk={resolveAll:nb()},ck=tb("string"),dk=tb("text");function tb(t){return{resolveAll:nb(t==="text"?fk:void 0),tokenize:r};function r(i){const l=this,o=this.parser.constructs[t],u=i.attempt(o,c,f);return c;function c(b){return p(b)?u(b):f(b)}function f(b){if(b===null){i.consume(b);return}return i.enter("data"),i.consume(b),h}function h(b){return p(b)?(i.exit("data"),u(b)):(i.consume(b),h)}function p(b){if(b===null)return!0;const x=o[b];let w=-1;if(x)for(;++w<x.length;){const y=x[w];if(!y.previous||y.previous.call(l,l.previous))return!0}return!1}}}function nb(t){return r;function r(i,l){let o=-1,u;for(;++o<=i.length;)u===void 0?i[o]&&i[o][1].type==="data"&&(u=o,o++):(!i[o]||i[o][1].type!=="data")&&(o!==u+2&&(i[u][1].end=i[o-1][1].end,i.splice(u+2,o-u-2),o=u+2),u=void 0);return t?t(i,l):i}}function fk(t,r){let i=0;for(;++i<=t.length;)if((i===t.length||t[i][1].type==="lineEnding")&&t[i-1][1].type==="data"){const l=t[i-1][1],o=r.sliceStream(l);let u=o.length,c=-1,f=0,h;for(;u--;){const p=o[u];if(typeof p=="string"){for(c=p.length;p.charCodeAt(c-1)===32;)f++,c--;if(c)break;c=-1}else if(p===-2)h=!0,f++;else if(p!==-1){u++;break}}if(r._contentTypeTextTrailing&&i===t.length&&(f=0),f){const p={type:i===t.length||h||f<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:u?c:l.start._bufferIndex+c,_index:l.start._index+u,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):(t.splice(i,0,["enter",p,r],["exit",p,r]),i+=2)}i++}return t}const hk={42:nn,43:nn,45:nn,48:nn,49:nn,50:nn,51:nn,52:nn,53:nn,54:nn,55:nn,56:nn,57:nn,62:$x},pk={91:bS},mk={[-2]:Ic,[-1]:Ic,32:Ic},gk={35:jS,42:$s,45:[Cg,$s],60:ES,61:Cg,95:$s,96:jg,126:jg},xk={38:Zx,92:Xx},bk={[-5]:Hc,[-4]:Hc,[-3]:Hc,33:GS,38:Zx,42:cd,60:[$2,MS],91:$S,92:[SS,Xx],93:Rd,95:cd,96:sS},yk={null:[cd,uk]},vk={null:[42,95]},wk={null:[]},Sk=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:vk,contentInitial:pk,disable:wk,document:hk,flow:gk,flowInitial:mk,insideSpan:yk,string:xk,text:bk},Symbol.toStringTag,{value:"Module"}));function kk(t,r,i){let l={_bufferIndex:-1,_index:0,line:i&&i.line||1,column:i&&i.column||1,offset:i&&i.offset||0};const o={},u=[];let c=[],f=[];const h={attempt:R(D),check:R(z),consume:_,enter:N,exit:B,interrupt:R(z,{interrupt:!0})},p={code:null,containerState:{},defineSkip:v,events:[],now:j,parser:t,previous:null,sliceSerialize:w,sliceStream:y,write:x};let b=r.tokenize.call(p,h);return r.resolveAll&&u.push(r),p;function x(W){return c=Cn(c,W),k(),c[c.length-1]!==null?[]:(G(r,0),p.events=ro(u,p.events,p),p.events)}function w(W,I){return _k(y(W),I)}function y(W){return jk(c,W)}function j(){const{_bufferIndex:W,_index:I,line:X,column:E,offset:Q}=l;return{_bufferIndex:W,_index:I,line:X,column:E,offset:Q}}function v(W){o[W.line]=W.column,q()}function k(){let W;for(;l._index<c.length;){const I=c[l._index];if(typeof I=="string")for(W=l._index,l._bufferIndex<0&&(l._bufferIndex=0);l._index===W&&l._bufferIndex<I.length;)S(I.charCodeAt(l._bufferIndex));else S(I)}}function S(W){b=b(W)}function _(W){qe(W)?(l.line++,l.column=1,l.offset+=W===-3?2:1,q()):W!==-1&&(l.column++,l.offset++),l._bufferIndex<0?l._index++:(l._bufferIndex++,l._bufferIndex===c[l._index].length&&(l._bufferIndex=-1,l._index++)),p.previous=W}function N(W,I){const X=I||{};return X.type=W,X.start=j(),p.events.push(["enter",X,p]),f.push(X),X}function B(W){const I=f.pop();return I.end=j(),p.events.push(["exit",I,p]),I}function D(W,I){G(W,I.from)}function z(W,I){I.restore()}function R(W,I){return X;function X(E,Q,$){let J,ve,ee,L;return Array.isArray(E)?H(E):"tokenize"in E?H([E]):O(E);function O(se){return ze;function ze(Re){const De=Re!==null&&se[Re],Pe=Re!==null&&se.null,Ge=[...Array.isArray(De)?De:De?[De]:[],...Array.isArray(Pe)?Pe:Pe?[Pe]:[]];return H(Ge)(Re)}}function H(se){return J=se,ve=0,se.length===0?$:M(se[ve])}function M(se){return ze;function ze(Re){return L=P(),ee=se,se.partial||(p.currentConstruct=se),se.name&&p.parser.constructs.disable.null.includes(se.name)?V():se.tokenize.call(I?Object.assign(Object.create(p),I):p,h,ie,V)(Re)}}function ie(se){return W(ee,L),Q}function V(se){return L.restore(),++ve<J.length?M(J[ve]):$}}}function G(W,I){W.resolveAll&&!u.includes(W)&&u.push(W),W.resolve&&hn(p.events,I,p.events.length-I,W.resolve(p.events.slice(I),p)),W.resolveTo&&(p.events=W.resolveTo(p.events,p))}function P(){const W=j(),I=p.previous,X=p.currentConstruct,E=p.events.length,Q=Array.from(f);return{from:E,restore:$};function $(){l=W,p.previous=I,p.currentConstruct=X,p.events.length=E,f=Q,q()}}function q(){l.line in o&&l.column<2&&(l.column=o[l.line],l.offset+=o[l.line]-1)}}function jk(t,r){const i=r.start._index,l=r.start._bufferIndex,o=r.end._index,u=r.end._bufferIndex;let c;if(i===o)c=[t[i].slice(l,u)];else{if(c=t.slice(i,o),l>-1){const f=c[0];typeof f=="string"?c[0]=f.slice(l):c.shift()}u>0&&c.push(t[o].slice(0,u))}return c}function _k(t,r){let i=-1;const l=[];let o;for(;++i<t.length;){const u=t[i];let c;if(typeof u=="string")c=u;else switch(u){case-5:{c="\r";break}case-4:{c=`
16
- `;break}case-3:{c=`\r
17
- `;break}case-2:{c=r?" ":" ";break}case-1:{if(!r&&o)continue;c=" ";break}default:c=String.fromCharCode(u)}o=u===-2,l.push(c)}return l.join("")}function Ck(t){const l={constructs:Gx([Sk,...(t||{}).extensions||[]]),content:o(P2),defined:[],document:o(q2),flow:o(sk),lazy:{},string:o(ck),text:o(dk)};return l;function o(u){return c;function c(f){return kk(l,u,f)}}}function Nk(t){for(;!Qx(t););return t}const Ng=/[\0\t\n\r]/g;function Ek(){let t=1,r="",i=!0,l;return o;function o(u,c,f){const h=[];let p,b,x,w,y;for(u=r+(typeof u=="string"?u.toString():new TextDecoder(c||void 0).decode(u)),x=0,r="",i&&(u.charCodeAt(0)===65279&&x++,i=void 0);x<u.length;){if(Ng.lastIndex=x,p=Ng.exec(u),w=p&&p.index!==void 0?p.index:u.length,y=u.charCodeAt(w),!p){r=u.slice(x);break}if(y===10&&x===w&&l)h.push(-3),l=void 0;else switch(l&&(h.push(-5),l=void 0),x<w&&(h.push(u.slice(x,w)),t+=w-x),y){case 0:{h.push(65533),t++;break}case 9:{for(b=Math.ceil(t/4)*4,h.push(-2);t++<b;)h.push(-1);break}case 10:{h.push(-4),t=1;break}default:l=!0,t=1}x=w+1}return f&&(l&&h.push(-5),r&&h.push(r),h.push(null)),h}}const Ak=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function zk(t){return t.replace(Ak,Tk)}function Tk(t,r,i){if(r)return r;if(i.charCodeAt(0)===35){const o=i.charCodeAt(1),u=o===120||o===88;return Kx(i.slice(u?2:1),u?16:10)}return Td(i)||t}const ib={}.hasOwnProperty;function Rk(t,r,i){return r&&typeof r=="object"&&(i=r,r=void 0),Ok(i)(Nk(Ck(i).document().write(Ek()(t,r,!0))))}function Ok(t){const r={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:u(ne),autolinkProtocol:P,autolinkEmail:P,atxHeading:u(pe),blockQuote:u(Pe),characterEscape:P,characterReference:P,codeFenced:u(Ge),codeFencedFenceInfo:c,codeFencedFenceMeta:c,codeIndented:u(Ge,c),codeText:u(nt,c),codeTextData:P,data:P,codeFlowValue:P,definition:u(ht),definitionDestinationString:c,definitionLabelString:c,definitionTitleString:c,emphasis:u(A),hardBreakEscape:u(re),hardBreakTrailing:u(re),htmlFlow:u(Y,c),htmlFlowData:P,htmlText:u(Y,c),htmlTextData:P,image:u(F),label:c,link:u(ne),listItem:u(de),listItemValue:w,listOrdered:u(me,x),listUnordered:u(me),paragraph:u(K),reference:M,referenceString:c,resourceDestinationString:c,resourceTitleString:c,setextHeading:u(pe),strong:u(xe),thematicBreak:u(ke)},exit:{atxHeading:h(),atxHeadingSequence:D,autolink:h(),autolinkEmail:De,autolinkProtocol:Re,blockQuote:h(),characterEscapeValue:q,characterReferenceMarkerHexadecimal:V,characterReferenceMarkerNumeric:V,characterReferenceValue:se,characterReference:ze,codeFenced:h(k),codeFencedFence:v,codeFencedFenceInfo:y,codeFencedFenceMeta:j,codeFlowValue:q,codeIndented:h(S),codeText:h(Q),codeTextData:q,data:q,definition:h(),definitionDestinationString:B,definitionLabelString:_,definitionTitleString:N,emphasis:h(),hardBreakEscape:h(I),hardBreakTrailing:h(I),htmlFlow:h(X),htmlFlowData:q,htmlText:h(E),htmlTextData:q,image:h(J),label:ee,labelText:ve,lineEnding:W,link:h($),listItem:h(),listOrdered:h(),listUnordered:h(),paragraph:h(),referenceString:ie,resourceDestinationString:L,resourceTitleString:O,resource:H,setextHeading:h(G),setextHeadingLineSequence:R,setextHeadingText:z,strong:h(),thematicBreak:h()}};ab(r,(t||{}).mdastExtensions||[]);const i={};return l;function l(ae){let ye={type:"root",children:[]};const Ae={stack:[ye],tokenStack:[],config:r,enter:f,exit:p,buffer:c,resume:b,data:i},Ie=[];let fe=-1;for(;++fe<ae.length;)if(ae[fe][1].type==="listOrdered"||ae[fe][1].type==="listUnordered")if(ae[fe][0]==="enter")Ie.push(fe);else{const we=Ie.pop();fe=o(ae,we,fe)}for(fe=-1;++fe<ae.length;){const we=r[ae[fe][0]];ib.call(we,ae[fe][1].type)&&we[ae[fe][1].type].call(Object.assign({sliceSerialize:ae[fe][2].sliceSerialize},Ae),ae[fe][1])}if(Ae.tokenStack.length>0){const we=Ae.tokenStack[Ae.tokenStack.length-1];(we[1]||Eg).call(Ae,void 0,we[0])}for(ye.position={start:Ui(ae.length>0?ae[0][1].start:{line:1,column:1,offset:0}),end:Ui(ae.length>0?ae[ae.length-2][1].end:{line:1,column:1,offset:0})},fe=-1;++fe<r.transforms.length;)ye=r.transforms[fe](ye)||ye;return ye}function o(ae,ye,Ae){let Ie=ye-1,fe=-1,we=!1,Me,Be,Ve,Ke;for(;++Ie<=Ae;){const Le=ae[Ie];switch(Le[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Le[0]==="enter"?fe++:fe--,Ke=void 0;break}case"lineEndingBlank":{Le[0]==="enter"&&(Me&&!Ke&&!fe&&!Ve&&(Ve=Ie),Ke=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Ke=void 0}if(!fe&&Le[0]==="enter"&&Le[1].type==="listItemPrefix"||fe===-1&&Le[0]==="exit"&&(Le[1].type==="listUnordered"||Le[1].type==="listOrdered")){if(Me){let Je=Ie;for(Be=void 0;Je--;){const ct=ae[Je];if(ct[1].type==="lineEnding"||ct[1].type==="lineEndingBlank"){if(ct[0]==="exit")continue;Be&&(ae[Be][1].type="lineEndingBlank",we=!0),ct[1].type="lineEnding",Be=Je}else if(!(ct[1].type==="linePrefix"||ct[1].type==="blockQuotePrefix"||ct[1].type==="blockQuotePrefixWhitespace"||ct[1].type==="blockQuoteMarker"||ct[1].type==="listItemIndent"))break}Ve&&(!Be||Ve<Be)&&(Me._spread=!0),Me.end=Object.assign({},Be?ae[Be][1].start:Le[1].end),ae.splice(Be||Ie,0,["exit",Me,Le[2]]),Ie++,Ae++}if(Le[1].type==="listItemPrefix"){const Je={type:"listItem",_spread:!1,start:Object.assign({},Le[1].start),end:void 0};Me=Je,ae.splice(Ie,0,["enter",Je,Le[2]]),Ie++,Ae++,Ve=void 0,Ke=!0}}}return ae[ye][1]._spread=we,Ae}function u(ae,ye){return Ae;function Ae(Ie){f.call(this,ae(Ie),Ie),ye&&ye.call(this,Ie)}}function c(){this.stack.push({type:"fragment",children:[]})}function f(ae,ye,Ae){this.stack[this.stack.length-1].children.push(ae),this.stack.push(ae),this.tokenStack.push([ye,Ae||void 0]),ae.position={start:Ui(ye.start),end:void 0}}function h(ae){return ye;function ye(Ae){ae&&ae.call(this,Ae),p.call(this,Ae)}}function p(ae,ye){const Ae=this.stack.pop(),Ie=this.tokenStack.pop();if(Ie)Ie[0].type!==ae.type&&(ye?ye.call(this,ae,Ie[0]):(Ie[1]||Eg).call(this,ae,Ie[0]));else throw new Error("Cannot close `"+ae.type+"` ("+il({start:ae.start,end:ae.end})+"): it’s not open");Ae.position.end=Ui(ae.end)}function b(){return zd(this.stack.pop())}function x(){this.data.expectingFirstListItemValue=!0}function w(ae){if(this.data.expectingFirstListItemValue){const ye=this.stack[this.stack.length-2];ye.start=Number.parseInt(this.sliceSerialize(ae),10),this.data.expectingFirstListItemValue=void 0}}function y(){const ae=this.resume(),ye=this.stack[this.stack.length-1];ye.lang=ae}function j(){const ae=this.resume(),ye=this.stack[this.stack.length-1];ye.meta=ae}function v(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function k(){const ae=this.resume(),ye=this.stack[this.stack.length-1];ye.value=ae.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function S(){const ae=this.resume(),ye=this.stack[this.stack.length-1];ye.value=ae.replace(/(\r?\n|\r)$/g,"")}function _(ae){const ye=this.resume(),Ae=this.stack[this.stack.length-1];Ae.label=ye,Ae.identifier=Rn(this.sliceSerialize(ae)).toLowerCase()}function N(){const ae=this.resume(),ye=this.stack[this.stack.length-1];ye.title=ae}function B(){const ae=this.resume(),ye=this.stack[this.stack.length-1];ye.url=ae}function D(ae){const ye=this.stack[this.stack.length-1];if(!ye.depth){const Ae=this.sliceSerialize(ae).length;ye.depth=Ae}}function z(){this.data.setextHeadingSlurpLineEnding=!0}function R(ae){const ye=this.stack[this.stack.length-1];ye.depth=this.sliceSerialize(ae).codePointAt(0)===61?1:2}function G(){this.data.setextHeadingSlurpLineEnding=void 0}function P(ae){const Ae=this.stack[this.stack.length-1].children;let Ie=Ae[Ae.length-1];(!Ie||Ie.type!=="text")&&(Ie=Ee(),Ie.position={start:Ui(ae.start),end:void 0},Ae.push(Ie)),this.stack.push(Ie)}function q(ae){const ye=this.stack.pop();ye.value+=this.sliceSerialize(ae),ye.position.end=Ui(ae.end)}function W(ae){const ye=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Ae=ye.children[ye.children.length-1];Ae.position.end=Ui(ae.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&r.canContainEols.includes(ye.type)&&(P.call(this,ae),q.call(this,ae))}function I(){this.data.atHardBreak=!0}function X(){const ae=this.resume(),ye=this.stack[this.stack.length-1];ye.value=ae}function E(){const ae=this.resume(),ye=this.stack[this.stack.length-1];ye.value=ae}function Q(){const ae=this.resume(),ye=this.stack[this.stack.length-1];ye.value=ae}function $(){const ae=this.stack[this.stack.length-1];if(this.data.inReference){const ye=this.data.referenceType||"shortcut";ae.type+="Reference",ae.referenceType=ye,delete ae.url,delete ae.title}else delete ae.identifier,delete ae.label;this.data.referenceType=void 0}function J(){const ae=this.stack[this.stack.length-1];if(this.data.inReference){const ye=this.data.referenceType||"shortcut";ae.type+="Reference",ae.referenceType=ye,delete ae.url,delete ae.title}else delete ae.identifier,delete ae.label;this.data.referenceType=void 0}function ve(ae){const ye=this.sliceSerialize(ae),Ae=this.stack[this.stack.length-2];Ae.label=zk(ye),Ae.identifier=Rn(ye).toLowerCase()}function ee(){const ae=this.stack[this.stack.length-1],ye=this.resume(),Ae=this.stack[this.stack.length-1];if(this.data.inReference=!0,Ae.type==="link"){const Ie=ae.children;Ae.children=Ie}else Ae.alt=ye}function L(){const ae=this.resume(),ye=this.stack[this.stack.length-1];ye.url=ae}function O(){const ae=this.resume(),ye=this.stack[this.stack.length-1];ye.title=ae}function H(){this.data.inReference=void 0}function M(){this.data.referenceType="collapsed"}function ie(ae){const ye=this.resume(),Ae=this.stack[this.stack.length-1];Ae.label=ye,Ae.identifier=Rn(this.sliceSerialize(ae)).toLowerCase(),this.data.referenceType="full"}function V(ae){this.data.characterReferenceType=ae.type}function se(ae){const ye=this.sliceSerialize(ae),Ae=this.data.characterReferenceType;let Ie;Ae?(Ie=Kx(ye,Ae==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ie=Td(ye);const fe=this.stack[this.stack.length-1];fe.value+=Ie}function ze(ae){const ye=this.stack.pop();ye.position.end=Ui(ae.end)}function Re(ae){q.call(this,ae);const ye=this.stack[this.stack.length-1];ye.url=this.sliceSerialize(ae)}function De(ae){q.call(this,ae);const ye=this.stack[this.stack.length-1];ye.url="mailto:"+this.sliceSerialize(ae)}function Pe(){return{type:"blockquote",children:[]}}function Ge(){return{type:"code",lang:null,meta:null,value:""}}function nt(){return{type:"inlineCode",value:""}}function ht(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function A(){return{type:"emphasis",children:[]}}function pe(){return{type:"heading",depth:0,children:[]}}function re(){return{type:"break"}}function Y(){return{type:"html",value:""}}function F(){return{type:"image",title:null,url:"",alt:null}}function ne(){return{type:"link",title:null,url:"",children:[]}}function me(ae){return{type:"list",ordered:ae.type==="listOrdered",start:null,spread:ae._spread,children:[]}}function de(ae){return{type:"listItem",spread:ae._spread,checked:null,children:[]}}function K(){return{type:"paragraph",children:[]}}function xe(){return{type:"strong",children:[]}}function Ee(){return{type:"text",value:""}}function ke(){return{type:"thematicBreak"}}}function Ui(t){return{line:t.line,column:t.column,offset:t.offset}}function ab(t,r){let i=-1;for(;++i<r.length;){const l=r[i];Array.isArray(l)?ab(t,l):Dk(t,l)}}function Dk(t,r){let i;for(i in r)if(ib.call(r,i))switch(i){case"canContainEols":{const l=r[i];l&&t[i].push(...l);break}case"transforms":{const l=r[i];l&&t[i].push(...l);break}case"enter":case"exit":{const l=r[i];l&&Object.assign(t[i],l);break}}}function Eg(t,r){throw t?new Error("Cannot close `"+t.type+"` ("+il({start:t.start,end:t.end})+"): a different token (`"+r.type+"`, "+il({start:r.start,end:r.end})+") is open"):new Error("Cannot close document, a token (`"+r.type+"`, "+il({start:r.start,end:r.end})+") is still open")}function Mk(t){const r=this;r.parser=i;function i(l){return Rk(l,{...r.data("settings"),...t,extensions:r.data("micromarkExtensions")||[],mdastExtensions:r.data("fromMarkdownExtensions")||[]})}}function Lk(t,r){const i={type:"element",tagName:"blockquote",properties:{},children:t.wrap(t.all(r),!0)};return t.patch(r,i),t.applyData(r,i)}function Bk(t,r){const i={type:"element",tagName:"br",properties:{},children:[]};return t.patch(r,i),[t.applyData(r,i),{type:"text",value:`
18
- `}]}function Uk(t,r){const i=r.value?r.value+`
19
- `:"",l={},o=r.lang?r.lang.split(/\s+/):[];o.length>0&&(l.className=["language-"+o[0]]);let u={type:"element",tagName:"code",properties:l,children:[{type:"text",value:i}]};return r.meta&&(u.data={meta:r.meta}),t.patch(r,u),u=t.applyData(r,u),u={type:"element",tagName:"pre",properties:{},children:[u]},t.patch(r,u),u}function Ik(t,r){const i={type:"element",tagName:"del",properties:{},children:t.all(r)};return t.patch(r,i),t.applyData(r,i)}function Hk(t,r){const i={type:"element",tagName:"em",properties:{},children:t.all(r)};return t.patch(r,i),t.applyData(r,i)}function Pk(t,r){const i=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",l=String(r.identifier).toUpperCase(),o=tr(l.toLowerCase()),u=t.footnoteOrder.indexOf(l);let c,f=t.footnoteCounts.get(l);f===void 0?(f=0,t.footnoteOrder.push(l),c=t.footnoteOrder.length):c=u+1,f+=1,t.footnoteCounts.set(l,f);const h={type:"element",tagName:"a",properties:{href:"#"+i+"fn-"+o,id:i+"fnref-"+o+(f>1?"-"+f:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(c)}]};t.patch(r,h);const p={type:"element",tagName:"sup",properties:{},children:[h]};return t.patch(r,p),t.applyData(r,p)}function Fk(t,r){const i={type:"element",tagName:"h"+r.depth,properties:{},children:t.all(r)};return t.patch(r,i),t.applyData(r,i)}function qk(t,r){if(t.options.allowDangerousHtml){const i={type:"raw",value:r.value};return t.patch(r,i),t.applyData(r,i)}}function rb(t,r){const i=r.referenceType;let l="]";if(i==="collapsed"?l+="[]":i==="full"&&(l+="["+(r.label||r.identifier)+"]"),r.type==="imageReference")return[{type:"text",value:"!["+r.alt+l}];const o=t.all(r),u=o[0];u&&u.type==="text"?u.value="["+u.value:o.unshift({type:"text",value:"["});const c=o[o.length-1];return c&&c.type==="text"?c.value+=l:o.push({type:"text",value:l}),o}function Vk(t,r){const i=String(r.identifier).toUpperCase(),l=t.definitionById.get(i);if(!l)return rb(t,r);const o={src:tr(l.url||""),alt:r.alt};l.title!==null&&l.title!==void 0&&(o.title=l.title);const u={type:"element",tagName:"img",properties:o,children:[]};return t.patch(r,u),t.applyData(r,u)}function Yk(t,r){const i={src:tr(r.url)};r.alt!==null&&r.alt!==void 0&&(i.alt=r.alt),r.title!==null&&r.title!==void 0&&(i.title=r.title);const l={type:"element",tagName:"img",properties:i,children:[]};return t.patch(r,l),t.applyData(r,l)}function Gk(t,r){const i={type:"text",value:r.value.replace(/\r?\n|\r/g," ")};t.patch(r,i);const l={type:"element",tagName:"code",properties:{},children:[i]};return t.patch(r,l),t.applyData(r,l)}function Kk(t,r){const i=String(r.identifier).toUpperCase(),l=t.definitionById.get(i);if(!l)return rb(t,r);const o={href:tr(l.url||"")};l.title!==null&&l.title!==void 0&&(o.title=l.title);const u={type:"element",tagName:"a",properties:o,children:t.all(r)};return t.patch(r,u),t.applyData(r,u)}function $k(t,r){const i={href:tr(r.url)};r.title!==null&&r.title!==void 0&&(i.title=r.title);const l={type:"element",tagName:"a",properties:i,children:t.all(r)};return t.patch(r,l),t.applyData(r,l)}function Xk(t,r,i){const l=t.all(r),o=i?Zk(i):lb(r),u={},c=[];if(typeof r.checked=="boolean"){const b=l[0];let x;b&&b.type==="element"&&b.tagName==="p"?x=b:(x={type:"element",tagName:"p",properties:{},children:[]},l.unshift(x)),x.children.length>0&&x.children.unshift({type:"text",value:" "}),x.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:r.checked,disabled:!0},children:[]}),u.className=["task-list-item"]}let f=-1;for(;++f<l.length;){const b=l[f];(o||f!==0||b.type!=="element"||b.tagName!=="p")&&c.push({type:"text",value:`
20
- `}),b.type==="element"&&b.tagName==="p"&&!o?c.push(...b.children):c.push(b)}const h=l[l.length-1];h&&(o||h.type!=="element"||h.tagName!=="p")&&c.push({type:"text",value:`
21
- `});const p={type:"element",tagName:"li",properties:u,children:c};return t.patch(r,p),t.applyData(r,p)}function Zk(t){let r=!1;if(t.type==="list"){r=t.spread||!1;const i=t.children;let l=-1;for(;!r&&++l<i.length;)r=lb(i[l])}return r}function lb(t){const r=t.spread;return r??t.children.length>1}function Qk(t,r){const i={},l=t.all(r);let o=-1;for(typeof r.start=="number"&&r.start!==1&&(i.start=r.start);++o<l.length;){const c=l[o];if(c.type==="element"&&c.tagName==="li"&&c.properties&&Array.isArray(c.properties.className)&&c.properties.className.includes("task-list-item")){i.className=["contains-task-list"];break}}const u={type:"element",tagName:r.ordered?"ol":"ul",properties:i,children:t.wrap(l,!0)};return t.patch(r,u),t.applyData(r,u)}function Jk(t,r){const i={type:"element",tagName:"p",properties:{},children:t.all(r)};return t.patch(r,i),t.applyData(r,i)}function Wk(t,r){const i={type:"root",children:t.wrap(t.all(r))};return t.patch(r,i),t.applyData(r,i)}function ej(t,r){const i={type:"element",tagName:"strong",properties:{},children:t.all(r)};return t.patch(r,i),t.applyData(r,i)}function tj(t,r){const i=t.all(r),l=i.shift(),o=[];if(l){const c={type:"element",tagName:"thead",properties:{},children:t.wrap([l],!0)};t.patch(r.children[0],c),o.push(c)}if(i.length>0){const c={type:"element",tagName:"tbody",properties:{},children:t.wrap(i,!0)},f=Cd(r.children[1]),h=Ix(r.children[r.children.length-1]);f&&h&&(c.position={start:f,end:h}),o.push(c)}const u={type:"element",tagName:"table",properties:{},children:t.wrap(o,!0)};return t.patch(r,u),t.applyData(r,u)}function nj(t,r,i){const l=i?i.children:void 0,u=(l?l.indexOf(r):1)===0?"th":"td",c=i&&i.type==="table"?i.align:void 0,f=c?c.length:r.children.length;let h=-1;const p=[];for(;++h<f;){const x=r.children[h],w={},y=c?c[h]:void 0;y&&(w.align=y);let j={type:"element",tagName:u,properties:w,children:[]};x&&(j.children=t.all(x),t.patch(x,j),j=t.applyData(x,j)),p.push(j)}const b={type:"element",tagName:"tr",properties:{},children:t.wrap(p,!0)};return t.patch(r,b),t.applyData(r,b)}function ij(t,r){const i={type:"element",tagName:"td",properties:{},children:t.all(r)};return t.patch(r,i),t.applyData(r,i)}const Ag=9,zg=32;function aj(t){const r=String(t),i=/\r?\n|\r/g;let l=i.exec(r),o=0;const u=[];for(;l;)u.push(Tg(r.slice(o,l.index),o>0,!0),l[0]),o=l.index+l[0].length,l=i.exec(r);return u.push(Tg(r.slice(o),o>0,!1)),u.join("")}function Tg(t,r,i){let l=0,o=t.length;if(r){let u=t.codePointAt(l);for(;u===Ag||u===zg;)l++,u=t.codePointAt(l)}if(i){let u=t.codePointAt(o-1);for(;u===Ag||u===zg;)o--,u=t.codePointAt(o-1)}return o>l?t.slice(l,o):""}function rj(t,r){const i={type:"text",value:aj(String(r.value))};return t.patch(r,i),t.applyData(r,i)}function lj(t,r){const i={type:"element",tagName:"hr",properties:{},children:[]};return t.patch(r,i),t.applyData(r,i)}const sj={blockquote:Lk,break:Bk,code:Uk,delete:Ik,emphasis:Hk,footnoteReference:Pk,heading:Fk,html:qk,imageReference:Vk,image:Yk,inlineCode:Gk,linkReference:Kk,link:$k,listItem:Xk,list:Qk,paragraph:Jk,root:Wk,strong:ej,table:tj,tableCell:ij,tableRow:nj,text:rj,thematicBreak:lj,toml:Is,yaml:Is,definition:Is,footnoteDefinition:Is};function Is(){}const sb=-1,lo=0,rl=1,Qs=2,Od=3,Dd=4,Md=5,Ld=6,ob=7,ub=8,Rg=typeof self=="object"?self:globalThis,oj=(t,r)=>{const i=(o,u)=>(t.set(u,o),o),l=o=>{if(t.has(o))return t.get(o);const[u,c]=r[o];switch(u){case lo:case sb:return i(c,o);case rl:{const f=i([],o);for(const h of c)f.push(l(h));return f}case Qs:{const f=i({},o);for(const[h,p]of c)f[l(h)]=l(p);return f}case Od:return i(new Date(c),o);case Dd:{const{source:f,flags:h}=c;return i(new RegExp(f,h),o)}case Md:{const f=i(new Map,o);for(const[h,p]of c)f.set(l(h),l(p));return f}case Ld:{const f=i(new Set,o);for(const h of c)f.add(l(h));return f}case ob:{const{name:f,message:h}=c;return i(new Rg[f](h),o)}case ub:return i(BigInt(c),o);case"BigInt":return i(Object(BigInt(c)),o);case"ArrayBuffer":return i(new Uint8Array(c).buffer,c);case"DataView":{const{buffer:f}=new Uint8Array(c);return i(new DataView(f),c)}}return i(new Rg[u](c),o)};return l},Og=t=>oj(new Map,t)(0),$a="",{toString:uj}={},{keys:cj}=Object,tl=t=>{const r=typeof t;if(r!=="object"||!t)return[lo,r];const i=uj.call(t).slice(8,-1);switch(i){case"Array":return[rl,$a];case"Object":return[Qs,$a];case"Date":return[Od,$a];case"RegExp":return[Dd,$a];case"Map":return[Md,$a];case"Set":return[Ld,$a];case"DataView":return[rl,i]}return i.includes("Array")?[rl,i]:i.includes("Error")?[ob,i]:[Qs,i]},Hs=([t,r])=>t===lo&&(r==="function"||r==="symbol"),dj=(t,r,i,l)=>{const o=(c,f)=>{const h=l.push(c)-1;return i.set(f,h),h},u=c=>{if(i.has(c))return i.get(c);let[f,h]=tl(c);switch(f){case lo:{let b=c;switch(h){case"bigint":f=ub,b=c.toString();break;case"function":case"symbol":if(t)throw new TypeError("unable to serialize "+h);b=null;break;case"undefined":return o([sb],c)}return o([f,b],c)}case rl:{if(h){let w=c;return h==="DataView"?w=new Uint8Array(c.buffer):h==="ArrayBuffer"&&(w=new Uint8Array(c)),o([h,[...w]],c)}const b=[],x=o([f,b],c);for(const w of c)b.push(u(w));return x}case Qs:{if(h)switch(h){case"BigInt":return o([h,c.toString()],c);case"Boolean":case"Number":case"String":return o([h,c.valueOf()],c)}if(r&&"toJSON"in c)return u(c.toJSON());const b=[],x=o([f,b],c);for(const w of cj(c))(t||!Hs(tl(c[w])))&&b.push([u(w),u(c[w])]);return x}case Od:return o([f,c.toISOString()],c);case Dd:{const{source:b,flags:x}=c;return o([f,{source:b,flags:x}],c)}case Md:{const b=[],x=o([f,b],c);for(const[w,y]of c)(t||!(Hs(tl(w))||Hs(tl(y))))&&b.push([u(w),u(y)]);return x}case Ld:{const b=[],x=o([f,b],c);for(const w of c)(t||!Hs(tl(w)))&&b.push(u(w));return x}}const{message:p}=c;return o([f,{name:h,message:p}],c)};return u},Dg=(t,{json:r,lossy:i}={})=>{const l=[];return dj(!(r||i),!!r,new Map,l)(t),l},Js=typeof structuredClone=="function"?(t,r)=>r&&("json"in r||"lossy"in r)?Og(Dg(t,r)):structuredClone(t):(t,r)=>Og(Dg(t,r));function fj(t,r){const i=[{type:"text",value:"↩"}];return r>1&&i.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(r)}]}),i}function hj(t,r){return"Back to reference "+(t+1)+(r>1?"-"+r:"")}function pj(t){const r=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",i=t.options.footnoteBackContent||fj,l=t.options.footnoteBackLabel||hj,o=t.options.footnoteLabel||"Footnotes",u=t.options.footnoteLabelTagName||"h2",c=t.options.footnoteLabelProperties||{className:["sr-only"]},f=[];let h=-1;for(;++h<t.footnoteOrder.length;){const p=t.footnoteById.get(t.footnoteOrder[h]);if(!p)continue;const b=t.all(p),x=String(p.identifier).toUpperCase(),w=tr(x.toLowerCase());let y=0;const j=[],v=t.footnoteCounts.get(x);for(;v!==void 0&&++y<=v;){j.length>0&&j.push({type:"text",value:" "});let _=typeof i=="string"?i:i(h,y);typeof _=="string"&&(_={type:"text",value:_}),j.push({type:"element",tagName:"a",properties:{href:"#"+r+"fnref-"+w+(y>1?"-"+y:""),dataFootnoteBackref:"",ariaLabel:typeof l=="string"?l:l(h,y),className:["data-footnote-backref"]},children:Array.isArray(_)?_:[_]})}const k=b[b.length-1];if(k&&k.type==="element"&&k.tagName==="p"){const _=k.children[k.children.length-1];_&&_.type==="text"?_.value+=" ":k.children.push({type:"text",value:" "}),k.children.push(...j)}else b.push(...j);const S={type:"element",tagName:"li",properties:{id:r+"fn-"+w},children:t.wrap(b,!0)};t.patch(p,S),f.push(S)}if(f.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:u,properties:{...Js(c),id:"footnote-label"},children:[{type:"text",value:o}]},{type:"text",value:`
22
- `},{type:"element",tagName:"ol",properties:{},children:t.wrap(f,!0)},{type:"text",value:`
23
- `}]}}const so=(function(t){if(t==null)return bj;if(typeof t=="function")return oo(t);if(typeof t=="object")return Array.isArray(t)?mj(t):gj(t);if(typeof t=="string")return xj(t);throw new Error("Expected function, string, or object as test")});function mj(t){const r=[];let i=-1;for(;++i<t.length;)r[i]=so(t[i]);return oo(l);function l(...o){let u=-1;for(;++u<r.length;)if(r[u].apply(this,o))return!0;return!1}}function gj(t){const r=t;return oo(i);function i(l){const o=l;let u;for(u in t)if(o[u]!==r[u])return!1;return!0}}function xj(t){return oo(r);function r(i){return i&&i.type===t}}function oo(t){return r;function r(i,l,o){return!!(yj(i)&&t.call(this,i,typeof l=="number"?l:void 0,o||void 0))}}function bj(){return!0}function yj(t){return t!==null&&typeof t=="object"&&"type"in t}const cb=[],vj=!0,dd=!1,wj="skip";function db(t,r,i,l){let o;typeof r=="function"&&typeof i!="function"?(l=i,i=r):o=r;const u=so(o),c=l?-1:1;f(t,void 0,[])();function f(h,p,b){const x=h&&typeof h=="object"?h:{};if(typeof x.type=="string"){const y=typeof x.tagName=="string"?x.tagName:typeof x.name=="string"?x.name:void 0;Object.defineProperty(w,"name",{value:"node ("+(h.type+(y?"<"+y+">":""))+")"})}return w;function w(){let y=cb,j,v,k;if((!r||u(h,p,b[b.length-1]||void 0))&&(y=Sj(i(h,b)),y[0]===dd))return y;if("children"in h&&h.children){const S=h;if(S.children&&y[0]!==wj)for(v=(l?S.children.length:-1)+c,k=b.concat(S);v>-1&&v<S.children.length;){const _=S.children[v];if(j=f(_,v,k)(),j[0]===dd)return j;v=typeof j[1]=="number"?j[1]:v+c}}return y}}}function Sj(t){return Array.isArray(t)?t:typeof t=="number"?[vj,t]:t==null?cb:[t]}function Bd(t,r,i,l){let o,u,c;typeof r=="function"&&typeof i!="function"?(u=void 0,c=r,o=i):(u=r,c=i,o=l),db(t,u,f,o);function f(h,p){const b=p[p.length-1],x=b?b.children.indexOf(h):void 0;return c(h,x,b)}}const fd={}.hasOwnProperty,kj={};function jj(t,r){const i=r||kj,l=new Map,o=new Map,u=new Map,c={...sj,...i.handlers},f={all:p,applyData:Cj,definitionById:l,footnoteById:o,footnoteCounts:u,footnoteOrder:[],handlers:c,one:h,options:i,patch:_j,wrap:Ej};return Bd(t,function(b){if(b.type==="definition"||b.type==="footnoteDefinition"){const x=b.type==="definition"?l:o,w=String(b.identifier).toUpperCase();x.has(w)||x.set(w,b)}}),f;function h(b,x){const w=b.type,y=f.handlers[w];if(fd.call(f.handlers,w)&&y)return y(f,b,x);if(f.options.passThrough&&f.options.passThrough.includes(w)){if("children"in b){const{children:v,...k}=b,S=Js(k);return S.children=f.all(b),S}return Js(b)}return(f.options.unknownHandler||Nj)(f,b,x)}function p(b){const x=[];if("children"in b){const w=b.children;let y=-1;for(;++y<w.length;){const j=f.one(w[y],b);if(j){if(y&&w[y-1].type==="break"&&(!Array.isArray(j)&&j.type==="text"&&(j.value=Mg(j.value)),!Array.isArray(j)&&j.type==="element")){const v=j.children[0];v&&v.type==="text"&&(v.value=Mg(v.value))}Array.isArray(j)?x.push(...j):x.push(j)}}}return x}}function _j(t,r){t.position&&(r.position=h2(t))}function Cj(t,r){let i=r;if(t&&t.data){const l=t.data.hName,o=t.data.hChildren,u=t.data.hProperties;if(typeof l=="string")if(i.type==="element")i.tagName=l;else{const c="children"in i?i.children:[i];i={type:"element",tagName:l,properties:{},children:c}}i.type==="element"&&u&&Object.assign(i.properties,Js(u)),"children"in i&&i.children&&o!==null&&o!==void 0&&(i.children=o)}return i}function Nj(t,r){const i=r.data||{},l="value"in r&&!(fd.call(i,"hProperties")||fd.call(i,"hChildren"))?{type:"text",value:r.value}:{type:"element",tagName:"div",properties:{},children:t.all(r)};return t.patch(r,l),t.applyData(r,l)}function Ej(t,r){const i=[];let l=-1;for(r&&i.push({type:"text",value:`
24
- `});++l<t.length;)l&&i.push({type:"text",value:`
25
- `}),i.push(t[l]);return r&&t.length>0&&i.push({type:"text",value:`
26
- `}),i}function Mg(t){let r=0,i=t.charCodeAt(r);for(;i===9||i===32;)r++,i=t.charCodeAt(r);return t.slice(r)}function Lg(t,r){const i=jj(t,r),l=i.one(t,void 0),o=pj(i),u=Array.isArray(l)?{type:"root",children:l}:l||{type:"root",children:[]};return o&&u.children.push({type:"text",value:`
27
- `},o),u}function Aj(t,r){return t&&"run"in t?async function(i,l){const o=Lg(i,{file:l,...r});await t.run(o,l)}:function(i,l){return Lg(i,{file:l,...t||r})}}function Bg(t){if(t)throw t}var Pc,Ug;function zj(){if(Ug)return Pc;Ug=1;var t=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=Object.defineProperty,l=Object.getOwnPropertyDescriptor,o=function(p){return typeof Array.isArray=="function"?Array.isArray(p):r.call(p)==="[object Array]"},u=function(p){if(!p||r.call(p)!=="[object Object]")return!1;var b=t.call(p,"constructor"),x=p.constructor&&p.constructor.prototype&&t.call(p.constructor.prototype,"isPrototypeOf");if(p.constructor&&!b&&!x)return!1;var w;for(w in p);return typeof w>"u"||t.call(p,w)},c=function(p,b){i&&b.name==="__proto__"?i(p,b.name,{enumerable:!0,configurable:!0,value:b.newValue,writable:!0}):p[b.name]=b.newValue},f=function(p,b){if(b==="__proto__")if(t.call(p,b)){if(l)return l(p,b).value}else return;return p[b]};return Pc=function h(){var p,b,x,w,y,j,v=arguments[0],k=1,S=arguments.length,_=!1;for(typeof v=="boolean"&&(_=v,v=arguments[1]||{},k=2),(v==null||typeof v!="object"&&typeof v!="function")&&(v={});k<S;++k)if(p=arguments[k],p!=null)for(b in p)x=f(v,b),w=f(p,b),v!==w&&(_&&w&&(u(w)||(y=o(w)))?(y?(y=!1,j=x&&o(x)?x:[]):j=x&&u(x)?x:{},c(v,{name:b,newValue:h(_,j,w)})):typeof w<"u"&&c(v,{name:b,newValue:w}));return v},Pc}var Tj=zj();const Fc=dl(Tj);function hd(t){if(typeof t!="object"||t===null)return!1;const r=Object.getPrototypeOf(t);return(r===null||r===Object.prototype||Object.getPrototypeOf(r)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)}function Rj(){const t=[],r={run:i,use:l};return r;function i(...o){let u=-1;const c=o.pop();if(typeof c!="function")throw new TypeError("Expected function as last argument, not "+c);f(null,...o);function f(h,...p){const b=t[++u];let x=-1;if(h){c(h);return}for(;++x<o.length;)(p[x]===null||p[x]===void 0)&&(p[x]=o[x]);o=p,b?Oj(b,f)(...p):c(null,...p)}}function l(o){if(typeof o!="function")throw new TypeError("Expected `middelware` to be a function, not "+o);return t.push(o),r}}function Oj(t,r){let i;return l;function l(...c){const f=t.length>c.length;let h;f&&c.push(o);try{h=t.apply(this,c)}catch(p){const b=p;if(f&&i)throw b;return o(b)}f||(h&&h.then&&typeof h.then=="function"?h.then(u,o):h instanceof Error?o(h):u(h))}function o(c,...f){i||(i=!0,r(c,...f))}function u(c){o(null,c)}}const Hn={basename:Dj,dirname:Mj,extname:Lj,join:Bj,sep:"/"};function Dj(t,r){if(r!==void 0&&typeof r!="string")throw new TypeError('"ext" argument must be a string');xl(t);let i=0,l=-1,o=t.length,u;if(r===void 0||r.length===0||r.length>t.length){for(;o--;)if(t.codePointAt(o)===47){if(u){i=o+1;break}}else l<0&&(u=!0,l=o+1);return l<0?"":t.slice(i,l)}if(r===t)return"";let c=-1,f=r.length-1;for(;o--;)if(t.codePointAt(o)===47){if(u){i=o+1;break}}else c<0&&(u=!0,c=o+1),f>-1&&(t.codePointAt(o)===r.codePointAt(f--)?f<0&&(l=o):(f=-1,l=c));return i===l?l=c:l<0&&(l=t.length),t.slice(i,l)}function Mj(t){if(xl(t),t.length===0)return".";let r=-1,i=t.length,l;for(;--i;)if(t.codePointAt(i)===47){if(l){r=i;break}}else l||(l=!0);return r<0?t.codePointAt(0)===47?"/":".":r===1&&t.codePointAt(0)===47?"//":t.slice(0,r)}function Lj(t){xl(t);let r=t.length,i=-1,l=0,o=-1,u=0,c;for(;r--;){const f=t.codePointAt(r);if(f===47){if(c){l=r+1;break}continue}i<0&&(c=!0,i=r+1),f===46?o<0?o=r:u!==1&&(u=1):o>-1&&(u=-1)}return o<0||i<0||u===0||u===1&&o===i-1&&o===l+1?"":t.slice(o,i)}function Bj(...t){let r=-1,i;for(;++r<t.length;)xl(t[r]),t[r]&&(i=i===void 0?t[r]:i+"/"+t[r]);return i===void 0?".":Uj(i)}function Uj(t){xl(t);const r=t.codePointAt(0)===47;let i=Ij(t,!r);return i.length===0&&!r&&(i="."),i.length>0&&t.codePointAt(t.length-1)===47&&(i+="/"),r?"/"+i:i}function Ij(t,r){let i="",l=0,o=-1,u=0,c=-1,f,h;for(;++c<=t.length;){if(c<t.length)f=t.codePointAt(c);else{if(f===47)break;f=47}if(f===47){if(!(o===c-1||u===1))if(o!==c-1&&u===2){if(i.length<2||l!==2||i.codePointAt(i.length-1)!==46||i.codePointAt(i.length-2)!==46){if(i.length>2){if(h=i.lastIndexOf("/"),h!==i.length-1){h<0?(i="",l=0):(i=i.slice(0,h),l=i.length-1-i.lastIndexOf("/")),o=c,u=0;continue}}else if(i.length>0){i="",l=0,o=c,u=0;continue}}r&&(i=i.length>0?i+"/..":"..",l=2)}else i.length>0?i+="/"+t.slice(o+1,c):i=t.slice(o+1,c),l=c-o-1;o=c,u=0}else f===46&&u>-1?u++:u=-1}return i}function xl(t){if(typeof t!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}const Hj={cwd:Pj};function Pj(){return"/"}function pd(t){return!!(t!==null&&typeof t=="object"&&"href"in t&&t.href&&"protocol"in t&&t.protocol&&t.auth===void 0)}function Fj(t){if(typeof t=="string")t=new URL(t);else if(!pd(t)){const r=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+t+"`");throw r.code="ERR_INVALID_ARG_TYPE",r}if(t.protocol!=="file:"){const r=new TypeError("The URL must be of scheme file");throw r.code="ERR_INVALID_URL_SCHEME",r}return qj(t)}function qj(t){if(t.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 r=t.pathname;let i=-1;for(;++i<r.length;)if(r.codePointAt(i)===37&&r.codePointAt(i+1)===50){const l=r.codePointAt(i+2);if(l===70||l===102){const o=new TypeError("File URL path must not include encoded / characters");throw o.code="ERR_INVALID_FILE_URL_PATH",o}}return decodeURIComponent(r)}const qc=["history","path","basename","stem","extname","dirname"];class fb{constructor(r){let i;r?pd(r)?i={path:r}:typeof r=="string"||Vj(r)?i={value:r}:i=r:i={},this.cwd="cwd"in i?"":Hj.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let l=-1;for(;++l<qc.length;){const u=qc[l];u in i&&i[u]!==void 0&&i[u]!==null&&(this[u]=u==="history"?[...i[u]]:i[u])}let o;for(o in i)qc.includes(o)||(this[o]=i[o])}get basename(){return typeof this.path=="string"?Hn.basename(this.path):void 0}set basename(r){Yc(r,"basename"),Vc(r,"basename"),this.path=Hn.join(this.dirname||"",r)}get dirname(){return typeof this.path=="string"?Hn.dirname(this.path):void 0}set dirname(r){Ig(this.basename,"dirname"),this.path=Hn.join(r||"",this.basename)}get extname(){return typeof this.path=="string"?Hn.extname(this.path):void 0}set extname(r){if(Vc(r,"extname"),Ig(this.dirname,"extname"),r){if(r.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(r.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Hn.join(this.dirname,this.stem+(r||""))}get path(){return this.history[this.history.length-1]}set path(r){pd(r)&&(r=Fj(r)),Yc(r,"path"),this.path!==r&&this.history.push(r)}get stem(){return typeof this.path=="string"?Hn.basename(this.path,this.extname):void 0}set stem(r){Yc(r,"stem"),Vc(r,"stem"),this.path=Hn.join(this.dirname||"",r+(this.extname||""))}fail(r,i,l){const o=this.message(r,i,l);throw o.fatal=!0,o}info(r,i,l){const o=this.message(r,i,l);return o.fatal=void 0,o}message(r,i,l){const o=new Yt(r,i,l);return this.path&&(o.name=this.path+":"+o.name,o.file=this.path),o.fatal=!1,this.messages.push(o),o}toString(r){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(r||void 0).decode(this.value)}}function Vc(t,r){if(t&&t.includes(Hn.sep))throw new Error("`"+r+"` cannot be a path: did not expect `"+Hn.sep+"`")}function Yc(t,r){if(!t)throw new Error("`"+r+"` cannot be empty")}function Ig(t,r){if(!t)throw new Error("Setting `"+r+"` requires `path` to be set too")}function Vj(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const Yj=(function(t){const l=this.constructor.prototype,o=l[t],u=function(){return o.apply(u,arguments)};return Object.setPrototypeOf(u,l),u}),Gj={}.hasOwnProperty;class Ud extends Yj{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=Rj()}copy(){const r=new Ud;let i=-1;for(;++i<this.attachers.length;){const l=this.attachers[i];r.use(...l)}return r.data(Fc(!0,{},this.namespace)),r}data(r,i){return typeof r=="string"?arguments.length===2?($c("data",this.frozen),this.namespace[r]=i,this):Gj.call(this.namespace,r)&&this.namespace[r]||void 0:r?($c("data",this.frozen),this.namespace=r,this):this.namespace}freeze(){if(this.frozen)return this;const r=this;for(;++this.freezeIndex<this.attachers.length;){const[i,...l]=this.attachers[this.freezeIndex];if(l[0]===!1)continue;l[0]===!0&&(l[0]=void 0);const o=i.call(r,...l);typeof o=="function"&&this.transformers.use(o)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(r){this.freeze();const i=Ps(r),l=this.parser||this.Parser;return Gc("parse",l),l(String(i),i)}process(r,i){const l=this;return this.freeze(),Gc("process",this.parser||this.Parser),Kc("process",this.compiler||this.Compiler),i?o(void 0,i):new Promise(o);function o(u,c){const f=Ps(r),h=l.parse(f);l.run(h,f,function(b,x,w){if(b||!x||!w)return p(b);const y=x,j=l.stringify(y,w);Xj(j)?w.value=j:w.result=j,p(b,w)});function p(b,x){b||!x?c(b):u?u(x):i(void 0,x)}}}processSync(r){let i=!1,l;return this.freeze(),Gc("processSync",this.parser||this.Parser),Kc("processSync",this.compiler||this.Compiler),this.process(r,o),Pg("processSync","process",i),l;function o(u,c){i=!0,Bg(u),l=c}}run(r,i,l){Hg(r),this.freeze();const o=this.transformers;return!l&&typeof i=="function"&&(l=i,i=void 0),l?u(void 0,l):new Promise(u);function u(c,f){const h=Ps(i);o.run(r,h,p);function p(b,x,w){const y=x||r;b?f(b):c?c(y):l(void 0,y,w)}}}runSync(r,i){let l=!1,o;return this.run(r,i,u),Pg("runSync","run",l),o;function u(c,f){Bg(c),o=f,l=!0}}stringify(r,i){this.freeze();const l=Ps(i),o=this.compiler||this.Compiler;return Kc("stringify",o),Hg(r),o(r,l)}use(r,...i){const l=this.attachers,o=this.namespace;if($c("use",this.frozen),r!=null)if(typeof r=="function")h(r,i);else if(typeof r=="object")Array.isArray(r)?f(r):c(r);else throw new TypeError("Expected usable value, not `"+r+"`");return this;function u(p){if(typeof p=="function")h(p,[]);else if(typeof p=="object")if(Array.isArray(p)){const[b,...x]=p;h(b,x)}else c(p);else throw new TypeError("Expected usable value, not `"+p+"`")}function c(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&&(o.settings=Fc(!0,o.settings,p.settings))}function f(p){let b=-1;if(p!=null)if(Array.isArray(p))for(;++b<p.length;){const x=p[b];u(x)}else throw new TypeError("Expected a list of plugins, not `"+p+"`")}function h(p,b){let x=-1,w=-1;for(;++x<l.length;)if(l[x][0]===p){w=x;break}if(w===-1)l.push([p,...b]);else if(b.length>0){let[y,...j]=b;const v=l[w][1];hd(v)&&hd(y)&&(y=Fc(!0,v,y)),l[w]=[p,y,...j]}}}}const Kj=new Ud().freeze();function Gc(t,r){if(typeof r!="function")throw new TypeError("Cannot `"+t+"` without `parser`")}function Kc(t,r){if(typeof r!="function")throw new TypeError("Cannot `"+t+"` without `compiler`")}function $c(t,r){if(r)throw new Error("Cannot call `"+t+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Hg(t){if(!hd(t)||typeof t.type!="string")throw new TypeError("Expected node, got `"+t+"`")}function Pg(t,r,i){if(!i)throw new Error("`"+t+"` finished async. Use `"+r+"` instead")}function Ps(t){return $j(t)?t:new fb(t)}function $j(t){return!!(t&&typeof t=="object"&&"message"in t&&"messages"in t)}function Xj(t){return typeof t=="string"||Zj(t)}function Zj(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const Qj="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Fg=[],qg={allowDangerousHtml:!0},Jj=/^(https?|ircs?|mailto|xmpp)$/i,Wj=[{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 e5(t){const r=t5(t),i=n5(t);return i5(r.runSync(r.parse(i),i),t)}function t5(t){const r=t.rehypePlugins||Fg,i=t.remarkPlugins||Fg,l=t.remarkRehypeOptions?{...t.remarkRehypeOptions,...qg}:qg;return Kj().use(Mk).use(i).use(Aj,l).use(r)}function n5(t){const r=t.children||"",i=new fb;return typeof r=="string"&&(i.value=r),i}function i5(t,r){const i=r.allowedElements,l=r.allowElement,o=r.components,u=r.disallowedElements,c=r.skipHtml,f=r.unwrapDisallowed,h=r.urlTransform||a5;for(const b of Wj)Object.hasOwn(r,b.from)&&(""+b.from+(b.to?"use `"+b.to+"` instead":"remove it")+Qj+b.id,void 0);return Bd(t,p),b2(t,{Fragment:d.Fragment,components:o,ignoreInvalidStyle:!0,jsx:d.jsx,jsxs:d.jsxs,passKeys:!0,passNode:!0});function p(b,x,w){if(b.type==="raw"&&w&&typeof x=="number")return c?w.children.splice(x,1):w.children[x]={type:"text",value:b.value},x;if(b.type==="element"){let y;for(y in Uc)if(Object.hasOwn(Uc,y)&&Object.hasOwn(b.properties,y)){const j=b.properties[y],v=Uc[y];(v===null||v.includes(b.tagName))&&(b.properties[y]=h(String(j||""),y,b))}}if(b.type==="element"){let y=i?!i.includes(b.tagName):u?u.includes(b.tagName):!1;if(!y&&l&&typeof x=="number"&&(y=!l(b,x,w)),y&&w&&typeof x=="number")return f&&b.children?w.children.splice(x,1,...b.children):w.children.splice(x,1),x}}}function a5(t){const r=t.indexOf(":"),i=t.indexOf("?"),l=t.indexOf("#"),o=t.indexOf("/");return r===-1||o!==-1&&r>o||i!==-1&&r>i||l!==-1&&r>l||Jj.test(t.slice(0,r))?t:""}function Vg(t,r){const i=String(t);if(typeof r!="string")throw new TypeError("Expected character");let l=0,o=i.indexOf(r);for(;o!==-1;)l++,o=i.indexOf(r,o+r.length);return l}function r5(t){if(typeof t!="string")throw new TypeError("Expected a string");return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function l5(t,r,i){const o=so((i||{}).ignore||[]),u=s5(r);let c=-1;for(;++c<u.length;)db(t,"text",f);function f(p,b){let x=-1,w;for(;++x<b.length;){const y=b[x],j=w?w.children:void 0;if(o(y,j?j.indexOf(y):void 0,w))return;w=y}if(w)return h(p,b)}function h(p,b){const x=b[b.length-1],w=u[c][0],y=u[c][1];let j=0;const k=x.children.indexOf(p);let S=!1,_=[];w.lastIndex=0;let N=w.exec(p.value);for(;N;){const B=N.index,D={index:N.index,input:N.input,stack:[...b,p]};let z=y(...N,D);if(typeof z=="string"&&(z=z.length>0?{type:"text",value:z}:void 0),z===!1?w.lastIndex=B+1:(j!==B&&_.push({type:"text",value:p.value.slice(j,B)}),Array.isArray(z)?_.push(...z):z&&_.push(z),j=B+N[0].length,S=!0),!w.global)break;N=w.exec(p.value)}return S?(j<p.value.length&&_.push({type:"text",value:p.value.slice(j)}),x.children.splice(k,1,..._)):_=[p],k+_.length}}function s5(t){const r=[];if(!Array.isArray(t))throw new TypeError("Expected find and replace tuple or list of tuples");const i=!t[0]||Array.isArray(t[0])?t:[t];let l=-1;for(;++l<i.length;){const o=i[l];r.push([o5(o[0]),u5(o[1])])}return r}function o5(t){return typeof t=="string"?new RegExp(r5(t),"g"):t}function u5(t){return typeof t=="function"?t:function(){return t}}const Xc="phrasing",Zc=["autolink","link","image","label"];function c5(){return{transforms:[x5],enter:{literalAutolink:f5,literalAutolinkEmail:Qc,literalAutolinkHttp:Qc,literalAutolinkWww:Qc},exit:{literalAutolink:g5,literalAutolinkEmail:m5,literalAutolinkHttp:h5,literalAutolinkWww:p5}}}function d5(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Xc,notInConstruct:Zc},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Xc,notInConstruct:Zc},{character:":",before:"[ps]",after:"\\/",inConstruct:Xc,notInConstruct:Zc}]}}function f5(t){this.enter({type:"link",title:null,url:"",children:[]},t)}function Qc(t){this.config.enter.autolinkProtocol.call(this,t)}function h5(t){this.config.exit.autolinkProtocol.call(this,t)}function p5(t){this.config.exit.data.call(this,t);const r=this.stack[this.stack.length-1];r.type,r.url="http://"+this.sliceSerialize(t)}function m5(t){this.config.exit.autolinkEmail.call(this,t)}function g5(t){this.exit(t)}function x5(t){l5(t,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,b5],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),y5]],{ignore:["link","linkReference"]})}function b5(t,r,i,l,o){let u="";if(!hb(o)||(/^w/i.test(r)&&(i=r+i,r="",u="http://"),!v5(i)))return!1;const c=w5(i+l);if(!c[0])return!1;const f={type:"link",title:null,url:u+r+c[0],children:[{type:"text",value:r+c[0]}]};return c[1]?[f,{type:"text",value:c[1]}]:f}function y5(t,r,i,l){return!hb(l,!0)||/[-\d_]$/.test(i)?!1:{type:"link",title:null,url:"mailto:"+r+"@"+i,children:[{type:"text",value:r+"@"+i}]}}function v5(t){const r=t.split(".");return!(r.length<2||r[r.length-1]&&(/_/.test(r[r.length-1])||!/[a-zA-Z\d]/.test(r[r.length-1]))||r[r.length-2]&&(/_/.test(r[r.length-2])||!/[a-zA-Z\d]/.test(r[r.length-2])))}function w5(t){const r=/[!"&'),.:;<>?\]}]+$/.exec(t);if(!r)return[t,void 0];t=t.slice(0,r.index);let i=r[0],l=i.indexOf(")");const o=Vg(t,"(");let u=Vg(t,")");for(;l!==-1&&o>u;)t+=i.slice(0,l+1),i=i.slice(l+1),l=i.indexOf(")"),u++;return[t,i]}function hb(t,r){const i=t.input.charCodeAt(t.index-1);return(t.index===0||la(i)||ao(i))&&(!r||i!==47)}pb.peek=z5;function S5(){this.buffer()}function k5(t){this.enter({type:"footnoteReference",identifier:"",label:""},t)}function j5(){this.buffer()}function _5(t){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},t)}function C5(t){const r=this.resume(),i=this.stack[this.stack.length-1];i.type,i.identifier=Rn(this.sliceSerialize(t)).toLowerCase(),i.label=r}function N5(t){this.exit(t)}function E5(t){const r=this.resume(),i=this.stack[this.stack.length-1];i.type,i.identifier=Rn(this.sliceSerialize(t)).toLowerCase(),i.label=r}function A5(t){this.exit(t)}function z5(){return"["}function pb(t,r,i,l){const o=i.createTracker(l);let u=o.move("[^");const c=i.enter("footnoteReference"),f=i.enter("reference");return u+=o.move(i.safe(i.associationId(t),{after:"]",before:u})),f(),c(),u+=o.move("]"),u}function T5(){return{enter:{gfmFootnoteCallString:S5,gfmFootnoteCall:k5,gfmFootnoteDefinitionLabelString:j5,gfmFootnoteDefinition:_5},exit:{gfmFootnoteCallString:C5,gfmFootnoteCall:N5,gfmFootnoteDefinitionLabelString:E5,gfmFootnoteDefinition:A5}}}function R5(t){let r=!1;return t&&t.firstLineBlank&&(r=!0),{handlers:{footnoteDefinition:i,footnoteReference:pb},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function i(l,o,u,c){const f=u.createTracker(c);let h=f.move("[^");const p=u.enter("footnoteDefinition"),b=u.enter("label");return h+=f.move(u.safe(u.associationId(l),{before:h,after:"]"})),b(),h+=f.move("]:"),l.children&&l.children.length>0&&(f.shift(4),h+=f.move((r?`
28
- `:" ")+u.indentLines(u.containerFlow(l,f.current()),r?mb:O5))),p(),h}}function O5(t,r,i){return r===0?t:mb(t,r,i)}function mb(t,r,i){return(i?"":" ")+t}const D5=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];gb.peek=I5;function M5(){return{canContainEols:["delete"],enter:{strikethrough:B5},exit:{strikethrough:U5}}}function L5(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:D5}],handlers:{delete:gb}}}function B5(t){this.enter({type:"delete",children:[]},t)}function U5(t){this.exit(t)}function gb(t,r,i,l){const o=i.createTracker(l),u=i.enter("strikethrough");let c=o.move("~~");return c+=i.containerPhrasing(t,{...o.current(),before:c,after:"~"}),c+=o.move("~~"),u(),c}function I5(){return"~"}function H5(t){return t.length}function P5(t,r){const i=r||{},l=(i.align||[]).concat(),o=i.stringLength||H5,u=[],c=[],f=[],h=[];let p=0,b=-1;for(;++b<t.length;){const v=[],k=[];let S=-1;for(t[b].length>p&&(p=t[b].length);++S<t[b].length;){const _=F5(t[b][S]);if(i.alignDelimiters!==!1){const N=o(_);k[S]=N,(h[S]===void 0||N>h[S])&&(h[S]=N)}v.push(_)}c[b]=v,f[b]=k}let x=-1;if(typeof l=="object"&&"length"in l)for(;++x<p;)u[x]=Yg(l[x]);else{const v=Yg(l);for(;++x<p;)u[x]=v}x=-1;const w=[],y=[];for(;++x<p;){const v=u[x];let k="",S="";v===99?(k=":",S=":"):v===108?k=":":v===114&&(S=":");let _=i.alignDelimiters===!1?1:Math.max(1,h[x]-k.length-S.length);const N=k+"-".repeat(_)+S;i.alignDelimiters!==!1&&(_=k.length+_+S.length,_>h[x]&&(h[x]=_),y[x]=_),w[x]=N}c.splice(1,0,w),f.splice(1,0,y),b=-1;const j=[];for(;++b<c.length;){const v=c[b],k=f[b];x=-1;const S=[];for(;++x<p;){const _=v[x]||"";let N="",B="";if(i.alignDelimiters!==!1){const D=h[x]-(k[x]||0),z=u[x];z===114?N=" ".repeat(D):z===99?D%2?(N=" ".repeat(D/2+.5),B=" ".repeat(D/2-.5)):(N=" ".repeat(D/2),B=N):B=" ".repeat(D)}i.delimiterStart!==!1&&!x&&S.push("|"),i.padding!==!1&&!(i.alignDelimiters===!1&&_==="")&&(i.delimiterStart!==!1||x)&&S.push(" "),i.alignDelimiters!==!1&&S.push(N),S.push(_),i.alignDelimiters!==!1&&S.push(B),i.padding!==!1&&S.push(" "),(i.delimiterEnd!==!1||x!==p-1)&&S.push("|")}j.push(i.delimiterEnd===!1?S.join("").replace(/ +$/,""):S.join(""))}return j.join(`
29
- `)}function F5(t){return t==null?"":String(t)}function Yg(t){const r=typeof t=="string"?t.codePointAt(0):0;return r===67||r===99?99:r===76||r===108?108:r===82||r===114?114:0}function q5(t,r,i,l){const o=i.enter("blockquote"),u=i.createTracker(l);u.move("> "),u.shift(2);const c=i.indentLines(i.containerFlow(t,u.current()),V5);return o(),c}function V5(t,r,i){return">"+(i?"":" ")+t}function Y5(t,r){return Gg(t,r.inConstruct,!0)&&!Gg(t,r.notInConstruct,!1)}function Gg(t,r,i){if(typeof r=="string"&&(r=[r]),!r||r.length===0)return i;let l=-1;for(;++l<r.length;)if(t.includes(r[l]))return!0;return!1}function Kg(t,r,i,l){let o=-1;for(;++o<i.unsafe.length;)if(i.unsafe[o].character===`
30
- `&&Y5(i.stack,i.unsafe[o]))return/[ \t]/.test(l.before)?"":" ";return`\\
31
- `}function G5(t,r){const i=String(t);let l=i.indexOf(r),o=l,u=0,c=0;if(typeof r!="string")throw new TypeError("Expected substring");for(;l!==-1;)l===o?++u>c&&(c=u):u=1,o=l+r.length,l=i.indexOf(r,o);return c}function K5(t,r){return!!(r.options.fences===!1&&t.value&&!t.lang&&/[^ \r\n]/.test(t.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(t.value))}function $5(t){const r=t.options.fence||"`";if(r!=="`"&&r!=="~")throw new Error("Cannot serialize code with `"+r+"` for `options.fence`, expected `` ` `` or `~`");return r}function X5(t,r,i,l){const o=$5(i),u=t.value||"",c=o==="`"?"GraveAccent":"Tilde";if(K5(t,i)){const x=i.enter("codeIndented"),w=i.indentLines(u,Z5);return x(),w}const f=i.createTracker(l),h=o.repeat(Math.max(G5(u,o)+1,3)),p=i.enter("codeFenced");let b=f.move(h);if(t.lang){const x=i.enter(`codeFencedLang${c}`);b+=f.move(i.safe(t.lang,{before:b,after:" ",encode:["`"],...f.current()})),x()}if(t.lang&&t.meta){const x=i.enter(`codeFencedMeta${c}`);b+=f.move(" "),b+=f.move(i.safe(t.meta,{before:b,after:`
32
- `,encode:["`"],...f.current()})),x()}return b+=f.move(`
33
- `),u&&(b+=f.move(u+`
34
- `)),b+=f.move(h),p(),b}function Z5(t,r,i){return(i?"":" ")+t}function Id(t){const r=t.options.quote||'"';if(r!=='"'&&r!=="'")throw new Error("Cannot serialize title with `"+r+"` for `options.quote`, expected `\"`, or `'`");return r}function Q5(t,r,i,l){const o=Id(i),u=o==='"'?"Quote":"Apostrophe",c=i.enter("definition");let f=i.enter("label");const h=i.createTracker(l);let p=h.move("[");return p+=h.move(i.safe(i.associationId(t),{before:p,after:"]",...h.current()})),p+=h.move("]: "),f(),!t.url||/[\0- \u007F]/.test(t.url)?(f=i.enter("destinationLiteral"),p+=h.move("<"),p+=h.move(i.safe(t.url,{before:p,after:">",...h.current()})),p+=h.move(">")):(f=i.enter("destinationRaw"),p+=h.move(i.safe(t.url,{before:p,after:t.title?" ":`
35
- `,...h.current()}))),f(),t.title&&(f=i.enter(`title${u}`),p+=h.move(" "+o),p+=h.move(i.safe(t.title,{before:p,after:o,...h.current()})),p+=h.move(o),f()),c(),p}function J5(t){const r=t.options.emphasis||"*";if(r!=="*"&&r!=="_")throw new Error("Cannot serialize emphasis with `"+r+"` for `options.emphasis`, expected `*`, or `_`");return r}function cl(t){return"&#x"+t.toString(16).toUpperCase()+";"}function Ws(t,r,i){const l=Qa(t),o=Qa(r);return l===void 0?o===void 0?i==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:o===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:l===1?o===void 0?{inside:!1,outside:!1}:o===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:o===void 0?{inside:!1,outside:!1}:o===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}xb.peek=W5;function xb(t,r,i,l){const o=J5(i),u=i.enter("emphasis"),c=i.createTracker(l),f=c.move(o);let h=c.move(i.containerPhrasing(t,{after:o,before:f,...c.current()}));const p=h.charCodeAt(0),b=Ws(l.before.charCodeAt(l.before.length-1),p,o);b.inside&&(h=cl(p)+h.slice(1));const x=h.charCodeAt(h.length-1),w=Ws(l.after.charCodeAt(0),x,o);w.inside&&(h=h.slice(0,-1)+cl(x));const y=c.move(o);return u(),i.attentionEncodeSurroundingInfo={after:w.outside,before:b.outside},f+h+y}function W5(t,r,i){return i.options.emphasis||"*"}function e_(t,r){let i=!1;return Bd(t,function(l){if("value"in l&&/\r?\n|\r/.test(l.value)||l.type==="break")return i=!0,dd}),!!((!t.depth||t.depth<3)&&zd(t)&&(r.options.setext||i))}function t_(t,r,i,l){const o=Math.max(Math.min(6,t.depth||1),1),u=i.createTracker(l);if(e_(t,i)){const b=i.enter("headingSetext"),x=i.enter("phrasing"),w=i.containerPhrasing(t,{...u.current(),before:`
36
- `,after:`
37
- `});return x(),b(),w+`
38
- `+(o===1?"=":"-").repeat(w.length-(Math.max(w.lastIndexOf("\r"),w.lastIndexOf(`
39
- `))+1))}const c="#".repeat(o),f=i.enter("headingAtx"),h=i.enter("phrasing");u.move(c+" ");let p=i.containerPhrasing(t,{before:"# ",after:`
40
- `,...u.current()});return/^[\t ]/.test(p)&&(p=cl(p.charCodeAt(0))+p.slice(1)),p=p?c+" "+p:c,i.options.closeAtx&&(p+=" "+c),h(),f(),p}bb.peek=n_;function bb(t){return t.value||""}function n_(){return"<"}yb.peek=i_;function yb(t,r,i,l){const o=Id(i),u=o==='"'?"Quote":"Apostrophe",c=i.enter("image");let f=i.enter("label");const h=i.createTracker(l);let p=h.move("![");return p+=h.move(i.safe(t.alt,{before:p,after:"]",...h.current()})),p+=h.move("]("),f(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(f=i.enter("destinationLiteral"),p+=h.move("<"),p+=h.move(i.safe(t.url,{before:p,after:">",...h.current()})),p+=h.move(">")):(f=i.enter("destinationRaw"),p+=h.move(i.safe(t.url,{before:p,after:t.title?" ":")",...h.current()}))),f(),t.title&&(f=i.enter(`title${u}`),p+=h.move(" "+o),p+=h.move(i.safe(t.title,{before:p,after:o,...h.current()})),p+=h.move(o),f()),p+=h.move(")"),c(),p}function i_(){return"!"}vb.peek=a_;function vb(t,r,i,l){const o=t.referenceType,u=i.enter("imageReference");let c=i.enter("label");const f=i.createTracker(l);let h=f.move("![");const p=i.safe(t.alt,{before:h,after:"]",...f.current()});h+=f.move(p+"]["),c();const b=i.stack;i.stack=[],c=i.enter("reference");const x=i.safe(i.associationId(t),{before:h,after:"]",...f.current()});return c(),i.stack=b,u(),o==="full"||!p||p!==x?h+=f.move(x+"]"):o==="shortcut"?h=h.slice(0,-1):h+=f.move("]"),h}function a_(){return"!"}wb.peek=r_;function wb(t,r,i){let l=t.value||"",o="`",u=-1;for(;new RegExp("(^|[^`])"+o+"([^`]|$)").test(l);)o+="`";for(/[^ \r\n]/.test(l)&&(/^[ \r\n]/.test(l)&&/[ \r\n]$/.test(l)||/^`|`$/.test(l))&&(l=" "+l+" ");++u<i.unsafe.length;){const c=i.unsafe[u],f=i.compilePattern(c);let h;if(c.atBreak)for(;h=f.exec(l);){let p=h.index;l.charCodeAt(p)===10&&l.charCodeAt(p-1)===13&&p--,l=l.slice(0,p)+" "+l.slice(h.index+1)}}return o+l+o}function r_(){return"`"}function Sb(t,r){const i=zd(t);return!!(!r.options.resourceLink&&t.url&&!t.title&&t.children&&t.children.length===1&&t.children[0].type==="text"&&(i===t.url||"mailto:"+i===t.url)&&/^[a-z][a-z+.-]+:/i.test(t.url)&&!/[\0- <>\u007F]/.test(t.url))}kb.peek=l_;function kb(t,r,i,l){const o=Id(i),u=o==='"'?"Quote":"Apostrophe",c=i.createTracker(l);let f,h;if(Sb(t,i)){const b=i.stack;i.stack=[],f=i.enter("autolink");let x=c.move("<");return x+=c.move(i.containerPhrasing(t,{before:x,after:">",...c.current()})),x+=c.move(">"),f(),i.stack=b,x}f=i.enter("link"),h=i.enter("label");let p=c.move("[");return p+=c.move(i.containerPhrasing(t,{before:p,after:"](",...c.current()})),p+=c.move("]("),h(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(h=i.enter("destinationLiteral"),p+=c.move("<"),p+=c.move(i.safe(t.url,{before:p,after:">",...c.current()})),p+=c.move(">")):(h=i.enter("destinationRaw"),p+=c.move(i.safe(t.url,{before:p,after:t.title?" ":")",...c.current()}))),h(),t.title&&(h=i.enter(`title${u}`),p+=c.move(" "+o),p+=c.move(i.safe(t.title,{before:p,after:o,...c.current()})),p+=c.move(o),h()),p+=c.move(")"),f(),p}function l_(t,r,i){return Sb(t,i)?"<":"["}jb.peek=s_;function jb(t,r,i,l){const o=t.referenceType,u=i.enter("linkReference");let c=i.enter("label");const f=i.createTracker(l);let h=f.move("[");const p=i.containerPhrasing(t,{before:h,after:"]",...f.current()});h+=f.move(p+"]["),c();const b=i.stack;i.stack=[],c=i.enter("reference");const x=i.safe(i.associationId(t),{before:h,after:"]",...f.current()});return c(),i.stack=b,u(),o==="full"||!p||p!==x?h+=f.move(x+"]"):o==="shortcut"?h=h.slice(0,-1):h+=f.move("]"),h}function s_(){return"["}function Hd(t){const r=t.options.bullet||"*";if(r!=="*"&&r!=="+"&&r!=="-")throw new Error("Cannot serialize items with `"+r+"` for `options.bullet`, expected `*`, `+`, or `-`");return r}function o_(t){const r=Hd(t),i=t.options.bulletOther;if(!i)return r==="*"?"-":"*";if(i!=="*"&&i!=="+"&&i!=="-")throw new Error("Cannot serialize items with `"+i+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(i===r)throw new Error("Expected `bullet` (`"+r+"`) and `bulletOther` (`"+i+"`) to be different");return i}function u_(t){const r=t.options.bulletOrdered||".";if(r!=="."&&r!==")")throw new Error("Cannot serialize items with `"+r+"` for `options.bulletOrdered`, expected `.` or `)`");return r}function _b(t){const r=t.options.rule||"*";if(r!=="*"&&r!=="-"&&r!=="_")throw new Error("Cannot serialize rules with `"+r+"` for `options.rule`, expected `*`, `-`, or `_`");return r}function c_(t,r,i,l){const o=i.enter("list"),u=i.bulletCurrent;let c=t.ordered?u_(i):Hd(i);const f=t.ordered?c==="."?")":".":o_(i);let h=r&&i.bulletLastUsed?c===i.bulletLastUsed:!1;if(!t.ordered){const b=t.children?t.children[0]:void 0;if((c==="*"||c==="-")&&b&&(!b.children||!b.children[0])&&i.stack[i.stack.length-1]==="list"&&i.stack[i.stack.length-2]==="listItem"&&i.stack[i.stack.length-3]==="list"&&i.stack[i.stack.length-4]==="listItem"&&i.indexStack[i.indexStack.length-1]===0&&i.indexStack[i.indexStack.length-2]===0&&i.indexStack[i.indexStack.length-3]===0&&(h=!0),_b(i)===c&&b){let x=-1;for(;++x<t.children.length;){const w=t.children[x];if(w&&w.type==="listItem"&&w.children&&w.children[0]&&w.children[0].type==="thematicBreak"){h=!0;break}}}}h&&(c=f),i.bulletCurrent=c;const p=i.containerFlow(t,l);return i.bulletLastUsed=c,i.bulletCurrent=u,o(),p}function d_(t){const r=t.options.listItemIndent||"one";if(r!=="tab"&&r!=="one"&&r!=="mixed")throw new Error("Cannot serialize items with `"+r+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return r}function f_(t,r,i,l){const o=d_(i);let u=i.bulletCurrent||Hd(i);r&&r.type==="list"&&r.ordered&&(u=(typeof r.start=="number"&&r.start>-1?r.start:1)+(i.options.incrementListMarker===!1?0:r.children.indexOf(t))+u);let c=u.length+1;(o==="tab"||o==="mixed"&&(r&&r.type==="list"&&r.spread||t.spread))&&(c=Math.ceil(c/4)*4);const f=i.createTracker(l);f.move(u+" ".repeat(c-u.length)),f.shift(c);const h=i.enter("listItem"),p=i.indentLines(i.containerFlow(t,f.current()),b);return h(),p;function b(x,w,y){return w?(y?"":" ".repeat(c))+x:(y?u:u+" ".repeat(c-u.length))+x}}function h_(t,r,i,l){const o=i.enter("paragraph"),u=i.enter("phrasing"),c=i.containerPhrasing(t,l);return u(),o(),c}const p_=so(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function m_(t,r,i,l){return(t.children.some(function(c){return p_(c)})?i.containerPhrasing:i.containerFlow).call(i,t,l)}function g_(t){const r=t.options.strong||"*";if(r!=="*"&&r!=="_")throw new Error("Cannot serialize strong with `"+r+"` for `options.strong`, expected `*`, or `_`");return r}Cb.peek=x_;function Cb(t,r,i,l){const o=g_(i),u=i.enter("strong"),c=i.createTracker(l),f=c.move(o+o);let h=c.move(i.containerPhrasing(t,{after:o,before:f,...c.current()}));const p=h.charCodeAt(0),b=Ws(l.before.charCodeAt(l.before.length-1),p,o);b.inside&&(h=cl(p)+h.slice(1));const x=h.charCodeAt(h.length-1),w=Ws(l.after.charCodeAt(0),x,o);w.inside&&(h=h.slice(0,-1)+cl(x));const y=c.move(o+o);return u(),i.attentionEncodeSurroundingInfo={after:w.outside,before:b.outside},f+h+y}function x_(t,r,i){return i.options.strong||"*"}function b_(t,r,i,l){return i.safe(t.value,l)}function y_(t){const r=t.options.ruleRepetition||3;if(r<3)throw new Error("Cannot serialize rules with repetition `"+r+"` for `options.ruleRepetition`, expected `3` or more");return r}function v_(t,r,i){const l=(_b(i)+(i.options.ruleSpaces?" ":"")).repeat(y_(i));return i.options.ruleSpaces?l.slice(0,-1):l}const Nb={blockquote:q5,break:Kg,code:X5,definition:Q5,emphasis:xb,hardBreak:Kg,heading:t_,html:bb,image:yb,imageReference:vb,inlineCode:wb,link:kb,linkReference:jb,list:c_,listItem:f_,paragraph:h_,root:m_,strong:Cb,text:b_,thematicBreak:v_};function w_(){return{enter:{table:S_,tableData:$g,tableHeader:$g,tableRow:j_},exit:{codeText:__,table:k_,tableData:Jc,tableHeader:Jc,tableRow:Jc}}}function S_(t){const r=t._align;this.enter({type:"table",align:r.map(function(i){return i==="none"?null:i}),children:[]},t),this.data.inTable=!0}function k_(t){this.exit(t),this.data.inTable=void 0}function j_(t){this.enter({type:"tableRow",children:[]},t)}function Jc(t){this.exit(t)}function $g(t){this.enter({type:"tableCell",children:[]},t)}function __(t){let r=this.resume();this.data.inTable&&(r=r.replace(/\\([\\|])/g,C_));const i=this.stack[this.stack.length-1];i.type,i.value=r,this.exit(t)}function C_(t,r){return r==="|"?r:t}function N_(t){const r=t||{},i=r.tableCellPadding,l=r.tablePipeAlign,o=r.stringLength,u=i?" ":"|";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:w,table:c,tableCell:h,tableRow:f}};function c(y,j,v,k){return p(b(y,v,k),y.align)}function f(y,j,v,k){const S=x(y,v,k),_=p([S]);return _.slice(0,_.indexOf(`
42
- `))}function h(y,j,v,k){const S=v.enter("tableCell"),_=v.enter("phrasing"),N=v.containerPhrasing(y,{...k,before:u,after:u});return _(),S(),N}function p(y,j){return P5(y,{align:j,alignDelimiters:l,padding:i,stringLength:o})}function b(y,j,v){const k=y.children;let S=-1;const _=[],N=j.enter("table");for(;++S<k.length;)_[S]=x(k[S],j,v);return N(),_}function x(y,j,v){const k=y.children;let S=-1;const _=[],N=j.enter("tableRow");for(;++S<k.length;)_[S]=h(k[S],y,j,v);return N(),_}function w(y,j,v){let k=Nb.inlineCode(y,j,v);return v.stack.includes("tableCell")&&(k=k.replace(/\|/g,"\\$&")),k}}function E_(){return{exit:{taskListCheckValueChecked:Xg,taskListCheckValueUnchecked:Xg,paragraph:z_}}}function A_(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:T_}}}function Xg(t){const r=this.stack[this.stack.length-2];r.type,r.checked=t.type==="taskListCheckValueChecked"}function z_(t){const r=this.stack[this.stack.length-2];if(r&&r.type==="listItem"&&typeof r.checked=="boolean"){const i=this.stack[this.stack.length-1];i.type;const l=i.children[0];if(l&&l.type==="text"){const o=r.children;let u=-1,c;for(;++u<o.length;){const f=o[u];if(f.type==="paragraph"){c=f;break}}c===i&&(l.value=l.value.slice(1),l.value.length===0?i.children.shift():i.position&&l.position&&typeof l.position.start.offset=="number"&&(l.position.start.column++,l.position.start.offset++,i.position.start=Object.assign({},l.position.start)))}}this.exit(t)}function T_(t,r,i,l){const o=t.children[0],u=typeof t.checked=="boolean"&&o&&o.type==="paragraph",c="["+(t.checked?"x":" ")+"] ",f=i.createTracker(l);u&&f.move(c);let h=Nb.listItem(t,r,i,{...l,...f.current()});return u&&(h=h.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,p)),h;function p(b){return b+c}}function R_(){return[c5(),T5(),M5(),w_(),E_()]}function O_(t){return{extensions:[d5(),R5(t),L5(),N_(t),A_()]}}const D_={tokenize:H_,partial:!0},Eb={tokenize:P_,partial:!0},Ab={tokenize:F_,partial:!0},zb={tokenize:q_,partial:!0},M_={tokenize:V_,partial:!0},Tb={name:"wwwAutolink",tokenize:U_,previous:Ob},Rb={name:"protocolAutolink",tokenize:I_,previous:Db},fi={name:"emailAutolink",tokenize:B_,previous:Mb},qn={};function L_(){return{text:qn}}let ra=48;for(;ra<123;)qn[ra]=fi,ra++,ra===58?ra=65:ra===91&&(ra=97);qn[43]=fi;qn[45]=fi;qn[46]=fi;qn[95]=fi;qn[72]=[fi,Rb];qn[104]=[fi,Rb];qn[87]=[fi,Tb];qn[119]=[fi,Tb];function B_(t,r,i){const l=this;let o,u;return c;function c(x){return!md(x)||!Mb.call(l,l.previous)||Pd(l.events)?i(x):(t.enter("literalAutolink"),t.enter("literalAutolinkEmail"),f(x))}function f(x){return md(x)?(t.consume(x),f):x===64?(t.consume(x),h):i(x)}function h(x){return x===46?t.check(M_,b,p)(x):x===45||x===95||Vt(x)?(u=!0,t.consume(x),h):b(x)}function p(x){return t.consume(x),o=!0,h}function b(x){return u&&o&&$t(l.previous)?(t.exit("literalAutolinkEmail"),t.exit("literalAutolink"),r(x)):i(x)}}function U_(t,r,i){const l=this;return o;function o(c){return c!==87&&c!==119||!Ob.call(l,l.previous)||Pd(l.events)?i(c):(t.enter("literalAutolink"),t.enter("literalAutolinkWww"),t.check(D_,t.attempt(Eb,t.attempt(Ab,u),i),i)(c))}function u(c){return t.exit("literalAutolinkWww"),t.exit("literalAutolink"),r(c)}}function I_(t,r,i){const l=this;let o="",u=!1;return c;function c(x){return(x===72||x===104)&&Db.call(l,l.previous)&&!Pd(l.events)?(t.enter("literalAutolink"),t.enter("literalAutolinkHttp"),o+=String.fromCodePoint(x),t.consume(x),f):i(x)}function f(x){if($t(x)&&o.length<5)return o+=String.fromCodePoint(x),t.consume(x),f;if(x===58){const w=o.toLowerCase();if(w==="http"||w==="https")return t.consume(x),h}return i(x)}function h(x){return x===47?(t.consume(x),u?p:(u=!0,h)):i(x)}function p(x){return x===null||Zs(x)||vt(x)||la(x)||ao(x)?i(x):t.attempt(Eb,t.attempt(Ab,b),i)(x)}function b(x){return t.exit("literalAutolinkHttp"),t.exit("literalAutolink"),r(x)}}function H_(t,r,i){let l=0;return o;function o(c){return(c===87||c===119)&&l<3?(l++,t.consume(c),o):c===46&&l===3?(t.consume(c),u):i(c)}function u(c){return c===null?i(c):r(c)}}function P_(t,r,i){let l,o,u;return c;function c(p){return p===46||p===95?t.check(zb,h,f)(p):p===null||vt(p)||la(p)||p!==45&&ao(p)?h(p):(u=!0,t.consume(p),c)}function f(p){return p===95?l=!0:(o=l,l=void 0),t.consume(p),c}function h(p){return o||l||!u?i(p):r(p)}}function F_(t,r){let i=0,l=0;return o;function o(c){return c===40?(i++,t.consume(c),o):c===41&&l<i?u(c):c===33||c===34||c===38||c===39||c===41||c===42||c===44||c===46||c===58||c===59||c===60||c===63||c===93||c===95||c===126?t.check(zb,r,u)(c):c===null||vt(c)||la(c)?r(c):(t.consume(c),o)}function u(c){return c===41&&l++,t.consume(c),o}}function q_(t,r,i){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?(t.consume(f),l):f===38?(t.consume(f),u):f===93?(t.consume(f),o):f===60||f===null||vt(f)||la(f)?r(f):i(f)}function o(f){return f===null||f===40||f===91||vt(f)||la(f)?r(f):l(f)}function u(f){return $t(f)?c(f):i(f)}function c(f){return f===59?(t.consume(f),l):$t(f)?(t.consume(f),c):i(f)}}function V_(t,r,i){return l;function l(u){return t.consume(u),o}function o(u){return Vt(u)?i(u):r(u)}}function Ob(t){return t===null||t===40||t===42||t===95||t===91||t===93||t===126||vt(t)}function Db(t){return!$t(t)}function Mb(t){return!(t===47||md(t))}function md(t){return t===43||t===45||t===46||t===95||Vt(t)}function Pd(t){let r=t.length,i=!1;for(;r--;){const l=t[r][1];if((l.type==="labelLink"||l.type==="labelImage")&&!l._balanced){i=!0;break}if(l._gfmAutolinkLiteralWalkedInto){i=!1;break}}return t.length>0&&!i&&(t[t.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),i}const Y_={tokenize:W_,partial:!0};function G_(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:Z_,continuation:{tokenize:Q_},exit:J_}},text:{91:{name:"gfmFootnoteCall",tokenize:X_},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:K_,resolveTo:$_}}}}function K_(t,r,i){const l=this;let o=l.events.length;const u=l.parser.gfmFootnotes||(l.parser.gfmFootnotes=[]);let c;for(;o--;){const h=l.events[o][1];if(h.type==="labelImage"){c=h;break}if(h.type==="gfmFootnoteCall"||h.type==="labelLink"||h.type==="label"||h.type==="image"||h.type==="link")break}return f;function f(h){if(!c||!c._balanced)return i(h);const p=Rn(l.sliceSerialize({start:c.end,end:l.now()}));return p.codePointAt(0)!==94||!u.includes(p.slice(1))?i(h):(t.enter("gfmFootnoteCallLabelMarker"),t.consume(h),t.exit("gfmFootnoteCallLabelMarker"),r(h))}}function $_(t,r){let i=t.length;for(;i--;)if(t[i][1].type==="labelImage"&&t[i][0]==="enter"){t[i][1];break}t[i+1][1].type="data",t[i+3][1].type="gfmFootnoteCallLabelMarker";const l={type:"gfmFootnoteCall",start:Object.assign({},t[i+3][1].start),end:Object.assign({},t[t.length-1][1].end)},o={type:"gfmFootnoteCallMarker",start:Object.assign({},t[i+3][1].end),end:Object.assign({},t[i+3][1].end)};o.end.column++,o.end.offset++,o.end._bufferIndex++;const u={type:"gfmFootnoteCallString",start:Object.assign({},o.end),end:Object.assign({},t[t.length-1][1].start)},c={type:"chunkString",contentType:"string",start:Object.assign({},u.start),end:Object.assign({},u.end)},f=[t[i+1],t[i+2],["enter",l,r],t[i+3],t[i+4],["enter",o,r],["exit",o,r],["enter",u,r],["enter",c,r],["exit",c,r],["exit",u,r],t[t.length-2],t[t.length-1],["exit",l,r]];return t.splice(i,t.length-i+1,...f),t}function X_(t,r,i){const l=this,o=l.parser.gfmFootnotes||(l.parser.gfmFootnotes=[]);let u=0,c;return f;function f(x){return t.enter("gfmFootnoteCall"),t.enter("gfmFootnoteCallLabelMarker"),t.consume(x),t.exit("gfmFootnoteCallLabelMarker"),h}function h(x){return x!==94?i(x):(t.enter("gfmFootnoteCallMarker"),t.consume(x),t.exit("gfmFootnoteCallMarker"),t.enter("gfmFootnoteCallString"),t.enter("chunkString").contentType="string",p)}function p(x){if(u>999||x===93&&!c||x===null||x===91||vt(x))return i(x);if(x===93){t.exit("chunkString");const w=t.exit("gfmFootnoteCallString");return o.includes(Rn(l.sliceSerialize(w)))?(t.enter("gfmFootnoteCallLabelMarker"),t.consume(x),t.exit("gfmFootnoteCallLabelMarker"),t.exit("gfmFootnoteCall"),r):i(x)}return vt(x)||(c=!0),u++,t.consume(x),x===92?b:p}function b(x){return x===91||x===92||x===93?(t.consume(x),u++,p):p(x)}}function Z_(t,r,i){const l=this,o=l.parser.gfmFootnotes||(l.parser.gfmFootnotes=[]);let u,c=0,f;return h;function h(j){return t.enter("gfmFootnoteDefinition")._container=!0,t.enter("gfmFootnoteDefinitionLabel"),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(j),t.exit("gfmFootnoteDefinitionLabelMarker"),p}function p(j){return j===94?(t.enter("gfmFootnoteDefinitionMarker"),t.consume(j),t.exit("gfmFootnoteDefinitionMarker"),t.enter("gfmFootnoteDefinitionLabelString"),t.enter("chunkString").contentType="string",b):i(j)}function b(j){if(c>999||j===93&&!f||j===null||j===91||vt(j))return i(j);if(j===93){t.exit("chunkString");const v=t.exit("gfmFootnoteDefinitionLabelString");return u=Rn(l.sliceSerialize(v)),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(j),t.exit("gfmFootnoteDefinitionLabelMarker"),t.exit("gfmFootnoteDefinitionLabel"),w}return vt(j)||(f=!0),c++,t.consume(j),j===92?x:b}function x(j){return j===91||j===92||j===93?(t.consume(j),c++,b):b(j)}function w(j){return j===58?(t.enter("definitionMarker"),t.consume(j),t.exit("definitionMarker"),o.includes(u)||o.push(u),lt(t,y,"gfmFootnoteDefinitionWhitespace")):i(j)}function y(j){return r(j)}}function Q_(t,r,i){return t.check(gl,r,t.attempt(Y_,r,i))}function J_(t){t.exit("gfmFootnoteDefinition")}function W_(t,r,i){const l=this;return lt(t,o,"gfmFootnoteDefinitionIndent",5);function o(u){const c=l.events[l.events.length-1];return c&&c[1].type==="gfmFootnoteDefinitionIndent"&&c[2].sliceSerialize(c[1],!0).length===4?r(u):i(u)}}function eC(t){let i=(t||{}).singleTilde;const l={name:"strikethrough",tokenize:u,resolveAll:o};return i==null&&(i=!0),{text:{126:l},insideSpan:{null:[l]},attentionMarkers:{null:[126]}};function o(c,f){let h=-1;for(;++h<c.length;)if(c[h][0]==="enter"&&c[h][1].type==="strikethroughSequenceTemporary"&&c[h][1]._close){let p=h;for(;p--;)if(c[p][0]==="exit"&&c[p][1].type==="strikethroughSequenceTemporary"&&c[p][1]._open&&c[h][1].end.offset-c[h][1].start.offset===c[p][1].end.offset-c[p][1].start.offset){c[h][1].type="strikethroughSequence",c[p][1].type="strikethroughSequence";const b={type:"strikethrough",start:Object.assign({},c[p][1].start),end:Object.assign({},c[h][1].end)},x={type:"strikethroughText",start:Object.assign({},c[p][1].end),end:Object.assign({},c[h][1].start)},w=[["enter",b,f],["enter",c[p][1],f],["exit",c[p][1],f],["enter",x,f]],y=f.parser.constructs.insideSpan.null;y&&hn(w,w.length,0,ro(y,c.slice(p+1,h),f)),hn(w,w.length,0,[["exit",x,f],["enter",c[h][1],f],["exit",c[h][1],f],["exit",b,f]]),hn(c,p-1,h-p+3,w),h=p+w.length-2;break}}for(h=-1;++h<c.length;)c[h][1].type==="strikethroughSequenceTemporary"&&(c[h][1].type="data");return c}function u(c,f,h){const p=this.previous,b=this.events;let x=0;return w;function w(j){return p===126&&b[b.length-1][1].type!=="characterEscape"?h(j):(c.enter("strikethroughSequenceTemporary"),y(j))}function y(j){const v=Qa(p);if(j===126)return x>1?h(j):(c.consume(j),x++,y);if(x<2&&!i)return h(j);const k=c.exit("strikethroughSequenceTemporary"),S=Qa(j);return k._open=!S||S===2&&!!v,k._close=!v||v===2&&!!S,f(j)}}}class tC{constructor(){this.map=[]}add(r,i,l){nC(this,r,i,l)}consume(r){if(this.map.sort(function(u,c){return u[0]-c[0]}),this.map.length===0)return;let i=this.map.length;const l=[];for(;i>0;)i-=1,l.push(r.slice(this.map[i][0]+this.map[i][1]),this.map[i][2]),r.length=this.map[i][0];l.push(r.slice()),r.length=0;let o=l.pop();for(;o;){for(const u of o)r.push(u);o=l.pop()}this.map.length=0}}function nC(t,r,i,l){let o=0;if(!(i===0&&l.length===0)){for(;o<t.map.length;){if(t.map[o][0]===r){t.map[o][1]+=i,t.map[o][2].push(...l);return}o+=1}t.map.push([r,i,l])}}function iC(t,r){let i=!1;const l=[];for(;r<t.length;){const o=t[r];if(i){if(o[0]==="enter")o[1].type==="tableContent"&&l.push(t[r+1][1].type==="tableDelimiterMarker"?"left":"none");else if(o[1].type==="tableContent"){if(t[r-1][1].type==="tableDelimiterMarker"){const u=l.length-1;l[u]=l[u]==="left"?"center":"right"}}else if(o[1].type==="tableDelimiterRow")break}else o[0]==="enter"&&o[1].type==="tableDelimiterRow"&&(i=!0);r+=1}return l}function aC(){return{flow:{null:{name:"table",tokenize:rC,resolveAll:lC}}}}function rC(t,r,i){const l=this;let o=0,u=0,c;return f;function f(q){let W=l.events.length-1;for(;W>-1;){const E=l.events[W][1].type;if(E==="lineEnding"||E==="linePrefix")W--;else break}const I=W>-1?l.events[W][1].type:null,X=I==="tableHead"||I==="tableRow"?z:h;return X===z&&l.parser.lazy[l.now().line]?i(q):X(q)}function h(q){return t.enter("tableHead"),t.enter("tableRow"),p(q)}function p(q){return q===124||(c=!0,u+=1),b(q)}function b(q){return q===null?i(q):qe(q)?u>1?(u=0,l.interrupt=!0,t.exit("tableRow"),t.enter("lineEnding"),t.consume(q),t.exit("lineEnding"),y):i(q):tt(q)?lt(t,b,"whitespace")(q):(u+=1,c&&(c=!1,o+=1),q===124?(t.enter("tableCellDivider"),t.consume(q),t.exit("tableCellDivider"),c=!0,b):(t.enter("data"),x(q)))}function x(q){return q===null||q===124||vt(q)?(t.exit("data"),b(q)):(t.consume(q),q===92?w:x)}function w(q){return q===92||q===124?(t.consume(q),x):x(q)}function y(q){return l.interrupt=!1,l.parser.lazy[l.now().line]?i(q):(t.enter("tableDelimiterRow"),c=!1,tt(q)?lt(t,j,"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(q):j(q))}function j(q){return q===45||q===58?k(q):q===124?(c=!0,t.enter("tableCellDivider"),t.consume(q),t.exit("tableCellDivider"),v):D(q)}function v(q){return tt(q)?lt(t,k,"whitespace")(q):k(q)}function k(q){return q===58?(u+=1,c=!0,t.enter("tableDelimiterMarker"),t.consume(q),t.exit("tableDelimiterMarker"),S):q===45?(u+=1,S(q)):q===null||qe(q)?B(q):D(q)}function S(q){return q===45?(t.enter("tableDelimiterFiller"),_(q)):D(q)}function _(q){return q===45?(t.consume(q),_):q===58?(c=!0,t.exit("tableDelimiterFiller"),t.enter("tableDelimiterMarker"),t.consume(q),t.exit("tableDelimiterMarker"),N):(t.exit("tableDelimiterFiller"),N(q))}function N(q){return tt(q)?lt(t,B,"whitespace")(q):B(q)}function B(q){return q===124?j(q):q===null||qe(q)?!c||o!==u?D(q):(t.exit("tableDelimiterRow"),t.exit("tableHead"),r(q)):D(q)}function D(q){return i(q)}function z(q){return t.enter("tableRow"),R(q)}function R(q){return q===124?(t.enter("tableCellDivider"),t.consume(q),t.exit("tableCellDivider"),R):q===null||qe(q)?(t.exit("tableRow"),r(q)):tt(q)?lt(t,R,"whitespace")(q):(t.enter("data"),G(q))}function G(q){return q===null||q===124||vt(q)?(t.exit("data"),R(q)):(t.consume(q),q===92?P:G)}function P(q){return q===92||q===124?(t.consume(q),G):G(q)}}function lC(t,r){let i=-1,l=!0,o=0,u=[0,0,0,0],c=[0,0,0,0],f=!1,h=0,p,b,x;const w=new tC;for(;++i<t.length;){const y=t[i],j=y[1];y[0]==="enter"?j.type==="tableHead"?(f=!1,h!==0&&(Zg(w,r,h,p,b),b=void 0,h=0),p={type:"table",start:Object.assign({},j.start),end:Object.assign({},j.end)},w.add(i,0,[["enter",p,r]])):j.type==="tableRow"||j.type==="tableDelimiterRow"?(l=!0,x=void 0,u=[0,0,0,0],c=[0,i+1,0,0],f&&(f=!1,b={type:"tableBody",start:Object.assign({},j.start),end:Object.assign({},j.end)},w.add(i,0,[["enter",b,r]])),o=j.type==="tableDelimiterRow"?2:b?3:1):o&&(j.type==="data"||j.type==="tableDelimiterMarker"||j.type==="tableDelimiterFiller")?(l=!1,c[2]===0&&(u[1]!==0&&(c[0]=c[1],x=Fs(w,r,u,o,void 0,x),u=[0,0,0,0]),c[2]=i)):j.type==="tableCellDivider"&&(l?l=!1:(u[1]!==0&&(c[0]=c[1],x=Fs(w,r,u,o,void 0,x)),u=c,c=[u[1],i,0,0])):j.type==="tableHead"?(f=!0,h=i):j.type==="tableRow"||j.type==="tableDelimiterRow"?(h=i,u[1]!==0?(c[0]=c[1],x=Fs(w,r,u,o,i,x)):c[1]!==0&&(x=Fs(w,r,c,o,i,x)),o=0):o&&(j.type==="data"||j.type==="tableDelimiterMarker"||j.type==="tableDelimiterFiller")&&(c[3]=i)}for(h!==0&&Zg(w,r,h,p,b),w.consume(r.events),i=-1;++i<r.events.length;){const y=r.events[i];y[0]==="enter"&&y[1].type==="table"&&(y[1]._align=iC(r.events,i))}return t}function Fs(t,r,i,l,o,u){const c=l===1?"tableHeader":l===2?"tableDelimiter":"tableData",f="tableContent";i[0]!==0&&(u.end=Object.assign({},Xa(r.events,i[0])),t.add(i[0],0,[["exit",u,r]]));const h=Xa(r.events,i[1]);if(u={type:c,start:Object.assign({},h),end:Object.assign({},h)},t.add(i[1],0,[["enter",u,r]]),i[2]!==0){const p=Xa(r.events,i[2]),b=Xa(r.events,i[3]),x={type:f,start:Object.assign({},p),end:Object.assign({},b)};if(t.add(i[2],0,[["enter",x,r]]),l!==2){const w=r.events[i[2]],y=r.events[i[3]];if(w[1].end=Object.assign({},y[1].end),w[1].type="chunkText",w[1].contentType="text",i[3]>i[2]+1){const j=i[2]+1,v=i[3]-i[2]-1;t.add(j,v,[])}}t.add(i[3]+1,0,[["exit",x,r]])}return o!==void 0&&(u.end=Object.assign({},Xa(r.events,o)),t.add(o,0,[["exit",u,r]]),u=void 0),u}function Zg(t,r,i,l,o){const u=[],c=Xa(r.events,i);o&&(o.end=Object.assign({},c),u.push(["exit",o,r])),l.end=Object.assign({},c),u.push(["exit",l,r]),t.add(i+1,0,u)}function Xa(t,r){const i=t[r],l=i[0]==="enter"?"start":"end";return i[1][l]}const sC={name:"tasklistCheck",tokenize:uC};function oC(){return{text:{91:sC}}}function uC(t,r,i){const l=this;return o;function o(h){return l.previous!==null||!l._gfmTasklistFirstContentOfListItem?i(h):(t.enter("taskListCheck"),t.enter("taskListCheckMarker"),t.consume(h),t.exit("taskListCheckMarker"),u)}function u(h){return vt(h)?(t.enter("taskListCheckValueUnchecked"),t.consume(h),t.exit("taskListCheckValueUnchecked"),c):h===88||h===120?(t.enter("taskListCheckValueChecked"),t.consume(h),t.exit("taskListCheckValueChecked"),c):i(h)}function c(h){return h===93?(t.enter("taskListCheckMarker"),t.consume(h),t.exit("taskListCheckMarker"),t.exit("taskListCheck"),f):i(h)}function f(h){return qe(h)?r(h):tt(h)?t.check({tokenize:cC},r,i)(h):i(h)}}function cC(t,r,i){return lt(t,l,"whitespace");function l(o){return o===null?i(o):r(o)}}function dC(t){return Gx([L_(),G_(),eC(t),aC(),oC()])}const fC={};function hC(t){const r=this,i=t||fC,l=r.data(),o=l.micromarkExtensions||(l.micromarkExtensions=[]),u=l.fromMarkdownExtensions||(l.fromMarkdownExtensions=[]),c=l.toMarkdownExtensions||(l.toMarkdownExtensions=[]);o.push(dC(i)),u.push(R_()),c.push(O_(i))}const Qg={default:{bg:"rgba(255,255,255,0.07)",border:"rgba(255,255,255,0.18)",header:"rgba(255,255,255,0.10)"},yellow:{bg:"rgba(250,204,21,0.14)",border:"rgba(250,204,21,0.40)",header:"rgba(250,204,21,0.20)"},pink:{bg:"rgba(236,72,153,0.14)",border:"rgba(236,72,153,0.40)",header:"rgba(236,72,153,0.20)"},green:{bg:"rgba(34,197,94,0.14)",border:"rgba(34,197,94,0.40)",header:"rgba(34,197,94,0.20)"},purple:{bg:"rgba(168,85,247,0.14)",border:"rgba(168,85,247,0.40)",header:"rgba(168,85,247,0.20)"}},Jg={default:"#ffffff",yellow:"#facc15",pink:"#ec4899",green:"#22c55e",purple:"#a855f7"},pC=["default","yellow","pink","green","purple"],mC=({note:t,canvasScale:r,isSelected:i,onUpdate:l,onDelete:o,onDuplicate:u})=>{const[c,f]=T.useState(t.content===""),[h,p]=T.useState(t.content),[b,x]=T.useState(!1),[w,y]=T.useState(null),j=T.useRef(null),v=T.useRef(null),k=T.useRef(null),S=Qg[t.color]||Qg.default;T.useEffect(()=>{c&&j.current&&(j.current.focus(),j.current.select())},[c]);const _=T.useCallback(P=>{P.stopPropagation(),P.preventDefault(),v.current={startX:P.clientX,startY:P.clientY,origX:t.x,origY:t.y},P.target.setPointerCapture(P.pointerId)},[t.x,t.y]),N=T.useCallback(P=>{if(P.stopPropagation(),!v.current)return;const q=(P.clientX-v.current.startX)/r,W=(P.clientY-v.current.startY)/r;l(t.id,{x:Math.round(v.current.origX+q),y:Math.round(v.current.origY+W)})},[r,t.id,l]),B=T.useCallback(P=>{P.stopPropagation(),v.current=null},[]),D=T.useCallback(P=>{P.stopPropagation(),P.preventDefault(),k.current={startX:P.clientX,startY:P.clientY,origW:t.width,origH:t.height},P.target.setPointerCapture(P.pointerId)},[t.width,t.height]),z=T.useCallback(P=>{if(P.stopPropagation(),!k.current)return;const q=(P.clientX-k.current.startX)/r,W=(P.clientY-k.current.startY)/r;l(t.id,{width:Math.round(Math.max(160,k.current.origW+q)),height:Math.round(Math.max(100,k.current.origH+W))})},[r,t.id,l]),R=T.useCallback(P=>{P.stopPropagation(),k.current=null},[]),G=T.useCallback(()=>{l(t.id,{content:h}),f(!1)},[t.id,h,l]);return d.jsxs(d.Fragment,{children:[d.jsx("div",{"data-sticky-note-id":t.id,className:"absolute select-none",style:{left:t.x,top:t.y,width:t.width,height:t.height,zIndex:5},onMouseEnter:()=>x(!0),onMouseLeave:()=>x(!1),onPointerDown:P=>P.stopPropagation(),onContextMenu:P=>{P.preventDefault(),P.stopPropagation();const q=8,W=200,I=164,X=Math.min(Math.max(P.clientX+12,q),window.innerWidth-W-q),E=Math.min(Math.max(P.clientY+12,q),window.innerHeight-I-q);y({x:X,y:E})},children:d.jsxs("div",{className:"w-full h-full rounded-xl flex flex-col overflow-hidden",style:{background:S.bg,border:`1px solid ${i?"rgba(96,165,250,0.8)":S.border}`,boxShadow:i?"0 0 0 2px rgba(59,130,246,0.4), 0 4px 24px rgba(0,0,0,0.4)":"0 4px 24px rgba(0,0,0,0.4)"},children:[d.jsxs("div",{className:"flex items-center justify-between px-2.5 py-1.5 cursor-grab active:cursor-grabbing shrink-0",style:{background:S.header},onPointerDown:_,onPointerMove:N,onPointerUp:B,onPointerCancel:B,children:[d.jsx("div",{className:"flex items-center gap-1",children:pC.map(P=>d.jsx("button",{className:"w-3 h-3 rounded-full transition-transform hover:scale-125 focus:outline-none",style:{background:Jg[P],opacity:t.color===P?1:.35,outline:t.color===P?`1.5px solid ${Jg[P]}`:"none",outlineOffset:"1px"},onPointerDown:q=>q.stopPropagation(),onClick:q=>{q.stopPropagation(),l(t.id,{color:P})},title:P},P))}),d.jsxs("div",{className:"flex items-center gap-0.5",style:{opacity:b?1:0,transition:"opacity 0.15s"},children:[d.jsx("button",{className:"w-5 h-5 rounded flex items-center justify-center text-white/50 hover:text-white hover:bg-white/10 transition-colors focus:outline-none",onPointerDown:P=>P.stopPropagation(),onClick:P=>{P.stopPropagation(),f(!0),p(t.content)},title:"Edit",children:d.jsx("span",{className:"material-symbols-outlined",style:{fontSize:"13px"},children:"edit"})}),d.jsx("button",{className:"w-5 h-5 rounded flex items-center justify-center text-white/50 hover:text-red-400 hover:bg-white/10 transition-colors focus:outline-none",onPointerDown:P=>P.stopPropagation(),onClick:P=>{P.stopPropagation(),o(t.id)},title:"Delete",children:d.jsx("span",{className:"material-symbols-outlined",style:{fontSize:"13px"},children:"close"})})]})]}),d.jsx("div",{className:"flex-1 overflow-auto min-h-0 custom-scrollbar",onDoubleClick:()=>{c||(f(!0),p(t.content))},children:c?d.jsx("textarea",{ref:j,value:h,onChange:P=>p(P.target.value),onBlur:G,onKeyDown:P=>{P.key==="Escape"&&G(),(P.ctrlKey||P.metaKey)&&P.key==="Enter"&&G(),P.stopPropagation()},className:"w-full h-full resize-none bg-transparent px-3 py-2 text-xs text-white/80 placeholder-white/20 focus:outline-none font-mono leading-relaxed",placeholder:"Write markdown here...",style:{minHeight:0},onClick:P=>P.stopPropagation()}):d.jsx("div",{className:"px-3 py-2 text-xs text-white/75 leading-relaxed overflow-auto h-full sticky-note-markdown cursor-text custom-scrollbar",children:t.content?d.jsx(e5,{remarkPlugins:[hC],children:t.content}):d.jsx("span",{className:"text-white/20 italic",children:"Double-click to edit..."})})}),d.jsx("div",{className:"absolute bottom-0 right-0 w-5 h-5 cursor-se-resize flex items-end justify-end pb-1 pr-1",onPointerDown:D,onPointerMove:z,onPointerUp:R,onPointerCancel:R,children:d.jsx("svg",{width:"8",height:"8",viewBox:"0 0 8 8",fill:"none",children:d.jsx("path",{d:"M7 1L1 7M7 4L4 7",stroke:"rgba(255,255,255,0.25)",strokeWidth:"1.5",strokeLinecap:"round"})})})]})}),w&&_x.createPortal(d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>y(null),onContextMenu:P=>{P.preventDefault(),y(null)}}),d.jsxs("div",{className:"fixed z-50 w-[200px] bg-[#0b0b0b] border border-white/10 rounded-xl shadow-2xl p-2 text-[10px] font-bold uppercase tracking-widest text-white/80",style:{left:w.x,top:w.y},children:[d.jsxs("button",{className:"w-full text-left px-3 py-2 rounded-lg hover:bg-white/5 transition-colors flex items-center gap-2.5",onClick:()=>{u(t),y(null)},children:[d.jsx("span",{className:"material-symbols-outlined text-white/40",style:{fontSize:"14px"},children:"copy_all"}),"Duplicate"]}),d.jsxs("button",{className:"w-full text-left px-3 py-2 rounded-lg hover:bg-white/5 transition-colors flex items-center gap-2.5",onClick:()=>{navigator.clipboard.writeText(t.content).catch(()=>{}),y(null)},children:[d.jsx("span",{className:"material-symbols-outlined text-white/40",style:{fontSize:"14px"},children:"content_copy"}),"Copy"]}),d.jsxs("button",{className:"w-full text-left px-3 py-2 rounded-lg hover:bg-white/5 transition-colors flex items-center gap-2.5",onClick:()=>{navigator.clipboard.writeText(t.content).catch(()=>{}),o(t.id),y(null)},children:[d.jsx("span",{className:"material-symbols-outlined text-white/40",style:{fontSize:"14px"},children:"content_cut"}),"Cut"]}),d.jsxs("button",{className:"w-full text-left px-3 py-2 rounded-lg hover:bg-white/5 transition-colors text-red-400 flex items-center gap-2.5",onClick:()=>{o(t.id),y(null)},children:[d.jsx("span",{className:"material-symbols-outlined text-red-400/70",style:{fontSize:"14px"},children:"delete"}),"Delete"]})]})]}),document.body)]})},gC=({currentTask:t,setCurrentTask:r,canvasOffset:i,canvasScale:l,canvasViewportRef:o,triggerExpanded:u,setTriggerExpanded:c,onOpenCabinet:f,handleAutoSave:h,dragState:p,dragOverIndex:b,selectedActionIds:x,actionStatusById:w,availableTasks:y,selectorOptionsById:j,updateAction:v,openActionPalette:k,openContextMenu:S,handleActionPointerDown:_,onOpenHeadful:N,isHeadfulOpen:B,onPointerDown:D,onPointerMove:z,onPointerUp:R,onPointerCancel:G,selectionBox:P,onAddStickyNote:q,onUpdateStickyNote:W,onDeleteStickyNote:I,onDuplicateStickyNote:X,selectedNoteIds:E})=>{const Q=T.useCallback(L=>{B||N?.(t.url||"https://www.google.com",L,t,t.variables)},[B,N,t.url,t.variables]),[$,J]=T.useState(null),ve=T.useCallback(L=>{const O=L.target;if(O.closest("[data-action-id]")||O.closest("[data-sticky-note-id]")||O.closest('[data-interactive-target="true"]'))return;L.preventDefault();const H=L.currentTarget.getBoundingClientRect(),M=Math.round((L.clientX-H.left-i.x)/l),ie=Math.round((L.clientY-H.top-i.y)/l),V=8,se=180,ze=48,Re=Math.min(Math.max(L.clientX+12,V),window.innerWidth-se-V),De=Math.min(Math.max(L.clientY+12,V),window.innerHeight-ze-V);J({x:Re,y:De,worldX:M,worldY:ie})},[i,l]),ee=(L,O,H=0)=>{const M=[];let ie=L;for(;ie<O;){const V=ie,se=t.actions[V];if(!se){ie++;continue}if(se.type==="if"||se.type==="while"){const ze=ie;let Re=1,De=ie+1,Pe=-1;for(;De<O&&Re>0;){const re=t.actions[De];if((re.type==="if"||re.type==="while")&&Re++,re.type==="end"&&(Re--,Re===0))break;re.type==="else"&&Re===1&&se.type==="if"&&(Pe=De),De++}const Ge=De,nt=ze+1,ht=Pe!==-1?Pe:Ge,A=Pe!==-1?Pe+1:-1,pe=Pe!==-1?Ge:-1;M.push(d.jsxs("div",{className:"flex flex-col items-center w-full",children:[d.jsx("div",{className:"w-[360px]",children:d.jsx(sg,{action:se,index:V,isDragOver:b===V&&p?.id!==se.id,isDragging:p?.id===se.id,dragTransformY:p?.id===se.id?p.currentY-p.startY:void 0,isSelected:x.has(se.id),status:w[se.id],translateY:0,variables:t.variables,availableTasks:y,selectorOptions:j[se.id],onUpdate:v,onAutoSave:h,onOpenPalette:k,onOpenContextMenu:S,onPointerDown:_,onStartInspect:Q})}),d.jsxs("div",{className:"flex gap-16 mt-4 relative",children:[d.jsxs("div",{className:"flex flex-col items-center min-w-[200px]",children:[d.jsx("div",{className:"text-[8px] font-bold text-white/60 uppercase tracking-widest mb-2",children:se.type==="while"?"Loop":"True"}),d.jsx("div",{className:"w-px h-6 bg-white/25"}),d.jsx("div",{className:"flex flex-col items-center gap-3",children:ee(nt,ht,H+1)}),d.jsxs("div",{className:"mt-2 flex flex-col items-center",children:[d.jsx("div",{className:"w-px h-4 bg-white/20"}),d.jsx("button",{onClick:()=>k(void 0,ht),className:"w-12 h-12 border border-dashed border-white/15 rounded-xl hover:border-white/30 hover:bg-white/5 transition-all flex items-center justify-center group cursor-pointer focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50","aria-label":"Add action",title:"Add action",children:d.jsx(Ce,{name:"add",className:"text-lg text-gray-500 group-hover:text-white transition-colors"})})]})]}),se.type==="if"&&d.jsxs("div",{className:"flex flex-col items-center min-w-[200px]",children:[d.jsx("div",{className:"text-[8px] font-bold text-white/60 uppercase tracking-widest mb-2",children:"Otherwise"}),d.jsx("div",{className:"w-px h-6 bg-white/25"}),d.jsx("div",{className:"flex flex-col items-center gap-3",children:A!==-1?ee(A,pe,H+1):null}),d.jsxs("div",{className:"mt-2 flex flex-col items-center",children:[d.jsx("div",{className:"w-px h-4 bg-white/20"}),d.jsx("button",{onClick:()=>{if(A!==-1)k(void 0,pe);else{const re={id:"act_"+Date.now()+"_else",type:"else",selector:"",value:""},Y=[...t.actions];Y.splice(Ge,0,re),r({...t,actions:Y}),h({...t,actions:Y}),setTimeout(()=>k(void 0,Ge+1),50)}},className:"w-12 h-12 border border-dashed border-white/15 rounded-xl hover:border-white/30 hover:bg-white/5 transition-all flex items-center justify-center group cursor-pointer focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50","aria-label":"Add action",title:"Add action",children:d.jsx(Ce,{name:"add",className:"text-lg text-gray-500 group-hover:text-white transition-colors"})})]})]})]}),d.jsxs("div",{className:"flex flex-col items-center mt-3",children:[d.jsx("div",{className:"w-px h-2 bg-white/25"}),d.jsx("button",{onClick:()=>k(void 0,Ge+1),className:"w-8 h-8 border border-dashed border-white/10 rounded-lg hover:border-white/30 hover:bg-white/5 transition-all flex items-center justify-center group cursor-pointer focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50","aria-label":"Add action",title:"Add action",children:d.jsx(Ce,{name:"add",className:"text-sm text-gray-600 group-hover:text-white transition-colors"})}),d.jsx("div",{className:"w-px h-2 bg-white/25"})]})]},se.id)),ie=Ge+1}else se.type==="end"||se.type==="else"||M.push(d.jsxs("div",{className:"flex flex-col items-center",children:[d.jsx("div",{className:"w-[360px]",children:d.jsx(sg,{action:se,index:V,isDragOver:b===V&&p?.id!==se.id,isDragging:p?.id===se.id,dragTransformY:p?.id===se.id?p.currentY-p.startY:void 0,isSelected:x.has(se.id),status:w[se.id],translateY:0,variables:t.variables,availableTasks:y,selectorOptions:j[se.id],onUpdate:v,onAutoSave:h,onOpenPalette:k,onOpenContextMenu:S,onPointerDown:_,onStartInspect:Q})}),ie<O-1&&t.actions[ie+1]?.type!=="end"&&d.jsxs("div",{className:"flex flex-col items-center my-1",children:[d.jsx("div",{className:"w-px h-2 bg-white/25"}),d.jsx("button",{onClick:()=>k(void 0,V+1),className:"w-8 h-8 border border-dashed border-white/10 rounded-lg hover:border-white/30 hover:bg-white/5 transition-all flex items-center justify-center group cursor-pointer focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50","aria-label":"Add action",title:"Add action",children:d.jsx(Ce,{name:"add",className:"text-sm text-gray-600 group-hover:text-white transition-colors"})}),d.jsx("div",{className:"w-px h-2 bg-white/25"})]})]},se.id)),ie++}return M};return d.jsxs("div",{ref:o,className:"flex-1 overflow-hidden relative cursor-grab active:cursor-grabbing select-none",style:{touchAction:"none"},onPointerDown:D,onPointerMove:z,onPointerUp:R,onPointerCancel:G,onContextMenu:ve,children:[d.jsx("div",{className:"absolute inset-0 pointer-events-none z-0",style:{backgroundImage:"radial-gradient(circle, rgba(255,255,255,0.3) 0.8px, transparent 0)",backgroundSize:`${22*l}px ${22*l}px`,backgroundPosition:`${i.x}px ${i.y}px`}}),d.jsxs("div",{className:"absolute origin-top-left",style:{transform:`translate(${i.x}px, ${i.y}px) scale(${l})`},children:[(t.stickyNotes||[]).map(L=>d.jsx(mC,{note:L,canvasScale:l,isSelected:E.has(L.id),onUpdate:W,onDelete:I,onDuplicate:X},L.id)),d.jsxs("div",{className:"relative z-10 flex flex-col items-center pointer-events-none",style:{paddingTop:"60px",minWidth:"500px"},children:[d.jsxs("div",{className:"w-[360px] bg-black border border-white/15 p-5 rounded-2xl shadow-2xl shadow-black/50 select-text cursor-auto relative z-10 pointer-events-auto",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsxs("button",{type:"button","aria-expanded":u,"aria-label":u?"Collapse trigger settings":"Expand trigger settings",title:u?"Collapse":"Expand",onClick:()=>c(!u),className:"flex items-center gap-3 cursor-pointer focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50 rounded-lg pr-2 transition-all",children:[d.jsx(Ce,{name:"bolt",className:"text-white/40 text-base"}),d.jsx("h3",{className:"text-white/60 font-bold tracking-widest uppercase text-[10px]",children:"On Execution"}),d.jsx(Ce,{name:u?"expand_less":"expand_more",className:"text-xs text-gray-600"})]}),d.jsx("button",{onClick:()=>f("mode"),className:"p-2 rounded-lg hover:bg-white/10 text-white/30 hover:text-white transition-all focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50",title:"Task Settings","aria-label":"Task Settings",children:d.jsx(Ce,{name:"settings",className:"text-lg"})})]}),t.description&&d.jsx("p",{className:"text-[10px] text-gray-500 mt-2 leading-relaxed",children:t.description}),u&&d.jsxs("div",{className:"space-y-4 mt-4 pt-3 border-t border-white/10",children:[d.jsxs("div",{className:"space-y-1.5",children:[d.jsx("label",{className:"text-[8px] font-bold text-gray-500 uppercase tracking-[0.2em]",children:"URL"}),d.jsx("div",{className:"w-full bg-[#111] border border-white/10 rounded-lg px-3 py-2 text-sm focus-within:border-white/30 transition-all",children:d.jsx(_n,{value:t.url,onChange:L=>r({...t,url:L}),onBlur:()=>h(),variables:t.variables,placeholder:"https://..."})})]}),d.jsxs("div",{className:"space-y-1.5",children:[d.jsx("label",{className:"text-[8px] font-bold text-gray-500 uppercase tracking-[0.2em]",children:"Wait (sec)"}),d.jsx("input",{type:"number",value:t.wait,onChange:L=>r({...t,wait:parseFloat(L.target.value)||0}),onBlur:()=>h(),className:"w-full bg-[#111] border border-white/10 rounded-lg px-3 py-2 text-sm focus:outline-none focus:border-white/30 transition-all text-white"})]})]})]}),t.mode==="agent"&&d.jsx("div",{className:"w-px h-10 bg-white/25"}),t.mode==="agent"&&d.jsx("div",{className:"flex flex-col items-center w-full select-text cursor-auto pointer-events-none",children:d.jsxs("div",{className:"space-y-6 w-full flex flex-col items-center relative",children:[ee(0,t.actions.length),d.jsxs("div",{className:"pt-2 flex flex-col items-center",children:[d.jsx("div",{className:"w-px h-6 bg-white/10"}),d.jsxs("button",{onClick:()=>k(),className:"w-[360px] bg-[#0a0a0a] border border-dashed border-white/15 rounded-2xl p-6 hover:border-white/30 hover:bg-white/[0.03] transition-all flex flex-col items-center justify-center gap-2 group cursor-pointer focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50",children:[d.jsx("div",{className:"w-10 h-10 rounded-xl bg-white/5 group-hover:bg-white/10 transition-all flex items-center justify-center",children:d.jsx(Ce,{name:"add",className:"text-2xl text-gray-500 group-hover:text-white transition-colors"})}),d.jsx("span",{className:"text-[9px] font-bold uppercase tracking-[0.2em] text-gray-500 group-hover:text-gray-300 transition-colors",children:"Add Action"})]})]})]})})]})]}),P&&d.jsx("div",{className:"fixed inset-0 pointer-events-none z-20 overflow-hidden",children:d.jsx("div",{className:"absolute bg-blue-500/10 border border-blue-400",style:{left:Math.min(P.startX,P.currentX),top:Math.min(P.startY,P.currentY),width:Math.abs(P.currentX-P.startX),height:Math.abs(P.currentY-P.startY)}})}),$&&d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>J(null),onContextMenu:L=>{L.preventDefault(),J(null)}}),d.jsx("div",{className:"fixed z-50 w-[180px] bg-[#0b0b0b] border border-white/10 rounded-xl shadow-2xl p-2 text-[10px] font-bold uppercase tracking-widest text-white/80",style:{left:$.x,top:$.y},children:d.jsxs("button",{className:"w-full text-left px-3 py-2 rounded-lg hover:bg-white/5 transition-colors flex items-center gap-2",onClick:()=>{q($.worldX,$.worldY),J(null)},children:[d.jsx("span",{className:"material-symbols-outlined text-white/50",style:{fontSize:"14px"},children:"sticky_note_2"}),"Add sticky note"]})})]})]})},Lb=({currentTask:t,setCurrentTask:r,tasks:i=[],isExecuting:l,onSave:o,onRun:u,results:c,pinnedResults:f,onConfirm:h,onNotify:p,onPinResults:b,onUnpinResults:x,onRunSnapshot:w,runId:y,onStop:j,isHeadfulOpen:v,onOpenHeadful:k,onStopHeadful:S,useNovnc:_})=>{const N=Ww();e1(t,fe=>r(fe),(fe,we)=>o(fe,we));const B=t1(t,r,(fe,we)=>o(fe,we)),D=n1(t,p,h,fe=>r(fe)),z=i1(t,v,B.updateAction,p,S),{proxyList:R,proxyListLoaded:G}=a1(),P=T.useRef(t);T.useEffect(()=>{P.current=t},[t]);const[q,W]=T.useState(null),[I,X]=T.useState([]),[E,Q]=T.useState([]),[$,J]=T.useState(!1),[ve,ee]=T.useState(!1),[L,O]=T.useState("mode"),[H,M]=T.useState(null),[ie,V]=T.useState(""),[se,ze]=T.useState(null),[Re,De]=T.useState(null),[Pe,Ge]=T.useState({}),[nt,ht]=T.useState(!1),[A,pe]=T.useState(!1),[re,Y]=T.useState(new Set);T.useEffect(()=>{if(!y||t.mode!=="agent")return;Ge({});const fe=new EventSource(`/api/executions/stream?runId=${encodeURIComponent(y)}`,{withCredentials:!0});return fe.onmessage=we=>{if(we.data)try{const Me=JSON.parse(we.data);Me&&Me.actionId&&Me.status&&Ge(Be=>({...Be,[Me.actionId]:Me.status}))}catch{}},()=>fe.close()},[y,t.mode]);const F=T.useCallback(fe=>{o(fe||P.current,!1)},[o]),ne=T.useCallback((fe,we)=>{const Me={id:"note_"+Date.now()+"_"+Math.floor(Math.random()*1e3),x:fe-100,y:we-60,width:220,height:160,content:"",color:"default"},Be={...t,stickyNotes:[...t.stickyNotes||[],Me]};r(Be),F(Be)},[t,F,r]),me=T.useCallback((fe,we)=>{const Me={...t,stickyNotes:(t.stickyNotes||[]).map(Be=>Be.id===fe?{...Be,...we}:Be)};r(Me),F(Me)},[t,F,r]),de=T.useCallback(fe=>{const we={...fe,id:"note_"+Date.now()+"_"+Math.floor(Math.random()*1e3),x:fe.x+24,y:fe.y+24},Me={...t,stickyNotes:[...t.stickyNotes||[],we]};r(Me),F(Me)},[t,F,r]),K=T.useCallback(fe=>{const we={...t,stickyNotes:(t.stickyNotes||[]).filter(Me=>Me.id!==fe)};r(we),F(we)},[t,F,r]),xe=(fe="mode")=>{O(fe),fe==="history"&&D.loadVersions(),ee(!0)},Ee=T.useCallback((fe,we)=>{J(!0),V(""),ze(fe||null),De(we!==void 0?we:null)},[]),ke=fe=>{const we=fe.tagName.toLowerCase();return we==="input"||we==="textarea"||fe.isContentEditable||fe.closest('[data-interactive-target="true"]')};T.useEffect(()=>{const fe=we=>{if(!ke(we.target))if(we.key==="Backspace"||we.key==="Delete"){if(B.selectedActionIds.size>0||re.size>0){we.preventDefault();let Me=[...t.actions];B.selectedActionIds.forEach(Ve=>{const Ke=Me.findIndex(Le=>Le.id===Ve);if(Ke!==-1){const Le=Me[Ke];if(Le.type==="if"||Le.type==="while"){let Je=1;for(let ct=Ke+1;ct<Me.length;ct++)if((Me[ct].type==="if"||Me[ct].type==="while")&&Je++,Me[ct].type==="end"&&Je--,Je===0){Me.splice(ct,1);break}}Me.splice(Ke,1)}});const Be={...t,actions:Me,stickyNotes:(t.stickyNotes||[]).filter(Ve=>!re.has(Ve.id))};r(Be),F(Be),B.setSelectedActionIds(new Set),Y(new Set)}}else if((we.ctrlKey||we.metaKey)&&we.key==="c")(B.selectedActionIds.size>0||re.size>0)&&(we.preventDefault(),B.selectedActionIds.size>0&&X(t.actions.filter(Me=>B.selectedActionIds.has(Me.id))),re.size>0&&Q((t.stickyNotes||[]).filter(Me=>re.has(Me.id))));else if((we.ctrlKey||we.metaKey)&&we.key==="v"){if(I.length>0||E.length>0){we.preventDefault();let Me={...t},Be=[],Ve=[];if(I.length>0){const Ke=I.map(En=>({...En,id:"act_"+Date.now()+"_"+Math.floor(Math.random()*1e3)})),Le=Math.max(-1,...I.map(En=>Me.actions.findIndex(On=>On.id===En.id))),Je=Le>=0?Le+1:Me.actions.length,ct=[...Me.actions];ct.splice(Je,0,...Ke),Me={...Me,actions:ct},Be=Ke.map(En=>En.id)}if(E.length>0){const Ke=E.map(Le=>({...Le,id:"note_"+Date.now()+"_"+Math.floor(Math.random()*1e3),x:Le.x+24,y:Le.y+24}));Me={...Me,stickyNotes:[...Me.stickyNotes||[],...Ke]},Ve=Ke.map(Le=>Le.id)}r(Me),F(Me),Be.length>0&&B.setSelectedActionIds(new Set(Be)),Ve.length>0&&Y(new Set(Ve))}}else(we.ctrlKey||we.metaKey)&&we.key==="a"?(we.preventDefault(),B.setSelectedActionIds(new Set(t.actions.map(Me=>Me.id)))):(we.metaKey||we.ctrlKey)&&we.key==="k"&&(we.preventDefault(),$||Ee())};return document.addEventListener("keydown",fe),()=>document.removeEventListener("keydown",fe)},[B,t,F,$,Ee,r,re,I,E]);const ae=T.useCallback((fe,we)=>{fe.preventDefault();const Me=8,Be=200,Ve=190,Ke=Math.min(Math.max(fe.clientX+12,Me),window.innerWidth-Be-Me),Le=Math.min(Math.max(fe.clientY+12,Me),window.innerHeight-Ve-Me);W({id:we,x:Ke,y:Le})},[]),ye=fe=>({...fe,id:"act_"+Date.now()+"_"+Math.floor(Math.random()*1e3)}),Ae=fe=>{const we={id:"act_"+Date.now(),type:fe,selector:"",value:""};if((fe==="set"||fe==="merge")&&(we.varName=""),fe==="start"&&(we.value=""),fe==="type"&&(we.typeMode="replace"),fe==="if"||fe==="while"){we.conditionVar="",we.conditionVarType="string",we.conditionOp="equals",we.conditionValue="";const Me={id:"act_"+Date.now()+"_end",type:"end",selector:"",value:""},Be={...t,actions:[...t.actions,we,Me]};r(Be),F(Be)}else{fe==="wait_downloads"&&(we.value="30");const Me={...t,actions:[...t.actions,we]};r(Me),F(Me)}},Ie=T.useMemo(()=>i.filter(fe=>String(fe.id||"")!==String(t.id||"")),[i,t.id]);return d.jsxs("div",{className:"flex-1 flex overflow-hidden animate-in fade-in slide-in-from-bottom-4 duration-500 bg-black relative",children:[d.jsx(r1,{currentTask:t,onUpdateTaskName:fe=>r({...t,name:fe}),onAutoSave:F,onOpenHistory:()=>xe("history")}),d.jsx(gC,{currentTask:t,setCurrentTask:r,canvasOffset:N.canvasOffset,canvasScale:N.canvasScale,canvasViewportRef:N.canvasViewportRef,triggerExpanded:A,setTriggerExpanded:pe,onOpenCabinet:xe,handleAutoSave:F,dragState:B.dragState,dragOverIndex:B.dragOverIndex,selectedActionIds:B.selectedActionIds,setSelectedActionIds:B.setSelectedActionIds,actionStatusById:Pe,availableTasks:Ie,selectorOptionsById:z.selectorOptionsById,updateAction:B.updateAction,openActionPalette:Ee,openContextMenu:ae,handleActionPointerDown:B.handleActionPointerDown,onOpenHeadful:T.useCallback((fe,we)=>{z.setActiveInspectActionId(we||null),k?.(fe,we,P.current,P.current.variables)},[k,z.setActiveInspectActionId]),isHeadfulOpen:v,onPointerDown:fe=>{if(fe.button===1||fe.button===0&&N.spaceHeldRef.current)N.startPanning(fe);else if(fe.button===0&&!ke(fe.target)){if(fe.target.closest("[data-action-id]")||fe.target.closest("[data-sticky-note-id]"))return;M({startX:fe.clientX,startY:fe.clientY,currentX:fe.clientX,currentY:fe.clientY}),!fe.shiftKey&&!fe.ctrlKey&&!fe.metaKey&&(B.setSelectedActionIds(new Set),Y(new Set)),fe.target.setPointerCapture?.(fe.pointerId)}},onPointerMove:fe=>{if(N.isPanning.current)N.handlePanning(fe.nativeEvent);else if(H){M(Le=>Le?{...Le,currentX:fe.clientX,currentY:fe.clientY}:null);const we={left:Math.min(H.startX,fe.clientX),right:Math.max(H.startX,fe.clientX),top:Math.min(H.startY,fe.clientY),bottom:Math.max(H.startY,fe.clientY)},Me=document.querySelectorAll("[data-action-id]"),Be=new Set(fe.shiftKey||fe.ctrlKey||fe.metaKey?Array.from(B.selectedActionIds):[]);Me.forEach(Le=>{const Je=Le.getBoundingClientRect();!(Je.right<we.left||Je.left>we.right||Je.bottom<we.top||Je.top>we.bottom)&&Be.add(Le.getAttribute("data-action-id"))}),B.setSelectedActionIds(Be);const Ve=document.querySelectorAll("[data-sticky-note-id]"),Ke=new Set(fe.shiftKey||fe.ctrlKey||fe.metaKey?Array.from(re):[]);Ve.forEach(Le=>{const Je=Le.getBoundingClientRect();!(Je.right<we.left||Je.left>we.right||Je.bottom<we.top||Je.top>we.bottom)&&Ke.add(Le.getAttribute("data-sticky-note-id"))}),Y(Ke)}},onPointerUp:()=>{N.stopPanning(),M(null)},onPointerCancel:()=>{N.stopPanning(),M(null)},selectionBox:H,onAddStickyNote:ne,onUpdateStickyNote:me,onDeleteStickyNote:K,onDuplicateStickyNote:de,selectedNoteIds:re}),d.jsxs("div",{className:"absolute bottom-24 left-6 z-30 flex flex-col gap-1 bg-[#111] border border-white/10 rounded-xl p-1 shadow-xl",role:"group","aria-label":"Zoom controls",children:[d.jsx("button",{onClick:()=>N.setCanvasScale(Math.min(2,N.canvasScale*1.2)),className:"w-8 h-8 rounded-lg text-white/60 hover:text-white hover:bg-white/10 transition-all flex items-center justify-center text-sm font-bold focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50","aria-label":"Zoom in",title:"Zoom in",children:"+"}),d.jsxs("div",{className:"text-[8px] text-center text-gray-500 font-bold select-none","aria-live":"polite",children:[Math.round(N.canvasScale*100),"%"]}),d.jsx("button",{onClick:()=>N.setCanvasScale(Math.max(.25,N.canvasScale*.8)),className:"w-8 h-8 rounded-lg text-white/60 hover:text-white hover:bg-white/10 transition-all flex items-center justify-center text-sm font-bold focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50","aria-label":"Zoom out",title:"Zoom out",children:"−"}),d.jsx("button",{onClick:()=>{N.setCanvasScale(1);const fe=N.canvasViewportRef.current;N.setCanvasOffset({x:((fe?fe.clientWidth:1e3)-400)/2,y:20})},className:"w-8 h-8 rounded-lg text-white/60 hover:text-white hover:bg-white/10 transition-all flex items-center justify-center focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50","aria-label":"Reset zoom and center",title:"Reset zoom and center",children:d.jsx(Ce,{name:"fit_screen",className:"text-sm"})})]}),q&&(()=>{const fe=t.actions.findIndex(Ve=>Ve.id===q.id),we=t.actions[fe];if(!we)return null;const Me=B.selectedActionIds.has(we.id)&&B.selectedActionIds.size>1,Be=Me?Array.from(B.selectedActionIds):[we.id];return d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>W(null)}),d.jsxs("div",{className:"action-context-menu fixed z-50 w-[200px] bg-[#0b0b0b] border border-white/10 rounded-xl shadow-2xl p-2 text-[10px] font-bold uppercase tracking-widest text-white/80",style:{left:q.x,top:q.y},children:[d.jsxs("button",{onClick:()=>{const Ve=!we.disabled,Ke=t.actions.map(Je=>Be.includes(Je.id)?{...Je,disabled:Ve}:Je),Le={...t,actions:Ke};r(Le),F(Le),W(null)},className:"w-full text-left px-3 py-2 rounded-lg hover:bg-white/5 transition-colors flex items-center gap-2.5",children:[d.jsx(Ce,{name:we.disabled?"visibility":"visibility_off",className:"text-sm text-white/40"}),we.disabled?"Enable":"Disable"," ",Me?"All":""]}),d.jsxs("button",{onClick:()=>{const Ve=t.actions.filter(Le=>!Be.includes(Le.id)),Ke={...t,actions:Ve};r(Ke),F(Ke),W(null),B.setSelectedActionIds(new Set)},className:"w-full text-left px-3 py-2 rounded-lg hover:bg-white/5 transition-colors text-red-400 flex items-center gap-2.5",children:[d.jsx(Ce,{name:"delete",className:"text-sm text-red-400/70"}),"Delete ",Me?"All":""]}),d.jsxs("button",{onClick:()=>{const Ve=t.actions.filter(Je=>Be.includes(Je.id));X(Ve);const Ke=t.actions.filter(Je=>!Be.includes(Je.id)),Le={...t,actions:Ke};r(Le),F(Le),B.setSelectedActionIds(new Set),W(null)},className:"w-full text-left px-3 py-2 rounded-lg hover:bg-white/5 transition-colors flex items-center gap-2.5",children:[d.jsx(Ce,{name:"content_cut",className:"text-sm text-white/40"}),"Cut ",Me?"All":""]}),d.jsxs("button",{onClick:()=>{X(t.actions.filter(Ve=>Be.includes(Ve.id))),W(null)},className:"w-full text-left px-3 py-2 rounded-lg hover:bg-white/5 transition-colors flex items-center gap-2.5",children:[d.jsx(Ce,{name:"content_copy",className:"text-sm text-white/40"}),"Copy ",Me?"All":""]}),d.jsxs("button",{onClick:()=>{const Ke=t.actions.filter(ct=>Be.includes(ct.id)).map(ct=>ye(ct)),Le=[...t.actions];Le.splice(fe+1,0,...Ke);const Je={...t,actions:Le};r(Je),F(Je),W(null)},className:"w-full text-left px-3 py-2 rounded-lg hover:bg-white/5 transition-colors flex items-center gap-2.5",children:[d.jsx(Ce,{name:"copy_all",className:"text-sm text-white/40"}),"Duplicate ",Me?"All":""]})]})]})})(),d.jsx(Yw,{open:$,query:ie,onQueryChange:V,onClose:()=>J(!1),onSelect:fe=>{if(se)B.updateAction(se,{type:fe},!0);else if(Re!==null){const we={id:"act_"+Date.now(),type:fe,selector:"",value:""};(fe==="set"||fe==="merge")&&(we.varName=""),fe==="start"&&(we.value=""),fe==="type"&&(we.typeMode="replace"),(fe==="if"||fe==="while")&&(we.conditionVar="",we.conditionVarType="string",we.conditionOp="equals",we.conditionValue=""),fe==="wait_downloads"&&(we.value="30");const Me=[...t.actions];if(fe==="if"||fe==="while"){const Ve={id:"act_"+Date.now()+"_end",type:"end",selector:"",value:""};Me.splice(Re,0,we,Ve)}else Me.splice(Re,0,we);const Be={...t,actions:Me};r(Be),F(Be)}else Ae(fe);J(!1),De(null)}}),d.jsx(L1,{isOpen:nt,onToggle:()=>ht(!nt),results:c,pinnedResults:f,isExecuting:l,isHeadfulOpen:v||!1,runId:y,onConfirm:h,onNotify:p,onPinResults:b,onUnpinResults:x,useNovnc:_}),d.jsx(B1,{versionPreview:D.versionPreview,onClose:()=>D.setVersionPreview(null),onRunSnapshot:w}),d.jsx(U1,{isHeadfulOpen:v||!1,isInspectMode:z.isInspectMode,isInspectLoading:z.isInspectLoading,isExecuting:l,useNovnc:_,onToggleInspect:z.handleToggleInspect,onStopHeadful:()=>S?.()}),d.jsx(l1,{isExecuting:l,isHeadfulOpen:v||!1,onRun:()=>{ht(!0),u()},onStop:j,onOpenHeadful:()=>k?.(t.url||"https://www.google.com",void 0,t,t.variables),onStopHeadful:S}),d.jsx(Jw,{isOpen:ve,onClose:()=>ee(!1),currentTask:t,onUpdateTask:fe=>{const we={...t,...fe};r(we),F(we)},proxyListLoaded:G,proxyList:R,initialTab:L,versions:D.versions,versionsLoading:D.versionsLoading,onRollback:D.rollbackToVersion,onPreview:D.openVersionPreview})]})},xC=({config:t,onConfirm:r})=>{const[i,l]=T.useState(t.startEditing||!1),[o,u]=T.useState(t.startEditing&&t.value||""),[c,f]=T.useState(!1),h=()=>{u(t.value||""),f(!1),l(!0)},p=()=>{l(!1),u(""),f(!1)},b=async()=>{const y=o.trim();await t.onSave(y),l(!1)},x=async()=>{t.onRegenerate&&await t.onRegenerate()},w=t.loading?"Loading...":t.value?"••••••••••••••••••••••••••••••••••••••••":"No key set";return d.jsxs("div",{className:"flex flex-col gap-4 py-4 border-b border-white/5 last:border-0",children:[d.jsxs("div",{className:"flex items-center gap-4",children:[d.jsx("div",{className:"w-10 h-10 rounded-2xl bg-white/5 flex items-center justify-center text-blue-400 overflow-hidden",children:t.iconUrl?d.jsx("img",{src:t.iconUrl,alt:t.name,className:"w-6 h-6 object-contain"}):t.iconComponent?d.jsx(t.iconComponent,{className:"w-5 h-5"}):d.jsx(Ce,{name:t.icon||"key",className:"text-xl"})}),d.jsxs("div",{children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("h4",{className:"text-sm font-bold text-white uppercase tracking-widest",children:t.name}),t.badge&&d.jsx("span",{className:`text-[8px] font-bold uppercase tracking-widest px-2 py-0.5 rounded-full ${t.badge==="Primary"?"bg-blue-500/20 text-blue-400 border border-blue-500/30":"bg-white/10 text-white/50 border border-white/10"}`,children:t.badge})]}),d.jsx("p",{className:"text-[10px] text-gray-500 uppercase tracking-widest mt-1",children:t.description})]})]}),i?d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsxs("div",{className:"flex-1 flex items-center gap-3 rounded-2xl bg-black/40 border border-white/30 focus-within:border-white px-4 py-2 transition-all",children:[d.jsx("input",{type:c?"text":"password",value:o,onChange:y=>u(y.target.value),disabled:t.saving,placeholder:"Enter new API key...",className:"flex-1 bg-transparent text-[10px] text-white font-mono focus:outline-none",autoFocus:!0}),d.jsx("button",{onClick:()=>f(!c),type:"button",className:"p-2 rounded-xl text-white/50 hover:text-white hover:bg-white/10 transition-all",title:c?"Hide value":"Show value","aria-label":c?"Hide value":"Show value",children:d.jsx(Ce,{name:c?"visibility_off":"visibility",className:"text-base"})})]}),d.jsx("button",{onClick:p,disabled:t.saving,className:"px-6 py-3 rounded-2xl text-[9px] font-bold uppercase tracking-widest bg-transparent border border-white/20 text-white hover:bg-white/10 transition-all disabled:opacity-50",children:"Cancel"}),d.jsxs("button",{onClick:b,disabled:t.saving,className:"px-6 py-3 rounded-2xl text-[9px] font-bold uppercase tracking-widest bg-blue-500 text-white hover:bg-blue-400 transition-all disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-2",children:[d.jsx(Ce,{name:"save",className:"text-base"}),t.saving?"Saving...":"Save"]})]}):d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx("div",{className:"flex-1 rounded-2xl bg-black/40 border border-white/10 px-4 py-3 font-mono text-[10px] text-blue-200/80 break-all min-h-[44px] flex items-center",children:d.jsx("span",{className:"opacity-80 select-none",children:w})}),!t.readOnly&&d.jsxs("button",{onClick:h,disabled:t.loading||t.saving,className:"px-6 py-3 rounded-2xl text-[9px] font-bold uppercase tracking-widest bg-white/10 text-white hover:bg-white/20 transition-all disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-2",children:[d.jsx(Ce,{name:"edit",className:"text-base"}),"Edit"]}),t.onRegenerate&&d.jsxs("button",{onClick:x,disabled:t.loading||t.saving,className:"px-6 py-3 rounded-2xl text-[9px] font-bold uppercase tracking-widest bg-white text-black hover:scale-105 transition-all disabled:opacity-50 disabled:hover:scale-100 disabled:cursor-not-allowed flex items-center gap-2",children:[d.jsx(Ce,{name:"autorenew",className:"text-base"}),t.saving?"Generating...":"Regenerate"]}),t.showCopyButton&&t.value&&d.jsx(ol,{text:t.value,className:"p-3 rounded-2xl bg-white/5 border border-white/10 text-white hover:bg-white/10 transition-all",iconClassName:"text-base"}),t.onDelete&&d.jsx("button",{onClick:async()=>{(r?await r(`Are you sure you want to delete the ${t.name}?`):confirm(`Are you sure you want to delete the ${t.name}?`))&&await t.onDelete?.()},disabled:t.loading||t.saving,className:"p-3 rounded-2xl bg-white/5 border border-white/10 text-red-400 hover:bg-red-500/20 hover:border-red-500/30 transition-all disabled:opacity-50 disabled:cursor-not-allowed",title:"Delete Key","aria-label":"Delete Key",children:d.jsx(Ce,{name:"delete",className:"text-base"})})]})]})},bC=({keys:t,availableProviders:r,onAddProvider:i,dbProviders:l,onAddDbCredential:o,onConfirm:u})=>{const[c,f]=T.useState(!1),[h,p]=T.useState("list"),[b,x]=T.useState(null),[w,y]=T.useState({name:"",baseUrl:"https://api.baserow.io",token:""}),[j,v]=T.useState(!1),[k,S]=T.useState(null),_=r&&r.length>0&&i||l&&l.length>0&&o,N=()=>{f(!1),p("list"),x(null),y({name:"",baseUrl:"https://api.baserow.io",token:""}),S(null)},B=z=>{x(z),p("db-form"),S(null)},D=async()=>{if(!(!b||!w.name||!w.token||!o)){v(!0),S(null);try{await o({name:w.name,provider:b.providerKey,config:{baseUrl:w.baseUrl,token:w.token}})?N():S("Failed to save credential. Check the server console for details.")}catch(z){console.error("[ApiKeysPanel] handleDbSave error:",z),S("An unexpected error occurred.")}finally{v(!1)}}};return T.useEffect(()=>{if(c){document.body.style.overflow="hidden";const z=document.querySelector("main");z&&(z.style.overflow="hidden")}else{document.body.style.overflow="";const z=document.querySelector("main");z&&(z.style.overflow="")}return()=>{document.body.style.overflow="";const z=document.querySelector("main");z&&(z.style.overflow="")}},[c]),d.jsxs("div",{className:"glass-card p-8 rounded-[40px]",children:[d.jsxs("div",{className:"mb-6 flex items-center justify-between",children:[d.jsxs("div",{children:[d.jsx("h3",{className:"text-lg font-bold text-white uppercase tracking-widest",children:"API Keys"}),d.jsx("p",{className:"text-[10px] text-gray-400 uppercase tracking-widest mt-1",children:"Manage external integrations and API access"})]}),_&&d.jsxs("div",{children:[d.jsxs("button",{onClick:()=>f(!0),className:"px-6 py-3 rounded-2xl text-[10px] font-bold uppercase tracking-widest bg-blue-500/10 text-blue-400 hover:bg-blue-500/20 transition-all flex items-center gap-2 border border-blue-500/10",children:[d.jsx(Ce,{name:"add",className:"text-base"}),"Add API Key"]}),c&&_x.createPortal(d.jsx("div",{className:"fixed inset-0 z-[9999] flex items-center justify-center p-4 bg-black/80 backdrop-blur-md animate-in fade-in duration-200",style:{position:"fixed",top:0,left:0,right:0,bottom:0},onClick:z=>{z.target===z.currentTarget&&N()},children:d.jsxs("div",{className:"glass-card max-w-2xl w-full p-10 rounded-[40px] shadow-2xl relative border border-white/10 animate-in zoom-in-95 duration-300 bg-gray-900/80",children:[d.jsx("button",{onClick:N,className:"absolute top-6 right-6 p-3 rounded-2xl text-white/50 hover:text-white hover:bg-white/10 transition-all","aria-label":"Close",children:d.jsx(Ce,{name:"close",className:"text-2xl"})}),h==="list"&&d.jsxs(d.Fragment,{children:[d.jsx("h3",{className:"text-2xl font-bold text-white tracking-wide mb-2",children:"Add Key"}),d.jsx("p",{className:"text-sm text-white/50 mb-8",children:"Choose what you'd like to add."}),r&&r.length>0&&i&&d.jsxs("div",{className:"mb-8",children:[d.jsx("p",{className:"text-[9px] font-bold text-gray-500 uppercase tracking-[0.2em] mb-4",children:"AI Providers"}),d.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:r.map(z=>d.jsxs("button",{onClick:()=>{z.disabled||(i(z.id),N())},disabled:z.disabled,className:`flex items-start gap-4 p-5 rounded-3xl border transition-all text-left ${z.disabled?"border-white/5 bg-white/5 opacity-40 cursor-not-allowed grayscale":"border-white/10 hover:border-blue-400/30 hover:bg-blue-500/5 cursor-pointer group"}`,children:[d.jsx("div",{className:`w-12 h-12 rounded-2xl flex items-center justify-center shrink-0 overflow-hidden ${z.disabled?"bg-black/20":"bg-white/5 group-hover:scale-110 transition-transform"}`,children:z.iconUrl?d.jsx("img",{src:z.iconUrl,alt:z.name,className:"w-8 h-8 object-contain drop-shadow-md"}):z.iconComponent?d.jsx(z.iconComponent,{className:"w-6 h-6 text-white"}):d.jsx(Ce,{name:"api",className:"text-xl text-white"})}),d.jsxs("div",{className:"flex-1",children:[d.jsx("div",{className:"text-base font-bold text-white mb-1",children:z.name}),d.jsx("div",{className:"text-[10px] text-white/50 uppercase tracking-widest",children:z.disabled?"Coming Soon":"Available"})]})]},z.id))})]}),l&&l.length>0&&o&&d.jsxs("div",{children:[d.jsx("p",{className:"text-[9px] font-bold text-gray-500 uppercase tracking-[0.2em] mb-4",children:"Database / Output"}),d.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:l.map(z=>d.jsxs("button",{onClick:()=>!z.disabled&&B(z),disabled:z.disabled,className:`flex items-start gap-4 p-5 rounded-3xl border transition-all text-left ${z.disabled?"border-white/5 bg-white/5 opacity-40 cursor-not-allowed grayscale":"border-white/10 hover:border-emerald-400/30 hover:bg-emerald-500/5 cursor-pointer group"}`,children:[d.jsx("div",{className:`w-12 h-12 rounded-2xl flex items-center justify-center shrink-0 overflow-hidden ${z.disabled?"bg-black/20":"bg-white/5 group-hover:scale-110 transition-transform"}`,children:z.iconUrl?d.jsx("img",{src:z.iconUrl,alt:z.name,className:"w-8 h-8 object-contain drop-shadow-md"}):d.jsx(Ce,{name:"database",className:"text-xl text-white"})}),d.jsxs("div",{className:"flex-1",children:[d.jsx("div",{className:"text-base font-bold text-white mb-1",children:z.name}),d.jsx("div",{className:"text-[10px] text-white/50 uppercase tracking-widest",children:z.disabled?"Coming Soon":"Available"})]})]},z.providerKey))})]})]}),h==="db-form"&&b&&d.jsxs(d.Fragment,{children:[d.jsxs("button",{onClick:()=>p("list"),className:"flex items-center gap-2 text-[10px] font-bold text-gray-500 hover:text-white uppercase tracking-widest mb-6 transition-colors",children:[d.jsx(Ce,{name:"arrow_back",className:"text-sm"}),"Back"]}),d.jsxs("h3",{className:"text-2xl font-bold text-white tracking-wide mb-2",children:["Add ",b.name]}),d.jsxs("p",{className:"text-sm text-white/50 mb-8",children:["Enter your ",b.name," credentials."]}),d.jsxs("div",{className:"space-y-4",children:[d.jsxs("div",{className:"space-y-1",children:[d.jsx("label",{className:"text-[9px] font-bold text-gray-500 uppercase tracking-[0.2em]",children:"Name"}),d.jsx("input",{className:"w-full bg-black/40 border border-white/10 rounded-2xl px-4 py-3 text-sm text-white placeholder-gray-600 focus:outline-none focus:border-white/30 transition-colors",placeholder:"e.g. My Baserow",value:w.name,onChange:z=>y(R=>({...R,name:z.target.value})),autoFocus:!0})]}),b.providerKey==="baserow"&&d.jsxs("div",{className:"space-y-1",children:[d.jsx("label",{className:"text-[9px] font-bold text-gray-500 uppercase tracking-[0.2em]",children:"Base URL"}),d.jsx("input",{className:"w-full bg-black/40 border border-white/10 rounded-2xl px-4 py-3 text-sm text-white placeholder-gray-600 focus:outline-none focus:border-white/30 transition-colors",placeholder:"https://api.baserow.io",value:w.baseUrl,onChange:z=>y(R=>({...R,baseUrl:z.target.value}))})]}),d.jsxs("div",{className:"space-y-1",children:[d.jsx("label",{className:"text-[9px] font-bold text-gray-500 uppercase tracking-[0.2em]",children:"API Token"}),d.jsx("input",{className:"w-full bg-black/40 border border-white/10 rounded-2xl px-4 py-3 text-sm text-white placeholder-gray-600 focus:outline-none focus:border-white/30 transition-colors font-mono",placeholder:"Token",type:"password",value:w.token,onChange:z=>y(R=>({...R,token:z.target.value}))})]})]}),k&&d.jsx("p",{className:"mt-4 text-[10px] text-red-400 bg-red-500/10 border border-red-500/20 rounded-xl px-3 py-2",children:k}),d.jsxs("div",{className:"flex gap-3 mt-4",children:[d.jsx("button",{onClick:N,className:"px-6 py-3 rounded-2xl text-[10px] font-bold uppercase tracking-widest bg-transparent border border-white/10 text-gray-400 hover:text-white hover:border-white/20 transition-all",children:"Cancel"}),d.jsx("button",{onClick:D,disabled:j||!w.name||!w.token,className:"flex-1 py-3 rounded-2xl text-[10px] font-bold uppercase tracking-widest bg-white text-black hover:bg-white/90 transition-all disabled:opacity-40 disabled:cursor-not-allowed",children:j?"Saving…":"Save Credential"})]})]})]})}),document.body)]})]}),d.jsx("div",{className:"flex flex-col",children:t.map(z=>d.jsx(xC,{config:z,onConfirm:u},z.id))})]})},yC=({onClearStorage:t})=>d.jsxs("div",{className:"glass-card p-8 rounded-[40px] space-y-6",children:[d.jsxs("div",{className:"flex items-center gap-4 mb-2",children:[d.jsx("div",{className:"w-10 h-10 rounded-2xl bg-white/5 flex items-center justify-center text-gray-400",children:d.jsx(Ce,{name:"delete",className:"text-xl"})}),d.jsxs("div",{children:[d.jsx("h3",{className:"text-sm font-bold text-white uppercase tracking-widest",children:"Storage"}),d.jsx("p",{className:"text-[10px] text-gray-500 uppercase tracking-widest mt-1",children:"Manage stored data"})]})]}),d.jsxs("div",{className:"flex gap-4",children:[d.jsx("button",{type:"button",onClick:()=>t("screenshots"),"aria-label":"Clear all captures",title:"Clear all captures",className:"flex-1 px-6 py-4 bg-red-500/5 border border-red-500/10 text-red-400 rounded-2xl text-[9px] font-bold uppercase tracking-widest hover:bg-red-500/10 transition-all focus:outline-none focus-visible:ring-2 focus-visible:ring-red-500/50",children:"Clear Captures"}),d.jsx("button",{type:"button",onClick:()=>t("cookies"),"aria-label":"Reset all cookies",title:"Reset all cookies",className:"flex-1 px-6 py-4 bg-yellow-500/5 border border-yellow-500/10 text-yellow-400 rounded-2xl text-[9px] font-bold uppercase tracking-widest hover:bg-yellow-500/10 transition-all focus:outline-none focus-visible:ring-2 focus-visible:ring-yellow-500/50",children:"Reset Cookies"})]})]}),vC=72,Bb=6,qs=vC+Bb,wC=5,SC=2,kC=({index:t,style:r,data:i})=>{const l=i.captures[t];return l?d.jsx("div",{style:{...r,paddingBottom:Bb},children:d.jsxs("div",{className:"flex items-center justify-between gap-4 p-4 rounded-2xl border border-white/10 bg-white/[0.02]",children:[d.jsxs("div",{className:"space-y-1",children:[d.jsx("div",{className:"text-[10px] font-bold text-white uppercase tracking-widest",children:l.type==="recording"?"Recording":"Screenshot"}),d.jsx("div",{className:"text-[9px] text-gray-500 uppercase tracking-widest",children:l.name})]}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("a",{href:l.url,target:"_blank",rel:"noreferrer",className:"px-3 py-2 rounded-xl border border-white/10 text-[9px] font-bold uppercase tracking-widest text-white hover:bg-white/5 transition-all focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50","aria-label":`Open ${l.name}`,title:`Open ${l.name}`,children:"Open"}),d.jsx("button",{type:"button",onClick:()=>i.onDelete(l.name),className:"px-3 py-2 rounded-xl border border-red-500/20 text-[9px] font-bold uppercase tracking-widest text-red-300 hover:bg-red-500/10 transition-all focus:outline-none focus-visible:ring-2 focus-visible:ring-red-500/50","aria-label":`Delete ${l.name}`,title:`Delete ${l.name}`,children:"Delete"})]})]})}):null},jC=({captures:t,loading:r,onRefresh:i,onDelete:l})=>{const o=Math.min(Math.max(qs,t.length*qs),qs*wC),u=T.useMemo(()=>({captures:t,onDelete:l}),[t,l]);return d.jsxs("div",{className:"glass-card p-8 rounded-[40px] space-y-6",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsxs("div",{children:[d.jsx("h3",{className:"text-sm font-bold text-white uppercase tracking-widest",children:"Captures"}),d.jsx("p",{className:"text-[10px] text-gray-500 uppercase tracking-widest mt-1",children:"Recordings and screenshots"})]}),d.jsx("button",{type:"button",onClick:i,disabled:r,className:"px-4 py-2 border border-white/10 text-[9px] font-bold rounded-xl uppercase tracking-widest text-white/70 hover:text-white hover:bg-white/5 transition-all disabled:opacity-50 focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50","aria-label":"Refresh captures list",title:"Refresh captures list",children:"Refresh"})]}),r&&d.jsx("div",{className:"text-[9px] text-gray-500 uppercase tracking-widest",children:"Loading captures..."}),!r&&t.length===0&&d.jsx("div",{className:"text-[9px] text-gray-600 uppercase tracking-widest",children:"No captures found."}),!r&&t.length>0&&d.jsx(io,{height:o,width:"100%",itemCount:t.length,itemSize:qs,overscanCount:SC,itemData:u,children:kC})]})},Wc=t=>`${t.name}|${t.domain||""}|${t.path||""}|${t.expires||""}`,Wg=t=>{if(!t)return!1;let r=0;for(let i=0;i<t.length;i+=1){const l=t.charCodeAt(i);(l===9||l===10||l===13||l>=32&&l<=126)&&(r+=1)}return r/t.length>=.85},_C=t=>{if(!t)return null;if(/%[0-9A-Fa-f]{2}/.test(t))try{const r=decodeURIComponent(t);if(r!==t&&Wg(r))return{value:r,kind:"URL"}}catch{}if(/^[A-Za-z0-9+/=]+$/.test(t)&&t.length>=12&&t.length%4===0)try{const r=atob(t);if(r&&Wg(r))return{value:r,kind:"Base64"}}catch{}return null},CC=({cookies:t,originsCount:r,loading:i,onClear:l,onDelete:o})=>{const[u,c]=T.useState({}),[f,h]=T.useState({}),p=w=>{const y=Wc(w);c(j=>({...j,[y]:!j[y]}))},b=w=>{const y=Wc(w);h(j=>({...j,[y]:!j[y]}))},x=T.useMemo(()=>t.map(w=>{const y=Wc(w),j=w.value||"";return{cookie:w,key:y,value:j,decodedCandidate:_C(j)}}),[t]);return d.jsxs("div",{className:"glass-card p-8 rounded-[40px] space-y-6",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsxs("div",{className:"flex items-center gap-4",children:[d.jsx("div",{className:"w-10 h-10 rounded-2xl bg-white/5 flex items-center justify-center text-gray-400",children:d.jsx(Ce,{name:"database",className:"text-xl"})}),d.jsxs("div",{children:[d.jsx("h3",{className:"text-sm font-bold text-white uppercase tracking-widest",children:"Cookies"}),d.jsx("p",{className:"text-[10px] text-gray-500 uppercase tracking-widest mt-1",children:"Browser storage state"})]})]}),d.jsx("button",{type:"button",onClick:l,title:"Clear all cookies","aria-label":"Clear all cookies",className:"px-4 py-2 text-[9px] font-bold uppercase tracking-widest rounded-xl bg-yellow-500/5 border border-yellow-500/10 text-yellow-400 hover:bg-yellow-500/10 transition-all focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50",children:"Clear Cookies"})]}),i&&d.jsx("div",{className:"text-[9px] text-gray-500 uppercase tracking-widest",children:"Loading data..."}),!i&&t.length===0&&d.jsx("div",{className:"text-[9px] text-gray-600 uppercase tracking-widest",children:"No cookies found."}),d.jsx("div",{className:"space-y-3",children:x.map(({cookie:w,key:y,value:j,decodedCandidate:v})=>{const k=!!u[y],S=!!v&&!!f[y],_=S&&v?v.value:j,N=k||_.length<=120?_:`${_.slice(0,120)}...`;return d.jsxs("div",{className:"bg-white/5 border border-white/10 rounded-2xl p-4 space-y-3",children:[d.jsxs("div",{className:"flex items-center justify-between gap-4",children:[d.jsxs("div",{className:"min-w-0",children:[d.jsx("div",{className:"text-[10px] font-bold text-white uppercase tracking-widest truncate",children:w.name}),d.jsxs("div",{className:"text-[8px] text-gray-500 uppercase tracking-[0.2em]",children:[w.domain||"local"," | ",w.path||"/",w.expires?` | ${new Date(w.expires*1e3).toLocaleString()}`:""]})]}),d.jsxs("div",{className:"flex items-center gap-2",children:[v&&d.jsx("button",{type:"button",onClick:()=>b(w),title:S?"Show raw value":`Decode ${v.kind}`,"aria-label":S?"Show raw value":`Decode ${v.kind}`,className:"px-3 py-2 text-[9px] font-bold uppercase tracking-widest rounded-xl border border-white/10 text-white/70 hover:text-white hover:bg-white/5 transition-all focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50",children:S?"Show Raw":`Decode ${v.kind}`}),d.jsx(ol,{text:_,title:"Copy cookie value",label:"Copy",className:"px-3 py-2 text-[9px] font-bold uppercase tracking-widest rounded-xl bg-white/5 border border-white/10 text-white hover:bg-white/10 transition-all",iconClassName:"text-sm"}),d.jsx("button",{type:"button",onClick:()=>o(w),title:`Delete cookie ${w.name}`,"aria-label":`Delete cookie ${w.name}`,className:"px-3 py-2 text-[9px] font-bold uppercase tracking-widest rounded-xl bg-red-500/5 border border-red-500/10 text-red-400 hover:bg-red-500/10 transition-all focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50",children:"Delete"})]})]}),d.jsx("button",{type:"button",onClick:()=>p(w),"aria-expanded":k,"aria-label":k?"Collapse cookie value":"Expand cookie value",className:"w-full text-left cursor-pointer rounded-xl bg-black/40 border border-white/10 px-3 py-2 font-mono text-[10px] text-blue-200/80 whitespace-pre-wrap break-words focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50",title:k?"Click to collapse":"Click to expand",children:N||"(empty)"})]},y)})}),!i&&r>0&&d.jsxs("div",{className:"pt-2 text-[8px] text-gray-600 uppercase tracking-widest",children:["Origins stored: ",r]})]})},NC=({tab:t,onTabChange:r})=>d.jsxs("div",{className:"flex items-end justify-between mb-8",children:[d.jsx("div",{className:"space-y-2",children:d.jsx("h2",{className:"text-2xl font-medium tracking-[0.25em] text-white uppercase",children:"Settings"})}),d.jsx("div",{role:"tablist",className:"flex bg-white/5 rounded-xl p-1 border border-white/5",children:["system","data","proxies"].map(i=>d.jsx("button",{role:"tab","aria-selected":t===i,onClick:()=>r(i),className:`px-4 py-2 text-[9px] font-bold uppercase tracking-widest rounded-lg transition-all focus:outline-none focus-visible:ring-2 ${t===i?"bg-white text-black focus-visible:ring-blue-500":"text-gray-500 hover:text-white focus-visible:ring-white/50"}`,children:i},i))})]}),EC=({proxies:t,defaultProxyId:r,includeDefaultInRotation:i,rotationMode:l,loading:o,onRefresh:u,onAdd:c,onImport:f,onUpdate:h,onDelete:p,onDeleteMultiple:b,onSetDefault:x,onToggleIncludeDefault:w,onRotationModeChange:y})=>{const[j,v]=T.useState(""),[k,S]=T.useState(""),[_,N]=T.useState(""),[B,D]=T.useState(""),[z,R]=T.useState(!1),[G,P]=T.useState(""),[q,W]=T.useState(null),[I,X]=T.useState(""),[E,Q]=T.useState(""),[$,J]=T.useState(""),[ve,ee]=T.useState(""),[L,O]=T.useState(!1),[H,M]=T.useState(""),[ie,V]=T.useState(""),[se,ze]=T.useState(new Set),[Re,De]=T.useState(null),Pe=T.useRef(null),Ge=()=>{j.trim()&&(c({server:j.trim(),username:k.trim()||void 0,password:_.trim()||void 0,label:B.trim()||void 0,isRotatingPool:z,estimatedPoolSize:G?parseInt(G,10):void 0}),v(""),S(""),N(""),D(""),R(!1),P(""))},nt=K=>{W(K.id),X(K.server),Q(K.username||""),J(""),ee(K.label||""),O(!!K.isRotatingPool),M(K.estimatedPoolSize?String(K.estimatedPoolSize):"")},ht=()=>{W(null),X(""),Q(""),J(""),ee(""),O(!1),M("")},A=()=>{!q||!I.trim()||(h(q,{server:I.trim(),username:E.trim()||void 0,password:$.trim()||void 0,label:ve.trim()||void 0,isRotatingPool:L,estimatedPoolSize:H?parseInt(H,10):void 0}),ht())},pe=K=>{const xe=K.trim();if(!xe)return null;if(xe.includes("://"))return{server:xe};const Ee=xe.split(":");if(Ee.length<2)return null;const ke=Ee[0]?.trim(),ae=Ee[1]?.trim();if(!ke||!ae)return null;const ye=Ee[2]?Ee[2].trim():"",Ae=Ee.length>3?Ee.slice(3).join(":").trim():"";return{server:`${ke}:${ae}`,username:ye||void 0,password:Ae||void 0}},re=async K=>{const xe=Array.from(K.target.files||[]);if(xe.length)try{const ae=(await Promise.all(xe.map(ye=>ye.text()))).join(`
43
- `).split(/\r?\n/).flatMap(ye=>ye.split(/[,;]+/)).map(pe).filter(Boolean);if(ae.length===0){V("No valid proxies found in file.");return}V(""),f(ae)}catch{V("Failed to read file.")}finally{Pe.current&&(Pe.current.value="")}},Y=(K,xe)=>{ze(Ee=>{const ke=new Set(Ee);if(xe?.shiftKey&&Re){const ae=t.filter(Ie=>Ie.id!=="host"),ye=ae.findIndex(Ie=>Ie.id===Re),Ae=ae.findIndex(Ie=>Ie.id===K);if(ye!==-1&&Ae!==-1){const Ie=Math.min(ye,Ae),fe=Math.max(ye,Ae);for(let we=Ie;we<=fe;we++)ke.add(ae[we].id);return ke}}return ke.has(K)?ke.delete(K):ke.add(K),ke}),De(K)},F=()=>{const K=t.filter(xe=>xe.id!=="host");se.size>=K.length&&K.length>0?ze(new Set):ze(new Set(K.map(xe=>xe.id)))},ne=()=>{se.size>0&&(b(Array.from(se)),ze(new Set))},me=t.filter(K=>K.id!=="host"),de=me.length>0&&se.size>=me.length;return d.jsxs("div",{className:"glass-card p-8 rounded-[40px] space-y-6",children:[d.jsxs("div",{className:"flex items-center gap-4 mb-2",children:[d.jsx("div",{className:"w-10 h-10 rounded-2xl bg-white/5 flex items-center justify-center text-gray-400",children:d.jsx(Ce,{name:"security",className:"text-xl"})}),d.jsxs("div",{children:[d.jsx("h3",{className:"text-sm font-bold text-white uppercase tracking-widest",children:"Proxies"}),d.jsx("p",{className:"text-[10px] text-gray-500 uppercase tracking-widest mt-1",children:"Set defaults and rotate per task"})]}),d.jsx("div",{className:"ml-auto",children:d.jsxs("button",{onClick:u,disabled:o,className:"px-4 py-2 rounded-xl border border-white/10 text-[9px] font-bold uppercase tracking-widest text-white hover:bg-white/5 transition-all disabled:opacity-50 inline-flex items-center gap-2 focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50",title:"Refresh proxy list","aria-label":"Refresh proxy list",children:[d.jsx(Ce,{name:"sync",className:`text-base ${o?"animate-spin":""}`}),"Refresh"]})})]}),d.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[d.jsx("input",{type:"text",placeholder:"Proxy server (host:port or scheme://host:port)",value:j,onChange:K=>v(K.target.value),className:"bg-white/[0.05] border border-white/10 rounded-xl px-4 py-3 text-[10px] text-white","aria-label":"Proxy server address"}),d.jsx("input",{type:"text",placeholder:"Label (optional)",value:B,onChange:K=>D(K.target.value),className:"bg-white/[0.05] border border-white/10 rounded-xl px-4 py-3 text-[10px] text-white","aria-label":"Proxy label"}),d.jsx("input",{type:"text",placeholder:"Username (optional)",value:k,onChange:K=>S(K.target.value),className:"bg-white/[0.05] border border-white/10 rounded-xl px-4 py-3 text-[10px] text-white","aria-label":"Proxy username"}),d.jsx("input",{type:"password",placeholder:"Password (optional)",value:_,onChange:K=>N(K.target.value),className:"bg-white/[0.05] border border-white/10 rounded-xl px-4 py-3 text-[10px] text-white","aria-label":"Proxy password"}),d.jsxs("label",{className:"flex items-center gap-3 px-4 py-3 rounded-xl bg-white/[0.05] border border-white/10 group cursor-pointer",children:[d.jsx("input",{type:"checkbox",checked:z,onChange:K=>R(K.target.checked),className:"w-4 h-4 rounded border-white/20 bg-transparent"}),d.jsx("span",{className:"text-[10px] text-gray-400 uppercase tracking-widest group-hover:text-white transition-colors",children:"Rotating pool"})]}),z&&d.jsx("input",{type:"number",placeholder:"Estimated size (optional)",value:G,onChange:K=>P(K.target.value),className:"bg-white/[0.05] border border-white/10 rounded-xl px-4 py-3 text-[10px] text-white","aria-label":"Estimated pool size",min:"1"})]}),d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsxs("button",{onClick:Ge,disabled:o||!j.trim(),className:"px-6 py-3 rounded-2xl text-[9px] font-bold uppercase tracking-widest bg-white text-black hover:scale-105 transition-all focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-2",children:[o&&d.jsx("div",{className:"w-3 h-3 border-2 border-black/20 border-t-black rounded-full animate-spin"}),"Add Proxy"]}),d.jsx("button",{onClick:()=>Pe.current?.click(),className:"px-6 py-3 rounded-2xl text-[9px] font-bold uppercase tracking-widest border border-white/10 text-white hover:bg-white/5 transition-all focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50",children:"Import"}),d.jsx("button",{onClick:()=>x("host"),className:`px-6 py-3 rounded-2xl text-[9px] font-bold uppercase tracking-widest border border-white/10 transition-all focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50 ${r?"text-white hover:bg-white/5":"bg-white/10 text-white"}`,children:"Use Host IP"})]}),(se.size>0||me.length>0)&&d.jsxs("div",{className:"flex items-center justify-between p-3.5 rounded-2xl bg-white/[0.02] border border-white/5",children:[d.jsxs("label",{className:"flex items-center gap-3 cursor-pointer group",children:[d.jsx("input",{type:"checkbox",checked:de,onChange:F,disabled:me.length===0,className:"w-4 h-4 rounded border-white/20 bg-transparent disabled:opacity-50"}),d.jsx("span",{className:"text-[10px] font-bold text-gray-500 uppercase tracking-widest group-hover:text-white transition-colors",children:se.size>0?`${se.size} Selected`:"Select All"})]}),se.size>0&&d.jsxs("button",{onClick:ne,className:"px-4 py-2 rounded-xl bg-red-500/10 border border-red-500/20 text-[9px] font-bold uppercase tracking-widest text-red-400 hover:bg-red-500/20 transition-all inline-flex items-center gap-2 focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50",children:[d.jsx(Ce,{name:"delete",className:"text-base"}),"Delete Selected"]})]}),d.jsx("input",{ref:Pe,type:"file",accept:".txt,text/plain",onChange:re,className:"hidden"}),ie&&d.jsx("div",{className:"text-[9px] text-red-400 uppercase tracking-widest",children:ie}),d.jsxs("label",{className:"flex items-center justify-between gap-3 p-3.5 rounded-2xl bg-white/[0.02] border border-white/5 hover:bg-white/[0.05] transition-all group",children:[d.jsx("span",{className:"text-[10px] font-bold text-gray-500 uppercase tracking-widest group-hover:text-white",children:"Rotation mode"}),d.jsxs("select",{value:l,onChange:K=>y(K.target.value==="random"?"random":"round-robin"),className:"bg-white/[0.05] border border-white/10 rounded-xl px-3 py-2 text-[10px] text-white uppercase tracking-widest","aria-label":"Rotation mode",children:[d.jsx("option",{value:"round-robin",children:"Round robin"}),d.jsx("option",{value:"random",children:"Random"})]})]}),d.jsxs("label",{className:"flex items-center gap-3 p-3.5 rounded-2xl bg-white/[0.02] border border-white/5 hover:bg-white/[0.05] transition-all cursor-pointer group",children:[d.jsx("input",{type:"checkbox",checked:i,onChange:K=>w(K.target.checked),className:"w-4 h-4 rounded border-white/20 bg-transparent"}),d.jsx("span",{className:"text-[10px] font-bold text-gray-500 uppercase tracking-widest group-hover:text-white",children:"Include default IP in rotation pool"})]}),d.jsxs("div",{className:"space-y-3",children:[o&&d.jsx("div",{className:"text-[9px] text-gray-500 uppercase tracking-widest",children:"Loading proxies..."}),!o&&t.length===0&&d.jsx("div",{className:"text-[9px] text-gray-600 uppercase tracking-widest",children:"No proxies saved yet."}),!o&&t.map(K=>{const xe=K.id===r,Ee=K.id===q;return d.jsx("div",{className:"flex items-center justify-between gap-4 p-4 rounded-2xl border border-white/10 bg-white/[0.02]",children:Ee?d.jsxs("div",{className:"w-full space-y-3",children:[d.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[d.jsx("input",{type:"text",value:I,onChange:ke=>X(ke.target.value),className:"bg-white/[0.05] border border-white/10 rounded-xl px-4 py-2 text-[10px] text-white",placeholder:"Proxy server","aria-label":"Proxy server"}),d.jsx("input",{type:"text",value:ve,onChange:ke=>ee(ke.target.value),className:"bg-white/[0.05] border border-white/10 rounded-xl px-4 py-2 text-[10px] text-white",placeholder:"Label","aria-label":"Label"}),d.jsx("input",{type:"text",value:E,onChange:ke=>Q(ke.target.value),className:"bg-white/[0.05] border border-white/10 rounded-xl px-4 py-2 text-[10px] text-white",placeholder:"Username","aria-label":"Username"}),d.jsx("input",{type:"password",value:$,onChange:ke=>J(ke.target.value),placeholder:"Password (leave blank to keep)",className:"bg-white/[0.05] border border-white/10 rounded-xl px-4 py-2 text-[10px] text-white","aria-label":"Password"}),d.jsxs("label",{className:"flex items-center gap-3 px-4 py-2 rounded-xl bg-white/[0.05] border border-white/10 group cursor-pointer",children:[d.jsx("input",{type:"checkbox",checked:L,onChange:ke=>O(ke.target.checked),className:"w-3.5 h-3.5 rounded border-white/20 bg-transparent"}),d.jsx("span",{className:"text-[10px] text-gray-400 uppercase tracking-widest group-hover:text-white transition-colors",children:"Rotating pool"})]}),L&&d.jsx("input",{type:"number",placeholder:"Estimated size",value:H,onChange:ke=>M(ke.target.value),className:"bg-white/[0.05] border border-white/10 rounded-xl px-4 py-2 text-[10px] text-white","aria-label":"Estimated pool size",min:"1"})]}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("button",{onClick:A,className:"px-3 py-2 rounded-xl border border-white/10 text-[9px] font-bold uppercase tracking-widest text-white hover:bg-white/5 transition-all focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50",title:"Save proxy changes","aria-label":"Save proxy changes",children:"Save"}),d.jsx("button",{onClick:ht,className:"px-3 py-2 rounded-xl border border-white/10 text-[9px] font-bold uppercase tracking-widest text-white/70 hover:bg-white/5 transition-all focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50",title:"Cancel editing","aria-label":"Cancel editing",children:"Cancel"})]})]}):d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"flex items-center gap-4 border-r border-white/10 pr-4 w-12 justify-center",children:K.id!=="host"?d.jsx("input",{type:"checkbox",checked:se.has(K.id),onChange:()=>{},onClick:ke=>{ke.stopPropagation(),Y(K.id,ke)},className:"w-4 h-4 rounded border-white/20 bg-transparent"}):d.jsx("div",{title:"Host IP (Cannot be deleted)",className:"flex items-center justify-center opacity-70",children:d.jsx(Ce,{name:"computer",className:"text-lg text-white"})})}),d.jsxs("div",{className:"flex-1 space-y-1",children:[d.jsx("div",{className:"text-[10px] font-bold text-white uppercase tracking-widest",children:K.label||K.server}),d.jsxs("div",{className:"text-[9px] text-gray-500 uppercase tracking-widest flex items-center gap-2",children:[d.jsx("span",{children:K.server}),K.isRotatingPool&&d.jsxs("span",{className:"px-1.5 py-0.5 rounded bg-white/10 text-white font-bold inline-flex items-center gap-1",children:[d.jsx(Ce,{name:"autorenew",className:"text-[10px]"}),"Pool",K.estimatedPoolSize?`(~${K.estimatedPoolSize})`:""]})]})]}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsxs("button",{onClick:()=>x(K.id),className:`px-3 py-2 rounded-xl border text-[9px] font-bold uppercase tracking-widest transition-all inline-flex items-center gap-2 focus:outline-none focus-visible:ring-2 ${xe?"bg-white text-black border-white focus-visible:ring-blue-500":"border-white/10 text-white hover:bg-white/5 focus-visible:ring-white/50"}`,title:xe?"Current default proxy":"Set as default proxy","aria-label":xe?"Current default proxy":"Set as default proxy",children:[xe?d.jsx(Ce,{name:"star",className:"text-base"}):d.jsx(Ce,{name:"star_outline",className:"text-base"}),xe?"Default":"Set Default"]}),K.id!=="host"&&d.jsxs(d.Fragment,{children:[d.jsx("button",{onClick:()=>nt(K),className:"px-3 py-2 rounded-xl border border-white/10 text-[9px] font-bold uppercase tracking-widest text-white hover:bg-white/5 transition-all focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50",title:"Edit proxy","aria-label":"Edit proxy",children:"Edit"}),d.jsxs("button",{onClick:()=>p(K.id),className:"px-3 py-2 rounded-xl border border-red-500/20 text-[9px] font-bold uppercase tracking-widest text-red-300 hover:bg-red-500/10 transition-all inline-flex items-center gap-2 focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50",title:"Delete proxy","aria-label":"Delete proxy",children:[d.jsx(Ce,{name:"delete",className:"text-base"}),"Delete"]})]})]})]})},K.id)})]})]})},AC=({selection:t,options:r,loading:i,onChange:l})=>d.jsxs("div",{className:"glass-card p-8 rounded-[40px] space-y-4",children:[d.jsxs("div",{children:[d.jsx("h3",{className:"text-sm font-bold text-white uppercase tracking-widest",children:"User Agent"}),d.jsx("p",{className:"text-[10px] text-gray-500 uppercase tracking-widest mt-1",children:"Default browser identity"})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx("label",{htmlFor:"user-agent-select",className:"sr-only",children:"Select Default User Agent"}),d.jsxs("select",{id:"user-agent-select",value:t,onChange:o=>l(o.target.value),disabled:i,className:"w-full bg-white/[0.05] border border-white/10 rounded-xl px-4 py-3 text-[10px] text-white uppercase tracking-widest disabled:opacity-60 focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50",children:[d.jsx("option",{value:"system",children:"System user agent (default)"}),r.map(o=>d.jsx("option",{value:o,children:o},o))]}),d.jsx("div",{className:"text-[9px] text-gray-500 uppercase tracking-widest",children:"Applies when rotate UA is disabled in tasks."})]})]}),zC=({version:t})=>{const[r,i]=T.useState(!1),l=t?`v${t}`:"Unknown",o=async()=>{const u=t||l;try{if(typeof navigator<"u"&&navigator.clipboard&&typeof window<"u"&&window.isSecureContext)await navigator.clipboard.writeText(u);else if(typeof document<"u"){const f=document.createElement("textarea");f.value=u,f.style.position="fixed",f.style.opacity="0",document.body.appendChild(f),f.select(),document.execCommand("copy"),document.body.removeChild(f)}i(!0),setTimeout(()=>i(!1),1500)}catch{i(!1)}};return d.jsxs("div",{className:"glass-card p-8 rounded-[40px] space-y-6",children:[d.jsxs("div",{className:"flex items-center gap-4 mb-2",children:[d.jsx("div",{className:"w-10 h-10 rounded-2xl bg-white/5 flex items-center justify-center text-gray-400",children:d.jsx(Ce,{name:"content_copy",className:"text-xl"})}),d.jsxs("div",{children:[d.jsx("h3",{className:"text-sm font-bold text-white uppercase tracking-widest",children:"Version"}),d.jsx("p",{className:"text-[10px] text-gray-500 uppercase tracking-widest mt-1",children:"Package metadata"})]})]}),d.jsxs("div",{className:"flex items-center justify-between gap-4",children:[d.jsx("div",{className:"text-[9px] font-bold uppercase tracking-[0.3em] text-white",children:l}),d.jsx("button",{onClick:o,className:"px-4 py-2 rounded-xl border border-white/10 text-[9px] font-bold uppercase tracking-widest text-white hover:bg-white/5 transition-all",type:"button",children:r?"Copied":"Copy version"})]})]})},TC="0.11.2",RC={version:TC},gd=RC.version,OC=({onClearStorage:t,onConfirm:r,onNotify:i})=>{const[l,o]=T.useState("system"),[u,c]=T.useState([]),[f,h]=T.useState(!1),[p,b]=T.useState([]),[x,w]=T.useState([]),[y,j]=T.useState([]),[v,k]=T.useState([]),[S,_]=T.useState(!1),[N,B]=T.useState(null),[D,z]=T.useState(!0),[R,G]=T.useState(!1),[P,q]=T.useState([]),[W,I]=T.useState(!0),[X,E]=T.useState(!1),[Q,$]=T.useState([]),[J,ve]=T.useState(!0),[ee,L]=T.useState(!1),[O,H]=T.useState([]),[M,ie]=T.useState(!0),[V,se]=T.useState(!1),[ze,Re]=T.useState([]),[De,Pe]=T.useState(null),[Ge,nt]=T.useState(!1),[ht,A]=T.useState("round-robin"),[pe,re]=T.useState(!1),[Y,F]=T.useState("system"),[ne,me]=T.useState([]),[de,K]=T.useState(!1),xe=T.useCallback(async()=>{_(!0);try{const[be,je]=await Promise.all([fetch("/api/data/captures"),fetch("/api/data/cookies")]),Ne=be.ok?await be.json():{captures:[]},Te=je.ok?await je.json():{cookies:[],origins:[]};w(Array.isArray(Ne.captures)?Ne.captures:[]),j(Array.isArray(Te.cookies)?Te.cookies:[]),k(Array.isArray(Te.origins)?Te.origins:[])}catch{w([]),j([]),k([])}finally{_(!1)}},[]),Ee=T.useCallback(async()=>{h(!0);try{const be=await fetch("/api/credentials");be.ok&&c(await be.json())}catch{c([])}finally{h(!1)}},[]),ke=T.useCallback(async be=>{await fetch(`/api/credentials/${be}`,{method:"DELETE"}),c(je=>je.filter(Ne=>Ne.id!==be))},[]),ae=T.useCallback(async be=>{if(!await r(`Delete capture ${be}?`))return;(await fetch(`/api/data/captures/${encodeURIComponent(be)}`,{method:"DELETE"})).ok?(i("Capture deleted.","success"),xe()):i("Delete failed.","error")},[r,i,xe]),ye=T.useCallback(async be=>{if(!await r(`Delete cookie ${be.name}?`))return;(await fetch("/api/data/cookies/delete",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:be.name,domain:be.domain,path:be.path})})).ok?(i("Cookie deleted.","success"),xe()):i("Delete failed.","error")},[r,i,xe]),Ae=async()=>{z(!0);try{const be=await fetch("/api/settings/api-key",{credentials:"include"});if(!be.ok){be.status===401&&i("Session expired. Please log in again.","error"),B(null);return}const je=await be.json();B(je.apiKey||null)}catch{B(null)}finally{z(!1)}},Ie=async()=>{I(!0);try{const be=await fetch("/api/settings/gemini-api-key",{credentials:"include"});if(!be.ok){be.status===401&&i("Session expired. Please log in again.","error"),q([]);return}const je=await be.json();q(Array.isArray(je.geminiApiKeys)?je.geminiApiKeys:[])}catch{q([])}finally{I(!1)}},fe=async()=>{ve(!0);try{const be=await fetch("/api/settings/openai-api-key",{credentials:"include"});if(!be.ok){be.status===401&&i("Session expired. Please log in again.","error"),$([]);return}const je=await be.json();$(Array.isArray(je.openAiApiKeys)?je.openAiApiKeys:[])}catch{$([])}finally{ve(!1)}},we=async()=>{ie(!0);try{const be=await fetch("/api/settings/claude-api-key",{credentials:"include"});if(!be.ok){be.status===401&&i("Session expired. Please log in again.","error"),H([]);return}const je=await be.json();H(Array.isArray(je.claudeApiKeys)?je.claudeApiKeys:[])}catch{H([])}finally{ie(!1)}},Me=async()=>{re(!0);try{const be=await fetch("/api/settings/proxies",{credentials:"include"});if(!be.ok){be.status===401&&i("Session expired. Please log in again.","error"),Re([]),Pe(null),A("round-robin");return}const je=await be.json();Re(Array.isArray(je.proxies)?je.proxies:[]),Pe(je.defaultProxyId||null),nt(!!je.includeDefaultInRotation),A(je.rotationMode==="random"?"random":"round-robin")}catch{Re([]),Pe(null),nt(!1),A("round-robin")}finally{re(!1)}},Be=async be=>{re(!0);try{const je=await fetch("/api/settings/proxies",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(be)});if(!je.ok){let Te="";try{const st=await je.json();Te=st?.error||st?.message||""}catch{Te=""}i(`Failed to add proxy${Te?`: ${Te}`:""}.`,"error");return}const Ne=await je.json();Re(Array.isArray(Ne.proxies)?Ne.proxies:[]),Pe(Ne.defaultProxyId||null),nt(!!Ne.includeDefaultInRotation),A(Ne.rotationMode==="random"?"random":"round-robin"),i("Proxy added.","success")}catch{i("Failed to add proxy.","error")}finally{re(!1)}},Ve=async()=>{K(!0);try{const be=await fetch("/api/settings/user-agent",{credentials:"include"});if(!be.ok){be.status===401&&i("Session expired. Please log in again.","error"),F("system"),me([]);return}const je=await be.json();F(je.selection==="system"?"system":String(je.selection||"system")),me(Array.isArray(je.userAgents)?je.userAgents:[])}catch{F("system"),me([])}finally{K(!1)}},Ke=async be=>{K(!0);try{const je=await fetch("/api/settings/user-agent",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({selection:be})});if(!je.ok){i("Failed to update user agent.","error");return}const Ne=await je.json();F(Ne.selection==="system"?"system":String(Ne.selection||"system")),me(Array.isArray(Ne.userAgents)?Ne.userAgents:[]),i("User agent updated.","success")}catch{i("Failed to update user agent.","error")}finally{K(!1)}},Le=async be=>{if(!be.length){i("No valid proxies found in file.","error");return}re(!0);try{const je=await fetch("/api/settings/proxies/import",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({proxies:be})});if(!je.ok){let Te="";try{const st=await je.json();Te=st?.error||st?.message||""}catch{Te=""}i(`Failed to import proxies${Te?`: ${Te}`:""}.`,"error");return}const Ne=await je.json();Re(Array.isArray(Ne.proxies)?Ne.proxies:[]),Pe(Ne.defaultProxyId||null),nt(!!Ne.includeDefaultInRotation),A(Ne.rotationMode==="random"?"random":"round-robin"),i("Proxies imported.","success")}catch{i("Failed to import proxies.","error")}finally{re(!1)}},Je=async(be,je)=>{re(!0);try{const Ne=await fetch(`/api/settings/proxies/${encodeURIComponent(be)}`,{method:"PUT",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(je)});if(!Ne.ok){let st="";try{const Gt=await Ne.json();st=Gt?.error||Gt?.message||""}catch{st=""}i(`Failed to update proxy${st?`: ${st}`:""}.`,"error");return}const Te=await Ne.json();Re(Array.isArray(Te.proxies)?Te.proxies:[]),Pe(Te.defaultProxyId||null),nt(!!Te.includeDefaultInRotation),A(Te.rotationMode==="random"?"random":"round-robin"),i("Proxy updated.","success")}catch{i("Failed to update proxy.","error")}finally{re(!1)}},ct=async be=>{if(!(be==="host"||!await r("Delete this proxy?"))){re(!0);try{const Ne=await fetch(`/api/settings/proxies/${encodeURIComponent(be)}`,{method:"DELETE",credentials:"include"});if(!Ne.ok){i("Delete failed.","error");return}const Te=await Ne.json();Re(Array.isArray(Te.proxies)?Te.proxies:[]),Pe(Te.defaultProxyId||null),nt(!!Te.includeDefaultInRotation),A(Te.rotationMode==="random"?"random":"round-robin"),i("Proxy deleted.","success")}catch{i("Delete failed.","error")}finally{re(!1)}}},En=async be=>{if(!(be.length===0||!await r(`Delete ${be.length} proxies?`))){re(!0);try{const Ne=await fetch("/api/settings/proxies",{method:"DELETE",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({ids:be})});if(!Ne.ok){i("Bulk delete failed.","error");return}const Te=await Ne.json();Re(Array.isArray(Te.proxies)?Te.proxies:[]),Pe(Te.defaultProxyId||null),nt(!!Te.includeDefaultInRotation),A(Te.rotationMode==="random"?"random":"round-robin"),i(`${be.length} proxies deleted.`,"success")}catch{i("Bulk delete failed.","error")}finally{re(!1)}}},On=async be=>{const je=be==="host"?null:be;re(!0);try{const Ne=await fetch("/api/settings/proxies/default",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({id:je})});if(!Ne.ok){i("Failed to set default.","error");return}const Te=await Ne.json();Re(Array.isArray(Te.proxies)?Te.proxies:[]),Pe(Te.defaultProxyId||null),nt(!!Te.includeDefaultInRotation),A(Te.rotationMode==="random"?"random":"round-robin"),i("Default proxy updated.","success")}catch{i("Failed to set default.","error")}finally{re(!1)}},Vn=async be=>{re(!0);try{const je=await fetch("/api/settings/proxies/rotation",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({includeDefaultInRotation:be})});if(!je.ok){i("Failed to update rotation setting.","error");return}const Ne=await je.json();Re(Array.isArray(Ne.proxies)?Ne.proxies:[]),Pe(Ne.defaultProxyId||null),nt(!!Ne.includeDefaultInRotation),A(Ne.rotationMode==="random"?"random":"round-robin"),i("Rotation setting updated.","success")}catch{i("Failed to update rotation setting.","error")}finally{re(!1)}},pn=async be=>{re(!0);try{const je=await fetch("/api/settings/proxies/rotation",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({rotationMode:be})});if(!je.ok){i("Failed to update rotation mode.","error");return}const Ne=await je.json();Re(Array.isArray(Ne.proxies)?Ne.proxies:[]),Pe(Ne.defaultProxyId||null),nt(!!Ne.includeDefaultInRotation),A(Ne.rotationMode==="random"?"random":"round-robin"),i("Rotation mode updated.","success")}catch{i("Failed to update rotation mode.","error")}finally{re(!1)}},Xt=async()=>{G(!0);try{const be=await fetch("/api/settings/api-key",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include"});if(!be.ok){let Ne="";try{const Te=await be.json();Ne=Te?.error||Te?.message||""}catch{Ne=""}be.status===401?i("Session expired. Please log in again.","error"):i(`Failed to generate API key${Ne?`: ${Ne}`:""}.`,"error");return}const je=await be.json();B(je.apiKey||null),i("API key generated.","success")}catch{i("Failed to generate API key.","error")}finally{G(!1)}},hi=async be=>{E(!0);try{const je=await fetch("/api/settings/gemini-api-key",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({geminiApiKeys:be})});if(!je.ok){je.status===401?i("Session expired. Please log in again.","error"):i("Failed to save Gemini API keys.","error");return}const Ne=await je.json();q(Array.isArray(Ne.geminiApiKeys)?Ne.geminiApiKeys:[]),i("Gemini API keys saved.","success")}catch{i("Failed to save Gemini API keys.","error")}finally{E(!1)}},Yn=async be=>{L(!0);try{const je=await fetch("/api/settings/openai-api-key",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({openAiApiKeys:be})});if(!je.ok){je.status===401?i("Session expired. Please log in again.","error"):i("Failed to save OpenAI API keys.","error");return}const Ne=await je.json();$(Array.isArray(Ne.openAiApiKeys)?Ne.openAiApiKeys:[]),i("OpenAI API keys saved.","success")}catch{i("Failed to save OpenAI API keys.","error")}finally{L(!1)}},nr=async be=>{se(!0);try{const je=await fetch("/api/settings/claude-api-key",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({claudeApiKeys:be})});if(!je.ok){je.status===401?i("Session expired. Please log in again.","error"):i("Failed to save Claude API keys.","error");return}const Ne=await je.json();H(Array.isArray(Ne.claudeApiKeys)?Ne.claudeApiKeys:[]),i("Claude API keys saved.","success")}catch{i("Failed to save Claude API keys.","error")}finally{se(!1)}};T.useEffect(()=>{l==="data"&&xe(),l==="system"&&(Ae(),Ie(),fe(),we(),Ve(),Ee()),l==="proxies"&&Me()},[l]),T.useEffect(()=>{l==="system"&&(Ae(),Ie(),fe(),we(),Ee())},[]);const bl=[{id:"gemini_api_key",name:"Gemini API Key",iconUrl:"https://www.google.com/s2/favicons?domain=gemini.google.com&sz=128",disabled:!1},{id:"anthropic_api_key",name:"Anthropic API Key",iconUrl:"https://cdn.jsdelivr.net/gh/selfhst/icons@main/svg/claude.svg",disabled:!1},{id:"openai_api_key",name:"OpenAI API Key",iconUrl:"https://cdn.jsdelivr.net/gh/selfhst/icons@main/svg/openai.svg",disabled:!1},{id:"ollama_api_key",name:"Ollama API Key",iconUrl:"https://cdn.jsdelivr.net/gh/selfhst/icons@main/svg/ollama.svg",disabled:!0}],ir=[{providerKey:"baserow",name:"Baserow",iconUrl:"https://www.google.com/s2/favicons?domain=baserow.io&sz=128"}],Pi=async be=>{try{const je=await fetch("/api/credentials",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(be)});if(!je.ok){const Te=await je.json().catch(()=>({}));return console.error("[handleAddDbCredential] API error",je.status,Te),!1}const Ne=await je.json();return c(Te=>[...Te,Ne]),i("Credential saved.","success"),!0}catch(je){return console.error("[handleAddDbCredential] fetch error:",je),!1}},Dn=[{id:"doppelganger_api_key",name:"Tasks API",description:"Manage task API access via `x-api-key` header",icon:"database",value:N,saving:R,loading:D,showCopyButton:!0,readOnly:!0,onSave:async()=>{},onRegenerate:async()=>{await Xt()}}];P.filter(be=>be&&be.trim()).forEach((be,je)=>{Dn.push({id:`gemini_api_key_${je}`,name:"Gemini API Key",description:"Provide an API Key from Google AI Studio for AI features",iconUrl:"https://www.google.com/s2/favicons?domain=gemini.google.com&sz=128",value:be,saving:X,loading:W,badge:je===0?"Primary":"Backup",onSave:async Ne=>{const Te=[...P];Te[je]=Ne,await hi(Te)},onDelete:async()=>{const Ne=P.filter((Te,st)=>st!==je);await hi(Ne)}})}),Q.filter(be=>be&&be.trim()).forEach((be,je)=>{Dn.push({id:`openai_api_key_${je}`,name:"OpenAI API Key",description:"Provide an API Key from OpenAI for AI features",iconUrl:"https://cdn.jsdelivr.net/gh/selfhst/icons@main/svg/openai.svg",value:be,saving:ee,loading:J,badge:je===0?"Primary":"Backup",onSave:async Ne=>{const Te=[...Q];Te[je]=Ne,await Yn(Te)},onDelete:async()=>{const Ne=Q.filter((Te,st)=>st!==je);await Yn(Ne)}})}),O.filter(be=>be&&be.trim()).forEach((be,je)=>{Dn.push({id:`anthropic_api_key_${je}`,name:"Anthropic API Key",description:"Provide an API Key from Anthropic for AI features",iconUrl:"https://cdn.jsdelivr.net/gh/selfhst/icons@main/svg/claude.svg",value:be,saving:V,loading:M,badge:je===0?"Primary":"Backup",onSave:async Ne=>{const Te=[...O];Te[je]=Ne,await nr(Te)},onDelete:async()=>{const Ne=O.filter((Te,st)=>st!==je);await nr(Ne)}})});const ar=p.filter(be=>be==="gemini_api_key").length;for(let be=0;be<ar;be++)Dn.push({id:`gemini_api_key_unsaved_${be}`,name:"Gemini API Key",description:"Provide an API Key from Google AI Studio for AI features",iconUrl:"https://www.google.com/s2/favicons?domain=gemini.google.com&sz=128",value:null,saving:X,loading:W,startEditing:!0,onSave:async je=>{const Ne=[...P,je];await hi(Ne),b(Te=>{const st=Te.indexOf("gemini_api_key");if(st!==-1){const Gt=[...Te];return Gt.splice(st,1),Gt}return Te})},onDelete:async()=>{b(je=>{const Ne=je.indexOf("gemini_api_key");if(Ne!==-1){const Te=[...je];return Te.splice(Ne,1),Te}return je})}});const rr=p.filter(be=>be==="openai_api_key").length;for(let be=0;be<rr;be++)Dn.push({id:`openai_api_key_unsaved_${be}`,name:"OpenAI API Key",description:"Provide an API Key from OpenAI for AI features",iconUrl:"https://cdn.jsdelivr.net/gh/selfhst/icons@main/svg/openai.svg",value:null,saving:ee,loading:J,startEditing:!0,onSave:async je=>{const Ne=[...Q,je];await Yn(Ne),b(Te=>{const st=Te.indexOf("openai_api_key");if(st!==-1){const Gt=[...Te];return Gt.splice(st,1),Gt}return Te})},onDelete:async()=>{b(je=>{const Ne=je.indexOf("openai_api_key");if(Ne!==-1){const Te=[...je];return Te.splice(Ne,1),Te}return je})}});const yl=p.filter(be=>be==="anthropic_api_key").length;for(let be=0;be<yl;be++)Dn.push({id:`anthropic_api_key_unsaved_${be}`,name:"Anthropic API Key",description:"Provide an API Key from Anthropic for AI features",iconUrl:"https://cdn.jsdelivr.net/gh/selfhst/icons@main/svg/claude.svg",value:null,saving:V,loading:M,startEditing:!0,onSave:async je=>{const Ne=[...O,je];await nr(Ne),b(Te=>{const st=Te.indexOf("anthropic_api_key");if(st!==-1){const Gt=[...Te];return Gt.splice(st,1),Gt}return Te})},onDelete:async()=>{b(je=>{const Ne=je.indexOf("anthropic_api_key");if(Ne!==-1){const Te=[...je];return Te.splice(Ne,1),Te}return je})}});return u.forEach(be=>{Dn.push({id:`db_cred_${be.id}`,name:be.name,description:`${be.provider} · ${be.config.baseUrl}`,iconUrl:"https://www.google.com/s2/favicons?domain=baserow.io&sz=128",value:be.config.token||null,saving:!1,loading:f,onSave:async()=>{},readOnly:!0,onDelete:async()=>{(r?await r(`Delete credential "${be.name}"?`):confirm(`Delete credential "${be.name}"?`))&&await ke(be.id)}})}),d.jsx("main",{className:"flex-1 p-12 overflow-y-auto custom-scrollbar animate-in fade-in duration-500",children:d.jsxs("div",{className:"max-w-3xl mx-auto space-y-8",children:[d.jsx(NC,{tab:l,onTabChange:o}),l==="system"&&d.jsxs(d.Fragment,{children:[d.jsx(bC,{keys:Dn,availableProviders:bl,onAddProvider:be=>b(je=>[...je,be]),dbProviders:ir,onAddDbCredential:Pi,onConfirm:r}),d.jsx(AC,{selection:Y,options:ne,loading:de,onChange:Ke}),d.jsx(zC,{version:gd}),d.jsx(yC,{onClearStorage:t})]}),l==="data"&&d.jsxs(d.Fragment,{children:[d.jsx(jC,{captures:x,loading:S,onRefresh:xe,onDelete:ae}),d.jsx(CC,{cookies:y,originsCount:v.length,loading:S,onClear:()=>t("cookies"),onDelete:ye})]}),l==="proxies"&&d.jsx(EC,{proxies:ze,defaultProxyId:De,includeDefaultInRotation:Ge,rotationMode:ht,loading:pe,onRefresh:Me,onAdd:Be,onImport:Le,onUpdate:Je,onDelete:ct,onDeleteMultiple:En,onSetDefault:On,onToggleIncludeDefault:Vn,onRotationModeChange:pn}),d.jsx("div",{className:"pt-8 flex justify-center border-t border-white/5 mt-8",children:d.jsx(Cx,{})})]})})},xd=({title:t="Loading",subtitle:r})=>d.jsxs("div",{className:"fixed inset-0 z-[80] bg-[#020202] flex items-center justify-center",children:[d.jsx("div",{className:"absolute inset-0 opacity-[0.03] pointer-events-none",style:{backgroundImage:"radial-gradient(#fff 1px, transparent 1px)",backgroundSize:"40px 40px"}}),d.jsxs("div",{className:"glass-card p-10 rounded-[40px] text-center space-y-4",children:[d.jsx("div",{className:"w-12 h-12 mx-auto rounded-full border border-white/10 flex items-center justify-center",children:d.jsx("div",{className:"w-5 h-5 border-2 border-white/20 border-t-white rounded-full animate-spin"})}),d.jsxs("div",{className:"space-y-2",children:[d.jsx("p",{className:"text-[10px] font-bold uppercase tracking-[0.4em] text-gray-500",children:t}),r&&d.jsx("p",{className:"text-xs font-mono text-white/80",children:r})]})]})]}),Vs=140,DC=6,MC=4,LC=({index:t,style:r,data:i})=>{const l=i.items[t];return l?d.jsxs("div",{style:r,onClick:()=>i.navigate(`/executions/${l.id}`),onKeyDown:o=>{(o.key==="Enter"||o.key===" ")&&(o.preventDefault(),i.navigate(`/executions/${l.id}`))},role:"button",tabIndex:0,className:"glass-card w-full rounded-2xl p-5 flex items-center gap-4 text-left hover:bg-white/[0.06] transition-all cursor-pointer focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50",children:[d.jsx("div",{className:"w-10 h-10 rounded-2xl bg-white/5 flex items-center justify-center text-gray-400",children:l.source==="api"?d.jsx(Ce,{name:"cloud",className:"text-xl"}):d.jsx(Ce,{name:"monitor",className:"text-xl"})}),d.jsxs("div",{className:"flex-1 min-w-0 space-y-1",children:[d.jsx("div",{className:"text-[10px] font-bold text-white uppercase tracking-widest truncate",children:l.taskName||l.mode}),d.jsxs("div",{className:"text-[8px] text-gray-500 uppercase tracking-[0.2em]",children:[new Date(l.timestamp).toLocaleString()," | ",l.source," | ",l.mode," | ",l.status," | ",l.durationMs,"ms"]}),l.url&&d.jsx("div",{className:"text-[9px] text-white/50 truncate font-mono",children:l.url})]}),d.jsx("button",{onClick:o=>{o.stopPropagation(),i.deleteExecution(l.id)},className:"px-4 py-2 text-[9px] font-bold uppercase tracking-widest rounded-xl bg-red-500/5 border border-red-500/10 text-red-400 hover:bg-red-500/10 transition-all focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50","aria-label":`Delete execution ${l.id}`,children:"Delete"})]}):null},BC=({onConfirm:t,onNotify:r})=>{const i=sa(),[l,o]=T.useState([]),[u,c]=T.useState("all"),[f,h]=T.useState(!1),p=T.useCallback(async()=>{h(!0);try{const j=await fetch("/api/executions");if(!j.ok)throw new Error("Failed to load");const v=await j.json();o(Array.isArray(v.executions)?v.executions:[])}catch{o([])}finally{h(!1)}},[]),b=T.useCallback(async()=>{if(!await t("Clear all executions?"))return;(await fetch("/api/executions/clear",{method:"POST"})).ok?(r("Executions cleared.","success"),p()):r("Clear failed.","error")},[p,t,r]),x=T.useCallback(async j=>{if(!await t("Delete this execution?"))return;(await fetch(`/api/executions/${j}`,{method:"DELETE"})).ok?(r("Execution deleted.","success"),o(S=>S.filter(_=>_.id!==j))):r("Delete failed.","error")},[t,r]);T.useEffect(()=>{p()},[p]);const w=T.useMemo(()=>l.filter(j=>u==="all"?!0:j.source===u),[l,u]),y=T.useMemo(()=>({items:w,deleteExecution:x,navigate:i}),[w,x,i]);return d.jsx("main",{className:"flex-1 p-12 overflow-y-auto custom-scrollbar animate-in fade-in duration-500",children:d.jsxs("div",{className:"max-w-6xl mx-auto space-y-8",children:[d.jsxs("div",{className:"flex items-end justify-between",children:[d.jsx("div",{className:"space-y-2",children:d.jsx("h2",{className:"text-2xl font-medium tracking-[0.25em] text-white uppercase",children:"Run History"})}),d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx("div",{role:"tablist",className:"flex bg-white/5 rounded-xl p-1 border border-white/5",children:["all","editor","api"].map(j=>d.jsx("button",{role:"tab","aria-selected":u===j,onClick:()=>c(j),className:`px-4 py-2 text-[9px] font-bold uppercase tracking-widest rounded-lg transition-all focus:outline-none focus-visible:ring-2 ${u===j?"bg-white text-black focus-visible:ring-blue-500":"text-gray-500 hover:text-white focus-visible:ring-white/50"}`,children:j},j))}),d.jsx("button",{onClick:p,disabled:f,"aria-busy":f,className:"w-10 h-10 rounded-2xl border border-white/10 text-gray-400 hover:text-white hover:bg-white/5 transition-all flex items-center justify-center focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50 disabled:opacity-50 disabled:cursor-not-allowed",title:"Refresh","aria-label":"Refresh executions",children:d.jsx(Ce,{name:"sync",className:`text-xl ${f?"animate-spin":""}`})}),d.jsx("button",{onClick:b,className:"w-10 h-10 rounded-2xl border border-red-500/20 text-red-400 hover:bg-red-500/10 transition-all flex items-center justify-center focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50",title:"Clear all","aria-label":"Clear all executions",children:d.jsx(Ce,{name:"delete",className:"text-xl"})})]})]}),f&&d.jsx("div",{className:"text-[9px] text-gray-500 uppercase tracking-widest",children:"Loading executions..."}),!f&&w.length===0&&d.jsx("div",{className:"text-[9px] text-gray-600 uppercase tracking-widest",children:"No executions found."}),!f&&w.length>0&&d.jsx(io,{height:Math.min(Math.max(Vs,w.length*Vs),Vs*DC),itemCount:w.length,itemSize:Vs,width:"100%",overscanCount:MC,itemData:y,className:"custom-scrollbar",children:LC})]})})};function Ub(){const[t,r]=T.useState(null);return T.useEffect(()=>{let i=!1;return(async()=>{try{const o=await fetch("/api/headful/status");if(o.ok){const u=await o.json();i||r(!!u.useNovnc)}else i||r(!1)}catch{i||r(!1)}})(),()=>{i=!0}},[]),t}const UC=t=>{if(!t.result)return null;const r=t.result||{};return{url:t.url||r.url||"",finalUrl:r.final_url||r.finalUrl,html:r.html,data:r.data??r.html??"",screenshotUrl:r.screenshot_url||r.screenshotUrl,logs:r.logs||[],timestamp:new Date(t.timestamp).toLocaleTimeString()}},IC=({onConfirm:t,onNotify:r})=>{const{id:i}=gx(),l=sa(),[o,u]=T.useState(null),[c,f]=T.useState(!1),h=Ub();if(T.useEffect(()=>{(async()=>{if(i){f(!0);try{const x=await fetch(`/api/executions/${i}`);if(!x.ok)throw new Error("Failed to load execution");const w=await x.json();u(w.execution||null)}catch{u(null)}finally{f(!1)}}})()},[i]),c)return d.jsx("main",{className:"flex-1 p-12 overflow-y-auto custom-scrollbar animate-in fade-in duration-500",children:d.jsx("div",{className:"max-w-6xl mx-auto text-[9px] text-gray-500 uppercase tracking-widest",children:"Loading execution..."})});if(!o)return d.jsx("main",{className:"flex-1 p-12 overflow-y-auto custom-scrollbar animate-in fade-in duration-500",children:d.jsxs("div",{className:"max-w-6xl mx-auto space-y-6",children:[d.jsx("button",{onClick:()=>l("/executions"),className:"px-4 py-2 text-[9px] font-bold uppercase tracking-widest rounded-xl bg-white/5 border border-white/10 text-white hover:bg-white/10 transition-all",children:"Back"}),d.jsx("div",{className:"text-[9px] text-gray-600 uppercase tracking-widest",children:"Execution not found."})]})});const p=UC(o);return d.jsx("main",{className:"flex-1 p-12 overflow-y-auto custom-scrollbar animate-in fade-in duration-500",children:d.jsxs("div",{className:"max-w-6xl mx-auto space-y-8",children:[d.jsxs("div",{className:"flex items-end justify-between",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx("h2",{className:"text-3xl font-bold tracking-tighter text-white",children:o.taskName||o.mode}),d.jsxs("div",{className:"text-[8px] text-gray-500 uppercase tracking-[0.2em]",children:[new Date(o.timestamp).toLocaleString()," | ",o.source," | ",o.mode," | ",o.status," | ",o.durationMs,"ms"]})]}),d.jsx("button",{onClick:()=>l("/executions"),className:"px-4 py-2 text-[9px] font-bold uppercase tracking-widest rounded-xl bg-white/5 border border-white/10 text-white hover:bg-white/10 transition-all",children:"Back"})]}),d.jsxs("div",{className:"glass-card rounded-[32px] p-8 flex flex-col min-h-[420px]",children:[d.jsx("div",{className:"flex items-center justify-between border-b border-white/5 pb-4 mb-6",children:d.jsx("span",{className:"text-[8px] font-bold text-gray-500 uppercase tracking-widest",children:"Output"})}),p?d.jsx(Tx,{results:p,isExecuting:!1,onConfirm:t,onNotify:r,fullWidth:!0,useNovnc:h}):d.jsx("div",{className:"text-[9px] text-gray-500 uppercase tracking-widest",children:"No output captured."})]})]})})},HC=360,Ib=12,Ys=HC+Ib,PC=6,FC=4,qC=({index:t,style:r,data:i})=>{const l=i.captures[t];return l?d.jsx("div",{style:{...r,paddingBottom:Ib},children:d.jsx(Ax,{capture:l,onDelete:i.onDelete})}):null},VC=({onConfirm:t,onNotify:r})=>{const i=sa(),[l,o]=T.useState([]),[u,c]=T.useState(!1),f=async()=>{c(!0);try{const b=await fetch("/api/data/captures"),x=b.ok?await b.json():{captures:[]};o(Array.isArray(x.captures)?x.captures:[])}catch{o([])}finally{c(!1)}},h=T.useCallback(async b=>{if(!await t(`Delete capture ${b}?`))return;(await fetch(`/api/data/captures/${encodeURIComponent(b)}`,{method:"DELETE"})).ok?(o(y=>y.filter(j=>j.name!==b)),r("Capture deleted.","success")):r("Delete failed.","error")},[t,r]);T.useEffect(()=>{f()},[]);const p=T.useMemo(()=>({captures:l,onDelete:h}),[l,h]);return d.jsx("main",{className:"flex-1 p-12 overflow-y-auto custom-scrollbar animate-in fade-in duration-500",children:d.jsxs("div",{className:"max-w-6xl mx-auto space-y-8",children:[d.jsxs("div",{className:"flex items-end justify-between",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx("h2",{className:"text-2xl font-medium tracking-[0.25em] text-white uppercase",children:"All Captures"}),d.jsx("div",{className:"text-[8px] text-gray-500 uppercase tracking-[0.2em]",children:"Recordings and screenshots from every run"})]}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsxs("button",{onClick:f,disabled:u,"aria-busy":u,className:"px-4 py-2 text-[9px] font-bold uppercase tracking-widest rounded-xl bg-white/5 border border-white/10 text-white hover:bg-white/10 transition-all disabled:opacity-50 inline-flex items-center gap-2",children:[d.jsx(Ce,{name:"sync",className:`text-base ${u?"animate-spin":""}`}),"Refresh"]}),d.jsx("button",{onClick:()=>i("/executions"),className:"px-4 py-2 text-[9px] font-bold uppercase tracking-widest rounded-xl bg-white/5 border border-white/10 text-white hover:bg-white/10 transition-all",children:"Executions"})]})]}),d.jsxs("div",{className:"glass-card rounded-[32px] p-8",children:[u&&d.jsx("div",{className:"text-[9px] text-gray-500 uppercase tracking-widest",children:"Loading captures..."}),!u&&l.length===0&&d.jsx("div",{className:"text-[9px] text-gray-600 uppercase tracking-widest",children:"No captures found."}),!u&&l.length>0&&d.jsx("div",{className:"space-y-4",children:d.jsx(io,{height:Math.min(Math.max(Ys,l.length*Ys),Ys*PC),width:"100%",itemCount:l.length,itemSize:Ys,overscanCount:FC,itemData:p,className:"custom-scrollbar",children:qC})})]})]})})},Hb=({title:t="Not Found",subtitle:r="The page you requested does not exist.",onBack:i})=>d.jsx("div",{className:"h-full flex items-center justify-center px-10",children:d.jsxs("div",{className:"glass-card w-full max-w-2xl rounded-[40px] border border-white/10 p-10 text-center space-y-6",children:[d.jsx("div",{className:"text-[10px] font-bold uppercase tracking-[0.4em] text-gray-500",children:"404"}),d.jsx("h2",{className:"text-3xl font-bold tracking-tighter text-white",children:t}),d.jsx("p",{className:"text-[10px] font-bold uppercase tracking-[0.25em] text-gray-500",children:r}),i&&d.jsxs("button",{onClick:i,className:"mt-2 inline-flex items-center gap-2 px-6 py-3 rounded-2xl bg-white text-black text-[9px] font-bold uppercase tracking-[0.3em] hover:scale-105 transition-all",children:[d.jsx(Ce,{name:"arrow_back",className:"text-base"}),"Back"]})]})}),YC=({message:t,tone:r,onClose:i})=>{const[l,o]=T.useState(!1);return T.useEffect(()=>{const u=setTimeout(()=>{o(!0)},2500);return()=>clearTimeout(u)},[]),T.useEffect(()=>{if(!l)return;const u=setTimeout(()=>i(),240);return()=>clearTimeout(u)},[l,i]),d.jsx("div",{className:`fixed bottom-6 right-6 z-[220] max-w-sm w-full ${l?"animate-out fade-out slide-out-to-bottom-3 duration-200":"animate-in fade-in slide-in-from-bottom-3 duration-300"}`,children:d.jsxs("div",{role:r==="error"?"alert":"status",className:`glass-card rounded-2xl border border-white/10 p-4 shadow-2xl flex items-start gap-3 ${l?"animate-out fade-out zoom-out-95 duration-200":"animate-in fade-in zoom-in-95 duration-300"}`,children:[d.jsx("div",{className:`mt-1 h-2.5 w-2.5 rounded-full ${r==="error"?"bg-red-400":"bg-emerald-400"}`}),d.jsxs("div",{className:"flex-1",children:[d.jsx("p",{className:"text-[8px] font-bold uppercase tracking-[0.35em] text-gray-500",children:"Notification"}),d.jsx("p",{className:"mt-2 font-mono text-[11px] text-white leading-relaxed",children:t})]}),d.jsx("button",{onClick:()=>o(!0),className:"px-2 py-1 text-[8px] font-bold uppercase tracking-[0.2em] text-white/60 hover:text-white focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50 rounded","aria-label":"Close notification",children:"Close"})]})})},GC=({request:t,onResolve:r})=>d.jsx("div",{className:"fixed inset-0 z-[201] flex items-center justify-center bg-black/70 backdrop-blur-sm px-6",children:d.jsxs("div",{className:"glass-card w-full max-w-md rounded-[32px] border border-white/10 p-8 text-center shadow-2xl",children:[d.jsx("p",{className:"text-[10px] font-bold uppercase tracking-[0.4em] text-gray-500",children:t.title??"Confirm"}),d.jsx("p",{className:"mt-4 font-mono text-sm text-white",children:t.message}),d.jsxs("div",{className:"mt-6 flex gap-4",children:[d.jsx("button",{onClick:()=>r(!1),className:"w-full rounded-2xl px-6 py-3 text-[9px] font-bold uppercase tracking-[0.3em] transition-all bg-white/5 border border-white/10 text-gray-300 hover:bg-white/10 focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50",children:t.cancelLabel??"Cancel"}),d.jsx("button",{onClick:()=>r(!0),className:"w-full rounded-2xl px-6 py-3 text-[9px] font-bold uppercase tracking-[0.3em] transition-all bg-white text-black hover:scale-105 shadow-xl shadow-white/10 focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-500",children:t.confirmLabel??"Confirm"})]})]})}),KC=({tasks:t,loadTasks:r,touchTask:i,currentTask:l,setCurrentTask:o,onTaskLoaded:u,...c})=>{const{id:f}=gx(),h=sa(),[p,b]=T.useState(!1),[x,w]=T.useState(!1);return T.useEffect(()=>{(async()=>{if(l?.id===f)return;b(!0),w(!1);let j=t;t.length===0&&(j=await r());const v=j.find(k=>String(k.id)===String(f));if(v){const k={...v};(!k.variables||Array.isArray(k.variables))&&(k.variables={}),k.stealth||(k.stealth={allowTypos:!1,idleMovements:!1,overscroll:!1,deadClicks:!1,fatigue:!1,naturalTyping:!1,cursorGlide:!1,randomizeClicks:!1}),k.stealth.cursorGlide===void 0&&(k.stealth.cursorGlide=k.stealth.humanCursor??!1),delete k.stealth.humanCursor,k.stealth.randomizeClicks===void 0&&(k.stealth.randomizeClicks=!1),Array.isArray(k.actions)&&(k.actions=k.actions.map((S,_)=>S&&S.id?S:{...S,id:`act_${Date.now()}_${_}_${Math.floor(Math.random()*1e3)}`})),k.includeShadowDom===void 0&&(k.includeShadowDom=!0),o(k),u?.(k),f&&i(f)}else w(!0);b(!1)})()},[f,t]),x?d.jsx(Hb,{title:"Task Not Found",subtitle:"This task does not exist or was deleted.",onBack:()=>h("/dashboard")}):p||!l||String(l.id)!==String(f)?d.jsx(xd,{title:"Loading Mission Data",subtitle:"Syncing task payload"}):d.jsx(Lb,{currentTask:l,setCurrentTask:o,tasks:t,...c})},ex="doppelganger.seenReleaseNotes_0_8";function $C(){const[t,r]=T.useState(!1),[i,l]=T.useState(""),[o,u]=T.useState(!0);T.useEffect(()=>{gd.startsWith("0.8.")&&(localStorage.getItem(ex)||(r(!0),c()))},[]);const c=async()=>{try{const h=await fetch("https://api.github.com/repos/figranium/figranium/releases/tags/v0.8.0");if(h.ok){const p=await h.json();l(p.body||"No release notes available.")}else l("Failed to load release notes. Please check our GitHub repository.")}catch{l("Failed to load release notes. Please check our GitHub repository.")}finally{u(!1)}},f=()=>{r(!1),localStorage.setItem(ex,"true")};return t?d.jsx("div",{className:"fixed inset-0 z-[300] flex items-center justify-center bg-black/70 backdrop-blur-sm px-6",children:d.jsxs("div",{className:"glass-card w-full max-w-2xl max-h-[80vh] flex flex-col rounded-[32px] border border-white/10 p-8 text-left shadow-2xl overflow-hidden",children:[d.jsxs("div",{className:"flex justify-between items-center mb-6 shrink-0",children:[d.jsx("h2",{className:"text-lg md:text-2xl font-bold text-white tracking-tight",children:"What's new in v0.8.0"}),d.jsxs("span",{className:"bg-white/10 text-white/70 px-3 py-1 rounded-full text-xs font-mono ml-4 shrink-0",children:["v",gd]})]}),d.jsx("div",{className:"flex-1 overflow-y-auto pr-2 custom-scrollbar text-sm text-gray-300",children:o?d.jsx("div",{className:"flex justify-center items-center h-32",children:d.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-white"})}):d.jsx("div",{className:"whitespace-pre-wrap font-mono text-xs",children:i})}),d.jsx("div",{className:"mt-8 flex justify-end shrink-0",children:d.jsx("button",{onClick:f,className:"rounded-2xl px-8 py-3 text-[10px] font-bold uppercase tracking-[0.3em] transition-all bg-white text-black hover:scale-105 shadow-xl shadow-white/10 focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-500",children:"Got it"})})]})}):null}const XC=(t,r)=>{if(typeof t!="string"||!t)return r;switch(t){case"ALREADY_SETUP":return"An account already exists";case"INVALID":return"Invalid credentials";case"SESSION_SAVE_FAILED":return"Unable to persist your session";default:{const i=t.toLowerCase().replace(/_/g," ");return i.charAt(0).toUpperCase()+i.slice(1)}}};function ZC(){const t=sa(),[r,i]=T.useState(null),[l,o]=T.useState("checking"),[u,c]=T.useState(""),[f,h]=T.useState(!1),p=T.useCallback(async()=>{try{const y=await(await fetch("/api/auth/me",{credentials:"include"})).json();if(y.authenticated)return i(y.user),o("authenticated"),!0;const v=await(await fetch("/api/auth/check-setup",{credentials:"include"})).json();o(v.setupRequired?"setup":"login")}catch{o("login")}return!1},[]);T.useEffect(()=>{p()},[p]);const b=T.useCallback(async(w,y,j,v)=>{if(!w||!y){c("Email and password are required");return}if(l==="setup"&&(!j||y!==v)){c(j?"Passwords do not match":"Name required");return}if(f)return;const k=l==="setup"?"/api/auth/setup":"/api/auth/login",S=l==="setup"?{name:j,email:w,password:y}:{email:w,password:y};h(!0);try{const _=await fetch(k,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(S)}),N=await _.json().catch(()=>({}));if(_.ok)c(""),o("checking"),await p()?t("/"):(c("Authentication failed"),o("login"));else{const B=l==="setup"?"Setup failed":"Invalid credentials";c(XC(N?.error,B))}}catch{c("Network error")}finally{h(!1)}},[l,f,t,p]),x=T.useCallback(async w=>{await w("Are you sure you want to log out?")&&(await fetch("/api/auth/logout",{method:"POST",credentials:"include"}),i(null),o("login"),t("/"))},[t]);return{user:r,setUser:i,authStatus:l,setAuthStatus:o,authError:u,authBusy:f,checkAuth:p,handleAuthSubmit:b,logout:x}}const tx=t=>{if(!t)return"";const{last_opened:r,versions:i,...l}=t;return JSON.stringify(l)},eo=t=>{if(typeof t=="boolean")return t;if(t==null)return!1;const r=String(t).toLowerCase();return r==="true"||r==="1"},QC=t=>t&&t[0].toUpperCase()+t.slice(1),Pb=t=>{if(!t.actions||!Array.isArray(t.actions))return t;let r=!1;const i=t.actions.map((l,o)=>l.id?l:(r=!0,{...l,id:`act_${Date.now()}_${o}_${Math.floor(Math.random()*1e3)}`}));return r?{...t,actions:i}:t},JC=()=>({name:"Imported Task",url:"",mode:"scrape",wait:3,selector:"",rotateUserAgents:!1,rotateProxies:!1,rotateViewport:!1,humanTyping:!1,stealth:{allowTypos:!1,idleMovements:!1,overscroll:!1,deadClicks:!1,fatigue:!1,naturalTyping:!1,cursorGlide:!1,randomizeClicks:!1},actions:[],variables:{},includeShadowDom:!0,disableRecording:!1,statelessExecution:!1}),WC=(t,r)=>{if(!t||typeof t!="object")return null;const i=JC(),l={...i,...t};return(!l.name||typeof l.name!="string")&&(l.name=`Imported Task ${r+1}`),(!l.mode||!["scrape","agent","headful"].includes(l.mode))&&(l.mode="scrape"),typeof l.wait!="number"&&(l.wait=3),l.stealth||(l.stealth=i.stealth),(!l.variables||Array.isArray(l.variables))&&(l.variables={}),Array.isArray(l.actions)||(l.actions=[]),l.rotateProxies===void 0&&(l.rotateProxies=!1),l.disableRecording===void 0&&(l.disableRecording=!1),l.disableRecording=eo(l.disableRecording),l.statelessExecution===void 0&&(l.statelessExecution=!1),l.statelessExecution=eo(l.statelessExecution),delete l.versions,delete l.last_opened,l},eN=()=>({name:"Task "+Math.floor(Math.random()*100),url:"",mode:"agent",wait:3,selector:"",rotateUserAgents:!1,rotateProxies:!1,rotateViewport:!1,humanTyping:!1,stealth:{allowTypos:!1,idleMovements:!1,overscroll:!1,deadClicks:!1,fatigue:!1,naturalTyping:!1,cursorGlide:!1,randomizeClicks:!1},actions:[],variables:{},extractionFormat:"json",includeHtml:!1,includeShadowDom:!0,disableRecording:!1,statelessExecution:!1});function tN(t,r,i){const[l,o]=T.useState([]),[u,c]=T.useState(null),f=T.useRef(null);T.useEffect(()=>{f.current=u},[u]);const h=T.useCallback(async()=>{try{const _=[...await(await fetch("/api/tasks",{credentials:"include"})).json()].sort((N,B)=>(B.last_opened||0)-(N.last_opened||0));return o(_),_}catch(k){return console.error("Failed to load tasks",k),[]}},[]),p=T.useCallback(async k=>{try{await fetch(`/api/tasks/${k}/touch`,{method:"POST"}),h()}catch(S){console.error("Failed to touch task",S)}},[h]),b=T.useCallback((k,S)=>{const _=eN();S(!0),c(_),k(null),t("/tasks/new")},[t]),x=T.useCallback((k,S,_)=>{const N={...k};(!N.variables||Array.isArray(N.variables))&&(N.variables={}),N.stealth||(N.stealth={allowTypos:!1,idleMovements:!1,overscroll:!1,deadClicks:!1,fatigue:!1,naturalTyping:!1,cursorGlide:!1,randomizeClicks:!1}),N.stealth.cursorGlide===void 0&&(N.stealth.cursorGlide=N.stealth.humanCursor??!1),delete N.stealth.humanCursor,N.stealth.randomizeClicks===void 0&&(N.stealth.randomizeClicks=!1),N.rotateProxies===void 0&&(N.rotateProxies=!1),N.rotateViewport===void 0&&(N.rotateViewport=!1),N.extractionFormat||(N.extractionFormat="json"),N.includeHtml===void 0&&(N.includeHtml=!1),N.includeShadowDom===void 0&&(N.includeShadowDom=!0),N.disableRecording===void 0&&(N.disableRecording=!1),N.disableRecording=eo(N.disableRecording),N.statelessExecution===void 0&&(N.statelessExecution=!1),N.statelessExecution=eo(N.statelessExecution);const B=Pb(N);c(B),S(B),_(null),t(`/tasks/${k.id}`),k.id&&p(k.id)},[t,p]),w=T.useCallback(async(k,S)=>{await i("Are you sure you want to delete this task?")&&(await fetch(`/api/tasks/${k}`,{method:"DELETE"}),h(),S.includes(k)&&t("/dashboard"))},[i,h,t]),y=T.useCallback(async(k,S,_,N=!1)=>{const B=_||f.current;if(!B)return;const D={...B,last_opened:Date.now()},G=await(await fetch(`/api/tasks${N?"?version=true":""}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(D)})).json();c(G),k(G),h(),S.includes("new")&&t(`/tasks/${G.id}`,{replace:!0})},[t,h]),j=T.useCallback(k=>{let S=l;if(k&&k.length>0&&(S=l.filter(R=>R.id&&k.includes(R.id))),S.length===0){r("No tasks selected to export.","error");return}const _={exportedAt:new Date().toISOString(),tasks:S},N=new Blob([JSON.stringify(_,null,2)],{type:"application/json"}),B=URL.createObjectURL(N),D=document.createElement("a"),z=new Date().toISOString().slice(0,10);D.href=B,D.download=`doppelganger-tasks-${z}.json`,document.body.appendChild(D),D.click(),D.remove(),URL.revokeObjectURL(B),r(`Exported ${S.length} task(s).`,"success")},[l,r]),v=T.useCallback(async k=>{try{const S=await k.text(),_=JSON.parse(S);let N=[];if(Array.isArray(_)?N=_:_&&typeof _=="object"&&(Array.isArray(_.tasks)?N=_.tasks:(_.name||_.actions)&&(N=[_])),N.length===0){r("Invalid import file.","error");return}const B=Date.now(),D=N.map((z,R)=>WC(z,R)).filter(z=>!!z).map((z,R)=>z.id?z:{...z,id:`task_${B}_${R}`});if(D.length===0){r("No tasks to import.","error");return}await Promise.all(D.map(z=>fetch("/api/tasks",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(z)}))),await h(),r(`Imported ${D.length} task(s).`,"success")}catch(S){r(`Import failed: ${S.message||"Unknown error"}`,"error")}},[r,h]);return T.useEffect(()=>{h()},[h]),{tasks:l,setTasks:o,currentTask:u,setCurrentTask:c,loadTasks:h,touchTask:p,createNewTask:b,editTask:x,deleteTask:w,saveTask:y,exportTasks:j,importTasks:v}}const nx=(t,r)=>{const i=String(t||"").trim();if(!i)return"Execution failed.";const l=i.toLowerCase();if(r==="headful"){if(l.includes("missing x server")||l.includes("$display"))return"Headful browser could not start because no display server is available.";if(l.includes("failed to connect to the bus"))return"Headful browser could not start due to missing system services."}let o=i;const u=o.indexOf("--disable-");return u>0&&(o=o.slice(0,u).trim()),o.length>240&&(o=`${o.slice(0,240)}...`),o||"Execution failed."},nN=t=>{const r=String(t||"").toLowerCase();return r.includes("missing x server")||r.includes("$display")||r.includes("platform failed to initialize")||r.includes("no display server")};function iN(t){const[r,i]=T.useState(!1),[l,o]=T.useState(!1),[u,c]=T.useState(null),[f,h]=T.useState(null),p=Ub(),b=T.useRef(null),x=async()=>{try{await fetch("/headful/stop",{method:"POST"})}catch(v){console.error("Failed to stop headful session",v)}finally{o(!1)}};return{isExecuting:r,isHeadfulOpen:l,results:u,setResults:c,activeRunId:f,useNovnc:p,runTaskWithSnapshot:async(v,k,S)=>{if(!v||!v.url)return;const _=Pb(v);k&&_!==k&&S(_);const N=`run_${Date.now()}_${Math.floor(Math.random()*1e3)}`;if(h(N),r)return;i(!0),c({url:_.url,logs:[],timestamp:"Running..."});let B=null;try{const D={};Object.entries(_.variables).forEach(([X,E])=>{D[X]=E.value});const z=X=>X.replace(/\\{\$(\w+)\\}/g,(E,Q)=>{if(Q==="now")return new Date().toISOString();const $=D[Q];return $==null||$===""?"":String($)}),R=X=>typeof X!="string"?X:z(X),G=_.mode!=="agent";B={...{..._,url:G?z(_.url||""):_.url||"",selector:G?R(_.selector):_.selector,actions:G?_.actions.map(X=>({...X,selector:R(X.selector),value:R(X.value),key:R(X.key)})):_.actions},taskVariables:D,variables:D,runSource:"editor",taskId:_.id,taskName:_.name,taskSnapshot:_,runId:N};const q=async X=>{const E=new AbortController;b.current=E;const Q=await fetch(`/${X}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(B),signal:E.signal});if(!Q.ok){let $=null;try{$=await Q.json()}catch{$=null}const J=new Error($?.details||$?.error||"Request failed");throw J.code=$?.error,J}return Q.json()},W=_.mode==="headful"?"scrape":_.mode,I=await q(W);c({url:_.url,finalUrl:I.final_url,html:I.html,data:I.data??I.html??"No data captured.",screenshotUrl:I.screenshot_url,downloads:I.downloads,logs:I.logs||[],timestamp:new Date().toLocaleTimeString()})}catch(D){if(D?.name==="AbortError"){t("Execution stopped.","success"),i(!1);return}if(_?.mode==="headful"&&B&&(D?.code==="HEADFUL_DISPLAY_UNAVAILABLE"||nN(D?.message||String(D))))try{const R=await(async()=>{const G=new AbortController;b.current=G;const P=await fetch("/scrape",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(B),signal:G.signal});if(!P.ok){const q=await P.json();throw new Error(q.details||q.error||"Request failed")}return P.json()})();R.logs=["Headful display unavailable; ran headless instead.",...R.logs||[]],c({url:_.url,finalUrl:R.final_url,html:R.html,data:R.data??R.html??"No data captured.",screenshotUrl:R.screenshot_url,downloads:R.downloads,logs:R.logs||[],timestamp:new Date().toLocaleTimeString()}),i(!1);return}catch(R){const G=nx(R?.message||String(R),_?.mode);t(`Execution crash: ${G}`,"error"),i(!1);return}const z=nx(D?.message||String(D),_?.mode);t(`Execution crash: ${z}`,"error"),_?.mode==="headful"&&i(!1)}finally{b.current=null,i(!1)}},stopTask:async()=>{if(f)try{await fetch("/api/executions/stop",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({runId:f})})}catch(v){console.error("Failed to request stop",v)}b.current&&b.current.abort(),i(!1)},openHeadful:async(v,k,S,_)=>{if(l){await x();return}o(!0);try{const N=await fetch("/headful",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({url:v,targetActionId:k,taskSnapshot:S,variables:_})});if(!N.ok){const B=await N.json().catch(()=>({})),D=B?.details||B?.error||"Failed to start headful session";t(D,"error"),o(!1)}}catch{t("Failed to start headful session","error"),o(!1)}},stopHeadful:x}}function aN(){const[t,r]=T.useState(null),[i,l]=T.useState(null),o=T.useRef(null),u=T.useCallback((h,p="success")=>{r({message:h,tone:p}),p==="success"&&setTimeout(()=>{r(b=>b&&b.message===h?null:b)},2e3)},[]),c=T.useCallback(h=>new Promise(p=>{o.current=p,l(typeof h=="string"?{message:h}:h)}),[]),f=T.useCallback(h=>{const p=o.current;o.current=null,l(null),p&&p(h)},[]);return{centerAlert:t,setCenterAlert:r,centerConfirm:i,showAlert:u,requestConfirm:c,closeConfirm:f}}function rN(){const t=sa(),r=Ii(),{centerAlert:i,setCenterAlert:l,centerConfirm:o,showAlert:u,requestConfirm:c,closeConfirm:f}=aN(),{authStatus:h,authError:p,authBusy:b,handleAuthSubmit:x,logout:w}=ZC(),{tasks:y,currentTask:j,setCurrentTask:v,loadTasks:k,touchTask:S,createNewTask:_,editTask:N,deleteTask:B,saveTask:D,exportTasks:z,importTasks:R}=tN(t,u,c),{isExecuting:G,isHeadfulOpen:P,results:q,setResults:W,activeRunId:I,useNovnc:X,runTaskWithSnapshot:E,stopTask:Q,openHeadful:$,stopHeadful:J}=iN(u);T.useEffect(()=>{h==="authenticated"&&k()},[h]);const[ve,ee]=T.useState(!1),L=T.useRef(""),[O,H]=T.useState("visual"),[M,ie]=T.useState({}),V="doppelganger.pinnedResults",ze=(de=>de?.id?String(de.id):"new")(j),Re=j&&M[ze]||null;T.useEffect(()=>{try{const de=localStorage.getItem(V);if(de){const K=JSON.parse(de);K&&typeof K=="object"&&ie(K)}}catch{}},[]),T.useEffect(()=>{try{localStorage.setItem(V,JSON.stringify(M))}catch{}},[M]),T.useEffect(()=>{!r.pathname.startsWith("/tasks")&&O==="history"&&H("visual")},[r.pathname,O]),T.useEffect(()=>{r.pathname==="/tasks/new"&&!j&&_(W,ee)},[r.pathname]),T.useEffect(()=>{if(!j){ee(!1);return}const de=tx(j);ee(de!==L.current)},[j]),T.useEffect(()=>{if(typeof window>"u")return;const de=K=>{ve&&(K.preventDefault(),K.returnValue="")};return window.addEventListener("beforeunload",de),()=>window.removeEventListener("beforeunload",de)},[ve]);const De=T.useCallback(de=>{L.current=tx(de),ee(!1)},[]),Pe=de=>{j&&ie(K=>({...K,[ze]:de}))},Ge=()=>{j&&ie(de=>{const K={...de};return delete K[ze],K})},nt=async de=>{if(!await c(`Delete all ${de}?`))return;await fetch(de==="screenshots"?"/api/clear-screenshots":"/api/clear-cookies",{method:"POST"}),u(`${QC(de)} cleared.`,"success")},ht=()=>r.pathname.startsWith("/tasks")?"editor":r.pathname==="/settings"?"settings":r.pathname==="/executions"?"executions":r.pathname==="/captures"?"captures":"dashboard",A=T.useCallback(de=>{de==="dashboard"?t("/dashboard"):de==="settings"?t("/settings"):de==="executions"?t("/executions"):de==="captures"&&t("/captures")},[t]),pe=T.useCallback(()=>{_(W,ee)},[_,W,ee]),re=T.useCallback(de=>{N(de,De,W)},[N,De,W]),Y=T.useCallback(de=>{B(de,r.pathname)},[B,r.pathname]),F=T.useCallback((de,K)=>D(De,r.pathname,de,K),[D,De,r.pathname]),ne=T.useCallback(()=>{w(c)},[w,c]);let me;return h==="login"||h==="setup"?me=d.jsx(Pw,{status:h,onSubmit:x,error:p,busy:b}):h==="checking"?me=d.jsx(xd,{title:"Authenticating",subtitle:"Verifying session state"}):me=d.jsxs("div",{className:"h-full flex flex-row overflow-hidden bg-[#020202]",children:[d.jsx($C,{}),d.jsx(Hw,{onNavigate:A,onNewTask:pe,onLogout:ne,currentScreen:ht()}),d.jsxs(rw,{children:[d.jsx(In,{path:"/",element:d.jsx(Xm,{tasks:y,onNewTask:pe,onEditTask:re,onDeleteTask:Y,onExportTasks:z,onImportTasks:R})}),d.jsx(In,{path:"/dashboard",element:d.jsx(Xm,{tasks:y,onNewTask:pe,onEditTask:re,onDeleteTask:Y,onExportTasks:z,onImportTasks:R})}),d.jsx(In,{path:"/tasks/new",element:j?d.jsx(Lb,{currentTask:j,setCurrentTask:v,tasks:y,editorView:O,setEditorView:H,isExecuting:G,onSave:F,onRun:()=>E(j,j,v),onRunSnapshot:de=>E(de||j,j,v),results:q,pinnedResults:Re,onConfirm:c,onNotify:u,onPinResults:Pe,onUnpinResults:Ge,runId:I,onStop:()=>Q(),isHeadfulOpen:P,onOpenHeadful:(de,K,xe,Ee)=>$(de,K,xe,Ee),onStopHeadful:J,useNovnc:X}):d.jsx(xd,{title:"Initializing",subtitle:"Preparing task workspace"})}),d.jsx(In,{path:"/tasks/:id",element:d.jsx(KC,{tasks:y,loadTasks:k,touchTask:S,currentTask:j,setCurrentTask:v,editorView:O,setEditorView:H,isExecuting:G,onSave:F,onRun:()=>E(j,j,v),onRunSnapshot:de=>E(de||j,j,v),results:q,pinnedResults:Re,onConfirm:c,onNotify:u,onPinResults:Pe,onUnpinResults:Ge,runId:I,onStop:()=>Q(),onTaskLoaded:De,isHeadfulOpen:P,onOpenHeadful:(de,K,xe,Ee)=>$(de,K,xe,Ee),onStopHeadful:J,useNovnc:X})}),d.jsx(In,{path:"/settings",element:d.jsx(OC,{onClearStorage:nt,onConfirm:c,onNotify:u})}),d.jsx(In,{path:"/executions",element:d.jsx(BC,{onConfirm:c,onNotify:u})}),d.jsx(In,{path:"/executions/:id",element:d.jsx(IC,{onConfirm:c,onNotify:u})}),d.jsx(In,{path:"/captures",element:d.jsx(VC,{onConfirm:c,onNotify:u})}),d.jsx(In,{path:"*",element:d.jsx(Hb,{onBack:()=>t("/dashboard")})})]})]}),d.jsxs("div",{className:"h-full",children:[i&&d.jsx(YC,{message:i.message,tone:i.tone,onClose:()=>l(null)}),o&&d.jsx(GC,{request:o,onResolve:f}),me]})}ov.createRoot(document.getElementById("root")).render(d.jsx(ft.StrictMode,{children:d.jsx(Aw,{children:d.jsx(rN,{})})}));