prauga-flexdoc 0.4.0 → 0.4.2
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.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/assets/flexdoc.standalone.css +1 -1
- data/assets/flexdoc.standalone.js +81 -56
- data/lib/prauga/flexdoc/config.rb +40 -3
- data/lib/prauga/flexdoc/host.rb +23 -0
- data/lib/prauga/flexdoc/rack_app.rb +6 -0
- data/lib/prauga/flexdoc/rails.rb +9 -0
- data/lib/prauga/flexdoc/response.rb +3 -0
- data/lib/prauga/flexdoc/version.rb +1 -1
- data/lib/prauga/flexdoc.rb +5 -0
- metadata +2 -2
|
@@ -1,60 +1,85 @@
|
|
|
1
|
-
var FlexDocStandaloneBundle=(function(Kl){"use strict";var gu=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function xu(a){return a&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a}var ss={exports:{}},Ha={};var bu;function Ry(){if(bu)return Ha;bu=1;var a=Symbol.for("react.transitional.element"),i=Symbol.for("react.fragment");function c(u,f,p){var g=null;if(p!==void 0&&(g=""+p),f.key!==void 0&&(g=""+f.key),"key"in f){p={};for(var y in f)y!=="key"&&(p[y]=f[y])}else p=f;return f=p.ref,{$$typeof:a,type:u,key:g,ref:f!==void 0?f:null,props:p}}return Ha.Fragment=i,Ha.jsx=c,Ha.jsxs=c,Ha}var vu;function qy(){return vu||(vu=1,ss.exports=Ry()),ss.exports}var o=qy(),os={exports:{}},La={},cs={exports:{}},us={};var Su;function My(){return Su||(Su=1,(function(a){function i(T,ne){var W=T.length;T.push(ne);e:for(;0<W;){var K=W-1>>>1,P=T[K];if(0<f(P,ne))T[K]=ne,T[W]=P,W=K;else break e}}function c(T){return T.length===0?null:T[0]}function u(T){if(T.length===0)return null;var ne=T[0],W=T.pop();if(W!==ne){T[0]=W;e:for(var K=0,P=T.length,w=P>>>1;K<w;){var $=2*(K+1)-1,ce=T[$],pe=$+1,ve=T[pe];if(0>f(ce,W))pe<P&&0>f(ve,ce)?(T[K]=ve,T[pe]=W,K=pe):(T[K]=ce,T[$]=W,K=$);else if(pe<P&&0>f(ve,W))T[K]=ve,T[pe]=W,K=pe;else break e}}return ne}function f(T,ne){var W=T.sortIndex-ne.sortIndex;return W!==0?W:T.id-ne.id}if(a.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var p=performance;a.unstable_now=function(){return p.now()}}else{var g=Date,y=g.now();a.unstable_now=function(){return g.now()-y}}var x=[],h=[],S=1,A=null,C=3,M=!1,k=!1,G=!1,U=!1,I=typeof setTimeout=="function"?setTimeout:null,_=typeof clearTimeout=="function"?clearTimeout:null,N=typeof setImmediate<"u"?setImmediate:null;function j(T){for(var ne=c(h);ne!==null;){if(ne.callback===null)u(h);else if(ne.startTime<=T)u(h),ne.sortIndex=ne.expirationTime,i(x,ne);else break;ne=c(h)}}function R(T){if(G=!1,j(T),!k)if(c(x)!==null)k=!0,Y||(Y=!0,Ee());else{var ne=c(h);ne!==null&&ke(R,ne.startTime-T)}}var Y=!1,D=-1,X=5,me=-1;function xe(){return U?!0:!(a.unstable_now()-me<X)}function ge(){if(U=!1,Y){var T=a.unstable_now();me=T;var ne=!0;try{e:{k=!1,G&&(G=!1,_(D),D=-1),M=!0;var W=C;try{t:{for(j(T),A=c(x);A!==null&&!(A.expirationTime>T&&xe());){var K=A.callback;if(typeof K=="function"){A.callback=null,C=A.priorityLevel;var P=K(A.expirationTime<=T);if(T=a.unstable_now(),typeof P=="function"){A.callback=P,j(T),ne=!0;break t}A===c(x)&&u(x),j(T)}else u(x);A=c(x)}if(A!==null)ne=!0;else{var w=c(h);w!==null&&ke(R,w.startTime-T),ne=!1}}break e}finally{A=null,C=W,M=!1}ne=void 0}}finally{ne?Ee():Y=!1}}}var Ee;if(typeof N=="function")Ee=function(){N(ge)};else if(typeof MessageChannel<"u"){var He=new MessageChannel,he=He.port2;He.port1.onmessage=ge,Ee=function(){he.postMessage(null)}}else Ee=function(){I(ge,0)};function ke(T,ne){D=I(function(){T(a.unstable_now())},ne)}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(T){T.callback=null},a.unstable_forceFrameRate=function(T){0>T||125<T?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):X=0<T?Math.floor(1e3/T):5},a.unstable_getCurrentPriorityLevel=function(){return C},a.unstable_next=function(T){switch(C){case 1:case 2:case 3:var ne=3;break;default:ne=C}var W=C;C=ne;try{return T()}finally{C=W}},a.unstable_requestPaint=function(){U=!0},a.unstable_runWithPriority=function(T,ne){switch(T){case 1:case 2:case 3:case 4:case 5:break;default:T=3}var W=C;C=T;try{return ne()}finally{C=W}},a.unstable_scheduleCallback=function(T,ne,W){var K=a.unstable_now();switch(typeof W=="object"&&W!==null?(W=W.delay,W=typeof W=="number"&&0<W?K+W:K):W=K,T){case 1:var P=-1;break;case 2:P=250;break;case 5:P=1073741823;break;case 4:P=1e4;break;default:P=5e3}return P=W+P,T={id:S++,callback:ne,priorityLevel:T,startTime:W,expirationTime:P,sortIndex:-1},W>K?(T.sortIndex=W,i(h,T),c(x)===null&&T===c(h)&&(G?(_(D),D=-1):G=!0,ke(R,W-K))):(T.sortIndex=P,i(x,T),k||M||(k=!0,Y||(Y=!0,Ee()))),T},a.unstable_shouldYield=xe,a.unstable_wrapCallback=function(T){var ne=C;return function(){var W=C;C=ne;try{return T.apply(this,arguments)}finally{C=W}}}})(us)),us}var Au;function zy(){return Au||(Au=1,cs.exports=My()),cs.exports}var ds={exports:{}},Ue={};var ju;function $y(){if(ju)return Ue;ju=1;var a=Symbol.for("react.transitional.element"),i=Symbol.for("react.portal"),c=Symbol.for("react.fragment"),u=Symbol.for("react.strict_mode"),f=Symbol.for("react.profiler"),p=Symbol.for("react.consumer"),g=Symbol.for("react.context"),y=Symbol.for("react.forward_ref"),x=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),S=Symbol.for("react.lazy"),A=Symbol.for("react.activity"),C=Symbol.iterator;function M(w){return w===null||typeof w!="object"?null:(w=C&&w[C]||w["@@iterator"],typeof w=="function"?w:null)}var k={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},G=Object.assign,U={};function I(w,$,ce){this.props=w,this.context=$,this.refs=U,this.updater=ce||k}I.prototype.isReactComponent={},I.prototype.setState=function(w,$){if(typeof w!="object"&&typeof w!="function"&&w!=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,w,$,"setState")},I.prototype.forceUpdate=function(w){this.updater.enqueueForceUpdate(this,w,"forceUpdate")};function _(){}_.prototype=I.prototype;function N(w,$,ce){this.props=w,this.context=$,this.refs=U,this.updater=ce||k}var j=N.prototype=new _;j.constructor=N,G(j,I.prototype),j.isPureReactComponent=!0;var R=Array.isArray;function Y(){}var D={H:null,A:null,T:null,S:null},X=Object.prototype.hasOwnProperty;function me(w,$,ce){var pe=ce.ref;return{$$typeof:a,type:w,key:$,ref:pe!==void 0?pe:null,props:ce}}function xe(w,$){return me(w.type,$,w.props)}function ge(w){return typeof w=="object"&&w!==null&&w.$$typeof===a}function Ee(w){var $={"=":"=0",":":"=2"};return"$"+w.replace(/[=:]/g,function(ce){return $[ce]})}var He=/\/+/g;function he(w,$){return typeof w=="object"&&w!==null&&w.key!=null?Ee(""+w.key):$.toString(36)}function ke(w){switch(w.status){case"fulfilled":return w.value;case"rejected":throw w.reason;default:switch(typeof w.status=="string"?w.then(Y,Y):(w.status="pending",w.then(function($){w.status==="pending"&&(w.status="fulfilled",w.value=$)},function($){w.status==="pending"&&(w.status="rejected",w.reason=$)})),w.status){case"fulfilled":return w.value;case"rejected":throw w.reason}}throw w}function T(w,$,ce,pe,ve){var Te=typeof w;(Te==="undefined"||Te==="boolean")&&(w=null);var Re=!1;if(w===null)Re=!0;else switch(Te){case"bigint":case"string":case"number":Re=!0;break;case"object":switch(w.$$typeof){case a:case i:Re=!0;break;case S:return Re=w._init,T(Re(w._payload),$,ce,pe,ve)}}if(Re)return ve=ve(w),Re=pe===""?"."+he(w,0):pe,R(ve)?(ce="",Re!=null&&(ce=Re.replace(He,"$&/")+"/"),T(ve,$,ce,"",function(Be){return Be})):ve!=null&&(ge(ve)&&(ve=xe(ve,ce+(ve.key==null||w&&w.key===ve.key?"":(""+ve.key).replace(He,"$&/")+"/")+Re)),$.push(ve)),1;Re=0;var Ve=pe===""?".":pe+":";if(R(w))for(var Ie=0;Ie<w.length;Ie++)pe=w[Ie],Te=Ve+he(pe,Ie),Re+=T(pe,$,ce,Te,ve);else if(Ie=M(w),typeof Ie=="function")for(w=Ie.call(w),Ie=0;!(pe=w.next()).done;)pe=pe.value,Te=Ve+he(pe,Ie++),Re+=T(pe,$,ce,Te,ve);else if(Te==="object"){if(typeof w.then=="function")return T(ke(w),$,ce,pe,ve);throw $=String(w),Error("Objects are not valid as a React child (found: "+($==="[object Object]"?"object with keys {"+Object.keys(w).join(", ")+"}":$)+"). If you meant to render a collection of children, use an array instead.")}return Re}function ne(w,$,ce){if(w==null)return w;var pe=[],ve=0;return T(w,pe,"","",function(Te){return $.call(ce,Te,ve++)}),pe}function W(w){if(w._status===-1){var $=w._result;$=$(),$.then(function(ce){(w._status===0||w._status===-1)&&(w._status=1,w._result=ce)},function(ce){(w._status===0||w._status===-1)&&(w._status=2,w._result=ce)}),w._status===-1&&(w._status=0,w._result=$)}if(w._status===1)return w._result.default;throw w._result}var K=typeof reportError=="function"?reportError:function(w){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var $=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof w=="object"&&w!==null&&typeof w.message=="string"?String(w.message):String(w),error:w});if(!window.dispatchEvent($))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",w);return}console.error(w)},P={map:ne,forEach:function(w,$,ce){ne(w,function(){$.apply(this,arguments)},ce)},count:function(w){var $=0;return ne(w,function(){$++}),$},toArray:function(w){return ne(w,function($){return $})||[]},only:function(w){if(!ge(w))throw Error("React.Children.only expected to receive a single React element child.");return w}};return Ue.Activity=A,Ue.Children=P,Ue.Component=I,Ue.Fragment=c,Ue.Profiler=f,Ue.PureComponent=N,Ue.StrictMode=u,Ue.Suspense=x,Ue.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=D,Ue.__COMPILER_RUNTIME={__proto__:null,c:function(w){return D.H.useMemoCache(w)}},Ue.cache=function(w){return function(){return w.apply(null,arguments)}},Ue.cacheSignal=function(){return null},Ue.cloneElement=function(w,$,ce){if(w==null)throw Error("The argument must be a React element, but you passed "+w+".");var pe=G({},w.props),ve=w.key;if($!=null)for(Te in $.key!==void 0&&(ve=""+$.key),$)!X.call($,Te)||Te==="key"||Te==="__self"||Te==="__source"||Te==="ref"&&$.ref===void 0||(pe[Te]=$[Te]);var Te=arguments.length-2;if(Te===1)pe.children=ce;else if(1<Te){for(var Re=Array(Te),Ve=0;Ve<Te;Ve++)Re[Ve]=arguments[Ve+2];pe.children=Re}return me(w.type,ve,pe)},Ue.createContext=function(w){return w={$$typeof:g,_currentValue:w,_currentValue2:w,_threadCount:0,Provider:null,Consumer:null},w.Provider=w,w.Consumer={$$typeof:p,_context:w},w},Ue.createElement=function(w,$,ce){var pe,ve={},Te=null;if($!=null)for(pe in $.key!==void 0&&(Te=""+$.key),$)X.call($,pe)&&pe!=="key"&&pe!=="__self"&&pe!=="__source"&&(ve[pe]=$[pe]);var Re=arguments.length-2;if(Re===1)ve.children=ce;else if(1<Re){for(var Ve=Array(Re),Ie=0;Ie<Re;Ie++)Ve[Ie]=arguments[Ie+2];ve.children=Ve}if(w&&w.defaultProps)for(pe in Re=w.defaultProps,Re)ve[pe]===void 0&&(ve[pe]=Re[pe]);return me(w,Te,ve)},Ue.createRef=function(){return{current:null}},Ue.forwardRef=function(w){return{$$typeof:y,render:w}},Ue.isValidElement=ge,Ue.lazy=function(w){return{$$typeof:S,_payload:{_status:-1,_result:w},_init:W}},Ue.memo=function(w,$){return{$$typeof:h,type:w,compare:$===void 0?null:$}},Ue.startTransition=function(w){var $=D.T,ce={};D.T=ce;try{var pe=w(),ve=D.S;ve!==null&&ve(ce,pe),typeof pe=="object"&&pe!==null&&typeof pe.then=="function"&&pe.then(Y,K)}catch(Te){K(Te)}finally{$!==null&&ce.types!==null&&($.types=ce.types),D.T=$}},Ue.unstable_useCacheRefresh=function(){return D.H.useCacheRefresh()},Ue.use=function(w){return D.H.use(w)},Ue.useActionState=function(w,$,ce){return D.H.useActionState(w,$,ce)},Ue.useCallback=function(w,$){return D.H.useCallback(w,$)},Ue.useContext=function(w){return D.H.useContext(w)},Ue.useDebugValue=function(){},Ue.useDeferredValue=function(w,$){return D.H.useDeferredValue(w,$)},Ue.useEffect=function(w,$){return D.H.useEffect(w,$)},Ue.useEffectEvent=function(w){return D.H.useEffectEvent(w)},Ue.useId=function(){return D.H.useId()},Ue.useImperativeHandle=function(w,$,ce){return D.H.useImperativeHandle(w,$,ce)},Ue.useInsertionEffect=function(w,$){return D.H.useInsertionEffect(w,$)},Ue.useLayoutEffect=function(w,$){return D.H.useLayoutEffect(w,$)},Ue.useMemo=function(w,$){return D.H.useMemo(w,$)},Ue.useOptimistic=function(w,$){return D.H.useOptimistic(w,$)},Ue.useReducer=function(w,$,ce){return D.H.useReducer(w,$,ce)},Ue.useRef=function(w){return D.H.useRef(w)},Ue.useState=function(w){return D.H.useState(w)},Ue.useSyncExternalStore=function(w,$,ce){return D.H.useSyncExternalStore(w,$,ce)},Ue.useTransition=function(){return D.H.useTransition()},Ue.version="19.2.8",Ue}var Nu;function fs(){return Nu||(Nu=1,ds.exports=$y()),ds.exports}var ps={exports:{}},Dt={};var wu;function Dy(){if(wu)return Dt;wu=1;var a=fs();function i(x){var h="https://react.dev/errors/"+x;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var S=2;S<arguments.length;S++)h+="&args[]="+encodeURIComponent(arguments[S])}return"Minified React error #"+x+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function c(){}var u={d:{f:c,r:function(){throw Error(i(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 p(x,h,S){var A=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:f,key:A==null?null:""+A,children:x,containerInfo:h,implementation:S}}var g=a.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function y(x,h){if(x==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return Dt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=u,Dt.createPortal=function(x,h){var S=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(i(299));return p(x,h,null,S)},Dt.flushSync=function(x){var h=g.T,S=u.p;try{if(g.T=null,u.p=2,x)return x()}finally{g.T=h,u.p=S,u.d.f()}},Dt.preconnect=function(x,h){typeof x=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,u.d.C(x,h))},Dt.prefetchDNS=function(x){typeof x=="string"&&u.d.D(x)},Dt.preinit=function(x,h){if(typeof x=="string"&&h&&typeof h.as=="string"){var S=h.as,A=y(S,h.crossOrigin),C=typeof h.integrity=="string"?h.integrity:void 0,M=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;S==="style"?u.d.S(x,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:A,integrity:C,fetchPriority:M}):S==="script"&&u.d.X(x,{crossOrigin:A,integrity:C,fetchPriority:M,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},Dt.preinitModule=function(x,h){if(typeof x=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var S=y(h.as,h.crossOrigin);u.d.M(x,{crossOrigin:S,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&u.d.M(x)},Dt.preload=function(x,h){if(typeof x=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var S=h.as,A=y(S,h.crossOrigin);u.d.L(x,S,{crossOrigin:A,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,type:typeof h.type=="string"?h.type:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0,referrerPolicy:typeof h.referrerPolicy=="string"?h.referrerPolicy:void 0,imageSrcSet:typeof h.imageSrcSet=="string"?h.imageSrcSet:void 0,imageSizes:typeof h.imageSizes=="string"?h.imageSizes:void 0,media:typeof h.media=="string"?h.media:void 0})}},Dt.preloadModule=function(x,h){if(typeof x=="string")if(h){var S=y(h.as,h.crossOrigin);u.d.m(x,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:S,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else u.d.m(x)},Dt.requestFormReset=function(x){u.d.r(x)},Dt.unstable_batchedUpdates=function(x,h){return x(h)},Dt.useFormState=function(x,h,S){return g.H.useFormState(x,h,S)},Dt.useFormStatus=function(){return g.H.useHostTransitionStatus()},Dt.version="19.2.8",Dt}var Tu;function Uy(){if(Tu)return ps.exports;Tu=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(i){console.error(i)}}return a(),ps.exports=Dy(),ps.exports}var Eu;function Hy(){if(Eu)return La;Eu=1;var a=zy(),i=fs(),c=Uy();function u(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 p(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 g(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 x(e){if(p(e)!==e)throw Error(u(188))}function h(e){var t=e.alternate;if(!t){if(t=p(e),t===null)throw Error(u(188));return t!==e?null:e}for(var n=e,l=t;;){var r=n.return;if(r===null)break;var s=r.alternate;if(s===null){if(l=r.return,l!==null){n=l;continue}break}if(r.child===s.child){for(s=r.child;s;){if(s===n)return x(r),e;if(s===l)return x(r),t;s=s.sibling}throw Error(u(188))}if(n.return!==l.return)n=r,l=s;else{for(var m=!1,v=r.child;v;){if(v===n){m=!0,n=r,l=s;break}if(v===l){m=!0,l=r,n=s;break}v=v.sibling}if(!m){for(v=s.child;v;){if(v===n){m=!0,n=s,l=r;break}if(v===l){m=!0,l=s,n=r;break}v=v.sibling}if(!m)throw Error(u(189))}}if(n.alternate!==l)throw Error(u(190))}if(n.tag!==3)throw Error(u(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 A=Object.assign,C=Symbol.for("react.element"),M=Symbol.for("react.transitional.element"),k=Symbol.for("react.portal"),G=Symbol.for("react.fragment"),U=Symbol.for("react.strict_mode"),I=Symbol.for("react.profiler"),_=Symbol.for("react.consumer"),N=Symbol.for("react.context"),j=Symbol.for("react.forward_ref"),R=Symbol.for("react.suspense"),Y=Symbol.for("react.suspense_list"),D=Symbol.for("react.memo"),X=Symbol.for("react.lazy"),me=Symbol.for("react.activity"),xe=Symbol.for("react.memo_cache_sentinel"),ge=Symbol.iterator;function Ee(e){return e===null||typeof e!="object"?null:(e=ge&&e[ge]||e["@@iterator"],typeof e=="function"?e:null)}var He=Symbol.for("react.client.reference");function he(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===He?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case G:return"Fragment";case I:return"Profiler";case U:return"StrictMode";case R:return"Suspense";case Y:return"SuspenseList";case me:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case k:return"Portal";case N:return e.displayName||"Context";case _:return(e._context.displayName||"Context")+".Consumer";case j:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case D:return t=e.displayName||null,t!==null?t:he(e.type)||"Memo";case X:t=e._payload,e=e._init;try{return he(e(t))}catch{}}return null}var ke=Array.isArray,T=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ne=c.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,W={pending:!1,data:null,method:null,action:null},K=[],P=-1;function w(e){return{current:e}}function $(e){0>P||(e.current=K[P],K[P]=null,P--)}function ce(e,t){P++,K[P]=e.current,e.current=t}var pe=w(null),ve=w(null),Te=w(null),Re=w(null);function Ve(e,t){switch(ce(Te,t),ce(ve,e),ce(pe,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?ey(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=ey(t),e=ty(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}$(pe),ce(pe,e)}function Ie(){$(pe),$(ve),$(Te)}function Be(e){e.memoizedState!==null&&ce(Re,e);var t=pe.current,n=ty(t,e.type);t!==n&&(ce(ve,e),ce(pe,n))}function Z(e){ve.current===e&&($(pe),$(ve)),Re.current===e&&($(Re),Rr._currentValue=W)}var be,Se;function Ne(e){if(be===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);be=t&&t[1]||"",Se=-1<n.stack.indexOf(`
|
|
2
|
-
at`)?" (<anonymous>)":-1<
|
|
3
|
-
`+
|
|
4
|
-
`),
|
|
5
|
-
`);for(
|
|
6
|
-
`+
|
|
7
|
-
Error generating stack: `+
|
|
8
|
-
`+l.stack}}var un=Object.prototype.hasOwnProperty,Yt=a.unstable_scheduleCallback,It=a.unstable_cancelCallback,kn=a.unstable_shouldYield,Rn=a.unstable_requestPaint,_e=a.unstable_now,se=a.unstable_getCurrentPriorityLevel,Ae=a.unstable_ImmediatePriority,De=a.unstable_UserBlockingPriority,dn=a.unstable_NormalPriority,d=a.unstable_LowPriority,q=a.unstable_IdlePriority,ae=a.log,ie=a.unstable_setDisableYieldValue,Q=null,b=null;function H(e){if(typeof ae=="function"&&ie(e),b&&typeof b.setStrictMode=="function")try{b.setStrictMode(Q,e)}catch{}}var F=Math.clz32?Math.clz32:fe,ue=Math.log,de=Math.LN2;function fe(e){return e>>>=0,e===0?32:31-(ue(e)/de|0)|0}var ee=256,ye=262144,je=4194304;function Oe(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 qe(e,t,n){var l=e.pendingLanes;if(l===0)return 0;var r=0,s=e.suspendedLanes,m=e.pingedLanes;e=e.warmLanes;var v=l&134217727;return v!==0?(l=v&~s,l!==0?r=Oe(l):(m&=v,m!==0?r=Oe(m):n||(n=v&~e,n!==0&&(r=Oe(n))))):(v=l&~s,v!==0?r=Oe(v):m!==0?r=Oe(m):n||(n=l&~e,n!==0&&(r=Oe(n)))),r===0?0:t!==0&&t!==r&&(t&s)===0&&(s=r&-r,n=t&-t,s>=n||s===32&&(n&4194048)!==0)?t:r}function $e(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Ye(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 jn(){var e=je;return je<<=1,(je&62914560)===0&&(je=4194304),e}function Un(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Nn(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function rb(e,t,n,l,r,s){var m=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 v=e.entanglements,E=e.expirationTimes,B=e.hiddenUpdates;for(n=m&~n;0<n;){var te=31-F(n),oe=1<<te;v[te]=0,E[te]=-1;var V=B[te];if(V!==null)for(B[te]=null,te=0;te<V.length;te++){var J=V[te];J!==null&&(J.lane&=-536870913)}n&=~oe}l!==0&&$f(e,l,0),s!==0&&r===0&&e.tag!==0&&(e.suspendedLanes|=s&~(m&~t))}function $f(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var l=31-F(t);e.entangledLanes|=t,e.entanglements[l]=e.entanglements[l]|1073741824|n&261930}function Df(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var l=31-F(n),r=1<<l;r&t|e[l]&t&&(e[l]|=t),n&=~r}}function Uf(e,t){var n=t&-t;return n=(n&42)!==0?1:ro(n),(n&(e.suspendedLanes|t))!==0?0:n}function ro(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 io(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Hf(){var e=ne.p;return e!==0?e:(e=window.event,e===void 0?32:Ny(e.type))}function Lf(e,t){var n=ne.p;try{return ne.p=e,t()}finally{ne.p=n}}var ol=Math.random().toString(36).slice(2),Rt="__reactFiber$"+ol,Ft="__reactProps$"+ol,ta="__reactContainer$"+ol,so="__reactEvents$"+ol,ib="__reactListeners$"+ol,sb="__reactHandles$"+ol,Bf="__reactResources$"+ol,Xa="__reactMarker$"+ol;function oo(e){delete e[Rt],delete e[Ft],delete e[so],delete e[ib],delete e[sb]}function na(e){var t=e[Rt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[ta]||n[Rt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=oy(e);e!==null;){if(n=e[Rt])return n;e=oy(e)}return t}e=n,n=e.parentNode}return null}function la(e){if(e=e[Rt]||e[ta]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Za(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(u(33))}function aa(e){var t=e[Bf];return t||(t=e[Bf]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Ct(e){e[Xa]=!0}var Yf=new Set,Gf={};function ql(e,t){ra(e,t),ra(e+"Capture",t)}function ra(e,t){for(Gf[e]=t,e=0;e<t.length;e++)Yf.add(t[e])}var ob=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]*$"),If={},Ff={};function cb(e){return un.call(Ff,e)?!0:un.call(If,e)?!1:ob.test(e)?Ff[e]=!0:(If[e]=!0,!1)}function Qr(e,t,n){if(cb(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 Kr(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 Hn(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 fn(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Vf(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function ub(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 r=l.get,s=l.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return r.call(this)},set:function(m){n=""+m,s.call(this,m)}}),Object.defineProperty(e,t,{enumerable:l.enumerable}),{getValue:function(){return n},setValue:function(m){n=""+m},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function co(e){if(!e._valueTracker){var t=Vf(e)?"checked":"value";e._valueTracker=ub(e,t,""+e[t])}}function Xf(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),l="";return e&&(l=Vf(e)?e.checked?"true":"false":e.value),e=l,e!==n?(t.setValue(e),!0):!1}function Jr(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 db=/[\n"\\]/g;function pn(e){return e.replace(db,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function uo(e,t,n,l,r,s,m,v){e.name="",m!=null&&typeof m!="function"&&typeof m!="symbol"&&typeof m!="boolean"?e.type=m:e.removeAttribute("type"),t!=null?m==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+fn(t)):e.value!==""+fn(t)&&(e.value=""+fn(t)):m!=="submit"&&m!=="reset"||e.removeAttribute("value"),t!=null?fo(e,m,fn(t)):n!=null?fo(e,m,fn(n)):l!=null&&e.removeAttribute("value"),r==null&&s!=null&&(e.defaultChecked=!!s),r!=null&&(e.checked=r&&typeof r!="function"&&typeof r!="symbol"),v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"?e.name=""+fn(v):e.removeAttribute("name")}function Zf(e,t,n,l,r,s,m,v){if(s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"&&(e.type=s),t!=null||n!=null){if(!(s!=="submit"&&s!=="reset"||t!=null)){co(e);return}n=n!=null?""+fn(n):"",t=t!=null?""+fn(t):n,v||t===e.value||(e.value=t),e.defaultValue=t}l=l??r,l=typeof l!="function"&&typeof l!="symbol"&&!!l,e.checked=v?e.checked:!!l,e.defaultChecked=!!l,m!=null&&typeof m!="function"&&typeof m!="symbol"&&typeof m!="boolean"&&(e.name=m),co(e)}function fo(e,t,n){t==="number"&&Jr(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function ia(e,t,n,l){if(e=e.options,t){t={};for(var r=0;r<n.length;r++)t["$"+n[r]]=!0;for(n=0;n<e.length;n++)r=t.hasOwnProperty("$"+e[n].value),e[n].selected!==r&&(e[n].selected=r),r&&l&&(e[n].defaultSelected=!0)}else{for(n=""+fn(n),t=null,r=0;r<e.length;r++){if(e[r].value===n){e[r].selected=!0,l&&(e[r].defaultSelected=!0);return}t!==null||e[r].disabled||(t=e[r])}t!==null&&(t.selected=!0)}}function Qf(e,t,n){if(t!=null&&(t=""+fn(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+fn(n):""}function Kf(e,t,n,l){if(t==null){if(l!=null){if(n!=null)throw Error(u(92));if(ke(l)){if(1<l.length)throw Error(u(93));l=l[0]}n=l}n==null&&(n=""),t=n}n=fn(t),e.defaultValue=n,l=e.textContent,l===n&&l!==""&&l!==null&&(e.value=l),co(e)}function sa(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var fb=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 Jf(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||fb.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function Wf(e,t,n){if(t!=null&&typeof t!="object")throw Error(u(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 r in t)l=t[r],t.hasOwnProperty(r)&&n[r]!==l&&Jf(e,r,l)}else for(var s in t)t.hasOwnProperty(s)&&Jf(e,s,t[s])}function po(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 pb=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"]]),mb=/^[\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 Wr(e){return mb.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Ln(){}var mo=null;function ho(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var oa=null,ca=null;function Pf(e){var t=la(e);if(t&&(e=t.stateNode)){var n=e[Ft]||null;e:switch(e=t.stateNode,t.type){case"input":if(uo(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="'+pn(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var l=n[t];if(l!==e&&l.form===e.form){var r=l[Ft]||null;if(!r)throw Error(u(90));uo(l,r.value,r.defaultValue,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name)}}for(t=0;t<n.length;t++)l=n[t],l.form===e.form&&Xf(l)}break e;case"textarea":Qf(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&ia(e,!!n.multiple,t,!1)}}}var yo=!1;function ep(e,t,n){if(yo)return e(t,n);yo=!0;try{var l=e(t);return l}finally{if(yo=!1,(oa!==null||ca!==null)&&(Hi(),oa&&(t=oa,e=ca,ca=oa=null,Pf(t),e)))for(t=0;t<e.length;t++)Pf(e[t])}}function Qa(e,t){var n=e.stateNode;if(n===null)return null;var l=n[Ft]||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(u(231,t,typeof n));return n}var Bn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),go=!1;if(Bn)try{var Ka={};Object.defineProperty(Ka,"passive",{get:function(){go=!0}}),window.addEventListener("test",Ka,Ka),window.removeEventListener("test",Ka,Ka)}catch{go=!1}var cl=null,xo=null,Pr=null;function tp(){if(Pr)return Pr;var e,t=xo,n=t.length,l,r="value"in cl?cl.value:cl.textContent,s=r.length;for(e=0;e<n&&t[e]===r[e];e++);var m=n-e;for(l=1;l<=m&&t[n-l]===r[s-l];l++);return Pr=r.slice(e,1<l?1-l:void 0)}function ei(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 ti(){return!0}function np(){return!1}function Vt(e){function t(n,l,r,s,m){this._reactName=n,this._targetInst=r,this.type=l,this.nativeEvent=s,this.target=m,this.currentTarget=null;for(var v in e)e.hasOwnProperty(v)&&(n=e[v],this[v]=n?n(s):s[v]);return this.isDefaultPrevented=(s.defaultPrevented!=null?s.defaultPrevented:s.returnValue===!1)?ti:np,this.isPropagationStopped=np,this}return A(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=ti)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=ti)},persist:function(){},isPersistent:ti}),t}var Ml={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ni=Vt(Ml),Ja=A({},Ml,{view:0,detail:0}),hb=Vt(Ja),bo,vo,Wa,li=A({},Ja,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ao,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!==Wa&&(Wa&&e.type==="mousemove"?(bo=e.screenX-Wa.screenX,vo=e.screenY-Wa.screenY):vo=bo=0,Wa=e),bo)},movementY:function(e){return"movementY"in e?e.movementY:vo}}),lp=Vt(li),yb=A({},li,{dataTransfer:0}),gb=Vt(yb),xb=A({},Ja,{relatedTarget:0}),So=Vt(xb),bb=A({},Ml,{animationName:0,elapsedTime:0,pseudoElement:0}),vb=Vt(bb),Sb=A({},Ml,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Ab=Vt(Sb),jb=A({},Ml,{data:0}),ap=Vt(jb),Nb={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},wb={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"},Tb={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Eb(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Tb[e])?!!t[e]:!1}function Ao(){return Eb}var Cb=A({},Ja,{key:function(e){if(e.key){var t=Nb[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=ei(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?wb[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ao,charCode:function(e){return e.type==="keypress"?ei(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?ei(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),_b=Vt(Cb),Ob=A({},li,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),rp=Vt(Ob),kb=A({},Ja,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ao}),Rb=Vt(kb),qb=A({},Ml,{propertyName:0,elapsedTime:0,pseudoElement:0}),Mb=Vt(qb),zb=A({},li,{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}),$b=Vt(zb),Db=A({},Ml,{newState:0,oldState:0}),Ub=Vt(Db),Hb=[9,13,27,32],jo=Bn&&"CompositionEvent"in window,Pa=null;Bn&&"documentMode"in document&&(Pa=document.documentMode);var Lb=Bn&&"TextEvent"in window&&!Pa,ip=Bn&&(!jo||Pa&&8<Pa&&11>=Pa),sp=" ",op=!1;function cp(e,t){switch(e){case"keyup":return Hb.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function up(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var ua=!1;function Bb(e,t){switch(e){case"compositionend":return up(t);case"keypress":return t.which!==32?null:(op=!0,sp);case"textInput":return e=t.data,e===sp&&op?null:e;default:return null}}function Yb(e,t){if(ua)return e==="compositionend"||!jo&&cp(e,t)?(e=tp(),Pr=xo=cl=null,ua=!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 ip&&t.locale!=="ko"?null:t.data;default:return null}}var Gb={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 dp(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Gb[e.type]:t==="textarea"}function fp(e,t,n,l){oa?ca?ca.push(l):ca=[l]:oa=l,t=Vi(t,"onChange"),0<t.length&&(n=new ni("onChange","change",null,n,l),e.push({event:n,listeners:t}))}var er=null,tr=null;function Ib(e){Zh(e,0)}function ai(e){var t=Za(e);if(Xf(t))return e}function pp(e,t){if(e==="change")return t}var mp=!1;if(Bn){var No;if(Bn){var wo="oninput"in document;if(!wo){var hp=document.createElement("div");hp.setAttribute("oninput","return;"),wo=typeof hp.oninput=="function"}No=wo}else No=!1;mp=No&&(!document.documentMode||9<document.documentMode)}function yp(){er&&(er.detachEvent("onpropertychange",gp),tr=er=null)}function gp(e){if(e.propertyName==="value"&&ai(tr)){var t=[];fp(t,tr,e,ho(e)),ep(Ib,t)}}function Fb(e,t,n){e==="focusin"?(yp(),er=t,tr=n,er.attachEvent("onpropertychange",gp)):e==="focusout"&&yp()}function Vb(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return ai(tr)}function Xb(e,t){if(e==="click")return ai(t)}function Zb(e,t){if(e==="input"||e==="change")return ai(t)}function Qb(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Pt=typeof Object.is=="function"?Object.is:Qb;function nr(e,t){if(Pt(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 r=n[l];if(!un.call(t,r)||!Pt(e[r],t[r]))return!1}return!0}function xp(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function bp(e,t){var n=xp(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=xp(n)}}function vp(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?vp(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Sp(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Jr(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=Jr(e.document)}return t}function To(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 Kb=Bn&&"documentMode"in document&&11>=document.documentMode,da=null,Eo=null,lr=null,Co=!1;function Ap(e,t,n){var l=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Co||da==null||da!==Jr(l)||(l=da,"selectionStart"in l&&To(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}),lr&&nr(lr,l)||(lr=l,l=Vi(Eo,"onSelect"),0<l.length&&(t=new ni("onSelect","select",null,t,n),e.push({event:t,listeners:l}),t.target=da)))}function zl(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var fa={animationend:zl("Animation","AnimationEnd"),animationiteration:zl("Animation","AnimationIteration"),animationstart:zl("Animation","AnimationStart"),transitionrun:zl("Transition","TransitionRun"),transitionstart:zl("Transition","TransitionStart"),transitioncancel:zl("Transition","TransitionCancel"),transitionend:zl("Transition","TransitionEnd")},_o={},jp={};Bn&&(jp=document.createElement("div").style,"AnimationEvent"in window||(delete fa.animationend.animation,delete fa.animationiteration.animation,delete fa.animationstart.animation),"TransitionEvent"in window||delete fa.transitionend.transition);function $l(e){if(_o[e])return _o[e];if(!fa[e])return e;var t=fa[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in jp)return _o[e]=t[n];return e}var Np=$l("animationend"),wp=$l("animationiteration"),Tp=$l("animationstart"),Jb=$l("transitionrun"),Wb=$l("transitionstart"),Pb=$l("transitioncancel"),Ep=$l("transitionend"),Cp=new Map,Oo="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(" ");Oo.push("scrollEnd");function wn(e,t){Cp.set(e,t),ql(t,[e])}var ri=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)},mn=[],pa=0,ko=0;function ii(){for(var e=pa,t=ko=pa=0;t<e;){var n=mn[t];mn[t++]=null;var l=mn[t];mn[t++]=null;var r=mn[t];mn[t++]=null;var s=mn[t];if(mn[t++]=null,l!==null&&r!==null){var m=l.pending;m===null?r.next=r:(r.next=m.next,m.next=r),l.pending=r}s!==0&&_p(n,r,s)}}function si(e,t,n,l){mn[pa++]=e,mn[pa++]=t,mn[pa++]=n,mn[pa++]=l,ko|=l,e.lanes|=l,e=e.alternate,e!==null&&(e.lanes|=l)}function Ro(e,t,n,l){return si(e,t,n,l),oi(e)}function Dl(e,t){return si(e,null,null,t),oi(e)}function _p(e,t,n){e.lanes|=n;var l=e.alternate;l!==null&&(l.lanes|=n);for(var r=!1,s=e.return;s!==null;)s.childLanes|=n,l=s.alternate,l!==null&&(l.childLanes|=n),s.tag===22&&(e=s.stateNode,e===null||e._visibility&1||(r=!0)),e=s,s=s.return;return e.tag===3?(s=e.stateNode,r&&t!==null&&(r=31-F(n),e=s.hiddenUpdates,l=e[r],l===null?e[r]=[t]:l.push(t),t.lane=n|536870912),s):null}function oi(e){if(50<wr)throw wr=0,Bc=null,Error(u(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var ma={};function ev(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 en(e,t,n,l){return new ev(e,t,n,l)}function qo(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Yn(e,t){var n=e.alternate;return n===null?(n=en(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 Op(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 ci(e,t,n,l,r,s){var m=0;if(l=e,typeof e=="function")qo(e)&&(m=1);else if(typeof e=="string")m=r1(e,n,pe.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case me:return e=en(31,n,t,r),e.elementType=me,e.lanes=s,e;case G:return Ul(n.children,r,s,t);case U:m=8,r|=24;break;case I:return e=en(12,n,t,r|2),e.elementType=I,e.lanes=s,e;case R:return e=en(13,n,t,r),e.elementType=R,e.lanes=s,e;case Y:return e=en(19,n,t,r),e.elementType=Y,e.lanes=s,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case N:m=10;break e;case _:m=9;break e;case j:m=11;break e;case D:m=14;break e;case X:m=16,l=null;break e}m=29,n=Error(u(130,e===null?"null":typeof e,"")),l=null}return t=en(m,n,t,r),t.elementType=e,t.type=l,t.lanes=s,t}function Ul(e,t,n,l){return e=en(7,e,l,t),e.lanes=n,e}function Mo(e,t,n){return e=en(6,e,null,t),e.lanes=n,e}function kp(e){var t=en(18,null,null,0);return t.stateNode=e,t}function zo(e,t,n){return t=en(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Rp=new WeakMap;function hn(e,t){if(typeof e=="object"&&e!==null){var n=Rp.get(e);return n!==void 0?n:(t={value:e,source:t,stack:dt(t)},Rp.set(e,t),t)}return{value:e,source:t,stack:dt(t)}}var ha=[],ya=0,ui=null,ar=0,yn=[],gn=0,ul=null,qn=1,Mn="";function Gn(e,t){ha[ya++]=ar,ha[ya++]=ui,ui=e,ar=t}function qp(e,t,n){yn[gn++]=qn,yn[gn++]=Mn,yn[gn++]=ul,ul=e;var l=qn;e=Mn;var r=32-F(l)-1;l&=~(1<<r),n+=1;var s=32-F(t)+r;if(30<s){var m=r-r%5;s=(l&(1<<m)-1).toString(32),l>>=m,r-=m,qn=1<<32-F(t)+r|n<<r|l,Mn=s+e}else qn=1<<s|n<<r|l,Mn=e}function $o(e){e.return!==null&&(Gn(e,1),qp(e,1,0))}function Do(e){for(;e===ui;)ui=ha[--ya],ha[ya]=null,ar=ha[--ya],ha[ya]=null;for(;e===ul;)ul=yn[--gn],yn[gn]=null,Mn=yn[--gn],yn[gn]=null,qn=yn[--gn],yn[gn]=null}function Mp(e,t){yn[gn++]=qn,yn[gn++]=Mn,yn[gn++]=ul,qn=t.id,Mn=t.overflow,ul=e}var qt=null,pt=null,We=!1,dl=null,xn=!1,Uo=Error(u(519));function fl(e){var t=Error(u(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw rr(hn(t,e)),Uo}function zp(e){var t=e.stateNode,n=e.type,l=e.memoizedProps;switch(t[Rt]=e,t[Ft]=l,n){case"dialog":Ze("cancel",t),Ze("close",t);break;case"iframe":case"object":case"embed":Ze("load",t);break;case"video":case"audio":for(n=0;n<Er.length;n++)Ze(Er[n],t);break;case"source":Ze("error",t);break;case"img":case"image":case"link":Ze("error",t),Ze("load",t);break;case"details":Ze("toggle",t);break;case"input":Ze("invalid",t),Zf(t,l.value,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name,!0);break;case"select":Ze("invalid",t);break;case"textarea":Ze("invalid",t),Kf(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||Wh(t.textContent,n)?(l.popover!=null&&(Ze("beforetoggle",t),Ze("toggle",t)),l.onScroll!=null&&Ze("scroll",t),l.onScrollEnd!=null&&Ze("scrollend",t),l.onClick!=null&&(t.onclick=Ln),t=!0):t=!1,t||fl(e,!0)}function $p(e){for(qt=e.return;qt;)switch(qt.tag){case 5:case 31:case 13:xn=!1;return;case 27:case 3:xn=!0;return;default:qt=qt.return}}function ga(e){if(e!==qt)return!1;if(!We)return $p(e),We=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||nu(e.type,e.memoizedProps)),n=!n),n&&pt&&fl(e),$p(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(u(317));pt=sy(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(u(317));pt=sy(e)}else t===27?(t=pt,Tl(e.type)?(e=su,su=null,pt=e):pt=t):pt=qt?vn(e.stateNode.nextSibling):null;return!0}function Hl(){pt=qt=null,We=!1}function Ho(){var e=dl;return e!==null&&(Kt===null?Kt=e:Kt.push.apply(Kt,e),dl=null),e}function rr(e){dl===null?dl=[e]:dl.push(e)}var Lo=w(null),Ll=null,In=null;function pl(e,t,n){ce(Lo,t._currentValue),t._currentValue=n}function Fn(e){e._currentValue=Lo.current,$(Lo)}function Bo(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 Yo(e,t,n,l){var r=e.child;for(r!==null&&(r.return=e);r!==null;){var s=r.dependencies;if(s!==null){var m=r.child;s=s.firstContext;e:for(;s!==null;){var v=s;s=r;for(var E=0;E<t.length;E++)if(v.context===t[E]){s.lanes|=n,v=s.alternate,v!==null&&(v.lanes|=n),Bo(s.return,n,e),l||(m=null);break e}s=v.next}}else if(r.tag===18){if(m=r.return,m===null)throw Error(u(341));m.lanes|=n,s=m.alternate,s!==null&&(s.lanes|=n),Bo(m,n,e),m=null}else m=r.child;if(m!==null)m.return=r;else for(m=r;m!==null;){if(m===e){m=null;break}if(r=m.sibling,r!==null){r.return=m.return,m=r;break}m=m.return}r=m}}function xa(e,t,n,l){e=null;for(var r=t,s=!1;r!==null;){if(!s){if((r.flags&524288)!==0)s=!0;else if((r.flags&262144)!==0)break}if(r.tag===10){var m=r.alternate;if(m===null)throw Error(u(387));if(m=m.memoizedProps,m!==null){var v=r.type;Pt(r.pendingProps.value,m.value)||(e!==null?e.push(v):e=[v])}}else if(r===Re.current){if(m=r.alternate,m===null)throw Error(u(387));m.memoizedState.memoizedState!==r.memoizedState.memoizedState&&(e!==null?e.push(Rr):e=[Rr])}r=r.return}e!==null&&Yo(t,e,n,l),t.flags|=262144}function di(e){for(e=e.firstContext;e!==null;){if(!Pt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Bl(e){Ll=e,In=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Mt(e){return Dp(Ll,e)}function fi(e,t){return Ll===null&&Bl(e),Dp(e,t)}function Dp(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},In===null){if(e===null)throw Error(u(308));In=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else In=In.next=t;return n}var tv=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()})}},nv=a.unstable_scheduleCallback,lv=a.unstable_NormalPriority,St={$$typeof:N,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Go(){return{controller:new tv,data:new Map,refCount:0}}function ir(e){e.refCount--,e.refCount===0&&nv(lv,function(){e.controller.abort()})}var sr=null,Io=0,ba=0,va=null;function av(e,t){if(sr===null){var n=sr=[];Io=0,ba=Xc(),va={status:"pending",value:void 0,then:function(l){n.push(l)}}}return Io++,t.then(Up,Up),t}function Up(){if(--Io===0&&sr!==null){va!==null&&(va.status="fulfilled");var e=sr;sr=null,ba=0,va=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function rv(e,t){var n=[],l={status:"pending",value:null,reason:null,then:function(r){n.push(r)}};return e.then(function(){l.status="fulfilled",l.value=t;for(var r=0;r<n.length;r++)(0,n[r])(t)},function(r){for(l.status="rejected",l.reason=r,r=0;r<n.length;r++)(0,n[r])(void 0)}),l}var Hp=T.S;T.S=function(e,t){Ah=_e(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&av(e,t),Hp!==null&&Hp(e,t)};var Yl=w(null);function Fo(){var e=Yl.current;return e!==null?e:ut.pooledCache}function pi(e,t){t===null?ce(Yl,Yl.current):ce(Yl,t.pool)}function Lp(){var e=Fo();return e===null?null:{parent:St._currentValue,pool:e}}var Sa=Error(u(460)),Vo=Error(u(474)),mi=Error(u(542)),hi={then:function(){}};function Bp(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Yp(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(Ln,Ln),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Ip(e),e;default:if(typeof t.status=="string")t.then(Ln,Ln);else{if(e=ut,e!==null&&100<e.shellSuspendCounter)throw Error(u(482));e=t,e.status="pending",e.then(function(l){if(t.status==="pending"){var r=t;r.status="fulfilled",r.value=l}},function(l){if(t.status==="pending"){var r=t;r.status="rejected",r.reason=l}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Ip(e),e}throw Il=t,Sa}}function Gl(e){try{var t=e._init;return t(e._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(Il=n,Sa):n}}var Il=null;function Gp(){if(Il===null)throw Error(u(459));var e=Il;return Il=null,e}function Ip(e){if(e===Sa||e===mi)throw Error(u(483))}var Aa=null,or=0;function yi(e){var t=or;return or+=1,Aa===null&&(Aa=[]),Yp(Aa,e,t)}function cr(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function gi(e,t){throw t.$$typeof===C?Error(u(525)):(e=Object.prototype.toString.call(t),Error(u(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Fp(e){function t(z,O){if(e){var L=z.deletions;L===null?(z.deletions=[O],z.flags|=16):L.push(O)}}function n(z,O){if(!e)return null;for(;O!==null;)t(z,O),O=O.sibling;return null}function l(z){for(var O=new Map;z!==null;)z.key!==null?O.set(z.key,z):O.set(z.index,z),z=z.sibling;return O}function r(z,O){return z=Yn(z,O),z.index=0,z.sibling=null,z}function s(z,O,L){return z.index=L,e?(L=z.alternate,L!==null?(L=L.index,L<O?(z.flags|=67108866,O):L):(z.flags|=67108866,O)):(z.flags|=1048576,O)}function m(z){return e&&z.alternate===null&&(z.flags|=67108866),z}function v(z,O,L,re){return O===null||O.tag!==6?(O=Mo(L,z.mode,re),O.return=z,O):(O=r(O,L),O.return=z,O)}function E(z,O,L,re){var Me=L.type;return Me===G?te(z,O,L.props.children,re,L.key):O!==null&&(O.elementType===Me||typeof Me=="object"&&Me!==null&&Me.$$typeof===X&&Gl(Me)===O.type)?(O=r(O,L.props),cr(O,L),O.return=z,O):(O=ci(L.type,L.key,L.props,null,z.mode,re),cr(O,L),O.return=z,O)}function B(z,O,L,re){return O===null||O.tag!==4||O.stateNode.containerInfo!==L.containerInfo||O.stateNode.implementation!==L.implementation?(O=zo(L,z.mode,re),O.return=z,O):(O=r(O,L.children||[]),O.return=z,O)}function te(z,O,L,re,Me){return O===null||O.tag!==7?(O=Ul(L,z.mode,re,Me),O.return=z,O):(O=r(O,L),O.return=z,O)}function oe(z,O,L){if(typeof O=="string"&&O!==""||typeof O=="number"||typeof O=="bigint")return O=Mo(""+O,z.mode,L),O.return=z,O;if(typeof O=="object"&&O!==null){switch(O.$$typeof){case M:return L=ci(O.type,O.key,O.props,null,z.mode,L),cr(L,O),L.return=z,L;case k:return O=zo(O,z.mode,L),O.return=z,O;case X:return O=Gl(O),oe(z,O,L)}if(ke(O)||Ee(O))return O=Ul(O,z.mode,L,null),O.return=z,O;if(typeof O.then=="function")return oe(z,yi(O),L);if(O.$$typeof===N)return oe(z,fi(z,O),L);gi(z,O)}return null}function V(z,O,L,re){var Me=O!==null?O.key:null;if(typeof L=="string"&&L!==""||typeof L=="number"||typeof L=="bigint")return Me!==null?null:v(z,O,""+L,re);if(typeof L=="object"&&L!==null){switch(L.$$typeof){case M:return L.key===Me?E(z,O,L,re):null;case k:return L.key===Me?B(z,O,L,re):null;case X:return L=Gl(L),V(z,O,L,re)}if(ke(L)||Ee(L))return Me!==null?null:te(z,O,L,re,null);if(typeof L.then=="function")return V(z,O,yi(L),re);if(L.$$typeof===N)return V(z,O,fi(z,L),re);gi(z,L)}return null}function J(z,O,L,re,Me){if(typeof re=="string"&&re!==""||typeof re=="number"||typeof re=="bigint")return z=z.get(L)||null,v(O,z,""+re,Me);if(typeof re=="object"&&re!==null){switch(re.$$typeof){case M:return z=z.get(re.key===null?L:re.key)||null,E(O,z,re,Me);case k:return z=z.get(re.key===null?L:re.key)||null,B(O,z,re,Me);case X:return re=Gl(re),J(z,O,L,re,Me)}if(ke(re)||Ee(re))return z=z.get(L)||null,te(O,z,re,Me,null);if(typeof re.then=="function")return J(z,O,L,yi(re),Me);if(re.$$typeof===N)return J(z,O,L,fi(O,re),Me);gi(O,re)}return null}function we(z,O,L,re){for(var Me=null,tt=null,Ce=O,Ge=O=0,Ke=null;Ce!==null&&Ge<L.length;Ge++){Ce.index>Ge?(Ke=Ce,Ce=null):Ke=Ce.sibling;var nt=V(z,Ce,L[Ge],re);if(nt===null){Ce===null&&(Ce=Ke);break}e&&Ce&&nt.alternate===null&&t(z,Ce),O=s(nt,O,Ge),tt===null?Me=nt:tt.sibling=nt,tt=nt,Ce=Ke}if(Ge===L.length)return n(z,Ce),We&&Gn(z,Ge),Me;if(Ce===null){for(;Ge<L.length;Ge++)Ce=oe(z,L[Ge],re),Ce!==null&&(O=s(Ce,O,Ge),tt===null?Me=Ce:tt.sibling=Ce,tt=Ce);return We&&Gn(z,Ge),Me}for(Ce=l(Ce);Ge<L.length;Ge++)Ke=J(Ce,z,Ge,L[Ge],re),Ke!==null&&(e&&Ke.alternate!==null&&Ce.delete(Ke.key===null?Ge:Ke.key),O=s(Ke,O,Ge),tt===null?Me=Ke:tt.sibling=Ke,tt=Ke);return e&&Ce.forEach(function(kl){return t(z,kl)}),We&&Gn(z,Ge),Me}function ze(z,O,L,re){if(L==null)throw Error(u(151));for(var Me=null,tt=null,Ce=O,Ge=O=0,Ke=null,nt=L.next();Ce!==null&&!nt.done;Ge++,nt=L.next()){Ce.index>Ge?(Ke=Ce,Ce=null):Ke=Ce.sibling;var kl=V(z,Ce,nt.value,re);if(kl===null){Ce===null&&(Ce=Ke);break}e&&Ce&&kl.alternate===null&&t(z,Ce),O=s(kl,O,Ge),tt===null?Me=kl:tt.sibling=kl,tt=kl,Ce=Ke}if(nt.done)return n(z,Ce),We&&Gn(z,Ge),Me;if(Ce===null){for(;!nt.done;Ge++,nt=L.next())nt=oe(z,nt.value,re),nt!==null&&(O=s(nt,O,Ge),tt===null?Me=nt:tt.sibling=nt,tt=nt);return We&&Gn(z,Ge),Me}for(Ce=l(Ce);!nt.done;Ge++,nt=L.next())nt=J(Ce,z,Ge,nt.value,re),nt!==null&&(e&&nt.alternate!==null&&Ce.delete(nt.key===null?Ge:nt.key),O=s(nt,O,Ge),tt===null?Me=nt:tt.sibling=nt,tt=nt);return e&&Ce.forEach(function(y1){return t(z,y1)}),We&&Gn(z,Ge),Me}function ct(z,O,L,re){if(typeof L=="object"&&L!==null&&L.type===G&&L.key===null&&(L=L.props.children),typeof L=="object"&&L!==null){switch(L.$$typeof){case M:e:{for(var Me=L.key;O!==null;){if(O.key===Me){if(Me=L.type,Me===G){if(O.tag===7){n(z,O.sibling),re=r(O,L.props.children),re.return=z,z=re;break e}}else if(O.elementType===Me||typeof Me=="object"&&Me!==null&&Me.$$typeof===X&&Gl(Me)===O.type){n(z,O.sibling),re=r(O,L.props),cr(re,L),re.return=z,z=re;break e}n(z,O);break}else t(z,O);O=O.sibling}L.type===G?(re=Ul(L.props.children,z.mode,re,L.key),re.return=z,z=re):(re=ci(L.type,L.key,L.props,null,z.mode,re),cr(re,L),re.return=z,z=re)}return m(z);case k:e:{for(Me=L.key;O!==null;){if(O.key===Me)if(O.tag===4&&O.stateNode.containerInfo===L.containerInfo&&O.stateNode.implementation===L.implementation){n(z,O.sibling),re=r(O,L.children||[]),re.return=z,z=re;break e}else{n(z,O);break}else t(z,O);O=O.sibling}re=zo(L,z.mode,re),re.return=z,z=re}return m(z);case X:return L=Gl(L),ct(z,O,L,re)}if(ke(L))return we(z,O,L,re);if(Ee(L)){if(Me=Ee(L),typeof Me!="function")throw Error(u(150));return L=Me.call(L),ze(z,O,L,re)}if(typeof L.then=="function")return ct(z,O,yi(L),re);if(L.$$typeof===N)return ct(z,O,fi(z,L),re);gi(z,L)}return typeof L=="string"&&L!==""||typeof L=="number"||typeof L=="bigint"?(L=""+L,O!==null&&O.tag===6?(n(z,O.sibling),re=r(O,L),re.return=z,z=re):(n(z,O),re=Mo(L,z.mode,re),re.return=z,z=re),m(z)):n(z,O)}return function(z,O,L,re){try{or=0;var Me=ct(z,O,L,re);return Aa=null,Me}catch(Ce){if(Ce===Sa||Ce===mi)throw Ce;var tt=en(29,Ce,null,z.mode);return tt.lanes=re,tt.return=z,tt}}}var Fl=Fp(!0),Vp=Fp(!1),ml=!1;function Xo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Zo(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 hl(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function yl(e,t,n){var l=e.updateQueue;if(l===null)return null;if(l=l.shared,(lt&2)!==0){var r=l.pending;return r===null?t.next=t:(t.next=r.next,r.next=t),l.pending=t,t=oi(e),_p(e,null,n),t}return si(e,l,t,n),oi(e)}function ur(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,Df(e,n)}}function Qo(e,t){var n=e.updateQueue,l=e.alternate;if(l!==null&&(l=l.updateQueue,n===l)){var r=null,s=null;if(n=n.firstBaseUpdate,n!==null){do{var m={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};s===null?r=s=m:s=s.next=m,n=n.next}while(n!==null);s===null?r=s=t:s=s.next=t}else r=s=t;n={baseState:l.baseState,firstBaseUpdate:r,lastBaseUpdate:s,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 Ko=!1;function dr(){if(Ko){var e=va;if(e!==null)throw e}}function fr(e,t,n,l){Ko=!1;var r=e.updateQueue;ml=!1;var s=r.firstBaseUpdate,m=r.lastBaseUpdate,v=r.shared.pending;if(v!==null){r.shared.pending=null;var E=v,B=E.next;E.next=null,m===null?s=B:m.next=B,m=E;var te=e.alternate;te!==null&&(te=te.updateQueue,v=te.lastBaseUpdate,v!==m&&(v===null?te.firstBaseUpdate=B:v.next=B,te.lastBaseUpdate=E))}if(s!==null){var oe=r.baseState;m=0,te=B=E=null,v=s;do{var V=v.lane&-536870913,J=V!==v.lane;if(J?(Qe&V)===V:(l&V)===V){V!==0&&V===ba&&(Ko=!0),te!==null&&(te=te.next={lane:0,tag:v.tag,payload:v.payload,callback:null,next:null});e:{var we=e,ze=v;V=t;var ct=n;switch(ze.tag){case 1:if(we=ze.payload,typeof we=="function"){oe=we.call(ct,oe,V);break e}oe=we;break e;case 3:we.flags=we.flags&-65537|128;case 0:if(we=ze.payload,V=typeof we=="function"?we.call(ct,oe,V):we,V==null)break e;oe=A({},oe,V);break e;case 2:ml=!0}}V=v.callback,V!==null&&(e.flags|=64,J&&(e.flags|=8192),J=r.callbacks,J===null?r.callbacks=[V]:J.push(V))}else J={lane:V,tag:v.tag,payload:v.payload,callback:v.callback,next:null},te===null?(B=te=J,E=oe):te=te.next=J,m|=V;if(v=v.next,v===null){if(v=r.shared.pending,v===null)break;J=v,v=J.next,J.next=null,r.lastBaseUpdate=J,r.shared.pending=null}}while(!0);te===null&&(E=oe),r.baseState=E,r.firstBaseUpdate=B,r.lastBaseUpdate=te,s===null&&(r.shared.lanes=0),Sl|=m,e.lanes=m,e.memoizedState=oe}}function Xp(e,t){if(typeof e!="function")throw Error(u(191,e));e.call(t)}function Zp(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Xp(n[e],t)}var ja=w(null),xi=w(0);function Qp(e,t){e=el,ce(xi,e),ce(ja,t),el=e|t.baseLanes}function Jo(){ce(xi,el),ce(ja,ja.current)}function Wo(){el=xi.current,$(ja),$(xi)}var tn=w(null),bn=null;function gl(e){var t=e.alternate;ce(bt,bt.current&1),ce(tn,e),bn===null&&(t===null||ja.current!==null||t.memoizedState!==null)&&(bn=e)}function Po(e){ce(bt,bt.current),ce(tn,e),bn===null&&(bn=e)}function Kp(e){e.tag===22?(ce(bt,bt.current),ce(tn,e),bn===null&&(bn=e)):xl()}function xl(){ce(bt,bt.current),ce(tn,tn.current)}function nn(e){$(tn),bn===e&&(bn=null),$(bt)}var bt=w(0);function bi(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||ru(n)||iu(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 Vn=0,Le=null,st=null,At=null,vi=!1,Na=!1,Vl=!1,Si=0,pr=0,wa=null,iv=0;function gt(){throw Error(u(321))}function ec(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Pt(e[n],t[n]))return!1;return!0}function tc(e,t,n,l,r,s){return Vn=s,Le=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,T.H=e===null||e.memoizedState===null?qm:yc,Vl=!1,s=n(l,r),Vl=!1,Na&&(s=Wp(t,n,l,r)),Jp(e),s}function Jp(e){T.H=yr;var t=st!==null&&st.next!==null;if(Vn=0,At=st=Le=null,vi=!1,pr=0,wa=null,t)throw Error(u(300));e===null||jt||(e=e.dependencies,e!==null&&di(e)&&(jt=!0))}function Wp(e,t,n,l){Le=e;var r=0;do{if(Na&&(wa=null),pr=0,Na=!1,25<=r)throw Error(u(301));if(r+=1,At=st=null,e.updateQueue!=null){var s=e.updateQueue;s.lastEffect=null,s.events=null,s.stores=null,s.memoCache!=null&&(s.memoCache.index=0)}T.H=Mm,s=t(n,l)}while(Na);return s}function sv(){var e=T.H,t=e.useState()[0];return t=typeof t.then=="function"?mr(t):t,e=e.useState()[0],(st!==null?st.memoizedState:null)!==e&&(Le.flags|=1024),t}function nc(){var e=Si!==0;return Si=0,e}function lc(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function ac(e){if(vi){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}vi=!1}Vn=0,At=st=Le=null,Na=!1,pr=Si=0,wa=null}function Gt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return At===null?Le.memoizedState=At=e:At=At.next=e,At}function vt(){if(st===null){var e=Le.alternate;e=e!==null?e.memoizedState:null}else e=st.next;var t=At===null?Le.memoizedState:At.next;if(t!==null)At=t,st=e;else{if(e===null)throw Le.alternate===null?Error(u(467)):Error(u(310));st=e,e={memoizedState:st.memoizedState,baseState:st.baseState,baseQueue:st.baseQueue,queue:st.queue,next:null},At===null?Le.memoizedState=At=e:At=At.next=e}return At}function Ai(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function mr(e){var t=pr;return pr+=1,wa===null&&(wa=[]),e=Yp(wa,e,t),t=Le,(At===null?t.memoizedState:At.next)===null&&(t=t.alternate,T.H=t===null||t.memoizedState===null?qm:yc),e}function ji(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return mr(e);if(e.$$typeof===N)return Mt(e)}throw Error(u(438,String(e)))}function rc(e){var t=null,n=Le.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var l=Le.alternate;l!==null&&(l=l.updateQueue,l!==null&&(l=l.memoCache,l!=null&&(t={data:l.data.map(function(r){return r.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),n===null&&(n=Ai(),Le.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]=xe;return t.index++,n}function Xn(e,t){return typeof t=="function"?t(e):t}function Ni(e){var t=vt();return ic(t,st,e)}function ic(e,t,n){var l=e.queue;if(l===null)throw Error(u(311));l.lastRenderedReducer=n;var r=e.baseQueue,s=l.pending;if(s!==null){if(r!==null){var m=r.next;r.next=s.next,s.next=m}t.baseQueue=r=s,l.pending=null}if(s=e.baseState,r===null)e.memoizedState=s;else{t=r.next;var v=m=null,E=null,B=t,te=!1;do{var oe=B.lane&-536870913;if(oe!==B.lane?(Qe&oe)===oe:(Vn&oe)===oe){var V=B.revertLane;if(V===0)E!==null&&(E=E.next={lane:0,revertLane:0,gesture:null,action:B.action,hasEagerState:B.hasEagerState,eagerState:B.eagerState,next:null}),oe===ba&&(te=!0);else if((Vn&V)===V){B=B.next,V===ba&&(te=!0);continue}else oe={lane:0,revertLane:B.revertLane,gesture:null,action:B.action,hasEagerState:B.hasEagerState,eagerState:B.eagerState,next:null},E===null?(v=E=oe,m=s):E=E.next=oe,Le.lanes|=V,Sl|=V;oe=B.action,Vl&&n(s,oe),s=B.hasEagerState?B.eagerState:n(s,oe)}else V={lane:oe,revertLane:B.revertLane,gesture:B.gesture,action:B.action,hasEagerState:B.hasEagerState,eagerState:B.eagerState,next:null},E===null?(v=E=V,m=s):E=E.next=V,Le.lanes|=oe,Sl|=oe;B=B.next}while(B!==null&&B!==t);if(E===null?m=s:E.next=v,!Pt(s,e.memoizedState)&&(jt=!0,te&&(n=va,n!==null)))throw n;e.memoizedState=s,e.baseState=m,e.baseQueue=E,l.lastRenderedState=s}return r===null&&(l.lanes=0),[e.memoizedState,l.dispatch]}function sc(e){var t=vt(),n=t.queue;if(n===null)throw Error(u(311));n.lastRenderedReducer=e;var l=n.dispatch,r=n.pending,s=t.memoizedState;if(r!==null){n.pending=null;var m=r=r.next;do s=e(s,m.action),m=m.next;while(m!==r);Pt(s,t.memoizedState)||(jt=!0),t.memoizedState=s,t.baseQueue===null&&(t.baseState=s),n.lastRenderedState=s}return[s,l]}function Pp(e,t,n){var l=Le,r=vt(),s=We;if(s){if(n===void 0)throw Error(u(407));n=n()}else n=t();var m=!Pt((st||r).memoizedState,n);if(m&&(r.memoizedState=n,jt=!0),r=r.queue,uc(nm.bind(null,l,r,e),[e]),r.getSnapshot!==t||m||At!==null&&At.memoizedState.tag&1){if(l.flags|=2048,Ta(9,{destroy:void 0},tm.bind(null,l,r,n,t),null),ut===null)throw Error(u(349));s||(Vn&127)!==0||em(l,t,n)}return n}function em(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Le.updateQueue,t===null?(t=Ai(),Le.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function tm(e,t,n,l){t.value=n,t.getSnapshot=l,lm(t)&&am(e)}function nm(e,t,n){return n(function(){lm(t)&&am(e)})}function lm(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Pt(e,n)}catch{return!0}}function am(e){var t=Dl(e,2);t!==null&&Jt(t,e,2)}function oc(e){var t=Gt();if(typeof e=="function"){var n=e;if(e=n(),Vl){H(!0);try{n()}finally{H(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Xn,lastRenderedState:e},t}function rm(e,t,n,l){return e.baseState=n,ic(e,st,typeof l=="function"?l:Xn)}function ov(e,t,n,l,r){if(Ei(e))throw Error(u(485));if(e=t.action,e!==null){var s={payload:r,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(m){s.listeners.push(m)}};T.T!==null?n(!0):s.isTransition=!1,l(s),n=t.pending,n===null?(s.next=t.pending=s,im(t,s)):(s.next=n.next,t.pending=n.next=s)}}function im(e,t){var n=t.action,l=t.payload,r=e.state;if(t.isTransition){var s=T.T,m={};T.T=m;try{var v=n(r,l),E=T.S;E!==null&&E(m,v),sm(e,t,v)}catch(B){cc(e,t,B)}finally{s!==null&&m.types!==null&&(s.types=m.types),T.T=s}}else try{s=n(r,l),sm(e,t,s)}catch(B){cc(e,t,B)}}function sm(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(l){om(e,t,l)},function(l){return cc(e,t,l)}):om(e,t,n)}function om(e,t,n){t.status="fulfilled",t.value=n,cm(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,im(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,cm(t),t=t.next;while(t!==l)}e.action=null}function cm(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function um(e,t){return t}function dm(e,t){if(We){var n=ut.formState;if(n!==null){e:{var l=Le;if(We){if(pt){t:{for(var r=pt,s=xn;r.nodeType!==8;){if(!s){r=null;break t}if(r=vn(r.nextSibling),r===null){r=null;break t}}s=r.data,r=s==="F!"||s==="F"?r:null}if(r){pt=vn(r.nextSibling),l=r.data==="F!";break e}}fl(l)}l=!1}l&&(t=n[0])}}return n=Gt(),n.memoizedState=n.baseState=t,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:um,lastRenderedState:t},n.queue=l,n=Om.bind(null,Le,l),l.dispatch=n,l=oc(!1),s=hc.bind(null,Le,!1,l.queue),l=Gt(),r={state:t,dispatch:null,action:e,pending:null},l.queue=r,n=ov.bind(null,Le,r,s,n),r.dispatch=n,l.memoizedState=e,[t,n,!1]}function fm(e){var t=vt();return pm(t,st,e)}function pm(e,t,n){if(t=ic(e,t,um)[0],e=Ni(Xn)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var l=mr(t)}catch(m){throw m===Sa?mi:m}else l=t;t=vt();var r=t.queue,s=r.dispatch;return n!==t.memoizedState&&(Le.flags|=2048,Ta(9,{destroy:void 0},cv.bind(null,r,n),null)),[l,s,e]}function cv(e,t){e.action=t}function mm(e){var t=vt(),n=st;if(n!==null)return pm(t,n,e);vt(),t=t.memoizedState,n=vt();var l=n.queue.dispatch;return n.memoizedState=e,[t,l,!1]}function Ta(e,t,n,l){return e={tag:e,create:n,deps:l,inst:t,next:null},t=Le.updateQueue,t===null&&(t=Ai(),Le.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 hm(){return vt().memoizedState}function wi(e,t,n,l){var r=Gt();Le.flags|=e,r.memoizedState=Ta(1|t,{destroy:void 0},n,l===void 0?null:l)}function Ti(e,t,n,l){var r=vt();l=l===void 0?null:l;var s=r.memoizedState.inst;st!==null&&l!==null&&ec(l,st.memoizedState.deps)?r.memoizedState=Ta(t,s,n,l):(Le.flags|=e,r.memoizedState=Ta(1|t,s,n,l))}function ym(e,t){wi(8390656,8,e,t)}function uc(e,t){Ti(2048,8,e,t)}function uv(e){Le.flags|=4;var t=Le.updateQueue;if(t===null)t=Ai(),Le.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function gm(e){var t=vt().memoizedState;return uv({ref:t,nextImpl:e}),function(){if((lt&2)!==0)throw Error(u(440));return t.impl.apply(void 0,arguments)}}function xm(e,t){return Ti(4,2,e,t)}function bm(e,t){return Ti(4,4,e,t)}function vm(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 Sm(e,t,n){n=n!=null?n.concat([e]):null,Ti(4,4,vm.bind(null,t,e),n)}function dc(){}function Am(e,t){var n=vt();t=t===void 0?null:t;var l=n.memoizedState;return t!==null&&ec(t,l[1])?l[0]:(n.memoizedState=[e,t],e)}function jm(e,t){var n=vt();t=t===void 0?null:t;var l=n.memoizedState;if(t!==null&&ec(t,l[1]))return l[0];if(l=e(),Vl){H(!0);try{e()}finally{H(!1)}}return n.memoizedState=[l,t],l}function fc(e,t,n){return n===void 0||(Vn&1073741824)!==0&&(Qe&261930)===0?e.memoizedState=t:(e.memoizedState=n,e=Nh(),Le.lanes|=e,Sl|=e,n)}function Nm(e,t,n,l){return Pt(n,t)?n:ja.current!==null?(e=fc(e,n,l),Pt(e,t)||(jt=!0),e):(Vn&42)===0||(Vn&1073741824)!==0&&(Qe&261930)===0?(jt=!0,e.memoizedState=n):(e=Nh(),Le.lanes|=e,Sl|=e,t)}function wm(e,t,n,l,r){var s=ne.p;ne.p=s!==0&&8>s?s:8;var m=T.T,v={};T.T=v,hc(e,!1,t,n);try{var E=r(),B=T.S;if(B!==null&&B(v,E),E!==null&&typeof E=="object"&&typeof E.then=="function"){var te=rv(E,l);hr(e,t,te,rn(e))}else hr(e,t,l,rn(e))}catch(oe){hr(e,t,{then:function(){},status:"rejected",reason:oe},rn())}finally{ne.p=s,m!==null&&v.types!==null&&(m.types=v.types),T.T=m}}function dv(){}function pc(e,t,n,l){if(e.tag!==5)throw Error(u(476));var r=Tm(e).queue;wm(e,r,t,W,n===null?dv:function(){return Em(e),n(l)})}function Tm(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:W,baseState:W,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Xn,lastRenderedState:W},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Xn,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Em(e){var t=Tm(e);t.next===null&&(t=e.alternate.memoizedState),hr(e,t.next.queue,{},rn())}function mc(){return Mt(Rr)}function Cm(){return vt().memoizedState}function _m(){return vt().memoizedState}function fv(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=rn();e=hl(n);var l=yl(t,e,n);l!==null&&(Jt(l,t,n),ur(l,t,n)),t={cache:Go()},e.payload=t;return}t=t.return}}function pv(e,t,n){var l=rn();n={lane:l,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Ei(e)?km(t,n):(n=Ro(e,t,n,l),n!==null&&(Jt(n,e,l),Rm(n,t,l)))}function Om(e,t,n){var l=rn();hr(e,t,n,l)}function hr(e,t,n,l){var r={lane:l,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Ei(e))km(t,r);else{var s=e.alternate;if(e.lanes===0&&(s===null||s.lanes===0)&&(s=t.lastRenderedReducer,s!==null))try{var m=t.lastRenderedState,v=s(m,n);if(r.hasEagerState=!0,r.eagerState=v,Pt(v,m))return si(e,t,r,0),ut===null&&ii(),!1}catch{}if(n=Ro(e,t,r,l),n!==null)return Jt(n,e,l),Rm(n,t,l),!0}return!1}function hc(e,t,n,l){if(l={lane:2,revertLane:Xc(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Ei(e)){if(t)throw Error(u(479))}else t=Ro(e,n,l,2),t!==null&&Jt(t,e,2)}function Ei(e){var t=e.alternate;return e===Le||t!==null&&t===Le}function km(e,t){Na=vi=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Rm(e,t,n){if((n&4194048)!==0){var l=t.lanes;l&=e.pendingLanes,n|=l,t.lanes=n,Df(e,n)}}var yr={readContext:Mt,use:ji,useCallback:gt,useContext:gt,useEffect:gt,useImperativeHandle:gt,useLayoutEffect:gt,useInsertionEffect:gt,useMemo:gt,useReducer:gt,useRef:gt,useState:gt,useDebugValue:gt,useDeferredValue:gt,useTransition:gt,useSyncExternalStore:gt,useId:gt,useHostTransitionStatus:gt,useFormState:gt,useActionState:gt,useOptimistic:gt,useMemoCache:gt,useCacheRefresh:gt};yr.useEffectEvent=gt;var qm={readContext:Mt,use:ji,useCallback:function(e,t){return Gt().memoizedState=[e,t===void 0?null:t],e},useContext:Mt,useEffect:ym,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,wi(4194308,4,vm.bind(null,t,e),n)},useLayoutEffect:function(e,t){return wi(4194308,4,e,t)},useInsertionEffect:function(e,t){wi(4,2,e,t)},useMemo:function(e,t){var n=Gt();t=t===void 0?null:t;var l=e();if(Vl){H(!0);try{e()}finally{H(!1)}}return n.memoizedState=[l,t],l},useReducer:function(e,t,n){var l=Gt();if(n!==void 0){var r=n(t);if(Vl){H(!0);try{n(t)}finally{H(!1)}}}else r=t;return l.memoizedState=l.baseState=r,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:r},l.queue=e,e=e.dispatch=pv.bind(null,Le,e),[l.memoizedState,e]},useRef:function(e){var t=Gt();return e={current:e},t.memoizedState=e},useState:function(e){e=oc(e);var t=e.queue,n=Om.bind(null,Le,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:dc,useDeferredValue:function(e,t){var n=Gt();return fc(n,e,t)},useTransition:function(){var e=oc(!1);return e=wm.bind(null,Le,e.queue,!0,!1),Gt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var l=Le,r=Gt();if(We){if(n===void 0)throw Error(u(407));n=n()}else{if(n=t(),ut===null)throw Error(u(349));(Qe&127)!==0||em(l,t,n)}r.memoizedState=n;var s={value:n,getSnapshot:t};return r.queue=s,ym(nm.bind(null,l,s,e),[e]),l.flags|=2048,Ta(9,{destroy:void 0},tm.bind(null,l,s,n,t),null),n},useId:function(){var e=Gt(),t=ut.identifierPrefix;if(We){var n=Mn,l=qn;n=(l&~(1<<32-F(l)-1)).toString(32)+n,t="_"+t+"R_"+n,n=Si++,0<n&&(t+="H"+n.toString(32)),t+="_"}else n=iv++,t="_"+t+"r_"+n.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:mc,useFormState:dm,useActionState:dm,useOptimistic:function(e){var t=Gt();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=hc.bind(null,Le,!0,n),n.dispatch=t,[e,t]},useMemoCache:rc,useCacheRefresh:function(){return Gt().memoizedState=fv.bind(null,Le)},useEffectEvent:function(e){var t=Gt(),n={impl:e};return t.memoizedState=n,function(){if((lt&2)!==0)throw Error(u(440));return n.impl.apply(void 0,arguments)}}},yc={readContext:Mt,use:ji,useCallback:Am,useContext:Mt,useEffect:uc,useImperativeHandle:Sm,useInsertionEffect:xm,useLayoutEffect:bm,useMemo:jm,useReducer:Ni,useRef:hm,useState:function(){return Ni(Xn)},useDebugValue:dc,useDeferredValue:function(e,t){var n=vt();return Nm(n,st.memoizedState,e,t)},useTransition:function(){var e=Ni(Xn)[0],t=vt().memoizedState;return[typeof e=="boolean"?e:mr(e),t]},useSyncExternalStore:Pp,useId:Cm,useHostTransitionStatus:mc,useFormState:fm,useActionState:fm,useOptimistic:function(e,t){var n=vt();return rm(n,st,e,t)},useMemoCache:rc,useCacheRefresh:_m};yc.useEffectEvent=gm;var Mm={readContext:Mt,use:ji,useCallback:Am,useContext:Mt,useEffect:uc,useImperativeHandle:Sm,useInsertionEffect:xm,useLayoutEffect:bm,useMemo:jm,useReducer:sc,useRef:hm,useState:function(){return sc(Xn)},useDebugValue:dc,useDeferredValue:function(e,t){var n=vt();return st===null?fc(n,e,t):Nm(n,st.memoizedState,e,t)},useTransition:function(){var e=sc(Xn)[0],t=vt().memoizedState;return[typeof e=="boolean"?e:mr(e),t]},useSyncExternalStore:Pp,useId:Cm,useHostTransitionStatus:mc,useFormState:mm,useActionState:mm,useOptimistic:function(e,t){var n=vt();return st!==null?rm(n,st,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:rc,useCacheRefresh:_m};Mm.useEffectEvent=gm;function gc(e,t,n,l){t=e.memoizedState,n=n(l,t),n=n==null?t:A({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var xc={enqueueSetState:function(e,t,n){e=e._reactInternals;var l=rn(),r=hl(l);r.payload=t,n!=null&&(r.callback=n),t=yl(e,r,l),t!==null&&(Jt(t,e,l),ur(t,e,l))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var l=rn(),r=hl(l);r.tag=1,r.payload=t,n!=null&&(r.callback=n),t=yl(e,r,l),t!==null&&(Jt(t,e,l),ur(t,e,l))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=rn(),l=hl(n);l.tag=2,t!=null&&(l.callback=t),t=yl(e,l,n),t!==null&&(Jt(t,e,n),ur(t,e,n))}};function zm(e,t,n,l,r,s,m){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(l,s,m):t.prototype&&t.prototype.isPureReactComponent?!nr(n,l)||!nr(r,s):!0}function $m(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&&xc.enqueueReplaceState(t,t.state,null)}function Xl(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=A({},n));for(var r in e)n[r]===void 0&&(n[r]=e[r])}return n}function Dm(e){ri(e)}function Um(e){console.error(e)}function Hm(e){ri(e)}function Ci(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(l){setTimeout(function(){throw l})}}function Lm(e,t,n){try{var l=e.onCaughtError;l(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(r){setTimeout(function(){throw r})}}function bc(e,t,n){return n=hl(n),n.tag=3,n.payload={element:null},n.callback=function(){Ci(e,t)},n}function Bm(e){return e=hl(e),e.tag=3,e}function Ym(e,t,n,l){var r=n.type.getDerivedStateFromError;if(typeof r=="function"){var s=l.value;e.payload=function(){return r(s)},e.callback=function(){Lm(t,n,l)}}var m=n.stateNode;m!==null&&typeof m.componentDidCatch=="function"&&(e.callback=function(){Lm(t,n,l),typeof r!="function"&&(Al===null?Al=new Set([this]):Al.add(this));var v=l.stack;this.componentDidCatch(l.value,{componentStack:v!==null?v:""})})}function mv(e,t,n,l,r){if(n.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){if(t=n.alternate,t!==null&&xa(t,n,r,!0),n=tn.current,n!==null){switch(n.tag){case 31:case 13:return bn===null?Li():n.alternate===null&&xt===0&&(xt=3),n.flags&=-257,n.flags|=65536,n.lanes=r,l===hi?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([l]):t.add(l),Ic(e,l,r)),!1;case 22:return n.flags|=65536,l===hi?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)),Ic(e,l,r)),!1}throw Error(u(435,n.tag))}return Ic(e,l,r),Li(),!1}if(We)return t=tn.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=r,l!==Uo&&(e=Error(u(422),{cause:l}),rr(hn(e,n)))):(l!==Uo&&(t=Error(u(423),{cause:l}),rr(hn(t,n))),e=e.current.alternate,e.flags|=65536,r&=-r,e.lanes|=r,l=hn(l,n),r=bc(e.stateNode,l,r),Qo(e,r),xt!==4&&(xt=2)),!1;var s=Error(u(520),{cause:l});if(s=hn(s,n),Nr===null?Nr=[s]:Nr.push(s),xt!==4&&(xt=2),t===null)return!0;l=hn(l,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=r&-r,n.lanes|=e,e=bc(n.stateNode,l,e),Qo(n,e),!1;case 1:if(t=n.type,s=n.stateNode,(n.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||s!==null&&typeof s.componentDidCatch=="function"&&(Al===null||!Al.has(s))))return n.flags|=65536,r&=-r,n.lanes|=r,r=Bm(r),Ym(r,e,n,l),Qo(n,r),!1}n=n.return}while(n!==null);return!1}var vc=Error(u(461)),jt=!1;function zt(e,t,n,l){t.child=e===null?Vp(t,null,n,l):Fl(t,e.child,n,l)}function Gm(e,t,n,l,r){n=n.render;var s=t.ref;if("ref"in l){var m={};for(var v in l)v!=="ref"&&(m[v]=l[v])}else m=l;return Bl(t),l=tc(e,t,n,m,s,r),v=nc(),e!==null&&!jt?(lc(e,t,r),Zn(e,t,r)):(We&&v&&$o(t),t.flags|=1,zt(e,t,l,r),t.child)}function Im(e,t,n,l,r){if(e===null){var s=n.type;return typeof s=="function"&&!qo(s)&&s.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=s,Fm(e,t,s,l,r)):(e=ci(n.type,null,l,t,t.mode,r),e.ref=t.ref,e.return=t,t.child=e)}if(s=e.child,!Cc(e,r)){var m=s.memoizedProps;if(n=n.compare,n=n!==null?n:nr,n(m,l)&&e.ref===t.ref)return Zn(e,t,r)}return t.flags|=1,e=Yn(s,l),e.ref=t.ref,e.return=t,t.child=e}function Fm(e,t,n,l,r){if(e!==null){var s=e.memoizedProps;if(nr(s,l)&&e.ref===t.ref)if(jt=!1,t.pendingProps=l=s,Cc(e,r))(e.flags&131072)!==0&&(jt=!0);else return t.lanes=e.lanes,Zn(e,t,r)}return Sc(e,t,n,l,r)}function Vm(e,t,n,l){var r=l.children,s=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(s=s!==null?s.baseLanes|n:n,e!==null){for(l=t.child=e.child,r=0;l!==null;)r=r|l.lanes|l.childLanes,l=l.sibling;l=r&~s}else l=0,t.child=null;return Xm(e,t,s,n,l)}if((n&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&pi(t,s!==null?s.cachePool:null),s!==null?Qp(t,s):Jo(),Kp(t);else return l=t.lanes=536870912,Xm(e,t,s!==null?s.baseLanes|n:n,n,l)}else s!==null?(pi(t,s.cachePool),Qp(t,s),xl(),t.memoizedState=null):(e!==null&&pi(t,null),Jo(),xl());return zt(e,t,r,n),t.child}function gr(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Xm(e,t,n,l,r){var s=Fo();return s=s===null?null:{parent:St._currentValue,pool:s},t.memoizedState={baseLanes:n,cachePool:s},e!==null&&pi(t,null),Jo(),Kp(t),e!==null&&xa(e,t,l,!0),t.childLanes=r,null}function _i(e,t){return t=ki({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Zm(e,t,n){return Fl(t,e.child,null,n),e=_i(t,t.pendingProps),e.flags|=2,nn(t),t.memoizedState=null,e}function hv(e,t,n){var l=t.pendingProps,r=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(We){if(l.mode==="hidden")return e=_i(t,l),t.lanes=536870912,gr(null,e);if(Po(t),(e=pt)?(e=iy(e,xn),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ul!==null?{id:qn,overflow:Mn}:null,retryLane:536870912,hydrationErrors:null},n=kp(e),n.return=t,t.child=n,qt=t,pt=null)):e=null,e===null)throw fl(t);return t.lanes=536870912,null}return _i(t,l)}var s=e.memoizedState;if(s!==null){var m=s.dehydrated;if(Po(t),r)if(t.flags&256)t.flags&=-257,t=Zm(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(u(558));else if(jt||xa(e,t,n,!1),r=(n&e.childLanes)!==0,jt||r){if(l=ut,l!==null&&(m=Uf(l,n),m!==0&&m!==s.retryLane))throw s.retryLane=m,Dl(e,m),Jt(l,e,m),vc;Li(),t=Zm(e,t,n)}else e=s.treeContext,pt=vn(m.nextSibling),qt=t,We=!0,dl=null,xn=!1,e!==null&&Mp(t,e),t=_i(t,l),t.flags|=4096;return t}return e=Yn(e.child,{mode:l.mode,children:l.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Oi(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(u(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function Sc(e,t,n,l,r){return Bl(t),n=tc(e,t,n,l,void 0,r),l=nc(),e!==null&&!jt?(lc(e,t,r),Zn(e,t,r)):(We&&l&&$o(t),t.flags|=1,zt(e,t,n,r),t.child)}function Qm(e,t,n,l,r,s){return Bl(t),t.updateQueue=null,n=Wp(t,l,n,r),Jp(e),l=nc(),e!==null&&!jt?(lc(e,t,s),Zn(e,t,s)):(We&&l&&$o(t),t.flags|=1,zt(e,t,n,s),t.child)}function Km(e,t,n,l,r){if(Bl(t),t.stateNode===null){var s=ma,m=n.contextType;typeof m=="object"&&m!==null&&(s=Mt(m)),s=new n(l,s),t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,s.updater=xc,t.stateNode=s,s._reactInternals=t,s=t.stateNode,s.props=l,s.state=t.memoizedState,s.refs={},Xo(t),m=n.contextType,s.context=typeof m=="object"&&m!==null?Mt(m):ma,s.state=t.memoizedState,m=n.getDerivedStateFromProps,typeof m=="function"&&(gc(t,n,m,l),s.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof s.getSnapshotBeforeUpdate=="function"||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(m=s.state,typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount(),m!==s.state&&xc.enqueueReplaceState(s,s.state,null),fr(t,l,s,r),dr(),s.state=t.memoizedState),typeof s.componentDidMount=="function"&&(t.flags|=4194308),l=!0}else if(e===null){s=t.stateNode;var v=t.memoizedProps,E=Xl(n,v);s.props=E;var B=s.context,te=n.contextType;m=ma,typeof te=="object"&&te!==null&&(m=Mt(te));var oe=n.getDerivedStateFromProps;te=typeof oe=="function"||typeof s.getSnapshotBeforeUpdate=="function",v=t.pendingProps!==v,te||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(v||B!==m)&&$m(t,s,l,m),ml=!1;var V=t.memoizedState;s.state=V,fr(t,l,s,r),dr(),B=t.memoizedState,v||V!==B||ml?(typeof oe=="function"&&(gc(t,n,oe,l),B=t.memoizedState),(E=ml||zm(t,n,E,l,V,B,m))?(te||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount()),typeof s.componentDidMount=="function"&&(t.flags|=4194308)):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=l,t.memoizedState=B),s.props=l,s.state=B,s.context=m,l=E):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),l=!1)}else{s=t.stateNode,Zo(e,t),m=t.memoizedProps,te=Xl(n,m),s.props=te,oe=t.pendingProps,V=s.context,B=n.contextType,E=ma,typeof B=="object"&&B!==null&&(E=Mt(B)),v=n.getDerivedStateFromProps,(B=typeof v=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(m!==oe||V!==E)&&$m(t,s,l,E),ml=!1,V=t.memoizedState,s.state=V,fr(t,l,s,r),dr();var J=t.memoizedState;m!==oe||V!==J||ml||e!==null&&e.dependencies!==null&&di(e.dependencies)?(typeof v=="function"&&(gc(t,n,v,l),J=t.memoizedState),(te=ml||zm(t,n,te,l,V,J,E)||e!==null&&e.dependencies!==null&&di(e.dependencies))?(B||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(l,J,E),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(l,J,E)),typeof s.componentDidUpdate=="function"&&(t.flags|=4),typeof s.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof s.componentDidUpdate!="function"||m===e.memoizedProps&&V===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||m===e.memoizedProps&&V===e.memoizedState||(t.flags|=1024),t.memoizedProps=l,t.memoizedState=J),s.props=l,s.state=J,s.context=E,l=te):(typeof s.componentDidUpdate!="function"||m===e.memoizedProps&&V===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||m===e.memoizedProps&&V===e.memoizedState||(t.flags|=1024),l=!1)}return s=l,Oi(e,t),l=(t.flags&128)!==0,s||l?(s=t.stateNode,n=l&&typeof n.getDerivedStateFromError!="function"?null:s.render(),t.flags|=1,e!==null&&l?(t.child=Fl(t,e.child,null,r),t.child=Fl(t,null,n,r)):zt(e,t,n,r),t.memoizedState=s.state,e=t.child):e=Zn(e,t,r),e}function Jm(e,t,n,l){return Hl(),t.flags|=256,zt(e,t,n,l),t.child}var Ac={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function jc(e){return{baseLanes:e,cachePool:Lp()}}function Nc(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=an),e}function Wm(e,t,n){var l=t.pendingProps,r=!1,s=(t.flags&128)!==0,m;if((m=s)||(m=e!==null&&e.memoizedState===null?!1:(bt.current&2)!==0),m&&(r=!0,t.flags&=-129),m=(t.flags&32)!==0,t.flags&=-33,e===null){if(We){if(r?gl(t):xl(),(e=pt)?(e=iy(e,xn),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ul!==null?{id:qn,overflow:Mn}:null,retryLane:536870912,hydrationErrors:null},n=kp(e),n.return=t,t.child=n,qt=t,pt=null)):e=null,e===null)throw fl(t);return iu(e)?t.lanes=32:t.lanes=536870912,null}var v=l.children;return l=l.fallback,r?(xl(),r=t.mode,v=ki({mode:"hidden",children:v},r),l=Ul(l,r,n,null),v.return=t,l.return=t,v.sibling=l,t.child=v,l=t.child,l.memoizedState=jc(n),l.childLanes=Nc(e,m,n),t.memoizedState=Ac,gr(null,l)):(gl(t),wc(t,v))}var E=e.memoizedState;if(E!==null&&(v=E.dehydrated,v!==null)){if(s)t.flags&256?(gl(t),t.flags&=-257,t=Tc(e,t,n)):t.memoizedState!==null?(xl(),t.child=e.child,t.flags|=128,t=null):(xl(),v=l.fallback,r=t.mode,l=ki({mode:"visible",children:l.children},r),v=Ul(v,r,n,null),v.flags|=2,l.return=t,v.return=t,l.sibling=v,t.child=l,Fl(t,e.child,null,n),l=t.child,l.memoizedState=jc(n),l.childLanes=Nc(e,m,n),t.memoizedState=Ac,t=gr(null,l));else if(gl(t),iu(v)){if(m=v.nextSibling&&v.nextSibling.dataset,m)var B=m.dgst;m=B,l=Error(u(419)),l.stack="",l.digest=m,rr({value:l,source:null,stack:null}),t=Tc(e,t,n)}else if(jt||xa(e,t,n,!1),m=(n&e.childLanes)!==0,jt||m){if(m=ut,m!==null&&(l=Uf(m,n),l!==0&&l!==E.retryLane))throw E.retryLane=l,Dl(e,l),Jt(m,e,l),vc;ru(v)||Li(),t=Tc(e,t,n)}else ru(v)?(t.flags|=192,t.child=e.child,t=null):(e=E.treeContext,pt=vn(v.nextSibling),qt=t,We=!0,dl=null,xn=!1,e!==null&&Mp(t,e),t=wc(t,l.children),t.flags|=4096);return t}return r?(xl(),v=l.fallback,r=t.mode,E=e.child,B=E.sibling,l=Yn(E,{mode:"hidden",children:l.children}),l.subtreeFlags=E.subtreeFlags&65011712,B!==null?v=Yn(B,v):(v=Ul(v,r,n,null),v.flags|=2),v.return=t,l.return=t,l.sibling=v,t.child=l,gr(null,l),l=t.child,v=e.child.memoizedState,v===null?v=jc(n):(r=v.cachePool,r!==null?(E=St._currentValue,r=r.parent!==E?{parent:E,pool:E}:r):r=Lp(),v={baseLanes:v.baseLanes|n,cachePool:r}),l.memoizedState=v,l.childLanes=Nc(e,m,n),t.memoizedState=Ac,gr(e.child,l)):(gl(t),n=e.child,e=n.sibling,n=Yn(n,{mode:"visible",children:l.children}),n.return=t,n.sibling=null,e!==null&&(m=t.deletions,m===null?(t.deletions=[e],t.flags|=16):m.push(e)),t.child=n,t.memoizedState=null,n)}function wc(e,t){return t=ki({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function ki(e,t){return e=en(22,e,null,t),e.lanes=0,e}function Tc(e,t,n){return Fl(t,e.child,null,n),e=wc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Pm(e,t,n){e.lanes|=t;var l=e.alternate;l!==null&&(l.lanes|=t),Bo(e.return,t,n)}function Ec(e,t,n,l,r,s){var m=e.memoizedState;m===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:l,tail:n,tailMode:r,treeForkCount:s}:(m.isBackwards=t,m.rendering=null,m.renderingStartTime=0,m.last=l,m.tail=n,m.tailMode=r,m.treeForkCount=s)}function eh(e,t,n){var l=t.pendingProps,r=l.revealOrder,s=l.tail;l=l.children;var m=bt.current,v=(m&2)!==0;if(v?(m=m&1|2,t.flags|=128):m&=1,ce(bt,m),zt(e,t,l,n),l=We?ar:0,!v&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Pm(e,n,t);else if(e.tag===19)Pm(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(r){case"forwards":for(n=t.child,r=null;n!==null;)e=n.alternate,e!==null&&bi(e)===null&&(r=n),n=n.sibling;n=r,n===null?(r=t.child,t.child=null):(r=n.sibling,n.sibling=null),Ec(t,!1,r,n,s,l);break;case"backwards":case"unstable_legacy-backwards":for(n=null,r=t.child,t.child=null;r!==null;){if(e=r.alternate,e!==null&&bi(e)===null){t.child=r;break}e=r.sibling,r.sibling=n,n=r,r=e}Ec(t,!0,n,null,s,l);break;case"together":Ec(t,!1,null,null,void 0,l);break;default:t.memoizedState=null}return t.child}function Zn(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Sl|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(xa(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(u(153));if(t.child!==null){for(e=t.child,n=Yn(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Yn(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Cc(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&di(e)))}function yv(e,t,n){switch(t.tag){case 3:Ve(t,t.stateNode.containerInfo),pl(t,St,e.memoizedState.cache),Hl();break;case 27:case 5:Be(t);break;case 4:Ve(t,t.stateNode.containerInfo);break;case 10:pl(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Po(t),null;break;case 13:var l=t.memoizedState;if(l!==null)return l.dehydrated!==null?(gl(t),t.flags|=128,null):(n&t.child.childLanes)!==0?Wm(e,t,n):(gl(t),e=Zn(e,t,n),e!==null?e.sibling:null);gl(t);break;case 19:var r=(e.flags&128)!==0;if(l=(n&t.childLanes)!==0,l||(xa(e,t,n,!1),l=(n&t.childLanes)!==0),r){if(l)return eh(e,t,n);t.flags|=128}if(r=t.memoizedState,r!==null&&(r.rendering=null,r.tail=null,r.lastEffect=null),ce(bt,bt.current),l)break;return null;case 22:return t.lanes=0,Vm(e,t,n,t.pendingProps);case 24:pl(t,St,e.memoizedState.cache)}return Zn(e,t,n)}function th(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)jt=!0;else{if(!Cc(e,n)&&(t.flags&128)===0)return jt=!1,yv(e,t,n);jt=(e.flags&131072)!==0}else jt=!1,We&&(t.flags&1048576)!==0&&qp(t,ar,t.index);switch(t.lanes=0,t.tag){case 16:e:{var l=t.pendingProps;if(e=Gl(t.elementType),t.type=e,typeof e=="function")qo(e)?(l=Xl(e,l),t.tag=1,t=Km(null,t,e,l,n)):(t.tag=0,t=Sc(null,t,e,l,n));else{if(e!=null){var r=e.$$typeof;if(r===j){t.tag=11,t=Gm(null,t,e,l,n);break e}else if(r===D){t.tag=14,t=Im(null,t,e,l,n);break e}}throw t=he(e)||e,Error(u(306,t,""))}}return t;case 0:return Sc(e,t,t.type,t.pendingProps,n);case 1:return l=t.type,r=Xl(l,t.pendingProps),Km(e,t,l,r,n);case 3:e:{if(Ve(t,t.stateNode.containerInfo),e===null)throw Error(u(387));l=t.pendingProps;var s=t.memoizedState;r=s.element,Zo(e,t),fr(t,l,null,n);var m=t.memoizedState;if(l=m.cache,pl(t,St,l),l!==s.cache&&Yo(t,[St],n,!0),dr(),l=m.element,s.isDehydrated)if(s={element:l,isDehydrated:!1,cache:m.cache},t.updateQueue.baseState=s,t.memoizedState=s,t.flags&256){t=Jm(e,t,l,n);break e}else if(l!==r){r=hn(Error(u(424)),t),rr(r),t=Jm(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,pt=vn(e.firstChild),qt=t,We=!0,dl=null,xn=!0,n=Vp(t,null,l,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Hl(),l===r){t=Zn(e,t,n);break e}zt(e,t,l,n)}t=t.child}return t;case 26:return Oi(e,t),e===null?(n=fy(t.type,null,t.pendingProps,null))?t.memoizedState=n:We||(n=t.type,e=t.pendingProps,l=Xi(Te.current).createElement(n),l[Rt]=t,l[Ft]=e,$t(l,n,e),Ct(l),t.stateNode=l):t.memoizedState=fy(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Be(t),e===null&&We&&(l=t.stateNode=cy(t.type,t.pendingProps,Te.current),qt=t,xn=!0,r=pt,Tl(t.type)?(su=r,pt=vn(l.firstChild)):pt=r),zt(e,t,t.pendingProps.children,n),Oi(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&We&&((r=l=pt)&&(l=Vv(l,t.type,t.pendingProps,xn),l!==null?(t.stateNode=l,qt=t,pt=vn(l.firstChild),xn=!1,r=!0):r=!1),r||fl(t)),Be(t),r=t.type,s=t.pendingProps,m=e!==null?e.memoizedProps:null,l=s.children,nu(r,s)?l=null:m!==null&&nu(r,m)&&(t.flags|=32),t.memoizedState!==null&&(r=tc(e,t,sv,null,null,n),Rr._currentValue=r),Oi(e,t),zt(e,t,l,n),t.child;case 6:return e===null&&We&&((e=n=pt)&&(n=Xv(n,t.pendingProps,xn),n!==null?(t.stateNode=n,qt=t,pt=null,e=!0):e=!1),e||fl(t)),null;case 13:return Wm(e,t,n);case 4:return Ve(t,t.stateNode.containerInfo),l=t.pendingProps,e===null?t.child=Fl(t,null,l,n):zt(e,t,l,n),t.child;case 11:return Gm(e,t,t.type,t.pendingProps,n);case 7:return zt(e,t,t.pendingProps,n),t.child;case 8:return zt(e,t,t.pendingProps.children,n),t.child;case 12:return zt(e,t,t.pendingProps.children,n),t.child;case 10:return l=t.pendingProps,pl(t,t.type,l.value),zt(e,t,l.children,n),t.child;case 9:return r=t.type._context,l=t.pendingProps.children,Bl(t),r=Mt(r),l=l(r),t.flags|=1,zt(e,t,l,n),t.child;case 14:return Im(e,t,t.type,t.pendingProps,n);case 15:return Fm(e,t,t.type,t.pendingProps,n);case 19:return eh(e,t,n);case 31:return hv(e,t,n);case 22:return Vm(e,t,n,t.pendingProps);case 24:return Bl(t),l=Mt(St),e===null?(r=Fo(),r===null&&(r=ut,s=Go(),r.pooledCache=s,s.refCount++,s!==null&&(r.pooledCacheLanes|=n),r=s),t.memoizedState={parent:l,cache:r},Xo(t),pl(t,St,r)):((e.lanes&n)!==0&&(Zo(e,t),fr(t,null,null,n),dr()),r=e.memoizedState,s=t.memoizedState,r.parent!==l?(r={parent:l,cache:l},t.memoizedState=r,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=r),pl(t,St,l)):(l=s.cache,pl(t,St,l),l!==r.cache&&Yo(t,[St],n,!0))),zt(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(u(156,t.tag))}function Qn(e){e.flags|=4}function _c(e,t,n,l,r){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(r&335544128)===r)if(e.stateNode.complete)e.flags|=8192;else if(Ch())e.flags|=8192;else throw Il=hi,Vo}else e.flags&=-16777217}function nh(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!gy(t))if(Ch())e.flags|=8192;else throw Il=hi,Vo}function Ri(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?jn():536870912,e.lanes|=t,Oa|=t)}function xr(e,t){if(!We)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 mt(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,l=0;if(t)for(var r=e.child;r!==null;)n|=r.lanes|r.childLanes,l|=r.subtreeFlags&65011712,l|=r.flags&65011712,r.return=e,r=r.sibling;else for(r=e.child;r!==null;)n|=r.lanes|r.childLanes,l|=r.subtreeFlags,l|=r.flags,r.return=e,r=r.sibling;return e.subtreeFlags|=l,e.childLanes=n,t}function gv(e,t,n){var l=t.pendingProps;switch(Do(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return mt(t),null;case 1:return mt(t),null;case 3:return n=t.stateNode,l=null,e!==null&&(l=e.memoizedState.cache),t.memoizedState.cache!==l&&(t.flags|=2048),Fn(St),Ie(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(ga(t)?Qn(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Ho())),mt(t),null;case 26:var r=t.type,s=t.memoizedState;return e===null?(Qn(t),s!==null?(mt(t),nh(t,s)):(mt(t),_c(t,r,null,l,n))):s?s!==e.memoizedState?(Qn(t),mt(t),nh(t,s)):(mt(t),t.flags&=-16777217):(e=e.memoizedProps,e!==l&&Qn(t),mt(t),_c(t,r,e,l,n)),null;case 27:if(Z(t),n=Te.current,r=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&Qn(t);else{if(!l){if(t.stateNode===null)throw Error(u(166));return mt(t),null}e=pe.current,ga(t)?zp(t):(e=cy(r,l,n),t.stateNode=e,Qn(t))}return mt(t),null;case 5:if(Z(t),r=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&Qn(t);else{if(!l){if(t.stateNode===null)throw Error(u(166));return mt(t),null}if(s=pe.current,ga(t))zp(t);else{var m=Xi(Te.current);switch(s){case 1:s=m.createElementNS("http://www.w3.org/2000/svg",r);break;case 2:s=m.createElementNS("http://www.w3.org/1998/Math/MathML",r);break;default:switch(r){case"svg":s=m.createElementNS("http://www.w3.org/2000/svg",r);break;case"math":s=m.createElementNS("http://www.w3.org/1998/Math/MathML",r);break;case"script":s=m.createElement("div"),s.innerHTML="<script><\/script>",s=s.removeChild(s.firstChild);break;case"select":s=typeof l.is=="string"?m.createElement("select",{is:l.is}):m.createElement("select"),l.multiple?s.multiple=!0:l.size&&(s.size=l.size);break;default:s=typeof l.is=="string"?m.createElement(r,{is:l.is}):m.createElement(r)}}s[Rt]=t,s[Ft]=l;e:for(m=t.child;m!==null;){if(m.tag===5||m.tag===6)s.appendChild(m.stateNode);else if(m.tag!==4&&m.tag!==27&&m.child!==null){m.child.return=m,m=m.child;continue}if(m===t)break e;for(;m.sibling===null;){if(m.return===null||m.return===t)break e;m=m.return}m.sibling.return=m.return,m=m.sibling}t.stateNode=s;e:switch($t(s,r,l),r){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}l&&Qn(t)}}return mt(t),_c(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==l&&Qn(t);else{if(typeof l!="string"&&t.stateNode===null)throw Error(u(166));if(e=Te.current,ga(t)){if(e=t.stateNode,n=t.memoizedProps,l=null,r=qt,r!==null)switch(r.tag){case 27:case 5:l=r.memoizedProps}e[Rt]=t,e=!!(e.nodeValue===n||l!==null&&l.suppressHydrationWarning===!0||Wh(e.nodeValue,n)),e||fl(t,!0)}else e=Xi(e).createTextNode(l),e[Rt]=t,t.stateNode=e}return mt(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(l=ga(t),n!==null){if(e===null){if(!l)throw Error(u(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(u(557));e[Rt]=t}else Hl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;mt(t),e=!1}else n=Ho(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(nn(t),t):(nn(t),null);if((t.flags&128)!==0)throw Error(u(558))}return mt(t),null;case 13:if(l=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(r=ga(t),l!==null&&l.dehydrated!==null){if(e===null){if(!r)throw Error(u(318));if(r=t.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(u(317));r[Rt]=t}else Hl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;mt(t),r=!1}else r=Ho(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=r),r=!0;if(!r)return t.flags&256?(nn(t),t):(nn(t),null)}return nn(t),(t.flags&128)!==0?(t.lanes=n,t):(n=l!==null,e=e!==null&&e.memoizedState!==null,n&&(l=t.child,r=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(r=l.alternate.memoizedState.cachePool.pool),s=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(s=l.memoizedState.cachePool.pool),s!==r&&(l.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Ri(t,t.updateQueue),mt(t),null);case 4:return Ie(),e===null&&Jc(t.stateNode.containerInfo),mt(t),null;case 10:return Fn(t.type),mt(t),null;case 19:if($(bt),l=t.memoizedState,l===null)return mt(t),null;if(r=(t.flags&128)!==0,s=l.rendering,s===null)if(r)xr(l,!1);else{if(xt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(s=bi(e),s!==null){for(t.flags|=128,xr(l,!1),e=s.updateQueue,t.updateQueue=e,Ri(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Op(n,e),n=n.sibling;return ce(bt,bt.current&1|2),We&&Gn(t,l.treeForkCount),t.child}e=e.sibling}l.tail!==null&&_e()>Di&&(t.flags|=128,r=!0,xr(l,!1),t.lanes=4194304)}else{if(!r)if(e=bi(s),e!==null){if(t.flags|=128,r=!0,e=e.updateQueue,t.updateQueue=e,Ri(t,e),xr(l,!0),l.tail===null&&l.tailMode==="hidden"&&!s.alternate&&!We)return mt(t),null}else 2*_e()-l.renderingStartTime>Di&&n!==536870912&&(t.flags|=128,r=!0,xr(l,!1),t.lanes=4194304);l.isBackwards?(s.sibling=t.child,t.child=s):(e=l.last,e!==null?e.sibling=s:t.child=s,l.last=s)}return l.tail!==null?(e=l.tail,l.rendering=e,l.tail=e.sibling,l.renderingStartTime=_e(),e.sibling=null,n=bt.current,ce(bt,r?n&1|2:n&1),We&&Gn(t,l.treeForkCount),e):(mt(t),null);case 22:case 23:return nn(t),Wo(),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&&(mt(t),t.subtreeFlags&6&&(t.flags|=8192)):mt(t),n=t.updateQueue,n!==null&&Ri(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&&$(Yl),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Fn(St),mt(t),null;case 25:return null;case 30:return null}throw Error(u(156,t.tag))}function xv(e,t){switch(Do(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Fn(St),Ie(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Z(t),null;case 31:if(t.memoizedState!==null){if(nn(t),t.alternate===null)throw Error(u(340));Hl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(nn(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(u(340));Hl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return $(bt),null;case 4:return Ie(),null;case 10:return Fn(t.type),null;case 22:case 23:return nn(t),Wo(),e!==null&&$(Yl),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Fn(St),null;case 25:return null;default:return null}}function lh(e,t){switch(Do(t),t.tag){case 3:Fn(St),Ie();break;case 26:case 27:case 5:Z(t);break;case 4:Ie();break;case 31:t.memoizedState!==null&&nn(t);break;case 13:nn(t);break;case 19:$(bt);break;case 10:Fn(t.type);break;case 22:case 23:nn(t),Wo(),e!==null&&$(Yl);break;case 24:Fn(St)}}function br(e,t){try{var n=t.updateQueue,l=n!==null?n.lastEffect:null;if(l!==null){var r=l.next;n=r;do{if((n.tag&e)===e){l=void 0;var s=n.create,m=n.inst;l=s(),m.destroy=l}n=n.next}while(n!==r)}}catch(v){it(t,t.return,v)}}function bl(e,t,n){try{var l=t.updateQueue,r=l!==null?l.lastEffect:null;if(r!==null){var s=r.next;l=s;do{if((l.tag&e)===e){var m=l.inst,v=m.destroy;if(v!==void 0){m.destroy=void 0,r=t;var E=n,B=v;try{B()}catch(te){it(r,E,te)}}}l=l.next}while(l!==s)}}catch(te){it(t,t.return,te)}}function ah(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Zp(t,n)}catch(l){it(e,e.return,l)}}}function rh(e,t,n){n.props=Xl(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(l){it(e,t,l)}}function vr(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(r){it(e,t,r)}}function zn(e,t){var n=e.ref,l=e.refCleanup;if(n!==null)if(typeof l=="function")try{l()}catch(r){it(e,t,r)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(r){it(e,t,r)}else n.current=null}function ih(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(r){it(e,e.return,r)}}function Oc(e,t,n){try{var l=e.stateNode;Lv(l,e.type,n,t),l[Ft]=t}catch(r){it(e,e.return,r)}}function sh(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Tl(e.type)||e.tag===4}function kc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||sh(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&&Tl(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=Ln));else if(l!==4&&(l===27&&Tl(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 qi(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&&Tl(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(qi(e,t,n),e=e.sibling;e!==null;)qi(e,t,n),e=e.sibling}function oh(e){var t=e.stateNode,n=e.memoizedProps;try{for(var l=e.type,r=t.attributes;r.length;)t.removeAttributeNode(r[0]);$t(t,l,n),t[Rt]=e,t[Ft]=n}catch(s){it(e,e.return,s)}}var Kn=!1,Nt=!1,qc=!1,ch=typeof WeakSet=="function"?WeakSet:Set,_t=null;function bv(e,t){if(e=e.containerInfo,eu=es,e=Sp(e),To(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 r=l.anchorOffset,s=l.focusNode;l=l.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break e}var m=0,v=-1,E=-1,B=0,te=0,oe=e,V=null;t:for(;;){for(var J;oe!==n||r!==0&&oe.nodeType!==3||(v=m+r),oe!==s||l!==0&&oe.nodeType!==3||(E=m+l),oe.nodeType===3&&(m+=oe.nodeValue.length),(J=oe.firstChild)!==null;)V=oe,oe=J;for(;;){if(oe===e)break t;if(V===n&&++B===r&&(v=m),V===s&&++te===l&&(E=m),(J=oe.nextSibling)!==null)break;oe=V,V=oe.parentNode}oe=J}n=v===-1||E===-1?null:{start:v,end:E}}else n=null}n=n||{start:0,end:0}}else n=null;for(tu={focusedElem:e,selectionRange:n},es=!1,_t=t;_t!==null;)if(t=_t,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,_t=e;else for(;_t!==null;){switch(t=_t,s=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++)r=e[n],r.ref.impl=r.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&s!==null){e=void 0,n=t,r=s.memoizedProps,s=s.memoizedState,l=n.stateNode;try{var we=Xl(n.type,r);e=l.getSnapshotBeforeUpdate(we,s),l.__reactInternalSnapshotBeforeUpdate=e}catch(ze){it(n,n.return,ze)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)au(e);else if(n===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":au(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(u(163))}if(e=t.sibling,e!==null){e.return=t.return,_t=e;break}_t=t.return}}function uh(e,t,n){var l=n.flags;switch(n.tag){case 0:case 11:case 15:Wn(e,n),l&4&&br(5,n);break;case 1:if(Wn(e,n),l&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(m){it(n,n.return,m)}else{var r=Xl(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(r,t,e.__reactInternalSnapshotBeforeUpdate)}catch(m){it(n,n.return,m)}}l&64&&ah(n),l&512&&vr(n,n.return);break;case 3:if(Wn(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{Zp(e,t)}catch(m){it(n,n.return,m)}}break;case 27:t===null&&l&4&&oh(n);case 26:case 5:Wn(e,n),t===null&&l&4&&ih(n),l&512&&vr(n,n.return);break;case 12:Wn(e,n);break;case 31:Wn(e,n),l&4&&ph(e,n);break;case 13:Wn(e,n),l&4&&mh(e,n),l&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Cv.bind(null,n),Zv(e,n))));break;case 22:if(l=n.memoizedState!==null||Kn,!l){t=t!==null&&t.memoizedState!==null||Nt,r=Kn;var s=Nt;Kn=l,(Nt=t)&&!s?Pn(e,n,(n.subtreeFlags&8772)!==0):Wn(e,n),Kn=r,Nt=s}break;case 30:break;default:Wn(e,n)}}function dh(e){var t=e.alternate;t!==null&&(e.alternate=null,dh(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&oo(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,Xt=!1;function Jn(e,t,n){for(n=n.child;n!==null;)fh(e,t,n),n=n.sibling}function fh(e,t,n){if(b&&typeof b.onCommitFiberUnmount=="function")try{b.onCommitFiberUnmount(Q,n)}catch{}switch(n.tag){case 26:Nt||zn(n,t),Jn(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:Nt||zn(n,t);var l=ht,r=Xt;Tl(n.type)&&(ht=n.stateNode,Xt=!1),Jn(e,t,n),_r(n.stateNode),ht=l,Xt=r;break;case 5:Nt||zn(n,t);case 6:if(l=ht,r=Xt,ht=null,Jn(e,t,n),ht=l,Xt=r,ht!==null)if(Xt)try{(ht.nodeType===9?ht.body:ht.nodeName==="HTML"?ht.ownerDocument.body:ht).removeChild(n.stateNode)}catch(s){it(n,t,s)}else try{ht.removeChild(n.stateNode)}catch(s){it(n,t,s)}break;case 18:ht!==null&&(Xt?(e=ht,ay(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),Ua(e)):ay(ht,n.stateNode));break;case 4:l=ht,r=Xt,ht=n.stateNode.containerInfo,Xt=!0,Jn(e,t,n),ht=l,Xt=r;break;case 0:case 11:case 14:case 15:bl(2,n,t),Nt||bl(4,n,t),Jn(e,t,n);break;case 1:Nt||(zn(n,t),l=n.stateNode,typeof l.componentWillUnmount=="function"&&rh(n,t,l)),Jn(e,t,n);break;case 21:Jn(e,t,n);break;case 22:Nt=(l=Nt)||n.memoizedState!==null,Jn(e,t,n),Nt=l;break;default:Jn(e,t,n)}}function ph(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Ua(e)}catch(n){it(t,t.return,n)}}}function mh(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Ua(e)}catch(n){it(t,t.return,n)}}function vv(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new ch),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new ch),t;default:throw Error(u(435,e.tag))}}function Mi(e,t){var n=vv(e);t.forEach(function(l){if(!n.has(l)){n.add(l);var r=_v.bind(null,e,l);l.then(r,r)}})}function Zt(e,t){var n=t.deletions;if(n!==null)for(var l=0;l<n.length;l++){var r=n[l],s=e,m=t,v=m;e:for(;v!==null;){switch(v.tag){case 27:if(Tl(v.type)){ht=v.stateNode,Xt=!1;break e}break;case 5:ht=v.stateNode,Xt=!1;break e;case 3:case 4:ht=v.stateNode.containerInfo,Xt=!0;break e}v=v.return}if(ht===null)throw Error(u(160));fh(s,m,r),ht=null,Xt=!1,s=r.alternate,s!==null&&(s.return=null),r.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)hh(t,e),t=t.sibling}var Tn=null;function hh(e,t){var n=e.alternate,l=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Zt(t,e),Qt(e),l&4&&(bl(3,e,e.return),br(3,e),bl(5,e,e.return));break;case 1:Zt(t,e),Qt(e),l&512&&(Nt||n===null||zn(n,n.return)),l&64&&Kn&&(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 r=Tn;if(Zt(t,e),Qt(e),l&512&&(Nt||n===null||zn(n,n.return)),l&4){var s=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,r=r.ownerDocument||r;t:switch(l){case"title":s=r.getElementsByTagName("title")[0],(!s||s[Xa]||s[Rt]||s.namespaceURI==="http://www.w3.org/2000/svg"||s.hasAttribute("itemprop"))&&(s=r.createElement(l),r.head.insertBefore(s,r.querySelector("head > title"))),$t(s,l,n),s[Rt]=e,Ct(s),l=s;break e;case"link":var m=hy("link","href",r).get(l+(n.href||""));if(m){for(var v=0;v<m.length;v++)if(s=m[v],s.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&s.getAttribute("rel")===(n.rel==null?null:n.rel)&&s.getAttribute("title")===(n.title==null?null:n.title)&&s.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){m.splice(v,1);break t}}s=r.createElement(l),$t(s,l,n),r.head.appendChild(s);break;case"meta":if(m=hy("meta","content",r).get(l+(n.content||""))){for(v=0;v<m.length;v++)if(s=m[v],s.getAttribute("content")===(n.content==null?null:""+n.content)&&s.getAttribute("name")===(n.name==null?null:n.name)&&s.getAttribute("property")===(n.property==null?null:n.property)&&s.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&s.getAttribute("charset")===(n.charSet==null?null:n.charSet)){m.splice(v,1);break t}}s=r.createElement(l),$t(s,l,n),r.head.appendChild(s);break;default:throw Error(u(468,l))}s[Rt]=e,Ct(s),l=s}e.stateNode=l}else yy(r,e.type,e.stateNode);else e.stateNode=my(r,l,e.memoizedProps);else s!==l?(s===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):s.count--,l===null?yy(r,e.type,e.stateNode):my(r,l,e.memoizedProps)):l===null&&e.stateNode!==null&&Oc(e,e.memoizedProps,n.memoizedProps)}break;case 27:Zt(t,e),Qt(e),l&512&&(Nt||n===null||zn(n,n.return)),n!==null&&l&4&&Oc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(Zt(t,e),Qt(e),l&512&&(Nt||n===null||zn(n,n.return)),e.flags&32){r=e.stateNode;try{sa(r,"")}catch(we){it(e,e.return,we)}}l&4&&e.stateNode!=null&&(r=e.memoizedProps,Oc(e,r,n!==null?n.memoizedProps:r)),l&1024&&(qc=!0);break;case 6:if(Zt(t,e),Qt(e),l&4){if(e.stateNode===null)throw Error(u(162));l=e.memoizedProps,n=e.stateNode;try{n.nodeValue=l}catch(we){it(e,e.return,we)}}break;case 3:if(Ki=null,r=Tn,Tn=Zi(t.containerInfo),Zt(t,e),Tn=r,Qt(e),l&4&&n!==null&&n.memoizedState.isDehydrated)try{Ua(t.containerInfo)}catch(we){it(e,e.return,we)}qc&&(qc=!1,yh(e));break;case 4:l=Tn,Tn=Zi(e.stateNode.containerInfo),Zt(t,e),Qt(e),Tn=l;break;case 12:Zt(t,e),Qt(e);break;case 31:Zt(t,e),Qt(e),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,Mi(e,l)));break;case 13:Zt(t,e),Qt(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&($i=_e()),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,Mi(e,l)));break;case 22:r=e.memoizedState!==null;var E=n!==null&&n.memoizedState!==null,B=Kn,te=Nt;if(Kn=B||r,Nt=te||E,Zt(t,e),Nt=te,Kn=B,Qt(e),l&8192)e:for(t=e.stateNode,t._visibility=r?t._visibility&-2:t._visibility|1,r&&(n===null||E||Kn||Nt||Zl(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){E=n=t;try{if(s=E.stateNode,r)m=s.style,typeof m.setProperty=="function"?m.setProperty("display","none","important"):m.display="none";else{v=E.stateNode;var oe=E.memoizedProps.style,V=oe!=null&&oe.hasOwnProperty("display")?oe.display:null;v.style.display=V==null||typeof V=="boolean"?"":(""+V).trim()}}catch(we){it(E,E.return,we)}}}else if(t.tag===6){if(n===null){E=t;try{E.stateNode.nodeValue=r?"":E.memoizedProps}catch(we){it(E,E.return,we)}}}else if(t.tag===18){if(n===null){E=t;try{var J=E.stateNode;r?ry(J,!0):ry(E.stateNode,!1)}catch(we){it(E,E.return,we)}}}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,Mi(e,n))));break;case 19:Zt(t,e),Qt(e),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,Mi(e,l)));break;case 30:break;case 21:break;default:Zt(t,e),Qt(e)}}function Qt(e){var t=e.flags;if(t&2){try{for(var n,l=e.return;l!==null;){if(sh(l)){n=l;break}l=l.return}if(n==null)throw Error(u(160));switch(n.tag){case 27:var r=n.stateNode,s=kc(e);qi(e,s,r);break;case 5:var m=n.stateNode;n.flags&32&&(sa(m,""),n.flags&=-33);var v=kc(e);qi(e,v,m);break;case 3:case 4:var E=n.stateNode.containerInfo,B=kc(e);Rc(e,B,E);break;default:throw Error(u(161))}}catch(te){it(e,e.return,te)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function yh(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;yh(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Wn(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)uh(e,t.alternate,t),t=t.sibling}function Zl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:bl(4,t,t.return),Zl(t);break;case 1:zn(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount=="function"&&rh(t,t.return,n),Zl(t);break;case 27:_r(t.stateNode);case 26:case 5:zn(t,t.return),Zl(t);break;case 22:t.memoizedState===null&&Zl(t);break;case 30:Zl(t);break;default:Zl(t)}e=e.sibling}}function Pn(e,t,n){for(n=n&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var l=t.alternate,r=e,s=t,m=s.flags;switch(s.tag){case 0:case 11:case 15:Pn(r,s,n),br(4,s);break;case 1:if(Pn(r,s,n),l=s,r=l.stateNode,typeof r.componentDidMount=="function")try{r.componentDidMount()}catch(B){it(l,l.return,B)}if(l=s,r=l.updateQueue,r!==null){var v=l.stateNode;try{var E=r.shared.hiddenCallbacks;if(E!==null)for(r.shared.hiddenCallbacks=null,r=0;r<E.length;r++)Xp(E[r],v)}catch(B){it(l,l.return,B)}}n&&m&64&&ah(s),vr(s,s.return);break;case 27:oh(s);case 26:case 5:Pn(r,s,n),n&&l===null&&m&4&&ih(s),vr(s,s.return);break;case 12:Pn(r,s,n);break;case 31:Pn(r,s,n),n&&m&4&&ph(r,s);break;case 13:Pn(r,s,n),n&&m&4&&mh(r,s);break;case 22:s.memoizedState===null&&Pn(r,s,n),vr(s,s.return);break;case 30:break;default:Pn(r,s,n)}t=t.sibling}}function Mc(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&&ir(n))}function zc(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ir(e))}function En(e,t,n,l){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)gh(e,t,n,l),t=t.sibling}function gh(e,t,n,l){var r=t.flags;switch(t.tag){case 0:case 11:case 15:En(e,t,n,l),r&2048&&br(9,t);break;case 1:En(e,t,n,l);break;case 3:En(e,t,n,l),r&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ir(e)));break;case 12:if(r&2048){En(e,t,n,l),e=t.stateNode;try{var s=t.memoizedProps,m=s.id,v=s.onPostCommit;typeof v=="function"&&v(m,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(E){it(t,t.return,E)}}else En(e,t,n,l);break;case 31:En(e,t,n,l);break;case 13:En(e,t,n,l);break;case 23:break;case 22:s=t.stateNode,m=t.alternate,t.memoizedState!==null?s._visibility&2?En(e,t,n,l):Sr(e,t):s._visibility&2?En(e,t,n,l):(s._visibility|=2,Ea(e,t,n,l,(t.subtreeFlags&10256)!==0||!1)),r&2048&&Mc(m,t);break;case 24:En(e,t,n,l),r&2048&&zc(t.alternate,t);break;default:En(e,t,n,l)}}function Ea(e,t,n,l,r){for(r=r&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var s=e,m=t,v=n,E=l,B=m.flags;switch(m.tag){case 0:case 11:case 15:Ea(s,m,v,E,r),br(8,m);break;case 23:break;case 22:var te=m.stateNode;m.memoizedState!==null?te._visibility&2?Ea(s,m,v,E,r):Sr(s,m):(te._visibility|=2,Ea(s,m,v,E,r)),r&&B&2048&&Mc(m.alternate,m);break;case 24:Ea(s,m,v,E,r),r&&B&2048&&zc(m.alternate,m);break;default:Ea(s,m,v,E,r)}t=t.sibling}}function Sr(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,l=t,r=l.flags;switch(l.tag){case 22:Sr(n,l),r&2048&&Mc(l.alternate,l);break;case 24:Sr(n,l),r&2048&&zc(l.alternate,l);break;default:Sr(n,l)}t=t.sibling}}var Ar=8192;function Ca(e,t,n){if(e.subtreeFlags&Ar)for(e=e.child;e!==null;)xh(e,t,n),e=e.sibling}function xh(e,t,n){switch(e.tag){case 26:Ca(e,t,n),e.flags&Ar&&e.memoizedState!==null&&i1(n,Tn,e.memoizedState,e.memoizedProps);break;case 5:Ca(e,t,n);break;case 3:case 4:var l=Tn;Tn=Zi(e.stateNode.containerInfo),Ca(e,t,n),Tn=l;break;case 22:e.memoizedState===null&&(l=e.alternate,l!==null&&l.memoizedState!==null?(l=Ar,Ar=16777216,Ca(e,t,n),Ar=l):Ca(e,t,n));break;default:Ca(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 jr(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];_t=l,Sh(l,e)}bh(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)vh(e),e=e.sibling}function vh(e){switch(e.tag){case 0:case 11:case 15:jr(e),e.flags&2048&&bl(9,e,e.return);break;case 3:jr(e);break;case 12:jr(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,zi(e)):jr(e);break;default:jr(e)}}function zi(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];_t=l,Sh(l,e)}bh(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:bl(8,t,t.return),zi(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,zi(t));break;default:zi(t)}e=e.sibling}}function Sh(e,t){for(;_t!==null;){var n=_t;switch(n.tag){case 0:case 11:case 15:bl(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:ir(n.memoizedState.cache)}if(l=n.child,l!==null)l.return=n,_t=l;else e:for(n=e;_t!==null;){l=_t;var r=l.sibling,s=l.return;if(dh(l),l===n){_t=null;break e}if(r!==null){r.return=s,_t=r;break e}_t=s}}}var Sv={getCacheForType:function(e){var t=Mt(St),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Mt(St).controller.signal}},Av=typeof WeakMap=="function"?WeakMap:Map,lt=0,ut=null,Xe=null,Qe=0,rt=0,ln=null,vl=!1,_a=!1,$c=!1,el=0,xt=0,Sl=0,Ql=0,Dc=0,an=0,Oa=0,Nr=null,Kt=null,Uc=!1,$i=0,Ah=0,Di=1/0,Ui=null,Al=null,Tt=0,jl=null,ka=null,tl=0,Hc=0,Lc=null,jh=null,wr=0,Bc=null;function rn(){return(lt&2)!==0&&Qe!==0?Qe&-Qe:T.T!==null?Xc():Hf()}function Nh(){if(an===0)if((Qe&536870912)===0||We){var e=ye;ye<<=1,(ye&3932160)===0&&(ye=262144),an=e}else an=536870912;return e=tn.current,e!==null&&(e.flags|=32),an}function Jt(e,t,n){(e===ut&&(rt===2||rt===9)||e.cancelPendingCommit!==null)&&(Ra(e,0),Nl(e,Qe,an,!1)),Nn(e,n),((lt&2)===0||e!==ut)&&(e===ut&&((lt&2)===0&&(Ql|=n),xt===4&&Nl(e,Qe,an,!1)),$n(e))}function wh(e,t,n){if((lt&6)!==0)throw Error(u(327));var l=!n&&(t&127)===0&&(t&e.expiredLanes)===0||$e(e,t),r=l?wv(e,t):Gc(e,t,!0),s=l;do{if(r===0){_a&&!l&&Nl(e,t,0,!1);break}else{if(n=e.current.alternate,s&&!jv(n)){r=Gc(e,t,!1),s=!1;continue}if(r===2){if(s=t,e.errorRecoveryDisabledLanes&s)var m=0;else m=e.pendingLanes&-536870913,m=m!==0?m:m&536870912?536870912:0;if(m!==0){t=m;e:{var v=e;r=Nr;var E=v.current.memoizedState.isDehydrated;if(E&&(Ra(v,m).flags|=256),m=Gc(v,m,!1),m!==2){if($c&&!E){v.errorRecoveryDisabledLanes|=s,Ql|=s,r=4;break e}s=Kt,Kt=r,s!==null&&(Kt===null?Kt=s:Kt.push.apply(Kt,s))}r=m}if(s=!1,r!==2)continue}}if(r===1){Ra(e,0),Nl(e,t,0,!0);break}e:{switch(l=e,s=r,s){case 0:case 1:throw Error(u(345));case 4:if((t&4194048)!==t)break;case 6:Nl(l,t,an,!vl);break e;case 2:Kt=null;break;case 3:case 5:break;default:throw Error(u(329))}if((t&62914560)===t&&(r=$i+300-_e(),10<r)){if(Nl(l,t,an,!vl),qe(l,0,!0)!==0)break e;tl=t,l.timeoutHandle=ny(Th.bind(null,l,n,Kt,Ui,Uc,t,an,Ql,Oa,vl,s,"Throttled",-0,0),r);break e}Th(l,n,Kt,Ui,Uc,t,an,Ql,Oa,vl,s,null,-0,0)}}break}while(!0);$n(e)}function Th(e,t,n,l,r,s,m,v,E,B,te,oe,V,J){if(e.timeoutHandle=-1,oe=t.subtreeFlags,oe&8192||(oe&16785408)===16785408){oe={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Ln},xh(t,s,oe);var we=(s&62914560)===s?$i-_e():(s&4194048)===s?Ah-_e():0;if(we=s1(oe,we),we!==null){tl=s,e.cancelPendingCommit=we(Mh.bind(null,e,t,s,n,l,r,m,v,E,te,oe,null,V,J)),Nl(e,s,m,!B);return}}Mh(e,t,s,n,l,r,m,v,E)}function jv(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 r=n[l],s=r.getSnapshot;r=r.value;try{if(!Pt(s(),r))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Nl(e,t,n,l){t&=~Dc,t&=~Ql,e.suspendedLanes|=t,e.pingedLanes&=~t,l&&(e.warmLanes|=t),l=e.expirationTimes;for(var r=t;0<r;){var s=31-F(r),m=1<<s;l[s]=-1,r&=~m}n!==0&&$f(e,n,t)}function Hi(){return(lt&6)===0?(Tr(0),!1):!0}function Yc(){if(Xe!==null){if(rt===0)var e=Xe.return;else e=Xe,In=Ll=null,ac(e),Aa=null,or=0,e=Xe;for(;e!==null;)lh(e.alternate,e),e=e.return;Xe=null}}function Ra(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,Gv(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),tl=0,Yc(),ut=e,Xe=n=Yn(e.current,null),Qe=t,rt=0,ln=null,vl=!1,_a=$e(e,t),$c=!1,Oa=an=Dc=Ql=Sl=xt=0,Kt=Nr=null,Uc=!1,(t&8)!==0&&(t|=t&32);var l=e.entangledLanes;if(l!==0)for(e=e.entanglements,l&=t;0<l;){var r=31-F(l),s=1<<r;t|=e[r],l&=~s}return el=t,ii(),n}function Eh(e,t){Le=null,T.H=yr,t===Sa||t===mi?(t=Gp(),rt=3):t===Vo?(t=Gp(),rt=4):rt=t===vc?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,ln=t,Xe===null&&(xt=1,Ci(e,hn(t,e.current)))}function Ch(){var e=tn.current;return e===null?!0:(Qe&4194048)===Qe?bn===null:(Qe&62914560)===Qe||(Qe&536870912)!==0?e===bn:!1}function _h(){var e=T.H;return T.H=yr,e===null?yr:e}function Oh(){var e=T.A;return T.A=Sv,e}function Li(){xt=4,vl||(Qe&4194048)!==Qe&&tn.current!==null||(_a=!0),(Sl&134217727)===0&&(Ql&134217727)===0||ut===null||Nl(ut,Qe,an,!1)}function Gc(e,t,n){var l=lt;lt|=2;var r=_h(),s=Oh();(ut!==e||Qe!==t)&&(Ui=null,Ra(e,t)),t=!1;var m=xt;e:do try{if(rt!==0&&Xe!==null){var v=Xe,E=ln;switch(rt){case 8:Yc(),m=6;break e;case 3:case 2:case 9:case 6:tn.current===null&&(t=!0);var B=rt;if(rt=0,ln=null,qa(e,v,E,B),n&&_a){m=0;break e}break;default:B=rt,rt=0,ln=null,qa(e,v,E,B)}}Nv(),m=xt;break}catch(te){Eh(e,te)}while(!0);return t&&e.shellSuspendCounter++,In=Ll=null,lt=l,T.H=r,T.A=s,Xe===null&&(ut=null,Qe=0,ii()),m}function Nv(){for(;Xe!==null;)kh(Xe)}function wv(e,t){var n=lt;lt|=2;var l=_h(),r=Oh();ut!==e||Qe!==t?(Ui=null,Di=_e()+500,Ra(e,t)):_a=$e(e,t);e:do try{if(rt!==0&&Xe!==null){t=Xe;var s=ln;t:switch(rt){case 1:rt=0,ln=null,qa(e,t,s,1);break;case 2:case 9:if(Bp(s)){rt=0,ln=null,Rh(t);break}t=function(){rt!==2&&rt!==9||ut!==e||(rt=7),$n(e)},s.then(t,t);break e;case 3:rt=7;break e;case 4:rt=5;break e;case 7:Bp(s)?(rt=0,ln=null,Rh(t)):(rt=0,ln=null,qa(e,t,s,7));break;case 5:var m=null;switch(Xe.tag){case 26:m=Xe.memoizedState;case 5:case 27:var v=Xe;if(m?gy(m):v.stateNode.complete){rt=0,ln=null;var E=v.sibling;if(E!==null)Xe=E;else{var B=v.return;B!==null?(Xe=B,Bi(B)):Xe=null}break t}}rt=0,ln=null,qa(e,t,s,5);break;case 6:rt=0,ln=null,qa(e,t,s,6);break;case 8:Yc(),xt=6;break e;default:throw Error(u(462))}}Tv();break}catch(te){Eh(e,te)}while(!0);return In=Ll=null,T.H=l,T.A=r,lt=n,Xe!==null?0:(ut=null,Qe=0,ii(),xt)}function Tv(){for(;Xe!==null&&!kn();)kh(Xe)}function kh(e){var t=th(e.alternate,e,el);e.memoizedProps=e.pendingProps,t===null?Bi(e):Xe=t}function Rh(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Qm(n,t,t.pendingProps,t.type,void 0,Qe);break;case 11:t=Qm(n,t,t.pendingProps,t.type.render,t.ref,Qe);break;case 5:ac(t);default:lh(n,t),t=Xe=Op(t,el),t=th(n,t,el)}e.memoizedProps=e.pendingProps,t===null?Bi(e):Xe=t}function qa(e,t,n,l){In=Ll=null,ac(t),Aa=null,or=0;var r=t.return;try{if(mv(e,r,t,n,Qe)){xt=1,Ci(e,hn(n,e.current)),Xe=null;return}}catch(s){if(r!==null)throw Xe=r,s;xt=1,Ci(e,hn(n,e.current)),Xe=null;return}t.flags&32768?(We||l===1?e=!0:_a||(Qe&536870912)!==0?e=!1:(vl=e=!0,(l===2||l===9||l===3||l===6)&&(l=tn.current,l!==null&&l.tag===13&&(l.flags|=16384))),qh(t,e)):Bi(t)}function Bi(e){var t=e;do{if((t.flags&32768)!==0){qh(t,vl);return}e=t.return;var n=gv(t.alternate,t,el);if(n!==null){Xe=n;return}if(t=t.sibling,t!==null){Xe=t;return}Xe=t=e}while(t!==null);xt===0&&(xt=5)}function qh(e,t){do{var n=xv(e.alternate,e);if(n!==null){n.flags&=32767,Xe=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Xe=e;return}Xe=e=n}while(e!==null);xt=6,Xe=null}function Mh(e,t,n,l,r,s,m,v,E){e.cancelPendingCommit=null;do Yi();while(Tt!==0);if((lt&6)!==0)throw Error(u(327));if(t!==null){if(t===e.current)throw Error(u(177));if(s=t.lanes|t.childLanes,s|=ko,rb(e,n,s,m,v,E),e===ut&&(Xe=ut=null,Qe=0),ka=t,jl=e,tl=n,Hc=s,Lc=r,jh=l,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,Ov(dn,function(){return Hh(),null})):(e.callbackNode=null,e.callbackPriority=0),l=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||l){l=T.T,T.T=null,r=ne.p,ne.p=2,m=lt,lt|=4;try{bv(e,t,n)}finally{lt=m,ne.p=r,T.T=l}}Tt=1,zh(),$h(),Dh()}}function zh(){if(Tt===1){Tt=0;var e=jl,t=ka,n=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||n){n=T.T,T.T=null;var l=ne.p;ne.p=2;var r=lt;lt|=4;try{hh(t,e);var s=tu,m=Sp(e.containerInfo),v=s.focusedElem,E=s.selectionRange;if(m!==v&&v&&v.ownerDocument&&vp(v.ownerDocument.documentElement,v)){if(E!==null&&To(v)){var B=E.start,te=E.end;if(te===void 0&&(te=B),"selectionStart"in v)v.selectionStart=B,v.selectionEnd=Math.min(te,v.value.length);else{var oe=v.ownerDocument||document,V=oe&&oe.defaultView||window;if(V.getSelection){var J=V.getSelection(),we=v.textContent.length,ze=Math.min(E.start,we),ct=E.end===void 0?ze:Math.min(E.end,we);!J.extend&&ze>ct&&(m=ct,ct=ze,ze=m);var z=bp(v,ze),O=bp(v,ct);if(z&&O&&(J.rangeCount!==1||J.anchorNode!==z.node||J.anchorOffset!==z.offset||J.focusNode!==O.node||J.focusOffset!==O.offset)){var L=oe.createRange();L.setStart(z.node,z.offset),J.removeAllRanges(),ze>ct?(J.addRange(L),J.extend(O.node,O.offset)):(L.setEnd(O.node,O.offset),J.addRange(L))}}}}for(oe=[],J=v;J=J.parentNode;)J.nodeType===1&&oe.push({element:J,left:J.scrollLeft,top:J.scrollTop});for(typeof v.focus=="function"&&v.focus(),v=0;v<oe.length;v++){var re=oe[v];re.element.scrollLeft=re.left,re.element.scrollTop=re.top}}es=!!eu,tu=eu=null}finally{lt=r,ne.p=l,T.T=n}}e.current=t,Tt=2}}function $h(){if(Tt===2){Tt=0;var e=jl,t=ka,n=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||n){n=T.T,T.T=null;var l=ne.p;ne.p=2;var r=lt;lt|=4;try{uh(e,t.alternate,t)}finally{lt=r,ne.p=l,T.T=n}}Tt=3}}function Dh(){if(Tt===4||Tt===3){Tt=0,Rn();var e=jl,t=ka,n=tl,l=jh;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Tt=5:(Tt=0,ka=jl=null,Uh(e,e.pendingLanes));var r=e.pendingLanes;if(r===0&&(Al=null),io(n),t=t.stateNode,b&&typeof b.onCommitFiberRoot=="function")try{b.onCommitFiberRoot(Q,t,void 0,(t.current.flags&128)===128)}catch{}if(l!==null){t=T.T,r=ne.p,ne.p=2,T.T=null;try{for(var s=e.onRecoverableError,m=0;m<l.length;m++){var v=l[m];s(v.value,{componentStack:v.stack})}}finally{T.T=t,ne.p=r}}(tl&3)!==0&&Yi(),$n(e),r=e.pendingLanes,(n&261930)!==0&&(r&42)!==0?e===Bc?wr++:(wr=0,Bc=e):wr=0,Tr(0)}}function Uh(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,ir(t)))}function Yi(){return zh(),$h(),Dh(),Hh()}function Hh(){if(Tt!==5)return!1;var e=jl,t=Hc;Hc=0;var n=io(tl),l=T.T,r=ne.p;try{ne.p=32>n?32:n,T.T=null,n=Lc,Lc=null;var s=jl,m=tl;if(Tt=0,ka=jl=null,tl=0,(lt&6)!==0)throw Error(u(331));var v=lt;if(lt|=4,vh(s.current),gh(s,s.current,m,n),lt=v,Tr(0,!1),b&&typeof b.onPostCommitFiberRoot=="function")try{b.onPostCommitFiberRoot(Q,s)}catch{}return!0}finally{ne.p=r,T.T=l,Uh(e,t)}}function Lh(e,t,n){t=hn(n,t),t=bc(e.stateNode,t,2),e=yl(e,t,2),e!==null&&(Nn(e,2),$n(e))}function it(e,t,n){if(e.tag===3)Lh(e,e,n);else for(;t!==null;){if(t.tag===3){Lh(t,e,n);break}else if(t.tag===1){var l=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(Al===null||!Al.has(l))){e=hn(n,e),n=Bm(2),l=yl(t,n,2),l!==null&&(Ym(n,l,t,e),Nn(l,2),$n(l));break}}t=t.return}}function Ic(e,t,n){var l=e.pingCache;if(l===null){l=e.pingCache=new Av;var r=new Set;l.set(t,r)}else r=l.get(t),r===void 0&&(r=new Set,l.set(t,r));r.has(n)||($c=!0,r.add(n),e=Ev.bind(null,e,t,n),t.then(e,e))}function Ev(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&&(xt===4||xt===3&&(Qe&62914560)===Qe&&300>_e()-$i?(lt&2)===0&&Ra(e,0):Dc|=n,Oa===Qe&&(Oa=0)),$n(e)}function Bh(e,t){t===0&&(t=jn()),e=Dl(e,t),e!==null&&(Nn(e,t),$n(e))}function Cv(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Bh(e,n)}function _v(e,t){var n=0;switch(e.tag){case 31:case 13:var l=e.stateNode,r=e.memoizedState;r!==null&&(n=r.retryLane);break;case 19:l=e.stateNode;break;case 22:l=e.stateNode._retryCache;break;default:throw Error(u(314))}l!==null&&l.delete(t),Bh(e,n)}function Ov(e,t){return Yt(e,t)}var Gi=null,Ma=null,Fc=!1,Ii=!1,Vc=!1,wl=0;function $n(e){e!==Ma&&e.next===null&&(Ma===null?Gi=Ma=e:Ma=Ma.next=e),Ii=!0,Fc||(Fc=!0,Rv())}function Tr(e,t){if(!Vc&&Ii){Vc=!0;do for(var n=!1,l=Gi;l!==null;){if(e!==0){var r=l.pendingLanes;if(r===0)var s=0;else{var m=l.suspendedLanes,v=l.pingedLanes;s=(1<<31-F(42|e)+1)-1,s&=r&~(m&~v),s=s&201326741?s&201326741|1:s?s|2:0}s!==0&&(n=!0,Fh(l,s))}else s=Qe,s=qe(l,l===ut?s:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(s&3)===0||$e(l,s)||(n=!0,Fh(l,s));l=l.next}while(n);Vc=!1}}function kv(){Yh()}function Yh(){Ii=Fc=!1;var e=0;wl!==0&&Yv()&&(e=wl);for(var t=_e(),n=null,l=Gi;l!==null;){var r=l.next,s=Gh(l,t);s===0?(l.next=null,n===null?Gi=r:n.next=r,r===null&&(Ma=n)):(n=l,(e!==0||(s&3)!==0)&&(Ii=!0)),l=r}Tt!==0&&Tt!==5||Tr(e),wl!==0&&(wl=0)}function Gh(e,t){for(var n=e.suspendedLanes,l=e.pingedLanes,r=e.expirationTimes,s=e.pendingLanes&-62914561;0<s;){var m=31-F(s),v=1<<m,E=r[m];E===-1?((v&n)===0||(v&l)!==0)&&(r[m]=Ye(v,t)):E<=t&&(e.expiredLanes|=v),s&=~v}if(t=ut,n=Qe,n=qe(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l=e.callbackNode,n===0||e===t&&(rt===2||rt===9)||e.cancelPendingCommit!==null)return l!==null&&l!==null&&It(l),e.callbackNode=null,e.callbackPriority=0;if((n&3)===0||$e(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(l!==null&&It(l),io(n)){case 2:case 8:n=De;break;case 32:n=dn;break;case 268435456:n=q;break;default:n=dn}return l=Ih.bind(null,e),n=Yt(n,l),e.callbackPriority=t,e.callbackNode=n,t}return l!==null&&l!==null&&It(l),e.callbackPriority=2,e.callbackNode=null,2}function Ih(e,t){if(Tt!==0&&Tt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Yi()&&e.callbackNode!==n)return null;var l=Qe;return l=qe(e,e===ut?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l===0?null:(wh(e,l,t),Gh(e,_e()),e.callbackNode!=null&&e.callbackNode===n?Ih.bind(null,e):null)}function Fh(e,t){if(Yi())return null;wh(e,t,!0)}function Rv(){Iv(function(){(lt&6)!==0?Yt(Ae,kv):Yh()})}function Xc(){if(wl===0){var e=ba;e===0&&(e=ee,ee<<=1,(ee&261888)===0&&(ee=256)),wl=e}return wl}function Vh(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Wr(""+e)}function Xh(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 qv(e,t,n,l,r){if(t==="submit"&&n&&n.stateNode===r){var s=Vh((r[Ft]||null).action),m=l.submitter;m&&(t=(t=m[Ft]||null)?Vh(t.formAction):m.getAttribute("formAction"),t!==null&&(s=t,m=null));var v=new ni("action","action",null,l,r);e.push({event:v,listeners:[{instance:null,listener:function(){if(l.defaultPrevented){if(wl!==0){var E=m?Xh(r,m):new FormData(r);pc(n,{pending:!0,data:E,method:r.method,action:s},null,E)}}else typeof s=="function"&&(v.preventDefault(),E=m?Xh(r,m):new FormData(r),pc(n,{pending:!0,data:E,method:r.method,action:s},s,E))},currentTarget:r}]})}}for(var Zc=0;Zc<Oo.length;Zc++){var Qc=Oo[Zc],Mv=Qc.toLowerCase(),zv=Qc[0].toUpperCase()+Qc.slice(1);wn(Mv,"on"+zv)}wn(Np,"onAnimationEnd"),wn(wp,"onAnimationIteration"),wn(Tp,"onAnimationStart"),wn("dblclick","onDoubleClick"),wn("focusin","onFocus"),wn("focusout","onBlur"),wn(Jb,"onTransitionRun"),wn(Wb,"onTransitionStart"),wn(Pb,"onTransitionCancel"),wn(Ep,"onTransitionEnd"),ra("onMouseEnter",["mouseout","mouseover"]),ra("onMouseLeave",["mouseout","mouseover"]),ra("onPointerEnter",["pointerout","pointerover"]),ra("onPointerLeave",["pointerout","pointerover"]),ql("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),ql("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),ql("onBeforeInput",["compositionend","keypress","textInput","paste"]),ql("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),ql("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),ql("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Er="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(" "),$v=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Er));function Zh(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var l=e[n],r=l.event;l=l.listeners;e:{var s=void 0;if(t)for(var m=l.length-1;0<=m;m--){var v=l[m],E=v.instance,B=v.currentTarget;if(v=v.listener,E!==s&&r.isPropagationStopped())break e;s=v,r.currentTarget=B;try{s(r)}catch(te){ri(te)}r.currentTarget=null,s=E}else for(m=0;m<l.length;m++){if(v=l[m],E=v.instance,B=v.currentTarget,v=v.listener,E!==s&&r.isPropagationStopped())break e;s=v,r.currentTarget=B;try{s(r)}catch(te){ri(te)}r.currentTarget=null,s=E}}}}function Ze(e,t){var n=t[so];n===void 0&&(n=t[so]=new Set);var l=e+"__bubble";n.has(l)||(Qh(t,e,2,!1),n.add(l))}function Kc(e,t,n){var l=0;t&&(l|=4),Qh(n,e,l,t)}var Fi="_reactListening"+Math.random().toString(36).slice(2);function Jc(e){if(!e[Fi]){e[Fi]=!0,Yf.forEach(function(n){n!=="selectionchange"&&($v.has(n)||Kc(n,!1,e),Kc(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Fi]||(t[Fi]=!0,Kc("selectionchange",!1,t))}}function Qh(e,t,n,l){switch(Ny(t)){case 2:var r=u1;break;case 8:r=d1;break;default:r=fu}n=r.bind(null,t,n,e),r=void 0,!go||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(r=!0),l?r!==void 0?e.addEventListener(t,n,{capture:!0,passive:r}):e.addEventListener(t,n,!0):r!==void 0?e.addEventListener(t,n,{passive:r}):e.addEventListener(t,n,!1)}function Wc(e,t,n,l,r){var s=l;if((t&1)===0&&(t&2)===0&&l!==null)e:for(;;){if(l===null)return;var m=l.tag;if(m===3||m===4){var v=l.stateNode.containerInfo;if(v===r)break;if(m===4)for(m=l.return;m!==null;){var E=m.tag;if((E===3||E===4)&&m.stateNode.containerInfo===r)return;m=m.return}for(;v!==null;){if(m=na(v),m===null)return;if(E=m.tag,E===5||E===6||E===26||E===27){l=s=m;continue e}v=v.parentNode}}l=l.return}ep(function(){var B=s,te=ho(n),oe=[];e:{var V=Cp.get(e);if(V!==void 0){var J=ni,we=e;switch(e){case"keypress":if(ei(n)===0)break e;case"keydown":case"keyup":J=_b;break;case"focusin":we="focus",J=So;break;case"focusout":we="blur",J=So;break;case"beforeblur":case"afterblur":J=So;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":J=lp;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":J=gb;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":J=Rb;break;case Np:case wp:case Tp:J=vb;break;case Ep:J=Mb;break;case"scroll":case"scrollend":J=hb;break;case"wheel":J=$b;break;case"copy":case"cut":case"paste":J=Ab;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":J=rp;break;case"toggle":case"beforetoggle":J=Ub}var ze=(t&4)!==0,ct=!ze&&(e==="scroll"||e==="scrollend"),z=ze?V!==null?V+"Capture":null:V;ze=[];for(var O=B,L;O!==null;){var re=O;if(L=re.stateNode,re=re.tag,re!==5&&re!==26&&re!==27||L===null||z===null||(re=Qa(O,z),re!=null&&ze.push(Cr(O,re,L))),ct)break;O=O.return}0<ze.length&&(V=new J(V,we,null,n,te),oe.push({event:V,listeners:ze}))}}if((t&7)===0){e:{if(V=e==="mouseover"||e==="pointerover",J=e==="mouseout"||e==="pointerout",V&&n!==mo&&(we=n.relatedTarget||n.fromElement)&&(na(we)||we[ta]))break e;if((J||V)&&(V=te.window===te?te:(V=te.ownerDocument)?V.defaultView||V.parentWindow:window,J?(we=n.relatedTarget||n.toElement,J=B,we=we?na(we):null,we!==null&&(ct=p(we),ze=we.tag,we!==ct||ze!==5&&ze!==27&&ze!==6)&&(we=null)):(J=null,we=B),J!==we)){if(ze=lp,re="onMouseLeave",z="onMouseEnter",O="mouse",(e==="pointerout"||e==="pointerover")&&(ze=rp,re="onPointerLeave",z="onPointerEnter",O="pointer"),ct=J==null?V:Za(J),L=we==null?V:Za(we),V=new ze(re,O+"leave",J,n,te),V.target=ct,V.relatedTarget=L,re=null,na(te)===B&&(ze=new ze(z,O+"enter",we,n,te),ze.target=L,ze.relatedTarget=ct,re=ze),ct=re,J&&we)t:{for(ze=Dv,z=J,O=we,L=0,re=z;re;re=ze(re))L++;re=0;for(var Me=O;Me;Me=ze(Me))re++;for(;0<L-re;)z=ze(z),L--;for(;0<re-L;)O=ze(O),re--;for(;L--;){if(z===O||O!==null&&z===O.alternate){ze=z;break t}z=ze(z),O=ze(O)}ze=null}else ze=null;J!==null&&Kh(oe,V,J,ze,!1),we!==null&&ct!==null&&Kh(oe,ct,we,ze,!0)}}e:{if(V=B?Za(B):window,J=V.nodeName&&V.nodeName.toLowerCase(),J==="select"||J==="input"&&V.type==="file")var tt=pp;else if(dp(V))if(mp)tt=Zb;else{tt=Vb;var Ce=Fb}else J=V.nodeName,!J||J.toLowerCase()!=="input"||V.type!=="checkbox"&&V.type!=="radio"?B&&po(B.elementType)&&(tt=pp):tt=Xb;if(tt&&(tt=tt(e,B))){fp(oe,tt,n,te);break e}Ce&&Ce(e,V,B),e==="focusout"&&B&&V.type==="number"&&B.memoizedProps.value!=null&&fo(V,"number",V.value)}switch(Ce=B?Za(B):window,e){case"focusin":(dp(Ce)||Ce.contentEditable==="true")&&(da=Ce,Eo=B,lr=null);break;case"focusout":lr=Eo=da=null;break;case"mousedown":Co=!0;break;case"contextmenu":case"mouseup":case"dragend":Co=!1,Ap(oe,n,te);break;case"selectionchange":if(Kb)break;case"keydown":case"keyup":Ap(oe,n,te)}var Ge;if(jo)e:{switch(e){case"compositionstart":var Ke="onCompositionStart";break e;case"compositionend":Ke="onCompositionEnd";break e;case"compositionupdate":Ke="onCompositionUpdate";break e}Ke=void 0}else ua?cp(e,n)&&(Ke="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(Ke="onCompositionStart");Ke&&(ip&&n.locale!=="ko"&&(ua||Ke!=="onCompositionStart"?Ke==="onCompositionEnd"&&ua&&(Ge=tp()):(cl=te,xo="value"in cl?cl.value:cl.textContent,ua=!0)),Ce=Vi(B,Ke),0<Ce.length&&(Ke=new ap(Ke,e,null,n,te),oe.push({event:Ke,listeners:Ce}),Ge?Ke.data=Ge:(Ge=up(n),Ge!==null&&(Ke.data=Ge)))),(Ge=Lb?Bb(e,n):Yb(e,n))&&(Ke=Vi(B,"onBeforeInput"),0<Ke.length&&(Ce=new ap("onBeforeInput","beforeinput",null,n,te),oe.push({event:Ce,listeners:Ke}),Ce.data=Ge)),qv(oe,e,B,n,te)}Zh(oe,t)})}function Cr(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Vi(e,t){for(var n=t+"Capture",l=[];e!==null;){var r=e,s=r.stateNode;if(r=r.tag,r!==5&&r!==26&&r!==27||s===null||(r=Qa(e,n),r!=null&&l.unshift(Cr(e,r,s)),r=Qa(e,t),r!=null&&l.push(Cr(e,r,s))),e.tag===3)return l;e=e.return}return[]}function Dv(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Kh(e,t,n,l,r){for(var s=t._reactName,m=[];n!==null&&n!==l;){var v=n,E=v.alternate,B=v.stateNode;if(v=v.tag,E!==null&&E===l)break;v!==5&&v!==26&&v!==27||B===null||(E=B,r?(B=Qa(n,s),B!=null&&m.unshift(Cr(n,B,E))):r||(B=Qa(n,s),B!=null&&m.push(Cr(n,B,E)))),n=n.return}m.length!==0&&e.push({event:t,listeners:m})}var Uv=/\r\n?/g,Hv=/\u0000|\uFFFD/g;function Jh(e){return(typeof e=="string"?e:""+e).replace(Uv,`
|
|
9
|
-
`).replace(Hv,"")}function Wh(e,t){return t=Jh(t),Jh(e)===t}function ot(e,t,n,l,r,s){switch(n){case"children":typeof l=="string"?t==="body"||t==="textarea"&&l===""||sa(e,l):(typeof l=="number"||typeof l=="bigint")&&t!=="body"&&sa(e,""+l);break;case"className":Kr(e,"class",l);break;case"tabIndex":Kr(e,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":Kr(e,n,l);break;case"style":Wf(e,l,s);break;case"data":if(t!=="object"){Kr(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=Wr(""+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 s=="function"&&(n==="formAction"?(t!=="input"&&ot(e,t,"name",r.name,r,null),ot(e,t,"formEncType",r.formEncType,r,null),ot(e,t,"formMethod",r.formMethod,r,null),ot(e,t,"formTarget",r.formTarget,r,null)):(ot(e,t,"encType",r.encType,r,null),ot(e,t,"method",r.method,r,null),ot(e,t,"target",r.target,r,null)));if(l==null||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(n);break}l=Wr(""+l),e.setAttribute(n,l);break;case"onClick":l!=null&&(e.onclick=Ln);break;case"onScroll":l!=null&&Ze("scroll",e);break;case"onScrollEnd":l!=null&&Ze("scrollend",e);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(u(61));if(n=l.__html,n!=null){if(r.children!=null)throw Error(u(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=Wr(""+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":Ze("beforetoggle",e),Ze("toggle",e),Qr(e,"popover",l);break;case"xlinkActuate":Hn(e,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":Hn(e,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":Hn(e,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":Hn(e,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":Hn(e,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":Hn(e,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":Hn(e,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":Hn(e,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":Hn(e,"http://www.w3.org/XML/1998/namespace","xml:space",l);break;case"is":Qr(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=pb.get(n)||n,Qr(e,n,l))}}function Pc(e,t,n,l,r,s){switch(n){case"style":Wf(e,l,s);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(u(61));if(n=l.__html,n!=null){if(r.children!=null)throw Error(u(60));e.innerHTML=n}}break;case"children":typeof l=="string"?sa(e,l):(typeof l=="number"||typeof l=="bigint")&&sa(e,""+l);break;case"onScroll":l!=null&&Ze("scroll",e);break;case"onScrollEnd":l!=null&&Ze("scrollend",e);break;case"onClick":l!=null&&(e.onclick=Ln);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Gf.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(r=n.endsWith("Capture"),t=n.slice(2,r?n.length-7:void 0),s=e[Ft]||null,s=s!=null?s[n]:null,typeof s=="function"&&e.removeEventListener(t,s,r),typeof l=="function")){typeof s!="function"&&s!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,l,r);break e}n in e?e[n]=l:l===!0?e.setAttribute(n,""):Qr(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":Ze("error",e),Ze("load",e);var l=!1,r=!1,s;for(s in n)if(n.hasOwnProperty(s)){var m=n[s];if(m!=null)switch(s){case"src":l=!0;break;case"srcSet":r=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(u(137,t));default:ot(e,t,s,m,n,null)}}r&&ot(e,t,"srcSet",n.srcSet,n,null),l&&ot(e,t,"src",n.src,n,null);return;case"input":Ze("invalid",e);var v=s=m=r=null,E=null,B=null;for(l in n)if(n.hasOwnProperty(l)){var te=n[l];if(te!=null)switch(l){case"name":r=te;break;case"type":m=te;break;case"checked":E=te;break;case"defaultChecked":B=te;break;case"value":s=te;break;case"defaultValue":v=te;break;case"children":case"dangerouslySetInnerHTML":if(te!=null)throw Error(u(137,t));break;default:ot(e,t,l,te,n,null)}}Zf(e,s,v,E,B,m,r,!1);return;case"select":Ze("invalid",e),l=m=s=null;for(r in n)if(n.hasOwnProperty(r)&&(v=n[r],v!=null))switch(r){case"value":s=v;break;case"defaultValue":m=v;break;case"multiple":l=v;default:ot(e,t,r,v,n,null)}t=s,n=m,e.multiple=!!l,t!=null?ia(e,!!l,t,!1):n!=null&&ia(e,!!l,n,!0);return;case"textarea":Ze("invalid",e),s=r=l=null;for(m in n)if(n.hasOwnProperty(m)&&(v=n[m],v!=null))switch(m){case"value":l=v;break;case"defaultValue":r=v;break;case"children":s=v;break;case"dangerouslySetInnerHTML":if(v!=null)throw Error(u(91));break;default:ot(e,t,m,v,n,null)}Kf(e,l,r,s);return;case"option":for(E in n)n.hasOwnProperty(E)&&(l=n[E],l!=null)&&(E==="selected"?e.selected=l&&typeof l!="function"&&typeof l!="symbol":ot(e,t,E,l,n,null));return;case"dialog":Ze("beforetoggle",e),Ze("toggle",e),Ze("cancel",e),Ze("close",e);break;case"iframe":case"object":Ze("load",e);break;case"video":case"audio":for(l=0;l<Er.length;l++)Ze(Er[l],e);break;case"image":Ze("error",e),Ze("load",e);break;case"details":Ze("toggle",e);break;case"embed":case"source":case"link":Ze("error",e),Ze("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(u(137,t));default:ot(e,t,B,l,n,null)}return;default:if(po(t)){for(te in n)n.hasOwnProperty(te)&&(l=n[te],l!==void 0&&Pc(e,t,te,l,n,void 0));return}}for(v in n)n.hasOwnProperty(v)&&(l=n[v],l!=null&&ot(e,t,v,l,n,null))}function Lv(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 r=null,s=null,m=null,v=null,E=null,B=null,te=null;for(J in n){var oe=n[J];if(n.hasOwnProperty(J)&&oe!=null)switch(J){case"checked":break;case"value":break;case"defaultValue":E=oe;default:l.hasOwnProperty(J)||ot(e,t,J,null,l,oe)}}for(var V in l){var J=l[V];if(oe=n[V],l.hasOwnProperty(V)&&(J!=null||oe!=null))switch(V){case"type":s=J;break;case"name":r=J;break;case"checked":B=J;break;case"defaultChecked":te=J;break;case"value":m=J;break;case"defaultValue":v=J;break;case"children":case"dangerouslySetInnerHTML":if(J!=null)throw Error(u(137,t));break;default:J!==oe&&ot(e,t,V,J,l,oe)}}uo(e,m,v,E,B,te,s,r);return;case"select":J=m=v=V=null;for(s in n)if(E=n[s],n.hasOwnProperty(s)&&E!=null)switch(s){case"value":break;case"multiple":J=E;default:l.hasOwnProperty(s)||ot(e,t,s,null,l,E)}for(r in l)if(s=l[r],E=n[r],l.hasOwnProperty(r)&&(s!=null||E!=null))switch(r){case"value":V=s;break;case"defaultValue":v=s;break;case"multiple":m=s;default:s!==E&&ot(e,t,r,s,l,E)}t=v,n=m,l=J,V!=null?ia(e,!!n,V,!1):!!l!=!!n&&(t!=null?ia(e,!!n,t,!0):ia(e,!!n,n?[]:"",!1));return;case"textarea":J=V=null;for(v in n)if(r=n[v],n.hasOwnProperty(v)&&r!=null&&!l.hasOwnProperty(v))switch(v){case"value":break;case"children":break;default:ot(e,t,v,null,l,r)}for(m in l)if(r=l[m],s=n[m],l.hasOwnProperty(m)&&(r!=null||s!=null))switch(m){case"value":V=r;break;case"defaultValue":J=r;break;case"children":break;case"dangerouslySetInnerHTML":if(r!=null)throw Error(u(91));break;default:r!==s&&ot(e,t,m,r,l,s)}Qf(e,V,J);return;case"option":for(var we in n)V=n[we],n.hasOwnProperty(we)&&V!=null&&!l.hasOwnProperty(we)&&(we==="selected"?e.selected=!1:ot(e,t,we,null,l,V));for(E in l)V=l[E],J=n[E],l.hasOwnProperty(E)&&V!==J&&(V!=null||J!=null)&&(E==="selected"?e.selected=V&&typeof V!="function"&&typeof V!="symbol":ot(e,t,E,V,l,J));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 ze in n)V=n[ze],n.hasOwnProperty(ze)&&V!=null&&!l.hasOwnProperty(ze)&&ot(e,t,ze,null,l,V);for(B in l)if(V=l[B],J=n[B],l.hasOwnProperty(B)&&V!==J&&(V!=null||J!=null))switch(B){case"children":case"dangerouslySetInnerHTML":if(V!=null)throw Error(u(137,t));break;default:ot(e,t,B,V,l,J)}return;default:if(po(t)){for(var ct in n)V=n[ct],n.hasOwnProperty(ct)&&V!==void 0&&!l.hasOwnProperty(ct)&&Pc(e,t,ct,void 0,l,V);for(te in l)V=l[te],J=n[te],!l.hasOwnProperty(te)||V===J||V===void 0&&J===void 0||Pc(e,t,te,V,l,J);return}}for(var z in n)V=n[z],n.hasOwnProperty(z)&&V!=null&&!l.hasOwnProperty(z)&&ot(e,t,z,null,l,V);for(oe in l)V=l[oe],J=n[oe],!l.hasOwnProperty(oe)||V===J||V==null&&J==null||ot(e,t,oe,V,l,J)}function Ph(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Bv(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,n=performance.getEntriesByType("resource"),l=0;l<n.length;l++){var r=n[l],s=r.transferSize,m=r.initiatorType,v=r.duration;if(s&&v&&Ph(m)){for(m=0,v=r.responseEnd,l+=1;l<n.length;l++){var E=n[l],B=E.startTime;if(B>v)break;var te=E.transferSize,oe=E.initiatorType;te&&Ph(oe)&&(E=E.responseEnd,m+=te*(E<v?1:(v-B)/(E-B)))}if(--l,t+=8*(s+m)/(r.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 eu=null,tu=null;function Xi(e){return e.nodeType===9?e:e.ownerDocument}function ey(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 ty(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 nu(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 lu=null;function Yv(){var e=window.event;return e&&e.type==="popstate"?e===lu?!1:(lu=e,!0):(lu=null,!1)}var ny=typeof setTimeout=="function"?setTimeout:void 0,Gv=typeof clearTimeout=="function"?clearTimeout:void 0,ly=typeof Promise=="function"?Promise:void 0,Iv=typeof queueMicrotask=="function"?queueMicrotask:typeof ly<"u"?function(e){return ly.resolve(null).then(e).catch(Fv)}:ny;function Fv(e){setTimeout(function(){throw e})}function Tl(e){return e==="head"}function ay(e,t){var n=t,l=0;do{var r=n.nextSibling;if(e.removeChild(n),r&&r.nodeType===8)if(n=r.data,n==="/$"||n==="/&"){if(l===0){e.removeChild(r),Ua(t);return}l--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")l++;else if(n==="html")_r(e.ownerDocument.documentElement);else if(n==="head"){n=e.ownerDocument.head,_r(n);for(var s=n.firstChild;s;){var m=s.nextSibling,v=s.nodeName;s[Xa]||v==="SCRIPT"||v==="STYLE"||v==="LINK"&&s.rel.toLowerCase()==="stylesheet"||n.removeChild(s),s=m}}else n==="body"&&_r(e.ownerDocument.body);n=r}while(n);Ua(t)}function ry(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 au(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":au(n),oo(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function Vv(e,t,n,l){for(;e.nodeType===1;){var r=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!l&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(l){if(!e[Xa])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(s=e.getAttribute("rel"),s==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(s!==r.rel||e.getAttribute("href")!==(r.href==null||r.href===""?null:r.href)||e.getAttribute("crossorigin")!==(r.crossOrigin==null?null:r.crossOrigin)||e.getAttribute("title")!==(r.title==null?null:r.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(s=e.getAttribute("src"),(s!==(r.src==null?null:r.src)||e.getAttribute("type")!==(r.type==null?null:r.type)||e.getAttribute("crossorigin")!==(r.crossOrigin==null?null:r.crossOrigin))&&s&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var s=r.name==null?null:""+r.name;if(r.type==="hidden"&&e.getAttribute("name")===s)return e}else return e;if(e=vn(e.nextSibling),e===null)break}return null}function Xv(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=vn(e.nextSibling),e===null))return null;return e}function iy(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=vn(e.nextSibling),e===null))return null;return e}function ru(e){return e.data==="$?"||e.data==="$~"}function iu(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function Zv(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 vn(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 su=null;function sy(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"||n==="/&"){if(t===0)return vn(e.nextSibling);t--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||t++}e=e.nextSibling}return null}function oy(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 cy(e,t,n){switch(t=Xi(n),e){case"html":if(e=t.documentElement,!e)throw Error(u(452));return e;case"head":if(e=t.head,!e)throw Error(u(453));return e;case"body":if(e=t.body,!e)throw Error(u(454));return e;default:throw Error(u(451))}}function _r(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);oo(e)}var Sn=new Map,uy=new Set;function Zi(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var nl=ne.d;ne.d={f:Qv,r:Kv,D:Jv,C:Wv,L:Pv,m:e1,X:n1,S:t1,M:l1};function Qv(){var e=nl.f(),t=Hi();return e||t}function Kv(e){var t=la(e);t!==null&&t.tag===5&&t.type==="form"?Em(t):nl.r(e)}var za=typeof document>"u"?null:document;function dy(e,t,n){var l=za;if(l&&typeof t=="string"&&t){var r=pn(t);r='link[rel="'+e+'"][href="'+r+'"]',typeof n=="string"&&(r+='[crossorigin="'+n+'"]'),uy.has(r)||(uy.add(r),e={rel:e,crossOrigin:n,href:t},l.querySelector(r)===null&&(t=l.createElement("link"),$t(t,"link",e),Ct(t),l.head.appendChild(t)))}}function Jv(e){nl.D(e),dy("dns-prefetch",e,null)}function Wv(e,t){nl.C(e,t),dy("preconnect",e,t)}function Pv(e,t,n){nl.L(e,t,n);var l=za;if(l&&e&&t){var r='link[rel="preload"][as="'+pn(t)+'"]';t==="image"&&n&&n.imageSrcSet?(r+='[imagesrcset="'+pn(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(r+='[imagesizes="'+pn(n.imageSizes)+'"]')):r+='[href="'+pn(e)+'"]';var s=r;switch(t){case"style":s=$a(e);break;case"script":s=Da(e)}Sn.has(s)||(e=A({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),Sn.set(s,e),l.querySelector(r)!==null||t==="style"&&l.querySelector(Or(s))||t==="script"&&l.querySelector(kr(s))||(t=l.createElement("link"),$t(t,"link",e),Ct(t),l.head.appendChild(t)))}}function e1(e,t){nl.m(e,t);var n=za;if(n&&e){var l=t&&typeof t.as=="string"?t.as:"script",r='link[rel="modulepreload"][as="'+pn(l)+'"][href="'+pn(e)+'"]',s=r;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":s=Da(e)}if(!Sn.has(s)&&(e=A({rel:"modulepreload",href:e},t),Sn.set(s,e),n.querySelector(r)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(kr(s)))return}l=n.createElement("link"),$t(l,"link",e),Ct(l),n.head.appendChild(l)}}}function t1(e,t,n){nl.S(e,t,n);var l=za;if(l&&e){var r=aa(l).hoistableStyles,s=$a(e);t=t||"default";var m=r.get(s);if(!m){var v={loading:0,preload:null};if(m=l.querySelector(Or(s)))v.loading=5;else{e=A({rel:"stylesheet",href:e,"data-precedence":t},n),(n=Sn.get(s))&&ou(e,n);var E=m=l.createElement("link");Ct(E),$t(E,"link",e),E._p=new Promise(function(B,te){E.onload=B,E.onerror=te}),E.addEventListener("load",function(){v.loading|=1}),E.addEventListener("error",function(){v.loading|=2}),v.loading|=4,Qi(m,t,l)}m={type:"stylesheet",instance:m,count:1,state:v},r.set(s,m)}}}function n1(e,t){nl.X(e,t);var n=za;if(n&&e){var l=aa(n).hoistableScripts,r=Da(e),s=l.get(r);s||(s=n.querySelector(kr(r)),s||(e=A({src:e,async:!0},t),(t=Sn.get(r))&&cu(e,t),s=n.createElement("script"),Ct(s),$t(s,"link",e),n.head.appendChild(s)),s={type:"script",instance:s,count:1,state:null},l.set(r,s))}}function l1(e,t){nl.M(e,t);var n=za;if(n&&e){var l=aa(n).hoistableScripts,r=Da(e),s=l.get(r);s||(s=n.querySelector(kr(r)),s||(e=A({src:e,async:!0,type:"module"},t),(t=Sn.get(r))&&cu(e,t),s=n.createElement("script"),Ct(s),$t(s,"link",e),n.head.appendChild(s)),s={type:"script",instance:s,count:1,state:null},l.set(r,s))}}function fy(e,t,n,l){var r=(r=Te.current)?Zi(r):null;if(!r)throw Error(u(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(t=$a(n.href),n=aa(r).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=$a(n.href);var s=aa(r).hoistableStyles,m=s.get(e);if(m||(r=r.ownerDocument||r,m={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},s.set(e,m),(s=r.querySelector(Or(e)))&&!s._p&&(m.instance=s,m.state.loading=5),Sn.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},Sn.set(e,n),s||a1(r,e,n,m.state))),t&&l===null)throw Error(u(528,""));return m}if(t&&l!==null)throw Error(u(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Da(n),n=aa(r).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(u(444,e))}}function $a(e){return'href="'+pn(e)+'"'}function Or(e){return'link[rel="stylesheet"]['+e+"]"}function py(e){return A({},e,{"data-precedence":e.precedence,precedence:null})}function a1(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),Ct(t),e.head.appendChild(t))}function Da(e){return'[src="'+pn(e)+'"]'}function kr(e){return"script[async]"+e}function my(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var l=e.querySelector('style[data-href~="'+pn(n.href)+'"]');if(l)return t.instance=l,Ct(l),l;var r=A({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return l=(e.ownerDocument||e).createElement("style"),Ct(l),$t(l,"style",r),Qi(l,n.precedence,e),t.instance=l;case"stylesheet":r=$a(n.href);var s=e.querySelector(Or(r));if(s)return t.state.loading|=4,t.instance=s,Ct(s),s;l=py(n),(r=Sn.get(r))&&ou(l,r),s=(e.ownerDocument||e).createElement("link"),Ct(s);var m=s;return m._p=new Promise(function(v,E){m.onload=v,m.onerror=E}),$t(s,"link",l),t.state.loading|=4,Qi(s,n.precedence,e),t.instance=s;case"script":return s=Da(n.src),(r=e.querySelector(kr(s)))?(t.instance=r,Ct(r),r):(l=n,(r=Sn.get(s))&&(l=A({},n),cu(l,r)),e=e.ownerDocument||e,r=e.createElement("script"),Ct(r),$t(r,"link",l),e.head.appendChild(r),t.instance=r);case"void":return null;default:throw Error(u(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(l=t.instance,t.state.loading|=4,Qi(l,n.precedence,e));return t.instance}function Qi(e,t,n){for(var l=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),r=l.length?l[l.length-1]:null,s=r,m=0;m<l.length;m++){var v=l[m];if(v.dataset.precedence===t)s=v;else if(s!==r)break}s?s.parentNode.insertBefore(e,s.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function ou(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function cu(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Ki=null;function hy(e,t,n){if(Ki===null){var l=new Map,r=Ki=new Map;r.set(n,l)}else r=Ki,l=r.get(n),l||(l=new Map,r.set(n,l));if(l.has(e))return l;for(l.set(e,null),n=n.getElementsByTagName(e),r=0;r<n.length;r++){var s=n[r];if(!(s[Xa]||s[Rt]||e==="link"&&s.getAttribute("rel")==="stylesheet")&&s.namespaceURI!=="http://www.w3.org/2000/svg"){var m=s.getAttribute(t)||"";m=e+m;var v=l.get(m);v?v.push(s):l.set(m,[s])}}return l}function yy(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function r1(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 gy(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function i1(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 r=$a(l.href),s=t.querySelector(Or(r));if(s){t=s._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Ji.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=s,Ct(s);return}s=t.ownerDocument||t,l=py(l),(r=Sn.get(r))&&ou(l,r),s=s.createElement("link"),Ct(s);var m=s;m._p=new Promise(function(v,E){m.onload=v,m.onerror=E}),$t(s,"link",l),n.instance=s}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&(n.state.loading&3)===0&&(e.count++,n=Ji.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var uu=0;function s1(e,t){return e.stylesheets&&e.count===0&&Pi(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var l=setTimeout(function(){if(e.stylesheets&&Pi(e,e.stylesheets),e.unsuspend){var s=e.unsuspend;e.unsuspend=null,s()}},6e4+t);0<e.imgBytes&&uu===0&&(uu=62500*Bv());var r=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Pi(e,e.stylesheets),e.unsuspend)){var s=e.unsuspend;e.unsuspend=null,s()}},(e.imgBytes>uu?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(l),clearTimeout(r)}}:null}function Ji(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Pi(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Wi=null;function Pi(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Wi=new Map,t.forEach(o1,e),Wi=null,Ji.call(e))}function o1(e,t){if(!(t.state.loading&4)){var n=Wi.get(e);if(n)var l=n.get(null);else{n=new Map,Wi.set(e,n);for(var r=e.querySelectorAll("link[data-precedence],style[data-precedence]"),s=0;s<r.length;s++){var m=r[s];(m.nodeName==="LINK"||m.getAttribute("media")!=="not all")&&(n.set(m.dataset.precedence,m),l=m)}l&&n.set(null,l)}r=t.instance,m=r.getAttribute("data-precedence"),s=n.get(m)||l,s===l&&n.set(null,r),n.set(m,r),this.count++,l=Ji.bind(this),r.addEventListener("load",l),r.addEventListener("error",l),s?s.parentNode.insertBefore(r,s.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(r,e.firstChild)),t.state.loading|=4}}var Rr={$$typeof:N,Provider:null,Consumer:null,_currentValue:W,_currentValue2:W,_threadCount:0};function c1(e,t,n,l,r,s,m,v,E){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=Un(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Un(0),this.hiddenUpdates=Un(null),this.identifierPrefix=l,this.onUncaughtError=r,this.onCaughtError=s,this.onRecoverableError=m,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=E,this.incompleteTransitions=new Map}function xy(e,t,n,l,r,s,m,v,E,B,te,oe){return e=new c1(e,t,n,m,E,B,te,oe,v),t=1,s===!0&&(t|=24),s=en(3,null,null,t),e.current=s,s.stateNode=e,t=Go(),t.refCount++,e.pooledCache=t,t.refCount++,s.memoizedState={element:l,isDehydrated:n,cache:t},Xo(s),e}function by(e){return e?(e=ma,e):ma}function vy(e,t,n,l,r,s){r=by(r),l.context===null?l.context=r:l.pendingContext=r,l=hl(t),l.payload={element:n},s=s===void 0?null:s,s!==null&&(l.callback=s),n=yl(e,l,t),n!==null&&(Jt(n,e,t),ur(n,e,t))}function Sy(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function du(e,t){Sy(e,t),(e=e.alternate)&&Sy(e,t)}function Ay(e){if(e.tag===13||e.tag===31){var t=Dl(e,67108864);t!==null&&Jt(t,e,67108864),du(e,67108864)}}function jy(e){if(e.tag===13||e.tag===31){var t=rn();t=ro(t);var n=Dl(e,t);n!==null&&Jt(n,e,t),du(e,t)}}var es=!0;function u1(e,t,n,l){var r=T.T;T.T=null;var s=ne.p;try{ne.p=2,fu(e,t,n,l)}finally{ne.p=s,T.T=r}}function d1(e,t,n,l){var r=T.T;T.T=null;var s=ne.p;try{ne.p=8,fu(e,t,n,l)}finally{ne.p=s,T.T=r}}function fu(e,t,n,l){if(es){var r=pu(l);if(r===null)Wc(e,t,l,ts,n),wy(e,l);else if(p1(r,e,t,n,l))l.stopPropagation();else if(wy(e,l),t&4&&-1<f1.indexOf(e)){for(;r!==null;){var s=la(r);if(s!==null)switch(s.tag){case 3:if(s=s.stateNode,s.current.memoizedState.isDehydrated){var m=Oe(s.pendingLanes);if(m!==0){var v=s;for(v.pendingLanes|=2,v.entangledLanes|=2;m;){var E=1<<31-F(m);v.entanglements[1]|=E,m&=~E}$n(s),(lt&6)===0&&(Di=_e()+500,Tr(0))}}break;case 31:case 13:v=Dl(s,2),v!==null&&Jt(v,s,2),Hi(),du(s,2)}if(s=pu(l),s===null&&Wc(e,t,l,ts,n),s===r)break;r=s}r!==null&&l.stopPropagation()}else Wc(e,t,l,null,n)}}function pu(e){return e=ho(e),mu(e)}var ts=null;function mu(e){if(ts=null,e=na(e),e!==null){var t=p(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=g(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 ts=e,null}function Ny(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(se()){case Ae:return 2;case De:return 8;case dn:case d:return 32;case q:return 268435456;default:return 32}default:return 32}}var hu=!1,El=null,Cl=null,_l=null,qr=new Map,Mr=new Map,Ol=[],f1="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 wy(e,t){switch(e){case"focusin":case"focusout":El=null;break;case"dragenter":case"dragleave":Cl=null;break;case"mouseover":case"mouseout":_l=null;break;case"pointerover":case"pointerout":qr.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Mr.delete(t.pointerId)}}function zr(e,t,n,l,r,s){return e===null||e.nativeEvent!==s?(e={blockedOn:t,domEventName:n,eventSystemFlags:l,nativeEvent:s,targetContainers:[r]},t!==null&&(t=la(t),t!==null&&Ay(t)),e):(e.eventSystemFlags|=l,t=e.targetContainers,r!==null&&t.indexOf(r)===-1&&t.push(r),e)}function p1(e,t,n,l,r){switch(t){case"focusin":return El=zr(El,e,t,n,l,r),!0;case"dragenter":return Cl=zr(Cl,e,t,n,l,r),!0;case"mouseover":return _l=zr(_l,e,t,n,l,r),!0;case"pointerover":var s=r.pointerId;return qr.set(s,zr(qr.get(s)||null,e,t,n,l,r)),!0;case"gotpointercapture":return s=r.pointerId,Mr.set(s,zr(Mr.get(s)||null,e,t,n,l,r)),!0}return!1}function Ty(e){var t=na(e.target);if(t!==null){var n=p(t);if(n!==null){if(t=n.tag,t===13){if(t=g(n),t!==null){e.blockedOn=t,Lf(e.priority,function(){jy(n)});return}}else if(t===31){if(t=y(n),t!==null){e.blockedOn=t,Lf(e.priority,function(){jy(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 ns(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=pu(e.nativeEvent);if(n===null){n=e.nativeEvent;var l=new n.constructor(n.type,n);mo=l,n.target.dispatchEvent(l),mo=null}else return t=la(n),t!==null&&Ay(t),e.blockedOn=n,!1;t.shift()}return!0}function Ey(e,t,n){ns(e)&&n.delete(t)}function m1(){hu=!1,El!==null&&ns(El)&&(El=null),Cl!==null&&ns(Cl)&&(Cl=null),_l!==null&&ns(_l)&&(_l=null),qr.forEach(Ey),Mr.forEach(Ey)}function ls(e,t){e.blockedOn===t&&(e.blockedOn=null,hu||(hu=!0,a.unstable_scheduleCallback(a.unstable_NormalPriority,m1)))}var as=null;function Cy(e){as!==e&&(as=e,a.unstable_scheduleCallback(a.unstable_NormalPriority,function(){as===e&&(as=null);for(var t=0;t<e.length;t+=3){var n=e[t],l=e[t+1],r=e[t+2];if(typeof l!="function"){if(mu(l||n)===null)continue;break}var s=la(n);s!==null&&(e.splice(t,3),t-=3,pc(s,{pending:!0,data:r,method:n.method,action:l},l,r))}}))}function Ua(e){function t(E){return ls(E,e)}El!==null&&ls(El,e),Cl!==null&&ls(Cl,e),_l!==null&&ls(_l,e),qr.forEach(t),Mr.forEach(t);for(var n=0;n<Ol.length;n++){var l=Ol[n];l.blockedOn===e&&(l.blockedOn=null)}for(;0<Ol.length&&(n=Ol[0],n.blockedOn===null);)Ty(n),n.blockedOn===null&&Ol.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(l=0;l<n.length;l+=3){var r=n[l],s=n[l+1],m=r[Ft]||null;if(typeof s=="function")m||Cy(n);else if(m){var v=null;if(s&&s.hasAttribute("formAction")){if(r=s,m=s[Ft]||null)v=m.formAction;else if(mu(r)!==null)continue}else v=m.action;typeof v=="function"?n[l+1]=v:(n.splice(l,3),l-=3),Cy(n)}}}function _y(){function e(s){s.canIntercept&&s.info==="react-transition"&&s.intercept({handler:function(){return new Promise(function(m){return r=m})},focusReset:"manual",scroll:"manual"})}function t(){r!==null&&(r(),r=null),l||setTimeout(n,20)}function n(){if(!l&&!navigation.transition){var s=navigation.currentEntry;s&&s.url!=null&&navigation.navigate(s.url,{state:s.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var l=!1,r=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),r!==null&&(r(),r=null)}}}function yu(e){this._internalRoot=e}rs.prototype.render=yu.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(u(409));var n=t.current,l=rn();vy(n,l,e,t,null,null)},rs.prototype.unmount=yu.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;vy(e.current,2,null,e,null,null),Hi(),t[ta]=null}};function rs(e){this._internalRoot=e}rs.prototype.unstable_scheduleHydration=function(e){if(e){var t=Hf();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Ol.length&&t!==0&&t<Ol[n].priority;n++);Ol.splice(n,0,e),n===0&&Ty(e)}};var Oy=i.version;if(Oy!=="19.2.8")throw Error(u(527,Oy,"19.2.8"));ne.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(u(188)):(e=Object.keys(e).join(","),Error(u(268,e)));return e=h(t),e=e!==null?S(e):null,e=e===null?null:e.stateNode,e};var h1={bundleType:0,version:"19.2.8",rendererPackageName:"react-dom",currentDispatcherRef:T,reconcilerVersion:"19.2.8"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var is=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!is.isDisabled&&is.supportsFiber)try{Q=is.inject(h1),b=is}catch{}}return La.createRoot=function(e,t){if(!f(e))throw Error(u(299));var n=!1,l="",r=Dm,s=Um,m=Hm;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(l=t.identifierPrefix),t.onUncaughtError!==void 0&&(r=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(m=t.onRecoverableError)),t=xy(e,1,!1,null,null,n,l,null,r,s,m,_y),e[ta]=t.current,Jc(e),new yu(t)},La.hydrateRoot=function(e,t,n){if(!f(e))throw Error(u(299));var l=!1,r="",s=Dm,m=Um,v=Hm,E=null;return n!=null&&(n.unstable_strictMode===!0&&(l=!0),n.identifierPrefix!==void 0&&(r=n.identifierPrefix),n.onUncaughtError!==void 0&&(s=n.onUncaughtError),n.onCaughtError!==void 0&&(m=n.onCaughtError),n.onRecoverableError!==void 0&&(v=n.onRecoverableError),n.formState!==void 0&&(E=n.formState)),t=xy(e,1,!0,t,n??null,l,r,E,s,m,v,_y),t.context=by(null),n=t.current,l=rn(),l=ro(l),r=hl(l),r.callback=null,yl(n,r,l),n=l,t.current.lanes=n,Nn(t,n),$n(t),e[ta]=t.current,Jc(e),new rs(t)},La.version="19.2.8",La}var Cu;function Ly(){if(Cu)return os.exports;Cu=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(i){console.error(i)}}return a(),os.exports=Hy(),os.exports}var By=Ly(),le=fs();const ms=xu(le);const Yy=a=>a.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Gy=a=>a.replace(/^([A-Z])|[\s-_]+(\w)/g,(i,c,u)=>u?u.toUpperCase():c.toLowerCase()),_u=a=>{const i=Gy(a);return i.charAt(0).toUpperCase()+i.slice(1)},Ou=(...a)=>a.filter((i,c,u)=>!!i&&i.trim()!==""&&u.indexOf(i)===c).join(" ").trim(),Iy=a=>{for(const i in a)if(i.startsWith("aria-")||i==="role"||i==="title")return!0};var Fy={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const Vy=le.forwardRef(({color:a="currentColor",size:i=24,strokeWidth:c=2,absoluteStrokeWidth:u,className:f="",children:p,iconNode:g,...y},x)=>le.createElement("svg",{ref:x,...Fy,width:i,height:i,stroke:a,strokeWidth:u?Number(c)*24/Number(i):c,className:Ou("lucide",f),...!p&&!Iy(y)&&{"aria-hidden":"true"},...y},[...g.map(([h,S])=>le.createElement(h,S)),...Array.isArray(p)?p:[p]]));const et=(a,i)=>{const c=le.forwardRef(({className:u,...f},p)=>le.createElement(Vy,{ref:p,iconNode:i,className:Ou(`lucide-${Yy(_u(a))}`,`lucide-${a}`,u),...f}));return c.displayName=_u(a),c};const ku=et("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);const Xy=et("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);const Ru=et("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);const qu=et("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);const $r=et("circle-alert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);const Mu=et("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);const Zy=et("circle-x",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);const hs=et("clock-3",[["path",{d:"M12 6v6h4",key:"135r8i"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);const Qy=et("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);const ys=et("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);const gs=et("file-text",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);const Ky=et("folder-plus",[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);const Jy=et("history",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]);const Wy=et("library",[["path",{d:"m16 6 4 14",key:"ji33uf"}],["path",{d:"M12 6v14",key:"1n7gus"}],["path",{d:"M8 8v12",key:"1gg7y9"}],["path",{d:"M4 4v16",key:"6qkkli"}]]);const xs=et("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);const Py=et("lock-open",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 9.9-1",key:"1mm8w8"}]]);const eg=et("lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);const tg=et("menu",[["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 18h16",key:"19g7jn"}],["path",{d:"M4 6h16",key:"1o0s65"}]]);const Jl=et("play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);const Ba=et("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);const ng=et("rotate-ccw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);const lg=et("save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);const zu=et("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]);const $u=et("server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]);const ag=et("settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);const rg=et("shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]);const ig=et("square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);const Du=et("tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]);const Cn=et("trash-2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);const sg=et("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);const Uu=et("upload",[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]]);const Hu=et("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function og(a){return a&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a}var Ut={},Dr={},ll={},Lu;function Ya(){if(Lu)return ll;Lu=1;function a(g){return typeof g>"u"||g===null}function i(g){return typeof g=="object"&&g!==null}function c(g){return Array.isArray(g)?g:a(g)?[]:[g]}function u(g,y){if(y){const x=Object.keys(y);for(let h=0,S=x.length;h<S;h+=1){const A=x[h];g[A]=y[A]}}return g}function f(g,y){let x="";for(let h=0;h<y;h+=1)x+=g;return x}function p(g){return g===0&&Number.NEGATIVE_INFINITY===1/g}return ll.isNothing=a,ll.isObject=i,ll.toArray=c,ll.repeat=f,ll.isNegativeZero=p,ll.extend=u,ll}var bs,Bu;function Ga(){if(Bu)return bs;Bu=1;function a(c,u){let f="";const p=c.reason||"(unknown reason)";return c.mark?(c.mark.name&&(f+='in "'+c.mark.name+'" '),f+="("+(c.mark.line+1)+":"+(c.mark.column+1)+")",!u&&c.mark.snippet&&(f+=`
|
|
1
|
+
var FlexDocStandaloneBundle=(function(As){"use strict";var Xm=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Jm(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var id={exports:{}},ra={};var Qm;function I2(){if(Qm)return ra;Qm=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function n(r,s,a){var c=null;if(a!==void 0&&(c=""+a),s.key!==void 0&&(c=""+s.key),"key"in s){a={};for(var d in s)d!=="key"&&(a[d]=s[d])}else a=s;return s=a.ref,{$$typeof:t,type:r,key:c,ref:s!==void 0?s:null,props:a}}return ra.Fragment=e,ra.jsx=n,ra.jsxs=n,ra}var Wm;function U2(){return Wm||(Wm=1,id.exports=I2()),id.exports}var p=U2(),rd={exports:{}},sa={},sd={exports:{}},ld={};var Zm;function F2(){return Zm||(Zm=1,(function(t){function e(_,ee){var he=_.length;_.push(ee);e:for(;0<he;){var $=he-1>>>1,te=_[$];if(0<s(te,ee))_[$]=ee,_[he]=te,he=$;else break e}}function n(_){return _.length===0?null:_[0]}function r(_){if(_.length===0)return null;var ee=_[0],he=_.pop();if(he!==ee){_[0]=he;e:for(var $=0,te=_.length,L=te>>>1;$<L;){var P=2*($+1)-1,ue=_[P],Se=P+1,Ne=_[Se];if(0>s(ue,he))Se<te&&0>s(Ne,ue)?(_[$]=Ne,_[Se]=he,$=Se):(_[$]=ue,_[P]=he,$=P);else if(Se<te&&0>s(Ne,he))_[$]=Ne,_[Se]=he,$=Se;else break e}}return ee}function s(_,ee){var he=_.sortIndex-ee.sortIndex;return he!==0?he:_.id-ee.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var a=performance;t.unstable_now=function(){return a.now()}}else{var c=Date,d=c.now();t.unstable_now=function(){return c.now()-d}}var f=[],h=[],g=1,b=null,v=3,S=!1,A=!1,C=!1,T=!1,D=typeof setTimeout=="function"?setTimeout:null,j=typeof clearTimeout=="function"?clearTimeout:null,E=typeof setImmediate<"u"?setImmediate:null;function O(_){for(var ee=n(h);ee!==null;){if(ee.callback===null)r(h);else if(ee.startTime<=_)r(h),ee.sortIndex=ee.expirationTime,e(f,ee);else break;ee=n(h)}}function R(_){if(C=!1,O(_),!A)if(n(f)!==null)A=!0,B||(B=!0,G());else{var ee=n(h);ee!==null&&xe(R,ee.startTime-_)}}var B=!1,M=-1,z=5,F=-1;function X(){return T?!0:!(t.unstable_now()-F<z)}function W(){if(T=!1,B){var _=t.unstable_now();F=_;var ee=!0;try{e:{A=!1,C&&(C=!1,j(M),M=-1),S=!0;var he=v;try{t:{for(O(_),b=n(f);b!==null&&!(b.expirationTime>_&&X());){var $=b.callback;if(typeof $=="function"){b.callback=null,v=b.priorityLevel;var te=$(b.expirationTime<=_);if(_=t.unstable_now(),typeof te=="function"){b.callback=te,O(_),ee=!0;break t}b===n(f)&&r(f),O(_)}else r(f);b=n(f)}if(b!==null)ee=!0;else{var L=n(h);L!==null&&xe(R,L.startTime-_),ee=!1}}break e}finally{b=null,v=he,S=!1}ee=void 0}}finally{ee?G():B=!1}}}var G;if(typeof E=="function")G=function(){E(W)};else if(typeof MessageChannel<"u"){var we=new MessageChannel,ye=we.port2;we.port1.onmessage=W,G=function(){ye.postMessage(null)}}else G=function(){D(W,0)};function xe(_,ee){M=D(function(){_(t.unstable_now())},ee)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(_){_.callback=null},t.unstable_forceFrameRate=function(_){0>_||125<_?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):z=0<_?Math.floor(1e3/_):5},t.unstable_getCurrentPriorityLevel=function(){return v},t.unstable_next=function(_){switch(v){case 1:case 2:case 3:var ee=3;break;default:ee=v}var he=v;v=ee;try{return _()}finally{v=he}},t.unstable_requestPaint=function(){T=!0},t.unstable_runWithPriority=function(_,ee){switch(_){case 1:case 2:case 3:case 4:case 5:break;default:_=3}var he=v;v=_;try{return ee()}finally{v=he}},t.unstable_scheduleCallback=function(_,ee,he){var $=t.unstable_now();switch(typeof he=="object"&&he!==null?(he=he.delay,he=typeof he=="number"&&0<he?$+he:$):he=$,_){case 1:var te=-1;break;case 2:te=250;break;case 5:te=1073741823;break;case 4:te=1e4;break;default:te=5e3}return te=he+te,_={id:g++,callback:ee,priorityLevel:_,startTime:he,expirationTime:te,sortIndex:-1},he>$?(_.sortIndex=he,e(h,_),n(f)===null&&_===n(h)&&(C?(j(M),M=-1):C=!0,xe(R,he-$))):(_.sortIndex=te,e(f,_),A||S||(A=!0,B||(B=!0,G()))),_},t.unstable_shouldYield=X,t.unstable_wrapCallback=function(_){var ee=v;return function(){var he=v;v=ee;try{return _.apply(this,arguments)}finally{v=he}}}})(ld)),ld}var eg;function V2(){return eg||(eg=1,sd.exports=F2()),sd.exports}var ad={exports:{}},We={};var tg;function P2(){if(tg)return We;tg=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),a=Symbol.for("react.consumer"),c=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),b=Symbol.for("react.activity"),v=Symbol.iterator;function S(L){return L===null||typeof L!="object"?null:(L=v&&L[v]||L["@@iterator"],typeof L=="function"?L:null)}var A={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,T={};function D(L,P,ue){this.props=L,this.context=P,this.refs=T,this.updater=ue||A}D.prototype.isReactComponent={},D.prototype.setState=function(L,P){if(typeof L!="object"&&typeof L!="function"&&L!=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,L,P,"setState")},D.prototype.forceUpdate=function(L){this.updater.enqueueForceUpdate(this,L,"forceUpdate")};function j(){}j.prototype=D.prototype;function E(L,P,ue){this.props=L,this.context=P,this.refs=T,this.updater=ue||A}var O=E.prototype=new j;O.constructor=E,C(O,D.prototype),O.isPureReactComponent=!0;var R=Array.isArray;function B(){}var M={H:null,A:null,T:null,S:null},z=Object.prototype.hasOwnProperty;function F(L,P,ue){var Se=ue.ref;return{$$typeof:t,type:L,key:P,ref:Se!==void 0?Se:null,props:ue}}function X(L,P){return F(L.type,P,L.props)}function W(L){return typeof L=="object"&&L!==null&&L.$$typeof===t}function G(L){var P={"=":"=0",":":"=2"};return"$"+L.replace(/[=:]/g,function(ue){return P[ue]})}var we=/\/+/g;function ye(L,P){return typeof L=="object"&&L!==null&&L.key!=null?G(""+L.key):P.toString(36)}function xe(L){switch(L.status){case"fulfilled":return L.value;case"rejected":throw L.reason;default:switch(typeof L.status=="string"?L.then(B,B):(L.status="pending",L.then(function(P){L.status==="pending"&&(L.status="fulfilled",L.value=P)},function(P){L.status==="pending"&&(L.status="rejected",L.reason=P)})),L.status){case"fulfilled":return L.value;case"rejected":throw L.reason}}throw L}function _(L,P,ue,Se,Ne){var Re=typeof L;(Re==="undefined"||Re==="boolean")&&(L=null);var Be=!1;if(L===null)Be=!0;else switch(Re){case"bigint":case"string":case"number":Be=!0;break;case"object":switch(L.$$typeof){case t:case e:Be=!0;break;case g:return Be=L._init,_(Be(L._payload),P,ue,Se,Ne)}}if(Be)return Ne=Ne(L),Be=Se===""?"."+ye(L,0):Se,R(Ne)?(ue="",Be!=null&&(ue=Be.replace(we,"$&/")+"/"),_(Ne,P,ue,"",function(Ke){return Ke})):Ne!=null&&(W(Ne)&&(Ne=X(Ne,ue+(Ne.key==null||L&&L.key===Ne.key?"":(""+Ne.key).replace(we,"$&/")+"/")+Be)),P.push(Ne)),1;Be=0;var Ze=Se===""?".":Se+":";if(R(L))for(var _e=0;_e<L.length;_e++)Se=L[_e],Re=Ze+ye(Se,_e),Be+=_(Se,P,ue,Re,Ne);else if(_e=S(L),typeof _e=="function")for(L=_e.call(L),_e=0;!(Se=L.next()).done;)Se=Se.value,Re=Ze+ye(Se,_e++),Be+=_(Se,P,ue,Re,Ne);else if(Re==="object"){if(typeof L.then=="function")return _(xe(L),P,ue,Se,Ne);throw P=String(L),Error("Objects are not valid as a React child (found: "+(P==="[object Object]"?"object with keys {"+Object.keys(L).join(", ")+"}":P)+"). If you meant to render a collection of children, use an array instead.")}return Be}function ee(L,P,ue){if(L==null)return L;var Se=[],Ne=0;return _(L,Se,"","",function(Re){return P.call(ue,Re,Ne++)}),Se}function he(L){if(L._status===-1){var P=L._result;P=P(),P.then(function(ue){(L._status===0||L._status===-1)&&(L._status=1,L._result=ue)},function(ue){(L._status===0||L._status===-1)&&(L._status=2,L._result=ue)}),L._status===-1&&(L._status=0,L._result=P)}if(L._status===1)return L._result.default;throw L._result}var $=typeof reportError=="function"?reportError:function(L){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var P=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof L=="object"&&L!==null&&typeof L.message=="string"?String(L.message):String(L),error:L});if(!window.dispatchEvent(P))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",L);return}console.error(L)},te={map:ee,forEach:function(L,P,ue){ee(L,function(){P.apply(this,arguments)},ue)},count:function(L){var P=0;return ee(L,function(){P++}),P},toArray:function(L){return ee(L,function(P){return P})||[]},only:function(L){if(!W(L))throw Error("React.Children.only expected to receive a single React element child.");return L}};return We.Activity=b,We.Children=te,We.Component=D,We.Fragment=n,We.Profiler=s,We.PureComponent=E,We.StrictMode=r,We.Suspense=f,We.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=M,We.__COMPILER_RUNTIME={__proto__:null,c:function(L){return M.H.useMemoCache(L)}},We.cache=function(L){return function(){return L.apply(null,arguments)}},We.cacheSignal=function(){return null},We.cloneElement=function(L,P,ue){if(L==null)throw Error("The argument must be a React element, but you passed "+L+".");var Se=C({},L.props),Ne=L.key;if(P!=null)for(Re in P.key!==void 0&&(Ne=""+P.key),P)!z.call(P,Re)||Re==="key"||Re==="__self"||Re==="__source"||Re==="ref"&&P.ref===void 0||(Se[Re]=P[Re]);var Re=arguments.length-2;if(Re===1)Se.children=ue;else if(1<Re){for(var Be=Array(Re),Ze=0;Ze<Re;Ze++)Be[Ze]=arguments[Ze+2];Se.children=Be}return F(L.type,Ne,Se)},We.createContext=function(L){return L={$$typeof:c,_currentValue:L,_currentValue2:L,_threadCount:0,Provider:null,Consumer:null},L.Provider=L,L.Consumer={$$typeof:a,_context:L},L},We.createElement=function(L,P,ue){var Se,Ne={},Re=null;if(P!=null)for(Se in P.key!==void 0&&(Re=""+P.key),P)z.call(P,Se)&&Se!=="key"&&Se!=="__self"&&Se!=="__source"&&(Ne[Se]=P[Se]);var Be=arguments.length-2;if(Be===1)Ne.children=ue;else if(1<Be){for(var Ze=Array(Be),_e=0;_e<Be;_e++)Ze[_e]=arguments[_e+2];Ne.children=Ze}if(L&&L.defaultProps)for(Se in Be=L.defaultProps,Be)Ne[Se]===void 0&&(Ne[Se]=Be[Se]);return F(L,Re,Ne)},We.createRef=function(){return{current:null}},We.forwardRef=function(L){return{$$typeof:d,render:L}},We.isValidElement=W,We.lazy=function(L){return{$$typeof:g,_payload:{_status:-1,_result:L},_init:he}},We.memo=function(L,P){return{$$typeof:h,type:L,compare:P===void 0?null:P}},We.startTransition=function(L){var P=M.T,ue={};M.T=ue;try{var Se=L(),Ne=M.S;Ne!==null&&Ne(ue,Se),typeof Se=="object"&&Se!==null&&typeof Se.then=="function"&&Se.then(B,$)}catch(Re){$(Re)}finally{P!==null&&ue.types!==null&&(P.types=ue.types),M.T=P}},We.unstable_useCacheRefresh=function(){return M.H.useCacheRefresh()},We.use=function(L){return M.H.use(L)},We.useActionState=function(L,P,ue){return M.H.useActionState(L,P,ue)},We.useCallback=function(L,P){return M.H.useCallback(L,P)},We.useContext=function(L){return M.H.useContext(L)},We.useDebugValue=function(){},We.useDeferredValue=function(L,P){return M.H.useDeferredValue(L,P)},We.useEffect=function(L,P){return M.H.useEffect(L,P)},We.useEffectEvent=function(L){return M.H.useEffectEvent(L)},We.useId=function(){return M.H.useId()},We.useImperativeHandle=function(L,P,ue){return M.H.useImperativeHandle(L,P,ue)},We.useInsertionEffect=function(L,P){return M.H.useInsertionEffect(L,P)},We.useLayoutEffect=function(L,P){return M.H.useLayoutEffect(L,P)},We.useMemo=function(L,P){return M.H.useMemo(L,P)},We.useOptimistic=function(L,P){return M.H.useOptimistic(L,P)},We.useReducer=function(L,P,ue){return M.H.useReducer(L,P,ue)},We.useRef=function(L){return M.H.useRef(L)},We.useState=function(L){return M.H.useState(L)},We.useSyncExternalStore=function(L,P,ue){return M.H.useSyncExternalStore(L,P,ue)},We.useTransition=function(){return M.H.useTransition()},We.version="19.2.8",We}var ng;function od(){return ng||(ng=1,ad.exports=P2()),ad.exports}var cd={exports:{}},xn={};var ig;function K2(){if(ig)return xn;ig=1;var t=od();function e(f){var h="https://react.dev/errors/"+f;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var g=2;g<arguments.length;g++)h+="&args[]="+encodeURIComponent(arguments[g])}return"Minified React error #"+f+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(e(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},s=Symbol.for("react.portal");function a(f,h,g){var b=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:s,key:b==null?null:""+b,children:f,containerInfo:h,implementation:g}}var c=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(f,h){if(f==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return xn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,xn.createPortal=function(f,h){var g=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(e(299));return a(f,h,null,g)},xn.flushSync=function(f){var h=c.T,g=r.p;try{if(c.T=null,r.p=2,f)return f()}finally{c.T=h,r.p=g,r.d.f()}},xn.preconnect=function(f,h){typeof f=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,r.d.C(f,h))},xn.prefetchDNS=function(f){typeof f=="string"&&r.d.D(f)},xn.preinit=function(f,h){if(typeof f=="string"&&h&&typeof h.as=="string"){var g=h.as,b=d(g,h.crossOrigin),v=typeof h.integrity=="string"?h.integrity:void 0,S=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;g==="style"?r.d.S(f,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:b,integrity:v,fetchPriority:S}):g==="script"&&r.d.X(f,{crossOrigin:b,integrity:v,fetchPriority:S,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},xn.preinitModule=function(f,h){if(typeof f=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var g=d(h.as,h.crossOrigin);r.d.M(f,{crossOrigin:g,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&r.d.M(f)},xn.preload=function(f,h){if(typeof f=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var g=h.as,b=d(g,h.crossOrigin);r.d.L(f,g,{crossOrigin:b,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,type:typeof h.type=="string"?h.type:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0,referrerPolicy:typeof h.referrerPolicy=="string"?h.referrerPolicy:void 0,imageSrcSet:typeof h.imageSrcSet=="string"?h.imageSrcSet:void 0,imageSizes:typeof h.imageSizes=="string"?h.imageSizes:void 0,media:typeof h.media=="string"?h.media:void 0})}},xn.preloadModule=function(f,h){if(typeof f=="string")if(h){var g=d(h.as,h.crossOrigin);r.d.m(f,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:g,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else r.d.m(f)},xn.requestFormReset=function(f){r.d.r(f)},xn.unstable_batchedUpdates=function(f,h){return f(h)},xn.useFormState=function(f,h,g){return c.H.useFormState(f,h,g)},xn.useFormStatus=function(){return c.H.useHostTransitionStatus()},xn.version="19.2.8",xn}var rg;function Y2(){if(rg)return cd.exports;rg=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),cd.exports=K2(),cd.exports}var sg;function G2(){if(sg)return sa;sg=1;var t=V2(),e=od(),n=Y2();function r(i){var l="https://react.dev/errors/"+i;if(1<arguments.length){l+="?args[]="+encodeURIComponent(arguments[1]);for(var o=2;o<arguments.length;o++)l+="&args[]="+encodeURIComponent(arguments[o])}return"Minified React error #"+i+"; visit "+l+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11)}function a(i){var l=i,o=i;if(i.alternate)for(;l.return;)l=l.return;else{i=l;do l=i,(l.flags&4098)!==0&&(o=l.return),i=l.return;while(i)}return l.tag===3?o:null}function c(i){if(i.tag===13){var l=i.memoizedState;if(l===null&&(i=i.alternate,i!==null&&(l=i.memoizedState)),l!==null)return l.dehydrated}return null}function d(i){if(i.tag===31){var l=i.memoizedState;if(l===null&&(i=i.alternate,i!==null&&(l=i.memoizedState)),l!==null)return l.dehydrated}return null}function f(i){if(a(i)!==i)throw Error(r(188))}function h(i){var l=i.alternate;if(!l){if(l=a(i),l===null)throw Error(r(188));return l!==i?null:i}for(var o=i,u=l;;){var m=o.return;if(m===null)break;var y=m.alternate;if(y===null){if(u=m.return,u!==null){o=u;continue}break}if(m.child===y.child){for(y=m.child;y;){if(y===o)return f(m),i;if(y===u)return f(m),l;y=y.sibling}throw Error(r(188))}if(o.return!==u.return)o=m,u=y;else{for(var w=!1,N=m.child;N;){if(N===o){w=!0,o=m,u=y;break}if(N===u){w=!0,u=m,o=y;break}N=N.sibling}if(!w){for(N=y.child;N;){if(N===o){w=!0,o=y,u=m;break}if(N===u){w=!0,u=y,o=m;break}N=N.sibling}if(!w)throw Error(r(189))}}if(o.alternate!==u)throw Error(r(190))}if(o.tag!==3)throw Error(r(188));return o.stateNode.current===o?i:l}function g(i){var l=i.tag;if(l===5||l===26||l===27||l===6)return i;for(i=i.child;i!==null;){if(l=g(i),l!==null)return l;i=i.sibling}return null}var b=Object.assign,v=Symbol.for("react.element"),S=Symbol.for("react.transitional.element"),A=Symbol.for("react.portal"),C=Symbol.for("react.fragment"),T=Symbol.for("react.strict_mode"),D=Symbol.for("react.profiler"),j=Symbol.for("react.consumer"),E=Symbol.for("react.context"),O=Symbol.for("react.forward_ref"),R=Symbol.for("react.suspense"),B=Symbol.for("react.suspense_list"),M=Symbol.for("react.memo"),z=Symbol.for("react.lazy"),F=Symbol.for("react.activity"),X=Symbol.for("react.memo_cache_sentinel"),W=Symbol.iterator;function G(i){return i===null||typeof i!="object"?null:(i=W&&i[W]||i["@@iterator"],typeof i=="function"?i:null)}var we=Symbol.for("react.client.reference");function ye(i){if(i==null)return null;if(typeof i=="function")return i.$$typeof===we?null:i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case C:return"Fragment";case D:return"Profiler";case T:return"StrictMode";case R:return"Suspense";case B:return"SuspenseList";case F:return"Activity"}if(typeof i=="object")switch(i.$$typeof){case A:return"Portal";case E:return i.displayName||"Context";case j:return(i._context.displayName||"Context")+".Consumer";case O:var l=i.render;return i=i.displayName,i||(i=l.displayName||l.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case M:return l=i.displayName||null,l!==null?l:ye(i.type)||"Memo";case z:l=i._payload,i=i._init;try{return ye(i(l))}catch{}}return null}var xe=Array.isArray,_=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ee=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,he={pending:!1,data:null,method:null,action:null},$=[],te=-1;function L(i){return{current:i}}function P(i){0>te||(i.current=$[te],$[te]=null,te--)}function ue(i,l){te++,$[te]=i.current,i.current=l}var Se=L(null),Ne=L(null),Re=L(null),Be=L(null);function Ze(i,l){switch(ue(Re,l),ue(Ne,i),ue(Se,null),l.nodeType){case 9:case 11:i=(i=l.documentElement)&&(i=i.namespaceURI)?o2(i):0;break;default:if(i=l.tagName,l=l.namespaceURI)l=o2(l),i=c2(l,i);else switch(i){case"svg":i=1;break;case"math":i=2;break;default:i=0}}P(Se),ue(Se,i)}function _e(){P(Se),P(Ne),P(Re)}function Ke(i){i.memoizedState!==null&&ue(Be,i);var l=Se.current,o=c2(l,i.type);l!==o&&(ue(Ne,i),ue(Se,o))}function gt(i){Ne.current===i&&(P(Se),P(Ne)),Be.current===i&&(P(Be),Co._currentValue=he)}var se,de;function ge(i){if(se===void 0)try{throw Error()}catch(o){var l=o.stack.trim().match(/\n( *(at )?)/);se=l&&l[1]||"",de=-1<o.stack.indexOf(`
|
|
2
|
+
at`)?" (<anonymous>)":-1<o.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
+
`+se+i+de}var Te=!1;function Ie(i,l){if(!i||Te)return"";Te=!0;var o=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var u={DetermineComponentFrameRoot:function(){try{if(l){var ve=function(){throw Error()};if(Object.defineProperty(ve.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ve,[])}catch(ce){var re=ce}Reflect.construct(i,[],ve)}else{try{ve.call()}catch(ce){re=ce}i.call(ve.prototype)}}else{try{throw Error()}catch(ce){re=ce}(ve=i())&&typeof ve.catch=="function"&&ve.catch(function(){})}}catch(ce){if(ce&&re&&typeof ce.stack=="string")return[ce.stack,re.stack]}return[null,null]}};u.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var m=Object.getOwnPropertyDescriptor(u.DetermineComponentFrameRoot,"name");m&&m.configurable&&Object.defineProperty(u.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var y=u.DetermineComponentFrameRoot(),w=y[0],N=y[1];if(w&&N){var q=w.split(`
|
|
4
|
+
`),ie=N.split(`
|
|
5
|
+
`);for(m=u=0;u<q.length&&!q[u].includes("DetermineComponentFrameRoot");)u++;for(;m<ie.length&&!ie[m].includes("DetermineComponentFrameRoot");)m++;if(u===q.length||m===ie.length)for(u=q.length-1,m=ie.length-1;1<=u&&0<=m&&q[u]!==ie[m];)m--;for(;1<=u&&0<=m;u--,m--)if(q[u]!==ie[m]){if(u!==1||m!==1)do if(u--,m--,0>m||q[u]!==ie[m]){var me=`
|
|
6
|
+
`+q[u].replace(" at new "," at ");return i.displayName&&me.includes("<anonymous>")&&(me=me.replace("<anonymous>",i.displayName)),me}while(1<=u&&0<=m);break}}}finally{Te=!1,Error.prepareStackTrace=o}return(o=i?i.displayName||i.name:"")?ge(o):""}function Xe(i,l){switch(i.tag){case 26:case 27:case 5:return ge(i.type);case 16:return ge("Lazy");case 13:return i.child!==l&&l!==null?ge("Suspense Fallback"):ge("Suspense");case 19:return ge("SuspenseList");case 0:case 15:return Ie(i.type,!1);case 11:return Ie(i.type.render,!1);case 1:return Ie(i.type,!0);case 31:return ge("Activity");default:return""}}function ht(i){try{var l="",o=null;do l+=Xe(i,o),o=i,i=i.return;while(i);return l}catch(u){return`
|
|
7
|
+
Error generating stack: `+u.message+`
|
|
8
|
+
`+u.stack}}var Pt=Object.prototype.hasOwnProperty,rn=t.unstable_scheduleCallback,sn=t.unstable_cancelCallback,qn=t.unstable_shouldYield,Cn=t.unstable_requestPaint,lt=t.unstable_now,pi=t.unstable_getCurrentPriorityLevel,Mn=t.unstable_ImmediatePriority,Jn=t.unstable_UserBlockingPriority,Tt=t.unstable_NormalPriority,x=t.unstable_LowPriority,V=t.unstable_IdlePriority,pe=t.log,le=t.unstable_setDisableYieldValue,oe=null,k=null;function J(i){if(typeof pe=="function"&&le(i),k&&typeof k.setStrictMode=="function")try{k.setStrictMode(oe,i)}catch{}}var Z=Math.clz32?Math.clz32:Ae,K=Math.log,Q=Math.LN2;function Ae(i){return i>>>=0,i===0?32:31-(K(i)/Q|0)|0}var fe=256,ke=262144,je=4194304;function De(i){var l=i&42;if(l!==0)return l;switch(i&-i){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 i&261888;case 262144:case 524288:case 1048576:case 2097152:return i&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return i&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return i}}function $e(i,l,o){var u=i.pendingLanes;if(u===0)return 0;var m=0,y=i.suspendedLanes,w=i.pingedLanes;i=i.warmLanes;var N=u&134217727;return N!==0?(u=N&~y,u!==0?m=De(u):(w&=N,w!==0?m=De(w):o||(o=N&~i,o!==0&&(m=De(o))))):(N=u&~y,N!==0?m=De(N):w!==0?m=De(w):o||(o=u&~i,o!==0&&(m=De(o)))),m===0?0:l!==0&&l!==m&&(l&y)===0&&(y=m&-m,o=l&-l,y>=o||y===32&&(o&4194048)!==0)?l:m}function ze(i,l){return(i.pendingLanes&~(i.suspendedLanes&~i.pingedLanes)&l)===0}function Je(i,l){switch(i){case 1:case 2:case 4:case 8:case 64:return l+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return l+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Rn(){var i=je;return je<<=1,(je&62914560)===0&&(je=4194304),i}function Dn(i){for(var l=[],o=0;31>o;o++)l.push(i);return l}function Kt(i,l){i.pendingLanes|=l,l!==268435456&&(i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0)}function _i(i,l,o,u,m,y){var w=i.pendingLanes;i.pendingLanes=o,i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0,i.expiredLanes&=o,i.entangledLanes&=o,i.errorRecoveryDisabledLanes&=o,i.shellSuspendCounter=0;var N=i.entanglements,q=i.expirationTimes,ie=i.hiddenUpdates;for(o=w&~o;0<o;){var me=31-Z(o),ve=1<<me;N[me]=0,q[me]=-1;var re=ie[me];if(re!==null)for(ie[me]=null,me=0;me<re.length;me++){var ce=re[me];ce!==null&&(ce.lane&=-536870913)}o&=~ve}u!==0&&or(i,u,0),y!==0&&m===0&&i.tag!==0&&(i.suspendedLanes|=y&~(w&~l))}function or(i,l,o){i.pendingLanes|=l,i.suspendedLanes&=~l;var u=31-Z(l);i.entangledLanes|=l,i.entanglements[u]=i.entanglements[u]|1073741824|o&261930}function Me(i,l){var o=i.entangledLanes|=l;for(i=i.entanglements;o;){var u=31-Z(o),m=1<<u;m&l|i[u]&l&&(i[u]|=l),o&=~m}}function Qe(i,l){var o=l&-l;return o=(o&42)!==0?1:Yt(o),(o&(i.suspendedLanes|l))!==0?0:o}function Yt(i){switch(i){case 2:i=1;break;case 8:i=4;break;case 32:i=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:i=128;break;case 268435456:i=134217728;break;default:i=0}return i}function mi(i){return i&=-i,2<i?8<i?(i&134217727)!==0?32:268435456:8:2}function Li(){var i=ee.p;return i!==0?i:(i=window.event,i===void 0?32:R2(i.type))}function Wr(i,l){var o=ee.p;try{return ee.p=i,l()}finally{ee.p=o}}var Qn=Math.random().toString(36).slice(2),_t="__reactFiber$"+Qn,It="__reactProps$"+Qn,gi="__reactContainer$"+Qn,cr="__reactEvents$"+Qn,yi="__reactListeners$"+Qn,Vc="__reactHandles$"+Qn,Ha="__reactResources$"+Qn,Ji="__reactMarker$"+Qn;function Al(i){delete i[_t],delete i[It],delete i[cr],delete i[yi],delete i[Vc]}function zn(i){var l=i[_t];if(l)return l;for(var o=i.parentNode;o;){if(l=o[gi]||o[_t]){if(o=l.alternate,l.child!==null||o!==null&&o.child!==null)for(i=g2(i);i!==null;){if(o=i[_t])return o;i=g2(i)}return l}i=o,o=i.parentNode}return null}function ur(i){if(i=i[_t]||i[gi]){var l=i.tag;if(l===5||l===6||l===13||l===31||l===26||l===27||l===3)return i}return null}function Bs(i){var l=i.tag;if(l===5||l===26||l===27||l===6)return i.stateNode;throw Error(r(33))}function Zr(i){var l=i[Ha];return l||(l=i[Ha]={hoistableStyles:new Map,hoistableScripts:new Map}),l}function Ut(i){i[Ji]=!0}var H=new Set,ae={};function Ge(i,l){Hn(i,l),Hn(i+"Capture",l)}function Hn(i,l){for(ae[i]=l,i=0;i<l.length;i++)H.add(l[i])}var $s=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]*$"),kl={},Zv={};function C3(i){return Pt.call(Zv,i)?!0:Pt.call(kl,i)?!1:$s.test(i)?Zv[i]=!0:(kl[i]=!0,!1)}function Pc(i,l,o){if(C3(l))if(o===null)i.removeAttribute(l);else{switch(typeof o){case"undefined":case"function":case"symbol":i.removeAttribute(l);return;case"boolean":var u=l.toLowerCase().slice(0,5);if(u!=="data-"&&u!=="aria-"){i.removeAttribute(l);return}}i.setAttribute(l,""+o)}}function Kc(i,l,o){if(o===null)i.removeAttribute(l);else{switch(typeof o){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(l);return}i.setAttribute(l,""+o)}}function dr(i,l,o,u){if(u===null)i.removeAttribute(o);else{switch(typeof u){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(o);return}i.setAttributeNS(l,o,""+u)}}function bi(i){switch(typeof i){case"bigint":case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function e1(i){var l=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(l==="checkbox"||l==="radio")}function N3(i,l,o){var u=Object.getOwnPropertyDescriptor(i.constructor.prototype,l);if(!i.hasOwnProperty(l)&&typeof u<"u"&&typeof u.get=="function"&&typeof u.set=="function"){var m=u.get,y=u.set;return Object.defineProperty(i,l,{configurable:!0,get:function(){return m.call(this)},set:function(w){o=""+w,y.call(this,w)}}),Object.defineProperty(i,l,{enumerable:u.enumerable}),{getValue:function(){return o},setValue:function(w){o=""+w},stopTracking:function(){i._valueTracker=null,delete i[l]}}}}function Uh(i){if(!i._valueTracker){var l=e1(i)?"checked":"value";i._valueTracker=N3(i,l,""+i[l])}}function t1(i){if(!i)return!1;var l=i._valueTracker;if(!l)return!0;var o=l.getValue(),u="";return i&&(u=e1(i)?i.checked?"true":"false":i.value),i=u,i!==o?(l.setValue(i),!0):!1}function Yc(i){if(i=i||(typeof document<"u"?document:void 0),typeof i>"u")return null;try{return i.activeElement||i.body}catch{return i.body}}var T3=/[\n"\\]/g;function xi(i){return i.replace(T3,function(l){return"\\"+l.charCodeAt(0).toString(16)+" "})}function Fh(i,l,o,u,m,y,w,N){i.name="",w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"?i.type=w:i.removeAttribute("type"),l!=null?w==="number"?(l===0&&i.value===""||i.value!=l)&&(i.value=""+bi(l)):i.value!==""+bi(l)&&(i.value=""+bi(l)):w!=="submit"&&w!=="reset"||i.removeAttribute("value"),l!=null?Vh(i,w,bi(l)):o!=null?Vh(i,w,bi(o)):u!=null&&i.removeAttribute("value"),m==null&&y!=null&&(i.defaultChecked=!!y),m!=null&&(i.checked=m&&typeof m!="function"&&typeof m!="symbol"),N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"?i.name=""+bi(N):i.removeAttribute("name")}function n1(i,l,o,u,m,y,w,N){if(y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"&&(i.type=y),l!=null||o!=null){if(!(y!=="submit"&&y!=="reset"||l!=null)){Uh(i);return}o=o!=null?""+bi(o):"",l=l!=null?""+bi(l):o,N||l===i.value||(i.value=l),i.defaultValue=l}u=u??m,u=typeof u!="function"&&typeof u!="symbol"&&!!u,i.checked=N?i.checked:!!u,i.defaultChecked=!!u,w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"&&(i.name=w),Uh(i)}function Vh(i,l,o){l==="number"&&Yc(i.ownerDocument)===i||i.defaultValue===""+o||(i.defaultValue=""+o)}function Cl(i,l,o,u){if(i=i.options,l){l={};for(var m=0;m<o.length;m++)l["$"+o[m]]=!0;for(o=0;o<i.length;o++)m=l.hasOwnProperty("$"+i[o].value),i[o].selected!==m&&(i[o].selected=m),m&&u&&(i[o].defaultSelected=!0)}else{for(o=""+bi(o),l=null,m=0;m<i.length;m++){if(i[m].value===o){i[m].selected=!0,u&&(i[m].defaultSelected=!0);return}l!==null||i[m].disabled||(l=i[m])}l!==null&&(l.selected=!0)}}function i1(i,l,o){if(l!=null&&(l=""+bi(l),l!==i.value&&(i.value=l),o==null)){i.defaultValue!==l&&(i.defaultValue=l);return}i.defaultValue=o!=null?""+bi(o):""}function r1(i,l,o,u){if(l==null){if(u!=null){if(o!=null)throw Error(r(92));if(xe(u)){if(1<u.length)throw Error(r(93));u=u[0]}o=u}o==null&&(o=""),l=o}o=bi(l),i.defaultValue=o,u=i.textContent,u===o&&u!==""&&u!==null&&(i.value=u),Uh(i)}function Nl(i,l){if(l){var o=i.firstChild;if(o&&o===i.lastChild&&o.nodeType===3){o.nodeValue=l;return}}i.textContent=l}var j3=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 s1(i,l,o){var u=l.indexOf("--")===0;o==null||typeof o=="boolean"||o===""?u?i.setProperty(l,""):l==="float"?i.cssFloat="":i[l]="":u?i.setProperty(l,o):typeof o!="number"||o===0||j3.has(l)?l==="float"?i.cssFloat=o:i[l]=(""+o).trim():i[l]=o+"px"}function l1(i,l,o){if(l!=null&&typeof l!="object")throw Error(r(62));if(i=i.style,o!=null){for(var u in o)!o.hasOwnProperty(u)||l!=null&&l.hasOwnProperty(u)||(u.indexOf("--")===0?i.setProperty(u,""):u==="float"?i.cssFloat="":i[u]="");for(var m in l)u=l[m],l.hasOwnProperty(m)&&o[m]!==u&&s1(i,m,u)}else for(var y in l)l.hasOwnProperty(y)&&s1(i,y,l[y])}function Ph(i){if(i.indexOf("-")===-1)return!1;switch(i){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 E3=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"]]),O3=/^[\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 Gc(i){return O3.test(""+i)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":i}function fr(){}var Kh=null;function Yh(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var Tl=null,jl=null;function a1(i){var l=ur(i);if(l&&(i=l.stateNode)){var o=i[It]||null;e:switch(i=l.stateNode,l.type){case"input":if(Fh(i,o.value,o.defaultValue,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name),l=o.name,o.type==="radio"&&l!=null){for(o=i;o.parentNode;)o=o.parentNode;for(o=o.querySelectorAll('input[name="'+xi(""+l)+'"][type="radio"]'),l=0;l<o.length;l++){var u=o[l];if(u!==i&&u.form===i.form){var m=u[It]||null;if(!m)throw Error(r(90));Fh(u,m.value,m.defaultValue,m.defaultValue,m.checked,m.defaultChecked,m.type,m.name)}}for(l=0;l<o.length;l++)u=o[l],u.form===i.form&&t1(u)}break e;case"textarea":i1(i,o.value,o.defaultValue);break e;case"select":l=o.value,l!=null&&Cl(i,!!o.multiple,l,!1)}}}var Gh=!1;function o1(i,l,o){if(Gh)return i(l,o);Gh=!0;try{var u=i(l);return u}finally{if(Gh=!1,(Tl!==null||jl!==null)&&(Lu(),Tl&&(l=Tl,i=jl,jl=Tl=null,a1(l),i)))for(l=0;l<i.length;l++)a1(i[l])}}function Ia(i,l){var o=i.stateNode;if(o===null)return null;var u=o[It]||null;if(u===null)return null;o=u[l];e:switch(l){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(u=!u.disabled)||(i=i.type,u=!(i==="button"||i==="input"||i==="select"||i==="textarea")),i=!u;break e;default:i=!1}if(i)return null;if(o&&typeof o!="function")throw Error(r(231,l,typeof o));return o}var hr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Xh=!1;if(hr)try{var Ua={};Object.defineProperty(Ua,"passive",{get:function(){Xh=!0}}),window.addEventListener("test",Ua,Ua),window.removeEventListener("test",Ua,Ua)}catch{Xh=!1}var es=null,Jh=null,Xc=null;function c1(){if(Xc)return Xc;var i,l=Jh,o=l.length,u,m="value"in es?es.value:es.textContent,y=m.length;for(i=0;i<o&&l[i]===m[i];i++);var w=o-i;for(u=1;u<=w&&l[o-u]===m[y-u];u++);return Xc=m.slice(i,1<u?1-u:void 0)}function Jc(i){var l=i.keyCode;return"charCode"in i?(i=i.charCode,i===0&&l===13&&(i=13)):i=l,i===10&&(i=13),32<=i||i===13?i:0}function Qc(){return!0}function u1(){return!1}function In(i){function l(o,u,m,y,w){this._reactName=o,this._targetInst=m,this.type=u,this.nativeEvent=y,this.target=w,this.currentTarget=null;for(var N in i)i.hasOwnProperty(N)&&(o=i[N],this[N]=o?o(y):y[N]);return this.isDefaultPrevented=(y.defaultPrevented!=null?y.defaultPrevented:y.returnValue===!1)?Qc:u1,this.isPropagationStopped=u1,this}return b(l.prototype,{preventDefault:function(){this.defaultPrevented=!0;var o=this.nativeEvent;o&&(o.preventDefault?o.preventDefault():typeof o.returnValue!="unknown"&&(o.returnValue=!1),this.isDefaultPrevented=Qc)},stopPropagation:function(){var o=this.nativeEvent;o&&(o.stopPropagation?o.stopPropagation():typeof o.cancelBubble!="unknown"&&(o.cancelBubble=!0),this.isPropagationStopped=Qc)},persist:function(){},isPersistent:Qc}),l}var qs={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(i){return i.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Wc=In(qs),Fa=b({},qs,{view:0,detail:0}),M3=In(Fa),Qh,Wh,Va,Zc=b({},Fa,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ep,button:0,buttons:0,relatedTarget:function(i){return i.relatedTarget===void 0?i.fromElement===i.srcElement?i.toElement:i.fromElement:i.relatedTarget},movementX:function(i){return"movementX"in i?i.movementX:(i!==Va&&(Va&&i.type==="mousemove"?(Qh=i.screenX-Va.screenX,Wh=i.screenY-Va.screenY):Wh=Qh=0,Va=i),Qh)},movementY:function(i){return"movementY"in i?i.movementY:Wh}}),d1=In(Zc),R3=b({},Zc,{dataTransfer:0}),D3=In(R3),_3=b({},Fa,{relatedTarget:0}),Zh=In(_3),L3=b({},qs,{animationName:0,elapsedTime:0,pseudoElement:0}),B3=In(L3),$3=b({},qs,{clipboardData:function(i){return"clipboardData"in i?i.clipboardData:window.clipboardData}}),q3=In($3),z3=b({},qs,{data:0}),f1=In(z3),H3={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},I3={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"},U3={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function F3(i){var l=this.nativeEvent;return l.getModifierState?l.getModifierState(i):(i=U3[i])?!!l[i]:!1}function ep(){return F3}var V3=b({},Fa,{key:function(i){if(i.key){var l=H3[i.key]||i.key;if(l!=="Unidentified")return l}return i.type==="keypress"?(i=Jc(i),i===13?"Enter":String.fromCharCode(i)):i.type==="keydown"||i.type==="keyup"?I3[i.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ep,charCode:function(i){return i.type==="keypress"?Jc(i):0},keyCode:function(i){return i.type==="keydown"||i.type==="keyup"?i.keyCode:0},which:function(i){return i.type==="keypress"?Jc(i):i.type==="keydown"||i.type==="keyup"?i.keyCode:0}}),P3=In(V3),K3=b({},Zc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),h1=In(K3),Y3=b({},Fa,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ep}),G3=In(Y3),X3=b({},qs,{propertyName:0,elapsedTime:0,pseudoElement:0}),J3=In(X3),Q3=b({},Zc,{deltaX:function(i){return"deltaX"in i?i.deltaX:"wheelDeltaX"in i?-i.wheelDeltaX:0},deltaY:function(i){return"deltaY"in i?i.deltaY:"wheelDeltaY"in i?-i.wheelDeltaY:"wheelDelta"in i?-i.wheelDelta:0},deltaZ:0,deltaMode:0}),W3=In(Q3),Z3=b({},qs,{newState:0,oldState:0}),eM=In(Z3),tM=[9,13,27,32],tp=hr&&"CompositionEvent"in window,Pa=null;hr&&"documentMode"in document&&(Pa=document.documentMode);var nM=hr&&"TextEvent"in window&&!Pa,p1=hr&&(!tp||Pa&&8<Pa&&11>=Pa),m1=" ",g1=!1;function y1(i,l){switch(i){case"keyup":return tM.indexOf(l.keyCode)!==-1;case"keydown":return l.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function b1(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var El=!1;function iM(i,l){switch(i){case"compositionend":return b1(l);case"keypress":return l.which!==32?null:(g1=!0,m1);case"textInput":return i=l.data,i===m1&&g1?null:i;default:return null}}function rM(i,l){if(El)return i==="compositionend"||!tp&&y1(i,l)?(i=c1(),Xc=Jh=es=null,El=!1,i):null;switch(i){case"paste":return null;case"keypress":if(!(l.ctrlKey||l.altKey||l.metaKey)||l.ctrlKey&&l.altKey){if(l.char&&1<l.char.length)return l.char;if(l.which)return String.fromCharCode(l.which)}return null;case"compositionend":return p1&&l.locale!=="ko"?null:l.data;default:return null}}var sM={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 x1(i){var l=i&&i.nodeName&&i.nodeName.toLowerCase();return l==="input"?!!sM[i.type]:l==="textarea"}function v1(i,l,o,u){Tl?jl?jl.push(u):jl=[u]:Tl=u,l=Uu(l,"onChange"),0<l.length&&(o=new Wc("onChange","change",null,o,u),i.push({event:o,listeners:l}))}var Ka=null,Ya=null;function lM(i){n2(i,0)}function eu(i){var l=Bs(i);if(t1(l))return i}function w1(i,l){if(i==="change")return l}var S1=!1;if(hr){var np;if(hr){var ip="oninput"in document;if(!ip){var A1=document.createElement("div");A1.setAttribute("oninput","return;"),ip=typeof A1.oninput=="function"}np=ip}else np=!1;S1=np&&(!document.documentMode||9<document.documentMode)}function k1(){Ka&&(Ka.detachEvent("onpropertychange",C1),Ya=Ka=null)}function C1(i){if(i.propertyName==="value"&&eu(Ya)){var l=[];v1(l,Ya,i,Yh(i)),o1(lM,l)}}function aM(i,l,o){i==="focusin"?(k1(),Ka=l,Ya=o,Ka.attachEvent("onpropertychange",C1)):i==="focusout"&&k1()}function oM(i){if(i==="selectionchange"||i==="keyup"||i==="keydown")return eu(Ya)}function cM(i,l){if(i==="click")return eu(l)}function uM(i,l){if(i==="input"||i==="change")return eu(l)}function dM(i,l){return i===l&&(i!==0||1/i===1/l)||i!==i&&l!==l}var Wn=typeof Object.is=="function"?Object.is:dM;function Ga(i,l){if(Wn(i,l))return!0;if(typeof i!="object"||i===null||typeof l!="object"||l===null)return!1;var o=Object.keys(i),u=Object.keys(l);if(o.length!==u.length)return!1;for(u=0;u<o.length;u++){var m=o[u];if(!Pt.call(l,m)||!Wn(i[m],l[m]))return!1}return!0}function N1(i){for(;i&&i.firstChild;)i=i.firstChild;return i}function T1(i,l){var o=N1(i);i=0;for(var u;o;){if(o.nodeType===3){if(u=i+o.textContent.length,i<=l&&u>=l)return{node:o,offset:l-i};i=u}e:{for(;o;){if(o.nextSibling){o=o.nextSibling;break e}o=o.parentNode}o=void 0}o=N1(o)}}function j1(i,l){return i&&l?i===l?!0:i&&i.nodeType===3?!1:l&&l.nodeType===3?j1(i,l.parentNode):"contains"in i?i.contains(l):i.compareDocumentPosition?!!(i.compareDocumentPosition(l)&16):!1:!1}function E1(i){i=i!=null&&i.ownerDocument!=null&&i.ownerDocument.defaultView!=null?i.ownerDocument.defaultView:window;for(var l=Yc(i.document);l instanceof i.HTMLIFrameElement;){try{var o=typeof l.contentWindow.location.href=="string"}catch{o=!1}if(o)i=l.contentWindow;else break;l=Yc(i.document)}return l}function rp(i){var l=i&&i.nodeName&&i.nodeName.toLowerCase();return l&&(l==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||l==="textarea"||i.contentEditable==="true")}var fM=hr&&"documentMode"in document&&11>=document.documentMode,Ol=null,sp=null,Xa=null,lp=!1;function O1(i,l,o){var u=o.window===o?o.document:o.nodeType===9?o:o.ownerDocument;lp||Ol==null||Ol!==Yc(u)||(u=Ol,"selectionStart"in u&&rp(u)?u={start:u.selectionStart,end:u.selectionEnd}:(u=(u.ownerDocument&&u.ownerDocument.defaultView||window).getSelection(),u={anchorNode:u.anchorNode,anchorOffset:u.anchorOffset,focusNode:u.focusNode,focusOffset:u.focusOffset}),Xa&&Ga(Xa,u)||(Xa=u,u=Uu(sp,"onSelect"),0<u.length&&(l=new Wc("onSelect","select",null,l,o),i.push({event:l,listeners:u}),l.target=Ol)))}function zs(i,l){var o={};return o[i.toLowerCase()]=l.toLowerCase(),o["Webkit"+i]="webkit"+l,o["Moz"+i]="moz"+l,o}var Ml={animationend:zs("Animation","AnimationEnd"),animationiteration:zs("Animation","AnimationIteration"),animationstart:zs("Animation","AnimationStart"),transitionrun:zs("Transition","TransitionRun"),transitionstart:zs("Transition","TransitionStart"),transitioncancel:zs("Transition","TransitionCancel"),transitionend:zs("Transition","TransitionEnd")},ap={},M1={};hr&&(M1=document.createElement("div").style,"AnimationEvent"in window||(delete Ml.animationend.animation,delete Ml.animationiteration.animation,delete Ml.animationstart.animation),"TransitionEvent"in window||delete Ml.transitionend.transition);function Hs(i){if(ap[i])return ap[i];if(!Ml[i])return i;var l=Ml[i],o;for(o in l)if(l.hasOwnProperty(o)&&o in M1)return ap[i]=l[o];return i}var R1=Hs("animationend"),D1=Hs("animationiteration"),_1=Hs("animationstart"),hM=Hs("transitionrun"),pM=Hs("transitionstart"),mM=Hs("transitioncancel"),L1=Hs("transitionend"),B1=new Map,op="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(" ");op.push("scrollEnd");function Bi(i,l){B1.set(i,l),Ge(l,[i])}var tu=typeof reportError=="function"?reportError:function(i){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var l=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof i=="object"&&i!==null&&typeof i.message=="string"?String(i.message):String(i),error:i});if(!window.dispatchEvent(l))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",i);return}console.error(i)},vi=[],Rl=0,cp=0;function nu(){for(var i=Rl,l=cp=Rl=0;l<i;){var o=vi[l];vi[l++]=null;var u=vi[l];vi[l++]=null;var m=vi[l];vi[l++]=null;var y=vi[l];if(vi[l++]=null,u!==null&&m!==null){var w=u.pending;w===null?m.next=m:(m.next=w.next,w.next=m),u.pending=m}y!==0&&$1(o,m,y)}}function iu(i,l,o,u){vi[Rl++]=i,vi[Rl++]=l,vi[Rl++]=o,vi[Rl++]=u,cp|=u,i.lanes|=u,i=i.alternate,i!==null&&(i.lanes|=u)}function up(i,l,o,u){return iu(i,l,o,u),ru(i)}function Is(i,l){return iu(i,null,null,l),ru(i)}function $1(i,l,o){i.lanes|=o;var u=i.alternate;u!==null&&(u.lanes|=o);for(var m=!1,y=i.return;y!==null;)y.childLanes|=o,u=y.alternate,u!==null&&(u.childLanes|=o),y.tag===22&&(i=y.stateNode,i===null||i._visibility&1||(m=!0)),i=y,y=y.return;return i.tag===3?(y=i.stateNode,m&&l!==null&&(m=31-Z(o),i=y.hiddenUpdates,u=i[m],u===null?i[m]=[l]:u.push(l),l.lane=o|536870912),y):null}function ru(i){if(50<bo)throw bo=0,xm=null,Error(r(185));for(var l=i.return;l!==null;)i=l,l=i.return;return i.tag===3?i.stateNode:null}var Dl={};function gM(i,l,o,u){this.tag=i,this.key=o,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=l,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=u,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Zn(i,l,o,u){return new gM(i,l,o,u)}function dp(i){return i=i.prototype,!(!i||!i.isReactComponent)}function pr(i,l){var o=i.alternate;return o===null?(o=Zn(i.tag,l,i.key,i.mode),o.elementType=i.elementType,o.type=i.type,o.stateNode=i.stateNode,o.alternate=i,i.alternate=o):(o.pendingProps=l,o.type=i.type,o.flags=0,o.subtreeFlags=0,o.deletions=null),o.flags=i.flags&65011712,o.childLanes=i.childLanes,o.lanes=i.lanes,o.child=i.child,o.memoizedProps=i.memoizedProps,o.memoizedState=i.memoizedState,o.updateQueue=i.updateQueue,l=i.dependencies,o.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext},o.sibling=i.sibling,o.index=i.index,o.ref=i.ref,o.refCleanup=i.refCleanup,o}function q1(i,l){i.flags&=65011714;var o=i.alternate;return o===null?(i.childLanes=0,i.lanes=l,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=o.childLanes,i.lanes=o.lanes,i.child=o.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=o.memoizedProps,i.memoizedState=o.memoizedState,i.updateQueue=o.updateQueue,i.type=o.type,l=o.dependencies,i.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext}),i}function su(i,l,o,u,m,y){var w=0;if(u=i,typeof i=="function")dp(i)&&(w=1);else if(typeof i=="string")w=wR(i,o,Se.current)?26:i==="html"||i==="head"||i==="body"?27:5;else e:switch(i){case F:return i=Zn(31,o,l,m),i.elementType=F,i.lanes=y,i;case C:return Us(o.children,m,y,l);case T:w=8,m|=24;break;case D:return i=Zn(12,o,l,m|2),i.elementType=D,i.lanes=y,i;case R:return i=Zn(13,o,l,m),i.elementType=R,i.lanes=y,i;case B:return i=Zn(19,o,l,m),i.elementType=B,i.lanes=y,i;default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case E:w=10;break e;case j:w=9;break e;case O:w=11;break e;case M:w=14;break e;case z:w=16,u=null;break e}w=29,o=Error(r(130,i===null?"null":typeof i,"")),u=null}return l=Zn(w,o,l,m),l.elementType=i,l.type=u,l.lanes=y,l}function Us(i,l,o,u){return i=Zn(7,i,u,l),i.lanes=o,i}function fp(i,l,o){return i=Zn(6,i,null,l),i.lanes=o,i}function z1(i){var l=Zn(18,null,null,0);return l.stateNode=i,l}function hp(i,l,o){return l=Zn(4,i.children!==null?i.children:[],i.key,l),l.lanes=o,l.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},l}var H1=new WeakMap;function wi(i,l){if(typeof i=="object"&&i!==null){var o=H1.get(i);return o!==void 0?o:(l={value:i,source:l,stack:ht(l)},H1.set(i,l),l)}return{value:i,source:l,stack:ht(l)}}var _l=[],Ll=0,lu=null,Ja=0,Si=[],Ai=0,ts=null,Qi=1,Wi="";function mr(i,l){_l[Ll++]=Ja,_l[Ll++]=lu,lu=i,Ja=l}function I1(i,l,o){Si[Ai++]=Qi,Si[Ai++]=Wi,Si[Ai++]=ts,ts=i;var u=Qi;i=Wi;var m=32-Z(u)-1;u&=~(1<<m),o+=1;var y=32-Z(l)+m;if(30<y){var w=m-m%5;y=(u&(1<<w)-1).toString(32),u>>=w,m-=w,Qi=1<<32-Z(l)+m|o<<m|u,Wi=y+i}else Qi=1<<y|o<<m|u,Wi=i}function pp(i){i.return!==null&&(mr(i,1),I1(i,1,0))}function mp(i){for(;i===lu;)lu=_l[--Ll],_l[Ll]=null,Ja=_l[--Ll],_l[Ll]=null;for(;i===ts;)ts=Si[--Ai],Si[Ai]=null,Wi=Si[--Ai],Si[Ai]=null,Qi=Si[--Ai],Si[Ai]=null}function U1(i,l){Si[Ai++]=Qi,Si[Ai++]=Wi,Si[Ai++]=ts,Qi=l.id,Wi=l.overflow,ts=i}var mn=null,Ot=null,dt=!1,ns=null,ki=!1,gp=Error(r(519));function is(i){var l=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Qa(wi(l,i)),gp}function F1(i){var l=i.stateNode,o=i.type,u=i.memoizedProps;switch(l[_t]=i,l[It]=u,o){case"dialog":ot("cancel",l),ot("close",l);break;case"iframe":case"object":case"embed":ot("load",l);break;case"video":case"audio":for(o=0;o<vo.length;o++)ot(vo[o],l);break;case"source":ot("error",l);break;case"img":case"image":case"link":ot("error",l),ot("load",l);break;case"details":ot("toggle",l);break;case"input":ot("invalid",l),n1(l,u.value,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name,!0);break;case"select":ot("invalid",l);break;case"textarea":ot("invalid",l),r1(l,u.value,u.defaultValue,u.children)}o=u.children,typeof o!="string"&&typeof o!="number"&&typeof o!="bigint"||l.textContent===""+o||u.suppressHydrationWarning===!0||l2(l.textContent,o)?(u.popover!=null&&(ot("beforetoggle",l),ot("toggle",l)),u.onScroll!=null&&ot("scroll",l),u.onScrollEnd!=null&&ot("scrollend",l),u.onClick!=null&&(l.onclick=fr),l=!0):l=!1,l||is(i,!0)}function V1(i){for(mn=i.return;mn;)switch(mn.tag){case 5:case 31:case 13:ki=!1;return;case 27:case 3:ki=!0;return;default:mn=mn.return}}function Bl(i){if(i!==mn)return!1;if(!dt)return V1(i),dt=!0,!1;var l=i.tag,o;if((o=l!==3&&l!==27)&&((o=l===5)&&(o=i.type,o=!(o!=="form"&&o!=="button")||_m(i.type,i.memoizedProps)),o=!o),o&&Ot&&is(i),V1(i),l===13){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));Ot=m2(i)}else if(l===31){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));Ot=m2(i)}else l===27?(l=Ot,ys(i.type)?(i=zm,zm=null,Ot=i):Ot=l):Ot=mn?Ni(i.stateNode.nextSibling):null;return!0}function Fs(){Ot=mn=null,dt=!1}function yp(){var i=ns;return i!==null&&(Pn===null?Pn=i:Pn.push.apply(Pn,i),ns=null),i}function Qa(i){ns===null?ns=[i]:ns.push(i)}var bp=L(null),Vs=null,gr=null;function rs(i,l,o){ue(bp,l._currentValue),l._currentValue=o}function yr(i){i._currentValue=bp.current,P(bp)}function xp(i,l,o){for(;i!==null;){var u=i.alternate;if((i.childLanes&l)!==l?(i.childLanes|=l,u!==null&&(u.childLanes|=l)):u!==null&&(u.childLanes&l)!==l&&(u.childLanes|=l),i===o)break;i=i.return}}function vp(i,l,o,u){var m=i.child;for(m!==null&&(m.return=i);m!==null;){var y=m.dependencies;if(y!==null){var w=m.child;y=y.firstContext;e:for(;y!==null;){var N=y;y=m;for(var q=0;q<l.length;q++)if(N.context===l[q]){y.lanes|=o,N=y.alternate,N!==null&&(N.lanes|=o),xp(y.return,o,i),u||(w=null);break e}y=N.next}}else if(m.tag===18){if(w=m.return,w===null)throw Error(r(341));w.lanes|=o,y=w.alternate,y!==null&&(y.lanes|=o),xp(w,o,i),w=null}else w=m.child;if(w!==null)w.return=m;else for(w=m;w!==null;){if(w===i){w=null;break}if(m=w.sibling,m!==null){m.return=w.return,w=m;break}w=w.return}m=w}}function $l(i,l,o,u){i=null;for(var m=l,y=!1;m!==null;){if(!y){if((m.flags&524288)!==0)y=!0;else if((m.flags&262144)!==0)break}if(m.tag===10){var w=m.alternate;if(w===null)throw Error(r(387));if(w=w.memoizedProps,w!==null){var N=m.type;Wn(m.pendingProps.value,w.value)||(i!==null?i.push(N):i=[N])}}else if(m===Be.current){if(w=m.alternate,w===null)throw Error(r(387));w.memoizedState.memoizedState!==m.memoizedState.memoizedState&&(i!==null?i.push(Co):i=[Co])}m=m.return}i!==null&&vp(l,i,o,u),l.flags|=262144}function au(i){for(i=i.firstContext;i!==null;){if(!Wn(i.context._currentValue,i.memoizedValue))return!0;i=i.next}return!1}function Ps(i){Vs=i,gr=null,i=i.dependencies,i!==null&&(i.firstContext=null)}function gn(i){return P1(Vs,i)}function ou(i,l){return Vs===null&&Ps(i),P1(i,l)}function P1(i,l){var o=l._currentValue;if(l={context:l,memoizedValue:o,next:null},gr===null){if(i===null)throw Error(r(308));gr=l,i.dependencies={lanes:0,firstContext:l},i.flags|=524288}else gr=gr.next=l;return o}var yM=typeof AbortController<"u"?AbortController:function(){var i=[],l=this.signal={aborted:!1,addEventListener:function(o,u){i.push(u)}};this.abort=function(){l.aborted=!0,i.forEach(function(o){return o()})}},bM=t.unstable_scheduleCallback,xM=t.unstable_NormalPriority,Gt={$$typeof:E,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function wp(){return{controller:new yM,data:new Map,refCount:0}}function Wa(i){i.refCount--,i.refCount===0&&bM(xM,function(){i.controller.abort()})}var Za=null,Sp=0,ql=0,zl=null;function vM(i,l){if(Za===null){var o=Za=[];Sp=0,ql=Cm(),zl={status:"pending",value:void 0,then:function(u){o.push(u)}}}return Sp++,l.then(K1,K1),l}function K1(){if(--Sp===0&&Za!==null){zl!==null&&(zl.status="fulfilled");var i=Za;Za=null,ql=0,zl=null;for(var l=0;l<i.length;l++)(0,i[l])()}}function wM(i,l){var o=[],u={status:"pending",value:null,reason:null,then:function(m){o.push(m)}};return i.then(function(){u.status="fulfilled",u.value=l;for(var m=0;m<o.length;m++)(0,o[m])(l)},function(m){for(u.status="rejected",u.reason=m,m=0;m<o.length;m++)(0,o[m])(void 0)}),u}var Y1=_.S;_.S=function(i,l){OS=lt(),typeof l=="object"&&l!==null&&typeof l.then=="function"&&vM(i,l),Y1!==null&&Y1(i,l)};var Ks=L(null);function Ap(){var i=Ks.current;return i!==null?i:jt.pooledCache}function cu(i,l){l===null?ue(Ks,Ks.current):ue(Ks,l.pool)}function G1(){var i=Ap();return i===null?null:{parent:Gt._currentValue,pool:i}}var Hl=Error(r(460)),kp=Error(r(474)),uu=Error(r(542)),du={then:function(){}};function X1(i){return i=i.status,i==="fulfilled"||i==="rejected"}function J1(i,l,o){switch(o=i[o],o===void 0?i.push(l):o!==l&&(l.then(fr,fr),l=o),l.status){case"fulfilled":return l.value;case"rejected":throw i=l.reason,W1(i),i;default:if(typeof l.status=="string")l.then(fr,fr);else{if(i=jt,i!==null&&100<i.shellSuspendCounter)throw Error(r(482));i=l,i.status="pending",i.then(function(u){if(l.status==="pending"){var m=l;m.status="fulfilled",m.value=u}},function(u){if(l.status==="pending"){var m=l;m.status="rejected",m.reason=u}})}switch(l.status){case"fulfilled":return l.value;case"rejected":throw i=l.reason,W1(i),i}throw Gs=l,Hl}}function Ys(i){try{var l=i._init;return l(i._payload)}catch(o){throw o!==null&&typeof o=="object"&&typeof o.then=="function"?(Gs=o,Hl):o}}var Gs=null;function Q1(){if(Gs===null)throw Error(r(459));var i=Gs;return Gs=null,i}function W1(i){if(i===Hl||i===uu)throw Error(r(483))}var Il=null,eo=0;function fu(i){var l=eo;return eo+=1,Il===null&&(Il=[]),J1(Il,i,l)}function to(i,l){l=l.props.ref,i.ref=l!==void 0?l:null}function hu(i,l){throw l.$$typeof===v?Error(r(525)):(i=Object.prototype.toString.call(l),Error(r(31,i==="[object Object]"?"object with keys {"+Object.keys(l).join(", ")+"}":i)))}function Z1(i){function l(Y,U){if(i){var ne=Y.deletions;ne===null?(Y.deletions=[U],Y.flags|=16):ne.push(U)}}function o(Y,U){if(!i)return null;for(;U!==null;)l(Y,U),U=U.sibling;return null}function u(Y){for(var U=new Map;Y!==null;)Y.key!==null?U.set(Y.key,Y):U.set(Y.index,Y),Y=Y.sibling;return U}function m(Y,U){return Y=pr(Y,U),Y.index=0,Y.sibling=null,Y}function y(Y,U,ne){return Y.index=ne,i?(ne=Y.alternate,ne!==null?(ne=ne.index,ne<U?(Y.flags|=67108866,U):ne):(Y.flags|=67108866,U)):(Y.flags|=1048576,U)}function w(Y){return i&&Y.alternate===null&&(Y.flags|=67108866),Y}function N(Y,U,ne,be){return U===null||U.tag!==6?(U=fp(ne,Y.mode,be),U.return=Y,U):(U=m(U,ne),U.return=Y,U)}function q(Y,U,ne,be){var Ue=ne.type;return Ue===C?me(Y,U,ne.props.children,be,ne.key):U!==null&&(U.elementType===Ue||typeof Ue=="object"&&Ue!==null&&Ue.$$typeof===z&&Ys(Ue)===U.type)?(U=m(U,ne.props),to(U,ne),U.return=Y,U):(U=su(ne.type,ne.key,ne.props,null,Y.mode,be),to(U,ne),U.return=Y,U)}function ie(Y,U,ne,be){return U===null||U.tag!==4||U.stateNode.containerInfo!==ne.containerInfo||U.stateNode.implementation!==ne.implementation?(U=hp(ne,Y.mode,be),U.return=Y,U):(U=m(U,ne.children||[]),U.return=Y,U)}function me(Y,U,ne,be,Ue){return U===null||U.tag!==7?(U=Us(ne,Y.mode,be,Ue),U.return=Y,U):(U=m(U,ne),U.return=Y,U)}function ve(Y,U,ne){if(typeof U=="string"&&U!==""||typeof U=="number"||typeof U=="bigint")return U=fp(""+U,Y.mode,ne),U.return=Y,U;if(typeof U=="object"&&U!==null){switch(U.$$typeof){case S:return ne=su(U.type,U.key,U.props,null,Y.mode,ne),to(ne,U),ne.return=Y,ne;case A:return U=hp(U,Y.mode,ne),U.return=Y,U;case z:return U=Ys(U),ve(Y,U,ne)}if(xe(U)||G(U))return U=Us(U,Y.mode,ne,null),U.return=Y,U;if(typeof U.then=="function")return ve(Y,fu(U),ne);if(U.$$typeof===E)return ve(Y,ou(Y,U),ne);hu(Y,U)}return null}function re(Y,U,ne,be){var Ue=U!==null?U.key:null;if(typeof ne=="string"&&ne!==""||typeof ne=="number"||typeof ne=="bigint")return Ue!==null?null:N(Y,U,""+ne,be);if(typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case S:return ne.key===Ue?q(Y,U,ne,be):null;case A:return ne.key===Ue?ie(Y,U,ne,be):null;case z:return ne=Ys(ne),re(Y,U,ne,be)}if(xe(ne)||G(ne))return Ue!==null?null:me(Y,U,ne,be,null);if(typeof ne.then=="function")return re(Y,U,fu(ne),be);if(ne.$$typeof===E)return re(Y,U,ou(Y,ne),be);hu(Y,ne)}return null}function ce(Y,U,ne,be,Ue){if(typeof be=="string"&&be!==""||typeof be=="number"||typeof be=="bigint")return Y=Y.get(ne)||null,N(U,Y,""+be,Ue);if(typeof be=="object"&&be!==null){switch(be.$$typeof){case S:return Y=Y.get(be.key===null?ne:be.key)||null,q(U,Y,be,Ue);case A:return Y=Y.get(be.key===null?ne:be.key)||null,ie(U,Y,be,Ue);case z:return be=Ys(be),ce(Y,U,ne,be,Ue)}if(xe(be)||G(be))return Y=Y.get(ne)||null,me(U,Y,be,Ue,null);if(typeof be.then=="function")return ce(Y,U,ne,fu(be),Ue);if(be.$$typeof===E)return ce(Y,U,ne,ou(U,be),Ue);hu(U,be)}return null}function Le(Y,U,ne,be){for(var Ue=null,yt=null,qe=U,nt=U=0,ut=null;qe!==null&&nt<ne.length;nt++){qe.index>nt?(ut=qe,qe=null):ut=qe.sibling;var bt=re(Y,qe,ne[nt],be);if(bt===null){qe===null&&(qe=ut);break}i&&qe&&bt.alternate===null&&l(Y,qe),U=y(bt,U,nt),yt===null?Ue=bt:yt.sibling=bt,yt=bt,qe=ut}if(nt===ne.length)return o(Y,qe),dt&&mr(Y,nt),Ue;if(qe===null){for(;nt<ne.length;nt++)qe=ve(Y,ne[nt],be),qe!==null&&(U=y(qe,U,nt),yt===null?Ue=qe:yt.sibling=qe,yt=qe);return dt&&mr(Y,nt),Ue}for(qe=u(qe);nt<ne.length;nt++)ut=ce(qe,Y,nt,ne[nt],be),ut!==null&&(i&&ut.alternate!==null&&qe.delete(ut.key===null?nt:ut.key),U=y(ut,U,nt),yt===null?Ue=ut:yt.sibling=ut,yt=ut);return i&&qe.forEach(function(Ss){return l(Y,Ss)}),dt&&mr(Y,nt),Ue}function Ve(Y,U,ne,be){if(ne==null)throw Error(r(151));for(var Ue=null,yt=null,qe=U,nt=U=0,ut=null,bt=ne.next();qe!==null&&!bt.done;nt++,bt=ne.next()){qe.index>nt?(ut=qe,qe=null):ut=qe.sibling;var Ss=re(Y,qe,bt.value,be);if(Ss===null){qe===null&&(qe=ut);break}i&&qe&&Ss.alternate===null&&l(Y,qe),U=y(Ss,U,nt),yt===null?Ue=Ss:yt.sibling=Ss,yt=Ss,qe=ut}if(bt.done)return o(Y,qe),dt&&mr(Y,nt),Ue;if(qe===null){for(;!bt.done;nt++,bt=ne.next())bt=ve(Y,bt.value,be),bt!==null&&(U=y(bt,U,nt),yt===null?Ue=bt:yt.sibling=bt,yt=bt);return dt&&mr(Y,nt),Ue}for(qe=u(qe);!bt.done;nt++,bt=ne.next())bt=ce(qe,Y,nt,bt.value,be),bt!==null&&(i&&bt.alternate!==null&&qe.delete(bt.key===null?nt:bt.key),U=y(bt,U,nt),yt===null?Ue=bt:yt.sibling=bt,yt=bt);return i&&qe.forEach(function(RR){return l(Y,RR)}),dt&&mr(Y,nt),Ue}function Ct(Y,U,ne,be){if(typeof ne=="object"&&ne!==null&&ne.type===C&&ne.key===null&&(ne=ne.props.children),typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case S:e:{for(var Ue=ne.key;U!==null;){if(U.key===Ue){if(Ue=ne.type,Ue===C){if(U.tag===7){o(Y,U.sibling),be=m(U,ne.props.children),be.return=Y,Y=be;break e}}else if(U.elementType===Ue||typeof Ue=="object"&&Ue!==null&&Ue.$$typeof===z&&Ys(Ue)===U.type){o(Y,U.sibling),be=m(U,ne.props),to(be,ne),be.return=Y,Y=be;break e}o(Y,U);break}else l(Y,U);U=U.sibling}ne.type===C?(be=Us(ne.props.children,Y.mode,be,ne.key),be.return=Y,Y=be):(be=su(ne.type,ne.key,ne.props,null,Y.mode,be),to(be,ne),be.return=Y,Y=be)}return w(Y);case A:e:{for(Ue=ne.key;U!==null;){if(U.key===Ue)if(U.tag===4&&U.stateNode.containerInfo===ne.containerInfo&&U.stateNode.implementation===ne.implementation){o(Y,U.sibling),be=m(U,ne.children||[]),be.return=Y,Y=be;break e}else{o(Y,U);break}else l(Y,U);U=U.sibling}be=hp(ne,Y.mode,be),be.return=Y,Y=be}return w(Y);case z:return ne=Ys(ne),Ct(Y,U,ne,be)}if(xe(ne))return Le(Y,U,ne,be);if(G(ne)){if(Ue=G(ne),typeof Ue!="function")throw Error(r(150));return ne=Ue.call(ne),Ve(Y,U,ne,be)}if(typeof ne.then=="function")return Ct(Y,U,fu(ne),be);if(ne.$$typeof===E)return Ct(Y,U,ou(Y,ne),be);hu(Y,ne)}return typeof ne=="string"&&ne!==""||typeof ne=="number"||typeof ne=="bigint"?(ne=""+ne,U!==null&&U.tag===6?(o(Y,U.sibling),be=m(U,ne),be.return=Y,Y=be):(o(Y,U),be=fp(ne,Y.mode,be),be.return=Y,Y=be),w(Y)):o(Y,U)}return function(Y,U,ne,be){try{eo=0;var Ue=Ct(Y,U,ne,be);return Il=null,Ue}catch(qe){if(qe===Hl||qe===uu)throw qe;var yt=Zn(29,qe,null,Y.mode);return yt.lanes=be,yt.return=Y,yt}}}var Xs=Z1(!0),ew=Z1(!1),ss=!1;function Cp(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Np(i,l){i=i.updateQueue,l.updateQueue===i&&(l.updateQueue={baseState:i.baseState,firstBaseUpdate:i.firstBaseUpdate,lastBaseUpdate:i.lastBaseUpdate,shared:i.shared,callbacks:null})}function ls(i){return{lane:i,tag:0,payload:null,callback:null,next:null}}function as(i,l,o){var u=i.updateQueue;if(u===null)return null;if(u=u.shared,(xt&2)!==0){var m=u.pending;return m===null?l.next=l:(l.next=m.next,m.next=l),u.pending=l,l=ru(i),$1(i,null,o),l}return iu(i,u,l,o),ru(i)}function no(i,l,o){if(l=l.updateQueue,l!==null&&(l=l.shared,(o&4194048)!==0)){var u=l.lanes;u&=i.pendingLanes,o|=u,l.lanes=o,Me(i,o)}}function Tp(i,l){var o=i.updateQueue,u=i.alternate;if(u!==null&&(u=u.updateQueue,o===u)){var m=null,y=null;if(o=o.firstBaseUpdate,o!==null){do{var w={lane:o.lane,tag:o.tag,payload:o.payload,callback:null,next:null};y===null?m=y=w:y=y.next=w,o=o.next}while(o!==null);y===null?m=y=l:y=y.next=l}else m=y=l;o={baseState:u.baseState,firstBaseUpdate:m,lastBaseUpdate:y,shared:u.shared,callbacks:u.callbacks},i.updateQueue=o;return}i=o.lastBaseUpdate,i===null?o.firstBaseUpdate=l:i.next=l,o.lastBaseUpdate=l}var jp=!1;function io(){if(jp){var i=zl;if(i!==null)throw i}}function ro(i,l,o,u){jp=!1;var m=i.updateQueue;ss=!1;var y=m.firstBaseUpdate,w=m.lastBaseUpdate,N=m.shared.pending;if(N!==null){m.shared.pending=null;var q=N,ie=q.next;q.next=null,w===null?y=ie:w.next=ie,w=q;var me=i.alternate;me!==null&&(me=me.updateQueue,N=me.lastBaseUpdate,N!==w&&(N===null?me.firstBaseUpdate=ie:N.next=ie,me.lastBaseUpdate=q))}if(y!==null){var ve=m.baseState;w=0,me=ie=q=null,N=y;do{var re=N.lane&-536870913,ce=re!==N.lane;if(ce?(ct&re)===re:(u&re)===re){re!==0&&re===ql&&(jp=!0),me!==null&&(me=me.next={lane:0,tag:N.tag,payload:N.payload,callback:null,next:null});e:{var Le=i,Ve=N;re=l;var Ct=o;switch(Ve.tag){case 1:if(Le=Ve.payload,typeof Le=="function"){ve=Le.call(Ct,ve,re);break e}ve=Le;break e;case 3:Le.flags=Le.flags&-65537|128;case 0:if(Le=Ve.payload,re=typeof Le=="function"?Le.call(Ct,ve,re):Le,re==null)break e;ve=b({},ve,re);break e;case 2:ss=!0}}re=N.callback,re!==null&&(i.flags|=64,ce&&(i.flags|=8192),ce=m.callbacks,ce===null?m.callbacks=[re]:ce.push(re))}else ce={lane:re,tag:N.tag,payload:N.payload,callback:N.callback,next:null},me===null?(ie=me=ce,q=ve):me=me.next=ce,w|=re;if(N=N.next,N===null){if(N=m.shared.pending,N===null)break;ce=N,N=ce.next,ce.next=null,m.lastBaseUpdate=ce,m.shared.pending=null}}while(!0);me===null&&(q=ve),m.baseState=q,m.firstBaseUpdate=ie,m.lastBaseUpdate=me,y===null&&(m.shared.lanes=0),fs|=w,i.lanes=w,i.memoizedState=ve}}function tw(i,l){if(typeof i!="function")throw Error(r(191,i));i.call(l)}function nw(i,l){var o=i.callbacks;if(o!==null)for(i.callbacks=null,i=0;i<o.length;i++)tw(o[i],l)}var Ul=L(null),pu=L(0);function iw(i,l){i=Nr,ue(pu,i),ue(Ul,l),Nr=i|l.baseLanes}function Ep(){ue(pu,Nr),ue(Ul,Ul.current)}function Op(){Nr=pu.current,P(Ul),P(pu)}var ei=L(null),Ci=null;function os(i){var l=i.alternate;ue(Ft,Ft.current&1),ue(ei,i),Ci===null&&(l===null||Ul.current!==null||l.memoizedState!==null)&&(Ci=i)}function Mp(i){ue(Ft,Ft.current),ue(ei,i),Ci===null&&(Ci=i)}function rw(i){i.tag===22?(ue(Ft,Ft.current),ue(ei,i),Ci===null&&(Ci=i)):cs()}function cs(){ue(Ft,Ft.current),ue(ei,ei.current)}function ti(i){P(ei),Ci===i&&(Ci=null),P(Ft)}var Ft=L(0);function mu(i){for(var l=i;l!==null;){if(l.tag===13){var o=l.memoizedState;if(o!==null&&(o=o.dehydrated,o===null||$m(o)||qm(o)))return l}else if(l.tag===19&&(l.memoizedProps.revealOrder==="forwards"||l.memoizedProps.revealOrder==="backwards"||l.memoizedProps.revealOrder==="unstable_legacy-backwards"||l.memoizedProps.revealOrder==="together")){if((l.flags&128)!==0)return l}else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===i)break;for(;l.sibling===null;){if(l.return===null||l.return===i)return null;l=l.return}l.sibling.return=l.return,l=l.sibling}return null}var br=0,tt=null,At=null,Xt=null,gu=!1,Fl=!1,Js=!1,yu=0,so=0,Vl=null,SM=0;function Bt(){throw Error(r(321))}function Rp(i,l){if(l===null)return!1;for(var o=0;o<l.length&&o<i.length;o++)if(!Wn(i[o],l[o]))return!1;return!0}function Dp(i,l,o,u,m,y){return br=y,tt=l,l.memoizedState=null,l.updateQueue=null,l.lanes=0,_.H=i===null||i.memoizedState===null?Iw:Gp,Js=!1,y=o(u,m),Js=!1,Fl&&(y=lw(l,o,u,m)),sw(i),y}function sw(i){_.H=oo;var l=At!==null&&At.next!==null;if(br=0,Xt=At=tt=null,gu=!1,so=0,Vl=null,l)throw Error(r(300));i===null||Jt||(i=i.dependencies,i!==null&&au(i)&&(Jt=!0))}function lw(i,l,o,u){tt=i;var m=0;do{if(Fl&&(Vl=null),so=0,Fl=!1,25<=m)throw Error(r(301));if(m+=1,Xt=At=null,i.updateQueue!=null){var y=i.updateQueue;y.lastEffect=null,y.events=null,y.stores=null,y.memoCache!=null&&(y.memoCache.index=0)}_.H=Uw,y=l(o,u)}while(Fl);return y}function AM(){var i=_.H,l=i.useState()[0];return l=typeof l.then=="function"?lo(l):l,i=i.useState()[0],(At!==null?At.memoizedState:null)!==i&&(tt.flags|=1024),l}function _p(){var i=yu!==0;return yu=0,i}function Lp(i,l,o){l.updateQueue=i.updateQueue,l.flags&=-2053,i.lanes&=~o}function Bp(i){if(gu){for(i=i.memoizedState;i!==null;){var l=i.queue;l!==null&&(l.pending=null),i=i.next}gu=!1}br=0,Xt=At=tt=null,Fl=!1,so=yu=0,Vl=null}function _n(){var i={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Xt===null?tt.memoizedState=Xt=i:Xt=Xt.next=i,Xt}function Vt(){if(At===null){var i=tt.alternate;i=i!==null?i.memoizedState:null}else i=At.next;var l=Xt===null?tt.memoizedState:Xt.next;if(l!==null)Xt=l,At=i;else{if(i===null)throw tt.alternate===null?Error(r(467)):Error(r(310));At=i,i={memoizedState:At.memoizedState,baseState:At.baseState,baseQueue:At.baseQueue,queue:At.queue,next:null},Xt===null?tt.memoizedState=Xt=i:Xt=Xt.next=i}return Xt}function bu(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function lo(i){var l=so;return so+=1,Vl===null&&(Vl=[]),i=J1(Vl,i,l),l=tt,(Xt===null?l.memoizedState:Xt.next)===null&&(l=l.alternate,_.H=l===null||l.memoizedState===null?Iw:Gp),i}function xu(i){if(i!==null&&typeof i=="object"){if(typeof i.then=="function")return lo(i);if(i.$$typeof===E)return gn(i)}throw Error(r(438,String(i)))}function $p(i){var l=null,o=tt.updateQueue;if(o!==null&&(l=o.memoCache),l==null){var u=tt.alternate;u!==null&&(u=u.updateQueue,u!==null&&(u=u.memoCache,u!=null&&(l={data:u.data.map(function(m){return m.slice()}),index:0})))}if(l==null&&(l={data:[],index:0}),o===null&&(o=bu(),tt.updateQueue=o),o.memoCache=l,o=l.data[l.index],o===void 0)for(o=l.data[l.index]=Array(i),u=0;u<i;u++)o[u]=X;return l.index++,o}function xr(i,l){return typeof l=="function"?l(i):l}function vu(i){var l=Vt();return qp(l,At,i)}function qp(i,l,o){var u=i.queue;if(u===null)throw Error(r(311));u.lastRenderedReducer=o;var m=i.baseQueue,y=u.pending;if(y!==null){if(m!==null){var w=m.next;m.next=y.next,y.next=w}l.baseQueue=m=y,u.pending=null}if(y=i.baseState,m===null)i.memoizedState=y;else{l=m.next;var N=w=null,q=null,ie=l,me=!1;do{var ve=ie.lane&-536870913;if(ve!==ie.lane?(ct&ve)===ve:(br&ve)===ve){var re=ie.revertLane;if(re===0)q!==null&&(q=q.next={lane:0,revertLane:0,gesture:null,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null}),ve===ql&&(me=!0);else if((br&re)===re){ie=ie.next,re===ql&&(me=!0);continue}else ve={lane:0,revertLane:ie.revertLane,gesture:null,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null},q===null?(N=q=ve,w=y):q=q.next=ve,tt.lanes|=re,fs|=re;ve=ie.action,Js&&o(y,ve),y=ie.hasEagerState?ie.eagerState:o(y,ve)}else re={lane:ve,revertLane:ie.revertLane,gesture:ie.gesture,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null},q===null?(N=q=re,w=y):q=q.next=re,tt.lanes|=ve,fs|=ve;ie=ie.next}while(ie!==null&&ie!==l);if(q===null?w=y:q.next=N,!Wn(y,i.memoizedState)&&(Jt=!0,me&&(o=zl,o!==null)))throw o;i.memoizedState=y,i.baseState=w,i.baseQueue=q,u.lastRenderedState=y}return m===null&&(u.lanes=0),[i.memoizedState,u.dispatch]}function zp(i){var l=Vt(),o=l.queue;if(o===null)throw Error(r(311));o.lastRenderedReducer=i;var u=o.dispatch,m=o.pending,y=l.memoizedState;if(m!==null){o.pending=null;var w=m=m.next;do y=i(y,w.action),w=w.next;while(w!==m);Wn(y,l.memoizedState)||(Jt=!0),l.memoizedState=y,l.baseQueue===null&&(l.baseState=y),o.lastRenderedState=y}return[y,u]}function aw(i,l,o){var u=tt,m=Vt(),y=dt;if(y){if(o===void 0)throw Error(r(407));o=o()}else o=l();var w=!Wn((At||m).memoizedState,o);if(w&&(m.memoizedState=o,Jt=!0),m=m.queue,Up(uw.bind(null,u,m,i),[i]),m.getSnapshot!==l||w||Xt!==null&&Xt.memoizedState.tag&1){if(u.flags|=2048,Pl(9,{destroy:void 0},cw.bind(null,u,m,o,l),null),jt===null)throw Error(r(349));y||(br&127)!==0||ow(u,l,o)}return o}function ow(i,l,o){i.flags|=16384,i={getSnapshot:l,value:o},l=tt.updateQueue,l===null?(l=bu(),tt.updateQueue=l,l.stores=[i]):(o=l.stores,o===null?l.stores=[i]:o.push(i))}function cw(i,l,o,u){l.value=o,l.getSnapshot=u,dw(l)&&fw(i)}function uw(i,l,o){return o(function(){dw(l)&&fw(i)})}function dw(i){var l=i.getSnapshot;i=i.value;try{var o=l();return!Wn(i,o)}catch{return!0}}function fw(i){var l=Is(i,2);l!==null&&Kn(l,i,2)}function Hp(i){var l=_n();if(typeof i=="function"){var o=i;if(i=o(),Js){J(!0);try{o()}finally{J(!1)}}}return l.memoizedState=l.baseState=i,l.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:xr,lastRenderedState:i},l}function hw(i,l,o,u){return i.baseState=o,qp(i,At,typeof u=="function"?u:xr)}function kM(i,l,o,u,m){if(Au(i))throw Error(r(485));if(i=l.action,i!==null){var y={payload:m,action:i,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(w){y.listeners.push(w)}};_.T!==null?o(!0):y.isTransition=!1,u(y),o=l.pending,o===null?(y.next=l.pending=y,pw(l,y)):(y.next=o.next,l.pending=o.next=y)}}function pw(i,l){var o=l.action,u=l.payload,m=i.state;if(l.isTransition){var y=_.T,w={};_.T=w;try{var N=o(m,u),q=_.S;q!==null&&q(w,N),mw(i,l,N)}catch(ie){Ip(i,l,ie)}finally{y!==null&&w.types!==null&&(y.types=w.types),_.T=y}}else try{y=o(m,u),mw(i,l,y)}catch(ie){Ip(i,l,ie)}}function mw(i,l,o){o!==null&&typeof o=="object"&&typeof o.then=="function"?o.then(function(u){gw(i,l,u)},function(u){return Ip(i,l,u)}):gw(i,l,o)}function gw(i,l,o){l.status="fulfilled",l.value=o,yw(l),i.state=o,l=i.pending,l!==null&&(o=l.next,o===l?i.pending=null:(o=o.next,l.next=o,pw(i,o)))}function Ip(i,l,o){var u=i.pending;if(i.pending=null,u!==null){u=u.next;do l.status="rejected",l.reason=o,yw(l),l=l.next;while(l!==u)}i.action=null}function yw(i){i=i.listeners;for(var l=0;l<i.length;l++)(0,i[l])()}function bw(i,l){return l}function xw(i,l){if(dt){var o=jt.formState;if(o!==null){e:{var u=tt;if(dt){if(Ot){t:{for(var m=Ot,y=ki;m.nodeType!==8;){if(!y){m=null;break t}if(m=Ni(m.nextSibling),m===null){m=null;break t}}y=m.data,m=y==="F!"||y==="F"?m:null}if(m){Ot=Ni(m.nextSibling),u=m.data==="F!";break e}}is(u)}u=!1}u&&(l=o[0])}}return o=_n(),o.memoizedState=o.baseState=l,u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:bw,lastRenderedState:l},o.queue=u,o=qw.bind(null,tt,u),u.dispatch=o,u=Hp(!1),y=Yp.bind(null,tt,!1,u.queue),u=_n(),m={state:l,dispatch:null,action:i,pending:null},u.queue=m,o=kM.bind(null,tt,m,y,o),m.dispatch=o,u.memoizedState=i,[l,o,!1]}function vw(i){var l=Vt();return ww(l,At,i)}function ww(i,l,o){if(l=qp(i,l,bw)[0],i=vu(xr)[0],typeof l=="object"&&l!==null&&typeof l.then=="function")try{var u=lo(l)}catch(w){throw w===Hl?uu:w}else u=l;l=Vt();var m=l.queue,y=m.dispatch;return o!==l.memoizedState&&(tt.flags|=2048,Pl(9,{destroy:void 0},CM.bind(null,m,o),null)),[u,y,i]}function CM(i,l){i.action=l}function Sw(i){var l=Vt(),o=At;if(o!==null)return ww(l,o,i);Vt(),l=l.memoizedState,o=Vt();var u=o.queue.dispatch;return o.memoizedState=i,[l,u,!1]}function Pl(i,l,o,u){return i={tag:i,create:o,deps:u,inst:l,next:null},l=tt.updateQueue,l===null&&(l=bu(),tt.updateQueue=l),o=l.lastEffect,o===null?l.lastEffect=i.next=i:(u=o.next,o.next=i,i.next=u,l.lastEffect=i),i}function Aw(){return Vt().memoizedState}function wu(i,l,o,u){var m=_n();tt.flags|=i,m.memoizedState=Pl(1|l,{destroy:void 0},o,u===void 0?null:u)}function Su(i,l,o,u){var m=Vt();u=u===void 0?null:u;var y=m.memoizedState.inst;At!==null&&u!==null&&Rp(u,At.memoizedState.deps)?m.memoizedState=Pl(l,y,o,u):(tt.flags|=i,m.memoizedState=Pl(1|l,y,o,u))}function kw(i,l){wu(8390656,8,i,l)}function Up(i,l){Su(2048,8,i,l)}function NM(i){tt.flags|=4;var l=tt.updateQueue;if(l===null)l=bu(),tt.updateQueue=l,l.events=[i];else{var o=l.events;o===null?l.events=[i]:o.push(i)}}function Cw(i){var l=Vt().memoizedState;return NM({ref:l,nextImpl:i}),function(){if((xt&2)!==0)throw Error(r(440));return l.impl.apply(void 0,arguments)}}function Nw(i,l){return Su(4,2,i,l)}function Tw(i,l){return Su(4,4,i,l)}function jw(i,l){if(typeof l=="function"){i=i();var o=l(i);return function(){typeof o=="function"?o():l(null)}}if(l!=null)return i=i(),l.current=i,function(){l.current=null}}function Ew(i,l,o){o=o!=null?o.concat([i]):null,Su(4,4,jw.bind(null,l,i),o)}function Fp(){}function Ow(i,l){var o=Vt();l=l===void 0?null:l;var u=o.memoizedState;return l!==null&&Rp(l,u[1])?u[0]:(o.memoizedState=[i,l],i)}function Mw(i,l){var o=Vt();l=l===void 0?null:l;var u=o.memoizedState;if(l!==null&&Rp(l,u[1]))return u[0];if(u=i(),Js){J(!0);try{i()}finally{J(!1)}}return o.memoizedState=[u,l],u}function Vp(i,l,o){return o===void 0||(br&1073741824)!==0&&(ct&261930)===0?i.memoizedState=l:(i.memoizedState=o,i=RS(),tt.lanes|=i,fs|=i,o)}function Rw(i,l,o,u){return Wn(o,l)?o:Ul.current!==null?(i=Vp(i,o,u),Wn(i,l)||(Jt=!0),i):(br&42)===0||(br&1073741824)!==0&&(ct&261930)===0?(Jt=!0,i.memoizedState=o):(i=RS(),tt.lanes|=i,fs|=i,l)}function Dw(i,l,o,u,m){var y=ee.p;ee.p=y!==0&&8>y?y:8;var w=_.T,N={};_.T=N,Yp(i,!1,l,o);try{var q=m(),ie=_.S;if(ie!==null&&ie(N,q),q!==null&&typeof q=="object"&&typeof q.then=="function"){var me=wM(q,u);ao(i,l,me,ri(i))}else ao(i,l,u,ri(i))}catch(ve){ao(i,l,{then:function(){},status:"rejected",reason:ve},ri())}finally{ee.p=y,w!==null&&N.types!==null&&(w.types=N.types),_.T=w}}function TM(){}function Pp(i,l,o,u){if(i.tag!==5)throw Error(r(476));var m=_w(i).queue;Dw(i,m,l,he,o===null?TM:function(){return Lw(i),o(u)})}function _w(i){var l=i.memoizedState;if(l!==null)return l;l={memoizedState:he,baseState:he,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:xr,lastRenderedState:he},next:null};var o={};return l.next={memoizedState:o,baseState:o,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:xr,lastRenderedState:o},next:null},i.memoizedState=l,i=i.alternate,i!==null&&(i.memoizedState=l),l}function Lw(i){var l=_w(i);l.next===null&&(l=i.alternate.memoizedState),ao(i,l.next.queue,{},ri())}function Kp(){return gn(Co)}function Bw(){return Vt().memoizedState}function $w(){return Vt().memoizedState}function jM(i){for(var l=i.return;l!==null;){switch(l.tag){case 24:case 3:var o=ri();i=ls(o);var u=as(l,i,o);u!==null&&(Kn(u,l,o),no(u,l,o)),l={cache:wp()},i.payload=l;return}l=l.return}}function EM(i,l,o){var u=ri();o={lane:u,revertLane:0,gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},Au(i)?zw(l,o):(o=up(i,l,o,u),o!==null&&(Kn(o,i,u),Hw(o,l,u)))}function qw(i,l,o){var u=ri();ao(i,l,o,u)}function ao(i,l,o,u){var m={lane:u,revertLane:0,gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null};if(Au(i))zw(l,m);else{var y=i.alternate;if(i.lanes===0&&(y===null||y.lanes===0)&&(y=l.lastRenderedReducer,y!==null))try{var w=l.lastRenderedState,N=y(w,o);if(m.hasEagerState=!0,m.eagerState=N,Wn(N,w))return iu(i,l,m,0),jt===null&&nu(),!1}catch{}if(o=up(i,l,m,u),o!==null)return Kn(o,i,u),Hw(o,l,u),!0}return!1}function Yp(i,l,o,u){if(u={lane:2,revertLane:Cm(),gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},Au(i)){if(l)throw Error(r(479))}else l=up(i,o,u,2),l!==null&&Kn(l,i,2)}function Au(i){var l=i.alternate;return i===tt||l!==null&&l===tt}function zw(i,l){Fl=gu=!0;var o=i.pending;o===null?l.next=l:(l.next=o.next,o.next=l),i.pending=l}function Hw(i,l,o){if((o&4194048)!==0){var u=l.lanes;u&=i.pendingLanes,o|=u,l.lanes=o,Me(i,o)}}var oo={readContext:gn,use:xu,useCallback:Bt,useContext:Bt,useEffect:Bt,useImperativeHandle:Bt,useLayoutEffect:Bt,useInsertionEffect:Bt,useMemo:Bt,useReducer:Bt,useRef:Bt,useState:Bt,useDebugValue:Bt,useDeferredValue:Bt,useTransition:Bt,useSyncExternalStore:Bt,useId:Bt,useHostTransitionStatus:Bt,useFormState:Bt,useActionState:Bt,useOptimistic:Bt,useMemoCache:Bt,useCacheRefresh:Bt};oo.useEffectEvent=Bt;var Iw={readContext:gn,use:xu,useCallback:function(i,l){return _n().memoizedState=[i,l===void 0?null:l],i},useContext:gn,useEffect:kw,useImperativeHandle:function(i,l,o){o=o!=null?o.concat([i]):null,wu(4194308,4,jw.bind(null,l,i),o)},useLayoutEffect:function(i,l){return wu(4194308,4,i,l)},useInsertionEffect:function(i,l){wu(4,2,i,l)},useMemo:function(i,l){var o=_n();l=l===void 0?null:l;var u=i();if(Js){J(!0);try{i()}finally{J(!1)}}return o.memoizedState=[u,l],u},useReducer:function(i,l,o){var u=_n();if(o!==void 0){var m=o(l);if(Js){J(!0);try{o(l)}finally{J(!1)}}}else m=l;return u.memoizedState=u.baseState=m,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:m},u.queue=i,i=i.dispatch=EM.bind(null,tt,i),[u.memoizedState,i]},useRef:function(i){var l=_n();return i={current:i},l.memoizedState=i},useState:function(i){i=Hp(i);var l=i.queue,o=qw.bind(null,tt,l);return l.dispatch=o,[i.memoizedState,o]},useDebugValue:Fp,useDeferredValue:function(i,l){var o=_n();return Vp(o,i,l)},useTransition:function(){var i=Hp(!1);return i=Dw.bind(null,tt,i.queue,!0,!1),_n().memoizedState=i,[!1,i]},useSyncExternalStore:function(i,l,o){var u=tt,m=_n();if(dt){if(o===void 0)throw Error(r(407));o=o()}else{if(o=l(),jt===null)throw Error(r(349));(ct&127)!==0||ow(u,l,o)}m.memoizedState=o;var y={value:o,getSnapshot:l};return m.queue=y,kw(uw.bind(null,u,y,i),[i]),u.flags|=2048,Pl(9,{destroy:void 0},cw.bind(null,u,y,o,l),null),o},useId:function(){var i=_n(),l=jt.identifierPrefix;if(dt){var o=Wi,u=Qi;o=(u&~(1<<32-Z(u)-1)).toString(32)+o,l="_"+l+"R_"+o,o=yu++,0<o&&(l+="H"+o.toString(32)),l+="_"}else o=SM++,l="_"+l+"r_"+o.toString(32)+"_";return i.memoizedState=l},useHostTransitionStatus:Kp,useFormState:xw,useActionState:xw,useOptimistic:function(i){var l=_n();l.memoizedState=l.baseState=i;var o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return l.queue=o,l=Yp.bind(null,tt,!0,o),o.dispatch=l,[i,l]},useMemoCache:$p,useCacheRefresh:function(){return _n().memoizedState=jM.bind(null,tt)},useEffectEvent:function(i){var l=_n(),o={impl:i};return l.memoizedState=o,function(){if((xt&2)!==0)throw Error(r(440));return o.impl.apply(void 0,arguments)}}},Gp={readContext:gn,use:xu,useCallback:Ow,useContext:gn,useEffect:Up,useImperativeHandle:Ew,useInsertionEffect:Nw,useLayoutEffect:Tw,useMemo:Mw,useReducer:vu,useRef:Aw,useState:function(){return vu(xr)},useDebugValue:Fp,useDeferredValue:function(i,l){var o=Vt();return Rw(o,At.memoizedState,i,l)},useTransition:function(){var i=vu(xr)[0],l=Vt().memoizedState;return[typeof i=="boolean"?i:lo(i),l]},useSyncExternalStore:aw,useId:Bw,useHostTransitionStatus:Kp,useFormState:vw,useActionState:vw,useOptimistic:function(i,l){var o=Vt();return hw(o,At,i,l)},useMemoCache:$p,useCacheRefresh:$w};Gp.useEffectEvent=Cw;var Uw={readContext:gn,use:xu,useCallback:Ow,useContext:gn,useEffect:Up,useImperativeHandle:Ew,useInsertionEffect:Nw,useLayoutEffect:Tw,useMemo:Mw,useReducer:zp,useRef:Aw,useState:function(){return zp(xr)},useDebugValue:Fp,useDeferredValue:function(i,l){var o=Vt();return At===null?Vp(o,i,l):Rw(o,At.memoizedState,i,l)},useTransition:function(){var i=zp(xr)[0],l=Vt().memoizedState;return[typeof i=="boolean"?i:lo(i),l]},useSyncExternalStore:aw,useId:Bw,useHostTransitionStatus:Kp,useFormState:Sw,useActionState:Sw,useOptimistic:function(i,l){var o=Vt();return At!==null?hw(o,At,i,l):(o.baseState=i,[i,o.queue.dispatch])},useMemoCache:$p,useCacheRefresh:$w};Uw.useEffectEvent=Cw;function Xp(i,l,o,u){l=i.memoizedState,o=o(u,l),o=o==null?l:b({},l,o),i.memoizedState=o,i.lanes===0&&(i.updateQueue.baseState=o)}var Jp={enqueueSetState:function(i,l,o){i=i._reactInternals;var u=ri(),m=ls(u);m.payload=l,o!=null&&(m.callback=o),l=as(i,m,u),l!==null&&(Kn(l,i,u),no(l,i,u))},enqueueReplaceState:function(i,l,o){i=i._reactInternals;var u=ri(),m=ls(u);m.tag=1,m.payload=l,o!=null&&(m.callback=o),l=as(i,m,u),l!==null&&(Kn(l,i,u),no(l,i,u))},enqueueForceUpdate:function(i,l){i=i._reactInternals;var o=ri(),u=ls(o);u.tag=2,l!=null&&(u.callback=l),l=as(i,u,o),l!==null&&(Kn(l,i,o),no(l,i,o))}};function Fw(i,l,o,u,m,y,w){return i=i.stateNode,typeof i.shouldComponentUpdate=="function"?i.shouldComponentUpdate(u,y,w):l.prototype&&l.prototype.isPureReactComponent?!Ga(o,u)||!Ga(m,y):!0}function Vw(i,l,o,u){i=l.state,typeof l.componentWillReceiveProps=="function"&&l.componentWillReceiveProps(o,u),typeof l.UNSAFE_componentWillReceiveProps=="function"&&l.UNSAFE_componentWillReceiveProps(o,u),l.state!==i&&Jp.enqueueReplaceState(l,l.state,null)}function Qs(i,l){var o=l;if("ref"in l){o={};for(var u in l)u!=="ref"&&(o[u]=l[u])}if(i=i.defaultProps){o===l&&(o=b({},o));for(var m in i)o[m]===void 0&&(o[m]=i[m])}return o}function Pw(i){tu(i)}function Kw(i){console.error(i)}function Yw(i){tu(i)}function ku(i,l){try{var o=i.onUncaughtError;o(l.value,{componentStack:l.stack})}catch(u){setTimeout(function(){throw u})}}function Gw(i,l,o){try{var u=i.onCaughtError;u(o.value,{componentStack:o.stack,errorBoundary:l.tag===1?l.stateNode:null})}catch(m){setTimeout(function(){throw m})}}function Qp(i,l,o){return o=ls(o),o.tag=3,o.payload={element:null},o.callback=function(){ku(i,l)},o}function Xw(i){return i=ls(i),i.tag=3,i}function Jw(i,l,o,u){var m=o.type.getDerivedStateFromError;if(typeof m=="function"){var y=u.value;i.payload=function(){return m(y)},i.callback=function(){Gw(l,o,u)}}var w=o.stateNode;w!==null&&typeof w.componentDidCatch=="function"&&(i.callback=function(){Gw(l,o,u),typeof m!="function"&&(hs===null?hs=new Set([this]):hs.add(this));var N=u.stack;this.componentDidCatch(u.value,{componentStack:N!==null?N:""})})}function OM(i,l,o,u,m){if(o.flags|=32768,u!==null&&typeof u=="object"&&typeof u.then=="function"){if(l=o.alternate,l!==null&&$l(l,o,m,!0),o=ei.current,o!==null){switch(o.tag){case 31:case 13:return Ci===null?Bu():o.alternate===null&&$t===0&&($t=3),o.flags&=-257,o.flags|=65536,o.lanes=m,u===du?o.flags|=16384:(l=o.updateQueue,l===null?o.updateQueue=new Set([u]):l.add(u),Sm(i,u,m)),!1;case 22:return o.flags|=65536,u===du?o.flags|=16384:(l=o.updateQueue,l===null?(l={transitions:null,markerInstances:null,retryQueue:new Set([u])},o.updateQueue=l):(o=l.retryQueue,o===null?l.retryQueue=new Set([u]):o.add(u)),Sm(i,u,m)),!1}throw Error(r(435,o.tag))}return Sm(i,u,m),Bu(),!1}if(dt)return l=ei.current,l!==null?((l.flags&65536)===0&&(l.flags|=256),l.flags|=65536,l.lanes=m,u!==gp&&(i=Error(r(422),{cause:u}),Qa(wi(i,o)))):(u!==gp&&(l=Error(r(423),{cause:u}),Qa(wi(l,o))),i=i.current.alternate,i.flags|=65536,m&=-m,i.lanes|=m,u=wi(u,o),m=Qp(i.stateNode,u,m),Tp(i,m),$t!==4&&($t=2)),!1;var y=Error(r(520),{cause:u});if(y=wi(y,o),yo===null?yo=[y]:yo.push(y),$t!==4&&($t=2),l===null)return!0;u=wi(u,o),o=l;do{switch(o.tag){case 3:return o.flags|=65536,i=m&-m,o.lanes|=i,i=Qp(o.stateNode,u,i),Tp(o,i),!1;case 1:if(l=o.type,y=o.stateNode,(o.flags&128)===0&&(typeof l.getDerivedStateFromError=="function"||y!==null&&typeof y.componentDidCatch=="function"&&(hs===null||!hs.has(y))))return o.flags|=65536,m&=-m,o.lanes|=m,m=Xw(m),Jw(m,i,o,u),Tp(o,m),!1}o=o.return}while(o!==null);return!1}var Wp=Error(r(461)),Jt=!1;function yn(i,l,o,u){l.child=i===null?ew(l,null,o,u):Xs(l,i.child,o,u)}function Qw(i,l,o,u,m){o=o.render;var y=l.ref;if("ref"in u){var w={};for(var N in u)N!=="ref"&&(w[N]=u[N])}else w=u;return Ps(l),u=Dp(i,l,o,w,y,m),N=_p(),i!==null&&!Jt?(Lp(i,l,m),vr(i,l,m)):(dt&&N&&pp(l),l.flags|=1,yn(i,l,u,m),l.child)}function Ww(i,l,o,u,m){if(i===null){var y=o.type;return typeof y=="function"&&!dp(y)&&y.defaultProps===void 0&&o.compare===null?(l.tag=15,l.type=y,Zw(i,l,y,u,m)):(i=su(o.type,null,u,l,l.mode,m),i.ref=l.ref,i.return=l,l.child=i)}if(y=i.child,!lm(i,m)){var w=y.memoizedProps;if(o=o.compare,o=o!==null?o:Ga,o(w,u)&&i.ref===l.ref)return vr(i,l,m)}return l.flags|=1,i=pr(y,u),i.ref=l.ref,i.return=l,l.child=i}function Zw(i,l,o,u,m){if(i!==null){var y=i.memoizedProps;if(Ga(y,u)&&i.ref===l.ref)if(Jt=!1,l.pendingProps=u=y,lm(i,m))(i.flags&131072)!==0&&(Jt=!0);else return l.lanes=i.lanes,vr(i,l,m)}return Zp(i,l,o,u,m)}function eS(i,l,o,u){var m=u.children,y=i!==null?i.memoizedState:null;if(i===null&&l.stateNode===null&&(l.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),u.mode==="hidden"){if((l.flags&128)!==0){if(y=y!==null?y.baseLanes|o:o,i!==null){for(u=l.child=i.child,m=0;u!==null;)m=m|u.lanes|u.childLanes,u=u.sibling;u=m&~y}else u=0,l.child=null;return tS(i,l,y,o,u)}if((o&536870912)!==0)l.memoizedState={baseLanes:0,cachePool:null},i!==null&&cu(l,y!==null?y.cachePool:null),y!==null?iw(l,y):Ep(),rw(l);else return u=l.lanes=536870912,tS(i,l,y!==null?y.baseLanes|o:o,o,u)}else y!==null?(cu(l,y.cachePool),iw(l,y),cs(),l.memoizedState=null):(i!==null&&cu(l,null),Ep(),cs());return yn(i,l,m,o),l.child}function co(i,l){return i!==null&&i.tag===22||l.stateNode!==null||(l.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.sibling}function tS(i,l,o,u,m){var y=Ap();return y=y===null?null:{parent:Gt._currentValue,pool:y},l.memoizedState={baseLanes:o,cachePool:y},i!==null&&cu(l,null),Ep(),rw(l),i!==null&&$l(i,l,u,!0),l.childLanes=m,null}function Cu(i,l){return l=Tu({mode:l.mode,children:l.children},i.mode),l.ref=i.ref,i.child=l,l.return=i,l}function nS(i,l,o){return Xs(l,i.child,null,o),i=Cu(l,l.pendingProps),i.flags|=2,ti(l),l.memoizedState=null,i}function MM(i,l,o){var u=l.pendingProps,m=(l.flags&128)!==0;if(l.flags&=-129,i===null){if(dt){if(u.mode==="hidden")return i=Cu(l,u),l.lanes=536870912,co(null,i);if(Mp(l),(i=Ot)?(i=p2(i,ki),i=i!==null&&i.data==="&"?i:null,i!==null&&(l.memoizedState={dehydrated:i,treeContext:ts!==null?{id:Qi,overflow:Wi}:null,retryLane:536870912,hydrationErrors:null},o=z1(i),o.return=l,l.child=o,mn=l,Ot=null)):i=null,i===null)throw is(l);return l.lanes=536870912,null}return Cu(l,u)}var y=i.memoizedState;if(y!==null){var w=y.dehydrated;if(Mp(l),m)if(l.flags&256)l.flags&=-257,l=nS(i,l,o);else if(l.memoizedState!==null)l.child=i.child,l.flags|=128,l=null;else throw Error(r(558));else if(Jt||$l(i,l,o,!1),m=(o&i.childLanes)!==0,Jt||m){if(u=jt,u!==null&&(w=Qe(u,o),w!==0&&w!==y.retryLane))throw y.retryLane=w,Is(i,w),Kn(u,i,w),Wp;Bu(),l=nS(i,l,o)}else i=y.treeContext,Ot=Ni(w.nextSibling),mn=l,dt=!0,ns=null,ki=!1,i!==null&&U1(l,i),l=Cu(l,u),l.flags|=4096;return l}return i=pr(i.child,{mode:u.mode,children:u.children}),i.ref=l.ref,l.child=i,i.return=l,i}function Nu(i,l){var o=l.ref;if(o===null)i!==null&&i.ref!==null&&(l.flags|=4194816);else{if(typeof o!="function"&&typeof o!="object")throw Error(r(284));(i===null||i.ref!==o)&&(l.flags|=4194816)}}function Zp(i,l,o,u,m){return Ps(l),o=Dp(i,l,o,u,void 0,m),u=_p(),i!==null&&!Jt?(Lp(i,l,m),vr(i,l,m)):(dt&&u&&pp(l),l.flags|=1,yn(i,l,o,m),l.child)}function iS(i,l,o,u,m,y){return Ps(l),l.updateQueue=null,o=lw(l,u,o,m),sw(i),u=_p(),i!==null&&!Jt?(Lp(i,l,y),vr(i,l,y)):(dt&&u&&pp(l),l.flags|=1,yn(i,l,o,y),l.child)}function rS(i,l,o,u,m){if(Ps(l),l.stateNode===null){var y=Dl,w=o.contextType;typeof w=="object"&&w!==null&&(y=gn(w)),y=new o(u,y),l.memoizedState=y.state!==null&&y.state!==void 0?y.state:null,y.updater=Jp,l.stateNode=y,y._reactInternals=l,y=l.stateNode,y.props=u,y.state=l.memoizedState,y.refs={},Cp(l),w=o.contextType,y.context=typeof w=="object"&&w!==null?gn(w):Dl,y.state=l.memoizedState,w=o.getDerivedStateFromProps,typeof w=="function"&&(Xp(l,o,w,u),y.state=l.memoizedState),typeof o.getDerivedStateFromProps=="function"||typeof y.getSnapshotBeforeUpdate=="function"||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(w=y.state,typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount(),w!==y.state&&Jp.enqueueReplaceState(y,y.state,null),ro(l,u,y,m),io(),y.state=l.memoizedState),typeof y.componentDidMount=="function"&&(l.flags|=4194308),u=!0}else if(i===null){y=l.stateNode;var N=l.memoizedProps,q=Qs(o,N);y.props=q;var ie=y.context,me=o.contextType;w=Dl,typeof me=="object"&&me!==null&&(w=gn(me));var ve=o.getDerivedStateFromProps;me=typeof ve=="function"||typeof y.getSnapshotBeforeUpdate=="function",N=l.pendingProps!==N,me||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(N||ie!==w)&&Vw(l,y,u,w),ss=!1;var re=l.memoizedState;y.state=re,ro(l,u,y,m),io(),ie=l.memoizedState,N||re!==ie||ss?(typeof ve=="function"&&(Xp(l,o,ve,u),ie=l.memoizedState),(q=ss||Fw(l,o,q,u,re,ie,w))?(me||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount()),typeof y.componentDidMount=="function"&&(l.flags|=4194308)):(typeof y.componentDidMount=="function"&&(l.flags|=4194308),l.memoizedProps=u,l.memoizedState=ie),y.props=u,y.state=ie,y.context=w,u=q):(typeof y.componentDidMount=="function"&&(l.flags|=4194308),u=!1)}else{y=l.stateNode,Np(i,l),w=l.memoizedProps,me=Qs(o,w),y.props=me,ve=l.pendingProps,re=y.context,ie=o.contextType,q=Dl,typeof ie=="object"&&ie!==null&&(q=gn(ie)),N=o.getDerivedStateFromProps,(ie=typeof N=="function"||typeof y.getSnapshotBeforeUpdate=="function")||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(w!==ve||re!==q)&&Vw(l,y,u,q),ss=!1,re=l.memoizedState,y.state=re,ro(l,u,y,m),io();var ce=l.memoizedState;w!==ve||re!==ce||ss||i!==null&&i.dependencies!==null&&au(i.dependencies)?(typeof N=="function"&&(Xp(l,o,N,u),ce=l.memoizedState),(me=ss||Fw(l,o,me,u,re,ce,q)||i!==null&&i.dependencies!==null&&au(i.dependencies))?(ie||typeof y.UNSAFE_componentWillUpdate!="function"&&typeof y.componentWillUpdate!="function"||(typeof y.componentWillUpdate=="function"&&y.componentWillUpdate(u,ce,q),typeof y.UNSAFE_componentWillUpdate=="function"&&y.UNSAFE_componentWillUpdate(u,ce,q)),typeof y.componentDidUpdate=="function"&&(l.flags|=4),typeof y.getSnapshotBeforeUpdate=="function"&&(l.flags|=1024)):(typeof y.componentDidUpdate!="function"||w===i.memoizedProps&&re===i.memoizedState||(l.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||w===i.memoizedProps&&re===i.memoizedState||(l.flags|=1024),l.memoizedProps=u,l.memoizedState=ce),y.props=u,y.state=ce,y.context=q,u=me):(typeof y.componentDidUpdate!="function"||w===i.memoizedProps&&re===i.memoizedState||(l.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||w===i.memoizedProps&&re===i.memoizedState||(l.flags|=1024),u=!1)}return y=u,Nu(i,l),u=(l.flags&128)!==0,y||u?(y=l.stateNode,o=u&&typeof o.getDerivedStateFromError!="function"?null:y.render(),l.flags|=1,i!==null&&u?(l.child=Xs(l,i.child,null,m),l.child=Xs(l,null,o,m)):yn(i,l,o,m),l.memoizedState=y.state,i=l.child):i=vr(i,l,m),i}function sS(i,l,o,u){return Fs(),l.flags|=256,yn(i,l,o,u),l.child}var em={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function tm(i){return{baseLanes:i,cachePool:G1()}}function nm(i,l,o){return i=i!==null?i.childLanes&~o:0,l&&(i|=ii),i}function lS(i,l,o){var u=l.pendingProps,m=!1,y=(l.flags&128)!==0,w;if((w=y)||(w=i!==null&&i.memoizedState===null?!1:(Ft.current&2)!==0),w&&(m=!0,l.flags&=-129),w=(l.flags&32)!==0,l.flags&=-33,i===null){if(dt){if(m?os(l):cs(),(i=Ot)?(i=p2(i,ki),i=i!==null&&i.data!=="&"?i:null,i!==null&&(l.memoizedState={dehydrated:i,treeContext:ts!==null?{id:Qi,overflow:Wi}:null,retryLane:536870912,hydrationErrors:null},o=z1(i),o.return=l,l.child=o,mn=l,Ot=null)):i=null,i===null)throw is(l);return qm(i)?l.lanes=32:l.lanes=536870912,null}var N=u.children;return u=u.fallback,m?(cs(),m=l.mode,N=Tu({mode:"hidden",children:N},m),u=Us(u,m,o,null),N.return=l,u.return=l,N.sibling=u,l.child=N,u=l.child,u.memoizedState=tm(o),u.childLanes=nm(i,w,o),l.memoizedState=em,co(null,u)):(os(l),im(l,N))}var q=i.memoizedState;if(q!==null&&(N=q.dehydrated,N!==null)){if(y)l.flags&256?(os(l),l.flags&=-257,l=rm(i,l,o)):l.memoizedState!==null?(cs(),l.child=i.child,l.flags|=128,l=null):(cs(),N=u.fallback,m=l.mode,u=Tu({mode:"visible",children:u.children},m),N=Us(N,m,o,null),N.flags|=2,u.return=l,N.return=l,u.sibling=N,l.child=u,Xs(l,i.child,null,o),u=l.child,u.memoizedState=tm(o),u.childLanes=nm(i,w,o),l.memoizedState=em,l=co(null,u));else if(os(l),qm(N)){if(w=N.nextSibling&&N.nextSibling.dataset,w)var ie=w.dgst;w=ie,u=Error(r(419)),u.stack="",u.digest=w,Qa({value:u,source:null,stack:null}),l=rm(i,l,o)}else if(Jt||$l(i,l,o,!1),w=(o&i.childLanes)!==0,Jt||w){if(w=jt,w!==null&&(u=Qe(w,o),u!==0&&u!==q.retryLane))throw q.retryLane=u,Is(i,u),Kn(w,i,u),Wp;$m(N)||Bu(),l=rm(i,l,o)}else $m(N)?(l.flags|=192,l.child=i.child,l=null):(i=q.treeContext,Ot=Ni(N.nextSibling),mn=l,dt=!0,ns=null,ki=!1,i!==null&&U1(l,i),l=im(l,u.children),l.flags|=4096);return l}return m?(cs(),N=u.fallback,m=l.mode,q=i.child,ie=q.sibling,u=pr(q,{mode:"hidden",children:u.children}),u.subtreeFlags=q.subtreeFlags&65011712,ie!==null?N=pr(ie,N):(N=Us(N,m,o,null),N.flags|=2),N.return=l,u.return=l,u.sibling=N,l.child=u,co(null,u),u=l.child,N=i.child.memoizedState,N===null?N=tm(o):(m=N.cachePool,m!==null?(q=Gt._currentValue,m=m.parent!==q?{parent:q,pool:q}:m):m=G1(),N={baseLanes:N.baseLanes|o,cachePool:m}),u.memoizedState=N,u.childLanes=nm(i,w,o),l.memoizedState=em,co(i.child,u)):(os(l),o=i.child,i=o.sibling,o=pr(o,{mode:"visible",children:u.children}),o.return=l,o.sibling=null,i!==null&&(w=l.deletions,w===null?(l.deletions=[i],l.flags|=16):w.push(i)),l.child=o,l.memoizedState=null,o)}function im(i,l){return l=Tu({mode:"visible",children:l},i.mode),l.return=i,i.child=l}function Tu(i,l){return i=Zn(22,i,null,l),i.lanes=0,i}function rm(i,l,o){return Xs(l,i.child,null,o),i=im(l,l.pendingProps.children),i.flags|=2,l.memoizedState=null,i}function aS(i,l,o){i.lanes|=l;var u=i.alternate;u!==null&&(u.lanes|=l),xp(i.return,l,o)}function sm(i,l,o,u,m,y){var w=i.memoizedState;w===null?i.memoizedState={isBackwards:l,rendering:null,renderingStartTime:0,last:u,tail:o,tailMode:m,treeForkCount:y}:(w.isBackwards=l,w.rendering=null,w.renderingStartTime=0,w.last=u,w.tail=o,w.tailMode=m,w.treeForkCount=y)}function oS(i,l,o){var u=l.pendingProps,m=u.revealOrder,y=u.tail;u=u.children;var w=Ft.current,N=(w&2)!==0;if(N?(w=w&1|2,l.flags|=128):w&=1,ue(Ft,w),yn(i,l,u,o),u=dt?Ja:0,!N&&i!==null&&(i.flags&128)!==0)e:for(i=l.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&aS(i,o,l);else if(i.tag===19)aS(i,o,l);else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===l)break e;for(;i.sibling===null;){if(i.return===null||i.return===l)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}switch(m){case"forwards":for(o=l.child,m=null;o!==null;)i=o.alternate,i!==null&&mu(i)===null&&(m=o),o=o.sibling;o=m,o===null?(m=l.child,l.child=null):(m=o.sibling,o.sibling=null),sm(l,!1,m,o,y,u);break;case"backwards":case"unstable_legacy-backwards":for(o=null,m=l.child,l.child=null;m!==null;){if(i=m.alternate,i!==null&&mu(i)===null){l.child=m;break}i=m.sibling,m.sibling=o,o=m,m=i}sm(l,!0,o,null,y,u);break;case"together":sm(l,!1,null,null,void 0,u);break;default:l.memoizedState=null}return l.child}function vr(i,l,o){if(i!==null&&(l.dependencies=i.dependencies),fs|=l.lanes,(o&l.childLanes)===0)if(i!==null){if($l(i,l,o,!1),(o&l.childLanes)===0)return null}else return null;if(i!==null&&l.child!==i.child)throw Error(r(153));if(l.child!==null){for(i=l.child,o=pr(i,i.pendingProps),l.child=o,o.return=l;i.sibling!==null;)i=i.sibling,o=o.sibling=pr(i,i.pendingProps),o.return=l;o.sibling=null}return l.child}function lm(i,l){return(i.lanes&l)!==0?!0:(i=i.dependencies,!!(i!==null&&au(i)))}function RM(i,l,o){switch(l.tag){case 3:Ze(l,l.stateNode.containerInfo),rs(l,Gt,i.memoizedState.cache),Fs();break;case 27:case 5:Ke(l);break;case 4:Ze(l,l.stateNode.containerInfo);break;case 10:rs(l,l.type,l.memoizedProps.value);break;case 31:if(l.memoizedState!==null)return l.flags|=128,Mp(l),null;break;case 13:var u=l.memoizedState;if(u!==null)return u.dehydrated!==null?(os(l),l.flags|=128,null):(o&l.child.childLanes)!==0?lS(i,l,o):(os(l),i=vr(i,l,o),i!==null?i.sibling:null);os(l);break;case 19:var m=(i.flags&128)!==0;if(u=(o&l.childLanes)!==0,u||($l(i,l,o,!1),u=(o&l.childLanes)!==0),m){if(u)return oS(i,l,o);l.flags|=128}if(m=l.memoizedState,m!==null&&(m.rendering=null,m.tail=null,m.lastEffect=null),ue(Ft,Ft.current),u)break;return null;case 22:return l.lanes=0,eS(i,l,o,l.pendingProps);case 24:rs(l,Gt,i.memoizedState.cache)}return vr(i,l,o)}function cS(i,l,o){if(i!==null)if(i.memoizedProps!==l.pendingProps)Jt=!0;else{if(!lm(i,o)&&(l.flags&128)===0)return Jt=!1,RM(i,l,o);Jt=(i.flags&131072)!==0}else Jt=!1,dt&&(l.flags&1048576)!==0&&I1(l,Ja,l.index);switch(l.lanes=0,l.tag){case 16:e:{var u=l.pendingProps;if(i=Ys(l.elementType),l.type=i,typeof i=="function")dp(i)?(u=Qs(i,u),l.tag=1,l=rS(null,l,i,u,o)):(l.tag=0,l=Zp(null,l,i,u,o));else{if(i!=null){var m=i.$$typeof;if(m===O){l.tag=11,l=Qw(null,l,i,u,o);break e}else if(m===M){l.tag=14,l=Ww(null,l,i,u,o);break e}}throw l=ye(i)||i,Error(r(306,l,""))}}return l;case 0:return Zp(i,l,l.type,l.pendingProps,o);case 1:return u=l.type,m=Qs(u,l.pendingProps),rS(i,l,u,m,o);case 3:e:{if(Ze(l,l.stateNode.containerInfo),i===null)throw Error(r(387));u=l.pendingProps;var y=l.memoizedState;m=y.element,Np(i,l),ro(l,u,null,o);var w=l.memoizedState;if(u=w.cache,rs(l,Gt,u),u!==y.cache&&vp(l,[Gt],o,!0),io(),u=w.element,y.isDehydrated)if(y={element:u,isDehydrated:!1,cache:w.cache},l.updateQueue.baseState=y,l.memoizedState=y,l.flags&256){l=sS(i,l,u,o);break e}else if(u!==m){m=wi(Error(r(424)),l),Qa(m),l=sS(i,l,u,o);break e}else for(i=l.stateNode.containerInfo,i.nodeType===9?i=i.body:i=i.nodeName==="HTML"?i.ownerDocument.body:i,Ot=Ni(i.firstChild),mn=l,dt=!0,ns=null,ki=!0,o=ew(l,null,u,o),l.child=o;o;)o.flags=o.flags&-3|4096,o=o.sibling;else{if(Fs(),u===m){l=vr(i,l,o);break e}yn(i,l,u,o)}l=l.child}return l;case 26:return Nu(i,l),i===null?(o=v2(l.type,null,l.pendingProps,null))?l.memoizedState=o:dt||(o=l.type,i=l.pendingProps,u=Fu(Re.current).createElement(o),u[_t]=l,u[It]=i,bn(u,o,i),Ut(u),l.stateNode=u):l.memoizedState=v2(l.type,i.memoizedProps,l.pendingProps,i.memoizedState),null;case 27:return Ke(l),i===null&&dt&&(u=l.stateNode=y2(l.type,l.pendingProps,Re.current),mn=l,ki=!0,m=Ot,ys(l.type)?(zm=m,Ot=Ni(u.firstChild)):Ot=m),yn(i,l,l.pendingProps.children,o),Nu(i,l),i===null&&(l.flags|=4194304),l.child;case 5:return i===null&&dt&&((m=u=Ot)&&(u=oR(u,l.type,l.pendingProps,ki),u!==null?(l.stateNode=u,mn=l,Ot=Ni(u.firstChild),ki=!1,m=!0):m=!1),m||is(l)),Ke(l),m=l.type,y=l.pendingProps,w=i!==null?i.memoizedProps:null,u=y.children,_m(m,y)?u=null:w!==null&&_m(m,w)&&(l.flags|=32),l.memoizedState!==null&&(m=Dp(i,l,AM,null,null,o),Co._currentValue=m),Nu(i,l),yn(i,l,u,o),l.child;case 6:return i===null&&dt&&((i=o=Ot)&&(o=cR(o,l.pendingProps,ki),o!==null?(l.stateNode=o,mn=l,Ot=null,i=!0):i=!1),i||is(l)),null;case 13:return lS(i,l,o);case 4:return Ze(l,l.stateNode.containerInfo),u=l.pendingProps,i===null?l.child=Xs(l,null,u,o):yn(i,l,u,o),l.child;case 11:return Qw(i,l,l.type,l.pendingProps,o);case 7:return yn(i,l,l.pendingProps,o),l.child;case 8:return yn(i,l,l.pendingProps.children,o),l.child;case 12:return yn(i,l,l.pendingProps.children,o),l.child;case 10:return u=l.pendingProps,rs(l,l.type,u.value),yn(i,l,u.children,o),l.child;case 9:return m=l.type._context,u=l.pendingProps.children,Ps(l),m=gn(m),u=u(m),l.flags|=1,yn(i,l,u,o),l.child;case 14:return Ww(i,l,l.type,l.pendingProps,o);case 15:return Zw(i,l,l.type,l.pendingProps,o);case 19:return oS(i,l,o);case 31:return MM(i,l,o);case 22:return eS(i,l,o,l.pendingProps);case 24:return Ps(l),u=gn(Gt),i===null?(m=Ap(),m===null&&(m=jt,y=wp(),m.pooledCache=y,y.refCount++,y!==null&&(m.pooledCacheLanes|=o),m=y),l.memoizedState={parent:u,cache:m},Cp(l),rs(l,Gt,m)):((i.lanes&o)!==0&&(Np(i,l),ro(l,null,null,o),io()),m=i.memoizedState,y=l.memoizedState,m.parent!==u?(m={parent:u,cache:u},l.memoizedState=m,l.lanes===0&&(l.memoizedState=l.updateQueue.baseState=m),rs(l,Gt,u)):(u=y.cache,rs(l,Gt,u),u!==m.cache&&vp(l,[Gt],o,!0))),yn(i,l,l.pendingProps.children,o),l.child;case 29:throw l.pendingProps}throw Error(r(156,l.tag))}function wr(i){i.flags|=4}function am(i,l,o,u,m){if((l=(i.mode&32)!==0)&&(l=!1),l){if(i.flags|=16777216,(m&335544128)===m)if(i.stateNode.complete)i.flags|=8192;else if(BS())i.flags|=8192;else throw Gs=du,kp}else i.flags&=-16777217}function uS(i,l){if(l.type!=="stylesheet"||(l.state.loading&4)!==0)i.flags&=-16777217;else if(i.flags|=16777216,!C2(l))if(BS())i.flags|=8192;else throw Gs=du,kp}function ju(i,l){l!==null&&(i.flags|=4),i.flags&16384&&(l=i.tag!==22?Rn():536870912,i.lanes|=l,Xl|=l)}function uo(i,l){if(!dt)switch(i.tailMode){case"hidden":l=i.tail;for(var o=null;l!==null;)l.alternate!==null&&(o=l),l=l.sibling;o===null?i.tail=null:o.sibling=null;break;case"collapsed":o=i.tail;for(var u=null;o!==null;)o.alternate!==null&&(u=o),o=o.sibling;u===null?l||i.tail===null?i.tail=null:i.tail.sibling=null:u.sibling=null}}function Mt(i){var l=i.alternate!==null&&i.alternate.child===i.child,o=0,u=0;if(l)for(var m=i.child;m!==null;)o|=m.lanes|m.childLanes,u|=m.subtreeFlags&65011712,u|=m.flags&65011712,m.return=i,m=m.sibling;else for(m=i.child;m!==null;)o|=m.lanes|m.childLanes,u|=m.subtreeFlags,u|=m.flags,m.return=i,m=m.sibling;return i.subtreeFlags|=u,i.childLanes=o,l}function DM(i,l,o){var u=l.pendingProps;switch(mp(l),l.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Mt(l),null;case 1:return Mt(l),null;case 3:return o=l.stateNode,u=null,i!==null&&(u=i.memoizedState.cache),l.memoizedState.cache!==u&&(l.flags|=2048),yr(Gt),_e(),o.pendingContext&&(o.context=o.pendingContext,o.pendingContext=null),(i===null||i.child===null)&&(Bl(l)?wr(l):i===null||i.memoizedState.isDehydrated&&(l.flags&256)===0||(l.flags|=1024,yp())),Mt(l),null;case 26:var m=l.type,y=l.memoizedState;return i===null?(wr(l),y!==null?(Mt(l),uS(l,y)):(Mt(l),am(l,m,null,u,o))):y?y!==i.memoizedState?(wr(l),Mt(l),uS(l,y)):(Mt(l),l.flags&=-16777217):(i=i.memoizedProps,i!==u&&wr(l),Mt(l),am(l,m,i,u,o)),null;case 27:if(gt(l),o=Re.current,m=l.type,i!==null&&l.stateNode!=null)i.memoizedProps!==u&&wr(l);else{if(!u){if(l.stateNode===null)throw Error(r(166));return Mt(l),null}i=Se.current,Bl(l)?F1(l):(i=y2(m,u,o),l.stateNode=i,wr(l))}return Mt(l),null;case 5:if(gt(l),m=l.type,i!==null&&l.stateNode!=null)i.memoizedProps!==u&&wr(l);else{if(!u){if(l.stateNode===null)throw Error(r(166));return Mt(l),null}if(y=Se.current,Bl(l))F1(l);else{var w=Fu(Re.current);switch(y){case 1:y=w.createElementNS("http://www.w3.org/2000/svg",m);break;case 2:y=w.createElementNS("http://www.w3.org/1998/Math/MathML",m);break;default:switch(m){case"svg":y=w.createElementNS("http://www.w3.org/2000/svg",m);break;case"math":y=w.createElementNS("http://www.w3.org/1998/Math/MathML",m);break;case"script":y=w.createElement("div"),y.innerHTML="<script><\/script>",y=y.removeChild(y.firstChild);break;case"select":y=typeof u.is=="string"?w.createElement("select",{is:u.is}):w.createElement("select"),u.multiple?y.multiple=!0:u.size&&(y.size=u.size);break;default:y=typeof u.is=="string"?w.createElement(m,{is:u.is}):w.createElement(m)}}y[_t]=l,y[It]=u;e:for(w=l.child;w!==null;){if(w.tag===5||w.tag===6)y.appendChild(w.stateNode);else if(w.tag!==4&&w.tag!==27&&w.child!==null){w.child.return=w,w=w.child;continue}if(w===l)break e;for(;w.sibling===null;){if(w.return===null||w.return===l)break e;w=w.return}w.sibling.return=w.return,w=w.sibling}l.stateNode=y;e:switch(bn(y,m,u),m){case"button":case"input":case"select":case"textarea":u=!!u.autoFocus;break e;case"img":u=!0;break e;default:u=!1}u&&wr(l)}}return Mt(l),am(l,l.type,i===null?null:i.memoizedProps,l.pendingProps,o),null;case 6:if(i&&l.stateNode!=null)i.memoizedProps!==u&&wr(l);else{if(typeof u!="string"&&l.stateNode===null)throw Error(r(166));if(i=Re.current,Bl(l)){if(i=l.stateNode,o=l.memoizedProps,u=null,m=mn,m!==null)switch(m.tag){case 27:case 5:u=m.memoizedProps}i[_t]=l,i=!!(i.nodeValue===o||u!==null&&u.suppressHydrationWarning===!0||l2(i.nodeValue,o)),i||is(l,!0)}else i=Fu(i).createTextNode(u),i[_t]=l,l.stateNode=i}return Mt(l),null;case 31:if(o=l.memoizedState,i===null||i.memoizedState!==null){if(u=Bl(l),o!==null){if(i===null){if(!u)throw Error(r(318));if(i=l.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(557));i[_t]=l}else Fs(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;Mt(l),i=!1}else o=yp(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=o),i=!0;if(!i)return l.flags&256?(ti(l),l):(ti(l),null);if((l.flags&128)!==0)throw Error(r(558))}return Mt(l),null;case 13:if(u=l.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(m=Bl(l),u!==null&&u.dehydrated!==null){if(i===null){if(!m)throw Error(r(318));if(m=l.memoizedState,m=m!==null?m.dehydrated:null,!m)throw Error(r(317));m[_t]=l}else Fs(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;Mt(l),m=!1}else m=yp(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=m),m=!0;if(!m)return l.flags&256?(ti(l),l):(ti(l),null)}return ti(l),(l.flags&128)!==0?(l.lanes=o,l):(o=u!==null,i=i!==null&&i.memoizedState!==null,o&&(u=l.child,m=null,u.alternate!==null&&u.alternate.memoizedState!==null&&u.alternate.memoizedState.cachePool!==null&&(m=u.alternate.memoizedState.cachePool.pool),y=null,u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(y=u.memoizedState.cachePool.pool),y!==m&&(u.flags|=2048)),o!==i&&o&&(l.child.flags|=8192),ju(l,l.updateQueue),Mt(l),null);case 4:return _e(),i===null&&Em(l.stateNode.containerInfo),Mt(l),null;case 10:return yr(l.type),Mt(l),null;case 19:if(P(Ft),u=l.memoizedState,u===null)return Mt(l),null;if(m=(l.flags&128)!==0,y=u.rendering,y===null)if(m)uo(u,!1);else{if($t!==0||i!==null&&(i.flags&128)!==0)for(i=l.child;i!==null;){if(y=mu(i),y!==null){for(l.flags|=128,uo(u,!1),i=y.updateQueue,l.updateQueue=i,ju(l,i),l.subtreeFlags=0,i=o,o=l.child;o!==null;)q1(o,i),o=o.sibling;return ue(Ft,Ft.current&1|2),dt&&mr(l,u.treeForkCount),l.child}i=i.sibling}u.tail!==null&<()>Du&&(l.flags|=128,m=!0,uo(u,!1),l.lanes=4194304)}else{if(!m)if(i=mu(y),i!==null){if(l.flags|=128,m=!0,i=i.updateQueue,l.updateQueue=i,ju(l,i),uo(u,!0),u.tail===null&&u.tailMode==="hidden"&&!y.alternate&&!dt)return Mt(l),null}else 2*lt()-u.renderingStartTime>Du&&o!==536870912&&(l.flags|=128,m=!0,uo(u,!1),l.lanes=4194304);u.isBackwards?(y.sibling=l.child,l.child=y):(i=u.last,i!==null?i.sibling=y:l.child=y,u.last=y)}return u.tail!==null?(i=u.tail,u.rendering=i,u.tail=i.sibling,u.renderingStartTime=lt(),i.sibling=null,o=Ft.current,ue(Ft,m?o&1|2:o&1),dt&&mr(l,u.treeForkCount),i):(Mt(l),null);case 22:case 23:return ti(l),Op(),u=l.memoizedState!==null,i!==null?i.memoizedState!==null!==u&&(l.flags|=8192):u&&(l.flags|=8192),u?(o&536870912)!==0&&(l.flags&128)===0&&(Mt(l),l.subtreeFlags&6&&(l.flags|=8192)):Mt(l),o=l.updateQueue,o!==null&&ju(l,o.retryQueue),o=null,i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(o=i.memoizedState.cachePool.pool),u=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(u=l.memoizedState.cachePool.pool),u!==o&&(l.flags|=2048),i!==null&&P(Ks),null;case 24:return o=null,i!==null&&(o=i.memoizedState.cache),l.memoizedState.cache!==o&&(l.flags|=2048),yr(Gt),Mt(l),null;case 25:return null;case 30:return null}throw Error(r(156,l.tag))}function _M(i,l){switch(mp(l),l.tag){case 1:return i=l.flags,i&65536?(l.flags=i&-65537|128,l):null;case 3:return yr(Gt),_e(),i=l.flags,(i&65536)!==0&&(i&128)===0?(l.flags=i&-65537|128,l):null;case 26:case 27:case 5:return gt(l),null;case 31:if(l.memoizedState!==null){if(ti(l),l.alternate===null)throw Error(r(340));Fs()}return i=l.flags,i&65536?(l.flags=i&-65537|128,l):null;case 13:if(ti(l),i=l.memoizedState,i!==null&&i.dehydrated!==null){if(l.alternate===null)throw Error(r(340));Fs()}return i=l.flags,i&65536?(l.flags=i&-65537|128,l):null;case 19:return P(Ft),null;case 4:return _e(),null;case 10:return yr(l.type),null;case 22:case 23:return ti(l),Op(),i!==null&&P(Ks),i=l.flags,i&65536?(l.flags=i&-65537|128,l):null;case 24:return yr(Gt),null;case 25:return null;default:return null}}function dS(i,l){switch(mp(l),l.tag){case 3:yr(Gt),_e();break;case 26:case 27:case 5:gt(l);break;case 4:_e();break;case 31:l.memoizedState!==null&&ti(l);break;case 13:ti(l);break;case 19:P(Ft);break;case 10:yr(l.type);break;case 22:case 23:ti(l),Op(),i!==null&&P(Ks);break;case 24:yr(Gt)}}function fo(i,l){try{var o=l.updateQueue,u=o!==null?o.lastEffect:null;if(u!==null){var m=u.next;o=m;do{if((o.tag&i)===i){u=void 0;var y=o.create,w=o.inst;u=y(),w.destroy=u}o=o.next}while(o!==m)}}catch(N){St(l,l.return,N)}}function us(i,l,o){try{var u=l.updateQueue,m=u!==null?u.lastEffect:null;if(m!==null){var y=m.next;u=y;do{if((u.tag&i)===i){var w=u.inst,N=w.destroy;if(N!==void 0){w.destroy=void 0,m=l;var q=o,ie=N;try{ie()}catch(me){St(m,q,me)}}}u=u.next}while(u!==y)}}catch(me){St(l,l.return,me)}}function fS(i){var l=i.updateQueue;if(l!==null){var o=i.stateNode;try{nw(l,o)}catch(u){St(i,i.return,u)}}}function hS(i,l,o){o.props=Qs(i.type,i.memoizedProps),o.state=i.memoizedState;try{o.componentWillUnmount()}catch(u){St(i,l,u)}}function ho(i,l){try{var o=i.ref;if(o!==null){switch(i.tag){case 26:case 27:case 5:var u=i.stateNode;break;case 30:u=i.stateNode;break;default:u=i.stateNode}typeof o=="function"?i.refCleanup=o(u):o.current=u}}catch(m){St(i,l,m)}}function Zi(i,l){var o=i.ref,u=i.refCleanup;if(o!==null)if(typeof u=="function")try{u()}catch(m){St(i,l,m)}finally{i.refCleanup=null,i=i.alternate,i!=null&&(i.refCleanup=null)}else if(typeof o=="function")try{o(null)}catch(m){St(i,l,m)}else o.current=null}function pS(i){var l=i.type,o=i.memoizedProps,u=i.stateNode;try{e:switch(l){case"button":case"input":case"select":case"textarea":o.autoFocus&&u.focus();break e;case"img":o.src?u.src=o.src:o.srcSet&&(u.srcset=o.srcSet)}}catch(m){St(i,i.return,m)}}function om(i,l,o){try{var u=i.stateNode;nR(u,i.type,o,l),u[It]=l}catch(m){St(i,i.return,m)}}function mS(i){return i.tag===5||i.tag===3||i.tag===26||i.tag===27&&ys(i.type)||i.tag===4}function cm(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||mS(i.return))return null;i=i.return}for(i.sibling.return=i.return,i=i.sibling;i.tag!==5&&i.tag!==6&&i.tag!==18;){if(i.tag===27&&ys(i.type)||i.flags&2||i.child===null||i.tag===4)continue e;i.child.return=i,i=i.child}if(!(i.flags&2))return i.stateNode}}function um(i,l,o){var u=i.tag;if(u===5||u===6)i=i.stateNode,l?(o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o).insertBefore(i,l):(l=o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o,l.appendChild(i),o=o._reactRootContainer,o!=null||l.onclick!==null||(l.onclick=fr));else if(u!==4&&(u===27&&ys(i.type)&&(o=i.stateNode,l=null),i=i.child,i!==null))for(um(i,l,o),i=i.sibling;i!==null;)um(i,l,o),i=i.sibling}function Eu(i,l,o){var u=i.tag;if(u===5||u===6)i=i.stateNode,l?o.insertBefore(i,l):o.appendChild(i);else if(u!==4&&(u===27&&ys(i.type)&&(o=i.stateNode),i=i.child,i!==null))for(Eu(i,l,o),i=i.sibling;i!==null;)Eu(i,l,o),i=i.sibling}function gS(i){var l=i.stateNode,o=i.memoizedProps;try{for(var u=i.type,m=l.attributes;m.length;)l.removeAttributeNode(m[0]);bn(l,u,o),l[_t]=i,l[It]=o}catch(y){St(i,i.return,y)}}var Sr=!1,Qt=!1,dm=!1,yS=typeof WeakSet=="function"?WeakSet:Set,ln=null;function LM(i,l){if(i=i.containerInfo,Rm=Ju,i=E1(i),rp(i)){if("selectionStart"in i)var o={start:i.selectionStart,end:i.selectionEnd};else e:{o=(o=i.ownerDocument)&&o.defaultView||window;var u=o.getSelection&&o.getSelection();if(u&&u.rangeCount!==0){o=u.anchorNode;var m=u.anchorOffset,y=u.focusNode;u=u.focusOffset;try{o.nodeType,y.nodeType}catch{o=null;break e}var w=0,N=-1,q=-1,ie=0,me=0,ve=i,re=null;t:for(;;){for(var ce;ve!==o||m!==0&&ve.nodeType!==3||(N=w+m),ve!==y||u!==0&&ve.nodeType!==3||(q=w+u),ve.nodeType===3&&(w+=ve.nodeValue.length),(ce=ve.firstChild)!==null;)re=ve,ve=ce;for(;;){if(ve===i)break t;if(re===o&&++ie===m&&(N=w),re===y&&++me===u&&(q=w),(ce=ve.nextSibling)!==null)break;ve=re,re=ve.parentNode}ve=ce}o=N===-1||q===-1?null:{start:N,end:q}}else o=null}o=o||{start:0,end:0}}else o=null;for(Dm={focusedElem:i,selectionRange:o},Ju=!1,ln=l;ln!==null;)if(l=ln,i=l.child,(l.subtreeFlags&1028)!==0&&i!==null)i.return=l,ln=i;else for(;ln!==null;){switch(l=ln,y=l.alternate,i=l.flags,l.tag){case 0:if((i&4)!==0&&(i=l.updateQueue,i=i!==null?i.events:null,i!==null))for(o=0;o<i.length;o++)m=i[o],m.ref.impl=m.nextImpl;break;case 11:case 15:break;case 1:if((i&1024)!==0&&y!==null){i=void 0,o=l,m=y.memoizedProps,y=y.memoizedState,u=o.stateNode;try{var Le=Qs(o.type,m);i=u.getSnapshotBeforeUpdate(Le,y),u.__reactInternalSnapshotBeforeUpdate=i}catch(Ve){St(o,o.return,Ve)}}break;case 3:if((i&1024)!==0){if(i=l.stateNode.containerInfo,o=i.nodeType,o===9)Bm(i);else if(o===1)switch(i.nodeName){case"HEAD":case"HTML":case"BODY":Bm(i);break;default:i.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((i&1024)!==0)throw Error(r(163))}if(i=l.sibling,i!==null){i.return=l.return,ln=i;break}ln=l.return}}function bS(i,l,o){var u=o.flags;switch(o.tag){case 0:case 11:case 15:kr(i,o),u&4&&fo(5,o);break;case 1:if(kr(i,o),u&4)if(i=o.stateNode,l===null)try{i.componentDidMount()}catch(w){St(o,o.return,w)}else{var m=Qs(o.type,l.memoizedProps);l=l.memoizedState;try{i.componentDidUpdate(m,l,i.__reactInternalSnapshotBeforeUpdate)}catch(w){St(o,o.return,w)}}u&64&&fS(o),u&512&&ho(o,o.return);break;case 3:if(kr(i,o),u&64&&(i=o.updateQueue,i!==null)){if(l=null,o.child!==null)switch(o.child.tag){case 27:case 5:l=o.child.stateNode;break;case 1:l=o.child.stateNode}try{nw(i,l)}catch(w){St(o,o.return,w)}}break;case 27:l===null&&u&4&&gS(o);case 26:case 5:kr(i,o),l===null&&u&4&&pS(o),u&512&&ho(o,o.return);break;case 12:kr(i,o);break;case 31:kr(i,o),u&4&&wS(i,o);break;case 13:kr(i,o),u&4&&SS(i,o),u&64&&(i=o.memoizedState,i!==null&&(i=i.dehydrated,i!==null&&(o=VM.bind(null,o),uR(i,o))));break;case 22:if(u=o.memoizedState!==null||Sr,!u){l=l!==null&&l.memoizedState!==null||Qt,m=Sr;var y=Qt;Sr=u,(Qt=l)&&!y?Cr(i,o,(o.subtreeFlags&8772)!==0):kr(i,o),Sr=m,Qt=y}break;case 30:break;default:kr(i,o)}}function xS(i){var l=i.alternate;l!==null&&(i.alternate=null,xS(l)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(l=i.stateNode,l!==null&&Al(l)),i.stateNode=null,i.return=null,i.dependencies=null,i.memoizedProps=null,i.memoizedState=null,i.pendingProps=null,i.stateNode=null,i.updateQueue=null}var Dt=null,Un=!1;function Ar(i,l,o){for(o=o.child;o!==null;)vS(i,l,o),o=o.sibling}function vS(i,l,o){if(k&&typeof k.onCommitFiberUnmount=="function")try{k.onCommitFiberUnmount(oe,o)}catch{}switch(o.tag){case 26:Qt||Zi(o,l),Ar(i,l,o),o.memoizedState?o.memoizedState.count--:o.stateNode&&(o=o.stateNode,o.parentNode.removeChild(o));break;case 27:Qt||Zi(o,l);var u=Dt,m=Un;ys(o.type)&&(Dt=o.stateNode,Un=!1),Ar(i,l,o),So(o.stateNode),Dt=u,Un=m;break;case 5:Qt||Zi(o,l);case 6:if(u=Dt,m=Un,Dt=null,Ar(i,l,o),Dt=u,Un=m,Dt!==null)if(Un)try{(Dt.nodeType===9?Dt.body:Dt.nodeName==="HTML"?Dt.ownerDocument.body:Dt).removeChild(o.stateNode)}catch(y){St(o,l,y)}else try{Dt.removeChild(o.stateNode)}catch(y){St(o,l,y)}break;case 18:Dt!==null&&(Un?(i=Dt,f2(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,o.stateNode),ia(i)):f2(Dt,o.stateNode));break;case 4:u=Dt,m=Un,Dt=o.stateNode.containerInfo,Un=!0,Ar(i,l,o),Dt=u,Un=m;break;case 0:case 11:case 14:case 15:us(2,o,l),Qt||us(4,o,l),Ar(i,l,o);break;case 1:Qt||(Zi(o,l),u=o.stateNode,typeof u.componentWillUnmount=="function"&&hS(o,l,u)),Ar(i,l,o);break;case 21:Ar(i,l,o);break;case 22:Qt=(u=Qt)||o.memoizedState!==null,Ar(i,l,o),Qt=u;break;default:Ar(i,l,o)}}function wS(i,l){if(l.memoizedState===null&&(i=l.alternate,i!==null&&(i=i.memoizedState,i!==null))){i=i.dehydrated;try{ia(i)}catch(o){St(l,l.return,o)}}}function SS(i,l){if(l.memoizedState===null&&(i=l.alternate,i!==null&&(i=i.memoizedState,i!==null&&(i=i.dehydrated,i!==null))))try{ia(i)}catch(o){St(l,l.return,o)}}function BM(i){switch(i.tag){case 31:case 13:case 19:var l=i.stateNode;return l===null&&(l=i.stateNode=new yS),l;case 22:return i=i.stateNode,l=i._retryCache,l===null&&(l=i._retryCache=new yS),l;default:throw Error(r(435,i.tag))}}function Ou(i,l){var o=BM(i);l.forEach(function(u){if(!o.has(u)){o.add(u);var m=PM.bind(null,i,u);u.then(m,m)}})}function Fn(i,l){var o=l.deletions;if(o!==null)for(var u=0;u<o.length;u++){var m=o[u],y=i,w=l,N=w;e:for(;N!==null;){switch(N.tag){case 27:if(ys(N.type)){Dt=N.stateNode,Un=!1;break e}break;case 5:Dt=N.stateNode,Un=!1;break e;case 3:case 4:Dt=N.stateNode.containerInfo,Un=!0;break e}N=N.return}if(Dt===null)throw Error(r(160));vS(y,w,m),Dt=null,Un=!1,y=m.alternate,y!==null&&(y.return=null),m.return=null}if(l.subtreeFlags&13886)for(l=l.child;l!==null;)AS(l,i),l=l.sibling}var $i=null;function AS(i,l){var o=i.alternate,u=i.flags;switch(i.tag){case 0:case 11:case 14:case 15:Fn(l,i),Vn(i),u&4&&(us(3,i,i.return),fo(3,i),us(5,i,i.return));break;case 1:Fn(l,i),Vn(i),u&512&&(Qt||o===null||Zi(o,o.return)),u&64&&Sr&&(i=i.updateQueue,i!==null&&(u=i.callbacks,u!==null&&(o=i.shared.hiddenCallbacks,i.shared.hiddenCallbacks=o===null?u:o.concat(u))));break;case 26:var m=$i;if(Fn(l,i),Vn(i),u&512&&(Qt||o===null||Zi(o,o.return)),u&4){var y=o!==null?o.memoizedState:null;if(u=i.memoizedState,o===null)if(u===null)if(i.stateNode===null){e:{u=i.type,o=i.memoizedProps,m=m.ownerDocument||m;t:switch(u){case"title":y=m.getElementsByTagName("title")[0],(!y||y[Ji]||y[_t]||y.namespaceURI==="http://www.w3.org/2000/svg"||y.hasAttribute("itemprop"))&&(y=m.createElement(u),m.head.insertBefore(y,m.querySelector("head > title"))),bn(y,u,o),y[_t]=i,Ut(y),u=y;break e;case"link":var w=A2("link","href",m).get(u+(o.href||""));if(w){for(var N=0;N<w.length;N++)if(y=w[N],y.getAttribute("href")===(o.href==null||o.href===""?null:o.href)&&y.getAttribute("rel")===(o.rel==null?null:o.rel)&&y.getAttribute("title")===(o.title==null?null:o.title)&&y.getAttribute("crossorigin")===(o.crossOrigin==null?null:o.crossOrigin)){w.splice(N,1);break t}}y=m.createElement(u),bn(y,u,o),m.head.appendChild(y);break;case"meta":if(w=A2("meta","content",m).get(u+(o.content||""))){for(N=0;N<w.length;N++)if(y=w[N],y.getAttribute("content")===(o.content==null?null:""+o.content)&&y.getAttribute("name")===(o.name==null?null:o.name)&&y.getAttribute("property")===(o.property==null?null:o.property)&&y.getAttribute("http-equiv")===(o.httpEquiv==null?null:o.httpEquiv)&&y.getAttribute("charset")===(o.charSet==null?null:o.charSet)){w.splice(N,1);break t}}y=m.createElement(u),bn(y,u,o),m.head.appendChild(y);break;default:throw Error(r(468,u))}y[_t]=i,Ut(y),u=y}i.stateNode=u}else k2(m,i.type,i.stateNode);else i.stateNode=S2(m,u,i.memoizedProps);else y!==u?(y===null?o.stateNode!==null&&(o=o.stateNode,o.parentNode.removeChild(o)):y.count--,u===null?k2(m,i.type,i.stateNode):S2(m,u,i.memoizedProps)):u===null&&i.stateNode!==null&&om(i,i.memoizedProps,o.memoizedProps)}break;case 27:Fn(l,i),Vn(i),u&512&&(Qt||o===null||Zi(o,o.return)),o!==null&&u&4&&om(i,i.memoizedProps,o.memoizedProps);break;case 5:if(Fn(l,i),Vn(i),u&512&&(Qt||o===null||Zi(o,o.return)),i.flags&32){m=i.stateNode;try{Nl(m,"")}catch(Le){St(i,i.return,Le)}}u&4&&i.stateNode!=null&&(m=i.memoizedProps,om(i,m,o!==null?o.memoizedProps:m)),u&1024&&(dm=!0);break;case 6:if(Fn(l,i),Vn(i),u&4){if(i.stateNode===null)throw Error(r(162));u=i.memoizedProps,o=i.stateNode;try{o.nodeValue=u}catch(Le){St(i,i.return,Le)}}break;case 3:if(Ku=null,m=$i,$i=Vu(l.containerInfo),Fn(l,i),$i=m,Vn(i),u&4&&o!==null&&o.memoizedState.isDehydrated)try{ia(l.containerInfo)}catch(Le){St(i,i.return,Le)}dm&&(dm=!1,kS(i));break;case 4:u=$i,$i=Vu(i.stateNode.containerInfo),Fn(l,i),Vn(i),$i=u;break;case 12:Fn(l,i),Vn(i);break;case 31:Fn(l,i),Vn(i),u&4&&(u=i.updateQueue,u!==null&&(i.updateQueue=null,Ou(i,u)));break;case 13:Fn(l,i),Vn(i),i.child.flags&8192&&i.memoizedState!==null!=(o!==null&&o.memoizedState!==null)&&(Ru=lt()),u&4&&(u=i.updateQueue,u!==null&&(i.updateQueue=null,Ou(i,u)));break;case 22:m=i.memoizedState!==null;var q=o!==null&&o.memoizedState!==null,ie=Sr,me=Qt;if(Sr=ie||m,Qt=me||q,Fn(l,i),Qt=me,Sr=ie,Vn(i),u&8192)e:for(l=i.stateNode,l._visibility=m?l._visibility&-2:l._visibility|1,m&&(o===null||q||Sr||Qt||Ws(i)),o=null,l=i;;){if(l.tag===5||l.tag===26){if(o===null){q=o=l;try{if(y=q.stateNode,m)w=y.style,typeof w.setProperty=="function"?w.setProperty("display","none","important"):w.display="none";else{N=q.stateNode;var ve=q.memoizedProps.style,re=ve!=null&&ve.hasOwnProperty("display")?ve.display:null;N.style.display=re==null||typeof re=="boolean"?"":(""+re).trim()}}catch(Le){St(q,q.return,Le)}}}else if(l.tag===6){if(o===null){q=l;try{q.stateNode.nodeValue=m?"":q.memoizedProps}catch(Le){St(q,q.return,Le)}}}else if(l.tag===18){if(o===null){q=l;try{var ce=q.stateNode;m?h2(ce,!0):h2(q.stateNode,!1)}catch(Le){St(q,q.return,Le)}}}else if((l.tag!==22&&l.tag!==23||l.memoizedState===null||l===i)&&l.child!==null){l.child.return=l,l=l.child;continue}if(l===i)break e;for(;l.sibling===null;){if(l.return===null||l.return===i)break e;o===l&&(o=null),l=l.return}o===l&&(o=null),l.sibling.return=l.return,l=l.sibling}u&4&&(u=i.updateQueue,u!==null&&(o=u.retryQueue,o!==null&&(u.retryQueue=null,Ou(i,o))));break;case 19:Fn(l,i),Vn(i),u&4&&(u=i.updateQueue,u!==null&&(i.updateQueue=null,Ou(i,u)));break;case 30:break;case 21:break;default:Fn(l,i),Vn(i)}}function Vn(i){var l=i.flags;if(l&2){try{for(var o,u=i.return;u!==null;){if(mS(u)){o=u;break}u=u.return}if(o==null)throw Error(r(160));switch(o.tag){case 27:var m=o.stateNode,y=cm(i);Eu(i,y,m);break;case 5:var w=o.stateNode;o.flags&32&&(Nl(w,""),o.flags&=-33);var N=cm(i);Eu(i,N,w);break;case 3:case 4:var q=o.stateNode.containerInfo,ie=cm(i);um(i,ie,q);break;default:throw Error(r(161))}}catch(me){St(i,i.return,me)}i.flags&=-3}l&4096&&(i.flags&=-4097)}function kS(i){if(i.subtreeFlags&1024)for(i=i.child;i!==null;){var l=i;kS(l),l.tag===5&&l.flags&1024&&l.stateNode.reset(),i=i.sibling}}function kr(i,l){if(l.subtreeFlags&8772)for(l=l.child;l!==null;)bS(i,l.alternate,l),l=l.sibling}function Ws(i){for(i=i.child;i!==null;){var l=i;switch(l.tag){case 0:case 11:case 14:case 15:us(4,l,l.return),Ws(l);break;case 1:Zi(l,l.return);var o=l.stateNode;typeof o.componentWillUnmount=="function"&&hS(l,l.return,o),Ws(l);break;case 27:So(l.stateNode);case 26:case 5:Zi(l,l.return),Ws(l);break;case 22:l.memoizedState===null&&Ws(l);break;case 30:Ws(l);break;default:Ws(l)}i=i.sibling}}function Cr(i,l,o){for(o=o&&(l.subtreeFlags&8772)!==0,l=l.child;l!==null;){var u=l.alternate,m=i,y=l,w=y.flags;switch(y.tag){case 0:case 11:case 15:Cr(m,y,o),fo(4,y);break;case 1:if(Cr(m,y,o),u=y,m=u.stateNode,typeof m.componentDidMount=="function")try{m.componentDidMount()}catch(ie){St(u,u.return,ie)}if(u=y,m=u.updateQueue,m!==null){var N=u.stateNode;try{var q=m.shared.hiddenCallbacks;if(q!==null)for(m.shared.hiddenCallbacks=null,m=0;m<q.length;m++)tw(q[m],N)}catch(ie){St(u,u.return,ie)}}o&&w&64&&fS(y),ho(y,y.return);break;case 27:gS(y);case 26:case 5:Cr(m,y,o),o&&u===null&&w&4&&pS(y),ho(y,y.return);break;case 12:Cr(m,y,o);break;case 31:Cr(m,y,o),o&&w&4&&wS(m,y);break;case 13:Cr(m,y,o),o&&w&4&&SS(m,y);break;case 22:y.memoizedState===null&&Cr(m,y,o),ho(y,y.return);break;case 30:break;default:Cr(m,y,o)}l=l.sibling}}function fm(i,l){var o=null;i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(o=i.memoizedState.cachePool.pool),i=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(i=l.memoizedState.cachePool.pool),i!==o&&(i!=null&&i.refCount++,o!=null&&Wa(o))}function hm(i,l){i=null,l.alternate!==null&&(i=l.alternate.memoizedState.cache),l=l.memoizedState.cache,l!==i&&(l.refCount++,i!=null&&Wa(i))}function qi(i,l,o,u){if(l.subtreeFlags&10256)for(l=l.child;l!==null;)CS(i,l,o,u),l=l.sibling}function CS(i,l,o,u){var m=l.flags;switch(l.tag){case 0:case 11:case 15:qi(i,l,o,u),m&2048&&fo(9,l);break;case 1:qi(i,l,o,u);break;case 3:qi(i,l,o,u),m&2048&&(i=null,l.alternate!==null&&(i=l.alternate.memoizedState.cache),l=l.memoizedState.cache,l!==i&&(l.refCount++,i!=null&&Wa(i)));break;case 12:if(m&2048){qi(i,l,o,u),i=l.stateNode;try{var y=l.memoizedProps,w=y.id,N=y.onPostCommit;typeof N=="function"&&N(w,l.alternate===null?"mount":"update",i.passiveEffectDuration,-0)}catch(q){St(l,l.return,q)}}else qi(i,l,o,u);break;case 31:qi(i,l,o,u);break;case 13:qi(i,l,o,u);break;case 23:break;case 22:y=l.stateNode,w=l.alternate,l.memoizedState!==null?y._visibility&2?qi(i,l,o,u):po(i,l):y._visibility&2?qi(i,l,o,u):(y._visibility|=2,Kl(i,l,o,u,(l.subtreeFlags&10256)!==0||!1)),m&2048&&fm(w,l);break;case 24:qi(i,l,o,u),m&2048&&hm(l.alternate,l);break;default:qi(i,l,o,u)}}function Kl(i,l,o,u,m){for(m=m&&((l.subtreeFlags&10256)!==0||!1),l=l.child;l!==null;){var y=i,w=l,N=o,q=u,ie=w.flags;switch(w.tag){case 0:case 11:case 15:Kl(y,w,N,q,m),fo(8,w);break;case 23:break;case 22:var me=w.stateNode;w.memoizedState!==null?me._visibility&2?Kl(y,w,N,q,m):po(y,w):(me._visibility|=2,Kl(y,w,N,q,m)),m&&ie&2048&&fm(w.alternate,w);break;case 24:Kl(y,w,N,q,m),m&&ie&2048&&hm(w.alternate,w);break;default:Kl(y,w,N,q,m)}l=l.sibling}}function po(i,l){if(l.subtreeFlags&10256)for(l=l.child;l!==null;){var o=i,u=l,m=u.flags;switch(u.tag){case 22:po(o,u),m&2048&&fm(u.alternate,u);break;case 24:po(o,u),m&2048&&hm(u.alternate,u);break;default:po(o,u)}l=l.sibling}}var mo=8192;function Yl(i,l,o){if(i.subtreeFlags&mo)for(i=i.child;i!==null;)NS(i,l,o),i=i.sibling}function NS(i,l,o){switch(i.tag){case 26:Yl(i,l,o),i.flags&mo&&i.memoizedState!==null&&SR(o,$i,i.memoizedState,i.memoizedProps);break;case 5:Yl(i,l,o);break;case 3:case 4:var u=$i;$i=Vu(i.stateNode.containerInfo),Yl(i,l,o),$i=u;break;case 22:i.memoizedState===null&&(u=i.alternate,u!==null&&u.memoizedState!==null?(u=mo,mo=16777216,Yl(i,l,o),mo=u):Yl(i,l,o));break;default:Yl(i,l,o)}}function TS(i){var l=i.alternate;if(l!==null&&(i=l.child,i!==null)){l.child=null;do l=i.sibling,i.sibling=null,i=l;while(i!==null)}}function go(i){var l=i.deletions;if((i.flags&16)!==0){if(l!==null)for(var o=0;o<l.length;o++){var u=l[o];ln=u,ES(u,i)}TS(i)}if(i.subtreeFlags&10256)for(i=i.child;i!==null;)jS(i),i=i.sibling}function jS(i){switch(i.tag){case 0:case 11:case 15:go(i),i.flags&2048&&us(9,i,i.return);break;case 3:go(i);break;case 12:go(i);break;case 22:var l=i.stateNode;i.memoizedState!==null&&l._visibility&2&&(i.return===null||i.return.tag!==13)?(l._visibility&=-3,Mu(i)):go(i);break;default:go(i)}}function Mu(i){var l=i.deletions;if((i.flags&16)!==0){if(l!==null)for(var o=0;o<l.length;o++){var u=l[o];ln=u,ES(u,i)}TS(i)}for(i=i.child;i!==null;){switch(l=i,l.tag){case 0:case 11:case 15:us(8,l,l.return),Mu(l);break;case 22:o=l.stateNode,o._visibility&2&&(o._visibility&=-3,Mu(l));break;default:Mu(l)}i=i.sibling}}function ES(i,l){for(;ln!==null;){var o=ln;switch(o.tag){case 0:case 11:case 15:us(8,o,l);break;case 23:case 22:if(o.memoizedState!==null&&o.memoizedState.cachePool!==null){var u=o.memoizedState.cachePool.pool;u!=null&&u.refCount++}break;case 24:Wa(o.memoizedState.cache)}if(u=o.child,u!==null)u.return=o,ln=u;else e:for(o=i;ln!==null;){u=ln;var m=u.sibling,y=u.return;if(xS(u),u===o){ln=null;break e}if(m!==null){m.return=y,ln=m;break e}ln=y}}}var $M={getCacheForType:function(i){var l=gn(Gt),o=l.data.get(i);return o===void 0&&(o=i(),l.data.set(i,o)),o},cacheSignal:function(){return gn(Gt).controller.signal}},qM=typeof WeakMap=="function"?WeakMap:Map,xt=0,jt=null,at=null,ct=0,wt=0,ni=null,ds=!1,Gl=!1,pm=!1,Nr=0,$t=0,fs=0,Zs=0,mm=0,ii=0,Xl=0,yo=null,Pn=null,gm=!1,Ru=0,OS=0,Du=1/0,_u=null,hs=null,tn=0,ps=null,Jl=null,Tr=0,ym=0,bm=null,MS=null,bo=0,xm=null;function ri(){return(xt&2)!==0&&ct!==0?ct&-ct:_.T!==null?Cm():Li()}function RS(){if(ii===0)if((ct&536870912)===0||dt){var i=ke;ke<<=1,(ke&3932160)===0&&(ke=262144),ii=i}else ii=536870912;return i=ei.current,i!==null&&(i.flags|=32),ii}function Kn(i,l,o){(i===jt&&(wt===2||wt===9)||i.cancelPendingCommit!==null)&&(Ql(i,0),ms(i,ct,ii,!1)),Kt(i,o),((xt&2)===0||i!==jt)&&(i===jt&&((xt&2)===0&&(Zs|=o),$t===4&&ms(i,ct,ii,!1)),er(i))}function DS(i,l,o){if((xt&6)!==0)throw Error(r(327));var u=!o&&(l&127)===0&&(l&i.expiredLanes)===0||ze(i,l),m=u?IM(i,l):wm(i,l,!0),y=u;do{if(m===0){Gl&&!u&&ms(i,l,0,!1);break}else{if(o=i.current.alternate,y&&!zM(o)){m=wm(i,l,!1),y=!1;continue}if(m===2){if(y=l,i.errorRecoveryDisabledLanes&y)var w=0;else w=i.pendingLanes&-536870913,w=w!==0?w:w&536870912?536870912:0;if(w!==0){l=w;e:{var N=i;m=yo;var q=N.current.memoizedState.isDehydrated;if(q&&(Ql(N,w).flags|=256),w=wm(N,w,!1),w!==2){if(pm&&!q){N.errorRecoveryDisabledLanes|=y,Zs|=y,m=4;break e}y=Pn,Pn=m,y!==null&&(Pn===null?Pn=y:Pn.push.apply(Pn,y))}m=w}if(y=!1,m!==2)continue}}if(m===1){Ql(i,0),ms(i,l,0,!0);break}e:{switch(u=i,y=m,y){case 0:case 1:throw Error(r(345));case 4:if((l&4194048)!==l)break;case 6:ms(u,l,ii,!ds);break e;case 2:Pn=null;break;case 3:case 5:break;default:throw Error(r(329))}if((l&62914560)===l&&(m=Ru+300-lt(),10<m)){if(ms(u,l,ii,!ds),$e(u,0,!0)!==0)break e;Tr=l,u.timeoutHandle=u2(_S.bind(null,u,o,Pn,_u,gm,l,ii,Zs,Xl,ds,y,"Throttled",-0,0),m);break e}_S(u,o,Pn,_u,gm,l,ii,Zs,Xl,ds,y,null,-0,0)}}break}while(!0);er(i)}function _S(i,l,o,u,m,y,w,N,q,ie,me,ve,re,ce){if(i.timeoutHandle=-1,ve=l.subtreeFlags,ve&8192||(ve&16785408)===16785408){ve={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:fr},NS(l,y,ve);var Le=(y&62914560)===y?Ru-lt():(y&4194048)===y?OS-lt():0;if(Le=AR(ve,Le),Le!==null){Tr=y,i.cancelPendingCommit=Le(US.bind(null,i,l,y,o,u,m,w,N,q,me,ve,null,re,ce)),ms(i,y,w,!ie);return}}US(i,l,y,o,u,m,w,N,q)}function zM(i){for(var l=i;;){var o=l.tag;if((o===0||o===11||o===15)&&l.flags&16384&&(o=l.updateQueue,o!==null&&(o=o.stores,o!==null)))for(var u=0;u<o.length;u++){var m=o[u],y=m.getSnapshot;m=m.value;try{if(!Wn(y(),m))return!1}catch{return!1}}if(o=l.child,l.subtreeFlags&16384&&o!==null)o.return=l,l=o;else{if(l===i)break;for(;l.sibling===null;){if(l.return===null||l.return===i)return!0;l=l.return}l.sibling.return=l.return,l=l.sibling}}return!0}function ms(i,l,o,u){l&=~mm,l&=~Zs,i.suspendedLanes|=l,i.pingedLanes&=~l,u&&(i.warmLanes|=l),u=i.expirationTimes;for(var m=l;0<m;){var y=31-Z(m),w=1<<y;u[y]=-1,m&=~w}o!==0&&or(i,o,l)}function Lu(){return(xt&6)===0?(xo(0),!1):!0}function vm(){if(at!==null){if(wt===0)var i=at.return;else i=at,gr=Vs=null,Bp(i),Il=null,eo=0,i=at;for(;i!==null;)dS(i.alternate,i),i=i.return;at=null}}function Ql(i,l){var o=i.timeoutHandle;o!==-1&&(i.timeoutHandle=-1,sR(o)),o=i.cancelPendingCommit,o!==null&&(i.cancelPendingCommit=null,o()),Tr=0,vm(),jt=i,at=o=pr(i.current,null),ct=l,wt=0,ni=null,ds=!1,Gl=ze(i,l),pm=!1,Xl=ii=mm=Zs=fs=$t=0,Pn=yo=null,gm=!1,(l&8)!==0&&(l|=l&32);var u=i.entangledLanes;if(u!==0)for(i=i.entanglements,u&=l;0<u;){var m=31-Z(u),y=1<<m;l|=i[m],u&=~y}return Nr=l,nu(),o}function LS(i,l){tt=null,_.H=oo,l===Hl||l===uu?(l=Q1(),wt=3):l===kp?(l=Q1(),wt=4):wt=l===Wp?8:l!==null&&typeof l=="object"&&typeof l.then=="function"?6:1,ni=l,at===null&&($t=1,ku(i,wi(l,i.current)))}function BS(){var i=ei.current;return i===null?!0:(ct&4194048)===ct?Ci===null:(ct&62914560)===ct||(ct&536870912)!==0?i===Ci:!1}function $S(){var i=_.H;return _.H=oo,i===null?oo:i}function qS(){var i=_.A;return _.A=$M,i}function Bu(){$t=4,ds||(ct&4194048)!==ct&&ei.current!==null||(Gl=!0),(fs&134217727)===0&&(Zs&134217727)===0||jt===null||ms(jt,ct,ii,!1)}function wm(i,l,o){var u=xt;xt|=2;var m=$S(),y=qS();(jt!==i||ct!==l)&&(_u=null,Ql(i,l)),l=!1;var w=$t;e:do try{if(wt!==0&&at!==null){var N=at,q=ni;switch(wt){case 8:vm(),w=6;break e;case 3:case 2:case 9:case 6:ei.current===null&&(l=!0);var ie=wt;if(wt=0,ni=null,Wl(i,N,q,ie),o&&Gl){w=0;break e}break;default:ie=wt,wt=0,ni=null,Wl(i,N,q,ie)}}HM(),w=$t;break}catch(me){LS(i,me)}while(!0);return l&&i.shellSuspendCounter++,gr=Vs=null,xt=u,_.H=m,_.A=y,at===null&&(jt=null,ct=0,nu()),w}function HM(){for(;at!==null;)zS(at)}function IM(i,l){var o=xt;xt|=2;var u=$S(),m=qS();jt!==i||ct!==l?(_u=null,Du=lt()+500,Ql(i,l)):Gl=ze(i,l);e:do try{if(wt!==0&&at!==null){l=at;var y=ni;t:switch(wt){case 1:wt=0,ni=null,Wl(i,l,y,1);break;case 2:case 9:if(X1(y)){wt=0,ni=null,HS(l);break}l=function(){wt!==2&&wt!==9||jt!==i||(wt=7),er(i)},y.then(l,l);break e;case 3:wt=7;break e;case 4:wt=5;break e;case 7:X1(y)?(wt=0,ni=null,HS(l)):(wt=0,ni=null,Wl(i,l,y,7));break;case 5:var w=null;switch(at.tag){case 26:w=at.memoizedState;case 5:case 27:var N=at;if(w?C2(w):N.stateNode.complete){wt=0,ni=null;var q=N.sibling;if(q!==null)at=q;else{var ie=N.return;ie!==null?(at=ie,$u(ie)):at=null}break t}}wt=0,ni=null,Wl(i,l,y,5);break;case 6:wt=0,ni=null,Wl(i,l,y,6);break;case 8:vm(),$t=6;break e;default:throw Error(r(462))}}UM();break}catch(me){LS(i,me)}while(!0);return gr=Vs=null,_.H=u,_.A=m,xt=o,at!==null?0:(jt=null,ct=0,nu(),$t)}function UM(){for(;at!==null&&!qn();)zS(at)}function zS(i){var l=cS(i.alternate,i,Nr);i.memoizedProps=i.pendingProps,l===null?$u(i):at=l}function HS(i){var l=i,o=l.alternate;switch(l.tag){case 15:case 0:l=iS(o,l,l.pendingProps,l.type,void 0,ct);break;case 11:l=iS(o,l,l.pendingProps,l.type.render,l.ref,ct);break;case 5:Bp(l);default:dS(o,l),l=at=q1(l,Nr),l=cS(o,l,Nr)}i.memoizedProps=i.pendingProps,l===null?$u(i):at=l}function Wl(i,l,o,u){gr=Vs=null,Bp(l),Il=null,eo=0;var m=l.return;try{if(OM(i,m,l,o,ct)){$t=1,ku(i,wi(o,i.current)),at=null;return}}catch(y){if(m!==null)throw at=m,y;$t=1,ku(i,wi(o,i.current)),at=null;return}l.flags&32768?(dt||u===1?i=!0:Gl||(ct&536870912)!==0?i=!1:(ds=i=!0,(u===2||u===9||u===3||u===6)&&(u=ei.current,u!==null&&u.tag===13&&(u.flags|=16384))),IS(l,i)):$u(l)}function $u(i){var l=i;do{if((l.flags&32768)!==0){IS(l,ds);return}i=l.return;var o=DM(l.alternate,l,Nr);if(o!==null){at=o;return}if(l=l.sibling,l!==null){at=l;return}at=l=i}while(l!==null);$t===0&&($t=5)}function IS(i,l){do{var o=_M(i.alternate,i);if(o!==null){o.flags&=32767,at=o;return}if(o=i.return,o!==null&&(o.flags|=32768,o.subtreeFlags=0,o.deletions=null),!l&&(i=i.sibling,i!==null)){at=i;return}at=i=o}while(i!==null);$t=6,at=null}function US(i,l,o,u,m,y,w,N,q){i.cancelPendingCommit=null;do qu();while(tn!==0);if((xt&6)!==0)throw Error(r(327));if(l!==null){if(l===i.current)throw Error(r(177));if(y=l.lanes|l.childLanes,y|=cp,_i(i,o,y,w,N,q),i===jt&&(at=jt=null,ct=0),Jl=l,ps=i,Tr=o,ym=y,bm=m,MS=u,(l.subtreeFlags&10256)!==0||(l.flags&10256)!==0?(i.callbackNode=null,i.callbackPriority=0,KM(Tt,function(){return YS(),null})):(i.callbackNode=null,i.callbackPriority=0),u=(l.flags&13878)!==0,(l.subtreeFlags&13878)!==0||u){u=_.T,_.T=null,m=ee.p,ee.p=2,w=xt,xt|=4;try{LM(i,l,o)}finally{xt=w,ee.p=m,_.T=u}}tn=1,FS(),VS(),PS()}}function FS(){if(tn===1){tn=0;var i=ps,l=Jl,o=(l.flags&13878)!==0;if((l.subtreeFlags&13878)!==0||o){o=_.T,_.T=null;var u=ee.p;ee.p=2;var m=xt;xt|=4;try{AS(l,i);var y=Dm,w=E1(i.containerInfo),N=y.focusedElem,q=y.selectionRange;if(w!==N&&N&&N.ownerDocument&&j1(N.ownerDocument.documentElement,N)){if(q!==null&&rp(N)){var ie=q.start,me=q.end;if(me===void 0&&(me=ie),"selectionStart"in N)N.selectionStart=ie,N.selectionEnd=Math.min(me,N.value.length);else{var ve=N.ownerDocument||document,re=ve&&ve.defaultView||window;if(re.getSelection){var ce=re.getSelection(),Le=N.textContent.length,Ve=Math.min(q.start,Le),Ct=q.end===void 0?Ve:Math.min(q.end,Le);!ce.extend&&Ve>Ct&&(w=Ct,Ct=Ve,Ve=w);var Y=T1(N,Ve),U=T1(N,Ct);if(Y&&U&&(ce.rangeCount!==1||ce.anchorNode!==Y.node||ce.anchorOffset!==Y.offset||ce.focusNode!==U.node||ce.focusOffset!==U.offset)){var ne=ve.createRange();ne.setStart(Y.node,Y.offset),ce.removeAllRanges(),Ve>Ct?(ce.addRange(ne),ce.extend(U.node,U.offset)):(ne.setEnd(U.node,U.offset),ce.addRange(ne))}}}}for(ve=[],ce=N;ce=ce.parentNode;)ce.nodeType===1&&ve.push({element:ce,left:ce.scrollLeft,top:ce.scrollTop});for(typeof N.focus=="function"&&N.focus(),N=0;N<ve.length;N++){var be=ve[N];be.element.scrollLeft=be.left,be.element.scrollTop=be.top}}Ju=!!Rm,Dm=Rm=null}finally{xt=m,ee.p=u,_.T=o}}i.current=l,tn=2}}function VS(){if(tn===2){tn=0;var i=ps,l=Jl,o=(l.flags&8772)!==0;if((l.subtreeFlags&8772)!==0||o){o=_.T,_.T=null;var u=ee.p;ee.p=2;var m=xt;xt|=4;try{bS(i,l.alternate,l)}finally{xt=m,ee.p=u,_.T=o}}tn=3}}function PS(){if(tn===4||tn===3){tn=0,Cn();var i=ps,l=Jl,o=Tr,u=MS;(l.subtreeFlags&10256)!==0||(l.flags&10256)!==0?tn=5:(tn=0,Jl=ps=null,KS(i,i.pendingLanes));var m=i.pendingLanes;if(m===0&&(hs=null),mi(o),l=l.stateNode,k&&typeof k.onCommitFiberRoot=="function")try{k.onCommitFiberRoot(oe,l,void 0,(l.current.flags&128)===128)}catch{}if(u!==null){l=_.T,m=ee.p,ee.p=2,_.T=null;try{for(var y=i.onRecoverableError,w=0;w<u.length;w++){var N=u[w];y(N.value,{componentStack:N.stack})}}finally{_.T=l,ee.p=m}}(Tr&3)!==0&&qu(),er(i),m=i.pendingLanes,(o&261930)!==0&&(m&42)!==0?i===xm?bo++:(bo=0,xm=i):bo=0,xo(0)}}function KS(i,l){(i.pooledCacheLanes&=l)===0&&(l=i.pooledCache,l!=null&&(i.pooledCache=null,Wa(l)))}function qu(){return FS(),VS(),PS(),YS()}function YS(){if(tn!==5)return!1;var i=ps,l=ym;ym=0;var o=mi(Tr),u=_.T,m=ee.p;try{ee.p=32>o?32:o,_.T=null,o=bm,bm=null;var y=ps,w=Tr;if(tn=0,Jl=ps=null,Tr=0,(xt&6)!==0)throw Error(r(331));var N=xt;if(xt|=4,jS(y.current),CS(y,y.current,w,o),xt=N,xo(0,!1),k&&typeof k.onPostCommitFiberRoot=="function")try{k.onPostCommitFiberRoot(oe,y)}catch{}return!0}finally{ee.p=m,_.T=u,KS(i,l)}}function GS(i,l,o){l=wi(o,l),l=Qp(i.stateNode,l,2),i=as(i,l,2),i!==null&&(Kt(i,2),er(i))}function St(i,l,o){if(i.tag===3)GS(i,i,o);else for(;l!==null;){if(l.tag===3){GS(l,i,o);break}else if(l.tag===1){var u=l.stateNode;if(typeof l.type.getDerivedStateFromError=="function"||typeof u.componentDidCatch=="function"&&(hs===null||!hs.has(u))){i=wi(o,i),o=Xw(2),u=as(l,o,2),u!==null&&(Jw(o,u,l,i),Kt(u,2),er(u));break}}l=l.return}}function Sm(i,l,o){var u=i.pingCache;if(u===null){u=i.pingCache=new qM;var m=new Set;u.set(l,m)}else m=u.get(l),m===void 0&&(m=new Set,u.set(l,m));m.has(o)||(pm=!0,m.add(o),i=FM.bind(null,i,l,o),l.then(i,i))}function FM(i,l,o){var u=i.pingCache;u!==null&&u.delete(l),i.pingedLanes|=i.suspendedLanes&o,i.warmLanes&=~o,jt===i&&(ct&o)===o&&($t===4||$t===3&&(ct&62914560)===ct&&300>lt()-Ru?(xt&2)===0&&Ql(i,0):mm|=o,Xl===ct&&(Xl=0)),er(i)}function XS(i,l){l===0&&(l=Rn()),i=Is(i,l),i!==null&&(Kt(i,l),er(i))}function VM(i){var l=i.memoizedState,o=0;l!==null&&(o=l.retryLane),XS(i,o)}function PM(i,l){var o=0;switch(i.tag){case 31:case 13:var u=i.stateNode,m=i.memoizedState;m!==null&&(o=m.retryLane);break;case 19:u=i.stateNode;break;case 22:u=i.stateNode._retryCache;break;default:throw Error(r(314))}u!==null&&u.delete(l),XS(i,o)}function KM(i,l){return rn(i,l)}var zu=null,Zl=null,Am=!1,Hu=!1,km=!1,gs=0;function er(i){i!==Zl&&i.next===null&&(Zl===null?zu=Zl=i:Zl=Zl.next=i),Hu=!0,Am||(Am=!0,GM())}function xo(i,l){if(!km&&Hu){km=!0;do for(var o=!1,u=zu;u!==null;){if(i!==0){var m=u.pendingLanes;if(m===0)var y=0;else{var w=u.suspendedLanes,N=u.pingedLanes;y=(1<<31-Z(42|i)+1)-1,y&=m&~(w&~N),y=y&201326741?y&201326741|1:y?y|2:0}y!==0&&(o=!0,ZS(u,y))}else y=ct,y=$e(u,u===jt?y:0,u.cancelPendingCommit!==null||u.timeoutHandle!==-1),(y&3)===0||ze(u,y)||(o=!0,ZS(u,y));u=u.next}while(o);km=!1}}function YM(){JS()}function JS(){Hu=Am=!1;var i=0;gs!==0&&rR()&&(i=gs);for(var l=lt(),o=null,u=zu;u!==null;){var m=u.next,y=QS(u,l);y===0?(u.next=null,o===null?zu=m:o.next=m,m===null&&(Zl=o)):(o=u,(i!==0||(y&3)!==0)&&(Hu=!0)),u=m}tn!==0&&tn!==5||xo(i),gs!==0&&(gs=0)}function QS(i,l){for(var o=i.suspendedLanes,u=i.pingedLanes,m=i.expirationTimes,y=i.pendingLanes&-62914561;0<y;){var w=31-Z(y),N=1<<w,q=m[w];q===-1?((N&o)===0||(N&u)!==0)&&(m[w]=Je(N,l)):q<=l&&(i.expiredLanes|=N),y&=~N}if(l=jt,o=ct,o=$e(i,i===l?o:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),u=i.callbackNode,o===0||i===l&&(wt===2||wt===9)||i.cancelPendingCommit!==null)return u!==null&&u!==null&&sn(u),i.callbackNode=null,i.callbackPriority=0;if((o&3)===0||ze(i,o)){if(l=o&-o,l===i.callbackPriority)return l;switch(u!==null&&sn(u),mi(o)){case 2:case 8:o=Jn;break;case 32:o=Tt;break;case 268435456:o=V;break;default:o=Tt}return u=WS.bind(null,i),o=rn(o,u),i.callbackPriority=l,i.callbackNode=o,l}return u!==null&&u!==null&&sn(u),i.callbackPriority=2,i.callbackNode=null,2}function WS(i,l){if(tn!==0&&tn!==5)return i.callbackNode=null,i.callbackPriority=0,null;var o=i.callbackNode;if(qu()&&i.callbackNode!==o)return null;var u=ct;return u=$e(i,i===jt?u:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),u===0?null:(DS(i,u,l),QS(i,lt()),i.callbackNode!=null&&i.callbackNode===o?WS.bind(null,i):null)}function ZS(i,l){if(qu())return null;DS(i,l,!0)}function GM(){lR(function(){(xt&6)!==0?rn(Mn,YM):JS()})}function Cm(){if(gs===0){var i=ql;i===0&&(i=fe,fe<<=1,(fe&261888)===0&&(fe=256)),gs=i}return gs}function e2(i){return i==null||typeof i=="symbol"||typeof i=="boolean"?null:typeof i=="function"?i:Gc(""+i)}function t2(i,l){var o=l.ownerDocument.createElement("input");return o.name=l.name,o.value=l.value,i.id&&o.setAttribute("form",i.id),l.parentNode.insertBefore(o,l),i=new FormData(i),o.parentNode.removeChild(o),i}function XM(i,l,o,u,m){if(l==="submit"&&o&&o.stateNode===m){var y=e2((m[It]||null).action),w=u.submitter;w&&(l=(l=w[It]||null)?e2(l.formAction):w.getAttribute("formAction"),l!==null&&(y=l,w=null));var N=new Wc("action","action",null,u,m);i.push({event:N,listeners:[{instance:null,listener:function(){if(u.defaultPrevented){if(gs!==0){var q=w?t2(m,w):new FormData(m);Pp(o,{pending:!0,data:q,method:m.method,action:y},null,q)}}else typeof y=="function"&&(N.preventDefault(),q=w?t2(m,w):new FormData(m),Pp(o,{pending:!0,data:q,method:m.method,action:y},y,q))},currentTarget:m}]})}}for(var Nm=0;Nm<op.length;Nm++){var Tm=op[Nm],JM=Tm.toLowerCase(),QM=Tm[0].toUpperCase()+Tm.slice(1);Bi(JM,"on"+QM)}Bi(R1,"onAnimationEnd"),Bi(D1,"onAnimationIteration"),Bi(_1,"onAnimationStart"),Bi("dblclick","onDoubleClick"),Bi("focusin","onFocus"),Bi("focusout","onBlur"),Bi(hM,"onTransitionRun"),Bi(pM,"onTransitionStart"),Bi(mM,"onTransitionCancel"),Bi(L1,"onTransitionEnd"),Hn("onMouseEnter",["mouseout","mouseover"]),Hn("onMouseLeave",["mouseout","mouseover"]),Hn("onPointerEnter",["pointerout","pointerover"]),Hn("onPointerLeave",["pointerout","pointerover"]),Ge("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ge("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ge("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ge("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ge("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ge("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var vo="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(" "),WM=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(vo));function n2(i,l){l=(l&4)!==0;for(var o=0;o<i.length;o++){var u=i[o],m=u.event;u=u.listeners;e:{var y=void 0;if(l)for(var w=u.length-1;0<=w;w--){var N=u[w],q=N.instance,ie=N.currentTarget;if(N=N.listener,q!==y&&m.isPropagationStopped())break e;y=N,m.currentTarget=ie;try{y(m)}catch(me){tu(me)}m.currentTarget=null,y=q}else for(w=0;w<u.length;w++){if(N=u[w],q=N.instance,ie=N.currentTarget,N=N.listener,q!==y&&m.isPropagationStopped())break e;y=N,m.currentTarget=ie;try{y(m)}catch(me){tu(me)}m.currentTarget=null,y=q}}}}function ot(i,l){var o=l[cr];o===void 0&&(o=l[cr]=new Set);var u=i+"__bubble";o.has(u)||(i2(l,i,2,!1),o.add(u))}function jm(i,l,o){var u=0;l&&(u|=4),i2(o,i,u,l)}var Iu="_reactListening"+Math.random().toString(36).slice(2);function Em(i){if(!i[Iu]){i[Iu]=!0,H.forEach(function(o){o!=="selectionchange"&&(WM.has(o)||jm(o,!1,i),jm(o,!0,i))});var l=i.nodeType===9?i:i.ownerDocument;l===null||l[Iu]||(l[Iu]=!0,jm("selectionchange",!1,l))}}function i2(i,l,o,u){switch(R2(l)){case 2:var m=NR;break;case 8:m=TR;break;default:m=Vm}o=m.bind(null,l,o,i),m=void 0,!Xh||l!=="touchstart"&&l!=="touchmove"&&l!=="wheel"||(m=!0),u?m!==void 0?i.addEventListener(l,o,{capture:!0,passive:m}):i.addEventListener(l,o,!0):m!==void 0?i.addEventListener(l,o,{passive:m}):i.addEventListener(l,o,!1)}function Om(i,l,o,u,m){var y=u;if((l&1)===0&&(l&2)===0&&u!==null)e:for(;;){if(u===null)return;var w=u.tag;if(w===3||w===4){var N=u.stateNode.containerInfo;if(N===m)break;if(w===4)for(w=u.return;w!==null;){var q=w.tag;if((q===3||q===4)&&w.stateNode.containerInfo===m)return;w=w.return}for(;N!==null;){if(w=zn(N),w===null)return;if(q=w.tag,q===5||q===6||q===26||q===27){u=y=w;continue e}N=N.parentNode}}u=u.return}o1(function(){var ie=y,me=Yh(o),ve=[];e:{var re=B1.get(i);if(re!==void 0){var ce=Wc,Le=i;switch(i){case"keypress":if(Jc(o)===0)break e;case"keydown":case"keyup":ce=P3;break;case"focusin":Le="focus",ce=Zh;break;case"focusout":Le="blur",ce=Zh;break;case"beforeblur":case"afterblur":ce=Zh;break;case"click":if(o.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ce=d1;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ce=D3;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ce=G3;break;case R1:case D1:case _1:ce=B3;break;case L1:ce=J3;break;case"scroll":case"scrollend":ce=M3;break;case"wheel":ce=W3;break;case"copy":case"cut":case"paste":ce=q3;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ce=h1;break;case"toggle":case"beforetoggle":ce=eM}var Ve=(l&4)!==0,Ct=!Ve&&(i==="scroll"||i==="scrollend"),Y=Ve?re!==null?re+"Capture":null:re;Ve=[];for(var U=ie,ne;U!==null;){var be=U;if(ne=be.stateNode,be=be.tag,be!==5&&be!==26&&be!==27||ne===null||Y===null||(be=Ia(U,Y),be!=null&&Ve.push(wo(U,be,ne))),Ct)break;U=U.return}0<Ve.length&&(re=new ce(re,Le,null,o,me),ve.push({event:re,listeners:Ve}))}}if((l&7)===0){e:{if(re=i==="mouseover"||i==="pointerover",ce=i==="mouseout"||i==="pointerout",re&&o!==Kh&&(Le=o.relatedTarget||o.fromElement)&&(zn(Le)||Le[gi]))break e;if((ce||re)&&(re=me.window===me?me:(re=me.ownerDocument)?re.defaultView||re.parentWindow:window,ce?(Le=o.relatedTarget||o.toElement,ce=ie,Le=Le?zn(Le):null,Le!==null&&(Ct=a(Le),Ve=Le.tag,Le!==Ct||Ve!==5&&Ve!==27&&Ve!==6)&&(Le=null)):(ce=null,Le=ie),ce!==Le)){if(Ve=d1,be="onMouseLeave",Y="onMouseEnter",U="mouse",(i==="pointerout"||i==="pointerover")&&(Ve=h1,be="onPointerLeave",Y="onPointerEnter",U="pointer"),Ct=ce==null?re:Bs(ce),ne=Le==null?re:Bs(Le),re=new Ve(be,U+"leave",ce,o,me),re.target=Ct,re.relatedTarget=ne,be=null,zn(me)===ie&&(Ve=new Ve(Y,U+"enter",Le,o,me),Ve.target=ne,Ve.relatedTarget=Ct,be=Ve),Ct=be,ce&&Le)t:{for(Ve=ZM,Y=ce,U=Le,ne=0,be=Y;be;be=Ve(be))ne++;be=0;for(var Ue=U;Ue;Ue=Ve(Ue))be++;for(;0<ne-be;)Y=Ve(Y),ne--;for(;0<be-ne;)U=Ve(U),be--;for(;ne--;){if(Y===U||U!==null&&Y===U.alternate){Ve=Y;break t}Y=Ve(Y),U=Ve(U)}Ve=null}else Ve=null;ce!==null&&r2(ve,re,ce,Ve,!1),Le!==null&&Ct!==null&&r2(ve,Ct,Le,Ve,!0)}}e:{if(re=ie?Bs(ie):window,ce=re.nodeName&&re.nodeName.toLowerCase(),ce==="select"||ce==="input"&&re.type==="file")var yt=w1;else if(x1(re))if(S1)yt=uM;else{yt=oM;var qe=aM}else ce=re.nodeName,!ce||ce.toLowerCase()!=="input"||re.type!=="checkbox"&&re.type!=="radio"?ie&&Ph(ie.elementType)&&(yt=w1):yt=cM;if(yt&&(yt=yt(i,ie))){v1(ve,yt,o,me);break e}qe&&qe(i,re,ie),i==="focusout"&&ie&&re.type==="number"&&ie.memoizedProps.value!=null&&Vh(re,"number",re.value)}switch(qe=ie?Bs(ie):window,i){case"focusin":(x1(qe)||qe.contentEditable==="true")&&(Ol=qe,sp=ie,Xa=null);break;case"focusout":Xa=sp=Ol=null;break;case"mousedown":lp=!0;break;case"contextmenu":case"mouseup":case"dragend":lp=!1,O1(ve,o,me);break;case"selectionchange":if(fM)break;case"keydown":case"keyup":O1(ve,o,me)}var nt;if(tp)e:{switch(i){case"compositionstart":var ut="onCompositionStart";break e;case"compositionend":ut="onCompositionEnd";break e;case"compositionupdate":ut="onCompositionUpdate";break e}ut=void 0}else El?y1(i,o)&&(ut="onCompositionEnd"):i==="keydown"&&o.keyCode===229&&(ut="onCompositionStart");ut&&(p1&&o.locale!=="ko"&&(El||ut!=="onCompositionStart"?ut==="onCompositionEnd"&&El&&(nt=c1()):(es=me,Jh="value"in es?es.value:es.textContent,El=!0)),qe=Uu(ie,ut),0<qe.length&&(ut=new f1(ut,i,null,o,me),ve.push({event:ut,listeners:qe}),nt?ut.data=nt:(nt=b1(o),nt!==null&&(ut.data=nt)))),(nt=nM?iM(i,o):rM(i,o))&&(ut=Uu(ie,"onBeforeInput"),0<ut.length&&(qe=new f1("onBeforeInput","beforeinput",null,o,me),ve.push({event:qe,listeners:ut}),qe.data=nt)),XM(ve,i,ie,o,me)}n2(ve,l)})}function wo(i,l,o){return{instance:i,listener:l,currentTarget:o}}function Uu(i,l){for(var o=l+"Capture",u=[];i!==null;){var m=i,y=m.stateNode;if(m=m.tag,m!==5&&m!==26&&m!==27||y===null||(m=Ia(i,o),m!=null&&u.unshift(wo(i,m,y)),m=Ia(i,l),m!=null&&u.push(wo(i,m,y))),i.tag===3)return u;i=i.return}return[]}function ZM(i){if(i===null)return null;do i=i.return;while(i&&i.tag!==5&&i.tag!==27);return i||null}function r2(i,l,o,u,m){for(var y=l._reactName,w=[];o!==null&&o!==u;){var N=o,q=N.alternate,ie=N.stateNode;if(N=N.tag,q!==null&&q===u)break;N!==5&&N!==26&&N!==27||ie===null||(q=ie,m?(ie=Ia(o,y),ie!=null&&w.unshift(wo(o,ie,q))):m||(ie=Ia(o,y),ie!=null&&w.push(wo(o,ie,q)))),o=o.return}w.length!==0&&i.push({event:l,listeners:w})}var eR=/\r\n?/g,tR=/\u0000|\uFFFD/g;function s2(i){return(typeof i=="string"?i:""+i).replace(eR,`
|
|
9
|
+
`).replace(tR,"")}function l2(i,l){return l=s2(l),s2(i)===l}function kt(i,l,o,u,m,y){switch(o){case"children":typeof u=="string"?l==="body"||l==="textarea"&&u===""||Nl(i,u):(typeof u=="number"||typeof u=="bigint")&&l!=="body"&&Nl(i,""+u);break;case"className":Kc(i,"class",u);break;case"tabIndex":Kc(i,"tabindex",u);break;case"dir":case"role":case"viewBox":case"width":case"height":Kc(i,o,u);break;case"style":l1(i,u,y);break;case"data":if(l!=="object"){Kc(i,"data",u);break}case"src":case"href":if(u===""&&(l!=="a"||o!=="href")){i.removeAttribute(o);break}if(u==null||typeof u=="function"||typeof u=="symbol"||typeof u=="boolean"){i.removeAttribute(o);break}u=Gc(""+u),i.setAttribute(o,u);break;case"action":case"formAction":if(typeof u=="function"){i.setAttribute(o,"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 y=="function"&&(o==="formAction"?(l!=="input"&&kt(i,l,"name",m.name,m,null),kt(i,l,"formEncType",m.formEncType,m,null),kt(i,l,"formMethod",m.formMethod,m,null),kt(i,l,"formTarget",m.formTarget,m,null)):(kt(i,l,"encType",m.encType,m,null),kt(i,l,"method",m.method,m,null),kt(i,l,"target",m.target,m,null)));if(u==null||typeof u=="symbol"||typeof u=="boolean"){i.removeAttribute(o);break}u=Gc(""+u),i.setAttribute(o,u);break;case"onClick":u!=null&&(i.onclick=fr);break;case"onScroll":u!=null&&ot("scroll",i);break;case"onScrollEnd":u!=null&&ot("scrollend",i);break;case"dangerouslySetInnerHTML":if(u!=null){if(typeof u!="object"||!("__html"in u))throw Error(r(61));if(o=u.__html,o!=null){if(m.children!=null)throw Error(r(60));i.innerHTML=o}}break;case"multiple":i.multiple=u&&typeof u!="function"&&typeof u!="symbol";break;case"muted":i.muted=u&&typeof u!="function"&&typeof u!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(u==null||typeof u=="function"||typeof u=="boolean"||typeof u=="symbol"){i.removeAttribute("xlink:href");break}o=Gc(""+u),i.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",o);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":u!=null&&typeof u!="function"&&typeof u!="symbol"?i.setAttribute(o,""+u):i.removeAttribute(o);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":u&&typeof u!="function"&&typeof u!="symbol"?i.setAttribute(o,""):i.removeAttribute(o);break;case"capture":case"download":u===!0?i.setAttribute(o,""):u!==!1&&u!=null&&typeof u!="function"&&typeof u!="symbol"?i.setAttribute(o,u):i.removeAttribute(o);break;case"cols":case"rows":case"size":case"span":u!=null&&typeof u!="function"&&typeof u!="symbol"&&!isNaN(u)&&1<=u?i.setAttribute(o,u):i.removeAttribute(o);break;case"rowSpan":case"start":u==null||typeof u=="function"||typeof u=="symbol"||isNaN(u)?i.removeAttribute(o):i.setAttribute(o,u);break;case"popover":ot("beforetoggle",i),ot("toggle",i),Pc(i,"popover",u);break;case"xlinkActuate":dr(i,"http://www.w3.org/1999/xlink","xlink:actuate",u);break;case"xlinkArcrole":dr(i,"http://www.w3.org/1999/xlink","xlink:arcrole",u);break;case"xlinkRole":dr(i,"http://www.w3.org/1999/xlink","xlink:role",u);break;case"xlinkShow":dr(i,"http://www.w3.org/1999/xlink","xlink:show",u);break;case"xlinkTitle":dr(i,"http://www.w3.org/1999/xlink","xlink:title",u);break;case"xlinkType":dr(i,"http://www.w3.org/1999/xlink","xlink:type",u);break;case"xmlBase":dr(i,"http://www.w3.org/XML/1998/namespace","xml:base",u);break;case"xmlLang":dr(i,"http://www.w3.org/XML/1998/namespace","xml:lang",u);break;case"xmlSpace":dr(i,"http://www.w3.org/XML/1998/namespace","xml:space",u);break;case"is":Pc(i,"is",u);break;case"innerText":case"textContent":break;default:(!(2<o.length)||o[0]!=="o"&&o[0]!=="O"||o[1]!=="n"&&o[1]!=="N")&&(o=E3.get(o)||o,Pc(i,o,u))}}function Mm(i,l,o,u,m,y){switch(o){case"style":l1(i,u,y);break;case"dangerouslySetInnerHTML":if(u!=null){if(typeof u!="object"||!("__html"in u))throw Error(r(61));if(o=u.__html,o!=null){if(m.children!=null)throw Error(r(60));i.innerHTML=o}}break;case"children":typeof u=="string"?Nl(i,u):(typeof u=="number"||typeof u=="bigint")&&Nl(i,""+u);break;case"onScroll":u!=null&&ot("scroll",i);break;case"onScrollEnd":u!=null&&ot("scrollend",i);break;case"onClick":u!=null&&(i.onclick=fr);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!ae.hasOwnProperty(o))e:{if(o[0]==="o"&&o[1]==="n"&&(m=o.endsWith("Capture"),l=o.slice(2,m?o.length-7:void 0),y=i[It]||null,y=y!=null?y[o]:null,typeof y=="function"&&i.removeEventListener(l,y,m),typeof u=="function")){typeof y!="function"&&y!==null&&(o in i?i[o]=null:i.hasAttribute(o)&&i.removeAttribute(o)),i.addEventListener(l,u,m);break e}o in i?i[o]=u:u===!0?i.setAttribute(o,""):Pc(i,o,u)}}}function bn(i,l,o){switch(l){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ot("error",i),ot("load",i);var u=!1,m=!1,y;for(y in o)if(o.hasOwnProperty(y)){var w=o[y];if(w!=null)switch(y){case"src":u=!0;break;case"srcSet":m=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,l));default:kt(i,l,y,w,o,null)}}m&&kt(i,l,"srcSet",o.srcSet,o,null),u&&kt(i,l,"src",o.src,o,null);return;case"input":ot("invalid",i);var N=y=w=m=null,q=null,ie=null;for(u in o)if(o.hasOwnProperty(u)){var me=o[u];if(me!=null)switch(u){case"name":m=me;break;case"type":w=me;break;case"checked":q=me;break;case"defaultChecked":ie=me;break;case"value":y=me;break;case"defaultValue":N=me;break;case"children":case"dangerouslySetInnerHTML":if(me!=null)throw Error(r(137,l));break;default:kt(i,l,u,me,o,null)}}n1(i,y,N,q,ie,w,m,!1);return;case"select":ot("invalid",i),u=w=y=null;for(m in o)if(o.hasOwnProperty(m)&&(N=o[m],N!=null))switch(m){case"value":y=N;break;case"defaultValue":w=N;break;case"multiple":u=N;default:kt(i,l,m,N,o,null)}l=y,o=w,i.multiple=!!u,l!=null?Cl(i,!!u,l,!1):o!=null&&Cl(i,!!u,o,!0);return;case"textarea":ot("invalid",i),y=m=u=null;for(w in o)if(o.hasOwnProperty(w)&&(N=o[w],N!=null))switch(w){case"value":u=N;break;case"defaultValue":m=N;break;case"children":y=N;break;case"dangerouslySetInnerHTML":if(N!=null)throw Error(r(91));break;default:kt(i,l,w,N,o,null)}r1(i,u,m,y);return;case"option":for(q in o)o.hasOwnProperty(q)&&(u=o[q],u!=null)&&(q==="selected"?i.selected=u&&typeof u!="function"&&typeof u!="symbol":kt(i,l,q,u,o,null));return;case"dialog":ot("beforetoggle",i),ot("toggle",i),ot("cancel",i),ot("close",i);break;case"iframe":case"object":ot("load",i);break;case"video":case"audio":for(u=0;u<vo.length;u++)ot(vo[u],i);break;case"image":ot("error",i),ot("load",i);break;case"details":ot("toggle",i);break;case"embed":case"source":case"link":ot("error",i),ot("load",i);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(ie in o)if(o.hasOwnProperty(ie)&&(u=o[ie],u!=null))switch(ie){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,l));default:kt(i,l,ie,u,o,null)}return;default:if(Ph(l)){for(me in o)o.hasOwnProperty(me)&&(u=o[me],u!==void 0&&Mm(i,l,me,u,o,void 0));return}}for(N in o)o.hasOwnProperty(N)&&(u=o[N],u!=null&&kt(i,l,N,u,o,null))}function nR(i,l,o,u){switch(l){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var m=null,y=null,w=null,N=null,q=null,ie=null,me=null;for(ce in o){var ve=o[ce];if(o.hasOwnProperty(ce)&&ve!=null)switch(ce){case"checked":break;case"value":break;case"defaultValue":q=ve;default:u.hasOwnProperty(ce)||kt(i,l,ce,null,u,ve)}}for(var re in u){var ce=u[re];if(ve=o[re],u.hasOwnProperty(re)&&(ce!=null||ve!=null))switch(re){case"type":y=ce;break;case"name":m=ce;break;case"checked":ie=ce;break;case"defaultChecked":me=ce;break;case"value":w=ce;break;case"defaultValue":N=ce;break;case"children":case"dangerouslySetInnerHTML":if(ce!=null)throw Error(r(137,l));break;default:ce!==ve&&kt(i,l,re,ce,u,ve)}}Fh(i,w,N,q,ie,me,y,m);return;case"select":ce=w=N=re=null;for(y in o)if(q=o[y],o.hasOwnProperty(y)&&q!=null)switch(y){case"value":break;case"multiple":ce=q;default:u.hasOwnProperty(y)||kt(i,l,y,null,u,q)}for(m in u)if(y=u[m],q=o[m],u.hasOwnProperty(m)&&(y!=null||q!=null))switch(m){case"value":re=y;break;case"defaultValue":N=y;break;case"multiple":w=y;default:y!==q&&kt(i,l,m,y,u,q)}l=N,o=w,u=ce,re!=null?Cl(i,!!o,re,!1):!!u!=!!o&&(l!=null?Cl(i,!!o,l,!0):Cl(i,!!o,o?[]:"",!1));return;case"textarea":ce=re=null;for(N in o)if(m=o[N],o.hasOwnProperty(N)&&m!=null&&!u.hasOwnProperty(N))switch(N){case"value":break;case"children":break;default:kt(i,l,N,null,u,m)}for(w in u)if(m=u[w],y=o[w],u.hasOwnProperty(w)&&(m!=null||y!=null))switch(w){case"value":re=m;break;case"defaultValue":ce=m;break;case"children":break;case"dangerouslySetInnerHTML":if(m!=null)throw Error(r(91));break;default:m!==y&&kt(i,l,w,m,u,y)}i1(i,re,ce);return;case"option":for(var Le in o)re=o[Le],o.hasOwnProperty(Le)&&re!=null&&!u.hasOwnProperty(Le)&&(Le==="selected"?i.selected=!1:kt(i,l,Le,null,u,re));for(q in u)re=u[q],ce=o[q],u.hasOwnProperty(q)&&re!==ce&&(re!=null||ce!=null)&&(q==="selected"?i.selected=re&&typeof re!="function"&&typeof re!="symbol":kt(i,l,q,re,u,ce));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 Ve in o)re=o[Ve],o.hasOwnProperty(Ve)&&re!=null&&!u.hasOwnProperty(Ve)&&kt(i,l,Ve,null,u,re);for(ie in u)if(re=u[ie],ce=o[ie],u.hasOwnProperty(ie)&&re!==ce&&(re!=null||ce!=null))switch(ie){case"children":case"dangerouslySetInnerHTML":if(re!=null)throw Error(r(137,l));break;default:kt(i,l,ie,re,u,ce)}return;default:if(Ph(l)){for(var Ct in o)re=o[Ct],o.hasOwnProperty(Ct)&&re!==void 0&&!u.hasOwnProperty(Ct)&&Mm(i,l,Ct,void 0,u,re);for(me in u)re=u[me],ce=o[me],!u.hasOwnProperty(me)||re===ce||re===void 0&&ce===void 0||Mm(i,l,me,re,u,ce);return}}for(var Y in o)re=o[Y],o.hasOwnProperty(Y)&&re!=null&&!u.hasOwnProperty(Y)&&kt(i,l,Y,null,u,re);for(ve in u)re=u[ve],ce=o[ve],!u.hasOwnProperty(ve)||re===ce||re==null&&ce==null||kt(i,l,ve,re,u,ce)}function a2(i){switch(i){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function iR(){if(typeof performance.getEntriesByType=="function"){for(var i=0,l=0,o=performance.getEntriesByType("resource"),u=0;u<o.length;u++){var m=o[u],y=m.transferSize,w=m.initiatorType,N=m.duration;if(y&&N&&a2(w)){for(w=0,N=m.responseEnd,u+=1;u<o.length;u++){var q=o[u],ie=q.startTime;if(ie>N)break;var me=q.transferSize,ve=q.initiatorType;me&&a2(ve)&&(q=q.responseEnd,w+=me*(q<N?1:(N-ie)/(q-ie)))}if(--u,l+=8*(y+w)/(m.duration/1e3),i++,10<i)break}}if(0<i)return l/i/1e6}return navigator.connection&&(i=navigator.connection.downlink,typeof i=="number")?i:5}var Rm=null,Dm=null;function Fu(i){return i.nodeType===9?i:i.ownerDocument}function o2(i){switch(i){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function c2(i,l){if(i===0)switch(l){case"svg":return 1;case"math":return 2;default:return 0}return i===1&&l==="foreignObject"?0:i}function _m(i,l){return i==="textarea"||i==="noscript"||typeof l.children=="string"||typeof l.children=="number"||typeof l.children=="bigint"||typeof l.dangerouslySetInnerHTML=="object"&&l.dangerouslySetInnerHTML!==null&&l.dangerouslySetInnerHTML.__html!=null}var Lm=null;function rR(){var i=window.event;return i&&i.type==="popstate"?i===Lm?!1:(Lm=i,!0):(Lm=null,!1)}var u2=typeof setTimeout=="function"?setTimeout:void 0,sR=typeof clearTimeout=="function"?clearTimeout:void 0,d2=typeof Promise=="function"?Promise:void 0,lR=typeof queueMicrotask=="function"?queueMicrotask:typeof d2<"u"?function(i){return d2.resolve(null).then(i).catch(aR)}:u2;function aR(i){setTimeout(function(){throw i})}function ys(i){return i==="head"}function f2(i,l){var o=l,u=0;do{var m=o.nextSibling;if(i.removeChild(o),m&&m.nodeType===8)if(o=m.data,o==="/$"||o==="/&"){if(u===0){i.removeChild(m),ia(l);return}u--}else if(o==="$"||o==="$?"||o==="$~"||o==="$!"||o==="&")u++;else if(o==="html")So(i.ownerDocument.documentElement);else if(o==="head"){o=i.ownerDocument.head,So(o);for(var y=o.firstChild;y;){var w=y.nextSibling,N=y.nodeName;y[Ji]||N==="SCRIPT"||N==="STYLE"||N==="LINK"&&y.rel.toLowerCase()==="stylesheet"||o.removeChild(y),y=w}}else o==="body"&&So(i.ownerDocument.body);o=m}while(o);ia(l)}function h2(i,l){var o=i;i=0;do{var u=o.nextSibling;if(o.nodeType===1?l?(o._stashedDisplay=o.style.display,o.style.display="none"):(o.style.display=o._stashedDisplay||"",o.getAttribute("style")===""&&o.removeAttribute("style")):o.nodeType===3&&(l?(o._stashedText=o.nodeValue,o.nodeValue=""):o.nodeValue=o._stashedText||""),u&&u.nodeType===8)if(o=u.data,o==="/$"){if(i===0)break;i--}else o!=="$"&&o!=="$?"&&o!=="$~"&&o!=="$!"||i++;o=u}while(o)}function Bm(i){var l=i.firstChild;for(l&&l.nodeType===10&&(l=l.nextSibling);l;){var o=l;switch(l=l.nextSibling,o.nodeName){case"HTML":case"HEAD":case"BODY":Bm(o),Al(o);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(o.rel.toLowerCase()==="stylesheet")continue}i.removeChild(o)}}function oR(i,l,o,u){for(;i.nodeType===1;){var m=o;if(i.nodeName.toLowerCase()!==l.toLowerCase()){if(!u&&(i.nodeName!=="INPUT"||i.type!=="hidden"))break}else if(u){if(!i[Ji])switch(l){case"meta":if(!i.hasAttribute("itemprop"))break;return i;case"link":if(y=i.getAttribute("rel"),y==="stylesheet"&&i.hasAttribute("data-precedence"))break;if(y!==m.rel||i.getAttribute("href")!==(m.href==null||m.href===""?null:m.href)||i.getAttribute("crossorigin")!==(m.crossOrigin==null?null:m.crossOrigin)||i.getAttribute("title")!==(m.title==null?null:m.title))break;return i;case"style":if(i.hasAttribute("data-precedence"))break;return i;case"script":if(y=i.getAttribute("src"),(y!==(m.src==null?null:m.src)||i.getAttribute("type")!==(m.type==null?null:m.type)||i.getAttribute("crossorigin")!==(m.crossOrigin==null?null:m.crossOrigin))&&y&&i.hasAttribute("async")&&!i.hasAttribute("itemprop"))break;return i;default:return i}}else if(l==="input"&&i.type==="hidden"){var y=m.name==null?null:""+m.name;if(m.type==="hidden"&&i.getAttribute("name")===y)return i}else return i;if(i=Ni(i.nextSibling),i===null)break}return null}function cR(i,l,o){if(l==="")return null;for(;i.nodeType!==3;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!o||(i=Ni(i.nextSibling),i===null))return null;return i}function p2(i,l){for(;i.nodeType!==8;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!l||(i=Ni(i.nextSibling),i===null))return null;return i}function $m(i){return i.data==="$?"||i.data==="$~"}function qm(i){return i.data==="$!"||i.data==="$?"&&i.ownerDocument.readyState!=="loading"}function uR(i,l){var o=i.ownerDocument;if(i.data==="$~")i._reactRetry=l;else if(i.data!=="$?"||o.readyState!=="loading")l();else{var u=function(){l(),o.removeEventListener("DOMContentLoaded",u)};o.addEventListener("DOMContentLoaded",u),i._reactRetry=u}}function Ni(i){for(;i!=null;i=i.nextSibling){var l=i.nodeType;if(l===1||l===3)break;if(l===8){if(l=i.data,l==="$"||l==="$!"||l==="$?"||l==="$~"||l==="&"||l==="F!"||l==="F")break;if(l==="/$"||l==="/&")return null}}return i}var zm=null;function m2(i){i=i.nextSibling;for(var l=0;i;){if(i.nodeType===8){var o=i.data;if(o==="/$"||o==="/&"){if(l===0)return Ni(i.nextSibling);l--}else o!=="$"&&o!=="$!"&&o!=="$?"&&o!=="$~"&&o!=="&"||l++}i=i.nextSibling}return null}function g2(i){i=i.previousSibling;for(var l=0;i;){if(i.nodeType===8){var o=i.data;if(o==="$"||o==="$!"||o==="$?"||o==="$~"||o==="&"){if(l===0)return i;l--}else o!=="/$"&&o!=="/&"||l++}i=i.previousSibling}return null}function y2(i,l,o){switch(l=Fu(o),i){case"html":if(i=l.documentElement,!i)throw Error(r(452));return i;case"head":if(i=l.head,!i)throw Error(r(453));return i;case"body":if(i=l.body,!i)throw Error(r(454));return i;default:throw Error(r(451))}}function So(i){for(var l=i.attributes;l.length;)i.removeAttributeNode(l[0]);Al(i)}var Ti=new Map,b2=new Set;function Vu(i){return typeof i.getRootNode=="function"?i.getRootNode():i.nodeType===9?i:i.ownerDocument}var jr=ee.d;ee.d={f:dR,r:fR,D:hR,C:pR,L:mR,m:gR,X:bR,S:yR,M:xR};function dR(){var i=jr.f(),l=Lu();return i||l}function fR(i){var l=ur(i);l!==null&&l.tag===5&&l.type==="form"?Lw(l):jr.r(i)}var ea=typeof document>"u"?null:document;function x2(i,l,o){var u=ea;if(u&&typeof l=="string"&&l){var m=xi(l);m='link[rel="'+i+'"][href="'+m+'"]',typeof o=="string"&&(m+='[crossorigin="'+o+'"]'),b2.has(m)||(b2.add(m),i={rel:i,crossOrigin:o,href:l},u.querySelector(m)===null&&(l=u.createElement("link"),bn(l,"link",i),Ut(l),u.head.appendChild(l)))}}function hR(i){jr.D(i),x2("dns-prefetch",i,null)}function pR(i,l){jr.C(i,l),x2("preconnect",i,l)}function mR(i,l,o){jr.L(i,l,o);var u=ea;if(u&&i&&l){var m='link[rel="preload"][as="'+xi(l)+'"]';l==="image"&&o&&o.imageSrcSet?(m+='[imagesrcset="'+xi(o.imageSrcSet)+'"]',typeof o.imageSizes=="string"&&(m+='[imagesizes="'+xi(o.imageSizes)+'"]')):m+='[href="'+xi(i)+'"]';var y=m;switch(l){case"style":y=ta(i);break;case"script":y=na(i)}Ti.has(y)||(i=b({rel:"preload",href:l==="image"&&o&&o.imageSrcSet?void 0:i,as:l},o),Ti.set(y,i),u.querySelector(m)!==null||l==="style"&&u.querySelector(Ao(y))||l==="script"&&u.querySelector(ko(y))||(l=u.createElement("link"),bn(l,"link",i),Ut(l),u.head.appendChild(l)))}}function gR(i,l){jr.m(i,l);var o=ea;if(o&&i){var u=l&&typeof l.as=="string"?l.as:"script",m='link[rel="modulepreload"][as="'+xi(u)+'"][href="'+xi(i)+'"]',y=m;switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":y=na(i)}if(!Ti.has(y)&&(i=b({rel:"modulepreload",href:i},l),Ti.set(y,i),o.querySelector(m)===null)){switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(o.querySelector(ko(y)))return}u=o.createElement("link"),bn(u,"link",i),Ut(u),o.head.appendChild(u)}}}function yR(i,l,o){jr.S(i,l,o);var u=ea;if(u&&i){var m=Zr(u).hoistableStyles,y=ta(i);l=l||"default";var w=m.get(y);if(!w){var N={loading:0,preload:null};if(w=u.querySelector(Ao(y)))N.loading=5;else{i=b({rel:"stylesheet",href:i,"data-precedence":l},o),(o=Ti.get(y))&&Hm(i,o);var q=w=u.createElement("link");Ut(q),bn(q,"link",i),q._p=new Promise(function(ie,me){q.onload=ie,q.onerror=me}),q.addEventListener("load",function(){N.loading|=1}),q.addEventListener("error",function(){N.loading|=2}),N.loading|=4,Pu(w,l,u)}w={type:"stylesheet",instance:w,count:1,state:N},m.set(y,w)}}}function bR(i,l){jr.X(i,l);var o=ea;if(o&&i){var u=Zr(o).hoistableScripts,m=na(i),y=u.get(m);y||(y=o.querySelector(ko(m)),y||(i=b({src:i,async:!0},l),(l=Ti.get(m))&&Im(i,l),y=o.createElement("script"),Ut(y),bn(y,"link",i),o.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},u.set(m,y))}}function xR(i,l){jr.M(i,l);var o=ea;if(o&&i){var u=Zr(o).hoistableScripts,m=na(i),y=u.get(m);y||(y=o.querySelector(ko(m)),y||(i=b({src:i,async:!0,type:"module"},l),(l=Ti.get(m))&&Im(i,l),y=o.createElement("script"),Ut(y),bn(y,"link",i),o.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},u.set(m,y))}}function v2(i,l,o,u){var m=(m=Re.current)?Vu(m):null;if(!m)throw Error(r(446));switch(i){case"meta":case"title":return null;case"style":return typeof o.precedence=="string"&&typeof o.href=="string"?(l=ta(o.href),o=Zr(m).hoistableStyles,u=o.get(l),u||(u={type:"style",instance:null,count:0,state:null},o.set(l,u)),u):{type:"void",instance:null,count:0,state:null};case"link":if(o.rel==="stylesheet"&&typeof o.href=="string"&&typeof o.precedence=="string"){i=ta(o.href);var y=Zr(m).hoistableStyles,w=y.get(i);if(w||(m=m.ownerDocument||m,w={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},y.set(i,w),(y=m.querySelector(Ao(i)))&&!y._p&&(w.instance=y,w.state.loading=5),Ti.has(i)||(o={rel:"preload",as:"style",href:o.href,crossOrigin:o.crossOrigin,integrity:o.integrity,media:o.media,hrefLang:o.hrefLang,referrerPolicy:o.referrerPolicy},Ti.set(i,o),y||vR(m,i,o,w.state))),l&&u===null)throw Error(r(528,""));return w}if(l&&u!==null)throw Error(r(529,""));return null;case"script":return l=o.async,o=o.src,typeof o=="string"&&l&&typeof l!="function"&&typeof l!="symbol"?(l=na(o),o=Zr(m).hoistableScripts,u=o.get(l),u||(u={type:"script",instance:null,count:0,state:null},o.set(l,u)),u):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,i))}}function ta(i){return'href="'+xi(i)+'"'}function Ao(i){return'link[rel="stylesheet"]['+i+"]"}function w2(i){return b({},i,{"data-precedence":i.precedence,precedence:null})}function vR(i,l,o,u){i.querySelector('link[rel="preload"][as="style"]['+l+"]")?u.loading=1:(l=i.createElement("link"),u.preload=l,l.addEventListener("load",function(){return u.loading|=1}),l.addEventListener("error",function(){return u.loading|=2}),bn(l,"link",o),Ut(l),i.head.appendChild(l))}function na(i){return'[src="'+xi(i)+'"]'}function ko(i){return"script[async]"+i}function S2(i,l,o){if(l.count++,l.instance===null)switch(l.type){case"style":var u=i.querySelector('style[data-href~="'+xi(o.href)+'"]');if(u)return l.instance=u,Ut(u),u;var m=b({},o,{"data-href":o.href,"data-precedence":o.precedence,href:null,precedence:null});return u=(i.ownerDocument||i).createElement("style"),Ut(u),bn(u,"style",m),Pu(u,o.precedence,i),l.instance=u;case"stylesheet":m=ta(o.href);var y=i.querySelector(Ao(m));if(y)return l.state.loading|=4,l.instance=y,Ut(y),y;u=w2(o),(m=Ti.get(m))&&Hm(u,m),y=(i.ownerDocument||i).createElement("link"),Ut(y);var w=y;return w._p=new Promise(function(N,q){w.onload=N,w.onerror=q}),bn(y,"link",u),l.state.loading|=4,Pu(y,o.precedence,i),l.instance=y;case"script":return y=na(o.src),(m=i.querySelector(ko(y)))?(l.instance=m,Ut(m),m):(u=o,(m=Ti.get(y))&&(u=b({},o),Im(u,m)),i=i.ownerDocument||i,m=i.createElement("script"),Ut(m),bn(m,"link",u),i.head.appendChild(m),l.instance=m);case"void":return null;default:throw Error(r(443,l.type))}else l.type==="stylesheet"&&(l.state.loading&4)===0&&(u=l.instance,l.state.loading|=4,Pu(u,o.precedence,i));return l.instance}function Pu(i,l,o){for(var u=o.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),m=u.length?u[u.length-1]:null,y=m,w=0;w<u.length;w++){var N=u[w];if(N.dataset.precedence===l)y=N;else if(y!==m)break}y?y.parentNode.insertBefore(i,y.nextSibling):(l=o.nodeType===9?o.head:o,l.insertBefore(i,l.firstChild))}function Hm(i,l){i.crossOrigin==null&&(i.crossOrigin=l.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=l.referrerPolicy),i.title==null&&(i.title=l.title)}function Im(i,l){i.crossOrigin==null&&(i.crossOrigin=l.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=l.referrerPolicy),i.integrity==null&&(i.integrity=l.integrity)}var Ku=null;function A2(i,l,o){if(Ku===null){var u=new Map,m=Ku=new Map;m.set(o,u)}else m=Ku,u=m.get(o),u||(u=new Map,m.set(o,u));if(u.has(i))return u;for(u.set(i,null),o=o.getElementsByTagName(i),m=0;m<o.length;m++){var y=o[m];if(!(y[Ji]||y[_t]||i==="link"&&y.getAttribute("rel")==="stylesheet")&&y.namespaceURI!=="http://www.w3.org/2000/svg"){var w=y.getAttribute(l)||"";w=i+w;var N=u.get(w);N?N.push(y):u.set(w,[y])}}return u}function k2(i,l,o){i=i.ownerDocument||i,i.head.insertBefore(o,l==="title"?i.querySelector("head > title"):null)}function wR(i,l,o){if(o===1||l.itemProp!=null)return!1;switch(i){case"meta":case"title":return!0;case"style":if(typeof l.precedence!="string"||typeof l.href!="string"||l.href==="")break;return!0;case"link":if(typeof l.rel!="string"||typeof l.href!="string"||l.href===""||l.onLoad||l.onError)break;return l.rel==="stylesheet"?(i=l.disabled,typeof l.precedence=="string"&&i==null):!0;case"script":if(l.async&&typeof l.async!="function"&&typeof l.async!="symbol"&&!l.onLoad&&!l.onError&&l.src&&typeof l.src=="string")return!0}return!1}function C2(i){return!(i.type==="stylesheet"&&(i.state.loading&3)===0)}function SR(i,l,o,u){if(o.type==="stylesheet"&&(typeof u.media!="string"||matchMedia(u.media).matches!==!1)&&(o.state.loading&4)===0){if(o.instance===null){var m=ta(u.href),y=l.querySelector(Ao(m));if(y){l=y._p,l!==null&&typeof l=="object"&&typeof l.then=="function"&&(i.count++,i=Yu.bind(i),l.then(i,i)),o.state.loading|=4,o.instance=y,Ut(y);return}y=l.ownerDocument||l,u=w2(u),(m=Ti.get(m))&&Hm(u,m),y=y.createElement("link"),Ut(y);var w=y;w._p=new Promise(function(N,q){w.onload=N,w.onerror=q}),bn(y,"link",u),o.instance=y}i.stylesheets===null&&(i.stylesheets=new Map),i.stylesheets.set(o,l),(l=o.state.preload)&&(o.state.loading&3)===0&&(i.count++,o=Yu.bind(i),l.addEventListener("load",o),l.addEventListener("error",o))}}var Um=0;function AR(i,l){return i.stylesheets&&i.count===0&&Xu(i,i.stylesheets),0<i.count||0<i.imgCount?function(o){var u=setTimeout(function(){if(i.stylesheets&&Xu(i,i.stylesheets),i.unsuspend){var y=i.unsuspend;i.unsuspend=null,y()}},6e4+l);0<i.imgBytes&&Um===0&&(Um=62500*iR());var m=setTimeout(function(){if(i.waitingForImages=!1,i.count===0&&(i.stylesheets&&Xu(i,i.stylesheets),i.unsuspend)){var y=i.unsuspend;i.unsuspend=null,y()}},(i.imgBytes>Um?50:800)+l);return i.unsuspend=o,function(){i.unsuspend=null,clearTimeout(u),clearTimeout(m)}}:null}function Yu(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Xu(this,this.stylesheets);else if(this.unsuspend){var i=this.unsuspend;this.unsuspend=null,i()}}}var Gu=null;function Xu(i,l){i.stylesheets=null,i.unsuspend!==null&&(i.count++,Gu=new Map,l.forEach(kR,i),Gu=null,Yu.call(i))}function kR(i,l){if(!(l.state.loading&4)){var o=Gu.get(i);if(o)var u=o.get(null);else{o=new Map,Gu.set(i,o);for(var m=i.querySelectorAll("link[data-precedence],style[data-precedence]"),y=0;y<m.length;y++){var w=m[y];(w.nodeName==="LINK"||w.getAttribute("media")!=="not all")&&(o.set(w.dataset.precedence,w),u=w)}u&&o.set(null,u)}m=l.instance,w=m.getAttribute("data-precedence"),y=o.get(w)||u,y===u&&o.set(null,m),o.set(w,m),this.count++,u=Yu.bind(this),m.addEventListener("load",u),m.addEventListener("error",u),y?y.parentNode.insertBefore(m,y.nextSibling):(i=i.nodeType===9?i.head:i,i.insertBefore(m,i.firstChild)),l.state.loading|=4}}var Co={$$typeof:E,Provider:null,Consumer:null,_currentValue:he,_currentValue2:he,_threadCount:0};function CR(i,l,o,u,m,y,w,N,q){this.tag=1,this.containerInfo=i,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=Dn(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Dn(0),this.hiddenUpdates=Dn(null),this.identifierPrefix=u,this.onUncaughtError=m,this.onCaughtError=y,this.onRecoverableError=w,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=q,this.incompleteTransitions=new Map}function N2(i,l,o,u,m,y,w,N,q,ie,me,ve){return i=new CR(i,l,o,w,q,ie,me,ve,N),l=1,y===!0&&(l|=24),y=Zn(3,null,null,l),i.current=y,y.stateNode=i,l=wp(),l.refCount++,i.pooledCache=l,l.refCount++,y.memoizedState={element:u,isDehydrated:o,cache:l},Cp(y),i}function T2(i){return i?(i=Dl,i):Dl}function j2(i,l,o,u,m,y){m=T2(m),u.context===null?u.context=m:u.pendingContext=m,u=ls(l),u.payload={element:o},y=y===void 0?null:y,y!==null&&(u.callback=y),o=as(i,u,l),o!==null&&(Kn(o,i,l),no(o,i,l))}function E2(i,l){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var o=i.retryLane;i.retryLane=o!==0&&o<l?o:l}}function Fm(i,l){E2(i,l),(i=i.alternate)&&E2(i,l)}function O2(i){if(i.tag===13||i.tag===31){var l=Is(i,67108864);l!==null&&Kn(l,i,67108864),Fm(i,67108864)}}function M2(i){if(i.tag===13||i.tag===31){var l=ri();l=Yt(l);var o=Is(i,l);o!==null&&Kn(o,i,l),Fm(i,l)}}var Ju=!0;function NR(i,l,o,u){var m=_.T;_.T=null;var y=ee.p;try{ee.p=2,Vm(i,l,o,u)}finally{ee.p=y,_.T=m}}function TR(i,l,o,u){var m=_.T;_.T=null;var y=ee.p;try{ee.p=8,Vm(i,l,o,u)}finally{ee.p=y,_.T=m}}function Vm(i,l,o,u){if(Ju){var m=Pm(u);if(m===null)Om(i,l,u,Qu,o),D2(i,u);else if(ER(m,i,l,o,u))u.stopPropagation();else if(D2(i,u),l&4&&-1<jR.indexOf(i)){for(;m!==null;){var y=ur(m);if(y!==null)switch(y.tag){case 3:if(y=y.stateNode,y.current.memoizedState.isDehydrated){var w=De(y.pendingLanes);if(w!==0){var N=y;for(N.pendingLanes|=2,N.entangledLanes|=2;w;){var q=1<<31-Z(w);N.entanglements[1]|=q,w&=~q}er(y),(xt&6)===0&&(Du=lt()+500,xo(0))}}break;case 31:case 13:N=Is(y,2),N!==null&&Kn(N,y,2),Lu(),Fm(y,2)}if(y=Pm(u),y===null&&Om(i,l,u,Qu,o),y===m)break;m=y}m!==null&&u.stopPropagation()}else Om(i,l,u,null,o)}}function Pm(i){return i=Yh(i),Km(i)}var Qu=null;function Km(i){if(Qu=null,i=zn(i),i!==null){var l=a(i);if(l===null)i=null;else{var o=l.tag;if(o===13){if(i=c(l),i!==null)return i;i=null}else if(o===31){if(i=d(l),i!==null)return i;i=null}else if(o===3){if(l.stateNode.current.memoizedState.isDehydrated)return l.tag===3?l.stateNode.containerInfo:null;i=null}else l!==i&&(i=null)}}return Qu=i,null}function R2(i){switch(i){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(pi()){case Mn:return 2;case Jn:return 8;case Tt:case x:return 32;case V:return 268435456;default:return 32}default:return 32}}var Ym=!1,bs=null,xs=null,vs=null,No=new Map,To=new Map,ws=[],jR="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 D2(i,l){switch(i){case"focusin":case"focusout":bs=null;break;case"dragenter":case"dragleave":xs=null;break;case"mouseover":case"mouseout":vs=null;break;case"pointerover":case"pointerout":No.delete(l.pointerId);break;case"gotpointercapture":case"lostpointercapture":To.delete(l.pointerId)}}function jo(i,l,o,u,m,y){return i===null||i.nativeEvent!==y?(i={blockedOn:l,domEventName:o,eventSystemFlags:u,nativeEvent:y,targetContainers:[m]},l!==null&&(l=ur(l),l!==null&&O2(l)),i):(i.eventSystemFlags|=u,l=i.targetContainers,m!==null&&l.indexOf(m)===-1&&l.push(m),i)}function ER(i,l,o,u,m){switch(l){case"focusin":return bs=jo(bs,i,l,o,u,m),!0;case"dragenter":return xs=jo(xs,i,l,o,u,m),!0;case"mouseover":return vs=jo(vs,i,l,o,u,m),!0;case"pointerover":var y=m.pointerId;return No.set(y,jo(No.get(y)||null,i,l,o,u,m)),!0;case"gotpointercapture":return y=m.pointerId,To.set(y,jo(To.get(y)||null,i,l,o,u,m)),!0}return!1}function _2(i){var l=zn(i.target);if(l!==null){var o=a(l);if(o!==null){if(l=o.tag,l===13){if(l=c(o),l!==null){i.blockedOn=l,Wr(i.priority,function(){M2(o)});return}}else if(l===31){if(l=d(o),l!==null){i.blockedOn=l,Wr(i.priority,function(){M2(o)});return}}else if(l===3&&o.stateNode.current.memoizedState.isDehydrated){i.blockedOn=o.tag===3?o.stateNode.containerInfo:null;return}}}i.blockedOn=null}function Wu(i){if(i.blockedOn!==null)return!1;for(var l=i.targetContainers;0<l.length;){var o=Pm(i.nativeEvent);if(o===null){o=i.nativeEvent;var u=new o.constructor(o.type,o);Kh=u,o.target.dispatchEvent(u),Kh=null}else return l=ur(o),l!==null&&O2(l),i.blockedOn=o,!1;l.shift()}return!0}function L2(i,l,o){Wu(i)&&o.delete(l)}function OR(){Ym=!1,bs!==null&&Wu(bs)&&(bs=null),xs!==null&&Wu(xs)&&(xs=null),vs!==null&&Wu(vs)&&(vs=null),No.forEach(L2),To.forEach(L2)}function Zu(i,l){i.blockedOn===l&&(i.blockedOn=null,Ym||(Ym=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,OR)))}var ed=null;function B2(i){ed!==i&&(ed=i,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){ed===i&&(ed=null);for(var l=0;l<i.length;l+=3){var o=i[l],u=i[l+1],m=i[l+2];if(typeof u!="function"){if(Km(u||o)===null)continue;break}var y=ur(o);y!==null&&(i.splice(l,3),l-=3,Pp(y,{pending:!0,data:m,method:o.method,action:u},u,m))}}))}function ia(i){function l(q){return Zu(q,i)}bs!==null&&Zu(bs,i),xs!==null&&Zu(xs,i),vs!==null&&Zu(vs,i),No.forEach(l),To.forEach(l);for(var o=0;o<ws.length;o++){var u=ws[o];u.blockedOn===i&&(u.blockedOn=null)}for(;0<ws.length&&(o=ws[0],o.blockedOn===null);)_2(o),o.blockedOn===null&&ws.shift();if(o=(i.ownerDocument||i).$$reactFormReplay,o!=null)for(u=0;u<o.length;u+=3){var m=o[u],y=o[u+1],w=m[It]||null;if(typeof y=="function")w||B2(o);else if(w){var N=null;if(y&&y.hasAttribute("formAction")){if(m=y,w=y[It]||null)N=w.formAction;else if(Km(m)!==null)continue}else N=w.action;typeof N=="function"?o[u+1]=N:(o.splice(u,3),u-=3),B2(o)}}}function $2(){function i(y){y.canIntercept&&y.info==="react-transition"&&y.intercept({handler:function(){return new Promise(function(w){return m=w})},focusReset:"manual",scroll:"manual"})}function l(){m!==null&&(m(),m=null),u||setTimeout(o,20)}function o(){if(!u&&!navigation.transition){var y=navigation.currentEntry;y&&y.url!=null&&navigation.navigate(y.url,{state:y.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var u=!1,m=null;return navigation.addEventListener("navigate",i),navigation.addEventListener("navigatesuccess",l),navigation.addEventListener("navigateerror",l),setTimeout(o,100),function(){u=!0,navigation.removeEventListener("navigate",i),navigation.removeEventListener("navigatesuccess",l),navigation.removeEventListener("navigateerror",l),m!==null&&(m(),m=null)}}}function Gm(i){this._internalRoot=i}td.prototype.render=Gm.prototype.render=function(i){var l=this._internalRoot;if(l===null)throw Error(r(409));var o=l.current,u=ri();j2(o,u,i,l,null,null)},td.prototype.unmount=Gm.prototype.unmount=function(){var i=this._internalRoot;if(i!==null){this._internalRoot=null;var l=i.containerInfo;j2(i.current,2,null,i,null,null),Lu(),l[gi]=null}};function td(i){this._internalRoot=i}td.prototype.unstable_scheduleHydration=function(i){if(i){var l=Li();i={blockedOn:null,target:i,priority:l};for(var o=0;o<ws.length&&l!==0&&l<ws[o].priority;o++);ws.splice(o,0,i),o===0&&_2(i)}};var q2=e.version;if(q2!=="19.2.8")throw Error(r(527,q2,"19.2.8"));ee.findDOMNode=function(i){var l=i._reactInternals;if(l===void 0)throw typeof i.render=="function"?Error(r(188)):(i=Object.keys(i).join(","),Error(r(268,i)));return i=h(l),i=i!==null?g(i):null,i=i===null?null:i.stateNode,i};var MR={bundleType:0,version:"19.2.8",rendererPackageName:"react-dom",currentDispatcherRef:_,reconcilerVersion:"19.2.8"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var nd=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!nd.isDisabled&&nd.supportsFiber)try{oe=nd.inject(MR),k=nd}catch{}}return sa.createRoot=function(i,l){if(!s(i))throw Error(r(299));var o=!1,u="",m=Pw,y=Kw,w=Yw;return l!=null&&(l.unstable_strictMode===!0&&(o=!0),l.identifierPrefix!==void 0&&(u=l.identifierPrefix),l.onUncaughtError!==void 0&&(m=l.onUncaughtError),l.onCaughtError!==void 0&&(y=l.onCaughtError),l.onRecoverableError!==void 0&&(w=l.onRecoverableError)),l=N2(i,1,!1,null,null,o,u,null,m,y,w,$2),i[gi]=l.current,Em(i),new Gm(l)},sa.hydrateRoot=function(i,l,o){if(!s(i))throw Error(r(299));var u=!1,m="",y=Pw,w=Kw,N=Yw,q=null;return o!=null&&(o.unstable_strictMode===!0&&(u=!0),o.identifierPrefix!==void 0&&(m=o.identifierPrefix),o.onUncaughtError!==void 0&&(y=o.onUncaughtError),o.onCaughtError!==void 0&&(w=o.onCaughtError),o.onRecoverableError!==void 0&&(N=o.onRecoverableError),o.formState!==void 0&&(q=o.formState)),l=N2(i,1,!0,l,o??null,u,m,q,y,w,N,$2),l.context=T2(null),o=l.current,u=ri(),u=Yt(u),m=ls(u),m.callback=null,as(o,m,u),o=u,l.current.lanes=o,Kt(l,o),er(l),i[gi]=l.current,Em(i),new td(l)},sa.version="19.2.8",sa}var lg;function X2(){if(lg)return rd.exports;lg=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),rd.exports=G2(),rd.exports}var ag=X2(),I=od();const og=Jm(I);const J2=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Q2=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,n,r)=>r?r.toUpperCase():n.toLowerCase()),cg=t=>{const e=Q2(t);return e.charAt(0).toUpperCase()+e.slice(1)},ug=(...t)=>t.filter((e,n,r)=>!!e&&e.trim()!==""&&r.indexOf(e)===n).join(" ").trim(),W2=t=>{for(const e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0};var Z2={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const eA=I.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:s="",children:a,iconNode:c,...d},f)=>I.createElement("svg",{ref:f,...Z2,width:e,height:e,stroke:t,strokeWidth:r?Number(n)*24/Number(e):n,className:ug("lucide",s),...!a&&!W2(d)&&{"aria-hidden":"true"},...d},[...c.map(([h,g])=>I.createElement(h,g)),...Array.isArray(a)?a:[a]]));const rt=(t,e)=>{const n=I.forwardRef(({className:r,...s},a)=>I.createElement(eA,{ref:a,iconNode:e,className:ug(`lucide-${J2(cg(t))}`,`lucide-${t}`,r),...s}));return n.displayName=cg(t),n};const dg=rt("activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);const Eo=rt("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);const fg=rt("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);const hg=rt("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);const pg=rt("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);const ud=rt("circle-alert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);const Oo=rt("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);const tA=rt("circle-x",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);const dd=rt("clock-3",[["path",{d:"M12 6v6h4",key:"135r8i"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);const nA=rt("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);const fd=rt("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);const mg=rt("file-text",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);const iA=rt("folder-plus",[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);const rA=rt("history",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]);const sA=rt("library",[["path",{d:"m16 6 4 14",key:"ji33uf"}],["path",{d:"M12 6v14",key:"1n7gus"}],["path",{d:"M8 8v12",key:"1gg7y9"}],["path",{d:"M4 4v16",key:"6qkkli"}]]);const lA=rt("link-2",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]);const aA=rt("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);const oA=rt("lock-open",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 9.9-1",key:"1mm8w8"}]]);const cA=rt("lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);const uA=rt("menu",[["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 18h16",key:"19g7jn"}],["path",{d:"M4 6h16",key:"1o0s65"}]]);const hd=rt("panel-left-close",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m16 15-3-3 3-3",key:"14y99z"}]]);const pd=rt("panel-left-open",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m14 9 3 3-3 3",key:"8010ee"}]]);const la=rt("play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);const ks=rt("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);const dA=rt("rotate-ccw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);const fA=rt("save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);const gg=rt("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]);const yg=rt("server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]);const hA=rt("settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);const pA=rt("shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]);const bg=rt("square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);const xg=rt("tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]);const si=rt("trash-2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);const md=rt("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);const vg=rt("upload",[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]]);const mA=rt("wand-sparkles",[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",key:"ul74o6"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]]);const gd=rt("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function gA(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var vn={},Mo={},Er={},wg;function aa(){if(wg)return Er;wg=1;function t(c){return typeof c>"u"||c===null}function e(c){return typeof c=="object"&&c!==null}function n(c){return Array.isArray(c)?c:t(c)?[]:[c]}function r(c,d){if(d){const f=Object.keys(d);for(let h=0,g=f.length;h<g;h+=1){const b=f[h];c[b]=d[b]}}return c}function s(c,d){let f="";for(let h=0;h<d;h+=1)f+=c;return f}function a(c){return c===0&&Number.NEGATIVE_INFINITY===1/c}return Er.isNothing=t,Er.isObject=e,Er.toArray=n,Er.repeat=s,Er.isNegativeZero=a,Er.extend=r,Er}var yd,Sg;function oa(){if(Sg)return yd;Sg=1;function t(n,r){let s="";const a=n.reason||"(unknown reason)";return n.mark?(n.mark.name&&(s+='in "'+n.mark.name+'" '),s+="("+(n.mark.line+1)+":"+(n.mark.column+1)+")",!r&&n.mark.snippet&&(s+=`
|
|
10
10
|
|
|
11
|
-
`+
|
|
12
|
-
`+
|
|
13
|
-
`,
|
|
14
|
-
`;for(let
|
|
15
|
-
`}return
|
|
16
|
-
\r`;function c
|
|
17
|
-
`;case 118:return"\v";case 102:return"\f";case 114:return"\r";case 101:return"\x1B";case 32:return" ";case 34:return'"';case 47:return"/";case 92:return"\\";case 78:return"
";case 95:return" ";case 76:return"\u2028";case 80:return"\u2029";default:return""}}function
|
|
18
|
-
`,
|
|
19
|
-
`,
|
|
20
|
-
`);break}
|
|
21
|
-
`,
|
|
22
|
-
`,
|
|
23
|
-
`,
|
|
24
|
-
`,
|
|
25
|
-
`),
|
|
26
|
-
`,
|
|
27
|
-
`&&(
|
|
28
|
-
`+
|
|
29
|
-
`,
|
|
30
|
-
`||
|
|
31
|
-
`)?"+":
|
|
32
|
-
`}function
|
|
33
|
-
`?
|
|
34
|
-
`);return
|
|
35
|
-
`||
|
|
36
|
-
`:"")+
|
|
37
|
-
`+
|
|
38
|
-
`,
|
|
39
|
-
`+
|
|
40
|
-
`:""}return Bs.dump=Q,Bs}var Ed;function fg(){if(Ed)return Ut;Ed=1;const a=ug(),i=dg();function c(u,f){return function(){throw new Error("Function yaml."+u+" is removed in js-yaml 4. Use yaml."+f+" instead, which is now safe by default.")}}return Ut.Type=Bt(),Ut.Schema=Fu(),Ut.FAILSAFE_SCHEMA=Pu(),Ut.JSON_SCHEMA=cd(),Ut.CORE_SCHEMA=dd(),Ut.DEFAULT_SCHEMA=Ls(),Ut.load=a.load,Ut.loadAll=a.loadAll,Ut.dump=i.dump,Ut.YAMLException=Ga(),Ut.types={binary:gd(),float:sd(),map:Ju(),null:td(),pairs:Sd(),set:jd(),timestamp:pd(),bool:ld(),int:rd(),merge:hd(),omap:bd(),seq:Qu(),str:Xu()},Ut.safeLoad=c("safeLoad","load"),Ut.safeLoadAll=c("safeLoadAll","loadAll"),Ut.safeDump=c("safeDump","dump"),Ut}var pg=fg();const mg=og(pg),{Type:Q1,Schema:K1,FAILSAFE_SCHEMA:J1,JSON_SCHEMA:W1,CORE_SCHEMA:P1,DEFAULT_SCHEMA:e2,load:hg,loadAll:t2,dump:n2,YAMLException:l2,types:a2,safeLoad:r2,safeLoadAll:i2,safeDump:s2}=mg;let _n=class ky{static async parseSpec(i){let c;if(typeof i=="string"){const u=i.trim();try{c=JSON.parse(u)}catch{try{c=hg(u)}catch{throw new Error("Invalid OpenAPI specification format")}}}else c=i;if(!c.openapi||!c.info||!c.paths)throw new Error("Invalid OpenAPI specification: missing required fields");return c}static getHttpMethods(i){return["get","post","put","delete","patch","options","head","trace"].filter(u=>i[u])}static decodePointerToken(i){return decodeURIComponent(i).replace(/~1/g,"/").replace(/~0/g,"~")}static encodePointerToken(i){return i.replace(/~/g,"~0").replace(/\//g,"~1")}static resolveReference(i,c){if(!c.startsWith("#/"))throw new Error(`Only local references are supported synchronously; bundle external references first: ${c}`);const u=c.substring(2).split("/").map(ky.decodePointerToken);let f=i;for(const p of u){if(f===null||typeof f!="object"||!(p in f))throw new Error(`Reference not found: ${c}`);f=f[p]}return f}static isReference(i){return!!i&&typeof i=="object"&&"$ref"in i&&typeof i.$ref=="string"}};class Wt{static async parseSpec(i){return _n.parseSpec(i)}static getHttpMethods(i){return _n.getHttpMethods(i)}static getMethodColor(i,c){const p=c==="dark"?{get:"text-blue-300 bg-blue-900/30 border-blue-700",post:"text-green-300 bg-green-900/30 border-green-700",put:"text-orange-300 bg-orange-900/30 border-orange-700",delete:"text-red-300 bg-red-900/30 border-red-700",patch:"text-purple-300 bg-purple-900/30 border-purple-700",options:"text-cyan-100 bg-cyan-800/50 border-cyan-500",head:"text-gray-300 bg-gray-700/50 border-gray-600",trace:"text-gray-300 bg-gray-700/50 border-gray-600"}:{get:"text-blue-600 bg-blue-50 border-blue-200",post:"text-green-600 bg-green-50 border-green-200",put:"text-orange-600 bg-orange-50 border-orange-200",delete:"text-red-600 bg-red-50 border-red-200",patch:"text-purple-600 bg-purple-50 border-purple-200",options:"text-gray-600 bg-gray-50 border-gray-200",head:"text-gray-600 bg-gray-50 border-gray-200",trace:"text-gray-600 bg-gray-50 border-gray-200"},g=c==="dark"?"text-gray-300 bg-gray-700/50 border-gray-600":"text-gray-600 bg-gray-50 border-gray-200";return p[i.toLowerCase()]||g}static decodePointerToken(i){return _n.decodePointerToken(i)}static encodePointerToken(i){return _n.encodePointerToken(i)}static resolveReference(i,c){return _n.resolveReference(i,c)}static isReference(i){return _n.isReference(i)}}const Cd=({spec:a,onEndpointSelect:i,selectedEndpoint:c=null,theme:u="light"})=>{const[f,p]=le.useState(""),[g,y]=le.useState(new Set(["default"])),x=u==="dark"?"bg-gray-900 border-r border-gray-800 text-white":"bg-white border-r border-gray-200 text-gray-700",h=u==="dark"?"bg-gray-800 border-gray-700 text-white placeholder-gray-400 focus:ring-blue-500 focus:border-blue-500 focus:ring-1":"border-gray-300 text-gray-700 placeholder-gray-400 focus:ring-blue-500 focus:border-blue-500 focus:ring-1",S=u==="dark"?"text-gray-300":"text-gray-500",A=u==="dark"?"bg-gray-800/50 border-gray-700 text-white":"bg-gray-50 border-gray-100 text-gray-700",C=U=>{const I="text-xs font-bold px-2 py-0.5 rounded border",_={dark:{get:"bg-blue-900/30 border-blue-700 text-blue-200",post:"bg-green-900/30 border-green-700 text-green-200",put:"bg-yellow-900/30 border-yellow-700 text-yellow-200",patch:"bg-purple-900/30 border-purple-700 text-purple-200",delete:"bg-red-900/30 border-red-700 text-red-200",default:"bg-gray-800/50 border-gray-700 text-gray-200"},light:{get:"bg-blue-50 border-blue-200 text-blue-700",post:"bg-green-50 border-green-200 text-green-700",put:"bg-yellow-50 border-yellow-200 text-yellow-700",patch:"bg-purple-50 border-purple-200 text-purple-700",delete:"bg-red-50 border-red-200 text-red-700",default:"bg-gray-100 border-gray-200 text-gray-600"}},N=u==="dark"?_.dark:_.light;return`${I} ${N[U.toLowerCase()]||N.default}`},M=Object.entries(a.paths).reduce((U,[I,_])=>(Wt.getHttpMethods(_).forEach(N=>{const j=_[N];(j?.tags||["default"]).forEach(Y=>{U[Y]||(U[Y]=[]),U[Y].push({path:I,method:N,operation:j})})}),U),{}),k=Object.entries(M).reduce((U,[I,_])=>{const N=f.toLowerCase(),j=_.filter(R=>`${R.method} ${R.path} ${R.operation?.summary||""} ${I}`.toLowerCase().includes(N));return j.length&&(U[I]=j),U},{}),G=U=>y(I=>{const _=new Set(I);return _.has(U)?_.delete(U):_.add(U),_});return o.jsxs("div",{className:`flex h-full w-full min-w-0 flex-col ${x}`,style:{backgroundColor:"var(--flexdoc-sidebar-bg)",color:"var(--flexdoc-sidebar-text)"},children:[o.jsxs("div",{className:`border-b p-4 ${u==="dark"?"border-gray-800":"border-gray-100"}`,children:[o.jsxs("div",{className:"mb-4 flex items-center gap-3",children:[o.jsx("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-gradient-to-br from-blue-500 to-blue-600",children:o.jsx(gs,{className:"h-4 w-4 text-white"})}),o.jsxs("div",{className:"min-w-0",children:[o.jsx("h1",{className:`truncate text-lg font-semibold ${u==="dark"?"text-white":"text-gray-900"}`,children:"FlexDoc"}),o.jsx("p",{className:`truncate text-sm ${u==="dark"?"text-gray-300":"text-gray-500"}`,children:"API Documentation"})]})]}),o.jsx("label",{className:"sr-only",htmlFor:"flexdoc-endpoint-search",children:"Search endpoints"}),o.jsxs("div",{className:"relative",children:[o.jsx(zu,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-gray-400"}),o.jsx("input",{id:"flexdoc-endpoint-search",type:"search",placeholder:"Search endpoints...",value:f,onChange:U=>p(U.target.value),className:`w-full rounded-lg border py-2 pl-10 pr-4 text-sm transition-colors ${h}`})]})]}),o.jsx("div",{className:"flex-1 overflow-y-auto overscroll-contain",children:o.jsxs("div",{className:"p-4",children:[o.jsxs("div",{className:"mb-6",children:[o.jsx("h3",{className:`mb-2 text-xs font-semibold uppercase tracking-wider ${S}`,children:"API Information"}),o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{className:`rounded-lg border p-3 ${A}`,children:[o.jsx("h4",{className:`truncate font-medium ${u==="dark"?"text-white":"text-gray-900"}`,children:a.info.title}),o.jsxs("p",{className:`text-sm ${u==="dark"?"text-gray-300":"text-gray-600"}`,children:["Version ",a.info.version]})]}),a.servers&&a.servers.length>0&&o.jsxs("div",{className:`rounded-lg border p-3 ${A}`,children:[o.jsxs("div",{className:"mb-2 flex items-center gap-2",children:[o.jsx($u,{className:"h-4 w-4 text-gray-400"}),o.jsx("span",{className:"text-sm font-medium",children:"Servers"})]}),o.jsx("div",{className:"space-y-2",children:a.servers.map((U,I)=>o.jsxs("div",{className:"min-w-0 text-sm",children:[o.jsx("code",{className:`block max-w-full overflow-x-auto rounded px-1.5 py-0.5 text-xs ${u==="dark"?"bg-gray-700/50 text-blue-200":"bg-gray-100 text-blue-600"}`,children:U.url}),U.description&&o.jsx("p",{className:`mt-1.5 ${u==="dark"?"text-gray-300":"text-gray-600"}`,children:U.description})]},`${U.url}:${I}`))})]})]})]}),o.jsxs("div",{children:[o.jsx("h3",{className:`mb-3 text-xs font-semibold uppercase tracking-wider ${S}`,children:"Endpoints"}),Object.keys(k).length===0&&o.jsx("p",{className:`px-2 py-4 text-sm ${S}`,children:"No endpoints match your search."}),Object.entries(k).map(([U,I])=>o.jsxs("div",{className:"mb-4",children:[o.jsxs("button",{onClick:()=>G(U),className:`flex min-h-11 w-full items-center gap-2 rounded-lg p-2 text-left transition-colors ${u==="dark"?"hover:bg-gray-800/50 text-white":"hover:bg-gray-50 text-gray-700"}`,children:[g.has(U)?o.jsx(Ru,{className:"h-4 w-4 shrink-0 text-gray-400"}):o.jsx(qu,{className:"h-4 w-4 shrink-0 text-gray-400"}),o.jsx(Du,{className:"h-4 w-4 shrink-0 text-gray-400"}),o.jsx("span",{className:"min-w-0 truncate text-sm font-medium",children:U==="default"?"General":U}),o.jsx("span",{className:`ml-auto shrink-0 rounded-full px-2 py-0.5 text-xs ${u==="dark"?"bg-gray-800 text-white":"bg-gray-100 text-gray-500"}`,children:I.length})]}),g.has(U)&&o.jsx("div",{className:"ml-4 mt-1.5 space-y-1.5 sm:ml-6",children:I.map(({path:_,method:N,operation:j})=>{const R=c?.path===_&&c?.method===N;return o.jsxs("button",{onClick:()=>i(_,N),className:`mb-2 min-h-11 w-full rounded-lg border p-2 text-left transition-all ${R?u==="dark"?"bg-blue-900/20 border-blue-800/50 shadow-sm":"bg-blue-50 border-blue-100 shadow-sm":u==="dark"?"hover:bg-gray-800/50 border-transparent hover:border-gray-700":"hover:bg-gray-50 border-transparent hover:border-gray-100"}`,style:R?{color:"var(--flexdoc-sidebar-active-text)"}:void 0,children:[o.jsx("div",{className:"mb-1 flex items-center gap-2",children:o.jsx("span",{className:C(N),children:N.toUpperCase()})}),o.jsx("div",{className:`break-all font-mono text-sm ${R?u==="dark"?"text-blue-300":"text-blue-600":u==="dark"?"text-gray-300":"text-gray-800"}`,children:_}),j?.summary&&o.jsx("div",{className:`mt-1 text-xs ${u==="dark"?"text-gray-400":"text-gray-600"}`,children:j.summary})]},`${N}-${_}`)})})]},U))]})]})})]})},Rl=["parameters","requestBody","responses","tryIt","codeSamples"],Ys={all:Rl,none:[],minimal:[],documentation:["parameters","requestBody","responses"],interactive:["parameters","requestBody","tryIt","codeSamples"]},yg=new Set(["minimal","documentation","interactive"]),_d=new Set(Rl),gg=new Set(Object.keys(Ys));function xg(a){return typeof a=="string"?gg.has(a):Array.isArray(a)&&a.every(i=>typeof i=="string"&&(_d.has(i)||yg.has(i)))}function bg(a,i){for(const c of Ys[i])a.add(c)}function Gs(a,i){if(a===void 0&&i!==void 0){const u=new Set(["parameters","requestBody","tryIt","codeSamples"]);return i!=="none"&&u.add("responses"),Rl.filter(f=>u.has(f))}if(a===void 0)return[];if(typeof a=="string")return[...Ys[a]];const c=new Set;for(const u of a)_d.has(u)?c.add(u):bg(c,u);return Rl.filter(u=>c.has(u))}function vg(a,i){return`flexdoc:viewer:${encodeURIComponent(i?.trim()||"unknown-host")}:${encodeURIComponent(a?.trim()||"untitled")}`}function Od(a,i){const c=typeof window<"u"?window.localStorage:void 0;if(!c)return{version:1};try{const u=c.getItem(a);if(!u)return{version:1};const f=JSON.parse(u);return f.version!==1||f.expand!==void 0&&!xg(f.expand)?{version:1}:{version:1,...f.expand!==void 0?{expand:f.expand}:{}}}catch{return{version:1}}}function Sg(a,i,c){const u=typeof window<"u"?window.localStorage:void 0;if(u)try{i===void 0?u.removeItem(a):u.setItem(a,JSON.stringify({version:1,expand:i}))}catch{}}function al(a,i){if(i)return _n.isReference(i)?_n.resolveReference(a,i.$ref):i}function Ag(a,i){const c=a.paths[i];if(!c)throw new Error(`Path not found: ${i}`);return al(a,c)}function jg(a,i={}){return a.url.replace(/\{([^}]+)\}/g,(c,u)=>{const f=a.variables?.[u],p=i[u]??f?.default;if(p===void 0)throw new Error(`Missing server variable: ${u}`);if(f?.enum?.length&&!f.enum.includes(p))throw new Error(`Invalid value for server variable ${u}: ${p}`);return p})}function Is(a,i,c){const u=Ag(a,i),f=u[c.toLowerCase()];if(!f||typeof f!="object"||!("responses"in f))throw new Error(`Operation not found: ${c.toUpperCase()} ${i}`);const p=[...u.parameters||[],...f.parameters||[]].map(x=>al(a,x)).filter(x=>!!x),g=new Map;for(const x of p)g.set(`${x.in}:${x.name}`,x);const y={};for(const[x,h]of Object.entries(f.responses||{})){const S=al(a,h);S&&(y[x]=S)}return{path:i,method:c.toUpperCase(),pathItem:u,operation:f,parameters:[...g.values()],requestBody:al(a,f.requestBody),responses:y,servers:f.servers||u.servers||a.servers||[],security:f.security!==void 0?f.security:a.security||[]}}function Ng(a,i,c){return Is(a,i,c).parameters}function wg(a,i){return al(a,i.schema)}function Tg(a,i){if(i.example!==void 0)return i.example;const c=wg(a,i);return c?.example!==void 0?c.example:c?.examples?.length?c.examples[0]:c?.default!==void 0?c.default:c?.enum?.length?c.enum[0]:c?.type==="array"?[]:c?.type==="object"?{}:c?.type==="integer"||c?.type==="number"?1:c?.type==="boolean"?!0:""}function Eg(a,i,c){const u=Is(a,i,c),f={parameters:{},headers:{},cookies:{},auth:{}};for(const y of u.parameters){const x=y.in==="header"?f.headers:y.in==="cookie"?f.cookies:f.parameters;x[y.name]=Tg(a,y)}const p=u.requestBody,g=p?Object.keys(p.content||{})[0]:void 0;if(g){f.contentType=g;const y=p.content[g],x=al(a,y.schema),h=y.examples?Object.values(y.examples)[0]:void 0,S=al(a,h),A=y.example??S?.value??x?.example??x?.examples?.[0]??x?.default;f.body=A!==void 0?JSON.stringify(A,null,2):""}return f}function Ot(a){return a===null?"null":typeof a=="object"?JSON.stringify(a):String(a)}function Fs(a){if(typeof a!="string")return a;const i=a.trim();if(!i||!i.startsWith("[")&&!i.startsWith("{"))return a;try{return JSON.parse(i)}catch{return a}}function kd(a,i=!1){const c=Ot(a);return i?encodeURI(c).replace(/%5B/g,"[").replace(/%5D/g,"]"):encodeURIComponent(c)}function Rd(a,i=!1){const c=Fs(a);if(Array.isArray(c))return c.map(Ot).join(",");if(c&&typeof c=="object"){const u=Object.entries(c);return i?u.map(([f,p])=>`${f}=${Ot(p)}`).join(","):u.flatMap(([f,p])=>[f,Ot(p)]).join(",")}return Ot(c)}function Cg(a,i){const c=a.style||"simple",u=a.explode??!1,f=Fs(i),p=y=>kd(y,a.allowReserved);if(Array.isArray(f)){const y=f.map(p);return c==="label"?`.${y.join(u?".":",")}`:c==="matrix"?u?y.map(x=>`;${a.name}=${x}`).join(""):`;${a.name}=${y.join(",")}`:y.join(",")}if(f&&typeof f=="object"){const y=Object.entries(f).map(([x,h])=>[p(x),p(h)]);return c==="label"?u?`.${y.map(([x,h])=>`${x}=${h}`).join(".")}`:`.${y.flatMap(([x,h])=>[x,h]).join(",")}`:c==="matrix"?u?y.map(([x,h])=>`;${x}=${h}`).join(""):`;${a.name}=${y.flatMap(([x,h])=>[x,h]).join(",")}`:u?y.map(([x,h])=>`${x}=${h}`).join(","):y.flatMap(([x,h])=>[x,h]).join(",")}const g=p(f);return c==="label"?`.${g}`:c==="matrix"?`;${a.name}=${g}`:g}function _g(a,i){const c=a.style||"form",u=a.explode??c==="form",f=Fs(i);if(c==="deepObject"&&f&&typeof f=="object"&&!Array.isArray(f))return Object.entries(f).map(([p,g])=>[`${a.name}[${p}]`,Ot(g)]);if(Array.isArray(f))return c==="spaceDelimited"?[[a.name,f.map(Ot).join(" ")]]:c==="pipeDelimited"?[[a.name,f.map(Ot).join("|")]]:u?f.map(p=>[a.name,Ot(p)]):[[a.name,f.map(Ot).join(",")]];if(f&&typeof f=="object"){const p=Object.entries(f);return u?p.map(([g,y])=>[g,Ot(y)]):[[a.name,p.flatMap(([g,y])=>[g,Ot(y)]).join(",")]]}return[[a.name,Ot(f)]]}function Og(a){return typeof globalThis.btoa=="function"?globalThis.btoa(unescape(encodeURIComponent(a))):a}function kg(a,i){return Object.keys(a).every(c=>!!i[c])}function Rg(a,i,c,u,f,p){if(!i.length||!a.components?.securitySchemes)return;const g=i.find(y=>Object.keys(y).length===0||kg(y,p))||i[0];for(const y of Object.keys(g)){const x=al(a,a.components.securitySchemes[y]),h=p[y];!x||!h||(x.type==="http"&&x.scheme?.toLowerCase()==="bearer"?c.Authorization=`Bearer ${h}`:x.type==="http"&&x.scheme?.toLowerCase()==="basic"?c.Authorization=`Basic ${Og(h)}`:x.type==="apiKey"&&x.in==="header"&&x.name?c[x.name]=h:x.type==="apiKey"&&x.in==="query"&&x.name?u.push(`${encodeURIComponent(x.name)}=${encodeURIComponent(h)}`):x.type==="apiKey"&&x.in==="cookie"&&x.name?f.push(`${x.name}=${encodeURIComponent(h)}`):(x.type==="oauth2"||x.type==="openIdConnect")&&(c.Authorization=`Bearer ${h}`))}}function qd(a){try{const i=JSON.parse(a);return i&&typeof i=="object"&&!Array.isArray(i)?i:void 0}catch{return}}function qg(a,i,c,u={}){const f=Is(a,i,c),p=f.servers[0],g=u.serverUrl||(p?jg(p,u.serverVariables):"");let y=i;const x=[],h={...u.headers||{}},S=[];for(const U of f.parameters){const I=U.in==="header"?u.headers?.[U.name]:U.in==="cookie"?u.cookies?.[U.name]:u.parameters?.[U.name];if(!(I===void 0||I===""))if(U.in==="path")y=y.replace(`{${U.name}}`,Cg(U,I));else if(U.in==="query")for(const[_,N]of _g(U,I))x.push(`${encodeURIComponent(_)}=${kd(N,U.allowReserved)}`);else U.in==="header"?h[U.name]=Rd(I,U.explode):U.in==="cookie"&&S.push(`${U.name}=${encodeURIComponent(Rd(I,U.explode))}`)}Rg(a,f.security,h,x,S,u.auth||{}),S.length&&(h.Cookie=S.join("; "));let A,C,M;if(u.body&&!["GET","HEAD"].includes(f.method)){const U=u.contentType||"application/json";if(A=u.body,U==="application/x-www-form-urlencoded"){const I=qd(u.body);A=I?Object.entries(I).flatMap(([_,N])=>Array.isArray(N)?N.map(j=>`${encodeURIComponent(_)}=${encodeURIComponent(Ot(j))}`):[`${encodeURIComponent(_)}=${encodeURIComponent(Ot(N))}`]).join("&"):u.body,M=A,C="form",h["Content-Type"]=U}else if(U.startsWith("multipart/form-data")){const I=qd(u.body);if(I&&typeof FormData<"u"){const _=new FormData;for(const[N,j]of Object.entries(I))Array.isArray(j)?j.forEach(R=>_.append(N,Ot(R))):_.append(N,Ot(j));M=_}else M=u.body;C="multipart"}else M=u.body,C=U.includes("json")?"json":"text",h["Content-Type"]=U}const k=x.join("&");return{url:`${g.replace(/\/$/,"")}${y}${k?`?${k}`:""}`,method:f.method,headers:h,body:A,bodyKind:C,init:{method:f.method,headers:h,body:M}}}function Md(a,i,c){return Ng(a,i,c)}function Vs(a,i,c){return Eg(a,i,c)}function Ur(a,i,c,u={}){return qg(a,i,c,u)}const kt=a=>JSON.stringify(a);function Mg(a,i){const c=Object.entries(a.headers);if(i==="curl"){const p=[`curl -X ${a.method} ${kt(a.url)}`];for(const[g,y]of c)p.push(` -H ${kt(`${g}: ${y}`)}`);return a.body&&p.push(` --data-raw ${kt(a.body)}`),p.join(` \\
|
|
41
|
-
`)}if(
|
|
42
|
-
const data = await response.json();`}if(
|
|
43
|
-
`)}if(
|
|
44
|
-
`)}const
|
|
45
|
-
`)}function zg(a){return{curl:"cURL",javascript:"JavaScript",python:"Python",go:"Go",java:"Java"}[a]}function $g(a,i){return Mg(a,i)}function zd(a){return zg(a)}var Xs={exports:{}},$d;function Dg(){return $d||($d=1,(function(a){var i=typeof window<"u"?window:typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:{};var c=(function(u){var f=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,p=0,g={},y={manual:u.Prism&&u.Prism.manual,disableWorkerMessageHandler:u.Prism&&u.Prism.disableWorkerMessageHandler,util:{encode:function _(N){return N instanceof x?new x(N.type,_(N.content),N.alias):Array.isArray(N)?N.map(_):N.replace(/&/g,"&").replace(/</g,"<").replace(/\u00a0/g," ")},type:function(_){return Object.prototype.toString.call(_).slice(8,-1)},objId:function(_){return _.__id||Object.defineProperty(_,"__id",{value:++p}),_.__id},clone:function _(N,j){j=j||{};var R,Y;switch(y.util.type(N)){case"Object":if(Y=y.util.objId(N),j[Y])return j[Y];R={},j[Y]=R;for(var D in N)N.hasOwnProperty(D)&&(R[D]=_(N[D],j));return R;case"Array":return Y=y.util.objId(N),j[Y]?j[Y]:(R=[],j[Y]=R,N.forEach(function(X,me){R[me]=_(X,j)}),R);default:return N}},getLanguage:function(_){for(;_;){var N=f.exec(_.className);if(N)return N[1].toLowerCase();_=_.parentElement}return"none"},setLanguage:function(_,N){_.className=_.className.replace(RegExp(f,"gi"),""),_.classList.add("language-"+N)},currentScript:function(){if(typeof document>"u")return null;if(document.currentScript&&document.currentScript.tagName==="SCRIPT")return document.currentScript;try{throw new Error}catch(R){var _=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(R.stack)||[])[1];if(_){var N=document.getElementsByTagName("script");for(var j in N)if(N[j].src==_)return N[j]}return null}},isActive:function(_,N,j){for(var R="no-"+N;_;){var Y=_.classList;if(Y.contains(N))return!0;if(Y.contains(R))return!1;_=_.parentElement}return!!j}},languages:{plain:g,plaintext:g,text:g,txt:g,extend:function(_,N){var j=y.util.clone(y.languages[_]);for(var R in N)j[R]=N[R];return j},insertBefore:function(_,N,j,R){R=R||y.languages;var Y=R[_],D={};for(var X in Y)if(Y.hasOwnProperty(X)){if(X==N)for(var me in j)j.hasOwnProperty(me)&&(D[me]=j[me]);j.hasOwnProperty(X)||(D[X]=Y[X])}var xe=R[_];return R[_]=D,y.languages.DFS(y.languages,function(ge,Ee){Ee===xe&&ge!=_&&(this[ge]=D)}),D},DFS:function _(N,j,R,Y){Y=Y||{};var D=y.util.objId;for(var X in N)if(N.hasOwnProperty(X)){j.call(N,X,N[X],R||X);var me=N[X],xe=y.util.type(me);xe==="Object"&&!Y[D(me)]?(Y[D(me)]=!0,_(me,j,null,Y)):xe==="Array"&&!Y[D(me)]&&(Y[D(me)]=!0,_(me,j,X,Y))}}},plugins:{},highlightAll:function(_,N){y.highlightAllUnder(document,_,N)},highlightAllUnder:function(_,N,j){var R={callback:j,container:_,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};y.hooks.run("before-highlightall",R),R.elements=Array.prototype.slice.apply(R.container.querySelectorAll(R.selector)),y.hooks.run("before-all-elements-highlight",R);for(var Y=0,D;D=R.elements[Y++];)y.highlightElement(D,N===!0,R.callback)},highlightElement:function(_,N,j){var R=y.util.getLanguage(_),Y=y.languages[R];y.util.setLanguage(_,R);var D=_.parentElement;D&&D.nodeName.toLowerCase()==="pre"&&y.util.setLanguage(D,R);var X=_.textContent,me={element:_,language:R,grammar:Y,code:X};function xe(Ee){me.highlightedCode=Ee,y.hooks.run("before-insert",me),me.element.innerHTML=me.highlightedCode,y.hooks.run("after-highlight",me),y.hooks.run("complete",me),j&&j.call(me.element)}if(y.hooks.run("before-sanity-check",me),D=me.element.parentElement,D&&D.nodeName.toLowerCase()==="pre"&&!D.hasAttribute("tabindex")&&D.setAttribute("tabindex","0"),!me.code){y.hooks.run("complete",me),j&&j.call(me.element);return}if(y.hooks.run("before-highlight",me),!me.grammar){xe(y.util.encode(me.code));return}if(N&&u.Worker){var ge=new Worker(y.filename);ge.onmessage=function(Ee){xe(Ee.data)},ge.postMessage(JSON.stringify({language:me.language,code:me.code,immediateClose:!0}))}else xe(y.highlight(me.code,me.grammar,me.language))},highlight:function(_,N,j){var R={code:_,grammar:N,language:j};if(y.hooks.run("before-tokenize",R),!R.grammar)throw new Error('The language "'+R.language+'" has no grammar.');return R.tokens=y.tokenize(R.code,R.grammar),y.hooks.run("after-tokenize",R),x.stringify(y.util.encode(R.tokens),R.language)},tokenize:function(_,N){var j=N.rest;if(j){for(var R in j)N[R]=j[R];delete N.rest}var Y=new A;return C(Y,Y.head,_),S(_,Y,N,Y.head,0),k(Y)},hooks:{all:{},add:function(_,N){var j=y.hooks.all;j[_]=j[_]||[],j[_].push(N)},run:function(_,N){var j=y.hooks.all[_];if(!(!j||!j.length))for(var R=0,Y;Y=j[R++];)Y(N)}},Token:x};u.Prism=y;function x(_,N,j,R){this.type=_,this.content=N,this.alias=j,this.length=(R||"").length|0}x.stringify=function _(N,j){if(typeof N=="string")return N;if(Array.isArray(N)){var R="";return N.forEach(function(xe){R+=_(xe,j)}),R}var Y={type:N.type,content:_(N.content,j),tag:"span",classes:["token",N.type],attributes:{},language:j},D=N.alias;D&&(Array.isArray(D)?Array.prototype.push.apply(Y.classes,D):Y.classes.push(D)),y.hooks.run("wrap",Y);var X="";for(var me in Y.attributes)X+=" "+me+'="'+(Y.attributes[me]||"").replace(/"/g,""")+'"';return"<"+Y.tag+' class="'+Y.classes.join(" ")+'"'+X+">"+Y.content+"</"+Y.tag+">"};function h(_,N,j,R){_.lastIndex=N;var Y=_.exec(j);if(Y&&R&&Y[1]){var D=Y[1].length;Y.index+=D,Y[0]=Y[0].slice(D)}return Y}function S(_,N,j,R,Y,D){for(var X in j)if(!(!j.hasOwnProperty(X)||!j[X])){var me=j[X];me=Array.isArray(me)?me:[me];for(var xe=0;xe<me.length;++xe){if(D&&D.cause==X+","+xe)return;var ge=me[xe],Ee=ge.inside,He=!!ge.lookbehind,he=!!ge.greedy,ke=ge.alias;if(he&&!ge.pattern.global){var T=ge.pattern.toString().match(/[imsuy]*$/)[0];ge.pattern=RegExp(ge.pattern.source,T+"g")}for(var ne=ge.pattern||ge,W=R.next,K=Y;W!==N.tail&&!(D&&K>=D.reach);K+=W.value.length,W=W.next){var P=W.value;if(N.length>_.length)return;if(!(P instanceof x)){var w=1,$;if(he){if($=h(ne,K,_,He),!$||$.index>=_.length)break;var Te=$.index,ce=$.index+$[0].length,pe=K;for(pe+=W.value.length;Te>=pe;)W=W.next,pe+=W.value.length;if(pe-=W.value.length,K=pe,W.value instanceof x)continue;for(var ve=W;ve!==N.tail&&(pe<ce||typeof ve.value=="string");ve=ve.next)w++,pe+=ve.value.length;w--,P=_.slice(K,pe),$.index-=K}else if($=h(ne,0,P,He),!$)continue;var Te=$.index,Re=$[0],Ve=P.slice(0,Te),Ie=P.slice(Te+Re.length),Be=K+P.length;D&&Be>D.reach&&(D.reach=Be);var Z=W.prev;Ve&&(Z=C(N,Z,Ve),K+=Ve.length),M(N,Z,w);var be=new x(X,Ee?y.tokenize(Re,Ee):Re,ke,Re);if(W=C(N,Z,be),Ie&&C(N,W,Ie),w>1){var Se={cause:X+","+xe,reach:Be};S(_,N,j,W.prev,K,Se),D&&Se.reach>D.reach&&(D.reach=Se.reach)}}}}}}function A(){var _={value:null,prev:null,next:null},N={value:null,prev:_,next:null};_.next=N,this.head=_,this.tail=N,this.length=0}function C(_,N,j){var R=N.next,Y={value:j,prev:N,next:R};return N.next=Y,R.prev=Y,_.length++,Y}function M(_,N,j){for(var R=N.next,Y=0;Y<j&&R!==_.tail;Y++)R=R.next;N.next=R,R.prev=N,_.length-=Y}function k(_){for(var N=[],j=_.head.next;j!==_.tail;)N.push(j.value),j=j.next;return N}if(!u.document)return u.addEventListener&&(y.disableWorkerMessageHandler||u.addEventListener("message",function(_){var N=JSON.parse(_.data),j=N.language,R=N.code,Y=N.immediateClose;u.postMessage(y.highlight(R,y.languages[j],j)),Y&&u.close()},!1)),y;var G=y.util.currentScript();G&&(y.filename=G.src,G.hasAttribute("data-manual")&&(y.manual=!0));function U(){y.manual||y.highlightAll()}if(!y.manual){var I=document.readyState;I==="loading"||I==="interactive"&&G&&G.defer?document.addEventListener("DOMContentLoaded",U):window.requestAnimationFrame?window.requestAnimationFrame(U):window.setTimeout(U,16)}return y})(i);a.exports&&(a.exports=c),typeof gu<"u"&&(gu.Prism=c),c.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},c.languages.markup.tag.inside["attr-value"].inside.entity=c.languages.markup.entity,c.languages.markup.doctype.inside["internal-subset"].inside=c.languages.markup,c.hooks.add("wrap",function(u){u.type==="entity"&&(u.attributes.title=u.content.replace(/&/,"&"))}),Object.defineProperty(c.languages.markup.tag,"addInlined",{value:function(f,p){var g={};g["language-"+p]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:c.languages[p]},g.cdata=/^<!\[CDATA\[|\]\]>$/i;var y={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:g}};y["language-"+p]={pattern:/[\s\S]+/,inside:c.languages[p]};var x={};x[f]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return f}),"i"),lookbehind:!0,greedy:!0,inside:y},c.languages.insertBefore("markup","cdata",x)}}),Object.defineProperty(c.languages.markup.tag,"addAttribute",{value:function(u,f){c.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+u+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[f,"language-"+f],inside:c.languages[f]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),c.languages.html=c.languages.markup,c.languages.mathml=c.languages.markup,c.languages.svg=c.languages.markup,c.languages.xml=c.languages.extend("markup",{}),c.languages.ssml=c.languages.xml,c.languages.atom=c.languages.xml,c.languages.rss=c.languages.xml,(function(u){var f=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;u.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+f.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+f.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+f.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+f.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:f,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},u.languages.css.atrule.inside.rest=u.languages.css;var p=u.languages.markup;p&&(p.tag.addInlined("style","css"),p.tag.addAttribute("style","css"))})(c),c.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},c.languages.javascript=c.languages.extend("clike",{"class-name":[c.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+(/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source)+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),c.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,c.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:c.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:c.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:c.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:c.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:c.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),c.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:c.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),c.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),c.languages.markup&&(c.languages.markup.tag.addInlined("script","javascript"),c.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),c.languages.js=c.languages.javascript,(function(){if(typeof c>"u"||typeof document>"u")return;Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);var u="Loading…",f=function(G,U){return"✖ Error "+G+" while fetching file: "+U},p="✖ Error: File does not exist or is empty",g={js:"javascript",py:"python",rb:"ruby",ps1:"powershell",psm1:"powershell",sh:"bash",bat:"batch",h:"c",tex:"latex"},y="data-src-status",x="loading",h="loaded",S="failed",A="pre[data-src]:not(["+y+'="'+h+'"]):not(['+y+'="'+x+'"])';function C(G,U,I){var _=new XMLHttpRequest;_.open("GET",G,!0),_.onreadystatechange=function(){_.readyState==4&&(_.status<400&&_.responseText?U(_.responseText):_.status>=400?I(f(_.status,_.statusText)):I(p))},_.send(null)}function M(G){var U=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(G||"");if(U){var I=Number(U[1]),_=U[2],N=U[3];return _?N?[I,Number(N)]:[I,void 0]:[I,I]}}c.hooks.add("before-highlightall",function(G){G.selector+=", "+A}),c.hooks.add("before-sanity-check",function(G){var U=G.element;if(U.matches(A)){G.code="",U.setAttribute(y,x);var I=U.appendChild(document.createElement("CODE"));I.textContent=u;var _=U.getAttribute("data-src"),N=G.language;if(N==="none"){var j=(/\.(\w+)$/.exec(_)||[,"none"])[1];N=g[j]||j}c.util.setLanguage(I,N),c.util.setLanguage(U,N);var R=c.plugins.autoloader;R&&R.loadLanguages(N),C(_,function(Y){U.setAttribute(y,h);var D=M(U.getAttribute("data-range"));if(D){var X=Y.split(/\r\n?|\n/g),me=D[0],xe=D[1]==null?X.length:D[1];me<0&&(me+=X.length),me=Math.max(0,Math.min(me-1,X.length)),xe<0&&(xe+=X.length),xe=Math.max(0,Math.min(xe,X.length)),Y=X.slice(me,xe).join(`
|
|
46
|
-
`),U.hasAttribute("data-start")||U.setAttribute("data-start",String(me+1))}I.textContent=Y,c.highlightElement(I)},function(Y){U.setAttribute(y,S),I.textContent=Y})}}),c.plugins.fileHighlight={highlight:function(U){for(var I=(U||document).querySelectorAll(A),_=0,N;N=I[_++];)c.highlightElement(N)}};var k=!1;c.fileHighlight=function(){k||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),k=!0),c.plugins.fileHighlight.highlight.apply(this,arguments)}})()})(Xs)),Xs.exports}var Ug=Dg();const Hg=xu(Ug);Prism.languages.json={property:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,lookbehind:!0,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"}},Prism.languages.webmanifest=Prism.languages.json,(function(a){var i=/[*&][^\s[\]{},]+/,c=/!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/,u="(?:"+c.source+"(?:[ ]+"+i.source+")?|"+i.source+"(?:[ ]+"+c.source+")?)",f=/(?:[^\s\x00-\x08\x0e-\x1f!"#%&'*,\-:>?@[\]`{|}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]|[?:-]<PLAIN>)(?:[ \t]*(?:(?![#:])<PLAIN>|:<PLAIN>))*/.source.replace(/<PLAIN>/g,function(){return/[^\s\x00-\x08\x0e-\x1f,[\]{}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]/.source}),p=/"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'/.source;function g(y,x){x=(x||"").replace(/m/g,"")+"m";var h=/([:\-,[{]\s*(?:\s<<prop>>[ \t]+)?)(?:<<value>>)(?=[ \t]*(?:$|,|\]|\}|(?:[\r\n]\s*)?#))/.source.replace(/<<prop>>/g,function(){return u}).replace(/<<value>>/g,function(){return y});return RegExp(h,x)}a.languages.yaml={scalar:{pattern:RegExp(/([\-:]\s*(?:\s<<prop>>[ \t]+)?[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)\S[^\r\n]*(?:\2[^\r\n]+)*)/.source.replace(/<<prop>>/g,function(){return u})),lookbehind:!0,alias:"string"},comment:/#.*/,key:{pattern:RegExp(/((?:^|[:\-,[{\r\n?])[ \t]*(?:<<prop>>[ \t]+)?)<<key>>(?=\s*:\s)/.source.replace(/<<prop>>/g,function(){return u}).replace(/<<key>>/g,function(){return"(?:"+f+"|"+p+")"})),lookbehind:!0,greedy:!0,alias:"atrule"},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:"important"},datetime:{pattern:g(/\d{4}-\d\d?-\d\d?(?:[tT]|[ \t]+)\d\d?:\d{2}:\d{2}(?:\.\d*)?(?:[ \t]*(?:Z|[-+]\d\d?(?::\d{2})?))?|\d{4}-\d{2}-\d{2}|\d\d?:\d{2}(?::\d{2}(?:\.\d*)?)?/.source),lookbehind:!0,alias:"number"},boolean:{pattern:g(/false|true/.source,"i"),lookbehind:!0,alias:"important"},null:{pattern:g(/null|~/.source,"i"),lookbehind:!0,alias:"important"},string:{pattern:g(p),lookbehind:!0,greedy:!0},number:{pattern:g(/[+-]?(?:0x[\da-f]+|0o[0-7]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?|\.inf|\.nan)/.source,"i"),lookbehind:!0},tag:c,important:i,punctuation:/---|[:[\]{}\-,|>?]|\.\.\./},a.languages.yml=a.languages.yaml})(Prism),Prism.languages.javascript=Prism.languages.extend("clike",{"class-name":[Prism.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+(/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source)+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),Prism.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,Prism.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:Prism.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:Prism.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),Prism.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:Prism.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),Prism.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),Prism.languages.markup&&(Prism.languages.markup.tag.addInlined("script","javascript"),Prism.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),Prism.languages.js=Prism.languages.javascript,(function(a){var i="\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\b",c={pattern:/(^(["']?)\w+\2)[ \t]+\S.*/,lookbehind:!0,alias:"punctuation",inside:null},u={bash:c,environment:{pattern:RegExp("\\$"+i),alias:"constant"},variable:[{pattern:/\$?\(\([\s\S]+?\)\)/,greedy:!0,inside:{variable:[{pattern:/(^\$\(\([\s\S]+)\)\)/,lookbehind:!0},/^\$\(\(/],number:/\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee]-?\d+)?/,operator:/--|\+\+|\*\*=?|<<=?|>>=?|&&|\|\||[=!+\-*/%<>^&|]=?|[?~:]/,punctuation:/\(\(?|\)\)?|,|;/}},{pattern:/\$\((?:\([^)]+\)|[^()])+\)|`[^`]+`/,greedy:!0,inside:{variable:/^\$\(|^`|\)$|`$/}},{pattern:/\$\{[^}]+\}/,greedy:!0,inside:{operator:/:[-=?+]?|[!\/]|##?|%%?|\^\^?|,,?/,punctuation:/[\[\]]/,environment:{pattern:RegExp("(\\{)"+i),lookbehind:!0,alias:"constant"}}},/\$(?:\w+|[#?*!@$])/],entity:/\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|U[0-9a-fA-F]{8}|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{1,2})/};a.languages.bash={shebang:{pattern:/^#!\s*\/.*/,alias:"important"},comment:{pattern:/(^|[^"{\\$])#.*/,lookbehind:!0},"function-name":[{pattern:/(\bfunction\s+)[\w-]+(?=(?:\s*\(?:\s*\))?\s*\{)/,lookbehind:!0,alias:"function"},{pattern:/\b[\w-]+(?=\s*\(\s*\)\s*\{)/,alias:"function"}],"for-or-select":{pattern:/(\b(?:for|select)\s+)\w+(?=\s+in\s)/,alias:"variable",lookbehind:!0},"assign-left":{pattern:/(^|[\s;|&]|[<>]\()\w+(?:\.\w+)*(?=\+?=)/,inside:{environment:{pattern:RegExp("(^|[\\s;|&]|[<>]\\()"+i),lookbehind:!0,alias:"constant"}},alias:"variable",lookbehind:!0},parameter:{pattern:/(^|\s)-{1,2}(?:\w+:[+-]?)?\w+(?:\.\w+)*(?=[=\s]|$)/,alias:"variable",lookbehind:!0},string:[{pattern:/((?:^|[^<])<<-?\s*)(\w+)\s[\s\S]*?(?:\r?\n|\r)\2/,lookbehind:!0,greedy:!0,inside:u},{pattern:/((?:^|[^<])<<-?\s*)(["'])(\w+)\2\s[\s\S]*?(?:\r?\n|\r)\3/,lookbehind:!0,greedy:!0,inside:{bash:c}},{pattern:/(^|[^\\](?:\\\\)*)"(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^"\\`$])*"/,lookbehind:!0,greedy:!0,inside:u},{pattern:/(^|[^$\\])'[^']*'/,lookbehind:!0,greedy:!0},{pattern:/\$'(?:[^'\\]|\\[\s\S])*'/,greedy:!0,inside:{entity:u.entity}}],environment:{pattern:RegExp("\\$?"+i),alias:"constant"},variable:u.variable,function:{pattern:/(^|[\s;|&]|[<>]\()(?:add|apropos|apt|apt-cache|apt-get|aptitude|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cargo|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|docker|docker-compose|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|java|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|node|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|podman|podman-compose|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|sysctl|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vcpkg|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/,lookbehind:!0},keyword:{pattern:/(^|[\s;|&]|[<>]\()(?:case|do|done|elif|else|esac|fi|for|function|if|in|select|then|until|while)(?=$|[)\s;|&])/,lookbehind:!0},builtin:{pattern:/(^|[\s;|&]|[<>]\()(?:\.|:|alias|bind|break|builtin|caller|cd|command|continue|declare|echo|enable|eval|exec|exit|export|getopts|hash|help|let|local|logout|mapfile|printf|pwd|read|readarray|readonly|return|set|shift|shopt|source|test|times|trap|type|typeset|ulimit|umask|unalias|unset)(?=$|[)\s;|&])/,lookbehind:!0,alias:"class-name"},boolean:{pattern:/(^|[\s;|&]|[<>]\()(?:false|true)(?=$|[)\s;|&])/,lookbehind:!0},"file-descriptor":{pattern:/\B&\d\b/,alias:"important"},operator:{pattern:/\d?<>|>\||\+=|=[=~]?|!=?|<<[<-]?|[&\d]?>>|\d[<>]&?|[<>][&=]?|&[>&]?|\|[&|]?/,inside:{"file-descriptor":{pattern:/^\d/,alias:"important"}}},punctuation:/\$?\(\(?|\)\)?|\.\.|[{}[\];\\]/,number:{pattern:/(^|\s)(?:[1-9]\d*|0)(?:[.,]\d+)?\b/,lookbehind:!0}},c.inside=a.languages.bash;for(var f=["comment","function-name","for-or-select","assign-left","parameter","string","environment","function","keyword","builtin","boolean","file-descriptor","operator","punctuation","number"],p=u.variable[1].inside,g=0;g<f.length;g++)p[f[g]]=a.languages.bash[f[g]];a.languages.sh=a.languages.bash,a.languages.shell=a.languages.bash})(Prism);var Dd={},Ud;function Lg(){return Ud||(Ud=1,Prism.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern://,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},Prism.languages.python["string-interpolation"].inside.interpolation.inside.rest=Prism.languages.python,Prism.languages.py=Prism.languages.python),Dd}Lg(),Prism.languages.go=Prism.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"|`[^`]*`/,lookbehind:!0,greedy:!0},keyword:/\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/,boolean:/\b(?:_|false|iota|nil|true)\b/,number:[/\b0(?:b[01_]+|o[0-7_]+)i?\b/i,/\b0x(?:[a-f\d_]+(?:\.[a-f\d_]*)?|\.[a-f\d_]+)(?:p[+-]?\d+(?:_\d+)*)?i?(?!\w)/i,/(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?[\d_]+)?i?(?!\w)/i],operator:/[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,builtin:/\b(?:append|bool|byte|cap|close|complex|complex(?:64|128)|copy|delete|error|float(?:32|64)|u?int(?:8|16|32|64)?|imag|len|make|new|panic|print(?:ln)?|real|recover|rune|string|uintptr)\b/}),Prism.languages.insertBefore("go","string",{char:{pattern:/'(?:\\.|[^'\\\r\n]){0,10}'/,greedy:!0}}),delete Prism.languages.go["class-name"];var Hd={},Ld;function Bg(){return Ld||(Ld=1,(function(a){var i=/\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record(?!\s*[(){}[\]<>=%~.:,;?+\-*/&|^])|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/,c=/(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source,u={pattern:RegExp(/(^|[^\w.])/.source+c+/[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}},punctuation:/\./}};a.languages.java=a.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"/,lookbehind:!0,greedy:!0},"class-name":[u,{pattern:RegExp(/(^|[^\w.])/.source+c+/[A-Z]\w*(?=\s+\w+\s*[;,=()]|\s*(?:\[[\s,]*\]\s*)?::\s*new\b)/.source),lookbehind:!0,inside:u.inside},{pattern:RegExp(/(\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\s+)/.source+c+/[A-Z]\w*\b/.source),lookbehind:!0,inside:u.inside}],keyword:i,function:[a.languages.clike.function,{pattern:/(::\s*)[a-z_]\w*/,lookbehind:!0}],number:/\b0b[01][01_]*L?\b|\b0x(?:\.[\da-f_p+-]+|[\da-f_]+(?:\.[\da-f_p+-]+)?)\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i,operator:{pattern:/(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,lookbehind:!0},constant:/\b[A-Z][A-Z_\d]+\b/}),a.languages.insertBefore("java","string",{"triple-quoted-string":{pattern:/"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,greedy:!0,alias:"string"},char:{pattern:/'(?:\\.|[^'\\\r\n]){1,6}'/,greedy:!0}}),a.languages.insertBefore("java","class-name",{annotation:{pattern:/(^|[^.])@\w+(?:\s*\.\s*\w+)*/,lookbehind:!0,alias:"punctuation"},generics:{pattern:/<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/,inside:{"class-name":u,keyword:i,punctuation:/[<>(),.:]/,operator:/[?&|]/}},import:[{pattern:RegExp(/(\bimport\s+)/.source+c+/(?:[A-Z]\w*|\*)(?=\s*;)/.source),lookbehind:!0,inside:{namespace:u.inside.namespace,punctuation:/\./,operator:/\*/,"class-name":/\w+/}},{pattern:RegExp(/(\bimport\s+static\s+)/.source+c+/(?:\w+|\*)(?=\s*;)/.source),lookbehind:!0,alias:"static",inside:{namespace:u.inside.namespace,static:/\b\w+$/,punctuation:/\./,operator:/\*/,"class-name":/\w+/}}],namespace:{pattern:RegExp(/(\b(?:exports|import(?:\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\s+)(?!<keyword>)[a-z]\w*(?:\.[a-z]\w*)*\.?/.source.replace(/<keyword>/g,function(){return i.source})),lookbehind:!0,inside:{punctuation:/\./}}})})(Prism)),Hd}Bg();const On=({code:a,language:i,title:c,showCopy:u=!0,theme:f="dark",wrap:p=!1})=>{const[g,y]=ms.useState(!1);le.useEffect(()=>{Hg.highlightAll()},[a,f]);const x=async()=>{try{await navigator.clipboard.writeText(a),y(!0),setTimeout(()=>y(!1),2e3)}catch(C){console.error("Failed to copy text: ",C)}},h=f==="dark"?"bg-gray-900 border-gray-700":"bg-gray-50 border-gray-200",S=f==="dark"?"bg-gray-800 border-gray-700 text-gray-300":"bg-gray-100 border-gray-200 text-gray-700",A=f==="dark"?"text-gray-400 hover:text-gray-200":"text-gray-500 hover:text-gray-900";return o.jsxs("div",{className:`min-w-0 rounded-lg overflow-hidden border ${h}`,children:[(c||u)&&o.jsxs("div",{className:`flex items-center justify-between gap-3 px-3 sm:px-4 py-2 border-b ${S}`,children:[c&&o.jsx("span",{className:"min-w-0 truncate text-sm font-medium",children:c}),u&&o.jsx("button",{onClick:x,className:`shrink-0 flex items-center gap-1 text-xs transition-colors ${A}`,"aria-label":"Copy code to clipboard",children:g?o.jsxs(o.Fragment,{children:[o.jsx(Xy,{className:"w-3 h-3"}),o.jsx("span",{children:"Copied"})]}):o.jsxs(o.Fragment,{children:[o.jsx(Qy,{className:"w-3 h-3"}),o.jsx("span",{children:"Copy"})]})})]}),o.jsx("div",{className:`p-3 sm:p-4 overflow-x-auto ${f==="dark"?"bg-gray-800":"bg-white"}`,children:o.jsx("pre",{className:`m-0 text-xs sm:text-sm ${p?"whitespace-pre-wrap break-words":""} ${f==="dark"?"text-gray-100":"text-gray-800"}`,children:o.jsx("code",{className:`language-${i} bg-transparent`,children:a})})})]})};function Yg(a){const i=Array.isArray(a.type)?a.type.join(" | "):a.type;return i?a.format?`${i} (${a.format})`:i:a.oneOf?"oneOf":a.anyOf?"anyOf":a.allOf?"allOf":a.const!==void 0?"const":"any"}const rl=({spec:a,schema:i,theme:c,required:u=!1,level:f=0,seen:p=new Set,requiredPropsFirst:g=!1,sortPropsAlphabetically:y=!1})=>{const x={spec:a,theme:c,requiredPropsFirst:g,sortPropsAlphabetically:y};if(Wt.isReference(i)){if(p.has(i.$ref))return o.jsxs("div",{className:"py-1 text-sm opacity-70",children:["↳ ",o.jsx("code",{children:i.$ref.replace("#/components/schemas/","")})," (recursive reference)"]});const k=new Set(p);k.add(i.$ref);let G;try{G=Wt.resolveReference(a,i.$ref)}catch{return o.jsxs("div",{className:"py-1 text-sm text-red-500",children:["Unresolved reference: ",o.jsx("code",{children:i.$ref})]})}return o.jsx(rl,{...x,schema:G,required:u,level:f,seen:k})}const h=c==="dark"?"text-gray-400":"text-gray-600",S=c==="dark"?"border-gray-700":"border-gray-200",A=[["All of",i.allOf],["One of",i.oneOf],["Any of",i.anyOf]],C=new Set(i.required||[]),M=Object.entries(i.properties||{}).sort(([k],[G])=>{if(g){const U=Number(C.has(G))-Number(C.has(k));if(U)return U}return y?k.localeCompare(G):0});return o.jsxs("div",{className:f?`border-l-2 ${S} pl-3`:"",children:[o.jsxs("div",{className:"flex flex-wrap items-center gap-2 py-1",children:[o.jsx("span",{className:c==="dark"?"text-blue-300":"text-blue-600",children:Yg(i)}),u&&o.jsx("span",{className:"rounded bg-red-100 px-2 py-0.5 text-xs text-red-700 dark:bg-red-900/30 dark:text-red-300",children:"required"}),(i.nullable||Array.isArray(i.type)&&i.type.includes("null"))&&o.jsx("span",{className:"rounded bg-gray-100 px-2 py-0.5 text-xs text-gray-700 dark:bg-gray-700 dark:text-gray-300",children:"nullable"}),i.deprecated&&o.jsx("span",{className:"rounded bg-orange-100 px-2 py-0.5 text-xs text-orange-700",children:"deprecated"}),i.readOnly&&o.jsx("span",{className:"text-xs opacity-60",children:"readOnly"}),i.writeOnly&&o.jsx("span",{className:"text-xs opacity-60",children:"writeOnly"})]}),i.description&&o.jsx("p",{className:`mt-1 text-sm leading-relaxed ${h}`,children:i.description}),i.enum&&o.jsxs("p",{className:`mt-1 text-xs ${h}`,children:["Allowed: ",i.enum.map(String).join(", ")]}),i.const!==void 0&&o.jsxs("p",{className:`mt-1 text-xs ${h}`,children:["Constant: ",JSON.stringify(i.const)]}),i.default!==void 0&&o.jsxs("p",{className:`mt-1 text-xs ${h}`,children:["Default: ",JSON.stringify(i.default)]}),(i.example!==void 0||i.examples?.length)&&o.jsx("div",{className:"mt-2",children:o.jsx(On,{code:JSON.stringify(i.example??i.examples?.[0],null,2),language:"json",title:"Example",showCopy:!1,theme:c,wrap:!0})}),i.items&&o.jsxs("div",{className:"mt-3",children:[o.jsx("div",{className:"mb-1 text-xs font-semibold uppercase tracking-wide opacity-60",children:"Items"}),o.jsx(rl,{...x,schema:i.items,level:f+1,seen:p})]}),A.map(([k,G])=>G?.length?o.jsxs("div",{className:"mt-3",children:[o.jsx("div",{className:"mb-2 text-xs font-semibold uppercase tracking-wide opacity-60",children:k}),o.jsx("div",{className:"space-y-3",children:G.map((U,I)=>o.jsx(rl,{...x,schema:U,level:f+1,seen:p},I))})]},k):null),M.length>0&&o.jsx("div",{className:"mt-3 space-y-3",children:M.map(([k,G])=>o.jsxs("div",{children:[o.jsx("div",{className:"font-mono text-sm font-medium",children:k}),o.jsx(rl,{...x,schema:G,required:C.has(k),level:f+1,seen:p})]},k))}),i.additionalProperties&&typeof i.additionalProperties=="object"&&o.jsxs("div",{className:"mt-3",children:[o.jsx("div",{className:"mb-1 text-xs font-semibold uppercase tracking-wide opacity-60",children:"Additional properties"}),o.jsx(rl,{...x,schema:i.additionalProperties,level:f+1,seen:p})]})]})};function sn(a){return{preRequest:a?.preRequest||"",tests:a?.tests||""}}function Gg(a){return{...a,query:a.query?.map(i=>({...i})),headers:a.headers?.map(i=>({...i})),auth:a.auth?{...a.auth}:void 0}}function Hr(a){return Object.assign(Object.create(null),a)}function wt(a){if(typeof a=="string")return a;if(a instanceof Error)return a.message;try{return JSON.stringify(a)}catch{return String(a)}}function Wl(a,i){if(Object.is(a,i))return!0;if(typeof a!=typeof i||a===null||i===null)return!1;if(Array.isArray(a))return Array.isArray(i)&&a.length===i.length&&a.every((c,u)=>Wl(c,i[u]));if(typeof a=="object"&&typeof i=="object"){const c=a,u=i,f=Object.keys(c),p=Object.keys(u);return f.length===p.length&&f.every(g=>Object.prototype.hasOwnProperty.call(u,g)&&Wl(c[g],u[g]))}return!1}function on(a){throw new Error(a)}function Ig(a){const i=h=>{Object.is(a,h)||on(`expected ${wt(a)} to equal ${wt(h)}`)},c=h=>{Wl(a,h)||on(`expected ${wt(a)} to deeply equal ${wt(h)}`)},u=h=>{(typeof a=="string"?a.includes(String(h)):Array.isArray(a)&&a.some(A=>Wl(A,h)))||on(`expected ${wt(a)} to include ${wt(h)}`)},f=(h,...S)=>{(!a||typeof a!="object"||!Object.prototype.hasOwnProperty.call(a,h))&&on(`expected value to have property ${h}`),S.length>0&&!Wl(a[h],S[0])&&on(`expected property ${h} to equal ${wt(S[0])}`)},x={above:h=>{(typeof a!="number"||a<=h)&&on(`expected ${wt(a)} to be above ${h}`)},below:h=>{(typeof a!="number"||a>=h)&&on(`expected ${wt(a)} to be below ${h}`)},oneOf:h=>{h.some(S=>Wl(a,S))||on(`expected ${wt(a)} to be one of ${wt(h)}`)}};return Object.defineProperties(x,{ok:{get:()=>(a||on(`expected ${wt(a)} to be truthy`),!0)},true:{get:()=>(a!==!0&&on(`expected ${wt(a)} to be true`),!0)},false:{get:()=>(a!==!1&&on(`expected ${wt(a)} to be false`),!0)}}),{to:{equal:i,eql:c,include:u,match:h=>{(typeof a!="string"||!h.test(a))&&on(`expected ${wt(a)} to match ${h}`)},have:{property:f},be:x}}}function Zs(a,i){return a.findIndex(c=>c.key.toLowerCase()===i.toLowerCase())}function Fg(a){const i=()=>a.headers||(a.headers=[]),c=(u,f)=>{const p=i(),g=Zs(p,u),y={key:u,value:String(f),enabled:!0};g>=0?p[g]=y:p.push(y)};return{get(u){const f=Zs(i(),u);return f>=0?i()[f].value:void 0},has(u){return Zs(i(),u)>=0},set:c,upsert({key:u,value:f}){c(u,f)},remove(u){a.headers=i().filter(f=>f.key.toLowerCase()!==u.toLowerCase())},toObject(){const u={};for(const f of i())f.enabled!==!1&&(u[f.key]=f.value);return u}}}function Vg(a){return{get(i){return a.find(([c])=>c.toLowerCase()===i.toLowerCase())?.[1]},has(i){return a.some(([c])=>c.toLowerCase()===i.toLowerCase())},toObject(){const i={};for(const[c,u]of a)i[c]=u;return i}}}async function Bd(a){const i=Gg(a.draft),c=Hr(a.variables||{}),u=Hr(a.collectionVariables||{}),f=Hr(a.externalVariables||{}),p=Hr(a.environmentVariables||{}),g=[],y=[],x=[],h=[],S=[],A=j=>{Object.prototype.hasOwnProperty.call(p,j)?c[j]=p[j]:Object.prototype.hasOwnProperty.call(f,j)?c[j]=f[j]:Object.prototype.hasOwnProperty.call(u,j)?c[j]=u[j]:delete c[j]},C={get(j){return p[j]},has(j){return Object.prototype.hasOwnProperty.call(p,j)},set(j,R){const Y=String(R);p[j]=Y,c[j]=Y,y.push({action:"set",key:j,value:Y})},unset(j){delete p[j],A(j),y.push({action:"unset",key:j})},replaceIn(j){return j.replace(/\{\{\s*([^{}]+?)\s*\}\}/g,(R,Y)=>{const D=Y.trim();return Object.prototype.hasOwnProperty.call(p,D)?p[D]:R})}},M={get(j){return u[j]},has(j){return Object.prototype.hasOwnProperty.call(u,j)},set(j,R){const Y=String(R);u[j]=Y,A(j),g.push({action:"set",key:j,value:Y})},unset(j){delete u[j],A(j),g.push({action:"unset",key:j})},replaceIn(j){return j.replace(/\{\{\s*([^{}]+?)\s*\}\}/g,(R,Y)=>{const D=Y.trim();return Object.prototype.hasOwnProperty.call(u,D)?u[D]:R})}},k={get(j){return c[j]},has(j){return Object.prototype.hasOwnProperty.call(c,j)},set(j,R){c[j]=String(R)},unset(j){delete c[j]},replaceIn(j){return j.replace(/\{\{\s*([^{}]+?)\s*\}\}/g,(R,Y)=>{const D=Y.trim();return Object.prototype.hasOwnProperty.call(c,D)?c[D]:R})}},G={get raw(){return i.body||""},set raw(j){i.body=String(j)}},U={get method(){return i.method},set method(j){i.method=String(j)},get url(){return i.url},set url(j){i.url=String(j)},headers:Fg(i),body:G},I=a.response?{code:a.response.status,status:a.response.statusText,responseTime:a.response.responseTime,headers:Vg(a.response.headers),text:()=>a.response?.body||"",json:()=>JSON.parse(a.response?.body||"")}:void 0,_={request:U,response:I,environment:C,collection:M,variables:k,expect:Ig,test(j,R){if(a.phase!=="tests")throw new Error("flex.test is only available in post-response test scripts.");const Y=Promise.resolve().then(R).then(()=>{x.push({name:j,passed:!0})}).catch(D=>{x.push({name:j,passed:!1,error:D instanceof Error?D.message:String(D)})});S.push(Y)}},N={log:(...j)=>h.push(j.map(wt).join(" ")),info:(...j)=>h.push(j.map(wt).join(" ")),warn:(...j)=>h.push(`WARN ${j.map(wt).join(" ")}`),error:(...j)=>h.push(`ERROR ${j.map(wt).join(" ")}`)};try{return await new Function("flex","console",`"use strict"; return (async () => {
|
|
47
|
-
${
|
|
48
|
-
})();`)(_,N),await Promise.all(S),{draft:i,variables:c,collectionVariables:u,externalVariables:f,environmentVariables:p,collectionChanges:g,environmentChanges:y,tests:x,logs:h}}catch(j){return await Promise.all(S),{draft:i,variables:c,collectionVariables:u,externalVariables:f,environmentVariables:p,collectionChanges:g,environmentChanges:y,tests:x,logs:h,error:j instanceof Error?j.message:String(j)}}}const Xg="flexdoc-api-client",Zg=1,Pl="workspaces",Qg="My Collection",Yd=100,Gd=256*1024;function Ia(){return new Date().toISOString()}function cn(a){return!!a&&typeof a=="object"&&!Array.isArray(a)}function Fe(a,i){return typeof a[i]=="string"}function Lr(a,i){const c=a[i];return c===void 0||typeof c=="number"&&Number.isFinite(c)}function Id(a){return!cn(a)||!Fe(a,"key")||!Fe(a,"value")?!1:a.enabled===void 0||typeof a.enabled=="boolean"}function Qs(a){if(!cn(a)||typeof a.type!="string")return!1;if(a.type==="none"||a.type==="inherit")return!0;if(a.type==="bearer")return Fe(a,"token");if(a.type==="oauth2"){if(!Fe(a,"accessToken"))return!1;const i=new Set(["accessToken","authorizationCode","clientCredentials","password","implicit"]);if(a.grantType!==void 0&&(typeof a.grantType!="string"||!i.has(a.grantType))||a.clientAuthentication!==void 0&&a.clientAuthentication!=="body"&&a.clientAuthentication!=="basic")return!1;for(const c of["authorizationUrl","tokenUrl","clientId","clientSecret","redirectUri","username","password","refreshToken"])if(a[c]!==void 0&&typeof a[c]!="string")return!1;return a.scopes===void 0||Array.isArray(a.scopes)&&a.scopes.every(c=>typeof c=="string")}return a.type==="basic"?Fe(a,"username")&&Fe(a,"password"):a.type==="apiKey"&&Fe(a,"key")&&Fe(a,"value")&&(a.in==="header"||a.in==="query")}function Fd(a){return!cn(a)||!Fe(a,"method")||!Fe(a,"url")||a.query!==void 0&&(!Array.isArray(a.query)||!a.query.every(Id))||a.headers!==void 0&&(!Array.isArray(a.headers)||!a.headers.every(Id))||a.body!==void 0&&typeof a.body!="string"||a.contentType!==void 0&&typeof a.contentType!="string"?!1:a.auth===void 0||Qs(a.auth)}function Vd(a){return cn(a)&&Fe(a,"id")&&Fe(a,"key")&&Fe(a,"value")&&(a.enabled===void 0||typeof a.enabled=="boolean")}function Kg(a){return!cn(a)||!Fe(a,"id")||!Fe(a,"name")||!Fe(a,"createdAt")||!Fe(a,"updatedAt")?null:{id:a.id,name:a.name,auth:Qs(a.auth)?a.auth:{type:"none"},variables:Array.isArray(a.variables)?a.variables.filter(Vd):[],createdAt:a.createdAt,updatedAt:a.updatedAt}}function Jg(a){return!cn(a)||!Fe(a,"id")||!Fe(a,"collectionId")||a.parentFolderId!==void 0&&typeof a.parentFolderId!="string"||!Fe(a,"name")||!Fe(a,"createdAt")||!Fe(a,"updatedAt")?null:{id:a.id,collectionId:a.collectionId,parentFolderId:a.parentFolderId,name:a.name,auth:Qs(a.auth)?a.auth:{type:"inherit"},createdAt:a.createdAt,updatedAt:a.updatedAt}}function Wg(a,i){const c=a.map(Jg).filter(f=>f!==null).filter(f=>i.has(f.collectionId)),u=new Map(c.map(f=>[f.id,f]));for(const f of c){if(!f.parentFolderId)continue;const p=u.get(f.parentFolderId);(!p||p.collectionId!==f.collectionId||p.id===f.id)&&(f.parentFolderId=void 0)}for(const f of c){if(!f.parentFolderId)continue;const p=new Set([f.id]);let g=f.parentFolderId;for(;g;){if(p.has(g)){f.parentFolderId=void 0;break}p.add(g),g=u.get(g)?.parentFolderId}}return c}function Xd(a){if(!(!cn(a)||!Fe(a,"preRequest")||!Fe(a,"tests")))return{preRequest:a.preRequest,tests:a.tests}}function Pg(a){if(!cn(a)||!Fe(a,"id")||!Fe(a,"collectionId")||a.folderId!==void 0&&typeof a.folderId!="string"||!Fe(a,"name")||!Fd(a.request)||!Fe(a,"createdAt")||!Fe(a,"updatedAt"))return null;const i=Xd(a.scripts);return{id:a.id,collectionId:a.collectionId,folderId:a.folderId,name:a.name,request:a.request,...i?{scripts:i}:{},createdAt:a.createdAt,updatedAt:a.updatedAt}}function e0(a){return!cn(a)||!Fe(a,"id")||!Fe(a,"name")||!Array.isArray(a.variables)||!Fe(a,"createdAt")||!Fe(a,"updatedAt")?null:{id:a.id,name:a.name,variables:a.variables.filter(Vd),createdAt:a.createdAt,updatedAt:a.updatedAt}}function t0(a){return Array.isArray(a)&&a.length===2&&typeof a[0]=="string"&&typeof a[1]=="string"}function n0(a){return!cn(a)||!Fe(a,"name")||typeof a.passed!="boolean"||a.error!==void 0&&typeof a.error!="string"?null:{name:a.name,passed:a.passed,error:a.error}}function l0(a){if(!cn(a)||!Fe(a,"id")||!Fd(a.request)||!Fe(a,"executedMethod")||!Fe(a,"resolvedUrl")||!Lr(a,"status")||a.statusText!==void 0&&typeof a.statusText!="string"||!Lr(a,"responseTime")||a.responseHeaders!==void 0&&(!Array.isArray(a.responseHeaders)||!a.responseHeaders.every(t0))||a.responseBody!==void 0&&typeof a.responseBody!="string"||a.responseBodyTruncated!==void 0&&typeof a.responseBodyTruncated!="boolean"||a.runId!==void 0&&typeof a.runId!="string"||a.runName!==void 0&&typeof a.runName!="string"||!Lr(a,"runIndex")||!Lr(a,"runTotal")||a.runPassed!==void 0&&typeof a.runPassed!="boolean"||a.runCancelled!==void 0&&typeof a.runCancelled!="boolean"||a.error!==void 0&&typeof a.error!="string"||a.scriptError!==void 0&&typeof a.scriptError!="string"||!Fe(a,"createdAt"))return null;const i=Xd(a.scripts),c=Array.isArray(a.scriptTests)?a.scriptTests.map(n0).filter(f=>f!==null):[],u=Array.isArray(a.scriptLogs)?a.scriptLogs.filter(f=>typeof f=="string"):[];return{id:a.id,collectionId:typeof a.collectionId=="string"?a.collectionId:void 0,folderId:typeof a.folderId=="string"?a.folderId:void 0,request:a.request,...i?{scripts:i}:{},executedMethod:a.executedMethod,resolvedUrl:a.resolvedUrl,status:a.status,statusText:a.statusText,responseTime:a.responseTime,responseHeaders:Array.isArray(a.responseHeaders)?a.responseHeaders.map(([f,p])=>[f,p]):void 0,responseBody:typeof a.responseBody=="string"?a.responseBody:void 0,responseBodyTruncated:a.responseBodyTruncated===!0?!0:void 0,runId:typeof a.runId=="string"?a.runId:void 0,runName:typeof a.runName=="string"?a.runName:void 0,runIndex:typeof a.runIndex=="number"?a.runIndex:void 0,runTotal:typeof a.runTotal=="number"?a.runTotal:void 0,runPassed:typeof a.runPassed=="boolean"?a.runPassed:void 0,runCancelled:a.runCancelled===!0?!0:void 0,error:a.error,...c.length?{scriptTests:c}:{},...u.length?{scriptLogs:u}:{},scriptError:a.scriptError,createdAt:a.createdAt}}function Zd(a){const i=Object.create(null);for(const c of a){const u=c.key.trim();c.enabled===!1||!u||(i[u]=c.value)}return i}function Ht(a){const i=globalThis.crypto?.randomUUID?.();return i?`${a}-${i}`:`${a}-${Date.now()}-${Math.random().toString(36).slice(2,10)}`}function a0(a,i){const c=i?.trim()||"unknown-host",u=a?.trim()||"untitled";return`flexdoc:${encodeURIComponent(c)}:${encodeURIComponent(u)}`}function Dn(a){const i=a.auth?a.auth.type==="oauth2"?{...a.auth,scopes:a.auth.scopes?[...a.auth.scopes]:void 0}:{...a.auth}:void 0;return{...a,query:a.query?.map(c=>({...c})),headers:a.headers?.map(c=>({...c})),auth:i}}function Fa(){const a=Ia();return{version:6,collections:[{id:Ht("collection"),name:Qg,auth:{type:"none"},variables:[],createdAt:a,updatedAt:a}],folders:[],requests:[],environments:[],history:[]}}function r0(a){if(!cn(a)||![1,2,3,4,5,6].includes(a.version))return Fa();const i=(Array.isArray(a.collections)?a.collections:[]).map(Kg).filter(h=>h!==null);if(i.length===0)return Fa();const c=new Set(i.map(h=>h.id)),u=Wg(Array.isArray(a.folders)?a.folders:[],c),f=new Map(u.map(h=>[h.id,h])),p=(Array.isArray(a.requests)?a.requests:[]).map(Pg).filter(h=>h!==null).filter(h=>c.has(h.collectionId)).map(h=>h.folderId?f.get(h.folderId)?.collectionId===h.collectionId?h:{...h,folderId:void 0}:h);if(a.version===1)return{version:6,collections:i,folders:u,requests:p,environments:[],history:[]};const g=(Array.isArray(a.environments)?a.environments:[]).map(e0).filter(h=>h!==null),y=typeof a.activeEnvironmentId=="string"&&g.some(h=>h.id===a.activeEnvironmentId)?a.activeEnvironmentId:void 0,x=(a.version===4||a.version===5||a.version===6)&&Array.isArray(a.history)?a.history.map(l0).filter(h=>h!==null).slice(0,Yd):[];return{version:6,collections:i,folders:u,requests:p,environments:g,activeEnvironmentId:y,history:x}}function Qd(a,i){const c=i.responseBody===void 0?void 0:i.responseBody.slice(0,Gd),u=i.responseBodyTruncated===!0||(i.responseBody?.length||0)>Gd,f={id:Ht("history"),collectionId:i.collectionId,folderId:i.folderId,request:Dn(i.request),...i.scripts?{scripts:sn(i.scripts)}:{},executedMethod:i.executedMethod,resolvedUrl:i.resolvedUrl,status:i.status,statusText:i.statusText,responseTime:i.responseTime,...i.responseHeaders?.length?{responseHeaders:i.responseHeaders.map(([p,g])=>[p,g])}:{},...c!==void 0?{responseBody:c,...u?{responseBodyTruncated:!0}:{}}:{},runId:i.runId,runName:i.runName,runIndex:i.runIndex,runTotal:i.runTotal,runPassed:i.runPassed,...i.runCancelled?{runCancelled:!0}:{},error:i.error,...i.scriptTests?.length?{scriptTests:i.scriptTests.map(p=>({...p}))}:{},...i.scriptLogs?.length?{scriptLogs:[...i.scriptLogs]}:{},scriptError:i.scriptError,createdAt:Ia()};return{...a,history:[f,...a.history].slice(0,Yd)}}function Kd(a,i,c,u={type:"none"}){if(u.type!=="inherit")return{...u};const f=new Map(a.folders.map(x=>[x.id,x])),p=new Set;let g=c?f.get(c):void 0;for(;g&&g.collectionId===i&&!p.has(g.id);){if(p.add(g.id),g.auth.type!=="inherit")return{...g.auth};g=g.parentFolderId?f.get(g.parentFolderId):void 0}const y=a.collections.find(x=>x.id===i);return y&&y.auth.type!=="inherit"?{...y.auth}:{type:"none"}}function Jd(a,i){const c=a.collections.find(u=>u.id===i);return Zd(c?.variables||[])}function Wd(a){const i=a.environments.find(c=>c.id===a.activeEnvironmentId);return Zd(i?.variables||[])}function Pd(a,i){if(!a.activeEnvironmentId||i.length===0)return a;const c=a.environments.findIndex(y=>y.id===a.activeEnvironmentId);if(c<0)return a;let f=a.environments[c].variables.map(y=>({...y})),p=!1;for(const y of i){const x=y.key.trim();if(!x)continue;if(y.action==="unset"){const A=f.filter(C=>C.key.trim()!==x);A.length!==f.length&&(f=A,p=!0);continue}const h=f.map((A,C)=>A.key.trim()===x?C:-1).filter(A=>A>=0),S=y.value||"";if(h.length>0){const A=h[0];f[A]={...f[A],key:x,value:S,enabled:!0},h.length>1&&(f=f.filter((C,M)=>M===A||C.key.trim()!==x))}else f.push({id:Ht("variable"),key:x,value:S,enabled:!0});p=!0}if(!p)return a;const g=a.environments.map((y,x)=>x===c?{...y,variables:f,updatedAt:Ia()}:y);return{...a,environments:g}}function ef(a,i,c){if(!i||c.length===0)return a;const u=a.collections.findIndex(x=>x.id===i);if(u<0)return a;let p=a.collections[u].variables.map(x=>({...x})),g=!1;for(const x of c){const h=x.key.trim();if(!h)continue;if(x.action==="unset"){const C=p.filter(M=>M.key.trim()!==h);C.length!==p.length&&(p=C,g=!0);continue}const S=p.map((C,M)=>C.key.trim()===h?M:-1).filter(C=>C>=0),A=x.value||"";if(S.length>0){const C=S[0];p[C]={...p[C],key:h,value:A,enabled:!0},S.length>1&&(p=p.filter((M,k)=>k===C||M.key.trim()!==h))}else p.push({id:Ht("variable"),key:h,value:A,enabled:!0});g=!0}if(!g)return a;const y=a.collections.map((x,h)=>h===u?{...x,variables:p,updatedAt:Ia()}:x);return{...a,collections:y}}function i0(a,i){return{...a,environments:a.environments.filter(c=>c.id!==i),activeEnvironmentId:a.activeEnvironmentId===i?void 0:a.activeEnvironmentId}}function s0(a,i){const c=a.folders.find(f=>f.id===i);if(!c)return a;const u=Ia();return{...a,folders:a.folders.filter(f=>f.id!==i).map(f=>f.parentFolderId===i?{...f,parentFolderId:c.parentFolderId,updatedAt:u}:f),requests:a.requests.map(f=>f.folderId===i?{...f,folderId:c.parentFolderId,updatedAt:u}:f)}}function o0(a,i){const c=a.collections.filter(u=>u.id!==i);return c.length===0?{...Fa(),environments:a.environments,activeEnvironmentId:a.activeEnvironmentId,history:a.history}:{...a,collections:c,folders:a.folders.filter(u=>u.collectionId!==i),requests:a.requests.filter(u=>u.collectionId!==i)}}function tf(){return typeof indexedDB>"u"?Promise.resolve(null):new Promise((a,i)=>{const c=indexedDB.open(Xg,Zg);c.onupgradeneeded=()=>{const u=c.result;u.objectStoreNames.contains(Pl)||u.createObjectStore(Pl)},c.onsuccess=()=>a(c.result),c.onerror=()=>i(c.error||new Error("Unable to open FlexDoc API Client storage"))})}async function c0(a){const i=await tf();if(!i)return Fa();try{return await new Promise((c,u)=>{const p=i.transaction(Pl,"readonly").objectStore(Pl).get(a);p.onsuccess=()=>c(r0(p.result)),p.onerror=()=>u(p.error||new Error("Unable to load FlexDoc API Client workspace"))})}finally{i.close()}}async function u0(a,i){const c=await tf();if(c)try{await new Promise((u,f)=>{const p=c.transaction(Pl,"readwrite");p.objectStore(Pl).put(i,a),p.oncomplete=()=>u(),p.onerror=()=>f(p.error||new Error("Unable to save FlexDoc API Client workspace")),p.onabort=()=>f(p.error||new Error("Unable to save FlexDoc API Client workspace"))})}finally{c.close()}}function ea(a,i){const c=a?.trim();if(!c)throw new Error(`${i} is required for this OAuth flow.`);return c}function Br(a){return(a.scopes||[]).map(i=>i.trim()).filter(Boolean).join(" ")}function d0(a){if(typeof TextEncoder>"u")throw new Error("OAuth Basic client authentication requires UTF-8 encoding support.");const i=new TextEncoder().encode(a);let c="";for(const p of i)c+=String.fromCharCode(p);const u=globalThis.Buffer,f=typeof btoa=="function"?btoa(c):u?.from(c,"binary").toString("base64");if(!f)throw new Error("OAuth Basic client authentication requires Base64 support in this runtime.");return f}function nf(a){let i="";for(const f of a)i+=String.fromCharCode(f);const c=globalThis.Buffer,u=typeof btoa=="function"?btoa(i):c?.from(i,"binary").toString("base64");if(!u)throw new Error("OAuth PKCE requires Base64 support in this runtime.");return u.replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/g,"")}function lf(a=32){if(!globalThis.crypto?.getRandomValues)throw new Error("OAuth requires cryptographic random-number support.");const i=new Uint8Array(a);return globalThis.crypto.getRandomValues(i),nf(i)}async function f0(a){if(!globalThis.crypto?.subtle||typeof TextEncoder>"u")throw new Error("OAuth authorization-code flow requires Web Crypto PKCE support.");const i=await globalThis.crypto.subtle.digest("SHA-256",new TextEncoder().encode(a));return nf(new Uint8Array(i))}function af(a,i,c,u){const f=ea(a.authorizationUrl,"Authorization URL"),p=ea(a.clientId,"Client ID"),g=new URL(f),y=a.grantType||"accessToken";g.searchParams.set("response_type",y==="implicit"?"token":"code"),g.searchParams.set("client_id",p),g.searchParams.set("redirect_uri",c),g.searchParams.set("state",i);const x=Br(a);return x&&g.searchParams.set("scope",x),u&&(g.searchParams.set("code_challenge",u),g.searchParams.set("code_challenge_method","S256")),g.toString()}function p0(a){const i=new URL(a.location.href);return i.search="",i.hash="",i.toString()}async function m0(a,i){const c=i??(typeof window>"u"?void 0:window);if(!c)throw new Error("Interactive OAuth requires a browser window.");const u=a.redirectUri?.trim()||p0(c);if(new URL(u).origin!==c.location.origin)throw new Error("Interactive OAuth redirect URI must use the same origin as the FlexDoc page so the popup result can be read.");const f=lf(24);if((a.grantType||"accessToken")==="implicit")return{url:af(a,f,u),state:f,redirectUri:u};const p=lf(48),g=await f0(p);return{url:af(a,f,u,g),state:f,redirectUri:u,codeVerifier:p}}async function h0(a){const i=await a.text();let c;try{c=i?JSON.parse(i):{}}catch{c=Object.fromEntries(new URLSearchParams(i))}if(!a.ok){const g=String(c.error_description||c.error||`OAuth token endpoint returned ${a.status}`);throw new Error(g)}const u=typeof c.access_token=="string"?c.access_token:"";if(!u)throw new Error("OAuth token endpoint did not return access_token.");const f=c.expires_in,p=typeof f=="number"?f:typeof f=="string"&&f.trim()!==""&&Number.isFinite(Number(f))?Number(f):void 0;return{accessToken:u,refreshToken:typeof c.refresh_token=="string"?c.refresh_token:void 0,tokenType:typeof c.token_type=="string"?c.token_type:void 0,expiresIn:p,scope:typeof c.scope=="string"?c.scope:void 0}}async function Yr(a,i,c){const u=ea(a.tokenUrl,"Token URL"),f={"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},p=a.clientId?.trim();(a.clientAuthentication||"body")==="basic"&&p?f.Authorization=`Basic ${d0(`${p}:${a.clientSecret||""}`)}`:(p&&i.set("client_id",p),a.clientSecret&&i.set("client_secret",a.clientSecret));const g=await c(u,{method:"POST",headers:f,body:i.toString()});return h0(g)}async function y0(a,i){const c=i.windowObject??(typeof window>"u"?void 0:window);if(!c)throw new Error("Interactive OAuth requires a browser window.");const u=c.open(a.url,"flexdoc-oauth","popup,width=640,height=760");if(!u)throw new Error("OAuth popup was blocked. Allow popups for this documentation origin and try again.");const f=new URL(a.redirectUri),p=Date.now(),g=i.popupTimeoutMs??12e4,y=i.pollIntervalMs??200;for(;Date.now()-p<g;){if(u.closed)throw new Error("OAuth popup was closed before authorization completed.");try{const x=new URL(u.location.href);if(x.origin===f.origin&&x.pathname===f.pathname)return u.close(),x}catch{}await new Promise(x=>setTimeout(x,y))}throw u.close(),new Error("OAuth authorization timed out.")}async function g0(a,i={}){const c=a.grantType||"accessToken",u=i.fetchImpl??fetch;if(c==="accessToken")return{accessToken:ea(a.accessToken,"Access token")};if(c==="clientCredentials"){const A=new URLSearchParams({grant_type:"client_credentials"}),C=Br(a);return C&&A.set("scope",C),Yr(a,A,u)}if(c==="password"){const A=new URLSearchParams({grant_type:"password",username:ea(a.username,"Username"),password:a.password||""}),C=Br(a);return C&&A.set("scope",C),Yr(a,A,u)}const f=await m0(a,i.windowObject),p=await y0(f,i);if((p.searchParams.get("state")||new URLSearchParams(p.hash.replace(/^#/,"")).get("state"))!==f.state)throw new Error("OAuth state mismatch; authorization response was rejected.");const y=new URLSearchParams(p.hash.replace(/^#/,"")),x=p.searchParams.get("error")||y.get("error");if(x){const A=p.searchParams.get("error_description")||y.get("error_description");throw new Error(A||x)}if(c==="implicit"){const A=y.get("access_token")||"";if(!A)throw new Error("OAuth implicit response did not include access_token.");return{accessToken:A,tokenType:y.get("token_type")||void 0,expiresIn:y.get("expires_in")?Number(y.get("expires_in")):void 0,scope:y.get("scope")||void 0}}const h=p.searchParams.get("code");if(!h)throw new Error("OAuth authorization response did not include code.");const S=new URLSearchParams({grant_type:"authorization_code",code:h,redirect_uri:f.redirectUri});return f.codeVerifier&&S.set("code_verifier",f.codeVerifier),Yr(a,S,u)}async function x0(a,i={}){const c=ea(a.refreshToken,"Refresh token"),u=new URLSearchParams({grant_type:"refresh_token",refresh_token:c}),f=Br(a);return f&&u.set("scope",f),Yr(a,u,i.fetchImpl??fetch)}function b0(a){return a==="inherit"?{type:"inherit"}:a==="bearer"?{type:"bearer",token:""}:a==="oauth2"?{type:"oauth2",accessToken:"",grantType:"accessToken",scopes:[]}:a==="basic"?{type:"basic",username:"",password:""}:a==="apiKey"?{type:"apiKey",key:"",value:"",in:"header"}:{type:"none"}}function v0(a){return a.split(/\s+/).map(i=>i.trim()).filter(Boolean)}const rf=({auth:a,fieldClass:i,label:c,onChange:u})=>{const[f,p]=le.useState(!1),[g,y]=le.useState(null),x=a.grantType||"accessToken",h=x==="authorizationCode"||x==="implicit",S=x==="authorizationCode"||x==="clientCredentials"||x==="password",A=x!=="accessToken",C=async()=>{p(!0),y(null);try{const k=await g0(a);u({...a,accessToken:k.accessToken,refreshToken:k.refreshToken??a.refreshToken}),y(k.expiresIn?`Access token acquired; expires in ${k.expiresIn}s.`:"Access token acquired.")}catch(k){y(k instanceof Error?k.message:"OAuth authorization failed.")}finally{p(!1)}},M=async()=>{p(!0),y(null);try{const k=await x0(a);u({...a,accessToken:k.accessToken,refreshToken:k.refreshToken??a.refreshToken}),y("Access token refreshed.")}catch(k){y(k instanceof Error?k.message:"OAuth token refresh failed.")}finally{p(!1)}};return o.jsxs("div",{className:"space-y-2",children:[o.jsxs("select",{"aria-label":c?`${c} OAuth grant type`:"OAuth grant type",className:i,value:x,onChange:k=>u({...a,grantType:k.target.value}),children:[o.jsx("option",{value:"accessToken",children:"Manual access token"}),o.jsx("option",{value:"authorizationCode",children:"Authorization Code + PKCE"}),o.jsx("option",{value:"clientCredentials",children:"Client Credentials"}),o.jsx("option",{value:"password",children:"Password grant (legacy)"}),o.jsx("option",{value:"implicit",children:"Implicit grant (legacy)"})]}),h&&o.jsx("input",{"aria-label":c?`${c} OAuth authorization URL`:"OAuth authorization URL",className:i,placeholder:"Authorization URL",value:a.authorizationUrl||"",onChange:k=>u({...a,authorizationUrl:k.target.value})}),S&&o.jsx("input",{"aria-label":c?`${c} OAuth token URL`:"OAuth token URL",className:i,placeholder:"Token URL",value:a.tokenUrl||"",onChange:k=>u({...a,tokenUrl:k.target.value})}),A&&o.jsx("input",{"aria-label":c?`${c} OAuth client ID`:"OAuth client ID",className:i,placeholder:"Client ID",value:a.clientId||"",onChange:k=>u({...a,clientId:k.target.value})}),(x==="authorizationCode"||x==="clientCredentials"||x==="password")&&o.jsx("input",{"aria-label":c?`${c} OAuth client secret`:"OAuth client secret",type:"password",autoComplete:"off",className:i,placeholder:x==="authorizationCode"?"Client secret (optional for PKCE/public clients)":"Client secret (optional)",value:a.clientSecret||"",onChange:k=>u({...a,clientSecret:k.target.value})}),S&&o.jsxs("select",{"aria-label":c?`${c} OAuth client authentication`:"OAuth client authentication",className:i,value:a.clientAuthentication||"body",onChange:k=>u({...a,clientAuthentication:k.target.value}),children:[o.jsx("option",{value:"body",children:"Send client credentials in body"}),o.jsx("option",{value:"basic",children:"Send as Basic Auth header"})]}),h&&o.jsx("input",{"aria-label":c?`${c} OAuth redirect URI`:"OAuth redirect URI",className:i,placeholder:"Redirect URI (defaults to this page)",value:a.redirectUri||"",onChange:k=>u({...a,redirectUri:k.target.value})}),A&&o.jsx("input",{"aria-label":c?`${c} OAuth scopes`:"OAuth scopes",className:i,placeholder:"Scopes separated by spaces",value:(a.scopes||[]).join(" "),onChange:k=>u({...a,scopes:v0(k.target.value)})}),x==="password"&&o.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[o.jsx("input",{"aria-label":c?`${c} OAuth username`:"OAuth username",className:i,placeholder:"Resource owner username",value:a.username||"",onChange:k=>u({...a,username:k.target.value})}),o.jsx("input",{"aria-label":c?`${c} OAuth password`:"OAuth password",type:"password",autoComplete:"off",className:i,placeholder:"Resource owner password",value:a.password||"",onChange:k=>u({...a,password:k.target.value})})]}),o.jsx("input",{"aria-label":c?`${c} OAuth access token`:"OAuth access token",type:"password",autoComplete:"off",className:i,placeholder:"Access token",value:a.accessToken,onChange:k=>u({...a,accessToken:k.target.value})}),x!=="accessToken"&&o.jsxs("div",{className:"flex flex-wrap gap-2",children:[o.jsx("button",{type:"button",disabled:f,onClick:C,className:"rounded-md border px-2.5 py-1.5 text-xs font-medium disabled:opacity-60",children:f?"Authorizing…":"Get access token"}),a.refreshToken&&a.tokenUrl&&o.jsx("button",{type:"button",disabled:f,onClick:M,className:"rounded-md border px-2.5 py-1.5 text-xs font-medium disabled:opacity-60",children:"Refresh access token"})]}),x!=="accessToken"&&o.jsx("p",{className:"text-[11px] opacity-70",children:"Authorization Code uses PKCE. Popup callbacks must return to this page origin; token endpoints must allow browser CORS. Client secrets entered here are browser-visible and should only be used when the OAuth provider permits it."}),g&&o.jsx("p",{role:"status",className:"text-xs",children:g})]})},sf=({auth:a,label:i,allowInherit:c=!1,onChange:u,theme:f})=>{const g=`w-full rounded-md border px-2 py-1.5 text-xs ${f==="dark"?"bg-gray-900 border-gray-700 text-gray-100":"bg-white border-gray-300 text-gray-900"}`;return o.jsxs("div",{className:"space-y-2",children:[o.jsxs("select",{"aria-label":`${i} authorization type`,className:g,value:a.type==="inherit"&&!c?"none":a.type,onChange:y=>u(b0(y.target.value)),children:[c&&o.jsx("option",{value:"inherit",children:"Inherit from parent"}),o.jsx("option",{value:"none",children:"No auth"}),o.jsx("option",{value:"bearer",children:"Bearer token"}),o.jsx("option",{value:"oauth2",children:"OAuth 2.0"}),o.jsx("option",{value:"basic",children:"Basic auth"}),o.jsx("option",{value:"apiKey",children:"API key"})]}),a.type==="bearer"&&o.jsx("input",{"aria-label":`${i} bearer token`,type:"password",autoComplete:"off",className:g,value:a.token,onChange:y=>u({type:"bearer",token:y.target.value})}),a.type==="oauth2"&&o.jsx(rf,{auth:a,fieldClass:g,label:i,onChange:u}),a.type==="basic"&&o.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[o.jsx("input",{"aria-label":`${i} basic username`,className:g,placeholder:"Username",value:a.username,onChange:y=>u({...a,username:y.target.value})}),o.jsx("input",{"aria-label":`${i} basic password`,type:"password",autoComplete:"off",className:g,placeholder:"Password",value:a.password,onChange:y=>u({...a,password:y.target.value})})]}),a.type==="apiKey"&&o.jsxs("div",{className:"space-y-2",children:[o.jsx("input",{"aria-label":`${i} API key name`,className:g,placeholder:"Key name",value:a.key,onChange:y=>u({...a,key:y.target.value})}),o.jsx("input",{"aria-label":`${i} API key value`,type:"password",autoComplete:"off",className:g,placeholder:"Value",value:a.value,onChange:y=>u({...a,value:y.target.value})}),o.jsxs("select",{"aria-label":`${i} API key location`,className:g,value:a.in,onChange:y=>u({...a,in:y.target.value}),children:[o.jsx("option",{value:"header",children:"Header"}),o.jsx("option",{value:"query",children:"Query"})]})]})]})},Ks=[{label:"get",kind:"method",signature:"get(key: string): string | undefined",documentation:"Read a variable by key."},{label:"has",kind:"method",signature:"has(key: string): boolean",documentation:"Check whether a variable is defined."},{label:"set",kind:"method",signature:"set(key: string, value: unknown): void",documentation:"Set a variable. Collection and environment stores persist the change in the workspace."},{label:"unset",kind:"method",signature:"unset(key: string): void",documentation:"Remove a variable by key."},{label:"replaceIn",kind:"method",signature:"replaceIn(value: string): string",documentation:"Replace {{variable}} placeholders using this variable scope."}],S0={flex:[{label:"request",kind:"property",documentation:"The mutable request draft available to pre-request and test scripts."},{label:"response",kind:"property",documentation:"The response from the executed request.",testsOnly:!0},{label:"environment",kind:"property",documentation:"Read and mutate variables in the active environment."},{label:"collection",kind:"property",documentation:"Read and mutate variables on the current collection."},{label:"variables",kind:"property",documentation:"Read and mutate the effective variables for this execution."},{label:"expect",kind:"function",signature:"expect(actual: unknown): FlexExpectation",documentation:"Create an assertion chain for a value."},{label:"test",kind:"function",signature:"test(name: string, callback: () => unknown | Promise<unknown>): void",documentation:"Register a post-response test.",testsOnly:!0}],"flex.request":[{label:"method",kind:"property",signature:"method: string",documentation:"Read or replace the HTTP method."},{label:"url",kind:"property",signature:"url: string",documentation:"Read or replace the request URL before variable resolution."},{label:"headers",kind:"property",documentation:"Mutable request-header helpers."},{label:"body",kind:"property",documentation:"Mutable raw request-body helpers."}],"flex.request.headers":[{label:"get",kind:"method",signature:"get(name: string): string | undefined",documentation:"Read a request header case-insensitively."},{label:"has",kind:"method",signature:"has(name: string): boolean",documentation:"Check whether a request header exists."},{label:"set",kind:"method",signature:"set(name: string, value: unknown): void",documentation:"Set or replace a request header."},{label:"upsert",kind:"method",signature:"upsert({ key, value }: { key: string; value: unknown }): void",documentation:"Set or replace a request header from a key/value object."},{label:"remove",kind:"method",signature:"remove(name: string): void",documentation:"Remove a request header case-insensitively."},{label:"toObject",kind:"method",signature:"toObject(): Record<string, string>",documentation:"Return enabled request headers as an object."}],"flex.request.body":[{label:"raw",kind:"property",signature:"raw: string",documentation:"Read or replace the raw request body."}],"flex.response":[{label:"code",kind:"property",signature:"code: number",documentation:"HTTP response status code.",testsOnly:!0},{label:"status",kind:"property",signature:"status: string",documentation:"HTTP response status text.",testsOnly:!0},{label:"responseTime",kind:"property",signature:"responseTime: number",documentation:"Measured response time in milliseconds.",testsOnly:!0},{label:"headers",kind:"property",documentation:"Read-only response-header helpers.",testsOnly:!0},{label:"text",kind:"method",signature:"text(): string",documentation:"Return the response body as text.",testsOnly:!0},{label:"json",kind:"method",signature:"json(): unknown",documentation:"Parse and return the response body as JSON.",testsOnly:!0}],"flex.response.headers":[{label:"get",kind:"method",signature:"get(name: string): string | undefined",documentation:"Read a response header case-insensitively.",testsOnly:!0},{label:"has",kind:"method",signature:"has(name: string): boolean",documentation:"Check whether a response header exists.",testsOnly:!0},{label:"toObject",kind:"method",signature:"toObject(): Record<string, string>",documentation:"Return response headers as an object.",testsOnly:!0}],"flex.environment":Ks,"flex.collection":Ks,"flex.variables":Ks.map(a=>({...a,documentation:a.label==="set"||a.label==="unset"?`${a.documentation} Local effective-variable changes apply only to the current request execution.`:a.documentation})),"flex.expect.to":[{label:"equal",kind:"method",signature:"equal(expected: unknown): void",documentation:"Assert strict equality with Object.is."},{label:"eql",kind:"method",signature:"eql(expected: unknown): void",documentation:"Assert deep structural equality."},{label:"include",kind:"method",signature:"include(expected: unknown): void",documentation:"Assert that a string or array contains the expected value."},{label:"match",kind:"method",signature:"match(pattern: RegExp): void",documentation:"Assert that a string matches a regular expression."},{label:"have",kind:"property",documentation:"Property assertions."},{label:"be",kind:"property",documentation:"Boolean, range, and membership assertions."}],"flex.expect.to.have":[{label:"property",kind:"method",signature:"property(name: string, expected?: unknown): void",documentation:"Assert that an object has a property, optionally with an expected value."}],"flex.expect.to.be":[{label:"above",kind:"method",signature:"above(expected: number): void",documentation:"Assert that a number is greater than expected."},{label:"below",kind:"method",signature:"below(expected: number): void",documentation:"Assert that a number is less than expected."},{label:"oneOf",kind:"method",signature:"oneOf(expected: unknown[]): void",documentation:"Assert deep equality with one value from a list."},{label:"ok",kind:"property",signature:"ok: true",documentation:"Assert that the value is truthy."},{label:"true",kind:"property",signature:"true: true",documentation:"Assert that the value is exactly true."},{label:"false",kind:"property",signature:"false: true",documentation:"Assert that the value is exactly false."}],console:[{label:"log",kind:"method",signature:"log(...values: unknown[]): void",documentation:"Write a line to the API Client script console."},{label:"info",kind:"method",signature:"info(...values: unknown[]): void",documentation:"Write an informational line to the API Client script console."},{label:"warn",kind:"method",signature:"warn(...values: unknown[]): void",documentation:"Write a warning line to the API Client script console."},{label:"error",kind:"method",signature:"error(...values: unknown[]): void",documentation:"Write an error line to the API Client script console."}]};function of(a,i){return[...S0[a]||[]].filter(c=>i==="tests"||!c.testsOnly).map(c=>({...c}))}function A0(a,i,c={}){const u=i.toLowerCase();return[...new Set(c[a]||[])].filter(Boolean).filter(f=>f.toLowerCase().startsWith(u)).sort((f,p)=>f.localeCompare(p)).map(f=>({label:f,kind:"variable",signature:f,documentation:`Known ${a==="variables"?"effective":a} variable.`}))}const j0=[{label:"flex",kind:"namespace",documentation:"FlexDoc request, response, variables, assertions, and test scripting API."},{label:"console",kind:"namespace",documentation:"Captured script console with log, info, warn, and error methods."}];function N0(a){const i=a.lastIndexOf("flex.expect(");if(i<0)return null;const c=a.slice(i),u=[[/\.to\.have\.([A-Za-z_$][\w$]*)?$/,"flex.expect.to.have"],[/\.to\.be\.([A-Za-z_$][\w$]*)?$/,"flex.expect.to.be"],[/\.to\.([A-Za-z_$][\w$]*)?$/,"flex.expect.to"]];for(const[f,p]of u){const g=c.match(f);if(g)return{path:p,prefix:g[1]||""}}return null}function w0(a){const i=a.match(/flex\.(environment|collection|variables)\.(?:get|has|set|unset)\(\s*['"]([^'"]*)$/);return i?{scope:i[1],prefix:i[2]||""}:null}function T0(a){const i=a.match(/(?:^|[^\w$])((?:flex|console)(?:\.[A-Za-z_$][\w$]*)*)\.([A-Za-z_$][\w$]*)?$/);return i?{path:i[1],prefix:i[2]||""}:null}function E0(a,i,c,u={},f=!1){const p=Math.max(0,Math.min(i,a.length)),g=a.slice(0,p),y=w0(g);if(y){const C=A0(y.scope,y.prefix,u);return C.length>0?{from:p-y.prefix.length,to:p,items:C}:null}const x=N0(g);if(x){const C=of(x.path,c).filter(M=>M.label.toLowerCase().startsWith(x.prefix.toLowerCase()));return C.length>0?{from:p-x.prefix.length,to:p,items:C}:null}const h=T0(g);if(h){const C=of(h.path,c).filter(M=>M.label.toLowerCase().startsWith(h.prefix.toLowerCase()));return C.length>0?{from:p-h.prefix.length,to:p,items:C}:null}const S=g.match(/([A-Za-z_$][\w$]*)$/)?.[1]||"";if(!f&&!S)return null;const A=j0.filter(C=>!S||C.label.startsWith(S));return!f&&A.length===0?null:A.length>0?{from:p-S.length,to:p,items:A.map(C=>({...C}))}:null}const cf=({ariaLabel:a,value:i,onChange:c,phase:u,theme:f="light",variableKeys:p={}})=>{const g=le.useRef(null),[y,x]=le.useState(null),[h,S]=le.useState(0),A=le.useMemo(()=>`api-client-script-completions-${a.toLowerCase().replace(/[^a-z0-9]+/g,"-")}`,[a]),C=f==="dark",M=(N,j,R=!1)=>{const Y=E0(N,j,u,p,R);x(Y),S(0)},k=N=>{if(!y)return;const j=`${i.slice(0,y.from)}${N.label}${i.slice(y.to)}`,R=y.from+N.label.length;c(j),x(null),requestAnimationFrame(()=>{const Y=g.current;Y&&(Y.focus(),Y.setSelectionRange(R,R))})},G=N=>{const j=N.currentTarget;if((N.ctrlKey||N.metaKey)&&N.code==="Space"){N.preventDefault(),M(i,j.selectionStart,!0);return}if(!(!y||y.items.length===0)){if(N.key==="ArrowDown"){N.preventDefault(),S(R=>(R+1)%y.items.length);return}if(N.key==="ArrowUp"){N.preventDefault(),S(R=>(R-1+y.items.length)%y.items.length);return}if(N.key==="Enter"||N.key==="Tab"){N.preventDefault(),k(y.items[h]);return}N.key==="Escape"&&(N.preventDefault(),x(null))}},U=y?.items[h],I=C?"w-full min-h-40 max-h-96 resize-y rounded-md border border-gray-700 bg-gray-900 px-3 py-2 font-mono text-xs text-gray-100 outline-none focus:border-blue-400 focus:ring-1 focus:ring-blue-400":"w-full min-h-40 max-h-96 resize-y rounded-md border border-gray-300 bg-white px-3 py-2 font-mono text-xs text-gray-900 outline-none focus:border-blue-600 focus:ring-1 focus:ring-blue-600",_=C?"absolute z-50 mt-1 w-full overflow-hidden rounded-md border border-gray-700 bg-gray-900 text-gray-100 shadow-xl":"absolute z-50 mt-1 w-full overflow-hidden rounded-md border border-gray-200 bg-white text-gray-900 shadow-xl";return o.jsxs("div",{className:"relative",children:[o.jsx("textarea",{ref:g,"aria-label":a,"aria-autocomplete":"list","aria-controls":y?A:void 0,"aria-expanded":!!y,"aria-activedescendant":y?`${A}-${h}`:void 0,className:I,"data-api-client-script-phase":u,"data-testid":`${a}-editor`,onBlur:()=>x(null),onChange:N=>{const j=N.target.value,R=N.target.selectionStart;c(j),M(j,R)},onKeyDown:G,spellCheck:!1,value:i}),y&&y.items.length>0&&o.jsxs("div",{className:_,children:[o.jsx("div",{id:A,role:"listbox",className:"max-h-52 overflow-y-auto py-1",children:y.items.map((N,j)=>o.jsxs("button",{"aria-selected":j===h,className:`flex w-full items-baseline gap-2 px-3 py-1.5 text-left text-xs ${j===h?C?"bg-blue-700 text-white":"bg-blue-50 text-gray-900":C?"hover:bg-gray-800":"hover:bg-gray-50"}`,id:`${A}-${j}`,onMouseDown:R=>{R.preventDefault(),k(N)},role:"option",type:"button",children:[o.jsx("span",{className:"font-mono font-semibold",children:N.label}),o.jsx("span",{className:`truncate ${j===h&&C?"text-blue-100":C?"text-gray-400":"text-gray-500"}`,children:N.signature||N.kind})]},`${N.kind}-${N.label}`))}),U&&o.jsxs("div",{className:`border-t px-3 py-2 text-[11px] ${C?"border-gray-700 text-gray-300":"border-gray-200 text-gray-600"}`,children:[U.signature&&o.jsx("div",{className:"mb-1 font-mono text-xs",children:U.signature}),o.jsx("div",{children:U.documentation})]})]}),o.jsxs("div",{className:`mt-1 text-[11px] ${C?"text-gray-400":"text-gray-500"}`,children:["IntelliSense: type ",o.jsx("code",{children:"flex."})," or press Ctrl+Space. Use ↑/↓ and Enter or Tab to complete. Known variable names are suggested inside variable helpers."]})]})};function uf(a){return(a||[]).filter(i=>i.enabled!==!1&&i.key.trim()!=="")}function C0(a,i){if(!i.length)return a;const c=a.indexOf("#"),u=c>=0?a.slice(0,c):a,f=c>=0?a.slice(c):"",p=i.map(({key:y,value:x})=>`${encodeURIComponent(y)}=${encodeURIComponent(x)}`).join("&"),g=u.includes("?")?u.endsWith("?")||u.endsWith("&")?"":"&":"?";return`${u}${g}${p}${f}`}function _0(a){const i=a.indexOf("#"),c=i>=0?a.slice(0,i):a,u=i>=0?a.slice(i):"",f=c.indexOf("?");if(f<0)return{url:a,query:[]};const p=[];return new URLSearchParams(c.slice(f+1)).forEach((y,x)=>p.push({key:x,value:y})),{url:`${c.slice(0,f)}${u}`,query:p}}function df(a,i){return a.find(([c])=>c.toLowerCase()===i.toLowerCase())?.[1]}function Gr(a,i,c){for(let u=a.length-1;u>=0;u-=1)a[u][0].toLowerCase()===i.toLowerCase()&&a.splice(u,1);a.push([i,c])}function O0(a){const i={};for(const[c,u]of a)i[c]=u;return i}function k0(a){const i=a.headerEntries;if(!Array.isArray(i))return Object.entries(a.headers||{});const c=[];for(const u of i){if(Array.isArray(u)&&u.length>=2){c.push([String(u[0]),String(u[1])]);continue}if(u&&typeof u=="object"&&"key"in u&&"value"in u){const f=u;f.enabled!==!1&&c.push([String(f.key),String(f.value)])}}return c.length||i.length===0?c:Object.entries(a.headers||{})}function R0(a){if(typeof globalThis.btoa=="function"){if(typeof TextEncoder>"u")throw new Error("Basic auth requires UTF-8 encoding support.");const c=new TextEncoder().encode(a);let u="";for(const f of c)u+=String.fromCharCode(f);return globalThis.btoa(u)}const i=globalThis.Buffer;if(i?.from)return i.from(a,"utf8").toString("base64");throw new Error("Basic auth requires a Base64 encoder in this runtime.")}function yt(a,i){return a===void 0||a===""?a:a.replace(/\{\{\s*([^{}]+?)\s*\}\}/g,(c,u)=>{const f=u.trim();return Object.prototype.hasOwnProperty.call(i,f)?i[f]:c})}function q0(a,i){if(!a||a.type==="none"||a.type==="inherit")return a;if(a.type==="bearer")return{type:"bearer",token:yt(a.token,i)||""};if(a.type==="oauth2"){const c={...a,accessToken:yt(a.accessToken,i)||""};return a.authorizationUrl!==void 0&&(c.authorizationUrl=yt(a.authorizationUrl,i)),a.tokenUrl!==void 0&&(c.tokenUrl=yt(a.tokenUrl,i)),a.clientId!==void 0&&(c.clientId=yt(a.clientId,i)),a.clientSecret!==void 0&&(c.clientSecret=yt(a.clientSecret,i)),a.redirectUri!==void 0&&(c.redirectUri=yt(a.redirectUri,i)),a.scopes!==void 0&&(c.scopes=a.scopes.map(u=>yt(u,i)||"")),a.username!==void 0&&(c.username=yt(a.username,i)),a.password!==void 0&&(c.password=yt(a.password,i)),a.refreshToken!==void 0&&(c.refreshToken=yt(a.refreshToken,i)),c}return a.type==="basic"?{type:"basic",username:yt(a.username,i)||"",password:yt(a.password,i)||""}:{type:"apiKey",key:yt(a.key,i)||"",value:yt(a.value,i)||"",in:a.in}}function M0(a,i){return{method:yt(a.method,i)??a.method,url:yt(a.url,i)??a.url,query:a.query?.map(c=>({...c,key:yt(c.key,i)||"",value:yt(c.value,i)||""})),headers:a.headers?.map(c=>({...c,key:yt(c.key,i)||"",value:yt(c.value,i)||""})),body:yt(a.body,i),contentType:yt(a.contentType,i),auth:q0(a.auth,i)}}function z0(a,i,c){const u=a.auth;if(!(!u||u.type==="none"||u.type==="inherit")){if(u.type==="bearer"){u.token&&Gr(i,"Authorization",`Bearer ${u.token}`);return}if(u.type==="oauth2"){u.accessToken&&Gr(i,"Authorization",`Bearer ${u.accessToken}`);return}if(u.type==="basic"){(u.username||u.password)&&Gr(i,"Authorization",`Basic ${R0(`${u.username}:${u.password}`)}`);return}u.key&&(u.in==="query"?c.push({key:u.key,value:u.value}):Gr(i,u.key,u.value))}}function $0(a,i={}){const c=i.variables?M0(a,i.variables):a,u=(c.method||"GET").trim().toUpperCase(),f=c.url.trim();if(!f)throw new Error("Request URL is required.");const p=uf(c.query),g=uf(c.headers).map(({key:C,value:M})=>[C,M]);z0(c,g,p);let y,x,h;if(c.body&&!["GET","HEAD"].includes(u)){y=c.body,h=c.body;const C=df(g,"Content-Type"),M=c.contentType?.trim();!C&&M&&g.push(["Content-Type",M]);const k=C||M;x=k?.includes("json")?"json":k==="application/x-www-form-urlencoded"?"form":k?.startsWith("multipart/form-data")?"multipart":"text"}const S=O0(g);return{url:C0(f,p),method:u,headers:S,headerEntries:g,body:y,bodyKind:x,init:{method:u,headers:g,body:h}}}function D0(a){const i=k0(a),c=_0(a.url);return{method:a.method,url:c.url,query:c.query,headers:i.map(([u,f])=>({key:u,value:f})),body:a.body,contentType:df(i,"Content-Type"),auth:{type:"none"}}}function ff(a,i={}){return $0(a,i)}function U0(a){return D0(a)}function pf(a){const i=a.auth?a.auth.type==="oauth2"?{...a.auth,scopes:a.auth.scopes?[...a.auth.scopes]:void 0}:{...a.auth}:void 0;return{...a,query:a.query?.map(c=>({...c})),headers:a.headers?.map(c=>({...c})),auth:i}}function Ir(a){return Object.assign(Object.create(null),a||{})}function H0(a){return a instanceof Error?a.message:"Request failed"}async function mf(a){const i=pf(a.request),c=sn(a.scripts),u=a.fetcher||globalThis.fetch,f=a.now||Date.now;let p=pf(a.request),g=Ir(a.variables),y=Ir(a.collectionVariables);const x=Ir(a.externalVariables);let h=Ir(a.environmentVariables),S=[],A=[],C,M="",k="",G=0,U=!1;try{if(c.preRequest.trim()){const xe=await Bd({script:c.preRequest,phase:"pre-request",draft:p,variables:g,collectionVariables:y,externalVariables:x,environmentVariables:h});if(p=xe.draft,g=xe.variables,y=xe.collectionVariables,h=xe.environmentVariables,S=[...S,...xe.logs],xe.collectionChanges.length>0&&a.onCollectionChanges?.(xe.collectionChanges),xe.environmentChanges.length>0&&a.onEnvironmentChanges?.(xe.environmentChanges),xe.error)return{scriptTests:A,scriptLogs:S,scriptError:`Pre-request script: ${xe.error}`}}a.resolveAuth&&(p={...p,auth:a.resolveAuth(p.auth)});const I=ff(p,{variables:g});M=I.method,k=I.url,a.onRequestBuilt?.(I);let _={...I.init,url:I.url,credentials:a.credentials||"same-origin",...a.signal?{signal:a.signal}:{}};a.requestInterceptor&&(_=await a.requestInterceptor(_)),a.signal&&(_.signal=a.signal);const{url:N,...j}=_;if(k=N,G=f(),U=!0,!u)throw new Error("Fetch API is not available");const R=await u(N,j),Y=await R.text(),D=f()-G,X=[...R.headers.entries()];if(c.tests.trim()){const xe=await Bd({script:c.tests,phase:"tests",draft:p,variables:g,collectionVariables:y,externalVariables:x,environmentVariables:h,response:{status:R.status,statusText:R.statusText,headers:X,body:Y,responseTime:D}});S=[...S,...xe.logs],A=xe.tests.map(ge=>({...ge})),xe.collectionChanges.length>0&&a.onCollectionChanges?.(xe.collectionChanges),xe.environmentChanges.length>0&&a.onEnvironmentChanges?.(xe.environmentChanges),xe.error&&(C=`Test script: ${xe.error}`)}return{result:{request:i,scripts:c,executedMethod:M,resolvedUrl:k,status:R.status,statusText:R.statusText,responseTime:D,responseHeaders:X.map(([xe,ge])=>[xe,ge]),responseBody:Y,...A.length?{scriptTests:A}:{},...S.length?{scriptLogs:[...S]}:{},...C?{scriptError:C}:{}},response:{status:R.status,statusText:R.statusText,headers:X,body:Y,responseTime:D},scriptTests:A,scriptLogs:S,...C?{scriptError:C}:{}}}catch(I){const _=H0(I),N={error:_,scriptTests:A,scriptLogs:S};return U&&(N.result={request:i,scripts:c,executedMethod:M,resolvedUrl:k,responseTime:G?f()-G:void 0,error:_,...S.length?{scriptLogs:[...S]}:{}}),N}}function Js(a){let i=a.url;for(const[c,u]of Object.entries(a.variables||{}))i=i.split(`{${c}}`).join(u.default);return i}function Ws(a){return a.replace(/\/+$/,"")}function hf(a,i){const c=Ws(i);return c?a===c||a.startsWith(`${c}/`)||a.startsWith(`${c}?`):!1}function L0(a,i,c){const u=Ws(c);if(!u)return a;const f=Ws(i);if(f&&hf(a,f))return`${u}${a.slice(f.length)}`;try{const p=new URL(a),g=`${p.pathname==="/"?"":p.pathname}${p.search}${p.hash}`;return`${u}${g}`}catch{return u}}const Ps=()=>({key:"",value:"",enabled:!0});function B0(a){return{method:a?.method||"GET",url:a?.url||"",query:a?.query?.length?a.query:[Ps()],headers:a?.headers?.length?a.headers:[Ps()],body:a?.body||"",contentType:a?.contentType||"application/json",auth:a?.auth||{type:"none"}}}function Y0(a){const i=a.auth?a.auth.type==="oauth2"?{...a.auth,scopes:a.auth.scopes?[...a.auth.scopes]:void 0}:{...a.auth}:void 0;return{...a,query:a.query?.map(c=>({...c})),headers:a.headers?.map(c=>({...c})),auth:i}}function G0(a){try{return new URL(a).origin}catch{return""}}function yf({label:a,entries:i,onChange:c,inputClass:u}){const f=(p,g)=>c(i.map((y,x)=>x===p?{...y,...g}:y));return o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("span",{className:"text-sm font-medium",children:a}),o.jsxs("button",{type:"button",className:"inline-flex min-h-11 items-center justify-center gap-2 rounded-md border px-3 py-2 text-sm",onClick:()=>c([...i,Ps()]),children:[o.jsx(Ba,{className:"h-4 w-4"})," Add"]})]}),i.map((p,g)=>o.jsxs("div",{className:"flex gap-2",children:[o.jsx("input",{"aria-label":`${a} ${g+1} enabled`,type:"checkbox",checked:p.enabled!==!1,onChange:y=>f(g,{enabled:y.target.checked})}),o.jsx("input",{"aria-label":`${a} ${g+1} key`,className:`w-full rounded-md border px-3 py-2 text-sm ${u}`,placeholder:"Key",value:p.key,onChange:y=>f(g,{key:y.target.value})}),o.jsx("input",{"aria-label":`${a} ${g+1} value`,className:`w-full rounded-md border px-3 py-2 text-sm ${u}`,placeholder:"Value",value:p.value,onChange:y=>f(g,{value:y.target.value})}),o.jsx("button",{type:"button","aria-label":`Remove ${a.toLowerCase()} ${g+1}`,className:"inline-flex min-h-11 items-center justify-center rounded-md border px-3 py-2",onClick:()=>c(i.filter((y,x)=>x!==g)),children:o.jsx(Cn,{className:"h-4 w-4"})})]},g))]})}const I0=({initialRequest:a,initialScripts:i,theme:c="light",credentials:u="same-origin",requestInterceptor:f,onRequestChange:p,onDraftChange:g,onScriptsChange:y,onExecutionStart:x,onExecutionComplete:h,resolveAuth:S,variables:A={},collectionVariables:C={},externalVariables:M={},environmentVariables:k={},onCollectionChanges:G,onEnvironmentChanges:U,serverOptions:I=[],initialServerUrl:_})=>{const N=B0(a),j=sn(i),R=I.map(se=>({server:se,url:Js(se)})),Y=R.map(se=>se.url),D=_||Y.find(se=>hf(N.url,se))||"",X=Y.includes(D)?D:Y[0]||"",me=D&&!Y.includes(D)?D:"",xe=D||X||G0(N.url),[ge,Ee]=le.useState(N),[He,he]=le.useState(j),[ke,T]=le.useState(X),[ne,W]=le.useState(me),K=le.useRef(xe),P=le.useRef(xe),[w,$]=le.useState(null),[ce,pe]=le.useState(null),[ve,Te]=le.useState(null),[Re,Ve]=le.useState([]),[Ie,Be]=le.useState([]),[Z,be]=le.useState(!1),Se=le.useRef(p),Ne=le.useRef(g),Je=le.useRef(y),at=le.useRef(null);le.useEffect(()=>{Se.current=p},[p]),le.useEffect(()=>{Ne.current=g},[g]),le.useEffect(()=>{Je.current=y},[y]),le.useEffect(()=>{Ne.current?.(Y0(ge))},[ge]),le.useEffect(()=>{Je.current?.(sn(He))},[He]),le.useEffect(()=>{try{const se=S?{...ge,auth:S(ge.auth)}:ge,Ae=ff(se,{variables:A}),De=JSON.stringify([Ae.method,Ae.url,Ae.headerEntries,Ae.body,Ae.bodyKind]);if(De===at.current)return;at.current=De,Se.current?.(Ae)}catch{}},[ge,S,A]);const ft=(ge.method||"GET").toUpperCase(),dt=c==="dark"?"bg-gray-900 border-gray-700 text-gray-100":"bg-white border-gray-300 text-gray-900",un=c==="dark"?"border-gray-700 bg-gray-800/60 text-gray-100":"border-gray-200 bg-gray-50 text-gray-900",Yt=c==="dark"?"text-gray-400":"text-gray-600",It=se=>{if(!se)return;const Ae=K.current;K.current=se,Ee(De=>({...De,url:L0(De.url,Ae,se)}))},kn=se=>{const Ae=se==="inherit"?{type:"inherit"}:se==="bearer"?{type:se,token:""}:se==="oauth2"?{type:se,accessToken:""}:se==="basic"?{type:se,username:"",password:""}:se==="apiKey"?{type:se,key:"",value:"",in:"header"}:{type:"none"};Ee(De=>({...De,auth:Ae}))},Rn=async()=>{x?.(),be(!0),pe(null),Te(null),Ve([]),Be([]),$(null);try{const se=await mf({request:ge,scripts:He,credentials:u,requestInterceptor:f,resolveAuth:S,variables:A,collectionVariables:C,externalVariables:M,environmentVariables:k,onRequestBuilt:Ae=>Se.current?.(Ae),onCollectionChanges:G,onEnvironmentChanges:U});pe(se.error||null),Te(se.scriptError||null),Ve(se.scriptTests),Be(se.scriptLogs),se.response&&$({status:se.response.status,statusText:se.response.statusText,headers:se.response.headers.map(([Ae,De])=>`${Ae}: ${De}`).join(`
|
|
49
|
-
`),body:se.response.body}),se.result&&h?.(se.result)}finally{be(!1)}},_e=Re.filter(se=>se.passed).length;return o.jsx("div",{className:`rounded-xl border p-4 md:p-5 ${un}`,children:o.jsxs("div",{className:"flex flex-col gap-4",children:[o.jsxs("div",{className:"grid gap-2 sm:grid-cols-2",children:[I.length>0&&o.jsxs("label",{className:"text-sm font-medium",children:["Server",o.jsx("select",{"aria-label":"API Client server",className:`mt-1 w-full rounded-md border px-3 py-2 text-sm ${dt}`,value:ke,onChange:se=>{T(se.target.value),W(""),It(se.target.value)},children:R.map(({server:se,url:Ae})=>o.jsxs("option",{value:Ae,children:[se.description?`${se.description} — `:"",se.url]},`${se.url}:${Ae}`))})]}),o.jsxs("label",{className:"text-sm font-medium",children:["Custom server URL ",o.jsx("span",{className:"text-xs font-normal opacity-70",children:"(optional override)"}),o.jsx("input",{"aria-label":"API Client custom server URL",className:`mt-1 w-full rounded-md border px-3 py-2 font-mono text-sm ${dt}`,value:ne,onChange:se=>{const Ae=se.target.value;W(Ae);const De=ke||P.current;(Ae.trim()||De)&&It(Ae.trim()||De)},placeholder:"http://localhost:8080"})]})]}),o.jsxs("div",{className:"flex gap-2",children:[o.jsx("select",{"aria-label":"HTTP method",className:`rounded-md border px-3 py-2 font-medium ${dt}`,value:ft,onChange:se=>{const Ae=se.target.value;Ee(De=>({...De,method:Ae}))},children:["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"].map(se=>o.jsx("option",{children:se},se))}),o.jsx("input",{"aria-label":"Request URL",className:`w-full rounded-md border px-3 py-2 font-mono text-sm ${dt}`,placeholder:"https://api.example.com/resource or {{baseUrl}}/resource",value:ge.url,onChange:se=>{const Ae=se.target.value;Ee(De=>({...De,url:Ae}))}})]}),o.jsx(yf,{label:"Query parameters",entries:ge.query||[],onChange:se=>Ee(Ae=>({...Ae,query:se})),inputClass:dt}),o.jsx(yf,{label:"Headers",entries:ge.headers||[],onChange:se=>Ee(Ae=>({...Ae,headers:se})),inputClass:dt}),o.jsxs("div",{className:"space-y-3",children:[o.jsxs("label",{className:"text-sm font-medium",children:["Authorization",o.jsxs("select",{"aria-label":"Authorization type",className:`rounded-md border px-3 py-2 text-sm ${dt}`,value:ge.auth?.type||"none",onChange:se=>kn(se.target.value),children:[S&&o.jsx("option",{value:"inherit",children:"Inherit from parent"}),o.jsx("option",{value:"none",children:"None"}),o.jsx("option",{value:"bearer",children:"Bearer token"}),o.jsx("option",{value:"oauth2",children:"OAuth 2.0 access token"}),o.jsx("option",{value:"basic",children:"Basic auth"}),o.jsx("option",{value:"apiKey",children:"API key"})]})]}),ge.auth?.type==="bearer"&&o.jsx("input",{"aria-label":"Bearer token",type:"password",autoComplete:"off",className:`w-full rounded-md border px-3 py-2 ${dt}`,value:ge.auth.token,onChange:se=>{const Ae=se.target.value;Ee(De=>({...De,auth:{type:"bearer",token:Ae}}))}}),ge.auth?.type==="oauth2"&&o.jsx(rf,{auth:ge.auth,fieldClass:`w-full rounded-md border px-3 py-2 text-sm ${dt}`,label:"",onChange:se=>Ee(Ae=>({...Ae,auth:se}))}),ge.auth?.type==="basic"&&o.jsxs("div",{className:"flex gap-2",children:[o.jsx("input",{"aria-label":"Basic auth username",className:`w-full rounded-md border px-3 py-2 ${dt}`,placeholder:"Username",value:ge.auth.username,onChange:se=>{const Ae=se.target.value;Ee(De=>({...De,auth:{...De.auth,type:"basic",username:Ae}}))}}),o.jsx("input",{"aria-label":"Basic auth password",type:"password",autoComplete:"off",className:`w-full rounded-md border px-3 py-2 ${dt}`,placeholder:"Password",value:ge.auth.password,onChange:se=>{const Ae=se.target.value;Ee(De=>({...De,auth:{...De.auth,type:"basic",password:Ae}}))}})]}),ge.auth?.type==="apiKey"&&o.jsxs("div",{className:"flex gap-2",children:[o.jsx("input",{"aria-label":"API key name",className:`w-full rounded-md border px-3 py-2 ${dt}`,placeholder:"Key name",value:ge.auth.key,onChange:se=>{const Ae=se.target.value;Ee(De=>({...De,auth:{...De.auth,type:"apiKey",key:Ae}}))}}),o.jsx("input",{"aria-label":"API key value",type:"password",autoComplete:"off",className:`w-full rounded-md border px-3 py-2 ${dt}`,placeholder:"Value",value:ge.auth.value,onChange:se=>{const Ae=se.target.value;Ee(De=>({...De,auth:{...De.auth,type:"apiKey",value:Ae}}))}}),o.jsxs("select",{"aria-label":"API key location",className:`rounded-md border px-3 py-2 text-sm ${dt}`,value:ge.auth.in,onChange:se=>{const Ae=se.target.value;Ee(De=>({...De,auth:{...De.auth,type:"apiKey",in:Ae}}))},children:[o.jsx("option",{value:"header",children:"Header"}),o.jsx("option",{value:"query",children:"Query"})]})]})]}),!["GET","HEAD"].includes(ft)&&o.jsxs("div",{className:"space-y-3",children:[o.jsxs("label",{className:"text-sm font-medium",children:["Content type",o.jsx("input",{"aria-label":"Content type",className:`w-full rounded-md border px-3 py-2 ${dt}`,value:ge.contentType||"",onChange:se=>{const Ae=se.target.value;Ee(De=>({...De,contentType:Ae}))}})]}),o.jsxs("label",{className:"text-sm font-medium",children:["Request body",o.jsx("textarea",{"aria-label":"Request body",rows:8,className:`w-full rounded-md border px-3 py-2 font-mono text-sm ${dt}`,value:ge.body||"",onChange:se=>{const Ae=se.target.value;Ee(De=>({...De,body:Ae}))}})]})]}),o.jsxs("section",{className:"space-y-3 border-t pt-4","aria-labelledby":"api-client-scripts-heading",children:[o.jsxs("div",{children:[o.jsx("h3",{id:"api-client-scripts-heading",className:"font-semibold",children:"Scripts"}),o.jsx("p",{className:`text-xs ${Yt}`,children:"Trusted local JavaScript. Scripts are not sandboxed; only run code you trust."})]}),o.jsxs("div",{className:"grid gap-3 xl:grid-cols-2",children:[o.jsxs("label",{className:"text-sm font-medium",children:["Pre-request script",o.jsx("div",{className:"mt-1",children:o.jsx(cf,{ariaLabel:"Pre-request script",phase:"pre-request",theme:c,value:He.preRequest,onChange:se=>he(Ae=>({...Ae,preRequest:se})),variableKeys:{environment:Object.keys(k),collection:Object.keys(C),variables:Object.keys(A)}})})]}),o.jsxs("label",{className:"text-sm font-medium",children:["Tests",o.jsx("div",{className:"mt-1",children:o.jsx(cf,{ariaLabel:"Tests script",phase:"tests",theme:c,value:He.tests,onChange:se=>he(Ae=>({...Ae,tests:se})),variableKeys:{environment:Object.keys(k),collection:Object.keys(C),variables:Object.keys(A)}})})]})]})]}),o.jsxs("button",{onClick:Rn,disabled:Z,className:"inline-flex min-h-11 items-center justify-center gap-2 rounded-md bg-blue-600 px-4 py-2 font-medium text-white hover:bg-blue-700 disabled:opacity-60",children:[Z?o.jsx(xs,{className:"h-4 w-4 animate-spin"}):o.jsx(Jl,{className:"h-4 w-4"})," ",Z?"Sending…":"Send request"]}),ce&&o.jsxs("div",{role:"alert",className:"flex gap-2 rounded-md border border-red-300 bg-red-50 p-3 text-sm text-red-700",children:[o.jsx($r,{className:"mt-0.5 h-4 w-4 shrink-0"}),ce]}),ve&&o.jsxs("div",{role:"alert",className:"flex gap-2 rounded-md border border-amber-300 bg-amber-50 p-3 text-sm text-amber-800",children:[o.jsx($r,{className:"mt-0.5 h-4 w-4 shrink-0"}),ve]}),w&&o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{className:"font-semibold",children:["Response ",o.jsxs("span",{className:w.status>=400?"text-red-600":"text-green-600",children:[w.status," ",w.statusText]})]}),w.headers&&o.jsx(On,{code:w.headers,language:"text",title:"Headers",theme:c,wrap:!0}),o.jsx(On,{code:w.body||"(empty response)",language:"json",title:"Body",theme:c,wrap:!0})]}),Re.length>0&&o.jsxs("section",{className:"space-y-2","aria-labelledby":"api-client-test-results-heading",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("h3",{id:"api-client-test-results-heading",className:"font-semibold",children:"Test results"}),o.jsxs("span",{className:`text-xs ${Yt}`,children:[_e,"/",Re.length," passed"]})]}),o.jsx("div",{className:"space-y-2",children:Re.map((se,Ae)=>o.jsxs("div",{className:`rounded-md border px-3 py-2 text-sm ${se.passed?"border-green-300 bg-green-50 text-green-800":"border-red-300 bg-red-50 text-red-800"}`,children:[o.jsxs("div",{className:"font-medium",children:[se.passed?"PASS":"FAIL"," — ",se.name]}),se.error&&o.jsx("div",{className:"mt-1 text-xs",children:se.error})]},`${se.name}:${Ae}`))})]}),Ie.length>0&&o.jsx(On,{code:Ie.join(`
|
|
50
|
-
`),language:"text",title:"Script console",theme:c,wrap:!0})]})})};function F0(a,i,c){if(!c)return null;const u=a.folders.find(g=>g.id===c&&g.collectionId===i);if(!u)return new Set;const f=new Set([u.id]);let p=!0;for(;p;){p=!1;for(const g of a.folders)g.collectionId!==i||!g.parentFolderId||f.has(g.id)||f.has(g.parentFolderId)&&(f.add(g.id),p=!0)}return f}function Fr(a,i,c){const u=F0(a,i,c);return a.requests.filter(f=>f.collectionId!==i?!1:u?!!f.folderId&&u.has(f.folderId):!0)}function V0(a,i){const c=new Map(a.map(g=>[g.id,g])),u=[],f=new Set;let p=c.get(i);for(;p&&!f.has(p.id);)f.add(p.id),u.unshift(p.name),p=p.parentFolderId?c.get(p.parentFolderId):void 0;return u.join(" / ")}function gf(a,i,c){const u=a.collections.find(p=>p.id===i)?.name||"Deleted collection";if(!c)return u;const f=V0(a.folders.filter(p=>p.collectionId===i),c);return f?`${u} / ${f}`:`${u} / Deleted folder`}function X0(a){return!a.error&&!a.scriptError&&a.scriptTests.every(i=>i.passed)}async function Z0(a){const i=Fr(a.workspace,a.collectionId,a.folderId),c=a.runId||Ht("run"),u=a.runName||gf(a.workspace,a.collectionId,a.folderId);let f=a.workspace;const p=[];let g=a.signal?.aborted===!0;for(let S=0;S<i.length&&!g;S+=1){if(a.signal?.aborted){g=!0;break}const A=i[S];a.onRequestStart?.(A,S,i.length);const C=Jd(f,a.collectionId),M=Wd(f),k={...a.externalEnvironmentVariables||{},...M},G={...C,...a.externalVariables||{},...k},U=await mf({request:A.request,scripts:A.scripts,credentials:a.credentials,requestInterceptor:a.requestInterceptor,resolveAuth:R=>Kd(f,A.collectionId,A.folderId,R||{type:"none"}),variables:G,collectionVariables:C,externalVariables:a.externalVariables,environmentVariables:k,signal:a.signal,fetcher:a.fetcher,now:a.now,onCollectionChanges:R=>{f=ef(f,A.collectionId,R),a.onCollectionChanges?.(R)},onEnvironmentChanges:R=>{f=Pd(f,R),a.onEnvironmentChanges?.(R)}}),I=a.signal?.aborted===!0,_=!I&&X0(U);let N;U.result&&!I&&(f=Qd(f,{...U.result,collectionId:A.collectionId,folderId:A.folderId,runId:c,runName:u,runIndex:S+1,runTotal:i.length,runPassed:_}),N=f.history[0]?.id);const j={requestId:A.id,requestName:A.name,collectionId:A.collectionId,folderId:A.folderId,passed:_,cancelled:I,historyEntryId:N,outcome:U};if(p.push(j),a.onRequestComplete?.(j,S,i.length),I){g=!0;break}if(!j.passed&&a.stopOnFailure&&S<i.length-1){g=!0;break}}const y=p.filter(S=>S.passed).length,x=p.filter(S=>S.cancelled).length,h=p.filter(S=>!S.passed&&!S.cancelled).length;return{runId:c,runName:u,collectionId:a.collectionId,folderId:a.folderId,total:i.length,completed:p.length,passed:y,failed:h,cancelled:x,stopped:g,items:p,workspace:f}}function il(){return new Date().toISOString()}const Q0=({request:a,scripts:i,onLoadRequest:c,onSelectedCollectionChange:u,onSelectedFolderChange:f,onRunCollection:p,onRunFolder:g,selectedCollectionId:y,selectedFolderId:x="",workspace:h,onWorkspaceChange:S,theme:A})=>{const[C,M]=le.useState(""),[k,G]=le.useState(""),[U,I]=le.useState(""),[_,N]=le.useState(null),j=h.collections.find(Z=>Z.id===y)||h.collections[0],R=le.useMemo(()=>h.folders.filter(Z=>Z.collectionId===j?.id),[j?.id,h.folders]),Y=le.useMemo(()=>h.requests.filter(Z=>Z.collectionId===j?.id),[j?.id,h.requests]),D=R.find(Z=>Z.id===x),X=le.useMemo(()=>new Map(R.map(Z=>[Z.id,Z])),[R]),me=le.useMemo(()=>{const Z=[],be=new Set,Se=(Ne,Je)=>{R.filter(at=>at.parentFolderId===Ne).forEach(at=>{be.has(at.id)||(be.add(at.id),Z.push({folder:at,depth:Je}),Se(at.id,Je+1))})};return Se(void 0,0),R.forEach(Ne=>{be.has(Ne.id)||(be.add(Ne.id),Z.push({folder:Ne,depth:0}),Se(Ne.id,1))}),Z},[R]),xe=Z=>{const be=[],Se=new Set;let Ne=X.get(Z);for(;Ne&&!Se.has(Ne.id);)Se.add(Ne.id),be.unshift(Ne.name),Ne=Ne.parentFolderId?X.get(Ne.parentFolderId):void 0;return be.join(" / ")};le.useEffect(()=>{u?.(j?.id)},[u,j?.id]);const ge=()=>{const Z=C.trim();if(!Z)return;const be=il(),Se=Ht("collection");S(Ne=>({...Ne,collections:[...Ne.collections,{id:Se,name:Z,auth:{type:"none"},variables:[],createdAt:be,updatedAt:be}]})),u?.(Se),f?.(""),M(""),N(null)},Ee=Z=>{if(!j)return;const be=il();S(Se=>({...Se,collections:Se.collections.map(Ne=>Ne.id===j.id?{...Ne,auth:Z,updatedAt:be}:Ne)}))},He=Z=>{if(!D)return;const be=il();S(Se=>({...Se,folders:Se.folders.map(Ne=>Ne.id===D.id?{...Ne,auth:Z,updatedAt:be}:Ne)}))},he=()=>{if(!j)return;const Z=il();S(be=>({...be,collections:be.collections.map(Se=>Se.id===j.id?{...Se,variables:[...Se.variables,{id:Ht("variable"),key:"",value:"",enabled:!0}],updatedAt:Z}:Se)}))},ke=(Z,be)=>{if(!j)return;const Se=il();S(Ne=>({...Ne,collections:Ne.collections.map(Je=>Je.id===j.id?{...Je,variables:Je.variables.map(at=>at.id===Z?{...at,...be}:at),updatedAt:Se}:Je)}))},T=Z=>{if(!j)return;const be=il();S(Se=>({...Se,collections:Se.collections.map(Ne=>Ne.id===j.id?{...Ne,variables:Ne.variables.filter(Je=>Je.id!==Z),updatedAt:be}:Ne)}))},ne=()=>{const Z=k.trim();if(!Z||!j)return;const be=il(),Se=Ht("folder");S(Ne=>({...Ne,folders:[...Ne.folders,{id:Se,collectionId:j.id,parentFolderId:x||void 0,name:Z,auth:{type:"inherit"},createdAt:be,updatedAt:be}]})),f?.(Se),G("")},W=()=>{if(!j)return;const Z=U.trim()||a.url||"Untitled request",be=il();if(_){S(Ne=>({...Ne,requests:Ne.requests.map(Je=>Je.id===_?{...Je,collectionId:j.id,folderId:x||void 0,name:Z,request:Dn(a),scripts:sn(i),updatedAt:be}:Je)}));return}const Se={id:Ht("request"),collectionId:j.id,folderId:x||void 0,name:Z,request:Dn(a),scripts:sn(i),createdAt:be,updatedAt:be};S(Ne=>({...Ne,requests:[...Ne.requests,Se]})),N(Se.id),I(Z)},K=Z=>{const be=h.requests.find(Se=>Se.id===Z);be&&(N(be.id),u?.(be.collectionId),f?.(be.folderId||""),I(be.name),c(Dn(be.request),be.scripts?sn(be.scripts):void 0,be.collectionId,be.folderId))},P=Z=>{S(be=>({...be,requests:be.requests.filter(Se=>Se.id!==Z)})),_===Z&&(N(null),I(""))},w=Z=>{const be=h.folders.find(Se=>Se.id===Z);S(Se=>s0(Se,Z)),x===Z&&f?.(be?.parentFolderId||"")},$=Z=>{const be=o0(h,Z);S(be),y===Z&&(u?.(be.collections[0]?.id||""),f?.(""),N(null),I(""))},ce=A==="dark"?"bg-gray-900 border-gray-700 text-gray-100":"bg-white border-gray-300 text-gray-900",pe=A==="dark"?"text-gray-400":"text-gray-500",ve=A==="dark"?"bg-blue-500/10 text-blue-300":"bg-blue-500/10 text-blue-700",Te=Z=>o.jsxs("div",{className:`group flex items-center gap-1 rounded-md ${_===Z.id?"bg-blue-500/10":""}`,children:[o.jsxs("button",{type:"button",className:"min-w-0 flex-1 rounded-md px-2 py-2 text-left text-sm hover:bg-blue-500/10","aria-label":`Load saved request ${Z.name}`,onClick:()=>K(Z.id),children:[o.jsx("span",{className:"mr-2 font-mono text-xs font-semibold text-blue-600",children:Z.request.method.toUpperCase()}),o.jsx("span",{className:"truncate",children:Z.name})]}),o.jsx("button",{type:"button",className:"rounded-md p-2 opacity-70 hover:opacity-100","aria-label":`Delete saved request ${Z.name}`,onClick:()=>P(Z.id),children:o.jsx(Cn,{className:"h-4 w-4"})})]},Z.id),Re=(Z,be,Se=new Set)=>{if(Se.has(Z.id))return null;const Ne=new Set(Se);Ne.add(Z.id);const Je=xe(Z.id),at=R.filter(ft=>ft.parentFolderId===Z.id);return o.jsxs(ms.Fragment,{children:[o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx("button",{type:"button","aria-label":`Select folder ${Je}`,className:`min-w-0 flex-1 rounded-md py-2 pr-2 text-left text-sm ${x===Z.id?"bg-blue-500/10":""}`,style:{paddingLeft:`${8+be*16}px`},onClick:()=>f?.(Z.id),children:Z.name}),o.jsx("button",{type:"button",disabled:Fr(h,Z.collectionId,Z.id).length===0,"aria-label":`Run folder ${Je}`,className:"rounded-md p-2 opacity-70 hover:opacity-100 disabled:cursor-not-allowed disabled:opacity-30",onClick:()=>g?.(Z.collectionId,Z.id),children:o.jsx(Jl,{className:"h-4 w-4"})}),o.jsx("button",{type:"button","aria-label":`Delete folder ${Je}`,className:"rounded-md p-2 opacity-70 hover:opacity-100",onClick:()=>w(Z.id),children:o.jsx(Cn,{className:"h-4 w-4"})})]}),at.map(ft=>Re(ft,be+1,Ne))]},Z.id)},Ve=(Z,be,Se=new Set)=>{if(Se.has(Z.id))return null;const Ne=new Set(Se);Ne.add(Z.id);const Je=Y.filter(ft=>ft.folderId===Z.id),at=R.filter(ft=>ft.parentFolderId===Z.id);return Je.length===0&&at.length===0?null:o.jsxs("div",{className:"space-y-1",children:[Je.length>0&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:`mb-1 text-xs font-semibold uppercase tracking-wide ${pe}`,style:{paddingLeft:`${8+be*12}px`},children:Z.name}),o.jsx("div",{style:{paddingLeft:`${be*12}px`},children:Je.map(Te)})]}),at.map(ft=>Ve(ft,be+1,Ne))]},Z.id)},Ie=R.filter(Z=>!Z.parentFolderId),Be=x?xe(x):"";return o.jsxs("section",{className:"space-y-4","aria-labelledby":"api-client-collections-heading",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(Wy,{className:"h-4 w-4"}),o.jsx("h3",{id:"api-client-collections-heading",className:"font-semibold",children:"Collections"})]}),o.jsxs("div",{className:"flex gap-2",children:[o.jsx("input",{"aria-label":"New collection name",className:`min-w-0 flex-1 rounded-md border px-2 py-2 text-sm ${ce}`,value:C,onChange:Z=>M(Z.target.value),placeholder:"New collection"}),o.jsx("button",{type:"button","aria-label":"Add collection",className:"rounded-md border px-3 py-2",onClick:ge,children:o.jsx(Ba,{className:"h-4 w-4"})})]}),o.jsx("div",{className:"space-y-2",children:h.collections.map(Z=>o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx("button",{type:"button",className:`min-w-0 flex-1 rounded-md px-2 py-2 text-left text-sm font-medium ${Z.id===j?.id?ve:""}`,onClick:()=>{u?.(Z.id),f?.(""),N(null),I("")},children:Z.name}),o.jsx("button",{type:"button",disabled:Fr(h,Z.id).length===0,"aria-label":`Run collection ${Z.name}`,className:"rounded-md p-2 opacity-70 hover:opacity-100 disabled:cursor-not-allowed disabled:opacity-30",onClick:()=>p?.(Z.id),children:o.jsx(Jl,{className:"h-4 w-4"})}),h.collections.length>1&&o.jsx("button",{type:"button","aria-label":`Delete collection ${Z.name}`,className:"rounded-md p-2 opacity-70 hover:opacity-100",onClick:()=>$(Z.id),children:o.jsx(Cn,{className:"h-4 w-4"})})]},Z.id))}),j&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"space-y-2 border-t pt-3",children:[o.jsx("div",{className:"text-xs font-semibold uppercase tracking-wide",children:"Collection authorization"}),o.jsx(sf,{auth:j.auth,label:"Collection",onChange:Ee,theme:A}),o.jsx("p",{className:`text-xs ${pe}`,children:"Requests set to inherit use the nearest folder override, then this collection authorization."})]}),o.jsxs("div",{className:"space-y-2 border-t pt-3",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("span",{className:"text-xs font-semibold uppercase tracking-wide",children:"Collection variables"}),o.jsxs("button",{type:"button","aria-label":"Add collection variable",className:"inline-flex items-center gap-1 rounded-md border px-2 py-1 text-xs",onClick:he,children:[o.jsx(Ba,{className:"h-3.5 w-3.5"})," Add"]})]}),o.jsxs("div",{className:"space-y-2",children:[j.variables.map((Z,be)=>o.jsxs("div",{className:"grid grid-cols-[auto_minmax(0,1fr)_minmax(0,1fr)_auto] items-center gap-1",children:[o.jsx("input",{"aria-label":`Collection variable ${be+1} enabled`,type:"checkbox",checked:Z.enabled!==!1,onChange:Se=>ke(Z.id,{enabled:Se.target.checked})}),o.jsx("input",{"aria-label":`Collection variable ${be+1} key`,className:`min-w-0 rounded-md border px-2 py-1.5 font-mono text-xs ${ce}`,placeholder:"baseUrl",value:Z.key,onChange:Se=>ke(Z.id,{key:Se.target.value})}),o.jsx("input",{"aria-label":`Collection variable ${be+1} value`,className:`min-w-0 rounded-md border px-2 py-1.5 font-mono text-xs ${ce}`,placeholder:"https://api.example.com",value:Z.value,onChange:Se=>ke(Z.id,{value:Se.target.value})}),o.jsx("button",{type:"button","aria-label":`Remove collection variable ${be+1}`,className:"rounded-md p-1.5 opacity-70 hover:opacity-100",onClick:()=>T(Z.id),children:o.jsx(Cn,{className:"h-3.5 w-3.5"})})]},Z.id)),j.variables.length===0&&o.jsxs("p",{className:`text-xs ${pe}`,children:["Collection variables provide reusable defaults such as ",o.jsx("code",{children:"{{baseUrl}}"}),". Active environment values override matching collection keys."]})]})]}),o.jsxs("div",{className:"space-y-1 border-t pt-3",children:[o.jsxs("div",{className:"flex gap-2",children:[o.jsx("input",{"aria-label":"New folder name",className:`min-w-0 flex-1 rounded-md border px-2 py-2 text-sm ${ce}`,value:k,onChange:Z=>G(Z.target.value),placeholder:"Folder"}),o.jsx("button",{type:"button","aria-label":"Add folder",className:"rounded-md border px-3 py-2",onClick:ne,children:o.jsx(Ky,{className:"h-4 w-4"})})]}),o.jsx("p",{className:`text-xs ${pe}`,children:Be?`New folders are created inside ${Be}.`:"New folders are created at the collection root."})]}),o.jsxs("div",{className:"space-y-1",children:[o.jsx("button",{type:"button","aria-label":"Select collection root",className:`w-full rounded-md px-2 py-2 text-left text-sm ${x===""?"bg-blue-500/10":""}`,onClick:()=>f?.(""),children:"Unfiled / collection root"}),Ie.map(Z=>Re(Z,0))]}),D&&o.jsxs("div",{className:"space-y-2 border-t pt-3",children:[o.jsxs("div",{className:"text-xs font-semibold uppercase tracking-wide",children:["Folder authorization — ",Be]}),o.jsx(sf,{auth:D.auth,label:"Folder",allowInherit:!0,onChange:He,theme:A})]}),o.jsxs("div",{className:"space-y-2 border-t pt-3",children:[o.jsx("input",{"aria-label":"Saved request name",className:`w-full rounded-md border px-2 py-2 text-sm ${ce}`,value:U,onChange:Z=>I(Z.target.value),placeholder:"Request name"}),o.jsxs("select",{"aria-label":"Saved request folder",className:`w-full rounded-md border px-2 py-2 text-sm ${ce}`,value:x,onChange:Z=>f?.(Z.target.value),children:[o.jsx("option",{value:"",children:"Unfiled"}),me.map(({folder:Z,depth:be})=>o.jsx("option",{value:Z.id,children:`${"— ".repeat(be)}${Z.name}`},Z.id))]}),o.jsxs("button",{type:"button",className:"inline-flex w-full items-center justify-center gap-2 rounded-md border px-3 py-2 text-sm font-medium",onClick:W,children:[o.jsx(lg,{className:"h-4 w-4"})," ",_?"Update request":"Save request"]})]}),o.jsxs("div",{className:"space-y-3 border-t pt-3",children:[Y.filter(Z=>!Z.folderId).map(Te),Ie.map(Z=>Ve(Z,0)),Y.length===0&&o.jsx("p",{className:`px-2 text-xs ${pe}`,children:"Save the current request to build a reusable collection."})]})]})]})};function Va(){return new Date().toISOString()}const K0=({workspace:a,onWorkspaceChange:i,theme:c})=>{const[u,f]=le.useState(""),p=a.environments.find(M=>M.id===a.activeEnvironmentId),g=c==="dark"?"bg-gray-900 border-gray-700 text-gray-100":"bg-white border-gray-300 text-gray-900",y=c==="dark"?"text-gray-400":"text-gray-500",x=()=>{const M=u.trim();if(!M)return;const k=Va(),G=Ht("environment");i(U=>({...U,environments:[...U.environments,{id:G,name:M,variables:[],createdAt:k,updatedAt:k}],activeEnvironmentId:G})),f("")},h=M=>{if(!p)return;const k=Va();i(G=>({...G,environments:G.environments.map(U=>U.id===p.id?{...U,name:M,updatedAt:k}:U)}))},S=()=>{if(!p)return;const M=Va();i(k=>({...k,environments:k.environments.map(G=>G.id===p.id?{...G,variables:[...G.variables,{id:Ht("variable"),key:"",value:"",enabled:!0}],updatedAt:M}:G)}))},A=(M,k)=>{if(!p)return;const G=Va();i(U=>({...U,environments:U.environments.map(I=>I.id===p.id?{...I,variables:I.variables.map(_=>_.id===M?{..._,...k}:_),updatedAt:G}:I)}))},C=M=>{if(!p)return;const k=Va();i(G=>({...G,environments:G.environments.map(U=>U.id===p.id?{...U,variables:U.variables.filter(I=>I.id!==M),updatedAt:k}:U)}))};return o.jsxs("section",{className:"space-y-3","aria-labelledby":"api-client-environment-heading",children:[o.jsxs("div",{className:"flex items-center justify-between gap-2",children:[o.jsx("h3",{id:"api-client-environment-heading",className:"font-semibold",children:"Environment"}),p&&o.jsx("button",{type:"button","aria-label":`Delete environment ${p.name}`,className:"rounded-md p-2 opacity-70 hover:opacity-100",onClick:()=>i(M=>i0(M,p.id)),children:o.jsx(Cn,{className:"h-4 w-4"})})]}),o.jsxs("select",{"aria-label":"Active environment",className:`w-full rounded-md border px-2 py-2 text-sm ${g}`,value:a.activeEnvironmentId||"",onChange:M=>i(k=>({...k,activeEnvironmentId:M.target.value||void 0})),children:[o.jsx("option",{value:"",children:"No environment"}),a.environments.map(M=>o.jsx("option",{value:M.id,children:M.name},M.id))]}),o.jsxs("div",{className:"flex gap-2",children:[o.jsx("input",{"aria-label":"New environment name",className:`min-w-0 flex-1 rounded-md border px-2 py-2 text-sm ${g}`,value:u,onChange:M=>f(M.target.value),placeholder:"New environment"}),o.jsx("button",{type:"button","aria-label":"Add environment",className:"rounded-md border px-3 py-2",onClick:x,children:o.jsx(Ba,{className:"h-4 w-4"})})]}),p&&o.jsxs("div",{className:"space-y-3",children:[o.jsx("input",{"aria-label":"Environment name",className:`w-full rounded-md border px-2 py-2 text-sm font-medium ${g}`,value:p.name,onChange:M=>h(M.target.value)}),o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("span",{className:"text-xs font-semibold uppercase tracking-wide",children:"Variables"}),o.jsxs("button",{type:"button","aria-label":"Add environment variable",className:"inline-flex items-center gap-1 rounded-md border px-2 py-1 text-xs",onClick:S,children:[o.jsx(Ba,{className:"h-3.5 w-3.5"})," Add"]})]}),o.jsxs("div",{className:"space-y-2",children:[p.variables.map((M,k)=>o.jsxs("div",{className:"grid grid-cols-[auto_minmax(0,1fr)_minmax(0,1fr)_auto] items-center gap-1",children:[o.jsx("input",{"aria-label":`Environment variable ${k+1} enabled`,type:"checkbox",checked:M.enabled!==!1,onChange:G=>A(M.id,{enabled:G.target.checked})}),o.jsx("input",{"aria-label":`Environment variable ${k+1} key`,className:`min-w-0 rounded-md border px-2 py-1.5 font-mono text-xs ${g}`,placeholder:"baseUrl",value:M.key,onChange:G=>A(M.id,{key:G.target.value})}),o.jsx("input",{"aria-label":`Environment variable ${k+1} value`,className:`min-w-0 rounded-md border px-2 py-1.5 font-mono text-xs ${g}`,placeholder:"https://api.example.com",value:M.value,onChange:G=>A(M.id,{value:G.target.value})}),o.jsx("button",{type:"button","aria-label":`Remove environment variable ${k+1}`,className:"rounded-md p-1.5 opacity-70 hover:opacity-100",onClick:()=>C(M.id),children:o.jsx(Cn,{className:"h-3.5 w-3.5"})})]},M.id)),p.variables.length===0&&o.jsxs("p",{className:`text-xs ${y}`,children:["Add variables such as ",o.jsx("code",{children:"{{baseUrl}}"})," or ",o.jsx("code",{children:"{{token}}"}),"."]})]})]})]})};function J0(a){const i=new Date(a);return Number.isNaN(i.getTime())?a:i.toLocaleString()}const W0=({workspace:a,onWorkspaceChange:i,onLoadRequest:c,onViewAll:u,theme:f})=>{const p=f==="dark"?"text-gray-400":"text-gray-500",g=x=>{const h=a.history.find(S=>S.id===x);h&&c(Dn(h.request),h.scripts?sn(h.scripts):void 0,h.collectionId,h.folderId)},y=x=>{i(h=>({...h,history:h.history.filter(S=>S.id!==x)}))};return o.jsxs("section",{className:"space-y-3","aria-labelledby":"api-client-history-heading",children:[o.jsxs("div",{className:"flex items-center justify-between gap-2",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(hs,{className:"h-4 w-4"}),o.jsx("h3",{id:"api-client-history-heading",className:"font-semibold",children:"Recent history"})]}),a.history.length>0&&u&&o.jsx("button",{type:"button",className:`text-xs underline underline-offset-2 ${p}`,onClick:u,children:"View all"})]}),o.jsxs("div",{className:"space-y-1",children:[a.history.slice(0,5).map(x=>{const h=x.status!==void 0?`${x.status}${x.statusText?` ${x.statusText}`:""}`:x.error?"Error":"Sent",S=x.responseTime!==void 0?` · ${x.responseTime} ms`:"",A=x.scriptTests?.filter(M=>M.passed).length||0,C=x.scriptTests?.length?`${A}/${x.scriptTests.length} tests passed`:x.scriptError?"Script error":void 0;return o.jsxs("div",{className:"group flex items-start gap-1 rounded-md",children:[o.jsxs("button",{type:"button",className:"min-w-0 flex-1 rounded-md px-2 py-2 text-left hover:bg-blue-500/10","aria-label":`Load history request ${x.executedMethod.toUpperCase()} ${x.resolvedUrl}`,onClick:()=>g(x.id),children:[o.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[o.jsx("span",{className:"font-mono font-semibold text-blue-600",children:x.executedMethod.toUpperCase()}),o.jsxs("span",{className:x.error?"text-red-600":p,children:[h,S]})]}),o.jsx("div",{className:"truncate font-mono text-xs",title:x.resolvedUrl,children:x.resolvedUrl}),C&&o.jsx("div",{className:`mt-1 text-[11px] ${x.scriptError?"text-red-600":p}`,children:C}),o.jsx("div",{className:`mt-1 text-[11px] ${p}`,children:J0(x.createdAt)})]}),o.jsx("button",{type:"button",className:"rounded-md p-2 opacity-70 hover:opacity-100","aria-label":`Delete history request ${x.executedMethod.toUpperCase()} ${x.resolvedUrl}`,onClick:()=>y(x.id),children:o.jsx(Cn,{className:"h-4 w-4"})})]},x.id)}),a.history.length===0&&o.jsx("p",{className:`px-2 text-xs ${p}`,children:"Sent requests appear here for quick replay."})]}),a.history.length>0&&u&&o.jsxs("button",{type:"button",className:"w-full rounded-md border px-3 py-2 text-xs font-medium hover:bg-blue-500/10",onClick:u,children:["Open full history · ",a.history.length]})]})};function P0(a){return!!a.error||!!a.scriptError||a.status!==void 0&&a.status>=400||!!a.scriptTests?.some(i=>!i.passed)}function ex(a,i){const c=i.query.trim().toLowerCase();return a.history.filter(u=>{const f=u.collectionId?a.collections.find(S=>S.id===u.collectionId)?.name||"Deleted collection":"",p=u.folderId?a.folders.find(S=>S.id===u.folderId)?.name||"Deleted folder":"",g=!c||[u.executedMethod,u.resolvedUrl,u.status,u.statusText,f,p,u.runName].filter(S=>S!==void 0).some(S=>String(S).toLowerCase().includes(c)),y=i.method==="all"||u.executedMethod.toUpperCase()===i.method,x=P0(u),h=i.outcome==="all"||i.outcome==="success"&&!x||i.outcome==="failed"&&x||i.outcome==="tests"&&!!u.scriptTests?.length;return g&&y&&h})}function tx(a){const i=new Set,c=[];for(const u of a){if(!u.runId){c.push({kind:"entry",entry:u});continue}if(i.has(u.runId))continue;i.add(u.runId);const f=a.filter(g=>g.runId===u.runId).sort((g,y)=>(g.runIndex||Number.MAX_SAFE_INTEGER)-(y.runIndex||Number.MAX_SAFE_INTEGER)),p=Math.max(f.length,...f.map(g=>g.runTotal||0));c.push({kind:"run",group:{runId:u.runId,runName:u.runName||"Collection run",entries:f,total:p,captured:f.length,passed:f.filter(g=>g.runPassed===!0).length,failed:f.filter(g=>g.runPassed===!1).length,cancelled:0}})}return c}function xf(a){const i=new Date(a);return Number.isNaN(i.getTime())?a:i.toLocaleString()}function eo(a){return!!a.error||!!a.scriptError||a.status!==void 0&&a.status>=400||!!a.scriptTests?.some(i=>!i.passed)}function to(a){return a.error?"Request failed":a.status!==void 0?`${a.status}${a.statusText?` ${a.statusText}`:""}`:"Sent"}function nx(a){return(a||[]).filter(i=>i.enabled!==!1&&(i.key.trim()||i.value.trim()))}function bf({title:a,values:i,mutedClass:c}){const u=nx(i);return u.length===0?null:o.jsxs("section",{className:"space-y-2",children:[o.jsx("h4",{className:"text-xs font-semibold uppercase tracking-wide",children:a}),o.jsx("div",{className:"overflow-hidden rounded-md border",children:u.map((f,p)=>o.jsxs("div",{className:"grid grid-cols-[minmax(8rem,0.35fr)_minmax(0,1fr)] gap-3 border-b px-3 py-2 text-xs last:border-b-0",children:[o.jsx("span",{className:"break-all font-mono font-medium",children:f.key||"—"}),o.jsx("span",{className:`break-all font-mono ${c}`,children:f.value})]},`${f.key}:${p}`))})]})}function vf(a){const i=[`${a.passed} runner passed`,`${a.failed} runner failed`];return a.cancelled&&i.push(`${a.cancelled} cancelled`),i.join(" · ")}const lx=({workspace:a,onWorkspaceChange:i,onLoadRequest:c,onBack:u,theme:f,initialEntryId:p,initialRunId:g})=>{const[y,x]=le.useState(""),[h,S]=le.useState("all"),[A,C]=le.useState("all"),[M,k]=le.useState(g?void 0:p||a.history[0]?.id),[G,U]=le.useState(g),I=f==="dark"?"border-gray-700 bg-gray-900 text-gray-100":"border-gray-300 bg-white text-gray-900",_=f==="dark"?"border-gray-700 bg-gray-800/60 text-gray-100":"border-gray-200 bg-gray-50 text-gray-900",N=f==="dark"?"text-gray-400":"text-gray-500",j=f==="dark"?"border-gray-700 bg-gray-950 text-gray-100":"border-gray-200 bg-white text-gray-900",R=le.useMemo(()=>ex(a,{query:y,method:h,outcome:A}),[h,A,y,a]),Y=le.useMemo(()=>tx(R),[R]),D=G&&Y.find(K=>K.kind==="run"&&K.group.runId===G)?.kind==="run"?Y.find(K=>K.kind==="run"&&K.group.runId===G).group:void 0,X=D?void 0:R.find(K=>K.id===M)||R[0],me=X?.collectionId?a.collections.find(K=>K.id===X.collectionId):void 0,xe=X?.folderId?a.folders.find(K=>K.id===X.folderId):void 0,ge=()=>{k(void 0),U(void 0)},Ee=K=>{k(K),U(void 0)},He=K=>{U(K),k(void 0)},he=K=>{c(Dn(K.request),K.scripts?sn(K.scripts):void 0,K.collectionId,K.folderId),u()},ke=K=>{i(P=>({...P,history:P.history.filter(w=>w.id!==K)})),M===K&&k(void 0)},T=()=>{i(K=>({...K,history:[]})),ge()},ne=X?.responseHeaders||[],W=X?.scriptTests?.filter(K=>K.passed).length||0;return o.jsx("section",{className:`rounded-xl border p-4 md:p-5 ${_}`,"aria-labelledby":"api-client-history-page-heading",children:o.jsxs("div",{className:"space-y-4",children:[o.jsxs("header",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsxs("button",{type:"button",className:"inline-flex min-h-10 items-center gap-2 rounded-md border px-3 py-2 text-sm",onClick:u,children:[o.jsx(ku,{className:"h-4 w-4"})," Client"]}),o.jsxs("div",{children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(hs,{className:"h-5 w-5"}),o.jsx("h2",{id:"api-client-history-page-heading",className:"text-lg font-semibold",children:"Request history"})]}),o.jsxs("p",{className:`text-xs ${N}`,children:[a.history.length," persisted request",a.history.length===1?"":"s"," · newest first"]})]})]}),a.history.length>0&&o.jsxs("button",{type:"button",className:"inline-flex min-h-10 items-center gap-2 self-start rounded-md border px-3 py-2 text-sm text-red-600",onClick:T,children:[o.jsx(Cn,{className:"h-4 w-4"})," Clear history"]})]}),o.jsxs("div",{className:"grid gap-2 md:grid-cols-[minmax(0,1fr)_10rem_12rem]",children:[o.jsxs("label",{className:"relative",children:[o.jsx("span",{className:"sr-only",children:"Search history"}),o.jsx(zu,{className:`pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 ${N}`}),o.jsx("input",{"aria-label":"Search history",className:`w-full rounded-md border py-2 pl-9 pr-3 text-sm ${I}`,value:y,onChange:K=>{x(K.target.value),ge()},placeholder:"Search URL, status, collection or run…"})]}),o.jsxs("select",{"aria-label":"History method filter",className:`rounded-md border px-3 py-2 text-sm ${I}`,value:h,onChange:K=>{S(K.target.value),ge()},children:[o.jsx("option",{value:"all",children:"All methods"}),["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"].map(K=>o.jsx("option",{value:K,children:K},K))]}),o.jsxs("select",{"aria-label":"History outcome filter",className:`rounded-md border px-3 py-2 text-sm ${I}`,value:A,onChange:K=>{C(K.target.value),ge()},children:[o.jsx("option",{value:"all",children:"All outcomes"}),o.jsx("option",{value:"success",children:"Successful HTTP"}),o.jsx("option",{value:"failed",children:"HTTP / script failures"}),o.jsx("option",{value:"tests",children:"With tests"})]})]}),o.jsxs("div",{className:"grid min-h-[32rem] gap-4 lg:grid-cols-[minmax(18rem,0.85fr)_minmax(0,1.35fr)]",children:[o.jsxs("div",{className:"max-h-[48rem] space-y-2 overflow-auto rounded-lg border p-2",children:[Y.map(K=>{if(K.kind==="entry"){const $=K.entry,ce=X?.id===$.id,pe=eo($),ve=$.collectionId?a.collections.find(Te=>Te.id===$.collectionId)?.name||"Deleted collection":void 0;return o.jsxs("button",{type:"button",className:`w-full rounded-md border px-3 py-3 text-left transition ${ce?"border-blue-500 bg-blue-500/10":"border-transparent hover:bg-blue-500/5"}`,onClick:()=>Ee($.id),children:[o.jsxs("div",{className:"flex items-center justify-between gap-3 text-xs",children:[o.jsx("span",{className:"font-mono font-semibold text-blue-600",children:$.executedMethod.toUpperCase()}),o.jsxs("span",{className:pe?"text-red-600":N,children:[to($),$.responseTime!==void 0?` · ${$.responseTime} ms`:""]})]}),o.jsx("div",{className:"mt-1 truncate font-mono text-xs",title:$.resolvedUrl,children:$.resolvedUrl}),o.jsxs("div",{className:`mt-1 flex items-center justify-between gap-2 text-[11px] ${N}`,children:[o.jsx("span",{className:"truncate",children:ve||"Unsaved request"}),o.jsx("span",{children:xf($.createdAt)})]})]},$.id)}const P=K.group,w=D?.runId===P.runId;return o.jsxs("div",{className:`rounded-lg border ${w?"border-blue-500 bg-blue-500/5":""}`,children:[o.jsxs("button",{type:"button","aria-label":`Open collection run ${P.runName}`,className:"w-full px-3 py-3 text-left",onClick:()=>He(P.runId),children:[o.jsx("div",{className:"text-xs font-semibold text-blue-600",children:"Collection run"}),o.jsx("div",{className:"mt-1 truncate text-sm font-medium",children:P.runName}),o.jsxs("div",{className:`mt-1 text-[11px] ${N}`,children:[P.captured,"/",P.total," history entries · ",vf(P)]})]}),o.jsx("div",{className:"border-t px-2 py-1",children:P.entries.map($=>o.jsxs("button",{type:"button",className:`w-full rounded-md px-2 py-2 text-left text-xs hover:bg-blue-500/10 ${X?.id===$.id?"bg-blue-500/10":""}`,onClick:()=>Ee($.id),children:[o.jsxs("div",{className:"flex items-center justify-between gap-2",children:[o.jsxs("span",{children:[o.jsx("span",{className:"mr-2 text-[10px] text-gray-500",children:$.runIndex||"–"}),o.jsx("span",{className:"font-mono font-semibold text-blue-600",children:$.executedMethod.toUpperCase()})]}),o.jsx("span",{className:eo($)?"text-red-600":N,children:to($)})]}),o.jsx("div",{className:"mt-1 truncate font-mono",title:$.resolvedUrl,children:$.resolvedUrl})]},$.id))})]},P.runId)}),R.length===0&&o.jsx("div",{className:`px-3 py-8 text-center text-sm ${N}`,children:a.history.length===0?"Send a request to start building history.":"No history entries match these filters."})]}),o.jsxs("div",{className:"min-w-0 rounded-lg border p-4",children:[D&&o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"border-b pb-4",children:[o.jsx("div",{className:"text-xs font-semibold uppercase tracking-wide text-blue-600",children:"Collection run"}),o.jsx("h3",{className:"mt-1 text-lg font-semibold",children:D.runName}),o.jsxs("p",{className:`mt-1 text-sm ${N}`,children:[D.captured," / ",D.total," history entries captured · ",vf(D)]}),o.jsx("p",{className:`mt-2 text-xs ${N}`,children:"Runner pass/fail is based on transport, scripts, and tests. An HTTP 4xx/5xx can therefore be a runner pass while still appearing as an HTTP failure in the request inspector."})]}),o.jsx("div",{className:"space-y-2",children:D.entries.map(K=>o.jsxs("button",{type:"button","aria-label":`Inspect history ${K.runIndex||""}`,className:"w-full rounded-md border px-3 py-3 text-left hover:bg-blue-500/5",onClick:()=>Ee(K.id),children:[o.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 text-sm",children:[o.jsxs("span",{children:[o.jsx("span",{className:`mr-2 text-xs ${N}`,children:K.runIndex||"–"}),o.jsx("span",{className:"font-mono font-bold text-blue-600",children:K.executedMethod.toUpperCase()})]}),o.jsxs("span",{className:K.runPassed===!1?"text-red-600":K.runPassed===!0?"text-green-600":N,children:[K.runPassed===!0?"Runner pass":K.runPassed===!1?"Runner fail":"Recorded",K.status!==void 0?` · HTTP ${K.status}`:""]})]}),o.jsx("div",{className:"mt-1 truncate font-mono text-xs",children:K.resolvedUrl})]},K.id))})]}),!D&&!X&&o.jsx("div",{className:`flex min-h-[20rem] items-center justify-center text-sm ${N}`,children:"Select a history entry or collection run to inspect it."}),X&&o.jsxs("div",{className:"space-y-5",children:[o.jsxs("div",{className:"space-y-2 border-b pb-4",children:[o.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[o.jsxs("div",{className:"min-w-0",children:[o.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-sm",children:[o.jsx("span",{className:"font-mono font-bold text-blue-600",children:X.executedMethod.toUpperCase()}),o.jsx("span",{className:eo(X)?"text-red-600":N,children:to(X)}),X.responseTime!==void 0&&o.jsxs("span",{className:N,children:[X.responseTime," ms"]}),X.runPassed!==void 0&&o.jsx("span",{className:X.runPassed?"text-green-600":"text-red-600",children:X.runPassed?"Runner pass":"Runner fail"})]}),o.jsx("div",{className:"mt-1 break-all font-mono text-sm",children:X.resolvedUrl}),o.jsxs("div",{className:`mt-1 text-xs ${N}`,children:[xf(X.createdAt),X.collectionId?` · ${me?.name||"Deleted collection"}`:"",X.folderId?` / ${xe?.name||"Deleted folder"}`:"",X.runName?` · Run: ${X.runName}`:""]})]}),o.jsxs("div",{className:"flex shrink-0 gap-2",children:[o.jsxs("button",{type:"button",className:"inline-flex min-h-10 items-center gap-2 rounded-md border px-3 py-2 text-sm font-medium hover:bg-blue-500/10",onClick:()=>he(X),children:[o.jsx(ng,{className:"h-4 w-4"})," Open in client"]}),o.jsx("button",{type:"button","aria-label":"Delete selected history entry",className:"inline-flex min-h-10 items-center rounded-md border px-3 py-2 text-red-600",onClick:()=>ke(X.id),children:o.jsx(Cn,{className:"h-4 w-4"})})]})]}),X.error&&o.jsx("div",{className:"rounded-md border border-red-300 bg-red-500/10 px-3 py-2 text-sm text-red-700",children:X.error})]}),o.jsxs("section",{className:"space-y-3",children:[o.jsx("h3",{className:"font-semibold",children:"Request"}),o.jsxs("div",{className:"grid gap-3 text-xs sm:grid-cols-2",children:[o.jsxs("div",{children:[o.jsx("span",{className:N,children:"Original URL"}),o.jsx("div",{className:"mt-1 break-all font-mono",children:X.request.url})]}),o.jsxs("div",{children:[o.jsx("span",{className:N,children:"Content type"}),o.jsx("div",{className:"mt-1 font-mono",children:X.request.contentType||"—"})]})]}),o.jsx(bf,{title:"Query parameters",values:X.request.query,mutedClass:N}),o.jsx(bf,{title:"Headers",values:X.request.headers,mutedClass:N}),X.request.body&&o.jsxs("div",{className:"space-y-2",children:[o.jsx("h4",{className:"text-xs font-semibold uppercase tracking-wide",children:"Body"}),o.jsx("pre",{className:`max-h-72 overflow-auto whitespace-pre-wrap break-words rounded-md border p-3 text-xs ${j}`,children:X.request.body})]})]}),o.jsxs("section",{className:"space-y-3 border-t pt-4",children:[o.jsxs("div",{className:"flex items-center justify-between gap-2",children:[o.jsx("h3",{className:"font-semibold",children:"Response"}),X.responseBodyTruncated&&o.jsx("span",{className:"text-xs text-amber-600",children:"Body truncated in history"})]}),ne.length>0&&o.jsxs("div",{className:"space-y-2",children:[o.jsx("h4",{className:"text-xs font-semibold uppercase tracking-wide",children:"Headers"}),o.jsx("div",{className:"overflow-hidden rounded-md border",children:ne.map(([K,P],w)=>o.jsxs("div",{className:"grid grid-cols-[minmax(8rem,0.35fr)_minmax(0,1fr)] gap-3 border-b px-3 py-2 text-xs last:border-b-0",children:[o.jsx("span",{className:"break-all font-mono font-medium",children:K}),o.jsx("span",{className:`break-all font-mono ${N}`,children:P})]},`${K}:${w}`))})]}),X.responseBody!==void 0?o.jsxs("div",{className:"space-y-2",children:[o.jsx("h4",{className:"text-xs font-semibold uppercase tracking-wide",children:"Body"}),o.jsx("pre",{className:`max-h-96 overflow-auto whitespace-pre-wrap break-words rounded-md border p-3 text-xs ${j}`,children:X.responseBody||"(empty response body)"})]}):o.jsx("p",{className:`text-sm ${N}`,children:"Response payload was not captured for this older history entry."})]}),(X.scriptTests?.length||X.scriptError||X.scriptLogs?.length)&&o.jsxs("section",{className:"space-y-3 border-t pt-4",children:[o.jsx("h3",{className:"font-semibold",children:"Tests & console"}),X.scriptTests?.length?o.jsxs("div",{className:"space-y-1",children:[o.jsxs("div",{className:`text-xs ${N}`,children:[W,"/",X.scriptTests.length," tests passed"]}),X.scriptTests.map((K,P)=>o.jsxs("div",{className:`rounded-md border px-3 py-2 text-sm ${K.passed?"":"border-red-300 bg-red-500/10 text-red-700"}`,children:[o.jsxs("span",{className:"font-medium",children:[K.passed?"✓":"✕"," ",K.name]}),K.error&&o.jsx("div",{className:"mt-1 text-xs",children:K.error})]},`${K.name}:${P}`))]}):null,X.scriptError&&o.jsx("div",{className:"rounded-md border border-red-300 bg-red-500/10 px-3 py-2 text-sm text-red-700",children:X.scriptError}),X.scriptLogs?.length?o.jsx("pre",{className:`max-h-56 overflow-auto whitespace-pre-wrap rounded-md border p-3 text-xs ${j}`,children:X.scriptLogs.join(`
|
|
51
|
-
`)
|
|
52
|
-
${f}`),f}function ix(a,i,c){return Lt(a)?(a.src!==void 0&&An(c,"postman-script-src",i,"External Postman script sources are not fetched; only inline script.exec content is imported."),Array.isArray(a.exec)?a.exec.map(Pe).join(`
|
|
53
|
-
`):Pe(a.exec)):""}function Af(a,i,c){const u={preRequest:[],tests:[]};return sl(a).forEach((f,p)=>{const g=Pe(f.listen).toLowerCase();if(g!=="prerequest"&&g!=="test")return;const y=`${i}[${p}]`,x=ix(f.script,`${y}.script`,c).trim();if(!x)return;const h=rx(x,`${y}.script`,c);g==="prerequest"?u.preRequest.push(h):u.tests.push(h)}),u}function sx(a,i){return{preRequest:[...a.preRequest,...i.preRequest],tests:[...a.tests,...i.tests]}}function ox(a){const i=a.preRequest.filter(Boolean).join(`
|
|
11
|
+
`+n.mark.snippet),a+" "+s):a}function e(n,r){Error.call(this),this.name="YAMLException",this.reason=n,this.mark=r,this.message=t(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}return e.prototype=Object.create(Error.prototype),e.prototype.constructor=e,e.prototype.toString=function(r){return this.name+": "+t(this,r)},yd=e,yd}var bd,Ag;function yA(){if(Ag)return bd;Ag=1;const t=aa();function e(s,a,c,d,f){let h="",g="";const b=Math.floor(f/2)-1;return d-a>b&&(h=" ... ",a=d-b+h.length),c-d>b&&(g=" ...",c=d+b-g.length),{str:h+s.slice(a,c).replace(/\t/g,"→")+g,pos:d-a+h.length}}function n(s,a){return t.repeat(" ",a-s.length)+s}function r(s,a){if(a=Object.create(a||null),!s.buffer)return null;a.maxLength||(a.maxLength=79),typeof a.indent!="number"&&(a.indent=1),typeof a.linesBefore!="number"&&(a.linesBefore=3),typeof a.linesAfter!="number"&&(a.linesAfter=2);const c=/\r?\n|\r|\0/g,d=[0],f=[];let h,g=-1;for(;h=c.exec(s.buffer);)f.push(h.index),d.push(h.index+h[0].length),s.position<=h.index&&g<0&&(g=d.length-2);g<0&&(g=d.length-1);let b="";const v=Math.min(s.line+a.linesAfter,f.length).toString().length,S=a.maxLength-(a.indent+v+3);for(let C=1;C<=a.linesBefore&&!(g-C<0);C++){const T=e(s.buffer,d[g-C],f[g-C],s.position-(d[g]-d[g-C]),S);b=t.repeat(" ",a.indent)+n((s.line-C+1).toString(),v)+" | "+T.str+`
|
|
12
|
+
`+b}const A=e(s.buffer,d[g],f[g],s.position,S);b+=t.repeat(" ",a.indent)+n((s.line+1).toString(),v)+" | "+A.str+`
|
|
13
|
+
`,b+=t.repeat("-",a.indent+v+3+A.pos)+`^
|
|
14
|
+
`;for(let C=1;C<=a.linesAfter&&!(g+C>=f.length);C++){const T=e(s.buffer,d[g+C],f[g+C],s.position-(d[g]-d[g+C]),S);b+=t.repeat(" ",a.indent)+n((s.line+C+1).toString(),v)+" | "+T.str+`
|
|
15
|
+
`}return b.replace(/\n$/,"")}return bd=r,bd}var xd,kg;function Nn(){if(kg)return xd;kg=1;const t=oa(),e=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],n=["scalar","sequence","mapping"];function r(a){const c={};return a!==null&&Object.keys(a).forEach(function(d){a[d].forEach(function(f){c[String(f)]=d})}),c}function s(a,c){if(c=c||{},Object.keys(c).forEach(function(d){if(e.indexOf(d)===-1)throw new t('Unknown option "'+d+'" is met in definition of "'+a+'" YAML type.')}),this.options=c,this.tag=a,this.kind=c.kind||null,this.resolve=c.resolve||function(){return!0},this.construct=c.construct||function(d){return d},this.instanceOf=c.instanceOf||null,this.predicate=c.predicate||null,this.represent=c.represent||null,this.representName=c.representName||null,this.defaultStyle=c.defaultStyle||null,this.multi=c.multi||!1,this.styleAliases=r(c.styleAliases||null),n.indexOf(this.kind)===-1)throw new t('Unknown kind "'+this.kind+'" is specified for "'+a+'" YAML type.')}return xd=s,xd}var vd,Cg;function Ng(){if(Cg)return vd;Cg=1;const t=oa(),e=Nn();function n(a,c){const d=[];return a[c].forEach(function(f){let h=d.length;d.forEach(function(g,b){g.tag===f.tag&&g.kind===f.kind&&g.multi===f.multi&&(h=b)}),d[h]=f}),d}function r(){const a={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}};function c(d){d.multi?(a.multi[d.kind].push(d),a.multi.fallback.push(d)):a[d.kind][d.tag]=a.fallback[d.tag]=d}for(let d=0,f=arguments.length;d<f;d+=1)arguments[d].forEach(c);return a}function s(a){return this.extend(a)}return s.prototype.extend=function(c){let d=[],f=[];if(c instanceof e)f.push(c);else if(Array.isArray(c))f=f.concat(c);else if(c&&(Array.isArray(c.implicit)||Array.isArray(c.explicit)))c.implicit&&(d=d.concat(c.implicit)),c.explicit&&(f=f.concat(c.explicit));else throw new t("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");d.forEach(function(g){if(!(g instanceof e))throw new t("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(g.loadKind&&g.loadKind!=="scalar")throw new t("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(g.multi)throw new t("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),f.forEach(function(g){if(!(g instanceof e))throw new t("Specified list of YAML types (or a single Type object) contains a non-Type object.")});const h=Object.create(s.prototype);return h.implicit=(this.implicit||[]).concat(d),h.explicit=(this.explicit||[]).concat(f),h.compiledImplicit=n(h,"implicit"),h.compiledExplicit=n(h,"explicit"),h.compiledTypeMap=r(h.compiledImplicit,h.compiledExplicit),h},vd=s,vd}var wd,Tg;function jg(){if(Tg)return wd;Tg=1;const t=Nn();return wd=new t("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return e!==null?e:""}}),wd}var Sd,Eg;function Og(){if(Eg)return Sd;Eg=1;const t=Nn();return Sd=new t("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return e!==null?e:[]}}),Sd}var Ad,Mg;function Rg(){if(Mg)return Ad;Mg=1;const t=Nn();return Ad=new t("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return e!==null?e:{}}}),Ad}var kd,Dg;function _g(){if(Dg)return kd;Dg=1;const t=Ng();return kd=new t({explicit:[jg(),Og(),Rg()]}),kd}var Cd,Lg;function Bg(){if(Lg)return Cd;Lg=1;const t=Nn();function e(s){if(s===null)return!0;const a=s.length;return a===1&&s==="~"||a===4&&(s==="null"||s==="Null"||s==="NULL")}function n(){return null}function r(s){return s===null}return Cd=new t("tag:yaml.org,2002:null",{kind:"scalar",resolve:e,construct:n,predicate:r,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"}),Cd}var Nd,$g;function qg(){if($g)return Nd;$g=1;const t=Nn();function e(s){if(s===null)return!1;const a=s.length;return a===4&&(s==="true"||s==="True"||s==="TRUE")||a===5&&(s==="false"||s==="False"||s==="FALSE")}function n(s){return s==="true"||s==="True"||s==="TRUE"}function r(s){return Object.prototype.toString.call(s)==="[object Boolean]"}return Nd=new t("tag:yaml.org,2002:bool",{kind:"scalar",resolve:e,construct:n,predicate:r,represent:{lowercase:function(s){return s?"true":"false"},uppercase:function(s){return s?"TRUE":"FALSE"},camelcase:function(s){return s?"True":"False"}},defaultStyle:"lowercase"}),Nd}var Td,zg;function Hg(){if(zg)return Td;zg=1;const t=aa(),e=Nn();function n(h){return h>=48&&h<=57||h>=65&&h<=70||h>=97&&h<=102}function r(h){return h>=48&&h<=55}function s(h){return h>=48&&h<=57}function a(h){if(h===null)return!1;const g=h.length;let b=0,v=!1;if(!g)return!1;let S=h[b];if((S==="-"||S==="+")&&(S=h[++b]),S==="0"){if(b+1===g)return!0;if(S=h[++b],S==="b"){for(b++;b<g;b++){if(S=h[b],S!=="0"&&S!=="1")return!1;v=!0}return v&&isFinite(c(h))}if(S==="x"){for(b++;b<g;b++){if(!n(h.charCodeAt(b)))return!1;v=!0}return v&&isFinite(c(h))}if(S==="o"){for(b++;b<g;b++){if(!r(h.charCodeAt(b)))return!1;v=!0}return v&&isFinite(c(h))}}for(;b<g;b++){if(!s(h.charCodeAt(b)))return!1;v=!0}return v?isFinite(c(h)):!1}function c(h){let g=h,b=1,v=g[0];if((v==="-"||v==="+")&&(v==="-"&&(b=-1),g=g.slice(1),v=g[0]),g==="0")return 0;if(v==="0"){if(g[1]==="b")return b*parseInt(g.slice(2),2);if(g[1]==="x")return b*parseInt(g.slice(2),16);if(g[1]==="o")return b*parseInt(g.slice(2),8)}return b*parseInt(g,10)}function d(h){return c(h)}function f(h){return Object.prototype.toString.call(h)==="[object Number]"&&h%1===0&&!t.isNegativeZero(h)}return Td=new e("tag:yaml.org,2002:int",{kind:"scalar",resolve:a,construct:d,predicate:f,represent:{binary:function(h){return h>=0?"0b"+h.toString(2):"-0b"+h.toString(2).slice(1)},octal:function(h){return h>=0?"0o"+h.toString(8):"-0o"+h.toString(8).slice(1)},decimal:function(h){return h.toString(10)},hexadecimal:function(h){return h>=0?"0x"+h.toString(16).toUpperCase():"-0x"+h.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),Td}var jd,Ig;function Ug(){if(Ig)return jd;Ig=1;const t=aa(),e=Nn(),n=new RegExp("^(?:[-+]?(?:[0-9]+)(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),r=new RegExp("^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function s(h){return h===null||!n.test(h)?!1:isFinite(parseFloat(h,10))?!0:r.test(h)}function a(h){let g=h.toLowerCase();const b=g[0]==="-"?-1:1;return"+-".indexOf(g[0])>=0&&(g=g.slice(1)),g===".inf"?b===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:g===".nan"?NaN:b*parseFloat(g,10)}const c=/^[-+]?[0-9]+e/;function d(h,g){if(isNaN(h))switch(g){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===h)switch(g){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===h)switch(g){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(t.isNegativeZero(h))return"-0.0";const b=h.toString(10);return c.test(b)?b.replace("e",".e"):b}function f(h){return Object.prototype.toString.call(h)==="[object Number]"&&(h%1!==0||t.isNegativeZero(h))}return jd=new e("tag:yaml.org,2002:float",{kind:"scalar",resolve:s,construct:a,predicate:f,represent:d,defaultStyle:"lowercase"}),jd}var Ed,Fg;function Vg(){return Fg||(Fg=1,Ed=_g().extend({implicit:[Bg(),qg(),Hg(),Ug()]})),Ed}var Od,Pg;function Kg(){return Pg||(Pg=1,Od=Vg()),Od}var Md,Yg;function Gg(){if(Yg)return Md;Yg=1;const t=Nn(),e=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),n=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function r(c){return c===null?!1:e.exec(c)!==null||n.exec(c)!==null}function s(c){let d=0,f=null,h=e.exec(c);if(h===null&&(h=n.exec(c)),h===null)throw new Error("Date resolve error");const g=+h[1],b=+h[2]-1,v=+h[3];if(!h[4])return new Date(Date.UTC(g,b,v));const S=+h[4],A=+h[5],C=+h[6];if(h[7]){for(d=h[7].slice(0,3);d.length<3;)d+="0";d=+d}if(h[9]){const D=+h[10],j=+(h[11]||0);f=(D*60+j)*6e4,h[9]==="-"&&(f=-f)}const T=new Date(Date.UTC(g,b,v,S,A,C,d));return f&&T.setTime(T.getTime()-f),T}function a(c){return c.toISOString()}return Md=new t("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:r,construct:s,instanceOf:Date,represent:a}),Md}var Rd,Xg;function Jg(){if(Xg)return Rd;Xg=1;const t=Nn();function e(n){return n==="<<"||n===null}return Rd=new t("tag:yaml.org,2002:merge",{kind:"scalar",resolve:e}),Rd}var Dd,Qg;function Wg(){if(Qg)return Dd;Qg=1;const t=Nn(),e=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
|
|
16
|
+
\r`;function n(c){if(c===null)return!1;let d=0;const f=c.length,h=e;for(let g=0;g<f;g++){const b=h.indexOf(c.charAt(g));if(!(b>64)){if(b<0)return!1;d+=6}}return d%8===0}function r(c){const d=c.replace(/[\r\n=]/g,""),f=d.length,h=e;let g=0;const b=[];for(let S=0;S<f;S++)S%4===0&&S&&(b.push(g>>16&255),b.push(g>>8&255),b.push(g&255)),g=g<<6|h.indexOf(d.charAt(S));const v=f%4*6;return v===0?(b.push(g>>16&255),b.push(g>>8&255),b.push(g&255)):v===18?(b.push(g>>10&255),b.push(g>>2&255)):v===12&&b.push(g>>4&255),new Uint8Array(b)}function s(c){let d="",f=0;const h=c.length,g=e;for(let v=0;v<h;v++)v%3===0&&v&&(d+=g[f>>18&63],d+=g[f>>12&63],d+=g[f>>6&63],d+=g[f&63]),f=(f<<8)+c[v];const b=h%3;return b===0?(d+=g[f>>18&63],d+=g[f>>12&63],d+=g[f>>6&63],d+=g[f&63]):b===2?(d+=g[f>>10&63],d+=g[f>>4&63],d+=g[f<<2&63],d+=g[64]):b===1&&(d+=g[f>>2&63],d+=g[f<<4&63],d+=g[64],d+=g[64]),d}function a(c){return Object.prototype.toString.call(c)==="[object Uint8Array]"}return Dd=new t("tag:yaml.org,2002:binary",{kind:"scalar",resolve:n,construct:r,predicate:a,represent:s}),Dd}var _d,Zg;function e0(){if(Zg)return _d;Zg=1;const t=Nn(),e=Object.prototype.hasOwnProperty,n=Object.prototype.toString;function r(a){if(a===null)return!0;const c={},d=a;for(let f=0,h=d.length;f<h;f+=1){const g=d[f];let b=!1;if(n.call(g)!=="[object Object]")return!1;let v;for(v in g)if(e.call(g,v))if(!b)b=!0;else return!1;if(!b||e.call(c,v))return!1;Object.defineProperty(c,v,{value:!0})}return!0}function s(a){return a!==null?a:[]}return _d=new t("tag:yaml.org,2002:omap",{kind:"sequence",resolve:r,construct:s}),_d}var Ld,t0;function n0(){if(t0)return Ld;t0=1;const t=Nn(),e=Object.prototype.toString;function n(s){if(s===null)return!0;const a=s,c=new Array(a.length);for(let d=0,f=a.length;d<f;d+=1){const h=a[d];if(e.call(h)!=="[object Object]")return!1;const g=Object.keys(h);if(g.length!==1)return!1;c[d]=[g[0],h[g[0]]]}return!0}function r(s){if(s===null)return[];const a=s,c=new Array(a.length);for(let d=0,f=a.length;d<f;d+=1){const h=a[d],g=Object.keys(h);c[d]=[g[0],h[g[0]]]}return c}return Ld=new t("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:n,construct:r}),Ld}var Bd,i0;function r0(){if(i0)return Bd;i0=1;const t=Nn(),e=Object.prototype.hasOwnProperty;function n(s){if(s===null)return!0;const a=s;for(const c in a)if(e.call(a,c)&&a[c]!==null)return!1;return!0}function r(s){return s!==null?s:{}}return Bd=new t("tag:yaml.org,2002:set",{kind:"mapping",resolve:n,construct:r}),Bd}var $d,s0;function qd(){return s0||(s0=1,$d=Kg().extend({implicit:[Gg(),Jg()],explicit:[Wg(),e0(),n0(),r0()]})),$d}var l0;function bA(){if(l0)return Mo;l0=1;const t=aa(),e=oa(),n=yA(),r=qd(),s=Object.prototype.hasOwnProperty,a=1,c=2,d=3,f=4,h=1,g=2,b=3,v=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,S=/[\x85\u2028\u2029]/,A=/[,\[\]{}]/,C=/^(?:!|!!|![0-9A-Za-z-]+!)$/,T=/^(?:!|[^,\[\]{}])(?:%[0-9a-f]{2}|[0-9a-z\-#;/?:@&=+$,_.!~*'()\[\]])*$/i;function D(x){return Object.prototype.toString.call(x)}function j(x){return x===10||x===13}function E(x){return x===9||x===32}function O(x){return x===9||x===32||x===10||x===13}function R(x){return x===44||x===91||x===93||x===123||x===125}function B(x){if(x>=48&&x<=57)return x-48;const V=x|32;return V>=97&&V<=102?V-97+10:-1}function M(x){return x===120?2:x===117?4:x===85?8:0}function z(x){return x>=48&&x<=57?x-48:-1}function F(x){switch(x){case 48:return"\0";case 97:return"\x07";case 98:return"\b";case 116:return" ";case 9:return" ";case 110:return`
|
|
17
|
+
`;case 118:return"\v";case 102:return"\f";case 114:return"\r";case 101:return"\x1B";case 32:return" ";case 34:return'"';case 47:return"/";case 92:return"\\";case 78:return"
";case 95:return" ";case 76:return"\u2028";case 80:return"\u2029";default:return""}}function X(x){return x<=65535?String.fromCharCode(x):String.fromCharCode((x-65536>>10)+55296,(x-65536&1023)+56320)}function W(x,V,pe){V==="__proto__"?Object.defineProperty(x,V,{configurable:!0,enumerable:!0,writable:!0,value:pe}):x[V]=pe}const G=new Array(256),we=new Array(256);for(let x=0;x<256;x++)G[x]=F(x)?1:0,we[x]=F(x);function ye(x,V){this.input=x,this.filename=V.filename||null,this.schema=V.schema||r,this.onWarning=V.onWarning||null,this.legacy=V.legacy||!1,this.json=V.json||!1,this.listener=V.listener||null,this.maxDepth=typeof V.maxDepth=="number"?V.maxDepth:100,this.maxTotalMergeKeys=typeof V.maxTotalMergeKeys=="number"?V.maxTotalMergeKeys:1e4,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=x.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.depth=0,this.totalMergeKeys=0,this.firstTabInLine=-1,this.documents=[],this.anchorMapTransactions=[]}function xe(x,V){const pe={name:x.filename,buffer:x.input.slice(0,-1),position:x.position,line:x.line,column:x.position-x.lineStart};return pe.snippet=n(pe),new e(V,pe)}function _(x,V){throw xe(x,V)}function ee(x,V){x.onWarning&&x.onWarning.call(null,xe(x,V))}function he(x,V,pe){const le=x.anchorMapTransactions;if(le.length!==0){const oe=le[le.length-1];s.call(oe,V)||(oe[V]={existed:s.call(x.anchorMap,V),value:x.anchorMap[V]})}x.anchorMap[V]=pe}function $(x){x.anchorMapTransactions.push(Object.create(null))}function te(x){const V=x.anchorMapTransactions.pop(),pe=x.anchorMapTransactions;if(pe.length===0)return;const le=pe[pe.length-1],oe=Object.keys(V);for(let k=0,J=oe.length;k<J;k+=1){const Z=oe[k];s.call(le,Z)||(le[Z]=V[Z])}}function L(x){const V=x.anchorMapTransactions.pop(),pe=Object.keys(V);for(let le=pe.length-1;le>=0;le-=1){const oe=V[pe[le]];oe.existed?x.anchorMap[pe[le]]=oe.value:delete x.anchorMap[pe[le]]}}function P(x){return{position:x.position,line:x.line,lineStart:x.lineStart,lineIndent:x.lineIndent,firstTabInLine:x.firstTabInLine,tag:x.tag,anchor:x.anchor,kind:x.kind,result:x.result}}function ue(x,V){x.position=V.position,x.line=V.line,x.lineStart=V.lineStart,x.lineIndent=V.lineIndent,x.firstTabInLine=V.firstTabInLine,x.tag=V.tag,x.anchor=V.anchor,x.kind=V.kind,x.result=V.result}const Se={YAML:function(V,pe,le){V.version!==null&&_(V,"duplication of %YAML directive"),le.length!==1&&_(V,"YAML directive accepts exactly one argument");const oe=/^([0-9]+)\.([0-9]+)$/.exec(le[0]);oe===null&&_(V,"ill-formed argument of the YAML directive");const k=parseInt(oe[1],10),J=parseInt(oe[2],10);k!==1&&_(V,"unacceptable YAML version of the document"),V.version=le[0],V.checkLineBreaks=J<2,J!==1&&J!==2&&ee(V,"unsupported YAML version of the document")},TAG:function(V,pe,le){let oe;le.length!==2&&_(V,"TAG directive accepts exactly two arguments");const k=le[0];oe=le[1],C.test(k)||_(V,"ill-formed tag handle (first argument) of the TAG directive"),s.call(V.tagMap,k)&&_(V,'there is a previously declared suffix for "'+k+'" tag handle'),T.test(oe)||_(V,"ill-formed tag prefix (second argument) of the TAG directive");try{oe=decodeURIComponent(oe)}catch{_(V,"tag prefix is malformed: "+oe)}V.tagMap[k]=oe}};function Ne(x,V,pe,le){if(V<pe){const oe=x.input.slice(V,pe);if(le)for(let k=0,J=oe.length;k<J;k+=1){const Z=oe.charCodeAt(k);Z===9||Z>=32&&Z<=1114111||_(x,"expected valid JSON character")}else v.test(oe)&&_(x,"the stream contains non-printable characters");x.result+=oe}}function Re(x){x.totalMergeKeys++,x.maxTotalMergeKeys!==-1&&x.totalMergeKeys>x.maxTotalMergeKeys&&_(x,"merge keys exceeded maxTotalMergeKeys ("+x.maxTotalMergeKeys+")")}function Be(x,V,pe,le){t.isObject(pe)||_(x,"cannot merge mappings; the provided source object is unacceptable"),Re(x);const oe=Object.keys(pe);for(let k=0,J=oe.length;k<J;k+=1){const Z=oe[k];Re(x),s.call(V,Z)||(W(V,Z,pe[Z]),le[Z]=!0)}}function Ze(x,V,pe,le,oe,k,J,Z,K){if(Array.isArray(oe)){oe=Array.prototype.slice.call(oe);for(let Q=0,Ae=oe.length;Q<Ae;Q+=1)Array.isArray(oe[Q])&&_(x,"nested arrays are not supported inside keys"),typeof oe=="object"&&D(oe[Q])==="[object Object]"&&(oe[Q]="[object Object]")}if(typeof oe=="object"&&D(oe)==="[object Object]"&&(oe="[object Object]"),oe=String(oe),V===null&&(V={}),le==="tag:yaml.org,2002:merge")if(Array.isArray(k)){k.length>100&&_(x,"abnormal merge sequence size");for(let Q=0,Ae=k.length;Q<Ae;Q+=1)Be(x,V,k[Q],pe)}else Be(x,V,k,pe);else!x.json&&!s.call(pe,oe)&&s.call(V,oe)&&(x.line=J||x.line,x.lineStart=Z||x.lineStart,x.position=K||x.position,_(x,"duplicated mapping key")),W(V,oe,k),delete pe[oe];return V}function _e(x){const V=x.input.charCodeAt(x.position);V===10?x.position++:V===13?(x.position++,x.input.charCodeAt(x.position)===10&&x.position++):_(x,"a line break is expected"),x.line+=1,x.lineStart=x.position,x.firstTabInLine=-1}function Ke(x,V,pe){let le=0,oe=x.input.charCodeAt(x.position);for(;oe!==0;){for(;E(oe);)oe===9&&x.firstTabInLine===-1&&(x.firstTabInLine=x.position),oe=x.input.charCodeAt(++x.position);if(V&&oe===35)do oe=x.input.charCodeAt(++x.position);while(oe!==10&&oe!==13&&oe!==0);if(j(oe))for(_e(x),oe=x.input.charCodeAt(x.position),le++,x.lineIndent=0;oe===32;)x.lineIndent++,oe=x.input.charCodeAt(++x.position);else break}return pe!==-1&&le!==0&&x.lineIndent<pe&&ee(x,"deficient indentation"),le}function gt(x){let V=x.position,pe=x.input.charCodeAt(V);return!!((pe===45||pe===46)&&pe===x.input.charCodeAt(V+1)&&pe===x.input.charCodeAt(V+2)&&(V+=3,pe=x.input.charCodeAt(V),pe===0||O(pe)))}function se(x,V){V===1?x.result+=" ":V>1&&(x.result+=t.repeat(`
|
|
18
|
+
`,V-1))}function de(x,V,pe){let le,oe,k,J,Z,K;const Q=x.kind,Ae=x.result;let fe=x.input.charCodeAt(x.position);if(O(fe)||R(fe)||fe===35||fe===38||fe===42||fe===33||fe===124||fe===62||fe===39||fe===34||fe===37||fe===64||fe===96)return!1;if(fe===63||fe===45){const ke=x.input.charCodeAt(x.position+1);if(O(ke)||pe&&R(ke))return!1}for(x.kind="scalar",x.result="",le=oe=x.position,k=!1;fe!==0;){if(fe===58){const ke=x.input.charCodeAt(x.position+1);if(O(ke)||pe&&R(ke))break}else if(fe===35){const ke=x.input.charCodeAt(x.position-1);if(O(ke))break}else{if(x.position===x.lineStart&>(x)||pe&&R(fe))break;if(j(fe))if(J=x.line,Z=x.lineStart,K=x.lineIndent,Ke(x,!1,-1),x.lineIndent>=V){k=!0,fe=x.input.charCodeAt(x.position);continue}else{x.position=oe,x.line=J,x.lineStart=Z,x.lineIndent=K;break}}k&&(Ne(x,le,oe,!1),se(x,x.line-J),le=oe=x.position,k=!1),E(fe)||(oe=x.position+1),fe=x.input.charCodeAt(++x.position)}return Ne(x,le,oe,!1),x.result?!0:(x.kind=Q,x.result=Ae,!1)}function ge(x,V){let pe,le,oe=x.input.charCodeAt(x.position);if(oe!==39)return!1;for(x.kind="scalar",x.result="",x.position++,pe=le=x.position;(oe=x.input.charCodeAt(x.position))!==0;)if(oe===39)if(Ne(x,pe,x.position,!0),oe=x.input.charCodeAt(++x.position),oe===39)pe=x.position,x.position++,le=x.position;else return!0;else j(oe)?(Ne(x,pe,le,!0),se(x,Ke(x,!1,V)),pe=le=x.position):x.position===x.lineStart&>(x)?_(x,"unexpected end of the document within a single quoted scalar"):(x.position++,E(oe)||(le=x.position));_(x,"unexpected end of the stream within a single quoted scalar")}function Te(x,V){let pe,le,oe,k=x.input.charCodeAt(x.position);if(k!==34)return!1;for(x.kind="scalar",x.result="",x.position++,pe=le=x.position;(k=x.input.charCodeAt(x.position))!==0;){if(k===34)return Ne(x,pe,x.position,!0),x.position++,!0;if(k===92){if(Ne(x,pe,x.position,!0),k=x.input.charCodeAt(++x.position),j(k))Ke(x,!1,V);else if(k<256&&G[k])x.result+=we[k],x.position++;else if((oe=M(k))>0){let J=oe,Z=0;for(;J>0;J--)k=x.input.charCodeAt(++x.position),(oe=B(k))>=0?Z=(Z<<4)+oe:_(x,"expected hexadecimal character");x.result+=X(Z),x.position++}else _(x,"unknown escape sequence");pe=le=x.position}else j(k)?(Ne(x,pe,le,!0),se(x,Ke(x,!1,V)),pe=le=x.position):x.position===x.lineStart&>(x)?_(x,"unexpected end of the document within a double quoted scalar"):(x.position++,E(k)||(le=x.position))}_(x,"unexpected end of the stream within a double quoted scalar")}function Ie(x,V){let pe=!0,le,oe,k;const J=x.tag;let Z;const K=x.anchor;let Q,Ae,fe,ke;const je=Object.create(null);let De,$e,ze,Je=x.input.charCodeAt(x.position);if(Je===91)Q=93,ke=!1,Z=[];else if(Je===123)Q=125,ke=!0,Z={};else return!1;for(x.anchor!==null&&he(x,x.anchor,Z),Je=x.input.charCodeAt(++x.position);Je!==0;){if(Ke(x,!0,V),Je=x.input.charCodeAt(x.position),Je===Q)return x.position++,x.tag=J,x.anchor=K,x.kind=ke?"mapping":"sequence",x.result=Z,!0;if(pe?Je===44&&_(x,"expected the node content, but found ','"):_(x,"missed comma between flow collection entries"),$e=De=ze=null,Ae=fe=!1,Je===63){const Rn=x.input.charCodeAt(x.position+1);O(Rn)&&(Ae=fe=!0,x.position++,Ke(x,!0,V))}le=x.line,oe=x.lineStart,k=x.position,lt(x,V,a,!1,!0),$e=x.tag,De=x.result,Ke(x,!0,V),Je=x.input.charCodeAt(x.position),(fe||x.line===le)&&Je===58&&(Ae=!0,Je=x.input.charCodeAt(++x.position),Ke(x,!0,V),lt(x,V,a,!1,!0),ze=x.result),ke?Ze(x,Z,je,$e,De,ze,le,oe,k):Ae?Z.push(Ze(x,null,je,$e,De,ze,le,oe,k)):Z.push(De),Ke(x,!0,V),Je=x.input.charCodeAt(x.position),Je===44?(pe=!0,Je=x.input.charCodeAt(++x.position)):pe=!1}_(x,"unexpected end of the stream within a flow collection")}function Xe(x,V){let pe,le=h,oe=!1,k=!1,J=V,Z=0,K=!1,Q,Ae=x.input.charCodeAt(x.position);if(Ae===124)pe=!1;else if(Ae===62)pe=!0;else return!1;for(x.kind="scalar",x.result="";Ae!==0;)if(Ae=x.input.charCodeAt(++x.position),Ae===43||Ae===45)h===le?le=Ae===43?b:g:_(x,"repeat of a chomping mode identifier");else if((Q=z(Ae))>=0)Q===0?_(x,"bad explicit indentation width of a block scalar; it cannot be less than one"):k?_(x,"repeat of an indentation width identifier"):(J=V+Q-1,k=!0);else break;if(E(Ae)){do Ae=x.input.charCodeAt(++x.position);while(E(Ae));if(Ae===35)do Ae=x.input.charCodeAt(++x.position);while(!j(Ae)&&Ae!==0)}for(;Ae!==0;){for(_e(x),x.lineIndent=0,Ae=x.input.charCodeAt(x.position);(!k||x.lineIndent<J)&&Ae===32;)x.lineIndent++,Ae=x.input.charCodeAt(++x.position);if(!k&&x.lineIndent>J&&(J=x.lineIndent),j(Ae)){Z++;continue}if(!k&&J===0&&_(x,"missing indentation for block scalar"),x.lineIndent<J){le===b?x.result+=t.repeat(`
|
|
19
|
+
`,oe?1+Z:Z):le===h&&oe&&(x.result+=`
|
|
20
|
+
`);break}pe?E(Ae)?(K=!0,x.result+=t.repeat(`
|
|
21
|
+
`,oe?1+Z:Z)):K?(K=!1,x.result+=t.repeat(`
|
|
22
|
+
`,Z+1)):Z===0?oe&&(x.result+=" "):x.result+=t.repeat(`
|
|
23
|
+
`,Z):x.result+=t.repeat(`
|
|
24
|
+
`,oe?1+Z:Z),oe=!0,k=!0,Z=0;const fe=x.position;for(;!j(Ae)&&Ae!==0;)Ae=x.input.charCodeAt(++x.position);Ne(x,fe,x.position,!1)}return!0}function ht(x,V){const pe=x.tag,le=x.anchor,oe=[];let k=!1;if(x.firstTabInLine!==-1)return!1;x.anchor!==null&&he(x,x.anchor,oe);let J=x.input.charCodeAt(x.position);for(;J!==0&&(x.firstTabInLine!==-1&&(x.position=x.firstTabInLine,_(x,"tab characters must not be used in indentation")),J===45);){const Z=x.input.charCodeAt(x.position+1);if(!O(Z))break;if(k=!0,x.position++,Ke(x,!0,-1)&&x.lineIndent<=V){oe.push(null),J=x.input.charCodeAt(x.position);continue}const K=x.line;if(lt(x,V,d,!1,!0),oe.push(x.result),Ke(x,!0,-1),J=x.input.charCodeAt(x.position),(x.line===K||x.lineIndent>V)&&J!==0)_(x,"bad indentation of a sequence entry");else if(x.lineIndent<V)break}return k?(x.tag=pe,x.anchor=le,x.kind="sequence",x.result=oe,!0):!1}function Pt(x,V,pe){let le,oe,k,J;const Z=x.tag,K=x.anchor,Q={},Ae=Object.create(null);let fe=null,ke=null,je=null,De=!1,$e=!1;if(x.firstTabInLine!==-1)return!1;x.anchor!==null&&he(x,x.anchor,Q);let ze=x.input.charCodeAt(x.position);for(;ze!==0;){!De&&x.firstTabInLine!==-1&&(x.position=x.firstTabInLine,_(x,"tab characters must not be used in indentation"));const Je=x.input.charCodeAt(x.position+1),Rn=x.line;if((ze===63||ze===58)&&O(Je))ze===63?(De&&(Ze(x,Q,Ae,fe,ke,null,oe,k,J),fe=ke=je=null),$e=!0,De=!0,le=!0):De?(De=!1,le=!0):_(x,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),x.position+=1,ze=Je;else{if(oe=x.line,k=x.lineStart,J=x.position,!lt(x,pe,c,!1,!0))break;if(x.line===Rn){for(ze=x.input.charCodeAt(x.position);E(ze);)ze=x.input.charCodeAt(++x.position);if(ze===58)ze=x.input.charCodeAt(++x.position),O(ze)||_(x,"a whitespace character is expected after the key-value separator within a block mapping"),De&&(Ze(x,Q,Ae,fe,ke,null,oe,k,J),fe=ke=je=null),$e=!0,De=!1,le=!1,fe=x.tag,ke=x.result;else if($e)_(x,"can not read an implicit mapping pair; a colon is missed");else return x.tag=Z,x.anchor=K,!0}else if($e)_(x,"can not read a block mapping entry; a multiline key may not be an implicit key");else return x.tag=Z,x.anchor=K,!0}if((x.line===Rn||x.lineIndent>V)&&(De&&(oe=x.line,k=x.lineStart,J=x.position),lt(x,V,f,!0,le)&&(De?ke=x.result:je=x.result),De||(Ze(x,Q,Ae,fe,ke,je,oe,k,J),fe=ke=je=null),Ke(x,!0,-1),ze=x.input.charCodeAt(x.position)),(x.line===Rn||x.lineIndent>V)&&ze!==0)_(x,"bad indentation of a mapping entry");else if(x.lineIndent<V)break}return De&&Ze(x,Q,Ae,fe,ke,null,oe,k,J),$e&&(x.tag=Z,x.anchor=K,x.kind="mapping",x.result=Q),$e}function rn(x){let V=!1,pe=!1,le,oe,k=x.input.charCodeAt(x.position);if(k!==33)return!1;x.tag!==null&&_(x,"duplication of a tag property"),k=x.input.charCodeAt(++x.position),k===60?(V=!0,k=x.input.charCodeAt(++x.position)):k===33?(pe=!0,le="!!",k=x.input.charCodeAt(++x.position)):le="!";let J=x.position;if(V){do k=x.input.charCodeAt(++x.position);while(k!==0&&k!==62);x.position<x.length?(oe=x.input.slice(J,x.position),k=x.input.charCodeAt(++x.position)):_(x,"unexpected end of the stream within a verbatim tag")}else{for(;k!==0&&!O(k);)k===33&&(pe?_(x,"tag suffix cannot contain exclamation marks"):(le=x.input.slice(J-1,x.position+1),C.test(le)||_(x,"named tag handle cannot contain such characters"),pe=!0,J=x.position+1)),k=x.input.charCodeAt(++x.position);oe=x.input.slice(J,x.position),A.test(oe)&&_(x,"tag suffix cannot contain flow indicator characters")}oe&&!T.test(oe)&&_(x,"tag name cannot contain such characters: "+oe);try{oe=decodeURIComponent(oe)}catch{_(x,"tag name is malformed: "+oe)}return V?x.tag=oe:s.call(x.tagMap,le)?x.tag=x.tagMap[le]+oe:le==="!"?x.tag="!"+oe:le==="!!"?x.tag="tag:yaml.org,2002:"+oe:_(x,'undeclared tag handle "'+le+'"'),!0}function sn(x){let V=x.input.charCodeAt(x.position);if(V!==38)return!1;x.anchor!==null&&_(x,"duplication of an anchor property"),V=x.input.charCodeAt(++x.position);const pe=x.position;for(;V!==0&&!O(V)&&!R(V);)V=x.input.charCodeAt(++x.position);return x.position===pe&&_(x,"name of an anchor node must contain at least one character"),x.anchor=x.input.slice(pe,x.position),!0}function qn(x){let V=x.input.charCodeAt(x.position);if(V!==42)return!1;V=x.input.charCodeAt(++x.position);const pe=x.position;for(;V!==0&&!O(V)&&!R(V);)V=x.input.charCodeAt(++x.position);x.position===pe&&_(x,"name of an alias node must contain at least one character");const le=x.input.slice(pe,x.position);return s.call(x.anchorMap,le)||_(x,'unidentified alias "'+le+'"'),x.result=x.anchorMap[le],Ke(x,!0,-1),!0}function Cn(x,V,pe,le){const oe=P(x);return $(x),ue(x,V),x.tag=null,x.anchor=null,x.kind=null,x.result=null,Pt(x,pe,le)&&x.kind==="mapping"?(te(x),!0):(L(x),ue(x,oe),!1)}function lt(x,V,pe,le,oe){let k,J,Z=1,K=!1,Q=!1,Ae=null,fe,ke,je;x.depth>=x.maxDepth&&_(x,"nesting exceeded maxDepth ("+x.maxDepth+")"),x.depth+=1,x.listener!==null&&x.listener("open",x),x.tag=null,x.anchor=null,x.kind=null,x.result=null;const De=k=J=f===pe||d===pe;if(le&&Ke(x,!0,-1)&&(K=!0,x.lineIndent>V?Z=1:x.lineIndent===V?Z=0:x.lineIndent<V&&(Z=-1)),Z===1)for(;;){const $e=x.input.charCodeAt(x.position),ze=P(x);if(K&&($e===33&&x.tag!==null||$e===38&&x.anchor!==null)||!rn(x)&&!sn(x))break;Ae===null&&(Ae=ze),Ke(x,!0,-1)?(K=!0,J=De,x.lineIndent>V?Z=1:x.lineIndent===V?Z=0:x.lineIndent<V&&(Z=-1)):J=!1}if(J&&(J=K||oe),Z===1||f===pe)if(a===pe||c===pe?ke=V:ke=V+1,je=x.position-x.lineStart,Z===1)if(J&&(ht(x,je)||Pt(x,je,ke))||Ie(x,ke))Q=!0;else{const $e=x.input.charCodeAt(x.position);Ae!==null&&De&&!J&&$e!==124&&$e!==62&&Cn(x,Ae,Ae.position-Ae.lineStart,ke)||k&&Xe(x,ke)||ge(x,ke)||Te(x,ke)?Q=!0:qn(x)?(Q=!0,(x.tag!==null||x.anchor!==null)&&_(x,"alias node should not have any properties")):de(x,ke,a===pe)&&(Q=!0,x.tag===null&&(x.tag="?")),x.anchor!==null&&he(x,x.anchor,x.result)}else Z===0&&(Q=J&&ht(x,je));if(x.tag===null)x.anchor!==null&&he(x,x.anchor,x.result);else if(x.tag==="?"){x.result!==null&&x.kind!=="scalar"&&_(x,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+x.kind+'"');for(let $e=0,ze=x.implicitTypes.length;$e<ze;$e+=1)if(fe=x.implicitTypes[$e],fe.resolve(x.result)){x.result=fe.construct(x.result),x.tag=fe.tag,x.anchor!==null&&he(x,x.anchor,x.result);break}}else if(x.tag!=="!"){if(s.call(x.typeMap[x.kind||"fallback"],x.tag))fe=x.typeMap[x.kind||"fallback"][x.tag];else{fe=null;const $e=x.typeMap.multi[x.kind||"fallback"];for(let ze=0,Je=$e.length;ze<Je;ze+=1)if(x.tag.slice(0,$e[ze].tag.length)===$e[ze].tag){fe=$e[ze];break}}fe||_(x,"unknown tag !<"+x.tag+">"),x.result!==null&&fe.kind!==x.kind&&_(x,"unacceptable node kind for !<"+x.tag+'> tag; it should be "'+fe.kind+'", not "'+x.kind+'"'),fe.resolve(x.result,x.tag)?(x.result=fe.construct(x.result,x.tag),x.anchor!==null&&he(x,x.anchor,x.result)):_(x,"cannot resolve a node with !<"+x.tag+"> explicit tag")}return x.listener!==null&&x.listener("close",x),x.depth-=1,x.tag!==null||x.anchor!==null||Q}function pi(x){const V=x.position;let pe=!1,le;for(x.version=null,x.checkLineBreaks=x.legacy,x.tagMap=Object.create(null),x.anchorMap=Object.create(null);(le=x.input.charCodeAt(x.position))!==0&&(Ke(x,!0,-1),le=x.input.charCodeAt(x.position),!(x.lineIndent>0||le!==37));){pe=!0,le=x.input.charCodeAt(++x.position);let oe=x.position;for(;le!==0&&!O(le);)le=x.input.charCodeAt(++x.position);const k=x.input.slice(oe,x.position),J=[];for(k.length<1&&_(x,"directive name must not be less than one character in length");le!==0;){for(;E(le);)le=x.input.charCodeAt(++x.position);if(le===35){do le=x.input.charCodeAt(++x.position);while(le!==0&&!j(le));break}if(j(le))break;for(oe=x.position;le!==0&&!O(le);)le=x.input.charCodeAt(++x.position);J.push(x.input.slice(oe,x.position))}le!==0&&_e(x),s.call(Se,k)?Se[k](x,k,J):ee(x,'unknown document directive "'+k+'"')}if(Ke(x,!0,-1),x.lineIndent===0&&x.input.charCodeAt(x.position)===45&&x.input.charCodeAt(x.position+1)===45&&x.input.charCodeAt(x.position+2)===45?(x.position+=3,Ke(x,!0,-1)):pe&&_(x,"directives end mark is expected"),lt(x,x.lineIndent-1,f,!1,!0),Ke(x,!0,-1),x.checkLineBreaks&&S.test(x.input.slice(V,x.position))&&ee(x,"non-ASCII line breaks are interpreted as content"),x.documents.push(x.result),x.position===x.lineStart&>(x)){x.input.charCodeAt(x.position)===46&&(x.position+=3,Ke(x,!0,-1));return}x.position<x.length-1&&_(x,"end of the stream or a document separator is expected")}function Mn(x,V){x=String(x),V=V||{},x.length!==0&&(x.charCodeAt(x.length-1)!==10&&x.charCodeAt(x.length-1)!==13&&(x+=`
|
|
25
|
+
`),x.charCodeAt(0)===65279&&(x=x.slice(1)));const pe=new ye(x,V),le=x.indexOf("\0");for(le!==-1&&(pe.position=le,_(pe,"null byte is not allowed in input")),pe.input+="\0";pe.input.charCodeAt(pe.position)===32;)pe.lineIndent+=1,pe.position+=1;for(;pe.position<pe.length-1;)pi(pe);return pe.documents}function Jn(x,V,pe){V!==null&&typeof V=="object"&&typeof pe>"u"&&(pe=V,V=null);const le=Mn(x,pe);if(typeof V!="function")return le;for(let oe=0,k=le.length;oe<k;oe+=1)V(le[oe])}function Tt(x,V){const pe=Mn(x,V);if(pe.length!==0){if(pe.length===1)return pe[0];throw new e("expected a single document in the stream, but found more")}}return Mo.loadAll=Jn,Mo.load=Tt,Mo}var zd={},a0;function xA(){if(a0)return zd;a0=1;const t=aa(),e=oa(),n=qd(),r=Object.prototype.toString,s=Object.prototype.hasOwnProperty,a=65279,c=9,d=10,f=13,h=32,g=33,b=34,v=35,S=37,A=38,C=39,T=42,D=44,j=45,E=58,O=61,R=62,B=63,M=64,z=91,F=93,X=96,W=123,G=124,we=125,ye={};ye[0]="\\0",ye[7]="\\a",ye[8]="\\b",ye[9]="\\t",ye[10]="\\n",ye[11]="\\v",ye[12]="\\f",ye[13]="\\r",ye[27]="\\e",ye[34]='\\"',ye[92]="\\\\",ye[133]="\\N",ye[160]="\\_",ye[8232]="\\L",ye[8233]="\\P";const xe=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],_=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function ee(k,J){if(J===null)return{};const Z={},K=Object.keys(J);for(let Q=0,Ae=K.length;Q<Ae;Q+=1){let fe=K[Q],ke=String(J[fe]);fe.slice(0,2)==="!!"&&(fe="tag:yaml.org,2002:"+fe.slice(2));const je=k.compiledTypeMap.fallback[fe];je&&s.call(je.styleAliases,ke)&&(ke=je.styleAliases[ke]),Z[fe]=ke}return Z}function he(k){let J,Z;const K=k.toString(16).toUpperCase();if(k<=255)J="x",Z=2;else if(k<=65535)J="u",Z=4;else if(k<=4294967295)J="U",Z=8;else throw new e("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+J+t.repeat("0",Z-K.length)+K}const $=1,te=2;function L(k){this.schema=k.schema||n,this.indent=Math.max(1,k.indent||2),this.noArrayIndent=k.noArrayIndent||!1,this.skipInvalid=k.skipInvalid||!1,this.flowLevel=t.isNothing(k.flowLevel)?-1:k.flowLevel,this.styleMap=ee(this.schema,k.styles||null),this.sortKeys=k.sortKeys||!1,this.lineWidth=k.lineWidth||80,this.noRefs=k.noRefs||!1,this.noCompatMode=k.noCompatMode||!1,this.condenseFlow=k.condenseFlow||!1,this.quotingType=k.quotingType==='"'?te:$,this.forceQuotes=k.forceQuotes||!1,this.replacer=typeof k.replacer=="function"?k.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function P(k,J){const Z=t.repeat(" ",J);let K=0,Q="";const Ae=k.length;for(;K<Ae;){let fe;const ke=k.indexOf(`
|
|
26
|
+
`,K);ke===-1?(fe=k.slice(K),K=Ae):(fe=k.slice(K,ke+1),K=ke+1),fe.length&&fe!==`
|
|
27
|
+
`&&(Q+=Z),Q+=fe}return Q}function ue(k,J){return`
|
|
28
|
+
`+t.repeat(" ",k.indent*J)}function Se(k,J){for(let Z=0,K=k.implicitTypes.length;Z<K;Z+=1)if(k.implicitTypes[Z].resolve(J))return!0;return!1}function Ne(k){return k===h||k===c}function Re(k){return k>=32&&k<=126||k>=161&&k<=55295&&k!==8232&&k!==8233||k>=57344&&k<=65533&&k!==a||k>=65536&&k<=1114111}function Be(k){return Re(k)&&k!==a&&k!==f&&k!==d}function Ze(k,J,Z){const K=Be(k),Q=K&&!Ne(k);return(Z?K:K&&k!==D&&k!==z&&k!==F&&k!==W&&k!==we)&&k!==v&&!(J===E&&!Q)||Be(J)&&!Ne(J)&&k===v||J===E&&Q}function _e(k){return Re(k)&&k!==a&&!Ne(k)&&k!==j&&k!==B&&k!==E&&k!==D&&k!==z&&k!==F&&k!==W&&k!==we&&k!==v&&k!==A&&k!==T&&k!==g&&k!==G&&k!==O&&k!==R&&k!==C&&k!==b&&k!==S&&k!==M&&k!==X}function Ke(k){return!Ne(k)&&k!==E}function gt(k,J){const Z=k.charCodeAt(J);let K;return Z>=55296&&Z<=56319&&J+1<k.length&&(K=k.charCodeAt(J+1),K>=56320&&K<=57343)?(Z-55296)*1024+K-56320+65536:Z}function se(k){return/^\n* /.test(k)}const de=1,ge=2,Te=3,Ie=4,Xe=5;function ht(k,J,Z,K,Q,Ae,fe,ke){let je,De=0,$e=null,ze=!1,Je=!1;const Rn=K!==-1;let Dn=-1,Kt=_e(gt(k,0))&&Ke(gt(k,k.length-1));if(J||fe)for(je=0;je<k.length;De>=65536?je+=2:je++){if(De=gt(k,je),!Re(De))return Xe;Kt=Kt&&Ze(De,$e,ke),$e=De}else{for(je=0;je<k.length;De>=65536?je+=2:je++){if(De=gt(k,je),De===d)ze=!0,Rn&&(Je=Je||je-Dn-1>K&&k[Dn+1]!==" ",Dn=je);else if(!Re(De))return Xe;Kt=Kt&&Ze(De,$e,ke),$e=De}Je=Je||Rn&&je-Dn-1>K&&k[Dn+1]!==" "}return!ze&&!Je?Kt&&!fe&&!Q(k)?de:Ae===te?Xe:ge:Z>9&&se(k)?Xe:fe?Ae===te?Xe:ge:Je?Ie:Te}function Pt(k,J,Z,K,Q){k.dump=(function(){if(J.length===0)return k.quotingType===te?'""':"''";if(!k.noCompatMode&&(xe.indexOf(J)!==-1||_.test(J)))return k.quotingType===te?'"'+J+'"':"'"+J+"'";const Ae=k.indent*Math.max(1,Z),fe=k.lineWidth===-1?-1:Math.max(Math.min(k.lineWidth,40),k.lineWidth-Ae),ke=K||k.flowLevel>-1&&Z>=k.flowLevel;function je(De){return Se(k,De)}switch(ht(J,ke,k.indent,fe,je,k.quotingType,k.forceQuotes&&!K,Q)){case de:return J;case ge:return"'"+J.replace(/'/g,"''")+"'";case Te:return"|"+rn(J,k.indent)+sn(P(J,Ae));case Ie:return">"+rn(J,k.indent)+sn(P(qn(J,fe),Ae));case Xe:return'"'+lt(J)+'"';default:throw new e("impossible error: invalid scalar style")}})()}function rn(k,J){const Z=se(k)?String(J):"",K=k[k.length-1]===`
|
|
29
|
+
`,Ae=K&&(k[k.length-2]===`
|
|
30
|
+
`||k===`
|
|
31
|
+
`)?"+":K?"":"-";return Z+Ae+`
|
|
32
|
+
`}function sn(k){return k[k.length-1]===`
|
|
33
|
+
`?k.slice(0,-1):k}function qn(k,J){const Z=/(\n+)([^\n]*)/g;let K=(function(){let ke=k.indexOf(`
|
|
34
|
+
`);return ke=ke!==-1?ke:k.length,Z.lastIndex=ke,Cn(k.slice(0,ke),J)})(),Q=k[0]===`
|
|
35
|
+
`||k[0]===" ",Ae,fe;for(;fe=Z.exec(k);){const ke=fe[1],je=fe[2];Ae=je[0]===" ",K+=ke+(!Q&&!Ae&&je!==""?`
|
|
36
|
+
`:"")+Cn(je,J),Q=Ae}return K}function Cn(k,J){if(k===""||k[0]===" ")return k;const Z=/ [^ ]/g;let K,Q=0,Ae,fe=0,ke=0,je="";for(;K=Z.exec(k);)ke=K.index,ke-Q>J&&(Ae=fe>Q?fe:ke,je+=`
|
|
37
|
+
`+k.slice(Q,Ae),Q=Ae+1),fe=ke;return je+=`
|
|
38
|
+
`,k.length-Q>J&&fe>Q?je+=k.slice(Q,fe)+`
|
|
39
|
+
`+k.slice(fe+1):je+=k.slice(Q),je.slice(1)}function lt(k){let J="",Z=0;for(let K=0;K<k.length;Z>=65536?K+=2:K++){Z=gt(k,K);const Q=ye[Z];!Q&&Re(Z)?(J+=k[K],Z>=65536&&(J+=k[K+1])):J+=Q||he(Z)}return J}function pi(k,J,Z){let K="";const Q=k.tag;for(let Ae=0,fe=Z.length;Ae<fe;Ae+=1){let ke=Z[Ae];k.replacer&&(ke=k.replacer.call(Z,String(Ae),ke)),(V(k,J,ke,!1,!1)||typeof ke>"u"&&V(k,J,null,!1,!1))&&(K!==""&&(K+=","+(k.condenseFlow?"":" ")),K+=k.dump)}k.tag=Q,k.dump="["+K+"]"}function Mn(k,J,Z,K){let Q="";const Ae=k.tag;for(let fe=0,ke=Z.length;fe<ke;fe+=1){let je=Z[fe];k.replacer&&(je=k.replacer.call(Z,String(fe),je)),(V(k,J+1,je,!0,!0,!1,!0)||typeof je>"u"&&V(k,J+1,null,!0,!0,!1,!0))&&((!K||Q!=="")&&(Q+=ue(k,J)),k.dump&&d===k.dump.charCodeAt(0)?Q+="-":Q+="- ",Q+=k.dump)}k.tag=Ae,k.dump=Q||"[]"}function Jn(k,J,Z){let K="";const Q=k.tag,Ae=Object.keys(Z);for(let fe=0,ke=Ae.length;fe<ke;fe+=1){let je="";K!==""&&(je+=", "),k.condenseFlow&&(je+='"');const De=Ae[fe];let $e=Z[De];k.replacer&&($e=k.replacer.call(Z,De,$e)),V(k,J,De,!1,!1)&&(k.dump.length>1024&&(je+="? "),je+=k.dump+(k.condenseFlow?'"':"")+":"+(k.condenseFlow?"":" "),V(k,J,$e,!1,!1)&&(je+=k.dump,K+=je))}k.tag=Q,k.dump="{"+K+"}"}function Tt(k,J,Z,K){let Q="";const Ae=k.tag,fe=Object.keys(Z);if(k.sortKeys===!0)fe.sort();else if(typeof k.sortKeys=="function")fe.sort(k.sortKeys);else if(k.sortKeys)throw new e("sortKeys must be a boolean or a function");for(let ke=0,je=fe.length;ke<je;ke+=1){let De="";(!K||Q!=="")&&(De+=ue(k,J));const $e=fe[ke];let ze=Z[$e];if(k.replacer&&(ze=k.replacer.call(Z,$e,ze)),!V(k,J+1,$e,!0,!0,!0))continue;const Je=k.tag!==null&&k.tag!=="?"||k.dump&&k.dump.length>1024;Je&&(k.dump&&d===k.dump.charCodeAt(0)?De+="?":De+="? "),De+=k.dump,Je&&(De+=ue(k,J)),V(k,J+1,ze,!0,Je)&&(k.dump&&d===k.dump.charCodeAt(0)?De+=":":De+=": ",De+=k.dump,Q+=De)}k.tag=Ae,k.dump=Q||"{}"}function x(k,J,Z){const K=Z?k.explicitTypes:k.implicitTypes;for(let Q=0,Ae=K.length;Q<Ae;Q+=1){const fe=K[Q];if((fe.instanceOf||fe.predicate)&&(!fe.instanceOf||typeof J=="object"&&J instanceof fe.instanceOf)&&(!fe.predicate||fe.predicate(J))){if(Z?fe.multi&&fe.representName?k.tag=fe.representName(J):k.tag=fe.tag:k.tag="?",fe.represent){const ke=k.styleMap[fe.tag]||fe.defaultStyle;let je;if(r.call(fe.represent)==="[object Function]")je=fe.represent(J,ke);else if(s.call(fe.represent,ke))je=fe.represent[ke](J,ke);else throw new e("!<"+fe.tag+'> tag resolver accepts not "'+ke+'" style');k.dump=je}return!0}}return!1}function V(k,J,Z,K,Q,Ae,fe){k.tag=null,k.dump=Z,x(k,Z,!1)||x(k,Z,!0);const ke=r.call(k.dump),je=K;K&&(K=k.flowLevel<0||k.flowLevel>J);const De=ke==="[object Object]"||ke==="[object Array]";let $e,ze;if(De&&($e=k.duplicates.indexOf(Z),ze=$e!==-1),(k.tag!==null&&k.tag!=="?"||ze||k.indent!==2&&J>0)&&(Q=!1),ze&&k.usedDuplicates[$e])k.dump="*ref_"+$e;else{if(De&&ze&&!k.usedDuplicates[$e]&&(k.usedDuplicates[$e]=!0),ke==="[object Object]")K&&Object.keys(k.dump).length!==0?(Tt(k,J,k.dump,Q),ze&&(k.dump="&ref_"+$e+k.dump)):(Jn(k,J,k.dump),ze&&(k.dump="&ref_"+$e+" "+k.dump));else if(ke==="[object Array]")K&&k.dump.length!==0?(k.noArrayIndent&&!fe&&J>0?Mn(k,J-1,k.dump,Q):Mn(k,J,k.dump,Q),ze&&(k.dump="&ref_"+$e+k.dump)):(pi(k,J,k.dump),ze&&(k.dump="&ref_"+$e+" "+k.dump));else if(ke==="[object String]")k.tag!=="?"&&Pt(k,k.dump,J,Ae,je);else{if(ke==="[object Undefined]")return!1;if(k.skipInvalid)return!1;throw new e("unacceptable kind of an object to dump "+ke)}if(k.tag!==null&&k.tag!=="?"){let Je=encodeURI(k.tag[0]==="!"?k.tag.slice(1):k.tag).replace(/!/g,"%21");k.tag[0]==="!"?Je="!"+Je:Je.slice(0,18)==="tag:yaml.org,2002:"?Je="!!"+Je.slice(18):Je="!<"+Je+">",k.dump=Je+" "+k.dump}}return!0}function pe(k,J){const Z=[],K=[];le(k,Z,K);const Q=K.length;for(let Ae=0;Ae<Q;Ae+=1)J.duplicates.push(Z[K[Ae]]);J.usedDuplicates=new Array(Q)}function le(k,J,Z){if(k!==null&&typeof k=="object"){const K=J.indexOf(k);if(K!==-1)Z.indexOf(K)===-1&&Z.push(K);else if(J.push(k),Array.isArray(k))for(let Q=0,Ae=k.length;Q<Ae;Q+=1)le(k[Q],J,Z);else{const Q=Object.keys(k);for(let Ae=0,fe=Q.length;Ae<fe;Ae+=1)le(k[Q[Ae]],J,Z)}}}function oe(k,J){J=J||{};const Z=new L(J);Z.noRefs||pe(k,Z);let K=k;return Z.replacer&&(K=Z.replacer.call({"":K},"",K)),V(Z,0,K,!0,!0)?Z.dump+`
|
|
40
|
+
`:""}return zd.dump=oe,zd}var o0;function vA(){if(o0)return vn;o0=1;const t=bA(),e=xA();function n(r,s){return function(){throw new Error("Function yaml."+r+" is removed in js-yaml 4. Use yaml."+s+" instead, which is now safe by default.")}}return vn.Type=Nn(),vn.Schema=Ng(),vn.FAILSAFE_SCHEMA=_g(),vn.JSON_SCHEMA=Vg(),vn.CORE_SCHEMA=Kg(),vn.DEFAULT_SCHEMA=qd(),vn.load=t.load,vn.loadAll=t.loadAll,vn.dump=e.dump,vn.YAMLException=oa(),vn.types={binary:Wg(),float:Ug(),map:Rg(),null:Bg(),pairs:n0(),set:r0(),timestamp:Gg(),bool:qg(),int:Hg(),merge:Jg(),omap:e0(),seq:Og(),str:jg()},vn.safeLoad=n("safeLoad","load"),vn.safeLoadAll=n("safeLoadAll","loadAll"),vn.safeDump=n("safeDump","dump"),vn}var wA=vA();const SA=gA(wA),{Type:gD,Schema:yD,FAILSAFE_SCHEMA:bD,JSON_SCHEMA:xD,CORE_SCHEMA:vD,DEFAULT_SCHEMA:wD,load:AA,loadAll:SD,dump:kA,YAMLException:AD,types:kD,safeLoad:CD,safeLoadAll:ND,safeDump:TD}=SA;let zi=class z2{static async parseSpec(e){let n;if(typeof e=="string"){const r=e.trim();try{n=JSON.parse(r)}catch{try{n=AA(r)}catch{throw new Error("Invalid OpenAPI specification format")}}}else n=e;if(!n.openapi||!n.info||!n.paths)throw new Error("Invalid OpenAPI specification: missing required fields");return n}static getHttpMethods(e){return["get","post","put","delete","patch","options","head","trace"].filter(r=>e[r])}static decodePointerToken(e){return decodeURIComponent(e).replace(/~1/g,"/").replace(/~0/g,"~")}static encodePointerToken(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}static resolveReference(e,n){if(!n.startsWith("#/"))throw new Error(`Only local references are supported synchronously; bundle external references first: ${n}`);const r=n.substring(2).split("/").map(z2.decodePointerToken);let s=e;for(const a of r){if(s===null||typeof s!="object"||!(a in s))throw new Error(`Reference not found: ${n}`);s=s[a]}return s}static isReference(e){return!!e&&typeof e=="object"&&"$ref"in e&&typeof e.$ref=="string"}};class Ln{static async parseSpec(e){return zi.parseSpec(e)}static getHttpMethods(e){return zi.getHttpMethods(e)}static getMethodColor(e,n){const a=n==="dark"?{get:"text-blue-300 bg-blue-900/30 border-blue-700",post:"text-green-300 bg-green-900/30 border-green-700",put:"text-orange-300 bg-orange-900/30 border-orange-700",delete:"text-red-300 bg-red-900/30 border-red-700",patch:"text-purple-300 bg-purple-900/30 border-purple-700",options:"text-cyan-100 bg-cyan-800/50 border-cyan-500",head:"text-gray-300 bg-gray-700/50 border-gray-600",trace:"text-gray-300 bg-gray-700/50 border-gray-600"}:{get:"text-blue-600 bg-blue-50 border-blue-200",post:"text-green-600 bg-green-50 border-green-200",put:"text-orange-600 bg-orange-50 border-orange-200",delete:"text-red-600 bg-red-50 border-red-200",patch:"text-purple-600 bg-purple-50 border-purple-200",options:"text-gray-600 bg-gray-50 border-gray-200",head:"text-gray-600 bg-gray-50 border-gray-200",trace:"text-gray-600 bg-gray-50 border-gray-200"},c=n==="dark"?"text-gray-300 bg-gray-700/50 border-gray-600":"text-gray-600 bg-gray-50 border-gray-200";return a[e.toLowerCase()]||c}static decodePointerToken(e){return zi.decodePointerToken(e)}static encodePointerToken(e){return zi.encodePointerToken(e)}static resolveReference(e,n){return zi.resolveReference(e,n)}static isReference(e){return zi.isReference(e)}}const CA=({spec:t,onEndpointSelect:e,selectedEndpoint:n=null,theme:r="light",expandedTags:s,onExpandedTagsChange:a,messages:c})=>{const[d,f]=I.useState(""),[h,g]=I.useState(new Set(s?.length?s:["default"])),b=I.useId(),v=I.useRef(null),S=s?new Set(s):h;I.useEffect(()=>{n&&requestAnimationFrame(()=>{v.current?.querySelector('[data-selected-endpoint="true"]')?.scrollIntoView({block:"nearest"})})},[n]);const A=r==="dark"?"bg-gray-900 border-r border-gray-800 text-white":"bg-white border-r border-gray-200 text-gray-700",C=r==="dark"?"bg-gray-800 border-gray-700 text-white placeholder-gray-400 focus:ring-blue-500 focus:border-blue-500 focus:ring-1":"border-gray-300 text-gray-700 placeholder-gray-400 focus:ring-blue-500 focus:border-blue-500 focus:ring-1",T=r==="dark"?"text-gray-300":"text-gray-500",D=r==="dark"?"bg-gray-800/50 border-gray-700 text-white":"bg-gray-50 border-gray-100 text-gray-700",j=z=>{const F="text-xs font-bold px-2 py-0.5 rounded border",X={dark:{get:"bg-blue-900/30 border-blue-700 text-blue-200",post:"bg-green-900/30 border-green-700 text-green-200",put:"bg-yellow-900/30 border-yellow-700 text-yellow-200",patch:"bg-purple-900/30 border-purple-700 text-purple-200",delete:"bg-red-900/30 border-red-700 text-red-200",default:"bg-gray-800/50 border-gray-700 text-gray-200"},light:{get:"bg-blue-50 border-blue-200 text-blue-700",post:"bg-green-50 border-green-200 text-green-700",put:"bg-yellow-50 border-yellow-200 text-yellow-700",patch:"bg-purple-50 border-purple-200 text-purple-700",delete:"bg-red-50 border-red-200 text-red-700",default:"bg-gray-100 border-gray-200 text-gray-600"}},W=r==="dark"?X.dark:X.light;return`${F} ${W[z.toLowerCase()]||W.default}`},E=Object.entries(t.paths).reduce((z,[F,X])=>(Ln.getHttpMethods(X).forEach(W=>{const G=X[W];(G?.tags||["default"]).forEach(ye=>{z[ye]||(z[ye]=[]),z[ye].push({path:F,method:W,operation:G})})}),z),{}),O=d.trim().toLowerCase(),R=O.length>0,B=Object.entries(E).reduce((z,[F,X])=>{const W=X.filter(G=>`${G.method} ${G.path} ${G.operation?.summary||""} ${F}`.toLowerCase().includes(O));return W.length&&(z[F]=W),z},{}),M=z=>{const F=new Set(S);F.has(z)?F.delete(z):F.add(z),s||g(F),a?.([...F])};return p.jsxs("div",{ref:v,className:`flex h-full w-full min-w-0 flex-col ${A}`,style:{backgroundColor:"var(--flexdoc-sidebar-bg)",color:"var(--flexdoc-sidebar-text)"},children:[p.jsxs("div",{className:`border-b p-4 ${r==="dark"?"border-gray-800":"border-gray-100"}`,children:[p.jsx("label",{className:"sr-only",htmlFor:b,children:c?.searchEndpoints||"Search endpoints"}),p.jsxs("div",{className:"relative",children:[p.jsx(gg,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-gray-400"}),p.jsx("input",{id:b,type:"search",placeholder:c?.searchEndpointsPlaceholder||"Search endpoints...",value:d,onChange:z=>f(z.target.value),className:`w-full rounded-lg border py-2 pl-10 pr-4 text-sm transition-colors ${C}`})]})]}),p.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto overscroll-contain",children:p.jsxs("div",{className:"p-4",children:[p.jsxs("div",{className:"mb-6",children:[p.jsx("h3",{className:`mb-2 text-xs font-semibold uppercase tracking-wider ${T}`,children:c?.apiInformation||"API Information"}),p.jsxs("div",{className:"space-y-3",children:[p.jsxs("div",{className:`rounded-lg border p-3 ${D}`,children:[p.jsx("h4",{className:`truncate font-medium ${r==="dark"?"text-white":"text-gray-900"}`,children:t.info.title}),p.jsxs("p",{className:`text-sm ${r==="dark"?"text-gray-300":"text-gray-600"}`,children:[c?.versionLabel||"Version"," ",t.info.version]})]}),t.servers&&t.servers.length>0&&p.jsxs("div",{className:`rounded-lg border p-3 ${D}`,children:[p.jsxs("div",{className:"mb-2 flex items-center gap-2",children:[p.jsx(yg,{className:"h-4 w-4 text-gray-400"}),p.jsx("span",{className:"text-sm font-medium",children:c?.servers||"Servers"})]}),p.jsx("div",{className:"space-y-2",children:t.servers.map((z,F)=>p.jsxs("div",{className:"min-w-0 text-sm",children:[p.jsx("code",{className:`block max-w-full overflow-x-auto rounded px-1.5 py-0.5 text-xs ${r==="dark"?"bg-gray-700/50 text-blue-200":"bg-gray-100 text-blue-600"}`,children:z.url}),z.description&&p.jsx("p",{className:`mt-1.5 ${r==="dark"?"text-gray-300":"text-gray-600"}`,children:z.description})]},`${z.url}:${F}`))})]})]})]}),p.jsxs("div",{children:[p.jsx("h3",{className:`mb-3 text-xs font-semibold uppercase tracking-wider ${T}`,children:c?.endpoints||"Endpoints"}),Object.keys(B).length===0&&p.jsx("p",{className:`px-2 py-4 text-sm ${T}`,children:c?.noEndpointsMatch||"No endpoints match your search."}),Object.entries(B).map(([z,F])=>{const X=R||S.has(z);return p.jsxs("div",{className:"mb-4",children:[p.jsxs("button",{type:"button","aria-expanded":X,onClick:()=>M(z),className:`flex min-h-11 w-full items-center gap-2 rounded-lg p-2 text-left transition-colors ${r==="dark"?"hover:bg-gray-800/50 text-white":"hover:bg-gray-50 text-gray-700"}`,children:[X?p.jsx(hg,{className:"h-4 w-4 shrink-0 text-gray-400"}):p.jsx(pg,{className:"h-4 w-4 shrink-0 text-gray-400"}),p.jsx(xg,{className:"h-4 w-4 shrink-0 text-gray-400"}),p.jsx("span",{className:"min-w-0 truncate text-sm font-medium",children:z==="default"?c?.generalTag||"General":z}),p.jsx("span",{className:`ml-auto shrink-0 rounded-full px-2 py-0.5 text-xs ${r==="dark"?"bg-gray-800 text-white":"bg-gray-100 text-gray-500"}`,children:F.length})]}),X&&p.jsx("div",{className:"ml-4 mt-1.5 space-y-1.5 sm:ml-6",children:F.map(({path:W,method:G,operation:we})=>{const ye=n?.path===W&&n?.method===G;return p.jsxs("button",{type:"button","data-selected-endpoint":ye?"true":void 0,onClick:()=>e(W,G),className:`mb-2 min-h-11 w-full rounded-lg border p-2 text-left transition-all ${ye?r==="dark"?"bg-blue-900/20 border-blue-800/50 shadow-sm":"bg-blue-50 border-blue-100 shadow-sm":r==="dark"?"hover:bg-gray-800/50 border-transparent hover:border-gray-700":"hover:bg-gray-50 border-transparent hover:border-gray-100"}`,style:ye?{color:"var(--flexdoc-sidebar-active-text)"}:void 0,children:[p.jsx("div",{className:"mb-1 flex items-center gap-2",children:p.jsx("span",{className:j(G),children:G.toUpperCase()})}),p.jsx("div",{className:`break-all font-mono text-sm ${ye?r==="dark"?"text-blue-300":"text-blue-600":r==="dark"?"text-gray-300":"text-gray-800"}`,children:W}),we?.summary&&p.jsx("div",{className:`mt-1 text-xs ${r==="dark"?"text-gray-400":"text-gray-600"}`,children:we.summary})]},`${G}-${W}`)})})]},z)})]})]})})]})},Cs=["parameters","requestBody","responses","tryIt","codeSamples"],Hd={all:Cs,none:[],minimal:[],documentation:["parameters","requestBody","responses"],interactive:["parameters","requestBody","tryIt","codeSamples"]},NA=new Set(["minimal","documentation","interactive"]),c0=new Set(Cs),TA=new Set(Object.keys(Hd)),jA=new Set(["light","dark","high-contrast"]);function EA(t){return typeof t=="string"?TA.has(t):Array.isArray(t)&&t.every(e=>typeof e=="string"&&(c0.has(e)||NA.has(e)))}function OA(t,e){for(const n of Hd[e])t.add(n)}function Id(t,e){if(t===void 0&&e!==void 0){const r=new Set(["parameters","requestBody","tryIt","codeSamples"]);return e!=="none"&&r.add("responses"),Cs.filter(s=>r.has(s))}if(t===void 0)return[];if(typeof t=="string")return[...Hd[t]];const n=new Set;for(const r of t)c0.has(r)?n.add(r):OA(n,r);return Cs.filter(r=>n.has(r))}function MA(t,e){return`flexdoc:viewer:${encodeURIComponent(e?.trim()||"unknown-host")}:${encodeURIComponent(t?.trim()||"untitled")}`}function Or(t,e){const n=typeof window<"u"?window.localStorage:void 0;if(!n)return{version:1};try{const r=n.getItem(t);if(!r)return{version:1};const s=JSON.parse(r);return s.version!==1?{version:1}:s.expand!==void 0&&!EA(s.expand)?{version:1}:s.sidebarCollapsed!==void 0&&typeof s.sidebarCollapsed!="boolean"?{version:1}:s.theme!==void 0&&(typeof s.theme!="string"||!jA.has(s.theme))?{version:1}:s.expandedTags!==void 0&&(!Array.isArray(s.expandedTags)||!s.expandedTags.every(a=>typeof a=="string"))?{version:1}:{version:1,...s.expand!==void 0?{expand:s.expand}:{},...s.sidebarCollapsed!==void 0?{sidebarCollapsed:s.sidebarCollapsed}:{},...s.theme!==void 0?{theme:s.theme}:{},...s.expandedTags!==void 0?{expandedTags:[...new Set(s.expandedTags)]}:{}}}catch{return{version:1}}}function Ro(t,e,n){const r=typeof window<"u"?window.localStorage:void 0;if(r)try{e.expand===void 0&&e.sidebarCollapsed===void 0&&e.theme===void 0&&e.expandedTags===void 0?r.removeItem(t):r.setItem(t,JSON.stringify(e))}catch{}}function RA(t,e,n){const s={...Or(t)};e===void 0?delete s.expand:s.expand=e,Ro(t,s)}function DA(t,e,n){const s={...Or(t)};e===void 0?delete s.sidebarCollapsed:s.sidebarCollapsed=e,Ro(t,s)}function _A(t,e,n){const s={...Or(t)};e===void 0?delete s.theme:s.theme=e,Ro(t,s)}function LA(t,e,n){const s={...Or(t)};e===void 0?delete s.expandedTags:s.expandedTags=[...new Set(e)],Ro(t,s)}function Mr(t,e){if(e)return zi.isReference(e)?zi.resolveReference(t,e.$ref):e}function BA(t,e){const n=t.paths[e];if(!n)throw new Error(`Path not found: ${e}`);return Mr(t,n)}function $A(t,e={}){return t.url.replace(/\{([^}]+)\}/g,(n,r)=>{const s=t.variables?.[r],a=e[r]??s?.default;if(a===void 0)throw new Error(`Missing server variable: ${r}`);if(s?.enum?.length&&!s.enum.includes(a))throw new Error(`Invalid value for server variable ${r}: ${a}`);return a})}function Ud(t,e,n){const r=BA(t,e),s=r[n.toLowerCase()];if(!s||typeof s!="object"||!("responses"in s))throw new Error(`Operation not found: ${n.toUpperCase()} ${e}`);const a=[...r.parameters||[],...s.parameters||[]].map(f=>Mr(t,f)).filter(f=>!!f),c=new Map;for(const f of a)c.set(`${f.in}:${f.name}`,f);const d={};for(const[f,h]of Object.entries(s.responses||{})){const g=Mr(t,h);g&&(d[f]=g)}return{path:e,method:n.toUpperCase(),pathItem:r,operation:s,parameters:[...c.values()],requestBody:Mr(t,s.requestBody),responses:d,servers:s.servers||r.servers||t.servers||[],security:s.security!==void 0?s.security:t.security||[]}}function qA(t,e,n){return Ud(t,e,n).parameters}function zA(t,e){return Mr(t,e.schema)}function HA(t,e){if(e.example!==void 0)return e.example;const n=zA(t,e);return n?.example!==void 0?n.example:n?.examples?.length?n.examples[0]:n?.default!==void 0?n.default:n?.enum?.length?n.enum[0]:n?.type==="array"?[]:n?.type==="object"?{}:n?.type==="integer"||n?.type==="number"?1:n?.type==="boolean"?!0:""}function IA(t,e,n){const r=Ud(t,e,n),s={parameters:{},headers:{},cookies:{},auth:{}};for(const d of r.parameters){const f=d.in==="header"?s.headers:d.in==="cookie"?s.cookies:s.parameters;f[d.name]=HA(t,d)}const a=r.requestBody,c=a?Object.keys(a.content||{})[0]:void 0;if(c){s.contentType=c;const d=a.content[c],f=Mr(t,d.schema),h=d.examples?Object.values(d.examples)[0]:void 0,g=Mr(t,h),b=d.example??g?.value??f?.example??f?.examples?.[0]??f?.default;s.body=b!==void 0?JSON.stringify(b,null,2):""}return s}function an(t){return t===null?"null":typeof t=="object"?JSON.stringify(t):String(t)}function Fd(t){if(typeof t!="string")return t;const e=t.trim();if(!e||!e.startsWith("[")&&!e.startsWith("{"))return t;try{return JSON.parse(e)}catch{return t}}function u0(t,e=!1){const n=an(t);return e?encodeURI(n).replace(/%5B/g,"[").replace(/%5D/g,"]"):encodeURIComponent(n)}function d0(t,e=!1){const n=Fd(t);if(Array.isArray(n))return n.map(an).join(",");if(n&&typeof n=="object"){const r=Object.entries(n);return e?r.map(([s,a])=>`${s}=${an(a)}`).join(","):r.flatMap(([s,a])=>[s,an(a)]).join(",")}return an(n)}function UA(t,e){const n=t.style||"simple",r=t.explode??!1,s=Fd(e),a=d=>u0(d,t.allowReserved);if(Array.isArray(s)){const d=s.map(a);return n==="label"?`.${d.join(r?".":",")}`:n==="matrix"?r?d.map(f=>`;${t.name}=${f}`).join(""):`;${t.name}=${d.join(",")}`:d.join(",")}if(s&&typeof s=="object"){const d=Object.entries(s).map(([f,h])=>[a(f),a(h)]);return n==="label"?r?`.${d.map(([f,h])=>`${f}=${h}`).join(".")}`:`.${d.flatMap(([f,h])=>[f,h]).join(",")}`:n==="matrix"?r?d.map(([f,h])=>`;${f}=${h}`).join(""):`;${t.name}=${d.flatMap(([f,h])=>[f,h]).join(",")}`:r?d.map(([f,h])=>`${f}=${h}`).join(","):d.flatMap(([f,h])=>[f,h]).join(",")}const c=a(s);return n==="label"?`.${c}`:n==="matrix"?`;${t.name}=${c}`:c}function FA(t,e){const n=t.style||"form",r=t.explode??n==="form",s=Fd(e);if(n==="deepObject"&&s&&typeof s=="object"&&!Array.isArray(s))return Object.entries(s).map(([a,c])=>[`${t.name}[${a}]`,an(c)]);if(Array.isArray(s))return n==="spaceDelimited"?[[t.name,s.map(an).join(" ")]]:n==="pipeDelimited"?[[t.name,s.map(an).join("|")]]:r?s.map(a=>[t.name,an(a)]):[[t.name,s.map(an).join(",")]];if(s&&typeof s=="object"){const a=Object.entries(s);return r?a.map(([c,d])=>[c,an(d)]):[[t.name,a.flatMap(([c,d])=>[c,an(d)]).join(",")]]}return[[t.name,an(s)]]}function VA(t){return typeof globalThis.btoa=="function"?globalThis.btoa(unescape(encodeURIComponent(t))):t}function PA(t,e){return Object.keys(t).every(n=>!!e[n])}function KA(t,e,n,r,s,a){if(!e.length||!t.components?.securitySchemes)return;const c=e.find(d=>Object.keys(d).length===0||PA(d,a))||e[0];for(const d of Object.keys(c)){const f=Mr(t,t.components.securitySchemes[d]),h=a[d];!f||!h||(f.type==="http"&&f.scheme?.toLowerCase()==="bearer"?n.Authorization=`Bearer ${h}`:f.type==="http"&&f.scheme?.toLowerCase()==="basic"?n.Authorization=`Basic ${VA(h)}`:f.type==="apiKey"&&f.in==="header"&&f.name?n[f.name]=h:f.type==="apiKey"&&f.in==="query"&&f.name?r.push(`${encodeURIComponent(f.name)}=${encodeURIComponent(h)}`):f.type==="apiKey"&&f.in==="cookie"&&f.name?s.push(`${f.name}=${encodeURIComponent(h)}`):(f.type==="oauth2"||f.type==="openIdConnect")&&(n.Authorization=`Bearer ${h}`))}}function f0(t){try{const e=JSON.parse(t);return e&&typeof e=="object"&&!Array.isArray(e)?e:void 0}catch{return}}function YA(t,e,n,r={}){const s=Ud(t,e,n),a=s.servers[0],c=r.serverUrl||(a?$A(a,r.serverVariables):"");let d=e;const f=[],h={...r.headers||{}},g=[];for(const T of s.parameters){const D=T.in==="header"?r.headers?.[T.name]:T.in==="cookie"?r.cookies?.[T.name]:r.parameters?.[T.name];if(!(D===void 0||D===""))if(T.in==="path")d=d.replace(`{${T.name}}`,UA(T,D));else if(T.in==="query")for(const[j,E]of FA(T,D))f.push(`${encodeURIComponent(j)}=${u0(E,T.allowReserved)}`);else T.in==="header"?h[T.name]=d0(D,T.explode):T.in==="cookie"&&g.push(`${T.name}=${encodeURIComponent(d0(D,T.explode))}`)}KA(t,s.security,h,f,g,r.auth||{}),g.length&&(h.Cookie=g.join("; "));let b,v,S;if(r.body){const T=r.contentType||"application/json";if(b=r.body,T==="application/x-www-form-urlencoded"){const D=f0(r.body);b=D?Object.entries(D).flatMap(([j,E])=>Array.isArray(E)?E.map(O=>`${encodeURIComponent(j)}=${encodeURIComponent(an(O))}`):[`${encodeURIComponent(j)}=${encodeURIComponent(an(E))}`]).join("&"):r.body,S=b,v="form",h["Content-Type"]=T}else if(T.startsWith("multipart/form-data")){const D=f0(r.body);if(D&&typeof FormData<"u"){const j=new FormData;for(const[E,O]of Object.entries(D))Array.isArray(O)?O.forEach(R=>j.append(E,an(R))):j.append(E,an(O));S=j}else S=r.body;v="multipart"}else S=r.body,v=T.includes("json")?"json":"text",h["Content-Type"]=T}const A=f.join("&");return{url:`${c.replace(/\/$/,"")}${d}${A?`?${A}`:""}`,method:s.method,headers:h,body:b,bodyKind:v,init:{method:s.method,headers:h,body:S}}}function GA(t,e,n){return qA(t,e,n)}function h0(t,e,n){return IA(t,e,n)}function p0(t,e,n,r={}){return YA(t,e,n,r)}const on=t=>JSON.stringify(t);function XA(t,e){const n=Object.entries(t.headers);if(e==="curl"){const a=[`curl -X ${t.method} ${on(t.url)}`];for(const[c,d]of n)a.push(` -H ${on(`${c}: ${d}`)}`);return t.body&&a.push(` --data-raw ${on(t.body)}`),a.join(` \\
|
|
41
|
+
`)}if(e==="javascript"){const a={method:t.method};return n.length&&(a.headers=t.headers),t.body&&(a.body=t.body),`const response = await fetch(${on(t.url)}, ${JSON.stringify(a,null,2)});
|
|
42
|
+
const data = await response.json();`}if(e==="python"){const a=["import requests","",`url = ${on(t.url)}`];return n.length&&a.push(`headers = ${JSON.stringify(t.headers,null,2)}`),t.body&&a.push(`body = ${on(t.body)}`),a.push(`response = requests.request(${on(t.method)}, url${n.length?", headers=headers":""}${t.body?", data=body":""})`,"print(response.text)"),a.join(`
|
|
43
|
+
`)}if(e==="go"){const a=t.body?`strings.NewReader(${on(t.body)})`:"nil",c=["package main","","import (",' "fmt"',' "io"',' "net/http"'];t.body&&c.push(' "strings"'),c.push(")","","func main() {",` req, _ := http.NewRequest(${on(t.method)}, ${on(t.url)}, ${a})`);for(const[d,f]of n)c.push(` req.Header.Set(${on(d)}, ${on(f)})`);return c.push(" res, err := http.DefaultClient.Do(req)"," if err != nil { panic(err) }"," defer res.Body.Close()"," data, _ := io.ReadAll(res.Body)"," fmt.Println(string(data))","}"),c.join(`
|
|
44
|
+
`)}const r=["import java.net.URI;","import java.net.http.*;","","var client = HttpClient.newHttpClient();","var builder = HttpRequest.newBuilder()",` .uri(URI.create(${on(t.url)}))`];for(const[a,c]of n)r.push(` .header(${on(a)}, ${on(c)})`);const s=t.body?`HttpRequest.BodyPublishers.ofString(${on(t.body)})`:"HttpRequest.BodyPublishers.noBody()";return r.push(` .method(${on(t.method)}, ${s});`,"var response = client.send(builder.build(), HttpResponse.BodyHandlers.ofString());","System.out.println(response.body());"),r.join(`
|
|
45
|
+
`)}function JA(t){return{curl:"cURL",javascript:"JavaScript",python:"Python",go:"Go",java:"Java"}[t]}function QA(t,e){return XA(t,e)}function m0(t){return JA(t)}var Vd={exports:{}},g0;function WA(){return g0||(g0=1,(function(t){var e=typeof window<"u"?window:typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:{};var n=(function(r){var s=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,a=0,c={},d={manual:r.Prism&&r.Prism.manual,disableWorkerMessageHandler:r.Prism&&r.Prism.disableWorkerMessageHandler,util:{encode:function j(E){return E instanceof f?new f(E.type,j(E.content),E.alias):Array.isArray(E)?E.map(j):E.replace(/&/g,"&").replace(/</g,"<").replace(/\u00a0/g," ")},type:function(j){return Object.prototype.toString.call(j).slice(8,-1)},objId:function(j){return j.__id||Object.defineProperty(j,"__id",{value:++a}),j.__id},clone:function j(E,O){O=O||{};var R,B;switch(d.util.type(E)){case"Object":if(B=d.util.objId(E),O[B])return O[B];R={},O[B]=R;for(var M in E)E.hasOwnProperty(M)&&(R[M]=j(E[M],O));return R;case"Array":return B=d.util.objId(E),O[B]?O[B]:(R=[],O[B]=R,E.forEach(function(z,F){R[F]=j(z,O)}),R);default:return E}},getLanguage:function(j){for(;j;){var E=s.exec(j.className);if(E)return E[1].toLowerCase();j=j.parentElement}return"none"},setLanguage:function(j,E){j.className=j.className.replace(RegExp(s,"gi"),""),j.classList.add("language-"+E)},currentScript:function(){if(typeof document>"u")return null;if(document.currentScript&&document.currentScript.tagName==="SCRIPT")return document.currentScript;try{throw new Error}catch(R){var j=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(R.stack)||[])[1];if(j){var E=document.getElementsByTagName("script");for(var O in E)if(E[O].src==j)return E[O]}return null}},isActive:function(j,E,O){for(var R="no-"+E;j;){var B=j.classList;if(B.contains(E))return!0;if(B.contains(R))return!1;j=j.parentElement}return!!O}},languages:{plain:c,plaintext:c,text:c,txt:c,extend:function(j,E){var O=d.util.clone(d.languages[j]);for(var R in E)O[R]=E[R];return O},insertBefore:function(j,E,O,R){R=R||d.languages;var B=R[j],M={};for(var z in B)if(B.hasOwnProperty(z)){if(z==E)for(var F in O)O.hasOwnProperty(F)&&(M[F]=O[F]);O.hasOwnProperty(z)||(M[z]=B[z])}var X=R[j];return R[j]=M,d.languages.DFS(d.languages,function(W,G){G===X&&W!=j&&(this[W]=M)}),M},DFS:function j(E,O,R,B){B=B||{};var M=d.util.objId;for(var z in E)if(E.hasOwnProperty(z)){O.call(E,z,E[z],R||z);var F=E[z],X=d.util.type(F);X==="Object"&&!B[M(F)]?(B[M(F)]=!0,j(F,O,null,B)):X==="Array"&&!B[M(F)]&&(B[M(F)]=!0,j(F,O,z,B))}}},plugins:{},highlightAll:function(j,E){d.highlightAllUnder(document,j,E)},highlightAllUnder:function(j,E,O){var R={callback:O,container:j,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};d.hooks.run("before-highlightall",R),R.elements=Array.prototype.slice.apply(R.container.querySelectorAll(R.selector)),d.hooks.run("before-all-elements-highlight",R);for(var B=0,M;M=R.elements[B++];)d.highlightElement(M,E===!0,R.callback)},highlightElement:function(j,E,O){var R=d.util.getLanguage(j),B=d.languages[R];d.util.setLanguage(j,R);var M=j.parentElement;M&&M.nodeName.toLowerCase()==="pre"&&d.util.setLanguage(M,R);var z=j.textContent,F={element:j,language:R,grammar:B,code:z};function X(G){F.highlightedCode=G,d.hooks.run("before-insert",F),F.element.innerHTML=F.highlightedCode,d.hooks.run("after-highlight",F),d.hooks.run("complete",F),O&&O.call(F.element)}if(d.hooks.run("before-sanity-check",F),M=F.element.parentElement,M&&M.nodeName.toLowerCase()==="pre"&&!M.hasAttribute("tabindex")&&M.setAttribute("tabindex","0"),!F.code){d.hooks.run("complete",F),O&&O.call(F.element);return}if(d.hooks.run("before-highlight",F),!F.grammar){X(d.util.encode(F.code));return}if(E&&r.Worker){var W=new Worker(d.filename);W.onmessage=function(G){X(G.data)},W.postMessage(JSON.stringify({language:F.language,code:F.code,immediateClose:!0}))}else X(d.highlight(F.code,F.grammar,F.language))},highlight:function(j,E,O){var R={code:j,grammar:E,language:O};if(d.hooks.run("before-tokenize",R),!R.grammar)throw new Error('The language "'+R.language+'" has no grammar.');return R.tokens=d.tokenize(R.code,R.grammar),d.hooks.run("after-tokenize",R),f.stringify(d.util.encode(R.tokens),R.language)},tokenize:function(j,E){var O=E.rest;if(O){for(var R in O)E[R]=O[R];delete E.rest}var B=new b;return v(B,B.head,j),g(j,B,E,B.head,0),A(B)},hooks:{all:{},add:function(j,E){var O=d.hooks.all;O[j]=O[j]||[],O[j].push(E)},run:function(j,E){var O=d.hooks.all[j];if(!(!O||!O.length))for(var R=0,B;B=O[R++];)B(E)}},Token:f};r.Prism=d;function f(j,E,O,R){this.type=j,this.content=E,this.alias=O,this.length=(R||"").length|0}f.stringify=function j(E,O){if(typeof E=="string")return E;if(Array.isArray(E)){var R="";return E.forEach(function(X){R+=j(X,O)}),R}var B={type:E.type,content:j(E.content,O),tag:"span",classes:["token",E.type],attributes:{},language:O},M=E.alias;M&&(Array.isArray(M)?Array.prototype.push.apply(B.classes,M):B.classes.push(M)),d.hooks.run("wrap",B);var z="";for(var F in B.attributes)z+=" "+F+'="'+(B.attributes[F]||"").replace(/"/g,""")+'"';return"<"+B.tag+' class="'+B.classes.join(" ")+'"'+z+">"+B.content+"</"+B.tag+">"};function h(j,E,O,R){j.lastIndex=E;var B=j.exec(O);if(B&&R&&B[1]){var M=B[1].length;B.index+=M,B[0]=B[0].slice(M)}return B}function g(j,E,O,R,B,M){for(var z in O)if(!(!O.hasOwnProperty(z)||!O[z])){var F=O[z];F=Array.isArray(F)?F:[F];for(var X=0;X<F.length;++X){if(M&&M.cause==z+","+X)return;var W=F[X],G=W.inside,we=!!W.lookbehind,ye=!!W.greedy,xe=W.alias;if(ye&&!W.pattern.global){var _=W.pattern.toString().match(/[imsuy]*$/)[0];W.pattern=RegExp(W.pattern.source,_+"g")}for(var ee=W.pattern||W,he=R.next,$=B;he!==E.tail&&!(M&&$>=M.reach);$+=he.value.length,he=he.next){var te=he.value;if(E.length>j.length)return;if(!(te instanceof f)){var L=1,P;if(ye){if(P=h(ee,$,j,we),!P||P.index>=j.length)break;var Re=P.index,ue=P.index+P[0].length,Se=$;for(Se+=he.value.length;Re>=Se;)he=he.next,Se+=he.value.length;if(Se-=he.value.length,$=Se,he.value instanceof f)continue;for(var Ne=he;Ne!==E.tail&&(Se<ue||typeof Ne.value=="string");Ne=Ne.next)L++,Se+=Ne.value.length;L--,te=j.slice($,Se),P.index-=$}else if(P=h(ee,0,te,we),!P)continue;var Re=P.index,Be=P[0],Ze=te.slice(0,Re),_e=te.slice(Re+Be.length),Ke=$+te.length;M&&Ke>M.reach&&(M.reach=Ke);var gt=he.prev;Ze&&(gt=v(E,gt,Ze),$+=Ze.length),S(E,gt,L);var se=new f(z,G?d.tokenize(Be,G):Be,xe,Be);if(he=v(E,gt,se),_e&&v(E,he,_e),L>1){var de={cause:z+","+X,reach:Ke};g(j,E,O,he.prev,$,de),M&&de.reach>M.reach&&(M.reach=de.reach)}}}}}}function b(){var j={value:null,prev:null,next:null},E={value:null,prev:j,next:null};j.next=E,this.head=j,this.tail=E,this.length=0}function v(j,E,O){var R=E.next,B={value:O,prev:E,next:R};return E.next=B,R.prev=B,j.length++,B}function S(j,E,O){for(var R=E.next,B=0;B<O&&R!==j.tail;B++)R=R.next;E.next=R,R.prev=E,j.length-=B}function A(j){for(var E=[],O=j.head.next;O!==j.tail;)E.push(O.value),O=O.next;return E}if(!r.document)return r.addEventListener&&(d.disableWorkerMessageHandler||r.addEventListener("message",function(j){var E=JSON.parse(j.data),O=E.language,R=E.code,B=E.immediateClose;r.postMessage(d.highlight(R,d.languages[O],O)),B&&r.close()},!1)),d;var C=d.util.currentScript();C&&(d.filename=C.src,C.hasAttribute("data-manual")&&(d.manual=!0));function T(){d.manual||d.highlightAll()}if(!d.manual){var D=document.readyState;D==="loading"||D==="interactive"&&C&&C.defer?document.addEventListener("DOMContentLoaded",T):window.requestAnimationFrame?window.requestAnimationFrame(T):window.setTimeout(T,16)}return d})(e);t.exports&&(t.exports=n),typeof Xm<"u"&&(Xm.Prism=n),n.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},n.languages.markup.tag.inside["attr-value"].inside.entity=n.languages.markup.entity,n.languages.markup.doctype.inside["internal-subset"].inside=n.languages.markup,n.hooks.add("wrap",function(r){r.type==="entity"&&(r.attributes.title=r.content.replace(/&/,"&"))}),Object.defineProperty(n.languages.markup.tag,"addInlined",{value:function(s,a){var c={};c["language-"+a]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:n.languages[a]},c.cdata=/^<!\[CDATA\[|\]\]>$/i;var d={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:c}};d["language-"+a]={pattern:/[\s\S]+/,inside:n.languages[a]};var f={};f[s]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return s}),"i"),lookbehind:!0,greedy:!0,inside:d},n.languages.insertBefore("markup","cdata",f)}}),Object.defineProperty(n.languages.markup.tag,"addAttribute",{value:function(r,s){n.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+r+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[s,"language-"+s],inside:n.languages[s]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),n.languages.html=n.languages.markup,n.languages.mathml=n.languages.markup,n.languages.svg=n.languages.markup,n.languages.xml=n.languages.extend("markup",{}),n.languages.ssml=n.languages.xml,n.languages.atom=n.languages.xml,n.languages.rss=n.languages.xml,(function(r){var s=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;r.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+s.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+s.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+s.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+s.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:s,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},r.languages.css.atrule.inside.rest=r.languages.css;var a=r.languages.markup;a&&(a.tag.addInlined("style","css"),a.tag.addAttribute("style","css"))})(n),n.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},n.languages.javascript=n.languages.extend("clike",{"class-name":[n.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+(/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source)+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),n.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,n.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:n.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:n.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:n.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:n.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:n.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),n.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:n.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),n.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),n.languages.markup&&(n.languages.markup.tag.addInlined("script","javascript"),n.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),n.languages.js=n.languages.javascript,(function(){if(typeof n>"u"||typeof document>"u")return;Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);var r="Loading…",s=function(C,T){return"✖ Error "+C+" while fetching file: "+T},a="✖ Error: File does not exist or is empty",c={js:"javascript",py:"python",rb:"ruby",ps1:"powershell",psm1:"powershell",sh:"bash",bat:"batch",h:"c",tex:"latex"},d="data-src-status",f="loading",h="loaded",g="failed",b="pre[data-src]:not(["+d+'="'+h+'"]):not(['+d+'="'+f+'"])';function v(C,T,D){var j=new XMLHttpRequest;j.open("GET",C,!0),j.onreadystatechange=function(){j.readyState==4&&(j.status<400&&j.responseText?T(j.responseText):j.status>=400?D(s(j.status,j.statusText)):D(a))},j.send(null)}function S(C){var T=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(C||"");if(T){var D=Number(T[1]),j=T[2],E=T[3];return j?E?[D,Number(E)]:[D,void 0]:[D,D]}}n.hooks.add("before-highlightall",function(C){C.selector+=", "+b}),n.hooks.add("before-sanity-check",function(C){var T=C.element;if(T.matches(b)){C.code="",T.setAttribute(d,f);var D=T.appendChild(document.createElement("CODE"));D.textContent=r;var j=T.getAttribute("data-src"),E=C.language;if(E==="none"){var O=(/\.(\w+)$/.exec(j)||[,"none"])[1];E=c[O]||O}n.util.setLanguage(D,E),n.util.setLanguage(T,E);var R=n.plugins.autoloader;R&&R.loadLanguages(E),v(j,function(B){T.setAttribute(d,h);var M=S(T.getAttribute("data-range"));if(M){var z=B.split(/\r\n?|\n/g),F=M[0],X=M[1]==null?z.length:M[1];F<0&&(F+=z.length),F=Math.max(0,Math.min(F-1,z.length)),X<0&&(X+=z.length),X=Math.max(0,Math.min(X,z.length)),B=z.slice(F,X).join(`
|
|
46
|
+
`),T.hasAttribute("data-start")||T.setAttribute("data-start",String(F+1))}D.textContent=B,n.highlightElement(D)},function(B){T.setAttribute(d,g),D.textContent=B})}}),n.plugins.fileHighlight={highlight:function(T){for(var D=(T||document).querySelectorAll(b),j=0,E;E=D[j++];)n.highlightElement(E)}};var A=!1;n.fileHighlight=function(){A||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),A=!0),n.plugins.fileHighlight.highlight.apply(this,arguments)}})()})(Vd)),Vd.exports}var ZA=WA();const ek=Jm(ZA);Prism.languages.json={property:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,lookbehind:!0,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"}},Prism.languages.webmanifest=Prism.languages.json,(function(t){var e=/[*&][^\s[\]{},]+/,n=/!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/,r="(?:"+n.source+"(?:[ ]+"+e.source+")?|"+e.source+"(?:[ ]+"+n.source+")?)",s=/(?:[^\s\x00-\x08\x0e-\x1f!"#%&'*,\-:>?@[\]`{|}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]|[?:-]<PLAIN>)(?:[ \t]*(?:(?![#:])<PLAIN>|:<PLAIN>))*/.source.replace(/<PLAIN>/g,function(){return/[^\s\x00-\x08\x0e-\x1f,[\]{}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]/.source}),a=/"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'/.source;function c(d,f){f=(f||"").replace(/m/g,"")+"m";var h=/([:\-,[{]\s*(?:\s<<prop>>[ \t]+)?)(?:<<value>>)(?=[ \t]*(?:$|,|\]|\}|(?:[\r\n]\s*)?#))/.source.replace(/<<prop>>/g,function(){return r}).replace(/<<value>>/g,function(){return d});return RegExp(h,f)}t.languages.yaml={scalar:{pattern:RegExp(/([\-:]\s*(?:\s<<prop>>[ \t]+)?[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)\S[^\r\n]*(?:\2[^\r\n]+)*)/.source.replace(/<<prop>>/g,function(){return r})),lookbehind:!0,alias:"string"},comment:/#.*/,key:{pattern:RegExp(/((?:^|[:\-,[{\r\n?])[ \t]*(?:<<prop>>[ \t]+)?)<<key>>(?=\s*:\s)/.source.replace(/<<prop>>/g,function(){return r}).replace(/<<key>>/g,function(){return"(?:"+s+"|"+a+")"})),lookbehind:!0,greedy:!0,alias:"atrule"},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:"important"},datetime:{pattern:c(/\d{4}-\d\d?-\d\d?(?:[tT]|[ \t]+)\d\d?:\d{2}:\d{2}(?:\.\d*)?(?:[ \t]*(?:Z|[-+]\d\d?(?::\d{2})?))?|\d{4}-\d{2}-\d{2}|\d\d?:\d{2}(?::\d{2}(?:\.\d*)?)?/.source),lookbehind:!0,alias:"number"},boolean:{pattern:c(/false|true/.source,"i"),lookbehind:!0,alias:"important"},null:{pattern:c(/null|~/.source,"i"),lookbehind:!0,alias:"important"},string:{pattern:c(a),lookbehind:!0,greedy:!0},number:{pattern:c(/[+-]?(?:0x[\da-f]+|0o[0-7]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?|\.inf|\.nan)/.source,"i"),lookbehind:!0},tag:n,important:e,punctuation:/---|[:[\]{}\-,|>?]|\.\.\./},t.languages.yml=t.languages.yaml})(Prism),Prism.languages.javascript=Prism.languages.extend("clike",{"class-name":[Prism.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+(/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source)+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),Prism.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,Prism.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:Prism.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:Prism.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),Prism.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:Prism.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),Prism.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),Prism.languages.markup&&(Prism.languages.markup.tag.addInlined("script","javascript"),Prism.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),Prism.languages.js=Prism.languages.javascript,(function(t){var e="\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\b",n={pattern:/(^(["']?)\w+\2)[ \t]+\S.*/,lookbehind:!0,alias:"punctuation",inside:null},r={bash:n,environment:{pattern:RegExp("\\$"+e),alias:"constant"},variable:[{pattern:/\$?\(\([\s\S]+?\)\)/,greedy:!0,inside:{variable:[{pattern:/(^\$\(\([\s\S]+)\)\)/,lookbehind:!0},/^\$\(\(/],number:/\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee]-?\d+)?/,operator:/--|\+\+|\*\*=?|<<=?|>>=?|&&|\|\||[=!+\-*/%<>^&|]=?|[?~:]/,punctuation:/\(\(?|\)\)?|,|;/}},{pattern:/\$\((?:\([^)]+\)|[^()])+\)|`[^`]+`/,greedy:!0,inside:{variable:/^\$\(|^`|\)$|`$/}},{pattern:/\$\{[^}]+\}/,greedy:!0,inside:{operator:/:[-=?+]?|[!\/]|##?|%%?|\^\^?|,,?/,punctuation:/[\[\]]/,environment:{pattern:RegExp("(\\{)"+e),lookbehind:!0,alias:"constant"}}},/\$(?:\w+|[#?*!@$])/],entity:/\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|U[0-9a-fA-F]{8}|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{1,2})/};t.languages.bash={shebang:{pattern:/^#!\s*\/.*/,alias:"important"},comment:{pattern:/(^|[^"{\\$])#.*/,lookbehind:!0},"function-name":[{pattern:/(\bfunction\s+)[\w-]+(?=(?:\s*\(?:\s*\))?\s*\{)/,lookbehind:!0,alias:"function"},{pattern:/\b[\w-]+(?=\s*\(\s*\)\s*\{)/,alias:"function"}],"for-or-select":{pattern:/(\b(?:for|select)\s+)\w+(?=\s+in\s)/,alias:"variable",lookbehind:!0},"assign-left":{pattern:/(^|[\s;|&]|[<>]\()\w+(?:\.\w+)*(?=\+?=)/,inside:{environment:{pattern:RegExp("(^|[\\s;|&]|[<>]\\()"+e),lookbehind:!0,alias:"constant"}},alias:"variable",lookbehind:!0},parameter:{pattern:/(^|\s)-{1,2}(?:\w+:[+-]?)?\w+(?:\.\w+)*(?=[=\s]|$)/,alias:"variable",lookbehind:!0},string:[{pattern:/((?:^|[^<])<<-?\s*)(\w+)\s[\s\S]*?(?:\r?\n|\r)\2/,lookbehind:!0,greedy:!0,inside:r},{pattern:/((?:^|[^<])<<-?\s*)(["'])(\w+)\2\s[\s\S]*?(?:\r?\n|\r)\3/,lookbehind:!0,greedy:!0,inside:{bash:n}},{pattern:/(^|[^\\](?:\\\\)*)"(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^"\\`$])*"/,lookbehind:!0,greedy:!0,inside:r},{pattern:/(^|[^$\\])'[^']*'/,lookbehind:!0,greedy:!0},{pattern:/\$'(?:[^'\\]|\\[\s\S])*'/,greedy:!0,inside:{entity:r.entity}}],environment:{pattern:RegExp("\\$?"+e),alias:"constant"},variable:r.variable,function:{pattern:/(^|[\s;|&]|[<>]\()(?:add|apropos|apt|apt-cache|apt-get|aptitude|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cargo|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|docker|docker-compose|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|java|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|node|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|podman|podman-compose|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|sysctl|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vcpkg|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/,lookbehind:!0},keyword:{pattern:/(^|[\s;|&]|[<>]\()(?:case|do|done|elif|else|esac|fi|for|function|if|in|select|then|until|while)(?=$|[)\s;|&])/,lookbehind:!0},builtin:{pattern:/(^|[\s;|&]|[<>]\()(?:\.|:|alias|bind|break|builtin|caller|cd|command|continue|declare|echo|enable|eval|exec|exit|export|getopts|hash|help|let|local|logout|mapfile|printf|pwd|read|readarray|readonly|return|set|shift|shopt|source|test|times|trap|type|typeset|ulimit|umask|unalias|unset)(?=$|[)\s;|&])/,lookbehind:!0,alias:"class-name"},boolean:{pattern:/(^|[\s;|&]|[<>]\()(?:false|true)(?=$|[)\s;|&])/,lookbehind:!0},"file-descriptor":{pattern:/\B&\d\b/,alias:"important"},operator:{pattern:/\d?<>|>\||\+=|=[=~]?|!=?|<<[<-]?|[&\d]?>>|\d[<>]&?|[<>][&=]?|&[>&]?|\|[&|]?/,inside:{"file-descriptor":{pattern:/^\d/,alias:"important"}}},punctuation:/\$?\(\(?|\)\)?|\.\.|[{}[\];\\]/,number:{pattern:/(^|\s)(?:[1-9]\d*|0)(?:[.,]\d+)?\b/,lookbehind:!0}},n.inside=t.languages.bash;for(var s=["comment","function-name","for-or-select","assign-left","parameter","string","environment","function","keyword","builtin","boolean","file-descriptor","operator","punctuation","number"],a=r.variable[1].inside,c=0;c<s.length;c++)a[s[c]]=t.languages.bash[s[c]];t.languages.sh=t.languages.bash,t.languages.shell=t.languages.bash})(Prism);var y0={},b0;function tk(){return b0||(b0=1,Prism.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern://,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},Prism.languages.python["string-interpolation"].inside.interpolation.inside.rest=Prism.languages.python,Prism.languages.py=Prism.languages.python),y0}tk(),Prism.languages.go=Prism.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"|`[^`]*`/,lookbehind:!0,greedy:!0},keyword:/\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/,boolean:/\b(?:_|false|iota|nil|true)\b/,number:[/\b0(?:b[01_]+|o[0-7_]+)i?\b/i,/\b0x(?:[a-f\d_]+(?:\.[a-f\d_]*)?|\.[a-f\d_]+)(?:p[+-]?\d+(?:_\d+)*)?i?(?!\w)/i,/(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?[\d_]+)?i?(?!\w)/i],operator:/[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,builtin:/\b(?:append|bool|byte|cap|close|complex|complex(?:64|128)|copy|delete|error|float(?:32|64)|u?int(?:8|16|32|64)?|imag|len|make|new|panic|print(?:ln)?|real|recover|rune|string|uintptr)\b/}),Prism.languages.insertBefore("go","string",{char:{pattern:/'(?:\\.|[^'\\\r\n]){0,10}'/,greedy:!0}}),delete Prism.languages.go["class-name"];var x0={},v0;function nk(){return v0||(v0=1,(function(t){var e=/\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record(?!\s*[(){}[\]<>=%~.:,;?+\-*/&|^])|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/,n=/(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source,r={pattern:RegExp(/(^|[^\w.])/.source+n+/[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}},punctuation:/\./}};t.languages.java=t.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"/,lookbehind:!0,greedy:!0},"class-name":[r,{pattern:RegExp(/(^|[^\w.])/.source+n+/[A-Z]\w*(?=\s+\w+\s*[;,=()]|\s*(?:\[[\s,]*\]\s*)?::\s*new\b)/.source),lookbehind:!0,inside:r.inside},{pattern:RegExp(/(\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\s+)/.source+n+/[A-Z]\w*\b/.source),lookbehind:!0,inside:r.inside}],keyword:e,function:[t.languages.clike.function,{pattern:/(::\s*)[a-z_]\w*/,lookbehind:!0}],number:/\b0b[01][01_]*L?\b|\b0x(?:\.[\da-f_p+-]+|[\da-f_]+(?:\.[\da-f_p+-]+)?)\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i,operator:{pattern:/(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,lookbehind:!0},constant:/\b[A-Z][A-Z_\d]+\b/}),t.languages.insertBefore("java","string",{"triple-quoted-string":{pattern:/"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,greedy:!0,alias:"string"},char:{pattern:/'(?:\\.|[^'\\\r\n]){1,6}'/,greedy:!0}}),t.languages.insertBefore("java","class-name",{annotation:{pattern:/(^|[^.])@\w+(?:\s*\.\s*\w+)*/,lookbehind:!0,alias:"punctuation"},generics:{pattern:/<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/,inside:{"class-name":r,keyword:e,punctuation:/[<>(),.:]/,operator:/[?&|]/}},import:[{pattern:RegExp(/(\bimport\s+)/.source+n+/(?:[A-Z]\w*|\*)(?=\s*;)/.source),lookbehind:!0,inside:{namespace:r.inside.namespace,punctuation:/\./,operator:/\*/,"class-name":/\w+/}},{pattern:RegExp(/(\bimport\s+static\s+)/.source+n+/(?:\w+|\*)(?=\s*;)/.source),lookbehind:!0,alias:"static",inside:{namespace:r.inside.namespace,static:/\b\w+$/,punctuation:/\./,operator:/\*/,"class-name":/\w+/}}],namespace:{pattern:RegExp(/(\b(?:exports|import(?:\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\s+)(?!<keyword>)[a-z]\w*(?:\.[a-z]\w*)*\.?/.source.replace(/<keyword>/g,function(){return e.source})),lookbehind:!0,inside:{punctuation:/\./}}})})(Prism)),x0}nk();const Rr=({code:t,language:e,title:n,showCopy:r=!0,theme:s="dark",wrap:a=!1})=>{const[c,d]=og.useState(!1);I.useEffect(()=>{ek.highlightAll()},[t,s]);const f=async()=>{try{await navigator.clipboard.writeText(t),d(!0),setTimeout(()=>d(!1),2e3)}catch(S){console.error("Failed to copy text: ",S)}},h=s==="dark"?"bg-gray-900 border-gray-700":"bg-gray-50 border-gray-200",g=s==="dark"?"bg-gray-800 border-gray-700 text-gray-300":"bg-gray-100 border-gray-200 text-gray-700",b=s==="dark"?"text-gray-400 hover:text-gray-200":"text-gray-500 hover:text-gray-900",v={"--fd-code-muted":s==="dark"?"#9ca3af":"#64748b","--fd-code-string":s==="dark"?"#86efac":"#15803d","--fd-code-keyword":s==="dark"?"#c4b5fd":"#6d28d9","--fd-code-number":s==="dark"?"#fb923c":"#c2410c","--fd-code-accent":s==="dark"?"#93c5fd":"#1d4ed8"};return p.jsxs("div",{className:`flexdoc-code min-w-0 rounded-lg overflow-hidden border ${h}`,"data-code-theme":s,style:v,children:[(n||r)&&p.jsxs("div",{className:`flex items-center justify-between gap-3 px-3 sm:px-4 py-2 border-b ${g}`,children:[n&&p.jsx("span",{className:"min-w-0 truncate text-sm font-medium",children:n}),r&&p.jsx("button",{onClick:f,className:`shrink-0 flex items-center gap-1 text-xs transition-colors ${b}`,"aria-label":"Copy code to clipboard",children:c?p.jsxs(p.Fragment,{children:[p.jsx(fg,{className:"w-3 h-3"}),p.jsx("span",{children:"Copied"})]}):p.jsxs(p.Fragment,{children:[p.jsx(nA,{className:"w-3 h-3"}),p.jsx("span",{children:"Copy"})]})})]}),p.jsx("div",{className:`p-3 sm:p-4 overflow-x-auto ${s==="dark"?"bg-gray-800":"bg-white"}`,children:p.jsx("pre",{className:`m-0 text-xs sm:text-sm ${a?"whitespace-pre-wrap break-words":""} ${s==="dark"?"text-gray-100":"text-gray-800"}`,children:p.jsx("code",{className:`language-${e} bg-transparent`,children:t})})})]})};function ik(t){const e=Array.isArray(t.type)?t.type.join(" | "):t.type;return e?t.format?`${e} (${t.format})`:e:t.oneOf?"oneOf":t.anyOf?"anyOf":t.allOf?"allOf":t.const!==void 0?"const":"any"}const Dr=({spec:t,schema:e,theme:n,required:r=!1,level:s=0,seen:a=new Set,requiredPropsFirst:c=!1,sortPropsAlphabetically:d=!1})=>{const f={spec:t,theme:n,requiredPropsFirst:c,sortPropsAlphabetically:d};if(Ln.isReference(e)){if(a.has(e.$ref))return p.jsxs("div",{className:"py-1 text-sm opacity-70",children:["↳ ",p.jsx("code",{children:e.$ref.replace("#/components/schemas/","")})," (recursive reference)"]});const A=new Set(a);A.add(e.$ref);let C;try{C=Ln.resolveReference(t,e.$ref)}catch{return p.jsxs("div",{className:"py-1 text-sm text-red-500",children:["Unresolved reference: ",p.jsx("code",{children:e.$ref})]})}return p.jsx(Dr,{...f,schema:C,required:r,level:s,seen:A})}const h=n==="dark"?"text-gray-400":"text-gray-600",g=n==="dark"?"border-gray-700":"border-gray-200",b=[["All of",e.allOf],["One of",e.oneOf],["Any of",e.anyOf]],v=new Set(e.required||[]),S=Object.entries(e.properties||{}).sort(([A],[C])=>{if(c){const T=Number(v.has(C))-Number(v.has(A));if(T)return T}return d?A.localeCompare(C):0});return p.jsxs("div",{className:s?`border-l-2 ${g} pl-3`:"",children:[p.jsxs("div",{className:"flex flex-wrap items-center gap-2 py-1",children:[p.jsx("span",{className:n==="dark"?"text-blue-300":"text-blue-600",children:ik(e)}),r&&p.jsx("span",{className:"rounded bg-red-100 px-2 py-0.5 text-xs text-red-700 dark:bg-red-900/30 dark:text-red-300",children:"required"}),(e.nullable||Array.isArray(e.type)&&e.type.includes("null"))&&p.jsx("span",{className:"rounded bg-gray-100 px-2 py-0.5 text-xs text-gray-700 dark:bg-gray-700 dark:text-gray-300",children:"nullable"}),e.deprecated&&p.jsx("span",{className:"rounded bg-orange-100 px-2 py-0.5 text-xs text-orange-700",children:"deprecated"}),e.readOnly&&p.jsx("span",{className:"text-xs opacity-60",children:"readOnly"}),e.writeOnly&&p.jsx("span",{className:"text-xs opacity-60",children:"writeOnly"})]}),e.description&&p.jsx("p",{className:`mt-1 text-sm leading-relaxed ${h}`,children:e.description}),e.enum&&p.jsxs("p",{className:`mt-1 text-xs ${h}`,children:["Allowed: ",e.enum.map(String).join(", ")]}),e.const!==void 0&&p.jsxs("p",{className:`mt-1 text-xs ${h}`,children:["Constant: ",JSON.stringify(e.const)]}),e.default!==void 0&&p.jsxs("p",{className:`mt-1 text-xs ${h}`,children:["Default: ",JSON.stringify(e.default)]}),(e.example!==void 0||e.examples?.length)&&p.jsx("div",{className:"mt-2",children:p.jsx(Rr,{code:JSON.stringify(e.example??e.examples?.[0],null,2),language:"json",title:"Example",showCopy:!1,theme:n,wrap:!0})}),e.items&&p.jsxs("div",{className:"mt-3",children:[p.jsx("div",{className:"mb-1 text-xs font-semibold uppercase tracking-wide opacity-60",children:"Items"}),p.jsx(Dr,{...f,schema:e.items,level:s+1,seen:a})]}),b.map(([A,C])=>C?.length?p.jsxs("div",{className:"mt-3",children:[p.jsx("div",{className:"mb-2 text-xs font-semibold uppercase tracking-wide opacity-60",children:A}),p.jsx("div",{className:"space-y-3",children:C.map((T,D)=>p.jsx(Dr,{...f,schema:T,level:s+1,seen:a},D))})]},A):null),S.length>0&&p.jsx("div",{className:"mt-3 space-y-3",children:S.map(([A,C])=>p.jsxs("div",{children:[p.jsx("div",{className:"font-mono text-sm font-medium",children:A}),p.jsx(Dr,{...f,schema:C,required:v.has(A),level:s+1,seen:a})]},A))}),e.additionalProperties&&typeof e.additionalProperties=="object"&&p.jsxs("div",{className:"mt-3",children:[p.jsx("div",{className:"mb-1 text-xs font-semibold uppercase tracking-wide opacity-60",children:"Additional properties"}),p.jsx(Dr,{...f,schema:e.additionalProperties,level:s+1,seen:a})]})]})};function cn(t){return{preRequest:t?.preRequest||"",tests:t?.tests||""}}function rk(t){return{...t,query:t.query?.map(e=>({...e})),headers:t.headers?.map(e=>({...e})),urlencoded:t.urlencoded?.map(e=>({...e})),formData:t.formData?.map(e=>({...e})),binary:t.binary?{...t.binary}:void 0,graphql:t.graphql?{...t.graphql}:void 0,auth:t.auth?{...t.auth}:void 0}}function Do(t){return Object.assign(Object.create(null),t)}function Wt(t){if(typeof t=="string")return t;if(t instanceof Error)return t.message;try{return JSON.stringify(t)}catch{return String(t)}}function el(t,e){if(Object.is(t,e))return!0;if(typeof t!=typeof e||t===null||e===null)return!1;if(Array.isArray(t))return Array.isArray(e)&&t.length===e.length&&t.every((n,r)=>el(n,e[r]));if(typeof t=="object"&&typeof e=="object"){const n=t,r=e,s=Object.keys(n),a=Object.keys(r);return s.length===a.length&&s.every(c=>Object.prototype.hasOwnProperty.call(r,c)&&el(n[c],r[c]))}return!1}function li(t){throw new Error(t)}function sk(t){const e=h=>{Object.is(t,h)||li(`expected ${Wt(t)} to equal ${Wt(h)}`)},n=h=>{el(t,h)||li(`expected ${Wt(t)} to deeply equal ${Wt(h)}`)},r=h=>{(typeof t=="string"?t.includes(String(h)):Array.isArray(t)&&t.some(b=>el(b,h)))||li(`expected ${Wt(t)} to include ${Wt(h)}`)},s=(h,...g)=>{(!t||typeof t!="object"||!Object.prototype.hasOwnProperty.call(t,h))&&li(`expected value to have property ${h}`),g.length>0&&!el(t[h],g[0])&&li(`expected property ${h} to equal ${Wt(g[0])}`)},f={above:h=>{(typeof t!="number"||t<=h)&&li(`expected ${Wt(t)} to be above ${h}`)},below:h=>{(typeof t!="number"||t>=h)&&li(`expected ${Wt(t)} to be below ${h}`)},oneOf:h=>{h.some(g=>el(t,g))||li(`expected ${Wt(t)} to be one of ${Wt(h)}`)}};return Object.defineProperties(f,{ok:{get:()=>(t||li(`expected ${Wt(t)} to be truthy`),!0)},true:{get:()=>(t!==!0&&li(`expected ${Wt(t)} to be true`),!0)},false:{get:()=>(t!==!1&&li(`expected ${Wt(t)} to be false`),!0)}}),{to:{equal:e,eql:n,include:r,match:h=>{(typeof t!="string"||!h.test(t))&&li(`expected ${Wt(t)} to match ${h}`)},have:{property:s},be:f}}}function Pd(t,e){return t.findIndex(n=>n.key.toLowerCase()===e.toLowerCase())}function lk(t){const e=()=>t.headers||(t.headers=[]),n=(r,s)=>{const a=e(),c=Pd(a,r),d={key:r,value:String(s),enabled:!0};c>=0?a[c]=d:a.push(d)};return{get(r){const s=Pd(e(),r);return s>=0?e()[s].value:void 0},has(r){return Pd(e(),r)>=0},set:n,upsert({key:r,value:s}){n(r,s)},remove(r){t.headers=e().filter(s=>s.key.toLowerCase()!==r.toLowerCase())},toObject(){const r={};for(const s of e())s.enabled!==!1&&(r[s.key]=s.value);return r}}}function ak(t){return{get(e){return t.find(([n])=>n.toLowerCase()===e.toLowerCase())?.[1]},has(e){return t.some(([n])=>n.toLowerCase()===e.toLowerCase())},toObject(){const e={};for(const[n,r]of t)e[n]=r;return e}}}async function w0(t){const e=rk(t.draft),n=Do(t.variables||{}),r=Do(t.collectionVariables||{}),s=Do(t.externalVariables||{}),a=Do(t.environmentVariables||{}),c=[],d=[],f=[],h=[],g=[],b=O=>{Object.prototype.hasOwnProperty.call(a,O)?n[O]=a[O]:Object.prototype.hasOwnProperty.call(s,O)?n[O]=s[O]:Object.prototype.hasOwnProperty.call(r,O)?n[O]=r[O]:delete n[O]},v={get(O){return a[O]},has(O){return Object.prototype.hasOwnProperty.call(a,O)},set(O,R){const B=String(R);a[O]=B,n[O]=B,d.push({action:"set",key:O,value:B})},unset(O){delete a[O],b(O),d.push({action:"unset",key:O})},replaceIn(O){return O.replace(/\{\{\s*([^{}]+?)\s*\}\}/g,(R,B)=>{const M=B.trim();return Object.prototype.hasOwnProperty.call(a,M)?a[M]:R})}},S={get(O){return r[O]},has(O){return Object.prototype.hasOwnProperty.call(r,O)},set(O,R){const B=String(R);r[O]=B,b(O),c.push({action:"set",key:O,value:B})},unset(O){delete r[O],b(O),c.push({action:"unset",key:O})},replaceIn(O){return O.replace(/\{\{\s*([^{}]+?)\s*\}\}/g,(R,B)=>{const M=B.trim();return Object.prototype.hasOwnProperty.call(r,M)?r[M]:R})}},A={get(O){return n[O]},has(O){return Object.prototype.hasOwnProperty.call(n,O)},set(O,R){n[O]=String(R)},unset(O){delete n[O]},replaceIn(O){return O.replace(/\{\{\s*([^{}]+?)\s*\}\}/g,(R,B)=>{const M=B.trim();return Object.prototype.hasOwnProperty.call(n,M)?n[M]:R})}},C={get raw(){return e.body||""},set raw(O){e.body=String(O),e.bodyMode="raw"}},T={get method(){return e.method},set method(O){e.method=String(O)},get url(){return e.url},set url(O){e.url=String(O)},headers:lk(e),body:C},D=t.response?{code:t.response.status,status:t.response.statusText,responseTime:t.response.responseTime,headers:ak(t.response.headers),text:()=>t.response?.body||"",json:()=>JSON.parse(t.response?.body||"")}:void 0,j={request:T,response:D,environment:v,collection:S,variables:A,expect:sk,test(O,R){if(t.phase!=="tests")throw new Error("flex.test is only available in post-response test scripts.");const B=Promise.resolve().then(R).then(()=>{f.push({name:O,passed:!0})}).catch(M=>{f.push({name:O,passed:!1,error:M instanceof Error?M.message:String(M)})});g.push(B)}},E={log:(...O)=>h.push(O.map(Wt).join(" ")),info:(...O)=>h.push(O.map(Wt).join(" ")),warn:(...O)=>h.push(`WARN ${O.map(Wt).join(" ")}`),error:(...O)=>h.push(`ERROR ${O.map(Wt).join(" ")}`)};try{return await new Function("flex","console",`"use strict"; return (async () => {
|
|
47
|
+
${t.script}
|
|
48
|
+
})();`)(j,E),await Promise.all(g),{draft:e,variables:n,collectionVariables:r,externalVariables:s,environmentVariables:a,collectionChanges:c,environmentChanges:d,tests:f,logs:h}}catch(O){return await Promise.all(g),{draft:e,variables:n,collectionVariables:r,externalVariables:s,environmentVariables:a,collectionChanges:c,environmentChanges:d,tests:f,logs:h,error:O instanceof Error?O.message:String(O)}}}function Kd(t){return(t||[]).filter(e=>e.enabled!==!1&&e.key.trim()!=="")}function S0(t){if(t.bodyMode)return t.bodyMode;if(t.binary?.file||t.binary?.fileName)return"binary";if(t.formData?.length)return"formdata";if(t.urlencoded?.length)return"urlencoded";if(t.graphql&&(t.graphql.query||t.graphql.variables))return"graphql";if(!t.body)return"none";const e=(t.contentType||"").toLowerCase();return e.includes("application/x-www-form-urlencoded")?"urlencoded":e.includes("multipart/form-data")?"formdata":e.includes("json")?"json":"raw"}function A0(t){const e=new Set,n=t.auth;return n?.type==="apiKey"&&n.in==="cookie"?e.add("cookies"):n?.type==="digest"?e.add("digest"):n?.type==="hawk"?e.add("hawk"):n?.type==="ntlm"?e.add("ntlm"):n?.type==="oauth1"?e.add("oauth1"):n?.type==="awsv4"&&e.add("awsv4"),t.headers?.some(r=>r.enabled!==!1&&r.key.trim().toLowerCase()==="cookie")&&e.add("cookies"),t.hostExecution?.cookieJar==="session"&&e.add("cookies"),t.hostExecution?.certificateId&&e.add("clientCertificates"),[...e]}function ok(t,e){if(!e.length)return t;const n=t.indexOf("#"),r=n>=0?t.slice(0,n):t,s=n>=0?t.slice(n):"",a=e.map(({key:d,value:f})=>`${encodeURIComponent(d)}=${encodeURIComponent(f)}`).join("&"),c=r.includes("?")?r.endsWith("?")||r.endsWith("&")?"":"&":"?";return`${r}${c}${a}${s}`}function ck(t){const e=t.indexOf("#"),n=e>=0?t.slice(0,e):t,r=e>=0?t.slice(e):"",s=n.indexOf("?");if(s<0)return{url:t,query:[]};const a=[];return new URLSearchParams(n.slice(s+1)).forEach((d,f)=>a.push({key:f,value:d})),{url:`${n.slice(0,s)}${r}`,query:a}}function Yd(t,e){return t.find(([n])=>n.toLowerCase()===e.toLowerCase())?.[1]}function _o(t,e,n){for(let r=t.length-1;r>=0;r-=1)t[r][0].toLowerCase()===e.toLowerCase()&&t.splice(r,1);t.push([e,n])}function uk(t){const e={};for(const[n,r]of t)e[n]=r;return e}function dk(t){const e=t.headerEntries;if(!Array.isArray(e))return Object.entries(t.headers||{});const n=[];for(const r of e){if(Array.isArray(r)&&r.length>=2){n.push([String(r[0]),String(r[1])]);continue}if(r&&typeof r=="object"&&"key"in r&&"value"in r){const s=r;s.enabled!==!1&&n.push([String(s.key),String(s.value)])}}return n.length||e.length===0?n:Object.entries(t.headers||{})}function fk(t){if(typeof globalThis.btoa=="function"){if(typeof TextEncoder>"u")throw new Error("Basic auth requires UTF-8 encoding support.");const n=new TextEncoder().encode(t);let r="";for(const s of n)r+=String.fromCharCode(s);return globalThis.btoa(r)}const e=globalThis.Buffer;if(e?.from)return e.from(t,"utf8").toString("base64");throw new Error("Basic auth requires a Base64 encoder in this runtime.")}function Fe(t,e){return t===void 0||t===""?t:t.replace(/\{\{\s*([^{}]+?)\s*\}\}/g,(n,r)=>{const s=r.trim();return Object.prototype.hasOwnProperty.call(e,s)?e[s]:n})}function hk(t,e){if(!t||t.type==="none"||t.type==="inherit")return t;if(t.type==="bearer")return{type:"bearer",token:Fe(t.token,e)||""};if(t.type==="oauth2"){const n={...t,accessToken:Fe(t.accessToken,e)||""};return t.authorizationUrl!==void 0&&(n.authorizationUrl=Fe(t.authorizationUrl,e)),t.tokenUrl!==void 0&&(n.tokenUrl=Fe(t.tokenUrl,e)),t.clientId!==void 0&&(n.clientId=Fe(t.clientId,e)),t.clientSecret!==void 0&&(n.clientSecret=Fe(t.clientSecret,e)),t.redirectUri!==void 0&&(n.redirectUri=Fe(t.redirectUri,e)),t.scopes!==void 0&&(n.scopes=t.scopes.map(r=>Fe(r,e)||"")),t.username!==void 0&&(n.username=Fe(t.username,e)),t.password!==void 0&&(n.password=Fe(t.password,e)),t.refreshToken!==void 0&&(n.refreshToken=Fe(t.refreshToken,e)),n}return t.type==="basic"?{type:"basic",username:Fe(t.username,e)||"",password:Fe(t.password,e)||""}:t.type==="apiKey"?{type:"apiKey",key:Fe(t.key,e)||"",value:Fe(t.value,e)||"",in:t.in}:t.type==="digest"?{type:"digest",username:Fe(t.username,e)||"",password:Fe(t.password,e)||""}:t.type==="hawk"?{...t,id:Fe(t.id,e)||"",key:Fe(t.key,e)||"",ext:Fe(t.ext,e)}:t.type==="ntlm"?{...t,username:Fe(t.username,e)||"",password:Fe(t.password,e)||"",domain:Fe(t.domain,e),workstation:Fe(t.workstation,e)}:t.type==="oauth1"?{...t,consumerKey:Fe(t.consumerKey,e)||"",consumerSecret:Fe(t.consumerSecret,e)||"",token:Fe(t.token,e),tokenSecret:Fe(t.tokenSecret,e),realm:Fe(t.realm,e)}:{...t,accessKey:Fe(t.accessKey,e)||"",secretKey:Fe(t.secretKey,e)||"",sessionToken:Fe(t.sessionToken,e),region:Fe(t.region,e)||"",service:Fe(t.service,e)||""}}function k0(t,e){return{method:Fe(t.method,e)??t.method,url:Fe(t.url,e)??t.url,query:t.query?.map(n=>({...n,key:Fe(n.key,e)||"",value:Fe(n.value,e)||""})),headers:t.headers?.map(n=>({...n,key:Fe(n.key,e)||"",value:Fe(n.value,e)||""})),body:Fe(t.body,e),contentType:Fe(t.contentType,e),bodyMode:t.bodyMode,urlencoded:t.urlencoded?.map(n=>({...n,key:Fe(n.key,e)||"",value:Fe(n.value,e)||""})),formData:t.formData?.map(n=>({...n,key:Fe(n.key,e)||"",value:Fe(n.value,e)||"",fileName:Fe(n.fileName,e),contentType:Fe(n.contentType,e)})),binary:t.binary?{...t.binary,fileName:Fe(t.binary.fileName,e),contentType:Fe(t.binary.contentType,e)}:void 0,graphql:t.graphql?{query:Fe(t.graphql.query,e)||"",variables:Fe(t.graphql.variables,e)||""}:void 0,auth:hk(t.auth,e),hostExecution:t.hostExecution?{...t.hostExecution}:void 0}}function pk(t,e,n){const r=t.auth;if(!(!r||r.type==="none"||r.type==="inherit")){if(r.type==="bearer"){r.token&&_o(e,"Authorization",`Bearer ${r.token}`);return}if(r.type==="oauth2"){r.accessToken&&_o(e,"Authorization",`Bearer ${r.accessToken}`);return}if(r.type==="basic"){(r.username||r.password)&&_o(e,"Authorization",`Basic ${fk(`${r.username}:${r.password}`)}`);return}r.type!=="apiKey"||!r.key||(r.in==="query"?n.push({key:r.key,value:r.value}):r.in==="header"&&_o(e,r.key,r.value))}}function mk(t,e={}){const n=e.variables?k0(t,e.variables):t,r=(n.method||"GET").trim().toUpperCase(),s=n.url.trim();if(!s)throw new Error("Request URL is required.");const a=A0(n);if(a.length>0)throw new Error(`This request requires API host execution (${a.join(", ")}).`);const c=Kd(n.query),d=Kd(n.headers).map(({key:A,value:C})=>[A,C]);pk(n,d,c);let f,h,g;const b=S0(n);if(b!=="none"){if(b==="formdata")for(let T=d.length-1;T>=0;T-=1)d[T][0].toLowerCase()==="content-type"&&d.splice(T,1);const A=Yd(d,"Content-Type"),C=n.contentType?.trim();if(b==="urlencoded")f=Kd(n.urlencoded).map(({key:D,value:j})=>`${encodeURIComponent(D)}=${encodeURIComponent(j)}`).join("&"),g=f,A||d.push(["Content-Type",C||"application/x-www-form-urlencoded"]),h="form";else if(b==="formdata"){const T=new FormData,D=[];for(const j of(n.formData||[]).filter(E=>E.enabled!==!1&&E.key.trim()!==""))if(j.type==="file"){if(!j.file)throw new Error(`File field "${j.key}" needs a file selection.`);T.append(j.key,j.file,j.fileName||j.file.name),D.push(`${j.key}=[file: ${j.fileName||j.file.name}]`)}else T.append(j.key,j.value),D.push(`${j.key}=${j.value}`);f=D.join(`
|
|
49
|
+
`),g=T,h="multipart"}else if(b==="binary"){const T=n.binary;if(!T?.file)throw new Error("Binary body needs a file selection.");f=`[file: ${T.fileName||T.file.name}]`,g=T.file,A||d.push(["Content-Type",C||T.contentType||T.file.type||"application/octet-stream"]),h="binary"}else if(b==="graphql"){const T=n.graphql?.query||"",D=n.graphql?.variables?.trim()||"";let j={};if(D)try{j=JSON.parse(D)}catch{throw new Error("GraphQL variables must be valid JSON.")}f=JSON.stringify({query:T,variables:j}),g=f,A||d.push(["Content-Type",C||"application/json"]),h="json"}else{f=n.body||"",g=f;const T=b==="json"?"application/json":void 0;!A&&(C||T)&&d.push(["Content-Type",C||T]),h=b==="json"||(A||C||T)?.includes("json")?"json":"text"}}const v=uk(d);return{url:ok(s,c),method:r,headers:v,headerEntries:d,body:f,bodyKind:h,init:{method:r,headers:d,body:g}}}function gk(t){const e=dk(t),n=ck(t.url),r=t.bodyKind==="binary"&&typeof File<"u"&&t.init.body instanceof File?t.init.body:void 0;return{method:t.method,url:n.url,query:n.query,headers:e.map(([s,a])=>({key:s,value:a})),body:t.body,contentType:Yd(e,"Content-Type"),bodyMode:t.bodyKind==="json"?"json":t.bodyKind==="form"?"urlencoded":t.bodyKind==="multipart"?"formdata":t.bodyKind==="binary"?"binary":t.body?"raw":"none",binary:t.bodyKind==="binary"?{file:r,fileName:r?.name,contentType:Yd(e,"Content-Type")}:void 0,urlencoded:t.bodyKind==="form"&&t.body?[...new URLSearchParams(t.body).entries()].map(([s,a])=>({key:s,value:a,enabled:!0})):void 0,auth:{type:"none"}}}function C0(t,e={}){return mk(t,e)}function ca(t){return S0(t)}function N0(t){return A0(t)}function yk(t,e){return k0(t,e)}function bk(t){return gk(t)}function xk(t,e,n){return t.paths[e]?.[n.toLowerCase()]}function vk(t,e){const n=t.components?.securitySchemes?.[e];if(!n)return;if(!("$ref"in n))return n;const r=n.$ref,s="#/components/securitySchemes/";if(!r.startsWith(s))return;const a=t.components?.securitySchemes?.[decodeURIComponent(r.slice(s.length))];return a&&!("$ref"in a)?a:void 0}function wk(t,e,n,r){const a=xk(t,e,n)?.security??t.security??[];if(!a.length)return;const c=a.find(f=>{const h=Object.keys(f);return h.length===1&&!!r[h[0]]});if(c)return c;const d=a.find(f=>{const h=Object.keys(f);return h.length>0&&h.every(g=>!!r[g])});return d||(a.find(f=>Object.keys(f).length===0)??a[0])}function Sk(t,e,n=[]){if(e){if(t.type==="http"&&t.scheme?.toLowerCase()==="bearer")return{type:"bearer",token:e};if(t.type==="http"&&t.scheme?.toLowerCase()==="basic"){const r=e.indexOf(":");return r>=0?{type:"basic",username:e.slice(0,r),password:e.slice(r+1)}:{type:"basic",username:e,password:""}}if(t.type==="apiKey"&&(t.in==="header"||t.in==="query")&&t.name)return{type:"apiKey",key:t.name,value:e,in:t.in};if(t.type==="openIdConnect")return{type:"oauth2",accessToken:e,grantType:"accessToken",scopes:n};if(t.type==="oauth2"){const r=t.flows,s=r?.authorizationCode?["authorizationCode",r.authorizationCode]:r?.clientCredentials?["clientCredentials",r.clientCredentials]:r?.password?["password",r.password]:r?.implicit?["implicit",r.implicit]:void 0,a=s?.[1];return{type:"oauth2",accessToken:e,grantType:s?.[0]||"accessToken",authorizationUrl:a?.authorizationUrl,tokenUrl:a?.tokenUrl,scopes:n.length?n:Object.keys(a?.scopes||{})}}}}function T0(t,e){return{...t,headers:t.headers?.filter(n=>n.key.toLowerCase()!==e.toLowerCase())}}function Ak(t,e){return{...t,query:t.query?.filter(n=>n.key!==e)}}function kk(t,e,n,r,s){let a=bk(s);const c=wk(t,e,n,r.auth||{});if(!c||Object.keys(c).length!==1)return a;const d=Object.keys(c)[0],f=vk(t,d),h=r.auth?.[d]||"";if(!f)return a;if(!h)return{...a,auth:{type:"inherit"}};const g=Sk(f,h,c[d]||[]);return g?(g.type==="bearer"||g.type==="oauth2"||g.type==="basic"?a=T0(a,"Authorization"):g.type==="apiKey"&&g.in==="header"?a=T0(a,g.key):g.type==="apiKey"&&g.in==="query"&&(a=Ak(a,g.key)),{...a,auth:g}):a}function Ck(t,e,n,r,s){const a=p0(t,e,n,r);return{request:kk(t,e,n,r,a),serverUrl:r.serverUrl||s}}const Nk="flexdoc-api-client",Tk=1,tl="workspaces",jk="My Collection",j0=100,E0=256*1024;function ua(){return new Date().toISOString()}function Tn(t){return!!t&&typeof t=="object"&&!Array.isArray(t)}function Pe(t,e){return typeof t[e]=="string"}function Lo(t,e){const n=t[e];return n===void 0||typeof n=="number"&&Number.isFinite(n)}function Bo(t){return!Tn(t)||!Pe(t,"key")||!Pe(t,"value")?!1:t.enabled===void 0||typeof t.enabled=="boolean"}function Ek(t){if(!Bo(t))return!1;const e=t;return!(e.type!==void 0&&e.type!=="text"&&e.type!=="file"||e.fileName!==void 0&&typeof e.fileName!="string"||e.contentType!==void 0&&typeof e.contentType!="string"||e.file!==void 0&&typeof File<"u"&&!(e.file instanceof File))}function Ok(t){return!(!Tn(t)||t.fileName!==void 0&&typeof t.fileName!="string"||t.contentType!==void 0&&typeof t.contentType!="string"||t.file!==void 0&&typeof File<"u"&&!(t.file instanceof File))}function Gd(t){if(!Tn(t)||typeof t.type!="string")return!1;if(t.type==="none"||t.type==="inherit")return!0;if(t.type==="bearer")return Pe(t,"token");if(t.type==="oauth2"){if(!Pe(t,"accessToken"))return!1;const e=new Set(["accessToken","authorizationCode","clientCredentials","password","implicit"]);if(t.grantType!==void 0&&(typeof t.grantType!="string"||!e.has(t.grantType))||t.clientAuthentication!==void 0&&t.clientAuthentication!=="body"&&t.clientAuthentication!=="basic")return!1;for(const n of["authorizationUrl","tokenUrl","clientId","clientSecret","redirectUri","username","password","refreshToken"])if(t[n]!==void 0&&typeof t[n]!="string")return!1;return t.scopes===void 0||Array.isArray(t.scopes)&&t.scopes.every(n=>typeof n=="string")}return t.type==="basic"||t.type==="digest"?Pe(t,"username")&&Pe(t,"password"):t.type==="apiKey"?Pe(t,"key")&&Pe(t,"value")&&(t.in==="header"||t.in==="query"||t.in==="cookie"):t.type==="hawk"?Pe(t,"id")&&Pe(t,"key")&&(t.algorithm===void 0||t.algorithm==="sha1"||t.algorithm==="sha256")&&(t.ext===void 0||typeof t.ext=="string"):t.type==="ntlm"?Pe(t,"username")&&Pe(t,"password")&&(t.domain===void 0||typeof t.domain=="string")&&(t.workstation===void 0||typeof t.workstation=="string"):t.type==="oauth1"?Pe(t,"consumerKey")&&Pe(t,"consumerSecret")&&(t.token===void 0||typeof t.token=="string")&&(t.tokenSecret===void 0||typeof t.tokenSecret=="string")&&(t.realm===void 0||typeof t.realm=="string")&&(t.signatureMethod===void 0||["HMAC-SHA1","HMAC-SHA256","PLAINTEXT"].includes(String(t.signatureMethod))):t.type==="awsv4"?Pe(t,"accessKey")&&Pe(t,"secretKey")&&Pe(t,"region")&&Pe(t,"service")&&(t.sessionToken===void 0||typeof t.sessionToken=="string"):!1}function O0(t){return!Tn(t)||!Pe(t,"method")||!Pe(t,"url")||t.query!==void 0&&(!Array.isArray(t.query)||!t.query.every(Bo))||t.headers!==void 0&&(!Array.isArray(t.headers)||!t.headers.every(Bo))||t.body!==void 0&&typeof t.body!="string"||t.contentType!==void 0&&typeof t.contentType!="string"||t.bodyMode!==void 0&&!["none","raw","json","urlencoded","formdata","binary","graphql"].includes(String(t.bodyMode))||t.urlencoded!==void 0&&(!Array.isArray(t.urlencoded)||!t.urlencoded.every(Bo))||t.formData!==void 0&&(!Array.isArray(t.formData)||!t.formData.every(Ek))||t.binary!==void 0&&!Ok(t.binary)||t.graphql!==void 0&&(!Tn(t.graphql)||!Pe(t.graphql,"query")||!Pe(t.graphql,"variables"))||t.hostExecution!==void 0&&(!Tn(t.hostExecution)||t.hostExecution.certificateId!==void 0&&typeof t.hostExecution.certificateId!="string"||t.hostExecution.cookieJar!==void 0&&t.hostExecution.cookieJar!=="session")?!1:t.auth===void 0||Gd(t.auth)}function M0(t){return Tn(t)&&Pe(t,"id")&&Pe(t,"key")&&Pe(t,"value")&&(t.enabled===void 0||typeof t.enabled=="boolean")}function Mk(t){return!Tn(t)||!Pe(t,"id")||!Pe(t,"name")||!Pe(t,"createdAt")||!Pe(t,"updatedAt")?null:{id:t.id,name:t.name,auth:Gd(t.auth)?t.auth:{type:"none"},variables:Array.isArray(t.variables)?t.variables.filter(M0):[],createdAt:t.createdAt,updatedAt:t.updatedAt}}function Rk(t){return!Tn(t)||!Pe(t,"id")||!Pe(t,"collectionId")||t.parentFolderId!==void 0&&typeof t.parentFolderId!="string"||!Pe(t,"name")||!Pe(t,"createdAt")||!Pe(t,"updatedAt")?null:{id:t.id,collectionId:t.collectionId,parentFolderId:t.parentFolderId,name:t.name,auth:Gd(t.auth)?t.auth:{type:"inherit"},createdAt:t.createdAt,updatedAt:t.updatedAt}}function Dk(t,e){const n=t.map(Rk).filter(s=>s!==null).filter(s=>e.has(s.collectionId)),r=new Map(n.map(s=>[s.id,s]));for(const s of n){if(!s.parentFolderId)continue;const a=r.get(s.parentFolderId);(!a||a.collectionId!==s.collectionId||a.id===s.id)&&(s.parentFolderId=void 0)}for(const s of n){if(!s.parentFolderId)continue;const a=new Set([s.id]);let c=s.parentFolderId;for(;c;){if(a.has(c)){s.parentFolderId=void 0;break}a.add(c),c=r.get(c)?.parentFolderId}}return n}function R0(t){if(!(!Tn(t)||!Pe(t,"preRequest")||!Pe(t,"tests")))return{preRequest:t.preRequest,tests:t.tests}}function _k(t){if(!Tn(t)||!Pe(t,"id")||!Pe(t,"collectionId")||t.folderId!==void 0&&typeof t.folderId!="string"||!Pe(t,"name")||!O0(t.request)||!Pe(t,"createdAt")||!Pe(t,"updatedAt"))return null;const e=R0(t.scripts);return{id:t.id,collectionId:t.collectionId,folderId:t.folderId,name:t.name,request:ai(t.request),...e?{scripts:e}:{},createdAt:t.createdAt,updatedAt:t.updatedAt}}function Lk(t){return!Tn(t)||!Pe(t,"id")||!Pe(t,"name")||!Array.isArray(t.variables)||!Pe(t,"createdAt")||!Pe(t,"updatedAt")?null:{id:t.id,name:t.name,variables:t.variables.filter(M0),createdAt:t.createdAt,updatedAt:t.updatedAt}}function Bk(t){return Array.isArray(t)&&t.length===2&&typeof t[0]=="string"&&typeof t[1]=="string"}function $k(t){return!Tn(t)||!Pe(t,"name")||typeof t.passed!="boolean"||t.error!==void 0&&typeof t.error!="string"?null:{name:t.name,passed:t.passed,error:t.error}}function qk(t){if(!Tn(t)||!Pe(t,"id")||!O0(t.request)||!Pe(t,"executedMethod")||!Pe(t,"resolvedUrl")||!Lo(t,"status")||t.statusText!==void 0&&typeof t.statusText!="string"||!Lo(t,"responseTime")||t.responseHeaders!==void 0&&(!Array.isArray(t.responseHeaders)||!t.responseHeaders.every(Bk))||t.responseBody!==void 0&&typeof t.responseBody!="string"||t.responseBodyTruncated!==void 0&&typeof t.responseBodyTruncated!="boolean"||t.runId!==void 0&&typeof t.runId!="string"||t.runName!==void 0&&typeof t.runName!="string"||!Lo(t,"runIndex")||!Lo(t,"runTotal")||t.runPassed!==void 0&&typeof t.runPassed!="boolean"||t.runCancelled!==void 0&&typeof t.runCancelled!="boolean"||t.error!==void 0&&typeof t.error!="string"||t.scriptError!==void 0&&typeof t.scriptError!="string"||!Pe(t,"createdAt"))return null;const e=R0(t.scripts),n=Array.isArray(t.scriptTests)?t.scriptTests.map($k).filter(s=>s!==null):[],r=Array.isArray(t.scriptLogs)?t.scriptLogs.filter(s=>typeof s=="string"):[];return{id:t.id,collectionId:typeof t.collectionId=="string"?t.collectionId:void 0,folderId:typeof t.folderId=="string"?t.folderId:void 0,request:ai(t.request),...e?{scripts:e}:{},executedMethod:t.executedMethod,resolvedUrl:t.resolvedUrl,status:t.status,statusText:t.statusText,responseTime:t.responseTime,responseHeaders:Array.isArray(t.responseHeaders)?t.responseHeaders.map(([s,a])=>[s,a]):void 0,responseBody:typeof t.responseBody=="string"?t.responseBody:void 0,responseBodyTruncated:t.responseBodyTruncated===!0?!0:void 0,runId:typeof t.runId=="string"?t.runId:void 0,runName:typeof t.runName=="string"?t.runName:void 0,runIndex:typeof t.runIndex=="number"?t.runIndex:void 0,runTotal:typeof t.runTotal=="number"?t.runTotal:void 0,runPassed:typeof t.runPassed=="boolean"?t.runPassed:void 0,runCancelled:t.runCancelled===!0?!0:void 0,error:t.error,...n.length?{scriptTests:n}:{},...r.length?{scriptLogs:r}:{},scriptError:t.scriptError,createdAt:t.createdAt}}function D0(t){const e=Object.create(null);for(const n of t){const r=n.key.trim();n.enabled===!1||!r||(e[r]=n.value)}return e}function wn(t){const e=globalThis.crypto?.randomUUID?.();return e?`${t}-${e}`:`${t}-${Date.now()}-${Math.random().toString(36).slice(2,10)}`}function _0(t,e){const n=e?.trim()||"unknown-host",r=t?.trim()||"untitled";return`flexdoc:${encodeURIComponent(n)}:${encodeURIComponent(r)}`}function ai(t){const e=t.auth?t.auth.type==="oauth2"?{...t.auth,scopes:t.auth.scopes?[...t.auth.scopes]:void 0}:{...t.auth}:void 0;return{...t,query:t.query?.map(n=>({...n})),headers:t.headers?.map(n=>({...n})),urlencoded:t.urlencoded?.map(n=>({...n})),formData:t.formData?.map(n=>({...n,file:void 0})),binary:t.binary?{...t.binary,file:void 0}:void 0,graphql:t.graphql?{...t.graphql}:void 0,auth:e,hostExecution:t.hostExecution?{...t.hostExecution}:void 0}}function nl(){const t=ua();return{version:6,collections:[{id:wn("collection"),name:jk,auth:{type:"none"},variables:[],createdAt:t,updatedAt:t}],folders:[],requests:[],environments:[],history:[]}}function zk(t){if(!Tn(t)||![1,2,3,4,5,6].includes(t.version))return nl();const e=(Array.isArray(t.collections)?t.collections:[]).map(Mk).filter(h=>h!==null);if(e.length===0)return nl();const n=new Set(e.map(h=>h.id)),r=Dk(Array.isArray(t.folders)?t.folders:[],n),s=new Map(r.map(h=>[h.id,h])),a=(Array.isArray(t.requests)?t.requests:[]).map(_k).filter(h=>h!==null).filter(h=>n.has(h.collectionId)).map(h=>h.folderId?s.get(h.folderId)?.collectionId===h.collectionId?h:{...h,folderId:void 0}:h);if(t.version===1)return{version:6,collections:e,folders:r,requests:a,environments:[],history:[]};const c=(Array.isArray(t.environments)?t.environments:[]).map(Lk).filter(h=>h!==null),d=typeof t.activeEnvironmentId=="string"&&c.some(h=>h.id===t.activeEnvironmentId)?t.activeEnvironmentId:void 0,f=(t.version===4||t.version===5||t.version===6)&&Array.isArray(t.history)?t.history.map(qk).filter(h=>h!==null).slice(0,j0):[];return{version:6,collections:e,folders:r,requests:a,environments:c,activeEnvironmentId:d,history:f}}function L0(t,e){const n=e.responseBody===void 0?void 0:e.responseBody.slice(0,E0),r=e.responseBodyTruncated===!0||(e.responseBody?.length||0)>E0,s={id:wn("history"),collectionId:e.collectionId,folderId:e.folderId,request:ai(e.request),...e.scripts?{scripts:cn(e.scripts)}:{},executedMethod:e.executedMethod,resolvedUrl:e.resolvedUrl,status:e.status,statusText:e.statusText,responseTime:e.responseTime,...e.responseHeaders?.length?{responseHeaders:e.responseHeaders.map(([a,c])=>[a,c])}:{},...n!==void 0?{responseBody:n,...r?{responseBodyTruncated:!0}:{}}:{},runId:e.runId,runName:e.runName,runIndex:e.runIndex,runTotal:e.runTotal,runPassed:e.runPassed,...e.runCancelled?{runCancelled:!0}:{},error:e.error,...e.scriptTests?.length?{scriptTests:e.scriptTests.map(a=>({...a}))}:{},...e.scriptLogs?.length?{scriptLogs:[...e.scriptLogs]}:{},scriptError:e.scriptError,createdAt:ua()};return{...t,history:[s,...t.history].slice(0,j0)}}function B0(t,e,n,r={type:"none"}){if(r.type!=="inherit")return{...r};const s=new Map(t.folders.map(f=>[f.id,f])),a=new Set;let c=n?s.get(n):void 0;for(;c&&c.collectionId===e&&!a.has(c.id);){if(a.add(c.id),c.auth.type!=="inherit")return{...c.auth};c=c.parentFolderId?s.get(c.parentFolderId):void 0}const d=t.collections.find(f=>f.id===e);return d&&d.auth.type!=="inherit"?{...d.auth}:{type:"none"}}function $0(t,e){const n=t.collections.find(r=>r.id===e);return D0(n?.variables||[])}function Xd(t){const e=t.environments.find(n=>n.id===t.activeEnvironmentId);return D0(e?.variables||[])}function Jd(t,e){if(!t.activeEnvironmentId||e.length===0)return t;const n=t.environments.findIndex(d=>d.id===t.activeEnvironmentId);if(n<0)return t;let s=t.environments[n].variables.map(d=>({...d})),a=!1;for(const d of e){const f=d.key.trim();if(!f)continue;if(d.action==="unset"){const b=s.filter(v=>v.key.trim()!==f);b.length!==s.length&&(s=b,a=!0);continue}const h=s.map((b,v)=>b.key.trim()===f?v:-1).filter(b=>b>=0),g=d.value||"";if(h.length>0){const b=h[0];s[b]={...s[b],key:f,value:g,enabled:!0},h.length>1&&(s=s.filter((v,S)=>S===b||v.key.trim()!==f))}else s.push({id:wn("variable"),key:f,value:g,enabled:!0});a=!0}if(!a)return t;const c=t.environments.map((d,f)=>f===n?{...d,variables:s,updatedAt:ua()}:d);return{...t,environments:c}}function q0(t,e,n){if(!e||n.length===0)return t;const r=t.collections.findIndex(f=>f.id===e);if(r<0)return t;let a=t.collections[r].variables.map(f=>({...f})),c=!1;for(const f of n){const h=f.key.trim();if(!h)continue;if(f.action==="unset"){const v=a.filter(S=>S.key.trim()!==h);v.length!==a.length&&(a=v,c=!0);continue}const g=a.map((v,S)=>v.key.trim()===h?S:-1).filter(v=>v>=0),b=f.value||"";if(g.length>0){const v=g[0];a[v]={...a[v],key:h,value:b,enabled:!0},g.length>1&&(a=a.filter((S,A)=>A===v||S.key.trim()!==h))}else a.push({id:wn("variable"),key:h,value:b,enabled:!0});c=!0}if(!c)return t;const d=t.collections.map((f,h)=>h===r?{...f,variables:a,updatedAt:ua()}:f);return{...t,collections:d}}function Hk(t,e){return{...t,environments:t.environments.filter(n=>n.id!==e),activeEnvironmentId:t.activeEnvironmentId===e?void 0:t.activeEnvironmentId}}function Ik(t,e){const n=t.folders.find(s=>s.id===e);if(!n)return t;const r=ua();return{...t,folders:t.folders.filter(s=>s.id!==e).map(s=>s.parentFolderId===e?{...s,parentFolderId:n.parentFolderId,updatedAt:r}:s),requests:t.requests.map(s=>s.folderId===e?{...s,folderId:n.parentFolderId,updatedAt:r}:s)}}function Uk(t,e){const n=t.collections.filter(r=>r.id!==e);return n.length===0?{...nl(),environments:t.environments,activeEnvironmentId:t.activeEnvironmentId,history:t.history}:{...t,collections:n,folders:t.folders.filter(r=>r.collectionId!==e),requests:t.requests.filter(r=>r.collectionId!==e)}}function z0(){return typeof indexedDB>"u"?Promise.resolve(null):new Promise((t,e)=>{const n=indexedDB.open(Nk,Tk);n.onupgradeneeded=()=>{const r=n.result;r.objectStoreNames.contains(tl)||r.createObjectStore(tl)},n.onsuccess=()=>t(n.result),n.onerror=()=>e(n.error||new Error("Unable to open FlexDoc API Client storage"))})}async function H0(t){const e=await z0();if(!e)return nl();try{return await new Promise((n,r)=>{const a=e.transaction(tl,"readonly").objectStore(tl).get(t);a.onsuccess=()=>n(zk(a.result)),a.onerror=()=>r(a.error||new Error("Unable to load FlexDoc API Client workspace"))})}finally{e.close()}}async function I0(t,e){const n=await z0();if(n)try{await new Promise((r,s)=>{const a=n.transaction(tl,"readwrite");a.objectStore(tl).put(e,t),a.oncomplete=()=>r(),a.onerror=()=>s(a.error||new Error("Unable to save FlexDoc API Client workspace")),a.onabort=()=>s(a.error||new Error("Unable to save FlexDoc API Client workspace"))})}finally{n.close()}}function il(t,e){const n=t?.trim();if(!n)throw new Error(`${e} is required for this OAuth flow.`);return n}function $o(t){return(t.scopes||[]).map(e=>e.trim()).filter(Boolean).join(" ")}function Fk(t){if(typeof TextEncoder>"u")throw new Error("OAuth Basic client authentication requires UTF-8 encoding support.");const e=new TextEncoder().encode(t);let n="";for(const a of e)n+=String.fromCharCode(a);const r=globalThis.Buffer,s=typeof btoa=="function"?btoa(n):r?.from(n,"binary").toString("base64");if(!s)throw new Error("OAuth Basic client authentication requires Base64 support in this runtime.");return s}function U0(t){let e="";for(const s of t)e+=String.fromCharCode(s);const n=globalThis.Buffer,r=typeof btoa=="function"?btoa(e):n?.from(e,"binary").toString("base64");if(!r)throw new Error("OAuth PKCE requires Base64 support in this runtime.");return r.replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/g,"")}function F0(t=32){if(!globalThis.crypto?.getRandomValues)throw new Error("OAuth requires cryptographic random-number support.");const e=new Uint8Array(t);return globalThis.crypto.getRandomValues(e),U0(e)}async function Vk(t){if(!globalThis.crypto?.subtle||typeof TextEncoder>"u")throw new Error("OAuth authorization-code flow requires Web Crypto PKCE support.");const e=await globalThis.crypto.subtle.digest("SHA-256",new TextEncoder().encode(t));return U0(new Uint8Array(e))}function V0(t,e,n,r){const s=il(t.authorizationUrl,"Authorization URL"),a=il(t.clientId,"Client ID"),c=new URL(s),d=t.grantType||"accessToken";c.searchParams.set("response_type",d==="implicit"?"token":"code"),c.searchParams.set("client_id",a),c.searchParams.set("redirect_uri",n),c.searchParams.set("state",e);const f=$o(t);return f&&c.searchParams.set("scope",f),r&&(c.searchParams.set("code_challenge",r),c.searchParams.set("code_challenge_method","S256")),c.toString()}function Pk(t){const e=new URL(t.location.href);return e.search="",e.hash="",e.toString()}async function Kk(t,e){const n=e??(typeof window>"u"?void 0:window);if(!n)throw new Error("Interactive OAuth requires a browser window.");const r=t.redirectUri?.trim()||Pk(n);if(new URL(r).origin!==n.location.origin)throw new Error("Interactive OAuth redirect URI must use the same origin as the FlexDoc page so the popup result can be read.");const s=F0(24);if((t.grantType||"accessToken")==="implicit")return{url:V0(t,s,r),state:s,redirectUri:r};const a=F0(48),c=await Vk(a);return{url:V0(t,s,r,c),state:s,redirectUri:r,codeVerifier:a}}async function Yk(t){const e=await t.text();let n;try{n=e?JSON.parse(e):{}}catch{n=Object.fromEntries(new URLSearchParams(e))}if(!t.ok){const c=String(n.error_description||n.error||`OAuth token endpoint returned ${t.status}`);throw new Error(c)}const r=typeof n.access_token=="string"?n.access_token:"";if(!r)throw new Error("OAuth token endpoint did not return access_token.");const s=n.expires_in,a=typeof s=="number"?s:typeof s=="string"&&s.trim()!==""&&Number.isFinite(Number(s))?Number(s):void 0;return{accessToken:r,refreshToken:typeof n.refresh_token=="string"?n.refresh_token:void 0,tokenType:typeof n.token_type=="string"?n.token_type:void 0,expiresIn:a,scope:typeof n.scope=="string"?n.scope:void 0}}async function qo(t,e,n){const r=il(t.tokenUrl,"Token URL"),s={"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},a=t.clientId?.trim();(t.clientAuthentication||"body")==="basic"&&a?s.Authorization=`Basic ${Fk(`${a}:${t.clientSecret||""}`)}`:(a&&e.set("client_id",a),t.clientSecret&&e.set("client_secret",t.clientSecret));const c=await n(r,{method:"POST",headers:s,body:e.toString()});return Yk(c)}async function Gk(t,e){const n=e.windowObject??(typeof window>"u"?void 0:window);if(!n)throw new Error("Interactive OAuth requires a browser window.");const r=n.open(t.url,"flexdoc-oauth","popup,width=640,height=760");if(!r)throw new Error("OAuth popup was blocked. Allow popups for this documentation origin and try again.");const s=new URL(t.redirectUri),a=Date.now(),c=e.popupTimeoutMs??12e4,d=e.pollIntervalMs??200;for(;Date.now()-a<c;){if(r.closed)throw new Error("OAuth popup was closed before authorization completed.");try{const f=new URL(r.location.href);if(f.origin===s.origin&&f.pathname===s.pathname)return r.close(),f}catch{}await new Promise(f=>setTimeout(f,d))}throw r.close(),new Error("OAuth authorization timed out.")}async function Xk(t,e={}){const n=t.grantType||"accessToken",r=e.fetchImpl??fetch;if(n==="accessToken")return{accessToken:il(t.accessToken,"Access token")};if(n==="clientCredentials"){const b=new URLSearchParams({grant_type:"client_credentials"}),v=$o(t);return v&&b.set("scope",v),qo(t,b,r)}if(n==="password"){const b=new URLSearchParams({grant_type:"password",username:il(t.username,"Username"),password:t.password||""}),v=$o(t);return v&&b.set("scope",v),qo(t,b,r)}const s=await Kk(t,e.windowObject),a=await Gk(s,e);if((a.searchParams.get("state")||new URLSearchParams(a.hash.replace(/^#/,"")).get("state"))!==s.state)throw new Error("OAuth state mismatch; authorization response was rejected.");const d=new URLSearchParams(a.hash.replace(/^#/,"")),f=a.searchParams.get("error")||d.get("error");if(f){const b=a.searchParams.get("error_description")||d.get("error_description");throw new Error(b||f)}if(n==="implicit"){const b=d.get("access_token")||"";if(!b)throw new Error("OAuth implicit response did not include access_token.");return{accessToken:b,tokenType:d.get("token_type")||void 0,expiresIn:d.get("expires_in")?Number(d.get("expires_in")):void 0,scope:d.get("scope")||void 0}}const h=a.searchParams.get("code");if(!h)throw new Error("OAuth authorization response did not include code.");const g=new URLSearchParams({grant_type:"authorization_code",code:h,redirect_uri:s.redirectUri});return s.codeVerifier&&g.set("code_verifier",s.codeVerifier),qo(t,g,r)}async function Jk(t,e={}){const n=il(t.refreshToken,"Refresh token"),r=new URLSearchParams({grant_type:"refresh_token",refresh_token:n}),s=$o(t);return s&&r.set("scope",s),qo(t,r,e.fetchImpl??fetch)}function Qk(t){return t==="inherit"?{type:"inherit"}:t==="bearer"?{type:"bearer",token:""}:t==="oauth2"?{type:"oauth2",accessToken:"",grantType:"accessToken",scopes:[]}:t==="basic"?{type:"basic",username:"",password:""}:t==="apiKey"?{type:"apiKey",key:"",value:"",in:"header"}:t==="digest"?{type:"digest",username:"",password:""}:t==="hawk"?{type:"hawk",id:"",key:"",algorithm:"sha256"}:t==="ntlm"?{type:"ntlm",username:"",password:""}:t==="oauth1"?{type:"oauth1",consumerKey:"",consumerSecret:"",signatureMethod:"HMAC-SHA1"}:t==="awsv4"?{type:"awsv4",accessKey:"",secretKey:"",region:"",service:""}:{type:"none"}}function Wk(t){return t.split(/\s+/).map(e=>e.trim()).filter(Boolean)}const P0=({auth:t,fieldClass:e,label:n,onChange:r})=>{const[s,a]=I.useState(!1),[c,d]=I.useState(null),f=t.grantType||"accessToken",h=f==="authorizationCode"||f==="implicit",g=f==="authorizationCode"||f==="clientCredentials"||f==="password",b=f!=="accessToken",v=async()=>{a(!0),d(null);try{const A=await Xk(t);r({...t,accessToken:A.accessToken,refreshToken:A.refreshToken??t.refreshToken}),d(A.expiresIn?`Access token acquired; expires in ${A.expiresIn}s.`:"Access token acquired.")}catch(A){d(A instanceof Error?A.message:"OAuth authorization failed.")}finally{a(!1)}},S=async()=>{a(!0),d(null);try{const A=await Jk(t);r({...t,accessToken:A.accessToken,refreshToken:A.refreshToken??t.refreshToken}),d("Access token refreshed.")}catch(A){d(A instanceof Error?A.message:"OAuth token refresh failed.")}finally{a(!1)}};return p.jsxs("div",{className:"space-y-2",children:[p.jsxs("select",{"aria-label":n?`${n} OAuth grant type`:"OAuth grant type",className:e,value:f,onChange:A=>r({...t,grantType:A.target.value}),children:[p.jsx("option",{value:"accessToken",children:"Manual access token"}),p.jsx("option",{value:"authorizationCode",children:"Authorization Code + PKCE"}),p.jsx("option",{value:"clientCredentials",children:"Client Credentials"}),p.jsx("option",{value:"password",children:"Password grant (legacy)"}),p.jsx("option",{value:"implicit",children:"Implicit grant (legacy)"})]}),h&&p.jsx("input",{"aria-label":n?`${n} OAuth authorization URL`:"OAuth authorization URL",className:e,placeholder:"Authorization URL",value:t.authorizationUrl||"",onChange:A=>r({...t,authorizationUrl:A.target.value})}),g&&p.jsx("input",{"aria-label":n?`${n} OAuth token URL`:"OAuth token URL",className:e,placeholder:"Token URL",value:t.tokenUrl||"",onChange:A=>r({...t,tokenUrl:A.target.value})}),b&&p.jsx("input",{"aria-label":n?`${n} OAuth client ID`:"OAuth client ID",className:e,placeholder:"Client ID",value:t.clientId||"",onChange:A=>r({...t,clientId:A.target.value})}),(f==="authorizationCode"||f==="clientCredentials"||f==="password")&&p.jsx("input",{"aria-label":n?`${n} OAuth client secret`:"OAuth client secret",type:"password",autoComplete:"off",className:e,placeholder:f==="authorizationCode"?"Client secret (optional for PKCE/public clients)":"Client secret (optional)",value:t.clientSecret||"",onChange:A=>r({...t,clientSecret:A.target.value})}),g&&p.jsxs("select",{"aria-label":n?`${n} OAuth client authentication`:"OAuth client authentication",className:e,value:t.clientAuthentication||"body",onChange:A=>r({...t,clientAuthentication:A.target.value}),children:[p.jsx("option",{value:"body",children:"Send client credentials in body"}),p.jsx("option",{value:"basic",children:"Send as Basic Auth header"})]}),h&&p.jsx("input",{"aria-label":n?`${n} OAuth redirect URI`:"OAuth redirect URI",className:e,placeholder:"Redirect URI (defaults to this page)",value:t.redirectUri||"",onChange:A=>r({...t,redirectUri:A.target.value})}),b&&p.jsx("input",{"aria-label":n?`${n} OAuth scopes`:"OAuth scopes",className:e,placeholder:"Scopes separated by spaces",value:(t.scopes||[]).join(" "),onChange:A=>r({...t,scopes:Wk(A.target.value)})}),f==="password"&&p.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[p.jsx("input",{"aria-label":n?`${n} OAuth username`:"OAuth username",className:e,placeholder:"Resource owner username",value:t.username||"",onChange:A=>r({...t,username:A.target.value})}),p.jsx("input",{"aria-label":n?`${n} OAuth password`:"OAuth password",type:"password",autoComplete:"off",className:e,placeholder:"Resource owner password",value:t.password||"",onChange:A=>r({...t,password:A.target.value})})]}),p.jsx("input",{"aria-label":n?`${n} OAuth access token`:"OAuth access token",type:"password",autoComplete:"off",className:e,placeholder:"Access token",value:t.accessToken,onChange:A=>r({...t,accessToken:A.target.value})}),f!=="accessToken"&&p.jsxs("div",{className:"flex flex-wrap gap-2",children:[p.jsx("button",{type:"button",disabled:s,onClick:v,className:"rounded-md border px-2.5 py-1.5 text-xs font-medium disabled:opacity-60",children:s?"Authorizing…":"Get access token"}),t.refreshToken&&t.tokenUrl&&p.jsx("button",{type:"button",disabled:s,onClick:S,className:"rounded-md border px-2.5 py-1.5 text-xs font-medium disabled:opacity-60",children:"Refresh access token"})]}),f!=="accessToken"&&p.jsx("p",{className:"text-[11px] opacity-70",children:"Authorization Code uses PKCE. Popup callbacks must return to this page origin; token endpoints must allow browser CORS. Client secrets entered here are browser-visible and should only be used when the OAuth provider permits it."}),c&&p.jsx("p",{role:"status",className:"text-xs",children:c})]})},K0=({auth:t,label:e,allowInherit:n=!1,hostExecution:r,onChange:s,theme:a})=>{const d=`w-full rounded-md border px-2 py-1.5 text-xs ${a==="dark"?"bg-gray-900 border-gray-700 text-gray-100":"bg-white border-gray-300 text-gray-900"}`,f=new Set(r?.capabilities||[]),h=b=>r?.available===!0&&f.has(b),g=t.type==="digest"?"digest":t.type==="hawk"?"hawk":t.type==="ntlm"?"ntlm":t.type==="oauth1"?"oauth1":t.type==="awsv4"?"awsv4":t.type==="apiKey"&&t.in==="cookie"?"cookies":void 0;return p.jsxs("div",{className:"space-y-2",children:[p.jsxs("select",{"aria-label":`${e} authorization type`,className:d,value:t.type==="inherit"&&!n?"none":t.type,onChange:b=>s(Qk(b.target.value)),children:[n&&p.jsx("option",{value:"inherit",children:"Inherit from parent"}),p.jsx("option",{value:"none",children:"No auth"}),p.jsx("option",{value:"bearer",children:"Bearer token"}),p.jsx("option",{value:"oauth2",children:"OAuth 2.0"}),p.jsx("option",{value:"basic",children:"Basic auth"}),p.jsx("option",{value:"apiKey",children:"API key"}),p.jsx("option",{value:"digest",disabled:!h("digest"),children:"Digest (API host)"}),p.jsx("option",{value:"hawk",disabled:!h("hawk"),children:"Hawk (API host)"}),p.jsx("option",{value:"ntlm",disabled:!h("ntlm"),children:"NTLM / Negotiate (API host)"}),p.jsx("option",{value:"oauth1",disabled:!h("oauth1"),children:"OAuth 1.0 (API host)"}),p.jsx("option",{value:"awsv4",disabled:!h("awsv4"),children:"AWS Signature v4 (API host)"})]}),t.type==="bearer"&&p.jsx("input",{"aria-label":`${e} bearer token`,type:"password",autoComplete:"off",className:d,value:t.token,onChange:b=>s({...t,token:b.target.value})}),t.type==="oauth2"&&p.jsx(P0,{auth:t,fieldClass:d,label:e,onChange:s}),(t.type==="basic"||t.type==="digest")&&p.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[p.jsx("input",{"aria-label":`${e} ${t.type} username`,className:d,placeholder:"Username",value:t.username,onChange:b=>s({...t,username:b.target.value})}),p.jsx("input",{"aria-label":`${e} ${t.type} password`,type:"password",autoComplete:"off",className:d,placeholder:"Password",value:t.password,onChange:b=>s({...t,password:b.target.value})})]}),t.type==="apiKey"&&p.jsxs("div",{className:"space-y-2",children:[p.jsx("input",{"aria-label":`${e} API key name`,className:d,placeholder:"Key name",value:t.key,onChange:b=>s({...t,key:b.target.value})}),p.jsx("input",{"aria-label":`${e} API key value`,type:"password",autoComplete:"off",className:d,placeholder:"Value",value:t.value,onChange:b=>s({...t,value:b.target.value})}),p.jsxs("select",{"aria-label":`${e} API key location`,className:d,value:t.in,onChange:b=>s({...t,in:b.target.value}),children:[p.jsx("option",{value:"header",children:"Header"}),p.jsx("option",{value:"query",children:"Query"}),p.jsx("option",{value:"cookie",disabled:!h("cookies"),children:"Cookie (API host)"})]})]}),t.type==="hawk"&&p.jsxs("div",{className:"grid gap-2",children:[p.jsx("input",{"aria-label":`${e} Hawk id`,className:d,placeholder:"ID",value:t.id,onChange:b=>s({...t,id:b.target.value})}),p.jsx("input",{"aria-label":`${e} Hawk key`,type:"password",autoComplete:"off",className:d,placeholder:"Key",value:t.key,onChange:b=>s({...t,key:b.target.value})}),p.jsxs("select",{"aria-label":`${e} Hawk algorithm`,className:d,value:t.algorithm||"sha256",onChange:b=>s({...t,algorithm:b.target.value}),children:[p.jsx("option",{value:"sha256",children:"SHA-256"}),p.jsx("option",{value:"sha1",children:"SHA-1"})]}),p.jsx("input",{"aria-label":`${e} Hawk ext`,className:d,placeholder:"ext (optional)",value:t.ext||"",onChange:b=>s({...t,ext:b.target.value})})]}),t.type==="ntlm"&&p.jsxs("div",{className:"grid gap-2",children:[p.jsx("input",{"aria-label":`${e} NTLM username`,className:d,placeholder:"Username",value:t.username,onChange:b=>s({...t,username:b.target.value})}),p.jsx("input",{"aria-label":`${e} NTLM password`,type:"password",autoComplete:"off",className:d,placeholder:"Password",value:t.password,onChange:b=>s({...t,password:b.target.value})}),p.jsx("input",{"aria-label":`${e} NTLM domain`,className:d,placeholder:"Domain (optional)",value:t.domain||"",onChange:b=>s({...t,domain:b.target.value})}),p.jsx("input",{"aria-label":`${e} NTLM workstation`,className:d,placeholder:"Workstation (optional)",value:t.workstation||"",onChange:b=>s({...t,workstation:b.target.value})})]}),t.type==="oauth1"&&p.jsxs("div",{className:"grid gap-2",children:[p.jsx("input",{"aria-label":`${e} OAuth1 consumer key`,className:d,placeholder:"Consumer key",value:t.consumerKey,onChange:b=>s({...t,consumerKey:b.target.value})}),p.jsx("input",{"aria-label":`${e} OAuth1 consumer secret`,type:"password",autoComplete:"off",className:d,placeholder:"Consumer secret",value:t.consumerSecret,onChange:b=>s({...t,consumerSecret:b.target.value})}),p.jsx("input",{"aria-label":`${e} OAuth1 token`,className:d,placeholder:"Token (optional)",value:t.token||"",onChange:b=>s({...t,token:b.target.value})}),p.jsx("input",{"aria-label":`${e} OAuth1 token secret`,type:"password",autoComplete:"off",className:d,placeholder:"Token secret (optional)",value:t.tokenSecret||"",onChange:b=>s({...t,tokenSecret:b.target.value})}),p.jsxs("select",{"aria-label":`${e} OAuth1 signature method`,className:d,value:t.signatureMethod||"HMAC-SHA1",onChange:b=>s({...t,signatureMethod:b.target.value}),children:[p.jsx("option",{children:"HMAC-SHA1"}),p.jsx("option",{children:"HMAC-SHA256"}),p.jsx("option",{children:"PLAINTEXT"})]}),p.jsx("input",{"aria-label":`${e} OAuth1 realm`,className:d,placeholder:"Realm (optional)",value:t.realm||"",onChange:b=>s({...t,realm:b.target.value})})]}),t.type==="awsv4"&&p.jsxs("div",{className:"grid gap-2",children:[p.jsx("input",{"aria-label":`${e} AWS access key`,className:d,placeholder:"Access key",value:t.accessKey,onChange:b=>s({...t,accessKey:b.target.value})}),p.jsx("input",{"aria-label":`${e} AWS secret key`,type:"password",autoComplete:"off",className:d,placeholder:"Secret key",value:t.secretKey,onChange:b=>s({...t,secretKey:b.target.value})}),p.jsx("input",{"aria-label":`${e} AWS session token`,type:"password",autoComplete:"off",className:d,placeholder:"Session token (optional)",value:t.sessionToken||"",onChange:b=>s({...t,sessionToken:b.target.value})}),p.jsx("input",{"aria-label":`${e} AWS region`,className:d,placeholder:"Region",value:t.region,onChange:b=>s({...t,region:b.target.value})}),p.jsx("input",{"aria-label":`${e} AWS service`,className:d,placeholder:"Service",value:t.service,onChange:b=>s({...t,service:b.target.value})})]}),g&&p.jsx("p",{role:h(g)?"status":"alert",className:"text-[11px] opacity-75",children:h(g)?"This authorization mode is executed by the FlexDoc API host.":"Host execution is disabled or this documentation host does not support the selected authorization mode."})]})};let Qd=[],Y0=[];(()=>{let t="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,1n,9,16,o,,x,1i,3,,i,,7,a,2,t,3,1k,,,7,2,2,2,3,9,,a,2,q,,2,3,1k,,,5,4,2,2,3,3,,u,2,3,,b,3,1k,,,8,,3,,3,k,2,m,6,,3,1k,,,7,2,2,2,3,7,3,a,2,u,,1n,5,3,3,,4,9,,14,5,1j,,,7,,3,,4,7,2,b,2,t,3,1k,,,7,,3,,4,7,2,b,2,f,,c,4,1j,2,,7,,3,,4,9,,a,2,t,3,1y,,4,6,,,,8,i,2,1p,,,8,c,8,2q,,,a,b,7,21,2,r,,,,,,4,2,1d,k,,2,5,b,,10,9,,2u,b,,6,n,4,4,3,g,4,d,,,3,6,,f,,jj,3,qa,4,s,3,t,2,u,2,1s,w,9,,19,3,,,39,2,y,,3a,c,4,c,63,5,1l,a,,,,,2,o,2,,1c,1a,2,c,k,5,1b,h,12,9,c,3,u,d,1k,e,1c,k,48,3,,l,4,,6,,2,3,5i,1s,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,n,5,4,,2b,2,1e,i,q,i,d,,12,8,p,d,18,4,1b,e,10,,1v,e,c,,8,2,1a,,1f,,,3,2,2,5,2,,,15,5,5,2,6k,8,,2,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,1t,5,8t,2,25,6,1y,b,1d,4,3e,3,1h,f,15,,2,2,a,4,19,b,7,,1p,3,10,e,g,2,18,,c,3,1c,e,8,4,,2,2k,c,6,,2,,4d,c,l,4,1j,2,,7,2,2,2,3,9,,a,2,2,7,3,5,1v,9,,,2,,,4,,5,,,e,2,2a,i,n,,29,k,6j,7,2,9,r,2,2a,h,2y,d,2t,3,2,a,74,f,6t,6,,2,2,4,,,,2,3x,7,2,7,3,,s,a,14,7,,4,8,,9,b,1a,g,5i,8,5j,8,,8,2a,m,,e,3e,6,3,,,2,,7,,,1u,5,,2,,5,9n,4,9,2,,,1c,7,3,5,n,,44l,,6,f,8ug,i,1xc,5,1n,7,t4,,,1j,7,4,29,,b,2,f57,2,3mp,1a,2,n,f2,5,3,6,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,2s,,4g,7,af,,1p,4,e4,4,72,2,6r,,2,,7,2,5,,d6,7,31,7,240,5".split(",").map(e=>e?parseInt(e,36):1);for(let e=0,n=0;e<t.length;e++)(e%2?Y0:Qd).push(n=n+t[e])})();function Zk(t){if(t<768)return!1;for(let e=0,n=Qd.length;;){let r=e+n>>1;if(t<Qd[r])n=r;else if(t>=Y0[r])e=r+1;else return!0;if(e==n)return!1}}function G0(t){return t>=127462&&t<=127487}const X0=8205;function eC(t,e,n=!0,r=!0){return(n?J0:tC)(t,e,r)}function J0(t,e,n){if(e==t.length)return e;e&&Q0(t.charCodeAt(e))&&W0(t.charCodeAt(e-1))&&e--;let r=Wd(t,e);for(e+=Z0(r);e<t.length;){let s=Wd(t,e);if(r==X0||s==X0||n&&Zk(s))e+=Z0(s),r=s;else if(G0(s)){let a=0,c=e-2;for(;c>=0&&G0(Wd(t,c));)a++,c-=2;if(a%2==0)break;e+=2}else break}return e}function tC(t,e,n){for(;e>1;){let r=J0(t,e-2,n);if(r<e)return r;e--}return 0}function Wd(t,e){let n=t.charCodeAt(e);if(!W0(n)||e+1==t.length)return n;let r=t.charCodeAt(e+1);return Q0(r)?(n-55296<<10)+(r-56320)+65536:n}function Q0(t){return t>=56320&&t<57344}function W0(t){return t>=55296&&t<56320}function Z0(t){return t<65536?1:2}class pt{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,n,r){[e,n]=rl(this,e,n);let s=[];return this.decompose(0,e,s,2),r.length&&r.decompose(0,r.length,s,3),this.decompose(n,this.length,s,1),Hi.from(s,this.length-(n-e)+r.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,n=this.length){[e,n]=rl(this,e,n);let r=[];return this.decompose(e,n,r,0),Hi.from(r,n-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let n=this.scanIdentical(e,1),r=this.length-this.scanIdentical(e,-1),s=new da(this),a=new da(e);for(let c=n,d=n;;){if(s.next(c),a.next(c),c=0,s.lineBreak!=a.lineBreak||s.done!=a.done||s.value!=a.value)return!1;if(d+=s.value.length,s.done||d>=r)return!0}}iter(e=1){return new da(this,e)}iterRange(e,n=this.length){return new ty(this,e,n)}iterLines(e,n){let r;if(e==null)r=this.iter();else{n==null&&(n=this.lines+1);let s=this.line(e).from;r=this.iterRange(s,Math.max(s,n==this.lines+1?this.length:n<=1?0:this.line(n-1).to))}return new ny(r)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?pt.empty:e.length<=32?new qt(e):Hi.from(qt.split(e,[]))}}class qt extends pt{constructor(e,n=nC(e)){super(),this.text=e,this.length=n}get lines(){return this.text.length}get children(){return null}lineInner(e,n,r,s){for(let a=0;;a++){let c=this.text[a],d=s+c.length;if((n?r:d)>=e)return new iC(s,d,r,c);s=d+1,r++}}decompose(e,n,r,s){let a=e<=0&&n>=this.length?this:new qt(ey(this.text,e,n),Math.min(n,this.length)-Math.max(0,e));if(s&1){let c=r.pop(),d=zo(a.text,c.text.slice(),0,a.length);if(d.length<=32)r.push(new qt(d,c.length+a.length));else{let f=d.length>>1;r.push(new qt(d.slice(0,f)),new qt(d.slice(f)))}}else r.push(a)}replace(e,n,r){if(!(r instanceof qt))return super.replace(e,n,r);[e,n]=rl(this,e,n);let s=zo(this.text,zo(r.text,ey(this.text,0,e)),n),a=this.length+r.length-(n-e);return s.length<=32?new qt(s,a):Hi.from(qt.split(s,[]),a)}sliceString(e,n=this.length,r=`
|
|
50
|
+
`){[e,n]=rl(this,e,n);let s="";for(let a=0,c=0;a<=n&&c<this.text.length;c++){let d=this.text[c],f=a+d.length;a>e&&c&&(s+=r),e<f&&n>a&&(s+=d.slice(Math.max(0,e-a),n-a)),a=f+1}return s}flatten(e){for(let n of this.text)e.push(n)}scanIdentical(){return 0}static split(e,n){let r=[],s=-1;for(let a of e)r.push(a),s+=a.length+1,r.length==32&&(n.push(new qt(r,s)),r=[],s=-1);return s>-1&&n.push(new qt(r,s)),n}}class Hi extends pt{constructor(e,n){super(),this.children=e,this.length=n,this.lines=0;for(let r of e)this.lines+=r.lines}lineInner(e,n,r,s){for(let a=0;;a++){let c=this.children[a],d=s+c.length,f=r+c.lines-1;if((n?f:d)>=e)return c.lineInner(e,n,r,s);s=d+1,r=f+1}}decompose(e,n,r,s){for(let a=0,c=0;c<=n&&a<this.children.length;a++){let d=this.children[a],f=c+d.length;if(e<=f&&n>=c){let h=s&((c<=e?1:0)|(f>=n?2:0));c>=e&&f<=n&&!h?r.push(d):d.decompose(e-c,n-c,r,h)}c=f+1}}replace(e,n,r){if([e,n]=rl(this,e,n),r.lines<this.lines)for(let s=0,a=0;s<this.children.length;s++){let c=this.children[s],d=a+c.length;if(e>=a&&n<=d){let f=c.replace(e-a,n-a,r),h=this.lines-c.lines+f.lines;if(f.lines<h>>4&&f.lines>h>>6){let g=this.children.slice();return g[s]=f,new Hi(g,this.length-(n-e)+r.length)}return super.replace(a,d,f)}a=d+1}return super.replace(e,n,r)}sliceString(e,n=this.length,r=`
|
|
51
|
+
`){[e,n]=rl(this,e,n);let s="";for(let a=0,c=0;a<this.children.length&&c<=n;a++){let d=this.children[a],f=c+d.length;c>e&&a&&(s+=r),e<f&&n>c&&(s+=d.sliceString(e-c,n-c,r)),c=f+1}return s}flatten(e){for(let n of this.children)n.flatten(e)}scanIdentical(e,n){if(!(e instanceof Hi))return 0;let r=0,[s,a,c,d]=n>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;s+=n,a+=n){if(s==c||a==d)return r;let f=this.children[s],h=e.children[a];if(f!=h)return r+f.scanIdentical(h,n);r+=f.length+1}}static from(e,n=e.reduce((r,s)=>r+s.length+1,-1)){let r=0;for(let S of e)r+=S.lines;if(r<32){let S=[];for(let A of e)A.flatten(S);return new qt(S,n)}let s=Math.max(32,r>>5),a=s<<1,c=s>>1,d=[],f=0,h=-1,g=[];function b(S){let A;if(S.lines>a&&S instanceof Hi)for(let C of S.children)b(C);else S.lines>c&&(f>c||!f)?(v(),d.push(S)):S instanceof qt&&f&&(A=g[g.length-1])instanceof qt&&S.lines+A.lines<=32?(f+=S.lines,h+=S.length+1,g[g.length-1]=new qt(A.text.concat(S.text),A.length+1+S.length)):(f+S.lines>s&&v(),f+=S.lines,h+=S.length+1,g.push(S))}function v(){f!=0&&(d.push(g.length==1?g[0]:Hi.from(g,h)),h=-1,f=g.length=0)}for(let S of e)b(S);return v(),d.length==1?d[0]:new Hi(d,n)}}pt.empty=new qt([""],0);function nC(t){let e=-1;for(let n of t)e+=n.length+1;return e}function zo(t,e,n=0,r=1e9){for(let s=0,a=0,c=!0;a<t.length&&s<=r;a++){let d=t[a],f=s+d.length;f>=n&&(f>r&&(d=d.slice(0,r-s)),s<n&&(d=d.slice(n-s)),c?(e[e.length-1]+=d,c=!1):e.push(d)),s=f+1}return e}function ey(t,e,n){return zo(t,[""],e,n)}class da{constructor(e,n=1){this.dir=n,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[e],this.offsets=[n>0?1:(e instanceof qt?e.text.length:e.children.length)<<1]}nextInner(e,n){for(this.done=this.lineBreak=!1;;){let r=this.nodes.length-1,s=this.nodes[r],a=this.offsets[r],c=a>>1,d=s instanceof qt?s.text.length:s.children.length;if(c==(n>0?d:0)){if(r==0)return this.done=!0,this.value="",this;n>0&&this.offsets[r-1]++,this.nodes.pop(),this.offsets.pop()}else if((a&1)==(n>0?0:1)){if(this.offsets[r]+=n,e==0)return this.lineBreak=!0,this.value=`
|
|
52
|
+
`,this;e--}else if(s instanceof qt){let f=s.text[c+(n<0?-1:0)];if(this.offsets[r]+=n,f.length>Math.max(0,e))return this.value=e==0?f:n>0?f.slice(e):f.slice(0,f.length-e),this;e-=f.length}else{let f=s.children[c+(n<0?-1:0)];e>f.length?(e-=f.length,this.offsets[r]+=n):(n<0&&this.offsets[r]--,this.nodes.push(f),this.offsets.push(n>0?1:(f instanceof qt?f.text.length:f.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class ty{constructor(e,n,r){this.value="",this.done=!1,this.cursor=new da(e,n>r?-1:1),this.pos=n>r?e.length:0,this.from=Math.min(n,r),this.to=Math.max(n,r)}nextInner(e,n){if(n<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,n<0?this.pos-this.to:this.from-this.pos);let r=n<0?this.pos-this.from:this.to-this.pos;e>r&&(e=r),r-=e;let{value:s}=this.cursor.next(e);return this.pos+=(s.length+e)*n,this.value=s.length<=r?s:n<0?s.slice(s.length-r):s.slice(0,r),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class ny{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:n,lineBreak:r,value:s}=this.inner.next(e);return n&&this.afterBreak?(this.value="",this.afterBreak=!1):n?(this.done=!0,this.value=""):r?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=s,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(pt.prototype[Symbol.iterator]=function(){return this.iter()},da.prototype[Symbol.iterator]=ty.prototype[Symbol.iterator]=ny.prototype[Symbol.iterator]=function(){return this});class iC{constructor(e,n,r,s){this.from=e,this.to=n,this.number=r,this.text=s}get length(){return this.to-this.from}}function rl(t,e,n){return e=Math.max(0,Math.min(t.length,e)),[e,Math.max(e,Math.min(t.length,n))]}function Sn(t,e,n=!0,r=!0){return eC(t,e,n,r)}function rC(t){return t>=56320&&t<57344}function sC(t){return t>=55296&&t<56320}function lC(t,e){let n=t.charCodeAt(e);if(!sC(n)||e+1==t.length)return n;let r=t.charCodeAt(e+1);return rC(r)?(n-55296<<10)+(r-56320)+65536:n}function aC(t){return t<65536?1:2}const Zd=/\r\n?|\n/;var Yn=(function(t){return t[t.Simple=0]="Simple",t[t.TrackDel=1]="TrackDel",t[t.TrackBefore=2]="TrackBefore",t[t.TrackAfter=3]="TrackAfter",t})(Yn||(Yn={}));class Ii{constructor(e){this.sections=e}get length(){let e=0;for(let n=0;n<this.sections.length;n+=2)e+=this.sections[n];return e}get newLength(){let e=0;for(let n=0;n<this.sections.length;n+=2){let r=this.sections[n+1];e+=r<0?this.sections[n]:r}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let n=0,r=0,s=0;n<this.sections.length;){let a=this.sections[n++],c=this.sections[n++];c<0?(e(r,s,a),s+=a):s+=c,r+=a}}iterChangedRanges(e,n=!1){ef(this,e,n)}get invertedDesc(){let e=[];for(let n=0;n<this.sections.length;){let r=this.sections[n++],s=this.sections[n++];s<0?e.push(r,s):e.push(s,r)}return new Ii(e)}composeDesc(e){return this.empty?e:e.empty?this:iy(this,e)}mapDesc(e,n=!1){return e.empty?this:tf(this,e,n)}mapPos(e,n=-1,r=Yn.Simple){let s=0,a=0;for(let c=0;c<this.sections.length;){let d=this.sections[c++],f=this.sections[c++],h=s+d;if(f<0){if(h>e)return a+(e-s);a+=d}else{if(r!=Yn.Simple&&h>=e&&(r==Yn.TrackDel&&s<e&&h>e||r==Yn.TrackBefore&&s<e||r==Yn.TrackAfter&&h>e))return null;if(h>e||h==e&&n<0&&!d)return e==s||n<0?a:a+f;a+=f}s=h}if(e>s)throw new RangeError(`Position ${e} is out of range for changeset of length ${s}`);return a}touchesRange(e,n=e){for(let r=0,s=0;r<this.sections.length&&s<=n;){let a=this.sections[r++],c=this.sections[r++],d=s+a;if(c>=0&&s<=n&&d>=e)return s<e&&d>n?"cover":!0;s=d}return!1}toString(){let e="";for(let n=0;n<this.sections.length;){let r=this.sections[n++],s=this.sections[n++];e+=(e?" ":"")+r+(s>=0?":"+s:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(n=>typeof n!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new Ii(e)}static create(e){return new Ii(e)}}class Zt extends Ii{constructor(e,n){super(e),this.inserted=n}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return ef(this,(n,r,s,a,c)=>e=e.replace(s,s+(r-n),c),!1),e}mapDesc(e,n=!1){return tf(this,e,n,!0)}invert(e){let n=this.sections.slice(),r=[];for(let s=0,a=0;s<n.length;s+=2){let c=n[s],d=n[s+1];if(d>=0){n[s]=d,n[s+1]=c;let f=s>>1;for(;r.length<f;)r.push(pt.empty);r.push(c?e.slice(a,a+c):pt.empty)}a+=c}return new Zt(n,r)}compose(e){return this.empty?e:e.empty?this:iy(this,e,!0)}map(e,n=!1){return e.empty?this:tf(this,e,n,!0)}iterChanges(e,n=!1){ef(this,e,n)}get desc(){return Ii.create(this.sections)}filter(e){let n=[],r=[],s=[],a=new fa(this);e:for(let c=0,d=0;;){let f=c==e.length?1e9:e[c++];for(;d<f||d==f&&a.len==0;){if(a.done)break e;let g=Math.min(a.len,f-d);An(s,g,-1);let b=a.ins==-1?-1:a.off==0?a.ins:0;An(n,g,b),b>0&&_r(r,n,a.text),a.forward(g),d+=g}let h=e[c++];for(;d<h;){if(a.done)break e;let g=Math.min(a.len,h-d);An(n,g,-1),An(s,g,a.ins==-1?-1:a.off==0?a.ins:0),a.forward(g),d+=g}}return{changes:new Zt(n,r),filtered:Ii.create(s)}}toJSON(){let e=[];for(let n=0;n<this.sections.length;n+=2){let r=this.sections[n],s=this.sections[n+1];s<0?e.push(r):s==0?e.push([r]):e.push([r].concat(this.inserted[n>>1].toJSON()))}return e}static of(e,n,r){let s=[],a=[],c=0,d=null;function f(g=!1){if(!g&&!s.length)return;c<n&&An(s,n-c,-1);let b=new Zt(s,a);d=d?d.compose(b.map(d)):b,s=[],a=[],c=0}function h(g){if(Array.isArray(g))for(let b of g)h(b);else if(g instanceof Zt){if(g.length!=n)throw new RangeError(`Mismatched change set length (got ${g.length}, expected ${n})`);f(),d=d?d.compose(g.map(d)):g}else{let{from:b,to:v=b,insert:S}=g;if(b>v||b<0||v>n)throw new RangeError(`Invalid change range ${b} to ${v} (in doc of length ${n})`);let A=S?typeof S=="string"?pt.of(S.split(r||Zd)):S:pt.empty,C=A.length;if(b==v&&C==0)return;b<c&&f(),b>c&&An(s,b-c,-1),An(s,v-b,C),_r(a,s,A),c=v}}return h(e),f(!d),d}static empty(e){return new Zt(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let n=[],r=[];for(let s=0;s<e.length;s++){let a=e[s];if(typeof a=="number")n.push(a,-1);else{if(!Array.isArray(a)||typeof a[0]!="number"||a.some((c,d)=>d&&typeof c!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(a.length==1)n.push(a[0],0);else{for(;r.length<s;)r.push(pt.empty);r[s]=pt.of(a.slice(1)),n.push(a[0],r[s].length)}}}return new Zt(n,r)}static createSet(e,n){return new Zt(e,n)}}function An(t,e,n,r=!1){if(e==0&&n<=0)return;let s=t.length-2;s>=0&&n<=0&&n==t[s+1]?t[s]+=e:s>=0&&e==0&&t[s]==0?t[s+1]+=n:r?(t[s]+=e,t[s+1]+=n):t.push(e,n)}function _r(t,e,n){if(n.length==0)return;let r=e.length-2>>1;if(r<t.length)t[t.length-1]=t[t.length-1].append(n);else{for(;t.length<r;)t.push(pt.empty);t.push(n)}}function ef(t,e,n){let r=t.inserted;for(let s=0,a=0,c=0;c<t.sections.length;){let d=t.sections[c++],f=t.sections[c++];if(f<0)s+=d,a+=d;else{let h=s,g=a,b=pt.empty;for(;h+=d,g+=f,f&&r&&(b=b.append(r[c-2>>1])),!(n||c==t.sections.length||t.sections[c+1]<0);)d=t.sections[c++],f=t.sections[c++];e(s,h,a,g,b),s=h,a=g}}}function tf(t,e,n,r=!1){let s=[],a=r?[]:null,c=new fa(t),d=new fa(e);for(let f=-1;;){if(c.done&&d.len||d.done&&c.len)throw new Error("Mismatched change set lengths");if(c.ins==-1&&d.ins==-1){let h=Math.min(c.len,d.len);An(s,h,-1),c.forward(h),d.forward(h)}else if(d.ins>=0&&(c.ins<0||f==c.i||c.off==0&&(d.len<c.len||d.len==c.len&&!n))){let h=d.len;for(An(s,d.ins,-1);h;){let g=Math.min(c.len,h);c.ins>=0&&f<c.i&&c.len<=g&&(An(s,0,c.ins),a&&_r(a,s,c.text),f=c.i),c.forward(g),h-=g}d.next()}else if(c.ins>=0){let h=0,g=c.len;for(;g;)if(d.ins==-1){let b=Math.min(g,d.len);h+=b,g-=b,d.forward(b)}else if(d.ins==0&&d.len<g)g-=d.len,d.next();else break;An(s,h,f<c.i?c.ins:0),a&&f<c.i&&_r(a,s,c.text),f=c.i,c.forward(c.len-g)}else{if(c.done&&d.done)return a?Zt.createSet(s,a):Ii.create(s);throw new Error("Mismatched change set lengths")}}}function iy(t,e,n=!1){let r=[],s=n?[]:null,a=new fa(t),c=new fa(e);for(let d=!1;;){if(a.done&&c.done)return s?Zt.createSet(r,s):Ii.create(r);if(a.ins==0)An(r,a.len,0,d),a.next();else if(c.len==0&&!c.done)An(r,0,c.ins,d),s&&_r(s,r,c.text),c.next();else{if(a.done||c.done)throw new Error("Mismatched change set lengths");{let f=Math.min(a.len2,c.len),h=r.length;if(a.ins==-1){let g=c.ins==-1?-1:c.off?0:c.ins;An(r,f,g,d),s&&g&&_r(s,r,c.text)}else c.ins==-1?(An(r,a.off?0:a.len,f,d),s&&_r(s,r,a.textBit(f))):(An(r,a.off?0:a.len,c.off?0:c.ins,d),s&&!c.off&&_r(s,r,c.text));d=(a.ins>f||c.ins>=0&&c.len>f)&&(d||r.length>h),a.forward2(f),c.forward(f)}}}}class fa{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i<e.length?(this.len=e[this.i++],this.ins=e[this.i++]):(this.len=0,this.ins=-2),this.off=0}get done(){return this.ins==-2}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:e}=this.set,n=this.i-2>>1;return n>=e.length?pt.empty:e[n]}textBit(e){let{inserted:n}=this.set,r=this.i-2>>1;return r>=n.length&&!e?pt.empty:n[r].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class Lr{constructor(e,n,r,s){this.from=e,this.to=n,this.flags=r,this.goalColumn=s}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get undirectional(){return(this.flags&64)>0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}map(e,n=-1){let r,s;return this.empty?r=s=e.mapPos(this.from,n):(r=e.mapPos(this.from,1),s=e.mapPos(this.to,-1)),r==this.from&&s==this.to?this:new Lr(r,s,this.flags,this.goalColumn)}extend(e,n=e,r=0){if(e<=this.anchor&&n>=this.anchor)return Ce.range(e,n,void 0,void 0,r);let s=Math.abs(e-this.anchor)>Math.abs(n-this.anchor)?e:n;return Ce.range(this.anchor,s,void 0,void 0,r)}eq(e,n=!1){return this.anchor==e.anchor&&this.head==e.head&&this.goalColumn==e.goalColumn&&(!n||!this.empty||this.assoc==e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return Ce.range(e.anchor,e.head)}static create(e,n,r,s){return new Lr(e,n,r,s)}}class Ce{constructor(e,n){this.ranges=e,this.mainIndex=n}map(e,n=-1){return e.empty?this:Ce.create(this.ranges.map(r=>r.map(e,n)),this.mainIndex)}eq(e,n=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let r=0;r<this.ranges.length;r++)if(!this.ranges[r].eq(e.ranges[r],n))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return this.ranges.length==1?this:new Ce([this.main],0)}addRange(e,n=!0){return Ce.create([e].concat(this.ranges),n?0:this.mainIndex+1)}replaceRange(e,n=this.mainIndex){let r=this.ranges.slice();return r[n]=e,Ce.create(r,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(e=>e.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!="number"||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new Ce(e.ranges.map(n=>Lr.fromJSON(n)),e.main)}static single(e,n=e){return new Ce([Ce.range(e,n)],0)}static create(e,n=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let r=0,s=0;s<e.length;s++){let a=e[s];if(a.empty?a.from<=r:a.from<r)return Ce.normalized(e.slice(),n);r=a.to}return new Ce(e,n)}static cursor(e,n=0,r,s){return Lr.create(e,e,(n==0?0:n<0?8:16)|(r==null?7:Math.min(6,r)),s)}static range(e,n,r,s,a){let c=s==null?7:Math.min(6,s);return!a&&e!=n&&(a=n<e?1:-1),a&&(c|=a<0?8:16),n<e?Lr.create(n,e,c|32,r):Lr.create(e,n,c,r)}static undirectionalRange(e,n){return Lr.create(e,n,64,void 0)}static normalized(e,n=0){let r=e[n];e.sort((s,a)=>s.from-a.from),n=e.indexOf(r);for(let s=1;s<e.length;s++){let a=e[s],c=e[s-1];if(a.empty?a.from<=c.to:a.from<c.to){let d=c.from,f=Math.max(a.to,c.to);s<=n&&n--,e.splice(--s,2,a.anchor>a.head?Ce.range(f,d):Ce.range(d,f))}}return new Ce(e,n)}}function ry(t,e){for(let n of t.ranges)if(n.to>e)throw new RangeError("Selection points outside of document")}let nf=0;class He{constructor(e,n,r,s,a){this.combine=e,this.compareInput=n,this.compare=r,this.isStatic=s,this.id=nf++,this.default=e([]),this.extensions=typeof a=="function"?a(this):a}get reader(){return this}static define(e={}){return new He(e.combine||(n=>n),e.compareInput||((n,r)=>n===r),e.compare||(e.combine?(n,r)=>n===r:rf),!!e.static,e.enables)}of(e){return new Ho([],this,0,e)}compute(e,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new Ho(e,this,1,n)}computeN(e,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new Ho(e,this,2,n)}from(e,n){return n||(n=r=>r),this.compute([e],r=>n(r.field(e)))}}function rf(t,e){return t==e||t.length==e.length&&t.every((n,r)=>n===e[r])}class Ho{constructor(e,n,r,s){this.dependencies=e,this.facet=n,this.type=r,this.value=s,this.id=nf++}dynamicSlot(e){var n;let r=this.value,s=this.facet.compareInput,a=this.id,c=e[a]>>1,d=this.type==2,f=!1,h=!1,g=[];for(let b of this.dependencies)b=="doc"?f=!0:b=="selection"?h=!0:(((n=e[b.id])!==null&&n!==void 0?n:1)&1)==0&&g.push(e[b.id]);return{create(b){return b.values[c]=r(b),1},update(b,v){if(f&&v.docChanged||h&&(v.docChanged||v.selection)||sf(b,g)){let S=r(b);if(d?!sy(S,b.values[c],s):!s(S,b.values[c]))return b.values[c]=S,1}return 0},reconfigure:(b,v)=>{let S,A=v.config.address[a];if(A!=null){let C=Vo(v,A);if(this.dependencies.every(T=>T instanceof He?v.facet(T)===b.facet(T):T instanceof Br?v.field(T,!1)==b.field(T,!1):!0)||(d?sy(S=r(b),C,s):s(S=r(b),C)))return b.values[c]=C,0}else S=r(b);return b.values[c]=S,1}}}get extension(){return this}}function sy(t,e,n){if(t.length!=e.length)return!1;for(let r=0;r<t.length;r++)if(!n(t[r],e[r]))return!1;return!0}function sf(t,e){let n=!1;for(let r of e)pa(t,r)&1&&(n=!0);return n}function oC(t,e,n){let r=n.map(f=>t[f.id]),s=n.map(f=>f.type),a=r.filter(f=>!(f&1)),c=t[e.id]>>1;function d(f){let h=[];for(let g=0;g<r.length;g++){let b=Vo(f,r[g]);if(s[g]==2)for(let v of b)h.push(v);else h.push(b)}return e.combine(h)}return{create(f){for(let h of r)pa(f,h);return f.values[c]=d(f),1},update(f,h){if(!sf(f,a))return 0;let g=d(f);return e.compare(g,f.values[c])?0:(f.values[c]=g,1)},reconfigure(f,h){let g=sf(f,r),b=h.config.facets[e.id],v=h.facet(e);if(b&&!g&&rf(n,b))return f.values[c]=v,0;let S=d(f);return e.compare(S,v)?(f.values[c]=v,0):(f.values[c]=S,1)}}}const Io=He.define({static:!0});class Br{constructor(e,n,r,s,a){this.id=e,this.createF=n,this.updateF=r,this.compareF=s,this.spec=a,this.provides=void 0}static define(e){let n=new Br(nf++,e.create,e.update,e.compare||((r,s)=>r===s),e);return e.provide&&(n.provides=e.provide(n)),n}create(e){let n=e.facet(Io).find(r=>r.field==this);return(n?.create||this.createF)(e)}slot(e){let n=e[this.id]>>1;return{create:r=>(r.values[n]=this.create(r),1),update:(r,s)=>{let a=r.values[n],c=this.updateF(a,s);return this.compareF(a,c)?0:(r.values[n]=c,1)},reconfigure:(r,s)=>{let a=r.facet(Io),c=s.facet(Io),d;return(d=a.find(f=>f.field==this))&&d!=c.find(f=>f.field==this)?(r.values[n]=d.create(r),1):s.config.address[this.id]!=null?(r.values[n]=s.field(this),0):(r.values[n]=this.create(r),1)}}}init(e){return[this,Io.of({field:this,create:e})]}get extension(){return this}}const Ns={lowest:4,low:3,default:2,high:1,highest:0};function ha(t){return e=>new ly(e,t)}const Uo={highest:ha(Ns.highest),high:ha(Ns.high),default:ha(Ns.default),low:ha(Ns.low),lowest:ha(Ns.lowest)};class ly{constructor(e,n){this.inner=e,this.prec=n}get extension(){return this}}class tr{of(e){return new lf(this,e)}reconfigure(e){return tr.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class lf{constructor(e,n){this.compartment=e,this.inner=n}get extension(){return this}}class Fo{constructor(e,n,r,s,a,c){for(this.base=e,this.compartments=n,this.dynamicSlots=r,this.address=s,this.staticValues=a,this.facets=c,this.statusTemplate=[];this.statusTemplate.length<r.length;)this.statusTemplate.push(0)}staticFacet(e){let n=this.address[e.id];return n==null?e.default:this.staticValues[n>>1]}static resolve(e,n,r){let s=[],a=Object.create(null),c=new Map;for(let v of cC(e,n,c))v instanceof Br?s.push(v):(a[v.facet.id]||(a[v.facet.id]=[])).push(v);let d=Object.create(null),f=[],h=[];for(let v of s)d[v.id]=h.length<<1,h.push(S=>v.slot(S));let g=r?.config.facets;for(let v in a){let S=a[v],A=S[0].facet,C=g&&g[v]||[];if(S.every(T=>T.type==0))if(d[A.id]=f.length<<1|1,rf(C,S))f.push(r.facet(A));else{let T=A.combine(S.map(D=>D.value));f.push(r&&A.compare(T,r.facet(A))?r.facet(A):T)}else{for(let T of S)T.type==0?(d[T.id]=f.length<<1|1,f.push(T.value)):(d[T.id]=h.length<<1,h.push(D=>T.dynamicSlot(D)));d[A.id]=h.length<<1,h.push(T=>oC(T,A,S))}}let b=h.map(v=>v(d));return new Fo(e,c,b,d,f,a)}}function cC(t,e,n){let r=[[],[],[],[],[]],s=new Map;function a(c,d){let f=s.get(c);if(f!=null){if(f<=d)return;let h=r[f].indexOf(c);h>-1&&r[f].splice(h,1),c instanceof lf&&n.delete(c.compartment)}if(s.set(c,d),Array.isArray(c))for(let h of c)a(h,d);else if(c instanceof lf){if(n.has(c.compartment))throw new RangeError("Duplicate use of compartment in extensions");let h=e.get(c.compartment)||c.inner;n.set(c.compartment,h),a(h,d)}else if(c instanceof ly)a(c.inner,c.prec);else if(c instanceof Br)r[d].push(c),c.provides&&a(c.provides,d);else if(c instanceof Ho)r[d].push(c),c.facet.extensions&&a(c.facet.extensions,Ns.default);else{let h=c.extension;if(!h)throw new Error(`Unrecognized extension value in extension set (${c}).`);if(h==c)throw new Error(`Unrecognized extension value in extension set (${c}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);a(h,d)}}return a(t,Ns.default),r.reduce((c,d)=>c.concat(d))}function pa(t,e){if(e&1)return 2;let n=e>>1,r=t.status[n];if(r==4)throw new Error("Cyclic dependency between fields and/or facets");if(r&2)return r;t.status[n]=4;let s=t.computeSlot(t,t.config.dynamicSlots[n]);return t.status[n]=2|s}function Vo(t,e){return e&1?t.config.staticValues[e>>1]:t.values[e>>1]}const ay=He.define(),af=He.define({combine:t=>t.some(e=>e),static:!0}),oy=He.define({combine:t=>t.length?t[0]:void 0,static:!0}),cy=He.define(),uy=He.define(),dy=He.define(),fy=He.define({combine:t=>t.length?t[0]:!1});class $r{constructor(e,n){this.type=e,this.value=n}static define(){return new uC}}class uC{of(e){return new $r(this,e)}}class dC{constructor(e){this.map=e}of(e){return new zt(this,e)}}class zt{constructor(e,n){this.type=e,this.value=n}map(e){let n=this.type.map(this.value,e);return n===void 0?void 0:n==this.value?this:new zt(this.type,n)}is(e){return this.type==e}static define(e={}){return new dC(e.map||(n=>n))}static mapEffects(e,n){if(!e.length)return e;let r=[];for(let s of e){let a=s.map(n);a&&r.push(a)}return r}}zt.reconfigure=zt.define(),zt.appendConfig=zt.define();class en{constructor(e,n,r,s,a,c){this.startState=e,this.changes=n,this.selection=r,this.effects=s,this.annotations=a,this.scrollIntoView=c,this._doc=null,this._state=null,r&&ry(r,n.newLength),a.some(d=>d.type==en.time)||(this.annotations=a.concat(en.time.of(Date.now())))}static create(e,n,r,s,a,c){return new en(e,n,r,s,a,c)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let n of this.annotations)if(n.type==e)return n.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let n=this.annotation(en.userEvent);return!!(n&&(n==e||n.length>e.length&&n.slice(0,e.length)==e&&n[e.length]=="."))}}en.time=$r.define(),en.userEvent=$r.define(),en.addToHistory=$r.define(),en.remote=$r.define();function fC(t,e){let n=[];for(let r=0,s=0;;){let a,c;if(r<t.length&&(s==e.length||e[s]>=t[r]))a=t[r++],c=t[r++];else if(s<e.length)a=e[s++],c=e[s++];else return n;!n.length||n[n.length-1]<a?n.push(a,c):n[n.length-1]<c&&(n[n.length-1]=c)}}function hy(t,e,n){var r;let s,a,c;return n?(s=e.changes,a=Zt.empty(e.changes.length),c=t.changes.compose(e.changes)):(s=e.changes.map(t.changes),a=t.changes.mapDesc(e.changes,!0),c=t.changes.compose(s)),{changes:c,selection:e.selection?e.selection.map(a):(r=t.selection)===null||r===void 0?void 0:r.map(s),effects:zt.mapEffects(t.effects,s).concat(zt.mapEffects(e.effects,a)),annotations:t.annotations.length?t.annotations.concat(e.annotations):e.annotations,scrollIntoView:t.scrollIntoView||e.scrollIntoView}}function of(t,e,n){let r=e.selection,s=sl(e.annotations);return e.userEvent&&(s=s.concat(en.userEvent.of(e.userEvent))),{changes:e.changes instanceof Zt?e.changes:Zt.of(e.changes||[],n,t.facet(oy)),selection:r&&(r instanceof Ce?r:Ce.single(r.anchor,r.head)),effects:sl(e.effects),annotations:s,scrollIntoView:!!e.scrollIntoView}}function py(t,e,n){let r=of(t,e.length?e[0]:{},t.doc.length);e.length&&e[0].filter===!1&&(n=!1);for(let a=1;a<e.length;a++){e[a].filter===!1&&(n=!1);let c=!!e[a].sequential;r=hy(r,of(t,e[a],c?r.changes.newLength:t.doc.length),c)}let s=en.create(t,r.changes,r.selection,r.effects,r.annotations,r.scrollIntoView);return pC(n?hC(s):s)}function hC(t){let e=t.startState,n=!0;for(let s of e.facet(cy)){let a=s(t);if(a===!1){n=!1;break}Array.isArray(a)&&(n=n===!0?a:fC(n,a))}if(n!==!0){let s,a;if(n===!1)a=t.changes.invertedDesc,s=Zt.empty(e.doc.length);else{let c=t.changes.filter(n);s=c.changes,a=c.filtered.mapDesc(c.changes).invertedDesc}t=en.create(e,s,t.selection&&t.selection.map(a),zt.mapEffects(t.effects,a),t.annotations,t.scrollIntoView)}let r=e.facet(uy);for(let s=r.length-1;s>=0;s--){let a=r[s](t);a instanceof en?t=a:Array.isArray(a)&&a.length==1&&a[0]instanceof en?t=a[0]:t=py(e,sl(a),!1)}return t}function pC(t){let e=t.startState,n=e.facet(dy),r=t;for(let s=n.length-1;s>=0;s--){let a=n[s](t);a&&Object.keys(a).length&&(r=hy(r,of(e,a,t.changes.newLength),!0))}return r==t?t:en.create(e,t.changes,t.selection,r.effects,r.annotations,r.scrollIntoView)}const mC=[];function sl(t){return t==null?mC:Array.isArray(t)?t:[t]}var nr=(function(t){return t[t.Word=0]="Word",t[t.Space=1]="Space",t[t.Other=2]="Other",t})(nr||(nr={}));const gC=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let cf;try{cf=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function yC(t){if(cf)return cf.test(t);for(let e=0;e<t.length;e++){let n=t[e];if(/\w/.test(n)||n>""&&(n.toUpperCase()!=n.toLowerCase()||gC.test(n)))return!0}return!1}function bC(t){return e=>{if(!/\S/.test(e))return nr.Space;if(yC(e))return nr.Word;for(let n=0;n<t.length;n++)if(e.indexOf(t[n])>-1)return nr.Word;return nr.Other}}class vt{constructor(e,n,r,s,a,c){this.config=e,this.doc=n,this.selection=r,this.values=s,this.status=e.statusTemplate.slice(),this.computeSlot=a,c&&(c._state=this);for(let d=0;d<this.config.dynamicSlots.length;d++)pa(this,d<<1);this.computeSlot=null}field(e,n=!0){let r=this.config.address[e.id];if(r==null){if(n)throw new RangeError("Field is not present in this state");return}return pa(this,r),Vo(this,r)}update(...e){return py(this,e,!0)}applyTransaction(e){let n=this.config,{base:r,compartments:s}=n;for(let d of e.effects)d.is(tr.reconfigure)?(n&&(s=new Map,n.compartments.forEach((f,h)=>s.set(h,f)),n=null),s.set(d.value.compartment,d.value.extension)):d.is(zt.reconfigure)?(n=null,r=d.value):d.is(zt.appendConfig)&&(n=null,r=sl(r).concat(d.value));let a;n?a=e.startState.values.slice():(n=Fo.resolve(r,s,this),a=new vt(n,this.doc,this.selection,n.dynamicSlots.map(()=>null),(f,h)=>h.reconfigure(f,this),null).values);let c=e.startState.facet(af)?e.newSelection:e.newSelection.asSingle();new vt(n,e.newDoc,c,a,(d,f)=>f.update(d,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(n=>({changes:{from:n.from,to:n.to,insert:e},range:Ce.cursor(n.from+e.length)}))}changeByRange(e){let n=this.selection,r=e(n.ranges[0]),s=this.changes(r.changes),a=[r.range],c=sl(r.effects);for(let d=1;d<n.ranges.length;d++){let f=e(n.ranges[d]),h=this.changes(f.changes),g=h.map(s);for(let v=0;v<d;v++)a[v]=a[v].map(g);let b=s.mapDesc(h,!0);a.push(f.range.map(b)),s=s.compose(g),c=zt.mapEffects(c,g).concat(zt.mapEffects(sl(f.effects),b))}return{changes:s,selection:Ce.create(a,n.mainIndex),effects:c}}changes(e=[]){return e instanceof Zt?e:Zt.of(e,this.doc.length,this.facet(vt.lineSeparator))}toText(e){return pt.of(e.split(this.facet(vt.lineSeparator)||Zd))}sliceDoc(e=0,n=this.doc.length){return this.doc.sliceString(e,n,this.lineBreak)}facet(e){let n=this.config.address[e.id];return n==null?e.default:(pa(this,n),Vo(this,n))}toJSON(e){let n={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(let r in e){let s=e[r];s instanceof Br&&this.config.address[s.id]!=null&&(n[r]=s.spec.toJSON(this.field(e[r]),this))}return n}static fromJSON(e,n={},r){if(!e||typeof e.doc!="string")throw new RangeError("Invalid JSON representation for EditorState");let s=[];if(r){for(let a in r)if(Object.prototype.hasOwnProperty.call(e,a)){let c=r[a],d=e[a];s.push(c.init(f=>c.spec.fromJSON(d,f)))}}return vt.create({doc:e.doc,selection:Ce.fromJSON(e.selection),extensions:n.extensions?s.concat([n.extensions]):s})}static create(e={}){let n=Fo.resolve(e.extensions||[],new Map),r=e.doc instanceof pt?e.doc:pt.of((e.doc||"").split(n.staticFacet(vt.lineSeparator)||Zd)),s=e.selection?e.selection instanceof Ce?e.selection:Ce.single(e.selection.anchor,e.selection.head):Ce.single(0);return ry(s,r.length),n.staticFacet(af)||(s=s.asSingle()),new vt(n,r,s,n.dynamicSlots.map(()=>null),(a,c)=>c.create(a),null)}get tabSize(){return this.facet(vt.tabSize)}get lineBreak(){return this.facet(vt.lineSeparator)||`
|
|
53
|
+
`}get readOnly(){return this.facet(fy)}phrase(e,...n){for(let r of this.facet(vt.phrases))if(Object.prototype.hasOwnProperty.call(r,e)){e=r[e];break}return n.length&&(e=e.replace(/\$(\$|\d*)/g,(r,s)=>{if(s=="$")return"$";let a=+(s||1);return!a||a>n.length?r:n[a-1]})),e}languageDataAt(e,n,r=-1){let s=[];for(let a of this.facet(ay))for(let c of a(this,n,r))Object.prototype.hasOwnProperty.call(c,e)&&s.push(c[e]);return s}charCategorizer(e){let n=this.languageDataAt("wordChars",e);return bC(n.length?n[0]:"")}wordAt(e){let{text:n,from:r,length:s}=this.doc.lineAt(e),a=this.charCategorizer(e),c=e-r,d=e-r;for(;c>0;){let f=Sn(n,c,!1);if(a(n.slice(f,c))!=nr.Word)break;c=f}for(;d<s;){let f=Sn(n,d);if(a(n.slice(d,f))!=nr.Word)break;d=f}return c==d?null:Ce.range(c+r,d+r)}}vt.allowMultipleSelections=af,vt.tabSize=He.define({combine:t=>t.length?t[0]:4}),vt.lineSeparator=oy,vt.readOnly=fy,vt.phrases=He.define({compare(t,e){let n=Object.keys(t),r=Object.keys(e);return n.length==r.length&&n.every(s=>t[s]==e[s])}}),vt.languageData=ay,vt.changeFilter=cy,vt.transactionFilter=uy,vt.transactionExtender=dy,tr.reconfigure=zt.define();function uf(t,e,n={}){let r={};for(let s of t)for(let a of Object.keys(s)){let c=s[a],d=r[a];if(d===void 0)r[a]=c;else if(!(d===c||c===void 0))if(Object.hasOwnProperty.call(n,a))r[a]=n[a](d,c);else throw new Error("Config merge conflict for field "+a)}for(let s in e)r[s]===void 0&&(r[s]=e[s]);return r}class Ts{eq(e){return this==e}range(e,n=e){return ff.create(e,n,this)}}Ts.prototype.startSide=Ts.prototype.endSide=0,Ts.prototype.point=!1,Ts.prototype.mapMode=Yn.TrackDel;function df(t,e){return t==e||t.constructor==e.constructor&&t.eq(e)}let ff=class H2{constructor(e,n,r){this.from=e,this.to=n,this.value=r}static create(e,n,r){return new H2(e,n,r)}};function hf(t,e){return t.from-e.from||t.value.startSide-e.value.startSide}class pf{constructor(e,n,r,s){this.from=e,this.to=n,this.value=r,this.maxPoint=s}get length(){return ll(this.to)}findIndex(e,n,r,s=0){let a=r?this.to:this.from;for(let c=s,d=a.length;;){if(c==d)return c;let f=c+d>>1,h=a[f]-e||(r?this.value[f].endSide:this.value[f].startSide)-n;if(f==c)return h>=0?c:d;h>=0?d=f:c=f+1}}between(e,n,r,s){for(let a=this.findIndex(n,-1e9,!0),c=this.findIndex(r,1e9,!1,a);a<c;a++)if(s(this.from[a]+e,this.to[a]+e,this.value[a])===!1)return!1}map(e,n,r,s,a){let c=[],d=[],f=[],h=-1,g=-1;e:for(let b=0;b<this.value.length;b++){let v=this.value[b],S=this.from[b]+e,A=this.to[b]+e,C,T;if(S==A){let D=n.mapPos(S,v.startSide,v.mapMode);if(D==null||(C=T=D,v.startSide!=v.endSide&&(T=n.mapPos(S,v.endSide),T<C)))continue}else if(C=n.mapPos(S,v.startSide),T=n.mapPos(A,v.endSide),C>T||C==T&&v.startSide>0&&v.endSide<=0)continue;if(!((T-C||v.endSide-v.startSide)<0))if(h<0&&(h=C),v.point&&(g=Math.max(g,T-C)),(C-r||v.startSide-s)>=0)c.push(v),d.push(C-h),f.push(T-h),r=T,s=v.endSide;else{if(C==T)for(let D=c.length;D>0;D--){if((C-(f[D-1]+h)||v.startSide-c[D-1].endSide)>=0){c.splice(D,0,v),d.splice(D,0,C-h),f.splice(D,0,T-h);continue e}if((C-(d[D-1]+h)||v.endSide-c[D-1].startSide)>0)break}a(C,T,v)}}return{mapped:c.length?new pf(d,f,c,g):null,pos:h}}}class ft{constructor(e,n,r,s){this.chunkPos=e,this.chunk=n,this.nextLayer=r,this.maxPoint=s}static create(e,n,r,s){return new ft(e,n,r,s)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let n of this.chunk)e+=n.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:n=[],sort:r=!1,filterFrom:s=0,filterTo:a=this.length}=e,c=e.filter;if(n.length==0&&!c)return this;if(r&&(n=n.slice().sort(hf)),this.isEmpty)return n.length?ft.of(n):this;let d=new gy(this,null,-1).goto(0),f=0,h=[],g=new ma;for(;d.value||f<n.length;)if(f<n.length&&(d.from-n[f].from||d.startSide-n[f].value.startSide)>=0){let b=n[f++];g.addInner(b.from,b.to,b.value,!1)||h.push(b)}else d.rangeIndex==1&&d.chunkIndex<this.chunk.length&&(f==n.length||this.chunkEnd(d.chunkIndex)<n[f].from)&&(!c||s>this.chunkEnd(d.chunkIndex)||a<this.chunkPos[d.chunkIndex])&&g.addChunk(this.chunkPos[d.chunkIndex],this.chunk[d.chunkIndex])?d.nextChunk():((!c||s>d.to||a<d.from||c(d.from,d.to,d.value))&&(g.addInner(d.from,d.to,d.value,!1)||h.push(ff.create(d.from,d.to,d.value))),d.next());return g.finishInner(this.nextLayer.isEmpty&&!h.length?ft.empty:this.nextLayer.update({add:h,filter:c,filterFrom:s,filterTo:a}))}map(e){if(e.empty||this.isEmpty)return this;let n=[],r=[],s=-1,a,c=(f,h,g)=>{a||(a=new ma),a.addRange(f,h,g,!1)};for(let f=0;f<this.chunk.length;f++){let h=this.chunkPos[f],g=this.chunk[f],b=e.touchesRange(h,h+g.length);if(b===!1)s=Math.max(s,g.maxPoint),n.push(g),r.push(e.mapPos(h));else if(b===!0){let[v,S]=n.length?[ll(r)+ll(n).length,ll(ll(n).value).endSide]:[-1,-1],{mapped:A,pos:C}=g.map(h,e,v,S,c);A&&(s=Math.max(s,A.maxPoint),n.push(A),r.push(C))}}let d=this.nextLayer.map(e);return a&&(d=a.finishInner(d)),n.length==0?d:new ft(r,n,d||ft.empty,s)}between(e,n,r){if(!this.isEmpty){for(let s=0;s<this.chunk.length;s++){let a=this.chunkPos[s],c=this.chunk[s];if(n>=a&&e<=a+c.length&&c.between(a,e-a,n-a,r)===!1)return}this.nextLayer.between(e,n,r)}}iter(e=0){return ga.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,n=0){return ga.from(e).goto(n)}static compare(e,n,r,s,a=-1){let c=e.filter(b=>b.maxPoint>0||!b.isEmpty&&b.maxPoint>=a),d=n.filter(b=>b.maxPoint>0||!b.isEmpty&&b.maxPoint>=a),f=my(c,d,r),h=new ya(c,f,a),g=new ya(d,f,a);r.iterGaps((b,v,S)=>yy(h,b,g,v,S,s)),r.empty&&r.length==0&&yy(h,0,g,0,0,s)}static eq(e,n,r=0,s){s==null&&(s=999999999);let a=e.filter(g=>!g.isEmpty&&n.indexOf(g)<0),c=n.filter(g=>!g.isEmpty&&e.indexOf(g)<0);if(a.length!=c.length)return!1;if(!a.length)return!0;let d=my(a,c),f=new ya(a,d,0).goto(r),h=new ya(c,d,0).goto(r);for(;;){if(f.to!=h.to||!gf(f.active,h.active)||f.point&&(!h.point||!df(f.point,h.point)))return!1;if(f.to>s)return!0;f.next(),h.next()}}static spans(e,n,r,s,a=-1){let c=new ya(e,null,a).goto(n),d=n,f=c.openStart;for(;;){let h=Math.min(c.to,r);if(c.point){let g=c.activeForPoint(c.to),b=c.pointFrom<n?g.length+1:c.point.startSide<0?g.length:Math.min(g.length,f);s.point(d,h,c.point,g,b,c.pointRank),f=Math.min(c.openEnd(h),g.length)}else h>d&&(s.span(d,h,c.active,f),f=c.openEnd(h));if(c.to>r)return f+(c.point&&c.to>r?1:0);d=c.to,c.next()}}static of(e,n=!1){let r=new ma;for(let s of e instanceof ff?[e]:n?xC(e):e)r.add(s.from,s.to,s.value);return r.finish()}static join(e){if(!e.length)return ft.empty;let n=ll(e);for(let r=e.length-2;r>=0;r--)for(let s=e[r];s!=ft.empty;s=s.nextLayer)n=new ft(s.chunkPos,s.chunk,n,Math.max(s.maxPoint,n.maxPoint));return n}}ft.empty=new ft([],[],null,-1);function ll(t){return t[t.length-1]}function xC(t){if(t.length>1)for(let e=t[0],n=1;n<t.length;n++){let r=t[n];if(hf(e,r)>0)return t.slice().sort(hf);e=r}return t}ft.empty.nextLayer=ft.empty;class ma{finishChunk(e){this.chunks.push(new pf(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(e,n,r){this.addRange(e,n,r,!0)}addRange(e,n,r,s){this.addInner(e,n,r,s)||(this.nextLayer||(this.nextLayer=new ma)).addRange(e,n,r,s)}addInner(e,n,r,s){let a=e-this.lastTo||r.startSide-this.last.endSide;if(s&&a<=0&&(e-this.lastFrom||r.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return a<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(n-this.chunkStart),this.last=r,this.lastFrom=e,this.lastTo=n,this.value.push(r),r.point&&(this.maxPoint=Math.max(this.maxPoint,n-e)),!0)}addChunk(e,n){if((e-this.lastTo||n.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,n.maxPoint),this.chunks.push(n),this.chunkPos.push(e);let r=n.value.length-1;return this.last=n.value[r],this.lastFrom=n.from[r]+e,this.lastTo=n.to[r]+e,!0}finish(){return this.finishInner(ft.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let n=ft.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,n}}function my(t,e,n){let r=new Map;for(let a of t)for(let c=0;c<a.chunk.length;c++)a.chunk[c].maxPoint<=0&&r.set(a.chunk[c],a.chunkPos[c]);let s=new Set;for(let a of e)for(let c=0;c<a.chunk.length;c++){let d=r.get(a.chunk[c]);d!=null&&(n?n.mapPos(d):d)==a.chunkPos[c]&&!n?.touchesRange(d,d+a.chunk[c].length)&&s.add(a.chunk[c])}return s}class gy{constructor(e,n,r,s=0){this.layer=e,this.skip=n,this.minPoint=r,this.rank=s}get startSide(){return this.value?this.value.startSide:0}get endSide(){return this.value?this.value.endSide:0}goto(e,n=-1e9){return this.chunkIndex=this.rangeIndex=0,this.gotoInner(e,n,!1),this}gotoInner(e,n,r){for(;this.chunkIndex<this.layer.chunk.length;){let s=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(s)||this.layer.chunkEnd(this.chunkIndex)<e||s.maxPoint<this.minPoint))break;this.chunkIndex++,r=!1}if(this.chunkIndex<this.layer.chunk.length){let s=this.layer.chunk[this.chunkIndex].findIndex(e-this.layer.chunkPos[this.chunkIndex],n,!0);(!r||this.rangeIndex<s)&&this.setRangeIndex(s)}this.next()}forward(e,n){(this.to-e||this.endSide-n)<0&&this.gotoInner(e,n,!0)}next(){for(;;)if(this.chunkIndex==this.layer.chunk.length){this.from=this.to=1e9,this.value=null;break}else{let e=this.layer.chunkPos[this.chunkIndex],n=this.layer.chunk[this.chunkIndex],r=e+n.from[this.rangeIndex];if(this.from=r,this.to=e+n.to[this.rangeIndex],this.value=n.value[this.rangeIndex],this.setRangeIndex(this.rangeIndex+1),this.minPoint<0||this.value.point&&this.to-this.from>=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex<this.layer.chunk.length&&this.skip.has(this.layer.chunk[this.chunkIndex]);)this.chunkIndex++;this.rangeIndex=0}else this.rangeIndex=e}nextChunk(){this.chunkIndex++,this.rangeIndex=0,this.next()}compare(e){return this.from-e.from||this.startSide-e.startSide||this.rank-e.rank||this.to-e.to||this.endSide-e.endSide}}class ga{constructor(e){this.heap=e}static from(e,n=null,r=-1){let s=[];for(let a=0;a<e.length;a++)for(let c=e[a];!c.isEmpty;c=c.nextLayer)c.maxPoint>=r&&s.push(new gy(c,n,r,a));return s.length==1?s[0]:new ga(s)}get startSide(){return this.value?this.value.startSide:0}goto(e,n=-1e9){for(let r of this.heap)r.goto(e,n);for(let r=this.heap.length>>1;r>=0;r--)mf(this.heap,r);return this.next(),this}forward(e,n){for(let r of this.heap)r.forward(e,n);for(let r=this.heap.length>>1;r>=0;r--)mf(this.heap,r);(this.to-e||this.value.endSide-n)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),mf(this.heap,0)}}}function mf(t,e){for(let n=t[e];;){let r=(e<<1)+1;if(r>=t.length)break;let s=t[r];if(r+1<t.length&&s.compare(t[r+1])>=0&&(s=t[r+1],r++),n.compare(s)<0)break;t[r]=n,t[e]=s,e=r}}class ya{constructor(e,n,r){this.minPoint=r,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=ga.from(e,n,r)}goto(e,n=-1e9){return this.cursor.goto(e,n),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=n,this.openStart=-1,this.next(),this}forward(e,n){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-n)<0;)this.removeActive(this.minActive);this.cursor.forward(e,n)}removeActive(e){Po(this.active,e),Po(this.activeTo,e),Po(this.activeRank,e),this.minActive=by(this.active,this.activeTo)}addActive(e){let n=0,{value:r,to:s,rank:a}=this.cursor;for(;n<this.activeRank.length&&(a-this.activeRank[n]||s-this.activeTo[n])>0;)n++;Ko(this.active,n,r),Ko(this.activeTo,n,s),Ko(this.activeRank,n,a),e&&Ko(e,n,this.cursor.from),this.minActive=by(this.active,this.activeTo)}next(){let e=this.to,n=this.point;this.point=null;let r=this.openStart<0?[]:null;for(;;){let s=this.minActive;if(s>-1&&(this.activeTo[s]-this.cursor.from||this.active[s].endSide-this.cursor.startSide)<0){if(this.activeTo[s]>e){this.to=this.activeTo[s],this.endSide=this.active[s].endSide;break}this.removeActive(s),r&&Po(r,s)}else if(this.cursor.value)if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let a=this.cursor.value;if(!a.point)this.addActive(r),this.cursor.next();else if(n&&this.cursor.to==this.to&&this.cursor.from<this.cursor.to)this.cursor.next();else{this.point=a,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=a.endSide,this.cursor.next(),this.forward(this.to,this.endSide);break}}else{this.to=this.endSide=1e9;break}}if(r){this.openStart=0;for(let s=r.length-1;s>=0&&r[s]<e;s--)this.openStart++}}activeForPoint(e){if(!this.active.length)return this.active;let n=[];for(let r=this.active.length-1;r>=0&&!(this.activeRank[r]<this.pointRank);r--)(this.activeTo[r]>e||this.activeTo[r]==e&&this.active[r].endSide>=this.point.endSide)&&n.push(this.active[r]);return n.reverse()}openEnd(e){let n=0;for(let r=this.activeTo.length-1;r>=0&&this.activeTo[r]>e;r--)n++;return n}}function yy(t,e,n,r,s,a){t.goto(e),n.goto(r);let c=r+s,d=r,f=r-e,h=!!a.boundChange;for(let g=!1;;){let b=t.to+f-n.to,v=b||t.endSide-n.endSide,S=v<0?t.to+f:n.to,A=Math.min(S,c);if(t.point||n.point?(t.point&&n.point&&df(t.point,n.point)&&gf(t.activeForPoint(t.to),n.activeForPoint(n.to))||a.comparePoint(d,A,t.point,n.point),g=!1):(g&&a.boundChange(d),A>d&&!gf(t.active,n.active)&&a.compareRange(d,A,t.active,n.active),h&&A<c&&(b||t.openEnd(S)!=n.openEnd(S))&&(g=!0)),S>c)break;d=S,v<=0&&t.next(),v>=0&&n.next()}}function gf(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!=e[n]&&!df(t[n],e[n]))return!1;return!0}function Po(t,e){for(let n=e,r=t.length-1;n<r;n++)t[n]=t[n+1];t.pop()}function Ko(t,e,n){for(let r=t.length-1;r>=e;r--)t[r+1]=t[r];t[e]=n}function by(t,e){let n=-1,r=1e9;for(let s=0;s<e.length;s++)(e[s]-r||t[s].endSide-t[n].endSide)<0&&(n=s,r=e[s]);return n}function Yo(t,e,n=t.length){let r=0;for(let s=0;s<n&&s<t.length;)t.charCodeAt(s)==9?(r+=e-r%e,s++):(r++,s=Sn(t,s));return r}function vC(t,e,n,r){for(let s=0,a=0;;){if(a>=e)return s;if(s==t.length)break;a+=t.charCodeAt(s)==9?n-a%n:1,s=Sn(t,s)}return t.length}const yf="ͼ",xy=typeof Symbol>"u"?"__"+yf:Symbol.for(yf),bf=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),vy=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class al{constructor(e,n){this.rules=[];let{finish:r}=n||{};function s(c){return/^@/.test(c)?[c]:c.split(/,\s*/)}function a(c,d,f,h){let g=[],b=/^@(\w+)\b/.exec(c[0]),v=b&&b[1]=="keyframes";if(b&&d==null)return f.push(c[0]+";");for(let S in d){let A=d[S];if(/&/.test(S))a(S.split(/,\s*/).map(C=>c.map(T=>C.replace(/&/,T))).reduce((C,T)=>C.concat(T)),A,f);else if(A&&typeof A=="object"){if(!b)throw new RangeError("The value of a property ("+S+") should be a primitive value.");a(s(S),A,g,v)}else A!=null&&g.push(S.replace(/_.*/,"").replace(/[A-Z]/g,C=>"-"+C.toLowerCase())+": "+A+";")}(g.length||v)&&f.push((r&&!b&&!h?c.map(r):c).join(", ")+" {"+g.join(" ")+"}")}for(let c in e)a(s(c),e[c],this.rules)}getRules(){return this.rules.join(`
|
|
54
|
+
`)}static newName(){let e=vy[xy]||1;return vy[xy]=e+1,yf+e.toString(36)}static mount(e,n,r){let s=e[bf],a=r&&r.nonce;s?a&&s.setNonce(a):s=new wC(e,a),s.mount(Array.isArray(n)?n:[n],e)}}let wy=new Map;class wC{constructor(e,n){let r=e.ownerDocument||e,s=r.defaultView;if(!e.head&&e.adoptedStyleSheets&&s.CSSStyleSheet){let a=wy.get(r);if(a)return e[bf]=a;this.sheet=new s.CSSStyleSheet,wy.set(r,this)}else this.styleTag=r.createElement("style"),n&&this.styleTag.setAttribute("nonce",n);this.modules=[],e[bf]=this}mount(e,n){let r=this.sheet,s=0,a=0;for(let c=0;c<e.length;c++){let d=e[c],f=this.modules.indexOf(d);if(f<a&&f>-1&&(this.modules.splice(f,1),a--,f=-1),f==-1){if(this.modules.splice(a++,0,d),r)for(let h=0;h<d.rules.length;h++)r.insertRule(d.rules[h],s++)}else{for(;a<f;)s+=this.modules[a++].rules.length;s+=d.rules.length,a++}}if(r)n.adoptedStyleSheets.indexOf(this.sheet)<0&&(n.adoptedStyleSheets=[this.sheet,...n.adoptedStyleSheets]);else{let c="";for(let f=0;f<this.modules.length;f++)c+=this.modules[f].getRules()+`
|
|
55
|
+
`;this.styleTag.textContent=c;let d=n.head||n;this.styleTag.parentNode!=d&&d.insertBefore(this.styleTag,d.firstChild)}}setNonce(e){this.styleTag&&this.styleTag.getAttribute("nonce")!=e&&this.styleTag.setAttribute("nonce",e)}}for(var qr={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},ba={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},SC=typeof navigator<"u"&&/Mac/.test(navigator.platform),AC=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),un=0;un<10;un++)qr[48+un]=qr[96+un]=String(un);for(var un=1;un<=24;un++)qr[un+111]="F"+un;for(var un=65;un<=90;un++)qr[un]=String.fromCharCode(un+32),ba[un]=String.fromCharCode(un);for(var xf in qr)ba.hasOwnProperty(xf)||(ba[xf]=qr[xf]);function kC(t){var e=SC&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||AC&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?ba:qr)[t.keyCode]||t.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}let jn=typeof navigator<"u"?navigator:{userAgent:"",vendor:"",platform:""},vf=typeof document<"u"?document:{documentElement:{style:{}}};const wf=/Edge\/(\d+)/.exec(jn.userAgent),Sy=/MSIE \d/.test(jn.userAgent),Sf=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(jn.userAgent),Go=!!(Sy||Sf||wf),Ay=!Go&&/gecko\/(\d+)/i.test(jn.userAgent),Af=!Go&&/Chrome\/(\d+)/.exec(jn.userAgent),ky="webkitFontSmoothing"in vf.documentElement.style,kf=!Go&&/Apple Computer/.test(jn.vendor),Cy=kf&&(/Mobile\/\w+/.test(jn.userAgent)||jn.maxTouchPoints>2);var Oe={mac:Cy||/Mac/.test(jn.platform),windows:/Win/.test(jn.platform),linux:/Linux|X11/.test(jn.platform),ie:Go,ie_version:Sy?vf.documentMode||6:Sf?+Sf[1]:wf?+wf[1]:0,gecko:Ay,gecko_version:Ay?+(/Firefox\/(\d+)/.exec(jn.userAgent)||[0,0])[1]:0,chrome:!!Af,chrome_version:Af?+Af[1]:0,ios:Cy,android:/Android\b/.test(jn.userAgent),webkit:ky,webkit_version:ky?+(/\bAppleWebKit\/(\d+)/.exec(jn.userAgent)||[0,0])[1]:0,safari:kf,safari_version:kf?+(/\bVersion\/(\d+(\.\d+)?)/.exec(jn.userAgent)||[0,0])[1]:0,tabSize:vf.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};function Cf(t,e){for(let n in t)n=="class"&&e.class?e.class+=" "+t.class:n=="style"&&e.style?e.style+=";"+t.style:e[n]=t[n];return e}const Xo=Object.create(null);function Nf(t,e,n){if(t==e)return!0;t||(t=Xo),e||(e=Xo);let r=Object.keys(t),s=Object.keys(e);if(r.length-0!=s.length-0)return!1;for(let a of r)if(a!=n&&(s.indexOf(a)==-1||t[a]!==e[a]))return!1;return!0}function CC(t,e){for(let n=t.attributes.length-1;n>=0;n--){let r=t.attributes[n].name;e[r]==null&&t.removeAttribute(r)}for(let n in e){let r=e[n];n=="style"?t.style.cssText=r:t.getAttribute(n)!=r&&t.setAttribute(n,r)}}function Ny(t,e,n){let r=!1;if(e)for(let s in e)n&&s in n||(r=!0,s=="style"?t.style.cssText="":t.removeAttribute(s));if(n)for(let s in n)e&&e[s]==n[s]||(r=!0,s=="style"?t.style.cssText=n[s]:t.setAttribute(s,n[s]));return r}function NC(t){let e=Object.create(null);for(let n=0;n<t.attributes.length;n++){let r=t.attributes[n];e[r.name]=r.value}return e}class Jo{eq(e){return!1}updateDOM(e,n,r){return!1}compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}get estimatedHeight(){return-1}get lineBreaks(){return 0}ignoreEvent(e){return!0}coordsAt(e,n,r){return null}get isHidden(){return!1}get editable(){return!1}destroy(e){}}var dn=(function(t){return t[t.Text=0]="Text",t[t.WidgetBefore=1]="WidgetBefore",t[t.WidgetAfter=2]="WidgetAfter",t[t.WidgetRange=3]="WidgetRange",t})(dn||(dn={}));class nn extends Ts{constructor(e,n,r,s){super(),this.startSide=e,this.endSide=n,this.widget=r,this.spec=s}get heightRelevant(){return!1}static mark(e){return new xa(e)}static widget(e){let n=Math.max(-1e4,Math.min(1e4,e.side||0)),r=!!e.block;return n+=r&&!e.inlineOrder?n>0?3e8:-4e8:n>0?1e8:-1e8,new js(e,n,n,r,e.widget||null,!1)}static replace(e){let n=!!e.block,r,s;if(e.isBlockGap)r=-5e8,s=4e8;else{let{start:a,end:c}=Ty(e,n);r=(a?n?-3e8:-1:5e8)-1,s=(c?n?2e8:1:-6e8)+1}return new js(e,r,s,n,e.widget||null,!0)}static line(e){return new va(e)}static set(e,n=!1){return ft.of(e,n)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}nn.none=ft.empty;class xa extends nn{constructor(e){let{start:n,end:r}=Ty(e);super(n?-1:5e8,r?1:-6e8,null,e),this.tagName=e.tagName||"span",this.attrs=e.class&&e.attributes?Cf(e.attributes,{class:e.class}):e.class?{class:e.class}:e.attributes||Xo}eq(e){return this==e||e instanceof xa&&this.tagName==e.tagName&&Nf(this.attrs,e.attrs)}range(e,n=e){if(e>=n)throw new RangeError("Mark decorations may not be empty");return super.range(e,n)}}xa.prototype.point=!1;class va extends nn{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof va&&this.spec.class==e.spec.class&&Nf(this.spec.attributes,e.spec.attributes)}range(e,n=e){if(n!=e)throw new RangeError("Line decoration ranges must be zero-length");return super.range(e,n)}}va.prototype.mapMode=Yn.TrackBefore,va.prototype.point=!0;class js extends nn{constructor(e,n,r,s,a,c){super(n,r,a,e),this.block=s,this.isReplace=c,this.mapMode=s?n<=0?Yn.TrackBefore:Yn.TrackAfter:Yn.TrackDel}get type(){return this.startSide!=this.endSide?dn.WidgetRange:this.startSide<=0?dn.WidgetBefore:dn.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof js&&TC(this.widget,e.widget)&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide}range(e,n=e){if(this.isReplace&&(e>n||e==n&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&n!=e)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(e,n)}}js.prototype.point=!0;function Ty(t,e=!1){let{inclusiveStart:n,inclusiveEnd:r}=t;return n==null&&(n=t.inclusive),r==null&&(r=t.inclusive),{start:n??e,end:r??e}}function TC(t,e){return t==e||!!(t&&e&&t.compare(e))}function ol(t,e,n,r=0){let s=n.length-1;s>=0&&n[s]+r>=t?n[s]=Math.max(n[s],e):n.push(t,e)}class wa extends Ts{constructor(e,n,r){super(),this.tagName=e,this.attributes=n,this.rank=r}eq(e){return e==this||e instanceof wa&&this.tagName==e.tagName&&Nf(this.attributes,e.attributes)}static create(e){return new wa(e.tagName,e.attributes||Xo,e.rank==null?50:Math.max(0,Math.min(e.rank,100)))}static set(e,n=!1){return ft.of(e,n)}}wa.prototype.startSide=wa.prototype.endSide=-1;function Sa(t){let e;return t.nodeType==11?e=t.getSelection?t:t.ownerDocument:e=t,e.getSelection()}function Tf(t,e){return e?t==e||t.contains(e.nodeType!=1?e.parentNode:e):!1}function Aa(t,e){if(!e.anchorNode)return!1;try{return Tf(t,e.anchorNode)}catch{return!1}}function Qo(t){return t.nodeType==3?Ca(t,0,t.nodeValue.length).getClientRects():t.nodeType==1?t.getClientRects():[]}function ka(t,e,n,r){return n?jy(t,e,n,r,-1)||jy(t,e,n,r,1):!1}function zr(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e}function Wo(t){return t.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(t.nodeName)}function jy(t,e,n,r,s){for(;;){if(t==n&&e==r)return!0;if(e==(s<0?0:ir(t))){if(t.nodeName=="DIV")return!1;let a=t.parentNode;if(!a||a.nodeType!=1)return!1;e=zr(t)+(s<0?0:1),t=a}else if(t.nodeType==1){if(t=t.childNodes[e+(s<0?-1:0)],t.nodeType==1&&t.contentEditable=="false")return!1;e=s<0?ir(t):0}else return!1}}function ir(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function Zo(t,e){let{left:n,right:r}=t;if(n==r)return t;let s=e?n:r;return{left:s,right:s,top:t.top,bottom:t.bottom}}function jC(t){let e=t.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.innerWidth,top:0,bottom:t.innerHeight}}function Ey(t,e){let n=e.width/t.offsetWidth,r=e.height/t.offsetHeight;return(n>.995&&n<1.005||!isFinite(n)||Math.abs(e.width-t.offsetWidth)<1)&&(n=1),(r>.995&&r<1.005||!isFinite(r)||Math.abs(e.height-t.offsetHeight)<1)&&(r=1),{scaleX:n,scaleY:r}}function EC(t,e,n,r,s,a,c,d){let f=t.ownerDocument,h=f.defaultView||window;for(let g=t,b=!1;g&&!b;)if(g.nodeType==1){let v,S=g==f.body,A=1,C=1;if(S)v=jC(h);else{if(/^(fixed|sticky)$/.test(getComputedStyle(g).position)&&(b=!0),g.scrollHeight<=g.clientHeight&&g.scrollWidth<=g.clientWidth){g=g.assignedSlot||g.parentNode;continue}let j=g.getBoundingClientRect();({scaleX:A,scaleY:C}=Ey(g,j)),v={left:j.left,right:j.left+g.clientWidth*A,top:j.top,bottom:j.top+g.clientHeight*C}}let T=0,D=0;if(s=="nearest")e.top<v.top+c?(D=e.top-(v.top+c),n>0&&e.bottom>v.bottom+D&&(D=e.bottom-v.bottom+c)):e.bottom>v.bottom-c&&(D=e.bottom-v.bottom+c,n<0&&e.top-D<v.top&&(D=e.top-(v.top+c)));else{let j=e.bottom-e.top,E=v.bottom-v.top;D=(s=="center"&&j<=E?e.top+j/2-E/2:s=="start"||s=="center"&&n<0?e.top-c:e.bottom-E+c)-v.top}if(r=="nearest"?e.left<v.left+a?(T=e.left-(v.left+a),n>0&&e.right>v.right+T&&(T=e.right-v.right+a)):e.right>v.right-a&&(T=e.right-v.right+a,n<0&&e.left<v.left+T&&(T=e.left-(v.left+a))):T=(r=="center"?e.left+(e.right-e.left)/2-(v.right-v.left)/2:r=="start"==d?e.left-a:e.right-(v.right-v.left)+a)-v.left,T||D)if(S)h.scrollBy(T,D);else{let j=0,E=0;if(D){let O=g.scrollTop;g.scrollTop+=D/C,E=(g.scrollTop-O)*C}if(T){let O=g.scrollLeft;g.scrollLeft+=T/A,j=(g.scrollLeft-O)*A}e={left:e.left-j,top:e.top-E,right:e.right-j,bottom:e.bottom-E},j&&Math.abs(j-T)<1&&(r="nearest"),E&&Math.abs(E-D)<1&&(s="nearest")}if(S)break;(e.top<v.top||e.bottom>v.bottom||e.left<v.left||e.right>v.right)&&(e={left:Math.max(e.left,v.left),right:Math.min(e.right,v.right),top:Math.max(e.top,v.top),bottom:Math.min(e.bottom,v.bottom)}),g=g.assignedSlot||g.parentNode}else if(g.nodeType==11)g=g.host;else break}function Oy(t,e=!0){let n=t.ownerDocument,r=null,s=null;for(let a=t.parentNode;a&&!(a==n.body||(!e||r)&&s);)if(a.nodeType==1)!s&&a.scrollHeight>a.clientHeight&&(s=a),e&&!r&&a.scrollWidth>a.clientWidth&&(r=a),a=a.assignedSlot||a.parentNode;else if(a.nodeType==11)a=a.host;else break;return{x:r,y:s}}class OC{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){let{anchorNode:n,focusNode:r}=e;this.set(n,Math.min(e.anchorOffset,n?ir(n):0),r,Math.min(e.focusOffset,r?ir(r):0))}set(e,n,r,s){this.anchorNode=e,this.anchorOffset=n,this.focusNode=r,this.focusOffset=s}}function My(t){let e=[];for(let n=t;n;n=n.nodeType==11?n.host:n.parentNode)n.nodeType==1&&e.push({node:n,left:n.scrollLeft,top:n.scrollTop});return e}function Ry(t,e=!0){for(let{node:n,left:r,top:s}of t)e&&n.scrollTop!=s&&(n.scrollTop=s),n.scrollLeft!=r&&(n.scrollLeft=r)}let Es=null;Oe.safari&&Oe.safari_version>=26&&(Es=!1);function Dy(t){if(t.setActive)return t.setActive();if(Es)return t.focus(Es);let e=My(t);t.focus(Es==null?{get preventScroll(){return Es={preventScroll:!0},!0}}:void 0),Es||(Es=!1,Ry(e))}let _y;function Ca(t,e,n=e){let r=_y||(_y=document.createRange());return r.setEnd(t,n),r.setStart(t,e),r}function cl(t,e,n,r){let s={key:e,code:e,keyCode:n,which:n,cancelable:!0};r&&({altKey:s.altKey,ctrlKey:s.ctrlKey,shiftKey:s.shiftKey,metaKey:s.metaKey}=r);let a=new KeyboardEvent("keydown",s);a.synthetic=!0,t.dispatchEvent(a);let c=new KeyboardEvent("keyup",s);return c.synthetic=!0,t.dispatchEvent(c),a.defaultPrevented||c.defaultPrevented}function MC(t){for(;t;){if(t&&(t.nodeType==9||t.nodeType==11&&t.host))return t;t=t.assignedSlot||t.parentNode}return null}function RC(t,e){let n=e.focusNode,r=e.focusOffset;if(!n||e.anchorNode!=n||e.anchorOffset!=r)return!1;for(r=Math.min(r,ir(n));;)if(r){if(n.nodeType!=1)return!1;let s=n.childNodes[r-1];s.contentEditable=="false"?r--:(n=s,r=ir(n))}else{if(n==t)return!0;r=zr(n),n=n.parentNode}}function Ly(t){return t instanceof Window?t.pageYOffset>Math.max(0,t.document.documentElement.scrollHeight-t.innerHeight-4):t.scrollTop>Math.max(1,t.scrollHeight-t.clientHeight-4)}function By(t,e){for(let n=t,r=e;;){if(n.nodeType==3&&r>0)return{node:n,offset:r};if(n.nodeType==1&&r>0){if(n.contentEditable=="false")return null;n=n.childNodes[r-1],r=ir(n)}else if(n.parentNode&&!Wo(n))r=zr(n),n=n.parentNode;else return null}}function $y(t,e){for(let n=t,r=e;;){if(n.nodeType==3&&r<n.nodeValue.length)return{node:n,offset:r};if(n.nodeType==1&&r<n.childNodes.length){if(n.contentEditable=="false")return null;n=n.childNodes[r],r=0}else if(n.parentNode&&!Wo(n))r=zr(n)+1,n=n.parentNode;else return null}}class ji{constructor(e,n,r=!0){this.node=e,this.offset=n,this.precise=r}static before(e,n){return new ji(e.parentNode,zr(e),n)}static after(e,n){return new ji(e.parentNode,zr(e)+1,n)}}var Rt=(function(t){return t[t.LTR=0]="LTR",t[t.RTL=1]="RTL",t})(Rt||(Rt={}));const Os=Rt.LTR,jf=Rt.RTL;function qy(t){let e=[];for(let n=0;n<t.length;n++)e.push(1<<+t[n]);return e}const DC=qy("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"),_C=qy("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"),Ef=Object.create(null),Ui=[];for(let t of["()","[]","{}"]){let e=t.charCodeAt(0),n=t.charCodeAt(1);Ef[e]=n,Ef[n]=-e}function zy(t){return t<=247?DC[t]:1424<=t&&t<=1524?2:1536<=t&&t<=1785?_C[t-1536]:1774<=t&&t<=2220?4:8192<=t&&t<=8204?256:64336<=t&&t<=65023?4:1}const LC=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/;class Fi{get dir(){return this.level%2?jf:Os}constructor(e,n,r){this.from=e,this.to=n,this.level=r}side(e,n){return this.dir==n==e?this.to:this.from}forward(e,n){return e==(this.dir==n)}static find(e,n,r,s){let a=-1;for(let c=0;c<e.length;c++){let d=e[c];if(d.from<=n&&d.to>=n){if(d.level==r)return c;(a<0||(s!=0?s<0?d.from<n:d.to>n:e[a].level>d.level))&&(a=c)}}if(a<0)throw new RangeError("Index out of range");return a}}function Hy(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++){let r=t[n],s=e[n];if(r.from!=s.from||r.to!=s.to||r.direction!=s.direction||!Hy(r.inner,s.inner))return!1}return!0}const Nt=[];function BC(t,e,n,r,s){for(let a=0;a<=r.length;a++){let c=a?r[a-1].to:e,d=a<r.length?r[a].from:n,f=a?256:s;for(let h=c,g=f,b=f;h<d;h++){let v=zy(t.charCodeAt(h));v==512?v=g:v==8&&b==4&&(v=16),Nt[h]=v==4?2:v,v&7&&(b=v),g=v}for(let h=c,g=f,b=f;h<d;h++){let v=Nt[h];if(v==128)h<d-1&&g==Nt[h+1]&&g&24?v=Nt[h]=g:Nt[h]=256;else if(v==64){let S=h+1;for(;S<d&&Nt[S]==64;)S++;let A=h&&g==8||S<n&&Nt[S]==8?b==1?1:8:256;for(let C=h;C<S;C++)Nt[C]=A;h=S-1}else v==8&&b==1&&(Nt[h]=1);g=v,v&7&&(b=v)}}}function $C(t,e,n,r,s){let a=s==1?2:1;for(let c=0,d=0,f=0;c<=r.length;c++){let h=c?r[c-1].to:e,g=c<r.length?r[c].from:n;for(let b=h,v,S,A;b<g;b++)if(S=Ef[v=t.charCodeAt(b)])if(S<0){for(let C=d-3;C>=0;C-=3)if(Ui[C+1]==-S){let T=Ui[C+2],D=T&2?s:T&4?T&1?a:s:0;D&&(Nt[b]=Nt[Ui[C]]=D),d=C;break}}else{if(Ui.length==189)break;Ui[d++]=b,Ui[d++]=v,Ui[d++]=f}else if((A=Nt[b])==2||A==1){let C=A==s;f=C?0:1;for(let T=d-3;T>=0;T-=3){let D=Ui[T+2];if(D&2)break;if(C)Ui[T+2]|=2;else{if(D&4)break;Ui[T+2]|=4}}}}}function qC(t,e,n,r){for(let s=0,a=r;s<=n.length;s++){let c=s?n[s-1].to:t,d=s<n.length?n[s].from:e;for(let f=c;f<d;){let h=Nt[f];if(h==256){let g=f+1;for(;;)if(g==d){if(s==n.length)break;g=n[s++].to,d=s<n.length?n[s].from:e}else if(Nt[g]==256)g++;else break;let b=a==1,v=(g<e?Nt[g]:r)==1,S=b==v?b?1:2:r;for(let A=g,C=s,T=C?n[C-1].to:t;A>f;)A==T&&(A=n[--C].from,T=C?n[C-1].to:t),Nt[--A]=S;f=g}else a=h,f++}}}function Of(t,e,n,r,s,a,c){let d=r%2?2:1;if(r%2==s%2)for(let f=e,h=0;f<n;){let g=!0,b=!1;if(h==a.length||f<a[h].from){let C=Nt[f];C!=d&&(g=!1,b=C==16)}let v=!g&&d==1?[]:null,S=g?r:r+1,A=f;e:for(;;)if(h<a.length&&A==a[h].from){if(b)break e;let C=a[h];if(!g)for(let T=C.to,D=h+1;;){if(T==n)break e;if(D<a.length&&a[D].from==T)T=a[D++].to;else{if(Nt[T]==d)break e;break}}if(h++,v)v.push(C);else{C.from>f&&c.push(new Fi(f,C.from,S));let T=C.direction==Os!=!(S%2);Mf(t,T?r+1:r,s,C.inner,C.from,C.to,c),f=C.to}A=C.to}else{if(A==n||(g?Nt[A]!=d:Nt[A]==d))break;A++}v?Of(t,f,A,r+1,s,v,c):f<A&&c.push(new Fi(f,A,S)),f=A}else for(let f=n,h=a.length;f>e;){let g=!0,b=!1;if(!h||f>a[h-1].to){let C=Nt[f-1];C!=d&&(g=!1,b=C==16)}let v=!g&&d==1?[]:null,S=g?r:r+1,A=f;e:for(;;)if(h&&A==a[h-1].to){if(b)break e;let C=a[--h];if(!g)for(let T=C.from,D=h;;){if(T==e)break e;if(D&&a[D-1].to==T)T=a[--D].from;else{if(Nt[T-1]==d)break e;break}}if(v)v.push(C);else{C.to<f&&c.push(new Fi(C.to,f,S));let T=C.direction==Os!=!(S%2);Mf(t,T?r+1:r,s,C.inner,C.from,C.to,c),f=C.from}A=C.from}else{if(A==e||(g?Nt[A-1]!=d:Nt[A-1]==d))break;A--}v?Of(t,A,f,r+1,s,v,c):A<f&&c.push(new Fi(A,f,S)),f=A}}function Mf(t,e,n,r,s,a,c){let d=e%2?2:1;BC(t,s,a,r,d),$C(t,s,a,r,d),qC(s,a,r,d),Of(t,s,a,e,n,r,c)}function zC(t,e,n){if(!t)return[new Fi(0,0,e==jf?1:0)];if(e==Os&&!n.length&&!LC.test(t))return Iy(t.length);if(n.length)for(;t.length>Nt.length;)Nt[Nt.length]=256;let r=[],s=e==Os?0:1;return Mf(t,s,s,n,0,t.length,r),r}function Iy(t){return[new Fi(0,t,0)]}let Uy="";function HC(t,e,n,r,s){var a;let c=r.head-t.from,d=Fi.find(e,c,(a=r.bidiLevel)!==null&&a!==void 0?a:-1,r.assoc),f=e[d],h=f.side(s,n);if(c==h){let v=d+=s?1:-1;if(v<0||v>=e.length)return null;f=e[d=v],c=f.side(!s,n),h=f.side(s,n)}let g=Sn(t.text,c,f.forward(s,n));(g<f.from||g>f.to)&&(g=h),Uy=t.text.slice(Math.min(c,g),Math.max(c,g));let b=d==(s?e.length-1:0)?null:e[d+(s?1:-1)];return b&&g==h&&b.level+(s?0:1)<f.level?Ce.cursor(b.side(!s,n)+t.from,b.forward(s,n)?1:-1,b.level):Ce.cursor(g+t.from,f.forward(s,n)?-1:1,f.level)}function IC(t,e,n){for(let r=e;r<n;r++){let s=zy(t.charCodeAt(r));if(s==1)return Os;if(s==2||s==4)return jf}return Os}const Fy=He.define(),Vy=He.define(),Py=He.define(),Ky=He.define(),Rf=He.define(),Yy=He.define(),Gy=He.define(),Df=He.define(),_f=He.define(),Xy=He.define({combine:t=>t.some(e=>e)}),Jy=He.define({combine:t=>t.some(e=>e)}),Qy=He.define();class ul{constructor(e,n,r,s,a,c=!1){this.range=e,this.y=n,this.x=r,this.yMargin=s,this.xMargin=a,this.isSnapshot=c}map(e){return e.empty?this:new ul(this.range.map(e),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(e){return this.range.to<=e.doc.length?this:new ul(Ce.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const ec=zt.define({map:(t,e)=>t.map(e)}),Wy=zt.define();function Vi(t,e,n){let r=t.facet(Ky);r.length?r[0](e):window.onerror&&window.onerror(String(e),n,void 0,void 0,e)||(n?console.error(n+":",e):console.error(e))}const rr=He.define({combine:t=>t.length?t[0]:!0});let UC=0;const dl=He.define({combine(t){return t.filter((e,n)=>{for(let r=0;r<n;r++)if(t[r].plugin==e.plugin)return!1;return!0})}});class sr{constructor(e,n,r,s,a){this.id=e,this.create=n,this.domEventHandlers=r,this.domEventObservers=s,this.baseExtensions=a(this),this.extension=this.baseExtensions.concat(dl.of({plugin:this,arg:void 0}))}of(e){return this.baseExtensions.concat(dl.of({plugin:this,arg:e}))}static define(e,n){const{eventHandlers:r,eventObservers:s,provide:a,decorations:c}=n||{};return new sr(UC++,e,r,s,d=>{let f=[];return c&&f.push(tc.of(h=>{let g=h.plugin(d);return g?c(g):nn.none})),a&&f.push(a(d)),f})}static fromClass(e,n){return sr.define((r,s)=>new e(r,s),n)}}class Lf{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}get plugin(){return this.spec&&this.spec.plugin}update(e){if(this.value){if(this.mustUpdate){let n=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(n)}catch(r){if(Vi(n.state,r,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.plugin.create(e,this.spec.arg)}catch(n){Vi(e.state,n,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var n;if(!((n=this.value)===null||n===void 0)&&n.destroy)try{this.value.destroy()}catch(r){Vi(e.state,r,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const Zy=He.define(),Bf=He.define(),tc=He.define(),eb=He.define(),$f=He.define(),Na=He.define(),tb=He.define();function nb(t,e){let n=t.state.facet(tb);if(!n.length)return n;let r=n.map(a=>a instanceof Function?a(t):a),s=[];return ft.spans(r,e.from,e.to,{point(){},span(a,c,d,f){let h=a-e.from,g=c-e.from,b=s;for(let v=d.length-1;v>=0;v--,f--){let S=d[v].spec.bidiIsolate,A;if(S==null&&(S=IC(e.text,h,g)),f>0&&b.length&&(A=b[b.length-1]).to==h&&A.direction==S)A.to=g,b=A.inner;else{let C={from:h,to:g,direction:S,inner:[]};b.push(C),b=C.inner}}}}),s}const ib=He.define();function rb(t){let e=0,n=0,r=0,s=0;for(let a of t.state.facet(ib)){let c=a(t);c&&(c.left!=null&&(e=Math.max(e,c.left)),c.right!=null&&(n=Math.max(n,c.right)),c.top!=null&&(r=Math.max(r,c.top)),c.bottom!=null&&(s=Math.max(s,c.bottom)))}return{left:e,right:n,top:r,bottom:s}}const Ta=He.define();class oi{constructor(e,n,r,s){this.fromA=e,this.toA=n,this.fromB=r,this.toB=s}join(e){return new oi(Math.min(this.fromA,e.fromA),Math.max(this.toA,e.toA),Math.min(this.fromB,e.fromB),Math.max(this.toB,e.toB))}addToSet(e){let n=e.length,r=this;for(;n>0;n--){let s=e[n-1];if(!(s.fromA>r.toA)){if(s.toA<r.fromA)break;r=r.join(s),e.splice(n-1,1)}}return e.splice(n,0,r),e}static extendWithRanges(e,n){if(n.length==0)return e;let r=[];for(let s=0,a=0,c=0;;){let d=s<e.length?e[s].fromB:1e9,f=a<n.length?n[a]:1e9,h=Math.min(d,f);if(h==1e9)break;let g=h+c,b=h,v=g;for(;;)if(a<n.length&&n[a]<=b){let S=n[a+1];a+=2,b=Math.max(b,S);for(let A=s;A<e.length&&e[A].fromB<=b;A++)c=e[A].toA-e[A].toB;v=Math.max(v,S+c)}else if(s<e.length&&e[s].fromB<=b){let S=e[s++];b=Math.max(b,S.toB),v=Math.max(v,S.toA),c=S.toA-S.toB}else break;r.push(new oi(g,v,h,b))}return r}}class nc{constructor(e,n,r){this.view=e,this.state=n,this.transactions=r,this.flags=0,this.startState=e.state,this.changes=Zt.empty(this.startState.doc.length);for(let a of r)this.changes=this.changes.compose(a.changes);let s=[];this.changes.iterChangedRanges((a,c,d,f)=>s.push(new oi(a,c,d,f))),this.changedRanges=s}static create(e,n,r){return new nc(e,n,r)}get viewportChanged(){return(this.flags&4)>0}get viewportMoved(){return(this.flags&8)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&18)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(e=>e.selection)}get empty(){return this.flags==0&&this.transactions.length==0}}const FC=[];class Lt{constructor(e,n,r=0){this.dom=e,this.length=n,this.flags=r,this.parent=null,e.cmTile=this}get breakAfter(){return this.flags&1}get children(){return FC}isWidget(){return!1}get isHidden(){return!1}isComposite(){return!1}isLine(){return!1}isText(){return!1}isBlock(){return!1}get domAttrs(){return null}sync(e){if(this.flags|=2,this.flags&4){this.flags&=-5;let n=this.domAttrs;n&&CC(this.dom,n)}}toString(){return this.constructor.name+(this.children.length?`(${this.children})`:"")+(this.breakAfter?"#":"")}destroy(){this.parent=null}setDOM(e){this.dom=e,e.cmTile=this}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(e,n=this.posAtStart){let r=n;for(let s of this.children){if(s==e)return r;r+=s.length+s.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(e){return this.posBefore(e)+e.length}covers(e){return!0}coordsIn(e,n,r){return null}domPosFor(e,n){let r=zr(this.dom),s=this.length?e>0:n>0;return new ji(this.parent.dom,r+(s?1:0),e==0||e==this.length)}markDirty(e){this.flags&=-3,e&&(this.flags|=4),this.parent&&this.parent.flags&2&&this.parent.markDirty(!1)}get overrideDOMText(){return null}get root(){for(let e=this;e;e=e.parent)if(e instanceof rc)return e;return null}static get(e){return e.cmTile}}class ic extends Lt{constructor(e){super(e,0),this._children=[]}isComposite(){return!0}get children(){return this._children}get lastChild(){return this.children.length?this.children[this.children.length-1]:null}append(e){this.children.push(e),e.parent=this}sync(e){if(this.flags&2)return;super.sync(e);let n=this.dom,r=null,s,a=e?.node==n?e:null,c=0;for(let d of this.children){if(d.sync(e),c+=d.length+d.breakAfter,s=r?r.nextSibling:n.firstChild,a&&s!=d.dom&&(a.written=!0),d.dom.parentNode==n)for(;s&&s!=d.dom;)s=sb(s);else n.insertBefore(d.dom,s);r=d.dom}for(s=r?r.nextSibling:n.firstChild,a&&s&&(a.written=!0);s;)s=sb(s);this.length=c}}function sb(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class rc extends ic{constructor(e,n){super(n),this.view=e}owns(e){for(;e;e=e.parent)if(e==this)return!0;return!1}isBlock(){return!0}nearest(e){for(;;){if(!e)return null;let n=Lt.get(e);if(n&&this.owns(n))return n;e=e.parentNode}}blockTiles(e){for(let n=[],r=this,s=0,a=0;;)if(s==r.children.length){if(!n.length)return;r=r.parent,r.breakAfter&&a++,s=n.pop()}else{let c=r.children[s++];if(c instanceof lr)n.push(s),r=c,s=0;else{let d=a+c.length,f=e(c,a);if(f!==void 0)return f;a=d+c.breakAfter}}}resolveBlock(e,n){let r,s=-1,a,c=-1;if(this.blockTiles((d,f)=>{let h=f+d.length;if(e>=f&&e<=h){if(d.isWidget()&&n>=-1&&n<=1){if(d.flags&32)return!0;d.flags&16&&(r=void 0)}(f<e||e==h&&(n<-1?d.length:d.covers(1)))&&(!r||!d.isWidget()&&r.isWidget())&&(r=d,s=e-f),(h>e||e==f&&(n>1?d.length:d.covers(-1)))&&(!a||!d.isWidget()&&a.isWidget())&&(a=d,c=e-f)}}),!r&&!a)throw new Error("No tile at position "+e);return r&&n<0||!a?{tile:r,offset:s}:{tile:a,offset:c}}}class lr extends ic{constructor(e,n){super(e),this.wrapper=n}isBlock(){return!0}covers(e){return this.children.length?e<0?this.children[0].covers(-1):this.lastChild.covers(1):!1}get domAttrs(){return this.wrapper.attributes}static of(e,n){let r=new lr(n||document.createElement(e.tagName),e);return n||(r.flags|=4),r}}class fl extends ic{constructor(e,n){super(e),this.attrs=n}isLine(){return!0}static start(e,n,r){let s=new fl(n||document.createElement("div"),e);return(!n||!r)&&(s.flags|=4),s}get domAttrs(){return this.attrs}resolveInline(e,n,r){let s=null,a=-1,c=null,d=-1;function f(g,b){for(let v=0,S=0;v<g.children.length&&S<=b;v++){let A=g.children[v],C=S+A.length;C>=b&&(A.isComposite()?f(A,b-S):(!c||c.isHidden&&(n>0&&!(c.flags&32)||r&&PC(c,A)))&&(C>b||A.flags&32&&n<=1)?(c=A,d=b-S):(S<b||A.flags&16&&!A.isHidden&&n>=-1)&&(s=A,a=b-S)),S=C}}f(this,e);let h=(n<0?s:c)||s||c;return h?{tile:h,offset:h==s?a:d}:null}coordsIn(e,n,r){let s=this.resolveInline(e,n,!0);return s?s.tile.coordsIn(Math.max(0,s.offset),n,r):VC(this)}domIn(e,n){let r=this.resolveInline(e,n);if(r){let{tile:s,offset:a}=r;if(this.dom.contains(s.dom))return s.isText()?new ji(s.dom,Math.min(s.dom.nodeValue.length,a)):s.domPosFor(a,s.flags&16?1:s.flags&32?-1:n);let c=r.tile.parent,d=!1;for(let f of c.children){if(d)return new ji(f.dom,0);f==r.tile&&(d=!0)}}return new ji(this.dom,0)}}function VC(t){let e=t.dom.lastChild;if(!e)return t.dom.getBoundingClientRect();let n=Qo(e);return n[n.length-1]||null}function PC(t,e){let n=t.coordsIn(0,1),r=e.coordsIn(0,1);return n&&r&&r.top<n.bottom}class Bn extends ic{constructor(e,n){super(e),this.mark=n}get domAttrs(){return this.mark.attrs}static of(e,n){let r=new Bn(n||document.createElement(e.tagName),e);return n||(r.flags|=4),r}}class Ms extends Lt{constructor(e,n){super(e,n.length),this.text=n}sync(e){this.flags&2||(super.sync(e),this.dom.nodeValue!=this.text&&(e&&e.node==this.dom&&(e.written=!0),this.dom.nodeValue=this.text))}isText(){return!0}toString(){return JSON.stringify(this.text)}coordsIn(e,n,r){let s=this.dom.nodeValue.length;e>s&&(e=s);let a=e,c=e,d=0;e==0&&n<0||e==s&&n>=0?Oe.chrome||Oe.gecko||(e?(a--,d=1):c<s&&(c++,d=-1)):n<0?a--:c<s&&c++;let f=Ca(this.dom,a,c).getClientRects();if(!f.length)return null;let h=f[(d?d<0:n>=0)?0:f.length-1];return Oe.safari&&!d&&h.width==0&&(h=Array.prototype.find.call(f,g=>g.width)||h),r==null?h:Zo(h,(d?d>0:n<0)==r)}static of(e,n){let r=new Ms(n||document.createTextNode(e),e);return n||(r.flags|=2),r}}class Rs extends Lt{constructor(e,n,r,s){super(e,n,s),this.widget=r}isWidget(){return!0}get isHidden(){return this.widget.isHidden}covers(e){return this.flags&48?!1:(this.flags&(e<0?64:128))>0}coordsIn(e,n){return this.coordsInWidget(e,n,!1)}coordsInWidget(e,n,r){let s=this.widget.coordsAt(this.dom,e,n);if(s)return s;if(r)return Zo(this.dom.getBoundingClientRect(),this.length?e==0:n<=0);{let a=this.dom.getClientRects(),c=null;if(!a.length)return null;let d=this.flags&16?!0:this.flags&32?!1:e>0;for(let f=d?a.length-1:0;c=a[f],!(e>0?f==0:f==a.length-1||c.top<c.bottom);f+=d?-1:1);return Zo(c,!d)}}get overrideDOMText(){if(!this.length)return pt.empty;let{root:e}=this;if(!e)return pt.empty;let n=this.posAtStart;return e.view.state.doc.slice(n,n+this.length)}destroy(){super.destroy(),this.widget.destroy(this.dom)}static of(e,n,r,s,a){return a||(a=e.toDOM(n),e.editable||(a.contentEditable="false")),new Rs(a,r,e,s)}}class sc extends Lt{constructor(e){let n=document.createElement("img");n.className="cm-widgetBuffer",n.setAttribute("aria-hidden","true"),super(n,0,e)}get isHidden(){return!0}get overrideDOMText(){return pt.empty}coordsIn(e,n,r){let s=this.dom.getBoundingClientRect();return r==null?s:Zo(s,n>0==r)}}class KC{constructor(e){this.index=0,this.beforeBreak=!1,this.parents=[],this.tile=e}advance(e,n,r){let{tile:s,index:a,beforeBreak:c,parents:d}=this;for(;e||n>0;)if(s.isComposite())if(c){if(!e)break;r&&r.break(),e--,c=!1}else if(a==s.children.length){if(!e&&!d.length)break;r&&r.leave(s),c=!!s.breakAfter,{tile:s,index:a}=d.pop(),a++}else{let f=s.children[a],h=f.breakAfter;(n>0?f.length<=e:f.length<e)&&(!r||r.skip(f,0,f.length)!==!1||!f.isComposite)?(c=!!h,a++,e-=f.length):(d.push({tile:s,index:a}),s=f,a=0,r&&f.isComposite()&&r.enter(f))}else{let f=s.length;if(a<f&&e){let h=Math.min(e,f-a);r&&r.skip(s,a,a+h),e-=h,a+=h}if(a==f)c=!!s.breakAfter,{tile:s,index:a}=d.pop(),a++;else if(!e)break}return this.tile=s,this.index=a,this.beforeBreak=c,this}get root(){return this.parents.length?this.parents[0].tile:this.tile}}class YC{constructor(e,n,r,s){this.from=e,this.to=n,this.wrapper=r,this.rank=s}}class GC{constructor(e,n,r){this.cache=e,this.root=n,this.blockWrappers=r,this.curLine=null,this.lastBlock=null,this.afterWidget=null,this.pos=0,this.wrappers=[],this.wrapperPos=0}addText(e,n,r,s){var a;this.flushBuffer();let c=this.ensureMarks(n,r),d=c.lastChild;if(d&&d.isText()&&!(d.flags&8)&&d.length+e.length<512){this.cache.reused.set(d,2);let f=c.children[c.children.length-1]=new Ms(d.dom,d.text+e);f.parent=c}else c.append(s||Ms.of(e,(a=this.cache.find(Ms))===null||a===void 0?void 0:a.dom));this.pos+=e.length,this.afterWidget=null}addComposition(e,n){let r=this.curLine;r.dom!=n.line.dom&&(r.setDOM(this.cache.reused.has(n.line)?qf(n.line.dom):n.line.dom),this.cache.reused.set(n.line,2));let s=r;for(let d=n.marks.length-1;d>=0;d--){let f=n.marks[d],h=s.lastChild;if(h instanceof Bn&&h.mark.eq(f.mark))h.dom!=f.dom&&h.setDOM(qf(f.dom)),s=h;else{if(this.cache.reused.get(f)){let b=Lt.get(f.dom);b&&b.setDOM(qf(f.dom))}let g=Bn.of(f.mark,f.dom);s.append(g),s=g}this.cache.reused.set(f,2)}let a=Lt.get(e.text);a&&this.cache.reused.set(a,2);let c=new Ms(e.text,e.text.nodeValue);c.flags|=8,this.pos=e.range.toB,s.append(c)}addInlineWidget(e,n,r){let s=this.afterWidget&&e.flags&48&&(this.afterWidget.flags&48)==(e.flags&48);s||this.flushBuffer();let a=this.ensureMarks(n,r);!s&&!(e.flags&16)&&a.append(this.getBuffer(1)),a.append(e),this.pos+=e.length,this.afterWidget=e}addMark(e,n,r){this.flushBuffer(),this.ensureMarks(n,r).append(e),this.pos+=e.length,this.afterWidget=null}addBlockWidget(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}continueWidget(e){let n=this.afterWidget||this.lastBlock;n.length+=e,this.pos+=e}addLineStart(e,n){var r;e||(e=ab);let s=fl.start(e,n||((r=this.cache.find(fl))===null||r===void 0?void 0:r.dom),!!n);this.getBlockPos().append(this.lastBlock=this.curLine=s)}addLine(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}addBreak(){this.lastBlock.flags|=1,this.endLine(),this.pos++}addLineStartIfNotCovered(e){this.blockPosCovered()||this.addLineStart(e)}ensureLine(e){this.curLine||this.addLineStart(e)}ensureMarks(e,n){var r;let s=this.curLine;for(let a=e.length-1;a>=0;a--){let c=e[a],d;if(n>0&&(d=s.lastChild)&&d instanceof Bn&&d.mark.eq(c))s=d,n--;else{let f=Bn.of(c,(r=this.cache.find(Bn,h=>h.mark.eq(c)))===null||r===void 0?void 0:r.dom);s.append(f),s=f,n=0}}return s}endLine(){if(this.curLine){this.flushBuffer();let e=this.curLine.lastChild;(!e||!lb(this.curLine,!1)||e.dom.nodeName!="BR"&&e.isWidget()&&!(Oe.ios&&lb(this.curLine,!0)))&&this.curLine.append(this.cache.findWidget(zf,0,32)||new Rs(zf.toDOM(),0,zf,32)),this.curLine=this.afterWidget=null}}updateBlockWrappers(){this.wrapperPos>this.pos+1e4&&(this.blockWrappers.goto(this.pos),this.wrappers.length=0);for(let e=this.wrappers.length-1;e>=0;e--)this.wrappers[e].to<this.pos&&this.wrappers.splice(e,1);for(let e=this.blockWrappers;e.value&&e.from<=this.pos;e.next())if(e.to>=this.pos){let n=e.rank*102+e.value.rank,r=new YC(e.from,e.to,e.value,n),s=this.wrappers.length;for(;s>0&&(this.wrappers[s-1].rank-r.rank||this.wrappers[s-1].to-r.to)<0;)s--;this.wrappers.splice(s,0,r)}this.wrapperPos=this.pos}getBlockPos(){var e;this.updateBlockWrappers();let n=this.root;for(let r of this.wrappers){let s=n.lastChild;if(r.from<this.pos&&s instanceof lr&&s.wrapper.eq(r.wrapper))n=s;else{let a=lr.of(r.wrapper,(e=this.cache.find(lr,c=>c.wrapper.eq(r.wrapper)))===null||e===void 0?void 0:e.dom);n.append(a),n=a}}return n}blockPosCovered(){let e=this.lastBlock;return e!=null&&!e.breakAfter&&(!e.isWidget()||(e.flags&160)>0)}getBuffer(e){let n=2|(e<0?16:32),r=this.cache.find(sc,void 0,1);return r&&(r.flags=n),r||new sc(n)}flushBuffer(){this.afterWidget&&!(this.afterWidget.flags&32)&&(this.afterWidget.parent.append(this.getBuffer(-1)),this.afterWidget=null)}}class XC{constructor(e){this.skipCount=0,this.text="",this.textOff=0,this.cursor=e.iter()}skip(e){this.textOff+e<=this.text.length?this.textOff+=e:(this.skipCount+=e-(this.text.length-this.textOff),this.text="",this.textOff=0)}next(e){if(this.textOff==this.text.length){let{value:s,lineBreak:a,done:c}=this.cursor.next(this.skipCount);if(this.skipCount=0,c)throw new Error("Ran out of text content when drawing inline views");this.text=s;let d=this.textOff=Math.min(e,s.length);return a?null:s.slice(0,d)}let n=Math.min(this.text.length,this.textOff+e),r=this.text.slice(this.textOff,n);return this.textOff=n,r}}const lc=[Rs,fl,Ms,Bn,sc,lr,rc];for(let t=0;t<lc.length;t++)lc[t].bucket=t;class JC{constructor(e){this.view=e,this.buckets=lc.map(()=>[]),this.index=lc.map(()=>0),this.reused=new Map}add(e){let n=e.constructor.bucket,r=this.buckets[n];r.length<6?r.push(e):r[this.index[n]=(this.index[n]+1)%6]=e}find(e,n,r=2){let s=e.bucket,a=this.buckets[s],c=this.index[s];for(let d=0;d<a.length;d++){let f=(d+c)%a.length,h=a[f];if((!n||n(h))&&!this.reused.has(h))return a.splice(f,1),f<c&&this.index[s]--,this.reused.set(h,r),h}return null}findWidget(e,n,r){let s=this.buckets[0];if(s.length)for(let a=0,c=0;;a++){if(a==s.length){if(c)return null;c=1,a=0}let d=s[a];if(!this.reused.has(d)&&(c==0?d.widget.compare(e):d.widget.constructor==e.constructor&&e.updateDOM(d.dom,this.view,d.widget)))return s.splice(a,1),a<this.index[0]&&this.index[0]--,d.widget==e&&d.length==n&&(d.flags&497)==r?(this.reused.set(d,1),d):(this.reused.set(d,2),new Rs(d.dom,n,e,d.flags&-498|r))}}reuse(e){return this.reused.set(e,1),e}maybeReuse(e,n=2){if(!this.reused.has(e))return this.reused.set(e,n),e.dom}clear(){for(let e=0;e<this.buckets.length;e++)this.buckets[e].length=this.index[e]=0}}class QC{constructor(e,n,r,s,a){this.view=e,this.decorations=s,this.disallowBlockEffectsFor=a,this.openWidget=!1,this.openMarks=0,this.cache=new JC(e),this.text=new XC(e.state.doc),this.builder=new GC(this.cache,new rc(e,e.contentDOM),ft.iter(r)),this.cache.reused.set(n,2),this.old=new KC(n),this.reuseWalker={skip:(c,d,f)=>{if(this.cache.add(c),c.isComposite())return!1},enter:c=>this.cache.add(c),leave:()=>{},break:()=>{}}}run(e,n){let r=n&&this.getCompositionContext(n.text);for(let s=0,a=0,c=0;;){let d=c<e.length?e[c++]:null,f=d?d.fromA:this.old.root.length;if(f>s){let h=f-s;this.preserve(h,!c,!d),s=f,a+=h}if(!d)break;n&&d.fromA<=n.range.fromA&&d.toA>=n.range.toA?(this.forward(d.fromA,n.range.fromA,n.range.fromA<n.range.toA?1:-1),this.emit(a,n.range.fromB),this.builder.flushBuffer(),this.cache.clear(),this.builder.addComposition(n,r),this.text.skip(n.range.toB-n.range.fromB),this.forward(n.range.fromA,d.toA),this.emit(n.range.toB,d.toB)):(this.forward(d.fromA,d.toA),this.emit(a,d.toB)),a=d.toB,s=d.toA}return this.builder.curLine&&this.builder.endLine(),this.builder.root}preserve(e,n,r){let s=eN(this.old),a=this.openMarks;this.old.advance(e,r?1:-1,{skip:(c,d,f)=>{if(c.isWidget())if(this.openWidget)this.builder.continueWidget(f-d);else{let h=f>0||d<c.length?Rs.of(c.widget,this.view,f-d,c.flags&496,this.cache.maybeReuse(c)):this.cache.reuse(c);h.flags&256?(h.flags&=-2,this.builder.addBlockWidget(h)):(this.builder.ensureLine(null),this.builder.addInlineWidget(h,s,a),a=s.length)}else if(c.isText())this.builder.ensureLine(null),!d&&f==c.length&&!this.cache.reused.has(c)?this.builder.addText(c.text,s,a,this.cache.reuse(c)):(this.cache.add(c),this.builder.addText(c.text.slice(d,f),s,a)),a=s.length;else if(c.isLine())c.flags&=-2,this.cache.reused.set(c,1),this.builder.addLine(c);else if(c instanceof sc)this.cache.add(c);else if(c instanceof Bn)this.builder.ensureLine(null),this.builder.addMark(c,s,a),this.cache.reused.set(c,1),a=s.length;else return!1;this.openWidget=!1},enter:c=>{c.isLine()?this.builder.addLineStart(c.attrs,this.cache.maybeReuse(c)):(this.cache.add(c),c instanceof Bn&&s.unshift(c.mark)),this.openWidget=!1},leave:c=>{c.isLine()?s.length&&(s.length=a=0):c instanceof Bn&&(s.shift(),a=Math.min(a,s.length))},break:()=>{this.builder.addBreak(),this.openWidget=!1}}),this.text.skip(e)}emit(e,n){let r=null,s=this.builder,a=-1,c=ft.spans(this.decorations,e,n,{point:(d,f,h,g,b,v)=>{if(h instanceof js){if(this.disallowBlockEffectsFor[v]){if(h.block)throw new RangeError("Block decorations may not be specified via plugins");if(f>this.view.state.doc.lineAt(d).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}if(a=g.length,b>g.length)s.continueWidget(f-d);else{let S=h.widget||(h.block?hl.block:hl.inline),A=WC(h),C=this.cache.findWidget(S,f-d,A)||Rs.of(S,this.view,f-d,A);h.block?(h.startSide>0&&s.addLineStartIfNotCovered(r),s.addBlockWidget(C)):(s.ensureLine(r),s.addInlineWidget(C,g,b))}r=null}else r=ZC(r,h);f>d&&this.text.skip(f-d)},span:(d,f,h,g)=>{for(let b=d;b<f;){let v=this.text.next(Math.min(512,f-b));v==null?(s.addLineStartIfNotCovered(r),s.addBreak(),b++):(s.ensureLine(r),s.addText(v,h,b==d?g:h.length),b+=v.length),r=null}a=h.length}});a>-1&&(this.openWidget=c>a),this.openWidget||s.addLineStartIfNotCovered(r),this.openMarks=c}forward(e,n,r=1){n-e<=10?this.old.advance(n-e,r,this.reuseWalker):(this.old.advance(5,-1,this.reuseWalker),this.old.advance(n-e-10,-1),this.old.advance(5,r,this.reuseWalker))}getCompositionContext(e){let n=[],r=null;for(let s=e.parentNode;;s=s.parentNode){let a=Lt.get(s);if(s==this.view.contentDOM)break;a instanceof Bn?n.push(a):a?.isLine()?r=a:a instanceof lr||(s.nodeName=="DIV"&&!r&&s!=this.view.contentDOM?r=new fl(s,ab):r||n.push(Bn.of(new xa({tagName:s.nodeName.toLowerCase(),attributes:NC(s)}),s)))}return{line:r,marks:n}}}function lb(t,e){let n=r=>{for(let s of r.children)if((e?s.isText():s.length)||n(s))return!0;return!1};return n(t)}function WC(t){let e=t.isReplace?(t.startSide<0?64:0)|(t.endSide>0?128:0):t.startSide>0?32:16;return t.block&&(e|=256),e}const ab={class:"cm-line"};function ZC(t,e){let n=e.spec.attributes,r=e.spec.class;return!n&&!r||(t||(t={class:"cm-line"}),n&&Cf(n,t),r&&(t.class+=" "+r)),t}function eN(t){let e=[];for(let n=t.parents.length;n>1;n--){let r=n==t.parents.length?t.tile:t.parents[n].tile;r instanceof Bn&&e.push(r.mark)}return e}function qf(t){let e=Lt.get(t);return e&&e.setDOM(t.cloneNode()),t}class hl extends Jo{constructor(e){super(),this.tag=e}eq(e){return e.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(e){return e.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}hl.inline=new hl("span"),hl.block=new hl("div");const zf=new class extends Jo{toDOM(){return document.createElement("br")}get isHidden(){return!0}get editable(){return!0}};class ob{constructor(e){this.view=e,this.decorations=[],this.blockWrappers=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.editContextFormatting=nn.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.updateDeco(),this.tile=new rc(e,e.contentDOM),this.updateInner([new oi(0,0,0,e.state.doc.length)],null)}update(e){var n;let r=e.changedRanges;this.minWidth>0&&r.length&&(r.every(({fromA:g,toA:b})=>b<this.minWidthFrom||g>this.minWidthTo)?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(e);let s=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(!((n=this.domChanged)===null||n===void 0)&&n.newSel?s=this.domChanged.newSel.head:!cN(e.changes,this.hasComposition)&&!e.selectionSet&&(s=e.state.selection.main.head));let a=s>-1?nN(this.view,e.changes,s):null;if(this.domChanged=null,this.hasComposition){let{from:g,to:b}=this.hasComposition;r=new oi(g,b,e.changes.mapPos(g,-1),e.changes.mapPos(b,1)).addToSet(r.slice())}this.hasComposition=a?{from:a.range.fromB,to:a.range.toB}:null,(Oe.ie||Oe.chrome)&&!a&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let c=this.decorations,d=this.blockWrappers;this.updateDeco();let f=sN(c,this.decorations,e.changes);f.length&&(r=oi.extendWithRanges(r,f));let h=aN(d,this.blockWrappers,e.changes);return h.length&&(r=oi.extendWithRanges(r,h)),a&&!r.some(g=>g.fromA<=a.range.fromA&&g.toA>=a.range.toA)&&(r=a.range.addToSet(r.slice())),this.tile.flags&2&&r.length==0?!1:(this.updateInner(r,a),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,n){this.view.viewState.mustMeasureContent=!0;let{observer:r}=this.view;r.ignore(()=>{if(n||e.length){let c=this.tile,d=new QC(this.view,c,this.blockWrappers,this.decorations,this.dynamicDecorationMap);n&&Lt.get(n.text)&&d.cache.reused.set(Lt.get(n.text),2),this.tile=d.run(e,n),Hf(c,d.cache.reused)}this.tile.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.tile.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let a=Oe.chrome||Oe.ios?{node:r.selectionRange.focusNode,written:!1}:void 0;this.tile.sync(a),a&&(a.written||r.selectionRange.focusNode!=a.node||!this.tile.dom.contains(a.node))&&(this.forceSelection=!0),this.tile.dom.style.height=""});let s=[];if(this.view.viewport.from||this.view.viewport.to<this.view.state.doc.length)for(let a of this.tile.children)a.isWidget()&&a.widget instanceof If&&s.push(a.dom);r.updateGaps(s)}updateEditContextFormatting(e){this.editContextFormatting=this.editContextFormatting.map(e.changes);for(let n of e.transactions)for(let r of n.effects)r.is(Wy)&&(this.editContextFormatting=r.value)}updateSelection(e=!1,n=!1){(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let{dom:r}=this.tile,s=this.view.root.activeElement,a=s==r,c=!a&&!(this.view.state.facet(rr)||r.tabIndex>-1)&&Aa(r,this.view.observer.selectionRange)&&!(s&&r.contains(s));if(!(a||n||c))return;let d=this.forceSelection;this.forceSelection=!1;let f=this.view.state.selection.main,h,g;if(f.empty?g=h=this.inlineDOMNearPos(f.anchor,f.assoc||1):(g=this.inlineDOMNearPos(f.head,f.head==f.from?1:-1),h=this.inlineDOMNearPos(f.anchor,f.anchor==f.from?1:-1)),Oe.gecko&&f.empty&&!this.hasComposition&&tN(h)){let v=document.createTextNode("");this.view.observer.ignore(()=>h.node.insertBefore(v,h.node.childNodes[h.offset]||null)),h=g=new ji(v,0),d=!0}let b=this.view.observer.selectionRange;(d||!b.focusNode||(!ka(h.node,h.offset,b.anchorNode,b.anchorOffset)||!ka(g.node,g.offset,b.focusNode,b.focusOffset))&&!this.suppressWidgetCursorChange(b,f))&&(this.view.observer.ignore(()=>{Oe.android&&Oe.chrome&&r.contains(b.focusNode)&&oN(b.focusNode,r)&&(r.blur(),r.focus({preventScroll:!0}));let v=Sa(this.view.root);if(v)if(f.empty){if(Oe.gecko){let S=iN(h.node,h.offset);if(S&&S!=3){let A=(S==1?By:$y)(h.node,h.offset);A&&(h=new ji(A.node,A.offset))}}v.collapse(h.node,h.offset),f.bidiLevel!=null&&v.caretBidiLevel!==void 0&&(v.caretBidiLevel=f.bidiLevel)}else if(v.extend){v.collapse(h.node,h.offset);try{v.extend(g.node,g.offset)}catch{}}else{let S=document.createRange();f.anchor>f.head&&([h,g]=[g,h]),S.setEnd(g.node,g.offset),S.setStart(h.node,h.offset),v.removeAllRanges(),v.addRange(S)}c&&this.view.root.activeElement==r&&(r.blur(),s&&s.focus())}),this.view.observer.setSelectionRange(h,g)),this.impreciseAnchor=h.precise?null:new ji(b.anchorNode,b.anchorOffset),this.impreciseHead=g.precise?null:new ji(b.focusNode,b.focusOffset)}suppressWidgetCursorChange(e,n){return this.hasComposition&&n.empty&&ka(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)&&this.posFromDOM(e.focusNode,e.focusOffset)==n.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,n=e.state.selection.main,r=Sa(e.root),{anchorNode:s,anchorOffset:a}=e.observer.selectionRange;if(!r||!n.empty||!n.assoc||!r.modify)return;let c=this.lineAt(n.head,n.assoc);if(!c)return;let d=c.posAtStart;if(n.head==d||n.head==d+c.length)return;let f=this.coordsAt(n.head,-1),h=this.coordsAt(n.head,1);if(!f||!h||f.bottom>h.top)return;let g=this.domAtPos(n.head+n.assoc,n.assoc);r.collapse(g.node,g.offset),r.modify("move",n.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let b=e.observer.selectionRange;e.docView.posFromDOM(b.anchorNode,b.anchorOffset)!=n.from&&r.collapse(s,a)}posFromDOM(e,n){let r=this.tile.nearest(e);if(!r)return this.tile.dom.compareDocumentPosition(e)&2?0:this.view.state.doc.length;let s=r.posAtStart;if(r.isComposite()){let a;if(e==r.dom)a=r.dom.childNodes[n];else{let c=ir(e)==0?0:n==0?-1:1;for(;;){let d=e.parentNode;if(d==r.dom)break;c==0&&d.firstChild!=d.lastChild&&(e==d.firstChild?c=-1:c=1),e=d}c<0?a=e:a=e.nextSibling}if(a==r.dom.firstChild)return s;for(;a&&!Lt.get(a);)a=a.nextSibling;if(!a)return s+r.length;for(let c=0,d=s;;c++){let f=r.children[c];if(f.dom==a)return d;d+=f.length+f.breakAfter}}else return r.isText()?e==r.dom?s+n:s+(n?r.length:0):s}domAtPos(e,n){let{tile:r,offset:s}=this.tile.resolveBlock(e,n);return r.isWidget()?r.domPosFor(s,n):r.domIn(s,n)}inlineDOMNearPos(e,n){let r,s=-1,a=!1,c,d=-1,f=!1;return this.tile.blockTiles((h,g)=>{if(h.isWidget()){if(h.flags&32&&g>=e)return!0;h.flags&16&&(a=!0)}else{let b=g+h.length;if(g<=e&&(r=h,s=e-g,a=b<e),b>=e&&!c&&(c=h,d=e-g,f=g>e),g>e&&c)return!0}}),!r&&!c?this.domAtPos(e,n):(a&&c?r=null:f&&r&&(c=null),r&&n<0||!c?r.domIn(s,n):c.domIn(d,n))}coordsAt(e,n,r){let{tile:s,offset:a}=this.tile.resolveBlock(e,n);return s.isWidget()?s.widget instanceof If?null:s.coordsInWidget(a,n,!0):s.coordsIn(a,n,r)}lineAt(e,n){let{tile:r}=this.tile.resolveBlock(e,n);return r.isLine()?r:null}coordsForChar(e){let{tile:n,offset:r}=this.tile.resolveBlock(e,1);if(!n.isLine())return null;function s(a,c){if(a.isComposite())for(let d of a.children){if(d.length>=c){let f=s(d,c);if(f)return f}if(c-=d.length,c<0)break}else if(a.isText()&&c<a.length){let d=Sn(a.text,c);if(d==c)return null;let f=Ca(a.dom,c,d).getClientRects();for(let h=0;h<f.length;h++){let g=f[h];if(h==f.length-1||g.top<g.bottom&&g.left<g.right)return g}}return null}return s(n,r)}measureVisibleLineHeights(e){let n=[],{from:r,to:s}=e,a=this.view.contentDOM.clientWidth,c=a>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,d=-1,f=this.view.textDirection==Rt.LTR,h=0,g=(b,v,S)=>{for(let A=0;A<b.children.length&&!(v>s);A++){let C=b.children[A],T=v+C.length,D=C.dom.getBoundingClientRect(),{height:j}=D;if(S&&!A&&(h+=D.top-S.top),C instanceof lr)T>r&&g(C,v,D);else if(v>=r&&(h>0&&n.push(-h),n.push(j+h),h=0,c)){let E=C.dom.lastChild,O=E?Qo(E):[];if(O.length){let R=O[O.length-1],B=f?R.right-D.left:D.right-R.left;B>d&&(d=B,this.minWidth=a,this.minWidthFrom=v,this.minWidthTo=T)}}S&&A==b.children.length-1&&(h+=S.bottom-D.bottom),v=T+C.breakAfter}};return g(this.tile,0,null),n}textDirectionAt(e){let{tile:n}=this.tile.resolveBlock(e,1);return getComputedStyle(n.dom).direction=="rtl"?Rt.RTL:Rt.LTR}measureTextSize(){let e=this.tile.blockTiles(c=>{if(c.isLine()&&c.children.length&&c.length<=20){let d=0,f;for(let h of c.children){if(!h.isText()||/[^ -~]/.test(h.text))return;let g=Qo(h.dom);if(g.length!=1)return;d+=g[0].width,f=g[0].height}if(d)return{lineHeight:c.dom.getBoundingClientRect().height,charWidth:d/c.length,textHeight:f}}});if(e)return e;let n=document.createElement("div"),r,s,a;return n.className="cm-line",n.style.width="99999px",n.style.position="absolute",n.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.tile.dom.appendChild(n);let c=Qo(n.firstChild)[0];r=n.getBoundingClientRect().height,s=c&&c.width?c.width/27:7,a=c&&c.height?c.height:r,n.remove()}),{lineHeight:r,charWidth:s,textHeight:a}}computeBlockGapDeco(){let e=[],n=this.view.viewState;for(let r=0,s=0;;s++){let a=s==n.viewports.length?null:n.viewports[s],c=a?a.from-1:this.view.state.doc.length;if(c>r){let d=(n.lineBlockAt(c).bottom-n.lineBlockAt(r).top)/this.view.scaleY;e.push(nn.replace({widget:new If(d),block:!0,inclusive:!0,isBlockGap:!0}).range(r,c))}if(!a)break;r=a.to+1}return nn.set(e)}updateDeco(){let e=1,n=this.view.state.facet(tc).map(a=>(this.dynamicDecorationMap[e++]=typeof a=="function")?a(this.view):a),r=!1,s=this.view.state.facet($f).map((a,c)=>{let d=typeof a=="function";return d&&(r=!0),d?a(this.view):a});for(s.length&&(this.dynamicDecorationMap[e++]=r,n.push(ft.join(s))),this.decorations=[this.editContextFormatting,...n,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];e<this.decorations.length;)this.dynamicDecorationMap[e++]=!1;this.blockWrappers=this.view.state.facet(eb).map(a=>typeof a=="function"?a(this.view):a)}scrollIntoView(e){if(e.isSnapshot){let h=this.view.viewState.lineBlockAt(e.range.head);this.view.scrollDOM.scrollTop=h.top-e.yMargin,this.view.scrollDOM.scrollLeft=e.xMargin;return}for(let h of this.view.state.facet(Qy))try{if(h(this.view,e.range,e))return!0}catch(g){Vi(this.view.state,g,"scroll handler")}let{range:n}=e,r=this.coordsAt(n.head,n.assoc||(n.head>n.anchor?-1:1)),s;if(!r)return;!n.empty&&(s=this.coordsAt(n.anchor,n.anchor>n.head?-1:1))&&(r={left:Math.min(r.left,s.left),top:Math.min(r.top,s.top),right:Math.max(r.right,s.right),bottom:Math.max(r.bottom,s.bottom)});let a=rb(this.view),c={left:r.left-a.left,top:r.top-a.top,right:r.right+a.right,bottom:r.bottom+a.bottom},{offsetWidth:d,offsetHeight:f}=this.view.scrollDOM;if(EC(this.view.scrollDOM,c,n.head<n.anchor?-1:1,e.x,e.y,Math.max(Math.min(e.xMargin,d),-d),Math.max(Math.min(e.yMargin,f),-f),this.view.textDirection==Rt.LTR),window.visualViewport&&window.innerHeight-window.visualViewport.height>1&&(r.top>window.visualViewport.offsetTop+window.visualViewport.height||r.bottom<window.visualViewport.offsetTop)){let h=this.view.docView.lineAt(n.head,1);if(h){let g=My(h.dom);h.dom.scrollIntoView({block:"nearest"}),Ry(g,!1)}}}lineHasWidget(e){let n=r=>r.isWidget()||r.children.some(n);return n(this.tile.resolveBlock(e,1).tile)}destroy(){Hf(this.tile)}}function Hf(t,e){let n=e?.get(t);if(n!=1){n==null&&t.destroy();for(let r of t.children)Hf(r,e)}}function tN(t){return t.node.nodeType==1&&t.node.firstChild&&(t.offset==0||t.node.childNodes[t.offset-1].contentEditable=="false")&&(t.offset==t.node.childNodes.length||t.node.childNodes[t.offset].contentEditable=="false")}function cb(t,e){let n=t.observer.selectionRange;if(!n.focusNode)return null;let r=By(n.focusNode,n.focusOffset),s=$y(n.focusNode,n.focusOffset),a=r||s;if(s&&r&&s.node!=r.node){let d=Lt.get(s.node);if(!d||d.isText()&&d.text!=s.node.nodeValue)a=s;else if(t.docView.lastCompositionAfterCursor){let f=Lt.get(r.node);!f||f.isText()&&f.text!=r.node.nodeValue||(a=s)}}if(t.docView.lastCompositionAfterCursor=a!=r,!a)return null;let c=e-a.offset;return{from:c,to:c+a.node.nodeValue.length,node:a.node}}function nN(t,e,n){let r=cb(t,n);if(!r)return null;let{node:s,from:a,to:c}=r,d=s.nodeValue;if(/[\n\r]/.test(d)||t.state.doc.sliceString(r.from,r.to)!=d)return null;let f=e.invertedDesc;return{range:new oi(f.mapPos(a),f.mapPos(c),a,c),text:s}}function iN(t,e){return t.nodeType!=1?0:(e&&t.childNodes[e-1].contentEditable=="false"?1:0)|(e<t.childNodes.length&&t.childNodes[e].contentEditable=="false"?2:0)}let rN=class{constructor(){this.changes=[]}compareRange(e,n){ol(e,n,this.changes)}comparePoint(e,n){ol(e,n,this.changes)}boundChange(e){ol(e,e,this.changes)}};function sN(t,e,n){let r=new rN;return ft.compare(t,e,n,r),r.changes}class lN{constructor(){this.changes=[]}compareRange(e,n){ol(e,n,this.changes)}comparePoint(){}boundChange(e){ol(e,e,this.changes)}}function aN(t,e,n){let r=new lN;return ft.compare(t,e,n,r),r.changes}function oN(t,e){for(let n=t;n&&n!=e;n=n.assignedSlot||n.parentNode)if(n.nodeType==1&&n.contentEditable=="false")return!0;return!1}function cN(t,e){let n=!1;return e&&t.iterChangedRanges((r,s)=>{r<e.to&&s>e.from&&(n=!0)}),n}class If extends Jo{constructor(e){super(),this.height=e}toDOM(){let e=document.createElement("div");return e.className="cm-gap",this.updateDOM(e),e}eq(e){return e.height==this.height}updateDOM(e){return e.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}function uN(t,e,n=1){let r=t.charCategorizer(e),s=t.doc.lineAt(e),a=e-s.from;if(s.length==0)return Ce.cursor(e);a==0?n=1:a==s.length&&(n=-1);let c=a,d=a;n<0?c=Sn(s.text,a,!1):d=Sn(s.text,a);let f=r(s.text.slice(c,d));for(;c>0;){let h=Sn(s.text,c,!1);if(r(s.text.slice(h,c))!=f)break;c=h}for(;d<s.length;){let h=Sn(s.text,d);if(r(s.text.slice(d,h))!=f)break;d=h}return Ce.undirectionalRange(c+s.from,d+s.from)}function dN(t,e,n,r,s){let a=Math.round((r-e.left)*t.defaultCharacterWidth);if(t.lineWrapping&&n.height>t.defaultLineHeight*1.5){let d=t.viewState.heightOracle.textHeight,f=Math.floor((s-n.top-(t.defaultLineHeight-d)*.5)/d);a+=f*t.viewState.heightOracle.lineLength}let c=t.state.sliceDoc(n.from,n.to);return n.from+vC(c,a,t.state.tabSize)}function Uf(t,e,n){let r=t.lineBlockAt(e);if(Array.isArray(r.type)){let s;for(let a of r.type){if(a.from>e)break;if(!(a.to<e)){if(a.from<e&&a.to>e)return a;(!s||a.type==dn.Text&&(s.type!=a.type||(n<0?a.from<e:a.to>e)))&&(s=a)}}return s||r}return r}function fN(t,e,n,r){let s=Uf(t,e.head,e.assoc||-1),a=!r||s.type!=dn.Text||!(t.lineWrapping||s.widgetLineBreaks)?null:t.coordsAtPos(e.assoc<0&&e.head>s.from?e.head-1:e.head);if(a){let c=t.dom.getBoundingClientRect(),d=t.textDirectionAt(s.from),f=t.posAtCoords({x:n==(d==Rt.LTR)?c.right-1:c.left+1,y:(a.top+a.bottom)/2});if(f!=null)return Ce.cursor(f,n?-1:1)}return Ce.cursor(n?s.to:s.from,n?-1:1)}function ub(t,e,n,r){let s=t.state.doc.lineAt(e.head),a=t.bidiSpans(s),c=t.textDirectionAt(s.from);for(let d=e,f=null;;){let h=HC(s,a,c,d,n),g=Uy;if(!h){if(s.number==(n?t.state.doc.lines:1))return d;g=`
|
|
56
|
+
`,s=t.state.doc.line(s.number+(n?1:-1)),a=t.bidiSpans(s),h=t.visualLineSide(s,!n)}if(f){if(!f(g))return d}else{if(!r)return h;f=r(g)}d=h}}function hN(t,e,n){let r=t.state.charCategorizer(e),s=r(n);return a=>{let c=r(a);return s==nr.Space&&(s=c),s==c}}function pN(t,e,n,r){let s=e.head,a=n?1:-1;if(s==(n?t.state.doc.length:0))return Ce.cursor(s,e.assoc);let c=e.goalColumn,d,f=t.contentDOM.getBoundingClientRect(),h=t.coordsAtPos(s,e.assoc||((e.empty?n:e.head==e.from)?1:-1)),g=t.documentTop;if(h)c==null&&(c=h.left-f.left),d=a<0?h.top:h.bottom;else{let A=t.viewState.lineBlockAt(s);c==null&&(c=Math.min(f.right-f.left,t.defaultCharacterWidth*(s-A.from))),d=(a<0?A.top:A.bottom)+g}let b=f.left+c,v=t.viewState.heightOracle.textHeight>>1,S=r??v;for(let A=0;;A+=v){let C=d+(S+A)*a,T=Vf(t,{x:b,y:C},!1,a);if(n?C>f.bottom:C<f.top)return Ce.cursor(T.pos,T.assoc);let D=t.coordsAtPos(T.pos,T.assoc),j=D?(D.top+D.bottom)/2:0;if(!D||(n?j>d:j<d))return Ce.cursor(T.pos,T.assoc,void 0,c)}}function ja(t,e,n){for(;;){let r=0;for(let s of t)s.between(e-1,e+1,(a,c,d)=>{if(e>a&&e<c){let f=r||n||(e-a<c-e?-1:1);e=f<0?a:c,r=f}});if(!r)return e}}function db(t,e){let n=null;for(let r=0;r<e.ranges.length;r++){let s=e.ranges[r],a=null;if(s.empty){let c=ja(t,s.from,0);c!=s.from&&(a=Ce.cursor(c,-1))}else{let c=ja(t,s.from,-1),d=ja(t,s.to,1);(c!=s.from||d!=s.to)&&(s.undirectional?a=Ce.undirectionalRange(s.from,s.to):a=Ce.range(s.from==s.anchor?c:d,s.from==s.head?c:d))}a&&(n||(n=e.ranges.slice()),n[r]=a)}return n?Ce.create(n,e.mainIndex):e}function Ff(t,e,n){let r=ja(t.state.facet(Na).map(s=>s(t)),n.from,e.head>n.from?-1:1);return r==n.from?n:Ce.cursor(r,r<n.from?1:-1)}class Pi{constructor(e,n){this.pos=e,this.assoc=n}}function Vf(t,e,n,r){let s=t.contentDOM.getBoundingClientRect(),a=s.top+t.viewState.paddingTop,{x:c,y:d}=e,f=d-a,h;for(;;){if(f<0)return new Pi(0,1);if(f>t.viewState.docHeight)return new Pi(t.state.doc.length,-1);if(h=t.elementAtHeight(f),r==null)break;if(h.type==dn.Text){if(r<0?h.to<t.viewport.from:h.from>t.viewport.to)break;let v=t.docView.coordsAt(r<0?h.from:h.to,r>0?-1:1);if(v&&(r<0?v.top<=f+a:v.bottom>=f+a))break}let b=t.viewState.heightOracle.textHeight/2;f=r>0?h.bottom+b:h.top-b}if(t.viewport.from>=h.to||t.viewport.to<=h.from){if(n)return null;if(h.type==dn.Text){let b=dN(t,s,h,c,d);return new Pi(b,b==h.from?1:-1)}}if(h.type!=dn.Text)return f<(h.top+h.bottom)/2?new Pi(h.from,1):new Pi(h.to,-1);let g=t.docView.lineAt(h.from,2);return(!g||g.length!=h.length)&&(g=t.docView.lineAt(h.from,-2)),new mN(t,c,d,t.textDirectionAt(h.from)).scanTile(g,h.from)}class mN{constructor(e,n,r,s){this.view=e,this.x=n,this.y=r,this.baseDir=s,this.line=null,this.spans=null}bidiSpansAt(e){return(!this.line||this.line.from>e||this.line.to<e)&&(this.line=this.view.state.doc.lineAt(e),this.spans=this.view.bidiSpans(this.line)),this}baseDirAt(e,n){let{line:r,spans:s}=this.bidiSpansAt(e);return s[Fi.find(s,e-r.from,-1,n)].level==this.baseDir}dirAt(e,n){let{line:r,spans:s}=this.bidiSpansAt(e);return s[Fi.find(s,e-r.from,-1,n)].dir}bidiIn(e,n){let{spans:r,line:s}=this.bidiSpansAt(e);return r.length>1||r.length&&(r[0].level!=this.baseDir||r[0].to+s.from<n)}scan(e,n,r=!1){let s=0,a=e.length-1,c=new Set,d=this.bidiIn(e[0],e[a]),f,h,g=-1,b=1e9,v;e:for(;s<a;){let A=a-s,C=s+a>>1;t:if(c.has(C)){for(let j=1;j<A;j++){let E=C+j;if(E>=a&&(E-=A),!c.has(E)){C=E;break t}}break e}c.add(C);let T=n(C),D=0;if(T)for(let j=0;j<T.length;j++){let E=T[j];if(!(E.width==0&&T.length>1))if(E.bottom<this.y)(!f||f.bottom<E.bottom)&&(f=E),D=1;else if(E.top>this.y)(!h||h.top>E.top)&&(h=E),D=-1;else{let O=E.left>this.x?this.x-E.left:E.right<this.x?this.x-E.right:0,R=Math.abs(O);R<b&&(g=C,b=R,v=E),O&&(D=O<0==(this.baseDir==Rt.LTR)?-1:1)}}D==-1&&(!d||this.baseDirAt(e[C],1))?a=C:D==1&&(!d||this.baseDirAt(e[C+1],-1))&&(s=C+1)}if(!v){if(!h&&!f)return{i:0,after:!1};let A=f&&(!h||this.y-f.bottom<h.top-this.y)?f:h;return this.y=(A.top+A.bottom)/2,this.scan(e,n,!0)}if(b&&!r){let{top:A,bottom:C}=v;if(f&&f.bottom>(A+A+C)/3)return this.y=f.bottom-1,this.scan(e,n,!0);if(h&&h.top<(A+C+C)/3)return this.y=h.top+1,this.scan(e,n,!0)}let S=(d?this.dirAt(e[g],1):this.baseDir)==Rt.LTR;return{i:g,after:this.x>(v.left+v.right)/2==S}}scanText(e,n){let r=[];for(let a=0;a<e.length;a=Sn(e.text,a))r.push(n+a);r.push(n+e.length);let s=this.scan(r,a=>{let c=r[a]-n,d=r[a+1]-n;return Ca(e.dom,c,d).getClientRects()});return s.after?new Pi(r[s.i+1],-1):new Pi(r[s.i],1)}scanTile(e,n){if(!e.length)return new Pi(n,1);if(e.children.length==1){let d=e.children[0];if(d.isText())return this.scanText(d,n);if(d.isComposite())return this.scanTile(d,n)}let r=[n];for(let d=0,f=n;d<e.children.length;d++)r.push(f+=e.children[d].length);let s=this.scan(r,d=>{let f=e.children[d];return f.flags&48?null:(f.dom.nodeType==1?f.dom:Ca(f.dom,0,f.length)).getClientRects()}),a=e.children[s.i],c=r[s.i];return a.isText()?this.scanText(a,c):a.isComposite()?this.scanTile(a,c):s.after?new Pi(r[s.i+1],-1):new Pi(c,1)}}const pl="";class gN{constructor(e,n){this.points=e,this.view=n,this.text="",this.lineSeparator=n.state.facet(vt.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=pl}readRange(e,n){if(!e)return this;let r=e.parentNode;for(let s=e;;){this.findPointBefore(r,s);let a=this.text.length;this.readNode(s);let c=Lt.get(s),d=s.nextSibling;if(d==n){c?.breakAfter&&!d&&r!=this.view.contentDOM&&this.lineBreak();break}let f=Lt.get(d);(c&&f?c.breakAfter:(c?c.breakAfter:Wo(s))||Wo(d)&&(s.nodeName!="BR"||c?.isWidget())&&this.text.length>a)&&!bN(d,n)&&this.lineBreak(),s=d}return this.findPointBefore(r,n),this}readTextNode(e){let n=e.nodeValue;for(let r of this.points)r.node==e&&(r.pos=this.text.length+Math.min(r.offset,n.length));for(let r=0,s=this.lineSeparator?null:/\r\n?|\n/g;;){let a=-1,c=1,d;if(this.lineSeparator?(a=n.indexOf(this.lineSeparator,r),c=this.lineSeparator.length):(d=s.exec(n))&&(a=d.index,c=d[0].length),this.append(n.slice(r,a<0?n.length:a)),a<0)break;if(this.lineBreak(),c>1)for(let f of this.points)f.node==e&&f.pos>this.text.length&&(f.pos-=c-1);r=a+c}}readNode(e){let n=Lt.get(e),r=n&&n.overrideDOMText;if(r!=null){this.findPointInside(e,r.length);for(let s=r.iter();!s.next().done;)s.lineBreak?this.lineBreak():this.append(s.value)}else e.nodeType==3?this.readTextNode(e):e.nodeName=="BR"?e.nextSibling&&this.lineBreak():e.nodeType==1&&this.readRange(e.firstChild,null)}findPointBefore(e,n){for(let r of this.points)r.node==e&&e.childNodes[r.offset]==n&&(r.pos=this.text.length)}findPointInside(e,n){for(let r of this.points)(e.nodeType==3?r.node==e:e.contains(r.node))&&(r.pos=this.text.length+(yN(e,r.node,r.offset)?n:0))}}function yN(t,e,n){for(;;){if(!e||n<ir(e))return!1;if(e==t)return!0;n=zr(e)+1,e=e.parentNode}}function bN(t,e){let n;for(;!(t==e||!t);t=t.nextSibling){let r=Lt.get(t);if(!r?.isWidget())return!1;r&&(n||(n=[])).push(r)}if(n)for(let r of n){let s=r.overrideDOMText;if(s?.length)return!1}return!0}class fb{constructor(e,n){this.node=e,this.offset=n,this.pos=-1}}class xN{constructor(e,n,r,s){this.typeOver=s,this.bounds=null,this.text="",this.domChanged=n>-1;let{impreciseHead:a,impreciseAnchor:c}=e.docView,d=e.state.selection;if(e.state.readOnly&&n>-1)this.newSel=null;else if(n>-1&&(this.bounds=hb(e.docView.tile,n,r,0))){let f=a||c?[]:wN(e),h=new gN(f,e);h.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=h.text,this.newSel=SN(f,this.bounds.from)}else{let f=e.observer.selectionRange,h=a&&a.node==f.focusNode&&a.offset==f.focusOffset||!Tf(e.contentDOM,f.focusNode)?d.main.head:e.docView.posFromDOM(f.focusNode,f.focusOffset),g=c&&c.node==f.anchorNode&&c.offset==f.anchorOffset||!Tf(e.contentDOM,f.anchorNode)?d.main.anchor:e.docView.posFromDOM(f.anchorNode,f.anchorOffset),b=e.viewport;if((Oe.ios||Oe.chrome)&&h!=g&&Math.min(h,g)<=d.main.from&&Math.max(h,g)>=d.main.to&&(b.from>0||b.to<e.state.doc.length)){let v=Math.min(h,g),S=Math.max(h,g),A=b.from-v,C=b.to-S;(A==0||A==1||v==0)&&(C==0||C==-1||S==e.state.doc.length)&&(h=0,g=e.state.doc.length)}if(e.inputState.composing>-1&&d.ranges.length>1)this.newSel=d.replaceRange(Ce.range(g,h));else if(e.lineWrapping&&g==h&&!(d.main.empty&&d.main.head==h)&&e.inputState.lastTouchTime>Date.now()-100){let v=e.coordsAtPos(h,-1),S=0;v&&(S=e.inputState.lastTouchY<=v.bottom?-1:1),this.newSel=Ce.create([Ce.cursor(h,S)])}else this.newSel=Ce.single(g,h)}}}function hb(t,e,n,r){if(t.isComposite()){let s=-1,a=-1,c=-1,d=-1;for(let f=0,h=r,g=r;f<t.children.length;f++){let b=t.children[f],v=h+b.length;if(h<e&&v>n)return hb(b,e,n,h);if(v>=e&&s==-1&&(s=f,a=h),h>n&&b.dom.parentNode==t.dom){c=f,d=g;break}g=v,h=v+b.breakAfter}return{from:a,to:d<0?r+t.length:d,startDOM:(s?t.children[s-1].dom.nextSibling:null)||t.dom.firstChild,endDOM:c<t.children.length&&c>=0?t.children[c].dom:null}}else return t.isText()?{from:r,to:r+t.length,startDOM:t.dom,endDOM:t.dom.nextSibling}:null}function pb(t,e){let n,{newSel:r}=e,{state:s}=t,a=s.selection.main,c=t.inputState.lastKeyTime>Date.now()-100?t.inputState.lastKeyCode:-1;if(e.bounds){let{from:d,to:f}=e.bounds,h=a.from,g=null;(c===8||Oe.android&&e.text.length<f-d)&&(h=a.to,g="end");let b=s.doc.sliceString(d,f,pl),v,S;!a.empty&&a.from>=d&&a.to<=f&&(e.typeOver||b!=e.text)&&b.slice(0,a.from-d)==e.text.slice(0,a.from-d)&&b.slice(a.to-d)==e.text.slice(v=e.text.length-(b.length-(a.to-d)))?n={from:a.from,to:a.to,insert:pt.of(e.text.slice(a.from-d,v).split(pl))}:(S=mb(b,e.text,h-d,g))&&(Oe.chrome&&c==13&&S.toB==S.from+2&&e.text.slice(S.from,S.toB)==pl+pl&&S.toB--,n={from:d+S.from,to:d+S.toA,insert:pt.of(e.text.slice(S.from,S.toB).split(pl))})}else r&&(!t.hasFocus&&s.facet(rr)||ac(r,a))&&(r=null);if(!n&&!r)return!1;if((Oe.mac||Oe.android)&&n&&n.from==n.to&&n.from==a.head-1&&/^\. ?$/.test(n.insert.toString())&&t.contentDOM.getAttribute("autocorrect")=="off"?(r&&n.insert.length==2&&(r=Ce.single(r.main.anchor-1,r.main.head-1)),n={from:n.from,to:n.to,insert:pt.of([n.insert.toString().replace("."," ")])}):s.doc.lineAt(a.from).to<a.to&&t.docView.lineHasWidget(a.to)&&t.inputState.insertingTextAt>Date.now()-50?n={from:a.from,to:a.to,insert:s.toText(t.inputState.insertingText)}:Oe.chrome&&n&&n.from==n.to&&n.from==a.head&&n.insert.toString()==`
|
|
57
|
+
`&&t.lineWrapping&&(r&&(r=Ce.single(r.main.anchor-1,r.main.head-1)),n={from:a.from,to:a.to,insert:pt.of([" "])}),n)return Pf(t,n,r,c);if(r&&!ac(r,a)){let d=!1,f="select";return t.inputState.lastSelectionTime>Date.now()-50&&(t.inputState.lastSelectionOrigin=="select"&&(d=!0),f=t.inputState.lastSelectionOrigin,f=="select.pointer"&&(r=db(s.facet(Na).map(h=>h(t)),r))),t.dispatch({selection:r,scrollIntoView:d,userEvent:f}),!0}else return!1}function Pf(t,e,n,r=-1){if(Oe.ios&&t.inputState.flushIOSKey(e))return!0;let s=t.state.selection.main;if(Oe.android&&(e.to==s.to&&(e.from==s.from||e.from==s.from-1&&t.state.sliceDoc(e.from,s.from)==" ")&&e.insert.length==1&&e.insert.lines==2&&cl(t.contentDOM,"Enter",13)||(e.from==s.from-1&&e.to==s.to&&e.insert.length==0||r==8&&e.insert.length<e.to-e.from&&e.to>s.head)&&cl(t.contentDOM,"Backspace",8)||e.from==s.from&&e.to==s.to+1&&e.insert.length==0&&cl(t.contentDOM,"Delete",46)))return!0;let a=e.insert.toString();t.inputState.composing>=0&&t.inputState.composing++;let c,d=()=>c||(c=vN(t,e,n));return t.state.facet(Yy).some(f=>f(t,e.from,e.to,a,d))||t.dispatch(d()),!0}function vN(t,e,n){let r,s=t.state,a=s.selection.main,c=-1;if(e.from==e.to&&e.from<a.from||e.from>a.to){let f=e.from<a.from?-1:1,h=f<0?a.from:a.to,g=ja(s.facet(Na).map(b=>b(t)),h,f);e.from==g&&(c=g)}if(c>-1)r={changes:e,selection:Ce.cursor(e.from+e.insert.length,-1)};else if(e.from>=a.from&&e.to<=a.to&&e.to-e.from>=(a.to-a.from)/3&&(!n||n.main.empty&&n.main.from==e.from+e.insert.length)&&t.inputState.composing<0){let f=a.from<e.from?s.sliceDoc(a.from,e.from):"",h=a.to>e.to?s.sliceDoc(e.to,a.to):"";r=s.replaceSelection(t.state.toText(f+e.insert.sliceString(0,void 0,t.state.lineBreak)+h))}else{let f=s.changes(e),h=n&&n.main.to<=f.newLength?n.main:void 0;if(s.selection.ranges.length>1&&(t.inputState.composing>=0||t.inputState.compositionPendingChange)&&e.to<=a.to+10&&e.to>=a.to-10){let g=t.state.sliceDoc(e.from,e.to),b,v=n&&cb(t,n.main.head);if(v){let A=e.insert.length-(e.to-e.from);b={from:v.from,to:v.to-A}}else b=t.state.doc.lineAt(a.head);let S=a.to-e.to;r=s.changeByRange(A=>{if(A.from==a.from&&A.to==a.to)return{changes:f,range:h||A.map(f)};let C=A.to-S,T=C-g.length;if(t.state.sliceDoc(T,C)!=g||C>=b.from&&T<=b.to)return{range:A};let D=s.changes({from:T,to:C,insert:e.insert}),j=A.to-a.to;return{changes:D,range:h?Ce.range(Math.max(0,h.anchor+j),Math.max(0,h.head+j)):A.map(D)}})}else r={changes:f,selection:h&&s.selection.replaceRange(h)}}let d="input.type";return(t.composing||t.inputState.compositionPendingChange&&t.inputState.compositionEndedAt>Date.now()-50)&&(t.inputState.compositionPendingChange=!1,d+=".compose",t.inputState.compositionFirstChange&&(d+=".start",t.inputState.compositionFirstChange=!1)),s.update(r,{userEvent:d,scrollIntoView:!0})}function mb(t,e,n,r){let s=Math.min(t.length,e.length),a=0;for(;a<s&&t.charCodeAt(a)==e.charCodeAt(a);)a++;if(a==s&&t.length==e.length)return null;let c=t.length,d=e.length;for(;c>0&&d>0&&t.charCodeAt(c-1)==e.charCodeAt(d-1);)c--,d--;if(r=="end"){let f=Math.max(0,a-Math.min(c,d));n-=c+f-a}if(c<a&&t.length<e.length){let f=n<=a&&n>=c?a-n:0;a-=f,d=a+(d-c),c=a}else if(d<a){let f=n<=a&&n>=d?a-n:0;a-=f,c=a+(c-d),d=a}return{from:a,toA:c,toB:d}}function wN(t){let e=[];if(t.root.activeElement!=t.contentDOM)return e;let{anchorNode:n,anchorOffset:r,focusNode:s,focusOffset:a}=t.observer.selectionRange;return n&&(e.push(new fb(n,r)),(s!=n||a!=r)&&e.push(new fb(s,a))),e}function SN(t,e){if(t.length==0)return null;let n=t[0].pos,r=t.length==2?t[1].pos:n;return n>-1&&r>-1?Ce.single(n+e,r+e):null}function ac(t,e){return e.head==t.main.head&&e.anchor==t.main.anchor}class AN{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.touchActive=!1,this.lastTouchTime=0,this.lastTouchX=0,this.lastTouchY=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.lastWheelEvent=0,this.pendingIOSKey=void 0,this.lastIOSMomentumScroll=0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.insertingText="",this.insertingTextAt=0,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,Oe.safari&&e.contentDOM.addEventListener("input",()=>null),Oe.gecko&&zN(e.contentDOM.ownerDocument)}handleEvent(e){!RN(this.view,e)||this.ignoreDuringComposition(e)||e.type=="keydown"&&this.keydown(e)||(this.view.updateState!=0?Promise.resolve().then(()=>this.runHandlers(e.type,e)):this.runHandlers(e.type,e))}runHandlers(e,n){let r=this.handlers[e];if(r){for(let s of r.observers)s(this.view,n);for(let s of r.handlers){if(n.defaultPrevented)break;if(s(this.view,n)){n.preventDefault();break}}}}ensureHandlers(e){let n=CN(e),r=this.handlers,s=this.view.contentDOM;for(let a in n)if(a!="scroll"){let c=!n[a].handlers.length,d=r[a];d&&c!=!d.handlers.length&&(s.removeEventListener(a,this.handleEvent),d=null),d||s.addEventListener(a,this.handleEvent,{passive:c})}for(let a in r)a!="scroll"&&!n[a]&&s.removeEventListener(a,this.handleEvent);this.handlers=n}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),e.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&e.keyCode!=27&&bb.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),Oe.android&&Oe.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;if(Oe.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&(yb.some(n=>n.keyCode==e.keyCode)&&!e.ctrlKey||NN.indexOf(e.key)>-1&&e.ctrlKey)){let n={ctrlKey:e.ctrlKey,altKey:e.altKey,metaKey:e.metaKey,shiftKey:e.shiftKey};return n.shiftKey&&Oe.ios&&!/^(off|none)$/.test(this.view.contentDOM.autocapitalize)&&kN(this.view.win)&&(n.shiftKey=!1),this.pendingIOSKey={key:e.key,keyCode:e.keyCode,mods:n},setTimeout(()=>this.flushIOSKey(),50),!0}return e.keyCode!=229&&this.view.observer.forceFlush(),!1}flushIOSKey(e){let n=this.pendingIOSKey;return!n||this.view.observer.pendingRecords().length||n.key=="Enter"&&e&&e.from<e.to&&/^\S+$/.test(e.insert.toString())?!1:(this.pendingIOSKey=void 0,cl(this.view.contentDOM,n.key,n.keyCode,n.mods))}ignoreDuringComposition(e){return!/^key/.test(e.type)||e.synthetic?!1:this.composing>0?!0:Oe.safari&&!Oe.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.view.observer.update(e),this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function kN(t){return t.visualViewport?t.visualViewport.height*t.visualViewport.scale/t.document.documentElement.clientHeight<.85:!1}function gb(t,e){return(n,r)=>{try{return e.call(t,r,n)}catch(s){Vi(n.state,s)}}}function CN(t){let e=Object.create(null);function n(r){return e[r]||(e[r]={observers:[],handlers:[]})}for(let r of t){let s=r.spec,a=s&&s.plugin.domEventHandlers,c=s&&s.plugin.domEventObservers;if(a)for(let d in a){let f=a[d];f&&n(d).handlers.push(gb(r.value,f))}if(c)for(let d in c){let f=c[d];f&&n(d).observers.push(gb(r.value,f))}}for(let r in Ei)n(r).handlers.push(Ei[r]);for(let r in En)n(r).observers.push(En[r]);return e}const yb=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],NN="dthko",bb=[16,17,18,20,91,92,224,225],oc=6;function cc(t){return Math.max(0,t)*.7+8}function TN(t,e){return Math.max(Math.abs(t.clientX-e.clientX),Math.abs(t.clientY-e.clientY))}class jN{constructor(e,n,r,s){this.view=e,this.startEvent=n,this.style=r,this.mustSelect=s,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=n,this.scrollParents=Oy(e.contentDOM),this.atoms=e.state.facet(Na).map(c=>c(e));let a=e.contentDOM.ownerDocument;a.addEventListener("mousemove",this.move=this.move.bind(this)),a.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=n.shiftKey,this.multiple=e.state.facet(vt.allowMultipleSelections)&&EN(e,n),this.dragging=MN(e,n)&&Cb(n)==1?null:!1}start(e){this.dragging===!1&&this.select(e)}move(e){if(e.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&TN(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let n=0,r=0,s=0,a=0,c=this.view.win.innerWidth,d=this.view.win.innerHeight;this.scrollParents.x&&({left:s,right:c}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:a,bottom:d}=this.scrollParents.y.getBoundingClientRect());let f=rb(this.view);e.clientX-f.left<=s+oc?n=-cc(s-e.clientX):e.clientX+f.right>=c-oc&&(n=cc(e.clientX-c)),e.clientY-f.top<=a+oc?r=-cc(a-e.clientY):e.clientY+f.bottom>=d-oc&&(r=cc(e.clientY-d)),this.setScrollSpeed(n,r)}up(e){this.dragging==null&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(e,n){this.scrollSpeed={x:e,y:n},e||n?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:e,y:n}=this.scrollSpeed;e&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=e,e=0),n&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=n,n=0),(e||n)&&this.view.win.scrollBy(e,n),this.dragging===!1&&this.select(this.lastEvent)}select(e){let{view:n}=this,r=db(this.atoms,this.style.get(e,this.extend,this.multiple));(this.mustSelect||!r.eq(n.state.selection,this.dragging===!1))&&this.view.dispatch({selection:r,userEvent:"select.pointer"}),this.mustSelect=!1}update(e){e.transactions.some(n=>n.isUserEvent("input.type"))?this.destroy():this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}}function EN(t,e){let n=t.state.facet(Fy);return n.length?n[0](e):Oe.mac?e.metaKey:e.ctrlKey}function ON(t,e){let n=t.state.facet(Vy);return n.length?n[0](e):Oe.mac?!e.altKey:!e.ctrlKey}function MN(t,e){let{main:n}=t.state.selection;if(n.empty)return!1;let r=Sa(t.root);if(!r||r.rangeCount==0)return!0;let s=r.getRangeAt(0).getClientRects();for(let a=0;a<s.length;a++){let c=s[a];if(c.left<=e.clientX&&c.right>=e.clientX&&c.top<=e.clientY&&c.bottom>=e.clientY)return!0}return!1}function RN(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target,r;n!=t.contentDOM;n=n.parentNode)if(!n||n.nodeType==11||(r=Lt.get(n))&&r.isWidget()&&!r.isHidden&&r.widget.ignoreEvent(e))return!1;return!0}const Ei=Object.create(null),En=Object.create(null),xb=Oe.ie&&Oe.ie_version<15||Oe.ios&&Oe.webkit_version<604;function DN(t){let e=t.dom.parentNode;if(!e)return;let n=e.appendChild(document.createElement("textarea"));n.style.cssText="position: fixed; left: -10000px; top: 10px",n.focus(),setTimeout(()=>{t.focus(),n.remove(),vb(t,n.value)},50)}function uc(t,e,n){for(let r of t.facet(e))n=r(n,t);return n}function vb(t,e){e=uc(t.state,Df,e);let{state:n}=t,r,s=1,a=n.toText(e),c=a.lines==n.selection.ranges.length;if(Kf!=null&&n.selection.ranges.every(f=>f.empty)&&Kf==a.toString()){let f=-1;r=n.changeByRange(h=>{let g=n.doc.lineAt(h.from);if(g.from==f)return{range:h};f=g.from;let b=n.toText((c?a.line(s++).text:e)+n.lineBreak);return{changes:{from:g.from,insert:b},range:Ce.cursor(h.from+b.length)}})}else c?r=n.changeByRange(f=>{let h=a.line(s++);return{changes:{from:f.from,to:f.to,insert:h.text},range:Ce.cursor(f.from+h.length)}}):r=n.replaceSelection(a);t.dispatch(r,{userEvent:"input.paste",scrollIntoView:!0})}En.scroll=t=>{let e=t.inputState;e.lastScrollTop=t.scrollDOM.scrollTop,e.lastScrollLeft=t.scrollDOM.scrollLeft,Oe.ios&&!e.touchActive&&(e.lastIOSMomentumScroll=Date.now())},En.wheel=En.mousewheel=t=>{t.inputState.lastWheelEvent=Date.now()},Ei.keydown=(t,e)=>(t.inputState.setSelectionOrigin("select"),e.keyCode==27&&t.inputState.tabFocusMode!=0&&(t.inputState.tabFocusMode=Date.now()+2e3),!1),En.touchstart=(t,e)=>{let n=t.inputState,r=e.targetTouches[0];n.touchActive=!0,n.lastTouchTime=Date.now(),r&&(n.lastTouchX=r.clientX,n.lastTouchY=r.clientY),n.setSelectionOrigin("select.pointer")},En.touchmove=t=>{t.inputState.setSelectionOrigin("select.pointer")},En.touchend=(t,e)=>{t.inputState.touchActive=!1},Ei.mousedown=(t,e)=>{if(t.observer.flush(),t.inputState.lastTouchTime>Date.now()-2e3)return!1;let n=null;for(let r of t.state.facet(Py))if(n=r(t,e),n)break;if(!n&&e.button==0&&(n=LN(t,e)),n){let r=!t.hasFocus;t.inputState.startMouseSelection(new jN(t,e,n,r)),r&&t.observer.ignore(()=>{Dy(t.contentDOM);let a=t.root.activeElement;a&&!a.contains(t.contentDOM)&&a.blur()});let s=t.inputState.mouseSelection;if(s)return s.start(e),s.dragging===!1}else t.inputState.setSelectionOrigin("select.pointer");return!1};function wb(t,e,n,r){if(r==1)return Ce.cursor(e,n);if(r==2)return uN(t.state,e,n);{let s=t.docView.lineAt(e,n),a=t.state.doc.lineAt(s?s.posAtEnd:e),c=s?s.posAtStart:a.from,d=s?s.posAtEnd:a.to;return d<t.state.doc.length&&d==a.to&&d++,Ce.undirectionalRange(c,d)}}const _N=Oe.ie&&Oe.ie_version<=11;let Sb=null,Ab=0,kb=0;function Cb(t){if(!_N)return t.detail;let e=Sb,n=kb;return Sb=t,kb=Date.now(),Ab=!e||n>Date.now()-400&&Math.abs(e.clientX-t.clientX)<2&&Math.abs(e.clientY-t.clientY)<2?(Ab+1)%3:1}function LN(t,e){let n=t.posAndSideAtCoords({x:e.clientX,y:e.clientY},!1),r=Cb(e),s=t.state.selection;return{update(a){a.docChanged&&(n.pos=a.changes.mapPos(n.pos),s=s.map(a.changes))},get(a,c,d){let f=t.posAndSideAtCoords({x:a.clientX,y:a.clientY},!1),h,g=wb(t,f.pos,f.assoc,r);if(n.pos!=f.pos&&!c){let b=wb(t,n.pos,n.assoc,r),v=Math.min(b.from,g.from),S=Math.max(b.to,g.to);g=v<g.from?Ce.range(v,S,g.assoc):Ce.range(S,v,g.assoc)}return c?s.replaceRange(s.main.extend(g.from,g.to,g.assoc)):d&&r==1&&s.ranges.length>1&&(h=BN(s,f.pos))?h:d?s.addRange(g):Ce.create([g])}}}function BN(t,e){for(let n=0;n<t.ranges.length;n++){let{from:r,to:s}=t.ranges[n];if(r<=e&&s>=e)return Ce.create(t.ranges.slice(0,n).concat(t.ranges.slice(n+1)),t.mainIndex==n?0:t.mainIndex-(t.mainIndex>n?1:0))}return null}Ei.dragstart=(t,e)=>{let{selection:{main:n}}=t.state;if(e.target.draggable){let s=t.docView.tile.nearest(e.target);if(s&&s.isWidget()){let a=s.posAtStart,c=a+s.length;(a>=n.to||c<=n.from)&&(n=Ce.undirectionalRange(a,c))}}let{inputState:r}=t;return r.mouseSelection&&(r.mouseSelection.dragging=!0),r.draggedContent=n,e.dataTransfer&&(e.dataTransfer.setData("Text",uc(t.state,_f,t.state.sliceDoc(n.from,n.to))),e.dataTransfer.effectAllowed="copyMove"),!1},Ei.dragend=t=>(t.inputState.draggedContent=null,!1);function Nb(t,e,n,r){if(n=uc(t.state,Df,n),!n)return;let s=t.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:a}=t.inputState,c=r&&a&&ON(t,e)?{from:a.from,to:a.to}:null,d={from:s,insert:n},f=t.state.changes(c?[c,d]:d);t.focus(),t.dispatch({changes:f,selection:{anchor:f.mapPos(s,-1),head:f.mapPos(s,1)},userEvent:c?"move.drop":"input.drop"}),t.inputState.draggedContent=null}Ei.drop=(t,e)=>{if(!e.dataTransfer)return!1;if(t.state.readOnly)return!0;let n=e.dataTransfer.files;if(n&&n.length){let r=Array(n.length),s=0,a=()=>{++s==n.length&&Nb(t,e,r.filter(c=>c!=null).join(t.state.lineBreak),!1)};for(let c=0;c<n.length;c++){let d=new FileReader;d.onerror=a,d.onload=()=>{/[\x00-\x08\x0e-\x1f]{2}/.test(d.result)||(r[c]=d.result),a()},d.readAsText(n[c])}return!0}else{let r=e.dataTransfer.getData("Text");if(r)return Nb(t,e,r,!0),!0}return!1},Ei.paste=(t,e)=>{if(t.state.readOnly)return!0;t.observer.flush();let n=xb?null:e.clipboardData;return n?(vb(t,n.getData("text/plain")||n.getData("text/uri-list")),!0):(DN(t),!1)};function $N(t,e){let n=t.dom.parentNode;if(!n)return;let r=n.appendChild(document.createElement("textarea"));r.style.cssText="position: fixed; left: -10000px; top: 10px",r.value=e,r.focus(),r.selectionEnd=e.length,r.selectionStart=0,setTimeout(()=>{r.remove(),t.focus()},50)}function qN(t){let e=[],n=[],r=!1;for(let s of t.selection.ranges)s.empty||(e.push(t.sliceDoc(s.from,s.to)),n.push(s));if(!e.length){let s=-1;for(let{from:a}of t.selection.ranges){let c=t.doc.lineAt(a);c.number>s&&(e.push(c.text),n.push({from:c.from,to:Math.min(t.doc.length,c.to+1)})),s=c.number}r=!0}return{text:uc(t,_f,e.join(t.lineBreak)),ranges:n,linewise:r}}let Kf=null;Ei.copy=Ei.cut=(t,e)=>{if(!Aa(t.contentDOM,t.observer.selectionRange))return!1;let{text:n,ranges:r,linewise:s}=qN(t.state);if(!n&&!s)return!1;Kf=s?n:null,e.type=="cut"&&!t.state.readOnly&&t.dispatch({changes:r,scrollIntoView:!0,userEvent:"delete.cut"});let a=xb?null:e.clipboardData;return a?(a.clearData(),a.setData("text/plain",n),!0):($N(t,n),!1)};const Tb=$r.define();function jb(t,e){let n=[];for(let r of t.facet(Gy)){let s=r(t,e);s&&n.push(s)}return n.length?t.update({effects:n,annotations:Tb.of(!0)}):null}function Eb(t){setTimeout(()=>{let e=t.hasFocus;if(e!=t.inputState.notifiedFocused){let n=jb(t.state,e);n?t.dispatch(n):t.update([])}},10)}En.focus=t=>{t.inputState.lastFocusTime=Date.now(),!t.scrollDOM.scrollTop&&(t.inputState.lastScrollTop||t.inputState.lastScrollLeft)&&(t.scrollDOM.scrollTop=t.inputState.lastScrollTop,t.scrollDOM.scrollLeft=t.inputState.lastScrollLeft),Eb(t)},En.blur=t=>{t.observer.clearSelectionRange(),Eb(t)},En.compositionstart=En.compositionupdate=t=>{t.observer.editContext||(t.inputState.compositionFirstChange==null&&(t.inputState.compositionFirstChange=!0),t.inputState.composing<0&&(t.inputState.composing=0))},En.compositionend=t=>{t.observer.editContext||(t.inputState.composing=-1,t.inputState.compositionEndedAt=Date.now(),t.inputState.compositionPendingKey=!0,t.inputState.compositionPendingChange=t.observer.pendingRecords().length>0,t.inputState.compositionFirstChange=null,Oe.chrome&&Oe.android?t.observer.flushSoon():t.inputState.compositionPendingChange?Promise.resolve().then(()=>t.observer.flush()):setTimeout(()=>{t.inputState.composing<0&&t.docView.hasComposition&&t.update([])},50))},En.contextmenu=t=>{t.inputState.lastContextMenu=Date.now()},Ei.beforeinput=(t,e)=>{var n,r;if((e.inputType=="insertText"||e.inputType=="insertCompositionText")&&(t.inputState.insertingText=e.data,t.inputState.insertingTextAt=Date.now()),e.inputType=="insertReplacementText"&&t.observer.editContext){let a=(n=e.dataTransfer)===null||n===void 0?void 0:n.getData("text/plain"),c=e.getTargetRanges();if(a&&c.length){let d=c[0],f=t.posAtDOM(d.startContainer,d.startOffset),h=t.posAtDOM(d.endContainer,d.endOffset);return Pf(t,{from:f,to:h,insert:t.state.toText(a)},null),!0}}let s;if(Oe.chrome&&Oe.android&&(s=yb.find(a=>a.inputType==e.inputType))&&(t.observer.delayAndroidKey(s.key,s.keyCode),s.key=="Backspace"||s.key=="Delete")){let a=((r=window.visualViewport)===null||r===void 0?void 0:r.height)||0;setTimeout(()=>{var c;(((c=window.visualViewport)===null||c===void 0?void 0:c.height)||0)>a+10&&t.hasFocus&&(t.contentDOM.blur(),t.focus())},100)}return Oe.ios&&e.inputType=="deleteContentForward"&&t.observer.flushSoon(),Oe.safari&&e.inputType=="insertText"&&t.inputState.composing>=0&&setTimeout(()=>En.compositionend(t,e),20),!1};const Ob=new Set;function zN(t){Ob.has(t)||(Ob.add(t),t.addEventListener("copy",()=>{}),t.addEventListener("cut",()=>{}))}const Mb=["pre-wrap","normal","pre-line","break-spaces"];let ml=!1;function Rb(){ml=!1}class HN{constructor(e){this.lineWrapping=e,this.doc=pt.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(e,n){let r=this.doc.lineAt(n).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(r+=Math.max(0,Math.ceil((n-e-r*this.lineLength*.5)/this.lineLength))),this.lineHeight*r}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/Math.max(1,this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return Mb.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let n=!1;for(let r=0;r<e.length;r++){let s=e[r];s<0?r++:this.heightSamples[Math.floor(s*10)]||(n=!0,this.heightSamples[Math.floor(s*10)]=!0)}return n}refresh(e,n,r,s,a,c){let d=Mb.indexOf(e)>-1,f=Math.abs(n-this.lineHeight)>.3||this.lineWrapping!=d;if(this.lineWrapping=d,this.lineHeight=n,this.charWidth=r,this.textHeight=s,this.lineLength=a,f){this.heightSamples={};for(let h=0;h<c.length;h++){let g=c[h];g<0?h++:this.heightSamples[Math.floor(g*10)]=!0}}return f}}class IN{constructor(e,n){this.from=e,this.heights=n,this.index=0}get more(){return this.index<this.heights.length}}class Oi{constructor(e,n,r,s,a){this.from=e,this.length=n,this.top=r,this.height=s,this._content=a}get type(){return typeof this._content=="number"?dn.Text:Array.isArray(this._content)?this._content:this._content.type}get to(){return this.from+this.length}get bottom(){return this.top+this.height}get widget(){return this._content instanceof js?this._content.widget:null}get widgetLineBreaks(){return typeof this._content=="number"?this._content:0}join(e){let n=(Array.isArray(this._content)?this._content:[this]).concat(Array.isArray(e._content)?e._content:[e]);return new Oi(this.from,this.length+e.length,this.top,this.height+e.height,n)}}var Et=(function(t){return t[t.ByPos=0]="ByPos",t[t.ByHeight=1]="ByHeight",t[t.ByPosNoHeight=2]="ByPosNoHeight",t})(Et||(Et={}));const dc=.001;class On{constructor(e,n,r=2){this.length=e,this.height=n,this.flags=r}get outdated(){return(this.flags&2)>0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e){this.height!=e&&(Math.abs(this.height-e)>dc&&(ml=!0),this.height=e)}replace(e,n,r){return On.of(r)}decomposeLeft(e,n){n.push(this)}decomposeRight(e,n){n.push(this)}applyChanges(e,n,r,s){let a=this,c=r.doc;for(let d=s.length-1;d>=0;d--){let{fromA:f,toA:h,fromB:g,toB:b}=s[d],v=a.lineAt(f,Et.ByPosNoHeight,r.setDoc(n),0,0),S=v.to>=h?v:a.lineAt(h,Et.ByPosNoHeight,r,0,0);for(b+=S.to-h,h=S.to;d>0&&v.from<=s[d-1].toA;)f=s[d-1].fromA,g=s[d-1].fromB,d--,f<v.from&&(v=a.lineAt(f,Et.ByPosNoHeight,r,0,0));g+=v.from-f,f=v.from;let A=Yf.build(r.setDoc(c),e,g,b);a=fc(a,a.replace(f,h,A))}return a.updateHeight(r,0)}static empty(){return new Gn(0,0,0)}static of(e){if(e.length==1)return e[0];let n=0,r=e.length,s=0,a=0;for(;;)if(n==r)if(s>a*2){let d=e[n-1];d.break?e.splice(--n,1,d.left,null,d.right):e.splice(--n,1,d.left,d.right),r+=1+d.break,s-=d.size}else if(a>s*2){let d=e[r];d.break?e.splice(r,1,d.left,null,d.right):e.splice(r,1,d.left,d.right),r+=2+d.break,a-=d.size}else break;else if(s<a){let d=e[n++];d&&(s+=d.size)}else{let d=e[--r];d&&(a+=d.size)}let c=0;return e[n-1]==null?(c=1,n--):e[n]==null&&(c=1,r++),new FN(On.of(e.slice(0,n)),c,On.of(e.slice(r)))}}function fc(t,e){return t==e?t:(t.constructor!=e.constructor&&(ml=!0),e)}On.prototype.size=1;const UN=nn.replace({});class Db extends On{constructor(e,n,r){super(e,n),this.deco=r,this.spaceAbove=0}mainBlock(e,n){return new Oi(n,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.deco||0)}blockAt(e,n,r,s){return this.spaceAbove&&e<r+this.spaceAbove?new Oi(s,0,r,this.spaceAbove,UN):this.mainBlock(r,s)}lineAt(e,n,r,s,a){let c=this.mainBlock(s,a);return this.spaceAbove?this.blockAt(0,r,s,a).join(c):c}forEachLine(e,n,r,s,a,c){e<=a+this.length&&n>=a&&c(this.lineAt(0,Et.ByPos,r,s,a))}setMeasuredHeight(e){let n=e.heights[e.index++];n<0?(this.spaceAbove=-n,n=e.heights[e.index++]):this.spaceAbove=0,this.setHeight(n)}updateHeight(e,n=0,r=!1,s){return s&&s.from<=n&&s.more&&this.setMeasuredHeight(s),this.outdated=!1,this}toString(){return`block(${this.length})`}}class Gn extends Db{constructor(e,n,r){super(e,n,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0,this.spaceAbove=r}mainBlock(e,n){return new Oi(n,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.breaks)}replace(e,n,r){let s=r[0];return r.length==1&&(s instanceof Gn||s instanceof fn&&s.flags&4)&&Math.abs(this.length-s.length)<10?(s instanceof fn?s=new Gn(s.length,this.height,this.spaceAbove):s.height=this.height,this.outdated||(s.outdated=!1),s):On.of(r)}updateHeight(e,n=0,r=!1,s){return s&&s.from<=n&&s.more?this.setMeasuredHeight(s):(r||this.outdated)&&(this.spaceAbove=0,this.setHeight(Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight)),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class fn extends On{constructor(e){super(e,0)}heightMetrics(e,n){let r=e.doc.lineAt(n).number,s=e.doc.lineAt(n+this.length).number,a=s-r+1,c,d=0;if(e.lineWrapping){let f=Math.min(this.height,e.lineHeight*a);c=f/a,this.length>a+1&&(d=(this.height-f)/(this.length-a-1))}else c=this.height/a;return{firstLine:r,lastLine:s,perLine:c,perChar:d}}blockAt(e,n,r,s){let{firstLine:a,lastLine:c,perLine:d,perChar:f}=this.heightMetrics(n,s);if(n.lineWrapping){let h=s+(e<n.lineHeight?0:Math.round(Math.max(0,Math.min(1,(e-r)/this.height))*this.length)),g=n.doc.lineAt(h),b=d+g.length*f,v=Math.max(r,e-b/2);return new Oi(g.from,g.length,v,b,0)}else{let h=Math.max(0,Math.min(c-a,Math.floor((e-r)/d))),{from:g,length:b}=n.doc.line(a+h);return new Oi(g,b,r+d*h,d,0)}}lineAt(e,n,r,s,a){if(n==Et.ByHeight)return this.blockAt(e,r,s,a);if(n==Et.ByPosNoHeight){let{from:S,to:A}=r.doc.lineAt(e);return new Oi(S,A-S,0,0,0)}let{firstLine:c,perLine:d,perChar:f}=this.heightMetrics(r,a),h=r.doc.lineAt(e),g=d+h.length*f,b=h.number-c,v=s+d*b+f*(h.from-a-b);return new Oi(h.from,h.length,Math.max(s,Math.min(v,s+this.height-g)),g,0)}forEachLine(e,n,r,s,a,c){e=Math.max(e,a),n=Math.min(n,a+this.length);let{firstLine:d,perLine:f,perChar:h}=this.heightMetrics(r,a);for(let g=e,b=s;g<=n;){let v=r.doc.lineAt(g);if(g==e){let A=v.number-d;b+=f*A+h*(e-a-A)}let S=f+h*v.length;c(new Oi(v.from,v.length,b,S,0)),b+=S,g=v.to+1}}replace(e,n,r){let s=this.length-n;if(s>0){let a=r[r.length-1];a instanceof fn?r[r.length-1]=new fn(a.length+s):r.push(null,new fn(s-1))}if(e>0){let a=r[0];a instanceof fn?r[0]=new fn(e+a.length):r.unshift(new fn(e-1),null)}return On.of(r)}decomposeLeft(e,n){n.push(new fn(e-1),null)}decomposeRight(e,n){n.push(null,new fn(this.length-e-1))}updateHeight(e,n=0,r=!1,s){let a=n+this.length;if(s&&s.from<=n+this.length&&s.more){let c=[],d=Math.max(n,s.from),f=-1;for(s.from>n&&c.push(new fn(s.from-n-1).updateHeight(e,n));d<=a&&s.more;){let g=e.doc.lineAt(d).length;c.length&&c.push(null);let b=s.heights[s.index++],v=0;b<0&&(v=-b,b=s.heights[s.index++]),f==-1?f=b:Math.abs(b-f)>=dc&&(f=-2);let S=new Gn(g,b,v);S.outdated=!1,c.push(S),d+=g+1}d<=a&&c.push(null,new fn(a-d).updateHeight(e,d));let h=On.of(c);return(f<0||Math.abs(h.height-this.height)>=dc||Math.abs(f-this.heightMetrics(e,n).perLine)>=dc)&&(ml=!0),fc(this,h)}else(r||this.outdated)&&(this.setHeight(e.heightForGap(n,n+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class FN extends On{constructor(e,n,r){super(e.length+n+r.length,e.height+r.height,n|(e.outdated||r.outdated?2:0)),this.left=e,this.right=r,this.size=e.size+r.size}get break(){return this.flags&1}blockAt(e,n,r,s){let a=r+this.left.height;return e<a?this.left.blockAt(e,n,r,s):this.right.blockAt(e,n,a,s+this.left.length+this.break)}lineAt(e,n,r,s,a){let c=s+this.left.height,d=a+this.left.length+this.break,f=n==Et.ByHeight?e<c:e<d,h=f?this.left.lineAt(e,n,r,s,a):this.right.lineAt(e,n,r,c,d);if(this.break||(f?h.to<d:h.from>d))return h;let g=n==Et.ByPosNoHeight?Et.ByPosNoHeight:Et.ByPos;return f?h.join(this.right.lineAt(d,g,r,c,d)):this.left.lineAt(d,g,r,s,a).join(h)}forEachLine(e,n,r,s,a,c){let d=s+this.left.height,f=a+this.left.length+this.break;if(this.break)e<f&&this.left.forEachLine(e,n,r,s,a,c),n>=f&&this.right.forEachLine(e,n,r,d,f,c);else{let h=this.lineAt(f,Et.ByPos,r,s,a);e<h.from&&this.left.forEachLine(e,h.from-1,r,s,a,c),h.to>=e&&h.from<=n&&c(h),n>h.to&&this.right.forEachLine(h.to+1,n,r,d,f,c)}}replace(e,n,r){let s=this.left.length+this.break;if(n<s)return this.balanced(this.left.replace(e,n,r),this.right);if(e>this.left.length)return this.balanced(this.left,this.right.replace(e-s,n-s,r));let a=[];e>0&&this.decomposeLeft(e,a);let c=a.length;for(let d of r)a.push(d);if(e>0&&_b(a,c-1),n<this.length){let d=a.length;this.decomposeRight(n,a),_b(a,d)}return On.of(a)}decomposeLeft(e,n){let r=this.left.length;if(e<=r)return this.left.decomposeLeft(e,n);n.push(this.left),this.break&&(r++,e>=r&&n.push(null)),e>r&&this.right.decomposeLeft(e-r,n)}decomposeRight(e,n){let r=this.left.length,s=r+this.break;if(e>=s)return this.right.decomposeRight(e-s,n);e<r&&this.left.decomposeRight(e,n),this.break&&e<s&&n.push(null),n.push(this.right)}balanced(e,n){return e.size>2*n.size||n.size>2*e.size?On.of(this.break?[e,null,n]:[e,n]):(this.left=fc(this.left,e),this.right=fc(this.right,n),this.setHeight(e.height+n.height),this.outdated=e.outdated||n.outdated,this.size=e.size+n.size,this.length=e.length+this.break+n.length,this)}updateHeight(e,n=0,r=!1,s){let{left:a,right:c}=this,d=n+a.length+this.break,f=null;return s&&s.from<=n+a.length&&s.more?f=a=a.updateHeight(e,n,r,s):a.updateHeight(e,n,r),s&&s.from<=d+c.length&&s.more?f=c=c.updateHeight(e,d,r,s):c.updateHeight(e,d,r),f?this.balanced(a,c):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function _b(t,e){let n,r;t[e]==null&&(n=t[e-1])instanceof fn&&(r=t[e+1])instanceof fn&&t.splice(e-1,3,new fn(n.length+1+r.length))}const VN=5;class Yf{constructor(e,n){this.pos=e,this.oracle=n,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,n){if(this.lineStart>-1){let r=Math.min(n,this.lineEnd),s=this.nodes[this.nodes.length-1];s instanceof Gn?s.length+=r-this.pos:(r>this.pos||!this.isCovered)&&this.nodes.push(new Gn(r-this.pos,-1,0)),this.writtenTo=r,n>r&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=n}point(e,n,r){if(e<n||r.heightRelevant){let s=r.widget?r.widget.estimatedHeight:0,a=r.widget?r.widget.lineBreaks:0;s<0&&(s=this.oracle.lineHeight);let c=n-e;r.block?this.addBlock(new Db(c,s,r)):(c||a||s>=VN)&&this.addLineDeco(s,a,c)}else n>e&&this.span(e,n);this.lineEnd>-1&&this.lineEnd<this.pos&&(this.lineEnd=this.oracle.doc.lineAt(this.pos).to)}enterLine(){if(this.lineStart>-1)return;let{from:e,to:n}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=n,this.writtenTo<e&&((this.writtenTo<e-1||this.nodes[this.nodes.length-1]==null)&&this.nodes.push(this.blankContent(this.writtenTo,e-1)),this.nodes.push(null)),this.pos>e&&this.nodes.push(new Gn(this.pos-e,-1,0)),this.writtenTo=this.pos}blankContent(e,n){let r=new fn(n-e);return this.oracle.doc.lineAt(e).to==n&&(r.flags|=4),r}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof Gn)return e;let n=new Gn(0,-1,0);return this.nodes.push(n),n}addBlock(e){this.enterLine();let n=e.deco;n&&n.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,n&&n.endSide>0&&(this.covering=e)}addLineDeco(e,n,r){let s=this.ensureLine();s.length+=r,s.collapsed+=r,s.widgetHeight=Math.max(s.widgetHeight,e),s.breaks+=n,this.writtenTo=this.pos=this.pos+r}finish(e){let n=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(n instanceof Gn)&&!this.isCovered?this.nodes.push(new Gn(0,-1,0)):(this.writtenTo<this.pos||n==null)&&this.nodes.push(this.blankContent(this.writtenTo,this.pos));let r=e;for(let s of this.nodes)s instanceof Gn&&s.updateHeight(this.oracle,r),r+=s?s.length:1;return this.nodes}static build(e,n,r,s){let a=new Yf(r,e);return ft.spans(n,r,s,a,0),a.finish(r)}}function PN(t,e,n){let r=new KN;return ft.compare(t,e,n,r,0),r.changes}class KN{constructor(){this.changes=[]}compareRange(){}comparePoint(e,n,r,s){(e<n||r&&r.heightRelevant||s&&s.heightRelevant)&&ol(e,n,this.changes,5)}}function YN(t,e){let n=t.getBoundingClientRect(),r=t.ownerDocument,s=r.defaultView||window,a=Math.max(0,n.left),c=Math.min(s.innerWidth,n.right),d=Math.max(0,n.top),f=Math.min(s.innerHeight,n.bottom);for(let h=t.parentNode;h&&h!=r.body;)if(h.nodeType==1){let g=h,b=window.getComputedStyle(g);if((g.scrollHeight>g.clientHeight||g.scrollWidth>g.clientWidth)&&b.overflow!="visible"){let v=g.getBoundingClientRect();a=Math.max(a,v.left),c=Math.min(c,v.right),d=Math.max(d,v.top),f=Math.min(h==t.parentNode?s.innerHeight:f,v.bottom)}h=b.position=="absolute"||b.position=="fixed"?g.offsetParent:g.parentNode}else if(h.nodeType==11)h=h.host;else break;return{left:a-n.left,right:Math.max(a,c)-n.left,top:d-(n.top+e),bottom:Math.max(d,f)-(n.top+e)}}function GN(t){let e=t.getBoundingClientRect(),n=t.ownerDocument.defaultView||window;return e.left<n.innerWidth&&e.right>0&&e.top<n.innerHeight&&e.bottom>0}function XN(t,e){let n=t.getBoundingClientRect();return{left:0,right:n.right-n.left,top:e,bottom:n.bottom-(n.top+e)}}class Gf{constructor(e,n,r,s){this.from=e,this.to=n,this.size=r,this.displaySize=s}static same(e,n){if(e.length!=n.length)return!1;for(let r=0;r<e.length;r++){let s=e[r],a=n[r];if(s.from!=a.from||s.to!=a.to||s.size!=a.size)return!1}return!0}draw(e,n){return nn.replace({widget:new JN(this.displaySize*(n?e.scaleY:e.scaleX),n)}).range(this.from,this.to)}}class JN extends Jo{constructor(e,n){super(),this.size=e,this.vertical=n}eq(e){return e.size==this.size&&e.vertical==this.vertical}toDOM(){let e=document.createElement("div");return this.vertical?e.style.height=this.size+"px":(e.style.width=this.size+"px",e.style.height="2px",e.style.display="inline-block"),e}get estimatedHeight(){return this.vertical?this.size:-1}}class Lb{constructor(e,n){this.view=e,this.state=n,this.pixelViewport={left:0,right:window.innerWidth,top:0,bottom:0},this.inView=!0,this.paddingTop=0,this.paddingBottom=0,this.contentDOMWidth=0,this.contentDOMHeight=0,this.editorHeight=0,this.editorWidth=0,this.scaleX=1,this.scaleY=1,this.scrollOffset=0,this.scrolledToBottom=!1,this.scrollAnchorPos=0,this.scrollAnchorHeight=-1,this.scaler=Bb,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=Rt.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let r=n.facet(Bf).some(s=>typeof s!="function"&&s.class=="cm-lineWrapping");this.heightOracle=new HN(r),this.stateDeco=$b(n),this.heightMap=On.empty().applyChanges(this.stateDeco,pt.empty,this.heightOracle.setDoc(n.doc),[new oi(0,0,0,n.doc.length)]);for(let s=0;s<2&&(this.viewport=this.getViewport(0,null),!!this.updateForViewport());s++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=nn.set(this.lineGaps.map(s=>s.draw(this,!1))),this.scrollParent=e.scrollDOM,this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:n}=this.state.selection;for(let r=0;r<=1;r++){let s=r?n.head:n.anchor;if(!e.some(({from:a,to:c})=>s>=a&&s<=c)){let{from:a,to:c}=this.lineBlockAt(s);e.push(new hc(a,c))}}return this.viewports=e.sort((r,s)=>r.from-s.from),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?Bb:new Xf(this.heightOracle,this.heightMap,this.viewports),e.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(Ea(e,this.scaler))})}update(e,n=null){this.state=e.state;let r=this.stateDeco;this.stateDeco=$b(this.state);let s=e.changedRanges,a=oi.extendWithRanges(s,PN(r,this.stateDeco,e?e.changes:Zt.empty(this.state.doc.length))),c=this.heightMap.height,d=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollOffset);Rb(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),a),(this.heightMap.height!=c||ml)&&(e.flags|=2),d?(this.scrollAnchorPos=e.changes.mapPos(d.from,-1),this.scrollAnchorHeight=d.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=c);let f=a.length?this.mapViewport(this.viewport,e.changes):this.viewport;(n&&(n.range.head<f.from||n.range.head>f.to)||!this.viewportIsAppropriate(f))&&(f=this.getViewport(0,n));let h=f.from!=this.viewport.from||f.to!=this.viewport.to;this.viewport=f,e.flags|=this.updateForViewport(),(h||!e.changes.empty||e.flags&2)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(e.changes),n&&(this.scrollTarget=n),!this.mustEnforceCursorAssoc&&(e.selectionSet||e.focusChanged)&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(Jy)&&(this.mustEnforceCursorAssoc=!0)}measure(){let{view:e}=this,n=e.contentDOM,r=window.getComputedStyle(n),s=this.heightOracle,a=r.whiteSpace;this.defaultTextDirection=r.direction=="rtl"?Rt.RTL:Rt.LTR;let c=this.heightOracle.mustRefreshForWrapping(a)||this.mustMeasureContent==="refresh",d=n.getBoundingClientRect(),f=c||this.mustMeasureContent||this.contentDOMHeight!=d.height;this.contentDOMHeight=d.height,this.mustMeasureContent=!1;let h=0,g=0;if(d.width&&d.height){let{scaleX:R,scaleY:B}=Ey(n,d);(R>.005&&Math.abs(this.scaleX-R)>.005||B>.005&&Math.abs(this.scaleY-B)>.005)&&(this.scaleX=R,this.scaleY=B,h|=16,c=f=!0)}let b=(parseInt(r.paddingTop)||0)*this.scaleY,v=(parseInt(r.paddingBottom)||0)*this.scaleY;(this.paddingTop!=b||this.paddingBottom!=v)&&(this.paddingTop=b,this.paddingBottom=v,h|=18),this.editorWidth!=e.scrollDOM.clientWidth&&(s.lineWrapping&&(f=!0),this.editorWidth=e.scrollDOM.clientWidth,h|=16);let S=Oy(this.view.contentDOM,!1).y;S!=this.scrollParent&&(this.scrollParent=S,this.scrollAnchorHeight=-1,this.scrollOffset=0);let A=this.getScrollOffset();this.scrollOffset!=A&&(this.scrollAnchorHeight=-1,this.scrollOffset=A),this.scrolledToBottom=Ly(this.scrollParent||e.win);let C=(this.printing?XN:YN)(n,this.paddingTop),T=C.top-this.pixelViewport.top,D=C.bottom-this.pixelViewport.bottom;this.pixelViewport=C;let j=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(j!=this.inView&&(this.inView=j,j&&(f=!0)),!this.inView&&!this.scrollTarget&&!GN(e.dom))return 0;let E=d.width;if((this.contentDOMWidth!=E||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=d.width,this.editorHeight=e.scrollDOM.clientHeight,h|=16),f){let R=e.docView.measureVisibleLineHeights(this.viewport);if(s.mustRefreshForHeights(R)&&(c=!0),c||s.lineWrapping&&Math.abs(E-this.contentDOMWidth)>s.charWidth){let{lineHeight:B,charWidth:M,textHeight:z}=e.docView.measureTextSize();c=B>0&&s.refresh(a,B,M,z,Math.max(5,E/M),R),c&&(e.docView.minWidth=0,h|=16)}T>0&&D>0?g=Math.max(T,D):T<0&&D<0&&(g=Math.min(T,D)),Rb();for(let B of this.viewports){let M=B.from==this.viewport.from?R:e.docView.measureVisibleLineHeights(B);this.heightMap=(c?On.empty().applyChanges(this.stateDeco,pt.empty,this.heightOracle,[new oi(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(s,0,c,new IN(B.from,M))}ml&&(h|=2)}let O=!this.viewportIsAppropriate(this.viewport,g)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return O&&(h&2&&(h|=this.updateScaler()),this.viewport=this.getViewport(g,this.scrollTarget),h|=this.updateForViewport()),(h&2||O)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(c?[]:this.lineGaps,e)),h|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),h}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,n){let r=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),s=this.heightMap,a=this.heightOracle,{visibleTop:c,visibleBottom:d}=this,f=new hc(s.lineAt(c-r*1e3,Et.ByHeight,a,0,0).from,s.lineAt(d+(1-r)*1e3,Et.ByHeight,a,0,0).to);if(n){let{head:h}=n.range;if(h<f.from||h>f.to){let g=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),b=s.lineAt(h,Et.ByPos,a,0,0),v;n.y=="center"?v=(b.top+b.bottom)/2-g/2:n.y=="start"||n.y=="nearest"&&h<f.from?v=b.top:v=b.bottom-g,f=new hc(s.lineAt(v-500,Et.ByHeight,a,0,0).from,s.lineAt(v+g+500,Et.ByHeight,a,0,0).to)}}return f}mapViewport(e,n){let r=n.mapPos(e.from,-1),s=n.mapPos(e.to,1);return new hc(this.heightMap.lineAt(r,Et.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(s,Et.ByPos,this.heightOracle,0,0).to)}viewportIsAppropriate({from:e,to:n},r=0){if(!this.inView)return!0;let{top:s}=this.heightMap.lineAt(e,Et.ByPos,this.heightOracle,0,0),{bottom:a}=this.heightMap.lineAt(n,Et.ByPos,this.heightOracle,0,0),{visibleTop:c,visibleBottom:d}=this;return(e==0||s<=c-Math.max(10,Math.min(-r,250)))&&(n==this.state.doc.length||a>=d+Math.max(10,Math.min(r,250)))&&s>c-2e3&&a<d+2e3}mapLineGaps(e,n){if(!e.length||n.empty)return e;let r=[];for(let s of e)n.touchesRange(s.from,s.to)||r.push(new Gf(n.mapPos(s.from),n.mapPos(s.to),s.size,s.displaySize));return r}ensureLineGaps(e,n){let r=this.heightOracle.lineWrapping,s=r?1e4:2e3,a=s>>1,c=s<<1;if(this.defaultTextDirection!=Rt.LTR&&!r)return[];let d=[],f=(g,b,v,S)=>{if(b-g<a)return;let A=this.state.selection.main,C=[A.from];A.empty||C.push(A.to);for(let D of C)if(D>g&&D<b){f(g,D-10,v,S),f(D+10,b,v,S);return}let T=WN(e,D=>D.from>=v.from&&D.to<=v.to&&Math.abs(D.from-g)<a&&Math.abs(D.to-b)<a&&!C.some(j=>D.from<j&&D.to>j));if(!T){if(b<v.to&&n&&r&&n.visibleRanges.some(E=>E.from<=b&&E.to>=b)){let E=n.moveToLineBoundary(Ce.cursor(b),!1,!0).head;E>g&&(b=E)}let D=this.gapSize(v,g,b,S),j=r||D<2e6?D:2e6;T=new Gf(g,b,D,j)}d.push(T)},h=g=>{if(g.length<c||g.type!=dn.Text)return;let b=QN(g.from,g.to,this.stateDeco);if(b.total<c)return;let v=this.scrollTarget?this.scrollTarget.range.head:null,S,A;if(r){let C=s/this.heightOracle.lineLength*this.heightOracle.lineHeight,T,D;if(v!=null){let j=mc(b,v),E=((this.visibleBottom-this.visibleTop)/2+C)/g.height;T=j-E,D=j+E}else T=(this.visibleTop-g.top-C)/g.height,D=(this.visibleBottom-g.top+C)/g.height;S=pc(b,T),A=pc(b,D)}else{let C=b.total*this.heightOracle.charWidth,T=s*this.heightOracle.charWidth,D=0;if(C>2e6)for(let B of e)B.from>=g.from&&B.from<g.to&&B.size!=B.displaySize&&B.from*this.heightOracle.charWidth+D<this.pixelViewport.left&&(D=B.size-B.displaySize);let j=this.pixelViewport.left+D,E=this.pixelViewport.right+D,O,R;if(v!=null){let B=mc(b,v),M=((E-j)/2+T)/C;O=B-M,R=B+M}else O=(j-T)/C,R=(E+T)/C;S=pc(b,O),A=pc(b,R)}S>g.from&&f(g.from,S,g,b),A<g.to&&f(A,g.to,g,b)};for(let g of this.viewportLines)Array.isArray(g.type)?g.type.forEach(h):h(g);return d}gapSize(e,n,r,s){let a=mc(s,r)-mc(s,n);return this.heightOracle.lineWrapping?e.height*a:s.total*this.heightOracle.charWidth*a}updateLineGaps(e){Gf.same(e,this.lineGaps)||(this.lineGaps=e,this.lineGapDeco=nn.set(e.map(n=>n.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(e){let n=this.stateDeco;this.lineGaps.length&&(n=n.concat(this.lineGapDeco));let r=[];ft.spans(n,this.viewport.from,this.viewport.to,{span(a,c){r.push({from:a,to:c})},point(){}},20);let s=0;if(r.length!=this.visibleRanges.length)s=12;else for(let a=0;a<r.length&&!(s&8);a++){let c=this.visibleRanges[a],d=r[a];(c.from!=d.from||c.to!=d.to)&&(s|=4,e&&e.mapPos(c.from,-1)==d.from&&e.mapPos(c.to,1)==d.to||(s|=8))}return this.visibleRanges=r,s}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(n=>n.from<=e&&n.to>=e)||Ea(this.heightMap.lineAt(e,Et.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return e>=this.viewportLines[0].top&&e<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(n=>n.top<=e&&n.bottom>=e)||Ea(this.heightMap.lineAt(this.scaler.fromDOM(e),Et.ByHeight,this.heightOracle,0,0),this.scaler)}getScrollOffset(){return this.scrollParent==this.view.scrollDOM?this.scrollParent.scrollTop*this.scaleY:(this.scrollParent?this.scrollParent.getBoundingClientRect().top:0)-this.view.contentDOM.getBoundingClientRect().top}scrollAnchorAt(e){let n=this.lineBlockAtHeight(e+8);return n.from>=this.viewport.from||this.viewportLines[0].top-e>200?n:this.viewportLines[0]}elementAtHeight(e){return Ea(this.heightMap.blockAt(this.scaler.fromDOM(e),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class hc{constructor(e,n){this.from=e,this.to=n}}function QN(t,e,n){let r=[],s=t,a=0;return ft.spans(n,t,e,{span(){},point(c,d){c>s&&(r.push({from:s,to:c}),a+=c-s),s=d}},20),s<e&&(r.push({from:s,to:e}),a+=e-s),{total:a,ranges:r}}function pc({total:t,ranges:e},n){if(n<=0)return e[0].from;if(n>=1)return e[e.length-1].to;let r=Math.floor(t*n);for(let s=0;;s++){let{from:a,to:c}=e[s],d=c-a;if(r<=d)return a+r;r-=d}}function mc(t,e){let n=0;for(let{from:r,to:s}of t.ranges){if(e<=s){n+=e-r;break}n+=s-r}return n/t.total}function WN(t,e){for(let n of t)if(e(n))return n}const Bb={toDOM(t){return t},fromDOM(t){return t},scale:1,eq(t){return t==this}};function $b(t){let e=t.facet(tc).filter(r=>typeof r!="function"),n=t.facet($f).filter(r=>typeof r!="function");return n.length&&e.push(ft.join(n)),e}class Xf{constructor(e,n,r){let s=0,a=0,c=0;this.viewports=r.map(({from:d,to:f})=>{let h=n.lineAt(d,Et.ByPos,e,0,0).top,g=n.lineAt(f,Et.ByPos,e,0,0).bottom;return s+=g-h,{from:d,to:f,top:h,bottom:g,domTop:0,domBottom:0}}),this.scale=(7e6-s)/(n.height-s);for(let d of this.viewports)d.domTop=c+(d.top-a)*this.scale,c=d.domBottom=d.domTop+(d.bottom-d.top),a=d.bottom}toDOM(e){for(let n=0,r=0,s=0;;n++){let a=n<this.viewports.length?this.viewports[n]:null;if(!a||e<a.top)return s+(e-r)*this.scale;if(e<=a.bottom)return a.domTop+(e-a.top);r=a.bottom,s=a.domBottom}}fromDOM(e){for(let n=0,r=0,s=0;;n++){let a=n<this.viewports.length?this.viewports[n]:null;if(!a||e<a.domTop)return r+(e-s)/this.scale;if(e<=a.domBottom)return a.top+(e-a.domTop);r=a.bottom,s=a.domBottom}}eq(e){return e instanceof Xf?this.scale==e.scale&&this.viewports.length==e.viewports.length&&this.viewports.every((n,r)=>n.from==e.viewports[r].from&&n.to==e.viewports[r].to):!1}}function Ea(t,e){if(e.scale==1)return t;let n=e.toDOM(t.top),r=e.toDOM(t.bottom);return new Oi(t.from,t.length,n,r-n,Array.isArray(t._content)?t._content.map(s=>Ea(s,e)):t._content)}const gc=He.define({combine:t=>t.join(" ")}),Jf=He.define({combine:t=>t.indexOf(!0)>-1}),Qf=al.newName(),qb=al.newName(),zb=al.newName(),Hb={"&light":"."+qb,"&dark":"."+zb};function Wf(t,e,n){return new al(e,{finish(r){return/&/.test(r)?r.replace(/&\w*/,s=>{if(s=="&")return t;if(!n||!n[s])throw new RangeError(`Unsupported selector: ${s}`);return n[s]}):t+" "+r}})}const ZN=Wf("."+Qf,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0,overflowAnchor:"none"},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{userSelect:"none",position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#ddd"},".cm-selectionHandle":{backgroundColor:"currentColor",width:"1.5px"},".cm-selectionHandle-start::before, .cm-selectionHandle-end::before":{content:'""',backgroundColor:"inherit",borderRadius:"50%",width:"8px",height:"8px",position:"absolute",left:"-3.25px"},".cm-selectionHandle-start::before":{top:"-8px"},".cm-selectionHandle-end::before":{bottom:"-8px"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",zIndex:200},".cm-gutters-before":{insetInlineStart:0},".cm-gutters-after":{insetInlineEnd:0},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",border:"0px solid #ddd","&.cm-gutters-before":{borderRightWidth:"1px"},"&.cm-gutters-after":{borderLeftWidth:"1px"}},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},".cm-panels-top":{top:"0"},".cm-panels-bottom":{bottom:"0"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-dialog":{padding:"2px 19px 4px 6px",position:"relative","& label":{fontSize:"80%"}},".cm-dialog-close":{position:"absolute",top:"3px",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",fontSize:"14px",padding:"0"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top",userSelect:"none"},".cm-highlightSpace":{background:"radial-gradient(circle at 50% 55%, #aaa 20%, transparent 0) no-repeat",backgroundSize:".4em",backgroundPosition:"calc(min(50%, 0px)) center"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="20"><path stroke="%23888" stroke-width="1" fill="none" d="M1 10H196L190 5M190 15L196 10M197 4L197 16"/></svg>')`,backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},Hb),eT={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},Zf=Oe.ie&&Oe.ie_version<=11;class tT{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new OC,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(n=>{for(let r of n)this.queue.push(r);(Oe.ie&&Oe.ie_version<=11||Oe.ios&&e.composing)&&n.some(r=>r.type=="childList"&&r.removedNodes.length||r.type=="characterData"&&r.oldValue.length>r.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&Oe.android&&e.constructor.EDIT_CONTEXT!==!1&&!(Oe.chrome&&Oe.chrome_version<126)&&(this.editContext=new iT(e),e.state.facet(rr)&&(e.contentDOM.editContext=this.editContext.editContext)),Zf&&(this.onCharData=n=>{this.queue.push({target:n.target,type:"characterData",oldValue:n.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia("print")),typeof ResizeObserver=="function"&&(this.resizeScroll=new ResizeObserver(()=>{var n;((n=this.view.docView)===null||n===void 0?void 0:n.lastUpdate)<Date.now()-75&&this.onResize()}),this.resizeScroll.observe(e.scrollDOM)),this.addWindowListeners(this.win=e.win),this.start(),typeof IntersectionObserver=="function"&&(this.intersection=new IntersectionObserver(n=>{this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),n.length>0&&n[n.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(n=>{n.length>0&&n[n.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runHandlers("scroll",e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(e){(e.type=="change"||!e.type)&&!e.matches||(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((n,r)=>n!=e[r]))){this.gapIntersection.disconnect();for(let n of e)this.gapIntersection.observe(n);this.gaps=e}}onSelectionChange(e){let n=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:r}=this,s=this.selectionRange;if(r.state.facet(rr)?r.root.activeElement!=this.dom:!Aa(this.dom,s))return;let a=s.anchorNode&&r.docView.tile.nearest(s.anchorNode);if(a&&a.isWidget()&&a.widget.ignoreEvent(e)){n||(this.selectionChanged=!1);return}(Oe.ie&&Oe.ie_version<=11||Oe.android&&Oe.chrome)&&!r.state.selection.main.empty&&s.focusNode&&ka(s.focusNode,s.focusOffset,s.anchorNode,s.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,n=Sa(e.root);if(!n)return!1;let r=Oe.safari&&e.root.nodeType==11&&e.root.activeElement==this.dom&&nT(this.view,n)||n;if(!r||this.selectionRange.eq(r))return!1;let s=Aa(this.dom,r);return s&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime<Date.now()-300&&RC(this.dom,r)?(this.view.inputState.lastFocusTime=0,e.docView.updateSelection(),!1):(this.selectionRange.setRange(r),s&&(this.selectionChanged=!0),!0)}setSelectionRange(e,n){this.selectionRange.set(e.node,e.offset,n.node,n.offset),this.selectionChanged=!1}clearSelectionRange(){this.selectionRange.set(null,0,null,0)}listenForScroll(){this.parentCheck=-1;let e=0,n=null;for(let r=this.dom;r;)if(r.nodeType==1)!n&&e<this.scrollTargets.length&&this.scrollTargets[e]==r?e++:n||(n=this.scrollTargets.slice(0,e)),n&&n.push(r),r=r.assignedSlot||r.parentNode;else if(r.nodeType==11)r=r.host;else break;if(e<this.scrollTargets.length&&!n&&(n=this.scrollTargets.slice(0,e)),n){for(let r of this.scrollTargets)r.removeEventListener("scroll",this.onScroll);for(let r of this.scrollTargets=n)r.addEventListener("scroll",this.onScroll)}}ignore(e){if(!this.active)return e();try{return this.stop(),e()}finally{this.start(),this.clear()}}start(){this.active||(this.observer.observe(this.dom,eT),Zf&&this.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.active=!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),Zf&&this.dom.removeEventListener("DOMCharacterDataModified",this.onCharData))}clear(){this.processRecords(),this.queue.length=0,this.selectionChanged=!1}delayAndroidKey(e,n){var r;if(!this.delayedAndroidKey){let s=()=>{let a=this.delayedAndroidKey;a&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=a.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&a.force&&cl(this.dom,a.key,a.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(s)}(!this.delayedAndroidKey||e=="Enter")&&(this.delayedAndroidKey={key:e,keyCode:n,force:this.lastChange<Date.now()-50||!!(!((r=this.delayedAndroidKey)===null||r===void 0)&&r.force)})}clearDelayedAndroidKey(){this.win.cancelAnimationFrame(this.flushingAndroidKey),this.delayedAndroidKey=null,this.flushingAndroidKey=-1}flushSoon(){this.delayedFlush<0&&(this.delayedFlush=this.view.win.requestAnimationFrame(()=>{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let n=-1,r=-1,s=!1;for(let a of e){let c=this.readMutation(a);c&&(c.typeOver&&(s=!0),n==-1?{from:n,to:r}=c:(n=Math.min(c.from,n),r=Math.max(c.to,r)))}return{from:n,to:r,typeOver:s}}readChange(){let{from:e,to:n,typeOver:r}=this.processRecords(),s=this.selectionChanged&&Aa(this.dom,this.selectionRange);if(e<0&&!s)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let a=new xN(this.view,e,n,r);return this.view.docView.domChanged={newSel:a.newSel?a.newSel.main:null},a}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let n=this.readChange();if(!n)return this.view.requestMeasure(),!1;let r=this.view.state,s=pb(this.view,n);return this.view.state==r&&(n.domChanged||n.newSel&&!ac(this.view.state.selection,n.newSel.main))&&this.view.update([]),s}readMutation(e){let n=this.view.docView.tile.nearest(e.target);if(!n||n.isWidget())return null;if(n.markDirty(e.type=="attributes"),e.type=="childList"){let r=Ib(n,e.previousSibling||e.target.previousSibling,-1),s=Ib(n,e.nextSibling||e.target.nextSibling,1);return{from:r?n.posAfter(r):n.posAtStart,to:s?n.posBefore(s):n.posAtEnd,typeOver:!1}}else return e.type=="characterData"?{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):e.addEventListener("beforeprint",this.onPrint),e.addEventListener("scroll",this.onScroll),e.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener("scroll",this.onScroll),e.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}update(e){this.editContext&&(this.editContext.update(e),e.startState.facet(rr)!=e.state.facet(rr)&&(e.view.contentDOM.editContext=e.state.facet(rr)?this.editContext.editContext:null))}destroy(){var e,n,r;this.stop(),(e=this.intersection)===null||e===void 0||e.disconnect(),(n=this.gapIntersection)===null||n===void 0||n.disconnect(),(r=this.resizeScroll)===null||r===void 0||r.disconnect();for(let s of this.scrollTargets)s.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}}function Ib(t,e,n){for(;e;){let r=Lt.get(e);if(r&&r.parent==t)return r;let s=e.parentNode;e=s!=t.dom?s:n>0?e.nextSibling:e.previousSibling}return null}function Ub(t,e){let n=e.startContainer,r=e.startOffset,s=e.endContainer,a=e.endOffset,c=t.docView.domAtPos(t.state.selection.main.anchor,1);return ka(c.node,c.offset,s,a)&&([n,r,s,a]=[s,a,n,r]),{anchorNode:n,anchorOffset:r,focusNode:s,focusOffset:a}}function nT(t,e){if(e.getComposedRanges){let s=e.getComposedRanges(t.root)[0];if(s)return Ub(t,s)}let n=null;function r(s){s.preventDefault(),s.stopImmediatePropagation(),n=s.getTargetRanges()[0]}return t.contentDOM.addEventListener("beforeinput",r,!0),t.dom.ownerDocument.execCommand("indent"),t.contentDOM.removeEventListener("beforeinput",r,!0),n?Ub(t,n):null}class iT{constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(e.state);let n=this.editContext=new window.EditContext({text:e.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,e.state.selection.main.anchor))),selectionEnd:this.toContextPos(e.state.selection.main.head)});this.handlers.textupdate=r=>{let s=e.state.selection.main,{anchor:a,head:c}=s,d=this.toEditorPos(r.updateRangeStart),f=this.toEditorPos(r.updateRangeEnd);e.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:r.updateRangeStart,editorBase:d,drifted:!1});let h=f-d>r.text.length;d==this.from&&a<this.from?d=a:f==this.to&&a>this.to&&(f=a);let g=mb(e.state.sliceDoc(d,f),r.text,(h?s.from:s.to)-d,h?"end":null);if(!g){let v=Ce.single(this.toEditorPos(r.selectionStart),this.toEditorPos(r.selectionEnd));ac(v,s)||e.dispatch({selection:v,userEvent:"select"});return}let b={from:g.from+d,to:g.toA+d,insert:pt.of(r.text.slice(g.from,g.toB).split(`
|
|
58
|
+
`))};if((Oe.mac||Oe.android)&&b.from==c-1&&/^\. ?$/.test(r.text)&&e.contentDOM.getAttribute("autocorrect")=="off"&&(b={from:d,to:f,insert:pt.of([r.text.replace("."," ")])}),this.pendingContextChange=b,!e.state.readOnly){let v=this.to-this.from+(b.to-b.from+b.insert.length);Pf(e,b,Ce.single(this.toEditorPos(r.selectionStart,v),this.toEditorPos(r.selectionEnd,v)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)),b.from<b.to&&!b.insert.length&&e.inputState.composing>=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(n.text.slice(Math.max(0,r.updateRangeStart-1),Math.min(n.text.length,r.updateRangeStart+1)))&&this.handlers.compositionend(r)},this.handlers.characterboundsupdate=r=>{let s=[],a=null;for(let c=this.toEditorPos(r.rangeStart),d=this.toEditorPos(r.rangeEnd);c<d;c++){let f=e.coordsForChar(c);a=f&&new DOMRect(f.left,f.top,f.right-f.left,f.bottom-f.top)||a||new DOMRect,s.push(a)}n.updateCharacterBounds(r.rangeStart,s)},this.handlers.textformatupdate=r=>{let s=[];for(let a of r.getTextFormats()){let c=a.underlineStyle,d=a.underlineThickness;if(!/none/i.test(c)&&!/none/i.test(d)){let f=this.toEditorPos(a.rangeStart),h=this.toEditorPos(a.rangeEnd);if(f<h){let g=`text-decoration: underline ${/^[a-z]/.test(c)?c+" ":c=="Dashed"?"dashed ":c=="Squiggle"?"wavy ":""}${/thin/i.test(d)?1:2}px`;s.push(nn.mark({attributes:{style:g}}).range(f,h))}}}e.dispatch({effects:Wy.of(nn.set(s))})},this.handlers.compositionstart=()=>{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(e.inputState.composing=-1,e.inputState.compositionFirstChange=null,this.composing){let{drifted:r}=this.composing;this.composing=null,r&&this.reset(e.state)}};for(let r in this.handlers)n.addEventListener(r,this.handlers[r]);this.measureReq={read:r=>{let s=Sa(r.root);s&&s.rangeCount&&this.editContext.updateSelectionBounds(s.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let n=0,r=!1,s=this.pendingContextChange;return e.changes.iterChanges((a,c,d,f,h)=>{if(r)return;let g=h.length-(c-a);if(s&&c>=s.to)if(s.from==a&&s.to==c&&s.insert.eq(h)){s=this.pendingContextChange=null,n+=g,this.to+=g;return}else s=null,this.revertPending(e.state);if(a+=n,c+=n,c<=this.from)this.from+=g,this.to+=g;else if(a<this.to){if(a<this.from||c>this.to||this.to-this.from+h.length>3e4){r=!0;return}this.editContext.updateText(this.toContextPos(a),this.toContextPos(c),h.toString()),this.to+=g}n+=g}),s&&!r&&this.revertPending(e.state),!r}update(e){let n=this.pendingContextChange,r=e.startState.selection.main;this.composing&&(this.composing.drifted||!e.changes.touchesRange(r.from,r.to)&&e.transactions.some(s=>!s.isUserEvent("input.type")&&s.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=e.changes.mapPos(this.composing.editorBase)):!this.applyEdits(e)||!this.rangeIsValid(e.state)?(this.pendingContextChange=null,this.reset(e.state)):(e.docChanged||e.selectionSet||n)&&this.setSelection(e.state),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:n}=e.selection.main;this.from=Math.max(0,n-1e4),this.to=Math.min(e.doc.length,n+1e4)}reset(e){this.resetRange(e),this.editContext.updateText(0,this.editContext.text.length,e.doc.sliceString(this.from,this.to)),this.setSelection(e)}revertPending(e){let n=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(n.from),this.toContextPos(n.from+n.insert.length),e.doc.sliceString(n.from,n.to))}setSelection(e){let{main:n}=e.selection,r=this.toContextPos(Math.max(this.from,Math.min(this.to,n.anchor))),s=this.toContextPos(n.head);(this.editContext.selectionStart!=r||this.editContext.selectionEnd!=s)&&this.editContext.updateSelection(r,s)}rangeIsValid(e){let{head:n}=e.selection.main;return!(this.from>0&&n-this.from<500||this.to<e.doc.length&&this.to-n<500||this.to-this.from>3e4)}toEditorPos(e,n=this.to-this.from){e=Math.min(e,n);let r=this.composing;return r&&r.drifted?r.editorBase+(e-r.contextBase):e+this.from}toContextPos(e){let n=this.composing;return n&&n.drifted?n.contextBase+(e-n.editorBase):e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}}class Ye{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return!!this.inputState&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){var n;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),e.parent&&e.parent.appendChild(this.dom);let{dispatch:r}=e;this.dispatchTransactions=e.dispatchTransactions||r&&(s=>s.forEach(a=>r(a,this)))||(s=>this.update(s)),this.dispatch=this.dispatch.bind(this),this._root=e.root||MC(e.parent)||document,this.viewState=new Lb(this,e.state||vt.create(e)),e.scrollTo&&e.scrollTo.is(ec)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(dl).map(s=>new Lf(s));for(let s of this.plugins)s.update(this);this.observer=new tT(this),this.inputState=new AN(this),this.inputState.ensureHandlers(this.plugins),this.docView=new ob(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),!((n=document.fonts)===null||n===void 0)&&n.ready&&document.fonts.ready.then(()=>{this.viewState.mustMeasureContent="refresh",this.requestMeasure()})}dispatch(...e){let n=e.length==1&&e[0]instanceof en?e:e.length==1&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(n,this)}update(e){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let n=!1,r=!1,s,a=this.state;for(let v of e){if(v.startState!=a)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");a=v.state}if(this.destroyed){this.viewState.state=a;return}let c=this.hasFocus,d=0,f=null;e.some(v=>v.annotation(Tb))?(this.inputState.notifiedFocused=c,d=1):c!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=c,f=jb(a,c),f||(d=1));let h=this.observer.delayedAndroidKey,g=null;if(h?(this.observer.clearDelayedAndroidKey(),g=this.observer.readChange(),(g&&!this.state.doc.eq(a.doc)||!this.state.selection.eq(a.selection))&&(g=null)):this.observer.clear(),a.facet(vt.phrases)!=this.state.facet(vt.phrases))return this.setState(a);s=nc.create(this,a,e),s.flags|=d;let b=this.viewState.scrollTarget;try{this.updateState=2;for(let v of e){if(b&&(b=b.map(v.changes)),v.scrollIntoView){let{main:S}=v.state.selection,{x:A,y:C}=this.state.facet(Ye.cursorScrollMargin);b=new ul(S.empty?S:Ce.cursor(S.head,S.head>S.anchor?-1:1),"nearest","nearest",C,A)}for(let S of v.effects)S.is(ec)&&(b=S.value.clip(this.state))}this.viewState.update(s,b),this.bidiCache=yc.update(this.bidiCache,s.changes),s.empty||(this.updatePlugins(s),this.inputState.update(s)),n=this.docView.update(s),this.state.facet(Ta)!=this.styleModules&&this.mountStyles(),r=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(n,e.some(v=>v.isUserEvent("select.pointer")))}finally{this.updateState=0}if(s.startState.facet(gc)!=s.state.facet(gc)&&(this.viewState.mustMeasureContent=!0),(n||r||b||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),n&&this.docViewUpdate(),!s.empty)for(let v of this.state.facet(Rf))try{v(s)}catch(S){Vi(this.state,S,"update listener")}(f||g)&&Promise.resolve().then(()=>{f&&this.state==f.startState&&this.dispatch(f),g&&!pb(this,g)&&h.force&&cl(this.contentDOM,h.key,h.keyCode)})}setState(e){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=e;return}this.updateState=2;let n=this.hasFocus;try{for(let r of this.plugins)r.destroy(this);this.viewState=new Lb(this,e),this.plugins=e.facet(dl).map(r=>new Lf(r)),this.pluginMap.clear();for(let r of this.plugins)r.update(this);this.docView.destroy(),this.docView=new ob(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}n&&this.focus(),this.requestMeasure()}updatePlugins(e){let n=e.startState.facet(dl),r=e.state.facet(dl);if(n!=r){let s=[];for(let a of r){let c=n.indexOf(a);if(c<0)s.push(new Lf(a));else{let d=this.plugins[c];d.mustUpdate=e,s.push(d)}}for(let a of this.plugins)a.mustUpdate!=e&&a.destroy(this);this.plugins=s,this.pluginMap.clear()}else for(let s of this.plugins)s.mustUpdate=e;for(let s=0;s<this.plugins.length;s++)this.plugins[s].update(this);n!=r&&this.inputState.ensureHandlers(this.plugins)}docViewUpdate(){for(let e of this.plugins){let n=e.value;if(n&&n.docViewUpdate)try{n.docViewUpdate(this)}catch(r){Vi(this.state,r,"doc view update listener")}}}measure(e=!0){if(this.destroyed)return;if(this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,e&&this.observer.forceFlush();let n=null,r=this.viewState.scrollParent,s=this.viewState.getScrollOffset(),{scrollAnchorPos:a,scrollAnchorHeight:c,scaleY:d}=this.viewState;Math.abs(s-this.viewState.scrollOffset)>1&&(c=-1),this.viewState.scrollAnchorHeight=-1;try{for(let f=0;;f++){if(c<0){if(Ly(r||this.win))a=-1,c=this.viewState.heightMap.height/this.viewState.scaleY;else{let A=this.viewState.scrollAnchorAt(s);a=A.from,c=A.top}d=this.viewState.scaleY}this.updateState=1;let h=this.viewState.measure();if(!h&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(f>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let g=[];h&4||([this.measureRequests,g]=[g,this.measureRequests]);let b=g.map(A=>{try{return A.read(this)}catch(C){return Vi(this.state,C),Fb}}),v=nc.create(this,this.state,[]),S=!1;v.flags|=h,n?n.flags|=h:n=v,this.updateState=2,v.empty||(this.updatePlugins(v),this.inputState.update(v),this.updateAttrs(),S=this.docView.update(v),S&&this.docViewUpdate());for(let A=0;A<g.length;A++)if(b[A]!=Fb)try{let C=g[A];C.write&&C.write(b[A],this)}catch(C){Vi(this.state,C)}if(S&&this.docView.updateSelection(!0),!v.viewportChanged&&this.measureRequests.length==0){if(this.viewState.editorHeight)if(this.viewState.scrollTarget){this.docView.scrollIntoView(this.viewState.scrollTarget),this.viewState.scrollTarget=null,c=-1;continue}else{let C=(a<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(a).top)/this.viewState.scaleY-c/d;if((C>1||C<-1)&&!(Oe.ios&&this.inputState.lastIOSMomentumScroll>Date.now()-100)&&(r==this.scrollDOM||this.hasFocus||Math.max(this.inputState.lastWheelEvent,this.inputState.lastTouchTime)>Date.now()-100)){s=s+C,r?a<0?r.scrollTop=r.scrollHeight:r.scrollTop+=C:this.win.scrollBy(0,C),c=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(n&&!n.empty)for(let f of this.state.facet(Rf))f(n)}get themeClasses(){return Qf+" "+(this.state.facet(Jf)?zb:qb)+" "+this.state.facet(gc)}updateAttrs(){let e=Vb(this,Zy,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),n={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(rr)?"true":"false",class:"cm-content",style:`${Oe.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(n["aria-readonly"]="true"),Vb(this,Bf,n);let r=this.observer.ignore(()=>{let s=Ny(this.contentDOM,this.contentAttrs,n),a=Ny(this.dom,this.editorAttrs,e);return s||a});return this.editorAttrs=e,this.contentAttrs=n,r}showAnnouncements(e){let n=!0;for(let r of e)for(let s of r.effects)if(s.is(Ye.announce)){n&&(this.announceDOM.textContent=""),n=!1;let a=this.announceDOM.appendChild(document.createElement("div"));a.textContent=s.value}}mountStyles(){this.styleModules=this.state.facet(Ta);let e=this.state.facet(Ye.cspNonce);al.mount(this.root,this.styleModules.concat(ZN).reverse(),e?{nonce:e}:void 0)}readMeasured(){if(this.updateState==2)throw new Error("Reading the editor layout isn't allowed during an update");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),e){if(this.measureRequests.indexOf(e)>-1)return;if(e.key!=null){for(let n=0;n<this.measureRequests.length;n++)if(this.measureRequests[n].key===e.key){this.measureRequests[n]=e;return}}this.measureRequests.push(e)}}plugin(e){let n=this.pluginMap.get(e);return(n===void 0||n&&n.plugin!=e)&&this.pluginMap.set(e,n=this.plugins.find(r=>r.plugin==e)||null),n&&n.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,n,r){return Ff(this,e,ub(this,e,n,r))}moveByGroup(e,n){return Ff(this,e,ub(this,e,n,r=>hN(this,e.head,r)))}visualLineSide(e,n){let r=this.bidiSpans(e),s=this.textDirectionAt(e.from),a=r[n?r.length-1:0];return Ce.cursor(a.side(n,s)+e.from,a.forward(!n,s)?1:-1)}moveToLineBoundary(e,n,r=!0){return fN(this,e,n,r)}moveVertically(e,n,r){return Ff(this,e,pN(this,e,n,r))}domAtPos(e,n=1){return this.docView.domAtPos(e,n)}posAtDOM(e,n=0){return this.docView.posFromDOM(e,n)}posAtCoords(e,n=!0){this.readMeasured();let r=Vf(this,e,n);return r&&r.pos}posAndSideAtCoords(e,n=!0){return this.readMeasured(),Vf(this,e,n)}coordsAtPos(e,n=1){this.readMeasured();let r=this.state.doc.lineAt(e),s=this.bidiSpans(r),a=s[Fi.find(s,e-r.from,-1,n)];return this.docView.coordsAt(e,n,a.dir==Rt.RTL)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(Xy)||e<this.viewport.from||e>this.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>rT)return Iy(e.length);let n=this.textDirectionAt(e.from),r;for(let a of this.bidiCache)if(a.from==e.from&&a.dir==n&&(a.fresh||Hy(a.isolates,r=nb(this,e))))return a.order;r||(r=nb(this,e));let s=zC(e.text,n,r);return this.bidiCache.push(new yc(e.from,e.to,n,r,!0,s)),s}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||Oe.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{Dy(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((e.nodeType==9?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,n={}){var r,s,a,c;return ec.of(new ul(typeof e=="number"?Ce.cursor(e):e,(r=n.y)!==null&&r!==void 0?r:"nearest",(s=n.x)!==null&&s!==void 0?s:"nearest",(a=n.yMargin)!==null&&a!==void 0?a:5,(c=n.xMargin)!==null&&c!==void 0?c:5))}scrollSnapshot(){let{scrollTop:e,scrollLeft:n}=this.scrollDOM,r=this.viewState.scrollAnchorAt(e);return ec.of(new ul(Ce.cursor(r.from),"start","start",r.top-e,n,!0))}setTabFocusMode(e){e==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof e=="boolean"?this.inputState.tabFocusMode=e?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+e)}static domEventHandlers(e){return sr.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return sr.define(()=>({}),{eventObservers:e})}static theme(e,n){let r=al.newName(),s=[gc.of(r),Ta.of(Wf(`.${r}`,e))];return n&&n.dark&&s.push(Jf.of(!0)),s}static baseTheme(e){return Uo.lowest(Ta.of(Wf("."+Qf,e,Hb)))}static findFromDOM(e){var n;let r=e.querySelector(".cm-content"),s=r&&Lt.get(r)||Lt.get(e);return((n=s?.root)===null||n===void 0?void 0:n.view)||null}}Ye.styleModule=Ta,Ye.inputHandler=Yy,Ye.clipboardInputFilter=Df,Ye.clipboardOutputFilter=_f,Ye.scrollHandler=Qy,Ye.focusChangeEffect=Gy,Ye.perLineTextDirection=Xy,Ye.exceptionSink=Ky,Ye.updateListener=Rf,Ye.editable=rr,Ye.mouseSelectionStyle=Py,Ye.dragMovesSelection=Vy,Ye.clickAddsSelectionRange=Fy,Ye.decorations=tc,Ye.blockWrappers=eb,Ye.outerDecorations=$f,Ye.atomicRanges=Na,Ye.bidiIsolatedRanges=tb,Ye.cursorScrollMargin=He.define({combine:t=>{let e=5,n=5;for(let r of t)typeof r=="number"?e=n=r:{x:e,y:n}=r;return{x:e,y:n}}}),Ye.scrollMargins=ib,Ye.darkTheme=Jf,Ye.cspNonce=He.define({combine:t=>t.length?t[0]:""}),Ye.contentAttributes=Bf,Ye.editorAttributes=Zy,Ye.lineWrapping=Ye.contentAttributes.of({class:"cm-lineWrapping"}),Ye.announce=zt.define();const rT=4096,Fb={};class yc{constructor(e,n,r,s,a,c){this.from=e,this.to=n,this.dir=r,this.isolates=s,this.fresh=a,this.order=c}static update(e,n){if(n.empty&&!e.some(a=>a.fresh))return e;let r=[],s=e.length?e[e.length-1].dir:Rt.LTR;for(let a=Math.max(0,e.length-10);a<e.length;a++){let c=e[a];c.dir==s&&!n.touchesRange(c.from,c.to)&&r.push(new yc(n.mapPos(c.from,1),n.mapPos(c.to,-1),c.dir,c.isolates,!1,c.order))}return r}}function Vb(t,e,n){for(let r=t.state.facet(e),s=r.length-1;s>=0;s--){let a=r[s],c=typeof a=="function"?a(t):a;c&&Cf(c,n)}return n}const sT=Oe.mac?"mac":Oe.windows?"win":Oe.linux?"linux":"key";function lT(t,e){const n=t.split(/-(?!$)/);let r=n[n.length-1];r=="Space"&&(r=" ");let s,a,c,d;for(let f=0;f<n.length-1;++f){const h=n[f];if(/^(cmd|meta|m)$/i.test(h))d=!0;else if(/^a(lt)?$/i.test(h))s=!0;else if(/^(c|ctrl|control)$/i.test(h))a=!0;else if(/^s(hift)?$/i.test(h))c=!0;else if(/^mod$/i.test(h))e=="mac"?d=!0:a=!0;else throw new Error("Unrecognized modifier name: "+h)}return s&&(r="Alt-"+r),a&&(r="Ctrl-"+r),d&&(r="Meta-"+r),c&&(r="Shift-"+r),r}function bc(t,e,n){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),n!==!1&&e.shiftKey&&(t="Shift-"+t),t}const aT=Uo.default(Ye.domEventHandlers({keydown(t,e){return dT(oT(e.state),t,e,"editor")}})),Pb=He.define({enables:aT}),Kb=new WeakMap;function oT(t){let e=t.facet(Pb),n=Kb.get(e);return n||Kb.set(e,n=uT(e.reduce((r,s)=>r.concat(s),[]))),n}let Hr=null;const cT=4e3;function uT(t,e=sT){let n=Object.create(null),r=Object.create(null),s=(c,d)=>{let f=r[c];if(f==null)r[c]=d;else if(f!=d)throw new Error("Key binding "+c+" is used both as a regular binding and as a multi-stroke prefix")},a=(c,d,f,h,g)=>{var b,v;let S=n[c]||(n[c]=Object.create(null)),A=d.split(/ (?!$)/).map(D=>lT(D,e));for(let D=1;D<A.length;D++){let j=A.slice(0,D).join(" ");s(j,!0),S[j]||(S[j]={preventDefault:!0,stopPropagation:!1,run:[E=>{let O=Hr={view:E,prefix:j,scope:c};return setTimeout(()=>{Hr==O&&(Hr=null)},cT),!0}]})}let C=A.join(" ");s(C,!1);let T=S[C]||(S[C]={preventDefault:!1,stopPropagation:!1,run:((v=(b=S._any)===null||b===void 0?void 0:b.run)===null||v===void 0?void 0:v.slice())||[]});f&&T.run.push(f),h&&(T.preventDefault=!0),g&&(T.stopPropagation=!0)};for(let c of t){let d=c.scope?c.scope.split(" "):["editor"];if(c.any)for(let h of d){let g=n[h]||(n[h]=Object.create(null));g._any||(g._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:b}=c;for(let v in g)g[v].run.push(S=>b(S,eh))}let f=c[e]||c.key;if(f)for(let h of d)a(h,f,c.run,c.preventDefault,c.stopPropagation),c.shift&&a(h,"Shift-"+f,c.shift,c.preventDefault,c.stopPropagation)}return n}let eh=null;function dT(t,e,n,r){eh=e;let s=kC(e),a=lC(s,0),c=aC(a)==s.length&&s!=" ",d="",f=!1,h=!1,g=!1;Hr&&Hr.view==n&&Hr.scope==r&&(d=Hr.prefix+" ",bb.indexOf(e.keyCode)<0&&(h=!0,Hr=null));let b=new Set,v=T=>{if(T){for(let D of T.run)if(!b.has(D)&&(b.add(D),D(n)))return T.stopPropagation&&(g=!0),!0;T.preventDefault&&(T.stopPropagation&&(g=!0),h=!0)}return!1},S=t[r],A,C;return S&&(v(S[d+bc(s,e,!c)])?f=!0:c&&(e.altKey||e.metaKey||e.ctrlKey)&&!(Oe.windows&&e.ctrlKey&&e.altKey)&&!(Oe.mac&&e.altKey&&!(e.ctrlKey||e.metaKey))&&(A=qr[e.keyCode])&&A!=s?(v(S[d+bc(A,e,!0)])||e.shiftKey&&(C=ba[e.keyCode])!=s&&C!=A&&v(S[d+bc(C,e,!1)]))&&(f=!0):c&&e.shiftKey&&v(S[d+bc(s,e,!0)])&&(f=!0),!f&&v(S._any)&&(f=!0)),h&&(f=!0),f&&g&&e.stopPropagation(),eh=null,f}class Ds{constructor(e,n,r,s,a){this.className=e,this.left=n,this.top=r,this.width=s,this.height=a}draw(){let e=document.createElement("div");return e.className=this.className,this.adjust(e),e}update(e,n){return n.className!=this.className?!1:(this.adjust(e),!0)}adjust(e){e.style.left=this.left+"px",e.style.top=this.top+"px",this.width!=null&&(e.style.width=this.width+"px"),e.style.height=this.height+"px"}eq(e){return this.left==e.left&&this.top==e.top&&this.width==e.width&&this.height==e.height&&this.className==e.className}static forRange(e,n,r){if(r.empty){let s=e.coordsAtPos(r.head,r.assoc||1);if(!s)return[];let a=Yb(e);return[new Ds(n,s.left-a.left,s.top-a.top,null,s.bottom-s.top)]}else return fT(e,n,r)}}function Yb(t){let e=t.scrollDOM.getBoundingClientRect();return{left:(t.textDirection==Rt.LTR?e.left:e.right-t.scrollDOM.clientWidth*t.scaleX)-t.scrollDOM.scrollLeft*t.scaleX,top:e.top-t.scrollDOM.scrollTop*t.scaleY}}function Gb(t,e,n,r){let s=t.coordsAtPos(e,n*2);if(!s)return r;let a=t.dom.getBoundingClientRect(),c=(s.top+s.bottom)/2,d=t.posAtCoords({x:a.left+1,y:c}),f=t.posAtCoords({x:a.right-1,y:c});return d==null||f==null?r:{from:Math.max(r.from,Math.min(d,f)),to:Math.min(r.to,Math.max(d,f))}}function fT(t,e,n){if(n.to<=t.viewport.from||n.from>=t.viewport.to)return[];let r=Math.max(n.from,t.viewport.from),s=Math.min(n.to,t.viewport.to),a=t.textDirection==Rt.LTR,c=t.contentDOM,d=c.getBoundingClientRect(),f=Yb(t),h=c.querySelector(".cm-line"),g=h&&window.getComputedStyle(h),b=d.left+(g?parseInt(g.paddingLeft)+Math.min(0,parseInt(g.textIndent)):0),v=d.right-(g?parseInt(g.paddingRight):0),S=Uf(t,r,1),A=Uf(t,s,-1),C=S.type==dn.Text?S:null,T=A.type==dn.Text?A:null;if(C&&(t.lineWrapping||S.widgetLineBreaks)&&(C=Gb(t,r,1,C)),T&&(t.lineWrapping||A.widgetLineBreaks)&&(T=Gb(t,s,-1,T)),C&&T&&C.from==T.from&&C.to==T.to)return j(E(n.from,n.to,C));{let R=C?E(n.from,null,C):O(S,!1),B=T?E(null,n.to,T):O(A,!0),M=[];return(C||S).to<(T||A).from-(C&&T?1:0)||S.widgetLineBreaks>1&&R.bottom+t.defaultLineHeight/2<B.top?M.push(D(b,R.bottom,v,B.top)):R.bottom<B.top&&t.elementAtHeight((R.bottom+B.top)/2).type==dn.Text&&(R.bottom=B.top=(R.bottom+B.top)/2),j(R).concat(M).concat(j(B))}function D(R,B,M,z){return new Ds(e,R-f.left,B-f.top,Math.max(0,M-R),z-B)}function j({top:R,bottom:B,horizontal:M}){let z=[];for(let F=0;F<M.length;F+=2)z.push(D(M[F],R,M[F+1],B));return z}function E(R,B,M){let z=1e9,F=-1e9,X=[];function W(ye,xe,_,ee,he){let $=t.coordsAtPos(ye,ye==M.to?-2:2),te=t.coordsAtPos(_,_==M.from?2:-2);!$||!te||(z=Math.min($.top,te.top,z),F=Math.max($.bottom,te.bottom,F),he==Rt.LTR?X.push(a&&xe?b:$.left,a&&ee?v:te.right):X.push(!a&&ee?b:te.left,!a&&xe?v:$.right))}let G=R??M.from,we=B??M.to;for(let ye of t.visibleRanges)if(ye.to>G&&ye.from<we)for(let xe=Math.max(ye.from,G),_=Math.min(ye.to,we);;){let ee=t.state.doc.lineAt(xe);for(let he of t.bidiSpans(ee)){let $=he.from+ee.from,te=he.to+ee.from;if($>=_)break;te>xe&&W(Math.max($,xe),R==null&&$<=G,Math.min(te,_),B==null&&te>=we,he.dir)}if(xe=ee.to+1,xe>=_)break}return X.length==0&&W(G,R==null,we,B==null,t.textDirection),{top:z,bottom:F,horizontal:X}}function O(R,B){let M=d.top+(B?R.top:R.bottom);return{top:M,bottom:M,horizontal:[]}}}function hT(t,e){return t.constructor==e.constructor&&t.eq(e)}class pT{constructor(e,n){this.view=e,this.layer=n,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=e.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),n.above&&this.dom.classList.add("cm-layer-above"),n.class&&this.dom.classList.add(n.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(e.state),e.requestMeasure(this.measureReq),n.mount&&n.mount(this.dom,e)}update(e){e.startState.facet(xc)!=e.state.facet(xc)&&this.setOrder(e.state),(this.layer.update(e,this.dom)||e.geometryChanged)&&(this.scale(),e.view.requestMeasure(this.measureReq))}docViewUpdate(e){this.layer.updateOnDocViewUpdate!==!1&&e.requestMeasure(this.measureReq)}setOrder(e){let n=0,r=e.facet(xc);for(;n<r.length&&r[n]!=this.layer;)n++;this.dom.style.zIndex=String((this.layer.above?150:-1)-n)}measure(){return this.layer.markers(this.view)}scale(){let{scaleX:e,scaleY:n}=this.view;(e!=this.scaleX||n!=this.scaleY)&&(this.scaleX=e,this.scaleY=n,this.dom.style.transform=`scale(${1/e}, ${1/n})`)}draw(e){if(e.length!=this.drawn.length||e.some((n,r)=>!hT(n,this.drawn[r]))){let n=this.dom.firstChild,r=0;for(let s of e)s.update&&n&&s.constructor&&this.drawn[r].constructor&&s.update(n,this.drawn[r])?(n=n.nextSibling,r++):this.dom.insertBefore(s.draw(),n);for(;n;){let s=n.nextSibling;n.remove(),n=s}this.drawn=e,Oe.webkit&&(this.dom.style.display=this.dom.firstChild?"":"none")}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const xc=He.define();function Xb(t){return[sr.define(e=>new pT(e,t)),xc.of(t)]}const gl=He.define({combine(t){return uf(t,{cursorBlinkRate:1200,drawRangeCursor:!0,iosSelectionHandles:!0},{cursorBlinkRate:(e,n)=>Math.min(e,n),drawRangeCursor:(e,n)=>e||n})}});function mT(t={}){return[gl.of(t),gT,yT,xT,Jy.of(!0)]}function Jb(t){return t.startState.facet(gl)!=t.state.facet(gl)}const gT=Xb({above:!0,markers(t){let{state:e}=t,n=e.facet(gl),r=[];for(let s of e.selection.ranges){let a=s==e.selection.main;if(s.empty||n.drawRangeCursor&&!(a&&Oe.ios&&n.iosSelectionHandles)){let c=a?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",d=s.empty?s:Ce.cursor(s.head,s.assoc);for(let f of Ds.forRange(t,c,d))r.push(f)}}return r},update(t,e){t.transactions.some(r=>r.selection)&&(e.style.animationName=e.style.animationName=="cm-blink"?"cm-blink2":"cm-blink");let n=Jb(t);return n&&Qb(t.state,e),t.docChanged||t.selectionSet||n},mount(t,e){Qb(e.state,t)},class:"cm-cursorLayer"});function Qb(t,e){e.style.animationDuration=t.facet(gl).cursorBlinkRate+"ms"}const yT=Xb({above:!1,markers(t){let e=[],{main:n,ranges:r}=t.state.selection;for(let s of r)if(!s.empty)for(let a of Ds.forRange(t,"cm-selectionBackground",s))e.push(a);if(Oe.ios&&!n.empty&&t.state.facet(gl).iosSelectionHandles){for(let s of Ds.forRange(t,"cm-selectionHandle cm-selectionHandle-start",Ce.cursor(n.from,1)))e.push(s);for(let s of Ds.forRange(t,"cm-selectionHandle cm-selectionHandle-end",Ce.cursor(n.to,1)))e.push(s)}return e},update(t,e){return t.docChanged||t.selectionSet||t.viewportChanged||Jb(t)},class:"cm-selectionLayer"}),bT=Oe.gecko&&Oe.gecko_version==153?"#ffffff01":"transparent",xT=Uo.highest(Ye.theme({".cm-line":{"& ::selection, &::selection":{backgroundColor:`${bT} !important`},caretColor:"transparent !important"},".cm-content":{caretColor:"transparent !important","& :focus":{caretColor:"initial !important","&::selection, & ::selection":{backgroundColor:"Highlight !important"}}}}));function Wb(){return wT}const vT=nn.line({class:"cm-activeLine"}),wT=sr.fromClass(class{constructor(t){this.decorations=this.getDeco(t)}update(t){(t.docChanged||t.selectionSet)&&(this.decorations=this.getDeco(t.view))}getDeco(t){let e=-1,n=[];for(let r of t.state.selection.ranges){let s=t.lineBlockAt(r.head);s.from>e&&(n.push(vT.range(s.from)),e=s.from)}return nn.set(n)}},{decorations:t=>t.decorations});class Ir extends Ts{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}Ir.prototype.elementClass="",Ir.prototype.toDOM=void 0,Ir.prototype.mapMode=Yn.TrackBefore,Ir.prototype.startSide=Ir.prototype.endSide=-1,Ir.prototype.point=!0;const vc=He.define(),ST=He.define(),wc=He.define(),Zb=He.define({combine:t=>t.some(e=>e)});function AT(t){return[kT]}const kT=sr.fromClass(class{constructor(t){this.view=t,this.domAfter=null,this.prevViewport=t.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters cm-gutters-before",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=t.state.facet(wc).map(e=>new tx(t,e)),this.fixed=!t.state.facet(Zb);for(let e of this.gutters)e.config.side=="after"?this.getDOMAfter().appendChild(e.dom):this.dom.appendChild(e.dom);this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),t.scrollDOM.insertBefore(this.dom,t.contentDOM)}getDOMAfter(){return this.domAfter||(this.domAfter=document.createElement("div"),this.domAfter.className="cm-gutters cm-gutters-after",this.domAfter.setAttribute("aria-hidden","true"),this.domAfter.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.domAfter.style.position=this.fixed?"sticky":"",this.view.scrollDOM.appendChild(this.domAfter)),this.domAfter}update(t){if(this.updateGutters(t)){let e=this.prevViewport,n=t.view.viewport,r=Math.min(e.to,n.to)-Math.max(e.from,n.from);this.syncGutters(r<(n.to-n.from)*.8)}if(t.geometryChanged){let e=this.view.contentHeight/this.view.scaleY+"px";this.dom.style.minHeight=e,this.domAfter&&(this.domAfter.style.minHeight=e)}this.view.state.facet(Zb)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":"",this.domAfter&&(this.domAfter.style.position=this.fixed?"sticky":"")),this.prevViewport=t.view.viewport}syncGutters(t){let e=this.dom.nextSibling;t&&(this.dom.remove(),this.domAfter&&this.domAfter.remove());let n=ft.iter(this.view.state.facet(vc),this.view.viewport.from),r=[],s=this.gutters.map(a=>new CT(a,this.view.viewport,-this.view.documentPadding.top));for(let a of this.view.viewportLineBlocks)if(r.length&&(r=[]),Array.isArray(a.type)){let c=!0;for(let d of a.type)if(d.type==dn.Text&&c){th(n,r,d.from);for(let f of s)f.line(this.view,d,r);c=!1}else if(d.widget)for(let f of s)f.widget(this.view,d)}else if(a.type==dn.Text){th(n,r,a.from);for(let c of s)c.line(this.view,a,r)}else if(a.widget)for(let c of s)c.widget(this.view,a);for(let a of s)a.finish();t&&(this.view.scrollDOM.insertBefore(this.dom,e),this.domAfter&&this.view.scrollDOM.appendChild(this.domAfter))}updateGutters(t){let e=t.startState.facet(wc),n=t.state.facet(wc),r=t.docChanged||t.heightChanged||t.viewportChanged||!ft.eq(t.startState.facet(vc),t.state.facet(vc),t.view.viewport.from,t.view.viewport.to);if(e==n)for(let s of this.gutters)s.update(t)&&(r=!0);else{r=!0;let s=[];for(let a of n){let c=e.indexOf(a);c<0?s.push(new tx(this.view,a)):(this.gutters[c].update(t),s.push(this.gutters[c]))}for(let a of this.gutters)a.dom.remove(),s.indexOf(a)<0&&a.destroy();for(let a of s)a.config.side=="after"?this.getDOMAfter().appendChild(a.dom):this.dom.appendChild(a.dom);this.gutters=s}return r}destroy(){for(let t of this.gutters)t.destroy();this.dom.remove(),this.domAfter&&this.domAfter.remove()}},{provide:t=>Ye.scrollMargins.of(e=>{let n=e.plugin(t);if(!n||n.gutters.length==0||!n.fixed)return null;let r=n.dom.offsetWidth*e.scaleX,s=n.domAfter?n.domAfter.offsetWidth*e.scaleX:0;return e.textDirection==Rt.LTR?{left:r,right:s}:{right:r,left:s}})});function ex(t){return Array.isArray(t)?t:[t]}function th(t,e,n){for(;t.value&&t.from<=n;)t.from==n&&e.push(t.value),t.next()}class CT{constructor(e,n,r){this.gutter=e,this.height=r,this.i=0,this.cursor=ft.iter(e.markers,n.from)}addElement(e,n,r){let{gutter:s}=this,a=(n.top-this.height)/e.scaleY,c=n.height/e.scaleY;if(this.i==s.elements.length){let d=new nx(e,c,a,r);s.elements.push(d),s.dom.appendChild(d.dom)}else s.elements[this.i].update(e,c,a,r);this.height=n.bottom,this.i++}line(e,n,r){let s=[];th(this.cursor,s,n.from),r.length&&(s=s.concat(r));let a=this.gutter.config.lineMarker(e,n,s);a&&s.unshift(a);let c=this.gutter;s.length==0&&!c.config.renderEmptyElements||this.addElement(e,n,s)}widget(e,n){let r=this.gutter.config.widgetMarker(e,n.widget,n),s=r?[r]:null;for(let a of e.state.facet(ST)){let c=a(e,n.widget,n);c&&(s||(s=[])).push(c)}s&&this.addElement(e,n,s)}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let n=e.elements.pop();e.dom.removeChild(n.dom),n.destroy()}}}class tx{constructor(e,n){this.view=e,this.config=n,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let r in n.domEventHandlers)this.dom.addEventListener(r,s=>{let a=s.target,c;if(a!=this.dom&&this.dom.contains(a)){for(;a.parentNode!=this.dom;)a=a.parentNode;let f=a.getBoundingClientRect();c=(f.top+f.bottom)/2}else c=s.clientY;let d=e.lineBlockAtHeight(c-e.documentTop);n.domEventHandlers[r](e,d,s)&&s.preventDefault()});this.markers=ex(n.markers(e)),n.initialSpacer&&(this.spacer=new nx(e,0,0,[n.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(e){let n=this.markers;if(this.markers=ex(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let s=this.config.updateSpacer(this.spacer.markers[0],e);s!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[s])}let r=e.view.viewport;return!ft.eq(this.markers,n,r.from,r.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(e):!1)}destroy(){for(let e of this.elements)e.destroy()}}class nx{constructor(e,n,r,s){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,n,r,s)}update(e,n,r,s){this.height!=n&&(this.height=n,this.dom.style.height=n+"px"),this.above!=r&&(this.dom.style.marginTop=(this.above=r)?r+"px":""),NT(this.markers,s)||this.setMarkers(e,s)}setMarkers(e,n){let r="cm-gutterElement",s=this.dom.firstChild;for(let a=0,c=0;;){let d=c,f=a<n.length?n[a++]:null,h=!1;if(f){let g=f.elementClass;g&&(r+=" "+g);for(let b=c;b<this.markers.length;b++)if(this.markers[b].compare(f)){d=b,h=!0;break}}else d=this.markers.length;for(;c<d;){let g=this.markers[c++];if(g.toDOM){g.destroy(s);let b=s.nextSibling;s.remove(),s=b}}if(!f)break;f.toDOM&&(h?s=s.nextSibling:this.dom.insertBefore(f.toDOM(e),s)),h&&c++}this.dom.className=r,this.markers=n}destroy(){this.setMarkers(null,[])}}function NT(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!t[n].compare(e[n]))return!1;return!0}const TT=He.define(),jT=He.define(),yl=He.define({combine(t){return uf(t,{formatNumber:String,domEventHandlers:{}},{domEventHandlers(e,n){let r=Object.assign({},e);for(let s in n){let a=r[s],c=n[s];r[s]=a?(d,f,h)=>a(d,f,h)||c(d,f,h):c}return r}})}});class nh extends Ir{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function ih(t,e){return t.state.facet(yl).formatNumber(e,t.state)}const ET=wc.compute([yl],t=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(e){return e.state.facet(TT)},lineMarker(e,n,r){return r.some(s=>s.toDOM)?null:new nh(ih(e,e.state.doc.lineAt(n.from).number))},widgetMarker:(e,n,r)=>{for(let s of e.state.facet(jT)){let a=s(e,n,r);if(a)return a}return null},lineMarkerChange:e=>e.startState.facet(yl)!=e.state.facet(yl),initialSpacer(e){return new nh(ih(e,rx(e.state.doc.lines)))},updateSpacer(e,n){let r=ih(n.view,rx(n.view.state.doc.lines));return r==e.number?e:new nh(r)},domEventHandlers:t.facet(yl).domEventHandlers,side:"before"}));function ix(t={}){return[yl.of(t),AT(),ET]}function rx(t){let e=9;for(;e<t;)e=e*10+9;return e}const OT=new class extends Ir{constructor(){super(...arguments),this.elementClass="cm-activeLineGutter"}},MT=vc.compute(["selection"],t=>{let e=[],n=-1;for(let r of t.selection.ranges){let s=t.doc.lineAt(r.head).from;s>n&&(n=s,e.push(OT.range(s)))}return ft.of(e)});function sx(){return MT}const RT=1024;let DT=0;class rh{constructor(e,n){this.from=e,this.to=n}}class mt{constructor(e={}){this.id=DT++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")}),this.combine=e.combine||null}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=ci.match(e)),n=>{let r=e(n);return r===void 0?null:[this,r]}}}mt.closedBy=new mt({deserialize:t=>t.split(" ")}),mt.openedBy=new mt({deserialize:t=>t.split(" ")}),mt.group=new mt({deserialize:t=>t.split(" ")}),mt.isolate=new mt({deserialize:t=>{if(t&&t!="rtl"&&t!="ltr"&&t!="auto")throw new RangeError("Invalid value for isolate: "+t);return t||"auto"}}),mt.contextHash=new mt({perNode:!0}),mt.lookAhead=new mt({perNode:!0}),mt.mounted=new mt({perNode:!0});class Oa{constructor(e,n,r,s=!1){this.tree=e,this.overlay=n,this.parser=r,this.bracketed=s}static get(e){return e&&e.props&&e.props[mt.mounted.id]}}const _T=Object.create(null);class ci{constructor(e,n,r,s=0){this.name=e,this.props=n,this.id=r,this.flags=s}static define(e){let n=e.props&&e.props.length?Object.create(null):_T,r=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),s=new ci(e.name||"",n,e.id,r);if(e.props){for(let a of e.props)if(Array.isArray(a)||(a=a(s)),a){if(a[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");n[a[0].id]=a[1]}}return s}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e=="string"){if(this.name==e)return!0;let n=this.prop(mt.group);return n?n.indexOf(e)>-1:!1}return this.id==e}static match(e){let n=Object.create(null);for(let r in e)for(let s of r.split(" "))n[s]=e[r];return r=>{for(let s=r.prop(mt.group),a=-1;a<(s?s.length:0);a++){let c=n[a<0?r.name:s[a]];if(c)return c}}}}ci.none=new ci("",Object.create(null),0,8);const Sc=new WeakMap,lx=new WeakMap;var Ht;(function(t){t[t.ExcludeBuffers=1]="ExcludeBuffers",t[t.IncludeAnonymous=2]="IncludeAnonymous",t[t.IgnoreMounts=4]="IgnoreMounts",t[t.IgnoreOverlays=8]="IgnoreOverlays",t[t.EnterBracketed=16]="EnterBracketed"})(Ht||(Ht={}));class hn{constructor(e,n,r,s,a){if(this.type=e,this.children=n,this.positions=r,this.length=s,this.props=null,a&&a.length){this.props=Object.create(null);for(let[c,d]of a)this.props[typeof c=="number"?c:c.id]=d}}toString(){let e=Oa.get(this);if(e&&!e.overlay)return e.tree.toString();let n="";for(let r of this.children){let s=r.toString();s&&(n&&(n+=","),n+=s)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(n.length?"("+n+")":""):n}cursor(e=0){return new ah(this.topNode,e)}cursorAt(e,n=0,r=0){let s=Sc.get(this)||this.topNode,a=new ah(s);return a.moveTo(e,n),Sc.set(this,a._tree),a}get topNode(){return new ui(this,0,0,null)}resolve(e,n=0){let r=Ma(Sc.get(this)||this.topNode,e,n,!1);return Sc.set(this,r),r}resolveInner(e,n=0){let r=Ma(lx.get(this)||this.topNode,e,n,!0);return lx.set(this,r),r}resolveStack(e,n=0){return $T(this,e,n)}iterate(e){let{enter:n,leave:r,from:s=0,to:a=this.length}=e,c=e.mode||0,d=(c&Ht.IncludeAnonymous)>0;for(let f=this.cursor(c|Ht.IncludeAnonymous);;){let h=!1;if(f.from<=a&&f.to>=s&&(!d&&f.type.isAnonymous||n(f)!==!1)){if(f.firstChild())continue;h=!0}for(;h&&r&&(d||!f.type.isAnonymous)&&r(f),!f.nextSibling();){if(!f.parent())return;h=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let n in this.props)e.push([+n,this.props[n]]);return e}balance(e={}){return this.children.length<=8?this:ch(ci.none,this.children,this.positions,0,this.children.length,0,this.length,(n,r,s)=>new hn(this.type,n,r,s,this.propValues),e.makeTree||((n,r,s)=>new hn(ci.none,n,r,s)))}static build(e){return qT(e)}}hn.empty=new hn(ci.none,[],[],0);class sh{constructor(e,n){this.buffer=e,this.index=n}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new sh(this.buffer,this.index)}}class Ur{constructor(e,n,r){this.buffer=e,this.length=n,this.set=r}get type(){return ci.none}toString(){let e=[];for(let n=0;n<this.buffer.length;)e.push(this.childString(n)),n=this.buffer[n+3];return e.join(",")}childString(e){let n=this.buffer[e],r=this.buffer[e+3],s=this.set.types[n],a=s.name;if(/\W/.test(a)&&!s.isError&&(a=JSON.stringify(a)),e+=4,r==e)return a;let c=[];for(;e<r;)c.push(this.childString(e)),e=this.buffer[e+3];return a+"("+c.join(",")+")"}findChild(e,n,r,s,a){let{buffer:c}=this,d=-1;for(let f=e;f!=n&&!(ax(a,s,c[f+1],c[f+2])&&(d=f,r>0));f=c[f+3]);return d}slice(e,n,r){let s=this.buffer,a=new Uint16Array(n-e),c=0;for(let d=e,f=0;d<n;){a[f++]=s[d++],a[f++]=s[d++]-r;let h=a[f++]=s[d++]-r;a[f++]=s[d++]-e,c=Math.max(c,h)}return new Ur(a,c,this.set)}}function ax(t,e,n,r){switch(t){case-2:return n<e;case-1:return r>=e&&n<e;case 0:return n<e&&r>e;case 1:return n<=e&&r>e;case 2:return r>e;case 4:return!0}}function Ma(t,e,n,r){for(var s;t.from==t.to||(n<1?t.from>=e:t.from>e)||(n>-1?t.to<=e:t.to<e);){let c=!r&&t instanceof ui&&t.index<0?null:t.parent;if(!c)return t;t=c}let a=r?0:Ht.IgnoreOverlays;if(r)for(let c=t,d=c.parent;d;c=d,d=c.parent)c instanceof ui&&c.index<0&&((s=d.enter(e,n,a))===null||s===void 0?void 0:s.from)!=c.from&&(t=d);for(;;){let c=t.enter(e,n,a);if(!c)return t;t=c}}class ox{cursor(e=0){return new ah(this,e)}getChild(e,n=null,r=null){let s=cx(this,e,n,r);return s.length?s[0]:null}getChildren(e,n=null,r=null){return cx(this,e,n,r)}resolve(e,n=0){return Ma(this,e,n,!1)}resolveInner(e,n=0){return Ma(this,e,n,!0)}matchContext(e){return lh(this.parent,e)}enterUnfinishedNodesBefore(e){let n=this.childBefore(e),r=this;for(;n;){let s=n.lastChild;if(!s||s.to!=n.to)break;s.type.isError&&s.from==s.to?(r=n,n=s.prevSibling):n=s}return r}get node(){return this}get next(){return this.parent}}class ui extends ox{constructor(e,n,r,s){super(),this._tree=e,this.from=n,this.index=r,this._parent=s}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(e,n,r,s,a=0){for(let c=this;;){for(let{children:d,positions:f}=c._tree,h=n>0?d.length:-1;e!=h;e+=n){let g=d[e],b=f[e]+c.from,v;if(!(!(a&Ht.EnterBracketed&&g instanceof hn&&(v=Oa.get(g))&&!v.overlay&&v.bracketed&&r>=b&&r<=b+g.length)&&!ax(s,r,b,b+g.length))){if(g instanceof Ur){if(a&Ht.ExcludeBuffers)continue;let S=g.findChild(0,g.buffer.length,n,r-b,s);if(S>-1)return new Fr(new LT(c,g,e,b),null,S)}else if(a&Ht.IncludeAnonymous||!g.type.isAnonymous||oh(g)){let S;if(!(a&Ht.IgnoreMounts)&&(S=Oa.get(g))&&!S.overlay)return new ui(S.tree,b,e,c);let A=new ui(g,b,e,c);return a&Ht.IncludeAnonymous||!A.type.isAnonymous?A:A.nextChild(n<0?g.children.length-1:0,n,r,s,a)}}}if(a&Ht.IncludeAnonymous||!c.type.isAnonymous||(c.index>=0?e=c.index+n:e=n<0?-1:c._parent._tree.children.length,c=c._parent,!c))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}prop(e){return this._tree.prop(e)}enter(e,n,r=0){let s;if(!(r&Ht.IgnoreOverlays)&&(s=Oa.get(this._tree))&&s.overlay){let a=e-this.from,c=r&Ht.EnterBracketed&&s.bracketed;for(let{from:d,to:f}of s.overlay)if((n>0||c?d<=a:d<a)&&(n<0||c?f>=a:f>a))return new ui(s.tree,s.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,n,r)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function cx(t,e,n,r){let s=t.cursor(),a=[];if(!s.firstChild())return a;if(n!=null){for(let c=!1;!c;)if(c=s.type.is(n),!s.nextSibling())return a}for(;;){if(r!=null&&s.type.is(r))return a;if(s.type.is(e)&&a.push(s.node),!s.nextSibling())return r==null?a:[]}}function lh(t,e,n=e.length-1){for(let r=t;n>=0;r=r.parent){if(!r)return!1;if(!r.type.isAnonymous){if(e[n]&&e[n]!=r.name)return!1;n--}}return!0}class LT{constructor(e,n,r,s){this.parent=e,this.buffer=n,this.index=r,this.start=s}}class Fr extends ox{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,n,r){super(),this.context=e,this._parent=n,this.index=r,this.type=e.buffer.set.types[e.buffer.buffer[r]]}child(e,n,r){let{buffer:s}=this.context,a=s.findChild(this.index+4,s.buffer[this.index+3],e,n-this.context.start,r);return a<0?null:new Fr(this.context,this,a)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}prop(e){return this.type.prop(e)}enter(e,n,r=0){if(r&Ht.ExcludeBuffers)return null;let{buffer:s}=this.context,a=s.findChild(this.index+4,s.buffer[this.index+3],n>0?1:-1,e-this.context.start,n);return a<0?null:new Fr(this.context,this,a)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,n=e.buffer[this.index+3];return n<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new Fr(this.context,this._parent,n):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,n=this._parent?this._parent.index+4:0;return this.index==n?this.externalSibling(-1):new Fr(this.context,this._parent,e.findChild(n,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],n=[],{buffer:r}=this.context,s=this.index+4,a=r.buffer[this.index+3];if(a>s){let c=r.buffer[this.index+1];e.push(r.slice(s,a,c)),n.push(0)}return new hn(this.type,e,n,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function ux(t){if(!t.length)return null;let e=0,n=t[0];for(let a=1;a<t.length;a++){let c=t[a];(c.from>n.from||c.to<n.to)&&(n=c,e=a)}let r=n instanceof ui&&n.index<0?null:n.parent,s=t.slice();return r?s[e]=r:s.splice(e,1),new BT(s,n)}class BT{constructor(e,n){this.heads=e,this.node=n}get next(){return ux(this.heads)}}function $T(t,e,n){let r=t.resolveInner(e,n),s=null;for(let a=r instanceof ui?r:r.context.parent;a;a=a.parent)if(a.index<0){let c=a.parent;(s||(s=[r])).push(c.resolve(e,n)),a=c}else{let c=Oa.get(a.tree);if(c&&c.overlay&&c.overlay[0].from<=e&&c.overlay[c.overlay.length-1].to>=e){let d=new ui(c.tree,c.overlay[0].from+a.from,-1,a);(s||(s=[r])).push(Ma(d,e,n,!1))}}return s?ux(s):r}class ah{get name(){return this.type.name}constructor(e,n=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=n&~Ht.EnterBracketed,e instanceof ui)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let r=e._parent;r;r=r._parent)this.stack.unshift(r.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,n){this.index=e;let{start:r,buffer:s}=this.buffer;return this.type=n||s.set.types[s.buffer[e]],this.from=r+s.buffer[e+1],this.to=r+s.buffer[e+2],!0}yield(e){return e?e instanceof ui?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,n,r){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,n,r,this.mode));let{buffer:s}=this.buffer,a=s.findChild(this.index+4,s.buffer[this.index+3],e,n-this.buffer.start,r);return a<0?!1:(this.stack.push(this.index),this.yieldBuf(a))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,n,r=this.mode){return this.buffer?r&Ht.ExcludeBuffers?!1:this.enterChild(1,e,n):this.yield(this._tree.enter(e,n,r))}parent(){if(!this.buffer)return this.yieldNode(this.mode&Ht.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&Ht.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:n}=this.buffer,r=this.stack.length-1;if(e<0){let s=r<0?0:this.stack[r]+4;if(this.index!=s)return this.yieldBuf(n.findChild(s,this.index,-1,0,4))}else{let s=n.buffer[this.index+3];if(s<(r<0?n.buffer.length:n.buffer[this.stack[r]+3]))return this.yieldBuf(s)}return r<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let n,r,{buffer:s}=this;if(s){if(e>0){if(this.index<s.buffer.buffer.length)return!1}else for(let a=0;a<this.index;a++)if(s.buffer.buffer[a+3]<this.index)return!1;({index:n,parent:r}=s)}else({index:n,_parent:r}=this._tree);for(;r;{index:n,_parent:r}=r)if(n>-1)for(let a=n+e,c=e<0?-1:r._tree.children.length;a!=c;a+=e){let d=r._tree.children[a];if(this.mode&Ht.IncludeAnonymous||d instanceof Ur||!d.type.isAnonymous||oh(d))return!1}return!0}move(e,n){if(n&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,n=0){for(;(this.from==this.to||(n<1?this.from>=e:this.from>e)||(n>-1?this.to<=e:this.to<e))&&this.parent(););for(;this.enterChild(1,e,n););return this}get node(){if(!this.buffer)return this._tree;let e=this.bufferNode,n=null,r=0;if(e&&e.context==this.buffer)e:for(let s=this.index,a=this.stack.length;a>=0;){for(let c=e;c;c=c._parent)if(c.index==s){if(s==this.index)return c;n=c,r=a+1;break e}s=this.stack[--a]}for(let s=r;s<this.stack.length;s++)n=new Fr(this.buffer,n,this.stack[s]);return this.bufferNode=new Fr(this.buffer,n,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(e,n){for(let r=0;;){let s=!1;if(this.type.isAnonymous||e(this)!==!1){if(this.firstChild()){r++;continue}this.type.isAnonymous||(s=!0)}for(;;){if(s&&n&&n(this),s=this.type.isAnonymous,!r)return;if(this.nextSibling())break;this.parent(),r--,s=!0}}}matchContext(e){if(!this.buffer)return lh(this.node.parent,e);let{buffer:n}=this.buffer,{types:r}=n.set;for(let s=e.length-1,a=this.stack.length-1;s>=0;a--){if(a<0)return lh(this._tree,e,s);let c=r[n.buffer[this.stack[a]]];if(!c.isAnonymous){if(e[s]&&e[s]!=c.name)return!1;s--}}return!0}}function oh(t){return t.children.some(e=>e instanceof Ur||!e.type.isAnonymous||oh(e))}function qT(t){var e;let{buffer:n,nodeSet:r,maxBufferLength:s=RT,reused:a=[],minRepeatType:c=r.types.length}=t,d=Array.isArray(n)?new sh(n,n.length):n,f=r.types,h=0,g=0;function b(R,B,M,z,F,X){let{id:W,start:G,end:we,size:ye}=d,xe=g,_=h;if(ye<0)if(d.next(),ye==-1){let L=a[W];M.push(L),z.push(G-R);return}else if(ye==-3){h=W;return}else if(ye==-4){g=W;return}else throw new RangeError(`Unrecognized record size: ${ye}`);let ee=f[W],he,$,te=G-R;if(we-G<=s&&($=T(d.pos-B,F))){let L=new Uint16Array($.size-$.skip),P=d.pos-$.size,ue=L.length;for(;d.pos>P;)ue=D($.start,L,ue);he=new Ur(L,we-$.start,r),te=$.start-R}else{let L=d.pos-ye;d.next();let P=[],ue=[],Se=W>=c?W:-1,Ne=0,Re=we;for(;d.pos>L;)Se>=0&&d.id==Se&&d.size>=0?(d.end<=Re-s&&(A(P,ue,G,Ne,d.end,Re,Se,xe,_),Ne=P.length,Re=d.end),d.next()):X>2500?v(G,L,P,ue):b(G,L,P,ue,Se,X+1);if(Se>=0&&Ne>0&&Ne<P.length&&A(P,ue,G,Ne,G,Re,Se,xe,_),P.reverse(),ue.reverse(),Se>-1&&Ne>0){let Be=S(ee,_);he=ch(ee,P,ue,0,P.length,0,we-G,Be,Be)}else he=C(ee,P,ue,we-G,xe-we,_)}M.push(he),z.push(te)}function v(R,B,M,z){let F=[],X=0,W=-1;for(;d.pos>B;){let{id:G,start:we,end:ye,size:xe}=d;if(xe>4)d.next();else{if(W>-1&&we<W)break;W<0&&(W=ye-s),F.push(G,we,ye),X++,d.next()}}if(X){let G=new Uint16Array(X*4),we=F[F.length-2];for(let ye=F.length-3,xe=0;ye>=0;ye-=3)G[xe++]=F[ye],G[xe++]=F[ye+1]-we,G[xe++]=F[ye+2]-we,G[xe++]=xe;M.push(new Ur(G,F[2]-we,r)),z.push(we-R)}}function S(R,B){return(M,z,F)=>{let X=0,W=M.length-1,G,we;if(W>=0&&(G=M[W])instanceof hn){if(!W&&G.type==R&&G.length==F)return G;(we=G.prop(mt.lookAhead))&&(X=z[W]+G.length+we)}return C(R,M,z,F,X,B)}}function A(R,B,M,z,F,X,W,G,we){let ye=[],xe=[];for(;R.length>z;)ye.push(R.pop()),xe.push(B.pop()+M-F);R.push(C(r.types[W],ye,xe,X-F,G-X,we)),B.push(F-M)}function C(R,B,M,z,F,X,W){if(X){let G=[mt.contextHash,X];W=W?[G].concat(W):[G]}if(F>25){let G=[mt.lookAhead,F];W=W?[G].concat(W):[G]}return new hn(R,B,M,z,W)}function T(R,B){let M=d.fork(),z=0,F=0,X=0,W=M.end-s,G={size:0,start:0,skip:0};e:for(let we=M.pos-R;M.pos>we;){let ye=M.size;if(M.id==B&&ye>=0){G.size=z,G.start=F,G.skip=X,X+=4,z+=4,M.next();continue}let xe=M.pos-ye;if(ye<0||xe<we||M.start<W)break;let _=M.id>=c?4:0,ee=M.start;for(M.next();M.pos>xe;){if(M.size<0)if(M.size==-3||M.size==-4)_+=4;else break e;else M.id>=c&&(_+=4);M.next()}F=ee,z+=ye,X+=_}return(B<0||z==R)&&(G.size=z,G.start=F,G.skip=X),G.size>4?G:void 0}function D(R,B,M){let{id:z,start:F,end:X,size:W}=d;if(d.next(),W>=0&&z<c){let G=M;if(W>4){let we=d.pos-(W-4);for(;d.pos>we;)M=D(R,B,M)}B[--M]=G,B[--M]=X-R,B[--M]=F-R,B[--M]=z}else W==-3?h=z:W==-4&&(g=z);return M}let j=[],E=[];for(;d.pos>0;)b(t.start||0,t.bufferStart||0,j,E,-1,0);let O=(e=t.length)!==null&&e!==void 0?e:j.length?E[0]+j[0].length:0;return new hn(f[t.topID],j.reverse(),E.reverse(),O)}const dx=new WeakMap;function Ac(t,e){if(!t.isAnonymous||e instanceof Ur||e.type!=t)return 1;let n=dx.get(e);if(n==null){n=1;for(let r of e.children){if(r.type!=t||!(r instanceof hn)){n=1;break}n+=Ac(t,r)}dx.set(e,n)}return n}function ch(t,e,n,r,s,a,c,d,f){let h=0;for(let A=r;A<s;A++)h+=Ac(t,e[A]);let g=Math.ceil(h*1.5/8),b=[],v=[];function S(A,C,T,D,j){for(let E=T;E<D;){let O=E,R=C[E],B=Ac(t,A[E]);for(E++;E<D;E++){let M=Ac(t,A[E]);if(B+M>=g)break;B+=M}if(E==O+1){if(B>g){let M=A[O];S(M.children,M.positions,0,M.children.length,C[O]+j);continue}b.push(A[O])}else{let M=C[E-1]+A[E-1].length-R;b.push(ch(t,A,C,O,E,R,M,null,f))}v.push(R+j-a)}}return S(e,n,r,s,0),(d||f)(b,v,c)}class _s{constructor(e,n,r,s,a=!1,c=!1){this.from=e,this.to=n,this.tree=r,this.offset=s,this.open=(a?1:0)|(c?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,n=[],r=!1){let s=[new _s(0,e.length,e,0,!1,r)];for(let a of n)a.to>e.length&&s.push(a);return s}static applyChanges(e,n,r=128){if(!n.length)return e;let s=[],a=1,c=e.length?e[0]:null;for(let d=0,f=0,h=0;;d++){let g=d<n.length?n[d]:null,b=g?g.fromA:1e9;if(b-f>=r)for(;c&&c.from<b;){let v=c;if(f>=v.from||b<=v.to||h){let S=Math.max(v.from,f)-h,A=Math.min(v.to,b)-h;v=S>=A?null:new _s(S,A,v.tree,v.offset+h,d>0,!!g)}if(v&&s.push(v),c.to>b)break;c=a<e.length?e[a++]:null}if(!g)break;f=g.toA,h=g.toA-g.toB}return s}}class zT{startParse(e,n,r){return typeof e=="string"&&(e=new HT(e)),r=r?r.length?r.map(s=>new rh(s.from,s.to)):[new rh(0,0)]:[new rh(0,e.length)],this.createParse(e,n||[],r)}parse(e,n,r){let s=this.startParse(e,n,r);for(;;){let a=s.advance();if(a)return a}}}class HT{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,n){return this.string.slice(e,n)}}new mt({perNode:!0});let IT=0;class di{constructor(e,n,r,s){this.name=e,this.set=n,this.base=r,this.modified=s,this.id=IT++}toString(){let{name:e}=this;for(let n of this.modified)n.name&&(e=`${n.name}(${e})`);return e}static define(e,n){let r=typeof e=="string"?e:"?";if(e instanceof di&&(n=e),n?.base)throw new Error("Can not derive from a modified tag");let s=new di(r,[],null,[]);if(s.set.push(s),n)for(let a of n.set)s.set.push(a);return s}static defineModifier(e){let n=new kc(e);return r=>r.modified.indexOf(n)>-1?r:kc.get(r.base||r,r.modified.concat(n).sort((s,a)=>s.id-a.id))}}let UT=0;class kc{constructor(e){this.name=e,this.instances=[],this.id=UT++}static get(e,n){if(!n.length)return e;let r=n[0].instances.find(d=>d.base==e&&FT(n,d.modified));if(r)return r;let s=[],a=new di(e.name,s,e,n);for(let d of n)d.instances.push(a);let c=VT(n);for(let d of e.set)if(!d.modified.length)for(let f of c)s.push(kc.get(d,f));return a}}function FT(t,e){return t.length==e.length&&t.every((n,r)=>n==e[r])}function VT(t){let e=[[]];for(let n=0;n<t.length;n++)for(let r=0,s=e.length;r<s;r++)e.push(e[r].concat(t[n]));return e.sort((n,r)=>r.length-n.length)}function PT(t){let e=Object.create(null);for(let n in t){let r=t[n];Array.isArray(r)||(r=[r]);for(let s of n.split(" "))if(s){let a=[],c=2,d=s;for(let b=0;;){if(d=="..."&&b>0&&b+3==s.length){c=1;break}let v=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(d);if(!v)throw new RangeError("Invalid path: "+s);if(a.push(v[0]=="*"?"":v[0][0]=='"'?JSON.parse(v[0]):v[0]),b+=v[0].length,b==s.length)break;let S=s[b++];if(b==s.length&&S=="!"){c=0;break}if(S!="/")throw new RangeError("Invalid path: "+s);d=s.slice(b)}let f=a.length-1,h=a[f];if(!h)throw new RangeError("Invalid path: "+s);let g=new Cc(r,c,f>0?a.slice(0,f):null);e[h]=g.sort(e[h])}}return KT.add(e)}const KT=new mt({combine(t,e){let n,r,s;for(;t||e;){if(!t||e&&t.depth>=e.depth?(s=e,e=e.next):(s=t,t=t.next),n&&n.mode==s.mode&&!s.context&&!n.context)continue;let a=new Cc(s.tags,s.mode,s.context);n?n.next=a:r=a,n=a}return r}});class Cc{constructor(e,n,r,s){this.tags=e,this.mode=n,this.context=r,this.next=s}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth<this.depth?(this.next=e,this):(e.next=this.sort(e.next),e)}get depth(){return this.context?this.context.length:0}}Cc.empty=new Cc([],2,null);function YT(t,e){let n=Object.create(null);for(let a of t)if(!Array.isArray(a.tag))n[a.tag.id]=a.class;else for(let c of a.tag)n[c.id]=a.class;let{scope:r,all:s=null}={};return{style:a=>{let c=s;for(let d of a)for(let f of d.set){let h=n[f.id];if(h){c=c?c+" "+h:h;break}}return c},scope:r}}const Ee=di.define,Nc=Ee(),Vr=Ee(),fx=Ee(Vr),hx=Ee(Vr),Pr=Ee(),Tc=Ee(Pr),uh=Ee(Pr),Ki=Ee(),Ls=Ee(Ki),Yi=Ee(),Gi=Ee(),dh=Ee(),Ra=Ee(dh),jc=Ee(),it={comment:Nc,lineComment:Ee(Nc),blockComment:Ee(Nc),docComment:Ee(Nc),name:Vr,variableName:Ee(Vr),typeName:fx,tagName:Ee(fx),propertyName:hx,attributeName:Ee(hx),className:Ee(Vr),labelName:Ee(Vr),namespace:Ee(Vr),macroName:Ee(Vr),literal:Pr,string:Tc,docString:Ee(Tc),character:Ee(Tc),attributeValue:Ee(Tc),number:uh,integer:Ee(uh),float:Ee(uh),bool:Ee(Pr),regexp:Ee(Pr),escape:Ee(Pr),color:Ee(Pr),url:Ee(Pr),keyword:Yi,self:Ee(Yi),null:Ee(Yi),atom:Ee(Yi),unit:Ee(Yi),modifier:Ee(Yi),operatorKeyword:Ee(Yi),controlKeyword:Ee(Yi),definitionKeyword:Ee(Yi),moduleKeyword:Ee(Yi),operator:Gi,derefOperator:Ee(Gi),arithmeticOperator:Ee(Gi),logicOperator:Ee(Gi),bitwiseOperator:Ee(Gi),compareOperator:Ee(Gi),updateOperator:Ee(Gi),definitionOperator:Ee(Gi),typeOperator:Ee(Gi),controlOperator:Ee(Gi),punctuation:dh,separator:Ee(dh),bracket:Ra,angleBracket:Ee(Ra),squareBracket:Ee(Ra),paren:Ee(Ra),brace:Ee(Ra),content:Ki,heading:Ls,heading1:Ee(Ls),heading2:Ee(Ls),heading3:Ee(Ls),heading4:Ee(Ls),heading5:Ee(Ls),heading6:Ee(Ls),contentSeparator:Ee(Ki),list:Ee(Ki),quote:Ee(Ki),emphasis:Ee(Ki),strong:Ee(Ki),link:Ee(Ki),monospace:Ee(Ki),strikethrough:Ee(Ki),inserted:Ee(),deleted:Ee(),changed:Ee(),invalid:Ee(),meta:jc,documentMeta:Ee(jc),annotation:Ee(jc),processingInstruction:Ee(jc),definition:di.defineModifier("definition"),constant:di.defineModifier("constant"),function:di.defineModifier("function"),standard:di.defineModifier("standard"),local:di.defineModifier("local"),special:di.defineModifier("special")};for(let t in it){let e=it[t];e instanceof di&&(e.name=t)}YT([{tag:it.link,class:"tok-link"},{tag:it.heading,class:"tok-heading"},{tag:it.emphasis,class:"tok-emphasis"},{tag:it.strong,class:"tok-strong"},{tag:it.keyword,class:"tok-keyword"},{tag:it.atom,class:"tok-atom"},{tag:it.bool,class:"tok-bool"},{tag:it.url,class:"tok-url"},{tag:it.labelName,class:"tok-labelName"},{tag:it.inserted,class:"tok-inserted"},{tag:it.deleted,class:"tok-deleted"},{tag:it.literal,class:"tok-literal"},{tag:it.string,class:"tok-string"},{tag:it.number,class:"tok-number"},{tag:[it.regexp,it.escape,it.special(it.string)],class:"tok-string2"},{tag:it.variableName,class:"tok-variableName"},{tag:it.local(it.variableName),class:"tok-variableName tok-local"},{tag:it.definition(it.variableName),class:"tok-variableName tok-definition"},{tag:it.special(it.variableName),class:"tok-variableName2"},{tag:it.definition(it.propertyName),class:"tok-propertyName tok-definition"},{tag:it.typeName,class:"tok-typeName"},{tag:it.namespace,class:"tok-namespace"},{tag:it.className,class:"tok-className"},{tag:it.macroName,class:"tok-macroName"},{tag:it.propertyName,class:"tok-propertyName"},{tag:it.operator,class:"tok-operator"},{tag:it.comment,class:"tok-comment"},{tag:it.meta,class:"tok-meta"},{tag:it.invalid,class:"tok-invalid"},{tag:it.punctuation,class:"tok-punctuation"}]);var fh;const Ec=new mt,GT=new mt;class ar{constructor(e,n,r=[],s=""){this.data=e,this.name=s,vt.prototype.hasOwnProperty("tree")||Object.defineProperty(vt.prototype,"tree",{get(){return Kr(this)}}),this.parser=n,this.extension=[xl.of(this),vt.languageData.of((a,c,d)=>{let f=px(a,c,d),h=f.type.prop(Ec);if(!h)return[];let g=a.facet(h),b=f.type.prop(GT);if(b){let v=f.resolve(c-f.from,d);for(let S of b)if(S.test(v,a)){let A=a.facet(S.facet);return S.type=="replace"?A:A.concat(g)}}return g})].concat(r)}isActiveAt(e,n,r=-1){return px(e,n,r).type.prop(Ec)==this.data}findRegions(e){let n=e.facet(xl);if(n?.data==this.data)return[{from:0,to:e.doc.length}];if(!n||!n.allowsNesting)return[];let r=[],s=(a,c)=>{if(a.prop(Ec)==this.data){r.push({from:c,to:c+a.length});return}let d=a.prop(mt.mounted);if(d){if(d.tree.prop(Ec)==this.data){if(d.overlay)for(let f of d.overlay)r.push({from:f.from+c,to:f.to+c});else r.push({from:c,to:c+a.length});return}else if(d.overlay){let f=r.length;if(s(d.tree,d.overlay[0].from+c),r.length>f)return}}for(let f=0;f<a.children.length;f++){let h=a.children[f];h instanceof hn&&s(h,a.positions[f]+c)}};return s(Kr(e),0),r}get allowsNesting(){return!0}}ar.setState=zt.define();function px(t,e,n){let r=t.facet(xl),s=Kr(t).topNode;if(!r||r.allowsNesting)for(let a=s;a;a=a.enter(e,n,Ht.ExcludeBuffers|Ht.EnterBracketed))a.type.isTop&&(s=a);return s}function Kr(t){let e=t.field(ar.state,!1);return e?e.tree:hn.empty}class XT{constructor(e){this.doc=e,this.cursorPos=0,this.string="",this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,n){let r=this.cursorPos-this.string.length;return e<r||n>=this.cursorPos?this.doc.sliceString(e,n):this.string.slice(e-r,n-r)}}let Da=null;class Oc{constructor(e,n,r=[],s,a,c,d,f){this.parser=e,this.state=n,this.fragments=r,this.tree=s,this.treeLen=a,this.viewport=c,this.skipped=d,this.scheduleOn=f,this.parse=null,this.tempSkipped=[]}static create(e,n,r){return new Oc(e,n,[],hn.empty,0,r,[],null)}startParse(){return this.parser.startParse(new XT(this.state.doc),this.fragments)}work(e,n){return n!=null&&n>=this.state.doc.length&&(n=void 0),this.tree!=hn.empty&&this.isDone(n??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var r;if(typeof e=="number"){let s=Date.now()+e;e=()=>Date.now()>s}for(this.parse||(this.parse=this.startParse()),n!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>n)&&n<this.state.doc.length&&this.parse.stopAt(n);;){let s=this.parse.advance();if(s)if(this.fragments=this.withoutTempSkipped(_s.addTree(s,this.fragments,this.parse.stoppedAt!=null)),this.treeLen=(r=this.parse.stoppedAt)!==null&&r!==void 0?r:this.state.doc.length,this.tree=s,this.parse=null,this.treeLen<(n??this.state.doc.length))this.parse=this.startParse();else return!0;if(e())return!1}})}takeTree(){let e,n;this.parse&&(e=this.parse.parsedPos)>=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(n=this.parse.advance()););}),this.treeLen=e,this.tree=n,this.fragments=this.withoutTempSkipped(_s.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let n=Da;Da=this;try{return e()}finally{Da=n}}withoutTempSkipped(e){for(let n;n=this.tempSkipped.pop();)e=mx(e,n.from,n.to);return e}changes(e,n){let{fragments:r,tree:s,treeLen:a,viewport:c,skipped:d}=this;if(this.takeTree(),!e.empty){let f=[];if(e.iterChangedRanges((h,g,b,v)=>f.push({fromA:h,toA:g,fromB:b,toB:v})),r=_s.applyChanges(r,f),s=hn.empty,a=0,c={from:e.mapPos(c.from,-1),to:e.mapPos(c.to,1)},this.skipped.length){d=[];for(let h of this.skipped){let g=e.mapPos(h.from,1),b=e.mapPos(h.to,-1);g<b&&d.push({from:g,to:b})}}}return new Oc(this.parser,n,r,s,a,c,d,this.scheduleOn)}updateViewport(e){if(this.viewport.from==e.from&&this.viewport.to==e.to)return!1;this.viewport=e;let n=this.skipped.length;for(let r=0;r<this.skipped.length;r++){let{from:s,to:a}=this.skipped[r];s<e.to&&a>e.from&&(this.fragments=mx(this.fragments,s,a),this.skipped.splice(r--,1))}return this.skipped.length>=n?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,n){this.skipped.push({from:e,to:n})}static getSkippingParser(e){return new class extends zT{createParse(n,r,s){let a=s[0].from,c=s[s.length-1].to;return{parsedPos:a,advance(){let f=Da;if(f){for(let h of s)f.tempSkipped.push(h);e&&(f.scheduleOn=f.scheduleOn?Promise.all([f.scheduleOn,e]):e)}return this.parsedPos=c,new hn(ci.none,[],[],c-a)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let n=this.fragments;return this.treeLen>=e&&n.length&&n[0].from==0&&n[0].to>=e}static get(){return Da}}function mx(t,e,n){return _s.applyChanges(t,[{fromA:e,toA:n,fromB:e,toB:n}])}class bl{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let n=this.context.changes(e.changes,e.state),r=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),n.viewport.to);return n.work(20,r)||n.takeTree(),new bl(n)}static init(e){let n=Math.min(3e3,e.doc.length),r=Oc.create(e.facet(xl).parser,e,{from:0,to:n});return r.work(20,n)||r.takeTree(),new bl(r)}}ar.state=Br.define({create:bl.init,update(t,e){for(let n of e.effects)if(n.is(ar.setState))return n.value;return e.startState.facet(xl)!=e.state.facet(xl)?bl.init(e.state):t.apply(e)}});let gx=t=>{let e=setTimeout(()=>t(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(gx=t=>{let e=-1,n=setTimeout(()=>{e=requestIdleCallback(t,{timeout:400})},100);return()=>e<0?clearTimeout(n):cancelIdleCallback(e)});const hh=typeof navigator<"u"&&(!((fh=navigator.scheduling)===null||fh===void 0)&&fh.isInputPending)?()=>navigator.scheduling.isInputPending():null,JT=sr.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let n=this.view.state.field(ar.state).context;(n.updateViewport(e.view.viewport)||this.view.viewport.to>n.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(n)}scheduleWork(){if(this.working)return;let{state:e}=this.view,n=e.field(ar.state);(n.tree!=n.context.tree||!n.context.isDone(e.doc.length))&&(this.working=gx(this.work))}work(e){this.working=null;let n=Date.now();if(this.chunkEnd<n&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=n+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:r,viewport:{to:s}}=this.view,a=r.field(ar.state);if(a.tree==a.context.tree&&a.context.isDone(s+1e5))return;let c=Date.now()+Math.min(this.chunkBudget,100,e&&!hh?Math.max(25,e.timeRemaining()-5):1e9),d=a.context.treeLen<s&&r.doc.length>s+1e3,f=a.context.work(()=>hh&&hh()||Date.now()>c,s+(d?0:1e5));this.chunkBudget-=Date.now()-n,(f||this.chunkBudget<=0)&&(a.context.takeTree(),this.view.dispatch({effects:ar.setState.of(new bl(a.context))})),this.chunkBudget>0&&!(f&&!d)&&this.scheduleWork(),this.checkAsyncSchedule(a.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(n=>Vi(this.view.state,n)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),xl=He.define({combine(t){return t.length?t[0]:null},enables:t=>[ar.state,JT,Ye.contentAttributes.compute([t],e=>{let n=e.facet(t);return n&&n.name?{"data-language":n.name}:{}})]}),QT=He.define(),ph=He.define({combine:t=>{if(!t.length)return" ";let e=t[0];if(!e||/\S/.test(e)||Array.from(e).some(n=>n!=e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(t[0]));return e}});function Mc(t){let e=t.facet(ph);return e.charCodeAt(0)==9?t.tabSize*e.length:e.length}function Rc(t,e){let n="",r=t.tabSize,s=t.facet(ph)[0];if(s==" "){for(;e>=r;)n+=" ",e-=r;s=" "}for(let a=0;a<e;a++)n+=s;return n}function yx(t,e){t instanceof vt&&(t=new Dc(t));for(let r of t.state.facet(QT)){let s=r(t,e);if(s!==void 0)return s}let n=Kr(t.state);return n.length>=e?ZT(t,n,e):null}class Dc{constructor(e,n={}){this.state=e,this.options=n,this.unit=Mc(e)}lineAt(e,n=1){let r=this.state.doc.lineAt(e),{simulateBreak:s,simulateDoubleBreak:a}=this.options;return s!=null&&s>=r.from&&s<=r.to?a&&s==e?{text:"",from:e}:(n<0?s<e:s<=e)?{text:r.text.slice(s-r.from),from:s}:{text:r.text.slice(0,s-r.from),from:r.from}:r}textAfterPos(e,n=1){if(this.options.simulateDoubleBreak&&e==this.options.simulateBreak)return"";let{text:r,from:s}=this.lineAt(e,n);return r.slice(e-s,Math.min(r.length,e+100-s))}column(e,n=1){let{text:r,from:s}=this.lineAt(e,n),a=this.countColumn(r,e-s),c=this.options.overrideIndentation?this.options.overrideIndentation(s):-1;return c>-1&&(a+=c-this.countColumn(r,r.search(/\S|$/))),a}countColumn(e,n=e.length){return Yo(e,this.state.tabSize,n)}lineIndent(e,n=1){let{text:r,from:s}=this.lineAt(e,n),a=this.options.overrideIndentation;if(a){let c=a(s);if(c>-1)return c}return this.countColumn(r,r.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const WT=new mt;function ZT(t,e,n){let r=e.resolveStack(n),s=e.resolveInner(n,-1).resolve(n,0).enterUnfinishedNodesBefore(n);if(s!=r.node){let a=[];for(let c=s;c&&!(c.from<r.node.from||c.to>r.node.to||c.from==r.node.from&&c.type==r.node.type);c=c.parent)a.push(c);for(let c=a.length-1;c>=0;c--)r={node:a[c],next:r}}return bx(r,t,n)}function bx(t,e,n){for(let r=t;r;r=r.next){let s=tj(r.node);if(s)return s(mh.create(e,n,r))}return 0}function ej(t){return t.pos==t.options.simulateBreak&&t.options.simulateDoubleBreak}function tj(t){let e=t.type.prop(WT);if(e)return e;let n=t.firstChild,r;if(n&&(r=n.type.prop(mt.closedBy))){let s=t.lastChild,a=s&&r.indexOf(s.name)>-1;return c=>sj(c,!0,1,void 0,a&&!ej(c)?s.from:void 0)}return t.parent==null?nj:null}function nj(){return 0}class mh extends Dc{constructor(e,n,r){super(e.state,e.options),this.base=e,this.pos=n,this.context=r}get node(){return this.context.node}static create(e,n,r){return new mh(e,n,r)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let n=this.state.doc.lineAt(e.from);for(;;){let r=e.resolve(n.from);for(;r.parent&&r.parent.from==r.from;)r=r.parent;if(ij(r,e))break;n=this.state.doc.lineAt(r.from)}return this.lineIndent(n.from)}continue(){return bx(this.context.next,this.base,this.pos)}}function ij(t,e){for(let n=e;n;n=n.parent)if(t==n)return!0;return!1}function rj(t){let e=t.node,n=e.childAfter(e.from),r=e.lastChild;if(!n)return null;let s=t.options.simulateBreak,a=t.state.doc.lineAt(n.from),c=s==null||s<=a.from?a.to:Math.min(a.to,s);for(let d=n.to;;){let f=e.childAfter(d);if(!f||f==r)return null;if(!f.type.isSkipped){if(f.from>=c)return null;let h=/^ */.exec(a.text.slice(n.to-a.from))[0].length;return{from:n.from,to:n.to+h}}d=f.to}}function sj(t,e,n,r,s){let a=t.textAfter,c=a.match(/^\s*/)[0].length,d=r&&a.slice(c,c+r.length)==r||s==t.pos+c,f=rj(t);return f?d?t.column(f.from):t.column(f.to):t.baseIndent+(d?0:t.unit*n)}const lj=1e4,aj="()[]{}",oj=new mt;function gh(t,e,n){let r=t.prop(e<0?mt.openedBy:mt.closedBy);if(r)return r;if(t.name.length==1){let s=n.indexOf(t.name);if(s>-1&&s%2==(e<0?1:0))return[n[s+e]]}return null}function yh(t){let e=t.type.prop(oj);return e?e(t.node):t}function vl(t,e,n,r={}){let s=r.maxScanDistance||lj,a=r.brackets||aj,c=Kr(t),d=c.resolveInner(e,n);for(let f=d;f;f=f.parent){let h=gh(f.type,n,a);if(h&&f.from<f.to){let g=yh(f);if(g&&(n>0?e>=g.from&&e<g.to:e>g.from&&e<=g.to))return cj(t,e,n,f,g,h,a)}}return uj(t,e,n,c,d.type,s,a)}function cj(t,e,n,r,s,a,c){let d=r.parent,f={from:s.from,to:s.to},h=0,g=d?.cursor();if(g&&(n<0?g.childBefore(r.from):g.childAfter(r.to)))do if(n<0?g.to<=r.from:g.from>=r.to){if(h==0&&a.indexOf(g.type.name)>-1&&g.from<g.to){let b=yh(g);return{start:f,end:b?{from:b.from,to:b.to}:void 0,matched:!0}}else if(gh(g.type,n,c))h++;else if(gh(g.type,-n,c)){if(h==0){let b=yh(g);return{start:f,end:b&&b.from<b.to?{from:b.from,to:b.to}:void 0,matched:!1}}h--}}while(n<0?g.prevSibling():g.nextSibling());return{start:f,matched:!1}}function uj(t,e,n,r,s,a,c){if(n<0?!e:e==t.doc.length)return null;let d=n<0?t.sliceDoc(e-1,e):t.sliceDoc(e,e+1),f=c.indexOf(d);if(f<0||f%2==0!=n>0)return null;let h={from:n<0?e-1:e,to:n>0?e+1:e},g=t.doc.iterRange(e,n>0?t.doc.length:0),b=0;for(let v=0;!g.next().done&&v<=a;){let S=g.value;n<0&&(v+=S.length);let A=e+v*n;for(let C=n>0?0:S.length-1,T=n>0?S.length:-1;C!=T;C+=n){let D=c.indexOf(S[C]);if(!(D<0||r.resolveInner(A+C,1).type!=s))if(D%2==0==n>0)b++;else{if(b==1)return{start:h,end:{from:A+C,to:A+C+1},matched:D>>1==f>>1};b--}}n>0&&(v+=S.length)}return g.done?{start:h,matched:!1}:null}const dj=Object.create(null),xx=[ci.none],vx=[],wx=Object.create(null),fj=Object.create(null);for(let[t,e]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])fj[t]=hj(dj,e);function bh(t,e){vx.indexOf(t)>-1||(vx.push(t),console.warn(e))}function hj(t,e){let n=[];for(let d of e.split(" ")){let f=[];for(let h of d.split(".")){let g=t[h]||it[h];g?typeof g=="function"?f.length?f=f.map(g):bh(h,`Modifier ${h} used at start of tag`):f.length?bh(h,`Tag ${h} used as modifier`):f=Array.isArray(g)?g:[g]:bh(h,`Unknown highlighting tag ${h}`)}for(let h of f)n.push(h)}if(!n.length)return 0;let r=e.replace(/ /g,"_"),s=r+" "+n.map(d=>d.id),a=wx[s];if(a)return a.id;let c=wx[s]=ci.define({id:xx.length,name:r,props:[PT({[r]:n})]});return xx.push(c),c.id}Rt.RTL,Rt.LTR;const pj=t=>{let{state:e}=t,n=e.doc.lineAt(e.selection.main.from),r=vh(t.state,n.from);return r.line?mj(t):r.block?yj(t):!1};function xh(t,e){return({state:n,dispatch:r})=>{if(n.readOnly)return!1;let s=t(e,n);return s?(r(n.update(s)),!0):!1}}const mj=xh(vj,0),gj=xh(Sx,0),yj=xh((t,e)=>Sx(t,e,xj(e)),0);function vh(t,e){let n=t.languageDataAt("commentTokens",e,1);return n.length?n[0]:{}}const _a=50;function bj(t,{open:e,close:n},r,s){let a=t.sliceDoc(r-_a,r),c=t.sliceDoc(s,s+_a),d=/\s*$/.exec(a)[0].length,f=/^\s*/.exec(c)[0].length,h=a.length-d;if(a.slice(h-e.length,h)==e&&c.slice(f,f+n.length)==n)return{open:{pos:r-d,margin:d&&1},close:{pos:s+f,margin:f&&1}};let g,b;s-r<=2*_a?g=b=t.sliceDoc(r,s):(g=t.sliceDoc(r,r+_a),b=t.sliceDoc(s-_a,s));let v=/^\s*/.exec(g)[0].length,S=/\s*$/.exec(b)[0].length,A=b.length-S-n.length;return g.slice(v,v+e.length)==e&&b.slice(A,A+n.length)==n?{open:{pos:r+v+e.length,margin:/\s/.test(g.charAt(v+e.length))?1:0},close:{pos:s-S-n.length,margin:/\s/.test(b.charAt(A-1))?1:0}}:null}function xj(t){let e=[];for(let n of t.selection.ranges){let r=t.doc.lineAt(n.from),s=n.to<=r.to?r:t.doc.lineAt(n.to);s.from>r.from&&s.from==n.to&&(s=n.to==r.to+1?r:t.doc.lineAt(n.to-1));let a=e.length-1;a>=0&&e[a].to>r.from?e[a].to=s.to:e.push({from:r.from+/^\s*/.exec(r.text)[0].length,to:s.to})}return e}function Sx(t,e,n=e.selection.ranges){let r=n.map(a=>vh(e,a.from).block);if(!r.every(a=>a))return null;let s=n.map((a,c)=>bj(e,r[c],a.from,a.to));if(t!=2&&!s.every(a=>a))return{changes:e.changes(n.map((a,c)=>s[c]?[]:[{from:a.from,insert:r[c].open+" "},{from:a.to,insert:" "+r[c].close}]))};if(t!=1&&s.some(a=>a)){let a=[];for(let c=0,d;c<s.length;c++)if(d=s[c]){let f=r[c],{open:h,close:g}=d;a.push({from:h.pos-f.open.length,to:h.pos+h.margin},{from:g.pos-g.margin,to:g.pos+f.close.length})}return{changes:a}}return null}function vj(t,e,n=e.selection.ranges){let r=[],s=-1;e:for(let{from:a,to:c}of n){let d=r.length,f=1e9,h;for(let g=a;g<=c;){let b=e.doc.lineAt(g);if(h==null&&(h=vh(e,b.from).line,!h))continue e;if(b.from>s&&(a==c||c>b.from)){s=b.from;let v=/^\s*/.exec(b.text)[0].length,S=v==b.length,A=b.text.slice(v,v+h.length)==h?v:-1;v<b.text.length&&v<f&&(f=v),r.push({line:b,comment:A,token:h,indent:v,empty:S,single:!1})}g=b.to+1}if(f<1e9)for(let g=d;g<r.length;g++)r[g].indent<r[g].line.text.length&&(r[g].indent=f);r.length==d+1&&(r[d].single=!0)}if(t!=2&&r.some(a=>a.comment<0&&(!a.empty||a.single))){let a=[];for(let{line:d,token:f,indent:h,empty:g,single:b}of r)(b||!g)&&a.push({from:d.from+h,insert:f+" "});let c=e.changes(a);return{changes:c,selection:e.selection.map(c,1)}}else if(t!=1&&r.some(a=>a.comment>=0)){let a=[];for(let{line:c,comment:d,token:f}of r)if(d>=0){let h=c.from+d,g=h+f.length;c.text[g-c.from]==" "&&g++,a.push({from:h,to:g})}return{changes:a}}return null}const wh=$r.define(),wj=$r.define(),Sj=He.define(),Ax=He.define({combine(t){return uf(t,{minDepth:100,newGroupDelay:500,joinToEvent:(e,n)=>n},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,n)=>(r,s)=>e(r,s)||n(r,s)})}}),kx=Br.define({create(){return Xi.empty},update(t,e){let n=e.state.facet(Ax),r=e.annotation(wh);if(r){let f=$n.fromTransaction(e,r.selection),h=r.side,g=h==0?t.undone:t.done;return f?g=Lc(g,g.length,n.minDepth,f):g=Tx(g,e.startState.selection),new Xi(h==0?r.rest:g,h==0?g:r.rest)}let s=e.annotation(wj);if((s=="full"||s=="before")&&(t=t.isolate()),e.annotation(en.addToHistory)===!1)return e.changes.empty?t:t.addMapping(e.changes.desc);let a=$n.fromTransaction(e),c=e.annotation(en.time),d=e.annotation(en.userEvent);return a?t=t.addChanges(a,c,d,n,e):e.selection&&(t=t.addSelection(e.startState.selection,c,d,n.newGroupDelay)),(s=="full"||s=="after")&&(t=t.isolate()),t},toJSON(t){return{done:t.done.map(e=>e.toJSON()),undone:t.undone.map(e=>e.toJSON())}},fromJSON(t){return new Xi(t.done.map($n.fromJSON),t.undone.map($n.fromJSON))}});function Aj(t={}){return[kx,Ax.of(t),Ye.domEventHandlers({beforeinput(e,n){let r=e.inputType=="historyUndo"?Cx:e.inputType=="historyRedo"?Sh:null;return r?(e.preventDefault(),r(n)):!1}})]}function _c(t,e){return function({state:n,dispatch:r}){if(!e&&n.readOnly)return!1;let s=n.field(kx,!1);if(!s)return!1;let a=s.pop(t,n,e);return a?(r(a),!0):!1}}const Cx=_c(0,!1),Sh=_c(1,!1),kj=_c(0,!0),Cj=_c(1,!0);class $n{constructor(e,n,r,s,a){this.changes=e,this.effects=n,this.mapped=r,this.startSelection=s,this.selectionsAfter=a}setSelAfter(e){return new $n(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,n,r;return{changes:(e=this.changes)===null||e===void 0?void 0:e.toJSON(),mapped:(n=this.mapped)===null||n===void 0?void 0:n.toJSON(),startSelection:(r=this.startSelection)===null||r===void 0?void 0:r.toJSON(),selectionsAfter:this.selectionsAfter.map(s=>s.toJSON())}}static fromJSON(e){return new $n(e.changes&&Zt.fromJSON(e.changes),[],e.mapped&&Ii.fromJSON(e.mapped),e.startSelection&&Ce.fromJSON(e.startSelection),e.selectionsAfter.map(Ce.fromJSON))}static fromTransaction(e,n){let r=fi;for(let s of e.startState.facet(Sj)){let a=s(e);a.length&&(r=r.concat(a))}return!r.length&&e.changes.empty?null:new $n(e.changes.invert(e.startState.doc),r,void 0,n||e.startState.selection,fi)}static selection(e){return new $n(void 0,fi,void 0,void 0,e)}}function Lc(t,e,n,r){let s=e+1>n+20?e-n-1:0,a=t.slice(s,e);return a.push(r),a}function Nj(t,e){let n=[],r=!1;return t.iterChangedRanges((s,a)=>n.push(s,a)),e.iterChangedRanges((s,a,c,d)=>{for(let f=0;f<n.length;){let h=n[f++],g=n[f++];d>=h&&c<=g&&(r=!0)}}),r}function Tj(t,e){return t.ranges.length==e.ranges.length&&t.ranges.filter((n,r)=>n.empty!=e.ranges[r].empty).length===0}function Nx(t,e){return t.length?e.length?t.concat(e):t:e}const fi=[],jj=200;function Tx(t,e){if(t.length){let n=t[t.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-jj));return r.length&&r[r.length-1].eq(e)?t:(r.push(e),Lc(t,t.length-1,1e9,n.setSelAfter(r)))}else return[$n.selection([e])]}function Ej(t){let e=t[t.length-1],n=t.slice();return n[t.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),n}function Ah(t,e){if(!t.length)return t;let n=t.length,r=fi;for(;n;){let s=Oj(t[n-1],e,r);if(s.changes&&!s.changes.empty||s.effects.length){let a=t.slice(0,n);return a[n-1]=s,a}else e=s.mapped,n--,r=s.selectionsAfter}return r.length?[$n.selection(r)]:fi}function Oj(t,e,n){let r=Nx(t.selectionsAfter.length?t.selectionsAfter.map(d=>d.map(e)):fi,n);if(!t.changes)return $n.selection(r);let s=t.changes.map(e),a=e.mapDesc(t.changes,!0),c=t.mapped?t.mapped.composeDesc(a):a;return new $n(s,zt.mapEffects(t.effects,e),c,t.startSelection.map(a),r)}const Mj=/^(input\.type|delete)($|\.)/;class Xi{constructor(e,n,r=0,s=void 0){this.done=e,this.undone=n,this.prevTime=r,this.prevUserEvent=s}isolate(){return this.prevTime?new Xi(this.done,this.undone):this}addChanges(e,n,r,s,a){let c=this.done,d=c[c.length-1];return d&&d.changes&&!d.changes.empty&&e.changes&&(!r||Mj.test(r))&&(!d.selectionsAfter.length&&n-this.prevTime<s.newGroupDelay&&s.joinToEvent(a,Nj(d.changes,e.changes))||r=="input.type.compose")?c=Lc(c,c.length-1,s.minDepth,new $n(e.changes.compose(d.changes),Nx(zt.mapEffects(e.effects,d.changes),d.effects),d.mapped,d.startSelection,fi)):c=Lc(c,c.length,s.minDepth,e),new Xi(c,fi,n,r)}addSelection(e,n,r,s){let a=this.done.length?this.done[this.done.length-1].selectionsAfter:fi;return a.length>0&&n-this.prevTime<s&&r==this.prevUserEvent&&r&&/^select($|\.)/.test(r)&&Tj(a[a.length-1],e)?this:new Xi(Tx(this.done,e),this.undone,n,r)}addMapping(e){return new Xi(Ah(this.done,e),Ah(this.undone,e),this.prevTime,this.prevUserEvent)}pop(e,n,r){let s=e==0?this.done:this.undone;if(s.length==0)return null;let a=s[s.length-1],c=a.selectionsAfter[0]||(a.startSelection?a.startSelection.map(a.changes.invertedDesc,1):n.selection);if(r&&a.selectionsAfter.length)return n.update({selection:a.selectionsAfter[a.selectionsAfter.length-1],annotations:wh.of({side:e,rest:Ej(s),selection:c}),userEvent:e==0?"select.undo":"select.redo",scrollIntoView:!0});if(a.changes){let d=s.length==1?fi:s.slice(0,s.length-1);return a.mapped&&(d=Ah(d,a.mapped)),n.update({changes:a.changes,selection:a.startSelection,effects:a.effects,annotations:wh.of({side:e,rest:d,selection:c}),filter:!1,userEvent:e==0?"undo":"redo",scrollIntoView:!0})}else return null}}Xi.empty=new Xi(fi,fi);const jx=[{key:"Mod-z",run:Cx,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:Sh,preventDefault:!0},{linux:"Ctrl-Shift-z",run:Sh,preventDefault:!0},{key:"Mod-u",run:kj,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:Cj,preventDefault:!0}];function wl(t,e){return Ce.create(t.ranges.map(e),t.mainIndex)}function Mi(t,e){return t.update({selection:e,scrollIntoView:!0,userEvent:"select"})}function Ri({state:t,dispatch:e},n){let r=wl(t.selection,n);return r.eq(t.selection,!0)?!1:(e(Mi(t,r)),!0)}function Bc(t,e){return Ce.cursor(e?t.to:t.from)}function Ex(t,e){return Ri(t,n=>n.empty?t.moveByChar(n,e):Bc(n,e))}function kn(t){return t.textDirectionAt(t.state.selection.main.head)==Rt.LTR}const Ox=t=>Ex(t,!kn(t)),Mx=t=>Ex(t,kn(t));function Rx(t,e){return Ri(t,n=>n.empty?t.moveByGroup(n,e):Bc(n,e))}const Rj=t=>Rx(t,!kn(t)),Dj=t=>Rx(t,kn(t));function _j(t,e,n){if(e.type.prop(n))return!0;let r=e.to-e.from;return r&&(r>2||/[^\s,.;:]/.test(t.sliceDoc(e.from,e.to)))||e.firstChild}function $c(t,e,n){let r=Kr(t).resolveInner(e.head),s=n?mt.closedBy:mt.openedBy;for(let f=e.head;;){let h=n?r.childAfter(f):r.childBefore(f);if(!h)break;_j(t,h,s)?r=h:f=n?h.to:h.from}let a=r.type.prop(s),c,d;return a&&(c=n?vl(t,r.from,1):vl(t,r.to,-1))&&c.matched?d=n?c.end.to:c.end.from:d=n?r.to:r.from,Ce.cursor(d,n?-1:1)}const Lj=t=>Ri(t,e=>$c(t.state,e,!kn(t))),Bj=t=>Ri(t,e=>$c(t.state,e,kn(t)));function Dx(t,e){return Ri(t,n=>{if(!n.empty)return Bc(n,e);let r=t.moveVertically(n,e);return r.head!=n.head?r:t.moveToLineBoundary(n,e)})}const _x=t=>Dx(t,!1),Lx=t=>Dx(t,!0);function Bx(t){let e=t.scrollDOM.clientHeight<t.scrollDOM.scrollHeight-2,n=0,r=0,s;if(e){for(let a of t.state.facet(Ye.scrollMargins)){let c=a(t);c?.top&&(n=Math.max(c?.top,n)),c?.bottom&&(r=Math.max(c?.bottom,r))}s=t.scrollDOM.clientHeight-n-r}else s=(t.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:n,marginBottom:r,selfScroll:e,height:Math.max(t.defaultLineHeight,s-5)}}function $x(t,e){let n=Bx(t),{state:r}=t,s=wl(r.selection,c=>c.empty?t.moveVertically(c,e,n.height):Bc(c,e));if(s.eq(r.selection))return!1;let a;if(n.selfScroll){let c=t.coordsAtPos(r.selection.main.head),d=t.scrollDOM.getBoundingClientRect(),f=d.top+n.marginTop,h=d.bottom-n.marginBottom;c&&c.top>f&&c.bottom<h&&(a=Ye.scrollIntoView(s.main.head,{y:"start",yMargin:c.top-f}))}return t.dispatch(Mi(r,s),{effects:a}),!0}const qx=t=>$x(t,!1),kh=t=>$x(t,!0);function Yr(t,e,n){let r=t.lineBlockAt(e.head),s=t.moveToLineBoundary(e,n);if(s.head==e.head&&s.head!=(n?r.to:r.from)&&(s=t.moveToLineBoundary(e,n,!1)),!n&&s.head==r.from&&r.length){let a=/^\s*/.exec(t.state.sliceDoc(r.from,Math.min(r.from+100,r.to)))[0].length;a&&e.head!=r.from+a&&(s=Ce.cursor(r.from+a))}return s}const $j=t=>Ri(t,e=>Yr(t,e,!0)),qj=t=>Ri(t,e=>Yr(t,e,!1)),zj=t=>Ri(t,e=>Yr(t,e,!kn(t))),Hj=t=>Ri(t,e=>Yr(t,e,kn(t))),Ij=t=>Ri(t,e=>Ce.cursor(t.lineBlockAt(e.head).from,1)),Uj=t=>Ri(t,e=>Ce.cursor(t.lineBlockAt(e.head).to,-1));function Fj(t,e,n){let r=!1,s=wl(t.selection,a=>{let c=vl(t,a.head,-1)||vl(t,a.head,1)||a.head>0&&vl(t,a.head-1,1)||a.head<t.doc.length&&vl(t,a.head+1,-1);if(!c||!c.end)return a;r=!0;let d=c.start.from==a.head?c.end.to:c.end.from;return Ce.cursor(d)});return r?(e(Mi(t,s)),!0):!1}const Vj=({state:t,dispatch:e})=>Fj(t,e);function hi(t,e,n){let r=wl(t.state.selection,s=>{s.undirectional&&s.head>=s.anchor!=e&&(s=Ce.range(s.head,s.anchor));let a=n(s);return Ce.range(s.anchor,a.head,a.goalColumn,a.bidiLevel||void 0,a.assoc)});return r.eq(t.state.selection)?!1:(t.dispatch(Mi(t.state,r)),!0)}function zx(t,e){return hi(t,e,n=>t.moveByChar(n,e))}const Hx=t=>zx(t,!kn(t)),Ix=t=>zx(t,kn(t));function Ux(t,e){return hi(t,e,n=>t.moveByGroup(n,e))}const Pj=t=>Ux(t,!kn(t)),Kj=t=>Ux(t,kn(t)),Yj=t=>{let e=!kn(t);return hi(t,e,n=>$c(t.state,n,e))},Gj=t=>{let e=kn(t);return hi(t,e,n=>$c(t.state,n,e))};function Fx(t,e){return hi(t,e,n=>t.moveVertically(n,e))}const Vx=t=>Fx(t,!1),Px=t=>Fx(t,!0);function Kx(t,e){return hi(t,e,n=>t.moveVertically(n,e,Bx(t).height))}const Yx=t=>Kx(t,!1),Gx=t=>Kx(t,!0),Xj=t=>hi(t,!0,e=>Yr(t,e,!0)),Jj=t=>hi(t,!1,e=>Yr(t,e,!1)),Qj=t=>{let e=!kn(t);return hi(t,e,n=>Yr(t,n,e))},Wj=t=>{let e=kn(t);return hi(t,e,n=>Yr(t,n,e))},Zj=t=>hi(t,!1,e=>Ce.cursor(t.lineBlockAt(e.head).from)),eE=t=>hi(t,!0,e=>Ce.cursor(t.lineBlockAt(e.head).to)),Xx=({state:t,dispatch:e})=>(e(Mi(t,{anchor:0})),!0),Jx=({state:t,dispatch:e})=>(e(Mi(t,{anchor:t.doc.length})),!0),Qx=({state:t,dispatch:e})=>(e(Mi(t,{anchor:t.selection.main.anchor,head:0})),!0),Wx=({state:t,dispatch:e})=>(e(Mi(t,{anchor:t.selection.main.anchor,head:t.doc.length})),!0),tE=({state:t,dispatch:e})=>(e(t.update({selection:{anchor:0,head:t.doc.length},userEvent:"select"})),!0),nE=({state:t,dispatch:e})=>{let n=zc(t).map(({from:r,to:s})=>Ce.undirectionalRange(r,Math.min(s+1,t.doc.length)));return e(t.update({selection:Ce.create(n),userEvent:"select"})),!0},iE=({state:t,dispatch:e})=>{let n=wl(t.selection,r=>{let s=Kr(t),a=s.resolveStack(r.from,1);if(r.empty){let c=s.resolveStack(r.from,-1);c.node.from>=a.node.from&&c.node.to<=a.node.to&&(a=c)}for(let c=a;c;c=c.next){let{node:d}=c;if((d.from<r.from&&d.to>=r.to||d.to>r.to&&d.from<=r.from)&&c.next)return Ce.undirectionalRange(d.from,d.to)}return r});return n.eq(t.selection)?!1:(e(Mi(t,n)),!0)};function Zx(t,e){let{state:n}=t,r=n.selection,s=n.selection.ranges.slice();for(let a of n.selection.ranges){let c=n.doc.lineAt(a.head);if(e?c.to<t.state.doc.length:c.from>0)for(let d=a;;){let f=t.moveVertically(d,e);if(f.head<c.from||f.head>c.to){s.some(h=>h.head==f.head)||s.push(f);break}else{if(f.head==d.head)break;d=f}}}return s.length==r.ranges.length?!1:(t.dispatch(Mi(n,Ce.create(s,s.length-1))),!0)}const rE=t=>Zx(t,!1),sE=t=>Zx(t,!0),lE=({state:t,dispatch:e})=>{let n=t.selection,r=null;return n.ranges.length>1?r=Ce.create([n.main]):n.main.empty||(r=Ce.create([Ce.cursor(n.main.head)])),r?(e(Mi(t,r)),!0):!1};function La(t,e){if(t.state.readOnly)return!1;let n="delete.selection",{state:r}=t,s=r.changeByRange(a=>{let{from:c,to:d}=a;if(c==d){let f=e(a);f<c?(n="delete.backward",f=qc(t,f,!1)):f>c&&(n="delete.forward",f=qc(t,f,!0)),c=Math.min(c,f),d=Math.max(d,f)}else c=qc(t,c,!1),d=qc(t,d,!0);return c==d?{range:a}:{changes:{from:c,to:d},range:Ce.cursor(c,c<a.head?-1:1)}});return s.changes.empty?!1:(t.dispatch(r.update(s,{scrollIntoView:!0,userEvent:n,effects:n=="delete.selection"?Ye.announce.of(r.phrase("Selection deleted")):void 0})),!0)}function qc(t,e,n){if(t instanceof Ye)for(let r of t.state.facet(Ye.atomicRanges).map(s=>s(t)))r.between(e,e,(s,a)=>{s<e&&a>e&&(e=n?a:s)});return e}const ev=(t,e,n)=>La(t,r=>{let s=r.from,{state:a}=t,c=a.doc.lineAt(s),d,f;if(n&&!e&&s>c.from&&s<c.from+200&&!/[^ \t]/.test(d=c.text.slice(0,s-c.from))){if(d[d.length-1]==" ")return s-1;let h=Yo(d,a.tabSize),g=h%Mc(a)||Mc(a);for(let b=0;b<g&&d[d.length-1-b]==" ";b++)s--;f=s}else f=Sn(c.text,s-c.from,e,e)+c.from,f==s&&c.number!=(e?a.doc.lines:1)?f+=e?1:-1:!e&&/[\ufe00-\ufe0f]/.test(c.text.slice(f-c.from,s-c.from))&&(f=Sn(c.text,f-c.from,!1,!1)+c.from);return f}),Ch=t=>ev(t,!1,!0),tv=t=>ev(t,!0,!1),nv=(t,e)=>La(t,n=>{let r=n.head,{state:s}=t,a=s.doc.lineAt(r),c=s.charCategorizer(r);for(let d=null;;){if(r==(e?a.to:a.from)){r==n.head&&a.number!=(e?s.doc.lines:1)&&(r+=e?1:-1);break}let f=Sn(a.text,r-a.from,e)+a.from,h=a.text.slice(Math.min(r,f)-a.from,Math.max(r,f)-a.from),g=c(h);if(d!=null&&g!=d)break;(h!=" "||r!=n.head)&&(d=g),r=f}return r}),iv=t=>nv(t,!1),aE=t=>nv(t,!0),oE=t=>La(t,e=>{let n=t.lineBlockAt(e.head).to;return e.head<n?n:Math.min(t.state.doc.length,e.head+1)}),cE=t=>La(t,e=>{let n=t.moveToLineBoundary(e,!1).head;return e.head>n?n:Math.max(0,e.head-1)}),uE=t=>La(t,e=>{let n=t.moveToLineBoundary(e,!0).head;return e.head<n?n:Math.min(t.state.doc.length,e.head+1)}),dE=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=t.changeByRange(r=>({changes:{from:r.from,to:r.to,insert:pt.of(["",""])},range:Ce.cursor(r.from)}));return e(t.update(n,{scrollIntoView:!0,userEvent:"input"})),!0},fE=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=t.changeByRange(r=>{if(!r.empty||r.from==0||r.from==t.doc.length)return{range:r};let s=r.from,a=t.doc.lineAt(s),c=s==a.from?s-1:Sn(a.text,s-a.from,!1)+a.from,d=s==a.to?s+1:Sn(a.text,s-a.from,!0)+a.from;return{changes:{from:c,to:d,insert:t.doc.slice(s,d).append(t.doc.slice(c,s))},range:Ce.cursor(d)}});return n.changes.empty?!1:(e(t.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function zc(t){let e=[],n=-1;for(let r of t.selection.ranges){let s=t.doc.lineAt(r.from),a=t.doc.lineAt(r.to);if(!r.empty&&r.to==a.from&&(a=t.doc.lineAt(r.to-1)),n>=s.number){let c=e[e.length-1];c.to=a.to,c.ranges.push(r)}else e.push({from:s.from,to:a.to,ranges:[r]});n=a.number+1}return e}function rv(t,e,n){if(t.readOnly)return!1;let r=[],s=[];for(let a of zc(t)){if(n?a.to==t.doc.length:a.from==0)continue;let c=t.doc.lineAt(n?a.to+1:a.from-1),d=c.length+1;if(n){r.push({from:a.to,to:c.to},{from:a.from,insert:c.text+t.lineBreak});for(let f of a.ranges)s.push(Ce.range(Math.min(t.doc.length,f.anchor+d),Math.min(t.doc.length,f.head+d)))}else{r.push({from:c.from,to:a.from},{from:a.to,insert:t.lineBreak+c.text});for(let f of a.ranges)s.push(Ce.range(f.anchor-d,f.head-d))}}return r.length?(e(t.update({changes:r,scrollIntoView:!0,selection:Ce.create(s,t.selection.mainIndex),userEvent:"move.line"})),!0):!1}const hE=({state:t,dispatch:e})=>rv(t,e,!1),pE=({state:t,dispatch:e})=>rv(t,e,!0);function sv(t,e,n){if(t.readOnly)return!1;let r=[];for(let a of zc(t))n?r.push({from:a.from,insert:t.doc.slice(a.from,a.to)+t.lineBreak}):r.push({from:a.to,insert:t.lineBreak+t.doc.slice(a.from,a.to)});let s=t.changes(r);return e(t.update({changes:s,selection:t.selection.map(s,n?1:-1),scrollIntoView:!0,userEvent:"input.copyline"})),!0}const mE=({state:t,dispatch:e})=>sv(t,e,!1),gE=({state:t,dispatch:e})=>sv(t,e,!0),yE=t=>{if(t.state.readOnly)return!1;let{state:e}=t,n=e.changes(zc(e).map(({from:s,to:a})=>(s>0?s--:a<e.doc.length&&a++,{from:s,to:a}))),r=wl(e.selection,s=>{let a;if(t.lineWrapping){let c=t.lineBlockAt(s.head),d=t.coordsAtPos(s.head,s.assoc||1);d&&(a=c.bottom+t.documentTop-d.bottom+t.defaultLineHeight/2)}return t.moveVertically(s,!0,a)}).map(n);return t.dispatch({changes:n,selection:r,scrollIntoView:!0,userEvent:"delete.line"}),!0};function bE(t,e){if(/\(\)|\[\]|\{\}/.test(t.sliceDoc(e-1,e+1)))return{from:e,to:e};let n=Kr(t).resolveInner(e),r=n.childBefore(e),s=n.childAfter(e),a;return r&&s&&r.to<=e&&s.from>=e&&(a=r.type.prop(mt.closedBy))&&a.indexOf(s.name)>-1&&t.doc.lineAt(r.to).from==t.doc.lineAt(s.from).from&&!/\S/.test(t.sliceDoc(r.to,s.from))?{from:r.to,to:s.from}:null}const lv=av(!1),xE=av(!0);function av(t){return({state:e,dispatch:n})=>{if(e.readOnly)return!1;let r=e.changeByRange(s=>{let{from:a,to:c}=s,d=e.doc.lineAt(a),f=!t&&a==c&&bE(e,a);t&&(a=c=(c<=d.to?d:e.doc.lineAt(c)).to);let h=new Dc(e,{simulateBreak:a,simulateDoubleBreak:!!f}),g=yx(h,a);for(g==null&&(g=Yo(/^\s*/.exec(e.doc.lineAt(a).text)[0],e.tabSize));c<d.to&&/\s/.test(d.text[c-d.from]);)c++;f?{from:a,to:c}=f:a>d.from&&a<d.from+100&&!/\S/.test(d.text.slice(0,a))&&(a=d.from);let b=["",Rc(e,g)];return f&&b.push(Rc(e,h.lineIndent(d.from,-1))),{changes:{from:a,to:c,insert:pt.of(b)},range:Ce.cursor(a+1+b[1].length)}});return n(e.update(r,{scrollIntoView:!0,userEvent:"input"})),!0}}function Nh(t,e){let n=-1;return t.changeByRange(r=>{let s=[];for(let c=r.from;c<=r.to;){let d=t.doc.lineAt(c);d.number>n&&(r.empty||r.to>d.from)&&(e(d,s,r),n=d.number),c=d.to+1}let a=t.changes(s);return{changes:s,range:Ce.range(a.mapPos(r.anchor,1),a.mapPos(r.head,1))}})}const vE=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=Object.create(null),r=new Dc(t,{overrideIndentation:a=>{let c=n[a];return c??-1}}),s=Nh(t,(a,c,d)=>{let f=yx(r,a.from);if(f==null)return;/\S/.test(a.text)||(f=0);let h=/^\s*/.exec(a.text)[0],g=Rc(t,f);(h!=g||d.from<a.from+h.length)&&(n[a.from]=f,c.push({from:a.from,to:a.from+h.length,insert:g}))});return s.changes.empty||e(t.update(s,{userEvent:"indent"})),!0},ov=({state:t,dispatch:e})=>t.readOnly?!1:(e(t.update(Nh(t,(n,r)=>{r.push({from:n.from,insert:t.facet(ph)})}),{userEvent:"input.indent"})),!0),cv=({state:t,dispatch:e})=>t.readOnly?!1:(e(t.update(Nh(t,(n,r)=>{let s=/^\s*/.exec(n.text)[0];if(!s)return;let a=Yo(s,t.tabSize),c=0,d=Rc(t,Math.max(0,a-Mc(t)));for(;c<s.length&&c<d.length&&s.charCodeAt(c)==d.charCodeAt(c);)c++;r.push({from:n.from+c,to:n.from+s.length,insert:d.slice(c)})}),{userEvent:"delete.dedent"})),!0),wE=t=>(t.setTabFocusMode(),!0),SE=[{key:"Ctrl-b",run:Ox,shift:Hx,preventDefault:!0},{key:"Ctrl-f",run:Mx,shift:Ix},{key:"Ctrl-p",run:_x,shift:Vx},{key:"Ctrl-n",run:Lx,shift:Px},{key:"Ctrl-a",run:Ij,shift:Zj},{key:"Ctrl-e",run:Uj,shift:eE},{key:"Ctrl-d",run:tv},{key:"Ctrl-h",run:Ch},{key:"Ctrl-k",run:oE},{key:"Ctrl-Alt-h",run:iv},{key:"Ctrl-o",run:dE},{key:"Ctrl-t",run:fE},{key:"Ctrl-v",run:kh}],AE=[{key:"ArrowLeft",run:Ox,shift:Hx,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:Rj,shift:Pj,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:zj,shift:Qj,preventDefault:!0},{key:"ArrowRight",run:Mx,shift:Ix,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:Dj,shift:Kj,preventDefault:!0},{mac:"Cmd-ArrowRight",run:Hj,shift:Wj,preventDefault:!0},{key:"ArrowUp",run:_x,shift:Vx,preventDefault:!0},{mac:"Cmd-ArrowUp",run:Xx,shift:Qx},{mac:"Ctrl-ArrowUp",run:qx,shift:Yx},{key:"ArrowDown",run:Lx,shift:Px,preventDefault:!0},{mac:"Cmd-ArrowDown",run:Jx,shift:Wx},{mac:"Ctrl-ArrowDown",run:kh,shift:Gx},{key:"PageUp",run:qx,shift:Yx},{key:"PageDown",run:kh,shift:Gx},{key:"Home",run:qj,shift:Jj,preventDefault:!0},{key:"Mod-Home",run:Xx,shift:Qx},{key:"End",run:$j,shift:Xj,preventDefault:!0},{key:"Mod-End",run:Jx,shift:Wx},{key:"Enter",run:lv,shift:lv},{key:"Mod-a",run:tE},{key:"Backspace",run:Ch,shift:Ch,preventDefault:!0},{key:"Delete",run:tv,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:iv,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:aE,preventDefault:!0},{mac:"Mod-Backspace",run:cE,preventDefault:!0},{mac:"Mod-Delete",run:uE,preventDefault:!0}].concat(SE.map(t=>({mac:t.key,run:t.run,shift:t.shift}))),uv=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:Lj,shift:Yj},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:Bj,shift:Gj},{key:"Alt-ArrowUp",run:hE},{key:"Shift-Alt-ArrowUp",run:mE},{key:"Alt-ArrowDown",run:pE},{key:"Shift-Alt-ArrowDown",run:gE},{key:"Mod-Alt-ArrowUp",run:rE},{key:"Mod-Alt-ArrowDown",run:sE},{key:"Escape",run:lE},{key:"Mod-Enter",run:xE},{key:"Alt-l",mac:"Ctrl-l",run:nE},{key:"Mod-i",run:iE,preventDefault:!0},{key:"Mod-[",run:cv},{key:"Mod-]",run:ov},{key:"Mod-Alt-\\",run:vE},{key:"Shift-Mod-k",run:yE},{key:"Shift-Mod-\\",run:Vj},{key:"Mod-/",run:pj},{key:"Alt-A",mac:"Ctrl-A",run:gj},{key:"Ctrl-m",mac:"Shift-Alt-m",run:wE}].concat(AE),kE={key:"Tab",run:ov,shift:cv};function dv({ariaLabel:t,dataTestId:e,ariaControls:n,ariaActiveDescendant:r,ariaAutocomplete:s,ariaExpanded:a}){const c={"aria-label":t,"aria-multiline":"true",role:"textbox",spellcheck:"false"};return e&&(c["data-testid"]=e),n&&(c["aria-controls"]=n),r&&(c["aria-activedescendant"]=r),s&&(c["aria-autocomplete"]=s),a!==void 0&&(c["aria-expanded"]=String(a)),c}function fv(t){const e=t==="dark";return Ye.theme({"&":{height:"100%",backgroundColor:e?"#030712":"#ffffff",color:e?"#f3f4f6":"#111827"},"&.cm-focused":{outline:"none"},".cm-scroller":{fontFamily:'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace',fontSize:"12px",lineHeight:"24px",overflow:"auto"},".cm-content":{minHeight:"100%",padding:"8px 12px",caretColor:e?"#f9fafb":"#111827"},".cm-line":{padding:"0"},".cm-cursor, .cm-dropCursor":{borderLeftColor:e?"#f9fafb":"#111827"},".cm-gutters":{backgroundColor:e?"#111827":"#f9fafb",color:e?"#6b7280":"#9ca3af",borderRight:`1px solid ${e?"#1f2937":"#e5e7eb"}`},".cm-activeLine":{backgroundColor:e?"#11182780":"#f3f4f680"},".cm-activeLineGutter":{backgroundColor:e?"#1f2937":"#f3f4f6"},"&.cm-focused .cm-selectionBackground, .cm-selectionBackground, ::selection":{backgroundColor:e?"#1d4ed880":"#bfdbfe"}},{dark:e})}const CE={key:"Enter",run:t=>(t.dispatch(t.state.replaceSelection(`
|
|
59
|
+
`)),!0)};function hv(t){const e=uv.filter(n=>n.key!=="Enter");return Pb.of(t?[...uv,...jx,kE]:[CE,...e,...jx])}const Ba=I.forwardRef(({ariaLabel:t,value:e,onChange:n,language:r="text",theme:s="light",minLines:a=7,maxLines:c=16,dataTestId:d,wrap:f=!1,autoIndent:h=!1,ariaControls:g,ariaActiveDescendant:b,ariaAutocomplete:v,ariaExpanded:S,onEditorKeyDown:A,onCursorChange:C},T)=>{const D=I.useRef(null),j=I.useRef(null),E=I.useRef(n),O=I.useRef(C),R=I.useRef(A),B=I.useRef(!1),M=I.useRef({value:e,theme:s,wrap:f,autoIndent:h,ariaLabel:t,dataTestId:d,ariaControls:g,ariaActiveDescendant:b,ariaAutocomplete:v,ariaExpanded:S}),z=I.useMemo(()=>new tr,[]),F=I.useMemo(()=>new tr,[]),X=I.useMemo(()=>new tr,[]),W=I.useMemo(()=>new tr,[]),G=I.useMemo(()=>new tr,[]);E.current=n,O.current=C,R.current=A,I.useImperativeHandle(T,()=>({focus:()=>j.current?.focus(),getSelection:()=>{const ee=j.current?.state.selection.main;return ee?{from:ee.from,to:ee.to}:{from:0,to:0}},setSelection:(ee,he=ee)=>{const $=j.current;if(!$)return;const te=$.state.doc.length,L=Math.max(0,Math.min(ee,te)),P=Math.max(0,Math.min(he,te));$.dispatch({selection:{anchor:L,head:P},scrollIntoView:!0}),$.focus(),O.current?.(L)},coordsAtPos:ee=>{const he=j.current;if(!he)return null;const $=Math.max(0,Math.min(ee,he.state.doc.length)),te=he.coordsAtPos($);return te?{left:te.left,right:te.right,top:te.top,bottom:te.bottom}:null}}),[]),I.useEffect(()=>{if(!D.current||j.current)return;const ee=M.current,he=vt.create({doc:ee.value,extensions:[Aj(),mT(),z.of(fv(ee.theme)),F.of(ee.wrap?Ye.lineWrapping:[]),X.of(ee.wrap?[]:[ix(),sx(),Wb()]),W.of(hv(ee.autoIndent)),G.of(Ye.contentAttributes.of(dv(ee))),Uo.highest(Ye.domEventHandlers({keydown:te=>(R.current?.(te),te.defaultPrevented)})),Ye.updateListener.of(te=>{te.docChanged&&!B.current&&E.current(te.state.doc.toString()),(te.selectionSet||te.docChanged)&&O.current?.(te.state.selection.main.head)})]}),$=new Ye({state:he,parent:D.current});return j.current=$,()=>{$.destroy(),j.current=null}},[G,X,W,z,F]),I.useEffect(()=>{const ee=j.current;if(!ee||ee.state.doc.toString()===e)return;const he=ee.state.selection.main;B.current=!0,ee.dispatch({changes:{from:0,to:ee.state.doc.length,insert:e},selection:{anchor:Math.min(he.anchor,e.length),head:Math.min(he.head,e.length)}}),B.current=!1},[e]),I.useEffect(()=>{j.current?.dispatch({effects:z.reconfigure(fv(s))})},[s,z]),I.useEffect(()=>{j.current?.dispatch({effects:F.reconfigure(f?Ye.lineWrapping:[])}),j.current?.dispatch({effects:X.reconfigure(f?[]:[ix(),sx(),Wb()])})},[X,f,F]),I.useEffect(()=>{j.current?.dispatch({effects:W.reconfigure(hv(h))})},[h,W]),I.useEffect(()=>{j.current?.dispatch({effects:G.reconfigure(Ye.contentAttributes.of(dv({ariaLabel:t,dataTestId:d,ariaControls:g,ariaActiveDescendant:b,ariaAutocomplete:v,ariaExpanded:S})))})},[b,v,g,S,t,G,d]);const we=Math.max(1,e.split(`
|
|
60
|
+
`).length),xe=Math.min(c,Math.max(a,we))*24+16,_=s==="dark";return p.jsx("div",{className:`api-client-code-editor min-w-0 overflow-hidden rounded-md border focus-within:ring-2 focus-within:ring-inset focus-within:ring-blue-500 ${_?"border-gray-700 bg-gray-950":"border-gray-300 bg-white"}`,"data-editor":"codemirror","data-language":r,"data-wrap":f?"soft":"off",style:{height:xe},children:p.jsx("div",{ref:D,className:"h-full min-w-0"})})});Ba.displayName="ApiClientCodeEditor";const pv=()=>({key:"",value:"",enabled:!0}),Th=()=>({key:"",value:"",enabled:!0,type:"text"}),mv=[["application/json","JSON — application/json"],["application/problem+json","Problem JSON — application/problem+json"],["application/ld+json","JSON-LD — application/ld+json"],["text/plain","Text — text/plain"],["application/xml","XML — application/xml"],["text/html","HTML — text/html"],["application/javascript","JavaScript — application/javascript"],["application/octet-stream","Binary — application/octet-stream"]];function NE(t){const e=(t||"").toLowerCase();return e.includes("json")?"json":e.includes("xml")?"xml":e.includes("html")?"html":e.includes("javascript")?"javascript":"text"}function TE({label:t,entries:e,onChange:n,inputClass:r}){const s=(a,c)=>n(e.map((d,f)=>f===a?{...d,...c}:d));return p.jsxs("div",{className:"space-y-2",children:[e.map((a,c)=>p.jsxs("div",{className:"grid grid-cols-[auto_1fr_1fr_auto] items-center gap-2",children:[p.jsx("input",{"aria-label":`${t} ${c+1} enabled`,type:"checkbox",checked:a.enabled!==!1,onChange:d=>s(c,{enabled:d.target.checked})}),p.jsx("input",{"aria-label":`${t} ${c+1} key`,className:`min-w-0 rounded-md border px-3 py-2 text-sm ${r}`,placeholder:"Key",value:a.key,onChange:d=>s(c,{key:d.target.value})}),p.jsx("input",{"aria-label":`${t} ${c+1} value`,className:`min-w-0 rounded-md border px-3 py-2 text-sm ${r}`,placeholder:"Value",value:a.value,onChange:d=>s(c,{value:d.target.value})}),p.jsx("button",{type:"button","aria-label":`Remove ${t.toLowerCase()} ${c+1}`,className:"rounded-md border p-2",onClick:()=>n(e.filter((d,f)=>f!==c)),children:p.jsx(si,{className:"h-4 w-4"})})]},c)),p.jsxs("button",{type:"button",className:"inline-flex items-center gap-2 rounded-md border px-3 py-2 text-xs",onClick:()=>n([...e,pv()]),children:[p.jsx(ks,{className:"h-3.5 w-3.5"})," Add field"]})]})}const jE=({draft:t,onChange:e,theme:n="light"})=>{const r=t.bodyMode||ca(t),s=n==="dark",a=s?"border-gray-700 bg-gray-900 text-gray-100":"border-gray-300 bg-white text-gray-900",d=mv.some(([v])=>v===t.contentType)?t.contentType||"application/json":"__custom__",f=I.useMemo(()=>{if(r!=="json"||!(t.body||"").trim())return null;try{return JSON.parse(t.body||""),""}catch(v){return v instanceof Error?v.message:"Invalid JSON"}},[t.body,r]),h=I.useMemo(()=>{const v=t.graphql?.variables?.trim();if(r!=="graphql"||!v)return null;try{return JSON.parse(v),""}catch(S){return S instanceof Error?S.message:"Invalid JSON"}},[t.graphql?.variables,r]),g=v=>{const S={bodyMode:v};v==="json"&&(!t.contentType||!t.contentType.includes("json"))&&(S.contentType="application/json"),v==="raw"&&!t.contentType&&(S.contentType="text/plain"),v==="urlencoded"&&(S.contentType="application/x-www-form-urlencoded"),v==="formdata"&&(S.contentType=void 0),v==="binary"&&!t.contentType&&(S.contentType="application/octet-stream"),v==="graphql"&&(S.contentType="application/json"),e({...t,...S})},b=(v,S)=>{const A=t.formData||[Th()];e({...t,formData:A.map((C,T)=>T===v?{...C,...S}:C)})};return p.jsxs("section",{className:"space-y-3","aria-labelledby":"api-client-body-heading",children:[p.jsxs("div",{className:"flex flex-wrap items-end justify-between gap-3",children:[p.jsxs("label",{className:"text-sm font-medium",children:["Body type",p.jsxs("select",{"aria-label":"Request body type",className:`ml-2 rounded-md border px-3 py-2 text-sm ${a}`,value:r,onChange:v=>g(v.target.value),children:[p.jsx("option",{value:"none",children:"None"}),p.jsx("option",{value:"json",children:"JSON"}),p.jsx("option",{value:"raw",children:"Raw"}),p.jsx("option",{value:"urlencoded",children:"x-www-form-urlencoded"}),p.jsx("option",{value:"formdata",children:"form-data"}),p.jsx("option",{value:"binary",children:"Binary"}),p.jsx("option",{value:"graphql",children:"GraphQL"})]})]}),(r==="json"||r==="raw"||r==="binary")&&p.jsxs("div",{className:"flex flex-wrap items-end gap-2",children:[p.jsxs("label",{className:"text-sm font-medium",children:["Content type",p.jsxs("select",{"aria-label":"Content type",className:`ml-2 rounded-md border px-3 py-2 text-sm ${a}`,value:d,onChange:v=>{const S=v.target.value==="__custom__"?"":v.target.value;e({...t,contentType:S})},children:[mv.map(([v,S])=>p.jsx("option",{value:v,children:S},v)),p.jsx("option",{value:"__custom__",children:"Custom…"})]})]}),d==="__custom__"&&p.jsx("input",{"aria-label":"Custom content type",className:`rounded-md border px-3 py-2 text-sm ${a}`,placeholder:"application/vnd.example+json",value:t.contentType||"",onChange:v=>e({...t,contentType:v.target.value})})]})]}),r==="none"&&p.jsx("div",{className:`rounded-md border border-dashed p-4 text-sm ${s?"border-gray-700 text-gray-400":"border-gray-300 text-gray-500"}`,children:"This request has no body."}),(r==="json"||r==="raw")&&p.jsxs("div",{className:"space-y-2",children:[p.jsx(Ba,{ariaLabel:"Request body",language:r==="json"?"json":NE(t.contentType),theme:n,value:t.body||"",onChange:v=>e({...t,body:v}),minLines:9,maxLines:20}),p.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[p.jsx("span",{className:`text-xs ${f?"text-red-600":r==="json"&&f===""?"text-green-600":s?"text-gray-400":"text-gray-500"}`,children:r==="json"?f?`Invalid JSON: ${f}`:(t.body||"").trim()?"Valid JSON":"Enter a JSON object, array, or value.":"Raw body is sent exactly as entered."}),r==="json"&&p.jsx("button",{type:"button",className:"rounded-md border px-3 py-1.5 text-xs",disabled:!!f||!(t.body||"").trim(),onClick:()=>{try{e({...t,body:JSON.stringify(JSON.parse(t.body||""),null,2)})}catch{}},children:"Beautify JSON"})]})]}),r==="urlencoded"&&p.jsxs("div",{className:"space-y-2",children:[p.jsx(TE,{label:"Form field",entries:t.urlencoded?.length?t.urlencoded:[pv()],inputClass:a,onChange:v=>e({...t,urlencoded:v,contentType:"application/x-www-form-urlencoded"})}),p.jsx("p",{className:`text-xs ${s?"text-gray-400":"text-gray-500"}`,children:"Enabled fields are URL-encoded at send time. Variable substitution still applies to keys and values."})]}),r==="formdata"&&p.jsxs("div",{className:"space-y-2",children:[(t.formData?.length?t.formData:[Th()]).map((v,S)=>p.jsxs("div",{className:"grid gap-2 md:grid-cols-[auto_7rem_1fr_1fr_auto]",children:[p.jsx("input",{"aria-label":`Form data ${S+1} enabled`,type:"checkbox",checked:v.enabled!==!1,onChange:A=>b(S,{enabled:A.target.checked})}),p.jsxs("select",{"aria-label":`Form data ${S+1} type`,className:`rounded-md border px-2 py-2 text-sm ${a}`,value:v.type||"text",onChange:A=>b(S,{type:A.target.value,file:void 0,fileName:void 0}),children:[p.jsx("option",{value:"text",children:"Text"}),p.jsx("option",{value:"file",children:"File"})]}),p.jsx("input",{"aria-label":`Form data ${S+1} key`,className:`min-w-0 rounded-md border px-3 py-2 text-sm ${a}`,placeholder:"Key",value:v.key,onChange:A=>b(S,{key:A.target.value})}),v.type==="file"?p.jsxs("label",{className:`flex min-w-0 cursor-pointer items-center rounded-md border px-3 py-2 text-sm ${a}`,children:[p.jsx("span",{className:"truncate",children:v.file?.name||v.fileName||"Choose file…"}),p.jsx("input",{"aria-label":`Form data ${S+1} file`,className:"sr-only",type:"file",onChange:A=>{const C=A.target.files?.[0];b(S,{file:C,fileName:C?.name,contentType:C?.type||void 0})}})]}):p.jsx("input",{"aria-label":`Form data ${S+1} value`,className:`min-w-0 rounded-md border px-3 py-2 text-sm ${a}`,placeholder:"Value",value:v.value,onChange:A=>b(S,{value:A.target.value})}),p.jsx("button",{type:"button","aria-label":`Remove form data ${S+1}`,className:"rounded-md border p-2",onClick:()=>e({...t,formData:(t.formData||[]).filter((A,C)=>C!==S)}),children:p.jsx(si,{className:"h-4 w-4"})})]},S)),p.jsxs("button",{type:"button",className:"inline-flex items-center gap-2 rounded-md border px-3 py-2 text-xs",onClick:()=>e({...t,formData:[...t.formData||[],Th()]}),children:[p.jsx(ks,{className:"h-3.5 w-3.5"})," Add form-data field"]}),p.jsx("p",{className:`text-xs ${s?"text-gray-400":"text-gray-500"}`,children:"The browser supplies the multipart boundary automatically. Imported Postman file paths must be re-selected from this browser."})]}),r==="binary"&&p.jsxs("div",{className:"space-y-2",children:[p.jsxs("label",{className:`flex cursor-pointer items-center justify-between gap-3 rounded-md border px-3 py-3 text-sm ${a}`,children:[p.jsx("span",{className:"min-w-0 truncate",children:t.binary?.file?.name||t.binary?.fileName||"Choose binary file…"}),p.jsx("span",{className:"shrink-0 text-xs font-medium",children:"Browse"}),p.jsx("input",{"aria-label":"Binary file",className:"sr-only",type:"file",onChange:v=>{const S=v.target.files?.[0];e({...t,contentType:S?.type||t.contentType||"application/octet-stream",binary:{file:S,fileName:S?.name||t.binary?.fileName,contentType:S?.type||t.binary?.contentType}})}})]}),p.jsx("p",{className:`text-xs ${s?"text-gray-400":"text-gray-500"}`,children:"The selected file is sent as the request body without text conversion. Saved requests retain only file metadata, so the browser asks you to re-select the file before a later send or collection run."})]}),r==="graphql"&&p.jsxs("div",{className:"grid gap-3 xl:grid-cols-2",children:[p.jsxs("div",{className:"space-y-1",children:[p.jsx("div",{className:"text-xs font-medium",children:"Query"}),p.jsx(Ba,{ariaLabel:"GraphQL query",language:"graphql",theme:n,value:t.graphql?.query||"",onChange:v=>e({...t,graphql:{query:v,variables:t.graphql?.variables||""}}),minLines:9,maxLines:20})]}),p.jsxs("div",{className:"space-y-1",children:[p.jsx("div",{className:"text-xs font-medium",children:"Variables (JSON)"}),p.jsx(Ba,{ariaLabel:"GraphQL variables",language:"json",theme:n,value:t.graphql?.variables||"",onChange:v=>e({...t,graphql:{query:t.graphql?.query||"",variables:v}}),minLines:9,maxLines:20}),p.jsx("div",{className:`text-xs ${h?"text-red-600":s?"text-gray-400":"text-gray-500"}`,children:h?`Invalid variables JSON: ${h}`:"Variables are serialized with the query as application/json."})]})]})]})};function EE(t,e){return t.find(([n])=>n.toLowerCase()===e.toLowerCase())?.[1]||""}function OE(t,e){const n=e.toLowerCase();if(n.includes("json"))try{return{body:JSON.stringify(JSON.parse(t),null,2),language:"json"}}catch{return{body:t,language:"json",invalidJson:!0}}return n.includes("html")?{body:t,language:"markup"}:n.includes("xml")?{body:t,language:"markup"}:n.includes("javascript")?{body:t,language:"javascript"}:{body:t,language:"text"}}function ME(t,e){const n=e.trim().toLowerCase();if(!n)return 0;let r=0,s=0;const a=t.toLowerCase();for(;s<a.length;){const c=a.indexOf(n,s);if(c<0)break;r+=1,s=c+Math.max(1,n.length)}return r}function RE(t,e){const n=e.trim().toLowerCase();return n?t.split(`
|
|
61
|
+
`).filter(s=>s.toLowerCase().includes(n)).join(`
|
|
62
|
+
`):t}const DE=({response:t,theme:e="light",curlCommand:n,advanced:r=!0})=>{const[s,a]=I.useState("pretty"),[c,d]=I.useState(""),[f,h]=I.useState(!1),[g,b]=I.useState(""),[v,S]=I.useState(!1),A=EE(t.headers,"content-type"),C=I.useMemo(()=>OE(t.body,A),[A,t.body]),T=/(?:text\/html|application\/xhtml\+xml)/i.test(A),D=I.useMemo(()=>new TextEncoder().encode(t.body).byteLength,[t.body]),j=e==="dark",E=r?s:"pretty",O=E==="pretty"?C.body:t.body,R=I.useMemo(()=>ME(O,c),[c,O]),B=I.useMemo(()=>f?RE(O,c):O,[c,O,f]),M=g.trim().toLowerCase(),z=t.headers.filter(([G,we])=>!M||`${G}: ${we}`.toLowerCase().includes(M)),F=j?"border-gray-700 bg-gray-900 text-gray-100":"border-gray-300 bg-white text-gray-900",X=j?"text-gray-400":"text-gray-500",W=async()=>{if(!(!n||typeof navigator>"u"||!navigator.clipboard?.writeText))try{await navigator.clipboard.writeText(n),S(!0),window.setTimeout(()=>S(!1),1500)}catch{S(!1)}};return p.jsxs("section",{className:"space-y-3","aria-labelledby":"api-client-response-heading",children:[p.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[p.jsxs("div",{id:"api-client-response-heading",className:"font-semibold",children:["Response ",p.jsxs("span",{className:t.status>=400?j?"text-red-300":"text-red-600":j?"text-green-300":"text-green-600",children:[t.status," ",t.statusText]})]}),p.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[p.jsxs("div",{className:`flex flex-wrap gap-3 text-xs ${X}`,children:[p.jsxs("span",{children:[t.responseTime," ms"]}),p.jsxs("span",{children:[D.toLocaleString()," B"]}),A&&p.jsx("span",{className:"font-mono",children:A.split(";")[0]})]}),n&&p.jsx("button",{type:"button",className:`rounded-md border px-2.5 py-1.5 text-xs font-medium ${j?"border-gray-700 bg-gray-900 text-gray-200 hover:bg-gray-800":"border-gray-300 bg-white text-gray-700 hover:bg-gray-50"}`,onClick:()=>{W()},"aria-label":"Copy request as cURL",children:v?"Copied cURL":"Copy as cURL"})]})]}),r&&p.jsxs("div",{className:`flex w-fit overflow-hidden rounded-md border ${j?"border-gray-700":"border-gray-300"}`,role:"group","aria-label":"Response body view",children:[["pretty","raw"].map(G=>{const we=G==="pretty"?"Pretty":"Raw";return p.jsx("button",{type:"button","aria-label":we,"aria-pressed":s===G,className:`px-3 py-1.5 text-xs font-medium ${s===G?"bg-blue-600 text-white":j?"bg-gray-900 text-gray-300":"bg-white text-gray-700"}`,onClick:()=>a(G),children:we},G)}),p.jsx("button",{type:"button",disabled:!T,"aria-pressed":s==="preview",className:`px-3 py-1.5 text-xs font-medium ${s==="preview"?"bg-blue-600 text-white":j?"bg-gray-900 text-gray-300":"bg-white text-gray-700"} disabled:cursor-not-allowed disabled:opacity-40`,onClick:()=>a("preview"),children:"Preview"})]}),r&&E!=="preview"&&p.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[p.jsx("input",{"aria-label":"Search response body",type:"search",className:`min-w-0 flex-1 rounded-md border px-3 py-2 text-sm ${F}`,placeholder:"Search response body…",value:c,onChange:G=>d(G.target.value)}),p.jsx("span",{className:`text-xs ${X}`,children:c.trim()?`${R} match${R===1?"":"es"}`:"Search exact response text"}),p.jsxs("label",{className:`inline-flex items-center gap-2 text-xs ${X}`,children:[p.jsx("input",{type:"checkbox",checked:f,disabled:!c.trim(),onChange:G=>h(G.target.checked)}),"Only matching lines"]})]}),E==="pretty"&&p.jsxs("div",{className:"space-y-2",children:[C.invalidJson&&p.jsx("div",{className:`rounded-md border px-3 py-2 text-xs ${j?"border-amber-800 bg-amber-950/40 text-amber-200":"border-amber-300 bg-amber-50 text-amber-800"}`,children:"Response declares JSON but could not be parsed. Showing the exact payload."}),p.jsx(Rr,{code:B||"(empty response)",language:C.language,title:r?"Body — Pretty":"Response body",theme:e,wrap:!0})]}),r&&E==="raw"&&p.jsx("div",{"data-testid":"api-client-response-raw-body",children:p.jsx(Rr,{code:B||"(empty response)",language:"text",title:"Body — Raw",theme:e,wrap:!0})}),r&&E==="preview"&&T&&p.jsx("iframe",{title:"Response preview",sandbox:"",srcDoc:t.body,className:`min-h-80 w-full rounded-md border bg-white ${j?"border-gray-700":"border-gray-300"}`}),r&&t.headers.length>0&&p.jsxs("section",{className:`overflow-hidden rounded-md border ${j?"border-gray-700":"border-gray-200"}`,"aria-labelledby":"api-client-response-headers-heading",children:[p.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 px-3 py-2",children:[p.jsxs("h4",{id:"api-client-response-headers-heading",className:"text-sm font-medium",children:["Response headers (",t.headers.length,")"]}),p.jsx("input",{"aria-label":"Filter response headers",type:"search",className:`rounded-md border px-2 py-1.5 text-xs ${F}`,placeholder:"Filter headers…",value:g,onChange:G=>b(G.target.value)})]}),p.jsx("div",{className:"overflow-x-auto border-t",children:p.jsxs("table",{className:"w-full min-w-[28rem] text-left text-xs",children:[p.jsx("thead",{className:j?"bg-gray-900 text-gray-300":"bg-gray-50 text-gray-600",children:p.jsxs("tr",{children:[p.jsx("th",{className:"px-3 py-2 font-medium",children:"Header"}),p.jsx("th",{className:"px-3 py-2 font-medium",children:"Value"})]})}),p.jsxs("tbody",{children:[z.map(([G,we],ye)=>p.jsxs("tr",{className:j?"border-t border-gray-800":"border-t border-gray-100",children:[p.jsx("th",{scope:"row",className:"whitespace-nowrap px-3 py-2 font-mono font-medium",children:G}),p.jsx("td",{className:"break-all px-3 py-2 font-mono",children:we})]},`${G}:${ye}`)),z.length===0&&p.jsx("tr",{children:p.jsx("td",{colSpan:2,className:`px-3 py-4 text-center ${X}`,children:"No response headers match this filter."})})]})]})})]})]})};function _E(t){if(!t.trim())return{valid:!0,message:"Ready"};try{return new Function("flex","console",`"use strict"; return (async () => {
|
|
63
|
+
${t}
|
|
64
|
+
});`),{valid:!0,message:"Syntax OK"}}catch(e){return{valid:!1,message:e instanceof Error?e.message:String(e)}}}function LE(t,e){let n=0,r=0;const s={...e};for(let a=0;a<t.length;a+=1){const c=t[a],d=t[a+1];if(s.blockComment){c==="*"&&d==="/"&&(s.blockComment=!1,a+=1);continue}if(s.quote){if(s.escaped){s.escaped=!1;continue}if(c==="\\"){s.escaped=!0;continue}c===s.quote&&(s.quote=void 0);continue}if(c==="/"&&d==="/")break;if(c==="/"&&d==="*"){s.blockComment=!0,a+=1;continue}if(c==="'"||c==='"'||c==="`"){s.quote=c,s.escaped=!1;continue}c==="{"?n+=1:c==="}"&&(r+=1)}return{opens:n,closes:r,state:s}}function BE(t){const e=t.replace(/\r\n?/g,`
|
|
65
|
+
`);if(!e.trim())return e;let n=0,r={escaped:!1,blockComment:!1};return e.split(`
|
|
66
|
+
`).map(a=>{const d=a.replace(/[ \t]+$/g,"").trimStart();if(!d)return"";const f=d.match(/^}+/)?.[0].length||0,h=Math.max(0,n-f),g=LE(d,r);return r=g.state,n=Math.max(0,n+g.opens-g.closes),`${" ".repeat(h)}${d}`}).join(`
|
|
67
|
+
`)}function gv(t,e){return t.slice(0,Math.max(0,Math.min(e,t.length))).replace(/\r\n?/g,`
|
|
68
|
+
`).length}function yv(t,e,n){const r=t.split(`
|
|
69
|
+
`),s=e.split(`
|
|
70
|
+
`),a=t.slice(0,Math.max(0,Math.min(n,t.length))),c=a.split(`
|
|
71
|
+
`).length-1,d=a.lastIndexOf(`
|
|
72
|
+
`),f=a.length-(d+1),h=r[c]||"",g=s[c]||"",b=h.length-h.trimStart().length,v=g.length-g.trimStart().length,S=g.length-v,A=f<=b?Math.min(f,v):v+Math.min(f-b,S);return s.slice(0,c).reduce((T,D)=>T+D.length+1,0)+A}function $E(t,e,n=e){const r=t.replace(/\r\n?/g,`
|
|
73
|
+
`),s=BE(t),a=yv(r,s,gv(t,e)),c=yv(r,s,gv(t,n));return{value:s,selectionStart:Math.min(a,s.length),selectionEnd:Math.min(Math.max(a,c),s.length)}}const jh=[{label:"get",kind:"method",signature:"get(key: string): string | undefined",documentation:"Read a variable by key."},{label:"has",kind:"method",signature:"has(key: string): boolean",documentation:"Check whether a variable is defined."},{label:"set",kind:"method",signature:"set(key: string, value: unknown): void",documentation:"Set a variable. Collection and environment stores persist the change in the workspace."},{label:"unset",kind:"method",signature:"unset(key: string): void",documentation:"Remove a variable by key."},{label:"replaceIn",kind:"method",signature:"replaceIn(value: string): string",documentation:"Replace {{variable}} placeholders using this variable scope."}],qE={flex:[{label:"request",kind:"property",documentation:"The mutable request draft available to pre-request and test scripts."},{label:"response",kind:"property",documentation:"The response from the executed request.",testsOnly:!0},{label:"environment",kind:"property",documentation:"Read and mutate variables in the active environment."},{label:"collection",kind:"property",documentation:"Read and mutate variables on the current collection."},{label:"variables",kind:"property",documentation:"Read and mutate the effective variables for this execution."},{label:"expect",kind:"function",signature:"expect(actual: unknown): FlexExpectation",documentation:"Create an assertion chain for a value."},{label:"test",kind:"function",signature:"test(name: string, callback: () => unknown | Promise<unknown>): void",documentation:"Register a post-response test.",testsOnly:!0}],"flex.request":[{label:"method",kind:"property",signature:"method: string",documentation:"Read or replace the HTTP method."},{label:"url",kind:"property",signature:"url: string",documentation:"Read or replace the request URL before variable resolution."},{label:"headers",kind:"property",documentation:"Mutable request-header helpers."},{label:"body",kind:"property",documentation:"Mutable raw request-body helpers."}],"flex.request.headers":[{label:"get",kind:"method",signature:"get(name: string): string | undefined",documentation:"Read a request header case-insensitively."},{label:"has",kind:"method",signature:"has(name: string): boolean",documentation:"Check whether a request header exists."},{label:"set",kind:"method",signature:"set(name: string, value: unknown): void",documentation:"Set or replace a request header."},{label:"upsert",kind:"method",signature:"upsert({ key, value }: { key: string; value: unknown }): void",documentation:"Set or replace a request header from a key/value object."},{label:"remove",kind:"method",signature:"remove(name: string): void",documentation:"Remove a request header case-insensitively."},{label:"toObject",kind:"method",signature:"toObject(): Record<string, string>",documentation:"Return enabled request headers as an object."}],"flex.request.body":[{label:"raw",kind:"property",signature:"raw: string",documentation:"Read or replace the raw request body."}],"flex.response":[{label:"code",kind:"property",signature:"code: number",documentation:"HTTP response status code.",testsOnly:!0},{label:"status",kind:"property",signature:"status: string",documentation:"HTTP response status text.",testsOnly:!0},{label:"responseTime",kind:"property",signature:"responseTime: number",documentation:"Measured response time in milliseconds.",testsOnly:!0},{label:"headers",kind:"property",documentation:"Read-only response-header helpers.",testsOnly:!0},{label:"text",kind:"method",signature:"text(): string",documentation:"Return the response body as text.",testsOnly:!0},{label:"json",kind:"method",signature:"json(): unknown",documentation:"Parse and return the response body as JSON.",testsOnly:!0}],"flex.response.headers":[{label:"get",kind:"method",signature:"get(name: string): string | undefined",documentation:"Read a response header case-insensitively.",testsOnly:!0},{label:"has",kind:"method",signature:"has(name: string): boolean",documentation:"Check whether a response header exists.",testsOnly:!0},{label:"toObject",kind:"method",signature:"toObject(): Record<string, string>",documentation:"Return response headers as an object.",testsOnly:!0}],"flex.environment":jh,"flex.collection":jh,"flex.variables":jh.map(t=>({...t,documentation:t.label==="set"||t.label==="unset"?`${t.documentation} Local effective-variable changes apply only to the current request execution.`:t.documentation})),"flex.expect.to":[{label:"equal",kind:"method",signature:"equal(expected: unknown): void",documentation:"Assert strict equality with Object.is."},{label:"eql",kind:"method",signature:"eql(expected: unknown): void",documentation:"Assert deep structural equality."},{label:"include",kind:"method",signature:"include(expected: unknown): void",documentation:"Assert that a string or array contains the expected value."},{label:"match",kind:"method",signature:"match(pattern: RegExp): void",documentation:"Assert that a string matches a regular expression."},{label:"have",kind:"property",documentation:"Property assertions."},{label:"be",kind:"property",documentation:"Boolean, range, and membership assertions."}],"flex.expect.to.have":[{label:"property",kind:"method",signature:"property(name: string, expected?: unknown): void",documentation:"Assert that an object has a property, optionally with an expected value."}],"flex.expect.to.be":[{label:"above",kind:"method",signature:"above(expected: number): void",documentation:"Assert that a number is greater than expected."},{label:"below",kind:"method",signature:"below(expected: number): void",documentation:"Assert that a number is less than expected."},{label:"oneOf",kind:"method",signature:"oneOf(expected: unknown[]): void",documentation:"Assert deep equality with one value from a list."},{label:"ok",kind:"property",signature:"ok: true",documentation:"Assert that the value is truthy."},{label:"true",kind:"property",signature:"true: true",documentation:"Assert that the value is exactly true."},{label:"false",kind:"property",signature:"false: true",documentation:"Assert that the value is exactly false."}],console:[{label:"log",kind:"method",signature:"log(...values: unknown[]): void",documentation:"Write a line to the API Client script console."},{label:"info",kind:"method",signature:"info(...values: unknown[]): void",documentation:"Write an informational line to the API Client script console."},{label:"warn",kind:"method",signature:"warn(...values: unknown[]): void",documentation:"Write a warning line to the API Client script console."},{label:"error",kind:"method",signature:"error(...values: unknown[]): void",documentation:"Write an error line to the API Client script console."}]};function bv(t,e){return[...qE[t]||[]].filter(n=>e==="tests"||!n.testsOnly).map(n=>({...n}))}function zE(t,e,n={}){const r=e.toLowerCase();return[...new Set(n[t]||[])].filter(Boolean).filter(s=>s.toLowerCase().startsWith(r)).sort((s,a)=>s.localeCompare(a)).map(s=>({label:s,kind:"variable",signature:s,documentation:`Known ${t==="variables"?"effective":t} variable.`}))}const HE=[{label:"flex",kind:"namespace",documentation:"FlexDoc request, response, variables, assertions, and test scripting API."},{label:"console",kind:"namespace",documentation:"Captured script console with log, info, warn, and error methods."}];function IE(t){const e=t.lastIndexOf("flex.expect(");if(e<0)return null;const n=t.slice(e),r=[[/\.to\.have\.([A-Za-z_$][\w$]*)?$/,"flex.expect.to.have"],[/\.to\.be\.([A-Za-z_$][\w$]*)?$/,"flex.expect.to.be"],[/\.to\.([A-Za-z_$][\w$]*)?$/,"flex.expect.to"]];for(const[s,a]of r){const c=n.match(s);if(c)return{path:a,prefix:c[1]||""}}return null}function UE(t){const e=t.match(/flex\.(environment|collection|variables)\.(?:get|has|set|unset)\(\s*['"]([^'"]*)$/);return e?{scope:e[1],prefix:e[2]||""}:null}function FE(t){const e=t.match(/(?:^|[^\w$])((?:flex|console)(?:\.[A-Za-z_$][\w$]*)*)\.([A-Za-z_$][\w$]*)?$/);return e?{path:e[1],prefix:e[2]||""}:null}function VE(t,e,n,r={},s=!1){const a=Math.max(0,Math.min(e,t.length)),c=t.slice(0,a),d=UE(c);if(d){const v=zE(d.scope,d.prefix,r);return v.length>0?{from:a-d.prefix.length,to:a,items:v}:null}const f=IE(c);if(f){const v=bv(f.path,n).filter(S=>S.label.toLowerCase().startsWith(f.prefix.toLowerCase()));return v.length>0?{from:a-f.prefix.length,to:a,items:v}:null}const h=FE(c);if(h){const v=bv(h.path,n).filter(S=>S.label.toLowerCase().startsWith(h.prefix.toLowerCase()));return v.length>0?{from:a-h.prefix.length,to:a,items:v}:null}const g=c.match(/([A-Za-z_$][\w$]*)$/)?.[1]||"";if(!s&&!g)return null;const b=HE.filter(v=>!g||v.label.startsWith(g));return!s&&b.length===0?null:b.length>0?{from:a-g.length,to:a,items:b.map(v=>({...v}))}:null}const xv=({ariaLabel:t,value:e,onChange:n,phase:r,theme:s="light",variableKeys:a={}})=>{const c=I.useRef(null),d=I.useRef(null),f=I.useRef([]),[h,g]=I.useState(null),[b,v]=I.useState(0),[S,A]=I.useState({left:12,top:36}),C=I.useMemo(()=>`api-client-script-completions-${t.toLowerCase().replace(/[^a-z0-9]+/g,"-")}`,[t]),T=I.useMemo(()=>_E(e),[e]),D=s==="dark",j=X=>{const W=d.current,G=c.current;if(!W||!G)return;const we=W.coordsAtPos(X);if(!we)return;const ye=G.getBoundingClientRect(),xe=we.left-ye.left,_=Math.max(8,ye.width-430),ee=we.bottom-ye.top+2,he=Math.max(8,ye.height-96);A({left:Math.max(8,Math.min(xe,_)),top:Math.max(8,Math.min(ee,he))})},E=(X,W,G=!1)=>{const we=VE(X,W,r,a,G);g(we),v(0),we&&requestAnimationFrame(()=>j(W))},O=X=>{if(!h)return;const W=`${e.slice(0,h.from)}${X.label}${e.slice(h.to)}`,G=h.from+X.label.length;n(W),g(null),requestAnimationFrame(()=>{d.current?.setSelection(G)})},R=()=>{if(!T.valid)return;const X=d.current?.getSelection()??{from:e.length,to:e.length},W=$E(e,X.from,X.to);W.value!==e&&n(W.value),g(null),requestAnimationFrame(()=>{d.current?.setSelection(W.selectionStart,W.selectionEnd)})};I.useEffect(()=>{f.current[b]?.scrollIntoView({block:"nearest"})},[b]);const B=X=>{const W=d.current?.getSelection().from??e.length;if((X.ctrlKey||X.metaKey)&&X.code==="Space"){X.preventDefault(),E(e,W,!0);return}if(X.shiftKey&&X.altKey&&X.code==="KeyF"){X.preventDefault(),R();return}if(!(!h||h.items.length===0)){if(X.key==="ArrowDown"){X.preventDefault(),v(G=>(G+1)%h.items.length);return}if(X.key==="ArrowUp"){X.preventDefault(),v(G=>(G-1+h.items.length)%h.items.length);return}if(X.key==="Enter"||X.key==="Tab"){X.preventDefault(),O(h.items[b]);return}X.key==="Escape"&&(X.preventDefault(),g(null))}},M=h?.items[b],z=!!h&&h.items.length>0,F=D?"border-gray-700 bg-gray-900 text-gray-100 shadow-2xl":"border-gray-200 bg-white text-gray-900 shadow-2xl";return p.jsxs("div",{ref:c,className:"relative min-w-0",onBlur:X=>{X.currentTarget.contains(X.relatedTarget)||g(null)},children:[p.jsxs("div",{className:"mb-1 flex flex-wrap items-center justify-between gap-2",children:[p.jsxs("span",{role:T.valid?"status":"alert",className:`inline-flex items-center gap-1 text-[11px] ${T.valid?D?"text-emerald-300":"text-emerald-700":D?"text-amber-300":"text-amber-700"}`,children:[T.valid?p.jsx(Oo,{className:"h-3.5 w-3.5"}):p.jsx(md,{className:"h-3.5 w-3.5"}),p.jsx("span",{className:"max-w-[24rem] truncate",children:T.message})]}),p.jsxs("button",{type:"button",className:"inline-flex min-h-9 items-center gap-1.5 rounded-md border px-2.5 py-1 text-xs disabled:cursor-not-allowed disabled:opacity-50",disabled:!T.valid||!e.trim(),onMouseDown:X=>X.preventDefault(),onClick:R,"aria-label":"Format current script",children:[p.jsx(mA,{className:"h-3.5 w-3.5"}),"Format"]})]}),p.jsx(Ba,{ref:d,ariaActiveDescendant:z?`${C}-${b}`:void 0,ariaAutocomplete:"list",ariaControls:z?C:void 0,ariaExpanded:z,ariaLabel:t,autoIndent:!0,dataTestId:`${t}-editor`,language:"javascript",onChange:X=>{const W=d.current?.getSelection().from??X.length;n(X),requestAnimationFrame(()=>{const G=d.current?.getSelection().from??W;E(X,G)})},onCursorChange:X=>{h&&j(X)},onEditorKeyDown:B,theme:s,value:e,wrap:!0}),z&&p.jsxs("div",{className:`absolute z-[70] w-[min(26rem,calc(100%-1rem))] overflow-hidden rounded-md border ${F}`,"data-testid":`${t}-completion-popup`,style:{left:S.left,top:S.top},children:[p.jsx("div",{id:C,role:"listbox","aria-label":"Script suggestions",className:"max-h-56 overflow-y-auto py-1",children:h.items.map((X,W)=>p.jsxs("button",{ref:G=>{f.current[W]=G},"aria-label":X.label,"aria-selected":W===b,className:`flex w-full items-baseline gap-2 px-3 py-1.5 text-left text-xs ${W===b?D?"bg-blue-700 text-white":"bg-blue-50 text-gray-900":D?"hover:bg-gray-800":"hover:bg-gray-50"}`,id:`${C}-${W}`,onMouseEnter:()=>v(W),onMouseDown:G=>{G.preventDefault(),O(X)},role:"option",type:"button",children:[p.jsx("span",{"aria-hidden":"true",className:"shrink-0 rounded bg-black/5 px-1 font-mono text-[10px] uppercase opacity-60 dark:bg-white/10",children:X.kind}),p.jsx("span",{className:"font-mono font-semibold",children:X.label}),p.jsx("span",{"aria-hidden":"true",className:`min-w-0 truncate ${W===b&&D?"text-blue-100":D?"text-gray-400":"text-gray-500"}`,children:X.signature||""})]},`${X.kind}-${X.label}`))}),M&&p.jsxs("div",{className:`border-t px-3 py-2 text-[11px] ${D?"border-gray-700 text-gray-300":"border-gray-200 text-gray-600"}`,children:[M.signature&&p.jsx("div",{className:"mb-1 overflow-x-auto whitespace-nowrap font-mono text-xs",children:M.signature}),p.jsx("div",{children:M.documentation})]})]}),p.jsxs("div",{className:`mt-1 flex flex-wrap gap-x-3 text-[11px] ${D?"text-gray-400":"text-gray-500"}`,children:[p.jsxs("span",{children:[p.jsx("code",{children:"flex."})," or Ctrl+Space"]}),p.jsx("span",{children:"Enter keeps indentation"}),p.jsx("span",{children:"↑/↓ choose"}),p.jsx("span",{children:"Enter/Tab complete"}),p.jsx("span",{children:"Shift+Alt+F format"})]})]})};function Eh(t){const e=t.auth?t.auth.type==="oauth2"?{...t.auth,scopes:t.auth.scopes?[...t.auth.scopes]:void 0}:{...t.auth}:void 0;return{...t,query:t.query?.map(n=>({...n})),headers:t.headers?.map(n=>({...n})),urlencoded:t.urlencoded?.map(n=>({...n})),formData:t.formData?.map(n=>({...n})),binary:t.binary?{...t.binary}:void 0,graphql:t.graphql?{...t.graphql}:void 0,auth:e,hostExecution:t.hostExecution?{...t.hostExecution}:void 0}}function PE(t){const e=Eh(t);return e.binary&&(e.binary={fileName:e.binary.fileName,contentType:e.binary.contentType}),e.formData&&(e.formData=e.formData.map(n=>{const r={...n};return delete r.file,r})),e}function Hc(t){return Object.assign(Object.create(null),t||{})}function KE(t){return t instanceof Error?t.message:"Request failed"}function YE(t){return t?Array.isArray(t)?t.map(([e,n])=>[String(e),String(n)]):[...new Headers(t).entries()]:[]}function GE(t,e){if(e.body!=null&&typeof e.body!="string")return;const r=[`curl -X ${String(e.method||"GET").toUpperCase()} ${JSON.stringify(t)}`];for(const[s,a]of YE(e.headers))r.push(` -H ${JSON.stringify(`${s}: ${a}`)}`);return typeof e.body=="string"&&e.body.length>0&&r.push(` --data-raw ${JSON.stringify(e.body)}`),r.join(" \\n")}function XE(t,e){return e?.available?`The API host does not support the required capability${t.length===1?"":"ies"}: ${t.join(", ")}.`:"Host execution is disabled on this documentation server."}function JE(t){if(typeof globalThis.btoa!="function")throw new Error("Host execution binary uploads require a Base64 encoder.");let e="";const n=32768;for(let r=0;r<t.length;r+=n)e+=String.fromCharCode(...t.subarray(r,Math.min(r+n,t.length)));return globalThis.btoa(e)}async function QE(t){const e={request:PE(t),...t.hostExecution?.certificateId?{certificateId:t.hostExecution.certificateId}:{},...t.hostExecution?.cookieJar?{cookieJar:t.hostExecution.cookieJar}:{}};t.bodyMode==="binary"&&t.binary?.file&&(e.bodyBase64=JE(new Uint8Array(await t.binary.file.arrayBuffer())));const n=(t.formData||[]).map((r,s)=>({entry:r,index:s})).filter(({entry:r})=>r.enabled!==!1&&r.type==="file"&&!!r.file);if(n.length>0){if(typeof FormData>"u")throw new Error("Host multipart execution requires FormData support.");const r=new FormData;r.append("descriptor",JSON.stringify(e));for(const{entry:s,index:a}of n){const c=s.file;r.append(`formData[${a}]`,c,s.fileName||c.name)}return{body:r,headers:{"X-FlexDoc-Execute":"1"}}}return{body:JSON.stringify(e),headers:{"X-FlexDoc-Execute":"1","Content-Type":"application/json"}}}async function vv(t){const e=Eh(t.request),n=cn(t.scripts),r=t.fetcher||globalThis.fetch,s=t.now||Date.now;let a=Eh(t.request),c=Hc(t.variables),d=Hc(t.collectionVariables);const f=Hc(t.externalVariables);let h=Hc(t.environmentVariables),g=[],b=[],v,S="",A="",C=0,T=!1,D;try{if(n.preRequest.trim()){const M=await w0({script:n.preRequest,phase:"pre-request",draft:a,variables:c,collectionVariables:d,externalVariables:f,environmentVariables:h});if(a=M.draft,c=M.variables,d=M.collectionVariables,h=M.environmentVariables,g=[...g,...M.logs],M.collectionChanges.length>0&&t.onCollectionChanges?.(M.collectionChanges),M.environmentChanges.length>0&&t.onEnvironmentChanges?.(M.environmentChanges),M.error)return{scriptTests:b,scriptLogs:g,scriptError:`Pre-request script: ${M.error}`}}t.resolveAuth&&(a={...a,auth:t.resolveAuth(a.auth)}),a=yk(a,c),S=(a.method||"GET").toUpperCase(),A=a.url;const j=N0(a),E=["GET","HEAD"].includes(S)&&ca(a)!=="none",O=j.length>0||E&&t.hostExecution?.available===!0;let R;if(O){const M=new Set(t.hostExecution?.capabilities||[]),z=j.filter(_=>!M.has(_));if(!t.hostExecution?.available||z.length>0){const _=XE(z,t.hostExecution);return{error:_,result:{request:e,scripts:n,executedMethod:S,resolvedUrl:A,error:_,...g.length?{scriptLogs:[...g]}:{}},scriptTests:b,scriptLogs:g}}if(!r)throw new Error("Fetch API is not available");const F=await QE(a);C=s(),T=!0;const X=await r(t.hostExecution.endpoint,{method:"POST",credentials:"same-origin",headers:F.headers,body:F.body,...t.signal?{signal:t.signal}:{}}),W=await X.text();let G;try{const _=W?JSON.parse(W):{};if(!_||typeof _!="object"||Array.isArray(_))throw new Error("invalid");G=_}catch{throw new Error("API host returned an invalid execution response.")}const we=typeof G.error=="string"?G.error:void 0;if(!X.ok)throw new Error(we||`API host execution failed with HTTP ${X.status}.`);if(typeof G.status!="number"||!Array.isArray(G.headers))throw new Error("API host returned an invalid execution response.");const ye=G.headers.map(_=>Array.isArray(_)?[String(_[0]),String(_[1])]:["",""]).filter(([_])=>!!_),xe=Array.isArray(G.cookies)?G.cookies:void 0;R={status:G.status,statusText:String(G.statusText||""),headers:ye,body:String(G.body||""),responseTime:typeof G.responseTime=="number"?G.responseTime:s()-C,...xe?{cookies:xe}:{}}}else{const M=C0(a);S=M.method,A=M.url,t.onRequestBuilt?.(M);let z={...M.init,url:M.url,credentials:t.credentials||"same-origin",...t.signal?{signal:t.signal}:{}};t.requestInterceptor&&(z=await t.requestInterceptor(z)),t.signal&&(z.signal=t.signal);const{url:F,...X}=z;if(A=F,D=GE(F,X),C=s(),T=!0,!r)throw new Error("Fetch API is not available");const W=await r(F,X),G=await W.text();R={status:W.status,statusText:W.statusText,headers:[...W.headers.entries()],body:G,responseTime:s()-C}}if(n.tests.trim()){const M=await w0({script:n.tests,phase:"tests",draft:a,variables:c,collectionVariables:d,externalVariables:f,environmentVariables:h,response:R});g=[...g,...M.logs],b=M.tests.map(z=>({...z})),M.collectionChanges.length>0&&t.onCollectionChanges?.(M.collectionChanges),M.environmentChanges.length>0&&t.onEnvironmentChanges?.(M.environmentChanges),M.error&&(v=`Test script: ${M.error}`)}return{result:{request:e,scripts:n,executedMethod:S,resolvedUrl:A,status:R.status,statusText:R.statusText,responseTime:R.responseTime,responseHeaders:R.headers.map(([M,z])=>[M,z]),responseBody:R.body,...b.length?{scriptTests:b}:{},...g.length?{scriptLogs:[...g]}:{},...v?{scriptError:v}:{}},response:R,scriptTests:b,scriptLogs:g,...D?{curlCommand:D}:{},...v?{scriptError:v}:{}}}catch(j){const E=KE(j),O={error:E,scriptTests:b,scriptLogs:g};return T&&(O.result={request:e,scripts:n,executedMethod:S,resolvedUrl:A,responseTime:C?s()-C:void 0,error:E,...g.length?{scriptLogs:[...g]}:{}}),O}}function WE(t){let e=t.url;for(const[n,r]of Object.entries(t.variables||{}))e=e.split(`{${n}}`).join(r.default);return e}function Oh(t){return t.replace(/\/+$/,"")}function wv(t,e){const n=Oh(e);return n?t===n||t.startsWith(`${n}/`)||t.startsWith(`${n}?`):!1}function ZE(t,e,n){const r=Oh(n);if(!r)return t;const s=Oh(e);if(s&&wv(t,s))return`${r}${t.slice(s.length)}`;try{const a=new URL(t),c=`${a.pathname==="/"?"":a.pathname}${a.search}${a.hash}`;return`${r}${c}`}catch{return r}}const eO=()=>({key:"",value:"",enabled:!0});function tO(t){return{method:t?.method||"GET",url:t?.url||"",query:t?.query?.map(e=>({...e}))||[],headers:t?.headers?.map(e=>({...e}))||[],body:t?.body||"",contentType:t?.contentType||"application/json",bodyMode:t?.bodyMode||ca(t||{}),urlencoded:t?.urlencoded?.length?t.urlencoded.map(e=>({...e})):void 0,formData:t?.formData?.length?t.formData.map(e=>({...e})):void 0,binary:t?.binary?{...t.binary}:void 0,graphql:t?.graphql?{...t.graphql}:void 0,auth:t?.auth||{type:"none"},hostExecution:t?.hostExecution?{...t.hostExecution}:void 0}}function nO(t){const e=t.auth?t.auth.type==="oauth2"?{...t.auth,scopes:t.auth.scopes?[...t.auth.scopes]:void 0}:{...t.auth}:void 0;return{...t,query:t.query?.map(n=>({...n})),headers:t.headers?.map(n=>({...n})),urlencoded:t.urlencoded?.map(n=>({...n})),formData:t.formData?.map(n=>({...n})),binary:t.binary?{...t.binary}:void 0,graphql:t.graphql?{...t.graphql}:void 0,auth:e,hostExecution:t.hostExecution?{...t.hostExecution}:void 0}}function iO(t){try{return new URL(t).origin}catch{return""}}function rO(t,e){if(t==="query"){const n=e.trim().replace(/^\?/,"").replace(/\r?\n/g,"&");return n?[...new URLSearchParams(n).entries()].map(([r,s])=>({key:r,value:s,enabled:!0})):[]}return e.split(/\r?\n/).map(n=>n.trim()).filter(Boolean).flatMap(n=>{const r=n.indexOf(":");return r<=0?[]:[{key:n.slice(0,r).trim(),value:n.slice(r+1).trim(),enabled:!0}]})}function Sv({kind:t,label:e,entries:n,onChange:r,inputClass:s,mutedClass:a}){const[c,d]=I.useState(""),f=(g,b)=>r(n.map((v,S)=>S===g?{...v,...b}:v)),h=()=>{const g=rO(t,c);g.length&&(r(g),d(""))};return p.jsxs("div",{className:"space-y-3",children:[p.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[p.jsx("span",{className:"text-sm font-medium",children:e}),p.jsxs("button",{type:"button",className:"inline-flex min-h-11 items-center justify-center gap-2 rounded-md border px-3 py-2 text-sm",onClick:()=>r([...n,eO()]),children:[p.jsx(ks,{className:"h-4 w-4"})," Add"]})]}),n.length===0&&p.jsxs("div",{className:`rounded-md border border-dashed p-3 text-sm ${a}`,children:["No ",t==="query"?"query parameters":"headers"," configured."]}),n.map((g,b)=>p.jsxs("div",{className:"grid grid-cols-[auto_minmax(0,1fr)_auto] items-start gap-2 sm:grid-cols-[auto_minmax(0,1fr)_minmax(0,1fr)_auto]",children:[p.jsx("input",{className:"mt-3","aria-label":`${e} ${b+1} enabled`,type:"checkbox",checked:g.enabled!==!1,onChange:v=>f(b,{enabled:v.target.checked})}),p.jsx("input",{"aria-label":`${e} ${b+1} key`,className:`min-w-0 w-full rounded-md border px-3 py-2 text-sm ${s}`,placeholder:"Key",value:g.key,onChange:v=>f(b,{key:v.target.value})}),p.jsx("input",{"aria-label":`${e} ${b+1} value`,className:`col-start-2 min-w-0 w-full rounded-md border px-3 py-2 text-sm sm:col-start-auto ${s}`,placeholder:"Value",value:g.value,onChange:v=>f(b,{value:v.target.value})}),p.jsx("button",{type:"button","aria-label":`Remove ${e.toLowerCase()} ${b+1}`,className:"col-start-3 row-start-1 inline-flex min-h-11 items-center justify-center rounded-md border px-3 py-2 sm:col-start-auto sm:row-start-auto",onClick:()=>r(n.filter((v,S)=>S!==b)),children:p.jsx(si,{className:"h-4 w-4"})})]},b)),p.jsxs("details",{className:"rounded-md border p-3",children:[p.jsx("summary",{className:"cursor-pointer text-xs font-medium",children:"Bulk edit"}),p.jsxs("div",{className:"mt-2 space-y-2",children:[p.jsx("textarea",{"aria-label":`${e} bulk editor`,className:`min-h-24 w-full rounded-md border px-3 py-2 font-mono text-xs ${s}`,placeholder:t==="query"?"a=1&b=2":`Accept: application/json
|
|
74
|
+
X-Trace: abc123`,value:c,onChange:g=>d(g.target.value)}),p.jsxs("div",{className:"flex items-center justify-between gap-2",children:[p.jsx("span",{className:`text-xs ${a}`,children:t==="query"?"Paste query-string pairs; applying replaces the current rows.":"Paste raw Header: value lines; applying replaces the current rows."}),p.jsx("button",{type:"button",className:"rounded-md border px-3 py-1.5 text-xs",disabled:!c.trim(),onClick:h,children:"Apply"})]})]})]})]})}function Av(t){return(t||[]).filter(e=>e.enabled!==!1&&e.key.trim()).length}function sO(t,e){const n=[...t.matchAll(/\{\{\s*([^{}]+?)\s*\}\}/g)].map(c=>c[1].trim()),r=[...new Set(n)],s=r.filter(c=>!Object.prototype.hasOwnProperty.call(e,c)),a=t.replace(/\{\{\s*([^{}]+?)\s*\}\}/g,(c,d)=>{const f=d.trim();return Object.prototype.hasOwnProperty.call(e,f)?e[f]:c});return{names:r,missing:s,resolved:a}}const kv=({initialRequest:t,initialScripts:e,initialRequestTab:n="params",initialScriptTab:r,theme:s="light",density:a="advanced",messages:c,credentials:d="same-origin",requestInterceptor:f,onRequestChange:h,onDraftChange:g,onScriptsChange:b,onRequestTabChange:v,onScriptTabChange:S,onExecutionStart:A,onExecutionComplete:C,resolveAuth:T,variables:D={},collectionVariables:j={},externalVariables:E={},environmentVariables:O={},onCollectionChanges:R,onEnvironmentChanges:B,serverOptions:M=[],initialServerUrl:z,onServerUrlChange:F,hostExecution:X})=>{const W=tO(t),G=cn(e),we=M.map(H=>({server:H,url:WE(H)})),ye=we.map(H=>H.url),xe=z||ye.find(H=>wv(W.url,H))||"",_=ye.includes(xe)?xe:ye[0]||"",ee=xe&&!ye.includes(xe)?xe:"",he=xe||_||iO(W.url),[$,te]=I.useState(W),[L,P]=I.useState(G),[ue,Se]=I.useState(_),[Ne,Re]=I.useState(ee),Be=I.useRef(he),Ze=I.useRef(he),[_e,Ke]=I.useState(null),[gt,se]=I.useState(),[de,ge]=I.useState(null),[Te,Ie]=I.useState(null),[Xe,ht]=I.useState([]),[Pt,rn]=I.useState([]),[sn,qn]=I.useState(!1),Cn=I.useRef(null),lt=I.useRef(h),pi=I.useRef(g),Mn=I.useRef(b),Jn=I.useRef(null),[Tt,x]=I.useState(n),[V,pe]=I.useState(()=>r||(G.tests.trim()&&!G.preRequest.trim()?"tests":"pre-request")),le=I.useRef({}),oe=I.useRef({}),k=I.useId().replace(/:/g,""),J=I.useId().replace(/:/g,"");I.useEffect(()=>{lt.current=h},[h]),I.useEffect(()=>{pi.current=g},[g]),I.useEffect(()=>{Mn.current=b},[b]),I.useEffect(()=>{pi.current?.(nO($))},[$]),I.useEffect(()=>{Mn.current?.(cn(L))},[L]),I.useEffect(()=>{try{const H=T?{...$,auth:T($.auth)}:$,ae=C0(H,{variables:D}),Ge=JSON.stringify([ae.method,ae.url,ae.headerEntries,ae.body,ae.bodyKind]);if(Ge===Jn.current)return;Jn.current=Ge,lt.current?.(ae)}catch{}},[$,T,D]);const Z=($.method||"GET").toUpperCase(),K=["GET","HEAD"].includes(Z),Q=s==="dark"?"bg-gray-900 border-gray-700 text-gray-100":"bg-white border-gray-300 text-gray-900",Ae=s==="dark"?"border-gray-700 bg-gray-800/60 text-gray-100":"border-gray-200 bg-gray-50 text-gray-900",fe=s==="dark"?"text-gray-400":"text-gray-600",ke=Tt==="scripts"&&a!=="advanced"?"params":Tt,je=Av($.query),De=Av($.headers),$e=!!$.auth&&$.auth.type!=="none"&&$.auth.type!=="inherit",ze=ca($)!=="none",Je=!!(L.preRequest.trim()||L.tests.trim()),Dn=[{id:"params",label:"Params",count:je},{id:"headers",label:"Headers",count:De},{id:"authorization",label:"Authorization",active:$e},{id:"body",label:"Body",active:ze},{id:"scripts",label:"Scripts",active:Je}].filter(H=>a==="advanced"||H.id!=="scripts"),Kt=H=>`${k}-request-tab-${H}`,_i=H=>`${k}-request-panel-${H}`,or=H=>`${J}-script-tab-${H}`,Me=H=>`${J}-script-panel-${H}`,Qe=sO($.url,D),Yt=H=>{H==="scripts"&&a!=="advanced"||(x(H),v?.(H))},mi=H=>{pe(H),S?.(H)},Li=(H,ae)=>{if(!["ArrowLeft","ArrowRight","Home","End"].includes(H.key))return;H.preventDefault();const Ge=Dn.filter(kl=>!kl.disabled).map(kl=>kl.id),Hn=Math.max(0,Ge.indexOf(ae)),$s=H.key==="Home"?Ge[0]:H.key==="End"?Ge[Ge.length-1]:H.key==="ArrowRight"?Ge[(Hn+1)%Ge.length]:Ge[(Hn-1+Ge.length)%Ge.length];Yt($s),le.current[$s]?.focus()},Wr=(H,ae)=>{if(!["ArrowLeft","ArrowRight","Home","End"].includes(H.key))return;H.preventDefault();const Ge=["pre-request","tests"],Hn=Ge.indexOf(ae),$s=H.key==="Home"?Ge[0]:H.key==="End"?Ge[Ge.length-1]:H.key==="ArrowRight"?Ge[(Hn+1)%Ge.length]:Ge[(Hn-1+Ge.length)%Ge.length];mi($s),oe.current[$s]?.focus()},Qn=H=>{if(!H)return;const ae=Be.current;Be.current=H,F?.(H),te(Ge=>({...Ge,url:ZE(Ge.url,ae,H)}))},_t=H=>{const ae=H==="inherit"?{type:"inherit"}:H==="bearer"?{type:H,token:""}:H==="oauth2"?{type:H,accessToken:""}:H==="basic"?{type:H,username:"",password:""}:H==="apiKey"?{type:H,key:"",value:"",in:"header"}:H==="digest"?{type:H,username:"",password:""}:H==="hawk"?{type:H,id:"",key:"",algorithm:"sha256"}:H==="ntlm"?{type:H,username:"",password:""}:H==="oauth1"?{type:H,consumerKey:"",consumerSecret:"",signatureMethod:"HMAC-SHA1"}:H==="awsv4"?{type:H,accessKey:"",secretKey:"",region:"",service:""}:{type:"none"};te(Ge=>({...Ge,auth:ae}))},It=T?T($.auth):$.auth,gi=N0({...$,auth:It}),cr=new Set(X?.capabilities||[]),yi=gi.filter(H=>!cr.has(H)),Vc=K&&ze,Ha=gi.length>0,Ji=X?.available===!0&&yi.length===0,Al=Vc?X?.available?c?.unusualBodyHostExecution||`${Z} request bodies are unusual. FlexDoc will use API-host execution so the body can be sent.`:c?.unusualBodyBrowserWarning||`${Z} request bodies are unusual. Browser fetch may reject this request; enable API-host execution to send it reliably.`:Ha?Ji?c?.hostBrowserUnsupported||"The browser cannot send this request. FlexDoc will execute it from the API host.":X?.available?`The API host does not support the required capability${yi.length===1?"":"ies"}: ${yi.join(", ")}.`:c?.hostExecutionDisabled||"Host execution is disabled on this documentation server.":null,zn=H=>X?.available===!0&&cr.has(H),ur=async()=>{if(sn)return;const H=new AbortController;Cn.current=H,A?.(),qn(!0),ge(null),Ie(null),ht([]),rn([]),Ke(null),se(void 0);try{const ae=await vv({request:$,scripts:L,credentials:d,requestInterceptor:f,resolveAuth:T,variables:D,collectionVariables:j,externalVariables:E,environmentVariables:O,hostExecution:X,signal:H.signal,onRequestBuilt:Ge=>lt.current?.(Ge),onCollectionChanges:R,onEnvironmentChanges:B});if(H.signal.aborted){ge(c?.requestCancelled||"Request cancelled.");return}ge(ae.error||null),Ie(ae.scriptError||null),ht(ae.scriptTests),rn(ae.scriptLogs),ae.response&&(se(ae.curlCommand),Ke({status:ae.response.status,statusText:ae.response.statusText,headers:ae.response.headers.map(([Ge,Hn])=>[Ge,Hn]),body:ae.response.body,responseTime:ae.response.responseTime})),ae.result&&C?.(ae.result)}finally{Cn.current===H&&(Cn.current=null),qn(!1)}},Bs=()=>Cn.current?.abort(),Zr=Xe.filter(H=>H.passed).length,Ut=!sn&&!(Ha&&!Ji);return p.jsx("div",{className:`min-w-0 rounded-xl border p-4 md:p-5 ${Ae}`,"data-api-client-editor":!0,onKeyDown:H=>{(H.ctrlKey||H.metaKey)&&H.key==="Enter"&&Ut&&(H.preventDefault(),ur())},children:p.jsxs("div",{className:"flex flex-col gap-4",children:[p.jsxs("div",{className:"grid gap-2 sm:grid-cols-2",children:[M.length>0&&p.jsxs("label",{className:"text-sm font-medium",children:["Server",p.jsx("select",{"aria-label":"API Client server",className:`mt-1 w-full rounded-md border px-3 py-2 text-sm ${Q}`,value:ue,onChange:H=>{Se(H.target.value),Re(""),Qn(H.target.value)},children:we.map(({server:H,url:ae})=>p.jsxs("option",{value:ae,children:[H.description?`${H.description} — `:"",H.url]},`${H.url}:${ae}`))})]}),p.jsxs("label",{className:"text-sm font-medium",children:["Custom server URL ",p.jsx("span",{className:"text-xs font-normal opacity-70",children:"(optional override)"}),p.jsx("input",{"aria-label":"API Client custom server URL",className:`mt-1 w-full rounded-md border px-3 py-2 font-mono text-sm ${Q}`,value:Ne,onChange:H=>{const ae=H.target.value;Re(ae);const Ge=ue||Ze.current;(ae.trim()||Ge)&&Qn(ae.trim()||Ge)},placeholder:"http://localhost:8080"})]})]}),p.jsxs("div",{className:"grid min-w-0 gap-2 sm:grid-cols-[auto_minmax(0,1fr)]",children:[p.jsx("select",{"aria-label":"HTTP method",className:`rounded-md border px-3 py-2 font-medium ${Q}`,value:Z,onChange:H=>{const ae=H.target.value;te(Ge=>({...Ge,method:ae}))},children:["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"].map(H=>p.jsx("option",{children:H},H))}),p.jsx("input",{"aria-label":"Request URL",className:`w-full rounded-md border px-3 py-2 font-mono text-sm ${Q}`,placeholder:"https://api.example.com/resource or {{baseUrl}}/resource",value:$.url,onChange:H=>{const ae=H.target.value;te(Ge=>({...Ge,url:ae}))}})]}),Qe.names.length>0&&p.jsx("div",{className:`rounded-md border px-3 py-2 text-xs ${Qe.missing.length?s==="dark"?"border-amber-800 bg-amber-950/40 text-amber-200":"border-amber-300 bg-amber-50 text-amber-800":s==="dark"?"border-gray-700 bg-gray-900 text-gray-300":"border-gray-200 bg-white text-gray-600"}`,children:Qe.missing.length>0?p.jsxs(p.Fragment,{children:["Missing URL variable",Qe.missing.length===1?"":"s",": ",p.jsx("strong",{children:Qe.missing.join(", ")}),"."]}):p.jsxs(p.Fragment,{children:["Resolved URL: ",p.jsx("code",{className:"break-all",children:Qe.resolved})]})}),p.jsx("div",{className:"-mx-1 overflow-x-auto px-1 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden","data-api-client-request-tabs":!0,children:p.jsx("div",{className:`flex min-w-max gap-1 rounded-lg border p-1 ${s==="dark"?"border-gray-700 bg-gray-900/70":"border-gray-200 bg-white"}`,role:"tablist","aria-label":"Request configuration",children:Dn.map(H=>p.jsxs("button",{ref:ae=>{le.current[H.id]=ae},id:Kt(H.id),type:"button",role:"tab","aria-controls":_i(H.id),"aria-label":H.label,"aria-selected":ke===H.id,tabIndex:ke===H.id?0:-1,className:`inline-flex items-center gap-1.5 rounded-md px-3 py-2 text-sm font-medium transition ${ke===H.id?"bg-blue-600 text-white shadow-sm":s==="dark"?"text-gray-300 hover:bg-gray-800":"text-gray-600 hover:bg-gray-100"}`,onClick:()=>Yt(H.id),onKeyDown:ae=>Li(ae,H.id),children:[p.jsx("span",{children:H.label}),H.count!==void 0&&H.count>0&&p.jsx("span",{className:`rounded-full px-1.5 text-[10px] leading-5 ${ke===H.id?"bg-white/20 text-white":s==="dark"?"bg-gray-700 text-gray-200":"bg-gray-200 text-gray-700"}`,children:H.count}),H.active&&H.count===void 0&&p.jsx("span",{"aria-label":"Configured",className:`h-1.5 w-1.5 rounded-full ${ke===H.id?"bg-white":"bg-blue-500"}`})]},H.id))})}),K&&p.jsx("p",{className:`-mt-2 text-xs ${fe}`,children:c?.unusualBodyAdvisory||`${Z} request bodies are unusual and may be ignored or rejected by servers or intermediaries. FlexDoc keeps the body; API-host execution can send it when available, while browser fetch may reject it.`}),ke==="params"&&p.jsx("div",{role:"tabpanel",id:_i("params"),"aria-labelledby":Kt("params"),children:p.jsx(Sv,{kind:"query",label:"Query parameters",entries:$.query||[],onChange:H=>te(ae=>({...ae,query:H})),inputClass:Q,mutedClass:fe})}),ke==="headers"&&p.jsx("div",{role:"tabpanel",id:_i("headers"),"aria-labelledby":Kt("headers"),children:p.jsx(Sv,{kind:"headers",label:"Headers",entries:$.headers||[],onChange:H=>te(ae=>({...ae,headers:H})),inputClass:Q,mutedClass:fe})}),ke==="authorization"&&p.jsxs("div",{role:"tabpanel",id:_i("authorization"),"aria-labelledby":Kt("authorization"),className:"space-y-3",children:[p.jsxs("label",{className:"text-sm font-medium",children:["Authorization",p.jsxs("select",{"aria-label":"Authorization type",className:`rounded-md border px-3 py-2 text-sm ${Q}`,value:$.auth?.type||"none",onChange:H=>_t(H.target.value),children:[T&&p.jsx("option",{value:"inherit",children:"Inherit from parent"}),p.jsx("option",{value:"none",children:"None"}),p.jsx("option",{value:"bearer",children:"Bearer token"}),p.jsx("option",{value:"basic",children:"Basic auth"}),p.jsx("option",{value:"apiKey",children:"API key"}),(a==="advanced"||$.auth?.type==="oauth2")&&p.jsx("option",{value:"oauth2",children:"OAuth 2.0 access token"}),a==="advanced"&&p.jsxs(p.Fragment,{children:[p.jsx("option",{value:"digest",disabled:!zn("digest"),children:"Digest (API host)"}),p.jsx("option",{value:"hawk",disabled:!zn("hawk"),children:"Hawk (API host)"}),p.jsx("option",{value:"ntlm",disabled:!zn("ntlm"),children:"NTLM / Negotiate (API host)"}),p.jsx("option",{value:"oauth1",disabled:!zn("oauth1"),children:"OAuth 1.0 (API host)"}),p.jsx("option",{value:"awsv4",disabled:!zn("awsv4"),children:"AWS Signature v4 (API host)"})]})]})]}),$.auth?.type==="bearer"&&p.jsx("input",{"aria-label":"Bearer token",type:"password",autoComplete:"off",className:`w-full rounded-md border px-3 py-2 ${Q}`,value:$.auth.token,onChange:H=>{const ae=H.target.value;te(Ge=>({...Ge,auth:{type:"bearer",token:ae}}))}}),(a==="advanced"||$.auth?.type==="oauth2")&&$.auth?.type==="oauth2"&&p.jsx(P0,{auth:$.auth,fieldClass:`w-full rounded-md border px-3 py-2 text-sm ${Q}`,label:"",onChange:H=>te(ae=>({...ae,auth:H}))}),$.auth?.type==="basic"&&p.jsxs("div",{className:"flex gap-2",children:[p.jsx("input",{"aria-label":"Basic auth username",className:`w-full rounded-md border px-3 py-2 ${Q}`,placeholder:"Username",value:$.auth.username,onChange:H=>te(ae=>({...ae,auth:{...ae.auth,username:H.target.value}}))}),p.jsx("input",{"aria-label":"Basic auth password",type:"password",autoComplete:"off",className:`w-full rounded-md border px-3 py-2 ${Q}`,placeholder:"Password",value:$.auth.password,onChange:H=>te(ae=>({...ae,auth:{...ae.auth,password:H.target.value}}))})]}),$.auth?.type==="apiKey"&&p.jsxs("div",{className:"flex gap-2",children:[p.jsx("input",{"aria-label":"API key name",className:`w-full rounded-md border px-3 py-2 ${Q}`,placeholder:"Key name",value:$.auth.key,onChange:H=>te(ae=>({...ae,auth:{...ae.auth,key:H.target.value}}))}),p.jsx("input",{"aria-label":"API key value",type:"password",autoComplete:"off",className:`w-full rounded-md border px-3 py-2 ${Q}`,placeholder:"Value",value:$.auth.value,onChange:H=>te(ae=>({...ae,auth:{...ae.auth,value:H.target.value}}))}),p.jsxs("select",{"aria-label":"API key location",className:`rounded-md border px-3 py-2 text-sm ${Q}`,value:$.auth.in,onChange:H=>te(ae=>({...ae,auth:{...ae.auth,in:H.target.value}})),children:[p.jsx("option",{value:"header",children:"Header"}),p.jsx("option",{value:"query",children:"Query"}),p.jsx("option",{value:"cookie",disabled:!zn("cookies"),children:"Cookie (API host)"})]})]}),$.auth?.type==="digest"&&p.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[p.jsx("input",{"aria-label":"Digest username",className:`rounded-md border px-3 py-2 ${Q}`,placeholder:"Username",value:$.auth.username,onChange:H=>te(ae=>({...ae,auth:{...ae.auth,username:H.target.value}}))}),p.jsx("input",{"aria-label":"Digest password",type:"password",autoComplete:"off",className:`rounded-md border px-3 py-2 ${Q}`,placeholder:"Password",value:$.auth.password,onChange:H=>te(ae=>({...ae,auth:{...ae.auth,password:H.target.value}}))})]}),$.auth?.type==="hawk"&&p.jsxs("div",{className:"grid gap-2 sm:grid-cols-2",children:[p.jsx("input",{"aria-label":"Hawk id",className:`rounded-md border px-3 py-2 ${Q}`,placeholder:"ID",value:$.auth.id,onChange:H=>te(ae=>({...ae,auth:{...ae.auth,id:H.target.value}}))}),p.jsx("input",{"aria-label":"Hawk key",type:"password",autoComplete:"off",className:`rounded-md border px-3 py-2 ${Q}`,placeholder:"Key",value:$.auth.key,onChange:H=>te(ae=>({...ae,auth:{...ae.auth,key:H.target.value}}))}),p.jsxs("select",{"aria-label":"Hawk algorithm",className:`rounded-md border px-3 py-2 ${Q}`,value:$.auth.algorithm||"sha256",onChange:H=>te(ae=>({...ae,auth:{...ae.auth,algorithm:H.target.value}})),children:[p.jsx("option",{value:"sha256",children:"SHA-256"}),p.jsx("option",{value:"sha1",children:"SHA-1"})]}),p.jsx("input",{"aria-label":"Hawk ext",className:`rounded-md border px-3 py-2 ${Q}`,placeholder:"ext (optional)",value:$.auth.ext||"",onChange:H=>te(ae=>({...ae,auth:{...ae.auth,ext:H.target.value}}))})]}),$.auth?.type==="ntlm"&&p.jsxs("div",{className:"grid gap-2 sm:grid-cols-2",children:[p.jsx("input",{"aria-label":"NTLM username",className:`rounded-md border px-3 py-2 ${Q}`,placeholder:"Username",value:$.auth.username,onChange:H=>te(ae=>({...ae,auth:{...ae.auth,username:H.target.value}}))}),p.jsx("input",{"aria-label":"NTLM password",type:"password",autoComplete:"off",className:`rounded-md border px-3 py-2 ${Q}`,placeholder:"Password",value:$.auth.password,onChange:H=>te(ae=>({...ae,auth:{...ae.auth,password:H.target.value}}))}),p.jsx("input",{"aria-label":"NTLM domain",className:`rounded-md border px-3 py-2 ${Q}`,placeholder:"Domain (optional)",value:$.auth.domain||"",onChange:H=>te(ae=>({...ae,auth:{...ae.auth,domain:H.target.value}}))}),p.jsx("input",{"aria-label":"NTLM workstation",className:`rounded-md border px-3 py-2 ${Q}`,placeholder:"Workstation (optional)",value:$.auth.workstation||"",onChange:H=>te(ae=>({...ae,auth:{...ae.auth,workstation:H.target.value}}))})]}),$.auth?.type==="oauth1"&&p.jsxs("div",{className:"grid gap-2 sm:grid-cols-2",children:[p.jsx("input",{"aria-label":"OAuth1 consumer key",className:`rounded-md border px-3 py-2 ${Q}`,placeholder:"Consumer key",value:$.auth.consumerKey,onChange:H=>te(ae=>({...ae,auth:{...ae.auth,consumerKey:H.target.value}}))}),p.jsx("input",{"aria-label":"OAuth1 consumer secret",type:"password",autoComplete:"off",className:`rounded-md border px-3 py-2 ${Q}`,placeholder:"Consumer secret",value:$.auth.consumerSecret,onChange:H=>te(ae=>({...ae,auth:{...ae.auth,consumerSecret:H.target.value}}))}),p.jsx("input",{"aria-label":"OAuth1 token",className:`rounded-md border px-3 py-2 ${Q}`,placeholder:"Token (optional)",value:$.auth.token||"",onChange:H=>te(ae=>({...ae,auth:{...ae.auth,token:H.target.value}}))}),p.jsx("input",{"aria-label":"OAuth1 token secret",type:"password",autoComplete:"off",className:`rounded-md border px-3 py-2 ${Q}`,placeholder:"Token secret (optional)",value:$.auth.tokenSecret||"",onChange:H=>te(ae=>({...ae,auth:{...ae.auth,tokenSecret:H.target.value}}))}),p.jsxs("select",{"aria-label":"OAuth1 signature method",className:`rounded-md border px-3 py-2 ${Q}`,value:$.auth.signatureMethod||"HMAC-SHA1",onChange:H=>te(ae=>({...ae,auth:{...ae.auth,signatureMethod:H.target.value}})),children:[p.jsx("option",{children:"HMAC-SHA1"}),p.jsx("option",{children:"HMAC-SHA256"}),p.jsx("option",{children:"PLAINTEXT"})]}),p.jsx("input",{"aria-label":"OAuth1 realm",className:`rounded-md border px-3 py-2 ${Q}`,placeholder:"Realm (optional)",value:$.auth.realm||"",onChange:H=>te(ae=>({...ae,auth:{...ae.auth,realm:H.target.value}}))})]}),$.auth?.type==="awsv4"&&p.jsxs("div",{className:"grid gap-2 sm:grid-cols-2",children:[p.jsx("input",{"aria-label":"AWS access key",className:`rounded-md border px-3 py-2 ${Q}`,placeholder:"Access key",value:$.auth.accessKey,onChange:H=>te(ae=>({...ae,auth:{...ae.auth,accessKey:H.target.value}}))}),p.jsx("input",{"aria-label":"AWS secret key",type:"password",autoComplete:"off",className:`rounded-md border px-3 py-2 ${Q}`,placeholder:"Secret key",value:$.auth.secretKey,onChange:H=>te(ae=>({...ae,auth:{...ae.auth,secretKey:H.target.value}}))}),p.jsx("input",{"aria-label":"AWS session token",type:"password",autoComplete:"off",className:`rounded-md border px-3 py-2 ${Q}`,placeholder:"Session token (optional)",value:$.auth.sessionToken||"",onChange:H=>te(ae=>({...ae,auth:{...ae.auth,sessionToken:H.target.value}}))}),p.jsx("input",{"aria-label":"AWS region",className:`rounded-md border px-3 py-2 ${Q}`,placeholder:"Region",value:$.auth.region,onChange:H=>te(ae=>({...ae,auth:{...ae.auth,region:H.target.value}}))}),p.jsx("input",{"aria-label":"AWS service",className:`rounded-md border px-3 py-2 ${Q}`,placeholder:"Service",value:$.auth.service,onChange:H=>te(ae=>({...ae,auth:{...ae.auth,service:H.target.value}}))})]}),a==="advanced"&&X?.available&&p.jsxs("div",{className:"grid gap-2 rounded-md border p-3 sm:grid-cols-2",children:[X.clientCertificates?.length?p.jsxs("label",{className:"text-xs font-medium",children:["Client certificate",p.jsxs("select",{"aria-label":"Client certificate",className:`mt-1 w-full rounded-md border px-2 py-1.5 ${Q}`,value:$.hostExecution?.certificateId||"",onChange:H=>te(ae=>({...ae,hostExecution:{...ae.hostExecution||{},certificateId:H.target.value||void 0}})),children:[p.jsx("option",{value:"",children:"None"}),X.clientCertificates.map(H=>p.jsx("option",{value:H.id,children:H.name},H.id))]})]}):null,zn("cookies")&&p.jsxs("label",{className:"inline-flex items-center gap-2 text-xs font-medium",children:[p.jsx("input",{"aria-label":"Use API host cookie jar",type:"checkbox",checked:$.hostExecution?.cookieJar==="session",onChange:H=>te(ae=>({...ae,hostExecution:{...ae.hostExecution||{},cookieJar:H.target.checked?"session":void 0}}))}),"Use API host cookie jar"]})]})]}),ke==="body"&&p.jsx("div",{role:"tabpanel",id:_i("body"),"aria-labelledby":Kt("body"),children:p.jsx(jE,{draft:$,onChange:te,theme:s})}),a==="advanced"&&ke==="scripts"&&p.jsxs("section",{role:"tabpanel",id:_i("scripts"),"aria-labelledby":Kt("scripts"),className:"min-w-0 space-y-3",children:[p.jsxs("div",{children:[p.jsx("h3",{id:"api-client-scripts-heading",className:"font-semibold",children:"Scripts"}),p.jsx("p",{className:`text-xs ${fe}`,children:"Trusted local JavaScript. Editors soft-wrap, keep indentation, format only when you choose Format or Shift+Alt+F, and show lightweight syntax diagnostics."})]}),p.jsx("div",{className:`inline-flex max-w-full gap-1 rounded-lg border p-1 ${s==="dark"?"border-gray-700 bg-gray-900/70":"border-gray-200 bg-white"}`,role:"tablist","aria-label":"Script phase",children:["pre-request","tests"].map(H=>p.jsxs("button",{ref:ae=>{oe.current[H]=ae},id:or(H),type:"button",role:"tab","aria-controls":Me(H),"aria-selected":V===H,tabIndex:V===H?0:-1,className:`rounded-md px-3 py-1.5 text-sm ${V===H?"bg-blue-600 text-white":""}`,onClick:()=>mi(H),onKeyDown:ae=>Wr(ae,H),children:[H==="pre-request"?"Pre-request":"Tests",(H==="pre-request"?L.preRequest:L.tests).trim()&&p.jsx("span",{"aria-label":"Configured",className:`ml-1.5 inline-block h-1.5 w-1.5 rounded-full ${V===H?"bg-white":"bg-blue-500"}`})]},H))}),V==="pre-request"?p.jsx("div",{role:"tabpanel",id:Me("pre-request"),"aria-labelledby":or("pre-request"),className:"min-w-0",children:p.jsx(xv,{ariaLabel:"Pre-request script",phase:"pre-request",theme:s,value:L.preRequest,onChange:H=>P(ae=>({...ae,preRequest:H})),variableKeys:{environment:Object.keys(O),collection:Object.keys(j),variables:Object.keys(D)}})}):p.jsx("div",{role:"tabpanel",id:Me("tests"),"aria-labelledby":or("tests"),className:"min-w-0",children:p.jsx(xv,{ariaLabel:"Tests script",phase:"tests",theme:s,value:L.tests,onChange:H=>P(ae=>({...ae,tests:H})),variableKeys:{environment:Object.keys(O),collection:Object.keys(j),variables:Object.keys(D)}})})]}),Al&&p.jsx("div",{role:Vc||Ji?"status":"alert","aria-label":c?.hostExecutionStatus||"Host execution status",className:`rounded-md border p-3 text-sm ${Ji?s==="dark"?"border-blue-800 bg-blue-950/40 text-blue-200":"border-blue-300 bg-blue-50 text-blue-800":s==="dark"?"border-amber-800 bg-amber-950/40 text-amber-200":"border-amber-300 bg-amber-50 text-amber-800"}`,children:Al}),sn?p.jsxs("button",{type:"button",onClick:Bs,className:"inline-flex min-h-11 w-full items-center justify-center gap-2 rounded-md border border-red-500 px-4 py-2 font-medium text-red-600 sm:w-auto",children:[p.jsx(bg,{className:"h-4 w-4"}),c?.cancelRequest||"Cancel request"]}):p.jsxs("button",{type:"button","data-api-client-send":"true",onClick:()=>{ur()},disabled:!Ut,"aria-keyshortcuts":"Control+Enter Meta+Enter",title:`${c?.sendRequest||"Send request"} (Ctrl/Cmd+Enter)`,className:"inline-flex min-h-11 w-full items-center justify-center gap-2 rounded-md bg-blue-600 px-4 py-2 font-medium text-white hover:bg-blue-700 disabled:opacity-60 sm:w-auto",children:[p.jsx(la,{className:"h-4 w-4"})," ",c?.sendRequest||"Send request"," ",p.jsx("span",{className:"text-xs font-normal opacity-80",children:"Ctrl/Cmd+Enter"})]}),de&&p.jsxs("div",{role:"alert",className:`flex gap-2 rounded-md border p-3 text-sm ${s==="dark"?"border-red-800 bg-red-950/40 text-red-200":"border-red-300 bg-red-50 text-red-700"}`,children:[p.jsx(ud,{className:"mt-0.5 h-4 w-4 shrink-0"}),de]}),Te&&p.jsxs("div",{role:"alert",className:`flex gap-2 rounded-md border p-3 text-sm ${s==="dark"?"border-amber-800 bg-amber-950/40 text-amber-200":"border-amber-300 bg-amber-50 text-amber-800"}`,children:[p.jsx(ud,{className:"mt-0.5 h-4 w-4 shrink-0"}),Te]}),_e&&p.jsx(DE,{response:_e,theme:s,curlCommand:gt,advanced:a==="advanced"}),Xe.length>0&&p.jsxs("section",{className:"space-y-2","aria-labelledby":"api-client-test-results-heading",children:[p.jsxs("div",{className:"flex items-center justify-between",children:[p.jsx("h3",{id:"api-client-test-results-heading",className:"font-semibold",children:"Test results"}),p.jsxs("span",{className:`text-xs ${fe}`,children:[Zr,"/",Xe.length," passed"]})]}),p.jsx("div",{className:"space-y-2",children:Xe.map((H,ae)=>p.jsxs("div",{className:`rounded-md border px-3 py-2 text-sm ${H.passed?s==="dark"?"border-green-800 bg-green-950/40 text-green-200":"border-green-300 bg-green-50 text-green-800":s==="dark"?"border-red-800 bg-red-950/40 text-red-200":"border-red-300 bg-red-50 text-red-800"}`,children:[p.jsxs("div",{className:"font-medium",children:[H.passed?"PASS":"FAIL"," — ",H.name]}),H.error&&p.jsx("div",{className:"mt-1 text-xs",children:H.error})]},`${H.name}:${ae}`))})]}),Pt.length>0&&p.jsx(Rr,{code:Pt.join(`
|
|
75
|
+
`),language:"text",title:"Script console",theme:s,wrap:!0})]})})};function Mh(t,e){if(typeof window>"u")return;const n=new URL(window.location.href);e?n.searchParams.set(t,e):n.searchParams.delete(t),window.history.replaceState(null,"",`${n.pathname}${n.search}${n.hash}`)}function lO(t,e){return t==="scripts"||e?"advanced":typeof window>"u"?"basic":new URLSearchParams(window.location.search).get("density")==="advanced"?"advanced":"basic"}function Cv(t,e){return JSON.stringify({request:t,scripts:e},(n,r)=>typeof File<"u"&&r instanceof File?{name:r.name,size:r.size,type:r.type,lastModified:r.lastModified}:r)}const aO=({spec:t,path:e,method:n,theme:r,options:s,initialRequestTab:a,initialScriptTab:c,onRequestChange:d,onOpenInApiClient:f})=>{const h=t.paths[e],b=h?.[n.toLowerCase()]?.servers||h?.servers||t.servers||[],v=s?.tryIt?.apiClientPersistenceKey??_0(t.info?.title,typeof window>"u"?void 0:window.location.host),S=I.useMemo(()=>{const ue={...h0(t,e,n),serverUrl:s?.tryIt?.defaultServer};return Ck(t,e,n,ue,s?.tryIt?.defaultServer)},[n,s?.tryIt?.defaultServer,e,t]),A=I.useMemo(()=>cn(),[]),[C,T]=I.useState(()=>lO(a,c)),[D,j]=I.useState(S.request),[E,O]=I.useState(S.serverUrl),[R,B]=I.useState(A),[M,z]=I.useState(a||"params"),[F,X]=I.useState(c||"pre-request"),[W,G]=I.useState(()=>nl()),[we,ye]=I.useState(v===!1),xe=s?.messages;I.useEffect(()=>{if(v===!1)return;let ue=!1;return H0(v).then(Se=>{ue||(G(Se),ye(!0))}).catch(()=>{ue||ye(!0)}),()=>{ue=!0}},[v]),I.useEffect(()=>{!we||v===!1||I0(v,W).catch(()=>{})},[we,W,v]);const _=I.useMemo(()=>Xd(W),[W]),ee=Cv(D,R)!==Cv(S.request,A),he=C==="advanced",$=r==="dark"?"border-gray-700 bg-gray-900/40 text-gray-100":"border-gray-200 bg-white text-gray-900",te=r==="dark"?"border-gray-700 bg-gray-900 text-gray-100":"border-gray-300 bg-white text-gray-900",L=ue=>{T(ue),Mh("density",ue==="advanced"?"advanced":void 0)},P=()=>f?.({request:D,scripts:cn(R),serverUrl:E,requestTab:M,scriptTab:F});return p.jsxs("div",{className:"space-y-3","data-try-it-session":!0,children:[p.jsxs("div",{className:`flex flex-wrap items-center justify-between gap-3 rounded-lg border p-2 ${$}`,children:[p.jsxs("div",{className:"flex rounded-md border p-1",role:"group","aria-label":"Try It density",children:[p.jsx("button",{type:"button","aria-pressed":!he,className:`rounded px-3 py-1.5 text-sm ${he?"":"bg-blue-600 text-white"}`,onClick:()=>L("basic"),children:xe?.tryItBasic||"Basic"}),p.jsx("button",{type:"button","aria-pressed":he,className:`rounded px-3 py-1.5 text-sm ${he?"bg-blue-600 text-white":""}`,onClick:()=>L("advanced"),children:xe?.tryItAdvanced||"Advanced"})]}),p.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[he&&ee&&p.jsx("span",{"aria-label":"Unsaved Try It changes",className:"text-xs font-medium",children:xe?.unsavedChanges||"Unsaved changes"}),f&&p.jsxs("button",{type:"button",className:"inline-flex min-h-10 items-center gap-2 rounded-md border px-3 py-1.5 text-sm",onClick:P,children:[p.jsx(fd,{className:"h-4 w-4"}),xe?.openApiClient||"Open in API Client"]})]})]}),he&&p.jsx("div",{className:`rounded-lg border p-3 ${$}`,children:p.jsxs("label",{className:"flex flex-wrap items-center gap-2 text-sm font-medium",children:[p.jsx("span",{children:xe?.environment||"Environment"}),p.jsxs("select",{"aria-label":xe?.environment||"Try It environment",className:`min-w-48 rounded-md border px-2 py-1.5 text-sm ${te}`,value:W.activeEnvironmentId||"",onChange:ue=>G(Se=>({...Se,activeEnvironmentId:ue.target.value||void 0})),children:[p.jsx("option",{value:"",children:xe?.noEnvironment||"No environment"}),W.environments.map(ue=>p.jsx("option",{value:ue.id,children:ue.name},ue.id))]})]})}),p.jsx(kv,{initialRequest:S.request,initialScripts:A,initialRequestTab:M,initialScriptTab:F,density:C,theme:r,messages:xe,credentials:s?.tryIt?.credentials||"same-origin",requestInterceptor:s?.tryIt?.requestInterceptor,hostExecution:s?.tryIt?.hostExecution,environmentVariables:_,serverOptions:b,initialServerUrl:S.serverUrl,onServerUrlChange:O,onRequestChange:d,onDraftChange:j,onScriptsChange:ue=>B(cn(ue)),onRequestTabChange:ue=>{z(ue),Mh("tab",ue)},onScriptTabChange:ue=>{X(ue),Mh("script",ue)},onEnvironmentChanges:ue=>G(Se=>Jd(Se,ue))})]})};function Rh(t,e){const n=encodeURIComponent(t).replace(/%/g,"~");return`${e.trim().toLowerCase()}-${n}`}function oO(t,e){return`${e.trim().toLowerCase()}-${t.replace(/[^a-zA-Z0-9]+/g,"-").replace(/^-|-$/g,"")}`}const cO=["curl","javascript","python","go","java"];function uO(){if(typeof window>"u")return{tryIt:!1};const t=new URLSearchParams(window.location.search),e=t.get("tab"),n=t.get("script");return{tryIt:t.get("tryIt")==="1",requestTab:e&&/^(params|headers|authorization|body|scripts)$/.test(e)?e:void 0,scriptTab:n&&/^(pre-request|tests)$/.test(n)?n:void 0}}function dO(t,e){if(typeof window>"u")return;const n=new URL(window.location.href);e?n.searchParams.set(t,e):n.searchParams.delete(t),window.history.replaceState(null,"",`${n.pathname}${n.search}${n.hash}`)}const fO=({spec:t,path:e,method:n,theme:r="light",options:s={},defaultExpandedSections:a,runtimeSnapshot:c,onOpenInApiClient:d})=>{const f=uO(),h=a??Id(s.expand,s.expand===void 0?s.expandResponses:void 0),g=f.tryIt&&!h.includes("tryIt")?[...h,"tryIt"]:h,b=`${n}:${e}:${g.join("|")}`,[v,S]=I.useState(()=>({key:b,sections:new Set(g)})),A=v.key===b?v.sections:new Set(g),[C,T]=I.useState(s.codeSamples?.languages?.[0]||"curl"),[D,j]=I.useState(!1),E=I.useId().replace(/:/g,""),O=I.useRef({}),R=I.useMemo(()=>p0(t,e,n,h0(t,e,n)),[t,e,n]),[B,M]=I.useState(R),F=t.paths[e]?.[n.toLowerCase()],X=I.useMemo(()=>GA(t,e,n),[t,e,n]),W=s.messages;if(I.useEffect(()=>{!f.tryIt||typeof document>"u"||requestAnimationFrame(()=>document.getElementById("tryIt-heading")?.scrollIntoView({block:"start"}))},[f.tryIt,n,e]),!F)return p.jsx("div",{className:"p-6",children:"Operation not found."});const G=r==="dark"?"text-gray-400":"text-gray-600",we=r==="dark"?"border-gray-700 bg-gray-800/60":"border-gray-200 bg-white",ye=r==="dark"?"bg-gray-900 text-gray-100":"bg-white text-gray-900",xe=s.codeSamples?.languages?.length?s.codeSamples.languages:cO,_=F.security??t.security,ee={requiredPropsFirst:s.requiredPropsFirst,sortPropsAlphabetically:s.sortPropsAlphabetically},he=r==="dark"?"bg-blue-950/60 text-blue-200":"bg-blue-100 text-blue-700",$=r==="dark"?"bg-red-950/60 text-red-200":"bg-red-100 text-red-700",te=r==="dark"?"bg-orange-950/60 text-orange-200":"bg-orange-100 text-orange-700",L=r==="dark"?"bg-gray-800 text-gray-200":"bg-gray-100 text-gray-700",P=de=>`${E}-code-tab-${de}`,ue=`${E}-code-panel`,Se=de=>{const ge=!A.has(de);S(Te=>{const Ie=new Set(Te.key===b?Te.sections:g);return Ie.has(de)?Ie.delete(de):Ie.add(de),{key:b,sections:Ie}}),de==="tryIt"&&dO("tryIt",ge?"1":void 0)},Ne=(de,ge,Te)=>p.jsxs("section",{className:"mb-8","aria-labelledby":`${ge}-heading`,children:[p.jsxs("button",{type:"button",id:`${ge}-heading`,"aria-expanded":A.has(ge),onClick:()=>Se(ge),className:"mb-4 flex min-h-10 w-full items-center gap-2 text-left text-base font-semibold sm:text-lg",children:[A.has(ge)?p.jsx(hg,{className:"h-5 w-5 shrink-0"}):p.jsx(pg,{className:"h-5 w-5 shrink-0"}),de]}),A.has(ge)&&Te]}),Re=de=>{T(de),O.current[de]?.focus()},Be=(de,ge)=>{if(!/^(ArrowLeft|ArrowRight|Home|End)$/.test(de.key))return;de.preventDefault();const Te=xe.indexOf(ge),Ie=de.key==="Home"?xe[0]:de.key==="End"?xe[xe.length-1]:de.key==="ArrowRight"?xe[(Te+1)%xe.length]:xe[(Te-1+xe.length)%xe.length];Re(Ie)},Ze=async()=>{if(typeof window>"u"||typeof navigator>"u"||!navigator.clipboard)return;const de=new URL(window.location.href);de.hash=Rh(e,n),await navigator.clipboard.writeText(de.toString()),j(!0),window.setTimeout(()=>j(!1),1400)},_e=F.requestBody?Ln.isReference(F.requestBody)?Ln.resolveReference(t,F.requestBody.$ref):F.requestBody:void 0,Ke=Object.entries(F).filter(([de])=>de.startsWith("x-")),gt=typeof s.theme=="object"?s.theme.methodColors?.[n.toLowerCase()]:void 0,se=c?.routes.some(de=>de.method===n.toUpperCase()&&de.path===e);return p.jsx("div",{lang:s.locale,className:`min-h-full ${ye}`,children:p.jsxs("article",{className:"mx-auto w-full max-w-6xl p-4 sm:p-6 lg:p-8",children:[p.jsxs("header",{className:"mb-8",children:[p.jsxs("div",{className:"mb-4 flex min-w-0 flex-wrap items-center gap-2 sm:gap-3",children:[p.jsx("span",{className:`shrink-0 rounded border px-2.5 py-1 text-xs font-bold sm:text-sm ${Ln.getMethodColor(n,r)}`,style:{background:gt?.bg,borderColor:gt?.border},children:n.toUpperCase()}),p.jsx("code",{className:`min-w-0 max-w-full overflow-x-auto rounded px-2.5 py-1 font-mono text-sm sm:text-base ${r==="dark"?"bg-gray-800 text-blue-300":"bg-gray-100 text-gray-900"}`,children:e}),p.jsxs("button",{type:"button",className:"inline-flex min-h-9 items-center gap-1.5 rounded-md border px-2.5 py-1 text-xs","aria-label":"Copy endpoint link",onClick:()=>{Ze()},children:[D?p.jsx(fg,{className:"h-3.5 w-3.5"}):p.jsx(lA,{className:"h-3.5 w-3.5"}),D?"Copied":"Copy link"]})]}),F.summary&&p.jsx("h1",{className:"mb-2 text-2xl font-bold tracking-tight sm:text-3xl",children:F.summary}),F.description&&p.jsx("p",{className:`max-w-3xl whitespace-pre-wrap leading-relaxed ${G}`,children:F.description}),p.jsxs("div",{className:"mt-4 flex flex-wrap gap-3 text-sm",children:[F.deprecated&&p.jsxs("span",{className:r==="dark"?"inline-flex items-center gap-1 text-orange-300":"inline-flex items-center gap-1 text-orange-600",children:[p.jsx(ud,{className:"h-4 w-4"}),"Deprecated"]}),_?.length?p.jsxs("span",{className:r==="dark"?"inline-flex items-center gap-1 text-red-300":"inline-flex items-center gap-1 text-red-600",children:[p.jsx(cA,{className:"h-4 w-4"}),"Authentication required"]}):p.jsxs("span",{className:r==="dark"?"inline-flex items-center gap-1 text-green-300":"inline-flex items-center gap-1 text-green-600",children:[p.jsx(oA,{className:"h-4 w-4"}),"No authentication required"]}),c&&(se?p.jsx("span",{className:r==="dark"?"text-green-300":"text-green-600",children:"Observed at runtime"}):p.jsx("span",{className:c.discoveryComplete?r==="dark"?"text-amber-300":"text-amber-600":G,children:c.discoveryComplete?"Not found at runtime":"Not observed in partial runtime discovery"})),F.operationId&&p.jsxs("span",{className:G,children:["operationId: ",p.jsx("code",{children:F.operationId})]})]}),(s.showExtensions||s.showCommonExtensions)&&Ke.length>0&&p.jsx("div",{className:`mt-4 rounded-lg border p-3 text-xs ${we}`,children:Ke.map(([de,ge])=>p.jsxs("div",{children:[p.jsx("code",{children:de}),": ",typeof ge=="string"?ge:JSON.stringify(ge)]},de))})]}),X.length>0&&Ne(W?.parameters||"Parameters","parameters",p.jsx("div",{className:"space-y-3",children:X.map(de=>p.jsxs("div",{className:`rounded-lg border p-4 ${we}`,children:[p.jsxs("div",{className:"mb-2 flex flex-wrap items-center gap-2",children:[p.jsx("code",{className:"font-medium",children:de.name}),p.jsx("span",{className:`rounded px-2 py-0.5 text-xs ${he}`,children:de.in}),de.required&&p.jsx("span",{className:`rounded px-2 py-0.5 text-xs ${$}`,children:"required"}),de.deprecated&&p.jsx("span",{className:`rounded px-2 py-0.5 text-xs ${te}`,children:"deprecated"})]}),de.description&&p.jsx("p",{className:`mb-3 text-sm ${G}`,children:de.description}),de.schema&&p.jsx(Dr,{spec:t,schema:de.schema,theme:r,required:de.required,...ee})]},`${de.in}:${de.name}`))})),_e&&Ne(W?.requestBody||"Request Body","requestBody",p.jsxs("div",{className:"space-y-4",children:[_e.description&&p.jsx("p",{className:G,children:_e.description}),Object.entries(_e.content||{}).map(([de,ge])=>p.jsxs("div",{className:`rounded-lg border p-4 ${we}`,children:[p.jsxs("div",{className:"mb-3 flex flex-wrap items-center gap-2",children:[p.jsx("code",{className:`rounded px-2 py-1 text-xs ${L}`,children:de}),_e.required&&p.jsx("span",{className:`rounded px-2 py-0.5 text-xs ${$}`,children:"required"})]}),ge.schema&&p.jsx(Dr,{spec:t,schema:ge.schema,theme:r,...ee}),ge.example!==void 0&&p.jsx("div",{className:"mt-3",children:p.jsx(Rr,{code:JSON.stringify(ge.example,null,2),language:"json",title:"Example payload",theme:r,wrap:!0})})]},de))]})),Ne(W?.responses||"Responses","responses",p.jsx("div",{className:"space-y-4",children:Object.entries(F.responses||{}).map(([de,ge])=>{const Te=Ln.isReference(ge)?Ln.resolveReference(t,ge.$ref):ge;return p.jsxs("div",{className:`rounded-lg border p-4 ${we}`,children:[p.jsxs("div",{className:"mb-3 flex flex-wrap items-center gap-2",children:[p.jsx("span",{className:"rounded border px-2.5 py-1 text-sm font-bold",children:de}),p.jsx("span",{className:`text-sm ${G}`,children:Te.description})]}),Te.headers&&s.showRequestHeaders&&p.jsxs("div",{className:"mb-3 text-sm",children:[p.jsx("span",{className:"font-medium",children:"Headers:"})," ",Object.keys(Te.headers).join(", ")]}),Te.content&&Object.entries(Te.content).map(([Ie,Xe])=>{const ht=Xe.examples&&Object.values(Xe.examples)[s.payloadSampleIdx||0];return p.jsxs("div",{className:"mt-3",children:[p.jsx("code",{className:`rounded px-1.5 py-0.5 text-xs ${L}`,children:Ie}),Xe.schema&&p.jsx("div",{className:"mt-2",children:p.jsx(Dr,{spec:t,schema:Xe.schema,theme:r,...ee})}),Xe.example!==void 0&&p.jsx("div",{className:"mt-3",children:p.jsx(Rr,{code:JSON.stringify(Xe.example,null,2),language:"json",title:"Example response",theme:r,wrap:!0})}),ht&&p.jsx("div",{className:"mt-3",children:p.jsx(Rr,{code:JSON.stringify(ht.value??ht,null,2),language:"json",title:"Example response",theme:r,wrap:!0})})]},Ie)})]},de)})})),s.tryIt?.enabled!==!1&&Ne(W?.tryIt||"Try It","tryIt",p.jsx(aO,{spec:t,path:e,method:n,theme:r,options:s,initialRequestTab:f.requestTab,initialScriptTab:f.scriptTab,onRequestChange:M,onOpenInApiClient:d},`${n}:${e}:${s.tryIt?.defaultServer||""}`)),s.codeSamples?.enabled!==!1&&Ne(W?.codeExamples||"Code Examples","codeSamples",p.jsxs("div",{className:"min-w-0",children:[p.jsx("div",{className:"mb-3 flex max-w-full gap-1 overflow-x-auto pb-1",role:"tablist","aria-label":"Code example language",children:xe.map(de=>p.jsx("button",{ref:ge=>{O.current[de]=ge},id:P(de),type:"button",role:"tab","aria-controls":ue,"aria-selected":C===de,tabIndex:C===de?0:-1,onClick:()=>Re(de),onKeyDown:ge=>Be(ge,de),className:`shrink-0 rounded-md px-3 py-2 text-sm ${C===de?"bg-blue-600 text-white":r==="dark"?"bg-gray-800 text-gray-200":"bg-gray-100 text-gray-700"}`,children:m0(de)},de))}),p.jsx("div",{role:"tabpanel",id:ue,"aria-labelledby":P(C),children:p.jsx(Rr,{code:QA(B,C),language:C==="curl"?"bash":C,title:m0(C),theme:r,wrap:!!(typeof s.theme=="object"&&s.theme.typography?.code?.wrap)})})]})),F.externalDocs&&p.jsx("p",{className:"pb-4 text-sm",children:p.jsx("a",{className:"text-blue-600 underline",href:F.externalDocs.url,target:"_blank",rel:"noopener noreferrer",children:F.externalDocs.description||"External documentation"})})]})})};function hO(t){const e=t?.["x-flexdoc-priority"]??t?.["x-flexdoc-weight"];return typeof e=="number"&&Number.isFinite(e)?e:0}function pO(t,e){let n=hO(t)*1e3;return t?.["x-flexdoc-highlight"]===!0&&(n+=1e5),t?.deprecated||(n+=100),t?.summary&&(n+=40),t?.description&&(n+=20),t?.operationId&&(n+=10),Array.isArray(t?.tags)&&t.tags.length>0&&(n+=5),e.toLowerCase()==="get"?n+=3:e.toLowerCase()==="post"&&(n+=2),n}function mO(t){let e=0;const n=[];for(const[r,s]of Object.entries(t.paths))for(const a of Ln.getHttpMethods(s)){const c=s[a];n.push({path:r,method:a,operation:c,score:pO(c,a),order:e++})}return n.sort((r,s)=>s.score-r.score||r.order-s.order).slice(0,6)}const gO=({spec:t,onEndpointSelect:e,theme:n="light"})=>{const r=n==="dark",s=r?"border-gray-700 bg-gray-800 text-white shadow-lg":"border-gray-200 bg-white text-gray-900 shadow-sm",a=r?"text-gray-300":"text-gray-600",c=r?"hover:border-gray-600 hover:bg-gray-700":"hover:border-blue-300 hover:bg-blue-50",d=Object.values(t.paths).reduce((g,b)=>{for(const v of Ln.getHttpMethods(b))g[v]=(g[v]||0)+1,g.total+=1;return g},{total:0}),f=mO(t),h=[{icon:mg,title:"Total endpoints",value:d.total,surface:r?"bg-blue-900":"bg-blue-100",iconClass:r?"text-blue-300":"text-blue-600"},{icon:yg,title:"Servers",value:t.servers?.length||0,surface:r?"bg-green-900":"bg-green-100",iconClass:r?"text-green-300":"text-green-600"},{icon:xg,title:"Tags",value:t.tags?.length||0,surface:r?"bg-purple-900":"bg-purple-100",iconClass:r?"text-purple-300":"text-purple-600"},{icon:pA,title:"Security schemes",value:t.components?.securitySchemes?Object.keys(t.components.securitySchemes).length:0,surface:r?"bg-orange-900":"bg-orange-100",iconClass:r?"text-orange-300":"text-orange-600"}];return p.jsx("div",{className:`flex-1 overflow-y-auto ${r?"bg-gray-900":"bg-gray-50"}`,children:p.jsxs("div",{className:"p-4 md:p-8",children:[p.jsxs("header",{className:"mb-8",children:[p.jsxs("div",{className:"mb-4 flex items-center gap-4",children:[p.jsx("div",{className:`flex h-12 w-12 items-center justify-center rounded-xl ${r?"bg-blue-700":"bg-gradient-to-br from-blue-500 to-blue-600"}`,children:p.jsx(mg,{className:"h-6 w-6 text-white"})}),p.jsxs("div",{className:"min-w-0",children:[p.jsx("h1",{className:`truncate text-2xl font-bold md:text-3xl ${r?"text-white":"text-gray-900"}`,children:t.info.title}),p.jsxs("p",{className:a,children:["Version ",t.info.version]})]})]}),t.info.description&&p.jsx("p",{className:`max-w-4xl text-lg leading-relaxed ${a}`,children:t.info.description})]}),p.jsx("div",{className:"mb-8 grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4",children:h.map(({icon:g,title:b,value:v,surface:S,iconClass:A})=>p.jsx("div",{className:`rounded-xl border p-4 ${s}`,children:p.jsxs("div",{className:"flex items-center gap-3",children:[p.jsx("div",{className:`flex h-10 w-10 items-center justify-center rounded-lg ${S}`,children:p.jsx(g,{className:`h-5 w-5 ${A}`})}),p.jsxs("div",{children:[p.jsx("p",{className:`text-sm font-medium ${a}`,children:b}),p.jsx("p",{className:"text-xl font-bold",children:v})]})]})},b))}),p.jsxs("section",{className:`mb-8 rounded-xl border p-4 md:p-6 ${s}`,"aria-labelledby":"method-distribution-heading",children:[p.jsx("h2",{id:"method-distribution-heading",className:"mb-4 text-lg font-semibold md:text-xl",children:"HTTP method distribution"}),p.jsx("div",{className:"grid grid-cols-2 gap-4 md:grid-cols-4 lg:grid-cols-6",children:["get","post","put","delete","patch","options"].map(g=>p.jsxs("div",{className:"text-center",children:[p.jsx("div",{className:`mx-auto mb-2 flex items-center justify-center rounded-lg px-3 py-1.5 ${Ln.getMethodColor(g,n)}`,children:p.jsx("span",{className:"text-sm font-medium",children:g.toUpperCase()})}),p.jsx("p",{className:"font-bold",children:d[g]||0})]},g))})]}),p.jsxs("section",{className:`mb-8 rounded-xl border p-4 md:p-6 ${s}`,"aria-labelledby":"endpoint-highlights-heading",children:[p.jsxs("div",{className:"mb-4",children:[p.jsx("h2",{id:"endpoint-highlights-heading",className:"text-lg font-semibold md:text-xl",children:"Endpoint highlights"}),p.jsx("p",{className:`mt-1 text-xs ${a}`,children:"Prioritized by explicit FlexDoc metadata when supplied, then by documentation completeness. This is not usage analytics."})]}),p.jsxs("div",{className:"space-y-3",children:[f.map(({path:g,method:b,operation:v})=>p.jsxs("button",{type:"button",onClick:()=>e(g,b),className:`w-full rounded-lg border p-3 text-left transition-colors ${c} ${r?"border-gray-700":"border-gray-200"}`,children:[p.jsxs("div",{className:"flex items-center gap-3",children:[p.jsx("span",{className:`rounded border px-2 py-1 text-xs font-bold ${Ln.getMethodColor(b,n)}`,children:b.toUpperCase()}),p.jsx("code",{className:`break-all font-mono text-sm ${r?"text-blue-300":"text-blue-600"}`,children:g})]}),v?.summary&&p.jsx("p",{className:`ml-14 mt-2 text-sm ${a}`,children:v.summary})]},`${b}-${g}`)),f.length===0&&p.jsx("p",{className:`py-4 text-sm ${a}`,children:"No operations are defined in this specification."})]})]}),p.jsxs("div",{className:"grid grid-cols-1 gap-6 lg:grid-cols-2",children:[(t.info.contact||t.info.license)&&p.jsxs("section",{className:`rounded-xl border p-4 md:p-6 ${s}`,"aria-labelledby":"api-information-heading",children:[p.jsx("h2",{id:"api-information-heading",className:"mb-4 text-lg font-semibold md:text-xl",children:"Information"}),p.jsxs("div",{className:"space-y-4",children:[t.info.contact&&p.jsxs("div",{children:[p.jsx("h3",{className:"mb-2 font-medium",children:"Contact"}),t.info.contact.name&&p.jsx("p",{className:`text-sm ${a}`,children:t.info.contact.name}),t.info.contact.email&&p.jsx("a",{className:`block text-sm underline ${r?"text-blue-300":"text-blue-600"}`,href:`mailto:${t.info.contact.email}`,children:t.info.contact.email}),t.info.contact.url&&p.jsxs("a",{href:t.info.contact.url,target:"_blank",rel:"noopener noreferrer",className:`inline-flex items-center gap-1 text-sm ${r?"text-blue-300":"text-blue-600"}`,children:["Website ",p.jsx(fd,{className:"h-3 w-3"})]})]}),t.info.license&&p.jsxs("div",{children:[p.jsx("h3",{className:"mb-2 font-medium",children:"License"}),t.info.license.url?p.jsxs("a",{href:t.info.license.url,target:"_blank",rel:"noopener noreferrer",className:`inline-flex items-center gap-1 text-sm ${r?"text-blue-300":"text-blue-600"}`,children:[t.info.license.name,p.jsx(fd,{className:"h-3 w-3"})]}):p.jsx("p",{className:`text-sm ${a}`,children:t.info.license.name})]})]})]}),t.servers&&t.servers.length>0&&p.jsxs("section",{className:`rounded-xl border p-4 md:p-6 ${s}`,"aria-labelledby":"api-servers-heading",children:[p.jsx("h2",{id:"api-servers-heading",className:"mb-4 text-lg font-semibold md:text-xl",children:"Servers"}),p.jsx("div",{className:"space-y-3",children:t.servers.map((g,b)=>p.jsxs("div",{className:`rounded-lg p-3 ${r?"bg-gray-700/50":"bg-gray-50"}`,children:[p.jsx("code",{className:`break-all font-mono text-sm ${r?"text-blue-300":"text-blue-600"}`,children:g.url}),g.description&&p.jsx("p",{className:`mt-1 text-sm ${a}`,children:g.description})]},`${g.url}:${b}`))})]})]})]})})},yO=({footerClasses:t,footer:e})=>{const n=e?.copyright,r=e?.link||[];return p.jsx("footer",{className:`${t} w-full border-t`,children:p.jsxs("div",{className:"mx-auto flex min-h-12 w-full max-w-[1600px] flex-col gap-2 px-4 py-3 text-xs sm:flex-row sm:items-center sm:justify-between sm:px-6 sm:text-sm",children:[p.jsx("p",{children:n||p.jsxs(p.Fragment,{children:["Powered by ",p.jsx("a",{href:"https://prauga.github.io/flexdoc",target:"_blank",rel:"noopener noreferrer",className:"font-semibold hover:opacity-80 transition-opacity",children:"FlexDoc"})]})}),r.length>0&&p.jsx("nav",{"aria-label":"Footer links",className:"flex flex-wrap gap-x-4 gap-y-2",children:r.map(s=>p.jsx("a",{href:s.url,target:"_blank",rel:"noopener noreferrer",className:"hover:opacity-80",children:s.text},`${s.text}:${s.url}`))})]})})},bO=(t,e,n)=>t==="dark"?n:e,xO="Runtime intelligence returned an invalid snapshot.";function Di(){throw new Error(xO)}function Sl(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function Gr(t,e){const n=t[e];return(typeof n!="string"||n.trim()==="")&&Di(),n}function Nv(t,e){const n=t[e];if(n!==void 0)return(typeof n!="string"||n.trim()==="")&&Di(),n}function $a(t,e){const n=t[e];return(typeof n!="number"||!Number.isInteger(n)||n<0)&&Di(),n}function vO(t){return Sl(t)||Di(),{method:Gr(t,"method"),path:Gr(t,"path")}}function Dh(t){return Array.isArray(t)||Di(),t.map(vO)}function wO(t){Sl(t)||Di(),(!Sl(t.runtime)||!Sl(t.summary))&&Di(),typeof t.discoveryComplete!="boolean"&&Di();const e={name:Gr(t.runtime,"name"),version:Gr(t.runtime,"version"),platform:Gr(t.runtime,"platform"),arch:Gr(t.runtime,"arch")},n={documented:$a(t.summary,"documented"),runtime:$a(t.summary,"runtime"),matched:$a(t.summary,"matched"),runtimeOnly:$a(t.summary,"runtimeOnly"),documentedOnly:$a(t.summary,"documentedOnly")},r={framework:Gr(t,"framework"),runtime:e,discoveryComplete:t.discoveryComplete,routes:Dh(t.routes),runtimeOnly:Dh(t.runtimeOnly),documentedOnly:Dh(t.documentedOnly),summary:n},s=Nv(t,"frameworkVersion");s&&(r.frameworkVersion=s);const a=Nv(t,"serverOrigin");if(a&&(r.serverOrigin=a),t.server!==void 0){Sl(t.server)||Di();const c=t.server.localPort;c!==void 0&&(typeof c!="number"||!Number.isInteger(c)||c<=0||c>65535)&&Di(),r.server=c===void 0?{}:{localPort:c}}return t.environment!==void 0&&(Sl(t.environment)||Di(),r.environment={name:Gr(t.environment,"name")}),r}const SO=60;function AO(t,e,n=SO){const r=Math.max(0,Math.min(Math.max(0,e-20),Math.max(0,t-n)));return{start:r,end:Math.min(t,r+n)}}const _h=44;function kO(t){return Array.from(t.querySelectorAll('button:not([disabled]), input:not([disabled]), [tabindex]:not([tabindex="-1"])'))}const CO=({spec:t,theme:e,onEndpointSelect:n,onHome:r,onOpenSettings:s,onOpenApiClient:a,onOpenRuntime:c,onSendCurrent:d,messages:f})=>{const[h,g]=I.useState(!1),[b,v]=I.useState(""),[S,A]=I.useState(0),C=I.useRef(null),T=I.useRef(null),D=I.useRef([]),j=h&&typeof document<"u"&&Array.from(document.querySelectorAll('[data-api-client-send="true"]')).some(we=>!we.closest(".hidden")),E=I.useMemo(()=>{const we=[{id:"overview",label:f?.openOverview||"Open Overview",action:r},{id:"api-client",label:f?.openApiClient||"Open API Client",action:a},...c?[{id:"runtime",label:f?.openRuntime||"Open Runtime Intelligence",action:c}]:[],{id:"settings",label:f?.openSettings||"Open Viewer Settings",action:s},...d&&j?[{id:"send-current",label:f?.sendCurrentRequest||"Send current request",action:d}]:[]];for(const[ye,xe]of Object.entries(t.paths))for(const _ of Ln.getHttpMethods(xe))we.push({id:`operation:${_}:${ye}`,label:`${_.toUpperCase()} ${ye}`,action:()=>n(ye,_)});return we},[j,f?.openApiClient,f?.openOverview,f?.openRuntime,f?.openSettings,f?.sendCurrentRequest,n,r,a,c,s,d,t]),O=b.trim().toLowerCase(),R=I.useMemo(()=>O?E.filter(we=>we.label.toLowerCase().includes(O)):E,[E,O]),{start:B,end:M}=AO(R.length,S),z=R.slice(B,M),F=I.useCallback(()=>{g(!1),v(""),A(0)},[]),X=I.useCallback(we=>{we&&(F(),we.action())},[F]);if(I.useEffect(()=>{const we=ye=>{!(ye.ctrlKey||ye.metaKey)||ye.key.toLowerCase()!=="k"||(ye.preventDefault(),g(xe=>!xe))};return document.addEventListener("keydown",we),()=>document.removeEventListener("keydown",we)},[]),I.useEffect(()=>{if(!h||typeof document>"u")return;const we=document.activeElement instanceof HTMLElement?document.activeElement:null,ye=document.body.style.overflow;document.body.style.overflow="hidden",requestAnimationFrame(()=>T.current?.focus());const xe=_=>{if(_.key==="Escape"){_.preventDefault(),F();return}if(_.key==="ArrowDown"||_.key==="ArrowUp"||_.key==="Home"||_.key==="End"){_.preventDefault(),A(L=>!R.length||_.key==="Home"?0:_.key==="End"?R.length-1:_.key==="ArrowDown"?(L+1)%R.length:(L-1+R.length)%R.length);return}if(_.key==="Enter"){_.preventDefault(),X(R[S]);return}if(_.key!=="Tab"||!C.current)return;const ee=kO(C.current);if(!ee.length)return;const he=ee[0],$=ee[ee.length-1],te=document.activeElement;_.shiftKey&&(te===he||!C.current.contains(te))?(_.preventDefault(),$.focus()):!_.shiftKey&&(te===$||!C.current.contains(te))&&(_.preventDefault(),he.focus())};return document.addEventListener("keydown",xe),()=>{document.body.style.overflow=ye,document.removeEventListener("keydown",xe),we?.isConnected&&we.focus()}},[S,X,F,h,R]),I.useEffect(()=>{D.current[S]?.scrollIntoView({block:"nearest"})},[S]),!h)return null;const W=e==="dark"?"border-gray-700 bg-gray-900 text-gray-100":"border-gray-200 bg-white text-gray-900",G=e==="dark"?"bg-blue-950/70 text-blue-100":"bg-blue-50 text-blue-900";return p.jsxs("div",{className:"fixed inset-0 z-[80]",children:[p.jsx("button",{type:"button","aria-label":f?.closeCommandPalette||"Close command palette",className:"absolute inset-0 bg-black/40",onClick:F}),p.jsxs("div",{ref:C,role:"dialog","aria-modal":"true","aria-label":f?.commandPalette||"Command palette",className:`relative mx-auto mt-[10vh] w-[min(94vw,56rem)] overflow-hidden rounded-xl border shadow-2xl ${W}`,children:[p.jsx("input",{ref:T,"aria-label":f?.searchCommands||"Search commands",className:"w-full border-b bg-transparent p-3 text-sm outline-none",placeholder:f?.searchCommandsPlaceholder||"Search operations and commands…",value:b,onChange:we=>{v(we.target.value),A(0)}}),p.jsxs("div",{className:"max-h-[60vh] overflow-y-auto p-2",role:"listbox","aria-label":f?.commandResults||"Command results",children:[B>0&&p.jsx("div",{"aria-hidden":"true",style:{height:B*_h}}),z.map((we,ye)=>{const xe=B+ye;return p.jsx("button",{ref:_=>{D.current[xe]=_},type:"button",role:"option","aria-selected":xe===S,"aria-posinset":xe+1,"aria-setsize":R.length,className:`w-full rounded-md p-2 text-left text-sm ${xe===S?G:""}`,style:{height:_h,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},onMouseEnter:()=>A(xe),onClick:()=>X(we),children:we.label},we.id)}),M<R.length&&p.jsx("div",{"aria-hidden":"true",style:{height:(R.length-M)*_h}}),!R.length&&p.jsx("div",{className:"p-3 text-sm opacity-65",children:f?.noCommandResults||"No matching commands."})]})]})]})},NO={parameters:"Parameters",requestBody:"Request body",responses:"Responses",tryIt:"Try It",codeSamples:"Code examples"};function TO(t){return t===void 0?"host":Array.isArray(t)?"custom":t==="none"?"minimal":t}function jO(t){return Array.from(t.querySelectorAll('button:not([disabled]), select:not([disabled]), input:not([disabled]), a[href], [tabindex]:not([tabindex="-1"])')).filter(e=>e.getAttribute("aria-hidden")!=="true")}const EO=({open:t,theme:e,hostTheme:n,viewerTheme:r,viewerExpand:s,effectiveExpandedSections:a,messages:c,onThemeChange:d,onExpandChange:f,onClose:h})=>{const g=I.useRef(null),b=I.useRef(null);if(I.useEffect(()=>{if(!t||typeof document>"u")return;const T=document.activeElement instanceof HTMLElement?document.activeElement:null;b.current?.focus();const D=j=>{if(j.key==="Escape"){j.preventDefault(),h();return}if(j.key!=="Tab"||!g.current)return;const E=jO(g.current);if(E.length===0){j.preventDefault(),g.current.focus();return}const O=E[0],R=E[E.length-1],B=document.activeElement;j.shiftKey&&(B===O||!g.current.contains(B))?(j.preventDefault(),R.focus()):!j.shiftKey&&(B===R||!g.current.contains(B))&&(j.preventDefault(),O.focus())};return document.addEventListener("keydown",D),()=>{document.removeEventListener("keydown",D),T?.isConnected&&T.focus()}},[t,h]),!t)return null;const v=e==="dark",S=v?"border-gray-700 bg-gray-900 text-gray-100":"border-gray-200 bg-white text-gray-900",A=v?"border-gray-700 bg-gray-800 text-gray-100":"border-gray-300 bg-white text-gray-900",C=Array.isArray(s)?s.filter(T=>Cs.includes(T)):[];return p.jsxs("div",{className:"fixed inset-0 z-[70]",children:[p.jsx("button",{type:"button","aria-label":"Close settings backdrop",className:"absolute inset-0 bg-black/40",onClick:h}),p.jsxs("aside",{ref:g,role:"dialog","aria-modal":"true","aria-label":"Viewer settings",tabIndex:-1,className:`absolute inset-y-0 right-0 flex w-[min(92vw,24rem)] flex-col border-l shadow-2xl ${S}`,children:[p.jsxs("div",{className:"flex min-h-14 items-center justify-between border-b px-4",children:[p.jsxs("div",{children:[p.jsx("div",{className:"font-semibold",children:"Settings"}),p.jsx("div",{className:"text-xs opacity-65",children:"Preferences are saved for this documentation."})]}),p.jsx("button",{type:"button","aria-label":"Close settings",className:"inline-flex h-11 w-11 items-center justify-center rounded-md",onClick:h,children:p.jsx(gd,{className:"h-5 w-5"})})]}),p.jsxs("div",{className:"flex-1 space-y-6 overflow-y-auto p-4",children:[p.jsxs("section",{"aria-labelledby":"appearance-settings-heading",children:[p.jsx("h2",{id:"appearance-settings-heading",className:"mb-1 text-sm font-semibold",children:c?.viewerTheme||"Appearance"}),p.jsx("p",{className:"mb-3 text-xs opacity-65",children:"Override the documentation host theme on this device."}),p.jsxs("select",{"aria-label":c?.viewerTheme||"Viewer theme",className:`w-full rounded-md border px-3 py-2 text-sm ${A}`,value:r||"host",onChange:T=>d(T.target.value==="host"?void 0:T.target.value),children:[p.jsxs("option",{value:"host",children:["Use documentation default (",n,")"]}),p.jsx("option",{value:"light",children:c?.lightTheme||"Light"}),p.jsx("option",{value:"dark",children:c?.darkTheme||"Dark"}),p.jsx("option",{value:"high-contrast",children:c?.highContrast||"High contrast"})]})]}),p.jsxs("section",{"aria-labelledby":"expansion-settings-heading",children:[p.jsx("h2",{id:"expansion-settings-heading",className:"mb-1 text-sm font-semibold",children:"Default expanded sections"}),p.jsx("p",{className:"mb-3 text-xs opacity-65",children:"This preference overrides the documentation author's default. Opening or closing a section manually remains temporary."}),p.jsxs("select",{ref:b,"aria-label":"Default expanded sections",className:`w-full rounded-md border px-3 py-2 text-sm ${A}`,value:TO(s),onChange:T=>{const D=T.target.value;f(D==="host"?void 0:D==="custom"?[...a]:D)},children:[p.jsx("option",{value:"host",children:"Use documentation default"}),p.jsx("option",{value:"minimal",children:"Minimal"}),p.jsx("option",{value:"documentation",children:"Documentation"}),p.jsx("option",{value:"interactive",children:"Interactive"}),p.jsx("option",{value:"all",children:"All sections"}),p.jsx("option",{value:"custom",children:"Custom sections"})]}),Array.isArray(s)&&p.jsxs("fieldset",{className:"mt-4 space-y-2",children:[p.jsx("legend",{className:"mb-2 text-xs font-medium uppercase tracking-wide opacity-65",children:"Custom sections"}),Cs.map(T=>p.jsxs("label",{className:"flex min-h-9 items-center gap-2 text-sm",children:[p.jsx("input",{type:"checkbox",checked:C.includes(T),onChange:D=>{const j=new Set(C);D.target.checked?j.add(T):j.delete(T),f(Cs.filter(E=>j.has(E)))}}),NO[T]]},T))]}),s!==void 0&&p.jsx("button",{type:"button",className:"mt-5 rounded-md border px-3 py-2 text-sm",onClick:()=>f(void 0),children:"Reset to documentation defaults"})]})]})]})]})};function OO(t){return Array.from(t.querySelectorAll('button:not([disabled]), select:not([disabled]), input:not([disabled]), a[href], [tabindex]:not([tabindex="-1"])')).filter(e=>e.getAttribute("aria-hidden")!=="true")}const MO=({open:t,theme:e,loading:n,error:r,snapshot:s,onClose:a,onEndpointSelect:c,messages:d})=>{const f=I.useRef(null),h=I.useRef(null);if(I.useEffect(()=>{if(!t||typeof document>"u")return;const T=document.activeElement instanceof HTMLElement?document.activeElement:null,D=document.body.style.overflow;document.body.style.overflow="hidden",h.current?.focus();const j=E=>{if(E.key==="Escape"){E.preventDefault(),a();return}if(E.key!=="Tab"||!f.current)return;const O=OO(f.current);if(O.length===0){E.preventDefault(),f.current.focus();return}const R=O[0],B=O[O.length-1],M=document.activeElement;E.shiftKey&&(M===R||!f.current.contains(M))?(E.preventDefault(),B.focus()):!E.shiftKey&&(M===B||!f.current.contains(M))&&(E.preventDefault(),R.focus())};return document.addEventListener("keydown",j),()=>{document.body.style.overflow=D,document.removeEventListener("keydown",j),T?.isConnected&&T.focus()}},[t,a]),!t)return null;const g=e==="dark",b=g?"border-gray-700 bg-gray-900 text-gray-100":"border-gray-200 bg-white text-gray-900",v=g?"text-gray-400":"text-gray-600",S=g?"border-red-800 bg-red-950/50 text-red-200":"border-red-300 bg-red-50 text-red-800",A=g?"border-amber-700 bg-amber-950/50 text-amber-200":"border-amber-300 bg-amber-50 text-amber-900",C=g?"text-green-300":"text-green-700";return p.jsxs("div",{className:"fixed inset-0 z-50",children:[p.jsx("button",{tabIndex:-1,className:"absolute inset-0 bg-black/40","aria-label":d?.closeRuntimeIntelligence||"Close runtime intelligence",onClick:a}),p.jsxs("section",{ref:f,role:"dialog","aria-modal":"true","aria-labelledby":"runtime-intelligence-heading",tabIndex:-1,className:`absolute inset-y-0 right-0 w-[min(92vw,32rem)] overflow-y-auto border-l p-5 shadow-2xl ${b}`,children:[p.jsxs("div",{className:"mb-5 flex items-start justify-between gap-4",children:[p.jsxs("div",{children:[p.jsxs("div",{id:"runtime-intelligence-heading",className:"flex items-center gap-2 text-lg font-semibold",children:[p.jsx(dg,{className:"h-5 w-5"}),d?.runtimeIntelligence||"Runtime intelligence"]}),p.jsx("p",{className:`mt-1 text-sm ${v}`,children:d?.runtimeIntelligenceDescription||"Live route presence from the backend hosting this documentation."})]}),p.jsx("button",{ref:h,className:"inline-flex h-10 w-10 items-center justify-center rounded-md border","aria-label":d?.closeRuntimeIntelligencePanel||"Close runtime intelligence panel",onClick:a,children:p.jsx(gd,{className:"h-4 w-4"})})]}),n&&p.jsx("p",{className:v,children:d?.inspectingRuntimeRoutes||"Inspecting runtime routes…"}),r&&p.jsx("div",{role:"alert",className:`rounded-lg border p-3 text-sm ${S}`,children:r}),s&&p.jsxs("div",{className:"space-y-5",children:[p.jsxs("div",{className:"grid grid-cols-2 gap-3 text-sm",children:[p.jsxs("div",{className:"rounded-lg border p-3",children:[p.jsx("div",{className:v,children:d?.framework||"Framework"}),p.jsxs("div",{className:"font-semibold",children:[s.framework,s.frameworkVersion?` ${s.frameworkVersion}`:""]})]}),p.jsxs("div",{className:"rounded-lg border p-3",children:[p.jsx("div",{className:v,children:d?.matched||"Matched"}),p.jsxs("div",{className:"font-semibold",children:[s.summary.matched," / ",s.summary.documented]})]}),p.jsxs("div",{className:"col-span-2 rounded-lg border p-3",children:[p.jsx("div",{className:v,children:d?.runtime||"Runtime"}),p.jsxs("div",{className:"font-semibold",children:[s.runtime.name," ",s.runtime.version]}),p.jsxs("div",{className:`mt-1 text-xs ${v}`,children:[s.runtime.platform," · ",s.runtime.arch]})]}),(s.serverOrigin||s.server?.localPort)&&p.jsxs("div",{className:"col-span-2 rounded-lg border p-3",children:[p.jsx("div",{className:v,children:d?.runtimeServer||"Runtime server"}),s.serverOrigin&&p.jsx("code",{className:"block break-all text-xs",children:s.serverOrigin}),s.server?.localPort&&p.jsxs("div",{className:`mt-1 text-xs ${v}`,children:[d?.backendListenerPort||"Backend listener port"," ",s.server.localPort]})]}),s.environment?.name&&p.jsxs("div",{className:"col-span-2 rounded-lg border p-3",children:[p.jsx("div",{className:v,children:d?.environment||"Environment"}),p.jsx("div",{className:"font-semibold",children:s.environment.name})]})]}),!s.discoveryComplete&&p.jsxs("div",{className:`flex gap-2 rounded-lg border p-3 text-sm ${A}`,children:[p.jsx(md,{className:"mt-0.5 h-4 w-4 shrink-0"}),d?.routeDiscoveryPartial||"Route discovery is partial; documented routes not observed at runtime may be false positives."]}),p.jsx(Tv,{title:d?.implementedButUndocumented||"Implemented but undocumented",routes:s.runtimeOnly,empty:d?.noUndocumentedRuntimeRoutes||"No undocumented runtime routes discovered.",theme:e,warning:!0,openLabel:d?.openRuntimeRoute||"Open runtime route"}),p.jsx(Tv,{title:d?.documentedButNotObserved||"Documented but not observed",routes:s.documentedOnly,empty:d?.everyDocumentedRouteObserved||"Every documented route was observed.",theme:e,openLabel:d?.openRuntimeRoute||"Open runtime route",onSelect:c?T=>{c(T.path,T.method),a()}:void 0}),s.summary.runtimeOnly===0&&s.summary.documentedOnly===0&&s.discoveryComplete&&p.jsxs("div",{className:`flex items-center gap-2 text-sm ${C}`,children:[p.jsx(Oo,{className:"h-4 w-4"}),d?.runtimeAligned||"Runtime routes and OpenAPI paths are aligned."]})]})]})]})};function Tv({title:t,routes:e,empty:n,theme:r,warning:s=!1,onSelect:a,openLabel:c="Open runtime route"}){const d=r==="dark",f=d?"text-gray-400":"text-gray-600",h=s?d?"border-amber-700":"border-amber-300":"";return p.jsxs("section",{children:[p.jsxs("h3",{className:"mb-2 font-semibold",children:[t," ",p.jsxs("span",{className:f,children:["(",e.length,")"]})]}),e.length?p.jsx("div",{className:"space-y-2",children:e.map(g=>a?p.jsxs("button",{type:"button","aria-label":`${c} ${g.method} ${g.path}`,className:`flex w-full gap-2 rounded border p-2 text-left text-sm transition hover:border-blue-500 hover:bg-blue-500/10 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 ${h}`,onClick:()=>a(g),children:[p.jsx("span",{className:"w-14 shrink-0 font-semibold",children:g.method}),p.jsx("code",{className:"break-all",children:g.path})]},`${g.method}:${g.path}`):p.jsxs("div",{className:`flex gap-2 rounded border p-2 text-sm ${h}`,children:[p.jsx("span",{className:"w-14 shrink-0 font-semibold",children:g.method}),p.jsx("code",{className:"break-all",children:g.path})]},`${g.method}:${g.path}`))}):p.jsx("p",{className:`text-sm ${f}`,children:n})]})}function RO(t,e,n){if(!n)return null;const r=t.folders.find(c=>c.id===n&&c.collectionId===e);if(!r)return new Set;const s=new Set([r.id]);let a=!0;for(;a;){a=!1;for(const c of t.folders)c.collectionId!==e||!c.parentFolderId||s.has(c.id)||s.has(c.parentFolderId)&&(s.add(c.id),a=!0)}return s}function Ic(t,e,n){const r=RO(t,e,n);return t.requests.filter(s=>s.collectionId!==e?!1:r?!!s.folderId&&r.has(s.folderId):!0)}function DO(t,e){const n=new Map(t.map(c=>[c.id,c])),r=[],s=new Set;let a=n.get(e);for(;a&&!s.has(a.id);)s.add(a.id),r.unshift(a.name),a=a.parentFolderId?n.get(a.parentFolderId):void 0;return r.join(" / ")}function jv(t,e,n){const r=t.collections.find(a=>a.id===e)?.name||"Deleted collection";if(!n)return r;const s=DO(t.folders.filter(a=>a.collectionId===e),n);return s?`${r} / ${s}`:`${r} / Deleted folder`}function _O(t){return!t.error&&!t.scriptError&&t.scriptTests.every(e=>e.passed)}async function LO(t){const e=Ic(t.workspace,t.collectionId,t.folderId),n=t.runId||wn("run"),r=t.runName||jv(t.workspace,t.collectionId,t.folderId);let s=t.workspace;const a=[];let c=t.signal?.aborted===!0;for(let g=0;g<e.length&&!c;g+=1){if(t.signal?.aborted){c=!0;break}const b=e[g];t.onRequestStart?.(b,g,e.length);const v=$0(s,t.collectionId),S=Xd(s),A={...t.externalEnvironmentVariables||{},...S},C={...v,...t.externalVariables||{},...A},T=await vv({request:b.request,scripts:b.scripts,credentials:t.credentials,requestInterceptor:t.requestInterceptor,hostExecution:t.hostExecution,resolveAuth:R=>B0(s,b.collectionId,b.folderId,R||{type:"none"}),variables:C,collectionVariables:v,externalVariables:t.externalVariables,environmentVariables:A,signal:t.signal,fetcher:t.fetcher,now:t.now,onCollectionChanges:R=>{s=q0(s,b.collectionId,R),t.onCollectionChanges?.(R)},onEnvironmentChanges:R=>{s=Jd(s,R),t.onEnvironmentChanges?.(R)}}),D=t.signal?.aborted===!0,j=!D&&_O(T);let E;T.result&&!D&&(s=L0(s,{...T.result,collectionId:b.collectionId,folderId:b.folderId,runId:n,runName:r,runIndex:g+1,runTotal:e.length,runPassed:j}),E=s.history[0]?.id);const O={requestId:b.id,requestName:b.name,collectionId:b.collectionId,folderId:b.folderId,passed:j,cancelled:D,historyEntryId:E,outcome:T};if(a.push(O),t.onRequestComplete?.(O,g,e.length),D){c=!0;break}if(!O.passed&&t.stopOnFailure&&g<e.length-1){c=!0;break}}const d=a.filter(g=>g.passed).length,f=a.filter(g=>g.cancelled).length,h=a.filter(g=>!g.passed&&!g.cancelled).length;return{runId:n,runName:r,collectionId:t.collectionId,folderId:t.folderId,total:e.length,completed:a.length,passed:d,failed:h,cancelled:f,stopped:c,items:a,workspace:s}}function Xr(){return new Date().toISOString()}const BO=({request:t,scripts:e,onLoadRequest:n,onSelectedCollectionChange:r,onSelectedFolderChange:s,onRunCollection:a,onRunFolder:c,selectedCollectionId:d,selectedFolderId:f="",workspace:h,onWorkspaceChange:g,hostExecution:b,theme:v})=>{const[S,A]=I.useState(""),[C,T]=I.useState(""),[D,j]=I.useState(""),[E,O]=I.useState(null),R=h.collections.find(se=>se.id===d)||h.collections[0],B=I.useMemo(()=>h.folders.filter(se=>se.collectionId===R?.id),[R?.id,h.folders]),M=I.useMemo(()=>h.requests.filter(se=>se.collectionId===R?.id),[R?.id,h.requests]),z=B.find(se=>se.id===f),F=I.useMemo(()=>new Map(B.map(se=>[se.id,se])),[B]),X=I.useMemo(()=>{const se=[],de=new Set,ge=(Te,Ie)=>{B.filter(Xe=>Xe.parentFolderId===Te).forEach(Xe=>{de.has(Xe.id)||(de.add(Xe.id),se.push({folder:Xe,depth:Ie}),ge(Xe.id,Ie+1))})};return ge(void 0,0),B.forEach(Te=>{de.has(Te.id)||(de.add(Te.id),se.push({folder:Te,depth:0}),ge(Te.id,1))}),se},[B]),W=se=>{const de=[],ge=new Set;let Te=F.get(se);for(;Te&&!ge.has(Te.id);)ge.add(Te.id),de.unshift(Te.name),Te=Te.parentFolderId?F.get(Te.parentFolderId):void 0;return de.join(" / ")};I.useEffect(()=>{r?.(R?.id)},[r,R?.id]);const G=()=>{const se=S.trim();if(!se)return;const de=Xr(),ge=wn("collection");g(Te=>({...Te,collections:[...Te.collections,{id:ge,name:se,auth:{type:"none"},variables:[],createdAt:de,updatedAt:de}]})),r?.(ge),s?.(""),A(""),O(null)},we=se=>{if(!R)return;const de=Xr();g(ge=>({...ge,collections:ge.collections.map(Te=>Te.id===R.id?{...Te,auth:se,updatedAt:de}:Te)}))},ye=se=>{if(!z)return;const de=Xr();g(ge=>({...ge,folders:ge.folders.map(Te=>Te.id===z.id?{...Te,auth:se,updatedAt:de}:Te)}))},xe=()=>{if(!R)return;const se=Xr();g(de=>({...de,collections:de.collections.map(ge=>ge.id===R.id?{...ge,variables:[...ge.variables,{id:wn("variable"),key:"",value:"",enabled:!0}],updatedAt:se}:ge)}))},_=(se,de)=>{if(!R)return;const ge=Xr();g(Te=>({...Te,collections:Te.collections.map(Ie=>Ie.id===R.id?{...Ie,variables:Ie.variables.map(Xe=>Xe.id===se?{...Xe,...de}:Xe),updatedAt:ge}:Ie)}))},ee=se=>{if(!R)return;const de=Xr();g(ge=>({...ge,collections:ge.collections.map(Te=>Te.id===R.id?{...Te,variables:Te.variables.filter(Ie=>Ie.id!==se),updatedAt:de}:Te)}))},he=()=>{const se=C.trim();if(!se||!R)return;const de=Xr(),ge=wn("folder");g(Te=>({...Te,folders:[...Te.folders,{id:ge,collectionId:R.id,parentFolderId:f||void 0,name:se,auth:{type:"inherit"},createdAt:de,updatedAt:de}]})),s?.(ge),T("")},$=()=>{if(!R)return;const se=D.trim()||t.url||"Untitled request",de=Xr();if(E){g(Te=>({...Te,requests:Te.requests.map(Ie=>Ie.id===E?{...Ie,collectionId:R.id,folderId:f||void 0,name:se,request:ai(t),scripts:cn(e),updatedAt:de}:Ie)}));return}const ge={id:wn("request"),collectionId:R.id,folderId:f||void 0,name:se,request:ai(t),scripts:cn(e),createdAt:de,updatedAt:de};g(Te=>({...Te,requests:[...Te.requests,ge]})),O(ge.id),j(se)},te=se=>{const de=h.requests.find(ge=>ge.id===se);de&&(O(de.id),r?.(de.collectionId),s?.(de.folderId||""),j(de.name),n(ai(de.request),de.scripts?cn(de.scripts):void 0,de.collectionId,de.folderId))},L=se=>{g(de=>({...de,requests:de.requests.filter(ge=>ge.id!==se)})),E===se&&(O(null),j(""))},P=se=>{const de=h.folders.find(ge=>ge.id===se);g(ge=>Ik(ge,se)),f===se&&s?.(de?.parentFolderId||"")},ue=se=>{const de=Uk(h,se);g(de),d===se&&(r?.(de.collections[0]?.id||""),s?.(""),O(null),j(""))},Se=v==="dark"?"bg-gray-900 border-gray-700 text-gray-100":"bg-white border-gray-300 text-gray-900",Ne=v==="dark"?"text-gray-400":"text-gray-500",Re=v==="dark"?"bg-blue-500/10 text-blue-300":"bg-blue-500/10 text-blue-700",Be=se=>p.jsxs("div",{className:`group flex items-center gap-1 rounded-md ${E===se.id?"bg-blue-500/10":""}`,children:[p.jsxs("button",{type:"button",className:"min-w-0 flex-1 rounded-md px-2 py-2 text-left text-sm hover:bg-blue-500/10","aria-label":`Load saved request ${se.name}`,onClick:()=>te(se.id),children:[p.jsx("span",{className:"mr-2 font-mono text-xs font-semibold text-blue-600",children:se.request.method.toUpperCase()}),p.jsx("span",{className:"truncate",children:se.name})]}),p.jsx("button",{type:"button",className:"rounded-md p-2 opacity-70 hover:opacity-100","aria-label":`Delete saved request ${se.name}`,onClick:()=>L(se.id),children:p.jsx(si,{className:"h-4 w-4"})})]},se.id),Ze=(se,de,ge=new Set)=>{if(ge.has(se.id))return null;const Te=new Set(ge);Te.add(se.id);const Ie=W(se.id),Xe=B.filter(ht=>ht.parentFolderId===se.id);return p.jsxs(og.Fragment,{children:[p.jsxs("div",{className:"flex items-center gap-1",children:[p.jsx("button",{type:"button","aria-label":`Select folder ${Ie}`,className:`min-w-0 flex-1 rounded-md py-2 pr-2 text-left text-sm ${f===se.id?"bg-blue-500/10":""}`,style:{paddingLeft:`${8+de*16}px`},onClick:()=>s?.(se.id),children:se.name}),p.jsx("button",{type:"button",disabled:Ic(h,se.collectionId,se.id).length===0,"aria-label":`Run folder ${Ie}`,className:"rounded-md p-2 opacity-70 hover:opacity-100 disabled:cursor-not-allowed disabled:opacity-30",onClick:()=>c?.(se.collectionId,se.id),children:p.jsx(la,{className:"h-4 w-4"})}),p.jsx("button",{type:"button","aria-label":`Delete folder ${Ie}`,className:"rounded-md p-2 opacity-70 hover:opacity-100",onClick:()=>P(se.id),children:p.jsx(si,{className:"h-4 w-4"})})]}),Xe.map(ht=>Ze(ht,de+1,Te))]},se.id)},_e=(se,de,ge=new Set)=>{if(ge.has(se.id))return null;const Te=new Set(ge);Te.add(se.id);const Ie=M.filter(ht=>ht.folderId===se.id),Xe=B.filter(ht=>ht.parentFolderId===se.id);return Ie.length===0&&Xe.length===0?null:p.jsxs("div",{className:"space-y-1",children:[Ie.length>0&&p.jsxs(p.Fragment,{children:[p.jsx("div",{className:`mb-1 text-xs font-semibold uppercase tracking-wide ${Ne}`,style:{paddingLeft:`${8+de*12}px`},children:se.name}),p.jsx("div",{style:{paddingLeft:`${de*12}px`},children:Ie.map(Be)})]}),Xe.map(ht=>_e(ht,de+1,Te))]},se.id)},Ke=B.filter(se=>!se.parentFolderId),gt=f?W(f):"";return p.jsxs("section",{className:"space-y-4","aria-labelledby":"api-client-collections-heading",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx(sA,{className:"h-4 w-4"}),p.jsx("h3",{id:"api-client-collections-heading",className:"font-semibold",children:"Collections"})]}),p.jsxs("div",{className:"flex gap-2",children:[p.jsx("input",{"aria-label":"New collection name",className:`min-w-0 flex-1 rounded-md border px-2 py-2 text-sm ${Se}`,value:S,onChange:se=>A(se.target.value),placeholder:"New collection"}),p.jsx("button",{type:"button","aria-label":"Add collection",className:"rounded-md border px-3 py-2",onClick:G,children:p.jsx(ks,{className:"h-4 w-4"})})]}),p.jsx("div",{className:"space-y-2",children:h.collections.map(se=>p.jsxs("div",{className:"flex items-center gap-1",children:[p.jsx("button",{type:"button",className:`min-w-0 flex-1 rounded-md px-2 py-2 text-left text-sm font-medium ${se.id===R?.id?Re:""}`,onClick:()=>{r?.(se.id),s?.(""),O(null),j("")},children:se.name}),p.jsx("button",{type:"button",disabled:Ic(h,se.id).length===0,"aria-label":`Run collection ${se.name}`,className:"rounded-md p-2 opacity-70 hover:opacity-100 disabled:cursor-not-allowed disabled:opacity-30",onClick:()=>a?.(se.id),children:p.jsx(la,{className:"h-4 w-4"})}),h.collections.length>1&&p.jsx("button",{type:"button","aria-label":`Delete collection ${se.name}`,className:"rounded-md p-2 opacity-70 hover:opacity-100",onClick:()=>ue(se.id),children:p.jsx(si,{className:"h-4 w-4"})})]},se.id))}),R&&p.jsxs(p.Fragment,{children:[p.jsxs("div",{className:"space-y-2 border-t pt-3",children:[p.jsx("div",{className:"text-xs font-semibold uppercase tracking-wide",children:"Collection authorization"}),p.jsx(K0,{auth:R.auth,label:"Collection",hostExecution:b,onChange:we,theme:v}),p.jsx("p",{className:`text-xs ${Ne}`,children:"Requests set to inherit use the nearest folder override, then this collection authorization."})]}),p.jsxs("div",{className:"space-y-2 border-t pt-3",children:[p.jsxs("div",{className:"flex items-center justify-between",children:[p.jsx("span",{className:"text-xs font-semibold uppercase tracking-wide",children:"Collection variables"}),p.jsxs("button",{type:"button","aria-label":"Add collection variable",className:"inline-flex items-center gap-1 rounded-md border px-2 py-1 text-xs",onClick:xe,children:[p.jsx(ks,{className:"h-3.5 w-3.5"})," Add"]})]}),p.jsxs("div",{className:"space-y-2",children:[R.variables.map((se,de)=>p.jsxs("div",{className:"grid grid-cols-[auto_minmax(0,1fr)_minmax(0,1fr)_auto] items-center gap-1",children:[p.jsx("input",{"aria-label":`Collection variable ${de+1} enabled`,type:"checkbox",checked:se.enabled!==!1,onChange:ge=>_(se.id,{enabled:ge.target.checked})}),p.jsx("input",{"aria-label":`Collection variable ${de+1} key`,className:`min-w-0 rounded-md border px-2 py-1.5 font-mono text-xs ${Se}`,placeholder:"baseUrl",value:se.key,onChange:ge=>_(se.id,{key:ge.target.value})}),p.jsx("input",{"aria-label":`Collection variable ${de+1} value`,className:`min-w-0 rounded-md border px-2 py-1.5 font-mono text-xs ${Se}`,placeholder:"https://api.example.com",value:se.value,onChange:ge=>_(se.id,{value:ge.target.value})}),p.jsx("button",{type:"button","aria-label":`Remove collection variable ${de+1}`,className:"rounded-md p-1.5 opacity-70 hover:opacity-100",onClick:()=>ee(se.id),children:p.jsx(si,{className:"h-3.5 w-3.5"})})]},se.id)),R.variables.length===0&&p.jsxs("p",{className:`text-xs ${Ne}`,children:["Collection variables provide reusable defaults such as ",p.jsx("code",{children:"{{baseUrl}}"}),". Active environment values override matching collection keys."]})]})]}),p.jsxs("div",{className:"space-y-1 border-t pt-3",children:[p.jsxs("div",{className:"flex gap-2",children:[p.jsx("input",{"aria-label":"New folder name",className:`min-w-0 flex-1 rounded-md border px-2 py-2 text-sm ${Se}`,value:C,onChange:se=>T(se.target.value),placeholder:"Folder"}),p.jsx("button",{type:"button","aria-label":"Add folder",className:"rounded-md border px-3 py-2",onClick:he,children:p.jsx(iA,{className:"h-4 w-4"})})]}),p.jsx("p",{className:`text-xs ${Ne}`,children:gt?`New folders are created inside ${gt}.`:"New folders are created at the collection root."})]}),p.jsxs("div",{className:"space-y-1",children:[p.jsx("button",{type:"button","aria-label":"Select collection root",className:`w-full rounded-md px-2 py-2 text-left text-sm ${f===""?"bg-blue-500/10":""}`,onClick:()=>s?.(""),children:"Unfiled / collection root"}),Ke.map(se=>Ze(se,0))]}),z&&p.jsxs("div",{className:"space-y-2 border-t pt-3",children:[p.jsxs("div",{className:"text-xs font-semibold uppercase tracking-wide",children:["Folder authorization — ",gt]}),p.jsx(K0,{auth:z.auth,label:"Folder",allowInherit:!0,hostExecution:b,onChange:ye,theme:v})]}),p.jsxs("div",{className:"space-y-2 border-t pt-3",children:[p.jsx("input",{"aria-label":"Saved request name",className:`w-full rounded-md border px-2 py-2 text-sm ${Se}`,value:D,onChange:se=>j(se.target.value),placeholder:"Request name"}),p.jsxs("select",{"aria-label":"Saved request folder",className:`w-full rounded-md border px-2 py-2 text-sm ${Se}`,value:f,onChange:se=>s?.(se.target.value),children:[p.jsx("option",{value:"",children:"Unfiled"}),X.map(({folder:se,depth:de})=>p.jsx("option",{value:se.id,children:`${"— ".repeat(de)}${se.name}`},se.id))]}),p.jsxs("button",{type:"button",className:"inline-flex w-full items-center justify-center gap-2 rounded-md border px-3 py-2 text-sm font-medium",onClick:$,children:[p.jsx(fA,{className:"h-4 w-4"})," ",E?"Update request":"Save request"]})]}),p.jsxs("div",{className:"space-y-3 border-t pt-3",children:[M.filter(se=>!se.folderId).map(Be),Ke.map(se=>_e(se,0)),M.length===0&&p.jsx("p",{className:`px-2 text-xs ${Ne}`,children:"Save the current request to build a reusable collection."})]})]})]})};function qa(){return new Date().toISOString()}const $O=({workspace:t,onWorkspaceChange:e,theme:n})=>{const[r,s]=I.useState(""),a=t.environments.find(S=>S.id===t.activeEnvironmentId),c=n==="dark"?"bg-gray-900 border-gray-700 text-gray-100":"bg-white border-gray-300 text-gray-900",d=n==="dark"?"text-gray-400":"text-gray-500",f=()=>{const S=r.trim();if(!S)return;const A=qa(),C=wn("environment");e(T=>({...T,environments:[...T.environments,{id:C,name:S,variables:[],createdAt:A,updatedAt:A}],activeEnvironmentId:C})),s("")},h=S=>{if(!a)return;const A=qa();e(C=>({...C,environments:C.environments.map(T=>T.id===a.id?{...T,name:S,updatedAt:A}:T)}))},g=()=>{if(!a)return;const S=qa();e(A=>({...A,environments:A.environments.map(C=>C.id===a.id?{...C,variables:[...C.variables,{id:wn("variable"),key:"",value:"",enabled:!0}],updatedAt:S}:C)}))},b=(S,A)=>{if(!a)return;const C=qa();e(T=>({...T,environments:T.environments.map(D=>D.id===a.id?{...D,variables:D.variables.map(j=>j.id===S?{...j,...A}:j),updatedAt:C}:D)}))},v=S=>{if(!a)return;const A=qa();e(C=>({...C,environments:C.environments.map(T=>T.id===a.id?{...T,variables:T.variables.filter(D=>D.id!==S),updatedAt:A}:T)}))};return p.jsxs("section",{className:"space-y-3","aria-labelledby":"api-client-environment-heading",children:[p.jsxs("div",{className:"flex items-center justify-between gap-2",children:[p.jsx("h3",{id:"api-client-environment-heading",className:"font-semibold",children:"Environment"}),a&&p.jsx("button",{type:"button","aria-label":`Delete environment ${a.name}`,className:"rounded-md p-2 opacity-70 hover:opacity-100",onClick:()=>e(S=>Hk(S,a.id)),children:p.jsx(si,{className:"h-4 w-4"})})]}),p.jsxs("select",{"aria-label":"Active environment",className:`w-full rounded-md border px-2 py-2 text-sm ${c}`,value:t.activeEnvironmentId||"",onChange:S=>e(A=>({...A,activeEnvironmentId:S.target.value||void 0})),children:[p.jsx("option",{value:"",children:"No environment"}),t.environments.map(S=>p.jsx("option",{value:S.id,children:S.name},S.id))]}),p.jsxs("div",{className:"flex gap-2",children:[p.jsx("input",{"aria-label":"New environment name",className:`min-w-0 flex-1 rounded-md border px-2 py-2 text-sm ${c}`,value:r,onChange:S=>s(S.target.value),placeholder:"New environment"}),p.jsx("button",{type:"button","aria-label":"Add environment",className:"rounded-md border px-3 py-2",onClick:f,children:p.jsx(ks,{className:"h-4 w-4"})})]}),a&&p.jsxs("div",{className:"space-y-3",children:[p.jsx("input",{"aria-label":"Environment name",className:`w-full rounded-md border px-2 py-2 text-sm font-medium ${c}`,value:a.name,onChange:S=>h(S.target.value)}),p.jsxs("div",{className:"flex items-center justify-between",children:[p.jsx("span",{className:"text-xs font-semibold uppercase tracking-wide",children:"Variables"}),p.jsxs("button",{type:"button","aria-label":"Add environment variable",className:"inline-flex items-center gap-1 rounded-md border px-2 py-1 text-xs",onClick:g,children:[p.jsx(ks,{className:"h-3.5 w-3.5"})," Add"]})]}),p.jsxs("div",{className:"space-y-2",children:[a.variables.map((S,A)=>p.jsxs("div",{className:"grid grid-cols-[auto_minmax(0,1fr)_minmax(0,1fr)_auto] items-center gap-1",children:[p.jsx("input",{"aria-label":`Environment variable ${A+1} enabled`,type:"checkbox",checked:S.enabled!==!1,onChange:C=>b(S.id,{enabled:C.target.checked})}),p.jsx("input",{"aria-label":`Environment variable ${A+1} key`,className:`min-w-0 rounded-md border px-2 py-1.5 font-mono text-xs ${c}`,placeholder:"baseUrl",value:S.key,onChange:C=>b(S.id,{key:C.target.value})}),p.jsx("input",{"aria-label":`Environment variable ${A+1} value`,className:`min-w-0 rounded-md border px-2 py-1.5 font-mono text-xs ${c}`,placeholder:"https://api.example.com",value:S.value,onChange:C=>b(S.id,{value:C.target.value})}),p.jsx("button",{type:"button","aria-label":`Remove environment variable ${A+1}`,className:"rounded-md p-1.5 opacity-70 hover:opacity-100",onClick:()=>v(S.id),children:p.jsx(si,{className:"h-3.5 w-3.5"})})]},S.id)),a.variables.length===0&&p.jsxs("p",{className:`text-xs ${d}`,children:["Add variables such as ",p.jsx("code",{children:"{{baseUrl}}"})," or ",p.jsx("code",{children:"{{token}}"}),"."]})]})]})]})};function qO(t){const e=new Date(t);return Number.isNaN(e.getTime())?t:e.toLocaleString()}const zO=({workspace:t,onWorkspaceChange:e,onLoadRequest:n,onViewAll:r,theme:s})=>{const a=s==="dark"?"text-gray-400":"text-gray-500",c=f=>{const h=t.history.find(g=>g.id===f);h&&n(ai(h.request),h.scripts?cn(h.scripts):void 0,h.collectionId,h.folderId)},d=f=>{const h=t.history.find(g=>g.id===f);h&&(typeof window<"u"&&!window.confirm(`Delete this history entry?
|
|
54
76
|
|
|
55
|
-
`).trim(),c=a.tests.filter(Boolean).join(`
|
|
77
|
+
${h.executedMethod.toUpperCase()} ${h.resolvedUrl}`)||e(g=>({...g,history:g.history.filter(b=>b.id!==f)})))};return p.jsxs("section",{className:"space-y-3","aria-labelledby":"api-client-history-heading",children:[p.jsxs("div",{className:"flex items-center justify-between gap-2",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx(dd,{className:"h-4 w-4"}),p.jsx("h3",{id:"api-client-history-heading",className:"font-semibold",children:"Recent history"})]}),t.history.length>0&&r&&p.jsx("button",{type:"button",className:`text-xs underline underline-offset-2 ${a}`,onClick:r,children:"View all"})]}),p.jsxs("div",{className:"space-y-1",children:[t.history.slice(0,5).map(f=>{const h=f.status!==void 0?`${f.status}${f.statusText?` ${f.statusText}`:""}`:f.error?"Error":"Sent",g=f.responseTime!==void 0?` · ${f.responseTime} ms`:"",b=f.scriptTests?.filter(S=>S.passed).length||0,v=f.scriptTests?.length?`${b}/${f.scriptTests.length} tests passed`:f.scriptError?"Script error":void 0;return p.jsxs("div",{className:"group flex items-start gap-1 rounded-md",children:[p.jsxs("button",{type:"button",className:"min-w-0 flex-1 rounded-md px-2 py-2 text-left hover:bg-blue-500/10","aria-label":`Load history request ${f.executedMethod.toUpperCase()} ${f.resolvedUrl}`,onClick:()=>c(f.id),children:[p.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[p.jsx("span",{className:"font-mono font-semibold text-blue-600",children:f.executedMethod.toUpperCase()}),p.jsxs("span",{className:f.error?"text-red-600":a,children:[h,g]})]}),p.jsx("div",{className:"truncate font-mono text-xs",title:f.resolvedUrl,children:f.resolvedUrl}),v&&p.jsx("div",{className:`mt-1 text-[11px] ${f.scriptError?"text-red-600":a}`,children:v}),p.jsx("div",{className:`mt-1 text-[11px] ${a}`,children:qO(f.createdAt)})]}),p.jsx("button",{type:"button",className:"rounded-md p-2 opacity-70 hover:opacity-100","aria-label":`Delete history request ${f.executedMethod.toUpperCase()} ${f.resolvedUrl}`,onClick:()=>d(f.id),children:p.jsx(si,{className:"h-4 w-4"})})]},f.id)}),t.history.length===0&&p.jsx("div",{className:`rounded-md border border-dashed px-3 py-3 text-xs ${a}`,children:"Sent requests appear here for quick replay. Import or open a collection request, then Send it to start building history."})]}),t.history.length>0&&r&&p.jsxs("button",{type:"button",className:"w-full rounded-md border px-3 py-2 text-xs font-medium hover:bg-blue-500/10",onClick:r,children:["Open full history · ",t.history.length]})]})};function HO(t){return!!t.error||!!t.scriptError||t.status!==void 0&&t.status>=400||!!t.scriptTests?.some(e=>!e.passed)}function IO(t,e){const n=e.query.trim().toLowerCase();return t.history.filter(r=>{const s=r.collectionId?t.collections.find(g=>g.id===r.collectionId)?.name||"Deleted collection":"",a=r.folderId?t.folders.find(g=>g.id===r.folderId)?.name||"Deleted folder":"",c=!n||[r.executedMethod,r.resolvedUrl,r.status,r.statusText,s,a,r.runName].filter(g=>g!==void 0).some(g=>String(g).toLowerCase().includes(n)),d=e.method==="all"||r.executedMethod.toUpperCase()===e.method,f=HO(r),h=e.outcome==="all"||e.outcome==="success"&&!f||e.outcome==="failed"&&f||e.outcome==="tests"&&!!r.scriptTests?.length;return c&&d&&h})}function UO(t){const e=new Set,n=[];for(const r of t){if(!r.runId){n.push({kind:"entry",entry:r});continue}if(e.has(r.runId))continue;e.add(r.runId);const s=t.filter(c=>c.runId===r.runId).sort((c,d)=>(c.runIndex||Number.MAX_SAFE_INTEGER)-(d.runIndex||Number.MAX_SAFE_INTEGER)),a=Math.max(s.length,...s.map(c=>c.runTotal||0));n.push({kind:"run",group:{runId:r.runId,runName:r.runName||"Collection run",entries:s,total:a,captured:s.length,passed:s.filter(c=>c.runPassed===!0).length,failed:s.filter(c=>c.runPassed===!1).length,cancelled:0}})}return n}function Ev(t){const e=new Date(t);return Number.isNaN(e.getTime())?t:e.toLocaleString()}function Lh(t){return!!t.error||!!t.scriptError||t.status!==void 0&&t.status>=400||!!t.scriptTests?.some(e=>!e.passed)}function Bh(t){return t.error?"Request failed":t.status!==void 0?`${t.status}${t.statusText?` ${t.statusText}`:""}`:"Sent"}function FO(t){return(t||[]).filter(e=>e.enabled!==!1&&(e.key.trim()||e.value.trim()))}function Ov({title:t,values:e,mutedClass:n}){const r=FO(e);return r.length===0?null:p.jsxs("section",{className:"space-y-2",children:[p.jsx("h4",{className:"text-xs font-semibold uppercase tracking-wide",children:t}),p.jsx("div",{className:"overflow-hidden rounded-md border",children:r.map((s,a)=>p.jsxs("div",{className:"grid grid-cols-[minmax(8rem,0.35fr)_minmax(0,1fr)] gap-3 border-b px-3 py-2 text-xs last:border-b-0",children:[p.jsx("span",{className:"break-all font-mono font-medium",children:s.key||"—"}),p.jsx("span",{className:`break-all font-mono ${n}`,children:s.value})]},`${s.key}:${a}`))})]})}function Mv(t){const e=[`${t.passed} runner passed`,`${t.failed} runner failed`];return t.cancelled&&e.push(`${t.cancelled} cancelled`),e.join(" · ")}const VO=({workspace:t,onWorkspaceChange:e,onLoadRequest:n,onBack:r,theme:s,initialEntryId:a,initialRunId:c})=>{const[d,f]=I.useState(""),[h,g]=I.useState("all"),[b,v]=I.useState("all"),[S,A]=I.useState(c?void 0:a||t.history[0]?.id),[C,T]=I.useState(c),D=s==="dark"?"border-gray-700 bg-gray-900 text-gray-100":"border-gray-300 bg-white text-gray-900",j=s==="dark"?"border-gray-700 bg-gray-800/60 text-gray-100":"border-gray-200 bg-gray-50 text-gray-900",E=s==="dark"?"text-gray-400":"text-gray-500",O=s==="dark"?"border-gray-700 bg-gray-950 text-gray-100":"border-gray-200 bg-white text-gray-900",R=I.useMemo(()=>IO(t,{query:d,method:h,outcome:b}),[h,b,d,t]),B=I.useMemo(()=>UO(R),[R]),M=C&&B.find($=>$.kind==="run"&&$.group.runId===C)?.kind==="run"?B.find($=>$.kind==="run"&&$.group.runId===C).group:void 0,z=M?void 0:R.find($=>$.id===S)||R[0],F=z?.collectionId?t.collections.find($=>$.id===z.collectionId):void 0,X=z?.folderId?t.folders.find($=>$.id===z.folderId):void 0,W=()=>{A(void 0),T(void 0)},G=$=>{A($),T(void 0)},we=$=>{T($),A(void 0)},ye=$=>{n(ai($.request),$.scripts?cn($.scripts):void 0,$.collectionId,$.folderId),r()},xe=$=>{window.confirm("Delete this history entry? This cannot be undone.")&&(e(te=>({...te,history:te.history.filter(L=>L.id!==$)})),S===$&&A(void 0))},_=()=>{window.confirm("Clear all request history? This cannot be undone.")&&(e($=>({...$,history:[]})),W())},ee=z?.responseHeaders||[],he=z?.scriptTests?.filter($=>$.passed).length||0;return p.jsx("section",{className:`rounded-xl border p-4 md:p-5 ${j}`,"aria-labelledby":"api-client-history-page-heading",children:p.jsxs("div",{className:"space-y-4",children:[p.jsxs("header",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[p.jsxs("div",{className:"flex items-center gap-3",children:[p.jsxs("button",{type:"button",className:"inline-flex min-h-10 items-center gap-2 rounded-md border px-3 py-2 text-sm",onClick:r,children:[p.jsx(Eo,{className:"h-4 w-4"})," Client"]}),p.jsxs("div",{children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx(dd,{className:"h-5 w-5"}),p.jsx("h2",{id:"api-client-history-page-heading",className:"text-lg font-semibold",children:"Request history"})]}),p.jsxs("p",{className:`text-xs ${E}`,children:[t.history.length," persisted request",t.history.length===1?"":"s"," · newest first"]})]})]}),t.history.length>0&&p.jsxs("button",{type:"button",className:"inline-flex min-h-10 items-center gap-2 self-start rounded-md border px-3 py-2 text-sm text-red-600",onClick:_,children:[p.jsx(si,{className:"h-4 w-4"})," Clear history"]})]}),p.jsxs("div",{className:"grid gap-2 md:grid-cols-[minmax(0,1fr)_10rem_12rem]",children:[p.jsxs("label",{className:"relative",children:[p.jsx("span",{className:"sr-only",children:"Search history"}),p.jsx(gg,{className:`pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 ${E}`}),p.jsx("input",{"aria-label":"Search history",className:`w-full rounded-md border py-2 pl-9 pr-3 text-sm ${D}`,value:d,onChange:$=>{f($.target.value),W()},placeholder:"Search URL, status, collection or run…"})]}),p.jsxs("select",{"aria-label":"History method filter",className:`rounded-md border px-3 py-2 text-sm ${D}`,value:h,onChange:$=>{g($.target.value),W()},children:[p.jsx("option",{value:"all",children:"All methods"}),["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"].map($=>p.jsx("option",{value:$,children:$},$))]}),p.jsxs("select",{"aria-label":"History outcome filter",className:`rounded-md border px-3 py-2 text-sm ${D}`,value:b,onChange:$=>{v($.target.value),W()},children:[p.jsx("option",{value:"all",children:"All outcomes"}),p.jsx("option",{value:"success",children:"Successful HTTP"}),p.jsx("option",{value:"failed",children:"HTTP / script failures"}),p.jsx("option",{value:"tests",children:"With tests"})]})]}),p.jsxs("div",{className:"grid min-h-[32rem] gap-4 lg:grid-cols-[minmax(18rem,0.85fr)_minmax(0,1.35fr)]",children:[p.jsxs("div",{className:"max-h-[48rem] space-y-2 overflow-auto rounded-lg border p-2",children:[B.map($=>{if($.kind==="entry"){const P=$.entry,ue=z?.id===P.id,Se=Lh(P),Ne=P.collectionId?t.collections.find(Re=>Re.id===P.collectionId)?.name||"Deleted collection":void 0;return p.jsxs("button",{type:"button",className:`w-full rounded-md border px-3 py-3 text-left transition ${ue?"border-blue-500 bg-blue-500/10":"border-transparent hover:bg-blue-500/5"}`,onClick:()=>G(P.id),children:[p.jsxs("div",{className:"flex items-center justify-between gap-3 text-xs",children:[p.jsx("span",{className:"font-mono font-semibold text-blue-600",children:P.executedMethod.toUpperCase()}),p.jsxs("span",{className:Se?"text-red-600":E,children:[Bh(P),P.responseTime!==void 0?` · ${P.responseTime} ms`:""]})]}),p.jsx("div",{className:"mt-1 truncate font-mono text-xs",title:P.resolvedUrl,children:P.resolvedUrl}),p.jsxs("div",{className:`mt-1 flex items-center justify-between gap-2 text-[11px] ${E}`,children:[p.jsx("span",{className:"truncate",children:Ne||"Unsaved request"}),p.jsx("span",{children:Ev(P.createdAt)})]})]},P.id)}const te=$.group,L=M?.runId===te.runId;return p.jsxs("div",{className:`rounded-lg border ${L?"border-blue-500 bg-blue-500/5":""}`,children:[p.jsxs("button",{type:"button","aria-label":`Open collection run ${te.runName}`,className:"w-full px-3 py-3 text-left",onClick:()=>we(te.runId),children:[p.jsx("div",{className:"text-xs font-semibold text-blue-600",children:"Collection run"}),p.jsx("div",{className:"mt-1 truncate text-sm font-medium",children:te.runName}),p.jsxs("div",{className:`mt-1 text-[11px] ${E}`,children:[te.captured,"/",te.total," history entries · ",Mv(te)]})]}),p.jsx("div",{className:"border-t px-2 py-1",children:te.entries.map(P=>p.jsxs("button",{type:"button",className:`w-full rounded-md px-2 py-2 text-left text-xs hover:bg-blue-500/10 ${z?.id===P.id?"bg-blue-500/10":""}`,onClick:()=>G(P.id),children:[p.jsxs("div",{className:"flex items-center justify-between gap-2",children:[p.jsxs("span",{children:[p.jsx("span",{className:"mr-2 text-[10px] text-gray-500",children:P.runIndex||"–"}),p.jsx("span",{className:"font-mono font-semibold text-blue-600",children:P.executedMethod.toUpperCase()})]}),p.jsx("span",{className:Lh(P)?"text-red-600":E,children:Bh(P)})]}),p.jsx("div",{className:"mt-1 truncate font-mono",title:P.resolvedUrl,children:P.resolvedUrl})]},P.id))})]},te.runId)}),R.length===0&&p.jsx("div",{className:`px-3 py-8 text-center text-sm ${E}`,children:t.history.length===0?"Send a request to start building history.":"No history entries match these filters."})]}),p.jsxs("div",{className:"min-w-0 rounded-lg border p-4",children:[M&&p.jsxs("div",{className:"space-y-4",children:[p.jsxs("div",{className:"border-b pb-4",children:[p.jsx("div",{className:"text-xs font-semibold uppercase tracking-wide text-blue-600",children:"Collection run"}),p.jsx("h3",{className:"mt-1 text-lg font-semibold",children:M.runName}),p.jsxs("p",{className:`mt-1 text-sm ${E}`,children:[M.captured," / ",M.total," history entries captured · ",Mv(M)]}),p.jsx("p",{className:`mt-2 text-xs ${E}`,children:"Runner pass/fail is based on transport, scripts, and tests. An HTTP 4xx/5xx can therefore be a runner pass while still appearing as an HTTP failure in the request inspector."})]}),p.jsx("div",{className:"space-y-2",children:M.entries.map($=>p.jsxs("button",{type:"button","aria-label":`Inspect history ${$.runIndex||""}`,className:"w-full rounded-md border px-3 py-3 text-left hover:bg-blue-500/5",onClick:()=>G($.id),children:[p.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 text-sm",children:[p.jsxs("span",{children:[p.jsx("span",{className:`mr-2 text-xs ${E}`,children:$.runIndex||"–"}),p.jsx("span",{className:"font-mono font-bold text-blue-600",children:$.executedMethod.toUpperCase()})]}),p.jsxs("span",{className:$.runPassed===!1?"text-red-600":$.runPassed===!0?"text-green-600":E,children:[$.runPassed===!0?"Runner pass":$.runPassed===!1?"Runner fail":"Recorded",$.status!==void 0?` · HTTP ${$.status}`:""]})]}),p.jsx("div",{className:"mt-1 truncate font-mono text-xs",children:$.resolvedUrl})]},$.id))})]}),!M&&!z&&p.jsx("div",{className:`flex min-h-[20rem] items-center justify-center text-sm ${E}`,children:"Select a history entry or collection run to inspect it."}),z&&p.jsxs("div",{className:"space-y-5",children:[p.jsxs("div",{className:"space-y-2 border-b pb-4",children:[p.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[p.jsxs("div",{className:"min-w-0",children:[p.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-sm",children:[p.jsx("span",{className:"font-mono font-bold text-blue-600",children:z.executedMethod.toUpperCase()}),p.jsx("span",{className:Lh(z)?"text-red-600":E,children:Bh(z)}),z.responseTime!==void 0&&p.jsxs("span",{className:E,children:[z.responseTime," ms"]}),z.runPassed!==void 0&&p.jsx("span",{className:z.runPassed?"text-green-600":"text-red-600",children:z.runPassed?"Runner pass":"Runner fail"})]}),p.jsx("div",{className:"mt-1 break-all font-mono text-sm",children:z.resolvedUrl}),p.jsxs("div",{className:`mt-1 text-xs ${E}`,children:[Ev(z.createdAt),z.collectionId?` · ${F?.name||"Deleted collection"}`:"",z.folderId?` / ${X?.name||"Deleted folder"}`:"",z.runName?` · Run: ${z.runName}`:""]})]}),p.jsxs("div",{className:"flex shrink-0 gap-2",children:[p.jsxs("button",{type:"button",className:"inline-flex min-h-10 items-center gap-2 rounded-md border px-3 py-2 text-sm font-medium hover:bg-blue-500/10",onClick:()=>ye(z),children:[p.jsx(dA,{className:"h-4 w-4"})," Open in client"]}),p.jsx("button",{type:"button","aria-label":"Delete selected history entry",className:"inline-flex min-h-10 items-center rounded-md border px-3 py-2 text-red-600",onClick:()=>xe(z.id),children:p.jsx(si,{className:"h-4 w-4"})})]})]}),z.error&&p.jsx("div",{className:"rounded-md border border-red-300 bg-red-500/10 px-3 py-2 text-sm text-red-700",children:z.error})]}),p.jsxs("section",{className:"space-y-3",children:[p.jsx("h3",{className:"font-semibold",children:"Request"}),p.jsxs("div",{className:"grid gap-3 text-xs sm:grid-cols-2",children:[p.jsxs("div",{children:[p.jsx("span",{className:E,children:"Original URL"}),p.jsx("div",{className:"mt-1 break-all font-mono",children:z.request.url})]}),p.jsxs("div",{children:[p.jsx("span",{className:E,children:"Content type"}),p.jsx("div",{className:"mt-1 font-mono",children:z.request.contentType||"—"})]})]}),p.jsx(Ov,{title:"Query parameters",values:z.request.query,mutedClass:E}),p.jsx(Ov,{title:"Headers",values:z.request.headers,mutedClass:E}),z.request.body&&p.jsxs("div",{className:"space-y-2",children:[p.jsx("h4",{className:"text-xs font-semibold uppercase tracking-wide",children:"Body"}),p.jsx("pre",{className:`max-h-72 overflow-auto whitespace-pre-wrap break-words rounded-md border p-3 text-xs ${O}`,children:z.request.body})]})]}),p.jsxs("section",{className:"space-y-3 border-t pt-4",children:[p.jsxs("div",{className:"flex items-center justify-between gap-2",children:[p.jsx("h3",{className:"font-semibold",children:"Response"}),z.responseBodyTruncated&&p.jsx("span",{className:"text-xs text-amber-600",children:"Body truncated in history"})]}),ee.length>0&&p.jsxs("div",{className:"space-y-2",children:[p.jsx("h4",{className:"text-xs font-semibold uppercase tracking-wide",children:"Headers"}),p.jsx("div",{className:"overflow-hidden rounded-md border",children:ee.map(([$,te],L)=>p.jsxs("div",{className:"grid grid-cols-[minmax(8rem,0.35fr)_minmax(0,1fr)] gap-3 border-b px-3 py-2 text-xs last:border-b-0",children:[p.jsx("span",{className:"break-all font-mono font-medium",children:$}),p.jsx("span",{className:`break-all font-mono ${E}`,children:te})]},`${$}:${L}`))})]}),z.responseBody!==void 0?p.jsxs("div",{className:"space-y-2",children:[p.jsx("h4",{className:"text-xs font-semibold uppercase tracking-wide",children:"Body"}),p.jsx("pre",{className:`max-h-96 overflow-auto whitespace-pre-wrap break-words rounded-md border p-3 text-xs ${O}`,children:z.responseBody||"(empty response body)"})]}):p.jsx("p",{className:`text-sm ${E}`,children:"Response payload was not captured for this older history entry."})]}),(z.scriptTests?.length||z.scriptError||z.scriptLogs?.length)&&p.jsxs("section",{className:"space-y-3 border-t pt-4",children:[p.jsx("h3",{className:"font-semibold",children:"Tests & console"}),z.scriptTests?.length?p.jsxs("div",{className:"space-y-1",children:[p.jsxs("div",{className:`text-xs ${E}`,children:[he,"/",z.scriptTests.length," tests passed"]}),z.scriptTests.map(($,te)=>p.jsxs("div",{className:`rounded-md border px-3 py-2 text-sm ${$.passed?"":"border-red-300 bg-red-500/10 text-red-700"}`,children:[p.jsxs("span",{className:"font-medium",children:[$.passed?"✓":"✕"," ",$.name]}),$.error&&p.jsx("div",{className:"mt-1 text-xs",children:$.error})]},`${$.name}:${te}`))]}):null,z.scriptError&&p.jsx("div",{className:"rounded-md border border-red-300 bg-red-500/10 px-3 py-2 text-sm text-red-700",children:z.scriptError}),z.scriptLogs?.length?p.jsx("pre",{className:`max-h-56 overflow-auto whitespace-pre-wrap rounded-md border p-3 text-xs ${O}`,children:z.scriptLogs.join(`
|
|
78
|
+
`)}):null]}),(z.scripts?.preRequest.trim()||z.scripts?.tests.trim())&&p.jsxs("section",{className:"space-y-3 border-t pt-4",children:[p.jsx("h3",{className:"font-semibold",children:"Scripts used"}),z.scripts?.preRequest.trim()&&p.jsxs("div",{className:"space-y-2",children:[p.jsx("h4",{className:"text-xs font-semibold uppercase tracking-wide",children:"Pre-request"}),p.jsx("pre",{className:`max-h-56 overflow-auto whitespace-pre-wrap rounded-md border p-3 text-xs ${O}`,children:z.scripts.preRequest})]}),z.scripts?.tests.trim()&&p.jsxs("div",{className:"space-y-2",children:[p.jsx("h4",{className:"text-xs font-semibold uppercase tracking-wide",children:"Tests"}),p.jsx("pre",{className:`max-h-56 overflow-auto whitespace-pre-wrap rounded-md border p-3 text-xs ${O}`,children:z.scripts.tests})]})]})]})]})]})]})})};function pn(t){return!!t&&typeof t=="object"&&!Array.isArray(t)}function st(t){if(t==null)return"";if(typeof t=="string")return t;if(typeof t=="number"||typeof t=="boolean")return String(t);try{return JSON.stringify(t)}catch{return String(t)}}function Xn(t,e,n,r){t.push({code:e,path:n,message:r})}function Jr(t){return Array.isArray(t)?t.filter(pn):[]}function et(t,e,n){const r=Jr(t[e]).find(s=>s.key===n);return r?st(r.value):""}function PO(t){switch(t){case"authorization_code":return"authorizationCode";case"client_credentials":return"clientCredentials";case"password_credentials":case"password":return"password";case"implicit":return"implicit";case"access_token":return"accessToken";default:return}}function $h(t,e,n,r){if(!pn(t)||typeof t.type!="string")return{...e};const s=t.type.toLowerCase();if(s==="inherit")return{...e};if(s==="noauth")return{type:"none"};if(s==="bearer")return{type:"bearer",token:et(t,"bearer","token")};if(s==="basic")return{type:"basic",username:et(t,"basic","username"),password:et(t,"basic","password")};if(s==="apikey"){const c=et(t,"apikey","in").toLowerCase();return c==="cookie"?Xn(r,"postman-auth-host-execution",n,"Imported Postman cookie API key requires FlexDoc API host execution; the browser will not send this auth mode directly."):c&&c!=="header"&&c!=="query"&&Xn(r,"postman-auth-apikey-location",n,`Unsupported Postman API-key location "${c}"; imported as a header API key.`),{type:"apiKey",key:et(t,"apikey","key"),value:et(t,"apikey","value"),in:c==="query"?"query":c==="cookie"?"cookie":"header"}}if(s==="oauth2"){const c=et(t,"oauth2","scope"),d=PO(et(t,"oauth2","grant_type")),f=et(t,"oauth2","client_authentication").toLowerCase();return{type:"oauth2",accessToken:et(t,"oauth2","accessToken"),...d?{grantType:d}:{},authorizationUrl:et(t,"oauth2","authUrl")||void 0,tokenUrl:et(t,"oauth2","accessTokenUrl")||void 0,clientId:et(t,"oauth2","clientId")||void 0,clientSecret:et(t,"oauth2","clientSecret")||void 0,clientAuthentication:f==="header"||f==="basic"?"basic":"body",redirectUri:et(t,"oauth2","redirect_uri")||void 0,scopes:c?c.split(/[\s,]+/).filter(Boolean):void 0,username:et(t,"oauth2","username")||void 0,password:et(t,"oauth2","password")||void 0,refreshToken:et(t,"oauth2","refreshToken")||void 0}}const a=c=>Xn(r,"postman-auth-host-execution",n,`Imported Postman ${c} auth requires FlexDoc API host execution; the browser will not send this auth mode directly.`);if(s==="digest")return a("Digest"),{type:"digest",username:et(t,"digest","username"),password:et(t,"digest","password")};if(s==="hawk"){a("Hawk");const c=et(t,"hawk","algorithm").toLowerCase();return{type:"hawk",id:et(t,"hawk","authId")||et(t,"hawk","id"),key:et(t,"hawk","authKey")||et(t,"hawk","key"),algorithm:c==="sha1"?"sha1":"sha256",ext:et(t,"hawk","extraData")||et(t,"hawk","ext")||void 0}}if(s==="ntlm")return a("NTLM/Negotiate"),{type:"ntlm",username:et(t,"ntlm","username"),password:et(t,"ntlm","password"),domain:et(t,"ntlm","domain")||void 0,workstation:et(t,"ntlm","workstation")||void 0};if(s==="oauth1"){a("OAuth 1.0");const c=et(t,"oauth1","signatureMethod").toUpperCase();return{type:"oauth1",consumerKey:et(t,"oauth1","consumerKey"),consumerSecret:et(t,"oauth1","consumerSecret"),token:et(t,"oauth1","token")||void 0,tokenSecret:et(t,"oauth1","tokenSecret")||void 0,signatureMethod:c==="HMAC-SHA256"||c==="PLAINTEXT"?c:"HMAC-SHA1",realm:et(t,"oauth1","realm")||void 0}}return s==="awsv4"?(a("AWS Signature V4"),{type:"awsv4",accessKey:et(t,"awsv4","accessKey"),secretKey:et(t,"awsv4","secretKey"),sessionToken:et(t,"awsv4","sessionToken")||void 0,region:et(t,"awsv4","region"),service:et(t,"awsv4","service")}):(Xn(r,"postman-auth-unsupported",n,`Postman auth type "${t.type}" is not supported by FlexDoc and was left to inherited/default auth.`),{...e})}function Rv(t,e,n){return Jr(t).flatMap((r,s)=>{const a=st(r.key).trim();return a?[{id:wn("variable"),key:a,value:st(r.value),enabled:r.disabled!==!0&&r.enabled!==!1}]:(Xn(n,"postman-variable-empty-key",`${e}[${s}]`,"Skipped a Postman variable with an empty key."),[])})}function KO(t,e,n){const r=["pm.sendRequest","pm.globals","pm.iterationData","pm.cookies","pm.vault","pm.require","pm.execution","postman."].filter(a=>t.includes(a));let s=t.replace(/\bpm\.response\.to\.have\.status\(([^)\n]+)\)\s*;?/g,"flex.expect(flex.response?.code).to.equal($1);").replace(/\bpm\.response\.to\.have\.header\(([^)\n]+)\)\s*;?/g,"flex.expect(flex.response?.headers.has($1)).to.equal(true);").replace(/\bpm\.collectionVariables\b/g,"flex.collection").replace(/\bpm\.environment\b/g,"flex.environment").replace(/\bpm\.variables\b/g,"flex.variables").replace(/\bpm\.request\b/g,"flex.request").replace(/\bpm\.response\b/g,"flex.response").replace(/\bpm\.expect\b/g,"flex.expect").replace(/\bpm\.test\b/g,"flex.test").replace(/\bflex\.request\.headers\.add\s*\(/g,"flex.request.headers.upsert(");return/\bpm\./.test(s)&&r.push("other pm.* APIs"),r.length>0&&(Xn(n,"postman-script-partial-compatibility",e,`Imported script uses unsupported Postman APIs (${[...new Set(r)].join(", ")}); review the script before relying on it.`),s=`// Imported from Postman. Review unsupported API usage before relying on this script.
|
|
79
|
+
${s}`),s}function YO(t,e,n){return pn(t)?(t.src!==void 0&&Xn(n,"postman-script-src",e,"External Postman script sources are not fetched; only inline script.exec content is imported."),Array.isArray(t.exec)?t.exec.map(st).join(`
|
|
80
|
+
`):st(t.exec)):""}function Dv(t,e,n){const r={preRequest:[],tests:[]};return Jr(t).forEach((s,a)=>{const c=st(s.listen).toLowerCase();if(c!=="prerequest"&&c!=="test")return;const d=`${e}[${a}]`,f=YO(s.script,`${d}.script`,n).trim();if(!f)return;const h=KO(f,`${d}.script`,n);c==="prerequest"?r.preRequest.push(h):r.tests.push(h)}),r}function GO(t,e){return{preRequest:[...t.preRequest,...e.preRequest],tests:[...t.tests,...e.tests]}}function XO(t){const e=t.preRequest.filter(Boolean).join(`
|
|
56
81
|
|
|
57
|
-
`).trim()
|
|
58
|
-
`),contentType:f||"multipart/form-data"}}return p==="file"?(An(u,"postman-body-file",c,"Postman file bodies cannot be imported into the current FlexDoc request model; the request body was left empty."),{body:"",contentType:f||"application/octet-stream"}):(An(u,"postman-body-unsupported",c,`Postman body mode "${p}" is not supported; the request body was left empty.`),{body:"",contentType:f||"application/octet-stream"})}function yx(a,i,c,u,f,p,g,y){const x=typeof a=="string"?{method:"GET",url:a}:a;if(!Lt(x))return An(y,"postman-request-invalid",g,"Skipped an invalid Postman request entry."),null;const h=Pe(x.method).trim().toUpperCase()||"GET",S=dx(x.url),A=fx(x.header),C=hx(x.body,A,`${g}.body`,y),M={method:h,url:S.url,query:S.query,headers:A,body:C.body,contentType:C.contentType,auth:no(x.auth,{type:"inherit"},`${g}.auth`,y)},k=ox(f);return{id:Ht("request"),collectionId:c,folderId:u,name:i.trim()||`${h} ${S.url||"request"}`,request:M,...k?{scripts:k}:{},createdAt:p,updatedAt:p}}function Tf(a){Array.isArray(a.items)&&a.items.forEach((i,c)=>{const u=`${a.path}[${c}]`;if(!Lt(i)){An(a.warnings,"postman-item-invalid",u,"Skipped an invalid Postman item.");return}const f=Pe(i.name)||"Untitled",p=Af(i.event,`${u}.event`,a.warnings),g=sx(a.inheritedScripts,p);if(Array.isArray(i.item)){const x=Ht("folder");a.folders.push({id:x,collectionId:a.collectionId,parentFolderId:a.parentFolderId,name:f,auth:no(i.auth,{type:"inherit"},`${u}.auth`,a.warnings),createdAt:a.timestamp,updatedAt:a.timestamp}),Tf({...a,items:i.item,parentFolderId:x,inheritedScripts:g,path:`${u}.item`});return}const y=yx(i.request,f,a.collectionId,a.parentFolderId,g,a.timestamp,`${u}.request`,a.warnings);y&&a.requests.push(y)})}function gx(a){if(!Lt(a)||!Lt(a.info)||!Array.isArray(a.item))throw new Error("This JSON is not a Postman collection. Expected info and item fields.");const i=Pe(a.info.name).trim();if(!i)throw new Error("Postman collection info.name is required.");const c=[],u=Pe(a.info.schema);u&&!u.includes("/v2.1.0/")&&An(c,"postman-schema-version","info.schema",`Collection schema "${u}" is not Postman v2.1; FlexDoc imported the compatible fields it recognized.`);const f=new Date().toISOString(),p=Ht("collection"),g={id:p,name:i,auth:no(a.auth,{type:"none"},"auth",c),variables:Sf(a.variable,"variable",c),createdAt:f,updatedAt:f},y=[],x=[];return Tf({items:a.item,collectionId:p,inheritedScripts:Af(a.event,"event",c),timestamp:f,path:"item",folders:y,requests:x,warnings:c}),{collection:g,folders:y,requests:x,warnings:c}}function xx(a){if(!Lt(a)||!Array.isArray(a.values)||typeof a.name!="string")throw new Error("This JSON is not a Postman environment. Expected name and values fields.");const i=Pe(a._postman_variable_scope).toLowerCase();if(i&&i!=="environment")throw new Error(`Postman variable scope "${i}" is not an environment.`);const c=[],u=new Date().toISOString();return{environment:{id:Ht("environment"),name:a.name.trim()||"Imported environment",variables:Sf(a.values,"values",c),createdAt:u,updatedAt:u},warnings:c}}function bx(a){if(Lt(a)&&Lt(a.info)&&Array.isArray(a.item))return{kind:"collection",result:gx(a)};if(Lt(a)&&Array.isArray(a.values)&&typeof a.name=="string")return{kind:"environment",result:xx(a)};throw new Error("Unsupported Postman JSON. Import a collection v2.1 JSON file or an exported environment JSON file.")}function vx(a){if(a.collections.length!==1||a.folders.length!==0||a.requests.length!==0)return!1;const i=a.collections[0];return i.name==="My Collection"&&i.auth.type==="none"&&i.variables.length===0}function Sx(a,i){const c=vx(a)?[]:a.collections;return{...a,collections:[...c,i.collection],folders:[...a.folders,...i.folders],requests:[...a.requests,...i.requests]}}function Ax(a,i){return{...a,environments:[...a.environments,i.environment],activeEnvironmentId:a.activeEnvironmentId||i.environment.id}}function Ef(a,i){return`${a} ${a===1?i:`${i}s`}`}const jx=({onWorkspaceChange:a,onSelectedCollectionChange:i,theme:c})=>{const u=le.useRef(null),[f,p]=le.useState(null),[g,y]=le.useState([]),x=async k=>{if(k.length===0)return;const G=[],U=[],I=[];for(const Y of k)try{const D=JSON.parse(await Y.text()),X=bx(D);G.push(X),U.push(...X.result.warnings.map(me=>({...me,path:`${Y.name}:${me.path}`})))}catch(D){I.push(`${Y.name}: ${D instanceof Error?D.message:String(D)}`)}G.length>0&&a(Y=>{let D=Y;for(const X of G)D=X.kind==="collection"?Sx(D,X.result):Ax(D,X.result);return D});const _=G.filter(Y=>Y.kind==="collection"),N=G.length-_.length,j=_[_.length-1];j?.kind==="collection"&&i?.(j.result.collection.id),y(U);const R=[_.length>0?Ef(_.length,"collection"):"",N>0?Ef(N,"environment"):""].filter(Boolean);G.length===0?p({tone:"error",text:I.join(" ")||"No Postman documents were imported."}):I.length>0||U.length>0?p({tone:"warning",text:`Imported ${R.join(" and ")}. ${I.length>0?`${I.length} file${I.length===1?"":"s"} failed to import.`:`${U.length} compatibility warning${U.length===1?"":"s"} need review.`}`}):p({tone:"success",text:`Imported ${R.join(" and ")}.`})},h=c==="dark"?"border-gray-700 bg-gray-900 text-gray-100":"border-gray-300 bg-white text-gray-900",S=c==="dark"?"text-gray-400":"text-gray-500",A=c==="dark"?"text-amber-300":"text-amber-700",C=c==="dark"?"text-emerald-300":"text-emerald-700",M=c==="dark"?"text-red-300":"text-red-700";return o.jsxs("section",{className:"space-y-3","aria-labelledby":"api-client-import-heading",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(Uu,{className:"h-4 w-4"}),o.jsx("h3",{id:"api-client-import-heading",className:"font-semibold",children:"Import"})]}),o.jsx("input",{ref:u,type:"file",accept:".json,application/json",multiple:!0,className:"hidden","aria-label":"Import Postman JSON",onChange:k=>{const G=Array.from(k.currentTarget.files||[]);k.currentTarget.value="",x(G)}}),o.jsxs("button",{type:"button",className:`flex w-full items-center justify-center gap-2 rounded-md border px-3 py-2 text-sm font-medium ${h}`,onClick:()=>u.current?.click(),children:[o.jsx(Uu,{className:"h-4 w-4"}),"Import Postman"]}),o.jsx("p",{className:`text-xs ${S}`,children:"Import Postman Collection v2.1 and exported environment JSON files. Multiple files can be selected together."}),f&&o.jsxs("div",{className:`flex items-start gap-2 text-xs ${f.tone==="success"?C:f.tone==="warning"?A:M}`,role:"status",children:[f.tone==="success"?o.jsx(Mu,{className:"mt-0.5 h-4 w-4 shrink-0"}):o.jsx(sg,{className:"mt-0.5 h-4 w-4 shrink-0"}),o.jsx("span",{children:f.text})]}),g.length>0&&o.jsxs("details",{className:`text-xs ${A}`,children:[o.jsxs("summary",{className:"cursor-pointer font-medium",children:["Review import warnings (",g.length,")"]}),o.jsxs("ul",{className:"mt-2 space-y-2 pl-4",children:[g.slice(0,5).map((k,G)=>o.jsxs("li",{children:[o.jsx("span",{className:"font-mono",children:k.path}),": ",k.message]},`${k.code}-${k.path}-${G}`)),g.length>5&&o.jsxs("li",{children:[g.length-5," more warning",g.length-5===1?"":"s"," not shown."]})]})]})]})};function Nx(a,i){if(!i.folderId)return"Collection root";const c=new Map(a.folders.map(g=>[g.id,g])),u=[],f=new Set;let p=c.get(i.folderId);for(;p&&!f.has(p.id);)f.add(p.id),u.unshift(p.name),p=p.parentFolderId?c.get(p.parentFolderId):void 0;return u.join(" / ")||"Deleted folder"}function wx(a){return a.status==="running"?"Running":a.status==="passed"?"Runner pass":a.status==="failed"?"Runner fail":a.status==="cancelled"?"Cancelled":a.status==="skipped"?"Not run":"Pending"}const Tx=({workspace:a,onWorkspaceChange:i,collectionId:c,folderId:u,theme:f,credentials:p,requestInterceptor:g,externalVariables:y,externalEnvironmentVariables:x,onCollectionChanges:h,onEnvironmentChanges:S,onOpenHistory:A,onBack:C,fetcher:M})=>{const k=le.useMemo(()=>Fr(a,c,u),[c,u,a]),G=le.useMemo(()=>gf(a,c,u),[c,u,a]),U=a.environments.find(T=>T.id===a.activeEnvironmentId),[I,_]=le.useState(!1),[N,j]=le.useState(!1),[R,Y]=le.useState(),[D,X]=le.useState({}),me=le.useRef(void 0),xe=le.useRef(!0);le.useEffect(()=>(xe.current=!0,()=>{xe.current=!1,me.current?.abort()}),[]);const ge=async()=>{if(N||k.length===0)return;const T=new AbortController;me.current=T,j(!0),Y(void 0),X(Object.fromEntries(k.map(W=>[W.id,{status:"pending"}])));const ne=await Z0({workspace:a,collectionId:c,folderId:u,runName:G,credentials:p,requestInterceptor:g,externalVariables:y,externalEnvironmentVariables:x,stopOnFailure:I,signal:T.signal,fetcher:M,onCollectionChanges:h,onEnvironmentChanges:S,onRequestStart:W=>{xe.current&&X(K=>({...K,[W.id]:{status:"running"}}))},onRequestComplete:W=>{xe.current&&X(K=>({...K,[W.requestId]:{status:W.cancelled?"cancelled":W.passed?"passed":"failed",item:W}}))}});xe.current&&(i(ne.workspace),X(W=>Object.fromEntries(k.map(K=>{const P=W[K.id]||{status:"pending"};return[K.id,P.status==="pending"&&ne.stopped?{status:"skipped"}:P]}))),Y(ne),j(!1),me.current=void 0)},Ee=()=>me.current?.abort(),He=f==="dark"?"border-gray-700 bg-gray-800/60 text-gray-100":"border-gray-200 bg-gray-50 text-gray-900",he=f==="dark"?"text-gray-400":"text-gray-500",ke=f==="dark"?"border-gray-700 bg-gray-900/40":"border-gray-200 bg-white";return o.jsx("section",{className:`rounded-xl border p-4 md:p-5 ${He}`,"aria-labelledby":"api-client-runner-heading",children:o.jsxs("div",{className:"space-y-5",children:[o.jsxs("header",{className:"flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[o.jsxs("div",{className:"flex items-start gap-3",children:[o.jsxs("button",{type:"button",className:"inline-flex min-h-10 items-center gap-2 rounded-md border px-3 py-2 text-sm",onClick:C,children:[o.jsx(ku,{className:"h-4 w-4"})," Client"]}),o.jsxs("div",{children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(Jl,{className:"h-5 w-5"}),o.jsx("h2",{id:"api-client-runner-heading",className:"text-lg font-semibold",children:"Collection runner"})]}),o.jsx("p",{className:"mt-1 text-sm font-medium",children:G}),o.jsxs("p",{className:`mt-1 text-xs ${he}`,children:[k.length," saved request",k.length===1?"":"s"," · Environment: ",U?.name||"None"]})]})]}),o.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[R?.runId&&o.jsxs("button",{type:"button",className:"inline-flex min-h-10 items-center gap-2 rounded-md border px-3 py-2 text-sm",onClick:()=>A(void 0,R.runId),children:[o.jsx(Jy,{className:"h-4 w-4"})," Open run history"]}),N?o.jsxs("button",{type:"button",className:"inline-flex min-h-10 items-center gap-2 rounded-md border border-red-300 px-3 py-2 text-sm text-red-700",onClick:Ee,children:[o.jsx(ig,{className:"h-4 w-4"})," Stop run"]}):o.jsxs("button",{type:"button",disabled:k.length===0,className:"inline-flex min-h-10 items-center gap-2 rounded-md border px-3 py-2 text-sm font-medium disabled:cursor-not-allowed disabled:opacity-50",onClick:()=>{ge()},children:[o.jsx(Jl,{className:"h-4 w-4"})," ",R?"Run again":"Start run"]})]})]}),o.jsxs("div",{className:"flex flex-col gap-3 rounded-lg border p-3 sm:flex-row sm:items-center sm:justify-between",children:[o.jsxs("label",{className:"inline-flex items-center gap-2 text-sm",children:[o.jsx("input",{type:"checkbox",checked:I,disabled:N,onChange:T=>_(T.target.checked)}),"Stop on runner failure"]}),o.jsx("p",{className:`text-xs ${he}`,children:"Runner failure means transport/script/test failure. HTTP 4xx/5xx alone does not fail an item."})]}),R&&o.jsxs("div",{className:"grid gap-2 sm:grid-cols-5",children:[o.jsxs("div",{className:"rounded-md border px-3 py-2 text-sm",children:[o.jsx("div",{className:he,children:"Progress"}),o.jsxs("strong",{children:[R.completed," / ",R.total]})]}),o.jsxs("div",{className:"rounded-md border px-3 py-2 text-sm",children:[o.jsx("div",{className:he,children:"Passed"}),o.jsx("strong",{className:"text-green-600",children:R.passed})]}),o.jsxs("div",{className:"rounded-md border px-3 py-2 text-sm",children:[o.jsx("div",{className:he,children:"Failed"}),o.jsx("strong",{className:"text-red-600",children:R.failed})]}),o.jsxs("div",{className:"rounded-md border px-3 py-2 text-sm",children:[o.jsx("div",{className:he,children:"Cancelled"}),o.jsx("strong",{children:R.cancelled})]}),o.jsxs("div",{className:"rounded-md border px-3 py-2 text-sm",children:[o.jsx("div",{className:he,children:"Run"}),o.jsx("strong",{children:R.stopped?"Stopped":"Complete"})]})]}),o.jsxs("section",{className:"space-y-3","aria-labelledby":"api-client-runner-order-heading",children:[o.jsxs("div",{children:[o.jsx("h3",{id:"api-client-runner-order-heading",className:"font-semibold",children:"Execution order"}),o.jsx("p",{className:`text-xs ${he}`,children:"Requests execute sequentially in saved-request order. Folder runs include descendant folders; this list is the exact order that will run."})]}),k.map((T,ne)=>{const W=D[T.id]||{status:"pending"},K=W.item?.outcome.result,P=W.item?.outcome.scriptTests||[],w=P.filter(ce=>ce.passed).length,$=K?.status!==void 0&&K.status>=400;return o.jsxs("div",{"data-runner-request-id":T.id,className:`rounded-lg border p-3 ${ke}`,children:[o.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-start sm:justify-between",children:[o.jsxs("div",{className:"min-w-0",children:[o.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-sm",children:[o.jsx("span",{className:`text-xs ${he}`,children:ne+1}),o.jsx("span",{className:"font-mono font-bold text-blue-600",children:T.request.method.toUpperCase()}),o.jsx("span",{className:"font-medium",children:T.name})]}),o.jsx("div",{className:`mt-1 text-xs ${he}`,children:Nx(a,T)}),o.jsx("div",{className:"mt-1 truncate font-mono text-xs",title:T.request.url,children:T.request.url})]}),o.jsxs("div",{className:"flex shrink-0 flex-wrap items-center gap-2 text-xs",children:[W.status==="running"&&o.jsx(xs,{className:"h-4 w-4 animate-spin"}),W.status==="passed"&&o.jsx(Mu,{className:"h-4 w-4 text-green-600"}),W.status==="failed"&&o.jsx(Zy,{className:"h-4 w-4 text-red-600"}),o.jsx("span",{children:wx(W)}),K?.status!==void 0&&o.jsxs("span",{className:$?"text-amber-600":he,children:["HTTP ",K.status]}),K?.responseTime!==void 0&&o.jsxs("span",{className:he,children:[o.jsx(hs,{className:"mr-1 inline h-3.5 w-3.5"}),K.responseTime," ms"]})]})]}),P.length>0&&o.jsxs("div",{className:`mt-2 text-xs ${P.some(ce=>!ce.passed)?"text-red-600":he}`,children:[w,"/",P.length," tests passed"]}),W.item?.outcome.scriptError&&o.jsx("div",{className:"mt-2 text-xs text-red-600",children:W.item.outcome.scriptError}),W.item?.outcome.error&&!W.item.cancelled&&o.jsx("div",{className:"mt-2 text-xs text-red-600",children:W.item.outcome.error}),W.item?.historyEntryId&&o.jsx("button",{type:"button",className:"mt-2 text-xs font-medium text-blue-600 underline underline-offset-2","aria-label":`Open history for ${T.name}`,onClick:()=>A(W.item?.historyEntryId,W.item?.outcome.result?R?.runId:void 0),children:"Inspect history"})]},T.id)}),k.length===0&&o.jsx("div",{className:`rounded-lg border px-4 py-8 text-center text-sm ${he}`,children:"There are no saved requests in this run scope yet."})]})]})})};function Ex(a){return{method:a?.method||"GET",url:a?.url||"",query:a?.query?.map(i=>({...i}))||[],headers:a?.headers?.map(i=>({...i}))||[],body:a?.body||"",contentType:a?.contentType||"application/json",auth:a?.auth?{...a.auth}:{type:"inherit"}}}const Cx=({initialRequest:a,initialScripts:i,theme:c="light",persistenceKey:u="default",onRequestChange:f,onDraftChange:p,onScriptsChange:g,onExecutionStart:y,onExecutionComplete:x,variables:h={},environmentVariables:S={},onCollectionChanges:A,onEnvironmentChanges:C,...M})=>{const k=Ex(a),G=sn(i),U=Fa(),[I,_]=le.useState(k),[N,j]=le.useState(k),[R,Y]=le.useState(G),[D,X]=le.useState(G),[me,xe]=le.useState(0),[ge,Ee]=le.useState("request"),[He,he]=le.useState({}),[ke,T]=le.useState(),[ne,W]=le.useState(U),[K,P]=le.useState(U.collections[0]?.id),[w,$]=le.useState(""),ce=le.useRef(U.collections[0]?.id),pe=le.useRef(void 0),[ve,Te]=le.useState(u===!1);le.useEffect(()=>{if(u===!1)return;let _e=!1;return c0(u).then(se=>{_e||(W(se),P(se.collections[0]?.id),$(""),Te(!0))}).catch(()=>{_e||Te(!0)}),()=>{_e=!0}},[u]),le.useEffect(()=>{!ve||u===!1||u0(u,ne).catch(()=>{})},[ve,u,ne]);const Re=le.useMemo(()=>Jd(ne,K),[K,ne]),Ve=le.useMemo(()=>Wd(ne),[ne]),Ie=le.useMemo(()=>({...S,...Ve}),[S,Ve]),Be=le.useMemo(()=>({...Re,...h,...Ie}),[Re,Ie,h]),Z=le.useCallback(_e=>Kd(ne,K,w||void 0,_e||{type:"none"}),[K,w,ne]),be=le.useCallback(_e=>{P(_e),$("")},[]),Se=_e=>{f?.(_e)},Ne=_e=>{j(Dn(_e)),p?.(Dn(_e))},Je=_e=>{const se=sn(_e);X(se),g?.(se)},at=_e=>{const se=ce.current||K;W(Ae=>ef(Ae,se,_e)),A?.(_e)},ft=_e=>{W(se=>Pd(se,_e)),C?.(_e)},dt=()=>{ce.current=K,pe.current=w||void 0,y?.()},un=_e=>{W(se=>Qd(se,{..._e,collectionId:ce.current,folderId:pe.current})),x?.(_e)},Yt=(_e,se,Ae,De)=>{Ee("request");const dn=Ae&&ne.collections.some(Q=>Q.id===Ae)?Ae:void 0;dn&&P(dn);const d=dn||K,q=De&&ne.folders.some(Q=>Q.id===De&&Q.collectionId===d)?De:"";$(q);const ae=Dn(_e),ie=sn(se);_(ae),j(ae),Y(ie),X(ie),xe(Q=>Q+1)},It=(_e,se)=>{P(_e),$(se||""),T({collectionId:_e,folderId:se}),Ee("runner")},kn=(_e,se)=>{he({entryId:_e,runId:se}),Ee("history")},Rn=c==="dark"?"border-gray-700 bg-gray-900/40 text-gray-100":"border-gray-200 bg-white text-gray-900";return o.jsxs("div",{className:"grid gap-4 lg:grid-cols-[19rem_minmax(0,1fr)]",children:[o.jsxs("aside",{className:`space-y-5 rounded-xl border p-4 ${Rn}`,children:[o.jsx(jx,{onWorkspaceChange:W,onSelectedCollectionChange:be,theme:c}),o.jsx("div",{className:"border-t pt-4",children:o.jsx(K0,{workspace:ne,onWorkspaceChange:W,theme:c})}),o.jsx("div",{className:"border-t pt-4",children:o.jsx(Q0,{request:N,scripts:D,onLoadRequest:Yt,onSelectedCollectionChange:be,onSelectedFolderChange:$,onRunCollection:_e=>It(_e),onRunFolder:(_e,se)=>It(_e,se),selectedCollectionId:K,selectedFolderId:w,workspace:ne,onWorkspaceChange:W,theme:c})}),o.jsx("div",{className:"border-t pt-4",children:o.jsx(W0,{workspace:ne,onWorkspaceChange:W,onLoadRequest:Yt,onViewAll:()=>kn(),theme:c})})]}),ge==="history"?o.jsx(lx,{workspace:ne,onWorkspaceChange:W,onLoadRequest:Yt,onBack:()=>Ee("request"),initialEntryId:He.entryId,initialRunId:He.runId,theme:c},`${He.runId||""}:${He.entryId||""}`):ge==="runner"&&ke?o.jsx(Tx,{workspace:ne,onWorkspaceChange:W,collectionId:ke.collectionId,folderId:ke.folderId,theme:c,credentials:M.credentials,requestInterceptor:M.requestInterceptor,externalVariables:h,externalEnvironmentVariables:S,onCollectionChanges:A,onEnvironmentChanges:C,onOpenHistory:kn,onBack:()=>Ee("request")}):o.jsx(I0,{...M,initialRequest:I,initialScripts:R,theme:c,resolveAuth:Z,variables:Be,collectionVariables:Re,externalVariables:h,environmentVariables:Ie,onCollectionChanges:at,onEnvironmentChanges:ft,onDraftChange:Ne,onScriptsChange:Je,onExecutionStart:dt,onExecutionComplete:un,onRequestChange:Se},me)]})};function _x(a,i,c){return a.paths[i]?.[c.toLowerCase()]}function Ox(a,i){const c=a.components?.securitySchemes?.[i];if(!c)return;if(!("$ref"in c))return c;const u=c.$ref,f="#/components/securitySchemes/";if(!u.startsWith(f))return;const p=a.components?.securitySchemes?.[decodeURIComponent(u.slice(f.length))];return p&&!("$ref"in p)?p:void 0}function kx(a,i,c,u){const p=_x(a,i,c)?.security??a.security??[];if(!p.length)return;const g=p.find(x=>{const h=Object.keys(x);return h.length===1&&!!u[h[0]]});if(g)return g;const y=p.find(x=>{const h=Object.keys(x);return h.length>0&&h.every(S=>!!u[S])});return y||(p.find(x=>Object.keys(x).length===0)??p[0])}function Rx(a,i,c=[]){if(i){if(a.type==="http"&&a.scheme?.toLowerCase()==="bearer")return{type:"bearer",token:i};if(a.type==="http"&&a.scheme?.toLowerCase()==="basic"){const u=i.indexOf(":");return u>=0?{type:"basic",username:i.slice(0,u),password:i.slice(u+1)}:{type:"basic",username:i,password:""}}if(a.type==="apiKey"&&(a.in==="header"||a.in==="query")&&a.name)return{type:"apiKey",key:a.name,value:i,in:a.in};if(a.type==="openIdConnect")return{type:"oauth2",accessToken:i,grantType:"accessToken",scopes:c};if(a.type==="oauth2"){const u=a.flows,f=u?.authorizationCode?["authorizationCode",u.authorizationCode]:u?.clientCredentials?["clientCredentials",u.clientCredentials]:u?.password?["password",u.password]:u?.implicit?["implicit",u.implicit]:void 0,p=f?.[1];return{type:"oauth2",accessToken:i,grantType:f?.[0]||"accessToken",authorizationUrl:p?.authorizationUrl,tokenUrl:p?.tokenUrl,scopes:c.length?c:Object.keys(p?.scopes||{})}}}}function Cf(a,i){return{...a,headers:a.headers?.filter(c=>c.key.toLowerCase()!==i.toLowerCase())}}function qx(a,i){return{...a,query:a.query?.filter(c=>c.key!==i)}}function Mx(a,i,c,u,f){let p=U0(f);const g=kx(a,i,c,u.auth||{});if(!g||Object.keys(g).length!==1)return p;const y=Object.keys(g)[0],x=Ox(a,y),h=u.auth?.[y]||"";if(!x)return p;if(!h)return{...p,auth:{type:"inherit"}};const S=Rx(x,h,g[y]||[]);return S?(S.type==="bearer"||S.type==="oauth2"||S.type==="basic"?p=Cf(p,"Authorization"):S.type==="apiKey"&&S.in==="header"?p=Cf(p,S.key):S.type==="apiKey"&&S.in==="query"&&(p=qx(p,S.key)),{...p,auth:S}):p}function zx(a,i,c,u,f){const p=Ur(a,i,c,u);return{request:Mx(a,i,c,u,p),serverUrl:u.serverUrl||f}}function $x(a){return a==null?"":Array.isArray(a)?a.map(String):typeof a=="object"?JSON.stringify(a):typeof a=="boolean"?String(a):a}function Dx({spec:a,path:i,method:c,options:u}){const f=a.paths[i],g=f?.[c.toLowerCase()]?.servers||f?.servers||a.servers||[];return JSON.stringify({path:i,method:c.toLowerCase(),defaultServer:u?.tryIt?.defaultServer??null,servers:g.map(Js),defaults:Vs(a,i,c)})}const Ux=({spec:a,path:i,method:c,theme:u,options:f,onRequestChange:p,onOpenInApiClient:g})=>{const y=a.paths[i],x=y?.[c.toLowerCase()],h=le.useMemo(()=>x?.servers||y?.servers||a.servers||[],[x?.servers,y?.servers,a.servers]),S=le.useMemo(()=>h.map(P=>({server:P,url:Js(P)})),[h]),A=le.useMemo(()=>S.map(P=>P.url),[S]),C=le.useMemo(()=>({...Vs(a,i,c),serverUrl:f?.tryIt?.defaultServer}),[a,i,c,f?.tryIt?.defaultServer]),M=C.serverUrl&&A.includes(C.serverUrl)?C.serverUrl:A[0]||"",k=C.serverUrl&&!A.includes(C.serverUrl)?C.serverUrl:"",[G,U]=le.useState(C),I=le.useRef(C),_=le.useRef(M),N=le.useRef(null),j=le.useRef(p),[R,Y]=le.useState(null),[D,X]=le.useState(null),[me,xe]=le.useState(!1),ge=le.useMemo(()=>Md(a,i,c),[a,i,c]),Ee=f?.noAutoAuth?[]:Object.keys((x?.security??a.security??[])[0]||{}),He=P=>{I.current=P,U(P)};le.useEffect(()=>{j.current=p},[p]),le.useEffect(()=>{try{j.current?.(Ur(a,i,c,G))}catch{}},[a,i,c,G]);const he=(P,w,$)=>{const ce=I.current;He({...ce,[P]:{...ce[P]||{},[w]:$}})},ke=async()=>{xe(!0),X(null),Y(null);try{const P=Ur(a,i,c,I.current);let w={...P.init,url:P.url,credentials:f?.tryIt?.credentials||"same-origin"};f?.tryIt?.requestInterceptor&&(w=await f.tryIt.requestInterceptor(w));const{url:$,...ce}=w,pe=await fetch($,ce),ve=await pe.text();Y({status:pe.status,statusText:pe.statusText,headers:[...pe.headers.entries()].map(([Te,Re])=>`${Te}: ${Re}`).join(`
|
|
59
|
-
`),body:ve})}catch(P){X(P instanceof Error?P.message:"Request failed")}finally{xe(!1)}},T=()=>{try{g?.(zx(a,i,c,I.current,M||void 0))}catch(P){X(P instanceof Error?P.message:"Request is incomplete")}},ne=u==="dark"?"bg-gray-900 border-gray-700 text-gray-100":"bg-white border-gray-300 text-gray-900",W=u==="dark"?"text-gray-300":"text-gray-700",K=`${i}:${c}:${M}:${k}`;return o.jsx("div",{className:`rounded-xl border p-4 md:p-5 ${u==="dark"?"border-gray-700 bg-gray-800/60":"border-gray-200 bg-gray-50"}`,children:o.jsxs("div",{className:"flex flex-col gap-4",children:[h.length>0&&o.jsxs("label",{className:W,children:["Server",o.jsx("select",{"aria-label":"Server",className:`mt-1 w-full rounded-md border px-3 py-2 text-sm ${ne}`,defaultValue:M,onChange:P=>{_.current=P.target.value,N.current&&(N.current.value=""),He({...I.current,serverUrl:P.target.value})},children:S.map(({server:P,url:w})=>o.jsxs("option",{value:w,children:[P.description?`${P.description} — `:"",P.url]},`${P.url}:${w}`))},`server:${K}`)]}),o.jsxs("label",{className:W,children:["Custom server URL ",o.jsx("span",{className:"text-xs opacity-70",children:"(optional override)"}),o.jsx("input",{ref:N,"aria-label":"Custom server URL",className:`mt-1 w-full rounded-md border px-3 py-2 font-mono text-sm ${ne}`,defaultValue:k,onChange:P=>{const w=P.target.value.trim()||_.current;He({...I.current,serverUrl:w||void 0})},placeholder:"http://localhost:8080"},`custom:${K}`)]}),ge.map(P=>{const w=P.in==="header"?G.headers?.[P.name]:P.in==="cookie"?G.cookies?.[P.name]:G.parameters?.[P.name];return o.jsxs("label",{className:W,children:[o.jsxs("span",{className:"text-sm font-medium",children:[P.name," ",o.jsxs("span",{className:"text-xs opacity-70",children:["(",P.in,")"]}),P.required?" *":""]}),o.jsx("input",{"aria-label":`${P.in} ${P.name}`,className:`mt-1 w-full rounded-md border px-3 py-2 text-sm ${ne}`,value:$x(w),onChange:$=>he(P.in==="header"?"headers":P.in==="cookie"?"cookies":"parameters",P.name,$.target.value),placeholder:P.description||P.name})]},`${P.in}:${P.name}`)}),Ee.map(P=>o.jsxs("label",{className:W,children:[o.jsxs("span",{className:"text-sm font-medium",children:[P," credential"]}),o.jsx("input",{type:"password",autoComplete:"off",className:`mt-1 w-full rounded-md border px-3 py-2 text-sm ${ne}`,value:G.auth?.[P]||"",onChange:w=>he("auth",P,w.target.value),placeholder:"Token / API key"})]},P)),C.contentType&&o.jsxs(o.Fragment,{children:[o.jsxs("label",{className:W,children:["Content type",o.jsx("input",{className:`mt-1 w-full rounded-md border px-3 py-2 text-sm ${ne}`,value:G.contentType||"",onChange:P=>He({...I.current,contentType:P.target.value})})]}),o.jsxs("label",{className:W,children:["Request body",o.jsx("textarea",{"aria-label":"Request body",rows:8,className:`mt-1 w-full rounded-md border px-3 py-2 font-mono text-sm ${ne}`,value:G.body||"",onChange:P=>He({...I.current,body:P.target.value})})]})]}),o.jsxs("div",{className:"flex flex-wrap gap-2",children:[o.jsxs("button",{onClick:ke,disabled:me,className:"inline-flex min-h-11 items-center justify-center gap-2 rounded-md bg-blue-600 px-4 py-2 font-medium text-white hover:bg-blue-700 disabled:opacity-60",children:[me?o.jsx(xs,{className:"h-4 w-4 animate-spin"}):o.jsx(Jl,{className:"h-4 w-4"})," ",me?"Sending…":"Send request"]}),g&&o.jsxs("button",{type:"button",onClick:T,className:"inline-flex min-h-11 items-center justify-center gap-2 rounded-md border px-4 py-2 font-medium",children:[o.jsx(ys,{className:"h-4 w-4"})," Open in API Client"]})]}),D&&o.jsxs("div",{role:"alert",className:"flex gap-2 rounded-md border border-red-300 bg-red-50 p-3 text-sm text-red-700",children:[o.jsx($r,{className:"mt-0.5 h-4 w-4 shrink-0"}),D]}),R&&o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{className:"font-semibold",children:["Response ",o.jsxs("span",{className:R.status>=400?"text-red-600":"text-green-600",children:[R.status," ",R.statusText]})]}),R.headers&&o.jsx(On,{code:R.headers,language:"text",title:"Headers",theme:u,wrap:!0}),o.jsx(On,{code:R.body||"(empty response)",language:"json",title:"Body",theme:u,wrap:!0})]})]})})},Hx=a=>o.jsx(Ux,{...a},Dx(a)),Lx=({spec:a,path:i,method:c,theme:u,options:f,onRequestChange:p})=>{const[g,y]=le.useState(null),x=le.useRef(0),h=a.paths[i],A=h?.[c.toLowerCase()]?.servers||h?.servers||a.servers||[],C=f?.tryIt?.apiClientPersistenceKey??a0(a.info?.title,typeof window>"u"?void 0:window.location.host),M=k=>{x.current+=1,y({id:x.current,...k})};return o.jsxs(o.Fragment,{children:[o.jsx(Hx,{spec:a,path:i,method:c,theme:u,options:f,onRequestChange:p,onOpenInApiClient:M}),g&&o.jsxs("section",{className:"mt-6","aria-labelledby":"api-client-heading",children:[o.jsx("h2",{id:"api-client-heading",className:"mb-2 text-base font-semibold sm:text-lg",children:"API Client"}),o.jsx("p",{className:`mb-4 text-xs ${u==="dark"?"text-gray-400":"text-gray-600"}`,children:"Changes in Try It do not refresh this client automatically. Reopen it to load the latest Try It values. Saved collections stay local to this browser."}),o.jsx(Cx,{initialRequest:g.request,theme:u,credentials:f?.tryIt?.credentials||"same-origin",requestInterceptor:f?.tryIt?.requestInterceptor,onRequestChange:p,serverOptions:A,initialServerUrl:g.serverUrl,persistenceKey:C},g.id)]})]})},Bx=["curl","javascript","python","go","java"],Yx=({spec:a,path:i,method:c,theme:u="light",options:f={},defaultExpandedSections:p})=>{const g=p??Gs(f.expand,f.expand===void 0?f.expandResponses:void 0),y=`${c}:${i}:${g.join("|")}`,[x,h]=le.useState(()=>({key:y,sections:new Set(g)})),S=x.key===y?x.sections:new Set(g),[A,C]=le.useState(f.codeSamples?.languages?.[0]||"curl"),M=le.useMemo(()=>Ur(a,i,c,Vs(a,i,c)),[a,i,c]),[k,G]=le.useState(M),I=a.paths[i]?.[c.toLowerCase()],_=le.useMemo(()=>Md(a,i,c),[a,i,c]);if(!I)return o.jsx("div",{className:"p-6",children:"Operation not found."});const N=u==="dark"?"text-gray-400":"text-gray-600",j=u==="dark"?"border-gray-700 bg-gray-800/60":"border-gray-200 bg-white",R=u==="dark"?"bg-gray-900 text-gray-100":"bg-white text-gray-900",Y=f.codeSamples?.languages?.length?f.codeSamples.languages:Bx,D=I.security??a.security,X={requiredPropsFirst:f.requiredPropsFirst,sortPropsAlphabetically:f.sortPropsAlphabetically},me=he=>h(ke=>{const T=new Set(ke.key===y?ke.sections:g);return T.has(he)?T.delete(he):T.add(he),{key:y,sections:T}}),xe=(he,ke,T)=>o.jsxs("section",{className:"mb-8","aria-labelledby":`${ke}-heading`,children:[o.jsxs("button",{id:`${ke}-heading`,"aria-expanded":S.has(ke),onClick:()=>me(ke),className:"mb-4 flex min-h-10 w-full items-center gap-2 text-left text-base font-semibold sm:text-lg",children:[S.has(ke)?o.jsx(Ru,{className:"h-5 w-5 shrink-0"}):o.jsx(qu,{className:"h-5 w-5 shrink-0"}),he]}),S.has(ke)&&T]}),ge=I.requestBody?Wt.isReference(I.requestBody)?Wt.resolveReference(a,I.requestBody.$ref):I.requestBody:void 0,Ee=Object.entries(I).filter(([he])=>he.startsWith("x-")),He=typeof f.theme=="object"?f.theme.methodColors?.[c.toLowerCase()]:void 0;return o.jsx("div",{className:`h-full overflow-y-auto ${R}`,children:o.jsxs("article",{className:"mx-auto w-full max-w-6xl p-4 sm:p-6 lg:p-8",children:[o.jsxs("header",{className:"mb-8",children:[o.jsxs("div",{className:"mb-4 flex min-w-0 flex-wrap items-center gap-2 sm:gap-3",children:[o.jsx("span",{className:`shrink-0 rounded border px-2.5 py-1 text-xs font-bold sm:text-sm ${Wt.getMethodColor(c,u)}`,style:{background:He?.bg,borderColor:He?.border},children:c.toUpperCase()}),o.jsx("code",{className:`min-w-0 max-w-full overflow-x-auto rounded px-2.5 py-1 font-mono text-sm sm:text-base ${u==="dark"?"bg-gray-800 text-blue-300":"bg-gray-100 text-gray-900"}`,children:i})]}),I.summary&&o.jsx("h1",{className:"mb-2 text-2xl font-bold tracking-tight sm:text-3xl",children:I.summary}),I.description&&o.jsx("p",{className:`max-w-3xl whitespace-pre-wrap leading-relaxed ${N}`,children:I.description}),o.jsxs("div",{className:"mt-4 flex flex-wrap gap-3 text-sm",children:[I.deprecated&&o.jsxs("span",{className:"inline-flex items-center gap-1 text-orange-600",children:[o.jsx($r,{className:"h-4 w-4"}),"Deprecated"]}),D?.length?o.jsxs("span",{className:"inline-flex items-center gap-1 text-red-600",children:[o.jsx(eg,{className:"h-4 w-4"}),"Authentication required"]}):o.jsxs("span",{className:"inline-flex items-center gap-1 text-green-600",children:[o.jsx(Py,{className:"h-4 w-4"}),"No authentication required"]}),I.operationId&&o.jsxs("span",{className:N,children:["operationId: ",o.jsx("code",{children:I.operationId})]})]}),(f.showExtensions||f.showCommonExtensions)&&Ee.length>0&&o.jsx("div",{className:`mt-4 rounded-lg border p-3 text-xs ${j}`,children:Ee.map(([he,ke])=>o.jsxs("div",{children:[o.jsx("code",{children:he}),": ",typeof ke=="string"?ke:JSON.stringify(ke)]},he))})]}),_.length>0&&xe("Parameters","parameters",o.jsx("div",{className:"space-y-3",children:_.map(he=>o.jsxs("div",{className:`rounded-lg border p-4 ${j}`,children:[o.jsxs("div",{className:"mb-2 flex flex-wrap items-center gap-2",children:[o.jsx("code",{className:"font-medium",children:he.name}),o.jsx("span",{className:"rounded bg-blue-100 px-2 py-0.5 text-xs text-blue-700",children:he.in}),he.required&&o.jsx("span",{className:"rounded bg-red-100 px-2 py-0.5 text-xs text-red-700",children:"required"}),he.deprecated&&o.jsx("span",{className:"rounded bg-orange-100 px-2 py-0.5 text-xs text-orange-700",children:"deprecated"})]}),he.description&&o.jsx("p",{className:`mb-3 text-sm ${N}`,children:he.description}),he.schema&&o.jsx(rl,{spec:a,schema:he.schema,theme:u,required:he.required,...X})]},`${he.in}:${he.name}`))})),ge&&xe("Request Body","requestBody",o.jsxs("div",{className:"space-y-4",children:[ge.description&&o.jsx("p",{className:N,children:ge.description}),Object.entries(ge.content||{}).map(([he,ke])=>o.jsxs("div",{className:`rounded-lg border p-4 ${j}`,children:[o.jsxs("div",{className:"mb-3 flex flex-wrap items-center gap-2",children:[o.jsx("code",{className:"rounded bg-gray-100 px-2 py-1 text-xs text-gray-700",children:he}),ge.required&&o.jsx("span",{className:"rounded bg-red-100 px-2 py-0.5 text-xs text-red-700",children:"required"})]}),ke.schema&&o.jsx(rl,{spec:a,schema:ke.schema,theme:u,...X}),ke.example!==void 0&&o.jsx("div",{className:"mt-3",children:o.jsx(On,{code:JSON.stringify(ke.example,null,2),language:"json",title:"Example payload",theme:u,wrap:!0})})]},he))]})),xe("Responses","responses",o.jsx("div",{className:"space-y-4",children:Object.entries(I.responses||{}).map(([he,ke])=>{const T=Wt.isReference(ke)?Wt.resolveReference(a,ke.$ref):ke;return o.jsxs("div",{className:`rounded-lg border p-4 ${j}`,children:[o.jsxs("div",{className:"mb-3 flex flex-wrap items-center gap-2",children:[o.jsx("span",{className:"rounded border px-2.5 py-1 text-sm font-bold",children:he}),o.jsx("span",{className:`text-sm ${N}`,children:T.description})]}),T.headers&&f.showRequestHeaders&&o.jsxs("div",{className:"mb-3 text-sm",children:[o.jsx("span",{className:"font-medium",children:"Headers:"})," ",Object.keys(T.headers).join(", ")]}),T.content&&Object.entries(T.content).map(([ne,W])=>o.jsxs("div",{className:"mt-3",children:[o.jsx("code",{className:"text-xs opacity-70",children:ne}),W.schema&&o.jsx("div",{className:"mt-2",children:o.jsx(rl,{spec:a,schema:W.schema,theme:u,...X})}),W.example!==void 0&&o.jsx("div",{className:"mt-3",children:o.jsx(On,{code:JSON.stringify(W.example,null,2),language:"json",title:"Example response",theme:u,wrap:!0})}),W.examples&&Object.values(W.examples)[f.payloadSampleIdx||0]&&o.jsx("div",{className:"mt-3",children:o.jsx(On,{code:JSON.stringify(Object.values(W.examples)[f.payloadSampleIdx||0].value??Object.values(W.examples)[f.payloadSampleIdx||0],null,2),language:"json",title:"Example response",theme:u,wrap:!0})})]},ne))]},he)})})),f.tryIt?.enabled!==!1&&xe("Try It","tryIt",o.jsx(Lx,{spec:a,path:i,method:c,theme:u,options:f,onRequestChange:G},`${c}:${i}:${f.tryIt?.defaultServer||""}`)),f.codeSamples?.enabled!==!1&&xe("Code Examples","codeSamples",o.jsxs("div",{className:"min-w-0",children:[o.jsx("div",{className:"mb-3 flex max-w-full gap-1 overflow-x-auto pb-1",role:"tablist","aria-label":"Code example language",children:Y.map(he=>o.jsx("button",{role:"tab","aria-selected":A===he,onClick:()=>C(he),className:`shrink-0 rounded-md px-3 py-2 text-sm ${A===he?"bg-blue-600 text-white":u==="dark"?"bg-gray-800 text-gray-200":"bg-gray-100 text-gray-700"}`,children:zd(he)},he))}),o.jsx(On,{code:$g(k,A),language:A==="curl"?"bash":A,title:zd(A),theme:u,wrap:!!(typeof f.theme=="object"&&f.theme.typography?.code?.wrap)})]})),I.externalDocs&&o.jsx("p",{className:"pb-4 text-sm",children:o.jsx("a",{className:"text-blue-600 underline",href:I.externalDocs.url,target:"_blank",rel:"noopener noreferrer",children:I.externalDocs.description||"External documentation"})})]})})},Gx=({spec:a,onEndpointSelect:i,theme:c="light"})=>{const u=c==="dark"?"bg-gray-800 border-gray-700 shadow-lg text-white":"bg-white border-gray-200 shadow-sm text-gray-900",f=c==="dark"?"text-gray-300":"text-gray-600",p=c==="dark"?"hover:bg-gray-700 hover:border-gray-600":"hover:border-blue-300 hover:bg-blue-50",g=Object.values(a.paths).reduce((h,S)=>(Wt.getHttpMethods(S).forEach(C=>{h[C]=(h[C]||0)+1,h.total++}),h),{total:0}),y=Object.entries(a.paths).slice(0,6).flatMap(([h,S])=>Wt.getHttpMethods(S).map(A=>({path:h,method:A,operation:S[A]}))),x=[{icon:o.jsx(gs,{className:"w-5 h-5"}),iconBg:c==="dark"?"bg-blue-900":"bg-blue-100",iconColor:c==="dark"?"text-blue-300":"text-blue-600",title:"Total Endpoints",value:g.total},{icon:o.jsx($u,{className:"w-5 h-5"}),iconBg:c==="dark"?"bg-green-900":"bg-green-100",iconColor:c==="dark"?"text-green-300":"text-green-600",title:"Servers",value:a.servers?.length||0},{icon:o.jsx(Du,{className:"w-5 h-5"}),iconBg:c==="dark"?"bg-purple-900":"bg-purple-100",iconColor:c==="dark"?"text-purple-300":"text-purple-600",title:"Tags",value:a.tags?.length||0},{icon:o.jsx(rg,{className:"w-5 h-5"}),iconBg:c==="dark"?"bg-orange-900":"bg-orange-100",iconColor:c==="dark"?"text-orange-300":"text-orange-600",title:"Security Schemes",value:a.components?.securitySchemes?Object.keys(a.components.securitySchemes).length:0}];return o.jsx("div",{className:`flex-1 overflow-y-auto ${c==="dark"?"bg-gray-900":"bg-gray-50"}`,children:o.jsxs("div",{className:"p-4 md:p-8",children:[o.jsxs("div",{className:"mb-8",children:[o.jsxs("div",{className:"flex items-center gap-4 mb-4",children:[o.jsx("div",{className:`w-12 h-12 rounded-xl flex items-center justify-center ${c==="dark"?"bg-blue-700":"bg-gradient-to-br from-blue-500 to-blue-600"}`,children:o.jsx(gs,{className:"w-6 h-6 text-white"})}),o.jsxs("div",{children:[o.jsx("h1",{className:`text-2xl md:text-3xl font-bold ${c==="dark"?"text-white":"text-gray-900"}`,children:a.info.title}),o.jsxs("p",{className:`${c==="dark"?"text-gray-300":"text-gray-600"}`,children:["Version ",a.info.version]})]})]}),a.info.description&&o.jsx("p",{className:`text-lg leading-relaxed max-w-4xl ${c==="dark"?"text-white":"text-gray-600"}`,children:a.info.description})]}),o.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4 mb-8",children:x.map((h,S)=>o.jsx("div",{className:`p-4 rounded-xl border transition-colors ${u}`,children:o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("div",{className:`w-10 h-10 ${h.iconBg} rounded-lg flex items-center justify-center`,children:ms.cloneElement(h.icon,{className:`${h.iconColor} w-5 h-5`})}),o.jsxs("div",{children:[o.jsx("p",{className:`text-sm font-medium ${f}`,children:h.title}),o.jsx("p",{className:`text-xl font-bold ${c==="dark"?"text-white":"text-gray-900"}`,children:h.value})]})]})},S))}),o.jsxs("div",{className:`rounded-xl border p-4 md:p-6 mb-8 ${u}`,children:[o.jsx("h2",{className:`text-lg md:text-xl font-semibold mb-4 ${c==="dark"?"text-white":"text-gray-900"}`,children:"HTTP Methods Distribution"}),o.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 lg:grid-cols-6 gap-4",children:["get","post","put","delete","patch","options"].map(h=>o.jsxs("div",{className:"text-center",children:[o.jsx("div",{className:`px-3 py-1.5 mx-auto rounded-lg flex items-center justify-center mb-2 ${Wt.getMethodColor(h,c)}`,children:o.jsx("span",{className:"text-sm font-medium",children:h.toUpperCase()})}),o.jsx("p",{className:`font-bold ${c==="dark"?"text-white":"text-gray-900"}`,children:g[h]||0}),o.jsx("p",{className:"text-xs text-gray-400",children:h.toUpperCase()})]},h))})]}),o.jsxs("div",{className:`rounded-xl border p-4 md:p-6 mb-8 ${u}`,children:[o.jsx("h2",{className:`text-lg md:text-xl font-semibold mb-4 ${c==="dark"?"text-white":"text-gray-900"}`,children:"Available Endpoints"}),o.jsx("div",{className:"space-y-3",children:y.map(({path:h,method:S,operation:A})=>o.jsxs("button",{onClick:()=>i(h,S),className:`w-full text-left p-3 border rounded-lg transition-colors ${p} ${c==="dark"?"border-gray-700":"border-gray-200"}`,children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("span",{className:`text-xs font-bold px-2 py-1 rounded border ${Wt.getMethodColor(S,c)}`,children:S.toUpperCase()}),o.jsx("code",{className:`font-mono text-sm break-all ${c==="dark"?"text-blue-300 group-hover:text-blue-200":"text-blue-600 group-hover:text-blue-700"}`,children:h})]}),A?.summary&&o.jsx("p",{className:`text-sm mt-2 ml-14 ${c==="dark"?"text-gray-300":"text-gray-600"}`,children:A.summary})]},`${S}-${h}`))})]}),o.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[(a.info.contact||a.info.license)&&o.jsxs("div",{className:`rounded-xl border p-4 md:p-6 ${u}`,children:[o.jsx("h2",{className:`text-lg md:text-xl font-semibold mb-4 ${c==="dark"?"text-white":"text-gray-900"}`,children:"Information"}),o.jsxs("div",{className:"space-y-4",children:[a.info.contact&&o.jsxs("div",{children:[o.jsx("h3",{className:`font-medium mb-2 ${c==="dark"?"text-gray-100":"text-gray-900"}`,children:"Contact"}),a.info.contact.name&&o.jsx("p",{className:`text-sm ${f}`,children:a.info.contact.name}),a.info.contact.email&&o.jsx("p",{className:`text-sm ${f}`,children:a.info.contact.email}),a.info.contact.url&&o.jsxs("a",{href:a.info.contact.url,target:"_blank",rel:"noopener noreferrer",className:`text-sm flex items-center gap-1 ${c==="dark"?"text-blue-400 hover:text-blue-300":"text-blue-600 hover:text-blue-700"}`,children:["Website ",o.jsx(ys,{className:"w-3 h-3"})]})]}),a.info.license&&o.jsxs("div",{children:[o.jsx("h3",{className:`font-medium mb-2 ${c==="dark"?"text-gray-100":"text-gray-900"}`,children:"License"}),a.info.license.url?o.jsxs("a",{href:a.info.license.url,target:"_blank",rel:"noopener noreferrer",className:`text-sm flex items-center gap-1 ${c==="dark"?"text-blue-400 hover:text-blue-300":"text-blue-600 hover:text-blue-700"}`,children:[a.info.license.name,o.jsx(ys,{className:"w-3 h-3"})]}):o.jsx("p",{className:`text-sm ${f}`,children:a.info.license.name})]})]})]}),a.servers&&a.servers.length>0&&o.jsxs("div",{className:`rounded-xl border p-4 md:p-6 ${u}`,children:[o.jsx("h2",{className:`text-lg md:text-xl font-semibold mb-4 ${c==="dark"?"text-white":"text-gray-900"}`,children:"Servers"}),o.jsx("div",{className:"space-y-3",children:a.servers.map((h,S)=>o.jsxs("div",{className:`p-3 rounded-lg ${c==="dark"?"bg-gray-700/50":"bg-gray-50"}`,children:[o.jsx("code",{className:`text-sm font-mono ${c==="dark"?"text-blue-300":"text-blue-600"}`,children:h.url}),h.description&&o.jsx("p",{className:`text-sm mt-1 ${f}`,children:h.description})]},S))})]})]})]})})},Ix=({footerClasses:a,footer:i})=>{const c=i?.copyright,u=i?.link||[];return o.jsx("footer",{className:`${a} w-full border-t`,children:o.jsxs("div",{className:"mx-auto flex min-h-12 w-full max-w-[1600px] flex-col gap-2 px-4 py-3 text-xs sm:flex-row sm:items-center sm:justify-between sm:px-6 sm:text-sm",children:[o.jsx("p",{children:c||o.jsxs(o.Fragment,{children:["Powered by ",o.jsx("a",{href:"https://prauga.github.io/flexdoc",target:"_blank",rel:"noopener noreferrer",className:"font-semibold hover:opacity-80 transition-opacity",children:"FlexDoc"})]})}),u.length>0&&o.jsx("nav",{"aria-label":"Footer links",className:"flex flex-wrap gap-x-4 gap-y-2",children:u.map(f=>o.jsx("a",{href:f.url,target:"_blank",rel:"noopener noreferrer",className:"hover:opacity-80",children:f.text},`${f.text}:${f.url}`))})]})})},Fx=(a,i,c)=>a==="dark"?c:i,Vx={parameters:"Parameters",requestBody:"Request body",responses:"Responses",tryIt:"Try It",codeSamples:"Code examples"};function Xx(a){return a===void 0?"host":Array.isArray(a)?"custom":a==="none"?"minimal":a}function Zx(a){return Array.from(a.querySelectorAll('button:not([disabled]), select:not([disabled]), input:not([disabled]), a[href], [tabindex]:not([tabindex="-1"])')).filter(i=>i.getAttribute("aria-hidden")!=="true")}const Qx=({open:a,theme:i,viewerExpand:c,effectiveExpandedSections:u,onExpandChange:f,onClose:p})=>{const g=le.useRef(null),y=le.useRef(null);if(le.useEffect(()=>{if(!a||typeof document>"u")return;const C=document.activeElement instanceof HTMLElement?document.activeElement:null;y.current?.focus();const M=k=>{if(k.key==="Escape"){k.preventDefault(),p();return}if(k.key!=="Tab"||!g.current)return;const G=Zx(g.current);if(G.length===0){k.preventDefault(),g.current.focus();return}const U=G[0],I=G[G.length-1],_=document.activeElement;k.shiftKey&&(_===U||!g.current.contains(_))?(k.preventDefault(),I.focus()):!k.shiftKey&&(_===I||!g.current.contains(_))&&(k.preventDefault(),U.focus())};return document.addEventListener("keydown",M),()=>{document.removeEventListener("keydown",M),C?.isConnected&&C.focus()}},[a,p]),!a)return null;const x=i==="dark",h=x?"border-gray-700 bg-gray-900 text-gray-100":"border-gray-200 bg-white text-gray-900",S=x?"border-gray-700 bg-gray-800 text-gray-100":"border-gray-300 bg-white text-gray-900",A=Array.isArray(c)?c.filter(C=>Rl.includes(C)):[];return o.jsxs("div",{className:"fixed inset-0 z-[70]",children:[o.jsx("button",{"aria-label":"Close settings backdrop",className:"absolute inset-0 bg-black/40",onClick:p}),o.jsxs("aside",{ref:g,role:"dialog","aria-modal":"true","aria-label":"Viewer settings",tabIndex:-1,className:`absolute inset-y-0 right-0 flex w-[min(92vw,24rem)] flex-col border-l shadow-2xl ${h}`,children:[o.jsxs("div",{className:"flex min-h-14 items-center justify-between border-b px-4",children:[o.jsxs("div",{children:[o.jsx("div",{className:"font-semibold",children:"Settings"}),o.jsx("div",{className:"text-xs opacity-65",children:"Preferences are saved for this documentation."})]}),o.jsx("button",{type:"button","aria-label":"Close settings",className:"inline-flex h-11 w-11 items-center justify-center rounded-md",onClick:p,children:o.jsx(Hu,{className:"h-5 w-5"})})]}),o.jsx("div",{className:"flex-1 overflow-y-auto p-4",children:o.jsxs("section",{"aria-labelledby":"expansion-settings-heading",children:[o.jsx("h2",{id:"expansion-settings-heading",className:"mb-1 text-sm font-semibold",children:"Default expanded sections"}),o.jsx("p",{className:"mb-3 text-xs opacity-65",children:"This preference overrides the documentation author's default. Opening or closing a section manually remains temporary."}),o.jsxs("select",{ref:y,"aria-label":"Default expanded sections",className:`w-full rounded-md border px-3 py-2 text-sm ${S}`,value:Xx(c),onChange:C=>{const M=C.target.value;f(M==="host"?void 0:M==="custom"?[...u]:M)},children:[o.jsx("option",{value:"host",children:"Use documentation default"}),o.jsx("option",{value:"minimal",children:"Minimal"}),o.jsx("option",{value:"documentation",children:"Documentation"}),o.jsx("option",{value:"interactive",children:"Interactive"}),o.jsx("option",{value:"all",children:"All sections"}),o.jsx("option",{value:"custom",children:"Custom sections"})]}),Array.isArray(c)&&o.jsxs("fieldset",{className:"mt-4 space-y-2",children:[o.jsx("legend",{className:"mb-2 text-xs font-medium uppercase tracking-wide opacity-65",children:"Custom sections"}),Rl.map(C=>o.jsxs("label",{className:"flex min-h-9 items-center gap-2 text-sm",children:[o.jsx("input",{type:"checkbox",checked:A.includes(C),onChange:M=>{const k=new Set(A);M.target.checked?k.add(C):k.delete(C),f(Rl.filter(G=>k.has(G)))}}),Vx[C]]},C))]}),c!==void 0&&o.jsx("button",{type:"button",className:"mt-5 rounded-md border px-3 py-2 text-sm",onClick:()=>f(void 0),children:"Reset to documentation defaults"})]})})]})]})};function Vr(a){if(a!==void 0)return typeof a=="number"?`${a}px`:a}function Kx(a,i){if(!i)return{};const c=i.colors||{},u=i.typography||{},f=i.sidebar||{};return{"--flexdoc-primary":c.primary?.main,"--flexdoc-text":c.text?.primary,"--flexdoc-text-muted":c.text?.secondary,"--flexdoc-border":a==="dark"?c.border?.dark:c.border?.light,"--flexdoc-sidebar-bg":a==="dark"?f.backgroundColorDark:f.backgroundColor,"--flexdoc-sidebar-text":a==="dark"?f.textColorDark:f.textColor,"--flexdoc-sidebar-active-text":a==="dark"?f.activeTextColorDark:f.activeTextColor,"--flexdoc-heading-font":u.headings?.fontFamily,"--flexdoc-heading-weight":u.headings?.fontWeight,"--flexdoc-code-font":u.code?.fontFamily,"--flexdoc-code-size":u.code?.fontSize,"--flexdoc-code-line-height":u.code?.lineHeight,"--flexdoc-code-color":u.code?.color,"--flexdoc-code-bg":u.code?.backgroundColor,fontFamily:u.fontFamily,fontSize:u.fontSize,lineHeight:u.lineHeight}}function _f(a,i){return`${i.toLowerCase()}-${a.replace(/[^a-zA-Z0-9]+/g,"-").replace(/^-|-$/g,"")}`}function Of(a,i){const c=i.replace(/^#/,"");if(!c)return null;for(const[u,f]of Object.entries(a.paths))for(const p of Wt.getHttpMethods(f))if(_f(u,p)===c)return{path:u,method:p};return null}function Jx({logo:a}){const i=typeof a=="string"?{url:a}:a,c=typeof i.padding=="object"?`${Vr(i.padding.vertical)||"0"} ${Vr(i.padding.horizontal)||"0"}`:i.padding,u=o.jsx("img",{src:i.url,alt:i.alt||"API documentation logo",style:{maxHeight:Vr(i.maxHeight)||"32px",maxWidth:Vr(i.maxWidth)||"180px"}});return o.jsx("div",{className:`flex items-center ${i.containerClass||""}`,style:{backgroundColor:i.backgroundColor,padding:c},children:i.clickable===!1?u:o.jsx("a",{href:"#","aria-label":"Documentation home",children:u})})}const Wx=({spec:a,theme:i="light",customStyles:c={},options:u={}})=>{const[f,p]=le.useState(()=>typeof window>"u"?null:Of(a,window.location.hash)),[g,y]=le.useState(!1),[x,h]=le.useState(!1),S=vg(a.info.title,typeof window>"u"?void 0:window.location.host),[A,C]=le.useState(()=>({key:S,expand:Od(S).expand})),M=A.key===S?A.expand:Od(S).expand,k=typeof u.theme=="object"?u.theme:void 0,G=le.useMemo(()=>({...Kx(i,k),...c}),[i,k,c]);le.useEffect(()=>{if(!u.customCss)return;const D=document.createElement("style");return D.dataset.flexdocCustomCss="true",D.textContent=u.customCss,document.head.appendChild(D),()=>D.remove()},[u.customCss]),le.useEffect(()=>{if(typeof window>"u")return;const D=()=>p(Of(a,window.location.hash));return D(),window.addEventListener("hashchange",D),()=>window.removeEventListener("hashchange",D)},[a]),le.useEffect(()=>{if(!g||typeof document>"u")return;const D=document.body.style.overflow;document.body.style.overflow="hidden";const X=me=>{me.key==="Escape"&&y(!1)};return document.addEventListener("keydown",X),()=>{document.body.style.overflow=D,document.removeEventListener("keydown",X)}},[g]);const U=(D,X)=>{p({path:D,method:X}),y(!1),typeof window<"u"&&(window.location.hash=_f(D,X))},I=Gs(u.expand,u.expand===void 0?u.expandResponses:void 0),_=M===void 0?I:Gs(M),N=D=>{C({key:S,expand:D}),Sg(S,D)},j=Fx(i,"border-gray-200 bg-white text-gray-600","border-gray-700 bg-gray-800 text-gray-300"),R=i==="dark"?"bg-gray-900 text-gray-100":"bg-gray-50 text-gray-900",Y=(D=!1)=>o.jsx("button",{type:"button",className:D?`fixed bottom-4 right-4 z-40 inline-flex h-11 w-11 items-center justify-center rounded-full border shadow-lg ${i==="dark"?"border-gray-700 bg-gray-900 text-gray-100":"border-gray-200 bg-white text-gray-900"}`:"inline-flex h-11 w-11 items-center justify-center rounded-md border","aria-label":"Open settings","aria-expanded":x,onClick:()=>h(!0),children:o.jsx(ag,{className:"h-5 w-5"})});return o.jsxs("div",{className:`flexdoc-root flex min-h-screen flex-col ${R}`,style:G,children:[!u.hideTopbar&&o.jsxs("header",{className:`sticky top-0 z-30 flex min-h-14 items-center gap-3 border-b px-3 sm:px-5 ${i==="dark"?"border-gray-700 bg-gray-900":"border-gray-200 bg-white"}`,children:[o.jsx("button",{className:"inline-flex h-11 w-11 items-center justify-center rounded-md lg:hidden","aria-label":"Open API navigation","aria-expanded":g,onClick:()=>y(!0),children:o.jsx(tg,{className:"h-5 w-5"})}),u.logo&&o.jsx(Jx,{logo:u.logo}),o.jsxs("div",{className:"min-w-0 flex-1",children:[o.jsx("div",{className:"truncate font-semibold",children:a.info.title}),!u.hideHostname&&a.servers?.[0]?.url&&o.jsx("div",{className:"truncate text-xs opacity-60",children:a.servers[0].url})]}),!u.hideDownloadButton&&o.jsx("a",{className:"hidden rounded-md border px-3 py-2 text-sm sm:inline-flex",href:`data:application/json;charset=utf-8,${encodeURIComponent(JSON.stringify(a,null,2))}`,download:"openapi.json",children:"Download spec"}),Y()]}),u.hideTopbar&&Y(!0),o.jsxs("div",{className:"relative flex min-h-0 flex-1 overflow-hidden",children:[o.jsx("aside",{className:"hidden w-80 shrink-0 lg:block",style:{background:"var(--flexdoc-sidebar-bg)",color:"var(--flexdoc-sidebar-text)"},children:o.jsx(Cd,{spec:a,onEndpointSelect:U,theme:i,selectedEndpoint:f||void 0})}),g&&o.jsxs("div",{className:"fixed inset-0 z-50 lg:hidden",role:"dialog","aria-modal":"true","aria-label":"API navigation",children:[o.jsx("button",{"aria-label":"Close navigation backdrop",className:"absolute inset-0 bg-black/40",onClick:()=>y(!1)}),o.jsxs("aside",{className:`absolute inset-y-0 left-0 flex w-[min(88vw,22rem)] flex-col shadow-2xl ${i==="dark"?"bg-gray-900":"bg-white"}`,children:[o.jsxs("div",{className:"flex h-14 items-center justify-between border-b px-4",children:[o.jsx("span",{className:"font-semibold",children:"API navigation"}),o.jsx("button",{className:"inline-flex h-11 w-11 items-center justify-center rounded-md","aria-label":"Close API navigation",onClick:()=>y(!1),children:o.jsx(Hu,{className:"h-5 w-5"})})]}),o.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:o.jsx(Cd,{spec:a,onEndpointSelect:U,theme:i,selectedEndpoint:f||void 0})})]})]}),o.jsx("main",{className:"min-w-0 flex-1 overflow-hidden",children:f?o.jsx(Yx,{spec:a,path:f.path,method:f.method,theme:i,options:u,defaultExpandedSections:_}):o.jsx(Gx,{spec:a,onEndpointSelect:U,theme:i})})]}),o.jsx(Ix,{footerClasses:j,footer:u.footer}),o.jsx(Qx,{open:x,theme:i,viewerExpand:M,effectiveExpandedSections:_,onExpandChange:N,onClose:()=>h(!1)})]})},lo="x-flexdoc-external-documents";function Px(a){if(typeof fetch!="function")throw new Error("No document loader is available in this environment");return fetch(a).then(async i=>{if(!i.ok)throw new Error(`Failed to load OpenAPI reference ${a}: ${i.status}`);const c=await i.text();return _n.parseSpec(c).catch(()=>{try{return JSON.parse(c)}catch{throw new Error(`Reference document is not valid JSON/YAML: ${a}`)}})})}function eb(a,i){if(a.startsWith("#"))return{documentUri:i,pointer:a};const c=new URL(a,i),u=c.hash||"#";return c.hash="",{documentUri:c.toString(),pointer:u}}function kf(a,i){const c=_n.encodePointerToken(a);if(i==="#"||i==="")return`#/${lo}/${c}`;if(!i.startsWith("#/"))throw new Error(`Unsupported JSON Pointer reference: ${i}`);return`#/${lo}/${c}/${i.slice(2)}`}function Rf(a){return JSON.parse(JSON.stringify(a))}async function tb(a,i){const c=i.load||Px,u=new URL(i.baseUri).toString().replace(/#.*$/,""),f=Rf(a),p={},g=new Map;async function y(S){if(S===u)return f;if(p[S])return p[S];if(g.has(S))return g.get(S);const A=Promise.resolve(c(S)).then(M=>Rf(M));g.set(S,A);const C=await A;return p[S]=C,C}const x=new Set;async function h(S,A){if(x.has(A))return;x.add(A);async function C(M){if(!(!M||typeof M!="object")){if(Array.isArray(M)){for(const k of M)await C(k);return}if(typeof M.$ref=="string"){const k=eb(M.$ref,A);if(k.documentUri!==A){const G=await y(k.documentUri);M.$ref=k.documentUri===u?k.pointer:kf(k.documentUri,k.pointer),await h(G,k.documentUri)}else A!==u&&(M.$ref=kf(A,k.pointer))}for(const[k,G]of Object.entries(M))k!=="$ref"&&await C(G)}}await C(S)}return await h(f,u),Object.keys(p).length&&(f[lo]=p),f}async function nb(a,i){return tb(a,i)}const Xr="1",Zr=new WeakMap;function lb(a){return JSON.parse(JSON.stringify(a))}function ao(a,i={}){const c=lb(a);if(i.title&&(c.info.title=i.title),i.description&&(c.info.description=i.description),i.altDescription&&!c.info.description&&(c.info.description=i.altDescription),i.version&&(c.info.version=i.version),!i.tagGroups?.length)return c;const u=new Map;for(const g of i.tagGroups)for(const y of g.tags)u.set(y,g.name);const f={},p=new Set(["get","post","put","delete","patch","options","head","trace"]);for(const[g,y]of Object.entries(c.paths)){const x={};let h=!1;for(const[S,A]of Object.entries(y)){if(!p.has(S)){x[S]=A;continue}const C=A,M=(C?.tags||[]).filter(k=>u.has(k)).map(k=>u.get(k));!M.length||!C||(x[S]={...C,tags:Array.from(new Set(M))},h=!0)}h&&(f[g]=x)}return c.paths=f,c.tags=i.tagGroups.map(g=>({name:g.name})),c}function ab(a){return typeof a.theme=="string"?a.theme:typeof document<"u"&&document.documentElement.classList.contains("dark")?"dark":"light"}function qf(a,i,c){const u=ao(i,c),f=Zr.get(a);f&&f.unmount();const p=By.createRoot(a);return Zr.set(a,p),p.render(o.jsx(Wx,{spec:u,theme:ab(c),options:c})),()=>{Zr.get(a)===p&&Zr.delete(a),p.unmount()}}function Mf(a,i){const c={contractVersion:Xr,...i.options||{}};return qf(a,i.spec,c)}async function zf(a,i){const c={contractVersion:Xr,...i.options||{}},u=i.baseUri?await nb(i.spec,{baseUri:i.baseUri,load:i.documentLoader}):i.spec;return qf(a,u,c)}return typeof window<"u"&&(window.FlexDocStandalone={mount:Mf,mountAsync:zf,prepareSpec:ao,contractVersion:Xr}),Kl.FLEXDOC_CONTRACT_VERSION=Xr,Kl.mountFlexDoc=Mf,Kl.mountFlexDocAsync=zf,Kl.prepareSpec=ao,Object.defineProperty(Kl,Symbol.toStringTag,{value:"Module"}),Kl})({});
|
|
82
|
+
`).trim(),n=t.tests.filter(Boolean).join(`
|
|
83
|
+
|
|
84
|
+
`).trim();return e||n?{preRequest:e,tests:n}:void 0}function _v(t){try{return decodeURIComponent(t.replace(/\+/g," "))}catch{return t}}function Lv(t){const e=t.split("#",1)[0],n=e.indexOf("?");if(n<0)return{url:e,query:[]};const r=e.slice(n+1),s=r?r.split("&").map(a=>{const c=a.indexOf("=");return{key:_v(c>=0?a.slice(0,c):a),value:_v(c>=0?a.slice(c+1):""),enabled:!0}}):[];return{url:e.slice(0,n),query:s}}function JO(t){return Jr(t).map(e=>({key:st(e.key),value:st(e.value),enabled:e.disabled!==!0}))}function QO(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Bv(t,e){let n=t;for(const r of Jr(e)){const s=st(r.key).trim();s&&(n=n.replace(new RegExp(`:${QO(s)}(?=/|$)`,"g"),`{{${s}}}`))}return n}function WO(t){if(typeof t=="string")return Lv(t);if(!pn(t))return{url:"",query:[]};const e=JO(t.query),n=st(t.raw);if(n){const h=Lv(n);return{url:Bv(h.url,t.variable),query:e.length>0?e:h.query}}const r=st(t.protocol).replace(/:$/,""),s=Array.isArray(t.host)?t.host.map(st).join("."):st(t.host),a=st(t.port),c=Array.isArray(t.path)?t.path.map(st).join("/"):st(t.path).replace(/^\//,""),d=s?`${r?`${r}://`:""}${s}${a?`:${a}`:""}`:"",f=d?`${d}${c?`/${c}`:""}`:c;return{url:Bv(f,t.variable),query:e}}function ZO(t){return Jr(t).map(e=>({key:st(e.key),value:st(e.value),enabled:e.disabled!==!0}))}function e3(t){return t.find(e=>e.enabled!==!1&&e.key.toLowerCase()==="content-type")?.value}function t3(t){switch(t.toLowerCase()){case"json":return"application/json";case"xml":return"application/xml";case"html":return"text/html";case"javascript":return"application/javascript";case"text":return"text/plain";default:return}}function n3(t,e,n,r){const s=e3(e);if(!pn(t)||!t.mode)return{body:"",contentType:s||"application/json",bodyMode:"none"};const a=st(t.mode);if(a==="raw"){const c=pn(t.options)&&pn(t.options.raw)?t.options.raw:void 0,d=c?st(c.language):"";return{body:st(t.raw),contentType:s||t3(d)||"text/plain",bodyMode:d.toLowerCase()==="json"?"json":"raw"}}if(a==="urlencoded")return{body:"",bodyMode:"urlencoded",urlencoded:Jr(t.urlencoded).map(d=>({key:st(d.key),value:st(d.value),enabled:d.disabled!==!0})),contentType:s||"application/x-www-form-urlencoded"};if(a==="graphql"){const c=pn(t.graphql)?t.graphql:{},d=st(c.variables);return{body:"",bodyMode:"graphql",graphql:{query:st(c.query),variables:d},contentType:s||"application/json"}}if(a==="formdata"){const c=Jr(t.formdata).map(f=>{const h=st(f.type)==="file"?"file":"text",g=Array.isArray(f.src)?f.src.map(st).filter(Boolean).join(", "):st(f.src);return{key:st(f.key),value:h==="text"?st(f.value):"",enabled:f.disabled!==!0,type:h,...h==="file"&&g?{fileName:g}:{},...typeof f.contentType=="string"?{contentType:f.contentType}:{}}});return c.filter(f=>f.type==="file").length>0&&Xn(r,"postman-body-formdata-files",n,"Multipart file fields were preserved, but exported local file paths cannot be reopened by the browser. Re-select those files before sending."),{body:"",bodyMode:"formdata",formData:c,contentType:s}}if(a==="file"){const c=pn(t.file)?st(t.file.src):st(t.src);return Xn(r,"postman-body-file",n,c?`Postman binary file body "${c}" was preserved as intent, but browser security requires re-selecting the file before sending.`:"Postman binary file body requires selecting the file again in FlexDoc before sending."),{body:"",contentType:s||"application/octet-stream",bodyMode:"binary",binary:{fileName:c||void 0,contentType:s||"application/octet-stream"}}}return Xn(r,"postman-body-unsupported",n,`Postman body mode "${a}" is not supported; the request body was left empty.`),{body:"",contentType:s||"application/octet-stream",bodyMode:"none"}}function i3(t,e,n,r,s,a,c,d){const f=typeof t=="string"?{method:"GET",url:t}:t;if(!pn(f))return Xn(d,"postman-request-invalid",c,"Skipped an invalid Postman request entry."),null;const h=st(f.method).trim().toUpperCase()||"GET",g=WO(f.url),b=ZO(f.header),v=n3(f.body,b,`${c}.body`,d),S={method:h,url:g.url,query:g.query,headers:b,body:v.body,contentType:v.contentType,bodyMode:v.bodyMode,urlencoded:v.urlencoded,formData:v.formData,binary:v.binary,graphql:v.graphql,auth:$h(f.auth,{type:"inherit"},`${c}.auth`,d)},A=XO(s);return{id:wn("request"),collectionId:n,folderId:r,name:e.trim()||`${h} ${g.url||"request"}`,request:S,...A?{scripts:A}:{},createdAt:a,updatedAt:a}}function $v(t){Array.isArray(t.items)&&t.items.forEach((e,n)=>{const r=`${t.path}[${n}]`;if(!pn(e)){Xn(t.warnings,"postman-item-invalid",r,"Skipped an invalid Postman item.");return}const s=st(e.name)||"Untitled",a=Dv(e.event,`${r}.event`,t.warnings),c=GO(t.inheritedScripts,a);if(Array.isArray(e.item)){const f=wn("folder");t.folders.push({id:f,collectionId:t.collectionId,parentFolderId:t.parentFolderId,name:s,auth:$h(e.auth,{type:"inherit"},`${r}.auth`,t.warnings),createdAt:t.timestamp,updatedAt:t.timestamp}),$v({...t,items:e.item,parentFolderId:f,inheritedScripts:c,path:`${r}.item`});return}const d=i3(e.request,s,t.collectionId,t.parentFolderId,c,t.timestamp,`${r}.request`,t.warnings);d&&t.requests.push(d)})}function r3(t){if(!pn(t)||!pn(t.info)||!Array.isArray(t.item))throw new Error("This JSON is not a Postman collection. Expected info and item fields.");const e=st(t.info.name).trim();if(!e)throw new Error("Postman collection info.name is required.");const n=[],r=st(t.info.schema);r&&!r.includes("/v2.1.0/")&&Xn(n,"postman-schema-version","info.schema",`Collection schema "${r}" is not Postman v2.1; FlexDoc imported the compatible fields it recognized.`);const s=new Date().toISOString(),a=wn("collection"),c={id:a,name:e,auth:$h(t.auth,{type:"none"},"auth",n),variables:Rv(t.variable,"variable",n),createdAt:s,updatedAt:s},d=[],f=[];return $v({items:t.item,collectionId:a,inheritedScripts:Dv(t.event,"event",n),timestamp:s,path:"item",folders:d,requests:f,warnings:n}),{collection:c,folders:d,requests:f,warnings:n}}function s3(t){if(!pn(t)||!Array.isArray(t.values)||typeof t.name!="string")throw new Error("This JSON is not a Postman environment. Expected name and values fields.");const e=st(t._postman_variable_scope).toLowerCase();if(e&&e!=="environment")throw new Error(`Postman variable scope "${e}" is not an environment.`);const n=[],r=new Date().toISOString();return{environment:{id:wn("environment"),name:t.name.trim()||"Imported environment",variables:Rv(t.values,"values",n),createdAt:r,updatedAt:r},warnings:n}}function l3(t){if(pn(t)&&pn(t.info)&&Array.isArray(t.item))return{kind:"collection",result:r3(t)};if(pn(t)&&Array.isArray(t.values)&&typeof t.name=="string")return{kind:"environment",result:s3(t)};throw new Error("Unsupported Postman JSON. Import a collection v2.1 JSON file or an exported environment JSON file.")}function a3(t){if(t.collections.length!==1||t.folders.length!==0||t.requests.length!==0)return!1;const e=t.collections[0];return e.name==="My Collection"&&e.auth.type==="none"&&e.variables.length===0}function o3(t,e){const n=a3(t)?[]:t.collections;return{...t,collections:[...n,e.collection],folders:[...t.folders,...e.folders],requests:[...t.requests,...e.requests]}}function c3(t,e){return{...t,environments:[...t.environments,e.environment],activeEnvironmentId:t.activeEnvironmentId||e.environment.id}}function qv(t,e){return`${t} ${t===1?e:`${e}s`}`}const u3=({onWorkspaceChange:t,onSelectedCollectionChange:e,theme:n})=>{const r=I.useRef(null),[s,a]=I.useState(null),[c,d]=I.useState([]),f=async A=>{if(A.length===0)return;const C=[],T=[],D=[];for(const B of A)try{const M=JSON.parse(await B.text()),z=l3(M);C.push(z),T.push(...z.result.warnings.map(F=>({...F,path:`${B.name}:${F.path}`})))}catch(M){D.push(`${B.name}: ${M instanceof Error?M.message:String(M)}`)}C.length>0&&t(B=>{let M=B;for(const z of C)M=z.kind==="collection"?o3(M,z.result):c3(M,z.result);return M});const j=C.filter(B=>B.kind==="collection"),E=C.length-j.length,O=j[j.length-1];O?.kind==="collection"&&e?.(O.result.collection.id),d(T);const R=[j.length>0?qv(j.length,"collection"):"",E>0?qv(E,"environment"):""].filter(Boolean);C.length===0?a({tone:"error",text:D.join(" ")||"No Postman documents were imported."}):D.length>0||T.length>0?a({tone:"warning",text:`Imported ${R.join(" and ")}. ${D.length>0?`${D.length} file${D.length===1?"":"s"} failed to import.`:`${T.length} compatibility warning${T.length===1?"":"s"} need review.`}`}):a({tone:"success",text:`Imported ${R.join(" and ")}.`})},h=n==="dark"?"border-gray-700 bg-gray-900 text-gray-100":"border-gray-300 bg-white text-gray-900",g=n==="dark"?"text-gray-400":"text-gray-500",b=n==="dark"?"text-amber-300":"text-amber-700",v=n==="dark"?"text-emerald-300":"text-emerald-700",S=n==="dark"?"text-red-300":"text-red-700";return p.jsxs("section",{className:"space-y-3","aria-labelledby":"api-client-import-heading",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx(vg,{className:"h-4 w-4"}),p.jsx("h3",{id:"api-client-import-heading",className:"font-semibold",children:"Import"})]}),p.jsx("input",{ref:r,type:"file",accept:".json,application/json",multiple:!0,className:"hidden","aria-label":"Import Postman JSON",onChange:A=>{const C=Array.from(A.currentTarget.files||[]);A.currentTarget.value="",f(C)}}),p.jsxs("button",{type:"button",className:`flex w-full items-center justify-center gap-2 rounded-md border px-3 py-2 text-sm font-medium ${h}`,onClick:()=>r.current?.click(),children:[p.jsx(vg,{className:"h-4 w-4"}),"Import Postman"]}),p.jsx("p",{className:`text-xs ${g}`,children:"Import Postman Collection v2.1 and exported environment JSON files. Multiple files can be selected together."}),s&&p.jsxs("div",{className:`flex items-start gap-2 text-xs ${s.tone==="success"?v:s.tone==="warning"?b:S}`,role:"status",children:[s.tone==="success"?p.jsx(Oo,{className:"mt-0.5 h-4 w-4 shrink-0"}):p.jsx(md,{className:"mt-0.5 h-4 w-4 shrink-0"}),p.jsx("span",{children:s.text})]}),c.length>0&&p.jsxs("details",{className:`text-xs ${b}`,children:[p.jsxs("summary",{className:"cursor-pointer font-medium",children:["Review import warnings (",c.length,")"]}),p.jsxs("ul",{className:"mt-2 space-y-2 pl-4",children:[c.slice(0,5).map((A,C)=>p.jsxs("li",{children:[p.jsx("span",{className:"font-mono",children:A.path}),": ",A.message]},`${A.code}-${A.path}-${C}`)),c.length>5&&p.jsxs("li",{children:[c.length-5," more warning",c.length-5===1?"":"s"," not shown."]})]})]})]})};function d3(t,e){if(!e.folderId)return"Collection root";const n=new Map(t.folders.map(c=>[c.id,c])),r=[],s=new Set;let a=n.get(e.folderId);for(;a&&!s.has(a.id);)s.add(a.id),r.unshift(a.name),a=a.parentFolderId?n.get(a.parentFolderId):void 0;return r.join(" / ")||"Deleted folder"}function f3(t){return t.status==="running"?"Running":t.status==="passed"?"Runner pass":t.status==="failed"?"Runner fail":t.status==="cancelled"?"Cancelled":t.status==="skipped"?"Not run":"Pending"}const h3=({workspace:t,onWorkspaceChange:e,collectionId:n,folderId:r,theme:s,credentials:a,requestInterceptor:c,hostExecution:d,externalVariables:f,externalEnvironmentVariables:h,onCollectionChanges:g,onEnvironmentChanges:b,onOpenHistory:v,onBack:S,fetcher:A})=>{const C=I.useMemo(()=>Ic(t,n,r),[n,r,t]),T=I.useMemo(()=>jv(t,n,r),[n,r,t]),D=t.environments.find(ee=>ee.id===t.activeEnvironmentId),[j,E]=I.useState(!1),[O,R]=I.useState(!1),[B,M]=I.useState(),[z,F]=I.useState({}),X=I.useRef(void 0),W=I.useRef(!0);I.useEffect(()=>(W.current=!0,()=>{W.current=!1,X.current?.abort()}),[]);const G=async()=>{if(O||C.length===0)return;const ee=new AbortController;X.current=ee,R(!0),M(void 0),F(Object.fromEntries(C.map($=>[$.id,{status:"pending"}])));const he=await LO({workspace:t,collectionId:n,folderId:r,runName:T,credentials:a,requestInterceptor:c,hostExecution:d,externalVariables:f,externalEnvironmentVariables:h,stopOnFailure:j,signal:ee.signal,fetcher:A,onCollectionChanges:g,onEnvironmentChanges:b,onRequestStart:$=>{W.current&&F(te=>({...te,[$.id]:{status:"running"}}))},onRequestComplete:$=>{W.current&&F(te=>({...te,[$.requestId]:{status:$.cancelled?"cancelled":$.passed?"passed":"failed",item:$}}))}});W.current&&(e(he.workspace),F($=>Object.fromEntries(C.map(te=>{const L=$[te.id]||{status:"pending"};return[te.id,L.status==="pending"&&he.stopped?{status:"skipped"}:L]}))),M(he),R(!1),X.current=void 0)},we=()=>X.current?.abort(),ye=s==="dark"?"border-gray-700 bg-gray-800/60 text-gray-100":"border-gray-200 bg-gray-50 text-gray-900",xe=s==="dark"?"text-gray-400":"text-gray-500",_=s==="dark"?"border-gray-700 bg-gray-900/40":"border-gray-200 bg-white";return p.jsx("section",{className:`rounded-xl border p-4 md:p-5 ${ye}`,"aria-labelledby":"api-client-runner-heading",children:p.jsxs("div",{className:"space-y-5",children:[p.jsxs("header",{className:"flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[p.jsxs("div",{className:"flex items-start gap-3",children:[p.jsxs("button",{type:"button",className:"inline-flex min-h-10 items-center gap-2 rounded-md border px-3 py-2 text-sm",onClick:S,children:[p.jsx(Eo,{className:"h-4 w-4"})," Client"]}),p.jsxs("div",{children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx(la,{className:"h-5 w-5"}),p.jsx("h2",{id:"api-client-runner-heading",className:"text-lg font-semibold",children:"Collection runner"})]}),p.jsx("p",{className:"mt-1 text-sm font-medium",children:T}),p.jsxs("p",{className:`mt-1 text-xs ${xe}`,children:[C.length," saved request",C.length===1?"":"s"," · Environment: ",D?.name||"None"]})]})]}),p.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[B?.runId&&p.jsxs("button",{type:"button",className:"inline-flex min-h-10 items-center gap-2 rounded-md border px-3 py-2 text-sm",onClick:()=>v(void 0,B.runId),children:[p.jsx(rA,{className:"h-4 w-4"})," Open run history"]}),O?p.jsxs("button",{type:"button",className:"inline-flex min-h-10 items-center gap-2 rounded-md border border-red-300 px-3 py-2 text-sm text-red-700",onClick:we,children:[p.jsx(bg,{className:"h-4 w-4"})," Stop run"]}):p.jsxs("button",{type:"button",disabled:C.length===0,className:"inline-flex min-h-10 items-center gap-2 rounded-md border px-3 py-2 text-sm font-medium disabled:cursor-not-allowed disabled:opacity-50",onClick:()=>{G()},children:[p.jsx(la,{className:"h-4 w-4"})," ",B?"Run again":"Start run"]})]})]}),p.jsxs("div",{className:"flex flex-col gap-3 rounded-lg border p-3 sm:flex-row sm:items-center sm:justify-between",children:[p.jsxs("label",{className:"inline-flex items-center gap-2 text-sm",children:[p.jsx("input",{type:"checkbox",checked:j,disabled:O,onChange:ee=>E(ee.target.checked)}),"Stop on runner failure"]}),p.jsx("p",{className:`text-xs ${xe}`,children:"Runner failure means transport/script/test failure. HTTP 4xx/5xx alone does not fail an item."})]}),B&&p.jsxs("div",{className:"grid gap-2 sm:grid-cols-5",children:[p.jsxs("div",{className:"rounded-md border px-3 py-2 text-sm",children:[p.jsx("div",{className:xe,children:"Progress"}),p.jsxs("strong",{children:[B.completed," / ",B.total]})]}),p.jsxs("div",{className:"rounded-md border px-3 py-2 text-sm",children:[p.jsx("div",{className:xe,children:"Passed"}),p.jsx("strong",{className:"text-green-600",children:B.passed})]}),p.jsxs("div",{className:"rounded-md border px-3 py-2 text-sm",children:[p.jsx("div",{className:xe,children:"Failed"}),p.jsx("strong",{className:"text-red-600",children:B.failed})]}),p.jsxs("div",{className:"rounded-md border px-3 py-2 text-sm",children:[p.jsx("div",{className:xe,children:"Cancelled"}),p.jsx("strong",{children:B.cancelled})]}),p.jsxs("div",{className:"rounded-md border px-3 py-2 text-sm",children:[p.jsx("div",{className:xe,children:"Run"}),p.jsx("strong",{children:B.stopped?"Stopped":"Complete"})]})]}),p.jsxs("section",{className:"space-y-3","aria-labelledby":"api-client-runner-order-heading",children:[p.jsxs("div",{children:[p.jsx("h3",{id:"api-client-runner-order-heading",className:"font-semibold",children:"Execution order"}),p.jsx("p",{className:`text-xs ${xe}`,children:"Requests execute sequentially in saved-request order. Folder runs include descendant folders; this list is the exact order that will run."})]}),C.map((ee,he)=>{const $=z[ee.id]||{status:"pending"},te=$.item?.outcome.result,L=$.item?.outcome.scriptTests||[],P=L.filter(Se=>Se.passed).length,ue=te?.status!==void 0&&te.status>=400;return p.jsxs("div",{"data-runner-request-id":ee.id,className:`rounded-lg border p-3 ${_}`,children:[p.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-start sm:justify-between",children:[p.jsxs("div",{className:"min-w-0",children:[p.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-sm",children:[p.jsx("span",{className:`text-xs ${xe}`,children:he+1}),p.jsx("span",{className:"font-mono font-bold text-blue-600",children:ee.request.method.toUpperCase()}),p.jsx("span",{className:"font-medium",children:ee.name})]}),p.jsx("div",{className:`mt-1 text-xs ${xe}`,children:d3(t,ee)}),p.jsx("div",{className:"mt-1 truncate font-mono text-xs",title:ee.request.url,children:ee.request.url})]}),p.jsxs("div",{className:"flex shrink-0 flex-wrap items-center gap-2 text-xs",children:[$.status==="running"&&p.jsx(aA,{className:"h-4 w-4 animate-spin"}),$.status==="passed"&&p.jsx(Oo,{className:"h-4 w-4 text-green-600"}),$.status==="failed"&&p.jsx(tA,{className:"h-4 w-4 text-red-600"}),p.jsx("span",{children:f3($)}),te?.status!==void 0&&p.jsxs("span",{className:ue?"text-amber-600":xe,children:["HTTP ",te.status]}),te?.responseTime!==void 0&&p.jsxs("span",{className:xe,children:[p.jsx(dd,{className:"mr-1 inline h-3.5 w-3.5"}),te.responseTime," ms"]})]})]}),L.length>0&&p.jsxs("div",{className:`mt-2 text-xs ${L.some(Se=>!Se.passed)?"text-red-600":xe}`,children:[P,"/",L.length," tests passed"]}),$.item?.outcome.scriptError&&p.jsx("div",{className:"mt-2 text-xs text-red-600",children:$.item.outcome.scriptError}),$.item?.outcome.error&&!$.item.cancelled&&p.jsx("div",{className:"mt-2 text-xs text-red-600",children:$.item.outcome.error}),$.item?.historyEntryId&&p.jsx("button",{type:"button",className:"mt-2 text-xs font-medium text-blue-600 underline underline-offset-2","aria-label":`Open history for ${ee.name}`,onClick:()=>v($.item?.historyEntryId,$.item?.outcome.result?B?.runId:void 0),children:"Inspect history"})]},ee.id)}),C.length===0&&p.jsx("div",{className:`rounded-lg border px-4 py-8 text-center text-sm ${xe}`,children:"There are no saved requests in this run scope yet."})]})]})})};function zv(t){return`flexdoc:api-client-ui:${encodeURIComponent(t)}`}function Hv(t,e){const n=e??(typeof window<"u"?window.localStorage:void 0);if(!n)return{version:1};try{const r=n.getItem(zv(t));if(!r)return{version:1};const s=JSON.parse(r);if(s.version!==1)return{version:1};const a=new Set(["params","headers","authorization","body","scripts"]),c=new Set(["pre-request","tests"]),d=new Set(["light","dark"]);return s.sidebarCollapsed!==void 0&&typeof s.sidebarCollapsed!="boolean"?{version:1}:s.requestTab!==void 0&&(typeof s.requestTab!="string"||!a.has(s.requestTab))?{version:1}:s.scriptTab!==void 0&&(typeof s.scriptTab!="string"||!c.has(s.scriptTab))?{version:1}:s.theme!==void 0&&(typeof s.theme!="string"||!d.has(s.theme))?{version:1}:{version:1,...typeof s.sidebarCollapsed=="boolean"?{sidebarCollapsed:s.sidebarCollapsed}:{},...typeof s.requestTab=="string"?{requestTab:s.requestTab}:{},...typeof s.scriptTab=="string"?{scriptTab:s.scriptTab}:{},...typeof s.theme=="string"?{theme:s.theme}:{}}}catch{return{version:1}}}function za(t,e,n){const r=typeof window<"u"?window.localStorage:void 0;if(r)try{const s=Hv(t,r);r.setItem(zv(t),JSON.stringify({...s,...e,version:1}))}catch{}}function p3(t){return{method:t?.method||"GET",url:t?.url||"",query:t?.query?.map(e=>({...e}))||[],headers:t?.headers?.map(e=>({...e}))||[],body:t?.body||"",contentType:t?.contentType||"application/json",bodyMode:t?.bodyMode,urlencoded:t?.urlencoded?.map(e=>({...e})),formData:t?.formData?.map(e=>({...e})),binary:t?.binary?{...t.binary}:void 0,graphql:t?.graphql?{...t.graphql}:void 0,hostExecution:t?.hostExecution?{...t.hostExecution}:void 0,auth:t?.auth?t.auth.type==="oauth2"?{...t.auth,scopes:t.auth.scopes?[...t.auth.scopes]:void 0}:{...t.auth}:{type:"inherit"}}}function Iv(t,e){return ca(t)!=="none"?"body":e.preRequest.trim()||e.tests.trim()?"scripts":t.auth&&t.auth.type!=="none"&&t.auth.type!=="inherit"?"authorization":(t.headers||[]).some(n=>n.enabled!==!1&&n.key.trim())?"headers":"params"}function qh(t){return t.tests.trim()&&!t.preRequest.trim()?"tests":"pre-request"}function Uv(t,e){return JSON.stringify({request:t,scripts:cn(e)},(n,r)=>typeof File<"u"&&r instanceof File?{name:r.name,size:r.size,type:r.type,lastModified:r.lastModified}:r)}function m3(t,e){return!!t.url.trim()||!!t.body?.trim()||!!t.query?.some(n=>n.key.trim()||n.value.trim())||!!t.headers?.some(n=>n.key.trim()||n.value.trim())||!!e.preRequest.trim()||!!e.tests.trim()}const Fv=({initialRequest:t,initialScripts:e,initialRequestTab:n,initialScriptTab:r,theme:s="light",persistenceKey:a="default",pageMode:c=!1,manageTheme:d=!0,handoff:f,activeEnvironmentId:h,onActiveEnvironmentIdChange:g,onChromeStateChange:b,onRequestChange:v,onDraftChange:S,onScriptsChange:A,onRequestTabChange:C,onScriptTabChange:T,onExecutionStart:D,onExecutionComplete:j,variables:E={},environmentVariables:O={},onCollectionChanges:R,onEnvironmentChanges:B,...M})=>{const z=p3(t),F=cn(e),X=nl(),W=a===!1?{}:Hv(a),[G,we]=I.useState(z),[ye,xe]=I.useState(z),[_,ee]=I.useState(F),[he,$]=I.useState(F),[te,L]=I.useState(M.initialServerUrl),[P,ue]=I.useState(0),[Se,Ne]=I.useState(n||W.requestTab||"params"),[Re,Be]=I.useState(r||W.scriptTab||qh(F)),[Ze,_e]=I.useState("request"),[Ke,gt]=I.useState({}),[se,de]=I.useState(),[ge,Te]=I.useState(X),[Ie,Xe]=I.useState(X.collections[0]?.id),[ht,Pt]=I.useState(""),rn=I.useRef(X.collections[0]?.id),sn=I.useRef(void 0),[qn,Cn]=I.useState(a===!1),[lt,pi]=I.useState(W.sidebarCollapsed??!1),[Mn,Jn]=I.useState(W.theme||s),Tt=d?Mn:s;I.useEffect(()=>{if(a===!1)return;let Me=!1;return H0(a).then(Qe=>{Me||(Te(Qe),Xe(Qe.collections[0]?.id),Pt(""),Cn(!0))}).catch(()=>{Me||Cn(!0)}),()=>{Me=!0}},[a]),I.useEffect(()=>{!qn||a===!1||I0(a,ge).catch(()=>{})},[qn,a,ge]);const x=I.useMemo(()=>$0(ge,Ie),[Ie,ge]),V=I.useMemo(()=>Xd(ge),[ge]),pe=I.useMemo(()=>({...O,...V}),[O,V]),le=I.useMemo(()=>({...x,...E,...pe}),[x,pe,E]);I.useEffect(()=>{if(h===void 0)return;const Me=h||void 0;let Qe=!1;return queueMicrotask(()=>{Qe||Te(Yt=>Yt.activeEnvironmentId===Me?Yt:{...Yt,activeEnvironmentId:Me})}),()=>{Qe=!0}},[h]);const oe=I.useMemo(()=>Uv(ye,he),[ye,he]),k=I.useMemo(()=>m3(ye,he)&&!ge.requests.some(Me=>Uv(Me.request,Me.scripts)===oe),[oe,ye,he,ge.requests]);I.useEffect(()=>{b?.({environments:ge.environments.map(({id:Me,name:Qe})=>({id:Me,name:Qe})),activeEnvironmentId:ge.activeEnvironmentId,hasUnsavedRequest:k})},[k,b,ge.activeEnvironmentId,ge.environments]);const J=I.useCallback(Me=>B0(ge,Ie,ht||void 0,Me||{type:"none"}),[Ie,ht,ge]),Z=I.useCallback(Me=>{Xe(Me),Pt("")},[]),K=Me=>{v?.(Me)},Q=Me=>{xe(ai(Me)),S?.(ai(Me))},Ae=Me=>{const Qe=cn(Me);$(Qe),A?.(Qe)},fe=Me=>{Ne(Me),a!==!1&&za(a,{requestTab:Me}),C?.(Me)},ke=Me=>{Be(Me),a!==!1&&za(a,{scriptTab:Me}),T?.(Me)},je=Me=>{const Qe=rn.current||Ie;Te(Yt=>q0(Yt,Qe,Me)),R?.(Me)},De=Me=>{Te(Qe=>Jd(Qe,Me)),B?.(Me)},$e=()=>{rn.current=Ie,sn.current=ht||void 0,D?.()},ze=Me=>{Te(Qe=>L0(Qe,{...Me,collectionId:rn.current,folderId:sn.current})),j?.(Me)},Je=(Me,Qe,Yt,mi)=>{_e("request");const Li=Yt&&ge.collections.some(yi=>yi.id===Yt)?Yt:void 0;Li&&Xe(Li);const Wr=Li||Ie,Qn=mi&&ge.folders.some(yi=>yi.id===mi&&yi.collectionId===Wr)?mi:"";Pt(Qn);const _t=ai(Me),It=cn(Qe),gi=Iv(_t,It),cr=qh(It);Ne(gi),Be(cr),a!==!1&&za(a,{requestTab:gi,scriptTab:cr}),we(_t),xe(_t),ee(It),$(It),L(void 0),ue(yi=>yi+1)};I.useEffect(()=>{if(!f)return;const Me=ai(f.request),Qe=cn(f.scripts),Yt=f.requestTab||Iv(Me,Qe),mi=f.scriptTab||qh(Qe);let Li=!1;return queueMicrotask(()=>{Li||(_e("request"),we(Me),xe(Me),ee(Qe),$(Qe),L(f.serverUrl),Ne(Yt),Be(mi),ue(Wr=>Wr+1))}),()=>{Li=!0}},[f]);const Rn=(Me,Qe)=>{Xe(Me),Pt(Qe||""),de({collectionId:Me,folderId:Qe}),_e("runner")},Dn=(Me,Qe)=>{gt({entryId:Me,runId:Qe}),_e("history")},Kt=()=>pi(Me=>{const Qe=!Me;return a!==!1&&za(a,{sidebarCollapsed:Qe}),Qe}),_i=Tt==="dark"?"border-gray-700 bg-gray-900/40 text-gray-100":"border-gray-200 bg-white text-gray-900",or=Tt==="dark"?"border-gray-700 bg-gray-900 text-gray-100":"border-gray-300 bg-white text-gray-900";return p.jsxs("div",{className:`grid h-full min-h-0 min-w-0 ${c?"gap-0":"gap-4"} ${lt?"lg:grid-cols-[3.5rem_minmax(0,1fr)]":"lg:grid-cols-[19rem_minmax(0,1fr)]"}`,"data-api-client-workspace":!0,children:[p.jsxs("aside",{className:`min-h-0 min-w-0 overflow-y-auto border p-3 ${c?"rounded-none border-b-0 border-l-0 border-t-0":"rounded-xl"} ${_i}`,"data-api-client-workspace-sidebar":!0,"data-collapsed":lt?"true":"false",children:[p.jsx("div",{className:`mb-3 flex ${lt?"justify-center":"justify-end"}`,children:p.jsx("button",{type:"button",className:"inline-flex h-10 w-10 items-center justify-center rounded-md border","aria-label":lt?"Expand API Client sidebar":"Collapse API Client sidebar","aria-expanded":!lt,onClick:Kt,children:lt?p.jsx(pd,{className:"h-4 w-4"}):p.jsx(hd,{className:"h-4 w-4"})})}),!lt&&p.jsxs("div",{className:"space-y-5",children:[p.jsx(u3,{onWorkspaceChange:Te,onSelectedCollectionChange:Z,theme:Tt}),p.jsx("div",{className:"border-t pt-4",children:p.jsx($O,{workspace:ge,onWorkspaceChange:Te,theme:Tt})}),p.jsx("div",{className:"border-t pt-4",children:p.jsx(BO,{request:ye,scripts:he,onLoadRequest:Je,onSelectedCollectionChange:Z,onSelectedFolderChange:Pt,onRunCollection:Me=>Rn(Me),onRunFolder:(Me,Qe)=>Rn(Me,Qe),selectedCollectionId:Ie,selectedFolderId:ht,workspace:ge,onWorkspaceChange:Te,hostExecution:M.hostExecution,theme:Tt})}),p.jsx("div",{className:"border-t pt-4",children:p.jsx(zO,{workspace:ge,onWorkspaceChange:Te,onLoadRequest:Je,onViewAll:()=>Dn(),theme:Tt})})]})]}),p.jsxs("div",{className:"min-h-0 min-w-0 overflow-y-auto overscroll-contain",children:[p.jsxs("div",{className:`mb-3 flex flex-wrap items-center justify-between gap-2 rounded-md border px-3 py-2 text-xs ${_i}`,"data-api-client-toolbar":!0,children:[p.jsxs("label",{className:"flex items-center gap-2",children:[p.jsx("span",{children:M.messages?.environment||"Environment"}),p.jsxs("select",{"aria-label":M.messages?.environment||"API Client environment",className:`rounded-md border px-2 py-1 text-xs ${or}`,value:ge.activeEnvironmentId||"",onChange:Me=>{const Qe=Me.target.value||void 0;Te(Yt=>({...Yt,activeEnvironmentId:Qe})),g?.(Qe)},children:[p.jsx("option",{value:"",children:M.messages?.noEnvironment||"No environment"}),ge.environments.map(Me=>p.jsx("option",{value:Me.id,children:Me.name},Me.id))]})]}),p.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[d&&p.jsxs("button",{type:"button",className:`rounded-md border px-2 py-1 text-xs ${or}`,"aria-label":`${M.messages?.viewerTheme||"Theme"}: ${Tt==="dark"?M.messages?.lightTheme||"Light":M.messages?.darkTheme||"Dark"}`,"aria-pressed":Tt==="dark",onClick:()=>{const Me=Tt==="dark"?"light":"dark";Jn(Me),a!==!1&&za(a,{theme:Me})},children:[M.messages?.viewerTheme||"Theme",": ",Tt==="dark"?M.messages?.darkTheme||"Dark":M.messages?.lightTheme||"Light"]}),Ze==="request"&&k&&p.jsx("span",{"aria-label":"Unsaved request changes",children:M.messages?.unsavedChanges||"Unsaved changes"})]})]}),Ze==="history"?p.jsx(VO,{workspace:ge,onWorkspaceChange:Te,onLoadRequest:Je,onBack:()=>_e("request"),initialEntryId:Ke.entryId,initialRunId:Ke.runId,theme:Tt},`${Ke.runId||""}:${Ke.entryId||""}`):Ze==="runner"&&se?p.jsx(h3,{workspace:ge,onWorkspaceChange:Te,collectionId:se.collectionId,folderId:se.folderId,theme:Tt,credentials:M.credentials,requestInterceptor:M.requestInterceptor,hostExecution:M.hostExecution,externalVariables:E,externalEnvironmentVariables:O,onCollectionChanges:R,onEnvironmentChanges:B,onOpenHistory:Dn,onBack:()=>_e("request")}):p.jsx(kv,{...M,initialRequest:G,initialScripts:_,initialRequestTab:Se,initialScriptTab:Re,initialServerUrl:te,theme:Tt,resolveAuth:J,variables:le,collectionVariables:x,externalVariables:E,environmentVariables:pe,onCollectionChanges:je,onEnvironmentChanges:De,onDraftChange:Q,onScriptsChange:Ae,onRequestTabChange:fe,onScriptTabChange:ke,onExecutionStart:$e,onExecutionComplete:ze,onRequestChange:K},P)]})]})};function Uc(t){if(t!==void 0)return typeof t=="number"?`${t}px`:t}function g3(t,e){if(!e)return{};const n=e.colors||{},r=e.typography||{},s=e.sidebar||{};return{"--flexdoc-primary":n.primary?.main,"--flexdoc-text":n.text?.primary,"--flexdoc-text-muted":n.text?.secondary,"--flexdoc-border":t==="dark"?n.border?.dark:n.border?.light,"--flexdoc-sidebar-bg":t==="dark"?s.backgroundColorDark:s.backgroundColor,"--flexdoc-sidebar-text":t==="dark"?s.textColorDark:s.textColor,"--flexdoc-sidebar-active-text":t==="dark"?s.activeTextColorDark:s.activeTextColor,"--flexdoc-heading-font":r.headings?.fontFamily,"--flexdoc-heading-weight":r.headings?.fontWeight,"--flexdoc-code-font":r.code?.fontFamily,"--flexdoc-code-size":r.code?.fontSize,"--flexdoc-code-line-height":r.code?.lineHeight,"--flexdoc-code-color":r.code?.color,"--flexdoc-code-bg":r.code?.backgroundColor,fontFamily:r.fontFamily,fontSize:r.fontSize,lineHeight:r.lineHeight}}function Vv(t,e){const n=e.replace(/^#/,"");if(!n)return null;const r=[];for(const[s,a]of Object.entries(t.paths))for(const c of Ln.getHttpMethods(a)){if(Rh(s,c)===n)return{path:s,method:c};oO(s,c)===n&&r.push({path:s,method:c})}return r.length===1?r[0]:null}function Pv(){return typeof window>"u"?"docs":new URLSearchParams(window.location.search).get("view")==="api-client"?"api-client":"docs"}function zh(t){if(typeof window>"u")return;const e=new URL(window.location.href);t==="api-client"?e.searchParams.set("view","api-client"):e.searchParams.delete("view"),window.history.replaceState(null,"",`${e.pathname}${e.search}${e.hash}`)}function Kv(t,e){if(typeof document>"u"||typeof URL>"u")return"Downloads are unavailable in this environment.";try{const n=e==="yaml"?kA(t,{lineWidth:120,noRefs:!1}):JSON.stringify(t,null,2),r=new Blob([n],{type:e==="yaml"?"application/yaml;charset=utf-8":"application/json;charset=utf-8"}),s=URL.createObjectURL(r),a=document.createElement("a");a.href=s,a.download=`openapi.${e==="yaml"?"yaml":"json"}`,document.body.appendChild(a),a.click(),a.remove(),URL.revokeObjectURL(s);return}catch(n){const r=n instanceof Error?n.message:String(n);return`Unable to download ${e.toUpperCase()}: ${r}`}}function y3({logo:t,onHome:e}){const n=typeof t=="string"?{url:t}:t,r=typeof n.padding=="object"?`${Uc(n.padding.vertical)||"0"} ${Uc(n.padding.horizontal)||"0"}`:n.padding,s=p.jsx("img",{src:n.url,alt:n.alt||"API documentation logo",style:{maxHeight:Uc(n.maxHeight)||"32px",maxWidth:Uc(n.maxWidth)||"180px"}});return p.jsx("div",{className:`flex items-center ${n.containerClass||""}`,style:{backgroundColor:n.backgroundColor,padding:r},children:n.clickable===!1?s:p.jsx("button",{type:"button","aria-label":"Documentation home",onClick:e,children:s})})}const b3=({spec:t,theme:e="light",customStyles:n={},options:r={}})=>{const s=MA(t.info.title,typeof window>"u"?void 0:window.location.host),a=Or(s),c=r.tryIt?.apiClientPersistenceKey??_0(t.info.title,typeof window>"u"?void 0:window.location.host),d=Pv(),[f,h]=I.useState(()=>typeof window>"u"?null:Vv(t,window.location.hash)),[g,b]=I.useState(d),[v,S]=I.useState(d==="api-client"),[A,C]=I.useState(),T=I.useRef(0),[D,j]=I.useState({environments:[],hasUnsavedRequest:!1}),[E,O]=I.useState(void 0),[R,B]=I.useState(!1),[M,z]=I.useState(!1),[F,X]=I.useState(!1),[W,G]=I.useState(),[we,ye]=I.useState(),[xe,_]=I.useState(()=>({key:s,preferences:a})),ee=I.useRef(null),he=I.useRef(null),$=I.useRef(null),te=r.runtimeIntelligence?.available===!0,L=r.runtimeIntelligence?.endpoint,P=te&&L&&we?.endpoint===L?we:void 0,ue=P?.snapshot,Se=P?.error,Ne=!!(te&&L&&!P),Re=I.useCallback(()=>X(!1),[]),Be=xe.key===s?xe.preferences:Or(s),Ze=Be.theme||e,_e=Ze==="high-contrast"?"dark":Ze,Ke=Be.expand,gt=Be.expandedTags??["default"],se=Be.sidebarCollapsed??!1,de=typeof r.theme=="object"?r.theme:void 0,ge=I.useMemo(()=>({...g3(_e,de),...n}),[_e,de,n]);I.useEffect(()=>{if(!te||!L)return;const K=new AbortController;return fetch(L,{credentials:"same-origin",signal:K.signal}).then(async Q=>{if(!Q.ok)throw new Error(`Runtime intelligence unavailable: HTTP ${Q.status}`);return wO(await Q.json())}).then(Q=>ye({endpoint:L,snapshot:Q})).catch(Q=>{K.signal.aborted||ye({endpoint:L,error:Q instanceof Error?Q.message:String(Q)})}),()=>K.abort()},[te,L]),I.useEffect(()=>{if(!r.customCss)return;const K=document.createElement("style");return K.dataset.flexdocCustomCss="true",K.textContent=r.customCss,document.head.appendChild(K),()=>K.remove()},[r.customCss]),I.useEffect(()=>{if(typeof window>"u")return;const K=()=>h(Vv(t,window.location.hash)),Q=()=>{const Ae=Pv();b(Ae),Ae==="api-client"&&S(!0)};return K(),Q(),window.addEventListener("hashchange",K),window.addEventListener("popstate",Q),()=>{window.removeEventListener("hashchange",K),window.removeEventListener("popstate",Q)}},[t]),I.useEffect(()=>{if(!R||typeof document>"u")return;const K=document.body.style.overflow,Q=he.current;document.body.style.overflow="hidden";const Ae=ee.current,fe=()=>Array.from(Ae?.querySelectorAll('button:not([data-focus-trap-ignore]):not([disabled]), a[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])')||[]);requestAnimationFrame(()=>fe()[0]?.focus());const ke=je=>{if(je.key==="Escape"){je.preventDefault(),B(!1);return}if(je.key!=="Tab")return;const De=fe();if(!De.length)return;const $e=De[0],ze=De[De.length-1];je.shiftKey&&document.activeElement===$e?(je.preventDefault(),ze.focus()):!je.shiftKey&&document.activeElement===ze&&(je.preventDefault(),$e.focus())};return document.addEventListener("keydown",ke),()=>{document.body.style.overflow=K,document.removeEventListener("keydown",ke),Q?.focus()}},[R]);const Te=()=>{_({key:s,preferences:Or(s)})},Ie=K=>{_(Q=>{const Ae=Q.key===s?Q.preferences:Or(s);return{key:s,preferences:{...Ae,...K,version:1}}})},Xe=()=>requestAnimationFrame(()=>$.current?.scrollTo({top:0,behavior:"auto"})),ht=(K,Q)=>{h({path:K,method:Q}),b("docs"),B(!1),zh("docs"),typeof window<"u"&&(window.location.hash=Rh(K,Q)),Xe()},Pt=()=>{if(h(null),b("docs"),B(!1),typeof window<"u"){const K=new URL(window.location.href);K.searchParams.delete("view"),K.hash="",window.history.replaceState(null,"",`${K.pathname}${K.search}`)}Xe()},rn=K=>{K&&(T.current+=1,C({id:T.current,request:K.request,scripts:K.scripts,requestTab:K.requestTab,scriptTab:K.scriptTab,serverUrl:K.serverUrl})),S(!0),b("api-client"),zh("api-client")},sn=()=>{b("docs"),zh("docs"),Xe()},qn=()=>{const K=!se;DA(s,K),Ie({sidebarCollapsed:K})},Cn=Id(r.expand,r.expand===void 0?r.expandResponses:void 0),lt=Ke===void 0?Cn:Id(Ke),pi=K=>{RA(s,K),Te()},Mn=K=>{_A(s,K),Te()},Jn=K=>{LA(s,K),Ie({expandedTags:K})},Tt=I.useCallback(()=>{if(typeof document>"u")return;(g==="api-client"?document.querySelector('[data-api-client-page="api-client"]:not(.hidden)'):document.querySelector('[data-flexdoc-docs-view="docs"]:not(.hidden)'))?.querySelector('[data-api-client-send="true"]:not([disabled])')?.click()},[g]),x=bO(_e,"border-gray-200 bg-white text-gray-600","border-gray-700 bg-gray-800 text-gray-300"),V=_e==="dark"?"bg-gray-900 text-gray-100":"bg-gray-50 text-gray-900",pe=_e==="dark"?"border-gray-700 bg-gray-900 text-gray-100":"border-gray-200 bg-white text-gray-900",le=r.messages,oe=(K=!1)=>p.jsx("button",{type:"button","data-flexdoc-floating-control":K?"settings":void 0,className:K?`fixed bottom-4 right-4 z-40 inline-flex h-11 w-11 items-center justify-center rounded-full border shadow-lg ${pe}`:"inline-flex h-11 w-11 items-center justify-center rounded-md border","aria-label":le?.openSettings||"Open settings","aria-expanded":M,onClick:()=>z(!0),children:p.jsx(hA,{className:"h-5 w-5"})}),k=(K=!1)=>te?p.jsxs("button",{type:"button","data-flexdoc-floating-control":K?"runtime":void 0,className:K?`fixed bottom-4 right-[4.25rem] z-40 inline-flex h-11 w-11 items-center justify-center rounded-full border shadow-lg ${pe}`:"inline-flex h-11 min-w-11 items-center justify-center gap-2 rounded-md border px-2 text-sm sm:px-3",onClick:()=>X(!0),"aria-label":le?.openRuntime||"Open runtime intelligence","aria-expanded":F,children:[p.jsx(dg,{className:"h-4 w-4"}),!K&&p.jsx("span",{className:"hidden sm:inline",children:ue?`Runtime ${ue.summary.matched}/${ue.summary.documented}`:Ne?"Runtime…":"Runtime"})]}):null,J=(K=!1)=>p.jsx("button",{ref:he,type:"button","data-flexdoc-floating-control":K?"navigation":void 0,"data-flexdoc-mobile-nav-trigger":K?"floating":"topbar",className:K?`fixed left-4 top-4 z-[65] pointer-events-auto inline-flex h-11 w-11 items-center justify-center rounded-full border shadow-lg lg:hidden ${pe}`:"inline-flex h-11 w-11 items-center justify-center rounded-md lg:hidden","aria-label":le?.apiNavigation||"Open API navigation","aria-expanded":R,onClick:()=>B(!0),children:p.jsx(uA,{className:"h-5 w-5"})}),Z=p.jsx(CA,{spec:t,onEndpointSelect:ht,theme:_e,selectedEndpoint:f||void 0,expandedTags:gt,onExpandedTagsChange:Jn,messages:le});return p.jsxs("div",{lang:r.locale,className:`flexdoc-root flex h-full min-h-0 flex-col ${V}`,style:ge,"data-theme":Ze,"data-flexdoc-view":g,children:[!r.hideTopbar&&p.jsx("header",{className:`z-30 flex flex-wrap min-h-14 shrink-0 items-center gap-3 border-b px-3 sm:px-5 ${_e==="dark"?"border-gray-700 bg-gray-900":"border-gray-200 bg-white"}`,children:g==="api-client"?p.jsxs(p.Fragment,{children:[p.jsxs("button",{type:"button",className:"inline-flex min-h-11 items-center gap-2 rounded-md border px-3 text-sm",onClick:sn,children:[p.jsx(Eo,{className:"h-4 w-4"}),le?.backToOperation||"Back to operation"]}),p.jsx("div",{className:"min-w-0 flex-1 truncate font-semibold",children:le?.apiClient||"API Client"}),p.jsxs("label",{className:"flex shrink-0 items-center gap-1 text-xs sm:gap-2",children:[p.jsx("span",{className:"sr-only",children:le?.environment||"Environment"}),p.jsxs("select",{"aria-label":le?.environment||"API Client environment",style:{maxWidth:"10rem"},className:`rounded-md border px-2 py-1.5 text-xs ${_e==="dark"?"border-gray-700 bg-gray-900":"border-gray-300 bg-white"}`,value:E??D.activeEnvironmentId??"",onChange:K=>O(K.target.value||null),children:[p.jsx("option",{value:"",children:le?.noEnvironment||"No environment"}),D.environments.map(K=>p.jsx("option",{value:K.id,children:K.name},K.id))]})]}),D.hasUnsavedRequest&&p.jsx("span",{className:"shrink-0 text-xs font-medium","aria-label":le?.unsavedChanges||"Unsaved request changes",children:le?.unsavedChanges||"Unsaved changes"}),oe()]}):p.jsxs(p.Fragment,{children:[J(),p.jsx("button",{type:"button",className:"hidden h-11 w-11 items-center justify-center rounded-md border lg:inline-flex","aria-label":se?"Expand API navigation sidebar":"Collapse API navigation sidebar","aria-expanded":!se,onClick:qn,children:se?p.jsx(pd,{className:"h-5 w-5"}):p.jsx(hd,{className:"h-5 w-5"})}),r.logo&&p.jsx(y3,{logo:r.logo,onHome:Pt}),p.jsxs("div",{className:"min-w-0 flex-1",children:[p.jsx("div",{className:"truncate font-semibold",children:t.info.title}),!r.hideHostname&&t.servers?.[0]?.url&&p.jsx("div",{className:"truncate text-xs opacity-60",children:t.servers[0].url})]}),k(),f&&p.jsx("button",{type:"button",className:"hidden shrink-0 rounded-md border px-3 py-2 text-sm md:inline-flex","aria-label":le?.printOperation||"Print operation",onClick:()=>{typeof window<"u"&&window.print()},children:le?.printOperation||"Print operation"}),!r.hideDownloadButton&&p.jsxs("div",{className:"flex shrink-0 items-center gap-1","aria-label":"Download OpenAPI specification",children:[p.jsx("button",{type:"button",className:"rounded-md border px-2 py-2 text-xs sm:px-3 sm:text-sm",onClick:()=>G(Kv(t,"json")),children:"JSON"}),p.jsx("button",{type:"button",className:"rounded-md border px-2 py-2 text-xs sm:px-3 sm:text-sm",onClick:()=>G(Kv(t,"yaml")),children:"YAML"})]}),oe()]})}),r.hideTopbar&&g==="docs"&&J(!0),r.hideTopbar&&g==="docs"&&k(!0),r.hideTopbar&&oe(!0),r.hideTopbar&&g==="docs"&&p.jsx("button",{type:"button","data-flexdoc-floating-control":"desktop-navigation",className:`fixed left-4 top-4 z-40 hidden h-11 w-11 items-center justify-center rounded-full border shadow-lg lg:inline-flex ${pe}`,"aria-label":se?"Expand API navigation sidebar":"Collapse API navigation sidebar","aria-expanded":!se,onClick:qn,children:se?p.jsx(pd,{className:"h-5 w-5"}):p.jsx(hd,{className:"h-5 w-5"})}),r.hideTopbar&&g==="api-client"&&p.jsxs(p.Fragment,{children:[p.jsxs("button",{type:"button","data-flexdoc-floating-control":"api-client-back",className:`fixed left-4 top-4 z-[65] inline-flex min-h-11 items-center gap-2 rounded-full border px-3 shadow-lg ${pe}`,onClick:sn,children:[p.jsx(Eo,{className:"h-4 w-4"}),le?.backToOperation||"Back"]}),p.jsxs("div",{"data-flexdoc-floating-control":"api-client-status",className:`fixed right-4 top-4 z-[65] flex items-center gap-2 rounded-full border px-2 py-1.5 shadow-lg ${pe}`,style:{maxWidth:"calc(100vw - 8rem)"},children:[p.jsxs("label",{className:"flex min-w-0 items-center gap-1 text-xs",children:[p.jsx("span",{className:"sr-only",children:le?.environment||"Environment"}),p.jsxs("select",{"aria-label":le?.environment||"API Client environment",style:{maxWidth:"8rem"},className:`rounded-md border px-2 py-1 text-xs ${_e==="dark"?"border-gray-700 bg-gray-900":"border-gray-300 bg-white"}`,value:E??D.activeEnvironmentId??"",onChange:K=>O(K.target.value||null),children:[p.jsx("option",{value:"",children:le?.noEnvironment||"No environment"}),D.environments.map(K=>p.jsx("option",{value:K.id,children:K.name},K.id))]})]}),D.hasUnsavedRequest&&p.jsx("span",{className:"truncate text-xs font-medium","aria-label":le?.unsavedChanges||"Unsaved request changes",children:le?.unsavedChanges||"Unsaved changes"})]})]}),p.jsxs("div",{className:"relative flex min-h-0 flex-1 overflow-hidden",children:[p.jsxs("div",{"data-flexdoc-docs-view":"docs",className:`${g==="docs"?"flex":"hidden"} min-h-0 min-w-0 flex-1`,children:[p.jsx("aside",{className:`hidden min-h-0 shrink-0 overflow-hidden transition-[width] duration-200 motion-reduce:transition-none lg:block ${se?"w-14":"w-80"}`,"data-docs-sidebar":!0,"data-collapsed":se?"true":"false",style:{background:"var(--flexdoc-sidebar-bg)",color:"var(--flexdoc-sidebar-text)"},children:!se&&Z}),p.jsxs("main",{ref:$,"data-flexdoc-main-scroll":!0,className:"min-h-0 min-w-0 flex-1 overflow-y-auto overscroll-contain",children:[f?p.jsx(fO,{spec:t,path:f.path,method:f.method,theme:_e,options:r,defaultExpandedSections:lt,runtimeSnapshot:ue,onOpenInApiClient:rn}):p.jsx(gO,{spec:t,onEndpointSelect:ht,theme:_e}),p.jsx(yO,{footerClasses:x,footer:r.footer})]})]}),v&&p.jsx("div",{"data-api-client-page":"api-client",className:`${g==="api-client"?"block":"hidden"} min-h-0 min-w-0 flex-1 overflow-hidden`,children:p.jsx(Fv,{pageMode:!0,manageTheme:!1,theme:_e,messages:le,persistenceKey:c,handoff:A,activeEnvironmentId:E,onActiveEnvironmentIdChange:K=>O(K??null),onChromeStateChange:K=>{j(K),O(Q=>Q===void 0?K.activeEnvironmentId??null:Q)},credentials:r.tryIt?.credentials||"same-origin",requestInterceptor:r.tryIt?.requestInterceptor,hostExecution:r.tryIt?.hostExecution,serverOptions:t.servers||[]})})]}),R&&p.jsxs("div",{ref:ee,className:"fixed inset-0 z-[70] lg:hidden",role:"dialog","aria-modal":"true","aria-label":le?.apiNavigation||"API navigation",children:[p.jsx("button",{type:"button",tabIndex:-1,"data-focus-trap-ignore":!0,"aria-label":"Close navigation backdrop",className:"absolute inset-0 bg-black/40",onClick:()=>B(!1)}),p.jsxs("aside",{className:`absolute inset-y-0 left-0 flex w-[min(88vw,22rem)] flex-col shadow-2xl ${_e==="dark"?"bg-gray-900":"bg-white"}`,children:[p.jsxs("div",{className:"flex h-14 items-center justify-between border-b px-4",children:[p.jsx("span",{className:"font-semibold",children:le?.apiNavigation||"API navigation"}),p.jsx("button",{type:"button",className:"inline-flex h-11 w-11 items-center justify-center rounded-md","aria-label":le?.closeApiNavigation||"Close API navigation",onClick:()=>B(!1),children:p.jsx(gd,{className:"h-5 w-5"})})]}),p.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:Z})]})]}),W&&p.jsx("div",{role:"alert",className:`fixed bottom-4 left-1/2 z-[90] max-w-[min(92vw,40rem)] -translate-x-1/2 rounded-lg border px-4 py-3 text-sm shadow-xl ${_e==="dark"?"border-red-800 bg-red-950 text-red-100":"border-red-300 bg-white text-red-700"}`,onClick:()=>G(void 0),children:le?.downloadFailed||W}),p.jsx(MO,{open:F&&te,theme:_e,loading:Ne,error:Se,snapshot:ue,onClose:Re,onEndpointSelect:ht,messages:le}),p.jsx(CO,{spec:t,theme:_e,messages:le,onEndpointSelect:ht,onHome:Pt,onOpenSettings:()=>z(!0),onOpenApiClient:()=>rn(),onOpenRuntime:te?()=>X(!0):void 0,onSendCurrent:Tt}),p.jsx(EO,{open:M,theme:_e,hostTheme:e,viewerTheme:Be.theme,viewerExpand:Ke,effectiveExpandedSections:lt,messages:le,onThemeChange:Mn,onExpandChange:pi,onClose:()=>z(!1)})]})},Hh="x-flexdoc-external-documents";function x3(t){if(typeof fetch!="function")throw new Error("No document loader is available in this environment");return fetch(t).then(async e=>{if(!e.ok)throw new Error(`Failed to load OpenAPI reference ${t}: ${e.status}`);const n=await e.text();return zi.parseSpec(n).catch(()=>{try{return JSON.parse(n)}catch{throw new Error(`Reference document is not valid JSON/YAML: ${t}`)}})})}function v3(t,e){if(t.startsWith("#"))return{documentUri:e,pointer:t};const n=new URL(t,e),r=n.hash||"#";return n.hash="",{documentUri:n.toString(),pointer:r}}function Yv(t,e){const n=zi.encodePointerToken(t);if(e==="#"||e==="")return`#/${Hh}/${n}`;if(!e.startsWith("#/"))throw new Error(`Unsupported JSON Pointer reference: ${e}`);return`#/${Hh}/${n}/${e.slice(2)}`}function Gv(t){return JSON.parse(JSON.stringify(t))}async function w3(t,e){const n=e.load||x3,r=new URL(e.baseUri).toString().replace(/#.*$/,""),s=Gv(t),a={},c=new Map;async function d(g){if(g===r)return s;if(a[g])return a[g];if(c.has(g))return c.get(g);const b=Promise.resolve(n(g)).then(S=>Gv(S));c.set(g,b);const v=await b;return a[g]=v,v}const f=new Set;async function h(g,b){if(f.has(b))return;f.add(b);async function v(S){if(!(!S||typeof S!="object")){if(Array.isArray(S)){for(const A of S)await v(A);return}if(typeof S.$ref=="string"){const A=v3(S.$ref,b);if(A.documentUri!==b){const C=await d(A.documentUri);S.$ref=A.documentUri===r?A.pointer:Yv(A.documentUri,A.pointer),await h(C,A.documentUri)}else b!==r&&(S.$ref=Yv(b,A.pointer))}for(const[A,C]of Object.entries(S))A!=="$ref"&&await v(C)}}await v(g)}return await h(s,r),Object.keys(a).length&&(s[Hh]=a),s}async function S3(t,e){return w3(t,e)}const Fc="1",Qr=new WeakMap;function A3(t){return JSON.parse(JSON.stringify(t))}function Ih(t,e={}){const n=A3(t);if(e.title&&(n.info.title=e.title),e.description&&(n.info.description=e.description),e.altDescription&&!n.info.description&&(n.info.description=e.altDescription),e.version&&(n.info.version=e.version),!e.tagGroups?.length)return n;const r=new Map;for(const c of e.tagGroups)for(const d of c.tags)r.set(d,c.name);const s={},a=new Set(["get","post","put","delete","patch","options","head","trace"]);for(const[c,d]of Object.entries(n.paths)){const f={};let h=!1;for(const[g,b]of Object.entries(d)){if(!a.has(g)){f[g]=b;continue}const v=b,S=(v?.tags||[]).filter(A=>r.has(A)).map(A=>r.get(A));!S.length||!v||(f[g]={...v,tags:Array.from(new Set(S))},h=!0)}h&&(s[c]=f)}return n.paths=s,n.tags=e.tagGroups.map(c=>({name:c.name})),n}function k3(t){return typeof t.theme=="string"?t.theme:typeof document<"u"&&document.documentElement.classList.contains("dark")?"dark":"light"}function Xv(t,e,n){const r=Ih(e,n),s=Qr.get(t);s&&s.unmount();const a=ag.createRoot(t);return Qr.set(t,a),a.render(p.jsx(b3,{spec:r,theme:k3(n),options:n})),()=>{Qr.get(t)===a&&Qr.delete(t),a.unmount()}}function Jv(t,e){const n={contractVersion:Fc,...e.options||{}};return Xv(t,e.spec,n)}function Qv(t,e={}){const n=Qr.get(t);n&&n.unmount();const r=ag.createRoot(t);return Qr.set(t,r),r.render(p.jsx(Fv,{...e})),()=>{Qr.get(t)===r&&Qr.delete(t),r.unmount()}}async function Wv(t,e){const n={contractVersion:Fc,...e.options||{}},r=e.baseUri?await S3(e.spec,{baseUri:e.baseUri,load:e.documentLoader}):e.spec;return Xv(t,r,n)}return typeof window<"u"&&(window.FlexDocStandalone={mount:Jv,mountAsync:Wv,mountApiClient:Qv,prepareSpec:Ih,contractVersion:Fc}),As.FLEXDOC_CONTRACT_VERSION=Fc,As.mountApiClient=Qv,As.mountFlexDoc=Jv,As.mountFlexDocAsync=Wv,As.prepareSpec=Ih,Object.defineProperty(As,Symbol.toStringTag,{value:"Module"}),As})({});
|
|
60
85
|
//# sourceMappingURL=flexdoc.standalone.js.map
|