leglas 1.2.1 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/args.d.ts +19 -0
- package/dist/baseline.d.ts +2 -8
- package/dist/bin-start.d.ts +5 -0
- package/dist/bin.js +3230 -587
- package/dist/dev-server-owner.d.ts +3 -4
- package/dist/explore.d.ts +5 -13
- package/dist/help.d.ts +2 -0
- package/dist/ignore.d.ts +3 -6
- package/dist/index.d.ts +3 -0
- package/dist/index.js +2980 -497
- package/dist/keep.d.ts +3 -10
- package/dist/new.d.ts +3 -4
- package/dist/resolve-title.d.ts +4 -8
- package/dist/rules.d.ts +41 -0
- package/dist/run-classify.d.ts +3 -5
- package/dist/run-explore-build.d.ts +24 -0
- package/dist/run-explore.d.ts +3 -6
- package/dist/run-init.d.ts +3 -4
- package/dist/run-link.d.ts +18 -0
- package/dist/run-log.d.ts +3 -7
- package/dist/run-new.d.ts +4 -7
- package/dist/run-previews.d.ts +4 -4
- package/dist/run-remove.d.ts +17 -0
- package/dist/run-share.d.ts +10 -10
- package/dist/run-show.d.ts +3 -5
- package/dist/run-watch.d.ts +4 -9
- package/dist/run.d.ts +3 -6
- package/dist/running.d.ts +24 -7
- package/dist/shell/assets/index-C59b2VHc.css +1 -0
- package/dist/shell/assets/index-CXz1BSV1.js +14 -0
- package/dist/shell/index.html +2 -2
- package/dist/show.d.ts +7 -16
- package/dist/shutdown.d.ts +7 -22
- package/dist/test-helpers.d.ts +2 -0
- package/package.json +3 -3
- package/dist/shell/assets/index-DfiRUTCS.css +0 -1
- package/dist/shell/assets/index-lVZbvEvf.js +0 -14
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
(function(){const s=document.createElement("link").relList;if(s&&s.supports&&s.supports("modulepreload"))return;for(const f of document.querySelectorAll('link[rel="modulepreload"]'))r(f);new MutationObserver(f=>{for(const d of f)if(d.type==="childList")for(const p of d.addedNodes)p.tagName==="LINK"&&p.rel==="modulepreload"&&r(p)}).observe(document,{childList:!0,subtree:!0});function c(f){const d={};return f.integrity&&(d.integrity=f.integrity),f.referrerPolicy&&(d.referrerPolicy=f.referrerPolicy),f.crossOrigin==="use-credentials"?d.credentials="include":f.crossOrigin==="anonymous"?d.credentials="omit":d.credentials="same-origin",d}function r(f){if(f.ep)return;f.ep=!0;const d=c(f);fetch(f.href,d)}})();var vf={exports:{}},So={};var F0;function ug(){if(F0)return So;F0=1;var a=Symbol.for("react.transitional.element"),s=Symbol.for("react.fragment");function c(r,f,d){var p=null;if(d!==void 0&&(p=""+d),f.key!==void 0&&(p=""+f.key),"key"in f){d={};for(var y in f)y!=="key"&&(d[y]=f[y])}else d=f;return f=d.ref,{$$typeof:a,type:r,key:p,ref:f!==void 0?f:null,props:d}}return So.Fragment=s,So.jsx=c,So.jsxs=c,So}var J0;function rg(){return J0||(J0=1,vf.exports=ug()),vf.exports}var u=rg(),bf={exports:{}},De={};var W0;function cg(){if(W0)return De;W0=1;var a=Symbol.for("react.transitional.element"),s=Symbol.for("react.portal"),c=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),f=Symbol.for("react.profiler"),d=Symbol.for("react.consumer"),p=Symbol.for("react.context"),y=Symbol.for("react.forward_ref"),v=Symbol.for("react.suspense"),g=Symbol.for("react.memo"),S=Symbol.for("react.lazy"),C=Symbol.for("react.activity"),T=Symbol.iterator;function D(E){return E===null||typeof E!="object"?null:(E=T&&E[T]||E["@@iterator"],typeof E=="function"?E:null)}var M={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},U=Object.assign,H={};function R(E,G,le){this.props=E,this.context=G,this.refs=H,this.updater=le||M}R.prototype.isReactComponent={},R.prototype.setState=function(E,G){if(typeof E!="object"&&typeof E!="function"&&E!=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,E,G,"setState")},R.prototype.forceUpdate=function(E){this.updater.enqueueForceUpdate(this,E,"forceUpdate")};function K(){}K.prototype=R.prototype;function Q(E,G,le){this.props=E,this.context=G,this.refs=H,this.updater=le||M}var X=Q.prototype=new K;X.constructor=Q,U(X,R.prototype),X.isPureReactComponent=!0;var ae=Array.isArray;function ne(){}var I={H:null,A:null,T:null,S:null},b=Object.prototype.hasOwnProperty;function ie(E,G,le){var ce=le.ref;return{$$typeof:a,type:E,key:G,ref:ce!==void 0?ce:null,props:le}}function P(E,G){return ie(E.type,G,E.props)}function ye(E){return typeof E=="object"&&E!==null&&E.$$typeof===a}function fe(E){var G={"=":"=0",":":"=2"};return"$"+E.replace(/[=:]/g,function(le){return G[le]})}var Se=/\/+/g;function xe(E,G){return typeof E=="object"&&E!==null&&E.key!=null?fe(""+E.key):G.toString(36)}function Te(E){switch(E.status){case"fulfilled":return E.value;case"rejected":throw E.reason;default:switch(typeof E.status=="string"?E.then(ne,ne):(E.status="pending",E.then(function(G){E.status==="pending"&&(E.status="fulfilled",E.value=G)},function(G){E.status==="pending"&&(E.status="rejected",E.reason=G)})),E.status){case"fulfilled":return E.value;case"rejected":throw E.reason}}throw E}function O(E,G,le,ce,oe){var Ee=typeof E;(Ee==="undefined"||Ee==="boolean")&&(E=null);var L=!1;if(E===null)L=!0;else switch(Ee){case"bigint":case"string":case"number":L=!0;break;case"object":switch(E.$$typeof){case a:case s:L=!0;break;case S:return L=E._init,O(L(E._payload),G,le,ce,oe)}}if(L)return oe=oe(E),L=ce===""?"."+xe(E,0):ce,ae(oe)?(le="",L!=null&&(le=L.replace(Se,"$&/")+"/"),O(oe,G,le,"",function(pe){return pe})):oe!=null&&(ye(oe)&&(oe=P(oe,le+(oe.key==null||E&&E.key===oe.key?"":(""+oe.key).replace(Se,"$&/")+"/")+L)),G.push(oe)),1;L=0;var V=ce===""?".":ce+":";if(ae(E))for(var se=0;se<E.length;se++)ce=E[se],Ee=V+xe(ce,se),L+=O(ce,G,le,Ee,oe);else if(se=D(E),typeof se=="function")for(E=se.call(E),se=0;!(ce=E.next()).done;)ce=ce.value,Ee=V+xe(ce,se++),L+=O(ce,G,le,Ee,oe);else if(Ee==="object"){if(typeof E.then=="function")return O(Te(E),G,le,ce,oe);throw G=String(E),Error("Objects are not valid as a React child (found: "+(G==="[object Object]"?"object with keys {"+Object.keys(E).join(", ")+"}":G)+"). If you meant to render a collection of children, use an array instead.")}return L}function W(E,G,le){if(E==null)return E;var ce=[],oe=0;return O(E,ce,"","",function(Ee){return G.call(le,Ee,oe++)}),ce}function ue(E){if(E._status===-1){var G=E._result;G=G(),G.then(function(le){(E._status===0||E._status===-1)&&(E._status=1,E._result=le)},function(le){(E._status===0||E._status===-1)&&(E._status=2,E._result=le)}),E._status===-1&&(E._status=0,E._result=G)}if(E._status===1)return E._result.default;throw E._result}var je=typeof reportError=="function"?reportError:function(E){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var G=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(G))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",E);return}console.error(E)},Ne={map:W,forEach:function(E,G,le){W(E,function(){G.apply(this,arguments)},le)},count:function(E){var G=0;return W(E,function(){G++}),G},toArray:function(E){return W(E,function(G){return G})||[]},only:function(E){if(!ye(E))throw Error("React.Children.only expected to receive a single React element child.");return E}};return De.Activity=C,De.Children=Ne,De.Component=R,De.Fragment=c,De.Profiler=f,De.PureComponent=Q,De.StrictMode=r,De.Suspense=v,De.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=I,De.__COMPILER_RUNTIME={__proto__:null,c:function(E){return I.H.useMemoCache(E)}},De.cache=function(E){return function(){return E.apply(null,arguments)}},De.cacheSignal=function(){return null},De.cloneElement=function(E,G,le){if(E==null)throw Error("The argument must be a React element, but you passed "+E+".");var ce=U({},E.props),oe=E.key;if(G!=null)for(Ee in G.key!==void 0&&(oe=""+G.key),G)!b.call(G,Ee)||Ee==="key"||Ee==="__self"||Ee==="__source"||Ee==="ref"&&G.ref===void 0||(ce[Ee]=G[Ee]);var Ee=arguments.length-2;if(Ee===1)ce.children=le;else if(1<Ee){for(var L=Array(Ee),V=0;V<Ee;V++)L[V]=arguments[V+2];ce.children=L}return ie(E.type,oe,ce)},De.createContext=function(E){return E={$$typeof:p,_currentValue:E,_currentValue2:E,_threadCount:0,Provider:null,Consumer:null},E.Provider=E,E.Consumer={$$typeof:d,_context:E},E},De.createElement=function(E,G,le){var ce,oe={},Ee=null;if(G!=null)for(ce in G.key!==void 0&&(Ee=""+G.key),G)b.call(G,ce)&&ce!=="key"&&ce!=="__self"&&ce!=="__source"&&(oe[ce]=G[ce]);var L=arguments.length-2;if(L===1)oe.children=le;else if(1<L){for(var V=Array(L),se=0;se<L;se++)V[se]=arguments[se+2];oe.children=V}if(E&&E.defaultProps)for(ce in L=E.defaultProps,L)oe[ce]===void 0&&(oe[ce]=L[ce]);return ie(E,Ee,oe)},De.createRef=function(){return{current:null}},De.forwardRef=function(E){return{$$typeof:y,render:E}},De.isValidElement=ye,De.lazy=function(E){return{$$typeof:S,_payload:{_status:-1,_result:E},_init:ue}},De.memo=function(E,G){return{$$typeof:g,type:E,compare:G===void 0?null:G}},De.startTransition=function(E){var G=I.T,le={};I.T=le;try{var ce=E(),oe=I.S;oe!==null&&oe(le,ce),typeof ce=="object"&&ce!==null&&typeof ce.then=="function"&&ce.then(ne,je)}catch(Ee){je(Ee)}finally{G!==null&&le.types!==null&&(G.types=le.types),I.T=G}},De.unstable_useCacheRefresh=function(){return I.H.useCacheRefresh()},De.use=function(E){return I.H.use(E)},De.useActionState=function(E,G,le){return I.H.useActionState(E,G,le)},De.useCallback=function(E,G){return I.H.useCallback(E,G)},De.useContext=function(E){return I.H.useContext(E)},De.useDebugValue=function(){},De.useDeferredValue=function(E,G){return I.H.useDeferredValue(E,G)},De.useEffect=function(E,G){return I.H.useEffect(E,G)},De.useEffectEvent=function(E){return I.H.useEffectEvent(E)},De.useId=function(){return I.H.useId()},De.useImperativeHandle=function(E,G,le){return I.H.useImperativeHandle(E,G,le)},De.useInsertionEffect=function(E,G){return I.H.useInsertionEffect(E,G)},De.useLayoutEffect=function(E,G){return I.H.useLayoutEffect(E,G)},De.useMemo=function(E,G){return I.H.useMemo(E,G)},De.useOptimistic=function(E,G){return I.H.useOptimistic(E,G)},De.useReducer=function(E,G,le){return I.H.useReducer(E,G,le)},De.useRef=function(E){return I.H.useRef(E)},De.useState=function(E){return I.H.useState(E)},De.useSyncExternalStore=function(E,G,le){return I.H.useSyncExternalStore(E,G,le)},De.useTransition=function(){return I.H.useTransition()},De.version="19.2.8",De}var I0;function Xf(){return I0||(I0=1,bf.exports=cg()),bf.exports}var w=Xf(),wf={exports:{}},jo={},Sf={exports:{}},jf={};var P0;function fg(){return P0||(P0=1,(function(a){function s(O,W){var ue=O.length;O.push(W);e:for(;0<ue;){var je=ue-1>>>1,Ne=O[je];if(0<f(Ne,W))O[je]=W,O[ue]=Ne,ue=je;else break e}}function c(O){return O.length===0?null:O[0]}function r(O){if(O.length===0)return null;var W=O[0],ue=O.pop();if(ue!==W){O[0]=ue;e:for(var je=0,Ne=O.length,E=Ne>>>1;je<E;){var G=2*(je+1)-1,le=O[G],ce=G+1,oe=O[ce];if(0>f(le,ue))ce<Ne&&0>f(oe,le)?(O[je]=oe,O[ce]=ue,je=ce):(O[je]=le,O[G]=ue,je=G);else if(ce<Ne&&0>f(oe,ue))O[je]=oe,O[ce]=ue,je=ce;else break e}}return W}function f(O,W){var ue=O.sortIndex-W.sortIndex;return ue!==0?ue:O.id-W.id}if(a.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var d=performance;a.unstable_now=function(){return d.now()}}else{var p=Date,y=p.now();a.unstable_now=function(){return p.now()-y}}var v=[],g=[],S=1,C=null,T=3,D=!1,M=!1,U=!1,H=!1,R=typeof setTimeout=="function"?setTimeout:null,K=typeof clearTimeout=="function"?clearTimeout:null,Q=typeof setImmediate<"u"?setImmediate:null;function X(O){for(var W=c(g);W!==null;){if(W.callback===null)r(g);else if(W.startTime<=O)r(g),W.sortIndex=W.expirationTime,s(v,W);else break;W=c(g)}}function ae(O){if(U=!1,X(O),!M)if(c(v)!==null)M=!0,ne||(ne=!0,fe());else{var W=c(g);W!==null&&Te(ae,W.startTime-O)}}var ne=!1,I=-1,b=5,ie=-1;function P(){return H?!0:!(a.unstable_now()-ie<b)}function ye(){if(H=!1,ne){var O=a.unstable_now();ie=O;var W=!0;try{e:{M=!1,U&&(U=!1,K(I),I=-1),D=!0;var ue=T;try{t:{for(X(O),C=c(v);C!==null&&!(C.expirationTime>O&&P());){var je=C.callback;if(typeof je=="function"){C.callback=null,T=C.priorityLevel;var Ne=je(C.expirationTime<=O);if(O=a.unstable_now(),typeof Ne=="function"){C.callback=Ne,X(O),W=!0;break t}C===c(v)&&r(v),X(O)}else r(v);C=c(v)}if(C!==null)W=!0;else{var E=c(g);E!==null&&Te(ae,E.startTime-O),W=!1}}break e}finally{C=null,T=ue,D=!1}W=void 0}}finally{W?fe():ne=!1}}}var fe;if(typeof Q=="function")fe=function(){Q(ye)};else if(typeof MessageChannel<"u"){var Se=new MessageChannel,xe=Se.port2;Se.port1.onmessage=ye,fe=function(){xe.postMessage(null)}}else fe=function(){R(ye,0)};function Te(O,W){I=R(function(){O(a.unstable_now())},W)}a.unstable_IdlePriority=5,a.unstable_ImmediatePriority=1,a.unstable_LowPriority=4,a.unstable_NormalPriority=3,a.unstable_Profiling=null,a.unstable_UserBlockingPriority=2,a.unstable_cancelCallback=function(O){O.callback=null},a.unstable_forceFrameRate=function(O){0>O||125<O?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):b=0<O?Math.floor(1e3/O):5},a.unstable_getCurrentPriorityLevel=function(){return T},a.unstable_next=function(O){switch(T){case 1:case 2:case 3:var W=3;break;default:W=T}var ue=T;T=W;try{return O()}finally{T=ue}},a.unstable_requestPaint=function(){H=!0},a.unstable_runWithPriority=function(O,W){switch(O){case 1:case 2:case 3:case 4:case 5:break;default:O=3}var ue=T;T=O;try{return W()}finally{T=ue}},a.unstable_scheduleCallback=function(O,W,ue){var je=a.unstable_now();switch(typeof ue=="object"&&ue!==null?(ue=ue.delay,ue=typeof ue=="number"&&0<ue?je+ue:je):ue=je,O){case 1:var Ne=-1;break;case 2:Ne=250;break;case 5:Ne=1073741823;break;case 4:Ne=1e4;break;default:Ne=5e3}return Ne=ue+Ne,O={id:S++,callback:W,priorityLevel:O,startTime:ue,expirationTime:Ne,sortIndex:-1},ue>je?(O.sortIndex=ue,s(g,O),c(v)===null&&O===c(g)&&(U?(K(I),I=-1):U=!0,Te(ae,ue-je))):(O.sortIndex=Ne,s(v,O),M||D||(M=!0,ne||(ne=!0,fe()))),O},a.unstable_shouldYield=P,a.unstable_wrapCallback=function(O){var W=T;return function(){var ue=T;T=W;try{return O.apply(this,arguments)}finally{T=ue}}}})(jf)),jf}var e1;function dg(){return e1||(e1=1,Sf.exports=fg()),Sf.exports}var Ef={exports:{}},Qt={};var t1;function hg(){if(t1)return Qt;t1=1;var a=Xf();function s(v){var g="https://react.dev/errors/"+v;if(1<arguments.length){g+="?args[]="+encodeURIComponent(arguments[1]);for(var S=2;S<arguments.length;S++)g+="&args[]="+encodeURIComponent(arguments[S])}return"Minified React error #"+v+"; visit "+g+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function c(){}var r={d:{f:c,r:function(){throw Error(s(522))},D:c,C:c,L:c,m:c,X:c,S:c,M:c},p:0,findDOMNode:null},f=Symbol.for("react.portal");function d(v,g,S){var C=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:f,key:C==null?null:""+C,children:v,containerInfo:g,implementation:S}}var p=a.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function y(v,g){if(v==="font")return"";if(typeof g=="string")return g==="use-credentials"?g:""}return Qt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,Qt.createPortal=function(v,g){var S=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!g||g.nodeType!==1&&g.nodeType!==9&&g.nodeType!==11)throw Error(s(299));return d(v,g,null,S)},Qt.flushSync=function(v){var g=p.T,S=r.p;try{if(p.T=null,r.p=2,v)return v()}finally{p.T=g,r.p=S,r.d.f()}},Qt.preconnect=function(v,g){typeof v=="string"&&(g?(g=g.crossOrigin,g=typeof g=="string"?g==="use-credentials"?g:"":void 0):g=null,r.d.C(v,g))},Qt.prefetchDNS=function(v){typeof v=="string"&&r.d.D(v)},Qt.preinit=function(v,g){if(typeof v=="string"&&g&&typeof g.as=="string"){var S=g.as,C=y(S,g.crossOrigin),T=typeof g.integrity=="string"?g.integrity:void 0,D=typeof g.fetchPriority=="string"?g.fetchPriority:void 0;S==="style"?r.d.S(v,typeof g.precedence=="string"?g.precedence:void 0,{crossOrigin:C,integrity:T,fetchPriority:D}):S==="script"&&r.d.X(v,{crossOrigin:C,integrity:T,fetchPriority:D,nonce:typeof g.nonce=="string"?g.nonce:void 0})}},Qt.preinitModule=function(v,g){if(typeof v=="string")if(typeof g=="object"&&g!==null){if(g.as==null||g.as==="script"){var S=y(g.as,g.crossOrigin);r.d.M(v,{crossOrigin:S,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0})}}else g==null&&r.d.M(v)},Qt.preload=function(v,g){if(typeof v=="string"&&typeof g=="object"&&g!==null&&typeof g.as=="string"){var S=g.as,C=y(S,g.crossOrigin);r.d.L(v,S,{crossOrigin:C,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0,type:typeof g.type=="string"?g.type:void 0,fetchPriority:typeof g.fetchPriority=="string"?g.fetchPriority:void 0,referrerPolicy:typeof g.referrerPolicy=="string"?g.referrerPolicy:void 0,imageSrcSet:typeof g.imageSrcSet=="string"?g.imageSrcSet:void 0,imageSizes:typeof g.imageSizes=="string"?g.imageSizes:void 0,media:typeof g.media=="string"?g.media:void 0})}},Qt.preloadModule=function(v,g){if(typeof v=="string")if(g){var S=y(g.as,g.crossOrigin);r.d.m(v,{as:typeof g.as=="string"&&g.as!=="script"?g.as:void 0,crossOrigin:S,integrity:typeof g.integrity=="string"?g.integrity:void 0})}else r.d.m(v)},Qt.requestFormReset=function(v){r.d.r(v)},Qt.unstable_batchedUpdates=function(v,g){return v(g)},Qt.useFormState=function(v,g,S){return p.H.useFormState(v,g,S)},Qt.useFormStatus=function(){return p.H.useHostTransitionStatus()},Qt.version="19.2.8",Qt}var n1;function im(){if(n1)return Ef.exports;n1=1;function a(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(a)}catch(s){console.error(s)}}return a(),Ef.exports=hg(),Ef.exports}var l1;function mg(){if(l1)return jo;l1=1;var a=dg(),s=Xf(),c=im();function r(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function f(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function d(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function p(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function y(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function v(e){if(d(e)!==e)throw Error(r(188))}function g(e){var t=e.alternate;if(!t){if(t=d(e),t===null)throw Error(r(188));return t!==e?null:e}for(var n=e,l=t;;){var i=n.return;if(i===null)break;var o=i.alternate;if(o===null){if(l=i.return,l!==null){n=l;continue}break}if(i.child===o.child){for(o=i.child;o;){if(o===n)return v(i),e;if(o===l)return v(i),t;o=o.sibling}throw Error(r(188))}if(n.return!==l.return)n=i,l=o;else{for(var h=!1,x=i.child;x;){if(x===n){h=!0,n=i,l=o;break}if(x===l){h=!0,l=i,n=o;break}x=x.sibling}if(!h){for(x=o.child;x;){if(x===n){h=!0,n=o,l=i;break}if(x===l){h=!0,l=o,n=i;break}x=x.sibling}if(!h)throw Error(r(189))}}if(n.alternate!==l)throw Error(r(190))}if(n.tag!==3)throw Error(r(188));return n.stateNode.current===n?e:t}function S(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=S(e),t!==null)return t;e=e.sibling}return null}var C=Object.assign,T=Symbol.for("react.element"),D=Symbol.for("react.transitional.element"),M=Symbol.for("react.portal"),U=Symbol.for("react.fragment"),H=Symbol.for("react.strict_mode"),R=Symbol.for("react.profiler"),K=Symbol.for("react.consumer"),Q=Symbol.for("react.context"),X=Symbol.for("react.forward_ref"),ae=Symbol.for("react.suspense"),ne=Symbol.for("react.suspense_list"),I=Symbol.for("react.memo"),b=Symbol.for("react.lazy"),ie=Symbol.for("react.activity"),P=Symbol.for("react.memo_cache_sentinel"),ye=Symbol.iterator;function fe(e){return e===null||typeof e!="object"?null:(e=ye&&e[ye]||e["@@iterator"],typeof e=="function"?e:null)}var Se=Symbol.for("react.client.reference");function xe(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===Se?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case U:return"Fragment";case R:return"Profiler";case H:return"StrictMode";case ae:return"Suspense";case ne:return"SuspenseList";case ie:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case M:return"Portal";case Q:return e.displayName||"Context";case K:return(e._context.displayName||"Context")+".Consumer";case X:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case I:return t=e.displayName||null,t!==null?t:xe(e.type)||"Memo";case b:t=e._payload,e=e._init;try{return xe(e(t))}catch{}}return null}var Te=Array.isArray,O=s.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,W=c.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ue={pending:!1,data:null,method:null,action:null},je=[],Ne=-1;function E(e){return{current:e}}function G(e){0>Ne||(e.current=je[Ne],je[Ne]=null,Ne--)}function le(e,t){Ne++,je[Ne]=e.current,e.current=t}var ce=E(null),oe=E(null),Ee=E(null),L=E(null);function V(e,t){switch(le(Ee,t),le(oe,e),le(ce,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?y0(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=y0(t),e=v0(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}G(ce),le(ce,e)}function se(){G(ce),G(oe),G(Ee)}function pe(e){e.memoizedState!==null&&le(L,e);var t=ce.current,n=v0(t,e.type);t!==n&&(le(oe,e),le(ce,n))}function Ae(e){oe.current===e&&(G(ce),G(oe)),L.current===e&&(G(L),yo._currentValue=ue)}var Ve,st;function ot(e){if(Ve===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Ve=t&&t[1]||"",st=-1<n.stack.indexOf(`
|
|
2
|
+
at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
+
`+Ve+e+st}var _e=!1;function Ze(e,t){if(!e||_e)return"";_e=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var l={DetermineComponentFrameRoot:function(){try{if(t){var te=function(){throw Error()};if(Object.defineProperty(te.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(te,[])}catch(Y){var $=Y}Reflect.construct(e,[],te)}else{try{te.call()}catch(Y){$=Y}e.call(te.prototype)}}else{try{throw Error()}catch(Y){$=Y}(te=e())&&typeof te.catch=="function"&&te.catch(function(){})}}catch(Y){if(Y&&$&&typeof Y.stack=="string")return[Y.stack,$.stack]}return[null,null]}};l.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var i=Object.getOwnPropertyDescriptor(l.DetermineComponentFrameRoot,"name");i&&i.configurable&&Object.defineProperty(l.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var o=l.DetermineComponentFrameRoot(),h=o[0],x=o[1];if(h&&x){var N=h.split(`
|
|
4
|
+
`),B=x.split(`
|
|
5
|
+
`);for(i=l=0;l<N.length&&!N[l].includes("DetermineComponentFrameRoot");)l++;for(;i<B.length&&!B[i].includes("DetermineComponentFrameRoot");)i++;if(l===N.length||i===B.length)for(l=N.length-1,i=B.length-1;1<=l&&0<=i&&N[l]!==B[i];)i--;for(;1<=l&&0<=i;l--,i--)if(N[l]!==B[i]){if(l!==1||i!==1)do if(l--,i--,0>i||N[l]!==B[i]){var F=`
|
|
6
|
+
`+N[l].replace(" at new "," at ");return e.displayName&&F.includes("<anonymous>")&&(F=F.replace("<anonymous>",e.displayName)),F}while(1<=l&&0<=i);break}}}finally{_e=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?ot(n):""}function Tt(e,t){switch(e.tag){case 26:case 27:case 5:return ot(e.type);case 16:return ot("Lazy");case 13:return e.child!==t&&t!==null?ot("Suspense Fallback"):ot("Suspense");case 19:return ot("SuspenseList");case 0:case 15:return Ze(e.type,!1);case 11:return Ze(e.type.render,!1);case 1:return Ze(e.type,!0);case 31:return ot("Activity");default:return""}}function ln(e){try{var t="",n=null;do t+=Tt(e,n),n=e,e=e.return;while(e);return t}catch(l){return`
|
|
7
|
+
Error generating stack: `+l.message+`
|
|
8
|
+
`+l.stack}}var an=Object.prototype.hasOwnProperty,mn=a.unstable_scheduleCallback,Un=a.unstable_cancelCallback,Gl=a.unstable_shouldYield,ms=a.unstable_requestPaint,ft=a.unstable_now,In=a.unstable_getCurrentPriorityLevel,pn=a.unstable_ImmediatePriority,za=a.unstable_UserBlockingPriority,Hn=a.unstable_NormalPriority,mt=a.unstable_LowPriority,cl=a.unstable_IdlePriority,mi=a.log,pi=a.unstable_setDisableYieldValue,fl=null,Rt=null;function gn(e){if(typeof mi=="function"&&pi(e),Rt&&typeof Rt.setStrictMode=="function")try{Rt.setStrictMode(fl,e)}catch{}}var jt=Math.clz32?Math.clz32:Ra,gi=Math.log,xi=Math.LN2;function Ra(e){return e>>>=0,e===0?32:31-(gi(e)/xi|0)|0}var dl=256,hl=262144,ml=4194304;function Kt(e){var t=e&42;if(t!==0)return t;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 Mn(e,t,n){var l=e.pendingLanes;if(l===0)return 0;var i=0,o=e.suspendedLanes,h=e.pingedLanes;e=e.warmLanes;var x=l&134217727;return x!==0?(l=x&~o,l!==0?i=Kt(l):(h&=x,h!==0?i=Kt(h):n||(n=x&~e,n!==0&&(i=Kt(n))))):(x=l&~o,x!==0?i=Kt(x):h!==0?i=Kt(h):n||(n=l&~e,n!==0&&(i=Kt(n)))),i===0?0:t!==0&&t!==i&&(t&o)===0&&(o=i&-i,n=t&-t,o>=n||o===32&&(n&4194048)!==0)?t:i}function Ft(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function $n(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+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 t+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 yi(){var e=ml;return ml<<=1,(ml&62914560)===0&&(ml=4194304),e}function Pn(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Yt(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function rt(e,t,n,l,i,o){var h=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var x=e.entanglements,N=e.expirationTimes,B=e.hiddenUpdates;for(n=h&~n;0<n;){var F=31-jt(n),te=1<<F;x[F]=0,N[F]=-1;var $=B[F];if($!==null)for(B[F]=null,F=0;F<$.length;F++){var Y=$[F];Y!==null&&(Y.lane&=-536870913)}n&=~te}l!==0&&pl(e,l,0),o!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=o&~(h&~t))}function pl(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var l=31-jt(t);e.entangledLanes|=t,e.entanglements[l]=e.entanglements[l]|1073741824|n&261930}function el(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var l=31-jt(n),i=1<<l;i&t|e[l]&t&&(e[l]|=t),n&=~i}}function Z(e,t){var n=t&-t;return n=(n&42)!==0?1:de(n),(n&(e.suspendedLanes|t))!==0?0:n}function de(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 Ce(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Oe(){var e=W.p;return e!==0?e:(e=window.event,e===void 0?32:Y0(e.type))}function ve(e,t){var n=W.p;try{return W.p=e,t()}finally{W.p=n}}var We=Math.random().toString(36).slice(2),Ie="__reactFiber$"+We,Re="__reactProps$"+We,ct="__reactContainer$"+We,tl="__reactEvents$"+We,zo="__reactListeners$"+We,Ro="__reactHandles$"+We,pt="__reactResources$"+We,Xl="__reactMarker$"+We;function Oa(e){delete e[Ie],delete e[Re],delete e[tl],delete e[zo],delete e[Ro]}function Et(e){var t=e[Ie];if(t)return t;for(var n=e.parentNode;n;){if(t=n[ct]||n[Ie]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=N0(e);e!==null;){if(n=e[Ie])return n;e=N0(e)}return t}e=n,n=e.parentNode}return null}function qn(e){if(e=e[Ie]||e[ct]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Ql(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(r(33))}function Vl(e){var t=e[pt];return t||(t=e[pt]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function bt(e){e[Xl]=!0}var ps=new Set,La={};function gl(e,t){Ot(e,t),Ot(e+"Capture",t)}function Ot(e,t){for(La[e]=t,e=0;e<t.length;e++)ps.add(t[e])}var Zl=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]*$"),_a={},Oo={};function Lo(e){return an.call(Oo,e)?!0:an.call(_a,e)?!1:Zl.test(e)?Oo[e]=!0:(_a[e]=!0,!1)}function Kl(e,t,n){if(Lo(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var l=t.toLowerCase().slice(0,5);if(l!=="data-"&&l!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+n)}}function nl(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+n)}}function An(e,t,n,l){if(l===null)e.removeAttribute(n);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttributeNS(t,n,""+l)}}function Gt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function _o(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Nr(e,t,n){var l=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof l<"u"&&typeof l.get=="function"&&typeof l.set=="function"){var i=l.get,o=l.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(h){n=""+h,o.call(this,h)}}),Object.defineProperty(e,t,{enumerable:l.enumerable}),{getValue:function(){return n},setValue:function(h){n=""+h},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function gs(e){if(!e._valueTracker){var t=_o(e)?"checked":"value";e._valueTracker=Nr(e,t,""+e[t])}}function vi(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),l="";return e&&(l=_o(e)?e.checked?"true":"false":e.value),e=l,e!==n?(t.setValue(e),!0):!1}function Ba(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 xs=/[\n"\\]/g;function Jt(e){return e.replace(xs,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Ua(e,t,n,l,i,o,h,x){e.name="",h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"?e.type=h:e.removeAttribute("type"),t!=null?h==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Gt(t)):e.value!==""+Gt(t)&&(e.value=""+Gt(t)):h!=="submit"&&h!=="reset"||e.removeAttribute("value"),t!=null?Fl(e,h,Gt(t)):n!=null?Fl(e,h,Gt(n)):l!=null&&e.removeAttribute("value"),i==null&&o!=null&&(e.defaultChecked=!!o),i!=null&&(e.checked=i&&typeof i!="function"&&typeof i!="symbol"),x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"?e.name=""+Gt(x):e.removeAttribute("name")}function ll(e,t,n,l,i,o,h,x){if(o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"&&(e.type=o),t!=null||n!=null){if(!(o!=="submit"&&o!=="reset"||t!=null)){gs(e);return}n=n!=null?""+Gt(n):"",t=t!=null?""+Gt(t):n,x||t===e.value||(e.value=t),e.defaultValue=t}l=l??i,l=typeof l!="function"&&typeof l!="symbol"&&!!l,e.checked=x?e.checked:!!l,e.defaultChecked=!!l,h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"&&(e.name=h),gs(e)}function Fl(e,t,n){t==="number"&&Ba(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function xn(e,t,n,l){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t["$"+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty("$"+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&l&&(e[n].defaultSelected=!0)}else{for(n=""+Gt(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,l&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function bi(e,t,n){if(t!=null&&(t=""+Gt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+Gt(n):""}function wi(e,t,n,l){if(t==null){if(l!=null){if(n!=null)throw Error(r(92));if(Te(l)){if(1<l.length)throw Error(r(93));l=l[0]}n=l}n==null&&(n=""),t=n}n=Gt(t),e.defaultValue=n,l=e.textContent,l===n&&l!==""&&l!==null&&(e.value=l),gs(e)}function al(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Si=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 ys(e,t,n){var l=t.indexOf("--")===0;n==null||typeof n=="boolean"||n===""?l?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":l?e.setProperty(t,n):typeof n!="number"||n===0||Si.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function vs(e,t,n){if(t!=null&&typeof t!="object")throw Error(r(62));if(e=e.style,n!=null){for(var l in n)!n.hasOwnProperty(l)||t!=null&&t.hasOwnProperty(l)||(l.indexOf("--")===0?e.setProperty(l,""):l==="float"?e.cssFloat="":e[l]="");for(var i in t)l=t[i],t.hasOwnProperty(i)&&n[i]!==l&&ys(e,i,l)}else for(var o in t)t.hasOwnProperty(o)&&ys(e,o,t[o])}function bs(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 Mr=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"]]),Ha=/^[\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 xl(e){return Ha.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Wt(){}var ji=null;function gt(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var yn=null,yl=null;function $a(e){var t=qn(e);if(t&&(e=t.stateNode)){var n=e[Re]||null;e:switch(e=t.stateNode,t.type){case"input":if(Ua(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+Jt(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var l=n[t];if(l!==e&&l.form===e.form){var i=l[Re]||null;if(!i)throw Error(r(90));Ua(l,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name)}}for(t=0;t<n.length;t++)l=n[t],l.form===e.form&&vi(l)}break e;case"textarea":bi(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&xn(e,!!n.multiple,t,!1)}}}var ws=!1;function Ss(e,t,n){if(ws)return e(t,n);ws=!0;try{var l=e(t);return l}finally{if(ws=!1,(yn!==null||yl!==null)&&(Ou(),yn&&(t=yn,e=yl,yl=yn=null,$a(t),e)))for(t=0;t<e.length;t++)$a(e[t])}}function qa(e,t){var n=e.stateNode;if(n===null)return null;var l=n[Re]||null;if(l===null)return null;n=l[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(l=!l.disabled)||(e=e.type,l=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!l;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(r(231,t,typeof n));return n}var Yn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),il=!1;if(Yn)try{var vl={};Object.defineProperty(vl,"passive",{get:function(){il=!0}}),window.addEventListener("test",vl,vl),window.removeEventListener("test",vl,vl)}catch{il=!1}var It=null,js=null,Ei=null;function Es(){if(Ei)return Ei;var e,t=js,n=t.length,l,i="value"in It?It.value:It.textContent,o=i.length;for(e=0;e<n&&t[e]===i[e];e++);var h=n-e;for(l=1;l<=h&&t[n-l]===i[o-l];l++);return Ei=i.slice(e,1<l?1-l:void 0)}function Jl(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Ci(){return!0}function Ni(){return!1}function Lt(e){function t(n,l,i,o,h){this._reactName=n,this._targetInst=i,this.type=l,this.nativeEvent=o,this.target=h,this.currentTarget=null;for(var x in e)e.hasOwnProperty(x)&&(n=e[x],this[x]=n?n(o):o[x]);return this.isDefaultPrevented=(o.defaultPrevented!=null?o.defaultPrevented:o.returnValue===!1)?Ci:Ni,this.isPropagationStopped=Ni,this}return C(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Ci)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Ci)},persist:function(){},isPersistent:Ci}),t}var Tn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Dn=Lt(Tn),Wl=C({},Tn,{view:0,detail:0}),Cs=Lt(Wl),Mi,Ns,Il,Pl=C({},Wl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Qa,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!==Il&&(Il&&e.type==="mousemove"?(Mi=e.screenX-Il.screenX,Ns=e.screenY-Il.screenY):Ns=Mi=0,Il=e),Mi)},movementY:function(e){return"movementY"in e?e.movementY:Ns}}),ea=Lt(Pl),Ar=C({},Pl,{dataTransfer:0}),Ai=Lt(Ar),Ms=C({},Wl,{relatedTarget:0}),As=Lt(Ms),Tr=C({},Tn,{animationName:0,elapsedTime:0,pseudoElement:0}),Bo=Lt(Tr),vn=C({},Tn,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Ya=Lt(vn),Ti=C({},Tn,{data:0}),Ts=Lt(Ti),sl={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Ga={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"},Ds={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Xa(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Ds[e])?!!t[e]:!1}function Qa(){return Xa}var Uo=C({},Wl,{key:function(e){if(e.key){var t=sl[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Jl(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Ga[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Qa,charCode:function(e){return e.type==="keypress"?Jl(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Jl(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),ta=Lt(Uo),Ho=C({},Pl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Di=Lt(Ho),$o=C({},Wl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Qa}),qo=Lt($o),Va=C({},Tn,{propertyName:0,elapsedTime:0,pseudoElement:0}),Yo=Lt(Va),Dr=C({},Pl,{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}),kr=Lt(Dr),zr=C({},Tn,{newState:0,oldState:0}),Rr=Lt(zr),Or=[9,13,27,32],ki=Yn&&"CompositionEvent"in window,bl=null;Yn&&"documentMode"in document&&(bl=document.documentMode);var Go=Yn&&"TextEvent"in window&&!bl,Xo=Yn&&(!ki||bl&&8<bl&&11>=bl),Qo=" ",kn=!1;function ks(e,t){switch(e){case"keyup":return Or.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function na(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var la=!1;function Gn(e,t){switch(e){case"compositionend":return na(t);case"keypress":return t.which!==32?null:(kn=!0,Qo);case"textInput":return e=t.data,e===Qo&&kn?null:e;default:return null}}function Lr(e,t){if(la)return e==="compositionend"||!ki&&ks(e,t)?(e=Es(),Ei=js=It=null,la=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Xo&&t.locale!=="ko"?null:t.data;default:return null}}var _r={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 Vo(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!_r[e.type]:t==="textarea"}function zi(e,t,n,l){yn?yl?yl.push(l):yl=[l]:yn=l,t=qu(t,"onChange"),0<t.length&&(n=new Dn("onChange","change",null,n,l),e.push({event:n,listeners:t}))}var wl=null,_t=null;function Ri(e){d0(e,0)}function Za(e){var t=Ql(e);if(vi(t))return e}function Oi(e,t){if(e==="change")return t}var Zo=!1;if(Yn){var Xn;if(Yn){var kt="oninput"in document;if(!kt){var Sl=document.createElement("div");Sl.setAttribute("oninput","return;"),kt=typeof Sl.oninput=="function"}Xn=kt}else Xn=!1;Zo=Xn&&(!document.documentMode||9<document.documentMode)}function aa(){wl&&(wl.detachEvent("onpropertychange",zs),_t=wl=null)}function zs(e){if(e.propertyName==="value"&&Za(_t)){var t=[];zi(t,_t,e,gt(e)),Ss(Ri,t)}}function Ko(e,t,n){e==="focusin"?(aa(),wl=t,_t=n,wl.attachEvent("onpropertychange",zs)):e==="focusout"&&aa()}function Rs(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Za(_t)}function Li(e,t){if(e==="click")return Za(t)}function Br(e,t){if(e==="input"||e==="change")return Za(t)}function ol(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Bt=typeof Object.is=="function"?Object.is:ol;function ia(e,t){if(Bt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),l=Object.keys(t);if(n.length!==l.length)return!1;for(l=0;l<n.length;l++){var i=n[l];if(!an.call(t,i)||!Bt(e[i],t[i]))return!1}return!0}function Fo(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function _i(e,t){var n=Fo(e);e=0;for(var l;n;){if(n.nodeType===3){if(l=e+n.textContent.length,e<=t&&l>=t)return{node:n,offset:t-e};e=l}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Fo(n)}}function Jo(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Jo(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Wo(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Ba(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Ba(e.document)}return t}function Os(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var Ur=Yn&&"documentMode"in document&&11>=document.documentMode,sa=null,Bi=null,jl=null,Ls=!1;function Io(e,t,n){var l=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Ls||sa==null||sa!==Ba(l)||(l=sa,"selectionStart"in l&&Os(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),jl&&ia(jl,l)||(jl=l,l=qu(Bi,"onSelect"),0<l.length&&(t=new Dn("onSelect","select",null,t,n),e.push({event:t,listeners:l}),t.target=sa)))}function Qn(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var oa={animationend:Qn("Animation","AnimationEnd"),animationiteration:Qn("Animation","AnimationIteration"),animationstart:Qn("Animation","AnimationStart"),transitionrun:Qn("Transition","TransitionRun"),transitionstart:Qn("Transition","TransitionStart"),transitioncancel:Qn("Transition","TransitionCancel"),transitionend:Qn("Transition","TransitionEnd")},Ui={},ua={};Yn&&(ua=document.createElement("div").style,"AnimationEvent"in window||(delete oa.animationend.animation,delete oa.animationiteration.animation,delete oa.animationstart.animation),"TransitionEvent"in window||delete oa.transitionend.transition);function El(e){if(Ui[e])return Ui[e];if(!oa[e])return e;var t=oa[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in ua)return Ui[e]=t[n];return e}var Po=El("animationend"),_s=El("animationiteration"),Ka=El("animationstart"),eu=El("transitionrun"),tu=El("transitionstart"),Hr=El("transitioncancel"),Cl=El("transitionend"),nu=new Map,Bs="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(" ");Bs.push("scrollEnd");function bn(e,t){nu.set(e,t),gl(t,[e])}var Hi=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=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(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},sn=[],Nl=0,Us=0;function $i(){for(var e=Nl,t=Us=Nl=0;t<e;){var n=sn[t];sn[t++]=null;var l=sn[t];sn[t++]=null;var i=sn[t];sn[t++]=null;var o=sn[t];if(sn[t++]=null,l!==null&&i!==null){var h=l.pending;h===null?i.next=i:(i.next=h.next,h.next=i),l.pending=i}o!==0&&qi(n,i,o)}}function on(e,t,n,l){sn[Nl++]=e,sn[Nl++]=t,sn[Nl++]=n,sn[Nl++]=l,Us|=l,e.lanes|=l,e=e.alternate,e!==null&&(e.lanes|=l)}function Hs(e,t,n,l){return on(e,t,n,l),ra(e)}function zn(e,t){return on(e,null,null,t),ra(e)}function qi(e,t,n){e.lanes|=n;var l=e.alternate;l!==null&&(l.lanes|=n);for(var i=!1,o=e.return;o!==null;)o.childLanes|=n,l=o.alternate,l!==null&&(l.childLanes|=n),o.tag===22&&(e=o.stateNode,e===null||e._visibility&1||(i=!0)),e=o,o=o.return;return e.tag===3?(o=e.stateNode,i&&t!==null&&(i=31-jt(n),e=o.hiddenUpdates,l=e[i],l===null?e[i]=[t]:l.push(t),t.lane=n|536870912),o):null}function ra(e){if(50<co)throw co=0,Yc=null,Error(r(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Ml={};function lu(e,t,n,l){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=l,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Pt(e,t,n,l){return new lu(e,t,n,l)}function $s(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Vn(e,t){var n=e.alternate;return n===null?(n=Pt(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function au(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Fa(e,t,n,l,i,o){var h=0;if(l=e,typeof e=="function")$s(e)&&(h=1);else if(typeof e=="string")h=Jp(e,n,ce.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case ie:return e=Pt(31,n,t,i),e.elementType=ie,e.lanes=o,e;case U:return Al(n.children,i,o,t);case H:h=8,i|=24;break;case R:return e=Pt(12,n,t,i|2),e.elementType=R,e.lanes=o,e;case ae:return e=Pt(13,n,t,i),e.elementType=ae,e.lanes=o,e;case ne:return e=Pt(19,n,t,i),e.elementType=ne,e.lanes=o,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Q:h=10;break e;case K:h=9;break e;case X:h=11;break e;case I:h=14;break e;case b:h=16,l=null;break e}h=29,n=Error(r(130,e===null?"null":typeof e,"")),l=null}return t=Pt(h,n,t,i),t.elementType=e,t.type=l,t.lanes=o,t}function Al(e,t,n,l){return e=Pt(7,e,l,t),e.lanes=n,e}function qs(e,t,n){return e=Pt(6,e,null,t),e.lanes=n,e}function iu(e){var t=Pt(18,null,null,0);return t.stateNode=e,t}function Ys(e,t,n){return t=Pt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Gs=new WeakMap;function m(e,t){if(typeof e=="object"&&e!==null){var n=Gs.get(e);return n!==void 0?n:(t={value:e,source:t,stack:ln(t)},Gs.set(e,t),t)}return{value:e,source:t,stack:ln(t)}}var j=[],z=0,q=null,ee=0,re=[],he=0,me=null,Be=1,Le="";function Xe(e,t){j[z++]=ee,j[z++]=q,q=e,ee=t}function en(e,t,n){re[he++]=Be,re[he++]=Le,re[he++]=me,me=e;var l=Be;e=Le;var i=32-jt(l)-1;l&=~(1<<i),n+=1;var o=32-jt(t)+i;if(30<o){var h=i-i%5;o=(l&(1<<h)-1).toString(32),l>>=h,i-=h,Be=1<<32-jt(t)+i|n<<i|l,Le=o+e}else Be=1<<o|n<<i|l,Le=e}function Qe(e){e.return!==null&&(Xe(e,1),en(e,1,0))}function un(e){for(;e===q;)q=j[--z],j[z]=null,ee=j[--z],j[z]=null;for(;e===me;)me=re[--he],re[he]=null,Le=re[--he],re[he]=null,Be=re[--he],re[he]=null}function Zn(e,t){re[he++]=Be,re[he++]=Le,re[he++]=me,Be=t.id,Le=t.overflow,me=e}var xt=null,et=null,Ue=!1,Kn=null,tn=!1,wn=Error(r(519));function Xt(e){var t=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Xs(m(t,e)),wn}function Pf(e){var t=e.stateNode,n=e.type,l=e.memoizedProps;switch(t[Ie]=e,t[Re]=l,n){case"dialog":$e("cancel",t),$e("close",t);break;case"iframe":case"object":case"embed":$e("load",t);break;case"video":case"audio":for(n=0;n<ho.length;n++)$e(ho[n],t);break;case"source":$e("error",t);break;case"img":case"image":case"link":$e("error",t),$e("load",t);break;case"details":$e("toggle",t);break;case"input":$e("invalid",t),ll(t,l.value,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name,!0);break;case"select":$e("invalid",t);break;case"textarea":$e("invalid",t),wi(t,l.value,l.defaultValue,l.children)}n=l.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||t.textContent===""+n||l.suppressHydrationWarning===!0||g0(t.textContent,n)?(l.popover!=null&&($e("beforetoggle",t),$e("toggle",t)),l.onScroll!=null&&$e("scroll",t),l.onScrollEnd!=null&&$e("scrollend",t),l.onClick!=null&&(t.onclick=Wt),t=!0):t=!1,t||Xt(e,!0)}function ed(e){for(xt=e.return;xt;)switch(xt.tag){case 5:case 31:case 13:tn=!1;return;case 27:case 3:tn=!0;return;default:xt=xt.return}}function Yi(e){if(e!==xt)return!1;if(!Ue)return ed(e),Ue=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||lf(e.type,e.memoizedProps)),n=!n),n&&et&&Xt(e),ed(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(r(317));et=C0(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(r(317));et=C0(e)}else t===27?(t=et,ja(e.type)?(e=rf,rf=null,et=e):et=t):et=xt?On(e.stateNode.nextSibling):null;return!0}function Ja(){et=xt=null,Ue=!1}function $r(){var e=Kn;return e!==null&&(dn===null?dn=e:dn.push.apply(dn,e),Kn=null),e}function Xs(e){Kn===null?Kn=[e]:Kn.push(e)}var qr=E(null),Wa=null,Tl=null;function ca(e,t,n){le(qr,t._currentValue),t._currentValue=n}function Dl(e){e._currentValue=qr.current,G(qr)}function Yr(e,t,n){for(;e!==null;){var l=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,l!==null&&(l.childLanes|=t)):l!==null&&(l.childLanes&t)!==t&&(l.childLanes|=t),e===n)break;e=e.return}}function Gr(e,t,n,l){var i=e.child;for(i!==null&&(i.return=e);i!==null;){var o=i.dependencies;if(o!==null){var h=i.child;o=o.firstContext;e:for(;o!==null;){var x=o;o=i;for(var N=0;N<t.length;N++)if(x.context===t[N]){o.lanes|=n,x=o.alternate,x!==null&&(x.lanes|=n),Yr(o.return,n,e),l||(h=null);break e}o=x.next}}else if(i.tag===18){if(h=i.return,h===null)throw Error(r(341));h.lanes|=n,o=h.alternate,o!==null&&(o.lanes|=n),Yr(h,n,e),h=null}else h=i.child;if(h!==null)h.return=i;else for(h=i;h!==null;){if(h===e){h=null;break}if(i=h.sibling,i!==null){i.return=h.return,h=i;break}h=h.return}i=h}}function Gi(e,t,n,l){e=null;for(var i=t,o=!1;i!==null;){if(!o){if((i.flags&524288)!==0)o=!0;else if((i.flags&262144)!==0)break}if(i.tag===10){var h=i.alternate;if(h===null)throw Error(r(387));if(h=h.memoizedProps,h!==null){var x=i.type;Bt(i.pendingProps.value,h.value)||(e!==null?e.push(x):e=[x])}}else if(i===L.current){if(h=i.alternate,h===null)throw Error(r(387));h.memoizedState.memoizedState!==i.memoizedState.memoizedState&&(e!==null?e.push(yo):e=[yo])}i=i.return}e!==null&&Gr(t,e,n,l),t.flags|=262144}function su(e){for(e=e.firstContext;e!==null;){if(!Bt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Ia(e){Wa=e,Tl=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Ut(e){return td(Wa,e)}function ou(e,t){return Wa===null&&Ia(e),td(e,t)}function td(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Tl===null){if(e===null)throw Error(r(308));Tl=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Tl=Tl.next=t;return n}var Vm=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(n,l){e.push(l)}};this.abort=function(){t.aborted=!0,e.forEach(function(n){return n()})}},Zm=a.unstable_scheduleCallback,Km=a.unstable_NormalPriority,Ct={$$typeof:Q,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Xr(){return{controller:new Vm,data:new Map,refCount:0}}function Qs(e){e.refCount--,e.refCount===0&&Zm(Km,function(){e.controller.abort()})}var Vs=null,Qr=0,Xi=0,Qi=null;function Fm(e,t){if(Vs===null){var n=Vs=[];Qr=0,Xi=Kc(),Qi={status:"pending",value:void 0,then:function(l){n.push(l)}}}return Qr++,t.then(nd,nd),t}function nd(){if(--Qr===0&&Vs!==null){Qi!==null&&(Qi.status="fulfilled");var e=Vs;Vs=null,Xi=0,Qi=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Jm(e,t){var n=[],l={status:"pending",value:null,reason:null,then:function(i){n.push(i)}};return e.then(function(){l.status="fulfilled",l.value=t;for(var i=0;i<n.length;i++)(0,n[i])(t)},function(i){for(l.status="rejected",l.reason=i,i=0;i<n.length;i++)(0,n[i])(void 0)}),l}var ld=O.S;O.S=function(e,t){$h=ft(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&Fm(e,t),ld!==null&&ld(e,t)};var Pa=E(null);function Vr(){var e=Pa.current;return e!==null?e:ut.pooledCache}function uu(e,t){t===null?le(Pa,Pa.current):le(Pa,t.pool)}function ad(){var e=Vr();return e===null?null:{parent:Ct._currentValue,pool:e}}var Vi=Error(r(460)),Zr=Error(r(474)),ru=Error(r(542)),cu={then:function(){}};function id(e){return e=e.status,e==="fulfilled"||e==="rejected"}function sd(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(Wt,Wt),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,ud(e),e;default:if(typeof t.status=="string")t.then(Wt,Wt);else{if(e=ut,e!==null&&100<e.shellSuspendCounter)throw Error(r(482));e=t,e.status="pending",e.then(function(l){if(t.status==="pending"){var i=t;i.status="fulfilled",i.value=l}},function(l){if(t.status==="pending"){var i=t;i.status="rejected",i.reason=l}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,ud(e),e}throw ti=t,Vi}}function ei(e){try{var t=e._init;return t(e._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(ti=n,Vi):n}}var ti=null;function od(){if(ti===null)throw Error(r(459));var e=ti;return ti=null,e}function ud(e){if(e===Vi||e===ru)throw Error(r(483))}var Zi=null,Zs=0;function fu(e){var t=Zs;return Zs+=1,Zi===null&&(Zi=[]),sd(Zi,e,t)}function Ks(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function du(e,t){throw t.$$typeof===T?Error(r(525)):(e=Object.prototype.toString.call(t),Error(r(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function rd(e){function t(k,A){if(e){var _=k.deletions;_===null?(k.deletions=[A],k.flags|=16):_.push(A)}}function n(k,A){if(!e)return null;for(;A!==null;)t(k,A),A=A.sibling;return null}function l(k){for(var A=new Map;k!==null;)k.key!==null?A.set(k.key,k):A.set(k.index,k),k=k.sibling;return A}function i(k,A){return k=Vn(k,A),k.index=0,k.sibling=null,k}function o(k,A,_){return k.index=_,e?(_=k.alternate,_!==null?(_=_.index,_<A?(k.flags|=67108866,A):_):(k.flags|=67108866,A)):(k.flags|=1048576,A)}function h(k){return e&&k.alternate===null&&(k.flags|=67108866),k}function x(k,A,_,J){return A===null||A.tag!==6?(A=qs(_,k.mode,J),A.return=k,A):(A=i(A,_),A.return=k,A)}function N(k,A,_,J){var we=_.type;return we===U?F(k,A,_.props.children,J,_.key):A!==null&&(A.elementType===we||typeof we=="object"&&we!==null&&we.$$typeof===b&&ei(we)===A.type)?(A=i(A,_.props),Ks(A,_),A.return=k,A):(A=Fa(_.type,_.key,_.props,null,k.mode,J),Ks(A,_),A.return=k,A)}function B(k,A,_,J){return A===null||A.tag!==4||A.stateNode.containerInfo!==_.containerInfo||A.stateNode.implementation!==_.implementation?(A=Ys(_,k.mode,J),A.return=k,A):(A=i(A,_.children||[]),A.return=k,A)}function F(k,A,_,J,we){return A===null||A.tag!==7?(A=Al(_,k.mode,J,we),A.return=k,A):(A=i(A,_),A.return=k,A)}function te(k,A,_){if(typeof A=="string"&&A!==""||typeof A=="number"||typeof A=="bigint")return A=qs(""+A,k.mode,_),A.return=k,A;if(typeof A=="object"&&A!==null){switch(A.$$typeof){case D:return _=Fa(A.type,A.key,A.props,null,k.mode,_),Ks(_,A),_.return=k,_;case M:return A=Ys(A,k.mode,_),A.return=k,A;case b:return A=ei(A),te(k,A,_)}if(Te(A)||fe(A))return A=Al(A,k.mode,_,null),A.return=k,A;if(typeof A.then=="function")return te(k,fu(A),_);if(A.$$typeof===Q)return te(k,ou(k,A),_);du(k,A)}return null}function $(k,A,_,J){var we=A!==null?A.key:null;if(typeof _=="string"&&_!==""||typeof _=="number"||typeof _=="bigint")return we!==null?null:x(k,A,""+_,J);if(typeof _=="object"&&_!==null){switch(_.$$typeof){case D:return _.key===we?N(k,A,_,J):null;case M:return _.key===we?B(k,A,_,J):null;case b:return _=ei(_),$(k,A,_,J)}if(Te(_)||fe(_))return we!==null?null:F(k,A,_,J,null);if(typeof _.then=="function")return $(k,A,fu(_),J);if(_.$$typeof===Q)return $(k,A,ou(k,_),J);du(k,_)}return null}function Y(k,A,_,J,we){if(typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint")return k=k.get(_)||null,x(A,k,""+J,we);if(typeof J=="object"&&J!==null){switch(J.$$typeof){case D:return k=k.get(J.key===null?_:J.key)||null,N(A,k,J,we);case M:return k=k.get(J.key===null?_:J.key)||null,B(A,k,J,we);case b:return J=ei(J),Y(k,A,_,J,we)}if(Te(J)||fe(J))return k=k.get(_)||null,F(A,k,J,we,null);if(typeof J.then=="function")return Y(k,A,_,fu(J),we);if(J.$$typeof===Q)return Y(k,A,_,ou(A,J),we);du(A,J)}return null}function ge(k,A,_,J){for(var we=null,Ke=null,be=A,ze=A=0,Ye=null;be!==null&&ze<_.length;ze++){be.index>ze?(Ye=be,be=null):Ye=be.sibling;var Fe=$(k,be,_[ze],J);if(Fe===null){be===null&&(be=Ye);break}e&&be&&Fe.alternate===null&&t(k,be),A=o(Fe,A,ze),Ke===null?we=Fe:Ke.sibling=Fe,Ke=Fe,be=Ye}if(ze===_.length)return n(k,be),Ue&&Xe(k,ze),we;if(be===null){for(;ze<_.length;ze++)be=te(k,_[ze],J),be!==null&&(A=o(be,A,ze),Ke===null?we=be:Ke.sibling=be,Ke=be);return Ue&&Xe(k,ze),we}for(be=l(be);ze<_.length;ze++)Ye=Y(be,k,ze,_[ze],J),Ye!==null&&(e&&Ye.alternate!==null&&be.delete(Ye.key===null?ze:Ye.key),A=o(Ye,A,ze),Ke===null?we=Ye:Ke.sibling=Ye,Ke=Ye);return e&&be.forEach(function(Aa){return t(k,Aa)}),Ue&&Xe(k,ze),we}function Me(k,A,_,J){if(_==null)throw Error(r(151));for(var we=null,Ke=null,be=A,ze=A=0,Ye=null,Fe=_.next();be!==null&&!Fe.done;ze++,Fe=_.next()){be.index>ze?(Ye=be,be=null):Ye=be.sibling;var Aa=$(k,be,Fe.value,J);if(Aa===null){be===null&&(be=Ye);break}e&&be&&Aa.alternate===null&&t(k,be),A=o(Aa,A,ze),Ke===null?we=Aa:Ke.sibling=Aa,Ke=Aa,be=Ye}if(Fe.done)return n(k,be),Ue&&Xe(k,ze),we;if(be===null){for(;!Fe.done;ze++,Fe=_.next())Fe=te(k,Fe.value,J),Fe!==null&&(A=o(Fe,A,ze),Ke===null?we=Fe:Ke.sibling=Fe,Ke=Fe);return Ue&&Xe(k,ze),we}for(be=l(be);!Fe.done;ze++,Fe=_.next())Fe=Y(be,k,ze,Fe.value,J),Fe!==null&&(e&&Fe.alternate!==null&&be.delete(Fe.key===null?ze:Fe.key),A=o(Fe,A,ze),Ke===null?we=Fe:Ke.sibling=Fe,Ke=Fe);return e&&be.forEach(function(og){return t(k,og)}),Ue&&Xe(k,ze),we}function it(k,A,_,J){if(typeof _=="object"&&_!==null&&_.type===U&&_.key===null&&(_=_.props.children),typeof _=="object"&&_!==null){switch(_.$$typeof){case D:e:{for(var we=_.key;A!==null;){if(A.key===we){if(we=_.type,we===U){if(A.tag===7){n(k,A.sibling),J=i(A,_.props.children),J.return=k,k=J;break e}}else if(A.elementType===we||typeof we=="object"&&we!==null&&we.$$typeof===b&&ei(we)===A.type){n(k,A.sibling),J=i(A,_.props),Ks(J,_),J.return=k,k=J;break e}n(k,A);break}else t(k,A);A=A.sibling}_.type===U?(J=Al(_.props.children,k.mode,J,_.key),J.return=k,k=J):(J=Fa(_.type,_.key,_.props,null,k.mode,J),Ks(J,_),J.return=k,k=J)}return h(k);case M:e:{for(we=_.key;A!==null;){if(A.key===we)if(A.tag===4&&A.stateNode.containerInfo===_.containerInfo&&A.stateNode.implementation===_.implementation){n(k,A.sibling),J=i(A,_.children||[]),J.return=k,k=J;break e}else{n(k,A);break}else t(k,A);A=A.sibling}J=Ys(_,k.mode,J),J.return=k,k=J}return h(k);case b:return _=ei(_),it(k,A,_,J)}if(Te(_))return ge(k,A,_,J);if(fe(_)){if(we=fe(_),typeof we!="function")throw Error(r(150));return _=we.call(_),Me(k,A,_,J)}if(typeof _.then=="function")return it(k,A,fu(_),J);if(_.$$typeof===Q)return it(k,A,ou(k,_),J);du(k,_)}return typeof _=="string"&&_!==""||typeof _=="number"||typeof _=="bigint"?(_=""+_,A!==null&&A.tag===6?(n(k,A.sibling),J=i(A,_),J.return=k,k=J):(n(k,A),J=qs(_,k.mode,J),J.return=k,k=J),h(k)):n(k,A)}return function(k,A,_,J){try{Zs=0;var we=it(k,A,_,J);return Zi=null,we}catch(be){if(be===Vi||be===ru)throw be;var Ke=Pt(29,be,null,k.mode);return Ke.lanes=J,Ke.return=k,Ke}}}var ni=rd(!0),cd=rd(!1),fa=!1;function Kr(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Fr(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function da(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function ha(e,t,n){var l=e.updateQueue;if(l===null)return null;if(l=l.shared,(Pe&2)!==0){var i=l.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),l.pending=t,t=ra(e),qi(e,null,n),t}return on(e,l,t,n),ra(e)}function Fs(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var l=t.lanes;l&=e.pendingLanes,n|=l,t.lanes=n,el(e,n)}}function Jr(e,t){var n=e.updateQueue,l=e.alternate;if(l!==null&&(l=l.updateQueue,n===l)){var i=null,o=null;if(n=n.firstBaseUpdate,n!==null){do{var h={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};o===null?i=o=h:o=o.next=h,n=n.next}while(n!==null);o===null?i=o=t:o=o.next=t}else i=o=t;n={baseState:l.baseState,firstBaseUpdate:i,lastBaseUpdate:o,shared:l.shared,callbacks:l.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Wr=!1;function Js(){if(Wr){var e=Qi;if(e!==null)throw e}}function Ws(e,t,n,l){Wr=!1;var i=e.updateQueue;fa=!1;var o=i.firstBaseUpdate,h=i.lastBaseUpdate,x=i.shared.pending;if(x!==null){i.shared.pending=null;var N=x,B=N.next;N.next=null,h===null?o=B:h.next=B,h=N;var F=e.alternate;F!==null&&(F=F.updateQueue,x=F.lastBaseUpdate,x!==h&&(x===null?F.firstBaseUpdate=B:x.next=B,F.lastBaseUpdate=N))}if(o!==null){var te=i.baseState;h=0,F=B=N=null,x=o;do{var $=x.lane&-536870913,Y=$!==x.lane;if(Y?(qe&$)===$:(l&$)===$){$!==0&&$===Xi&&(Wr=!0),F!==null&&(F=F.next={lane:0,tag:x.tag,payload:x.payload,callback:null,next:null});e:{var ge=e,Me=x;$=t;var it=n;switch(Me.tag){case 1:if(ge=Me.payload,typeof ge=="function"){te=ge.call(it,te,$);break e}te=ge;break e;case 3:ge.flags=ge.flags&-65537|128;case 0:if(ge=Me.payload,$=typeof ge=="function"?ge.call(it,te,$):ge,$==null)break e;te=C({},te,$);break e;case 2:fa=!0}}$=x.callback,$!==null&&(e.flags|=64,Y&&(e.flags|=8192),Y=i.callbacks,Y===null?i.callbacks=[$]:Y.push($))}else Y={lane:$,tag:x.tag,payload:x.payload,callback:x.callback,next:null},F===null?(B=F=Y,N=te):F=F.next=Y,h|=$;if(x=x.next,x===null){if(x=i.shared.pending,x===null)break;Y=x,x=Y.next,Y.next=null,i.lastBaseUpdate=Y,i.shared.pending=null}}while(!0);F===null&&(N=te),i.baseState=N,i.firstBaseUpdate=B,i.lastBaseUpdate=F,o===null&&(i.shared.lanes=0),ya|=h,e.lanes=h,e.memoizedState=te}}function fd(e,t){if(typeof e!="function")throw Error(r(191,e));e.call(t)}function dd(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)fd(n[e],t)}var Ki=E(null),hu=E(0);function hd(e,t){e=Hl,le(hu,e),le(Ki,t),Hl=e|t.baseLanes}function Ir(){le(hu,Hl),le(Ki,Ki.current)}function Pr(){Hl=hu.current,G(Ki),G(hu)}var Sn=E(null),Rn=null;function ma(e){var t=e.alternate;le(wt,wt.current&1),le(Sn,e),Rn===null&&(t===null||Ki.current!==null||t.memoizedState!==null)&&(Rn=e)}function ec(e){le(wt,wt.current),le(Sn,e),Rn===null&&(Rn=e)}function md(e){e.tag===22?(le(wt,wt.current),le(Sn,e),Rn===null&&(Rn=e)):pa()}function pa(){le(wt,wt.current),le(Sn,Sn.current)}function jn(e){G(Sn),Rn===e&&(Rn=null),G(wt)}var wt=E(0);function mu(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||of(n)||uf(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var kl=0,ke=null,lt=null,Nt=null,pu=!1,Fi=!1,li=!1,gu=0,Is=0,Ji=null,Wm=0;function yt(){throw Error(r(321))}function tc(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Bt(e[n],t[n]))return!1;return!0}function nc(e,t,n,l,i,o){return kl=o,ke=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,O.H=e===null||e.memoizedState===null?Wd:xc,li=!1,o=n(l,i),li=!1,Fi&&(o=gd(t,n,l,i)),pd(e),o}function pd(e){O.H=to;var t=lt!==null&<.next!==null;if(kl=0,Nt=lt=ke=null,pu=!1,Is=0,Ji=null,t)throw Error(r(300));e===null||Mt||(e=e.dependencies,e!==null&&su(e)&&(Mt=!0))}function gd(e,t,n,l){ke=e;var i=0;do{if(Fi&&(Ji=null),Is=0,Fi=!1,25<=i)throw Error(r(301));if(i+=1,Nt=lt=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}O.H=Id,o=t(n,l)}while(Fi);return o}function Im(){var e=O.H,t=e.useState()[0];return t=typeof t.then=="function"?Ps(t):t,e=e.useState()[0],(lt!==null?lt.memoizedState:null)!==e&&(ke.flags|=1024),t}function lc(){var e=gu!==0;return gu=0,e}function ac(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function ic(e){if(pu){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}pu=!1}kl=0,Nt=lt=ke=null,Fi=!1,Is=gu=0,Ji=null}function nn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Nt===null?ke.memoizedState=Nt=e:Nt=Nt.next=e,Nt}function St(){if(lt===null){var e=ke.alternate;e=e!==null?e.memoizedState:null}else e=lt.next;var t=Nt===null?ke.memoizedState:Nt.next;if(t!==null)Nt=t,lt=e;else{if(e===null)throw ke.alternate===null?Error(r(467)):Error(r(310));lt=e,e={memoizedState:lt.memoizedState,baseState:lt.baseState,baseQueue:lt.baseQueue,queue:lt.queue,next:null},Nt===null?ke.memoizedState=Nt=e:Nt=Nt.next=e}return Nt}function xu(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ps(e){var t=Is;return Is+=1,Ji===null&&(Ji=[]),e=sd(Ji,e,t),t=ke,(Nt===null?t.memoizedState:Nt.next)===null&&(t=t.alternate,O.H=t===null||t.memoizedState===null?Wd:xc),e}function yu(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Ps(e);if(e.$$typeof===Q)return Ut(e)}throw Error(r(438,String(e)))}function sc(e){var t=null,n=ke.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var l=ke.alternate;l!==null&&(l=l.updateQueue,l!==null&&(l=l.memoCache,l!=null&&(t={data:l.data.map(function(i){return i.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),n===null&&(n=xu(),ke.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),l=0;l<e;l++)n[l]=P;return t.index++,n}function zl(e,t){return typeof t=="function"?t(e):t}function vu(e){var t=St();return oc(t,lt,e)}function oc(e,t,n){var l=e.queue;if(l===null)throw Error(r(311));l.lastRenderedReducer=n;var i=e.baseQueue,o=l.pending;if(o!==null){if(i!==null){var h=i.next;i.next=o.next,o.next=h}t.baseQueue=i=o,l.pending=null}if(o=e.baseState,i===null)e.memoizedState=o;else{t=i.next;var x=h=null,N=null,B=t,F=!1;do{var te=B.lane&-536870913;if(te!==B.lane?(qe&te)===te:(kl&te)===te){var $=B.revertLane;if($===0)N!==null&&(N=N.next={lane:0,revertLane:0,gesture:null,action:B.action,hasEagerState:B.hasEagerState,eagerState:B.eagerState,next:null}),te===Xi&&(F=!0);else if((kl&$)===$){B=B.next,$===Xi&&(F=!0);continue}else te={lane:0,revertLane:B.revertLane,gesture:null,action:B.action,hasEagerState:B.hasEagerState,eagerState:B.eagerState,next:null},N===null?(x=N=te,h=o):N=N.next=te,ke.lanes|=$,ya|=$;te=B.action,li&&n(o,te),o=B.hasEagerState?B.eagerState:n(o,te)}else $={lane:te,revertLane:B.revertLane,gesture:B.gesture,action:B.action,hasEagerState:B.hasEagerState,eagerState:B.eagerState,next:null},N===null?(x=N=$,h=o):N=N.next=$,ke.lanes|=te,ya|=te;B=B.next}while(B!==null&&B!==t);if(N===null?h=o:N.next=x,!Bt(o,e.memoizedState)&&(Mt=!0,F&&(n=Qi,n!==null)))throw n;e.memoizedState=o,e.baseState=h,e.baseQueue=N,l.lastRenderedState=o}return i===null&&(l.lanes=0),[e.memoizedState,l.dispatch]}function uc(e){var t=St(),n=t.queue;if(n===null)throw Error(r(311));n.lastRenderedReducer=e;var l=n.dispatch,i=n.pending,o=t.memoizedState;if(i!==null){n.pending=null;var h=i=i.next;do o=e(o,h.action),h=h.next;while(h!==i);Bt(o,t.memoizedState)||(Mt=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,l]}function xd(e,t,n){var l=ke,i=St(),o=Ue;if(o){if(n===void 0)throw Error(r(407));n=n()}else n=t();var h=!Bt((lt||i).memoizedState,n);if(h&&(i.memoizedState=n,Mt=!0),i=i.queue,fc(bd.bind(null,l,i,e),[e]),i.getSnapshot!==t||h||Nt!==null&&Nt.memoizedState.tag&1){if(l.flags|=2048,Wi(9,{destroy:void 0},vd.bind(null,l,i,n,t),null),ut===null)throw Error(r(349));o||(kl&127)!==0||yd(l,t,n)}return n}function yd(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=ke.updateQueue,t===null?(t=xu(),ke.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function vd(e,t,n,l){t.value=n,t.getSnapshot=l,wd(t)&&Sd(e)}function bd(e,t,n){return n(function(){wd(t)&&Sd(e)})}function wd(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Bt(e,n)}catch{return!0}}function Sd(e){var t=zn(e,2);t!==null&&hn(t,e,2)}function rc(e){var t=nn();if(typeof e=="function"){var n=e;if(e=n(),li){gn(!0);try{n()}finally{gn(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:zl,lastRenderedState:e},t}function jd(e,t,n,l){return e.baseState=n,oc(e,lt,typeof l=="function"?l:zl)}function Pm(e,t,n,l,i){if(Su(e))throw Error(r(485));if(e=t.action,e!==null){var o={payload:i,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(h){o.listeners.push(h)}};O.T!==null?n(!0):o.isTransition=!1,l(o),n=t.pending,n===null?(o.next=t.pending=o,Ed(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Ed(e,t){var n=t.action,l=t.payload,i=e.state;if(t.isTransition){var o=O.T,h={};O.T=h;try{var x=n(i,l),N=O.S;N!==null&&N(h,x),Cd(e,t,x)}catch(B){cc(e,t,B)}finally{o!==null&&h.types!==null&&(o.types=h.types),O.T=o}}else try{o=n(i,l),Cd(e,t,o)}catch(B){cc(e,t,B)}}function Cd(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(l){Nd(e,t,l)},function(l){return cc(e,t,l)}):Nd(e,t,n)}function Nd(e,t,n){t.status="fulfilled",t.value=n,Md(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Ed(e,n)))}function cc(e,t,n){var l=e.pending;if(e.pending=null,l!==null){l=l.next;do t.status="rejected",t.reason=n,Md(t),t=t.next;while(t!==l)}e.action=null}function Md(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Ad(e,t){return t}function Td(e,t){if(Ue){var n=ut.formState;if(n!==null){e:{var l=ke;if(Ue){if(et){t:{for(var i=et,o=tn;i.nodeType!==8;){if(!o){i=null;break t}if(i=On(i.nextSibling),i===null){i=null;break t}}o=i.data,i=o==="F!"||o==="F"?i:null}if(i){et=On(i.nextSibling),l=i.data==="F!";break e}}Xt(l)}l=!1}l&&(t=n[0])}}return n=nn(),n.memoizedState=n.baseState=t,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ad,lastRenderedState:t},n.queue=l,n=Kd.bind(null,ke,l),l.dispatch=n,l=rc(!1),o=gc.bind(null,ke,!1,l.queue),l=nn(),i={state:t,dispatch:null,action:e,pending:null},l.queue=i,n=Pm.bind(null,ke,i,o,n),i.dispatch=n,l.memoizedState=e,[t,n,!1]}function Dd(e){var t=St();return kd(t,lt,e)}function kd(e,t,n){if(t=oc(e,t,Ad)[0],e=vu(zl)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var l=Ps(t)}catch(h){throw h===Vi?ru:h}else l=t;t=St();var i=t.queue,o=i.dispatch;return n!==t.memoizedState&&(ke.flags|=2048,Wi(9,{destroy:void 0},ep.bind(null,i,n),null)),[l,o,e]}function ep(e,t){e.action=t}function zd(e){var t=St(),n=lt;if(n!==null)return kd(t,n,e);St(),t=t.memoizedState,n=St();var l=n.queue.dispatch;return n.memoizedState=e,[t,l,!1]}function Wi(e,t,n,l){return e={tag:e,create:n,deps:l,inst:t,next:null},t=ke.updateQueue,t===null&&(t=xu(),ke.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(l=n.next,n.next=e,e.next=l,t.lastEffect=e),e}function Rd(){return St().memoizedState}function bu(e,t,n,l){var i=nn();ke.flags|=e,i.memoizedState=Wi(1|t,{destroy:void 0},n,l===void 0?null:l)}function wu(e,t,n,l){var i=St();l=l===void 0?null:l;var o=i.memoizedState.inst;lt!==null&&l!==null&&tc(l,lt.memoizedState.deps)?i.memoizedState=Wi(t,o,n,l):(ke.flags|=e,i.memoizedState=Wi(1|t,o,n,l))}function Od(e,t){bu(8390656,8,e,t)}function fc(e,t){wu(2048,8,e,t)}function tp(e){ke.flags|=4;var t=ke.updateQueue;if(t===null)t=xu(),ke.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Ld(e){var t=St().memoizedState;return tp({ref:t,nextImpl:e}),function(){if((Pe&2)!==0)throw Error(r(440));return t.impl.apply(void 0,arguments)}}function _d(e,t){return wu(4,2,e,t)}function Bd(e,t){return wu(4,4,e,t)}function Ud(e,t){if(typeof t=="function"){e=e();var n=t(e);return function(){typeof n=="function"?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Hd(e,t,n){n=n!=null?n.concat([e]):null,wu(4,4,Ud.bind(null,t,e),n)}function dc(){}function $d(e,t){var n=St();t=t===void 0?null:t;var l=n.memoizedState;return t!==null&&tc(t,l[1])?l[0]:(n.memoizedState=[e,t],e)}function qd(e,t){var n=St();t=t===void 0?null:t;var l=n.memoizedState;if(t!==null&&tc(t,l[1]))return l[0];if(l=e(),li){gn(!0);try{e()}finally{gn(!1)}}return n.memoizedState=[l,t],l}function hc(e,t,n){return n===void 0||(kl&1073741824)!==0&&(qe&261930)===0?e.memoizedState=t:(e.memoizedState=n,e=Yh(),ke.lanes|=e,ya|=e,n)}function Yd(e,t,n,l){return Bt(n,t)?n:Ki.current!==null?(e=hc(e,n,l),Bt(e,t)||(Mt=!0),e):(kl&42)===0||(kl&1073741824)!==0&&(qe&261930)===0?(Mt=!0,e.memoizedState=n):(e=Yh(),ke.lanes|=e,ya|=e,t)}function Gd(e,t,n,l,i){var o=W.p;W.p=o!==0&&8>o?o:8;var h=O.T,x={};O.T=x,gc(e,!1,t,n);try{var N=i(),B=O.S;if(B!==null&&B(x,N),N!==null&&typeof N=="object"&&typeof N.then=="function"){var F=Jm(N,l);eo(e,t,F,Nn(e))}else eo(e,t,l,Nn(e))}catch(te){eo(e,t,{then:function(){},status:"rejected",reason:te},Nn())}finally{W.p=o,h!==null&&x.types!==null&&(h.types=x.types),O.T=h}}function np(){}function mc(e,t,n,l){if(e.tag!==5)throw Error(r(476));var i=Xd(e).queue;Gd(e,i,t,ue,n===null?np:function(){return Qd(e),n(l)})}function Xd(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ue,baseState:ue,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:zl,lastRenderedState:ue},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:zl,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Qd(e){var t=Xd(e);t.next===null&&(t=e.alternate.memoizedState),eo(e,t.next.queue,{},Nn())}function pc(){return Ut(yo)}function Vd(){return St().memoizedState}function Zd(){return St().memoizedState}function lp(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Nn();e=da(n);var l=ha(t,e,n);l!==null&&(hn(l,t,n),Fs(l,t,n)),t={cache:Xr()},e.payload=t;return}t=t.return}}function ap(e,t,n){var l=Nn();n={lane:l,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Su(e)?Fd(t,n):(n=Hs(e,t,n,l),n!==null&&(hn(n,e,l),Jd(n,t,l)))}function Kd(e,t,n){var l=Nn();eo(e,t,n,l)}function eo(e,t,n,l){var i={lane:l,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Su(e))Fd(t,i);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var h=t.lastRenderedState,x=o(h,n);if(i.hasEagerState=!0,i.eagerState=x,Bt(x,h))return on(e,t,i,0),ut===null&&$i(),!1}catch{}if(n=Hs(e,t,i,l),n!==null)return hn(n,e,l),Jd(n,t,l),!0}return!1}function gc(e,t,n,l){if(l={lane:2,revertLane:Kc(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Su(e)){if(t)throw Error(r(479))}else t=Hs(e,n,l,2),t!==null&&hn(t,e,2)}function Su(e){var t=e.alternate;return e===ke||t!==null&&t===ke}function Fd(e,t){Fi=pu=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Jd(e,t,n){if((n&4194048)!==0){var l=t.lanes;l&=e.pendingLanes,n|=l,t.lanes=n,el(e,n)}}var to={readContext:Ut,use:yu,useCallback:yt,useContext:yt,useEffect:yt,useImperativeHandle:yt,useLayoutEffect:yt,useInsertionEffect:yt,useMemo:yt,useReducer:yt,useRef:yt,useState:yt,useDebugValue:yt,useDeferredValue:yt,useTransition:yt,useSyncExternalStore:yt,useId:yt,useHostTransitionStatus:yt,useFormState:yt,useActionState:yt,useOptimistic:yt,useMemoCache:yt,useCacheRefresh:yt};to.useEffectEvent=yt;var Wd={readContext:Ut,use:yu,useCallback:function(e,t){return nn().memoizedState=[e,t===void 0?null:t],e},useContext:Ut,useEffect:Od,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,bu(4194308,4,Ud.bind(null,t,e),n)},useLayoutEffect:function(e,t){return bu(4194308,4,e,t)},useInsertionEffect:function(e,t){bu(4,2,e,t)},useMemo:function(e,t){var n=nn();t=t===void 0?null:t;var l=e();if(li){gn(!0);try{e()}finally{gn(!1)}}return n.memoizedState=[l,t],l},useReducer:function(e,t,n){var l=nn();if(n!==void 0){var i=n(t);if(li){gn(!0);try{n(t)}finally{gn(!1)}}}else i=t;return l.memoizedState=l.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},l.queue=e,e=e.dispatch=ap.bind(null,ke,e),[l.memoizedState,e]},useRef:function(e){var t=nn();return e={current:e},t.memoizedState=e},useState:function(e){e=rc(e);var t=e.queue,n=Kd.bind(null,ke,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:dc,useDeferredValue:function(e,t){var n=nn();return hc(n,e,t)},useTransition:function(){var e=rc(!1);return e=Gd.bind(null,ke,e.queue,!0,!1),nn().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var l=ke,i=nn();if(Ue){if(n===void 0)throw Error(r(407));n=n()}else{if(n=t(),ut===null)throw Error(r(349));(qe&127)!==0||yd(l,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,Od(bd.bind(null,l,o,e),[e]),l.flags|=2048,Wi(9,{destroy:void 0},vd.bind(null,l,o,n,t),null),n},useId:function(){var e=nn(),t=ut.identifierPrefix;if(Ue){var n=Le,l=Be;n=(l&~(1<<32-jt(l)-1)).toString(32)+n,t="_"+t+"R_"+n,n=gu++,0<n&&(t+="H"+n.toString(32)),t+="_"}else n=Wm++,t="_"+t+"r_"+n.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:pc,useFormState:Td,useActionState:Td,useOptimistic:function(e){var t=nn();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=gc.bind(null,ke,!0,n),n.dispatch=t,[e,t]},useMemoCache:sc,useCacheRefresh:function(){return nn().memoizedState=lp.bind(null,ke)},useEffectEvent:function(e){var t=nn(),n={impl:e};return t.memoizedState=n,function(){if((Pe&2)!==0)throw Error(r(440));return n.impl.apply(void 0,arguments)}}},xc={readContext:Ut,use:yu,useCallback:$d,useContext:Ut,useEffect:fc,useImperativeHandle:Hd,useInsertionEffect:_d,useLayoutEffect:Bd,useMemo:qd,useReducer:vu,useRef:Rd,useState:function(){return vu(zl)},useDebugValue:dc,useDeferredValue:function(e,t){var n=St();return Yd(n,lt.memoizedState,e,t)},useTransition:function(){var e=vu(zl)[0],t=St().memoizedState;return[typeof e=="boolean"?e:Ps(e),t]},useSyncExternalStore:xd,useId:Vd,useHostTransitionStatus:pc,useFormState:Dd,useActionState:Dd,useOptimistic:function(e,t){var n=St();return jd(n,lt,e,t)},useMemoCache:sc,useCacheRefresh:Zd};xc.useEffectEvent=Ld;var Id={readContext:Ut,use:yu,useCallback:$d,useContext:Ut,useEffect:fc,useImperativeHandle:Hd,useInsertionEffect:_d,useLayoutEffect:Bd,useMemo:qd,useReducer:uc,useRef:Rd,useState:function(){return uc(zl)},useDebugValue:dc,useDeferredValue:function(e,t){var n=St();return lt===null?hc(n,e,t):Yd(n,lt.memoizedState,e,t)},useTransition:function(){var e=uc(zl)[0],t=St().memoizedState;return[typeof e=="boolean"?e:Ps(e),t]},useSyncExternalStore:xd,useId:Vd,useHostTransitionStatus:pc,useFormState:zd,useActionState:zd,useOptimistic:function(e,t){var n=St();return lt!==null?jd(n,lt,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:sc,useCacheRefresh:Zd};Id.useEffectEvent=Ld;function yc(e,t,n,l){t=e.memoizedState,n=n(l,t),n=n==null?t:C({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var vc={enqueueSetState:function(e,t,n){e=e._reactInternals;var l=Nn(),i=da(l);i.payload=t,n!=null&&(i.callback=n),t=ha(e,i,l),t!==null&&(hn(t,e,l),Fs(t,e,l))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var l=Nn(),i=da(l);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=ha(e,i,l),t!==null&&(hn(t,e,l),Fs(t,e,l))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Nn(),l=da(n);l.tag=2,t!=null&&(l.callback=t),t=ha(e,l,n),t!==null&&(hn(t,e,n),Fs(t,e,n))}};function Pd(e,t,n,l,i,o,h){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(l,o,h):t.prototype&&t.prototype.isPureReactComponent?!ia(n,l)||!ia(i,o):!0}function eh(e,t,n,l){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,l),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,l),t.state!==e&&vc.enqueueReplaceState(t,t.state,null)}function ai(e,t){var n=t;if("ref"in t){n={};for(var l in t)l!=="ref"&&(n[l]=t[l])}if(e=e.defaultProps){n===t&&(n=C({},n));for(var i in e)n[i]===void 0&&(n[i]=e[i])}return n}function th(e){Hi(e)}function nh(e){console.error(e)}function lh(e){Hi(e)}function ju(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(l){setTimeout(function(){throw l})}}function ah(e,t,n){try{var l=e.onCaughtError;l(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(i){setTimeout(function(){throw i})}}function bc(e,t,n){return n=da(n),n.tag=3,n.payload={element:null},n.callback=function(){ju(e,t)},n}function ih(e){return e=da(e),e.tag=3,e}function sh(e,t,n,l){var i=n.type.getDerivedStateFromError;if(typeof i=="function"){var o=l.value;e.payload=function(){return i(o)},e.callback=function(){ah(t,n,l)}}var h=n.stateNode;h!==null&&typeof h.componentDidCatch=="function"&&(e.callback=function(){ah(t,n,l),typeof i!="function"&&(va===null?va=new Set([this]):va.add(this));var x=l.stack;this.componentDidCatch(l.value,{componentStack:x!==null?x:""})})}function ip(e,t,n,l,i){if(n.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){if(t=n.alternate,t!==null&&Gi(t,n,i,!0),n=Sn.current,n!==null){switch(n.tag){case 31:case 13:return Rn===null?Lu():n.alternate===null&&vt===0&&(vt=3),n.flags&=-257,n.flags|=65536,n.lanes=i,l===cu?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([l]):t.add(l),Qc(e,l,i)),!1;case 22:return n.flags|=65536,l===cu?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([l])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([l]):n.add(l)),Qc(e,l,i)),!1}throw Error(r(435,n.tag))}return Qc(e,l,i),Lu(),!1}if(Ue)return t=Sn.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=i,l!==wn&&(e=Error(r(422),{cause:l}),Xs(m(e,n)))):(l!==wn&&(t=Error(r(423),{cause:l}),Xs(m(t,n))),e=e.current.alternate,e.flags|=65536,i&=-i,e.lanes|=i,l=m(l,n),i=bc(e.stateNode,l,i),Jr(e,i),vt!==4&&(vt=2)),!1;var o=Error(r(520),{cause:l});if(o=m(o,n),ro===null?ro=[o]:ro.push(o),vt!==4&&(vt=2),t===null)return!0;l=m(l,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=i&-i,n.lanes|=e,e=bc(n.stateNode,l,e),Jr(n,e),!1;case 1:if(t=n.type,o=n.stateNode,(n.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||o!==null&&typeof o.componentDidCatch=="function"&&(va===null||!va.has(o))))return n.flags|=65536,i&=-i,n.lanes|=i,i=ih(i),sh(i,e,n,l),Jr(n,i),!1}n=n.return}while(n!==null);return!1}var wc=Error(r(461)),Mt=!1;function Ht(e,t,n,l){t.child=e===null?cd(t,null,n,l):ni(t,e.child,n,l)}function oh(e,t,n,l,i){n=n.render;var o=t.ref;if("ref"in l){var h={};for(var x in l)x!=="ref"&&(h[x]=l[x])}else h=l;return Ia(t),l=nc(e,t,n,h,o,i),x=lc(),e!==null&&!Mt?(ac(e,t,i),Rl(e,t,i)):(Ue&&x&&Qe(t),t.flags|=1,Ht(e,t,l,i),t.child)}function uh(e,t,n,l,i){if(e===null){var o=n.type;return typeof o=="function"&&!$s(o)&&o.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=o,rh(e,t,o,l,i)):(e=Fa(n.type,null,l,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(o=e.child,!Tc(e,i)){var h=o.memoizedProps;if(n=n.compare,n=n!==null?n:ia,n(h,l)&&e.ref===t.ref)return Rl(e,t,i)}return t.flags|=1,e=Vn(o,l),e.ref=t.ref,e.return=t,t.child=e}function rh(e,t,n,l,i){if(e!==null){var o=e.memoizedProps;if(ia(o,l)&&e.ref===t.ref)if(Mt=!1,t.pendingProps=l=o,Tc(e,i))(e.flags&131072)!==0&&(Mt=!0);else return t.lanes=e.lanes,Rl(e,t,i)}return Sc(e,t,n,l,i)}function ch(e,t,n,l){var i=l.children,o=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.mode==="hidden"){if((t.flags&128)!==0){if(o=o!==null?o.baseLanes|n:n,e!==null){for(l=t.child=e.child,i=0;l!==null;)i=i|l.lanes|l.childLanes,l=l.sibling;l=i&~o}else l=0,t.child=null;return fh(e,t,o,n,l)}if((n&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&uu(t,o!==null?o.cachePool:null),o!==null?hd(t,o):Ir(),md(t);else return l=t.lanes=536870912,fh(e,t,o!==null?o.baseLanes|n:n,n,l)}else o!==null?(uu(t,o.cachePool),hd(t,o),pa(),t.memoizedState=null):(e!==null&&uu(t,null),Ir(),pa());return Ht(e,t,i,n),t.child}function no(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function fh(e,t,n,l,i){var o=Vr();return o=o===null?null:{parent:Ct._currentValue,pool:o},t.memoizedState={baseLanes:n,cachePool:o},e!==null&&uu(t,null),Ir(),md(t),e!==null&&Gi(e,t,l,!0),t.childLanes=i,null}function Eu(e,t){return t=Nu({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function dh(e,t,n){return ni(t,e.child,null,n),e=Eu(t,t.pendingProps),e.flags|=2,jn(t),t.memoizedState=null,e}function sp(e,t,n){var l=t.pendingProps,i=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Ue){if(l.mode==="hidden")return e=Eu(t,l),t.lanes=536870912,no(null,e);if(ec(t),(e=et)?(e=E0(e,tn),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:me!==null?{id:Be,overflow:Le}:null,retryLane:536870912,hydrationErrors:null},n=iu(e),n.return=t,t.child=n,xt=t,et=null)):e=null,e===null)throw Xt(t);return t.lanes=536870912,null}return Eu(t,l)}var o=e.memoizedState;if(o!==null){var h=o.dehydrated;if(ec(t),i)if(t.flags&256)t.flags&=-257,t=dh(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(r(558));else if(Mt||Gi(e,t,n,!1),i=(n&e.childLanes)!==0,Mt||i){if(l=ut,l!==null&&(h=Z(l,n),h!==0&&h!==o.retryLane))throw o.retryLane=h,zn(e,h),hn(l,e,h),wc;Lu(),t=dh(e,t,n)}else e=o.treeContext,et=On(h.nextSibling),xt=t,Ue=!0,Kn=null,tn=!1,e!==null&&Zn(t,e),t=Eu(t,l),t.flags|=4096;return t}return e=Vn(e.child,{mode:l.mode,children:l.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Cu(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!="function"&&typeof n!="object")throw Error(r(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function Sc(e,t,n,l,i){return Ia(t),n=nc(e,t,n,l,void 0,i),l=lc(),e!==null&&!Mt?(ac(e,t,i),Rl(e,t,i)):(Ue&&l&&Qe(t),t.flags|=1,Ht(e,t,n,i),t.child)}function hh(e,t,n,l,i,o){return Ia(t),t.updateQueue=null,n=gd(t,l,n,i),pd(e),l=lc(),e!==null&&!Mt?(ac(e,t,o),Rl(e,t,o)):(Ue&&l&&Qe(t),t.flags|=1,Ht(e,t,n,o),t.child)}function mh(e,t,n,l,i){if(Ia(t),t.stateNode===null){var o=Ml,h=n.contextType;typeof h=="object"&&h!==null&&(o=Ut(h)),o=new n(l,o),t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,o.updater=vc,t.stateNode=o,o._reactInternals=t,o=t.stateNode,o.props=l,o.state=t.memoizedState,o.refs={},Kr(t),h=n.contextType,o.context=typeof h=="object"&&h!==null?Ut(h):Ml,o.state=t.memoizedState,h=n.getDerivedStateFromProps,typeof h=="function"&&(yc(t,n,h,l),o.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof o.getSnapshotBeforeUpdate=="function"||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(h=o.state,typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount(),h!==o.state&&vc.enqueueReplaceState(o,o.state,null),Ws(t,l,o,i),Js(),o.state=t.memoizedState),typeof o.componentDidMount=="function"&&(t.flags|=4194308),l=!0}else if(e===null){o=t.stateNode;var x=t.memoizedProps,N=ai(n,x);o.props=N;var B=o.context,F=n.contextType;h=Ml,typeof F=="object"&&F!==null&&(h=Ut(F));var te=n.getDerivedStateFromProps;F=typeof te=="function"||typeof o.getSnapshotBeforeUpdate=="function",x=t.pendingProps!==x,F||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(x||B!==h)&&eh(t,o,l,h),fa=!1;var $=t.memoizedState;o.state=$,Ws(t,l,o,i),Js(),B=t.memoizedState,x||$!==B||fa?(typeof te=="function"&&(yc(t,n,te,l),B=t.memoizedState),(N=fa||Pd(t,n,N,l,$,B,h))?(F||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(t.flags|=4194308)):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=l,t.memoizedState=B),o.props=l,o.state=B,o.context=h,l=N):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),l=!1)}else{o=t.stateNode,Fr(e,t),h=t.memoizedProps,F=ai(n,h),o.props=F,te=t.pendingProps,$=o.context,B=n.contextType,N=Ml,typeof B=="object"&&B!==null&&(N=Ut(B)),x=n.getDerivedStateFromProps,(B=typeof x=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(h!==te||$!==N)&&eh(t,o,l,N),fa=!1,$=t.memoizedState,o.state=$,Ws(t,l,o,i),Js();var Y=t.memoizedState;h!==te||$!==Y||fa||e!==null&&e.dependencies!==null&&su(e.dependencies)?(typeof x=="function"&&(yc(t,n,x,l),Y=t.memoizedState),(F=fa||Pd(t,n,F,l,$,Y,N)||e!==null&&e.dependencies!==null&&su(e.dependencies))?(B||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(l,Y,N),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(l,Y,N)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||h===e.memoizedProps&&$===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||h===e.memoizedProps&&$===e.memoizedState||(t.flags|=1024),t.memoizedProps=l,t.memoizedState=Y),o.props=l,o.state=Y,o.context=N,l=F):(typeof o.componentDidUpdate!="function"||h===e.memoizedProps&&$===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||h===e.memoizedProps&&$===e.memoizedState||(t.flags|=1024),l=!1)}return o=l,Cu(e,t),l=(t.flags&128)!==0,o||l?(o=t.stateNode,n=l&&typeof n.getDerivedStateFromError!="function"?null:o.render(),t.flags|=1,e!==null&&l?(t.child=ni(t,e.child,null,i),t.child=ni(t,null,n,i)):Ht(e,t,n,i),t.memoizedState=o.state,e=t.child):e=Rl(e,t,i),e}function ph(e,t,n,l){return Ja(),t.flags|=256,Ht(e,t,n,l),t.child}var jc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Ec(e){return{baseLanes:e,cachePool:ad()}}function Cc(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=Cn),e}function gh(e,t,n){var l=t.pendingProps,i=!1,o=(t.flags&128)!==0,h;if((h=o)||(h=e!==null&&e.memoizedState===null?!1:(wt.current&2)!==0),h&&(i=!0,t.flags&=-129),h=(t.flags&32)!==0,t.flags&=-33,e===null){if(Ue){if(i?ma(t):pa(),(e=et)?(e=E0(e,tn),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:me!==null?{id:Be,overflow:Le}:null,retryLane:536870912,hydrationErrors:null},n=iu(e),n.return=t,t.child=n,xt=t,et=null)):e=null,e===null)throw Xt(t);return uf(e)?t.lanes=32:t.lanes=536870912,null}var x=l.children;return l=l.fallback,i?(pa(),i=t.mode,x=Nu({mode:"hidden",children:x},i),l=Al(l,i,n,null),x.return=t,l.return=t,x.sibling=l,t.child=x,l=t.child,l.memoizedState=Ec(n),l.childLanes=Cc(e,h,n),t.memoizedState=jc,no(null,l)):(ma(t),Nc(t,x))}var N=e.memoizedState;if(N!==null&&(x=N.dehydrated,x!==null)){if(o)t.flags&256?(ma(t),t.flags&=-257,t=Mc(e,t,n)):t.memoizedState!==null?(pa(),t.child=e.child,t.flags|=128,t=null):(pa(),x=l.fallback,i=t.mode,l=Nu({mode:"visible",children:l.children},i),x=Al(x,i,n,null),x.flags|=2,l.return=t,x.return=t,l.sibling=x,t.child=l,ni(t,e.child,null,n),l=t.child,l.memoizedState=Ec(n),l.childLanes=Cc(e,h,n),t.memoizedState=jc,t=no(null,l));else if(ma(t),uf(x)){if(h=x.nextSibling&&x.nextSibling.dataset,h)var B=h.dgst;h=B,l=Error(r(419)),l.stack="",l.digest=h,Xs({value:l,source:null,stack:null}),t=Mc(e,t,n)}else if(Mt||Gi(e,t,n,!1),h=(n&e.childLanes)!==0,Mt||h){if(h=ut,h!==null&&(l=Z(h,n),l!==0&&l!==N.retryLane))throw N.retryLane=l,zn(e,l),hn(h,e,l),wc;of(x)||Lu(),t=Mc(e,t,n)}else of(x)?(t.flags|=192,t.child=e.child,t=null):(e=N.treeContext,et=On(x.nextSibling),xt=t,Ue=!0,Kn=null,tn=!1,e!==null&&Zn(t,e),t=Nc(t,l.children),t.flags|=4096);return t}return i?(pa(),x=l.fallback,i=t.mode,N=e.child,B=N.sibling,l=Vn(N,{mode:"hidden",children:l.children}),l.subtreeFlags=N.subtreeFlags&65011712,B!==null?x=Vn(B,x):(x=Al(x,i,n,null),x.flags|=2),x.return=t,l.return=t,l.sibling=x,t.child=l,no(null,l),l=t.child,x=e.child.memoizedState,x===null?x=Ec(n):(i=x.cachePool,i!==null?(N=Ct._currentValue,i=i.parent!==N?{parent:N,pool:N}:i):i=ad(),x={baseLanes:x.baseLanes|n,cachePool:i}),l.memoizedState=x,l.childLanes=Cc(e,h,n),t.memoizedState=jc,no(e.child,l)):(ma(t),n=e.child,e=n.sibling,n=Vn(n,{mode:"visible",children:l.children}),n.return=t,n.sibling=null,e!==null&&(h=t.deletions,h===null?(t.deletions=[e],t.flags|=16):h.push(e)),t.child=n,t.memoizedState=null,n)}function Nc(e,t){return t=Nu({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Nu(e,t){return e=Pt(22,e,null,t),e.lanes=0,e}function Mc(e,t,n){return ni(t,e.child,null,n),e=Nc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function xh(e,t,n){e.lanes|=t;var l=e.alternate;l!==null&&(l.lanes|=t),Yr(e.return,t,n)}function Ac(e,t,n,l,i,o){var h=e.memoizedState;h===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:l,tail:n,tailMode:i,treeForkCount:o}:(h.isBackwards=t,h.rendering=null,h.renderingStartTime=0,h.last=l,h.tail=n,h.tailMode=i,h.treeForkCount=o)}function yh(e,t,n){var l=t.pendingProps,i=l.revealOrder,o=l.tail;l=l.children;var h=wt.current,x=(h&2)!==0;if(x?(h=h&1|2,t.flags|=128):h&=1,le(wt,h),Ht(e,t,l,n),l=Ue?ee:0,!x&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&xh(e,n,t);else if(e.tag===19)xh(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case"forwards":for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&mu(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Ac(t,!1,i,n,o,l);break;case"backwards":case"unstable_legacy-backwards":for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&mu(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Ac(t,!0,n,null,o,l);break;case"together":Ac(t,!1,null,null,void 0,l);break;default:t.memoizedState=null}return t.child}function Rl(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),ya|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(Gi(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(r(153));if(t.child!==null){for(e=t.child,n=Vn(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Vn(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Tc(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&su(e)))}function op(e,t,n){switch(t.tag){case 3:V(t,t.stateNode.containerInfo),ca(t,Ct,e.memoizedState.cache),Ja();break;case 27:case 5:pe(t);break;case 4:V(t,t.stateNode.containerInfo);break;case 10:ca(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,ec(t),null;break;case 13:var l=t.memoizedState;if(l!==null)return l.dehydrated!==null?(ma(t),t.flags|=128,null):(n&t.child.childLanes)!==0?gh(e,t,n):(ma(t),e=Rl(e,t,n),e!==null?e.sibling:null);ma(t);break;case 19:var i=(e.flags&128)!==0;if(l=(n&t.childLanes)!==0,l||(Gi(e,t,n,!1),l=(n&t.childLanes)!==0),i){if(l)return yh(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),le(wt,wt.current),l)break;return null;case 22:return t.lanes=0,ch(e,t,n,t.pendingProps);case 24:ca(t,Ct,e.memoizedState.cache)}return Rl(e,t,n)}function vh(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)Mt=!0;else{if(!Tc(e,n)&&(t.flags&128)===0)return Mt=!1,op(e,t,n);Mt=(e.flags&131072)!==0}else Mt=!1,Ue&&(t.flags&1048576)!==0&&en(t,ee,t.index);switch(t.lanes=0,t.tag){case 16:e:{var l=t.pendingProps;if(e=ei(t.elementType),t.type=e,typeof e=="function")$s(e)?(l=ai(e,l),t.tag=1,t=mh(null,t,e,l,n)):(t.tag=0,t=Sc(null,t,e,l,n));else{if(e!=null){var i=e.$$typeof;if(i===X){t.tag=11,t=oh(null,t,e,l,n);break e}else if(i===I){t.tag=14,t=uh(null,t,e,l,n);break e}}throw t=xe(e)||e,Error(r(306,t,""))}}return t;case 0:return Sc(e,t,t.type,t.pendingProps,n);case 1:return l=t.type,i=ai(l,t.pendingProps),mh(e,t,l,i,n);case 3:e:{if(V(t,t.stateNode.containerInfo),e===null)throw Error(r(387));l=t.pendingProps;var o=t.memoizedState;i=o.element,Fr(e,t),Ws(t,l,null,n);var h=t.memoizedState;if(l=h.cache,ca(t,Ct,l),l!==o.cache&&Gr(t,[Ct],n,!0),Js(),l=h.element,o.isDehydrated)if(o={element:l,isDehydrated:!1,cache:h.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=ph(e,t,l,n);break e}else if(l!==i){i=m(Error(r(424)),t),Xs(i),t=ph(e,t,l,n);break e}else for(e=t.stateNode.containerInfo,e.nodeType===9?e=e.body:e=e.nodeName==="HTML"?e.ownerDocument.body:e,et=On(e.firstChild),xt=t,Ue=!0,Kn=null,tn=!0,n=cd(t,null,l,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Ja(),l===i){t=Rl(e,t,n);break e}Ht(e,t,l,n)}t=t.child}return t;case 26:return Cu(e,t),e===null?(n=D0(t.type,null,t.pendingProps,null))?t.memoizedState=n:Ue||(n=t.type,e=t.pendingProps,l=Yu(Ee.current).createElement(n),l[Ie]=t,l[Re]=e,$t(l,n,e),bt(l),t.stateNode=l):t.memoizedState=D0(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return pe(t),e===null&&Ue&&(l=t.stateNode=M0(t.type,t.pendingProps,Ee.current),xt=t,tn=!0,i=et,ja(t.type)?(rf=i,et=On(l.firstChild)):et=i),Ht(e,t,t.pendingProps.children,n),Cu(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Ue&&((i=l=et)&&(l=Bp(l,t.type,t.pendingProps,tn),l!==null?(t.stateNode=l,xt=t,et=On(l.firstChild),tn=!1,i=!0):i=!1),i||Xt(t)),pe(t),i=t.type,o=t.pendingProps,h=e!==null?e.memoizedProps:null,l=o.children,lf(i,o)?l=null:h!==null&&lf(i,h)&&(t.flags|=32),t.memoizedState!==null&&(i=nc(e,t,Im,null,null,n),yo._currentValue=i),Cu(e,t),Ht(e,t,l,n),t.child;case 6:return e===null&&Ue&&((e=n=et)&&(n=Up(n,t.pendingProps,tn),n!==null?(t.stateNode=n,xt=t,et=null,e=!0):e=!1),e||Xt(t)),null;case 13:return gh(e,t,n);case 4:return V(t,t.stateNode.containerInfo),l=t.pendingProps,e===null?t.child=ni(t,null,l,n):Ht(e,t,l,n),t.child;case 11:return oh(e,t,t.type,t.pendingProps,n);case 7:return Ht(e,t,t.pendingProps,n),t.child;case 8:return Ht(e,t,t.pendingProps.children,n),t.child;case 12:return Ht(e,t,t.pendingProps.children,n),t.child;case 10:return l=t.pendingProps,ca(t,t.type,l.value),Ht(e,t,l.children,n),t.child;case 9:return i=t.type._context,l=t.pendingProps.children,Ia(t),i=Ut(i),l=l(i),t.flags|=1,Ht(e,t,l,n),t.child;case 14:return uh(e,t,t.type,t.pendingProps,n);case 15:return rh(e,t,t.type,t.pendingProps,n);case 19:return yh(e,t,n);case 31:return sp(e,t,n);case 22:return ch(e,t,n,t.pendingProps);case 24:return Ia(t),l=Ut(Ct),e===null?(i=Vr(),i===null&&(i=ut,o=Xr(),i.pooledCache=o,o.refCount++,o!==null&&(i.pooledCacheLanes|=n),i=o),t.memoizedState={parent:l,cache:i},Kr(t),ca(t,Ct,i)):((e.lanes&n)!==0&&(Fr(e,t),Ws(t,null,null,n),Js()),i=e.memoizedState,o=t.memoizedState,i.parent!==l?(i={parent:l,cache:l},t.memoizedState=i,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=i),ca(t,Ct,l)):(l=o.cache,ca(t,Ct,l),l!==i.cache&&Gr(t,[Ct],n,!0))),Ht(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(r(156,t.tag))}function Ol(e){e.flags|=4}function Dc(e,t,n,l,i){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i)if(e.stateNode.complete)e.flags|=8192;else if(Vh())e.flags|=8192;else throw ti=cu,Zr}else e.flags&=-16777217}function bh(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!L0(t))if(Vh())e.flags|=8192;else throw ti=cu,Zr}function Mu(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?yi():536870912,e.lanes|=t,ts|=t)}function lo(e,t){if(!Ue)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var l=null;n!==null;)n.alternate!==null&&(l=n),n=n.sibling;l===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:l.sibling=null}}function dt(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,l=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,l|=i.subtreeFlags&65011712,l|=i.flags&65011712,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,l|=i.subtreeFlags,l|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=l,e.childLanes=n,t}function up(e,t,n){var l=t.pendingProps;switch(un(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return dt(t),null;case 1:return dt(t),null;case 3:return n=t.stateNode,l=null,e!==null&&(l=e.memoizedState.cache),t.memoizedState.cache!==l&&(t.flags|=2048),Dl(Ct),se(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Yi(t)?Ol(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,$r())),dt(t),null;case 26:var i=t.type,o=t.memoizedState;return e===null?(Ol(t),o!==null?(dt(t),bh(t,o)):(dt(t),Dc(t,i,null,l,n))):o?o!==e.memoizedState?(Ol(t),dt(t),bh(t,o)):(dt(t),t.flags&=-16777217):(e=e.memoizedProps,e!==l&&Ol(t),dt(t),Dc(t,i,e,l,n)),null;case 27:if(Ae(t),n=Ee.current,i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&Ol(t);else{if(!l){if(t.stateNode===null)throw Error(r(166));return dt(t),null}e=ce.current,Yi(t)?Pf(t):(e=M0(i,l,n),t.stateNode=e,Ol(t))}return dt(t),null;case 5:if(Ae(t),i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&Ol(t);else{if(!l){if(t.stateNode===null)throw Error(r(166));return dt(t),null}if(o=ce.current,Yi(t))Pf(t);else{var h=Yu(Ee.current);switch(o){case 1:o=h.createElementNS("http://www.w3.org/2000/svg",i);break;case 2:o=h.createElementNS("http://www.w3.org/1998/Math/MathML",i);break;default:switch(i){case"svg":o=h.createElementNS("http://www.w3.org/2000/svg",i);break;case"math":o=h.createElementNS("http://www.w3.org/1998/Math/MathML",i);break;case"script":o=h.createElement("div"),o.innerHTML="<script><\/script>",o=o.removeChild(o.firstChild);break;case"select":o=typeof l.is=="string"?h.createElement("select",{is:l.is}):h.createElement("select"),l.multiple?o.multiple=!0:l.size&&(o.size=l.size);break;default:o=typeof l.is=="string"?h.createElement(i,{is:l.is}):h.createElement(i)}}o[Ie]=t,o[Re]=l;e:for(h=t.child;h!==null;){if(h.tag===5||h.tag===6)o.appendChild(h.stateNode);else if(h.tag!==4&&h.tag!==27&&h.child!==null){h.child.return=h,h=h.child;continue}if(h===t)break e;for(;h.sibling===null;){if(h.return===null||h.return===t)break e;h=h.return}h.sibling.return=h.return,h=h.sibling}t.stateNode=o;e:switch($t(o,i,l),i){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}l&&Ol(t)}}return dt(t),Dc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==l&&Ol(t);else{if(typeof l!="string"&&t.stateNode===null)throw Error(r(166));if(e=Ee.current,Yi(t)){if(e=t.stateNode,n=t.memoizedProps,l=null,i=xt,i!==null)switch(i.tag){case 27:case 5:l=i.memoizedProps}e[Ie]=t,e=!!(e.nodeValue===n||l!==null&&l.suppressHydrationWarning===!0||g0(e.nodeValue,n)),e||Xt(t,!0)}else e=Yu(e).createTextNode(l),e[Ie]=t,t.stateNode=e}return dt(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(l=Yi(t),n!==null){if(e===null){if(!l)throw Error(r(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(r(557));e[Ie]=t}else Ja(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;dt(t),e=!1}else n=$r(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(jn(t),t):(jn(t),null);if((t.flags&128)!==0)throw Error(r(558))}return dt(t),null;case 13:if(l=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(i=Yi(t),l!==null&&l.dehydrated!==null){if(e===null){if(!i)throw Error(r(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));i[Ie]=t}else Ja(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;dt(t),i=!1}else i=$r(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),i=!0;if(!i)return t.flags&256?(jn(t),t):(jn(t),null)}return jn(t),(t.flags&128)!==0?(t.lanes=n,t):(n=l!==null,e=e!==null&&e.memoizedState!==null,n&&(l=t.child,i=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(i=l.alternate.memoizedState.cachePool.pool),o=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(o=l.memoizedState.cachePool.pool),o!==i&&(l.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Mu(t,t.updateQueue),dt(t),null);case 4:return se(),e===null&&Ic(t.stateNode.containerInfo),dt(t),null;case 10:return Dl(t.type),dt(t),null;case 19:if(G(wt),l=t.memoizedState,l===null)return dt(t),null;if(i=(t.flags&128)!==0,o=l.rendering,o===null)if(i)lo(l,!1);else{if(vt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(o=mu(e),o!==null){for(t.flags|=128,lo(l,!1),e=o.updateQueue,t.updateQueue=e,Mu(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)au(n,e),n=n.sibling;return le(wt,wt.current&1|2),Ue&&Xe(t,l.treeForkCount),t.child}e=e.sibling}l.tail!==null&&ft()>zu&&(t.flags|=128,i=!0,lo(l,!1),t.lanes=4194304)}else{if(!i)if(e=mu(o),e!==null){if(t.flags|=128,i=!0,e=e.updateQueue,t.updateQueue=e,Mu(t,e),lo(l,!0),l.tail===null&&l.tailMode==="hidden"&&!o.alternate&&!Ue)return dt(t),null}else 2*ft()-l.renderingStartTime>zu&&n!==536870912&&(t.flags|=128,i=!0,lo(l,!1),t.lanes=4194304);l.isBackwards?(o.sibling=t.child,t.child=o):(e=l.last,e!==null?e.sibling=o:t.child=o,l.last=o)}return l.tail!==null?(e=l.tail,l.rendering=e,l.tail=e.sibling,l.renderingStartTime=ft(),e.sibling=null,n=wt.current,le(wt,i?n&1|2:n&1),Ue&&Xe(t,l.treeForkCount),e):(dt(t),null);case 22:case 23:return jn(t),Pr(),l=t.memoizedState!==null,e!==null?e.memoizedState!==null!==l&&(t.flags|=8192):l&&(t.flags|=8192),l?(n&536870912)!==0&&(t.flags&128)===0&&(dt(t),t.subtreeFlags&6&&(t.flags|=8192)):dt(t),n=t.updateQueue,n!==null&&Mu(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),l=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),l!==n&&(t.flags|=2048),e!==null&&G(Pa),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Dl(Ct),dt(t),null;case 25:return null;case 30:return null}throw Error(r(156,t.tag))}function rp(e,t){switch(un(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Dl(Ct),se(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Ae(t),null;case 31:if(t.memoizedState!==null){if(jn(t),t.alternate===null)throw Error(r(340));Ja()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(jn(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(r(340));Ja()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return G(wt),null;case 4:return se(),null;case 10:return Dl(t.type),null;case 22:case 23:return jn(t),Pr(),e!==null&&G(Pa),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Dl(Ct),null;case 25:return null;default:return null}}function wh(e,t){switch(un(t),t.tag){case 3:Dl(Ct),se();break;case 26:case 27:case 5:Ae(t);break;case 4:se();break;case 31:t.memoizedState!==null&&jn(t);break;case 13:jn(t);break;case 19:G(wt);break;case 10:Dl(t.type);break;case 22:case 23:jn(t),Pr(),e!==null&&G(Pa);break;case 24:Dl(Ct)}}function ao(e,t){try{var n=t.updateQueue,l=n!==null?n.lastEffect:null;if(l!==null){var i=l.next;n=i;do{if((n.tag&e)===e){l=void 0;var o=n.create,h=n.inst;l=o(),h.destroy=l}n=n.next}while(n!==i)}}catch(x){nt(t,t.return,x)}}function ga(e,t,n){try{var l=t.updateQueue,i=l!==null?l.lastEffect:null;if(i!==null){var o=i.next;l=o;do{if((l.tag&e)===e){var h=l.inst,x=h.destroy;if(x!==void 0){h.destroy=void 0,i=t;var N=n,B=x;try{B()}catch(F){nt(i,N,F)}}}l=l.next}while(l!==o)}}catch(F){nt(t,t.return,F)}}function Sh(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{dd(t,n)}catch(l){nt(e,e.return,l)}}}function jh(e,t,n){n.props=ai(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(l){nt(e,t,l)}}function io(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var l=e.stateNode;break;case 30:l=e.stateNode;break;default:l=e.stateNode}typeof n=="function"?e.refCleanup=n(l):n.current=l}}catch(i){nt(e,t,i)}}function ul(e,t){var n=e.ref,l=e.refCleanup;if(n!==null)if(typeof l=="function")try{l()}catch(i){nt(e,t,i)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(i){nt(e,t,i)}else n.current=null}function Eh(e){var t=e.type,n=e.memoizedProps,l=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&l.focus();break e;case"img":n.src?l.src=n.src:n.srcSet&&(l.srcset=n.srcSet)}}catch(i){nt(e,e.return,i)}}function kc(e,t,n){try{var l=e.stateNode;kp(l,e.type,n,t),l[Re]=t}catch(i){nt(e,e.return,i)}}function Ch(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&ja(e.type)||e.tag===4}function zc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Ch(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&&ja(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 Rc(e,t,n){var l=e.tag;if(l===5||l===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Wt));else if(l!==4&&(l===27&&ja(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Rc(e,t,n),e=e.sibling;e!==null;)Rc(e,t,n),e=e.sibling}function Au(e,t,n){var l=e.tag;if(l===5||l===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(l!==4&&(l===27&&ja(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Au(e,t,n),e=e.sibling;e!==null;)Au(e,t,n),e=e.sibling}function Nh(e){var t=e.stateNode,n=e.memoizedProps;try{for(var l=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);$t(t,l,n),t[Ie]=e,t[Re]=n}catch(o){nt(e,e.return,o)}}var Ll=!1,At=!1,Oc=!1,Mh=typeof WeakSet=="function"?WeakSet:Set,zt=null;function cp(e,t){if(e=e.containerInfo,tf=Fu,e=Wo(e),Os(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var l=n.getSelection&&n.getSelection();if(l&&l.rangeCount!==0){n=l.anchorNode;var i=l.anchorOffset,o=l.focusNode;l=l.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var h=0,x=-1,N=-1,B=0,F=0,te=e,$=null;t:for(;;){for(var Y;te!==n||i!==0&&te.nodeType!==3||(x=h+i),te!==o||l!==0&&te.nodeType!==3||(N=h+l),te.nodeType===3&&(h+=te.nodeValue.length),(Y=te.firstChild)!==null;)$=te,te=Y;for(;;){if(te===e)break t;if($===n&&++B===i&&(x=h),$===o&&++F===l&&(N=h),(Y=te.nextSibling)!==null)break;te=$,$=te.parentNode}te=Y}n=x===-1||N===-1?null:{start:x,end:N}}else n=null}n=n||{start:0,end:0}}else n=null;for(nf={focusedElem:e,selectionRange:n},Fu=!1,zt=t;zt!==null;)if(t=zt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,zt=e;else for(;zt!==null;){switch(t=zt,o=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(n=0;n<e.length;n++)i=e[n],i.ref.impl=i.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&o!==null){e=void 0,n=t,i=o.memoizedProps,o=o.memoizedState,l=n.stateNode;try{var ge=ai(n.type,i);e=l.getSnapshotBeforeUpdate(ge,o),l.__reactInternalSnapshotBeforeUpdate=e}catch(Me){nt(n,n.return,Me)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)sf(e);else if(n===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":sf(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(r(163))}if(e=t.sibling,e!==null){e.return=t.return,zt=e;break}zt=t.return}}function Ah(e,t,n){var l=n.flags;switch(n.tag){case 0:case 11:case 15:Bl(e,n),l&4&&ao(5,n);break;case 1:if(Bl(e,n),l&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(h){nt(n,n.return,h)}else{var i=ai(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(h){nt(n,n.return,h)}}l&64&&Sh(n),l&512&&io(n,n.return);break;case 3:if(Bl(e,n),l&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{dd(e,t)}catch(h){nt(n,n.return,h)}}break;case 27:t===null&&l&4&&Nh(n);case 26:case 5:Bl(e,n),t===null&&l&4&&Eh(n),l&512&&io(n,n.return);break;case 12:Bl(e,n);break;case 31:Bl(e,n),l&4&&kh(e,n);break;case 13:Bl(e,n),l&4&&zh(e,n),l&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=vp.bind(null,n),Hp(e,n))));break;case 22:if(l=n.memoizedState!==null||Ll,!l){t=t!==null&&t.memoizedState!==null||At,i=Ll;var o=At;Ll=l,(At=t)&&!o?Ul(e,n,(n.subtreeFlags&8772)!==0):Bl(e,n),Ll=i,At=o}break;case 30:break;default:Bl(e,n)}}function Th(e){var t=e.alternate;t!==null&&(e.alternate=null,Th(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Oa(t)),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 ht=null,rn=!1;function _l(e,t,n){for(n=n.child;n!==null;)Dh(e,t,n),n=n.sibling}function Dh(e,t,n){if(Rt&&typeof Rt.onCommitFiberUnmount=="function")try{Rt.onCommitFiberUnmount(fl,n)}catch{}switch(n.tag){case 26:At||ul(n,t),_l(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:At||ul(n,t);var l=ht,i=rn;ja(n.type)&&(ht=n.stateNode,rn=!1),_l(e,t,n),po(n.stateNode),ht=l,rn=i;break;case 5:At||ul(n,t);case 6:if(l=ht,i=rn,ht=null,_l(e,t,n),ht=l,rn=i,ht!==null)if(rn)try{(ht.nodeType===9?ht.body:ht.nodeName==="HTML"?ht.ownerDocument.body:ht).removeChild(n.stateNode)}catch(o){nt(n,t,o)}else try{ht.removeChild(n.stateNode)}catch(o){nt(n,t,o)}break;case 18:ht!==null&&(rn?(e=ht,S0(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),rs(e)):S0(ht,n.stateNode));break;case 4:l=ht,i=rn,ht=n.stateNode.containerInfo,rn=!0,_l(e,t,n),ht=l,rn=i;break;case 0:case 11:case 14:case 15:ga(2,n,t),At||ga(4,n,t),_l(e,t,n);break;case 1:At||(ul(n,t),l=n.stateNode,typeof l.componentWillUnmount=="function"&&jh(n,t,l)),_l(e,t,n);break;case 21:_l(e,t,n);break;case 22:At=(l=At)||n.memoizedState!==null,_l(e,t,n),At=l;break;default:_l(e,t,n)}}function kh(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{rs(e)}catch(n){nt(t,t.return,n)}}}function zh(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{rs(e)}catch(n){nt(t,t.return,n)}}function fp(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Mh),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Mh),t;default:throw Error(r(435,e.tag))}}function Tu(e,t){var n=fp(e);t.forEach(function(l){if(!n.has(l)){n.add(l);var i=bp.bind(null,e,l);l.then(i,i)}})}function cn(e,t){var n=t.deletions;if(n!==null)for(var l=0;l<n.length;l++){var i=n[l],o=e,h=t,x=h;e:for(;x!==null;){switch(x.tag){case 27:if(ja(x.type)){ht=x.stateNode,rn=!1;break e}break;case 5:ht=x.stateNode,rn=!1;break e;case 3:case 4:ht=x.stateNode.containerInfo,rn=!0;break e}x=x.return}if(ht===null)throw Error(r(160));Dh(o,h,i),ht=null,rn=!1,o=i.alternate,o!==null&&(o.return=null),i.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Rh(t,e),t=t.sibling}var Fn=null;function Rh(e,t){var n=e.alternate,l=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:cn(t,e),fn(e),l&4&&(ga(3,e,e.return),ao(3,e),ga(5,e,e.return));break;case 1:cn(t,e),fn(e),l&512&&(At||n===null||ul(n,n.return)),l&64&&Ll&&(e=e.updateQueue,e!==null&&(l=e.callbacks,l!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?l:n.concat(l))));break;case 26:var i=Fn;if(cn(t,e),fn(e),l&512&&(At||n===null||ul(n,n.return)),l&4){var o=n!==null?n.memoizedState:null;if(l=e.memoizedState,n===null)if(l===null)if(e.stateNode===null){e:{l=e.type,n=e.memoizedProps,i=i.ownerDocument||i;t:switch(l){case"title":o=i.getElementsByTagName("title")[0],(!o||o[Xl]||o[Ie]||o.namespaceURI==="http://www.w3.org/2000/svg"||o.hasAttribute("itemprop"))&&(o=i.createElement(l),i.head.insertBefore(o,i.querySelector("head > title"))),$t(o,l,n),o[Ie]=e,bt(o),l=o;break e;case"link":var h=R0("link","href",i).get(l+(n.href||""));if(h){for(var x=0;x<h.length;x++)if(o=h[x],o.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&o.getAttribute("rel")===(n.rel==null?null:n.rel)&&o.getAttribute("title")===(n.title==null?null:n.title)&&o.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){h.splice(x,1);break t}}o=i.createElement(l),$t(o,l,n),i.head.appendChild(o);break;case"meta":if(h=R0("meta","content",i).get(l+(n.content||""))){for(x=0;x<h.length;x++)if(o=h[x],o.getAttribute("content")===(n.content==null?null:""+n.content)&&o.getAttribute("name")===(n.name==null?null:n.name)&&o.getAttribute("property")===(n.property==null?null:n.property)&&o.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&o.getAttribute("charset")===(n.charSet==null?null:n.charSet)){h.splice(x,1);break t}}o=i.createElement(l),$t(o,l,n),i.head.appendChild(o);break;default:throw Error(r(468,l))}o[Ie]=e,bt(o),l=o}e.stateNode=l}else O0(i,e.type,e.stateNode);else e.stateNode=z0(i,l,e.memoizedProps);else o!==l?(o===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):o.count--,l===null?O0(i,e.type,e.stateNode):z0(i,l,e.memoizedProps)):l===null&&e.stateNode!==null&&kc(e,e.memoizedProps,n.memoizedProps)}break;case 27:cn(t,e),fn(e),l&512&&(At||n===null||ul(n,n.return)),n!==null&&l&4&&kc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(cn(t,e),fn(e),l&512&&(At||n===null||ul(n,n.return)),e.flags&32){i=e.stateNode;try{al(i,"")}catch(ge){nt(e,e.return,ge)}}l&4&&e.stateNode!=null&&(i=e.memoizedProps,kc(e,i,n!==null?n.memoizedProps:i)),l&1024&&(Oc=!0);break;case 6:if(cn(t,e),fn(e),l&4){if(e.stateNode===null)throw Error(r(162));l=e.memoizedProps,n=e.stateNode;try{n.nodeValue=l}catch(ge){nt(e,e.return,ge)}}break;case 3:if(Qu=null,i=Fn,Fn=Gu(t.containerInfo),cn(t,e),Fn=i,fn(e),l&4&&n!==null&&n.memoizedState.isDehydrated)try{rs(t.containerInfo)}catch(ge){nt(e,e.return,ge)}Oc&&(Oc=!1,Oh(e));break;case 4:l=Fn,Fn=Gu(e.stateNode.containerInfo),cn(t,e),fn(e),Fn=l;break;case 12:cn(t,e),fn(e);break;case 31:cn(t,e),fn(e),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,Tu(e,l)));break;case 13:cn(t,e),fn(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(ku=ft()),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,Tu(e,l)));break;case 22:i=e.memoizedState!==null;var N=n!==null&&n.memoizedState!==null,B=Ll,F=At;if(Ll=B||i,At=F||N,cn(t,e),At=F,Ll=B,fn(e),l&8192)e:for(t=e.stateNode,t._visibility=i?t._visibility&-2:t._visibility|1,i&&(n===null||N||Ll||At||ii(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){N=n=t;try{if(o=N.stateNode,i)h=o.style,typeof h.setProperty=="function"?h.setProperty("display","none","important"):h.display="none";else{x=N.stateNode;var te=N.memoizedProps.style,$=te!=null&&te.hasOwnProperty("display")?te.display:null;x.style.display=$==null||typeof $=="boolean"?"":(""+$).trim()}}catch(ge){nt(N,N.return,ge)}}}else if(t.tag===6){if(n===null){N=t;try{N.stateNode.nodeValue=i?"":N.memoizedProps}catch(ge){nt(N,N.return,ge)}}}else if(t.tag===18){if(n===null){N=t;try{var Y=N.stateNode;i?j0(Y,!0):j0(N.stateNode,!1)}catch(ge){nt(N,N.return,ge)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}l&4&&(l=e.updateQueue,l!==null&&(n=l.retryQueue,n!==null&&(l.retryQueue=null,Tu(e,n))));break;case 19:cn(t,e),fn(e),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,Tu(e,l)));break;case 30:break;case 21:break;default:cn(t,e),fn(e)}}function fn(e){var t=e.flags;if(t&2){try{for(var n,l=e.return;l!==null;){if(Ch(l)){n=l;break}l=l.return}if(n==null)throw Error(r(160));switch(n.tag){case 27:var i=n.stateNode,o=zc(e);Au(e,o,i);break;case 5:var h=n.stateNode;n.flags&32&&(al(h,""),n.flags&=-33);var x=zc(e);Au(e,x,h);break;case 3:case 4:var N=n.stateNode.containerInfo,B=zc(e);Rc(e,B,N);break;default:throw Error(r(161))}}catch(F){nt(e,e.return,F)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Oh(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Oh(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Bl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Ah(e,t.alternate,t),t=t.sibling}function ii(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:ga(4,t,t.return),ii(t);break;case 1:ul(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount=="function"&&jh(t,t.return,n),ii(t);break;case 27:po(t.stateNode);case 26:case 5:ul(t,t.return),ii(t);break;case 22:t.memoizedState===null&&ii(t);break;case 30:ii(t);break;default:ii(t)}e=e.sibling}}function Ul(e,t,n){for(n=n&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var l=t.alternate,i=e,o=t,h=o.flags;switch(o.tag){case 0:case 11:case 15:Ul(i,o,n),ao(4,o);break;case 1:if(Ul(i,o,n),l=o,i=l.stateNode,typeof i.componentDidMount=="function")try{i.componentDidMount()}catch(B){nt(l,l.return,B)}if(l=o,i=l.updateQueue,i!==null){var x=l.stateNode;try{var N=i.shared.hiddenCallbacks;if(N!==null)for(i.shared.hiddenCallbacks=null,i=0;i<N.length;i++)fd(N[i],x)}catch(B){nt(l,l.return,B)}}n&&h&64&&Sh(o),io(o,o.return);break;case 27:Nh(o);case 26:case 5:Ul(i,o,n),n&&l===null&&h&4&&Eh(o),io(o,o.return);break;case 12:Ul(i,o,n);break;case 31:Ul(i,o,n),n&&h&4&&kh(i,o);break;case 13:Ul(i,o,n),n&&h&4&&zh(i,o);break;case 22:o.memoizedState===null&&Ul(i,o,n),io(o,o.return);break;case 30:break;default:Ul(i,o,n)}t=t.sibling}}function Lc(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&Qs(n))}function _c(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Qs(e))}function Jn(e,t,n,l){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Lh(e,t,n,l),t=t.sibling}function Lh(e,t,n,l){var i=t.flags;switch(t.tag){case 0:case 11:case 15:Jn(e,t,n,l),i&2048&&ao(9,t);break;case 1:Jn(e,t,n,l);break;case 3:Jn(e,t,n,l),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Qs(e)));break;case 12:if(i&2048){Jn(e,t,n,l),e=t.stateNode;try{var o=t.memoizedProps,h=o.id,x=o.onPostCommit;typeof x=="function"&&x(h,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(N){nt(t,t.return,N)}}else Jn(e,t,n,l);break;case 31:Jn(e,t,n,l);break;case 13:Jn(e,t,n,l);break;case 23:break;case 22:o=t.stateNode,h=t.alternate,t.memoizedState!==null?o._visibility&2?Jn(e,t,n,l):so(e,t):o._visibility&2?Jn(e,t,n,l):(o._visibility|=2,Ii(e,t,n,l,(t.subtreeFlags&10256)!==0||!1)),i&2048&&Lc(h,t);break;case 24:Jn(e,t,n,l),i&2048&&_c(t.alternate,t);break;default:Jn(e,t,n,l)}}function Ii(e,t,n,l,i){for(i=i&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var o=e,h=t,x=n,N=l,B=h.flags;switch(h.tag){case 0:case 11:case 15:Ii(o,h,x,N,i),ao(8,h);break;case 23:break;case 22:var F=h.stateNode;h.memoizedState!==null?F._visibility&2?Ii(o,h,x,N,i):so(o,h):(F._visibility|=2,Ii(o,h,x,N,i)),i&&B&2048&&Lc(h.alternate,h);break;case 24:Ii(o,h,x,N,i),i&&B&2048&&_c(h.alternate,h);break;default:Ii(o,h,x,N,i)}t=t.sibling}}function so(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,l=t,i=l.flags;switch(l.tag){case 22:so(n,l),i&2048&&Lc(l.alternate,l);break;case 24:so(n,l),i&2048&&_c(l.alternate,l);break;default:so(n,l)}t=t.sibling}}var oo=8192;function Pi(e,t,n){if(e.subtreeFlags&oo)for(e=e.child;e!==null;)_h(e,t,n),e=e.sibling}function _h(e,t,n){switch(e.tag){case 26:Pi(e,t,n),e.flags&oo&&e.memoizedState!==null&&Wp(n,Fn,e.memoizedState,e.memoizedProps);break;case 5:Pi(e,t,n);break;case 3:case 4:var l=Fn;Fn=Gu(e.stateNode.containerInfo),Pi(e,t,n),Fn=l;break;case 22:e.memoizedState===null&&(l=e.alternate,l!==null&&l.memoizedState!==null?(l=oo,oo=16777216,Pi(e,t,n),oo=l):Pi(e,t,n));break;default:Pi(e,t,n)}}function Bh(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function uo(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var l=t[n];zt=l,Hh(l,e)}Bh(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Uh(e),e=e.sibling}function Uh(e){switch(e.tag){case 0:case 11:case 15:uo(e),e.flags&2048&&ga(9,e,e.return);break;case 3:uo(e);break;case 12:uo(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Du(e)):uo(e);break;default:uo(e)}}function Du(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var l=t[n];zt=l,Hh(l,e)}Bh(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:ga(8,t,t.return),Du(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Du(t));break;default:Du(t)}e=e.sibling}}function Hh(e,t){for(;zt!==null;){var n=zt;switch(n.tag){case 0:case 11:case 15:ga(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var l=n.memoizedState.cachePool.pool;l!=null&&l.refCount++}break;case 24:Qs(n.memoizedState.cache)}if(l=n.child,l!==null)l.return=n,zt=l;else e:for(n=e;zt!==null;){l=zt;var i=l.sibling,o=l.return;if(Th(l),l===n){zt=null;break e}if(i!==null){i.return=o,zt=i;break e}zt=o}}}var dp={getCacheForType:function(e){var t=Ut(Ct),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Ut(Ct).controller.signal}},hp=typeof WeakMap=="function"?WeakMap:Map,Pe=0,ut=null,He=null,qe=0,tt=0,En=null,xa=!1,es=!1,Bc=!1,Hl=0,vt=0,ya=0,si=0,Uc=0,Cn=0,ts=0,ro=null,dn=null,Hc=!1,ku=0,$h=0,zu=1/0,Ru=null,va=null,Dt=0,ba=null,ns=null,$l=0,$c=0,qc=null,qh=null,co=0,Yc=null;function Nn(){return(Pe&2)!==0&&qe!==0?qe&-qe:O.T!==null?Kc():Oe()}function Yh(){if(Cn===0)if((qe&536870912)===0||Ue){var e=hl;hl<<=1,(hl&3932160)===0&&(hl=262144),Cn=e}else Cn=536870912;return e=Sn.current,e!==null&&(e.flags|=32),Cn}function hn(e,t,n){(e===ut&&(tt===2||tt===9)||e.cancelPendingCommit!==null)&&(ls(e,0),wa(e,qe,Cn,!1)),Yt(e,n),((Pe&2)===0||e!==ut)&&(e===ut&&((Pe&2)===0&&(si|=n),vt===4&&wa(e,qe,Cn,!1)),rl(e))}function Gh(e,t,n){if((Pe&6)!==0)throw Error(r(327));var l=!n&&(t&127)===0&&(t&e.expiredLanes)===0||Ft(e,t),i=l?gp(e,t):Xc(e,t,!0),o=l;do{if(i===0){es&&!l&&wa(e,t,0,!1);break}else{if(n=e.current.alternate,o&&!mp(n)){i=Xc(e,t,!1),o=!1;continue}if(i===2){if(o=t,e.errorRecoveryDisabledLanes&o)var h=0;else h=e.pendingLanes&-536870913,h=h!==0?h:h&536870912?536870912:0;if(h!==0){t=h;e:{var x=e;i=ro;var N=x.current.memoizedState.isDehydrated;if(N&&(ls(x,h).flags|=256),h=Xc(x,h,!1),h!==2){if(Bc&&!N){x.errorRecoveryDisabledLanes|=o,si|=o,i=4;break e}o=dn,dn=i,o!==null&&(dn===null?dn=o:dn.push.apply(dn,o))}i=h}if(o=!1,i!==2)continue}}if(i===1){ls(e,0),wa(e,t,0,!0);break}e:{switch(l=e,o=i,o){case 0:case 1:throw Error(r(345));case 4:if((t&4194048)!==t)break;case 6:wa(l,t,Cn,!xa);break e;case 2:dn=null;break;case 3:case 5:break;default:throw Error(r(329))}if((t&62914560)===t&&(i=ku+300-ft(),10<i)){if(wa(l,t,Cn,!xa),Mn(l,0,!0)!==0)break e;$l=t,l.timeoutHandle=b0(Xh.bind(null,l,n,dn,Ru,Hc,t,Cn,si,ts,xa,o,"Throttled",-0,0),i);break e}Xh(l,n,dn,Ru,Hc,t,Cn,si,ts,xa,o,null,-0,0)}}break}while(!0);rl(e)}function Xh(e,t,n,l,i,o,h,x,N,B,F,te,$,Y){if(e.timeoutHandle=-1,te=t.subtreeFlags,te&8192||(te&16785408)===16785408){te={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Wt},_h(t,o,te);var ge=(o&62914560)===o?ku-ft():(o&4194048)===o?$h-ft():0;if(ge=Ip(te,ge),ge!==null){$l=o,e.cancelPendingCommit=ge(Ih.bind(null,e,t,o,n,l,i,h,x,N,F,te,null,$,Y)),wa(e,o,h,!B);return}}Ih(e,t,o,n,l,i,h,x,N)}function mp(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var l=0;l<n.length;l++){var i=n[l],o=i.getSnapshot;i=i.value;try{if(!Bt(o(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function wa(e,t,n,l){t&=~Uc,t&=~si,e.suspendedLanes|=t,e.pingedLanes&=~t,l&&(e.warmLanes|=t),l=e.expirationTimes;for(var i=t;0<i;){var o=31-jt(i),h=1<<o;l[o]=-1,i&=~h}n!==0&&pl(e,n,t)}function Ou(){return(Pe&6)===0?(fo(0),!1):!0}function Gc(){if(He!==null){if(tt===0)var e=He.return;else e=He,Tl=Wa=null,ic(e),Zi=null,Zs=0,e=He;for(;e!==null;)wh(e.alternate,e),e=e.return;He=null}}function ls(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,Op(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),$l=0,Gc(),ut=e,He=n=Vn(e.current,null),qe=t,tt=0,En=null,xa=!1,es=Ft(e,t),Bc=!1,ts=Cn=Uc=si=ya=vt=0,dn=ro=null,Hc=!1,(t&8)!==0&&(t|=t&32);var l=e.entangledLanes;if(l!==0)for(e=e.entanglements,l&=t;0<l;){var i=31-jt(l),o=1<<i;t|=e[i],l&=~o}return Hl=t,$i(),n}function Qh(e,t){ke=null,O.H=to,t===Vi||t===ru?(t=od(),tt=3):t===Zr?(t=od(),tt=4):tt=t===wc?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,En=t,He===null&&(vt=1,ju(e,m(t,e.current)))}function Vh(){var e=Sn.current;return e===null?!0:(qe&4194048)===qe?Rn===null:(qe&62914560)===qe||(qe&536870912)!==0?e===Rn:!1}function Zh(){var e=O.H;return O.H=to,e===null?to:e}function Kh(){var e=O.A;return O.A=dp,e}function Lu(){vt=4,xa||(qe&4194048)!==qe&&Sn.current!==null||(es=!0),(ya&134217727)===0&&(si&134217727)===0||ut===null||wa(ut,qe,Cn,!1)}function Xc(e,t,n){var l=Pe;Pe|=2;var i=Zh(),o=Kh();(ut!==e||qe!==t)&&(Ru=null,ls(e,t)),t=!1;var h=vt;e:do try{if(tt!==0&&He!==null){var x=He,N=En;switch(tt){case 8:Gc(),h=6;break e;case 3:case 2:case 9:case 6:Sn.current===null&&(t=!0);var B=tt;if(tt=0,En=null,as(e,x,N,B),n&&es){h=0;break e}break;default:B=tt,tt=0,En=null,as(e,x,N,B)}}pp(),h=vt;break}catch(F){Qh(e,F)}while(!0);return t&&e.shellSuspendCounter++,Tl=Wa=null,Pe=l,O.H=i,O.A=o,He===null&&(ut=null,qe=0,$i()),h}function pp(){for(;He!==null;)Fh(He)}function gp(e,t){var n=Pe;Pe|=2;var l=Zh(),i=Kh();ut!==e||qe!==t?(Ru=null,zu=ft()+500,ls(e,t)):es=Ft(e,t);e:do try{if(tt!==0&&He!==null){t=He;var o=En;t:switch(tt){case 1:tt=0,En=null,as(e,t,o,1);break;case 2:case 9:if(id(o)){tt=0,En=null,Jh(t);break}t=function(){tt!==2&&tt!==9||ut!==e||(tt=7),rl(e)},o.then(t,t);break e;case 3:tt=7;break e;case 4:tt=5;break e;case 7:id(o)?(tt=0,En=null,Jh(t)):(tt=0,En=null,as(e,t,o,7));break;case 5:var h=null;switch(He.tag){case 26:h=He.memoizedState;case 5:case 27:var x=He;if(h?L0(h):x.stateNode.complete){tt=0,En=null;var N=x.sibling;if(N!==null)He=N;else{var B=x.return;B!==null?(He=B,_u(B)):He=null}break t}}tt=0,En=null,as(e,t,o,5);break;case 6:tt=0,En=null,as(e,t,o,6);break;case 8:Gc(),vt=6;break e;default:throw Error(r(462))}}xp();break}catch(F){Qh(e,F)}while(!0);return Tl=Wa=null,O.H=l,O.A=i,Pe=n,He!==null?0:(ut=null,qe=0,$i(),vt)}function xp(){for(;He!==null&&!Gl();)Fh(He)}function Fh(e){var t=vh(e.alternate,e,Hl);e.memoizedProps=e.pendingProps,t===null?_u(e):He=t}function Jh(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=hh(n,t,t.pendingProps,t.type,void 0,qe);break;case 11:t=hh(n,t,t.pendingProps,t.type.render,t.ref,qe);break;case 5:ic(t);default:wh(n,t),t=He=au(t,Hl),t=vh(n,t,Hl)}e.memoizedProps=e.pendingProps,t===null?_u(e):He=t}function as(e,t,n,l){Tl=Wa=null,ic(t),Zi=null,Zs=0;var i=t.return;try{if(ip(e,i,t,n,qe)){vt=1,ju(e,m(n,e.current)),He=null;return}}catch(o){if(i!==null)throw He=i,o;vt=1,ju(e,m(n,e.current)),He=null;return}t.flags&32768?(Ue||l===1?e=!0:es||(qe&536870912)!==0?e=!1:(xa=e=!0,(l===2||l===9||l===3||l===6)&&(l=Sn.current,l!==null&&l.tag===13&&(l.flags|=16384))),Wh(t,e)):_u(t)}function _u(e){var t=e;do{if((t.flags&32768)!==0){Wh(t,xa);return}e=t.return;var n=up(t.alternate,t,Hl);if(n!==null){He=n;return}if(t=t.sibling,t!==null){He=t;return}He=t=e}while(t!==null);vt===0&&(vt=5)}function Wh(e,t){do{var n=rp(e.alternate,e);if(n!==null){n.flags&=32767,He=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){He=e;return}He=e=n}while(e!==null);vt=6,He=null}function Ih(e,t,n,l,i,o,h,x,N){e.cancelPendingCommit=null;do Bu();while(Dt!==0);if((Pe&6)!==0)throw Error(r(327));if(t!==null){if(t===e.current)throw Error(r(177));if(o=t.lanes|t.childLanes,o|=Us,rt(e,n,o,h,x,N),e===ut&&(He=ut=null,qe=0),ns=t,ba=e,$l=n,$c=o,qc=i,qh=l,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,wp(Hn,function(){return l0(),null})):(e.callbackNode=null,e.callbackPriority=0),l=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||l){l=O.T,O.T=null,i=W.p,W.p=2,h=Pe,Pe|=4;try{cp(e,t,n)}finally{Pe=h,W.p=i,O.T=l}}Dt=1,Ph(),e0(),t0()}}function Ph(){if(Dt===1){Dt=0;var e=ba,t=ns,n=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||n){n=O.T,O.T=null;var l=W.p;W.p=2;var i=Pe;Pe|=4;try{Rh(t,e);var o=nf,h=Wo(e.containerInfo),x=o.focusedElem,N=o.selectionRange;if(h!==x&&x&&x.ownerDocument&&Jo(x.ownerDocument.documentElement,x)){if(N!==null&&Os(x)){var B=N.start,F=N.end;if(F===void 0&&(F=B),"selectionStart"in x)x.selectionStart=B,x.selectionEnd=Math.min(F,x.value.length);else{var te=x.ownerDocument||document,$=te&&te.defaultView||window;if($.getSelection){var Y=$.getSelection(),ge=x.textContent.length,Me=Math.min(N.start,ge),it=N.end===void 0?Me:Math.min(N.end,ge);!Y.extend&&Me>it&&(h=it,it=Me,Me=h);var k=_i(x,Me),A=_i(x,it);if(k&&A&&(Y.rangeCount!==1||Y.anchorNode!==k.node||Y.anchorOffset!==k.offset||Y.focusNode!==A.node||Y.focusOffset!==A.offset)){var _=te.createRange();_.setStart(k.node,k.offset),Y.removeAllRanges(),Me>it?(Y.addRange(_),Y.extend(A.node,A.offset)):(_.setEnd(A.node,A.offset),Y.addRange(_))}}}}for(te=[],Y=x;Y=Y.parentNode;)Y.nodeType===1&&te.push({element:Y,left:Y.scrollLeft,top:Y.scrollTop});for(typeof x.focus=="function"&&x.focus(),x=0;x<te.length;x++){var J=te[x];J.element.scrollLeft=J.left,J.element.scrollTop=J.top}}Fu=!!tf,nf=tf=null}finally{Pe=i,W.p=l,O.T=n}}e.current=t,Dt=2}}function e0(){if(Dt===2){Dt=0;var e=ba,t=ns,n=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||n){n=O.T,O.T=null;var l=W.p;W.p=2;var i=Pe;Pe|=4;try{Ah(e,t.alternate,t)}finally{Pe=i,W.p=l,O.T=n}}Dt=3}}function t0(){if(Dt===4||Dt===3){Dt=0,ms();var e=ba,t=ns,n=$l,l=qh;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Dt=5:(Dt=0,ns=ba=null,n0(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(va=null),Ce(n),t=t.stateNode,Rt&&typeof Rt.onCommitFiberRoot=="function")try{Rt.onCommitFiberRoot(fl,t,void 0,(t.current.flags&128)===128)}catch{}if(l!==null){t=O.T,i=W.p,W.p=2,O.T=null;try{for(var o=e.onRecoverableError,h=0;h<l.length;h++){var x=l[h];o(x.value,{componentStack:x.stack})}}finally{O.T=t,W.p=i}}($l&3)!==0&&Bu(),rl(e),i=e.pendingLanes,(n&261930)!==0&&(i&42)!==0?e===Yc?co++:(co=0,Yc=e):co=0,fo(0)}}function n0(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Qs(t)))}function Bu(){return Ph(),e0(),t0(),l0()}function l0(){if(Dt!==5)return!1;var e=ba,t=$c;$c=0;var n=Ce($l),l=O.T,i=W.p;try{W.p=32>n?32:n,O.T=null,n=qc,qc=null;var o=ba,h=$l;if(Dt=0,ns=ba=null,$l=0,(Pe&6)!==0)throw Error(r(331));var x=Pe;if(Pe|=4,Uh(o.current),Lh(o,o.current,h,n),Pe=x,fo(0,!1),Rt&&typeof Rt.onPostCommitFiberRoot=="function")try{Rt.onPostCommitFiberRoot(fl,o)}catch{}return!0}finally{W.p=i,O.T=l,n0(e,t)}}function a0(e,t,n){t=m(n,t),t=bc(e.stateNode,t,2),e=ha(e,t,2),e!==null&&(Yt(e,2),rl(e))}function nt(e,t,n){if(e.tag===3)a0(e,e,n);else for(;t!==null;){if(t.tag===3){a0(t,e,n);break}else if(t.tag===1){var l=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(va===null||!va.has(l))){e=m(n,e),n=ih(2),l=ha(t,n,2),l!==null&&(sh(n,l,t,e),Yt(l,2),rl(l));break}}t=t.return}}function Qc(e,t,n){var l=e.pingCache;if(l===null){l=e.pingCache=new hp;var i=new Set;l.set(t,i)}else i=l.get(t),i===void 0&&(i=new Set,l.set(t,i));i.has(n)||(Bc=!0,i.add(n),e=yp.bind(null,e,t,n),t.then(e,e))}function yp(e,t,n){var l=e.pingCache;l!==null&&l.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,ut===e&&(qe&n)===n&&(vt===4||vt===3&&(qe&62914560)===qe&&300>ft()-ku?(Pe&2)===0&&ls(e,0):Uc|=n,ts===qe&&(ts=0)),rl(e)}function i0(e,t){t===0&&(t=yi()),e=zn(e,t),e!==null&&(Yt(e,t),rl(e))}function vp(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),i0(e,n)}function bp(e,t){var n=0;switch(e.tag){case 31:case 13:var l=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:l=e.stateNode;break;case 22:l=e.stateNode._retryCache;break;default:throw Error(r(314))}l!==null&&l.delete(t),i0(e,n)}function wp(e,t){return mn(e,t)}var Uu=null,is=null,Vc=!1,Hu=!1,Zc=!1,Sa=0;function rl(e){e!==is&&e.next===null&&(is===null?Uu=is=e:is=is.next=e),Hu=!0,Vc||(Vc=!0,jp())}function fo(e,t){if(!Zc&&Hu){Zc=!0;do for(var n=!1,l=Uu;l!==null;){if(e!==0){var i=l.pendingLanes;if(i===0)var o=0;else{var h=l.suspendedLanes,x=l.pingedLanes;o=(1<<31-jt(42|e)+1)-1,o&=i&~(h&~x),o=o&201326741?o&201326741|1:o?o|2:0}o!==0&&(n=!0,r0(l,o))}else o=qe,o=Mn(l,l===ut?o:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(o&3)===0||Ft(l,o)||(n=!0,r0(l,o));l=l.next}while(n);Zc=!1}}function Sp(){s0()}function s0(){Hu=Vc=!1;var e=0;Sa!==0&&Rp()&&(e=Sa);for(var t=ft(),n=null,l=Uu;l!==null;){var i=l.next,o=o0(l,t);o===0?(l.next=null,n===null?Uu=i:n.next=i,i===null&&(is=n)):(n=l,(e!==0||(o&3)!==0)&&(Hu=!0)),l=i}Dt!==0&&Dt!==5||fo(e),Sa!==0&&(Sa=0)}function o0(e,t){for(var n=e.suspendedLanes,l=e.pingedLanes,i=e.expirationTimes,o=e.pendingLanes&-62914561;0<o;){var h=31-jt(o),x=1<<h,N=i[h];N===-1?((x&n)===0||(x&l)!==0)&&(i[h]=$n(x,t)):N<=t&&(e.expiredLanes|=x),o&=~x}if(t=ut,n=qe,n=Mn(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l=e.callbackNode,n===0||e===t&&(tt===2||tt===9)||e.cancelPendingCommit!==null)return l!==null&&l!==null&&Un(l),e.callbackNode=null,e.callbackPriority=0;if((n&3)===0||Ft(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(l!==null&&Un(l),Ce(n)){case 2:case 8:n=za;break;case 32:n=Hn;break;case 268435456:n=cl;break;default:n=Hn}return l=u0.bind(null,e),n=mn(n,l),e.callbackPriority=t,e.callbackNode=n,t}return l!==null&&l!==null&&Un(l),e.callbackPriority=2,e.callbackNode=null,2}function u0(e,t){if(Dt!==0&&Dt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Bu()&&e.callbackNode!==n)return null;var l=qe;return l=Mn(e,e===ut?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l===0?null:(Gh(e,l,t),o0(e,ft()),e.callbackNode!=null&&e.callbackNode===n?u0.bind(null,e):null)}function r0(e,t){if(Bu())return null;Gh(e,t,!0)}function jp(){Lp(function(){(Pe&6)!==0?mn(pn,Sp):s0()})}function Kc(){if(Sa===0){var e=Xi;e===0&&(e=dl,dl<<=1,(dl&261888)===0&&(dl=256)),Sa=e}return Sa}function c0(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:xl(""+e)}function f0(e,t){var n=t.ownerDocument.createElement("input");return n.name=t.name,n.value=t.value,e.id&&n.setAttribute("form",e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function Ep(e,t,n,l,i){if(t==="submit"&&n&&n.stateNode===i){var o=c0((i[Re]||null).action),h=l.submitter;h&&(t=(t=h[Re]||null)?c0(t.formAction):h.getAttribute("formAction"),t!==null&&(o=t,h=null));var x=new Dn("action","action",null,l,i);e.push({event:x,listeners:[{instance:null,listener:function(){if(l.defaultPrevented){if(Sa!==0){var N=h?f0(i,h):new FormData(i);mc(n,{pending:!0,data:N,method:i.method,action:o},null,N)}}else typeof o=="function"&&(x.preventDefault(),N=h?f0(i,h):new FormData(i),mc(n,{pending:!0,data:N,method:i.method,action:o},o,N))},currentTarget:i}]})}}for(var Fc=0;Fc<Bs.length;Fc++){var Jc=Bs[Fc],Cp=Jc.toLowerCase(),Np=Jc[0].toUpperCase()+Jc.slice(1);bn(Cp,"on"+Np)}bn(Po,"onAnimationEnd"),bn(_s,"onAnimationIteration"),bn(Ka,"onAnimationStart"),bn("dblclick","onDoubleClick"),bn("focusin","onFocus"),bn("focusout","onBlur"),bn(eu,"onTransitionRun"),bn(tu,"onTransitionStart"),bn(Hr,"onTransitionCancel"),bn(Cl,"onTransitionEnd"),Ot("onMouseEnter",["mouseout","mouseover"]),Ot("onMouseLeave",["mouseout","mouseover"]),Ot("onPointerEnter",["pointerout","pointerover"]),Ot("onPointerLeave",["pointerout","pointerover"]),gl("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),gl("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),gl("onBeforeInput",["compositionend","keypress","textInput","paste"]),gl("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),gl("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),gl("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ho="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(" "),Mp=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(ho));function d0(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var l=e[n],i=l.event;l=l.listeners;e:{var o=void 0;if(t)for(var h=l.length-1;0<=h;h--){var x=l[h],N=x.instance,B=x.currentTarget;if(x=x.listener,N!==o&&i.isPropagationStopped())break e;o=x,i.currentTarget=B;try{o(i)}catch(F){Hi(F)}i.currentTarget=null,o=N}else for(h=0;h<l.length;h++){if(x=l[h],N=x.instance,B=x.currentTarget,x=x.listener,N!==o&&i.isPropagationStopped())break e;o=x,i.currentTarget=B;try{o(i)}catch(F){Hi(F)}i.currentTarget=null,o=N}}}}function $e(e,t){var n=t[tl];n===void 0&&(n=t[tl]=new Set);var l=e+"__bubble";n.has(l)||(h0(t,e,2,!1),n.add(l))}function Wc(e,t,n){var l=0;t&&(l|=4),h0(n,e,l,t)}var $u="_reactListening"+Math.random().toString(36).slice(2);function Ic(e){if(!e[$u]){e[$u]=!0,ps.forEach(function(n){n!=="selectionchange"&&(Mp.has(n)||Wc(n,!1,e),Wc(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[$u]||(t[$u]=!0,Wc("selectionchange",!1,t))}}function h0(e,t,n,l){switch(Y0(t)){case 2:var i=tg;break;case 8:i=ng;break;default:i=mf}n=i.bind(null,t,n,e),i=void 0,!il||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(i=!0),l?i!==void 0?e.addEventListener(t,n,{capture:!0,passive:i}):e.addEventListener(t,n,!0):i!==void 0?e.addEventListener(t,n,{passive:i}):e.addEventListener(t,n,!1)}function Pc(e,t,n,l,i){var o=l;if((t&1)===0&&(t&2)===0&&l!==null)e:for(;;){if(l===null)return;var h=l.tag;if(h===3||h===4){var x=l.stateNode.containerInfo;if(x===i)break;if(h===4)for(h=l.return;h!==null;){var N=h.tag;if((N===3||N===4)&&h.stateNode.containerInfo===i)return;h=h.return}for(;x!==null;){if(h=Et(x),h===null)return;if(N=h.tag,N===5||N===6||N===26||N===27){l=o=h;continue e}x=x.parentNode}}l=l.return}Ss(function(){var B=o,F=gt(n),te=[];e:{var $=nu.get(e);if($!==void 0){var Y=Dn,ge=e;switch(e){case"keypress":if(Jl(n)===0)break e;case"keydown":case"keyup":Y=ta;break;case"focusin":ge="focus",Y=As;break;case"focusout":ge="blur",Y=As;break;case"beforeblur":case"afterblur":Y=As;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Y=ea;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Y=Ai;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Y=qo;break;case Po:case _s:case Ka:Y=Bo;break;case Cl:Y=Yo;break;case"scroll":case"scrollend":Y=Cs;break;case"wheel":Y=kr;break;case"copy":case"cut":case"paste":Y=Ya;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Y=Di;break;case"toggle":case"beforetoggle":Y=Rr}var Me=(t&4)!==0,it=!Me&&(e==="scroll"||e==="scrollend"),k=Me?$!==null?$+"Capture":null:$;Me=[];for(var A=B,_;A!==null;){var J=A;if(_=J.stateNode,J=J.tag,J!==5&&J!==26&&J!==27||_===null||k===null||(J=qa(A,k),J!=null&&Me.push(mo(A,J,_))),it)break;A=A.return}0<Me.length&&($=new Y($,ge,null,n,F),te.push({event:$,listeners:Me}))}}if((t&7)===0){e:{if($=e==="mouseover"||e==="pointerover",Y=e==="mouseout"||e==="pointerout",$&&n!==ji&&(ge=n.relatedTarget||n.fromElement)&&(Et(ge)||ge[ct]))break e;if((Y||$)&&($=F.window===F?F:($=F.ownerDocument)?$.defaultView||$.parentWindow:window,Y?(ge=n.relatedTarget||n.toElement,Y=B,ge=ge?Et(ge):null,ge!==null&&(it=d(ge),Me=ge.tag,ge!==it||Me!==5&&Me!==27&&Me!==6)&&(ge=null)):(Y=null,ge=B),Y!==ge)){if(Me=ea,J="onMouseLeave",k="onMouseEnter",A="mouse",(e==="pointerout"||e==="pointerover")&&(Me=Di,J="onPointerLeave",k="onPointerEnter",A="pointer"),it=Y==null?$:Ql(Y),_=ge==null?$:Ql(ge),$=new Me(J,A+"leave",Y,n,F),$.target=it,$.relatedTarget=_,J=null,Et(F)===B&&(Me=new Me(k,A+"enter",ge,n,F),Me.target=_,Me.relatedTarget=it,J=Me),it=J,Y&&ge)t:{for(Me=Ap,k=Y,A=ge,_=0,J=k;J;J=Me(J))_++;J=0;for(var we=A;we;we=Me(we))J++;for(;0<_-J;)k=Me(k),_--;for(;0<J-_;)A=Me(A),J--;for(;_--;){if(k===A||A!==null&&k===A.alternate){Me=k;break t}k=Me(k),A=Me(A)}Me=null}else Me=null;Y!==null&&m0(te,$,Y,Me,!1),ge!==null&&it!==null&&m0(te,it,ge,Me,!0)}}e:{if($=B?Ql(B):window,Y=$.nodeName&&$.nodeName.toLowerCase(),Y==="select"||Y==="input"&&$.type==="file")var Ke=Oi;else if(Vo($))if(Zo)Ke=Br;else{Ke=Rs;var be=Ko}else Y=$.nodeName,!Y||Y.toLowerCase()!=="input"||$.type!=="checkbox"&&$.type!=="radio"?B&&bs(B.elementType)&&(Ke=Oi):Ke=Li;if(Ke&&(Ke=Ke(e,B))){zi(te,Ke,n,F);break e}be&&be(e,$,B),e==="focusout"&&B&&$.type==="number"&&B.memoizedProps.value!=null&&Fl($,"number",$.value)}switch(be=B?Ql(B):window,e){case"focusin":(Vo(be)||be.contentEditable==="true")&&(sa=be,Bi=B,jl=null);break;case"focusout":jl=Bi=sa=null;break;case"mousedown":Ls=!0;break;case"contextmenu":case"mouseup":case"dragend":Ls=!1,Io(te,n,F);break;case"selectionchange":if(Ur)break;case"keydown":case"keyup":Io(te,n,F)}var ze;if(ki)e:{switch(e){case"compositionstart":var Ye="onCompositionStart";break e;case"compositionend":Ye="onCompositionEnd";break e;case"compositionupdate":Ye="onCompositionUpdate";break e}Ye=void 0}else la?ks(e,n)&&(Ye="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(Ye="onCompositionStart");Ye&&(Xo&&n.locale!=="ko"&&(la||Ye!=="onCompositionStart"?Ye==="onCompositionEnd"&&la&&(ze=Es()):(It=F,js="value"in It?It.value:It.textContent,la=!0)),be=qu(B,Ye),0<be.length&&(Ye=new Ts(Ye,e,null,n,F),te.push({event:Ye,listeners:be}),ze?Ye.data=ze:(ze=na(n),ze!==null&&(Ye.data=ze)))),(ze=Go?Gn(e,n):Lr(e,n))&&(Ye=qu(B,"onBeforeInput"),0<Ye.length&&(be=new Ts("onBeforeInput","beforeinput",null,n,F),te.push({event:be,listeners:Ye}),be.data=ze)),Ep(te,e,B,n,F)}d0(te,t)})}function mo(e,t,n){return{instance:e,listener:t,currentTarget:n}}function qu(e,t){for(var n=t+"Capture",l=[];e!==null;){var i=e,o=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||o===null||(i=qa(e,n),i!=null&&l.unshift(mo(e,i,o)),i=qa(e,t),i!=null&&l.push(mo(e,i,o))),e.tag===3)return l;e=e.return}return[]}function Ap(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function m0(e,t,n,l,i){for(var o=t._reactName,h=[];n!==null&&n!==l;){var x=n,N=x.alternate,B=x.stateNode;if(x=x.tag,N!==null&&N===l)break;x!==5&&x!==26&&x!==27||B===null||(N=B,i?(B=qa(n,o),B!=null&&h.unshift(mo(n,B,N))):i||(B=qa(n,o),B!=null&&h.push(mo(n,B,N)))),n=n.return}h.length!==0&&e.push({event:t,listeners:h})}var Tp=/\r\n?/g,Dp=/\u0000|\uFFFD/g;function p0(e){return(typeof e=="string"?e:""+e).replace(Tp,`
|
|
9
|
+
`).replace(Dp,"")}function g0(e,t){return t=p0(t),p0(e)===t}function at(e,t,n,l,i,o){switch(n){case"children":typeof l=="string"?t==="body"||t==="textarea"&&l===""||al(e,l):(typeof l=="number"||typeof l=="bigint")&&t!=="body"&&al(e,""+l);break;case"className":nl(e,"class",l);break;case"tabIndex":nl(e,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":nl(e,n,l);break;case"style":vs(e,l,o);break;case"data":if(t!=="object"){nl(e,"data",l);break}case"src":case"href":if(l===""&&(t!=="a"||n!=="href")){e.removeAttribute(n);break}if(l==null||typeof l=="function"||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(n);break}l=xl(""+l),e.setAttribute(n,l);break;case"action":case"formAction":if(typeof l=="function"){e.setAttribute(n,"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 o=="function"&&(n==="formAction"?(t!=="input"&&at(e,t,"name",i.name,i,null),at(e,t,"formEncType",i.formEncType,i,null),at(e,t,"formMethod",i.formMethod,i,null),at(e,t,"formTarget",i.formTarget,i,null)):(at(e,t,"encType",i.encType,i,null),at(e,t,"method",i.method,i,null),at(e,t,"target",i.target,i,null)));if(l==null||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(n);break}l=xl(""+l),e.setAttribute(n,l);break;case"onClick":l!=null&&(e.onclick=Wt);break;case"onScroll":l!=null&&$e("scroll",e);break;case"onScrollEnd":l!=null&&$e("scrollend",e);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(r(61));if(n=l.__html,n!=null){if(i.children!=null)throw Error(r(60));e.innerHTML=n}}break;case"multiple":e.multiple=l&&typeof l!="function"&&typeof l!="symbol";break;case"muted":e.muted=l&&typeof l!="function"&&typeof l!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(l==null||typeof l=="function"||typeof l=="boolean"||typeof l=="symbol"){e.removeAttribute("xlink:href");break}n=xl(""+l),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(n,""+l):e.removeAttribute(n);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":l&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(n,""):e.removeAttribute(n);break;case"capture":case"download":l===!0?e.setAttribute(n,""):l!==!1&&l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(n,l):e.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":l!=null&&typeof l!="function"&&typeof l!="symbol"&&!isNaN(l)&&1<=l?e.setAttribute(n,l):e.removeAttribute(n);break;case"rowSpan":case"start":l==null||typeof l=="function"||typeof l=="symbol"||isNaN(l)?e.removeAttribute(n):e.setAttribute(n,l);break;case"popover":$e("beforetoggle",e),$e("toggle",e),Kl(e,"popover",l);break;case"xlinkActuate":An(e,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":An(e,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":An(e,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":An(e,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":An(e,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":An(e,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":An(e,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":An(e,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":An(e,"http://www.w3.org/XML/1998/namespace","xml:space",l);break;case"is":Kl(e,"is",l);break;case"innerText":case"textContent":break;default:(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(n=Mr.get(n)||n,Kl(e,n,l))}}function ef(e,t,n,l,i,o){switch(n){case"style":vs(e,l,o);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(r(61));if(n=l.__html,n!=null){if(i.children!=null)throw Error(r(60));e.innerHTML=n}}break;case"children":typeof l=="string"?al(e,l):(typeof l=="number"||typeof l=="bigint")&&al(e,""+l);break;case"onScroll":l!=null&&$e("scroll",e);break;case"onScrollEnd":l!=null&&$e("scrollend",e);break;case"onClick":l!=null&&(e.onclick=Wt);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!La.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(i=n.endsWith("Capture"),t=n.slice(2,i?n.length-7:void 0),o=e[Re]||null,o=o!=null?o[n]:null,typeof o=="function"&&e.removeEventListener(t,o,i),typeof l=="function")){typeof o!="function"&&o!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,l,i);break e}n in e?e[n]=l:l===!0?e.setAttribute(n,""):Kl(e,n,l)}}}function $t(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":$e("error",e),$e("load",e);var l=!1,i=!1,o;for(o in n)if(n.hasOwnProperty(o)){var h=n[o];if(h!=null)switch(o){case"src":l=!0;break;case"srcSet":i=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,t));default:at(e,t,o,h,n,null)}}i&&at(e,t,"srcSet",n.srcSet,n,null),l&&at(e,t,"src",n.src,n,null);return;case"input":$e("invalid",e);var x=o=h=i=null,N=null,B=null;for(l in n)if(n.hasOwnProperty(l)){var F=n[l];if(F!=null)switch(l){case"name":i=F;break;case"type":h=F;break;case"checked":N=F;break;case"defaultChecked":B=F;break;case"value":o=F;break;case"defaultValue":x=F;break;case"children":case"dangerouslySetInnerHTML":if(F!=null)throw Error(r(137,t));break;default:at(e,t,l,F,n,null)}}ll(e,o,x,N,B,h,i,!1);return;case"select":$e("invalid",e),l=h=o=null;for(i in n)if(n.hasOwnProperty(i)&&(x=n[i],x!=null))switch(i){case"value":o=x;break;case"defaultValue":h=x;break;case"multiple":l=x;default:at(e,t,i,x,n,null)}t=o,n=h,e.multiple=!!l,t!=null?xn(e,!!l,t,!1):n!=null&&xn(e,!!l,n,!0);return;case"textarea":$e("invalid",e),o=i=l=null;for(h in n)if(n.hasOwnProperty(h)&&(x=n[h],x!=null))switch(h){case"value":l=x;break;case"defaultValue":i=x;break;case"children":o=x;break;case"dangerouslySetInnerHTML":if(x!=null)throw Error(r(91));break;default:at(e,t,h,x,n,null)}wi(e,l,i,o);return;case"option":for(N in n)n.hasOwnProperty(N)&&(l=n[N],l!=null)&&(N==="selected"?e.selected=l&&typeof l!="function"&&typeof l!="symbol":at(e,t,N,l,n,null));return;case"dialog":$e("beforetoggle",e),$e("toggle",e),$e("cancel",e),$e("close",e);break;case"iframe":case"object":$e("load",e);break;case"video":case"audio":for(l=0;l<ho.length;l++)$e(ho[l],e);break;case"image":$e("error",e),$e("load",e);break;case"details":$e("toggle",e);break;case"embed":case"source":case"link":$e("error",e),$e("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(B in n)if(n.hasOwnProperty(B)&&(l=n[B],l!=null))switch(B){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,t));default:at(e,t,B,l,n,null)}return;default:if(bs(t)){for(F in n)n.hasOwnProperty(F)&&(l=n[F],l!==void 0&&ef(e,t,F,l,n,void 0));return}}for(x in n)n.hasOwnProperty(x)&&(l=n[x],l!=null&&at(e,t,x,l,n,null))}function kp(e,t,n,l){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var i=null,o=null,h=null,x=null,N=null,B=null,F=null;for(Y in n){var te=n[Y];if(n.hasOwnProperty(Y)&&te!=null)switch(Y){case"checked":break;case"value":break;case"defaultValue":N=te;default:l.hasOwnProperty(Y)||at(e,t,Y,null,l,te)}}for(var $ in l){var Y=l[$];if(te=n[$],l.hasOwnProperty($)&&(Y!=null||te!=null))switch($){case"type":o=Y;break;case"name":i=Y;break;case"checked":B=Y;break;case"defaultChecked":F=Y;break;case"value":h=Y;break;case"defaultValue":x=Y;break;case"children":case"dangerouslySetInnerHTML":if(Y!=null)throw Error(r(137,t));break;default:Y!==te&&at(e,t,$,Y,l,te)}}Ua(e,h,x,N,B,F,o,i);return;case"select":Y=h=x=$=null;for(o in n)if(N=n[o],n.hasOwnProperty(o)&&N!=null)switch(o){case"value":break;case"multiple":Y=N;default:l.hasOwnProperty(o)||at(e,t,o,null,l,N)}for(i in l)if(o=l[i],N=n[i],l.hasOwnProperty(i)&&(o!=null||N!=null))switch(i){case"value":$=o;break;case"defaultValue":x=o;break;case"multiple":h=o;default:o!==N&&at(e,t,i,o,l,N)}t=x,n=h,l=Y,$!=null?xn(e,!!n,$,!1):!!l!=!!n&&(t!=null?xn(e,!!n,t,!0):xn(e,!!n,n?[]:"",!1));return;case"textarea":Y=$=null;for(x in n)if(i=n[x],n.hasOwnProperty(x)&&i!=null&&!l.hasOwnProperty(x))switch(x){case"value":break;case"children":break;default:at(e,t,x,null,l,i)}for(h in l)if(i=l[h],o=n[h],l.hasOwnProperty(h)&&(i!=null||o!=null))switch(h){case"value":$=i;break;case"defaultValue":Y=i;break;case"children":break;case"dangerouslySetInnerHTML":if(i!=null)throw Error(r(91));break;default:i!==o&&at(e,t,h,i,l,o)}bi(e,$,Y);return;case"option":for(var ge in n)$=n[ge],n.hasOwnProperty(ge)&&$!=null&&!l.hasOwnProperty(ge)&&(ge==="selected"?e.selected=!1:at(e,t,ge,null,l,$));for(N in l)$=l[N],Y=n[N],l.hasOwnProperty(N)&&$!==Y&&($!=null||Y!=null)&&(N==="selected"?e.selected=$&&typeof $!="function"&&typeof $!="symbol":at(e,t,N,$,l,Y));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 Me in n)$=n[Me],n.hasOwnProperty(Me)&&$!=null&&!l.hasOwnProperty(Me)&&at(e,t,Me,null,l,$);for(B in l)if($=l[B],Y=n[B],l.hasOwnProperty(B)&&$!==Y&&($!=null||Y!=null))switch(B){case"children":case"dangerouslySetInnerHTML":if($!=null)throw Error(r(137,t));break;default:at(e,t,B,$,l,Y)}return;default:if(bs(t)){for(var it in n)$=n[it],n.hasOwnProperty(it)&&$!==void 0&&!l.hasOwnProperty(it)&&ef(e,t,it,void 0,l,$);for(F in l)$=l[F],Y=n[F],!l.hasOwnProperty(F)||$===Y||$===void 0&&Y===void 0||ef(e,t,F,$,l,Y);return}}for(var k in n)$=n[k],n.hasOwnProperty(k)&&$!=null&&!l.hasOwnProperty(k)&&at(e,t,k,null,l,$);for(te in l)$=l[te],Y=n[te],!l.hasOwnProperty(te)||$===Y||$==null&&Y==null||at(e,t,te,$,l,Y)}function x0(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function zp(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,n=performance.getEntriesByType("resource"),l=0;l<n.length;l++){var i=n[l],o=i.transferSize,h=i.initiatorType,x=i.duration;if(o&&x&&x0(h)){for(h=0,x=i.responseEnd,l+=1;l<n.length;l++){var N=n[l],B=N.startTime;if(B>x)break;var F=N.transferSize,te=N.initiatorType;F&&x0(te)&&(N=N.responseEnd,h+=F*(N<x?1:(x-B)/(N-B)))}if(--l,t+=8*(o+h)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var tf=null,nf=null;function Yu(e){return e.nodeType===9?e:e.ownerDocument}function y0(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 v0(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function lf(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var af=null;function Rp(){var e=window.event;return e&&e.type==="popstate"?e===af?!1:(af=e,!0):(af=null,!1)}var b0=typeof setTimeout=="function"?setTimeout:void 0,Op=typeof clearTimeout=="function"?clearTimeout:void 0,w0=typeof Promise=="function"?Promise:void 0,Lp=typeof queueMicrotask=="function"?queueMicrotask:typeof w0<"u"?function(e){return w0.resolve(null).then(e).catch(_p)}:b0;function _p(e){setTimeout(function(){throw e})}function ja(e){return e==="head"}function S0(e,t){var n=t,l=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n==="/$"||n==="/&"){if(l===0){e.removeChild(i),rs(t);return}l--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")l++;else if(n==="html")po(e.ownerDocument.documentElement);else if(n==="head"){n=e.ownerDocument.head,po(n);for(var o=n.firstChild;o;){var h=o.nextSibling,x=o.nodeName;o[Xl]||x==="SCRIPT"||x==="STYLE"||x==="LINK"&&o.rel.toLowerCase()==="stylesheet"||n.removeChild(o),o=h}}else n==="body"&&po(e.ownerDocument.body);n=i}while(n);rs(t)}function j0(e,t){var n=e;e=0;do{var l=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display="none"):(n.style.display=n._stashedDisplay||"",n.getAttribute("style")===""&&n.removeAttribute("style")):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=""):n.nodeValue=n._stashedText||""),l&&l.nodeType===8)if(n=l.data,n==="/$"){if(e===0)break;e--}else n!=="$"&&n!=="$?"&&n!=="$~"&&n!=="$!"||e++;n=l}while(n)}function sf(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":sf(n),Oa(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function Bp(e,t,n,l){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!l&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(l){if(!e[Xl])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(o=e.getAttribute("rel"),o==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(o!==i.rel||e.getAttribute("href")!==(i.href==null||i.href===""?null:i.href)||e.getAttribute("crossorigin")!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute("title")!==(i.title==null?null:i.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(o=e.getAttribute("src"),(o!==(i.src==null?null:i.src)||e.getAttribute("type")!==(i.type==null?null:i.type)||e.getAttribute("crossorigin")!==(i.crossOrigin==null?null:i.crossOrigin))&&o&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var o=i.name==null?null:""+i.name;if(i.type==="hidden"&&e.getAttribute("name")===o)return e}else return e;if(e=On(e.nextSibling),e===null)break}return null}function Up(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=On(e.nextSibling),e===null))return null;return e}function E0(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=On(e.nextSibling),e===null))return null;return e}function of(e){return e.data==="$?"||e.data==="$~"}function uf(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function Hp(e,t){var n=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||n.readyState!=="loading")t();else{var l=function(){t(),n.removeEventListener("DOMContentLoaded",l)};n.addEventListener("DOMContentLoaded",l),e._reactRetry=l}}function On(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var rf=null;function C0(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"||n==="/&"){if(t===0)return On(e.nextSibling);t--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||t++}e=e.nextSibling}return null}function N0(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"){if(t===0)return e;t--}else n!=="/$"&&n!=="/&"||t++}e=e.previousSibling}return null}function M0(e,t,n){switch(t=Yu(n),e){case"html":if(e=t.documentElement,!e)throw Error(r(452));return e;case"head":if(e=t.head,!e)throw Error(r(453));return e;case"body":if(e=t.body,!e)throw Error(r(454));return e;default:throw Error(r(451))}}function po(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Oa(e)}var Ln=new Map,A0=new Set;function Gu(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var ql=W.d;W.d={f:$p,r:qp,D:Yp,C:Gp,L:Xp,m:Qp,X:Zp,S:Vp,M:Kp};function $p(){var e=ql.f(),t=Ou();return e||t}function qp(e){var t=qn(e);t!==null&&t.tag===5&&t.type==="form"?Qd(t):ql.r(e)}var ss=typeof document>"u"?null:document;function T0(e,t,n){var l=ss;if(l&&typeof t=="string"&&t){var i=Jt(t);i='link[rel="'+e+'"][href="'+i+'"]',typeof n=="string"&&(i+='[crossorigin="'+n+'"]'),A0.has(i)||(A0.add(i),e={rel:e,crossOrigin:n,href:t},l.querySelector(i)===null&&(t=l.createElement("link"),$t(t,"link",e),bt(t),l.head.appendChild(t)))}}function Yp(e){ql.D(e),T0("dns-prefetch",e,null)}function Gp(e,t){ql.C(e,t),T0("preconnect",e,t)}function Xp(e,t,n){ql.L(e,t,n);var l=ss;if(l&&e&&t){var i='link[rel="preload"][as="'+Jt(t)+'"]';t==="image"&&n&&n.imageSrcSet?(i+='[imagesrcset="'+Jt(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(i+='[imagesizes="'+Jt(n.imageSizes)+'"]')):i+='[href="'+Jt(e)+'"]';var o=i;switch(t){case"style":o=os(e);break;case"script":o=us(e)}Ln.has(o)||(e=C({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),Ln.set(o,e),l.querySelector(i)!==null||t==="style"&&l.querySelector(go(o))||t==="script"&&l.querySelector(xo(o))||(t=l.createElement("link"),$t(t,"link",e),bt(t),l.head.appendChild(t)))}}function Qp(e,t){ql.m(e,t);var n=ss;if(n&&e){var l=t&&typeof t.as=="string"?t.as:"script",i='link[rel="modulepreload"][as="'+Jt(l)+'"][href="'+Jt(e)+'"]',o=i;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":o=us(e)}if(!Ln.has(o)&&(e=C({rel:"modulepreload",href:e},t),Ln.set(o,e),n.querySelector(i)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(xo(o)))return}l=n.createElement("link"),$t(l,"link",e),bt(l),n.head.appendChild(l)}}}function Vp(e,t,n){ql.S(e,t,n);var l=ss;if(l&&e){var i=Vl(l).hoistableStyles,o=os(e);t=t||"default";var h=i.get(o);if(!h){var x={loading:0,preload:null};if(h=l.querySelector(go(o)))x.loading=5;else{e=C({rel:"stylesheet",href:e,"data-precedence":t},n),(n=Ln.get(o))&&cf(e,n);var N=h=l.createElement("link");bt(N),$t(N,"link",e),N._p=new Promise(function(B,F){N.onload=B,N.onerror=F}),N.addEventListener("load",function(){x.loading|=1}),N.addEventListener("error",function(){x.loading|=2}),x.loading|=4,Xu(h,t,l)}h={type:"stylesheet",instance:h,count:1,state:x},i.set(o,h)}}}function Zp(e,t){ql.X(e,t);var n=ss;if(n&&e){var l=Vl(n).hoistableScripts,i=us(e),o=l.get(i);o||(o=n.querySelector(xo(i)),o||(e=C({src:e,async:!0},t),(t=Ln.get(i))&&ff(e,t),o=n.createElement("script"),bt(o),$t(o,"link",e),n.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},l.set(i,o))}}function Kp(e,t){ql.M(e,t);var n=ss;if(n&&e){var l=Vl(n).hoistableScripts,i=us(e),o=l.get(i);o||(o=n.querySelector(xo(i)),o||(e=C({src:e,async:!0,type:"module"},t),(t=Ln.get(i))&&ff(e,t),o=n.createElement("script"),bt(o),$t(o,"link",e),n.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},l.set(i,o))}}function D0(e,t,n,l){var i=(i=Ee.current)?Gu(i):null;if(!i)throw Error(r(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(t=os(n.href),n=Vl(i).hoistableStyles,l=n.get(t),l||(l={type:"style",instance:null,count:0,state:null},n.set(t,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=os(n.href);var o=Vl(i).hoistableStyles,h=o.get(e);if(h||(i=i.ownerDocument||i,h={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},o.set(e,h),(o=i.querySelector(go(e)))&&!o._p&&(h.instance=o,h.state.loading=5),Ln.has(e)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Ln.set(e,n),o||Fp(i,e,n,h.state))),t&&l===null)throw Error(r(528,""));return h}if(t&&l!==null)throw Error(r(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=us(n),n=Vl(i).hoistableScripts,l=n.get(t),l||(l={type:"script",instance:null,count:0,state:null},n.set(t,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,e))}}function os(e){return'href="'+Jt(e)+'"'}function go(e){return'link[rel="stylesheet"]['+e+"]"}function k0(e){return C({},e,{"data-precedence":e.precedence,precedence:null})}function Fp(e,t,n,l){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?l.loading=1:(t=e.createElement("link"),l.preload=t,t.addEventListener("load",function(){return l.loading|=1}),t.addEventListener("error",function(){return l.loading|=2}),$t(t,"link",n),bt(t),e.head.appendChild(t))}function us(e){return'[src="'+Jt(e)+'"]'}function xo(e){return"script[async]"+e}function z0(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var l=e.querySelector('style[data-href~="'+Jt(n.href)+'"]');if(l)return t.instance=l,bt(l),l;var i=C({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return l=(e.ownerDocument||e).createElement("style"),bt(l),$t(l,"style",i),Xu(l,n.precedence,e),t.instance=l;case"stylesheet":i=os(n.href);var o=e.querySelector(go(i));if(o)return t.state.loading|=4,t.instance=o,bt(o),o;l=k0(n),(i=Ln.get(i))&&cf(l,i),o=(e.ownerDocument||e).createElement("link"),bt(o);var h=o;return h._p=new Promise(function(x,N){h.onload=x,h.onerror=N}),$t(o,"link",l),t.state.loading|=4,Xu(o,n.precedence,e),t.instance=o;case"script":return o=us(n.src),(i=e.querySelector(xo(o)))?(t.instance=i,bt(i),i):(l=n,(i=Ln.get(o))&&(l=C({},n),ff(l,i)),e=e.ownerDocument||e,i=e.createElement("script"),bt(i),$t(i,"link",l),e.head.appendChild(i),t.instance=i);case"void":return null;default:throw Error(r(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(l=t.instance,t.state.loading|=4,Xu(l,n.precedence,e));return t.instance}function Xu(e,t,n){for(var l=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),i=l.length?l[l.length-1]:null,o=i,h=0;h<l.length;h++){var x=l[h];if(x.dataset.precedence===t)o=x;else if(o!==i)break}o?o.parentNode.insertBefore(e,o.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function cf(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function ff(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Qu=null;function R0(e,t,n){if(Qu===null){var l=new Map,i=Qu=new Map;i.set(n,l)}else i=Qu,l=i.get(n),l||(l=new Map,i.set(n,l));if(l.has(e))return l;for(l.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var o=n[i];if(!(o[Xl]||o[Ie]||e==="link"&&o.getAttribute("rel")==="stylesheet")&&o.namespaceURI!=="http://www.w3.org/2000/svg"){var h=o.getAttribute(t)||"";h=e+h;var x=l.get(h);x?x.push(o):l.set(h,[o])}}return l}function O0(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function Jp(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;return t.rel==="stylesheet"?(e=t.disabled,typeof t.precedence=="string"&&e==null):!0;case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function L0(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function Wp(e,t,n,l){if(n.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var i=os(l.href),o=t.querySelector(go(i));if(o){t=o._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Vu.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=o,bt(o);return}o=t.ownerDocument||t,l=k0(l),(i=Ln.get(i))&&cf(l,i),o=o.createElement("link"),bt(o);var h=o;h._p=new Promise(function(x,N){h.onload=x,h.onerror=N}),$t(o,"link",l),n.instance=o}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&(n.state.loading&3)===0&&(e.count++,n=Vu.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var df=0;function Ip(e,t){return e.stylesheets&&e.count===0&&Ku(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var l=setTimeout(function(){if(e.stylesheets&&Ku(e,e.stylesheets),e.unsuspend){var o=e.unsuspend;e.unsuspend=null,o()}},6e4+t);0<e.imgBytes&&df===0&&(df=62500*zp());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Ku(e,e.stylesheets),e.unsuspend)){var o=e.unsuspend;e.unsuspend=null,o()}},(e.imgBytes>df?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(l),clearTimeout(i)}}:null}function Vu(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Ku(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Zu=null;function Ku(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Zu=new Map,t.forEach(Pp,e),Zu=null,Vu.call(e))}function Pp(e,t){if(!(t.state.loading&4)){var n=Zu.get(e);if(n)var l=n.get(null);else{n=new Map,Zu.set(e,n);for(var i=e.querySelectorAll("link[data-precedence],style[data-precedence]"),o=0;o<i.length;o++){var h=i[o];(h.nodeName==="LINK"||h.getAttribute("media")!=="not all")&&(n.set(h.dataset.precedence,h),l=h)}l&&n.set(null,l)}i=t.instance,h=i.getAttribute("data-precedence"),o=n.get(h)||l,o===l&&n.set(null,i),n.set(h,i),this.count++,l=Vu.bind(this),i.addEventListener("load",l),i.addEventListener("error",l),o?o.parentNode.insertBefore(i,o.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var yo={$$typeof:Q,Provider:null,Consumer:null,_currentValue:ue,_currentValue2:ue,_threadCount:0};function eg(e,t,n,l,i,o,h,x,N){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=Pn(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Pn(0),this.hiddenUpdates=Pn(null),this.identifierPrefix=l,this.onUncaughtError=i,this.onCaughtError=o,this.onRecoverableError=h,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=N,this.incompleteTransitions=new Map}function _0(e,t,n,l,i,o,h,x,N,B,F,te){return e=new eg(e,t,n,h,N,B,F,te,x),t=1,o===!0&&(t|=24),o=Pt(3,null,null,t),e.current=o,o.stateNode=e,t=Xr(),t.refCount++,e.pooledCache=t,t.refCount++,o.memoizedState={element:l,isDehydrated:n,cache:t},Kr(o),e}function B0(e){return e?(e=Ml,e):Ml}function U0(e,t,n,l,i,o){i=B0(i),l.context===null?l.context=i:l.pendingContext=i,l=da(t),l.payload={element:n},o=o===void 0?null:o,o!==null&&(l.callback=o),n=ha(e,l,t),n!==null&&(hn(n,e,t),Fs(n,e,t))}function H0(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function hf(e,t){H0(e,t),(e=e.alternate)&&H0(e,t)}function $0(e){if(e.tag===13||e.tag===31){var t=zn(e,67108864);t!==null&&hn(t,e,67108864),hf(e,67108864)}}function q0(e){if(e.tag===13||e.tag===31){var t=Nn();t=de(t);var n=zn(e,t);n!==null&&hn(n,e,t),hf(e,t)}}var Fu=!0;function tg(e,t,n,l){var i=O.T;O.T=null;var o=W.p;try{W.p=2,mf(e,t,n,l)}finally{W.p=o,O.T=i}}function ng(e,t,n,l){var i=O.T;O.T=null;var o=W.p;try{W.p=8,mf(e,t,n,l)}finally{W.p=o,O.T=i}}function mf(e,t,n,l){if(Fu){var i=pf(l);if(i===null)Pc(e,t,l,Ju,n),G0(e,l);else if(ag(i,e,t,n,l))l.stopPropagation();else if(G0(e,l),t&4&&-1<lg.indexOf(e)){for(;i!==null;){var o=qn(i);if(o!==null)switch(o.tag){case 3:if(o=o.stateNode,o.current.memoizedState.isDehydrated){var h=Kt(o.pendingLanes);if(h!==0){var x=o;for(x.pendingLanes|=2,x.entangledLanes|=2;h;){var N=1<<31-jt(h);x.entanglements[1]|=N,h&=~N}rl(o),(Pe&6)===0&&(zu=ft()+500,fo(0))}}break;case 31:case 13:x=zn(o,2),x!==null&&hn(x,o,2),Ou(),hf(o,2)}if(o=pf(l),o===null&&Pc(e,t,l,Ju,n),o===i)break;i=o}i!==null&&l.stopPropagation()}else Pc(e,t,l,null,n)}}function pf(e){return e=gt(e),gf(e)}var Ju=null;function gf(e){if(Ju=null,e=Et(e),e!==null){var t=d(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=p(t),e!==null)return e;e=null}else if(n===31){if(e=y(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Ju=e,null}function Y0(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(In()){case pn:return 2;case za:return 8;case Hn:case mt:return 32;case cl:return 268435456;default:return 32}default:return 32}}var xf=!1,Ea=null,Ca=null,Na=null,vo=new Map,bo=new Map,Ma=[],lg="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 G0(e,t){switch(e){case"focusin":case"focusout":Ea=null;break;case"dragenter":case"dragleave":Ca=null;break;case"mouseover":case"mouseout":Na=null;break;case"pointerover":case"pointerout":vo.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":bo.delete(t.pointerId)}}function wo(e,t,n,l,i,o){return e===null||e.nativeEvent!==o?(e={blockedOn:t,domEventName:n,eventSystemFlags:l,nativeEvent:o,targetContainers:[i]},t!==null&&(t=qn(t),t!==null&&$0(t)),e):(e.eventSystemFlags|=l,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function ag(e,t,n,l,i){switch(t){case"focusin":return Ea=wo(Ea,e,t,n,l,i),!0;case"dragenter":return Ca=wo(Ca,e,t,n,l,i),!0;case"mouseover":return Na=wo(Na,e,t,n,l,i),!0;case"pointerover":var o=i.pointerId;return vo.set(o,wo(vo.get(o)||null,e,t,n,l,i)),!0;case"gotpointercapture":return o=i.pointerId,bo.set(o,wo(bo.get(o)||null,e,t,n,l,i)),!0}return!1}function X0(e){var t=Et(e.target);if(t!==null){var n=d(t);if(n!==null){if(t=n.tag,t===13){if(t=p(n),t!==null){e.blockedOn=t,ve(e.priority,function(){q0(n)});return}}else if(t===31){if(t=y(n),t!==null){e.blockedOn=t,ve(e.priority,function(){q0(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Wu(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=pf(e.nativeEvent);if(n===null){n=e.nativeEvent;var l=new n.constructor(n.type,n);ji=l,n.target.dispatchEvent(l),ji=null}else return t=qn(n),t!==null&&$0(t),e.blockedOn=n,!1;t.shift()}return!0}function Q0(e,t,n){Wu(e)&&n.delete(t)}function ig(){xf=!1,Ea!==null&&Wu(Ea)&&(Ea=null),Ca!==null&&Wu(Ca)&&(Ca=null),Na!==null&&Wu(Na)&&(Na=null),vo.forEach(Q0),bo.forEach(Q0)}function Iu(e,t){e.blockedOn===t&&(e.blockedOn=null,xf||(xf=!0,a.unstable_scheduleCallback(a.unstable_NormalPriority,ig)))}var Pu=null;function V0(e){Pu!==e&&(Pu=e,a.unstable_scheduleCallback(a.unstable_NormalPriority,function(){Pu===e&&(Pu=null);for(var t=0;t<e.length;t+=3){var n=e[t],l=e[t+1],i=e[t+2];if(typeof l!="function"){if(gf(l||n)===null)continue;break}var o=qn(n);o!==null&&(e.splice(t,3),t-=3,mc(o,{pending:!0,data:i,method:n.method,action:l},l,i))}}))}function rs(e){function t(N){return Iu(N,e)}Ea!==null&&Iu(Ea,e),Ca!==null&&Iu(Ca,e),Na!==null&&Iu(Na,e),vo.forEach(t),bo.forEach(t);for(var n=0;n<Ma.length;n++){var l=Ma[n];l.blockedOn===e&&(l.blockedOn=null)}for(;0<Ma.length&&(n=Ma[0],n.blockedOn===null);)X0(n),n.blockedOn===null&&Ma.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(l=0;l<n.length;l+=3){var i=n[l],o=n[l+1],h=i[Re]||null;if(typeof o=="function")h||V0(n);else if(h){var x=null;if(o&&o.hasAttribute("formAction")){if(i=o,h=o[Re]||null)x=h.formAction;else if(gf(i)!==null)continue}else x=h.action;typeof x=="function"?n[l+1]=x:(n.splice(l,3),l-=3),V0(n)}}}function Z0(){function e(o){o.canIntercept&&o.info==="react-transition"&&o.intercept({handler:function(){return new Promise(function(h){return i=h})},focusReset:"manual",scroll:"manual"})}function t(){i!==null&&(i(),i=null),l||setTimeout(n,20)}function n(){if(!l&&!navigation.transition){var o=navigation.currentEntry;o&&o.url!=null&&navigation.navigate(o.url,{state:o.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var l=!1,i=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(n,100),function(){l=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),i!==null&&(i(),i=null)}}}function yf(e){this._internalRoot=e}er.prototype.render=yf.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(r(409));var n=t.current,l=Nn();U0(n,l,e,t,null,null)},er.prototype.unmount=yf.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;U0(e.current,2,null,e,null,null),Ou(),t[ct]=null}};function er(e){this._internalRoot=e}er.prototype.unstable_scheduleHydration=function(e){if(e){var t=Oe();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Ma.length&&t!==0&&t<Ma[n].priority;n++);Ma.splice(n,0,e),n===0&&X0(e)}};var K0=s.version;if(K0!=="19.2.8")throw Error(r(527,K0,"19.2.8"));W.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(r(188)):(e=Object.keys(e).join(","),Error(r(268,e)));return e=g(t),e=e!==null?S(e):null,e=e===null?null:e.stateNode,e};var sg={bundleType:0,version:"19.2.8",rendererPackageName:"react-dom",currentDispatcherRef:O,reconcilerVersion:"19.2.8"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var tr=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!tr.isDisabled&&tr.supportsFiber)try{fl=tr.inject(sg),Rt=tr}catch{}}return jo.createRoot=function(e,t){if(!f(e))throw Error(r(299));var n=!1,l="",i=th,o=nh,h=lh;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(l=t.identifierPrefix),t.onUncaughtError!==void 0&&(i=t.onUncaughtError),t.onCaughtError!==void 0&&(o=t.onCaughtError),t.onRecoverableError!==void 0&&(h=t.onRecoverableError)),t=_0(e,1,!1,null,null,n,l,null,i,o,h,Z0),e[ct]=t.current,Ic(e),new yf(t)},jo.hydrateRoot=function(e,t,n){if(!f(e))throw Error(r(299));var l=!1,i="",o=th,h=nh,x=lh,N=null;return n!=null&&(n.unstable_strictMode===!0&&(l=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onUncaughtError!==void 0&&(o=n.onUncaughtError),n.onCaughtError!==void 0&&(h=n.onCaughtError),n.onRecoverableError!==void 0&&(x=n.onRecoverableError),n.formState!==void 0&&(N=n.formState)),t=_0(e,1,!0,t,n??null,l,i,N,o,h,x,Z0),t.context=B0(null),n=t.current,l=Nn(),l=de(l),i=da(l),i.callback=null,ha(n,i,l),n=l,t.current.lanes=n,Yt(t,n),rl(t),e[ct]=t.current,Ic(e),new er(t)},jo.version="19.2.8",jo}var a1;function pg(){if(a1)return wf.exports;a1=1;function a(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(a)}catch(s){console.error(s)}}return a(),wf.exports=mg(),wf.exports}var gg=pg(),sm=im();function Cf(a,s,c){return a+(s-a)*c}function om(a){return a-Math.floor(a)}function Nf(a,s){const c=Math.floor(a),r=Math.floor(s);let f=a-c,d=s-r;f=f*f*(3-2*f),d=d*d*(3-2*d);const p=Bn(c,r),y=Bn(c+1,r),v=Bn(c,r+1),g=Bn(c+1,r+1);return p+(y-p)*f+(v-p)*d+(p-y-v+g)*f*d}function Bn(a,s){const c=Math.sin(a*12.9898+s*78.233)*43758.5453;return c-Math.floor(c)}function Qf(a,s){const c=Math.PI*(3-Math.sqrt(5)),r=1-2*(a+.5)/s,f=Math.sqrt(1-r*r),d=a*c;return[f*Math.cos(d),r,f*Math.sin(d)]}function xg(a,s){return Math.atan2(Math.sin(a-s),Math.cos(a-s))}function fi(a,s,c,r,f){const d=Math.sin(s),p=Math.cos(s),y=Math.sin(a),v=Math.cos(a);return(g,S,C)=>{const T=g*v+C*y,D=-g*y+C*v,M=S*p-D*d,U=S*d+D*p;return[c+T*f,r-M*f,U]}}function Da(a,s,c,r=.3){s.sort((f,d)=>f.z-d.z);for(const f of s){const d=f.a??1;if(d<.02)continue;const p=Math.min(1,Math.max(0,f.white)),y=Math.round((c?1-p:p)*255);a.fillStyle=`rgba(${y},${y},${y},${d})`,a.beginPath(),a.arc(f.x,f.y,Math.max(r,f.r),0,Math.PI*2),a.fill()}}function yg(a,s,c){for(const r of s){const f=r.a??1;if(f<.02)continue;const d=Math.min(1,Math.max(0,r.white)),p=Math.round((c?1-d:d)*255);a.strokeStyle=`rgba(${p},${p},${p},${f})`,a.lineWidth=r.w,a.beginPath(),a.moveTo(r.x1,r.y1),a.lineTo(r.x2,r.y2),a.stroke()}}function di(a,s){return(a/300)**s}const vg=(a,s,c,r,f)=>{const d=s/2,p=s/2,y=s/2*.76,v=fi(c*.4,.3,d,p,1),g=di(s,f.rsPow??.6),S=[],C=f.ghostN??150;for(let M=0;M<C;M++){const U=Qf(M,C),[H,R,K]=v(U[0]*y,U[1]*y,U[2]*y),Q=(K/y+1)/2;S.push({x:H,y:R,z:K,r:.8*g,white:.78,a:.1+.22*Q})}const T=f.strandN??52,D=f.turns??3;for(let M=0;M<3;M++){const U=M/3*2*Math.PI;for(let H=0;H<T;H++){const R=(om(H/T+c*.045)*2-1)*.96,K=Math.sqrt(Math.max(0,1-R*R)),Q=Math.min(1,(1-Math.abs(R))/.1),X=R*Math.PI*D+U,ae=1+.075*Math.sin(R*Math.PI*D*2+U*2+c*.8),ne=K*y*ae,[I,b,ie]=v(Math.cos(X)*ne,R*y*ae,Math.sin(X)*ne),P=(ie/y+1)/2;S.push({x:I,y:b,z:ie,r:((f.rBase??1.2)+(f.rDepth??1.8)*P)*g,white:.55-.45*P,a:Q*(.45+.55*P)})}}Da(a,S,r,f.rMin)};function bg(a,s,c,r){const f=2*s*c+r,d=a%f,p=new Array(s).fill(0);let y=-1;if(d<2*s*c){const v=Math.floor(d/c),g=(d-v*c)/c,S=1-(1-Math.min(1,g/.7))**3;if(v<s){for(let C=0;C<v;C++)p[C]=1;p[v]=S,y=v}else{const C=2*s-1-v;for(let T=0;T<C;T++)p[T]=1;p[C]=1-S,y=C}}return{amount:p,active:y}}function wg(a,s,c){let[r,f,d]=a,p=!1;for(let y=0;y<s.length;y++){if(c.amount[y]<=0)continue;const v=s[y],g=v.axis===0?r:v.axis===1?f:d;if(g<v.lo||g>=v.hi)continue;y===c.active&&(p=!0);const S=v.ang*c.amount[y],C=Math.cos(S),T=Math.sin(S);if(v.axis===0){const D=f*C-d*T;d=f*T+d*C,f=D}else if(v.axis===1){const D=r*C+d*T;d=-r*T+d*C,r=D}else{const D=r*C-f*T;f=r*T+f*C,r=D}}return[r,f,d,p]}function Sg(a){const s=[];for(let c=0;c<a;c++){const r=Math.min(2,Math.floor(Bn(c,2.3)*3)),f=-1+.5*Math.min(3,Math.floor(Bn(c,5.9)*4)),d=Bn(c,7.7)<.5?1:-1;s.push({axis:r,lo:f,hi:f+.5,ang:d*Math.PI/2})}return s}const jg=(a,s,c,r,f)=>{const d=s/2,p=s/2,y=s/2*.82,v=.4+.06*Math.sin(c*.35),g=fi(c*.5,v,d,p,y),S=c*(.5+(1.7-.5)*(f.scanMul??1)),C=di(s,f.rsPow??.6),T=f.dimBase??1,D=[],M=f.latRings??17,U=f.lonDensity??44;for(let H=0;H<=M;H++){const R=-Math.PI/2+H/M*Math.PI,K=Math.cos(R),Q=Math.sin(R),X=Math.max(1,Math.round(Math.abs(K)*U));for(let ae=0;ae<X;ae++){const ne=ae/X*2*Math.PI,[I,b,ie]=g(K*Math.cos(ne),Q,K*Math.sin(ne)),P=(ie+1)/2,ye=xg(ne+c*.5,S),fe=Math.exp(-(ye*ye)/.18)*Math.max(0,ie);D.push({x:I,y:b,z:ie,r:((f.rBase??.6)+(f.rDepth??1.7)*P+(f.rBoost??1)*fe)*C,white:(f.inkFar??.62)-(f.inkSpan??.54)*P,a:T+(1-T)*Math.min(1,fe)})}}Da(a,D,r,f.rMin)},Eg=(a,s,c,r,f)=>{const d=s/2,p=s/2,y=s/2*.82,v=fi(c*.55,.35+.1*Math.sin(c*.9),d,p,y),g=di(s,f.rsPow??.6),S=f.moveCount??14,C=Sg(S),T=bg(c,S,.42,1.2),D=[],M=f.latRings??15,U=f.lonDensity??40;for(let H=0;H<=M;H++){const R=-Math.PI/2+H/M*Math.PI,K=Math.cos(R),Q=Math.sin(R),X=Math.max(1,Math.round(Math.abs(K)*U));for(let ae=0;ae<X;ae++){const ne=ae/X*2*Math.PI,[I,b,ie,P]=wg([K*Math.cos(ne),Q,K*Math.sin(ne)],C,T),[ye,fe,Se]=v(I,b,ie),xe=(Se+1)/2;D.push({x:ye,y:fe,z:Se,r:((f.rBase??.6)+(f.rDepth??1.7)*xe+(P?f.rActive??.3:0))*g,white:(f.inkFar??.62)-(f.inkSpan??.54)*xe-(P?.14:0)})}}Da(a,D,r,f.rMin)},Cg=(a,s,c,r,f)=>{const d=s/2,p=s/2,y=s/2*.874,v=fi(c*.18,.38,d,p,1),g=di(s,f.rsPow??.6),S=[],C=f.rings??15,T=f.lonDensity??40;for(let D=0;D<=C;D++){const M=-Math.PI/2+D/C*Math.PI,U=Math.cos(M),H=Math.sin(M),R=.62*Math.sin(c*2.1-D*.52)+.38*Math.sin(c*1.27+D*.83),K=y*(.88+.105*R),Q=Math.max(1,Math.round(Math.abs(U)*T));for(let X=0;X<Q;X++){const ae=X/Q*2*Math.PI,[ne,I,b]=v(U*Math.cos(ae)*K,H*K,U*Math.sin(ae)*K),ie=(b/y+1)/2,P=Math.max(0,R);S.push({x:ne,y:I,z:b,r:((f.rBase??.6)+(f.rDepth??1.7)*ie)*(1+.4*P)*g,white:.66-.56*ie-.1*P})}}Da(a,S,r,f.rMin)};function Ng(a){return a*a*(3-2*a)}function um(a){const s=a.length,c=[];let r=0;for(let f=0;f<s;f++){const d=a[f],p=a[(f+1)%s],y=Math.hypot(p[0]-d[0],p[1]-d[1]);c.push(y),r+=y}return f=>{let d=f*r,p=0;for(;d>c[p]&&p<s-1;)d-=c[p],p++;const y=a[p],v=a[(p+1)%s],g=c[p]?Math.min(1,d/c[p]):0;return[y[0]+(v[0]-y[0])*g,y[1]+(v[1]-y[1])*g]}}const Mg=a=>{const s=-Math.PI/2+a*2*Math.PI;return[Math.cos(s)*.24,Math.sin(s)*.24]},Ag=um([[0,-.26],[.24,.16],[-.24,.16]]),Tg=um([[0,-.2],[.2,-.2],[.2,.2],[-.2,.2],[-.2,-.2]]),Mf=[Mg,Ag,Tg];function Dg(a){return Math.max(6,Math.round(34*a))}const Uf=1.4,rm=.9,Af=Uf+rm,kg=(a,s,c,r,f)=>{const d=Mf.length,p=c%(Af*d),y=Math.floor(p/Af),v=p-y*Af,g=v>Uf?Ng((v-Uf)/rm):0,S=f.spread??1,C=Mf[y],T=Mf[(y+1)%d],D=160,M=[];for(let b=0;b<D;b++){const ie=b/D,P=C(ie),ye=T(ie);M.push([(P[0]+(ye[0]-P[0])*g)*S,(P[1]+(ye[1]-P[1])*g)*S])}const U=[];let H=0;for(let b=0;b<D;b++){const ie=M[b],P=M[(b+1)%D],ye=Math.hypot(P[0]-ie[0],P[1]-ie[1]);U.push(ye),H+=ye}const R=Dg(f.iconD??1),K=(f.rDot??.021)*1.35*S,Q=1+.02*Math.sin(v*3.1),X=[],ae=s/2;let ne=0,I=0;for(let b=0;b<R;b++){const ie=b/R*H;for(;I+U[ne]<ie&&ne<D-1;)I+=U[ne],ne++;const P=M[ne],ye=M[(ne+1)%D],fe=U[ne]?Math.min(1,(ie-I)/U[ne]):0,Se=(P[0]+(ye[0]-P[0])*fe)*Q,xe=(P[1]+(ye[1]-P[1])*fe)*Q;X.push({x:ae+Se*s,y:ae+xe*s,z:0,r:Math.max(.35,K*s),white:.1})}Da(a,X,r,f.rMin)},zg=(a,s,c,r,f)=>{const d=s/2,p=s/2,y=s/2*.82,v=fi(c*.12,.3,d,p,1),g=di(s,f.rsPow??.6),S=[],C=f.orbitN??12,T=f.ghostN??40,D=f.particles??3;for(let M=0;M<C;M++){const U=Bn(M,1.7),H=Bn(M,5.2),R=Bn(M,8.9),K=y*(.45+.52*U),Q=U*2*Math.PI,X=Math.acos(2*H-1),ae=Math.sin(X)*Math.cos(Q),ne=Math.cos(X),I=Math.sin(X)*Math.sin(Q);let b=-ne,ie=ae;const P=0,ye=Math.max(1e-6,Math.sqrt(b*b+ie*ie));b/=ye,ie/=ye;const fe=ne*P-I*ie,Se=I*b-ae*P,xe=ae*ie-ne*b,Te=(.25+.55*R)*(R>.5?1:-1);for(let O=0;O<T;O++){const W=O/T*2*Math.PI,[ue,je,Ne]=v((b*Math.cos(W)+fe*Math.sin(W))*K,(ie*Math.cos(W)+Se*Math.sin(W))*K,(P*Math.cos(W)+xe*Math.sin(W))*K),E=(Ne/K+1)/2;S.push({x:ue,y:je,z:Ne,r:(f.ghostR??.9)*g,white:.72,a:(f.ghostA??.5)*(.4+.6*E)})}for(let O=0;O<D;O++){const W=c*Te+O/D*2*Math.PI+H*6,[ue,je,Ne]=v((b*Math.cos(W)+fe*Math.sin(W))*K,(ie*Math.cos(W)+Se*Math.sin(W))*K,(P*Math.cos(W)+xe*Math.sin(W))*K),E=(Ne/K+1)/2;S.push({x:ue,y:je,z:Ne,r:((f.partR??1.2)+(f.partRDepth??1.6)*E)*g,white:.3-.22*E})}}Da(a,S,r,f.rMin)},i1=(a,s,c,r,f)=>{const d=s/2,p=s/2,y=s/2*.78,v=f.spin??1,g=.3,S=fi(c*.1*v,g,d,p,1),C=di(s,f.rsPow??.6),T=[],D=f.ghostN??150;for(let xe=0;xe<D;xe++){const Te=Qf(xe,D),[O,W,ue]=S(Te[0]*y,Te[1]*y,Te[2]*y),je=(ue/y+1)/2;T.push({x:O,y:W,z:ue,r:.8*C,white:.78,a:.1+.22*je})}const M=c*.24*v,U=f.faceOn?-g:.55+.3*Math.sin(c*.18)*v,H=Math.cos(M),R=0,K=Math.sin(M),Q=-K*Math.sin(U),X=Math.cos(U),ae=H*Math.sin(U),ne=R*ae-K*X,I=K*Q-H*ae,b=H*X-R*Q,ie=.23*(f.wobMul??1),P=f.faceOn?y/(1+.85*ie):y,ye=f.lanes??5,fe=f.segs??88,Se=Math.max(1,Math.round(ye*(f.bandMul??1)));for(let xe=0;xe<Se;xe++){const Te=(xe-(Se-1)/2)*.075,O=Math.abs(xe-(Se-1)/2)/Math.max(1,(Se-1)/2);for(let W=0;W<fe;W++){const ue=W/fe*2*Math.PI,je=(.16*Math.sin(ue*3-c*1.7+xe*.22)+.07*Math.sin(ue*5+c*1.1))*(f.wobMul??1),Ne=f.faceOn?1+je:1,E=f.faceOn?Te:Te+je,G=H*Math.cos(ue)+Q*Math.sin(ue)+ne*E,le=R*Math.cos(ue)+X*Math.sin(ue)+I*E,ce=K*Math.cos(ue)+ae*Math.sin(ue)+b*E,oe=Math.sqrt(G*G+le*le+ce*ce),Ee=P*Ne,[L,V,se]=S(G/oe*Ee,le/oe*Ee,ce/oe*Ee),pe=(se/y+1)/2;T.push({x:L,y:V,z:se,r:((f.rBase??1.1)+(f.rDepth??1.7)*pe)*(1-.25*O)*C,white:.52-.44*pe+.18*O,a:.4+.6*pe})}}Da(a,T,r,f.rMin)},Rg=(a,s,c,r,f)=>{const d=s/2,p=s/2,y=s/2*.8*(f.spread??1),v=fi(c*.12,.32,d,p,y),g=di(s,f.rsPow??.6),S=f.nodeN??30,C=f.thr??.72,T=f.nodeR??1.4,D=f.nodeRDepth??1.8,M=[];for(let K=0;K<S;K++){const Q=Qf(K,S),X=Q[0]+.3*(Nf(K*.31+9,c*.24)-.5)*2,ae=Q[1]+.3*(Nf(K*.53+27,c*.21)-.5)*2,ne=Q[2]+.3*(Nf(K*.77+55,c*.27)-.5)*2,I=Math.sqrt(X*X+ae*ae+ne*ne);M.push([X/I,ae/I,ne/I])}const U=[],H=[];for(let K=0;K<S;K++)for(let Q=K+1;Q<S;Q++){const X=M[K][0]-M[Q][0],ae=M[K][1]-M[Q][1],ne=M[K][2]-M[Q][2],I=Math.sqrt(X*X+ae*ae+ne*ne);if(I>=C)continue;const[b,ie,P]=v(M[K][0],M[K][1],M[K][2]),[ye,fe,Se]=v(M[Q][0],M[Q][1],M[Q][2]),xe=((P+Se)/2+1)/2;U.push({x1:b,y1:ie,x2:ye,y2:fe,white:.42,a:(1-I/C)*(.3+.55*xe),w:Math.max(.6,(f.lineW??.8)*g)})}for(let K=0;K<S;K++){const[Q,X,ae]=v(M[K][0],M[K][1],M[K][2]),ne=(ae+1)/2,I=1+.25*Math.sin(c*1.4+K*2.7);H.push({x:Q,y:X,z:ae,r:(T+D*ne)*I*g,white:.55-.45*ne})}const R=f.signals??5;for(let K=0;K<R;K++){const Q=Math.floor(c*.55+K*7.31),X=Math.floor(Bn(Q,K*3.1+1.7)*S),ae=Math.floor(Bn(Q,K*5.7+4.2)*S);if(X===ae)continue;const ne=om(c*.55+K*7.31),I=Cf(M[X][0],M[ae][0],ne),b=Cf(M[X][1],M[ae][1],ne),ie=Cf(M[X][2],M[ae][2],ne),P=Math.max(1e-6,Math.sqrt(I*I+b*b+ie*ie)),[ye,fe,Se]=v(I/P,b/P,ie/P),xe=(Se+1)/2;H.push({x:ye,y:fe,z:Se,r:(T*1.5+D*xe)*g,white:.05,a:.5+.5*xe})}yg(a,U,r),Da(a,H,r,f.rMin)},Og={orbits:zg,globe:jg,rubik:Eg,wave:Cg,web:Rg,braid:vg,ribbon:i1,ring:i1,morph:kg},Lg=[["latRings","lonDensity"],["rings","lonDensity"],["lanes","segs"]],_g=["orbitN","ghostN","nodeN","strandN","signals"],Bg=["iconD"],Ug=["rBase","rDepth","rActive","rDot","ghostR","partR","partRDepth","nodeR","nodeRDepth"];function Hg(a,s){const c={...a},r=new Set,f=Math.sqrt(s);for(const[d,p]of Lg){const y=c[d],v=c[p];y!=null&&v!=null&&!r.has(d)&&!r.has(p)&&(c[d]=Math.max(2,Math.round(y*f)),c[p]=Math.max(2,Math.round(v*f)),r.add(d),r.add(p))}for(const d of _g){const p=c[d];p!=null&&p!==0&&!r.has(d)&&(c[d]=Math.max(1,Math.round(p*s)))}for(const d of Bg){const p=c[d];p!=null&&(c[d]=Math.max(.02,p*s))}return c}function $g(a,s){const c={...a};for(const r of Ug){const f=c[r];f!=null&&(c[r]=f*s)}return c.rSizeMul=(c.rSizeMul??1)*s,c}const qg={globe:{latRings:17,lonDensity:44,rBase:.6,rDepth:1.7,rBoost:1,inkFar:.62,inkSpan:.54,rsPow:.6,rMin:.3},orbits:{orbitN:12,ghostN:40,ghostR:.9,ghostA:.5,particles:3,partR:1.2,partRDepth:1.6,rsPow:.6,rMin:.3},rubik:{latRings:15,lonDensity:40,moveCount:14,rBase:.6,rDepth:1.7,rActive:.3,inkFar:.62,inkSpan:.54,rsPow:.6,rMin:.3},wave:{rings:15,lonDensity:40,rBase:.6,rDepth:1.7,rsPow:.6,rMin:.3},web:{nodeN:30,thr:.72,signals:5,nodeR:1.4,nodeRDepth:1.8,lineW:.8,rsPow:.6,rMin:.3},braid:{strandN:52,turns:3,ghostN:150,rBase:1.2,rDepth:1.8,rsPow:.6,rMin:.3},ribbon:{lanes:5,segs:88,ghostN:150,rBase:1.1,rDepth:1.7,rsPow:.6,rMin:.3},ring:{lanes:5,segs:88,ghostN:0,faceOn:1,rBase:1.1,rDepth:1.7,rsPow:.6,rMin:.3},morph:{rDot:.021,iconD:1,rMin:.25}},Yg={working:"orbits",searching:"globe",solving:"rubik",listening:"wave",connecting:"web",weaving:"braid",composing:"ribbon",breathing:"ring",shaping:"morph"},Gg={orbits:{64:{speed:1.885,count:1,size:1},20:{speed:3.9,count:.238,size:2.4}},globe:{64:{speed:2.015,count:.42,size:1.15,extra:{scanMul:4.08,dimBase:.45}},20:{speed:2.665,count:.105,size:1.75,extra:{scanMul:4.335,dimBase:.45}}},rubik:{64:{speed:1.82,count:.35,size:1.05},20:{speed:1.95,count:.088,size:1.9}},wave:{64:{speed:4.388,count:.341,size:1},20:{speed:3.998,count:.105,size:1.6}},web:{64:{speed:3.315,count:1.35,size:.95},20:{speed:6.63,count:.25,size:1.52}},braid:{64:{speed:1.625,count:.5,size:1},20:{speed:2.75,count:.1125,size:1.36}},ribbon:{64:{speed:2.34,count:.25,size:.85,extra:{spin:0,bandMul:3.9,wobMul:1}},20:{speed:3.12,count:.051,size:1.073,extra:{spin:0,bandMul:4.94,wobMul:1}}},ring:{64:{speed:3.24,count:.25,size:.956,extra:{spin:0,bandMul:3.627,wobMul:.368}},20:{speed:3.78,count:.028,size:1.622,extra:{spin:0,bandMul:3.968,wobMul:.565}}},morph:{64:{speed:2.405,count:.702,size:.395,extra:{spread:1.45}},20:{speed:2.08,count:.53,size:1.011,extra:{spread:1.45}}}},s1=new Map;function Xg(a,s){const c=`${a}-${s}`,r=s1.get(c);if(r)return r;const f=Yg[a],d=Gg[f][s];let p={...qg[f]};d.count!==1&&(p=Hg(p,d.count)),d.size!==1&&(p=$g(p,d.size)),d.extra&&(p={...p,...d.extra});const y={mode:f,speed:d.speed,opts:p};return s1.set(c,y),y}function Qg(a){let s=a;for(;s;){const c=s.getAttribute("data-theme");if(c==="dark")return!0;if(c==="light")return!1;if(s.classList.contains("dark"))return!0;if(s.classList.contains("light"))return!1;s=s.parentElement}return null}function Vg(){return typeof matchMedia>"u"||matchMedia("(prefers-color-scheme: dark)").matches}function Zg(a,s){const[c,r]=w.useState(!0);return w.useEffect(()=>{if(a==="dark"){r(!0);return}if(a==="light"){r(!1);return}const f=()=>{const v=Qg(s.current);r(v??Vg())};f();const d=typeof matchMedia<"u"?matchMedia("(prefers-color-scheme: dark)"):null,p=()=>f();d?.addEventListener("change",p);let y=null;return typeof MutationObserver<"u"&&s.current&&(y=new MutationObserver(f),y.observe(document.documentElement,{attributes:!0,attributeFilter:["class","data-theme"],subtree:!0})),()=>{d?.removeEventListener("change",p),y?.disconnect()}},[a,s]),c}function Kg(){const[a,s]=w.useState(!1);return w.useEffect(()=>{if(typeof matchMedia>"u")return;const c=matchMedia("(prefers-reduced-motion: reduce)");s(c.matches);const r=f=>s(f.matches);return c.addEventListener("change",r),()=>c.removeEventListener("change",r)},[]),a}const Fg={working:"Working…",searching:"Searching…",solving:"Solving…",listening:"Listening…",connecting:"Connecting…",weaving:"Weaving…",composing:"Composing…",breathing:"Thinking…",shaping:"Shaping…"};function pr({state:a="working",size:s=64,theme:c="auto",speed:r=1,paused:f=!1,style:d,"aria-label":p,...y}){const v=w.useRef(null),g=Zg(c,v),S=Kg();return w.useEffect(()=>{const C=v.current;if(!C)return;const T=Math.min(2,typeof devicePixelRatio<"u"&&devicePixelRatio||1);C.width=Math.round(s*T),C.height=Math.round(s*T);const D=C.getContext("2d");if(!D)return;const{mode:M,speed:U,opts:H}=Xg(a,s),R=Og[M],K=U*r,Q=fe=>{D.setTransform(T,0,0,T,0,0),D.clearRect(0,0,s,s),R(D,s,fe,g,H)};if(S){Q(.6);return}let X=0,ae=!1;const ne=()=>{Q(performance.now()/1e3*K),ae&&(X=requestAnimationFrame(ne))},I=()=>{ae||f||(ae=!0,X=requestAnimationFrame(ne))},b=()=>{ae=!1,cancelAnimationFrame(X)};Q(performance.now()/1e3*K);let ie=!0;const P=typeof IntersectionObserver<"u"?new IntersectionObserver(([fe])=>{ie=fe.isIntersecting,ie&&document.visibilityState!=="hidden"?I():b()}):null;P?.observe(C);const ye=()=>{document.visibilityState==="hidden"?b():ie&&I()};return document.addEventListener("visibilitychange",ye),P||I(),()=>{b(),P?.disconnect(),document.removeEventListener("visibilitychange",ye)}},[a,s,g,r,f,S]),u.jsx("canvas",{ref:v,role:"img","aria-label":p??Fg[a],style:{width:s,height:s,display:"block",...d},...y})}const nr=["searching","solving","composing","breathing","shaping"];function Jg(a){const s=Math.floor(a*nr.length);return nr[Math.min(nr.length-1,Math.max(0,s))]??nr[0]}const gr=Jg(Math.random());function cm(a){return JSON.parse(a)}function ri(a){return typeof a=="object"&&a!==null&&!Array.isArray(a)}function Wn(a){return typeof a=="string"}function lr(a){return typeof a=="boolean"}function Wg(a){return typeof a=="number"}const ci="ease-[cubic-bezier(0.32,0.72,0,1)]",fm=274,dm=395,hm=368,mm=[{label:"Full",width:null},{label:"1440",width:1440},{label:"834",width:834},{label:"390",width:390}],Yl={buildDirections:!1,collapsed:!1,collapsedFamilies:[],deleted:[],corner:"bottom-right",font:"satoshi",hidden:[],order:[],renames:{},scaleSplit:!0,showDevOverlays:!0,showWidget:!0,viewport:null,width:hm};function Ig(a){return`leglas:${a}`}function pm(a,s){const c=s.map(r=>r.title);try{if(!a)return{...Yl,order:c};const r=cm(a);if(!ri(r))return{...Yl,order:c};const f=(S,C)=>Array.isArray(S)?S.filter(Wn).filter(T=>C.includes(T)):[],d=f(r.deleted,c),p=c.filter(S=>!d.includes(S)),y=f(r.order,p),v=["bottom-left","bottom-right","top-left","top-right"],g={};if(ri(r.renames))for(const[S,C]of Object.entries(r.renames))p.includes(S)&&Wn(C)&&(g[S]=C);return{collapsed:!!r.collapsed,collapsedFamilies:f(r.collapsedFamilies,p),corner:v.find(S=>S===r.corner)??Yl.corner,deleted:d,font:Wn(r.font)?r.font:Yl.font,hidden:f(r.hidden,p),order:[...y,...p.filter(S=>!y.includes(S))],renames:g,scaleSplit:lr(r.scaleSplit)?r.scaleSplit:Yl.scaleSplit,showDevOverlays:lr(r.showDevOverlays)?r.showDevOverlays:Yl.showDevOverlays,showWidget:lr(r.showWidget)?r.showWidget:Yl.showWidget,buildDirections:lr(r.buildDirections)?r.buildDirections:Yl.buildDirections,viewport:mm.map(S=>S.width).find(S=>S===r.viewport)??null,width:Wg(r.width)&&Number.isFinite(r.width)?Math.round(Math.min(dm,Math.max(fm,r.width))):hm}}catch{return{...Yl,order:c}}}function Pg(a,s){const c=new Set(s),r=Object.fromEntries(Object.entries(a.renames).filter(([f])=>!c.has(f)));return{...a,collapsedFamilies:a.collapsedFamilies.filter(f=>!c.has(f)),deleted:[...new Set([...a.deleted,...s])],hidden:a.hidden.filter(f=>!c.has(f)),order:a.order.filter(f=>!c.has(f)),renames:r}}function gm(a,s){if(a.length===0)return[...s];const c=new Set(s),r=a.filter(d=>c.has(d)),f=new Set(r);return[...r,...s.filter(d=>!f.has(d))]}const xm=8,ex=8;function tx(a,s,c=xm){return a.left<c?c-a.left:a.right>s-c?Math.max(c-a.left,s-c-a.right):0}function nx(a,s,c,r=xm){if(a.top>=r)return!1;const f=a.bottom-a.top;return s.bottom+r+f<=c-r}function lx(a,s,c,r){const f=a.at==="right"?a.x:a.x-s.width/2,d=a.at==="top"?a.y-s.height:a.at==="bottom"?a.y:a.y-s.height/2,p={bottom:d+s.height,left:f,right:f+s.width,top:d};if(a.at==="top"&&nx(p,c,r.height))return{at:"bottom",shift:a.shift,y:c.bottom+ex};const y=tx(p,r.width);return y===a.shift?null:{at:a.at,shift:y,y:a.y}}function Ao({size:a=18}){return u.jsxs("svg",{"aria-hidden":!0,height:a,strokeLinejoin:"round",strokeWidth:22,viewBox:"160 370 1050 1320",width:Math.round(a*(1050/1320)),children:[u.jsxs("defs",{children:[u.jsxs("linearGradient",{gradientUnits:"userSpaceOnUse",id:"lm-up",x1:"791.957",x2:"210",y1:"723.095",y2:"1010",children:[u.jsx("stop",{offset:"0",stopColor:"#7C38E8"}),u.jsx("stop",{offset:"0.68",stopColor:"#CDB6F1"}),u.jsx("stop",{offset:"1",stopColor:"#E9E0FA"})]}),u.jsxs("linearGradient",{gradientUnits:"userSpaceOnUse",id:"lm-down",x1:"789.954",x2:"210",y1:"1330.46",y2:"1035",children:[u.jsx("stop",{offset:"0",stopColor:"#3EC2A8"}),u.jsx("stop",{offset:"0.68",stopColor:"#9EDAE8"}),u.jsx("stop",{offset:"1",stopColor:"#E1F2F6"})]}),u.jsxs("linearGradient",{gradientUnits:"userSpaceOnUse",id:"lm-shaft",x1:"884.016",x2:"182",y1:"1023.26",y2:"1023.26",children:[u.jsx("stop",{offset:"0",stopColor:"#7E97DD"}),u.jsx("stop",{offset:"0.48",stopColor:"#5F7FD8"}),u.jsx("stop",{offset:"0.71",stopColor:"#9AABE2"}),u.jsx("stop",{offset:"1",stopColor:"#E2E8F6"})]}),u.jsxs("linearGradient",{gradientUnits:"userSpaceOnUse",id:"lm-head",x1:"1192",x2:"874.81",y1:"1021.57",y2:"1024.91",children:[u.jsx("stop",{offset:"0",stopColor:"#E8ECF7"}),u.jsx("stop",{offset:"1",stopColor:"#92A7E0"})]})]}),u.jsx("path",{d:"M 671.122 381.199 C 708.12 378.001 733.579 414.981 702.643 437.984 C 705.64 430.245 708.163 423.315 705.553 415.028 C 700.981 400.516 684.107 396.94 671.252 401.81 C 662.713 405.098 655.849 411.671 652.193 420.059 C 645.933 434.059 649.404 447.111 654.599 460.446 C 665.665 467.718 660.114 472.463 666.664 480.695 C 694.852 516.12 737.817 543.026 774.246 568.848 C 841.225 616.324 905.267 670.31 939.022 747.101 C 953.651 782.815 964.144 815.411 953.49 854.107 C 944.702 886.028 889.413 910.644 901.624 945.63 C 905.247 956.01 926.305 965.294 936.684 957.439 C 947.74 949.072 949.919 942.473 953.06 929.336 C 967.974 962.891 939.504 987.655 907.14 982.376 C 893.109 980.134 880.552 972.384 872.258 960.847 C 839.018 914.253 888.968 876.15 898.307 834.712 C 902.782 814.853 894.952 783.534 888.142 764.672 C 860.48 688.068 798.139 632.327 735.838 583.312 C 700.284 555.045 669.551 529.466 642.632 492.392 C 627.896 510.927 608.893 531.804 593.068 550.006 L 506.523 649.582 L 278.039 912.109 C 245.455 949.199 213.059 986.454 180.851 1023.87 C 231.765 1079.46 283.65 1142.04 333.374 1199.45 L 642.829 1555.74 C 666.446 1520.75 700.163 1494.07 732.424 1467.5 C 795.117 1417.7 858.256 1363.37 887.261 1286.25 C 898.113 1256.93 906.911 1217.89 889.705 1189.06 C 873.478 1161.87 852.143 1132.56 865.539 1099.12 C 871.003 1085.24 881.904 1074.2 895.712 1068.56 C 930.406 1054.52 970.704 1079.86 953.232 1118.88 C 950.548 1106.58 948.459 1099.64 937.837 1091.37 C 926.133 1082.27 907.942 1089.57 901.99 1101.66 C 890.169 1127.27 924.549 1151.85 939.219 1169.81 C 966.471 1203.18 959.658 1245.71 945.71 1284.44 C 914.285 1371.69 840.069 1433.7 765.809 1484.61 C 733.647 1506.66 698.091 1531.58 672.306 1561.08 C 665.933 1568.59 659.014 1581.87 653.634 1590.29 C 648.506 1598.32 647.787 1615.38 650.833 1624.56 C 653.881 1633.77 660.579 1641.32 669.359 1645.45 C 681.85 1651.27 699.281 1649.12 705.041 1634.65 C 708.705 1625.45 705.419 1617.29 701.581 1608.8 L 702.848 1609.85 C 737.88 1638.68 697.51 1681.47 657.106 1662.8 C 643.389 1656.45 632.826 1644.83 627.824 1630.56 C 619.064 1605.85 626.824 1585.32 637.489 1563.26 C 610.659 1534.07 581.755 1498.91 555.456 1468.66 L 383.745 1271.03 L 242.504 1108.25 C 219.223 1081.36 191.596 1051.06 169.707 1023.52 C 181.894 1007.58 201.352 986.522 215.082 970.737 L 301.342 871.646 L 539.659 597.67 C 572.041 560.265 605.914 522.417 637.6 484.482 C 616.356 444.192 617.849 392.637 671.122 381.199 z",fill:"#E8ECF7",stroke:"#E8ECF7"}),u.jsx("path",{d:"M 791.002 712.436 C 791.99 712.378 791.355 712.338 792.831 712.983 C 791.837 718.407 719.488 841.546 710.03 858.509 C 707.23 840.677 702.304 817.013 698.274 799.446 C 555 895 360 995 182 1023 C 355 963 525 870 674.863 761.103 C 659.702 748.905 644.649 736.575 629.704 724.113 C 681.16 722.084 738.984 715.793 791.002 712.436 z",fill:"url(#lm-up)",stroke:"url(#lm-up)"}),u.jsx("path",{d:"M 182 1023 C 360 1051 555 1151 698.326 1248.65 C 702.16 1232.41 707.425 1206.32 709.871 1189.79 C 737.246 1238.39 766.184 1286.55 793.713 1335.16 C 739.167 1331.05 684.598 1327.24 630.009 1323.75 C 644.462 1311.53 659.652 1298.21 674.331 1286.42 C 525 1176 355 1083 182 1023 z",fill:"url(#lm-down)",stroke:"url(#lm-down)"}),u.jsx("path",{d:"M 182 1023.5 L 884.044 1002.33 L 881.311 1004.34 C 882.15 1018.85 886.981 1021.89 881.356 1038.74 C 878.766 1040.79 876.225 1042.9 873.734 1045.08 z",fill:"url(#lm-shaft)",stroke:"url(#lm-shaft)"}),u.jsx("path",{d:"M 1005.63 925.199 L 1121.78 984.34 C 1142.45 994.767 1179.5 1012.52 1198.4 1023.72 L 1070.98 1089.03 C 1051.67 1098.95 1023.69 1114.54 1004.93 1122.53 C 1013.61 1097.65 1022.5 1072.85 1031.59 1048.12 L 873.734 1045.08 C 876.225 1042.9 878.766 1040.79 881.356 1038.74 C 886.981 1021.89 882.15 1018.85 881.311 1004.34 L 884.044 1002.33 L 1030.81 999.036 C 1023.04 976.689 1012.03 947.529 1005.63 925.199 z",fill:"url(#lm-head)",stroke:"url(#lm-head)"})]})}function ym({height:a=16}){return u.jsxs("svg",{"aria-label":"Leglas",fill:"#E8ECF7",height:a,role:"img",viewBox:"1256 928 642 222",width:Math.round(a*(642/222)),children:[u.jsx("path",{d:"M 1532.93 979.19 C 1552.43 978.051 1561.54 979.865 1574.88 995.12 L 1575.07 981.036 L 1598.92 981.151 L 1598.96 1052.38 C 1598.98 1086.98 1603.87 1127.82 1557.89 1134.37 C 1533.59 1137.83 1517.6 1134.59 1498.35 1119.87 L 1504.96 1108.54 L 1508.69 1102.35 C 1525.04 1114.93 1548.42 1124.68 1566.62 1107.48 C 1575.66 1098.94 1575.05 1084.76 1574.99 1073.16 C 1568.8 1080.06 1562.18 1085.4 1553.24 1088.34 C 1542.19 1091.88 1530.17 1090.79 1519.94 1085.31 C 1486.94 1067.75 1484.12 1009.92 1513.66 987.847 C 1520.32 982.873 1525.18 981.186 1532.93 979.19 z M 1541.52 1000.13 C 1555.85 998.918 1566.45 1003.26 1574.9 1015.05 C 1575.09 1027.93 1574.91 1041.22 1574.89 1054.14 C 1567.52 1063.25 1562.65 1066.25 1551.25 1068.92 C 1511.01 1069.99 1505.34 1012.62 1541.52 1000.13 z",fillRule:"evenodd"}),u.jsx("path",{d:"M 1416.95 979.231 C 1461.09 974.139 1477.7 1004.91 1478.08 1043.29 L 1395.13 1043.56 C 1404.31 1072.49 1429.03 1082.58 1454.48 1064.74 C 1457.34 1062.33 1456.68 1062.04 1459.58 1062.05 C 1464.01 1065.22 1467.95 1071.97 1471.41 1076.59 C 1414.1 1122.22 1344.57 1064.4 1381 1001.64 C 1388.32 989.03 1403.12 982.109 1416.95 979.231 z M 1419.64 998.169 C 1442.21 996.072 1449.85 1006.61 1455.14 1026.51 C 1448.55 1026.96 1438.16 1026.58 1431.31 1026.54 C 1419.15 1026.65 1406.99 1026.63 1394.83 1026.48 C 1398.74 1009.86 1403.7 1003.36 1419.64 998.169 z",fillRule:"evenodd"}),u.jsx("path",{d:"M 1713.27 979.252 C 1728.04 977.573 1745.26 979.123 1756.3 989.97 C 1768.26 1001.72 1767.44 1017.49 1767.31 1032.81 C 1767.15 1051.82 1767.12 1070.77 1767.06 1089.74 L 1757.36 1089.93 C 1733.55 1090.35 1748.04 1086.51 1742.3 1080.97 C 1727.07 1089.66 1714.5 1096.6 1695.79 1090.38 C 1685.07 1086.81 1679.16 1079.18 1674.51 1069.31 C 1663.26 1025.76 1710.42 1008.22 1743.06 1033.45 C 1743.17 1029.64 1743.75 1021.08 1742.89 1017.76 C 1734.81 986.781 1704.35 998.377 1687.37 1012 C 1684.28 1006.47 1681.22 1000.93 1678.2 995.358 C 1689.81 985.727 1698.69 981.852 1713.27 979.252 z M 1714.53 1038.21 C 1726.37 1037.77 1733.38 1039.57 1742.94 1046.21 C 1743.21 1052.09 1743.05 1058.97 1743.05 1064.94 C 1736.15 1071.44 1733.92 1072.52 1724.6 1074.96 C 1709.1 1075.75 1690.77 1070.07 1698.16 1048.49 C 1700.08 1042.9 1708.94 1039.56 1714.53 1038.21 z",fillRule:"evenodd"}),u.jsx("path",{d:"M 1823.29 979.174 C 1843.68 977.649 1857.91 980.343 1873.82 993.561 L 1864.19 1010.31 C 1854.9 1002.37 1842.52 996.264 1830.29 997.499 C 1810.54 999.496 1804.87 1016.41 1827.99 1021.78 C 1853.42 1027.68 1886.98 1035.62 1875.05 1070.07 C 1869.31 1086.64 1852.8 1091.05 1837.21 1092.35 C 1816.02 1092.18 1803.14 1089.58 1786.76 1075.52 L 1797.03 1058.98 C 1810.81 1068.5 1823.36 1075.69 1840.97 1072.95 C 1848.65 1071.76 1856.31 1065.31 1853.69 1057.02 C 1850.58 1049.89 1837.32 1046.22 1830.02 1044.91 C 1802.77 1040.01 1777.57 1024.93 1796.42 994.719 C 1802.7 984.652 1812.04 981.686 1823.29 979.174 z"}),u.jsx("path",{d:"M 1266.98 939.821 L 1293.02 939.95 L 1293.03 1066.58 L 1358.72 1066.65 L 1358.8 1089.73 L 1266.88 1089.69 L 1266.98 939.821 z"}),u.jsx("path",{d:"M 1627.11 939.241 L 1650.97 939.358 L 1650.98 1089.81 L 1627.17 1089.88 C 1626.5 1040.3 1626.89 988.911 1627.11 939.241 z"})]})}const Vt={copy:"M216,28H88A12,12,0,0,0,76,40V76H40A12,12,0,0,0,28,88V216a12,12,0,0,0,12,12H168a12,12,0,0,0,12-12V180h36a12,12,0,0,0,12-12V40A12,12,0,0,0,216,28ZM156,204H52V100H156Zm48-48H180V88a12,12,0,0,0-12-12H100V52H204Z",plus:"M228,128a12,12,0,0,1-12,12H140v76a12,12,0,0,1-24,0V140H40a12,12,0,0,1,0-24h76V40a12,12,0,0,1,24,0v76h76A12,12,0,0,1,228,128Z",pencil:"M230.14,70.54,185.46,25.85a20,20,0,0,0-28.29,0L33.86,149.17A19.85,19.85,0,0,0,28,163.31V208a20,20,0,0,0,20,20H92.69a19.86,19.86,0,0,0,14.14-5.86L230.14,98.82a20,20,0,0,0,0-28.28ZM91,204H52V165l84-84,39,39ZM192,103,153,64l18.34-18.34,39,39Z",link:"M87.5,151.52l64-64a12,12,0,0,1,17,17l-64,64a12,12,0,0,1-17-17Zm131-114a60.08,60.08,0,0,0-84.87,0L103.51,67.61a12,12,0,0,0,17,17l30.07-30.06a36,36,0,0,1,50.93,50.92L171.4,135.52a12,12,0,1,0,17,17l30.08-30.06A60.09,60.09,0,0,0,218.45,37.55ZM135.52,171.4l-30.07,30.08a36,36,0,0,1-50.92-50.93l30.06-30.07a12,12,0,0,0-17-17L37.55,133.58a60,60,0,0,0,84.88,84.87l30.06-30.07a12,12,0,0,0-17-17Z",search:"M229.66,218.34l-50.07-50.06a88.11,88.11,0,1,0-11.31,11.31l50.06,50.07a8,8,0,0,0,11.32-11.32ZM40,112a72,72,0,1,1,72,72A72.08,72.08,0,0,1,40,112Z",split:"M216,36H40A20,20,0,0,0,20,56V200a20,20,0,0,0,20,20H216a20,20,0,0,0,20-20V56A20,20,0,0,0,216,36ZM44,60h72V196H44ZM212,196H140V60h72Z",sidebar:"M216,36H40A20,20,0,0,0,20,56V200a20,20,0,0,0,20,20H216a20,20,0,0,0,20-20V56A20,20,0,0,0,216,36ZM44,60H76V196H44ZM212,196H100V60H212Z",trash:"M216,48H40a12,12,0,0,0,0,24h4V208a20,20,0,0,0,20,20H192a20,20,0,0,0,20-20V72h4a12,12,0,0,0,0-24ZM188,204H68V72H188ZM76,20A12,12,0,0,1,88,8h80a12,12,0,0,1,0,24H88A12,12,0,0,1,76,20Z"},_n="flex h-6 w-6 items-center justify-center rounded text-[#D1D5DB] hover:bg-[#2E2E2E] hover:text-white",oi="flex h-7 w-full items-center justify-between gap-2 whitespace-nowrap rounded px-2 text-xs hover:bg-[#2E2E2E] hover:text-white disabled:cursor-not-allowed disabled:opacity-40",vm="flex h-7 w-full items-center justify-center rounded-md bg-[#E8E8EA] text-xs font-medium text-[#1C1C20] transition-[background-color,transform] duration-150 hover:bg-white active:scale-[0.98] disabled:cursor-not-allowed disabled:opacity-50 motion-reduce:transition-none";function ar({on:a}){return u.jsx("span",{"aria-hidden":"true",className:`relative h-3.5 w-6 shrink-0 rounded-full transition-colors duration-150 motion-reduce:transition-none ${a?"bg-[#E6E8EC]":"bg-[#17181B]"}`,children:u.jsx("span",{className:`absolute left-0.5 top-0.5 size-2.5 rounded-full transition-transform duration-150 motion-reduce:transition-none ${a?"translate-x-2.5 bg-[#17181B]":"bg-[#84848C]"}`})})}function xr({className:a=""}){return u.jsx("span",{"aria-hidden":!0,className:`leglas-live-dot block size-1.5 rounded-full ${a}`})}function ax({size:a=14}){return u.jsxs("svg",{"aria-hidden":!0,fill:"none",height:a,stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.6",viewBox:"0 0 16 16",width:a,children:[u.jsx("path",{d:"M8 9.75V2.75"}),u.jsx("path",{d:"m5.25 5.5 2.75-2.75 2.75 2.75"}),u.jsx("path",{d:"M3.25 8.75v3.5a1.5 1.5 0 0 0 1.5 1.5h6.5a1.5 1.5 0 0 0 1.5-1.5v-3.5"})]})}function ui({size:a=3}){return u.jsx("span",{"aria-hidden":!0,className:`block ${a===3?"size-3":"size-3.5"} shrink-0 animate-spin rounded-full border-[1.5px] border-white/15 border-t-white/70 motion-reduce:animate-none`})}function Vf({size:a=12}){return u.jsxs("svg",{"aria-hidden":"true",className:"shrink-0 text-amber-400/90",fill:"none",height:a,stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",viewBox:"0 0 16 16",width:a,children:[u.jsx("path",{d:"M8 2.6 14.6 13.4H1.4Z"}),u.jsx("path",{d:"M8 6.8v2.7"}),u.jsx("path",{d:"M8 11.6h.01"})]})}function Zt({d:a,size:s=13}){return u.jsx("svg",{"aria-hidden":!0,fill:"currentColor",height:s,viewBox:"0 0 256 256",width:s,children:u.jsx("path",{d:a})})}let o1=0;function Je({children:a,label:s,side:c="top",wide:r=!1}){const f=w.useRef(null),d=w.useRef(null),p=w.useRef(null),y=w.useRef(null),v=w.useRef(null),[g,S]=w.useState(null);w.useLayoutEffect(()=>{const M=d.current,U=f.current?.firstElementChild;if(!g||g.out||!M||!U)return;const H=lx(g,{height:M.offsetHeight,width:M.offsetWidth},U.getBoundingClientRect(),{height:window.innerHeight,width:window.innerWidth});H&&S(R=>R&&{...R,...H})},[s,g?.at,g?.out,g?.shift,g?.x,g?.y]),w.useEffect(()=>()=>{y.current&&clearTimeout(y.current),v.current&&clearTimeout(v.current)},[]);const C=()=>{const M=f.current?.firstElementChild;if(!M)return;const U=M.getBoundingClientRect();v.current&&clearTimeout(v.current),p.current=M.closest("dialog, [data-leglas-shell]")??document.body,S(c==="top"?{at:"top",out:!1,shift:0,x:U.left+U.width/2,y:U.top-8}:{at:"right",out:!1,shift:0,x:U.right+8,y:U.top+U.height/2})},T=()=>{y.current&&clearTimeout(y.current),y.current=setTimeout(C,Date.now()<o1?0:300)},D=()=>{y.current&&clearTimeout(y.current),o1=Date.now()+300,S(M=>M&&!M.out?{...M,out:!0}:M),v.current&&clearTimeout(v.current),v.current=setTimeout(()=>S(null),120)};return u.jsxs("span",{className:"contents",onBlur:D,onFocus:M=>{M.target instanceof Element&&M.target.matches(":focus-visible")&&C()},onPointerDown:D,onPointerEnter:T,onPointerLeave:D,ref:f,children:[a,g&&sm.createPortal(u.jsx("span",{"aria-hidden":!0,className:"pointer-events-none fixed z-[60]",style:{left:g.x+g.shift,top:g.y},children:u.jsx("span",{className:`block ${{bottom:"-translate-x-1/2",right:"-translate-y-1/2",top:"-translate-x-1/2 -translate-y-full"}[g.at]}`,children:u.jsx("span",{className:`leglas-tip block rounded-lg border border-white/10 bg-[#171717] px-2 py-1 text-xs font-medium text-white shadow-lg ${r?"w-64 whitespace-normal":"whitespace-nowrap"} ${g.out?`leglas-tip-out-${g.at}`:`leglas-tip-in-${g.at}`}`,ref:d,children:s})})}),p.current??document.body)]})}function ix({error:a,initial:s,label:c,onCancel:r,onCommit:f}){const d=w.useRef(!1);return w.useEffect(()=>{a&&(d.current=!1)}),u.jsx("form",{className:"leglas-rename min-w-0 flex-1",onSubmit:p=>{p.preventDefault();const y=new FormData(p.currentTarget).get("name");d.current=!0,f(Wn(y)?y.trim():"","submit")},children:u.jsx("input",{"aria-describedby":a?"leglas-rename-error":void 0,"aria-invalid":a?!0:void 0,"aria-label":c,autoFocus:!0,className:`-mx-1 block w-[calc(100%+0.5rem)] rounded-[4px] bg-transparent px-1 py-0 text-sm font-medium leading-5 text-white outline-none ring-1 ${a?"ring-amber-400/60":"ring-[#D1D5DB]/45 focus:ring-[#D1D5DB]/70"}`,defaultValue:s,name:"name",onBlur:p=>{d.current||f(p.currentTarget.value.trim(),"blur")},onKeyDown:p=>{p.key==="Escape"&&(d.current=!0,r())},type:"text"})})}const sx={danger:"bg-amber-300",info:"bg-[#9CA3AF]",success:"bg-emerald-300"},ox=140;function ux({onDismiss:a,toast:s}){const[c,r]=w.useState(!1),[f,d]=w.useState(!1),[p,y]=w.useState(!1),v=w.useRef(s.ttl),g=w.useRef(null),S=()=>{g.current||(r(!0),g.current=setTimeout(a,ox))},C=f||p;return w.useEffect(()=>{if(c||C||v.current===null)return;const T=Date.now(),D=setTimeout(S,v.current);return()=>{clearTimeout(D),v.current!==null&&(v.current=Math.max(0,v.current-(Date.now()-T)))}},[c,C]),w.useEffect(()=>()=>{g.current&&clearTimeout(g.current)},[]),u.jsxs("li",{className:`pointer-events-auto flex items-start gap-2.5 rounded-lg border border-white/10 bg-[#2E2E2E] px-3 py-2.5 shadow-xl shadow-black/40 ${c?"leglas-toast-out":"leglas-toast-in"}`,onBlur:()=>y(!1),onFocus:()=>y(!0),onPointerEnter:()=>d(!0),onPointerLeave:()=>d(!1),children:[u.jsx("span",{"aria-hidden":!0,className:`mt-[5px] size-1.5 shrink-0 rounded-full ${sx[s.tone]}`}),u.jsxs("span",{className:"min-w-0 flex-1",children:[u.jsx("span",{className:"block text-xs leading-snug text-[#E8E8EA]",children:s.message}),s.detail?u.jsx("span",{className:"mt-1 block cursor-text select-text break-all text-[10px] leading-snug text-[#9CA3AF]","data-selectable":"",style:{fontFamily:"var(--font-mono)"},children:s.detail}):null,s.note?u.jsx("span",{className:"mt-1 block text-[11px] leading-snug text-[#9CA3AF]",children:s.note}):null]}),s.action?u.jsx("button",{className:"shrink-0 rounded px-1 py-0.5 text-[11px] font-medium text-white underline decoration-white/30 underline-offset-2 transition-colors hover:decoration-white focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[#D1D5DB]/60",onClick:()=>{s.action?.run(),S()},type:"button",children:s.action.label}):null,u.jsx("button",{"aria-label":"Dismiss",className:"-mr-1 flex size-5 shrink-0 items-center justify-center rounded text-[#84848C] transition-colors hover:bg-white/[0.06] hover:text-white focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[#D1D5DB]/60",onClick:S,type:"button",children:u.jsx("svg",{className:"size-2.5",fill:"none",stroke:"currentColor",strokeWidth:2,viewBox:"0 0 10 10",children:u.jsx("path",{d:"M2.5 2.5 7.5 7.5M7.5 2.5 2.5 7.5",strokeLinecap:"round"})})})]})}function rx({bottom:a,left:s,onDismiss:c,toasts:r,width:f}){return u.jsx("ol",{"aria-live":"polite",className:`pointer-events-none fixed z-40 flex flex-col gap-2 transition-[bottom,left,width] duration-200 ${ci} motion-reduce:transition-none`,style:{bottom:a,left:s,width:f},children:r.map(d=>u.jsx(ux,{onDismiss:()=>c(d.id),toast:d},d.id))})}function cx({loaded:a}){return u.jsxs("div",{"aria-hidden":!0,className:`absolute inset-0 overflow-hidden bg-white transition-opacity duration-700 ${ci} ${a?"pointer-events-none opacity-0":"opacity-100"}`,children:[u.jsxs("div",{children:[u.jsx("div",{className:"mx-auto mt-6 h-12 w-[400px] max-w-[80%] rounded-full bg-neutral-200/80"}),u.jsxs("div",{className:"mx-auto mt-24 grid w-full max-w-5xl grid-cols-[1.05fr_0.95fr] items-start gap-16 px-12 max-[900px]:grid-cols-1",children:[u.jsxs("div",{children:[u.jsx("div",{className:"h-14 w-4/5 rounded-lg bg-neutral-200"}),u.jsx("div",{className:"mt-3 h-14 w-3/5 rounded-lg bg-neutral-200"}),u.jsx("div",{className:"mt-8 h-4 w-full max-w-[420px] rounded bg-neutral-200/80"}),u.jsx("div",{className:"mt-2 h-4 w-4/5 max-w-[360px] rounded bg-neutral-200/80"}),u.jsx("div",{className:"mt-10 h-12 w-44 rounded-full bg-neutral-200"})]}),u.jsx("div",{className:"h-[420px] w-60 justify-self-center rounded-[2.5rem] bg-neutral-200 max-[900px]:hidden"})]})]}),u.jsx("div",{className:"pointer-events-none absolute inset-0 overflow-hidden motion-reduce:hidden",children:u.jsx("div",{className:"absolute inset-0 -translate-x-full animate-[leglas-skeleton-sweep_1.6s_ease-in-out_infinite]",style:{background:"linear-gradient(100deg, transparent 32%, rgba(255,255,255,0.55) 50%, transparent 68%)"}})}),u.jsxs("span",{className:"absolute bottom-4 right-5 flex items-center gap-2",children:[u.jsx(pr,{"aria-label":"",size:20,state:gr,theme:"light"}),u.jsx("span",{className:"leglas-shimmer-text text-xs font-medium",children:"Loading preview…"})]})]})}function fx({branch:a,onStart:s,state:c}){if(c.status==="failed")return u.jsx(bm,{onReload:s,reason:c.reason});const r=c.status==="starting"?{"checking out":`Checking out ${a}`,installing:"Installing what it needs",starting:"Starting its dev server"}[c.phase]:`Opening ${a}`;return u.jsxs("div",{"aria-live":"polite",className:"absolute inset-0 flex flex-col items-center justify-center gap-3 bg-white p-6 text-center",children:[u.jsx("span",{className:"size-4 animate-spin rounded-full border-2 border-neutral-300 border-t-neutral-800 motion-reduce:animate-none"}),u.jsxs("div",{className:"max-w-xs",children:[u.jsx("p",{className:"text-sm font-medium text-neutral-800",children:r}),u.jsx("p",{className:"mt-1 text-xs leading-snug text-neutral-500",children:"A branch runs in its own checkout, built the first time you open it this session."})]})]})}function bm({onReload:a,reason:s}){return u.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center gap-3 bg-white p-6 text-center",role:"alert",children:[u.jsxs("div",{className:"max-w-xs",children:[u.jsx("p",{className:"text-sm font-medium text-neutral-800",children:"Preview didn’t load"}),u.jsx("p",{className:"mt-1 text-xs leading-snug text-neutral-500",children:s})]}),u.jsx("button",{className:"rounded-md bg-neutral-900 px-3 py-1.5 text-xs font-medium text-white transition-colors hover:bg-neutral-700",onClick:a,type:"button",children:"Reload"})]})}function dx({text:a}){const s=[];let c=0;for(const r of a.split(" "))s.push({word:r,at:c}),c+=r.length+1;return u.jsx("code",{className:"font-mono text-[0.92em] text-neutral-700",children:s.map(({word:r,at:f})=>u.jsxs(w.Fragment,{children:[f>0&&" ",u.jsx("span",{className:"whitespace-nowrap",children:r})]},f))})}function u1({className:a,words:s}){return u.jsxs("p",{className:a,children:[s.lead,u.jsx(dx,{text:s.quote}),s.tail]})}function hx({headline:a,hint:s,href:c,onShowAnyway:r,reason:f}){return u.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center gap-3 bg-white p-6 text-center",role:"alert",children:[u.jsxs("div",{className:"max-w-sm",children:[u.jsx("p",{className:"text-balance text-sm font-medium text-neutral-800",children:a}),u.jsx(u1,{className:"mt-1 text-pretty text-xs leading-snug text-neutral-500",words:f})]}),u.jsx("a",{className:"rounded-md bg-neutral-900 px-3 py-1.5 text-xs font-medium text-white transition-colors hover:bg-neutral-700",href:c,rel:"noopener noreferrer",target:"_blank",children:"Open in a new tab"}),u.jsx("button",{className:"text-xs text-neutral-500 underline-offset-2 transition-colors hover:text-neutral-800 hover:underline",onClick:r,type:"button",children:"Show the frame anyway"}),u.jsx(u1,{className:"max-w-sm text-balance text-[11px] leading-snug text-neutral-400",words:s})]})}function cs({id:a,size:s=14}){const c=w.useId();return a==="claude"?u.jsx("svg",{"aria-hidden":"true",fill:"#D97757",height:s,viewBox:"0 0 24 24",width:s,children:u.jsx("path",{d:"m4.7144 15.9555 4.7174-2.6471.079-.2307-.079-.1275h-.2307l-.7893-.0486-2.6956-.0729-2.3375-.0971-2.2646-.1214-.5707-.1215-.5343-.7042.0546-.3522.4797-.3218.686.0608 1.5179.1032 2.2767.1578 1.6514.0972 2.4468.255h.3886l.0546-.1579-.1336-.0971-.1032-.0972L6.973 9.8356l-2.55-1.6879-1.3356-.9714-.7225-.4918-.3643-.4614-.1578-1.0078.6557-.7225.8803.0607.2246.0607.8925.686 1.9064 1.4754 2.4893 1.8336.3643.3035.1457-.1032.0182-.0728-.164-.2733-1.3539-2.4467-1.445-2.4893-.6435-1.032-.17-.6194c-.0607-.255-.1032-.4674-.1032-.7285L6.287.1335 6.6997 0l.9957.1336.419.3642.6192 1.4147 1.0018 2.2282 1.5543 3.0296.4553.8985.2429.8318.091.255h.1579v-.1457l.1275-1.706.2368-2.0947.2307-2.6957.0789-.7589.3764-.9107.7468-.4918.5828.2793.4797.686-.0668.4433-.2853 1.8517-.5586 2.9021-.3643 1.9429h.2125l.2429-.2429.9835-1.3053 1.6514-2.0643.7286-.8196.85-.9046.5464-.4311h1.0321l.759 1.1293-.34 1.1657-1.0625 1.3478-.8804 1.1414-1.2628 1.7-.7893 1.36.0729.1093.1882-.0183 2.8535-.607 1.5421-.2794 1.8396-.3157.8318.3886.091.3946-.3278.8075-1.967.4857-2.3072.4614-3.4364.8136-.0425.0304.0486.0607 1.5482.1457.6618.0364h1.621l3.0175.2247.7892.522.4736.6376-.079.4857-1.2142.6193-1.6393-.3886-3.825-.9107-1.3113-.3279h-.1822v.1093l1.0929 1.0686 2.0035 1.8092 2.5075 2.3314.1275.5768-.3218.4554-.34-.0486-2.2039-1.6575-.85-.7468-1.9246-1.621h-.1275v.17l.4432.6496 2.3436 3.5214.1214 1.0807-.17.3521-.6071.2125-.6679-.1214-1.3721-1.9246L14.38 17.959l-1.1414-1.9428-.1397.079-.674 7.2552-.3156.3703-.7286.2793-.6071-.4614-.3218-.7468.3218-1.4753.3886-1.9246.3157-1.53.2853-1.9004.17-.6314-.0121-.0425-.1397.0182-1.4328 1.9672-2.1796 2.9446-1.7243 1.8456-.4128.164-.7164-.3704.0667-.6618.4008-.5889 2.386-3.0357 1.4389-1.882.929-1.0868-.0062-.1579h-.0546l-6.3385 4.1164-1.1293.1457-.4857-.4554.0608-.7467.2307-.2429 1.9064-1.3114Z"})}):a==="cursor"?u.jsx("svg",{"aria-hidden":"true",fill:"currentColor",height:s,viewBox:"0 0 24 24",width:s,children:u.jsx("path",{d:"M11.503.131 1.891 5.678a.84.84 0 0 0-.42.726v11.188c0 .3.162.575.42.724l9.609 5.55a1 1 0 0 0 .998 0l9.61-5.55a.84.84 0 0 0 .42-.724V6.404a.84.84 0 0 0-.42-.726L12.497.131a1.01 1.01 0 0 0-.996 0M2.657 6.338h18.55c.263 0 .43.287.297.515L12.23 22.918c-.062.107-.229.064-.229-.06V12.335a.59.59 0 0 0-.295-.51l-9.11-5.257c-.109-.063-.064-.23.061-.23"})}):a==="codex"?u.jsxs("svg",{"aria-hidden":"true",height:s,viewBox:"0 0 24 24",width:s,children:[u.jsx("defs",{children:u.jsxs("linearGradient",{id:c,x1:"0",x2:"0",y1:"0",y2:"1",children:[u.jsx("stop",{offset:"0",stopColor:"#9B96F2"}),u.jsx("stop",{offset:"0.55",stopColor:"#5E6CF6"}),u.jsx("stop",{offset:"1",stopColor:"#3B32EF"})]})}),u.jsx("path",{d:"M8.086.457a6.105 6.105 0 013.046-.415c1.333.153 2.521.72 3.564 1.7a.117.117 0 00.107.029c1.408-.346 2.762-.224 4.061.366l.063.03.154.076c1.357.703 2.33 1.77 2.918 3.198.278.679.418 1.388.421 2.126a5.655 5.655 0 01-.18 1.631.167.167 0 00.04.155 5.982 5.982 0 011.578 2.891c.385 1.901-.01 3.615-1.183 5.14l-.182.22a6.063 6.063 0 01-2.934 1.851.162.162 0 00-.108.102c-.255.736-.511 1.364-.987 1.992-1.199 1.582-2.962 2.462-4.948 2.451-1.583-.008-2.986-.587-4.21-1.736a.145.145 0 00-.14-.032c-.518.167-1.04.191-1.604.185a5.924 5.924 0 01-2.595-.622 6.058 6.058 0 01-2.146-1.781c-.203-.269-.404-.522-.551-.821a7.74 7.74 0 01-.495-1.283 6.11 6.11 0 01-.017-3.064.166.166 0 00.008-.074.115.115 0 00-.037-.064 5.958 5.958 0 01-1.38-2.202 5.196 5.196 0 01-.333-1.589 6.915 6.915 0 01.188-2.132c.45-1.484 1.309-2.648 2.577-3.493.282-.188.55-.334.802-.438.286-.12.573-.22.861-.304a.129.129 0 00.087-.087A6.016 6.016 0 015.635 2.31C6.315 1.464 7.132.846 8.086.457z",fill:`url(#${c})`}),u.jsx("path",{d:"M7.282 8.307a.848.848 0 00-1.473.842l1.694 2.965-1.688 2.848a.849.849 0 001.46.864l1.94-3.272a.849.849 0 00.007-.854l-1.94-3.393zM12.728 14.547a.849.849 0 000 1.695h4.848a.849.849 0 000-1.696h-4.848z",fill:"#F4F4FE"})]}):a==="custom"?u.jsx("svg",{"aria-hidden":"true",fill:"none",height:s,stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",viewBox:"0 0 24 24",width:s,children:u.jsx("path",{d:"m5 6 6 6-6 6M13 18h6"})}):null}const To=15e3,mx=["config","requests","health","share","update","generation"];function px(a){return mx.some(s=>s===a)}function gx(a){try{const s=cm(a);if(!ri(s))return null;const c=s.changed;return px(c)?c:null}catch{return null}}const r1=250,xx=3e4;function yx(a){return a<=0?r1:Math.min(xx,r1*2**a)}function vx(){const{host:a,protocol:s}=window.location;return`${s==="https:"?"wss":"ws"}://${a}/leglas/api/live`}function bx(a){const s=new WebSocket(a);return{addEventListener:(c,r)=>s.addEventListener(c,f=>{r("data"in f&&Wn(f.data)?{data:f.data}:{})}),close:()=>s.close()}}let c1=null;function fs(){return c1??=wx(),c1}function wx(a={}){const s=a.connect??bx,c=a.setTimeout??((T,D)=>globalThis.setTimeout(T,D)),r=a.clearTimeout??(T=>globalThis.clearTimeout(T)),f=new Map;let d=null,p=!1,y=0,v=null,g=!1;const S=()=>{if(g)return;let T;try{T=s(a.url??vx())}catch{return C()}d=T,T.addEventListener("open",()=>{g||(p=!0,y=0)}),T.addEventListener("message",M=>{if(M.data===void 0)return;const U=gx(M.data);if(U!==null)for(const H of f.get(U)??[])H()});const D=()=>{d===T&&(p=!1,d=null,C())};T.addEventListener("close",D),T.addEventListener("error",D)},C=()=>{if(g||v!==null)return;const T=yx(y);y+=1,v=c(()=>{v=null,S()},T)};return S(),{on(T,D){const M=f.get(T)??new Set;return M.add(D),f.set(T,M),()=>{M.delete(D),M.size===0&&f.delete(T)}},get connected(){return p},stop(){g=!0,p=!1,v!==null&&r(v),v=null,f.clear();const T=d;d=null;try{T?.close()}catch{}}}}function Tf(a){return a instanceof Error&&a.name==="AbortError"}const Sx=1e4,jx={setInterval:(a,s)=>globalThis.setInterval(a,s),clearInterval:a=>globalThis.clearInterval(a),setTimeout:(a,s)=>globalThis.setTimeout(a,s),clearTimeout:a=>globalThis.clearTimeout(a)};function ds(a,s){const{everyMs:c,timeoutMs:r=Sx,timers:f=jx}=s;let d=!1,p=null;const y=()=>{if(d||p!==null)return;const S=new AbortController,C=f.setTimeout(()=>{S.abort(),p?.controller===S&&(p=null)},r),T={controller:S,deadline:C};p=T;const D=()=>{p===T&&(f.clearTimeout(C),p=null)};a(S.signal).then(D,D)};y();const v=f.setInterval(y,c),g=s.subscribe?.(y);return()=>{d=!0,g?.(),f.clearInterval(v),p!==null&&(f.clearTimeout(p.deadline),p.controller.abort(),p=null)}}function Ex(a){const s=document.createElement("textarea");s.value=a,s.setAttribute("readonly",""),s.style.cssText="position:fixed;top:-1000px;opacity:0",document.body.append(s),s.select();try{return document.execCommand("copy")}finally{s.remove()}}function Cx(){return{clipboard:typeof navigator>"u"?void 0:navigator.clipboard,legacy:typeof document>"u"?void 0:Ex}}async function Sr(a,s=Cx()){if(s.clipboard)try{return await s.clipboard.writeText(a),"copied"}catch{}try{if(s.legacy?.(a))return"copied"}catch{}return"blocked"}const Nx=9;function Mx(a){if((a.metaKey||a.ctrlKey)&&!a.altKey&&!a.shiftKey&&a.key.toLowerCase()==="k")return{kind:"search"};if(a.typing||a.metaKey||a.ctrlKey||a.altKey)return null;const{key:s}=a;if(s==="?")return{kind:"help"};if(s==="ArrowDown")return{kind:"move",delta:1};if(s==="ArrowUp")return{kind:"move",delta:-1};const c=s.length===1?s.toLowerCase():"";return c==="a"?{kind:"note"}:c==="c"?{kind:"split"}:c==="b"?{kind:"rail"}:c==="r"?{kind:"request"}:c==="t"?{kind:"tools"}:s.length===1&&s>="1"&&s<=String(Nx)?{kind:"jump",index:Number(s)-1}:null}function wm(a){return a?"⌘Cmd+K":"Ctrl+K"}function Ax(a,s=!1){const c=[{keys:["↑","↓"],label:"Move between directions"},{keys:["1","9"],join:"to",label:"Jump straight to a direction"},{keys:["C"],label:"Compare against the direction you were last on"},{keys:["R"],label:"Ask for a change to this direction",changes:!0},{keys:["A"],label:"Annotate the design: point at what is wrong",changes:!0},{keys:[wm(a)],label:"Search"},{keys:["B"],label:"Collapse or open the rail"},{keys:["T"],label:"Open or close the Leglas dev tool menu"},{keys:["?"],label:"This list"},{keys:["Esc"],label:"Clear the search, or close what is open"}],r=[];for(const{changes:f,...d}of c)s&&f||r.push(d);return r}function Tx(a,s,c){return`${a}\0${s}\0${c}`}function Dx(a,s,c){return a[s]===c}function kx(a,s,c){return a[s]===c?a:{...a,[s]:c}}function zx(a,s){if(!(s in a))return a;const c={...a};return delete c[s],c}function Zf(a){try{const s=a.contentDocument;return s!==null&&s.location.href!=="about:blank"&&s.readyState!=="loading"}catch{return!1}}function Rx({frame:a,onFailure:s,onReady:c,sameOrigin:r,timeoutMs:f}){let d=!1,p=null;const y=()=>{a.removeEventListener("load",S),a.removeEventListener("error",C),p!==null&&(globalThis.clearTimeout(p),p=null)},v=T=>d||(r?!Zf(a):!T)?!1:(d=!0,y(),c(),!0),g=T=>{d||T&&r&&v(!1)||(d=!0,y(),s())};function S(){v(!r)}function C(){g(!1)}return a.addEventListener("load",S),a.addEventListener("error",C),p=globalThis.setTimeout(()=>g(!0),f),r&&v(!1),()=>{d||(d=!0,y())}}function Ox(a){return ri(a)&&(a.header==="x-frame-options"||a.header==="content-security-policy")&&Wn(a.value)}async function Lx(a,s=fetch){try{const c=await s(`/leglas/api/previews/framing?title=${encodeURIComponent(a)}`);if(!c.ok)return null;const r=await c.json();return ri(r)&&r.framable===!1&&Ox(r.refusal)?{header:r.refusal.header,value:r.refusal.value}:null}catch{return null}}function _x(a){try{return new URL(a).host}catch{return a}}function Bx(a){if(a.header==="content-security-policy")return{lead:"Its Content-Security-Policy says ",quote:a.value,tail:", and Leglas is not on that list."};const s=a.value.trim(),c=`X-Frame-Options: ${s}`;switch(s.toLowerCase()){case"deny":return{lead:"It sends ",quote:c,tail:", which tells every browser not to show it in a frame."};case"sameorigin":return{lead:"It sends ",quote:c,tail:", which lets only its own pages frame it."};default:return{lead:"It sends ",quote:c,tail:", which browsers read as a refusal."}}}function Ux(a,s,c){return{headline:`${_x(s)} won’t open inside another page`,reason:Bx(a),hint:{lead:"If the site is yours, a Content-Security-Policy of ",quote:`frame-ancestors ${c}`,tail:" lets it show here."}}}function Hx(a){if(!ri(a))return null;const s=a.type;return s==="leglas:preview-ready"?"ready":s==="leglas:preview-error"?"error":null}function $x(a,s){if(s===null)return null;for(const c of a)if(c.contentWindow===s)return c;return null}function f1(a){return a.file===void 0&&a.branch===void 0&&a.url.startsWith("/")}const qx={reachable:!0,wasDown:!1};function Yx(a,s){return s?a.reachable?a:{reachable:!0,wasDown:a.wasDown}:!a.reachable&&a.wasDown?a:{reachable:!1,wasDown:!0}}function Gx(a){const s=a.rows,c=r=>r!=null&&r!==a.active&&(s===void 0||s.includes(r));return c(a.pinned)?a.pinned:c(a.parent)?a.parent:c(a.previous)?a.previous:s?.find(r=>r!==a.active)??null}function Xx(a){return!a.split||a.compare===null||a.compare===a.active?[a.active]:[a.active,a.compare]}const Qx=.999,Vx=.05,Zx=40;function Kx(a){return a<=3?{columns:Math.max(1,a),rows:1}:a===4?{columns:2,rows:2}:{columns:3,rows:Math.ceil(a/3)}}function Fx(a){const{gutter:s,panes:c,scaleSplit:r,stageHeight:f,stageWidth:d,viewport:p}=a,y=a.rows??1,v=a.inset??0,g=c>1?(d-(c-1))/c:d,S=p??d,C=g-(p!==null?s:0)-v,T=f-(p!==null?s:0),D=r&&(c>1||y>1)&&d>0&&S>0,M=(f-(y-1))/y,U=y>1?(M-Zx-v)/T:1,H=D?Math.max(Vx,Math.min(1,C/S,U)):1,R=H<Qx;return{boxHeight:T*H,boxWidth:S*H,designWidth:S,frameHeight:T,scale:H,scaling:R}}const Jx="#__next-build-watcher,#nuxt-devtools-anchor,astro-dev-toolbar{display:none!important}",Wx="#devtools-indicator{display:none!important}",Ix=12;function Px(a,s,c=[],r=[]){const f=a.replace(/\s+/g," ").trim().toLowerCase();return f.length<Ix?null:jm(`${s.join(">")} ${f} ${c.join("|")} ${r.join("|")}`.trimEnd())}const Sm=new Set(["LINK","META","NOSCRIPT","SCRIPT","STYLE","TEMPLATE"]),ir=720,d1=180,e2=["display","visibility","position","top","right","bottom","left","inset","box-sizing","width","height","min-width","min-height","max-width","max-height","margin-top","margin-right","margin-bottom","margin-left","padding-top","padding-right","padding-bottom","padding-left","overflow-x","overflow-y","opacity","transform","transform-origin","perspective","z-index","color","background-color","background-image","background-position","background-size","border-top-width","border-right-width","border-bottom-width","border-left-width","border-top-color","border-right-color","border-bottom-color","border-left-color","border-top-left-radius","border-top-right-radius","border-bottom-right-radius","border-bottom-left-radius","box-shadow","outline","filter","backdrop-filter","-webkit-backdrop-filter","clip-path","mask-image","mix-blend-mode","isolation","object-fit","object-position","font-family","font-size","font-style","font-weight","line-height","letter-spacing","text-align","text-transform","white-space","flex-direction","flex-wrap","flex-grow","flex-shrink","flex-basis","align-items","align-self","justify-content","justify-self","gap","row-gap","column-gap","grid-template-columns","grid-template-rows","grid-column","grid-row","aspect-ratio","pointer-events","animation-name","animation-duration","animation-delay","animation-iteration-count","animation-direction","animation-timing-function"],t2=new Set(["bottom","filter","height","left","opacity","right","top","transform","width"]),n2=["content","display","position","inset","width","height","opacity","transform","color","background-color","background-image","border-radius","box-shadow","filter","clip-path"],l2=["viewBox","d","points","x","y","x1","y1","x2","y2","cx","cy","r","rx","ry","width","height","fill","stroke","stroke-width"],h1=["nextjs-portal","vite-error-overlay","#webpack-dev-server-client-overlay","#leglas-hide-dev-overlays"].join(",");function sr(a){if(!Number.isFinite(a))return"?";const s=Math.round(a*2)/2;return Object.is(s,-0)?"0":String(s)}function jm(a){let s=2166136261,c=2654435769;for(let r=0;r<a.length;r+=1){const f=a.charCodeAt(r);s=Math.imul(s^f,16777619),c=Math.imul(c^f,2246822507)}return`${(s>>>0).toString(16)}${(c>>>0).toString(16)}`}function yr(a,s=480){const c=a.replace(/\s+/g," ").trim();return c.length<=s?c:`${c.slice(0,180)}…${c.slice(-80)}#${c.length}:${jm(c)}`}function a2(a){return Sm.has(a.tagName)||a.matches(h1)||a.closest(h1)!==null}function i2(a){if(a.length<=ir)return a.map((f,d)=>d);const s=new Set,c=f=>{f>=0&&f<a.length&&s.size<ir&&s.add(f)};for(let f=0;f<d1;f+=1)c(f);for(let f=Math.max(0,a.length-d1);f<a.length;f+=1)c(f);for(let f=0;f<a.length&&s.size<ir;f+=1){const d=a[f];if(!d.matches("a,button,input,select,textarea,summary,[role],svg,svg *,canvas,img,picture,video,audio,iframe"))continue;c(f);let p=d.parentElement;for(let y=0;p!==null&&y<3;y+=1)c(a.indexOf(p)),p=p.parentElement}const r=ir-s.size;if(r>0){const f=(a.length-1)/Math.max(1,r-1);for(let d=0;d<r;d+=1)c(Math.round(d*f))}return[...s].sort((f,d)=>f-d)}function s2(a,s){if(s.getPropertyValue("animation-name").trim()!=="none")return!0;try{return(a.getAnimations?.()??[]).some(c=>c.playState==="running")}catch{return!1}}function o2(a,s){if(s)return"rect:animated";let c;try{c=a.getBoundingClientRect()}catch{return"rect:?"}const r=a.ownerDocument.defaultView,f=r?.getComputedStyle(a).position,d=f==="fixed"?0:r?.scrollX??0,p=f==="fixed"?0:r?.scrollY??0;return`rect:${sr(c.left+d)},${sr(c.top+p)},${sr(c.width)},${sr(c.height)}`}function u2(a){const s=[];for(const r of l2){const f=a.getAttribute(r);f!==null&&s.push(`${r}:${yr(f)}`)}const c=a.tagName;if(["A","AUDIO","IFRAME","IMG","SOURCE","VIDEO"].includes(c))for(const r of["href","src","srcset","poster"]){const f=a.getAttribute(r);f!==null&&s.push(`${r}:${yr(f)}`)}if(c==="CANVAS"){const r=a;s.push(`bitmap:${r.width}x${r.height}`)}return s.join(",")}function m1(a,s,c){let r;try{r=c(a,s)}catch{return""}const f=r.getPropertyValue("content").trim();return f===""||f==="none"||f==="normal"?"":`${s}{${n2.map(d=>`${d}:${yr(r.getPropertyValue(d))}`).join(";")}}`}function r2(a,s){if(!a)return[];const c=[a,...Array.from(a.querySelectorAll("*"))].filter(r=>!a2(r));return i2(c).map(r=>{const f=c[r],d=s(f),p=s2(f,d),y=e2.map(D=>{const M=p&&t2.has(D)?"<animated>":yr(d.getPropertyValue(D));return`${D}:${M}`}).join(";"),v=f.getAttribute("role"),g=f.getAttribute("type"),S=[v&&`role:${v}`,g&&`type:${g}`].filter(Boolean).join(","),C=m1(f,"::before",s),T=m1(f,"::after",s);return`${f.tagName}${S?`[${S}]`:""}{${o2(f,p)};${y};${u2(f)};${C};${T}}`})}function c2(a,s){if(!a)return[];const c=[];let r=a;for(let f=0;f<4;f+=1){const d=s(r);c.push(`${d.backgroundColor};${d.backgroundImage};${d.color}`);const p=Array.from(r.children).filter(v=>!Sm.has(v.tagName??"")),y=p.length===1?p[0]:void 0;if(y===void 0)break;r=y}return c}function f2(a){const s=new Map;for(const[r,f]of Object.entries(a)){if(f===null)continue;const d=s.get(f);d?d.push(r):s.set(f,[r])}const c={};for(const r of s.values())if(!(r.length<2))for(const f of r)c[f]=r.filter(d=>d!==f);return c}function Em(a,s){const c=s[a.title];return c?.url===a.url?c:null}function Df(a,s){let c=null;for(const r of s)r in a&&(c??={...a},delete c[r]);return c??a}function d2(a,s){const c=[];for(const[r,f]of s){const d=a.get(r);d!==void 0&&d!==f&&c.push(r)}return c}function h2(a,s,c){const r=c.status==="complete"?{url:s.url,status:"complete",signature:c.signature}:{url:s.url,status:"failed"},f=a[s.title],d=f?.status==="failed"&&r.status==="failed"||f?.status==="complete"&&r.status==="complete"&&f.signature===r.signature;return f?.url===r.url&&d?a:{...a,[s.title]:r}}function m2(a,s){const c={};for(const r of a){const f=Em(r,s);f?.status==="complete"&&(c[r.title]=f.signature)}return c}function p2(a,s){return a.filter(c=>c.url?.startsWith("/")?Em(c,s)===null:!1)}const p1=24,g2=10,g1=44;function x2(a,s){const c=(r,f)=>{const d=Math.min(p1,f/2),p=Math.max(d,f-p1);return Math.max(d,Math.min(p,r))};return{x:c(a.x,s.width),y:c(a.y,s.height)}}function y2(a){return{x:a.x-g1/2,y:a.y-g1/2}}function v2(a,s,c=g2){return Math.abs(s.x-a.x)>c||Math.abs(s.y-a.y)>c}function b2(a,s){const c=a.x<s.width/2,r=a.y<s.height/2;return r&&c?{corner:"top-left"}:r?{corner:"top-right"}:c?{corner:"bottom-left"}:{corner:"bottom-right"}}function w2(a,s,c){const r=new Set([a]);let f=s.get(a);for(;f!==void 0&&!r.has(f);){if(c.has(f))return f;r.add(f),f=s.get(f)}return null}function S2(a,s){const c=new Set(a),r=new Map,f=new Map,d=[];for(const v of a){const g=w2(v,s,c);if(g===null){d.push(v);continue}r.set(v,g);const S=f.get(g);S?S.push(v):f.set(g,[v])}const p=new Set,y=v=>{if(!p.has(v)){p.add(v);for(const g of f.get(v)??[])y(g)}};for(const v of d)y(v);for(const v of a){if(p.has(v))continue;const g=r.get(v);g!==void 0&&(f.set(g,(f.get(g)??[]).filter(S=>S!==v)),r.delete(v)),d.push(v),y(v)}return{children:f,parentOf:r,roots:d}}function x1(a,s,c){const r=S2(a,s),f=S=>(r.children.get(S)??[]).reduce((C,T)=>C+f(T),1),d=[],p=[],y=()=>{const S=p.indexOf(null);return S!==-1?S:(p.push(null),p.length-1)},v=(S,C,T,D)=>{const M=c.has(S)?[]:r.children.get(S)??[],U=p.flatMap((Q,X)=>Q!==null&&X!==T?[X]:[]),[H,...R]=M,K=R.map(Q=>{const X=y();return p[X]=Q,{kid:Q,lane:X}});if(d.push({title:S,depth:C,lane:T,fromAbove:D,toBelow:H!==void 0,forks:K.map(Q=>Q.lane),through:U}),H===void 0){p[T]=null;return}v(H,C+1,T,!0);for(const Q of K)v(Q.kid,C+1,Q.lane,!0)};for(const S of r.roots){const C=y();p[C]=S,v(S,0,C,!1)}const g=new Map(d.map(S=>[S.title,{depth:S.depth,variants:S.depth===0?f(S.title)-1:0,descendants:f(S.title)-1,folded:c.has(S.title),graph:S}]));return{rows:d.map(S=>S.title),meta:g,parents:r.parentOf,children:r.children,roots:r.roots}}function j2(a,s,c,r,f){const d=(a.length?a:s).filter(y=>y!==c),p=r!==null&&d.includes(r)?d.indexOf(r):Math.max(-1,...f.flatMap(y=>y===c?[]:[d.indexOf(y)]))+1;return d.splice(p,0,c),d}function kf(a){const s=["mark"];a.fromAbove&&s.push("above"),a.toBelow&&s.push("below");for(const c of a.forks)s.push(`fork:${c}`);for(const c of a.through)s.push(`through:${c}`);return s}function E2(a,s){const c=[s];for(let r=a.get(s);r!==void 0&&!c.includes(r);r=a.get(r))c.unshift(r);return c}function C2(a,s,c){const r=E2(a,c),f=[...r],d=[];if(r.forEach((v,g)=>{const S=r[g+1];S!==void 0&&d.push([v,S])}),r.length>1)return{nodes:f,edges:d};const p=new Set(f),y=v=>{for(const g of s.get(v)??[])p.has(g)||(p.add(g),f.push(g),d.push([v,g]),y(g))};return y(c),{nodes:f,edges:d}}function N2(a,s,c){const r=new Map,f=(d,p)=>{const y=r.get(d);y?y.add(p):r.set(d,new Set([p]))};for(const d of c.nodes)s.has(d)&&f(d,"mark");for(const[d,p]of c.edges){if(!s.has(d)||!s.has(p))continue;const y=s.get(p)?.graph?.lane??0;f(d,s.get(d)?.graph?.lane===y?"below":`fork:${y}`);for(const v of a.slice(a.indexOf(d)+1,a.indexOf(p)))f(v,`through:${y}`);f(p,"above")}return r}function M2(a){let s=-1;for(const{graph:c}of a.values())c!==null&&(s=Math.max(s,c.lane,...c.forks,...c.through));return s}function Cm(a,s){const c=[],r=new Set([a]);let f=s.get(a);for(;f!==void 0&&!r.has(f);)c.unshift(f),r.add(f),f=s.get(f);return c}function A2(a,s=3){return a.length<=s?{head:[...a],hidden:[],tail:[]}:{head:[a[0]],hidden:a.slice(1,-1),tail:[a[a.length-1]]}}const y1=a=>Math.round(a*100)/100,vr=.5523,zf=4,T2=([a,s],c,r)=>[[a,s],[a,s+vr*c],[a+r*(c-vr*c),s+c],[a+r*c,s+c]],D2=([a,s],c,r)=>[[a,s],[a+r*vr*c,s],[a+r*c,s+c-vr*c],[a+r*c,s+c]],k2=(a,s)=>[a,[a[0]+(s[0]-a[0])/3,a[1]+(s[1]-a[1])/3],[a[0]+(s[0]-a[0])*2/3,a[1]+(s[1]-a[1])*2/3],s];function Nm(a,s,c){const r=Math.abs(c-a),f=c>a?1:-1,d=r/2,p=[a,s+zf],y=[a+f*d,s+zf+d];return{knee:s+zf+r,segments:[k2([a,s],p),T2(p,d,f),D2(y,d,f)]}}function Mm(a,s,c){return Nm(a,s,c).knee}const z2=([a,s,c,r],f)=>{const d=1-f;return[d*d*d*a[0]+3*d*d*f*s[0]+3*d*f*f*c[0]+f*f*f*r[0],d*d*d*a[1]+3*d*d*f*s[1]+3*d*f*f*c[1]+f*f*f*r[1]]};function R2([a,s,c,r],f){const d=(C,T)=>[C[0]+(T[0]-C[0])*f,C[1]+(T[1]-C[1])*f],p=d(a,s),y=d(s,c),v=d(c,r),g=d(p,y),S=d(y,v);return[d(g,S),S,v,r]}function Am(a,s,c,r=0){const{segments:f}=Nm(a,s,c);let d=r;const p=[];for(const g of f){if(d<=0){p.push(g);continue}const S=48;let C=0,T=g[0],D=null;for(let M=1;M<=S;M+=1){const U=z2(g,M/S),H=Math.hypot(U[0]-T[0],U[1]-T[1]);if(C+H>=d){D=(M-1+(d-C)/H)/S;break}C+=H,T=U}if(D===null){d-=C;continue}d=0,p.push(R2(g,D))}const y=p[0];if(y===void 0)return"";const v=g=>`${y1(g[0])} ${y1(g[1])}`;return`M ${v(y[0])} ${p.map(g=>`C ${v(g[1])}, ${v(g[2])}, ${v(g[3])}`).join(" ")}`}function O2(a){let s="";for(let c=1;c<a.length;c+=1){const[r,f]=[a[c-1],a[c]],d=r.clear??0,p=r.y+d,y=f.y-(f.clear??0);if(y<=p)continue;if(f.x===r.x){s+=`${s?" ":""}M ${r.x} ${p} L ${f.x} ${y}`;continue}const v=Mm(r.x,r.y,f.x);if(v>y){s+=`${s?" ":""}M ${r.x} ${p} L ${f.x} ${y}`;continue}const g=Am(r.x,r.y,f.x,d);s+=`${s?" ":""}${g===""?`M ${f.x} ${v}`:g} L ${f.x} ${y}`}return s}const br=10,wr=4,Tm=44,L2=8,_2=10,v1=4,B2="#4A4A54",U2="#41414A",H2="#8E8E98",b1="#7C7C85",$2="#D1D5DB",w1="#E8E8EA",or="160ms cubic-bezier(0.2, 0.7, 0.2, 1)";function q2(a){return a<0?0:Math.max(Tm,wr+a*br+10)}const S1=16,Y2=Tm-12,G2=2,X2=8;function Q2(a){let s=0,c=0;for(const{descendants:r,graph:f}of a.values())if(f!==null&&(f.fromAbove||f.toBelow||f.forks.length>0||r>0))if(f.depth===0)s=Math.max(s,S1,wr+Math.max(0,...f.forks)*br+G2);else{const d=Math.max(f.lane,...f.forks,...f.through);c=Math.max(c,Y2,wr+d*br+X2)}return c>0&&(s=Math.max(s,S1)),{root:s,variant:c}}function V2({active:a,arriving:s=!1,bloom:c=0,delay:r=0,family:f=!1,folded:d=!1,fresh:p,lit:y,row:v,tint:g="#FB7185",width:S,working:C=!1}){const T=P=>wr+P*br,D=T(v.lane),M=v1+L2+_2,U=v1,H=P=>y?.has(P)??!1,R=H("mark"),K=v.fromAbove||v.toBelow||v.forks.length>0||f,X=a||v.forks.length>0||!v.fromAbove||!v.toBelow?v.depth===0?3.5:3:C?3:1.5,ae=a?X+5:0,ne=[];for(const P of v.through)ne.push({key:`t${P}`,lane:P,segment:`through:${P}`,kind:"line",x:T(P),y1:0,y2:"100%"});v.fromAbove&&ne.push({key:"a",lane:v.lane,segment:"above",kind:"line",x:D,y1:0,y2:M-ae}),v.toBelow&&ne.push({key:"b",lane:v.lane,segment:"below",kind:"line",x:D,y1:M+ae,y2:"100%"});for(const P of v.forks){const ye=Mm(D,M,T(P)),fe=Am(D,M,T(P),ae);fe!==""&&ne.push({key:`fc${P}`,lane:P,segment:`fork:${P}`,kind:"path",d:fe}),ne.push({key:`ft${P}`,lane:P,segment:`fork:${P}`,kind:"line",x:T(P),y1:ye,y2:"100%"})}const I=(P,ye)=>P.kind==="line"?u.jsx("line",{pathLength:1,x1:P.x,x2:P.x,y1:P.y1,y2:P.y2,...ye},P.key):u.jsx("path",{d:P.d,pathLength:1,...ye},P.key),b=P=>({className:p?.has(P.segment)?"leglas-draw":void 0,style:{animationDelay:`${r}ms`,stroke:H(P.segment)?H2:P.lane>0?U2:B2,transition:`stroke ${or}`}}),ie=s;return u.jsx("span",{"aria-hidden":!0,className:"pointer-events-none absolute inset-y-0 left-0",style:{width:S},children:u.jsxs("svg",{className:"absolute left-0 overflow-visible [shape-rendering:geometricPrecision]",fill:"none",strokeWidth:1.25,style:{height:`calc(100% + ${U*2}px)`,top:-U,width:S},children:[ne.map(P=>I(P,b(P))),K&&u.jsxs(u.Fragment,{children:[a&&u.jsx("circle",{cx:D,cy:M,fill:"none",r:X+2.5,stroke:w1,strokeWidth:1.25,style:{transition:`r ${or}`}}),u.jsx("circle",{className:C?"leglas-breathe":p?.has("mark")?"leglas-pop":void 0,cx:D,cy:M,"data-mark":"",fill:C?g:a?w1:R?$2:b1,r:a?Math.max(2,X-1):X,stroke:"none",style:{animationDelay:`${r+120}ms`,transition:`fill ${or}, r ${or}`}}),d&&[8,14,20].map((P,ye)=>u.jsx("circle",{cx:D,cy:M+P,fill:b1,opacity:.6-ye*.18,r:1,stroke:"none"},P)),(ie||c>0)&&u.jsx("circle",{className:"leglas-bloom",cx:D,cy:M,fill:g,r:X,stroke:"none"},`bloom-${c}-${ie?"landed":""}`)]})]})})}const j1=200;function Z2({askedFor:a,chain:s,displayName:c,onCompare:r,onGo:f,onRail:d,onTrace:p,openAsk:y=!1,self:v,tint:g,traced:S=null}){const[C,T]=w.useState(!1),[D,M]=w.useState(!1),[U,H]=w.useState(!0),R=w.useRef(null);w.useEffect(()=>()=>{R.current&&clearTimeout(R.current)},[]);const K=()=>{const I=window.matchMedia("(prefers-reduced-motion: reduce)").matches;H(I),M(b=>!b),R.current&&clearTimeout(R.current),R.current=setTimeout(()=>H(!0),I?0:j1+20)},Q=C?{head:[...s],hidden:[],tail:[]}:A2(s),X=u.jsx("span",{"aria-hidden":!0,className:"select-none text-[#84848C]/50",children:"›"}),ae=I=>{const b=c(I);return d(I)?u.jsx(Je,{label:u.jsxs(u.Fragment,{children:[u.jsxs("span",{className:"block",children:["Go to ",b]}),u.jsx("span",{className:"block text-[#9CA3AF]",children:"Shift-click to compare"})]}),children:u.jsx("button",{className:`max-w-36 truncate rounded text-left transition-colors duration-150 hover:text-[#E8E8EA] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[#D1D5DB]/60 ${S===I?"text-[#E8E8EA]":""}`,onClick:ie=>ie.shiftKey?r(I):f(I),onPointerEnter:()=>p?.(I),onPointerLeave:()=>p?.(null),type:"button",children:b})}):u.jsx("span",{className:"max-w-36 truncate text-[#84848C]/70",title:`${b} is not on the rail`,children:b})},ne=a===null?null:`You asked for “${a}”`;return u.jsxs("div",{className:"px-3 pb-2",children:[u.jsxs("nav",{"aria-label":`Where ${c(v)} came from`,className:"flex flex-wrap items-center gap-x-1 gap-y-0.5 text-[10px] leading-snug text-[#84848C]",children:[Q.head.map(I=>u.jsxs(w.Fragment,{children:[ae(I),X]},I)),Q.hidden.length>0&&u.jsxs(u.Fragment,{children:[u.jsx(Je,{label:u.jsx(u.Fragment,{children:Q.hidden.map(I=>u.jsx("span",{className:"block",children:c(I)},I))}),wide:!0,children:u.jsx("button",{"aria-label":`Show the ${Q.hidden.length} directions between`,className:"rounded px-0.5 tracking-widest transition-colors hover:text-[#D1D5DB] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[#D1D5DB]/60",onClick:()=>T(!0),type:"button",children:"…"})}),X]}),Q.tail.map(I=>u.jsxs(w.Fragment,{children:[ae(I),X]},I)),u.jsxs("span",{className:`inline-flex max-w-36 items-center gap-1 truncate transition-colors duration-150 ${S===v?"text-[#E8E8EA]":"text-[#D1D5DB]"}`,children:[g!==void 0&&u.jsx("span",{"aria-hidden":!0,className:"inline-block size-[5px] shrink-0 rounded-full",style:{background:g}}),c(v)]})]}),ne===null?null:y?u.jsx("button",{"aria-expanded":D,"aria-label":D?"Show less of the request":"Show the whole request",className:"mt-0.5 block w-full cursor-pointer overflow-hidden text-left text-[10px] leading-snug text-[#84848C] transition-[max-height,color] ease-out hover:text-[#A1A1AA] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[#D1D5DB]/60 motion-reduce:transition-none",onClick:K,style:{maxHeight:D?96:14,transitionDuration:`${j1}ms`},type:"button",children:u.jsx("span",{className:!D&&U?"line-clamp-1":"block",children:ne})}):u.jsx("p",{className:"mt-0.5 min-w-0 truncate text-[10px] leading-snug text-[#84848C]",title:a??"",children:ne})]})}const ur=320,K2=22,Eo=240,F2=150,J2=2600,W2=5200,I2=2200,E1=900,C1=420,hr={current:["#FB7185","#FB923C","#F9A8D4","#E879F9","#FB7185"],bloom:"#FECDD3"},P2=typeof performance<"u"?performance.now():0;function ey(a){const s=(f,d,p)=>3*f*p*(1-p)**2+3*d*p**2*(1-p)+p**3;let c=0,r=1;for(let f=0;f<24;f+=1){const d=(c+r)/2;s(.5,.2,d)<a?c=d:r=d}return s(0,1,(c+r)/2)}function N1({d:a,height:s,leaving:c=!1,marks:r,still:f=!1,width:d}){const p=w.useId().replace(/\W/g,""),y=`current-${p}`,v=`surge-${p}`,g=w.useRef(null),S=w.useRef(null),C=w.useRef(null),T=w.useRef([]),D=w.useRef(r);return D.current=r,w.useEffect(()=>{if(f)return;const M=g.current,U=S.current,H=C.current;if(!M||!U||!H)return;const R=D.current,K=Math.min(...R.map(ye=>ye.y)),Q=Math.max(...R.map(ye=>ye.y)),X=K-Eo,ae=Q+Eo,ne=Math.min(W2,Math.max(J2,(ae-X)/F2*1e3)),I=ne+I2,b=R.map(()=>-1/0);let ie=0;const P=ye=>{const fe=Math.max(0,ye-P2),Se=fe/1e3*K2;M.setAttribute("y1",`${Se%ur}`),M.setAttribute("y2",`${Se%ur+ur}`);const xe=fe%I,Te=xe<ne,O=X+(ae-X)*(Te?ey(xe/ne):1);U.setAttribute("y1",`${O-Eo/2}`),U.setAttribute("y2",`${O+Eo/2}`);const W=Math.min(1,xe/500),ue=Math.min(1,Math.max(0,(ne-xe)/700));H.setAttribute("opacity",`${Te?Math.min(W,ue).toFixed(3):"0"}`);const je=fe-xe;R.forEach((Ne,E)=>{const G=T.current[E];if(!G)return;Te&&O>=Ne.y&&(b[E]??-1/0)<je&&(b[E]=fe);const le=fe-(b[E]??-1/0),ce=le<E1?1-le/E1:0,oe=ce*ce*(3-2*ce);G.setAttribute("opacity",`${(oe*.75).toFixed(3)}`),G.setAttribute("r",`${(2.5+(1-oe)*6).toFixed(2)}`)}),ie=requestAnimationFrame(P)};return ie=requestAnimationFrame(P),()=>cancelAnimationFrame(ie)},[a,f]),u.jsxs("svg",{"aria-hidden":!0,className:"pointer-events-none absolute left-0 top-0 z-20",fill:"none",height:s,style:{animation:c||f?void 0:`leglas-arrive ${C1}ms ease-out both`,opacity:c?0:void 0,transition:f?void 0:`opacity ${C1}ms ease-in`},width:d,children:[u.jsxs("defs",{children:[u.jsx("linearGradient",{gradientUnits:"userSpaceOnUse",id:y,ref:g,spreadMethod:"repeat",x1:0,x2:0,y1:0,y2:ur,children:hr.current.map((M,U)=>u.jsx("stop",{offset:U/(hr.current.length-1),stopColor:M},U))}),u.jsxs("linearGradient",{gradientUnits:"userSpaceOnUse",id:v,ref:S,x1:0,x2:0,y1:-Eo,y2:0,children:[u.jsx("stop",{offset:"0",stopColor:"#FFFFFF",stopOpacity:0}),u.jsx("stop",{offset:"0.3",stopColor:"#F0F4FF",stopOpacity:.35}),u.jsx("stop",{offset:"0.5",stopColor:"#FFFFFF",stopOpacity:.95}),u.jsx("stop",{offset:"0.7",stopColor:"#F0F4FF",stopOpacity:.35}),u.jsx("stop",{offset:"1",stopColor:"#FFFFFF",stopOpacity:0})]})]}),u.jsxs("g",{stroke:`url(#${y})`,strokeLinecap:"round",strokeLinejoin:"round",children:[u.jsx("path",{d:a,opacity:.1,strokeWidth:7}),u.jsx("path",{d:a,opacity:.24,strokeWidth:3.5}),u.jsx("path",{d:a,opacity:.85,strokeWidth:1.75})]}),u.jsxs("g",{opacity:0,ref:C,stroke:`url(#${v})`,strokeLinecap:"round",strokeLinejoin:"round",children:[u.jsx("path",{d:a,opacity:.16,strokeWidth:9}),u.jsx("path",{d:a,opacity:.4,strokeWidth:4}),u.jsx("path",{d:a,opacity:.9,strokeWidth:1.75})]}),r.map((M,U)=>u.jsx("circle",{cx:M.x,cy:M.y,fill:hr.bloom,opacity:0,r:2.5,ref:H=>{T.current[U]=H}},`${M.x},${M.y}`))]})}const ty=3,Ge={action:6e3,plain:2600};function ny(a,s,c=ty){return[...a.filter(f=>f.kind!==s.kind),s].slice(-c)}function ly(a,s){return a.filter(c=>c.id!==s)}const M1=a=>a.trim().replace(/\s+/g," ").toLowerCase();function ay(a,s,c){const r=a.trim().replace(/\s+/g," "),f=c.get(s)??s;if(r===""||r===s)return f===s?{kind:"same"}:{kind:"reset",value:s};if(r===f)return{kind:"same"};for(const[d,p]of c)if(d!==s&&M1(p)===M1(r))return{kind:"taken",by:p};return{kind:"set",value:r}}function iy(a,s){try{return new URL(a,s).toString()}catch{return a}}function sy({displayName:a,preview:s,previewUrl:c,title:r}){const f=a===r?"":` (shown as ${JSON.stringify(a)})`,d=s?.note?` — ${s.note}`:"",p=s?.tags.length?` [${s.tags.join(", ")}]`:"",y=[`Leglas direction ${JSON.stringify(r)}${f}${d}${p}`];return s?.file?y.push(`Source: ${s.file}`):s?.branch?y.push(`Branch: ${s.branch}`):s&&y.push(`Route: ${s.url}`),y.push(`Preview: ${c}`),s?.basedOn&&y.push(`A variant of: ${s.basedOn}`),y.push("","Inspect this direction in full:",` npx leglas show ${JSON.stringify(r)} --json`),y.join(`
|
|
10
|
+
`)}function Dm(a){return a===void 0?"is not on the rail":a.branch!==void 0?"runs on its own port and can't be shared yet":null}function km(a,s,c){const r=new Set(s);return{order:[...s],renames:Object.fromEntries(Object.entries(a.renames).filter(([f])=>r.has(f))),collapsedFamilies:a.collapsedFamilies.filter(f=>r.has(f)),compare:c,viewport:a.viewport}}function A1(a,s,c="open",r=[]){const f=new Map(s.map(g=>[g.title,g])),d=new Set([...a.deleted,...a.hidden]),p=gm(a.order,s.map(g=>g.title)).filter(g=>!d.has(g)),y=[],v=[];for(const g of p)(Dm(f.get(g))===null?v:y).push(g);return{request:{scope:"rail",titles:v,layout:km(a,v,null),reach:c,routes:[...r]},leftOut:y}}function oy(a,s,c,r,f="open",d=[]){const p=new Map(s.map(S=>[S.title,S])),y=r===null||r===c?null:r,v=y===null?[c]:[c,y];if(c==="")return{request:null,reason:"Nothing is on stage yet"};for(const S of v){const C=Dm(p.get(S));if(C!==null)return{request:null,reason:`${a.renames[S]??S} ${C}`}}return{request:{scope:y===null?"direction":"compare",titles:v,layout:km(a,v,y),reach:f,routes:[...d]},reason:null}}function Rf(a,s){return a.length===s.length&&a.every((c,r)=>c===s[r])}function uy(a,s){if(a.scope!==s.scope||!Rf(a.titles,s.titles)||a.reach!==s.reach)return!1;const c=a.layout,r=s.layout,f=Object.entries(c.renames).toSorted(),d=Object.entries(r.renames).toSorted();return Rf(c.order,r.order)&&Rf([...c.collapsedFamilies].toSorted(),[...r.collapsedFamilies].toSorted())&&c.compare===r.compare&&c.viewport===r.viewport&&f.length===d.length&&f.every(([p,y],v)=>p===d[v]?.[0]&&y===d[v]?.[1])}function Hf(a){return JSON.stringify({collapsedFamilies:a.collapsedFamilies,order:a.order,renames:a.renames,viewport:a.viewport})}function ry(a,s,c){const r=pm(Hf(s),c);return{...a,collapsedFamilies:r.collapsedFamilies,order:r.order,renames:r.renames,viewport:r.viewport}}function zm(a,s,c){return a==="rail"?`The whole rail · ${s.length} direction${s.length===1?"":"s"}`:s.map(c).join(" + ")}function Rm(a){return a===0?"nobody on it yet":a===1?"1 watching":`${a} watching`}function cy(a,s,c){const r=new Set(s),f=new Set;for(const d of a){const p=d.dataset.preview;if(p===void 0||!r.has(p))continue;let y=[];try{y=d.contentWindow?.performance.getEntriesByType("resource")??[]}catch{continue}for(const v of y)try{const{origin:g,pathname:S}=new URL(v.name);if(g!==c)continue;f.add(S)}catch{}}return[...f].toSorted()}function fy(a){const s=a.lastIndexOf("/");return s<=0?null:a.slice(0,s+1)}function dy(a){return a.reduce((s,c)=>s+c.viewers,0)}function hy(a,s){const c=a-s;if(c<=0)return"expired";const r=Math.round(c/6e4);return r<60?`${Math.max(1,r)}m left`:`${Math.round(c/36e5)}h left`}function my(a,s){return a.trim()===""?`Link ${s+1}`:a}function py(a){const s=new URLSearchParams(a),c=s.get("direction");if(c===null||c==="")return null;const r=s.get("compare");return{direction:c,compare:r===null||r===""||r===c?null:r}}function gy(a){const s=new URL(a);return s.searchParams.delete("direction"),s.searchParams.delete("compare"),`${s.pathname}${s.search}${s.hash}`}function xy(a,s,c){const r=g=>g!==null&&!s.deleted.includes(g)&&c.some(S=>S.title===g),[f=null,d=null]=[a.direction,a.compare].filter(r),p=new Set([f,d].filter(g=>g!==null)),y=new Map(c.flatMap(g=>g.basedOn===void 0?[]:[[g.title,g.basedOn]])),v=new Set([...p].flatMap(g=>Cm(g,y)));return{prefs:p.size===0?s:{...s,hidden:s.hidden.filter(g=>!p.has(g)),collapsedFamilies:s.collapsedFamilies.filter(g=>!v.has(g))},direction:f,compare:d,missing:[a.direction,a.compare].filter(g=>g!==null&&!r(g))}}async function ka(a,s){const c=await a.json().catch(()=>null),r=ri(c)?c.error:null;return new Error(Wn(r)?r:s)}function qt(a){return a.json()}async function Kf(a,s,c){const r=await fetch(a,{body:JSON.stringify(s),headers:{"content-type":"application/json"},method:"POST"});if(!r.ok)throw await ka(r,c);return qt(r)}function yy({previews:a,project:s,onToggleSplit:c,onToggleHelp:r,onToggleTools:f,onToggleNote:d,suspended:p=!1,viewer:y,link:v=null}){const g=Ig(s),[S]=w.useState(()=>{const Z=pm(y!==void 0?Hf(y.layout):typeof window>"u"?null:window.localStorage.getItem(g),a),de=v===null||y!==void 0?null:xy(v,Z,a),Ce=de?.prefs??Z,Oe=new Set(Ce.hidden);return{prefs:Ce,active:de?.direction??Ce.order.find(ve=>!Oe.has(ve))??Ce.order[0]??"",linked:de?.direction??null,compare:de?.compare??null,missing:de?.missing??[]}}),[C,T]=w.useState(S.prefs),D=new Map(a.map(Z=>[Z.title,Z])),[M,U]=w.useState(S.active),H=typeof window<"u"&&window.self!==window.top,[R,K]=w.useState(()=>[S.active]),[Q,X]=w.useState(""),[ae,ne]=w.useState([]),I=Z=>{ne(de=>de.length?[]:de),X(Z)},[b,ie]=w.useState(!1),[P,ye]=w.useState(()=>new Set),[fe,Se]=w.useState(null),[xe,Te]=w.useState(null),[O,W]=w.useState(null),[ue,je]=w.useState(!1),[Ne,E]=w.useState({}),[G,le]=w.useState([]),[ce,oe]=w.useState(null),Ee=w.useRef(1),L=w.useRef(null),V=w.useRef(0),se=Z=>{V.current+=1,le(de=>ny(de,{...Z,id:V.current}))},pe=Z=>le(de=>ly(de,Z)),Ae=Z=>{U(Z),K(de=>de.includes(Z)?de:[...de,Z])};w.useEffect(()=>{y===void 0&&window.localStorage.setItem(g,JSON.stringify(C))},[C,g,y]),w.useEffect(()=>{if(y!==void 0)return;const Z=new URLSearchParams(window.location.search);if((Z.has("direction")||Z.has("compare"))&&window.history.replaceState(window.history.state,"",gy(window.location.href)),v===null)return;[...document.querySelectorAll("li[data-title]")].find(Ce=>Ce.dataset.title===S.linked)?.scrollIntoView({block:"nearest"}),S.missing.length>0&&se({kind:"link",message:`The link asked for ${S.missing.join(" and ")}, ${S.missing.length===1?"which isn't":"which aren't"} on this rail`,tone:"info",ttl:Ge.plain})},[]);const Ve=y===void 0?null:Hf(y.layout),[st,ot]=w.useState(Ve);Ve!==st&&(ot(Ve),y!==void 0&&T(Z=>ry(Z,y.layout,a))),w.useEffect(()=>()=>{L.current&&clearTimeout(L.current)},[]);const _e=Z=>C.renames[Z]??Z,Ze=Z=>D.get(Z)?.url??"/",Tt=Z=>{const de=D.get(Z);return de?.branch===void 0?null:de.state??{status:"idle"}},ln=Z=>{y===void 0&&fetch("/leglas/api/previews/start",{body:JSON.stringify({title:Z}),headers:{"content-type":"application/json"},method:"POST"}).catch(()=>{})},an=Z=>{if(!Q.trim())return!0;const de=Q.toLowerCase(),Ce=D.get(Z);return _e(Z).toLowerCase().includes(de)||Z.toLowerCase().includes(de)||(Ce?.note??"").toLowerCase().includes(de)||(Ce?.tags??[]).some(Oe=>Oe.toLowerCase().includes(de))},mn=a.map(Z=>Z.title).filter(Z=>!C.deleted.includes(Z)),Un=gm(C.order,mn),Gl=Q.trim()!=="",ms=Gl?ae:C.collapsedFamilies,ft=new Map(a.flatMap(Z=>Z.basedOn===void 0?[]:[[Z.title,Z.basedOn]])),In=Un.filter(Z=>!C.hidden.includes(Z)&&an(Z)),{rows:pn,meta:za,parents:Hn,children:mt,roots:cl}=x1(In,ft,new Set([...ms,...P])),mi=Q2(x1(In,ft,new Set).meta),pi=(Z,de,Ce)=>T(Oe=>({...Oe,order:j2(Oe.order,a.map(ve=>ve.title),Z,de,Ce)})),fl=Z=>Cm(Z,ft),Rt=M2(za),gn=(Z,de)=>Z.includes(de)?Z.filter(Ce=>Ce!==de):[...Z,de],jt=Z=>Gl?ne(de=>gn(de,Z)):T(de=>({...de,collapsedFamilies:gn(de.collapsedFamilies,Z)})),gi=Z=>D.get(Z)?.basedOn??null,xi=Un.filter(Z=>!C.hidden.includes(Z)).length,Ra=(Z,de=!1)=>{T(Ce=>({...Ce,hidden:Ce.hidden.filter(Oe=>Oe!==Z)})),de&&Ae(Z)},dl=Z=>{const de=_e(Z),Ce=M===Z;if(T(Oe=>({...Oe,hidden:[...Oe.hidden,Z]})),Ce){const Oe=Un.find(ve=>ve!==Z&&!C.hidden.includes(ve));Oe&&Ae(Oe)}se({action:{label:"Undo",run:()=>Ra(Z,Ce)},kind:`remove:${Z}`,message:`${de} removed from the list`,tone:"info",ttl:Ge.action})},hl=async Z=>{const de=[...new Set(Z)].filter(ve=>C.hidden.includes(ve)),Ce=de.filter(ve=>D.get(ve)?.local===!0);if(Ce.length>0){const ve=await fetch("/leglas/api/previews/delete",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({titles:Ce})});if(!ve.ok)throw await ka(ve,"The directions could not be deleted from Leglas.")}const Oe=new Set(de);if(T(ve=>Pg(ve,de)),K(ve=>ve.filter(We=>!Oe.has(We))),de.includes(M)){const ve=Un.find(We=>!Oe.has(We)&&!C.hidden.includes(We));U(ve??"")}C.hidden.every(ve=>Oe.has(ve))&&ie(!1)},ml=(Z,de)=>T(Ce=>{const Oe={...Ce.renames};return de===void 0?delete Oe[Z]:Oe[Z]=de,y!==void 0?{...Ce,renames:Oe}:(fetch("/leglas/api/renames",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({renames:Oe})}).catch(()=>{}),{...Ce,renames:Oe})}),Kt=Z=>{Se(Z),Te(null)},Mn=(Z,de,Ce="submit")=>{const Oe=new Map(mn.map(Ie=>[Ie,_e(Ie)])),ve=ay(de,Z,Oe);if(ve.kind==="taken"){if(Ce==="submit"){Te(`${ve.by} already goes by that name.`);return}Kt(null),se({kind:`rename:${Z}`,message:`Still called ${_e(Z)}. ${ve.by} already goes by that name.`,tone:"info",ttl:Ge.plain});return}if(Kt(null),ve.kind==="same")return;const We=C.renames[Z];ml(Z,ve.kind==="reset"?void 0:ve.value),se({action:{label:"Undo",run:()=>ml(Z,We)},kind:`rename:${Z}`,message:ve.kind==="reset"?`Name reset to ${ve.value}`:`Renamed to ${ve.value}`,tone:"success",ttl:Ge.action})};w.useEffect(()=>{const Z=pn,de=ve=>{const We=ve.target,Ie=We?.tagName?.toLowerCase(),Re=Mx({key:ve.key,altKey:ve.altKey,ctrlKey:ve.ctrlKey,metaKey:ve.metaKey,shiftKey:ve.shiftKey,typing:Ie==="input"||Ie==="textarea"||Ie==="select"||(We?.isContentEditable??!1)});if(Re&&!(p&&Re.kind!=="help")&&!(y!==void 0&&(Re.kind==="request"||Re.kind==="note"))){if(Re.kind==="search"||Re.kind==="request")ve.preventDefault(),T(ct=>ct.collapsed?{...ct,collapsed:!1}:ct),oe({target:Re.kind,nonce:Ee.current++});else if(Re.kind==="split")ve.preventDefault(),c?.();else if(Re.kind==="help")ve.preventDefault(),r?.();else if(Re.kind==="tools")ve.preventDefault(),f?.();else if(Re.kind==="note")ve.preventDefault(),d?.();else if(Re.kind==="rail")T(ct=>({...ct,collapsed:!ct.collapsed}));else if(Re.kind==="jump"){const ct=Z[Re.index];ct&&(ve.preventDefault(),Ae(ct))}else if(Re.kind==="move"){ve.preventDefault();const ct=Z.indexOf(M),tl=Re.delta===1?Z[Math.min(Z.length-1,ct+1)]:Z[Math.max(0,ct-1)];tl&&Ae(tl)}}},Ce=[window];for(const ve of Array.from(document.querySelectorAll("iframe")))try{const We=ve.contentDocument;We&&Ce.push(We)}catch{}const Oe=de;for(const ve of Ce)ve.addEventListener("keydown",Oe);return()=>{for(const ve of Ce)ve.removeEventListener("keydown",Oe)}},[M,pn.join("|"),c,r,f,d,p,R.join("|"),Object.entries(Ne).filter(([,Z])=>Z).map(([Z])=>Z).join("|")]);const Ft=(Z,de)=>{const Ce=iy(Ze(Z),window.location.origin),Oe=de==="link"?Ce:sy({displayName:_e(Z),preview:D.get(Z),previewUrl:Ce,title:Z});Sr(Oe).then(ve=>{if(ve==="blocked"){W(null),se({detail:Ce,kind:"copy",message:"Your browser blocked the clipboard. The direction is at:",tone:"danger",ttl:null});return}W({kind:de,title:Z}),L.current&&clearTimeout(L.current),L.current=setTimeout(()=>W(null),1200),se({kind:"copy",message:de==="link"?`Link to ${_e(Z)} copied`:`Reference to ${_e(Z)} copied`,tone:"success",ttl:Ge.plain})})},$n=Z=>Ft(Z,"link"),yi=Z=>Ft(Z,"reference"),Pn=Z=>{Z.preventDefault();const de=Z.currentTarget;de.setPointerCapture(Z.pointerId);const Ce=Z.clientX,Oe=C.width;je(!0);const ve=Ie=>{const Re=Math.min(dm,Math.max(fm,Oe+Ie.clientX-Ce));T(ct=>ct.width===Re?ct:{...ct,width:Re})},We=Ie=>{de.releasePointerCapture(Ie.pointerId),de.removeEventListener("pointermove",ve),de.removeEventListener("pointerup",We),de.removeEventListener("pointercancel",We),je(!1)};de.addEventListener("pointermove",ve),de.addEventListener("pointerup",We),de.addEventListener("pointercancel",We)},Yt=(Z,de)=>E(Ce=>kx(Ce,Z,de)),rt=(Z,de)=>Dx(Ne,Z,de),pl=Z=>E(de=>zx(de,Z)),el=H?[M]:mn.filter(Z=>R.includes(Z));return{active:M,linkedCompare:S.compare,ancestryOf:fl,copied:O,copyLink:$n,copyReference:yi,deleteRemoved:hl,displayName:_e,dismissToast:pe,dragFolded:P,focusing:ce,hiddenCount:C.hidden.length,hide:dl,isLoaded:rt,lanes:Rt,insets:mi,loaded:Ne,markLoaded:Yt,matches:an,nested:H,notify:se,onHandlePointerDown:Pn,panes:el,prefs:C,railChildren:mt,railParents:Hn,railRoots:cl,reorderAmong:pi,previewFor:Z=>D.get(Z),query:Q,rename:Mn,renameError:xe,renaming:fe,parentOf:gi,resetLoaded:pl,resizing:ue,restore:Ra,rowMeta:za,rows:pn,toggleFamily:jt,setActive:Ae,setDragFolded:ye,setPrefs:T,setQuery:I,setShowHidden:ie,showHidden:b,startRename:Kt,toasts:G,urlFor:Ze,branchState:Tt,startBranch:ln,visibleCount:xi,viewports:mm,viewing:y!==void 0}}function T1(a){const s=a?.trim()??"";return s===""?null:s}function $f(a){const s=T1(a?.basedOn),c=T1(a?.askedFor);return s===null&&c===null?null:{basedOn:s,askedFor:c}}function vy(a,s){const c=a===null?null:`Variant of ${a}`,r=s===null?null:`asked for “${s}”`;return c===null?r===null?null:`You ${r}`:r===null?c:`${c} · you ${r}`}const D1=80,by=6,wy=8;function Sy(a){if(a==null)return null;const s=a.trim();return/^[A-Za-z][\w-]*$/.test(s)?s:null}function jy(a){return Wn(a)?a.trim().split(/\s+/).filter(Boolean).slice(0,by):[]}function mr(a){const s=(a??"").replace(/\s+/g," ").trim();return s.length>D1?`${s.slice(0,D1-1)}…`:s}function Ey(a){const s=[];let c=a;for(;c!==null&&s.length<wy;){const r=c.tagName.toLowerCase();if(r==="body"||r==="html")break;const f=Sy(c.id);if(f!==null)return s.unshift(`#${f}`),s.join(" > ");const d=c.parentElement;if(d===null){s.unshift(r);break}let p=1;for(let y=0;y<d.children.length;y+=1){const v=d.children[y];if(v===c)break;v?.tagName===c.tagName&&(p+=1)}s.unshift(`${r}:nth-of-type(${p})`),c=d}return s.join(" > ")}function k1(a,s){return!Number.isFinite(a)||!Number.isFinite(s)||s<=0?.5:Math.round(Math.min(1,Math.max(0,a/s))*1e3)/1e3}function z1(a,s,c,r){return{classes:jy(a.className),rect:{height:Math.round(s.height),width:Math.round(s.width),x:Math.round(s.x),y:Math.round(s.y)},selector:Ey(a),spot:{x:r===void 0?.5:k1(r.x-s.x,s.width),y:r===void 0?.5:k1(r.y-s.y,s.height)},tag:a.tagName.toLowerCase(),text:mr(a.textContent),viewport:Math.round(c)}}const R1=6;function O1(a,s){return Math.abs(s.x-a.x)>=R1||Math.abs(s.y-a.y)>=R1}function L1(a,s){return{height:Math.abs(s.y-a.y),width:Math.abs(s.x-a.x),x:Math.min(a.x,s.x),y:Math.min(a.y,s.y)}}function Cy(a,s){return a.x<s.x+s.width&&a.x+a.width>s.x&&a.y<s.y+s.height&&a.y+a.height>s.y}function _1(a,s){return s.x>=a.x&&s.y>=a.y&&s.x+s.width<=a.x+a.width&&s.y+s.height<=a.y+a.height}function Ny(a,s){const c=a.width>0?a.width:1,r=a.height>0?a.height:1,f=d=>Math.round(Math.min(1,Math.max(0,d))*1e3)/1e3;return{height:f(s.height/r),width:f(s.width/c),x:f((s.x-a.x)/c),y:f((s.y-a.y)/r)}}function My(a,s){return{height:s.height*a.height,width:s.width*a.width,x:a.x+s.x*a.width,y:a.y+s.y*a.height}}function Ay(a){const s=a.gap??8,{anchor:c,bounds:r,card:f}=a,d=c.y+c.height+s,p=c.y-s-f.height,y=d+f.height>r.height&&p>=0,v=y?p:d;let g=c.x;return g+f.width>r.width&&(g=r.width-f.width),{flipped:y,left:Math.max(0,g),top:Math.max(0,Math.min(v,Math.max(0,r.height-f.height)))}}function Ty(a){return!Number.isFinite(a)||a<=0?256:Math.round(Math.min(256,Math.max(180,a-48)))}function Dy(a){if(a.length===0)return null;const s=Math.min(...a.map(d=>d.x)),c=Math.min(...a.map(d=>d.y)),r=Math.max(...a.map(d=>d.x+d.width));return{height:Math.max(...a.map(d=>d.y+d.height))-c,width:r-s,x:s,y:c}}const ky=8;function zy(a){const s=new Set,c=[];for(const r of a){const f=`${r.tag}:${r.text}`;if(!s.has(f)&&(s.add(f),c.push(r),c.length===ky))break}return c}const rr=2,Ry=4e3,B1=600,U1=80;function Oy(a){const s=a.note.length>U1?`${a.note.slice(0,U1-1)}…`:a.note;return[`Annotation ${a.number}`,s===""?null:`: ${s}`,a.sent?". Sent with a change.":null,a.stale?". Its element has gone.":null].filter(c=>c!==null).join("")}function Ly(a){const s=[a.stale?"This element has moved or gone since the annotation was left.":null,a.sent?"Already sent with a change that has not landed yet.":null].filter(c=>c!==null);return s.length===0?void 0:s.join(" ")}function Ta(a){return"left"in a?{height:a.height,width:a.width,x:a.left,y:a.top}:a}function _y(a,s){return s.x>=a.x&&s.y>=a.y&&s.x<=a.x+a.width&&s.y<=a.y+a.height}function By({notes:a,onExit:s,onForget:c,onKeep:r,onRevise:f,paneScale:d,scaling:p,sent:y,title:v}){const g=w.useRef(null),S=w.useRef(null),C=w.useRef(null),T=w.useRef(null),[D,M]=w.useState(null),[U,H]=w.useState(null),[R,K]=w.useState(null),Q=w.useRef(0),[X,ae]=w.useState(null),[ne,I]=w.useState(null),[b,ie]=w.useState([]),[P,ye]=w.useState({height:92,width:256}),fe=w.useCallback(()=>{const L=document.querySelector(`iframe[data-preview="${CSS.escape(v)}"]`);if(L===null)return null;let V=null;try{V=L.contentDocument}catch{return null}const se=V?.defaultView??null;if(V===null||se===null)return null;const pe=L.getBoundingClientRect();return{doc:V,rect:pe,scale:se.innerWidth>0?pe.width/se.innerWidth:1,view:se}},[v]),Se=w.useCallback((L,V)=>{const se=fe();return se===null?null:{x:(L-se.rect.left)/se.scale,y:(V-se.rect.top)/se.scale}},[fe]),xe=w.useCallback((L,V)=>{const se=L.doc.elementFromPoint(V.x,V.y);if(se===null)return null;const pe=new Set;let Ae=se,Ve=0;for(let _e=0;Ae!==null&&_e<3&&Ve<B1;_e+=1){pe.add(Ae);const Ze=L.doc.createTreeWalker(Ae,NodeFilter.SHOW_ELEMENT);let Tt=Ze.nextNode();for(;Tt!==null&&Ve<B1;){const ln=Tt;pe.has(ln)||(pe.add(ln),Ve+=1),Tt=Ze.nextNode()}Ae=Ae.parentElement}const st=_e=>{const Ze=_e.tagName.toLowerCase();return(mr(_e.textContent)===""?0:4)+(Ze==="a"||Ze==="button"||Ze==="img"?3:0)+(/^h[1-6]$/.test(Ze)||Ze==="p"||Ze==="li"?2:0)},ot=[...pe].flatMap(_e=>{const Ze=_e.tagName.toLowerCase();if(_e===L.doc.body||_e===L.doc.documentElement||Ze==="head"||Ze==="script"||Ze==="style")return[];const Tt=Ta(_e.getBoundingClientRect());if(Tt.width<=0||Tt.height<=0||!_y(Tt,V))return[];const ln=L.view.getComputedStyle(_e);return ln.display==="none"||ln.visibility==="hidden"?[]:[{box:Tt,element:_e,weight:st(_e)}]});return ot.length===0?null:(ot.sort((_e,Ze)=>{const Tt=_e.element.contains(Ze.element),ln=Ze.element.contains(_e.element);if(Tt!==ln)return Tt?1:-1;const an=Ze.weight-_e.weight;return an!==0?an:_e.box.width*_e.box.height-Ze.box.width*Ze.box.height}),ot[0]??null)},[]),Te=w.useCallback((L,V)=>{let se=null;try{se=L.doc.querySelector(V.selector)}catch{}const pe=Ta(se===null?V.rect:se.getBoundingClientRect()),Ae=V.spot??{x:.5,y:.5},Ve=V.region?My(pe,V.region):null;return{about:Ve??pe,box:Ve??{height:0,width:0,x:pe.x+Ae.x*pe.width,y:pe.y+Ae.y*pe.height},stale:se===null}},[]),O=w.useCallback(()=>{const L=fe();return L===null?[]:a.map((V,se)=>{const pe=Te(L,V.anchor);return{anchor:V.anchor,box:pe.box,id:V.id,note:V.note,number:se+1,region:V.anchor.region?pe.about:null,sent:y.has(V.id),stale:pe.stale}})},[Te,fe,a,y]),W=w.useCallback(()=>ie(O()),[O]),ue=w.useCallback(()=>{const L=C.current,V=fe();L===null||V===null||R!==null||M(xe(V,L)?.box??null)},[xe,fe,R]);w.useEffect(()=>{W();const L=fe(),V=()=>{W(),ue()};return L?.view.addEventListener("scroll",V,{passive:!0}),L?.view.addEventListener("resize",V),window.addEventListener("resize",V),()=>{L?.view.removeEventListener("scroll",V),L?.view.removeEventListener("resize",V),window.removeEventListener("resize",V)}},[fe,W,ue]),w.useEffect(()=>{const L=g.current;if(L===null)return;const V=se=>{const pe=fe();pe!==null&&(se.preventDefault(),pe.view.scrollBy({behavior:"auto",left:se.deltaX,top:se.deltaY}))};return L.addEventListener("wheel",V,{passive:!1}),()=>L.removeEventListener("wheel",V)},[fe]),w.useEffect(()=>{const L=Ae=>{if(Ae.key==="Escape"){if(R!==null){K(null);return}s()}},V=[window],se=fe();se!==null&&V.push(se.doc);const pe=L;for(const Ae of V)Ae.addEventListener("keydown",pe);return()=>{for(const Ae of V)Ae.removeEventListener("keydown",pe)}},[fe,s,R]),w.useEffect(()=>{R===null||R.kind!=="kept"||a.some(L=>L.id===R.id)||K({anchor:R.anchor,answered:!0,field:R.field,kind:"new",note:R.note})},[a,R]),w.useEffect(()=>{const L=S.current;if(R===null||L===null)return;const V=L.offsetHeight,se=L.offsetWidth;ye(pe=>pe.height===V&&pe.width===se?pe:{height:V,width:se})},[R]);const je=(L,V)=>{const se=[...L.doc.body.querySelectorAll("*")].slice(0,Ry),pe=se.filter(st=>{const ot=Ta(st.getBoundingClientRect());return ot.width>0&&ot.height>0&&Cy(V,ot)}),Ae=pe.filter(st=>!pe.some(ot=>ot!==st&&st.contains(ot))&&!_1(Ta(st.getBoundingClientRect()),V)&&(mr(st.textContent)!==""||["a","button","canvas","img","input","svg","video"].includes(st.tagName.toLowerCase())));let Ve=L.doc.body;for(const st of se){const ot=Ta(st.getBoundingClientRect());_1(ot,V)&&Ve.contains(st)&&(Ve=st)}return{bounds:Dy(Ae.map(st=>Ta(st.getBoundingClientRect())))??V,covers:zy(Ae.map(st=>({tag:st.tagName.toLowerCase(),text:mr(st.textContent)}))),holder:Ve}},Ne=(L,V)=>{const se=fe();if(se===null)return;if(V!==null&&O1(V,L)){const Ae=L1(V,L),{bounds:Ve,covers:st,holder:ot}=je(se,Ae),_e=Ta(ot.getBoundingClientRect());K({anchor:{...z1(ot,_e,se.view.innerWidth,{x:Ve.x+Ve.width/2,y:Ve.y+Ve.height/2}),covers:st,region:Ny(_e,Ve)},field:String(Q.current+=1),kind:"new",note:""}),I(null);return}const pe=xe(se,L);pe!==null&&(K({anchor:z1(pe.element,pe.box,se.view.innerWidth,L),field:String(Q.current+=1),kind:"new",note:""}),I(null))},E=p&&d>0?1/d:1,G=fe(),le={height:G?.view.innerHeight??0,width:G?.view.innerWidth??0},ce=Ty(le.width),oe=R===null||G===null?null:Te(G,R.anchor),Ee=oe===null?null:Ay({anchor:oe.about,bounds:le,card:{height:P.height*E,width:ce*E}});return u.jsxs("div",{className:`absolute inset-0 z-20 ${R===null?"cursor-crosshair":"cursor-default"}`,onPointerDown:L=>{if(R!==null)return;const V=Se(L.clientX,L.clientY),se=fe();if(!(V===null||se===null)){try{L.currentTarget.setPointerCapture(L.pointerId)}catch{}T.current={from:V,scroll:{x:se.view.scrollX,y:se.view.scrollY}}}},onPointerLeave:()=>{C.current=null,T.current===null&&M(null)},onPointerMove:L=>{if(R!==null)return;const V=Se(L.clientX,L.clientY),se=fe();if(V===null||se===null)return;C.current=V;const pe=T.current;if(pe!==null){const Ae={x:pe.from.x+pe.scroll.x-se.view.scrollX,y:pe.from.y+pe.scroll.y-se.view.scrollY};H(O1(Ae,V)?L1(Ae,V):null),M(null);return}M(xe(se,V)?.box??null)},onPointerUp:L=>{const V=T.current;if(T.current=null,H(null),R!==null)return;const se=Se(L.clientX,L.clientY),pe=fe();if(se===null||pe===null)return;const Ae=V===null?null:{x:V.from.x+V.scroll.x-pe.view.scrollX,y:V.from.y+V.scroll.y-pe.view.scrollY};M(null),Ne(se,Ae)},ref:g,children:[D!==null&&R===null&&U===null?u.jsx("div",{className:"pointer-events-none absolute bg-[#7C9CFF]/10 outline outline-2 outline-[#7C9CFF]",style:{height:D.height,left:D.x,top:D.y,width:D.width}}):null,U!==null?u.jsx("div",{className:"pointer-events-none absolute rounded-sm border-2 border-dashed border-[#7C9CFF] bg-[#7C9CFF]/10",style:{height:U.height,left:U.x,top:U.y,width:U.width}}):null,b.map(L=>u.jsxs("div",{children:[L.region===null?null:u.jsx("div",{className:`pointer-events-none absolute rounded-sm border-2 border-dashed ${L.stale?"border-amber-500/70 bg-amber-500/5":"border-[#7C9CFF]/70 bg-[#7C9CFF]/5"}`,style:{height:L.region.height+rr*2,left:L.region.x-rr,top:L.region.y-rr,width:L.region.width+rr*2}}),u.jsxs("button",{"aria-label":Oy(L),className:"group/pin absolute size-5 cursor-pointer",onClick:V=>{V.stopPropagation(),K({anchor:L.anchor,field:String(Q.current+=1),id:L.id,kind:"kept",note:L.note}),I(null)},onPointerDown:V=>V.stopPropagation(),onPointerMove:V=>V.stopPropagation(),onPointerUp:V=>V.stopPropagation(),style:{left:L.box.x,top:L.box.y,transform:`translate(-50%, -50%) scale(${E})`,transformOrigin:"center"},type:"button",children:[u.jsx("span",{"aria-hidden":!0,className:"absolute -inset-1.5"}),u.jsx("span",{className:`flex size-5 shrink-0 items-center justify-center rounded-full text-[10px] font-semibold text-white shadow-lg outline-offset-2 group-focus-visible/pin:outline group-focus-visible/pin:outline-2 group-focus-visible/pin:outline-white ${L.stale?"bg-amber-500":"bg-[#7C9CFF]"} ${L.sent?"ring-2 ring-white/80":""}`,title:Ly(L),children:L.number}),u.jsx("span",{className:"pointer-events-none absolute left-full top-1/2 ml-1 w-max max-w-56 -translate-y-1/2 truncate rounded-md border border-white/10 bg-[#171717] px-1.5 py-1 text-left text-[11px] leading-snug text-white opacity-0 shadow-lg transition-opacity group-focus-visible/pin:opacity-100 group-hover/pin:opacity-100",children:L.note||"No words"})]})]},L.id)),R!==null&&oe!==null&&Ee!==null?u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"pointer-events-none absolute bg-[#7C9CFF]/10 outline outline-2 outline-[#7C9CFF]",style:{height:oe.about.height,left:oe.about.x,top:oe.about.y,width:oe.about.width}}),u.jsxs("form",{className:"absolute z-30 rounded-lg border border-[#232328] bg-[#1E1E22] p-1.5 shadow-2xl",onClick:L=>L.stopPropagation(),onPointerDown:L=>L.stopPropagation(),onSubmit:L=>{L.preventDefault();const V=R.field;if(X===V)return;const se=L.currentTarget.elements.namedItem("note"),pe=se instanceof HTMLInputElement?se.value.trim():"";ae(V),I(Ae=>Ae===V?null:Ae),(R.kind==="new"?r(R.anchor,pe):f(R.id,pe)).then(Ae=>{ae(Ve=>Ve===V?null:Ve),Ae?K(Ve=>Ve?.field===V?null:Ve):I(V)}).catch(()=>{ae(Ae=>Ae===V?null:Ae),I(V)})},ref:S,style:{left:Ee.left,top:Ee.top,transform:`scale(${E})`,transformOrigin:Ee.flipped?"bottom left":"top left",width:ce},children:[u.jsx("input",{autoFocus:!0,className:"w-full rounded border border-[#232328] bg-[#2E2E2E]/40 px-2 py-1 text-xs text-white placeholder:text-[#84848C] focus:border-[#D1D5DB]/40 focus:outline-none",defaultValue:R.note,onInput:ne===R.field?()=>I(null):void 0,name:"note",placeholder:R.kind==="kept"?"What is wrong with it?":R.anchor.region?"What is wrong with this area?":`What is wrong with this ${R.anchor.tag}?`},R.field),R.kind==="kept"?u.jsxs(u.Fragment,{children:[y.has(R.id)?u.jsx("p",{className:"px-1 pt-1 text-[10px] leading-snug text-[#B7A57A]",children:"Already sent. New words go with the next change."}):null,oe.stale?u.jsx("p",{className:"px-1 pt-1 text-[10px] leading-snug text-amber-500/90",children:"Its element has gone. The outline is where it was."}):null,ne===R.field?u.jsx("p",{className:"px-1 pt-1 text-[10px] leading-snug text-[#F87171]",children:"Those words were not saved. Enter tries again."}):null,u.jsxs("div",{className:"flex items-center justify-between gap-3 px-1 pt-1 text-[10px] leading-snug text-[#84848C]",children:[u.jsx("button",{className:"rounded transition-colors hover:text-[#F87171]",onClick:()=>{c(R.id),K(null)},type:"button",children:"Forget it"}),u.jsx("span",{children:"Enter saves · Esc drops"})]})]}):u.jsxs(u.Fragment,{children:[R.answered?u.jsx("p",{className:"px-1 pt-1 text-[10px] leading-snug text-[#B7A57A]",children:"That change has landed. Enter leaves these words as a new note."}):null,ne===R.field?u.jsx("p",{className:"px-1 pt-1 text-[10px] leading-snug text-[#F87171]",children:"Those words were not saved. Enter tries again."}):null,u.jsx("p",{className:"px-1 pt-1 text-[10px] leading-snug text-[#84848C]",children:R.anchor.covers&&R.anchor.covers.length>0?`${R.anchor.covers.length} ${R.anchor.covers.length===1?"element":"elements"} · Enter keeps it · Esc drops it`:"Enter keeps it · Esc drops it"})]})]})]}):null]})}const Om=["image/png","image/jpeg","image/webp","image/gif"],Ff=4,Uy=1e7;function Hy(a){return Om.includes(a.type)}function $y(a,s){const c=[],r=[];let f=Math.max(0,Ff-a.length);for(const d of s){if(!Hy(d)){r.push({file:d,why:"not-an-image"});continue}if(d.size>Uy){r.push({file:d,why:"too-big"});continue}if(f===0){r.push({file:d,why:"too-many"});continue}f-=1,c.push(d)}return{accepted:c,refused:r}}function qy(a){const s=a[0];if(s===void 0)return null;const c=a.length>1;switch(s.why){case"too-many":return`Up to ${Ff} images can ride with a change. ${c?`${a.length} were`:"One was"} left off.`;case"too-big":return`${c?"Some images are":"That image is"} over 10MB, which is more than an agent needs. Left off.`;case"not-an-image":return c?"Only PNG, JPEG, WebP and GIF images can be attached.":`${Jf(s.file.name)} is not an image Leglas can attach. PNG, JPEG, WebP or GIF.`}}function Jf(a){const s=a.replace(/\s+/g," ").trim();return s===""?"image":s}function Yy(a){const s=Jf(a).replace(/[^\x20-\x7E]/g,"").trim();return(s===""?"image":s).slice(0,80)}function Gy(a){if(a<1024)return`${a} B`;const s=a/1024;if(s<1024)return`${Math.round(s)} KB`;const c=s/1024;return`${c<10?c.toFixed(1):Math.round(c)} MB`}function Xy(a){return a.flatMap(s=>s.status==="ready"&&s.id!==null?[s.id]:[])}function Qy(a){return a.some(s=>s.status==="failed")?"failed":a.some(s=>s.status==="uploading")?"uploading":null}function cr(a){return a===void 0?!1:Array.from(a).includes("Files")}function Vy({drafts:a,onRemove:s,onRetry:c}){return a.length===0?null:u.jsx("ul",{"aria-label":"Images attached to this change",className:"flex flex-wrap gap-1.5 px-2 pt-2",children:a.map(r=>{const f=r.status==="failed";return u.jsxs("li",{className:"leglas-reference group/reference relative",children:[u.jsx(Je,{label:f?u.jsxs(u.Fragment,{children:[u.jsx("span",{className:"block",children:"Did not upload"}),u.jsx("span",{className:"block text-[#9CA3AF]",children:"Click to try again"})]}):`${r.name} · ${Gy(r.bytes)}`,children:f?u.jsx("button",{"aria-label":`${r.name} did not upload. Try again`,className:"block rounded transition-transform duration-150 focus-visible:outline-2 focus-visible:outline-offset-2 active:scale-[0.96] motion-reduce:transition-none",onClick:()=>c(r.key),type:"button",children:u.jsx(H1,{draft:r,failed:!0})}):u.jsx(H1,{draft:r,failed:!1})}),r.status==="uploading"?u.jsx("span",{"aria-label":"Uploading",className:"absolute bottom-1 right-1 size-3 animate-spin rounded-full border-[1.5px] border-white/30 border-t-white motion-reduce:animate-none",role:"status"}):f?u.jsx("span",{"aria-hidden":"true",className:"absolute bottom-1 right-1 flex size-3 items-center justify-center rounded-full bg-amber-400 text-[9px] font-semibold leading-none text-[#1C1C20]",children:"!"}):null,u.jsx("button",{"aria-label":`Remove ${r.name}`,className:"absolute -right-1.5 -top-1.5 flex size-4 items-center justify-center rounded-full bg-[#1E1E22] text-[#D1D5DB] opacity-0 shadow-[0_0_0_1px_rgba(255,255,255,0.12)] transition-[opacity,color,transform] duration-150 hover:text-white focus-visible:opacity-100 active:scale-[0.96] group-hover/reference:opacity-100 motion-reduce:transition-none",onClick:()=>s(r.key),type:"button",children:u.jsx("svg",{"aria-hidden":!0,fill:"none",height:"8",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.75",viewBox:"0 0 16 16",width:"8",children:u.jsx("path",{d:"m4 4 8 8M12 4l-8 8"})})})]},r.key)})})}function H1({draft:a,failed:s}){return u.jsx("img",{alt:a.name,className:`block h-10 w-auto min-w-10 max-w-28 rounded object-cover ${s?"opacity-70 shadow-[0_0_0_1px_rgba(251,191,36,0.8)]":"shadow-[0_0_0_1px_rgba(255,255,255,0.1)]"}`,draggable:!1,src:a.url})}const Zy=(a,s)=>fetch(a,s);async function Ky(a,s=Zy){const c=await s("/leglas/api/references",{body:a,headers:{"content-type":a.type,"x-leglas-filename":Yy(a.name??"")},method:"POST"});if(!c.ok)throw new Error("Leglas refused the image.");const r=await qt(c),f=r.reference?.id,d=r.reference?.file;if(r.ok!==!0||!Wn(f)||!Wn(d))throw new Error("Leglas refused the image.");return{id:f,file:d}}const jr=(a,s)=>fetch(a,s);async function Fy(a=jr){const s=await a("/leglas/api/annotations");if(!s.ok)throw new Error("Leglas refused the notes.");return(await qt(s)).annotations??[]}async function Wf(a,s,c){const r=await c(a,{body:JSON.stringify(s),headers:{"content-type":"application/json"},method:"POST"});if(!r.ok)throw new Error("Leglas refused the note.");const f=await qt(r);if(f.ok!==!0)throw new Error("Leglas refused the note.");return f}function Jy(a,s,c,r=jr){return Wf("/leglas/api/annotations",{anchor:c,note:s,title:a},r)}function Wy(a,s,c=jr){return Wf("/leglas/api/annotations/update",{id:a,note:s},c)}function Iy(a,s=jr){return Wf("/leglas/api/annotations/delete",{ids:a},s)}function Py(a){return[...new Set(a.flatMap(s=>s.mode!=="variant"&&(s.status==="queued"||s.status==="picked-up"||s.status==="running")?[s.title]:[]))]}function ev(a){return new Set(a.filter(s=>s.status==="queued"||s.status==="picked-up"||s.status==="running").flatMap(s=>s.notes??[]))}function tv(a){return new Set(a.flatMap(s=>s.status==="picked-up"||s.status==="running"?[s.title]:[]))}function nv(a,s,c=null){if(a==="custom"){const f=c?.trim().split(/\s+/)[0]??"";return{kind:"chosen",id:"custom",name:f===""?"Custom":f.split("/").pop()??"Custom"}}const r=a===null?void 0:s.find(f=>f.id===a);return r?.available?{kind:"chosen",id:r.id,name:r.name}:s.some(f=>f.available)?{kind:"choose"}:{kind:"none"}}function lv(a){const s=a.max===null?`retry ${a.attempt}`:`retry ${a.attempt} of ${a.max}`,c=a.status,r=a.reason??"";return c===429||r.includes("rate")?`provider is rate limiting · ${s}`:c===401||c===403||r.includes("auth")?`provider refused the login · ${s}`:c===529||c===503||r.includes("overload")?`provider is overloaded · ${s}`:`provider returned an error · ${s}`}function av(a){return a.kind==="running"?a.stopping?`Stopping ${a.name}`:`${a.name} is on it`:a.kind==="queued"?a.count===1?"Change queued":`${a.count} changes queued`:a.kind==="picked-up"?"Your agent is on it":a.kind==="stopped"?"You stopped that change":"That change failed"}function iv(a,s=null){return a.kind==="running"?a.stopping?"waiting for it to exit":a.waiting!==null?lv(a.waiting):a.quietSince!==null&&s!==null?`no output for ${Er(s-a.quietSince)}`:a.activity??a.title:a.kind==="queued"?a.attended?"your agent picks it up next":"pick who runs your changes":a.kind==="failed"?a.reason??a.title:a.kind==="stopped"?a.title:null}function Er(a){const s=Math.max(0,Math.floor(a/1e3));return s<60?`${s}s`:`${Math.floor(s/60)}m ${String(s%60).padStart(2,"0")}s`}function sv(a,s,c){const r=a.find(p=>p.status==="running");if(s.running||r!==void 0)return{kind:"running",id:r?.id??null,name:s.name??"Your agent",activity:s.activity,startedAt:s.startedAt,title:r?.title??null,stopping:s.stopping===!0,waiting:s.stopping===!0?null:s.waiting??null,quietSince:s.stopping===!0?null:s.quietSince??null};const f=a.filter(p=>p.status==="queued").length;if(f>0)return{kind:"queued",count:f,attended:c};if(a.some(p=>p.status==="picked-up"))return{kind:"picked-up"};const d=a.findLast(p=>p.status==="failed"||p.status==="cancelled");return d===void 0?null:d.status==="cancelled"?{kind:"stopped",id:d.id,title:d.title}:{kind:"failed",id:d.id,title:d.title,reason:d.failure?.message??null}}const hi=(a,s)=>fetch(a,s),ov=5e3,uv=1e4;async function Lm(a,s,c,r){const f=new AbortController,d=setTimeout(()=>f.abort(),c);try{return await r(a,{...s,signal:f.signal})}finally{clearTimeout(d)}}async function $1(a=!1,s=hi){const c=await Lm(`/leglas/api/agents${a?"?refresh=1":""}`,void 0,ov,s);if(!c.ok)throw new Error("Leglas refused the agent request.");return qt(c)}async function hs(a,s,c){const r={method:"POST"};s!==null&&(r.headers={"content-type":"application/json"},r.body=JSON.stringify(s));const f=await Lm(a,r,uv,c);if(!f.ok)throw new Error("Leglas refused the agent request.");if((await qt(f)).ok!==!0)throw new Error("Leglas refused the agent request.")}function rv(a,s,c=hi){return hs("/leglas/api/agent",{agent:a},c)}function cv(a,s,c=hi){return hs("/leglas/api/agent",{agent:a,effort:s},c)}function fv(a=hi){return hs("/leglas/api/agents/warm",null,a)}function dv(a,s=hi){return hs("/leglas/api/requests/cancel",a==null?null:{id:a},s)}function hv(a,s=hi){return hs("/leglas/api/requests/retry",{id:a},s)}function mv(a,s=hi){return hs("/leglas/api/requests/dismiss",{id:a},s)}const qf={claude:{codeLabel:"Terminal command",copyLabel:"Copy Claude Code command",description:"Add Leglas with one terminal command.",label:"Claude Code",nextStep:"Run this command from your project, then ask Claude to list your Leglas directions.",snippet:"claude mcp add leglas -- npx -y leglas-mcp"},other:{codeLabel:"MCP configuration",copyLabel:"Copy MCP configuration",description:"Use standard MCP JSON with another coding agent.",label:"Codex, Cursor & others",nextStep:"Add this configuration in your client's MCP settings, restart the client, then ask it to list your Leglas directions.",snippet:`{
|
|
11
|
+
"mcpServers": {
|
|
12
|
+
"leglas": { "command": "npx", "args": ["-y", "leglas-mcp"] }
|
|
13
|
+
}
|
|
14
|
+
}`}};function pv(a,s){return s==="copying"?"Copying…":s==="copied"?"Copied":a.copyLabel}function gv(a){return a?{title:"Agent connected",detail:"Leglas received activity from an MCP agent in this project."}:{title:"Waiting for agent activity",detail:"This updates after the agent uses a Leglas tool."}}const xv=Object.keys(qf);function yv({client:a}){return u.jsx("span",{"aria-hidden":"true",className:"mt-0.5 flex h-5 w-7 shrink-0 items-center justify-center text-[#D1D5DB]",children:a==="claude"?u.jsx(cs,{id:"claude",size:17}):u.jsxs("span",{className:"flex -space-x-1.5",children:[u.jsx("span",{className:"flex size-5 items-center justify-center rounded-full bg-[#25252B] ring-1 ring-[#3A3A42]",children:u.jsx(cs,{id:"codex",size:14})}),u.jsx("span",{className:"flex size-5 items-center justify-center rounded-full bg-[#25252B] ring-1 ring-[#3A3A42]",children:u.jsx(cs,{id:"cursor",size:13})})]})})}function vv({connected:a,fallbackFocusRef:s,onClose:c}){const[r,f]=w.useState("claude"),[d,p]=w.useState("idle"),y=w.useRef(null),v=w.useRef(null),g=w.useRef(c);g.current=c,w.useEffect(()=>{const M=y.current;if(M===null)return;const U=document.activeElement instanceof HTMLElement?document.activeElement:null,H=K=>{K.preventDefault(),g.current()},R=K=>{if(K.key!=="Tab")return;const Q=Array.from(M.querySelectorAll("button:not(:disabled), input:not(:disabled), [href], [tabindex]:not([tabindex='-1'])")),X=Q[0],ae=Q.at(-1);X===void 0||ae===void 0?(K.preventDefault(),M.focus()):K.shiftKey&&document.activeElement===X?(K.preventDefault(),ae.focus()):!K.shiftKey&&document.activeElement===ae&&(K.preventDefault(),X.focus())};return M.addEventListener("cancel",H),M.addEventListener("keydown",R),M.open||M.showModal(),v.current?.focus(),()=>{M.removeEventListener("cancel",H),M.removeEventListener("keydown",R),M.open&&M.close();const K=s.current;(K?.isConnected?K:U)?.focus()}},[s]);const S=qf[r],C=gv(a),T=M=>{f(M),p("idle")},D=async()=>{if(d==="copying")return;p("copying");const M=await Sr(S.snippet);p(M==="copied"?"copied":"blocked")};return u.jsx("dialog",{"aria-describedby":"mcp-connect-description","aria-labelledby":"mcp-connect-title","aria-modal":"true",className:"m-auto max-h-[calc(100dvh-2rem)] max-w-none overflow-visible border-0 bg-transparent p-0 text-start text-inherit backdrop:bg-black/55 backdrop:backdrop-blur-sm",onPointerDown:M=>{M.target===M.currentTarget&&c()},ref:y,tabIndex:-1,children:u.jsxs("div",{className:"w-[calc(100vw-2rem)] max-w-lg overscroll-contain rounded-xl border border-[#2A2A30] bg-[#1E1E22] p-5 shadow-2xl",children:[u.jsxs("div",{className:"flex items-start gap-3",children:[u.jsx("span",{"aria-hidden":"true",className:"flex size-10 shrink-0 items-center justify-center rounded-lg border border-[#34343B] bg-[#25252A] shadow-inner",children:u.jsx(Ao,{size:24})}),u.jsxs("div",{className:"min-w-0 pt-0.5",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(ym,{height:11}),u.jsx("span",{className:"rounded-full bg-[#7C9CFF]/10 px-1.5 py-0.5 text-[9px] font-medium uppercase tracking-[0.08em] text-[#AFC2FF]",children:"MCP setup"})]}),u.jsx("h2",{className:"mt-2 text-base font-medium text-white",id:"mcp-connect-title",children:"Connect agent via MCP"}),u.jsx("p",{className:"mt-1.5 max-w-md text-xs leading-relaxed text-[#9CA3AF]",id:"mcp-connect-description",children:"Connect an MCP-compatible agent so it can handle requests in this project."})]})]}),u.jsxs("fieldset",{className:"mt-5",children:[u.jsx("legend",{className:"text-[10px] font-medium uppercase tracking-[0.08em] text-[#84848C]",children:"MCP client"}),u.jsx("div",{className:"mt-2 grid grid-cols-1 gap-2 sm:grid-cols-2",children:xv.map((M,U)=>{const H=qf[M],R=r===M;return u.jsxs("label",{className:`flex cursor-pointer items-start gap-2.5 rounded-lg border p-3 transition-[background-color,border-color,color] duration-150 ${R?"border-[#6678B8] bg-[#7C9CFF]/10 text-white":"border-[#2A2A30] bg-[#19191D] text-[#D1D5DB] hover:border-[#3A3A42] hover:bg-[#24242A]"}`,children:[u.jsx("input",{checked:R,className:"mt-0.5 size-3.5 shrink-0 accent-[#AFC2FF] focus-visible:outline-2 focus-visible:outline-offset-2",name:"mcp-client",onChange:()=>T(M),ref:U===0?v:void 0,type:"radio",value:M}),u.jsx(yv,{client:M}),u.jsxs("span",{className:"min-w-0",children:[u.jsx("span",{className:"block text-xs font-medium",children:H.label}),u.jsx("span",{className:"mt-0.5 block text-[10px] leading-relaxed text-[#84848C]",children:H.description})]})]},M)})})]}),u.jsxs("div",{className:"mt-5 overflow-hidden rounded-lg border border-[#2A2A30] bg-[#151519]",children:[u.jsxs("div",{className:"flex min-h-9 items-center justify-between gap-3 border-b border-[#2A2A30] px-3",children:[u.jsx("span",{className:"text-[10px] font-medium text-[#84848C]",children:S.codeLabel}),u.jsxs("button",{className:"flex min-h-7 shrink-0 items-center gap-1.5 rounded-md px-2 text-[10px] font-medium text-[#D1D5DB] transition-[background-color,color,scale] duration-150 hover:bg-white/[0.06] hover:text-white active:scale-[0.96] disabled:opacity-60",disabled:d==="copying",onClick:()=>{D()},type:"button",children:[u.jsx(Zt,{d:Vt.copy,size:12}),pv(S,d)]})]}),u.jsx("pre",{"aria-label":S.codeLabel,className:"max-h-44 overflow-auto whitespace-pre-wrap break-words p-3 font-mono text-[11px] leading-relaxed text-[#D1D5DB]",tabIndex:0,children:u.jsx("code",{children:S.snippet})})]}),u.jsx("p",{className:"mt-2 min-h-4 text-[10px] leading-relaxed",role:"status",children:d==="blocked"?u.jsx("span",{className:"text-red-300",children:"Clipboard access is blocked. Select and copy the text above."}):d==="copied"?u.jsx("span",{className:"text-emerald-300",children:"Copied to the clipboard."}):null}),u.jsxs("div",{className:"mt-4 space-y-4",children:[u.jsx("p",{className:"text-xs leading-relaxed text-[#9CA3AF]",children:S.nextStep}),u.jsxs("div",{className:`flex items-start gap-2.5 rounded-lg px-3 py-2.5 ${a?"bg-emerald-400/10":"bg-white/[0.04]"}`,role:"status",children:[u.jsx("span",{"aria-hidden":"true",className:`mt-0.5 flex size-4 shrink-0 items-center justify-center rounded-full ${a?"bg-emerald-400 text-[#123326]":"border border-[#5B5B66]"}`,children:a?u.jsx("svg",{fill:"none",height:"10",viewBox:"0 0 12 12",width:"10",children:u.jsx("path",{d:"m2.2 6.1 2.2 2.2 5.4-5.2",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.8"})}):null}),u.jsxs("span",{className:"min-w-0",children:[u.jsx("span",{className:`block text-xs font-medium ${a?"text-emerald-200":"text-[#D1D5DB]"}`,children:C.title}),u.jsx("span",{className:"mt-0.5 block text-[10px] leading-relaxed text-[#84848C]",children:C.detail})]})]})]}),u.jsx("div",{className:"mt-5 flex justify-end",children:u.jsx("button",{className:"rounded-md bg-[#E8E8EA] px-3 py-1.5 text-xs font-medium text-[#1C1C20] transition-[background-color,scale] duration-150 hover:bg-white active:scale-[0.96]",onClick:c,type:"button",children:"Done"})})]})})}const _m={low:"Low",medium:"Medium",high:"High",xhigh:"Extra high",max:"Maximum"};function bv({agents:a,chip:s,connectRef:c,menuRef:r,onConnect:f,onPick:d,onPickEffort:p,open:y,pickingAgent:v,savingEffort:g,selectedAgent:S,selectedEffort:C,setOpen:T}){return u.jsxs("div",{"aria-hidden":!y,"aria-label":"Who runs your changes",className:`absolute bottom-full right-0 z-10 mb-1.5 w-max min-w-48 origin-bottom-right rounded-lg border border-[#232328] bg-[#1E1E22] p-1 text-[#D1D5DB] shadow-2xl transition-[opacity,transform] duration-150 ease-[cubic-bezier(0.165,0.84,0.44,1)] focus:outline-none motion-reduce:transition-none ${y?"translate-y-0 scale-100 opacity-100":"pointer-events-none translate-y-1 scale-95 opacity-0"}`,inert:!y,ref:r,role:"dialog",tabIndex:-1,children:[a.filter(D=>D.available).map(D=>{const M=s.kind==="chosen"&&D.id===s.id;return u.jsxs("button",{className:oi,disabled:v!==null||g,onClick:()=>M?T(!1):d(D.id),type:"button",children:[u.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[u.jsx(cs,{id:D.id}),u.jsx("span",{className:"truncate",children:D.name})]}),v===D.id?u.jsx("span",{"aria-label":"selecting",className:"size-3 animate-spin rounded-full border-[1.5px] border-current border-t-transparent motion-reduce:animate-none"}):D.auth==="signed-out"?u.jsx("span",{className:"text-[10px] text-amber-400/80",children:"signed out"}):M&&u.jsx("span",{"aria-label":"current choice",children:"✓"})]},D.id)}),s.kind==="chosen"&&s.id==="custom"?u.jsxs("button",{className:oi,onClick:()=>T(!1),type:"button",children:[u.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[u.jsx(cs,{id:"custom"}),u.jsx("span",{className:"truncate",children:s.name})]}),u.jsx("span",{"aria-label":"current choice",children:"✓"})]}):null,S!==void 0&&S.efforts.length>0?u.jsx("div",{className:"mt-1 border-t border-[#232328] px-1 pb-0.5 pt-1.5",children:u.jsxs("label",{className:"flex min-h-7 items-center justify-between gap-3",children:[u.jsx("span",{className:"text-[10px] font-medium text-[#84848C]",children:"Effort"}),u.jsxs("select",{"aria-busy":g,"aria-label":`${S.name} effort`,className:"min-h-7 rounded-md border border-[#303038] bg-[#17171B] px-2 text-[10px] text-[#D1D5DB] focus-visible:outline-2 focus-visible:outline-offset-2 disabled:opacity-60",disabled:g||v!==null,onChange:D=>{const M=D.currentTarget.value;p(S.efforts.find(U=>U===M)??null)},value:C??"",children:[u.jsx("option",{value:"",children:"Agent default"}),S.efforts.map(D=>u.jsx("option",{value:D,children:_m[D]},D))]})]})}):null,u.jsx("div",{className:"mt-1 border-t border-[#232328] pt-1",children:u.jsx("button",{className:`${oi} text-[#84848C]`,onClick:()=>{T(!1),f()},ref:c,type:"button",children:u.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[u.jsx(Zt,{d:Vt.link,size:14}),u.jsx("span",{className:"truncate",children:"Connect agent via MCP…"})]})})})]})}function wv({agents:a,chip:s,chosenSignedOut:c,connectRef:r,menuRef:f,onConnect:d,onPick:p,onPickEffort:y,onRefresh:v,open:g,pickingAgent:S,savingEffort:C,selectedAgent:T,selectedEffort:D,setOpen:M,triggerRef:U}){return s.kind==="none"?u.jsxs("button",{className:"flex min-w-0 items-center gap-1.5 rounded px-1.5 py-1 text-[10px] leading-none text-[#84848C] transition-colors duration-150 hover:bg-white/[0.04] hover:text-[#D1D5DB]",onClick:d,ref:r,type:"button",children:[u.jsx(Zt,{d:Vt.link,size:12}),u.jsx("span",{className:"truncate",children:"Connect agent via MCP…"})]}):u.jsxs("div",{className:"relative flex min-w-0 items-center",children:[u.jsx(bv,{agents:a,chip:s,connectRef:r,menuRef:f,onConnect:d,onPick:p,onPickEffort:y,open:g,pickingAgent:S,savingEffort:C,selectedAgent:T,selectedEffort:D,setOpen:M}),u.jsxs("button",{"aria-expanded":g,"aria-haspopup":"dialog",className:"flex min-w-0 items-center gap-1.5 rounded px-1.5 py-1 text-[11px] leading-none text-[#84848C] transition-colors hover:bg-white/[0.04] hover:text-[#D1D5DB]",onClick:()=>{g||v(),M(H=>!H)},ref:U,type:"button",children:[s.kind==="chosen"&&u.jsx(cs,{id:s.id,size:12}),u.jsx("span",{className:"truncate",children:s.kind==="chosen"?`${s.name}${D===null?"":` · ${_m[D]}`}`:"Choose an agent"}),c&&u.jsx("span",{className:"size-1.5 shrink-0 rounded-full bg-amber-400",title:"This CLI is signed out. Sign in in your terminal.",children:u.jsx("span",{className:"sr-only",children:"signed out"})}),u.jsx("svg",{"aria-hidden":"true",className:`shrink-0 transition-transform duration-150 motion-reduce:transition-none ${g?"rotate-180":""}`,fill:"none",height:"12",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.75",viewBox:"0 0 16 16",width:"12",children:u.jsx("path",{d:"M4 6.5 8 10.5l4-4"})})]})]})}const Sv="size-3 animate-spin rounded-full border-[1.5px] border-current border-t-transparent motion-reduce:animate-none";function Bm({kind:a}){return a==="stopped"?u.jsx("span",{"aria-hidden":"true",className:"flex size-3.5 shrink-0 items-center justify-center text-[#84848C]",children:u.jsx("span",{className:"block size-2 rounded-[2px] bg-current"})}):a==="failed"?u.jsxs("svg",{"aria-hidden":"true",className:"shrink-0 text-amber-400/90",fill:"none",height:"14",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",viewBox:"0 0 16 16",width:"14",children:[u.jsx("path",{d:"M8 2.6 14.6 13.4H1.4Z"}),u.jsx("path",{d:"M8 6.8v2.7"}),u.jsx("path",{d:"M8 11.6h.01"})]}):a==="queued"?u.jsx("span",{"aria-hidden":"true",className:"flex size-3.5 shrink-0 items-center justify-center",children:u.jsx("span",{className:"size-1.5 animate-pulse rounded-full bg-[#84848C] motion-reduce:animate-none"})}):u.jsx("span",{"aria-hidden":"true",className:"size-3.5 shrink-0 animate-spin rounded-full border-[1.5px] border-white/15 border-t-white/70 motion-reduce:animate-none"})}function No({busy:a,children:s,disabled:c,label:r,onClick:f,standalone:d=!1,tip:p}){return u.jsx(Je,{label:p,children:u.jsx("button",{"aria-label":r,className:`flex h-6 w-6 ${d?"shrink-0 ":""}items-center justify-center rounded-md text-[#84848C] transition-[background-color,color,transform] duration-150 hover:bg-white/[0.06] hover:text-white active:scale-[0.96] disabled:cursor-wait disabled:opacity-40 motion-reduce:transition-none`,disabled:c,onClick:f,type:"button",children:a?u.jsx("span",{className:Sv}):s})})}function Do({children:a}){return u.jsx("svg",{"aria-hidden":"true",fill:"none",height:"13",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.75",viewBox:"0 0 16 16",width:"13",children:a})}function jv({action:a,card:s,onCancel:c,onDismiss:r,onRetry:f}){const d=s.kind==="running"?s.startedAt:null,[p,y]=w.useState(()=>Date.now());w.useEffect(()=>{if(d===null)return;y(Date.now());const g=window.setInterval(()=>y(Date.now()),1e3);return()=>window.clearInterval(g)},[d]);const v=iv(s,d===null?null:p);return u.jsx("div",{className:"mx-3 mt-2 rounded-lg border border-[#232328] bg-[#1E1E22] px-2.5 py-2 shadow-lg",role:"status",children:u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(Bm,{kind:s.kind}),u.jsxs("div",{className:"min-w-0 flex-1",children:[u.jsx("p",{className:"truncate text-[11px] font-medium leading-tight text-[#D1D5DB]",children:av(s)}),v!==null&&u.jsx("p",{className:"mt-0.5 text-[10px] leading-tight text-[#84848C]",children:v})]}),d!==null&&u.jsx("span",{className:"shrink-0 text-[10px] tabular-nums text-[#84848C]",children:Er(p-d)}),s.kind==="running"&&u.jsx(No,{busy:a==="cancel"||s.stopping,disabled:a!==null||s.stopping,label:"Stop this run",onClick:()=>c(s.id),standalone:!0,tip:"Stop this run",children:u.jsx("span",{className:"block size-2 rounded-[2px] bg-current"})}),(s.kind==="failed"||s.kind==="stopped")&&u.jsxs("span",{className:"flex shrink-0 items-center",children:[u.jsx(No,{busy:a==="retry",disabled:a!==null,label:s.kind==="stopped"?"Run this change after all":"Retry this change",onClick:()=>f(s.id),tip:s.kind==="stopped"?"Run it after all":"Try it again",children:u.jsxs(Do,{children:[u.jsx("path",{d:"M13.5 8a5.5 5.5 0 1 1-1.6-3.9"}),u.jsx("path",{d:"M13.7 1.8v2.7H11"})]})}),u.jsx(No,{busy:a==="dismiss",disabled:a!==null,label:s.kind==="stopped"?"Dismiss this stopped change":"Dismiss this failed change",onClick:()=>r(s.id),tip:"Let it go",children:u.jsx(Do,{children:u.jsx("path",{d:"m4 4 8 8M12 4l-8 8"})})})]})]})})}function Of(a){return a==="codex"?"Codex":"Claude"}const Ev=6;function Um(a){let s;try{s=new URL(a,"http://leglas.invalid").searchParams}catch{return null}for(const c of s.keys())if(c.startsWith("v-")&&c.length>2)return c.slice(2);return null}function Cv(a){const s=new Map;for(const c of a)for(const r of c.slots)s.set(r.title,{job:c,slot:r});return s}function q1(a,s){try{return new URL(a,"http://leglas.invalid").searchParams.get(`v-${s.job.surface}`)===s.slot.key}catch{return!1}}const Nv=2e3;function If(a){let s=a.startedAt;for(const c of a.slots)c.startedAt!==null&&(a.plannedAt===null||c.startedAt-a.plannedAt>Nv)&&(s=Math.max(s,c.startedAt));return s}function Mv(a){let s=null;for(const c of a)c.endedAt!==null&&(s===null||c.endedAt>(s.endedAt??0))&&(s=c);return s}function Lf(a){return`${a.id}@${a.endedAt??""}`}function Av(a){const s=new Set;for(const c of a){const r=Um(c);r!==null&&s.add(r)}return[...s]}function Mo(a){return a.state==="planning"||a.state==="building"}function _f(a,s){return s.basedOn===null?`${a} ${s.surface} ${a===1?"direction":"directions"}`:`${a} ${a===1?"variation":"variations"} of ${s.basedOn}`}function Y1(a){const s=a.map(c=>c.title);return s.length<=1?s.join(""):`${s.slice(0,-1).join(", ")} and ${s.at(-1)}`}function Tv(a){const s=a.slots.filter(d=>d.state==="ready"),c=a.slots.filter(d=>d.state==="failed"),r=a.slots.filter(d=>d.state==="stopped");if(a.state==="planning")return{tone:"working",text:`Planning ${_f(a.count,a)}…`};if(a.state==="building"){const d=s.length>0?`, ${s.length} ready`:"";return{tone:"working",text:`Building ${_f(a.slots.length,a)}${d}`}}if(a.state==="failed")return{tone:"failed",text:a.error??"Leglas could not plan the directions."};if(a.slots.length===0||r.length===a.slots.length)return{tone:"stopped",text:a.basedOn===null?`Stopped the ${a.surface} directions`:`Stopped the variations of ${a.basedOn}`};if(s.length===a.slots.length){const d=a.endedAt===null||If(a)!==a.startedAt?null:Math.max(1,Math.round((a.endedAt-a.startedAt)/1e3));return{tone:"done",text:`${_f(s.length,a)} ready${d===null?"":` in ${d} s`}`}}const f=s.length>0?[`${s.length} of ${a.slots.length} ready`]:a.slots.length>1?[`None of the ${a.slots.length} were built`]:[];return c.length>0&&f.push(`${Y1(c)} failed`),r.length>0&&f.push(`${Y1(r)} stopped`),{tone:c.length>0?"failed":"stopped",text:f.join(". ")}}function Dv(a,s){return`Build ${a} with ${s}`}const G1="flex size-6 items-center justify-center rounded text-[#9CA3AF] transition-[background-color,color,transform] duration-150 hover:bg-white/[0.06] hover:text-white active:scale-[0.96] disabled:pointer-events-none disabled:opacity-30 motion-reduce:transition-none";function kv({agent:a,count:s,onCount:c,picker:r,reason:f,ready:d,starting:p}){return u.jsxs("div",{className:"flex items-center justify-between gap-1.5 p-1",children:[u.jsxs("div",{"aria-label":"How many directions",className:"flex items-center",role:"group",children:[u.jsx("button",{"aria-label":"One direction fewer",className:G1,disabled:s<=1||p,onClick:()=>c(s-1),type:"button",children:u.jsx("svg",{"aria-hidden":"true",height:"12",viewBox:"0 0 16 16",width:"12",children:u.jsx("path",{d:"M3.5 8h9",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.75"})})}),u.jsx("span",{"aria-live":"polite",className:"w-5 text-center text-[11px] font-medium tabular-nums text-[#D1D5DB]",children:s}),u.jsx("button",{"aria-label":"One direction more",className:G1,disabled:s>=Ev||p,onClick:()=>c(s+1),type:"button",children:u.jsx("svg",{"aria-hidden":"true",height:"12",viewBox:"0 0 16 16",width:"12",children:u.jsx("path",{d:"M3.5 8h9M8 3.5v9",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.75"})})})]}),f===null?u.jsxs("button",{className:"flex h-6 shrink-0 items-center gap-1.5 rounded-md bg-[#E8E8EA] px-2.5 text-[11px] font-medium text-[#1C1C20] transition-[background-color,transform,opacity] duration-150 hover:bg-white active:scale-[0.96] disabled:cursor-not-allowed disabled:opacity-40 motion-reduce:transition-none",disabled:!d||p,type:"submit",children:[p&&u.jsx("span",{"aria-hidden":"true",className:"size-3 animate-spin rounded-full border-[1.5px] border-current border-t-transparent motion-reduce:animate-none"}),Dv(s,a)]}):u.jsxs("span",{className:"flex min-w-0 items-center gap-1.5",children:[u.jsx("p",{className:"min-w-0 truncate text-right text-[10px] leading-snug text-[#84848C]",children:f}),r]})]})}function zv(){return u.jsx("svg",{"aria-hidden":"true",className:"shrink-0 text-emerald-300/90",fill:"none",height:"14",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.75",viewBox:"0 0 16 16",width:"14",children:u.jsx("path",{d:"m3.5 8.5 3 3 6-7"})})}function Rv({compare:a,comparing:s,job:c,onDismiss:r,onStop:f,stopping:d}){const p=Tv(c),y=Mo(c),[v,g]=w.useState(()=>Date.now());return w.useEffect(()=>{if(!y)return;g(Date.now());const S=window.setInterval(()=>g(Date.now()),1e3);return()=>window.clearInterval(S)},[y]),u.jsx("div",{className:"mx-3 mt-2 rounded-lg border border-[#232328] bg-[#1E1E22] px-2.5 py-2 shadow-lg",role:"status",children:u.jsxs("div",{className:"flex items-center gap-2",children:[p.tone==="done"?u.jsx(zv,{}):u.jsx(Bm,{kind:p.tone==="working"?"running":p.tone}),u.jsxs("div",{className:"min-w-0 flex-1",children:[u.jsx("p",{className:"truncate text-[11px] font-medium leading-tight text-[#D1D5DB]",children:p.text}),c.brief!==""&&u.jsxs("p",{className:"mt-0.5 truncate text-[10px] leading-tight text-[#84848C]",children:["“",c.brief,"”"]})]}),y&&u.jsx("span",{className:"shrink-0 text-[10px] tabular-nums text-[#84848C]",children:Er(v-If(c))}),a!==null&&u.jsx("button",{"aria-pressed":s,className:"h-6 shrink-0 rounded-md bg-white/[0.06] px-2 text-[10px] font-medium text-[#D1D5DB] transition-[background-color,color,transform] duration-150 hover:bg-white/[0.1] hover:text-white active:scale-[0.96] motion-reduce:transition-none",onClick:a.toggle,type:"button",children:s?"Show one":`Compare all ${a.count}`}),y?u.jsx(No,{busy:d,disabled:d,label:"Stop building these directions",onClick:f,standalone:!0,tip:"Stop them all",children:u.jsx("span",{className:"block size-2 rounded-[2px] bg-current"})}):u.jsx(No,{busy:!1,disabled:!1,label:"Dismiss this set's summary",onClick:r,standalone:!0,tip:"Let it go",children:u.jsx(Do,{children:u.jsx("path",{d:"m4 4 8 8M12 4l-8 8"})})})]})})}const Ov="rounded-md bg-neutral-900 px-3 py-1.5 text-xs font-medium text-white transition-[background-color,transform] duration-150 hover:bg-neutral-700 active:scale-[0.96] disabled:cursor-wait disabled:opacity-50 motion-reduce:transition-none",X1="rounded-md bg-neutral-100 px-3 py-1.5 text-xs font-medium text-neutral-800 transition-[background-color,transform] duration-150 hover:bg-neutral-200 active:scale-[0.96] disabled:cursor-wait disabled:opacity-50 motion-reduce:transition-none";function Lv({slot:a}){const[s,c]=w.useState(()=>Date.now());w.useEffect(()=>{const f=window.setInterval(()=>c(Date.now()),1e3);return()=>window.clearInterval(f)},[]);const r=a.activity??(a.state==="checking"?"opening the page":"starting");return u.jsxs("p",{className:"mt-3 text-[11px] leading-snug text-neutral-400",children:[u.jsx("span",{className:"block truncate",children:r}),u.jsxs("span",{className:"tabular-nums",children:[a.startedAt===null?"":`${Er(s-a.startedAt)} · `,"usually a minute or two"]})]})}function _v({acting:a,agent:s,name:c,onReplace:r,onRetry:f,onStop:d,slot:p}){return p.state==="building"||p.state==="checking"?u.jsxs("div",{"aria-live":"polite",className:"absolute inset-0 flex flex-col items-center justify-center gap-3 bg-white p-6 text-center",children:[u.jsx("span",{className:"size-4 animate-spin rounded-full border-2 border-neutral-300 border-t-neutral-800 motion-reduce:animate-none"}),u.jsxs("div",{className:"max-w-xs",children:[u.jsx("p",{className:"text-sm font-medium text-neutral-800",children:p.state==="building"?`${s} is building ${c}`:`Checking ${c} renders`}),u.jsx("p",{className:"mt-1 text-xs leading-snug text-neutral-500",children:p.idea}),u.jsx(Lv,{slot:p})]}),u.jsx("button",{className:X1,disabled:a,onClick:d,type:"button",children:"Stop"})]}):u.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center gap-3 bg-white p-6 text-center",role:"alert",children:[u.jsxs("div",{className:"max-w-xs",children:[u.jsx("p",{className:"text-sm font-medium text-neutral-800",children:p.state==="failed"?`${c} didn’t build`:`${c} was stopped`}),u.jsx("p",{className:"mt-1 text-xs leading-snug text-neutral-500",children:p.state==="failed"?p.failure?.message??"It did not build.":p.idea})]}),u.jsxs("div",{className:"flex gap-2",children:[u.jsx("button",{className:Ov,disabled:a,onClick:f,type:"button",children:p.state==="failed"?"Try again":"Build it"}),u.jsx("button",{className:X1,disabled:a,onClick:r,type:"button",children:"Try a new idea"})]})]})}async function Bv(a){const s=await fetch("/leglas/api/generate",a===void 0?{}:{signal:a});if(!s.ok)throw new Error(`the server answered ${s.status}`);return(await qt(s)).jobs}async function Cr(a,s,c){const r=await fetch(`/leglas/api/generate${a}`,{body:JSON.stringify(s),headers:{"content-type":"application/json"},method:"POST"});if(!r.ok)throw await ka(r,c);return r}async function Uv({basedOn:a,...s}){const c=await Cr("",a===null?s:{...s,basedOn:a},"Leglas could not start building the directions.");return(await qt(c)).job}async function Q1(a,s){await Cr("/stop",s===void 0?{id:a}:{id:a,slot:s},"Leglas could not stop it.")}async function Hv(a,s){await Cr("/retry",{id:a,slot:s},"Leglas could not build it again.")}async function $v(a,s){await Cr("/replace",{id:a,slot:s},"Leglas could not ask for a new idea.")}const qv=6e4,Yv=[];function Gv(a){const[s,c]=w.useState([]),r=s.some(Mo);w.useEffect(()=>{if(!a)return;let d=!1;const p=ds(y=>Bv(y).then(v=>{d||c(g=>JSON.stringify(g)===JSON.stringify(v)?g:v)}).catch(()=>{}),{everyMs:r?To:qv,subscribe:y=>fs().on("generation",y)});return()=>{d=!0,p()}},[a,r]);const f=w.useCallback(d=>{c(p=>p.some(y=>y.id===d.id)?p.map(y=>y.id===d.id?d:y):[...p,d])},[]);return{jobs:a?s:Yv,noteJob:f}}function Xv({annotating:a,count:s,onToggle:c}){return u.jsx(Je,{label:u.jsxs(u.Fragment,{children:[u.jsx("span",{className:"block",children:a?"Stop annotating":s>0?"Show what you marked up":"Point at what is wrong, instead of describing where it is"}),u.jsx("span",{className:"block text-[#9CA3AF]",children:a?"Click a detail · drag an area · Esc to stop":u.jsx("kbd",{className:"font-sans",children:"A"})})]}),children:u.jsxs("button",{"aria-keyshortcuts":"a","aria-label":a?"Stop annotating the design":`Annotate the design${s>0?`, ${s} annotation${s===1?"":"s"} so far`:""}`,"aria-pressed":a,className:`flex h-6 shrink-0 items-center gap-1 rounded-md px-1.5 text-[10px] font-medium leading-none transition-colors ${a?"bg-[#7C9CFF]/20 text-[#AFC2FF]":"text-[#84848C] hover:bg-white/[0.06] hover:text-[#D1D5DB]"}`,onClick:c,type:"button",children:[u.jsxs("svg",{"aria-hidden":!0,fill:"none",height:"11",stroke:"currentColor",strokeWidth:"1.7",viewBox:"0 0 16 16",width:"11",children:[u.jsx("path",{d:"M8 1.8a4.2 4.2 0 0 1 4.2 4.2c0 3-4.2 8-4.2 8S3.8 9 3.8 6A4.2 4.2 0 0 1 8 1.8Z",strokeLinejoin:"round"}),u.jsx("circle",{cx:"8",cy:"6",r:"1.4"})]}),"Annotate",s>0?u.jsx("span",{className:"rounded-full bg-white/15 px-1 text-[9px] leading-[1.5] text-white",children:s}):null]})})}function Qv({count:a,disabled:s,inputRef:c,onFiles:r}){return u.jsxs(u.Fragment,{children:[u.jsx("input",{accept:Om.join(","),"aria-hidden":"true",className:"sr-only",multiple:!0,onChange:f=>{r(Array.from(f.currentTarget.files??[])),f.currentTarget.value=""},ref:c,tabIndex:-1,type:"file"}),u.jsx(Je,{label:u.jsxs(u.Fragment,{children:[u.jsx("span",{className:"block",children:"Attach a reference image"}),u.jsx("span",{className:"block text-[#9CA3AF]",children:"Paste or drop one, too"})]}),children:u.jsx("button",{"aria-label":a>0?`Attach another image, ${a} attached`:"Attach a reference image",className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-md text-[#84848C] transition-[background-color,color,transform] duration-150 hover:bg-white/[0.06] hover:text-[#D1D5DB] active:scale-[0.96] disabled:cursor-not-allowed disabled:opacity-40 motion-reduce:transition-none",disabled:s,onClick:()=>c.current?.click(),type:"button",children:u.jsxs("svg",{"aria-hidden":!0,fill:"none",height:"11",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.7",viewBox:"0 0 16 16",width:"11",children:[u.jsx("rect",{height:"10.5",rx:"1.8",width:"12.5",x:"1.75",y:"2.75"}),u.jsx("circle",{cx:"5.6",cy:"6.3",r:"1.1"}),u.jsx("path",{d:"m14.25 10.4-3.1-3.1a1 1 0 0 0-1.4 0L4.5 12.5"})]})})})]})}function Vv({mode:a,onToggle:s}){return u.jsx(Je,{label:a==="variant"?"Builds a new direction beside this one and leaves this one alone.":"Changes this direction itself. Nothing is kept of what it was.",children:u.jsxs("button",{"aria-label":a==="variant"?"This change makes a new variant. Switch to changing the direction itself.":"This change edits the direction itself. Switch to making a new variant.",className:"mr-auto flex h-6 shrink-0 items-center gap-1 rounded-md px-1.5 text-[10px] font-medium leading-none text-[#84848C] transition-colors hover:bg-white/[0.06] hover:text-[#D1D5DB]",onClick:s,type:"button",children:[a==="variant"?u.jsxs("svg",{"aria-hidden":!0,fill:"none",height:"11",stroke:"currentColor",strokeWidth:"1.7",viewBox:"0 0 16 16",width:"11",children:[u.jsx("circle",{cx:"4.5",cy:"3.6",r:"1.9"}),u.jsx("circle",{cx:"11.5",cy:"12.4",r:"1.9"}),u.jsx("path",{d:"M4.5 5.5v2.6a4.3 4.3 0 0 0 4.3 4.3h0.8",strokeLinecap:"round"})]}):u.jsx("svg",{"aria-hidden":!0,fill:"none",height:"11",stroke:"currentColor",strokeWidth:"1.7",viewBox:"0 0 16 16",width:"11",children:u.jsx("path",{d:"M10.8 2.9 13.1 5.2 5.6 12.7H3.3v-2.3z",strokeLinejoin:"round"})}),a==="variant"?"as a variant":"in place"]})})}function Zv({ready:a,sending:s,target:c}){return u.jsx("button",{"aria-label":c===null?"Send the change":`Send the change to ${c}`,className:`flex h-6 w-6 shrink-0 items-center justify-center rounded-md transition-[background-color,color,transform] duration-150 active:scale-[0.96] motion-reduce:transition-none ${a?"bg-[#E8E8EA] text-[#1C1C20] hover:bg-white":"pointer-events-none text-[#84848C]/60"}`,disabled:!a,type:"submit",children:s?u.jsx("span",{className:"size-3 animate-spin rounded-full border-[1.5px] border-current border-t-transparent motion-reduce:animate-none"}):u.jsx("svg",{"aria-hidden":"true",fill:"none",height:"13",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.75",viewBox:"0 0 16 16",width:"13",children:u.jsx("path",{d:"M8 13V3M3.5 7.5 8 3l4.5 4.5"})})})}const V1="rounded-full bg-[#1C1C20]/85 px-2.5 py-1 text-[11px] font-medium text-[#E8E8EA] shadow-lg backdrop-blur";function Kv({errored:a,fromApp:s,loaded:c,onReload:r,onShowAnyway:f,refusal:d,serverUp:p,src:y}){return a?u.jsx(bm,{onReload:r,reason:p||!s?`${y} didn’t respond.`:"Your dev server stopped. This returns on its own once it is back."}):d!==null?u.jsx(hx,{href:y,onShowAnyway:f,...Ux(d,y,window.location.origin)}):u.jsx(cx,{loaded:c})}function Fv({annotate:a,cover:s=null,onOpen:c=null,boxHeight:r,boxWidth:f,branch:d,branchName:p,busy:y,designWidth:v,errored:g,frameHeight:S,framed:C,fromApp:T,identity:D,loaded:M,name:U,onError:H,onReady:R,onReload:K,onShowAnyway:Q,onStartBranch:X,order:ae,paneScale:ne,refusal:I,scaling:b,second:ie,serverUp:P,shown:ye,splitting:fe,src:Se,title:xe,viewport:Te}){const O=u.jsxs(u.Fragment,{children:[U,b&&u.jsxs("span",{className:"ml-1.5 font-normal text-[#8E8E96]",children:[Math.round(v),"px · ",Math.round(ne*100),"%"]})]});return u.jsxs("div",{className:ye?fe?`relative min-w-0 flex-1 overflow-auto ${ie?"border-l border-[#232328]":""} ${b?"flex flex-col items-center justify-center gap-2.5":C?"flex min-h-full justify-center p-6":""}`:C?"flex min-h-full justify-center p-6":"absolute inset-0":"hidden",style:fe?{order:ae}:void 0,children:[fe&&u.jsx("div",{className:b?"pointer-events-none z-10 flex justify-center":"pointer-events-none absolute inset-x-0 top-0 z-10 flex justify-center p-3",children:c===null?u.jsx("span",{className:V1,children:O}):u.jsx("button",{"aria-label":`Open ${U} on its own`,className:`${V1} pointer-events-auto transition-colors hover:bg-[#2E2E2E] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[#D1D5DB]/60`,onClick:c,type:"button",children:O})}),u.jsxs("div",{className:b?"relative shrink-0 overflow-hidden rounded-[10px] shadow-[0_0_0_1px_rgba(255,255,255,0.12)]":C?`relative h-[calc(100dvh-48px)] shrink-0 overflow-hidden rounded-[10px] shadow-[0_0_0_1px_rgba(255,255,255,0.10)] transition-[width] duration-200 ${ci} motion-reduce:transition-none`:"relative size-full",style:b?{height:r,width:f}:C?{width:Te??void 0}:void 0,children:[u.jsxs("div",{className:b?"relative origin-top-left":"relative size-full",style:b?{height:S,transform:`scale(${ne})`,width:v}:void 0,children:[d!==null&&d.status!=="ready"?u.jsx(fx,{branch:p,onStart:X,state:d}):u.jsx("iframe",{className:`size-full border-0 bg-white ${y?"pointer-events-none":""}`,onError:H,onLoad:W=>{const ue=W.currentTarget.dataset.previewIdentity;ue!==void 0&&(!Se.startsWith("/")||Zf(W.currentTarget))&&R(ue,W.currentTarget)},"data-preview":xe,"data-preview-identity":D,src:Se,title:`Preview: ${U}`},D),a]}),d!==null&&d.status!=="ready"?null:u.jsx(Kv,{errored:g,fromApp:T,loaded:M,onReload:K,onShowAnyway:Q,refusal:I,serverUp:P,src:Se}),s,!P&&M&&T&&u.jsx("div",{className:"pointer-events-none absolute inset-x-0 top-0 flex justify-center p-3",children:u.jsx("span",{className:"rounded-full bg-[#1C1C20]/90 px-2.5 py-1 text-[11px] font-medium text-amber-300/90 shadow-lg",children:"Stale — dev server stopped"})})]})]})}const Yf=[{key:"satoshi",label:"Satoshi",stack:"var(--font-satoshi)"},{key:"outfit",label:"Outfit",stack:"var(--font-outfit)"},{key:"geist",label:"Geist",stack:"var(--font-geist)"}];function Jv({applyOverlayPref:a,copied:s,fontKey:c,href:r,notify:f,onCopyReference:d,onShortcuts:p,open:y,parked:v,popoverRef:g,prefs:S,setPrefs:C,splitting:T,viewing:D,viewports:M}){return u.jsxs("div",{"aria-hidden":!y,"aria-label":"Leglas tools",className:`w-56 rounded-lg border border-[#232328] bg-[#1E1E22] p-1.5 shadow-2xl transition-[opacity,transform] duration-150 ease-[cubic-bezier(0.165,0.84,0.44,1)] focus:outline-none motion-reduce:transition-none ${v?"hidden ":""}${y?"translate-y-0 scale-100 opacity-100":"pointer-events-none translate-y-1 scale-95 opacity-0"}`,inert:!y,ref:g,role:"dialog",tabIndex:-1,children:[u.jsx("span",{className:"block px-1 pb-1 pt-0.5 text-[10px] uppercase tracking-[0.08em] text-[#84848C]",children:"Typeface"}),u.jsx("div",{"aria-label":"Interface typeface",className:"flex items-center gap-0.5 rounded-md bg-[#2E2E2E]/40 p-0.5",role:"group",children:Yf.map(U=>u.jsx("button",{"aria-pressed":c===U.key,className:`flex-1 rounded px-2 py-1 text-xs transition-colors ${c===U.key?"bg-[#2E2E2E] font-medium text-white":"text-[#9CA3AF] hover:text-[#D1D5DB]"}`,onClick:()=>C(H=>({...H,font:U.key})),style:{fontFamily:U.stack},type:"button",children:U.label},U.key))}),u.jsx("span",{className:"block px-1 pb-1 pt-2 text-[10px] uppercase tracking-[0.08em] text-[#84848C]",children:"Viewport"}),u.jsx("div",{"aria-label":"Viewport width",className:"flex items-center gap-0.5 rounded-md bg-[#2E2E2E]/40 p-0.5",role:"group",children:M.map(({label:U,width:H})=>u.jsx("button",{className:`flex-1 rounded px-2 py-1 text-xs transition-colors ${S.viewport===H?"bg-[#2E2E2E] font-medium text-white":"text-[#9CA3AF] hover:text-[#D1D5DB]"}`,onClick:()=>C(R=>({...R,viewport:H})),type:"button",children:U},U))}),T&&u.jsxs("button",{"aria-checked":S.scaleSplit,className:`${oi} mt-1 ${S.scaleSplit?"text-white":"text-[#9CA3AF]"}`,onClick:()=>C(U=>({...U,scaleSplit:!U.scaleSplit})),role:"switch",type:"button",children:[u.jsx("span",{children:"Scale each side to fit"}),u.jsx(ar,{on:S.scaleSplit})]}),u.jsx("span",{className:"block px-1 pb-1 pt-2 text-[10px] uppercase tracking-[0.08em] text-[#84848C]",children:"Dev overlays"}),u.jsxs("button",{"aria-checked":S.showDevOverlays,className:`${oi} ${S.showDevOverlays?"text-white":"text-[#9CA3AF]"}`,onClick:()=>{const U=!S.showDevOverlays;C(H=>({...H,showDevOverlays:U}));for(const H of document.querySelectorAll("iframe"))a(H,!U)},role:"switch",type:"button",children:[u.jsx("span",{children:"Show dev tool overlay"}),u.jsx(ar,{on:S.showDevOverlays})]}),u.jsxs("button",{"aria-checked":S.showWidget,className:`${oi} ${S.showWidget?"text-white":"text-[#9CA3AF]"}`,onClick:()=>{const U=!S.showWidget;C(H=>({...H,showWidget:U})),U||f({kind:"widget",message:"Press T to reopen the tools",tone:"info",ttl:Ge.plain+3e3})},role:"switch",type:"button",children:[u.jsx("span",{children:"Show Leglas overlay"}),u.jsx(ar,{on:S.showWidget})]}),!D&&u.jsxs(u.Fragment,{children:[u.jsx("span",{className:"block px-1 pb-1 pt-2 text-[10px] uppercase tracking-[0.08em] text-[#84848C]",children:"Labs"}),u.jsxs("button",{"aria-checked":S.buildDirections,className:`${oi} ${S.buildDirections?"text-white":"text-[#9CA3AF]"}`,onClick:()=>C(U=>({...U,buildDirections:!U.buildDirections})),role:"switch",type:"button",children:[u.jsx("span",{children:"Build directions with Claude or Codex"}),u.jsx(ar,{on:S.buildDirections})]})]}),!D&&u.jsxs("button",{className:"mt-1 flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-xs text-[#D1D5DB] transition-colors hover:bg-[#2E2E2E]/60 hover:text-white",onClick:d,type:"button",children:[u.jsx(Zt,{d:Vt.copy,size:12}),s?"Copied":"Copy reference"]}),u.jsx(Je,{label:"Or double-click any direction in the rail",children:u.jsxs("a",{className:"flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-xs text-[#D1D5DB] transition-colors hover:bg-[#2E2E2E]/60 hover:text-white",href:r,rel:"noreferrer",target:"_blank",children:[u.jsx("span",{className:"inline-block size-3 rounded-sm border border-current"}),"Open in new tab"]})}),u.jsxs("button",{className:"flex w-full items-center justify-between gap-2 rounded-md px-2 py-1.5 text-left text-xs text-[#D1D5DB] transition-colors hover:bg-[#2E2E2E]/60 hover:text-white",onClick:p,type:"button",children:[u.jsx("span",{children:"Keyboard shortcuts"}),u.jsx("kbd",{className:"rounded border border-[#232328] bg-[#2E2E2E]/60 px-1 py-0.5 font-sans text-[10px] text-[#84848C]",children:"?"})]})]})}function Wv({mac:a,onClose:s,viewer:c}){const r=w.useRef(null),f=Ax(a,c);return w.useEffect(()=>{const d=document.activeElement instanceof HTMLElement?document.activeElement:null;r.current?.focus();const p=y=>{y.key==="Escape"&&(y.preventDefault(),s())};return window.addEventListener("keydown",p),()=>{window.removeEventListener("keydown",p),d?.focus?.()}},[s]),u.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 p-6 backdrop-blur-sm",onPointerDown:d=>{d.target===d.currentTarget&&s()},children:u.jsxs("div",{"aria-label":"Keyboard shortcuts","aria-modal":"true",className:"w-full max-w-sm rounded-lg border border-[#232328] bg-[#1E1E22] p-4 shadow-2xl focus:outline-none",ref:r,role:"dialog",tabIndex:-1,children:[u.jsx("span",{className:"block pb-3 text-[10px] uppercase tracking-[0.08em] text-[#84848C]",children:"Keyboard"}),u.jsx("dl",{className:"flex flex-col gap-2.5",children:f.map(d=>u.jsxs("div",{className:"flex items-baseline justify-between gap-4",children:[u.jsx("dt",{className:"flex shrink-0 items-baseline gap-1",children:d.keys.map((p,y)=>u.jsxs("span",{className:"flex items-baseline gap-1",children:[y>0&&d.join?u.jsx("span",{className:"text-[10px] text-[#84848C]",children:d.join}):null,u.jsx("kbd",{className:"rounded border border-[#232328] bg-[#2E2E2E]/60 px-1.5 py-0.5 font-sans text-[11px] text-[#E8E8EA]",children:p})]},p))}),u.jsx("dd",{className:"text-right text-xs leading-snug text-[#9CA3AF]",children:d.label})]},d.label))})]})})}function Iv({busy:a,count:s,error:c,fallbackFocusRef:r,name:f,onCancel:d,onConfirm:p}){const y=w.useRef(null),v=w.useRef(null),g=w.useRef(d);g.current=d,w.useEffect(()=>{const D=v.current;if(D===null)return;const M=document.activeElement instanceof HTMLElement?document.activeElement:null,U=R=>{R.preventDefault(),g.current()},H=R=>{if(R.key!=="Tab")return;const K=Array.from(D.querySelectorAll("button:not(:disabled)")),Q=K[0],X=K.at(-1);Q===void 0||X===void 0?(R.preventDefault(),D.focus()):R.shiftKey&&document.activeElement===Q?(R.preventDefault(),X.focus()):!R.shiftKey&&document.activeElement===X&&(R.preventDefault(),Q.focus())};return D.addEventListener("cancel",U),D.addEventListener("keydown",H),D.open||D.showModal(),y.current?.focus(),()=>{D.removeEventListener("cancel",U),D.removeEventListener("keydown",H),D.open&&D.close(),(M?.isConnected?M:r.current)?.focus()}},[]);const S=s===1,C=S?"Delete removed direction?":"Clear removed directions?",T=S?`This permanently removes “${f??"this direction"}” from Leglas.`:`This permanently removes all ${s} directions from Leglas.`;return u.jsx("dialog",{"aria-describedby":"delete-removed-description","aria-labelledby":"delete-removed-title","aria-modal":"true",className:"m-auto max-h-[calc(100dvh-3rem)] max-w-none overflow-visible border-0 bg-transparent p-0 text-left text-inherit backdrop:bg-black/50 backdrop:backdrop-blur-sm",onPointerDown:D=>{D.target===D.currentTarget&&!a&&d()},ref:v,role:"alertdialog",tabIndex:-1,children:u.jsxs("div",{className:"w-[calc(100vw-3rem)] max-w-sm overscroll-contain rounded-lg border border-[#232328] bg-[#1E1E22] p-4 shadow-2xl",children:[u.jsx("h2",{className:"text-sm font-medium text-white",id:"delete-removed-title",children:C}),u.jsxs("div",{className:"mt-2 space-y-1 text-xs leading-relaxed text-[#9CA3AF]",id:"delete-removed-description",children:[u.jsx("p",{children:T}),u.jsx("p",{children:"Source files and shared project config stay untouched."})]}),c!==null?u.jsx("p",{className:"mt-3 text-xs leading-relaxed text-red-300",role:"alert",children:c}):null,u.jsxs("div",{className:"mt-4 flex justify-end gap-2",children:[u.jsx("button",{className:"rounded-md px-3 py-1.5 text-xs text-[#D1D5DB] transition-[background-color,color,scale] hover:bg-white/[0.06] hover:text-white active:scale-[0.96] disabled:opacity-50",disabled:a,onClick:d,ref:y,type:"button",children:"Cancel"}),u.jsx("button",{className:"rounded-md bg-red-500/90 px-3 py-1.5 text-xs font-medium text-white transition-[background-color,scale] hover:bg-red-500 active:scale-[0.96] disabled:opacity-60",disabled:a,onClick:p,type:"button",children:a?"Deleting…":S?"Delete":"Delete all"})]})]})})}function Hm(a,s,c,r){const f=w.useRef(r);w.useLayoutEffect(()=>{f.current=r},[r]),w.useEffect(()=>{if(!a)return;s.current?.focus();const d=c.current,p=g=>{g.key==="Escape"&&(f.current(),d?.focus())},y=g=>{const S=g.target instanceof Node?g.target:null;!s.current?.contains(S)&&!d?.contains(S)&&f.current()},v=()=>f.current();return window.addEventListener("keydown",p),window.addEventListener("pointerdown",y),window.addEventListener("blur",v),()=>{window.removeEventListener("keydown",p),window.removeEventListener("pointerdown",y),window.removeEventListener("blur",v)}},[a,s,c])}async function Pv(a){const s=await fetch("/leglas/api/share",a===void 0?{}:{signal:a});if(!s.ok)throw new Error(`the server answered ${s.status}`);return qt(s)}async function Z1(a){const s=await fetch("/leglas/api/share",{body:JSON.stringify(a),headers:{"content-type":"application/json"},method:"POST"});if(!s.ok)throw await ka(s,"Leglas could not start sharing.");return(await qt(s)).share}async function eb(a){const s=await fetch("/leglas/api/share/update",{body:JSON.stringify(a),headers:{"content-type":"application/json"},method:"POST"});if(!s.ok)throw await ka(s,"Leglas could not update the share.");return(await qt(s)).share}async function ko(a,s,c){const r=await fetch(`/leglas/api/share${a}`,{body:JSON.stringify(s),headers:{"content-type":"application/json"},method:"POST"});if(!r.ok)throw await ka(r,c);return(await qt(r)).share}function tb(a,s=!1){return ko("/allow",{path:a,subtree:s},"Leglas could not allow that path.")}function nb(a){return ko("/grants",{name:a},"Leglas could not make another link.")}function lb(a){return ko("/grants/revoke",{id:a},"Leglas could not turn that link off.")}function ab(a){return ko("/grants/extend",{id:a},"Leglas could not extend that link.")}function ib(){return ko("/rotate",{},"Leglas could not replace the links.")}async function K1(){const a=await fetch("/leglas/api/share/stop",{body:"{}",headers:{"content-type":"application/json"},method:"POST"});if(!a.ok)throw await ka(a,"Leglas could not stop sharing.")}const $m={cloudflared:"cloudflared",ngrok:"ngrok"},sb=1400;function ob(){return u.jsx("svg",{"aria-hidden":!0,fill:"none",height:"11",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.8",viewBox:"0 0 16 16",width:"11",children:u.jsx("path",{d:"M8 3.5v9M3.5 8h9"})})}function fr({checked:a,detail:s,disabled:c=!1,onPick:r,title:f}){return u.jsxs("button",{"aria-checked":a,className:`flex w-full items-start gap-2.5 rounded-md px-2 py-1.5 text-left transition-colors ${c?"cursor-not-allowed opacity-50":a?"bg-[#2E2E2E]/70":"hover:bg-white/[0.04]"}`,disabled:c,onClick:r,role:"radio",type:"button",children:[u.jsx("span",{"aria-hidden":!0,className:`mt-[3px] flex size-3 shrink-0 items-center justify-center rounded-full border transition-colors ${a?"border-[#E8E8EA]":"border-[#84848C]"}`,children:u.jsx("span",{className:`size-1.5 rounded-full bg-[#E8E8EA] transition-transform duration-150 motion-reduce:transition-none ${a?"scale-100":"scale-0"}`})}),u.jsxs("span",{className:"min-w-0 flex-1",children:[u.jsx("span",{className:`block text-xs ${a?"text-white":"text-[#D1D5DB]"}`,children:f}),u.jsx("span",{className:"mt-0.5 block truncate text-[10px] leading-snug text-[#84848C]",children:s})]})]})}function ub({busy:a,choice:s,displayName:c,onPick:r,onReach:f,onStart:d,provider:p,rail:y,reach:v,seeded:g,stage:S,stageOfPair:C}){const T=s==="rail"?y.request:S.request,D=y.request.titles.length;return u.jsxs(u.Fragment,{children:[u.jsx("span",{className:"block px-1 pb-1 pt-0.5 text-[10px] uppercase tracking-[0.08em] text-[#84848C]",children:"Share"}),u.jsxs("div",{"aria-label":"What to share",className:"flex flex-col gap-0.5",role:"radiogroup",children:[u.jsx(fr,{checked:s==="rail",detail:D===0?"Nothing on the rail can be shared yet":`${D} direction${D===1?"":"s"}${y.leftOut.length===0?", as you see them":` · ${y.leftOut.length} on ${y.leftOut.length===1?"a branch":"branches"} left out`}`,disabled:D===0,onPick:()=>r("rail"),title:"The whole rail"}),u.jsx(fr,{checked:s==="stage",detail:S.request===null?S.reason??"":zm(S.request.scope,S.request.titles,c),disabled:S.request===null,onPick:()=>r("stage"),title:C?"The comparison on stage":"The direction on stage"})]}),u.jsx("span",{className:"block px-1 pb-1 pt-2.5 text-[10px] uppercase tracking-[0.08em] text-[#84848C]",children:"How far they can go"}),u.jsxs("div",{"aria-label":"How far a viewer can go",className:"flex flex-col gap-0.5",role:"radiogroup",children:[u.jsx(fr,{checked:v==="open",detail:"Your whole dev server, over GET",onPick:()=>f("open"),title:"Anywhere in the app"}),u.jsx(fr,{checked:v==="listed",detail:g===0?"Open a direction first, so Leglas knows what it loads":`These pages and the ${g} files they loaded`,disabled:g===0,onPick:()=>f("listed"),title:"Only what you shared"})]}),u.jsx("div",{className:"mt-1.5 border-t border-[#232328] px-1 pb-1 pt-2",children:p==="none"?u.jsxs(u.Fragment,{children:[u.jsxs("p",{className:"flex items-center gap-1.5 text-[11px] text-amber-300/90",children:[u.jsx(Vf,{}),"No tunnel program found"]}),u.jsxs("p",{className:"mt-1 text-[10px] leading-snug text-[#84848C]",children:["Install ",u.jsx("span",{className:"text-[#9CA3AF]",children:"cloudflared"})," or"," ",u.jsx("span",{className:"text-[#9CA3AF]",children:"ngrok"})," and Leglas will use it. Without one the link only works on this machine."]})]}):u.jsxs("p",{className:"text-[10px] leading-snug text-[#84848C]",children:["Out through ",u.jsx("span",{className:"text-[#9CA3AF]",children:$m[p]})," on this machine. The link lives as long as Leglas does."]})}),u.jsx("button",{className:`mt-1 ${vm}`,disabled:a!==null||T===null||T.titles.length===0,onClick:d,type:"button",children:a==="start"?u.jsx(ui,{}):p==="none"?"Start on this machine":"Start sharing"}),u.jsx("p",{className:"px-1 pb-0.5 pt-2 text-[10px] leading-snug text-[#84848C]",children:v==="open"?"They see the real app and can flip, compare and change the width. They cannot change anything, and they read whatever your dev server serves.":"They see the real app and can flip, compare and change the width. Anything outside what you shared is refused, and Leglas tells you what it turned away so you can let it in."})]})}function rb({busy:a,copied:s,grant:c,index:r,now:f,onCopy:d,onExtend:p,onRevoke:y,only:v}){const g=hy(c.expiresAt,f),S=c.expiresAt-f<3600*1e3,C=my(c.name,r);return u.jsxs("li",{className:"group relative flex h-8 items-center gap-2 rounded-md px-2 transition-colors hover:bg-white/[0.04]",children:[u.jsx("span",{className:"min-w-0 flex-1 truncate text-xs text-[#D1D5DB]",children:C}),u.jsx("span",{className:`shrink-0 text-[10px] group-hover:hidden group-has-[button:focus-visible]:hidden ${S?"text-amber-300/80":c.viewers>0?"text-[#D1D5DB]":"text-[#84848C]"}`,children:c.viewers>0?`${Rm(c.viewers)} · ${g}`:g}),u.jsxs("span",{className:"pointer-events-none absolute right-2 flex shrink-0 items-center gap-0.5 opacity-0 transition-opacity duration-150 group-hover:pointer-events-auto group-hover:opacity-100 group-has-[button:focus-visible]:pointer-events-auto group-has-[button:focus-visible]:opacity-100 motion-reduce:transition-none",children:[u.jsx(Je,{label:s?"Copied":"Copy this link",children:u.jsx("button",{"aria-label":`Copy the ${C} link`,className:_n,onClick:d,type:"button",children:s?u.jsx("span",{className:"text-[10px] text-emerald-300",children:"✓"}):u.jsx(Zt,{d:Vt.link})})}),u.jsx(Je,{label:"Another 24 hours",children:u.jsx("button",{"aria-label":`Extend the ${C} link`,className:_n,disabled:a!==null,onClick:p,type:"button",children:u.jsx(ob,{})})}),u.jsx(Je,{label:v?"Turn off · the last link":"Turn off",children:u.jsx("button",{"aria-label":`Turn the ${C} link off`,className:`${_n} hover:text-red-300`,disabled:a!==null,onClick:y,type:"button",children:u.jsx(Zt,{d:Vt.trash,size:12})})})]})]})}function cb({busy:a,onCreate:s}){const[c,r]=w.useState(""),[f,d]=w.useState(!1);return f?u.jsxs("form",{className:"mt-0.5 flex items-center gap-1 px-2 py-1",onSubmit:p=>{p.preventDefault(),s(c.trim()),r(""),d(!1)},children:[u.jsx("input",{"aria-label":"Who this link is for",autoFocus:!0,className:"min-w-0 flex-1 rounded border border-[#232328] bg-[#2E2E2E]/40 px-1.5 py-1 text-[11px] text-white placeholder:text-[#84848C] focus:outline-none focus:ring-1 focus:ring-[#D1D5DB]/40",maxLength:60,onChange:p=>r(p.target.value),onKeyDown:p=>{p.key==="Escape"&&(r(""),d(!1))},placeholder:"Who is it for?",value:c}),u.jsx("button",{className:"shrink-0 rounded px-2 py-1 text-[11px] font-medium text-[#D1D5DB] transition-colors hover:bg-white/[0.06] hover:text-white disabled:opacity-50",disabled:a!==null,type:"submit",children:a==="grant"?u.jsx(ui,{}):"Make"})]}):u.jsx("button",{className:"mt-0.5 w-full rounded-md px-2 py-1.5 text-left text-[11px] text-[#84848C] transition-colors hover:bg-white/[0.04] hover:text-[#D1D5DB] disabled:opacity-50",disabled:a!==null,onClick:()=>d(!0),type:"button",children:"+ Another link"})}function fb({busy:a,changed:s,copiedId:c,displayName:r,now:f,onAllow:d,onCopy:p,onCreate:y,onExtend:v,onRetry:g,onRevoke:S,onRotate:C,onStop:T,onUpdate:D,share:M}){const U=M.tunnel;return u.jsxs(u.Fragment,{children:[u.jsxs("span",{className:"flex items-center gap-1.5 px-1 pb-1 pt-0.5 text-[10px] uppercase tracking-[0.08em] text-[#84848C]",children:[U.status==="ready"?u.jsx(xr,{}):null,"Sharing"]}),u.jsx("div",{"aria-live":"polite",className:"px-1 pb-1.5 text-[11px] leading-snug",children:U.status==="ready"?u.jsxs("p",{className:"flex items-center gap-1.5",children:[u.jsx(xr,{}),u.jsx("span",{className:"min-w-0 flex-1 truncate select-text font-mono text-[10px] text-[#D1D5DB]","data-selectable":!0,children:new URL(M.grants[0]?.url??"http://x").host})]}):U.status==="starting"?u.jsxs("div",{className:"flex items-start gap-1.5 text-[#9CA3AF]",children:[u.jsx("span",{className:"mt-[3px]",children:u.jsx(ui,{})}),U.url===void 0?u.jsxs("span",{children:["Opening a tunnel through ",$m[U.provider],"…"]}):U.slow?u.jsx("span",{children:"Still waiting for the link to answer from here. New tunnel names take a minute to spread, so it may already work for whoever you send it to."}):u.jsx("span",{children:"Waiting for the link to answer…"})]}):U.status==="failed"?u.jsxs("div",{children:[u.jsxs("p",{className:"flex items-start gap-1.5 text-amber-300/90",children:[u.jsx("span",{className:"mt-0.5",children:u.jsx(Vf,{})}),u.jsx("span",{children:U.reason})]}),u.jsx("button",{className:"mt-1 rounded text-[10px] text-[#9CA3AF] underline underline-offset-2 transition-colors hover:text-white disabled:opacity-50",disabled:a!==null,onClick:g,type:"button",children:"Try again"})]}):u.jsxs("p",{className:"text-[#9CA3AF]",children:["Reachable from this machine only. Point a tunnel of your own at"," ",u.jsxs("span",{className:"select-text font-mono text-[#D1D5DB]","data-selectable":!0,children:["127.0.0.1:",M.sharePort]})," ","and send that host with the same path."]})}),u.jsxs("ul",{"aria-label":"Links into this share",className:"max-h-64 overflow-y-auto",children:[M.grants.map((H,R)=>u.jsx(rb,{busy:a,copied:c===H.id,grant:H,index:R,now:f,onCopy:()=>p(H),onExtend:()=>v(H),onRevoke:()=>S(H),only:M.grants.length===1},H.id)),M.grants.length===0?u.jsx("li",{className:"px-2 py-1.5 text-[11px] text-[#84848C]",children:"No links. Nobody can open this share until you make one."}):null]}),u.jsx(cb,{busy:a,onCreate:y}),M.reach==="listed"&&M.refused.length>0?u.jsxs("div",{className:"mt-1.5 border-t border-[#232328] pt-1.5",children:[u.jsxs("span",{className:"flex items-baseline gap-1.5 px-1 pb-1",children:[u.jsx("span",{className:"text-[10px] uppercase tracking-[0.08em] text-amber-300/90",children:"Turned away"}),u.jsxs("span",{className:"text-[10px] text-[#84848C]",children:[M.refused.length," ",M.refused.length===1?"path":"paths"," your app asked for"]})]}),u.jsx("ul",{"aria-label":"Paths this share turned away",className:"max-h-32 overflow-y-auto",children:M.refused.map(H=>{const R=fy(H);return u.jsxs("li",{className:"group flex h-7 items-center gap-2 rounded-md px-2 transition-colors hover:bg-white/[0.04]",children:[u.jsx("span",{className:"min-w-0 flex-1 select-text truncate font-mono text-[10px] text-[#D1D5DB]","data-selectable":!0,title:H,children:H}),u.jsxs("span",{className:"flex shrink-0 items-center gap-1 opacity-0 transition-opacity duration-150 group-hover:opacity-100 group-has-[button:focus-visible]:opacity-100 motion-reduce:transition-none",children:[u.jsx("button",{"aria-label":`Let ${H} through`,className:"rounded px-1.5 py-0.5 text-[10px] text-[#9CA3AF] transition-colors hover:bg-white/[0.06] hover:text-white disabled:opacity-50",disabled:a!==null,onClick:()=>d(H,!1),type:"button",children:"Allow"}),R===null?null:u.jsx("button",{"aria-label":`Let everything in ${R} through`,className:"rounded px-1.5 py-0.5 text-[10px] text-[#9CA3AF] transition-colors hover:bg-white/[0.06] hover:text-white disabled:opacity-50",disabled:a!==null,onClick:()=>d(R,!0),type:"button",children:"+ folder"})]})]},H)})})]}):null,u.jsxs("p",{className:"truncate px-1 pt-1.5 text-[10px] text-[#84848C]",children:[zm(M.scope,M.titles,r),M.reach==="listed"?" · only what you shared":""]}),u.jsxs("div",{className:"mt-2 flex items-center gap-1 border-t border-[#232328] pt-1.5",children:[s?u.jsx("button",{className:"flex h-7 min-w-0 flex-1 items-center justify-center rounded-md bg-[#2E2E2E] px-2 text-xs font-medium text-white transition-[background-color,transform] duration-150 hover:bg-[#3A3A40] active:scale-[0.98] disabled:opacity-50 motion-reduce:transition-none",disabled:a!==null,onClick:D,type:"button",children:a==="update"?u.jsx(ui,{}):"Update what they see"}):u.jsx("span",{className:"min-w-0 flex-1 truncate px-2 text-[10px] text-[#84848C]",children:M.scope==="rail"?"They see the rail as you do":"They see what you shared"}),u.jsx(Je,{label:u.jsxs(u.Fragment,{children:[u.jsx("span",{className:"block",children:"Replace every link."}),u.jsx("span",{className:"block text-[#9CA3AF]",children:"For when one got somewhere you did not mean to send it."})]}),wide:!0,children:u.jsx("button",{"aria-label":"Replace every link and the address with them",className:"flex h-7 shrink-0 items-center justify-center rounded-md px-2 text-xs text-[#9CA3AF] transition-[color,background-color,transform] duration-150 hover:bg-white/[0.06] hover:text-white active:scale-[0.98] disabled:opacity-50 motion-reduce:transition-none",disabled:a!==null,onClick:C,type:"button",children:a==="rotate"?u.jsx(ui,{}):"Replace all"})}),u.jsx("button",{className:"flex h-7 shrink-0 items-center justify-center rounded-md px-2.5 text-xs text-[#9CA3AF] transition-[color,background-color,transform] duration-150 hover:bg-white/[0.06] hover:text-red-300 active:scale-[0.98] disabled:opacity-50 motion-reduce:transition-none",disabled:a!==null,onClick:T,type:"button",children:a==="stop"?u.jsx(ui,{}):"Stop"})]})]})}function db({active:a,compare:s,displayName:c,notify:r,onClose:f,open:d,prefs:p,previews:y,share:v,triggerRef:g,tunnels:S}){const C=w.useRef(null),[T,D]=w.useState("rail"),[M,U]=w.useState("open"),[H,R]=w.useState(null),[K,Q]=w.useState(null),[X,ae]=w.useState(()=>Date.now());w.useEffect(()=>{if(!d)return;ae(Date.now());const L=window.setInterval(()=>ae(Date.now()),6e4);return()=>window.clearInterval(L)},[d]);const ne=w.useRef(null),I=w.useRef(null),b=w.useRef(null);Hm(d,C,g,f);const[ie,P]=w.useState([]),ye=w.useMemo(()=>A1(p,y).request.titles,[p,y]);w.useEffect(()=>{d&&P(cy(document.querySelectorAll("iframe[data-preview]"),ye,window.location.origin))},[d,ye]);const fe=w.useMemo(()=>A1(p,y,M,ie),[p,y,M,ie]),Se=w.useMemo(()=>oy(p,y,a,s,M,ie),[p,y,a,s,M,ie]),xe=S[0]??"none",Te=v===null?null:v.scope==="rail"?fe.request:Se.request,O=v!==null&&Te!==null&&!uy(Te,{scope:v.scope,titles:v.titles,layout:v.layout,reach:v.reach,routes:v.routes}),W=v?.grants[0]??null,ue=W===null?null:W.url!==null?W.url:v?.tunnel.status==="none"?W.localUrl:null;w.useEffect(()=>()=>{ne.current&&clearTimeout(ne.current)},[]);const je=(L,V=!1,se=null)=>Sr(L).then(pe=>{if(pe==="blocked"){if(Q(null),V)return;r({detail:L,kind:"share",message:"Your browser blocked the clipboard. The link is:",tone:"danger",ttl:null});return}Q(se),ne.current&&clearTimeout(ne.current),ne.current=setTimeout(()=>Q(null),sb),V||r({kind:"share",message:"Share link copied",tone:"success",ttl:Ge.plain})}),Ne=v?.tunnel.status??null;w.useEffect(()=>{if(!(v===null||ue===null||I.current!==v.id)){if(b.current!==v.id){b.current=v.id,je(ue,!0).then(()=>r({kind:"share",message:Ne==="ready"||Ne==="none"?"Your share is live. Link copied.":"Share link copied. Waiting for it to answer…",tone:"success",ttl:Ge.action}));return}Ne==="ready"&&r({kind:"share",message:"Your share is live.",tone:"success",ttl:Ge.plain})}},[v?.id,ue,Ne]);const E=(L,V)=>r({kind:"share",message:L instanceof Error?L.message:V,tone:"danger",ttl:Ge.action}),G=L=>{H===null&&(R("start"),Z1({...L,tunnel:xe}).then(V=>{I.current=V.id}).catch(V=>E(V,"Leglas could not start sharing.")).finally(()=>R(null)))},le=()=>{H===null&&(R("stop"),K1().then(()=>{r({kind:"share",message:"Stopped sharing",tone:"info",ttl:Ge.plain})}).catch(L=>E(L,"Leglas could not stop sharing.")).finally(()=>R(null)))},ce=()=>{H!==null||Te===null||(R("update"),eb(Te).then(()=>{r({kind:"share",message:"Viewers now see the rail as you do",tone:"success",ttl:Ge.plain})}).catch(L=>E(L,"Leglas could not update the share.")).finally(()=>R(null)))},oe=(L,V,se)=>{H===null&&(R(L),V().then(()=>{r({kind:"share",message:se,tone:"success",ttl:Ge.plain})}).catch(pe=>E(pe,"That did not work.")).finally(()=>R(null)))},Ee=()=>{if(H!==null||v===null)return;const L={scope:v.scope,titles:v.titles,layout:v.layout,reach:v.reach,routes:v.routes};R("start"),K1().then(()=>Z1({...L,tunnel:xe})).then(V=>{I.current=V.id}).catch(V=>E(V,"Leglas could not start sharing.")).finally(()=>R(null))};return u.jsx("div",{"aria-hidden":!d,"aria-label":"Share",className:`absolute inset-x-3 top-full z-30 mt-1.5 origin-top-right rounded-lg border border-[#232328] bg-[#1E1E22] p-1.5 text-[#D1D5DB] shadow-2xl transition-[opacity,transform] duration-150 ease-[cubic-bezier(0.165,0.84,0.44,1)] focus:outline-none motion-reduce:transition-none ${d?"translate-y-0 scale-100 opacity-100":"pointer-events-none -translate-y-1 scale-95 opacity-0"}`,inert:!d,ref:C,role:"dialog",tabIndex:-1,children:v===null?u.jsx(ub,{busy:H,choice:T,onReach:U,reach:M,seeded:ie.length,displayName:c,onPick:D,onStart:()=>{const L=T==="rail"?fe.request:Se.request;L!==null&&G(L)},provider:xe,rail:fe,stage:Se,stageOfPair:s!==null&&s!==a}):u.jsx(fb,{busy:H,changed:O,copiedId:K,displayName:c,now:X,onAllow:(L,V)=>oe("allow",()=>tb(L,V),`${L} is in`),onCopy:L=>{const V=L.url??L.localUrl;je(V,!1,L.id)},onCreate:L=>oe("grant",()=>nb(L),L===""?"Link made":`Link for ${L}`),onExtend:L=>oe("extend",()=>ab(L.id),"Another 24 hours on that link"),onRetry:Ee,onRevoke:L=>oe("revoke",()=>lb(L.id),"That link is off"),onRotate:()=>oe("rotate",()=>ib(),"Every link replaced, and the address with them"),onStop:le,onUpdate:ce,share:v})})}const hb=6e4,mb={share:null,tunnels:[]};function pb(a){const[s,c]=w.useState(mb),r=s.share!==null;return w.useEffect(()=>{if(!a)return;let f=!1;const d=ds(p=>Pv(p).then(y=>{f||c(v=>JSON.stringify(v)===JSON.stringify(y)?v:y)}).catch(()=>{}),{everyMs:r?To:hb,subscribe:p=>fs().on("share",p)});return()=>{f=!0,d()}},[a,r]),s}const gb=9e4,xb=6*6e4,dr="https://leglas.vercel.app/changelog/",Gf="leglas:updated";function qm(a){return a!==null&&a.available&&a.latest!==null&&a.latest.version!==a.skipped}function F1(a){return a===null?"Leglas":qm(a)&&a.latest!==null?`${a.latest.version} is out`:`Leglas ${a.version}`}function yb(a,s){const c=s-Date.parse(a);if(!Number.isFinite(c)||c<6e4)return"just now";const r=Math.floor(c/6e4);if(r<60)return`${r} minute${r===1?"":"s"} ago`;const f=Math.floor(r/60);if(f<24)return`${f} hour${f===1?"":"s"} ago`;const d=Math.floor(f/24);return d===1?"yesterday":`${d} days ago`}function Ym(a,s){return a.replace("@latest",`@${s}`)}function Gm(a){switch(a){case"pnpm":return"pnpm dlx";case"bun":return"bunx";case"yarn":return"yarn dlx";default:return"npx"}}function J1(a){if(a===null)return"npx leglas";switch(a.install.kind){case"npx":return`${Gm(a.install.manager)} leglas`;case"project":return`${a.install.manager==="npm"?"npx":`${a.install.manager} exec`} leglas`;default:return"leglas"}}function W1(a){return{heading:"Restarting Leglas",detail:`This page reloads once ${a} answers.`,spinner:!0}}function vb(a,s){const{install:c}=a;if(c.kind==="source")return"You run Leglas from a checkout, so pull to update.";if(a.busy)return"Wait for the running change to finish, then update.";if(c.kind==="npx")return`Restarts Leglas with ${s} through ${Gm(c.manager)}. Your rail stays as it is.`;if(c.command===null)return null;const r=c.kind==="project"?" in this project":"";return`Runs ${Ym(c.command,s)}${r}, then restarts Leglas. Your rail stays as it is.`}function bb(a,s,c,r){const f={heading:"Leglas",title:null,detail:null,meta:null,note:null,link:null,spinner:!1,warning:!1,primary:null,skip:!1};if(s.status==="waiting")return{...f,...W1(s.version)};if(s.status==="wrong")return{...f,heading:"Something else answered",detail:`Leglas ${s.got} is on this port now, not the ${s.version} that was installed.`,note:`Start it again from your terminal: ${J1(a)}`,warning:!0};if(s.status==="lost")return{...f,heading:"Leglas did not come back",detail:`${s.version} was installed, but nothing answered here.`,note:`Look in the terminal: it may have started on another port. Otherwise start it again there with ${J1(a)}.`,warning:!0};if(a===null)return{...f,detail:"Reading…",spinner:!0};const{phase:d}=a;if(d.status==="installing")return{...f,heading:`Updating to ${d.version}`,detail:`Installing with ${a.install.manager}…`,spinner:!0};if(d.status==="waiting")return{...f,heading:`Updating to ${d.version}`,detail:"Installed. Waiting for the running change to finish, then restarting.",spinner:!0};if(d.status==="restarting")return{...f,...W1(d.version)};if(d.status==="failed")return{...f,heading:`Could not update to ${d.version}`,detail:d.reason,note:a.install.command===null?null:`Or run ${Ym(a.install.command,d.version)} yourself.`,warning:!0,primary:{label:"Try again",action:"install",disabled:a.busy}};const p=c||d.status==="checking";if(a.available&&a.latest!==null){const{latest:g}=a,S=g.version===a.skipped,C=a.install.kind!=="source";return{...f,heading:`${g.version} is out`,title:g.title,detail:S?"Skipped. Nothing will nag until the next release.":null,meta:`You have ${a.version}`,note:vb(a,g.version),link:{label:"What's new",url:g.url},primary:C?{label:S?"Update anyway":"Update",action:"install",disabled:a.busy}:null,skip:!S}}const y=a.checkedAt===null?null:yb(a.checkedAt,r),v=y===null?null:`Checked ${y}`;return p?{...f,heading:a.version,detail:"Asking npm…",meta:v,link:{label:"Changelog",url:dr},spinner:!0,primary:{label:"Check again",action:"check",disabled:!0}}:a.checkError!==null?{...f,heading:a.version,detail:a.checkError,meta:y===null?null:`Last answer ${y}`,link:{label:"Changelog",url:dr},warning:!0,primary:{label:"Try again",action:"check",disabled:!1}}:a.latest===null?{...f,heading:a.version,detail:"Not checked yet.",link:{label:"Changelog",url:dr},primary:{label:"Check for updates",action:"check",disabled:!1}}:{...f,heading:a.version,detail:"This is the latest version.",meta:v,link:{label:"Changelog",url:dr},primary:{label:"Check again",action:"check",disabled:!1}}}const wb="flex h-7 shrink-0 items-center justify-center rounded-md px-2.5 text-xs text-[#9CA3AF] transition-colors duration-150 hover:bg-white/[0.06] hover:text-[#D1D5DB] disabled:cursor-not-allowed disabled:opacity-50 motion-reduce:transition-none",Sb="flex h-7 flex-1 items-center justify-center rounded-md border border-[#2E2E33] px-3 text-xs text-[#D1D5DB] transition-colors duration-150 hover:bg-white/[0.04] hover:text-white motion-reduce:transition-none";function jb({onClose:a,open:s,triggerRef:c,updates:r}){const f=w.useRef(null);Hm(s,f,c,a);const[d,p]=w.useState(()=>Date.now());w.useEffect(()=>{if(!s)return;p(Date.now());const g=window.setInterval(()=>p(Date.now()),6e4);return()=>window.clearInterval(g)},[s]);const y=bb(r.status,r.wait,r.checking,d),v=()=>{y.primary!==null&&(y.primary.action==="check"?r.check():r.install())};return u.jsxs("div",{"aria-hidden":!s,"aria-label":"Updates",className:`absolute inset-x-3 top-full z-30 mt-1.5 origin-top-left rounded-lg border border-[#232328] bg-[#1E1E22] p-1.5 text-[#D1D5DB] shadow-2xl transition-[opacity,transform] duration-150 ease-[cubic-bezier(0.165,0.84,0.44,1)] focus:outline-none motion-reduce:transition-none ${s?"translate-y-0 scale-100 opacity-100":"pointer-events-none -translate-y-1 scale-95 opacity-0"}`,inert:!s,ref:f,role:"dialog",tabIndex:-1,children:[u.jsxs("div",{className:"flex items-center justify-between px-1 pb-1.5 pt-0.5",children:[u.jsx("span",{className:"text-[10px] uppercase tracking-[0.08em] text-[#84848C]",children:"Leglas"}),y.link!==null&&u.jsx("a",{className:"text-[10px] text-[#84848C] transition-colors hover:text-[#D1D5DB]",href:y.link.url,rel:"noreferrer",target:"_blank",children:y.link.label})]}),u.jsxs("div",{className:"px-1",children:[u.jsx("p",{className:"text-xs leading-snug text-white",children:y.heading}),y.title!==null&&u.jsx("p",{className:"mt-0.5 text-[11px] leading-snug text-[#D1D5DB]",children:y.title}),y.detail!==null&&u.jsxs("p",{"aria-live":"polite",className:`mt-1 flex items-start gap-1.5 text-[10px] leading-snug ${y.warning?"text-amber-300/90":"text-[#9CA3AF]"}`,children:[y.spinner&&u.jsx("span",{className:"mt-px",children:u.jsx(ui,{})}),y.warning&&u.jsx("span",{className:"mt-px",children:u.jsx(Vf,{})}),u.jsx("span",{children:y.detail})]}),y.meta!==null&&u.jsx("p",{className:"mt-0.5 text-[10px] leading-snug text-[#84848C]",children:y.meta})]}),(y.primary!==null||y.skip)&&u.jsxs("div",{className:"mt-2.5 flex items-center gap-1 px-1",children:[y.primary!==null&&u.jsx("button",{className:vm,disabled:y.primary.disabled,onClick:v,type:"button",children:y.primary.label}),y.skip&&u.jsx("button",{className:y.primary===null?Sb:wb,onClick:r.skip,type:"button",children:y.primary===null?"Skip this version":"Skip"})]}),y.note!==null&&u.jsx("p",{className:"px-1 pb-0.5 pt-2 text-[10px] leading-snug text-[#84848C]",children:y.note})]})}async function Eb(a){const s=await fetch("/leglas/api/update",a===void 0?{}:{signal:a});if(!s.ok)throw await ka(s,`the server answered ${s.status}`);return qt(s)}function Cb(){return Kf("/leglas/api/update/check",{},"Leglas could not check for updates.")}function Nb(a){return Kf("/leglas/api/update/skip",{version:a},"Leglas could not skip that version.")}function Mb(){return Kf("/leglas/api/update/install",{},"Leglas could not start the update.")}const Ab=15*6e4,Tb=15e3,Db=1e3;function I1(a){if(a===null)return null;const{phase:s}=a;return s.status==="installing"||s.status==="waiting"?{version:s.version,allowance:xb}:s.status==="restarting"?{version:s.version,allowance:gb}:null}function kb(a){try{window.sessionStorage.setItem(Gf,a)}catch{}window.location.reload()}function zb(a,s,c){const[r,f]=w.useState(null),[d,p]=w.useState({status:"none"}),[y,v]=w.useState(!1),g=w.useRef({status:r,wait:d,notify:c});w.useEffect(()=>{g.current={status:r,wait:d,notify:c}});const S=d.status==="waiting";w.useEffect(()=>{if(!a)return;let H=!1;const R=ds(K=>Eb(K).then(Q=>{if(H)return;const X=g.current;if(X.status!==null&&Q.version!==X.status.version){const ae=X.wait.status!=="none"?X.wait.version:I1(X.status)?.version??null;if(ae===null||Q.version===ae){kb(Q.version);return}(X.wait.status!=="wrong"||X.wait.got!==Q.version)&&p({status:"wrong",version:ae,got:Q.version})}else X.wait.status!=="none"&&p({status:"none"});f(ae=>JSON.stringify(ae)===JSON.stringify(Q)?ae:Q)}).catch(()=>{if(H||g.current.wait.status!=="none")return;const Q=I1(g.current.status);if(Q===null)return;const X=Date.now();p({status:"waiting",version:Q.version,since:X,until:X+Q.allowance})}),{everyMs:S?Db:s?Tb:Ab,subscribe:K=>fs().on("update",K)});return()=>{H=!0,R()}},[a,s,S]),w.useEffect(()=>{if(d.status!=="waiting")return;const{version:H,until:R}=d,K=window.setTimeout(()=>p(Q=>Q.status==="waiting"?{status:"lost",version:H}:Q),Math.max(0,R-Date.now()));return()=>window.clearTimeout(K)},[d]);const C=r!==null;w.useEffect(()=>{if(!C)return;let H=null;try{H=window.sessionStorage.getItem(Gf),H!==null&&window.sessionStorage.removeItem(Gf)}catch{return}H!==null&&g.current.notify({kind:"update",message:`Leglas is now ${g.current.status?.version??H}`,tone:"success",ttl:Ge.action})},[C]);const T=H=>R=>g.current.notify({kind:"update",message:R instanceof Error?R.message:H,tone:"danger",ttl:Ge.action});return{status:r,wait:d,checking:y,check:()=>{y||(v(!0),Cb().then(H=>f(H)).catch(T("Leglas could not check for updates.")).finally(()=>v(!1)))},skip:()=>{const H=g.current.status?.latest?.version;H!==void 0&&Nb(H).then(R=>{f(R),g.current.notify({kind:"update",message:`${H} skipped`,note:"Nothing will nag until the next release.",tone:"info",ttl:Ge.plain})}).catch(T("Leglas could not skip that version."))},install:()=>{Mb().then(H=>f(H)).catch(T("Leglas could not start the update."))}}}function Rb({buttonRef:a,news:s,onToggle:c,open:r,status:f}){return u.jsx(Je,{label:F1(f),children:u.jsxs("button",{"aria-expanded":r,"aria-haspopup":"dialog","aria-label":s?`Leglas ${f.version}. ${F1(f)}. Open updates`:`Leglas ${f.version}. Open updates`,className:`relative mt-px flex h-5 shrink-0 items-center rounded px-1 text-[10px] font-medium leading-none tabular-nums transition-colors duration-150 hover:bg-white/[0.06] ${s||r?"text-[#D1D5DB] hover:text-white":"text-[#84848C] hover:text-[#D1D5DB]"}`,onClick:c,ref:a,type:"button",children:[f.version,s&&u.jsx("span",{"aria-hidden":!0,className:"absolute -right-px top-0 size-1.5 rounded-full bg-[#7C9CFF]"})]})})}function Ob({active:a,briefing:s,compare:c,displayName:r,notify:f,onBuild:d,onCollapse:p,prefs:y,previews:v,viewing:g}){const[S,C]=w.useState(!1),T=w.useCallback(()=>C(!1),[]),D=w.useRef(null),M=pb(!g),[U,H]=w.useState(!1),R=w.useCallback(()=>H(!1),[]),K=w.useRef(null),Q=zb(!g,U,f),X=qm(Q.status);return u.jsxs("div",{className:"relative z-10 flex shrink-0 items-center justify-between gap-2 border-b border-[#232328] bg-[#1E1E22] px-2.5 py-2.5",children:[u.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[u.jsx(Ao,{size:28}),u.jsx(ym,{height:18}),!g&&Q.status!==null&&u.jsx(Rb,{buttonRef:K,news:X,onToggle:()=>{C(!1),H(ae=>!ae)},open:U,status:Q.status})]}),u.jsxs("span",{className:"flex shrink-0 items-center gap-0.5",children:[d!==null&&u.jsx(Je,{label:"Build new directions",children:u.jsx("button",{"aria-label":"Build a set of new directions","aria-pressed":s,className:`flex h-6 w-6 shrink-0 items-center justify-center rounded p-1 transition-colors hover:bg-[#2E2E2E] hover:text-white ${s?"text-white":"text-[#9CA3AF]"}`,onClick:d,type:"button",children:u.jsx(Zt,{d:Vt.plus,size:13})})}),!g&&u.jsx(Je,{label:M.share===null?"Share this rail":M.share.tunnel.status==="ready"?`Sharing · ${Rm(dy(M.share.grants))}`:"Sharing",children:u.jsxs("button",{"aria-expanded":S,"aria-haspopup":"dialog","aria-label":M.share===null?"Share":"Sharing. Open the share panel",className:`relative flex h-6 w-6 shrink-0 items-center justify-center rounded p-1 transition-colors hover:bg-[#2E2E2E] hover:text-white ${S||M.share!==null?"text-white":"text-[#9CA3AF]"}`,onClick:()=>{H(!1),C(ae=>!ae)},ref:D,type:"button",children:[u.jsx(ax,{}),M.share!==null&&u.jsx(xr,{className:"absolute right-0 top-0"})]})}),u.jsx(Je,{label:u.jsxs(u.Fragment,{children:["Collapse panel ",u.jsx("kbd",{className:"ml-1 text-[#9CA3AF]",children:"["})]}),side:"right",children:u.jsx("button",{"aria-label":"Collapse the directions panel",className:"flex h-6 w-6 shrink-0 items-center justify-center rounded p-1 text-[#9CA3AF] transition-colors hover:bg-[#2E2E2E] hover:text-white",onClick:p,type:"button",children:u.jsx(Zt,{d:Vt.sidebar,size:16})})})]}),!g&&u.jsx(jb,{onClose:R,open:U,triggerRef:K,updates:Q}),!g&&u.jsx(db,{active:a,compare:c,displayName:r,notify:f,onClose:T,open:S,prefs:y,previews:v,share:M.share,triggerRef:D,tunnels:M.tunnels})]})}function Lb({children:a,displayName:s,name:c,preview:r,quiet:f}){const d=f?null:$f(r);return d===null?u.jsx(u.Fragment,{children:a}):u.jsx(Je,{label:u.jsxs(u.Fragment,{children:[u.jsx("span",{className:"block text-white",children:c}),r?.note?u.jsx("span",{className:"mt-0.5 block font-normal text-[#D1D5DB]",children:r.note}):null,u.jsxs("span",{className:"mt-1.5 block border-t border-white/10 pt-1.5 font-normal text-[#84848C]",children:[d.basedOn===null?null:u.jsxs("span",{className:"block",children:["Variant of ",s(d.basedOn)]}),d.askedFor===null?null:u.jsxs("span",{className:"mt-0.5 block",children:["You asked for “",d.askedFor,"”"]})]})]}),side:"right",wide:!0,children:a})}const Bf=["#34D399","#38BDF8","#818CF8","#C084FC","#FB7185","#FB923C"];function _b(a){let s=0;for(const r of a)s=s*31+r.charCodeAt(0)|0;const c=Bf[Math.abs(s)%Bf.length]??Bf[0];return{backgroundColor:`${c}22`,color:c}}function Bb(a){let s=0;for(const c of a)s=s*31+c.charCodeAt(0)|0;return Math.abs(s).toString(36)}function Ub({agent:a,aside:s,slot:c}){return c.state==="building"||c.state==="checking"?u.jsxs("span",{className:`flex h-5 shrink-0 items-center gap-1 rounded bg-white/[0.04] pl-0.5 pr-1.5 text-[10px] font-medium leading-none text-[#84848C]/80 ${s}`,children:[u.jsx(pr,{"aria-label":c.state==="building"?`${a} is building this direction`:"Checking this direction renders",size:20,state:gr,theme:"dark"}),c.state==="building"?"Building":"Checking"]}):c.state==="failed"?u.jsx(Je,{label:c.failure?.message??"It did not build.",children:u.jsx("span",{className:`shrink-0 rounded bg-amber-400/10 px-1.5 py-0.5 text-[10px] font-medium leading-normal text-amber-300/90 ${s}`,children:"Failed"})}):u.jsx("span",{className:`shrink-0 rounded bg-white/[0.04] px-1.5 py-0.5 text-[10px] font-medium leading-normal text-[#84848C] ${s}`,children:"Stopped"})}function Hb({agent:a,aside:s,carrying:c,comparing:r,same:f,scanning:d,slot:p,tag:y,working:v}){return c>0?u.jsxs("span",{className:`shrink-0 rounded bg-white/[0.08] px-1.5 py-0.5 text-[10px] font-medium leading-normal tabular-nums text-[#E8E8EA] ${s}`,children:["+",c]}):r?u.jsx("span",{className:`shrink-0 rounded bg-white/[0.08] px-1.5 py-0.5 text-[10px] font-medium leading-normal text-[#E8E8EA] ${s}`,children:"Comparing"}):p!==null&&p.state!=="ready"?u.jsx(Ub,{agent:a,aside:s,slot:p}):v?u.jsxs("span",{className:`flex h-5 shrink-0 items-center gap-1 rounded bg-white/[0.04] pl-0.5 pr-1.5 text-[10px] font-medium leading-none text-[#84848C]/80 ${s}`,children:[u.jsx(pr,{"aria-label":"Working on direction",size:20,state:gr,theme:"dark"}),"Cooking"]}):f?u.jsx(Je,{label:`Rendered structure, layout, visual styles, media and vector geometry match ${f?.join(", ")} in a 1280 × 800 comparison.`,children:u.jsxs("span",{className:`shrink-0 rounded bg-amber-400/10 px-1.5 py-0.5 text-[10px] font-medium leading-normal text-amber-300/90 ${s}`,children:["Same as ",f?.length===1?f?.[0]:`${f?.length} others`]})}):d?u.jsxs("span",{className:`flex h-5 shrink-0 items-center gap-1 rounded bg-white/[0.04] pl-0.5 pr-1.5 text-[10px] font-medium leading-none text-[#84848C]/80 ${s}`,children:[u.jsx(pr,{"aria-label":"Checking for duplicates",size:20,state:gr,theme:"dark"}),"Cooking"]}):y!==void 0&&u.jsx("span",{className:`shrink-0 rounded px-1.5 py-0.5 text-[10px] font-medium leading-normal ${s}`,style:_b(y),children:y})}function $b({className:a,name:s,onRemove:c,slot:r}){const f=r.slot.state==="building"||r.slot.state==="checking";return u.jsx("div",{className:a,children:f?u.jsx(Je,{label:"Stop building",children:u.jsx("button",{"aria-label":`Stop building the ${s} direction`,className:`${_n} disabled:cursor-wait disabled:opacity-40`,disabled:r.acting,onClick:d=>{d.stopPropagation(),r.onStop()},type:"button",children:u.jsx("span",{className:"block size-2 rounded-[2px] bg-current"})})}):u.jsxs(u.Fragment,{children:[u.jsx(Je,{label:r.slot.state==="failed"?"Try again":"Build it",children:u.jsx("button",{"aria-label":`Build the ${s} direction again`,className:`${_n} disabled:cursor-wait disabled:opacity-40`,disabled:r.acting,onClick:d=>{d.stopPropagation(),r.onRetry()},type:"button",children:u.jsxs(Do,{children:[u.jsx("path",{d:"M13.5 8a5.5 5.5 0 1 1-1.6-3.9"}),u.jsx("path",{d:"M13.7 1.8v2.7H11"})]})})}),u.jsx(Je,{label:"Try a new idea",children:u.jsx("button",{"aria-label":`Replace the ${s} direction with a new idea`,className:`${_n} disabled:cursor-wait disabled:opacity-40`,disabled:r.acting,onClick:d=>{d.stopPropagation(),r.onReplace()},type:"button",children:u.jsx(Do,{children:u.jsx("path",{d:"M8 2.5 9.3 6.7 13.5 8 9.3 9.3 8 13.5 6.7 9.3 2.5 8 6.7 6.7Z"})})})}),u.jsx(Je,{label:"Remove from list",children:u.jsx("button",{"aria-label":`Remove the ${s} direction from the list`,className:_n,onClick:c,type:"button",children:u.jsx(Zt,{d:Vt.trash,size:12})})})]})})}function qb({comparing:a,dragging:s,onToggleCompare:c,renaming:r,slot:f,st:d,title:p,viewing:y}){const v=`pointer-events-none absolute right-2 top-1.5 flex items-center gap-0.5 opacity-0 transition-opacity duration-150 ${r?"invisible":""} ${s?"":"group-hover:pointer-events-auto group-hover:opacity-100 group-has-[button:focus-visible]:pointer-events-auto group-has-[button:focus-visible]:opacity-100"}`;return f!==null&&f.slot.state!=="ready"&&!y?u.jsx($b,{className:v,name:d.displayName(p),onRemove:()=>d.hide(p),slot:f}):u.jsxs("div",{className:v,children:[p!==d.active&&u.jsx(Je,{label:a?"Stop comparing":`Compare with ${d.displayName(d.active)}`,children:u.jsx("button",{"aria-label":a?`Stop comparing ${d.displayName(p)}`:`Compare ${d.displayName(p)} with ${d.displayName(d.active)}`,"aria-pressed":a,className:`${_n} ${a?"text-white":""}`,onClick:g=>{g.stopPropagation(),c()},type:"button",children:u.jsx(Zt,{d:Vt.split})})}),!y&&u.jsxs(u.Fragment,{children:[u.jsx(Je,{label:d.copied?.kind==="link"&&d.copied.title===p?"Copied":"Copy preview link",children:u.jsx("button",{"aria-label":`Copy the preview link to the ${d.displayName(p)} direction`,className:_n,onClick:()=>d.copyLink(p),type:"button",children:d.copied?.kind==="link"&&d.copied.title===p?u.jsx("span",{className:"text-[10px] text-emerald-300",children:"✓"}):u.jsx(Zt,{d:Vt.link})})}),u.jsx(Je,{label:d.copied?.kind==="reference"&&d.copied.title===p?"Copied":u.jsxs(u.Fragment,{children:[u.jsx("span",{className:"block",children:"Copy a detailed reference."}),u.jsx("span",{className:"block",children:"For a teammate or an agent."})]}),children:u.jsx("button",{"aria-label":`Copy a detailed reference to the ${d.displayName(p)} direction`,className:_n,onClick:()=>d.copyReference(p),type:"button",children:d.copied?.kind==="reference"&&d.copied.title===p?u.jsx("span",{className:"text-[10px] text-emerald-300",children:"✓"}):u.jsx(Zt,{d:Vt.copy,size:12})})}),u.jsx(Je,{label:"Rename",children:u.jsx("button",{"aria-label":`Rename the ${d.displayName(p)} direction`,className:_n,onClick:()=>d.startRename(p),type:"button",children:u.jsx(Zt,{d:Vt.pencil,size:12})})}),u.jsx(Je,{label:"Remove from list",children:u.jsx("button",{"aria-label":`Remove the ${d.displayName(p)} direction from the list`,className:_n,onClick:()=>d.hide(p),type:"button",children:u.jsx(Zt,{d:Vt.trash,size:12})})})]})]})}function Yb({arriving:a,comparing:s,crumbBloom:c,drag:r,dragMeta:f,dragging:d,freshFor:p,gutter:y,index:v,insets:g,lit:S,onEnter:C,onFold:T,onOpenAlone:D,onPick:M,onPointerDown:U,onToggleCompare:H,same:R,scanning:K,shiftFor:Q,st:X,tint:ae,title:ne,slot:I,viewing:b,working:ie}){const P=ne===X.active,ye=I?.slot.state==="building"||I?.slot.state==="checking",fe=ie||ye,Se=X.previewFor(ne),xe=d&&r?.title===ne,Te=d&&!xe?Q(v):0,O=X.rowMeta.get(ne),ue=(O?.depth??0)>0,je=d&&X.dragFolded.has(ne)&&(O?.variants??0)===0?O?.descendants??0:0,Ne=ue?g.variant:g.root,E=O?.variants??0,G=O?.folded??!1,le=X.renaming===ne,ce=xe&&r?.blocked?"opacity-0 transition-opacity duration-150":d||le?"transition-opacity duration-150":"group-hover:hidden group-has-[button:focus-visible]:hidden";return u.jsxs("li",{className:`group relative ${xe?`z-30 ${r?.settling?`transition-transform duration-200 ${ci} motion-reduce:transition-none`:""}`:"z-10"} ${d&&!xe?`transition-transform duration-200 ${ci} motion-reduce:transition-none`:""}`,"data-title":ne,onPointerEnter:oe=>C(oe.currentTarget),style:{...xe?{transform:`translateY(${r?.dy??0}px)`}:Te?{transform:`translateY(${Te}px)`}:{},paddingLeft:Ne,viewTransitionName:`row-${Bb(ne)}`},children:[xe&&r?.reason!=null?u.jsx("span",{"aria-live":"polite",className:`pointer-events-none absolute right-2 top-1.5 z-40 rounded bg-white/[0.1] px-1.5 py-0.5 text-[10px] font-medium leading-normal text-[#E8E8EA] shadow-md transition-opacity duration-150 motion-reduce:transition-none ${r.blocked?"opacity-100":"opacity-0"}`,children:r.reason}):null,y>0&&O?.graph?u.jsx(V2,{active:P,arriving:a(ne),bloom:c.title===ne?c.nonce:0,delay:Math.min(v,12)*28,family:(O?.descendants??0)>0,folded:O?.folded??!1,fresh:p(ne),lit:S,row:O.graph,tint:ae,width:y,working:fe}):null,u.jsx(Lb,{displayName:X.displayName,name:X.displayName(ne),preview:Se,quiet:le,children:u.jsx("div",{"aria-pressed":P,className:`relative flex w-full items-start gap-2 rounded-md py-2 pl-3 pr-3 text-left transition-colors ${b?"cursor-pointer":"cursor-grab active:cursor-grabbing"} ${P?"bg-[#2E2E2E] ring-1 ring-inset ring-[#D1D5DB]/40":xe?"bg-white/[0.06]":""} ${xe?"shadow-2xl":""}`,onClick:()=>{if(!le){if(f.current?.suppressed){f.current.suppressed=!1;return}M(),X.setActive(ne)}},onDoubleClick:oe=>{le||oe.target instanceof Element&&oe.target.closest("button")||(window.getSelection()?.removeAllRanges(),D())},onKeyDown:oe=>{oe.target===oe.currentTarget&&(oe.key==="Enter"||oe.key===" ")&&(oe.preventDefault(),M(),X.setActive(ne))},onPointerDown:U,role:"button",tabIndex:0,children:u.jsxs("span",{className:"min-w-0 flex-1",children:[u.jsxs("span",{className:`flex items-center gap-2 ${d||le?"":b?P?"":"group-hover:pr-[20px] group-has-[button:focus-visible]:pr-[20px]":P?"group-hover:pr-[72px] group-has-[button:focus-visible]:pr-[72px]":"group-hover:pr-[98px] group-has-[button:focus-visible]:pr-[98px]"}`,children:[E>0&&u.jsx(Je,{label:G?`Show ${E} variant${E===1?"":"s"}`:"Fold the variants away",children:u.jsxs("button",{"aria-expanded":!G,"aria-label":`${G?"Show":"Hide"} the variants of ${X.displayName(ne)}`,className:"flex shrink-0 items-center gap-1 rounded px-0.5 py-1 text-[#84848C] transition-colors hover:text-[#E8EAED]",onClick:oe=>{oe.stopPropagation(),T()},onPointerDown:oe=>oe.stopPropagation(),type:"button",children:[u.jsx("svg",{className:`size-2.5 transition-transform duration-150 motion-reduce:transition-none ${G?"-rotate-90":""}`,fill:"none",stroke:"currentColor",strokeWidth:2,viewBox:"0 0 10 10",children:u.jsx("path",{d:"M2 3.5 5 6.5 8 3.5",strokeLinecap:"round",strokeLinejoin:"round"})}),G?u.jsx("span",{className:"text-[10px] leading-none tabular-nums",children:E}):null]})}),le?u.jsx(ix,{error:X.renameError,initial:X.displayName(ne),label:`Rename the ${X.displayName(ne)} direction`,onCancel:()=>X.startRename(null),onCommit:(oe,Ee)=>X.rename(ne,oe,Ee)}):u.jsx("span",{className:`min-w-0 flex-1 text-sm font-medium leading-5 transition-colors duration-150 ${P?"text-white":"text-[#D1D5DB] group-hover:text-[#E8EAED]"}`,children:u.jsx("span",{className:`block w-fit min-w-[70%] max-w-full truncate -my-1 py-1 pr-2 ${b?"":"cursor-text"} ${E>0?"":"-ml-3 pl-3"}`,onDoubleClick:b?void 0:oe=>{oe.stopPropagation(),window.getSelection()?.removeAllRanges(),X.startRename(ne)},children:X.displayName(ne)})}),u.jsx(Hb,{agent:I?.agent??"",aside:ce,carrying:je,comparing:s,same:R,scanning:K,slot:I?.slot??null,tag:Se?.tags[0],working:fe})]}),u.jsx("span",{className:`mt-0.5 line-clamp-2 block cursor-text text-xs leading-snug transition-colors ${le&&X.renameError?"text-amber-300/90":P?"text-[#D1D5DB]":"text-[#84848C]"}`,id:le&&X.renameError?"leglas-rename-error":void 0,children:le&&X.renameError?X.renameError:Se?.note??(Se?.branch===void 0?Se?.url:Se.branch)})]})})}),u.jsx(qb,{comparing:s,dragging:d,onToggleCompare:H,renaming:le,slot:I,st:X,title:ne,viewing:b})]})}function Gb({cap:a,inputRef:s,onQuery:c,query:r}){const[f,d]=w.useState(!1);return u.jsx("div",{className:"px-3 pb-1 pt-2",children:u.jsxs("div",{className:"relative",children:[u.jsx("span",{className:"pointer-events-none absolute left-2 top-1/2 -translate-y-1/2 text-[#D1D5DB]",children:u.jsx(Zt,{d:Vt.search})}),u.jsx("kbd",{className:`pointer-events-none absolute right-2 top-1/2 -translate-y-1/2 rounded border border-[#232328] bg-[#2E2E2E]/60 px-1.5 py-0.5 font-sans text-[10px] leading-none tracking-wide text-[#84848C] transition-opacity duration-150 motion-reduce:transition-none ${r||f?"opacity-0":"opacity-100"}`,children:a}),u.jsx("input",{"aria-label":"Search directions",className:"w-full rounded-md border border-[#232328] bg-[#2E2E2E]/40 py-1.5 pl-7 pr-16 text-xs text-white placeholder:text-[#E8EAED] focus:outline-none focus:ring-1 focus:ring-[#D1D5DB]/60",onBlur:()=>d(!1),onFocus:()=>d(!0),onChange:p=>c(p.target.value),onKeyDown:p=>{p.key==="Escape"&&(r?c(""):p.currentTarget.blur())},placeholder:"Search directions…",ref:s,type:"text",value:r})]})})}function Xb({scope:a}){return u.jsx(Je,{label:u.jsxs(u.Fragment,{children:[u.jsx("span",{className:"block",children:"Someone is sharing their Leglas with you, live."}),u.jsx("span",{className:"block text-[#9CA3AF]",children:"Flip, compare and change the width. Nothing you do reaches their machine."})]}),side:"right",wide:!0,children:u.jsxs("div",{className:"flex shrink-0 items-center gap-2 border-b border-[#232328] bg-[#1E1E22] px-3 py-1.5",children:[u.jsx(xr,{}),u.jsx("span",{className:"text-[11px] text-[#D1D5DB]",children:"Shared with you"}),u.jsx("span",{className:"ml-auto min-w-0 truncate text-[10px] text-[#84848C]",children:a==="rail"?"the whole rail":a==="compare"?"a comparison":"one direction"})]})})}const P1=15e3,Qb=3e4,em={height:800,width:1280},Vb=96,Zb=32,tm=10*6e4,nm={attached:!1,running:!1,name:null,activity:null,startedAt:null,stopping:!1,waiting:null,quietSince:null},Kb={agents:[],choice:null,customRun:null,effort:null},Xm=typeof navigator<"u"&&/Mac|iPhone|iPad|iPod/.test(navigator.userAgent),Fb=wm(Xm),lm="linear-gradient(to bottom, transparent, black 12px, black calc(100% - 12px), transparent)";function Jb({previews:a,project:s,scanPreviews:c=!0,viewer:r,warnings:f=[]}){const d=w.useRef(null),p=w.useRef(null),y=w.useRef(null),[v,g]=w.useState(!1),[S,C]=w.useState(null),[T,D]=w.useState(!1),[M,U]=w.useState(!1),H=w.useCallback(()=>y.current?.(),[]),R=w.useCallback(()=>g(m=>!m),[]),K=w.useCallback(()=>g(!1),[]),[Q,X]=w.useState(!1),ae=w.useCallback(()=>X(m=>!m),[]),ne=w.useCallback(()=>wl(m=>!m),[]),[I]=w.useState(()=>typeof window>"u"?null:py(window.location.search)),b=yy({previews:a,project:s,onToggleSplit:H,onToggleHelp:R,onToggleTools:ae,onToggleNote:r===void 0?ne:void 0,suspended:v||S!==null||T,viewer:r===void 0?void 0:{layout:r.layout},link:I}),ie=b.viewing,P=q2(b.lanes),ye=b.insets,fe=hr.current[0],Se=w.useRef(null),xe=w.useRef(new Map),Te=m=>{if(Se.current===null)return!1;!Se.current.has(m)&&!xe.current.has(m)&&xe.current.set(m,performance.now());const j=xe.current.get(m);return j!==void 0&&performance.now()-j<1e3},O=m=>Te(m)||(b.railChildren.get(m)??[]).some(j=>Te(j));w.useEffect(()=>{const m=Se.current??new Set;for(const j of b.rows)m.add(j);Se.current=m});const[W,ue]=w.useState({nonce:0,title:""});w.useEffect(()=>{if(W.title==="")return;const m=setTimeout(()=>ue(j=>({...j,title:""})),950);return()=>clearTimeout(m)},[W]);const[je,Ne]=w.useState(null),E=w.useRef(null),G=w.useCallback(m=>{if(E.current&&clearTimeout(E.current),E.current=null,m===null){Ne(null);return}E.current=setTimeout(()=>{E.current=null,Ne(m)},120)},[]);w.useEffect(()=>()=>{E.current&&clearTimeout(E.current)},[]);const le=m=>m===""?{nodes:[],edges:[]}:C2(b.railParents,b.railChildren,m),ce=je!==null?le(je):{nodes:[],edges:[]},oe=ce.edges.length>0?ce:le(b.active),Ee=N2(b.rows,b.rowMeta,oe),L=w.useRef(new Map),V=w.useRef(!1);V.current=!1;const[,se]=w.useReducer(m=>m+1,0),pe=m=>{const j=b.rowMeta.get(m)?.graph;if(!j)return;const z=L.current.get(m),q=new Set(kf(j).filter(ee=>!z?.has(ee)));return q.size>0&&(V.current=!0),q},Ae=b.rows.map(m=>{const j=b.rowMeta.get(m)?.graph;return j?`${m}=${kf(j).join(",")}`:m}).join("|");w.useEffect(()=>{const m=b.rows.map(q=>[q,b.rowMeta.get(q)?.graph]),j=V.current,z=setTimeout(()=>{L.current=new Map(m.flatMap(([q,ee])=>ee?[[q,new Set(kf(ee))]]:[])),j&&se()},700);return()=>clearTimeout(z)},[Ae]);const Ve=m=>{if(!vl&&"startViewTransition"in document){document.startViewTransition(()=>sm.flushSync(()=>b.toggleFamily(m)));return}b.toggleFamily(m)},st=m=>{if(G(m),m===null){Wt(z=>({...z,on:!1}));return}ue(z=>({nonce:z.nonce+1,title:m}));const j=[...Ha.current?.querySelectorAll("li[data-title]")??[]].find(z=>z.dataset.title===m);j&&Wt(ji(j))},ot=()=>{M||C(null)},_e=async()=>{if(S===null||M)return;const m=S;U(!0),C({...m,error:null});try{await b.deleteRemoved(m.titles),C(null),b.notify({kind:`delete:${m.titles.join("|")}`,message:m.titles.length===1?`${b.displayName(m.titles[0]??"")} permanently deleted`:`${m.titles.length} removed directions permanently deleted`,tone:"info",ttl:Ge.plain})}catch(j){C({...m,error:j instanceof Error?j.message:"The directions could not be deleted."})}finally{U(!1)}},[Ze,Tt]=w.useState(null),ln=Ze!==null,an=w.useRef(!1),[mn,Un]=w.useState(""),[Gl,ms]=w.useState("variant"),[ft,In]=w.useState(!1),pn=b.prefs.buildDirections&&!ie,[za,Hn]=w.useState(!1),mt=za&&pn,[cl,mi]=w.useState(""),[pi,fl]=w.useState(3),[Rt,gn]=w.useState(!1),[jt,gi]=w.useState(!1),[xi,Ra]=w.useState(()=>new Map),[dl,hl]=w.useState(()=>new Set),[ml,Kt]=w.useState(null),[Mn,Ft]=w.useState(null),{jobs:$n,noteJob:yi}=Gv(pn),Pn=w.useMemo(()=>Cv($n),[$n]),Yt=$n.find(Mo)??null,rt=Yt??Mv($n),pl=b.active===null?null:Um(b.urlFor(b.active)),el=w.useMemo(()=>Av(a.map(m=>m.url)),[a]),[Z,de]=w.useState(null),Ce=Z!==null&&el.includes(Z)?Z:pl??(el.length===1?el[0]??null:null);w.useEffect(()=>{const m=p.current;m!==null&&(m.style.height="0px",m.style.height=`${Math.min(m.scrollHeight,96)}px`)},[mn,cl,mt,b.prefs.width]);const Oe=m=>`${m.slot.state}@${m.slot.startedAt??""}`,ve=m=>`${m.state}@${If(m)}`,We=(m,j,z)=>{dl.has(m)||xi.get(m)===j||(Ra(q=>new Map(q).set(m,j)),hl(q=>new Set(q).add(m)),z().catch(q=>{Ra(ee=>new Map([...ee].filter(([re])=>re!==m))),b.notify({kind:"generation",message:q instanceof Error?q.message:String(q),tone:"danger",ttl:Ge.action})}).finally(()=>hl(q=>new Set([...q].filter(ee=>ee!==m)))))},Ie=(m,j)=>dl.has(m)||xi.get(m)===j,Re=m=>{const j=Pn.get(m);return j!==void 0&&q1(b.urlFor(m),j)?j:void 0};Mn!==null&&Mn.from!==b.active&&Ft(null);const ct=m=>m===void 0?[]:m.slots.flatMap(j=>j.state==="ready"&&Re(j.title)!==void 0?[j.title]:[]),tl=Mn!==null&&Mn.from===b.active?$n.find(m=>m.id===Mn.job):void 0,zo=ct(tl),Ro=ct(rt??void 0),pt=zo.length>=2,Xl=b.active===null?void 0:Re(b.active),Oa=!pt&&b.active!==null&&pl!==null&&(Xl===void 0||Xl.slot.state==="ready")?b.active:null,Et=Rt?Oa:null,qn=Et===null?Ce:pl,Ql=m=>{const j=`${m.job.id}:${m.slot.key}`,z=Oe(m),{job:q,slot:ee}=m;return{acting:Ie(j,z),onReplace:()=>We(j,z,()=>$v(q.id,ee.key)),onRetry:()=>We(j,z,()=>Hv(q.id,ee.key)),onStop:()=>We(j,z,()=>Q1(q.id,ee.key))}},Vl=m=>{const j=Re(m);return j===void 0?null:{slot:j.slot,agent:Of(j.job.agent),...Ql(j)}};w.useEffect(()=>{if(rt===null||Mo(rt)||rt.endedAt===null)return;const m=rt.endedAt+tm-Date.now();if(m<=0)return;const j=window.setTimeout(()=>Kt(Lf(rt)),m);return()=>window.clearTimeout(j)},[rt]);const bt=w.useRef(null),ps=w.useRef(new Set);w.useEffect(()=>{for(const m of $n)m.state==="planning"&&ps.current.add(m.id)},[$n]),w.useEffect(()=>{const m=Yt?.slots[0];if(Yt===null||m===void 0||bt.current===Yt.id||!ps.current.has(Yt.id))return;const j=document.querySelector(`li[data-title="${CSS.escape(m.title)}"]`);if(j===null)return;bt.current=Yt.id;const z=window.matchMedia("(prefers-reduced-motion: reduce)").matches;j.scrollIntoView({behavior:z?"auto":"smooth",block:"nearest"})},[Yt,b.rows]);const La=w.useRef(null);w.useEffect(()=>{const m=b.active===null?void 0:Pn.get(b.active),j=m!==void 0&&b.active!==null&&q1(b.urlFor(b.active),m)?m:void 0;if(j!==void 0){La.current={job:j.job.id,key:j.slot.key,title:j.slot.title};return}const z=La.current;if(z===null||b.active!==z.title){La.current=null,b.active!==""&&b.previewFor(b.active)===void 0&&b.setActive(b.rows[0]??"");return}const q=[...Pn.values()].find(ee=>ee.job.id===z.job&&ee.slot.key===z.key);q===void 0||q.slot.title===z.title||b.previewFor(q.slot.title)!==void 0&&(La.current={job:z.job,key:q.slot.key,title:q.slot.title},b.setActive(q.slot.title))},[Pn,b,a]);const gl=()=>{const m=cl.trim();m===""&&Et===null||qn===null||jt||(gi(!0),Uv({surface:qn,brief:m,count:pi,basedOn:Et}).then(j=>{yi(j),mi(""),Hn(!1),Kt(null)}).catch(j=>b.notify({kind:"generation",message:j instanceof Error?j.message:String(j),tone:"danger",ttl:Ge.action})).finally(()=>gi(!1)))},[Ot,Zl]=w.useState([]),_a=w.useRef(new Map),Oo=w.useRef(null),[Lo,Kl]=w.useState(!1),nl=w.useRef(0),An=w.useCallback((m,j)=>{_a.current.set(m,j),Zl(z=>z.map(q=>q.key===m?{...q,status:"uploading",id:null}:q)),Ky(j).then(({id:z})=>Zl(q=>q.map(ee=>ee.key===m?{...ee,status:"ready",id:z}:ee))).catch(()=>Zl(z=>z.map(q=>q.key===m?{...q,status:"failed",id:null}:q)))},[]),Gt=m=>{if(b.active===null||ft)return;const{accepted:j,refused:z}=$y(Ot,m),q=qy(z);if(q!==null&&b.notify({kind:"reference",message:q,tone:"info",ttl:Ge.action}),j.length===0)return;const ee=j.map(re=>({key:crypto.randomUUID(),name:Jf(re.name),type:re.type,bytes:re.size,url:URL.createObjectURL(re),status:"uploading",id:null}));Zl(re=>[...re,...ee]),ee.forEach((re,he)=>{const me=j[he];me!==void 0&&An(re.key,me)})},_o=m=>{_a.current.delete(m);const j=Ot.find(z=>z.key===m);j!==void 0&&URL.revokeObjectURL(j.url),Zl(z=>z.filter(q=>q.key!==m))},Nr=m=>{const j=_a.current.get(m);j!==void 0&&An(m,j)},gs=()=>{_a.current.clear();for(const m of Ot)URL.revokeObjectURL(m.url);Zl([])},[vi,Ba]=w.useState(null),[xs,Jt]=w.useState(!1),[Ua,ll]=w.useState(!1),[Fl,xn]=w.useState(null),bi=w.useRef(null),wi=w.useRef(null),al=w.useRef(null),Si=w.useRef(null),ys=w.useRef(null),vs=w.useRef(null),[bs,Mr]=w.useState(Vb);w.useEffect(()=>{const m=vs.current;if(m===null||typeof ResizeObserver>"u")return;const j=()=>Mr(m.offsetHeight);j();const z=new ResizeObserver(j);return z.observe(m),()=>z.disconnect()},[]);const Ha=w.useRef(null),[xl,Wt]=w.useState({height:0,left:0,on:!1,top:0}),ji=m=>({height:m.offsetHeight,left:m.querySelector('[role="button"]')?.offsetLeft??0,on:!0,top:m.offsetTop});w.useEffect(()=>{Wt(m=>m.on?{...m,on:!1}:m)},[b.rows.join("|")]);const[gt,yn]=w.useState(null),yl=w.useRef(null),$a=w.useRef(null);w.useEffect(()=>{yl.current=gt},[gt]),w.useEffect(()=>{if(!b.focusing)return;const m=b.focusing.target==="search"?d.current:p.current;m?.focus(),m?.select()},[b.focusing]),w.useEffect(()=>{if(!gt)return;const m=$a.current;if(!m)return;const j=q=>{const ee=q.clientY-m.startY,re=q.clientX-m.startX;yn(he=>{if(!he||he.settling)return he;if(!he.started)return Math.abs(ee)<=4&&Math.abs(re)<=4?{...he,dy:ee}:Math.abs(re)>Math.abs(ee)?null:(window.getSelection()?.removeAllRanges(),b.setDragFolded(new Set(m.siblings.filter(wn=>(b.rowMeta.get(wn)?.descendants??0)>0))),{...he,dy:0,measured:!1,started:!0});if(!he.measured)return he;const me=m.rows[he.from];if(!me)return he;const[Be,Le]=he.span??[0,m.rows.length-1],Xe=wn=>{const Xt=m.rows[wn];return Xt?wn<=he.from?Xt.top:Xt.top+Xt.height-me.height:me.top},en=Xe(Be)-me.top,Qe=Xe(Le)-me.top,un=me.height,Zn=un/3;let xt=ee,et=!1;ee<en?(xt=en+Math.max(-Zn,(ee-en)*.3),et=ee<en-un):ee>Qe&&(xt=Qe+Math.min(Zn,(ee-Qe)*.3),et=ee>Qe+un),xt=Math.max(m.minDy,Math.min(m.maxDy,xt));const Ue=me.top+Math.max(en,Math.min(Qe,ee));let Kn=he.from,tn=1/0;for(let wn=Be;wn<=Le;wn+=1){const Xt=Math.abs(Xe(wn)-Ue);Xt<tn&&(tn=Xt,Kn=wn)}return{...he,blocked:et,dy:xt,started:!0,to:Kn}})},z=()=>{const q=yl.current;if(!q?.started){yn(null);return}m.suppressed=!0;const ee=q.blocked&&q.reason!==null,re=ee?q.from:q.to,he=m.rows[q.from],me=m.rows[re];let Be=0;he&&me&&(Be=(re<=q.from?me.top:me.top+me.height-he.height)-he.top),yn({...q,dy:Be,settling:!0,to:re}),window.setTimeout(()=>{if(ee)b.notify(ws(q.title,m.parent,m.siblings));else if(re!==q.from){const[,Le]=q.span??[0,m.rows.length-1],Xe=re>q.from?re+1<=Le?m.rows[re+1]?.title??null:null:m.rows[re]?.title??null;b.reorderAmong(q.title,Xe,m.siblings)}b.setDragFolded(new Set),yn(null),window.setTimeout(()=>{m.suppressed=!1},0)},190)};return window.addEventListener("pointermove",j),window.addEventListener("pointerup",z),window.addEventListener("pointercancel",z),()=>{window.removeEventListener("pointermove",j),window.removeEventListener("pointerup",z),window.removeEventListener("pointercancel",z)}},[gt!==null]),w.useLayoutEffect(()=>{if(!gt?.started||gt.measured)return;const m=$a.current,j=Ha.current,z=j?.parentElement;if(!m||!j||!z)return;const q=[...j.querySelectorAll("li[data-title]")],ee=q.map(Qe=>({height:Qe.offsetHeight,mid:Qe.offsetTop+Qe.offsetHeight/2,title:Qe.dataset.title??"",top:Qe.offsetTop})),re=ee.findIndex(Qe=>Qe.title===gt.title),he=ee[re],me=q[re];if(!he||!me)return;m.startY-=m.oldTop-he.top,m.rows=ee;const Be=z.getBoundingClientRect(),Le=me.getBoundingClientRect();m.minDy=Be.top-Le.top,m.maxDy=Be.bottom-Le.bottom;const Xe=m.siblings.map(Qe=>ee.findIndex(un=>un.title===Qe)).filter(Qe=>Qe!==-1),en=Xe.length?[Math.min(...Xe),Math.max(...Xe)]:null;yn(Qe=>Qe&&!Qe.measured?{...Qe,from:re,height:he.height,measured:!0,span:en,to:re}:Qe)},[gt?.started,gt?.measured,gt?.title]);const ws=(m,j,z)=>{const q=b.displayName(m),ee=j===null?null:b.displayName(j),re=z.length<2;return{note:ee===null?`${q} is the only direction at the top level; its variants travel with it.`:re?`Nothing to reorder it among. Drag ${ee} to move the whole family.`:`Where a direction sits comes from what it was based on. Drag ${ee} to move the whole family.`,kind:"reorder",message:ee===null?"Nothing to reorder":re?`${q} is ${ee}'s only variant`:`${q} stays under ${ee}`,tone:"info",ttl:Ge.action}};w.useEffect(()=>{if(!Q)return;wi.current?.focus();const m=q=>{q.key==="Escape"&&(X(!1),bi.current?.focus())},j=q=>{const ee=q.target instanceof Node?q.target:null;!wi.current?.contains(ee)&&!bi.current?.contains(ee)&&X(!1)},z=()=>X(!1);return window.addEventListener("keydown",m),window.addEventListener("pointerdown",j),window.addEventListener("blur",z),()=>{window.removeEventListener("keydown",m),window.removeEventListener("pointerdown",j),window.removeEventListener("blur",z)}},[Q]);const Ss=Yf.find(m=>m.key===b.prefs.font)??Yf[0],qa=b.prefs.viewport!==null,Yn=48,il=gt?.started??!1,[vl]=w.useState(()=>typeof window<"u"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches),[It,js]=w.useState(null),[Ei,Es]=w.useState([]),Jl=oe.edges,Ci=`${Jl.map(m=>m.join(">")).join(",")}|${il}|${b.prefs.width}|${P}`,Ni=m=>js(j=>{if(j?.d===m?.d)return j;if(j!==null){const z=j;Es(q=>[...q.filter(ee=>ee.d!==z.d),z]),setTimeout(()=>Es(q=>q.filter(ee=>ee!==z)),460)}return m});w.useLayoutEffect(()=>{const m=Ha.current;if(il||m===null||Jl.length===0){Ni(null);return}const j=()=>{const q=m.getBoundingClientRect(),ee=new Map,re=[...m.querySelectorAll("li[data-title]")];for(const me of oe.nodes){const Be=re.find(un=>un.dataset.title===me),Le=Be?.querySelector("[data-mark]");if(!Be||!Le)return Ni(null);const Xe=Le.getBoundingClientRect(),en=Number(Le.getAttribute("r")??0),Qe=me===b.active?3.75:0;ee.set(me,{clear:Qe>0||en>1.5?en+2+Qe:0,x:Xe.left+Xe.width/2-q.left,y:Xe.top+Xe.height/2-Be.getBoundingClientRect().top+Be.offsetTop})}const he=Jl.flatMap(([me,Be])=>{const Le=ee.get(me),Xe=ee.get(Be);return Le&&Xe?[O2([Le,Xe])]:[]}).join(" ");Ni({d:he,height:m.scrollHeight,marks:[...ee.values()]})};j();const z=new ResizeObserver(j);return z.observe(m),()=>z.disconnect()},[il,Ci]);const Lt=b.resizing||il||ln,[Tn,Dn]=w.useState({}),[Wl,Cs]=w.useState({}),Mi=w.useRef(new Set),[Ns,Il]=w.useState({}),[Pl,ea]=w.useState(r?.scope==="compare"||b.linkedCompare!==null),[Ar,Ai]=w.useState(r?.layout.compare??b.linkedCompare),Ms=r===void 0?null:`${r.scope}${r.layout.compare??""}`,[As,Tr]=w.useState(Ms);Ms!==As&&(Tr(Ms),r!==void 0&&(ea(r.scope==="compare"),Ai(r.layout.compare)));const Bo=w.useRef(null);w.useEffect(()=>()=>{Bo.current=b.active},[b.active]),y.current=()=>{!Pl&&vn!==null&&Ai(vn),(vn!==null||Pl)&&ea(m=>!m)};const vn=Gx({active:b.active,previous:Bo.current,pinned:Ar,parent:b.parentOf(b.active),rows:b.rows}),Ya=pt?zo:Xx({active:b.active,compare:vn,split:Pl}),Ti=pt?Kx(Ya.length):{columns:Ya.length,rows:1};w.useEffect(()=>{if(!pt)return;const m=j=>{const z=document.activeElement instanceof Element&&document.activeElement.closest('dialog[open], [role="dialog"], [role="alertdialog"], input, textarea')!==null;j.key==="Escape"&&!j.defaultPrevented&&!z&&Ft(null)};return window.addEventListener("keydown",m),()=>window.removeEventListener("keydown",m)},[pt]);const Ts=new Map(Ya.map((m,j)=>[m,j])),sl=Ya.length>1,Ga=Ya,Ds=w.useRef(new Map),Xa=m=>Tx(m,b.urlFor(m),Ns[m]??0),Qa=m=>{const j=Xa(m);return Ds.current.get(m)===j&&b.isLoaded(m,j)},Uo=Ga.filter(m=>b.branchState(m)?.status==="idle").join("");w.useEffect(()=>{for(const m of Uo.split("").filter(Boolean))b.startBranch(m)},[Uo]);const ta=new Map(Ga.map(m=>[m,Xa(m)])),Ho=[...ta.values()].join(""),Di=w.useRef(ta);Di.current=ta,w.useLayoutEffect(()=>{const m=Ds.current,j=[...ta].filter(([z,q])=>m.get(z)!==q);for(const[z]of j)b.resetLoaded(z);if(j.some(([z])=>Tn[z])&&Dn(z=>{const q={...z};for(const[ee]of j)q[ee]=!1;return q}),j.some(([z])=>Wl[z]!==void 0)){const z=new Set(j.map(([q])=>q));Cs(q=>Object.fromEntries(Object.entries(q).filter(([ee])=>!z.has(ee))))}Ds.current=new Map(ta)},[Ho]);const $o=w.useRef(null),qo=w.useRef(null),[Va,Yo]=w.useState({height:0,width:0}),Dr=w.useCallback(m=>{if($o.current=m,qo.current?.disconnect(),m===null)return;const j=m.getBoundingClientRect();Yo({height:j.height,width:j.width});const z=new ResizeObserver(([q])=>{const ee=q?.contentRect;ee&&Yo({height:ee.height,width:ee.width})});z.observe(m),qo.current=z},[]),{boxHeight:kr,boxWidth:zr,designWidth:Rr,frameHeight:Or,scale:ki,scaling:bl}=Fx({gutter:Yn,panes:Ti.columns,rows:Ti.rows,inset:pt?Zb:0,scaleSplit:pt||b.prefs.scaleSplit,stageHeight:Va.height,stageWidth:Va.width,viewport:b.prefs.viewport}),Go=b.prefs.viewport!==null?Math.round(b.prefs.viewport):Va.width<=0?null:Math.round(sl&&!bl?(Va.width-1)/2:Va.width),Xo=Ze?(()=>{const{x:m,y:j}=y2(Ze);return{bottom:"auto",left:m,right:"auto",top:j}})():void 0,Qo=m=>{if(m.button!==0)return;const j=$o.current?.getBoundingClientRect();if(!j)return;const z=m.currentTarget;z.setPointerCapture(m.pointerId),an.current=!1;const q={x:m.clientX,y:m.clientY};let ee=!1;const re=me=>{!ee&&!v2(q,{x:me.clientX,y:me.clientY})||(ee=!0,Tt(x2({x:me.clientX-j.left,y:me.clientY-j.top},{width:j.width,height:j.height})))},he=me=>{if(z.hasPointerCapture(me.pointerId)&&z.releasePointerCapture(me.pointerId),z.removeEventListener("pointermove",re),z.removeEventListener("pointerup",he),z.removeEventListener("pointercancel",he),Tt(null),!ee)return;an.current=!0;const{corner:Be}=b2({x:me.clientX-j.left,y:me.clientY-j.top},{width:j.width,height:j.height});b.setPrefs(Le=>({...Le,corner:Be})),X(!1)};z.addEventListener("pointermove",re),z.addEventListener("pointerup",he),z.addEventListener("pointercancel",he)},[kn,ks]=w.useState(qx),na=new Set(a.filter(f1).map(m=>m.title)),la=na.size>0,[Gn,Lr]=w.useState({requests:[],agent:nm}),[_r,Vo]=w.useState([]),[zi,wl]=w.useState(!1),[_t,Ri]=w.useState(Kb),[Za,Oi]=w.useReducer(m=>m+1,0);w.useEffect(()=>{if(ie)return;let m=!1;return $1(Za>0).then(j=>{m||Ri(z=>JSON.stringify(z)===JSON.stringify(j)?z:j)}).catch(()=>{}),()=>{m=!0}},[Za,ie]);const[Zo,Xn]=w.useReducer(m=>m+1,0);w.useEffect(()=>{if(ie)return;let m=!1;const z=ds(async q=>{const ee=(re,he)=>fetch(re,{...he,signal:q});await fetch("/leglas/api/requests",{signal:q}).then(re=>qt(re)).then(re=>{if(m)return;const he={requests:re.requests,agent:re.agent??nm};Lr(me=>JSON.stringify(me)===JSON.stringify(he)?me:he)}).catch(()=>{}),await Fy(ee).then(re=>{m||Vo(he=>JSON.stringify(he)===JSON.stringify(re)?he:re)}).catch(()=>{})},{everyMs:To,subscribe:q=>fs().on("requests",q)});return()=>{m=!0,z()}},[Zo,ie]);const kt=nv(_t.choice,_t.agents,_t.customRun),Sl=kt.kind==="chosen"&&(kt.id==="claude"||kt.id==="codex")?kt.id:null,aa=Sl===null?"Claude or Codex":Of(Sl),zs=Sl===null?"Building directions runs on Claude or Codex.":Yt!==null?"A set is being built. Wait for it, or stop it.":qn===null?"Pick a direction on the surface first.":null,Ko=w.useRef(0),Rs=()=>{if(kt.kind!=="chosen")return;const m=Date.now();m-Ko.current<Qb||(Ko.current=m,fv().catch(()=>{}))},Li=kt.kind==="chosen"?_t.agents.find(m=>m.id===kt.id&&m.available):void 0,Br=_t.effort!==null&&Li?.efforts.includes(_t.effort)?_t.effort:null,ol=b.active===null?[]:_r.filter(m=>m.title===b.active),Bt=(()=>{const m=$f(b.active===null?void 0:b.previewFor(b.active));return m===null?null:vy(m.basedOn===null?null:b.displayName(m.basedOn),m.askedFor)})(),ia=b.active===""?[]:b.ancestryOf(b.active),Fo=kt.kind==="chosen"&&_t.agents.some(m=>m.id===kt.id&&m.auth==="signed-out"),_i=sv(Gn.requests,Gn.agent,kt.kind==="chosen"||Gn.agent.attached);w.useEffect(()=>{kt.kind==="none"&&ll(!1)},[kt.kind]),w.useEffect(()=>{if(!Ua)return;al.current?.focus();const m=q=>{q.key==="Escape"&&(ll(!1),Si.current?.focus())},j=q=>{const ee=q.target instanceof Node?q.target:null;!al.current?.contains(ee)&&!Si.current?.contains(ee)&&ll(!1)},z=()=>ll(!1);return window.addEventListener("keydown",m),window.addEventListener("pointerdown",j),window.addEventListener("blur",z),()=>{window.removeEventListener("keydown",m),window.removeEventListener("pointerdown",j),window.removeEventListener("blur",z)}},[Ua]);const Jo=m=>{if(vi!==null||xs)return;const j=_t.agents.find(z=>z.id===m)?.name??"Agent";Ba(m),rv(m).then(()=>{Oi(),ll(!1)}).catch(async()=>{try{const z=await $1(!0);if(Ri(z),z.choice===m){ll(!1);return}}catch{}b.notify({kind:"agent-choice",message:`${j} wasn’t selected. Try again.`,tone:"danger",ttl:Ge.action})}).finally(()=>Ba(null))},Wo=m=>{if(Li===void 0||xs||vi!==null)return;const j=_t.effort;Jt(!0),Ri(z=>({...z,effort:m})),cv(Li.id,m).then(()=>Oi()).catch(()=>{Ri(z=>({...z,effort:j})),b.notify({kind:"agent-choice",message:"Effort could not be saved. Agent settings did not change.",tone:"danger",ttl:Ge.action})}).finally(()=>Jt(!1))},Os=m=>{Fl===null&&(xn("cancel"),dv(m).then(()=>Xn()).catch(()=>{b.notify({kind:"agent-cancel",message:"Leglas could not stop that run.",tone:"danger",ttl:Ge.action})}).finally(()=>xn(null)))},Ur=m=>{Fl===null&&(xn("retry"),hv(m).then(()=>Xn()).catch(()=>{b.notify({kind:"agent-retry",message:"That change could not be retried.",tone:"danger",ttl:Ge.action})}).finally(()=>xn(null)))},sa=m=>{Fl===null&&(xn("dismiss"),mv(m).then(()=>Xn()).catch(()=>{b.notify({kind:"agent-dismiss",message:"That change could not be dismissed.",tone:"danger",ttl:Ge.action})}).finally(()=>xn(null)))};w.useEffect(()=>{let m=!1;const z=ds(q=>fetch("/leglas/api/health",{signal:q}).then(ee=>qt(ee)).then(({reachable:ee})=>{m||ks(re=>Yx(re,ee))}).catch(()=>{}),{everyMs:To,subscribe:q=>fs().on("health",q)});return()=>{m=!0,z()}},[]),w.useEffect(()=>{!kn.reachable||!kn.wasDown||(Dn(m=>{const j={...m};for(const z of Object.keys(j))na.has(z)&&(j[z]=!1);return j}),Il(m=>{const j={...m};for(const z of na)j[z]=(j[z]??0)+1;return j}),ks(m=>({...m,wasDown:!1})))},[kn.reachable,kn.wasDown]);const[Bi,jl]=w.useState({}),[Ls,Io]=w.useState(()=>!document.hidden);w.useEffect(()=>{const m=()=>Io(!document.hidden);return document.addEventListener("visibilitychange",m),()=>document.removeEventListener("visibilitychange",m)},[]);const Qn=new Map(a.map(m=>[m.title,Xa(m.title)])),oa=[...Qn].map(([m,j])=>`${m}${j}`).join(""),Ui=w.useRef(new Map);w.useLayoutEffect(()=>{const m=d2(Ui.current,Qn);m.length>0&&jl(j=>Df(j,m)),Ui.current=new Map(Qn)},[oa]);const ua=(m,j)=>{let z=null;try{z=m.contentDocument}catch{return}if(!z?.head)return;const q=z,ee="leglas-hide-dev-overlays",re=(he,me,Be)=>{const Le=he.getElementById(ee);if(!j){Le?.remove();return}if(Le)return;const Xe=q.createElement("style");Xe.id=ee,Xe.textContent=Be,me.appendChild(Xe)};re(z,z.head,Jx);for(const he of z.querySelectorAll("nextjs-portal")){const me=he.shadowRoot;me&&re(me,me,Wx)}};w.useEffect(()=>{for(const m of document.querySelectorAll("iframe"))ua(m,!b.prefs.showDevOverlays)});const El=m=>{let j=null;try{j=m.contentDocument}catch{return}if(!j?.body)return;const z=[...j.body.querySelectorAll("*")].slice(0,400).map(he=>he.tagName),q=j.defaultView,ee=q?c2(j.body,he=>{const me=q.getComputedStyle(he);return{backgroundColor:me.backgroundColor,backgroundImage:me.backgroundImage,color:me.color}}):[],re=q?r2(j.body,(he,me)=>q.getComputedStyle(he,me)):[];return Px(j.body.innerText??"",z,ee,re)},Po=(m,j)=>{let z;try{z=m.contentDocument?.fonts}catch{}const q=new Promise(re=>window.setTimeout(re,900));(z?.status==="loading"?Promise.race([z.ready.then(()=>{}),q]):Promise.resolve()).then(()=>{const re=()=>{ua(m,!b.prefs.showDevOverlays),j(El(m))};typeof window.requestIdleCallback<"u"?window.requestIdleCallback(re,{timeout:1200}):window.setTimeout(re,0)})},_s=w.useRef(new WeakSet),Ka=(m,j,z)=>{if(Di.current.get(m)!==j)return;const q=b.urlFor(m);if(!q.startsWith("/")&&!Mi.current.has(q)){Lx(m).then(ee=>{Di.current.get(m)===j&&(ee!==null&&Cs(re=>({...re,[m]:ee})),eu(m,j,z))});return}eu(m,j,z)},eu=(m,j,z)=>{b.markLoaded(m,j),Dn(ee=>ee[m]?{...ee,[m]:!1}:ee),ua(z,!b.prefs.showDevOverlays);let q=null;try{q=z.contentDocument}catch{}q===null||_s.current.has(q)||_s.current.add(q)},tu=w.useRef(Ka);tu.current=Ka,w.useEffect(()=>{const m=j=>{if(j.origin!==window.location.origin)return;const z=Hx(j.data);if(z===null)return;const q=$x(document.querySelectorAll("iframe[data-preview]"),j.source),ee=q?.dataset.preview,re=q?.dataset.previewIdentity;q===null||ee===void 0||re===void 0||(z==="ready"?tu.current(ee,re,q):Dn(he=>({...he,[ee]:!0})))};return window.addEventListener("message",m),()=>window.removeEventListener("message",m)},[]);const Hr=c&&!ie?kn.reachable?a:a.filter(m=>!f1(m)):[],Cl=Py(Gn.requests),nu=Cl.toSorted().join("\0"),Bs=Gn.agent.running||Cl.length>0,bn=tv(Gn.requests),Hi=ev(Gn.requests);w.useEffect(()=>{Cl.length!==0&&jl(m=>Df(m,Cl))},[nu]);const sn=Ga.every(m=>Qa(m)),Nl=Cl.length>0?Df(Bi,Cl):Bi,Us=m2(a,Nl),$i=f2(Us),on=!Bs&&sn&&Ls?p2(Hr,Nl)[0]??null:null,Hs=on?.title??null,zn=on===null?null:`${on.title}\0${on.url}`,qi=w.useRef(zn);qi.current=zn;const ra=w.useRef(null),Ml=w.useRef(new Map(a.map(m=>[m.title,m.url])));Ml.current=new Map(a.map(m=>[m.title,m.url]));const lu=(m,j,z)=>{const q=`${m.title}\0${m.url}`;qi.current===q&&ra.current===z&&Ml.current.get(m.title)===m.url&&jl(ee=>h2(ee,m,j))};w.useEffect(()=>{if(on===null)return;const m=ra.current;if(m===null)return;const j=window.setTimeout(()=>{lu(on,{status:"failed"},m)},P1);return()=>clearTimeout(j)},[zn]);const Pt=(m,j)=>{Zf(j)&&(ua(j,!b.prefs.showDevOverlays),window.setTimeout(()=>{const z=`${m.title}\0${m.url}`;qi.current===z&&Po(j,q=>{lu(m,q===void 0?{status:"failed"}:{status:"complete",signature:q},j)})},600))};w.useEffect(()=>{const m=[];for(const j of Ga){const z=ta.get(j)??Xa(j);if(b.isLoaded(j,z)||Tn[j])continue;const q=document.querySelector(`iframe[data-preview="${CSS.escape(j)}"]`);if(q===null)continue;const ee=kn.reachable||!na.has(j)?P1:0;m.push(Rx({frame:q,onFailure:()=>Dn(re=>({...re,[j]:!0})),onReady:()=>Ka(j,z,q),sameOrigin:b.urlFor(j).startsWith("/"),timeoutMs:ee}))}return()=>{for(const j of m)j()}},[Ho,b.loaded,Tn,kn.reachable]);const $s=m=>{Dn(j=>({...j,[m]:!1})),b.resetLoaded(m),Il(j=>({...j,[m]:(j[m]??0)+1}))},Vn=(m,j)=>z=>{if(z.button!==0||ie||b.renaming||b.query.trim()||b.rows.length<2||z.target instanceof Element&&z.target.closest("button, [data-selectable]"))return;const q=Ha.current,ee=q?.parentElement;if(!q||!ee)return;const re=[...q.querySelectorAll("li[data-title]")],he=re.map(Zn=>({height:Zn.offsetHeight,mid:Zn.offsetTop+Zn.offsetHeight/2,title:Zn.dataset.title??"",top:Zn.offsetTop})),me=ee.getBoundingClientRect(),Be=re[j]?.getBoundingClientRect(),Le=b.railParents.get(m)??null,Xe=Le===null?b.railRoots:b.railChildren.get(Le)??[m],en=Xe.length<2?Le===null?"Nothing to reorder":`${b.displayName(Le)}'s only variant`:Le===null?null:`Stays under ${b.displayName(Le)}`;$a.current={maxDy:Be?me.bottom-Be.bottom:0,minDy:Be?me.top-Be.top:0,oldTop:he[j]?.top??0,parent:Le,rows:he,siblings:Xe,startX:z.clientX,startY:z.clientY,suppressed:!1};const Qe=he[0],un=he[1];yn({blocked:!1,dy:0,from:j,gap:Qe&&un?un.top-Qe.top-Qe.height:0,height:he[j]?.height??0,measured:!0,reason:en,span:null,title:m,settling:!1,started:!1,to:j})},au=m=>{if(!gt?.started)return 0;const j=gt.height+gt.gap;return m<gt.from&&m>=gt.to?j:m>gt.from&&m<=gt.to?-j:0},Fa=w.useCallback(()=>wl(!1),[]),Al=(m,j,z)=>(Rs(),Jy(m,z,j).then(()=>(Xn(),!0)).catch(()=>(b.notify({kind:"request",message:"That annotation could not be kept.",tone:"danger",ttl:Ge.action}),!1))),qs=(m,j)=>Wy(m,j).then(()=>(Xn(),!0)).catch(()=>(b.notify({kind:"request",message:"That annotation could not be changed.",tone:"danger",ttl:Ge.action}),!1)),iu=m=>{Iy([m]).then(()=>Xn()).catch(()=>{})},Ys=m=>{window.open(b.urlFor(m),"_blank","noopener,noreferrer")},Gs=u.jsx(wv,{agents:_t.agents,chip:kt,chosenSignedOut:Fo,connectRef:ys,menuRef:al,onConnect:()=>D(!0),onPick:Jo,onPickEffort:Wo,onRefresh:Oi,open:Ua,pickingAgent:vi,savingEffort:xs,selectedAgent:Li,selectedEffort:Br,setOpen:ll,triggerRef:Si});return u.jsxs("main",{className:`flex h-dvh bg-[#1C1C20] text-white antialiased selection:bg-[#E6E8EC] selection:text-[#17181B] ${b.resizing?"cursor-col-resize":""} ${Lt?"select-none":""}`,"data-leglas-shell":"",style:{fontFamily:Ss.stack},children:[u.jsxs("aside",{className:`relative shrink-0 overflow-hidden border-r border-[#232328] ${b.prefs.collapsed?"":"shadow-2xl"} ${b.resizing?"":`transition-[width] duration-200 ${ci} motion-reduce:transition-none`}`,style:{width:b.prefs.collapsed?48:b.prefs.width},children:[u.jsxs("div",{className:`flex h-full flex-col transition-opacity duration-150 ${b.prefs.collapsed?"pointer-events-none opacity-0":"opacity-100"}`,inert:b.prefs.collapsed,style:{width:b.prefs.width},children:[u.jsx(Ob,{active:b.active,briefing:mt,compare:sl&&!pt?vn:null,displayName:b.displayName,notify:b.notify,onBuild:pn?()=>{Hn(!mt),mt||window.requestAnimationFrame(()=>p.current?.focus())}:null,onCollapse:()=>b.setPrefs(m=>({...m,collapsed:!0})),prefs:b.prefs,previews:a,viewing:ie}),r!==void 0&&u.jsx(Xb,{scope:r.scope}),u.jsx(Gb,{cap:Fb,inputRef:d,onQuery:b.setQuery,query:b.query}),f.length>0&&u.jsxs("section",{"aria-label":"Preview warning",className:"mx-3 mb-1 mt-1 rounded-md border border-amber-400/20 bg-amber-400/[0.07] px-2.5 py-2",children:[u.jsx("p",{className:"text-xs font-medium text-amber-300/90",children:"Preview may be from another project"}),f.map(m=>u.jsx("p",{className:"mt-0.5 text-[11px] leading-snug text-[#9CA3AF]",children:m},m))]}),la&&!kn.reachable&&u.jsxs("div",{className:"mx-3 mb-1 mt-1 rounded-md border border-amber-400/20 bg-amber-400/[0.07] px-2.5 py-2",children:[u.jsx("p",{className:"text-xs font-medium text-amber-300/90",children:"Dev server not responding"}),u.jsx("p",{className:"mt-0.5 text-[11px] leading-snug text-[#9CA3AF]",children:"Anything on screen is from before it stopped. Previews return on their own once it is back."})]}),u.jsxs("div",{className:"flex-1 overflow-y-auto px-3 py-2 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",style:{WebkitMaskImage:lm,maskImage:lm},children:[u.jsxs("ul",{className:"relative flex flex-col gap-1","data-traced":je??"",onPointerLeave:()=>{G(null),Wt(m=>({...m,on:!1}))},ref:Ha,children:[u.jsx("div",{"aria-hidden":!0,className:`pointer-events-none absolute right-0 z-0 rounded-md bg-white/[0.06] transition-[transform,height,opacity,left] duration-150 ${ci} motion-reduce:transition-none`,style:{height:xl.height,left:xl.left,opacity:xl.on&&!il?1:0,transform:`translateY(${xl.top}px)`}}),b.rows.map((m,j)=>u.jsx(Yb,{arriving:O,comparing:sl&&!pt&&m===vn,crumbBloom:W,drag:gt,dragMeta:$a,dragging:il,freshFor:pe,gutter:P,index:j,insets:ye,lit:Ee?.get(m),onEnter:z=>{G(m),Wt(ji(z))},onFold:()=>Ve(m),onOpenAlone:()=>Ys(m),onPick:()=>Ft(null),onPointerDown:Vn(m,j),onToggleCompare:()=>{if(Ft(null),sl&&!pt&&m===vn){ea(!1);return}Ai(m),ea(!0)},same:$i[m],scanning:Hs===m,shiftFor:au,st:b,tint:fe,title:m,viewing:ie,slot:pn?Vl(m):null,working:bn.has(m)},m)),Ei.filter(m=>m.d!==It?.d).map(m=>u.jsx(N1,{d:m.d,height:m.height,leaving:!0,marks:m.marks,still:vl,width:P},`leaving:${m.d}`)),It!==null&&u.jsx(N1,{d:It.d,height:It.height,marks:It.marks,still:vl,width:P},It.d)]}),b.rows.length===0&&u.jsx("div",{className:"px-3 py-2",children:b.query.trim()?u.jsxs(u.Fragment,{children:[u.jsxs("p",{className:"text-xs text-[#9CA3AF]",children:["Nothing matches “",b.query,"”."]}),u.jsx("button",{className:"mt-1 rounded text-xs text-[#84848C] underline underline-offset-2 transition-colors hover:text-[#D1D5DB]",onClick:()=>b.setQuery(""),type:"button",children:"Clear search"})]}):u.jsx("p",{className:"text-xs leading-snug text-[#9CA3AF]",children:ie?"Nothing here was shared.":b.visibleCount===0&&b.hiddenCount>0?"Every direction is removed. Restore one below.":"No directions yet. Add them to leglas.config.ts."})}),!ie&&b.hiddenCount>0&&u.jsxs("div",{className:"mt-1 flex items-center justify-between gap-2",children:[u.jsxs("button",{className:"min-w-0 flex-1 rounded px-3 py-1.5 text-left text-[11px] text-[#84848C] transition-colors hover:text-[#D1D5DB]",onClick:()=>b.setShowHidden(m=>!m),type:"button",children:[b.showHidden?"Hide":"Show"," removed (",b.hiddenCount,")"]}),b.showHidden?u.jsx("button",{className:"rounded px-3 py-1.5 text-[11px] text-[#9CA3AF] transition-[color,scale] hover:text-red-300 active:scale-[0.96]",onClick:()=>C({error:null,titles:[...b.prefs.hidden]}),type:"button",children:"Clear all"}):null]}),!ie&&b.showHidden&&u.jsx("ul",{className:"relative",children:b.prefs.hidden.filter(b.matches).map(m=>u.jsx("li",{className:"group relative",children:u.jsxs("div",{className:"flex items-center justify-between rounded-md px-3 py-2 transition-colors group-hover:bg-white/[0.04]",children:[u.jsx("span",{className:"truncate text-sm font-medium text-[#9CA3AF]",children:b.displayName(m)}),u.jsxs("div",{className:"flex shrink-0 items-center gap-3",children:[u.jsx("button",{className:"rounded text-[11px] text-[#9CA3AF] transition-colors hover:text-white",onClick:()=>{b.restore(m),b.notify({kind:`remove:${m}`,message:`${b.displayName(m)} is back in the list`,tone:"success",ttl:Ge.plain})},type:"button",children:"Restore"}),u.jsx("button",{className:"rounded text-[11px] text-[#84848C] transition-[color,scale] hover:text-red-300 active:scale-[0.96]",onClick:()=>C({error:null,titles:[m]}),type:"button",children:"Delete"})]})]})},m))})]}),u.jsxs("div",{ref:vs,children:[pn&&rt!==null&&(Mo(rt)||Lf(rt)!==ml&&rt.endedAt!==null&&Date.now()-rt.endedAt<tm)&&u.jsx(Rv,{compare:Ro.length>=2?{count:Ro.length,toggle:()=>Ft(pt&&tl?.id===rt.id?null:{from:b.active,job:rt.id})}:null,comparing:pt&&tl?.id===rt.id,job:rt,onDismiss:()=>Kt(Lf(rt)),onStop:()=>We(`${rt.id}:set`,ve(rt),()=>Q1(rt.id)),stopping:Ie(`${rt.id}:set`,ve(rt))}),!ie&&_i!==null&&u.jsx(jv,{action:Fl,card:_i,onCancel:Os,onDismiss:sa,onRetry:Ur}),!ie&&u.jsx("form",{className:"relative px-3 pb-2.5 pt-2",onSubmit:m=>{if(m.preventDefault(),mt){zs===null&&gl();return}const j=mn.trim(),z=b.active;if(!j&&ol.length===0||!z||ft||pt)return;const q=b.displayName(z),ee=Qy(Ot);if(ee!==null){b.notify({kind:"request",message:ee==="uploading"?"Still uploading an image. Try again in a moment.":"One image did not upload. Retry it or remove it, then send.",tone:"info",ttl:Ge.action});return}const re=Xy(Ot),he={title:z,intent:j,mode:Gl};Go!==null&&(he.width=Go),sl&&vn!==null&&vn!==z&&(he.compare=vn),re.length>0&&(he.references=re),In(!0),fetch("/leglas/api/request",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(he)}).then(me=>qt(me)).then(me=>{if(me.duplicate===!0){In(!1),b.notify({kind:"request",message:`That exact change to ${q} is already queued.`,tone:"info",ttl:Ge.action});return}if(!me.ok&&Wn(me.error)){In(!1),b.notify({kind:"request",message:me.error,tone:"danger",ttl:Ge.action});return}if(!me.ok||!me.prompt)throw new Error("refused");Un(""),gs(),In(!1),Xn(),b.notify({kind:"request",message:`Asked for a change to ${q}.`,tone:"success",ttl:Ge.plain}),Sr(me.prompt).then(Be=>{b.notify({kind:"request",message:Be==="copied"?`Asked for a change to ${q}. Prompt copied.`:`Asked for a change to ${q}. Your browser blocked the clipboard, so read it with npx leglas requests.`,tone:"success",ttl:Ge.plain})})}).catch(()=>{In(!1),b.notify({kind:"request",message:`That request never reached Leglas. ${q} is unchanged.`,tone:"danger",ttl:Ge.action})})},children:u.jsxs("div",{className:`rounded-md border bg-[#2E2E2E]/40 transition-colors ${Lo?"border-[#7C9CFF]/70 ring-1 ring-[#7C9CFF]/40":"border-[#232328] focus-within:border-[#D1D5DB]/40 focus-within:ring-1 focus-within:ring-[#D1D5DB]/40"}`,onDragEnter:m=>{mt||!cr(m.dataTransfer.types)||(m.preventDefault(),nl.current+=1,Kl(!0))},onDragLeave:m=>{cr(m.dataTransfer.types)&&(nl.current=Math.max(0,nl.current-1),nl.current===0&&Kl(!1))},onDragOver:m=>{mt||!cr(m.dataTransfer.types)||(m.preventDefault(),m.dataTransfer.dropEffect="copy")},onDrop:m=>{mt||!cr(m.dataTransfer.types)||(m.preventDefault(),nl.current=0,Kl(!1),Gt(Array.from(m.dataTransfer.files)))},children:[mt?u.jsxs("div",{className:"flex items-center justify-between gap-2 pl-2.5 pr-1 pt-1",children:[Et!==null?u.jsxs("span",{className:"min-w-0 truncate text-[10px] font-medium leading-5 text-[#84848C]",children:["Variations of ",b.displayName(Et)]}):el.length>1&&Ce!==null?u.jsxs("label",{className:"flex items-center gap-1 text-[10px] font-medium leading-5 text-[#84848C]",children:["New",u.jsx("select",{"aria-label":"The surface to build directions for",className:"rounded bg-white/[0.06] px-1 text-[10px] font-medium text-[#D1D5DB] focus:outline-none focus-visible:ring-1 focus-visible:ring-[#D1D5DB]/60",onChange:m=>de(m.target.value),value:Ce,children:el.map(m=>u.jsx("option",{value:m,children:m},m))}),"directions"]}):u.jsx("span",{className:"text-[10px] font-medium leading-5 text-[#84848C]",children:Ce===null?"New directions":`New ${Ce} directions`}),u.jsxs("span",{className:"flex min-w-0 shrink-0 items-center gap-0.5",children:[Oa!==null&&(Et!==null||Ce===pl)&&u.jsxs("button",{"aria-pressed":Et!==null,className:`h-5 max-w-36 truncate rounded px-1.5 text-[10px] font-medium leading-5 transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[#D1D5DB]/60 ${Et===null?"text-[#84848C] hover:bg-white/[0.06] hover:text-[#D1D5DB]":"bg-white/[0.08] text-[#E8E8EA] hover:bg-white/[0.12]"}`,disabled:jt,onClick:()=>gn(Et===null),type:"button",children:["More like ",b.displayName(Oa)]}),u.jsx("button",{"aria-label":"Close the brief",className:"flex size-5 items-center justify-center rounded text-[#84848C] transition-colors hover:bg-white/[0.06] hover:text-white",onClick:()=>Hn(!1),type:"button",children:u.jsx("svg",{"aria-hidden":"true",height:"10",viewBox:"0 0 16 16",width:"10",children:u.jsx("path",{d:"m4 4 8 8M12 4l-8 8",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.75"})})})]})]}):u.jsx(Vy,{drafts:Ot,onRemove:_o,onRetry:Nr}),u.jsx("textarea",{"aria-label":mt?Et!==null?`Say what the variations of ${b.displayName(Et)} should vary, or leave it to ${aa}`:Ce===null?`Describe the new directions for ${aa} to build`:`Describe the new ${Ce} directions for ${aa} to build`:pt?"Open one of the directions to ask for a change":b.active?`Ask your agent to change the ${b.displayName(b.active)} direction`:"Ask your agent to change a direction",className:"block w-full resize-none overflow-y-auto bg-transparent px-2.5 pb-1 pt-2 text-xs leading-4 text-white placeholder:text-[#84848C] focus:outline-none disabled:cursor-not-allowed disabled:opacity-60",disabled:mt?jt:ft||!b.active||pt,onChange:m=>{if(mt){mi(m.target.value);return}mn===""&&m.target.value!==""&&Rs(),Un(m.target.value)},onFocus:mt?void 0:Rs,onKeyDown:m=>{if(mt&&m.key==="Escape"){m.preventDefault(),Hn(!1);return}m.key==="Enter"&&!m.shiftKey&&(m.preventDefault(),m.currentTarget.form?.requestSubmit())},onPaste:m=>{if(mt)return;const j=Array.from(m.clipboardData.files);j.length!==0&&(m.preventDefault(),Gt(j))},placeholder:mt?Et!==null?"What should they vary? Optional":Ce===null?"Pick a direction on the surface first":"What should they explore?":pt?"Open one of them to ask for a change":b.active===null?"No direction to change yet":Lo?"Drop the image here":Ot.length>0&&ol.length===0?`Say what to take from the ${Ot.length===1?"image":"images"}…`:ol.length>0?`Send ${ol.length===1?"the annotation":`${ol.length} annotations`}, or add words…`:`Change ${b.displayName(b.active)}…`,ref:p,rows:1,value:mt?cl:mn}),mt&&Sl!==null&&u.jsxs("p",{className:"px-2.5 text-[10px] leading-4 text-[#84848C]",children:["Runs on your ",aa," plan. Usually"," ",Sl==="codex"?"two or three minutes":"a minute or two","."]}),mt?u.jsx(kv,{count:pi,onCount:fl,agent:aa,picker:Sl===null?Gs:null,reason:zs,ready:(cl.trim()!==""||Et!==null)&&qn!==null,starting:jt}):u.jsxs("div",{className:"flex items-center justify-end gap-1.5 p-1",children:[u.jsx(Vv,{mode:Gl,onToggle:()=>ms(Gl==="variant"?"replace":"variant")}),u.jsx(Qv,{count:Ot.length,disabled:!b.active||ft||Ot.length>=Ff,inputRef:Oo,onFiles:Gt}),u.jsx(Xv,{annotating:zi,count:ol.length,onToggle:()=>zi?Fa():wl(!0)}),Gs,u.jsx(Zv,{ready:(mn.trim()!==""||ol.length>0)&&!!b.active&&!ft,sending:ft,target:b.active?b.displayName(b.active):null})]})]})}),ft?u.jsx("div",{className:"px-3 pb-2",children:u.jsx("p",{"aria-live":"polite",className:"min-w-0 truncate text-[10px] leading-snug text-[#84848C]",children:"Capturing the design for your agent…"})}):ia.length>0?u.jsx(Z2,{askedFor:$f(b.previewFor(b.active))?.askedFor??null,chain:ia,displayName:b.displayName,onCompare:m=>{Ai(m),ea(!0)},onGo:b.setActive,onRail:m=>b.rows.includes(m),onTrace:st,openAsk:!0,self:b.active,tint:fe,traced:je}):Bt===null?null:u.jsx("div",{className:"px-3 pb-2",children:u.jsx("p",{className:"min-w-0 truncate text-[10px] leading-snug text-[#84848C]",title:Bt,children:Bt})}),b.prefs.showWidget?!ie&&Gn.agent.attached&&_i===null?u.jsx("div",{className:"px-3 pb-2",children:u.jsx("p",{className:"min-w-0 truncate text-[10px] leading-snug text-[#84848C]",children:"Your agent is listening"})}):null:u.jsx("div",{className:"px-3 pb-2",children:u.jsxs("button",{className:"min-w-0 max-w-full truncate rounded text-left text-[10px] leading-snug text-[#84848C] transition-colors hover:text-[#D1D5DB]",onClick:()=>X(!0),type:"button",children:["Bring the tools back ",u.jsx("kbd",{className:"font-sans text-[#9CA3AF]",children:"T"})]})})]})]}),u.jsxs("div",{className:`absolute inset-y-0 left-0 z-30 flex w-12 flex-col items-center bg-[#1C1C20] py-3 transition-opacity duration-150 ${b.prefs.collapsed?"opacity-100":"pointer-events-none opacity-0"}`,inert:!b.prefs.collapsed,children:[u.jsx(Ao,{size:24}),u.jsx(Je,{label:u.jsxs(u.Fragment,{children:["Open directions ",u.jsx("kbd",{className:"ml-1 text-[#9CA3AF]",children:"["})]}),side:"right",children:u.jsx("button",{"aria-label":"Open the directions panel",className:"mt-3 flex h-6 w-6 items-center justify-center rounded p-1 text-[#9CA3AF] transition-colors hover:bg-[#2E2E2E] hover:text-white",onClick:()=>b.setPrefs(m=>({...m,collapsed:!1})),type:"button",children:u.jsx(Zt,{d:Vt.sidebar,size:16})})})]}),!b.prefs.collapsed&&u.jsx("div",{"aria-hidden":!0,className:"group/resize absolute inset-y-0 right-0 z-20 flex w-3 cursor-col-resize touch-none justify-end",onPointerDown:b.onHandlePointerDown,children:u.jsx("span",{className:`h-full transition-all duration-150 ${b.resizing?"w-0.5 bg-[#9CA3AF]":"w-px bg-[#232328] group-hover/resize:w-0.5 group-hover/resize:bg-[#9CA3AF]"}`})})]}),u.jsx("span",{"aria-live":"polite",className:"sr-only",role:"status",children:b.copied===null?"":b.copied.kind==="link"?"Link copied":"Reference copied"}),u.jsxs("div",{className:`relative min-w-0 flex-1 ${pt?"grid gap-px bg-[#232328]":sl?"flex":"overflow-auto"}`,ref:Dr,style:pt?{gridTemplateColumns:`repeat(${Ti.columns}, minmax(0, 1fr))`,gridTemplateRows:`repeat(${Ti.rows}, minmax(0, 1fr))`}:void 0,children:[Ga.map(m=>u.jsx(Fv,{annotate:!ie&&zi&&m===b.active?u.jsx(By,{notes:ol,onExit:Fa,onForget:iu,onKeep:(j,z)=>Al(m,j,z),onRevise:qs,paneScale:ki,scaling:bl,sent:Hi,title:m}):null,boxHeight:kr,boxWidth:zr,cover:(()=>{const j=pn?Re(m):void 0;if(j===void 0||j.slot.state==="ready")return null;const z=Ql(j);return u.jsx(_v,{acting:z.acting,agent:Of(j.job.agent),name:b.displayName(m),onReplace:z.onReplace,onRetry:z.onRetry,onStop:z.onStop,slot:j.slot})})(),branch:b.branchState(m),branchName:b.previewFor(m)?.branch??m,busy:Lt,designWidth:Rr,errored:Tn[m]===!0,frameHeight:Or,framed:qa,fromApp:na.has(m),identity:Xa(m),loaded:Qa(m),name:b.displayName(m),onError:()=>Dn(j=>({...j,[m]:!0})),onReady:(j,z)=>Ka(m,j,z),onReload:()=>$s(m),onShowAnyway:()=>{Mi.current.add(b.urlFor(m)),Cs(j=>Object.fromEntries(Object.entries(j).filter(([z])=>z!==m)))},onStartBranch:()=>b.startBranch(m),onOpen:pt?()=>{Ft(null),b.setActive(m)}:null,order:Ts.get(m)??-1,paneScale:ki,refusal:Wl[m]??null,scaling:bl,second:!pt&&m===vn,serverUp:kn.reachable,shown:Ts.has(m),splitting:sl,src:b.urlFor(m),title:m,viewport:b.prefs.viewport},m)),u.jsxs("div",{className:`absolute z-50 flex gap-2 ${Ze?"flex-col items-start":{"bottom-right":"bottom-4 right-4 flex-col items-end","bottom-left":"bottom-4 left-4 flex-col items-start","top-right":"right-4 top-4 flex-col-reverse items-end","top-left":"left-4 top-4 flex-col-reverse items-start"}[b.prefs.corner]}`,style:Xo,children:[u.jsx(Jv,{applyOverlayPref:ua,copied:b.copied?.kind==="reference"&&b.copied.title===b.active,fontKey:Ss.key,href:b.urlFor(b.active),notify:b.notify,onCopyReference:()=>b.copyReference(b.active),onShortcuts:()=>{X(!1),g(!0)},open:Q,parked:Ze!==null,popoverRef:wi,prefs:b.prefs,setPrefs:b.setPrefs,splitting:sl,viewing:ie,viewports:b.viewports}),(b.prefs.showWidget||Q)&&u.jsx(Je,{label:"Leglas tools",children:u.jsxs("button",{"aria-expanded":Q,"aria-haspopup":"dialog","aria-label":"Leglas tools",className:"relative flex h-11 w-11 items-center justify-center rounded-full border border-white/10 bg-[#1C1C20] shadow-lg transition-[border-color,transform] duration-150 hover:scale-[1.04] hover:border-white/20 active:scale-[0.95] motion-reduce:transform-none motion-reduce:hover:scale-100 motion-reduce:active:scale-100",onClick:()=>{if(an.current){an.current=!1;return}X(m=>!m)},onPointerDown:Qo,ref:bi,type:"button",children:[u.jsx(Ao,{size:30}),!Qa(b.active)&&u.jsx("span",{className:"absolute -right-0.5 -top-0.5 size-2 animate-pulse rounded-full bg-amber-400 motion-reduce:animate-none"})]})})]})]}),u.jsx(rx,{bottom:b.prefs.collapsed?12:bs+8,left:b.prefs.collapsed?60:12,onDismiss:b.dismissToast,toasts:b.toasts,width:(b.prefs.collapsed?320:b.prefs.width)-24}),on!==null&&u.jsx("iframe",{"aria-hidden":!0,className:"pointer-events-none fixed border-0",onLoad:m=>Pt(on,m.currentTarget),ref:ra,src:on.url,style:{height:em.height,left:-2400,top:0,width:em.width},tabIndex:-1,title:"Off-stage duplicate scan"},zn??void 0),v?u.jsx(Wv,{mac:Xm,onClose:K,viewer:ie}):null,T?u.jsx(vv,{connected:Gn.agent.attached,fallbackFocusRef:kt.kind==="none"?ys:Si,onClose:()=>D(!1)}):null,S!==null?u.jsx(Iv,{busy:M,count:S.titles.length,error:S.error,fallbackFocusRef:d,name:S.titles.length===1?b.displayName(S.titles[0]??""):null,onCancel:ot,onConfirm:()=>{_e()}}):null]})}function Co({children:a,title:s}){return u.jsxs("div",{className:"flex h-dvh flex-col items-center justify-center gap-3 bg-[#1C1C20] px-6 text-center antialiased",style:{fontFamily:"var(--font-satoshi)"},children:[u.jsx(Ao,{size:22}),u.jsx("p",{className:"text-sm font-medium text-white",children:s}),u.jsx("div",{className:"max-w-md text-xs leading-relaxed text-[#84848C]",children:a})]})}class am extends Error{constructor(s){super(`the server answered ${s}`),this.status=s}status}function Wb(){const[a,s]=w.useState({status:"loading"}),[c,r]=w.useReducer(d=>d+1,0),f=w.useRef(0);return w.useEffect(()=>{let d=!1;const p=v=>fetch("/leglas/api/config",{signal:v}).then(g=>{if(!g.ok)throw new am(g.status);return qt(g)}),y=ds(v=>p(v).then(g=>{d||(f.current=0,s(S=>S.status==="ready"&&JSON.stringify(S.config)===JSON.stringify(g)?S:{status:"ready",config:g}))}).catch(g=>{if(d)return;Tf(g)||(f.current+=1);const S=g instanceof am&&g.status===403;s(C=>(C.status==="ready"||C.status==="ended")&&C.config.viewer!==void 0?Tf(g)||!S&&f.current<2?C:{status:"ended",config:C.config,final:S}:C.status==="ready"?C:{status:"failed",message:Tf(g)?"it did not answer in time":g instanceof Error?g.message:String(g)})}),{everyMs:To,subscribe:v=>fs().on("config",v)});return()=>{d=!0,y()}},[c]),a.status==="loading"?u.jsx(Co,{title:"Starting Leglas…",children:null}):a.status==="ended"?a.final?u.jsx(Co,{title:"This share has ended",children:"The person sharing it stopped. A share they start later comes with a new link, so ask them for that one."}):u.jsxs(Co,{title:"This share isn’t answering",children:["The link is not reaching their Leglas right now: their machine may be asleep, or the tunnel between you is resetting. It comes back on its own when it can.",u.jsx("p",{className:"mt-4",children:u.jsx("button",{className:"rounded-md bg-[#2E2E2E] px-3 py-1.5 text-xs font-medium text-white transition-colors hover:bg-[#3A3A40]",onClick:r,type:"button",children:"Try again"})})]}):a.status==="failed"?u.jsxs(Co,{title:"Couldn’t reach the Leglas server",children:[a.message,". The interface is served by the same process that proxies your app, so this usually means it stopped."]}):a.config.errors.length>0?u.jsxs(Co,{title:"Your config needs fixing",children:[u.jsx("ul",{className:"space-y-1 text-left",children:a.config.errors.map(d=>u.jsx("li",{children:d},d))}),u.jsx("p",{className:"mt-3",children:"Fix it and restart Leglas."})]}):u.jsx(Jb,{previews:a.config.previews,project:a.config.project,scanPreviews:a.config.scanPreviews??!0,viewer:a.config.viewer,warnings:a.config.warnings??[]})}const Qm=document.getElementById("root");if(!Qm)throw new Error("Leglas: #root is missing from the document.");gg.createRoot(Qm).render(u.jsx(w.StrictMode,{children:u.jsx(Wb,{})}));
|