momentic 0.0.21 → 0.0.23

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.
@@ -0,0 +1,245 @@
1
+ function E$(t,e){for(var n=0;n<e.length;n++){const r=e[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in t)){const o=Object.getOwnPropertyDescriptor(r,i);o&&Object.defineProperty(t,i,o.get?o:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const s of o.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();var fn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Su(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var _$={exports:{}},mb={},T$={exports:{}},zt={};/**
2
+ * @license React
3
+ * react.production.min.js
4
+ *
5
+ * Copyright (c) Facebook, Inc. and its affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var km=Symbol.for("react.element"),gG=Symbol.for("react.portal"),vG=Symbol.for("react.fragment"),yG=Symbol.for("react.strict_mode"),bG=Symbol.for("react.profiler"),wG=Symbol.for("react.provider"),xG=Symbol.for("react.context"),SG=Symbol.for("react.forward_ref"),CG=Symbol.for("react.suspense"),kG=Symbol.for("react.memo"),EG=Symbol.for("react.lazy"),fR=Symbol.iterator;function _G(t){return t===null||typeof t!="object"?null:(t=fR&&t[fR]||t["@@iterator"],typeof t=="function"?t:null)}var A$={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},O$=Object.assign,R$={};function xd(t,e,n){this.props=t,this.context=e,this.refs=R$,this.updater=n||A$}xd.prototype.isReactComponent={};xd.prototype.setState=function(t,e){if(typeof t!="object"&&typeof t!="function"&&t!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,t,e,"setState")};xd.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function P$(){}P$.prototype=xd.prototype;function DE(t,e,n){this.props=t,this.context=e,this.refs=R$,this.updater=n||A$}var LE=DE.prototype=new P$;LE.constructor=DE;O$(LE,xd.prototype);LE.isPureReactComponent=!0;var dR=Array.isArray,N$=Object.prototype.hasOwnProperty,$E={current:null},M$={key:!0,ref:!0,__self:!0,__source:!0};function D$(t,e,n){var r,i={},o=null,s=null;if(e!=null)for(r in e.ref!==void 0&&(s=e.ref),e.key!==void 0&&(o=""+e.key),e)N$.call(e,r)&&!M$.hasOwnProperty(r)&&(i[r]=e[r]);var a=arguments.length-2;if(a===1)i.children=n;else if(1<a){for(var l=Array(a),c=0;c<a;c++)l[c]=arguments[c+2];i.children=l}if(t&&t.defaultProps)for(r in a=t.defaultProps,a)i[r]===void 0&&(i[r]=a[r]);return{$$typeof:km,type:t,key:o,ref:s,props:i,_owner:$E.current}}function TG(t,e){return{$$typeof:km,type:t.type,key:e,ref:t.ref,props:t.props,_owner:t._owner}}function IE(t){return typeof t=="object"&&t!==null&&t.$$typeof===km}function AG(t){var e={"=":"=0",":":"=2"};return"$"+t.replace(/[=:]/g,function(n){return e[n]})}var hR=/\/+/g;function Yw(t,e){return typeof t=="object"&&t!==null&&t.key!=null?AG(""+t.key):e.toString(36)}function qv(t,e,n,r,i){var o=typeof t;(o==="undefined"||o==="boolean")&&(t=null);var s=!1;if(t===null)s=!0;else switch(o){case"string":case"number":s=!0;break;case"object":switch(t.$$typeof){case km:case gG:s=!0}}if(s)return s=t,i=i(s),t=r===""?"."+Yw(s,0):r,dR(i)?(n="",t!=null&&(n=t.replace(hR,"$&/")+"/"),qv(i,e,n,"",function(c){return c})):i!=null&&(IE(i)&&(i=TG(i,n+(!i.key||s&&s.key===i.key?"":(""+i.key).replace(hR,"$&/")+"/")+t)),e.push(i)),1;if(s=0,r=r===""?".":r+":",dR(t))for(var a=0;a<t.length;a++){o=t[a];var l=r+Yw(o,a);s+=qv(o,e,n,l,i)}else if(l=_G(t),typeof l=="function")for(t=l.call(t),a=0;!(o=t.next()).done;)o=o.value,l=r+Yw(o,a++),s+=qv(o,e,n,l,i);else if(o==="object")throw e=String(t),Error("Objects are not valid as a React child (found: "+(e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)+"). If you meant to render a collection of children, use an array instead.");return s}function jg(t,e,n){if(t==null)return t;var r=[],i=0;return qv(t,r,"","",function(o){return e.call(n,o,i++)}),r}function OG(t){if(t._status===-1){var e=t._result;e=e(),e.then(function(n){(t._status===0||t._status===-1)&&(t._status=1,t._result=n)},function(n){(t._status===0||t._status===-1)&&(t._status=2,t._result=n)}),t._status===-1&&(t._status=0,t._result=e)}if(t._status===1)return t._result.default;throw t._result}var hi={current:null},Kv={transition:null},RG={ReactCurrentDispatcher:hi,ReactCurrentBatchConfig:Kv,ReactCurrentOwner:$E};zt.Children={map:jg,forEach:function(t,e,n){jg(t,function(){e.apply(this,arguments)},n)},count:function(t){var e=0;return jg(t,function(){e++}),e},toArray:function(t){return jg(t,function(e){return e})||[]},only:function(t){if(!IE(t))throw Error("React.Children.only expected to receive a single React element child.");return t}};zt.Component=xd;zt.Fragment=vG;zt.Profiler=bG;zt.PureComponent=DE;zt.StrictMode=yG;zt.Suspense=CG;zt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=RG;zt.cloneElement=function(t,e,n){if(t==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+t+".");var r=O$({},t.props),i=t.key,o=t.ref,s=t._owner;if(e!=null){if(e.ref!==void 0&&(o=e.ref,s=$E.current),e.key!==void 0&&(i=""+e.key),t.type&&t.type.defaultProps)var a=t.type.defaultProps;for(l in e)N$.call(e,l)&&!M$.hasOwnProperty(l)&&(r[l]=e[l]===void 0&&a!==void 0?a[l]:e[l])}var l=arguments.length-2;if(l===1)r.children=n;else if(1<l){a=Array(l);for(var c=0;c<l;c++)a[c]=arguments[c+2];r.children=a}return{$$typeof:km,type:t.type,key:i,ref:o,props:r,_owner:s}};zt.createContext=function(t){return t={$$typeof:xG,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},t.Provider={$$typeof:wG,_context:t},t.Consumer=t};zt.createElement=D$;zt.createFactory=function(t){var e=D$.bind(null,t);return e.type=t,e};zt.createRef=function(){return{current:null}};zt.forwardRef=function(t){return{$$typeof:SG,render:t}};zt.isValidElement=IE;zt.lazy=function(t){return{$$typeof:EG,_payload:{_status:-1,_result:t},_init:OG}};zt.memo=function(t,e){return{$$typeof:kG,type:t,compare:e===void 0?null:e}};zt.startTransition=function(t){var e=Kv.transition;Kv.transition={};try{t()}finally{Kv.transition=e}};zt.unstable_act=function(){throw Error("act(...) is not supported in production builds of React.")};zt.useCallback=function(t,e){return hi.current.useCallback(t,e)};zt.useContext=function(t){return hi.current.useContext(t)};zt.useDebugValue=function(){};zt.useDeferredValue=function(t){return hi.current.useDeferredValue(t)};zt.useEffect=function(t,e){return hi.current.useEffect(t,e)};zt.useId=function(){return hi.current.useId()};zt.useImperativeHandle=function(t,e,n){return hi.current.useImperativeHandle(t,e,n)};zt.useInsertionEffect=function(t,e){return hi.current.useInsertionEffect(t,e)};zt.useLayoutEffect=function(t,e){return hi.current.useLayoutEffect(t,e)};zt.useMemo=function(t,e){return hi.current.useMemo(t,e)};zt.useReducer=function(t,e,n){return hi.current.useReducer(t,e,n)};zt.useRef=function(t){return hi.current.useRef(t)};zt.useState=function(t){return hi.current.useState(t)};zt.useSyncExternalStore=function(t,e,n){return hi.current.useSyncExternalStore(t,e,n)};zt.useTransition=function(){return hi.current.useTransition()};zt.version="18.2.0";T$.exports=zt;var g=T$.exports;const ut=Su(g),jE=E$({__proto__:null,default:ut},[g]);/**
10
+ * @license React
11
+ * react-jsx-runtime.production.min.js
12
+ *
13
+ * Copyright (c) Facebook, Inc. and its affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var PG=g,NG=Symbol.for("react.element"),MG=Symbol.for("react.fragment"),DG=Object.prototype.hasOwnProperty,LG=PG.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,$G={key:!0,ref:!0,__self:!0,__source:!0};function L$(t,e,n){var r,i={},o=null,s=null;n!==void 0&&(o=""+n),e.key!==void 0&&(o=""+e.key),e.ref!==void 0&&(s=e.ref);for(r in e)DG.call(e,r)&&!$G.hasOwnProperty(r)&&(i[r]=e[r]);if(t&&t.defaultProps)for(r in e=t.defaultProps,e)i[r]===void 0&&(i[r]=e[r]);return{$$typeof:NG,type:t,key:o,ref:s,props:i,_owner:LG.current}}mb.Fragment=MG;mb.jsx=L$;mb.jsxs=L$;_$.exports=mb;var k=_$.exports,BS={},$$={exports:{}},ao={},I$={exports:{}},j$={};/**
18
+ * @license React
19
+ * scheduler.production.min.js
20
+ *
21
+ * Copyright (c) Facebook, Inc. and its affiliates.
22
+ *
23
+ * This source code is licensed under the MIT license found in the
24
+ * LICENSE file in the root directory of this source tree.
25
+ */(function(t){function e(re,W){var P=re.length;re.push(W);e:for(;0<P;){var he=P-1>>>1,fe=re[he];if(0<i(fe,W))re[he]=W,re[P]=fe,P=he;else break e}}function n(re){return re.length===0?null:re[0]}function r(re){if(re.length===0)return null;var W=re[0],P=re.pop();if(P!==W){re[0]=P;e:for(var he=0,fe=re.length,$=fe>>>1;he<$;){var Ne=2*(he+1)-1,He=re[Ne],Ye=Ne+1,Ie=re[Ye];if(0>i(He,P))Ye<fe&&0>i(Ie,He)?(re[he]=Ie,re[Ye]=P,he=Ye):(re[he]=He,re[Ne]=P,he=Ne);else if(Ye<fe&&0>i(Ie,P))re[he]=Ie,re[Ye]=P,he=Ye;else break e}}return W}function i(re,W){var P=re.sortIndex-W.sortIndex;return P!==0?P:re.id-W.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;t.unstable_now=function(){return o.now()}}else{var s=Date,a=s.now();t.unstable_now=function(){return s.now()-a}}var l=[],c=[],f=1,d=null,p=3,m=!1,v=!1,b=!1,S=typeof setTimeout=="function"?setTimeout:null,x=typeof clearTimeout=="function"?clearTimeout:null,w=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function C(re){for(var W=n(c);W!==null;){if(W.callback===null)r(c);else if(W.startTime<=re)r(c),W.sortIndex=W.expirationTime,e(l,W);else break;W=n(c)}}function T(re){if(b=!1,C(re),!v)if(n(l)!==null)v=!0,ie(A);else{var W=n(c);W!==null&&ae(T,W.startTime-re)}}function A(re,W){v=!1,b&&(b=!1,x(M),M=-1),m=!0;var P=p;try{for(C(W),d=n(l);d!==null&&(!(d.expirationTime>W)||re&&!U());){var he=d.callback;if(typeof he=="function"){d.callback=null,p=d.priorityLevel;var fe=he(d.expirationTime<=W);W=t.unstable_now(),typeof fe=="function"?d.callback=fe:d===n(l)&&r(l),C(W)}else r(l);d=n(l)}if(d!==null)var $=!0;else{var Ne=n(c);Ne!==null&&ae(T,Ne.startTime-W),$=!1}return $}finally{d=null,p=P,m=!1}}var _=!1,R=null,M=-1,I=5,V=-1;function U(){return!(t.unstable_now()-V<I)}function L(){if(R!==null){var re=t.unstable_now();V=re;var W=!0;try{W=R(!0,re)}finally{W?G():(_=!1,R=null)}}else _=!1}var G;if(typeof w=="function")G=function(){w(L)};else if(typeof MessageChannel<"u"){var K=new MessageChannel,F=K.port2;K.port1.onmessage=L,G=function(){F.postMessage(null)}}else G=function(){S(L,0)};function ie(re){R=re,_||(_=!0,G())}function ae(re,W){M=S(function(){re(t.unstable_now())},W)}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(re){re.callback=null},t.unstable_continueExecution=function(){v||m||(v=!0,ie(A))},t.unstable_forceFrameRate=function(re){0>re||125<re?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):I=0<re?Math.floor(1e3/re):5},t.unstable_getCurrentPriorityLevel=function(){return p},t.unstable_getFirstCallbackNode=function(){return n(l)},t.unstable_next=function(re){switch(p){case 1:case 2:case 3:var W=3;break;default:W=p}var P=p;p=W;try{return re()}finally{p=P}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(re,W){switch(re){case 1:case 2:case 3:case 4:case 5:break;default:re=3}var P=p;p=re;try{return W()}finally{p=P}},t.unstable_scheduleCallback=function(re,W,P){var he=t.unstable_now();switch(typeof P=="object"&&P!==null?(P=P.delay,P=typeof P=="number"&&0<P?he+P:he):P=he,re){case 1:var fe=-1;break;case 2:fe=250;break;case 5:fe=1073741823;break;case 4:fe=1e4;break;default:fe=5e3}return fe=P+fe,re={id:f++,callback:W,priorityLevel:re,startTime:P,expirationTime:fe,sortIndex:-1},P>he?(re.sortIndex=P,e(c,re),n(l)===null&&re===n(c)&&(b?(x(M),M=-1):b=!0,ae(T,P-he))):(re.sortIndex=fe,e(l,re),v||m||(v=!0,ie(A))),re},t.unstable_shouldYield=U,t.unstable_wrapCallback=function(re){var W=p;return function(){var P=p;p=W;try{return re.apply(this,arguments)}finally{p=P}}}})(j$);I$.exports=j$;var IG=I$.exports;/**
26
+ * @license React
27
+ * react-dom.production.min.js
28
+ *
29
+ * Copyright (c) Facebook, Inc. and its affiliates.
30
+ *
31
+ * This source code is licensed under the MIT license found in the
32
+ * LICENSE file in the root directory of this source tree.
33
+ */var B$=g,io=IG;function Re(t){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+t,n=1;n<arguments.length;n++)e+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+t+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var F$=new Set,yp={};function Cu(t,e){Zf(t,e),Zf(t+"Capture",e)}function Zf(t,e){for(yp[t]=e,t=0;t<e.length;t++)F$.add(e[t])}var Na=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),FS=Object.prototype.hasOwnProperty,jG=/^[: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]*$/,pR={},mR={};function BG(t){return FS.call(mR,t)?!0:FS.call(pR,t)?!1:jG.test(t)?mR[t]=!0:(pR[t]=!0,!1)}function FG(t,e,n,r){if(n!==null&&n.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function zG(t,e,n,r){if(e===null||typeof e>"u"||FG(t,e,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function pi(t,e,n,r,i,o,s){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=t,this.type=e,this.sanitizeURL=o,this.removeEmptyString=s}var jr={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){jr[t]=new pi(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];jr[e]=new pi(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){jr[t]=new pi(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){jr[t]=new pi(t,2,!1,t,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(t){jr[t]=new pi(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){jr[t]=new pi(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){jr[t]=new pi(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){jr[t]=new pi(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){jr[t]=new pi(t,5,!1,t.toLowerCase(),null,!1,!1)});var BE=/[\-:]([a-z])/g;function FE(t){return t[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(t){var e=t.replace(BE,FE);jr[e]=new pi(e,1,!1,t,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var e=t.replace(BE,FE);jr[e]=new pi(e,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(t){var e=t.replace(BE,FE);jr[e]=new pi(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){jr[t]=new pi(t,1,!1,t.toLowerCase(),null,!1,!1)});jr.xlinkHref=new pi("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){jr[t]=new pi(t,1,!1,t.toLowerCase(),null,!0,!0)});function zE(t,e,n,r){var i=jr.hasOwnProperty(e)?jr[e]:null;(i!==null?i.type!==0:r||!(2<e.length)||e[0]!=="o"&&e[0]!=="O"||e[1]!=="n"&&e[1]!=="N")&&(zG(e,n,i,r)&&(n=null),r||i===null?BG(e)&&(n===null?t.removeAttribute(e):t.setAttribute(e,""+n)):i.mustUseProperty?t[i.propertyName]=n===null?i.type===3?!1:"":n:(e=i.attributeName,r=i.attributeNamespace,n===null?t.removeAttribute(e):(i=i.type,n=i===3||i===4&&n===!0?"":""+n,r?t.setAttributeNS(r,e,n):t.setAttribute(e,n))))}var Ha=B$.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Bg=Symbol.for("react.element"),df=Symbol.for("react.portal"),hf=Symbol.for("react.fragment"),VE=Symbol.for("react.strict_mode"),zS=Symbol.for("react.profiler"),z$=Symbol.for("react.provider"),V$=Symbol.for("react.context"),UE=Symbol.for("react.forward_ref"),VS=Symbol.for("react.suspense"),US=Symbol.for("react.suspense_list"),WE=Symbol.for("react.memo"),ml=Symbol.for("react.lazy"),U$=Symbol.for("react.offscreen"),gR=Symbol.iterator;function lh(t){return t===null||typeof t!="object"?null:(t=gR&&t[gR]||t["@@iterator"],typeof t=="function"?t:null)}var Fn=Object.assign,Xw;function Ih(t){if(Xw===void 0)try{throw Error()}catch(n){var e=n.stack.trim().match(/\n( *(at )?)/);Xw=e&&e[1]||""}return`
34
+ `+Xw+t}var Zw=!1;function Qw(t,e){if(!t||Zw)return"";Zw=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(e)if(e=function(){throw Error()},Object.defineProperty(e.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(e,[])}catch(c){var r=c}Reflect.construct(t,[],e)}else{try{e.call()}catch(c){r=c}t.call(e.prototype)}else{try{throw Error()}catch(c){r=c}t()}}catch(c){if(c&&r&&typeof c.stack=="string"){for(var i=c.stack.split(`
35
+ `),o=r.stack.split(`
36
+ `),s=i.length-1,a=o.length-1;1<=s&&0<=a&&i[s]!==o[a];)a--;for(;1<=s&&0<=a;s--,a--)if(i[s]!==o[a]){if(s!==1||a!==1)do if(s--,a--,0>a||i[s]!==o[a]){var l=`
37
+ `+i[s].replace(" at new "," at ");return t.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",t.displayName)),l}while(1<=s&&0<=a);break}}}finally{Zw=!1,Error.prepareStackTrace=n}return(t=t?t.displayName||t.name:"")?Ih(t):""}function VG(t){switch(t.tag){case 5:return Ih(t.type);case 16:return Ih("Lazy");case 13:return Ih("Suspense");case 19:return Ih("SuspenseList");case 0:case 2:case 15:return t=Qw(t.type,!1),t;case 11:return t=Qw(t.type.render,!1),t;case 1:return t=Qw(t.type,!0),t;default:return""}}function WS(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case hf:return"Fragment";case df:return"Portal";case zS:return"Profiler";case VE:return"StrictMode";case VS:return"Suspense";case US:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case V$:return(t.displayName||"Context")+".Consumer";case z$:return(t._context.displayName||"Context")+".Provider";case UE:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case WE:return e=t.displayName||null,e!==null?e:WS(t.type)||"Memo";case ml:e=t._payload,t=t._init;try{return WS(t(e))}catch{}}return null}function UG(t){var e=t.type;switch(t.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=e.render,t=t.displayName||t.name||"",e.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return WS(e);case 8:return e===VE?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function Vl(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function W$(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function WG(t){var e=W$(t)?"checked":"value",n=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),r=""+t[e];if(!t.hasOwnProperty(e)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,o=n.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return i.call(this)},set:function(s){r=""+s,o.call(this,s)}}),Object.defineProperty(t,e,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(s){r=""+s},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function Fg(t){t._valueTracker||(t._valueTracker=WG(t))}function H$(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),r="";return t&&(r=W$(t)?t.checked?"true":"false":t.value),t=r,t!==n?(e.setValue(t),!0):!1}function Ny(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function HS(t,e){var n=e.checked;return Fn({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??t._wrapperState.initialChecked})}function vR(t,e){var n=e.defaultValue==null?"":e.defaultValue,r=e.checked!=null?e.checked:e.defaultChecked;n=Vl(e.value!=null?e.value:n),t._wrapperState={initialChecked:r,initialValue:n,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function q$(t,e){e=e.checked,e!=null&&zE(t,"checked",e,!1)}function qS(t,e){q$(t,e);var n=Vl(e.value),r=e.type;if(n!=null)r==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+n):t.value!==""+n&&(t.value=""+n);else if(r==="submit"||r==="reset"){t.removeAttribute("value");return}e.hasOwnProperty("value")?KS(t,e.type,n):e.hasOwnProperty("defaultValue")&&KS(t,e.type,Vl(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function yR(t,e,n){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var r=e.type;if(!(r!=="submit"&&r!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+t._wrapperState.initialValue,n||e===t.value||(t.value=e),t.defaultValue=e}n=t.name,n!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,n!==""&&(t.name=n)}function KS(t,e,n){(e!=="number"||Ny(t.ownerDocument)!==t)&&(n==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+n&&(t.defaultValue=""+n))}var jh=Array.isArray;function Nf(t,e,n,r){if(t=t.options,e){e={};for(var i=0;i<n.length;i++)e["$"+n[i]]=!0;for(n=0;n<t.length;n++)i=e.hasOwnProperty("$"+t[n].value),t[n].selected!==i&&(t[n].selected=i),i&&r&&(t[n].defaultSelected=!0)}else{for(n=""+Vl(n),e=null,i=0;i<t.length;i++){if(t[i].value===n){t[i].selected=!0,r&&(t[i].defaultSelected=!0);return}e!==null||t[i].disabled||(e=t[i])}e!==null&&(e.selected=!0)}}function GS(t,e){if(e.dangerouslySetInnerHTML!=null)throw Error(Re(91));return Fn({},e,{value:void 0,defaultValue:void 0,children:""+t._wrapperState.initialValue})}function bR(t,e){var n=e.value;if(n==null){if(n=e.children,e=e.defaultValue,n!=null){if(e!=null)throw Error(Re(92));if(jh(n)){if(1<n.length)throw Error(Re(93));n=n[0]}e=n}e==null&&(e=""),n=e}t._wrapperState={initialValue:Vl(n)}}function K$(t,e){var n=Vl(e.value),r=Vl(e.defaultValue);n!=null&&(n=""+n,n!==t.value&&(t.value=n),e.defaultValue==null&&t.defaultValue!==n&&(t.defaultValue=n)),r!=null&&(t.defaultValue=""+r)}function wR(t){var e=t.textContent;e===t._wrapperState.initialValue&&e!==""&&e!==null&&(t.value=e)}function G$(t){switch(t){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function YS(t,e){return t==null||t==="http://www.w3.org/1999/xhtml"?G$(e):t==="http://www.w3.org/2000/svg"&&e==="foreignObject"?"http://www.w3.org/1999/xhtml":t}var zg,Y$=function(t){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(e,n,r,i){MSApp.execUnsafeLocalFunction(function(){return t(e,n,r,i)})}:t}(function(t,e){if(t.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in t)t.innerHTML=e;else{for(zg=zg||document.createElement("div"),zg.innerHTML="<svg>"+e.valueOf().toString()+"</svg>",e=zg.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function bp(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=e;return}}t.textContent=e}var Xh={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},HG=["Webkit","ms","Moz","O"];Object.keys(Xh).forEach(function(t){HG.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),Xh[e]=Xh[t]})});function X$(t,e,n){return e==null||typeof e=="boolean"||e===""?"":n||typeof e!="number"||e===0||Xh.hasOwnProperty(t)&&Xh[t]?(""+e).trim():e+"px"}function Z$(t,e){t=t.style;for(var n in e)if(e.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=X$(n,e[n],r);n==="float"&&(n="cssFloat"),r?t.setProperty(n,i):t[n]=i}}var qG=Fn({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function XS(t,e){if(e){if(qG[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(Re(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(Re(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(Re(61))}if(e.style!=null&&typeof e.style!="object")throw Error(Re(62))}}function ZS(t,e){if(t.indexOf("-")===-1)return typeof e.is=="string";switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var QS=null;function HE(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var JS=null,Mf=null,Df=null;function xR(t){if(t=Tm(t)){if(typeof JS!="function")throw Error(Re(280));var e=t.stateNode;e&&(e=wb(e),JS(t.stateNode,t.type,e))}}function Q$(t){Mf?Df?Df.push(t):Df=[t]:Mf=t}function J$(){if(Mf){var t=Mf,e=Df;if(Df=Mf=null,xR(t),e)for(t=0;t<e.length;t++)xR(e[t])}}function eI(t,e){return t(e)}function tI(){}var Jw=!1;function nI(t,e,n){if(Jw)return t(e,n);Jw=!0;try{return eI(t,e,n)}finally{Jw=!1,(Mf!==null||Df!==null)&&(tI(),J$())}}function wp(t,e){var n=t.stateNode;if(n===null)return null;var r=wb(n);if(r===null)return null;n=r[e];e:switch(e){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(t=t.type,r=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!r;break e;default:t=!1}if(t)return null;if(n&&typeof n!="function")throw Error(Re(231,e,typeof n));return n}var eC=!1;if(Na)try{var ch={};Object.defineProperty(ch,"passive",{get:function(){eC=!0}}),window.addEventListener("test",ch,ch),window.removeEventListener("test",ch,ch)}catch{eC=!1}function KG(t,e,n,r,i,o,s,a,l){var c=Array.prototype.slice.call(arguments,3);try{e.apply(n,c)}catch(f){this.onError(f)}}var Zh=!1,My=null,Dy=!1,tC=null,GG={onError:function(t){Zh=!0,My=t}};function YG(t,e,n,r,i,o,s,a,l){Zh=!1,My=null,KG.apply(GG,arguments)}function XG(t,e,n,r,i,o,s,a,l){if(YG.apply(this,arguments),Zh){if(Zh){var c=My;Zh=!1,My=null}else throw Error(Re(198));Dy||(Dy=!0,tC=c)}}function ku(t){var e=t,n=t;if(t.alternate)for(;e.return;)e=e.return;else{t=e;do e=t,e.flags&4098&&(n=e.return),t=e.return;while(t)}return e.tag===3?n:null}function rI(t){if(t.tag===13){var e=t.memoizedState;if(e===null&&(t=t.alternate,t!==null&&(e=t.memoizedState)),e!==null)return e.dehydrated}return null}function SR(t){if(ku(t)!==t)throw Error(Re(188))}function ZG(t){var e=t.alternate;if(!e){if(e=ku(t),e===null)throw Error(Re(188));return e!==t?null:t}for(var n=t,r=e;;){var i=n.return;if(i===null)break;var o=i.alternate;if(o===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===o.child){for(o=i.child;o;){if(o===n)return SR(i),t;if(o===r)return SR(i),e;o=o.sibling}throw Error(Re(188))}if(n.return!==r.return)n=i,r=o;else{for(var s=!1,a=i.child;a;){if(a===n){s=!0,n=i,r=o;break}if(a===r){s=!0,r=i,n=o;break}a=a.sibling}if(!s){for(a=o.child;a;){if(a===n){s=!0,n=o,r=i;break}if(a===r){s=!0,r=o,n=i;break}a=a.sibling}if(!s)throw Error(Re(189))}}if(n.alternate!==r)throw Error(Re(190))}if(n.tag!==3)throw Error(Re(188));return n.stateNode.current===n?t:e}function iI(t){return t=ZG(t),t!==null?oI(t):null}function oI(t){if(t.tag===5||t.tag===6)return t;for(t=t.child;t!==null;){var e=oI(t);if(e!==null)return e;t=t.sibling}return null}var sI=io.unstable_scheduleCallback,CR=io.unstable_cancelCallback,QG=io.unstable_shouldYield,JG=io.unstable_requestPaint,er=io.unstable_now,eY=io.unstable_getCurrentPriorityLevel,qE=io.unstable_ImmediatePriority,aI=io.unstable_UserBlockingPriority,Ly=io.unstable_NormalPriority,tY=io.unstable_LowPriority,lI=io.unstable_IdlePriority,gb=null,qs=null;function nY(t){if(qs&&typeof qs.onCommitFiberRoot=="function")try{qs.onCommitFiberRoot(gb,t,void 0,(t.current.flags&128)===128)}catch{}}var fs=Math.clz32?Math.clz32:oY,rY=Math.log,iY=Math.LN2;function oY(t){return t>>>=0,t===0?32:31-(rY(t)/iY|0)|0}var Vg=64,Ug=4194304;function Bh(t){switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64: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&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function $y(t,e){var n=t.pendingLanes;if(n===0)return 0;var r=0,i=t.suspendedLanes,o=t.pingedLanes,s=n&268435455;if(s!==0){var a=s&~i;a!==0?r=Bh(a):(o&=s,o!==0&&(r=Bh(o)))}else s=n&~i,s!==0?r=Bh(s):o!==0&&(r=Bh(o));if(r===0)return 0;if(e!==0&&e!==r&&!(e&i)&&(i=r&-r,o=e&-e,i>=o||i===16&&(o&4194240)!==0))return e;if(r&4&&(r|=n&16),e=t.entangledLanes,e!==0)for(t=t.entanglements,e&=r;0<e;)n=31-fs(e),i=1<<n,r|=t[n],e&=~i;return r}function sY(t,e){switch(t){case 1:case 2:case 4:return e+250;case 8:case 16:case 32:case 64: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 e+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function aY(t,e){for(var n=t.suspendedLanes,r=t.pingedLanes,i=t.expirationTimes,o=t.pendingLanes;0<o;){var s=31-fs(o),a=1<<s,l=i[s];l===-1?(!(a&n)||a&r)&&(i[s]=sY(a,e)):l<=e&&(t.expiredLanes|=a),o&=~a}}function nC(t){return t=t.pendingLanes&-1073741825,t!==0?t:t&1073741824?1073741824:0}function cI(){var t=Vg;return Vg<<=1,!(Vg&4194240)&&(Vg=64),t}function ex(t){for(var e=[],n=0;31>n;n++)e.push(t);return e}function Em(t,e,n){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-fs(e),t[e]=n}function lY(t,e){var n=t.pendingLanes&~e;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=e,t.mutableReadLanes&=e,t.entangledLanes&=e,e=t.entanglements;var r=t.eventTimes;for(t=t.expirationTimes;0<n;){var i=31-fs(n),o=1<<i;e[i]=0,r[i]=-1,t[i]=-1,n&=~o}}function KE(t,e){var n=t.entangledLanes|=e;for(t=t.entanglements;n;){var r=31-fs(n),i=1<<r;i&e|t[r]&e&&(t[r]|=e),n&=~i}}var dn=0;function uI(t){return t&=-t,1<t?4<t?t&268435455?16:536870912:4:1}var fI,GE,dI,hI,pI,rC=!1,Wg=[],Rl=null,Pl=null,Nl=null,xp=new Map,Sp=new Map,bl=[],cY="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 submit".split(" ");function kR(t,e){switch(t){case"focusin":case"focusout":Rl=null;break;case"dragenter":case"dragleave":Pl=null;break;case"mouseover":case"mouseout":Nl=null;break;case"pointerover":case"pointerout":xp.delete(e.pointerId);break;case"gotpointercapture":case"lostpointercapture":Sp.delete(e.pointerId)}}function uh(t,e,n,r,i,o){return t===null||t.nativeEvent!==o?(t={blockedOn:e,domEventName:n,eventSystemFlags:r,nativeEvent:o,targetContainers:[i]},e!==null&&(e=Tm(e),e!==null&&GE(e)),t):(t.eventSystemFlags|=r,e=t.targetContainers,i!==null&&e.indexOf(i)===-1&&e.push(i),t)}function uY(t,e,n,r,i){switch(e){case"focusin":return Rl=uh(Rl,t,e,n,r,i),!0;case"dragenter":return Pl=uh(Pl,t,e,n,r,i),!0;case"mouseover":return Nl=uh(Nl,t,e,n,r,i),!0;case"pointerover":var o=i.pointerId;return xp.set(o,uh(xp.get(o)||null,t,e,n,r,i)),!0;case"gotpointercapture":return o=i.pointerId,Sp.set(o,uh(Sp.get(o)||null,t,e,n,r,i)),!0}return!1}function mI(t){var e=Mc(t.target);if(e!==null){var n=ku(e);if(n!==null){if(e=n.tag,e===13){if(e=rI(n),e!==null){t.blockedOn=e,pI(t.priority,function(){dI(n)});return}}else if(e===3&&n.stateNode.current.memoizedState.isDehydrated){t.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}t.blockedOn=null}function Gv(t){if(t.blockedOn!==null)return!1;for(var e=t.targetContainers;0<e.length;){var n=iC(t.domEventName,t.eventSystemFlags,e[0],t.nativeEvent);if(n===null){n=t.nativeEvent;var r=new n.constructor(n.type,n);QS=r,n.target.dispatchEvent(r),QS=null}else return e=Tm(n),e!==null&&GE(e),t.blockedOn=n,!1;e.shift()}return!0}function ER(t,e,n){Gv(t)&&n.delete(e)}function fY(){rC=!1,Rl!==null&&Gv(Rl)&&(Rl=null),Pl!==null&&Gv(Pl)&&(Pl=null),Nl!==null&&Gv(Nl)&&(Nl=null),xp.forEach(ER),Sp.forEach(ER)}function fh(t,e){t.blockedOn===e&&(t.blockedOn=null,rC||(rC=!0,io.unstable_scheduleCallback(io.unstable_NormalPriority,fY)))}function Cp(t){function e(i){return fh(i,t)}if(0<Wg.length){fh(Wg[0],t);for(var n=1;n<Wg.length;n++){var r=Wg[n];r.blockedOn===t&&(r.blockedOn=null)}}for(Rl!==null&&fh(Rl,t),Pl!==null&&fh(Pl,t),Nl!==null&&fh(Nl,t),xp.forEach(e),Sp.forEach(e),n=0;n<bl.length;n++)r=bl[n],r.blockedOn===t&&(r.blockedOn=null);for(;0<bl.length&&(n=bl[0],n.blockedOn===null);)mI(n),n.blockedOn===null&&bl.shift()}var Lf=Ha.ReactCurrentBatchConfig,Iy=!0;function dY(t,e,n,r){var i=dn,o=Lf.transition;Lf.transition=null;try{dn=1,YE(t,e,n,r)}finally{dn=i,Lf.transition=o}}function hY(t,e,n,r){var i=dn,o=Lf.transition;Lf.transition=null;try{dn=4,YE(t,e,n,r)}finally{dn=i,Lf.transition=o}}function YE(t,e,n,r){if(Iy){var i=iC(t,e,n,r);if(i===null)ux(t,e,r,jy,n),kR(t,r);else if(uY(i,t,e,n,r))r.stopPropagation();else if(kR(t,r),e&4&&-1<cY.indexOf(t)){for(;i!==null;){var o=Tm(i);if(o!==null&&fI(o),o=iC(t,e,n,r),o===null&&ux(t,e,r,jy,n),o===i)break;i=o}i!==null&&r.stopPropagation()}else ux(t,e,r,null,n)}}var jy=null;function iC(t,e,n,r){if(jy=null,t=HE(r),t=Mc(t),t!==null)if(e=ku(t),e===null)t=null;else if(n=e.tag,n===13){if(t=rI(e),t!==null)return t;t=null}else if(n===3){if(e.stateNode.current.memoizedState.isDehydrated)return e.tag===3?e.stateNode.containerInfo:null;t=null}else e!==t&&(t=null);return jy=t,null}function gI(t){switch(t){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"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 1;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"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(eY()){case qE:return 1;case aI:return 4;case Ly:case tY:return 16;case lI:return 536870912;default:return 16}default:return 16}}var Cl=null,XE=null,Yv=null;function vI(){if(Yv)return Yv;var t,e=XE,n=e.length,r,i="value"in Cl?Cl.value:Cl.textContent,o=i.length;for(t=0;t<n&&e[t]===i[t];t++);var s=n-t;for(r=1;r<=s&&e[n-r]===i[o-r];r++);return Yv=i.slice(t,1<r?1-r:void 0)}function Xv(t){var e=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&e===13&&(t=13)):t=e,t===10&&(t=13),32<=t||t===13?t:0}function Hg(){return!0}function _R(){return!1}function lo(t){function e(n,r,i,o,s){this._reactName=n,this._targetInst=i,this.type=r,this.nativeEvent=o,this.target=s,this.currentTarget=null;for(var a in t)t.hasOwnProperty(a)&&(n=t[a],this[a]=n?n(o):o[a]);return this.isDefaultPrevented=(o.defaultPrevented!=null?o.defaultPrevented:o.returnValue===!1)?Hg:_R,this.isPropagationStopped=_R,this}return Fn(e.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Hg)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Hg)},persist:function(){},isPersistent:Hg}),e}var Sd={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ZE=lo(Sd),_m=Fn({},Sd,{view:0,detail:0}),pY=lo(_m),tx,nx,dh,vb=Fn({},_m,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:QE,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==dh&&(dh&&t.type==="mousemove"?(tx=t.screenX-dh.screenX,nx=t.screenY-dh.screenY):nx=tx=0,dh=t),tx)},movementY:function(t){return"movementY"in t?t.movementY:nx}}),TR=lo(vb),mY=Fn({},vb,{dataTransfer:0}),gY=lo(mY),vY=Fn({},_m,{relatedTarget:0}),rx=lo(vY),yY=Fn({},Sd,{animationName:0,elapsedTime:0,pseudoElement:0}),bY=lo(yY),wY=Fn({},Sd,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),xY=lo(wY),SY=Fn({},Sd,{data:0}),AR=lo(SY),CY={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},kY={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"},EY={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function _Y(t){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(t):(t=EY[t])?!!e[t]:!1}function QE(){return _Y}var TY=Fn({},_m,{key:function(t){if(t.key){var e=CY[t.key]||t.key;if(e!=="Unidentified")return e}return t.type==="keypress"?(t=Xv(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?kY[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:QE,charCode:function(t){return t.type==="keypress"?Xv(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?Xv(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),AY=lo(TY),OY=Fn({},vb,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),OR=lo(OY),RY=Fn({},_m,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:QE}),PY=lo(RY),NY=Fn({},Sd,{propertyName:0,elapsedTime:0,pseudoElement:0}),MY=lo(NY),DY=Fn({},vb,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),LY=lo(DY),$Y=[9,13,27,32],JE=Na&&"CompositionEvent"in window,Qh=null;Na&&"documentMode"in document&&(Qh=document.documentMode);var IY=Na&&"TextEvent"in window&&!Qh,yI=Na&&(!JE||Qh&&8<Qh&&11>=Qh),RR=" ",PR=!1;function bI(t,e){switch(t){case"keyup":return $Y.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function wI(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var pf=!1;function jY(t,e){switch(t){case"compositionend":return wI(e);case"keypress":return e.which!==32?null:(PR=!0,RR);case"textInput":return t=e.data,t===RR&&PR?null:t;default:return null}}function BY(t,e){if(pf)return t==="compositionend"||!JE&&bI(t,e)?(t=vI(),Yv=XE=Cl=null,pf=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1<e.char.length)return e.char;if(e.which)return String.fromCharCode(e.which)}return null;case"compositionend":return yI&&e.locale!=="ko"?null:e.data;default:return null}}var FY={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 NR(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e==="input"?!!FY[t.type]:e==="textarea"}function xI(t,e,n,r){Q$(r),e=By(e,"onChange"),0<e.length&&(n=new ZE("onChange","change",null,n,r),t.push({event:n,listeners:e}))}var Jh=null,kp=null;function zY(t){NI(t,0)}function yb(t){var e=vf(t);if(H$(e))return t}function VY(t,e){if(t==="change")return e}var SI=!1;if(Na){var ix;if(Na){var ox="oninput"in document;if(!ox){var MR=document.createElement("div");MR.setAttribute("oninput","return;"),ox=typeof MR.oninput=="function"}ix=ox}else ix=!1;SI=ix&&(!document.documentMode||9<document.documentMode)}function DR(){Jh&&(Jh.detachEvent("onpropertychange",CI),kp=Jh=null)}function CI(t){if(t.propertyName==="value"&&yb(kp)){var e=[];xI(e,kp,t,HE(t)),nI(zY,e)}}function UY(t,e,n){t==="focusin"?(DR(),Jh=e,kp=n,Jh.attachEvent("onpropertychange",CI)):t==="focusout"&&DR()}function WY(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return yb(kp)}function HY(t,e){if(t==="click")return yb(e)}function qY(t,e){if(t==="input"||t==="change")return yb(e)}function KY(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var gs=typeof Object.is=="function"?Object.is:KY;function Ep(t,e){if(gs(t,e))return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;var n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!FS.call(e,i)||!gs(t[i],e[i]))return!1}return!0}function LR(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function $R(t,e){var n=LR(t);t=0;for(var r;n;){if(n.nodeType===3){if(r=t+n.textContent.length,t<=e&&r>=e)return{node:n,offset:e-t};t=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=LR(n)}}function kI(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?kI(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function EI(){for(var t=window,e=Ny();e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=Ny(t.document)}return e}function e_(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}function GY(t){var e=EI(),n=t.focusedElem,r=t.selectionRange;if(e!==n&&n&&n.ownerDocument&&kI(n.ownerDocument.documentElement,n)){if(r!==null&&e_(n)){if(e=r.start,t=r.end,t===void 0&&(t=e),"selectionStart"in n)n.selectionStart=e,n.selectionEnd=Math.min(t,n.value.length);else if(t=(e=n.ownerDocument||document)&&e.defaultView||window,t.getSelection){t=t.getSelection();var i=n.textContent.length,o=Math.min(r.start,i);r=r.end===void 0?o:Math.min(r.end,i),!t.extend&&o>r&&(i=r,r=o,o=i),i=$R(n,o);var s=$R(n,r);i&&s&&(t.rangeCount!==1||t.anchorNode!==i.node||t.anchorOffset!==i.offset||t.focusNode!==s.node||t.focusOffset!==s.offset)&&(e=e.createRange(),e.setStart(i.node,i.offset),t.removeAllRanges(),o>r?(t.addRange(e),t.extend(s.node,s.offset)):(e.setEnd(s.node,s.offset),t.addRange(e)))}}for(e=[],t=n;t=t.parentNode;)t.nodeType===1&&e.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<e.length;n++)t=e[n],t.element.scrollLeft=t.left,t.element.scrollTop=t.top}}var YY=Na&&"documentMode"in document&&11>=document.documentMode,mf=null,oC=null,ep=null,sC=!1;function IR(t,e,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;sC||mf==null||mf!==Ny(r)||(r=mf,"selectionStart"in r&&e_(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),ep&&Ep(ep,r)||(ep=r,r=By(oC,"onSelect"),0<r.length&&(e=new ZE("onSelect","select",null,e,n),t.push({event:e,listeners:r}),e.target=mf)))}function qg(t,e){var n={};return n[t.toLowerCase()]=e.toLowerCase(),n["Webkit"+t]="webkit"+e,n["Moz"+t]="moz"+e,n}var gf={animationend:qg("Animation","AnimationEnd"),animationiteration:qg("Animation","AnimationIteration"),animationstart:qg("Animation","AnimationStart"),transitionend:qg("Transition","TransitionEnd")},sx={},_I={};Na&&(_I=document.createElement("div").style,"AnimationEvent"in window||(delete gf.animationend.animation,delete gf.animationiteration.animation,delete gf.animationstart.animation),"TransitionEvent"in window||delete gf.transitionend.transition);function bb(t){if(sx[t])return sx[t];if(!gf[t])return t;var e=gf[t],n;for(n in e)if(e.hasOwnProperty(n)&&n in _I)return sx[t]=e[n];return t}var TI=bb("animationend"),AI=bb("animationiteration"),OI=bb("animationstart"),RI=bb("transitionend"),PI=new Map,jR="abort auxClick 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(" ");function rc(t,e){PI.set(t,e),Cu(e,[t])}for(var ax=0;ax<jR.length;ax++){var lx=jR[ax],XY=lx.toLowerCase(),ZY=lx[0].toUpperCase()+lx.slice(1);rc(XY,"on"+ZY)}rc(TI,"onAnimationEnd");rc(AI,"onAnimationIteration");rc(OI,"onAnimationStart");rc("dblclick","onDoubleClick");rc("focusin","onFocus");rc("focusout","onBlur");rc(RI,"onTransitionEnd");Zf("onMouseEnter",["mouseout","mouseover"]);Zf("onMouseLeave",["mouseout","mouseover"]);Zf("onPointerEnter",["pointerout","pointerover"]);Zf("onPointerLeave",["pointerout","pointerover"]);Cu("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Cu("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Cu("onBeforeInput",["compositionend","keypress","textInput","paste"]);Cu("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Cu("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Cu("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Fh="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(" "),QY=new Set("cancel close invalid load scroll toggle".split(" ").concat(Fh));function BR(t,e,n){var r=t.type||"unknown-event";t.currentTarget=n,XG(r,e,void 0,t),t.currentTarget=null}function NI(t,e){e=(e&4)!==0;for(var n=0;n<t.length;n++){var r=t[n],i=r.event;r=r.listeners;e:{var o=void 0;if(e)for(var s=r.length-1;0<=s;s--){var a=r[s],l=a.instance,c=a.currentTarget;if(a=a.listener,l!==o&&i.isPropagationStopped())break e;BR(i,a,c),o=l}else for(s=0;s<r.length;s++){if(a=r[s],l=a.instance,c=a.currentTarget,a=a.listener,l!==o&&i.isPropagationStopped())break e;BR(i,a,c),o=l}}}if(Dy)throw t=tC,Dy=!1,tC=null,t}function En(t,e){var n=e[fC];n===void 0&&(n=e[fC]=new Set);var r=t+"__bubble";n.has(r)||(MI(e,t,2,!1),n.add(r))}function cx(t,e,n){var r=0;e&&(r|=4),MI(n,t,r,e)}var Kg="_reactListening"+Math.random().toString(36).slice(2);function _p(t){if(!t[Kg]){t[Kg]=!0,F$.forEach(function(n){n!=="selectionchange"&&(QY.has(n)||cx(n,!1,t),cx(n,!0,t))});var e=t.nodeType===9?t:t.ownerDocument;e===null||e[Kg]||(e[Kg]=!0,cx("selectionchange",!1,e))}}function MI(t,e,n,r){switch(gI(e)){case 1:var i=dY;break;case 4:i=hY;break;default:i=YE}n=i.bind(null,e,n,t),i=void 0,!eC||e!=="touchstart"&&e!=="touchmove"&&e!=="wheel"||(i=!0),r?i!==void 0?t.addEventListener(e,n,{capture:!0,passive:i}):t.addEventListener(e,n,!0):i!==void 0?t.addEventListener(e,n,{passive:i}):t.addEventListener(e,n,!1)}function ux(t,e,n,r,i){var o=r;if(!(e&1)&&!(e&2)&&r!==null)e:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var a=r.stateNode.containerInfo;if(a===i||a.nodeType===8&&a.parentNode===i)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&(l=s.stateNode.containerInfo,l===i||l.nodeType===8&&l.parentNode===i))return;s=s.return}for(;a!==null;){if(s=Mc(a),s===null)return;if(l=s.tag,l===5||l===6){r=o=s;continue e}a=a.parentNode}}r=r.return}nI(function(){var c=o,f=HE(n),d=[];e:{var p=PI.get(t);if(p!==void 0){var m=ZE,v=t;switch(t){case"keypress":if(Xv(n)===0)break e;case"keydown":case"keyup":m=AY;break;case"focusin":v="focus",m=rx;break;case"focusout":v="blur",m=rx;break;case"beforeblur":case"afterblur":m=rx;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":m=TR;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":m=gY;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":m=PY;break;case TI:case AI:case OI:m=bY;break;case RI:m=MY;break;case"scroll":m=pY;break;case"wheel":m=LY;break;case"copy":case"cut":case"paste":m=xY;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":m=OR}var b=(e&4)!==0,S=!b&&t==="scroll",x=b?p!==null?p+"Capture":null:p;b=[];for(var w=c,C;w!==null;){C=w;var T=C.stateNode;if(C.tag===5&&T!==null&&(C=T,x!==null&&(T=wp(w,x),T!=null&&b.push(Tp(w,T,C)))),S)break;w=w.return}0<b.length&&(p=new m(p,v,null,n,f),d.push({event:p,listeners:b}))}}if(!(e&7)){e:{if(p=t==="mouseover"||t==="pointerover",m=t==="mouseout"||t==="pointerout",p&&n!==QS&&(v=n.relatedTarget||n.fromElement)&&(Mc(v)||v[Ma]))break e;if((m||p)&&(p=f.window===f?f:(p=f.ownerDocument)?p.defaultView||p.parentWindow:window,m?(v=n.relatedTarget||n.toElement,m=c,v=v?Mc(v):null,v!==null&&(S=ku(v),v!==S||v.tag!==5&&v.tag!==6)&&(v=null)):(m=null,v=c),m!==v)){if(b=TR,T="onMouseLeave",x="onMouseEnter",w="mouse",(t==="pointerout"||t==="pointerover")&&(b=OR,T="onPointerLeave",x="onPointerEnter",w="pointer"),S=m==null?p:vf(m),C=v==null?p:vf(v),p=new b(T,w+"leave",m,n,f),p.target=S,p.relatedTarget=C,T=null,Mc(f)===c&&(b=new b(x,w+"enter",v,n,f),b.target=C,b.relatedTarget=S,T=b),S=T,m&&v)t:{for(b=m,x=v,w=0,C=b;C;C=Gu(C))w++;for(C=0,T=x;T;T=Gu(T))C++;for(;0<w-C;)b=Gu(b),w--;for(;0<C-w;)x=Gu(x),C--;for(;w--;){if(b===x||x!==null&&b===x.alternate)break t;b=Gu(b),x=Gu(x)}b=null}else b=null;m!==null&&FR(d,p,m,b,!1),v!==null&&S!==null&&FR(d,S,v,b,!0)}}e:{if(p=c?vf(c):window,m=p.nodeName&&p.nodeName.toLowerCase(),m==="select"||m==="input"&&p.type==="file")var A=VY;else if(NR(p))if(SI)A=qY;else{A=WY;var _=UY}else(m=p.nodeName)&&m.toLowerCase()==="input"&&(p.type==="checkbox"||p.type==="radio")&&(A=HY);if(A&&(A=A(t,c))){xI(d,A,n,f);break e}_&&_(t,p,c),t==="focusout"&&(_=p._wrapperState)&&_.controlled&&p.type==="number"&&KS(p,"number",p.value)}switch(_=c?vf(c):window,t){case"focusin":(NR(_)||_.contentEditable==="true")&&(mf=_,oC=c,ep=null);break;case"focusout":ep=oC=mf=null;break;case"mousedown":sC=!0;break;case"contextmenu":case"mouseup":case"dragend":sC=!1,IR(d,n,f);break;case"selectionchange":if(YY)break;case"keydown":case"keyup":IR(d,n,f)}var R;if(JE)e:{switch(t){case"compositionstart":var M="onCompositionStart";break e;case"compositionend":M="onCompositionEnd";break e;case"compositionupdate":M="onCompositionUpdate";break e}M=void 0}else pf?bI(t,n)&&(M="onCompositionEnd"):t==="keydown"&&n.keyCode===229&&(M="onCompositionStart");M&&(yI&&n.locale!=="ko"&&(pf||M!=="onCompositionStart"?M==="onCompositionEnd"&&pf&&(R=vI()):(Cl=f,XE="value"in Cl?Cl.value:Cl.textContent,pf=!0)),_=By(c,M),0<_.length&&(M=new AR(M,t,null,n,f),d.push({event:M,listeners:_}),R?M.data=R:(R=wI(n),R!==null&&(M.data=R)))),(R=IY?jY(t,n):BY(t,n))&&(c=By(c,"onBeforeInput"),0<c.length&&(f=new AR("onBeforeInput","beforeinput",null,n,f),d.push({event:f,listeners:c}),f.data=R))}NI(d,e)})}function Tp(t,e,n){return{instance:t,listener:e,currentTarget:n}}function By(t,e){for(var n=e+"Capture",r=[];t!==null;){var i=t,o=i.stateNode;i.tag===5&&o!==null&&(i=o,o=wp(t,n),o!=null&&r.unshift(Tp(t,o,i)),o=wp(t,e),o!=null&&r.push(Tp(t,o,i))),t=t.return}return r}function Gu(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5);return t||null}function FR(t,e,n,r,i){for(var o=e._reactName,s=[];n!==null&&n!==r;){var a=n,l=a.alternate,c=a.stateNode;if(l!==null&&l===r)break;a.tag===5&&c!==null&&(a=c,i?(l=wp(n,o),l!=null&&s.unshift(Tp(n,l,a))):i||(l=wp(n,o),l!=null&&s.push(Tp(n,l,a)))),n=n.return}s.length!==0&&t.push({event:e,listeners:s})}var JY=/\r\n?/g,eX=/\u0000|\uFFFD/g;function zR(t){return(typeof t=="string"?t:""+t).replace(JY,`
38
+ `).replace(eX,"")}function Gg(t,e,n){if(e=zR(e),zR(t)!==e&&n)throw Error(Re(425))}function Fy(){}var aC=null,lC=null;function cC(t,e){return t==="textarea"||t==="noscript"||typeof e.children=="string"||typeof e.children=="number"||typeof e.dangerouslySetInnerHTML=="object"&&e.dangerouslySetInnerHTML!==null&&e.dangerouslySetInnerHTML.__html!=null}var uC=typeof setTimeout=="function"?setTimeout:void 0,tX=typeof clearTimeout=="function"?clearTimeout:void 0,VR=typeof Promise=="function"?Promise:void 0,nX=typeof queueMicrotask=="function"?queueMicrotask:typeof VR<"u"?function(t){return VR.resolve(null).then(t).catch(rX)}:uC;function rX(t){setTimeout(function(){throw t})}function fx(t,e){var n=e,r=0;do{var i=n.nextSibling;if(t.removeChild(n),i&&i.nodeType===8)if(n=i.data,n==="/$"){if(r===0){t.removeChild(i),Cp(e);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=i}while(n);Cp(e)}function Ml(t){for(;t!=null;t=t.nextSibling){var e=t.nodeType;if(e===1||e===3)break;if(e===8){if(e=t.data,e==="$"||e==="$!"||e==="$?")break;if(e==="/$")return null}}return t}function UR(t){t=t.previousSibling;for(var e=0;t;){if(t.nodeType===8){var n=t.data;if(n==="$"||n==="$!"||n==="$?"){if(e===0)return t;e--}else n==="/$"&&e++}t=t.previousSibling}return null}var Cd=Math.random().toString(36).slice(2),js="__reactFiber$"+Cd,Ap="__reactProps$"+Cd,Ma="__reactContainer$"+Cd,fC="__reactEvents$"+Cd,iX="__reactListeners$"+Cd,oX="__reactHandles$"+Cd;function Mc(t){var e=t[js];if(e)return e;for(var n=t.parentNode;n;){if(e=n[Ma]||n[js]){if(n=e.alternate,e.child!==null||n!==null&&n.child!==null)for(t=UR(t);t!==null;){if(n=t[js])return n;t=UR(t)}return e}t=n,n=t.parentNode}return null}function Tm(t){return t=t[js]||t[Ma],!t||t.tag!==5&&t.tag!==6&&t.tag!==13&&t.tag!==3?null:t}function vf(t){if(t.tag===5||t.tag===6)return t.stateNode;throw Error(Re(33))}function wb(t){return t[Ap]||null}var dC=[],yf=-1;function ic(t){return{current:t}}function On(t){0>yf||(t.current=dC[yf],dC[yf]=null,yf--)}function wn(t,e){yf++,dC[yf]=t.current,t.current=e}var Ul={},Yr=ic(Ul),_i=ic(!1),Qc=Ul;function Qf(t,e){var n=t.type.contextTypes;if(!n)return Ul;var r=t.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===e)return r.__reactInternalMemoizedMaskedChildContext;var i={},o;for(o in n)i[o]=e[o];return r&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=i),i}function Ti(t){return t=t.childContextTypes,t!=null}function zy(){On(_i),On(Yr)}function WR(t,e,n){if(Yr.current!==Ul)throw Error(Re(168));wn(Yr,e),wn(_i,n)}function DI(t,e,n){var r=t.stateNode;if(e=e.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in e))throw Error(Re(108,UG(t)||"Unknown",i));return Fn({},n,r)}function Vy(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||Ul,Qc=Yr.current,wn(Yr,t),wn(_i,_i.current),!0}function HR(t,e,n){var r=t.stateNode;if(!r)throw Error(Re(169));n?(t=DI(t,e,Qc),r.__reactInternalMemoizedMergedChildContext=t,On(_i),On(Yr),wn(Yr,t)):On(_i),wn(_i,n)}var Sa=null,xb=!1,dx=!1;function LI(t){Sa===null?Sa=[t]:Sa.push(t)}function sX(t){xb=!0,LI(t)}function oc(){if(!dx&&Sa!==null){dx=!0;var t=0,e=dn;try{var n=Sa;for(dn=1;t<n.length;t++){var r=n[t];do r=r(!0);while(r!==null)}Sa=null,xb=!1}catch(i){throw Sa!==null&&(Sa=Sa.slice(t+1)),sI(qE,oc),i}finally{dn=e,dx=!1}}return null}var bf=[],wf=0,Uy=null,Wy=0,ko=[],Eo=0,Jc=null,Ea=1,_a="";function xc(t,e){bf[wf++]=Wy,bf[wf++]=Uy,Uy=t,Wy=e}function $I(t,e,n){ko[Eo++]=Ea,ko[Eo++]=_a,ko[Eo++]=Jc,Jc=t;var r=Ea;t=_a;var i=32-fs(r)-1;r&=~(1<<i),n+=1;var o=32-fs(e)+i;if(30<o){var s=i-i%5;o=(r&(1<<s)-1).toString(32),r>>=s,i-=s,Ea=1<<32-fs(e)+i|n<<i|r,_a=o+t}else Ea=1<<o|n<<i|r,_a=t}function t_(t){t.return!==null&&(xc(t,1),$I(t,1,0))}function n_(t){for(;t===Uy;)Uy=bf[--wf],bf[wf]=null,Wy=bf[--wf],bf[wf]=null;for(;t===Jc;)Jc=ko[--Eo],ko[Eo]=null,_a=ko[--Eo],ko[Eo]=null,Ea=ko[--Eo],ko[Eo]=null}var no=null,Ji=null,Dn=!1,os=null;function II(t,e){var n=Ro(5,null,null,0);n.elementType="DELETED",n.stateNode=e,n.return=t,e=t.deletions,e===null?(t.deletions=[n],t.flags|=16):e.push(n)}function qR(t,e){switch(t.tag){case 5:var n=t.type;return e=e.nodeType!==1||n.toLowerCase()!==e.nodeName.toLowerCase()?null:e,e!==null?(t.stateNode=e,no=t,Ji=Ml(e.firstChild),!0):!1;case 6:return e=t.pendingProps===""||e.nodeType!==3?null:e,e!==null?(t.stateNode=e,no=t,Ji=null,!0):!1;case 13:return e=e.nodeType!==8?null:e,e!==null?(n=Jc!==null?{id:Ea,overflow:_a}:null,t.memoizedState={dehydrated:e,treeContext:n,retryLane:1073741824},n=Ro(18,null,null,0),n.stateNode=e,n.return=t,t.child=n,no=t,Ji=null,!0):!1;default:return!1}}function hC(t){return(t.mode&1)!==0&&(t.flags&128)===0}function pC(t){if(Dn){var e=Ji;if(e){var n=e;if(!qR(t,e)){if(hC(t))throw Error(Re(418));e=Ml(n.nextSibling);var r=no;e&&qR(t,e)?II(r,n):(t.flags=t.flags&-4097|2,Dn=!1,no=t)}}else{if(hC(t))throw Error(Re(418));t.flags=t.flags&-4097|2,Dn=!1,no=t}}}function KR(t){for(t=t.return;t!==null&&t.tag!==5&&t.tag!==3&&t.tag!==13;)t=t.return;no=t}function Yg(t){if(t!==no)return!1;if(!Dn)return KR(t),Dn=!0,!1;var e;if((e=t.tag!==3)&&!(e=t.tag!==5)&&(e=t.type,e=e!=="head"&&e!=="body"&&!cC(t.type,t.memoizedProps)),e&&(e=Ji)){if(hC(t))throw jI(),Error(Re(418));for(;e;)II(t,e),e=Ml(e.nextSibling)}if(KR(t),t.tag===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(Re(317));e:{for(t=t.nextSibling,e=0;t;){if(t.nodeType===8){var n=t.data;if(n==="/$"){if(e===0){Ji=Ml(t.nextSibling);break e}e--}else n!=="$"&&n!=="$!"&&n!=="$?"||e++}t=t.nextSibling}Ji=null}}else Ji=no?Ml(t.stateNode.nextSibling):null;return!0}function jI(){for(var t=Ji;t;)t=Ml(t.nextSibling)}function Jf(){Ji=no=null,Dn=!1}function r_(t){os===null?os=[t]:os.push(t)}var aX=Ha.ReactCurrentBatchConfig;function Jo(t,e){if(t&&t.defaultProps){e=Fn({},e),t=t.defaultProps;for(var n in t)e[n]===void 0&&(e[n]=t[n]);return e}return e}var Hy=ic(null),qy=null,xf=null,i_=null;function o_(){i_=xf=qy=null}function s_(t){var e=Hy.current;On(Hy),t._currentValue=e}function mC(t,e,n){for(;t!==null;){var r=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,r!==null&&(r.childLanes|=e)):r!==null&&(r.childLanes&e)!==e&&(r.childLanes|=e),t===n)break;t=t.return}}function $f(t,e){qy=t,i_=xf=null,t=t.dependencies,t!==null&&t.firstContext!==null&&(t.lanes&e&&(ki=!0),t.firstContext=null)}function $o(t){var e=t._currentValue;if(i_!==t)if(t={context:t,memoizedValue:e,next:null},xf===null){if(qy===null)throw Error(Re(308));xf=t,qy.dependencies={lanes:0,firstContext:t}}else xf=xf.next=t;return e}var Dc=null;function a_(t){Dc===null?Dc=[t]:Dc.push(t)}function BI(t,e,n,r){var i=e.interleaved;return i===null?(n.next=n,a_(e)):(n.next=i.next,i.next=n),e.interleaved=n,Da(t,r)}function Da(t,e){t.lanes|=e;var n=t.alternate;for(n!==null&&(n.lanes|=e),n=t,t=t.return;t!==null;)t.childLanes|=e,n=t.alternate,n!==null&&(n.childLanes|=e),n=t,t=t.return;return n.tag===3?n.stateNode:null}var gl=!1;function l_(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function FI(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,effects:t.effects})}function Ta(t,e){return{eventTime:t,lane:e,tag:0,payload:null,callback:null,next:null}}function Dl(t,e,n){var r=t.updateQueue;if(r===null)return null;if(r=r.shared,Yt&2){var i=r.pending;return i===null?e.next=e:(e.next=i.next,i.next=e),r.pending=e,Da(t,n)}return i=r.interleaved,i===null?(e.next=e,a_(r)):(e.next=i.next,i.next=e),r.interleaved=e,Da(t,n)}function Zv(t,e,n){if(e=e.updateQueue,e!==null&&(e=e.shared,(n&4194240)!==0)){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,KE(t,n)}}function GR(t,e){var n=t.updateQueue,r=t.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,o=null;if(n=n.firstBaseUpdate,n!==null){do{var s={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};o===null?i=o=s:o=o.next=s,n=n.next}while(n!==null);o===null?i=o=e:o=o.next=e}else i=o=e;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:o,shared:r.shared,effects:r.effects},t.updateQueue=n;return}t=n.lastBaseUpdate,t===null?n.firstBaseUpdate=e:t.next=e,n.lastBaseUpdate=e}function Ky(t,e,n,r){var i=t.updateQueue;gl=!1;var o=i.firstBaseUpdate,s=i.lastBaseUpdate,a=i.shared.pending;if(a!==null){i.shared.pending=null;var l=a,c=l.next;l.next=null,s===null?o=c:s.next=c,s=l;var f=t.alternate;f!==null&&(f=f.updateQueue,a=f.lastBaseUpdate,a!==s&&(a===null?f.firstBaseUpdate=c:a.next=c,f.lastBaseUpdate=l))}if(o!==null){var d=i.baseState;s=0,f=c=l=null,a=o;do{var p=a.lane,m=a.eventTime;if((r&p)===p){f!==null&&(f=f.next={eventTime:m,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var v=t,b=a;switch(p=e,m=n,b.tag){case 1:if(v=b.payload,typeof v=="function"){d=v.call(m,d,p);break e}d=v;break e;case 3:v.flags=v.flags&-65537|128;case 0:if(v=b.payload,p=typeof v=="function"?v.call(m,d,p):v,p==null)break e;d=Fn({},d,p);break e;case 2:gl=!0}}a.callback!==null&&a.lane!==0&&(t.flags|=64,p=i.effects,p===null?i.effects=[a]:p.push(a))}else m={eventTime:m,lane:p,tag:a.tag,payload:a.payload,callback:a.callback,next:null},f===null?(c=f=m,l=d):f=f.next=m,s|=p;if(a=a.next,a===null){if(a=i.shared.pending,a===null)break;p=a,a=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(!0);if(f===null&&(l=d),i.baseState=l,i.firstBaseUpdate=c,i.lastBaseUpdate=f,e=i.shared.interleaved,e!==null){i=e;do s|=i.lane,i=i.next;while(i!==e)}else o===null&&(i.shared.lanes=0);tu|=s,t.lanes=s,t.memoizedState=d}}function YR(t,e,n){if(t=e.effects,e.effects=null,t!==null)for(e=0;e<t.length;e++){var r=t[e],i=r.callback;if(i!==null){if(r.callback=null,r=n,typeof i!="function")throw Error(Re(191,i));i.call(r)}}}var zI=new B$.Component().refs;function gC(t,e,n,r){e=t.memoizedState,n=n(r,e),n=n==null?e:Fn({},e,n),t.memoizedState=n,t.lanes===0&&(t.updateQueue.baseState=n)}var Sb={isMounted:function(t){return(t=t._reactInternals)?ku(t)===t:!1},enqueueSetState:function(t,e,n){t=t._reactInternals;var r=ci(),i=$l(t),o=Ta(r,i);o.payload=e,n!=null&&(o.callback=n),e=Dl(t,o,i),e!==null&&(ds(e,t,i,r),Zv(e,t,i))},enqueueReplaceState:function(t,e,n){t=t._reactInternals;var r=ci(),i=$l(t),o=Ta(r,i);o.tag=1,o.payload=e,n!=null&&(o.callback=n),e=Dl(t,o,i),e!==null&&(ds(e,t,i,r),Zv(e,t,i))},enqueueForceUpdate:function(t,e){t=t._reactInternals;var n=ci(),r=$l(t),i=Ta(n,r);i.tag=2,e!=null&&(i.callback=e),e=Dl(t,i,r),e!==null&&(ds(e,t,r,n),Zv(e,t,r))}};function XR(t,e,n,r,i,o,s){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(r,o,s):e.prototype&&e.prototype.isPureReactComponent?!Ep(n,r)||!Ep(i,o):!0}function VI(t,e,n){var r=!1,i=Ul,o=e.contextType;return typeof o=="object"&&o!==null?o=$o(o):(i=Ti(e)?Qc:Yr.current,r=e.contextTypes,o=(r=r!=null)?Qf(t,i):Ul),e=new e(n,o),t.memoizedState=e.state!==null&&e.state!==void 0?e.state:null,e.updater=Sb,t.stateNode=e,e._reactInternals=t,r&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=i,t.__reactInternalMemoizedMaskedChildContext=o),e}function ZR(t,e,n,r){t=e.state,typeof e.componentWillReceiveProps=="function"&&e.componentWillReceiveProps(n,r),typeof e.UNSAFE_componentWillReceiveProps=="function"&&e.UNSAFE_componentWillReceiveProps(n,r),e.state!==t&&Sb.enqueueReplaceState(e,e.state,null)}function vC(t,e,n,r){var i=t.stateNode;i.props=n,i.state=t.memoizedState,i.refs=zI,l_(t);var o=e.contextType;typeof o=="object"&&o!==null?i.context=$o(o):(o=Ti(e)?Qc:Yr.current,i.context=Qf(t,o)),i.state=t.memoizedState,o=e.getDerivedStateFromProps,typeof o=="function"&&(gC(t,e,o,n),i.state=t.memoizedState),typeof e.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(e=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),e!==i.state&&Sb.enqueueReplaceState(i,i.state,null),Ky(t,n,i,r),i.state=t.memoizedState),typeof i.componentDidMount=="function"&&(t.flags|=4194308)}function hh(t,e,n){if(t=n.ref,t!==null&&typeof t!="function"&&typeof t!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(Re(309));var r=n.stateNode}if(!r)throw Error(Re(147,t));var i=r,o=""+t;return e!==null&&e.ref!==null&&typeof e.ref=="function"&&e.ref._stringRef===o?e.ref:(e=function(s){var a=i.refs;a===zI&&(a=i.refs={}),s===null?delete a[o]:a[o]=s},e._stringRef=o,e)}if(typeof t!="string")throw Error(Re(284));if(!n._owner)throw Error(Re(290,t))}return t}function Xg(t,e){throw t=Object.prototype.toString.call(e),Error(Re(31,t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t))}function QR(t){var e=t._init;return e(t._payload)}function UI(t){function e(x,w){if(t){var C=x.deletions;C===null?(x.deletions=[w],x.flags|=16):C.push(w)}}function n(x,w){if(!t)return null;for(;w!==null;)e(x,w),w=w.sibling;return null}function r(x,w){for(x=new Map;w!==null;)w.key!==null?x.set(w.key,w):x.set(w.index,w),w=w.sibling;return x}function i(x,w){return x=Il(x,w),x.index=0,x.sibling=null,x}function o(x,w,C){return x.index=C,t?(C=x.alternate,C!==null?(C=C.index,C<w?(x.flags|=2,w):C):(x.flags|=2,w)):(x.flags|=1048576,w)}function s(x){return t&&x.alternate===null&&(x.flags|=2),x}function a(x,w,C,T){return w===null||w.tag!==6?(w=bx(C,x.mode,T),w.return=x,w):(w=i(w,C),w.return=x,w)}function l(x,w,C,T){var A=C.type;return A===hf?f(x,w,C.props.children,T,C.key):w!==null&&(w.elementType===A||typeof A=="object"&&A!==null&&A.$$typeof===ml&&QR(A)===w.type)?(T=i(w,C.props),T.ref=hh(x,w,C),T.return=x,T):(T=ry(C.type,C.key,C.props,null,x.mode,T),T.ref=hh(x,w,C),T.return=x,T)}function c(x,w,C,T){return w===null||w.tag!==4||w.stateNode.containerInfo!==C.containerInfo||w.stateNode.implementation!==C.implementation?(w=wx(C,x.mode,T),w.return=x,w):(w=i(w,C.children||[]),w.return=x,w)}function f(x,w,C,T,A){return w===null||w.tag!==7?(w=qc(C,x.mode,T,A),w.return=x,w):(w=i(w,C),w.return=x,w)}function d(x,w,C){if(typeof w=="string"&&w!==""||typeof w=="number")return w=bx(""+w,x.mode,C),w.return=x,w;if(typeof w=="object"&&w!==null){switch(w.$$typeof){case Bg:return C=ry(w.type,w.key,w.props,null,x.mode,C),C.ref=hh(x,null,w),C.return=x,C;case df:return w=wx(w,x.mode,C),w.return=x,w;case ml:var T=w._init;return d(x,T(w._payload),C)}if(jh(w)||lh(w))return w=qc(w,x.mode,C,null),w.return=x,w;Xg(x,w)}return null}function p(x,w,C,T){var A=w!==null?w.key:null;if(typeof C=="string"&&C!==""||typeof C=="number")return A!==null?null:a(x,w,""+C,T);if(typeof C=="object"&&C!==null){switch(C.$$typeof){case Bg:return C.key===A?l(x,w,C,T):null;case df:return C.key===A?c(x,w,C,T):null;case ml:return A=C._init,p(x,w,A(C._payload),T)}if(jh(C)||lh(C))return A!==null?null:f(x,w,C,T,null);Xg(x,C)}return null}function m(x,w,C,T,A){if(typeof T=="string"&&T!==""||typeof T=="number")return x=x.get(C)||null,a(w,x,""+T,A);if(typeof T=="object"&&T!==null){switch(T.$$typeof){case Bg:return x=x.get(T.key===null?C:T.key)||null,l(w,x,T,A);case df:return x=x.get(T.key===null?C:T.key)||null,c(w,x,T,A);case ml:var _=T._init;return m(x,w,C,_(T._payload),A)}if(jh(T)||lh(T))return x=x.get(C)||null,f(w,x,T,A,null);Xg(w,T)}return null}function v(x,w,C,T){for(var A=null,_=null,R=w,M=w=0,I=null;R!==null&&M<C.length;M++){R.index>M?(I=R,R=null):I=R.sibling;var V=p(x,R,C[M],T);if(V===null){R===null&&(R=I);break}t&&R&&V.alternate===null&&e(x,R),w=o(V,w,M),_===null?A=V:_.sibling=V,_=V,R=I}if(M===C.length)return n(x,R),Dn&&xc(x,M),A;if(R===null){for(;M<C.length;M++)R=d(x,C[M],T),R!==null&&(w=o(R,w,M),_===null?A=R:_.sibling=R,_=R);return Dn&&xc(x,M),A}for(R=r(x,R);M<C.length;M++)I=m(R,x,M,C[M],T),I!==null&&(t&&I.alternate!==null&&R.delete(I.key===null?M:I.key),w=o(I,w,M),_===null?A=I:_.sibling=I,_=I);return t&&R.forEach(function(U){return e(x,U)}),Dn&&xc(x,M),A}function b(x,w,C,T){var A=lh(C);if(typeof A!="function")throw Error(Re(150));if(C=A.call(C),C==null)throw Error(Re(151));for(var _=A=null,R=w,M=w=0,I=null,V=C.next();R!==null&&!V.done;M++,V=C.next()){R.index>M?(I=R,R=null):I=R.sibling;var U=p(x,R,V.value,T);if(U===null){R===null&&(R=I);break}t&&R&&U.alternate===null&&e(x,R),w=o(U,w,M),_===null?A=U:_.sibling=U,_=U,R=I}if(V.done)return n(x,R),Dn&&xc(x,M),A;if(R===null){for(;!V.done;M++,V=C.next())V=d(x,V.value,T),V!==null&&(w=o(V,w,M),_===null?A=V:_.sibling=V,_=V);return Dn&&xc(x,M),A}for(R=r(x,R);!V.done;M++,V=C.next())V=m(R,x,M,V.value,T),V!==null&&(t&&V.alternate!==null&&R.delete(V.key===null?M:V.key),w=o(V,w,M),_===null?A=V:_.sibling=V,_=V);return t&&R.forEach(function(L){return e(x,L)}),Dn&&xc(x,M),A}function S(x,w,C,T){if(typeof C=="object"&&C!==null&&C.type===hf&&C.key===null&&(C=C.props.children),typeof C=="object"&&C!==null){switch(C.$$typeof){case Bg:e:{for(var A=C.key,_=w;_!==null;){if(_.key===A){if(A=C.type,A===hf){if(_.tag===7){n(x,_.sibling),w=i(_,C.props.children),w.return=x,x=w;break e}}else if(_.elementType===A||typeof A=="object"&&A!==null&&A.$$typeof===ml&&QR(A)===_.type){n(x,_.sibling),w=i(_,C.props),w.ref=hh(x,_,C),w.return=x,x=w;break e}n(x,_);break}else e(x,_);_=_.sibling}C.type===hf?(w=qc(C.props.children,x.mode,T,C.key),w.return=x,x=w):(T=ry(C.type,C.key,C.props,null,x.mode,T),T.ref=hh(x,w,C),T.return=x,x=T)}return s(x);case df:e:{for(_=C.key;w!==null;){if(w.key===_)if(w.tag===4&&w.stateNode.containerInfo===C.containerInfo&&w.stateNode.implementation===C.implementation){n(x,w.sibling),w=i(w,C.children||[]),w.return=x,x=w;break e}else{n(x,w);break}else e(x,w);w=w.sibling}w=wx(C,x.mode,T),w.return=x,x=w}return s(x);case ml:return _=C._init,S(x,w,_(C._payload),T)}if(jh(C))return v(x,w,C,T);if(lh(C))return b(x,w,C,T);Xg(x,C)}return typeof C=="string"&&C!==""||typeof C=="number"?(C=""+C,w!==null&&w.tag===6?(n(x,w.sibling),w=i(w,C),w.return=x,x=w):(n(x,w),w=bx(C,x.mode,T),w.return=x,x=w),s(x)):n(x,w)}return S}var ed=UI(!0),WI=UI(!1),Am={},Ks=ic(Am),Op=ic(Am),Rp=ic(Am);function Lc(t){if(t===Am)throw Error(Re(174));return t}function c_(t,e){switch(wn(Rp,e),wn(Op,t),wn(Ks,Am),t=e.nodeType,t){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:YS(null,"");break;default:t=t===8?e.parentNode:e,e=t.namespaceURI||null,t=t.tagName,e=YS(e,t)}On(Ks),wn(Ks,e)}function td(){On(Ks),On(Op),On(Rp)}function HI(t){Lc(Rp.current);var e=Lc(Ks.current),n=YS(e,t.type);e!==n&&(wn(Op,t),wn(Ks,n))}function u_(t){Op.current===t&&(On(Ks),On(Op))}var jn=ic(0);function Gy(t){for(var e=t;e!==null;){if(e.tag===13){var n=e.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return e}else if(e.tag===19&&e.memoizedProps.revealOrder!==void 0){if(e.flags&128)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var hx=[];function f_(){for(var t=0;t<hx.length;t++)hx[t]._workInProgressVersionPrimary=null;hx.length=0}var Qv=Ha.ReactCurrentDispatcher,px=Ha.ReactCurrentBatchConfig,eu=0,Bn=null,hr=null,wr=null,Yy=!1,tp=!1,Pp=0,lX=0;function Wr(){throw Error(Re(321))}function d_(t,e){if(e===null)return!1;for(var n=0;n<e.length&&n<t.length;n++)if(!gs(t[n],e[n]))return!1;return!0}function h_(t,e,n,r,i,o){if(eu=o,Bn=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,Qv.current=t===null||t.memoizedState===null?dX:hX,t=n(r,i),tp){o=0;do{if(tp=!1,Pp=0,25<=o)throw Error(Re(301));o+=1,wr=hr=null,e.updateQueue=null,Qv.current=pX,t=n(r,i)}while(tp)}if(Qv.current=Xy,e=hr!==null&&hr.next!==null,eu=0,wr=hr=Bn=null,Yy=!1,e)throw Error(Re(300));return t}function p_(){var t=Pp!==0;return Pp=0,t}function Ms(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return wr===null?Bn.memoizedState=wr=t:wr=wr.next=t,wr}function Io(){if(hr===null){var t=Bn.alternate;t=t!==null?t.memoizedState:null}else t=hr.next;var e=wr===null?Bn.memoizedState:wr.next;if(e!==null)wr=e,hr=t;else{if(t===null)throw Error(Re(310));hr=t,t={memoizedState:hr.memoizedState,baseState:hr.baseState,baseQueue:hr.baseQueue,queue:hr.queue,next:null},wr===null?Bn.memoizedState=wr=t:wr=wr.next=t}return wr}function Np(t,e){return typeof e=="function"?e(t):e}function mx(t){var e=Io(),n=e.queue;if(n===null)throw Error(Re(311));n.lastRenderedReducer=t;var r=hr,i=r.baseQueue,o=n.pending;if(o!==null){if(i!==null){var s=i.next;i.next=o.next,o.next=s}r.baseQueue=i=o,n.pending=null}if(i!==null){o=i.next,r=r.baseState;var a=s=null,l=null,c=o;do{var f=c.lane;if((eu&f)===f)l!==null&&(l=l.next={lane:0,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),r=c.hasEagerState?c.eagerState:t(r,c.action);else{var d={lane:f,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};l===null?(a=l=d,s=r):l=l.next=d,Bn.lanes|=f,tu|=f}c=c.next}while(c!==null&&c!==o);l===null?s=r:l.next=a,gs(r,e.memoizedState)||(ki=!0),e.memoizedState=r,e.baseState=s,e.baseQueue=l,n.lastRenderedState=r}if(t=n.interleaved,t!==null){i=t;do o=i.lane,Bn.lanes|=o,tu|=o,i=i.next;while(i!==t)}else i===null&&(n.lanes=0);return[e.memoizedState,n.dispatch]}function gx(t){var e=Io(),n=e.queue;if(n===null)throw Error(Re(311));n.lastRenderedReducer=t;var r=n.dispatch,i=n.pending,o=e.memoizedState;if(i!==null){n.pending=null;var s=i=i.next;do o=t(o,s.action),s=s.next;while(s!==i);gs(o,e.memoizedState)||(ki=!0),e.memoizedState=o,e.baseQueue===null&&(e.baseState=o),n.lastRenderedState=o}return[o,r]}function qI(){}function KI(t,e){var n=Bn,r=Io(),i=e(),o=!gs(r.memoizedState,i);if(o&&(r.memoizedState=i,ki=!0),r=r.queue,m_(XI.bind(null,n,r,t),[t]),r.getSnapshot!==e||o||wr!==null&&wr.memoizedState.tag&1){if(n.flags|=2048,Mp(9,YI.bind(null,n,r,i,e),void 0,null),Cr===null)throw Error(Re(349));eu&30||GI(n,e,i)}return i}function GI(t,e,n){t.flags|=16384,t={getSnapshot:e,value:n},e=Bn.updateQueue,e===null?(e={lastEffect:null,stores:null},Bn.updateQueue=e,e.stores=[t]):(n=e.stores,n===null?e.stores=[t]:n.push(t))}function YI(t,e,n,r){e.value=n,e.getSnapshot=r,ZI(e)&&QI(t)}function XI(t,e,n){return n(function(){ZI(e)&&QI(t)})}function ZI(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!gs(t,n)}catch{return!0}}function QI(t){var e=Da(t,1);e!==null&&ds(e,t,1,-1)}function JR(t){var e=Ms();return typeof t=="function"&&(t=t()),e.memoizedState=e.baseState=t,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Np,lastRenderedState:t},e.queue=t,t=t.dispatch=fX.bind(null,Bn,t),[e.memoizedState,t]}function Mp(t,e,n,r){return t={tag:t,create:e,destroy:n,deps:r,next:null},e=Bn.updateQueue,e===null?(e={lastEffect:null,stores:null},Bn.updateQueue=e,e.lastEffect=t.next=t):(n=e.lastEffect,n===null?e.lastEffect=t.next=t:(r=n.next,n.next=t,t.next=r,e.lastEffect=t)),t}function JI(){return Io().memoizedState}function Jv(t,e,n,r){var i=Ms();Bn.flags|=t,i.memoizedState=Mp(1|e,n,void 0,r===void 0?null:r)}function Cb(t,e,n,r){var i=Io();r=r===void 0?null:r;var o=void 0;if(hr!==null){var s=hr.memoizedState;if(o=s.destroy,r!==null&&d_(r,s.deps)){i.memoizedState=Mp(e,n,o,r);return}}Bn.flags|=t,i.memoizedState=Mp(1|e,n,o,r)}function eP(t,e){return Jv(8390656,8,t,e)}function m_(t,e){return Cb(2048,8,t,e)}function e5(t,e){return Cb(4,2,t,e)}function t5(t,e){return Cb(4,4,t,e)}function n5(t,e){if(typeof e=="function")return t=t(),e(t),function(){e(null)};if(e!=null)return t=t(),e.current=t,function(){e.current=null}}function r5(t,e,n){return n=n!=null?n.concat([t]):null,Cb(4,4,n5.bind(null,e,t),n)}function g_(){}function i5(t,e){var n=Io();e=e===void 0?null:e;var r=n.memoizedState;return r!==null&&e!==null&&d_(e,r[1])?r[0]:(n.memoizedState=[t,e],t)}function o5(t,e){var n=Io();e=e===void 0?null:e;var r=n.memoizedState;return r!==null&&e!==null&&d_(e,r[1])?r[0]:(t=t(),n.memoizedState=[t,e],t)}function s5(t,e,n){return eu&21?(gs(n,e)||(n=cI(),Bn.lanes|=n,tu|=n,t.baseState=!0),e):(t.baseState&&(t.baseState=!1,ki=!0),t.memoizedState=n)}function cX(t,e){var n=dn;dn=n!==0&&4>n?n:4,t(!0);var r=px.transition;px.transition={};try{t(!1),e()}finally{dn=n,px.transition=r}}function a5(){return Io().memoizedState}function uX(t,e,n){var r=$l(t);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},l5(t))c5(e,n);else if(n=BI(t,e,n,r),n!==null){var i=ci();ds(n,t,r,i),u5(n,e,r)}}function fX(t,e,n){var r=$l(t),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(l5(t))c5(e,i);else{var o=t.alternate;if(t.lanes===0&&(o===null||o.lanes===0)&&(o=e.lastRenderedReducer,o!==null))try{var s=e.lastRenderedState,a=o(s,n);if(i.hasEagerState=!0,i.eagerState=a,gs(a,s)){var l=e.interleaved;l===null?(i.next=i,a_(e)):(i.next=l.next,l.next=i),e.interleaved=i;return}}catch{}finally{}n=BI(t,e,i,r),n!==null&&(i=ci(),ds(n,t,r,i),u5(n,e,r))}}function l5(t){var e=t.alternate;return t===Bn||e!==null&&e===Bn}function c5(t,e){tp=Yy=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function u5(t,e,n){if(n&4194240){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,KE(t,n)}}var Xy={readContext:$o,useCallback:Wr,useContext:Wr,useEffect:Wr,useImperativeHandle:Wr,useInsertionEffect:Wr,useLayoutEffect:Wr,useMemo:Wr,useReducer:Wr,useRef:Wr,useState:Wr,useDebugValue:Wr,useDeferredValue:Wr,useTransition:Wr,useMutableSource:Wr,useSyncExternalStore:Wr,useId:Wr,unstable_isNewReconciler:!1},dX={readContext:$o,useCallback:function(t,e){return Ms().memoizedState=[t,e===void 0?null:e],t},useContext:$o,useEffect:eP,useImperativeHandle:function(t,e,n){return n=n!=null?n.concat([t]):null,Jv(4194308,4,n5.bind(null,e,t),n)},useLayoutEffect:function(t,e){return Jv(4194308,4,t,e)},useInsertionEffect:function(t,e){return Jv(4,2,t,e)},useMemo:function(t,e){var n=Ms();return e=e===void 0?null:e,t=t(),n.memoizedState=[t,e],t},useReducer:function(t,e,n){var r=Ms();return e=n!==void 0?n(e):e,r.memoizedState=r.baseState=e,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:e},r.queue=t,t=t.dispatch=uX.bind(null,Bn,t),[r.memoizedState,t]},useRef:function(t){var e=Ms();return t={current:t},e.memoizedState=t},useState:JR,useDebugValue:g_,useDeferredValue:function(t){return Ms().memoizedState=t},useTransition:function(){var t=JR(!1),e=t[0];return t=cX.bind(null,t[1]),Ms().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,n){var r=Bn,i=Ms();if(Dn){if(n===void 0)throw Error(Re(407));n=n()}else{if(n=e(),Cr===null)throw Error(Re(349));eu&30||GI(r,e,n)}i.memoizedState=n;var o={value:n,getSnapshot:e};return i.queue=o,eP(XI.bind(null,r,o,t),[t]),r.flags|=2048,Mp(9,YI.bind(null,r,o,n,e),void 0,null),n},useId:function(){var t=Ms(),e=Cr.identifierPrefix;if(Dn){var n=_a,r=Ea;n=(r&~(1<<32-fs(r)-1)).toString(32)+n,e=":"+e+"R"+n,n=Pp++,0<n&&(e+="H"+n.toString(32)),e+=":"}else n=lX++,e=":"+e+"r"+n.toString(32)+":";return t.memoizedState=e},unstable_isNewReconciler:!1},hX={readContext:$o,useCallback:i5,useContext:$o,useEffect:m_,useImperativeHandle:r5,useInsertionEffect:e5,useLayoutEffect:t5,useMemo:o5,useReducer:mx,useRef:JI,useState:function(){return mx(Np)},useDebugValue:g_,useDeferredValue:function(t){var e=Io();return s5(e,hr.memoizedState,t)},useTransition:function(){var t=mx(Np)[0],e=Io().memoizedState;return[t,e]},useMutableSource:qI,useSyncExternalStore:KI,useId:a5,unstable_isNewReconciler:!1},pX={readContext:$o,useCallback:i5,useContext:$o,useEffect:m_,useImperativeHandle:r5,useInsertionEffect:e5,useLayoutEffect:t5,useMemo:o5,useReducer:gx,useRef:JI,useState:function(){return gx(Np)},useDebugValue:g_,useDeferredValue:function(t){var e=Io();return hr===null?e.memoizedState=t:s5(e,hr.memoizedState,t)},useTransition:function(){var t=gx(Np)[0],e=Io().memoizedState;return[t,e]},useMutableSource:qI,useSyncExternalStore:KI,useId:a5,unstable_isNewReconciler:!1};function nd(t,e){try{var n="",r=e;do n+=VG(r),r=r.return;while(r);var i=n}catch(o){i=`
39
+ Error generating stack: `+o.message+`
40
+ `+o.stack}return{value:t,source:e,stack:i,digest:null}}function vx(t,e,n){return{value:t,source:null,stack:n??null,digest:e??null}}function yC(t,e){try{console.error(e.value)}catch(n){setTimeout(function(){throw n})}}var mX=typeof WeakMap=="function"?WeakMap:Map;function f5(t,e,n){n=Ta(-1,n),n.tag=3,n.payload={element:null};var r=e.value;return n.callback=function(){Qy||(Qy=!0,AC=r),yC(t,e)},n}function d5(t,e,n){n=Ta(-1,n),n.tag=3;var r=t.type.getDerivedStateFromError;if(typeof r=="function"){var i=e.value;n.payload=function(){return r(i)},n.callback=function(){yC(t,e)}}var o=t.stateNode;return o!==null&&typeof o.componentDidCatch=="function"&&(n.callback=function(){yC(t,e),typeof r!="function"&&(Ll===null?Ll=new Set([this]):Ll.add(this));var s=e.stack;this.componentDidCatch(e.value,{componentStack:s!==null?s:""})}),n}function tP(t,e,n){var r=t.pingCache;if(r===null){r=t.pingCache=new mX;var i=new Set;r.set(e,i)}else i=r.get(e),i===void 0&&(i=new Set,r.set(e,i));i.has(n)||(i.add(n),t=OX.bind(null,t,e,n),e.then(t,t))}function nP(t){do{var e;if((e=t.tag===13)&&(e=t.memoizedState,e=e!==null?e.dehydrated!==null:!0),e)return t;t=t.return}while(t!==null);return null}function rP(t,e,n,r,i){return t.mode&1?(t.flags|=65536,t.lanes=i,t):(t===e?t.flags|=65536:(t.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(e=Ta(-1,1),e.tag=2,Dl(n,e,1))),n.lanes|=1),t)}var gX=Ha.ReactCurrentOwner,ki=!1;function si(t,e,n,r){e.child=t===null?WI(e,null,n,r):ed(e,t.child,n,r)}function iP(t,e,n,r,i){n=n.render;var o=e.ref;return $f(e,i),r=h_(t,e,n,r,o,i),n=p_(),t!==null&&!ki?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~i,La(t,e,i)):(Dn&&n&&t_(e),e.flags|=1,si(t,e,r,i),e.child)}function oP(t,e,n,r,i){if(t===null){var o=n.type;return typeof o=="function"&&!k_(o)&&o.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(e.tag=15,e.type=o,h5(t,e,o,r,i)):(t=ry(n.type,null,r,e,e.mode,i),t.ref=e.ref,t.return=e,e.child=t)}if(o=t.child,!(t.lanes&i)){var s=o.memoizedProps;if(n=n.compare,n=n!==null?n:Ep,n(s,r)&&t.ref===e.ref)return La(t,e,i)}return e.flags|=1,t=Il(o,r),t.ref=e.ref,t.return=e,e.child=t}function h5(t,e,n,r,i){if(t!==null){var o=t.memoizedProps;if(Ep(o,r)&&t.ref===e.ref)if(ki=!1,e.pendingProps=r=o,(t.lanes&i)!==0)t.flags&131072&&(ki=!0);else return e.lanes=t.lanes,La(t,e,i)}return bC(t,e,n,r,i)}function p5(t,e,n){var r=e.pendingProps,i=r.children,o=t!==null?t.memoizedState:null;if(r.mode==="hidden")if(!(e.mode&1))e.memoizedState={baseLanes:0,cachePool:null,transitions:null},wn(Cf,Ki),Ki|=n;else{if(!(n&1073741824))return t=o!==null?o.baseLanes|n:n,e.lanes=e.childLanes=1073741824,e.memoizedState={baseLanes:t,cachePool:null,transitions:null},e.updateQueue=null,wn(Cf,Ki),Ki|=t,null;e.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=o!==null?o.baseLanes:n,wn(Cf,Ki),Ki|=r}else o!==null?(r=o.baseLanes|n,e.memoizedState=null):r=n,wn(Cf,Ki),Ki|=r;return si(t,e,i,n),e.child}function m5(t,e){var n=e.ref;(t===null&&n!==null||t!==null&&t.ref!==n)&&(e.flags|=512,e.flags|=2097152)}function bC(t,e,n,r,i){var o=Ti(n)?Qc:Yr.current;return o=Qf(e,o),$f(e,i),n=h_(t,e,n,r,o,i),r=p_(),t!==null&&!ki?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~i,La(t,e,i)):(Dn&&r&&t_(e),e.flags|=1,si(t,e,n,i),e.child)}function sP(t,e,n,r,i){if(Ti(n)){var o=!0;Vy(e)}else o=!1;if($f(e,i),e.stateNode===null)ey(t,e),VI(e,n,r),vC(e,n,r,i),r=!0;else if(t===null){var s=e.stateNode,a=e.memoizedProps;s.props=a;var l=s.context,c=n.contextType;typeof c=="object"&&c!==null?c=$o(c):(c=Ti(n)?Qc:Yr.current,c=Qf(e,c));var f=n.getDerivedStateFromProps,d=typeof f=="function"||typeof s.getSnapshotBeforeUpdate=="function";d||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(a!==r||l!==c)&&ZR(e,s,r,c),gl=!1;var p=e.memoizedState;s.state=p,Ky(e,r,s,i),l=e.memoizedState,a!==r||p!==l||_i.current||gl?(typeof f=="function"&&(gC(e,n,f,r),l=e.memoizedState),(a=gl||XR(e,n,a,r,p,l,c))?(d||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"&&(e.flags|=4194308)):(typeof s.componentDidMount=="function"&&(e.flags|=4194308),e.memoizedProps=r,e.memoizedState=l),s.props=r,s.state=l,s.context=c,r=a):(typeof s.componentDidMount=="function"&&(e.flags|=4194308),r=!1)}else{s=e.stateNode,FI(t,e),a=e.memoizedProps,c=e.type===e.elementType?a:Jo(e.type,a),s.props=c,d=e.pendingProps,p=s.context,l=n.contextType,typeof l=="object"&&l!==null?l=$o(l):(l=Ti(n)?Qc:Yr.current,l=Qf(e,l));var m=n.getDerivedStateFromProps;(f=typeof m=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(a!==d||p!==l)&&ZR(e,s,r,l),gl=!1,p=e.memoizedState,s.state=p,Ky(e,r,s,i);var v=e.memoizedState;a!==d||p!==v||_i.current||gl?(typeof m=="function"&&(gC(e,n,m,r),v=e.memoizedState),(c=gl||XR(e,n,c,r,p,v,l)||!1)?(f||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(r,v,l),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(r,v,l)),typeof s.componentDidUpdate=="function"&&(e.flags|=4),typeof s.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof s.componentDidUpdate!="function"||a===t.memoizedProps&&p===t.memoizedState||(e.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||a===t.memoizedProps&&p===t.memoizedState||(e.flags|=1024),e.memoizedProps=r,e.memoizedState=v),s.props=r,s.state=v,s.context=l,r=c):(typeof s.componentDidUpdate!="function"||a===t.memoizedProps&&p===t.memoizedState||(e.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||a===t.memoizedProps&&p===t.memoizedState||(e.flags|=1024),r=!1)}return wC(t,e,n,r,o,i)}function wC(t,e,n,r,i,o){m5(t,e);var s=(e.flags&128)!==0;if(!r&&!s)return i&&HR(e,n,!1),La(t,e,o);r=e.stateNode,gX.current=e;var a=s&&typeof n.getDerivedStateFromError!="function"?null:r.render();return e.flags|=1,t!==null&&s?(e.child=ed(e,t.child,null,o),e.child=ed(e,null,a,o)):si(t,e,a,o),e.memoizedState=r.state,i&&HR(e,n,!0),e.child}function g5(t){var e=t.stateNode;e.pendingContext?WR(t,e.pendingContext,e.pendingContext!==e.context):e.context&&WR(t,e.context,!1),c_(t,e.containerInfo)}function aP(t,e,n,r,i){return Jf(),r_(i),e.flags|=256,si(t,e,n,r),e.child}var xC={dehydrated:null,treeContext:null,retryLane:0};function SC(t){return{baseLanes:t,cachePool:null,transitions:null}}function v5(t,e,n){var r=e.pendingProps,i=jn.current,o=!1,s=(e.flags&128)!==0,a;if((a=s)||(a=t!==null&&t.memoizedState===null?!1:(i&2)!==0),a?(o=!0,e.flags&=-129):(t===null||t.memoizedState!==null)&&(i|=1),wn(jn,i&1),t===null)return pC(e),t=e.memoizedState,t!==null&&(t=t.dehydrated,t!==null)?(e.mode&1?t.data==="$!"?e.lanes=8:e.lanes=1073741824:e.lanes=1,null):(s=r.children,t=r.fallback,o?(r=e.mode,o=e.child,s={mode:"hidden",children:s},!(r&1)&&o!==null?(o.childLanes=0,o.pendingProps=s):o=_b(s,r,0,null),t=qc(t,r,n,null),o.return=e,t.return=e,o.sibling=t,e.child=o,e.child.memoizedState=SC(n),e.memoizedState=xC,t):v_(e,s));if(i=t.memoizedState,i!==null&&(a=i.dehydrated,a!==null))return vX(t,e,s,r,a,i,n);if(o){o=r.fallback,s=e.mode,i=t.child,a=i.sibling;var l={mode:"hidden",children:r.children};return!(s&1)&&e.child!==i?(r=e.child,r.childLanes=0,r.pendingProps=l,e.deletions=null):(r=Il(i,l),r.subtreeFlags=i.subtreeFlags&14680064),a!==null?o=Il(a,o):(o=qc(o,s,n,null),o.flags|=2),o.return=e,r.return=e,r.sibling=o,e.child=r,r=o,o=e.child,s=t.child.memoizedState,s=s===null?SC(n):{baseLanes:s.baseLanes|n,cachePool:null,transitions:s.transitions},o.memoizedState=s,o.childLanes=t.childLanes&~n,e.memoizedState=xC,r}return o=t.child,t=o.sibling,r=Il(o,{mode:"visible",children:r.children}),!(e.mode&1)&&(r.lanes=n),r.return=e,r.sibling=null,t!==null&&(n=e.deletions,n===null?(e.deletions=[t],e.flags|=16):n.push(t)),e.child=r,e.memoizedState=null,r}function v_(t,e){return e=_b({mode:"visible",children:e},t.mode,0,null),e.return=t,t.child=e}function Zg(t,e,n,r){return r!==null&&r_(r),ed(e,t.child,null,n),t=v_(e,e.pendingProps.children),t.flags|=2,e.memoizedState=null,t}function vX(t,e,n,r,i,o,s){if(n)return e.flags&256?(e.flags&=-257,r=vx(Error(Re(422))),Zg(t,e,s,r)):e.memoizedState!==null?(e.child=t.child,e.flags|=128,null):(o=r.fallback,i=e.mode,r=_b({mode:"visible",children:r.children},i,0,null),o=qc(o,i,s,null),o.flags|=2,r.return=e,o.return=e,r.sibling=o,e.child=r,e.mode&1&&ed(e,t.child,null,s),e.child.memoizedState=SC(s),e.memoizedState=xC,o);if(!(e.mode&1))return Zg(t,e,s,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var a=r.dgst;return r=a,o=Error(Re(419)),r=vx(o,r,void 0),Zg(t,e,s,r)}if(a=(s&t.childLanes)!==0,ki||a){if(r=Cr,r!==null){switch(s&-s){case 4:i=2;break;case 16:i=8;break;case 64: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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:i=32;break;case 536870912:i=268435456;break;default:i=0}i=i&(r.suspendedLanes|s)?0:i,i!==0&&i!==o.retryLane&&(o.retryLane=i,Da(t,i),ds(r,t,i,-1))}return C_(),r=vx(Error(Re(421))),Zg(t,e,s,r)}return i.data==="$?"?(e.flags|=128,e.child=t.child,e=RX.bind(null,t),i._reactRetry=e,null):(t=o.treeContext,Ji=Ml(i.nextSibling),no=e,Dn=!0,os=null,t!==null&&(ko[Eo++]=Ea,ko[Eo++]=_a,ko[Eo++]=Jc,Ea=t.id,_a=t.overflow,Jc=e),e=v_(e,r.children),e.flags|=4096,e)}function lP(t,e,n){t.lanes|=e;var r=t.alternate;r!==null&&(r.lanes|=e),mC(t.return,e,n)}function yx(t,e,n,r,i){var o=t.memoizedState;o===null?t.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(o.isBackwards=e,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i)}function y5(t,e,n){var r=e.pendingProps,i=r.revealOrder,o=r.tail;if(si(t,e,r.children,n),r=jn.current,r&2)r=r&1|2,e.flags|=128;else{if(t!==null&&t.flags&128)e:for(t=e.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&lP(t,n,e);else if(t.tag===19)lP(t,n,e);else if(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;t=t.return}t.sibling.return=t.return,t=t.sibling}r&=1}if(wn(jn,r),!(e.mode&1))e.memoizedState=null;else switch(i){case"forwards":for(n=e.child,i=null;n!==null;)t=n.alternate,t!==null&&Gy(t)===null&&(i=n),n=n.sibling;n=i,n===null?(i=e.child,e.child=null):(i=n.sibling,n.sibling=null),yx(e,!1,i,n,o);break;case"backwards":for(n=null,i=e.child,e.child=null;i!==null;){if(t=i.alternate,t!==null&&Gy(t)===null){e.child=i;break}t=i.sibling,i.sibling=n,n=i,i=t}yx(e,!0,n,null,o);break;case"together":yx(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function ey(t,e){!(e.mode&1)&&t!==null&&(t.alternate=null,e.alternate=null,e.flags|=2)}function La(t,e,n){if(t!==null&&(e.dependencies=t.dependencies),tu|=e.lanes,!(n&e.childLanes))return null;if(t!==null&&e.child!==t.child)throw Error(Re(153));if(e.child!==null){for(t=e.child,n=Il(t,t.pendingProps),e.child=n,n.return=e;t.sibling!==null;)t=t.sibling,n=n.sibling=Il(t,t.pendingProps),n.return=e;n.sibling=null}return e.child}function yX(t,e,n){switch(e.tag){case 3:g5(e),Jf();break;case 5:HI(e);break;case 1:Ti(e.type)&&Vy(e);break;case 4:c_(e,e.stateNode.containerInfo);break;case 10:var r=e.type._context,i=e.memoizedProps.value;wn(Hy,r._currentValue),r._currentValue=i;break;case 13:if(r=e.memoizedState,r!==null)return r.dehydrated!==null?(wn(jn,jn.current&1),e.flags|=128,null):n&e.child.childLanes?v5(t,e,n):(wn(jn,jn.current&1),t=La(t,e,n),t!==null?t.sibling:null);wn(jn,jn.current&1);break;case 19:if(r=(n&e.childLanes)!==0,t.flags&128){if(r)return y5(t,e,n);e.flags|=128}if(i=e.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),wn(jn,jn.current),r)break;return null;case 22:case 23:return e.lanes=0,p5(t,e,n)}return La(t,e,n)}var b5,CC,w5,x5;b5=function(t,e){for(var n=e.child;n!==null;){if(n.tag===5||n.tag===6)t.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};CC=function(){};w5=function(t,e,n,r){var i=t.memoizedProps;if(i!==r){t=e.stateNode,Lc(Ks.current);var o=null;switch(n){case"input":i=HS(t,i),r=HS(t,r),o=[];break;case"select":i=Fn({},i,{value:void 0}),r=Fn({},r,{value:void 0}),o=[];break;case"textarea":i=GS(t,i),r=GS(t,r),o=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(t.onclick=Fy)}XS(n,r);var s;n=null;for(c in i)if(!r.hasOwnProperty(c)&&i.hasOwnProperty(c)&&i[c]!=null)if(c==="style"){var a=i[c];for(s in a)a.hasOwnProperty(s)&&(n||(n={}),n[s]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(yp.hasOwnProperty(c)?o||(o=[]):(o=o||[]).push(c,null));for(c in r){var l=r[c];if(a=i!=null?i[c]:void 0,r.hasOwnProperty(c)&&l!==a&&(l!=null||a!=null))if(c==="style")if(a){for(s in a)!a.hasOwnProperty(s)||l&&l.hasOwnProperty(s)||(n||(n={}),n[s]="");for(s in l)l.hasOwnProperty(s)&&a[s]!==l[s]&&(n||(n={}),n[s]=l[s])}else n||(o||(o=[]),o.push(c,n)),n=l;else c==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,a=a?a.__html:void 0,l!=null&&a!==l&&(o=o||[]).push(c,l)):c==="children"?typeof l!="string"&&typeof l!="number"||(o=o||[]).push(c,""+l):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(yp.hasOwnProperty(c)?(l!=null&&c==="onScroll"&&En("scroll",t),o||a===l||(o=[])):(o=o||[]).push(c,l))}n&&(o=o||[]).push("style",n);var c=o;(e.updateQueue=c)&&(e.flags|=4)}};x5=function(t,e,n,r){n!==r&&(e.flags|=4)};function ph(t,e){if(!Dn)switch(t.tailMode){case"hidden":e=t.tail;for(var n=null;e!==null;)e.alternate!==null&&(n=e),e=e.sibling;n===null?t.tail=null:n.sibling=null;break;case"collapsed":n=t.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?e||t.tail===null?t.tail=null:t.tail.sibling=null:r.sibling=null}}function Hr(t){var e=t.alternate!==null&&t.alternate.child===t.child,n=0,r=0;if(e)for(var i=t.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&14680064,r|=i.flags&14680064,i.return=t,i=i.sibling;else for(i=t.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=t,i=i.sibling;return t.subtreeFlags|=r,t.childLanes=n,e}function bX(t,e,n){var r=e.pendingProps;switch(n_(e),e.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Hr(e),null;case 1:return Ti(e.type)&&zy(),Hr(e),null;case 3:return r=e.stateNode,td(),On(_i),On(Yr),f_(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(t===null||t.child===null)&&(Yg(e)?e.flags|=4:t===null||t.memoizedState.isDehydrated&&!(e.flags&256)||(e.flags|=1024,os!==null&&(PC(os),os=null))),CC(t,e),Hr(e),null;case 5:u_(e);var i=Lc(Rp.current);if(n=e.type,t!==null&&e.stateNode!=null)w5(t,e,n,r,i),t.ref!==e.ref&&(e.flags|=512,e.flags|=2097152);else{if(!r){if(e.stateNode===null)throw Error(Re(166));return Hr(e),null}if(t=Lc(Ks.current),Yg(e)){r=e.stateNode,n=e.type;var o=e.memoizedProps;switch(r[js]=e,r[Ap]=o,t=(e.mode&1)!==0,n){case"dialog":En("cancel",r),En("close",r);break;case"iframe":case"object":case"embed":En("load",r);break;case"video":case"audio":for(i=0;i<Fh.length;i++)En(Fh[i],r);break;case"source":En("error",r);break;case"img":case"image":case"link":En("error",r),En("load",r);break;case"details":En("toggle",r);break;case"input":vR(r,o),En("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!o.multiple},En("invalid",r);break;case"textarea":bR(r,o),En("invalid",r)}XS(n,o),i=null;for(var s in o)if(o.hasOwnProperty(s)){var a=o[s];s==="children"?typeof a=="string"?r.textContent!==a&&(o.suppressHydrationWarning!==!0&&Gg(r.textContent,a,t),i=["children",a]):typeof a=="number"&&r.textContent!==""+a&&(o.suppressHydrationWarning!==!0&&Gg(r.textContent,a,t),i=["children",""+a]):yp.hasOwnProperty(s)&&a!=null&&s==="onScroll"&&En("scroll",r)}switch(n){case"input":Fg(r),yR(r,o,!0);break;case"textarea":Fg(r),wR(r);break;case"select":case"option":break;default:typeof o.onClick=="function"&&(r.onclick=Fy)}r=i,e.updateQueue=r,r!==null&&(e.flags|=4)}else{s=i.nodeType===9?i:i.ownerDocument,t==="http://www.w3.org/1999/xhtml"&&(t=G$(n)),t==="http://www.w3.org/1999/xhtml"?n==="script"?(t=s.createElement("div"),t.innerHTML="<script><\/script>",t=t.removeChild(t.firstChild)):typeof r.is=="string"?t=s.createElement(n,{is:r.is}):(t=s.createElement(n),n==="select"&&(s=t,r.multiple?s.multiple=!0:r.size&&(s.size=r.size))):t=s.createElementNS(t,n),t[js]=e,t[Ap]=r,b5(t,e,!1,!1),e.stateNode=t;e:{switch(s=ZS(n,r),n){case"dialog":En("cancel",t),En("close",t),i=r;break;case"iframe":case"object":case"embed":En("load",t),i=r;break;case"video":case"audio":for(i=0;i<Fh.length;i++)En(Fh[i],t);i=r;break;case"source":En("error",t),i=r;break;case"img":case"image":case"link":En("error",t),En("load",t),i=r;break;case"details":En("toggle",t),i=r;break;case"input":vR(t,r),i=HS(t,r),En("invalid",t);break;case"option":i=r;break;case"select":t._wrapperState={wasMultiple:!!r.multiple},i=Fn({},r,{value:void 0}),En("invalid",t);break;case"textarea":bR(t,r),i=GS(t,r),En("invalid",t);break;default:i=r}XS(n,i),a=i;for(o in a)if(a.hasOwnProperty(o)){var l=a[o];o==="style"?Z$(t,l):o==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&Y$(t,l)):o==="children"?typeof l=="string"?(n!=="textarea"||l!=="")&&bp(t,l):typeof l=="number"&&bp(t,""+l):o!=="suppressContentEditableWarning"&&o!=="suppressHydrationWarning"&&o!=="autoFocus"&&(yp.hasOwnProperty(o)?l!=null&&o==="onScroll"&&En("scroll",t):l!=null&&zE(t,o,l,s))}switch(n){case"input":Fg(t),yR(t,r,!1);break;case"textarea":Fg(t),wR(t);break;case"option":r.value!=null&&t.setAttribute("value",""+Vl(r.value));break;case"select":t.multiple=!!r.multiple,o=r.value,o!=null?Nf(t,!!r.multiple,o,!1):r.defaultValue!=null&&Nf(t,!!r.multiple,r.defaultValue,!0);break;default:typeof i.onClick=="function"&&(t.onclick=Fy)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(e.flags|=4)}e.ref!==null&&(e.flags|=512,e.flags|=2097152)}return Hr(e),null;case 6:if(t&&e.stateNode!=null)x5(t,e,t.memoizedProps,r);else{if(typeof r!="string"&&e.stateNode===null)throw Error(Re(166));if(n=Lc(Rp.current),Lc(Ks.current),Yg(e)){if(r=e.stateNode,n=e.memoizedProps,r[js]=e,(o=r.nodeValue!==n)&&(t=no,t!==null))switch(t.tag){case 3:Gg(r.nodeValue,n,(t.mode&1)!==0);break;case 5:t.memoizedProps.suppressHydrationWarning!==!0&&Gg(r.nodeValue,n,(t.mode&1)!==0)}o&&(e.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[js]=e,e.stateNode=r}return Hr(e),null;case 13:if(On(jn),r=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(Dn&&Ji!==null&&e.mode&1&&!(e.flags&128))jI(),Jf(),e.flags|=98560,o=!1;else if(o=Yg(e),r!==null&&r.dehydrated!==null){if(t===null){if(!o)throw Error(Re(318));if(o=e.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(Re(317));o[js]=e}else Jf(),!(e.flags&128)&&(e.memoizedState=null),e.flags|=4;Hr(e),o=!1}else os!==null&&(PC(os),os=null),o=!0;if(!o)return e.flags&65536?e:null}return e.flags&128?(e.lanes=n,e):(r=r!==null,r!==(t!==null&&t.memoizedState!==null)&&r&&(e.child.flags|=8192,e.mode&1&&(t===null||jn.current&1?mr===0&&(mr=3):C_())),e.updateQueue!==null&&(e.flags|=4),Hr(e),null);case 4:return td(),CC(t,e),t===null&&_p(e.stateNode.containerInfo),Hr(e),null;case 10:return s_(e.type._context),Hr(e),null;case 17:return Ti(e.type)&&zy(),Hr(e),null;case 19:if(On(jn),o=e.memoizedState,o===null)return Hr(e),null;if(r=(e.flags&128)!==0,s=o.rendering,s===null)if(r)ph(o,!1);else{if(mr!==0||t!==null&&t.flags&128)for(t=e.child;t!==null;){if(s=Gy(t),s!==null){for(e.flags|=128,ph(o,!1),r=s.updateQueue,r!==null&&(e.updateQueue=r,e.flags|=4),e.subtreeFlags=0,r=n,n=e.child;n!==null;)o=n,t=r,o.flags&=14680066,s=o.alternate,s===null?(o.childLanes=0,o.lanes=t,o.child=null,o.subtreeFlags=0,o.memoizedProps=null,o.memoizedState=null,o.updateQueue=null,o.dependencies=null,o.stateNode=null):(o.childLanes=s.childLanes,o.lanes=s.lanes,o.child=s.child,o.subtreeFlags=0,o.deletions=null,o.memoizedProps=s.memoizedProps,o.memoizedState=s.memoizedState,o.updateQueue=s.updateQueue,o.type=s.type,t=s.dependencies,o.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),n=n.sibling;return wn(jn,jn.current&1|2),e.child}t=t.sibling}o.tail!==null&&er()>rd&&(e.flags|=128,r=!0,ph(o,!1),e.lanes=4194304)}else{if(!r)if(t=Gy(s),t!==null){if(e.flags|=128,r=!0,n=t.updateQueue,n!==null&&(e.updateQueue=n,e.flags|=4),ph(o,!0),o.tail===null&&o.tailMode==="hidden"&&!s.alternate&&!Dn)return Hr(e),null}else 2*er()-o.renderingStartTime>rd&&n!==1073741824&&(e.flags|=128,r=!0,ph(o,!1),e.lanes=4194304);o.isBackwards?(s.sibling=e.child,e.child=s):(n=o.last,n!==null?n.sibling=s:e.child=s,o.last=s)}return o.tail!==null?(e=o.tail,o.rendering=e,o.tail=e.sibling,o.renderingStartTime=er(),e.sibling=null,n=jn.current,wn(jn,r?n&1|2:n&1),e):(Hr(e),null);case 22:case 23:return S_(),r=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==r&&(e.flags|=8192),r&&e.mode&1?Ki&1073741824&&(Hr(e),e.subtreeFlags&6&&(e.flags|=8192)):Hr(e),null;case 24:return null;case 25:return null}throw Error(Re(156,e.tag))}function wX(t,e){switch(n_(e),e.tag){case 1:return Ti(e.type)&&zy(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return td(),On(_i),On(Yr),f_(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return u_(e),null;case 13:if(On(jn),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(Re(340));Jf()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return On(jn),null;case 4:return td(),null;case 10:return s_(e.type._context),null;case 22:case 23:return S_(),null;case 24:return null;default:return null}}var Qg=!1,Kr=!1,xX=typeof WeakSet=="function"?WeakSet:Set,Qe=null;function Sf(t,e){var n=t.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Hn(t,e,r)}else n.current=null}function kC(t,e,n){try{n()}catch(r){Hn(t,e,r)}}var cP=!1;function SX(t,e){if(aC=Iy,t=EI(),e_(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else e:{n=(n=t.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var s=0,a=-1,l=-1,c=0,f=0,d=t,p=null;t:for(;;){for(var m;d!==n||i!==0&&d.nodeType!==3||(a=s+i),d!==o||r!==0&&d.nodeType!==3||(l=s+r),d.nodeType===3&&(s+=d.nodeValue.length),(m=d.firstChild)!==null;)p=d,d=m;for(;;){if(d===t)break t;if(p===n&&++c===i&&(a=s),p===o&&++f===r&&(l=s),(m=d.nextSibling)!==null)break;d=p,p=d.parentNode}d=m}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(lC={focusedElem:t,selectionRange:n},Iy=!1,Qe=e;Qe!==null;)if(e=Qe,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,Qe=t;else for(;Qe!==null;){e=Qe;try{var v=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(v!==null){var b=v.memoizedProps,S=v.memoizedState,x=e.stateNode,w=x.getSnapshotBeforeUpdate(e.elementType===e.type?b:Jo(e.type,b),S);x.__reactInternalSnapshotBeforeUpdate=w}break;case 3:var C=e.stateNode.containerInfo;C.nodeType===1?C.textContent="":C.nodeType===9&&C.documentElement&&C.removeChild(C.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(Re(163))}}catch(T){Hn(e,e.return,T)}if(t=e.sibling,t!==null){t.return=e.return,Qe=t;break}Qe=e.return}return v=cP,cP=!1,v}function np(t,e,n){var r=e.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&t)===t){var o=i.destroy;i.destroy=void 0,o!==void 0&&kC(e,n,o)}i=i.next}while(i!==r)}}function kb(t,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var n=e=e.next;do{if((n.tag&t)===t){var r=n.create;n.destroy=r()}n=n.next}while(n!==e)}}function EC(t){var e=t.ref;if(e!==null){var n=t.stateNode;switch(t.tag){case 5:t=n;break;default:t=n}typeof e=="function"?e(t):e.current=t}}function S5(t){var e=t.alternate;e!==null&&(t.alternate=null,S5(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[js],delete e[Ap],delete e[fC],delete e[iX],delete e[oX])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function C5(t){return t.tag===5||t.tag===3||t.tag===4}function uP(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||C5(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function _C(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.nodeType===8?n.parentNode.insertBefore(t,e):n.insertBefore(t,e):(n.nodeType===8?(e=n.parentNode,e.insertBefore(t,n)):(e=n,e.appendChild(t)),n=n._reactRootContainer,n!=null||e.onclick!==null||(e.onclick=Fy));else if(r!==4&&(t=t.child,t!==null))for(_C(t,e,n),t=t.sibling;t!==null;)_C(t,e,n),t=t.sibling}function TC(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.insertBefore(t,e):n.appendChild(t);else if(r!==4&&(t=t.child,t!==null))for(TC(t,e,n),t=t.sibling;t!==null;)TC(t,e,n),t=t.sibling}var Pr=null,ns=!1;function al(t,e,n){for(n=n.child;n!==null;)k5(t,e,n),n=n.sibling}function k5(t,e,n){if(qs&&typeof qs.onCommitFiberUnmount=="function")try{qs.onCommitFiberUnmount(gb,n)}catch{}switch(n.tag){case 5:Kr||Sf(n,e);case 6:var r=Pr,i=ns;Pr=null,al(t,e,n),Pr=r,ns=i,Pr!==null&&(ns?(t=Pr,n=n.stateNode,t.nodeType===8?t.parentNode.removeChild(n):t.removeChild(n)):Pr.removeChild(n.stateNode));break;case 18:Pr!==null&&(ns?(t=Pr,n=n.stateNode,t.nodeType===8?fx(t.parentNode,n):t.nodeType===1&&fx(t,n),Cp(t)):fx(Pr,n.stateNode));break;case 4:r=Pr,i=ns,Pr=n.stateNode.containerInfo,ns=!0,al(t,e,n),Pr=r,ns=i;break;case 0:case 11:case 14:case 15:if(!Kr&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var o=i,s=o.destroy;o=o.tag,s!==void 0&&(o&2||o&4)&&kC(n,e,s),i=i.next}while(i!==r)}al(t,e,n);break;case 1:if(!Kr&&(Sf(n,e),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){Hn(n,e,a)}al(t,e,n);break;case 21:al(t,e,n);break;case 22:n.mode&1?(Kr=(r=Kr)||n.memoizedState!==null,al(t,e,n),Kr=r):al(t,e,n);break;default:al(t,e,n)}}function fP(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var n=t.stateNode;n===null&&(n=t.stateNode=new xX),e.forEach(function(r){var i=PX.bind(null,t,r);n.has(r)||(n.add(r),r.then(i,i))})}}function Yo(t,e){var n=e.deletions;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];try{var o=t,s=e,a=s;e:for(;a!==null;){switch(a.tag){case 5:Pr=a.stateNode,ns=!1;break e;case 3:Pr=a.stateNode.containerInfo,ns=!0;break e;case 4:Pr=a.stateNode.containerInfo,ns=!0;break e}a=a.return}if(Pr===null)throw Error(Re(160));k5(o,s,i),Pr=null,ns=!1;var l=i.alternate;l!==null&&(l.return=null),i.return=null}catch(c){Hn(i,e,c)}}if(e.subtreeFlags&12854)for(e=e.child;e!==null;)E5(e,t),e=e.sibling}function E5(t,e){var n=t.alternate,r=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:if(Yo(e,t),Ts(t),r&4){try{np(3,t,t.return),kb(3,t)}catch(b){Hn(t,t.return,b)}try{np(5,t,t.return)}catch(b){Hn(t,t.return,b)}}break;case 1:Yo(e,t),Ts(t),r&512&&n!==null&&Sf(n,n.return);break;case 5:if(Yo(e,t),Ts(t),r&512&&n!==null&&Sf(n,n.return),t.flags&32){var i=t.stateNode;try{bp(i,"")}catch(b){Hn(t,t.return,b)}}if(r&4&&(i=t.stateNode,i!=null)){var o=t.memoizedProps,s=n!==null?n.memoizedProps:o,a=t.type,l=t.updateQueue;if(t.updateQueue=null,l!==null)try{a==="input"&&o.type==="radio"&&o.name!=null&&q$(i,o),ZS(a,s);var c=ZS(a,o);for(s=0;s<l.length;s+=2){var f=l[s],d=l[s+1];f==="style"?Z$(i,d):f==="dangerouslySetInnerHTML"?Y$(i,d):f==="children"?bp(i,d):zE(i,f,d,c)}switch(a){case"input":qS(i,o);break;case"textarea":K$(i,o);break;case"select":var p=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!o.multiple;var m=o.value;m!=null?Nf(i,!!o.multiple,m,!1):p!==!!o.multiple&&(o.defaultValue!=null?Nf(i,!!o.multiple,o.defaultValue,!0):Nf(i,!!o.multiple,o.multiple?[]:"",!1))}i[Ap]=o}catch(b){Hn(t,t.return,b)}}break;case 6:if(Yo(e,t),Ts(t),r&4){if(t.stateNode===null)throw Error(Re(162));i=t.stateNode,o=t.memoizedProps;try{i.nodeValue=o}catch(b){Hn(t,t.return,b)}}break;case 3:if(Yo(e,t),Ts(t),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Cp(e.containerInfo)}catch(b){Hn(t,t.return,b)}break;case 4:Yo(e,t),Ts(t);break;case 13:Yo(e,t),Ts(t),i=t.child,i.flags&8192&&(o=i.memoizedState!==null,i.stateNode.isHidden=o,!o||i.alternate!==null&&i.alternate.memoizedState!==null||(w_=er())),r&4&&fP(t);break;case 22:if(f=n!==null&&n.memoizedState!==null,t.mode&1?(Kr=(c=Kr)||f,Yo(e,t),Kr=c):Yo(e,t),Ts(t),r&8192){if(c=t.memoizedState!==null,(t.stateNode.isHidden=c)&&!f&&t.mode&1)for(Qe=t,f=t.child;f!==null;){for(d=Qe=f;Qe!==null;){switch(p=Qe,m=p.child,p.tag){case 0:case 11:case 14:case 15:np(4,p,p.return);break;case 1:Sf(p,p.return);var v=p.stateNode;if(typeof v.componentWillUnmount=="function"){r=p,n=p.return;try{e=r,v.props=e.memoizedProps,v.state=e.memoizedState,v.componentWillUnmount()}catch(b){Hn(r,n,b)}}break;case 5:Sf(p,p.return);break;case 22:if(p.memoizedState!==null){hP(d);continue}}m!==null?(m.return=p,Qe=m):hP(d)}f=f.sibling}e:for(f=null,d=t;;){if(d.tag===5){if(f===null){f=d;try{i=d.stateNode,c?(o=i.style,typeof o.setProperty=="function"?o.setProperty("display","none","important"):o.display="none"):(a=d.stateNode,l=d.memoizedProps.style,s=l!=null&&l.hasOwnProperty("display")?l.display:null,a.style.display=X$("display",s))}catch(b){Hn(t,t.return,b)}}}else if(d.tag===6){if(f===null)try{d.stateNode.nodeValue=c?"":d.memoizedProps}catch(b){Hn(t,t.return,b)}}else if((d.tag!==22&&d.tag!==23||d.memoizedState===null||d===t)&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===t)break e;for(;d.sibling===null;){if(d.return===null||d.return===t)break e;f===d&&(f=null),d=d.return}f===d&&(f=null),d.sibling.return=d.return,d=d.sibling}}break;case 19:Yo(e,t),Ts(t),r&4&&fP(t);break;case 21:break;default:Yo(e,t),Ts(t)}}function Ts(t){var e=t.flags;if(e&2){try{e:{for(var n=t.return;n!==null;){if(C5(n)){var r=n;break e}n=n.return}throw Error(Re(160))}switch(r.tag){case 5:var i=r.stateNode;r.flags&32&&(bp(i,""),r.flags&=-33);var o=uP(t);TC(t,o,i);break;case 3:case 4:var s=r.stateNode.containerInfo,a=uP(t);_C(t,a,s);break;default:throw Error(Re(161))}}catch(l){Hn(t,t.return,l)}t.flags&=-3}e&4096&&(t.flags&=-4097)}function CX(t,e,n){Qe=t,_5(t)}function _5(t,e,n){for(var r=(t.mode&1)!==0;Qe!==null;){var i=Qe,o=i.child;if(i.tag===22&&r){var s=i.memoizedState!==null||Qg;if(!s){var a=i.alternate,l=a!==null&&a.memoizedState!==null||Kr;a=Qg;var c=Kr;if(Qg=s,(Kr=l)&&!c)for(Qe=i;Qe!==null;)s=Qe,l=s.child,s.tag===22&&s.memoizedState!==null?pP(i):l!==null?(l.return=s,Qe=l):pP(i);for(;o!==null;)Qe=o,_5(o),o=o.sibling;Qe=i,Qg=a,Kr=c}dP(t)}else i.subtreeFlags&8772&&o!==null?(o.return=i,Qe=o):dP(t)}}function dP(t){for(;Qe!==null;){var e=Qe;if(e.flags&8772){var n=e.alternate;try{if(e.flags&8772)switch(e.tag){case 0:case 11:case 15:Kr||kb(5,e);break;case 1:var r=e.stateNode;if(e.flags&4&&!Kr)if(n===null)r.componentDidMount();else{var i=e.elementType===e.type?n.memoizedProps:Jo(e.type,n.memoizedProps);r.componentDidUpdate(i,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var o=e.updateQueue;o!==null&&YR(e,o,r);break;case 3:var s=e.updateQueue;if(s!==null){if(n=null,e.child!==null)switch(e.child.tag){case 5:n=e.child.stateNode;break;case 1:n=e.child.stateNode}YR(e,s,n)}break;case 5:var a=e.stateNode;if(n===null&&e.flags&4){n=a;var l=e.memoizedProps;switch(e.type){case"button":case"input":case"select":case"textarea":l.autoFocus&&n.focus();break;case"img":l.src&&(n.src=l.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(e.memoizedState===null){var c=e.alternate;if(c!==null){var f=c.memoizedState;if(f!==null){var d=f.dehydrated;d!==null&&Cp(d)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(Re(163))}Kr||e.flags&512&&EC(e)}catch(p){Hn(e,e.return,p)}}if(e===t){Qe=null;break}if(n=e.sibling,n!==null){n.return=e.return,Qe=n;break}Qe=e.return}}function hP(t){for(;Qe!==null;){var e=Qe;if(e===t){Qe=null;break}var n=e.sibling;if(n!==null){n.return=e.return,Qe=n;break}Qe=e.return}}function pP(t){for(;Qe!==null;){var e=Qe;try{switch(e.tag){case 0:case 11:case 15:var n=e.return;try{kb(4,e)}catch(l){Hn(e,n,l)}break;case 1:var r=e.stateNode;if(typeof r.componentDidMount=="function"){var i=e.return;try{r.componentDidMount()}catch(l){Hn(e,i,l)}}var o=e.return;try{EC(e)}catch(l){Hn(e,o,l)}break;case 5:var s=e.return;try{EC(e)}catch(l){Hn(e,s,l)}}}catch(l){Hn(e,e.return,l)}if(e===t){Qe=null;break}var a=e.sibling;if(a!==null){a.return=e.return,Qe=a;break}Qe=e.return}}var kX=Math.ceil,Zy=Ha.ReactCurrentDispatcher,y_=Ha.ReactCurrentOwner,No=Ha.ReactCurrentBatchConfig,Yt=0,Cr=null,or=null,Ir=0,Ki=0,Cf=ic(0),mr=0,Dp=null,tu=0,Eb=0,b_=0,rp=null,Si=null,w_=0,rd=1/0,wa=null,Qy=!1,AC=null,Ll=null,Jg=!1,kl=null,Jy=0,ip=0,OC=null,ty=-1,ny=0;function ci(){return Yt&6?er():ty!==-1?ty:ty=er()}function $l(t){return t.mode&1?Yt&2&&Ir!==0?Ir&-Ir:aX.transition!==null?(ny===0&&(ny=cI()),ny):(t=dn,t!==0||(t=window.event,t=t===void 0?16:gI(t.type)),t):1}function ds(t,e,n,r){if(50<ip)throw ip=0,OC=null,Error(Re(185));Em(t,n,r),(!(Yt&2)||t!==Cr)&&(t===Cr&&(!(Yt&2)&&(Eb|=n),mr===4&&wl(t,Ir)),Ai(t,r),n===1&&Yt===0&&!(e.mode&1)&&(rd=er()+500,xb&&oc()))}function Ai(t,e){var n=t.callbackNode;aY(t,e);var r=$y(t,t===Cr?Ir:0);if(r===0)n!==null&&CR(n),t.callbackNode=null,t.callbackPriority=0;else if(e=r&-r,t.callbackPriority!==e){if(n!=null&&CR(n),e===1)t.tag===0?sX(mP.bind(null,t)):LI(mP.bind(null,t)),nX(function(){!(Yt&6)&&oc()}),n=null;else{switch(uI(r)){case 1:n=qE;break;case 4:n=aI;break;case 16:n=Ly;break;case 536870912:n=lI;break;default:n=Ly}n=D5(n,T5.bind(null,t))}t.callbackPriority=e,t.callbackNode=n}}function T5(t,e){if(ty=-1,ny=0,Yt&6)throw Error(Re(327));var n=t.callbackNode;if(If()&&t.callbackNode!==n)return null;var r=$y(t,t===Cr?Ir:0);if(r===0)return null;if(r&30||r&t.expiredLanes||e)e=e0(t,r);else{e=r;var i=Yt;Yt|=2;var o=O5();(Cr!==t||Ir!==e)&&(wa=null,rd=er()+500,Hc(t,e));do try{TX();break}catch(a){A5(t,a)}while(!0);o_(),Zy.current=o,Yt=i,or!==null?e=0:(Cr=null,Ir=0,e=mr)}if(e!==0){if(e===2&&(i=nC(t),i!==0&&(r=i,e=RC(t,i))),e===1)throw n=Dp,Hc(t,0),wl(t,r),Ai(t,er()),n;if(e===6)wl(t,r);else{if(i=t.current.alternate,!(r&30)&&!EX(i)&&(e=e0(t,r),e===2&&(o=nC(t),o!==0&&(r=o,e=RC(t,o))),e===1))throw n=Dp,Hc(t,0),wl(t,r),Ai(t,er()),n;switch(t.finishedWork=i,t.finishedLanes=r,e){case 0:case 1:throw Error(Re(345));case 2:Sc(t,Si,wa);break;case 3:if(wl(t,r),(r&130023424)===r&&(e=w_+500-er(),10<e)){if($y(t,0)!==0)break;if(i=t.suspendedLanes,(i&r)!==r){ci(),t.pingedLanes|=t.suspendedLanes&i;break}t.timeoutHandle=uC(Sc.bind(null,t,Si,wa),e);break}Sc(t,Si,wa);break;case 4:if(wl(t,r),(r&4194240)===r)break;for(e=t.eventTimes,i=-1;0<r;){var s=31-fs(r);o=1<<s,s=e[s],s>i&&(i=s),r&=~o}if(r=i,r=er()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*kX(r/1960))-r,10<r){t.timeoutHandle=uC(Sc.bind(null,t,Si,wa),r);break}Sc(t,Si,wa);break;case 5:Sc(t,Si,wa);break;default:throw Error(Re(329))}}}return Ai(t,er()),t.callbackNode===n?T5.bind(null,t):null}function RC(t,e){var n=rp;return t.current.memoizedState.isDehydrated&&(Hc(t,e).flags|=256),t=e0(t,e),t!==2&&(e=Si,Si=n,e!==null&&PC(e)),t}function PC(t){Si===null?Si=t:Si.push.apply(Si,t)}function EX(t){for(var e=t;;){if(e.flags&16384){var n=e.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var i=n[r],o=i.getSnapshot;i=i.value;try{if(!gs(o(),i))return!1}catch{return!1}}}if(n=e.child,e.subtreeFlags&16384&&n!==null)n.return=e,e=n;else{if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return!0;e=e.return}e.sibling.return=e.return,e=e.sibling}}return!0}function wl(t,e){for(e&=~b_,e&=~Eb,t.suspendedLanes|=e,t.pingedLanes&=~e,t=t.expirationTimes;0<e;){var n=31-fs(e),r=1<<n;t[n]=-1,e&=~r}}function mP(t){if(Yt&6)throw Error(Re(327));If();var e=$y(t,0);if(!(e&1))return Ai(t,er()),null;var n=e0(t,e);if(t.tag!==0&&n===2){var r=nC(t);r!==0&&(e=r,n=RC(t,r))}if(n===1)throw n=Dp,Hc(t,0),wl(t,e),Ai(t,er()),n;if(n===6)throw Error(Re(345));return t.finishedWork=t.current.alternate,t.finishedLanes=e,Sc(t,Si,wa),Ai(t,er()),null}function x_(t,e){var n=Yt;Yt|=1;try{return t(e)}finally{Yt=n,Yt===0&&(rd=er()+500,xb&&oc())}}function nu(t){kl!==null&&kl.tag===0&&!(Yt&6)&&If();var e=Yt;Yt|=1;var n=No.transition,r=dn;try{if(No.transition=null,dn=1,t)return t()}finally{dn=r,No.transition=n,Yt=e,!(Yt&6)&&oc()}}function S_(){Ki=Cf.current,On(Cf)}function Hc(t,e){t.finishedWork=null,t.finishedLanes=0;var n=t.timeoutHandle;if(n!==-1&&(t.timeoutHandle=-1,tX(n)),or!==null)for(n=or.return;n!==null;){var r=n;switch(n_(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&zy();break;case 3:td(),On(_i),On(Yr),f_();break;case 5:u_(r);break;case 4:td();break;case 13:On(jn);break;case 19:On(jn);break;case 10:s_(r.type._context);break;case 22:case 23:S_()}n=n.return}if(Cr=t,or=t=Il(t.current,null),Ir=Ki=e,mr=0,Dp=null,b_=Eb=tu=0,Si=rp=null,Dc!==null){for(e=0;e<Dc.length;e++)if(n=Dc[e],r=n.interleaved,r!==null){n.interleaved=null;var i=r.next,o=n.pending;if(o!==null){var s=o.next;o.next=i,r.next=s}n.pending=r}Dc=null}return t}function A5(t,e){do{var n=or;try{if(o_(),Qv.current=Xy,Yy){for(var r=Bn.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}Yy=!1}if(eu=0,wr=hr=Bn=null,tp=!1,Pp=0,y_.current=null,n===null||n.return===null){mr=1,Dp=e,or=null;break}e:{var o=t,s=n.return,a=n,l=e;if(e=Ir,a.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var c=l,f=a,d=f.tag;if(!(f.mode&1)&&(d===0||d===11||d===15)){var p=f.alternate;p?(f.updateQueue=p.updateQueue,f.memoizedState=p.memoizedState,f.lanes=p.lanes):(f.updateQueue=null,f.memoizedState=null)}var m=nP(s);if(m!==null){m.flags&=-257,rP(m,s,a,o,e),m.mode&1&&tP(o,c,e),e=m,l=c;var v=e.updateQueue;if(v===null){var b=new Set;b.add(l),e.updateQueue=b}else v.add(l);break e}else{if(!(e&1)){tP(o,c,e),C_();break e}l=Error(Re(426))}}else if(Dn&&a.mode&1){var S=nP(s);if(S!==null){!(S.flags&65536)&&(S.flags|=256),rP(S,s,a,o,e),r_(nd(l,a));break e}}o=l=nd(l,a),mr!==4&&(mr=2),rp===null?rp=[o]:rp.push(o),o=s;do{switch(o.tag){case 3:o.flags|=65536,e&=-e,o.lanes|=e;var x=f5(o,l,e);GR(o,x);break e;case 1:a=l;var w=o.type,C=o.stateNode;if(!(o.flags&128)&&(typeof w.getDerivedStateFromError=="function"||C!==null&&typeof C.componentDidCatch=="function"&&(Ll===null||!Ll.has(C)))){o.flags|=65536,e&=-e,o.lanes|=e;var T=d5(o,a,e);GR(o,T);break e}}o=o.return}while(o!==null)}P5(n)}catch(A){e=A,or===n&&n!==null&&(or=n=n.return);continue}break}while(!0)}function O5(){var t=Zy.current;return Zy.current=Xy,t===null?Xy:t}function C_(){(mr===0||mr===3||mr===2)&&(mr=4),Cr===null||!(tu&268435455)&&!(Eb&268435455)||wl(Cr,Ir)}function e0(t,e){var n=Yt;Yt|=2;var r=O5();(Cr!==t||Ir!==e)&&(wa=null,Hc(t,e));do try{_X();break}catch(i){A5(t,i)}while(!0);if(o_(),Yt=n,Zy.current=r,or!==null)throw Error(Re(261));return Cr=null,Ir=0,mr}function _X(){for(;or!==null;)R5(or)}function TX(){for(;or!==null&&!QG();)R5(or)}function R5(t){var e=M5(t.alternate,t,Ki);t.memoizedProps=t.pendingProps,e===null?P5(t):or=e,y_.current=null}function P5(t){var e=t;do{var n=e.alternate;if(t=e.return,e.flags&32768){if(n=wX(n,e),n!==null){n.flags&=32767,or=n;return}if(t!==null)t.flags|=32768,t.subtreeFlags=0,t.deletions=null;else{mr=6,or=null;return}}else if(n=bX(n,e,Ki),n!==null){or=n;return}if(e=e.sibling,e!==null){or=e;return}or=e=t}while(e!==null);mr===0&&(mr=5)}function Sc(t,e,n){var r=dn,i=No.transition;try{No.transition=null,dn=1,AX(t,e,n,r)}finally{No.transition=i,dn=r}return null}function AX(t,e,n,r){do If();while(kl!==null);if(Yt&6)throw Error(Re(327));n=t.finishedWork;var i=t.finishedLanes;if(n===null)return null;if(t.finishedWork=null,t.finishedLanes=0,n===t.current)throw Error(Re(177));t.callbackNode=null,t.callbackPriority=0;var o=n.lanes|n.childLanes;if(lY(t,o),t===Cr&&(or=Cr=null,Ir=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Jg||(Jg=!0,D5(Ly,function(){return If(),null})),o=(n.flags&15990)!==0,n.subtreeFlags&15990||o){o=No.transition,No.transition=null;var s=dn;dn=1;var a=Yt;Yt|=4,y_.current=null,SX(t,n),E5(n,t),GY(lC),Iy=!!aC,lC=aC=null,t.current=n,CX(n),JG(),Yt=a,dn=s,No.transition=o}else t.current=n;if(Jg&&(Jg=!1,kl=t,Jy=i),o=t.pendingLanes,o===0&&(Ll=null),nY(n.stateNode),Ai(t,er()),e!==null)for(r=t.onRecoverableError,n=0;n<e.length;n++)i=e[n],r(i.value,{componentStack:i.stack,digest:i.digest});if(Qy)throw Qy=!1,t=AC,AC=null,t;return Jy&1&&t.tag!==0&&If(),o=t.pendingLanes,o&1?t===OC?ip++:(ip=0,OC=t):ip=0,oc(),null}function If(){if(kl!==null){var t=uI(Jy),e=No.transition,n=dn;try{if(No.transition=null,dn=16>t?16:t,kl===null)var r=!1;else{if(t=kl,kl=null,Jy=0,Yt&6)throw Error(Re(331));var i=Yt;for(Yt|=4,Qe=t.current;Qe!==null;){var o=Qe,s=o.child;if(Qe.flags&16){var a=o.deletions;if(a!==null){for(var l=0;l<a.length;l++){var c=a[l];for(Qe=c;Qe!==null;){var f=Qe;switch(f.tag){case 0:case 11:case 15:np(8,f,o)}var d=f.child;if(d!==null)d.return=f,Qe=d;else for(;Qe!==null;){f=Qe;var p=f.sibling,m=f.return;if(S5(f),f===c){Qe=null;break}if(p!==null){p.return=m,Qe=p;break}Qe=m}}}var v=o.alternate;if(v!==null){var b=v.child;if(b!==null){v.child=null;do{var S=b.sibling;b.sibling=null,b=S}while(b!==null)}}Qe=o}}if(o.subtreeFlags&2064&&s!==null)s.return=o,Qe=s;else e:for(;Qe!==null;){if(o=Qe,o.flags&2048)switch(o.tag){case 0:case 11:case 15:np(9,o,o.return)}var x=o.sibling;if(x!==null){x.return=o.return,Qe=x;break e}Qe=o.return}}var w=t.current;for(Qe=w;Qe!==null;){s=Qe;var C=s.child;if(s.subtreeFlags&2064&&C!==null)C.return=s,Qe=C;else e:for(s=w;Qe!==null;){if(a=Qe,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:kb(9,a)}}catch(A){Hn(a,a.return,A)}if(a===s){Qe=null;break e}var T=a.sibling;if(T!==null){T.return=a.return,Qe=T;break e}Qe=a.return}}if(Yt=i,oc(),qs&&typeof qs.onPostCommitFiberRoot=="function")try{qs.onPostCommitFiberRoot(gb,t)}catch{}r=!0}return r}finally{dn=n,No.transition=e}}return!1}function gP(t,e,n){e=nd(n,e),e=f5(t,e,1),t=Dl(t,e,1),e=ci(),t!==null&&(Em(t,1,e),Ai(t,e))}function Hn(t,e,n){if(t.tag===3)gP(t,t,n);else for(;e!==null;){if(e.tag===3){gP(e,t,n);break}else if(e.tag===1){var r=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Ll===null||!Ll.has(r))){t=nd(n,t),t=d5(e,t,1),e=Dl(e,t,1),t=ci(),e!==null&&(Em(e,1,t),Ai(e,t));break}}e=e.return}}function OX(t,e,n){var r=t.pingCache;r!==null&&r.delete(e),e=ci(),t.pingedLanes|=t.suspendedLanes&n,Cr===t&&(Ir&n)===n&&(mr===4||mr===3&&(Ir&130023424)===Ir&&500>er()-w_?Hc(t,0):b_|=n),Ai(t,e)}function N5(t,e){e===0&&(t.mode&1?(e=Ug,Ug<<=1,!(Ug&130023424)&&(Ug=4194304)):e=1);var n=ci();t=Da(t,e),t!==null&&(Em(t,e,n),Ai(t,n))}function RX(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),N5(t,n)}function PX(t,e){var n=0;switch(t.tag){case 13:var r=t.stateNode,i=t.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=t.stateNode;break;default:throw Error(Re(314))}r!==null&&r.delete(e),N5(t,n)}var M5;M5=function(t,e,n){if(t!==null)if(t.memoizedProps!==e.pendingProps||_i.current)ki=!0;else{if(!(t.lanes&n)&&!(e.flags&128))return ki=!1,yX(t,e,n);ki=!!(t.flags&131072)}else ki=!1,Dn&&e.flags&1048576&&$I(e,Wy,e.index);switch(e.lanes=0,e.tag){case 2:var r=e.type;ey(t,e),t=e.pendingProps;var i=Qf(e,Yr.current);$f(e,n),i=h_(null,e,r,t,i,n);var o=p_();return e.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,Ti(r)?(o=!0,Vy(e)):o=!1,e.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,l_(e),i.updater=Sb,e.stateNode=i,i._reactInternals=e,vC(e,r,t,n),e=wC(null,e,r,!0,o,n)):(e.tag=0,Dn&&o&&t_(e),si(null,e,i,n),e=e.child),e;case 16:r=e.elementType;e:{switch(ey(t,e),t=e.pendingProps,i=r._init,r=i(r._payload),e.type=r,i=e.tag=MX(r),t=Jo(r,t),i){case 0:e=bC(null,e,r,t,n);break e;case 1:e=sP(null,e,r,t,n);break e;case 11:e=iP(null,e,r,t,n);break e;case 14:e=oP(null,e,r,Jo(r.type,t),n);break e}throw Error(Re(306,r,""))}return e;case 0:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:Jo(r,i),bC(t,e,r,i,n);case 1:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:Jo(r,i),sP(t,e,r,i,n);case 3:e:{if(g5(e),t===null)throw Error(Re(387));r=e.pendingProps,o=e.memoizedState,i=o.element,FI(t,e),Ky(e,r,null,n);var s=e.memoizedState;if(r=s.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},e.updateQueue.baseState=o,e.memoizedState=o,e.flags&256){i=nd(Error(Re(423)),e),e=aP(t,e,r,n,i);break e}else if(r!==i){i=nd(Error(Re(424)),e),e=aP(t,e,r,n,i);break e}else for(Ji=Ml(e.stateNode.containerInfo.firstChild),no=e,Dn=!0,os=null,n=WI(e,null,r,n),e.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Jf(),r===i){e=La(t,e,n);break e}si(t,e,r,n)}e=e.child}return e;case 5:return HI(e),t===null&&pC(e),r=e.type,i=e.pendingProps,o=t!==null?t.memoizedProps:null,s=i.children,cC(r,i)?s=null:o!==null&&cC(r,o)&&(e.flags|=32),m5(t,e),si(t,e,s,n),e.child;case 6:return t===null&&pC(e),null;case 13:return v5(t,e,n);case 4:return c_(e,e.stateNode.containerInfo),r=e.pendingProps,t===null?e.child=ed(e,null,r,n):si(t,e,r,n),e.child;case 11:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:Jo(r,i),iP(t,e,r,i,n);case 7:return si(t,e,e.pendingProps,n),e.child;case 8:return si(t,e,e.pendingProps.children,n),e.child;case 12:return si(t,e,e.pendingProps.children,n),e.child;case 10:e:{if(r=e.type._context,i=e.pendingProps,o=e.memoizedProps,s=i.value,wn(Hy,r._currentValue),r._currentValue=s,o!==null)if(gs(o.value,s)){if(o.children===i.children&&!_i.current){e=La(t,e,n);break e}}else for(o=e.child,o!==null&&(o.return=e);o!==null;){var a=o.dependencies;if(a!==null){s=o.child;for(var l=a.firstContext;l!==null;){if(l.context===r){if(o.tag===1){l=Ta(-1,n&-n),l.tag=2;var c=o.updateQueue;if(c!==null){c=c.shared;var f=c.pending;f===null?l.next=l:(l.next=f.next,f.next=l),c.pending=l}}o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),mC(o.return,n,e),a.lanes|=n;break}l=l.next}}else if(o.tag===10)s=o.type===e.type?null:o.child;else if(o.tag===18){if(s=o.return,s===null)throw Error(Re(341));s.lanes|=n,a=s.alternate,a!==null&&(a.lanes|=n),mC(s,n,e),s=o.sibling}else s=o.child;if(s!==null)s.return=o;else for(s=o;s!==null;){if(s===e){s=null;break}if(o=s.sibling,o!==null){o.return=s.return,s=o;break}s=s.return}o=s}si(t,e,i.children,n),e=e.child}return e;case 9:return i=e.type,r=e.pendingProps.children,$f(e,n),i=$o(i),r=r(i),e.flags|=1,si(t,e,r,n),e.child;case 14:return r=e.type,i=Jo(r,e.pendingProps),i=Jo(r.type,i),oP(t,e,r,i,n);case 15:return h5(t,e,e.type,e.pendingProps,n);case 17:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:Jo(r,i),ey(t,e),e.tag=1,Ti(r)?(t=!0,Vy(e)):t=!1,$f(e,n),VI(e,r,i),vC(e,r,i,n),wC(null,e,r,!0,t,n);case 19:return y5(t,e,n);case 22:return p5(t,e,n)}throw Error(Re(156,e.tag))};function D5(t,e){return sI(t,e)}function NX(t,e,n,r){this.tag=t,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ro(t,e,n,r){return new NX(t,e,n,r)}function k_(t){return t=t.prototype,!(!t||!t.isReactComponent)}function MX(t){if(typeof t=="function")return k_(t)?1:0;if(t!=null){if(t=t.$$typeof,t===UE)return 11;if(t===WE)return 14}return 2}function Il(t,e){var n=t.alternate;return n===null?(n=Ro(t.tag,e,t.key,t.mode),n.elementType=t.elementType,n.type=t.type,n.stateNode=t.stateNode,n.alternate=t,t.alternate=n):(n.pendingProps=e,n.type=t.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=t.flags&14680064,n.childLanes=t.childLanes,n.lanes=t.lanes,n.child=t.child,n.memoizedProps=t.memoizedProps,n.memoizedState=t.memoizedState,n.updateQueue=t.updateQueue,e=t.dependencies,n.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},n.sibling=t.sibling,n.index=t.index,n.ref=t.ref,n}function ry(t,e,n,r,i,o){var s=2;if(r=t,typeof t=="function")k_(t)&&(s=1);else if(typeof t=="string")s=5;else e:switch(t){case hf:return qc(n.children,i,o,e);case VE:s=8,i|=8;break;case zS:return t=Ro(12,n,e,i|2),t.elementType=zS,t.lanes=o,t;case VS:return t=Ro(13,n,e,i),t.elementType=VS,t.lanes=o,t;case US:return t=Ro(19,n,e,i),t.elementType=US,t.lanes=o,t;case U$:return _b(n,i,o,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case z$:s=10;break e;case V$:s=9;break e;case UE:s=11;break e;case WE:s=14;break e;case ml:s=16,r=null;break e}throw Error(Re(130,t==null?t:typeof t,""))}return e=Ro(s,n,e,i),e.elementType=t,e.type=r,e.lanes=o,e}function qc(t,e,n,r){return t=Ro(7,t,r,e),t.lanes=n,t}function _b(t,e,n,r){return t=Ro(22,t,r,e),t.elementType=U$,t.lanes=n,t.stateNode={isHidden:!1},t}function bx(t,e,n){return t=Ro(6,t,null,e),t.lanes=n,t}function wx(t,e,n){return e=Ro(4,t.children!==null?t.children:[],t.key,e),e.lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function DX(t,e,n,r,i){this.tag=e,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=ex(0),this.expirationTimes=ex(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ex(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function E_(t,e,n,r,i,o,s,a,l){return t=new DX(t,e,n,a,l),e===1?(e=1,o===!0&&(e|=8)):e=0,o=Ro(3,null,null,e),t.current=o,o.stateNode=t,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},l_(o),t}function LX(t,e,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:df,key:r==null?null:""+r,children:t,containerInfo:e,implementation:n}}function L5(t){if(!t)return Ul;t=t._reactInternals;e:{if(ku(t)!==t||t.tag!==1)throw Error(Re(170));var e=t;do{switch(e.tag){case 3:e=e.stateNode.context;break e;case 1:if(Ti(e.type)){e=e.stateNode.__reactInternalMemoizedMergedChildContext;break e}}e=e.return}while(e!==null);throw Error(Re(171))}if(t.tag===1){var n=t.type;if(Ti(n))return DI(t,n,e)}return e}function $5(t,e,n,r,i,o,s,a,l){return t=E_(n,r,!0,t,i,o,s,a,l),t.context=L5(null),n=t.current,r=ci(),i=$l(n),o=Ta(r,i),o.callback=e??null,Dl(n,o,i),t.current.lanes=i,Em(t,i,r),Ai(t,r),t}function Tb(t,e,n,r){var i=e.current,o=ci(),s=$l(i);return n=L5(n),e.context===null?e.context=n:e.pendingContext=n,e=Ta(o,s),e.payload={element:t},r=r===void 0?null:r,r!==null&&(e.callback=r),t=Dl(i,e,s),t!==null&&(ds(t,i,s,o),Zv(t,i,s)),s}function t0(t){if(t=t.current,!t.child)return null;switch(t.child.tag){case 5:return t.child.stateNode;default:return t.child.stateNode}}function vP(t,e){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var n=t.retryLane;t.retryLane=n!==0&&n<e?n:e}}function __(t,e){vP(t,e),(t=t.alternate)&&vP(t,e)}function $X(){return null}var I5=typeof reportError=="function"?reportError:function(t){console.error(t)};function T_(t){this._internalRoot=t}Ab.prototype.render=T_.prototype.render=function(t){var e=this._internalRoot;if(e===null)throw Error(Re(409));Tb(t,e,null,null)};Ab.prototype.unmount=T_.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var e=t.containerInfo;nu(function(){Tb(null,t,null,null)}),e[Ma]=null}};function Ab(t){this._internalRoot=t}Ab.prototype.unstable_scheduleHydration=function(t){if(t){var e=hI();t={blockedOn:null,target:t,priority:e};for(var n=0;n<bl.length&&e!==0&&e<bl[n].priority;n++);bl.splice(n,0,t),n===0&&mI(t)}};function A_(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function Ob(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11&&(t.nodeType!==8||t.nodeValue!==" react-mount-point-unstable "))}function yP(){}function IX(t,e,n,r,i){if(i){if(typeof r=="function"){var o=r;r=function(){var c=t0(s);o.call(c)}}var s=$5(e,r,t,0,null,!1,!1,"",yP);return t._reactRootContainer=s,t[Ma]=s.current,_p(t.nodeType===8?t.parentNode:t),nu(),s}for(;i=t.lastChild;)t.removeChild(i);if(typeof r=="function"){var a=r;r=function(){var c=t0(l);a.call(c)}}var l=E_(t,0,!1,null,null,!1,!1,"",yP);return t._reactRootContainer=l,t[Ma]=l.current,_p(t.nodeType===8?t.parentNode:t),nu(function(){Tb(e,l,n,r)}),l}function Rb(t,e,n,r,i){var o=n._reactRootContainer;if(o){var s=o;if(typeof i=="function"){var a=i;i=function(){var l=t0(s);a.call(l)}}Tb(e,s,t,i)}else s=IX(n,e,t,i,r);return t0(s)}fI=function(t){switch(t.tag){case 3:var e=t.stateNode;if(e.current.memoizedState.isDehydrated){var n=Bh(e.pendingLanes);n!==0&&(KE(e,n|1),Ai(e,er()),!(Yt&6)&&(rd=er()+500,oc()))}break;case 13:nu(function(){var r=Da(t,1);if(r!==null){var i=ci();ds(r,t,1,i)}}),__(t,1)}};GE=function(t){if(t.tag===13){var e=Da(t,134217728);if(e!==null){var n=ci();ds(e,t,134217728,n)}__(t,134217728)}};dI=function(t){if(t.tag===13){var e=$l(t),n=Da(t,e);if(n!==null){var r=ci();ds(n,t,e,r)}__(t,e)}};hI=function(){return dn};pI=function(t,e){var n=dn;try{return dn=t,e()}finally{dn=n}};JS=function(t,e,n){switch(e){case"input":if(qS(t,n),e=n.name,n.type==="radio"&&e!=null){for(n=t;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+e)+'][type="radio"]'),e=0;e<n.length;e++){var r=n[e];if(r!==t&&r.form===t.form){var i=wb(r);if(!i)throw Error(Re(90));H$(r),qS(r,i)}}}break;case"textarea":K$(t,n);break;case"select":e=n.value,e!=null&&Nf(t,!!n.multiple,e,!1)}};eI=x_;tI=nu;var jX={usingClientEntryPoint:!1,Events:[Tm,vf,wb,Q$,J$,x_]},mh={findFiberByHostInstance:Mc,bundleType:0,version:"18.2.0",rendererPackageName:"react-dom"},BX={bundleType:mh.bundleType,version:mh.version,rendererPackageName:mh.rendererPackageName,rendererConfig:mh.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Ha.ReactCurrentDispatcher,findHostInstanceByFiber:function(t){return t=iI(t),t===null?null:t.stateNode},findFiberByHostInstance:mh.findFiberByHostInstance||$X,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.2.0-next-9e3b772b8-20220608"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var ev=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ev.isDisabled&&ev.supportsFiber)try{gb=ev.inject(BX),qs=ev}catch{}}ao.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=jX;ao.createPortal=function(t,e){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!A_(e))throw Error(Re(200));return LX(t,e,null,n)};ao.createRoot=function(t,e){if(!A_(t))throw Error(Re(299));var n=!1,r="",i=I5;return e!=null&&(e.unstable_strictMode===!0&&(n=!0),e.identifierPrefix!==void 0&&(r=e.identifierPrefix),e.onRecoverableError!==void 0&&(i=e.onRecoverableError)),e=E_(t,1,!1,null,null,n,!1,r,i),t[Ma]=e.current,_p(t.nodeType===8?t.parentNode:t),new T_(e)};ao.findDOMNode=function(t){if(t==null)return null;if(t.nodeType===1)return t;var e=t._reactInternals;if(e===void 0)throw typeof t.render=="function"?Error(Re(188)):(t=Object.keys(t).join(","),Error(Re(268,t)));return t=iI(e),t=t===null?null:t.stateNode,t};ao.flushSync=function(t){return nu(t)};ao.hydrate=function(t,e,n){if(!Ob(e))throw Error(Re(200));return Rb(null,t,e,!0,n)};ao.hydrateRoot=function(t,e,n){if(!A_(t))throw Error(Re(405));var r=n!=null&&n.hydratedSources||null,i=!1,o="",s=I5;if(n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(o=n.identifierPrefix),n.onRecoverableError!==void 0&&(s=n.onRecoverableError)),e=$5(e,null,t,1,n??null,i,!1,o,s),t[Ma]=e.current,_p(t),r)for(t=0;t<r.length;t++)n=r[t],i=n._getVersion,i=i(n._source),e.mutableSourceEagerHydrationData==null?e.mutableSourceEagerHydrationData=[n,i]:e.mutableSourceEagerHydrationData.push(n,i);return new Ab(e)};ao.render=function(t,e,n){if(!Ob(e))throw Error(Re(200));return Rb(null,t,e,!1,n)};ao.unmountComponentAtNode=function(t){if(!Ob(t))throw Error(Re(40));return t._reactRootContainer?(nu(function(){Rb(null,null,t,!1,function(){t._reactRootContainer=null,t[Ma]=null})}),!0):!1};ao.unstable_batchedUpdates=x_;ao.unstable_renderSubtreeIntoContainer=function(t,e,n,r){if(!Ob(n))throw Error(Re(200));if(t==null||t._reactInternals===void 0)throw Error(Re(38));return Rb(t,e,n,!1,r)};ao.version="18.2.0-next-9e3b772b8-20220608";function j5(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(j5)}catch(t){console.error(t)}}j5(),$$.exports=ao;var na=$$.exports;const O_=Su(na),FX=E$({__proto__:null,default:O_},[na]);var bP=na;BS.createRoot=bP.createRoot,BS.hydrateRoot=bP.hydrateRoot;/**
41
+ * @remix-run/router v1.15.0
42
+ *
43
+ * Copyright (c) Remix Software Inc.
44
+ *
45
+ * This source code is licensed under the MIT license found in the
46
+ * LICENSE.md file in the root directory of this source tree.
47
+ *
48
+ * @license MIT
49
+ */function qn(){return qn=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},qn.apply(this,arguments)}var Qn;(function(t){t.Pop="POP",t.Push="PUSH",t.Replace="REPLACE"})(Qn||(Qn={}));const wP="popstate";function zX(t){t===void 0&&(t={});function e(r,i){let{pathname:o,search:s,hash:a}=r.location;return Lp("",{pathname:o,search:s,hash:a},i.state&&i.state.usr||null,i.state&&i.state.key||"default")}function n(r,i){return typeof i=="string"?i:iu(i)}return UX(e,n,null,t)}function jt(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function ru(t,e){if(!t){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function VX(){return Math.random().toString(36).substr(2,8)}function xP(t,e){return{usr:t.state,key:t.key,idx:e}}function Lp(t,e,n,r){return n===void 0&&(n=null),qn({pathname:typeof t=="string"?t:t.pathname,search:"",hash:""},typeof e=="string"?qa(e):e,{state:n,key:e&&e.key||r||VX()})}function iu(t){let{pathname:e="/",search:n="",hash:r=""}=t;return n&&n!=="?"&&(e+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(e+=r.charAt(0)==="#"?r:"#"+r),e}function qa(t){let e={};if(t){let n=t.indexOf("#");n>=0&&(e.hash=t.substr(n),t=t.substr(0,n));let r=t.indexOf("?");r>=0&&(e.search=t.substr(r),t=t.substr(0,r)),t&&(e.pathname=t)}return e}function UX(t,e,n,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:o=!1}=r,s=i.history,a=Qn.Pop,l=null,c=f();c==null&&(c=0,s.replaceState(qn({},s.state,{idx:c}),""));function f(){return(s.state||{idx:null}).idx}function d(){a=Qn.Pop;let S=f(),x=S==null?null:S-c;c=S,l&&l({action:a,location:b.location,delta:x})}function p(S,x){a=Qn.Push;let w=Lp(b.location,S,x);n&&n(w,S),c=f()+1;let C=xP(w,c),T=b.createHref(w);try{s.pushState(C,"",T)}catch(A){if(A instanceof DOMException&&A.name==="DataCloneError")throw A;i.location.assign(T)}o&&l&&l({action:a,location:b.location,delta:1})}function m(S,x){a=Qn.Replace;let w=Lp(b.location,S,x);n&&n(w,S),c=f();let C=xP(w,c),T=b.createHref(w);s.replaceState(C,"",T),o&&l&&l({action:a,location:b.location,delta:0})}function v(S){let x=i.location.origin!=="null"?i.location.origin:i.location.href,w=typeof S=="string"?S:iu(S);return jt(x,"No window.location.(origin|href) available to create URL for href: "+w),new URL(w,x)}let b={get action(){return a},get location(){return t(i,s)},listen(S){if(l)throw new Error("A history only accepts one active listener");return i.addEventListener(wP,d),l=S,()=>{i.removeEventListener(wP,d),l=null}},createHref(S){return e(i,S)},createURL:v,encodeLocation(S){let x=v(S);return{pathname:x.pathname,search:x.search,hash:x.hash}},push:p,replace:m,go(S){return s.go(S)}};return b}var Wn;(function(t){t.data="data",t.deferred="deferred",t.redirect="redirect",t.error="error"})(Wn||(Wn={}));const WX=new Set(["lazy","caseSensitive","path","id","index","children"]);function HX(t){return t.index===!0}function NC(t,e,n,r){return n===void 0&&(n=[]),r===void 0&&(r={}),t.map((i,o)=>{let s=[...n,o],a=typeof i.id=="string"?i.id:s.join("-");if(jt(i.index!==!0||!i.children,"Cannot specify children on an index route"),jt(!r[a],'Found a route id collision on id "'+a+`". Route id's must be globally unique within Data Router usages`),HX(i)){let l=qn({},i,e(i),{id:a});return r[a]=l,l}else{let l=qn({},i,e(i),{id:a,children:void 0});return r[a]=l,i.children&&(l.children=NC(i.children,e,s,r)),l}})}function kf(t,e,n){n===void 0&&(n="/");let r=typeof e=="string"?qa(e):e,i=kd(r.pathname||"/",n);if(i==null)return null;let o=B5(t);KX(o);let s=null;for(let a=0;s==null&&a<o.length;++a)s=nZ(o[a],oZ(i));return s}function qX(t,e){let{route:n,pathname:r,params:i}=t;return{id:n.id,pathname:r,params:i,data:e[n.id],handle:n.handle}}function B5(t,e,n,r){e===void 0&&(e=[]),n===void 0&&(n=[]),r===void 0&&(r="");let i=(o,s,a)=>{let l={relativePath:a===void 0?o.path||"":a,caseSensitive:o.caseSensitive===!0,childrenIndex:s,route:o};l.relativePath.startsWith("/")&&(jt(l.relativePath.startsWith(r),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(r.length));let c=Aa([r,l.relativePath]),f=n.concat(l);o.children&&o.children.length>0&&(jt(o.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+c+'".')),B5(o.children,e,f,c)),!(o.path==null&&!o.index)&&e.push({path:c,score:eZ(c,o.index),routesMeta:f})};return t.forEach((o,s)=>{var a;if(o.path===""||!((a=o.path)!=null&&a.includes("?")))i(o,s);else for(let l of F5(o.path))i(o,s,l)}),e}function F5(t){let e=t.split("/");if(e.length===0)return[];let[n,...r]=e,i=n.endsWith("?"),o=n.replace(/\?$/,"");if(r.length===0)return i?[o,""]:[o];let s=F5(r.join("/")),a=[];return a.push(...s.map(l=>l===""?o:[o,l].join("/"))),i&&a.push(...s),a.map(l=>t.startsWith("/")&&l===""?"/":l)}function KX(t){t.sort((e,n)=>e.score!==n.score?n.score-e.score:tZ(e.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const GX=/^:[\w-]+$/,YX=3,XX=2,ZX=1,QX=10,JX=-2,SP=t=>t==="*";function eZ(t,e){let n=t.split("/"),r=n.length;return n.some(SP)&&(r+=JX),e&&(r+=XX),n.filter(i=>!SP(i)).reduce((i,o)=>i+(GX.test(o)?YX:o===""?ZX:QX),r)}function tZ(t,e){return t.length===e.length&&t.slice(0,-1).every((r,i)=>r===e[i])?t[t.length-1]-e[e.length-1]:0}function nZ(t,e){let{routesMeta:n}=t,r={},i="/",o=[];for(let s=0;s<n.length;++s){let a=n[s],l=s===n.length-1,c=i==="/"?e:e.slice(i.length)||"/",f=rZ({path:a.relativePath,caseSensitive:a.caseSensitive,end:l},c);if(!f)return null;Object.assign(r,f.params);let d=a.route;o.push({params:r,pathname:Aa([i,f.pathname]),pathnameBase:cZ(Aa([i,f.pathnameBase])),route:d}),f.pathnameBase!=="/"&&(i=Aa([i,f.pathnameBase]))}return o}function rZ(t,e){typeof t=="string"&&(t={path:t,caseSensitive:!1,end:!0});let[n,r]=iZ(t.path,t.caseSensitive,t.end),i=e.match(n);if(!i)return null;let o=i[0],s=o.replace(/(.)\/+$/,"$1"),a=i.slice(1);return{params:r.reduce((c,f,d)=>{let{paramName:p,isOptional:m}=f;if(p==="*"){let b=a[d]||"";s=o.slice(0,o.length-b.length).replace(/(.)\/+$/,"$1")}const v=a[d];return m&&!v?c[p]=void 0:c[p]=sZ(v||"",p),c},{}),pathname:o,pathnameBase:s,pattern:t}}function iZ(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!0),ru(t==="*"||!t.endsWith("*")||t.endsWith("/*"),'Route path "'+t+'" will be treated as if it were '+('"'+t.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+t.replace(/\*$/,"/*")+'".'));let r=[],i="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(s,a,l)=>(r.push({paramName:a,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return t.endsWith("*")?(r.push({paramName:"*"}),i+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":t!==""&&t!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,e?void 0:"i"),r]}function oZ(t){try{return decodeURI(t)}catch(e){return ru(!1,'The URL path "'+t+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+e+").")),t}}function sZ(t,e){try{return decodeURIComponent(t)}catch(n){return ru(!1,'The value for the URL param "'+e+'" will not be decoded because'+(' the string "'+t+'" is a malformed URL segment. This is probably')+(" due to a bad percent encoding ("+n+").")),t}}function kd(t,e){if(e==="/")return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let n=e.endsWith("/")?e.length-1:e.length,r=t.charAt(n);return r&&r!=="/"?null:t.slice(n)||"/"}function aZ(t,e){e===void 0&&(e="/");let{pathname:n,search:r="",hash:i=""}=typeof t=="string"?qa(t):t;return{pathname:n?n.startsWith("/")?n:lZ(n,e):e,search:uZ(r),hash:fZ(i)}}function lZ(t,e){let n=e.replace(/\/+$/,"").split("/");return t.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function xx(t,e,n,r){return"Cannot include a '"+t+"' character in a manually specified "+("`to."+e+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function z5(t){return t.filter((e,n)=>n===0||e.route.path&&e.route.path.length>0)}function R_(t,e){let n=z5(t);return e?n.map((r,i)=>i===t.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function P_(t,e,n,r){r===void 0&&(r=!1);let i;typeof t=="string"?i=qa(t):(i=qn({},t),jt(!i.pathname||!i.pathname.includes("?"),xx("?","pathname","search",i)),jt(!i.pathname||!i.pathname.includes("#"),xx("#","pathname","hash",i)),jt(!i.search||!i.search.includes("#"),xx("#","search","hash",i)));let o=t===""||i.pathname==="",s=o?"/":i.pathname,a;if(s==null)a=n;else{let d=e.length-1;if(!r&&s.startsWith("..")){let p=s.split("/");for(;p[0]==="..";)p.shift(),d-=1;i.pathname=p.join("/")}a=d>=0?e[d]:"/"}let l=aZ(i,a),c=s&&s!=="/"&&s.endsWith("/"),f=(o||s===".")&&n.endsWith("/");return!l.pathname.endsWith("/")&&(c||f)&&(l.pathname+="/"),l}const Aa=t=>t.join("/").replace(/\/\/+/g,"/"),cZ=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),uZ=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,fZ=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t;class N_{constructor(e,n,r,i){i===void 0&&(i=!1),this.status=e,this.statusText=n||"",this.internal=i,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}}function V5(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}const U5=["post","put","patch","delete"],dZ=new Set(U5),hZ=["get",...U5],pZ=new Set(hZ),mZ=new Set([301,302,303,307,308]),gZ=new Set([307,308]),Sx={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},vZ={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},gh={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},W5=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,yZ=t=>({hasErrorBoundary:!!t.hasErrorBoundary}),H5="remix-router-transitions";function bZ(t){const e=t.window?t.window:typeof window<"u"?window:void 0,n=typeof e<"u"&&typeof e.document<"u"&&typeof e.document.createElement<"u",r=!n;jt(t.routes.length>0,"You must provide a non-empty routes array to createRouter");let i;if(t.mapRouteProperties)i=t.mapRouteProperties;else if(t.detectErrorBoundary){let Y=t.detectErrorBoundary;i=te=>({hasErrorBoundary:Y(te)})}else i=yZ;let o={},s=NC(t.routes,i,void 0,o),a,l=t.basename||"/",c=qn({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1},t.future),f=null,d=new Set,p=null,m=null,v=null,b=t.hydrationData!=null,S=kf(s,t.history.location,l),x=null;if(S==null){let Y=So(404,{pathname:t.history.location.pathname}),{matches:te,route:pe}=RP(s);S=te,x={[pe.id]:Y}}let w,C=S.some(Y=>Y.route.lazy),T=S.some(Y=>Y.route.loader);if(C)w=!1;else if(!T)w=!0;else if(c.v7_partialHydration){let Y=t.hydrationData?t.hydrationData.loaderData:null,te=t.hydrationData?t.hydrationData.errors:null;w=S.every(pe=>pe.route.loader&&pe.route.loader.hydrate!==!0&&(Y&&Y[pe.route.id]!==void 0||te&&te[pe.route.id]!==void 0))}else w=t.hydrationData!=null;let A,_={historyAction:t.history.action,location:t.history.location,matches:S,initialized:w,navigation:Sx,restoreScrollPosition:t.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:t.hydrationData&&t.hydrationData.loaderData||{},actionData:t.hydrationData&&t.hydrationData.actionData||null,errors:t.hydrationData&&t.hydrationData.errors||x,fetchers:new Map,blockers:new Map},R=Qn.Pop,M=!1,I,V=!1,U=new Map,L=null,G=!1,K=!1,F=[],ie=[],ae=new Map,re=0,W=-1,P=new Map,he=new Set,fe=new Map,$=new Map,Ne=new Set,He=new Map,Ye=new Map,Ie=!1;function J(){if(f=t.history.listen(Y=>{let{action:te,location:pe,delta:Me}=Y;if(Ie){Ie=!1;return}ru(Ye.size===0||Me!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let Ue=Kt({currentLocation:_.location,nextLocation:pe,historyAction:te});if(Ue&&Me!=null){Ie=!0,t.history.go(Me*-1),Lt(Ue,{state:"blocked",location:pe,proceed(){Lt(Ue,{state:"proceeding",proceed:void 0,reset:void 0,location:pe}),t.history.go(Me)},reset(){let at=new Map(_.blockers);at.set(Ue,gh),ke({blockers:at})}});return}return we(te,pe)}),n){RZ(e,U);let Y=()=>PZ(e,U);e.addEventListener("pagehide",Y),L=()=>e.removeEventListener("pagehide",Y)}return _.initialized||we(Qn.Pop,_.location,{initialHydration:!0}),A}function Se(){f&&f(),L&&L(),d.clear(),I&&I.abort(),_.fetchers.forEach((Y,te)=>de(te)),_.blockers.forEach((Y,te)=>sn(te))}function Ee(Y){return d.add(Y),()=>d.delete(Y)}function ke(Y,te){te===void 0&&(te={}),_=qn({},_,Y);let pe=[],Me=[];c.v7_fetcherPersist&&_.fetchers.forEach((Ue,at)=>{Ue.state==="idle"&&(Ne.has(at)?Me.push(at):pe.push(at))}),[...d].forEach(Ue=>Ue(_,{deletedFetchers:Me,unstable_viewTransitionOpts:te.viewTransitionOpts,unstable_flushSync:te.flushSync===!0})),c.v7_fetcherPersist&&(pe.forEach(Ue=>_.fetchers.delete(Ue)),Me.forEach(Ue=>de(Ue)))}function oe(Y,te,pe){var Me,Ue;let{flushSync:at}=pe===void 0?{}:pe,it=_.actionData!=null&&_.navigation.formMethod!=null&&rs(_.navigation.formMethod)&&_.navigation.state==="loading"&&((Me=Y.state)==null?void 0:Me._isRedirect)!==!0,st;te.actionData?Object.keys(te.actionData).length>0?st=te.actionData:st=null:it?st=_.actionData:st=null;let qe=te.loaderData?OP(_.loaderData,te.loaderData,te.matches||[],te.errors):_.loaderData,pt=_.blockers;pt.size>0&&(pt=new Map(pt),pt.forEach((Nt,rn)=>pt.set(rn,gh)));let qt=M===!0||_.navigation.formMethod!=null&&rs(_.navigation.formMethod)&&((Ue=Y.state)==null?void 0:Ue._isRedirect)!==!0;a&&(s=a,a=void 0),G||R===Qn.Pop||(R===Qn.Push?t.history.push(Y,Y.state):R===Qn.Replace&&t.history.replace(Y,Y.state));let lt;if(R===Qn.Pop){let Nt=U.get(_.location.pathname);Nt&&Nt.has(Y.pathname)?lt={currentLocation:_.location,nextLocation:Y}:U.has(Y.pathname)&&(lt={currentLocation:Y,nextLocation:_.location})}else if(V){let Nt=U.get(_.location.pathname);Nt?Nt.add(Y.pathname):(Nt=new Set([Y.pathname]),U.set(_.location.pathname,Nt)),lt={currentLocation:_.location,nextLocation:Y}}ke(qn({},te,{actionData:st,loaderData:qe,historyAction:R,location:Y,initialized:!0,navigation:Sx,revalidation:"idle",restoreScrollPosition:kr(Y,te.matches||_.matches),preventScrollReset:qt,blockers:pt}),{viewTransitionOpts:lt,flushSync:at===!0}),R=Qn.Pop,M=!1,V=!1,G=!1,K=!1,F=[],ie=[]}async function se(Y,te){if(typeof Y=="number"){t.history.go(Y);return}let pe=MC(_.location,_.matches,l,c.v7_prependBasename,Y,c.v7_relativeSplatPath,te==null?void 0:te.fromRouteId,te==null?void 0:te.relative),{path:Me,submission:Ue,error:at}=CP(c.v7_normalizeFormMethod,!1,pe,te),it=_.location,st=Lp(_.location,Me,te&&te.state);st=qn({},st,t.history.encodeLocation(st));let qe=te&&te.replace!=null?te.replace:void 0,pt=Qn.Push;qe===!0?pt=Qn.Replace:qe===!1||Ue!=null&&rs(Ue.formMethod)&&Ue.formAction===_.location.pathname+_.location.search&&(pt=Qn.Replace);let qt=te&&"preventScrollReset"in te?te.preventScrollReset===!0:void 0,lt=(te&&te.unstable_flushSync)===!0,Nt=Kt({currentLocation:it,nextLocation:st,historyAction:pt});if(Nt){Lt(Nt,{state:"blocked",location:st,proceed(){Lt(Nt,{state:"proceeding",proceed:void 0,reset:void 0,location:st}),se(Y,te)},reset(){let rn=new Map(_.blockers);rn.set(Nt,gh),ke({blockers:rn})}});return}return await we(pt,st,{submission:Ue,pendingError:at,preventScrollReset:qt,replace:te&&te.replace,enableViewTransition:te&&te.unstable_viewTransition,flushSync:lt})}function ue(){if(_e(),ke({revalidation:"loading"}),_.navigation.state!=="submitting"){if(_.navigation.state==="idle"){we(_.historyAction,_.location,{startUninterruptedRevalidation:!0});return}we(R||_.historyAction,_.navigation.location,{overrideNavigation:_.navigation})}}async function we(Y,te,pe){I&&I.abort(),I=null,R=Y,G=(pe&&pe.startUninterruptedRevalidation)===!0,Li(_.location,_.matches),M=(pe&&pe.preventScrollReset)===!0,V=(pe&&pe.enableViewTransition)===!0;let Me=a||s,Ue=pe&&pe.overrideNavigation,at=kf(Me,te,l),it=(pe&&pe.flushSync)===!0;if(!at){let rn=So(404,{pathname:te.pathname}),{matches:zr,route:zn}=RP(Me);Pt(),oe(te,{matches:zr,loaderData:{},errors:{[zn.id]:rn}},{flushSync:it});return}if(_.initialized&&!K&&kZ(_.location,te)&&!(pe&&pe.submission&&rs(pe.submission.formMethod))){oe(te,{matches:at},{flushSync:it});return}I=new AbortController;let st=yh(t.history,te,I.signal,pe&&pe.submission),qe,pt;if(pe&&pe.pendingError)pt={[op(at).route.id]:pe.pendingError};else if(pe&&pe.submission&&rs(pe.submission.formMethod)){let rn=await nt(st,te,pe.submission,at,{replace:pe.replace,flushSync:it});if(rn.shortCircuited)return;qe=rn.pendingActionData,pt=rn.pendingActionError,Ue=Cx(te,pe.submission),it=!1,st=new Request(st.url,{signal:st.signal})}let{shortCircuited:qt,loaderData:lt,errors:Nt}=await et(st,te,at,Ue,pe&&pe.submission,pe&&pe.fetcherSubmission,pe&&pe.replace,pe&&pe.initialHydration===!0,it,qe,pt);qt||(I=null,oe(te,qn({matches:at},qe?{actionData:qe}:{},{loaderData:lt,errors:Nt})))}async function nt(Y,te,pe,Me,Ue){Ue===void 0&&(Ue={}),_e();let at=AZ(te,pe);ke({navigation:at},{flushSync:Ue.flushSync===!0});let it,st=LC(Me,te);if(!st.route.action&&!st.route.lazy)it={type:Wn.error,error:So(405,{method:Y.method,pathname:te.pathname,routeId:st.route.id})};else if(it=await vh("action",Y,st,Me,o,i,l,c.v7_relativeSplatPath),Y.signal.aborted)return{shortCircuited:!0};if(Ic(it)){let qe;return Ue&&Ue.replace!=null?qe=Ue.replace:qe=it.location===_.location.pathname+_.location.search,await X(_,it,{submission:pe,replace:qe}),{shortCircuited:!0}}if(Ef(it)){let qe=op(Me,st.route.id);return(Ue&&Ue.replace)!==!0&&(R=Qn.Push),{pendingActionData:{},pendingActionError:{[qe.route.id]:it.error}}}if($c(it))throw So(400,{type:"defer-action"});return{pendingActionData:{[st.route.id]:it.data}}}async function et(Y,te,pe,Me,Ue,at,it,st,qe,pt,qt){let lt=Me||Cx(te,Ue),Nt=Ue||at||MP(lt),rn=a||s,[zr,zn]=kP(t.history,_,pe,Nt,te,c.v7_partialHydration&&st===!0,K,F,ie,Ne,fe,he,rn,l,pt,qt);if(Pt(Vt=>!(pe&&pe.some(an=>an.route.id===Vt))||zr&&zr.some(an=>an.route.id===Vt)),W=++re,zr.length===0&&zn.length===0){let Vt=je();return oe(te,qn({matches:pe,loaderData:{},errors:qt||null},pt?{actionData:pt}:{},Vt?{fetchers:new Map(_.fetchers)}:{}),{flushSync:qe}),{shortCircuited:!0}}if(!G&&(!c.v7_partialHydration||!st)){zn.forEach(an=>{let _r=_.fetchers.get(an.key),Za=bh(void 0,_r?_r.data:void 0);_.fetchers.set(an.key,Za)});let Vt=pt||_.actionData;ke(qn({navigation:lt},Vt?Object.keys(Vt).length===0?{actionData:null}:{actionData:Vt}:{},zn.length>0?{fetchers:new Map(_.fetchers)}:{}),{flushSync:qe})}zn.forEach(Vt=>{ae.has(Vt.key)&&Be(Vt.key),Vt.controller&&ae.set(Vt.key,Vt.controller)});let Vn=()=>zn.forEach(Vt=>Be(Vt.key));I&&I.signal.addEventListener("abort",Vn);let{results:cr,loaderResults:Yn,fetcherResults:Pn}=await ne(_.matches,pe,zr,zn,Y);if(Y.signal.aborted)return{shortCircuited:!0};I&&I.signal.removeEventListener("abort",Vn),zn.forEach(Vt=>ae.delete(Vt.key));let $i=PP(cr);if($i){if($i.idx>=zr.length){let Vt=zn[$i.idx-zr.length].key;he.add(Vt)}return await X(_,$i.result,{replace:it}),{shortCircuited:!0}}let{loaderData:Er,errors:Ya}=AP(_,pe,zr,Yn,qt,zn,Pn,He);He.forEach((Vt,an)=>{Vt.subscribe(_r=>{(_r||Vt.done)&&He.delete(an)})});let Xa=je(),Wo=Oe(W),la=Xa||Wo||zn.length>0;return qn({loaderData:Er,errors:Ya},la?{fetchers:new Map(_.fetchers)}:{})}function wt(Y,te,pe,Me){if(r)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");ae.has(Y)&&Be(Y);let Ue=(Me&&Me.unstable_flushSync)===!0,at=a||s,it=MC(_.location,_.matches,l,c.v7_prependBasename,pe,c.v7_relativeSplatPath,te,Me==null?void 0:Me.relative),st=kf(at,it,l);if(!st){j(Y,te,So(404,{pathname:it}),{flushSync:Ue});return}let{path:qe,submission:pt,error:qt}=CP(c.v7_normalizeFormMethod,!0,it,Me);if(qt){j(Y,te,qt,{flushSync:Ue});return}let lt=LC(st,qe);if(M=(Me&&Me.preventScrollReset)===!0,pt&&rs(pt.formMethod)){nn(Y,te,qe,lt,st,Ue,pt);return}fe.set(Y,{routeId:te,path:qe}),z(Y,te,qe,lt,st,Ue,pt)}async function nn(Y,te,pe,Me,Ue,at,it){if(_e(),fe.delete(Y),!Me.route.action&&!Me.route.lazy){let an=So(405,{method:it.formMethod,pathname:pe,routeId:te});j(Y,te,an,{flushSync:at});return}let st=_.fetchers.get(Y);Ce(Y,OZ(it,st),{flushSync:at});let qe=new AbortController,pt=yh(t.history,pe,qe.signal,it);ae.set(Y,qe);let qt=re,lt=await vh("action",pt,Me,Ue,o,i,l,c.v7_relativeSplatPath);if(pt.signal.aborted){ae.get(Y)===qe&&ae.delete(Y);return}if(c.v7_fetcherPersist&&Ne.has(Y)){if(Ic(lt)||Ef(lt)){Ce(Y,dl(void 0));return}}else{if(Ic(lt))if(ae.delete(Y),W>qt){Ce(Y,dl(void 0));return}else return he.add(Y),Ce(Y,bh(it)),X(_,lt,{fetcherSubmission:it});if(Ef(lt)){j(Y,te,lt.error);return}}if($c(lt))throw So(400,{type:"defer-action"});let Nt=_.navigation.location||_.location,rn=yh(t.history,Nt,qe.signal),zr=a||s,zn=_.navigation.state!=="idle"?kf(zr,_.navigation.location,l):_.matches;jt(zn,"Didn't find any matches after fetcher action");let Vn=++re;P.set(Y,Vn);let cr=bh(it,lt.data);_.fetchers.set(Y,cr);let[Yn,Pn]=kP(t.history,_,zn,it,Nt,!1,K,F,ie,Ne,fe,he,zr,l,{[Me.route.id]:lt.data},void 0);Pn.filter(an=>an.key!==Y).forEach(an=>{let _r=an.key,Za=_.fetchers.get(_r),uc=bh(void 0,Za?Za.data:void 0);_.fetchers.set(_r,uc),ae.has(_r)&&Be(_r),an.controller&&ae.set(_r,an.controller)}),ke({fetchers:new Map(_.fetchers)});let $i=()=>Pn.forEach(an=>Be(an.key));qe.signal.addEventListener("abort",$i);let{results:Er,loaderResults:Ya,fetcherResults:Xa}=await ne(_.matches,zn,Yn,Pn,rn);if(qe.signal.aborted)return;qe.signal.removeEventListener("abort",$i),P.delete(Y),ae.delete(Y),Pn.forEach(an=>ae.delete(an.key));let Wo=PP(Er);if(Wo){if(Wo.idx>=Yn.length){let an=Pn[Wo.idx-Yn.length].key;he.add(an)}return X(_,Wo.result)}let{loaderData:la,errors:Vt}=AP(_,_.matches,Yn,Ya,void 0,Pn,Xa,He);if(_.fetchers.has(Y)){let an=dl(lt.data);_.fetchers.set(Y,an)}Oe(Vn),_.navigation.state==="loading"&&Vn>W?(jt(R,"Expected pending action"),I&&I.abort(),oe(_.navigation.location,{matches:zn,loaderData:la,errors:Vt,fetchers:new Map(_.fetchers)})):(ke({errors:Vt,loaderData:OP(_.loaderData,la,zn,Vt),fetchers:new Map(_.fetchers)}),K=!1)}async function z(Y,te,pe,Me,Ue,at,it){let st=_.fetchers.get(Y);Ce(Y,bh(it,st?st.data:void 0),{flushSync:at});let qe=new AbortController,pt=yh(t.history,pe,qe.signal);ae.set(Y,qe);let qt=re,lt=await vh("loader",pt,Me,Ue,o,i,l,c.v7_relativeSplatPath);if($c(lt)&&(lt=await G5(lt,pt.signal,!0)||lt),ae.get(Y)===qe&&ae.delete(Y),!pt.signal.aborted){if(Ne.has(Y)){Ce(Y,dl(void 0));return}if(Ic(lt))if(W>qt){Ce(Y,dl(void 0));return}else{he.add(Y),await X(_,lt);return}if(Ef(lt)){j(Y,te,lt.error);return}jt(!$c(lt),"Unhandled fetcher deferred data"),Ce(Y,dl(lt.data))}}async function X(Y,te,pe){let{submission:Me,fetcherSubmission:Ue,replace:at}=pe===void 0?{}:pe;te.revalidate&&(K=!0);let it=Lp(Y.location,te.location,{_isRedirect:!0});if(jt(it,"Expected a location on the redirect navigation"),n){let Nt=!1;if(te.reloadDocument)Nt=!0;else if(W5.test(te.location)){const rn=t.history.createURL(te.location);Nt=rn.origin!==e.location.origin||kd(rn.pathname,l)==null}if(Nt){at?e.location.replace(te.location):e.location.assign(te.location);return}}I=null;let st=at===!0?Qn.Replace:Qn.Push,{formMethod:qe,formAction:pt,formEncType:qt}=Y.navigation;!Me&&!Ue&&qe&&pt&&qt&&(Me=MP(Y.navigation));let lt=Me||Ue;if(gZ.has(te.status)&&lt&&rs(lt.formMethod))await we(st,it,{submission:qn({},lt,{formAction:te.location}),preventScrollReset:M});else{let Nt=Cx(it,Me);await we(st,it,{overrideNavigation:Nt,fetcherSubmission:Ue,preventScrollReset:M})}}async function ne(Y,te,pe,Me,Ue){let at=await Promise.all([...pe.map(qe=>vh("loader",Ue,qe,te,o,i,l,c.v7_relativeSplatPath)),...Me.map(qe=>qe.matches&&qe.match&&qe.controller?vh("loader",yh(t.history,qe.path,qe.controller.signal),qe.match,qe.matches,o,i,l,c.v7_relativeSplatPath):{type:Wn.error,error:So(404,{pathname:qe.path})})]),it=at.slice(0,pe.length),st=at.slice(pe.length);return await Promise.all([NP(Y,pe,it,it.map(()=>Ue.signal),!1,_.loaderData),NP(Y,Me.map(qe=>qe.match),st,Me.map(qe=>qe.controller?qe.controller.signal:null),!0)]),{results:at,loaderResults:it,fetcherResults:st}}function _e(){K=!0,F.push(...Pt()),fe.forEach((Y,te)=>{ae.has(te)&&(ie.push(te),Be(te))})}function Ce(Y,te,pe){pe===void 0&&(pe={}),_.fetchers.set(Y,te),ke({fetchers:new Map(_.fetchers)},{flushSync:(pe&&pe.flushSync)===!0})}function j(Y,te,pe,Me){Me===void 0&&(Me={});let Ue=op(_.matches,te);de(Y),ke({errors:{[Ue.route.id]:pe},fetchers:new Map(_.fetchers)},{flushSync:(Me&&Me.flushSync)===!0})}function ee(Y){return c.v7_fetcherPersist&&($.set(Y,($.get(Y)||0)+1),Ne.has(Y)&&Ne.delete(Y)),_.fetchers.get(Y)||vZ}function de(Y){let te=_.fetchers.get(Y);ae.has(Y)&&!(te&&te.state==="loading"&&P.has(Y))&&Be(Y),fe.delete(Y),P.delete(Y),he.delete(Y),Ne.delete(Y),_.fetchers.delete(Y)}function Ae(Y){if(c.v7_fetcherPersist){let te=($.get(Y)||0)-1;te<=0?($.delete(Y),Ne.add(Y)):$.set(Y,te)}else de(Y);ke({fetchers:new Map(_.fetchers)})}function Be(Y){let te=ae.get(Y);jt(te,"Expected fetch controller: "+Y),te.abort(),ae.delete(Y)}function Te(Y){for(let te of Y){let pe=ee(te),Me=dl(pe.data);_.fetchers.set(te,Me)}}function je(){let Y=[],te=!1;for(let pe of he){let Me=_.fetchers.get(pe);jt(Me,"Expected fetcher: "+pe),Me.state==="loading"&&(he.delete(pe),Y.push(pe),te=!0)}return Te(Y),te}function Oe(Y){let te=[];for(let[pe,Me]of P)if(Me<Y){let Ue=_.fetchers.get(pe);jt(Ue,"Expected fetcher: "+pe),Ue.state==="loading"&&(Be(pe),P.delete(pe),te.push(pe))}return Te(te),te.length>0}function Qt(Y,te){let pe=_.blockers.get(Y)||gh;return Ye.get(Y)!==te&&Ye.set(Y,te),pe}function sn(Y){_.blockers.delete(Y),Ye.delete(Y)}function Lt(Y,te){let pe=_.blockers.get(Y)||gh;jt(pe.state==="unblocked"&&te.state==="blocked"||pe.state==="blocked"&&te.state==="blocked"||pe.state==="blocked"&&te.state==="proceeding"||pe.state==="blocked"&&te.state==="unblocked"||pe.state==="proceeding"&&te.state==="unblocked","Invalid blocker state transition: "+pe.state+" -> "+te.state);let Me=new Map(_.blockers);Me.set(Y,te),ke({blockers:Me})}function Kt(Y){let{currentLocation:te,nextLocation:pe,historyAction:Me}=Y;if(Ye.size===0)return;Ye.size>1&&ru(!1,"A router only supports one blocker at a time");let Ue=Array.from(Ye.entries()),[at,it]=Ue[Ue.length-1],st=_.blockers.get(at);if(!(st&&st.state==="proceeding")&&it({currentLocation:te,nextLocation:pe,historyAction:Me}))return at}function Pt(Y){let te=[];return He.forEach((pe,Me)=>{(!Y||Y(Me))&&(pe.cancel(),te.push(Me),He.delete(Me))}),te}function fo(Y,te,pe){if(p=Y,v=te,m=pe||null,!b&&_.navigation===Sx){b=!0;let Me=kr(_.location,_.matches);Me!=null&&ke({restoreScrollPosition:Me})}return()=>{p=null,v=null,m=null}}function ei(Y,te){return m&&m(Y,te.map(Me=>qX(Me,_.loaderData)))||Y.key}function Li(Y,te){if(p&&v){let pe=ei(Y,te);p[pe]=v()}}function kr(Y,te){if(p){let pe=ei(Y,te),Me=p[pe];if(typeof Me=="number")return Me}return null}function ti(Y){o={},a=NC(Y,i,void 0,o)}return A={get basename(){return l},get future(){return c},get state(){return _},get routes(){return s},get window(){return e},initialize:J,subscribe:Ee,enableScrollRestoration:fo,navigate:se,fetch:wt,revalidate:ue,createHref:Y=>t.history.createHref(Y),encodeLocation:Y=>t.history.encodeLocation(Y),getFetcher:ee,deleteFetcher:Ae,dispose:Se,getBlocker:Qt,deleteBlocker:sn,_internalFetchControllers:ae,_internalActiveDeferreds:He,_internalSetRoutes:ti},A}function wZ(t){return t!=null&&("formData"in t&&t.formData!=null||"body"in t&&t.body!==void 0)}function MC(t,e,n,r,i,o,s,a){let l,c;if(s){l=[];for(let d of e)if(l.push(d),d.route.id===s){c=d;break}}else l=e,c=e[e.length-1];let f=P_(i||".",R_(l,o),kd(t.pathname,n)||t.pathname,a==="path");return i==null&&(f.search=t.search,f.hash=t.hash),(i==null||i===""||i===".")&&c&&c.route.index&&!M_(f.search)&&(f.search=f.search?f.search.replace(/^\?/,"?index&"):"?index"),r&&n!=="/"&&(f.pathname=f.pathname==="/"?n:Aa([n,f.pathname])),iu(f)}function CP(t,e,n,r){if(!r||!wZ(r))return{path:n};if(r.formMethod&&!TZ(r.formMethod))return{path:n,error:So(405,{method:r.formMethod})};let i=()=>({path:n,error:So(400,{type:"invalid-body"})}),o=r.formMethod||"get",s=t?o.toUpperCase():o.toLowerCase(),a=K5(n);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!rs(s))return i();let p=typeof r.body=="string"?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((m,v)=>{let[b,S]=v;return""+m+b+"="+S+`
50
+ `},""):String(r.body);return{path:n,submission:{formMethod:s,formAction:a,formEncType:r.formEncType,formData:void 0,json:void 0,text:p}}}else if(r.formEncType==="application/json"){if(!rs(s))return i();try{let p=typeof r.body=="string"?JSON.parse(r.body):r.body;return{path:n,submission:{formMethod:s,formAction:a,formEncType:r.formEncType,formData:void 0,json:p,text:void 0}}}catch{return i()}}}jt(typeof FormData=="function","FormData is not available in this environment");let l,c;if(r.formData)l=DC(r.formData),c=r.formData;else if(r.body instanceof FormData)l=DC(r.body),c=r.body;else if(r.body instanceof URLSearchParams)l=r.body,c=TP(l);else if(r.body==null)l=new URLSearchParams,c=new FormData;else try{l=new URLSearchParams(r.body),c=TP(l)}catch{return i()}let f={formMethod:s,formAction:a,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:c,json:void 0,text:void 0};if(rs(f.formMethod))return{path:n,submission:f};let d=qa(n);return e&&d.search&&M_(d.search)&&l.append("index",""),d.search="?"+l,{path:iu(d),submission:f}}function xZ(t,e){let n=t;if(e){let r=t.findIndex(i=>i.route.id===e);r>=0&&(n=t.slice(0,r))}return n}function kP(t,e,n,r,i,o,s,a,l,c,f,d,p,m,v,b){let S=b?Object.values(b)[0]:v?Object.values(v)[0]:void 0,x=t.createURL(e.location),w=t.createURL(i),C=b?Object.keys(b)[0]:void 0,A=xZ(n,C).filter((R,M)=>{let{route:I}=R;if(I.lazy)return!0;if(I.loader==null)return!1;if(o)return I.loader.hydrate?!0:e.loaderData[I.id]===void 0&&(!e.errors||e.errors[I.id]===void 0);if(SZ(e.loaderData,e.matches[M],R)||a.some(L=>L===R.route.id))return!0;let V=e.matches[M],U=R;return EP(R,qn({currentUrl:x,currentParams:V.params,nextUrl:w,nextParams:U.params},r,{actionResult:S,defaultShouldRevalidate:s||x.pathname+x.search===w.pathname+w.search||x.search!==w.search||q5(V,U)}))}),_=[];return f.forEach((R,M)=>{if(o||!n.some(G=>G.route.id===R.routeId)||c.has(M))return;let I=kf(p,R.path,m);if(!I){_.push({key:M,routeId:R.routeId,path:R.path,matches:null,match:null,controller:null});return}let V=e.fetchers.get(M),U=LC(I,R.path),L=!1;d.has(M)?L=!1:l.includes(M)?L=!0:V&&V.state!=="idle"&&V.data===void 0?L=s:L=EP(U,qn({currentUrl:x,currentParams:e.matches[e.matches.length-1].params,nextUrl:w,nextParams:n[n.length-1].params},r,{actionResult:S,defaultShouldRevalidate:s})),L&&_.push({key:M,routeId:R.routeId,path:R.path,matches:I,match:U,controller:new AbortController})}),[A,_]}function SZ(t,e,n){let r=!e||n.route.id!==e.route.id,i=t[n.route.id]===void 0;return r||i}function q5(t,e){let n=t.route.path;return t.pathname!==e.pathname||n!=null&&n.endsWith("*")&&t.params["*"]!==e.params["*"]}function EP(t,e){if(t.route.shouldRevalidate){let n=t.route.shouldRevalidate(e);if(typeof n=="boolean")return n}return e.defaultShouldRevalidate}async function _P(t,e,n){if(!t.lazy)return;let r=await t.lazy();if(!t.lazy)return;let i=n[t.id];jt(i,"No route found in manifest");let o={};for(let s in r){let l=i[s]!==void 0&&s!=="hasErrorBoundary";ru(!l,'Route "'+i.id+'" has a static property "'+s+'" defined but its lazy function is also returning a value for this property. '+('The lazy route property "'+s+'" will be ignored.')),!l&&!WX.has(s)&&(o[s]=r[s])}Object.assign(i,o),Object.assign(i,qn({},e(i),{lazy:void 0}))}async function vh(t,e,n,r,i,o,s,a,l){l===void 0&&(l={});let c,f,d,p=b=>{let S,x=new Promise((w,C)=>S=C);return d=()=>S(),e.signal.addEventListener("abort",d),Promise.race([b({request:e,params:n.params,context:l.requestContext}),x])};try{let b=n.route[t];if(n.route.lazy)if(b){let S,x=await Promise.all([p(b).catch(w=>{S=w}),_P(n.route,o,i)]);if(S)throw S;f=x[0]}else if(await _P(n.route,o,i),b=n.route[t],b)f=await p(b);else if(t==="action"){let S=new URL(e.url),x=S.pathname+S.search;throw So(405,{method:e.method,pathname:x,routeId:n.route.id})}else return{type:Wn.data,data:void 0};else if(b)f=await p(b);else{let S=new URL(e.url),x=S.pathname+S.search;throw So(404,{pathname:x})}jt(f!==void 0,"You defined "+(t==="action"?"an action":"a loader")+" for route "+('"'+n.route.id+"\" but didn't return anything from your `"+t+"` ")+"function. Please return a value or `null`.")}catch(b){c=Wn.error,f=b}finally{d&&e.signal.removeEventListener("abort",d)}if(_Z(f)){let b=f.status;if(mZ.has(b)){let x=f.headers.get("Location");if(jt(x,"Redirects returned/thrown from loaders/actions must have a Location header"),!W5.test(x))x=MC(new URL(e.url),r.slice(0,r.indexOf(n)+1),s,!0,x,a);else if(!l.isStaticRequest){let w=new URL(e.url),C=x.startsWith("//")?new URL(w.protocol+x):new URL(x),T=kd(C.pathname,s)!=null;C.origin===w.origin&&T&&(x=C.pathname+C.search+C.hash)}if(l.isStaticRequest)throw f.headers.set("Location",x),f;return{type:Wn.redirect,status:b,location:x,revalidate:f.headers.get("X-Remix-Revalidate")!==null,reloadDocument:f.headers.get("X-Remix-Reload-Document")!==null}}if(l.isRouteRequest)throw{type:c===Wn.error?Wn.error:Wn.data,response:f};let S;try{let x=f.headers.get("Content-Type");x&&/\bapplication\/json\b/.test(x)?f.body==null?S=null:S=await f.json():S=await f.text()}catch(x){return{type:Wn.error,error:x}}return c===Wn.error?{type:c,error:new N_(b,f.statusText,S),headers:f.headers}:{type:Wn.data,data:S,statusCode:f.status,headers:f.headers}}if(c===Wn.error)return{type:c,error:f};if(EZ(f)){var m,v;return{type:Wn.deferred,deferredData:f,statusCode:(m=f.init)==null?void 0:m.status,headers:((v=f.init)==null?void 0:v.headers)&&new Headers(f.init.headers)}}return{type:Wn.data,data:f}}function yh(t,e,n,r){let i=t.createURL(K5(e)).toString(),o={signal:n};if(r&&rs(r.formMethod)){let{formMethod:s,formEncType:a}=r;o.method=s.toUpperCase(),a==="application/json"?(o.headers=new Headers({"Content-Type":a}),o.body=JSON.stringify(r.json)):a==="text/plain"?o.body=r.text:a==="application/x-www-form-urlencoded"&&r.formData?o.body=DC(r.formData):o.body=r.formData}return new Request(i,o)}function DC(t){let e=new URLSearchParams;for(let[n,r]of t.entries())e.append(n,typeof r=="string"?r:r.name);return e}function TP(t){let e=new FormData;for(let[n,r]of t.entries())e.append(n,r);return e}function CZ(t,e,n,r,i){let o={},s=null,a,l=!1,c={};return n.forEach((f,d)=>{let p=e[d].route.id;if(jt(!Ic(f),"Cannot handle redirect results in processLoaderData"),Ef(f)){let m=op(t,p),v=f.error;r&&(v=Object.values(r)[0],r=void 0),s=s||{},s[m.route.id]==null&&(s[m.route.id]=v),o[p]=void 0,l||(l=!0,a=V5(f.error)?f.error.status:500),f.headers&&(c[p]=f.headers)}else $c(f)?(i.set(p,f.deferredData),o[p]=f.deferredData.data):o[p]=f.data,f.statusCode!=null&&f.statusCode!==200&&!l&&(a=f.statusCode),f.headers&&(c[p]=f.headers)}),r&&(s=r,o[Object.keys(r)[0]]=void 0),{loaderData:o,errors:s,statusCode:a||200,loaderHeaders:c}}function AP(t,e,n,r,i,o,s,a){let{loaderData:l,errors:c}=CZ(e,n,r,i,a);for(let f=0;f<o.length;f++){let{key:d,match:p,controller:m}=o[f];jt(s!==void 0&&s[f]!==void 0,"Did not find corresponding fetcher result");let v=s[f];if(!(m&&m.signal.aborted))if(Ef(v)){let b=op(t.matches,p==null?void 0:p.route.id);c&&c[b.route.id]||(c=qn({},c,{[b.route.id]:v.error})),t.fetchers.delete(d)}else if(Ic(v))jt(!1,"Unhandled fetcher revalidation redirect");else if($c(v))jt(!1,"Unhandled fetcher deferred data");else{let b=dl(v.data);t.fetchers.set(d,b)}}return{loaderData:l,errors:c}}function OP(t,e,n,r){let i=qn({},e);for(let o of n){let s=o.route.id;if(e.hasOwnProperty(s)?e[s]!==void 0&&(i[s]=e[s]):t[s]!==void 0&&o.route.loader&&(i[s]=t[s]),r&&r.hasOwnProperty(s))break}return i}function op(t,e){return(e?t.slice(0,t.findIndex(r=>r.route.id===e)+1):[...t]).reverse().find(r=>r.route.hasErrorBoundary===!0)||t[0]}function RP(t){let e=t.length===1?t[0]:t.find(n=>n.index||!n.path||n.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:e}],route:e}}function So(t,e){let{pathname:n,routeId:r,method:i,type:o}=e===void 0?{}:e,s="Unknown Server Error",a="Unknown @remix-run/router error";return t===400?(s="Bad Request",i&&n&&r?a="You made a "+i+' request to "'+n+'" but '+('did not provide a `loader` for route "'+r+'", ')+"so there is no way to handle the request.":o==="defer-action"?a="defer() is not supported in actions":o==="invalid-body"&&(a="Unable to encode submission body")):t===403?(s="Forbidden",a='Route "'+r+'" does not match URL "'+n+'"'):t===404?(s="Not Found",a='No route matches URL "'+n+'"'):t===405&&(s="Method Not Allowed",i&&n&&r?a="You made a "+i.toUpperCase()+' request to "'+n+'" but '+('did not provide an `action` for route "'+r+'", ')+"so there is no way to handle the request.":i&&(a='Invalid request method "'+i.toUpperCase()+'"')),new N_(t||500,s,new Error(a),!0)}function PP(t){for(let e=t.length-1;e>=0;e--){let n=t[e];if(Ic(n))return{result:n,idx:e}}}function K5(t){let e=typeof t=="string"?qa(t):t;return iu(qn({},e,{hash:""}))}function kZ(t,e){return t.pathname!==e.pathname||t.search!==e.search?!1:t.hash===""?e.hash!=="":t.hash===e.hash?!0:e.hash!==""}function $c(t){return t.type===Wn.deferred}function Ef(t){return t.type===Wn.error}function Ic(t){return(t&&t.type)===Wn.redirect}function EZ(t){let e=t;return e&&typeof e=="object"&&typeof e.data=="object"&&typeof e.subscribe=="function"&&typeof e.cancel=="function"&&typeof e.resolveData=="function"}function _Z(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.headers=="object"&&typeof t.body<"u"}function TZ(t){return pZ.has(t.toLowerCase())}function rs(t){return dZ.has(t.toLowerCase())}async function NP(t,e,n,r,i,o){for(let s=0;s<n.length;s++){let a=n[s],l=e[s];if(!l)continue;let c=t.find(d=>d.route.id===l.route.id),f=c!=null&&!q5(c,l)&&(o&&o[l.route.id])!==void 0;if($c(a)&&(i||f)){let d=r[s];jt(d,"Expected an AbortSignal for revalidating fetcher deferred result"),await G5(a,d,i).then(p=>{p&&(n[s]=p||n[s])})}}}async function G5(t,e,n){if(n===void 0&&(n=!1),!await t.deferredData.resolveData(e)){if(n)try{return{type:Wn.data,data:t.deferredData.unwrappedData}}catch(i){return{type:Wn.error,error:i}}return{type:Wn.data,data:t.deferredData.data}}}function M_(t){return new URLSearchParams(t).getAll("index").some(e=>e==="")}function LC(t,e){let n=typeof e=="string"?qa(e).search:e.search;if(t[t.length-1].route.index&&M_(n||""))return t[t.length-1];let r=z5(t);return r[r.length-1]}function MP(t){let{formMethod:e,formAction:n,formEncType:r,text:i,formData:o,json:s}=t;if(!(!e||!n||!r)){if(i!=null)return{formMethod:e,formAction:n,formEncType:r,formData:void 0,json:void 0,text:i};if(o!=null)return{formMethod:e,formAction:n,formEncType:r,formData:o,json:void 0,text:void 0};if(s!==void 0)return{formMethod:e,formAction:n,formEncType:r,formData:void 0,json:s,text:void 0}}}function Cx(t,e){return e?{state:"loading",location:t,formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text}:{state:"loading",location:t,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function AZ(t,e){return{state:"submitting",location:t,formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text}}function bh(t,e){return t?{state:"loading",formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text,data:e}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function OZ(t,e){return{state:"submitting",formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text,data:e?e.data:void 0}}function dl(t){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function RZ(t,e){try{let n=t.sessionStorage.getItem(H5);if(n){let r=JSON.parse(n);for(let[i,o]of Object.entries(r||{}))o&&Array.isArray(o)&&e.set(i,new Set(o||[]))}}catch{}}function PZ(t,e){if(e.size>0){let n={};for(let[r,i]of e)n[r]=[...i];try{t.sessionStorage.setItem(H5,JSON.stringify(n))}catch(r){ru(!1,"Failed to save applied view transitions in sessionStorage ("+r+").")}}}/**
51
+ * React Router v6.22.0
52
+ *
53
+ * Copyright (c) Remix Software Inc.
54
+ *
55
+ * This source code is licensed under the MIT license found in the
56
+ * LICENSE.md file in the root directory of this source tree.
57
+ *
58
+ * @license MIT
59
+ */function $p(){return $p=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},$p.apply(this,arguments)}const Pb=g.createContext(null),Y5=g.createContext(null),Eu=g.createContext(null),Nb=g.createContext(null),sc=g.createContext({outlet:null,matches:[],isDataRoute:!1}),X5=g.createContext(null);function NZ(t,e){let{relative:n}=e===void 0?{}:e;Om()||jt(!1);let{basename:r,navigator:i}=g.useContext(Eu),{hash:o,pathname:s,search:a}=J5(t,{relative:n}),l=s;return r!=="/"&&(l=s==="/"?r:Aa([r,s])),i.createHref({pathname:l,search:a,hash:o})}function Om(){return g.useContext(Nb)!=null}function Mb(){return Om()||jt(!1),g.useContext(Nb).location}function Z5(t){g.useContext(Eu).static||g.useLayoutEffect(t)}function Q5(){let{isDataRoute:t}=g.useContext(sc);return t?WZ():MZ()}function MZ(){Om()||jt(!1);let t=g.useContext(Pb),{basename:e,future:n,navigator:r}=g.useContext(Eu),{matches:i}=g.useContext(sc),{pathname:o}=Mb(),s=JSON.stringify(R_(i,n.v7_relativeSplatPath)),a=g.useRef(!1);return Z5(()=>{a.current=!0}),g.useCallback(function(c,f){if(f===void 0&&(f={}),!a.current)return;if(typeof c=="number"){r.go(c);return}let d=P_(c,JSON.parse(s),o,f.relative==="path");t==null&&e!=="/"&&(d.pathname=d.pathname==="/"?e:Aa([e,d.pathname])),(f.replace?r.replace:r.push)(d,f.state,f)},[e,r,s,o,t])}function DZ(){let{matches:t}=g.useContext(sc),e=t[t.length-1];return e?e.params:{}}function J5(t,e){let{relative:n}=e===void 0?{}:e,{future:r}=g.useContext(Eu),{matches:i}=g.useContext(sc),{pathname:o}=Mb(),s=JSON.stringify(R_(i,r.v7_relativeSplatPath));return g.useMemo(()=>P_(t,JSON.parse(s),o,n==="path"),[t,s,o,n])}function LZ(t,e,n,r){Om()||jt(!1);let{navigator:i}=g.useContext(Eu),{matches:o}=g.useContext(sc),s=o[o.length-1],a=s?s.params:{};s&&s.pathname;let l=s?s.pathnameBase:"/";s&&s.route;let c=Mb(),f;if(e){var d;let S=typeof e=="string"?qa(e):e;l==="/"||(d=S.pathname)!=null&&d.startsWith(l)||jt(!1),f=S}else f=c;let p=f.pathname||"/",m=l==="/"?p:p.slice(l.length)||"/",v=kf(t,{pathname:m}),b=FZ(v&&v.map(S=>Object.assign({},S,{params:Object.assign({},a,S.params),pathname:Aa([l,i.encodeLocation?i.encodeLocation(S.pathname).pathname:S.pathname]),pathnameBase:S.pathnameBase==="/"?l:Aa([l,i.encodeLocation?i.encodeLocation(S.pathnameBase).pathname:S.pathnameBase])})),o,n,r);return e&&b?g.createElement(Nb.Provider,{value:{location:$p({pathname:"/",search:"",hash:"",state:null,key:"default"},f),navigationType:Qn.Pop}},b):b}function $Z(){let t=UZ(),e=V5(t)?t.status+" "+t.statusText:t instanceof Error?t.message:JSON.stringify(t),n=t instanceof Error?t.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"},o=null;return g.createElement(g.Fragment,null,g.createElement("h2",null,"Unexpected Application Error!"),g.createElement("h3",{style:{fontStyle:"italic"}},e),n?g.createElement("pre",{style:i},n):null,o)}const IZ=g.createElement($Z,null);class jZ extends g.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,n){return n.location!==e.location||n.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:n.error,location:n.location,revalidation:e.revalidation||n.revalidation}}componentDidCatch(e,n){console.error("React Router caught the following error during render",e,n)}render(){return this.state.error!==void 0?g.createElement(sc.Provider,{value:this.props.routeContext},g.createElement(X5.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function BZ(t){let{routeContext:e,match:n,children:r}=t,i=g.useContext(Pb);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),g.createElement(sc.Provider,{value:e},r)}function FZ(t,e,n,r){var i;if(e===void 0&&(e=[]),n===void 0&&(n=null),r===void 0&&(r=null),t==null){var o;if((o=n)!=null&&o.errors)t=n.matches;else return null}let s=t,a=(i=n)==null?void 0:i.errors;if(a!=null){let f=s.findIndex(d=>d.route.id&&(a==null?void 0:a[d.route.id]));f>=0||jt(!1),s=s.slice(0,Math.min(s.length,f+1))}let l=!1,c=-1;if(n&&r&&r.v7_partialHydration)for(let f=0;f<s.length;f++){let d=s[f];if((d.route.HydrateFallback||d.route.hydrateFallbackElement)&&(c=f),d.route.id){let{loaderData:p,errors:m}=n,v=d.route.loader&&p[d.route.id]===void 0&&(!m||m[d.route.id]===void 0);if(d.route.lazy||v){l=!0,c>=0?s=s.slice(0,c+1):s=[s[0]];break}}}return s.reduceRight((f,d,p)=>{let m,v=!1,b=null,S=null;n&&(m=a&&d.route.id?a[d.route.id]:void 0,b=d.route.errorElement||IZ,l&&(c<0&&p===0?(HZ("route-fallback",!1),v=!0,S=null):c===p&&(v=!0,S=d.route.hydrateFallbackElement||null)));let x=e.concat(s.slice(0,p+1)),w=()=>{let C;return m?C=b:v?C=S:d.route.Component?C=g.createElement(d.route.Component,null):d.route.element?C=d.route.element:C=f,g.createElement(BZ,{match:d,routeContext:{outlet:f,matches:x,isDataRoute:n!=null},children:C})};return n&&(d.route.ErrorBoundary||d.route.errorElement||p===0)?g.createElement(jZ,{location:n.location,revalidation:n.revalidation,component:b,error:m,children:w(),routeContext:{outlet:null,matches:x,isDataRoute:!0}}):w()},null)}var e3=function(t){return t.UseBlocker="useBlocker",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t}(e3||{}),id=function(t){return t.UseBlocker="useBlocker",t.UseLoaderData="useLoaderData",t.UseActionData="useActionData",t.UseRouteError="useRouteError",t.UseNavigation="useNavigation",t.UseRouteLoaderData="useRouteLoaderData",t.UseMatches="useMatches",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t.UseRouteId="useRouteId",t}(id||{});function zZ(t){let e=g.useContext(Pb);return e||jt(!1),e}function t3(t){let e=g.useContext(Y5);return e||jt(!1),e}function VZ(t){let e=g.useContext(sc);return e||jt(!1),e}function D_(t){let e=VZ(),n=e.matches[e.matches.length-1];return n.route.id||jt(!1),n.route.id}function n3(){let t=t3(id.UseLoaderData),e=D_(id.UseLoaderData);if(t.errors&&t.errors[e]!=null){console.error("You cannot `useLoaderData` in an errorElement (routeId: "+e+")");return}return t.loaderData[e]}function UZ(){var t;let e=g.useContext(X5),n=t3(id.UseRouteError),r=D_(id.UseRouteError);return e!==void 0?e:(t=n.errors)==null?void 0:t[r]}function WZ(){let{router:t}=zZ(e3.UseNavigateStable),e=D_(id.UseNavigateStable),n=g.useRef(!1);return Z5(()=>{n.current=!0}),g.useCallback(function(i,o){o===void 0&&(o={}),n.current&&(typeof i=="number"?t.navigate(i):t.navigate(i,$p({fromRouteId:e},o)))},[t,e])}const DP={};function HZ(t,e,n){!e&&!DP[t]&&(DP[t]=!0)}function qZ(t){let{basename:e="/",children:n=null,location:r,navigationType:i=Qn.Pop,navigator:o,static:s=!1,future:a}=t;Om()&&jt(!1);let l=e.replace(/^\/*/,"/"),c=g.useMemo(()=>({basename:l,navigator:o,static:s,future:$p({v7_relativeSplatPath:!1},a)}),[l,a,o,s]);typeof r=="string"&&(r=qa(r));let{pathname:f="/",search:d="",hash:p="",state:m=null,key:v="default"}=r,b=g.useMemo(()=>{let S=kd(f,l);return S==null?null:{location:{pathname:S,search:d,hash:p,state:m,key:v},navigationType:i}},[l,f,d,p,m,v,i]);return b==null?null:g.createElement(Eu.Provider,{value:c},g.createElement(Nb.Provider,{children:n,value:b}))}new Promise(()=>{});function KZ(t){let e={hasErrorBoundary:t.ErrorBoundary!=null||t.errorElement!=null};return t.Component&&Object.assign(e,{element:g.createElement(t.Component),Component:void 0}),t.HydrateFallback&&Object.assign(e,{hydrateFallbackElement:g.createElement(t.HydrateFallback),HydrateFallback:void 0}),t.ErrorBoundary&&Object.assign(e,{errorElement:g.createElement(t.ErrorBoundary),ErrorBoundary:void 0}),e}/**
60
+ * React Router DOM v6.22.0
61
+ *
62
+ * Copyright (c) Remix Software Inc.
63
+ *
64
+ * This source code is licensed under the MIT license found in the
65
+ * LICENSE.md file in the root directory of this source tree.
66
+ *
67
+ * @license MIT
68
+ */function Ip(){return Ip=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Ip.apply(this,arguments)}function GZ(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o<r.length;o++)i=r[o],!(e.indexOf(i)>=0)&&(n[i]=t[i]);return n}function YZ(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function XZ(t,e){return t.button===0&&(!e||e==="_self")&&!YZ(t)}const ZZ=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"],QZ="6";try{window.__reactRouterVersion=QZ}catch{}function JZ(t,e){return bZ({basename:e==null?void 0:e.basename,future:Ip({},e==null?void 0:e.future,{v7_prependBasename:!0}),history:zX({window:e==null?void 0:e.window}),hydrationData:(e==null?void 0:e.hydrationData)||eQ(),routes:t,mapRouteProperties:KZ,window:e==null?void 0:e.window}).initialize()}function eQ(){var t;let e=(t=window)==null?void 0:t.__staticRouterHydrationData;return e&&e.errors&&(e=Ip({},e,{errors:tQ(e.errors)})),e}function tQ(t){if(!t)return null;let e=Object.entries(t),n={};for(let[r,i]of e)if(i&&i.__type==="RouteErrorResponse")n[r]=new N_(i.status,i.statusText,i.data,i.internal===!0);else if(i&&i.__type==="Error"){if(i.__subType){let o=window[i.__subType];if(typeof o=="function")try{let s=new o(i.message);s.stack="",n[r]=s}catch{}}if(n[r]==null){let o=new Error(i.message);o.stack="",n[r]=o}}else n[r]=i;return n}const nQ=g.createContext({isTransitioning:!1}),rQ=g.createContext(new Map),iQ="startTransition",LP=jE[iQ],oQ="flushSync",$P=FX[oQ];function sQ(t){LP?LP(t):t()}function wh(t){$P?$P(t):t()}class aQ{constructor(){this.status="pending",this.promise=new Promise((e,n)=>{this.resolve=r=>{this.status==="pending"&&(this.status="resolved",e(r))},this.reject=r=>{this.status==="pending"&&(this.status="rejected",n(r))}})}}function lQ(t){let{fallbackElement:e,router:n,future:r}=t,[i,o]=g.useState(n.state),[s,a]=g.useState(),[l,c]=g.useState({isTransitioning:!1}),[f,d]=g.useState(),[p,m]=g.useState(),[v,b]=g.useState(),S=g.useRef(new Map),{v7_startTransition:x}=r||{},w=g.useCallback(R=>{x?sQ(R):R()},[x]),C=g.useCallback((R,M)=>{let{deletedFetchers:I,unstable_flushSync:V,unstable_viewTransitionOpts:U}=M;I.forEach(G=>S.current.delete(G)),R.fetchers.forEach((G,K)=>{G.data!==void 0&&S.current.set(K,G.data)});let L=n.window==null||typeof n.window.document.startViewTransition!="function";if(!U||L){V?wh(()=>o(R)):w(()=>o(R));return}if(V){wh(()=>{p&&(f&&f.resolve(),p.skipTransition()),c({isTransitioning:!0,flushSync:!0,currentLocation:U.currentLocation,nextLocation:U.nextLocation})});let G=n.window.document.startViewTransition(()=>{wh(()=>o(R))});G.finished.finally(()=>{wh(()=>{d(void 0),m(void 0),a(void 0),c({isTransitioning:!1})})}),wh(()=>m(G));return}p?(f&&f.resolve(),p.skipTransition(),b({state:R,currentLocation:U.currentLocation,nextLocation:U.nextLocation})):(a(R),c({isTransitioning:!0,flushSync:!1,currentLocation:U.currentLocation,nextLocation:U.nextLocation}))},[n.window,p,f,S,w]);g.useLayoutEffect(()=>n.subscribe(C),[n,C]),g.useEffect(()=>{l.isTransitioning&&!l.flushSync&&d(new aQ)},[l]),g.useEffect(()=>{if(f&&s&&n.window){let R=s,M=f.promise,I=n.window.document.startViewTransition(async()=>{w(()=>o(R)),await M});I.finished.finally(()=>{d(void 0),m(void 0),a(void 0),c({isTransitioning:!1})}),m(I)}},[w,s,f,n.window]),g.useEffect(()=>{f&&s&&i.location.key===s.location.key&&f.resolve()},[f,p,i.location,s]),g.useEffect(()=>{!l.isTransitioning&&v&&(a(v.state),c({isTransitioning:!0,flushSync:!1,currentLocation:v.currentLocation,nextLocation:v.nextLocation}),b(void 0))},[l.isTransitioning,v]),g.useEffect(()=>{},[]);let T=g.useMemo(()=>({createHref:n.createHref,encodeLocation:n.encodeLocation,go:R=>n.navigate(R),push:(R,M,I)=>n.navigate(R,{state:M,preventScrollReset:I==null?void 0:I.preventScrollReset}),replace:(R,M,I)=>n.navigate(R,{replace:!0,state:M,preventScrollReset:I==null?void 0:I.preventScrollReset})}),[n]),A=n.basename||"/",_=g.useMemo(()=>({router:n,navigator:T,static:!1,basename:A}),[n,T,A]);return g.createElement(g.Fragment,null,g.createElement(Pb.Provider,{value:_},g.createElement(Y5.Provider,{value:i},g.createElement(rQ.Provider,{value:S.current},g.createElement(nQ.Provider,{value:l},g.createElement(qZ,{basename:A,location:i.location,navigationType:i.historyAction,navigator:T,future:{v7_relativeSplatPath:n.future.v7_relativeSplatPath}},i.initialized||n.future.v7_partialHydration?g.createElement(cQ,{routes:n.routes,future:n.future,state:i}):e))))),null)}function cQ(t){let{routes:e,future:n,state:r}=t;return LZ(e,void 0,r,n)}const uQ=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",fQ=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,dQ=g.forwardRef(function(e,n){let{onClick:r,relative:i,reloadDocument:o,replace:s,state:a,target:l,to:c,preventScrollReset:f,unstable_viewTransition:d}=e,p=GZ(e,ZZ),{basename:m}=g.useContext(Eu),v,b=!1;if(typeof c=="string"&&fQ.test(c)&&(v=c,uQ))try{let C=new URL(window.location.href),T=c.startsWith("//")?new URL(C.protocol+c):new URL(c),A=kd(T.pathname,m);T.origin===C.origin&&A!=null?c=A+T.search+T.hash:b=!0}catch{}let S=NZ(c,{relative:i}),x=hQ(c,{replace:s,state:a,target:l,preventScrollReset:f,relative:i,unstable_viewTransition:d});function w(C){r&&r(C),C.defaultPrevented||x(C)}return g.createElement("a",Ip({},p,{href:v||S,onClick:b||o?r:w,ref:n,target:l}))});var IP;(function(t){t.UseScrollRestoration="useScrollRestoration",t.UseSubmit="useSubmit",t.UseSubmitFetcher="useSubmitFetcher",t.UseFetcher="useFetcher",t.useViewTransitionState="useViewTransitionState"})(IP||(IP={}));var jP;(function(t){t.UseFetcher="useFetcher",t.UseFetchers="useFetchers",t.UseScrollRestoration="useScrollRestoration"})(jP||(jP={}));function hQ(t,e){let{target:n,replace:r,state:i,preventScrollReset:o,relative:s,unstable_viewTransition:a}=e===void 0?{}:e,l=Q5(),c=Mb(),f=J5(t,{relative:s});return g.useCallback(d=>{if(XZ(d,n)){d.preventDefault();let p=r!==void 0?r:iu(c)===iu(f);l(t,{replace:p,state:i,preventScrollReset:o,relative:s,unstable_viewTransition:a})}},[c,l,f,r,i,n,t,o,s,a])}function H(){return H=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},H.apply(this,arguments)}function yt(t,e,{checkForDefaultPrevented:n=!0}={}){return function(i){if(t==null||t(i),n===!1||!i.defaultPrevented)return e==null?void 0:e(i)}}function pQ(t,e){typeof t=="function"?t(e):t!=null&&(t.current=e)}function r3(...t){return e=>t.forEach(n=>pQ(n,e))}function hn(...t){return g.useCallback(r3(...t),t)}function Fo(t,e=[]){let n=[];function r(o,s){const a=g.createContext(s),l=n.length;n=[...n,s];function c(d){const{scope:p,children:m,...v}=d,b=(p==null?void 0:p[t][l])||a,S=g.useMemo(()=>v,Object.values(v));return g.createElement(b.Provider,{value:S},m)}function f(d,p){const m=(p==null?void 0:p[t][l])||a,v=g.useContext(m);if(v)return v;if(s!==void 0)return s;throw new Error(`\`${d}\` must be used within \`${o}\``)}return c.displayName=o+"Provider",[c,f]}const i=()=>{const o=n.map(s=>g.createContext(s));return function(a){const l=(a==null?void 0:a[t])||o;return g.useMemo(()=>({[`__scope${t}`]:{...a,[t]:l}}),[a,l])}};return i.scopeName=t,[r,mQ(i,...e)]}function mQ(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const r=t.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const s=r.reduce((a,{useScope:l,scopeName:c})=>{const d=l(o)[`__scope${c}`];return{...a,...d}},{});return g.useMemo(()=>({[`__scope${e.scopeName}`]:s}),[s])}};return n.scopeName=e.scopeName,n}const $a=g.forwardRef((t,e)=>{const{children:n,...r}=t,i=g.Children.toArray(n),o=i.find(gQ);if(o){const s=o.props.children,a=i.map(l=>l===o?g.Children.count(s)>1?g.Children.only(null):g.isValidElement(s)?s.props.children:null:l);return g.createElement($C,H({},r,{ref:e}),g.isValidElement(s)?g.cloneElement(s,void 0,a):null)}return g.createElement($C,H({},r,{ref:e}),n)});$a.displayName="Slot";const $C=g.forwardRef((t,e)=>{const{children:n,...r}=t;return g.isValidElement(n)?g.cloneElement(n,{...vQ(r,n.props),ref:e?r3(e,n.ref):n.ref}):g.Children.count(n)>1?g.Children.only(null):null});$C.displayName="SlotClone";const i3=({children:t})=>g.createElement(g.Fragment,null,t);function gQ(t){return g.isValidElement(t)&&t.type===i3}function vQ(t,e){const n={...e};for(const r in e){const i=t[r],o=e[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...a)=>{o(...a),i(...a)}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...t,...n}}const yQ=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Dt=yQ.reduce((t,e)=>{const n=g.forwardRef((r,i)=>{const{asChild:o,...s}=r,a=o?$a:e;return g.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),g.createElement(a,H({},s,{ref:i}))});return n.displayName=`Primitive.${e}`,{...t,[e]:n}},{});function bQ(t,e){t&&na.flushSync(()=>t.dispatchEvent(e))}function Ys(t){const e=g.useRef(t);return g.useEffect(()=>{e.current=t}),g.useMemo(()=>(...n)=>{var r;return(r=e.current)===null||r===void 0?void 0:r.call(e,...n)},[])}function wQ(t,e=globalThis==null?void 0:globalThis.document){const n=Ys(t);g.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return e.addEventListener("keydown",r),()=>e.removeEventListener("keydown",r)},[n,e])}const IC="dismissableLayer.update",xQ="dismissableLayer.pointerDownOutside",SQ="dismissableLayer.focusOutside";let BP;const CQ=g.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Db=g.forwardRef((t,e)=>{var n;const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:a,onDismiss:l,...c}=t,f=g.useContext(CQ),[d,p]=g.useState(null),m=(n=d==null?void 0:d.ownerDocument)!==null&&n!==void 0?n:globalThis==null?void 0:globalThis.document,[,v]=g.useState({}),b=hn(e,M=>p(M)),S=Array.from(f.layers),[x]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),w=S.indexOf(x),C=d?S.indexOf(d):-1,T=f.layersWithOutsidePointerEventsDisabled.size>0,A=C>=w,_=kQ(M=>{const I=M.target,V=[...f.branches].some(U=>U.contains(I));!A||V||(o==null||o(M),a==null||a(M),M.defaultPrevented||l==null||l())},m),R=EQ(M=>{const I=M.target;[...f.branches].some(U=>U.contains(I))||(s==null||s(M),a==null||a(M),M.defaultPrevented||l==null||l())},m);return wQ(M=>{C===f.layers.size-1&&(i==null||i(M),!M.defaultPrevented&&l&&(M.preventDefault(),l()))},m),g.useEffect(()=>{if(d)return r&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(BP=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(d)),f.layers.add(d),FP(),()=>{r&&f.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=BP)}},[d,m,r,f]),g.useEffect(()=>()=>{d&&(f.layers.delete(d),f.layersWithOutsidePointerEventsDisabled.delete(d),FP())},[d,f]),g.useEffect(()=>{const M=()=>v({});return document.addEventListener(IC,M),()=>document.removeEventListener(IC,M)},[]),g.createElement(Dt.div,H({},c,{ref:b,style:{pointerEvents:T?A?"auto":"none":void 0,...t.style},onFocusCapture:yt(t.onFocusCapture,R.onFocusCapture),onBlurCapture:yt(t.onBlurCapture,R.onBlurCapture),onPointerDownCapture:yt(t.onPointerDownCapture,_.onPointerDownCapture)}))});function kQ(t,e=globalThis==null?void 0:globalThis.document){const n=Ys(t),r=g.useRef(!1),i=g.useRef(()=>{});return g.useEffect(()=>{const o=a=>{if(a.target&&!r.current){let f=function(){o3(xQ,n,c,{discrete:!0})};var l=f;const c={originalEvent:a};a.pointerType==="touch"?(e.removeEventListener("click",i.current),i.current=f,e.addEventListener("click",i.current,{once:!0})):f()}r.current=!1},s=window.setTimeout(()=>{e.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(s),e.removeEventListener("pointerdown",o),e.removeEventListener("click",i.current)}},[e,n]),{onPointerDownCapture:()=>r.current=!0}}function EQ(t,e=globalThis==null?void 0:globalThis.document){const n=Ys(t),r=g.useRef(!1);return g.useEffect(()=>{const i=o=>{o.target&&!r.current&&o3(SQ,n,{originalEvent:o},{discrete:!1})};return e.addEventListener("focusin",i),()=>e.removeEventListener("focusin",i)},[e,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function FP(){const t=new CustomEvent(IC);document.dispatchEvent(t)}function o3(t,e,n,{discrete:r}){const i=n.originalEvent.target,o=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:n});e&&i.addEventListener(t,e,{once:!0}),r?bQ(i,o):i.dispatchEvent(o)}const Pi=globalThis!=null&&globalThis.document?g.useLayoutEffect:()=>{},_Q=jE.useId||(()=>{});let TQ=0;function Oa(t){const[e,n]=g.useState(_Q());return Pi(()=>{t||n(r=>r??String(TQ++))},[t]),t||(e?`radix-${e}`:"")}const AQ=["top","right","bottom","left"],Wl=Math.min,Yi=Math.max,n0=Math.round,tv=Math.floor,Hl=t=>({x:t,y:t}),OQ={left:"right",right:"left",bottom:"top",top:"bottom"},RQ={start:"end",end:"start"};function jC(t,e,n){return Yi(t,Wl(e,n))}function Ia(t,e){return typeof t=="function"?t(e):t}function ja(t){return t.split("-")[0]}function Ed(t){return t.split("-")[1]}function L_(t){return t==="x"?"y":"x"}function $_(t){return t==="y"?"height":"width"}function _d(t){return["top","bottom"].includes(ja(t))?"y":"x"}function I_(t){return L_(_d(t))}function PQ(t,e,n){n===void 0&&(n=!1);const r=Ed(t),i=I_(t),o=$_(i);let s=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[o]>e.floating[o]&&(s=r0(s)),[s,r0(s)]}function NQ(t){const e=r0(t);return[BC(t),e,BC(e)]}function BC(t){return t.replace(/start|end/g,e=>RQ[e])}function MQ(t,e,n){const r=["left","right"],i=["right","left"],o=["top","bottom"],s=["bottom","top"];switch(t){case"top":case"bottom":return n?e?i:r:e?r:i;case"left":case"right":return e?o:s;default:return[]}}function DQ(t,e,n,r){const i=Ed(t);let o=MQ(ja(t),n==="start",r);return i&&(o=o.map(s=>s+"-"+i),e&&(o=o.concat(o.map(BC)))),o}function r0(t){return t.replace(/left|right|bottom|top/g,e=>OQ[e])}function LQ(t){return{top:0,right:0,bottom:0,left:0,...t}}function s3(t){return typeof t!="number"?LQ(t):{top:t,right:t,bottom:t,left:t}}function i0(t){return{...t,top:t.y,left:t.x,right:t.x+t.width,bottom:t.y+t.height}}function zP(t,e,n){let{reference:r,floating:i}=t;const o=_d(e),s=I_(e),a=$_(s),l=ja(e),c=o==="y",f=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,p=r[a]/2-i[a]/2;let m;switch(l){case"top":m={x:f,y:r.y-i.height};break;case"bottom":m={x:f,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:d};break;case"left":m={x:r.x-i.width,y:d};break;default:m={x:r.x,y:r.y}}switch(Ed(e)){case"start":m[s]-=p*(n&&c?-1:1);break;case"end":m[s]+=p*(n&&c?-1:1);break}return m}const $Q=async(t,e,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:s}=n,a=o.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(e));let c=await s.getElementRects({reference:t,floating:e,strategy:i}),{x:f,y:d}=zP(c,r,l),p=r,m={},v=0;for(let b=0;b<a.length;b++){const{name:S,fn:x}=a[b],{x:w,y:C,data:T,reset:A}=await x({x:f,y:d,initialPlacement:r,placement:p,strategy:i,middlewareData:m,rects:c,platform:s,elements:{reference:t,floating:e}});if(f=w??f,d=C??d,m={...m,[S]:{...m[S],...T}},A&&v<=50){v++,typeof A=="object"&&(A.placement&&(p=A.placement),A.rects&&(c=A.rects===!0?await s.getElementRects({reference:t,floating:e,strategy:i}):A.rects),{x:f,y:d}=zP(c,p,l)),b=-1;continue}}return{x:f,y:d,placement:p,strategy:i,middlewareData:m}};async function jp(t,e){var n;e===void 0&&(e={});const{x:r,y:i,platform:o,rects:s,elements:a,strategy:l}=t,{boundary:c="clippingAncestors",rootBoundary:f="viewport",elementContext:d="floating",altBoundary:p=!1,padding:m=0}=Ia(e,t),v=s3(m),S=a[p?d==="floating"?"reference":"floating":d],x=i0(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(S)))==null||n?S:S.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(a.floating)),boundary:c,rootBoundary:f,strategy:l})),w=d==="floating"?{...s.floating,x:r,y:i}:s.reference,C=await(o.getOffsetParent==null?void 0:o.getOffsetParent(a.floating)),T=await(o.isElement==null?void 0:o.isElement(C))?await(o.getScale==null?void 0:o.getScale(C))||{x:1,y:1}:{x:1,y:1},A=i0(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({rect:w,offsetParent:C,strategy:l}):w);return{top:(x.top-A.top+v.top)/T.y,bottom:(A.bottom-x.bottom+v.bottom)/T.y,left:(x.left-A.left+v.left)/T.x,right:(A.right-x.right+v.right)/T.x}}const VP=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:i,rects:o,platform:s,elements:a}=e,{element:l,padding:c=0}=Ia(t,e)||{};if(l==null)return{};const f=s3(c),d={x:n,y:r},p=I_(i),m=$_(p),v=await s.getDimensions(l),b=p==="y",S=b?"top":"left",x=b?"bottom":"right",w=b?"clientHeight":"clientWidth",C=o.reference[m]+o.reference[p]-d[p]-o.floating[m],T=d[p]-o.reference[p],A=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l));let _=A?A[w]:0;(!_||!await(s.isElement==null?void 0:s.isElement(A)))&&(_=a.floating[w]||o.floating[m]);const R=C/2-T/2,M=_/2-v[m]/2-1,I=Wl(f[S],M),V=Wl(f[x],M),U=I,L=_-v[m]-V,G=_/2-v[m]/2+R,K=jC(U,G,L),ie=Ed(i)!=null&&G!=K&&o.reference[m]/2-(G<U?I:V)-v[m]/2<0?G<U?U-G:L-G:0;return{[p]:d[p]-ie,data:{[p]:K,centerOffset:G-K+ie}}}}),IQ=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n;const{placement:r,middlewareData:i,rects:o,initialPlacement:s,platform:a,elements:l}=e,{mainAxis:c=!0,crossAxis:f=!0,fallbackPlacements:d,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:v=!0,...b}=Ia(t,e),S=ja(r),x=ja(s)===s,w=await(a.isRTL==null?void 0:a.isRTL(l.floating)),C=d||(x||!v?[r0(s)]:NQ(s));!d&&m!=="none"&&C.push(...DQ(s,v,m,w));const T=[s,...C],A=await jp(e,b),_=[];let R=((n=i.flip)==null?void 0:n.overflows)||[];if(c&&_.push(A[S]),f){const U=PQ(r,o,w);_.push(A[U[0]],A[U[1]])}if(R=[...R,{placement:r,overflows:_}],!_.every(U=>U<=0)){var M,I;const U=(((M=i.flip)==null?void 0:M.index)||0)+1,L=T[U];if(L)return{data:{index:U,overflows:R},reset:{placement:L}};let G=(I=R.filter(K=>K.overflows[0]<=0).sort((K,F)=>K.overflows[1]-F.overflows[1])[0])==null?void 0:I.placement;if(!G)switch(p){case"bestFit":{var V;const K=(V=R.map(F=>[F.placement,F.overflows.filter(ie=>ie>0).reduce((ie,ae)=>ie+ae,0)]).sort((F,ie)=>F[1]-ie[1])[0])==null?void 0:V[0];K&&(G=K);break}case"initialPlacement":G=s;break}if(r!==G)return{reset:{placement:G}}}return{}}}};function UP(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function WP(t){return AQ.some(e=>t[e]>=0)}const jQ=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n}=e,{strategy:r="referenceHidden",...i}=Ia(t,e);switch(r){case"referenceHidden":{const o=await jp(e,{...i,elementContext:"reference"}),s=UP(o,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:WP(s)}}}case"escaped":{const o=await jp(e,{...i,altBoundary:!0}),s=UP(o,n.floating);return{data:{escapedOffsets:s,escaped:WP(s)}}}default:return{}}}}};async function BQ(t,e){const{placement:n,platform:r,elements:i}=t,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),s=ja(n),a=Ed(n),l=_d(n)==="y",c=["left","top"].includes(s)?-1:1,f=o&&l?-1:1,d=Ia(e,t);let{mainAxis:p,crossAxis:m,alignmentAxis:v}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return a&&typeof v=="number"&&(m=a==="end"?v*-1:v),l?{x:m*f,y:p*c}:{x:p*c,y:m*f}}const FQ=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){const{x:n,y:r}=e,i=await BQ(e,t);return{x:n+i.x,y:r+i.y,data:i}}}},zQ=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:r,placement:i}=e,{mainAxis:o=!0,crossAxis:s=!1,limiter:a={fn:S=>{let{x,y:w}=S;return{x,y:w}}},...l}=Ia(t,e),c={x:n,y:r},f=await jp(e,l),d=_d(ja(i)),p=L_(d);let m=c[p],v=c[d];if(o){const S=p==="y"?"top":"left",x=p==="y"?"bottom":"right",w=m+f[S],C=m-f[x];m=jC(w,m,C)}if(s){const S=d==="y"?"top":"left",x=d==="y"?"bottom":"right",w=v+f[S],C=v-f[x];v=jC(w,v,C)}const b=a.fn({...e,[p]:m,[d]:v});return{...b,data:{x:b.x-n,y:b.y-r}}}}},VQ=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:n,y:r,placement:i,rects:o,middlewareData:s}=e,{offset:a=0,mainAxis:l=!0,crossAxis:c=!0}=Ia(t,e),f={x:n,y:r},d=_d(i),p=L_(d);let m=f[p],v=f[d];const b=Ia(a,e),S=typeof b=="number"?{mainAxis:b,crossAxis:0}:{mainAxis:0,crossAxis:0,...b};if(l){const C=p==="y"?"height":"width",T=o.reference[p]-o.floating[C]+S.mainAxis,A=o.reference[p]+o.reference[C]-S.mainAxis;m<T?m=T:m>A&&(m=A)}if(c){var x,w;const C=p==="y"?"width":"height",T=["top","left"].includes(ja(i)),A=o.reference[d]-o.floating[C]+(T&&((x=s.offset)==null?void 0:x[d])||0)+(T?0:S.crossAxis),_=o.reference[d]+o.reference[C]+(T?0:((w=s.offset)==null?void 0:w[d])||0)-(T?S.crossAxis:0);v<A?v=A:v>_&&(v=_)}return{[p]:m,[d]:v}}}},UQ=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){const{placement:n,rects:r,platform:i,elements:o}=e,{apply:s=()=>{},...a}=Ia(t,e),l=await jp(e,a),c=ja(n),f=Ed(n),d=_d(n)==="y",{width:p,height:m}=r.floating;let v,b;c==="top"||c==="bottom"?(v=c,b=f===(await(i.isRTL==null?void 0:i.isRTL(o.floating))?"start":"end")?"left":"right"):(b=c,v=f==="end"?"top":"bottom");const S=m-l[v],x=p-l[b],w=!e.middlewareData.shift;let C=S,T=x;if(d){const _=p-l.left-l.right;T=f||w?Wl(x,_):_}else{const _=m-l.top-l.bottom;C=f||w?Wl(S,_):_}if(w&&!f){const _=Yi(l.left,0),R=Yi(l.right,0),M=Yi(l.top,0),I=Yi(l.bottom,0);d?T=p-2*(_!==0||R!==0?_+R:Yi(l.left,l.right)):C=m-2*(M!==0||I!==0?M+I:Yi(l.top,l.bottom))}await s({...e,availableWidth:T,availableHeight:C});const A=await i.getDimensions(o.floating);return p!==A.width||m!==A.height?{reset:{rects:!0}}:{}}}};function ql(t){return a3(t)?(t.nodeName||"").toLowerCase():"#document"}function ro(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Ka(t){var e;return(e=(a3(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function a3(t){return t instanceof Node||t instanceof ro(t).Node}function Ba(t){return t instanceof Element||t instanceof ro(t).Element}function Xs(t){return t instanceof HTMLElement||t instanceof ro(t).HTMLElement}function HP(t){return typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof ro(t).ShadowRoot}function Rm(t){const{overflow:e,overflowX:n,overflowY:r,display:i}=jo(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&!["inline","contents"].includes(i)}function WQ(t){return["table","td","th"].includes(ql(t))}function j_(t){const e=B_(),n=jo(t);return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function HQ(t){let e=od(t);for(;Xs(e)&&!Lb(e);){if(j_(e))return e;e=od(e)}return null}function B_(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Lb(t){return["html","body","#document"].includes(ql(t))}function jo(t){return ro(t).getComputedStyle(t)}function $b(t){return Ba(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function od(t){if(ql(t)==="html")return t;const e=t.assignedSlot||t.parentNode||HP(t)&&t.host||Ka(t);return HP(e)?e.host:e}function l3(t){const e=od(t);return Lb(e)?t.ownerDocument?t.ownerDocument.body:t.body:Xs(e)&&Rm(e)?e:l3(e)}function o0(t,e){var n;e===void 0&&(e=[]);const r=l3(t),i=r===((n=t.ownerDocument)==null?void 0:n.body),o=ro(r);return i?e.concat(o,o.visualViewport||[],Rm(r)?r:[]):e.concat(r,o0(r))}function c3(t){const e=jo(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const i=Xs(t),o=i?t.offsetWidth:n,s=i?t.offsetHeight:r,a=n0(n)!==o||n0(r)!==s;return a&&(n=o,r=s),{width:n,height:r,$:a}}function F_(t){return Ba(t)?t:t.contextElement}function jf(t){const e=F_(t);if(!Xs(e))return Hl(1);const n=e.getBoundingClientRect(),{width:r,height:i,$:o}=c3(e);let s=(o?n0(n.width):n.width)/r,a=(o?n0(n.height):n.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const qQ=Hl(0);function u3(t){const e=ro(t);return!B_()||!e.visualViewport?qQ:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function KQ(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==ro(t)?!1:e}function ou(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),o=F_(t);let s=Hl(1);e&&(r?Ba(r)&&(s=jf(r)):s=jf(t));const a=KQ(o,n,r)?u3(o):Hl(0);let l=(i.left+a.x)/s.x,c=(i.top+a.y)/s.y,f=i.width/s.x,d=i.height/s.y;if(o){const p=ro(o),m=r&&Ba(r)?ro(r):r;let v=p.frameElement;for(;v&&r&&m!==p;){const b=jf(v),S=v.getBoundingClientRect(),x=jo(v),w=S.left+(v.clientLeft+parseFloat(x.paddingLeft))*b.x,C=S.top+(v.clientTop+parseFloat(x.paddingTop))*b.y;l*=b.x,c*=b.y,f*=b.x,d*=b.y,l+=w,c+=C,v=ro(v).frameElement}}return i0({width:f,height:d,x:l,y:c})}function GQ(t){let{rect:e,offsetParent:n,strategy:r}=t;const i=Xs(n),o=Ka(n);if(n===o)return e;let s={scrollLeft:0,scrollTop:0},a=Hl(1);const l=Hl(0);if((i||!i&&r!=="fixed")&&((ql(n)!=="body"||Rm(o))&&(s=$b(n)),Xs(n))){const c=ou(n);a=jf(n),l.x=c.x+n.clientLeft,l.y=c.y+n.clientTop}return{width:e.width*a.x,height:e.height*a.y,x:e.x*a.x-s.scrollLeft*a.x+l.x,y:e.y*a.y-s.scrollTop*a.y+l.y}}function YQ(t){return Array.from(t.getClientRects())}function f3(t){return ou(Ka(t)).left+$b(t).scrollLeft}function XQ(t){const e=Ka(t),n=$b(t),r=t.ownerDocument.body,i=Yi(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),o=Yi(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+f3(t);const a=-n.scrollTop;return jo(r).direction==="rtl"&&(s+=Yi(e.clientWidth,r.clientWidth)-i),{width:i,height:o,x:s,y:a}}function ZQ(t,e){const n=ro(t),r=Ka(t),i=n.visualViewport;let o=r.clientWidth,s=r.clientHeight,a=0,l=0;if(i){o=i.width,s=i.height;const c=B_();(!c||c&&e==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}return{width:o,height:s,x:a,y:l}}function QQ(t,e){const n=ou(t,!0,e==="fixed"),r=n.top+t.clientTop,i=n.left+t.clientLeft,o=Xs(t)?jf(t):Hl(1),s=t.clientWidth*o.x,a=t.clientHeight*o.y,l=i*o.x,c=r*o.y;return{width:s,height:a,x:l,y:c}}function qP(t,e,n){let r;if(e==="viewport")r=ZQ(t,n);else if(e==="document")r=XQ(Ka(t));else if(Ba(e))r=QQ(e,n);else{const i=u3(t);r={...e,x:e.x-i.x,y:e.y-i.y}}return i0(r)}function d3(t,e){const n=od(t);return n===e||!Ba(n)||Lb(n)?!1:jo(n).position==="fixed"||d3(n,e)}function JQ(t,e){const n=e.get(t);if(n)return n;let r=o0(t).filter(a=>Ba(a)&&ql(a)!=="body"),i=null;const o=jo(t).position==="fixed";let s=o?od(t):t;for(;Ba(s)&&!Lb(s);){const a=jo(s),l=j_(s);!l&&a.position==="fixed"&&(i=null),(o?!l&&!i:!l&&a.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||Rm(s)&&!l&&d3(t,s))?r=r.filter(f=>f!==s):i=a,s=od(s)}return e.set(t,r),r}function eJ(t){let{element:e,boundary:n,rootBoundary:r,strategy:i}=t;const s=[...n==="clippingAncestors"?JQ(e,this._c):[].concat(n),r],a=s[0],l=s.reduce((c,f)=>{const d=qP(e,f,i);return c.top=Yi(d.top,c.top),c.right=Wl(d.right,c.right),c.bottom=Wl(d.bottom,c.bottom),c.left=Yi(d.left,c.left),c},qP(e,a,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function tJ(t){return c3(t)}function nJ(t,e,n){const r=Xs(e),i=Ka(e),o=n==="fixed",s=ou(t,!0,o,e);let a={scrollLeft:0,scrollTop:0};const l=Hl(0);if(r||!r&&!o)if((ql(e)!=="body"||Rm(i))&&(a=$b(e)),r){const c=ou(e,!0,o,e);l.x=c.x+e.clientLeft,l.y=c.y+e.clientTop}else i&&(l.x=f3(i));return{x:s.left+a.scrollLeft-l.x,y:s.top+a.scrollTop-l.y,width:s.width,height:s.height}}function KP(t,e){return!Xs(t)||jo(t).position==="fixed"?null:e?e(t):t.offsetParent}function h3(t,e){const n=ro(t);if(!Xs(t))return n;let r=KP(t,e);for(;r&&WQ(r)&&jo(r).position==="static";)r=KP(r,e);return r&&(ql(r)==="html"||ql(r)==="body"&&jo(r).position==="static"&&!j_(r))?n:r||HQ(t)||n}const rJ=async function(t){let{reference:e,floating:n,strategy:r}=t;const i=this.getOffsetParent||h3,o=this.getDimensions;return{reference:nJ(e,await i(n),r),floating:{x:0,y:0,...await o(n)}}};function iJ(t){return jo(t).direction==="rtl"}const oJ={convertOffsetParentRelativeRectToViewportRelativeRect:GQ,getDocumentElement:Ka,getClippingRect:eJ,getOffsetParent:h3,getElementRects:rJ,getClientRects:YQ,getDimensions:tJ,getScale:jf,isElement:Ba,isRTL:iJ};function sJ(t,e){let n=null,r;const i=Ka(t);function o(){clearTimeout(r),n&&n.disconnect(),n=null}function s(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),o();const{left:c,top:f,width:d,height:p}=t.getBoundingClientRect();if(a||e(),!d||!p)return;const m=tv(f),v=tv(i.clientWidth-(c+d)),b=tv(i.clientHeight-(f+p)),S=tv(c),w={rootMargin:-m+"px "+-v+"px "+-b+"px "+-S+"px",threshold:Yi(0,Wl(1,l))||1};let C=!0;function T(A){const _=A[0].intersectionRatio;if(_!==l){if(!C)return s();_?s(!1,_):r=setTimeout(()=>{s(!1,1e-7)},100)}C=!1}try{n=new IntersectionObserver(T,{...w,root:i.ownerDocument})}catch{n=new IntersectionObserver(T,w)}n.observe(t)}return s(!0),o}function aJ(t,e,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=F_(t),f=i||o?[...c?o0(c):[],...o0(e)]:[];f.forEach(x=>{i&&x.addEventListener("scroll",n,{passive:!0}),o&&x.addEventListener("resize",n)});const d=c&&a?sJ(c,n):null;let p=-1,m=null;s&&(m=new ResizeObserver(x=>{let[w]=x;w&&w.target===c&&m&&(m.unobserve(e),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{m&&m.observe(e)})),n()}),c&&!l&&m.observe(c),m.observe(e));let v,b=l?ou(t):null;l&&S();function S(){const x=ou(t);b&&(x.x!==b.x||x.y!==b.y||x.width!==b.width||x.height!==b.height)&&n(),b=x,v=requestAnimationFrame(S)}return n(),()=>{f.forEach(x=>{i&&x.removeEventListener("scroll",n),o&&x.removeEventListener("resize",n)}),d&&d(),m&&m.disconnect(),m=null,l&&cancelAnimationFrame(v)}}const lJ=(t,e,n)=>{const r=new Map,i={platform:oJ,...n},o={...i.platform,_c:r};return $Q(t,e,{...i,platform:o})},cJ=t=>{function e(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:t,fn(n){const{element:r,padding:i}=typeof t=="function"?t(n):t;return r&&e(r)?r.current!=null?VP({element:r.current,padding:i}).fn(n):{}:r?VP({element:r,padding:i}).fn(n):{}}}};var iy=typeof document<"u"?g.useLayoutEffect:g.useEffect;function s0(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let n,r,i;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(n=t.length,n!=e.length)return!1;for(r=n;r--!==0;)if(!s0(t[r],e[r]))return!1;return!0}if(i=Object.keys(t),n=i.length,n!==Object.keys(e).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(e,i[r]))return!1;for(r=n;r--!==0;){const o=i[r];if(!(o==="_owner"&&t.$$typeof)&&!s0(t[o],e[o]))return!1}return!0}return t!==t&&e!==e}function p3(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function GP(t,e){const n=p3(t);return Math.round(e*n)/n}function YP(t){const e=g.useRef(t);return iy(()=>{e.current=t}),e}function uJ(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:o,floating:s}={},transform:a=!0,whileElementsMounted:l,open:c}=t,[f,d]=g.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[p,m]=g.useState(r);s0(p,r)||m(r);const[v,b]=g.useState(null),[S,x]=g.useState(null),w=g.useCallback(ie=>{ie!=_.current&&(_.current=ie,b(ie))},[b]),C=g.useCallback(ie=>{ie!==R.current&&(R.current=ie,x(ie))},[x]),T=o||v,A=s||S,_=g.useRef(null),R=g.useRef(null),M=g.useRef(f),I=YP(l),V=YP(i),U=g.useCallback(()=>{if(!_.current||!R.current)return;const ie={placement:e,strategy:n,middleware:p};V.current&&(ie.platform=V.current),lJ(_.current,R.current,ie).then(ae=>{const re={...ae,isPositioned:!0};L.current&&!s0(M.current,re)&&(M.current=re,na.flushSync(()=>{d(re)}))})},[p,e,n,V]);iy(()=>{c===!1&&M.current.isPositioned&&(M.current.isPositioned=!1,d(ie=>({...ie,isPositioned:!1})))},[c]);const L=g.useRef(!1);iy(()=>(L.current=!0,()=>{L.current=!1}),[]),iy(()=>{if(T&&(_.current=T),A&&(R.current=A),T&&A){if(I.current)return I.current(T,A,U);U()}},[T,A,U,I]);const G=g.useMemo(()=>({reference:_,floating:R,setReference:w,setFloating:C}),[w,C]),K=g.useMemo(()=>({reference:T,floating:A}),[T,A]),F=g.useMemo(()=>{const ie={position:n,left:0,top:0};if(!K.floating)return ie;const ae=GP(K.floating,f.x),re=GP(K.floating,f.y);return a?{...ie,transform:"translate("+ae+"px, "+re+"px)",...p3(K.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:ae,top:re}},[n,a,K.floating,f.x,f.y]);return g.useMemo(()=>({...f,update:U,refs:G,elements:K,floatingStyles:F}),[f,U,G,K,F])}function Ib(t){const[e,n]=g.useState(void 0);return Pi(()=>{if(t){n({width:t.offsetWidth,height:t.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const o=i[0];let s,a;if("borderBoxSize"in o){const l=o.borderBoxSize,c=Array.isArray(l)?l[0]:l;s=c.inlineSize,a=c.blockSize}else s=t.offsetWidth,a=t.offsetHeight;n({width:s,height:a})});return r.observe(t,{box:"border-box"}),()=>r.unobserve(t)}else n(void 0)},[t]),e}const m3="Popper",[g3,Td]=Fo(m3),[fJ,v3]=g3(m3),dJ=t=>{const{__scopePopper:e,children:n}=t,[r,i]=g.useState(null);return g.createElement(fJ,{scope:e,anchor:r,onAnchorChange:i},n)},hJ="PopperAnchor",pJ=g.forwardRef((t,e)=>{const{__scopePopper:n,virtualRef:r,...i}=t,o=v3(hJ,n),s=g.useRef(null),a=hn(e,s);return g.useEffect(()=>{o.onAnchorChange((r==null?void 0:r.current)||s.current)}),r?null:g.createElement(Dt.div,H({},i,{ref:a}))}),y3="PopperContent",[mJ,LCe]=g3(y3),gJ=g.forwardRef((t,e)=>{var n,r,i,o,s,a,l,c;const{__scopePopper:f,side:d="bottom",sideOffset:p=0,align:m="center",alignOffset:v=0,arrowPadding:b=0,collisionBoundary:S=[],collisionPadding:x=0,sticky:w="partial",hideWhenDetached:C=!1,avoidCollisions:T=!0,onPlaced:A,..._}=t,R=v3(y3,f),[M,I]=g.useState(null),V=hn(e,ue=>I(ue)),[U,L]=g.useState(null),G=Ib(U),K=(n=G==null?void 0:G.width)!==null&&n!==void 0?n:0,F=(r=G==null?void 0:G.height)!==null&&r!==void 0?r:0,ie=d+(m!=="center"?"-"+m:""),ae=typeof x=="number"?x:{top:0,right:0,bottom:0,left:0,...x},re=Array.isArray(S)?S:[S],W=re.length>0,P={padding:ae,boundary:re.filter(vJ),altBoundary:W},{refs:he,floatingStyles:fe,placement:$,isPositioned:Ne,middlewareData:He}=uJ({strategy:"fixed",placement:ie,whileElementsMounted:aJ,elements:{reference:R.anchor},middleware:[FQ({mainAxis:p+F,alignmentAxis:v}),T&&zQ({mainAxis:!0,crossAxis:!1,limiter:w==="partial"?VQ():void 0,...P}),T&&IQ({...P}),UQ({...P,apply:({elements:ue,rects:we,availableWidth:nt,availableHeight:et})=>{const{width:wt,height:nn}=we.reference,z=ue.floating.style;z.setProperty("--radix-popper-available-width",`${nt}px`),z.setProperty("--radix-popper-available-height",`${et}px`),z.setProperty("--radix-popper-anchor-width",`${wt}px`),z.setProperty("--radix-popper-anchor-height",`${nn}px`)}}),U&&cJ({element:U,padding:b}),yJ({arrowWidth:K,arrowHeight:F}),C&&jQ({strategy:"referenceHidden"})]}),[Ye,Ie]=b3($),J=Ys(A);Pi(()=>{Ne&&(J==null||J())},[Ne,J]);const Se=(i=He.arrow)===null||i===void 0?void 0:i.x,Ee=(o=He.arrow)===null||o===void 0?void 0:o.y,ke=((s=He.arrow)===null||s===void 0?void 0:s.centerOffset)!==0,[oe,se]=g.useState();return Pi(()=>{M&&se(window.getComputedStyle(M).zIndex)},[M]),g.createElement("div",{ref:he.setFloating,"data-radix-popper-content-wrapper":"",style:{...fe,transform:Ne?fe.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:oe,"--radix-popper-transform-origin":[(a=He.transformOrigin)===null||a===void 0?void 0:a.x,(l=He.transformOrigin)===null||l===void 0?void 0:l.y].join(" ")},dir:t.dir},g.createElement(mJ,{scope:f,placedSide:Ye,onArrowChange:L,arrowX:Se,arrowY:Ee,shouldHideArrow:ke},g.createElement(Dt.div,H({"data-side":Ye,"data-align":Ie},_,{ref:V,style:{..._.style,animation:Ne?void 0:"none",opacity:(c=He.hide)!==null&&c!==void 0&&c.referenceHidden?0:void 0}}))))});function vJ(t){return t!==null}const yJ=t=>({name:"transformOrigin",options:t,fn(e){var n,r,i,o,s;const{placement:a,rects:l,middlewareData:c}=e,d=((n=c.arrow)===null||n===void 0?void 0:n.centerOffset)!==0,p=d?0:t.arrowWidth,m=d?0:t.arrowHeight,[v,b]=b3(a),S={start:"0%",center:"50%",end:"100%"}[b],x=((r=(i=c.arrow)===null||i===void 0?void 0:i.x)!==null&&r!==void 0?r:0)+p/2,w=((o=(s=c.arrow)===null||s===void 0?void 0:s.y)!==null&&o!==void 0?o:0)+m/2;let C="",T="";return v==="bottom"?(C=d?S:`${x}px`,T=`${-m}px`):v==="top"?(C=d?S:`${x}px`,T=`${l.floating.height+m}px`):v==="right"?(C=`${-m}px`,T=d?S:`${w}px`):v==="left"&&(C=`${l.floating.width+m}px`,T=d?S:`${w}px`),{data:{x:C,y:T}}}});function b3(t){const[e,n="center"]=t.split("-");return[e,n]}const z_=dJ,V_=pJ,U_=gJ,jb=g.forwardRef((t,e)=>{var n;const{container:r=globalThis==null||(n=globalThis.document)===null||n===void 0?void 0:n.body,...i}=t;return r?O_.createPortal(g.createElement(Dt.div,H({},i,{ref:e})),r):null});function bJ(t,e){return g.useReducer((n,r)=>{const i=e[n][r];return i??n},t)}const ws=t=>{const{present:e,children:n}=t,r=wJ(e),i=typeof n=="function"?n({present:r.isPresent}):g.Children.only(n),o=hn(r.ref,i.ref);return typeof n=="function"||r.isPresent?g.cloneElement(i,{ref:o}):null};ws.displayName="Presence";function wJ(t){const[e,n]=g.useState(),r=g.useRef({}),i=g.useRef(t),o=g.useRef("none"),s=t?"mounted":"unmounted",[a,l]=bJ(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return g.useEffect(()=>{const c=nv(r.current);o.current=a==="mounted"?c:"none"},[a]),Pi(()=>{const c=r.current,f=i.current;if(f!==t){const p=o.current,m=nv(c);t?l("MOUNT"):m==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(f&&p!==m?"ANIMATION_OUT":"UNMOUNT"),i.current=t}},[t,l]),Pi(()=>{if(e){const c=d=>{const m=nv(r.current).includes(d.animationName);d.target===e&&m&&na.flushSync(()=>l("ANIMATION_END"))},f=d=>{d.target===e&&(o.current=nv(r.current))};return e.addEventListener("animationstart",f),e.addEventListener("animationcancel",c),e.addEventListener("animationend",c),()=>{e.removeEventListener("animationstart",f),e.removeEventListener("animationcancel",c),e.removeEventListener("animationend",c)}}else l("ANIMATION_END")},[e,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:g.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function nv(t){return(t==null?void 0:t.animationName)||"none"}function Zs({prop:t,defaultProp:e,onChange:n=()=>{}}){const[r,i]=xJ({defaultProp:e,onChange:n}),o=t!==void 0,s=o?t:r,a=Ys(n),l=g.useCallback(c=>{if(o){const d=typeof c=="function"?c(t):c;d!==t&&a(d)}else i(c)},[o,t,i,a]);return[s,l]}function xJ({defaultProp:t,onChange:e}){const n=g.useState(t),[r]=n,i=g.useRef(r),o=Ys(e);return g.useEffect(()=>{i.current!==r&&(o(r),i.current=r)},[r,i,o]),n}const w3=g.forwardRef((t,e)=>g.createElement(Dt.span,H({},t,{ref:e,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...t.style}}))),SJ=w3,[Bb,$Ce]=Fo("Tooltip",[Td]),W_=Td(),CJ="TooltipProvider",kJ=700,FC="tooltip.open",[EJ,H_]=Bb(CJ),_J=t=>{const{__scopeTooltip:e,delayDuration:n=kJ,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:o}=t,[s,a]=g.useState(!0),l=g.useRef(!1),c=g.useRef(0);return g.useEffect(()=>{const f=c.current;return()=>window.clearTimeout(f)},[]),g.createElement(EJ,{scope:e,isOpenDelayed:s,delayDuration:n,onOpen:g.useCallback(()=>{window.clearTimeout(c.current),a(!1)},[]),onClose:g.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>a(!0),r)},[r]),isPointerInTransitRef:l,onPointerInTransitChange:g.useCallback(f=>{l.current=f},[]),disableHoverableContent:i},o)},q_="Tooltip",[TJ,Pm]=Bb(q_),AJ=t=>{const{__scopeTooltip:e,children:n,open:r,defaultOpen:i=!1,onOpenChange:o,disableHoverableContent:s,delayDuration:a}=t,l=H_(q_,t.__scopeTooltip),c=W_(e),[f,d]=g.useState(null),p=Oa(),m=g.useRef(0),v=s??l.disableHoverableContent,b=a??l.delayDuration,S=g.useRef(!1),[x=!1,w]=Zs({prop:r,defaultProp:i,onChange:R=>{R?(l.onOpen(),document.dispatchEvent(new CustomEvent(FC))):l.onClose(),o==null||o(R)}}),C=g.useMemo(()=>x?S.current?"delayed-open":"instant-open":"closed",[x]),T=g.useCallback(()=>{window.clearTimeout(m.current),S.current=!1,w(!0)},[w]),A=g.useCallback(()=>{window.clearTimeout(m.current),w(!1)},[w]),_=g.useCallback(()=>{window.clearTimeout(m.current),m.current=window.setTimeout(()=>{S.current=!0,w(!0)},b)},[b,w]);return g.useEffect(()=>()=>window.clearTimeout(m.current),[]),g.createElement(z_,c,g.createElement(TJ,{scope:e,contentId:p,open:x,stateAttribute:C,trigger:f,onTriggerChange:d,onTriggerEnter:g.useCallback(()=>{l.isOpenDelayed?_():T()},[l.isOpenDelayed,_,T]),onTriggerLeave:g.useCallback(()=>{v?A():window.clearTimeout(m.current)},[A,v]),onOpen:T,onClose:A,disableHoverableContent:v},n))},XP="TooltipTrigger",OJ=g.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,i=Pm(XP,n),o=H_(XP,n),s=W_(n),a=g.useRef(null),l=hn(e,a,i.onTriggerChange),c=g.useRef(!1),f=g.useRef(!1),d=g.useCallback(()=>c.current=!1,[]);return g.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),g.createElement(V_,H({asChild:!0},s),g.createElement(Dt.button,H({"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute},r,{ref:l,onPointerMove:yt(t.onPointerMove,p=>{p.pointerType!=="touch"&&!f.current&&!o.isPointerInTransitRef.current&&(i.onTriggerEnter(),f.current=!0)}),onPointerLeave:yt(t.onPointerLeave,()=>{i.onTriggerLeave(),f.current=!1}),onPointerDown:yt(t.onPointerDown,()=>{c.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:yt(t.onFocus,()=>{c.current||i.onOpen()}),onBlur:yt(t.onBlur,i.onClose),onClick:yt(t.onClick,i.onClose)})))}),x3="TooltipPortal",[RJ,PJ]=Bb(x3,{forceMount:void 0}),NJ=t=>{const{__scopeTooltip:e,forceMount:n,children:r,container:i}=t,o=Pm(x3,e);return g.createElement(RJ,{scope:e,forceMount:n},g.createElement(ws,{present:n||o.open},g.createElement(jb,{asChild:!0,container:i},r)))},Bp="TooltipContent",MJ=g.forwardRef((t,e)=>{const n=PJ(Bp,t.__scopeTooltip),{forceMount:r=n.forceMount,side:i="top",...o}=t,s=Pm(Bp,t.__scopeTooltip);return g.createElement(ws,{present:r||s.open},s.disableHoverableContent?g.createElement(S3,H({side:i},o,{ref:e})):g.createElement(DJ,H({side:i},o,{ref:e})))}),DJ=g.forwardRef((t,e)=>{const n=Pm(Bp,t.__scopeTooltip),r=H_(Bp,t.__scopeTooltip),i=g.useRef(null),o=hn(e,i),[s,a]=g.useState(null),{trigger:l,onClose:c}=n,f=i.current,{onPointerInTransitChange:d}=r,p=g.useCallback(()=>{a(null),d(!1)},[d]),m=g.useCallback((v,b)=>{const S=v.currentTarget,x={x:v.clientX,y:v.clientY},w=$J(x,S.getBoundingClientRect()),C=IJ(x,w),T=jJ(b.getBoundingClientRect()),A=FJ([...C,...T]);a(A),d(!0)},[d]);return g.useEffect(()=>()=>p(),[p]),g.useEffect(()=>{if(l&&f){const v=S=>m(S,f),b=S=>m(S,l);return l.addEventListener("pointerleave",v),f.addEventListener("pointerleave",b),()=>{l.removeEventListener("pointerleave",v),f.removeEventListener("pointerleave",b)}}},[l,f,m,p]),g.useEffect(()=>{if(s){const v=b=>{const S=b.target,x={x:b.clientX,y:b.clientY},w=(l==null?void 0:l.contains(S))||(f==null?void 0:f.contains(S)),C=!BJ(x,s);w?p():C&&(p(),c())};return document.addEventListener("pointermove",v),()=>document.removeEventListener("pointermove",v)}},[l,f,s,c,p]),g.createElement(S3,H({},t,{ref:o}))}),[LJ,ICe]=Bb(q_,{isInside:!1}),S3=g.forwardRef((t,e)=>{const{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:o,onPointerDownOutside:s,...a}=t,l=Pm(Bp,n),c=W_(n),{onClose:f}=l;return g.useEffect(()=>(document.addEventListener(FC,f),()=>document.removeEventListener(FC,f)),[f]),g.useEffect(()=>{if(l.trigger){const d=p=>{const m=p.target;m!=null&&m.contains(l.trigger)&&f()};return window.addEventListener("scroll",d,{capture:!0}),()=>window.removeEventListener("scroll",d,{capture:!0})}},[l.trigger,f]),g.createElement(Db,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:d=>d.preventDefault(),onDismiss:f},g.createElement(U_,H({"data-state":l.stateAttribute},c,a,{ref:e,style:{...a.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"}}),g.createElement(i3,null,r),g.createElement(LJ,{scope:n,isInside:!0},g.createElement(SJ,{id:l.contentId,role:"tooltip"},i||r))))});function $J(t,e){const n=Math.abs(e.top-t.y),r=Math.abs(e.bottom-t.y),i=Math.abs(e.right-t.x),o=Math.abs(e.left-t.x);switch(Math.min(n,r,i,o)){case o:return"left";case i:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function IJ(t,e,n=5){const r=[];switch(e){case"top":r.push({x:t.x-n,y:t.y+n},{x:t.x+n,y:t.y+n});break;case"bottom":r.push({x:t.x-n,y:t.y-n},{x:t.x+n,y:t.y-n});break;case"left":r.push({x:t.x+n,y:t.y-n},{x:t.x+n,y:t.y+n});break;case"right":r.push({x:t.x-n,y:t.y-n},{x:t.x-n,y:t.y+n});break}return r}function jJ(t){const{top:e,right:n,bottom:r,left:i}=t;return[{x:i,y:e},{x:n,y:e},{x:n,y:r},{x:i,y:r}]}function BJ(t,e){const{x:n,y:r}=t;let i=!1;for(let o=0,s=e.length-1;o<e.length;s=o++){const a=e[o].x,l=e[o].y,c=e[s].x,f=e[s].y;l>r!=f>r&&n<(c-a)*(r-l)/(f-l)+a&&(i=!i)}return i}function FJ(t){const e=t.slice();return e.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),zJ(e)}function zJ(t){if(t.length<=1)return t.slice();const e=[];for(let r=0;r<t.length;r++){const i=t[r];for(;e.length>=2;){const o=e[e.length-1],s=e[e.length-2];if((o.x-s.x)*(i.y-s.y)>=(o.y-s.y)*(i.x-s.x))e.pop();else break}e.push(i)}e.pop();const n=[];for(let r=t.length-1;r>=0;r--){const i=t[r];for(;n.length>=2;){const o=n[n.length-1],s=n[n.length-2];if((o.x-s.x)*(i.y-s.y)>=(o.y-s.y)*(i.x-s.x))n.pop();else break}n.push(i)}return n.pop(),e.length===1&&n.length===1&&e[0].x===n[0].x&&e[0].y===n[0].y?e:e.concat(n)}const VJ=_J,UJ=AJ,WJ=OJ,HJ=NJ,C3=MJ;function k3(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t))for(e=0;e<t.length;e++)t[e]&&(n=k3(t[e]))&&(r&&(r+=" "),r+=n);else for(e in t)t[e]&&(r&&(r+=" "),r+=e);return r}function E3(){for(var t,e,n=0,r="";n<arguments.length;)(t=arguments[n++])&&(e=k3(t))&&(r&&(r+=" "),r+=e);return r}const K_="-";function qJ(t){const e=GJ(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=t;function i(s){const a=s.split(K_);return a[0]===""&&a.length!==1&&a.shift(),_3(a,e)||KJ(s)}function o(s,a){const l=n[s]||[];return a&&r[s]?[...l,...r[s]]:l}return{getClassGroupId:i,getConflictingClassGroupIds:o}}function _3(t,e){var s;if(t.length===0)return e.classGroupId;const n=t[0],r=e.nextPart.get(n),i=r?_3(t.slice(1),r):void 0;if(i)return i;if(e.validators.length===0)return;const o=t.join(K_);return(s=e.validators.find(({validator:a})=>a(o)))==null?void 0:s.classGroupId}const ZP=/^\[(.+)\]$/;function KJ(t){if(ZP.test(t)){const e=ZP.exec(t)[1],n=e==null?void 0:e.substring(0,e.indexOf(":"));if(n)return"arbitrary.."+n}}function GJ(t){const{theme:e,prefix:n}=t,r={nextPart:new Map,validators:[]};return XJ(Object.entries(t.classGroups),n).forEach(([o,s])=>{zC(s,r,o,e)}),r}function zC(t,e,n,r){t.forEach(i=>{if(typeof i=="string"){const o=i===""?e:QP(e,i);o.classGroupId=n;return}if(typeof i=="function"){if(YJ(i)){zC(i(r),e,n,r);return}e.validators.push({validator:i,classGroupId:n});return}Object.entries(i).forEach(([o,s])=>{zC(s,QP(e,o),n,r)})})}function QP(t,e){let n=t;return e.split(K_).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n}function YJ(t){return t.isThemeGetter}function XJ(t,e){return e?t.map(([n,r])=>{const i=r.map(o=>typeof o=="string"?e+o:typeof o=="object"?Object.fromEntries(Object.entries(o).map(([s,a])=>[e+s,a])):o);return[n,i]}):t}function ZJ(t){if(t<1)return{get:()=>{},set:()=>{}};let e=0,n=new Map,r=new Map;function i(o,s){n.set(o,s),e++,e>t&&(e=0,r=n,n=new Map)}return{get(o){let s=n.get(o);if(s!==void 0)return s;if((s=r.get(o))!==void 0)return i(o,s),s},set(o,s){n.has(o)?n.set(o,s):i(o,s)}}}const T3="!";function QJ(t){const e=t.separator,n=e.length===1,r=e[0],i=e.length;return function(s){const a=[];let l=0,c=0,f;for(let b=0;b<s.length;b++){let S=s[b];if(l===0){if(S===r&&(n||s.slice(b,b+i)===e)){a.push(s.slice(c,b)),c=b+i;continue}if(S==="/"){f=b;continue}}S==="["?l++:S==="]"&&l--}const d=a.length===0?s:s.substring(c),p=d.startsWith(T3),m=p?d.substring(1):d,v=f&&f>c?f-c:void 0;return{modifiers:a,hasImportantModifier:p,baseClassName:m,maybePostfixModifierPosition:v}}}function JJ(t){if(t.length<=1)return t;const e=[];let n=[];return t.forEach(r=>{r[0]==="["?(e.push(...n.sort(),r),n=[]):n.push(r)}),e.push(...n.sort()),e}function eee(t){return{cache:ZJ(t.cacheSize),splitModifiers:QJ(t),...qJ(t)}}const tee=/\s+/;function nee(t,e){const{splitModifiers:n,getClassGroupId:r,getConflictingClassGroupIds:i}=e,o=new Set;return t.trim().split(tee).map(s=>{const{modifiers:a,hasImportantModifier:l,baseClassName:c,maybePostfixModifierPosition:f}=n(s);let d=r(f?c.substring(0,f):c),p=!!f;if(!d){if(!f)return{isTailwindClass:!1,originalClassName:s};if(d=r(c),!d)return{isTailwindClass:!1,originalClassName:s};p=!1}const m=JJ(a).join(":");return{isTailwindClass:!0,modifierId:l?m+T3:m,classGroupId:d,originalClassName:s,hasPostfixModifier:p}}).reverse().filter(s=>{if(!s.isTailwindClass)return!0;const{modifierId:a,classGroupId:l,hasPostfixModifier:c}=s,f=a+l;return o.has(f)?!1:(o.add(f),i(l,c).forEach(d=>o.add(a+d)),!0)}).reverse().map(s=>s.originalClassName).join(" ")}function ree(){let t=0,e,n,r="";for(;t<arguments.length;)(e=arguments[t++])&&(n=A3(e))&&(r&&(r+=" "),r+=n);return r}function A3(t){if(typeof t=="string")return t;let e,n="";for(let r=0;r<t.length;r++)t[r]&&(e=A3(t[r]))&&(n&&(n+=" "),n+=e);return n}function iee(t,...e){let n,r,i,o=s;function s(l){const c=e.reduce((f,d)=>d(f),t());return n=eee(c),r=n.cache.get,i=n.cache.set,o=a,a(l)}function a(l){const c=r(l);if(c)return c;const f=nee(l,n);return i(l,f),f}return function(){return o(ree.apply(null,arguments))}}function kn(t){const e=n=>n[t]||[];return e.isThemeGetter=!0,e}const O3=/^\[(?:([a-z-]+):)?(.+)\]$/i,oee=/^\d+\/\d+$/,see=new Set(["px","full","screen"]),aee=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,lee=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,cee=/^-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,uee=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;function Xo(t){return jc(t)||see.has(t)||oee.test(t)}function ll(t){return Ad(t,"length",yee)}function jc(t){return!!t&&!Number.isNaN(Number(t))}function rv(t){return Ad(t,"number",jc)}function xh(t){return!!t&&Number.isInteger(Number(t))}function fee(t){return t.endsWith("%")&&jc(t.slice(0,-1))}function At(t){return O3.test(t)}function cl(t){return aee.test(t)}const dee=new Set(["length","size","percentage"]);function hee(t){return Ad(t,dee,R3)}function pee(t){return Ad(t,"position",R3)}const mee=new Set(["image","url"]);function gee(t){return Ad(t,mee,wee)}function vee(t){return Ad(t,"",bee)}function Sh(){return!0}function Ad(t,e,n){const r=O3.exec(t);return r?r[1]?typeof e=="string"?r[1]===e:e.has(r[1]):n(r[2]):!1}function yee(t){return lee.test(t)}function R3(){return!1}function bee(t){return cee.test(t)}function wee(t){return uee.test(t)}function xee(){const t=kn("colors"),e=kn("spacing"),n=kn("blur"),r=kn("brightness"),i=kn("borderColor"),o=kn("borderRadius"),s=kn("borderSpacing"),a=kn("borderWidth"),l=kn("contrast"),c=kn("grayscale"),f=kn("hueRotate"),d=kn("invert"),p=kn("gap"),m=kn("gradientColorStops"),v=kn("gradientColorStopPositions"),b=kn("inset"),S=kn("margin"),x=kn("opacity"),w=kn("padding"),C=kn("saturate"),T=kn("scale"),A=kn("sepia"),_=kn("skew"),R=kn("space"),M=kn("translate"),I=()=>["auto","contain","none"],V=()=>["auto","hidden","clip","visible","scroll"],U=()=>["auto",At,e],L=()=>[At,e],G=()=>["",Xo,ll],K=()=>["auto",jc,At],F=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],ie=()=>["solid","dashed","dotted","double","none"],ae=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-lighter"],re=()=>["start","end","center","between","around","evenly","stretch"],W=()=>["","0",At],P=()=>["auto","avoid","all","avoid-page","page","left","right","column"],he=()=>[jc,rv],fe=()=>[jc,At];return{cacheSize:500,separator:":",theme:{colors:[Sh],spacing:[Xo,ll],blur:["none","",cl,At],brightness:he(),borderColor:[t],borderRadius:["none","","full",cl,At],borderSpacing:L(),borderWidth:G(),contrast:he(),grayscale:W(),hueRotate:fe(),invert:W(),gap:L(),gradientColorStops:[t],gradientColorStopPositions:[fee,ll],inset:U(),margin:U(),opacity:he(),padding:L(),saturate:he(),scale:he(),sepia:W(),skew:fe(),space:L(),translate:L()},classGroups:{aspect:[{aspect:["auto","square","video",At]}],container:["container"],columns:[{columns:[cl]}],"break-after":[{"break-after":P()}],"break-before":[{"break-before":P()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none"]}],clear:[{clear:["left","right","both","none"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...F(),At]}],overflow:[{overflow:V()}],"overflow-x":[{"overflow-x":V()}],"overflow-y":[{"overflow-y":V()}],overscroll:[{overscroll:I()}],"overscroll-x":[{"overscroll-x":I()}],"overscroll-y":[{"overscroll-y":I()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[b]}],"inset-x":[{"inset-x":[b]}],"inset-y":[{"inset-y":[b]}],start:[{start:[b]}],end:[{end:[b]}],top:[{top:[b]}],right:[{right:[b]}],bottom:[{bottom:[b]}],left:[{left:[b]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",xh,At]}],basis:[{basis:U()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",At]}],grow:[{grow:W()}],shrink:[{shrink:W()}],order:[{order:["first","last","none",xh,At]}],"grid-cols":[{"grid-cols":[Sh]}],"col-start-end":[{col:["auto",{span:["full",xh,At]},At]}],"col-start":[{"col-start":K()}],"col-end":[{"col-end":K()}],"grid-rows":[{"grid-rows":[Sh]}],"row-start-end":[{row:["auto",{span:[xh,At]},At]}],"row-start":[{"row-start":K()}],"row-end":[{"row-end":K()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",At]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",At]}],gap:[{gap:[p]}],"gap-x":[{"gap-x":[p]}],"gap-y":[{"gap-y":[p]}],"justify-content":[{justify:["normal",...re()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...re(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...re(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[w]}],px:[{px:[w]}],py:[{py:[w]}],ps:[{ps:[w]}],pe:[{pe:[w]}],pt:[{pt:[w]}],pr:[{pr:[w]}],pb:[{pb:[w]}],pl:[{pl:[w]}],m:[{m:[S]}],mx:[{mx:[S]}],my:[{my:[S]}],ms:[{ms:[S]}],me:[{me:[S]}],mt:[{mt:[S]}],mr:[{mr:[S]}],mb:[{mb:[S]}],ml:[{ml:[S]}],"space-x":[{"space-x":[R]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[R]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit",At,e]}],"min-w":[{"min-w":["min","max","fit",At,Xo]}],"max-w":[{"max-w":["0","none","full","min","max","fit","prose",{screen:[cl]},cl,At]}],h:[{h:[At,e,"auto","min","max","fit"]}],"min-h":[{"min-h":["min","max","fit",Xo,At]}],"max-h":[{"max-h":[At,e,"min","max","fit"]}],"font-size":[{text:["base",cl,ll]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",rv]}],"font-family":[{font:[Sh]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",At]}],"line-clamp":[{"line-clamp":["none",jc,rv]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Xo,At]}],"list-image":[{"list-image":["none",At]}],"list-style-type":[{list:["none","disc","decimal",At]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[t]}],"placeholder-opacity":[{"placeholder-opacity":[x]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[t]}],"text-opacity":[{"text-opacity":[x]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ie(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Xo,ll]}],"underline-offset":[{"underline-offset":["auto",Xo,At]}],"text-decoration-color":[{decoration:[t]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],indent:[{indent:L()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",At]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",At]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[x]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...F(),pee]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",hee]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},gee]}],"bg-color":[{bg:[t]}],"gradient-from-pos":[{from:[v]}],"gradient-via-pos":[{via:[v]}],"gradient-to-pos":[{to:[v]}],"gradient-from":[{from:[m]}],"gradient-via":[{via:[m]}],"gradient-to":[{to:[m]}],rounded:[{rounded:[o]}],"rounded-s":[{"rounded-s":[o]}],"rounded-e":[{"rounded-e":[o]}],"rounded-t":[{"rounded-t":[o]}],"rounded-r":[{"rounded-r":[o]}],"rounded-b":[{"rounded-b":[o]}],"rounded-l":[{"rounded-l":[o]}],"rounded-ss":[{"rounded-ss":[o]}],"rounded-se":[{"rounded-se":[o]}],"rounded-ee":[{"rounded-ee":[o]}],"rounded-es":[{"rounded-es":[o]}],"rounded-tl":[{"rounded-tl":[o]}],"rounded-tr":[{"rounded-tr":[o]}],"rounded-br":[{"rounded-br":[o]}],"rounded-bl":[{"rounded-bl":[o]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[x]}],"border-style":[{border:[...ie(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[x]}],"divide-style":[{divide:ie()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...ie()]}],"outline-offset":[{"outline-offset":[Xo,At]}],"outline-w":[{outline:[Xo,ll]}],"outline-color":[{outline:[t]}],"ring-w":[{ring:G()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[t]}],"ring-opacity":[{"ring-opacity":[x]}],"ring-offset-w":[{"ring-offset":[Xo,ll]}],"ring-offset-color":[{"ring-offset":[t]}],shadow:[{shadow:["","inner","none",cl,vee]}],"shadow-color":[{shadow:[Sh]}],opacity:[{opacity:[x]}],"mix-blend":[{"mix-blend":ae()}],"bg-blend":[{"bg-blend":ae()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",cl,At]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[f]}],invert:[{invert:[d]}],saturate:[{saturate:[C]}],sepia:[{sepia:[A]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[f]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[x]}],"backdrop-saturate":[{"backdrop-saturate":[C]}],"backdrop-sepia":[{"backdrop-sepia":[A]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[s]}],"border-spacing-x":[{"border-spacing-x":[s]}],"border-spacing-y":[{"border-spacing-y":[s]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",At]}],duration:[{duration:fe()}],ease:[{ease:["linear","in","out","in-out",At]}],delay:[{delay:fe()}],animate:[{animate:["none","spin","ping","pulse","bounce",At]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[T]}],"scale-x":[{"scale-x":[T]}],"scale-y":[{"scale-y":[T]}],rotate:[{rotate:[xh,At]}],"translate-x":[{"translate-x":[M]}],"translate-y":[{"translate-y":[M]}],"skew-x":[{"skew-x":[_]}],"skew-y":[{"skew-y":[_]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",At]}],accent:[{accent:["auto",t]}],appearance:["appearance-none"],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",At]}],"caret-color":[{caret:[t]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":L()}],"scroll-mx":[{"scroll-mx":L()}],"scroll-my":[{"scroll-my":L()}],"scroll-ms":[{"scroll-ms":L()}],"scroll-me":[{"scroll-me":L()}],"scroll-mt":[{"scroll-mt":L()}],"scroll-mr":[{"scroll-mr":L()}],"scroll-mb":[{"scroll-mb":L()}],"scroll-ml":[{"scroll-ml":L()}],"scroll-p":[{"scroll-p":L()}],"scroll-px":[{"scroll-px":L()}],"scroll-py":[{"scroll-py":L()}],"scroll-ps":[{"scroll-ps":L()}],"scroll-pe":[{"scroll-pe":L()}],"scroll-pt":[{"scroll-pt":L()}],"scroll-pr":[{"scroll-pr":L()}],"scroll-pb":[{"scroll-pb":L()}],"scroll-pl":[{"scroll-pl":L()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",At]}],fill:[{fill:[t,"none"]}],"stroke-w":[{stroke:[Xo,ll,rv]}],stroke:[{stroke:[t,"none"]}],sr:["sr-only","not-sr-only"]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}}const See=iee(xee);function ft(...t){return See(E3(t))}const Cee=VJ,Ls=UJ,$s=WJ,Cc=HJ,ss=g.forwardRef(({className:t,sideOffset:e=4,...n},r)=>k.jsx(C3,{ref:r,sideOffset:e,className:ft("bg-primary text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 overflow-hidden rounded-md px-3 py-1.5 text-xs",t),...n}));ss.displayName=C3.displayName;var Xt;(function(t){t.assertEqual=i=>i;function e(i){}t.assertIs=e;function n(i){throw new Error}t.assertNever=n,t.arrayToEnum=i=>{const o={};for(const s of i)o[s]=s;return o},t.getValidEnumValues=i=>{const o=t.objectKeys(i).filter(a=>typeof i[i[a]]!="number"),s={};for(const a of o)s[a]=i[a];return t.objectValues(s)},t.objectValues=i=>t.objectKeys(i).map(function(o){return i[o]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const o=[];for(const s in i)Object.prototype.hasOwnProperty.call(i,s)&&o.push(s);return o},t.find=(i,o)=>{for(const s of i)if(o(s))return s},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function r(i,o=" | "){return i.map(s=>typeof s=="string"?`'${s}'`:s).join(o)}t.joinValues=r,t.jsonStringifyReplacer=(i,o)=>typeof o=="bigint"?o.toString():o})(Xt||(Xt={}));var VC;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(VC||(VC={}));const Ke=Xt.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),xl=t=>{switch(typeof t){case"undefined":return Ke.undefined;case"string":return Ke.string;case"number":return isNaN(t)?Ke.nan:Ke.number;case"boolean":return Ke.boolean;case"function":return Ke.function;case"bigint":return Ke.bigint;case"symbol":return Ke.symbol;case"object":return Array.isArray(t)?Ke.array:t===null?Ke.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?Ke.promise:typeof Map<"u"&&t instanceof Map?Ke.map:typeof Set<"u"&&t instanceof Set?Ke.set:typeof Date<"u"&&t instanceof Date?Ke.date:Ke.object;default:return Ke.unknown}},De=Xt.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),kee=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:");class hs extends Error{constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const n=e||function(o){return o.message},r={_errors:[]},i=o=>{for(const s of o.issues)if(s.code==="invalid_union")s.unionErrors.map(i);else if(s.code==="invalid_return_type")i(s.returnTypeError);else if(s.code==="invalid_arguments")i(s.argumentsError);else if(s.path.length===0)r._errors.push(n(s));else{let a=r,l=0;for(;l<s.path.length;){const c=s.path[l];l===s.path.length-1?(a[c]=a[c]||{_errors:[]},a[c]._errors.push(n(s))):a[c]=a[c]||{_errors:[]},a=a[c],l++}}};return i(this),r}toString(){return this.message}get message(){return JSON.stringify(this.issues,Xt.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){const n={},r=[];for(const i of this.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(e(i))):r.push(e(i));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}hs.create=t=>new hs(t);const Fp=(t,e)=>{let n;switch(t.code){case De.invalid_type:t.received===Ke.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case De.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,Xt.jsonStringifyReplacer)}`;break;case De.unrecognized_keys:n=`Unrecognized key(s) in object: ${Xt.joinValues(t.keys,", ")}`;break;case De.invalid_union:n="Invalid input";break;case De.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Xt.joinValues(t.options)}`;break;case De.invalid_enum_value:n=`Invalid enum value. Expected ${Xt.joinValues(t.options)}, received '${t.received}'`;break;case De.invalid_arguments:n="Invalid function arguments";break;case De.invalid_return_type:n="Invalid function return type";break;case De.invalid_date:n="Invalid date";break;case De.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:Xt.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case De.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case De.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case De.custom:n="Invalid input";break;case De.invalid_intersection_types:n="Intersection results could not be merged";break;case De.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case De.not_finite:n="Number must be finite";break;default:n=e.defaultError,Xt.assertNever(t)}return{message:n}};let P3=Fp;function Eee(t){P3=t}function a0(){return P3}const l0=t=>{const{data:e,path:n,errorMaps:r,issueData:i}=t,o=[...n,...i.path||[]],s={...i,path:o};let a="";const l=r.filter(c=>!!c).slice().reverse();for(const c of l)a=c(s,{data:e,defaultError:a}).message;return{...i,path:o,message:i.message||a}},_ee=[];function Ze(t,e){const n=l0({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,a0(),Fp].filter(r=>!!r)});t.common.issues.push(n)}class Xr{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){const r=[];for(const i of n){if(i.status==="aborted")return St;i.status==="dirty"&&e.dirty(),r.push(i.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,n){const r=[];for(const i of n)r.push({key:await i.key,value:await i.value});return Xr.mergeObjectSync(e,r)}static mergeObjectSync(e,n){const r={};for(const i of n){const{key:o,value:s}=i;if(o.status==="aborted"||s.status==="aborted")return St;o.status==="dirty"&&e.dirty(),s.status==="dirty"&&e.dirty(),o.value!=="__proto__"&&(typeof s.value<"u"||i.alwaysSet)&&(r[o.value]=s.value)}return{status:e.value,value:r}}}const St=Object.freeze({status:"aborted"}),N3=t=>({status:"dirty",value:t}),di=t=>({status:"valid",value:t}),UC=t=>t.status==="aborted",WC=t=>t.status==="dirty",zp=t=>t.status==="valid",c0=t=>typeof Promise<"u"&&t instanceof Promise;var ct;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(ct||(ct={}));class Qs{constructor(e,n,r,i){this._cachedPath=[],this.parent=e,this.data=n,this._path=r,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const JP=(t,e)=>{if(zp(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new hs(t.common.issues);return this._error=n,this._error}}};function Et(t){if(!t)return{};const{errorMap:e,invalid_type_error:n,required_error:r,description:i}=t;if(e&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:(s,a)=>s.code!=="invalid_type"?{message:a.defaultError}:typeof a.data>"u"?{message:r??a.defaultError}:{message:n??a.defaultError},description:i}}class Rt{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return xl(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:xl(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Xr,ctx:{common:e.parent.common,data:e.data,parsedType:xl(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const n=this._parse(e);if(c0(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){const n=this._parse(e);return Promise.resolve(n)}parse(e,n){const r=this.safeParse(e,n);if(r.success)return r.data;throw r.error}safeParse(e,n){var r;const i={common:{issues:[],async:(r=n==null?void 0:n.async)!==null&&r!==void 0?r:!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:xl(e)},o=this._parseSync({data:e,path:i.path,parent:i});return JP(i,o)}async parseAsync(e,n){const r=await this.safeParseAsync(e,n);if(r.success)return r.data;throw r.error}async safeParseAsync(e,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:xl(e)},i=this._parse({data:e,path:r.path,parent:r}),o=await(c0(i)?i:Promise.resolve(i));return JP(r,o)}refine(e,n){const r=i=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(i):n;return this._refinement((i,o)=>{const s=e(i),a=()=>o.addIssue({code:De.custom,...r(i)});return typeof Promise<"u"&&s instanceof Promise?s.then(l=>l?!0:(a(),!1)):s?!0:(a(),!1)})}refinement(e,n){return this._refinement((r,i)=>e(r)?!0:(i.addIssue(typeof n=="function"?n(r,i):n),!1))}_refinement(e){return new vs({schema:this,typeName:vt.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return Ra.create(this,this._def)}nullable(){return lu.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ps.create(this,this._def)}promise(){return ad.create(this,this._def)}or(e){return Hp.create([this,e],this._def)}and(e){return qp.create(this,e,this._def)}transform(e){return new vs({...Et(this._def),schema:this,typeName:vt.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new Zp({...Et(this._def),innerType:this,defaultValue:n,typeName:vt.ZodDefault})}brand(){return new D3({typeName:vt.ZodBranded,type:this,...Et(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new h0({...Et(this._def),innerType:this,catchValue:n,typeName:vt.ZodCatch})}describe(e){const n=this.constructor;return new n({...this._def,description:e})}pipe(e){return Nm.create(this,e)}readonly(){return m0.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Tee=/^c[^\s-]{8,}$/i,Aee=/^[a-z][a-z0-9]*$/,Oee=/^[0-9A-HJKMNP-TV-Z]{26}$/,Ree=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Pee=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Nee="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let kx;const Mee=/^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/,Dee=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,Lee=t=>t.precision?t.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${t.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${t.precision}}Z$`):t.precision===0?t.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):t.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$");function $ee(t,e){return!!((e==="v4"||!e)&&Mee.test(t)||(e==="v6"||!e)&&Dee.test(t))}class cs extends Rt{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==Ke.string){const o=this._getOrReturnCtx(e);return Ze(o,{code:De.invalid_type,expected:Ke.string,received:o.parsedType}),St}const r=new Xr;let i;for(const o of this._def.checks)if(o.kind==="min")e.data.length<o.value&&(i=this._getOrReturnCtx(e,i),Ze(i,{code:De.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="max")e.data.length>o.value&&(i=this._getOrReturnCtx(e,i),Ze(i,{code:De.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="length"){const s=e.data.length>o.value,a=e.data.length<o.value;(s||a)&&(i=this._getOrReturnCtx(e,i),s?Ze(i,{code:De.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):a&&Ze(i,{code:De.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),r.dirty())}else if(o.kind==="email")Pee.test(e.data)||(i=this._getOrReturnCtx(e,i),Ze(i,{validation:"email",code:De.invalid_string,message:o.message}),r.dirty());else if(o.kind==="emoji")kx||(kx=new RegExp(Nee,"u")),kx.test(e.data)||(i=this._getOrReturnCtx(e,i),Ze(i,{validation:"emoji",code:De.invalid_string,message:o.message}),r.dirty());else if(o.kind==="uuid")Ree.test(e.data)||(i=this._getOrReturnCtx(e,i),Ze(i,{validation:"uuid",code:De.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid")Tee.test(e.data)||(i=this._getOrReturnCtx(e,i),Ze(i,{validation:"cuid",code:De.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid2")Aee.test(e.data)||(i=this._getOrReturnCtx(e,i),Ze(i,{validation:"cuid2",code:De.invalid_string,message:o.message}),r.dirty());else if(o.kind==="ulid")Oee.test(e.data)||(i=this._getOrReturnCtx(e,i),Ze(i,{validation:"ulid",code:De.invalid_string,message:o.message}),r.dirty());else if(o.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),Ze(i,{validation:"url",code:De.invalid_string,message:o.message}),r.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),Ze(i,{validation:"regex",code:De.invalid_string,message:o.message}),r.dirty())):o.kind==="trim"?e.data=e.data.trim():o.kind==="includes"?e.data.includes(o.value,o.position)||(i=this._getOrReturnCtx(e,i),Ze(i,{code:De.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),r.dirty()):o.kind==="toLowerCase"?e.data=e.data.toLowerCase():o.kind==="toUpperCase"?e.data=e.data.toUpperCase():o.kind==="startsWith"?e.data.startsWith(o.value)||(i=this._getOrReturnCtx(e,i),Ze(i,{code:De.invalid_string,validation:{startsWith:o.value},message:o.message}),r.dirty()):o.kind==="endsWith"?e.data.endsWith(o.value)||(i=this._getOrReturnCtx(e,i),Ze(i,{code:De.invalid_string,validation:{endsWith:o.value},message:o.message}),r.dirty()):o.kind==="datetime"?Lee(o).test(e.data)||(i=this._getOrReturnCtx(e,i),Ze(i,{code:De.invalid_string,validation:"datetime",message:o.message}),r.dirty()):o.kind==="ip"?$ee(e.data,o.version)||(i=this._getOrReturnCtx(e,i),Ze(i,{validation:"ip",code:De.invalid_string,message:o.message}),r.dirty()):Xt.assertNever(o);return{status:r.value,value:e.data}}_regex(e,n,r){return this.refinement(i=>e.test(i),{validation:n,code:De.invalid_string,...ct.errToObj(r)})}_addCheck(e){return new cs({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...ct.errToObj(e)})}url(e){return this._addCheck({kind:"url",...ct.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...ct.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...ct.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...ct.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...ct.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...ct.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...ct.errToObj(e)})}datetime(e){var n;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(n=e==null?void 0:e.offset)!==null&&n!==void 0?n:!1,...ct.errToObj(e==null?void 0:e.message)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...ct.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n==null?void 0:n.position,...ct.errToObj(n==null?void 0:n.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...ct.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...ct.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...ct.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...ct.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...ct.errToObj(n)})}nonempty(e){return this.min(1,ct.errToObj(e))}trim(){return new cs({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new cs({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new cs({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get minLength(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}cs.create=t=>{var e;return new cs({checks:[],typeName:vt.ZodString,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...Et(t)})};function Iee(t,e){const n=(t.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,i=n>r?n:r,o=parseInt(t.toFixed(i).replace(".","")),s=parseInt(e.toFixed(i).replace(".",""));return o%s/Math.pow(10,i)}class Kl extends Rt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==Ke.number){const o=this._getOrReturnCtx(e);return Ze(o,{code:De.invalid_type,expected:Ke.number,received:o.parsedType}),St}let r;const i=new Xr;for(const o of this._def.checks)o.kind==="int"?Xt.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),Ze(r,{code:De.invalid_type,expected:"integer",received:"float",message:o.message}),i.dirty()):o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(r=this._getOrReturnCtx(e,r),Ze(r,{code:De.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(r=this._getOrReturnCtx(e,r),Ze(r,{code:De.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="multipleOf"?Iee(e.data,o.value)!==0&&(r=this._getOrReturnCtx(e,r),Ze(r,{code:De.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):o.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),Ze(r,{code:De.not_finite,message:o.message}),i.dirty()):Xt.assertNever(o);return{status:i.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,ct.toString(n))}gt(e,n){return this.setLimit("min",e,!1,ct.toString(n))}lte(e,n){return this.setLimit("max",e,!0,ct.toString(n))}lt(e,n){return this.setLimit("max",e,!1,ct.toString(n))}setLimit(e,n,r,i){return new Kl({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:ct.toString(i)}]})}_addCheck(e){return new Kl({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:ct.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:ct.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:ct.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:ct.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:ct.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:ct.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:ct.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:ct.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:ct.toString(e)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&Xt.isInteger(e.value))}get isFinite(){let e=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(e===null||r.value<e)&&(e=r.value)}return Number.isFinite(n)&&Number.isFinite(e)}}Kl.create=t=>new Kl({checks:[],typeName:vt.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...Et(t)});class Gl extends Rt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==Ke.bigint){const o=this._getOrReturnCtx(e);return Ze(o,{code:De.invalid_type,expected:Ke.bigint,received:o.parsedType}),St}let r;const i=new Xr;for(const o of this._def.checks)o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(r=this._getOrReturnCtx(e,r),Ze(r,{code:De.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(r=this._getOrReturnCtx(e,r),Ze(r,{code:De.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="multipleOf"?e.data%o.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),Ze(r,{code:De.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):Xt.assertNever(o);return{status:i.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,ct.toString(n))}gt(e,n){return this.setLimit("min",e,!1,ct.toString(n))}lte(e,n){return this.setLimit("max",e,!0,ct.toString(n))}lt(e,n){return this.setLimit("max",e,!1,ct.toString(n))}setLimit(e,n,r,i){return new Gl({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:ct.toString(i)}]})}_addCheck(e){return new Gl({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:ct.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:ct.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:ct.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:ct.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:ct.toString(n)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}Gl.create=t=>{var e;return new Gl({checks:[],typeName:vt.ZodBigInt,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...Et(t)})};class Vp extends Rt{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==Ke.boolean){const r=this._getOrReturnCtx(e);return Ze(r,{code:De.invalid_type,expected:Ke.boolean,received:r.parsedType}),St}return di(e.data)}}Vp.create=t=>new Vp({typeName:vt.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...Et(t)});class su extends Rt{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==Ke.date){const o=this._getOrReturnCtx(e);return Ze(o,{code:De.invalid_type,expected:Ke.date,received:o.parsedType}),St}if(isNaN(e.data.getTime())){const o=this._getOrReturnCtx(e);return Ze(o,{code:De.invalid_date}),St}const r=new Xr;let i;for(const o of this._def.checks)o.kind==="min"?e.data.getTime()<o.value&&(i=this._getOrReturnCtx(e,i),Ze(i,{code:De.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),r.dirty()):o.kind==="max"?e.data.getTime()>o.value&&(i=this._getOrReturnCtx(e,i),Ze(i,{code:De.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),r.dirty()):Xt.assertNever(o);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new su({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:ct.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:ct.toString(n)})}get minDate(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}}su.create=t=>new su({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:vt.ZodDate,...Et(t)});class u0 extends Rt{_parse(e){if(this._getType(e)!==Ke.symbol){const r=this._getOrReturnCtx(e);return Ze(r,{code:De.invalid_type,expected:Ke.symbol,received:r.parsedType}),St}return di(e.data)}}u0.create=t=>new u0({typeName:vt.ZodSymbol,...Et(t)});class Up extends Rt{_parse(e){if(this._getType(e)!==Ke.undefined){const r=this._getOrReturnCtx(e);return Ze(r,{code:De.invalid_type,expected:Ke.undefined,received:r.parsedType}),St}return di(e.data)}}Up.create=t=>new Up({typeName:vt.ZodUndefined,...Et(t)});class Wp extends Rt{_parse(e){if(this._getType(e)!==Ke.null){const r=this._getOrReturnCtx(e);return Ze(r,{code:De.invalid_type,expected:Ke.null,received:r.parsedType}),St}return di(e.data)}}Wp.create=t=>new Wp({typeName:vt.ZodNull,...Et(t)});class sd extends Rt{constructor(){super(...arguments),this._any=!0}_parse(e){return di(e.data)}}sd.create=t=>new sd({typeName:vt.ZodAny,...Et(t)});class Kc extends Rt{constructor(){super(...arguments),this._unknown=!0}_parse(e){return di(e.data)}}Kc.create=t=>new Kc({typeName:vt.ZodUnknown,...Et(t)});class Fa extends Rt{_parse(e){const n=this._getOrReturnCtx(e);return Ze(n,{code:De.invalid_type,expected:Ke.never,received:n.parsedType}),St}}Fa.create=t=>new Fa({typeName:vt.ZodNever,...Et(t)});class f0 extends Rt{_parse(e){if(this._getType(e)!==Ke.undefined){const r=this._getOrReturnCtx(e);return Ze(r,{code:De.invalid_type,expected:Ke.void,received:r.parsedType}),St}return di(e.data)}}f0.create=t=>new f0({typeName:vt.ZodVoid,...Et(t)});class ps extends Rt{_parse(e){const{ctx:n,status:r}=this._processInputParams(e),i=this._def;if(n.parsedType!==Ke.array)return Ze(n,{code:De.invalid_type,expected:Ke.array,received:n.parsedType}),St;if(i.exactLength!==null){const s=n.data.length>i.exactLength.value,a=n.data.length<i.exactLength.value;(s||a)&&(Ze(n,{code:s?De.too_big:De.too_small,minimum:a?i.exactLength.value:void 0,maximum:s?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),r.dirty())}if(i.minLength!==null&&n.data.length<i.minLength.value&&(Ze(n,{code:De.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),r.dirty()),i.maxLength!==null&&n.data.length>i.maxLength.value&&(Ze(n,{code:De.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((s,a)=>i.type._parseAsync(new Qs(n,s,n.path,a)))).then(s=>Xr.mergeArray(r,s));const o=[...n.data].map((s,a)=>i.type._parseSync(new Qs(n,s,n.path,a)));return Xr.mergeArray(r,o)}get element(){return this._def.type}min(e,n){return new ps({...this._def,minLength:{value:e,message:ct.toString(n)}})}max(e,n){return new ps({...this._def,maxLength:{value:e,message:ct.toString(n)}})}length(e,n){return new ps({...this._def,exactLength:{value:e,message:ct.toString(n)}})}nonempty(e){return this.min(1,e)}}ps.create=(t,e)=>new ps({type:t,minLength:null,maxLength:null,exactLength:null,typeName:vt.ZodArray,...Et(e)});function of(t){if(t instanceof In){const e={};for(const n in t.shape){const r=t.shape[n];e[n]=Ra.create(of(r))}return new In({...t._def,shape:()=>e})}else return t instanceof ps?new ps({...t._def,type:of(t.element)}):t instanceof Ra?Ra.create(of(t.unwrap())):t instanceof lu?lu.create(of(t.unwrap())):t instanceof Js?Js.create(t.items.map(e=>of(e))):t}class In extends Rt{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),n=Xt.objectKeys(e);return this._cached={shape:e,keys:n}}_parse(e){if(this._getType(e)!==Ke.object){const c=this._getOrReturnCtx(e);return Ze(c,{code:De.invalid_type,expected:Ke.object,received:c.parsedType}),St}const{status:r,ctx:i}=this._processInputParams(e),{shape:o,keys:s}=this._getCached(),a=[];if(!(this._def.catchall instanceof Fa&&this._def.unknownKeys==="strip"))for(const c in i.data)s.includes(c)||a.push(c);const l=[];for(const c of s){const f=o[c],d=i.data[c];l.push({key:{status:"valid",value:c},value:f._parse(new Qs(i,d,i.path,c)),alwaysSet:c in i.data})}if(this._def.catchall instanceof Fa){const c=this._def.unknownKeys;if(c==="passthrough")for(const f of a)l.push({key:{status:"valid",value:f},value:{status:"valid",value:i.data[f]}});else if(c==="strict")a.length>0&&(Ze(i,{code:De.unrecognized_keys,keys:a}),r.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const c=this._def.catchall;for(const f of a){const d=i.data[f];l.push({key:{status:"valid",value:f},value:c._parse(new Qs(i,d,i.path,f)),alwaysSet:f in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const c=[];for(const f of l){const d=await f.key;c.push({key:d,value:await f.value,alwaysSet:f.alwaysSet})}return c}).then(c=>Xr.mergeObjectSync(r,c)):Xr.mergeObjectSync(r,l)}get shape(){return this._def.shape()}strict(e){return ct.errToObj,new In({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,r)=>{var i,o,s,a;const l=(s=(o=(i=this._def).errorMap)===null||o===void 0?void 0:o.call(i,n,r).message)!==null&&s!==void 0?s:r.defaultError;return n.code==="unrecognized_keys"?{message:(a=ct.errToObj(e).message)!==null&&a!==void 0?a:l}:{message:l}}}:{}})}strip(){return new In({...this._def,unknownKeys:"strip"})}passthrough(){return new In({...this._def,unknownKeys:"passthrough"})}extend(e){return new In({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new In({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:vt.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new In({...this._def,catchall:e})}pick(e){const n={};return Xt.objectKeys(e).forEach(r=>{e[r]&&this.shape[r]&&(n[r]=this.shape[r])}),new In({...this._def,shape:()=>n})}omit(e){const n={};return Xt.objectKeys(this.shape).forEach(r=>{e[r]||(n[r]=this.shape[r])}),new In({...this._def,shape:()=>n})}deepPartial(){return of(this)}partial(e){const n={};return Xt.objectKeys(this.shape).forEach(r=>{const i=this.shape[r];e&&!e[r]?n[r]=i:n[r]=i.optional()}),new In({...this._def,shape:()=>n})}required(e){const n={};return Xt.objectKeys(this.shape).forEach(r=>{if(e&&!e[r])n[r]=this.shape[r];else{let o=this.shape[r];for(;o instanceof Ra;)o=o._def.innerType;n[r]=o}}),new In({...this._def,shape:()=>n})}keyof(){return M3(Xt.objectKeys(this.shape))}}In.create=(t,e)=>new In({shape:()=>t,unknownKeys:"strip",catchall:Fa.create(),typeName:vt.ZodObject,...Et(e)});In.strictCreate=(t,e)=>new In({shape:()=>t,unknownKeys:"strict",catchall:Fa.create(),typeName:vt.ZodObject,...Et(e)});In.lazycreate=(t,e)=>new In({shape:t,unknownKeys:"strip",catchall:Fa.create(),typeName:vt.ZodObject,...Et(e)});class Hp extends Rt{_parse(e){const{ctx:n}=this._processInputParams(e),r=this._def.options;function i(o){for(const a of o)if(a.result.status==="valid")return a.result;for(const a of o)if(a.result.status==="dirty")return n.common.issues.push(...a.ctx.common.issues),a.result;const s=o.map(a=>new hs(a.ctx.common.issues));return Ze(n,{code:De.invalid_union,unionErrors:s}),St}if(n.common.async)return Promise.all(r.map(async o=>{const s={...n,common:{...n.common,issues:[]},parent:null};return{result:await o._parseAsync({data:n.data,path:n.path,parent:s}),ctx:s}})).then(i);{let o;const s=[];for(const l of r){const c={...n,common:{...n.common,issues:[]},parent:null},f=l._parseSync({data:n.data,path:n.path,parent:c});if(f.status==="valid")return f;f.status==="dirty"&&!o&&(o={result:f,ctx:c}),c.common.issues.length&&s.push(c.common.issues)}if(o)return n.common.issues.push(...o.ctx.common.issues),o.result;const a=s.map(l=>new hs(l));return Ze(n,{code:De.invalid_union,unionErrors:a}),St}}get options(){return this._def.options}}Hp.create=(t,e)=>new Hp({options:t,typeName:vt.ZodUnion,...Et(e)});const oy=t=>t instanceof Gp?oy(t.schema):t instanceof vs?oy(t.innerType()):t instanceof Yp?[t.value]:t instanceof Yl?t.options:t instanceof Xp?Object.keys(t.enum):t instanceof Zp?oy(t._def.innerType):t instanceof Up?[void 0]:t instanceof Wp?[null]:null;class Fb extends Rt{_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==Ke.object)return Ze(n,{code:De.invalid_type,expected:Ke.object,received:n.parsedType}),St;const r=this.discriminator,i=n.data[r],o=this.optionsMap.get(i);return o?n.common.async?o._parseAsync({data:n.data,path:n.path,parent:n}):o._parseSync({data:n.data,path:n.path,parent:n}):(Ze(n,{code:De.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),St)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,r){const i=new Map;for(const o of n){const s=oy(o.shape[e]);if(!s)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const a of s){if(i.has(a))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`);i.set(a,o)}}return new Fb({typeName:vt.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:i,...Et(r)})}}function HC(t,e){const n=xl(t),r=xl(e);if(t===e)return{valid:!0,data:t};if(n===Ke.object&&r===Ke.object){const i=Xt.objectKeys(e),o=Xt.objectKeys(t).filter(a=>i.indexOf(a)!==-1),s={...t,...e};for(const a of o){const l=HC(t[a],e[a]);if(!l.valid)return{valid:!1};s[a]=l.data}return{valid:!0,data:s}}else if(n===Ke.array&&r===Ke.array){if(t.length!==e.length)return{valid:!1};const i=[];for(let o=0;o<t.length;o++){const s=t[o],a=e[o],l=HC(s,a);if(!l.valid)return{valid:!1};i.push(l.data)}return{valid:!0,data:i}}else return n===Ke.date&&r===Ke.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class qp extends Rt{_parse(e){const{status:n,ctx:r}=this._processInputParams(e),i=(o,s)=>{if(UC(o)||UC(s))return St;const a=HC(o.value,s.value);return a.valid?((WC(o)||WC(s))&&n.dirty(),{status:n.value,value:a.data}):(Ze(r,{code:De.invalid_intersection_types}),St)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([o,s])=>i(o,s)):i(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}qp.create=(t,e,n)=>new qp({left:t,right:e,typeName:vt.ZodIntersection,...Et(n)});class Js extends Rt{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==Ke.array)return Ze(r,{code:De.invalid_type,expected:Ke.array,received:r.parsedType}),St;if(r.data.length<this._def.items.length)return Ze(r,{code:De.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),St;!this._def.rest&&r.data.length>this._def.items.length&&(Ze(r,{code:De.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const o=[...r.data].map((s,a)=>{const l=this._def.items[a]||this._def.rest;return l?l._parse(new Qs(r,s,r.path,a)):null}).filter(s=>!!s);return r.common.async?Promise.all(o).then(s=>Xr.mergeArray(n,s)):Xr.mergeArray(n,o)}get items(){return this._def.items}rest(e){return new Js({...this._def,rest:e})}}Js.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Js({items:t,typeName:vt.ZodTuple,rest:null,...Et(e)})};class Kp extends Rt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==Ke.object)return Ze(r,{code:De.invalid_type,expected:Ke.object,received:r.parsedType}),St;const i=[],o=this._def.keyType,s=this._def.valueType;for(const a in r.data)i.push({key:o._parse(new Qs(r,a,r.path,a)),value:s._parse(new Qs(r,r.data[a],r.path,a))});return r.common.async?Xr.mergeObjectAsync(n,i):Xr.mergeObjectSync(n,i)}get element(){return this._def.valueType}static create(e,n,r){return n instanceof Rt?new Kp({keyType:e,valueType:n,typeName:vt.ZodRecord,...Et(r)}):new Kp({keyType:cs.create(),valueType:e,typeName:vt.ZodRecord,...Et(n)})}}class d0 extends Rt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==Ke.map)return Ze(r,{code:De.invalid_type,expected:Ke.map,received:r.parsedType}),St;const i=this._def.keyType,o=this._def.valueType,s=[...r.data.entries()].map(([a,l],c)=>({key:i._parse(new Qs(r,a,r.path,[c,"key"])),value:o._parse(new Qs(r,l,r.path,[c,"value"]))}));if(r.common.async){const a=new Map;return Promise.resolve().then(async()=>{for(const l of s){const c=await l.key,f=await l.value;if(c.status==="aborted"||f.status==="aborted")return St;(c.status==="dirty"||f.status==="dirty")&&n.dirty(),a.set(c.value,f.value)}return{status:n.value,value:a}})}else{const a=new Map;for(const l of s){const c=l.key,f=l.value;if(c.status==="aborted"||f.status==="aborted")return St;(c.status==="dirty"||f.status==="dirty")&&n.dirty(),a.set(c.value,f.value)}return{status:n.value,value:a}}}}d0.create=(t,e,n)=>new d0({valueType:e,keyType:t,typeName:vt.ZodMap,...Et(n)});class au extends Rt{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==Ke.set)return Ze(r,{code:De.invalid_type,expected:Ke.set,received:r.parsedType}),St;const i=this._def;i.minSize!==null&&r.data.size<i.minSize.value&&(Ze(r,{code:De.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),n.dirty()),i.maxSize!==null&&r.data.size>i.maxSize.value&&(Ze(r,{code:De.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),n.dirty());const o=this._def.valueType;function s(l){const c=new Set;for(const f of l){if(f.status==="aborted")return St;f.status==="dirty"&&n.dirty(),c.add(f.value)}return{status:n.value,value:c}}const a=[...r.data.values()].map((l,c)=>o._parse(new Qs(r,l,r.path,c)));return r.common.async?Promise.all(a).then(l=>s(l)):s(a)}min(e,n){return new au({...this._def,minSize:{value:e,message:ct.toString(n)}})}max(e,n){return new au({...this._def,maxSize:{value:e,message:ct.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}}au.create=(t,e)=>new au({valueType:t,minSize:null,maxSize:null,typeName:vt.ZodSet,...Et(e)});class Bf extends Rt{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==Ke.function)return Ze(n,{code:De.invalid_type,expected:Ke.function,received:n.parsedType}),St;function r(a,l){return l0({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,a0(),Fp].filter(c=>!!c),issueData:{code:De.invalid_arguments,argumentsError:l}})}function i(a,l){return l0({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,a0(),Fp].filter(c=>!!c),issueData:{code:De.invalid_return_type,returnTypeError:l}})}const o={errorMap:n.common.contextualErrorMap},s=n.data;if(this._def.returns instanceof ad){const a=this;return di(async function(...l){const c=new hs([]),f=await a._def.args.parseAsync(l,o).catch(m=>{throw c.addIssue(r(l,m)),c}),d=await Reflect.apply(s,this,f);return await a._def.returns._def.type.parseAsync(d,o).catch(m=>{throw c.addIssue(i(d,m)),c})})}else{const a=this;return di(function(...l){const c=a._def.args.safeParse(l,o);if(!c.success)throw new hs([r(l,c.error)]);const f=Reflect.apply(s,this,c.data),d=a._def.returns.safeParse(f,o);if(!d.success)throw new hs([i(f,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new Bf({...this._def,args:Js.create(e).rest(Kc.create())})}returns(e){return new Bf({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,n,r){return new Bf({args:e||Js.create([]).rest(Kc.create()),returns:n||Kc.create(),typeName:vt.ZodFunction,...Et(r)})}}class Gp extends Rt{get schema(){return this._def.getter()}_parse(e){const{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}Gp.create=(t,e)=>new Gp({getter:t,typeName:vt.ZodLazy,...Et(e)});class Yp extends Rt{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return Ze(n,{received:n.data,code:De.invalid_literal,expected:this._def.value}),St}return{status:"valid",value:e.data}}get value(){return this._def.value}}Yp.create=(t,e)=>new Yp({value:t,typeName:vt.ZodLiteral,...Et(e)});function M3(t,e){return new Yl({values:t,typeName:vt.ZodEnum,...Et(e)})}class Yl extends Rt{_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),r=this._def.values;return Ze(n,{expected:Xt.joinValues(r),received:n.parsedType,code:De.invalid_type}),St}if(this._def.values.indexOf(e.data)===-1){const n=this._getOrReturnCtx(e),r=this._def.values;return Ze(n,{received:n.data,code:De.invalid_enum_value,options:r}),St}return di(e.data)}get options(){return this._def.values}get enum(){const e={};for(const n of this._def.values)e[n]=n;return e}get Values(){const e={};for(const n of this._def.values)e[n]=n;return e}get Enum(){const e={};for(const n of this._def.values)e[n]=n;return e}extract(e){return Yl.create(e)}exclude(e){return Yl.create(this.options.filter(n=>!e.includes(n)))}}Yl.create=M3;class Xp extends Rt{_parse(e){const n=Xt.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==Ke.string&&r.parsedType!==Ke.number){const i=Xt.objectValues(n);return Ze(r,{expected:Xt.joinValues(i),received:r.parsedType,code:De.invalid_type}),St}if(n.indexOf(e.data)===-1){const i=Xt.objectValues(n);return Ze(r,{received:r.data,code:De.invalid_enum_value,options:i}),St}return di(e.data)}get enum(){return this._def.values}}Xp.create=(t,e)=>new Xp({values:t,typeName:vt.ZodNativeEnum,...Et(e)});class ad extends Rt{unwrap(){return this._def.type}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==Ke.promise&&n.common.async===!1)return Ze(n,{code:De.invalid_type,expected:Ke.promise,received:n.parsedType}),St;const r=n.parsedType===Ke.promise?n.data:Promise.resolve(n.data);return di(r.then(i=>this._def.type.parseAsync(i,{path:n.path,errorMap:n.common.contextualErrorMap})))}}ad.create=(t,e)=>new ad({type:t,typeName:vt.ZodPromise,...Et(e)});class vs extends Rt{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===vt.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:n,ctx:r}=this._processInputParams(e),i=this._def.effect||null,o={addIssue:s=>{Ze(r,s),s.fatal?n.abort():n.dirty()},get path(){return r.path}};if(o.addIssue=o.addIssue.bind(o),i.type==="preprocess"){const s=i.transform(r.data,o);return r.common.issues.length?{status:"dirty",value:r.data}:r.common.async?Promise.resolve(s).then(a=>this._def.schema._parseAsync({data:a,path:r.path,parent:r})):this._def.schema._parseSync({data:s,path:r.path,parent:r})}if(i.type==="refinement"){const s=a=>{const l=i.refinement(a,o);if(r.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(r.common.async===!1){const a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?St:(a.status==="dirty"&&n.dirty(),s(a.value),{status:n.value,value:a.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>a.status==="aborted"?St:(a.status==="dirty"&&n.dirty(),s(a.value).then(()=>({status:n.value,value:a.value}))))}if(i.type==="transform")if(r.common.async===!1){const s=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!zp(s))return s;const a=i.transform(s.value,o);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:a}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(s=>zp(s)?Promise.resolve(i.transform(s.value,o)).then(a=>({status:n.value,value:a})):s);Xt.assertNever(i)}}vs.create=(t,e,n)=>new vs({schema:t,typeName:vt.ZodEffects,effect:e,...Et(n)});vs.createWithPreprocess=(t,e,n)=>new vs({schema:e,effect:{type:"preprocess",transform:t},typeName:vt.ZodEffects,...Et(n)});class Ra extends Rt{_parse(e){return this._getType(e)===Ke.undefined?di(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Ra.create=(t,e)=>new Ra({innerType:t,typeName:vt.ZodOptional,...Et(e)});class lu extends Rt{_parse(e){return this._getType(e)===Ke.null?di(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}lu.create=(t,e)=>new lu({innerType:t,typeName:vt.ZodNullable,...Et(e)});class Zp extends Rt{_parse(e){const{ctx:n}=this._processInputParams(e);let r=n.data;return n.parsedType===Ke.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}Zp.create=(t,e)=>new Zp({innerType:t,typeName:vt.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Et(e)});class h0 extends Rt{_parse(e){const{ctx:n}=this._processInputParams(e),r={...n,common:{...n.common,issues:[]}},i=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return c0(i)?i.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new hs(r.common.issues)},input:r.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new hs(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}h0.create=(t,e)=>new h0({innerType:t,typeName:vt.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Et(e)});class p0 extends Rt{_parse(e){if(this._getType(e)!==Ke.nan){const r=this._getOrReturnCtx(e);return Ze(r,{code:De.invalid_type,expected:Ke.nan,received:r.parsedType}),St}return{status:"valid",value:e.data}}}p0.create=t=>new p0({typeName:vt.ZodNaN,...Et(t)});const jee=Symbol("zod_brand");class D3 extends Rt{_parse(e){const{ctx:n}=this._processInputParams(e),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class Nm extends Rt{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{const o=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?St:o.status==="dirty"?(n.dirty(),N3(o.value)):this._def.out._parseAsync({data:o.value,path:r.path,parent:r})})();{const i=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?St:i.status==="dirty"?(n.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:r.path,parent:r})}}static create(e,n){return new Nm({in:e,out:n,typeName:vt.ZodPipeline})}}class m0 extends Rt{_parse(e){const n=this._def.innerType._parse(e);return zp(n)&&(n.value=Object.freeze(n.value)),n}}m0.create=(t,e)=>new m0({innerType:t,typeName:vt.ZodReadonly,...Et(e)});const L3=(t,e={},n)=>t?sd.create().superRefine((r,i)=>{var o,s;if(!t(r)){const a=typeof e=="function"?e(r):typeof e=="string"?{message:e}:e,l=(s=(o=a.fatal)!==null&&o!==void 0?o:n)!==null&&s!==void 0?s:!0,c=typeof a=="string"?{message:a}:a;i.addIssue({code:"custom",...c,fatal:l})}}):sd.create(),Bee={object:In.lazycreate};var vt;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(vt||(vt={}));const Fee=(t,e={message:`Input not instance of ${t.name}`})=>L3(n=>n instanceof t,e),We=cs.create,Bo=Kl.create,zee=p0.create,Vee=Gl.create,Gn=Vp.create,Uee=su.create,Wee=u0.create,Hee=Up.create,$3=Wp.create,qC=sd.create,I3=Kc.create,qee=Fa.create,Kee=f0.create,G_=ps.create,ot=In.create,Gee=In.strictCreate,_u=Hp.create,Tu=Fb.create,Yee=qp.create,Xee=Js.create,cu=Kp.create,Zee=d0.create,Qee=au.create,Jee=Bf.create,ete=Gp.create,Zt=Yp.create,tte=Yl.create,Od=Xp.create,nte=ad.create,eN=vs.create,rte=Ra.create,ite=lu.create,ote=vs.createWithPreprocess,ste=Nm.create,ate=()=>We().optional(),lte=()=>Bo().optional(),cte=()=>Gn().optional(),uu={string:t=>cs.create({...t,coerce:!0}),number:t=>Kl.create({...t,coerce:!0}),boolean:t=>Vp.create({...t,coerce:!0}),bigint:t=>Gl.create({...t,coerce:!0}),date:t=>su.create({...t,coerce:!0})},ute=St;var le=Object.freeze({__proto__:null,defaultErrorMap:Fp,setErrorMap:Eee,getErrorMap:a0,makeIssue:l0,EMPTY_PATH:_ee,addIssueToContext:Ze,ParseStatus:Xr,INVALID:St,DIRTY:N3,OK:di,isAborted:UC,isDirty:WC,isValid:zp,isAsync:c0,get util(){return Xt},get objectUtil(){return VC},ZodParsedType:Ke,getParsedType:xl,ZodType:Rt,ZodString:cs,ZodNumber:Kl,ZodBigInt:Gl,ZodBoolean:Vp,ZodDate:su,ZodSymbol:u0,ZodUndefined:Up,ZodNull:Wp,ZodAny:sd,ZodUnknown:Kc,ZodNever:Fa,ZodVoid:f0,ZodArray:ps,ZodObject:In,ZodUnion:Hp,ZodDiscriminatedUnion:Fb,ZodIntersection:qp,ZodTuple:Js,ZodRecord:Kp,ZodMap:d0,ZodSet:au,ZodFunction:Bf,ZodLazy:Gp,ZodLiteral:Yp,ZodEnum:Yl,ZodNativeEnum:Xp,ZodPromise:ad,ZodEffects:vs,ZodTransformer:vs,ZodOptional:Ra,ZodNullable:lu,ZodDefault:Zp,ZodCatch:h0,ZodNaN:p0,BRAND:jee,ZodBranded:D3,ZodPipeline:Nm,ZodReadonly:m0,custom:L3,Schema:Rt,ZodSchema:Rt,late:Bee,get ZodFirstPartyTypeKind(){return vt},coerce:uu,any:qC,array:G_,bigint:Vee,boolean:Gn,date:Uee,discriminatedUnion:Tu,effect:eN,enum:tte,function:Jee,instanceof:Fee,intersection:Yee,lazy:ete,literal:Zt,map:Zee,nan:zee,nativeEnum:Od,never:qee,null:$3,nullable:ite,number:Bo,object:ot,oboolean:cte,onumber:lte,optional:rte,ostring:ate,pipeline:ste,preprocess:ote,promise:nte,record:cu,set:Qee,strictObject:Gee,string:We,symbol:Wee,transformer:eN,tuple:Xee,undefined:Hee,union:_u,unknown:I3,void:Kee,NEVER:ute,ZodIssueCode:De,quotelessJson:kee,ZodError:hs});function tN(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function nN(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?tN(Object(n),!0).forEach(function(r){fte(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):tN(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function fte(t,e,n){return e=dte(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function dte(t){var e=hte(t,"string");return typeof e=="symbol"?e:String(e)}function hte(t,e){if(typeof t!="object"||t===null)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const pte=j3({});function j3(t){return e.withOptions=n=>j3(nN(nN({},t),n)),e;function e(n,...r){const i=typeof n=="string"?[n]:n.raw,{escapeSpecialCharacters:o=Array.isArray(n)}=t;let s="";for(let c=0;c<i.length;c++){let f=i[c];o&&(f=f.replace(/\\\n[ \t]*/g,"").replace(/\\`/g,"`").replace(/\\\$/g,"$").replace(/\\{/g,"{")),s+=f,c<r.length&&(s+=r[c])}const a=s.split(`
69
+ `);let l=null;for(const c of a){const f=c.match(/^(\s+)\S+/);if(f){const d=f[1].length;l?l=Math.min(l,d):l=d}}if(l!==null){const c=l;s=a.map(f=>f[0]===" "||f[0]===" "?f.slice(c):f).join(`
70
+ `)}return s.trim().replace(/\\n/g,`
71
+ `)}}const mte=ot({id:Bo().int(),role:We().optional(),name:We().optional(),numChildren:Bo().optional(),content:We().optional(),pathFromRoot:We().optional(),serializedForm:We().optional()});var Le=(t=>(t.AI_ASSERTION="AI_ASSERTION",t.CLICK="CLICK",t.SELECT_OPTION="SELECT_OPTION",t.REQUEST="REQUEST",t.TYPE="TYPE",t.PRESS="PRESS",t.NAVIGATE="NAVIGATE",t.SCROLL_UP="SCROLL_UP",t.SCROLL_DOWN="SCROLL_DOWN",t.GO_BACK="GO_BACK",t.GO_FORWARD="GO_FORWARD",t.WAIT="WAIT",t.REFRESH="REFRESH",t.TAB="TAB",t.COOKIE="COOKIE",t.LOCAL_STORAGE="LOCAL_STORAGE",t.HOVER="HOVER",t.CAPTCHA="CAPTCHA",t.SUCCESS="SUCCESS",t))(Le||{});const Rd=ot({elementDescriptor:We(),a11yData:mte.optional()}),lr=ot({thoughts:We().optional()}),gte=lr.merge(ot({type:Zt("NAVIGATE"),url:We()})).describe("NAVIGATE <URL> - Go to the specified URL. Only navigate to URLs relevant to the user goal."),vte=lr.merge(ot({target:Rd.optional(),type:Zt("SCROLL_UP"),useVision:Gn().default(!1),deltaY:Bo().optional()})).describe("SCROLL_UP [id] - Scroll up while hovering over the element with the specified id. If no id is provided, scroll the entire page."),yte=lr.merge(ot({target:Rd.optional(),type:Zt("SCROLL_DOWN"),useVision:Gn().default(!1),deltaY:Bo().optional()})).describe("SCROLL_DOWN [id] - Scroll down while hovering over the element with the specified id. If no id is provided, scroll the entire page."),bte=lr.merge(ot({type:Zt("WAIT"),delay:Bo()})),wte=lr.merge(ot({type:Zt("REFRESH")})),xte=lr.merge(ot({type:Zt("GO_BACK")})),Ste=lr.merge(ot({type:Zt("GO_FORWARD")})),Cte=lr.merge(ot({type:Zt("CAPTCHA"),useVision:Gn().default(!1)})),kte=lr.merge(ot({type:Zt("CLICK"),target:Rd,doubleClick:Gn().default(!1),rightClick:Gn().default(!1),useVision:Gn().default(!1),force:Gn().optional()})).describe(pte`CLICK <id> - click on the element that has the specified id.
72
+ You are NOT allowed to click on disabled, hidden or StaticText elements.
73
+ Only click on elements on the Current Page.
74
+ Only click on elements with the following tag names: button, input, link, image, generic.
75
+ `.replaceAll(`
76
+ `," ")),Ete=lr.merge(ot({type:Zt("HOVER"),target:Rd,useVision:Gn().default(!1)})),_te=lr.merge(ot({type:Zt("SELECT_OPTION"),target:Rd,option:We()})).describe('SELECT_OPTION <id> "<option>" - select an option from a combobox, listbox, or menu element on the page. Provide the id of the parent combobox, listbox, or menu element in <id>. Do NOT provide the id of the option: instead, provide the name of the option in <option> enclosed by single quotes.'),B3=lr.merge(ot({type:Zt("AI_ASSERTION"),assertion:We(),useVision:Gn().default(!1),disableCache:Gn().default(!1),cancelOnFailure:Gn().default(!1)})),Tte=ot({clearContent:Gn().default(!0),pressKeysSequentially:Gn().default(!1)}),Ate=lr.merge(ot({type:Zt("TYPE"),target:Rd,value:We(),pressEnter:Gn().default(!1),useVision:Gn().default(!1),force:Gn().optional()})).merge(Tte).describe('TYPE <id> "<text>" - type the specified text into the input with the specified id. The text should be specified by the user - do not use text from the EXAMPLES or generate text yourself. Make sure to include quotes around the text.'),Ote=lr.merge(ot({type:Zt("PRESS"),value:We()})).describe('PRESS <key> - press the specified key, such as "ArrowLeft", "Enter", or "a". You must specify at least one key.'),Rte=lr.merge(ot({type:Zt("TAB"),url:We()})),Pte=lr.merge(ot({type:Zt("COOKIE"),value:We()})),Nte=lr.merge(ot({type:Zt("LOCAL_STORAGE"),key:We(),value:We()})),Mte=lr.merge(ot({type:Zt("REQUEST"),url:We(),method:_u([Zt("GET"),Zt("POST"),Zt("PUT"),Zt("DELETE"),Zt("PATCH")]),headers:cu(We(),We()).optional(),params:cu(We(),We()).optional(),body:We().optional(),timeout:Bo().optional().describe("Max seconds to wait for the request to complete")})),Dte=lr.merge(ot({type:Zt("SUCCESS"),condition:B3.optional()})).describe("SUCCESS - the user goal has been successfully achieved"),Pd=Tu("type",[kte,Ate,Ote,_te,gte,yte,vte,Dte]),Lte=Tu("type",[xte,Ste,wte,B3,bte,Rte,Pte,Nte,Ete,Mte,Cte]),F3=Tu("type",[...Pd.options,...Lte.options]),$te=lr.merge(ot({type:Zt("FAILURE")})).describe("FAILURE - there are no commands to suggest that could make progress that have not already been tried before");Tu("type",[...Pd.options,$te]);const Y_=t=>{switch(t){case"NAVIGATE":return{type:"NAVIGATE",url:""};case"CAPTCHA":return{type:t,useVision:!1};case"GO_BACK":case"GO_FORWARD":case"REFRESH":return{type:t};case"SCROLL_DOWN":case"SCROLL_UP":return{type:t,useVision:!1};case"WAIT":return{type:t,delay:1};case"CLICK":return{type:t,target:{elementDescriptor:""},doubleClick:!1,rightClick:!1,useVision:!1};case"HOVER":return{type:t,target:{elementDescriptor:""},useVision:!1};case"TYPE":return{type:t,target:{elementDescriptor:""},value:"",clearContent:!0,pressEnter:!1,pressKeysSequentially:!1,useVision:!1};case"PRESS":return{type:t,value:""};case"SELECT_OPTION":return{type:t,target:{elementDescriptor:""},option:""};case"TAB":return{type:t,url:""};case"REQUEST":return{type:t,url:"",method:"GET"};case"COOKIE":return{type:t,value:""};case"LOCAL_STORAGE":return{type:t,key:"",value:""};case"AI_ASSERTION":return{type:t,assertion:"",disableCache:!1,useVision:!1,cancelOnFailure:!1};case"SUCCESS":return{type:t};default:return(n=>{throw"If Typescript complains about the line below, you missed a case or break in the switch above"})()}};var $e=(t=>(t.AI_ACTION="AI_ACTION",t.PRESET_ACTION="PRESET_ACTION",t.MODULE="MODULE",t))($e||{});const zb=ot({type:Zt("AI_ACTION"),text:We(),commands:G_(Pd).optional()}),Vb=ot({type:Zt("PRESET_ACTION"),command:F3}),z3=ot({type:Zt("MODULE"),moduleId:We().uuid()}),X_=_u([zb,Vb]),Z_=ot({type:Zt("RESOLVED_MODULE"),moduleId:We().uuid(),name:We(),steps:X_.array()}),V3=_u([zb,Vb,z3]),Q_=_u([zb,Vb,Z_]),J_=t=>t.type==="RESOLVED_MODULE",ld=t=>t.type==="AI_ACTION"||t.type==="PRESET_ACTION",Ite=le.object({name:le.string(),fixtures:le.array(le.string().describe("Name of the fixture (must be available locally in the fixtures directory).")).optional()});var e2={},g0=fn&&fn.__assign||function(){return g0=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},g0.apply(this,arguments)};Object.defineProperty(e2,"__esModule",{value:!0});var U3=e2.isValidCron=void 0,KC=function(t){return/^\d+$/.test(t)?Number(t):NaN},jte=function(t){return t==="*"},Qp=function(t){return t==="?"},Ex=function(t,e,n){return t>=e&&t<=n},Bte=function(t,e,n){var r=t.split("-");switch(r.length){case 1:return jte(t)||Ex(KC(t),e,n);case 2:var i=r.map(function(a){return KC(a)}),o=i[0],s=i[1];return o<=s&&Ex(o,e,n)&&Ex(s,e,n);default:return!1}},Fte=function(t){return t===void 0||t.search(/[^\d]/)===-1&&KC(t)>0},Xl=function(t,e,n){if(t.search(/[^\d-,\/*]/)!==-1)return!1;var r=t.split(",");return r.every(function(i){var o=i.split("/");if(i.trim().endsWith("/")||o.length>2)return!1;var s=o[0],a=o[1];return Bte(s,e,n)&&Fte(a)})},zte=function(t){return Xl(t,0,59)},Vte=function(t){return Xl(t,0,59)},Ute=function(t){return Xl(t,0,23)},Wte=function(t,e){return e&&Qp(t)||Xl(t,1,31)},rN={jan:"1",feb:"2",mar:"3",apr:"4",may:"5",jun:"6",jul:"7",aug:"8",sep:"9",oct:"10",nov:"11",dec:"12"},Hte=function(t,e){if(t.search(/\/[a-zA-Z]/)!==-1)return!1;if(e){var n=t.toLowerCase().replace(/[a-z]{3}/g,function(r){return rN[r]===void 0?r:rN[r]});return Xl(n,1,12)}return Xl(t,1,12)},iN={sun:"0",mon:"1",tue:"2",wed:"3",thu:"4",fri:"5",sat:"6"},qte=function(t,e,n,r){if(n&&Qp(t))return!0;if(!n&&Qp(t)||t.search(/\/[a-zA-Z]/)!==-1)return!1;if(e){var i=t.toLowerCase().replace(/[a-z]{3}/g,function(o){return iN[o]===void 0?o:iN[o]});return Xl(i,0,r?7:6)}return Xl(t,0,r?7:6)},Kte=function(t,e,n){return!(n&&Qp(t)&&Qp(e))},Gte=function(t){return t.trim().split(/\s+/)},Yte={alias:!1,seconds:!1,allowBlankDay:!1,allowSevenAsSunday:!1};U3=e2.isValidCron=function(t,e){e=g0(g0({},Yte),e);var n=Gte(t);if(n.length>(e.seconds?6:5)||n.length<5)return!1;var r=[];if(n.length===6){var i=n.shift();i&&r.push(zte(i))}var o=n[0],s=n[1],a=n[2],l=n[3],c=n[4];return r.push(Vte(o)),r.push(Ute(s)),r.push(Wte(a,e.allowBlankDay)),r.push(Hte(l,e.alias)),r.push(qte(c,e.alias,e.allowBlankDay,e.allowSevenAsSunday)),r.push(Kte(a,c,e.allowBlankDay)),r.every(Boolean)};const Xte=le.object({availableAsModule:le.boolean().default(!1),disableAICaching:le.boolean().default(!1)}),Zte=le.object({cron:le.string().refine(t=>U3(t),{message:"Invalid cron expression."}).default("0 0 */1 * *"),enabled:le.boolean().default(!1),timeZone:le.string().default("America/Los_Angeles"),jobKey:le.string().optional()}),Qte=le.object({onSuccess:le.boolean().default(!1),onFailure:le.boolean().default(!0)}),t2=le.string().min(1).max(255).superRefine((t,e)=>{try{nne(t)}catch(n){return e.addIssue({code:le.ZodIssueCode.custom,message:n.message,fatal:!0}),le.NEVER}}),Nd=le.object({id:le.string(),name:t2,baseUrl:le.string(),schemaVersion:le.string(),advanced:Xte,retries:le.number(),envSettings:Ite.array().optional(),localOnly:le.boolean().optional()});Nd.pick({name:!0,baseUrl:!0,retries:!0,advanced:!0});const Jte=le.object({createdAt:le.coerce.date(),updatedAt:le.coerce.date(),schedule:Zte,notification:Qte,createdBy:le.string(),organizationId:le.string()});Nd.merge(Jte).merge(le.object({steps:le.array(Q_)}));const W3=Nd.merge(le.object({steps:le.array(Q_)}));Nd.merge(le.object({steps:V3.array()}));const H3=t=>t.toLowerCase().replace(/ /g,"-"),ene=/^[a-f0-9]{8}-[a-f0-9]{4}-[1-5][a-f0-9]{3}-[89ab][a-f0-9]{3}-[a-f0-9]{12}$/,tne=["modules","fixtures"];function nne(t){if(t=t.toLowerCase().trim(),t.length===0||t.length>255)throw new Error("Name must be between 1 and 255 characters long");if(/[<>:"\/\\|?*\x00]/.test(t))throw new Error("Name can only contain alphanumeric characters, dashes, and underscores.");if(/^(con|prn|aux|nul|com[0-9]|lpt[0-9])(\..*)?$/i.test(t))throw new Error(`"${t}" is a reserved name on Windows and cannot be used as a filename.`);if(/^\.+$/.test(t)||/^\s|\s$/.test(t))throw new Error("Name cannot start or end with a space or dot.");if(t.endsWith(".yaml"))throw new Error('Name cannot end with ".yaml".');if(tne.includes(t))throw new Error("'modules' is a reserved folder name in Momentic. Please choose a different name.");if(t.match(ene))throw new Error("Name cannot be a UUID. Please choose a different name.")}const rne=le.array(le.object({id:le.string(),name:le.string(),fullFilePath:le.string(),testPath:le.string().describe("path relative to the root test directory, i.e. my-folder/my-test.yaml"),fileName:le.string(),lastModified:le.coerce.date(),createdAt:le.coerce.date()})),ine=W3;le.object({steps:Q_.array()});le.object({name:le.string(),baseUrl:le.string().url()});W3.merge(le.object({testPath:le.string()}));le.object({name:le.string(),steps:X_.array()});const one=le.array(Z_);le.array(le.object({name:le.string(),moduleId:le.string().uuid(),numSteps:le.number()}));const n2=g.forwardRef(({className:t,...e},n)=>k.jsx("div",{className:"relative w-full overflow-auto",children:k.jsx("table",{ref:n,className:ft("w-full caption-bottom text-sm",t),...e})}));n2.displayName="Table";const r2=g.forwardRef(({className:t,...e},n)=>k.jsx("thead",{ref:n,className:ft("[&_tr]:border-b",t),...e}));r2.displayName="TableHeader";const i2=g.forwardRef(({className:t,...e},n)=>k.jsx("tbody",{ref:n,className:ft("[&_tr:last-child]:border-0",t),...e}));i2.displayName="TableBody";const q3=g.forwardRef(({className:t,...e},n)=>k.jsx("tfoot",{ref:n,className:ft("bg-muted/50 border-t font-medium [&>tr]:last:border-b-0",t),...e}));q3.displayName="TableFooter";const Gc=g.forwardRef(({className:t,...e},n)=>k.jsx("tr",{ref:n,className:ft("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",t),...e}));Gc.displayName="TableRow";const Bc=g.forwardRef(({className:t,...e},n)=>k.jsx("th",{ref:n,className:ft("text-muted-foreground h-10 px-2 text-left align-middle font-medium [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",t),...e}));Bc.displayName="TableHead";const ka=g.forwardRef(({className:t,...e},n)=>k.jsx("td",{ref:n,className:ft("p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",t),...e}));ka.displayName="TableCell";const sne=g.forwardRef(({className:t,...e},n)=>k.jsx("caption",{ref:n,className:ft("text-muted-foreground mt-4 text-sm",t),...e}));sne.displayName="TableCaption";var Mm=t=>t.type==="checkbox",_f=t=>t instanceof Date,ai=t=>t==null;const K3=t=>typeof t=="object";var vr=t=>!ai(t)&&!Array.isArray(t)&&K3(t)&&!_f(t),G3=t=>vr(t)&&t.target?Mm(t.target)?t.target.checked:t.target.value:t,ane=t=>t.substring(0,t.search(/\.\d+(\.|$)/))||t,Y3=(t,e)=>t.has(ane(e)),lne=t=>{const e=t.constructor&&t.constructor.prototype;return vr(e)&&e.hasOwnProperty("isPrototypeOf")},o2=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function es(t){let e;const n=Array.isArray(t);if(t instanceof Date)e=new Date(t);else if(t instanceof Set)e=new Set(t);else if(!(o2&&(t instanceof Blob||t instanceof FileList))&&(n||vr(t)))if(e=n?[]:{},!n&&!lne(t))e=t;else for(const r in t)t.hasOwnProperty(r)&&(e[r]=es(t[r]));else return t;return e}var Dm=t=>Array.isArray(t)?t.filter(Boolean):[],Kn=t=>t===void 0,ze=(t,e,n)=>{if(!e||!vr(t))return n;const r=Dm(e.split(/[,[\].]+?/)).reduce((i,o)=>ai(i)?i:i[o],t);return Kn(r)||r===t?Kn(t[e])?n:t[e]:r},_o=t=>typeof t=="boolean";const v0={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},as={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},ya={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},X3=ut.createContext(null),Ub=()=>ut.useContext(X3),cne=t=>{const{children:e,...n}=t;return ut.createElement(X3.Provider,{value:n},e)};var Z3=(t,e,n,r=!0)=>{const i={defaultValues:e._defaultValues};for(const o in t)Object.defineProperty(i,o,{get:()=>{const s=o;return e._proxyFormState[s]!==as.all&&(e._proxyFormState[s]=!r||as.all),n&&(n[s]=!0),t[s]}});return i},Co=t=>vr(t)&&!Object.keys(t).length,Q3=(t,e,n,r)=>{n(t);const{name:i,...o}=t;return Co(o)||Object.keys(o).length>=Object.keys(e).length||Object.keys(o).find(s=>e[s]===(!r||as.all))},sy=t=>Array.isArray(t)?t:[t],J3=(t,e,n)=>!t||!e||t===e||sy(t).some(r=>r&&(n?r===e:r.startsWith(e)||e.startsWith(r)));function s2(t){const e=ut.useRef(t);e.current=t,ut.useEffect(()=>{const n=!t.disabled&&e.current.subject&&e.current.subject.subscribe({next:e.current.next});return()=>{n&&n.unsubscribe()}},[t.disabled])}function une(t){const e=Ub(),{control:n=e.control,disabled:r,name:i,exact:o}=t||{},[s,a]=ut.useState(n._formState),l=ut.useRef(!0),c=ut.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1}),f=ut.useRef(i);return f.current=i,s2({disabled:r,next:d=>l.current&&J3(f.current,d.name,o)&&Q3(d,c.current,n._updateFormState)&&a({...n._formState,...d}),subject:n._subjects.state}),ut.useEffect(()=>(l.current=!0,c.current.isValid&&n._updateValid(!0),()=>{l.current=!1}),[n]),Z3(s,n,c.current,!1)}var Vs=t=>typeof t=="string",e4=(t,e,n,r,i)=>Vs(t)?(r&&e.watch.add(t),ze(n,t,i)):Array.isArray(t)?t.map(o=>(r&&e.watch.add(o),ze(n,o))):(r&&(e.watchAll=!0),n);function fne(t){const e=Ub(),{control:n=e.control,name:r,defaultValue:i,disabled:o,exact:s}=t||{},a=ut.useRef(r);a.current=r,s2({disabled:o,subject:n._subjects.values,next:f=>{J3(a.current,f.name,s)&&c(es(e4(a.current,n._names,f.values||n._formValues,!1,i)))}});const[l,c]=ut.useState(n._getWatch(r,i));return ut.useEffect(()=>n._removeUnmounted()),l}var a2=t=>/^\w*$/.test(t),t4=t=>Dm(t.replace(/["|']|\]/g,"").split(/\.|\[/)),cn=(t,e,n)=>{let r=-1;const i=a2(e)?[e]:t4(e),o=i.length,s=o-1;for(;++r<o;){const a=i[r];let l=n;if(r!==s){const c=t[a];l=vr(c)||Array.isArray(c)?c:isNaN(+i[r+1])?{}:[]}t[a]=l,t=t[a]}return t};function dne(t){const e=Ub(),{name:n,disabled:r,control:i=e.control,shouldUnregister:o}=t,s=Y3(i._names.array,n),a=fne({control:i,name:n,defaultValue:ze(i._formValues,n,ze(i._defaultValues,n,t.defaultValue)),exact:!0}),l=une({control:i,name:n}),c=ut.useRef(i.register(n,{...t.rules,value:a,..._o(t.disabled)?{disabled:t.disabled}:{}}));return ut.useEffect(()=>{const f=i._options.shouldUnregister||o,d=(p,m)=>{const v=ze(i._fields,p);v&&(v._f.mount=m)};if(d(n,!0),f){const p=es(ze(i._options.defaultValues,n));cn(i._defaultValues,n,p),Kn(ze(i._formValues,n))&&cn(i._formValues,n,p)}return()=>{(s?f&&!i._state.action:f)?i.unregister(n):d(n,!1)}},[n,i,s,o]),ut.useEffect(()=>{ze(i._fields,n)&&i._updateDisabledField({disabled:r,fields:i._fields,name:n,value:ze(i._fields,n)._f.value})},[r,n,i]),{field:{name:n,value:a,..._o(r)||_o(l.disabled)?{disabled:l.disabled||r}:{},onChange:ut.useCallback(f=>c.current.onChange({target:{value:G3(f),name:n},type:v0.CHANGE}),[n]),onBlur:ut.useCallback(()=>c.current.onBlur({target:{value:ze(i._formValues,n),name:n},type:v0.BLUR}),[n,i]),ref:f=>{const d=ze(i._fields,n);d&&f&&(d._f.ref={focus:()=>f.focus(),select:()=>f.select(),setCustomValidity:p=>f.setCustomValidity(p),reportValidity:()=>f.reportValidity()})}},formState:l,fieldState:Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!ze(l.errors,n)},isDirty:{enumerable:!0,get:()=>!!ze(l.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!ze(l.touchedFields,n)},error:{enumerable:!0,get:()=>ze(l.errors,n)}})}}const hne=t=>t.render(dne(t));var n4=(t,e,n,r,i)=>e?{...n[t],types:{...n[t]&&n[t].types?n[t].types:{},[r]:i||!0}}:{},oN=t=>({isOnSubmit:!t||t===as.onSubmit,isOnBlur:t===as.onBlur,isOnChange:t===as.onChange,isOnAll:t===as.all,isOnTouch:t===as.onTouched}),sN=(t,e,n)=>!n&&(e.watchAll||e.watch.has(t)||[...e.watch].some(r=>t.startsWith(r)&&/^\.\w+/.test(t.slice(r.length))));const sp=(t,e,n,r)=>{for(const i of n||Object.keys(t)){const o=ze(t,i);if(o){const{_f:s,...a}=o;if(s){if(s.refs&&s.refs[0]&&e(s.refs[0],i)&&!r)break;if(s.ref&&e(s.ref,s.name)&&!r)break;sp(a,e)}else vr(a)&&sp(a,e)}}};var pne=(t,e,n)=>{const r=Dm(ze(t,n));return cn(r,"root",e[n]),cn(t,n,r),t},l2=t=>t.type==="file",El=t=>typeof t=="function",y0=t=>{if(!o2)return!1;const e=t?t.ownerDocument:0;return t instanceof(e&&e.defaultView?e.defaultView.HTMLElement:HTMLElement)},ay=t=>Vs(t),c2=t=>t.type==="radio",b0=t=>t instanceof RegExp;const aN={value:!1,isValid:!1},lN={value:!0,isValid:!0};var r4=t=>{if(Array.isArray(t)){if(t.length>1){const e=t.filter(n=>n&&n.checked&&!n.disabled).map(n=>n.value);return{value:e,isValid:!!e.length}}return t[0].checked&&!t[0].disabled?t[0].attributes&&!Kn(t[0].attributes.value)?Kn(t[0].value)||t[0].value===""?lN:{value:t[0].value,isValid:!0}:lN:aN}return aN};const cN={isValid:!1,value:null};var i4=t=>Array.isArray(t)?t.reduce((e,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:e,cN):cN;function uN(t,e,n="validate"){if(ay(t)||Array.isArray(t)&&t.every(ay)||_o(t)&&!t)return{type:n,message:ay(t)?t:"",ref:e}}var Yu=t=>vr(t)&&!b0(t)?t:{value:t,message:""},fN=async(t,e,n,r,i)=>{const{ref:o,refs:s,required:a,maxLength:l,minLength:c,min:f,max:d,pattern:p,validate:m,name:v,valueAsNumber:b,mount:S,disabled:x}=t._f,w=ze(e,v);if(!S||x)return{};const C=s?s[0]:o,T=L=>{r&&C.reportValidity&&(C.setCustomValidity(_o(L)?"":L||""),C.reportValidity())},A={},_=c2(o),R=Mm(o),M=_||R,I=(b||l2(o))&&Kn(o.value)&&Kn(w)||y0(o)&&o.value===""||w===""||Array.isArray(w)&&!w.length,V=n4.bind(null,v,n,A),U=(L,G,K,F=ya.maxLength,ie=ya.minLength)=>{const ae=L?G:K;A[v]={type:L?F:ie,message:ae,ref:o,...V(L?F:ie,ae)}};if(i?!Array.isArray(w)||!w.length:a&&(!M&&(I||ai(w))||_o(w)&&!w||R&&!r4(s).isValid||_&&!i4(s).isValid)){const{value:L,message:G}=ay(a)?{value:!!a,message:a}:Yu(a);if(L&&(A[v]={type:ya.required,message:G,ref:C,...V(ya.required,G)},!n))return T(G),A}if(!I&&(!ai(f)||!ai(d))){let L,G;const K=Yu(d),F=Yu(f);if(!ai(w)&&!isNaN(w)){const ie=o.valueAsNumber||w&&+w;ai(K.value)||(L=ie>K.value),ai(F.value)||(G=ie<F.value)}else{const ie=o.valueAsDate||new Date(w),ae=P=>new Date(new Date().toDateString()+" "+P),re=o.type=="time",W=o.type=="week";Vs(K.value)&&w&&(L=re?ae(w)>ae(K.value):W?w>K.value:ie>new Date(K.value)),Vs(F.value)&&w&&(G=re?ae(w)<ae(F.value):W?w<F.value:ie<new Date(F.value))}if((L||G)&&(U(!!L,K.message,F.message,ya.max,ya.min),!n))return T(A[v].message),A}if((l||c)&&!I&&(Vs(w)||i&&Array.isArray(w))){const L=Yu(l),G=Yu(c),K=!ai(L.value)&&w.length>+L.value,F=!ai(G.value)&&w.length<+G.value;if((K||F)&&(U(K,L.message,G.message),!n))return T(A[v].message),A}if(p&&!I&&Vs(w)){const{value:L,message:G}=Yu(p);if(b0(L)&&!w.match(L)&&(A[v]={type:ya.pattern,message:G,ref:o,...V(ya.pattern,G)},!n))return T(G),A}if(m){if(El(m)){const L=await m(w,e),G=uN(L,C);if(G&&(A[v]={...G,...V(ya.validate,G.message)},!n))return T(G.message),A}else if(vr(m)){let L={};for(const G in m){if(!Co(L)&&!n)break;const K=uN(await m[G](w,e),C,G);K&&(L={...K,...V(G,K.message)},T(K.message),n&&(A[v]=L))}if(!Co(L)&&(A[v]={ref:C,...L},!n))return A}}return T(!0),A};function mne(t,e){const n=e.slice(0,-1).length;let r=0;for(;r<n;)t=Kn(t)?r++:t[e[r++]];return t}function gne(t){for(const e in t)if(t.hasOwnProperty(e)&&!Kn(t[e]))return!1;return!0}function Rr(t,e){const n=Array.isArray(e)?e:a2(e)?[e]:t4(e),r=n.length===1?t:mne(t,n),i=n.length-1,o=n[i];return r&&delete r[o],i!==0&&(vr(r)&&Co(r)||Array.isArray(r)&&gne(r))&&Rr(t,n.slice(0,-1)),t}var _x=()=>{let t=[];return{get observers(){return t},next:i=>{for(const o of t)o.next&&o.next(i)},subscribe:i=>(t.push(i),{unsubscribe:()=>{t=t.filter(o=>o!==i)}}),unsubscribe:()=>{t=[]}}},w0=t=>ai(t)||!K3(t);function Fc(t,e){if(w0(t)||w0(e))return t===e;if(_f(t)&&_f(e))return t.getTime()===e.getTime();const n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(const i of n){const o=t[i];if(!r.includes(i))return!1;if(i!=="ref"){const s=e[i];if(_f(o)&&_f(s)||vr(o)&&vr(s)||Array.isArray(o)&&Array.isArray(s)?!Fc(o,s):o!==s)return!1}}return!0}var o4=t=>t.type==="select-multiple",vne=t=>c2(t)||Mm(t),Tx=t=>y0(t)&&t.isConnected,s4=t=>{for(const e in t)if(El(t[e]))return!0;return!1};function x0(t,e={}){const n=Array.isArray(t);if(vr(t)||n)for(const r in t)Array.isArray(t[r])||vr(t[r])&&!s4(t[r])?(e[r]=Array.isArray(t[r])?[]:{},x0(t[r],e[r])):ai(t[r])||(e[r]=!0);return e}function a4(t,e,n){const r=Array.isArray(t);if(vr(t)||r)for(const i in t)Array.isArray(t[i])||vr(t[i])&&!s4(t[i])?Kn(e)||w0(n[i])?n[i]=Array.isArray(t[i])?x0(t[i],[]):{...x0(t[i])}:a4(t[i],ai(e)?{}:e[i],n[i]):n[i]=!Fc(t[i],e[i]);return n}var Ax=(t,e)=>a4(t,e,x0(e)),l4=(t,{valueAsNumber:e,valueAsDate:n,setValueAs:r})=>Kn(t)?t:e?t===""?NaN:t&&+t:n&&Vs(t)?new Date(t):r?r(t):t;function Ox(t){const e=t.ref;if(!(t.refs?t.refs.every(n=>n.disabled):e.disabled))return l2(e)?e.files:c2(e)?i4(t.refs).value:o4(e)?[...e.selectedOptions].map(({value:n})=>n):Mm(e)?r4(t.refs).value:l4(Kn(e.value)?t.ref.value:e.value,t)}var yne=(t,e,n,r)=>{const i={};for(const o of t){const s=ze(e,o);s&&cn(i,o,s._f)}return{criteriaMode:n,names:[...t],fields:i,shouldUseNativeValidation:r}},Ch=t=>Kn(t)?t:b0(t)?t.source:vr(t)?b0(t.value)?t.value.source:t.value:t,bne=t=>t.mount&&(t.required||t.min||t.max||t.maxLength||t.minLength||t.pattern||t.validate);function dN(t,e,n){const r=ze(t,n);if(r||a2(n))return{error:r,name:n};const i=n.split(".");for(;i.length;){const o=i.join("."),s=ze(e,o),a=ze(t,o);if(s&&!Array.isArray(s)&&n!==o)return{name:n};if(a&&a.type)return{name:o,error:a};i.pop()}return{name:n}}var wne=(t,e,n,r,i)=>i.isOnAll?!1:!n&&i.isOnTouch?!(e||t):(n?r.isOnBlur:i.isOnBlur)?!t:(n?r.isOnChange:i.isOnChange)?t:!0,xne=(t,e)=>!Dm(ze(t,e)).length&&Rr(t,e);const Sne={mode:as.onSubmit,reValidateMode:as.onChange,shouldFocusError:!0};function Cne(t={},e){let n={...Sne,...t},r={submitCount:0,isDirty:!1,isLoading:El(n.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},errors:n.errors||{},disabled:!1},i={},o=vr(n.defaultValues)||vr(n.values)?es(n.defaultValues||n.values)||{}:{},s=n.shouldUnregister?{}:es(o),a={action:!1,mount:!1,watch:!1},l={mount:new Set,unMount:new Set,array:new Set,watch:new Set},c,f=0;const d={isDirty:!1,dirtyFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},p={values:_x(),array:_x(),state:_x()},m=t.resetOptions&&t.resetOptions.keepDirtyValues,v=oN(n.mode),b=oN(n.reValidateMode),S=n.criteriaMode===as.all,x=z=>X=>{clearTimeout(f),f=setTimeout(z,X)},w=async z=>{if(d.isValid||z){const X=n.resolver?Co((await V()).errors):await L(i,!0);X!==r.isValid&&p.state.next({isValid:X})}},C=z=>d.isValidating&&p.state.next({isValidating:z}),T=(z,X=[],ne,_e,Ce=!0,j=!0)=>{if(_e&&ne){if(a.action=!0,j&&Array.isArray(ze(i,z))){const ee=ne(ze(i,z),_e.argA,_e.argB);Ce&&cn(i,z,ee)}if(j&&Array.isArray(ze(r.errors,z))){const ee=ne(ze(r.errors,z),_e.argA,_e.argB);Ce&&cn(r.errors,z,ee),xne(r.errors,z)}if(d.touchedFields&&j&&Array.isArray(ze(r.touchedFields,z))){const ee=ne(ze(r.touchedFields,z),_e.argA,_e.argB);Ce&&cn(r.touchedFields,z,ee)}d.dirtyFields&&(r.dirtyFields=Ax(o,s)),p.state.next({name:z,isDirty:K(z,X),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else cn(s,z,X)},A=(z,X)=>{cn(r.errors,z,X),p.state.next({errors:r.errors})},_=z=>{r.errors=z,p.state.next({errors:r.errors,isValid:!1})},R=(z,X,ne,_e)=>{const Ce=ze(i,z);if(Ce){const j=ze(s,z,Kn(ne)?ze(o,z):ne);Kn(j)||_e&&_e.defaultChecked||X?cn(s,z,X?j:Ox(Ce._f)):ae(z,j),a.mount&&w()}},M=(z,X,ne,_e,Ce)=>{let j=!1,ee=!1;const de={name:z},Ae=!!(ze(i,z)&&ze(i,z)._f.disabled);if(!ne||_e){d.isDirty&&(ee=r.isDirty,r.isDirty=de.isDirty=K(),j=ee!==de.isDirty);const Be=Ae||Fc(ze(o,z),X);ee=!!(!Ae&&ze(r.dirtyFields,z)),Be||Ae?Rr(r.dirtyFields,z):cn(r.dirtyFields,z,!0),de.dirtyFields=r.dirtyFields,j=j||d.dirtyFields&&ee!==!Be}if(ne){const Be=ze(r.touchedFields,z);Be||(cn(r.touchedFields,z,ne),de.touchedFields=r.touchedFields,j=j||d.touchedFields&&Be!==ne)}return j&&Ce&&p.state.next(de),j?de:{}},I=(z,X,ne,_e)=>{const Ce=ze(r.errors,z),j=d.isValid&&_o(X)&&r.isValid!==X;if(t.delayError&&ne?(c=x(()=>A(z,ne)),c(t.delayError)):(clearTimeout(f),c=null,ne?cn(r.errors,z,ne):Rr(r.errors,z)),(ne?!Fc(Ce,ne):Ce)||!Co(_e)||j){const ee={..._e,...j&&_o(X)?{isValid:X}:{},errors:r.errors,name:z};r={...r,...ee},p.state.next(ee)}C(!1)},V=async z=>n.resolver(s,n.context,yne(z||l.mount,i,n.criteriaMode,n.shouldUseNativeValidation)),U=async z=>{const{errors:X}=await V(z);if(z)for(const ne of z){const _e=ze(X,ne);_e?cn(r.errors,ne,_e):Rr(r.errors,ne)}else r.errors=X;return X},L=async(z,X,ne={valid:!0})=>{for(const _e in z){const Ce=z[_e];if(Ce){const{_f:j,...ee}=Ce;if(j){const de=l.array.has(j.name),Ae=await fN(Ce,s,S,n.shouldUseNativeValidation&&!X,de);if(Ae[j.name]&&(ne.valid=!1,X))break;!X&&(ze(Ae,j.name)?de?pne(r.errors,Ae,j.name):cn(r.errors,j.name,Ae[j.name]):Rr(r.errors,j.name))}ee&&await L(ee,X,ne)}}return ne.valid},G=()=>{for(const z of l.unMount){const X=ze(i,z);X&&(X._f.refs?X._f.refs.every(ne=>!Tx(ne)):!Tx(X._f.ref))&&J(z)}l.unMount=new Set},K=(z,X)=>(z&&X&&cn(s,z,X),!Fc($(),o)),F=(z,X,ne)=>e4(z,l,{...a.mount?s:Kn(X)?o:Vs(z)?{[z]:X}:X},ne,X),ie=z=>Dm(ze(a.mount?s:o,z,t.shouldUnregister?ze(o,z,[]):[])),ae=(z,X,ne={})=>{const _e=ze(i,z);let Ce=X;if(_e){const j=_e._f;j&&(!j.disabled&&cn(s,z,l4(X,j)),Ce=y0(j.ref)&&ai(X)?"":X,o4(j.ref)?[...j.ref.options].forEach(ee=>ee.selected=Ce.includes(ee.value)):j.refs?Mm(j.ref)?j.refs.length>1?j.refs.forEach(ee=>(!ee.defaultChecked||!ee.disabled)&&(ee.checked=Array.isArray(Ce)?!!Ce.find(de=>de===ee.value):Ce===ee.value)):j.refs[0]&&(j.refs[0].checked=!!Ce):j.refs.forEach(ee=>ee.checked=ee.value===Ce):l2(j.ref)?j.ref.value="":(j.ref.value=Ce,j.ref.type||p.values.next({name:z,values:{...s}})))}(ne.shouldDirty||ne.shouldTouch)&&M(z,Ce,ne.shouldTouch,ne.shouldDirty,!0),ne.shouldValidate&&fe(z)},re=(z,X,ne)=>{for(const _e in X){const Ce=X[_e],j=`${z}.${_e}`,ee=ze(i,j);(l.array.has(z)||!w0(Ce)||ee&&!ee._f)&&!_f(Ce)?re(j,Ce,ne):ae(j,Ce,ne)}},W=(z,X,ne={})=>{const _e=ze(i,z),Ce=l.array.has(z),j=es(X);cn(s,z,j),Ce?(p.array.next({name:z,values:{...s}}),(d.isDirty||d.dirtyFields)&&ne.shouldDirty&&p.state.next({name:z,dirtyFields:Ax(o,s),isDirty:K(z,j)})):_e&&!_e._f&&!ai(j)?re(z,j,ne):ae(z,j,ne),sN(z,l)&&p.state.next({...r}),p.values.next({name:z,values:{...s}}),!a.mount&&e()},P=async z=>{const X=z.target;let ne=X.name,_e=!0;const Ce=ze(i,ne),j=()=>X.type?Ox(Ce._f):G3(z),ee=de=>{_e=Number.isNaN(de)||de===ze(s,ne,de)};if(Ce){let de,Ae;const Be=j(),Te=z.type===v0.BLUR||z.type===v0.FOCUS_OUT,je=!bne(Ce._f)&&!n.resolver&&!ze(r.errors,ne)&&!Ce._f.deps||wne(Te,ze(r.touchedFields,ne),r.isSubmitted,b,v),Oe=sN(ne,l,Te);cn(s,ne,Be),Te?(Ce._f.onBlur&&Ce._f.onBlur(z),c&&c(0)):Ce._f.onChange&&Ce._f.onChange(z);const Qt=M(ne,Be,Te,!1),sn=!Co(Qt)||Oe;if(!Te&&p.values.next({name:ne,type:z.type,values:{...s}}),je)return d.isValid&&w(),sn&&p.state.next({name:ne,...Oe?{}:Qt});if(!Te&&Oe&&p.state.next({...r}),C(!0),n.resolver){const{errors:Lt}=await V([ne]);if(ee(Be),_e){const Kt=dN(r.errors,i,ne),Pt=dN(Lt,i,Kt.name||ne);de=Pt.error,ne=Pt.name,Ae=Co(Lt)}}else de=(await fN(Ce,s,S,n.shouldUseNativeValidation))[ne],ee(Be),_e&&(de?Ae=!1:d.isValid&&(Ae=await L(i,!0)));_e&&(Ce._f.deps&&fe(Ce._f.deps),I(ne,Ae,de,Qt))}},he=(z,X)=>{if(ze(r.errors,X)&&z.focus)return z.focus(),1},fe=async(z,X={})=>{let ne,_e;const Ce=sy(z);if(C(!0),n.resolver){const j=await U(Kn(z)?z:Ce);ne=Co(j),_e=z?!Ce.some(ee=>ze(j,ee)):ne}else z?(_e=(await Promise.all(Ce.map(async j=>{const ee=ze(i,j);return await L(ee&&ee._f?{[j]:ee}:ee)}))).every(Boolean),!(!_e&&!r.isValid)&&w()):_e=ne=await L(i);return p.state.next({...!Vs(z)||d.isValid&&ne!==r.isValid?{}:{name:z},...n.resolver||!z?{isValid:ne}:{},errors:r.errors,isValidating:!1}),X.shouldFocus&&!_e&&sp(i,he,z?Ce:l.mount),_e},$=z=>{const X={...o,...a.mount?s:{}};return Kn(z)?X:Vs(z)?ze(X,z):z.map(ne=>ze(X,ne))},Ne=(z,X)=>({invalid:!!ze((X||r).errors,z),isDirty:!!ze((X||r).dirtyFields,z),isTouched:!!ze((X||r).touchedFields,z),error:ze((X||r).errors,z)}),He=z=>{z&&sy(z).forEach(X=>Rr(r.errors,X)),p.state.next({errors:z?r.errors:{}})},Ye=(z,X,ne)=>{const _e=(ze(i,z,{_f:{}})._f||{}).ref;cn(r.errors,z,{...X,ref:_e}),p.state.next({name:z,errors:r.errors,isValid:!1}),ne&&ne.shouldFocus&&_e&&_e.focus&&_e.focus()},Ie=(z,X)=>El(z)?p.values.subscribe({next:ne=>z(F(void 0,X),ne)}):F(z,X,!0),J=(z,X={})=>{for(const ne of z?sy(z):l.mount)l.mount.delete(ne),l.array.delete(ne),X.keepValue||(Rr(i,ne),Rr(s,ne)),!X.keepError&&Rr(r.errors,ne),!X.keepDirty&&Rr(r.dirtyFields,ne),!X.keepTouched&&Rr(r.touchedFields,ne),!n.shouldUnregister&&!X.keepDefaultValue&&Rr(o,ne);p.values.next({values:{...s}}),p.state.next({...r,...X.keepDirty?{isDirty:K()}:{}}),!X.keepIsValid&&w()},Se=({disabled:z,name:X,field:ne,fields:_e,value:Ce})=>{if(_o(z)){const j=z?void 0:Kn(Ce)?Ox(ne?ne._f:ze(_e,X)._f):Ce;cn(s,X,j),M(X,j,!1,!1,!0)}},Ee=(z,X={})=>{let ne=ze(i,z);const _e=_o(X.disabled);return cn(i,z,{...ne||{},_f:{...ne&&ne._f?ne._f:{ref:{name:z}},name:z,mount:!0,...X}}),l.mount.add(z),ne?Se({field:ne,disabled:X.disabled,name:z,value:X.value}):R(z,!0,X.value),{..._e?{disabled:X.disabled}:{},...n.progressive?{required:!!X.required,min:Ch(X.min),max:Ch(X.max),minLength:Ch(X.minLength),maxLength:Ch(X.maxLength),pattern:Ch(X.pattern)}:{},name:z,onChange:P,onBlur:P,ref:Ce=>{if(Ce){Ee(z,X),ne=ze(i,z);const j=Kn(Ce.value)&&Ce.querySelectorAll&&Ce.querySelectorAll("input,select,textarea")[0]||Ce,ee=vne(j),de=ne._f.refs||[];if(ee?de.find(Ae=>Ae===j):j===ne._f.ref)return;cn(i,z,{_f:{...ne._f,...ee?{refs:[...de.filter(Tx),j,...Array.isArray(ze(o,z))?[{}]:[]],ref:{type:j.type,name:z}}:{ref:j}}}),R(z,!1,void 0,j)}else ne=ze(i,z,{}),ne._f&&(ne._f.mount=!1),(n.shouldUnregister||X.shouldUnregister)&&!(Y3(l.array,z)&&a.action)&&l.unMount.add(z)}}},ke=()=>n.shouldFocusError&&sp(i,he,l.mount),oe=z=>{_o(z)&&(p.state.next({disabled:z}),sp(i,(X,ne)=>{let _e=z;const Ce=ze(i,ne);Ce&&_o(Ce._f.disabled)&&(_e||(_e=Ce._f.disabled)),X.disabled=_e},0,!1))},se=(z,X)=>async ne=>{ne&&(ne.preventDefault&&ne.preventDefault(),ne.persist&&ne.persist());let _e=es(s);if(p.state.next({isSubmitting:!0}),n.resolver){const{errors:Ce,values:j}=await V();r.errors=Ce,_e=j}else await L(i);Rr(r.errors,"root"),Co(r.errors)?(p.state.next({errors:{}}),await z(_e,ne)):(X&&await X({...r.errors},ne),ke(),setTimeout(ke)),p.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Co(r.errors),submitCount:r.submitCount+1,errors:r.errors})},ue=(z,X={})=>{ze(i,z)&&(Kn(X.defaultValue)?W(z,ze(o,z)):(W(z,X.defaultValue),cn(o,z,X.defaultValue)),X.keepTouched||Rr(r.touchedFields,z),X.keepDirty||(Rr(r.dirtyFields,z),r.isDirty=X.defaultValue?K(z,ze(o,z)):K()),X.keepError||(Rr(r.errors,z),d.isValid&&w()),p.state.next({...r}))},we=(z,X={})=>{const ne=z?es(z):o,_e=es(ne),Ce=z&&!Co(z)?_e:o;if(X.keepDefaultValues||(o=ne),!X.keepValues){if(X.keepDirtyValues||m)for(const j of l.mount)ze(r.dirtyFields,j)?cn(Ce,j,ze(s,j)):W(j,ze(Ce,j));else{if(o2&&Kn(z))for(const j of l.mount){const ee=ze(i,j);if(ee&&ee._f){const de=Array.isArray(ee._f.refs)?ee._f.refs[0]:ee._f.ref;if(y0(de)){const Ae=de.closest("form");if(Ae){Ae.reset();break}}}}i={}}s=t.shouldUnregister?X.keepDefaultValues?es(o):{}:es(Ce),p.array.next({values:{...Ce}}),p.values.next({values:{...Ce}})}l={mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},!a.mount&&e(),a.mount=!d.isValid||!!X.keepIsValid,a.watch=!!t.shouldUnregister,p.state.next({submitCount:X.keepSubmitCount?r.submitCount:0,isDirty:X.keepDirty?r.isDirty:!!(X.keepDefaultValues&&!Fc(z,o)),isSubmitted:X.keepIsSubmitted?r.isSubmitted:!1,dirtyFields:X.keepDirtyValues?r.dirtyFields:X.keepDefaultValues&&z?Ax(o,z):{},touchedFields:X.keepTouched?r.touchedFields:{},errors:X.keepErrors?r.errors:{},isSubmitSuccessful:X.keepIsSubmitSuccessful?r.isSubmitSuccessful:!1,isSubmitting:!1})},nt=(z,X)=>we(El(z)?z(s):z,X);return{control:{register:Ee,unregister:J,getFieldState:Ne,handleSubmit:se,setError:Ye,_executeSchema:V,_getWatch:F,_getDirty:K,_updateValid:w,_removeUnmounted:G,_updateFieldArray:T,_updateDisabledField:Se,_getFieldArray:ie,_reset:we,_resetDefaultValues:()=>El(n.defaultValues)&&n.defaultValues().then(z=>{nt(z,n.resetOptions),p.state.next({isLoading:!1})}),_updateFormState:z=>{r={...r,...z}},_disableForm:oe,_subjects:p,_proxyFormState:d,_setErrors:_,get _fields(){return i},get _formValues(){return s},get _state(){return a},set _state(z){a=z},get _defaultValues(){return o},get _names(){return l},set _names(z){l=z},get _formState(){return r},set _formState(z){r=z},get _options(){return n},set _options(z){n={...n,...z}}},trigger:fe,register:Ee,handleSubmit:se,watch:Ie,setValue:W,getValues:$,reset:nt,resetField:ue,clearErrors:He,unregister:J,setError:Ye,setFocus:(z,X={})=>{const ne=ze(i,z),_e=ne&&ne._f;if(_e){const Ce=_e.refs?_e.refs[0]:_e.ref;Ce.focus&&(Ce.focus(),X.shouldSelect&&Ce.select())}},getFieldState:Ne}}function c4(t={}){const e=ut.useRef(),n=ut.useRef(),[r,i]=ut.useState({isDirty:!1,isValidating:!1,isLoading:El(t.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},errors:t.errors||{},disabled:!1,defaultValues:El(t.defaultValues)?void 0:t.defaultValues});e.current||(e.current={...Cne(t,()=>i(s=>({...s}))),formState:r});const o=e.current.control;return o._options=t,s2({subject:o._subjects.state,next:s=>{Q3(s,o._proxyFormState,o._updateFormState,!0)&&i({...o._formState})}}),ut.useEffect(()=>o._disableForm(t.disabled),[o,t.disabled]),ut.useEffect(()=>{if(o._proxyFormState.isDirty){const s=o._getDirty();s!==r.isDirty&&o._subjects.state.next({isDirty:s})}},[o,r.isDirty]),ut.useEffect(()=>{t.values&&!Fc(t.values,n.current)?(o._reset(t.values,o._options.resetOptions),n.current=t.values,i(s=>({...s}))):o._resetDefaultValues()},[t.values,o]),ut.useEffect(()=>{t.errors&&o._setErrors(t.errors)},[t.errors,o]),ut.useEffect(()=>{o._state.mount||(o._updateValid(),o._state.mount=!0),o._state.watch&&(o._state.watch=!1,o._subjects.state.next({...o._formState})),o._removeUnmounted()}),e.current.formState=Z3(r,o),e.current}var hN=function(t,e,n){if(t&&"reportValidity"in t){var r=ze(n,e);t.setCustomValidity(r&&r.message||""),t.reportValidity()}},u4=function(t,e){var n=function(i){var o=e.fields[i];o&&o.ref&&"reportValidity"in o.ref?hN(o.ref,i,t):o.refs&&o.refs.forEach(function(s){return hN(s,i,t)})};for(var r in e.fields)n(r)},kne=function(t,e){e.shouldUseNativeValidation&&u4(t,e);var n={};for(var r in t){var i=ze(e.fields,r),o=Object.assign(t[r]||{},{ref:i&&i.ref});if(_ne(e.names||Object.keys(t),r)){var s=Object.assign({},Ene(ze(n,r)));cn(s,"root",o),cn(n,r,s)}else cn(n,r,o)}return n},Ene=function(t){return Array.isArray(t)?t.filter(Boolean):[]},_ne=function(t,e){return t.some(function(n){return n.startsWith(e+".")})},Tne=function(t,e){for(var n={};t.length;){var r=t[0],i=r.code,o=r.message,s=r.path.join(".");if(!n[s])if("unionErrors"in r){var a=r.unionErrors[0].errors[0];n[s]={message:a.message,type:a.code}}else n[s]={message:o,type:i};if("unionErrors"in r&&r.unionErrors.forEach(function(f){return f.errors.forEach(function(d){return t.push(d)})}),e){var l=n[s].types,c=l&&l[r.code];n[s]=n4(s,e,n,i,c?[].concat(c,r.message):r.message)}t.shift()}return n},f4=function(t,e,n){return n===void 0&&(n={}),function(r,i,o){try{return Promise.resolve(function(s,a){try{var l=Promise.resolve(t[n.mode==="sync"?"parse":"parseAsync"](r,e)).then(function(c){return o.shouldUseNativeValidation&&u4({},o),{errors:{},values:n.raw?r:c}})}catch(c){return a(c)}return l&&l.then?l.then(void 0,a):l}(0,function(s){if(function(a){return a.errors!=null}(s))return{values:{},errors:kne(Tne(s.errors,!o.shouldUseNativeValidation&&o.criteriaMode==="all"),o)};throw s}))}catch(s){return Promise.reject(s)}}};function Au(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o<r.length;o++)i=r[o],!(e.indexOf(i)>=0)&&(n[i]=t[i]);return n}var Ane=["color"],One=g.forwardRef(function(t,e){var n=t.color,r=n===void 0?"currentColor":n,i=Au(t,Ane);return g.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:e}),g.createElement("path",{d:"M4.93179 5.43179C4.75605 5.60753 4.75605 5.89245 4.93179 6.06819C5.10753 6.24392 5.39245 6.24392 5.56819 6.06819L7.49999 4.13638L9.43179 6.06819C9.60753 6.24392 9.89245 6.24392 10.0682 6.06819C10.2439 5.89245 10.2439 5.60753 10.0682 5.43179L7.81819 3.18179C7.73379 3.0974 7.61933 3.04999 7.49999 3.04999C7.38064 3.04999 7.26618 3.0974 7.18179 3.18179L4.93179 5.43179ZM10.0682 9.56819C10.2439 9.39245 10.2439 9.10753 10.0682 8.93179C9.89245 8.75606 9.60753 8.75606 9.43179 8.93179L7.49999 10.8636L5.56819 8.93179C5.39245 8.75606 5.10753 8.75606 4.93179 8.93179C4.75605 9.10753 4.75605 9.39245 4.93179 9.56819L7.18179 11.8182C7.35753 11.9939 7.64245 11.9939 7.81819 11.8182L10.0682 9.56819Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),Rne=["color"],u2=g.forwardRef(function(t,e){var n=t.color,r=n===void 0?"currentColor":n,i=Au(t,Rne);return g.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:e}),g.createElement("path",{d:"M11.4669 3.72684C11.7558 3.91574 11.8369 4.30308 11.648 4.59198L7.39799 11.092C7.29783 11.2452 7.13556 11.3467 6.95402 11.3699C6.77247 11.3931 6.58989 11.3355 6.45446 11.2124L3.70446 8.71241C3.44905 8.48022 3.43023 8.08494 3.66242 7.82953C3.89461 7.57412 4.28989 7.55529 4.5453 7.78749L6.75292 9.79441L10.6018 3.90792C10.7907 3.61902 11.178 3.53795 11.4669 3.72684Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),Pne=["color"],Nne=g.forwardRef(function(t,e){var n=t.color,r=n===void 0?"currentColor":n,i=Au(t,Pne);return g.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:e}),g.createElement("path",{d:"M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),Mne=["color"],Dne=g.forwardRef(function(t,e){var n=t.color,r=n===void 0?"currentColor":n,i=Au(t,Mne);return g.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:e}),g.createElement("path",{d:"M3.13523 8.84197C3.3241 9.04343 3.64052 9.05363 3.84197 8.86477L7.5 5.43536L11.158 8.86477C11.3595 9.05363 11.6759 9.04343 11.8648 8.84197C12.0536 8.64051 12.0434 8.32409 11.842 8.13523L7.84197 4.38523C7.64964 4.20492 7.35036 4.20492 7.15803 4.38523L3.15803 8.13523C2.95657 8.32409 2.94637 8.64051 3.13523 8.84197Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),Lne=["color"],d4=g.forwardRef(function(t,e){var n=t.color,r=n===void 0?"currentColor":n,i=Au(t,Lne);return g.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:e}),g.createElement("path",{d:"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),$ne=["color"],Ine=g.forwardRef(function(t,e){var n=t.color,r=n===void 0?"currentColor":n,i=Au(t,$ne);return g.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:e}),g.createElement("path",{d:"M10 6.5C10 8.433 8.433 10 6.5 10C4.567 10 3 8.433 3 6.5C3 4.567 4.567 3 6.5 3C8.433 3 10 4.567 10 6.5ZM9.30884 10.0159C8.53901 10.6318 7.56251 11 6.5 11C4.01472 11 2 8.98528 2 6.5C2 4.01472 4.01472 2 6.5 2C8.98528 2 11 4.01472 11 6.5C11 7.56251 10.6318 8.53901 10.0159 9.30884L12.8536 12.1464C13.0488 12.3417 13.0488 12.6583 12.8536 12.8536C12.6583 13.0488 12.3417 13.0488 12.1464 12.8536L9.30884 10.0159Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),jne=["color"],Bne=g.forwardRef(function(t,e){var n=t.color,r=n===void 0?"currentColor":n,i=Au(t,jne);return g.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:e}),g.createElement("path",{d:"M8 2.75C8 2.47386 7.77614 2.25 7.5 2.25C7.22386 2.25 7 2.47386 7 2.75V7H2.75C2.47386 7 2.25 7.22386 2.25 7.5C2.25 7.77614 2.47386 8 2.75 8H7V12.25C7 12.5261 7.22386 12.75 7.5 12.75C7.77614 12.75 8 12.5261 8 12.25V8H12.25C12.5261 8 12.75 7.77614 12.75 7.5C12.75 7.22386 12.5261 7 12.25 7H8V2.75Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),Sr=function(){return Sr=Object.assign||function(e){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},Sr.apply(this,arguments)};function f2(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n}function h4(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))}function Fne(){var t=g.useRef(!1),e=g.useCallback(function(){return t.current},[]);return g.useEffect(function(){return t.current=!0,function(){t.current=!1}},[]),e}function d2(t,e,n){e===void 0&&(e=[]),n===void 0&&(n={loading:!1});var r=g.useRef(0),i=Fne(),o=g.useState(n),s=o[0],a=o[1],l=g.useCallback(function(){for(var c=[],f=0;f<arguments.length;f++)c[f]=arguments[f];var d=++r.current;return s.loading||a(function(p){return Sr(Sr({},p),{loading:!0})}),t.apply(void 0,c).then(function(p){return i()&&d===r.current&&a({value:p,loading:!1}),p},function(p){return i()&&d===r.current&&a({error:p,loading:!1}),p})},e);return[s,l]}function zne(t,{insertAt:e}={}){if(!t||typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",e==="top"&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=t:r.appendChild(document.createTextNode(t))}zne(`html[dir=ltr],[data-sonner-toaster][dir=ltr]{--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}html[dir=rtl],[data-sonner-toaster][dir=rtl]{--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999}[data-sonner-toaster][data-x-position=right]{right:max(var(--offset),env(safe-area-inset-right))}[data-sonner-toaster][data-x-position=left]{left:max(var(--offset),env(safe-area-inset-left))}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translate(-50%)}[data-sonner-toaster][data-y-position=top]{top:max(var(--offset),env(safe-area-inset-top))}[data-sonner-toaster][data-y-position=bottom]{bottom:max(var(--offset),env(safe-area-inset-bottom))}[data-sonner-toast]{--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;will-change:transform,opacity,height;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}[data-sonner-toast][data-y-position=top]{top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}[data-sonner-toast] [data-description]{font-weight:400;line-height:1.4;color:inherit}[data-sonner-toast] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast] [data-icon]>*{flex-shrink:0}[data-sonner-toast] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast] [data-button]:focus-visible{box-shadow:0 0 0 2px #0006}[data-sonner-toast] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toast][data-theme=dark] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;background:var(--gray1);color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;opacity:0;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]:focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}[data-sonner-toast] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast]:hover [data-close-button]{opacity:1}[data-sonner-toast]:focus [data-close-button]{opacity:1}[data-sonner-toast]:focus-within [data-close-button]{opacity:1}[data-sonner-toast]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]:before{content:"";position:absolute;left:0;right:0;height:100%}[data-sonner-toast][data-y-position=top][data-swiping=true]:before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]:before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]:before{content:"";position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast]:after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y: translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y: translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]:before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount, 0px));transition:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation:swipe-out .2s ease-out forwards}@keyframes swipe-out{0%{transform:translateY(calc(var(--lift) * var(--offset) + var(--swipe-amount)));opacity:1}to{transform:translateY(calc(var(--lift) * var(--offset) + var(--swipe-amount) + var(--lift) * -100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;--mobile-offset: 16px;right:var(--mobile-offset);left:var(--mobile-offset);width:100%}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - 32px)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset)}[data-sonner-toaster][data-y-position=bottom]{bottom:20px}[data-sonner-toaster][data-y-position=top]{top:20px}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset);right:var(--mobile-offset);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-rich-colors=true] [data-sonner-toast][data-type=success],[data-rich-colors=true] [data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true] [data-sonner-toast][data-type=info],[data-rich-colors=true] [data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true] [data-sonner-toast][data-type=warning],[data-rich-colors=true] [data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true] [data-sonner-toast][data-type=error],[data-rich-colors=true] [data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}
77
+ `);Array(12).fill(0);ut.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ut.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"}));ut.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},ut.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"}));ut.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ut.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"}));ut.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ut.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"}));var GC=1,Vne=class{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{let e=this.subscribers.indexOf(t);this.subscribers.splice(e,1)}),this.publish=t=>{this.subscribers.forEach(e=>e(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var e;let{message:n,...r}=t,i=typeof(t==null?void 0:t.id)=="number"||((e=t.id)==null?void 0:e.length)>0?t.id:GC++,o=this.toasts.find(a=>a.id===i),s=t.dismissible===void 0?!0:t.dismissible;return o?this.toasts=this.toasts.map(a=>a.id===i?(this.publish({...a,...t,id:i,title:n}),{...a,...t,id:i,dismissible:s,title:n}):a):this.addToast({title:n,...r,dismissible:s,id:i}),i},this.dismiss=t=>(t||this.toasts.forEach(e=>{this.subscribers.forEach(n=>n({id:e.id,dismiss:!0}))}),this.subscribers.forEach(e=>e({id:t,dismiss:!0})),t),this.message=(t,e)=>this.create({...e,message:t}),this.error=(t,e)=>this.create({...e,message:t,type:"error"}),this.success=(t,e)=>this.create({...e,type:"success",message:t}),this.info=(t,e)=>this.create({...e,type:"info",message:t}),this.warning=(t,e)=>this.create({...e,type:"warning",message:t}),this.loading=(t,e)=>this.create({...e,type:"loading",message:t}),this.promise=(t,e)=>{if(!e)return;let n;e.loading!==void 0&&(n=this.create({...e,promise:t,type:"loading",message:e.loading}));let r=t instanceof Promise?t:t(),i=n!==void 0;return r.then(o=>{if(o&&typeof o.ok=="boolean"&&!o.ok){i=!1;let s=typeof e.error=="function"?e.error(`HTTP error! status: ${o.status}`):e.error;this.create({id:n,type:"error",message:s})}else if(e.success!==void 0){i=!1;let s=typeof e.success=="function"?e.success(o):e.success;this.create({id:n,type:"success",message:s})}}).catch(o=>{if(e.error!==void 0){i=!1;let s=typeof e.error=="function"?e.error(o):e.error;this.create({id:n,type:"error",message:s})}}).finally(()=>{var o;i&&(this.dismiss(n),n=void 0),(o=e.finally)==null||o.call(e)}),n},this.custom=(t,e)=>{let n=(e==null?void 0:e.id)||GC++;return this.create({jsx:t(n),id:n,...e}),n},this.subscribers=[],this.toasts=[]}},Ps=new Vne,Une=(t,e)=>{let n=(e==null?void 0:e.id)||GC++;return Ps.addToast({title:t,...e,id:n}),n},Wne=Une,cd=Object.assign(Wne,{success:Ps.success,info:Ps.info,warning:Ps.warning,error:Ps.error,custom:Ps.custom,message:Ps.message,promise:Ps.promise,dismiss:Ps.dismiss,loading:Ps.loading});le.object({thoughts:le.string(),result:le.boolean(),relevantElements:le.array(le.number()).optional()});class pN extends Error{constructor(e,n={}){super(e,n),this.name="StepValidationError"}}le.object({command:le.string(),thoughts:le.string()});le.string().pipe(le.coerce.number());le.object({phrase:le.string()});const Hne=new Set(Object.values(Le)),qne=t=>Hne.has(t),S0={[$e.AI_ACTION]:"AI action",[$e.MODULE]:"Module",[Le.AI_ASSERTION]:"AI check",[Le.CLICK]:"Click",[Le.HOVER]:"Hover",[Le.SELECT_OPTION]:"Select",[Le.TYPE]:"Type",[Le.PRESS]:"Press",[Le.NAVIGATE]:"Navigate",[Le.SCROLL_UP]:"Scroll up",[Le.SCROLL_DOWN]:"Scroll down",[Le.CAPTCHA]:"Captcha",[Le.GO_BACK]:"Go back",[Le.GO_FORWARD]:"Go forward",[Le.WAIT]:"Wait",[Le.REFRESH]:"Refresh",[Le.TAB]:"Switch tab",[Le.COOKIE]:"Set cookie",[Le.LOCAL_STORAGE]:"Set local storage",[Le.REQUEST]:"Request",[Le.SUCCESS]:"Done"},Kne={[$e.AI_ACTION]:"Ask AI to plan and execute something on the page.",[$e.MODULE]:"A list of steps that can be reused in multiple tests.",[Le.AI_ASSERTION]:"Ask AI whether something is true on the page.",[Le.CLICK]:"Click on an element on the page based on a description.",[Le.HOVER]:"Hover over an element on the page based on a description.",[Le.SELECT_OPTION]:"Select an option from a dropdown based on a description.",[Le.TYPE]:"Type the specified text into an element.",[Le.PRESS]:"Press the specified keys using the keyboard. (e.g. Ctrl+A)",[Le.NAVIGATE]:"Navigate to the specified URL.",[Le.SCROLL_UP]:"Scroll up one page.",[Le.SCROLL_DOWN]:"Scroll down one page.",[Le.GO_BACK]:"Go back in browser history.",[Le.GO_FORWARD]:"Go forward in browser history.",[Le.WAIT]:"Wait for the specified number of seconds.",[Le.REFRESH]:"Refresh the page. This will not clear cookies or session data.",[Le.TAB]:"Switch to different tab in the browser.",[Le.COOKIE]:"Set a cookie that will persist throughout the browser session",[Le.LOCAL_STORAGE]:"Set a local storage value that will persist throughout the browser session",[Le.CAPTCHA]:"Solve captchas on the page. This may take 10-60 seconds.",[Le.REQUEST]:"Make an API request to a URL.",[Le.SUCCESS]:"Indicate the entire AI action has succeeded, optionally based on a condition."};var Mn=(t=>(t.SUCCESS="SUCCESS",t.FAILED="FAILED",t.RUNNING="RUNNING",t.IDLE="IDLE",t.CANCELLED="CANCELLED",t))(Mn||{}),p4=(t=>(t.SUCCESS="SUCCESS",t.FAILED="FAILED",t.CANCELLED="CANCELLED",t))(p4||{});const Gne=ot({beforeUrl:We(),beforeScreenshot:We().or(qC()).optional(),afterUrl:We().optional(),afterScreenshot:We().or(qC()).optional(),startedAt:uu.date(),finishedAt:uu.date(),viewport:ot({height:Bo(),width:Bo()}),status:Od(p4),message:We().optional(),elementInteracted:We().optional()}),Wb=ot({startedAt:uu.date(),finishedAt:uu.date(),status:Od(Mn),message:We().optional(),data:cu(We(),I3()).optional(),userAgent:We().optional()}),h2=Vb.merge(Wb).merge(ot({results:Gne.array()})),m4=zb.merge(Wb).merge(ot({results:h2.array()})),Yne=z3.merge(Wb).merge(ot({results:_u([m4,h2]).array()})),g4=Tu("type",[m4,h2,Yne]);Wb.pick({startedAt:!0,finishedAt:!0,status:!0,message:!0,data:!0});const Xne=ot({type:Od($e),generatedStep:Pd.optional(),serializedCommand:We().optional(),elementInteracted:We().optional()}),fu=ot({goal:We(),url:We(),browserState:We(),history:We(),numPrevious:Bo(),lastCommand:Xne.or($3())});var Hb=(t=>(t.TEST="momentic/test",t.MODULE="momentic/module",t.FIXTURE="momentic/fixture",t))(Hb||{});const Zne="1.0.0",mN=le.object({run:le.string().describe("Run a single command in the shell. The working directory will be set to where the CLI was invoked from."),waitForCompletion:le.boolean().optional().describe("Defaults to true")});le.object({type:le.literal(Hb.FIXTURE),schemaVersion:le.string(),name:le.string(),description:le.string().optional(),setup:le.object({steps:mN.array(),timeout:le.number().optional().describe("Timeout for all steps in seconds")}).optional(),teardown:le.object({steps:mN.array(),timeout:le.number().optional().describe("Timeout for all steps in seconds")}).optional()});Hb.FIXTURE;le.string().array();ot({thoughts:We(),id:Bo().int(),options:G_(We()).optional()});var Us=(t=>(t[t.IDLE=0]="IDLE",t[t.LOCATING=1]="LOCATING",t[t.LOCATED=2]="LOCATED",t[t.FAILED=3]="FAILED",t))(Us||{});const Qne=le.object({id:le.string(),createdAt:le.coerce.date(),createdBy:le.string(),organizationId:le.string(),name:le.string(),schemaVersion:le.string(),numSteps:le.number()});le.object({steps:X_.array()}).merge(Qne.omit({numSteps:!0}));const v4={WEBHOOK:"WEBHOOK",CRON:"CRON",MANUAL:"MANUAL",CLI:"CLI"},y4={PENDING:"PENDING",RUNNING:"RUNNING",PASSED:"PASSED",FAILED:"FAILED",CANCELLED:"CANCELLED"},Jne={PASSED:"PASSED",FAILED:"FAILED"},iv=le.string().pipe(le.coerce.date()).or(le.date()),ere=le.object({id:le.string(),createdAt:iv,createdBy:le.string(),organizationId:le.string(),scheduledAt:iv.or(le.null()),startedAt:iv.or(le.null()),finishedAt:iv.or(le.null()),testId:le.string().or(le.null()),status:le.nativeEnum(y4),expectedStatus:le.nativeEnum(Jne).or(le.null()),runKey:le.string(),trigger:le.nativeEnum(v4),attempts:le.number(),test:le.object({name:le.string(),id:le.string()}).or(le.null())});ere.merge(le.object({results:g4.array(),test:le.object({name:le.string(),id:le.string(),baseUrl:le.string()}).or(le.null())}));const du=ot({disableCache:Gn()});ot({error:Gn(),reason:We(),message:We()});fu.merge(du);Tu("vision",[fu.merge(du).merge(ot({vision:Zt(!1)})),fu.pick({goal:!0,url:!0}).merge(du).merge(ot({screenshot:We(),vision:Zt(!0)}))]);fu.pick({browserState:!0,goal:!0}).merge(du);fu.pick({goal:!0}).merge(du).merge(ot({screenshot:We().describe("base64 encoded image"),hintActivatedScreenshot:We().describe("base64 encoded image")}));fu.pick({goal:!0,url:!0}).merge(du);We().array();fu.pick({goal:!0,browserState:!0}).merge(du);ot({testPaths:We().array().describe("can be either hyphenated, lowercase test names or UUIDs"),all:Gn().optional()});ot({message:We(),queuedTests:ot({name:We(),id:We()}).array()});We().array();_u([ot({paths:We().array().describe("run specific test paths (e.g. todo-test)")}),ot({path:We().describe("deprecated; present for backcompat")}),ot({all:Gn().describe("run all tests")})]);ot({tests:cu(We().describe("Test name"),We().describe("Test YAML")),modules:cu(We().describe("Module name"),We().describe("Module YAML"))});const tre=ot({test:We().describe("test YAML"),modules:cu(We().describe("moduleId"),We().describe("module YAML"))});tre.array();ot({testPath:We(),testId:We()}).partial().merge(ot({trigger:Od(v4)}));ot({startedAt:uu.date(),finishedAt:uu.date(),results:g4.array(),status:Od(y4)}).partial();ot({screenshot:We()});ot({key:We()});ot({orgId:We()});const p2=Symbol.for("yaml.alias"),nre=Symbol.for("yaml.document"),Yc=Symbol.for("yaml.map"),b4=Symbol.for("yaml.pair"),m2=Symbol.for("yaml.scalar"),Lm=Symbol.for("yaml.seq"),ra=Symbol.for("yaml.node.type"),Md=t=>!!t&&typeof t=="object"&&t[ra]===p2,qb=t=>!!t&&typeof t=="object"&&t[ra]===nre,w4=t=>!!t&&typeof t=="object"&&t[ra]===Yc,Br=t=>!!t&&typeof t=="object"&&t[ra]===b4,yr=t=>!!t&&typeof t=="object"&&t[ra]===m2,g2=t=>!!t&&typeof t=="object"&&t[ra]===Lm;function Zi(t){if(t&&typeof t=="object")switch(t[ra]){case Yc:case Lm:return!0}return!1}function Oi(t){if(t&&typeof t=="object")switch(t[ra]){case p2:case Yc:case m2:case Lm:return!0}return!1}const rre=t=>(yr(t)||Zi(t))&&!!t.anchor,kc=Symbol("break visit"),ire=Symbol("skip children"),ap=Symbol("remove node");function Jp(t,e){const n=ore(e);qb(t)?Tf(null,t.contents,n,Object.freeze([t]))===ap&&(t.contents=null):Tf(null,t,n,Object.freeze([]))}Jp.BREAK=kc;Jp.SKIP=ire;Jp.REMOVE=ap;function Tf(t,e,n,r){const i=sre(t,e,n,r);if(Oi(i)||Br(i))return are(t,r,i),Tf(t,i,n,r);if(typeof i!="symbol"){if(Zi(e)){r=Object.freeze(r.concat(e));for(let o=0;o<e.items.length;++o){const s=Tf(o,e.items[o],n,r);if(typeof s=="number")o=s-1;else{if(s===kc)return kc;s===ap&&(e.items.splice(o,1),o-=1)}}}else if(Br(e)){r=Object.freeze(r.concat(e));const o=Tf("key",e.key,n,r);if(o===kc)return kc;o===ap&&(e.key=null);const s=Tf("value",e.value,n,r);if(s===kc)return kc;s===ap&&(e.value=null)}}return i}function ore(t){return typeof t=="object"&&(t.Collection||t.Node||t.Value)?Object.assign({Alias:t.Node,Map:t.Node,Scalar:t.Node,Seq:t.Node},t.Value&&{Map:t.Value,Scalar:t.Value,Seq:t.Value},t.Collection&&{Map:t.Collection,Seq:t.Collection},t):t}function sre(t,e,n,r){var i,o,s,a,l;if(typeof n=="function")return n(t,e,r);if(w4(e))return(i=n.Map)==null?void 0:i.call(n,t,e,r);if(g2(e))return(o=n.Seq)==null?void 0:o.call(n,t,e,r);if(Br(e))return(s=n.Pair)==null?void 0:s.call(n,t,e,r);if(yr(e))return(a=n.Scalar)==null?void 0:a.call(n,t,e,r);if(Md(e))return(l=n.Alias)==null?void 0:l.call(n,t,e,r)}function are(t,e,n){const r=e[e.length-1];if(Zi(r))r.items[t]=n;else if(Br(r))t==="key"?r.key=n:r.value=n;else if(qb(r))r.contents=n;else{const i=Md(r)?"alias":"scalar";throw new Error(`Cannot replace node with ${i} parent`)}}function x4(t){if(/[\x00-\x19\s,[\]{}]/.test(t)){const n=`Anchor must not contain whitespace or control characters: ${JSON.stringify(t)}`;throw new Error(n)}return!0}function zh(t,e,n,r){if(r&&typeof r=="object")if(Array.isArray(r))for(let i=0,o=r.length;i<o;++i){const s=r[i],a=zh(t,r,String(i),s);a===void 0?delete r[i]:a!==s&&(r[i]=a)}else if(r instanceof Map)for(const i of Array.from(r.keys())){const o=r.get(i),s=zh(t,r,i,o);s===void 0?r.delete(i):s!==o&&r.set(i,s)}else if(r instanceof Set)for(const i of Array.from(r)){const o=zh(t,r,i,i);o===void 0?r.delete(i):o!==i&&(r.delete(i),r.add(o))}else for(const[i,o]of Object.entries(r)){const s=zh(t,r,i,o);s===void 0?delete r[i]:s!==o&&(r[i]=s)}return t.call(e,n,r)}function ms(t,e,n){if(Array.isArray(t))return t.map((r,i)=>ms(r,String(i),n));if(t&&typeof t.toJSON=="function"){if(!n||!rre(t))return t.toJSON(e,n);const r={aliasCount:0,count:1,res:void 0};n.anchors.set(t,r),n.onCreate=o=>{r.res=o,delete n.onCreate};const i=t.toJSON(e,n);return n.onCreate&&n.onCreate(i),i}return typeof t=="bigint"&&!(n!=null&&n.keep)?Number(t):t}class v2{constructor(e){Object.defineProperty(this,ra,{value:e})}clone(){const e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:n,maxAliasCount:r,onAnchor:i,reviver:o}={}){if(!qb(e))throw new TypeError("A document argument is required");const s={anchors:new Map,doc:e,keep:!0,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},a=ms(this,"",s);if(typeof i=="function")for(const{count:l,res:c}of s.anchors.values())i(c,l);return typeof o=="function"?zh(o,{"":a},"",a):a}}class lre extends v2{constructor(e){super(p2),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e){let n;return Jp(e,{Node:(r,i)=>{if(i===this)return Jp.BREAK;i.anchor===this.source&&(n=i)}}),n}toJSON(e,n){if(!n)return{source:this.source};const{anchors:r,doc:i,maxAliasCount:o}=n,s=this.resolve(i);if(!s){const l=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(l)}let a=r.get(s);if(a||(ms(s,null,n),a=r.get(s)),!a||a.res===void 0){const l="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(l)}if(o>=0&&(a.count+=1,a.aliasCount===0&&(a.aliasCount=ly(i,s,r)),a.count*a.aliasCount>o)){const l="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(l)}return a.res}toString(e,n,r){const i=`*${this.source}`;if(e){if(x4(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){const o=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(o)}if(e.implicitKey)return`${i} `}return i}}function ly(t,e,n){if(Md(e)){const r=e.resolve(t),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}else if(Zi(e)){let r=0;for(const i of e.items){const o=ly(t,i,n);o>r&&(r=o)}return r}else if(Br(e)){const r=ly(t,e.key,n),i=ly(t,e.value,n);return Math.max(r,i)}return 1}const S4=t=>!t||typeof t!="function"&&typeof t!="object";class ir extends v2{constructor(e){super(m2),this.value=e}toJSON(e,n){return n!=null&&n.keep?this.value:ms(this.value,e,n)}toString(){return String(this.value)}}ir.BLOCK_FOLDED="BLOCK_FOLDED";ir.BLOCK_LITERAL="BLOCK_LITERAL";ir.PLAIN="PLAIN";ir.QUOTE_DOUBLE="QUOTE_DOUBLE";ir.QUOTE_SINGLE="QUOTE_SINGLE";const cre="tag:yaml.org,2002:";function ure(t,e,n){if(e){const r=n.filter(o=>o.tag===e),i=r.find(o=>!o.format)??r[0];if(!i)throw new Error(`Tag ${e} not found`);return i}return n.find(r=>{var i;return((i=r.identify)==null?void 0:i.call(r,t))&&!r.format})}function C0(t,e,n){var d,p,m;if(qb(t)&&(t=t.contents),Oi(t))return t;if(Br(t)){const v=(p=(d=n.schema[Yc]).createNode)==null?void 0:p.call(d,n.schema,null,n);return v.items.push(t),v}(t instanceof String||t instanceof Number||t instanceof Boolean||typeof BigInt<"u"&&t instanceof BigInt)&&(t=t.valueOf());const{aliasDuplicateObjects:r,onAnchor:i,onTagObj:o,schema:s,sourceObjects:a}=n;let l;if(r&&t&&typeof t=="object"){if(l=a.get(t),l)return l.anchor||(l.anchor=i(t)),new lre(l.anchor);l={anchor:null,node:null},a.set(t,l)}e!=null&&e.startsWith("!!")&&(e=cre+e.slice(2));let c=ure(t,e,s.tags);if(!c){if(t&&typeof t.toJSON=="function"&&(t=t.toJSON()),!t||typeof t!="object"){const v=new ir(t);return l&&(l.node=v),v}c=t instanceof Map?s[Yc]:Symbol.iterator in Object(t)?s[Lm]:s[Yc]}o&&(o(c),delete n.onTagObj);const f=c!=null&&c.createNode?c.createNode(n.schema,t,n):typeof((m=c==null?void 0:c.nodeClass)==null?void 0:m.from)=="function"?c.nodeClass.from(n.schema,t,n):new ir(t);return e?f.tag=e:c.default||(f.tag=c.tag),l&&(l.node=f),f}function gN(t,e,n){let r=n;for(let i=e.length-1;i>=0;--i){const o=e[i];if(typeof o=="number"&&Number.isInteger(o)&&o>=0){const s=[];s[o]=r,r=s}else r=new Map([[o,r]])}return C0(r,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:t,sourceObjects:new Map})}const fre=t=>t==null||typeof t=="object"&&!!t[Symbol.iterator]().next().done;class Kb extends v2{constructor(e,n){super(e),Object.defineProperty(this,"schema",{value:n,configurable:!0,enumerable:!1,writable:!0})}clone(e){const n=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(n.schema=e),n.items=n.items.map(r=>Oi(r)||Br(r)?r.clone(e):r),this.range&&(n.range=this.range.slice()),n}addIn(e,n){if(fre(e))this.add(n);else{const[r,...i]=e,o=this.get(r,!0);if(Zi(o))o.addIn(i,n);else if(o===void 0&&this.schema)this.set(r,gN(this.schema,i,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${i}`)}}deleteIn(e){const[n,...r]=e;if(r.length===0)return this.delete(n);const i=this.get(n,!0);if(Zi(i))return i.deleteIn(r);throw new Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}getIn(e,n){const[r,...i]=e,o=this.get(r,!0);return i.length===0?!n&&yr(o)?o.value:o:Zi(o)?o.getIn(i,n):void 0}hasAllNullValues(e){return this.items.every(n=>{if(!Br(n))return!1;const r=n.value;return r==null||e&&yr(r)&&r.value==null&&!r.commentBefore&&!r.comment&&!r.tag})}hasIn(e){const[n,...r]=e;if(r.length===0)return this.has(n);const i=this.get(n,!0);return Zi(i)?i.hasIn(r):!1}setIn(e,n){const[r,...i]=e;if(i.length===0)this.set(r,n);else{const o=this.get(r,!0);if(Zi(o))o.setIn(i,n);else if(o===void 0&&this.schema)this.set(r,gN(this.schema,i,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${i}`)}}}Kb.maxFlowStringSingleLineLength=60;const dre=t=>t.replace(/^(?!$)(?: $)?/gm,"#");function em(t,e){return/^\n+$/.test(t)?t.substring(1):e?t.replace(/^(?! *$)/gm,e):t}const zc=(t,e,n)=>t.endsWith(`
78
+ `)?em(n,e):n.includes(`
79
+ `)?`
80
+ `+em(n,e):(t.endsWith(" ")?"":" ")+n,C4="flow",YC="block",cy="quoted";function Gb(t,e,n="flow",{indentAtStart:r,lineWidth:i=80,minContentWidth:o=20,onFold:s,onOverflow:a}={}){if(!i||i<0)return t;const l=Math.max(1+o,1+i-e.length);if(t.length<=l)return t;const c=[],f={};let d=i-e.length;typeof r=="number"&&(r>i-Math.max(2,o)?c.push(0):d=i-r);let p,m,v=!1,b=-1,S=-1,x=-1;n===YC&&(b=vN(t,b),b!==-1&&(d=b+l));for(let C;C=t[b+=1];){if(n===cy&&C==="\\"){switch(S=b,t[b+1]){case"x":b+=3;break;case"u":b+=5;break;case"U":b+=9;break;default:b+=1}x=b}if(C===`
81
+ `)n===YC&&(b=vN(t,b)),d=b+l,p=void 0;else{if(C===" "&&m&&m!==" "&&m!==`
82
+ `&&m!==" "){const T=t[b+1];T&&T!==" "&&T!==`
83
+ `&&T!==" "&&(p=b)}if(b>=d)if(p)c.push(p),d=p+l,p=void 0;else if(n===cy){for(;m===" "||m===" ";)m=C,C=t[b+=1],v=!0;const T=b>x+1?b-2:S-1;if(f[T])return t;c.push(T),f[T]=!0,d=T+l,p=void 0}else v=!0}m=C}if(v&&a&&a(),c.length===0)return t;s&&s();let w=t.slice(0,c[0]);for(let C=0;C<c.length;++C){const T=c[C],A=c[C+1]||t.length;T===0?w=`
84
+ ${e}${t.slice(0,A)}`:(n===cy&&f[T]&&(w+=`${t[T]}\\`),w+=`
85
+ ${e}${t.slice(T+1,A)}`)}return w}function vN(t,e){let n=t[e+1];for(;n===" "||n===" ";){do n=t[e+=1];while(n&&n!==`
86
+ `);n=t[e+1]}return e}const Yb=(t,e)=>({indentAtStart:e?t.indent.length:t.indentAtStart,lineWidth:t.options.lineWidth,minContentWidth:t.options.minContentWidth}),Xb=t=>/^(%|---|\.\.\.)/m.test(t);function hre(t,e,n){if(!e||e<0)return!1;const r=e-n,i=t.length;if(i<=r)return!1;for(let o=0,s=0;o<i;++o)if(t[o]===`
87
+ `){if(o-s>r)return!0;if(s=o+1,i-s<=r)return!1}return!0}function lp(t,e){const n=JSON.stringify(t);if(e.options.doubleQuotedAsJSON)return n;const{implicitKey:r}=e,i=e.options.doubleQuotedMinMultiLineLength,o=e.indent||(Xb(t)?" ":"");let s="",a=0;for(let l=0,c=n[l];c;c=n[++l])if(c===" "&&n[l+1]==="\\"&&n[l+2]==="n"&&(s+=n.slice(a,l)+"\\ ",l+=1,a=l,c="\\"),c==="\\")switch(n[l+1]){case"u":{s+=n.slice(a,l);const f=n.substr(l+2,4);switch(f){case"0000":s+="\\0";break;case"0007":s+="\\a";break;case"000b":s+="\\v";break;case"001b":s+="\\e";break;case"0085":s+="\\N";break;case"00a0":s+="\\_";break;case"2028":s+="\\L";break;case"2029":s+="\\P";break;default:f.substr(0,2)==="00"?s+="\\x"+f.substr(2):s+=n.substr(l,6)}l+=5,a=l+1}break;case"n":if(r||n[l+2]==='"'||n.length<i)l+=1;else{for(s+=n.slice(a,l)+`
88
+
89
+ `;n[l+2]==="\\"&&n[l+3]==="n"&&n[l+4]!=='"';)s+=`
90
+ `,l+=2;s+=o,n[l+2]===" "&&(s+="\\"),l+=1,a=l+1}break;default:l+=1}return s=a?s+n.slice(a):n,r?s:Gb(s,o,cy,Yb(e,!1))}function XC(t,e){if(e.options.singleQuote===!1||e.implicitKey&&t.includes(`
91
+ `)||/[ \t]\n|\n[ \t]/.test(t))return lp(t,e);const n=e.indent||(Xb(t)?" ":""),r="'"+t.replace(/'/g,"''").replace(/\n+/g,`$&
92
+ ${n}`)+"'";return e.implicitKey?r:Gb(r,n,C4,Yb(e,!1))}function Af(t,e){const{singleQuote:n}=e.options;let r;if(n===!1)r=lp;else{const i=t.includes('"'),o=t.includes("'");i&&!o?r=XC:o&&!i?r=lp:r=n?XC:lp}return r(t,e)}let ZC;try{ZC=new RegExp(`(^|(?<!
93
+ ))
94
+ +(?!
95
+ |$)`,"g")}catch{ZC=/\n+(?!\n|$)/g}function uy({comment:t,type:e,value:n},r,i,o){const{blockQuote:s,commentString:a,lineWidth:l}=r.options;if(!s||/\n[\t ]+$/.test(n)||/^\s*$/.test(n))return Af(n,r);const c=r.indent||(r.forceBlockIndent||Xb(n)?" ":""),f=s==="literal"?!0:s==="folded"||e===ir.BLOCK_FOLDED?!1:e===ir.BLOCK_LITERAL?!0:!hre(n,l,c.length);if(!n)return f?`|
96
+ `:`>
97
+ `;let d,p;for(p=n.length;p>0;--p){const _=n[p-1];if(_!==`
98
+ `&&_!==" "&&_!==" ")break}let m=n.substring(p);const v=m.indexOf(`
99
+ `);v===-1?d="-":n===m||v!==m.length-1?(d="+",o&&o()):d="",m&&(n=n.slice(0,-m.length),m[m.length-1]===`
100
+ `&&(m=m.slice(0,-1)),m=m.replace(ZC,`$&${c}`));let b=!1,S,x=-1;for(S=0;S<n.length;++S){const _=n[S];if(_===" ")b=!0;else if(_===`
101
+ `)x=S;else break}let w=n.substring(0,x<S?x+1:S);w&&(n=n.substring(w.length),w=w.replace(/\n+/g,`$&${c}`));let T=(f?"|":">")+(b?c?"2":"1":"")+d;if(t&&(T+=" "+a(t.replace(/ ?[\r\n]+/g," ")),i&&i()),f)return n=n.replace(/\n+/g,`$&${c}`),`${T}
102
+ ${c}${w}${n}${m}`;n=n.replace(/\n+/g,`
103
+ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${c}`);const A=Gb(`${w}${n}${m}`,c,YC,Yb(r,!0));return`${T}
104
+ ${c}${A}`}function pre(t,e,n,r){const{type:i,value:o}=t,{actualString:s,implicitKey:a,indent:l,indentStep:c,inFlow:f}=e;if(a&&o.includes(`
105
+ `)||f&&/[[\]{},]/.test(o))return Af(o,e);if(!o||/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(o))return a||f||!o.includes(`
106
+ `)?Af(o,e):uy(t,e,n,r);if(!a&&!f&&i!==ir.PLAIN&&o.includes(`
107
+ `))return uy(t,e,n,r);if(Xb(o)){if(l==="")return e.forceBlockIndent=!0,uy(t,e,n,r);if(a&&l===c)return Af(o,e)}const d=o.replace(/\n+/g,`$&
108
+ ${l}`);if(s){const p=b=>{var S;return b.default&&b.tag!=="tag:yaml.org,2002:str"&&((S=b.test)==null?void 0:S.test(d))},{compat:m,tags:v}=e.doc.schema;if(v.some(p)||m!=null&&m.some(p))return Af(o,e)}return a?d:Gb(d,l,C4,Yb(e,!1))}function mre(t,e,n,r){const{implicitKey:i,inFlow:o}=e,s=typeof t.value=="string"?t:Object.assign({},t,{value:String(t.value)});let{type:a}=t;a!==ir.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(s.value)&&(a=ir.QUOTE_DOUBLE);const l=f=>{switch(f){case ir.BLOCK_FOLDED:case ir.BLOCK_LITERAL:return i||o?Af(s.value,e):uy(s,e,n,r);case ir.QUOTE_DOUBLE:return lp(s.value,e);case ir.QUOTE_SINGLE:return XC(s.value,e);case ir.PLAIN:return pre(s,e,n,r);default:return null}};let c=l(a);if(c===null){const{defaultKeyType:f,defaultStringType:d}=e.options,p=i&&f||d;if(c=l(p),c===null)throw new Error(`Unsupported default string type ${p}`)}return c}function gre(t,e){const n=Object.assign({blockQuote:!0,commentString:dre,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trueStr:"true",verifyAliasOrder:!0},t.schema.toStringOptions,e);let r;switch(n.collectionStyle){case"block":r=!1;break;case"flow":r=!0;break;default:r=null}return{anchors:new Set,doc:t,flowCollectionPadding:n.flowCollectionPadding?" ":"",indent:"",indentStep:typeof n.indent=="number"?" ".repeat(n.indent):" ",inFlow:r,options:n}}function vre(t,e){var i;if(e.tag){const o=t.filter(s=>s.tag===e.tag);if(o.length>0)return o.find(s=>s.format===e.format)??o[0]}let n,r;if(yr(e)){r=e.value;const o=t.filter(s=>{var a;return(a=s.identify)==null?void 0:a.call(s,r)});n=o.find(s=>s.format===e.format)??o.find(s=>!s.format)}else r=e,n=t.find(o=>o.nodeClass&&r instanceof o.nodeClass);if(!n){const o=((i=r==null?void 0:r.constructor)==null?void 0:i.name)??typeof r;throw new Error(`Tag not resolved for ${o} value`)}return n}function yre(t,e,{anchors:n,doc:r}){if(!r.directives)return"";const i=[],o=(yr(t)||Zi(t))&&t.anchor;o&&x4(o)&&(n.add(o),i.push(`&${o}`));const s=t.tag?t.tag:e.default?null:e.tag;return s&&i.push(r.directives.tagString(s)),i.join(" ")}function k0(t,e,n,r){var l;if(Br(t))return t.toString(e,n,r);if(Md(t)){if(e.doc.directives)return t.toString(e);if((l=e.resolvedAliases)!=null&&l.has(t))throw new TypeError("Cannot stringify circular structure without alias nodes");e.resolvedAliases?e.resolvedAliases.add(t):e.resolvedAliases=new Set([t]),t=t.resolve(e.doc)}let i;const o=Oi(t)?t:e.doc.createNode(t,{onTagObj:c=>i=c});i||(i=vre(e.doc.schema.tags,o));const s=yre(o,i,e);s.length>0&&(e.indentAtStart=(e.indentAtStart??0)+s.length+1);const a=typeof i.stringify=="function"?i.stringify(o,e,n,r):yr(o)?mre(o,e,n,r):o.toString(e,n,r);return s?yr(o)||a[0]==="{"||a[0]==="["?`${s} ${a}`:`${s}
109
+ ${e.indent}${a}`:a}function bre({key:t,value:e},n,r,i){const{allNullValues:o,doc:s,indent:a,indentStep:l,options:{commentString:c,indentSeq:f,simpleKeys:d}}=n;let p=Oi(t)&&t.comment||null;if(d){if(p)throw new Error("With simple keys, key nodes cannot have comments");if(Zi(t)){const R="With simple keys, collection cannot be used as a key value";throw new Error(R)}}let m=!d&&(!t||p&&e==null&&!n.inFlow||Zi(t)||(yr(t)?t.type===ir.BLOCK_FOLDED||t.type===ir.BLOCK_LITERAL:typeof t=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!m&&(d||!o),indent:a+l});let v=!1,b=!1,S=k0(t,n,()=>v=!0,()=>b=!0);if(!m&&!n.inFlow&&S.length>1024){if(d)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");m=!0}if(n.inFlow){if(o||e==null)return v&&r&&r(),S===""?"?":m?`? ${S}`:S}else if(o&&!d||e==null&&m)return S=`? ${S}`,p&&!v?S+=zc(S,n.indent,c(p)):b&&i&&i(),S;v&&(p=null),m?(p&&(S+=zc(S,n.indent,c(p))),S=`? ${S}
110
+ ${a}:`):(S=`${S}:`,p&&(S+=zc(S,n.indent,c(p))));let x,w,C;Oi(e)?(x=!!e.spaceBefore,w=e.commentBefore,C=e.comment):(x=!1,w=null,C=null,e&&typeof e=="object"&&(e=s.createNode(e))),n.implicitKey=!1,!m&&!p&&yr(e)&&(n.indentAtStart=S.length+1),b=!1,!f&&l.length>=2&&!n.inFlow&&!m&&g2(e)&&!e.flow&&!e.tag&&!e.anchor&&(n.indent=n.indent.substring(2));let T=!1;const A=k0(e,n,()=>T=!0,()=>b=!0);let _=" ";if(p||x||w){if(_=x?`
111
+ `:"",w){const R=c(w);_+=`
112
+ ${em(R,n.indent)}`}A===""&&!n.inFlow?_===`
113
+ `&&(_=`
114
+
115
+ `):_+=`
116
+ ${n.indent}`}else if(!m&&Zi(e)){const R=A[0],M=A.indexOf(`
117
+ `),I=M!==-1,V=n.inFlow??e.flow??e.items.length===0;if(I||!V){let U=!1;if(I&&(R==="&"||R==="!")){let L=A.indexOf(" ");R==="&"&&L!==-1&&L<M&&A[L+1]==="!"&&(L=A.indexOf(" ",L+1)),(L===-1||M<L)&&(U=!0)}U||(_=`
118
+ ${n.indent}`)}}else(A===""||A[0]===`
119
+ `)&&(_="");return S+=_+A,n.inFlow?T&&r&&r():C&&!T?S+=zc(S,n.indent,c(C)):b&&i&&i(),S}function wre(t,e){(t==="debug"||t==="warn")&&(typeof process<"u"&&process.emitWarning?process.emitWarning(e):console.warn(e))}const yN="<<";function k4(t,e,{key:n,value:r}){if(t!=null&&t.doc.schema.merge&&xre(n))if(r=Md(r)?r.resolve(t.doc):r,g2(r))for(const i of r.items)Rx(t,e,i);else if(Array.isArray(r))for(const i of r)Rx(t,e,i);else Rx(t,e,r);else{const i=ms(n,"",t);if(e instanceof Map)e.set(i,ms(r,i,t));else if(e instanceof Set)e.add(i);else{const o=Sre(n,i,t),s=ms(r,o,t);o in e?Object.defineProperty(e,o,{value:s,writable:!0,enumerable:!0,configurable:!0}):e[o]=s}}return e}const xre=t=>t===yN||yr(t)&&t.value===yN&&(!t.type||t.type===ir.PLAIN);function Rx(t,e,n){const r=t&&Md(n)?n.resolve(t.doc):n;if(!w4(r))throw new Error("Merge sources must be maps or map aliases");const i=r.toJSON(null,t,Map);for(const[o,s]of i)e instanceof Map?e.has(o)||e.set(o,s):e instanceof Set?e.add(o):Object.prototype.hasOwnProperty.call(e,o)||Object.defineProperty(e,o,{value:s,writable:!0,enumerable:!0,configurable:!0});return e}function Sre(t,e,n){if(e===null)return"";if(typeof e!="object")return String(e);if(Oi(t)&&(n!=null&&n.doc)){const r=gre(n.doc,{});r.anchors=new Set;for(const o of n.anchors.keys())r.anchors.add(o.anchor);r.inFlow=!0,r.inStringifyKey=!0;const i=t.toString(r);if(!n.mapKeyWarned){let o=JSON.stringify(i);o.length>40&&(o=o.substring(0,36)+'..."'),wre(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${o}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return i}return JSON.stringify(e)}function y2(t,e,n){const r=C0(t,void 0,n),i=C0(e,void 0,n);return new Pa(r,i)}class Pa{constructor(e,n=null){Object.defineProperty(this,ra,{value:b4}),this.key=e,this.value=n}clone(e){let{key:n,value:r}=this;return Oi(n)&&(n=n.clone(e)),Oi(r)&&(r=r.clone(e)),new Pa(n,r)}toJSON(e,n){const r=n!=null&&n.mapAsMap?new Map:{};return k4(n,r,this)}toString(e,n,r){return e!=null&&e.doc?bre(this,e,n,r):JSON.stringify(this)}}function E4(t,e,n){return(e.inFlow??t.flow?kre:Cre)(t,e,n)}function Cre({comment:t,items:e},n,{blockItemPrefix:r,flowChars:i,itemIndent:o,onChompKeep:s,onComment:a}){const{indent:l,options:{commentString:c}}=n,f=Object.assign({},n,{indent:o,type:null});let d=!1;const p=[];for(let v=0;v<e.length;++v){const b=e[v];let S=null;if(Oi(b))!d&&b.spaceBefore&&p.push(""),E0(n,p,b.commentBefore,d),b.comment&&(S=b.comment);else if(Br(b)){const w=Oi(b.key)?b.key:null;w&&(!d&&w.spaceBefore&&p.push(""),E0(n,p,w.commentBefore,d))}d=!1;let x=k0(b,f,()=>S=null,()=>d=!0);S&&(x+=zc(x,o,c(S))),d&&S&&(d=!1),p.push(r+x)}let m;if(p.length===0)m=i.start+i.end;else{m=p[0];for(let v=1;v<p.length;++v){const b=p[v];m+=b?`
120
+ ${l}${b}`:`
121
+ `}}return t?(m+=`
122
+ `+em(c(t),l),a&&a()):d&&s&&s(),m}function kre({comment:t,items:e},n,{flowChars:r,itemIndent:i,onComment:o}){const{indent:s,indentStep:a,flowCollectionPadding:l,options:{commentString:c}}=n;i+=a;const f=Object.assign({},n,{indent:i,inFlow:!0,type:null});let d=!1,p=0;const m=[];for(let x=0;x<e.length;++x){const w=e[x];let C=null;if(Oi(w))w.spaceBefore&&m.push(""),E0(n,m,w.commentBefore,!1),w.comment&&(C=w.comment);else if(Br(w)){const A=Oi(w.key)?w.key:null;A&&(A.spaceBefore&&m.push(""),E0(n,m,A.commentBefore,!1),A.comment&&(d=!0));const _=Oi(w.value)?w.value:null;_?(_.comment&&(C=_.comment),_.commentBefore&&(d=!0)):w.value==null&&(A!=null&&A.comment)&&(C=A.comment)}C&&(d=!0);let T=k0(w,f,()=>C=null);x<e.length-1&&(T+=","),C&&(T+=zc(T,i,c(C))),!d&&(m.length>p||T.includes(`
123
+ `))&&(d=!0),m.push(T),p=m.length}let v;const{start:b,end:S}=r;if(m.length===0)v=b+S;else if(d||(d=m.reduce((w,C)=>w+C.length+2,2)>Kb.maxFlowStringSingleLineLength),d){v=b;for(const x of m)v+=x?`
124
+ ${a}${s}${x}`:`
125
+ `;v+=`
126
+ ${s}${S}`}else v=`${b}${l}${m.join(" ")}${l}${S}`;return t&&(v+=zc(v,s,c(t)),o&&o()),v}function E0({indent:t,options:{commentString:e}},n,r,i){if(r&&i&&(r=r.replace(/^\n+/,"")),r){const o=em(e(r),t);n.push(o.trimStart())}}function Vc(t,e){const n=yr(e)?e.value:e;for(const r of t)if(Br(r)&&(r.key===e||r.key===n||yr(r.key)&&r.key.value===n))return r}class sf extends Kb{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(Yc,e),this.items=[]}static from(e,n,r){const{keepUndefined:i,replacer:o}=r,s=new this(e),a=(l,c)=>{if(typeof o=="function")c=o.call(n,l,c);else if(Array.isArray(o)&&!o.includes(l))return;(c!==void 0||i)&&s.items.push(y2(l,c,r))};if(n instanceof Map)for(const[l,c]of n)a(l,c);else if(n&&typeof n=="object")for(const l of Object.keys(n))a(l,n[l]);return typeof e.sortMapEntries=="function"&&s.items.sort(e.sortMapEntries),s}add(e,n){var s;let r;Br(e)?r=e:!e||typeof e!="object"||!("key"in e)?r=new Pa(e,e==null?void 0:e.value):r=new Pa(e.key,e.value);const i=Vc(this.items,r.key),o=(s=this.schema)==null?void 0:s.sortMapEntries;if(i){if(!n)throw new Error(`Key ${r.key} already set`);yr(i.value)&&S4(r.value)?i.value.value=r.value:i.value=r.value}else if(o){const a=this.items.findIndex(l=>o(r,l)<0);a===-1?this.items.push(r):this.items.splice(a,0,r)}else this.items.push(r)}delete(e){const n=Vc(this.items,e);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(e,n){const r=Vc(this.items,e),i=r==null?void 0:r.value;return(!n&&yr(i)?i.value:i)??void 0}has(e){return!!Vc(this.items,e)}set(e,n){this.add(new Pa(e,n),!0)}toJSON(e,n,r){const i=r?new r:n!=null&&n.mapAsMap?new Map:{};n!=null&&n.onCreate&&n.onCreate(i);for(const o of this.items)k4(n,i,o);return i}toString(e,n,r){if(!e)return JSON.stringify(this);for(const i of this.items)if(!Br(i))throw new Error(`Map items must all be pairs; found ${JSON.stringify(i)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),E4(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:r,onComment:n})}}class _4 extends Kb{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(Lm,e),this.items=[]}add(e){this.items.push(e)}delete(e){const n=ov(e);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(e,n){const r=ov(e);if(typeof r!="number")return;const i=this.items[r];return!n&&yr(i)?i.value:i}has(e){const n=ov(e);return typeof n=="number"&&n<this.items.length}set(e,n){const r=ov(e);if(typeof r!="number")throw new Error(`Expected a valid index, not ${e}.`);const i=this.items[r];yr(i)&&S4(n)?i.value=n:this.items[r]=n}toJSON(e,n){const r=[];n!=null&&n.onCreate&&n.onCreate(r);let i=0;for(const o of this.items)r.push(ms(o,String(i++),n));return r}toString(e,n,r){return e?E4(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:r,onComment:n}):JSON.stringify(this)}static from(e,n,r){const{replacer:i}=r,o=new this(e);if(n&&Symbol.iterator in Object(n)){let s=0;for(let a of n){if(typeof i=="function"){const l=n instanceof Set?a:String(s++);a=i.call(n,l,a)}o.items.push(C0(a,void 0,r))}}return o}}function ov(t){let e=yr(t)?t.value:t;return e&&typeof e=="string"&&(e=Number(e)),typeof e=="number"&&Number.isInteger(e)&&e>=0?e:null}function Ere(t,e,n){const{replacer:r}=n,i=new _4(t);i.tag="tag:yaml.org,2002:pairs";let o=0;if(e&&Symbol.iterator in Object(e))for(let s of e){typeof r=="function"&&(s=r.call(e,String(o++),s));let a,l;if(Array.isArray(s))if(s.length===2)a=s[0],l=s[1];else throw new TypeError(`Expected [key, value] tuple: ${s}`);else if(s&&s instanceof Object){const c=Object.keys(s);if(c.length===1)a=c[0],l=s[a];else throw new TypeError(`Expected tuple with one key, not ${c.length} keys`)}else a=s;i.items.push(y2(a,l,n))}return i}class b2 extends _4{constructor(){super(),this.add=sf.prototype.add.bind(this),this.delete=sf.prototype.delete.bind(this),this.get=sf.prototype.get.bind(this),this.has=sf.prototype.has.bind(this),this.set=sf.prototype.set.bind(this),this.tag=b2.tag}toJSON(e,n){if(!n)return super.toJSON(e);const r=new Map;n!=null&&n.onCreate&&n.onCreate(r);for(const i of this.items){let o,s;if(Br(i)?(o=ms(i.key,"",n),s=ms(i.value,o,n)):o=ms(i,"",n),r.has(o))throw new Error("Ordered maps must not include duplicate keys");r.set(o,s)}return r}static from(e,n,r){const i=Ere(e,n,r),o=new this;return o.items=i.items,o}}b2.tag="tag:yaml.org,2002:omap";class w2 extends sf{constructor(e){super(e),this.tag=w2.tag}add(e){let n;Br(e)?n=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?n=new Pa(e.key,null):n=new Pa(e,null),Vc(this.items,n.key)||this.items.push(n)}get(e,n){const r=Vc(this.items,e);return!n&&Br(r)?yr(r.key)?r.key.value:r.key:r}set(e,n){if(typeof n!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof n}`);const r=Vc(this.items,e);r&&!n?this.items.splice(this.items.indexOf(r),1):!r&&n&&this.items.push(new Pa(e))}toJSON(e,n){return super.toJSON(e,n,Set)}toString(e,n,r){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),n,r);throw new Error("Set items must all have null values")}static from(e,n,r){const{replacer:i}=r,o=new this(e);if(n&&Symbol.iterator in Object(n))for(let s of n)typeof i=="function"&&(s=i.call(n,s,s)),o.items.push(y2(s,null,r));return o}}w2.tag="tag:yaml.org,2002:set";le.object({test:le.string().describe("YAML for the test, including metadata and steps"),modules:le.record(le.string(),le.string()).describe("Map of module name to YAML for the module")});Nd.merge(le.object({steps:V3.array(),fileType:le.literal(Hb.TEST)}));Z_.omit({type:!0}).merge(le.object({schemaVersion:le.string(),fileType:le.literal("momentic/module")}));Nd.merge(le.object({steps:le.array(le.record(le.string(),le.unknown()))}));le.object({moduleId:le.string().uuid(),name:le.string(),schemaVersion:le.string(),steps:le.array(le.record(le.string(),le.unknown()))});const T4=t=>{var e,n;switch(t.type){case $e.AI_ACTION:if(!((e=t.commands)!=null&&e.length))return"Please run your AI action at least once to generate saved commands.";const r=S0[Le.SUCCESS];if((n=t.commands)!=null&&n.length&&t.commands[t.commands.length-1].type!==Le.SUCCESS)throw new pN(`AI actions must end with a ${r} command.`);if(t.commands&&t.commands.filter(i=>i.type===Le.SUCCESS).length>1)throw new pN(`AI actions can only have a single ${r} command.`);return;case"RESOLVED_MODULE":return t.steps.map(T4)[0];case $e.PRESET_ACTION:return}},_re=t=>{let e;return t.forEach(n=>{const r=T4(n);r&&!e&&(e=r)}),e},bN=t=>typeof t=="boolean"?"".concat(t):t===0?"0":t,wN=E3,A4=(t,e)=>n=>{var r;if((e==null?void 0:e.variants)==null)return wN(t,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:i,defaultVariants:o}=e,s=Object.keys(i).map(c=>{const f=n==null?void 0:n[c],d=o==null?void 0:o[c];if(f===null)return null;const p=bN(f)||bN(d);return i[c][p]}),a=n&&Object.entries(n).reduce((c,f)=>{let[d,p]=f;return p===void 0||(c[d]=p),c},{}),l=e==null||(r=e.compoundVariants)===null||r===void 0?void 0:r.reduce((c,f)=>{let{class:d,className:p,...m}=f;return Object.entries(m).every(v=>{let[b,S]=v;return Array.isArray(S)?S.includes({...o,...a}[b]):{...o,...a}[b]===S})?[...c,d,p]:c},[]);return wN(t,s,l,n==null?void 0:n.class,n==null?void 0:n.className)},Tre=A4("inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-transparent shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline",plain:"bg-transparent hover:bg-accent"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),Tn=g.forwardRef(({className:t,variant:e,size:n,asChild:r=!1,...i},o)=>{const s=r?$a:"button";return k.jsx(s,{className:ft(Tre({variant:e,size:n,className:t})),ref:o,...i})});Tn.displayName="Button";const Px="focusScope.autoFocusOnMount",Nx="focusScope.autoFocusOnUnmount",xN={bubbles:!1,cancelable:!0},x2=g.forwardRef((t,e)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...s}=t,[a,l]=g.useState(null),c=Ys(i),f=Ys(o),d=g.useRef(null),p=hn(e,b=>l(b)),m=g.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;g.useEffect(()=>{if(r){let w=function(_){if(m.paused||!a)return;const R=_.target;a.contains(R)?d.current=R:hl(d.current,{select:!0})},C=function(_){if(m.paused||!a)return;const R=_.relatedTarget;R!==null&&(a.contains(R)||hl(d.current,{select:!0}))},T=function(_){const R=document.activeElement;for(const M of _)M.removedNodes.length>0&&(a!=null&&a.contains(R)||hl(a))};var b=w,S=C,x=T;document.addEventListener("focusin",w),document.addEventListener("focusout",C);const A=new MutationObserver(T);return a&&A.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",w),document.removeEventListener("focusout",C),A.disconnect()}}},[r,a,m.paused]),g.useEffect(()=>{if(a){CN.add(m);const b=document.activeElement;if(!a.contains(b)){const x=new CustomEvent(Px,xN);a.addEventListener(Px,c),a.dispatchEvent(x),x.defaultPrevented||(Are(Mre(O4(a)),{select:!0}),document.activeElement===b&&hl(a))}return()=>{a.removeEventListener(Px,c),setTimeout(()=>{const x=new CustomEvent(Nx,xN);a.addEventListener(Nx,f),a.dispatchEvent(x),x.defaultPrevented||hl(b??document.body,{select:!0}),a.removeEventListener(Nx,f),CN.remove(m)},0)}}},[a,c,f,m]);const v=g.useCallback(b=>{if(!n&&!r||m.paused)return;const S=b.key==="Tab"&&!b.altKey&&!b.ctrlKey&&!b.metaKey,x=document.activeElement;if(S&&x){const w=b.currentTarget,[C,T]=Ore(w);C&&T?!b.shiftKey&&x===T?(b.preventDefault(),n&&hl(C,{select:!0})):b.shiftKey&&x===C&&(b.preventDefault(),n&&hl(T,{select:!0})):x===w&&b.preventDefault()}},[n,r,m.paused]);return g.createElement(Dt.div,H({tabIndex:-1},s,{ref:p,onKeyDown:v}))});function Are(t,{select:e=!1}={}){const n=document.activeElement;for(const r of t)if(hl(r,{select:e}),document.activeElement!==n)return}function Ore(t){const e=O4(t),n=SN(e,t),r=SN(e.reverse(),t);return[n,r]}function O4(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function SN(t,e){for(const n of t)if(!Rre(n,{upTo:e}))return n}function Rre(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function Pre(t){return t instanceof HTMLInputElement&&"select"in t}function hl(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&Pre(t)&&e&&t.select()}}const CN=Nre();function Nre(){let t=[];return{add(e){const n=t[0];e!==n&&(n==null||n.pause()),t=kN(t,e),t.unshift(e)},remove(e){var n;t=kN(t,e),(n=t[0])===null||n===void 0||n.resume()}}}function kN(t,e){const n=[...t],r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}function Mre(t){return t.filter(e=>e.tagName!=="A")}let Mx=0;function S2(){g.useEffect(()=>{var t,e;const n=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",(t=n[0])!==null&&t!==void 0?t:EN()),document.body.insertAdjacentElement("beforeend",(e=n[1])!==null&&e!==void 0?e:EN()),Mx++,()=>{Mx===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(r=>r.remove()),Mx--}},[])}function EN(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",t}var cp="right-scroll-bar-position",up="width-before-scroll-bar",Dre="with-scroll-bars-hidden",Lre="--removed-body-scroll-bar-size";function $re(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function Ire(t,e){var n=g.useState(function(){return{value:t,callback:e,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=e,n.facade}function R4(t,e){return Ire(e||null,function(n){return t.forEach(function(r){return $re(r,n)})})}function jre(t){return t}function Bre(t,e){e===void 0&&(e=jre);var n=[],r=!1,i={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:t},useMedium:function(o){var s=e(o,r);return n.push(s),function(){n=n.filter(function(a){return a!==s})}},assignSyncMedium:function(o){for(r=!0;n.length;){var s=n;n=[],s.forEach(o)}n={push:function(a){return o(a)},filter:function(){return n}}},assignMedium:function(o){r=!0;var s=[];if(n.length){var a=n;n=[],a.forEach(o),s=n}var l=function(){var f=s;s=[],f.forEach(o)},c=function(){return Promise.resolve().then(l)};c(),n={push:function(f){s.push(f),c()},filter:function(f){return s=s.filter(f),n}}}};return i}function P4(t){t===void 0&&(t={});var e=Bre(null);return e.options=Sr({async:!0,ssr:!1},t),e}var N4=function(t){var e=t.sideCar,n=f2(t,["sideCar"]);if(!e)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=e.read();if(!r)throw new Error("Sidecar medium not found");return g.createElement(r,Sr({},n))};N4.isSideCarExport=!0;function M4(t,e){return t.useMedium(e),N4}var D4=P4(),Dx=function(){},Zb=g.forwardRef(function(t,e){var n=g.useRef(null),r=g.useState({onScrollCapture:Dx,onWheelCapture:Dx,onTouchMoveCapture:Dx}),i=r[0],o=r[1],s=t.forwardProps,a=t.children,l=t.className,c=t.removeScrollBar,f=t.enabled,d=t.shards,p=t.sideCar,m=t.noIsolation,v=t.inert,b=t.allowPinchZoom,S=t.as,x=S===void 0?"div":S,w=f2(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as"]),C=p,T=R4([n,e]),A=Sr(Sr({},w),i);return g.createElement(g.Fragment,null,f&&g.createElement(C,{sideCar:D4,removeScrollBar:c,shards:d,noIsolation:m,inert:v,setCallbacks:o,allowPinchZoom:!!b,lockRef:n}),s?g.cloneElement(g.Children.only(a),Sr(Sr({},A),{ref:T})):g.createElement(x,Sr({},A,{className:l,ref:T}),a))});Zb.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Zb.classNames={fullWidth:up,zeroRight:cp};var _N,Fre=function(){if(_N)return _N;if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function zre(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=Fre();return e&&t.setAttribute("nonce",e),t}function Vre(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function Ure(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var Wre=function(){var t=0,e=null;return{add:function(n){t==0&&(e=zre())&&(Vre(e,n),Ure(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},Hre=function(){var t=Wre();return function(e,n){g.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&n])}},C2=function(){var t=Hre(),e=function(n){var r=n.styles,i=n.dynamic;return t(r,i),null};return e},qre={left:0,top:0,right:0,gap:0},Lx=function(t){return parseInt(t||"",10)||0},Kre=function(t){var e=window.getComputedStyle(document.body),n=e[t==="padding"?"paddingLeft":"marginLeft"],r=e[t==="padding"?"paddingTop":"marginTop"],i=e[t==="padding"?"paddingRight":"marginRight"];return[Lx(n),Lx(r),Lx(i)]},Gre=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return qre;var e=Kre(t),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,r-n+e[2]-e[0])}},Yre=C2(),Xre=function(t,e,n,r){var i=t.left,o=t.top,s=t.right,a=t.gap;return n===void 0&&(n="margin"),`
127
+ .`.concat(Dre,` {
128
+ overflow: hidden `).concat(r,`;
129
+ padding-right: `).concat(a,"px ").concat(r,`;
130
+ }
131
+ body {
132
+ overflow: hidden `).concat(r,`;
133
+ overscroll-behavior: contain;
134
+ `).concat([e&&"position: relative ".concat(r,";"),n==="margin"&&`
135
+ padding-left: `.concat(i,`px;
136
+ padding-top: `).concat(o,`px;
137
+ padding-right: `).concat(s,`px;
138
+ margin-left:0;
139
+ margin-top:0;
140
+ margin-right: `).concat(a,"px ").concat(r,`;
141
+ `),n==="padding"&&"padding-right: ".concat(a,"px ").concat(r,";")].filter(Boolean).join(""),`
142
+ }
143
+
144
+ .`).concat(cp,` {
145
+ right: `).concat(a,"px ").concat(r,`;
146
+ }
147
+
148
+ .`).concat(up,` {
149
+ margin-right: `).concat(a,"px ").concat(r,`;
150
+ }
151
+
152
+ .`).concat(cp," .").concat(cp,` {
153
+ right: 0 `).concat(r,`;
154
+ }
155
+
156
+ .`).concat(up," .").concat(up,` {
157
+ margin-right: 0 `).concat(r,`;
158
+ }
159
+
160
+ body {
161
+ `).concat(Lre,": ").concat(a,`px;
162
+ }
163
+ `)},L4=function(t){var e=t.noRelative,n=t.noImportant,r=t.gapMode,i=r===void 0?"margin":r,o=g.useMemo(function(){return Gre(i)},[i]);return g.createElement(Yre,{styles:Xre(o,!e,i,n?"":"!important")})},QC=!1;if(typeof window<"u")try{var sv=Object.defineProperty({},"passive",{get:function(){return QC=!0,!0}});window.addEventListener("test",sv,sv),window.removeEventListener("test",sv,sv)}catch{QC=!1}var Xu=QC?{passive:!1}:!1,Zre=function(t){return t.tagName==="TEXTAREA"},$4=function(t,e){var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!Zre(t)&&n[e]==="visible")},Qre=function(t){return $4(t,"overflowY")},Jre=function(t){return $4(t,"overflowX")},TN=function(t,e){var n=e;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var r=I4(t,n);if(r){var i=j4(t,n),o=i[1],s=i[2];if(o>s)return!0}n=n.parentNode}while(n&&n!==document.body);return!1},eie=function(t){var e=t.scrollTop,n=t.scrollHeight,r=t.clientHeight;return[e,n,r]},tie=function(t){var e=t.scrollLeft,n=t.scrollWidth,r=t.clientWidth;return[e,n,r]},I4=function(t,e){return t==="v"?Qre(e):Jre(e)},j4=function(t,e){return t==="v"?eie(e):tie(e)},nie=function(t,e){return t==="h"&&e==="rtl"?-1:1},rie=function(t,e,n,r,i){var o=nie(t,window.getComputedStyle(e).direction),s=o*r,a=n.target,l=e.contains(a),c=!1,f=s>0,d=0,p=0;do{var m=j4(t,a),v=m[0],b=m[1],S=m[2],x=b-S-o*v;(v||x)&&I4(t,a)&&(d+=x,p+=v),a=a.parentNode}while(!l&&a!==document.body||l&&(e.contains(a)||e===a));return(f&&(i&&d===0||!i&&s>d)||!f&&(i&&p===0||!i&&-s>p))&&(c=!0),c},av=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},AN=function(t){return[t.deltaX,t.deltaY]},ON=function(t){return t&&"current"in t?t.current:t},iie=function(t,e){return t[0]===e[0]&&t[1]===e[1]},oie=function(t){return`
164
+ .block-interactivity-`.concat(t,` {pointer-events: none;}
165
+ .allow-interactivity-`).concat(t,` {pointer-events: all;}
166
+ `)},sie=0,Zu=[];function aie(t){var e=g.useRef([]),n=g.useRef([0,0]),r=g.useRef(),i=g.useState(sie++)[0],o=g.useState(function(){return C2()})[0],s=g.useRef(t);g.useEffect(function(){s.current=t},[t]),g.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(i));var b=h4([t.lockRef.current],(t.shards||[]).map(ON),!0).filter(Boolean);return b.forEach(function(S){return S.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),b.forEach(function(S){return S.classList.remove("allow-interactivity-".concat(i))})}}},[t.inert,t.lockRef.current,t.shards]);var a=g.useCallback(function(b,S){if("touches"in b&&b.touches.length===2)return!s.current.allowPinchZoom;var x=av(b),w=n.current,C="deltaX"in b?b.deltaX:w[0]-x[0],T="deltaY"in b?b.deltaY:w[1]-x[1],A,_=b.target,R=Math.abs(C)>Math.abs(T)?"h":"v";if("touches"in b&&R==="h"&&_.type==="range")return!1;var M=TN(R,_);if(!M)return!0;if(M?A=R:(A=R==="v"?"h":"v",M=TN(R,_)),!M)return!1;if(!r.current&&"changedTouches"in b&&(C||T)&&(r.current=A),!A)return!0;var I=r.current||A;return rie(I,S,b,I==="h"?C:T,!0)},[]),l=g.useCallback(function(b){var S=b;if(!(!Zu.length||Zu[Zu.length-1]!==o)){var x="deltaY"in S?AN(S):av(S),w=e.current.filter(function(A){return A.name===S.type&&A.target===S.target&&iie(A.delta,x)})[0];if(w&&w.should){S.cancelable&&S.preventDefault();return}if(!w){var C=(s.current.shards||[]).map(ON).filter(Boolean).filter(function(A){return A.contains(S.target)}),T=C.length>0?a(S,C[0]):!s.current.noIsolation;T&&S.cancelable&&S.preventDefault()}}},[]),c=g.useCallback(function(b,S,x,w){var C={name:b,delta:S,target:x,should:w};e.current.push(C),setTimeout(function(){e.current=e.current.filter(function(T){return T!==C})},1)},[]),f=g.useCallback(function(b){n.current=av(b),r.current=void 0},[]),d=g.useCallback(function(b){c(b.type,AN(b),b.target,a(b,t.lockRef.current))},[]),p=g.useCallback(function(b){c(b.type,av(b),b.target,a(b,t.lockRef.current))},[]);g.useEffect(function(){return Zu.push(o),t.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:p}),document.addEventListener("wheel",l,Xu),document.addEventListener("touchmove",l,Xu),document.addEventListener("touchstart",f,Xu),function(){Zu=Zu.filter(function(b){return b!==o}),document.removeEventListener("wheel",l,Xu),document.removeEventListener("touchmove",l,Xu),document.removeEventListener("touchstart",f,Xu)}},[]);var m=t.removeScrollBar,v=t.inert;return g.createElement(g.Fragment,null,v?g.createElement(o,{styles:oie(i)}):null,m?g.createElement(L4,{gapMode:"margin"}):null)}const lie=M4(D4,aie);var B4=g.forwardRef(function(t,e){return g.createElement(Zb,Sr({},t,{ref:e,sideCar:lie}))});B4.classNames=Zb.classNames;const k2=B4;var cie=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},Qu=new WeakMap,lv=new WeakMap,cv={},$x=0,F4=function(t){return t&&(t.host||F4(t.parentNode))},uie=function(t,e){return e.map(function(n){if(t.contains(n))return n;var r=F4(n);return r&&t.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",t,". Doing nothing"),null)}).filter(function(n){return!!n})},fie=function(t,e,n,r){var i=uie(e,Array.isArray(t)?t:[t]);cv[n]||(cv[n]=new WeakMap);var o=cv[n],s=[],a=new Set,l=new Set(i),c=function(d){!d||a.has(d)||(a.add(d),c(d.parentNode))};i.forEach(c);var f=function(d){!d||l.has(d)||Array.prototype.forEach.call(d.children,function(p){if(a.has(p))f(p);else{var m=p.getAttribute(r),v=m!==null&&m!=="false",b=(Qu.get(p)||0)+1,S=(o.get(p)||0)+1;Qu.set(p,b),o.set(p,S),s.push(p),b===1&&v&&lv.set(p,!0),S===1&&p.setAttribute(n,"true"),v||p.setAttribute(r,"true")}})};return f(e),a.clear(),$x++,function(){s.forEach(function(d){var p=Qu.get(d)-1,m=o.get(d)-1;Qu.set(d,p),o.set(d,m),p||(lv.has(d)||d.removeAttribute(r),lv.delete(d)),m||d.removeAttribute(n)}),$x--,$x||(Qu=new WeakMap,Qu=new WeakMap,lv=new WeakMap,cv={})}},Qb=function(t,e,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(t)?t:[t]),i=e||cie(t);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live]"))),fie(r,i,n,"aria-hidden")):function(){return null}};const z4="Dialog",[V4,jCe]=Fo(z4),[die,xs]=V4(z4),hie=t=>{const{__scopeDialog:e,children:n,open:r,defaultOpen:i,onOpenChange:o,modal:s=!0}=t,a=g.useRef(null),l=g.useRef(null),[c=!1,f]=Zs({prop:r,defaultProp:i,onChange:o});return g.createElement(die,{scope:e,triggerRef:a,contentRef:l,contentId:Oa(),titleId:Oa(),descriptionId:Oa(),open:c,onOpenChange:f,onOpenToggle:g.useCallback(()=>f(d=>!d),[f]),modal:s},n)},pie="DialogTrigger",mie=g.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,i=xs(pie,n),o=hn(e,i.triggerRef);return g.createElement(Dt.button,H({type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":E2(i.open)},r,{ref:o,onClick:yt(t.onClick,i.onOpenToggle)}))}),U4="DialogPortal",[gie,W4]=V4(U4,{forceMount:void 0}),vie=t=>{const{__scopeDialog:e,forceMount:n,children:r,container:i}=t,o=xs(U4,e);return g.createElement(gie,{scope:e,forceMount:n},g.Children.map(r,s=>g.createElement(ws,{present:n||o.open},g.createElement(jb,{asChild:!0,container:i},s))))},JC="DialogOverlay",yie=g.forwardRef((t,e)=>{const n=W4(JC,t.__scopeDialog),{forceMount:r=n.forceMount,...i}=t,o=xs(JC,t.__scopeDialog);return o.modal?g.createElement(ws,{present:r||o.open},g.createElement(bie,H({},i,{ref:e}))):null}),bie=g.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,i=xs(JC,n);return g.createElement(k2,{as:$a,allowPinchZoom:!0,shards:[i.contentRef]},g.createElement(Dt.div,H({"data-state":E2(i.open)},r,{ref:e,style:{pointerEvents:"auto",...r.style}})))}),tm="DialogContent",wie=g.forwardRef((t,e)=>{const n=W4(tm,t.__scopeDialog),{forceMount:r=n.forceMount,...i}=t,o=xs(tm,t.__scopeDialog);return g.createElement(ws,{present:r||o.open},o.modal?g.createElement(xie,H({},i,{ref:e})):g.createElement(Sie,H({},i,{ref:e})))}),xie=g.forwardRef((t,e)=>{const n=xs(tm,t.__scopeDialog),r=g.useRef(null),i=hn(e,n.contentRef,r);return g.useEffect(()=>{const o=r.current;if(o)return Qb(o)},[]),g.createElement(H4,H({},t,{ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:yt(t.onCloseAutoFocus,o=>{var s;o.preventDefault(),(s=n.triggerRef.current)===null||s===void 0||s.focus()}),onPointerDownOutside:yt(t.onPointerDownOutside,o=>{const s=o.detail.originalEvent,a=s.button===0&&s.ctrlKey===!0;(s.button===2||a)&&o.preventDefault()}),onFocusOutside:yt(t.onFocusOutside,o=>o.preventDefault())}))}),Sie=g.forwardRef((t,e)=>{const n=xs(tm,t.__scopeDialog),r=g.useRef(!1),i=g.useRef(!1);return g.createElement(H4,H({},t,{ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var s;if((s=t.onCloseAutoFocus)===null||s===void 0||s.call(t,o),!o.defaultPrevented){var a;r.current||(a=n.triggerRef.current)===null||a===void 0||a.focus(),o.preventDefault()}r.current=!1,i.current=!1},onInteractOutside:o=>{var s,a;(s=t.onInteractOutside)===null||s===void 0||s.call(t,o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const l=o.target;((a=n.triggerRef.current)===null||a===void 0?void 0:a.contains(l))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}}))}),H4=g.forwardRef((t,e)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:o,...s}=t,a=xs(tm,n),l=g.useRef(null),c=hn(e,l);return S2(),g.createElement(g.Fragment,null,g.createElement(x2,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:o},g.createElement(Db,H({role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":E2(a.open)},s,{ref:c,onDismiss:()=>a.onOpenChange(!1)}))),!1)}),Cie="DialogTitle",kie=g.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,i=xs(Cie,n);return g.createElement(Dt.h2,H({id:i.titleId},r,{ref:e}))}),Eie="DialogDescription",_ie=g.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,i=xs(Eie,n);return g.createElement(Dt.p,H({id:i.descriptionId},r,{ref:e}))}),Tie="DialogClose",Aie=g.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,i=xs(Tie,n);return g.createElement(Dt.button,H({type:"button"},r,{ref:e,onClick:yt(t.onClick,()=>i.onOpenChange(!1))}))});function E2(t){return t?"open":"closed"}const Oie=hie,Rie=mie,Pie=vie,q4=yie,K4=wie,G4=kie,Y4=_ie,Nie=Aie,_2=Oie,T2=Rie,Mie=Pie,X4=g.forwardRef(({className:t,...e},n)=>k.jsx(q4,{ref:n,className:ft("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/80",t),...e}));X4.displayName=q4.displayName;const Jb=g.forwardRef(({className:t,children:e,...n},r)=>k.jsxs(Mie,{children:[k.jsx(X4,{}),k.jsxs(K4,{ref:r,className:ft("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border p-6 shadow-lg duration-200 sm:rounded-lg",t),...n,children:[e,k.jsxs(Nie,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute right-4 top-4 rounded-sm opacity-70 transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-offset-2 disabled:pointer-events-none",children:[k.jsx(d4,{className:"h-4 w-4"}),k.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Jb.displayName=K4.displayName;const e1=({className:t,...e})=>k.jsx("div",{className:ft("flex flex-col space-y-1.5 text-center sm:text-left",t),...e});e1.displayName="DialogHeader";const A2=({className:t,...e})=>k.jsx("div",{className:ft("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...e});A2.displayName="DialogFooter";const t1=g.forwardRef(({className:t,...e},n)=>k.jsx(G4,{ref:n,className:ft("text-lg font-semibold leading-none tracking-tight",t),...e}));t1.displayName=G4.displayName;const Z4=g.forwardRef(({className:t,...e},n)=>k.jsx(Y4,{ref:n,className:ft("text-muted-foreground text-sm",t),...e}));Z4.displayName=Y4.displayName;const Die=g.forwardRef((t,e)=>g.createElement(Dt.label,H({},t,{ref:e,onMouseDown:n=>{var r;(r=t.onMouseDown)===null||r===void 0||r.call(t,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault()}}))),Q4=Die,Lie=A4("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),xi=g.forwardRef(({className:t,...e},n)=>k.jsx(Q4,{ref:n,className:ft(Lie(),t),...e}));xi.displayName=Q4.displayName;const J4=cne,e6=g.createContext({}),ek=({...t})=>k.jsx(e6.Provider,{value:{name:t.name},children:k.jsx(hne,{...t})}),n1=()=>{const t=g.useContext(e6),e=g.useContext(t6),{getFieldState:n,formState:r}=Ub(),i=n(t.name,r);if(!t)throw new Error("useFormField should be used within <FormField>");const{id:o}=e;return{id:o,name:t.name,formItemId:`${o}-form-item`,formDescriptionId:`${o}-form-item-description`,formMessageId:`${o}-form-item-message`,...i}},t6=g.createContext({}),_0=g.forwardRef(({className:t,...e},n)=>{const r=g.useId();return k.jsx(t6.Provider,{value:{id:r},children:k.jsx("div",{ref:n,className:ft("space-y-2",t),...e})})});_0.displayName="FormItem";const T0=g.forwardRef(({className:t,...e},n)=>{const{error:r,formItemId:i}=n1();return k.jsx(xi,{ref:n,className:ft(r&&"text-destructive",t),htmlFor:i,...e})});T0.displayName="FormLabel";const A0=g.forwardRef(({...t},e)=>{const{error:n,formItemId:r,formDescriptionId:i,formMessageId:o}=n1();return k.jsx($a,{ref:e,id:r,"aria-describedby":n?`${i} ${o}`:`${i}`,"aria-invalid":!!n,...t})});A0.displayName="FormControl";const O0=g.forwardRef(({className:t,...e},n)=>{const{formDescriptionId:r}=n1();return k.jsx("p",{ref:n,id:r,className:ft("text-muted-foreground text-[0.8rem]",t),...e})});O0.displayName="FormDescription";const R0=g.forwardRef(({className:t,children:e,...n},r)=>{const{error:i,formMessageId:o}=n1(),s=i?String(i==null?void 0:i.message):e;return s?k.jsx("p",{ref:r,id:o,className:ft("text-destructive text-[0.8rem] font-medium",t),...n,children:s}):null});R0.displayName="FormMessage";const jl=g.forwardRef(({className:t,type:e,...n},r)=>k.jsx("input",{type:e,className:ft("border-input placeholder:text-muted-foreground focus-visible:ring-ring flex h-9 w-full rounded-md border bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium focus-visible:outline-none focus-visible:ring-1 disabled:cursor-not-allowed disabled:opacity-50",t),ref:r,...n}));jl.displayName="Input";const hu="";function P0(t){"@babel/helpers - typeof";return P0=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},P0(t)}function pu(t){if(t===null||t===!0||t===!1)return NaN;var e=Number(t);return isNaN(e)?e:e<0?Math.ceil(e):Math.floor(e)}function mi(t,e){if(e.length<t)throw new TypeError(t+" argument"+(t>1?"s":"")+" required, but only "+e.length+" present")}function ia(t){mi(1,arguments);var e=Object.prototype.toString.call(t);return t instanceof Date||P0(t)==="object"&&e==="[object Date]"?new Date(t.getTime()):typeof t=="number"||e==="[object Number]"?new Date(t):((typeof t=="string"||e==="[object String]")&&typeof console<"u"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(new Error().stack)),new Date(NaN))}function $ie(t,e){mi(2,arguments);var n=ia(t).getTime(),r=pu(e);return new Date(n+r)}var Iie={};function r1(){return Iie}function jie(t){var e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.setUTCFullYear(t.getFullYear()),t.getTime()-e.getTime()}function Bie(t){return mi(1,arguments),t instanceof Date||P0(t)==="object"&&Object.prototype.toString.call(t)==="[object Date]"}function Fie(t){if(mi(1,arguments),!Bie(t)&&typeof t!="number")return!1;var e=ia(t);return!isNaN(Number(e))}function zie(t,e){mi(2,arguments);var n=pu(e);return $ie(t,-n)}var Vie=864e5;function Uie(t){mi(1,arguments);var e=ia(t),n=e.getTime();e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0);var r=e.getTime(),i=n-r;return Math.floor(i/Vie)+1}function N0(t){mi(1,arguments);var e=1,n=ia(t),r=n.getUTCDay(),i=(r<e?7:0)+r-e;return n.setUTCDate(n.getUTCDate()-i),n.setUTCHours(0,0,0,0),n}function n6(t){mi(1,arguments);var e=ia(t),n=e.getUTCFullYear(),r=new Date(0);r.setUTCFullYear(n+1,0,4),r.setUTCHours(0,0,0,0);var i=N0(r),o=new Date(0);o.setUTCFullYear(n,0,4),o.setUTCHours(0,0,0,0);var s=N0(o);return e.getTime()>=i.getTime()?n+1:e.getTime()>=s.getTime()?n:n-1}function Wie(t){mi(1,arguments);var e=n6(t),n=new Date(0);n.setUTCFullYear(e,0,4),n.setUTCHours(0,0,0,0);var r=N0(n);return r}var Hie=6048e5;function qie(t){mi(1,arguments);var e=ia(t),n=N0(e).getTime()-Wie(e).getTime();return Math.round(n/Hie)+1}function M0(t,e){var n,r,i,o,s,a,l,c;mi(1,arguments);var f=r1(),d=pu((n=(r=(i=(o=e==null?void 0:e.weekStartsOn)!==null&&o!==void 0?o:e==null||(s=e.locale)===null||s===void 0||(a=s.options)===null||a===void 0?void 0:a.weekStartsOn)!==null&&i!==void 0?i:f.weekStartsOn)!==null&&r!==void 0?r:(l=f.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.weekStartsOn)!==null&&n!==void 0?n:0);if(!(d>=0&&d<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var p=ia(t),m=p.getUTCDay(),v=(m<d?7:0)+m-d;return p.setUTCDate(p.getUTCDate()-v),p.setUTCHours(0,0,0,0),p}function r6(t,e){var n,r,i,o,s,a,l,c;mi(1,arguments);var f=ia(t),d=f.getUTCFullYear(),p=r1(),m=pu((n=(r=(i=(o=e==null?void 0:e.firstWeekContainsDate)!==null&&o!==void 0?o:e==null||(s=e.locale)===null||s===void 0||(a=s.options)===null||a===void 0?void 0:a.firstWeekContainsDate)!==null&&i!==void 0?i:p.firstWeekContainsDate)!==null&&r!==void 0?r:(l=p.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.firstWeekContainsDate)!==null&&n!==void 0?n:1);if(!(m>=1&&m<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var v=new Date(0);v.setUTCFullYear(d+1,0,m),v.setUTCHours(0,0,0,0);var b=M0(v,e),S=new Date(0);S.setUTCFullYear(d,0,m),S.setUTCHours(0,0,0,0);var x=M0(S,e);return f.getTime()>=b.getTime()?d+1:f.getTime()>=x.getTime()?d:d-1}function Kie(t,e){var n,r,i,o,s,a,l,c;mi(1,arguments);var f=r1(),d=pu((n=(r=(i=(o=e==null?void 0:e.firstWeekContainsDate)!==null&&o!==void 0?o:e==null||(s=e.locale)===null||s===void 0||(a=s.options)===null||a===void 0?void 0:a.firstWeekContainsDate)!==null&&i!==void 0?i:f.firstWeekContainsDate)!==null&&r!==void 0?r:(l=f.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.firstWeekContainsDate)!==null&&n!==void 0?n:1),p=r6(t,e),m=new Date(0);m.setUTCFullYear(p,0,d),m.setUTCHours(0,0,0,0);var v=M0(m,e);return v}var Gie=6048e5;function Yie(t,e){mi(1,arguments);var n=ia(t),r=M0(n,e).getTime()-Kie(n,e).getTime();return Math.round(r/Gie)+1}function un(t,e){for(var n=t<0?"-":"",r=Math.abs(t).toString();r.length<e;)r="0"+r;return n+r}var Xie={y:function(e,n){var r=e.getUTCFullYear(),i=r>0?r:1-r;return un(n==="yy"?i%100:i,n.length)},M:function(e,n){var r=e.getUTCMonth();return n==="M"?String(r+1):un(r+1,2)},d:function(e,n){return un(e.getUTCDate(),n.length)},a:function(e,n){var r=e.getUTCHours()/12>=1?"pm":"am";switch(n){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];case"aaaa":default:return r==="am"?"a.m.":"p.m."}},h:function(e,n){return un(e.getUTCHours()%12||12,n.length)},H:function(e,n){return un(e.getUTCHours(),n.length)},m:function(e,n){return un(e.getUTCMinutes(),n.length)},s:function(e,n){return un(e.getUTCSeconds(),n.length)},S:function(e,n){var r=n.length,i=e.getUTCMilliseconds(),o=Math.floor(i*Math.pow(10,r-3));return un(o,n.length)}};const ul=Xie;var Ju={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Zie={G:function(e,n,r){var i=e.getUTCFullYear()>0?1:0;switch(n){case"G":case"GG":case"GGG":return r.era(i,{width:"abbreviated"});case"GGGGG":return r.era(i,{width:"narrow"});case"GGGG":default:return r.era(i,{width:"wide"})}},y:function(e,n,r){if(n==="yo"){var i=e.getUTCFullYear(),o=i>0?i:1-i;return r.ordinalNumber(o,{unit:"year"})}return ul.y(e,n)},Y:function(e,n,r,i){var o=r6(e,i),s=o>0?o:1-o;if(n==="YY"){var a=s%100;return un(a,2)}return n==="Yo"?r.ordinalNumber(s,{unit:"year"}):un(s,n.length)},R:function(e,n){var r=n6(e);return un(r,n.length)},u:function(e,n){var r=e.getUTCFullYear();return un(r,n.length)},Q:function(e,n,r){var i=Math.ceil((e.getUTCMonth()+1)/3);switch(n){case"Q":return String(i);case"QQ":return un(i,2);case"Qo":return r.ordinalNumber(i,{unit:"quarter"});case"QQQ":return r.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return r.quarter(i,{width:"wide",context:"formatting"})}},q:function(e,n,r){var i=Math.ceil((e.getUTCMonth()+1)/3);switch(n){case"q":return String(i);case"qq":return un(i,2);case"qo":return r.ordinalNumber(i,{unit:"quarter"});case"qqq":return r.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return r.quarter(i,{width:"wide",context:"standalone"})}},M:function(e,n,r){var i=e.getUTCMonth();switch(n){case"M":case"MM":return ul.M(e,n);case"Mo":return r.ordinalNumber(i+1,{unit:"month"});case"MMM":return r.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return r.month(i,{width:"wide",context:"formatting"})}},L:function(e,n,r){var i=e.getUTCMonth();switch(n){case"L":return String(i+1);case"LL":return un(i+1,2);case"Lo":return r.ordinalNumber(i+1,{unit:"month"});case"LLL":return r.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return r.month(i,{width:"wide",context:"standalone"})}},w:function(e,n,r,i){var o=Yie(e,i);return n==="wo"?r.ordinalNumber(o,{unit:"week"}):un(o,n.length)},I:function(e,n,r){var i=qie(e);return n==="Io"?r.ordinalNumber(i,{unit:"week"}):un(i,n.length)},d:function(e,n,r){return n==="do"?r.ordinalNumber(e.getUTCDate(),{unit:"date"}):ul.d(e,n)},D:function(e,n,r){var i=Uie(e);return n==="Do"?r.ordinalNumber(i,{unit:"dayOfYear"}):un(i,n.length)},E:function(e,n,r){var i=e.getUTCDay();switch(n){case"E":case"EE":case"EEE":return r.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(i,{width:"short",context:"formatting"});case"EEEE":default:return r.day(i,{width:"wide",context:"formatting"})}},e:function(e,n,r,i){var o=e.getUTCDay(),s=(o-i.weekStartsOn+8)%7||7;switch(n){case"e":return String(s);case"ee":return un(s,2);case"eo":return r.ordinalNumber(s,{unit:"day"});case"eee":return r.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(o,{width:"short",context:"formatting"});case"eeee":default:return r.day(o,{width:"wide",context:"formatting"})}},c:function(e,n,r,i){var o=e.getUTCDay(),s=(o-i.weekStartsOn+8)%7||7;switch(n){case"c":return String(s);case"cc":return un(s,n.length);case"co":return r.ordinalNumber(s,{unit:"day"});case"ccc":return r.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(o,{width:"narrow",context:"standalone"});case"cccccc":return r.day(o,{width:"short",context:"standalone"});case"cccc":default:return r.day(o,{width:"wide",context:"standalone"})}},i:function(e,n,r){var i=e.getUTCDay(),o=i===0?7:i;switch(n){case"i":return String(o);case"ii":return un(o,n.length);case"io":return r.ordinalNumber(o,{unit:"day"});case"iii":return r.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(i,{width:"short",context:"formatting"});case"iiii":default:return r.day(i,{width:"wide",context:"formatting"})}},a:function(e,n,r){var i=e.getUTCHours(),o=i/12>=1?"pm":"am";switch(n){case"a":case"aa":return r.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(o,{width:"narrow",context:"formatting"});case"aaaa":default:return r.dayPeriod(o,{width:"wide",context:"formatting"})}},b:function(e,n,r){var i=e.getUTCHours(),o;switch(i===12?o=Ju.noon:i===0?o=Ju.midnight:o=i/12>=1?"pm":"am",n){case"b":case"bb":return r.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(o,{width:"narrow",context:"formatting"});case"bbbb":default:return r.dayPeriod(o,{width:"wide",context:"formatting"})}},B:function(e,n,r){var i=e.getUTCHours(),o;switch(i>=17?o=Ju.evening:i>=12?o=Ju.afternoon:i>=4?o=Ju.morning:o=Ju.night,n){case"B":case"BB":case"BBB":return r.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(o,{width:"narrow",context:"formatting"});case"BBBB":default:return r.dayPeriod(o,{width:"wide",context:"formatting"})}},h:function(e,n,r){if(n==="ho"){var i=e.getUTCHours()%12;return i===0&&(i=12),r.ordinalNumber(i,{unit:"hour"})}return ul.h(e,n)},H:function(e,n,r){return n==="Ho"?r.ordinalNumber(e.getUTCHours(),{unit:"hour"}):ul.H(e,n)},K:function(e,n,r){var i=e.getUTCHours()%12;return n==="Ko"?r.ordinalNumber(i,{unit:"hour"}):un(i,n.length)},k:function(e,n,r){var i=e.getUTCHours();return i===0&&(i=24),n==="ko"?r.ordinalNumber(i,{unit:"hour"}):un(i,n.length)},m:function(e,n,r){return n==="mo"?r.ordinalNumber(e.getUTCMinutes(),{unit:"minute"}):ul.m(e,n)},s:function(e,n,r){return n==="so"?r.ordinalNumber(e.getUTCSeconds(),{unit:"second"}):ul.s(e,n)},S:function(e,n){return ul.S(e,n)},X:function(e,n,r,i){var o=i._originalDate||e,s=o.getTimezoneOffset();if(s===0)return"Z";switch(n){case"X":return PN(s);case"XXXX":case"XX":return Ec(s);case"XXXXX":case"XXX":default:return Ec(s,":")}},x:function(e,n,r,i){var o=i._originalDate||e,s=o.getTimezoneOffset();switch(n){case"x":return PN(s);case"xxxx":case"xx":return Ec(s);case"xxxxx":case"xxx":default:return Ec(s,":")}},O:function(e,n,r,i){var o=i._originalDate||e,s=o.getTimezoneOffset();switch(n){case"O":case"OO":case"OOO":return"GMT"+RN(s,":");case"OOOO":default:return"GMT"+Ec(s,":")}},z:function(e,n,r,i){var o=i._originalDate||e,s=o.getTimezoneOffset();switch(n){case"z":case"zz":case"zzz":return"GMT"+RN(s,":");case"zzzz":default:return"GMT"+Ec(s,":")}},t:function(e,n,r,i){var o=i._originalDate||e,s=Math.floor(o.getTime()/1e3);return un(s,n.length)},T:function(e,n,r,i){var o=i._originalDate||e,s=o.getTime();return un(s,n.length)}};function RN(t,e){var n=t>0?"-":"+",r=Math.abs(t),i=Math.floor(r/60),o=r%60;if(o===0)return n+String(i);var s=e||"";return n+String(i)+s+un(o,2)}function PN(t,e){if(t%60===0){var n=t>0?"-":"+";return n+un(Math.abs(t)/60,2)}return Ec(t,e)}function Ec(t,e){var n=e||"",r=t>0?"-":"+",i=Math.abs(t),o=un(Math.floor(i/60),2),s=un(i%60,2);return r+o+n+s}const Qie=Zie;var NN=function(e,n){switch(e){case"P":return n.date({width:"short"});case"PP":return n.date({width:"medium"});case"PPP":return n.date({width:"long"});case"PPPP":default:return n.date({width:"full"})}},i6=function(e,n){switch(e){case"p":return n.time({width:"short"});case"pp":return n.time({width:"medium"});case"ppp":return n.time({width:"long"});case"pppp":default:return n.time({width:"full"})}},Jie=function(e,n){var r=e.match(/(P+)(p+)?/)||[],i=r[1],o=r[2];if(!o)return NN(e,n);var s;switch(i){case"P":s=n.dateTime({width:"short"});break;case"PP":s=n.dateTime({width:"medium"});break;case"PPP":s=n.dateTime({width:"long"});break;case"PPPP":default:s=n.dateTime({width:"full"});break}return s.replace("{{date}}",NN(i,n)).replace("{{time}}",i6(o,n))},eoe={p:i6,P:Jie};const toe=eoe;var noe=["D","DD"],roe=["YY","YYYY"];function ioe(t){return noe.indexOf(t)!==-1}function ooe(t){return roe.indexOf(t)!==-1}function MN(t,e,n){if(t==="YYYY")throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(e,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(t==="YY")throw new RangeError("Use `yy` instead of `YY` (in `".concat(e,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(t==="D")throw new RangeError("Use `d` instead of `D` (in `".concat(e,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(t==="DD")throw new RangeError("Use `dd` instead of `DD` (in `".concat(e,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var soe={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},aoe=function(e,n,r){var i,o=soe[e];return typeof o=="string"?i=o:n===1?i=o.one:i=o.other.replace("{{count}}",n.toString()),r!=null&&r.addSuffix?r.comparison&&r.comparison>0?"in "+i:i+" ago":i};const loe=aoe;function Ix(t){return function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=e.width?String(e.width):t.defaultWidth,r=t.formats[n]||t.formats[t.defaultWidth];return r}}var coe={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},uoe={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},foe={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},doe={date:Ix({formats:coe,defaultWidth:"full"}),time:Ix({formats:uoe,defaultWidth:"full"}),dateTime:Ix({formats:foe,defaultWidth:"full"})};const hoe=doe;var poe={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},moe=function(e,n,r,i){return poe[e]};const goe=moe;function kh(t){return function(e,n){var r=n!=null&&n.context?String(n.context):"standalone",i;if(r==="formatting"&&t.formattingValues){var o=t.defaultFormattingWidth||t.defaultWidth,s=n!=null&&n.width?String(n.width):o;i=t.formattingValues[s]||t.formattingValues[o]}else{var a=t.defaultWidth,l=n!=null&&n.width?String(n.width):t.defaultWidth;i=t.values[l]||t.values[a]}var c=t.argumentCallback?t.argumentCallback(e):e;return i[c]}}var voe={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},yoe={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},boe={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},woe={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},xoe={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},Soe={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},Coe=function(e,n){var r=Number(e),i=r%100;if(i>20||i<10)switch(i%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},koe={ordinalNumber:Coe,era:kh({values:voe,defaultWidth:"wide"}),quarter:kh({values:yoe,defaultWidth:"wide",argumentCallback:function(e){return e-1}}),month:kh({values:boe,defaultWidth:"wide"}),day:kh({values:woe,defaultWidth:"wide"}),dayPeriod:kh({values:xoe,defaultWidth:"wide",formattingValues:Soe,defaultFormattingWidth:"wide"})};const Eoe=koe;function Eh(t){return function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=n.width,i=r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth],o=e.match(i);if(!o)return null;var s=o[0],a=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],l=Array.isArray(a)?Toe(a,function(d){return d.test(s)}):_oe(a,function(d){return d.test(s)}),c;c=t.valueCallback?t.valueCallback(l):l,c=n.valueCallback?n.valueCallback(c):c;var f=e.slice(s.length);return{value:c,rest:f}}}function _oe(t,e){for(var n in t)if(t.hasOwnProperty(n)&&e(t[n]))return n}function Toe(t,e){for(var n=0;n<t.length;n++)if(e(t[n]))return n}function Aoe(t){return function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=e.match(t.matchPattern);if(!r)return null;var i=r[0],o=e.match(t.parsePattern);if(!o)return null;var s=t.valueCallback?t.valueCallback(o[0]):o[0];s=n.valueCallback?n.valueCallback(s):s;var a=e.slice(i.length);return{value:s,rest:a}}}var Ooe=/^(\d+)(th|st|nd|rd)?/i,Roe=/\d+/i,Poe={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},Noe={any:[/^b/i,/^(a|c)/i]},Moe={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Doe={any:[/1/i,/2/i,/3/i,/4/i]},Loe={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},$oe={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Ioe={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},joe={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Boe={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Foe={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},zoe={ordinalNumber:Aoe({matchPattern:Ooe,parsePattern:Roe,valueCallback:function(e){return parseInt(e,10)}}),era:Eh({matchPatterns:Poe,defaultMatchWidth:"wide",parsePatterns:Noe,defaultParseWidth:"any"}),quarter:Eh({matchPatterns:Moe,defaultMatchWidth:"wide",parsePatterns:Doe,defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:Eh({matchPatterns:Loe,defaultMatchWidth:"wide",parsePatterns:$oe,defaultParseWidth:"any"}),day:Eh({matchPatterns:Ioe,defaultMatchWidth:"wide",parsePatterns:joe,defaultParseWidth:"any"}),dayPeriod:Eh({matchPatterns:Boe,defaultMatchWidth:"any",parsePatterns:Foe,defaultParseWidth:"any"})};const Voe=zoe;var Uoe={code:"en-US",formatDistance:loe,formatLong:hoe,formatRelative:goe,localize:Eoe,match:Voe,options:{weekStartsOn:0,firstWeekContainsDate:1}};const Woe=Uoe;var Hoe=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,qoe=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Koe=/^'([^]*?)'?$/,Goe=/''/g,Yoe=/[a-zA-Z]/;function Xoe(t,e,n){var r,i,o,s,a,l,c,f,d,p,m,v,b,S,x,w,C,T;mi(2,arguments);var A=String(e),_=r1(),R=(r=(i=n==null?void 0:n.locale)!==null&&i!==void 0?i:_.locale)!==null&&r!==void 0?r:Woe,M=pu((o=(s=(a=(l=n==null?void 0:n.firstWeekContainsDate)!==null&&l!==void 0?l:n==null||(c=n.locale)===null||c===void 0||(f=c.options)===null||f===void 0?void 0:f.firstWeekContainsDate)!==null&&a!==void 0?a:_.firstWeekContainsDate)!==null&&s!==void 0?s:(d=_.locale)===null||d===void 0||(p=d.options)===null||p===void 0?void 0:p.firstWeekContainsDate)!==null&&o!==void 0?o:1);if(!(M>=1&&M<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var I=pu((m=(v=(b=(S=n==null?void 0:n.weekStartsOn)!==null&&S!==void 0?S:n==null||(x=n.locale)===null||x===void 0||(w=x.options)===null||w===void 0?void 0:w.weekStartsOn)!==null&&b!==void 0?b:_.weekStartsOn)!==null&&v!==void 0?v:(C=_.locale)===null||C===void 0||(T=C.options)===null||T===void 0?void 0:T.weekStartsOn)!==null&&m!==void 0?m:0);if(!(I>=0&&I<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!R.localize)throw new RangeError("locale must contain localize property");if(!R.formatLong)throw new RangeError("locale must contain formatLong property");var V=ia(t);if(!Fie(V))throw new RangeError("Invalid time value");var U=jie(V),L=zie(V,U),G={firstWeekContainsDate:M,weekStartsOn:I,locale:R,_originalDate:V},K=A.match(qoe).map(function(F){var ie=F[0];if(ie==="p"||ie==="P"){var ae=toe[ie];return ae(F,R.formatLong)}return F}).join("").match(Hoe).map(function(F){if(F==="''")return"'";var ie=F[0];if(ie==="'")return Zoe(F);var ae=Qie[ie];if(ae)return!(n!=null&&n.useAdditionalWeekYearTokens)&&ooe(F)&&MN(F,e,String(t)),!(n!=null&&n.useAdditionalDayOfYearTokens)&&ioe(F)&&MN(F,e,String(t)),ae(L,F,R.localize,G);if(ie.match(Yoe))throw new RangeError("Format string contains an unescaped latin alphabet character `"+ie+"`");return F}).join("");return K}function Zoe(t){var e=t.match(Koe);return e?e[1].replace(Goe,"'"):t}async function ud(t,e){const n=await fetch(t,e);if(!n.ok){const r=await n.text(),i=new Error(r);throw i.status=n.status,i}return n.json()}function DN(t){return Xoe(t,"MMM dd, yyyy hh:mm a")}const Qoe=ot({name:t2,url:We().url()}),Joe=()=>{const t=c4({mode:"onChange",resolver:f4(Qoe),defaultValues:{name:"",url:""}}),e=Q5(),[n,r]=d2(async s=>{const a={name:s.name,baseUrl:s.url};try{const l=await ud(`${hu}/api/tests`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)});e(`/tests/${encodeURIComponent(l.testPath)}`)}catch(l){cd.error("Failed to create test.",{description:`${l}`})}},[]),{isDirty:i,isValid:o}=t.formState;return k.jsxs(_2,{children:[k.jsx(T2,{asChild:!0,children:k.jsxs(Tn,{children:[k.jsx(Bne,{className:"mr-2 h-4 w-4"}),"Create test"]})}),k.jsxs(Jb,{children:[k.jsx(e1,{children:k.jsx(t1,{children:"Create test"})}),k.jsx(J4,{...t,children:k.jsxs("form",{onSubmit:t.handleSubmit(r),className:"space-y-6",children:[k.jsx(ek,{control:t.control,name:"name",render:({field:s,fieldState:a})=>k.jsxs(_0,{children:[k.jsx(T0,{children:"Name"}),k.jsx(A0,{children:k.jsx(jl,{placeholder:"Checkout flow",...s})}),k.jsxs(O0,{children:["A short identifier, such as what functionality this test covers.",s.value&&!a.invalid?k.jsxs("span",{className:"block pt-2",children:["✓ Your test path will be"," ",k.jsx("span",{className:"font-mono font-medium text-green-600",children:H3(s.value)})]}):null]}),k.jsx(R0,{})]})}),k.jsx(ek,{control:t.control,name:"url",render:({field:s})=>k.jsxs(_0,{children:[k.jsx(T0,{children:"Base URL"}),k.jsx(A0,{children:k.jsx(jl,{placeholder:"https://example.com",...s})}),k.jsx(O0,{children:"URL the test will start on."}),k.jsx(R0,{})]})}),k.jsx(A2,{children:k.jsx(Tn,{type:"submit",disabled:n.loading||!i||!o,children:"Create test"})})]})})]})]})};async function ese(){const t=await ud(`${hu}/api/tests`);return{tests:rne.parse(t)}}const tse=()=>{const{tests:t}=n3();return k.jsxs("div",{className:"flex flex-col gap-4 overflow-auto p-8",children:[k.jsxs("div",{className:"flex items-center justify-between",children:[k.jsx("h2",{className:"text-3xl font-bold tracking-tight",children:"Tests"}),k.jsx("div",{className:"flex gap-2",children:k.jsx(Joe,{})})]}),k.jsxs(n2,{children:[k.jsx(r2,{children:k.jsxs(Gc,{children:[k.jsx(Bc,{children:"Name"}),k.jsx(Bc,{children:"File path"}),k.jsx(Bc,{children:"Created at"}),k.jsx(Bc,{children:"Last modified at"})]})}),k.jsxs(i2,{children:[!t.length&&k.jsx(Gc,{children:k.jsx(ka,{colSpan:5,className:"h-24 text-center",children:"No tests."})}),t.map((e,n)=>k.jsxs(Gc,{children:[k.jsx(ka,{children:k.jsx("a",{href:`/tests/${encodeURIComponent(e.testPath)}`,className:"text-blue-500 hover:underline",children:e.name})}),k.jsx(ka,{children:e.testPath}),k.jsx(ka,{children:DN(e.createdAt)}),k.jsx(ka,{children:DN(e.lastModified)})]},n))]})]})]})};var nse={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 rse=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),nr=(t,e)=>{const n=g.forwardRef(({color:r="currentColor",size:i=24,strokeWidth:o=2,absoluteStrokeWidth:s,children:a,...l},c)=>g.createElement("svg",{ref:c,...nse,width:i,height:i,stroke:r,strokeWidth:s?Number(o)*24/Number(i):o,className:`lucide lucide-${rse(t)}`,...l},[...e.map(([f,d])=>g.createElement(f,d)),...(Array.isArray(a)?a:[a])||[]]));return n.displayName=`${t}`,n},ise=nr("AlertTriangle",[["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-3Z",key:"c3ski4"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),ose=nr("CornerDownRight",[["polyline",{points:"15 10 20 15 15 20",key:"1q7qjw"}],["path",{d:"M4 4v7a4 4 0 0 0 4 4h12",key:"z08zvw"}]]),sse=nr("Expand",[["path",{d:"m21 21-6-6m6 6v-4.8m0 4.8h-4.8",key:"1c15vz"}],["path",{d:"M3 16.2V21m0 0h4.8M3 21l6-6",key:"1fsnz2"}],["path",{d:"M21 7.8V3m0 0h-4.8M21 3l-6 6",key:"hawz9i"}],["path",{d:"M3 7.8V3m0 0h4.8M3 3l6 6",key:"u9ee12"}]]),ase=nr("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]),o6=nr("Loader2",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]),lse=nr("MoveDown",[["path",{d:"M8 18L12 22L16 18",key:"cskvfv"}],["path",{d:"M12 2V22",key:"r89rzk"}]]),cse=nr("MoveUp",[["path",{d:"M8 6L12 2L16 6",key:"1yvkyx"}],["path",{d:"M12 2V22",key:"r89rzk"}]]),use=nr("Network",[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]]),fse=nr("PlayCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polygon",{points:"10 8 16 12 10 16 10 8",key:"1cimsy"}]]),dse=nr("Play",[["polygon",{points:"5 3 19 12 5 21 5 3",key:"191637"}]]),s6=nr("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]),hse=nr("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]),pse=nr("RotateCw",[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]]),mse=nr("Save",[["path",{d:"M19 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11l5 5v11a2 2 0 0 1-2 2z",key:"1owoqh"}],["polyline",{points:"17 21 17 13 7 13 7 21",key:"1md35c"}],["polyline",{points:"7 3 7 8 15 8",key:"8nz8an"}]]),gse=nr("Settings2",[["path",{d:"M20 7h-9",key:"3s1dr2"}],["path",{d:"M14 17H5",key:"gfn3mx"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]]),vse=nr("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"}]]),yse=nr("Shrink",[["path",{d:"m15 15 6 6m-6-6v4.8m0-4.8h4.8",key:"17vawe"}],["path",{d:"M9 19.8V15m0 0H4.2M9 15l-6 6",key:"chjx8e"}],["path",{d:"M15 4.2V9m0 0h4.8M15 9l6-6",key:"lav6yq"}],["path",{d:"M9 4.2V9m0 0H4.2M9 9 3 3",key:"1pxi2q"}]]),bse=nr("Trash",[["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"}]]),wse=nr("View",[["path",{d:"M5 12s2.545-5 7-5c4.454 0 7 5 7 5s-2.546 5-7 5c-4.455 0-7-5-7-5z",key:"vptub8"}],["path",{d:"M12 13a1 1 0 1 0 0-2 1 1 0 0 0 0 2z",key:"10lhjs"}],["path",{d:"M21 17v2a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-2",key:"mrq65r"}],["path",{d:"M21 7V5a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v2",key:"be3xqs"}]]),xse=nr("XOctagon",[["polygon",{points:"7.86 2 16.14 2 22 7.86 22 16.14 16.14 22 7.86 22 2 16.14 2 7.86 7.86 2",key:"h1p8hx"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]),Sse=nr("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),Cse=g.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"}),kse=t=>t;class LN{constructor(){this.order=[],this.scheduled=new Set}add(e){if(!this.scheduled.has(e))return this.scheduled.add(e),this.order.push(e),!0}remove(e){const n=this.order.indexOf(e);n!==-1&&(this.order.splice(n,1),this.scheduled.delete(e))}clear(){this.order.length=0,this.scheduled.clear()}}function Ese(t){let e=new LN,n=new LN,r=0,i=!1,o=!1;const s=new WeakSet,a={schedule:(l,c=!1,f=!1)=>{const d=f&&i,p=d?e:n;return c&&s.add(l),p.add(l)&&d&&i&&(r=e.order.length),l},cancel:l=>{n.remove(l),s.delete(l)},process:l=>{if(i){o=!0;return}if(i=!0,[e,n]=[n,e],n.clear(),r=e.order.length,r)for(let c=0;c<r;c++){const f=e.order[c];f(l),s.has(f)&&(a.schedule(f),t())}i=!1,o&&(o=!1,a.process(l))}};return a}const uv=["prepare","read","update","preRender","render","postRender"],_se=40;function Tse(t,e){let n=!1,r=!0;const i={delta:0,timestamp:0,isProcessing:!1},o=uv.reduce((d,p)=>(d[p]=Ese(()=>n=!0),d),{}),s=d=>o[d].process(i),a=()=>{const d=performance.now();n=!1,i.delta=r?1e3/60:Math.max(Math.min(d-i.timestamp,_se),1),i.timestamp=d,i.isProcessing=!0,uv.forEach(s),i.isProcessing=!1,n&&e&&(r=!1,t(a))},l=()=>{n=!0,r=!0,i.isProcessing||t(a)};return{schedule:uv.reduce((d,p)=>{const m=o[p];return d[p]=(v,b=!1,S=!1)=>(n||l(),m.schedule(v,b,S)),d},{}),cancel:d=>uv.forEach(p=>o[p].cancel(d)),state:i,steps:o}}const{schedule:Ase,cancel:Ose,state:BCe,steps:FCe}=Tse(typeof requestAnimationFrame<"u"?requestAnimationFrame:kse,!0);function Rse(t){const e=g.useRef(0),{isStatic:n}=g.useContext(Cse);g.useEffect(()=>{if(n)return;const r=({timestamp:i,delta:o})=>{e.current||(e.current=i),t(i-e.current,o)};return Ase.update(r,!0),()=>Ose(r)},[t])}const $N=5e3,Pse=t=>{const e=g.useRef(null),n=g.useRef(null);return g.useEffect(()=>{let r;if(typeof t.image=="string")r=t.image;else{const o=new Blob([t.image],{type:"image/jpeg"});r=URL.createObjectURL(o)}const i=new Image;i.onload=function(){n.current=i,URL.revokeObjectURL(r)},i.src=r},[t.image]),Rse(()=>{const r=e.current,i=n.current;if(!r||!i)return;const o=r.getContext("2d");if(!o)return;const s=t.viewport,a=s.width/s.height,l=r.getBoundingClientRect();r.width=l.width+$N,r.height=l.width*(s.height/s.width)+$N*(s.height/s.width);let c=0,f=0;r.width/r.height>a?(f=r.height,c=f*a):(c=r.width,f=c/a),o.drawImage(i,0,0,c,f)}),k.jsx("canvas",{className:"w-full",style:{imageRendering:"pixelated"},ref:e})};var tk={exports:{}};(function(t,e){(function(n,r){var i="1.0.37",o="",s="?",a="function",l="undefined",c="object",f="string",d="major",p="model",m="name",v="type",b="vendor",S="version",x="architecture",w="console",C="mobile",T="tablet",A="smarttv",_="wearable",R="embedded",M=500,I="Amazon",V="Apple",U="ASUS",L="BlackBerry",G="Browser",K="Chrome",F="Edge",ie="Firefox",ae="Google",re="Huawei",W="LG",P="Microsoft",he="Motorola",fe="Opera",$="Samsung",Ne="Sharp",He="Sony",Ye="Xiaomi",Ie="Zebra",J="Facebook",Se="Chromium OS",Ee="Mac OS",ke=function(j,ee){var de={};for(var Ae in j)ee[Ae]&&ee[Ae].length%2===0?de[Ae]=ee[Ae].concat(j[Ae]):de[Ae]=j[Ae];return de},oe=function(j){for(var ee={},de=0;de<j.length;de++)ee[j[de].toUpperCase()]=j[de];return ee},se=function(j,ee){return typeof j===f?ue(ee).indexOf(ue(j))!==-1:!1},ue=function(j){return j.toLowerCase()},we=function(j){return typeof j===f?j.replace(/[^\d\.]/g,o).split(".")[0]:r},nt=function(j,ee){if(typeof j===f)return j=j.replace(/^\s\s*/,o),typeof ee===l?j:j.substring(0,M)},et=function(j,ee){for(var de=0,Ae,Be,Te,je,Oe,Qt;de<ee.length&&!Oe;){var sn=ee[de],Lt=ee[de+1];for(Ae=Be=0;Ae<sn.length&&!Oe&&sn[Ae];)if(Oe=sn[Ae++].exec(j),Oe)for(Te=0;Te<Lt.length;Te++)Qt=Oe[++Be],je=Lt[Te],typeof je===c&&je.length>0?je.length===2?typeof je[1]==a?this[je[0]]=je[1].call(this,Qt):this[je[0]]=je[1]:je.length===3?typeof je[1]===a&&!(je[1].exec&&je[1].test)?this[je[0]]=Qt?je[1].call(this,Qt,je[2]):r:this[je[0]]=Qt?Qt.replace(je[1],je[2]):r:je.length===4&&(this[je[0]]=Qt?je[3].call(this,Qt.replace(je[1],je[2])):r):this[je]=Qt||r;de+=2}},wt=function(j,ee){for(var de in ee)if(typeof ee[de]===c&&ee[de].length>0){for(var Ae=0;Ae<ee[de].length;Ae++)if(se(ee[de][Ae],j))return de===s?r:de}else if(se(ee[de],j))return de===s?r:de;return j},nn={"1.0":"/8","1.2":"/1","1.3":"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"},z={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2","8.1":"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},X={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[S,[m,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[S,[m,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[m,S],[/opios[\/ ]+([\w\.]+)/i],[S,[m,fe+" Mini"]],[/\bopr\/([\w\.]+)/i],[S,[m,fe]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[S,[m,"Baidu"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim)\s?(?:browser)?[\/ ]?([\w\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|qq|duckduckgo)\/([-\w\.]+)/i,/(heytap|ovi)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[m,S],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[S,[m,"UC"+G]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[S,[m,"WeChat"]],[/konqueror\/([\w\.]+)/i],[S,[m,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[S,[m,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[S,[m,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[S,[m,"Smart Lenovo "+G]],[/(avast|avg)\/([\w\.]+)/i],[[m,/(.+)/,"$1 Secure "+G],S],[/\bfocus\/([\w\.]+)/i],[S,[m,ie+" Focus"]],[/\bopt\/([\w\.]+)/i],[S,[m,fe+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[S,[m,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[S,[m,"Dolphin"]],[/coast\/([\w\.]+)/i],[S,[m,fe+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[S,[m,"MIUI "+G]],[/fxios\/([-\w\.]+)/i],[S,[m,ie]],[/\bqihu|(qi?ho?o?|360)browser/i],[[m,"360 "+G]],[/(oculus|sailfish|huawei|vivo)browser\/([\w\.]+)/i],[[m,/(.+)/,"$1 "+G],S],[/samsungbrowser\/([\w\.]+)/i],[S,[m,$+" Internet"]],[/(comodo_dragon)\/([\w\.]+)/i],[[m,/_/g," "],S],[/metasr[\/ ]?([\d\.]+)/i],[S,[m,"Sogou Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[m,"Sogou Mobile"],S],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345Explorer)[\/ ]?([\w\.]+)/i],[m,S],[/(lbbrowser)/i,/\[(linkedin)app\]/i],[m],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[m,J],S],[/(Klarna)\/([\w\.]+)/i,/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i],[m,S],[/\bgsa\/([\w\.]+) .*safari\//i],[S,[m,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[S,[m,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[S,[m,K+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[m,K+" WebView"],S],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[S,[m,"Android "+G]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[m,S],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[S,[m,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[S,m],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[m,[S,wt,nn]],[/(webkit|khtml)\/([\w\.]+)/i],[m,S],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[m,"Netscape"],S],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[S,[m,ie+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i,/panasonic;(viera)/i],[m,S],[/(cobalt)\/([\w\.]+)/i],[m,[S,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[x,"amd64"]],[/(ia32(?=;))/i],[[x,ue]],[/((?:i[346]|x)86)[;\)]/i],[[x,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[x,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[x,"armhf"]],[/windows (ce|mobile); ppc;/i],[[x,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[x,/ower/,o,ue]],[/(sun4\w)[;\)]/i],[[x,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[x,ue]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[p,[b,$],[v,T]],[/\b((?:s[cgp]h|gt|sm)-\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[p,[b,$],[v,C]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[p,[b,V],[v,C]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[p,[b,V],[v,T]],[/(macintosh);/i],[p,[b,V]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[p,[b,Ne],[v,C]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[p,[b,re],[v,T]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[p,[b,re],[v,C]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[p,/_/g," "],[b,Ye],[v,C]],[/oid[^\)]+; (2\d{4}(283|rpbf)[cgl])( bui|\))/i,/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[p,/_/g," "],[b,Ye],[v,T]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[p,[b,"OPPO"],[v,C]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[p,[b,"Vivo"],[v,C]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[p,[b,"Realme"],[v,C]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[p,[b,he],[v,C]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[p,[b,he],[v,T]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[p,[b,W],[v,T]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[p,[b,W],[v,C]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[p,[b,"Lenovo"],[v,T]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[p,/_/g," "],[b,"Nokia"],[v,C]],[/(pixel c)\b/i],[p,[b,ae],[v,T]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[p,[b,ae],[v,C]],[/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[p,[b,He],[v,C]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[p,"Xperia Tablet"],[b,He],[v,T]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[p,[b,"OnePlus"],[v,C]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[p,[b,I],[v,T]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[p,/(.+)/g,"Fire Phone $1"],[b,I],[v,C]],[/(playbook);[-\w\),; ]+(rim)/i],[p,b,[v,T]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[p,[b,L],[v,C]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[p,[b,U],[v,T]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[p,[b,U],[v,C]],[/(nexus 9)/i],[p,[b,"HTC"],[v,T]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[b,[p,/_/g," "],[v,C]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[p,[b,"Acer"],[v,T]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[p,[b,"Meizu"],[v,C]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[p,[b,"Ulefone"],[v,C]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron|infinix|tecno)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[b,p,[v,C]],[/(kobo)\s(ereader|touch)/i,/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[b,p,[v,T]],[/(surface duo)/i],[p,[b,P],[v,T]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[p,[b,"Fairphone"],[v,C]],[/(u304aa)/i],[p,[b,"AT&T"],[v,C]],[/\bsie-(\w*)/i],[p,[b,"Siemens"],[v,C]],[/\b(rct\w+) b/i],[p,[b,"RCA"],[v,T]],[/\b(venue[\d ]{2,7}) b/i],[p,[b,"Dell"],[v,T]],[/\b(q(?:mv|ta)\w+) b/i],[p,[b,"Verizon"],[v,T]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[p,[b,"Barnes & Noble"],[v,T]],[/\b(tm\d{3}\w+) b/i],[p,[b,"NuVision"],[v,T]],[/\b(k88) b/i],[p,[b,"ZTE"],[v,T]],[/\b(nx\d{3}j) b/i],[p,[b,"ZTE"],[v,C]],[/\b(gen\d{3}) b.+49h/i],[p,[b,"Swiss"],[v,C]],[/\b(zur\d{3}) b/i],[p,[b,"Swiss"],[v,T]],[/\b((zeki)?tb.*\b) b/i],[p,[b,"Zeki"],[v,T]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[b,"Dragon Touch"],p,[v,T]],[/\b(ns-?\w{0,9}) b/i],[p,[b,"Insignia"],[v,T]],[/\b((nxa|next)-?\w{0,9}) b/i],[p,[b,"NextBook"],[v,T]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[b,"Voice"],p,[v,C]],[/\b(lvtel\-)?(v1[12]) b/i],[[b,"LvTel"],p,[v,C]],[/\b(ph-1) /i],[p,[b,"Essential"],[v,C]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[p,[b,"Envizen"],[v,T]],[/\b(trio[-\w\. ]+) b/i],[p,[b,"MachSpeed"],[v,T]],[/\btu_(1491) b/i],[p,[b,"Rotor"],[v,T]],[/(shield[\w ]+) b/i],[p,[b,"Nvidia"],[v,T]],[/(sprint) (\w+)/i],[b,p,[v,C]],[/(kin\.[onetw]{3})/i],[[p,/\./g," "],[b,P],[v,C]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[p,[b,Ie],[v,T]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[p,[b,Ie],[v,C]],[/smart-tv.+(samsung)/i],[b,[v,A]],[/hbbtv.+maple;(\d+)/i],[[p,/^/,"SmartTV"],[b,$],[v,A]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[b,W],[v,A]],[/(apple) ?tv/i],[b,[p,V+" TV"],[v,A]],[/crkey/i],[[p,K+"cast"],[b,ae],[v,A]],[/droid.+aft(\w+)( bui|\))/i],[p,[b,I],[v,A]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[p,[b,Ne],[v,A]],[/(bravia[\w ]+)( bui|\))/i],[p,[b,He],[v,A]],[/(mitv-\w{5}) bui/i],[p,[b,Ye],[v,A]],[/Hbbtv.*(technisat) (.*);/i],[b,p,[v,A]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[b,nt],[p,nt],[v,A]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[v,A]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[b,p,[v,w]],[/droid.+; (shield) bui/i],[p,[b,"Nvidia"],[v,w]],[/(playstation [345portablevi]+)/i],[p,[b,He],[v,w]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[p,[b,P],[v,w]],[/((pebble))app/i],[b,p,[v,_]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[p,[b,V],[v,_]],[/droid.+; (glass) \d/i],[p,[b,ae],[v,_]],[/droid.+; (wt63?0{2,3})\)/i],[p,[b,Ie],[v,_]],[/(quest( 2| pro)?)/i],[p,[b,J],[v,_]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[b,[v,R]],[/(aeobc)\b/i],[p,[b,I],[v,R]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[p,[v,C]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[p,[v,T]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[v,T]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[v,C]],[/(android[-\w\. ]{0,9});.+buil/i],[p,[b,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[S,[m,F+"HTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[S,[m,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[m,S],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[S,m]],os:[[/microsoft (windows) (vista|xp)/i],[m,S],[/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i],[m,[S,wt,z]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[S,wt,z],[m,"Windows"]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[S,/_/g,"."],[m,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[m,Ee],[S,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[S,m],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[m,S],[/\(bb(10);/i],[S,[m,L]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[S,[m,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[S,[m,ie+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[S,[m,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[S,[m,"watchOS"]],[/crkey\/([\d\.]+)/i],[S,[m,K+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[m,Se],S],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[m,S],[/(sunos) ?([\w\.\d]*)/i],[[m,"Solaris"],S],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[m,S]]},ne=function(j,ee){if(typeof j===c&&(ee=j,j=r),!(this instanceof ne))return new ne(j,ee).getResult();var de=typeof n!==l&&n.navigator?n.navigator:r,Ae=j||(de&&de.userAgent?de.userAgent:o),Be=de&&de.userAgentData?de.userAgentData:r,Te=ee?ke(X,ee):X,je=de&&de.userAgent==Ae;return this.getBrowser=function(){var Oe={};return Oe[m]=r,Oe[S]=r,et.call(Oe,Ae,Te.browser),Oe[d]=we(Oe[S]),je&&de&&de.brave&&typeof de.brave.isBrave==a&&(Oe[m]="Brave"),Oe},this.getCPU=function(){var Oe={};return Oe[x]=r,et.call(Oe,Ae,Te.cpu),Oe},this.getDevice=function(){var Oe={};return Oe[b]=r,Oe[p]=r,Oe[v]=r,et.call(Oe,Ae,Te.device),je&&!Oe[v]&&Be&&Be.mobile&&(Oe[v]=C),je&&Oe[p]=="Macintosh"&&de&&typeof de.standalone!==l&&de.maxTouchPoints&&de.maxTouchPoints>2&&(Oe[p]="iPad",Oe[v]=T),Oe},this.getEngine=function(){var Oe={};return Oe[m]=r,Oe[S]=r,et.call(Oe,Ae,Te.engine),Oe},this.getOS=function(){var Oe={};return Oe[m]=r,Oe[S]=r,et.call(Oe,Ae,Te.os),je&&!Oe[m]&&Be&&Be.platform!="Unknown"&&(Oe[m]=Be.platform.replace(/chrome os/i,Se).replace(/macos/i,Ee)),Oe},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return Ae},this.setUA=function(Oe){return Ae=typeof Oe===f&&Oe.length>M?nt(Oe,M):Oe,this},this.setUA(Ae),this};ne.VERSION=i,ne.BROWSER=oe([m,S,d]),ne.CPU=oe([x]),ne.DEVICE=oe([p,b,v,w,C,A,T,_,R]),ne.ENGINE=ne.OS=oe([m,S]),t.exports&&(e=t.exports=ne),e.UAParser=ne;var _e=typeof n!==l&&(n.jQuery||n.Zepto);if(_e&&!_e.ua){var Ce=new ne;_e.ua=Ce.getResult(),_e.ua.get=function(){return Ce.getUA()},_e.ua.set=function(j){Ce.setUA(j);var ee=Ce.getResult();for(var de in ee)_e.ua[de]=ee[de]}}})(typeof window=="object"?window:fn)})(tk,tk.exports);var Nse=tk.exports;const Mse=Su(Nse),Dse=t=>{const e=g.useMemo(()=>new Mse(t.userAgent).getResult(),[t.userAgent]);return k.jsxs(Ls,{children:[k.jsx($s,{children:k.jsx(ase,{className:"h-4 w-4 text-gray-600"})}),k.jsx(ss,{side:"bottom",children:t.userAgent&&t.viewport?k.jsxs("div",{className:"grid grid-cols-[auto_1fr] gap-2 text-sm",children:[k.jsx("div",{children:"OS"}),k.jsxs("div",{className:"text-right",children:[e.os.name," ",e.os.version]}),k.jsx("div",{children:"Browser"}),k.jsxs("div",{className:"text-right",children:[e.browser.name," ",e.browser.version]}),k.jsx("div",{children:"Window size"}),k.jsxs("div",{className:"text-right",children:[t.viewport.width,"x",t.viewport.height]})]}):k.jsx("div",{children:"No info available."})})]})},Lse=t=>k.jsxs("div",{className:"overflow-hidden rounded-md border",children:[k.jsxs("div",{className:"flex h-10 items-center justify-between gap-3 rounded-t-md border-b bg-gray-100 px-3",children:[k.jsxs("div",{className:"flex gap-1.5",children:[k.jsx("div",{className:"h-3 w-3 rounded-full bg-red-400"}),k.jsx("div",{className:"h-3 w-3 rounded-full bg-yellow-400"}),k.jsx("div",{className:"h-3 w-3 rounded-full bg-green-400"})]}),k.jsx("div",{className:"flex max-w-[50%] flex-grow items-center justify-between rounded-full bg-gray-200 px-3 py-1",children:k.jsxs("div",{className:"relative flex w-full items-center justify-center rounded-lg text-gray-600 ",children:[k.jsx("div",{className:"flex w-full max-w-[90%] items-center justify-center",children:k.jsx("span",{className:"relative overflow-hidden truncate text-xs",children:t.url})}),t.readonly?null:k.jsxs(Ls,{children:[k.jsx($s,{asChild:!0,children:k.jsx("div",{className:"group absolute right-0 flex h-[20px] w-[20px] cursor-pointer items-center justify-center rounded-md bg-transparent transition-all",onClick:t.onReset,tabIndex:0,role:"button",children:k.jsx(hse,{className:"h-3 w-3 cursor-pointer text-gray-600"})})}),k.jsx(ss,{side:"bottom",className:"w-52",children:"Reset the browser. This will clear cookie and session data."})]})]})}),k.jsx(Dse,{userAgent:t.userAgent,viewport:t.viewport})]}),t.image&&t.viewport?k.jsx(Pse,{image:t.image,viewport:t.viewport}):t.error?k.jsxs("div",{className:"flex h-[600px] flex-col items-center justify-center gap-2",children:[k.jsx("h2",{className:"text-xl font-semibold",children:"An unexpected error happened!"}),k.jsxs("div",{className:"text-destructive max-w-lg",children:["Error: ",t.error]}),k.jsxs("div",{className:"text-muted-foreground max-w-lg",children:["We apologize for the inconvenience. Our engineers have been notified of this problem and will work to resolve it. If the issue persists please contact"," ",k.jsx("a",{href:"mailto:support@momentic.ai",className:"text-blue-500 hover:underline",children:"support@momentic.ai"}),"."]}),k.jsx(Tn,{variant:"outline",onClick:t.onReconnect,children:"Reconnect"})]}):k.jsx("div",{className:"flex h-[600px] items-center justify-center",children:k.jsx("h2",{children:t.placeholder||"Starting browser..."})})]});var a6={exports:{}},Vh={exports:{}};/**
167
+ * @license
168
+ * Lodash <https://lodash.com/>
169
+ * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
170
+ * Released under MIT license <https://lodash.com/license>
171
+ * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
172
+ * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
173
+ */Vh.exports;var IN;function $se(){return IN||(IN=1,function(t,e){(function(){var n,r="4.17.21",i=200,o="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",s="Expected a function",a="Invalid `variable` option passed into `_.template`",l="__lodash_hash_undefined__",c=500,f="__lodash_placeholder__",d=1,p=2,m=4,v=1,b=2,S=1,x=2,w=4,C=8,T=16,A=32,_=64,R=128,M=256,I=512,V=30,U="...",L=800,G=16,K=1,F=2,ie=3,ae=1/0,re=9007199254740991,W=17976931348623157e292,P=NaN,he=4294967295,fe=he-1,$=he>>>1,Ne=[["ary",R],["bind",S],["bindKey",x],["curry",C],["curryRight",T],["flip",I],["partial",A],["partialRight",_],["rearg",M]],He="[object Arguments]",Ye="[object Array]",Ie="[object AsyncFunction]",J="[object Boolean]",Se="[object Date]",Ee="[object DOMException]",ke="[object Error]",oe="[object Function]",se="[object GeneratorFunction]",ue="[object Map]",we="[object Number]",nt="[object Null]",et="[object Object]",wt="[object Promise]",nn="[object Proxy]",z="[object RegExp]",X="[object Set]",ne="[object String]",_e="[object Symbol]",Ce="[object Undefined]",j="[object WeakMap]",ee="[object WeakSet]",de="[object ArrayBuffer]",Ae="[object DataView]",Be="[object Float32Array]",Te="[object Float64Array]",je="[object Int8Array]",Oe="[object Int16Array]",Qt="[object Int32Array]",sn="[object Uint8Array]",Lt="[object Uint8ClampedArray]",Kt="[object Uint16Array]",Pt="[object Uint32Array]",fo=/\b__p \+= '';/g,ei=/\b(__p \+=) '' \+/g,Li=/(__e\(.*?\)|\b__t\)) \+\n'';/g,kr=/&(?:amp|lt|gt|quot|#39);/g,ti=/[&<>"']/g,Y=RegExp(kr.source),te=RegExp(ti.source),pe=/<%-([\s\S]+?)%>/g,Me=/<%([\s\S]+?)%>/g,Ue=/<%=([\s\S]+?)%>/g,at=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,it=/^\w*$/,st=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,qe=/[\\^$.*+?()[\]{}|]/g,pt=RegExp(qe.source),qt=/^\s+/,lt=/\s/,Nt=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,rn=/\{\n\/\* \[wrapped with (.+)\] \*/,zr=/,? & /,zn=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Vn=/[()=,{}\[\]\/\s]/,cr=/\\(\\)?/g,Yn=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Pn=/\w*$/,$i=/^[-+]0x[0-9a-f]+$/i,Er=/^0b[01]+$/i,Ya=/^\[object .+?Constructor\]$/,Xa=/^0o[0-7]+$/i,Wo=/^(?:0|[1-9]\d*)$/,la=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Vt=/($^)/,an=/['\n\r\u2028\u2029\\]/g,_r="\\ud800-\\udfff",Za="\\u0300-\\u036f",uc="\\ufe20-\\ufe2f",Hd="\\u20d0-\\u20ff",Ym=Za+uc+Hd,Xm="\\u2700-\\u27bf",Zm="a-z\\xdf-\\xf6\\xf8-\\xff",qd="\\xac\\xb1\\xd7\\xf7",hz="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",pz="\\u2000-\\u206f",mz=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",UT="A-Z\\xc0-\\xd6\\xd8-\\xde",WT="\\ufe0e\\ufe0f",HT=qd+hz+pz+mz,B1="['’]",gz="["+_r+"]",qT="["+HT+"]",Qm="["+Ym+"]",KT="\\d+",vz="["+Xm+"]",GT="["+Zm+"]",YT="[^"+_r+HT+KT+Xm+Zm+UT+"]",F1="\\ud83c[\\udffb-\\udfff]",yz="(?:"+Qm+"|"+F1+")",XT="[^"+_r+"]",z1="(?:\\ud83c[\\udde6-\\uddff]){2}",V1="[\\ud800-\\udbff][\\udc00-\\udfff]",Du="["+UT+"]",ZT="\\u200d",QT="(?:"+GT+"|"+YT+")",bz="(?:"+Du+"|"+YT+")",JT="(?:"+B1+"(?:d|ll|m|re|s|t|ve))?",eA="(?:"+B1+"(?:D|LL|M|RE|S|T|VE))?",tA=yz+"?",nA="["+WT+"]?",wz="(?:"+ZT+"(?:"+[XT,z1,V1].join("|")+")"+nA+tA+")*",xz="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Sz="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",rA=nA+tA+wz,Cz="(?:"+[vz,z1,V1].join("|")+")"+rA,kz="(?:"+[XT+Qm+"?",Qm,z1,V1,gz].join("|")+")",Ez=RegExp(B1,"g"),_z=RegExp(Qm,"g"),U1=RegExp(F1+"(?="+F1+")|"+kz+rA,"g"),Tz=RegExp([Du+"?"+GT+"+"+JT+"(?="+[qT,Du,"$"].join("|")+")",bz+"+"+eA+"(?="+[qT,Du+QT,"$"].join("|")+")",Du+"?"+QT+"+"+JT,Du+"+"+eA,Sz,xz,KT,Cz].join("|"),"g"),Az=RegExp("["+ZT+_r+Ym+WT+"]"),Oz=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Rz=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Pz=-1,Cn={};Cn[Be]=Cn[Te]=Cn[je]=Cn[Oe]=Cn[Qt]=Cn[sn]=Cn[Lt]=Cn[Kt]=Cn[Pt]=!0,Cn[He]=Cn[Ye]=Cn[de]=Cn[J]=Cn[Ae]=Cn[Se]=Cn[ke]=Cn[oe]=Cn[ue]=Cn[we]=Cn[et]=Cn[z]=Cn[X]=Cn[ne]=Cn[j]=!1;var vn={};vn[He]=vn[Ye]=vn[de]=vn[Ae]=vn[J]=vn[Se]=vn[Be]=vn[Te]=vn[je]=vn[Oe]=vn[Qt]=vn[ue]=vn[we]=vn[et]=vn[z]=vn[X]=vn[ne]=vn[_e]=vn[sn]=vn[Lt]=vn[Kt]=vn[Pt]=!0,vn[ke]=vn[oe]=vn[j]=!1;var Nz={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},Mz={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Dz={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},Lz={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},$z=parseFloat,Iz=parseInt,iA=typeof fn=="object"&&fn&&fn.Object===Object&&fn,jz=typeof self=="object"&&self&&self.Object===Object&&self,Tr=iA||jz||Function("return this")(),W1=e&&!e.nodeType&&e,fc=W1&&!0&&t&&!t.nodeType&&t,oA=fc&&fc.exports===W1,H1=oA&&iA.process,ho=function(){try{var Z=fc&&fc.require&&fc.require("util").types;return Z||H1&&H1.binding&&H1.binding("util")}catch{}}(),sA=ho&&ho.isArrayBuffer,aA=ho&&ho.isDate,lA=ho&&ho.isMap,cA=ho&&ho.isRegExp,uA=ho&&ho.isSet,fA=ho&&ho.isTypedArray;function Ii(Z,ge,ce){switch(ce.length){case 0:return Z.call(ge);case 1:return Z.call(ge,ce[0]);case 2:return Z.call(ge,ce[0],ce[1]);case 3:return Z.call(ge,ce[0],ce[1],ce[2])}return Z.apply(ge,ce)}function Bz(Z,ge,ce,Xe){for(var xt=-1,Jt=Z==null?0:Z.length;++xt<Jt;){var ur=Z[xt];ge(Xe,ur,ce(ur),Z)}return Xe}function po(Z,ge){for(var ce=-1,Xe=Z==null?0:Z.length;++ce<Xe&&ge(Z[ce],ce,Z)!==!1;);return Z}function Fz(Z,ge){for(var ce=Z==null?0:Z.length;ce--&&ge(Z[ce],ce,Z)!==!1;);return Z}function dA(Z,ge){for(var ce=-1,Xe=Z==null?0:Z.length;++ce<Xe;)if(!ge(Z[ce],ce,Z))return!1;return!0}function Qa(Z,ge){for(var ce=-1,Xe=Z==null?0:Z.length,xt=0,Jt=[];++ce<Xe;){var ur=Z[ce];ge(ur,ce,Z)&&(Jt[xt++]=ur)}return Jt}function Jm(Z,ge){var ce=Z==null?0:Z.length;return!!ce&&Lu(Z,ge,0)>-1}function q1(Z,ge,ce){for(var Xe=-1,xt=Z==null?0:Z.length;++Xe<xt;)if(ce(ge,Z[Xe]))return!0;return!1}function Nn(Z,ge){for(var ce=-1,Xe=Z==null?0:Z.length,xt=Array(Xe);++ce<Xe;)xt[ce]=ge(Z[ce],ce,Z);return xt}function Ja(Z,ge){for(var ce=-1,Xe=ge.length,xt=Z.length;++ce<Xe;)Z[xt+ce]=ge[ce];return Z}function K1(Z,ge,ce,Xe){var xt=-1,Jt=Z==null?0:Z.length;for(Xe&&Jt&&(ce=Z[++xt]);++xt<Jt;)ce=ge(ce,Z[xt],xt,Z);return ce}function zz(Z,ge,ce,Xe){var xt=Z==null?0:Z.length;for(Xe&&xt&&(ce=Z[--xt]);xt--;)ce=ge(ce,Z[xt],xt,Z);return ce}function G1(Z,ge){for(var ce=-1,Xe=Z==null?0:Z.length;++ce<Xe;)if(ge(Z[ce],ce,Z))return!0;return!1}var Vz=Y1("length");function Uz(Z){return Z.split("")}function Wz(Z){return Z.match(zn)||[]}function hA(Z,ge,ce){var Xe;return ce(Z,function(xt,Jt,ur){if(ge(xt,Jt,ur))return Xe=Jt,!1}),Xe}function eg(Z,ge,ce,Xe){for(var xt=Z.length,Jt=ce+(Xe?1:-1);Xe?Jt--:++Jt<xt;)if(ge(Z[Jt],Jt,Z))return Jt;return-1}function Lu(Z,ge,ce){return ge===ge?nV(Z,ge,ce):eg(Z,pA,ce)}function Hz(Z,ge,ce,Xe){for(var xt=ce-1,Jt=Z.length;++xt<Jt;)if(Xe(Z[xt],ge))return xt;return-1}function pA(Z){return Z!==Z}function mA(Z,ge){var ce=Z==null?0:Z.length;return ce?Z1(Z,ge)/ce:P}function Y1(Z){return function(ge){return ge==null?n:ge[Z]}}function X1(Z){return function(ge){return Z==null?n:Z[ge]}}function gA(Z,ge,ce,Xe,xt){return xt(Z,function(Jt,ur,mn){ce=Xe?(Xe=!1,Jt):ge(ce,Jt,ur,mn)}),ce}function qz(Z,ge){var ce=Z.length;for(Z.sort(ge);ce--;)Z[ce]=Z[ce].value;return Z}function Z1(Z,ge){for(var ce,Xe=-1,xt=Z.length;++Xe<xt;){var Jt=ge(Z[Xe]);Jt!==n&&(ce=ce===n?Jt:ce+Jt)}return ce}function Q1(Z,ge){for(var ce=-1,Xe=Array(Z);++ce<Z;)Xe[ce]=ge(ce);return Xe}function Kz(Z,ge){return Nn(ge,function(ce){return[ce,Z[ce]]})}function vA(Z){return Z&&Z.slice(0,xA(Z)+1).replace(qt,"")}function ji(Z){return function(ge){return Z(ge)}}function J1(Z,ge){return Nn(ge,function(ce){return Z[ce]})}function Kd(Z,ge){return Z.has(ge)}function yA(Z,ge){for(var ce=-1,Xe=Z.length;++ce<Xe&&Lu(ge,Z[ce],0)>-1;);return ce}function bA(Z,ge){for(var ce=Z.length;ce--&&Lu(ge,Z[ce],0)>-1;);return ce}function Gz(Z,ge){for(var ce=Z.length,Xe=0;ce--;)Z[ce]===ge&&++Xe;return Xe}var Yz=X1(Nz),Xz=X1(Mz);function Zz(Z){return"\\"+Lz[Z]}function Qz(Z,ge){return Z==null?n:Z[ge]}function $u(Z){return Az.test(Z)}function Jz(Z){return Oz.test(Z)}function eV(Z){for(var ge,ce=[];!(ge=Z.next()).done;)ce.push(ge.value);return ce}function ew(Z){var ge=-1,ce=Array(Z.size);return Z.forEach(function(Xe,xt){ce[++ge]=[xt,Xe]}),ce}function wA(Z,ge){return function(ce){return Z(ge(ce))}}function el(Z,ge){for(var ce=-1,Xe=Z.length,xt=0,Jt=[];++ce<Xe;){var ur=Z[ce];(ur===ge||ur===f)&&(Z[ce]=f,Jt[xt++]=ce)}return Jt}function tg(Z){var ge=-1,ce=Array(Z.size);return Z.forEach(function(Xe){ce[++ge]=Xe}),ce}function tV(Z){var ge=-1,ce=Array(Z.size);return Z.forEach(function(Xe){ce[++ge]=[Xe,Xe]}),ce}function nV(Z,ge,ce){for(var Xe=ce-1,xt=Z.length;++Xe<xt;)if(Z[Xe]===ge)return Xe;return-1}function rV(Z,ge,ce){for(var Xe=ce+1;Xe--;)if(Z[Xe]===ge)return Xe;return Xe}function Iu(Z){return $u(Z)?oV(Z):Vz(Z)}function Ho(Z){return $u(Z)?sV(Z):Uz(Z)}function xA(Z){for(var ge=Z.length;ge--&&lt.test(Z.charAt(ge)););return ge}var iV=X1(Dz);function oV(Z){for(var ge=U1.lastIndex=0;U1.test(Z);)++ge;return ge}function sV(Z){return Z.match(U1)||[]}function aV(Z){return Z.match(Tz)||[]}var lV=function Z(ge){ge=ge==null?Tr:ju.defaults(Tr.Object(),ge,ju.pick(Tr,Rz));var ce=ge.Array,Xe=ge.Date,xt=ge.Error,Jt=ge.Function,ur=ge.Math,mn=ge.Object,tw=ge.RegExp,cV=ge.String,mo=ge.TypeError,ng=ce.prototype,uV=Jt.prototype,Bu=mn.prototype,rg=ge["__core-js_shared__"],ig=uV.toString,ln=Bu.hasOwnProperty,fV=0,SA=function(){var u=/[^.]+$/.exec(rg&&rg.keys&&rg.keys.IE_PROTO||"");return u?"Symbol(src)_1."+u:""}(),og=Bu.toString,dV=ig.call(mn),hV=Tr._,pV=tw("^"+ig.call(ln).replace(qe,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),sg=oA?ge.Buffer:n,tl=ge.Symbol,ag=ge.Uint8Array,CA=sg?sg.allocUnsafe:n,lg=wA(mn.getPrototypeOf,mn),kA=mn.create,EA=Bu.propertyIsEnumerable,cg=ng.splice,_A=tl?tl.isConcatSpreadable:n,Gd=tl?tl.iterator:n,dc=tl?tl.toStringTag:n,ug=function(){try{var u=vc(mn,"defineProperty");return u({},"",{}),u}catch{}}(),mV=ge.clearTimeout!==Tr.clearTimeout&&ge.clearTimeout,gV=Xe&&Xe.now!==Tr.Date.now&&Xe.now,vV=ge.setTimeout!==Tr.setTimeout&&ge.setTimeout,fg=ur.ceil,dg=ur.floor,nw=mn.getOwnPropertySymbols,yV=sg?sg.isBuffer:n,TA=ge.isFinite,bV=ng.join,wV=wA(mn.keys,mn),fr=ur.max,Vr=ur.min,xV=Xe.now,SV=ge.parseInt,AA=ur.random,CV=ng.reverse,rw=vc(ge,"DataView"),Yd=vc(ge,"Map"),iw=vc(ge,"Promise"),Fu=vc(ge,"Set"),Xd=vc(ge,"WeakMap"),Zd=vc(mn,"create"),hg=Xd&&new Xd,zu={},kV=yc(rw),EV=yc(Yd),_V=yc(iw),TV=yc(Fu),AV=yc(Xd),pg=tl?tl.prototype:n,Qd=pg?pg.valueOf:n,OA=pg?pg.toString:n;function N(u){if(Un(u)&&!Ct(u)&&!(u instanceof Ft)){if(u instanceof go)return u;if(ln.call(u,"__wrapped__"))return RO(u)}return new go(u)}var Vu=function(){function u(){}return function(h){if(!$n(h))return{};if(kA)return kA(h);u.prototype=h;var y=new u;return u.prototype=n,y}}();function mg(){}function go(u,h){this.__wrapped__=u,this.__actions__=[],this.__chain__=!!h,this.__index__=0,this.__values__=n}N.templateSettings={escape:pe,evaluate:Me,interpolate:Ue,variable:"",imports:{_:N}},N.prototype=mg.prototype,N.prototype.constructor=N,go.prototype=Vu(mg.prototype),go.prototype.constructor=go;function Ft(u){this.__wrapped__=u,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=he,this.__views__=[]}function OV(){var u=new Ft(this.__wrapped__);return u.__actions__=gi(this.__actions__),u.__dir__=this.__dir__,u.__filtered__=this.__filtered__,u.__iteratees__=gi(this.__iteratees__),u.__takeCount__=this.__takeCount__,u.__views__=gi(this.__views__),u}function RV(){if(this.__filtered__){var u=new Ft(this);u.__dir__=-1,u.__filtered__=!0}else u=this.clone(),u.__dir__*=-1;return u}function PV(){var u=this.__wrapped__.value(),h=this.__dir__,y=Ct(u),E=h<0,O=y?u.length:0,D=UU(0,O,this.__views__),B=D.start,q=D.end,Q=q-B,ve=E?q:B-1,ye=this.__iteratees__,xe=ye.length,Ve=0,rt=Vr(Q,this.__takeCount__);if(!y||!E&&O==Q&&rt==Q)return JA(u,this.__actions__);var mt=[];e:for(;Q--&&Ve<rt;){ve+=h;for(var Tt=-1,gt=u[ve];++Tt<xe;){var It=ye[Tt],Ut=It.iteratee,zi=It.type,ii=Ut(gt);if(zi==F)gt=ii;else if(!ii){if(zi==K)continue e;break e}}mt[Ve++]=gt}return mt}Ft.prototype=Vu(mg.prototype),Ft.prototype.constructor=Ft;function hc(u){var h=-1,y=u==null?0:u.length;for(this.clear();++h<y;){var E=u[h];this.set(E[0],E[1])}}function NV(){this.__data__=Zd?Zd(null):{},this.size=0}function MV(u){var h=this.has(u)&&delete this.__data__[u];return this.size-=h?1:0,h}function DV(u){var h=this.__data__;if(Zd){var y=h[u];return y===l?n:y}return ln.call(h,u)?h[u]:n}function LV(u){var h=this.__data__;return Zd?h[u]!==n:ln.call(h,u)}function $V(u,h){var y=this.__data__;return this.size+=this.has(u)?0:1,y[u]=Zd&&h===n?l:h,this}hc.prototype.clear=NV,hc.prototype.delete=MV,hc.prototype.get=DV,hc.prototype.has=LV,hc.prototype.set=$V;function ca(u){var h=-1,y=u==null?0:u.length;for(this.clear();++h<y;){var E=u[h];this.set(E[0],E[1])}}function IV(){this.__data__=[],this.size=0}function jV(u){var h=this.__data__,y=gg(h,u);if(y<0)return!1;var E=h.length-1;return y==E?h.pop():cg.call(h,y,1),--this.size,!0}function BV(u){var h=this.__data__,y=gg(h,u);return y<0?n:h[y][1]}function FV(u){return gg(this.__data__,u)>-1}function zV(u,h){var y=this.__data__,E=gg(y,u);return E<0?(++this.size,y.push([u,h])):y[E][1]=h,this}ca.prototype.clear=IV,ca.prototype.delete=jV,ca.prototype.get=BV,ca.prototype.has=FV,ca.prototype.set=zV;function ua(u){var h=-1,y=u==null?0:u.length;for(this.clear();++h<y;){var E=u[h];this.set(E[0],E[1])}}function VV(){this.size=0,this.__data__={hash:new hc,map:new(Yd||ca),string:new hc}}function UV(u){var h=Ag(this,u).delete(u);return this.size-=h?1:0,h}function WV(u){return Ag(this,u).get(u)}function HV(u){return Ag(this,u).has(u)}function qV(u,h){var y=Ag(this,u),E=y.size;return y.set(u,h),this.size+=y.size==E?0:1,this}ua.prototype.clear=VV,ua.prototype.delete=UV,ua.prototype.get=WV,ua.prototype.has=HV,ua.prototype.set=qV;function pc(u){var h=-1,y=u==null?0:u.length;for(this.__data__=new ua;++h<y;)this.add(u[h])}function KV(u){return this.__data__.set(u,l),this}function GV(u){return this.__data__.has(u)}pc.prototype.add=pc.prototype.push=KV,pc.prototype.has=GV;function qo(u){var h=this.__data__=new ca(u);this.size=h.size}function YV(){this.__data__=new ca,this.size=0}function XV(u){var h=this.__data__,y=h.delete(u);return this.size=h.size,y}function ZV(u){return this.__data__.get(u)}function QV(u){return this.__data__.has(u)}function JV(u,h){var y=this.__data__;if(y instanceof ca){var E=y.__data__;if(!Yd||E.length<i-1)return E.push([u,h]),this.size=++y.size,this;y=this.__data__=new ua(E)}return y.set(u,h),this.size=y.size,this}qo.prototype.clear=YV,qo.prototype.delete=XV,qo.prototype.get=ZV,qo.prototype.has=QV,qo.prototype.set=JV;function RA(u,h){var y=Ct(u),E=!y&&bc(u),O=!y&&!E&&sl(u),D=!y&&!E&&!O&&qu(u),B=y||E||O||D,q=B?Q1(u.length,cV):[],Q=q.length;for(var ve in u)(h||ln.call(u,ve))&&!(B&&(ve=="length"||O&&(ve=="offset"||ve=="parent")||D&&(ve=="buffer"||ve=="byteLength"||ve=="byteOffset")||pa(ve,Q)))&&q.push(ve);return q}function PA(u){var h=u.length;return h?u[mw(0,h-1)]:n}function eU(u,h){return Og(gi(u),mc(h,0,u.length))}function tU(u){return Og(gi(u))}function ow(u,h,y){(y!==n&&!Ko(u[h],y)||y===n&&!(h in u))&&fa(u,h,y)}function Jd(u,h,y){var E=u[h];(!(ln.call(u,h)&&Ko(E,y))||y===n&&!(h in u))&&fa(u,h,y)}function gg(u,h){for(var y=u.length;y--;)if(Ko(u[y][0],h))return y;return-1}function nU(u,h,y,E){return nl(u,function(O,D,B){h(E,O,y(O),B)}),E}function NA(u,h){return u&&Es(h,br(h),u)}function rU(u,h){return u&&Es(h,yi(h),u)}function fa(u,h,y){h=="__proto__"&&ug?ug(u,h,{configurable:!0,enumerable:!0,value:y,writable:!0}):u[h]=y}function sw(u,h){for(var y=-1,E=h.length,O=ce(E),D=u==null;++y<E;)O[y]=D?n:Fw(u,h[y]);return O}function mc(u,h,y){return u===u&&(y!==n&&(u=u<=y?u:y),h!==n&&(u=u>=h?u:h)),u}function vo(u,h,y,E,O,D){var B,q=h&d,Q=h&p,ve=h&m;if(y&&(B=O?y(u,E,O,D):y(u)),B!==n)return B;if(!$n(u))return u;var ye=Ct(u);if(ye){if(B=HU(u),!q)return gi(u,B)}else{var xe=Ur(u),Ve=xe==oe||xe==se;if(sl(u))return nO(u,q);if(xe==et||xe==He||Ve&&!O){if(B=Q||Ve?{}:xO(u),!q)return Q?DU(u,rU(B,u)):MU(u,NA(B,u))}else{if(!vn[xe])return O?u:{};B=qU(u,xe,q)}}D||(D=new qo);var rt=D.get(u);if(rt)return rt;D.set(u,B),XO(u)?u.forEach(function(gt){B.add(vo(gt,h,y,gt,u,D))}):GO(u)&&u.forEach(function(gt,It){B.set(It,vo(gt,h,y,It,u,D))});var mt=ve?Q?_w:Ew:Q?yi:br,Tt=ye?n:mt(u);return po(Tt||u,function(gt,It){Tt&&(It=gt,gt=u[It]),Jd(B,It,vo(gt,h,y,It,u,D))}),B}function iU(u){var h=br(u);return function(y){return MA(y,u,h)}}function MA(u,h,y){var E=y.length;if(u==null)return!E;for(u=mn(u);E--;){var O=y[E],D=h[O],B=u[O];if(B===n&&!(O in u)||!D(B))return!1}return!0}function DA(u,h,y){if(typeof u!="function")throw new mo(s);return sh(function(){u.apply(n,y)},h)}function eh(u,h,y,E){var O=-1,D=Jm,B=!0,q=u.length,Q=[],ve=h.length;if(!q)return Q;y&&(h=Nn(h,ji(y))),E?(D=q1,B=!1):h.length>=i&&(D=Kd,B=!1,h=new pc(h));e:for(;++O<q;){var ye=u[O],xe=y==null?ye:y(ye);if(ye=E||ye!==0?ye:0,B&&xe===xe){for(var Ve=ve;Ve--;)if(h[Ve]===xe)continue e;Q.push(ye)}else D(h,xe,E)||Q.push(ye)}return Q}var nl=aO(ks),LA=aO(lw,!0);function oU(u,h){var y=!0;return nl(u,function(E,O,D){return y=!!h(E,O,D),y}),y}function vg(u,h,y){for(var E=-1,O=u.length;++E<O;){var D=u[E],B=h(D);if(B!=null&&(q===n?B===B&&!Fi(B):y(B,q)))var q=B,Q=D}return Q}function sU(u,h,y,E){var O=u.length;for(y=_t(y),y<0&&(y=-y>O?0:O+y),E=E===n||E>O?O:_t(E),E<0&&(E+=O),E=y>E?0:QO(E);y<E;)u[y++]=h;return u}function $A(u,h){var y=[];return nl(u,function(E,O,D){h(E,O,D)&&y.push(E)}),y}function Ar(u,h,y,E,O){var D=-1,B=u.length;for(y||(y=GU),O||(O=[]);++D<B;){var q=u[D];h>0&&y(q)?h>1?Ar(q,h-1,y,E,O):Ja(O,q):E||(O[O.length]=q)}return O}var aw=lO(),IA=lO(!0);function ks(u,h){return u&&aw(u,h,br)}function lw(u,h){return u&&IA(u,h,br)}function yg(u,h){return Qa(h,function(y){return ma(u[y])})}function gc(u,h){h=il(h,u);for(var y=0,E=h.length;u!=null&&y<E;)u=u[_s(h[y++])];return y&&y==E?u:n}function jA(u,h,y){var E=h(u);return Ct(u)?E:Ja(E,y(u))}function ni(u){return u==null?u===n?Ce:nt:dc&&dc in mn(u)?VU(u):tW(u)}function cw(u,h){return u>h}function aU(u,h){return u!=null&&ln.call(u,h)}function lU(u,h){return u!=null&&h in mn(u)}function cU(u,h,y){return u>=Vr(h,y)&&u<fr(h,y)}function uw(u,h,y){for(var E=y?q1:Jm,O=u[0].length,D=u.length,B=D,q=ce(D),Q=1/0,ve=[];B--;){var ye=u[B];B&&h&&(ye=Nn(ye,ji(h))),Q=Vr(ye.length,Q),q[B]=!y&&(h||O>=120&&ye.length>=120)?new pc(B&&ye):n}ye=u[0];var xe=-1,Ve=q[0];e:for(;++xe<O&&ve.length<Q;){var rt=ye[xe],mt=h?h(rt):rt;if(rt=y||rt!==0?rt:0,!(Ve?Kd(Ve,mt):E(ve,mt,y))){for(B=D;--B;){var Tt=q[B];if(!(Tt?Kd(Tt,mt):E(u[B],mt,y)))continue e}Ve&&Ve.push(mt),ve.push(rt)}}return ve}function uU(u,h,y,E){return ks(u,function(O,D,B){h(E,y(O),D,B)}),E}function th(u,h,y){h=il(h,u),u=EO(u,h);var E=u==null?u:u[_s(bo(h))];return E==null?n:Ii(E,u,y)}function BA(u){return Un(u)&&ni(u)==He}function fU(u){return Un(u)&&ni(u)==de}function dU(u){return Un(u)&&ni(u)==Se}function nh(u,h,y,E,O){return u===h?!0:u==null||h==null||!Un(u)&&!Un(h)?u!==u&&h!==h:hU(u,h,y,E,nh,O)}function hU(u,h,y,E,O,D){var B=Ct(u),q=Ct(h),Q=B?Ye:Ur(u),ve=q?Ye:Ur(h);Q=Q==He?et:Q,ve=ve==He?et:ve;var ye=Q==et,xe=ve==et,Ve=Q==ve;if(Ve&&sl(u)){if(!sl(h))return!1;B=!0,ye=!1}if(Ve&&!ye)return D||(D=new qo),B||qu(u)?yO(u,h,y,E,O,D):FU(u,h,Q,y,E,O,D);if(!(y&v)){var rt=ye&&ln.call(u,"__wrapped__"),mt=xe&&ln.call(h,"__wrapped__");if(rt||mt){var Tt=rt?u.value():u,gt=mt?h.value():h;return D||(D=new qo),O(Tt,gt,y,E,D)}}return Ve?(D||(D=new qo),zU(u,h,y,E,O,D)):!1}function pU(u){return Un(u)&&Ur(u)==ue}function fw(u,h,y,E){var O=y.length,D=O,B=!E;if(u==null)return!D;for(u=mn(u);O--;){var q=y[O];if(B&&q[2]?q[1]!==u[q[0]]:!(q[0]in u))return!1}for(;++O<D;){q=y[O];var Q=q[0],ve=u[Q],ye=q[1];if(B&&q[2]){if(ve===n&&!(Q in u))return!1}else{var xe=new qo;if(E)var Ve=E(ve,ye,Q,u,h,xe);if(!(Ve===n?nh(ye,ve,v|b,E,xe):Ve))return!1}}return!0}function FA(u){if(!$n(u)||XU(u))return!1;var h=ma(u)?pV:Ya;return h.test(yc(u))}function mU(u){return Un(u)&&ni(u)==z}function gU(u){return Un(u)&&Ur(u)==X}function vU(u){return Un(u)&&Lg(u.length)&&!!Cn[ni(u)]}function zA(u){return typeof u=="function"?u:u==null?bi:typeof u=="object"?Ct(u)?WA(u[0],u[1]):UA(u):cR(u)}function dw(u){if(!oh(u))return wV(u);var h=[];for(var y in mn(u))ln.call(u,y)&&y!="constructor"&&h.push(y);return h}function yU(u){if(!$n(u))return eW(u);var h=oh(u),y=[];for(var E in u)E=="constructor"&&(h||!ln.call(u,E))||y.push(E);return y}function hw(u,h){return u<h}function VA(u,h){var y=-1,E=vi(u)?ce(u.length):[];return nl(u,function(O,D,B){E[++y]=h(O,D,B)}),E}function UA(u){var h=Aw(u);return h.length==1&&h[0][2]?CO(h[0][0],h[0][1]):function(y){return y===u||fw(y,u,h)}}function WA(u,h){return Rw(u)&&SO(h)?CO(_s(u),h):function(y){var E=Fw(y,u);return E===n&&E===h?zw(y,u):nh(h,E,v|b)}}function bg(u,h,y,E,O){u!==h&&aw(h,function(D,B){if(O||(O=new qo),$n(D))bU(u,h,B,y,bg,E,O);else{var q=E?E(Nw(u,B),D,B+"",u,h,O):n;q===n&&(q=D),ow(u,B,q)}},yi)}function bU(u,h,y,E,O,D,B){var q=Nw(u,y),Q=Nw(h,y),ve=B.get(Q);if(ve){ow(u,y,ve);return}var ye=D?D(q,Q,y+"",u,h,B):n,xe=ye===n;if(xe){var Ve=Ct(Q),rt=!Ve&&sl(Q),mt=!Ve&&!rt&&qu(Q);ye=Q,Ve||rt||mt?Ct(q)?ye=q:Xn(q)?ye=gi(q):rt?(xe=!1,ye=nO(Q,!0)):mt?(xe=!1,ye=rO(Q,!0)):ye=[]:ah(Q)||bc(Q)?(ye=q,bc(q)?ye=JO(q):(!$n(q)||ma(q))&&(ye=xO(Q))):xe=!1}xe&&(B.set(Q,ye),O(ye,Q,E,D,B),B.delete(Q)),ow(u,y,ye)}function HA(u,h){var y=u.length;if(y)return h+=h<0?y:0,pa(h,y)?u[h]:n}function qA(u,h,y){h.length?h=Nn(h,function(D){return Ct(D)?function(B){return gc(B,D.length===1?D[0]:D)}:D}):h=[bi];var E=-1;h=Nn(h,ji(ht()));var O=VA(u,function(D,B,q){var Q=Nn(h,function(ve){return ve(D)});return{criteria:Q,index:++E,value:D}});return qz(O,function(D,B){return NU(D,B,y)})}function wU(u,h){return KA(u,h,function(y,E){return zw(u,E)})}function KA(u,h,y){for(var E=-1,O=h.length,D={};++E<O;){var B=h[E],q=gc(u,B);y(q,B)&&rh(D,il(B,u),q)}return D}function xU(u){return function(h){return gc(h,u)}}function pw(u,h,y,E){var O=E?Hz:Lu,D=-1,B=h.length,q=u;for(u===h&&(h=gi(h)),y&&(q=Nn(u,ji(y)));++D<B;)for(var Q=0,ve=h[D],ye=y?y(ve):ve;(Q=O(q,ye,Q,E))>-1;)q!==u&&cg.call(q,Q,1),cg.call(u,Q,1);return u}function GA(u,h){for(var y=u?h.length:0,E=y-1;y--;){var O=h[y];if(y==E||O!==D){var D=O;pa(O)?cg.call(u,O,1):yw(u,O)}}return u}function mw(u,h){return u+dg(AA()*(h-u+1))}function SU(u,h,y,E){for(var O=-1,D=fr(fg((h-u)/(y||1)),0),B=ce(D);D--;)B[E?D:++O]=u,u+=y;return B}function gw(u,h){var y="";if(!u||h<1||h>re)return y;do h%2&&(y+=u),h=dg(h/2),h&&(u+=u);while(h);return y}function Mt(u,h){return Mw(kO(u,h,bi),u+"")}function CU(u){return PA(Ku(u))}function kU(u,h){var y=Ku(u);return Og(y,mc(h,0,y.length))}function rh(u,h,y,E){if(!$n(u))return u;h=il(h,u);for(var O=-1,D=h.length,B=D-1,q=u;q!=null&&++O<D;){var Q=_s(h[O]),ve=y;if(Q==="__proto__"||Q==="constructor"||Q==="prototype")return u;if(O!=B){var ye=q[Q];ve=E?E(ye,Q,q):n,ve===n&&(ve=$n(ye)?ye:pa(h[O+1])?[]:{})}Jd(q,Q,ve),q=q[Q]}return u}var YA=hg?function(u,h){return hg.set(u,h),u}:bi,EU=ug?function(u,h){return ug(u,"toString",{configurable:!0,enumerable:!1,value:Uw(h),writable:!0})}:bi;function _U(u){return Og(Ku(u))}function yo(u,h,y){var E=-1,O=u.length;h<0&&(h=-h>O?0:O+h),y=y>O?O:y,y<0&&(y+=O),O=h>y?0:y-h>>>0,h>>>=0;for(var D=ce(O);++E<O;)D[E]=u[E+h];return D}function TU(u,h){var y;return nl(u,function(E,O,D){return y=h(E,O,D),!y}),!!y}function wg(u,h,y){var E=0,O=u==null?E:u.length;if(typeof h=="number"&&h===h&&O<=$){for(;E<O;){var D=E+O>>>1,B=u[D];B!==null&&!Fi(B)&&(y?B<=h:B<h)?E=D+1:O=D}return O}return vw(u,h,bi,y)}function vw(u,h,y,E){var O=0,D=u==null?0:u.length;if(D===0)return 0;h=y(h);for(var B=h!==h,q=h===null,Q=Fi(h),ve=h===n;O<D;){var ye=dg((O+D)/2),xe=y(u[ye]),Ve=xe!==n,rt=xe===null,mt=xe===xe,Tt=Fi(xe);if(B)var gt=E||mt;else ve?gt=mt&&(E||Ve):q?gt=mt&&Ve&&(E||!rt):Q?gt=mt&&Ve&&!rt&&(E||!Tt):rt||Tt?gt=!1:gt=E?xe<=h:xe<h;gt?O=ye+1:D=ye}return Vr(D,fe)}function XA(u,h){for(var y=-1,E=u.length,O=0,D=[];++y<E;){var B=u[y],q=h?h(B):B;if(!y||!Ko(q,Q)){var Q=q;D[O++]=B===0?0:B}}return D}function ZA(u){return typeof u=="number"?u:Fi(u)?P:+u}function Bi(u){if(typeof u=="string")return u;if(Ct(u))return Nn(u,Bi)+"";if(Fi(u))return OA?OA.call(u):"";var h=u+"";return h=="0"&&1/u==-ae?"-0":h}function rl(u,h,y){var E=-1,O=Jm,D=u.length,B=!0,q=[],Q=q;if(y)B=!1,O=q1;else if(D>=i){var ve=h?null:jU(u);if(ve)return tg(ve);B=!1,O=Kd,Q=new pc}else Q=h?[]:q;e:for(;++E<D;){var ye=u[E],xe=h?h(ye):ye;if(ye=y||ye!==0?ye:0,B&&xe===xe){for(var Ve=Q.length;Ve--;)if(Q[Ve]===xe)continue e;h&&Q.push(xe),q.push(ye)}else O(Q,xe,y)||(Q!==q&&Q.push(xe),q.push(ye))}return q}function yw(u,h){return h=il(h,u),u=EO(u,h),u==null||delete u[_s(bo(h))]}function QA(u,h,y,E){return rh(u,h,y(gc(u,h)),E)}function xg(u,h,y,E){for(var O=u.length,D=E?O:-1;(E?D--:++D<O)&&h(u[D],D,u););return y?yo(u,E?0:D,E?D+1:O):yo(u,E?D+1:0,E?O:D)}function JA(u,h){var y=u;return y instanceof Ft&&(y=y.value()),K1(h,function(E,O){return O.func.apply(O.thisArg,Ja([E],O.args))},y)}function bw(u,h,y){var E=u.length;if(E<2)return E?rl(u[0]):[];for(var O=-1,D=ce(E);++O<E;)for(var B=u[O],q=-1;++q<E;)q!=O&&(D[O]=eh(D[O]||B,u[q],h,y));return rl(Ar(D,1),h,y)}function eO(u,h,y){for(var E=-1,O=u.length,D=h.length,B={};++E<O;){var q=E<D?h[E]:n;y(B,u[E],q)}return B}function ww(u){return Xn(u)?u:[]}function xw(u){return typeof u=="function"?u:bi}function il(u,h){return Ct(u)?u:Rw(u,h)?[u]:OO(on(u))}var AU=Mt;function ol(u,h,y){var E=u.length;return y=y===n?E:y,!h&&y>=E?u:yo(u,h,y)}var tO=mV||function(u){return Tr.clearTimeout(u)};function nO(u,h){if(h)return u.slice();var y=u.length,E=CA?CA(y):new u.constructor(y);return u.copy(E),E}function Sw(u){var h=new u.constructor(u.byteLength);return new ag(h).set(new ag(u)),h}function OU(u,h){var y=h?Sw(u.buffer):u.buffer;return new u.constructor(y,u.byteOffset,u.byteLength)}function RU(u){var h=new u.constructor(u.source,Pn.exec(u));return h.lastIndex=u.lastIndex,h}function PU(u){return Qd?mn(Qd.call(u)):{}}function rO(u,h){var y=h?Sw(u.buffer):u.buffer;return new u.constructor(y,u.byteOffset,u.length)}function iO(u,h){if(u!==h){var y=u!==n,E=u===null,O=u===u,D=Fi(u),B=h!==n,q=h===null,Q=h===h,ve=Fi(h);if(!q&&!ve&&!D&&u>h||D&&B&&Q&&!q&&!ve||E&&B&&Q||!y&&Q||!O)return 1;if(!E&&!D&&!ve&&u<h||ve&&y&&O&&!E&&!D||q&&y&&O||!B&&O||!Q)return-1}return 0}function NU(u,h,y){for(var E=-1,O=u.criteria,D=h.criteria,B=O.length,q=y.length;++E<B;){var Q=iO(O[E],D[E]);if(Q){if(E>=q)return Q;var ve=y[E];return Q*(ve=="desc"?-1:1)}}return u.index-h.index}function oO(u,h,y,E){for(var O=-1,D=u.length,B=y.length,q=-1,Q=h.length,ve=fr(D-B,0),ye=ce(Q+ve),xe=!E;++q<Q;)ye[q]=h[q];for(;++O<B;)(xe||O<D)&&(ye[y[O]]=u[O]);for(;ve--;)ye[q++]=u[O++];return ye}function sO(u,h,y,E){for(var O=-1,D=u.length,B=-1,q=y.length,Q=-1,ve=h.length,ye=fr(D-q,0),xe=ce(ye+ve),Ve=!E;++O<ye;)xe[O]=u[O];for(var rt=O;++Q<ve;)xe[rt+Q]=h[Q];for(;++B<q;)(Ve||O<D)&&(xe[rt+y[B]]=u[O++]);return xe}function gi(u,h){var y=-1,E=u.length;for(h||(h=ce(E));++y<E;)h[y]=u[y];return h}function Es(u,h,y,E){var O=!y;y||(y={});for(var D=-1,B=h.length;++D<B;){var q=h[D],Q=E?E(y[q],u[q],q,y,u):n;Q===n&&(Q=u[q]),O?fa(y,q,Q):Jd(y,q,Q)}return y}function MU(u,h){return Es(u,Ow(u),h)}function DU(u,h){return Es(u,bO(u),h)}function Sg(u,h){return function(y,E){var O=Ct(y)?Bz:nU,D=h?h():{};return O(y,u,ht(E,2),D)}}function Uu(u){return Mt(function(h,y){var E=-1,O=y.length,D=O>1?y[O-1]:n,B=O>2?y[2]:n;for(D=u.length>3&&typeof D=="function"?(O--,D):n,B&&ri(y[0],y[1],B)&&(D=O<3?n:D,O=1),h=mn(h);++E<O;){var q=y[E];q&&u(h,q,E,D)}return h})}function aO(u,h){return function(y,E){if(y==null)return y;if(!vi(y))return u(y,E);for(var O=y.length,D=h?O:-1,B=mn(y);(h?D--:++D<O)&&E(B[D],D,B)!==!1;);return y}}function lO(u){return function(h,y,E){for(var O=-1,D=mn(h),B=E(h),q=B.length;q--;){var Q=B[u?q:++O];if(y(D[Q],Q,D)===!1)break}return h}}function LU(u,h,y){var E=h&S,O=ih(u);function D(){var B=this&&this!==Tr&&this instanceof D?O:u;return B.apply(E?y:this,arguments)}return D}function cO(u){return function(h){h=on(h);var y=$u(h)?Ho(h):n,E=y?y[0]:h.charAt(0),O=y?ol(y,1).join(""):h.slice(1);return E[u]()+O}}function Wu(u){return function(h){return K1(aR(sR(h).replace(Ez,"")),u,"")}}function ih(u){return function(){var h=arguments;switch(h.length){case 0:return new u;case 1:return new u(h[0]);case 2:return new u(h[0],h[1]);case 3:return new u(h[0],h[1],h[2]);case 4:return new u(h[0],h[1],h[2],h[3]);case 5:return new u(h[0],h[1],h[2],h[3],h[4]);case 6:return new u(h[0],h[1],h[2],h[3],h[4],h[5]);case 7:return new u(h[0],h[1],h[2],h[3],h[4],h[5],h[6])}var y=Vu(u.prototype),E=u.apply(y,h);return $n(E)?E:y}}function $U(u,h,y){var E=ih(u);function O(){for(var D=arguments.length,B=ce(D),q=D,Q=Hu(O);q--;)B[q]=arguments[q];var ve=D<3&&B[0]!==Q&&B[D-1]!==Q?[]:el(B,Q);if(D-=ve.length,D<y)return pO(u,h,Cg,O.placeholder,n,B,ve,n,n,y-D);var ye=this&&this!==Tr&&this instanceof O?E:u;return Ii(ye,this,B)}return O}function uO(u){return function(h,y,E){var O=mn(h);if(!vi(h)){var D=ht(y,3);h=br(h),y=function(q){return D(O[q],q,O)}}var B=u(h,y,E);return B>-1?O[D?h[B]:B]:n}}function fO(u){return ha(function(h){var y=h.length,E=y,O=go.prototype.thru;for(u&&h.reverse();E--;){var D=h[E];if(typeof D!="function")throw new mo(s);if(O&&!B&&Tg(D)=="wrapper")var B=new go([],!0)}for(E=B?E:y;++E<y;){D=h[E];var q=Tg(D),Q=q=="wrapper"?Tw(D):n;Q&&Pw(Q[0])&&Q[1]==(R|C|A|M)&&!Q[4].length&&Q[9]==1?B=B[Tg(Q[0])].apply(B,Q[3]):B=D.length==1&&Pw(D)?B[q]():B.thru(D)}return function(){var ve=arguments,ye=ve[0];if(B&&ve.length==1&&Ct(ye))return B.plant(ye).value();for(var xe=0,Ve=y?h[xe].apply(this,ve):ye;++xe<y;)Ve=h[xe].call(this,Ve);return Ve}})}function Cg(u,h,y,E,O,D,B,q,Q,ve){var ye=h&R,xe=h&S,Ve=h&x,rt=h&(C|T),mt=h&I,Tt=Ve?n:ih(u);function gt(){for(var It=arguments.length,Ut=ce(It),zi=It;zi--;)Ut[zi]=arguments[zi];if(rt)var ii=Hu(gt),Vi=Gz(Ut,ii);if(E&&(Ut=oO(Ut,E,O,rt)),D&&(Ut=sO(Ut,D,B,rt)),It-=Vi,rt&&It<ve){var Zn=el(Ut,ii);return pO(u,h,Cg,gt.placeholder,y,Ut,Zn,q,Q,ve-It)}var Go=xe?y:this,va=Ve?Go[u]:u;return It=Ut.length,q?Ut=nW(Ut,q):mt&&It>1&&Ut.reverse(),ye&&Q<It&&(Ut.length=Q),this&&this!==Tr&&this instanceof gt&&(va=Tt||ih(va)),va.apply(Go,Ut)}return gt}function dO(u,h){return function(y,E){return uU(y,u,h(E),{})}}function kg(u,h){return function(y,E){var O;if(y===n&&E===n)return h;if(y!==n&&(O=y),E!==n){if(O===n)return E;typeof y=="string"||typeof E=="string"?(y=Bi(y),E=Bi(E)):(y=ZA(y),E=ZA(E)),O=u(y,E)}return O}}function Cw(u){return ha(function(h){return h=Nn(h,ji(ht())),Mt(function(y){var E=this;return u(h,function(O){return Ii(O,E,y)})})})}function Eg(u,h){h=h===n?" ":Bi(h);var y=h.length;if(y<2)return y?gw(h,u):h;var E=gw(h,fg(u/Iu(h)));return $u(h)?ol(Ho(E),0,u).join(""):E.slice(0,u)}function IU(u,h,y,E){var O=h&S,D=ih(u);function B(){for(var q=-1,Q=arguments.length,ve=-1,ye=E.length,xe=ce(ye+Q),Ve=this&&this!==Tr&&this instanceof B?D:u;++ve<ye;)xe[ve]=E[ve];for(;Q--;)xe[ve++]=arguments[++q];return Ii(Ve,O?y:this,xe)}return B}function hO(u){return function(h,y,E){return E&&typeof E!="number"&&ri(h,y,E)&&(y=E=n),h=ga(h),y===n?(y=h,h=0):y=ga(y),E=E===n?h<y?1:-1:ga(E),SU(h,y,E,u)}}function _g(u){return function(h,y){return typeof h=="string"&&typeof y=="string"||(h=wo(h),y=wo(y)),u(h,y)}}function pO(u,h,y,E,O,D,B,q,Q,ve){var ye=h&C,xe=ye?B:n,Ve=ye?n:B,rt=ye?D:n,mt=ye?n:D;h|=ye?A:_,h&=~(ye?_:A),h&w||(h&=~(S|x));var Tt=[u,h,O,rt,xe,mt,Ve,q,Q,ve],gt=y.apply(n,Tt);return Pw(u)&&_O(gt,Tt),gt.placeholder=E,TO(gt,u,h)}function kw(u){var h=ur[u];return function(y,E){if(y=wo(y),E=E==null?0:Vr(_t(E),292),E&&TA(y)){var O=(on(y)+"e").split("e"),D=h(O[0]+"e"+(+O[1]+E));return O=(on(D)+"e").split("e"),+(O[0]+"e"+(+O[1]-E))}return h(y)}}var jU=Fu&&1/tg(new Fu([,-0]))[1]==ae?function(u){return new Fu(u)}:qw;function mO(u){return function(h){var y=Ur(h);return y==ue?ew(h):y==X?tV(h):Kz(h,u(h))}}function da(u,h,y,E,O,D,B,q){var Q=h&x;if(!Q&&typeof u!="function")throw new mo(s);var ve=E?E.length:0;if(ve||(h&=~(A|_),E=O=n),B=B===n?B:fr(_t(B),0),q=q===n?q:_t(q),ve-=O?O.length:0,h&_){var ye=E,xe=O;E=O=n}var Ve=Q?n:Tw(u),rt=[u,h,y,E,O,ye,xe,D,B,q];if(Ve&&JU(rt,Ve),u=rt[0],h=rt[1],y=rt[2],E=rt[3],O=rt[4],q=rt[9]=rt[9]===n?Q?0:u.length:fr(rt[9]-ve,0),!q&&h&(C|T)&&(h&=~(C|T)),!h||h==S)var mt=LU(u,h,y);else h==C||h==T?mt=$U(u,h,q):(h==A||h==(S|A))&&!O.length?mt=IU(u,h,y,E):mt=Cg.apply(n,rt);var Tt=Ve?YA:_O;return TO(Tt(mt,rt),u,h)}function gO(u,h,y,E){return u===n||Ko(u,Bu[y])&&!ln.call(E,y)?h:u}function vO(u,h,y,E,O,D){return $n(u)&&$n(h)&&(D.set(h,u),bg(u,h,n,vO,D),D.delete(h)),u}function BU(u){return ah(u)?n:u}function yO(u,h,y,E,O,D){var B=y&v,q=u.length,Q=h.length;if(q!=Q&&!(B&&Q>q))return!1;var ve=D.get(u),ye=D.get(h);if(ve&&ye)return ve==h&&ye==u;var xe=-1,Ve=!0,rt=y&b?new pc:n;for(D.set(u,h),D.set(h,u);++xe<q;){var mt=u[xe],Tt=h[xe];if(E)var gt=B?E(Tt,mt,xe,h,u,D):E(mt,Tt,xe,u,h,D);if(gt!==n){if(gt)continue;Ve=!1;break}if(rt){if(!G1(h,function(It,Ut){if(!Kd(rt,Ut)&&(mt===It||O(mt,It,y,E,D)))return rt.push(Ut)})){Ve=!1;break}}else if(!(mt===Tt||O(mt,Tt,y,E,D))){Ve=!1;break}}return D.delete(u),D.delete(h),Ve}function FU(u,h,y,E,O,D,B){switch(y){case Ae:if(u.byteLength!=h.byteLength||u.byteOffset!=h.byteOffset)return!1;u=u.buffer,h=h.buffer;case de:return!(u.byteLength!=h.byteLength||!D(new ag(u),new ag(h)));case J:case Se:case we:return Ko(+u,+h);case ke:return u.name==h.name&&u.message==h.message;case z:case ne:return u==h+"";case ue:var q=ew;case X:var Q=E&v;if(q||(q=tg),u.size!=h.size&&!Q)return!1;var ve=B.get(u);if(ve)return ve==h;E|=b,B.set(u,h);var ye=yO(q(u),q(h),E,O,D,B);return B.delete(u),ye;case _e:if(Qd)return Qd.call(u)==Qd.call(h)}return!1}function zU(u,h,y,E,O,D){var B=y&v,q=Ew(u),Q=q.length,ve=Ew(h),ye=ve.length;if(Q!=ye&&!B)return!1;for(var xe=Q;xe--;){var Ve=q[xe];if(!(B?Ve in h:ln.call(h,Ve)))return!1}var rt=D.get(u),mt=D.get(h);if(rt&&mt)return rt==h&&mt==u;var Tt=!0;D.set(u,h),D.set(h,u);for(var gt=B;++xe<Q;){Ve=q[xe];var It=u[Ve],Ut=h[Ve];if(E)var zi=B?E(Ut,It,Ve,h,u,D):E(It,Ut,Ve,u,h,D);if(!(zi===n?It===Ut||O(It,Ut,y,E,D):zi)){Tt=!1;break}gt||(gt=Ve=="constructor")}if(Tt&&!gt){var ii=u.constructor,Vi=h.constructor;ii!=Vi&&"constructor"in u&&"constructor"in h&&!(typeof ii=="function"&&ii instanceof ii&&typeof Vi=="function"&&Vi instanceof Vi)&&(Tt=!1)}return D.delete(u),D.delete(h),Tt}function ha(u){return Mw(kO(u,n,MO),u+"")}function Ew(u){return jA(u,br,Ow)}function _w(u){return jA(u,yi,bO)}var Tw=hg?function(u){return hg.get(u)}:qw;function Tg(u){for(var h=u.name+"",y=zu[h],E=ln.call(zu,h)?y.length:0;E--;){var O=y[E],D=O.func;if(D==null||D==u)return O.name}return h}function Hu(u){var h=ln.call(N,"placeholder")?N:u;return h.placeholder}function ht(){var u=N.iteratee||Ww;return u=u===Ww?zA:u,arguments.length?u(arguments[0],arguments[1]):u}function Ag(u,h){var y=u.__data__;return YU(h)?y[typeof h=="string"?"string":"hash"]:y.map}function Aw(u){for(var h=br(u),y=h.length;y--;){var E=h[y],O=u[E];h[y]=[E,O,SO(O)]}return h}function vc(u,h){var y=Qz(u,h);return FA(y)?y:n}function VU(u){var h=ln.call(u,dc),y=u[dc];try{u[dc]=n;var E=!0}catch{}var O=og.call(u);return E&&(h?u[dc]=y:delete u[dc]),O}var Ow=nw?function(u){return u==null?[]:(u=mn(u),Qa(nw(u),function(h){return EA.call(u,h)}))}:Kw,bO=nw?function(u){for(var h=[];u;)Ja(h,Ow(u)),u=lg(u);return h}:Kw,Ur=ni;(rw&&Ur(new rw(new ArrayBuffer(1)))!=Ae||Yd&&Ur(new Yd)!=ue||iw&&Ur(iw.resolve())!=wt||Fu&&Ur(new Fu)!=X||Xd&&Ur(new Xd)!=j)&&(Ur=function(u){var h=ni(u),y=h==et?u.constructor:n,E=y?yc(y):"";if(E)switch(E){case kV:return Ae;case EV:return ue;case _V:return wt;case TV:return X;case AV:return j}return h});function UU(u,h,y){for(var E=-1,O=y.length;++E<O;){var D=y[E],B=D.size;switch(D.type){case"drop":u+=B;break;case"dropRight":h-=B;break;case"take":h=Vr(h,u+B);break;case"takeRight":u=fr(u,h-B);break}}return{start:u,end:h}}function WU(u){var h=u.match(rn);return h?h[1].split(zr):[]}function wO(u,h,y){h=il(h,u);for(var E=-1,O=h.length,D=!1;++E<O;){var B=_s(h[E]);if(!(D=u!=null&&y(u,B)))break;u=u[B]}return D||++E!=O?D:(O=u==null?0:u.length,!!O&&Lg(O)&&pa(B,O)&&(Ct(u)||bc(u)))}function HU(u){var h=u.length,y=new u.constructor(h);return h&&typeof u[0]=="string"&&ln.call(u,"index")&&(y.index=u.index,y.input=u.input),y}function xO(u){return typeof u.constructor=="function"&&!oh(u)?Vu(lg(u)):{}}function qU(u,h,y){var E=u.constructor;switch(h){case de:return Sw(u);case J:case Se:return new E(+u);case Ae:return OU(u,y);case Be:case Te:case je:case Oe:case Qt:case sn:case Lt:case Kt:case Pt:return rO(u,y);case ue:return new E;case we:case ne:return new E(u);case z:return RU(u);case X:return new E;case _e:return PU(u)}}function KU(u,h){var y=h.length;if(!y)return u;var E=y-1;return h[E]=(y>1?"& ":"")+h[E],h=h.join(y>2?", ":" "),u.replace(Nt,`{
174
+ /* [wrapped with `+h+`] */
175
+ `)}function GU(u){return Ct(u)||bc(u)||!!(_A&&u&&u[_A])}function pa(u,h){var y=typeof u;return h=h??re,!!h&&(y=="number"||y!="symbol"&&Wo.test(u))&&u>-1&&u%1==0&&u<h}function ri(u,h,y){if(!$n(y))return!1;var E=typeof h;return(E=="number"?vi(y)&&pa(h,y.length):E=="string"&&h in y)?Ko(y[h],u):!1}function Rw(u,h){if(Ct(u))return!1;var y=typeof u;return y=="number"||y=="symbol"||y=="boolean"||u==null||Fi(u)?!0:it.test(u)||!at.test(u)||h!=null&&u in mn(h)}function YU(u){var h=typeof u;return h=="string"||h=="number"||h=="symbol"||h=="boolean"?u!=="__proto__":u===null}function Pw(u){var h=Tg(u),y=N[h];if(typeof y!="function"||!(h in Ft.prototype))return!1;if(u===y)return!0;var E=Tw(y);return!!E&&u===E[0]}function XU(u){return!!SA&&SA in u}var ZU=rg?ma:Gw;function oh(u){var h=u&&u.constructor,y=typeof h=="function"&&h.prototype||Bu;return u===y}function SO(u){return u===u&&!$n(u)}function CO(u,h){return function(y){return y==null?!1:y[u]===h&&(h!==n||u in mn(y))}}function QU(u){var h=Mg(u,function(E){return y.size===c&&y.clear(),E}),y=h.cache;return h}function JU(u,h){var y=u[1],E=h[1],O=y|E,D=O<(S|x|R),B=E==R&&y==C||E==R&&y==M&&u[7].length<=h[8]||E==(R|M)&&h[7].length<=h[8]&&y==C;if(!(D||B))return u;E&S&&(u[2]=h[2],O|=y&S?0:w);var q=h[3];if(q){var Q=u[3];u[3]=Q?oO(Q,q,h[4]):q,u[4]=Q?el(u[3],f):h[4]}return q=h[5],q&&(Q=u[5],u[5]=Q?sO(Q,q,h[6]):q,u[6]=Q?el(u[5],f):h[6]),q=h[7],q&&(u[7]=q),E&R&&(u[8]=u[8]==null?h[8]:Vr(u[8],h[8])),u[9]==null&&(u[9]=h[9]),u[0]=h[0],u[1]=O,u}function eW(u){var h=[];if(u!=null)for(var y in mn(u))h.push(y);return h}function tW(u){return og.call(u)}function kO(u,h,y){return h=fr(h===n?u.length-1:h,0),function(){for(var E=arguments,O=-1,D=fr(E.length-h,0),B=ce(D);++O<D;)B[O]=E[h+O];O=-1;for(var q=ce(h+1);++O<h;)q[O]=E[O];return q[h]=y(B),Ii(u,this,q)}}function EO(u,h){return h.length<2?u:gc(u,yo(h,0,-1))}function nW(u,h){for(var y=u.length,E=Vr(h.length,y),O=gi(u);E--;){var D=h[E];u[E]=pa(D,y)?O[D]:n}return u}function Nw(u,h){if(!(h==="constructor"&&typeof u[h]=="function")&&h!="__proto__")return u[h]}var _O=AO(YA),sh=vV||function(u,h){return Tr.setTimeout(u,h)},Mw=AO(EU);function TO(u,h,y){var E=h+"";return Mw(u,KU(E,rW(WU(E),y)))}function AO(u){var h=0,y=0;return function(){var E=xV(),O=G-(E-y);if(y=E,O>0){if(++h>=L)return arguments[0]}else h=0;return u.apply(n,arguments)}}function Og(u,h){var y=-1,E=u.length,O=E-1;for(h=h===n?E:h;++y<h;){var D=mw(y,O),B=u[D];u[D]=u[y],u[y]=B}return u.length=h,u}var OO=QU(function(u){var h=[];return u.charCodeAt(0)===46&&h.push(""),u.replace(st,function(y,E,O,D){h.push(O?D.replace(cr,"$1"):E||y)}),h});function _s(u){if(typeof u=="string"||Fi(u))return u;var h=u+"";return h=="0"&&1/u==-ae?"-0":h}function yc(u){if(u!=null){try{return ig.call(u)}catch{}try{return u+""}catch{}}return""}function rW(u,h){return po(Ne,function(y){var E="_."+y[0];h&y[1]&&!Jm(u,E)&&u.push(E)}),u.sort()}function RO(u){if(u instanceof Ft)return u.clone();var h=new go(u.__wrapped__,u.__chain__);return h.__actions__=gi(u.__actions__),h.__index__=u.__index__,h.__values__=u.__values__,h}function iW(u,h,y){(y?ri(u,h,y):h===n)?h=1:h=fr(_t(h),0);var E=u==null?0:u.length;if(!E||h<1)return[];for(var O=0,D=0,B=ce(fg(E/h));O<E;)B[D++]=yo(u,O,O+=h);return B}function oW(u){for(var h=-1,y=u==null?0:u.length,E=0,O=[];++h<y;){var D=u[h];D&&(O[E++]=D)}return O}function sW(){var u=arguments.length;if(!u)return[];for(var h=ce(u-1),y=arguments[0],E=u;E--;)h[E-1]=arguments[E];return Ja(Ct(y)?gi(y):[y],Ar(h,1))}var aW=Mt(function(u,h){return Xn(u)?eh(u,Ar(h,1,Xn,!0)):[]}),lW=Mt(function(u,h){var y=bo(h);return Xn(y)&&(y=n),Xn(u)?eh(u,Ar(h,1,Xn,!0),ht(y,2)):[]}),cW=Mt(function(u,h){var y=bo(h);return Xn(y)&&(y=n),Xn(u)?eh(u,Ar(h,1,Xn,!0),n,y):[]});function uW(u,h,y){var E=u==null?0:u.length;return E?(h=y||h===n?1:_t(h),yo(u,h<0?0:h,E)):[]}function fW(u,h,y){var E=u==null?0:u.length;return E?(h=y||h===n?1:_t(h),h=E-h,yo(u,0,h<0?0:h)):[]}function dW(u,h){return u&&u.length?xg(u,ht(h,3),!0,!0):[]}function hW(u,h){return u&&u.length?xg(u,ht(h,3),!0):[]}function pW(u,h,y,E){var O=u==null?0:u.length;return O?(y&&typeof y!="number"&&ri(u,h,y)&&(y=0,E=O),sU(u,h,y,E)):[]}function PO(u,h,y){var E=u==null?0:u.length;if(!E)return-1;var O=y==null?0:_t(y);return O<0&&(O=fr(E+O,0)),eg(u,ht(h,3),O)}function NO(u,h,y){var E=u==null?0:u.length;if(!E)return-1;var O=E-1;return y!==n&&(O=_t(y),O=y<0?fr(E+O,0):Vr(O,E-1)),eg(u,ht(h,3),O,!0)}function MO(u){var h=u==null?0:u.length;return h?Ar(u,1):[]}function mW(u){var h=u==null?0:u.length;return h?Ar(u,ae):[]}function gW(u,h){var y=u==null?0:u.length;return y?(h=h===n?1:_t(h),Ar(u,h)):[]}function vW(u){for(var h=-1,y=u==null?0:u.length,E={};++h<y;){var O=u[h];E[O[0]]=O[1]}return E}function DO(u){return u&&u.length?u[0]:n}function yW(u,h,y){var E=u==null?0:u.length;if(!E)return-1;var O=y==null?0:_t(y);return O<0&&(O=fr(E+O,0)),Lu(u,h,O)}function bW(u){var h=u==null?0:u.length;return h?yo(u,0,-1):[]}var wW=Mt(function(u){var h=Nn(u,ww);return h.length&&h[0]===u[0]?uw(h):[]}),xW=Mt(function(u){var h=bo(u),y=Nn(u,ww);return h===bo(y)?h=n:y.pop(),y.length&&y[0]===u[0]?uw(y,ht(h,2)):[]}),SW=Mt(function(u){var h=bo(u),y=Nn(u,ww);return h=typeof h=="function"?h:n,h&&y.pop(),y.length&&y[0]===u[0]?uw(y,n,h):[]});function CW(u,h){return u==null?"":bV.call(u,h)}function bo(u){var h=u==null?0:u.length;return h?u[h-1]:n}function kW(u,h,y){var E=u==null?0:u.length;if(!E)return-1;var O=E;return y!==n&&(O=_t(y),O=O<0?fr(E+O,0):Vr(O,E-1)),h===h?rV(u,h,O):eg(u,pA,O,!0)}function EW(u,h){return u&&u.length?HA(u,_t(h)):n}var _W=Mt(LO);function LO(u,h){return u&&u.length&&h&&h.length?pw(u,h):u}function TW(u,h,y){return u&&u.length&&h&&h.length?pw(u,h,ht(y,2)):u}function AW(u,h,y){return u&&u.length&&h&&h.length?pw(u,h,n,y):u}var OW=ha(function(u,h){var y=u==null?0:u.length,E=sw(u,h);return GA(u,Nn(h,function(O){return pa(O,y)?+O:O}).sort(iO)),E});function RW(u,h){var y=[];if(!(u&&u.length))return y;var E=-1,O=[],D=u.length;for(h=ht(h,3);++E<D;){var B=u[E];h(B,E,u)&&(y.push(B),O.push(E))}return GA(u,O),y}function Dw(u){return u==null?u:CV.call(u)}function PW(u,h,y){var E=u==null?0:u.length;return E?(y&&typeof y!="number"&&ri(u,h,y)?(h=0,y=E):(h=h==null?0:_t(h),y=y===n?E:_t(y)),yo(u,h,y)):[]}function NW(u,h){return wg(u,h)}function MW(u,h,y){return vw(u,h,ht(y,2))}function DW(u,h){var y=u==null?0:u.length;if(y){var E=wg(u,h);if(E<y&&Ko(u[E],h))return E}return-1}function LW(u,h){return wg(u,h,!0)}function $W(u,h,y){return vw(u,h,ht(y,2),!0)}function IW(u,h){var y=u==null?0:u.length;if(y){var E=wg(u,h,!0)-1;if(Ko(u[E],h))return E}return-1}function jW(u){return u&&u.length?XA(u):[]}function BW(u,h){return u&&u.length?XA(u,ht(h,2)):[]}function FW(u){var h=u==null?0:u.length;return h?yo(u,1,h):[]}function zW(u,h,y){return u&&u.length?(h=y||h===n?1:_t(h),yo(u,0,h<0?0:h)):[]}function VW(u,h,y){var E=u==null?0:u.length;return E?(h=y||h===n?1:_t(h),h=E-h,yo(u,h<0?0:h,E)):[]}function UW(u,h){return u&&u.length?xg(u,ht(h,3),!1,!0):[]}function WW(u,h){return u&&u.length?xg(u,ht(h,3)):[]}var HW=Mt(function(u){return rl(Ar(u,1,Xn,!0))}),qW=Mt(function(u){var h=bo(u);return Xn(h)&&(h=n),rl(Ar(u,1,Xn,!0),ht(h,2))}),KW=Mt(function(u){var h=bo(u);return h=typeof h=="function"?h:n,rl(Ar(u,1,Xn,!0),n,h)});function GW(u){return u&&u.length?rl(u):[]}function YW(u,h){return u&&u.length?rl(u,ht(h,2)):[]}function XW(u,h){return h=typeof h=="function"?h:n,u&&u.length?rl(u,n,h):[]}function Lw(u){if(!(u&&u.length))return[];var h=0;return u=Qa(u,function(y){if(Xn(y))return h=fr(y.length,h),!0}),Q1(h,function(y){return Nn(u,Y1(y))})}function $O(u,h){if(!(u&&u.length))return[];var y=Lw(u);return h==null?y:Nn(y,function(E){return Ii(h,n,E)})}var ZW=Mt(function(u,h){return Xn(u)?eh(u,h):[]}),QW=Mt(function(u){return bw(Qa(u,Xn))}),JW=Mt(function(u){var h=bo(u);return Xn(h)&&(h=n),bw(Qa(u,Xn),ht(h,2))}),eH=Mt(function(u){var h=bo(u);return h=typeof h=="function"?h:n,bw(Qa(u,Xn),n,h)}),tH=Mt(Lw);function nH(u,h){return eO(u||[],h||[],Jd)}function rH(u,h){return eO(u||[],h||[],rh)}var iH=Mt(function(u){var h=u.length,y=h>1?u[h-1]:n;return y=typeof y=="function"?(u.pop(),y):n,$O(u,y)});function IO(u){var h=N(u);return h.__chain__=!0,h}function oH(u,h){return h(u),u}function Rg(u,h){return h(u)}var sH=ha(function(u){var h=u.length,y=h?u[0]:0,E=this.__wrapped__,O=function(D){return sw(D,u)};return h>1||this.__actions__.length||!(E instanceof Ft)||!pa(y)?this.thru(O):(E=E.slice(y,+y+(h?1:0)),E.__actions__.push({func:Rg,args:[O],thisArg:n}),new go(E,this.__chain__).thru(function(D){return h&&!D.length&&D.push(n),D}))});function aH(){return IO(this)}function lH(){return new go(this.value(),this.__chain__)}function cH(){this.__values__===n&&(this.__values__=ZO(this.value()));var u=this.__index__>=this.__values__.length,h=u?n:this.__values__[this.__index__++];return{done:u,value:h}}function uH(){return this}function fH(u){for(var h,y=this;y instanceof mg;){var E=RO(y);E.__index__=0,E.__values__=n,h?O.__wrapped__=E:h=E;var O=E;y=y.__wrapped__}return O.__wrapped__=u,h}function dH(){var u=this.__wrapped__;if(u instanceof Ft){var h=u;return this.__actions__.length&&(h=new Ft(this)),h=h.reverse(),h.__actions__.push({func:Rg,args:[Dw],thisArg:n}),new go(h,this.__chain__)}return this.thru(Dw)}function hH(){return JA(this.__wrapped__,this.__actions__)}var pH=Sg(function(u,h,y){ln.call(u,y)?++u[y]:fa(u,y,1)});function mH(u,h,y){var E=Ct(u)?dA:oU;return y&&ri(u,h,y)&&(h=n),E(u,ht(h,3))}function gH(u,h){var y=Ct(u)?Qa:$A;return y(u,ht(h,3))}var vH=uO(PO),yH=uO(NO);function bH(u,h){return Ar(Pg(u,h),1)}function wH(u,h){return Ar(Pg(u,h),ae)}function xH(u,h,y){return y=y===n?1:_t(y),Ar(Pg(u,h),y)}function jO(u,h){var y=Ct(u)?po:nl;return y(u,ht(h,3))}function BO(u,h){var y=Ct(u)?Fz:LA;return y(u,ht(h,3))}var SH=Sg(function(u,h,y){ln.call(u,y)?u[y].push(h):fa(u,y,[h])});function CH(u,h,y,E){u=vi(u)?u:Ku(u),y=y&&!E?_t(y):0;var O=u.length;return y<0&&(y=fr(O+y,0)),$g(u)?y<=O&&u.indexOf(h,y)>-1:!!O&&Lu(u,h,y)>-1}var kH=Mt(function(u,h,y){var E=-1,O=typeof h=="function",D=vi(u)?ce(u.length):[];return nl(u,function(B){D[++E]=O?Ii(h,B,y):th(B,h,y)}),D}),EH=Sg(function(u,h,y){fa(u,y,h)});function Pg(u,h){var y=Ct(u)?Nn:VA;return y(u,ht(h,3))}function _H(u,h,y,E){return u==null?[]:(Ct(h)||(h=h==null?[]:[h]),y=E?n:y,Ct(y)||(y=y==null?[]:[y]),qA(u,h,y))}var TH=Sg(function(u,h,y){u[y?0:1].push(h)},function(){return[[],[]]});function AH(u,h,y){var E=Ct(u)?K1:gA,O=arguments.length<3;return E(u,ht(h,4),y,O,nl)}function OH(u,h,y){var E=Ct(u)?zz:gA,O=arguments.length<3;return E(u,ht(h,4),y,O,LA)}function RH(u,h){var y=Ct(u)?Qa:$A;return y(u,Dg(ht(h,3)))}function PH(u){var h=Ct(u)?PA:CU;return h(u)}function NH(u,h,y){(y?ri(u,h,y):h===n)?h=1:h=_t(h);var E=Ct(u)?eU:kU;return E(u,h)}function MH(u){var h=Ct(u)?tU:_U;return h(u)}function DH(u){if(u==null)return 0;if(vi(u))return $g(u)?Iu(u):u.length;var h=Ur(u);return h==ue||h==X?u.size:dw(u).length}function LH(u,h,y){var E=Ct(u)?G1:TU;return y&&ri(u,h,y)&&(h=n),E(u,ht(h,3))}var $H=Mt(function(u,h){if(u==null)return[];var y=h.length;return y>1&&ri(u,h[0],h[1])?h=[]:y>2&&ri(h[0],h[1],h[2])&&(h=[h[0]]),qA(u,Ar(h,1),[])}),Ng=gV||function(){return Tr.Date.now()};function IH(u,h){if(typeof h!="function")throw new mo(s);return u=_t(u),function(){if(--u<1)return h.apply(this,arguments)}}function FO(u,h,y){return h=y?n:h,h=u&&h==null?u.length:h,da(u,R,n,n,n,n,h)}function zO(u,h){var y;if(typeof h!="function")throw new mo(s);return u=_t(u),function(){return--u>0&&(y=h.apply(this,arguments)),u<=1&&(h=n),y}}var $w=Mt(function(u,h,y){var E=S;if(y.length){var O=el(y,Hu($w));E|=A}return da(u,E,h,y,O)}),VO=Mt(function(u,h,y){var E=S|x;if(y.length){var O=el(y,Hu(VO));E|=A}return da(h,E,u,y,O)});function UO(u,h,y){h=y?n:h;var E=da(u,C,n,n,n,n,n,h);return E.placeholder=UO.placeholder,E}function WO(u,h,y){h=y?n:h;var E=da(u,T,n,n,n,n,n,h);return E.placeholder=WO.placeholder,E}function HO(u,h,y){var E,O,D,B,q,Q,ve=0,ye=!1,xe=!1,Ve=!0;if(typeof u!="function")throw new mo(s);h=wo(h)||0,$n(y)&&(ye=!!y.leading,xe="maxWait"in y,D=xe?fr(wo(y.maxWait)||0,h):D,Ve="trailing"in y?!!y.trailing:Ve);function rt(Zn){var Go=E,va=O;return E=O=n,ve=Zn,B=u.apply(va,Go),B}function mt(Zn){return ve=Zn,q=sh(It,h),ye?rt(Zn):B}function Tt(Zn){var Go=Zn-Q,va=Zn-ve,uR=h-Go;return xe?Vr(uR,D-va):uR}function gt(Zn){var Go=Zn-Q,va=Zn-ve;return Q===n||Go>=h||Go<0||xe&&va>=D}function It(){var Zn=Ng();if(gt(Zn))return Ut(Zn);q=sh(It,Tt(Zn))}function Ut(Zn){return q=n,Ve&&E?rt(Zn):(E=O=n,B)}function zi(){q!==n&&tO(q),ve=0,E=Q=O=q=n}function ii(){return q===n?B:Ut(Ng())}function Vi(){var Zn=Ng(),Go=gt(Zn);if(E=arguments,O=this,Q=Zn,Go){if(q===n)return mt(Q);if(xe)return tO(q),q=sh(It,h),rt(Q)}return q===n&&(q=sh(It,h)),B}return Vi.cancel=zi,Vi.flush=ii,Vi}var jH=Mt(function(u,h){return DA(u,1,h)}),BH=Mt(function(u,h,y){return DA(u,wo(h)||0,y)});function FH(u){return da(u,I)}function Mg(u,h){if(typeof u!="function"||h!=null&&typeof h!="function")throw new mo(s);var y=function(){var E=arguments,O=h?h.apply(this,E):E[0],D=y.cache;if(D.has(O))return D.get(O);var B=u.apply(this,E);return y.cache=D.set(O,B)||D,B};return y.cache=new(Mg.Cache||ua),y}Mg.Cache=ua;function Dg(u){if(typeof u!="function")throw new mo(s);return function(){var h=arguments;switch(h.length){case 0:return!u.call(this);case 1:return!u.call(this,h[0]);case 2:return!u.call(this,h[0],h[1]);case 3:return!u.call(this,h[0],h[1],h[2])}return!u.apply(this,h)}}function zH(u){return zO(2,u)}var VH=AU(function(u,h){h=h.length==1&&Ct(h[0])?Nn(h[0],ji(ht())):Nn(Ar(h,1),ji(ht()));var y=h.length;return Mt(function(E){for(var O=-1,D=Vr(E.length,y);++O<D;)E[O]=h[O].call(this,E[O]);return Ii(u,this,E)})}),Iw=Mt(function(u,h){var y=el(h,Hu(Iw));return da(u,A,n,h,y)}),qO=Mt(function(u,h){var y=el(h,Hu(qO));return da(u,_,n,h,y)}),UH=ha(function(u,h){return da(u,M,n,n,n,h)});function WH(u,h){if(typeof u!="function")throw new mo(s);return h=h===n?h:_t(h),Mt(u,h)}function HH(u,h){if(typeof u!="function")throw new mo(s);return h=h==null?0:fr(_t(h),0),Mt(function(y){var E=y[h],O=ol(y,0,h);return E&&Ja(O,E),Ii(u,this,O)})}function qH(u,h,y){var E=!0,O=!0;if(typeof u!="function")throw new mo(s);return $n(y)&&(E="leading"in y?!!y.leading:E,O="trailing"in y?!!y.trailing:O),HO(u,h,{leading:E,maxWait:h,trailing:O})}function KH(u){return FO(u,1)}function GH(u,h){return Iw(xw(h),u)}function YH(){if(!arguments.length)return[];var u=arguments[0];return Ct(u)?u:[u]}function XH(u){return vo(u,m)}function ZH(u,h){return h=typeof h=="function"?h:n,vo(u,m,h)}function QH(u){return vo(u,d|m)}function JH(u,h){return h=typeof h=="function"?h:n,vo(u,d|m,h)}function eq(u,h){return h==null||MA(u,h,br(h))}function Ko(u,h){return u===h||u!==u&&h!==h}var tq=_g(cw),nq=_g(function(u,h){return u>=h}),bc=BA(function(){return arguments}())?BA:function(u){return Un(u)&&ln.call(u,"callee")&&!EA.call(u,"callee")},Ct=ce.isArray,rq=sA?ji(sA):fU;function vi(u){return u!=null&&Lg(u.length)&&!ma(u)}function Xn(u){return Un(u)&&vi(u)}function iq(u){return u===!0||u===!1||Un(u)&&ni(u)==J}var sl=yV||Gw,oq=aA?ji(aA):dU;function sq(u){return Un(u)&&u.nodeType===1&&!ah(u)}function aq(u){if(u==null)return!0;if(vi(u)&&(Ct(u)||typeof u=="string"||typeof u.splice=="function"||sl(u)||qu(u)||bc(u)))return!u.length;var h=Ur(u);if(h==ue||h==X)return!u.size;if(oh(u))return!dw(u).length;for(var y in u)if(ln.call(u,y))return!1;return!0}function lq(u,h){return nh(u,h)}function cq(u,h,y){y=typeof y=="function"?y:n;var E=y?y(u,h):n;return E===n?nh(u,h,n,y):!!E}function jw(u){if(!Un(u))return!1;var h=ni(u);return h==ke||h==Ee||typeof u.message=="string"&&typeof u.name=="string"&&!ah(u)}function uq(u){return typeof u=="number"&&TA(u)}function ma(u){if(!$n(u))return!1;var h=ni(u);return h==oe||h==se||h==Ie||h==nn}function KO(u){return typeof u=="number"&&u==_t(u)}function Lg(u){return typeof u=="number"&&u>-1&&u%1==0&&u<=re}function $n(u){var h=typeof u;return u!=null&&(h=="object"||h=="function")}function Un(u){return u!=null&&typeof u=="object"}var GO=lA?ji(lA):pU;function fq(u,h){return u===h||fw(u,h,Aw(h))}function dq(u,h,y){return y=typeof y=="function"?y:n,fw(u,h,Aw(h),y)}function hq(u){return YO(u)&&u!=+u}function pq(u){if(ZU(u))throw new xt(o);return FA(u)}function mq(u){return u===null}function gq(u){return u==null}function YO(u){return typeof u=="number"||Un(u)&&ni(u)==we}function ah(u){if(!Un(u)||ni(u)!=et)return!1;var h=lg(u);if(h===null)return!0;var y=ln.call(h,"constructor")&&h.constructor;return typeof y=="function"&&y instanceof y&&ig.call(y)==dV}var Bw=cA?ji(cA):mU;function vq(u){return KO(u)&&u>=-re&&u<=re}var XO=uA?ji(uA):gU;function $g(u){return typeof u=="string"||!Ct(u)&&Un(u)&&ni(u)==ne}function Fi(u){return typeof u=="symbol"||Un(u)&&ni(u)==_e}var qu=fA?ji(fA):vU;function yq(u){return u===n}function bq(u){return Un(u)&&Ur(u)==j}function wq(u){return Un(u)&&ni(u)==ee}var xq=_g(hw),Sq=_g(function(u,h){return u<=h});function ZO(u){if(!u)return[];if(vi(u))return $g(u)?Ho(u):gi(u);if(Gd&&u[Gd])return eV(u[Gd]());var h=Ur(u),y=h==ue?ew:h==X?tg:Ku;return y(u)}function ga(u){if(!u)return u===0?u:0;if(u=wo(u),u===ae||u===-ae){var h=u<0?-1:1;return h*W}return u===u?u:0}function _t(u){var h=ga(u),y=h%1;return h===h?y?h-y:h:0}function QO(u){return u?mc(_t(u),0,he):0}function wo(u){if(typeof u=="number")return u;if(Fi(u))return P;if($n(u)){var h=typeof u.valueOf=="function"?u.valueOf():u;u=$n(h)?h+"":h}if(typeof u!="string")return u===0?u:+u;u=vA(u);var y=Er.test(u);return y||Xa.test(u)?Iz(u.slice(2),y?2:8):$i.test(u)?P:+u}function JO(u){return Es(u,yi(u))}function Cq(u){return u?mc(_t(u),-re,re):u===0?u:0}function on(u){return u==null?"":Bi(u)}var kq=Uu(function(u,h){if(oh(h)||vi(h)){Es(h,br(h),u);return}for(var y in h)ln.call(h,y)&&Jd(u,y,h[y])}),eR=Uu(function(u,h){Es(h,yi(h),u)}),Ig=Uu(function(u,h,y,E){Es(h,yi(h),u,E)}),Eq=Uu(function(u,h,y,E){Es(h,br(h),u,E)}),_q=ha(sw);function Tq(u,h){var y=Vu(u);return h==null?y:NA(y,h)}var Aq=Mt(function(u,h){u=mn(u);var y=-1,E=h.length,O=E>2?h[2]:n;for(O&&ri(h[0],h[1],O)&&(E=1);++y<E;)for(var D=h[y],B=yi(D),q=-1,Q=B.length;++q<Q;){var ve=B[q],ye=u[ve];(ye===n||Ko(ye,Bu[ve])&&!ln.call(u,ve))&&(u[ve]=D[ve])}return u}),Oq=Mt(function(u){return u.push(n,vO),Ii(tR,n,u)});function Rq(u,h){return hA(u,ht(h,3),ks)}function Pq(u,h){return hA(u,ht(h,3),lw)}function Nq(u,h){return u==null?u:aw(u,ht(h,3),yi)}function Mq(u,h){return u==null?u:IA(u,ht(h,3),yi)}function Dq(u,h){return u&&ks(u,ht(h,3))}function Lq(u,h){return u&&lw(u,ht(h,3))}function $q(u){return u==null?[]:yg(u,br(u))}function Iq(u){return u==null?[]:yg(u,yi(u))}function Fw(u,h,y){var E=u==null?n:gc(u,h);return E===n?y:E}function jq(u,h){return u!=null&&wO(u,h,aU)}function zw(u,h){return u!=null&&wO(u,h,lU)}var Bq=dO(function(u,h,y){h!=null&&typeof h.toString!="function"&&(h=og.call(h)),u[h]=y},Uw(bi)),Fq=dO(function(u,h,y){h!=null&&typeof h.toString!="function"&&(h=og.call(h)),ln.call(u,h)?u[h].push(y):u[h]=[y]},ht),zq=Mt(th);function br(u){return vi(u)?RA(u):dw(u)}function yi(u){return vi(u)?RA(u,!0):yU(u)}function Vq(u,h){var y={};return h=ht(h,3),ks(u,function(E,O,D){fa(y,h(E,O,D),E)}),y}function Uq(u,h){var y={};return h=ht(h,3),ks(u,function(E,O,D){fa(y,O,h(E,O,D))}),y}var Wq=Uu(function(u,h,y){bg(u,h,y)}),tR=Uu(function(u,h,y,E){bg(u,h,y,E)}),Hq=ha(function(u,h){var y={};if(u==null)return y;var E=!1;h=Nn(h,function(D){return D=il(D,u),E||(E=D.length>1),D}),Es(u,_w(u),y),E&&(y=vo(y,d|p|m,BU));for(var O=h.length;O--;)yw(y,h[O]);return y});function qq(u,h){return nR(u,Dg(ht(h)))}var Kq=ha(function(u,h){return u==null?{}:wU(u,h)});function nR(u,h){if(u==null)return{};var y=Nn(_w(u),function(E){return[E]});return h=ht(h),KA(u,y,function(E,O){return h(E,O[0])})}function Gq(u,h,y){h=il(h,u);var E=-1,O=h.length;for(O||(O=1,u=n);++E<O;){var D=u==null?n:u[_s(h[E])];D===n&&(E=O,D=y),u=ma(D)?D.call(u):D}return u}function Yq(u,h,y){return u==null?u:rh(u,h,y)}function Xq(u,h,y,E){return E=typeof E=="function"?E:n,u==null?u:rh(u,h,y,E)}var rR=mO(br),iR=mO(yi);function Zq(u,h,y){var E=Ct(u),O=E||sl(u)||qu(u);if(h=ht(h,4),y==null){var D=u&&u.constructor;O?y=E?new D:[]:$n(u)?y=ma(D)?Vu(lg(u)):{}:y={}}return(O?po:ks)(u,function(B,q,Q){return h(y,B,q,Q)}),y}function Qq(u,h){return u==null?!0:yw(u,h)}function Jq(u,h,y){return u==null?u:QA(u,h,xw(y))}function eK(u,h,y,E){return E=typeof E=="function"?E:n,u==null?u:QA(u,h,xw(y),E)}function Ku(u){return u==null?[]:J1(u,br(u))}function tK(u){return u==null?[]:J1(u,yi(u))}function nK(u,h,y){return y===n&&(y=h,h=n),y!==n&&(y=wo(y),y=y===y?y:0),h!==n&&(h=wo(h),h=h===h?h:0),mc(wo(u),h,y)}function rK(u,h,y){return h=ga(h),y===n?(y=h,h=0):y=ga(y),u=wo(u),cU(u,h,y)}function iK(u,h,y){if(y&&typeof y!="boolean"&&ri(u,h,y)&&(h=y=n),y===n&&(typeof h=="boolean"?(y=h,h=n):typeof u=="boolean"&&(y=u,u=n)),u===n&&h===n?(u=0,h=1):(u=ga(u),h===n?(h=u,u=0):h=ga(h)),u>h){var E=u;u=h,h=E}if(y||u%1||h%1){var O=AA();return Vr(u+O*(h-u+$z("1e-"+((O+"").length-1))),h)}return mw(u,h)}var oK=Wu(function(u,h,y){return h=h.toLowerCase(),u+(y?oR(h):h)});function oR(u){return Vw(on(u).toLowerCase())}function sR(u){return u=on(u),u&&u.replace(la,Yz).replace(_z,"")}function sK(u,h,y){u=on(u),h=Bi(h);var E=u.length;y=y===n?E:mc(_t(y),0,E);var O=y;return y-=h.length,y>=0&&u.slice(y,O)==h}function aK(u){return u=on(u),u&&te.test(u)?u.replace(ti,Xz):u}function lK(u){return u=on(u),u&&pt.test(u)?u.replace(qe,"\\$&"):u}var cK=Wu(function(u,h,y){return u+(y?"-":"")+h.toLowerCase()}),uK=Wu(function(u,h,y){return u+(y?" ":"")+h.toLowerCase()}),fK=cO("toLowerCase");function dK(u,h,y){u=on(u),h=_t(h);var E=h?Iu(u):0;if(!h||E>=h)return u;var O=(h-E)/2;return Eg(dg(O),y)+u+Eg(fg(O),y)}function hK(u,h,y){u=on(u),h=_t(h);var E=h?Iu(u):0;return h&&E<h?u+Eg(h-E,y):u}function pK(u,h,y){u=on(u),h=_t(h);var E=h?Iu(u):0;return h&&E<h?Eg(h-E,y)+u:u}function mK(u,h,y){return y||h==null?h=0:h&&(h=+h),SV(on(u).replace(qt,""),h||0)}function gK(u,h,y){return(y?ri(u,h,y):h===n)?h=1:h=_t(h),gw(on(u),h)}function vK(){var u=arguments,h=on(u[0]);return u.length<3?h:h.replace(u[1],u[2])}var yK=Wu(function(u,h,y){return u+(y?"_":"")+h.toLowerCase()});function bK(u,h,y){return y&&typeof y!="number"&&ri(u,h,y)&&(h=y=n),y=y===n?he:y>>>0,y?(u=on(u),u&&(typeof h=="string"||h!=null&&!Bw(h))&&(h=Bi(h),!h&&$u(u))?ol(Ho(u),0,y):u.split(h,y)):[]}var wK=Wu(function(u,h,y){return u+(y?" ":"")+Vw(h)});function xK(u,h,y){return u=on(u),y=y==null?0:mc(_t(y),0,u.length),h=Bi(h),u.slice(y,y+h.length)==h}function SK(u,h,y){var E=N.templateSettings;y&&ri(u,h,y)&&(h=n),u=on(u),h=Ig({},h,E,gO);var O=Ig({},h.imports,E.imports,gO),D=br(O),B=J1(O,D),q,Q,ve=0,ye=h.interpolate||Vt,xe="__p += '",Ve=tw((h.escape||Vt).source+"|"+ye.source+"|"+(ye===Ue?Yn:Vt).source+"|"+(h.evaluate||Vt).source+"|$","g"),rt="//# sourceURL="+(ln.call(h,"sourceURL")?(h.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Pz+"]")+`
176
+ `;u.replace(Ve,function(gt,It,Ut,zi,ii,Vi){return Ut||(Ut=zi),xe+=u.slice(ve,Vi).replace(an,Zz),It&&(q=!0,xe+=`' +
177
+ __e(`+It+`) +
178
+ '`),ii&&(Q=!0,xe+=`';
179
+ `+ii+`;
180
+ __p += '`),Ut&&(xe+=`' +
181
+ ((__t = (`+Ut+`)) == null ? '' : __t) +
182
+ '`),ve=Vi+gt.length,gt}),xe+=`';
183
+ `;var mt=ln.call(h,"variable")&&h.variable;if(!mt)xe=`with (obj) {
184
+ `+xe+`
185
+ }
186
+ `;else if(Vn.test(mt))throw new xt(a);xe=(Q?xe.replace(fo,""):xe).replace(ei,"$1").replace(Li,"$1;"),xe="function("+(mt||"obj")+`) {
187
+ `+(mt?"":`obj || (obj = {});
188
+ `)+"var __t, __p = ''"+(q?", __e = _.escape":"")+(Q?`, __j = Array.prototype.join;
189
+ function print() { __p += __j.call(arguments, '') }
190
+ `:`;
191
+ `)+xe+`return __p
192
+ }`;var Tt=lR(function(){return Jt(D,rt+"return "+xe).apply(n,B)});if(Tt.source=xe,jw(Tt))throw Tt;return Tt}function CK(u){return on(u).toLowerCase()}function kK(u){return on(u).toUpperCase()}function EK(u,h,y){if(u=on(u),u&&(y||h===n))return vA(u);if(!u||!(h=Bi(h)))return u;var E=Ho(u),O=Ho(h),D=yA(E,O),B=bA(E,O)+1;return ol(E,D,B).join("")}function _K(u,h,y){if(u=on(u),u&&(y||h===n))return u.slice(0,xA(u)+1);if(!u||!(h=Bi(h)))return u;var E=Ho(u),O=bA(E,Ho(h))+1;return ol(E,0,O).join("")}function TK(u,h,y){if(u=on(u),u&&(y||h===n))return u.replace(qt,"");if(!u||!(h=Bi(h)))return u;var E=Ho(u),O=yA(E,Ho(h));return ol(E,O).join("")}function AK(u,h){var y=V,E=U;if($n(h)){var O="separator"in h?h.separator:O;y="length"in h?_t(h.length):y,E="omission"in h?Bi(h.omission):E}u=on(u);var D=u.length;if($u(u)){var B=Ho(u);D=B.length}if(y>=D)return u;var q=y-Iu(E);if(q<1)return E;var Q=B?ol(B,0,q).join(""):u.slice(0,q);if(O===n)return Q+E;if(B&&(q+=Q.length-q),Bw(O)){if(u.slice(q).search(O)){var ve,ye=Q;for(O.global||(O=tw(O.source,on(Pn.exec(O))+"g")),O.lastIndex=0;ve=O.exec(ye);)var xe=ve.index;Q=Q.slice(0,xe===n?q:xe)}}else if(u.indexOf(Bi(O),q)!=q){var Ve=Q.lastIndexOf(O);Ve>-1&&(Q=Q.slice(0,Ve))}return Q+E}function OK(u){return u=on(u),u&&Y.test(u)?u.replace(kr,iV):u}var RK=Wu(function(u,h,y){return u+(y?" ":"")+h.toUpperCase()}),Vw=cO("toUpperCase");function aR(u,h,y){return u=on(u),h=y?n:h,h===n?Jz(u)?aV(u):Wz(u):u.match(h)||[]}var lR=Mt(function(u,h){try{return Ii(u,n,h)}catch(y){return jw(y)?y:new xt(y)}}),PK=ha(function(u,h){return po(h,function(y){y=_s(y),fa(u,y,$w(u[y],u))}),u});function NK(u){var h=u==null?0:u.length,y=ht();return u=h?Nn(u,function(E){if(typeof E[1]!="function")throw new mo(s);return[y(E[0]),E[1]]}):[],Mt(function(E){for(var O=-1;++O<h;){var D=u[O];if(Ii(D[0],this,E))return Ii(D[1],this,E)}})}function MK(u){return iU(vo(u,d))}function Uw(u){return function(){return u}}function DK(u,h){return u==null||u!==u?h:u}var LK=fO(),$K=fO(!0);function bi(u){return u}function Ww(u){return zA(typeof u=="function"?u:vo(u,d))}function IK(u){return UA(vo(u,d))}function jK(u,h){return WA(u,vo(h,d))}var BK=Mt(function(u,h){return function(y){return th(y,u,h)}}),FK=Mt(function(u,h){return function(y){return th(u,y,h)}});function Hw(u,h,y){var E=br(h),O=yg(h,E);y==null&&!($n(h)&&(O.length||!E.length))&&(y=h,h=u,u=this,O=yg(h,br(h)));var D=!($n(y)&&"chain"in y)||!!y.chain,B=ma(u);return po(O,function(q){var Q=h[q];u[q]=Q,B&&(u.prototype[q]=function(){var ve=this.__chain__;if(D||ve){var ye=u(this.__wrapped__),xe=ye.__actions__=gi(this.__actions__);return xe.push({func:Q,args:arguments,thisArg:u}),ye.__chain__=ve,ye}return Q.apply(u,Ja([this.value()],arguments))})}),u}function zK(){return Tr._===this&&(Tr._=hV),this}function qw(){}function VK(u){return u=_t(u),Mt(function(h){return HA(h,u)})}var UK=Cw(Nn),WK=Cw(dA),HK=Cw(G1);function cR(u){return Rw(u)?Y1(_s(u)):xU(u)}function qK(u){return function(h){return u==null?n:gc(u,h)}}var KK=hO(),GK=hO(!0);function Kw(){return[]}function Gw(){return!1}function YK(){return{}}function XK(){return""}function ZK(){return!0}function QK(u,h){if(u=_t(u),u<1||u>re)return[];var y=he,E=Vr(u,he);h=ht(h),u-=he;for(var O=Q1(E,h);++y<u;)h(y);return O}function JK(u){return Ct(u)?Nn(u,_s):Fi(u)?[u]:gi(OO(on(u)))}function eG(u){var h=++fV;return on(u)+h}var tG=kg(function(u,h){return u+h},0),nG=kw("ceil"),rG=kg(function(u,h){return u/h},1),iG=kw("floor");function oG(u){return u&&u.length?vg(u,bi,cw):n}function sG(u,h){return u&&u.length?vg(u,ht(h,2),cw):n}function aG(u){return mA(u,bi)}function lG(u,h){return mA(u,ht(h,2))}function cG(u){return u&&u.length?vg(u,bi,hw):n}function uG(u,h){return u&&u.length?vg(u,ht(h,2),hw):n}var fG=kg(function(u,h){return u*h},1),dG=kw("round"),hG=kg(function(u,h){return u-h},0);function pG(u){return u&&u.length?Z1(u,bi):0}function mG(u,h){return u&&u.length?Z1(u,ht(h,2)):0}return N.after=IH,N.ary=FO,N.assign=kq,N.assignIn=eR,N.assignInWith=Ig,N.assignWith=Eq,N.at=_q,N.before=zO,N.bind=$w,N.bindAll=PK,N.bindKey=VO,N.castArray=YH,N.chain=IO,N.chunk=iW,N.compact=oW,N.concat=sW,N.cond=NK,N.conforms=MK,N.constant=Uw,N.countBy=pH,N.create=Tq,N.curry=UO,N.curryRight=WO,N.debounce=HO,N.defaults=Aq,N.defaultsDeep=Oq,N.defer=jH,N.delay=BH,N.difference=aW,N.differenceBy=lW,N.differenceWith=cW,N.drop=uW,N.dropRight=fW,N.dropRightWhile=dW,N.dropWhile=hW,N.fill=pW,N.filter=gH,N.flatMap=bH,N.flatMapDeep=wH,N.flatMapDepth=xH,N.flatten=MO,N.flattenDeep=mW,N.flattenDepth=gW,N.flip=FH,N.flow=LK,N.flowRight=$K,N.fromPairs=vW,N.functions=$q,N.functionsIn=Iq,N.groupBy=SH,N.initial=bW,N.intersection=wW,N.intersectionBy=xW,N.intersectionWith=SW,N.invert=Bq,N.invertBy=Fq,N.invokeMap=kH,N.iteratee=Ww,N.keyBy=EH,N.keys=br,N.keysIn=yi,N.map=Pg,N.mapKeys=Vq,N.mapValues=Uq,N.matches=IK,N.matchesProperty=jK,N.memoize=Mg,N.merge=Wq,N.mergeWith=tR,N.method=BK,N.methodOf=FK,N.mixin=Hw,N.negate=Dg,N.nthArg=VK,N.omit=Hq,N.omitBy=qq,N.once=zH,N.orderBy=_H,N.over=UK,N.overArgs=VH,N.overEvery=WK,N.overSome=HK,N.partial=Iw,N.partialRight=qO,N.partition=TH,N.pick=Kq,N.pickBy=nR,N.property=cR,N.propertyOf=qK,N.pull=_W,N.pullAll=LO,N.pullAllBy=TW,N.pullAllWith=AW,N.pullAt=OW,N.range=KK,N.rangeRight=GK,N.rearg=UH,N.reject=RH,N.remove=RW,N.rest=WH,N.reverse=Dw,N.sampleSize=NH,N.set=Yq,N.setWith=Xq,N.shuffle=MH,N.slice=PW,N.sortBy=$H,N.sortedUniq=jW,N.sortedUniqBy=BW,N.split=bK,N.spread=HH,N.tail=FW,N.take=zW,N.takeRight=VW,N.takeRightWhile=UW,N.takeWhile=WW,N.tap=oH,N.throttle=qH,N.thru=Rg,N.toArray=ZO,N.toPairs=rR,N.toPairsIn=iR,N.toPath=JK,N.toPlainObject=JO,N.transform=Zq,N.unary=KH,N.union=HW,N.unionBy=qW,N.unionWith=KW,N.uniq=GW,N.uniqBy=YW,N.uniqWith=XW,N.unset=Qq,N.unzip=Lw,N.unzipWith=$O,N.update=Jq,N.updateWith=eK,N.values=Ku,N.valuesIn=tK,N.without=ZW,N.words=aR,N.wrap=GH,N.xor=QW,N.xorBy=JW,N.xorWith=eH,N.zip=tH,N.zipObject=nH,N.zipObjectDeep=rH,N.zipWith=iH,N.entries=rR,N.entriesIn=iR,N.extend=eR,N.extendWith=Ig,Hw(N,N),N.add=tG,N.attempt=lR,N.camelCase=oK,N.capitalize=oR,N.ceil=nG,N.clamp=nK,N.clone=XH,N.cloneDeep=QH,N.cloneDeepWith=JH,N.cloneWith=ZH,N.conformsTo=eq,N.deburr=sR,N.defaultTo=DK,N.divide=rG,N.endsWith=sK,N.eq=Ko,N.escape=aK,N.escapeRegExp=lK,N.every=mH,N.find=vH,N.findIndex=PO,N.findKey=Rq,N.findLast=yH,N.findLastIndex=NO,N.findLastKey=Pq,N.floor=iG,N.forEach=jO,N.forEachRight=BO,N.forIn=Nq,N.forInRight=Mq,N.forOwn=Dq,N.forOwnRight=Lq,N.get=Fw,N.gt=tq,N.gte=nq,N.has=jq,N.hasIn=zw,N.head=DO,N.identity=bi,N.includes=CH,N.indexOf=yW,N.inRange=rK,N.invoke=zq,N.isArguments=bc,N.isArray=Ct,N.isArrayBuffer=rq,N.isArrayLike=vi,N.isArrayLikeObject=Xn,N.isBoolean=iq,N.isBuffer=sl,N.isDate=oq,N.isElement=sq,N.isEmpty=aq,N.isEqual=lq,N.isEqualWith=cq,N.isError=jw,N.isFinite=uq,N.isFunction=ma,N.isInteger=KO,N.isLength=Lg,N.isMap=GO,N.isMatch=fq,N.isMatchWith=dq,N.isNaN=hq,N.isNative=pq,N.isNil=gq,N.isNull=mq,N.isNumber=YO,N.isObject=$n,N.isObjectLike=Un,N.isPlainObject=ah,N.isRegExp=Bw,N.isSafeInteger=vq,N.isSet=XO,N.isString=$g,N.isSymbol=Fi,N.isTypedArray=qu,N.isUndefined=yq,N.isWeakMap=bq,N.isWeakSet=wq,N.join=CW,N.kebabCase=cK,N.last=bo,N.lastIndexOf=kW,N.lowerCase=uK,N.lowerFirst=fK,N.lt=xq,N.lte=Sq,N.max=oG,N.maxBy=sG,N.mean=aG,N.meanBy=lG,N.min=cG,N.minBy=uG,N.stubArray=Kw,N.stubFalse=Gw,N.stubObject=YK,N.stubString=XK,N.stubTrue=ZK,N.multiply=fG,N.nth=EW,N.noConflict=zK,N.noop=qw,N.now=Ng,N.pad=dK,N.padEnd=hK,N.padStart=pK,N.parseInt=mK,N.random=iK,N.reduce=AH,N.reduceRight=OH,N.repeat=gK,N.replace=vK,N.result=Gq,N.round=dG,N.runInContext=Z,N.sample=PH,N.size=DH,N.snakeCase=yK,N.some=LH,N.sortedIndex=NW,N.sortedIndexBy=MW,N.sortedIndexOf=DW,N.sortedLastIndex=LW,N.sortedLastIndexBy=$W,N.sortedLastIndexOf=IW,N.startCase=wK,N.startsWith=xK,N.subtract=hG,N.sum=pG,N.sumBy=mG,N.template=SK,N.times=QK,N.toFinite=ga,N.toInteger=_t,N.toLength=QO,N.toLower=CK,N.toNumber=wo,N.toSafeInteger=Cq,N.toString=on,N.toUpper=kK,N.trim=EK,N.trimEnd=_K,N.trimStart=TK,N.truncate=AK,N.unescape=OK,N.uniqueId=eG,N.upperCase=RK,N.upperFirst=Vw,N.each=jO,N.eachRight=BO,N.first=DO,Hw(N,function(){var u={};return ks(N,function(h,y){ln.call(N.prototype,y)||(u[y]=h)}),u}(),{chain:!1}),N.VERSION=r,po(["bind","bindKey","curry","curryRight","partial","partialRight"],function(u){N[u].placeholder=N}),po(["drop","take"],function(u,h){Ft.prototype[u]=function(y){y=y===n?1:fr(_t(y),0);var E=this.__filtered__&&!h?new Ft(this):this.clone();return E.__filtered__?E.__takeCount__=Vr(y,E.__takeCount__):E.__views__.push({size:Vr(y,he),type:u+(E.__dir__<0?"Right":"")}),E},Ft.prototype[u+"Right"]=function(y){return this.reverse()[u](y).reverse()}}),po(["filter","map","takeWhile"],function(u,h){var y=h+1,E=y==K||y==ie;Ft.prototype[u]=function(O){var D=this.clone();return D.__iteratees__.push({iteratee:ht(O,3),type:y}),D.__filtered__=D.__filtered__||E,D}}),po(["head","last"],function(u,h){var y="take"+(h?"Right":"");Ft.prototype[u]=function(){return this[y](1).value()[0]}}),po(["initial","tail"],function(u,h){var y="drop"+(h?"":"Right");Ft.prototype[u]=function(){return this.__filtered__?new Ft(this):this[y](1)}}),Ft.prototype.compact=function(){return this.filter(bi)},Ft.prototype.find=function(u){return this.filter(u).head()},Ft.prototype.findLast=function(u){return this.reverse().find(u)},Ft.prototype.invokeMap=Mt(function(u,h){return typeof u=="function"?new Ft(this):this.map(function(y){return th(y,u,h)})}),Ft.prototype.reject=function(u){return this.filter(Dg(ht(u)))},Ft.prototype.slice=function(u,h){u=_t(u);var y=this;return y.__filtered__&&(u>0||h<0)?new Ft(y):(u<0?y=y.takeRight(-u):u&&(y=y.drop(u)),h!==n&&(h=_t(h),y=h<0?y.dropRight(-h):y.take(h-u)),y)},Ft.prototype.takeRightWhile=function(u){return this.reverse().takeWhile(u).reverse()},Ft.prototype.toArray=function(){return this.take(he)},ks(Ft.prototype,function(u,h){var y=/^(?:filter|find|map|reject)|While$/.test(h),E=/^(?:head|last)$/.test(h),O=N[E?"take"+(h=="last"?"Right":""):h],D=E||/^find/.test(h);O&&(N.prototype[h]=function(){var B=this.__wrapped__,q=E?[1]:arguments,Q=B instanceof Ft,ve=q[0],ye=Q||Ct(B),xe=function(It){var Ut=O.apply(N,Ja([It],q));return E&&Ve?Ut[0]:Ut};ye&&y&&typeof ve=="function"&&ve.length!=1&&(Q=ye=!1);var Ve=this.__chain__,rt=!!this.__actions__.length,mt=D&&!Ve,Tt=Q&&!rt;if(!D&&ye){B=Tt?B:new Ft(this);var gt=u.apply(B,q);return gt.__actions__.push({func:Rg,args:[xe],thisArg:n}),new go(gt,Ve)}return mt&&Tt?u.apply(this,q):(gt=this.thru(xe),mt?E?gt.value()[0]:gt.value():gt)})}),po(["pop","push","shift","sort","splice","unshift"],function(u){var h=ng[u],y=/^(?:push|sort|unshift)$/.test(u)?"tap":"thru",E=/^(?:pop|shift)$/.test(u);N.prototype[u]=function(){var O=arguments;if(E&&!this.__chain__){var D=this.value();return h.apply(Ct(D)?D:[],O)}return this[y](function(B){return h.apply(Ct(B)?B:[],O)})}}),ks(Ft.prototype,function(u,h){var y=N[h];if(y){var E=y.name+"";ln.call(zu,E)||(zu[E]=[]),zu[E].push({name:h,func:y})}}),zu[Cg(n,x).name]=[{name:"wrapper",func:n}],Ft.prototype.clone=OV,Ft.prototype.reverse=RV,Ft.prototype.value=PV,N.prototype.at=sH,N.prototype.chain=aH,N.prototype.commit=lH,N.prototype.next=cH,N.prototype.plant=fH,N.prototype.reverse=dH,N.prototype.toJSON=N.prototype.valueOf=N.prototype.value=hH,N.prototype.first=N.prototype.head,Gd&&(N.prototype[Gd]=uH),N},ju=lV();fc?((fc.exports=ju)._=ju,W1._=ju):Tr._=ju}).call(fn)}(Vh,Vh.exports)),Vh.exports}var jx={exports:{}},Bx,jN;function Ise(){if(jN)return Bx;jN=1;var t="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Bx=t,Bx}var Fx,BN;function jse(){if(BN)return Fx;BN=1;var t=Ise();function e(){}function n(){}return n.resetWarningCache=e,Fx=function(){function r(s,a,l,c,f,d){if(d!==t){var p=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw p.name="Invariant Violation",p}}r.isRequired=r;function i(){return r}var o={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:i,element:r,elementType:r,instanceOf:i,node:r,objectOf:i,oneOf:i,oneOfType:i,shape:i,exact:i,checkPropTypes:n,resetWarningCache:e};return o.PropTypes=o,o},Fx}var FN;function l6(){return FN||(FN=1,jx.exports=jse()()),jx.exports}(function(t,e){(function(r,i){t.exports=i(g,$se(),l6())})(fn,function(n,r,i){return function(){var o={"./src/Xarrow/utils/buzzier.js":function(c,f,d){d.r(f),d.d(f,{bzFunction:function(){return p},buzzierMinSols:function(){return m}});var p=function(b,S,x,w){return function(C){return Math.pow(1-C,3)*b+3*Math.pow(1-C,2)*C*S+3*(1-C)*Math.pow(C,2)*x+Math.pow(C,3)*w}},m=function(b,S,x,w){var C=p(b,S,x,w),T=-6*b+12*S-6*x,A=Math.pow(-6*b+12*S-6*x,2)-4*(3*S-3*b)*(-3*b+9*S-9*x+3*w),_=2*(-3*b+9*S-9*x+3*w),R=C((T+Math.sqrt(A))/_),M=C((T-Math.sqrt(A))/_);return[R,M]}},"./src/Xarrow/Xarrow.tsx":function(c,f,d){var p=this&&this.__assign||function(){return p=Object.assign||function(M){for(var I,V=1,U=arguments.length;V<U;V++){I=arguments[V];for(var L in I)Object.prototype.hasOwnProperty.call(I,L)&&(M[L]=I[L])}return M},p.apply(this,arguments)},m=this&&this.__createBinding||(Object.create?function(M,I,V,U){U===void 0&&(U=V),Object.defineProperty(M,U,{enumerable:!0,get:function(){return I[V]}})}:function(M,I,V,U){U===void 0&&(U=V),M[U]=I[V]}),v=this&&this.__setModuleDefault||(Object.create?function(M,I){Object.defineProperty(M,"default",{enumerable:!0,value:I})}:function(M,I){M.default=I}),b=this&&this.__importStar||function(M){if(M&&M.__esModule)return M;var I={};if(M!=null)for(var V in M)V!=="default"&&Object.prototype.hasOwnProperty.call(M,V)&&m(I,M,V);return v(I,M),I},S=this&&this.__spreadArray||function(M,I){for(var V=0,U=I.length,L=M.length;V<U;V++,L++)M[L]=I[V];return M},x=this&&this.__importDefault||function(M){return M&&M.__esModule?M:{default:M}};Object.defineProperty(f,"__esModule",{value:!0});var w=b(d("react")),C=x(d("./src/Xarrow/useXarrowProps.ts")),T=d("./src/Xwrapper.tsx"),A=x(d("./src/Xarrow/propTypes.ts")),_=d("./src/Xarrow/utils/GetPosition.tsx"),R=function(M){var I,V=w.useRef({svgRef:w.useRef(null),lineRef:w.useRef(null),headRef:w.useRef(null),tailRef:w.useRef(null),lineDrawAnimRef:w.useRef(null),lineDashAnimRef:w.useRef(null),headOpacityAnimRef:w.useRef(null)}),U=V.current,L=U.svgRef,G=U.lineRef,K=U.headRef;U.tailRef;var F=U.lineDrawAnimRef,ie=U.lineDashAnimRef,ae=U.headOpacityAnimRef;w.useContext(T.XarrowContext);var re=C.default(M,V.current),W=re[0],P=W.labels,he=W.lineColor,fe=W.headColor,$=W.tailColor,Ne=W.strokeWidth,He=W.showHead,Ye=W.showTail,Ie=W.dashness,J=W.headShape,Se=W.tailShape,Ee=W.showXarrow,ke=W.animateDrawing,oe=W.zIndex,se=W.passProps,ue=W.arrowBodyProps,we=W.arrowHeadProps,nt=W.arrowTailProps,et=W.SVGcanvasProps,wt=W.divContainerProps,nn=W.divContainerStyle,z=W.SVGcanvasStyle,X=W._debug,ne=W.shouldUpdatePosition;ke=M.animateDrawing;var _e=w.useState(!ke),Ce=_e[0],j=_e[1],ee=w.useState({}),de=ee[1],Ae=function(){return de({})},Be=w.useState({cx0:0,cy0:0,cw:0,ch:0,x1:0,y1:0,x2:0,y2:0,dx:0,dy:0,absDx:0,absDy:0,cpx1:0,cpy1:0,cpx2:0,cpy2:0,headOrient:0,tailOrient:0,arrowHeadOffset:{x:0,y:0},arrowTailOffset:{x:0,y:0},headOffset:0,excRight:0,excLeft:0,excUp:0,excDown:0,startPoints:[],endPoints:[],mainDivPos:{x:0,y:0},xSign:1,ySign:1,lineLength:0,fHeadSize:1,fTailSize:1,arrowPath:"",labelStartPos:{x:0,y:0},labelMiddlePos:{x:0,y:0},labelEndPos:{x:0,y:0}}),Te=Be[0],je=Be[1];w.useLayoutEffect(function(){if(ne.current){var Y=_.getPosition(re,V);je(Y),ne.current=!1}});var Oe=Te.x2-Te.arrowHeadOffset.x,Qt=Te.y2-Te.arrowHeadOffset.y,sn=Te.x1-Te.arrowTailOffset.x,Lt=Te.y1-Te.arrowTailOffset.y,Kt=Ie.strokeLen+Ie.nonStrokeLen,Pt=1;Ie.animation<0&&(Ie.animation*=-1,Pt=-1);var fo,ei,Li,kr,ti=0;return ke&&Ce==!1?(typeof ke=="boolean"&&(ke=1),ei=ke+"s",fo=Te.lineLength,kr=Te.lineLength,Li=1,ke<0&&(I=[ti,kr],kr=I[0],ti=I[1],ei=ke*-1+"s")):(fo=Ie.strokeLen+" "+Ie.nonStrokeLen,ei=1/Ie.animation+"s",kr=Kt*Pt,Li="indefinite",ti=0),w.useLayoutEffect(function(){G.current&&je(function(Y){var te,pe;return p(p({},Y),{lineLength:(pe=(te=G.current)===null||te===void 0?void 0:te.getTotalLength())!==null&&pe!==void 0?pe:0})})},[G.current]),w.useEffect(function(){var Y=function(){window.addEventListener("resize",Ae);var pe=function(){var Ue,at;j(!0),(Ue=ae.current)===null||Ue===void 0||Ue.beginElement(),(at=ie.current)===null||at===void 0||at.beginElement()},Me=function(){return K.current.style.opacity="0"};return F.current&&K.current&&(F.current.addEventListener("endEvent",pe),F.current.addEventListener("beginEvent",Me)),function(){window.removeEventListener("resize",Ae),F.current&&(F.current.removeEventListener("endEvent",pe),K.current&&F.current.removeEventListener("beginEvent",Me))}},te=Y();return function(){j(!1),te()}},[Ee]),w.default.createElement("div",p({},wt,{style:p({position:"absolute",zIndex:oe},nn)}),Ee?w.default.createElement(w.default.Fragment,null,w.default.createElement("svg",p({ref:L,width:Te.cw,height:Te.ch,style:p({position:"absolute",left:Te.cx0,top:Te.cy0,pointerEvents:"none",border:X?"1px dashed yellow":null},z),overflow:"auto"},et),w.default.createElement("path",p({ref:G,d:Te.arrowPath,stroke:he,strokeDasharray:fo,strokeWidth:Ne,fill:"transparent",pointerEvents:"visibleStroke"},se,ue),w.default.createElement(w.default.Fragment,null,Ce?w.default.createElement(w.default.Fragment,null,Ie.animation?w.default.createElement("animate",{ref:ie,attributeName:"stroke-dashoffset",values:Kt*Pt+";0",dur:1/Ie.animation+"s",repeatCount:"indefinite"}):null):w.default.createElement(w.default.Fragment,null,ke?w.default.createElement("animate",{ref:F,id:"svgEndAnimate",attributeName:"stroke-dashoffset",values:kr+";"+ti,dur:ei,repeatCount:Li}):null))),Ye?w.default.createElement("g",p({fill:$,pointerEvents:"auto",transform:"translate("+sn+","+Lt+") rotate("+Te.tailOrient+") scale("+Te.fTailSize+")"},se,nt),Se.svgElem):null,He?w.default.createElement("g",p({ref:K,fill:fe,pointerEvents:"auto",transform:"translate("+Oe+","+Qt+") rotate("+Te.headOrient+") scale("+Te.fHeadSize+")",opacity:ke&&!Ce?0:1},se,we),w.default.createElement("animate",{ref:ae,dur:"0.4",attributeName:"opacity",from:"0",to:"1",begin:"indefinite",repeatCount:"0",fill:"freeze"}),J.svgElem):null,X?w.default.createElement(w.default.Fragment,null,w.default.createElement("circle",{r:"5",cx:Te.cpx1,cy:Te.cpy1,fill:"green"}),w.default.createElement("circle",{r:"5",cx:Te.cpx2,cy:Te.cpy2,fill:"blue"}),w.default.createElement("rect",{x:Te.excLeft,y:Te.excUp,width:Te.absDx,height:Te.absDy,fill:"none",stroke:"pink",strokeWidth:"2px"})):null),P.start?w.default.createElement("div",{style:{transform:Te.dx<0?"translate(-100% , -50%)":"translate(-0% , -50%)",width:"max-content",position:"absolute",left:Te.cx0+Te.labelStartPos.x,top:Te.cy0+Te.labelStartPos.y-Ne-5}},P.start):null,P.middle?w.default.createElement("div",{style:{display:"table",width:"max-content",transform:"translate(-50% , -50%)",position:"absolute",left:Te.cx0+Te.labelMiddlePos.x,top:Te.cy0+Te.labelMiddlePos.y}},P.middle):null,P.end?w.default.createElement("div",{style:{transform:Te.dx>0?"translate(-100% , -50%)":"translate(-0% , -50%)",width:"max-content",position:"absolute",left:Te.cx0+Te.labelEndPos.x,top:Te.cy0+Te.labelEndPos.y+Ne+5}},P.end):null,X?w.default.createElement(w.default.Fragment,null,S(S([],Te.startPoints),Te.endPoints).map(function(Y,te){return w.default.createElement("div",{key:te,style:{background:"gray",opacity:.5,borderRadius:"50%",transform:"translate(-50%, -50%)",height:5,width:5,position:"absolute",left:Y.x-Te.mainDivPos.x,top:Y.y-Te.mainDivPos.y}})})):null):null)};R.propTypes=A.default,f.default=R},"./src/Xarrow/anchors.ts":function(c,f,d){c=d.nmd(c),Object.defineProperty(f,"__esModule",{value:!0}),f.calcAnchors=void 0;var p=function(v,b){return{middle:{x:v*.5,y:b*.5},left:{x:0,y:b*.5},right:{x:v,y:b*.5},top:{x:v*.5,y:0},bottom:{x:v*.5,y:b}}},m=function(v,b){return v.map(function(S){var x=p(b.right-b.x,b.bottom-b.y),w=x[S.position],C=w.x,T=w.y;return{x:b.x+C+S.offset.x,y:b.y+T+S.offset.y,anchor:S}})};f.calcAnchors=m,d.c[d.s]},"./src/Xarrow/propTypes.ts":function(c,f,d){var p=this&&this.__importDefault||function(V){return V&&V.__esModule?V:{default:V}};Object.defineProperty(f,"__esModule",{value:!0});var m=p(d("prop-types")),v=d("./src/constants.tsx"),b=m.default.oneOf(v.cAnchorEdge),S=m.default.exact({position:b.isRequired,offset:m.default.exact({x:m.default.number,y:m.default.number}).isRequired}),x=m.default.oneOfType([b,S]),w=m.default.oneOfType([x,m.default.arrayOf(x)]),C=m.default.oneOfType([m.default.string,m.default.exact({current:m.default.any})]),T=m.default.oneOfType([m.default.element,m.default.string]),A=m.default.exact({start:T,middle:T,end:T}),_=m.default.oneOf(Object.keys(v.arrowShapes)),R=m.default.any,M=m.default.oneOfType([_,m.default.exact({svgElem:R,offsetForward:m.default.number}).isRequired]),I={start:C.isRequired,end:C.isRequired,startAnchor:w,endAnchor:w,labels:m.default.oneOfType([T,A]),color:m.default.string,lineColor:m.default.string,showHead:m.default.bool,headColor:m.default.string,headSize:m.default.number,tailSize:m.default.number,tailColor:m.default.string,strokeWidth:m.default.number,showTail:m.default.bool,path:m.default.oneOf(v.cPaths),showXarrow:m.default.bool,curveness:m.default.number,gridBreak:m.default.string,dashness:m.default.oneOfType([m.default.bool,m.default.object]),headShape:M,tailShape:M,animateDrawing:m.default.oneOfType([m.default.bool,m.default.number]),zIndex:m.default.number,passProps:m.default.object,arrowBodyProps:m.default.object,arrowHeadProps:m.default.object,arrowTailProps:m.default.object,SVGcanvasProps:m.default.object,divContainerProps:m.default.object,_extendSVGcanvas:m.default.number,_debug:m.default.bool,_cpx1Offset:m.default.number,_cpy1Offset:m.default.number,_cpx2Offset:m.default.number,_cpy2Offset:m.default.number};f.default=I},"./src/Xarrow/useXarrowProps.ts":function(c,f,d){var p=this&&this.__assign||function(){return p=Object.assign||function(J){for(var Se,Ee=1,ke=arguments.length;Ee<ke;Ee++){Se=arguments[Ee];for(var oe in Se)Object.prototype.hasOwnProperty.call(Se,oe)&&(J[oe]=Se[oe])}return J},p.apply(this,arguments)},m=this&&this.__createBinding||(Object.create?function(J,Se,Ee,ke){ke===void 0&&(ke=Ee),Object.defineProperty(J,ke,{enumerable:!0,get:function(){return Se[Ee]}})}:function(J,Se,Ee,ke){ke===void 0&&(ke=Ee),J[ke]=Se[Ee]}),v=this&&this.__setModuleDefault||(Object.create?function(J,Se){Object.defineProperty(J,"default",{enumerable:!0,value:Se})}:function(J,Se){J.default=Se}),b=this&&this.__importStar||function(J){if(J&&J.__esModule)return J;var Se={};if(J!=null)for(var Ee in J)Ee!=="default"&&Object.prototype.hasOwnProperty.call(J,Ee)&&m(Se,J,Ee);return v(Se,J),Se},S=this&&this.__importDefault||function(J){return J&&J.__esModule?J:{default:J}};Object.defineProperty(f,"__esModule",{value:!0});var x=b(d("react")),w=d("./src/Xarrow/utils/index.ts"),C=S(d("lodash")),T=d("./src/constants.tsx"),A=function(J){var Se={start:null,middle:null,end:null};if(J)if(typeof J=="string"||x.default.isValidElement(J))Se.middle=J;else for(var Ee in J)Se[Ee]=J[Ee];return Se},_=function(J){var Se=Array.isArray(J)?J:[J],Ee=Se.map(function(se){return typeof se=="string"?{position:se}:se});Ee=Ee.filter(function(se){return T.cAnchorEdge.includes(se.position)}),Ee.length==0&&(Ee=[{position:"auto"}]);var ke=Ee.filter(function(se){return se.position==="auto"});ke.length>0&&(Ee=Ee.filter(function(se){return se.position!=="auto"}),Ee.push.apply(Ee,ke.flatMap(function(se){return["left","right","top","bottom"].map(function(ue){return p(p({},se),{position:ue})})})));var oe=Ee.map(function(se){if(typeof se=="object"){var ue=se;return ue.position||(ue.position="auto"),ue.offset||(ue.offset={x:0,y:0}),ue.offset.y||(ue.offset.y=0),ue.offset.x||(ue.offset.x=0),ue=ue,ue}else return se});return oe},R=function(J,Se){var Ee=0,ke=0,oe,se=1;return typeof J=="object"?(Ee=J.strokeLen||Se.strokeWidth*2,ke=J.strokeLen?J.nonStrokeLen:Se.strokeWidth,oe=J.animation?J.animation:null):typeof J=="boolean"&&J&&(Ee=Se.strokeWidth*2,ke=Se.strokeWidth,oe=null),{strokeLen:Ee,nonStrokeLen:ke,animation:oe,animDirection:se}},M=function(J){return typeof J=="string"&&(J in T.arrowShapes?J=T.arrowShapes[J]:(console.warn("'"+J+"' is not supported arrow shape. the supported arrow shapes is one of "+T.cArrowShapes+`.
193
+ reverting to default shape.`),J=T.arrowShapes.arrow1)),J=J,(J==null?void 0:J.offsetForward)===void 0&&(J.offsetForward=.25),(J==null?void 0:J.svgElem)===void 0&&(J.svgElem="path"),J},I=function(J){var Se=w.xStr2absRelative(J);return Se||(Se={relative:.5,abs:0}),Se},V=function(J,Se){return Se&&(Se.current=!0),J},U=function(J){return J},L=function(J,Se,Ee){return V(J,Ee)},G=function(J,Se,Ee){return V(Number(J),Ee)},K=function(J){return Number(J)},F={start:function(J){return w.getElementByPropGiven(J)},end:function(J){return w.getElementByPropGiven(J)},startAnchor:function(J,Se,Ee){return V(_(J),Ee)},endAnchor:function(J,Se,Ee){return V(_(J),Ee)},labels:function(J){return A(J)},color:U,lineColor:function(J,Se){return J||Se.color},headColor:function(J,Se){return J||Se.color},tailColor:function(J,Se){return J||Se.color},strokeWidth:G,showHead:L,headSize:G,showTail:L,tailSize:G,path:L,curveness:G,gridBreak:function(J,Se,Ee){return V(I(J),Ee)},dashness:function(J,Se){return R(J,Se)},headShape:function(J){return M(J)},tailShape:function(J){return M(J)},showXarrow:U,animateDrawing:U,zIndex:K,passProps:U,arrowBodyProps:L,arrowHeadProps:L,arrowTailProps:L,SVGcanvasProps:L,divContainerProps:L,divContainerStyle:L,SVGcanvasStyle:L,_extendSVGcanvas:L,_debug:L,_cpx1Offset:L,_cpy1Offset:L,_cpx2Offset:L,_cpy2Offset:L},ie={};for(var ae in F)ie[ae]=[ae];for(var re=0,W=["lineColor","headColor","tailColor"];re<W.length;re++){var ae=W[re];ie[ae].push("color")}var P=function(J,Se){for(var Ee,ke=0,oe=Object.entries(J);ke<oe.length;ke++){var se=oe[ke],ue=se[0],we=se[1];Se[ue]=(Ee=F==null?void 0:F[ue])===null||Ee===void 0?void 0:Ee.call(F,we,Se)}return Se},he={start:null,end:null,startAnchor:"auto",endAnchor:"auto",labels:null,color:"CornflowerBlue",lineColor:null,headColor:null,tailColor:null,strokeWidth:4,showHead:!0,headSize:6,showTail:!1,tailSize:6,path:"smooth",curveness:.8,gridBreak:"50%",dashness:!1,headShape:"arrow1",tailShape:"arrow1",showXarrow:!0,animateDrawing:!1,zIndex:0,passProps:{},arrowBodyProps:{},arrowHeadProps:{},arrowTailProps:{},SVGcanvasProps:{},divContainerProps:{},divContainerStyle:{},SVGcanvasStyle:{},_extendSVGcanvas:0,_debug:!1,_cpx1Offset:0,_cpy1Offset:0,_cpx2Offset:0,_cpy2Offset:0},fe={};fe=P(he,fe);var $={startPos:{x:0,y:0,right:0,bottom:0},endPos:{x:0,y:0,right:0,bottom:0}};function Ne(J,Se){return C.default.isEqual(J,Se)}function He(J){var Se=x.useRef();return Ne(J,Se.current)||(Se.current=J),Se.current}function Ye(J,Se){x.useLayoutEffect(J,Se.map(He))}var Ie=function(J,Se){var Ee=x.useState(fe),ke=Ee[0],oe=Ee[1],se=x.useRef(!1);ke.shouldUpdatePosition=se;var ue=p(p({},he),J),we=function(ne){x.useLayoutEffect(function(){var _e;ke[ne]=(_e=F==null?void 0:F[ne])===null||_e===void 0?void 0:_e.call(F,ue[ne],ke,se),oe(p({},ke))},ie[ne].map(function(_e){return J[_e]}))};for(var nt in he)we(nt);var et=x.useState($),wt=et[0],nn=et[1],z=w.getElemPos(ke.start);Ye(function(){wt.startPos=z,se.current=!0,nn(p({},wt))},[z]);var X=w.getElemPos(ke.end);return Ye(function(){wt.endPos=X,se.current=!0,nn(p({},wt))},[X]),x.useLayoutEffect(function(){se.current=!0,nn(p({},wt))},[ke.headShape.svgElem,ke.tailShape.svgElem]),[ke,wt]};f.default=Ie},"./src/Xarrow/utils/GetPosition.tsx":function(c,f,d){var p=this&&this.__importDefault||function(C){return C&&C.__esModule?C:{default:C}};Object.defineProperty(f,"__esModule",{value:!0}),f.getPosition=void 0;var m=d("./src/Xarrow/anchors.ts"),v=d("./src/Xarrow/utils/index.ts"),b=p(d("lodash")),S=d("./src/constants.tsx"),x=d("./src/Xarrow/utils/buzzier.js"),w=function(C,T){var A,_,R,M,I=C[0],V=C[1],U=I.startAnchor,L=I.endAnchor,G=I.strokeWidth,K=I.showHead,F=I.headSize,ie=I.showTail,ae=I.tailSize,re=I.path,W=I.curveness,P=I.gridBreak,he=I.headShape,fe=I.tailShape,$=I._extendSVGcanvas,Ne=I._cpx1Offset,He=I._cpy1Offset,Ye=I._cpx2Offset,Ie=I._cpy2Offset,J=V.startPos,Se=V.endPos,Ee=T.current,ke=Ee.svgRef,oe=Ee.lineRef,se=0,ue=0,we=m.calcAnchors(U,J),nt=m.calcAnchors(L,Se),et=v.getShortestLine(we,nt),wt=et.chosenStart,nn=et.chosenEnd,z=wt.anchor.position,X=nn.anchor.position,ne=b.default.pick(wt,["x","y"]),_e=b.default.pick(nn,["x","y"]),Ce=v.getSvgPos(ke),j=Math.min(ne.x,_e.x)-Ce.x,ee=Math.min(ne.y,_e.y)-Ce.y,de=_e.x-ne.x,Ae=_e.y-ne.y,Be=Math.abs(_e.x-ne.x),Te=Math.abs(_e.y-ne.y),je=de>0?1:-1,Oe=Ae>0?1:-1,Qt=[he.offsetForward,fe.offsetForward],sn=Qt[0],Lt=Qt[1],Kt=F*G,Pt=ae*G,fo=0,ei=0,Li=0,kr=0,ti=Kt*sn,Y=Pt*Lt,te=Number(W);S.cPaths.includes(re)||(re="smooth"),re==="straight"&&(te=0,re="smooth");var pe=F>ae?F:ae,Me=G+G*pe/2,Ue=Me,at=Me,it=Me,st=Me;at+=Number($),Ue+=Number($),it+=Number($),st+=Number($);var qe=0,pt=Be,qt=0,lt=Te;if(de<0&&(A=[pt,qe],qe=A[0],pt=A[1]),Ae<0&&(_=[lt,qt],qt=_[0],lt=_[1]),te===0){var Nt=Math.atan(Te/Be);K&&(pt-=Kt*(1-sn)*je*Math.cos(Nt),lt-=Kt*(1-sn)*Oe*Math.sin(Nt),Nt*=Oe,je<0&&(Nt=(Math.PI-Nt*je)*je),fo=Math.cos(Nt)*ti-Math.sin(Nt)*Kt/2,ei=Math.cos(Nt)*Kt/2+Math.sin(Nt)*ti,se=Nt*180/Math.PI);var rn=Math.atan(Te/Be);ie&&(qe+=Pt*(1-Lt)*je*Math.cos(rn),qt+=Pt*(1-Lt)*Oe*Math.sin(rn),rn*=-Oe,je>0&&(rn=(Math.PI-rn*je)*je),Li=Math.cos(rn)*Y-Math.sin(rn)*Pt/2,kr=Math.cos(rn)*Pt/2+Math.sin(rn)*Y,ue=rn*180/Math.PI)}else X==="middle"&&(Be>Te?X=je?"left":"right":X=Oe?"top":"bottom"),K&&(["left","right"].includes(X)?(fo+=ti*je,pt-=Kt*(1-sn)*je,ei+=Kt*je/2,X==="left"?(se=0,je<0&&(se+=180)):(se=180,je>0&&(se+=180))):["top","bottom"].includes(X)&&(fo+=Kt*-Oe/2,ei+=ti*Oe,lt-=Kt*Oe-ei,X==="top"?(se=270,Oe>0&&(se+=180)):(se=90,Oe<0&&(se+=180))));ie&&te!==0&&(["left","right"].includes(z)?(Li+=Y*-je,qe+=Pt*je+Li,kr+=-(Pt*je)/2,z==="left"?(ue=180,je<0&&(ue+=180)):(ue=0,je>0&&(ue+=180))):["top","bottom"].includes(z)&&(kr+=Y*-Oe,qt+=Pt*Oe+kr,Li+=Pt*Oe/2,z==="top"?(ue=90,Oe>0&&(ue+=180)):(ue=270,Oe<0&&(ue+=180))));var zr={x:fo,y:ei},zn={x:Li,y:kr},Vn=qe,cr=qt,Yn=pt,Pn=lt,$i={};re==="smooth"?$i={hh:function(){Vn+=Be*te*je,Yn-=Be*te*je},vv:function(){cr+=Te*te*Oe,Pn-=Te*te*Oe},hv:function(){Vn+=Be*te*je,Pn-=Te*te*Oe},vh:function(){cr+=Te*te*Oe,Yn-=Be*te*je}}:re==="grid"&&($i={hh:function(){Vn+=(Be*P.relative+P.abs)*je,Yn-=(Be*(1-P.relative)-P.abs)*je,K&&(Vn-=Kt*(1-sn)/2*je,Yn+=Kt*(1-sn)/2*je),ie&&(Vn-=Pt*(1-Lt)/2*je,Yn+=Pt*(1-Lt)/2*je)},vv:function(){cr+=(Te*P.relative+P.abs)*Oe,Pn-=(Te*(1-P.relative)-P.abs)*Oe,K&&(cr-=Kt*(1-sn)/2*Oe,Pn+=Kt*(1-sn)/2*Oe),ie&&(cr-=Pt*(1-Lt)/2*Oe,Pn+=Pt*(1-Lt)/2*Oe)},hv:function(){Vn=pt},vh:function(){cr=lt}});var Er="";["left","right"].includes(z)?Er+="h":["bottom","top"].includes(z)?Er+="v":z==="middle"&&(Er+="m"),["left","right"].includes(X)?Er+="h":["bottom","top"].includes(X)?Er+="v":X==="middle"&&(Er+="m"),Be>Te?Er=Er.replace(/m/g,"h"):Er=Er.replace(/m/g,"v"),$i[Er](),Vn+=Ne,cr+=He,Yn+=Ye,Pn+=Ie;var Ya=x.buzzierMinSols(qe,Vn,Yn,pt),Xa=Ya[0],Wo=Ya[1],la=x.buzzierMinSols(qt,cr,Pn,lt),Vt=la[0],an=la[1];Xa<0&&(at+=-Xa),Wo>Be&&(Ue+=Wo-Be),Vt<0&&(it+=-Vt),an>Te&&(st+=an-Te),re==="grid"&&(at+=Me,Ue+=Me,it+=Me,st+=Me),qe+=at,pt+=at,qt+=it,lt+=it,Vn+=at,Yn+=at,cr+=it,Pn+=it;var _r=Be+at+Ue,Za=Te+it+st;j-=at,ee-=it;var uc=x.bzFunction(qe,Vn,Yn,pt),Hd=x.bzFunction(qt,cr,Pn,lt),Ym={x:uc(.01),y:Hd(.01)},Xm={x:uc(.5),y:Hd(.5)},Zm={x:uc(.99),y:Hd(.99)},qd;return re==="grid"?qd="M "+qe+" "+qt+" L "+Vn+" "+cr+" L "+Yn+" "+Pn+" "+pt+" "+lt:re==="smooth"&&(qd="M "+qe+" "+qt+" C "+Vn+" "+cr+", "+Yn+" "+Pn+", "+pt+" "+lt),{cx0:j,cy0:ee,x1:qe,x2:pt,y1:qt,y2:lt,cw:_r,ch:Za,cpx1:Vn,cpy1:cr,cpx2:Yn,cpy2:Pn,dx:de,dy:Ae,absDx:Be,absDy:Te,headOrient:se,tailOrient:ue,labelStartPos:Ym,labelMiddlePos:Xm,labelEndPos:Zm,excLeft:at,excRight:Ue,excUp:it,excDown:st,headOffset:ti,arrowHeadOffset:zr,arrowTailOffset:zn,startPoints:we,endPoints:nt,mainDivPos:Ce,xSign:je,ySign:Oe,lineLength:(M=(R=oe.current)===null||R===void 0?void 0:R.getTotalLength())!==null&&M!==void 0?M:0,fHeadSize:Kt,fTailSize:Pt,arrowPath:qd}};f.getPosition=w},"./src/Xarrow/utils/index.ts":function(c,f){Object.defineProperty(f,"__esModule",{value:!0}),f.getSvgPos=f.getElemPos=f.getShortestLine=f.xStr2absRelative=f.factorDpathStr=f.getElementByPropGiven=void 0;var d=function(w){var C;return typeof w=="string"?C=document.getElementById(w):C=w==null?void 0:w.current,C};f.getElementByPropGiven=d;var p=function(w,C){var T=w.split(/(\d+(?:\.\d+)?)/);return T=T.map(function(A){return Number(A)?(Number(A)*C).toString():A}),T.join("")};f.factorDpathStr=p;var m=function(w){if(typeof w!="string")return{abs:0,relative:.5};var C=w.split("%"),T=0,A=0;if(C.length==1){var _=parseFloat(C[0]);if(!isNaN(_))return T=_,{abs:T,relative:0}}else if(C.length==2){var R=[parseFloat(C[0]),parseFloat(C[1])],M=R[0],I=R[1];if(isNaN(M)||(A=M/100),isNaN(I)||(T=I),!isNaN(M)||!isNaN(I))return{abs:T,relative:A}}};f.xStr2absRelative=m;var v=function(w,C){return Math.sqrt(Math.pow(w.x-C.x,2)+Math.pow(w.y-C.y,2))},b=function(w,C){var T=1/0,A=1/0,_;return w.forEach(function(R){C.forEach(function(M){A=v(R,M),A<T&&(T=A,_={chosenStart:R,chosenEnd:M})})}),_};f.getShortestLine=b;var S=function(w){if(!w)return{x:0,y:0,right:0,bottom:0};var C=w.getBoundingClientRect();return{x:C.left,y:C.top,right:C.right,bottom:C.bottom}};f.getElemPos=S;var x=function(w){if(!w.current)return{x:0,y:0};var C=w.current.getBoundingClientRect(),T=C.left,A=C.top,_=getComputedStyle(w.current),R=Number(_.left.slice(0,-2)),M=Number(_.top.slice(0,-2));return{x:T-R,y:A-M}};f.getSvgPos=x},"./src/Xwrapper.tsx":function(c,f,d){var p=this&&this.__createBinding||(Object.create?function(A,_,R,M){M===void 0&&(M=R),Object.defineProperty(A,M,{enumerable:!0,get:function(){return _[R]}})}:function(A,_,R,M){M===void 0&&(M=R),A[M]=_[R]}),m=this&&this.__setModuleDefault||(Object.create?function(A,_){Object.defineProperty(A,"default",{enumerable:!0,value:_})}:function(A,_){A.default=_}),v=this&&this.__importStar||function(A){if(A&&A.__esModule)return A;var _={};if(A!=null)for(var R in A)R!=="default"&&Object.prototype.hasOwnProperty.call(A,R)&&p(_,A,R);return m(_,A),_};Object.defineProperty(f,"__esModule",{value:!0}),f.XarrowContext=f.XelemContext=void 0;var b=v(d("react"));f.XelemContext=b.default.createContext(null),f.XarrowContext=b.default.createContext(null);var S={},x=0,w=function(A){var _=A.children,R=A.instanceCount,M=b.useState({}),I=M[1],V=function(){return I({})};return b.useEffect(function(){R.current=x,S[R.current]=V},[]),b.default.createElement(f.XarrowContext.Provider,{value:V},_)},C=function(A){var _=A.children,R=A.instanceCount;return b.default.createElement(f.XelemContext.Provider,{value:S[R.current]},_)},T=function(A){var _=A.children,R=b.useRef(x),M=b.useState({}),I=M[1];return b.useEffect(function(){return x++,I({}),function(){delete S[R.current]}},[]),b.default.createElement(C,{instanceCount:R},b.default.createElement(w,{instanceCount:R},_))};f.default=T},"./src/constants.tsx":function(c,f,d){var p=this&&this.__importDefault||function(v){return v&&v.__esModule?v:{default:v}};Object.defineProperty(f,"__esModule",{value:!0}),f.cArrowShapes=f.arrowShapes=f.cSvgElems=f.cPaths=f.cAnchorEdge=void 0;var m=p(d("react"));f.cAnchorEdge=["middle","left","right","top","bottom","auto"],f.cPaths=["smooth","grid","straight"],f.cSvgElems=["circle","ellipse","line","path","polygon","polyline","rect"],f.arrowShapes={arrow1:{svgElem:m.default.createElement("path",{d:"M 0 0 L 1 0.5 L 0 1 L 0.25 0.5 z"}),offsetForward:.25},heart:{svgElem:m.default.createElement("path",{d:"M 0,0.25 A 0.125,0.125 0,0,1 0.5,0.25 A 0.125,0.125 0,0,1 1,0.25 Q 1,0.625 0.5,1 Q 0,0.625 0,0.25 z"}),offsetForward:.1},circle:{svgElem:m.default.createElement("circle",{r:.5,cx:.5,cy:.5}),offsetForward:0}},f.cArrowShapes=Object.keys(f.arrowShapes)},"./src/index.tsx":function(c,f,d){var p=this&&this.__createBinding||(Object.create?function(w,C,T,A){A===void 0&&(A=T),Object.defineProperty(w,A,{enumerable:!0,get:function(){return C[T]}})}:function(w,C,T,A){A===void 0&&(A=T),w[A]=C[T]}),m=this&&this.__exportStar||function(w,C){for(var T in w)T!=="default"&&!Object.prototype.hasOwnProperty.call(C,T)&&p(C,w,T)},v=this&&this.__importDefault||function(w){return w&&w.__esModule?w:{default:w}};Object.defineProperty(f,"__esModule",{value:!0}),f.useXarrow=f.Xwrapper=f.default=void 0;var b=d("./src/Xarrow/Xarrow.tsx");Object.defineProperty(f,"default",{enumerable:!0,get:function(){return v(b).default}}),m(d("./src/types.ts"),f),m(d("./src/constants.tsx"),f);var S=d("./src/Xwrapper.tsx");Object.defineProperty(f,"Xwrapper",{enumerable:!0,get:function(){return v(S).default}});var x=d("./src/useXarrow.tsx");Object.defineProperty(f,"useXarrow",{enumerable:!0,get:function(){return v(x).default}})},"./src/types.ts":function(c,f){Object.defineProperty(f,"__esModule",{value:!0})},"./src/useXarrow.tsx":function(c,f,d){Object.defineProperty(f,"__esModule",{value:!0});var p=d("react"),m=d("./src/Xwrapper.tsx"),v=function(){var b=p.useState({}),S=b[1],x=function(){return S({})},w=p.useContext(m.XelemContext);return w||(w=function(){}),p.useLayoutEffect(function(){w()}),x};f.default=v},lodash:function(c){c.exports=r},"prop-types":function(c){c.exports=i},react:function(c){c.exports=n}},s={};function a(c){var f=s[c];if(f!==void 0)return f.exports;var d=s[c]={id:c,loaded:!1,exports:{}};return o[c].call(d.exports,d,d.exports,a),d.loaded=!0,d.exports}a.c=s,function(){a.d=function(c,f){for(var d in f)a.o(f,d)&&!a.o(c,d)&&Object.defineProperty(c,d,{enumerable:!0,get:f[d]})}}(),function(){a.o=function(c,f){return Object.prototype.hasOwnProperty.call(c,f)}}(),function(){a.r=function(c){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(c,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(c,"__esModule",{value:!0})}}(),function(){a.nmd=function(c){return c.paths=[],c.children||(c.children=[]),c}}();var l=a(a.s="./src/index.tsx");return l}()})})(a6);var O2=a6.exports;const zN=Su(O2);function i1(t){const e=g.useRef({value:t,previous:t});return g.useMemo(()=>(e.current.value!==t&&(e.current.previous=e.current.value,e.current.value=t),e.current.previous),[t])}const c6="Checkbox",[Bse,zCe]=Fo(c6),[Fse,zse]=Bse(c6),Vse=g.forwardRef((t,e)=>{const{__scopeCheckbox:n,name:r,checked:i,defaultChecked:o,required:s,disabled:a,value:l="on",onCheckedChange:c,...f}=t,[d,p]=g.useState(null),m=hn(e,C=>p(C)),v=g.useRef(!1),b=d?!!d.closest("form"):!0,[S=!1,x]=Zs({prop:i,defaultProp:o,onChange:c}),w=g.useRef(S);return g.useEffect(()=>{const C=d==null?void 0:d.form;if(C){const T=()=>x(w.current);return C.addEventListener("reset",T),()=>C.removeEventListener("reset",T)}},[d,x]),g.createElement(Fse,{scope:n,state:S,disabled:a},g.createElement(Dt.button,H({type:"button",role:"checkbox","aria-checked":Xc(S)?"mixed":S,"aria-required":s,"data-state":u6(S),"data-disabled":a?"":void 0,disabled:a,value:l},f,{ref:m,onKeyDown:yt(t.onKeyDown,C=>{C.key==="Enter"&&C.preventDefault()}),onClick:yt(t.onClick,C=>{x(T=>Xc(T)?!0:!T),b&&(v.current=C.isPropagationStopped(),v.current||C.stopPropagation())})})),b&&g.createElement(Hse,{control:d,bubbles:!v.current,name:r,value:l,checked:S,required:s,disabled:a,style:{transform:"translateX(-100%)"}}))}),Use="CheckboxIndicator",Wse=g.forwardRef((t,e)=>{const{__scopeCheckbox:n,forceMount:r,...i}=t,o=zse(Use,n);return g.createElement(ws,{present:r||Xc(o.state)||o.state===!0},g.createElement(Dt.span,H({"data-state":u6(o.state),"data-disabled":o.disabled?"":void 0},i,{ref:e,style:{pointerEvents:"none",...t.style}})))}),Hse=t=>{const{control:e,checked:n,bubbles:r=!0,...i}=t,o=g.useRef(null),s=i1(n),a=Ib(e);return g.useEffect(()=>{const l=o.current,c=window.HTMLInputElement.prototype,d=Object.getOwnPropertyDescriptor(c,"checked").set;if(s!==n&&d){const p=new Event("click",{bubbles:r});l.indeterminate=Xc(n),d.call(l,Xc(n)?!1:n),l.dispatchEvent(p)}},[s,n,r]),g.createElement("input",H({type:"checkbox","aria-hidden":!0,defaultChecked:Xc(n)?!1:n},i,{tabIndex:-1,ref:o,style:{...t.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function Xc(t){return t==="indeterminate"}function u6(t){return Xc(t)?"indeterminate":t?"checked":"unchecked"}const f6=Vse,qse=Wse,d6=g.forwardRef(({className:t,...e},n)=>k.jsx(f6,{ref:n,className:ft("border-primary focus-visible:ring-ring data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground peer h-4 w-4 shrink-0 rounded-sm border shadow focus-visible:outline-none focus-visible:ring-1 disabled:cursor-not-allowed disabled:opacity-50",t),...e,children:k.jsx(qse,{className:ft("flex items-center justify-center text-current"),children:k.jsx(u2,{className:"h-4 w-4"})})}));d6.displayName=f6.displayName;function Bt(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o<r.length;o++)i=r[o],!(e.indexOf(i)>=0)&&(n[i]=t[i]);return n}var h6={},p6=g.createContext(h6),Kse=(t,e)=>H({},t,e),Gse=()=>g.useContext(p6),R2=g.createContext(()=>{});R2.displayName="JVR.DispatchShowTools";function Yse(){return g.useReducer(Kse,h6)}function m6(){return g.useContext(R2)}var g6=t=>{var{initial:e,dispatch:n,children:r}=t;return k.jsx(p6.Provider,{value:e,children:k.jsx(R2.Provider,{value:n,children:r})})};g6.displayName="JVR.ShowTools";var v6={},y6=g.createContext(v6),Xse=(t,e)=>H({},t,e),o1=()=>g.useContext(y6),P2=g.createContext(()=>{});P2.displayName="JVR.DispatchExpands";function Zse(){return g.useReducer(Xse,v6)}function Qse(){return g.useContext(P2)}var b6=t=>{var{initial:e,dispatch:n,children:r}=t;return k.jsx(y6.Provider,{value:e,children:k.jsx(P2.Provider,{value:n,children:r})})};b6.displayName="JVR.Expands";var w6={Str:{as:"span","data-type":"string",style:{color:"var(--w-rjv-type-string-color, #cb4b16)"},className:"w-rjv-type",children:"string"},Url:{as:"a",style:{color:"var(--w-rjv-type-url-color, #0969da)"},"data-type":"url",className:"w-rjv-type",children:"url"},Undefined:{style:{color:"var(--w-rjv-type-undefined-color, #586e75)"},as:"span","data-type":"undefined",className:"w-rjv-type",children:"undefined"},Null:{style:{color:"var(--w-rjv-type-null-color, #d33682)"},as:"span","data-type":"null",className:"w-rjv-type",children:"null"},Map:{style:{color:"var(--w-rjv-type-map-color, #268bd2)",marginRight:3},as:"span","data-type":"map",className:"w-rjv-type",children:"Map"},Nan:{style:{color:"var(--w-rjv-type-nan-color, #859900)"},as:"span","data-type":"nan",className:"w-rjv-type",children:"NaN"},Bigint:{style:{color:"var(--w-rjv-type-bigint-color, #268bd2)"},as:"span","data-type":"bigint",className:"w-rjv-type",children:"bigint"},Int:{style:{color:"var(--w-rjv-type-int-color, #268bd2)"},as:"span","data-type":"int",className:"w-rjv-type",children:"int"},Set:{style:{color:"var(--w-rjv-type-set-color, #268bd2)",marginRight:3},as:"span","data-type":"set",className:"w-rjv-type",children:"Set"},Float:{style:{color:"var(--w-rjv-type-float-color, #859900)"},as:"span","data-type":"float",className:"w-rjv-type",children:"float"},True:{style:{color:"var(--w-rjv-type-boolean-color, #2aa198)"},as:"span","data-type":"bool",className:"w-rjv-type",children:"bool"},False:{style:{color:"var(--w-rjv-type-boolean-color, #2aa198)"},as:"span","data-type":"bool",className:"w-rjv-type",children:"bool"},Date:{style:{color:"var(--w-rjv-type-date-color, #268bd2)"},as:"span","data-type":"date",className:"w-rjv-type",children:"date"}},x6=g.createContext(w6),Jse=(t,e)=>H({},t,e),Sn=()=>g.useContext(x6),N2=g.createContext(()=>{});N2.displayName="JVR.DispatchTypes";function eae(){return g.useReducer(Jse,w6)}function tae(){return g.useContext(N2)}function S6(t){var{initial:e,dispatch:n,children:r}=t;return k.jsx(x6.Provider,{value:e,children:k.jsx(N2.Provider,{value:n,children:r})})}S6.displayName="JVR.Types";var nae=["style"];function C6(t){var{style:e}=t,n=Bt(t,nae),r=H({cursor:"pointer",height:"1em",width:"1em",userSelect:"none",display:"flex"},e);return k.jsx("svg",H({viewBox:"0 0 24 24",fill:"var(--w-rjv-arrow-color, currentColor)",style:r},n,{children:k.jsx("path",{d:"M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"})}))}C6.displayName="JVR.TriangleArrow";var k6={Arrow:{as:"span",className:"w-rjv-arrow",style:{transform:"rotate(0deg)",transition:"all 0.3s"},children:k.jsx(C6,{})},Colon:{as:"span",style:{color:"var(--w-rjv-colon-color, var(--w-rjv-color))",marginLeft:0,marginRight:2},className:"w-rjv-colon",children:":"},Quote:{as:"span",style:{color:"var(--w-rjv-quotes-color, #236a7c)"},className:"w-rjv-quotes",children:'"'},ValueQuote:{as:"span",style:{color:"var(--w-rjv-quotes-string-color, #cb4b16)"},className:"w-rjv-quotes",children:'"'},BracketsLeft:{as:"span",style:{color:"var(--w-rjv-brackets-color, #236a7c)"},className:"w-rjv-brackets-start",children:"["},BracketsRight:{as:"span",style:{color:"var(--w-rjv-brackets-color, #236a7c)"},className:"w-rjv-brackets-end",children:"]"},BraceLeft:{as:"span",style:{color:"var(--w-rjv-curlybraces-color, #236a7c)"},className:"w-rjv-curlybraces-start",children:"{"},BraceRight:{as:"span",style:{color:"var(--w-rjv-curlybraces-color, #236a7c)"},className:"w-rjv-curlybraces-end",children:"}"}},E6=g.createContext(k6),rae=(t,e)=>H({},t,e),Mi=()=>g.useContext(E6),M2=g.createContext(()=>{});M2.displayName="JVR.DispatchSymbols";function iae(){return g.useReducer(rae,k6)}function oae(){return g.useContext(M2)}var _6=t=>{var{initial:e,dispatch:n,children:r}=t;return k.jsx(E6.Provider,{value:e,children:k.jsx(M2.Provider,{value:n,children:r})})};_6.displayName="JVR.Symbols";var T6={Copied:{className:"w-rjv-copied",style:{height:"1em",width:"1em",cursor:"pointer",verticalAlign:"middle",marginLeft:5}},CountInfo:{as:"span",className:"w-rjv-object-size",style:{color:"var(--w-rjv-info-color, #0000004d)",paddingLeft:8,fontStyle:"italic"}},CountInfoExtra:{as:"span",className:"w-rjv-object-extra",style:{paddingLeft:8}},Ellipsis:{as:"span",style:{cursor:"pointer",color:"var(--w-rjv-ellipsis-color, #cb4b16)",userSelect:"none"},className:"w-rjv-ellipsis",children:"..."},Row:{as:"div",className:"w-rjv-line"},KeyName:{as:"span",className:"w-rjv-object-key"}},A6=g.createContext(T6),sae=(t,e)=>H({},t,e),zo=()=>g.useContext(A6),D2=g.createContext(()=>{});D2.displayName="JVR.DispatchSection";function aae(){return g.useReducer(sae,T6)}function lae(){return g.useContext(D2)}var O6=t=>{var{initial:e,dispatch:n,children:r}=t;return k.jsx(A6.Provider,{value:e,children:k.jsx(D2.Provider,{value:n,children:r})})};O6.displayName="JVR.Section";var R6={objectSortKeys:!1,indentWidth:15},L2=g.createContext(R6);L2.displayName="JVR.Context";var P6=g.createContext(()=>{});P6.displayName="JVR.DispatchContext";function cae(t,e){return H({},t,e)}var Ou=()=>g.useContext(L2),N6=t=>{var{children:e,initialState:n,initialTypes:r}=t,[i,o]=g.useReducer(cae,Object.assign({},R6,n)),[s,a]=Yse(),[l,c]=Zse(),[f,d]=eae(),[p,m]=iae(),[v,b]=aae();return g.useEffect(()=>o(H({},n)),[n]),k.jsx(L2.Provider,{value:i,children:k.jsx(P6.Provider,{value:o,children:k.jsx(g6,{initial:s,dispatch:a,children:k.jsx(b6,{initial:l,dispatch:c,children:k.jsx(S6,{initial:H({},f,r),dispatch:d,children:k.jsx(_6,{initial:p,dispatch:m,children:k.jsx(O6,{initial:v,dispatch:b,children:e})})})})})})})};N6.displayName="JVR.Provider";function uae(t){if(t==null)throw new TypeError("Cannot destructure "+t)}var fae=["isNumber"],dae=["as","render"],hae=["as","render"],pae=["as","render"],mae=["as","style","render"],gae=["as","render"],vae=["as","render"],yae=["as","render"],bae=["as","render"],nk=t=>{var{Quote:e={}}=Mi(),{isNumber:n}=t,r=Bt(t,fae);if(n)return null;var{as:i,render:o}=e,s=Bt(e,dae),a=i||"span",l=H({},r,s),c=o&&typeof o=="function"&&o(l);return c||k.jsx(a,H({},l))};nk.displayName="JVR.Quote";var nm=t=>{var{ValueQuote:e={}}=Mi(),n=H({},(uae(t),t)),{as:r,render:i}=e,o=Bt(e,hae),s=r||"span",a=H({},n,o),l=i&&typeof i=="function"&&i(a);return l||k.jsx(s,H({},a))};nm.displayName="JVR.ValueQuote";var M6=()=>{var{Colon:t={}}=Mi(),{as:e,render:n}=t,r=Bt(t,pae),i=e||"span",o=n&&typeof n=="function"&&n(r);return o||k.jsx(i,H({},r))};M6.displayName="JVR.Colon";var D6=t=>{var{Arrow:e={}}=Mi(),n=o1(),{expandKey:r}=t,i=!!n[r],{as:o,style:s,render:a}=e,l=Bt(e,mae),c=o||"span",f=a&&typeof a=="function",d=f&&a(H({},l,{"data-expanded":i,style:H({},s,t.style)}));return d||k.jsx(c,H({},l,{style:H({},s,t.style)}))};D6.displayName="JVR.Arrow";var L6=t=>{var{isBrackets:e}=t,{BracketsLeft:n={},BraceLeft:r={}}=Mi();if(e){var{as:i,render:o}=n,s=Bt(n,gae),a=i||"span",l=o&&typeof o=="function"&&o(s);return l||k.jsx(a,H({},s))}var{as:c,render:f}=r,d=Bt(r,vae),p=c||"span",m=f&&typeof f=="function"&&f(d);return m||k.jsx(p,H({},d))};L6.displayName="JVR.BracketsOpen";var $2=t=>{var{isBrackets:e,isVisiable:n}=t;if(!n)return null;var{BracketsRight:r={},BraceRight:i={}}=Mi();if(e){var{as:o,render:s}=r,a=Bt(r,yae),l=o||"span",c=s&&typeof s=="function"&&s(a);return c||k.jsx(l,H({},a))}var{as:f,render:d}=i,p=Bt(i,bae),m=f||"span",v=d&&typeof d=="function"&&d(p);return v||k.jsx(m,H({},p))};$2.displayName="JVR.BracketsClose";var $6=t=>{var e,{value:n,expandKey:r,level:i}=t,o=o1(),s=Array.isArray(n),{collapsed:a}=Ou(),l=n instanceof Set,c=(e=o[r])!=null?e:typeof a=="boolean"?a:typeof a=="number"?i>a:!1,f=Object.keys(n).length;if(c||f===0)return null;var d={paddingLeft:4};return k.jsx("div",{style:d,children:k.jsx($2,{isBrackets:s||l,isVisiable:!0})})};$6.displayName="JVR.NestedClose";var wae=["keyName","value","expandKey"],xae=["as","render"],co=t=>{var{keyName:e,value:n,expandKey:r}=t,i=Bt(t,wae),{onCopied:o,enableClipboard:s}=Ou(),a=Gse(),l=a[r],[c,f]=g.useState(!1),{Copied:d={}}=zo();if(s===!1||!l)return null;var p=C=>{C.stopPropagation();var T="";typeof n=="number"&&n===1/0?T="Infinity":typeof n=="number"&&isNaN(n)?T="NaN":typeof n=="bigint"?T=n+"n":n instanceof Date?T=n.toLocaleString():T=JSON.stringify(n,null,2),o&&o(T,n),f(!0),navigator.clipboard.writeText(T).then(()=>{var A=setTimeout(()=>{f(!1),clearTimeout(A)},3e3)}).catch(A=>{})},m={fill:c?"var(--w-rjv-copied-success-color, #28a745)":"var(--w-rjv-copied-color, currentColor)",onClick:p},{render:v}=d,b=Bt(d,xae),S=H({},b,i,m),x=v&&typeof v=="function",w=x&&v(H({},S,{"data-copied":c}),{value:n,keyName:e});return w||(c?k.jsx("svg",H({viewBox:"0 0 32 36"},S,{children:k.jsx("path",{d:"M27.5,33 L2.5,33 L2.5,12.5 L27.5,12.5 L27.5,15.2249049 C29.1403264,13.8627542 29.9736597,13.1778155 30,13.1700887 C30,11.9705278 30,10.0804982 30,7.5 C30,6.1 28.9,5 27.5,5 L20,5 C20,2.2 17.8,0 15,0 C12.2,0 10,2.2 10,5 L2.5,5 C1.1,5 0,6.1 0,7.5 L0,33 C0,34.4 1.1,36 2.5,36 L27.5,36 C28.9,36 30,34.4 30,33 L30,26.1114493 L27.5,28.4926435 L27.5,33 Z M7.5,7.5 L10,7.5 C10,7.5 12.5,6.4 12.5,5 C12.5,3.6 13.6,2.5 15,2.5 C16.4,2.5 17.5,3.6 17.5,5 C17.5,6.4 18.8,7.5 20,7.5 L22.5,7.5 C22.5,7.5 25,8.6 25,10 L5,10 C5,8.5 6.1,7.5 7.5,7.5 Z M5,27.5 L10,27.5 L10,25 L5,25 L5,27.5 Z M28.5589286,16 L32,19.6 L21.0160714,30.5382252 L13.5303571,24.2571429 L17.1303571,20.6571429 L21.0160714,24.5428571 L28.5589286,16 Z M17.5,15 L5,15 L5,17.5 L17.5,17.5 L17.5,15 Z M10,20 L5,20 L5,22.5 L10,22.5 L10,20 Z"})})):k.jsx("svg",H({viewBox:"0 0 32 36"},S,{children:k.jsx("path",{d:"M27.5,33 L2.5,33 L2.5,12.5 L27.5,12.5 L27.5,20 L30,20 L30,7.5 C30,6.1 28.9,5 27.5,5 L20,5 C20,2.2 17.8,0 15,0 C12.2,0 10,2.2 10,5 L2.5,5 C1.1,5 0,6.1 0,7.5 L0,33 C0,34.4 1.1,36 2.5,36 L27.5,36 C28.9,36 30,34.4 30,33 L30,29 L27.5,29 L27.5,33 Z M7.5,7.5 L10,7.5 C10,7.5 12.5,6.4 12.5,5 C12.5,3.6 13.6,2.5 15,2.5 C16.4,2.5 17.5,3.6 17.5,5 C17.5,6.4 18.8,7.5 20,7.5 L22.5,7.5 C22.5,7.5 25,8.6 25,10 L5,10 C5,8.5 6.1,7.5 7.5,7.5 Z M5,27.5 L10,27.5 L10,25 L5,25 L5,27.5 Z M22.5,21.5 L22.5,16.5 L12.5,24 L22.5,31.5 L22.5,26.5 L32,26.5 L32,21.5 L22.5,21.5 Z M17.5,15 L5,15 L5,17.5 L17.5,17.5 L17.5,15 Z M10,20 L5,20 L5,22.5 L10,22.5 L10,20 Z"})})))};co.displayName="JVR.Copied";var Sae=["as","render"],Cae=["as","render"],kae=["as","render"],Eae=["as","render"],_ae=["as","render"],Tae=["as","render"],Aae=["as","render"],Oae=["as","render"],Rae=["as","render"],Pae=["as","render"],Nae=["as","render"],Mae=["as","render"],Dae=["as","render"],I6=t=>{var{value:e,keyName:n}=t,{Set:r={},displayDataTypes:i}=Sn(),o=e instanceof Set;if(!o||!i)return null;var{as:s,render:a}=r,l=Bt(r,Sae),c=a&&typeof a=="function",f=c&&a(l,{type:"type",value:e,keyName:n});if(f)return f;var d=s||"span";return k.jsx(d,H({},l))};I6.displayName="JVR.SetComp";var j6=t=>{var{value:e,keyName:n}=t,{Map:r={},displayDataTypes:i}=Sn(),o=e instanceof Map;if(!o||!i)return null;var{as:s,render:a}=r,l=Bt(r,Cae),c=a&&typeof a=="function",f=c&&a(l,{type:"type",value:e,keyName:n});if(f)return f;var d=s||"span";return k.jsx(d,H({},l))};j6.displayName="JVR.MapComp";var Ss={opacity:.75,paddingRight:4},B6=t=>{var{children:e="",expandKey:n,keyName:r}=t,{Str:i={},displayDataTypes:o}=Sn(),{shortenTextAfterLength:s=30}=Ou(),{as:a,render:l}=i,c=Bt(i,kae),f=e,[d,p]=g.useState(s&&f.length>=s);g.useEffect(()=>p(s&&f.length>=s),[s]);var m=a||"span",v=H({},Ss,i.style||{});s>0&&(c.style=H({},c.style,{cursor:f.length<=s?"initial":"pointer"}),f.length>s&&(c.onClick=()=>{p(!d)}));var b=d?f.slice(0,s)+"...":f,S=l&&typeof l=="function",x=S&&l(H({},c,{style:v}),{type:"type",value:e,keyName:r}),w=S&&l(H({},c,{children:b,className:"w-rjv-value"}),{type:"value",value:e,keyName:r});return k.jsxs(g.Fragment,{children:[o&&(x||k.jsx(m,H({},c,{style:v}))),w||k.jsxs(g.Fragment,{children:[k.jsx(nm,{}),k.jsx(m,H({},c,{className:"w-rjv-value",children:b})),k.jsx(nm,{})]}),k.jsx(co,{keyName:r,value:e,expandKey:n})]})};B6.displayName="JVR.TypeString";var F6=t=>{var{children:e,expandKey:n,keyName:r}=t,{True:i={},displayDataTypes:o}=Sn(),{as:s,render:a}=i,l=Bt(i,Eae),c=s||"span",f=H({},Ss,i.style||{}),d=a&&typeof a=="function",p=d&&a(H({},l,{style:f}),{type:"type",value:e,keyName:r}),m=d&&a(H({},l,{children:e,className:"w-rjv-value"}),{type:"value",value:e,keyName:r});return k.jsxs(g.Fragment,{children:[o&&(p||k.jsx(c,H({},l,{style:f}))),m||k.jsx(c,H({},l,{className:"w-rjv-value",children:e==null?void 0:e.toString()})),k.jsx(co,{keyName:r,value:e,expandKey:n})]})};F6.displayName="JVR.TypeTrue";var z6=t=>{var{children:e,expandKey:n,keyName:r}=t,{False:i={},displayDataTypes:o}=Sn(),{as:s,render:a}=i,l=Bt(i,_ae),c=s||"span",f=H({},Ss,i.style||{}),d=a&&typeof a=="function",p=d&&a(H({},l,{style:f}),{type:"type",value:e,keyName:r}),m=d&&a(H({},l,{children:e,className:"w-rjv-value"}),{type:"value",value:e,keyName:r});return k.jsxs(g.Fragment,{children:[o&&(p||k.jsx(c,H({},l,{style:f}))),m||k.jsx(c,H({},l,{className:"w-rjv-value",children:e==null?void 0:e.toString()})),k.jsx(co,{keyName:r,value:e,expandKey:n})]})};z6.displayName="JVR.TypeFalse";var V6=t=>{var{children:e,expandKey:n,keyName:r}=t,{Float:i={},displayDataTypes:o}=Sn(),{as:s,render:a}=i,l=Bt(i,Tae),c=s||"span",f=H({},Ss,i.style||{}),d=a&&typeof a=="function",p=d&&a(H({},l,{style:f}),{type:"type",value:e,keyName:r}),m=d&&a(H({},l,{children:e,className:"w-rjv-value"}),{type:"value",value:e,keyName:r});return k.jsxs(g.Fragment,{children:[o&&(p||k.jsx(c,H({},l,{style:f}))),m||k.jsx(c,H({},l,{className:"w-rjv-value",children:e==null?void 0:e.toString()})),k.jsx(co,{keyName:r,value:e,expandKey:n})]})};V6.displayName="JVR.TypeFloat";var U6=t=>{var{children:e,expandKey:n,keyName:r}=t,{Int:i={},displayDataTypes:o}=Sn(),{as:s,render:a}=i,l=Bt(i,Aae),c=s||"span",f=H({},Ss,i.style||{}),d=a&&typeof a=="function",p=d&&a(H({},l,{style:f}),{type:"type",value:e,keyName:r}),m=d&&a(H({},l,{children:e,className:"w-rjv-value"}),{type:"value",value:e,keyName:r});return k.jsxs(g.Fragment,{children:[o&&(p||k.jsx(c,H({},l,{style:f}))),m||k.jsx(c,H({},l,{className:"w-rjv-value",children:e==null?void 0:e.toString()})),k.jsx(co,{keyName:r,value:e,expandKey:n})]})};U6.displayName="JVR.TypeInt";var W6=t=>{var{children:e,expandKey:n,keyName:r}=t,{Bigint:i={},displayDataTypes:o}=Sn(),{as:s,render:a}=i,l=Bt(i,Oae),c=s||"span",f=H({},Ss,i.style||{}),d=a&&typeof a=="function",p=d&&a(H({},l,{style:f}),{type:"type",value:e,keyName:r}),m=d&&a(H({},l,{children:e,className:"w-rjv-value"}),{type:"value",value:e,keyName:r});return k.jsxs(g.Fragment,{children:[o&&(p||k.jsx(c,H({},l,{style:f}))),m||k.jsx(c,H({},l,{className:"w-rjv-value",children:(e==null?void 0:e.toString())+"n"})),k.jsx(co,{keyName:r,value:e,expandKey:n})]})};W6.displayName="JVR.TypeFloat";var H6=t=>{var{children:e,expandKey:n,keyName:r}=t,{Url:i={},displayDataTypes:o}=Sn(),{as:s,render:a}=i,l=Bt(i,Rae),c=s||"span",f=H({},Ss,i.style),d=a&&typeof a=="function",p=d&&a(H({},l,{style:f}),{type:"type",value:e,keyName:r}),m=d&&a(H({},l,{children:e==null?void 0:e.href,className:"w-rjv-value"}),{type:"value",value:e,keyName:r});return k.jsxs(g.Fragment,{children:[o&&(p||k.jsx(c,H({},l,{style:f}))),m||k.jsxs("a",H({href:e==null?void 0:e.href,target:"_blank"},l,{className:"w-rjv-value",children:[k.jsx(nm,{}),e==null?void 0:e.href,k.jsx(nm,{})]})),k.jsx(co,{keyName:r,value:e,expandKey:n})]})};H6.displayName="JVR.TypeUrl";var q6=t=>{var{children:e,expandKey:n,keyName:r}=t,{Date:i={},displayDataTypes:o}=Sn(),{as:s,render:a}=i,l=Bt(i,Pae),c=s||"span",f=H({},Ss,i.style||{}),d=a&&typeof a=="function",p=d&&a(H({},l,{style:f}),{type:"type",value:e,keyName:r}),m=e instanceof Date?e.toLocaleString():e,v=d&&a(H({},l,{children:m,className:"w-rjv-value"}),{type:"value",value:e,keyName:r});return k.jsxs(g.Fragment,{children:[o&&(p||k.jsx(c,H({},l,{style:f}))),v||k.jsx(c,H({},l,{className:"w-rjv-value",children:m})),k.jsx(co,{keyName:r,value:e,expandKey:n})]})};q6.displayName="JVR.TypeDate";var K6=t=>{var{children:e,expandKey:n,keyName:r}=t,{Undefined:i={},displayDataTypes:o}=Sn(),{as:s,render:a}=i,l=Bt(i,Nae),c=s||"span",f=H({},Ss,i.style||{}),d=a&&typeof a=="function",p=d&&a(H({},l,{style:f}),{type:"type",value:e,keyName:r}),m=d&&a(H({},l,{children:e,className:"w-rjv-value"}),{type:"value",value:e,keyName:r});return k.jsxs(g.Fragment,{children:[o&&(p||k.jsx(c,H({},l,{style:f}))),m,k.jsx(co,{keyName:r,value:e,expandKey:n})]})};K6.displayName="JVR.TypeUndefined";var G6=t=>{var{children:e,expandKey:n,keyName:r}=t,{Null:i={},displayDataTypes:o}=Sn(),{as:s,render:a}=i,l=Bt(i,Mae),c=s||"span",f=H({},Ss,i.style||{}),d=a&&typeof a=="function",p=d&&a(H({},l,{style:f}),{type:"type",value:e,keyName:r}),m=d&&a(H({},l,{children:e,className:"w-rjv-value"}),{type:"value",value:e,keyName:r});return k.jsxs(g.Fragment,{children:[o&&(p||k.jsx(c,H({},l,{style:f}))),m,k.jsx(co,{keyName:r,value:e,expandKey:n})]})};G6.displayName="JVR.TypeNull";var Y6=t=>{var{children:e,expandKey:n,keyName:r}=t,{Nan:i={},displayDataTypes:o}=Sn(),{as:s,render:a}=i,l=Bt(i,Dae),c=s||"span",f=H({},Ss,i.style||{}),d=a&&typeof a=="function",p=d&&a(H({},l,{style:f}),{type:"type",value:e,keyName:r}),m=d&&a(H({},l,{children:e==null?void 0:e.toString(),className:"w-rjv-value"}),{type:"value",value:e,keyName:r});return k.jsxs(g.Fragment,{children:[o&&(p||k.jsx(c,H({},l,{style:f}))),m,k.jsx(co,{keyName:r,value:e,expandKey:n})]})};Y6.displayName="JVR.TypeNan";var Lae=t=>Number(t)===t&&t%1!==0||isNaN(t),X6=t=>{var{value:e,keyName:n,expandKey:r}=t,i={keyName:n,expandKey:r};return e instanceof URL?k.jsx(H6,H({},i,{children:e})):typeof e=="string"?k.jsx(B6,H({},i,{children:e})):e===!0?k.jsx(F6,H({},i,{children:e})):e===!1?k.jsx(z6,H({},i,{children:e})):e===null?k.jsx(G6,H({},i,{children:e})):e===void 0?k.jsx(K6,H({},i,{children:e})):e instanceof Date?k.jsx(q6,H({},i,{children:e})):typeof e=="number"&&isNaN(e)?k.jsx(Y6,H({},i,{children:e})):typeof e=="number"&&Lae(e)?k.jsx(V6,H({},i,{children:e})):typeof e=="bigint"?k.jsx(W6,H({},i,{children:e})):typeof e=="number"?k.jsx(U6,H({},i,{children:e})):null};X6.displayName="JVR.Value";function ac(t,e,n){var r=oae(),i=[t.className,e.className].filter(Boolean).join(" "),o=H({},t,e,{className:i,style:H({},t.style,e.style),children:e.children||t.children});g.useEffect(()=>r({[n]:o}),[e])}function uo(t,e,n){var r=tae(),i=[t.className,e.className].filter(Boolean).join(" "),o=H({},t,e,{className:i,style:H({},t.style,e.style),children:e.children||t.children});g.useEffect(()=>r({[n]:o}),[e])}function Dd(t,e,n){var r=lae(),i=[t.className,e.className].filter(Boolean).join(" "),o=H({},t,e,{className:i,style:H({},t.style,e.style),children:e.children||t.children});g.useEffect(()=>r({[n]:o}),[e])}var $ae=["as","render"],Z6=t=>{var{KeyName:e={}}=zo();return Dd(e,t,"KeyName"),null};Z6.displayName="JVR.KeyName";var Q6=t=>{var{children:e,value:n,parentValue:r,keyName:i}=t,o=typeof e=="number",s={color:o?"var(--w-rjv-key-number, #268bd2)":"var(--w-rjv-key-string, #002b36)"},{KeyName:a={}}=zo(),{as:l,render:c}=a,f=Bt(a,$ae);f.style=H({},f.style,s);var d=l||"span",p=c&&typeof c=="function"&&c(H({},f,{children:e}),{value:n,parentValue:r,keyName:i});return p||k.jsx(d,H({},f,{children:e}))};Q6.displayName="JVR.KeyNameComp";var Iae=["children","value","keyName","parentValue"],jae=["as","render","children"],J6=t=>{var{Row:e={}}=zo();return Dd(e,t,"Row"),null};J6.displayName="JVR.Row";var e7=t=>{var{children:e,value:n,keyName:r="",parentValue:i}=t,o=Bt(t,Iae),{Row:s={}}=zo(),{as:a,render:l}=s,c=Bt(s,jae),f=a||"div",d=l&&typeof l=="function"&&l(H({},o,c,{children:e}),{value:n,keyName:r,parentValue:i});return d||k.jsx(f,H({},o,c,{children:e}))};e7.displayName="JVR.RowComp";function Bae(t){var e=g.useRef();return g.useEffect(()=>{e.current=t}),e.current}function Fae(t){var{value:e,highlightUpdates:n,highlightContainer:r}=t,i=Bae(e),o=g.useMemo(()=>{if(!n||i===void 0)return!1;if(typeof e!=typeof i)return!0;if(typeof e=="number")return isNaN(e)&&isNaN(i)?!1:e!==i;if(Array.isArray(e)!==Array.isArray(i))return!0;if(typeof e=="object"||typeof e=="function")return!1;if(e!==i)return!0},[n,e]);g.useEffect(()=>{r&&r.current&&o&&"animate"in r.current&&r.current.animate([{backgroundColor:"var(--w-rjv-update-color, #ebcb8b)"},{backgroundColor:""}],{duration:1e3,easing:"ease-in"})},[o,e,r])}var t7=t=>{var e,{value:n,expandKey:r="",level:i}=t,o=o1(),{objectSortKeys:s,indentWidth:a,collapsed:l}=Ou(),c=Array.isArray(n),f=(e=o[r])!=null?e:typeof l=="boolean"?l:typeof l=="number"?i>l:!1;if(f)return null;var d=c?Object.entries(n).map(m=>[Number(m[0]),m[1]]):Object.entries(n);s&&(d=s===!0?d.sort((m,v)=>{var[b]=m,[S]=v;return typeof b=="string"&&typeof S=="string"?b.localeCompare(S):0}):d.sort((m,v)=>{var[b,S]=m,[x,w]=v;return typeof b=="string"&&typeof x=="string"?s(b,x,S,w):0}));var p={borderLeft:"var(--w-rjv-border-left-width, 1px) var(--w-rjv-line-style, solid) var(--w-rjv-line-color, #ebebeb)",paddingLeft:a,marginLeft:6};return k.jsx("div",{className:"w-rjv-wrap",style:p,children:d.map((m,v)=>{var[b,S]=m;return k.jsx(n7,{parentValue:n,keyName:b,value:S,level:i},v)})})};t7.displayName="JVR.KeyValues";var I2=t=>{var{keyName:e,parentValue:n,value:r}=t,{highlightUpdates:i}=Ou(),o=typeof e=="number",s=g.useRef(null);return Fae({value:r,highlightUpdates:i,highlightContainer:s}),k.jsxs(g.Fragment,{children:[k.jsxs("span",{ref:s,children:[k.jsx(nk,{isNumber:o,"data-placement":"left"}),k.jsx(Q6,{keyName:e,value:r,parentValue:n,children:e}),k.jsx(nk,{isNumber:o,"data-placement":"right"})]}),k.jsx(M6,{})]})};I2.displayName="JVR.KayName";var n7=t=>{var{keyName:e,value:n,parentValue:r,level:i=0}=t,o=m6(),s=g.useId(),a=Array.isArray(n),l=n instanceof Set,c=n instanceof Map,f=n instanceof Date,d=n instanceof URL,p=n&&typeof n=="object"&&!a&&!l&&!c&&!f&&!d,m=p||a||l||c;if(m){var v=l?Array.from(n):c?Object.fromEntries(n):n;return k.jsx(j2,{keyName:e,value:v,parentValue:r,initialValue:n,level:i+1})}var b={onMouseEnter:()=>o({[s]:!0}),onMouseLeave:()=>o({[s]:!1})};return k.jsxs(e7,H({className:"w-rjv-line",value:n,keyName:e,parentValue:r},b,{children:[k.jsx(I2,{keyName:e,value:n,parentValue:r}),k.jsx(X6,{keyName:e,value:n,expandKey:s})]}))};n7.displayName="JVR.KeyValuesItem";var zae=["value","keyName"],Vae=["as","render"],r7=t=>{var{CountInfoExtra:e={}}=zo();return Dd(e,t,"CountInfoExtra"),null};r7.displayName="JVR.CountInfoExtra";var i7=t=>{var{value:e={},keyName:n}=t,r=Bt(t,zae),{CountInfoExtra:i={}}=zo(),{as:o,render:s}=i,a=Bt(i,Vae);if(!s&&!a.children)return null;var l=o||"span",c=s&&typeof s=="function",f=H({},a,r),d=c&&s(f,{value:e,keyName:n});return d||k.jsx(l,H({},f))};i7.displayName="JVR.CountInfoExtraComps";var Uae=["value","keyName"],Wae=["as","render"],o7=t=>{var{CountInfo:e={}}=zo();return Dd(e,t,"CountInfo"),null};o7.displayName="JVR.CountInfo";var s7=t=>{var{value:e={},keyName:n}=t,r=Bt(t,Uae),{displayObjectSize:i}=Ou(),{CountInfo:o={}}=zo();if(!i)return null;var{as:s,render:a}=o,l=Bt(o,Wae),c=s||"span";l.style=H({},l.style,t.style);var f=Object.keys(e).length;l.children||(l.children=f+" items");var d=H({},l,r),p=a&&typeof a=="function",m=p&&a(H({},d,{"data-length":f}),{value:e,keyName:n});return m||k.jsx(c,H({},d))};s7.displayName="JVR.CountInfoComp";var Hae=["as","render"],a7=t=>{var{Ellipsis:e={}}=zo();return Dd(e,t,"Ellipsis"),null};a7.displayName="JVR.Ellipsis";var l7=t=>{var{isExpanded:e,value:n,keyName:r}=t,{Ellipsis:i={}}=zo(),{as:o,render:s}=i,a=Bt(i,Hae),l=o||"span",c=s&&typeof s=="function"&&s(H({},a,{"data-expanded":e}),{value:n,keyName:r});return c||(e?k.jsx(l,H({},a)):null)};l7.displayName="JVR.EllipsisComp";var c7=t=>{var e,{keyName:n,expandKey:r,initialValue:i,value:o,level:s}=t,a=o1(),l=Qse(),{onExpand:c,collapsed:f}=Ou(),d=Array.isArray(o),p=o instanceof Set,m=(e=a[r])!=null?e:typeof f=="boolean"?f:typeof f=="number"?s>f:!1,v=typeof o=="object",b=()=>{var A={expand:!m,value:o,keyid:r,keyName:n};c&&c(A),l({[r]:A.expand})},S={display:"inline-flex",alignItems:"center"},x={transform:"rotate("+(m?"-90":"0")+"deg)",transition:"all 0.3s"},w=Object.keys(o).length,C=w!==0&&(d||p||v),T={style:S};return C&&(T.onClick=b),k.jsxs("span",H({},T,{children:[C&&k.jsx(D6,{style:x,expandKey:r}),(n||typeof n=="number")&&k.jsx(I2,{keyName:n}),k.jsx(I6,{value:i,keyName:n}),k.jsx(j6,{value:i,keyName:n}),k.jsx(L6,{isBrackets:d||p}),k.jsx(l7,{keyName:n,value:o,isExpanded:m}),k.jsx($2,{isVisiable:m||!C,isBrackets:d||p}),k.jsx(s7,{value:o,keyName:n}),k.jsx(i7,{value:o,keyName:n}),k.jsx(co,{keyName:n,value:o,expandKey:r})]}))};c7.displayName="JVR.NestedOpen";var qae=["className","children","parentValue","keyid","level","value","initialValue","keyName"],j2=g.forwardRef((t,e)=>{var{className:n="",level:r=1,value:i,initialValue:o,keyName:s}=t,a=Bt(t,qae),l=m6(),c=g.useId(),f=[n,"w-rjv-inner"].filter(Boolean).join(" "),d={onMouseEnter:()=>l({[c]:!0}),onMouseLeave:()=>l({[c]:!1})};return k.jsxs("div",H({className:f,ref:e},a,d,{children:[k.jsx(c7,{expandKey:c,value:i,level:r,keyName:s,initialValue:o}),k.jsx(t7,{expandKey:c,value:i,level:r}),k.jsx($6,{expandKey:c,value:i,level:r})]}))});j2.displayName="JVR.Container";var u7=t=>{var{BraceLeft:e={}}=Mi();return ac(e,t,"BraceLeft"),null};u7.displayName="JVR.BraceLeft";var f7=t=>{var{BraceRight:e={}}=Mi();return ac(e,t,"BraceRight"),null};f7.displayName="JVR.BraceRight";var d7=t=>{var{BracketsLeft:e={}}=Mi();return ac(e,t,"BracketsLeft"),null};d7.displayName="JVR.BracketsLeft";var h7=t=>{var{BracketsRight:e={}}=Mi();return ac(e,t,"BracketsRight"),null};h7.displayName="JVR.BracketsRight";var p7=t=>{var{Arrow:e={}}=Mi();return ac(e,t,"Arrow"),null};p7.displayName="JVR.Arrow";var m7=t=>{var{Colon:e={}}=Mi();return ac(e,t,"Colon"),null};m7.displayName="JVR.Colon";var g7=t=>{var{Quote:e={}}=Mi();return ac(e,t,"Quote"),null};g7.displayName="JVR.Quote";var v7=t=>{var{ValueQuote:e={}}=Mi();return ac(e,t,"ValueQuote"),null};v7.displayName="JVR.ValueQuote";var y7=t=>{var{Bigint:e={}}=Sn();return uo(e,t,"Bigint"),null};y7.displayName="JVR.Bigint";var b7=t=>{var{Date:e={}}=Sn();return uo(e,t,"Date"),null};b7.displayName="JVR.Date";var w7=t=>{var{False:e={}}=Sn();return uo(e,t,"False"),null};w7.displayName="JVR.False";var x7=t=>{var{Float:e={}}=Sn();return uo(e,t,"Float"),null};x7.displayName="JVR.Float";var S7=t=>{var{Int:e={}}=Sn();return uo(e,t,"Int"),null};S7.displayName="JVR.Int";var C7=t=>{var{Map:e={}}=Sn();return uo(e,t,"Map"),null};C7.displayName="JVR.Map";var k7=t=>{var{Nan:e={}}=Sn();return uo(e,t,"Nan"),null};k7.displayName="JVR.Nan";var E7=t=>{var{Null:e={}}=Sn();return uo(e,t,"Null"),null};E7.displayName="JVR.Null";var _7=t=>{var{Set:e={}}=Sn();return uo(e,t,"Set"),null};_7.displayName="JVR.Set";var T7=t=>{var{Str:e={}}=Sn();return uo(e,t,"Str"),null};T7.displayName="JVR.StringText";var A7=t=>{var{True:e={}}=Sn();return uo(e,t,"True"),null};A7.displayName="JVR.True";var O7=t=>{var{Undefined:e={}}=Sn();return uo(e,t,"Undefined"),null};O7.displayName="JVR.Undefined";var R7=t=>{var{Url:e={}}=Sn();return uo(e,t,"Url"),null};R7.displayName="JVR.Url";var P7=t=>{var{Copied:e={}}=zo();return Dd(e,t,"Copied"),null};P7.displayName="JVR.Copied";var Kae=["className","style","value","children","collapsed","indentWidth","displayObjectSize","shortenTextAfterLength","highlightUpdates","enableClipboard","displayDataTypes","objectSortKeys","onExpand"],pn=g.forwardRef((t,e)=>{var{className:n="",style:r,value:i,children:o,collapsed:s,indentWidth:a=15,displayObjectSize:l=!0,shortenTextAfterLength:c=30,highlightUpdates:f=!0,enableClipboard:d=!0,displayDataTypes:p=!0,objectSortKeys:m=!1,onExpand:v}=t,b=Bt(t,Kae),S=H({lineHeight:1.4,fontFamily:"var(--w-rjv-font-family, Menlo, monospace)",color:"var(--w-rjv-color, #002b36)",backgroundColor:"var(--w-rjv-background-color, #00000000)",fontSize:13},r),x=["w-json-view-container","w-rjv",n].filter(Boolean).join(" ");return k.jsxs(N6,{initialState:{value:i,objectSortKeys:m,indentWidth:a,displayObjectSize:l,collapsed:s,enableClipboard:d,shortenTextAfterLength:c,highlightUpdates:f,onExpand:v},initialTypes:{displayDataTypes:p},children:[k.jsx(j2,H({value:i},b,{ref:e,className:x,style:S})),o]})});pn.Bigint=y7;pn.Date=b7;pn.False=w7;pn.Float=x7;pn.Int=S7;pn.Map=C7;pn.Nan=k7;pn.Null=E7;pn.Set=_7;pn.String=T7;pn.True=A7;pn.Undefined=O7;pn.Url=R7;pn.ValueQuote=v7;pn.Arrow=p7;pn.Colon=m7;pn.Quote=g7;pn.Ellipsis=a7;pn.BraceLeft=u7;pn.BraceRight=f7;pn.BracketsLeft=d7;pn.BracketsRight=h7;pn.Copied=P7;pn.CountInfo=o7;pn.CountInfoExtra=r7;pn.KeyName=Z6;pn.Row=J6;pn.displayName="JVR.JsonView";var Gae={"--w-rjv-font-family":"monospace","--w-rjv-color":"#79c0ff","--w-rjv-key-string":"#79c0ff","--w-rjv-background-color":"#0d1117","--w-rjv-line-color":"#94949480","--w-rjv-arrow-color":"#ccc","--w-rjv-edit-color":"var(--w-rjv-color)","--w-rjv-info-color":"#7b7b7b","--w-rjv-update-color":"#ebcb8b","--w-rjv-copied-color":"#79c0ff","--w-rjv-copied-success-color":"#28a745","--w-rjv-curlybraces-color":"#8b949e","--w-rjv-colon-color":"#c9d1d9","--w-rjv-brackets-color":"#8b949e","--w-rjv-quotes-color":"var(--w-rjv-key-string)","--w-rjv-quotes-string-color":"var(--w-rjv-type-string-color)","--w-rjv-type-string-color":"#a5d6ff","--w-rjv-type-int-color":"#79c0ff","--w-rjv-type-float-color":"#79c0ff","--w-rjv-type-bigint-color":"#79c0ff","--w-rjv-type-boolean-color":"#ffab70","--w-rjv-type-date-color":"#79c0ff","--w-rjv-type-url-color":"#4facff","--w-rjv-type-null-color":"#ff7b72","--w-rjv-type-nan-color":"#859900","--w-rjv-type-undefined-color":"#79c0ff"},Yae={"--w-rjv-font-family":"monospace","--w-rjv-color":"#6f42c1","--w-rjv-key-string":"#6f42c1","--w-rjv-background-color":"#ffffff","--w-rjv-line-color":"#ddd","--w-rjv-arrow-color":"#6e7781","--w-rjv-edit-color":"var(--w-rjv-color)","--w-rjv-info-color":"#0000004d","--w-rjv-update-color":"#ebcb8b","--w-rjv-copied-color":"#002b36","--w-rjv-copied-success-color":"#28a745","--w-rjv-curlybraces-color":"#6a737d","--w-rjv-colon-color":"#24292e","--w-rjv-brackets-color":"#6a737d","--w-rjv-quotes-color":"var(--w-rjv-key-string)","--w-rjv-quotes-string-color":"var(--w-rjv-type-string-color)","--w-rjv-type-string-color":"#032f62","--w-rjv-type-int-color":"#005cc5","--w-rjv-type-float-color":"#005cc5","--w-rjv-type-bigint-color":"#005cc5","--w-rjv-type-boolean-color":"#d73a49","--w-rjv-type-date-color":"#005cc5","--w-rjv-type-url-color":"#0969da","--w-rjv-type-null-color":"#d73a49","--w-rjv-type-nan-color":"#859900","--w-rjv-type-undefined-color":"#005cc5"};const Xae=g.createContext(void 0),Zae={setTheme:t=>{},themes:[]},Qae=()=>{var t;return(t=g.useContext(Xae))!==null&&t!==void 0?t:Zae},Jae=t=>{const{resolvedTheme:e}=Qae();return t.output?k.jsx("div",{className:"max-w-[518px] overflow-auto font-mono",children:k.jsx(pn,{value:t.output,style:e==="dark"?Gae:Yae,enableClipboard:!1,displayDataTypes:!1,collapsed:!0,keyName:"output",objectSortKeys:(n,r)=>{const i=["status","message","data","type","command","results"],o=i.indexOf(n),s=i.indexOf(r);return o!==-1&&s!==-1?o-s:o!==-1?-1:s!==-1?1:r.localeCompare(n)}})}):null};var N7={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},VN=ut.createContext&&ut.createContext(N7),ele=["attr","size","title"];function tle(t,e){if(t==null)return{};var n=nle(t,e),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i<o.length;i++)r=o[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function nle(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o<r.length;o++)i=r[o],!(e.indexOf(i)>=0)&&(n[i]=t[i]);return n}function D0(){return D0=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},D0.apply(this,arguments)}function UN(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function L0(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?UN(Object(n),!0).forEach(function(r){rle(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):UN(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function rle(t,e,n){return e=ile(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ile(t){var e=ole(t,"string");return typeof e=="symbol"?e:String(e)}function ole(t,e){if(typeof t!="object"||t===null)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function M7(t){return t&&t.map((e,n)=>ut.createElement(e.tag,L0({key:n},e.attr),M7(e.child)))}function D7(t){return e=>ut.createElement(sle,D0({attr:L0({},t.attr)},e),M7(t.child))}function sle(t){var e=n=>{var{attr:r,size:i,title:o}=t,s=tle(t,ele),a=i||n.size||"1em",l;return n.className&&(l=n.className),t.className&&(l=(l?l+" ":"")+t.className),ut.createElement("svg",D0({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},n.attr,r,s,{className:l,style:L0(L0({color:t.color||n.color},n.style),t.style),height:a,width:a,xmlns:"http://www.w3.org/2000/svg"}),o&&ut.createElement("title",null,o),t.children)};return VN!==void 0?ut.createElement(VN.Consumer,null,n=>e(n)):e(N7)}function ale(t){return D7({tag:"svg",attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},child:[]},{tag:"path",attr:{d:"M20 6v4a1 1 0 0 1 -1 1h-14a1 1 0 0 1 -1 -1v-4a1 1 0 0 1 1 -1h14a1 1 0 0 1 1 1z"},child:[]},{tag:"path",attr:{d:"M12 15l0 4"},child:[]},{tag:"path",attr:{d:"M14 17l-4 0"},child:[]}]})(t)}function lle(t){return D7({tag:"svg",attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},child:[]},{tag:"path",attr:{d:"M4 18v-4a1 1 0 0 1 1 -1h14a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-14a1 1 0 0 1 -1 -1z"},child:[]},{tag:"path",attr:{d:"M12 9v-4"},child:[]},{tag:"path",attr:{d:"M10 7l4 0"},child:[]}]})(t)}function Ff(t,e,{checkForDefaultPrevented:n=!0}={}){return function(i){if(t==null||t(i),n===!1||!i.defaultPrevented)return e==null?void 0:e(i)}}function cle(t,e){typeof t=="function"?t(e):t!=null&&(t.current=e)}function L7(...t){return e=>t.forEach(n=>cle(n,e))}function $m(...t){return g.useCallback(L7(...t),t)}function ule(t,e=[]){let n=[];function r(o,s){const a=g.createContext(s),l=n.length;n=[...n,s];function c(d){const{scope:p,children:m,...v}=d,b=(p==null?void 0:p[t][l])||a,S=g.useMemo(()=>v,Object.values(v));return g.createElement(b.Provider,{value:S},m)}function f(d,p){const m=(p==null?void 0:p[t][l])||a,v=g.useContext(m);if(v)return v;if(s!==void 0)return s;throw new Error(`\`${d}\` must be used within \`${o}\``)}return c.displayName=o+"Provider",[c,f]}const i=()=>{const o=n.map(s=>g.createContext(s));return function(a){const l=(a==null?void 0:a[t])||o;return g.useMemo(()=>({[`__scope${t}`]:{...a,[t]:l}}),[a,l])}};return i.scopeName=t,[r,fle(i,...e)]}function fle(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const r=t.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const s=r.reduce((a,{useScope:l,scopeName:c})=>{const d=l(o)[`__scope${c}`];return{...a,...d}},{});return g.useMemo(()=>({[`__scope${e.scopeName}`]:s}),[s])}};return n.scopeName=e.scopeName,n}const rk=globalThis!=null&&globalThis.document?g.useLayoutEffect:()=>{},dle=jE.useId||(()=>{});let hle=0;function zx(t){const[e,n]=g.useState(dle());return rk(()=>{t||n(r=>r??String(hle++))},[t]),t||(e?`radix-${e}`:"")}function mu(t){const e=g.useRef(t);return g.useEffect(()=>{e.current=t}),g.useMemo(()=>(...n)=>{var r;return(r=e.current)===null||r===void 0?void 0:r.call(e,...n)},[])}function ple({prop:t,defaultProp:e,onChange:n=()=>{}}){const[r,i]=mle({defaultProp:e,onChange:n}),o=t!==void 0,s=o?t:r,a=mu(n),l=g.useCallback(c=>{if(o){const d=typeof c=="function"?c(t):c;d!==t&&a(d)}else i(c)},[o,t,i,a]);return[s,l]}function mle({defaultProp:t,onChange:e}){const n=g.useState(t),[r]=n,i=g.useRef(r),o=mu(e);return g.useEffect(()=>{i.current!==r&&(o(r),i.current=r)},[r,i,o]),n}const B2=g.forwardRef((t,e)=>{const{children:n,...r}=t,i=g.Children.toArray(n),o=i.find(vle);if(o){const s=o.props.children,a=i.map(l=>l===o?g.Children.count(s)>1?g.Children.only(null):g.isValidElement(s)?s.props.children:null:l);return g.createElement(ik,H({},r,{ref:e}),g.isValidElement(s)?g.cloneElement(s,void 0,a):null)}return g.createElement(ik,H({},r,{ref:e}),n)});B2.displayName="Slot";const ik=g.forwardRef((t,e)=>{const{children:n,...r}=t;return g.isValidElement(n)?g.cloneElement(n,{...yle(r,n.props),ref:L7(e,n.ref)}):g.Children.count(n)>1?g.Children.only(null):null});ik.displayName="SlotClone";const gle=({children:t})=>g.createElement(g.Fragment,null,t);function vle(t){return g.isValidElement(t)&&t.type===gle}function yle(t,e){const n={...e};for(const r in e){const i=t[r],o=e[r];/^on[A-Z]/.test(r)?n[r]=(...a)=>{o==null||o(...a),i==null||i(...a)}:r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...t,...n}}const ble=["a","button","div","h2","h3","img","li","nav","ol","p","span","svg","ul"],s1=ble.reduce((t,e)=>{const n=g.forwardRef((r,i)=>{const{asChild:o,...s}=r,a=o?B2:e;return g.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),g.createElement(a,H({},s,{ref:i}))});return n.displayName=`Primitive.${e}`,{...t,[e]:n}},{});function wle(t,e){t&&na.flushSync(()=>t.dispatchEvent(e))}function xle(t){const e=mu(t);g.useEffect(()=>{const n=r=>{r.key==="Escape"&&e(r)};return document.addEventListener("keydown",n),()=>document.removeEventListener("keydown",n)},[e])}const ok="dismissableLayer.update",Sle="dismissableLayer.pointerDownOutside",Cle="dismissableLayer.focusOutside";let WN;const kle=g.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Ele=g.forwardRef((t,e)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:o,onInteractOutside:s,onDismiss:a,...l}=t,c=g.useContext(kle),[f,d]=g.useState(null),[,p]=g.useState({}),m=$m(e,_=>d(_)),v=Array.from(c.layers),[b]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),S=v.indexOf(b),x=f?v.indexOf(f):-1,w=c.layersWithOutsidePointerEventsDisabled.size>0,C=x>=S,T=_le(_=>{const R=_.target,M=[...c.branches].some(I=>I.contains(R));!C||M||(i==null||i(_),s==null||s(_),_.defaultPrevented||a==null||a())}),A=Tle(_=>{const R=_.target;[...c.branches].some(I=>I.contains(R))||(o==null||o(_),s==null||s(_),_.defaultPrevented||a==null||a())});return xle(_=>{x===c.layers.size-1&&(r==null||r(_),!_.defaultPrevented&&a&&(_.preventDefault(),a()))}),g.useEffect(()=>{if(f)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(WN=document.body.style.pointerEvents,document.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(f)),c.layers.add(f),HN(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(document.body.style.pointerEvents=WN)}},[f,n,c]),g.useEffect(()=>()=>{f&&(c.layers.delete(f),c.layersWithOutsidePointerEventsDisabled.delete(f),HN())},[f,c]),g.useEffect(()=>{const _=()=>p({});return document.addEventListener(ok,_),()=>document.removeEventListener(ok,_)},[]),g.createElement(s1.div,H({},l,{ref:m,style:{pointerEvents:w?C?"auto":"none":void 0,...t.style},onFocusCapture:Ff(t.onFocusCapture,A.onFocusCapture),onBlurCapture:Ff(t.onBlurCapture,A.onBlurCapture),onPointerDownCapture:Ff(t.onPointerDownCapture,T.onPointerDownCapture)}))});function _le(t){const e=mu(t),n=g.useRef(!1),r=g.useRef(()=>{});return g.useEffect(()=>{const i=s=>{if(s.target&&!n.current){let c=function(){$7(Sle,e,l,{discrete:!0})};var a=c;const l={originalEvent:s};s.pointerType==="touch"?(document.removeEventListener("click",r.current),r.current=c,document.addEventListener("click",r.current,{once:!0})):c()}n.current=!1},o=window.setTimeout(()=>{document.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(o),document.removeEventListener("pointerdown",i),document.removeEventListener("click",r.current)}},[e]),{onPointerDownCapture:()=>n.current=!0}}function Tle(t){const e=mu(t),n=g.useRef(!1);return g.useEffect(()=>{const r=i=>{i.target&&!n.current&&$7(Cle,e,{originalEvent:i},{discrete:!1})};return document.addEventListener("focusin",r),()=>document.removeEventListener("focusin",r)},[e]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function HN(){const t=new CustomEvent(ok);document.dispatchEvent(t)}function $7(t,e,n,{discrete:r}){const i=n.originalEvent.target,o=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:n});e&&i.addEventListener(t,e,{once:!0}),r?wle(i,o):i.dispatchEvent(o)}const Vx="focusScope.autoFocusOnMount",Ux="focusScope.autoFocusOnUnmount",qN={bubbles:!1,cancelable:!0},Ale=g.forwardRef((t,e)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...s}=t,[a,l]=g.useState(null),c=mu(i),f=mu(o),d=g.useRef(null),p=$m(e,b=>l(b)),m=g.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;g.useEffect(()=>{if(r){let x=function(C){if(m.paused||!a)return;const T=C.target;a.contains(T)?d.current=T:_c(d.current,{select:!0})},w=function(C){m.paused||!a||a.contains(C.relatedTarget)||_c(d.current,{select:!0})};var b=x,S=w;return document.addEventListener("focusin",x),document.addEventListener("focusout",w),()=>{document.removeEventListener("focusin",x),document.removeEventListener("focusout",w)}}},[r,a,m.paused]),g.useEffect(()=>{if(a){GN.add(m);const b=document.activeElement;if(!a.contains(b)){const x=new CustomEvent(Vx,qN);a.addEventListener(Vx,c),a.dispatchEvent(x),x.defaultPrevented||(Ole(Dle(I7(a)),{select:!0}),document.activeElement===b&&_c(a))}return()=>{a.removeEventListener(Vx,c),setTimeout(()=>{const x=new CustomEvent(Ux,qN);a.addEventListener(Ux,f),a.dispatchEvent(x),x.defaultPrevented||_c(b??document.body,{select:!0}),a.removeEventListener(Ux,f),GN.remove(m)},0)}}},[a,c,f,m]);const v=g.useCallback(b=>{if(!n&&!r||m.paused)return;const S=b.key==="Tab"&&!b.altKey&&!b.ctrlKey&&!b.metaKey,x=document.activeElement;if(S&&x){const w=b.currentTarget,[C,T]=Rle(w);C&&T?!b.shiftKey&&x===T?(b.preventDefault(),n&&_c(C,{select:!0})):b.shiftKey&&x===C&&(b.preventDefault(),n&&_c(T,{select:!0})):x===w&&b.preventDefault()}},[n,r,m.paused]);return g.createElement(s1.div,H({tabIndex:-1},s,{ref:p,onKeyDown:v}))});function Ole(t,{select:e=!1}={}){const n=document.activeElement;for(const r of t)if(_c(r,{select:e}),document.activeElement!==n)return}function Rle(t){const e=I7(t),n=KN(e,t),r=KN(e.reverse(),t);return[n,r]}function I7(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function KN(t,e){for(const n of t)if(!Ple(n,{upTo:e}))return n}function Ple(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function Nle(t){return t instanceof HTMLInputElement&&"select"in t}function _c(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&Nle(t)&&e&&t.select()}}const GN=Mle();function Mle(){let t=[];return{add(e){const n=t[0];e!==n&&(n==null||n.pause()),t=YN(t,e),t.unshift(e)},remove(e){var n;t=YN(t,e),(n=t[0])===null||n===void 0||n.resume()}}}function YN(t,e){const n=[...t],r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}function Dle(t){return t.filter(e=>e.tagName!=="A")}const Lle=g.forwardRef((t,e)=>{var n;const{container:r=globalThis==null||(n=globalThis.document)===null||n===void 0?void 0:n.body,...i}=t;return r?O_.createPortal(g.createElement(s1.div,H({},i,{ref:e})),r):null});function $le(t,e){return g.useReducer((n,r)=>{const i=e[n][r];return i??n},t)}const a1=t=>{const{present:e,children:n}=t,r=Ile(e),i=typeof n=="function"?n({present:r.isPresent}):g.Children.only(n),o=$m(r.ref,i.ref);return typeof n=="function"||r.isPresent?g.cloneElement(i,{ref:o}):null};a1.displayName="Presence";function Ile(t){const[e,n]=g.useState(),r=g.useRef({}),i=g.useRef(t),o=g.useRef("none"),s=t?"mounted":"unmounted",[a,l]=$le(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return g.useEffect(()=>{const c=fv(r.current);o.current=a==="mounted"?c:"none"},[a]),rk(()=>{const c=r.current,f=i.current;if(f!==t){const p=o.current,m=fv(c);t?l("MOUNT"):m==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(f&&p!==m?"ANIMATION_OUT":"UNMOUNT"),i.current=t}},[t,l]),rk(()=>{if(e){const c=d=>{const m=fv(r.current).includes(d.animationName);d.target===e&&m&&na.flushSync(()=>l("ANIMATION_END"))},f=d=>{d.target===e&&(o.current=fv(r.current))};return e.addEventListener("animationstart",f),e.addEventListener("animationcancel",c),e.addEventListener("animationend",c),()=>{e.removeEventListener("animationstart",f),e.removeEventListener("animationcancel",c),e.removeEventListener("animationend",c)}}else l("ANIMATION_END")},[e,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:g.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function fv(t){return(t==null?void 0:t.animationName)||"none"}let Wx=0;function jle(){g.useEffect(()=>{var t,e;const n=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",(t=n[0])!==null&&t!==void 0?t:XN()),document.body.insertAdjacentElement("beforeend",(e=n[1])!==null&&e!==void 0?e:XN()),Wx++,()=>{Wx===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(r=>r.remove()),Wx--}},[])}function XN(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",t}var j7=P4(),Hx=function(){},l1=g.forwardRef(function(t,e){var n=g.useRef(null),r=g.useState({onScrollCapture:Hx,onWheelCapture:Hx,onTouchMoveCapture:Hx}),i=r[0],o=r[1],s=t.forwardProps,a=t.children,l=t.className,c=t.removeScrollBar,f=t.enabled,d=t.shards,p=t.sideCar,m=t.noIsolation,v=t.inert,b=t.allowPinchZoom,S=t.as,x=S===void 0?"div":S,w=f2(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as"]),C=p,T=R4([n,e]),A=Sr(Sr({},w),i);return g.createElement(g.Fragment,null,f&&g.createElement(C,{sideCar:j7,removeScrollBar:c,shards:d,noIsolation:m,inert:v,setCallbacks:o,allowPinchZoom:!!b,lockRef:n}),s?g.cloneElement(g.Children.only(a),Sr(Sr({},A),{ref:T})):g.createElement(x,Sr({},A,{className:l,ref:T}),a))});l1.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};l1.classNames={fullWidth:up,zeroRight:cp};var sk=!1;if(typeof window<"u")try{var dv=Object.defineProperty({},"passive",{get:function(){return sk=!0,!0}});window.addEventListener("test",dv,dv),window.removeEventListener("test",dv,dv)}catch{sk=!1}var ef=sk?{passive:!1}:!1,Ble=function(t){var e=window.getComputedStyle(t);return e.overflowY!=="hidden"&&!(e.overflowY===e.overflowX&&e.overflowY==="visible")},Fle=function(t){var e=window.getComputedStyle(t);return e.overflowX!=="hidden"&&!(e.overflowY===e.overflowX&&e.overflowX==="visible")},ZN=function(t,e){var n=e;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var r=B7(t,n);if(r){var i=F7(t,n),o=i[1],s=i[2];if(o>s)return!0}n=n.parentNode}while(n&&n!==document.body);return!1},zle=function(t){var e=t.scrollTop,n=t.scrollHeight,r=t.clientHeight;return[e,n,r]},Vle=function(t){var e=t.scrollLeft,n=t.scrollWidth,r=t.clientWidth;return[e,n,r]},B7=function(t,e){return t==="v"?Ble(e):Fle(e)},F7=function(t,e){return t==="v"?zle(e):Vle(e)},Ule=function(t,e){return t==="h"&&e==="rtl"?-1:1},Wle=function(t,e,n,r,i){var o=Ule(t,window.getComputedStyle(e).direction),s=o*r,a=n.target,l=e.contains(a),c=!1,f=s>0,d=0,p=0;do{var m=F7(t,a),v=m[0],b=m[1],S=m[2],x=b-S-o*v;(v||x)&&B7(t,a)&&(d+=x,p+=v),a=a.parentNode}while(!l&&a!==document.body||l&&(e.contains(a)||e===a));return(f&&(i&&d===0||!i&&s>d)||!f&&(i&&p===0||!i&&-s>p))&&(c=!0),c},hv=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},QN=function(t){return[t.deltaX,t.deltaY]},JN=function(t){return t&&"current"in t?t.current:t},Hle=function(t,e){return t[0]===e[0]&&t[1]===e[1]},qle=function(t){return`
194
+ .block-interactivity-`.concat(t,` {pointer-events: none;}
195
+ .allow-interactivity-`).concat(t,` {pointer-events: all;}
196
+ `)},Kle=0,tf=[];function Gle(t){var e=g.useRef([]),n=g.useRef([0,0]),r=g.useRef(),i=g.useState(Kle++)[0],o=g.useState(function(){return C2()})[0],s=g.useRef(t);g.useEffect(function(){s.current=t},[t]),g.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(i));var b=h4([t.lockRef.current],(t.shards||[]).map(JN),!0).filter(Boolean);return b.forEach(function(S){return S.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),b.forEach(function(S){return S.classList.remove("allow-interactivity-".concat(i))})}}},[t.inert,t.lockRef.current,t.shards]);var a=g.useCallback(function(b,S){if("touches"in b&&b.touches.length===2)return!s.current.allowPinchZoom;var x=hv(b),w=n.current,C="deltaX"in b?b.deltaX:w[0]-x[0],T="deltaY"in b?b.deltaY:w[1]-x[1],A,_=b.target,R=Math.abs(C)>Math.abs(T)?"h":"v";if("touches"in b&&R==="h"&&_.type==="range")return!1;var M=ZN(R,_);if(!M)return!0;if(M?A=R:(A=R==="v"?"h":"v",M=ZN(R,_)),!M)return!1;if(!r.current&&"changedTouches"in b&&(C||T)&&(r.current=A),!A)return!0;var I=r.current||A;return Wle(I,S,b,I==="h"?C:T,!0)},[]),l=g.useCallback(function(b){var S=b;if(!(!tf.length||tf[tf.length-1]!==o)){var x="deltaY"in S?QN(S):hv(S),w=e.current.filter(function(A){return A.name===S.type&&A.target===S.target&&Hle(A.delta,x)})[0];if(w&&w.should){S.preventDefault();return}if(!w){var C=(s.current.shards||[]).map(JN).filter(Boolean).filter(function(A){return A.contains(S.target)}),T=C.length>0?a(S,C[0]):!s.current.noIsolation;T&&S.preventDefault()}}},[]),c=g.useCallback(function(b,S,x,w){var C={name:b,delta:S,target:x,should:w};e.current.push(C),setTimeout(function(){e.current=e.current.filter(function(T){return T!==C})},1)},[]),f=g.useCallback(function(b){n.current=hv(b),r.current=void 0},[]),d=g.useCallback(function(b){c(b.type,QN(b),b.target,a(b,t.lockRef.current))},[]),p=g.useCallback(function(b){c(b.type,hv(b),b.target,a(b,t.lockRef.current))},[]);g.useEffect(function(){return tf.push(o),t.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:p}),document.addEventListener("wheel",l,ef),document.addEventListener("touchmove",l,ef),document.addEventListener("touchstart",f,ef),function(){tf=tf.filter(function(b){return b!==o}),document.removeEventListener("wheel",l,ef),document.removeEventListener("touchmove",l,ef),document.removeEventListener("touchstart",f,ef)}},[]);var m=t.removeScrollBar,v=t.inert;return g.createElement(g.Fragment,null,v?g.createElement(o,{styles:qle(i)}):null,m?g.createElement(L4,{gapMode:"margin"}):null)}const Yle=M4(j7,Gle);var z7=g.forwardRef(function(t,e){return g.createElement(l1,Sr({},t,{ref:e,sideCar:Yle}))});z7.classNames=l1.classNames;const Xle=z7,V7="Dialog",[U7,VCe]=ule(V7),[Zle,Ru]=U7(V7),Qle=t=>{const{__scopeDialog:e,children:n,open:r,defaultOpen:i,onOpenChange:o,modal:s=!0}=t,a=g.useRef(null),l=g.useRef(null),[c=!1,f]=ple({prop:r,defaultProp:i,onChange:o});return g.createElement(Zle,{scope:e,triggerRef:a,contentRef:l,contentId:zx(),titleId:zx(),descriptionId:zx(),open:c,onOpenChange:f,onOpenToggle:g.useCallback(()=>f(d=>!d),[f]),modal:s},n)},W7="DialogPortal",[Jle,H7]=U7(W7,{forceMount:void 0}),ece=t=>{const{__scopeDialog:e,forceMount:n,children:r,container:i}=t,o=Ru(W7,e);return g.createElement(Jle,{scope:e,forceMount:n},g.Children.map(r,s=>g.createElement(a1,{present:n||o.open},g.createElement(Lle,{asChild:!0,container:i},s))))},ak="DialogOverlay",tce=g.forwardRef((t,e)=>{const n=H7(ak,t.__scopeDialog),{forceMount:r=n.forceMount,...i}=t,o=Ru(ak,t.__scopeDialog);return o.modal?g.createElement(a1,{present:r||o.open},g.createElement(nce,H({},i,{ref:e}))):null}),nce=g.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,i=Ru(ak,n);return g.createElement(Xle,{as:B2,allowPinchZoom:!0,shards:[i.contentRef]},g.createElement(s1.div,H({"data-state":K7(i.open)},r,{ref:e,style:{pointerEvents:"auto",...r.style}})))}),rm="DialogContent",rce=g.forwardRef((t,e)=>{const n=H7(rm,t.__scopeDialog),{forceMount:r=n.forceMount,...i}=t,o=Ru(rm,t.__scopeDialog);return g.createElement(a1,{present:r||o.open},o.modal?g.createElement(ice,H({},i,{ref:e})):g.createElement(oce,H({},i,{ref:e})))}),ice=g.forwardRef((t,e)=>{const n=Ru(rm,t.__scopeDialog),r=g.useRef(null),i=$m(e,n.contentRef,r);return g.useEffect(()=>{const o=r.current;if(o)return Qb(o)},[]),g.createElement(q7,H({},t,{ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ff(t.onCloseAutoFocus,o=>{var s;o.preventDefault(),(s=n.triggerRef.current)===null||s===void 0||s.focus()}),onPointerDownOutside:Ff(t.onPointerDownOutside,o=>{const s=o.detail.originalEvent,a=s.button===0&&s.ctrlKey===!0;(s.button===2||a)&&o.preventDefault()}),onFocusOutside:Ff(t.onFocusOutside,o=>o.preventDefault())}))}),oce=g.forwardRef((t,e)=>{const n=Ru(rm,t.__scopeDialog),r=g.useRef(!1);return g.createElement(q7,H({},t,{ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var o;if((o=t.onCloseAutoFocus)===null||o===void 0||o.call(t,i),!i.defaultPrevented){var s;r.current||(s=n.triggerRef.current)===null||s===void 0||s.focus(),i.preventDefault()}r.current=!1},onInteractOutside:i=>{var o,s;(o=t.onInteractOutside)===null||o===void 0||o.call(t,i),i.defaultPrevented||(r.current=!0);const a=i.target;((s=n.triggerRef.current)===null||s===void 0?void 0:s.contains(a))&&i.preventDefault()}}))}),q7=g.forwardRef((t,e)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:o,...s}=t,a=Ru(rm,n),l=g.useRef(null),c=$m(e,l);return jle(),g.createElement(g.Fragment,null,g.createElement(Ale,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:o},g.createElement(Ele,H({role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":K7(a.open)},s,{ref:c,onDismiss:()=>a.onOpenChange(!1)}))),!1)});function K7(t){return t?"open":"closed"}const sce=Qle,ace=ece,lce=tce,cce=rce;var eM=1,uce=.9,fce=.3,qx=.1,dce=0,Kx=.999,hce=.9999,pce=.99,tM=/[\\\/\-_+.# \t"@\[\(\{&]/,mce=/[\\\/\-_+.# \t"@\[\(\{&]/g;function lk(t,e,n,r,i,o){if(o===e.length)return i===t.length?eM:pce;for(var s=r.charAt(o),a=n.indexOf(s,i),l=0,c,f,d;a>=0;)c=lk(t,e,n,r,a+1,o+1),c>l&&(a===i?c*=eM:tM.test(t.charAt(a-1))?(c*=uce,d=t.slice(i,a-1).match(mce),d&&i>0&&(c*=Math.pow(Kx,d.length))):tM.test(t.slice(i,a-1))?(c*=dce,i>0&&(c*=Math.pow(Kx,a-i))):(c*=fce,i>0&&(c*=Math.pow(Kx,a-i))),t.charAt(a)!==e.charAt(o)&&(c*=hce)),c<qx&&n.charAt(a-1)===r.charAt(o+1)&&n.charAt(a-1)!==r.charAt(o)&&(f=lk(t,e,n,r,a+1,o+2),f*qx>c&&(c=f*qx)),c>l&&(l=c),a=n.indexOf(s,a+1);return l}function gce(t,e){return lk(t,e,t.toLowerCase(),e.toLowerCase(),0,0)}var vce=gce;const yce=Su(vce);var bce='[cmdk-list-sizer=""]',_h='[cmdk-group=""]',Gx='[cmdk-group-items=""]',wce='[cmdk-group-heading=""]',G7='[cmdk-item=""]',nM=`${G7}:not([aria-disabled="true"])`,ck="cmdk-item-select",pl="data-value",xce=(t,e)=>yce(t,e),Y7=g.createContext(void 0),Im=()=>g.useContext(Y7),X7=g.createContext(void 0),F2=()=>g.useContext(X7),Z7=g.createContext(void 0),Q7=g.forwardRef((t,e)=>{let n=g.useRef(null),r=af(()=>({search:"",value:"",filtered:{count:0,items:new Map,groups:new Set}})),i=af(()=>new Set),o=af(()=>new Map),s=af(()=>new Map),a=af(()=>new Set),l=J7(t),{label:c,children:f,value:d,onValueChange:p,filter:m,shouldFilter:v,...b}=t,S=g.useId(),x=g.useId(),w=g.useId(),C=Nce();Ld(()=>{if(d!==void 0){let W=d.trim().toLowerCase();r.current.value=W,C(6,V),T.emit()}},[d]);let T=g.useMemo(()=>({subscribe:W=>(a.current.add(W),()=>a.current.delete(W)),snapshot:()=>r.current,setState:(W,P,he)=>{var fe,$,Ne;if(!Object.is(r.current[W],P)){if(r.current[W]=P,W==="search")I(),R(),C(1,M);else if(W==="value")if(((fe=l.current)==null?void 0:fe.value)!==void 0){(Ne=($=l.current).onValueChange)==null||Ne.call($,P);return}else he||C(5,V);T.emit()}},emit:()=>{a.current.forEach(W=>W())}}),[]),A=g.useMemo(()=>({value:(W,P)=>{P!==s.current.get(W)&&(s.current.set(W,P),r.current.filtered.items.set(W,_(P)),C(2,()=>{R(),T.emit()}))},item:(W,P)=>(i.current.add(W),P&&(o.current.has(P)?o.current.get(P).add(W):o.current.set(P,new Set([W]))),C(3,()=>{I(),R(),r.current.value||M(),T.emit()}),()=>{s.current.delete(W),i.current.delete(W),r.current.filtered.items.delete(W),C(4,()=>{I(),M(),T.emit()})}),group:W=>(o.current.has(W)||o.current.set(W,new Set),()=>{s.current.delete(W),o.current.delete(W)}),filter:()=>l.current.shouldFilter,label:c||t["aria-label"],listId:S,inputId:w,labelId:x}),[]);function _(W){var P;let he=((P=l.current)==null?void 0:P.filter)??xce;return W?he(W,r.current.search):0}function R(){if(!n.current||!r.current.search||l.current.shouldFilter===!1)return;let W=r.current.filtered.items,P=[];r.current.filtered.groups.forEach(fe=>{let $=o.current.get(fe),Ne=0;$.forEach(He=>{let Ye=W.get(He);Ne=Math.max(Ye,Ne)}),P.push([fe,Ne])});let he=n.current.querySelector(bce);L().sort((fe,$)=>{let Ne=fe.getAttribute(pl),He=$.getAttribute(pl);return(W.get(He)??0)-(W.get(Ne)??0)}).forEach(fe=>{let $=fe.closest(Gx);$?$.appendChild(fe.parentElement===$?fe:fe.closest(`${Gx} > *`)):he.appendChild(fe.parentElement===he?fe:fe.closest(`${Gx} > *`))}),P.sort((fe,$)=>$[1]-fe[1]).forEach(fe=>{let $=n.current.querySelector(`${_h}[${pl}="${fe[0]}"]`);$==null||$.parentElement.appendChild($)})}function M(){let W=L().find(he=>!he.ariaDisabled),P=W==null?void 0:W.getAttribute(pl);T.setState("value",P||void 0)}function I(){if(!r.current.search||l.current.shouldFilter===!1){r.current.filtered.count=i.current.size;return}r.current.filtered.groups=new Set;let W=0;for(let P of i.current){let he=s.current.get(P),fe=_(he);r.current.filtered.items.set(P,fe),fe>0&&W++}for(let[P,he]of o.current)for(let fe of he)if(r.current.filtered.items.get(fe)>0){r.current.filtered.groups.add(P);break}r.current.filtered.count=W}function V(){var W,P,he;let fe=U();fe&&(((W=fe.parentElement)==null?void 0:W.firstChild)===fe&&((he=(P=fe.closest(_h))==null?void 0:P.querySelector(wce))==null||he.scrollIntoView({block:"nearest"})),fe.scrollIntoView({block:"nearest"}))}function U(){return n.current.querySelector(`${G7}[aria-selected="true"]`)}function L(){return Array.from(n.current.querySelectorAll(nM))}function G(W){let P=L()[W];P&&T.setState("value",P.getAttribute(pl))}function K(W){var P;let he=U(),fe=L(),$=fe.findIndex(He=>He===he),Ne=fe[$+W];(P=l.current)!=null&&P.loop&&(Ne=$+W<0?fe[fe.length-1]:$+W===fe.length?fe[0]:fe[$+W]),Ne&&T.setState("value",Ne.getAttribute(pl))}function F(W){let P=U(),he=P==null?void 0:P.closest(_h),fe;for(;he&&!fe;)he=W>0?Rce(he,_h):Pce(he,_h),fe=he==null?void 0:he.querySelector(nM);fe?T.setState("value",fe.getAttribute(pl)):K(W)}let ie=()=>G(L().length-1),ae=W=>{W.preventDefault(),W.metaKey?ie():W.altKey?F(1):K(1)},re=W=>{W.preventDefault(),W.metaKey?G(0):W.altKey?F(-1):K(-1)};return g.createElement("div",{ref:jm([n,e]),...b,"cmdk-root":"",onKeyDown:W=>{var P;if((P=b.onKeyDown)==null||P.call(b,W),!W.defaultPrevented)switch(W.key){case"n":case"j":{W.ctrlKey&&ae(W);break}case"ArrowDown":{ae(W);break}case"p":case"k":{W.ctrlKey&&re(W);break}case"ArrowUp":{re(W);break}case"Home":{W.preventDefault(),G(0);break}case"End":{W.preventDefault(),ie();break}case"Enter":{W.preventDefault();let he=U();if(he){let fe=new Event(ck);he.dispatchEvent(fe)}}}}},g.createElement("label",{"cmdk-label":"",htmlFor:A.inputId,id:A.labelId,style:Mce},c),g.createElement(X7.Provider,{value:T},g.createElement(Y7.Provider,{value:A},f)))}),Sce=g.forwardRef((t,e)=>{let n=g.useId(),r=g.useRef(null),i=g.useContext(Z7),o=Im(),s=J7(t);Ld(()=>o.item(n,i),[]);let a=ej(n,r,[t.value,t.children,r]),l=F2(),c=fd(x=>x.value&&x.value===a.current),f=fd(x=>o.filter()===!1?!0:x.search?x.filtered.items.get(n)>0:!0);g.useEffect(()=>{let x=r.current;if(!(!x||t.disabled))return x.addEventListener(ck,d),()=>x.removeEventListener(ck,d)},[f,t.onSelect,t.disabled]);function d(){var x,w;(w=(x=s.current).onSelect)==null||w.call(x,a.current)}function p(){l.setState("value",a.current,!0)}if(!f)return null;let{disabled:m,value:v,onSelect:b,...S}=t;return g.createElement("div",{ref:jm([r,e]),...S,"cmdk-item":"",role:"option","aria-disabled":m||void 0,"aria-selected":c||void 0,"data-selected":c||void 0,onPointerMove:m?void 0:p,onClick:m?void 0:d},t.children)}),Cce=g.forwardRef((t,e)=>{let{heading:n,children:r,...i}=t,o=g.useId(),s=g.useRef(null),a=g.useRef(null),l=g.useId(),c=Im(),f=fd(p=>c.filter()===!1?!0:p.search?p.filtered.groups.has(o):!0);Ld(()=>c.group(o),[]),ej(o,s,[t.value,t.heading,a]);let d=g.createElement(Z7.Provider,{value:o},r);return g.createElement("div",{ref:jm([s,e]),...i,"cmdk-group":"",role:"presentation",hidden:f?void 0:!0},n&&g.createElement("div",{ref:a,"cmdk-group-heading":"","aria-hidden":!0,id:l},n),g.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?l:void 0},d))}),kce=g.forwardRef((t,e)=>{let{alwaysRender:n,...r}=t,i=g.useRef(null),o=fd(s=>!s.search);return!n&&!o?null:g.createElement("div",{ref:jm([i,e]),...r,"cmdk-separator":"",role:"separator"})}),Ece=g.forwardRef((t,e)=>{let{onValueChange:n,...r}=t,i=t.value!=null,o=F2(),s=fd(l=>l.search),a=Im();return g.useEffect(()=>{t.value!=null&&o.setState("search",t.value)},[t.value]),g.createElement("input",{ref:e,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":a.listId,"aria-labelledby":a.labelId,id:a.inputId,type:"text",value:i?t.value:s,onChange:l=>{i||o.setState("search",l.target.value),n==null||n(l.target.value)}})}),_ce=g.forwardRef((t,e)=>{let{children:n,...r}=t,i=g.useRef(null),o=g.useRef(null),s=Im();return g.useEffect(()=>{if(o.current&&i.current){let a=o.current,l=i.current,c,f=new ResizeObserver(()=>{c=requestAnimationFrame(()=>{let d=a.getBoundingClientRect().height;l.style.setProperty("--cmdk-list-height",d.toFixed(1)+"px")})});return f.observe(a),()=>{cancelAnimationFrame(c),f.unobserve(a)}}},[]),g.createElement("div",{ref:jm([i,e]),...r,"cmdk-list":"",role:"listbox","aria-label":"Suggestions",id:s.listId,"aria-labelledby":s.inputId},g.createElement("div",{ref:o,"cmdk-list-sizer":""},n))}),Tce=g.forwardRef((t,e)=>{let{open:n,onOpenChange:r,container:i,...o}=t;return g.createElement(sce,{open:n,onOpenChange:r},g.createElement(ace,{container:i},g.createElement(lce,{"cmdk-overlay":""}),g.createElement(cce,{"aria-label":t.label,"cmdk-dialog":""},g.createElement(Q7,{ref:e,...o}))))}),Ace=g.forwardRef((t,e)=>{let n=g.useRef(!0),r=fd(i=>i.filtered.count===0);return g.useEffect(()=>{n.current=!1},[]),n.current||!r?null:g.createElement("div",{ref:e,...t,"cmdk-empty":"",role:"presentation"})}),Oce=g.forwardRef((t,e)=>{let{progress:n,children:r,...i}=t;return g.createElement("div",{ref:e,...i,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":"Loading..."},g.createElement("div",{"aria-hidden":!0},r))}),Di=Object.assign(Q7,{List:_ce,Item:Sce,Input:Ece,Group:Cce,Separator:kce,Dialog:Tce,Empty:Ace,Loading:Oce});function Rce(t,e){let n=t.nextElementSibling;for(;n;){if(n.matches(e))return n;n=n.nextElementSibling}}function Pce(t,e){let n=t.previousElementSibling;for(;n;){if(n.matches(e))return n;n=n.previousElementSibling}}function J7(t){let e=g.useRef(t);return Ld(()=>{e.current=t}),e}var Ld=typeof window>"u"?g.useEffect:g.useLayoutEffect;function af(t){let e=g.useRef();return e.current===void 0&&(e.current=t()),e}function jm(t){return e=>{t.forEach(n=>{typeof n=="function"?n(e):n!=null&&(n.current=e)})}}function fd(t){let e=F2(),n=()=>t(e.snapshot());return g.useSyncExternalStore(e.subscribe,n,n)}function ej(t,e,n){let r=g.useRef(),i=Im();return Ld(()=>{var o;let s=(()=>{var a;for(let l of n){if(typeof l=="string")return l.trim().toLowerCase();if(typeof l=="object"&&"current"in l&&l.current)return(a=l.current.textContent)==null?void 0:a.trim().toLowerCase()}})();i.value(t,s),(o=e.current)==null||o.setAttribute(pl,s),r.current=s}),r}var Nce=()=>{let[t,e]=g.useState(),n=af(()=>new Map);return Ld(()=>{n.current.forEach(r=>r()),n.current=new Map},[t]),(r,i)=>{n.current.set(r,i),e({})}},Mce={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const tj=g.forwardRef(({className:t,...e},n)=>k.jsx(Di,{ref:n,className:ft("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",t),...e}));tj.displayName=Di.displayName;const nj=g.forwardRef(({className:t,...e},n)=>k.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[k.jsx(Ine,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),k.jsx(Di.Input,{ref:n,className:ft("placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none disabled:cursor-not-allowed disabled:opacity-50",t),...e})]}));nj.displayName=Di.Input.displayName;const rj=g.forwardRef(({className:t,...e},n)=>k.jsx(Di.List,{ref:n,className:ft("max-h-[300px] overflow-y-auto overflow-x-hidden",t),...e}));rj.displayName=Di.List.displayName;const ij=g.forwardRef((t,e)=>k.jsx(Di.Empty,{ref:e,className:"py-6 text-center text-sm",...t}));ij.displayName=Di.Empty.displayName;const uk=g.forwardRef(({className:t,...e},n)=>k.jsx(Di.Group,{ref:n,className:ft("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",t),...e}));uk.displayName=Di.Group.displayName;const oj=g.forwardRef(({className:t,...e},n)=>k.jsx(Di.Separator,{ref:n,className:ft("bg-border -mx-1 h-px",t),...e}));oj.displayName=Di.Separator.displayName;const fk=g.forwardRef(({className:t,...e},n)=>k.jsx(Di.Item,{ref:n,className:ft("aria-selected:bg-accent aria-selected:text-accent-foreground relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...e}));fk.displayName=Di.Item.displayName;const sj="Popover",[aj,UCe]=Fo(sj,[Td]),z2=Td(),[Dce,$d]=aj(sj),Lce=t=>{const{__scopePopover:e,children:n,open:r,defaultOpen:i,onOpenChange:o,modal:s=!1}=t,a=z2(e),l=g.useRef(null),[c,f]=g.useState(!1),[d=!1,p]=Zs({prop:r,defaultProp:i,onChange:o});return g.createElement(z_,a,g.createElement(Dce,{scope:e,contentId:Oa(),triggerRef:l,open:d,onOpenChange:p,onOpenToggle:g.useCallback(()=>p(m=>!m),[p]),hasCustomAnchor:c,onCustomAnchorAdd:g.useCallback(()=>f(!0),[]),onCustomAnchorRemove:g.useCallback(()=>f(!1),[]),modal:s},n))},$ce="PopoverTrigger",Ice=g.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,i=$d($ce,n),o=z2(n),s=hn(e,i.triggerRef),a=g.createElement(Dt.button,H({type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":uj(i.open)},r,{ref:s,onClick:yt(t.onClick,i.onOpenToggle)}));return i.hasCustomAnchor?a:g.createElement(V_,H({asChild:!0},o),a)}),lj="PopoverPortal",[jce,Bce]=aj(lj,{forceMount:void 0}),Fce=t=>{const{__scopePopover:e,forceMount:n,children:r,container:i}=t,o=$d(lj,e);return g.createElement(jce,{scope:e,forceMount:n},g.createElement(ws,{present:n||o.open},g.createElement(jb,{asChild:!0,container:i},r)))},im="PopoverContent",zce=g.forwardRef((t,e)=>{const n=Bce(im,t.__scopePopover),{forceMount:r=n.forceMount,...i}=t,o=$d(im,t.__scopePopover);return g.createElement(ws,{present:r||o.open},o.modal?g.createElement(Vce,H({},i,{ref:e})):g.createElement(Uce,H({},i,{ref:e})))}),Vce=g.forwardRef((t,e)=>{const n=$d(im,t.__scopePopover),r=g.useRef(null),i=hn(e,r),o=g.useRef(!1);return g.useEffect(()=>{const s=r.current;if(s)return Qb(s)},[]),g.createElement(k2,{as:$a,allowPinchZoom:!0},g.createElement(cj,H({},t,{ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:yt(t.onCloseAutoFocus,s=>{var a;s.preventDefault(),o.current||(a=n.triggerRef.current)===null||a===void 0||a.focus()}),onPointerDownOutside:yt(t.onPointerDownOutside,s=>{const a=s.detail.originalEvent,l=a.button===0&&a.ctrlKey===!0,c=a.button===2||l;o.current=c},{checkForDefaultPrevented:!1}),onFocusOutside:yt(t.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1})})))}),Uce=g.forwardRef((t,e)=>{const n=$d(im,t.__scopePopover),r=g.useRef(!1),i=g.useRef(!1);return g.createElement(cj,H({},t,{ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var s;if((s=t.onCloseAutoFocus)===null||s===void 0||s.call(t,o),!o.defaultPrevented){var a;r.current||(a=n.triggerRef.current)===null||a===void 0||a.focus(),o.preventDefault()}r.current=!1,i.current=!1},onInteractOutside:o=>{var s,a;(s=t.onInteractOutside)===null||s===void 0||s.call(t,o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const l=o.target;((a=n.triggerRef.current)===null||a===void 0?void 0:a.contains(l))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}}))}),cj=g.forwardRef((t,e)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:o,disableOutsidePointerEvents:s,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:c,onInteractOutside:f,...d}=t,p=$d(im,n),m=z2(n);return S2(),g.createElement(x2,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:o},g.createElement(Db,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:f,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:c,onDismiss:()=>p.onOpenChange(!1)},g.createElement(U_,H({"data-state":uj(p.open),role:"dialog",id:p.contentId},m,d,{ref:e,style:{...d.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}}))))});function uj(t){return t?"open":"closed"}const Wce=Lce,Hce=Ice,qce=Fce,fj=zce,c1=Wce,u1=Hce,Bm=g.forwardRef(({className:t,align:e="center",sideOffset:n=4,...r},i)=>k.jsx(qce,{children:k.jsx(fj,{ref:i,align:e,sideOffset:n,className:ft("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 rounded-md border p-4 shadow-md outline-none",t),...r})}));Bm.displayName=fj.displayName;const Kce=[$e.AI_ACTION,...Object.values(Le)],Gce=t=>t.type===$e.AI_ACTION?t.type:t.type===$e.PRESET_ACTION?t.command:$e.MODULE,Yce=t=>{const e=Gce(t.value),[n,r]=g.useState(!1);return k.jsxs(c1,{open:n,onOpenChange:r,children:[k.jsx(u1,{asChild:!0,children:k.jsx(Tn,{variant:"secondary",size:"sm",disabled:t.disabled,className:ft({"pointer-events-none":t.readOnly}),children:k.jsx("span",{className:"whitespace-nowrap text-base font-normal",children:S0[e]})})}),k.jsx(Bm,{className:"w-[400px] p-0",side:"right",align:"start",children:k.jsx(dj,{modules:t.modules,hideModules:t.hideModules,aiSuggestibleCommandsOnly:t.aiSuggestibleCommandsOnly,onSelect:i=>{var o;(o=t.onChange)==null||o.call(t,i),r(!1)}})})]})},fy=t=>{const[e,n]=g.useState(!1);return k.jsxs(c1,{open:e,onOpenChange:n,children:[k.jsx(u1,{asChild:!0,children:t.children?t.children:k.jsxs(Tn,{variant:"outline",disabled:t.disabled,children:[k.jsx(s6,{className:"mr-2 h-4 w-4"})," Add new step"]})}),k.jsx(Bm,{className:"w-[400px] p-0",side:"right",align:"start",children:k.jsx(dj,{hideModules:t.hideModules,aiSuggestibleCommandsOnly:t.aiSuggestibleCommandsOnly,modules:t.modules,onSelect:r=>{var i;(i=t.onAdd)==null||i.call(t,r),n(!1)}})})]})},dj=t=>k.jsxs(tj,{children:[k.jsx(nj,{placeholder:"Search steps...",className:"h-9"}),k.jsxs(rj,{className:"max-h-[300px] overflow-y-auto overflow-x-hidden",children:[k.jsx(ij,{children:"No steps found."}),!t.hideModules&&!!t.modules.length&&k.jsxs(k.Fragment,{children:[k.jsx(uk,{heading:"Modules",children:t.modules.map(e=>k.jsx(fk,{onSelect:()=>{var n;(n=t.onSelect)==null||n.call(t,e)},value:`${e.name} ${e.moduleId}`,children:k.jsxs("div",{children:[k.jsx("div",{className:"font-medium",children:e.name}),k.jsxs("div",{className:"text-muted-foreground",children:[e.steps.length," step",e.steps.length===1?"":"s"]})]})},e.moduleId))}),k.jsx(oj,{})]}),k.jsx(uk,{heading:"Steps",children:Kce.filter(e=>e===Le.SUCCESS?t.aiSuggestibleCommandsOnly:t.aiSuggestibleCommandsOnly?Pd.options.some(n=>n.shape.type.value===e):!0).map(e=>k.jsx(fk,{value:S0[e],onSelect:()=>{var n,r;if(qne(e)){(n=t.onSelect)==null||n.call(t,{type:$e.PRESET_ACTION,command:e});return}(r=t.onSelect)==null||r.call(t,{type:e})},children:k.jsxs("div",{children:[k.jsx("div",{className:"font-medium",children:S0[e]}),k.jsx("div",{className:"text-muted-foreground",children:Kne[e]})]})},e))})]})]}),Xce=t=>k.jsxs(k.Fragment,{children:[!t.disallowModification&&k.jsxs(Ls,{children:[k.jsx($s,{asChild:!0,children:k.jsx(Tn,{variant:"plain",size:"icon",onClick:t.onMoveUp,disabled:t.disabled,className:"rounded-r-none",children:k.jsx(cse,{className:"h-4 w-4"})})}),k.jsx(Cc,{children:k.jsx(ss,{children:"Move up"})})]}),!t.disallowModification&&k.jsxs(Ls,{children:[k.jsx($s,{asChild:!0,children:k.jsx(Tn,{variant:"plain",size:"icon",onClick:t.onMoveDown,disabled:t.disabled,className:"rounded-none",children:k.jsx(lse,{className:"h-4 w-4"})})}),k.jsx(Cc,{children:k.jsx(ss,{children:"Move down"})})]}),k.jsxs(Ls,{children:[k.jsx(fy,{onAdd:t.onAddBefore,hideModules:t.hideModules,modules:t.modules,aiSuggestibleCommandsOnly:t.aiSuggestibleCommandsOnly,children:k.jsx($s,{asChild:!0,children:k.jsx(Tn,{variant:"plain",size:"icon",className:"rounded-none",disabled:t.disabled,children:k.jsx(lle,{className:"h-4 w-4"})})})}),k.jsx(Cc,{children:k.jsx(ss,{children:"Add before"})})]}),t.canAddAfter&&k.jsxs(Ls,{children:[k.jsx(fy,{onAdd:t.onAddAfter,hideModules:t.hideModules,modules:t.modules,aiSuggestibleCommandsOnly:t.aiSuggestibleCommandsOnly,children:k.jsx($s,{asChild:!0,children:k.jsx(Tn,{variant:"plain",size:"icon",className:"rounded-none",disabled:t.disabled,children:k.jsx(ale,{className:"h-4 w-4"})})})}),k.jsx(Cc,{children:k.jsx(ss,{children:"Add after"})})]}),t.canAddChild&&k.jsxs(Ls,{children:[k.jsx(fy,{onAdd:t.onAddChild,hideModules:!0,modules:t.modules,aiSuggestibleCommandsOnly:t.aiSuggestibleCommandsChildrenOnly,children:k.jsx($s,{asChild:!0,children:k.jsx(Tn,{variant:"plain",size:"icon",className:"rounded-none",disabled:t.disabled,children:k.jsx(ose,{className:"h-4 w-4"})})})}),k.jsx(Cc,{children:k.jsx(ss,{children:"Add child"})})]}),!t.disallowModification&&k.jsxs(Ls,{children:[k.jsx($s,{asChild:!0,children:k.jsx(Tn,{variant:"plain",size:"icon",className:"rounded-l-none",disabled:t.disabled,children:k.jsx(bse,{className:"text-destructive h-4 w-4",onClick:t.onDelete})})}),k.jsx(Cc,{children:k.jsx(ss,{children:"Delete"})})]})]}),hj="Switch",[Zce,WCe]=Fo(hj),[Qce,Jce]=Zce(hj),eue=g.forwardRef((t,e)=>{const{__scopeSwitch:n,name:r,checked:i,defaultChecked:o,required:s,disabled:a,value:l="on",onCheckedChange:c,...f}=t,[d,p]=g.useState(null),m=hn(e,w=>p(w)),v=g.useRef(!1),b=d?!!d.closest("form"):!0,[S=!1,x]=Zs({prop:i,defaultProp:o,onChange:c});return g.createElement(Qce,{scope:n,checked:S,disabled:a},g.createElement(Dt.button,H({type:"button",role:"switch","aria-checked":S,"aria-required":s,"data-state":pj(S),"data-disabled":a?"":void 0,disabled:a,value:l},f,{ref:m,onClick:yt(t.onClick,w=>{x(C=>!C),b&&(v.current=w.isPropagationStopped(),v.current||w.stopPropagation())})})),b&&g.createElement(rue,{control:d,bubbles:!v.current,name:r,value:l,checked:S,required:s,disabled:a,style:{transform:"translateX(-100%)"}}))}),tue="SwitchThumb",nue=g.forwardRef((t,e)=>{const{__scopeSwitch:n,...r}=t,i=Jce(tue,n);return g.createElement(Dt.span,H({"data-state":pj(i.checked),"data-disabled":i.disabled?"":void 0},r,{ref:e}))}),rue=t=>{const{control:e,checked:n,bubbles:r=!0,...i}=t,o=g.useRef(null),s=i1(n),a=Ib(e);return g.useEffect(()=>{const l=o.current,c=window.HTMLInputElement.prototype,d=Object.getOwnPropertyDescriptor(c,"checked").set;if(s!==n&&d){const p=new Event("click",{bubbles:r});d.call(l,n),l.dispatchEvent(p)}},[s,n,r]),g.createElement("input",H({type:"checkbox","aria-hidden":!0,defaultChecked:n},i,{tabIndex:-1,ref:o,style:{...t.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function pj(t){return t?"checked":"unchecked"}const mj=eue,iue=nue,Qo=g.forwardRef(({className:t,...e},n)=>k.jsx(mj,{className:ft("focus-visible:ring-ring focus-visible:ring-offset-background data-[state=checked]:bg-primary data-[state=unchecked]:bg-input peer inline-flex h-[20px] w-[36px] shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",t),...e,ref:n,children:k.jsx(iue,{className:ft("bg-background pointer-events-none block h-4 w-4 rounded-full shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})}));Qo.displayName=mj.displayName;function gj(t){const e=g.useRef(t);return g.useLayoutEffect(()=>{e.current=t}),g.useCallback(function(...r){return e.current&&e.current(...r)},[])}const oue=t=>{const e=g.useId(),n=t.step,r=gj(o=>{var s;(s=t.onStepChange)==null||s.call(t,o)}),i=g.useMemo(()=>{const o=[];if(n.type===$e.PRESET_ACTION&&(n.command.type===Le.CLICK||n.command.type===Le.TYPE||n.command.type===Le.HOVER||n.command.type===Le.SCROLL_UP||n.command.type===Le.SCROLL_DOWN||n.command.type===Le.CAPTCHA||n.command.type===Le.AI_ASSERTION)){const s=n.command;o.push(k.jsxs("div",{className:"flex items-center justify-between space-x-2",children:[k.jsxs(xi,{htmlFor:`${e}-vision`,className:"flex flex-col space-y-1",children:[k.jsx("span",{children:"Use vision"}),k.jsx("span",{className:"text-muted-foreground font-normal leading-snug",children:"Describe an element using its visual appearance or position on the screen."})]}),k.jsx(Qo,{id:`${e}-vision`,disabled:t.disabled,checked:s.useVision,onCheckedChange:a=>r==null?void 0:r({type:$e.PRESET_ACTION,command:{...s,useVision:!!a}})})]},"vision"))}if(n.type===$e.PRESET_ACTION&&n.command.type===Le.AI_ASSERTION){const s=n.command;o.push(k.jsxs("div",{className:"flex items-center justify-between space-x-2",children:[k.jsxs(xi,{htmlFor:`${e}-cache`,className:"flex flex-col space-y-1",children:[k.jsx("span",{children:"Cache results"}),k.jsx("span",{className:"text-muted-foreground font-normal leading-snug",children:"Reuse the results of this assertion."})]}),k.jsx(Qo,{id:`${e}-cache`,disabled:t.disabled,checked:!s.disableCache,onCheckedChange:a=>r==null?void 0:r({type:$e.PRESET_ACTION,command:{...s,disableCache:!a}})})]},"cache"),k.jsxs("div",{className:"flex items-center justify-between space-x-2",children:[k.jsxs(xi,{htmlFor:`${e}-cancel`,className:"flex flex-col space-y-1",children:[k.jsx("span",{children:"Cancel on failure"}),k.jsx("span",{className:"text-muted-foreground font-normal leading-snug",children:"Stop the test if this assertion fails. This does not trigger notifications."})]}),k.jsx(Qo,{id:`${e}-cancel`,disabled:t.disabled,checked:s.cancelOnFailure,onCheckedChange:a=>r==null?void 0:r({type:$e.PRESET_ACTION,command:{...s,cancelOnFailure:a}})})]},"cancel"))}if(n.type===$e.PRESET_ACTION&&n.command.type===Le.SUCCESS&&n.command.condition){const s=n.command,a=n.command.condition;o.push(k.jsxs("div",{className:"flex items-center justify-between space-x-2",children:[k.jsxs(xi,{htmlFor:`${e}-vision`,className:"flex flex-col space-y-1",children:[k.jsx("span",{children:"Use vision"}),k.jsx("span",{className:"text-muted-foreground font-normal leading-snug",children:"Describe an element using its visual appearance or position on the screen."})]}),k.jsx(Qo,{id:`${e}-vision`,disabled:t.disabled,checked:a==null?void 0:a.useVision,onCheckedChange:l=>r==null?void 0:r({type:$e.PRESET_ACTION,command:{...s,condition:{...a,useVision:!!l}}})})]},"vision"),k.jsxs("div",{className:"flex items-center justify-between space-x-2",children:[k.jsxs(xi,{htmlFor:`${e}-cache`,className:"flex flex-col space-y-1",children:[k.jsx("span",{children:"Cache results"}),k.jsx("span",{className:"text-muted-foreground font-normal leading-snug",children:"Reuse the results of this assertion."})]}),k.jsx(Qo,{id:`${e}-cache`,disabled:t.disabled,checked:!a.disableCache,onCheckedChange:l=>r==null?void 0:r({type:$e.PRESET_ACTION,command:{...s,condition:{...a,disableCache:!l}}})})]},"cache"))}if(n.type===$e.PRESET_ACTION&&n.command.type===Le.CLICK){const s=n.command;o.push(k.jsxs("div",{className:"flex items-center justify-between space-x-2",children:[k.jsxs(xi,{htmlFor:`${e}-dblclick`,className:"flex flex-col space-y-1",children:[k.jsx("span",{children:"Double click"}),k.jsx("span",{className:"text-muted-foreground font-normal leading-snug",children:"Click twice in quick succession."})]}),k.jsx(Qo,{id:`${e}-dblclick`,disabled:t.disabled,checked:s.doubleClick,onCheckedChange:a=>r==null?void 0:r({type:$e.PRESET_ACTION,command:{...s,doubleClick:!!a}})})]},"dblclick"),k.jsxs("div",{className:"flex items-center justify-between space-x-2",children:[k.jsxs(xi,{htmlFor:`${e}-rightclick`,className:"flex flex-col space-y-1",children:[k.jsx("span",{children:"Right click"}),k.jsx("span",{className:"text-muted-foreground font-normal leading-snug",children:"Use the right mouse button."})]}),k.jsx(Qo,{id:`${e}-rightclick`,disabled:t.disabled,checked:s.rightClick,onCheckedChange:a=>r==null?void 0:r({type:$e.PRESET_ACTION,command:{...s,rightClick:!!a}})})]},"rightclick"))}if(n.type===$e.PRESET_ACTION&&n.command.type===Le.TYPE){const s=n.command;o.push(k.jsxs("div",{className:"flex items-center justify-between space-x-2",children:[k.jsxs(xi,{htmlFor:`${e}-replace`,className:"flex flex-col space-y-1",children:[k.jsx("span",{children:"Replace content"}),k.jsx("span",{className:"text-muted-foreground font-normal leading-snug",children:"Replace the existing content with the new content."})]}),k.jsx(Qo,{id:`${e}-replace`,disabled:t.disabled,checked:s.clearContent,onCheckedChange:a=>r==null?void 0:r({type:$e.PRESET_ACTION,command:{...s,clearContent:!!a}})})]},"replace"),k.jsxs("div",{className:"flex items-center justify-between space-x-2",children:[k.jsxs(xi,{htmlFor:`${e}-enter`,className:"flex flex-col space-y-1",children:[k.jsx("span",{children:"Press enter"}),k.jsx("span",{className:"text-muted-foreground font-normal leading-snug",children:"Press the enter key after typing the content."})]}),k.jsx(Qo,{id:`${e}-enter`,disabled:t.disabled,checked:s.pressEnter,onCheckedChange:a=>r==null?void 0:r({type:$e.PRESET_ACTION,command:{...s,pressEnter:!!a}})})]},"enter"))}if(n.type===$e.PRESET_ACTION&&(n.command.type===Le.CLICK||n.command.type===Le.TYPE)){const s=n.command;o.push(k.jsxs("div",{className:"flex items-center justify-between space-x-2",children:[k.jsxs(xi,{htmlFor:`${e}-force`,className:"flex flex-col space-y-1",children:[k.jsx("span",{children:"Force"}),k.jsxs("span",{className:"text-muted-foreground font-normal leading-snug",children:["Do not wait for the element to be"," ",k.jsx("a",{className:"text-blue-500 hover:underline",href:"https://playwright.dev/docs/actionability",children:"stable and visible"}),"."]})]}),k.jsx(Qo,{id:`${e}-force`,disabled:t.disabled,checked:s.force,onCheckedChange:a=>r==null?void 0:r({type:$e.PRESET_ACTION,command:{...s,force:!!a}})})]},"force"))}return o},[e,r,t.disabled,n]);if(i.length)return k.jsxs(c1,{children:[k.jsx(u1,{asChild:!0,children:k.jsx(Tn,{variant:"plain",size:"icon",className:"ml-auto h-8 w-8",children:k.jsx(vse,{className:"h-7 w-7",strokeWidth:1})})}),k.jsx(Bm,{className:"grid w-96 gap-3",children:i})]})};function sue(t,e){const n=e||{};return(t[t.length-1]===""?[...t,""]:t).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const aue=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,lue=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,cue={};function rM(t,e){return((e||cue).jsx?lue:aue).test(t)}const uue=/[ \t\n\f\r]/g;function fue(t){return typeof t=="object"?t.type==="text"?iM(t.value):!1:iM(t)}function iM(t){return t.replace(uue,"")===""}class Fm{constructor(e,n,r){this.property=e,this.normal=n,r&&(this.space=r)}}Fm.prototype.property={};Fm.prototype.normal={};Fm.prototype.space=null;function vj(t,e){const n={},r={};let i=-1;for(;++i<t.length;)Object.assign(n,t[i].property),Object.assign(r,t[i].normal);return new Fm(n,r,e)}function dk(t){return t.toLowerCase()}class Vo{constructor(e,n){this.property=e,this.attribute=n}}Vo.prototype.space=null;Vo.prototype.boolean=!1;Vo.prototype.booleanish=!1;Vo.prototype.overloadedBoolean=!1;Vo.prototype.number=!1;Vo.prototype.commaSeparated=!1;Vo.prototype.spaceSeparated=!1;Vo.prototype.commaOrSpaceSeparated=!1;Vo.prototype.mustUseProperty=!1;Vo.prototype.defined=!1;let due=0;const kt=Pu(),rr=Pu(),yj=Pu(),Pe=Pu(),yn=Pu(),zf=Pu(),qi=Pu();function Pu(){return 2**++due}const hk=Object.freeze(Object.defineProperty({__proto__:null,boolean:kt,booleanish:rr,commaOrSpaceSeparated:qi,commaSeparated:zf,number:Pe,overloadedBoolean:yj,spaceSeparated:yn},Symbol.toStringTag,{value:"Module"})),Yx=Object.keys(hk);class V2 extends Vo{constructor(e,n,r,i){let o=-1;if(super(e,n),oM(this,"space",i),typeof r=="number")for(;++o<Yx.length;){const s=Yx[o];oM(this,Yx[o],(r&hk[s])===hk[s])}}}V2.prototype.defined=!0;function oM(t,e,n){n&&(t[e]=n)}const hue={}.hasOwnProperty;function Id(t){const e={},n={};let r;for(r in t.properties)if(hue.call(t.properties,r)){const i=t.properties[r],o=new V2(r,t.transform(t.attributes||{},r),i,t.space);t.mustUseProperty&&t.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),e[r]=o,n[dk(r)]=r,n[dk(o.attribute)]=r}return new Fm(e,n,t.space)}const bj=Id({space:"xlink",transform(t,e){return"xlink:"+e.slice(5).toLowerCase()},properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null}}),wj=Id({space:"xml",transform(t,e){return"xml:"+e.slice(3).toLowerCase()},properties:{xmlLang:null,xmlBase:null,xmlSpace:null}});function xj(t,e){return e in t?t[e]:e}function Sj(t,e){return xj(t,e.toLowerCase())}const Cj=Id({space:"xmlns",attributes:{xmlnsxlink:"xmlns:xlink"},transform:Sj,properties:{xmlns:null,xmlnsXLink:null}}),kj=Id({transform(t,e){return e==="role"?e:"aria-"+e.slice(4).toLowerCase()},properties:{ariaActiveDescendant:null,ariaAtomic:rr,ariaAutoComplete:null,ariaBusy:rr,ariaChecked:rr,ariaColCount:Pe,ariaColIndex:Pe,ariaColSpan:Pe,ariaControls:yn,ariaCurrent:null,ariaDescribedBy:yn,ariaDetails:null,ariaDisabled:rr,ariaDropEffect:yn,ariaErrorMessage:null,ariaExpanded:rr,ariaFlowTo:yn,ariaGrabbed:rr,ariaHasPopup:null,ariaHidden:rr,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:yn,ariaLevel:Pe,ariaLive:null,ariaModal:rr,ariaMultiLine:rr,ariaMultiSelectable:rr,ariaOrientation:null,ariaOwns:yn,ariaPlaceholder:null,ariaPosInSet:Pe,ariaPressed:rr,ariaReadOnly:rr,ariaRelevant:null,ariaRequired:rr,ariaRoleDescription:yn,ariaRowCount:Pe,ariaRowIndex:Pe,ariaRowSpan:Pe,ariaSelected:rr,ariaSetSize:Pe,ariaSort:null,ariaValueMax:Pe,ariaValueMin:Pe,ariaValueNow:Pe,ariaValueText:null,role:null}}),pue=Id({space:"html",attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},transform:Sj,mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:zf,acceptCharset:yn,accessKey:yn,action:null,allow:null,allowFullScreen:kt,allowPaymentRequest:kt,allowUserMedia:kt,alt:null,as:null,async:kt,autoCapitalize:null,autoComplete:yn,autoFocus:kt,autoPlay:kt,blocking:yn,capture:kt,charSet:null,checked:kt,cite:null,className:yn,cols:Pe,colSpan:null,content:null,contentEditable:rr,controls:kt,controlsList:yn,coords:Pe|zf,crossOrigin:null,data:null,dateTime:null,decoding:null,default:kt,defer:kt,dir:null,dirName:null,disabled:kt,download:yj,draggable:rr,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:kt,formTarget:null,headers:yn,height:Pe,hidden:kt,high:Pe,href:null,hrefLang:null,htmlFor:yn,httpEquiv:yn,id:null,imageSizes:null,imageSrcSet:null,inert:kt,inputMode:null,integrity:null,is:null,isMap:kt,itemId:null,itemProp:yn,itemRef:yn,itemScope:kt,itemType:yn,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:kt,low:Pe,manifest:null,max:null,maxLength:Pe,media:null,method:null,min:null,minLength:Pe,multiple:kt,muted:kt,name:null,nonce:null,noModule:kt,noValidate:kt,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:kt,optimum:Pe,pattern:null,ping:yn,placeholder:null,playsInline:kt,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:kt,referrerPolicy:null,rel:yn,required:kt,reversed:kt,rows:Pe,rowSpan:Pe,sandbox:yn,scope:null,scoped:kt,seamless:kt,selected:kt,shadowRootDelegatesFocus:kt,shadowRootMode:null,shape:null,size:Pe,sizes:null,slot:null,span:Pe,spellCheck:rr,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Pe,step:null,style:null,tabIndex:Pe,target:null,title:null,translate:null,type:null,typeMustMatch:kt,useMap:null,value:rr,width:Pe,wrap:null,align:null,aLink:null,archive:yn,axis:null,background:null,bgColor:null,border:Pe,borderColor:null,bottomMargin:Pe,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:kt,declare:kt,event:null,face:null,frame:null,frameBorder:null,hSpace:Pe,leftMargin:Pe,link:null,longDesc:null,lowSrc:null,marginHeight:Pe,marginWidth:Pe,noResize:kt,noHref:kt,noShade:kt,noWrap:kt,object:null,profile:null,prompt:null,rev:null,rightMargin:Pe,rules:null,scheme:null,scrolling:rr,standby:null,summary:null,text:null,topMargin:Pe,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Pe,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:kt,disableRemotePlayback:kt,prefix:null,property:null,results:Pe,security:null,unselectable:null}}),mue=Id({space:"svg",attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},transform:xj,properties:{about:qi,accentHeight:Pe,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Pe,amplitude:Pe,arabicForm:null,ascent:Pe,attributeName:null,attributeType:null,azimuth:Pe,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Pe,by:null,calcMode:null,capHeight:Pe,className:yn,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Pe,diffuseConstant:Pe,direction:null,display:null,dur:null,divisor:Pe,dominantBaseline:null,download:kt,dx:null,dy:null,edgeMode:null,editable:null,elevation:Pe,enableBackground:null,end:null,event:null,exponent:Pe,externalResourcesRequired:null,fill:null,fillOpacity:Pe,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:zf,g2:zf,glyphName:zf,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Pe,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Pe,horizOriginX:Pe,horizOriginY:Pe,id:null,ideographic:Pe,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Pe,k:Pe,k1:Pe,k2:Pe,k3:Pe,k4:Pe,kernelMatrix:qi,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Pe,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Pe,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Pe,overlineThickness:Pe,paintOrder:null,panose1:null,path:null,pathLength:Pe,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:yn,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Pe,pointsAtY:Pe,pointsAtZ:Pe,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:qi,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:qi,rev:qi,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:qi,requiredFeatures:qi,requiredFonts:qi,requiredFormats:qi,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Pe,specularExponent:Pe,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Pe,strikethroughThickness:Pe,string:null,stroke:null,strokeDashArray:qi,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Pe,strokeOpacity:Pe,strokeWidth:null,style:null,surfaceScale:Pe,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:qi,tabIndex:Pe,tableValues:null,target:null,targetX:Pe,targetY:Pe,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:qi,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Pe,underlineThickness:Pe,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Pe,values:null,vAlphabetic:Pe,vMathematical:Pe,vectorEffect:null,vHanging:Pe,vIdeographic:Pe,version:null,vertAdvY:Pe,vertOriginX:Pe,vertOriginY:Pe,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Pe,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null}}),gue=/^data[-\w.:]+$/i,sM=/-[a-z]/g,vue=/[A-Z]/g;function yue(t,e){const n=dk(e);let r=e,i=Vo;if(n in t.normal)return t.property[t.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&gue.test(e)){if(e.charAt(4)==="-"){const o=e.slice(5).replace(sM,wue);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=e.slice(4);if(!sM.test(o)){let s=o.replace(vue,bue);s.charAt(0)!=="-"&&(s="-"+s),e="data"+s}}i=V2}return new i(r,e)}function bue(t){return"-"+t.toLowerCase()}function wue(t){return t.charAt(1).toUpperCase()}const xue={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},Sue=vj([wj,bj,Cj,kj,pue],"html"),U2=vj([wj,bj,Cj,kj,mue],"svg");function Cue(t){return t.join(" ").trim()}var Ej={},aM=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,kue=/\n/g,Eue=/^\s*/,_ue=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,Tue=/^:\s*/,Aue=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,Oue=/^[;\s]*/,Rue=/^\s+|\s+$/g,Pue=`
197
+ `,lM="/",cM="*",Oc="",Nue="comment",Mue="declaration",Due=function(t,e){if(typeof t!="string")throw new TypeError("First argument must be a string");if(!t)return[];e=e||{};var n=1,r=1;function i(v){var b=v.match(kue);b&&(n+=b.length);var S=v.lastIndexOf(Pue);r=~S?v.length-S:r+v.length}function o(){var v={line:n,column:r};return function(b){return b.position=new s(v),c(),b}}function s(v){this.start=v,this.end={line:n,column:r},this.source=e.source}s.prototype.content=t;function a(v){var b=new Error(e.source+":"+n+":"+r+": "+v);if(b.reason=v,b.filename=e.source,b.line=n,b.column=r,b.source=t,!e.silent)throw b}function l(v){var b=v.exec(t);if(b){var S=b[0];return i(S),t=t.slice(S.length),b}}function c(){l(Eue)}function f(v){var b;for(v=v||[];b=d();)b!==!1&&v.push(b);return v}function d(){var v=o();if(!(lM!=t.charAt(0)||cM!=t.charAt(1))){for(var b=2;Oc!=t.charAt(b)&&(cM!=t.charAt(b)||lM!=t.charAt(b+1));)++b;if(b+=2,Oc===t.charAt(b-1))return a("End of comment missing");var S=t.slice(2,b-2);return r+=2,i(S),t=t.slice(b),r+=2,v({type:Nue,comment:S})}}function p(){var v=o(),b=l(_ue);if(b){if(d(),!l(Tue))return a("property missing ':'");var S=l(Aue),x=v({type:Mue,property:uM(b[0].replace(aM,Oc)),value:S?uM(S[0].replace(aM,Oc)):Oc});return l(Oue),x}}function m(){var v=[];f(v);for(var b;b=p();)b!==!1&&(v.push(b),f(v));return v}return c(),m()};function uM(t){return t?t.replace(Rue,Oc):Oc}var Lue=fn&&fn.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ej,"__esModule",{value:!0});var $ue=Lue(Due);function Iue(t,e){var n=null;if(!t||typeof t!="string")return n;var r=(0,$ue.default)(t),i=typeof e=="function";return r.forEach(function(o){if(o.type==="declaration"){var s=o.property,a=o.value;i?e(s,a,o):a&&(n=n||{},n[s]=a)}}),n}var fM=Ej.default=Iue;const jue=fM.default||fM,_j=Tj("end"),W2=Tj("start");function Tj(t){return e;function e(n){const r=n&&n.position&&n.position[t]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function Bue(t){const e=W2(t),n=_j(t);if(e&&n)return{start:e,end:n}}function fp(t){return!t||typeof t!="object"?"":"position"in t||"type"in t?dM(t.position):"start"in t||"end"in t?dM(t):"line"in t||"column"in t?pk(t):""}function pk(t){return hM(t&&t.line)+":"+hM(t&&t.column)}function dM(t){return pk(t&&t.start)+"-"+pk(t&&t.end)}function hM(t){return t&&typeof t=="number"?t:1}class Qr extends Error{constructor(e,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",o={},s=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof e=="string"?i=e:!o.cause&&e&&(s=!0,i=e.message,o.cause=e),!o.ruleId&&!o.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?o.ruleId=r:(o.source=r.slice(0,l),o.ruleId=r.slice(l+1))}if(!o.place&&o.ancestors&&o.ancestors){const l=o.ancestors[o.ancestors.length-1];l&&(o.place=l.position)}const a=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file,this.message=i,this.line=a?a.line:void 0,this.name=fp(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=s&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual,this.expected,this.note,this.url}}Qr.prototype.file="";Qr.prototype.name="";Qr.prototype.reason="";Qr.prototype.message="";Qr.prototype.stack="";Qr.prototype.column=void 0;Qr.prototype.line=void 0;Qr.prototype.ancestors=void 0;Qr.prototype.cause=void 0;Qr.prototype.fatal=void 0;Qr.prototype.place=void 0;Qr.prototype.ruleId=void 0;Qr.prototype.source=void 0;const H2={}.hasOwnProperty,Fue=new Map,zue=/[A-Z]/g,Vue=/-([a-z])/g,Uue=new Set(["table","tbody","thead","tfoot","tr"]),Wue=new Set(["td","th"]),Aj="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Hue(t,e){if(!e||e.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=e.filePath||void 0;let r;if(e.development){if(typeof e.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=Jue(n,e.jsxDEV)}else{if(typeof e.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof e.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=Que(n,e.jsx,e.jsxs)}const i={Fragment:e.Fragment,ancestors:[],components:e.components||{},create:r,elementAttributeNameCase:e.elementAttributeNameCase||"react",evaluater:e.createEvaluater?e.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:e.ignoreInvalidStyle||!1,passKeys:e.passKeys!==!1,passNode:e.passNode||!1,schema:e.space==="svg"?U2:Sue,stylePropertyNameCase:e.stylePropertyNameCase||"dom",tableCellAlignToStyle:e.tableCellAlignToStyle!==!1},o=Oj(i,t,void 0);return o&&typeof o!="string"?o:i.create(t,i.Fragment,{children:o||void 0},void 0)}function Oj(t,e,n){if(e.type==="element")return que(t,e,n);if(e.type==="mdxFlowExpression"||e.type==="mdxTextExpression")return Kue(t,e);if(e.type==="mdxJsxFlowElement"||e.type==="mdxJsxTextElement")return Yue(t,e,n);if(e.type==="mdxjsEsm")return Gue(t,e);if(e.type==="root")return Xue(t,e,n);if(e.type==="text")return Zue(t,e)}function que(t,e,n){const r=t.schema;let i=r;e.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=U2,t.schema=i),t.ancestors.push(e);const o=Pj(t,e.tagName,!1),s=efe(t,e);let a=K2(t,e);return Uue.has(e.tagName)&&(a=a.filter(function(l){return typeof l=="string"?!fue(l):!0})),Rj(t,s,o,e),q2(s,a),t.ancestors.pop(),t.schema=r,t.create(e,o,s,n)}function Kue(t,e){if(e.data&&e.data.estree&&t.evaluater){const r=e.data.estree.body[0];return r.type,t.evaluater.evaluateExpression(r.expression)}om(t,e.position)}function Gue(t,e){if(e.data&&e.data.estree&&t.evaluater)return t.evaluater.evaluateProgram(e.data.estree);om(t,e.position)}function Yue(t,e,n){const r=t.schema;let i=r;e.name==="svg"&&r.space==="html"&&(i=U2,t.schema=i),t.ancestors.push(e);const o=e.name===null?t.Fragment:Pj(t,e.name,!0),s=tfe(t,e),a=K2(t,e);return Rj(t,s,o,e),q2(s,a),t.ancestors.pop(),t.schema=r,t.create(e,o,s,n)}function Xue(t,e,n){const r={};return q2(r,K2(t,e)),t.create(e,t.Fragment,r,n)}function Zue(t,e){return e.value}function Rj(t,e,n,r){typeof n!="string"&&n!==t.Fragment&&t.passNode&&(e.node=r)}function q2(t,e){if(e.length>0){const n=e.length>1?e:e[0];n&&(t.children=n)}}function Que(t,e,n){return r;function r(i,o,s,a){const c=Array.isArray(s.children)?n:e;return a?c(o,s,a):c(o,s)}}function Jue(t,e){return n;function n(r,i,o,s){const a=Array.isArray(o.children),l=W2(r);return e(i,o,s,a,{columnNumber:l?l.column-1:void 0,fileName:t,lineNumber:l?l.line:void 0},void 0)}}function efe(t,e){const n={};let r,i;for(i in e.properties)if(i!=="children"&&H2.call(e.properties,i)){const o=nfe(t,i,e.properties[i]);if(o){const[s,a]=o;t.tableCellAlignToStyle&&s==="align"&&typeof a=="string"&&Wue.has(e.tagName)?r=a:n[s]=a}}if(r){const o=n.style||(n.style={});o[t.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function tfe(t,e){const n={};for(const r of e.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&t.evaluater){const o=r.data.estree.body[0];o.type;const s=o.expression;s.type;const a=s.properties[0];a.type,Object.assign(n,t.evaluater.evaluateExpression(a.argument))}else om(t,e.position);else{const i=r.name;let o;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&t.evaluater){const a=r.value.data.estree.body[0];a.type,o=t.evaluater.evaluateExpression(a.expression)}else om(t,e.position);else o=r.value===null?!0:r.value;n[i]=o}return n}function K2(t,e){const n=[];let r=-1;const i=t.passKeys?new Map:Fue;for(;++r<e.children.length;){const o=e.children[r];let s;if(t.passKeys){const l=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(l){const c=i.get(l)||0;s=l+"-"+c,i.set(l,c+1)}}const a=Oj(t,o,s);a!==void 0&&n.push(a)}return n}function nfe(t,e,n){const r=yue(t.schema,e);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?sue(n):Cue(n)),r.property==="style"){let i=typeof n=="object"?n:rfe(t,String(n));return t.stylePropertyNameCase==="css"&&(i=ife(i)),["style",i]}return[t.elementAttributeNameCase==="react"&&r.space?xue[r.property]||r.property:r.attribute,n]}}function rfe(t,e){const n={};try{jue(e,r)}catch(i){if(!t.ignoreInvalidStyle){const o=i,s=new Qr("Cannot parse `style` attribute",{ancestors:t.ancestors,cause:o,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw s.file=t.filePath||void 0,s.url=Aj+"#cannot-parse-style-attribute",s}}return n;function r(i,o){let s=i;s.slice(0,2)!=="--"&&(s.slice(0,4)==="-ms-"&&(s="ms-"+s.slice(4)),s=s.replace(Vue,sfe)),n[s]=o}}function Pj(t,e,n){let r;if(!n)r={type:"Literal",value:e};else if(e.includes(".")){const i=e.split(".");let o=-1,s;for(;++o<i.length;){const a=rM(i[o])?{type:"Identifier",name:i[o]}:{type:"Literal",value:i[o]};s=s?{type:"MemberExpression",object:s,property:a,computed:!!(o&&a.type==="Literal"),optional:!1}:a}r=s}else r=rM(e)&&!/^[a-z]/.test(e)?{type:"Identifier",name:e}:{type:"Literal",value:e};if(r.type==="Literal"){const i=r.value;return H2.call(t.components,i)?t.components[i]:i}if(t.evaluater)return t.evaluater.evaluateExpression(r);om(t)}function om(t,e){const n=new Qr("Cannot handle MDX estrees without `createEvaluater`",{ancestors:t.ancestors,place:e,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=t.filePath||void 0,n.url=Aj+"#cannot-handle-mdx-estrees-without-createevaluater",n}function ife(t){const e={};let n;for(n in t)H2.call(t,n)&&(e[ofe(n)]=t[n]);return e}function ofe(t){let e=t.replace(zue,afe);return e.slice(0,3)==="ms-"&&(e="-"+e),e}function sfe(t,e){return e.toUpperCase()}function afe(t){return"-"+t.toLowerCase()}const Xx={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},lfe={};function cfe(t,e){const n=e||lfe,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return Nj(t,r,i)}function Nj(t,e,n){if(ufe(t)){if("value"in t)return t.type==="html"&&!n?"":t.value;if(e&&"alt"in t&&t.alt)return t.alt;if("children"in t)return pM(t.children,e,n)}return Array.isArray(t)?pM(t,e,n):""}function pM(t,e,n){const r=[];let i=-1;for(;++i<t.length;)r[i]=Nj(t[i],e,n);return r.join("")}function ufe(t){return!!(t&&typeof t=="object")}const mM=document.createElement("i");function G2(t){const e="&"+t+";";mM.innerHTML=e;const n=mM.textContent;return n.charCodeAt(n.length-1)===59&&t!=="semi"||n===e?!1:n}function ea(t,e,n,r){const i=t.length;let o=0,s;if(e<0?e=-e>i?0:i+e:e=e>i?i:e,n=n>0?n:0,r.length<1e4)s=Array.from(r),s.unshift(e,n),t.splice(...s);else for(n&&t.splice(e,n);o<r.length;)s=r.slice(o,o+1e4),s.unshift(e,0),t.splice(...s),o+=1e4,e+=1e4}function To(t,e){return t.length>0?(ea(t,t.length,0,e),t):e}const gM={}.hasOwnProperty;function ffe(t){const e={};let n=-1;for(;++n<t.length;)dfe(e,t[n]);return e}function dfe(t,e){let n;for(n in e){const i=(gM.call(t,n)?t[n]:void 0)||(t[n]={}),o=e[n];let s;if(o)for(s in o){gM.call(i,s)||(i[s]=[]);const a=o[s];hfe(i[s],Array.isArray(a)?a:a?[a]:[])}}}function hfe(t,e){let n=-1;const r=[];for(;++n<e.length;)(e[n].add==="after"?t:r).push(e[n]);ea(t,0,0,r)}function Mj(t,e){const n=Number.parseInt(t,e);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function Vf(t){return t.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const pfe=lc(new RegExp("\\p{P}","u")),Bs=lc(/[A-Za-z]/),eo=lc(/[\dA-Za-z]/),mfe=lc(/[#-'*+\--9=?A-Z^-~]/);function mk(t){return t!==null&&(t<32||t===127)}const gk=lc(/\d/),gfe=lc(/[\dA-Fa-f]/),Dj=lc(/[!-/:-@[-`{-~]/);function bt(t){return t!==null&&t<-2}function Ri(t){return t!==null&&(t<0||t===32)}function en(t){return t===-2||t===-1||t===32}function vfe(t){return Dj(t)||pfe(t)}const yfe=lc(/\s/);function lc(t){return e;function e(n){return n!==null&&n>-1&&t.test(String.fromCharCode(n))}}function jd(t){const e=[];let n=-1,r=0,i=0;for(;++n<t.length;){const o=t.charCodeAt(n);let s="";if(o===37&&eo(t.charCodeAt(n+1))&&eo(t.charCodeAt(n+2)))i=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(s=String.fromCharCode(o));else if(o>55295&&o<57344){const a=t.charCodeAt(n+1);o<56320&&a>56319&&a<57344?(s=String.fromCharCode(o,a),i=1):s="�"}else s=String.fromCharCode(o);s&&(e.push(t.slice(r,n),encodeURIComponent(s)),r=n+i+1,s=""),i&&(n+=i,i=0)}return e.join("")+t.slice(r)}function xn(t,e,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return s;function s(l){return en(l)?(t.enter(n),a(l)):e(l)}function a(l){return en(l)&&o++<i?(t.consume(l),a):(t.exit(n),e(l))}}const bfe={tokenize:wfe};function wfe(t){const e=t.attempt(this.parser.constructs.contentInitial,r,i);let n;return e;function r(a){if(a===null){t.consume(a);return}return t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),xn(t,e,"linePrefix")}function i(a){return t.enter("paragraph"),o(a)}function o(a){const l=t.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=l),n=l,s(a)}function s(a){if(a===null){t.exit("chunkText"),t.exit("paragraph"),t.consume(a);return}return bt(a)?(t.consume(a),t.exit("chunkText"),o):(t.consume(a),s)}}const xfe={tokenize:Sfe},vM={tokenize:Cfe};function Sfe(t){const e=this,n=[];let r=0,i,o,s;return a;function a(C){if(r<n.length){const T=n[r];return e.containerState=T[1],t.attempt(T[0].continuation,l,c)(C)}return c(C)}function l(C){if(r++,e.containerState._closeFlow){e.containerState._closeFlow=void 0,i&&w();const T=e.events.length;let A=T,_;for(;A--;)if(e.events[A][0]==="exit"&&e.events[A][1].type==="chunkFlow"){_=e.events[A][1].end;break}x(r);let R=T;for(;R<e.events.length;)e.events[R][1].end=Object.assign({},_),R++;return ea(e.events,A+1,0,e.events.slice(T)),e.events.length=R,c(C)}return a(C)}function c(C){if(r===n.length){if(!i)return p(C);if(i.currentConstruct&&i.currentConstruct.concrete)return v(C);e.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return e.containerState={},t.check(vM,f,d)(C)}function f(C){return i&&w(),x(r),p(C)}function d(C){return e.parser.lazy[e.now().line]=r!==n.length,s=e.now().offset,v(C)}function p(C){return e.containerState={},t.attempt(vM,m,v)(C)}function m(C){return r++,n.push([e.currentConstruct,e.containerState]),p(C)}function v(C){if(C===null){i&&w(),x(0),t.consume(C);return}return i=i||e.parser.flow(e.now()),t.enter("chunkFlow",{contentType:"flow",previous:o,_tokenizer:i}),b(C)}function b(C){if(C===null){S(t.exit("chunkFlow"),!0),x(0),t.consume(C);return}return bt(C)?(t.consume(C),S(t.exit("chunkFlow")),r=0,e.interrupt=void 0,a):(t.consume(C),b)}function S(C,T){const A=e.sliceStream(C);if(T&&A.push(null),C.previous=o,o&&(o.next=C),o=C,i.defineSkip(C.start),i.write(A),e.parser.lazy[C.start.line]){let _=i.events.length;for(;_--;)if(i.events[_][1].start.offset<s&&(!i.events[_][1].end||i.events[_][1].end.offset>s))return;const R=e.events.length;let M=R,I,V;for(;M--;)if(e.events[M][0]==="exit"&&e.events[M][1].type==="chunkFlow"){if(I){V=e.events[M][1].end;break}I=!0}for(x(r),_=R;_<e.events.length;)e.events[_][1].end=Object.assign({},V),_++;ea(e.events,M+1,0,e.events.slice(R)),e.events.length=_}}function x(C){let T=n.length;for(;T-- >C;){const A=n[T];e.containerState=A[1],A[0].exit.call(e,t)}n.length=C}function w(){i.write([null]),o=void 0,i=void 0,e.containerState._closeFlow=void 0}}function Cfe(t,e,n){return xn(t,t.attempt(this.parser.constructs.document,e,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function yM(t){if(t===null||Ri(t)||yfe(t))return 1;if(vfe(t))return 2}function Y2(t,e,n){const r=[];let i=-1;for(;++i<t.length;){const o=t[i].resolveAll;o&&!r.includes(o)&&(e=o(e,n),r.push(o))}return e}const vk={name:"attention",tokenize:Efe,resolveAll:kfe};function kfe(t,e){let n=-1,r,i,o,s,a,l,c,f;for(;++n<t.length;)if(t[n][0]==="enter"&&t[n][1].type==="attentionSequence"&&t[n][1]._close){for(r=n;r--;)if(t[r][0]==="exit"&&t[r][1].type==="attentionSequence"&&t[r][1]._open&&e.sliceSerialize(t[r][1]).charCodeAt(0)===e.sliceSerialize(t[n][1]).charCodeAt(0)){if((t[r][1]._close||t[n][1]._open)&&(t[n][1].end.offset-t[n][1].start.offset)%3&&!((t[r][1].end.offset-t[r][1].start.offset+t[n][1].end.offset-t[n][1].start.offset)%3))continue;l=t[r][1].end.offset-t[r][1].start.offset>1&&t[n][1].end.offset-t[n][1].start.offset>1?2:1;const d=Object.assign({},t[r][1].end),p=Object.assign({},t[n][1].start);bM(d,-l),bM(p,l),s={type:l>1?"strongSequence":"emphasisSequence",start:d,end:Object.assign({},t[r][1].end)},a={type:l>1?"strongSequence":"emphasisSequence",start:Object.assign({},t[n][1].start),end:p},o={type:l>1?"strongText":"emphasisText",start:Object.assign({},t[r][1].end),end:Object.assign({},t[n][1].start)},i={type:l>1?"strong":"emphasis",start:Object.assign({},s.start),end:Object.assign({},a.end)},t[r][1].end=Object.assign({},s.start),t[n][1].start=Object.assign({},a.end),c=[],t[r][1].end.offset-t[r][1].start.offset&&(c=To(c,[["enter",t[r][1],e],["exit",t[r][1],e]])),c=To(c,[["enter",i,e],["enter",s,e],["exit",s,e],["enter",o,e]]),c=To(c,Y2(e.parser.constructs.insideSpan.null,t.slice(r+1,n),e)),c=To(c,[["exit",o,e],["enter",a,e],["exit",a,e],["exit",i,e]]),t[n][1].end.offset-t[n][1].start.offset?(f=2,c=To(c,[["enter",t[n][1],e],["exit",t[n][1],e]])):f=0,ea(t,r-1,n-r+3,c),n=r+c.length-f-2;break}}for(n=-1;++n<t.length;)t[n][1].type==="attentionSequence"&&(t[n][1].type="data");return t}function Efe(t,e){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=yM(r);let o;return s;function s(l){return o=l,t.enter("attentionSequence"),a(l)}function a(l){if(l===o)return t.consume(l),a;const c=t.exit("attentionSequence"),f=yM(l),d=!f||f===2&&i||n.includes(l),p=!i||i===2&&f||n.includes(r);return c._open=!!(o===42?d:d&&(i||!p)),c._close=!!(o===42?p:p&&(f||!d)),e(l)}}function bM(t,e){t.column+=e,t.offset+=e,t._bufferIndex+=e}const _fe={name:"autolink",tokenize:Tfe};function Tfe(t,e,n){let r=0;return i;function i(m){return t.enter("autolink"),t.enter("autolinkMarker"),t.consume(m),t.exit("autolinkMarker"),t.enter("autolinkProtocol"),o}function o(m){return Bs(m)?(t.consume(m),s):c(m)}function s(m){return m===43||m===45||m===46||eo(m)?(r=1,a(m)):c(m)}function a(m){return m===58?(t.consume(m),r=0,l):(m===43||m===45||m===46||eo(m))&&r++<32?(t.consume(m),a):(r=0,c(m))}function l(m){return m===62?(t.exit("autolinkProtocol"),t.enter("autolinkMarker"),t.consume(m),t.exit("autolinkMarker"),t.exit("autolink"),e):m===null||m===32||m===60||mk(m)?n(m):(t.consume(m),l)}function c(m){return m===64?(t.consume(m),f):mfe(m)?(t.consume(m),c):n(m)}function f(m){return eo(m)?d(m):n(m)}function d(m){return m===46?(t.consume(m),r=0,f):m===62?(t.exit("autolinkProtocol").type="autolinkEmail",t.enter("autolinkMarker"),t.consume(m),t.exit("autolinkMarker"),t.exit("autolink"),e):p(m)}function p(m){if((m===45||eo(m))&&r++<63){const v=m===45?p:d;return t.consume(m),v}return n(m)}}const f1={tokenize:Afe,partial:!0};function Afe(t,e,n){return r;function r(o){return en(o)?xn(t,i,"linePrefix")(o):i(o)}function i(o){return o===null||bt(o)?e(o):n(o)}}const Lj={name:"blockQuote",tokenize:Ofe,continuation:{tokenize:Rfe},exit:Pfe};function Ofe(t,e,n){const r=this;return i;function i(s){if(s===62){const a=r.containerState;return a.open||(t.enter("blockQuote",{_container:!0}),a.open=!0),t.enter("blockQuotePrefix"),t.enter("blockQuoteMarker"),t.consume(s),t.exit("blockQuoteMarker"),o}return n(s)}function o(s){return en(s)?(t.enter("blockQuotePrefixWhitespace"),t.consume(s),t.exit("blockQuotePrefixWhitespace"),t.exit("blockQuotePrefix"),e):(t.exit("blockQuotePrefix"),e(s))}}function Rfe(t,e,n){const r=this;return i;function i(s){return en(s)?xn(t,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):o(s)}function o(s){return t.attempt(Lj,e,n)(s)}}function Pfe(t){t.exit("blockQuote")}const $j={name:"characterEscape",tokenize:Nfe};function Nfe(t,e,n){return r;function r(o){return t.enter("characterEscape"),t.enter("escapeMarker"),t.consume(o),t.exit("escapeMarker"),i}function i(o){return Dj(o)?(t.enter("characterEscapeValue"),t.consume(o),t.exit("characterEscapeValue"),t.exit("characterEscape"),e):n(o)}}const Ij={name:"characterReference",tokenize:Mfe};function Mfe(t,e,n){const r=this;let i=0,o,s;return a;function a(d){return t.enter("characterReference"),t.enter("characterReferenceMarker"),t.consume(d),t.exit("characterReferenceMarker"),l}function l(d){return d===35?(t.enter("characterReferenceMarkerNumeric"),t.consume(d),t.exit("characterReferenceMarkerNumeric"),c):(t.enter("characterReferenceValue"),o=31,s=eo,f(d))}function c(d){return d===88||d===120?(t.enter("characterReferenceMarkerHexadecimal"),t.consume(d),t.exit("characterReferenceMarkerHexadecimal"),t.enter("characterReferenceValue"),o=6,s=gfe,f):(t.enter("characterReferenceValue"),o=7,s=gk,f(d))}function f(d){if(d===59&&i){const p=t.exit("characterReferenceValue");return s===eo&&!G2(r.sliceSerialize(p))?n(d):(t.enter("characterReferenceMarker"),t.consume(d),t.exit("characterReferenceMarker"),t.exit("characterReference"),e)}return s(d)&&i++<o?(t.consume(d),f):n(d)}}const wM={tokenize:Lfe,partial:!0},xM={name:"codeFenced",tokenize:Dfe,concrete:!0};function Dfe(t,e,n){const r=this,i={tokenize:A,partial:!0};let o=0,s=0,a;return l;function l(_){return c(_)}function c(_){const R=r.events[r.events.length-1];return o=R&&R[1].type==="linePrefix"?R[2].sliceSerialize(R[1],!0).length:0,a=_,t.enter("codeFenced"),t.enter("codeFencedFence"),t.enter("codeFencedFenceSequence"),f(_)}function f(_){return _===a?(s++,t.consume(_),f):s<3?n(_):(t.exit("codeFencedFenceSequence"),en(_)?xn(t,d,"whitespace")(_):d(_))}function d(_){return _===null||bt(_)?(t.exit("codeFencedFence"),r.interrupt?e(_):t.check(wM,b,T)(_)):(t.enter("codeFencedFenceInfo"),t.enter("chunkString",{contentType:"string"}),p(_))}function p(_){return _===null||bt(_)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),d(_)):en(_)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),xn(t,m,"whitespace")(_)):_===96&&_===a?n(_):(t.consume(_),p)}function m(_){return _===null||bt(_)?d(_):(t.enter("codeFencedFenceMeta"),t.enter("chunkString",{contentType:"string"}),v(_))}function v(_){return _===null||bt(_)?(t.exit("chunkString"),t.exit("codeFencedFenceMeta"),d(_)):_===96&&_===a?n(_):(t.consume(_),v)}function b(_){return t.attempt(i,T,S)(_)}function S(_){return t.enter("lineEnding"),t.consume(_),t.exit("lineEnding"),x}function x(_){return o>0&&en(_)?xn(t,w,"linePrefix",o+1)(_):w(_)}function w(_){return _===null||bt(_)?t.check(wM,b,T)(_):(t.enter("codeFlowValue"),C(_))}function C(_){return _===null||bt(_)?(t.exit("codeFlowValue"),w(_)):(t.consume(_),C)}function T(_){return t.exit("codeFenced"),e(_)}function A(_,R,M){let I=0;return V;function V(F){return _.enter("lineEnding"),_.consume(F),_.exit("lineEnding"),U}function U(F){return _.enter("codeFencedFence"),en(F)?xn(_,L,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(F):L(F)}function L(F){return F===a?(_.enter("codeFencedFenceSequence"),G(F)):M(F)}function G(F){return F===a?(I++,_.consume(F),G):I>=s?(_.exit("codeFencedFenceSequence"),en(F)?xn(_,K,"whitespace")(F):K(F)):M(F)}function K(F){return F===null||bt(F)?(_.exit("codeFencedFence"),R(F)):M(F)}}}function Lfe(t,e,n){const r=this;return i;function i(s){return s===null?n(s):(t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),o)}function o(s){return r.parser.lazy[r.now().line]?n(s):e(s)}}const Zx={name:"codeIndented",tokenize:Ife},$fe={tokenize:jfe,partial:!0};function Ife(t,e,n){const r=this;return i;function i(c){return t.enter("codeIndented"),xn(t,o,"linePrefix",5)(c)}function o(c){const f=r.events[r.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?s(c):n(c)}function s(c){return c===null?l(c):bt(c)?t.attempt($fe,s,l)(c):(t.enter("codeFlowValue"),a(c))}function a(c){return c===null||bt(c)?(t.exit("codeFlowValue"),s(c)):(t.consume(c),a)}function l(c){return t.exit("codeIndented"),e(c)}}function jfe(t,e,n){const r=this;return i;function i(s){return r.parser.lazy[r.now().line]?n(s):bt(s)?(t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),i):xn(t,o,"linePrefix",5)(s)}function o(s){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?e(s):bt(s)?i(s):n(s)}}const Bfe={name:"codeText",tokenize:Vfe,resolve:Ffe,previous:zfe};function Ffe(t){let e=t.length-4,n=3,r,i;if((t[n][1].type==="lineEnding"||t[n][1].type==="space")&&(t[e][1].type==="lineEnding"||t[e][1].type==="space")){for(r=n;++r<e;)if(t[r][1].type==="codeTextData"){t[n][1].type="codeTextPadding",t[e][1].type="codeTextPadding",n+=2,e-=2;break}}for(r=n-1,e++;++r<=e;)i===void 0?r!==e&&t[r][1].type!=="lineEnding"&&(i=r):(r===e||t[r][1].type==="lineEnding")&&(t[i][1].type="codeTextData",r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),e-=r-i-2,r=i+2),i=void 0);return t}function zfe(t){return t!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Vfe(t,e,n){let r=0,i,o;return s;function s(d){return t.enter("codeText"),t.enter("codeTextSequence"),a(d)}function a(d){return d===96?(t.consume(d),r++,a):(t.exit("codeTextSequence"),l(d))}function l(d){return d===null?n(d):d===32?(t.enter("space"),t.consume(d),t.exit("space"),l):d===96?(o=t.enter("codeTextSequence"),i=0,f(d)):bt(d)?(t.enter("lineEnding"),t.consume(d),t.exit("lineEnding"),l):(t.enter("codeTextData"),c(d))}function c(d){return d===null||d===32||d===96||bt(d)?(t.exit("codeTextData"),l(d)):(t.consume(d),c)}function f(d){return d===96?(t.consume(d),i++,f):i===r?(t.exit("codeTextSequence"),t.exit("codeText"),e(d)):(o.type="codeTextData",c(d))}}function jj(t){const e={};let n=-1,r,i,o,s,a,l,c;for(;++n<t.length;){for(;n in e;)n=e[n];if(r=t[n],n&&r[1].type==="chunkFlow"&&t[n-1][1].type==="listItemPrefix"&&(l=r[1]._tokenizer.events,o=0,o<l.length&&l[o][1].type==="lineEndingBlank"&&(o+=2),o<l.length&&l[o][1].type==="content"))for(;++o<l.length&&l[o][1].type!=="content";)l[o][1].type==="chunkText"&&(l[o][1]._isInFirstContentOfListItem=!0,o++);if(r[0]==="enter")r[1].contentType&&(Object.assign(e,Ufe(t,n)),n=e[n],c=!0);else if(r[1]._container){for(o=n,i=void 0;o--&&(s=t[o],s[1].type==="lineEnding"||s[1].type==="lineEndingBlank");)s[0]==="enter"&&(i&&(t[i][1].type="lineEndingBlank"),s[1].type="lineEnding",i=o);i&&(r[1].end=Object.assign({},t[i][1].start),a=t.slice(i,n),a.unshift(r),ea(t,i,n-i+1,a))}}return!c}function Ufe(t,e){const n=t[e][1],r=t[e][2];let i=e-1;const o=[],s=n._tokenizer||r.parser[n.contentType](n.start),a=s.events,l=[],c={};let f,d,p=-1,m=n,v=0,b=0;const S=[b];for(;m;){for(;t[++i][1]!==m;);o.push(i),m._tokenizer||(f=r.sliceStream(m),m.next||f.push(null),d&&s.defineSkip(m.start),m._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(f),m._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),d=m,m=m.next}for(m=n;++p<a.length;)a[p][0]==="exit"&&a[p-1][0]==="enter"&&a[p][1].type===a[p-1][1].type&&a[p][1].start.line!==a[p][1].end.line&&(b=p+1,S.push(b),m._tokenizer=void 0,m.previous=void 0,m=m.next);for(s.events=[],m?(m._tokenizer=void 0,m.previous=void 0):S.pop(),p=S.length;p--;){const x=a.slice(S[p],S[p+1]),w=o.pop();l.unshift([w,w+x.length-1]),ea(t,w,2,x)}for(p=-1;++p<l.length;)c[v+l[p][0]]=v+l[p][1],v+=l[p][1]-l[p][0]-1;return c}const Wfe={tokenize:Kfe,resolve:qfe},Hfe={tokenize:Gfe,partial:!0};function qfe(t){return jj(t),t}function Kfe(t,e){let n;return r;function r(a){return t.enter("content"),n=t.enter("chunkContent",{contentType:"content"}),i(a)}function i(a){return a===null?o(a):bt(a)?t.check(Hfe,s,o)(a):(t.consume(a),i)}function o(a){return t.exit("chunkContent"),t.exit("content"),e(a)}function s(a){return t.consume(a),t.exit("chunkContent"),n.next=t.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function Gfe(t,e,n){const r=this;return i;function i(s){return t.exit("chunkContent"),t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),xn(t,o,"linePrefix")}function o(s){if(s===null||bt(s))return n(s);const a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?e(s):t.interrupt(r.parser.constructs.flow,n,e)(s)}}function Bj(t,e,n,r,i,o,s,a,l){const c=l||Number.POSITIVE_INFINITY;let f=0;return d;function d(x){return x===60?(t.enter(r),t.enter(i),t.enter(o),t.consume(x),t.exit(o),p):x===null||x===32||x===41||mk(x)?n(x):(t.enter(r),t.enter(s),t.enter(a),t.enter("chunkString",{contentType:"string"}),b(x))}function p(x){return x===62?(t.enter(o),t.consume(x),t.exit(o),t.exit(i),t.exit(r),e):(t.enter(a),t.enter("chunkString",{contentType:"string"}),m(x))}function m(x){return x===62?(t.exit("chunkString"),t.exit(a),p(x)):x===null||x===60||bt(x)?n(x):(t.consume(x),x===92?v:m)}function v(x){return x===60||x===62||x===92?(t.consume(x),m):m(x)}function b(x){return!f&&(x===null||x===41||Ri(x))?(t.exit("chunkString"),t.exit(a),t.exit(s),t.exit(r),e(x)):f<c&&x===40?(t.consume(x),f++,b):x===41?(t.consume(x),f--,b):x===null||x===32||x===40||mk(x)?n(x):(t.consume(x),x===92?S:b)}function S(x){return x===40||x===41||x===92?(t.consume(x),b):b(x)}}function Fj(t,e,n,r,i,o){const s=this;let a=0,l;return c;function c(m){return t.enter(r),t.enter(i),t.consume(m),t.exit(i),t.enter(o),f}function f(m){return a>999||m===null||m===91||m===93&&!l||m===94&&!a&&"_hiddenFootnoteSupport"in s.parser.constructs?n(m):m===93?(t.exit(o),t.enter(i),t.consume(m),t.exit(i),t.exit(r),e):bt(m)?(t.enter("lineEnding"),t.consume(m),t.exit("lineEnding"),f):(t.enter("chunkString",{contentType:"string"}),d(m))}function d(m){return m===null||m===91||m===93||bt(m)||a++>999?(t.exit("chunkString"),f(m)):(t.consume(m),l||(l=!en(m)),m===92?p:d)}function p(m){return m===91||m===92||m===93?(t.consume(m),a++,d):d(m)}}function zj(t,e,n,r,i,o){let s;return a;function a(p){return p===34||p===39||p===40?(t.enter(r),t.enter(i),t.consume(p),t.exit(i),s=p===40?41:p,l):n(p)}function l(p){return p===s?(t.enter(i),t.consume(p),t.exit(i),t.exit(r),e):(t.enter(o),c(p))}function c(p){return p===s?(t.exit(o),l(s)):p===null?n(p):bt(p)?(t.enter("lineEnding"),t.consume(p),t.exit("lineEnding"),xn(t,c,"linePrefix")):(t.enter("chunkString",{contentType:"string"}),f(p))}function f(p){return p===s||p===null||bt(p)?(t.exit("chunkString"),c(p)):(t.consume(p),p===92?d:f)}function d(p){return p===s||p===92?(t.consume(p),f):f(p)}}function dp(t,e){let n;return r;function r(i){return bt(i)?(t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),n=!0,r):en(i)?xn(t,r,n?"linePrefix":"lineSuffix")(i):e(i)}}const Yfe={name:"definition",tokenize:Zfe},Xfe={tokenize:Qfe,partial:!0};function Zfe(t,e,n){const r=this;let i;return o;function o(m){return t.enter("definition"),s(m)}function s(m){return Fj.call(r,t,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(m)}function a(m){return i=Vf(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),m===58?(t.enter("definitionMarker"),t.consume(m),t.exit("definitionMarker"),l):n(m)}function l(m){return Ri(m)?dp(t,c)(m):c(m)}function c(m){return Bj(t,f,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(m)}function f(m){return t.attempt(Xfe,d,d)(m)}function d(m){return en(m)?xn(t,p,"whitespace")(m):p(m)}function p(m){return m===null||bt(m)?(t.exit("definition"),r.parser.defined.push(i),e(m)):n(m)}}function Qfe(t,e,n){return r;function r(a){return Ri(a)?dp(t,i)(a):n(a)}function i(a){return zj(t,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function o(a){return en(a)?xn(t,s,"whitespace")(a):s(a)}function s(a){return a===null||bt(a)?e(a):n(a)}}const Jfe={name:"hardBreakEscape",tokenize:ede};function ede(t,e,n){return r;function r(o){return t.enter("hardBreakEscape"),t.consume(o),i}function i(o){return bt(o)?(t.exit("hardBreakEscape"),e(o)):n(o)}}const tde={name:"headingAtx",tokenize:rde,resolve:nde};function nde(t,e){let n=t.length-2,r=3,i,o;return t[r][1].type==="whitespace"&&(r+=2),n-2>r&&t[n][1].type==="whitespace"&&(n-=2),t[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&t[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:t[r][1].start,end:t[n][1].end},o={type:"chunkText",start:t[r][1].start,end:t[n][1].end,contentType:"text"},ea(t,r,n-r+1,[["enter",i,e],["enter",o,e],["exit",o,e],["exit",i,e]])),t}function rde(t,e,n){let r=0;return i;function i(f){return t.enter("atxHeading"),o(f)}function o(f){return t.enter("atxHeadingSequence"),s(f)}function s(f){return f===35&&r++<6?(t.consume(f),s):f===null||Ri(f)?(t.exit("atxHeadingSequence"),a(f)):n(f)}function a(f){return f===35?(t.enter("atxHeadingSequence"),l(f)):f===null||bt(f)?(t.exit("atxHeading"),e(f)):en(f)?xn(t,a,"whitespace")(f):(t.enter("atxHeadingText"),c(f))}function l(f){return f===35?(t.consume(f),l):(t.exit("atxHeadingSequence"),a(f))}function c(f){return f===null||f===35||Ri(f)?(t.exit("atxHeadingText"),a(f)):(t.consume(f),c)}}const ide=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],SM=["pre","script","style","textarea"],ode={name:"htmlFlow",tokenize:cde,resolveTo:lde,concrete:!0},sde={tokenize:fde,partial:!0},ade={tokenize:ude,partial:!0};function lde(t){let e=t.length;for(;e--&&!(t[e][0]==="enter"&&t[e][1].type==="htmlFlow"););return e>1&&t[e-2][1].type==="linePrefix"&&(t[e][1].start=t[e-2][1].start,t[e+1][1].start=t[e-2][1].start,t.splice(e-2,2)),t}function cde(t,e,n){const r=this;let i,o,s,a,l;return c;function c($){return f($)}function f($){return t.enter("htmlFlow"),t.enter("htmlFlowData"),t.consume($),d}function d($){return $===33?(t.consume($),p):$===47?(t.consume($),o=!0,b):$===63?(t.consume($),i=3,r.interrupt?e:P):Bs($)?(t.consume($),s=String.fromCharCode($),S):n($)}function p($){return $===45?(t.consume($),i=2,m):$===91?(t.consume($),i=5,a=0,v):Bs($)?(t.consume($),i=4,r.interrupt?e:P):n($)}function m($){return $===45?(t.consume($),r.interrupt?e:P):n($)}function v($){const Ne="CDATA[";return $===Ne.charCodeAt(a++)?(t.consume($),a===Ne.length?r.interrupt?e:L:v):n($)}function b($){return Bs($)?(t.consume($),s=String.fromCharCode($),S):n($)}function S($){if($===null||$===47||$===62||Ri($)){const Ne=$===47,He=s.toLowerCase();return!Ne&&!o&&SM.includes(He)?(i=1,r.interrupt?e($):L($)):ide.includes(s.toLowerCase())?(i=6,Ne?(t.consume($),x):r.interrupt?e($):L($)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n($):o?w($):C($))}return $===45||eo($)?(t.consume($),s+=String.fromCharCode($),S):n($)}function x($){return $===62?(t.consume($),r.interrupt?e:L):n($)}function w($){return en($)?(t.consume($),w):V($)}function C($){return $===47?(t.consume($),V):$===58||$===95||Bs($)?(t.consume($),T):en($)?(t.consume($),C):V($)}function T($){return $===45||$===46||$===58||$===95||eo($)?(t.consume($),T):A($)}function A($){return $===61?(t.consume($),_):en($)?(t.consume($),A):C($)}function _($){return $===null||$===60||$===61||$===62||$===96?n($):$===34||$===39?(t.consume($),l=$,R):en($)?(t.consume($),_):M($)}function R($){return $===l?(t.consume($),l=null,I):$===null||bt($)?n($):(t.consume($),R)}function M($){return $===null||$===34||$===39||$===47||$===60||$===61||$===62||$===96||Ri($)?A($):(t.consume($),M)}function I($){return $===47||$===62||en($)?C($):n($)}function V($){return $===62?(t.consume($),U):n($)}function U($){return $===null||bt($)?L($):en($)?(t.consume($),U):n($)}function L($){return $===45&&i===2?(t.consume($),ie):$===60&&i===1?(t.consume($),ae):$===62&&i===4?(t.consume($),he):$===63&&i===3?(t.consume($),P):$===93&&i===5?(t.consume($),W):bt($)&&(i===6||i===7)?(t.exit("htmlFlowData"),t.check(sde,fe,G)($)):$===null||bt($)?(t.exit("htmlFlowData"),G($)):(t.consume($),L)}function G($){return t.check(ade,K,fe)($)}function K($){return t.enter("lineEnding"),t.consume($),t.exit("lineEnding"),F}function F($){return $===null||bt($)?G($):(t.enter("htmlFlowData"),L($))}function ie($){return $===45?(t.consume($),P):L($)}function ae($){return $===47?(t.consume($),s="",re):L($)}function re($){if($===62){const Ne=s.toLowerCase();return SM.includes(Ne)?(t.consume($),he):L($)}return Bs($)&&s.length<8?(t.consume($),s+=String.fromCharCode($),re):L($)}function W($){return $===93?(t.consume($),P):L($)}function P($){return $===62?(t.consume($),he):$===45&&i===2?(t.consume($),P):L($)}function he($){return $===null||bt($)?(t.exit("htmlFlowData"),fe($)):(t.consume($),he)}function fe($){return t.exit("htmlFlow"),e($)}}function ude(t,e,n){const r=this;return i;function i(s){return bt(s)?(t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),o):n(s)}function o(s){return r.parser.lazy[r.now().line]?n(s):e(s)}}function fde(t,e,n){return r;function r(i){return t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),t.attempt(f1,e,n)}}const dde={name:"htmlText",tokenize:hde};function hde(t,e,n){const r=this;let i,o,s;return a;function a(P){return t.enter("htmlText"),t.enter("htmlTextData"),t.consume(P),l}function l(P){return P===33?(t.consume(P),c):P===47?(t.consume(P),A):P===63?(t.consume(P),C):Bs(P)?(t.consume(P),M):n(P)}function c(P){return P===45?(t.consume(P),f):P===91?(t.consume(P),o=0,v):Bs(P)?(t.consume(P),w):n(P)}function f(P){return P===45?(t.consume(P),m):n(P)}function d(P){return P===null?n(P):P===45?(t.consume(P),p):bt(P)?(s=d,ae(P)):(t.consume(P),d)}function p(P){return P===45?(t.consume(P),m):d(P)}function m(P){return P===62?ie(P):P===45?p(P):d(P)}function v(P){const he="CDATA[";return P===he.charCodeAt(o++)?(t.consume(P),o===he.length?b:v):n(P)}function b(P){return P===null?n(P):P===93?(t.consume(P),S):bt(P)?(s=b,ae(P)):(t.consume(P),b)}function S(P){return P===93?(t.consume(P),x):b(P)}function x(P){return P===62?ie(P):P===93?(t.consume(P),x):b(P)}function w(P){return P===null||P===62?ie(P):bt(P)?(s=w,ae(P)):(t.consume(P),w)}function C(P){return P===null?n(P):P===63?(t.consume(P),T):bt(P)?(s=C,ae(P)):(t.consume(P),C)}function T(P){return P===62?ie(P):C(P)}function A(P){return Bs(P)?(t.consume(P),_):n(P)}function _(P){return P===45||eo(P)?(t.consume(P),_):R(P)}function R(P){return bt(P)?(s=R,ae(P)):en(P)?(t.consume(P),R):ie(P)}function M(P){return P===45||eo(P)?(t.consume(P),M):P===47||P===62||Ri(P)?I(P):n(P)}function I(P){return P===47?(t.consume(P),ie):P===58||P===95||Bs(P)?(t.consume(P),V):bt(P)?(s=I,ae(P)):en(P)?(t.consume(P),I):ie(P)}function V(P){return P===45||P===46||P===58||P===95||eo(P)?(t.consume(P),V):U(P)}function U(P){return P===61?(t.consume(P),L):bt(P)?(s=U,ae(P)):en(P)?(t.consume(P),U):I(P)}function L(P){return P===null||P===60||P===61||P===62||P===96?n(P):P===34||P===39?(t.consume(P),i=P,G):bt(P)?(s=L,ae(P)):en(P)?(t.consume(P),L):(t.consume(P),K)}function G(P){return P===i?(t.consume(P),i=void 0,F):P===null?n(P):bt(P)?(s=G,ae(P)):(t.consume(P),G)}function K(P){return P===null||P===34||P===39||P===60||P===61||P===96?n(P):P===47||P===62||Ri(P)?I(P):(t.consume(P),K)}function F(P){return P===47||P===62||Ri(P)?I(P):n(P)}function ie(P){return P===62?(t.consume(P),t.exit("htmlTextData"),t.exit("htmlText"),e):n(P)}function ae(P){return t.exit("htmlTextData"),t.enter("lineEnding"),t.consume(P),t.exit("lineEnding"),re}function re(P){return en(P)?xn(t,W,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(P):W(P)}function W(P){return t.enter("htmlTextData"),s(P)}}const X2={name:"labelEnd",tokenize:bde,resolveTo:yde,resolveAll:vde},pde={tokenize:wde},mde={tokenize:xde},gde={tokenize:Sde};function vde(t){let e=-1;for(;++e<t.length;){const n=t[e][1];(n.type==="labelImage"||n.type==="labelLink"||n.type==="labelEnd")&&(t.splice(e+1,n.type==="labelImage"?4:2),n.type="data",e++)}return t}function yde(t,e){let n=t.length,r=0,i,o,s,a;for(;n--;)if(i=t[n][1],o){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;t[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(s){if(t[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(o=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(s=n);const l={type:t[o][1].type==="labelLink"?"link":"image",start:Object.assign({},t[o][1].start),end:Object.assign({},t[t.length-1][1].end)},c={type:"label",start:Object.assign({},t[o][1].start),end:Object.assign({},t[s][1].end)},f={type:"labelText",start:Object.assign({},t[o+r+2][1].end),end:Object.assign({},t[s-2][1].start)};return a=[["enter",l,e],["enter",c,e]],a=To(a,t.slice(o+1,o+r+3)),a=To(a,[["enter",f,e]]),a=To(a,Y2(e.parser.constructs.insideSpan.null,t.slice(o+r+4,s-3),e)),a=To(a,[["exit",f,e],t[s-2],t[s-1],["exit",c,e]]),a=To(a,t.slice(s+1)),a=To(a,[["exit",l,e]]),ea(t,o,t.length,a),t}function bde(t,e,n){const r=this;let i=r.events.length,o,s;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){o=r.events[i][1];break}return a;function a(p){return o?o._inactive?d(p):(s=r.parser.defined.includes(Vf(r.sliceSerialize({start:o.end,end:r.now()}))),t.enter("labelEnd"),t.enter("labelMarker"),t.consume(p),t.exit("labelMarker"),t.exit("labelEnd"),l):n(p)}function l(p){return p===40?t.attempt(pde,f,s?f:d)(p):p===91?t.attempt(mde,f,s?c:d)(p):s?f(p):d(p)}function c(p){return t.attempt(gde,f,d)(p)}function f(p){return e(p)}function d(p){return o._balanced=!0,n(p)}}function wde(t,e,n){return r;function r(d){return t.enter("resource"),t.enter("resourceMarker"),t.consume(d),t.exit("resourceMarker"),i}function i(d){return Ri(d)?dp(t,o)(d):o(d)}function o(d){return d===41?f(d):Bj(t,s,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(d)}function s(d){return Ri(d)?dp(t,l)(d):f(d)}function a(d){return n(d)}function l(d){return d===34||d===39||d===40?zj(t,c,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(d):f(d)}function c(d){return Ri(d)?dp(t,f)(d):f(d)}function f(d){return d===41?(t.enter("resourceMarker"),t.consume(d),t.exit("resourceMarker"),t.exit("resource"),e):n(d)}}function xde(t,e,n){const r=this;return i;function i(a){return Fj.call(r,t,o,s,"reference","referenceMarker","referenceString")(a)}function o(a){return r.parser.defined.includes(Vf(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?e(a):n(a)}function s(a){return n(a)}}function Sde(t,e,n){return r;function r(o){return t.enter("reference"),t.enter("referenceMarker"),t.consume(o),t.exit("referenceMarker"),i}function i(o){return o===93?(t.enter("referenceMarker"),t.consume(o),t.exit("referenceMarker"),t.exit("reference"),e):n(o)}}const Cde={name:"labelStartImage",tokenize:kde,resolveAll:X2.resolveAll};function kde(t,e,n){const r=this;return i;function i(a){return t.enter("labelImage"),t.enter("labelImageMarker"),t.consume(a),t.exit("labelImageMarker"),o}function o(a){return a===91?(t.enter("labelMarker"),t.consume(a),t.exit("labelMarker"),t.exit("labelImage"),s):n(a)}function s(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):e(a)}}const Ede={name:"labelStartLink",tokenize:_de,resolveAll:X2.resolveAll};function _de(t,e,n){const r=this;return i;function i(s){return t.enter("labelLink"),t.enter("labelMarker"),t.consume(s),t.exit("labelMarker"),t.exit("labelLink"),o}function o(s){return s===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(s):e(s)}}const Qx={name:"lineEnding",tokenize:Tde};function Tde(t,e){return n;function n(r){return t.enter("lineEnding"),t.consume(r),t.exit("lineEnding"),xn(t,e,"linePrefix")}}const dy={name:"thematicBreak",tokenize:Ade};function Ade(t,e,n){let r=0,i;return o;function o(c){return t.enter("thematicBreak"),s(c)}function s(c){return i=c,a(c)}function a(c){return c===i?(t.enter("thematicBreakSequence"),l(c)):r>=3&&(c===null||bt(c))?(t.exit("thematicBreak"),e(c)):n(c)}function l(c){return c===i?(t.consume(c),r++,l):(t.exit("thematicBreakSequence"),en(c)?xn(t,a,"whitespace")(c):a(c))}}const wi={name:"list",tokenize:Pde,continuation:{tokenize:Nde},exit:Dde},Ode={tokenize:Lde,partial:!0},Rde={tokenize:Mde,partial:!0};function Pde(t,e,n){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,s=0;return a;function a(m){const v=r.containerState.type||(m===42||m===43||m===45?"listUnordered":"listOrdered");if(v==="listUnordered"?!r.containerState.marker||m===r.containerState.marker:gk(m)){if(r.containerState.type||(r.containerState.type=v,t.enter(v,{_container:!0})),v==="listUnordered")return t.enter("listItemPrefix"),m===42||m===45?t.check(dy,n,c)(m):c(m);if(!r.interrupt||m===49)return t.enter("listItemPrefix"),t.enter("listItemValue"),l(m)}return n(m)}function l(m){return gk(m)&&++s<10?(t.consume(m),l):(!r.interrupt||s<2)&&(r.containerState.marker?m===r.containerState.marker:m===41||m===46)?(t.exit("listItemValue"),c(m)):n(m)}function c(m){return t.enter("listItemMarker"),t.consume(m),t.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||m,t.check(f1,r.interrupt?n:f,t.attempt(Ode,p,d))}function f(m){return r.containerState.initialBlankLine=!0,o++,p(m)}function d(m){return en(m)?(t.enter("listItemPrefixWhitespace"),t.consume(m),t.exit("listItemPrefixWhitespace"),p):n(m)}function p(m){return r.containerState.size=o+r.sliceSerialize(t.exit("listItemPrefix"),!0).length,e(m)}}function Nde(t,e,n){const r=this;return r.containerState._closeFlow=void 0,t.check(f1,i,o);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,xn(t,e,"listItemIndent",r.containerState.size+1)(a)}function o(a){return r.containerState.furtherBlankLines||!en(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,s(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,t.attempt(Rde,e,s)(a))}function s(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,xn(t,t.attempt(wi,e,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function Mde(t,e,n){const r=this;return xn(t,i,"listItemIndent",r.containerState.size+1);function i(o){const s=r.events[r.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===r.containerState.size?e(o):n(o)}}function Dde(t){t.exit(this.containerState.type)}function Lde(t,e,n){const r=this;return xn(t,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){const s=r.events[r.events.length-1];return!en(o)&&s&&s[1].type==="listItemPrefixWhitespace"?e(o):n(o)}}const CM={name:"setextUnderline",tokenize:Ide,resolveTo:$de};function $de(t,e){let n=t.length,r,i,o;for(;n--;)if(t[n][0]==="enter"){if(t[n][1].type==="content"){r=n;break}t[n][1].type==="paragraph"&&(i=n)}else t[n][1].type==="content"&&t.splice(n,1),!o&&t[n][1].type==="definition"&&(o=n);const s={type:"setextHeading",start:Object.assign({},t[i][1].start),end:Object.assign({},t[t.length-1][1].end)};return t[i][1].type="setextHeadingText",o?(t.splice(i,0,["enter",s,e]),t.splice(o+1,0,["exit",t[r][1],e]),t[r][1].end=Object.assign({},t[o][1].end)):t[r][1]=s,t.push(["exit",s,e]),t}function Ide(t,e,n){const r=this;let i;return o;function o(c){let f=r.events.length,d;for(;f--;)if(r.events[f][1].type!=="lineEnding"&&r.events[f][1].type!=="linePrefix"&&r.events[f][1].type!=="content"){d=r.events[f][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||d)?(t.enter("setextHeadingLine"),i=c,s(c)):n(c)}function s(c){return t.enter("setextHeadingLineSequence"),a(c)}function a(c){return c===i?(t.consume(c),a):(t.exit("setextHeadingLineSequence"),en(c)?xn(t,l,"lineSuffix")(c):l(c))}function l(c){return c===null||bt(c)?(t.exit("setextHeadingLine"),e(c)):n(c)}}const jde={tokenize:Bde};function Bde(t){const e=this,n=t.attempt(f1,r,t.attempt(this.parser.constructs.flowInitial,i,xn(t,t.attempt(this.parser.constructs.flow,i,t.attempt(Wfe,i)),"linePrefix")));return n;function r(o){if(o===null){t.consume(o);return}return t.enter("lineEndingBlank"),t.consume(o),t.exit("lineEndingBlank"),e.currentConstruct=void 0,n}function i(o){if(o===null){t.consume(o);return}return t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),e.currentConstruct=void 0,n}}const Fde={resolveAll:Uj()},zde=Vj("string"),Vde=Vj("text");function Vj(t){return{tokenize:e,resolveAll:Uj(t==="text"?Ude:void 0)};function e(n){const r=this,i=this.parser.constructs[t],o=n.attempt(i,s,a);return s;function s(f){return c(f)?o(f):a(f)}function a(f){if(f===null){n.consume(f);return}return n.enter("data"),n.consume(f),l}function l(f){return c(f)?(n.exit("data"),o(f)):(n.consume(f),l)}function c(f){if(f===null)return!0;const d=i[f];let p=-1;if(d)for(;++p<d.length;){const m=d[p];if(!m.previous||m.previous.call(r,r.previous))return!0}return!1}}}function Uj(t){return e;function e(n,r){let i=-1,o;for(;++i<=n.length;)o===void 0?n[i]&&n[i][1].type==="data"&&(o=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==o+2&&(n[o][1].end=n[i-1][1].end,n.splice(o+2,i-o-2),i=o+2),o=void 0);return t?t(n,r):n}}function Ude(t,e){let n=0;for(;++n<=t.length;)if((n===t.length||t[n][1].type==="lineEnding")&&t[n-1][1].type==="data"){const r=t[n-1][1],i=e.sliceStream(r);let o=i.length,s=-1,a=0,l;for(;o--;){const c=i[o];if(typeof c=="string"){for(s=c.length;c.charCodeAt(s-1)===32;)a++,s--;if(s)break;s=-1}else if(c===-2)l=!0,a++;else if(c!==-1){o++;break}}if(a){const c={type:n===t.length||l||a<2?"lineSuffix":"hardBreakTrailing",start:{line:r.end.line,column:r.end.column-a,offset:r.end.offset-a,_index:r.start._index+o,_bufferIndex:o?s:r.start._bufferIndex+s},end:Object.assign({},r.end)};r.end=Object.assign({},c.start),r.start.offset===r.end.offset?Object.assign(r,c):(t.splice(n,0,["enter",c,e],["exit",c,e]),n+=2)}n++}return t}function Wde(t,e,n){let r=Object.assign(n?Object.assign({},n):{line:1,column:1,offset:0},{_index:0,_bufferIndex:-1});const i={},o=[];let s=[],a=[];const l={consume:w,enter:C,exit:T,attempt:R(A),check:R(_),interrupt:R(_,{interrupt:!0})},c={previous:null,code:null,containerState:{},events:[],parser:t,sliceStream:m,sliceSerialize:p,now:v,defineSkip:b,write:d};let f=e.tokenize.call(c,l);return e.resolveAll&&o.push(e),c;function d(U){return s=To(s,U),S(),s[s.length-1]!==null?[]:(M(e,0),c.events=Y2(o,c.events,c),c.events)}function p(U,L){return qde(m(U),L)}function m(U){return Hde(s,U)}function v(){const{line:U,column:L,offset:G,_index:K,_bufferIndex:F}=r;return{line:U,column:L,offset:G,_index:K,_bufferIndex:F}}function b(U){i[U.line]=U.column,V()}function S(){let U;for(;r._index<s.length;){const L=s[r._index];if(typeof L=="string")for(U=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===U&&r._bufferIndex<L.length;)x(L.charCodeAt(r._bufferIndex));else x(L)}}function x(U){f=f(U)}function w(U){bt(U)?(r.line++,r.column=1,r.offset+=U===-3?2:1,V()):U!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===s[r._index].length&&(r._bufferIndex=-1,r._index++)),c.previous=U}function C(U,L){const G=L||{};return G.type=U,G.start=v(),c.events.push(["enter",G,c]),a.push(G),G}function T(U){const L=a.pop();return L.end=v(),c.events.push(["exit",L,c]),L}function A(U,L){M(U,L.from)}function _(U,L){L.restore()}function R(U,L){return G;function G(K,F,ie){let ae,re,W,P;return Array.isArray(K)?fe(K):"tokenize"in K?fe([K]):he(K);function he(Ye){return Ie;function Ie(J){const Se=J!==null&&Ye[J],Ee=J!==null&&Ye.null,ke=[...Array.isArray(Se)?Se:Se?[Se]:[],...Array.isArray(Ee)?Ee:Ee?[Ee]:[]];return fe(ke)(J)}}function fe(Ye){return ae=Ye,re=0,Ye.length===0?ie:$(Ye[re])}function $(Ye){return Ie;function Ie(J){return P=I(),W=Ye,Ye.partial||(c.currentConstruct=Ye),Ye.name&&c.parser.constructs.disable.null.includes(Ye.name)?He():Ye.tokenize.call(L?Object.assign(Object.create(c),L):c,l,Ne,He)(J)}}function Ne(Ye){return U(W,P),F}function He(Ye){return P.restore(),++re<ae.length?$(ae[re]):ie}}}function M(U,L){U.resolveAll&&!o.includes(U)&&o.push(U),U.resolve&&ea(c.events,L,c.events.length-L,U.resolve(c.events.slice(L),c)),U.resolveTo&&(c.events=U.resolveTo(c.events,c))}function I(){const U=v(),L=c.previous,G=c.currentConstruct,K=c.events.length,F=Array.from(a);return{restore:ie,from:K};function ie(){r=U,c.previous=L,c.currentConstruct=G,c.events.length=K,a=F,V()}}function V(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function Hde(t,e){const n=e.start._index,r=e.start._bufferIndex,i=e.end._index,o=e.end._bufferIndex;let s;if(n===i)s=[t[n].slice(r,o)];else{if(s=t.slice(n,i),r>-1){const a=s[0];typeof a=="string"?s[0]=a.slice(r):s.shift()}o>0&&s.push(t[i].slice(0,o))}return s}function qde(t,e){let n=-1;const r=[];let i;for(;++n<t.length;){const o=t[n];let s;if(typeof o=="string")s=o;else switch(o){case-5:{s="\r";break}case-4:{s=`
198
+ `;break}case-3:{s=`\r
199
+ `;break}case-2:{s=e?" ":" ";break}case-1:{if(!e&&i)continue;s=" ";break}default:s=String.fromCharCode(o)}i=o===-2,r.push(s)}return r.join("")}const Kde={42:wi,43:wi,45:wi,48:wi,49:wi,50:wi,51:wi,52:wi,53:wi,54:wi,55:wi,56:wi,57:wi,62:Lj},Gde={91:Yfe},Yde={[-2]:Zx,[-1]:Zx,32:Zx},Xde={35:tde,42:dy,45:[CM,dy],60:ode,61:CM,95:dy,96:xM,126:xM},Zde={38:Ij,92:$j},Qde={[-5]:Qx,[-4]:Qx,[-3]:Qx,33:Cde,38:Ij,42:vk,60:[_fe,dde],91:Ede,92:[Jfe,$j],93:X2,95:vk,96:Bfe},Jde={null:[vk,Fde]},ehe={null:[42,95]},the={null:[]},nhe=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:ehe,contentInitial:Gde,disable:the,document:Kde,flow:Xde,flowInitial:Yde,insideSpan:Jde,string:Zde,text:Qde},Symbol.toStringTag,{value:"Module"}));function rhe(t){const n=ffe([nhe,...(t||{}).extensions||[]]),r={defined:[],lazy:{},constructs:n,content:i(bfe),document:i(xfe),flow:i(jde),string:i(zde),text:i(Vde)};return r;function i(o){return s;function s(a){return Wde(r,o,a)}}}function ihe(t){for(;!jj(t););return t}const kM=/[\0\t\n\r]/g;function ohe(){let t=1,e="",n=!0,r;return i;function i(o,s,a){const l=[];let c,f,d,p,m;for(o=e+(typeof o=="string"?o.toString():new TextDecoder(s||void 0).decode(o)),d=0,e="",n&&(o.charCodeAt(0)===65279&&d++,n=void 0);d<o.length;){if(kM.lastIndex=d,c=kM.exec(o),p=c&&c.index!==void 0?c.index:o.length,m=o.charCodeAt(p),!c){e=o.slice(d);break}if(m===10&&d===p&&r)l.push(-3),r=void 0;else switch(r&&(l.push(-5),r=void 0),d<p&&(l.push(o.slice(d,p)),t+=p-d),m){case 0:{l.push(65533),t++;break}case 9:{for(f=Math.ceil(t/4)*4,l.push(-2);t++<f;)l.push(-1);break}case 10:{l.push(-4),t=1;break}default:r=!0,t=1}d=p+1}return a&&(r&&l.push(-5),e&&l.push(e),l.push(null)),l}}const she=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function ahe(t){return t.replace(she,lhe)}function lhe(t,e,n){if(e)return e;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),o=i===120||i===88;return Mj(n.slice(o?2:1),o?16:10)}return G2(n)||t}const Wj={}.hasOwnProperty;function che(t,e,n){return typeof e!="string"&&(n=e,e=void 0),uhe(n)(ihe(rhe(n).document().write(ohe()(t,e,!0))))}function uhe(t){const e={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(wt),autolinkProtocol:I,autolinkEmail:I,atxHeading:o(ue),blockQuote:o(Se),characterEscape:I,characterReference:I,codeFenced:o(Ee),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:o(Ee,s),codeText:o(ke,s),codeTextData:I,data:I,codeFlowValue:I,definition:o(oe),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:o(se),hardBreakEscape:o(we),hardBreakTrailing:o(we),htmlFlow:o(nt,s),htmlFlowData:I,htmlText:o(nt,s),htmlTextData:I,image:o(et),label:s,link:o(wt),listItem:o(z),listItemValue:p,listOrdered:o(nn,d),listUnordered:o(nn),paragraph:o(X),reference:$,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:o(ue),strong:o(ne),thematicBreak:o(Ce)},exit:{atxHeading:l(),atxHeadingSequence:A,autolink:l(),autolinkEmail:J,autolinkProtocol:Ie,blockQuote:l(),characterEscapeValue:V,characterReferenceMarkerHexadecimal:He,characterReferenceMarkerNumeric:He,characterReferenceValue:Ye,codeFenced:l(S),codeFencedFence:b,codeFencedFenceInfo:m,codeFencedFenceMeta:v,codeFlowValue:V,codeIndented:l(x),codeText:l(F),codeTextData:V,data:V,definition:l(),definitionDestinationString:T,definitionLabelString:w,definitionTitleString:C,emphasis:l(),hardBreakEscape:l(L),hardBreakTrailing:l(L),htmlFlow:l(G),htmlFlowData:V,htmlText:l(K),htmlTextData:V,image:l(ae),label:W,labelText:re,lineEnding:U,link:l(ie),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:Ne,resourceDestinationString:P,resourceTitleString:he,resource:fe,setextHeading:l(M),setextHeadingLineSequence:R,setextHeadingText:_,strong:l(),thematicBreak:l()}};Hj(e,(t||{}).mdastExtensions||[]);const n={};return r;function r(j){let ee={type:"root",children:[]};const de={stack:[ee],tokenStack:[],config:e,enter:a,exit:c,buffer:s,resume:f,data:n},Ae=[];let Be=-1;for(;++Be<j.length;)if(j[Be][1].type==="listOrdered"||j[Be][1].type==="listUnordered")if(j[Be][0]==="enter")Ae.push(Be);else{const Te=Ae.pop();Be=i(j,Te,Be)}for(Be=-1;++Be<j.length;){const Te=e[j[Be][0]];Wj.call(Te,j[Be][1].type)&&Te[j[Be][1].type].call(Object.assign({sliceSerialize:j[Be][2].sliceSerialize},de),j[Be][1])}if(de.tokenStack.length>0){const Te=de.tokenStack[de.tokenStack.length-1];(Te[1]||EM).call(de,void 0,Te[0])}for(ee.position={start:fl(j.length>0?j[0][1].start:{line:1,column:1,offset:0}),end:fl(j.length>0?j[j.length-2][1].end:{line:1,column:1,offset:0})},Be=-1;++Be<e.transforms.length;)ee=e.transforms[Be](ee)||ee;return ee}function i(j,ee,de){let Ae=ee-1,Be=-1,Te=!1,je,Oe,Qt,sn;for(;++Ae<=de;){const Lt=j[Ae];switch(Lt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Lt[0]==="enter"?Be++:Be--,sn=void 0;break}case"lineEndingBlank":{Lt[0]==="enter"&&(je&&!sn&&!Be&&!Qt&&(Qt=Ae),sn=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:sn=void 0}if(!Be&&Lt[0]==="enter"&&Lt[1].type==="listItemPrefix"||Be===-1&&Lt[0]==="exit"&&(Lt[1].type==="listUnordered"||Lt[1].type==="listOrdered")){if(je){let Kt=Ae;for(Oe=void 0;Kt--;){const Pt=j[Kt];if(Pt[1].type==="lineEnding"||Pt[1].type==="lineEndingBlank"){if(Pt[0]==="exit")continue;Oe&&(j[Oe][1].type="lineEndingBlank",Te=!0),Pt[1].type="lineEnding",Oe=Kt}else if(!(Pt[1].type==="linePrefix"||Pt[1].type==="blockQuotePrefix"||Pt[1].type==="blockQuotePrefixWhitespace"||Pt[1].type==="blockQuoteMarker"||Pt[1].type==="listItemIndent"))break}Qt&&(!Oe||Qt<Oe)&&(je._spread=!0),je.end=Object.assign({},Oe?j[Oe][1].start:Lt[1].end),j.splice(Oe||Ae,0,["exit",je,Lt[2]]),Ae++,de++}if(Lt[1].type==="listItemPrefix"){const Kt={type:"listItem",_spread:!1,start:Object.assign({},Lt[1].start),end:void 0};je=Kt,j.splice(Ae,0,["enter",Kt,Lt[2]]),Ae++,de++,Qt=void 0,sn=!0}}}return j[ee][1]._spread=Te,de}function o(j,ee){return de;function de(Ae){a.call(this,j(Ae),Ae),ee&&ee.call(this,Ae)}}function s(){this.stack.push({type:"fragment",children:[]})}function a(j,ee,de){this.stack[this.stack.length-1].children.push(j),this.stack.push(j),this.tokenStack.push([ee,de]),j.position={start:fl(ee.start),end:void 0}}function l(j){return ee;function ee(de){j&&j.call(this,de),c.call(this,de)}}function c(j,ee){const de=this.stack.pop(),Ae=this.tokenStack.pop();if(Ae)Ae[0].type!==j.type&&(ee?ee.call(this,j,Ae[0]):(Ae[1]||EM).call(this,j,Ae[0]));else throw new Error("Cannot close `"+j.type+"` ("+fp({start:j.start,end:j.end})+"): it’s not open");de.position.end=fl(j.end)}function f(){return cfe(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function p(j){if(this.data.expectingFirstListItemValue){const ee=this.stack[this.stack.length-2];ee.start=Number.parseInt(this.sliceSerialize(j),10),this.data.expectingFirstListItemValue=void 0}}function m(){const j=this.resume(),ee=this.stack[this.stack.length-1];ee.lang=j}function v(){const j=this.resume(),ee=this.stack[this.stack.length-1];ee.meta=j}function b(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function S(){const j=this.resume(),ee=this.stack[this.stack.length-1];ee.value=j.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function x(){const j=this.resume(),ee=this.stack[this.stack.length-1];ee.value=j.replace(/(\r?\n|\r)$/g,"")}function w(j){const ee=this.resume(),de=this.stack[this.stack.length-1];de.label=ee,de.identifier=Vf(this.sliceSerialize(j)).toLowerCase()}function C(){const j=this.resume(),ee=this.stack[this.stack.length-1];ee.title=j}function T(){const j=this.resume(),ee=this.stack[this.stack.length-1];ee.url=j}function A(j){const ee=this.stack[this.stack.length-1];if(!ee.depth){const de=this.sliceSerialize(j).length;ee.depth=de}}function _(){this.data.setextHeadingSlurpLineEnding=!0}function R(j){const ee=this.stack[this.stack.length-1];ee.depth=this.sliceSerialize(j).codePointAt(0)===61?1:2}function M(){this.data.setextHeadingSlurpLineEnding=void 0}function I(j){const de=this.stack[this.stack.length-1].children;let Ae=de[de.length-1];(!Ae||Ae.type!=="text")&&(Ae=_e(),Ae.position={start:fl(j.start),end:void 0},de.push(Ae)),this.stack.push(Ae)}function V(j){const ee=this.stack.pop();ee.value+=this.sliceSerialize(j),ee.position.end=fl(j.end)}function U(j){const ee=this.stack[this.stack.length-1];if(this.data.atHardBreak){const de=ee.children[ee.children.length-1];de.position.end=fl(j.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&e.canContainEols.includes(ee.type)&&(I.call(this,j),V.call(this,j))}function L(){this.data.atHardBreak=!0}function G(){const j=this.resume(),ee=this.stack[this.stack.length-1];ee.value=j}function K(){const j=this.resume(),ee=this.stack[this.stack.length-1];ee.value=j}function F(){const j=this.resume(),ee=this.stack[this.stack.length-1];ee.value=j}function ie(){const j=this.stack[this.stack.length-1];if(this.data.inReference){const ee=this.data.referenceType||"shortcut";j.type+="Reference",j.referenceType=ee,delete j.url,delete j.title}else delete j.identifier,delete j.label;this.data.referenceType=void 0}function ae(){const j=this.stack[this.stack.length-1];if(this.data.inReference){const ee=this.data.referenceType||"shortcut";j.type+="Reference",j.referenceType=ee,delete j.url,delete j.title}else delete j.identifier,delete j.label;this.data.referenceType=void 0}function re(j){const ee=this.sliceSerialize(j),de=this.stack[this.stack.length-2];de.label=ahe(ee),de.identifier=Vf(ee).toLowerCase()}function W(){const j=this.stack[this.stack.length-1],ee=this.resume(),de=this.stack[this.stack.length-1];if(this.data.inReference=!0,de.type==="link"){const Ae=j.children;de.children=Ae}else de.alt=ee}function P(){const j=this.resume(),ee=this.stack[this.stack.length-1];ee.url=j}function he(){const j=this.resume(),ee=this.stack[this.stack.length-1];ee.title=j}function fe(){this.data.inReference=void 0}function $(){this.data.referenceType="collapsed"}function Ne(j){const ee=this.resume(),de=this.stack[this.stack.length-1];de.label=ee,de.identifier=Vf(this.sliceSerialize(j)).toLowerCase(),this.data.referenceType="full"}function He(j){this.data.characterReferenceType=j.type}function Ye(j){const ee=this.sliceSerialize(j),de=this.data.characterReferenceType;let Ae;de?(Ae=Mj(ee,de==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ae=G2(ee);const Be=this.stack.pop();Be.value+=Ae,Be.position.end=fl(j.end)}function Ie(j){V.call(this,j);const ee=this.stack[this.stack.length-1];ee.url=this.sliceSerialize(j)}function J(j){V.call(this,j);const ee=this.stack[this.stack.length-1];ee.url="mailto:"+this.sliceSerialize(j)}function Se(){return{type:"blockquote",children:[]}}function Ee(){return{type:"code",lang:null,meta:null,value:""}}function ke(){return{type:"inlineCode",value:""}}function oe(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function se(){return{type:"emphasis",children:[]}}function ue(){return{type:"heading",depth:0,children:[]}}function we(){return{type:"break"}}function nt(){return{type:"html",value:""}}function et(){return{type:"image",title:null,url:"",alt:null}}function wt(){return{type:"link",title:null,url:"",children:[]}}function nn(j){return{type:"list",ordered:j.type==="listOrdered",start:null,spread:j._spread,children:[]}}function z(j){return{type:"listItem",spread:j._spread,checked:null,children:[]}}function X(){return{type:"paragraph",children:[]}}function ne(){return{type:"strong",children:[]}}function _e(){return{type:"text",value:""}}function Ce(){return{type:"thematicBreak"}}}function fl(t){return{line:t.line,column:t.column,offset:t.offset}}function Hj(t,e){let n=-1;for(;++n<e.length;){const r=e[n];Array.isArray(r)?Hj(t,r):fhe(t,r)}}function fhe(t,e){let n;for(n in e)if(Wj.call(e,n))switch(n){case"canContainEols":{const r=e[n];r&&t[n].push(...r);break}case"transforms":{const r=e[n];r&&t[n].push(...r);break}case"enter":case"exit":{const r=e[n];r&&Object.assign(t[n],r);break}}}function EM(t,e){throw t?new Error("Cannot close `"+t.type+"` ("+fp({start:t.start,end:t.end})+"): a different token (`"+e.type+"`, "+fp({start:e.start,end:e.end})+") is open"):new Error("Cannot close document, a token (`"+e.type+"`, "+fp({start:e.start,end:e.end})+") is still open")}function dhe(t){const e=this;e.parser=n;function n(r){return che(r,{...e.data("settings"),...t,extensions:e.data("micromarkExtensions")||[],mdastExtensions:e.data("fromMarkdownExtensions")||[]})}}function hhe(t,e){const n={type:"element",tagName:"blockquote",properties:{},children:t.wrap(t.all(e),!0)};return t.patch(e,n),t.applyData(e,n)}function phe(t,e){const n={type:"element",tagName:"br",properties:{},children:[]};return t.patch(e,n),[t.applyData(e,n),{type:"text",value:`
200
+ `}]}function mhe(t,e){const n=e.value?e.value+`
201
+ `:"",r={};e.lang&&(r.className=["language-"+e.lang]);let i={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return e.meta&&(i.data={meta:e.meta}),t.patch(e,i),i=t.applyData(e,i),i={type:"element",tagName:"pre",properties:{},children:[i]},t.patch(e,i),i}function ghe(t,e){const n={type:"element",tagName:"del",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function vhe(t,e){const n={type:"element",tagName:"em",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function yhe(t,e){const n=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",r=String(e.identifier).toUpperCase(),i=jd(r.toLowerCase()),o=t.footnoteOrder.indexOf(r);let s,a=t.footnoteCounts.get(r);a===void 0?(a=0,t.footnoteOrder.push(r),s=t.footnoteOrder.length):s=o+1,a+=1,t.footnoteCounts.set(r,a);const l={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(a>1?"-"+a:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(s)}]};t.patch(e,l);const c={type:"element",tagName:"sup",properties:{},children:[l]};return t.patch(e,c),t.applyData(e,c)}function bhe(t,e){const n={type:"element",tagName:"h"+e.depth,properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function whe(t,e){if(t.options.allowDangerousHtml){const n={type:"raw",value:e.value};return t.patch(e,n),t.applyData(e,n)}}function qj(t,e){const n=e.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(e.label||e.identifier)+"]"),e.type==="imageReference")return[{type:"text",value:"!["+e.alt+r}];const i=t.all(e),o=i[0];o&&o.type==="text"?o.value="["+o.value:i.unshift({type:"text",value:"["});const s=i[i.length-1];return s&&s.type==="text"?s.value+=r:i.push({type:"text",value:r}),i}function xhe(t,e){const n=String(e.identifier).toUpperCase(),r=t.definitionById.get(n);if(!r)return qj(t,e);const i={src:jd(r.url||""),alt:e.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"img",properties:i,children:[]};return t.patch(e,o),t.applyData(e,o)}function She(t,e){const n={src:jd(e.url)};e.alt!==null&&e.alt!==void 0&&(n.alt=e.alt),e.title!==null&&e.title!==void 0&&(n.title=e.title);const r={type:"element",tagName:"img",properties:n,children:[]};return t.patch(e,r),t.applyData(e,r)}function Che(t,e){const n={type:"text",value:e.value.replace(/\r?\n|\r/g," ")};t.patch(e,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return t.patch(e,r),t.applyData(e,r)}function khe(t,e){const n=String(e.identifier).toUpperCase(),r=t.definitionById.get(n);if(!r)return qj(t,e);const i={href:jd(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"a",properties:i,children:t.all(e)};return t.patch(e,o),t.applyData(e,o)}function Ehe(t,e){const n={href:jd(e.url)};e.title!==null&&e.title!==void 0&&(n.title=e.title);const r={type:"element",tagName:"a",properties:n,children:t.all(e)};return t.patch(e,r),t.applyData(e,r)}function _he(t,e,n){const r=t.all(e),i=n?The(n):Kj(e),o={},s=[];if(typeof e.checked=="boolean"){const f=r[0];let d;f&&f.type==="element"&&f.tagName==="p"?d=f:(d={type:"element",tagName:"p",properties:{},children:[]},r.unshift(d)),d.children.length>0&&d.children.unshift({type:"text",value:" "}),d.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:e.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let a=-1;for(;++a<r.length;){const f=r[a];(i||a!==0||f.type!=="element"||f.tagName!=="p")&&s.push({type:"text",value:`
202
+ `}),f.type==="element"&&f.tagName==="p"&&!i?s.push(...f.children):s.push(f)}const l=r[r.length-1];l&&(i||l.type!=="element"||l.tagName!=="p")&&s.push({type:"text",value:`
203
+ `});const c={type:"element",tagName:"li",properties:o,children:s};return t.patch(e,c),t.applyData(e,c)}function The(t){let e=!1;if(t.type==="list"){e=t.spread||!1;const n=t.children;let r=-1;for(;!e&&++r<n.length;)e=Kj(n[r])}return e}function Kj(t){const e=t.spread;return e??t.children.length>1}function Ahe(t,e){const n={},r=t.all(e);let i=-1;for(typeof e.start=="number"&&e.start!==1&&(n.start=e.start);++i<r.length;){const s=r[i];if(s.type==="element"&&s.tagName==="li"&&s.properties&&Array.isArray(s.properties.className)&&s.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const o={type:"element",tagName:e.ordered?"ol":"ul",properties:n,children:t.wrap(r,!0)};return t.patch(e,o),t.applyData(e,o)}function Ohe(t,e){const n={type:"element",tagName:"p",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function Rhe(t,e){const n={type:"root",children:t.wrap(t.all(e))};return t.patch(e,n),t.applyData(e,n)}function Phe(t,e){const n={type:"element",tagName:"strong",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function Nhe(t,e){const n=t.all(e),r=n.shift(),i=[];if(r){const s={type:"element",tagName:"thead",properties:{},children:t.wrap([r],!0)};t.patch(e.children[0],s),i.push(s)}if(n.length>0){const s={type:"element",tagName:"tbody",properties:{},children:t.wrap(n,!0)},a=W2(e.children[1]),l=_j(e.children[e.children.length-1]);a&&l&&(s.position={start:a,end:l}),i.push(s)}const o={type:"element",tagName:"table",properties:{},children:t.wrap(i,!0)};return t.patch(e,o),t.applyData(e,o)}function Mhe(t,e,n){const r=n?n.children:void 0,o=(r?r.indexOf(e):1)===0?"th":"td",s=n&&n.type==="table"?n.align:void 0,a=s?s.length:e.children.length;let l=-1;const c=[];for(;++l<a;){const d=e.children[l],p={},m=s?s[l]:void 0;m&&(p.align=m);let v={type:"element",tagName:o,properties:p,children:[]};d&&(v.children=t.all(d),t.patch(d,v),v=t.applyData(d,v)),c.push(v)}const f={type:"element",tagName:"tr",properties:{},children:t.wrap(c,!0)};return t.patch(e,f),t.applyData(e,f)}function Dhe(t,e){const n={type:"element",tagName:"td",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}const _M=9,TM=32;function Lhe(t){const e=String(t),n=/\r?\n|\r/g;let r=n.exec(e),i=0;const o=[];for(;r;)o.push(AM(e.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(e);return o.push(AM(e.slice(i),i>0,!1)),o.join("")}function AM(t,e,n){let r=0,i=t.length;if(e){let o=t.codePointAt(r);for(;o===_M||o===TM;)r++,o=t.codePointAt(r)}if(n){let o=t.codePointAt(i-1);for(;o===_M||o===TM;)i--,o=t.codePointAt(i-1)}return i>r?t.slice(r,i):""}function $he(t,e){const n={type:"text",value:Lhe(String(e.value))};return t.patch(e,n),t.applyData(e,n)}function Ihe(t,e){const n={type:"element",tagName:"hr",properties:{},children:[]};return t.patch(e,n),t.applyData(e,n)}const jhe={blockquote:hhe,break:phe,code:mhe,delete:ghe,emphasis:vhe,footnoteReference:yhe,heading:bhe,html:whe,imageReference:xhe,image:She,inlineCode:Che,linkReference:khe,link:Ehe,listItem:_he,list:Ahe,paragraph:Ohe,root:Rhe,strong:Phe,table:Nhe,tableCell:Dhe,tableRow:Mhe,text:$he,thematicBreak:Ihe,toml:pv,yaml:pv,definition:pv,footnoteDefinition:pv};function pv(){}const Gj=-1,d1=0,$0=1,I0=2,Z2=3,Q2=4,J2=5,eT=6,Yj=7,Xj=8,OM=typeof self=="object"?self:globalThis,Bhe=(t,e)=>{const n=(i,o)=>(t.set(o,i),i),r=i=>{if(t.has(i))return t.get(i);const[o,s]=e[i];switch(o){case d1:case Gj:return n(s,i);case $0:{const a=n([],i);for(const l of s)a.push(r(l));return a}case I0:{const a=n({},i);for(const[l,c]of s)a[r(l)]=r(c);return a}case Z2:return n(new Date(s),i);case Q2:{const{source:a,flags:l}=s;return n(new RegExp(a,l),i)}case J2:{const a=n(new Map,i);for(const[l,c]of s)a.set(r(l),r(c));return a}case eT:{const a=n(new Set,i);for(const l of s)a.add(r(l));return a}case Yj:{const{name:a,message:l}=s;return n(new OM[a](l),i)}case Xj:return n(BigInt(s),i);case"BigInt":return n(Object(BigInt(s)),i)}return n(new OM[o](s),i)};return r},RM=t=>Bhe(new Map,t)(0),nf="",{toString:Fhe}={},{keys:zhe}=Object,Th=t=>{const e=typeof t;if(e!=="object"||!t)return[d1,e];const n=Fhe.call(t).slice(8,-1);switch(n){case"Array":return[$0,nf];case"Object":return[I0,nf];case"Date":return[Z2,nf];case"RegExp":return[Q2,nf];case"Map":return[J2,nf];case"Set":return[eT,nf]}return n.includes("Array")?[$0,n]:n.includes("Error")?[Yj,n]:[I0,n]},mv=([t,e])=>t===d1&&(e==="function"||e==="symbol"),Vhe=(t,e,n,r)=>{const i=(s,a)=>{const l=r.push(s)-1;return n.set(a,l),l},o=s=>{if(n.has(s))return n.get(s);let[a,l]=Th(s);switch(a){case d1:{let f=s;switch(l){case"bigint":a=Xj,f=s.toString();break;case"function":case"symbol":if(t)throw new TypeError("unable to serialize "+l);f=null;break;case"undefined":return i([Gj],s)}return i([a,f],s)}case $0:{if(l)return i([l,[...s]],s);const f=[],d=i([a,f],s);for(const p of s)f.push(o(p));return d}case I0:{if(l)switch(l){case"BigInt":return i([l,s.toString()],s);case"Boolean":case"Number":case"String":return i([l,s.valueOf()],s)}if(e&&"toJSON"in s)return o(s.toJSON());const f=[],d=i([a,f],s);for(const p of zhe(s))(t||!mv(Th(s[p])))&&f.push([o(p),o(s[p])]);return d}case Z2:return i([a,s.toISOString()],s);case Q2:{const{source:f,flags:d}=s;return i([a,{source:f,flags:d}],s)}case J2:{const f=[],d=i([a,f],s);for(const[p,m]of s)(t||!(mv(Th(p))||mv(Th(m))))&&f.push([o(p),o(m)]);return d}case eT:{const f=[],d=i([a,f],s);for(const p of s)(t||!mv(Th(p)))&&f.push(o(p));return d}}const{message:c}=s;return i([a,{name:l,message:c}],s)};return o},PM=(t,{json:e,lossy:n}={})=>{const r=[];return Vhe(!(e||n),!!e,new Map,r)(t),r},j0=typeof structuredClone=="function"?(t,e)=>e&&("json"in e||"lossy"in e)?RM(PM(t,e)):structuredClone(t):(t,e)=>RM(PM(t,e));function Uhe(t,e){const n=[{type:"text",value:"↩"}];return e>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(e)}]}),n}function Whe(t,e){return"Back to reference "+(t+1)+(e>1?"-"+e:"")}function Hhe(t){const e=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",n=t.options.footnoteBackContent||Uhe,r=t.options.footnoteBackLabel||Whe,i=t.options.footnoteLabel||"Footnotes",o=t.options.footnoteLabelTagName||"h2",s=t.options.footnoteLabelProperties||{className:["sr-only"]},a=[];let l=-1;for(;++l<t.footnoteOrder.length;){const c=t.footnoteById.get(t.footnoteOrder[l]);if(!c)continue;const f=t.all(c),d=String(c.identifier).toUpperCase(),p=jd(d.toLowerCase());let m=0;const v=[],b=t.footnoteCounts.get(d);for(;b!==void 0&&++m<=b;){v.length>0&&v.push({type:"text",value:" "});let w=typeof n=="string"?n:n(l,m);typeof w=="string"&&(w={type:"text",value:w}),v.push({type:"element",tagName:"a",properties:{href:"#"+e+"fnref-"+p+(m>1?"-"+m:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(l,m),className:["data-footnote-backref"]},children:Array.isArray(w)?w:[w]})}const S=f[f.length-1];if(S&&S.type==="element"&&S.tagName==="p"){const w=S.children[S.children.length-1];w&&w.type==="text"?w.value+=" ":S.children.push({type:"text",value:" "}),S.children.push(...v)}else f.push(...v);const x={type:"element",tagName:"li",properties:{id:e+"fn-"+p},children:t.wrap(f,!0)};t.patch(c,x),a.push(x)}if(a.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...j0(s),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
204
+ `},{type:"element",tagName:"ol",properties:{},children:t.wrap(a,!0)},{type:"text",value:`
205
+ `}]}}const Zj=function(t){if(t==null)return Yhe;if(typeof t=="function")return h1(t);if(typeof t=="object")return Array.isArray(t)?qhe(t):Khe(t);if(typeof t=="string")return Ghe(t);throw new Error("Expected function, string, or object as test")};function qhe(t){const e=[];let n=-1;for(;++n<t.length;)e[n]=Zj(t[n]);return h1(r);function r(...i){let o=-1;for(;++o<e.length;)if(e[o].apply(this,i))return!0;return!1}}function Khe(t){const e=t;return h1(n);function n(r){const i=r;let o;for(o in t)if(i[o]!==e[o])return!1;return!0}}function Ghe(t){return h1(e);function e(n){return n&&n.type===t}}function h1(t){return e;function e(n,r,i){return!!(Xhe(n)&&t.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function Yhe(){return!0}function Xhe(t){return t!==null&&typeof t=="object"&&"type"in t}const Qj=[],Zhe=!0,NM=!1,Qhe="skip";function Jhe(t,e,n,r){let i;typeof e=="function"&&typeof n!="function"?(r=n,n=e):i=e;const o=Zj(i),s=r?-1:1;a(t,void 0,[])();function a(l,c,f){const d=l&&typeof l=="object"?l:{};if(typeof d.type=="string"){const m=typeof d.tagName=="string"?d.tagName:typeof d.name=="string"?d.name:void 0;Object.defineProperty(p,"name",{value:"node ("+(l.type+(m?"<"+m+">":""))+")"})}return p;function p(){let m=Qj,v,b,S;if((!e||o(l,c,f[f.length-1]||void 0))&&(m=epe(n(l,f)),m[0]===NM))return m;if("children"in l&&l.children){const x=l;if(x.children&&m[0]!==Qhe)for(b=(r?x.children.length:-1)+s,S=f.concat(x);b>-1&&b<x.children.length;){const w=x.children[b];if(v=a(w,b,S)(),v[0]===NM)return v;b=typeof v[1]=="number"?v[1]:b+s}}return m}}}function epe(t){return Array.isArray(t)?t:typeof t=="number"?[Zhe,t]:t==null?Qj:[t]}function Jj(t,e,n,r){let i,o,s;typeof e=="function"&&typeof n!="function"?(o=void 0,s=e,i=n):(o=e,s=n,i=r),Jhe(t,o,a,i);function a(l,c){const f=c[c.length-1],d=f?f.children.indexOf(l):void 0;return s(l,d,f)}}const yk={}.hasOwnProperty,tpe={};function npe(t,e){const n=e||tpe,r=new Map,i=new Map,o=new Map,s={...jhe,...n.handlers},a={all:c,applyData:ipe,definitionById:r,footnoteById:i,footnoteCounts:o,footnoteOrder:[],handlers:s,one:l,options:n,patch:rpe,wrap:spe};return Jj(t,function(f){if(f.type==="definition"||f.type==="footnoteDefinition"){const d=f.type==="definition"?r:i,p=String(f.identifier).toUpperCase();d.has(p)||d.set(p,f)}}),a;function l(f,d){const p=f.type,m=a.handlers[p];if(yk.call(a.handlers,p)&&m)return m(a,f,d);if(a.options.passThrough&&a.options.passThrough.includes(p)){if("children"in f){const{children:b,...S}=f,x=j0(S);return x.children=a.all(f),x}return j0(f)}return(a.options.unknownHandler||ope)(a,f,d)}function c(f){const d=[];if("children"in f){const p=f.children;let m=-1;for(;++m<p.length;){const v=a.one(p[m],f);if(v){if(m&&p[m-1].type==="break"&&(!Array.isArray(v)&&v.type==="text"&&(v.value=MM(v.value)),!Array.isArray(v)&&v.type==="element")){const b=v.children[0];b&&b.type==="text"&&(b.value=MM(b.value))}Array.isArray(v)?d.push(...v):d.push(v)}}}return d}}function rpe(t,e){t.position&&(e.position=Bue(t))}function ipe(t,e){let n=e;if(t&&t.data){const r=t.data.hName,i=t.data.hChildren,o=t.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const s="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:s}}n.type==="element"&&o&&Object.assign(n.properties,j0(o)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function ope(t,e){const n=e.data||{},r="value"in e&&!(yk.call(n,"hProperties")||yk.call(n,"hChildren"))?{type:"text",value:e.value}:{type:"element",tagName:"div",properties:{},children:t.all(e)};return t.patch(e,r),t.applyData(e,r)}function spe(t,e){const n=[];let r=-1;for(e&&n.push({type:"text",value:`
206
+ `});++r<t.length;)r&&n.push({type:"text",value:`
207
+ `}),n.push(t[r]);return e&&t.length>0&&n.push({type:"text",value:`
208
+ `}),n}function MM(t){let e=0,n=t.charCodeAt(e);for(;n===9||n===32;)e++,n=t.charCodeAt(e);return t.slice(e)}function DM(t,e){const n=npe(t,e),r=n.one(t,void 0),i=Hhe(n),o=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&o.children.push({type:"text",value:`
209
+ `},i),o}function ape(t,e){return t&&"run"in t?async function(n,r){const i=DM(n,e);await t.run(i,r)}:function(n){return DM(n,e||t)}}function LM(t){if(t)throw t}var hy=Object.prototype.hasOwnProperty,e9=Object.prototype.toString,$M=Object.defineProperty,IM=Object.getOwnPropertyDescriptor,jM=function(e){return typeof Array.isArray=="function"?Array.isArray(e):e9.call(e)==="[object Array]"},BM=function(e){if(!e||e9.call(e)!=="[object Object]")return!1;var n=hy.call(e,"constructor"),r=e.constructor&&e.constructor.prototype&&hy.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!r)return!1;var i;for(i in e);return typeof i>"u"||hy.call(e,i)},FM=function(e,n){$M&&n.name==="__proto__"?$M(e,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):e[n.name]=n.newValue},zM=function(e,n){if(n==="__proto__")if(hy.call(e,n)){if(IM)return IM(e,n).value}else return;return e[n]},lpe=function t(){var e,n,r,i,o,s,a=arguments[0],l=1,c=arguments.length,f=!1;for(typeof a=="boolean"&&(f=a,a=arguments[1]||{},l=2),(a==null||typeof a!="object"&&typeof a!="function")&&(a={});l<c;++l)if(e=arguments[l],e!=null)for(n in e)r=zM(a,n),i=zM(e,n),a!==i&&(f&&i&&(BM(i)||(o=jM(i)))?(o?(o=!1,s=r&&jM(r)?r:[]):s=r&&BM(r)?r:{},FM(a,{name:n,newValue:t(f,s,i)})):typeof i<"u"&&FM(a,{name:n,newValue:i}));return a};const Jx=Su(lpe);function bk(t){if(typeof t!="object"||t===null)return!1;const e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)}function cpe(){const t=[],e={run:n,use:r};return e;function n(...i){let o=-1;const s=i.pop();if(typeof s!="function")throw new TypeError("Expected function as last argument, not "+s);a(null,...i);function a(l,...c){const f=t[++o];let d=-1;if(l){s(l);return}for(;++d<i.length;)(c[d]===null||c[d]===void 0)&&(c[d]=i[d]);i=c,f?upe(f,a)(...c):s(null,...c)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return t.push(i),e}}function upe(t,e){let n;return r;function r(...s){const a=t.length>s.length;let l;a&&s.push(i);try{l=t.apply(this,s)}catch(c){const f=c;if(a&&n)throw f;return i(f)}a||(l instanceof Promise?l.then(o,i):l instanceof Error?i(l):o(l))}function i(s,...a){n||(n=!0,e(s,...a))}function o(s){i(null,s)}}const Ds={basename:fpe,dirname:dpe,extname:hpe,join:ppe,sep:"/"};function fpe(t,e){if(e!==void 0&&typeof e!="string")throw new TypeError('"ext" argument must be a string');zm(t);let n=0,r=-1,i=t.length,o;if(e===void 0||e.length===0||e.length>t.length){for(;i--;)if(t.codePointAt(i)===47){if(o){n=i+1;break}}else r<0&&(o=!0,r=i+1);return r<0?"":t.slice(n,r)}if(e===t)return"";let s=-1,a=e.length-1;for(;i--;)if(t.codePointAt(i)===47){if(o){n=i+1;break}}else s<0&&(o=!0,s=i+1),a>-1&&(t.codePointAt(i)===e.codePointAt(a--)?a<0&&(r=i):(a=-1,r=s));return n===r?r=s:r<0&&(r=t.length),t.slice(n,r)}function dpe(t){if(zm(t),t.length===0)return".";let e=-1,n=t.length,r;for(;--n;)if(t.codePointAt(n)===47){if(r){e=n;break}}else r||(r=!0);return e<0?t.codePointAt(0)===47?"/":".":e===1&&t.codePointAt(0)===47?"//":t.slice(0,e)}function hpe(t){zm(t);let e=t.length,n=-1,r=0,i=-1,o=0,s;for(;e--;){const a=t.codePointAt(e);if(a===47){if(s){r=e+1;break}continue}n<0&&(s=!0,n=e+1),a===46?i<0?i=e:o!==1&&(o=1):i>-1&&(o=-1)}return i<0||n<0||o===0||o===1&&i===n-1&&i===r+1?"":t.slice(i,n)}function ppe(...t){let e=-1,n;for(;++e<t.length;)zm(t[e]),t[e]&&(n=n===void 0?t[e]:n+"/"+t[e]);return n===void 0?".":mpe(n)}function mpe(t){zm(t);const e=t.codePointAt(0)===47;let n=gpe(t,!e);return n.length===0&&!e&&(n="."),n.length>0&&t.codePointAt(t.length-1)===47&&(n+="/"),e?"/"+n:n}function gpe(t,e){let n="",r=0,i=-1,o=0,s=-1,a,l;for(;++s<=t.length;){if(s<t.length)a=t.codePointAt(s);else{if(a===47)break;a=47}if(a===47){if(!(i===s-1||o===1))if(i!==s-1&&o===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(l=n.lastIndexOf("/"),l!==n.length-1){l<0?(n="",r=0):(n=n.slice(0,l),r=n.length-1-n.lastIndexOf("/")),i=s,o=0;continue}}else if(n.length>0){n="",r=0,i=s,o=0;continue}}e&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+t.slice(i+1,s):n=t.slice(i+1,s),r=s-i-1;i=s,o=0}else a===46&&o>-1?o++:o=-1}return n}function zm(t){if(typeof t!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}const vpe={cwd:ype};function ype(){return"/"}function wk(t){return!!(t!==null&&typeof t=="object"&&"href"in t&&t.href&&"protocol"in t&&t.protocol&&t.auth===void 0)}function bpe(t){if(typeof t=="string")t=new URL(t);else if(!wk(t)){const e=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+t+"`");throw e.code="ERR_INVALID_ARG_TYPE",e}if(t.protocol!=="file:"){const e=new TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return wpe(t)}function wpe(t){if(t.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const e=t.pathname;let n=-1;for(;++n<e.length;)if(e.codePointAt(n)===37&&e.codePointAt(n+1)===50){const r=e.codePointAt(n+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(e)}const eS=["history","path","basename","stem","extname","dirname"];class t9{constructor(e){let n;e?wk(e)?n={path:e}:typeof e=="string"||xpe(e)?n={value:e}:n=e:n={},this.cwd=vpe.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<eS.length;){const o=eS[r];o in n&&n[o]!==void 0&&n[o]!==null&&(this[o]=o==="history"?[...n[o]]:n[o])}let i;for(i in n)eS.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?Ds.basename(this.path):void 0}set basename(e){nS(e,"basename"),tS(e,"basename"),this.path=Ds.join(this.dirname||"",e)}get dirname(){return typeof this.path=="string"?Ds.dirname(this.path):void 0}set dirname(e){VM(this.basename,"dirname"),this.path=Ds.join(e||"",this.basename)}get extname(){return typeof this.path=="string"?Ds.extname(this.path):void 0}set extname(e){if(tS(e,"extname"),VM(this.dirname,"extname"),e){if(e.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(e.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Ds.join(this.dirname,this.stem+(e||""))}get path(){return this.history[this.history.length-1]}set path(e){wk(e)&&(e=bpe(e)),nS(e,"path"),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path=="string"?Ds.basename(this.path,this.extname):void 0}set stem(e){nS(e,"stem"),tS(e,"stem"),this.path=Ds.join(this.dirname||"",e+(this.extname||""))}fail(e,n,r){const i=this.message(e,n,r);throw i.fatal=!0,i}info(e,n,r){const i=this.message(e,n,r);return i.fatal=void 0,i}message(e,n,r){const i=new Qr(e,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(e){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(e||void 0).decode(this.value)}}function tS(t,e){if(t&&t.includes(Ds.sep))throw new Error("`"+e+"` cannot be a path: did not expect `"+Ds.sep+"`")}function nS(t,e){if(!t)throw new Error("`"+e+"` cannot be empty")}function VM(t,e){if(!t)throw new Error("Setting `"+e+"` requires `path` to be set too")}function xpe(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const Spe=function(t){const r=this.constructor.prototype,i=r[t],o=function(){return i.apply(o,arguments)};Object.setPrototypeOf(o,r);const s=Object.getOwnPropertyNames(i);for(const a of s){const l=Object.getOwnPropertyDescriptor(i,a);l&&Object.defineProperty(o,a,l)}return o},Cpe={}.hasOwnProperty;class tT extends Spe{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=cpe()}copy(){const e=new tT;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];e.use(...r)}return e.data(Jx(!0,{},this.namespace)),e}data(e,n){return typeof e=="string"?arguments.length===2?(oS("data",this.frozen),this.namespace[e]=n,this):Cpe.call(this.namespace,e)&&this.namespace[e]||void 0:e?(oS("data",this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;const e=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=n.call(e,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(e){this.freeze();const n=gv(e),r=this.parser||this.Parser;return rS("parse",r),r(String(n),n)}process(e,n){const r=this;return this.freeze(),rS("process",this.parser||this.Parser),iS("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(o,s){const a=gv(e),l=r.parse(a);r.run(l,a,function(f,d,p){if(f||!d||!p)return c(f);const m=d,v=r.stringify(m,p);_pe(v)?p.value=v:p.result=v,c(f,p)});function c(f,d){f||!d?s(f):o?o(d):n(void 0,d)}}}processSync(e){let n=!1,r;return this.freeze(),rS("processSync",this.parser||this.Parser),iS("processSync",this.compiler||this.Compiler),this.process(e,i),WM("processSync","process",n),r;function i(o,s){n=!0,LM(o),r=s}}run(e,n,r){UM(e),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?o(void 0,r):new Promise(o);function o(s,a){const l=gv(n);i.run(e,l,c);function c(f,d,p){const m=d||e;f?a(f):s?s(m):r(void 0,m,p)}}}runSync(e,n){let r=!1,i;return this.run(e,n,o),WM("runSync","run",r),i;function o(s,a){LM(s),i=a,r=!0}}stringify(e,n){this.freeze();const r=gv(n),i=this.compiler||this.Compiler;return iS("stringify",i),UM(e),i(e,r)}use(e,...n){const r=this.attachers,i=this.namespace;if(oS("use",this.frozen),e!=null)if(typeof e=="function")l(e,n);else if(typeof e=="object")Array.isArray(e)?a(e):s(e);else throw new TypeError("Expected usable value, not `"+e+"`");return this;function o(c){if(typeof c=="function")l(c,[]);else if(typeof c=="object")if(Array.isArray(c)){const[f,...d]=c;l(f,d)}else s(c);else throw new TypeError("Expected usable value, not `"+c+"`")}function s(c){if(!("plugins"in c)&&!("settings"in c))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");a(c.plugins),c.settings&&(i.settings=Jx(!0,i.settings,c.settings))}function a(c){let f=-1;if(c!=null)if(Array.isArray(c))for(;++f<c.length;){const d=c[f];o(d)}else throw new TypeError("Expected a list of plugins, not `"+c+"`")}function l(c,f){let d=-1,p=-1;for(;++d<r.length;)if(r[d][0]===c){p=d;break}if(p===-1)r.push([c,...f]);else if(f.length>0){let[m,...v]=f;const b=r[p][1];bk(b)&&bk(m)&&(m=Jx(!0,b,m)),r[p]=[c,m,...v]}}}}const kpe=new tT().freeze();function rS(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `parser`")}function iS(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `compiler`")}function oS(t,e){if(e)throw new Error("Cannot call `"+t+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function UM(t){if(!bk(t)||typeof t.type!="string")throw new TypeError("Expected node, got `"+t+"`")}function WM(t,e,n){if(!n)throw new Error("`"+t+"` finished async. Use `"+e+"` instead")}function gv(t){return Epe(t)?t:new t9(t)}function Epe(t){return!!(t&&typeof t=="object"&&"message"in t&&"messages"in t)}function _pe(t){return typeof t=="string"||Tpe(t)}function Tpe(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const Ape="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",HM=[],qM={allowDangerousHtml:!0},Ope=/^(https?|ircs?|mailto|xmpp)$/i,Rpe=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function Zo(t){const e=t.allowedElements,n=t.allowElement,r=t.children||"",i=t.className,o=t.components,s=t.disallowedElements,a=t.rehypePlugins||HM,l=t.remarkPlugins||HM,c=t.remarkRehypeOptions?{...t.remarkRehypeOptions,...qM}:qM,f=t.skipHtml,d=t.unwrapDisallowed,p=t.urlTransform||Ppe,m=kpe().use(dhe).use(l).use(ape,c).use(a),v=new t9;typeof r=="string"&&(v.value=r);for(const w of Rpe)Object.hasOwn(t,w.from)&&(""+w.from+(w.to?"use `"+w.to+"` instead":"remove it")+Ape+w.id,void 0);const b=m.parse(v);let S=m.runSync(b,v);return i&&(S={type:"element",tagName:"div",properties:{className:i},children:S.type==="root"?S.children:[S]}),Jj(S,x),Hue(S,{Fragment:k.Fragment,components:o,ignoreInvalidStyle:!0,jsx:k.jsx,jsxs:k.jsxs,passKeys:!0,passNode:!0});function x(w,C,T){if(w.type==="raw"&&T&&typeof C=="number")return f?T.children.splice(C,1):T.children[C]={type:"text",value:w.value},C;if(w.type==="element"){let A;for(A in Xx)if(Object.hasOwn(Xx,A)&&Object.hasOwn(w.properties,A)){const _=w.properties[A],R=Xx[A];(R===null||R.includes(w.tagName))&&(w.properties[A]=p(String(_||""),A,w))}}if(w.type==="element"){let A=e?!e.includes(w.tagName):s?s.includes(w.tagName):!1;if(!A&&n&&typeof C=="number"&&(A=!n(w,C,T)),A&&T&&typeof C=="number")return d&&w.children?T.children.splice(C,1,...w.children):T.children.splice(C,1),C}}}function Ppe(t){const e=t.indexOf(":"),n=t.indexOf("?"),r=t.indexOf("#"),i=t.indexOf("/");return e<0||i>-1&&e>i||n>-1&&e>n||r>-1&&e>r||Ope.test(t.slice(0,e))?t:""}function KM(t,[e,n]){return Math.min(n,Math.max(e,t))}function n9(t){const e=t+"CollectionProvider",[n,r]=Fo(e),[i,o]=n(e,{collectionRef:{current:null},itemMap:new Map}),s=m=>{const{scope:v,children:b}=m,S=ut.useRef(null),x=ut.useRef(new Map).current;return ut.createElement(i,{scope:v,itemMap:x,collectionRef:S},b)},a=t+"CollectionSlot",l=ut.forwardRef((m,v)=>{const{scope:b,children:S}=m,x=o(a,b),w=hn(v,x.collectionRef);return ut.createElement($a,{ref:w},S)}),c=t+"CollectionItemSlot",f="data-radix-collection-item",d=ut.forwardRef((m,v)=>{const{scope:b,children:S,...x}=m,w=ut.useRef(null),C=hn(v,w),T=o(c,b);return ut.useEffect(()=>(T.itemMap.set(w,{ref:w,...x}),()=>void T.itemMap.delete(w))),ut.createElement($a,{[f]:"",ref:C},S)});function p(m){const v=o(t+"CollectionConsumer",m);return ut.useCallback(()=>{const S=v.collectionRef.current;if(!S)return[];const x=Array.from(S.querySelectorAll(`[${f}]`));return Array.from(v.itemMap.values()).sort((T,A)=>x.indexOf(T.ref.current)-x.indexOf(A.ref.current))},[v.collectionRef,v.itemMap])}return[{Provider:s,Slot:l,ItemSlot:d},p,r]}const Npe=g.createContext(void 0);function p1(t){const e=g.useContext(Npe);return t||e||"ltr"}const Mpe=[" ","Enter","ArrowUp","ArrowDown"],Dpe=[" ","Enter"],m1="Select",[g1,v1,Lpe]=n9(m1),[Bd,HCe]=Fo(m1,[Lpe,Td]),nT=Td(),[$pe,Nu]=Bd(m1),[Ipe,jpe]=Bd(m1),Bpe=t=>{const{__scopeSelect:e,children:n,open:r,defaultOpen:i,onOpenChange:o,value:s,defaultValue:a,onValueChange:l,dir:c,name:f,autoComplete:d,disabled:p,required:m}=t,v=nT(e),[b,S]=g.useState(null),[x,w]=g.useState(null),[C,T]=g.useState(!1),A=p1(c),[_=!1,R]=Zs({prop:r,defaultProp:i,onChange:o}),[M,I]=Zs({prop:s,defaultProp:a,onChange:l}),V=g.useRef(null),U=b?!!b.closest("form"):!0,[L,G]=g.useState(new Set),K=Array.from(L).map(F=>F.props.value).join(";");return g.createElement(z_,v,g.createElement($pe,{required:m,scope:e,trigger:b,onTriggerChange:S,valueNode:x,onValueNodeChange:w,valueNodeHasChildren:C,onValueNodeHasChildrenChange:T,contentId:Oa(),value:M,onValueChange:I,open:_,onOpenChange:R,dir:A,triggerPointerDownPosRef:V,disabled:p},g.createElement(g1.Provider,{scope:e},g.createElement(Ipe,{scope:t.__scopeSelect,onNativeOptionAdd:g.useCallback(F=>{G(ie=>new Set(ie).add(F))},[]),onNativeOptionRemove:g.useCallback(F=>{G(ie=>{const ae=new Set(ie);return ae.delete(F),ae})},[])},n)),U?g.createElement(s9,{key:K,"aria-hidden":!0,required:m,tabIndex:-1,name:f,autoComplete:d,value:M,onChange:F=>I(F.target.value),disabled:p},M===void 0?g.createElement("option",{value:""}):null,Array.from(L)):null))},Fpe="SelectTrigger",zpe=g.forwardRef((t,e)=>{const{__scopeSelect:n,disabled:r=!1,...i}=t,o=nT(n),s=Nu(Fpe,n),a=s.disabled||r,l=hn(e,s.onTriggerChange),c=v1(n),[f,d,p]=a9(v=>{const b=c().filter(w=>!w.disabled),S=b.find(w=>w.value===s.value),x=l9(b,v,S);x!==void 0&&s.onValueChange(x.value)}),m=()=>{a||(s.onOpenChange(!0),p())};return g.createElement(V_,H({asChild:!0},o),g.createElement(Dt.button,H({type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":s.value===void 0?"":void 0},i,{ref:l,onClick:yt(i.onClick,v=>{v.currentTarget.focus()}),onPointerDown:yt(i.onPointerDown,v=>{const b=v.target;b.hasPointerCapture(v.pointerId)&&b.releasePointerCapture(v.pointerId),v.button===0&&v.ctrlKey===!1&&(m(),s.triggerPointerDownPosRef.current={x:Math.round(v.pageX),y:Math.round(v.pageY)},v.preventDefault())}),onKeyDown:yt(i.onKeyDown,v=>{const b=f.current!=="";!(v.ctrlKey||v.altKey||v.metaKey)&&v.key.length===1&&d(v.key),!(b&&v.key===" ")&&Mpe.includes(v.key)&&(m(),v.preventDefault())})})))}),Vpe="SelectValue",Upe=g.forwardRef((t,e)=>{const{__scopeSelect:n,className:r,style:i,children:o,placeholder:s,...a}=t,l=Nu(Vpe,n),{onValueNodeHasChildrenChange:c}=l,f=o!==void 0,d=hn(e,l.onValueNodeChange);return Pi(()=>{c(f)},[c,f]),g.createElement(Dt.span,H({},a,{ref:d,style:{pointerEvents:"none"}}),l.value===void 0&&s!==void 0?s:o)}),Wpe=g.forwardRef((t,e)=>{const{__scopeSelect:n,children:r,...i}=t;return g.createElement(Dt.span,H({"aria-hidden":!0},i,{ref:e}),r||"▼")}),Hpe=t=>g.createElement(jb,H({asChild:!0},t)),dd="SelectContent",qpe=g.forwardRef((t,e)=>{const n=Nu(dd,t.__scopeSelect),[r,i]=g.useState();if(Pi(()=>{i(new DocumentFragment)},[]),!n.open){const o=r;return o?na.createPortal(g.createElement(r9,{scope:t.__scopeSelect},g.createElement(g1.Slot,{scope:t.__scopeSelect},g.createElement("div",null,t.children))),o):null}return g.createElement(Kpe,H({},t,{ref:e}))}),xa=10,[r9,Mu]=Bd(dd),Kpe=g.forwardRef((t,e)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:o,onPointerDownOutside:s,side:a,sideOffset:l,align:c,alignOffset:f,arrowPadding:d,collisionBoundary:p,collisionPadding:m,sticky:v,hideWhenDetached:b,avoidCollisions:S,...x}=t,w=Nu(dd,n),[C,T]=g.useState(null),[A,_]=g.useState(null),R=hn(e,Ie=>T(Ie)),[M,I]=g.useState(null),[V,U]=g.useState(null),L=v1(n),[G,K]=g.useState(!1),F=g.useRef(!1);g.useEffect(()=>{if(C)return Qb(C)},[C]),S2();const ie=g.useCallback(Ie=>{const[J,...Se]=L().map(oe=>oe.ref.current),[Ee]=Se.slice(-1),ke=document.activeElement;for(const oe of Ie)if(oe===ke||(oe==null||oe.scrollIntoView({block:"nearest"}),oe===J&&A&&(A.scrollTop=0),oe===Ee&&A&&(A.scrollTop=A.scrollHeight),oe==null||oe.focus(),document.activeElement!==ke))return},[L,A]),ae=g.useCallback(()=>ie([M,C]),[ie,M,C]);g.useEffect(()=>{G&&ae()},[G,ae]);const{onOpenChange:re,triggerPointerDownPosRef:W}=w;g.useEffect(()=>{if(C){let Ie={x:0,y:0};const J=Ee=>{var ke,oe,se,ue;Ie={x:Math.abs(Math.round(Ee.pageX)-((ke=(oe=W.current)===null||oe===void 0?void 0:oe.x)!==null&&ke!==void 0?ke:0)),y:Math.abs(Math.round(Ee.pageY)-((se=(ue=W.current)===null||ue===void 0?void 0:ue.y)!==null&&se!==void 0?se:0))}},Se=Ee=>{Ie.x<=10&&Ie.y<=10?Ee.preventDefault():C.contains(Ee.target)||re(!1),document.removeEventListener("pointermove",J),W.current=null};return W.current!==null&&(document.addEventListener("pointermove",J),document.addEventListener("pointerup",Se,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",J),document.removeEventListener("pointerup",Se,{capture:!0})}}},[C,re,W]),g.useEffect(()=>{const Ie=()=>re(!1);return window.addEventListener("blur",Ie),window.addEventListener("resize",Ie),()=>{window.removeEventListener("blur",Ie),window.removeEventListener("resize",Ie)}},[re]);const[P,he]=a9(Ie=>{const J=L().filter(ke=>!ke.disabled),Se=J.find(ke=>ke.ref.current===document.activeElement),Ee=l9(J,Ie,Se);Ee&&setTimeout(()=>Ee.ref.current.focus())}),fe=g.useCallback((Ie,J,Se)=>{const Ee=!F.current&&!Se;(w.value!==void 0&&w.value===J||Ee)&&(I(Ie),Ee&&(F.current=!0))},[w.value]),$=g.useCallback(()=>C==null?void 0:C.focus(),[C]),Ne=g.useCallback((Ie,J,Se)=>{const Ee=!F.current&&!Se;(w.value!==void 0&&w.value===J||Ee)&&U(Ie)},[w.value]),He=r==="popper"?GM:Gpe,Ye=He===GM?{side:a,sideOffset:l,align:c,alignOffset:f,arrowPadding:d,collisionBoundary:p,collisionPadding:m,sticky:v,hideWhenDetached:b,avoidCollisions:S}:{};return g.createElement(r9,{scope:n,content:C,viewport:A,onViewportChange:_,itemRefCallback:fe,selectedItem:M,onItemLeave:$,itemTextRefCallback:Ne,focusSelectedItem:ae,selectedItemText:V,position:r,isPositioned:G,searchRef:P},g.createElement(k2,{as:$a,allowPinchZoom:!0},g.createElement(x2,{asChild:!0,trapped:w.open,onMountAutoFocus:Ie=>{Ie.preventDefault()},onUnmountAutoFocus:yt(i,Ie=>{var J;(J=w.trigger)===null||J===void 0||J.focus({preventScroll:!0}),Ie.preventDefault()})},g.createElement(Db,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:Ie=>Ie.preventDefault(),onDismiss:()=>w.onOpenChange(!1)},g.createElement(He,H({role:"listbox",id:w.contentId,"data-state":w.open?"open":"closed",dir:w.dir,onContextMenu:Ie=>Ie.preventDefault()},x,Ye,{onPlaced:()=>K(!0),ref:R,style:{display:"flex",flexDirection:"column",outline:"none",...x.style},onKeyDown:yt(x.onKeyDown,Ie=>{const J=Ie.ctrlKey||Ie.altKey||Ie.metaKey;if(Ie.key==="Tab"&&Ie.preventDefault(),!J&&Ie.key.length===1&&he(Ie.key),["ArrowUp","ArrowDown","Home","End"].includes(Ie.key)){let Ee=L().filter(ke=>!ke.disabled).map(ke=>ke.ref.current);if(["ArrowUp","End"].includes(Ie.key)&&(Ee=Ee.slice().reverse()),["ArrowUp","ArrowDown"].includes(Ie.key)){const ke=Ie.target,oe=Ee.indexOf(ke);Ee=Ee.slice(oe+1)}setTimeout(()=>ie(Ee)),Ie.preventDefault()}})}))))))}),Gpe=g.forwardRef((t,e)=>{const{__scopeSelect:n,onPlaced:r,...i}=t,o=Nu(dd,n),s=Mu(dd,n),[a,l]=g.useState(null),[c,f]=g.useState(null),d=hn(e,R=>f(R)),p=v1(n),m=g.useRef(!1),v=g.useRef(!0),{viewport:b,selectedItem:S,selectedItemText:x,focusSelectedItem:w}=s,C=g.useCallback(()=>{if(o.trigger&&o.valueNode&&a&&c&&b&&S&&x){const R=o.trigger.getBoundingClientRect(),M=c.getBoundingClientRect(),I=o.valueNode.getBoundingClientRect(),V=x.getBoundingClientRect();if(o.dir!=="rtl"){const ke=V.left-M.left,oe=I.left-ke,se=R.left-oe,ue=R.width+se,we=Math.max(ue,M.width),nt=window.innerWidth-xa,et=KM(oe,[xa,nt-we]);a.style.minWidth=ue+"px",a.style.left=et+"px"}else{const ke=M.right-V.right,oe=window.innerWidth-I.right-ke,se=window.innerWidth-R.right-oe,ue=R.width+se,we=Math.max(ue,M.width),nt=window.innerWidth-xa,et=KM(oe,[xa,nt-we]);a.style.minWidth=ue+"px",a.style.right=et+"px"}const U=p(),L=window.innerHeight-xa*2,G=b.scrollHeight,K=window.getComputedStyle(c),F=parseInt(K.borderTopWidth,10),ie=parseInt(K.paddingTop,10),ae=parseInt(K.borderBottomWidth,10),re=parseInt(K.paddingBottom,10),W=F+ie+G+re+ae,P=Math.min(S.offsetHeight*5,W),he=window.getComputedStyle(b),fe=parseInt(he.paddingTop,10),$=parseInt(he.paddingBottom,10),Ne=R.top+R.height/2-xa,He=L-Ne,Ye=S.offsetHeight/2,Ie=S.offsetTop+Ye,J=F+ie+Ie,Se=W-J;if(J<=Ne){const ke=S===U[U.length-1].ref.current;a.style.bottom="0px";const oe=c.clientHeight-b.offsetTop-b.offsetHeight,se=Math.max(He,Ye+(ke?$:0)+oe+ae),ue=J+se;a.style.height=ue+"px"}else{const ke=S===U[0].ref.current;a.style.top="0px";const se=Math.max(Ne,F+b.offsetTop+(ke?fe:0)+Ye)+Se;a.style.height=se+"px",b.scrollTop=J-Ne+b.offsetTop}a.style.margin=`${xa}px 0`,a.style.minHeight=P+"px",a.style.maxHeight=L+"px",r==null||r(),requestAnimationFrame(()=>m.current=!0)}},[p,o.trigger,o.valueNode,a,c,b,S,x,o.dir,r]);Pi(()=>C(),[C]);const[T,A]=g.useState();Pi(()=>{c&&A(window.getComputedStyle(c).zIndex)},[c]);const _=g.useCallback(R=>{R&&v.current===!0&&(C(),w==null||w(),v.current=!1)},[C,w]);return g.createElement(Ype,{scope:n,contentWrapper:a,shouldExpandOnScrollRef:m,onScrollButtonChange:_},g.createElement("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:T}},g.createElement(Dt.div,H({},i,{ref:d,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}}))))}),GM=g.forwardRef((t,e)=>{const{__scopeSelect:n,align:r="start",collisionPadding:i=xa,...o}=t,s=nT(n);return g.createElement(U_,H({},s,o,{ref:e,align:r,collisionPadding:i,style:{boxSizing:"border-box",...o.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}}))}),[Ype,rT]=Bd(dd,{}),YM="SelectViewport",Xpe=g.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t,i=Mu(YM,n),o=rT(YM,n),s=hn(e,i.onViewportChange),a=g.useRef(0);return g.createElement(g.Fragment,null,g.createElement("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"}}),g.createElement(g1.Slot,{scope:n},g.createElement(Dt.div,H({"data-radix-select-viewport":"",role:"presentation"},r,{ref:s,style:{position:"relative",flex:1,overflow:"auto",...r.style},onScroll:yt(r.onScroll,l=>{const c=l.currentTarget,{contentWrapper:f,shouldExpandOnScrollRef:d}=o;if(d!=null&&d.current&&f){const p=Math.abs(a.current-c.scrollTop);if(p>0){const m=window.innerHeight-xa*2,v=parseFloat(f.style.minHeight),b=parseFloat(f.style.height),S=Math.max(v,b);if(S<m){const x=S+p,w=Math.min(m,x),C=x-w;f.style.height=w+"px",f.style.bottom==="0px"&&(c.scrollTop=C>0?C:0,f.style.justifyContent="flex-end")}}}a.current=c.scrollTop})}))))}),Zpe="SelectGroup",[qCe,Qpe]=Bd(Zpe),Jpe="SelectLabel",eme=g.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t,i=Qpe(Jpe,n);return g.createElement(Dt.div,H({id:i.id},r,{ref:e}))}),xk="SelectItem",[tme,i9]=Bd(xk),nme=g.forwardRef((t,e)=>{const{__scopeSelect:n,value:r,disabled:i=!1,textValue:o,...s}=t,a=Nu(xk,n),l=Mu(xk,n),c=a.value===r,[f,d]=g.useState(o??""),[p,m]=g.useState(!1),v=hn(e,x=>{var w;return(w=l.itemRefCallback)===null||w===void 0?void 0:w.call(l,x,r,i)}),b=Oa(),S=()=>{i||(a.onValueChange(r),a.onOpenChange(!1))};return g.createElement(tme,{scope:n,value:r,disabled:i,textId:b,isSelected:c,onItemTextChange:g.useCallback(x=>{d(w=>{var C;return w||((C=x==null?void 0:x.textContent)!==null&&C!==void 0?C:"").trim()})},[])},g.createElement(g1.ItemSlot,{scope:n,value:r,disabled:i,textValue:f},g.createElement(Dt.div,H({role:"option","aria-labelledby":b,"data-highlighted":p?"":void 0,"aria-selected":c&&p,"data-state":c?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1},s,{ref:v,onFocus:yt(s.onFocus,()=>m(!0)),onBlur:yt(s.onBlur,()=>m(!1)),onPointerUp:yt(s.onPointerUp,S),onPointerMove:yt(s.onPointerMove,x=>{if(i){var w;(w=l.onItemLeave)===null||w===void 0||w.call(l)}else x.currentTarget.focus({preventScroll:!0})}),onPointerLeave:yt(s.onPointerLeave,x=>{if(x.currentTarget===document.activeElement){var w;(w=l.onItemLeave)===null||w===void 0||w.call(l)}}),onKeyDown:yt(s.onKeyDown,x=>{var w;((w=l.searchRef)===null||w===void 0?void 0:w.current)!==""&&x.key===" "||(Dpe.includes(x.key)&&S(),x.key===" "&&x.preventDefault())})}))))}),vv="SelectItemText",rme=g.forwardRef((t,e)=>{const{__scopeSelect:n,className:r,style:i,...o}=t,s=Nu(vv,n),a=Mu(vv,n),l=i9(vv,n),c=jpe(vv,n),[f,d]=g.useState(null),p=hn(e,x=>d(x),l.onItemTextChange,x=>{var w;return(w=a.itemTextRefCallback)===null||w===void 0?void 0:w.call(a,x,l.value,l.disabled)}),m=f==null?void 0:f.textContent,v=g.useMemo(()=>g.createElement("option",{key:l.value,value:l.value,disabled:l.disabled},m),[l.disabled,l.value,m]),{onNativeOptionAdd:b,onNativeOptionRemove:S}=c;return Pi(()=>(b(v),()=>S(v)),[b,S,v]),g.createElement(g.Fragment,null,g.createElement(Dt.span,H({id:l.textId},o,{ref:p})),l.isSelected&&s.valueNode&&!s.valueNodeHasChildren?na.createPortal(o.children,s.valueNode):null)}),ime="SelectItemIndicator",ome=g.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t;return i9(ime,n).isSelected?g.createElement(Dt.span,H({"aria-hidden":!0},r,{ref:e})):null}),XM="SelectScrollUpButton",sme=g.forwardRef((t,e)=>{const n=Mu(XM,t.__scopeSelect),r=rT(XM,t.__scopeSelect),[i,o]=g.useState(!1),s=hn(e,r.onScrollButtonChange);return Pi(()=>{if(n.viewport&&n.isPositioned){let c=function(){const f=l.scrollTop>0;o(f)};var a=c;const l=n.viewport;return c(),l.addEventListener("scroll",c),()=>l.removeEventListener("scroll",c)}},[n.viewport,n.isPositioned]),i?g.createElement(o9,H({},t,{ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=n;a&&l&&(a.scrollTop=a.scrollTop-l.offsetHeight)}})):null}),ZM="SelectScrollDownButton",ame=g.forwardRef((t,e)=>{const n=Mu(ZM,t.__scopeSelect),r=rT(ZM,t.__scopeSelect),[i,o]=g.useState(!1),s=hn(e,r.onScrollButtonChange);return Pi(()=>{if(n.viewport&&n.isPositioned){let c=function(){const f=l.scrollHeight-l.clientHeight,d=Math.ceil(l.scrollTop)<f;o(d)};var a=c;const l=n.viewport;return c(),l.addEventListener("scroll",c),()=>l.removeEventListener("scroll",c)}},[n.viewport,n.isPositioned]),i?g.createElement(o9,H({},t,{ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=n;a&&l&&(a.scrollTop=a.scrollTop+l.offsetHeight)}})):null}),o9=g.forwardRef((t,e)=>{const{__scopeSelect:n,onAutoScroll:r,...i}=t,o=Mu("SelectScrollButton",n),s=g.useRef(null),a=v1(n),l=g.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return g.useEffect(()=>()=>l(),[l]),Pi(()=>{var c;const f=a().find(d=>d.ref.current===document.activeElement);f==null||(c=f.ref.current)===null||c===void 0||c.scrollIntoView({block:"nearest"})},[a]),g.createElement(Dt.div,H({"aria-hidden":!0},i,{ref:e,style:{flexShrink:0,...i.style},onPointerDown:yt(i.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(r,50))}),onPointerMove:yt(i.onPointerMove,()=>{var c;(c=o.onItemLeave)===null||c===void 0||c.call(o),s.current===null&&(s.current=window.setInterval(r,50))}),onPointerLeave:yt(i.onPointerLeave,()=>{l()})}))}),lme=g.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t;return g.createElement(Dt.div,H({"aria-hidden":!0},r,{ref:e}))}),s9=g.forwardRef((t,e)=>{const{value:n,...r}=t,i=g.useRef(null),o=hn(e,i),s=i1(n);return g.useEffect(()=>{const a=i.current,l=window.HTMLSelectElement.prototype,f=Object.getOwnPropertyDescriptor(l,"value").set;if(s!==n&&f){const d=new Event("change",{bubbles:!0});f.call(a,n),a.dispatchEvent(d)}},[s,n]),g.createElement(w3,{asChild:!0},g.createElement("select",H({},r,{ref:o,defaultValue:n})))});s9.displayName="BubbleSelect";function a9(t){const e=Ys(t),n=g.useRef(""),r=g.useRef(0),i=g.useCallback(s=>{const a=n.current+s;e(a),function l(c){n.current=c,window.clearTimeout(r.current),c!==""&&(r.current=window.setTimeout(()=>l(""),1e3))}(a)},[e]),o=g.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return g.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,o]}function l9(t,e,n){const i=e.length>1&&Array.from(e).every(c=>c===e[0])?e[0]:e,o=n?t.indexOf(n):-1;let s=cme(t,Math.max(o,0));i.length===1&&(s=s.filter(c=>c!==n));const l=s.find(c=>c.textValue.toLowerCase().startsWith(i.toLowerCase()));return l!==n?l:void 0}function cme(t,e){return t.map((n,r)=>t[(e+r)%t.length])}const ume=Bpe,c9=zpe,fme=Upe,dme=Wpe,hme=Hpe,u9=qpe,pme=Xpe,f9=eme,d9=nme,mme=rme,gme=ome,h9=sme,p9=ame,m9=lme,g9=ume,v9=fme,iT=g.forwardRef(({className:t,children:e,...n},r)=>k.jsxs(c9,{ref:r,className:ft("border-input ring-offset-background placeholder:text-muted-foreground focus:ring-ring flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border bg-transparent px-3 py-2 text-sm shadow-sm focus:outline-none focus:ring-1 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",t),...n,children:[e,k.jsx(dme,{asChild:!0,children:k.jsx(One,{className:"h-4 w-4 opacity-50"})})]}));iT.displayName=c9.displayName;const y9=g.forwardRef(({className:t,...e},n)=>k.jsx(h9,{ref:n,className:ft("flex cursor-default items-center justify-center py-1",t),...e,children:k.jsx(Dne,{})}));y9.displayName=h9.displayName;const b9=g.forwardRef(({className:t,...e},n)=>k.jsx(p9,{ref:n,className:ft("flex cursor-default items-center justify-center py-1",t),...e,children:k.jsx(Nne,{})}));b9.displayName=p9.displayName;const oT=g.forwardRef(({className:t,children:e,position:n="popper",...r},i)=>k.jsx(hme,{children:k.jsxs(u9,{ref:i,className:ft("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border shadow-md",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:n,...r,children:[k.jsx(y9,{}),k.jsx(pme,{className:ft("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:e}),k.jsx(b9,{})]})}));oT.displayName=u9.displayName;const vme=g.forwardRef(({className:t,...e},n)=>k.jsx(f9,{ref:n,className:ft("px-2 py-1.5 text-sm font-semibold",t),...e}));vme.displayName=f9.displayName;const Rc=g.forwardRef(({className:t,children:e,...n},r)=>k.jsxs(d9,{ref:r,className:ft("focus:bg-accent focus:text-accent-foreground relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...n,children:[k.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:k.jsx(gme,{children:k.jsx(u2,{className:"h-4 w-4"})})}),k.jsx(mme,{children:e})]}));Rc.displayName=d9.displayName;const yme=g.forwardRef(({className:t,...e},n)=>k.jsx(m9,{ref:n,className:ft("bg-muted -mx-1 my-1 h-px",t),...e}));yme.displayName=m9.displayName;var bme=g.useLayoutEffect,wme=function(e){var n=g.useRef(e);return bme(function(){n.current=e}),n},QM=function(e,n){if(typeof e=="function"){e(n);return}e.current=n},xme=function(e,n){var r=g.useRef();return g.useCallback(function(i){e.current=i,r.current&&QM(r.current,null),r.current=n,n&&QM(n,i)},[n])},JM={"min-height":"0","max-height":"none",height:"0",visibility:"hidden",overflow:"hidden",position:"absolute","z-index":"-1000",top:"0",right:"0"},Sme=function(e){Object.keys(JM).forEach(function(n){e.style.setProperty(n,JM[n],"important")})},eD=Sme,oi=null,tD=function(e,n){var r=e.scrollHeight;return n.sizingStyle.boxSizing==="border-box"?r+n.borderSize:r-n.paddingSize};function Cme(t,e,n,r){n===void 0&&(n=1),r===void 0&&(r=1/0),oi||(oi=document.createElement("textarea"),oi.setAttribute("tabindex","-1"),oi.setAttribute("aria-hidden","true"),eD(oi)),oi.parentNode===null&&document.body.appendChild(oi);var i=t.paddingSize,o=t.borderSize,s=t.sizingStyle,a=s.boxSizing;Object.keys(s).forEach(function(p){var m=p;oi.style[m]=s[m]}),eD(oi),oi.value=e;var l=tD(oi,t);oi.value=e,l=tD(oi,t),oi.value="x";var c=oi.scrollHeight-i,f=c*n;a==="border-box"&&(f=f+i+o),l=Math.max(f,l);var d=c*r;return a==="border-box"&&(d=d+i+o),l=Math.min(d,l),[l,c]}var nD=function(){},kme=function(e,n){return e.reduce(function(r,i){return r[i]=n[i],r},{})},Eme=["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth","boxSizing","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","lineHeight","paddingBottom","paddingLeft","paddingRight","paddingTop","tabSize","textIndent","textRendering","textTransform","width","wordBreak"],_me=!!document.documentElement.currentStyle,Tme=function(e){var n=window.getComputedStyle(e);if(n===null)return null;var r=kme(Eme,n),i=r.boxSizing;if(i==="")return null;_me&&i==="border-box"&&(r.width=parseFloat(r.width)+parseFloat(r.borderRightWidth)+parseFloat(r.borderLeftWidth)+parseFloat(r.paddingRight)+parseFloat(r.paddingLeft)+"px");var o=parseFloat(r.paddingBottom)+parseFloat(r.paddingTop),s=parseFloat(r.borderBottomWidth)+parseFloat(r.borderTopWidth);return{sizingStyle:r,paddingSize:o,borderSize:s}},Ame=Tme;function w9(t,e,n){var r=wme(n);g.useLayoutEffect(function(){var i=function(s){return r.current(s)};if(t)return t.addEventListener(e,i),function(){return t.removeEventListener(e,i)}},[])}var Ome=function(e){w9(window,"resize",e)},Rme=function(e){w9(document.fonts,"loadingdone",e)},Pme=["cacheMeasurements","maxRows","minRows","onChange","onHeightChange"],Nme=function(e,n){var r=e.cacheMeasurements,i=e.maxRows,o=e.minRows,s=e.onChange,a=s===void 0?nD:s,l=e.onHeightChange,c=l===void 0?nD:l,f=Bt(e,Pme),d=f.value!==void 0,p=g.useRef(null),m=xme(p,n),v=g.useRef(0),b=g.useRef(),S=function(){var C=p.current,T=r&&b.current?b.current:Ame(C);if(T){b.current=T;var A=Cme(T,C.value||C.placeholder||"x",o,i),_=A[0],R=A[1];v.current!==_&&(v.current=_,C.style.setProperty("height",_+"px","important"),c(_,{rowHeight:R}))}},x=function(C){d||S(),a(C)};return g.useLayoutEffect(S),Ome(S),Rme(S),g.createElement("textarea",H({},f,{onChange:x,ref:m}))},Mme=g.forwardRef(Nme);const B0=g.forwardRef(({className:t,...e},n)=>k.jsx(Mme,{className:ft("border-input placeholder:text-muted-foreground focus-visible:ring-ring flex h-[34px] w-full rounded-md border bg-transparent px-3 py-2 text-sm shadow-sm focus-visible:outline-none focus-visible:ring-1 disabled:cursor-not-allowed disabled:opacity-50",t),ref:n,...e}));B0.displayName="TextareaAutosize";const Ah=t=>k.jsxs(Ls,{children:[k.jsx($s,{asChild:!0,children:k.jsx(Tn,{variant:"plain",size:"icon",className:ft("h-8 w-8",t.className,{"text-destructive":t.locateStatus===Us.FAILED}),disabled:t.locateStatus===Us.LOCATING||t.disabled,onClick:()=>{var e;(e=t.onLocate)==null||e.call(t)},children:t.locateStatus===Us.LOCATING?k.jsx(o6,{className:"h-7 w-7 animate-spin",strokeWidth:1}):k.jsx(wse,{className:"h-7 w-7",strokeWidth:1})})}),k.jsx(Cc,{children:k.jsx(ss,{side:"bottom",className:"max-w-xs",children:t.locateStatus===Us.FAILED?"Failed to locate element. This may be due to the element not present on the page or accessibility issues.":"Locate element"})})]}),sS="rovingFocusGroup.onEntryFocus",Dme={bubbles:!1,cancelable:!0},sT="RovingFocusGroup",[Sk,x9,Lme]=n9(sT),[$me,y1]=Fo(sT,[Lme]),[Ime,jme]=$me(sT),Bme=g.forwardRef((t,e)=>g.createElement(Sk.Provider,{scope:t.__scopeRovingFocusGroup},g.createElement(Sk.Slot,{scope:t.__scopeRovingFocusGroup},g.createElement(Fme,H({},t,{ref:e}))))),Fme=g.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:o,currentTabStopId:s,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:c,...f}=t,d=g.useRef(null),p=hn(e,d),m=p1(o),[v=null,b]=Zs({prop:s,defaultProp:a,onChange:l}),[S,x]=g.useState(!1),w=Ys(c),C=x9(n),T=g.useRef(!1),[A,_]=g.useState(0);return g.useEffect(()=>{const R=d.current;if(R)return R.addEventListener(sS,w),()=>R.removeEventListener(sS,w)},[w]),g.createElement(Ime,{scope:n,orientation:r,dir:m,loop:i,currentTabStopId:v,onItemFocus:g.useCallback(R=>b(R),[b]),onItemShiftTab:g.useCallback(()=>x(!0),[]),onFocusableItemAdd:g.useCallback(()=>_(R=>R+1),[]),onFocusableItemRemove:g.useCallback(()=>_(R=>R-1),[])},g.createElement(Dt.div,H({tabIndex:S||A===0?-1:0,"data-orientation":r},f,{ref:p,style:{outline:"none",...t.style},onMouseDown:yt(t.onMouseDown,()=>{T.current=!0}),onFocus:yt(t.onFocus,R=>{const M=!T.current;if(R.target===R.currentTarget&&M&&!S){const I=new CustomEvent(sS,Dme);if(R.currentTarget.dispatchEvent(I),!I.defaultPrevented){const V=C().filter(F=>F.focusable),U=V.find(F=>F.active),L=V.find(F=>F.id===v),K=[U,L,...V].filter(Boolean).map(F=>F.ref.current);S9(K)}}T.current=!1}),onBlur:yt(t.onBlur,()=>x(!1))})))}),zme="RovingFocusGroupItem",Vme=g.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:o,...s}=t,a=Oa(),l=o||a,c=jme(zme,n),f=c.currentTabStopId===l,d=x9(n),{onFocusableItemAdd:p,onFocusableItemRemove:m}=c;return g.useEffect(()=>{if(r)return p(),()=>m()},[r,p,m]),g.createElement(Sk.ItemSlot,{scope:n,id:l,focusable:r,active:i},g.createElement(Dt.span,H({tabIndex:f?0:-1,"data-orientation":c.orientation},s,{ref:e,onMouseDown:yt(t.onMouseDown,v=>{r?c.onItemFocus(l):v.preventDefault()}),onFocus:yt(t.onFocus,()=>c.onItemFocus(l)),onKeyDown:yt(t.onKeyDown,v=>{if(v.key==="Tab"&&v.shiftKey){c.onItemShiftTab();return}if(v.target!==v.currentTarget)return;const b=Hme(v,c.orientation,c.dir);if(b!==void 0){v.preventDefault();let x=d().filter(w=>w.focusable).map(w=>w.ref.current);if(b==="last")x.reverse();else if(b==="prev"||b==="next"){b==="prev"&&x.reverse();const w=x.indexOf(v.currentTarget);x=c.loop?qme(x,w+1):x.slice(w+1)}setTimeout(()=>S9(x))}})})))}),Ume={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Wme(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function Hme(t,e,n){const r=Wme(t.key,n);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return Ume[r]}function S9(t){const e=document.activeElement;for(const n of t)if(n===e||(n.focus(),document.activeElement!==e))return}function qme(t,e){return t.map((n,r)=>t[(e+r)%t.length])}const C9=Bme,k9=Vme,E9="Radio",[Kme,_9]=Fo(E9),[Gme,Yme]=Kme(E9),Xme=g.forwardRef((t,e)=>{const{__scopeRadio:n,name:r,checked:i=!1,required:o,disabled:s,value:a="on",onCheck:l,...c}=t,[f,d]=g.useState(null),p=hn(e,b=>d(b)),m=g.useRef(!1),v=f?!!f.closest("form"):!0;return g.createElement(Gme,{scope:n,checked:i,disabled:s},g.createElement(Dt.button,H({type:"button",role:"radio","aria-checked":i,"data-state":T9(i),"data-disabled":s?"":void 0,disabled:s,value:a},c,{ref:p,onClick:yt(t.onClick,b=>{i||l==null||l(),v&&(m.current=b.isPropagationStopped(),m.current||b.stopPropagation())})})),v&&g.createElement(Jme,{control:f,bubbles:!m.current,name:r,value:a,checked:i,required:o,disabled:s,style:{transform:"translateX(-100%)"}}))}),Zme="RadioIndicator",Qme=g.forwardRef((t,e)=>{const{__scopeRadio:n,forceMount:r,...i}=t,o=Yme(Zme,n);return g.createElement(ws,{present:r||o.checked},g.createElement(Dt.span,H({"data-state":T9(o.checked),"data-disabled":o.disabled?"":void 0},i,{ref:e})))}),Jme=t=>{const{control:e,checked:n,bubbles:r=!0,...i}=t,o=g.useRef(null),s=i1(n),a=Ib(e);return g.useEffect(()=>{const l=o.current,c=window.HTMLInputElement.prototype,d=Object.getOwnPropertyDescriptor(c,"checked").set;if(s!==n&&d){const p=new Event("click",{bubbles:r});d.call(l,n),l.dispatchEvent(p)}},[s,n,r]),g.createElement("input",H({type:"radio","aria-hidden":!0,defaultChecked:n},i,{tabIndex:-1,ref:o,style:{...t.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function T9(t){return t?"checked":"unchecked"}const ege=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],A9="RadioGroup",[tge,KCe]=Fo(A9,[y1,_9]),O9=y1(),R9=_9(),[nge,rge]=tge(A9),ige=g.forwardRef((t,e)=>{const{__scopeRadioGroup:n,name:r,defaultValue:i,value:o,required:s=!1,disabled:a=!1,orientation:l,dir:c,loop:f=!0,onValueChange:d,...p}=t,m=O9(n),v=p1(c),[b,S]=Zs({prop:o,defaultProp:i,onChange:d});return g.createElement(nge,{scope:n,name:r,required:s,disabled:a,value:b,onValueChange:S},g.createElement(C9,H({asChild:!0},m,{orientation:l,dir:v,loop:f}),g.createElement(Dt.div,H({role:"radiogroup","aria-required":s,"aria-orientation":l,"data-disabled":a?"":void 0,dir:v},p,{ref:e}))))}),oge="RadioGroupItem",sge=g.forwardRef((t,e)=>{const{__scopeRadioGroup:n,disabled:r,...i}=t,o=rge(oge,n),s=o.disabled||r,a=O9(n),l=R9(n),c=g.useRef(null),f=hn(e,c),d=o.value===i.value,p=g.useRef(!1);return g.useEffect(()=>{const m=b=>{ege.includes(b.key)&&(p.current=!0)},v=()=>p.current=!1;return document.addEventListener("keydown",m),document.addEventListener("keyup",v),()=>{document.removeEventListener("keydown",m),document.removeEventListener("keyup",v)}},[]),g.createElement(k9,H({asChild:!0},a,{focusable:!s,active:d}),g.createElement(Xme,H({disabled:s,required:o.required,checked:d},l,i,{name:o.name,ref:f,onCheck:()=>o.onValueChange(i.value),onKeyDown:yt(m=>{m.key==="Enter"&&m.preventDefault()}),onFocus:yt(i.onFocus,()=>{var m;p.current&&((m=c.current)===null||m===void 0||m.click())})})))}),age=g.forwardRef((t,e)=>{const{__scopeRadioGroup:n,...r}=t,i=R9(n);return g.createElement(Qme,H({},i,r,{ref:e}))}),P9=ige,N9=sge,lge=age,M9=g.forwardRef(({className:t,...e},n)=>k.jsx(P9,{className:ft("grid gap-2",t),...e,ref:n}));M9.displayName=P9.displayName;const Ck=g.forwardRef(({className:t,...e},n)=>k.jsx(N9,{ref:n,className:ft("border-primary text-primary focus-visible:ring-ring aspect-square h-4 w-4 rounded-full border shadow focus:outline-none focus-visible:ring-1 disabled:cursor-not-allowed disabled:opacity-50",t),...e,children:k.jsx(lge,{className:"flex items-center justify-center",children:k.jsx(u2,{className:"fill-primary h-3.5 w-3.5"})})}));Ck.displayName=N9.displayName;const D9="Tabs",[cge,GCe]=Fo(D9,[y1]),L9=y1(),[uge,aT]=cge(D9),fge=g.forwardRef((t,e)=>{const{__scopeTabs:n,value:r,onValueChange:i,defaultValue:o,orientation:s="horizontal",dir:a,activationMode:l="automatic",...c}=t,f=p1(a),[d,p]=Zs({prop:r,onChange:i,defaultProp:o});return g.createElement(uge,{scope:n,baseId:Oa(),value:d,onValueChange:p,orientation:s,dir:f,activationMode:l},g.createElement(Dt.div,H({dir:f,"data-orientation":s},c,{ref:e})))}),dge="TabsList",hge=g.forwardRef((t,e)=>{const{__scopeTabs:n,loop:r=!0,...i}=t,o=aT(dge,n),s=L9(n);return g.createElement(C9,H({asChild:!0},s,{orientation:o.orientation,dir:o.dir,loop:r}),g.createElement(Dt.div,H({role:"tablist","aria-orientation":o.orientation},i,{ref:e})))}),pge="TabsTrigger",mge=g.forwardRef((t,e)=>{const{__scopeTabs:n,value:r,disabled:i=!1,...o}=t,s=aT(pge,n),a=L9(n),l=$9(s.baseId,r),c=I9(s.baseId,r),f=r===s.value;return g.createElement(k9,H({asChild:!0},a,{focusable:!i,active:f}),g.createElement(Dt.button,H({type:"button",role:"tab","aria-selected":f,"aria-controls":c,"data-state":f?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:l},o,{ref:e,onMouseDown:yt(t.onMouseDown,d=>{!i&&d.button===0&&d.ctrlKey===!1?s.onValueChange(r):d.preventDefault()}),onKeyDown:yt(t.onKeyDown,d=>{[" ","Enter"].includes(d.key)&&s.onValueChange(r)}),onFocus:yt(t.onFocus,()=>{const d=s.activationMode!=="manual";!f&&!i&&d&&s.onValueChange(r)})})))}),gge="TabsContent",vge=g.forwardRef((t,e)=>{const{__scopeTabs:n,value:r,forceMount:i,children:o,...s}=t,a=aT(gge,n),l=$9(a.baseId,r),c=I9(a.baseId,r),f=r===a.value,d=g.useRef(f);return g.useEffect(()=>{const p=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(p)},[]),g.createElement(ws,{present:i||f},({present:p})=>g.createElement(Dt.div,H({"data-state":f?"active":"inactive","data-orientation":a.orientation,role:"tabpanel","aria-labelledby":l,hidden:!p,id:c,tabIndex:0},s,{ref:e,style:{...t.style,animationDuration:d.current?"0s":void 0}}),p&&o))});function $9(t,e){return`${t}-trigger-${e}`}function I9(t,e){return`${t}-content-${e}`}const yge=fge,j9=hge,B9=mge,F9=vge,bge=yge,z9=g.forwardRef(({className:t,...e},n)=>k.jsx(j9,{ref:n,className:ft("bg-muted text-muted-foreground inline-flex h-9 items-center justify-center rounded-lg p-1",t),...e}));z9.displayName=j9.displayName;const py=g.forwardRef(({className:t,...e},n)=>k.jsx(B9,{ref:n,className:ft("ring-offset-background focus-visible:ring-ring data-[state=active]:bg-background data-[state=active]:text-foreground inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow",t),...e}));py.displayName=B9.displayName;const my=g.forwardRef(({className:t,...e},n)=>k.jsx(F9,{ref:n,className:ft("ring-offset-background focus-visible:ring-ring mt-2 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2",t),...e}));my.displayName=F9.displayName;var V9={},wge=function t(e,n){if(e===n)return!0;if(e&&n&&typeof e=="object"&&typeof n=="object"){if(e.constructor!==n.constructor)return!1;var r,i,o;if(Array.isArray(e)){if(r=e.length,r!=n.length)return!1;for(i=r;i--!==0;)if(!t(e[i],n[i]))return!1;return!0}if(e.constructor===RegExp)return e.source===n.source&&e.flags===n.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===n.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===n.toString();if(o=Object.keys(e),r=o.length,r!==Object.keys(n).length)return!1;for(i=r;i--!==0;)if(!Object.prototype.hasOwnProperty.call(n,o[i]))return!1;for(i=r;i--!==0;){var s=o[i];if(!t(e[s],n[s]))return!1}return!0}return e!==e&&n!==n},xge=fn&&fn.__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),F0=fn&&fn.__assign||function(){return F0=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},F0.apply(this,arguments)},Sge=fn&&fn.__createBinding||(Object.create?function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]}),Cge=fn&&fn.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),U9=fn&&fn.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&Sge(e,t,n);return Cge(e,t),e},kge=fn&&fn.__rest||function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n},Ege=fn&&fn.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(V9,"__esModule",{value:!0});var aS=U9(g),_ge=Ege(wge),ba=U9(l6());function rD(t){return t&&t.replace(/&nbsp;|\u202F|\u00A0/g," ").replace(/<br \/>/g,"<br>")}function Tge(t){var e=document.createTextNode("");t.appendChild(e);var n=document.activeElement===t;if(e!==null&&e.nodeValue!==null&&n){var r=window.getSelection();if(r!==null){var i=document.createRange();i.setStart(e,e.nodeValue.length),i.collapse(!0),r.removeAllRanges(),r.addRange(i)}t instanceof HTMLElement&&t.focus()}}var Age=function(t){xge(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.lastHtml=n.props.html,n.el=typeof n.props.innerRef=="function"?{current:null}:aS.createRef(),n.getEl=function(){return(n.props.innerRef&&typeof n.props.innerRef!="function"?n.props.innerRef:n.el).current},n.emitChange=function(r){var i=n.getEl();if(i){var o=i.innerHTML;if(n.props.onChange&&o!==n.lastHtml){var s=Object.assign({},r,{target:{value:o}});n.props.onChange(s)}n.lastHtml=o}},n}return e.prototype.render=function(){var n=this,r=this.props,i=r.tagName,o=r.html,s=r.innerRef,a=kge(r,["tagName","html","innerRef"]);return aS.createElement(i||"div",F0(F0({},a),{ref:typeof s=="function"?function(l){s(l),n.el.current=l}:s||this.el,onInput:this.emitChange,onBlur:this.props.onBlur||this.emitChange,onKeyUp:this.props.onKeyUp||this.emitChange,onKeyDown:this.props.onKeyDown||this.emitChange,contentEditable:!this.props.disabled,dangerouslySetInnerHTML:{__html:o}}),this.props.children)},e.prototype.shouldComponentUpdate=function(n){var r=this.props,i=this.getEl();return!i||rD(n.html)!==rD(i.innerHTML)?!0:r.disabled!==n.disabled||r.tagName!==n.tagName||r.className!==n.className||r.innerRef!==n.innerRef||r.placeholder!==n.placeholder||!(0,_ge.default)(r.style,n.style)},e.prototype.componentDidUpdate=function(){var n=this.getEl();n&&(this.props.html!==n.innerHTML&&(n.innerHTML=this.props.html),this.lastHtml=this.props.html,Tge(n))},e.propTypes={html:ba.string.isRequired,onChange:ba.func,disabled:ba.bool,tagName:ba.string,className:ba.string,style:ba.object,innerRef:ba.oneOfType([ba.object,ba.func])},e}(aS.Component),iD=V9.default=Age;const oD=t=>{const e=Object.entries(t.data);return k.jsxs(n2,{className:"table-fixed",children:[k.jsx(r2,{children:k.jsxs(Gc,{children:[k.jsx(Bc,{children:"Key"}),k.jsx(Bc,{children:"Value"})]})}),k.jsx(i2,{children:e.map(([n,r],i)=>k.jsxs(Gc,{children:[k.jsx(ka,{children:k.jsx(iD,{html:n,className:"resize-none whitespace-pre border-none outline-none",onChange:o=>{const s=e.map(([a,l],c)=>c===i?[o.target.value,l]:[a,l]);t.onChange(Object.fromEntries(s))}})}),k.jsx(ka,{children:k.jsx(iD,{html:r,className:"resize-none whitespace-pre border-none outline-none",onChange:o=>{const s=e.map(([a,l],c)=>c===i?[a,o.target.value]:[a,l]);t.onChange(Object.fromEntries(s))}})})]},i))}),k.jsx(q3,{children:k.jsx(Gc,{children:k.jsx(ka,{colSpan:2,className:"p-0",children:k.jsxs(Tn,{variant:"plain",size:"sm",className:"hover:bg-transparent",onClick:()=>{t.onChange({...t.data,"":""})},children:[k.jsx(s6,{className:"mr-2 h-4 w-4"})," Add"]})})})})]})},W9=1024;let Oge=0,lS=class{constructor(e,n){this.from=e,this.to=n}};class $t{constructor(e={}){this.id=Oge++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")})}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=Ni.match(e)),n=>{let r=e(n);return r===void 0?null:[this,r]}}}$t.closedBy=new $t({deserialize:t=>t.split(" ")});$t.openedBy=new $t({deserialize:t=>t.split(" ")});$t.group=new $t({deserialize:t=>t.split(" ")});$t.isolate=new $t({deserialize:t=>{if(t&&t!="rtl"&&t!="ltr"&&t!="auto")throw new RangeError("Invalid value for isolate: "+t);return t||"auto"}});$t.contextHash=new $t({perNode:!0});$t.lookAhead=new $t({perNode:!0});$t.mounted=new $t({perNode:!0});class z0{constructor(e,n,r){this.tree=e,this.overlay=n,this.parser=r}static get(e){return e&&e.props&&e.props[$t.mounted.id]}}const Rge=Object.create(null);class Ni{constructor(e,n,r,i=0){this.name=e,this.props=n,this.id=r,this.flags=i}static define(e){let n=e.props&&e.props.length?Object.create(null):Rge,r=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),i=new Ni(e.name||"",n,e.id,r);if(e.props){for(let o of e.props)if(Array.isArray(o)||(o=o(i)),o){if(o[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");n[o[0].id]=o[1]}}return i}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($t.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 i of r.split(" "))n[i]=e[r];return r=>{for(let i=r.prop($t.group),o=-1;o<(i?i.length:0);o++){let s=n[o<0?r.name:i[o]];if(s)return s}}}}Ni.none=new Ni("",Object.create(null),0,8);class lT{constructor(e){this.types=e;for(let n=0;n<e.length;n++)if(e[n].id!=n)throw new RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...e){let n=[];for(let r of this.types){let i=null;for(let o of e){let s=o(r);s&&(i||(i=Object.assign({},r.props)),i[s[0].id]=s[1])}n.push(i?new Ni(r.name,i,r.id,r.flags):r)}return new lT(n)}}const yv=new WeakMap,sD=new WeakMap;var xr;(function(t){t[t.ExcludeBuffers=1]="ExcludeBuffers",t[t.IncludeAnonymous=2]="IncludeAnonymous",t[t.IgnoreMounts=4]="IgnoreMounts",t[t.IgnoreOverlays=8]="IgnoreOverlays"})(xr||(xr={}));class sr{constructor(e,n,r,i,o){if(this.type=e,this.children=n,this.positions=r,this.length=i,this.props=null,o&&o.length){this.props=Object.create(null);for(let[s,a]of o)this.props[typeof s=="number"?s:s.id]=a}}toString(){let e=z0.get(this);if(e&&!e.overlay)return e.tree.toString();let n="";for(let r of this.children){let i=r.toString();i&&(n&&(n+=","),n+=i)}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 Ek(this.topNode,e)}cursorAt(e,n=0,r=0){let i=yv.get(this)||this.topNode,o=new Ek(i);return o.moveTo(e,n),yv.set(this,o._tree),o}get topNode(){return new Mo(this,0,0,null)}resolve(e,n=0){let r=sm(yv.get(this)||this.topNode,e,n,!1);return yv.set(this,r),r}resolveInner(e,n=0){let r=sm(sD.get(this)||this.topNode,e,n,!0);return sD.set(this,r),r}resolveStack(e,n=0){return Mge(this,e,n)}iterate(e){let{enter:n,leave:r,from:i=0,to:o=this.length}=e,s=e.mode||0,a=(s&xr.IncludeAnonymous)>0;for(let l=this.cursor(s|xr.IncludeAnonymous);;){let c=!1;if(l.from<=o&&l.to>=i&&(!a&&l.type.isAnonymous||n(l)!==!1)){if(l.firstChild())continue;c=!0}for(;c&&r&&(a||!l.type.isAnonymous)&&r(l),!l.nextSibling();){if(!l.parent())return;c=!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:fT(Ni.none,this.children,this.positions,0,this.children.length,0,this.length,(n,r,i)=>new sr(this.type,n,r,i,this.propValues),e.makeTree||((n,r,i)=>new sr(Ni.none,n,r,i)))}static build(e){return Dge(e)}}sr.empty=new sr(Ni.none,[],[],0);class cT{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 cT(this.buffer,this.index)}}class Zl{constructor(e,n,r){this.buffer=e,this.length=n,this.set=r}get type(){return Ni.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],i=this.set.types[n],o=i.name;if(/\W/.test(o)&&!i.isError&&(o=JSON.stringify(o)),e+=4,r==e)return o;let s=[];for(;e<r;)s.push(this.childString(e)),e=this.buffer[e+3];return o+"("+s.join(",")+")"}findChild(e,n,r,i,o){let{buffer:s}=this,a=-1;for(let l=e;l!=n&&!(H9(o,i,s[l+1],s[l+2])&&(a=l,r>0));l=s[l+3]);return a}slice(e,n,r){let i=this.buffer,o=new Uint16Array(n-e),s=0;for(let a=e,l=0;a<n;){o[l++]=i[a++],o[l++]=i[a++]-r;let c=o[l++]=i[a++]-r;o[l++]=i[a++]-e,s=Math.max(s,c)}return new Zl(o,s,this.set)}}function H9(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 sm(t,e,n,r){for(var i;t.from==t.to||(n<1?t.from>=e:t.from>e)||(n>-1?t.to<=e:t.to<e);){let s=!r&&t instanceof Mo&&t.index<0?null:t.parent;if(!s)return t;t=s}let o=r?0:xr.IgnoreOverlays;if(r)for(let s=t,a=s.parent;a;s=a,a=s.parent)s instanceof Mo&&s.index<0&&((i=a.enter(e,n,o))===null||i===void 0?void 0:i.from)!=s.from&&(t=a);for(;;){let s=t.enter(e,n,o);if(!s)return t;t=s}}class q9{cursor(e=0){return new Ek(this,e)}getChild(e,n=null,r=null){let i=aD(this,e,n,r);return i.length?i[0]:null}getChildren(e,n=null,r=null){return aD(this,e,n,r)}resolve(e,n=0){return sm(this,e,n,!1)}resolveInner(e,n=0){return sm(this,e,n,!0)}matchContext(e){return kk(this,e)}enterUnfinishedNodesBefore(e){let n=this.childBefore(e),r=this;for(;n;){let i=n.lastChild;if(!i||i.to!=n.to)break;i.type.isError&&i.from==i.to?(r=n,n=i.prevSibling):n=i}return r}get node(){return this}get next(){return this.parent}}class Mo extends q9{constructor(e,n,r,i){super(),this._tree=e,this.from=n,this.index=r,this._parent=i}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,i,o=0){for(let s=this;;){for(let{children:a,positions:l}=s._tree,c=n>0?a.length:-1;e!=c;e+=n){let f=a[e],d=l[e]+s.from;if(H9(i,r,d,d+f.length)){if(f instanceof Zl){if(o&xr.ExcludeBuffers)continue;let p=f.findChild(0,f.buffer.length,n,r-d,i);if(p>-1)return new _l(new Pge(s,f,e,d),null,p)}else if(o&xr.IncludeAnonymous||!f.type.isAnonymous||uT(f)){let p;if(!(o&xr.IgnoreMounts)&&(p=z0.get(f))&&!p.overlay)return new Mo(p.tree,d,e,s);let m=new Mo(f,d,e,s);return o&xr.IncludeAnonymous||!m.type.isAnonymous?m:m.nextChild(n<0?f.children.length-1:0,n,r,i)}}}if(o&xr.IncludeAnonymous||!s.type.isAnonymous||(s.index>=0?e=s.index+n:e=n<0?-1:s._parent._tree.children.length,s=s._parent,!s))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)}enter(e,n,r=0){let i;if(!(r&xr.IgnoreOverlays)&&(i=z0.get(this._tree))&&i.overlay){let o=e-this.from;for(let{from:s,to:a}of i.overlay)if((n>0?s<=o:s<o)&&(n<0?a>=o:a>o))return new Mo(i.tree,i.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 aD(t,e,n,r){let i=t.cursor(),o=[];if(!i.firstChild())return o;if(n!=null){for(let s=!1;!s;)if(s=i.type.is(n),!i.nextSibling())return o}for(;;){if(r!=null&&i.type.is(r))return o;if(i.type.is(e)&&o.push(i.node),!i.nextSibling())return r==null?o:[]}}function kk(t,e,n=e.length-1){for(let r=t.parent;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 Pge{constructor(e,n,r,i){this.parent=e,this.buffer=n,this.index=r,this.start=i}}class _l extends q9{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:i}=this.context,o=i.findChild(this.index+4,i.buffer[this.index+3],e,n-this.context.start,r);return o<0?null:new _l(this.context,this,o)}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)}enter(e,n,r=0){if(r&xr.ExcludeBuffers)return null;let{buffer:i}=this.context,o=i.findChild(this.index+4,i.buffer[this.index+3],n>0?1:-1,e-this.context.start,n);return o<0?null:new _l(this.context,this,o)}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 _l(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 _l(this.context,this._parent,e.findChild(n,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],n=[],{buffer:r}=this.context,i=this.index+4,o=r.buffer[this.index+3];if(o>i){let s=r.buffer[this.index+1];e.push(r.slice(i,o,s)),n.push(0)}return new sr(this.type,e,n,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function K9(t){if(!t.length)return null;let e=0,n=t[0];for(let o=1;o<t.length;o++){let s=t[o];(s.from>n.from||s.to<n.to)&&(n=s,e=o)}let r=n instanceof Mo&&n.index<0?null:n.parent,i=t.slice();return r?i[e]=r:i.splice(e,1),new Nge(i,n)}class Nge{constructor(e,n){this.heads=e,this.node=n}get next(){return K9(this.heads)}}function Mge(t,e,n){let r=t.resolveInner(e,n),i=null;for(let o=r instanceof Mo?r:r.context.parent;o;o=o.parent)if(o.index<0){let s=o.parent;(i||(i=[r])).push(s.resolve(e,n)),o=s}else{let s=z0.get(o.tree);if(s&&s.overlay&&s.overlay[0].from<=e&&s.overlay[s.overlay.length-1].to>=e){let a=new Mo(s.tree,s.overlay[0].from+o.from,-1,o);(i||(i=[r])).push(sm(a,e,n,!1))}}return i?K9(i):r}class Ek{get name(){return this.type.name}constructor(e,n=0){if(this.mode=n,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,e instanceof Mo)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:i}=this.buffer;return this.type=n||i.set.types[i.buffer[e]],this.from=r+i.buffer[e+1],this.to=r+i.buffer[e+2],!0}yield(e){return e?e instanceof Mo?(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:i}=this.buffer,o=i.findChild(this.index+4,i.buffer[this.index+3],e,n-this.buffer.start,r);return o<0?!1:(this.stack.push(this.index),this.yieldBuf(o))}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&xr.ExcludeBuffers?!1:this.enterChild(1,e,n):this.yield(this._tree.enter(e,n,r))}parent(){if(!this.buffer)return this.yieldNode(this.mode&xr.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&xr.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 i=r<0?0:this.stack[r]+4;if(this.index!=i)return this.yieldBuf(n.findChild(i,this.index,-1,0,4))}else{let i=n.buffer[this.index+3];if(i<(r<0?n.buffer.length:n.buffer[this.stack[r]+3]))return this.yieldBuf(i)}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:i}=this;if(i){if(e>0){if(this.index<i.buffer.buffer.length)return!1}else for(let o=0;o<this.index;o++)if(i.buffer.buffer[o+3]<this.index)return!1;({index:n,parent:r}=i)}else({index:n,_parent:r}=this._tree);for(;r;{index:n,_parent:r}=r)if(n>-1)for(let o=n+e,s=e<0?-1:r._tree.children.length;o!=s;o+=e){let a=r._tree.children[o];if(this.mode&xr.IncludeAnonymous||a instanceof Zl||!a.type.isAnonymous||uT(a))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 i=this.index,o=this.stack.length;o>=0;){for(let s=e;s;s=s._parent)if(s.index==i){if(i==this.index)return s;n=s,r=o+1;break e}i=this.stack[--o]}for(let i=r;i<this.stack.length;i++)n=new _l(this.buffer,n,this.stack[i]);return this.bufferNode=new _l(this.buffer,n,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(e,n){for(let r=0;;){let i=!1;if(this.type.isAnonymous||e(this)!==!1){if(this.firstChild()){r++;continue}this.type.isAnonymous||(i=!0)}for(;i&&n&&n(this),i=this.type.isAnonymous,!this.nextSibling();){if(!r)return;this.parent(),r--,i=!0}}}matchContext(e){if(!this.buffer)return kk(this.node,e);let{buffer:n}=this.buffer,{types:r}=n.set;for(let i=e.length-1,o=this.stack.length-1;i>=0;o--){if(o<0)return kk(this.node,e,i);let s=r[n.buffer[this.stack[o]]];if(!s.isAnonymous){if(e[i]&&e[i]!=s.name)return!1;i--}}return!0}}function uT(t){return t.children.some(e=>e instanceof Zl||!e.type.isAnonymous||uT(e))}function Dge(t){var e;let{buffer:n,nodeSet:r,maxBufferLength:i=W9,reused:o=[],minRepeatType:s=r.types.length}=t,a=Array.isArray(n)?new cT(n,n.length):n,l=r.types,c=0,f=0;function d(A,_,R,M,I,V){let{id:U,start:L,end:G,size:K}=a,F=f;for(;K<0;)if(a.next(),K==-1){let P=o[U];R.push(P),M.push(L-A);return}else if(K==-3){c=U;return}else if(K==-4){f=U;return}else throw new RangeError(`Unrecognized record size: ${K}`);let ie=l[U],ae,re,W=L-A;if(G-L<=i&&(re=S(a.pos-_,I))){let P=new Uint16Array(re.size-re.skip),he=a.pos-re.size,fe=P.length;for(;a.pos>he;)fe=x(re.start,P,fe);ae=new Zl(P,G-re.start,r),W=re.start-A}else{let P=a.pos-K;a.next();let he=[],fe=[],$=U>=s?U:-1,Ne=0,He=G;for(;a.pos>P;)$>=0&&a.id==$&&a.size>=0?(a.end<=He-i&&(v(he,fe,L,Ne,a.end,He,$,F),Ne=he.length,He=a.end),a.next()):V>2500?p(L,P,he,fe):d(L,P,he,fe,$,V+1);if($>=0&&Ne>0&&Ne<he.length&&v(he,fe,L,Ne,L,He,$,F),he.reverse(),fe.reverse(),$>-1&&Ne>0){let Ye=m(ie);ae=fT(ie,he,fe,0,he.length,0,G-L,Ye,Ye)}else ae=b(ie,he,fe,G-L,F-G)}R.push(ae),M.push(W)}function p(A,_,R,M){let I=[],V=0,U=-1;for(;a.pos>_;){let{id:L,start:G,end:K,size:F}=a;if(F>4)a.next();else{if(U>-1&&G<U)break;U<0&&(U=K-i),I.push(L,G,K),V++,a.next()}}if(V){let L=new Uint16Array(V*4),G=I[I.length-2];for(let K=I.length-3,F=0;K>=0;K-=3)L[F++]=I[K],L[F++]=I[K+1]-G,L[F++]=I[K+2]-G,L[F++]=F;R.push(new Zl(L,I[2]-G,r)),M.push(G-A)}}function m(A){return(_,R,M)=>{let I=0,V=_.length-1,U,L;if(V>=0&&(U=_[V])instanceof sr){if(!V&&U.type==A&&U.length==M)return U;(L=U.prop($t.lookAhead))&&(I=R[V]+U.length+L)}return b(A,_,R,M,I)}}function v(A,_,R,M,I,V,U,L){let G=[],K=[];for(;A.length>M;)G.push(A.pop()),K.push(_.pop()+R-I);A.push(b(r.types[U],G,K,V-I,L-V)),_.push(I-R)}function b(A,_,R,M,I=0,V){if(c){let U=[$t.contextHash,c];V=V?[U].concat(V):[U]}if(I>25){let U=[$t.lookAhead,I];V=V?[U].concat(V):[U]}return new sr(A,_,R,M,V)}function S(A,_){let R=a.fork(),M=0,I=0,V=0,U=R.end-i,L={size:0,start:0,skip:0};e:for(let G=R.pos-A;R.pos>G;){let K=R.size;if(R.id==_&&K>=0){L.size=M,L.start=I,L.skip=V,V+=4,M+=4,R.next();continue}let F=R.pos-K;if(K<0||F<G||R.start<U)break;let ie=R.id>=s?4:0,ae=R.start;for(R.next();R.pos>F;){if(R.size<0)if(R.size==-3)ie+=4;else break e;else R.id>=s&&(ie+=4);R.next()}I=ae,M+=K,V+=ie}return(_<0||M==A)&&(L.size=M,L.start=I,L.skip=V),L.size>4?L:void 0}function x(A,_,R){let{id:M,start:I,end:V,size:U}=a;if(a.next(),U>=0&&M<s){let L=R;if(U>4){let G=a.pos-(U-4);for(;a.pos>G;)R=x(A,_,R)}_[--R]=L,_[--R]=V-A,_[--R]=I-A,_[--R]=M}else U==-3?c=M:U==-4&&(f=M);return R}let w=[],C=[];for(;a.pos>0;)d(t.start||0,t.bufferStart||0,w,C,-1,0);let T=(e=t.length)!==null&&e!==void 0?e:w.length?C[0]+w[0].length:0;return new sr(l[t.topID],w.reverse(),C.reverse(),T)}const lD=new WeakMap;function gy(t,e){if(!t.isAnonymous||e instanceof Zl||e.type!=t)return 1;let n=lD.get(e);if(n==null){n=1;for(let r of e.children){if(r.type!=t||!(r instanceof sr)){n=1;break}n+=gy(t,r)}lD.set(e,n)}return n}function fT(t,e,n,r,i,o,s,a,l){let c=0;for(let v=r;v<i;v++)c+=gy(t,e[v]);let f=Math.ceil(c*1.5/8),d=[],p=[];function m(v,b,S,x,w){for(let C=S;C<x;){let T=C,A=b[C],_=gy(t,v[C]);for(C++;C<x;C++){let R=gy(t,v[C]);if(_+R>=f)break;_+=R}if(C==T+1){if(_>f){let R=v[T];m(R.children,R.positions,0,R.children.length,b[T]+w);continue}d.push(v[T])}else{let R=b[C-1]+v[C-1].length-A;d.push(fT(t,v,b,T,C,A,R,null,l))}p.push(A+w-o)}}return m(e,n,r,i,0),(a||l)(d,p,s)}class Zc{constructor(e,n,r,i,o=!1,s=!1){this.from=e,this.to=n,this.tree=r,this.offset=i,this.open=(o?1:0)|(s?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,n=[],r=!1){let i=[new Zc(0,e.length,e,0,!1,r)];for(let o of n)o.to>e.length&&i.push(o);return i}static applyChanges(e,n,r=128){if(!n.length)return e;let i=[],o=1,s=e.length?e[0]:null;for(let a=0,l=0,c=0;;a++){let f=a<n.length?n[a]:null,d=f?f.fromA:1e9;if(d-l>=r)for(;s&&s.from<d;){let p=s;if(l>=p.from||d<=p.to||c){let m=Math.max(p.from,l)-c,v=Math.min(p.to,d)-c;p=m>=v?null:new Zc(m,v,p.tree,p.offset+c,a>0,!!f)}if(p&&i.push(p),s.to>d)break;s=o<e.length?e[o++]:null}if(!f)break;l=f.toA,c=f.toA-f.toB}return i}}class G9{startParse(e,n,r){return typeof e=="string"&&(e=new Lge(e)),r=r?r.length?r.map(i=>new lS(i.from,i.to)):[new lS(0,0)]:[new lS(0,e.length)],this.createParse(e,n||[],r)}parse(e,n,r){let i=this.startParse(e,n,r);for(;;){let o=i.advance();if(o)return o}}}class Lge{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 $t({perNode:!0});var cD={};class V0{constructor(e,n,r,i,o,s,a,l,c,f=0,d){this.p=e,this.stack=n,this.state=r,this.reducePos=i,this.pos=o,this.score=s,this.buffer=a,this.bufferBase=l,this.curContext=c,this.lookAhead=f,this.parent=d}toString(){return`[${this.stack.filter((e,n)=>n%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,n,r=0){let i=e.parser.context;return new V0(e,[],n,r,r,0,[],0,i?new uD(i,i.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,n){this.stack.push(this.state,n,this.bufferBase+this.buffer.length),this.state=e}reduce(e){var n;let r=e>>19,i=e&65535,{parser:o}=this.p,s=o.dynamicPrecedence(i);if(s&&(this.score+=s),r==0){this.pushState(o.getGoto(this.state,i,!0),this.reducePos),i<o.minRepeatTerm&&this.storeNode(i,this.reducePos,this.reducePos,4,!0),this.reduceContext(i,this.reducePos);return}let a=this.stack.length-(r-1)*3-(e&262144?6:0),l=a?this.stack[a-2]:this.p.ranges[0].from,c=this.reducePos-l;c>=2e3&&!(!((n=this.p.parser.nodeSet.types[i])===null||n===void 0)&&n.isAnonymous)&&(l==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=c):this.p.lastBigReductionSize<c&&(this.p.bigReductionCount=1,this.p.lastBigReductionStart=l,this.p.lastBigReductionSize=c));let f=a?this.stack[a-1]:0,d=this.bufferBase+this.buffer.length-f;if(i<o.minRepeatTerm||e&131072){let p=o.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(i,l,p,d+4,!0)}if(e&262144)this.state=this.stack[a];else{let p=this.stack[a-3];this.state=o.getGoto(p,i,!0)}for(;this.stack.length>a;)this.stack.pop();this.reduceContext(i,l)}storeNode(e,n,r,i=4,o=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]<this.buffer.length+this.bufferBase)){let s=this,a=this.buffer.length;if(a==0&&s.parent&&(a=s.bufferBase-s.parent.bufferBase,s=s.parent),a>0&&s.buffer[a-4]==0&&s.buffer[a-1]>-1){if(n==r)return;if(s.buffer[a-2]>=n){s.buffer[a-2]=r;return}}}if(!o||this.pos==r)this.buffer.push(e,n,r,i);else{let s=this.buffer.length;if(s>0&&this.buffer[s-4]!=0)for(;s>0&&this.buffer[s-2]>r;)this.buffer[s]=this.buffer[s-4],this.buffer[s+1]=this.buffer[s-3],this.buffer[s+2]=this.buffer[s-2],this.buffer[s+3]=this.buffer[s-1],s-=4,i>4&&(i-=4);this.buffer[s]=e,this.buffer[s+1]=n,this.buffer[s+2]=r,this.buffer[s+3]=i}}shift(e,n,r,i){if(e&131072)this.pushState(e&65535,this.pos);else if(e&262144)this.pos=i,this.shiftContext(n,r),n<=this.p.parser.maxNode&&this.buffer.push(n,r,i,4);else{let o=e,{parser:s}=this.p;(i>this.pos||n<=s.maxNode)&&(this.pos=i,s.stateFlag(o,1)||(this.reducePos=i)),this.pushState(o,r),this.shiftContext(n,r),n<=s.maxNode&&this.buffer.push(n,r,i,4)}}apply(e,n,r,i){e&65536?this.reduce(e):this.shift(e,n,r,i)}useNode(e,n){let r=this.p.reused.length-1;(r<0||this.p.reused[r]!=e)&&(this.p.reused.push(e),r++);let i=this.pos;this.reducePos=this.pos=i+e.length,this.pushState(n,i),this.buffer.push(r,i,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,n=e.buffer.length;for(;n>0&&e.buffer[n-2]>e.reducePos;)n-=4;let r=e.buffer.slice(n),i=e.bufferBase+n;for(;e&&i==e.bufferBase;)e=e.parent;return new V0(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,r,i,this.curContext,this.lookAhead,e)}recoverByDelete(e,n){let r=e<=this.p.parser.maxNode;r&&this.storeNode(e,this.pos,n,4),this.storeNode(0,this.pos,n,r?8:4),this.pos=this.reducePos=n,this.score-=190}canShift(e){for(let n=new $ge(this);;){let r=this.p.parser.stateSlot(n.state,4)||this.p.parser.hasAction(n.state,e);if(r==0)return!1;if(!(r&65536))return!0;n.reduce(r)}}recoverByInsert(e){if(this.stack.length>=300)return[];let n=this.p.parser.nextStates(this.state);if(n.length>8||this.stack.length>=120){let i=[];for(let o=0,s;o<n.length;o+=2)(s=n[o+1])!=this.state&&this.p.parser.hasAction(s,e)&&i.push(n[o],s);if(this.stack.length<120)for(let o=0;i.length<8&&o<n.length;o+=2){let s=n[o+1];i.some((a,l)=>l&1&&a==s)||i.push(n[o],s)}n=i}let r=[];for(let i=0;i<n.length&&r.length<4;i+=2){let o=n[i+1];if(o==this.state)continue;let s=this.split();s.pushState(o,this.pos),s.storeNode(0,s.pos,s.pos,4,!0),s.shiftContext(n[i],this.pos),s.reducePos=this.pos,s.score-=200,r.push(s)}return r}forceReduce(){let{parser:e}=this.p,n=e.stateSlot(this.state,5);if(!(n&65536))return!1;if(!e.validAction(this.state,n)){let r=n>>19,i=n&65535,o=this.stack.length-r*3;if(o<0||e.getGoto(this.stack[o],i,!1)<0){let s=this.findForcedReduction();if(s==null)return!1;n=s}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(n),!0}findForcedReduction(){let{parser:e}=this.p,n=[],r=(i,o)=>{if(!n.includes(i))return n.push(i),e.allActions(i,s=>{if(!(s&393216))if(s&65536){let a=(s>>19)-o;if(a>1){let l=s&65535,c=this.stack.length-a*3;if(c>=0&&e.getGoto(this.stack[c],l,!1)>=0)return a<<19|65536|l}}else{let a=r(s,o+1);if(a!=null)return a}})};return r(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let n=0;n<this.stack.length;n+=3)if(this.stack[n]!=e.stack[n])return!1;return!0}get parser(){return this.p.parser}dialectEnabled(e){return this.p.parser.dialect.flags[e]}shiftContext(e,n){this.curContext&&this.updateContext(this.curContext.tracker.shift(this.curContext.context,e,this,this.p.stream.reset(n)))}reduceContext(e,n){this.curContext&&this.updateContext(this.curContext.tracker.reduce(this.curContext.context,e,this,this.p.stream.reset(n)))}emitContext(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-3)&&this.buffer.push(this.curContext.hash,this.pos,this.pos,-3)}emitLookAhead(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-4)&&this.buffer.push(this.lookAhead,this.pos,this.pos,-4)}updateContext(e){if(e!=this.curContext.context){let n=new uD(this.curContext.tracker,e);n.hash!=this.curContext.hash&&this.emitContext(),this.curContext=n}}setLookAhead(e){e>this.lookAhead&&(this.emitLookAhead(),this.lookAhead=e)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class uD{constructor(e,n){this.tracker=e,this.context=n,this.hash=e.strict?e.hash(n):0}}class $ge{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let n=e&65535,r=e>>19;r==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(r-1)*3;let i=this.start.p.parser.getGoto(this.stack[this.base-3],n,!0);this.state=i}}class U0{constructor(e,n,r){this.stack=e,this.pos=n,this.index=r,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(e,n=e.bufferBase+e.buffer.length){return new U0(e,n,n-e.bufferBase)}maybeNext(){let e=this.stack.parent;e!=null&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}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]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new U0(this.stack,this.pos,this.index)}}function bv(t,e=Uint16Array){if(typeof t!="string")return t;let n=null;for(let r=0,i=0;r<t.length;){let o=0;for(;;){let s=t.charCodeAt(r++),a=!1;if(s==126){o=65535;break}s>=92&&s--,s>=34&&s--;let l=s-32;if(l>=46&&(l-=46,a=!0),o+=l,a)break;o*=46}n?n[i++]=o:n=new e(o)}return n}class vy{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const fD=new vy;class Ige{constructor(e,n){this.input=e,this.ranges=n,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=fD,this.rangeIndex=0,this.pos=this.chunkPos=n[0].from,this.range=n[0],this.end=n[n.length-1].to,this.readNext()}resolveOffset(e,n){let r=this.range,i=this.rangeIndex,o=this.pos+e;for(;o<r.from;){if(!i)return null;let s=this.ranges[--i];o-=r.from-s.to,r=s}for(;n<0?o>r.to:o>=r.to;){if(i==this.ranges.length-1)return null;let s=this.ranges[++i];o+=s.from-r.to,r=s}return o}clipPos(e){if(e>=this.range.from&&e<this.range.to)return e;for(let n of this.ranges)if(n.to>e)return Math.max(e,n.from);return this.end}peek(e){let n=this.chunkOff+e,r,i;if(n>=0&&n<this.chunk.length)r=this.pos+e,i=this.chunk.charCodeAt(n);else{let o=this.resolveOffset(e,1);if(o==null)return-1;if(r=o,r>=this.chunk2Pos&&r<this.chunk2Pos+this.chunk2.length)i=this.chunk2.charCodeAt(r-this.chunk2Pos);else{let s=this.rangeIndex,a=this.range;for(;a.to<=r;)a=this.ranges[++s];this.chunk2=this.input.chunk(this.chunk2Pos=r),r+this.chunk2.length>a.to&&(this.chunk2=this.chunk2.slice(0,a.to-r)),i=this.chunk2.charCodeAt(0)}}return r>=this.token.lookAhead&&(this.token.lookAhead=r+1),i}acceptToken(e,n=0){let r=n?this.resolveOffset(n,-1):this.pos;if(r==null||r<this.token.start)throw new RangeError("Token end out of bounds");this.token.value=e,this.token.end=r}acceptTokenTo(e,n){this.token.value=e,this.token.end=n}getChunk(){if(this.pos>=this.chunk2Pos&&this.pos<this.chunk2Pos+this.chunk2.length){let{chunk:e,chunkPos:n}=this;this.chunk=this.chunk2,this.chunkPos=this.chunk2Pos,this.chunk2=e,this.chunk2Pos=n,this.chunkOff=this.pos-this.chunkPos}else{this.chunk2=this.chunk,this.chunk2Pos=this.chunkPos;let e=this.input.chunk(this.pos),n=this.pos+e.length;this.chunk=n>this.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(e,n){if(n?(this.token=n,n.start=e,n.lookAhead=e+1,n.value=n.extended=-1):this.token=fD,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e<this.range.from;)this.range=this.ranges[--this.rangeIndex];for(;e>=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e<this.chunkPos+this.chunk.length?this.chunkOff=e-this.chunkPos:(this.chunk="",this.chunkOff=0),this.readNext()}return this}read(e,n){if(e>=this.chunkPos&&n<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,n-this.chunkPos);if(e>=this.chunk2Pos&&n<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,n-this.chunk2Pos);if(e>=this.range.from&&n<=this.range.to)return this.input.read(e,n);let r="";for(let i of this.ranges){if(i.from>=n)break;i.to>e&&(r+=this.input.read(Math.max(i.from,e),Math.min(i.to,n)))}return r}}class Uf{constructor(e,n){this.data=e,this.id=n}token(e,n){let{parser:r}=n.p;jge(this.data,e,n,this.id,r.data,r.tokenPrecTable)}}Uf.prototype.contextual=Uf.prototype.fallback=Uf.prototype.extend=!1;Uf.prototype.fallback=Uf.prototype.extend=!1;function jge(t,e,n,r,i,o){let s=0,a=1<<r,{dialect:l}=n.p.parser;e:for(;a&t[s];){let c=t[s+1];for(let m=s+3;m<c;m+=2)if((t[m+1]&a)>0){let v=t[m];if(l.allows(v)&&(e.token.value==-1||e.token.value==v||Bge(v,e.token.value,i,o))){e.acceptToken(v);break}}let f=e.next,d=0,p=t[s+2];if(e.next<0&&p>d&&t[c+p*3-3]==65535){s=t[c+p*3-1];continue e}for(;d<p;){let m=d+p>>1,v=c+m+(m<<1),b=t[v],S=t[v+1]||65536;if(f<b)p=m;else if(f>=S)d=m+1;else{s=t[v+2],e.advance();continue e}}break}}function dD(t,e,n){for(let r=e,i;(i=t[r])!=65535;r++)if(i==n)return r-e;return-1}function Bge(t,e,n,r){let i=dD(n,r,e);return i<0||dD(n,r,t)<i}const Ui=typeof process<"u"&&cD&&/\bparse\b/.test(cD.LOG);let cS=null;function hD(t,e,n){let r=t.cursor(xr.IncludeAnonymous);for(r.moveTo(e);;)if(!(n<0?r.childBefore(e):r.childAfter(e)))for(;;){if((n<0?r.to<e:r.from>e)&&!r.type.isError)return n<0?Math.max(0,Math.min(r.to-1,e-25)):Math.min(t.length,Math.max(r.from+1,e+25));if(n<0?r.prevSibling():r.nextSibling())break;if(!r.parent())return n<0?0:t.length}}class Fge{constructor(e,n){this.fragments=e,this.nodeSet=n,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?hD(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?hD(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(e<this.nextStart)return null;for(;this.fragment&&this.safeTo<=e;)this.nextFragment();if(!this.fragment)return null;for(;;){let n=this.trees.length-1;if(n<0)return this.nextFragment(),null;let r=this.trees[n],i=this.index[n];if(i==r.children.length){this.trees.pop(),this.start.pop(),this.index.pop();continue}let o=r.children[i],s=this.start[n]+r.positions[i];if(s>e)return this.nextStart=s,null;if(o instanceof sr){if(s==e){if(s<this.safeFrom)return null;let a=s+o.length;if(a<=this.safeTo){let l=o.prop($t.lookAhead);if(!l||a+l<this.fragment.to)return o}}this.index[n]++,s+o.length>=Math.max(this.safeFrom,e)&&(this.trees.push(o),this.start.push(s),this.index.push(0))}else this.index[n]++,this.nextStart=s+o.length}}}class zge{constructor(e,n){this.stream=n,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(r=>new vy)}getActions(e){let n=0,r=null,{parser:i}=e.p,{tokenizers:o}=i,s=i.stateSlot(e.state,3),a=e.curContext?e.curContext.hash:0,l=0;for(let c=0;c<o.length;c++){if(!(1<<c&s))continue;let f=o[c],d=this.tokens[c];if(!(r&&!f.fallback)&&((f.contextual||d.start!=e.pos||d.mask!=s||d.context!=a)&&(this.updateCachedToken(d,f,e),d.mask=s,d.context=a),d.lookAhead>d.end+25&&(l=Math.max(d.lookAhead,l)),d.value!=0)){let p=n;if(d.extended>-1&&(n=this.addActions(e,d.extended,d.end,n)),n=this.addActions(e,d.value,d.end,n),!f.extend&&(r=d,n>p))break}}for(;this.actions.length>n;)this.actions.pop();return l&&e.setLookAhead(l),!r&&e.pos==this.stream.end&&(r=new vy,r.value=e.p.parser.eofTerm,r.start=r.end=e.pos,n=this.addActions(e,r.value,r.end,n)),this.mainToken=r,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let n=new vy,{pos:r,p:i}=e;return n.start=r,n.end=Math.min(r+1,i.stream.end),n.value=r==i.stream.end?i.parser.eofTerm:0,n}updateCachedToken(e,n,r){let i=this.stream.clipPos(r.pos);if(n.token(this.stream.reset(i,e),r),e.value>-1){let{parser:o}=r.p;for(let s=0;s<o.specialized.length;s++)if(o.specialized[s]==e.value){let a=o.specializers[s](this.stream.read(e.start,e.end),r);if(a>=0&&r.p.parser.dialect.allows(a>>1)){a&1?e.extended=a>>1:e.value=a>>1;break}}}else e.value=0,e.end=this.stream.clipPos(i+1)}putAction(e,n,r,i){for(let o=0;o<i;o+=3)if(this.actions[o]==e)return i;return this.actions[i++]=e,this.actions[i++]=n,this.actions[i++]=r,i}addActions(e,n,r,i){let{state:o}=e,{parser:s}=e.p,{data:a}=s;for(let l=0;l<2;l++)for(let c=s.stateSlot(o,l?2:1);;c+=3){if(a[c]==65535)if(a[c+1]==1)c=Ca(a,c+2);else{i==0&&a[c+1]==2&&(i=this.putAction(Ca(a,c+2),n,r,i));break}a[c]==n&&(i=this.putAction(Ca(a,c+1),n,r,i))}return i}}class Vge{constructor(e,n,r,i){this.parser=e,this.input=n,this.ranges=i,this.recovering=0,this.nextStackID=9812,this.minStackPos=0,this.reused=[],this.stoppedAt=null,this.lastBigReductionStart=-1,this.lastBigReductionSize=0,this.bigReductionCount=0,this.stream=new Ige(n,i),this.tokens=new zge(e,this.stream),this.topTerm=e.top[1];let{from:o}=i[0];this.stacks=[V0.start(this,e.top[0],o)],this.fragments=r.length&&this.stream.end-o>e.bufferLength*4?new Fge(r,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,n=this.minStackPos,r=this.stacks=[],i,o;if(this.bigReductionCount>300&&e.length==1){let[s]=e;for(;s.forceReduce()&&s.stack.length&&s.stack[s.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let s=0;s<e.length;s++){let a=e[s];for(;;){if(this.tokens.mainToken=null,a.pos>n)r.push(a);else{if(this.advanceStack(a,r,e))continue;{i||(i=[],o=[]),i.push(a);let l=this.tokens.getMainToken(a);o.push(l.value,l.end)}}break}}if(!r.length){let s=i&&Wge(i);if(s)return Ui&&console.log("Finish with "+this.stackID(s)),this.stackToTree(s);if(this.parser.strict)throw Ui&&i&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+n);this.recovering||(this.recovering=5)}if(this.recovering&&i){let s=this.stoppedAt!=null&&i[0].pos>this.stoppedAt?i[0]:this.runRecovery(i,o,r);if(s)return Ui&&console.log("Force-finish "+this.stackID(s)),this.stackToTree(s.forceAll())}if(this.recovering){let s=this.recovering==1?1:this.recovering*3;if(r.length>s)for(r.sort((a,l)=>l.score-a.score);r.length>s;)r.pop();r.some(a=>a.reducePos>n)&&this.recovering--}else if(r.length>1){e:for(let s=0;s<r.length-1;s++){let a=r[s];for(let l=s+1;l<r.length;l++){let c=r[l];if(a.sameState(c)||a.buffer.length>500&&c.buffer.length>500)if((a.score-c.score||a.buffer.length-c.buffer.length)>0)r.splice(l--,1);else{r.splice(s--,1);continue e}}}r.length>12&&r.splice(12,r.length-12)}this.minStackPos=r[0].pos;for(let s=1;s<r.length;s++)r[s].pos<this.minStackPos&&(this.minStackPos=r[s].pos);return null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt<e)throw new RangeError("Can't move stoppedAt forward");this.stoppedAt=e}advanceStack(e,n,r){let i=e.pos,{parser:o}=this,s=Ui?this.stackID(e)+" -> ":"";if(this.stoppedAt!=null&&i>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let c=e.curContext&&e.curContext.tracker.strict,f=c?e.curContext.hash:0;for(let d=this.fragments.nodeAt(i);d;){let p=this.parser.nodeSet.types[d.type.id]==d.type?o.getGoto(e.state,d.type.id):-1;if(p>-1&&d.length&&(!c||(d.prop($t.contextHash)||0)==f))return e.useNode(d,p),Ui&&console.log(s+this.stackID(e)+` (via reuse of ${o.getName(d.type.id)})`),!0;if(!(d instanceof sr)||d.children.length==0||d.positions[0]>0)break;let m=d.children[0];if(m instanceof sr&&d.positions[0]==0)d=m;else break}}let a=o.stateSlot(e.state,4);if(a>0)return e.reduce(a),Ui&&console.log(s+this.stackID(e)+` (via always-reduce ${o.getName(a&65535)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let l=this.tokens.getActions(e);for(let c=0;c<l.length;){let f=l[c++],d=l[c++],p=l[c++],m=c==l.length||!r,v=m?e:e.split(),b=this.tokens.mainToken;if(v.apply(f,d,b?b.start:v.pos,p),Ui&&console.log(s+this.stackID(v)+` (via ${f&65536?`reduce of ${o.getName(f&65535)}`:"shift"} for ${o.getName(d)} @ ${i}${v==e?"":", split"})`),m)return!0;v.pos>i?n.push(v):r.push(v)}return!1}advanceFully(e,n){let r=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>r)return pD(e,n),!0}}runRecovery(e,n,r){let i=null,o=!1;for(let s=0;s<e.length;s++){let a=e[s],l=n[s<<1],c=n[(s<<1)+1],f=Ui?this.stackID(a)+" -> ":"";if(a.deadEnd&&(o||(o=!0,a.restart(),Ui&&console.log(f+this.stackID(a)+" (restarted)"),this.advanceFully(a,r))))continue;let d=a.split(),p=f;for(let m=0;d.forceReduce()&&m<10&&(Ui&&console.log(p+this.stackID(d)+" (via force-reduce)"),!this.advanceFully(d,r));m++)Ui&&(p=this.stackID(d)+" -> ");for(let m of a.recoverByInsert(l))Ui&&console.log(f+this.stackID(m)+" (via recover-insert)"),this.advanceFully(m,r);this.stream.end>a.pos?(c==a.pos&&(c++,l=0),a.recoverByDelete(l,c),Ui&&console.log(f+this.stackID(a)+` (via recover-delete ${this.parser.getName(l)})`),pD(a,r)):(!i||i.score<a.score)&&(i=a)}return i}stackToTree(e){return e.close(),sr.build({buffer:U0.create(e),nodeSet:this.parser.nodeSet,topID:this.topTerm,maxBufferLength:this.parser.bufferLength,reused:this.reused,start:this.ranges[0].from,length:e.pos-this.ranges[0].from,minRepeatType:this.parser.minRepeatTerm})}stackID(e){let n=(cS||(cS=new WeakMap)).get(e);return n||cS.set(e,n=String.fromCodePoint(this.nextStackID++)),n+e}}function pD(t,e){for(let n=0;n<e.length;n++){let r=e[n];if(r.pos==t.pos&&r.sameState(t)){e[n].score<t.score&&(e[n]=t);return}}e.push(t)}class Uge{constructor(e,n,r){this.source=e,this.flags=n,this.disabled=r}allows(e){return!this.disabled||this.disabled[e]==0}}class W0 extends G9{constructor(e){if(super(),this.wrappers=[],e.version!=14)throw new RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let n=e.nodeNames.split(" ");this.minRepeatTerm=n.length;for(let a=0;a<e.repeatNodeCount;a++)n.push("");let r=Object.keys(e.topRules).map(a=>e.topRules[a][1]),i=[];for(let a=0;a<n.length;a++)i.push([]);function o(a,l,c){i[a].push([l,l.deserialize(String(c))])}if(e.nodeProps)for(let a of e.nodeProps){let l=a[0];typeof l=="string"&&(l=$t[l]);for(let c=1;c<a.length;){let f=a[c++];if(f>=0)o(f,l,a[c++]);else{let d=a[c+-f];for(let p=-f;p>0;p--)o(a[c++],l,d);c++}}}this.nodeSet=new lT(n.map((a,l)=>Ni.define({name:l>=this.minRepeatTerm?void 0:a,id:l,props:i[l],top:r.indexOf(l)>-1,error:l==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(l)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=W9;let s=bv(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let a=0;a<this.specializerSpecs.length;a++)this.specialized[a]=this.specializerSpecs[a].term;this.specializers=this.specializerSpecs.map(mD),this.states=bv(e.states,Uint32Array),this.data=bv(e.stateData),this.goto=bv(e.goto),this.maxTerm=e.maxTerm,this.tokenizers=e.tokenizers.map(a=>typeof a=="number"?new Uf(s,a):a),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,n,r){let i=new Vge(this,e,n,r);for(let o of this.wrappers)i=o(i,e,n,r);return i}getGoto(e,n,r=!1){let i=this.goto;if(n>=i[0])return-1;for(let o=i[n+1];;){let s=i[o++],a=s&1,l=i[o++];if(a&&r)return l;for(let c=o+(s>>1);o<c;o++)if(i[o]==e)return l;if(a)return-1}}hasAction(e,n){let r=this.data;for(let i=0;i<2;i++)for(let o=this.stateSlot(e,i?2:1),s;;o+=3){if((s=r[o])==65535)if(r[o+1]==1)s=r[o=Ca(r,o+2)];else{if(r[o+1]==2)return Ca(r,o+2);break}if(s==n||s==0)return Ca(r,o+1)}return 0}stateSlot(e,n){return this.states[e*6+n]}stateFlag(e,n){return(this.stateSlot(e,0)&n)>0}validAction(e,n){return!!this.allActions(e,r=>r==n?!0:null)}allActions(e,n){let r=this.stateSlot(e,4),i=r?n(r):void 0;for(let o=this.stateSlot(e,1);i==null;o+=3){if(this.data[o]==65535)if(this.data[o+1]==1)o=Ca(this.data,o+2);else break;i=n(Ca(this.data,o+1))}return i}nextStates(e){let n=[];for(let r=this.stateSlot(e,1);;r+=3){if(this.data[r]==65535)if(this.data[r+1]==1)r=Ca(this.data,r+2);else break;if(!(this.data[r+2]&1)){let i=this.data[r+1];n.some((o,s)=>s&1&&o==i)||n.push(this.data[r],i)}}return n}configure(e){let n=Object.assign(Object.create(W0.prototype),this);if(e.props&&(n.nodeSet=this.nodeSet.extend(...e.props)),e.top){let r=this.topRules[e.top];if(!r)throw new RangeError(`Invalid top rule name ${e.top}`);n.top=r}return e.tokenizers&&(n.tokenizers=this.tokenizers.map(r=>{let i=e.tokenizers.find(o=>o.from==r);return i?i.to:r})),e.specializers&&(n.specializers=this.specializers.slice(),n.specializerSpecs=this.specializerSpecs.map((r,i)=>{let o=e.specializers.find(a=>a.from==r.external);if(!o)return r;let s=Object.assign(Object.assign({},r),{external:o.to});return n.specializers[i]=mD(s),s})),e.contextTracker&&(n.context=e.contextTracker),e.dialect&&(n.dialect=this.parseDialect(e.dialect)),e.strict!=null&&(n.strict=e.strict),e.wrap&&(n.wrappers=n.wrappers.concat(e.wrap)),e.bufferLength!=null&&(n.bufferLength=e.bufferLength),n}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let n=this.dynamicPrecedences;return n==null?0:n[e]||0}parseDialect(e){let n=Object.keys(this.dialects),r=n.map(()=>!1);if(e)for(let o of e.split(" ")){let s=n.indexOf(o);s>=0&&(r[s]=!0)}let i=null;for(let o=0;o<n.length;o++)if(!r[o])for(let s=this.dialects[n[o]],a;(a=this.data[s++])!=65535;)(i||(i=new Uint8Array(this.maxTerm+1)))[a]=1;return new Uge(e,r,i)}static deserialize(e){return new W0(e)}}function Ca(t,e){return t[e]|t[e+1]<<16}function Wge(t){let e=null;for(let n of t){let r=n.p.stoppedAt;(n.pos==n.p.stream.end||r!=null&&n.pos>r)&&n.p.parser.stateFlag(n.state,2)&&(!e||e.score<n.score)&&(e=n)}return e}function mD(t){if(t.external){let e=t.extend?1:0;return(n,r)=>t.external(n,r)<<1|e}return t.get}let Hge=0;class Is{constructor(e,n,r){this.set=e,this.base=n,this.modified=r,this.id=Hge++}static define(e){if(e!=null&&e.base)throw new Error("Can not derive from a modified tag");let n=new Is([],null,[]);if(n.set.push(n),e)for(let r of e.set)n.set.push(r);return n}static defineModifier(){let e=new H0;return n=>n.modified.indexOf(e)>-1?n:H0.get(n.base||n,n.modified.concat(e).sort((r,i)=>r.id-i.id))}}let qge=0;class H0{constructor(){this.instances=[],this.id=qge++}static get(e,n){if(!n.length)return e;let r=n[0].instances.find(a=>a.base==e&&Kge(n,a.modified));if(r)return r;let i=[],o=new Is(i,e,n);for(let a of n)a.instances.push(o);let s=Gge(n);for(let a of e.set)if(!a.modified.length)for(let l of s)i.push(H0.get(a,l));return o}}function Kge(t,e){return t.length==e.length&&t.every((n,r)=>n==e[r])}function Gge(t){let e=[[]];for(let n=0;n<t.length;n++)for(let r=0,i=e.length;r<i;r++)e.push(e[r].concat(t[n]));return e.sort((n,r)=>r.length-n.length)}function Y9(t){let e=Object.create(null);for(let n in t){let r=t[n];Array.isArray(r)||(r=[r]);for(let i of n.split(" "))if(i){let o=[],s=2,a=i;for(let d=0;;){if(a=="..."&&d>0&&d+3==i.length){s=1;break}let p=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(a);if(!p)throw new RangeError("Invalid path: "+i);if(o.push(p[0]=="*"?"":p[0][0]=='"'?JSON.parse(p[0]):p[0]),d+=p[0].length,d==i.length)break;let m=i[d++];if(d==i.length&&m=="!"){s=0;break}if(m!="/")throw new RangeError("Invalid path: "+i);a=i.slice(d)}let l=o.length-1,c=o[l];if(!c)throw new RangeError("Invalid path: "+i);let f=new q0(r,s,l>0?o.slice(0,l):null);e[c]=f.sort(e[c])}}return X9.add(e)}const X9=new $t;class q0{constructor(e,n,r,i){this.tags=e,this.mode=n,this.context=r,this.next=i}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}}q0.empty=new q0([],2,null);function Z9(t,e){let n=Object.create(null);for(let o of t)if(!Array.isArray(o.tag))n[o.tag.id]=o.class;else for(let s of o.tag)n[s.id]=o.class;let{scope:r,all:i=null}=e||{};return{style:o=>{let s=i;for(let a of o)for(let l of a.set){let c=n[l.id];if(c){s=s?s+" "+c:c;break}}return s},scope:r}}function Yge(t,e){let n=null;for(let r of t){let i=r.style(e);i&&(n=n?n+" "+i:i)}return n}function Xge(t,e,n,r=0,i=t.length){let o=new Zge(r,Array.isArray(e)?e:[e],n);o.highlightRange(t.cursor(),r,i,"",o.highlighters),o.flush(i)}class Zge{constructor(e,n,r){this.at=e,this.highlighters=n,this.span=r,this.class=""}startSpan(e,n){n!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=n)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,n,r,i,o){let{type:s,from:a,to:l}=e;if(a>=r||l<=n)return;s.isTop&&(o=this.highlighters.filter(m=>!m.scope||m.scope(s)));let c=i,f=Qge(e)||q0.empty,d=Yge(o,f.tags);if(d&&(c&&(c+=" "),c+=d,f.mode==1&&(i+=(i?" ":"")+d)),this.startSpan(Math.max(n,a),c),f.opaque)return;let p=e.tree&&e.tree.prop($t.mounted);if(p&&p.overlay){let m=e.node.enter(p.overlay[0].from+a,1),v=this.highlighters.filter(S=>!S.scope||S.scope(p.tree.type)),b=e.firstChild();for(let S=0,x=a;;S++){let w=S<p.overlay.length?p.overlay[S]:null,C=w?w.from+a:l,T=Math.max(n,x),A=Math.min(r,C);if(T<A&&b)for(;e.from<A&&(this.highlightRange(e,T,A,i,o),this.startSpan(Math.min(A,e.to),c),!(e.to>=C||!e.nextSibling())););if(!w||C>r)break;x=w.to+a,x>n&&(this.highlightRange(m.cursor(),Math.max(n,w.from+a),Math.min(r,x),"",v),this.startSpan(Math.min(r,x),c))}b&&e.parent()}else if(e.firstChild()){p&&(i="");do if(!(e.to<=n)){if(e.from>=r)break;this.highlightRange(e,n,r,i,o),this.startSpan(Math.min(r,e.to),c)}while(e.nextSibling());e.parent()}}}function Qge(t){let e=t.type.prop(X9);for(;e&&e.context&&!t.matchContext(e.context);)e=e.next;return e||null}const Fe=Is.define,wv=Fe(),vl=Fe(),gD=Fe(vl),vD=Fe(vl),yl=Fe(),xv=Fe(yl),uS=Fe(yl),Ns=Fe(),wc=Fe(Ns),As=Fe(),Os=Fe(),_k=Fe(),Oh=Fe(_k),Sv=Fe(),me={comment:wv,lineComment:Fe(wv),blockComment:Fe(wv),docComment:Fe(wv),name:vl,variableName:Fe(vl),typeName:gD,tagName:Fe(gD),propertyName:vD,attributeName:Fe(vD),className:Fe(vl),labelName:Fe(vl),namespace:Fe(vl),macroName:Fe(vl),literal:yl,string:xv,docString:Fe(xv),character:Fe(xv),attributeValue:Fe(xv),number:uS,integer:Fe(uS),float:Fe(uS),bool:Fe(yl),regexp:Fe(yl),escape:Fe(yl),color:Fe(yl),url:Fe(yl),keyword:As,self:Fe(As),null:Fe(As),atom:Fe(As),unit:Fe(As),modifier:Fe(As),operatorKeyword:Fe(As),controlKeyword:Fe(As),definitionKeyword:Fe(As),moduleKeyword:Fe(As),operator:Os,derefOperator:Fe(Os),arithmeticOperator:Fe(Os),logicOperator:Fe(Os),bitwiseOperator:Fe(Os),compareOperator:Fe(Os),updateOperator:Fe(Os),definitionOperator:Fe(Os),typeOperator:Fe(Os),controlOperator:Fe(Os),punctuation:_k,separator:Fe(_k),bracket:Oh,angleBracket:Fe(Oh),squareBracket:Fe(Oh),paren:Fe(Oh),brace:Fe(Oh),content:Ns,heading:wc,heading1:Fe(wc),heading2:Fe(wc),heading3:Fe(wc),heading4:Fe(wc),heading5:Fe(wc),heading6:Fe(wc),contentSeparator:Fe(Ns),list:Fe(Ns),quote:Fe(Ns),emphasis:Fe(Ns),strong:Fe(Ns),link:Fe(Ns),monospace:Fe(Ns),strikethrough:Fe(Ns),inserted:Fe(),deleted:Fe(),changed:Fe(),invalid:Fe(),meta:Sv,documentMeta:Fe(Sv),annotation:Fe(Sv),processingInstruction:Fe(Sv),definition:Is.defineModifier(),constant:Is.defineModifier(),function:Is.defineModifier(),standard:Is.defineModifier(),local:Is.defineModifier(),special:Is.defineModifier()};Z9([{tag:me.link,class:"tok-link"},{tag:me.heading,class:"tok-heading"},{tag:me.emphasis,class:"tok-emphasis"},{tag:me.strong,class:"tok-strong"},{tag:me.keyword,class:"tok-keyword"},{tag:me.atom,class:"tok-atom"},{tag:me.bool,class:"tok-bool"},{tag:me.url,class:"tok-url"},{tag:me.labelName,class:"tok-labelName"},{tag:me.inserted,class:"tok-inserted"},{tag:me.deleted,class:"tok-deleted"},{tag:me.literal,class:"tok-literal"},{tag:me.string,class:"tok-string"},{tag:me.number,class:"tok-number"},{tag:[me.regexp,me.escape,me.special(me.string)],class:"tok-string2"},{tag:me.variableName,class:"tok-variableName"},{tag:me.local(me.variableName),class:"tok-variableName tok-local"},{tag:me.definition(me.variableName),class:"tok-variableName tok-definition"},{tag:me.special(me.variableName),class:"tok-variableName2"},{tag:me.definition(me.propertyName),class:"tok-propertyName tok-definition"},{tag:me.typeName,class:"tok-typeName"},{tag:me.namespace,class:"tok-namespace"},{tag:me.className,class:"tok-className"},{tag:me.macroName,class:"tok-macroName"},{tag:me.propertyName,class:"tok-propertyName"},{tag:me.operator,class:"tok-operator"},{tag:me.comment,class:"tok-comment"},{tag:me.meta,class:"tok-meta"},{tag:me.invalid,class:"tok-invalid"},{tag:me.punctuation,class:"tok-punctuation"}]);const Jge=Y9({String:me.string,Number:me.number,"True False":me.bool,PropertyName:me.propertyName,Null:me.null,",":me.separator,"[ ]":me.squareBracket,"{ }":me.brace}),eve=W0.deserialize({version:14,states:"$bOVQPOOOOQO'#Cb'#CbOnQPO'#CeOvQPO'#CjOOQO'#Cp'#CpQOQPOOOOQO'#Cg'#CgO}QPO'#CfO!SQPO'#CrOOQO,59P,59PO![QPO,59PO!aQPO'#CuOOQO,59U,59UO!iQPO,59UOVQPO,59QOqQPO'#CkO!nQPO,59^OOQO1G.k1G.kOVQPO'#ClO!vQPO,59aOOQO1G.p1G.pOOQO1G.l1G.lOOQO,59V,59VOOQO-E6i-E6iOOQO,59W,59WOOQO-E6j-E6j",stateData:"#O~OcOS~OQSORSOSSOTSOWQO]ROePO~OVXOeUO~O[[O~PVOg^O~Oh_OVfX~OVaO~OhbO[iX~O[dO~Oh_OVfa~OhbO[ia~O",goto:"!kjPPPPPPkPPkqwPPk{!RPPP!XP!ePP!hXSOR^bQWQRf_TVQ_Q`WRg`QcZRicQTOQZRQe^RhbRYQR]R",nodeNames:"⚠ JsonText True False Null Number String } { Object Property PropertyName ] [ Array",maxTerm:25,nodeProps:[["isolate",-2,6,11,""],["openedBy",7,"{",12,"["],["closedBy",8,"}",13,"]"]],propSources:[Jge],skippedNodes:[0],repeatNodeCount:2,tokenData:"(|~RaXY!WYZ!W]^!Wpq!Wrs!]|}$u}!O$z!Q!R%T!R![&c![!]&t!}#O&y#P#Q'O#Y#Z'T#b#c'r#h#i(Z#o#p(r#q#r(w~!]Oc~~!`Wpq!]qr!]rs!xs#O!]#O#P!}#P;'S!];'S;=`$o<%lO!]~!}Oe~~#QXrs!]!P!Q!]#O#P!]#U#V!]#Y#Z!]#b#c!]#f#g!]#h#i!]#i#j#m~#pR!Q![#y!c!i#y#T#Z#y~#|R!Q![$V!c!i$V#T#Z$V~$YR!Q![$c!c!i$c#T#Z$c~$fR!Q![!]!c!i!]#T#Z!]~$rP;=`<%l!]~$zOh~~$}Q!Q!R%T!R![&c~%YRT~!O!P%c!g!h%w#X#Y%w~%fP!Q![%i~%nRT~!Q![%i!g!h%w#X#Y%w~%zR{|&T}!O&T!Q![&Z~&WP!Q![&Z~&`PT~!Q![&Z~&hST~!O!P%c!Q![&c!g!h%w#X#Y%w~&yOg~~'OO]~~'TO[~~'WP#T#U'Z~'^P#`#a'a~'dP#g#h'g~'jP#X#Y'm~'rOR~~'uP#i#j'x~'{P#`#a(O~(RP#`#a(U~(ZOS~~(^P#f#g(a~(dP#i#j(g~(jP#X#Y(m~(rOQ~~(wOW~~(|OV~",tokenizers:[0],topRules:{JsonText:[0,1]},tokenPrec:0});class tn{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]=hd(this,e,n);let i=[];return this.decompose(0,e,i,2),r.length&&r.decompose(0,r.length,i,3),this.decompose(n,this.length,i,1),Fs.from(i,this.length-(n-e)+r.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,n=this.length){[e,n]=hd(this,e,n);let r=[];return this.decompose(e,n,r,0),Fs.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),i=new hp(this),o=new hp(e);for(let s=n,a=n;;){if(i.next(s),o.next(s),s=0,i.lineBreak!=o.lineBreak||i.done!=o.done||i.value!=o.value)return!1;if(a+=i.value.length,i.done||a>=r)return!0}}iter(e=1){return new hp(this,e)}iterRange(e,n=this.length){return new Q9(this,e,n)}iterLines(e,n){let r;if(e==null)r=this.iter();else{n==null&&(n=this.lines+1);let i=this.line(e).from;r=this.iterRange(i,Math.max(i,n==this.lines+1?this.length:n<=1?0:this.line(n-1).to))}return new J9(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]?tn.empty:e.length<=32?new Jn(e):Fs.from(Jn.split(e,[]))}}class Jn extends tn{constructor(e,n=tve(e)){super(),this.text=e,this.length=n}get lines(){return this.text.length}get children(){return null}lineInner(e,n,r,i){for(let o=0;;o++){let s=this.text[o],a=i+s.length;if((n?r:a)>=e)return new nve(i,a,r,s);i=a+1,r++}}decompose(e,n,r,i){let o=e<=0&&n>=this.length?this:new Jn(yD(this.text,e,n),Math.min(n,this.length)-Math.max(0,e));if(i&1){let s=r.pop(),a=yy(o.text,s.text.slice(),0,o.length);if(a.length<=32)r.push(new Jn(a,s.length+o.length));else{let l=a.length>>1;r.push(new Jn(a.slice(0,l)),new Jn(a.slice(l)))}}else r.push(o)}replace(e,n,r){if(!(r instanceof Jn))return super.replace(e,n,r);[e,n]=hd(this,e,n);let i=yy(this.text,yy(r.text,yD(this.text,0,e)),n),o=this.length+r.length-(n-e);return i.length<=32?new Jn(i,o):Fs.from(Jn.split(i,[]),o)}sliceString(e,n=this.length,r=`
210
+ `){[e,n]=hd(this,e,n);let i="";for(let o=0,s=0;o<=n&&s<this.text.length;s++){let a=this.text[s],l=o+a.length;o>e&&s&&(i+=r),e<l&&n>o&&(i+=a.slice(Math.max(0,e-o),n-o)),o=l+1}return i}flatten(e){for(let n of this.text)e.push(n)}scanIdentical(){return 0}static split(e,n){let r=[],i=-1;for(let o of e)r.push(o),i+=o.length+1,r.length==32&&(n.push(new Jn(r,i)),r=[],i=-1);return i>-1&&n.push(new Jn(r,i)),n}}class Fs extends tn{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,i){for(let o=0;;o++){let s=this.children[o],a=i+s.length,l=r+s.lines-1;if((n?l:a)>=e)return s.lineInner(e,n,r,i);i=a+1,r=l+1}}decompose(e,n,r,i){for(let o=0,s=0;s<=n&&o<this.children.length;o++){let a=this.children[o],l=s+a.length;if(e<=l&&n>=s){let c=i&((s<=e?1:0)|(l>=n?2:0));s>=e&&l<=n&&!c?r.push(a):a.decompose(e-s,n-s,r,c)}s=l+1}}replace(e,n,r){if([e,n]=hd(this,e,n),r.lines<this.lines)for(let i=0,o=0;i<this.children.length;i++){let s=this.children[i],a=o+s.length;if(e>=o&&n<=a){let l=s.replace(e-o,n-o,r),c=this.lines-s.lines+l.lines;if(l.lines<c>>4&&l.lines>c>>6){let f=this.children.slice();return f[i]=l,new Fs(f,this.length-(n-e)+r.length)}return super.replace(o,a,l)}o=a+1}return super.replace(e,n,r)}sliceString(e,n=this.length,r=`
211
+ `){[e,n]=hd(this,e,n);let i="";for(let o=0,s=0;o<this.children.length&&s<=n;o++){let a=this.children[o],l=s+a.length;s>e&&o&&(i+=r),e<l&&n>s&&(i+=a.sliceString(e-s,n-s,r)),s=l+1}return i}flatten(e){for(let n of this.children)n.flatten(e)}scanIdentical(e,n){if(!(e instanceof Fs))return 0;let r=0,[i,o,s,a]=n>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;i+=n,o+=n){if(i==s||o==a)return r;let l=this.children[i],c=e.children[o];if(l!=c)return r+l.scanIdentical(c,n);r+=l.length+1}}static from(e,n=e.reduce((r,i)=>r+i.length+1,-1)){let r=0;for(let m of e)r+=m.lines;if(r<32){let m=[];for(let v of e)v.flatten(m);return new Jn(m,n)}let i=Math.max(32,r>>5),o=i<<1,s=i>>1,a=[],l=0,c=-1,f=[];function d(m){let v;if(m.lines>o&&m instanceof Fs)for(let b of m.children)d(b);else m.lines>s&&(l>s||!l)?(p(),a.push(m)):m instanceof Jn&&l&&(v=f[f.length-1])instanceof Jn&&m.lines+v.lines<=32?(l+=m.lines,c+=m.length+1,f[f.length-1]=new Jn(v.text.concat(m.text),v.length+1+m.length)):(l+m.lines>i&&p(),l+=m.lines,c+=m.length+1,f.push(m))}function p(){l!=0&&(a.push(f.length==1?f[0]:Fs.from(f,c)),c=-1,l=f.length=0)}for(let m of e)d(m);return p(),a.length==1?a[0]:new Fs(a,n)}}tn.empty=new Jn([""],0);function tve(t){let e=-1;for(let n of t)e+=n.length+1;return e}function yy(t,e,n=0,r=1e9){for(let i=0,o=0,s=!0;o<t.length&&i<=r;o++){let a=t[o],l=i+a.length;l>=n&&(l>r&&(a=a.slice(0,r-i)),i<n&&(a=a.slice(n-i)),s?(e[e.length-1]+=a,s=!1):e.push(a)),i=l+1}return e}function yD(t,e,n){return yy(t,[""],e,n)}class hp{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 Jn?e.text.length:e.children.length)<<1]}nextInner(e,n){for(this.done=this.lineBreak=!1;;){let r=this.nodes.length-1,i=this.nodes[r],o=this.offsets[r],s=o>>1,a=i instanceof Jn?i.text.length:i.children.length;if(s==(n>0?a: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((o&1)==(n>0?0:1)){if(this.offsets[r]+=n,e==0)return this.lineBreak=!0,this.value=`
212
+ `,this;e--}else if(i instanceof Jn){let l=i.text[s+(n<0?-1:0)];if(this.offsets[r]+=n,l.length>Math.max(0,e))return this.value=e==0?l:n>0?l.slice(e):l.slice(0,l.length-e),this;e-=l.length}else{let l=i.children[s+(n<0?-1:0)];e>l.length?(e-=l.length,this.offsets[r]+=n):(n<0&&this.offsets[r]--,this.nodes.push(l),this.offsets.push(n>0?1:(l instanceof Jn?l.text.length:l.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class Q9{constructor(e,n,r){this.value="",this.done=!1,this.cursor=new hp(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:i}=this.cursor.next(e);return this.pos+=(i.length+e)*n,this.value=i.length<=r?i:n<0?i.slice(i.length-r):i.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 J9{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:n,lineBreak:r,value:i}=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=i,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(tn.prototype[Symbol.iterator]=function(){return this.iter()},hp.prototype[Symbol.iterator]=Q9.prototype[Symbol.iterator]=J9.prototype[Symbol.iterator]=function(){return this});class nve{constructor(e,n,r,i){this.from=e,this.to=n,this.number=r,this.text=i}get length(){return this.to-this.from}}function hd(t,e,n){return e=Math.max(0,Math.min(t.length,e)),[e,Math.max(e,Math.min(t.length,n))]}let Wf="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,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(t=>t?parseInt(t,36):1);for(let t=1;t<Wf.length;t++)Wf[t]+=Wf[t-1];function rve(t){for(let e=1;e<Wf.length;e+=2)if(Wf[e]>t)return Wf[e-1]<=t;return!1}function bD(t){return t>=127462&&t<=127487}const wD=8205;function $r(t,e,n=!0,r=!0){return(n?e8:ive)(t,e,r)}function e8(t,e,n){if(e==t.length)return e;e&&t8(t.charCodeAt(e))&&n8(t.charCodeAt(e-1))&&e--;let r=Mr(t,e);for(e+=Oo(r);e<t.length;){let i=Mr(t,e);if(r==wD||i==wD||n&&rve(i))e+=Oo(i),r=i;else if(bD(i)){let o=0,s=e-2;for(;s>=0&&bD(Mr(t,s));)o++,s-=2;if(o%2==0)break;e+=2}else break}return e}function ive(t,e,n){for(;e>0;){let r=e8(t,e-2,n);if(r<e)return r;e--}return 0}function t8(t){return t>=56320&&t<57344}function n8(t){return t>=55296&&t<56320}function Mr(t,e){let n=t.charCodeAt(e);if(!n8(n)||e+1==t.length)return n;let r=t.charCodeAt(e+1);return t8(r)?(n-55296<<10)+(r-56320)+65536:n}function dT(t){return t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode((t>>10)+55296,(t&1023)+56320))}function Oo(t){return t<65536?1:2}const Tk=/\r\n?|\n/;var li=function(t){return t[t.Simple=0]="Simple",t[t.TrackDel=1]="TrackDel",t[t.TrackBefore=2]="TrackBefore",t[t.TrackAfter=3]="TrackAfter",t}(li||(li={}));class Gs{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,i=0;n<this.sections.length;){let o=this.sections[n++],s=this.sections[n++];s<0?(e(r,i,o),i+=o):i+=s,r+=o}}iterChangedRanges(e,n=!1){Ak(this,e,n)}get invertedDesc(){let e=[];for(let n=0;n<this.sections.length;){let r=this.sections[n++],i=this.sections[n++];i<0?e.push(r,i):e.push(i,r)}return new Gs(e)}composeDesc(e){return this.empty?e:e.empty?this:r8(this,e)}mapDesc(e,n=!1){return e.empty?this:Ok(this,e,n)}mapPos(e,n=-1,r=li.Simple){let i=0,o=0;for(let s=0;s<this.sections.length;){let a=this.sections[s++],l=this.sections[s++],c=i+a;if(l<0){if(c>e)return o+(e-i);o+=a}else{if(r!=li.Simple&&c>=e&&(r==li.TrackDel&&i<e&&c>e||r==li.TrackBefore&&i<e||r==li.TrackAfter&&c>e))return null;if(c>e||c==e&&n<0&&!a)return e==i||n<0?o:o+l;o+=l}i=c}if(e>i)throw new RangeError(`Position ${e} is out of range for changeset of length ${i}`);return o}touchesRange(e,n=e){for(let r=0,i=0;r<this.sections.length&&i<=n;){let o=this.sections[r++],s=this.sections[r++],a=i+o;if(s>=0&&i<=n&&a>=e)return i<e&&a>n?"cover":!0;i=a}return!1}toString(){let e="";for(let n=0;n<this.sections.length;){let r=this.sections[n++],i=this.sections[n++];e+=(e?" ":"")+r+(i>=0?":"+i:"")}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 Gs(e)}static create(e){return new Gs(e)}}class pr extends Gs{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 Ak(this,(n,r,i,o,s)=>e=e.replace(i,i+(r-n),s),!1),e}mapDesc(e,n=!1){return Ok(this,e,n,!0)}invert(e){let n=this.sections.slice(),r=[];for(let i=0,o=0;i<n.length;i+=2){let s=n[i],a=n[i+1];if(a>=0){n[i]=a,n[i+1]=s;let l=i>>1;for(;r.length<l;)r.push(tn.empty);r.push(s?e.slice(o,o+s):tn.empty)}o+=s}return new pr(n,r)}compose(e){return this.empty?e:e.empty?this:r8(this,e,!0)}map(e,n=!1){return e.empty?this:Ok(this,e,n,!0)}iterChanges(e,n=!1){Ak(this,e,n)}get desc(){return Gs.create(this.sections)}filter(e){let n=[],r=[],i=[],o=new am(this);e:for(let s=0,a=0;;){let l=s==e.length?1e9:e[s++];for(;a<l||a==l&&o.len==0;){if(o.done)break e;let f=Math.min(o.len,l-a);qr(i,f,-1);let d=o.ins==-1?-1:o.off==0?o.ins:0;qr(n,f,d),d>0&&Tl(r,n,o.text),o.forward(f),a+=f}let c=e[s++];for(;a<c;){if(o.done)break e;let f=Math.min(o.len,c-a);qr(n,f,-1),qr(i,f,o.ins==-1?-1:o.off==0?o.ins:0),o.forward(f),a+=f}}return{changes:new pr(n,r),filtered:Gs.create(i)}}toJSON(){let e=[];for(let n=0;n<this.sections.length;n+=2){let r=this.sections[n],i=this.sections[n+1];i<0?e.push(r):i==0?e.push([r]):e.push([r].concat(this.inserted[n>>1].toJSON()))}return e}static of(e,n,r){let i=[],o=[],s=0,a=null;function l(f=!1){if(!f&&!i.length)return;s<n&&qr(i,n-s,-1);let d=new pr(i,o);a=a?a.compose(d.map(a)):d,i=[],o=[],s=0}function c(f){if(Array.isArray(f))for(let d of f)c(d);else if(f instanceof pr){if(f.length!=n)throw new RangeError(`Mismatched change set length (got ${f.length}, expected ${n})`);l(),a=a?a.compose(f.map(a)):f}else{let{from:d,to:p=d,insert:m}=f;if(d>p||d<0||p>n)throw new RangeError(`Invalid change range ${d} to ${p} (in doc of length ${n})`);let v=m?typeof m=="string"?tn.of(m.split(r||Tk)):m:tn.empty,b=v.length;if(d==p&&b==0)return;d<s&&l(),d>s&&qr(i,d-s,-1),qr(i,p-d,b),Tl(o,i,v),s=p}}return c(e),l(!a),a}static empty(e){return new pr(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let n=[],r=[];for(let i=0;i<e.length;i++){let o=e[i];if(typeof o=="number")n.push(o,-1);else{if(!Array.isArray(o)||typeof o[0]!="number"||o.some((s,a)=>a&&typeof s!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(o.length==1)n.push(o[0],0);else{for(;r.length<i;)r.push(tn.empty);r[i]=tn.of(o.slice(1)),n.push(o[0],r[i].length)}}}return new pr(n,r)}static createSet(e,n){return new pr(e,n)}}function qr(t,e,n,r=!1){if(e==0&&n<=0)return;let i=t.length-2;i>=0&&n<=0&&n==t[i+1]?t[i]+=e:e==0&&t[i]==0?t[i+1]+=n:r?(t[i]+=e,t[i+1]+=n):t.push(e,n)}function Tl(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(tn.empty);t.push(n)}}function Ak(t,e,n){let r=t.inserted;for(let i=0,o=0,s=0;s<t.sections.length;){let a=t.sections[s++],l=t.sections[s++];if(l<0)i+=a,o+=a;else{let c=i,f=o,d=tn.empty;for(;c+=a,f+=l,l&&r&&(d=d.append(r[s-2>>1])),!(n||s==t.sections.length||t.sections[s+1]<0);)a=t.sections[s++],l=t.sections[s++];e(i,c,o,f,d),i=c,o=f}}}function Ok(t,e,n,r=!1){let i=[],o=r?[]:null,s=new am(t),a=new am(e);for(let l=-1;;)if(s.ins==-1&&a.ins==-1){let c=Math.min(s.len,a.len);qr(i,c,-1),s.forward(c),a.forward(c)}else if(a.ins>=0&&(s.ins<0||l==s.i||s.off==0&&(a.len<s.len||a.len==s.len&&!n))){let c=a.len;for(qr(i,a.ins,-1);c;){let f=Math.min(s.len,c);s.ins>=0&&l<s.i&&s.len<=f&&(qr(i,0,s.ins),o&&Tl(o,i,s.text),l=s.i),s.forward(f),c-=f}a.next()}else if(s.ins>=0){let c=0,f=s.len;for(;f;)if(a.ins==-1){let d=Math.min(f,a.len);c+=d,f-=d,a.forward(d)}else if(a.ins==0&&a.len<f)f-=a.len,a.next();else break;qr(i,c,l<s.i?s.ins:0),o&&l<s.i&&Tl(o,i,s.text),l=s.i,s.forward(s.len-f)}else{if(s.done&&a.done)return o?pr.createSet(i,o):Gs.create(i);throw new Error("Mismatched change set lengths")}}function r8(t,e,n=!1){let r=[],i=n?[]:null,o=new am(t),s=new am(e);for(let a=!1;;){if(o.done&&s.done)return i?pr.createSet(r,i):Gs.create(r);if(o.ins==0)qr(r,o.len,0,a),o.next();else if(s.len==0&&!s.done)qr(r,0,s.ins,a),i&&Tl(i,r,s.text),s.next();else{if(o.done||s.done)throw new Error("Mismatched change set lengths");{let l=Math.min(o.len2,s.len),c=r.length;if(o.ins==-1){let f=s.ins==-1?-1:s.off?0:s.ins;qr(r,l,f,a),i&&f&&Tl(i,r,s.text)}else s.ins==-1?(qr(r,o.off?0:o.len,l,a),i&&Tl(i,r,o.textBit(l))):(qr(r,o.off?0:o.len,s.off?0:s.ins,a),i&&!s.off&&Tl(i,r,s.text));a=(o.ins>l||s.ins>=0&&s.len>l)&&(a||r.length>c),o.forward2(l),s.forward(l)}}}}class am{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?tn.empty:e[n]}textBit(e){let{inserted:n}=this.set,r=this.i-2>>1;return r>=n.length&&!e?tn.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 Uc{constructor(e,n,r){this.from=e,this.to=n,this.flags=r}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 bidiLevel(){let e=this.flags&7;return e==7?null:e}get goalColumn(){let e=this.flags>>6;return e==16777215?void 0:e}map(e,n=-1){let r,i;return this.empty?r=i=e.mapPos(this.from,n):(r=e.mapPos(this.from,1),i=e.mapPos(this.to,-1)),r==this.from&&i==this.to?this:new Uc(r,i,this.flags)}extend(e,n=e){if(e<=this.anchor&&n>=this.anchor)return be.range(e,n);let r=Math.abs(e-this.anchor)>Math.abs(n-this.anchor)?e:n;return be.range(this.anchor,r)}eq(e,n=!1){return this.anchor==e.anchor&&this.head==e.head&&(!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 be.range(e.anchor,e.head)}static create(e,n,r){return new Uc(e,n,r)}}class be{constructor(e,n){this.ranges=e,this.mainIndex=n}map(e,n=-1){return e.empty?this:be.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 be([this.main],0)}addRange(e,n=!0){return be.create([e].concat(this.ranges),n?0:this.mainIndex+1)}replaceRange(e,n=this.mainIndex){let r=this.ranges.slice();return r[n]=e,be.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 be(e.ranges.map(n=>Uc.fromJSON(n)),e.main)}static single(e,n=e){return new be([be.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,i=0;i<e.length;i++){let o=e[i];if(o.empty?o.from<=r:o.from<r)return be.normalized(e.slice(),n);r=o.to}return new be(e,n)}static cursor(e,n=0,r,i){return Uc.create(e,e,(n==0?0:n<0?8:16)|(r==null?7:Math.min(6,r))|(i??16777215)<<6)}static range(e,n,r,i){let o=(r??16777215)<<6|(i==null?7:Math.min(6,i));return n<e?Uc.create(n,e,48|o):Uc.create(e,n,(n>e?8:0)|o)}static normalized(e,n=0){let r=e[n];e.sort((i,o)=>i.from-o.from),n=e.indexOf(r);for(let i=1;i<e.length;i++){let o=e[i],s=e[i-1];if(o.empty?o.from<=s.to:o.from<s.to){let a=s.from,l=Math.max(o.to,s.to);i<=n&&n--,e.splice(--i,2,o.anchor>o.head?be.range(l,a):be.range(a,l))}}return new be(e,n)}}function i8(t,e){for(let n of t.ranges)if(n.to>e)throw new RangeError("Selection points outside of document")}let hT=0;class Je{constructor(e,n,r,i,o){this.combine=e,this.compareInput=n,this.compare=r,this.isStatic=i,this.id=hT++,this.default=e([]),this.extensions=typeof o=="function"?o(this):o}get reader(){return this}static define(e={}){return new Je(e.combine||(n=>n),e.compareInput||((n,r)=>n===r),e.compare||(e.combine?(n,r)=>n===r:pT),!!e.static,e.enables)}of(e){return new by([],this,0,e)}compute(e,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new by(e,this,1,n)}computeN(e,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new by(e,this,2,n)}from(e,n){return n||(n=r=>r),this.compute([e],r=>n(r.field(e)))}}function pT(t,e){return t==e||t.length==e.length&&t.every((n,r)=>n===e[r])}class by{constructor(e,n,r,i){this.dependencies=e,this.facet=n,this.type=r,this.value=i,this.id=hT++}dynamicSlot(e){var n;let r=this.value,i=this.facet.compareInput,o=this.id,s=e[o]>>1,a=this.type==2,l=!1,c=!1,f=[];for(let d of this.dependencies)d=="doc"?l=!0:d=="selection"?c=!0:((n=e[d.id])!==null&&n!==void 0?n:1)&1||f.push(e[d.id]);return{create(d){return d.values[s]=r(d),1},update(d,p){if(l&&p.docChanged||c&&(p.docChanged||p.selection)||Rk(d,f)){let m=r(d);if(a?!xD(m,d.values[s],i):!i(m,d.values[s]))return d.values[s]=m,1}return 0},reconfigure:(d,p)=>{let m,v=p.config.address[o];if(v!=null){let b=G0(p,v);if(this.dependencies.every(S=>S instanceof Je?p.facet(S)===d.facet(S):S instanceof Fr?p.field(S,!1)==d.field(S,!1):!0)||(a?xD(m=r(d),b,i):i(m=r(d),b)))return d.values[s]=b,0}else m=r(d);return d.values[s]=m,1}}}}function xD(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 Rk(t,e){let n=!1;for(let r of e)pp(t,r)&1&&(n=!0);return n}function ove(t,e,n){let r=n.map(l=>t[l.id]),i=n.map(l=>l.type),o=r.filter(l=>!(l&1)),s=t[e.id]>>1;function a(l){let c=[];for(let f=0;f<r.length;f++){let d=G0(l,r[f]);if(i[f]==2)for(let p of d)c.push(p);else c.push(d)}return e.combine(c)}return{create(l){for(let c of r)pp(l,c);return l.values[s]=a(l),1},update(l,c){if(!Rk(l,o))return 0;let f=a(l);return e.compare(f,l.values[s])?0:(l.values[s]=f,1)},reconfigure(l,c){let f=Rk(l,r),d=c.config.facets[e.id],p=c.facet(e);if(d&&!f&&pT(n,d))return l.values[s]=p,0;let m=a(l);return e.compare(m,p)?(l.values[s]=p,0):(l.values[s]=m,1)}}}const SD=Je.define({static:!0});class Fr{constructor(e,n,r,i,o){this.id=e,this.createF=n,this.updateF=r,this.compareF=i,this.spec=o,this.provides=void 0}static define(e){let n=new Fr(hT++,e.create,e.update,e.compare||((r,i)=>r===i),e);return e.provide&&(n.provides=e.provide(n)),n}create(e){let n=e.facet(SD).find(r=>r.field==this);return((n==null?void 0: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,i)=>{let o=r.values[n],s=this.updateF(o,i);return this.compareF(o,s)?0:(r.values[n]=s,1)},reconfigure:(r,i)=>i.config.address[this.id]!=null?(r.values[n]=i.field(this),0):(r.values[n]=this.create(r),1)}}init(e){return[this,SD.of({field:this,create:e})]}get extension(){return this}}const Pc={lowest:4,low:3,default:2,high:1,highest:0};function Rh(t){return e=>new o8(e,t)}const Fd={highest:Rh(Pc.highest),high:Rh(Pc.high),default:Rh(Pc.default),low:Rh(Pc.low),lowest:Rh(Pc.lowest)};class o8{constructor(e,n){this.inner=e,this.prec=n}}class b1{of(e){return new Pk(this,e)}reconfigure(e){return b1.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class Pk{constructor(e,n){this.compartment=e,this.inner=n}}class K0{constructor(e,n,r,i,o,s){for(this.base=e,this.compartments=n,this.dynamicSlots=r,this.address=i,this.staticValues=o,this.facets=s,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 i=[],o=Object.create(null),s=new Map;for(let p of sve(e,n,s))p instanceof Fr?i.push(p):(o[p.facet.id]||(o[p.facet.id]=[])).push(p);let a=Object.create(null),l=[],c=[];for(let p of i)a[p.id]=c.length<<1,c.push(m=>p.slot(m));let f=r==null?void 0:r.config.facets;for(let p in o){let m=o[p],v=m[0].facet,b=f&&f[p]||[];if(m.every(S=>S.type==0))if(a[v.id]=l.length<<1|1,pT(b,m))l.push(r.facet(v));else{let S=v.combine(m.map(x=>x.value));l.push(r&&v.compare(S,r.facet(v))?r.facet(v):S)}else{for(let S of m)S.type==0?(a[S.id]=l.length<<1|1,l.push(S.value)):(a[S.id]=c.length<<1,c.push(x=>S.dynamicSlot(x)));a[v.id]=c.length<<1,c.push(S=>ove(S,v,m))}}let d=c.map(p=>p(a));return new K0(e,s,d,a,l,o)}}function sve(t,e,n){let r=[[],[],[],[],[]],i=new Map;function o(s,a){let l=i.get(s);if(l!=null){if(l<=a)return;let c=r[l].indexOf(s);c>-1&&r[l].splice(c,1),s instanceof Pk&&n.delete(s.compartment)}if(i.set(s,a),Array.isArray(s))for(let c of s)o(c,a);else if(s instanceof Pk){if(n.has(s.compartment))throw new RangeError("Duplicate use of compartment in extensions");let c=e.get(s.compartment)||s.inner;n.set(s.compartment,c),o(c,a)}else if(s instanceof o8)o(s.inner,s.prec);else if(s instanceof Fr)r[a].push(s),s.provides&&o(s.provides,a);else if(s instanceof by)r[a].push(s),s.facet.extensions&&o(s.facet.extensions,Pc.default);else{let c=s.extension;if(!c)throw new Error(`Unrecognized extension value in extension set (${s}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);o(c,a)}}return o(t,Pc.default),r.reduce((s,a)=>s.concat(a))}function pp(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 i=t.computeSlot(t,t.config.dynamicSlots[n]);return t.status[n]=2|i}function G0(t,e){return e&1?t.config.staticValues[e>>1]:t.values[e>>1]}const s8=Je.define(),Nk=Je.define({combine:t=>t.some(e=>e),static:!0}),a8=Je.define({combine:t=>t.length?t[0]:void 0,static:!0}),l8=Je.define(),c8=Je.define(),u8=Je.define(),f8=Je.define({combine:t=>t.length?t[0]:!1});class oa{constructor(e,n){this.type=e,this.value=n}static define(){return new ave}}class ave{of(e){return new oa(this,e)}}class lve{constructor(e){this.map=e}of(e){return new Ot(this,e)}}class Ot{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 Ot(this.type,n)}is(e){return this.type==e}static define(e={}){return new lve(e.map||(n=>n))}static mapEffects(e,n){if(!e.length)return e;let r=[];for(let i of e){let o=i.map(n);o&&r.push(o)}return r}}Ot.reconfigure=Ot.define();Ot.appendConfig=Ot.define();class gr{constructor(e,n,r,i,o,s){this.startState=e,this.changes=n,this.selection=r,this.effects=i,this.annotations=o,this.scrollIntoView=s,this._doc=null,this._state=null,r&&i8(r,n.newLength),o.some(a=>a.type==gr.time)||(this.annotations=o.concat(gr.time.of(Date.now())))}static create(e,n,r,i,o,s){return new gr(e,n,r,i,o,s)}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(gr.userEvent);return!!(n&&(n==e||n.length>e.length&&n.slice(0,e.length)==e&&n[e.length]=="."))}}gr.time=oa.define();gr.userEvent=oa.define();gr.addToHistory=oa.define();gr.remote=oa.define();function cve(t,e){let n=[];for(let r=0,i=0;;){let o,s;if(r<t.length&&(i==e.length||e[i]>=t[r]))o=t[r++],s=t[r++];else if(i<e.length)o=e[i++],s=e[i++];else return n;!n.length||n[n.length-1]<o?n.push(o,s):n[n.length-1]<s&&(n[n.length-1]=s)}}function d8(t,e,n){var r;let i,o,s;return n?(i=e.changes,o=pr.empty(e.changes.length),s=t.changes.compose(e.changes)):(i=e.changes.map(t.changes),o=t.changes.mapDesc(e.changes,!0),s=t.changes.compose(i)),{changes:s,selection:e.selection?e.selection.map(o):(r=t.selection)===null||r===void 0?void 0:r.map(i),effects:Ot.mapEffects(t.effects,i).concat(Ot.mapEffects(e.effects,o)),annotations:t.annotations.length?t.annotations.concat(e.annotations):e.annotations,scrollIntoView:t.scrollIntoView||e.scrollIntoView}}function Mk(t,e,n){let r=e.selection,i=Hf(e.annotations);return e.userEvent&&(i=i.concat(gr.userEvent.of(e.userEvent))),{changes:e.changes instanceof pr?e.changes:pr.of(e.changes||[],n,t.facet(a8)),selection:r&&(r instanceof be?r:be.single(r.anchor,r.head)),effects:Hf(e.effects),annotations:i,scrollIntoView:!!e.scrollIntoView}}function h8(t,e,n){let r=Mk(t,e.length?e[0]:{},t.doc.length);e.length&&e[0].filter===!1&&(n=!1);for(let o=1;o<e.length;o++){e[o].filter===!1&&(n=!1);let s=!!e[o].sequential;r=d8(r,Mk(t,e[o],s?r.changes.newLength:t.doc.length),s)}let i=gr.create(t,r.changes,r.selection,r.effects,r.annotations,r.scrollIntoView);return fve(n?uve(i):i)}function uve(t){let e=t.startState,n=!0;for(let i of e.facet(l8)){let o=i(t);if(o===!1){n=!1;break}Array.isArray(o)&&(n=n===!0?o:cve(n,o))}if(n!==!0){let i,o;if(n===!1)o=t.changes.invertedDesc,i=pr.empty(e.doc.length);else{let s=t.changes.filter(n);i=s.changes,o=s.filtered.mapDesc(s.changes).invertedDesc}t=gr.create(e,i,t.selection&&t.selection.map(o),Ot.mapEffects(t.effects,o),t.annotations,t.scrollIntoView)}let r=e.facet(c8);for(let i=r.length-1;i>=0;i--){let o=r[i](t);o instanceof gr?t=o:Array.isArray(o)&&o.length==1&&o[0]instanceof gr?t=o[0]:t=h8(e,Hf(o),!1)}return t}function fve(t){let e=t.startState,n=e.facet(u8),r=t;for(let i=n.length-1;i>=0;i--){let o=n[i](t);o&&Object.keys(o).length&&(r=d8(r,Mk(e,o,t.changes.newLength),!0))}return r==t?t:gr.create(e,t.changes,t.selection,r.effects,r.annotations,r.scrollIntoView)}const dve=[];function Hf(t){return t==null?dve:Array.isArray(t)?t:[t]}var Ln=function(t){return t[t.Word=0]="Word",t[t.Space=1]="Space",t[t.Other=2]="Other",t}(Ln||(Ln={}));const hve=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let Dk;try{Dk=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function pve(t){if(Dk)return Dk.test(t);for(let e=0;e<t.length;e++){let n=t[e];if(/\w/.test(n)||n>"€"&&(n.toUpperCase()!=n.toLowerCase()||hve.test(n)))return!0}return!1}function mve(t){return e=>{if(!/\S/.test(e))return Ln.Space;if(pve(e))return Ln.Word;for(let n=0;n<t.length;n++)if(e.indexOf(t[n])>-1)return Ln.Word;return Ln.Other}}class Ht{constructor(e,n,r,i,o,s){this.config=e,this.doc=n,this.selection=r,this.values=i,this.status=e.statusTemplate.slice(),this.computeSlot=o,s&&(s._state=this);for(let a=0;a<this.config.dynamicSlots.length;a++)pp(this,a<<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 pp(this,r),G0(this,r)}update(...e){return h8(this,e,!0)}applyTransaction(e){let n=this.config,{base:r,compartments:i}=n;for(let a of e.effects)a.is(b1.reconfigure)?(n&&(i=new Map,n.compartments.forEach((l,c)=>i.set(c,l)),n=null),i.set(a.value.compartment,a.value.extension)):a.is(Ot.reconfigure)?(n=null,r=a.value):a.is(Ot.appendConfig)&&(n=null,r=Hf(r).concat(a.value));let o;n?o=e.startState.values.slice():(n=K0.resolve(r,i,this),o=new Ht(n,this.doc,this.selection,n.dynamicSlots.map(()=>null),(l,c)=>c.reconfigure(l,this),null).values);let s=e.startState.facet(Nk)?e.newSelection:e.newSelection.asSingle();new Ht(n,e.newDoc,s,o,(a,l)=>l.update(a,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:be.cursor(n.from+e.length)}))}changeByRange(e){let n=this.selection,r=e(n.ranges[0]),i=this.changes(r.changes),o=[r.range],s=Hf(r.effects);for(let a=1;a<n.ranges.length;a++){let l=e(n.ranges[a]),c=this.changes(l.changes),f=c.map(i);for(let p=0;p<a;p++)o[p]=o[p].map(f);let d=i.mapDesc(c,!0);o.push(l.range.map(d)),i=i.compose(f),s=Ot.mapEffects(s,f).concat(Ot.mapEffects(Hf(l.effects),d))}return{changes:i,selection:be.create(o,n.mainIndex),effects:s}}changes(e=[]){return e instanceof pr?e:pr.of(e,this.doc.length,this.facet(Ht.lineSeparator))}toText(e){return tn.of(e.split(this.facet(Ht.lineSeparator)||Tk))}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:(pp(this,n),G0(this,n))}toJSON(e){let n={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(let r in e){let i=e[r];i instanceof Fr&&this.config.address[i.id]!=null&&(n[r]=i.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 i=[];if(r){for(let o in r)if(Object.prototype.hasOwnProperty.call(e,o)){let s=r[o],a=e[o];i.push(s.init(l=>s.spec.fromJSON(a,l)))}}return Ht.create({doc:e.doc,selection:be.fromJSON(e.selection),extensions:n.extensions?i.concat([n.extensions]):i})}static create(e={}){let n=K0.resolve(e.extensions||[],new Map),r=e.doc instanceof tn?e.doc:tn.of((e.doc||"").split(n.staticFacet(Ht.lineSeparator)||Tk)),i=e.selection?e.selection instanceof be?e.selection:be.single(e.selection.anchor,e.selection.head):be.single(0);return i8(i,r.length),n.staticFacet(Nk)||(i=i.asSingle()),new Ht(n,r,i,n.dynamicSlots.map(()=>null),(o,s)=>s.create(o),null)}get tabSize(){return this.facet(Ht.tabSize)}get lineBreak(){return this.facet(Ht.lineSeparator)||`
213
+ `}get readOnly(){return this.facet(f8)}phrase(e,...n){for(let r of this.facet(Ht.phrases))if(Object.prototype.hasOwnProperty.call(r,e)){e=r[e];break}return n.length&&(e=e.replace(/\$(\$|\d*)/g,(r,i)=>{if(i=="$")return"$";let o=+(i||1);return!o||o>n.length?r:n[o-1]})),e}languageDataAt(e,n,r=-1){let i=[];for(let o of this.facet(s8))for(let s of o(this,n,r))Object.prototype.hasOwnProperty.call(s,e)&&i.push(s[e]);return i}charCategorizer(e){return mve(this.languageDataAt("wordChars",e).join(""))}wordAt(e){let{text:n,from:r,length:i}=this.doc.lineAt(e),o=this.charCategorizer(e),s=e-r,a=e-r;for(;s>0;){let l=$r(n,s,!1);if(o(n.slice(l,s))!=Ln.Word)break;s=l}for(;a<i;){let l=$r(n,a);if(o(n.slice(a,l))!=Ln.Word)break;a=l}return s==a?null:be.range(s+r,a+r)}}Ht.allowMultipleSelections=Nk;Ht.tabSize=Je.define({combine:t=>t.length?t[0]:4});Ht.lineSeparator=a8;Ht.readOnly=f8;Ht.phrases=Je.define({compare(t,e){let n=Object.keys(t),r=Object.keys(e);return n.length==r.length&&n.every(i=>t[i]==e[i])}});Ht.languageData=s8;Ht.changeFilter=l8;Ht.transactionFilter=c8;Ht.transactionExtender=u8;b1.reconfigure=Ot.define();function sa(t,e,n={}){let r={};for(let i of t)for(let o of Object.keys(i)){let s=i[o],a=r[o];if(a===void 0)r[o]=s;else if(!(a===s||s===void 0))if(Object.hasOwnProperty.call(n,o))r[o]=n[o](a,s);else throw new Error("Config merge conflict for field "+o)}for(let i in e)r[i]===void 0&&(r[i]=e[i]);return r}class gu{eq(e){return this==e}range(e,n=e){return lm.create(e,n,this)}}gu.prototype.startSide=gu.prototype.endSide=0;gu.prototype.point=!1;gu.prototype.mapMode=li.TrackDel;class lm{constructor(e,n,r){this.from=e,this.to=n,this.value=r}static create(e,n,r){return new lm(e,n,r)}}function Lk(t,e){return t.from-e.from||t.value.startSide-e.value.startSide}class mT{constructor(e,n,r,i){this.from=e,this.to=n,this.value=r,this.maxPoint=i}get length(){return this.to[this.to.length-1]}findIndex(e,n,r,i=0){let o=r?this.to:this.from;for(let s=i,a=o.length;;){if(s==a)return s;let l=s+a>>1,c=o[l]-e||(r?this.value[l].endSide:this.value[l].startSide)-n;if(l==s)return c>=0?s:a;c>=0?a=l:s=l+1}}between(e,n,r,i){for(let o=this.findIndex(n,-1e9,!0),s=this.findIndex(r,1e9,!1,o);o<s;o++)if(i(this.from[o]+e,this.to[o]+e,this.value[o])===!1)return!1}map(e,n){let r=[],i=[],o=[],s=-1,a=-1;for(let l=0;l<this.value.length;l++){let c=this.value[l],f=this.from[l]+e,d=this.to[l]+e,p,m;if(f==d){let v=n.mapPos(f,c.startSide,c.mapMode);if(v==null||(p=m=v,c.startSide!=c.endSide&&(m=n.mapPos(f,c.endSide),m<p)))continue}else if(p=n.mapPos(f,c.startSide),m=n.mapPos(d,c.endSide),p>m||p==m&&c.startSide>0&&c.endSide<=0)continue;(m-p||c.endSide-c.startSide)<0||(s<0&&(s=p),c.point&&(a=Math.max(a,m-p)),r.push(c),i.push(p-s),o.push(m-s))}return{mapped:r.length?new mT(i,o,r,a):null,pos:s}}}class Gt{constructor(e,n,r,i){this.chunkPos=e,this.chunk=n,this.nextLayer=r,this.maxPoint=i}static create(e,n,r,i){return new Gt(e,n,r,i)}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:i=0,filterTo:o=this.length}=e,s=e.filter;if(n.length==0&&!s)return this;if(r&&(n=n.slice().sort(Lk)),this.isEmpty)return n.length?Gt.of(n):this;let a=new p8(this,null,-1).goto(0),l=0,c=[],f=new Ql;for(;a.value||l<n.length;)if(l<n.length&&(a.from-n[l].from||a.startSide-n[l].value.startSide)>=0){let d=n[l++];f.addInner(d.from,d.to,d.value)||c.push(d)}else a.rangeIndex==1&&a.chunkIndex<this.chunk.length&&(l==n.length||this.chunkEnd(a.chunkIndex)<n[l].from)&&(!s||i>this.chunkEnd(a.chunkIndex)||o<this.chunkPos[a.chunkIndex])&&f.addChunk(this.chunkPos[a.chunkIndex],this.chunk[a.chunkIndex])?a.nextChunk():((!s||i>a.to||o<a.from||s(a.from,a.to,a.value))&&(f.addInner(a.from,a.to,a.value)||c.push(lm.create(a.from,a.to,a.value))),a.next());return f.finishInner(this.nextLayer.isEmpty&&!c.length?Gt.empty:this.nextLayer.update({add:c,filter:s,filterFrom:i,filterTo:o}))}map(e){if(e.empty||this.isEmpty)return this;let n=[],r=[],i=-1;for(let s=0;s<this.chunk.length;s++){let a=this.chunkPos[s],l=this.chunk[s],c=e.touchesRange(a,a+l.length);if(c===!1)i=Math.max(i,l.maxPoint),n.push(l),r.push(e.mapPos(a));else if(c===!0){let{mapped:f,pos:d}=l.map(a,e);f&&(i=Math.max(i,f.maxPoint),n.push(f),r.push(d))}}let o=this.nextLayer.map(e);return n.length==0?o:new Gt(r,n,o||Gt.empty,i)}between(e,n,r){if(!this.isEmpty){for(let i=0;i<this.chunk.length;i++){let o=this.chunkPos[i],s=this.chunk[i];if(n>=o&&e<=o+s.length&&s.between(o,e-o,n-o,r)===!1)return}this.nextLayer.between(e,n,r)}}iter(e=0){return cm.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,n=0){return cm.from(e).goto(n)}static compare(e,n,r,i,o=-1){let s=e.filter(d=>d.maxPoint>0||!d.isEmpty&&d.maxPoint>=o),a=n.filter(d=>d.maxPoint>0||!d.isEmpty&&d.maxPoint>=o),l=CD(s,a,r),c=new Ph(s,l,o),f=new Ph(a,l,o);r.iterGaps((d,p,m)=>kD(c,d,f,p,m,i)),r.empty&&r.length==0&&kD(c,0,f,0,0,i)}static eq(e,n,r=0,i){i==null&&(i=999999999);let o=e.filter(f=>!f.isEmpty&&n.indexOf(f)<0),s=n.filter(f=>!f.isEmpty&&e.indexOf(f)<0);if(o.length!=s.length)return!1;if(!o.length)return!0;let a=CD(o,s),l=new Ph(o,a,0).goto(r),c=new Ph(s,a,0).goto(r);for(;;){if(l.to!=c.to||!$k(l.active,c.active)||l.point&&(!c.point||!l.point.eq(c.point)))return!1;if(l.to>i)return!0;l.next(),c.next()}}static spans(e,n,r,i,o=-1){let s=new Ph(e,null,o).goto(n),a=n,l=s.openStart;for(;;){let c=Math.min(s.to,r);if(s.point){let f=s.activeForPoint(s.to),d=s.pointFrom<n?f.length+1:Math.min(f.length,l);i.point(a,c,s.point,f,d,s.pointRank),l=Math.min(s.openEnd(c),f.length)}else c>a&&(i.span(a,c,s.active,l),l=s.openEnd(c));if(s.to>r)return l+(s.point&&s.to>r?1:0);a=s.to,s.next()}}static of(e,n=!1){let r=new Ql;for(let i of e instanceof lm?[e]:n?gve(e):e)r.add(i.from,i.to,i.value);return r.finish()}static join(e){if(!e.length)return Gt.empty;let n=e[e.length-1];for(let r=e.length-2;r>=0;r--)for(let i=e[r];i!=Gt.empty;i=i.nextLayer)n=new Gt(i.chunkPos,i.chunk,n,Math.max(i.maxPoint,n.maxPoint));return n}}Gt.empty=new Gt([],[],null,-1);function gve(t){if(t.length>1)for(let e=t[0],n=1;n<t.length;n++){let r=t[n];if(Lk(e,r)>0)return t.slice().sort(Lk);e=r}return t}Gt.empty.nextLayer=Gt.empty;class Ql{finishChunk(e){this.chunks.push(new mT(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.addInner(e,n,r)||(this.nextLayer||(this.nextLayer=new Ql)).add(e,n,r)}addInner(e,n,r){let i=e-this.lastTo||r.startSide-this.last.endSide;if(i<=0&&(e-this.lastFrom||r.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return i<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(Gt.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let n=Gt.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,n}}function CD(t,e,n){let r=new Map;for(let o of t)for(let s=0;s<o.chunk.length;s++)o.chunk[s].maxPoint<=0&&r.set(o.chunk[s],o.chunkPos[s]);let i=new Set;for(let o of e)for(let s=0;s<o.chunk.length;s++){let a=r.get(o.chunk[s]);a!=null&&(n?n.mapPos(a):a)==o.chunkPos[s]&&!(n!=null&&n.touchesRange(a,a+o.chunk[s].length))&&i.add(o.chunk[s])}return i}class p8{constructor(e,n,r,i=0){this.layer=e,this.skip=n,this.minPoint=r,this.rank=i}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 i=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(i)||this.layer.chunkEnd(this.chunkIndex)<e||i.maxPoint<this.minPoint))break;this.chunkIndex++,r=!1}if(this.chunkIndex<this.layer.chunk.length){let i=this.layer.chunk[this.chunkIndex].findIndex(e-this.layer.chunkPos[this.chunkIndex],n,!0);(!r||this.rangeIndex<i)&&this.setRangeIndex(i)}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 cm{constructor(e){this.heap=e}static from(e,n=null,r=-1){let i=[];for(let o=0;o<e.length;o++)for(let s=e[o];!s.isEmpty;s=s.nextLayer)s.maxPoint>=r&&i.push(new p8(s,n,r,o));return i.length==1?i[0]:new cm(i)}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--)fS(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--)fS(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(),fS(this.heap,0)}}}function fS(t,e){for(let n=t[e];;){let r=(e<<1)+1;if(r>=t.length)break;let i=t[r];if(r+1<t.length&&i.compare(t[r+1])>=0&&(i=t[r+1],r++),n.compare(i)<0)break;t[r]=n,t[e]=i,e=r}}class Ph{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=cm.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){Cv(this.active,e),Cv(this.activeTo,e),Cv(this.activeRank,e),this.minActive=ED(this.active,this.activeTo)}addActive(e){let n=0,{value:r,to:i,rank:o}=this.cursor;for(;n<this.activeRank.length&&(o-this.activeRank[n]||i-this.activeTo[n])>0;)n++;kv(this.active,n,r),kv(this.activeTo,n,i),kv(this.activeRank,n,o),e&&kv(e,n,this.cursor.from),this.minActive=ED(this.active,this.activeTo)}next(){let e=this.to,n=this.point;this.point=null;let r=this.openStart<0?[]:null;for(;;){let i=this.minActive;if(i>-1&&(this.activeTo[i]-this.cursor.from||this.active[i].endSide-this.cursor.startSide)<0){if(this.activeTo[i]>e){this.to=this.activeTo[i],this.endSide=this.active[i].endSide;break}this.removeActive(i),r&&Cv(r,i)}else if(this.cursor.value)if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let o=this.cursor.value;if(!o.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=o,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=o.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 i=r.length-1;i>=0&&r[i]<e;i--)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 kD(t,e,n,r,i,o){t.goto(e),n.goto(r);let s=r+i,a=r,l=r-e;for(;;){let c=t.to+l-n.to||t.endSide-n.endSide,f=c<0?t.to+l:n.to,d=Math.min(f,s);if(t.point||n.point?t.point&&n.point&&(t.point==n.point||t.point.eq(n.point))&&$k(t.activeForPoint(t.to),n.activeForPoint(n.to))||o.comparePoint(a,d,t.point,n.point):d>a&&!$k(t.active,n.active)&&o.compareRange(a,d,t.active,n.active),f>s)break;a=f,c<=0&&t.next(),c>=0&&n.next()}}function $k(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!=e[n]&&!t[n].eq(e[n]))return!1;return!0}function Cv(t,e){for(let n=e,r=t.length-1;n<r;n++)t[n]=t[n+1];t.pop()}function kv(t,e,n){for(let r=t.length-1;r>=e;r--)t[r+1]=t[r];t[e]=n}function ED(t,e){let n=-1,r=1e9;for(let i=0;i<e.length;i++)(e[i]-r||t[i].endSide-t[n].endSide)<0&&(n=i,r=e[i]);return n}function zd(t,e,n=t.length){let r=0;for(let i=0;i<n;)t.charCodeAt(i)==9?(r+=e-r%e,i++):(r++,i=$r(t,i));return r}function Ik(t,e,n,r){for(let i=0,o=0;;){if(o>=e)return i;if(i==t.length)break;o+=t.charCodeAt(i)==9?n-o%n:1,i=$r(t,i)}return r===!0?-1:t.length}const jk="ͼ",_D=typeof Symbol>"u"?"__"+jk:Symbol.for(jk),Bk=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),TD=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class Jl{constructor(e,n){this.rules=[];let{finish:r}=n||{};function i(s){return/^@/.test(s)?[s]:s.split(/,\s*/)}function o(s,a,l,c){let f=[],d=/^@(\w+)\b/.exec(s[0]),p=d&&d[1]=="keyframes";if(d&&a==null)return l.push(s[0]+";");for(let m in a){let v=a[m];if(/&/.test(m))o(m.split(/,\s*/).map(b=>s.map(S=>b.replace(/&/,S))).reduce((b,S)=>b.concat(S)),v,l);else if(v&&typeof v=="object"){if(!d)throw new RangeError("The value of a property ("+m+") should be a primitive value.");o(i(m),v,f,p)}else v!=null&&f.push(m.replace(/_.*/,"").replace(/[A-Z]/g,b=>"-"+b.toLowerCase())+": "+v+";")}(f.length||p)&&l.push((r&&!d&&!c?s.map(r):s).join(", ")+" {"+f.join(" ")+"}")}for(let s in e)o(i(s),e[s],this.rules)}getRules(){return this.rules.join(`
214
+ `)}static newName(){let e=TD[_D]||1;return TD[_D]=e+1,jk+e.toString(36)}static mount(e,n,r){let i=e[Bk],o=r&&r.nonce;i?o&&i.setNonce(o):i=new vve(e,o),i.mount(Array.isArray(n)?n:[n])}}let AD=new Map;class vve{constructor(e,n){let r=e.ownerDocument||e,i=r.defaultView;if(!e.head&&e.adoptedStyleSheets&&i.CSSStyleSheet){let o=AD.get(r);if(o)return e.adoptedStyleSheets=[o.sheet,...e.adoptedStyleSheets],e[Bk]=o;this.sheet=new i.CSSStyleSheet,e.adoptedStyleSheets=[this.sheet,...e.adoptedStyleSheets],AD.set(r,this)}else{this.styleTag=r.createElement("style"),n&&this.styleTag.setAttribute("nonce",n);let o=e.head||e;o.insertBefore(this.styleTag,o.firstChild)}this.modules=[],e[Bk]=this}mount(e){let n=this.sheet,r=0,i=0;for(let o=0;o<e.length;o++){let s=e[o],a=this.modules.indexOf(s);if(a<i&&a>-1&&(this.modules.splice(a,1),i--,a=-1),a==-1){if(this.modules.splice(i++,0,s),n)for(let l=0;l<s.rules.length;l++)n.insertRule(s.rules[l],r++)}else{for(;i<a;)r+=this.modules[i++].rules.length;r+=s.rules.length,i++}}if(!n){let o="";for(let s=0;s<this.modules.length;s++)o+=this.modules[s].getRules()+`
215
+ `;this.styleTag.textContent=o}}setNonce(e){this.styleTag&&this.styleTag.getAttribute("nonce")!=e&&this.styleTag.setAttribute("nonce",e)}}var ec={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:"'"},um={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},yve=typeof navigator<"u"&&/Mac/.test(navigator.platform),bve=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var Dr=0;Dr<10;Dr++)ec[48+Dr]=ec[96+Dr]=String(Dr);for(var Dr=1;Dr<=24;Dr++)ec[Dr+111]="F"+Dr;for(var Dr=65;Dr<=90;Dr++)ec[Dr]=String.fromCharCode(Dr+32),um[Dr]=String.fromCharCode(Dr);for(var dS in ec)um.hasOwnProperty(dS)||(um[dS]=ec[dS]);function wve(t){var e=yve&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||bve&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?um:ec)[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}function Y0(t){let e;return t.nodeType==11?e=t.getSelection?t:t.ownerDocument:e=t,e.getSelection()}function Fk(t,e){return e?t==e||t.contains(e.nodeType!=1?e.parentNode:e):!1}function xve(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function wy(t,e){if(!e.anchorNode)return!1;try{return Fk(t,e.anchorNode)}catch{return!1}}function pd(t){return t.nodeType==3?vu(t,0,t.nodeValue.length).getClientRects():t.nodeType==1?t.getClientRects():[]}function mp(t,e,n,r){return n?OD(t,e,n,r,-1)||OD(t,e,n,r,1):!1}function fm(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e}function OD(t,e,n,r,i){for(;;){if(t==n&&e==r)return!0;if(e==(i<0?0:za(t))){if(t.nodeName=="DIV")return!1;let o=t.parentNode;if(!o||o.nodeType!=1)return!1;e=fm(t)+(i<0?0:1),t=o}else if(t.nodeType==1){if(t=t.childNodes[e+(i<0?-1:0)],t.nodeType==1&&t.contentEditable=="false")return!1;e=i<0?za(t):0}else return!1}}function za(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function w1(t,e){let n=e?t.left:t.right;return{left:n,right:n,top:t.top,bottom:t.bottom}}function Sve(t){return{left:0,right:t.innerWidth,top:0,bottom:t.innerHeight}}function m8(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 Cve(t,e,n,r,i,o,s,a){let l=t.ownerDocument,c=l.defaultView||window;for(let f=t,d=!1;f&&!d;)if(f.nodeType==1){let p,m=f==l.body,v=1,b=1;if(m)p=Sve(c);else{if(/^(fixed|sticky)$/.test(getComputedStyle(f).position)&&(d=!0),f.scrollHeight<=f.clientHeight&&f.scrollWidth<=f.clientWidth){f=f.assignedSlot||f.parentNode;continue}let w=f.getBoundingClientRect();({scaleX:v,scaleY:b}=m8(f,w)),p={left:w.left,right:w.left+f.clientWidth*v,top:w.top,bottom:w.top+f.clientHeight*b}}let S=0,x=0;if(i=="nearest")e.top<p.top?(x=-(p.top-e.top+s),n>0&&e.bottom>p.bottom+x&&(x=e.bottom-p.bottom+x+s)):e.bottom>p.bottom&&(x=e.bottom-p.bottom+s,n<0&&e.top-x<p.top&&(x=-(p.top+x-e.top+s)));else{let w=e.bottom-e.top,C=p.bottom-p.top;x=(i=="center"&&w<=C?e.top+w/2-C/2:i=="start"||i=="center"&&n<0?e.top-s:e.bottom-C+s)-p.top}if(r=="nearest"?e.left<p.left?(S=-(p.left-e.left+o),n>0&&e.right>p.right+S&&(S=e.right-p.right+S+o)):e.right>p.right&&(S=e.right-p.right+o,n<0&&e.left<p.left+S&&(S=-(p.left+S-e.left+o))):S=(r=="center"?e.left+(e.right-e.left)/2-(p.right-p.left)/2:r=="start"==a?e.left-o:e.right-(p.right-p.left)+o)-p.left,S||x)if(m)c.scrollBy(S,x);else{let w=0,C=0;if(x){let T=f.scrollTop;f.scrollTop+=x/b,C=(f.scrollTop-T)*b}if(S){let T=f.scrollLeft;f.scrollLeft+=S/v,w=(f.scrollLeft-T)*v}e={left:e.left-w,top:e.top-C,right:e.right-w,bottom:e.bottom-C},w&&Math.abs(w-S)<1&&(r="nearest"),C&&Math.abs(C-x)<1&&(i="nearest")}if(m)break;f=f.assignedSlot||f.parentNode}else if(f.nodeType==11)f=f.host;else break}function kve(t){let e=t.ownerDocument;for(let n=t.parentNode;n&&n!=e.body;)if(n.nodeType==1){if(n.scrollHeight>n.clientHeight||n.scrollWidth>n.clientWidth)return n;n=n.assignedSlot||n.parentNode}else if(n.nodeType==11)n=n.host;else break;return null}class Eve{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?za(n):0),r,Math.min(e.focusOffset,r?za(r):0))}set(e,n,r,i){this.anchorNode=e,this.anchorOffset=n,this.focusNode=r,this.focusOffset=i}}let rf=null;function g8(t){if(t.setActive)return t.setActive();if(rf)return t.focus(rf);let e=[];for(let n=t;n&&(e.push(n,n.scrollTop,n.scrollLeft),n!=n.ownerDocument);n=n.parentNode);if(t.focus(rf==null?{get preventScroll(){return rf={preventScroll:!0},!0}}:void 0),!rf){rf=!1;for(let n=0;n<e.length;){let r=e[n++],i=e[n++],o=e[n++];r.scrollTop!=i&&(r.scrollTop=i),r.scrollLeft!=o&&(r.scrollLeft=o)}}}let RD;function vu(t,e,n=e){let r=RD||(RD=document.createRange());return r.setEnd(t,n),r.setStart(t,e),r}function qf(t,e,n){let r={key:e,code:e,keyCode:n,which:n,cancelable:!0},i=new KeyboardEvent("keydown",r);i.synthetic=!0,t.dispatchEvent(i);let o=new KeyboardEvent("keyup",r);return o.synthetic=!0,t.dispatchEvent(o),i.defaultPrevented||o.defaultPrevented}function _ve(t){for(;t;){if(t&&(t.nodeType==9||t.nodeType==11&&t.host))return t;t=t.assignedSlot||t.parentNode}return null}function v8(t){for(;t.attributes.length;)t.removeAttributeNode(t.attributes[0])}function Tve(t,e){let n=e.focusNode,r=e.focusOffset;if(!n||e.anchorNode!=n||e.anchorOffset!=r)return!1;for(r=Math.min(r,za(n));;)if(r){if(n.nodeType!=1)return!1;let i=n.childNodes[r-1];i.contentEditable=="false"?r--:(n=i,r=za(n))}else{if(n==t)return!0;r=fm(n),n=n.parentNode}}function y8(t){return t.scrollTop>Math.max(1,t.scrollHeight-t.clientHeight-4)}class Gr{constructor(e,n,r=!0){this.node=e,this.offset=n,this.precise=r}static before(e,n){return new Gr(e.parentNode,fm(e),n)}static after(e,n){return new Gr(e.parentNode,fm(e)+1,n)}}const gT=[];class An{constructor(){this.parent=null,this.dom=null,this.flags=2}get overrideDOMText(){return null}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(e){let n=this.posAtStart;for(let r of this.children){if(r==e)return n;n+=r.length+r.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(e){return this.posBefore(e)+e.length}sync(e,n){if(this.flags&2){let r=this.dom,i=null,o;for(let s of this.children){if(s.flags&7){if(!s.dom&&(o=i?i.nextSibling:r.firstChild)){let a=An.get(o);(!a||!a.parent&&a.canReuseDOM(s))&&s.reuseDOM(o)}s.sync(e,n),s.flags&=-8}if(o=i?i.nextSibling:r.firstChild,n&&!n.written&&n.node==r&&o!=s.dom&&(n.written=!0),s.dom.parentNode==r)for(;o&&o!=s.dom;)o=PD(o);else r.insertBefore(s.dom,o);i=s.dom}for(o=i?i.nextSibling:r.firstChild,o&&n&&n.node==r&&(n.written=!0);o;)o=PD(o)}else if(this.flags&1)for(let r of this.children)r.flags&7&&(r.sync(e,n),r.flags&=-8)}reuseDOM(e){}localPosFromDOM(e,n){let r;if(e==this.dom)r=this.dom.childNodes[n];else{let i=za(e)==0?0:n==0?-1:1;for(;;){let o=e.parentNode;if(o==this.dom)break;i==0&&o.firstChild!=o.lastChild&&(e==o.firstChild?i=-1:i=1),e=o}i<0?r=e:r=e.nextSibling}if(r==this.dom.firstChild)return 0;for(;r&&!An.get(r);)r=r.nextSibling;if(!r)return this.length;for(let i=0,o=0;;i++){let s=this.children[i];if(s.dom==r)return o;o+=s.length+s.breakAfter}}domBoundsAround(e,n,r=0){let i=-1,o=-1,s=-1,a=-1;for(let l=0,c=r,f=r;l<this.children.length;l++){let d=this.children[l],p=c+d.length;if(c<e&&p>n)return d.domBoundsAround(e,n,c);if(p>=e&&i==-1&&(i=l,o=c),c>n&&d.dom.parentNode==this.dom){s=l,a=f;break}f=p,c=p+d.breakAfter}return{from:o,to:a<0?r+this.length:a,startDOM:(i?this.children[i-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:s<this.children.length&&s>=0?this.children[s].dom:null}}markDirty(e=!1){this.flags|=2,this.markParentsDirty(e)}markParentsDirty(e){for(let n=this.parent;n;n=n.parent){if(e&&(n.flags|=2),n.flags&1)return;n.flags|=1,e=!1}}setParent(e){this.parent!=e&&(this.parent=e,this.flags&7&&this.markParentsDirty(!0))}setDOM(e){this.dom!=e&&(this.dom&&(this.dom.cmView=null),this.dom=e,e.cmView=this)}get rootView(){for(let e=this;;){let n=e.parent;if(!n)return e;e=n}}replaceChildren(e,n,r=gT){this.markDirty();for(let i=e;i<n;i++){let o=this.children[i];o.parent==this&&r.indexOf(o)<0&&o.destroy()}this.children.splice(e,n-e,...r);for(let i=0;i<r.length;i++)r[i].setParent(this)}ignoreMutation(e){return!1}ignoreEvent(e){return!1}childCursor(e=this.length){return new b8(this.children,e,this.children.length)}childPos(e,n=1){return this.childCursor().findPos(e,n)}toString(){let e=this.constructor.name.replace("View","");return e+(this.children.length?"("+this.children.join()+")":this.length?"["+(e=="Text"?this.text:this.length)+"]":"")+(this.breakAfter?"#":"")}static get(e){return e.cmView}get isEditable(){return!0}get isWidget(){return!1}get isHidden(){return!1}merge(e,n,r,i,o,s){return!1}become(e){return!1}canReuseDOM(e){return e.constructor==this.constructor&&!((this.flags|e.flags)&8)}getSide(){return 0}destroy(){for(let e of this.children)e.parent==this&&e.destroy();this.parent=null}}An.prototype.breakAfter=0;function PD(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class b8{constructor(e,n,r){this.children=e,this.pos=n,this.i=r,this.off=0}findPos(e,n=1){for(;;){if(e>this.pos||e==this.pos&&(n>0||this.i==0||this.children[this.i-1].breakAfter))return this.off=e-this.pos,this;let r=this.children[--this.i];this.pos-=r.length+r.breakAfter}}}function w8(t,e,n,r,i,o,s,a,l){let{children:c}=t,f=c.length?c[e]:null,d=o.length?o[o.length-1]:null,p=d?d.breakAfter:s;if(!(e==r&&f&&!s&&!p&&o.length<2&&f.merge(n,i,o.length?d:null,n==0,a,l))){if(r<c.length){let m=c[r];m&&(i<m.length||m.breakAfter&&(d!=null&&d.breakAfter))?(e==r&&(m=m.split(i),i=0),!p&&d&&m.merge(0,i,d,!0,0,l)?o[o.length-1]=m:((i||m.children.length&&!m.children[0].length)&&m.merge(0,i,null,!1,0,l),o.push(m))):m!=null&&m.breakAfter&&(d?d.breakAfter=1:s=1),r++}for(f&&(f.breakAfter=s,n>0&&(!s&&o.length&&f.merge(n,f.length,o[0],!1,a,0)?f.breakAfter=o.shift().breakAfter:(n<f.length||f.children.length&&f.children[f.children.length-1].length==0)&&f.merge(n,f.length,null,!1,a,0),e++));e<r&&o.length;)if(c[r-1].become(o[o.length-1]))r--,o.pop(),l=o.length?0:a;else if(c[e].become(o[0]))e++,o.shift(),a=o.length?0:l;else break;!o.length&&e&&r<c.length&&!c[e-1].breakAfter&&c[r].merge(0,0,c[e-1],!1,a,l)&&e--,(e<r||o.length)&&t.replaceChildren(e,r,o)}}function x8(t,e,n,r,i,o){let s=t.childCursor(),{i:a,off:l}=s.findPos(n,1),{i:c,off:f}=s.findPos(e,-1),d=e-n;for(let p of r)d+=p.length;t.length+=d,w8(t,c,f,a,l,r,0,i,o)}let Qi=typeof navigator<"u"?navigator:{userAgent:"",vendor:"",platform:""},zk=typeof document<"u"?document:{documentElement:{style:{}}};const Vk=/Edge\/(\d+)/.exec(Qi.userAgent),S8=/MSIE \d/.test(Qi.userAgent),Uk=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Qi.userAgent),x1=!!(S8||Uk||Vk),ND=!x1&&/gecko\/(\d+)/i.test(Qi.userAgent),hS=!x1&&/Chrome\/(\d+)/.exec(Qi.userAgent),MD="webkitFontSmoothing"in zk.documentElement.style,C8=!x1&&/Apple Computer/.test(Qi.vendor),DD=C8&&(/Mobile\/\w+/.test(Qi.userAgent)||Qi.maxTouchPoints>2);var tt={mac:DD||/Mac/.test(Qi.platform),windows:/Win/.test(Qi.platform),linux:/Linux|X11/.test(Qi.platform),ie:x1,ie_version:S8?zk.documentMode||6:Uk?+Uk[1]:Vk?+Vk[1]:0,gecko:ND,gecko_version:ND?+(/Firefox\/(\d+)/.exec(Qi.userAgent)||[0,0])[1]:0,chrome:!!hS,chrome_version:hS?+hS[1]:0,ios:DD,android:/Android\b/.test(Qi.userAgent),webkit:MD,safari:C8,webkit_version:MD?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0,tabSize:zk.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};const Ave=256;class Va extends An{constructor(e){super(),this.text=e}get length(){return this.text.length}createDOM(e){this.setDOM(e||document.createTextNode(this.text))}sync(e,n){this.dom||this.createDOM(),this.dom.nodeValue!=this.text&&(n&&n.node==this.dom&&(n.written=!0),this.dom.nodeValue=this.text)}reuseDOM(e){e.nodeType==3&&this.createDOM(e)}merge(e,n,r){return this.flags&8||r&&(!(r instanceof Va)||this.length-(n-e)+r.length>Ave||r.flags&8)?!1:(this.text=this.text.slice(0,e)+(r?r.text:"")+this.text.slice(n),this.markDirty(),!0)}split(e){let n=new Va(this.text.slice(e));return this.text=this.text.slice(0,e),this.markDirty(),n.flags|=this.flags&8,n}localPosFromDOM(e,n){return e==this.dom?n:n?this.text.length:0}domAtPos(e){return new Gr(this.dom,e)}domBoundsAround(e,n,r){return{from:r,to:r+this.length,startDOM:this.dom,endDOM:this.dom.nextSibling}}coordsAt(e,n){return Ove(this.dom,e,n)}}class Ua extends An{constructor(e,n=[],r=0){super(),this.mark=e,this.children=n,this.length=r;for(let i of n)i.setParent(this)}setAttrs(e){if(v8(e),this.mark.class&&(e.className=this.mark.class),this.mark.attrs)for(let n in this.mark.attrs)e.setAttribute(n,this.mark.attrs[n]);return e}canReuseDOM(e){return super.canReuseDOM(e)&&!((this.flags|e.flags)&8)}reuseDOM(e){e.nodeName==this.mark.tagName.toUpperCase()&&(this.setDOM(e),this.flags|=6)}sync(e,n){this.dom?this.flags&4&&this.setAttrs(this.dom):this.setDOM(this.setAttrs(document.createElement(this.mark.tagName))),super.sync(e,n)}merge(e,n,r,i,o,s){return r&&(!(r instanceof Ua&&r.mark.eq(this.mark))||e&&o<=0||n<this.length&&s<=0)?!1:(x8(this,e,n,r?r.children.slice():[],o-1,s-1),this.markDirty(),!0)}split(e){let n=[],r=0,i=-1,o=0;for(let a of this.children){let l=r+a.length;l>e&&n.push(r<e?a.split(e-r):a),i<0&&r>=e&&(i=o),r=l,o++}let s=this.length-e;return this.length=e,i>-1&&(this.children.length=i,this.markDirty()),new Ua(this.mark,n,s)}domAtPos(e){return k8(this,e)}coordsAt(e,n){return _8(this,e,n)}}function Ove(t,e,n){let r=t.nodeValue.length;e>r&&(e=r);let i=e,o=e,s=0;e==0&&n<0||e==r&&n>=0?tt.chrome||tt.gecko||(e?(i--,s=1):o<r&&(o++,s=-1)):n<0?i--:o<r&&o++;let a=vu(t,i,o).getClientRects();if(!a.length)return null;let l=a[(s?s<0:n>=0)?0:a.length-1];return tt.safari&&!s&&l.width==0&&(l=Array.prototype.find.call(a,c=>c.width)||l),s?w1(l,s<0):l||null}class Al extends An{static create(e,n,r){return new Al(e,n,r)}constructor(e,n,r){super(),this.widget=e,this.length=n,this.side=r,this.prevWidget=null}split(e){let n=Al.create(this.widget,this.length-e,this.side);return this.length-=e,n}sync(e){(!this.dom||!this.widget.updateDOM(this.dom,e))&&(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(e)),this.widget.editable||(this.dom.contentEditable="false"))}getSide(){return this.side}merge(e,n,r,i,o,s){return r&&(!(r instanceof Al)||!this.widget.compare(r.widget)||e>0&&o<=0||n<this.length&&s<=0)?!1:(this.length=e+(r?r.length:0)+(this.length-n),!0)}become(e){return e instanceof Al&&e.side==this.side&&this.widget.constructor==e.widget.constructor?(this.widget.compare(e.widget)||this.markDirty(!0),this.dom&&!this.prevWidget&&(this.prevWidget=this.widget),this.widget=e.widget,this.length=e.length,!0):!1}ignoreMutation(){return!0}ignoreEvent(e){return this.widget.ignoreEvent(e)}get overrideDOMText(){if(this.length==0)return tn.empty;let e=this;for(;e.parent;)e=e.parent;let{view:n}=e,r=n&&n.state.doc,i=this.posAtStart;return r?r.slice(i,i+this.length):tn.empty}domAtPos(e){return(this.length?e==0:this.side>0)?Gr.before(this.dom):Gr.after(this.dom,e==this.length)}domBoundsAround(){return null}coordsAt(e,n){let r=this.widget.coordsAt(this.dom,e,n);if(r)return r;let i=this.dom.getClientRects(),o=null;if(!i.length)return null;let s=this.side?this.side<0:e>0;for(let a=s?i.length-1:0;o=i[a],!(e>0?a==0:a==i.length-1||o.top<o.bottom);a+=s?-1:1);return w1(o,!s)}get isEditable(){return!1}get isWidget(){return!0}get isHidden(){return this.widget.isHidden}destroy(){super.destroy(),this.dom&&this.widget.destroy(this.dom)}}class md extends An{constructor(e){super(),this.side=e}get length(){return 0}merge(){return!1}become(e){return e instanceof md&&e.side==this.side}split(){return new md(this.side)}sync(){if(!this.dom){let e=document.createElement("img");e.className="cm-widgetBuffer",e.setAttribute("aria-hidden","true"),this.setDOM(e)}}getSide(){return this.side}domAtPos(e){return this.side>0?Gr.before(this.dom):Gr.after(this.dom)}localPosFromDOM(){return 0}domBoundsAround(){return null}coordsAt(e){return this.dom.getBoundingClientRect()}get overrideDOMText(){return tn.empty}get isHidden(){return!0}}Va.prototype.children=Al.prototype.children=md.prototype.children=gT;function k8(t,e){let n=t.dom,{children:r}=t,i=0;for(let o=0;i<r.length;i++){let s=r[i],a=o+s.length;if(!(a==o&&s.getSide()<=0)){if(e>o&&e<a&&s.dom.parentNode==n)return s.domAtPos(e-o);if(e<=o)break;o=a}}for(let o=i;o>0;o--){let s=r[o-1];if(s.dom.parentNode==n)return s.domAtPos(s.length)}for(let o=i;o<r.length;o++){let s=r[o];if(s.dom.parentNode==n)return s.domAtPos(0)}return new Gr(n,0)}function E8(t,e,n){let r,{children:i}=t;n>0&&e instanceof Ua&&i.length&&(r=i[i.length-1])instanceof Ua&&r.mark.eq(e.mark)?E8(r,e.children[0],n-1):(i.push(e),e.setParent(t)),t.length+=e.length}function _8(t,e,n){let r=null,i=-1,o=null,s=-1;function a(c,f){for(let d=0,p=0;d<c.children.length&&p<=f;d++){let m=c.children[d],v=p+m.length;v>=f&&(m.children.length?a(m,f-p):(!o||o.isHidden&&n>0)&&(v>f||p==v&&m.getSide()>0)?(o=m,s=f-p):(p<f||p==v&&m.getSide()<0&&!m.isHidden)&&(r=m,i=f-p)),p=v}}a(t,e);let l=(n<0?r:o)||r||o;return l?l.coordsAt(Math.max(0,l==r?i:s),n):Rve(t)}function Rve(t){let e=t.dom.lastChild;if(!e)return t.dom.getBoundingClientRect();let n=pd(e);return n[n.length-1]||null}function Wk(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 LD=Object.create(null);function vT(t,e,n){if(t==e)return!0;t||(t=LD),e||(e=LD);let r=Object.keys(t),i=Object.keys(e);if(r.length-(n&&r.indexOf(n)>-1?1:0)!=i.length-(n&&i.indexOf(n)>-1?1:0))return!1;for(let o of r)if(o!=n&&(i.indexOf(o)==-1||t[o]!==e[o]))return!1;return!0}function Hk(t,e,n){let r=!1;if(e)for(let i in e)n&&i in n||(r=!0,i=="style"?t.style.cssText="":t.removeAttribute(i));if(n)for(let i in n)e&&e[i]==n[i]||(r=!0,i=="style"?t.style.cssText=n[i]:t.setAttribute(i,n[i]));return r}function Pve(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 dr extends An{constructor(){super(...arguments),this.children=[],this.length=0,this.prevAttrs=void 0,this.attrs=null,this.breakAfter=0}merge(e,n,r,i,o,s){if(r){if(!(r instanceof dr))return!1;this.dom||r.transferDOM(this)}return i&&this.setDeco(r?r.attrs:null),x8(this,e,n,r?r.children.slice():[],o,s),!0}split(e){let n=new dr;if(n.breakAfter=this.breakAfter,this.length==0)return n;let{i:r,off:i}=this.childPos(e);i&&(n.append(this.children[r].split(i),0),this.children[r].merge(i,this.children[r].length,null,!1,0,0),r++);for(let o=r;o<this.children.length;o++)n.append(this.children[o],0);for(;r>0&&this.children[r-1].length==0;)this.children[--r].destroy();return this.children.length=r,this.markDirty(),this.length=e,n}transferDOM(e){this.dom&&(this.markDirty(),e.setDOM(this.dom),e.prevAttrs=this.prevAttrs===void 0?this.attrs:this.prevAttrs,this.prevAttrs=void 0,this.dom=null)}setDeco(e){vT(this.attrs,e)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=e)}append(e,n){E8(this,e,n)}addLineDeco(e){let n=e.spec.attributes,r=e.spec.class;n&&(this.attrs=Wk(n,this.attrs||{})),r&&(this.attrs=Wk({class:r},this.attrs||{}))}domAtPos(e){return k8(this,e)}reuseDOM(e){e.nodeName=="DIV"&&(this.setDOM(e),this.flags|=6)}sync(e,n){var r;this.dom?this.flags&4&&(v8(this.dom),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0):(this.setDOM(document.createElement("div")),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0),this.prevAttrs!==void 0&&(Hk(this.dom,this.prevAttrs,this.attrs),this.dom.classList.add("cm-line"),this.prevAttrs=void 0),super.sync(e,n);let i=this.dom.lastChild;for(;i&&An.get(i)instanceof Ua;)i=i.lastChild;if(!i||!this.length||i.nodeName!="BR"&&((r=An.get(i))===null||r===void 0?void 0:r.isEditable)==!1&&(!tt.ios||!this.children.some(o=>o instanceof Va))){let o=document.createElement("BR");o.cmIgnore=!0,this.dom.appendChild(o)}}measureTextSize(){if(this.children.length==0||this.length>20)return null;let e=0,n;for(let r of this.children){if(!(r instanceof Va)||/[^ -~]/.test(r.text))return null;let i=pd(r.dom);if(i.length!=1)return null;e+=i[0].width,n=i[0].height}return e?{lineHeight:this.dom.getBoundingClientRect().height,charWidth:e/this.length,textHeight:n}:null}coordsAt(e,n){let r=_8(this,e,n);if(!this.children.length&&r&&this.parent){let{heightOracle:i}=this.parent.view.viewState,o=r.bottom-r.top;if(Math.abs(o-i.lineHeight)<2&&i.textHeight<o){let s=(o-i.textHeight)/2;return{top:r.top+s,bottom:r.bottom-s,left:r.left,right:r.left}}}return r}become(e){return!1}covers(){return!0}static find(e,n){for(let r=0,i=0;r<e.children.length;r++){let o=e.children[r],s=i+o.length;if(s>=n){if(o instanceof dr)return o;if(s>n)break}i=s+o.breakAfter}return null}}class Bl extends An{constructor(e,n,r){super(),this.widget=e,this.length=n,this.deco=r,this.breakAfter=0,this.prevWidget=null}merge(e,n,r,i,o,s){return r&&(!(r instanceof Bl)||!this.widget.compare(r.widget)||e>0&&o<=0||n<this.length&&s<=0)?!1:(this.length=e+(r?r.length:0)+(this.length-n),!0)}domAtPos(e){return e==0?Gr.before(this.dom):Gr.after(this.dom,e==this.length)}split(e){let n=this.length-e;this.length=e;let r=new Bl(this.widget,n,this.deco);return r.breakAfter=this.breakAfter,r}get children(){return gT}sync(e){(!this.dom||!this.widget.updateDOM(this.dom,e))&&(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(e)),this.widget.editable||(this.dom.contentEditable="false"))}get overrideDOMText(){return this.parent?this.parent.view.state.doc.slice(this.posAtStart,this.posAtEnd):tn.empty}domBoundsAround(){return null}become(e){return e instanceof Bl&&e.widget.constructor==this.widget.constructor?(e.widget.compare(this.widget)||this.markDirty(!0),this.dom&&!this.prevWidget&&(this.prevWidget=this.widget),this.widget=e.widget,this.length=e.length,this.deco=e.deco,this.breakAfter=e.breakAfter,!0):!1}ignoreMutation(){return!0}ignoreEvent(e){return this.widget.ignoreEvent(e)}get isEditable(){return!1}get isWidget(){return!0}coordsAt(e,n){return this.widget.coordsAt(this.dom,e,n)}destroy(){super.destroy(),this.dom&&this.widget.destroy(this.dom)}covers(e){let{startSide:n,endSide:r}=this.deco;return n==r?!1:e<0?n<0:r>0}}class Ga{eq(e){return!1}updateDOM(e,n){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 ui=function(t){return t[t.Text=0]="Text",t[t.WidgetBefore=1]="WidgetBefore",t[t.WidgetAfter=2]="WidgetAfter",t[t.WidgetRange=3]="WidgetRange",t}(ui||(ui={}));class dt extends gu{constructor(e,n,r,i){super(),this.startSide=e,this.endSide=n,this.widget=r,this.spec=i}get heightRelevant(){return!1}static mark(e){return new Vm(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 tc(e,n,n,r,e.widget||null,!1)}static replace(e){let n=!!e.block,r,i;if(e.isBlockGap)r=-5e8,i=4e8;else{let{start:o,end:s}=T8(e,n);r=(o?n?-3e8:-1:5e8)-1,i=(s?n?2e8:1:-6e8)+1}return new tc(e,r,i,n,e.widget||null,!0)}static line(e){return new Um(e)}static set(e,n=!1){return Gt.of(e,n)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}dt.none=Gt.empty;class Vm extends dt{constructor(e){let{start:n,end:r}=T8(e);super(n?-1:5e8,r?1:-6e8,null,e),this.tagName=e.tagName||"span",this.class=e.class||"",this.attrs=e.attributes||null}eq(e){var n,r;return this==e||e instanceof Vm&&this.tagName==e.tagName&&(this.class||((n=this.attrs)===null||n===void 0?void 0:n.class))==(e.class||((r=e.attrs)===null||r===void 0?void 0:r.class))&&vT(this.attrs,e.attrs,"class")}range(e,n=e){if(e>=n)throw new RangeError("Mark decorations may not be empty");return super.range(e,n)}}Vm.prototype.point=!1;class Um extends dt{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof Um&&this.spec.class==e.spec.class&&vT(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)}}Um.prototype.mapMode=li.TrackBefore;Um.prototype.point=!0;class tc extends dt{constructor(e,n,r,i,o,s){super(n,r,o,e),this.block=i,this.isReplace=s,this.mapMode=i?n<=0?li.TrackBefore:li.TrackAfter:li.TrackDel}get type(){return this.startSide!=this.endSide?ui.WidgetRange:this.startSide<=0?ui.WidgetBefore:ui.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof tc&&Nve(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)}}tc.prototype.point=!0;function T8(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 Nve(t,e){return t==e||!!(t&&e&&t.compare(e))}function qk(t,e,n,r=0){let i=n.length-1;i>=0&&n[i]+r>=t?n[i]=Math.max(n[i],e):n.push(t,e)}class gp{constructor(e,n,r,i){this.doc=e,this.pos=n,this.end=r,this.disallowBlockEffectsFor=i,this.content=[],this.curLine=null,this.breakAtStart=0,this.pendingBuffer=0,this.bufferMarks=[],this.atCursorPos=!0,this.openStart=-1,this.openEnd=-1,this.text="",this.textOff=0,this.cursor=e.iter(),this.skip=n}posCovered(){if(this.content.length==0)return!this.breakAtStart&&this.doc.lineAt(this.pos).from!=this.pos;let e=this.content[this.content.length-1];return!(e.breakAfter||e instanceof Bl&&e.deco.endSide<0)}getLine(){return this.curLine||(this.content.push(this.curLine=new dr),this.atCursorPos=!0),this.curLine}flushBuffer(e=this.bufferMarks){this.pendingBuffer&&(this.curLine.append(Ev(new md(-1),e),e.length),this.pendingBuffer=0)}addBlockWidget(e){this.flushBuffer(),this.curLine=null,this.content.push(e)}finish(e){this.pendingBuffer&&e<=this.bufferMarks.length?this.flushBuffer():this.pendingBuffer=0,!this.posCovered()&&!(e&&this.content.length&&this.content[this.content.length-1]instanceof Bl)&&this.getLine()}buildText(e,n,r){for(;e>0;){if(this.textOff==this.text.length){let{value:o,lineBreak:s,done:a}=this.cursor.next(this.skip);if(this.skip=0,a)throw new Error("Ran out of text content when drawing inline views");if(s){this.posCovered()||this.getLine(),this.content.length?this.content[this.content.length-1].breakAfter=1:this.breakAtStart=1,this.flushBuffer(),this.curLine=null,this.atCursorPos=!0,e--;continue}else this.text=o,this.textOff=0}let i=Math.min(this.text.length-this.textOff,e,512);this.flushBuffer(n.slice(n.length-r)),this.getLine().append(Ev(new Va(this.text.slice(this.textOff,this.textOff+i)),n),r),this.atCursorPos=!0,this.textOff+=i,e-=i,r=0}}span(e,n,r,i){this.buildText(n-e,r,i),this.pos=n,this.openStart<0&&(this.openStart=i)}point(e,n,r,i,o,s){if(this.disallowBlockEffectsFor[s]&&r instanceof tc){if(r.block)throw new RangeError("Block decorations may not be specified via plugins");if(n>this.doc.lineAt(this.pos).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}let a=n-e;if(r instanceof tc)if(r.block)r.startSide>0&&!this.posCovered()&&this.getLine(),this.addBlockWidget(new Bl(r.widget||new $D("div"),a,r));else{let l=Al.create(r.widget||new $D("span"),a,a?0:r.startSide),c=this.atCursorPos&&!l.isEditable&&o<=i.length&&(e<n||r.startSide>0),f=!l.isEditable&&(e<n||o>i.length||r.startSide<=0),d=this.getLine();this.pendingBuffer==2&&!c&&!l.isEditable&&(this.pendingBuffer=0),this.flushBuffer(i),c&&(d.append(Ev(new md(1),i),o),o=i.length+Math.max(0,o-i.length)),d.append(Ev(l,i),o),this.atCursorPos=f,this.pendingBuffer=f?e<n||o>i.length?1:2:0,this.pendingBuffer&&(this.bufferMarks=i.slice())}else this.doc.lineAt(this.pos).from==this.pos&&this.getLine().addLineDeco(r);a&&(this.textOff+a<=this.text.length?this.textOff+=a:(this.skip+=a-(this.text.length-this.textOff),this.text="",this.textOff=0),this.pos=n),this.openStart<0&&(this.openStart=o)}static build(e,n,r,i,o){let s=new gp(e,n,r,o);return s.openEnd=Gt.spans(i,n,r,s),s.openStart<0&&(s.openStart=s.openEnd),s.finish(s.openEnd),s}}function Ev(t,e){for(let n of e)t=new Ua(n,[t],t.length);return t}class $D extends Ga{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}}var Rn=function(t){return t[t.LTR=0]="LTR",t[t.RTL=1]="RTL",t}(Rn||(Rn={}));const yu=Rn.LTR,yT=Rn.RTL;function A8(t){let e=[];for(let n=0;n<t.length;n++)e.push(1<<+t[n]);return e}const Mve=A8("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"),Dve=A8("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"),Kk=Object.create(null),Rs=[];for(let t of["()","[]","{}"]){let e=t.charCodeAt(0),n=t.charCodeAt(1);Kk[e]=n,Kk[n]=-e}function O8(t){return t<=247?Mve[t]:1424<=t&&t<=1524?2:1536<=t&&t<=1785?Dve[t-1536]:1774<=t&&t<=2220?4:8192<=t&&t<=8204?256:64336<=t&&t<=65023?4:1}const Lve=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/;class Ol{get dir(){return this.level%2?yT:yu}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,i){let o=-1;for(let s=0;s<e.length;s++){let a=e[s];if(a.from<=n&&a.to>=n){if(a.level==r)return s;(o<0||(i!=0?i<0?a.from<n:a.to>n:e[o].level>a.level))&&(o=s)}}if(o<0)throw new RangeError("Index out of range");return o}}function R8(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++){let r=t[n],i=e[n];if(r.from!=i.from||r.to!=i.to||r.direction!=i.direction||!R8(r.inner,i.inner))return!1}return!0}const gn=[];function $ve(t,e,n,r,i){for(let o=0;o<=r.length;o++){let s=o?r[o-1].to:e,a=o<r.length?r[o].from:n,l=o?256:i;for(let c=s,f=l,d=l;c<a;c++){let p=O8(t.charCodeAt(c));p==512?p=f:p==8&&d==4&&(p=16),gn[c]=p==4?2:p,p&7&&(d=p),f=p}for(let c=s,f=l,d=l;c<a;c++){let p=gn[c];if(p==128)c<a-1&&f==gn[c+1]&&f&24?p=gn[c]=f:gn[c]=256;else if(p==64){let m=c+1;for(;m<a&&gn[m]==64;)m++;let v=c&&f==8||m<n&&gn[m]==8?d==1?1:8:256;for(let b=c;b<m;b++)gn[b]=v;c=m-1}else p==8&&d==1&&(gn[c]=1);f=p,p&7&&(d=p)}}}function Ive(t,e,n,r,i){let o=i==1?2:1;for(let s=0,a=0,l=0;s<=r.length;s++){let c=s?r[s-1].to:e,f=s<r.length?r[s].from:n;for(let d=c,p,m,v;d<f;d++)if(m=Kk[p=t.charCodeAt(d)])if(m<0){for(let b=a-3;b>=0;b-=3)if(Rs[b+1]==-m){let S=Rs[b+2],x=S&2?i:S&4?S&1?o:i:0;x&&(gn[d]=gn[Rs[b]]=x),a=b;break}}else{if(Rs.length==189)break;Rs[a++]=d,Rs[a++]=p,Rs[a++]=l}else if((v=gn[d])==2||v==1){let b=v==i;l=b?0:1;for(let S=a-3;S>=0;S-=3){let x=Rs[S+2];if(x&2)break;if(b)Rs[S+2]|=2;else{if(x&4)break;Rs[S+2]|=4}}}}}function jve(t,e,n,r){for(let i=0,o=r;i<=n.length;i++){let s=i?n[i-1].to:t,a=i<n.length?n[i].from:e;for(let l=s;l<a;){let c=gn[l];if(c==256){let f=l+1;for(;;)if(f==a){if(i==n.length)break;f=n[i++].to,a=i<n.length?n[i].from:e}else if(gn[f]==256)f++;else break;let d=o==1,p=(f<e?gn[f]:r)==1,m=d==p?d?1:2:r;for(let v=f,b=i,S=b?n[b-1].to:t;v>l;)v==S&&(v=n[--b].from,S=b?n[b-1].to:t),gn[--v]=m;l=f}else o=c,l++}}}function Gk(t,e,n,r,i,o,s){let a=r%2?2:1;if(r%2==i%2)for(let l=e,c=0;l<n;){let f=!0,d=!1;if(c==o.length||l<o[c].from){let b=gn[l];b!=a&&(f=!1,d=b==16)}let p=!f&&a==1?[]:null,m=f?r:r+1,v=l;e:for(;;)if(c<o.length&&v==o[c].from){if(d)break e;let b=o[c];if(!f)for(let S=b.to,x=c+1;;){if(S==n)break e;if(x<o.length&&o[x].from==S)S=o[x++].to;else{if(gn[S]==a)break e;break}}if(c++,p)p.push(b);else{b.from>l&&s.push(new Ol(l,b.from,m));let S=b.direction==yu!=!(m%2);Yk(t,S?r+1:r,i,b.inner,b.from,b.to,s),l=b.to}v=b.to}else{if(v==n||(f?gn[v]!=a:gn[v]==a))break;v++}p?Gk(t,l,v,r+1,i,p,s):l<v&&s.push(new Ol(l,v,m)),l=v}else for(let l=n,c=o.length;l>e;){let f=!0,d=!1;if(!c||l>o[c-1].to){let b=gn[l-1];b!=a&&(f=!1,d=b==16)}let p=!f&&a==1?[]:null,m=f?r:r+1,v=l;e:for(;;)if(c&&v==o[c-1].to){if(d)break e;let b=o[--c];if(!f)for(let S=b.from,x=c;;){if(S==e)break e;if(x&&o[x-1].to==S)S=o[--x].from;else{if(gn[S-1]==a)break e;break}}if(p)p.push(b);else{b.to<l&&s.push(new Ol(b.to,l,m));let S=b.direction==yu!=!(m%2);Yk(t,S?r+1:r,i,b.inner,b.from,b.to,s),l=b.from}v=b.from}else{if(v==e||(f?gn[v-1]!=a:gn[v-1]==a))break;v--}p?Gk(t,v,l,r+1,i,p,s):v<l&&s.push(new Ol(v,l,m)),l=v}}function Yk(t,e,n,r,i,o,s){let a=e%2?2:1;$ve(t,i,o,r,a),Ive(t,i,o,r,a),jve(i,o,r,a),Gk(t,i,o,e,n,r,s)}function Bve(t,e,n){if(!t)return[new Ol(0,0,e==yT?1:0)];if(e==yu&&!n.length&&!Lve.test(t))return P8(t.length);if(n.length)for(;t.length>gn.length;)gn[gn.length]=256;let r=[],i=e==yu?0:1;return Yk(t,i,i,n,0,t.length,r),r}function P8(t){return[new Ol(0,t,0)]}let N8="";function Fve(t,e,n,r,i){var o;let s=r.head-t.from,a=Ol.find(e,s,(o=r.bidiLevel)!==null&&o!==void 0?o:-1,r.assoc),l=e[a],c=l.side(i,n);if(s==c){let p=a+=i?1:-1;if(p<0||p>=e.length)return null;l=e[a=p],s=l.side(!i,n),c=l.side(i,n)}let f=$r(t.text,s,l.forward(i,n));(f<l.from||f>l.to)&&(f=c),N8=t.text.slice(Math.min(s,f),Math.max(s,f));let d=a==(i?e.length-1:0)?null:e[a+(i?1:-1)];return d&&f==c&&d.level+(i?0:1)<l.level?be.cursor(d.side(!i,n)+t.from,d.forward(i,n)?1:-1,d.level):be.cursor(f+t.from,l.forward(i,n)?-1:1,l.level)}function zve(t,e,n){for(let r=e;r<n;r++){let i=O8(t.charCodeAt(r));if(i==1)return yu;if(i==2||i==4)return yT}return yu}const M8=Je.define(),D8=Je.define(),L8=Je.define(),$8=Je.define(),Xk=Je.define(),I8=Je.define(),j8=Je.define(),B8=Je.define({combine:t=>t.some(e=>e)}),F8=Je.define({combine:t=>t.some(e=>e)});class Kf{constructor(e,n="nearest",r="nearest",i=5,o=5,s=!1){this.range=e,this.y=n,this.x=r,this.yMargin=i,this.xMargin=o,this.isSnapshot=s}map(e){return e.empty?this:new Kf(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 Kf(be.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const _v=Ot.define({map:(t,e)=>t.map(e)});function Do(t,e,n){let r=t.facet($8);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 S1=Je.define({combine:t=>t.length?t[0]:!0});let Vve=0;const Uh=Je.define();class tr{constructor(e,n,r,i,o){this.id=e,this.create=n,this.domEventHandlers=r,this.domEventObservers=i,this.extension=o(this)}static define(e,n){const{eventHandlers:r,eventObservers:i,provide:o,decorations:s}=n||{};return new tr(Vve++,e,r,i,a=>{let l=[Uh.of(a)];return s&&l.push(dm.of(c=>{let f=c.plugin(a);return f?s(f):dt.none})),o&&l.push(o(a)),l})}static fromClass(e,n){return tr.define(r=>new e(r),n)}}class pS{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}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(Do(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.create(e)}catch(n){Do(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){Do(e.state,r,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const z8=Je.define(),bT=Je.define(),dm=Je.define(),V8=Je.define(),wT=Je.define(),U8=Je.define();function ID(t,e){let n=t.state.facet(U8);if(!n.length)return n;let r=n.map(o=>o instanceof Function?o(t):o),i=[];return Gt.spans(r,e.from,e.to,{point(){},span(o,s,a,l){let c=o-e.from,f=s-e.from,d=i;for(let p=a.length-1;p>=0;p--,l--){let m=a[p].spec.bidiIsolate,v;if(m==null&&(m=zve(e.text,c,f)),l>0&&d.length&&(v=d[d.length-1]).to==c&&v.direction==m)v.to=f,d=v.inner;else{let b={from:c,to:f,direction:m,inner:[]};d.push(b),d=b.inner}}}}),i}const W8=Je.define();function H8(t){let e=0,n=0,r=0,i=0;for(let o of t.state.facet(W8)){let s=o(t);s&&(s.left!=null&&(e=Math.max(e,s.left)),s.right!=null&&(n=Math.max(n,s.right)),s.top!=null&&(r=Math.max(r,s.top)),s.bottom!=null&&(i=Math.max(i,s.bottom)))}return{left:e,right:n,top:r,bottom:i}}const Wh=Je.define();class Lo{constructor(e,n,r,i){this.fromA=e,this.toA=n,this.fromB=r,this.toB=i}join(e){return new Lo(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 i=e[n-1];if(!(i.fromA>r.toA)){if(i.toA<r.fromA)break;r=r.join(i),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 i=0,o=0,s=0,a=0;;i++){let l=i==e.length?null:e[i],c=s-a,f=l?l.fromB:1e9;for(;o<n.length&&n[o]<f;){let d=n[o],p=n[o+1],m=Math.max(a,d),v=Math.min(f,p);if(m<=v&&new Lo(m+c,v+c,m,v).addToSet(r),p>f)break;o+=2}if(!l)return r;new Lo(l.fromA,l.toA,l.fromB,l.toB).addToSet(r),s=l.toA,a=l.toB}}}class X0{constructor(e,n,r){this.view=e,this.state=n,this.transactions=r,this.flags=0,this.startState=e.state,this.changes=pr.empty(this.startState.doc.length);for(let o of r)this.changes=this.changes.compose(o.changes);let i=[];this.changes.iterChangedRanges((o,s,a,l)=>i.push(new Lo(o,s,a,l))),this.changedRanges=i}static create(e,n,r){return new X0(e,n,r)}get viewportChanged(){return(this.flags&4)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&10)>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}}class jD extends An{get length(){return this.view.state.doc.length}constructor(e){super(),this.view=e,this.decorations=[],this.dynamicDecorationMap=[],this.domChanged=null,this.hasComposition=null,this.markedForComposition=new Set,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.setDOM(e.contentDOM),this.children=[new dr],this.children[0].setParent(this),this.updateDeco(),this.updateInner([new Lo(0,0,0,e.state.doc.length)],0,null)}update(e){var n;let r=e.changedRanges;this.minWidth>0&&r.length&&(r.every(({fromA:c,toA:f})=>f<this.minWidthFrom||c>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);let i=-1;this.view.inputState.composing>=0&&(!((n=this.domChanged)===null||n===void 0)&&n.newSel?i=this.domChanged.newSel.head:!Yve(e.changes,this.hasComposition)&&!e.selectionSet&&(i=e.state.selection.main.head));let o=i>-1?Wve(this.view,e.changes,i):null;if(this.domChanged=null,this.hasComposition){this.markedForComposition.clear();let{from:c,to:f}=this.hasComposition;r=new Lo(c,f,e.changes.mapPos(c,-1),e.changes.mapPos(f,1)).addToSet(r.slice())}this.hasComposition=o?{from:o.range.fromB,to:o.range.toB}:null,(tt.ie||tt.chrome)&&!o&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let s=this.decorations,a=this.updateDeco(),l=Kve(s,a,e.changes);return r=Lo.extendWithRanges(r,l),!(this.flags&7)&&r.length==0?!1:(this.updateInner(r,e.startState.doc.length,o),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,n,r){this.view.viewState.mustMeasureContent=!0,this.updateChildren(e,n,r);let{observer:i}=this.view;i.ignore(()=>{this.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let s=tt.chrome||tt.ios?{node:i.selectionRange.focusNode,written:!1}:void 0;this.sync(this.view,s),this.flags&=-8,s&&(s.written||i.selectionRange.focusNode!=s.node)&&(this.forceSelection=!0),this.dom.style.height=""}),this.markedForComposition.forEach(s=>s.flags&=-9);let o=[];if(this.view.viewport.from||this.view.viewport.to<this.view.state.doc.length)for(let s of this.children)s instanceof Bl&&s.widget instanceof BD&&o.push(s.dom);i.updateGaps(o)}updateChildren(e,n,r){let i=r?r.range.addToSet(e.slice()):e,o=this.childCursor(n);for(let s=i.length-1;;s--){let a=s>=0?i[s]:null;if(!a)break;let{fromA:l,toA:c,fromB:f,toB:d}=a,p,m,v,b;if(r&&r.range.fromB<d&&r.range.toB>f){let T=gp.build(this.view.state.doc,f,r.range.fromB,this.decorations,this.dynamicDecorationMap),A=gp.build(this.view.state.doc,r.range.toB,d,this.decorations,this.dynamicDecorationMap);m=T.breakAtStart,v=T.openStart,b=A.openEnd;let _=this.compositionView(r);A.breakAtStart?_.breakAfter=1:A.content.length&&_.merge(_.length,_.length,A.content[0],!1,A.openStart,0)&&(_.breakAfter=A.content[0].breakAfter,A.content.shift()),T.content.length&&_.merge(0,0,T.content[T.content.length-1],!0,0,T.openEnd)&&T.content.pop(),p=T.content.concat(_).concat(A.content)}else({content:p,breakAtStart:m,openStart:v,openEnd:b}=gp.build(this.view.state.doc,f,d,this.decorations,this.dynamicDecorationMap));let{i:S,off:x}=o.findPos(c,1),{i:w,off:C}=o.findPos(l,-1);w8(this,w,C,S,x,p,m,v,b)}r&&this.fixCompositionDOM(r)}compositionView(e){let n=new Va(e.text.nodeValue);n.flags|=8;for(let{deco:i}of e.marks)n=new Ua(i,[n],n.length);let r=new dr;return r.append(n,0),r}fixCompositionDOM(e){let n=(o,s)=>{s.flags|=8|(s.children.some(l=>l.flags&7)?1:0),this.markedForComposition.add(s);let a=An.get(o);a&&a!=s&&(a.dom=null),s.setDOM(o)},r=this.childPos(e.range.fromB,1),i=this.children[r.i];n(e.line,i);for(let o=e.marks.length-1;o>=-1;o--)r=i.childPos(r.off,1),i=i.children[r.i],n(o>=0?e.marks[o].node:e.text,i)}updateSelection(e=!1,n=!1){(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let r=this.view.root.activeElement,i=r==this.dom,o=!i&&wy(this.dom,this.view.observer.selectionRange)&&!(r&&this.dom.contains(r));if(!(i||n||o))return;let s=this.forceSelection;this.forceSelection=!1;let a=this.view.state.selection.main,l=this.moveToLine(this.domAtPos(a.anchor)),c=a.empty?l:this.moveToLine(this.domAtPos(a.head));if(tt.gecko&&a.empty&&!this.hasComposition&&Uve(l)){let d=document.createTextNode("");this.view.observer.ignore(()=>l.node.insertBefore(d,l.node.childNodes[l.offset]||null)),l=c=new Gr(d,0),s=!0}let f=this.view.observer.selectionRange;(s||!f.focusNode||(!mp(l.node,l.offset,f.anchorNode,f.anchorOffset)||!mp(c.node,c.offset,f.focusNode,f.focusOffset))&&!this.suppressWidgetCursorChange(f,a))&&(this.view.observer.ignore(()=>{tt.android&&tt.chrome&&this.dom.contains(f.focusNode)&&Gve(f.focusNode,this.dom)&&(this.dom.blur(),this.dom.focus({preventScroll:!0}));let d=Y0(this.view.root);if(d)if(a.empty){if(tt.gecko){let p=Hve(l.node,l.offset);if(p&&p!=3){let m=K8(l.node,l.offset,p==1?1:-1);m&&(l=new Gr(m.node,m.offset))}}d.collapse(l.node,l.offset),a.bidiLevel!=null&&d.caretBidiLevel!==void 0&&(d.caretBidiLevel=a.bidiLevel)}else if(d.extend){d.collapse(l.node,l.offset);try{d.extend(c.node,c.offset)}catch{}}else{let p=document.createRange();a.anchor>a.head&&([l,c]=[c,l]),p.setEnd(c.node,c.offset),p.setStart(l.node,l.offset),d.removeAllRanges(),d.addRange(p)}o&&this.view.root.activeElement==this.dom&&(this.dom.blur(),r&&r.focus())}),this.view.observer.setSelectionRange(l,c)),this.impreciseAnchor=l.precise?null:new Gr(f.anchorNode,f.anchorOffset),this.impreciseHead=c.precise?null:new Gr(f.focusNode,f.focusOffset)}suppressWidgetCursorChange(e,n){return this.hasComposition&&n.empty&&mp(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=Y0(e.root),{anchorNode:i,anchorOffset:o}=e.observer.selectionRange;if(!r||!n.empty||!n.assoc||!r.modify)return;let s=dr.find(this,n.head);if(!s)return;let a=s.posAtStart;if(n.head==a||n.head==a+s.length)return;let l=this.coordsAt(n.head,-1),c=this.coordsAt(n.head,1);if(!l||!c||l.bottom>c.top)return;let f=this.domAtPos(n.head+n.assoc);r.collapse(f.node,f.offset),r.modify("move",n.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let d=e.observer.selectionRange;e.docView.posFromDOM(d.anchorNode,d.anchorOffset)!=n.from&&r.collapse(i,o)}moveToLine(e){let n=this.dom,r;if(e.node!=n)return e;for(let i=e.offset;!r&&i<n.childNodes.length;i++){let o=An.get(n.childNodes[i]);o instanceof dr&&(r=o.domAtPos(0))}for(let i=e.offset-1;!r&&i>=0;i--){let o=An.get(n.childNodes[i]);o instanceof dr&&(r=o.domAtPos(o.length))}return r?new Gr(r.node,r.offset,!0):e}nearest(e){for(let n=e;n;){let r=An.get(n);if(r&&r.rootView==this)return r;n=n.parentNode}return null}posFromDOM(e,n){let r=this.nearest(e);if(!r)throw new RangeError("Trying to find position for a DOM position outside of the document");return r.localPosFromDOM(e,n)+r.posAtStart}domAtPos(e){let{i:n,off:r}=this.childCursor().findPos(e,-1);for(;n<this.children.length-1;){let i=this.children[n];if(r<i.length||i instanceof dr)break;n++,r=0}return this.children[n].domAtPos(r)}coordsAt(e,n){let r=null,i=0;for(let o=this.length,s=this.children.length-1;s>=0;s--){let a=this.children[s],l=o-a.breakAfter,c=l-a.length;if(l<e)break;c<=e&&(c<e||a.covers(-1))&&(l>e||a.covers(1))&&(!r||a instanceof dr&&!(r instanceof dr&&n>=0))&&(r=a,i=c),o=c}return r?r.coordsAt(e-i,n):null}coordsForChar(e){let{i:n,off:r}=this.childPos(e,1),i=this.children[n];if(!(i instanceof dr))return null;for(;i.children.length;){let{i:a,off:l}=i.childPos(r,1);for(;;a++){if(a==i.children.length)return null;if((i=i.children[a]).length)break}r=l}if(!(i instanceof Va))return null;let o=$r(i.text,r);if(o==r)return null;let s=vu(i.dom,r,o).getClientRects();for(let a=0;a<s.length;a++){let l=s[a];if(a==s.length-1||l.top<l.bottom&&l.left<l.right)return l}return null}measureVisibleLineHeights(e){let n=[],{from:r,to:i}=e,o=this.view.contentDOM.clientWidth,s=o>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,a=-1,l=this.view.textDirection==Rn.LTR;for(let c=0,f=0;f<this.children.length;f++){let d=this.children[f],p=c+d.length;if(p>i)break;if(c>=r){let m=d.dom.getBoundingClientRect();if(n.push(m.height),s){let v=d.dom.lastChild,b=v?pd(v):[];if(b.length){let S=b[b.length-1],x=l?S.right-m.left:m.right-S.left;x>a&&(a=x,this.minWidth=o,this.minWidthFrom=c,this.minWidthTo=p)}}}c=p+d.breakAfter}return n}textDirectionAt(e){let{i:n}=this.childPos(e,1);return getComputedStyle(this.children[n].dom).direction=="rtl"?Rn.RTL:Rn.LTR}measureTextSize(){for(let o of this.children)if(o instanceof dr){let s=o.measureTextSize();if(s)return s}let e=document.createElement("div"),n,r,i;return e.className="cm-line",e.style.width="99999px",e.style.position="absolute",e.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.dom.appendChild(e);let o=pd(e.firstChild)[0];n=e.getBoundingClientRect().height,r=o?o.width/27:7,i=o?o.height:n,e.remove()}),{lineHeight:n,charWidth:r,textHeight:i}}childCursor(e=this.length){let n=this.children.length;return n&&(e-=this.children[--n].length),new b8(this.children,e,n)}computeBlockGapDeco(){let e=[],n=this.view.viewState;for(let r=0,i=0;;i++){let o=i==n.viewports.length?null:n.viewports[i],s=o?o.from-1:this.length;if(s>r){let a=(n.lineBlockAt(s).bottom-n.lineBlockAt(r).top)/this.view.scaleY;e.push(dt.replace({widget:new BD(a),block:!0,inclusive:!0,isBlockGap:!0}).range(r,s))}if(!o)break;r=o.to+1}return dt.set(e)}updateDeco(){let e=this.view.state.facet(dm).map((i,o)=>(this.dynamicDecorationMap[o]=typeof i=="function")?i(this.view):i),n=!1,r=this.view.state.facet(V8).map((i,o)=>{let s=typeof i=="function";return s&&(n=!0),s?i(this.view):i});r.length&&(this.dynamicDecorationMap[e.length]=n,e.push(Gt.join(r)));for(let i=e.length;i<e.length+3;i++)this.dynamicDecorationMap[i]=!1;return this.decorations=[...e,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco]}scrollIntoView(e){if(e.isSnapshot){let c=this.view.viewState.lineBlockAt(e.range.head);this.view.scrollDOM.scrollTop=c.top-e.yMargin,this.view.scrollDOM.scrollLeft=e.xMargin;return}let{range:n}=e,r=this.coordsAt(n.head,n.empty?n.assoc:n.head>n.anchor?-1:1),i;if(!r)return;!n.empty&&(i=this.coordsAt(n.anchor,n.anchor>n.head?-1:1))&&(r={left:Math.min(r.left,i.left),top:Math.min(r.top,i.top),right:Math.max(r.right,i.right),bottom:Math.max(r.bottom,i.bottom)});let o=H8(this.view),s={left:r.left-o.left,top:r.top-o.top,right:r.right+o.right,bottom:r.bottom+o.bottom},{offsetWidth:a,offsetHeight:l}=this.view.scrollDOM;Cve(this.view.scrollDOM,s,n.head<n.anchor?-1:1,e.x,e.y,Math.max(Math.min(e.xMargin,a),-a),Math.max(Math.min(e.yMargin,l),-l),this.view.textDirection==Rn.LTR)}}function Uve(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")}class BD extends Ga{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 q8(t,e){let n=t.observer.selectionRange,r=n.focusNode&&K8(n.focusNode,n.focusOffset,0);if(!r)return null;let i=e-r.offset;return{from:i,to:i+r.node.nodeValue.length,node:r.node}}function Wve(t,e,n){let r=q8(t,n);if(!r)return null;let{node:i,from:o,to:s}=r,a=i.nodeValue;if(/[\n\r]/.test(a)||t.state.doc.sliceString(r.from,r.to)!=a)return null;let l=e.invertedDesc,c=new Lo(l.mapPos(o),l.mapPos(s),o,s),f=[];for(let d=i.parentNode;;d=d.parentNode){let p=An.get(d);if(p instanceof Ua)f.push({node:d,deco:p.mark});else{if(p instanceof dr||d.nodeName=="DIV"&&d.parentNode==t.contentDOM)return{range:c,text:i,marks:f,line:d};if(d!=t.contentDOM)f.push({node:d,deco:new Vm({inclusive:!0,attributes:Pve(d),tagName:d.tagName.toLowerCase()})});else return null}}}function K8(t,e,n){if(n<=0)for(let r=t,i=e;;){if(r.nodeType==3)return{node:r,offset:i};if(r.nodeType==1&&i>0)r=r.childNodes[i-1],i=za(r);else break}if(n>=0)for(let r=t,i=e;;){if(r.nodeType==3)return{node:r,offset:i};if(r.nodeType==1&&i<r.childNodes.length&&n>=0)r=r.childNodes[i],i=0;else break}return null}function Hve(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 qve=class{constructor(){this.changes=[]}compareRange(e,n){qk(e,n,this.changes)}comparePoint(e,n){qk(e,n,this.changes)}};function Kve(t,e,n){let r=new qve;return Gt.compare(t,e,n,r),r.changes}function Gve(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 Yve(t,e){let n=!1;return e&&t.iterChangedRanges((r,i)=>{r<e.to&&i>e.from&&(n=!0)}),n}function Xve(t,e,n=1){let r=t.charCategorizer(e),i=t.doc.lineAt(e),o=e-i.from;if(i.length==0)return be.cursor(e);o==0?n=1:o==i.length&&(n=-1);let s=o,a=o;n<0?s=$r(i.text,o,!1):a=$r(i.text,o);let l=r(i.text.slice(s,a));for(;s>0;){let c=$r(i.text,s,!1);if(r(i.text.slice(c,s))!=l)break;s=c}for(;a<i.length;){let c=$r(i.text,a);if(r(i.text.slice(a,c))!=l)break;a=c}return be.range(s+i.from,a+i.from)}function Zve(t,e){return e.left>t?e.left-t:Math.max(0,t-e.right)}function Qve(t,e){return e.top>t?e.top-t:Math.max(0,t-e.bottom)}function mS(t,e){return t.top<e.bottom-1&&t.bottom>e.top+1}function FD(t,e){return e<t.top?{top:e,left:t.left,right:t.right,bottom:t.bottom}:t}function zD(t,e){return e>t.bottom?{top:t.top,left:t.left,right:t.right,bottom:e}:t}function Zk(t,e,n){let r,i,o,s,a=!1,l,c,f,d;for(let v=t.firstChild;v;v=v.nextSibling){let b=pd(v);for(let S=0;S<b.length;S++){let x=b[S];i&&mS(i,x)&&(x=FD(zD(x,i.bottom),i.top));let w=Zve(e,x),C=Qve(n,x);if(w==0&&C==0)return v.nodeType==3?VD(v,e,n):Zk(v,e,n);if(!r||s>C||s==C&&o>w){r=v,i=x,o=w,s=C;let T=C?n<x.top?-1:1:w?e<x.left?-1:1:0;a=!T||(T>0?S<b.length-1:S>0)}w==0?n>x.bottom&&(!f||f.bottom<x.bottom)?(l=v,f=x):n<x.top&&(!d||d.top>x.top)&&(c=v,d=x):f&&mS(f,x)?f=zD(f,x.bottom):d&&mS(d,x)&&(d=FD(d,x.top))}}if(f&&f.bottom>=n?(r=l,i=f):d&&d.top<=n&&(r=c,i=d),!r)return{node:t,offset:0};let p=Math.max(i.left,Math.min(i.right,e));if(r.nodeType==3)return VD(r,p,n);if(a&&r.contentEditable!="false")return Zk(r,p,n);let m=Array.prototype.indexOf.call(t.childNodes,r)+(e>=(i.left+i.right)/2?1:0);return{node:t,offset:m}}function VD(t,e,n){let r=t.nodeValue.length,i=-1,o=1e9,s=0;for(let a=0;a<r;a++){let l=vu(t,a,a+1).getClientRects();for(let c=0;c<l.length;c++){let f=l[c];if(f.top==f.bottom)continue;s||(s=e-f.left);let d=(f.top>n?f.top-n:n-f.bottom)-1;if(f.left-1<=e&&f.right+1>=e&&d<o){let p=e>=(f.left+f.right)/2,m=p;if((tt.chrome||tt.gecko)&&vu(t,a).getBoundingClientRect().left==f.right&&(m=!p),d<=0)return{node:t,offset:a+(m?1:0)};i=a+(m?1:0),o=d}}}return{node:t,offset:i>-1?i:s>0?t.nodeValue.length:0}}function G8(t,e,n,r=-1){var i,o;let s=t.contentDOM.getBoundingClientRect(),a=s.top+t.viewState.paddingTop,l,{docHeight:c}=t.viewState,{x:f,y:d}=e,p=d-a;if(p<0)return 0;if(p>c)return t.state.doc.length;for(let T=t.viewState.heightOracle.textHeight/2,A=!1;l=t.elementAtHeight(p),l.type!=ui.Text;)for(;p=r>0?l.bottom+T:l.top-T,!(p>=0&&p<=c);){if(A)return n?null:0;A=!0,r=-r}d=a+p;let m=l.from;if(m<t.viewport.from)return t.viewport.from==0?0:n?null:UD(t,s,l,f,d);if(m>t.viewport.to)return t.viewport.to==t.state.doc.length?t.state.doc.length:n?null:UD(t,s,l,f,d);let v=t.dom.ownerDocument,b=t.root.elementFromPoint?t.root:v,S=b.elementFromPoint(f,d);S&&!t.contentDOM.contains(S)&&(S=null),S||(f=Math.max(s.left+1,Math.min(s.right-1,f)),S=b.elementFromPoint(f,d),S&&!t.contentDOM.contains(S)&&(S=null));let x,w=-1;if(S&&((i=t.docView.nearest(S))===null||i===void 0?void 0:i.isEditable)!=!1){if(v.caretPositionFromPoint){let T=v.caretPositionFromPoint(f,d);T&&({offsetNode:x,offset:w}=T)}else if(v.caretRangeFromPoint){let T=v.caretRangeFromPoint(f,d);T&&({startContainer:x,startOffset:w}=T,(!t.contentDOM.contains(x)||tt.safari&&Jve(x,w,f)||tt.chrome&&eye(x,w,f))&&(x=void 0))}}if(!x||!t.docView.dom.contains(x)){let T=dr.find(t.docView,m);if(!T)return p>l.top+l.height/2?l.to:l.from;({node:x,offset:w}=Zk(T.dom,f,d))}let C=t.docView.nearest(x);if(!C)return null;if(C.isWidget&&((o=C.dom)===null||o===void 0?void 0:o.nodeType)==1){let T=C.dom.getBoundingClientRect();return e.y<T.top||e.y<=T.bottom&&e.x<=(T.left+T.right)/2?C.posAtStart:C.posAtEnd}else return C.localPosFromDOM(x,w)+C.posAtStart}function UD(t,e,n,r,i){let o=Math.round((r-e.left)*t.defaultCharacterWidth);if(t.lineWrapping&&n.height>t.defaultLineHeight*1.5){let a=t.viewState.heightOracle.textHeight,l=Math.floor((i-n.top-(t.defaultLineHeight-a)*.5)/a);o+=l*t.viewState.heightOracle.lineLength}let s=t.state.sliceDoc(n.from,n.to);return n.from+Ik(s,o,t.state.tabSize)}function Jve(t,e,n){let r;if(t.nodeType!=3||e!=(r=t.nodeValue.length))return!1;for(let i=t.nextSibling;i;i=i.nextSibling)if(i.nodeType!=1||i.nodeName!="BR")return!1;return vu(t,r-1,r).getBoundingClientRect().left>n}function eye(t,e,n){if(e!=0)return!1;for(let i=t;;){let o=i.parentNode;if(!o||o.nodeType!=1||o.firstChild!=i)return!1;if(o.classList.contains("cm-line"))break;i=o}let r=t.nodeType==1?t.getBoundingClientRect():vu(t,0,Math.max(t.nodeValue.length,1)).getBoundingClientRect();return n-r.left>5}function Qk(t,e){let n=t.lineBlockAt(e);if(Array.isArray(n.type)){for(let r of n.type)if(r.to>e||r.to==e&&(r.to==n.to||r.type==ui.Text))return r}return n}function tye(t,e,n,r){let i=Qk(t,e.head),o=!r||i.type!=ui.Text||!(t.lineWrapping||i.widgetLineBreaks)?null:t.coordsAtPos(e.assoc<0&&e.head>i.from?e.head-1:e.head);if(o){let s=t.dom.getBoundingClientRect(),a=t.textDirectionAt(i.from),l=t.posAtCoords({x:n==(a==Rn.LTR)?s.right-1:s.left+1,y:(o.top+o.bottom)/2});if(l!=null)return be.cursor(l,n?-1:1)}return be.cursor(n?i.to:i.from,n?-1:1)}function WD(t,e,n,r){let i=t.state.doc.lineAt(e.head),o=t.bidiSpans(i),s=t.textDirectionAt(i.from);for(let a=e,l=null;;){let c=Fve(i,o,s,a,n),f=N8;if(!c){if(i.number==(n?t.state.doc.lines:1))return a;f=`
216
+ `,i=t.state.doc.line(i.number+(n?1:-1)),o=t.bidiSpans(i),c=t.visualLineSide(i,!n)}if(l){if(!l(f))return a}else{if(!r)return c;l=r(f)}a=c}}function nye(t,e,n){let r=t.state.charCategorizer(e),i=r(n);return o=>{let s=r(o);return i==Ln.Space&&(i=s),i==s}}function rye(t,e,n,r){let i=e.head,o=n?1:-1;if(i==(n?t.state.doc.length:0))return be.cursor(i,e.assoc);let s=e.goalColumn,a,l=t.contentDOM.getBoundingClientRect(),c=t.coordsAtPos(i,e.assoc||-1),f=t.documentTop;if(c)s==null&&(s=c.left-l.left),a=o<0?c.top:c.bottom;else{let m=t.viewState.lineBlockAt(i);s==null&&(s=Math.min(l.right-l.left,t.defaultCharacterWidth*(i-m.from))),a=(o<0?m.top:m.bottom)+f}let d=l.left+s,p=r??t.viewState.heightOracle.textHeight>>1;for(let m=0;;m+=10){let v=a+(p+m)*o,b=G8(t,{x:d,y:v},!1,o);if(v<l.top||v>l.bottom||(o<0?b<i:b>i)){let S=t.docView.coordsForChar(b),x=!S||v<S.top?-1:1;return be.cursor(b,x,void 0,s)}}}function xy(t,e,n){for(;;){let r=0;for(let i of t)i.between(e-1,e+1,(o,s,a)=>{if(e>o&&e<s){let l=r||n||(e-o<s-e?-1:1);e=l<0?o:s,r=l}});if(!r)return e}}function gS(t,e,n){let r=xy(t.state.facet(wT).map(i=>i(t)),n.from,e.head>n.from?-1:1);return r==n.from?n:be.cursor(r,r<n.from?1:-1)}class iye{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.pendingIOSKey=void 0,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastEscPress=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.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,tt.safari&&e.contentDOM.addEventListener("input",()=>null),tt.gecko&&wye(e.contentDOM.ownerDocument)}handleEvent(e){!dye(this.view,e)||this.ignoreDuringComposition(e)||e.type=="keydown"&&this.keydown(e)||this.runHandlers(e.type,e)}runHandlers(e,n){let r=this.handlers[e];if(r){for(let i of r.observers)i(this.view,n);for(let i of r.handlers){if(n.defaultPrevented)break;if(i(this.view,n)){n.preventDefault();break}}}}ensureHandlers(e){let n=oye(e),r=this.handlers,i=this.view.contentDOM;for(let o in n)if(o!="scroll"){let s=!n[o].handlers.length,a=r[o];a&&s!=!a.handlers.length&&(i.removeEventListener(o,this.handleEvent),a=null),a||i.addEventListener(o,this.handleEvent,{passive:s})}for(let o in r)o!="scroll"&&!n[o]&&i.removeEventListener(o,this.handleEvent);this.handlers=n}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),e.keyCode==9&&Date.now()<this.lastEscPress+2e3)return!0;if(e.keyCode!=27&&X8.indexOf(e.keyCode)<0&&(this.view.inputState.lastEscPress=0),tt.android&&tt.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;let n;return tt.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&((n=Y8.find(r=>r.keyCode==e.keyCode))&&!e.ctrlKey||sye.indexOf(e.key)>-1&&e.ctrlKey&&!e.shiftKey)?(this.pendingIOSKey=n||e,setTimeout(()=>this.flushIOSKey(),250),!0):(e.keyCode!=229&&this.view.observer.forceFlush(),!1)}flushIOSKey(){let e=this.pendingIOSKey;return e?(this.pendingIOSKey=void 0,qf(this.view.contentDOM,e.key,e.keyCode)):!1}ignoreDuringComposition(e){return/^key/.test(e.type)?this.composing>0?!0:tt.safari&&!tt.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1:!1}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}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 HD(t,e){return(n,r)=>{try{return e.call(t,r,n)}catch(i){Do(n.state,i)}}}function oye(t){let e=Object.create(null);function n(r){return e[r]||(e[r]={observers:[],handlers:[]})}for(let r of t){let i=r.spec;if(i&&i.domEventHandlers)for(let o in i.domEventHandlers){let s=i.domEventHandlers[o];s&&n(o).handlers.push(HD(r.value,s))}if(i&&i.domEventObservers)for(let o in i.domEventObservers){let s=i.domEventObservers[o];s&&n(o).observers.push(HD(r.value,s))}}for(let r in ys)n(r).handlers.push(ys[r]);for(let r in bs)n(r).observers.push(bs[r]);return e}const Y8=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],sye="dthko",X8=[16,17,18,20,91,92,224,225],Tv=6;function Av(t){return Math.max(0,t)*.7+8}function aye(t,e){return Math.max(Math.abs(t.clientX-e.clientX),Math.abs(t.clientY-e.clientY))}class lye{constructor(e,n,r,i){this.view=e,this.startEvent=n,this.style=r,this.mustSelect=i,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=n,this.scrollParent=kve(e.contentDOM),this.atoms=e.state.facet(wT).map(s=>s(e));let o=e.contentDOM.ownerDocument;o.addEventListener("mousemove",this.move=this.move.bind(this)),o.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=n.shiftKey,this.multiple=e.state.facet(Ht.allowMultipleSelections)&&cye(e,n),this.dragging=fye(e,n)&&eB(n)==1?null:!1}start(e){this.dragging===!1&&this.select(e)}move(e){var n;if(e.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&aye(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let r=0,i=0,o=((n=this.scrollParent)===null||n===void 0?void 0:n.getBoundingClientRect())||{left:0,top:0,right:this.view.win.innerWidth,bottom:this.view.win.innerHeight},s=H8(this.view);e.clientX-s.left<=o.left+Tv?r=-Av(o.left-e.clientX):e.clientX+s.right>=o.right-Tv&&(r=Av(e.clientX-o.right)),e.clientY-s.top<=o.top+Tv?i=-Av(o.top-e.clientY):e.clientY+s.bottom>=o.bottom-Tv&&(i=Av(e.clientY-o.bottom)),this.setScrollSpeed(r,i)}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(){this.scrollParent?(this.scrollParent.scrollLeft+=this.scrollSpeed.x,this.scrollParent.scrollTop+=this.scrollSpeed.y):this.view.win.scrollBy(this.scrollSpeed.x,this.scrollSpeed.y),this.dragging===!1&&this.select(this.lastEvent)}skipAtoms(e){let n=null;for(let r=0;r<e.ranges.length;r++){let i=e.ranges[r],o=null;if(i.empty){let s=xy(this.atoms,i.from,0);s!=i.from&&(o=be.cursor(s,-1))}else{let s=xy(this.atoms,i.from,-1),a=xy(this.atoms,i.to,1);(s!=i.from||a!=i.to)&&(o=be.range(i.from==i.anchor?s:a,i.from==i.head?s:a))}o&&(n||(n=e.ranges.slice()),n[r]=o)}return n?be.create(n,e.mainIndex):e}select(e){let{view:n}=this,r=this.skipAtoms(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){this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}}function cye(t,e){let n=t.state.facet(M8);return n.length?n[0](e):tt.mac?e.metaKey:e.ctrlKey}function uye(t,e){let n=t.state.facet(D8);return n.length?n[0](e):tt.mac?!e.altKey:!e.ctrlKey}function fye(t,e){let{main:n}=t.state.selection;if(n.empty)return!1;let r=Y0(t.root);if(!r||r.rangeCount==0)return!0;let i=r.getRangeAt(0).getClientRects();for(let o=0;o<i.length;o++){let s=i[o];if(s.left<=e.clientX&&s.right>=e.clientX&&s.top<=e.clientY&&s.bottom>=e.clientY)return!0}return!1}function dye(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=An.get(n))&&r.ignoreEvent(e))return!1;return!0}const ys=Object.create(null),bs=Object.create(null),Z8=tt.ie&&tt.ie_version<15||tt.ios&&tt.webkit_version<604;function hye(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(),Q8(t,n.value)},50)}function Q8(t,e){let{state:n}=t,r,i=1,o=n.toText(e),s=o.lines==n.selection.ranges.length;if(Jk!=null&&n.selection.ranges.every(l=>l.empty)&&Jk==o.toString()){let l=-1;r=n.changeByRange(c=>{let f=n.doc.lineAt(c.from);if(f.from==l)return{range:c};l=f.from;let d=n.toText((s?o.line(i++).text:e)+n.lineBreak);return{changes:{from:f.from,insert:d},range:be.cursor(c.from+d.length)}})}else s?r=n.changeByRange(l=>{let c=o.line(i++);return{changes:{from:l.from,to:l.to,insert:c.text},range:be.cursor(l.from+c.length)}}):r=n.replaceSelection(o);t.dispatch(r,{userEvent:"input.paste",scrollIntoView:!0})}bs.scroll=t=>{t.inputState.lastScrollTop=t.scrollDOM.scrollTop,t.inputState.lastScrollLeft=t.scrollDOM.scrollLeft};ys.keydown=(t,e)=>(t.inputState.setSelectionOrigin("select"),e.keyCode==27&&(t.inputState.lastEscPress=Date.now()),!1);bs.touchstart=(t,e)=>{t.inputState.lastTouchTime=Date.now(),t.inputState.setSelectionOrigin("select.pointer")};bs.touchmove=t=>{t.inputState.setSelectionOrigin("select.pointer")};ys.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(L8))if(n=r(t,e),n)break;if(!n&&e.button==0&&(n=gye(t,e)),n){let r=!t.hasFocus;t.inputState.startMouseSelection(new lye(t,e,n,r)),r&&t.observer.ignore(()=>g8(t.contentDOM));let i=t.inputState.mouseSelection;if(i)return i.start(e),i.dragging===!1}return!1};function qD(t,e,n,r){if(r==1)return be.cursor(e,n);if(r==2)return Xve(t.state,e,n);{let i=dr.find(t.docView,e),o=t.state.doc.lineAt(i?i.posAtEnd:e),s=i?i.posAtStart:o.from,a=i?i.posAtEnd:o.to;return a<t.state.doc.length&&a==o.to&&a++,be.range(s,a)}}let J8=(t,e)=>t>=e.top&&t<=e.bottom,KD=(t,e,n)=>J8(e,n)&&t>=n.left&&t<=n.right;function pye(t,e,n,r){let i=dr.find(t.docView,e);if(!i)return 1;let o=e-i.posAtStart;if(o==0)return 1;if(o==i.length)return-1;let s=i.coordsAt(o,-1);if(s&&KD(n,r,s))return-1;let a=i.coordsAt(o,1);return a&&KD(n,r,a)?1:s&&J8(r,s)?-1:1}function GD(t,e){let n=t.posAtCoords({x:e.clientX,y:e.clientY},!1);return{pos:n,bias:pye(t,n,e.clientX,e.clientY)}}const mye=tt.ie&&tt.ie_version<=11;let YD=null,XD=0,ZD=0;function eB(t){if(!mye)return t.detail;let e=YD,n=ZD;return YD=t,ZD=Date.now(),XD=!e||n>Date.now()-400&&Math.abs(e.clientX-t.clientX)<2&&Math.abs(e.clientY-t.clientY)<2?(XD+1)%3:1}function gye(t,e){let n=GD(t,e),r=eB(e),i=t.state.selection;return{update(o){o.docChanged&&(n.pos=o.changes.mapPos(n.pos),i=i.map(o.changes))},get(o,s,a){let l=GD(t,o),c,f=qD(t,l.pos,l.bias,r);if(n.pos!=l.pos&&!s){let d=qD(t,n.pos,n.bias,r),p=Math.min(d.from,f.from),m=Math.max(d.to,f.to);f=p<f.from?be.range(p,m):be.range(m,p)}return s?i.replaceRange(i.main.extend(f.from,f.to)):a&&r==1&&i.ranges.length>1&&(c=vye(i,l.pos))?c:a?i.addRange(f):be.create([f])}}}function vye(t,e){for(let n=0;n<t.ranges.length;n++){let{from:r,to:i}=t.ranges[n];if(r<=e&&i>=e)return be.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}ys.dragstart=(t,e)=>{let{selection:{main:n}}=t.state;if(e.target.draggable){let i=t.docView.nearest(e.target);if(i&&i.isWidget){let o=i.posAtStart,s=o+i.length;(o>=n.to||s<=n.from)&&(n=be.range(o,s))}}let{inputState:r}=t;return r.mouseSelection&&(r.mouseSelection.dragging=!0),r.draggedContent=n,e.dataTransfer&&(e.dataTransfer.setData("Text",t.state.sliceDoc(n.from,n.to)),e.dataTransfer.effectAllowed="copyMove"),!1};ys.dragend=t=>(t.inputState.draggedContent=null,!1);function QD(t,e,n,r){if(!n)return;let i=t.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:o}=t.inputState,s=r&&o&&uye(t,e)?{from:o.from,to:o.to}:null,a={from:i,insert:n},l=t.state.changes(s?[s,a]:a);t.focus(),t.dispatch({changes:l,selection:{anchor:l.mapPos(i,-1),head:l.mapPos(i,1)},userEvent:s?"move.drop":"input.drop"}),t.inputState.draggedContent=null}ys.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),i=0,o=()=>{++i==n.length&&QD(t,e,r.filter(s=>s!=null).join(t.state.lineBreak),!1)};for(let s=0;s<n.length;s++){let a=new FileReader;a.onerror=o,a.onload=()=>{/[\x00-\x08\x0e-\x1f]{2}/.test(a.result)||(r[s]=a.result),o()},a.readAsText(n[s])}return!0}else{let r=e.dataTransfer.getData("Text");if(r)return QD(t,e,r,!0),!0}return!1};ys.paste=(t,e)=>{if(t.state.readOnly)return!0;t.observer.flush();let n=Z8?null:e.clipboardData;return n?(Q8(t,n.getData("text/plain")||n.getData("text/uri-text")),!0):(hye(t),!1)};function yye(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 bye(t){let e=[],n=[],r=!1;for(let i of t.selection.ranges)i.empty||(e.push(t.sliceDoc(i.from,i.to)),n.push(i));if(!e.length){let i=-1;for(let{from:o}of t.selection.ranges){let s=t.doc.lineAt(o);s.number>i&&(e.push(s.text),n.push({from:s.from,to:Math.min(t.doc.length,s.to+1)})),i=s.number}r=!0}return{text:e.join(t.lineBreak),ranges:n,linewise:r}}let Jk=null;ys.copy=ys.cut=(t,e)=>{let{text:n,ranges:r,linewise:i}=bye(t.state);if(!n&&!i)return!1;Jk=i?n:null,e.type=="cut"&&!t.state.readOnly&&t.dispatch({changes:r,scrollIntoView:!0,userEvent:"delete.cut"});let o=Z8?null:e.clipboardData;return o?(o.clearData(),o.setData("text/plain",n),!0):(yye(t,n),!1)};const tB=oa.define();function nB(t,e){let n=[];for(let r of t.facet(j8)){let i=r(t,e);i&&n.push(i)}return n?t.update({effects:n,annotations:tB.of(!0)}):null}function rB(t){setTimeout(()=>{let e=t.hasFocus;if(e!=t.inputState.notifiedFocused){let n=nB(t.state,e);n?t.dispatch(n):t.update([])}},10)}bs.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),rB(t)};bs.blur=t=>{t.observer.clearSelectionRange(),rB(t)};bs.compositionstart=bs.compositionupdate=t=>{t.inputState.compositionFirstChange==null&&(t.inputState.compositionFirstChange=!0),t.inputState.composing<0&&(t.inputState.composing=0)};bs.compositionend=t=>{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,tt.chrome&&tt.android?t.observer.flushSoon():t.inputState.compositionPendingChange?Promise.resolve().then(()=>t.observer.flush()):setTimeout(()=>{t.inputState.composing<0&&t.docView.hasComposition&&t.update([])},50)};bs.contextmenu=t=>{t.inputState.lastContextMenu=Date.now()};ys.beforeinput=(t,e)=>{var n;let r;if(tt.chrome&&tt.android&&(r=Y8.find(i=>i.inputType==e.inputType))&&(t.observer.delayAndroidKey(r.key,r.keyCode),r.key=="Backspace"||r.key=="Delete")){let i=((n=window.visualViewport)===null||n===void 0?void 0:n.height)||0;setTimeout(()=>{var o;(((o=window.visualViewport)===null||o===void 0?void 0:o.height)||0)>i+10&&t.hasFocus&&(t.contentDOM.blur(),t.focus())},100)}return!1};const JD=new Set;function wye(t){JD.has(t)||(JD.add(t),t.addEventListener("copy",()=>{}),t.addEventListener("cut",()=>{}))}const eL=["pre-wrap","normal","pre-line","break-spaces"];class xye{constructor(e){this.lineWrapping=e,this.doc=tn.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30,this.heightChanged=!1}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)/(this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return eL.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let n=!1;for(let r=0;r<e.length;r++){let i=e[r];i<0?r++:this.heightSamples[Math.floor(i*10)]||(n=!0,this.heightSamples[Math.floor(i*10)]=!0)}return n}refresh(e,n,r,i,o,s){let a=eL.indexOf(e)>-1,l=Math.round(n)!=Math.round(this.lineHeight)||this.lineWrapping!=a;if(this.lineWrapping=a,this.lineHeight=n,this.charWidth=r,this.textHeight=i,this.lineLength=o,l){this.heightSamples={};for(let c=0;c<s.length;c++){let f=s[c];f<0?c++:this.heightSamples[Math.floor(f*10)]=!0}}return l}}class Sye{constructor(e,n){this.from=e,this.heights=n,this.index=0}get more(){return this.index<this.heights.length}}class zs{constructor(e,n,r,i,o){this.from=e,this.length=n,this.top=r,this.height=i,this._content=o}get type(){return typeof this._content=="number"?ui.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 tc?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 zs(this.from,this.length+e.length,this.top,this.height+e.height,n)}}var _n=function(t){return t[t.ByPos=0]="ByPos",t[t.ByHeight=1]="ByHeight",t[t.ByPosNoHeight=2]="ByPosNoHeight",t}(_n||(_n={}));const Sy=.001;class fi{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,n){this.height!=n&&(Math.abs(this.height-n)>Sy&&(e.heightChanged=!0),this.height=n)}replace(e,n,r){return fi.of(r)}decomposeLeft(e,n){n.push(this)}decomposeRight(e,n){n.push(this)}applyChanges(e,n,r,i){let o=this,s=r.doc;for(let a=i.length-1;a>=0;a--){let{fromA:l,toA:c,fromB:f,toB:d}=i[a],p=o.lineAt(l,_n.ByPosNoHeight,r.setDoc(n),0,0),m=p.to>=c?p:o.lineAt(c,_n.ByPosNoHeight,r,0,0);for(d+=m.to-c,c=m.to;a>0&&p.from<=i[a-1].toA;)l=i[a-1].fromA,f=i[a-1].fromB,a--,l<p.from&&(p=o.lineAt(l,_n.ByPosNoHeight,r,0,0));f+=p.from-l,l=p.from;let v=xT.build(r.setDoc(s),e,f,d);o=o.replace(l,c,v)}return o.updateHeight(r,0)}static empty(){return new Gi(0,0)}static of(e){if(e.length==1)return e[0];let n=0,r=e.length,i=0,o=0;for(;;)if(n==r)if(i>o*2){let a=e[n-1];a.break?e.splice(--n,1,a.left,null,a.right):e.splice(--n,1,a.left,a.right),r+=1+a.break,i-=a.size}else if(o>i*2){let a=e[r];a.break?e.splice(r,1,a.left,null,a.right):e.splice(r,1,a.left,a.right),r+=2+a.break,o-=a.size}else break;else if(i<o){let a=e[n++];a&&(i+=a.size)}else{let a=e[--r];a&&(o+=a.size)}let s=0;return e[n-1]==null?(s=1,n--):e[n]==null&&(s=1,r++),new Cye(fi.of(e.slice(0,n)),s,fi.of(e.slice(r)))}}fi.prototype.size=1;class iB extends fi{constructor(e,n,r){super(e,n),this.deco=r}blockAt(e,n,r,i){return new zs(i,this.length,r,this.height,this.deco||0)}lineAt(e,n,r,i,o){return this.blockAt(0,r,i,o)}forEachLine(e,n,r,i,o,s){e<=o+this.length&&n>=o&&s(this.blockAt(0,r,i,o))}updateHeight(e,n=0,r=!1,i){return i&&i.from<=n&&i.more&&this.setHeight(e,i.heights[i.index++]),this.outdated=!1,this}toString(){return`block(${this.length})`}}class Gi extends iB{constructor(e,n){super(e,n,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0}blockAt(e,n,r,i){return new zs(i,this.length,r,this.height,this.breaks)}replace(e,n,r){let i=r[0];return r.length==1&&(i instanceof Gi||i instanceof Nr&&i.flags&4)&&Math.abs(this.length-i.length)<10?(i instanceof Nr?i=new Gi(i.length,this.height):i.height=this.height,this.outdated||(i.outdated=!1),i):fi.of(r)}updateHeight(e,n=0,r=!1,i){return i&&i.from<=n&&i.more?this.setHeight(e,i.heights[i.index++]):(r||this.outdated)&&this.setHeight(e,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 Nr extends fi{constructor(e){super(e,0)}heightMetrics(e,n){let r=e.doc.lineAt(n).number,i=e.doc.lineAt(n+this.length).number,o=i-r+1,s,a=0;if(e.lineWrapping){let l=Math.min(this.height,e.lineHeight*o);s=l/o,this.length>o+1&&(a=(this.height-l)/(this.length-o-1))}else s=this.height/o;return{firstLine:r,lastLine:i,perLine:s,perChar:a}}blockAt(e,n,r,i){let{firstLine:o,lastLine:s,perLine:a,perChar:l}=this.heightMetrics(n,i);if(n.lineWrapping){let c=i+Math.round(Math.max(0,Math.min(1,(e-r)/this.height))*this.length),f=n.doc.lineAt(c),d=a+f.length*l,p=Math.max(r,e-d/2);return new zs(f.from,f.length,p,d,0)}else{let c=Math.max(0,Math.min(s-o,Math.floor((e-r)/a))),{from:f,length:d}=n.doc.line(o+c);return new zs(f,d,r+a*c,a,0)}}lineAt(e,n,r,i,o){if(n==_n.ByHeight)return this.blockAt(e,r,i,o);if(n==_n.ByPosNoHeight){let{from:m,to:v}=r.doc.lineAt(e);return new zs(m,v-m,0,0,0)}let{firstLine:s,perLine:a,perChar:l}=this.heightMetrics(r,o),c=r.doc.lineAt(e),f=a+c.length*l,d=c.number-s,p=i+a*d+l*(c.from-o-d);return new zs(c.from,c.length,Math.max(i,Math.min(p,i+this.height-f)),f,0)}forEachLine(e,n,r,i,o,s){e=Math.max(e,o),n=Math.min(n,o+this.length);let{firstLine:a,perLine:l,perChar:c}=this.heightMetrics(r,o);for(let f=e,d=i;f<=n;){let p=r.doc.lineAt(f);if(f==e){let v=p.number-a;d+=l*v+c*(e-o-v)}let m=l+c*p.length;s(new zs(p.from,p.length,d,m,0)),d+=m,f=p.to+1}}replace(e,n,r){let i=this.length-n;if(i>0){let o=r[r.length-1];o instanceof Nr?r[r.length-1]=new Nr(o.length+i):r.push(null,new Nr(i-1))}if(e>0){let o=r[0];o instanceof Nr?r[0]=new Nr(e+o.length):r.unshift(new Nr(e-1),null)}return fi.of(r)}decomposeLeft(e,n){n.push(new Nr(e-1),null)}decomposeRight(e,n){n.push(null,new Nr(this.length-e-1))}updateHeight(e,n=0,r=!1,i){let o=n+this.length;if(i&&i.from<=n+this.length&&i.more){let s=[],a=Math.max(n,i.from),l=-1;for(i.from>n&&s.push(new Nr(i.from-n-1).updateHeight(e,n));a<=o&&i.more;){let f=e.doc.lineAt(a).length;s.length&&s.push(null);let d=i.heights[i.index++];l==-1?l=d:Math.abs(d-l)>=Sy&&(l=-2);let p=new Gi(f,d);p.outdated=!1,s.push(p),a+=f+1}a<=o&&s.push(null,new Nr(o-a).updateHeight(e,a));let c=fi.of(s);return(l<0||Math.abs(c.height-this.height)>=Sy||Math.abs(l-this.heightMetrics(e,n).perLine)>=Sy)&&(e.heightChanged=!0),c}else(r||this.outdated)&&(this.setHeight(e,e.heightForGap(n,n+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class Cye extends fi{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,i){let o=r+this.left.height;return e<o?this.left.blockAt(e,n,r,i):this.right.blockAt(e,n,o,i+this.left.length+this.break)}lineAt(e,n,r,i,o){let s=i+this.left.height,a=o+this.left.length+this.break,l=n==_n.ByHeight?e<s:e<a,c=l?this.left.lineAt(e,n,r,i,o):this.right.lineAt(e,n,r,s,a);if(this.break||(l?c.to<a:c.from>a))return c;let f=n==_n.ByPosNoHeight?_n.ByPosNoHeight:_n.ByPos;return l?c.join(this.right.lineAt(a,f,r,s,a)):this.left.lineAt(a,f,r,i,o).join(c)}forEachLine(e,n,r,i,o,s){let a=i+this.left.height,l=o+this.left.length+this.break;if(this.break)e<l&&this.left.forEachLine(e,n,r,i,o,s),n>=l&&this.right.forEachLine(e,n,r,a,l,s);else{let c=this.lineAt(l,_n.ByPos,r,i,o);e<c.from&&this.left.forEachLine(e,c.from-1,r,i,o,s),c.to>=e&&c.from<=n&&s(c),n>c.to&&this.right.forEachLine(c.to+1,n,r,a,l,s)}}replace(e,n,r){let i=this.left.length+this.break;if(n<i)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-i,n-i,r));let o=[];e>0&&this.decomposeLeft(e,o);let s=o.length;for(let a of r)o.push(a);if(e>0&&tL(o,s-1),n<this.length){let a=o.length;this.decomposeRight(n,o),tL(o,a)}return fi.of(o)}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,i=r+this.break;if(e>=i)return this.right.decomposeRight(e-i,n);e<r&&this.left.decomposeRight(e,n),this.break&&e<i&&n.push(null),n.push(this.right)}balanced(e,n){return e.size>2*n.size||n.size>2*e.size?fi.of(this.break?[e,null,n]:[e,n]):(this.left=e,this.right=n,this.height=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,i){let{left:o,right:s}=this,a=n+o.length+this.break,l=null;return i&&i.from<=n+o.length&&i.more?l=o=o.updateHeight(e,n,r,i):o.updateHeight(e,n,r),i&&i.from<=a+s.length&&i.more?l=s=s.updateHeight(e,a,r,i):s.updateHeight(e,a,r),l?this.balanced(o,s):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function tL(t,e){let n,r;t[e]==null&&(n=t[e-1])instanceof Nr&&(r=t[e+1])instanceof Nr&&t.splice(e-1,3,new Nr(n.length+1+r.length))}const kye=5;class xT{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),i=this.nodes[this.nodes.length-1];i instanceof Gi?i.length+=r-this.pos:(r>this.pos||!this.isCovered)&&this.nodes.push(new Gi(r-this.pos,-1)),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 i=r.widget?r.widget.estimatedHeight:0,o=r.widget?r.widget.lineBreaks:0;i<0&&(i=this.oracle.lineHeight);let s=n-e;r.block?this.addBlock(new iB(s,i,r)):(s||o||i>=kye)&&this.addLineDeco(i,o,s)}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 Gi(this.pos-e,-1)),this.writtenTo=this.pos}blankContent(e,n){let r=new Nr(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 Gi)return e;let n=new Gi(0,-1);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 i=this.ensureLine();i.length+=r,i.collapsed+=r,i.widgetHeight=Math.max(i.widgetHeight,e),i.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 Gi)&&!this.isCovered?this.nodes.push(new Gi(0,-1)):(this.writtenTo<this.pos||n==null)&&this.nodes.push(this.blankContent(this.writtenTo,this.pos));let r=e;for(let i of this.nodes)i instanceof Gi&&i.updateHeight(this.oracle,r),r+=i?i.length:1;return this.nodes}static build(e,n,r,i){let o=new xT(r,e);return Gt.spans(n,r,i,o,0),o.finish(r)}}function Eye(t,e,n){let r=new _ye;return Gt.compare(t,e,n,r,0),r.changes}class _ye{constructor(){this.changes=[]}compareRange(){}comparePoint(e,n,r,i){(e<n||r&&r.heightRelevant||i&&i.heightRelevant)&&qk(e,n,this.changes,5)}}function Tye(t,e){let n=t.getBoundingClientRect(),r=t.ownerDocument,i=r.defaultView||window,o=Math.max(0,n.left),s=Math.min(i.innerWidth,n.right),a=Math.max(0,n.top),l=Math.min(i.innerHeight,n.bottom);for(let c=t.parentNode;c&&c!=r.body;)if(c.nodeType==1){let f=c,d=window.getComputedStyle(f);if((f.scrollHeight>f.clientHeight||f.scrollWidth>f.clientWidth)&&d.overflow!="visible"){let p=f.getBoundingClientRect();o=Math.max(o,p.left),s=Math.min(s,p.right),a=Math.max(a,p.top),l=c==t.parentNode?p.bottom:Math.min(l,p.bottom)}c=d.position=="absolute"||d.position=="fixed"?f.offsetParent:f.parentNode}else if(c.nodeType==11)c=c.host;else break;return{left:o-n.left,right:Math.max(o,s)-n.left,top:a-(n.top+e),bottom:Math.max(a,l)-(n.top+e)}}function Aye(t,e){let n=t.getBoundingClientRect();return{left:0,right:n.right-n.left,top:e,bottom:n.bottom-(n.top+e)}}class vS{constructor(e,n,r){this.from=e,this.to=n,this.size=r}static same(e,n){if(e.length!=n.length)return!1;for(let r=0;r<e.length;r++){let i=e[r],o=n[r];if(i.from!=o.from||i.to!=o.to||i.size!=o.size)return!1}return!0}draw(e,n){return dt.replace({widget:new Oye(this.size*(n?e.scaleY:e.scaleX),n)}).range(this.from,this.to)}}class Oye extends Ga{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 nL{constructor(e){this.state=e,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.scrollTop=0,this.scrolledToBottom=!0,this.scaleX=1,this.scaleY=1,this.scrollAnchorPos=0,this.scrollAnchorHeight=-1,this.scaler=rL,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=Rn.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let n=e.facet(bT).some(r=>typeof r!="function"&&r.class=="cm-lineWrapping");this.heightOracle=new xye(n),this.stateDeco=e.facet(dm).filter(r=>typeof r!="function"),this.heightMap=fi.empty().applyChanges(this.stateDeco,tn.empty,this.heightOracle.setDoc(e.doc),[new Lo(0,0,0,e.doc.length)]),this.viewport=this.getViewport(0,null),this.updateViewportLines(),this.updateForViewport(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=dt.set(this.lineGaps.map(r=>r.draw(this,!1))),this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:n}=this.state.selection;for(let r=0;r<=1;r++){let i=r?n.head:n.anchor;if(!e.some(({from:o,to:s})=>i>=o&&i<=s)){let{from:o,to:s}=this.lineBlockAt(i);e.push(new Ov(o,s))}}this.viewports=e.sort((r,i)=>r.from-i.from),this.scaler=this.heightMap.height<=7e6?rL:new Nye(this.heightOracle,this.heightMap,this.viewports)}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(this.scaler.scale==1?e:Hh(e,this.scaler))})}update(e,n=null){this.state=e.state;let r=this.stateDeco;this.stateDeco=this.state.facet(dm).filter(f=>typeof f!="function");let i=e.changedRanges,o=Lo.extendWithRanges(i,Eye(r,this.stateDeco,e?e.changes:pr.empty(this.state.doc.length))),s=this.heightMap.height,a=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),o),this.heightMap.height!=s&&(e.flags|=2),a?(this.scrollAnchorPos=e.changes.mapPos(a.from,-1),this.scrollAnchorHeight=a.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=this.heightMap.height);let l=o.length?this.mapViewport(this.viewport,e.changes):this.viewport;(n&&(n.range.head<l.from||n.range.head>l.to)||!this.viewportIsAppropriate(l))&&(l=this.getViewport(0,n));let c=!e.changes.empty||e.flags&2||l.from!=this.viewport.from||l.to!=this.viewport.to;this.viewport=l,this.updateForViewport(),c&&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(),n&&(this.scrollTarget=n),!this.mustEnforceCursorAssoc&&e.selectionSet&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(F8)&&(this.mustEnforceCursorAssoc=!0)}measure(e){let n=e.contentDOM,r=window.getComputedStyle(n),i=this.heightOracle,o=r.whiteSpace;this.defaultTextDirection=r.direction=="rtl"?Rn.RTL:Rn.LTR;let s=this.heightOracle.mustRefreshForWrapping(o),a=n.getBoundingClientRect(),l=s||this.mustMeasureContent||this.contentDOMHeight!=a.height;this.contentDOMHeight=a.height,this.mustMeasureContent=!1;let c=0,f=0;if(a.width&&a.height){let{scaleX:T,scaleY:A}=m8(n,a);(this.scaleX!=T||this.scaleY!=A)&&(this.scaleX=T,this.scaleY=A,c|=8,s=l=!0)}let d=(parseInt(r.paddingTop)||0)*this.scaleY,p=(parseInt(r.paddingBottom)||0)*this.scaleY;(this.paddingTop!=d||this.paddingBottom!=p)&&(this.paddingTop=d,this.paddingBottom=p,c|=10),this.editorWidth!=e.scrollDOM.clientWidth&&(i.lineWrapping&&(l=!0),this.editorWidth=e.scrollDOM.clientWidth,c|=8);let m=e.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=m&&(this.scrollAnchorHeight=-1,this.scrollTop=m),this.scrolledToBottom=y8(e.scrollDOM);let v=(this.printing?Aye:Tye)(n,this.paddingTop),b=v.top-this.pixelViewport.top,S=v.bottom-this.pixelViewport.bottom;this.pixelViewport=v;let x=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(x!=this.inView&&(this.inView=x,x&&(l=!0)),!this.inView&&!this.scrollTarget)return 0;let w=a.width;if((this.contentDOMWidth!=w||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=a.width,this.editorHeight=e.scrollDOM.clientHeight,c|=8),l){let T=e.docView.measureVisibleLineHeights(this.viewport);if(i.mustRefreshForHeights(T)&&(s=!0),s||i.lineWrapping&&Math.abs(w-this.contentDOMWidth)>i.charWidth){let{lineHeight:A,charWidth:_,textHeight:R}=e.docView.measureTextSize();s=A>0&&i.refresh(o,A,_,R,w/_,T),s&&(e.docView.minWidth=0,c|=8)}b>0&&S>0?f=Math.max(b,S):b<0&&S<0&&(f=Math.min(b,S)),i.heightChanged=!1;for(let A of this.viewports){let _=A.from==this.viewport.from?T:e.docView.measureVisibleLineHeights(A);this.heightMap=(s?fi.empty().applyChanges(this.stateDeco,tn.empty,this.heightOracle,[new Lo(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(i,0,s,new Sye(A.from,_))}i.heightChanged&&(c|=2)}let C=!this.viewportIsAppropriate(this.viewport,f)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return C&&(this.viewport=this.getViewport(f,this.scrollTarget)),this.updateForViewport(),(c&2||C)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(s?[]:this.lineGaps,e)),c|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),c}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)),i=this.heightMap,o=this.heightOracle,{visibleTop:s,visibleBottom:a}=this,l=new Ov(i.lineAt(s-r*1e3,_n.ByHeight,o,0,0).from,i.lineAt(a+(1-r)*1e3,_n.ByHeight,o,0,0).to);if(n){let{head:c}=n.range;if(c<l.from||c>l.to){let f=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),d=i.lineAt(c,_n.ByPos,o,0,0),p;n.y=="center"?p=(d.top+d.bottom)/2-f/2:n.y=="start"||n.y=="nearest"&&c<l.from?p=d.top:p=d.bottom-f,l=new Ov(i.lineAt(p-1e3/2,_n.ByHeight,o,0,0).from,i.lineAt(p+f+1e3/2,_n.ByHeight,o,0,0).to)}}return l}mapViewport(e,n){let r=n.mapPos(e.from,-1),i=n.mapPos(e.to,1);return new Ov(this.heightMap.lineAt(r,_n.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(i,_n.ByPos,this.heightOracle,0,0).to)}viewportIsAppropriate({from:e,to:n},r=0){if(!this.inView)return!0;let{top:i}=this.heightMap.lineAt(e,_n.ByPos,this.heightOracle,0,0),{bottom:o}=this.heightMap.lineAt(n,_n.ByPos,this.heightOracle,0,0),{visibleTop:s,visibleBottom:a}=this;return(e==0||i<=s-Math.max(10,Math.min(-r,250)))&&(n==this.state.doc.length||o>=a+Math.max(10,Math.min(r,250)))&&i>s-2*1e3&&o<a+2*1e3}mapLineGaps(e,n){if(!e.length||n.empty)return e;let r=[];for(let i of e)n.touchesRange(i.from,i.to)||r.push(new vS(n.mapPos(i.from),n.mapPos(i.to),i.size));return r}ensureLineGaps(e,n){let r=this.heightOracle.lineWrapping,i=r?1e4:2e3,o=i>>1,s=i<<1;if(this.defaultTextDirection!=Rn.LTR&&!r)return[];let a=[],l=(c,f,d,p)=>{if(f-c<o)return;let m=this.state.selection.main,v=[m.from];m.empty||v.push(m.to);for(let S of v)if(S>c&&S<f){l(c,S-10,d,p),l(S+10,f,d,p);return}let b=Pye(e,S=>S.from>=d.from&&S.to<=d.to&&Math.abs(S.from-c)<o&&Math.abs(S.to-f)<o&&!v.some(x=>S.from<x&&S.to>x));if(!b){if(f<d.to&&n&&r&&n.visibleRanges.some(S=>S.from<=f&&S.to>=f)){let S=n.moveToLineBoundary(be.cursor(f),!1,!0).head;S>c&&(f=S)}b=new vS(c,f,this.gapSize(d,c,f,p))}a.push(b)};for(let c of this.viewportLines){if(c.length<s)continue;let f=Rye(c.from,c.to,this.stateDeco);if(f.total<s)continue;let d=this.scrollTarget?this.scrollTarget.range.head:null,p,m;if(r){let v=i/this.heightOracle.lineLength*this.heightOracle.lineHeight,b,S;if(d!=null){let x=Pv(f,d),w=((this.visibleBottom-this.visibleTop)/2+v)/c.height;b=x-w,S=x+w}else b=(this.visibleTop-c.top-v)/c.height,S=(this.visibleBottom-c.top+v)/c.height;p=Rv(f,b),m=Rv(f,S)}else{let v=f.total*this.heightOracle.charWidth,b=i*this.heightOracle.charWidth,S,x;if(d!=null){let w=Pv(f,d),C=((this.pixelViewport.right-this.pixelViewport.left)/2+b)/v;S=w-C,x=w+C}else S=(this.pixelViewport.left-b)/v,x=(this.pixelViewport.right+b)/v;p=Rv(f,S),m=Rv(f,x)}p>c.from&&l(c.from,p,c,f),m<c.to&&l(m,c.to,c,f)}return a}gapSize(e,n,r,i){let o=Pv(i,r)-Pv(i,n);return this.heightOracle.lineWrapping?e.height*o:i.total*this.heightOracle.charWidth*o}updateLineGaps(e){vS.same(e,this.lineGaps)||(this.lineGaps=e,this.lineGapDeco=dt.set(e.map(n=>n.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(){let e=this.stateDeco;this.lineGaps.length&&(e=e.concat(this.lineGapDeco));let n=[];Gt.spans(e,this.viewport.from,this.viewport.to,{span(i,o){n.push({from:i,to:o})},point(){}},20);let r=n.length!=this.visibleRanges.length||this.visibleRanges.some((i,o)=>i.from!=n[o].from||i.to!=n[o].to);return this.visibleRanges=n,r?4:0}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(n=>n.from<=e&&n.to>=e)||Hh(this.heightMap.lineAt(e,_n.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return Hh(this.heightMap.lineAt(this.scaler.fromDOM(e),_n.ByHeight,this.heightOracle,0,0),this.scaler)}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 Hh(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 Ov{constructor(e,n){this.from=e,this.to=n}}function Rye(t,e,n){let r=[],i=t,o=0;return Gt.spans(n,t,e,{span(){},point(s,a){s>i&&(r.push({from:i,to:s}),o+=s-i),i=a}},20),i<e&&(r.push({from:i,to:e}),o+=e-i),{total:o,ranges:r}}function Rv({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 i=0;;i++){let{from:o,to:s}=e[i],a=s-o;if(r<=a)return o+r;r-=a}}function Pv(t,e){let n=0;for(let{from:r,to:i}of t.ranges){if(e<=i){n+=e-r;break}n+=i-r}return n/t.total}function Pye(t,e){for(let n of t)if(e(n))return n}const rL={toDOM(t){return t},fromDOM(t){return t},scale:1};class Nye{constructor(e,n,r){let i=0,o=0,s=0;this.viewports=r.map(({from:a,to:l})=>{let c=n.lineAt(a,_n.ByPos,e,0,0).top,f=n.lineAt(l,_n.ByPos,e,0,0).bottom;return i+=f-c,{from:a,to:l,top:c,bottom:f,domTop:0,domBottom:0}}),this.scale=(7e6-i)/(n.height-i);for(let a of this.viewports)a.domTop=s+(a.top-o)*this.scale,s=a.domBottom=a.domTop+(a.bottom-a.top),o=a.bottom}toDOM(e){for(let n=0,r=0,i=0;;n++){let o=n<this.viewports.length?this.viewports[n]:null;if(!o||e<o.top)return i+(e-r)*this.scale;if(e<=o.bottom)return o.domTop+(e-o.top);r=o.bottom,i=o.domBottom}}fromDOM(e){for(let n=0,r=0,i=0;;n++){let o=n<this.viewports.length?this.viewports[n]:null;if(!o||e<o.domTop)return r+(e-i)/this.scale;if(e<=o.domBottom)return o.top+(e-o.domTop);r=o.bottom,i=o.domBottom}}}function Hh(t,e){if(e.scale==1)return t;let n=e.toDOM(t.top),r=e.toDOM(t.bottom);return new zs(t.from,t.length,n,r-n,Array.isArray(t._content)?t._content.map(i=>Hh(i,e)):t._content)}const Nv=Je.define({combine:t=>t.join(" ")}),eE=Je.define({combine:t=>t.indexOf(!0)>-1}),tE=Jl.newName(),oB=Jl.newName(),sB=Jl.newName(),aB={"&light":"."+oB,"&dark":"."+sB};function nE(t,e,n){return new Jl(e,{finish(r){return/&/.test(r)?r.replace(/&\w*/,i=>{if(i=="&")return t;if(!n||!n[i])throw new RangeError(`Unsupported selector: ${i}`);return n[i]}):t+" "+r}})}const Mye=nE("."+tE,{"&":{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},".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":{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:"#444"},".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",insetInlineStart:0,zIndex:200},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",borderRight:"1px solid #ddd"},"&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},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".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"},".cm-highlightSpace:before":{content:"attr(data-display)",position:"absolute",pointerEvents:"none",color:"#888"},".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"}},aB),qh="￿";class Dye{constructor(e,n){this.points=e,this.text="",this.lineSeparator=n.facet(Ht.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=qh}readRange(e,n){if(!e)return this;let r=e.parentNode;for(let i=e;;){this.findPointBefore(r,i);let o=this.text.length;this.readNode(i);let s=i.nextSibling;if(s==n)break;let a=An.get(i),l=An.get(s);(a&&l?a.breakAfter:(a?a.breakAfter:iL(i))||iL(s)&&(i.nodeName!="BR"||i.cmIgnore)&&this.text.length>o)&&this.lineBreak(),i=s}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,i=this.lineSeparator?null:/\r\n?|\n/g;;){let o=-1,s=1,a;if(this.lineSeparator?(o=n.indexOf(this.lineSeparator,r),s=this.lineSeparator.length):(a=i.exec(n))&&(o=a.index,s=a[0].length),this.append(n.slice(r,o<0?n.length:o)),o<0)break;if(this.lineBreak(),s>1)for(let l of this.points)l.node==e&&l.pos>this.text.length&&(l.pos-=s-1);r=o+s}}readNode(e){if(e.cmIgnore)return;let n=An.get(e),r=n&&n.overrideDOMText;if(r!=null){this.findPointInside(e,r.length);for(let i=r.iter();!i.next().done;)i.lineBreak?this.lineBreak():this.append(i.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+(Lye(e,r.node,r.offset)?n:0))}}function Lye(t,e,n){for(;;){if(!e||n<za(e))return!1;if(e==t)return!0;n=fm(e)+1,e=e.parentNode}}function iL(t){return t.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(t.nodeName)}class oL{constructor(e,n){this.node=e,this.offset=n,this.pos=-1}}class $ye{constructor(e,n,r,i){this.typeOver=i,this.bounds=null,this.text="";let{impreciseHead:o,impreciseAnchor:s}=e.docView;if(e.state.readOnly&&n>-1)this.newSel=null;else if(n>-1&&(this.bounds=e.docView.domBoundsAround(n,r,0))){let a=o||s?[]:Bye(e),l=new Dye(a,e.state);l.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=l.text,this.newSel=Fye(a,this.bounds.from)}else{let a=e.observer.selectionRange,l=o&&o.node==a.focusNode&&o.offset==a.focusOffset||!Fk(e.contentDOM,a.focusNode)?e.state.selection.main.head:e.docView.posFromDOM(a.focusNode,a.focusOffset),c=s&&s.node==a.anchorNode&&s.offset==a.anchorOffset||!Fk(e.contentDOM,a.anchorNode)?e.state.selection.main.anchor:e.docView.posFromDOM(a.anchorNode,a.anchorOffset),f=e.viewport;if((tt.ios||tt.chrome)&&e.state.selection.main.empty&&l!=c&&(f.from>0||f.to<e.state.doc.length)){let d=Math.min(l,c),p=Math.max(l,c),m=f.from-d,v=f.to-p;(m==0||m==1||d==0)&&(v==0||v==-1||p==e.state.doc.length)&&(l=0,c=e.state.doc.length)}this.newSel=be.single(c,l)}}}function lB(t,e){let n,{newSel:r}=e,i=t.state.selection.main,o=t.inputState.lastKeyTime>Date.now()-100?t.inputState.lastKeyCode:-1;if(e.bounds){let{from:s,to:a}=e.bounds,l=i.from,c=null;(o===8||tt.android&&e.text.length<a-s)&&(l=i.to,c="end");let f=jye(t.state.doc.sliceString(s,a,qh),e.text,l-s,c);f&&(tt.chrome&&o==13&&f.toB==f.from+2&&e.text.slice(f.from,f.toB)==qh+qh&&f.toB--,n={from:s+f.from,to:s+f.toA,insert:tn.of(e.text.slice(f.from,f.toB).split(qh))})}else r&&(!t.hasFocus&&t.state.facet(S1)||r.main.eq(i))&&(r=null);if(!n&&!r)return!1;if(!n&&e.typeOver&&!i.empty&&r&&r.main.empty?n={from:i.from,to:i.to,insert:t.state.doc.slice(i.from,i.to)}:n&&n.from>=i.from&&n.to<=i.to&&(n.from!=i.from||n.to!=i.to)&&i.to-i.from-(n.to-n.from)<=4?n={from:i.from,to:i.to,insert:t.state.doc.slice(i.from,n.from).append(n.insert).append(t.state.doc.slice(n.to,i.to))}:(tt.mac||tt.android)&&n&&n.from==n.to&&n.from==i.head-1&&/^\. ?$/.test(n.insert.toString())&&t.contentDOM.getAttribute("autocorrect")=="off"?(r&&n.insert.length==2&&(r=be.single(r.main.anchor-1,r.main.head-1)),n={from:i.from,to:i.to,insert:tn.of([" "])}):tt.chrome&&n&&n.from==n.to&&n.from==i.head&&n.insert.toString()==`
217
+ `&&t.lineWrapping&&(r&&(r=be.single(r.main.anchor-1,r.main.head-1)),n={from:i.from,to:i.to,insert:tn.of([" "])}),n){if(tt.ios&&t.inputState.flushIOSKey()||tt.android&&(n.from==i.from&&n.to==i.to&&n.insert.length==1&&n.insert.lines==2&&qf(t.contentDOM,"Enter",13)||(n.from==i.from-1&&n.to==i.to&&n.insert.length==0||o==8&&n.insert.length<n.to-n.from&&n.to>i.head)&&qf(t.contentDOM,"Backspace",8)||n.from==i.from&&n.to==i.to+1&&n.insert.length==0&&qf(t.contentDOM,"Delete",46)))return!0;let s=n.insert.toString();t.inputState.composing>=0&&t.inputState.composing++;let a,l=()=>a||(a=Iye(t,n,r));return t.state.facet(I8).some(c=>c(t,n.from,n.to,s,l))||t.dispatch(l()),!0}else if(r&&!r.main.eq(i)){let s=!1,a="select";return t.inputState.lastSelectionTime>Date.now()-50&&(t.inputState.lastSelectionOrigin=="select"&&(s=!0),a=t.inputState.lastSelectionOrigin),t.dispatch({selection:r,scrollIntoView:s,userEvent:a}),!0}else return!1}function Iye(t,e,n){let r,i=t.state,o=i.selection.main;if(e.from>=o.from&&e.to<=o.to&&e.to-e.from>=(o.to-o.from)/3&&(!n||n.main.empty&&n.main.from==e.from+e.insert.length)&&t.inputState.composing<0){let a=o.from<e.from?i.sliceDoc(o.from,e.from):"",l=o.to>e.to?i.sliceDoc(e.to,o.to):"";r=i.replaceSelection(t.state.toText(a+e.insert.sliceString(0,void 0,t.state.lineBreak)+l))}else{let a=i.changes(e),l=n&&n.main.to<=a.newLength?n.main:void 0;if(i.selection.ranges.length>1&&t.inputState.composing>=0&&e.to<=o.to&&e.to>=o.to-10){let c=t.state.sliceDoc(e.from,e.to),f,d=n&&q8(t,n.main.head);if(d){let v=e.insert.length-(e.to-e.from);f={from:d.from,to:d.to-v}}else f=t.state.doc.lineAt(o.head);let p=o.to-e.to,m=o.to-o.from;r=i.changeByRange(v=>{if(v.from==o.from&&v.to==o.to)return{changes:a,range:l||v.map(a)};let b=v.to-p,S=b-c.length;if(v.to-v.from!=m||t.state.sliceDoc(S,b)!=c||v.to>=f.from&&v.from<=f.to)return{range:v};let x=i.changes({from:S,to:b,insert:e.insert}),w=v.to-o.to;return{changes:x,range:l?be.range(Math.max(0,l.anchor+w),Math.max(0,l.head+w)):v.map(x)}})}else r={changes:a,selection:l&&i.selection.replaceRange(l)}}let s="input.type";return(t.composing||t.inputState.compositionPendingChange&&t.inputState.compositionEndedAt>Date.now()-50)&&(t.inputState.compositionPendingChange=!1,s+=".compose",t.inputState.compositionFirstChange&&(s+=".start",t.inputState.compositionFirstChange=!1)),i.update(r,{userEvent:s,scrollIntoView:!0})}function jye(t,e,n,r){let i=Math.min(t.length,e.length),o=0;for(;o<i&&t.charCodeAt(o)==e.charCodeAt(o);)o++;if(o==i&&t.length==e.length)return null;let s=t.length,a=e.length;for(;s>0&&a>0&&t.charCodeAt(s-1)==e.charCodeAt(a-1);)s--,a--;if(r=="end"){let l=Math.max(0,o-Math.min(s,a));n-=s+l-o}if(s<o&&t.length<e.length){let l=n<=o&&n>=s?o-n:0;o-=l,a=o+(a-s),s=o}else if(a<o){let l=n<=o&&n>=a?o-n:0;o-=l,s=o+(s-a),a=o}return{from:o,toA:s,toB:a}}function Bye(t){let e=[];if(t.root.activeElement!=t.contentDOM)return e;let{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:o}=t.observer.selectionRange;return n&&(e.push(new oL(n,r)),(i!=n||o!=r)&&e.push(new oL(i,o))),e}function Fye(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?be.single(n+e,r+e):null}const zye={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},yS=tt.ie&&tt.ie_version<=11;class Vye{constructor(e){this.view=e,this.active=!1,this.selectionRange=new Eve,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.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(n=>{for(let r of n)this.queue.push(r);(tt.ie&&tt.ie_version<=11||tt.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()}),yS&&(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),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.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(){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,i=this.selectionRange;if(r.state.facet(S1)?r.root.activeElement!=this.dom:!wy(r.dom,i))return;let o=i.anchorNode&&r.docView.nearest(i.anchorNode);if(o&&o.ignoreEvent(e)){n||(this.selectionChanged=!1);return}(tt.ie&&tt.ie_version<=11||tt.android&&tt.chrome)&&!r.state.selection.main.empty&&i.focusNode&&mp(i.focusNode,i.focusOffset,i.anchorNode,i.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,n=tt.safari&&e.root.nodeType==11&&xve(this.dom.ownerDocument)==this.dom&&Uye(this.view)||Y0(e.root);if(!n||this.selectionRange.eq(n))return!1;let r=wy(this.dom,n);return r&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime<Date.now()-300&&Tve(this.dom,n)?(this.view.inputState.lastFocusTime=0,e.docView.updateSelection(),!1):(this.selectionRange.setRange(n),r&&(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,zye),yS&&this.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.active=!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),yS&&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 i=()=>{let o=this.delayedAndroidKey;o&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=o.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&o.force&&qf(this.dom,o.key,o.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(i)}(!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,i=!1;for(let o of e){let s=this.readMutation(o);s&&(s.typeOver&&(i=!0),n==-1?{from:n,to:r}=s:(n=Math.min(s.from,n),r=Math.max(s.to,r)))}return{from:n,to:r,typeOver:i}}readChange(){let{from:e,to:n,typeOver:r}=this.processRecords(),i=this.selectionChanged&&wy(this.dom,this.selectionRange);if(e<0&&!i)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let o=new $ye(this.view,e,n,r);return this.view.docView.domChanged={newSel:o.newSel?o.newSel.main:null},o}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,i=lB(this.view,n);return this.view.state==r&&this.view.update([]),i}readMutation(e){let n=this.view.docView.nearest(e.target);if(!n||n.ignoreMutation(e))return null;if(n.markDirty(e.type=="attributes"),e.type=="attributes"&&(n.flags|=4),e.type=="childList"){let r=sL(n,e.previousSibling||e.target.previousSibling,-1),i=sL(n,e.nextSibling||e.target.nextSibling,1);return{from:r?n.posAfter(r):n.posAtStart,to:i?n.posBefore(i):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),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),e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}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 i of this.scrollTargets)i.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey)}}function sL(t,e,n){for(;e;){let r=An.get(e);if(r&&r.parent==t)return r;let i=e.parentNode;e=i!=t.dom?i:n>0?e.nextSibling:e.previousSibling}return null}function Uye(t){let e=null;function n(l){l.preventDefault(),l.stopImmediatePropagation(),e=l.getTargetRanges()[0]}if(t.contentDOM.addEventListener("beforeinput",n,!0),t.dom.ownerDocument.execCommand("indent"),t.contentDOM.removeEventListener("beforeinput",n,!0),!e)return null;let r=e.startContainer,i=e.startOffset,o=e.endContainer,s=e.endOffset,a=t.docView.domAtPos(t.state.selection.main.anchor);return mp(a.node,a.offset,o,s)&&([r,i,o,s]=[o,s,r,i]),{anchorNode:r,anchorOffset:i,focusNode:o,focusOffset:s}}class Ge{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.composing>0}get compositionStarted(){return this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){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:n}=e;this.dispatchTransactions=e.dispatchTransactions||n&&(r=>r.forEach(i=>n(i,this)))||(r=>this.update(r)),this.dispatch=this.dispatch.bind(this),this._root=e.root||_ve(e.parent)||document,this.viewState=new nL(e.state||Ht.create(e)),e.scrollTo&&e.scrollTo.is(_v)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(Uh).map(r=>new pS(r));for(let r of this.plugins)r.update(this);this.observer=new Vye(this),this.inputState=new iye(this),this.inputState.ensureHandlers(this.plugins),this.docView=new jD(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure()}dispatch(...e){let n=e.length==1&&e[0]instanceof gr?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,i,o=this.state;for(let p of e){if(p.startState!=o)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");o=p.state}if(this.destroyed){this.viewState.state=o;return}let s=this.hasFocus,a=0,l=null;e.some(p=>p.annotation(tB))?(this.inputState.notifiedFocused=s,a=1):s!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=s,l=nB(o,s),l||(a=1));let c=this.observer.delayedAndroidKey,f=null;if(c?(this.observer.clearDelayedAndroidKey(),f=this.observer.readChange(),(f&&!this.state.doc.eq(o.doc)||!this.state.selection.eq(o.selection))&&(f=null)):this.observer.clear(),o.facet(Ht.phrases)!=this.state.facet(Ht.phrases))return this.setState(o);i=X0.create(this,o,e),i.flags|=a;let d=this.viewState.scrollTarget;try{this.updateState=2;for(let p of e){if(d&&(d=d.map(p.changes)),p.scrollIntoView){let{main:m}=p.state.selection;d=new Kf(m.empty?m:be.cursor(m.head,m.head>m.anchor?-1:1))}for(let m of p.effects)m.is(_v)&&(d=m.value.clip(this.state))}this.viewState.update(i,d),this.bidiCache=Z0.update(this.bidiCache,i.changes),i.empty||(this.updatePlugins(i),this.inputState.update(i)),n=this.docView.update(i),this.state.facet(Wh)!=this.styleModules&&this.mountStyles(),r=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(n,e.some(p=>p.isUserEvent("select.pointer")))}finally{this.updateState=0}if(i.startState.facet(Nv)!=i.state.facet(Nv)&&(this.viewState.mustMeasureContent=!0),(n||r||d||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),!i.empty)for(let p of this.state.facet(Xk))try{p(i)}catch(m){Do(this.state,m,"update listener")}(l||f)&&Promise.resolve().then(()=>{l&&this.state==l.startState&&this.dispatch(l),f&&!lB(this,f)&&c.force&&qf(this.contentDOM,c.key,c.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 nL(e),this.plugins=e.facet(Uh).map(r=>new pS(r)),this.pluginMap.clear();for(let r of this.plugins)r.update(this);this.docView.destroy(),this.docView=new jD(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(Uh),r=e.state.facet(Uh);if(n!=r){let i=[];for(let o of r){let s=n.indexOf(o);if(s<0)i.push(new pS(o));else{let a=this.plugins[s];a.mustUpdate=e,i.push(a)}}for(let o of this.plugins)o.mustUpdate!=e&&o.destroy(this);this.plugins=i,this.pluginMap.clear()}else for(let i of this.plugins)i.mustUpdate=e;for(let i=0;i<this.plugins.length;i++)this.plugins[i].update(this);n!=r&&this.inputState.ensureHandlers(this.plugins)}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.scrollDOM,i=r.scrollTop*this.scaleY,{scrollAnchorPos:o,scrollAnchorHeight:s}=this.viewState;Math.abs(i-this.viewState.scrollTop)>1&&(s=-1),this.viewState.scrollAnchorHeight=-1;try{for(let a=0;;a++){if(s<0)if(y8(r))o=-1,s=this.viewState.heightMap.height;else{let m=this.viewState.scrollAnchorAt(i);o=m.from,s=m.top}this.updateState=1;let l=this.viewState.measure(this);if(!l&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(a>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let c=[];l&4||([this.measureRequests,c]=[c,this.measureRequests]);let f=c.map(m=>{try{return m.read(this)}catch(v){return Do(this.state,v),aL}}),d=X0.create(this,this.state,[]),p=!1;d.flags|=l,n?n.flags|=l:n=d,this.updateState=2,d.empty||(this.updatePlugins(d),this.inputState.update(d),this.updateAttrs(),p=this.docView.update(d));for(let m=0;m<c.length;m++)if(f[m]!=aL)try{let v=c[m];v.write&&v.write(f[m],this)}catch(v){Do(this.state,v)}if(p&&this.docView.updateSelection(!0),!d.viewportChanged&&this.measureRequests.length==0){if(this.viewState.editorHeight)if(this.viewState.scrollTarget){this.docView.scrollIntoView(this.viewState.scrollTarget),this.viewState.scrollTarget=null,s=-1;continue}else{let v=(o<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(o).top)-s;if(v>1||v<-1){i=i+v,r.scrollTop=i/this.scaleY,s=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(n&&!n.empty)for(let a of this.state.facet(Xk))a(n)}get themeClasses(){return tE+" "+(this.state.facet(eE)?sB:oB)+" "+this.state.facet(Nv)}updateAttrs(){let e=lL(this,z8,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),n={spellcheck:"false",autocorrect:"off",autocapitalize:"off",translate:"no",contenteditable:this.state.facet(S1)?"true":"false",class:"cm-content",style:`${tt.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(n["aria-readonly"]="true"),lL(this,bT,n);let r=this.observer.ignore(()=>{let i=Hk(this.contentDOM,this.contentAttrs,n),o=Hk(this.dom,this.editorAttrs,e);return i||o});return this.editorAttrs=e,this.contentAttrs=n,r}showAnnouncements(e){let n=!0;for(let r of e)for(let i of r.effects)if(i.is(Ge.announce)){n&&(this.announceDOM.textContent=""),n=!1;let o=this.announceDOM.appendChild(document.createElement("div"));o.textContent=i.value}}mountStyles(){this.styleModules=this.state.facet(Wh);let e=this.state.facet(Ge.cspNonce);Jl.mount(this.root,this.styleModules.concat(Mye).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.spec!=e)&&this.pluginMap.set(e,n=this.plugins.find(r=>r.spec==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 gS(this,e,WD(this,e,n,r))}moveByGroup(e,n){return gS(this,e,WD(this,e,n,r=>nye(this,e.head,r)))}visualLineSide(e,n){let r=this.bidiSpans(e),i=this.textDirectionAt(e.from),o=r[n?r.length-1:0];return be.cursor(o.side(n,i)+e.from,o.forward(!n,i)?1:-1)}moveToLineBoundary(e,n,r=!0){return tye(this,e,n,r)}moveVertically(e,n,r){return gS(this,e,rye(this,e,n,r))}domAtPos(e){return this.docView.domAtPos(e)}posAtDOM(e,n=0){return this.docView.posFromDOM(e,n)}posAtCoords(e,n=!0){return this.readMeasured(),G8(this,e,n)}coordsAtPos(e,n=1){this.readMeasured();let r=this.docView.coordsAt(e,n);if(!r||r.left==r.right)return r;let i=this.state.doc.lineAt(e),o=this.bidiSpans(i),s=o[Ol.find(o,e-i.from,-1,n)];return w1(r,s.dir==Rn.LTR==n>0)}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(B8)||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>Wye)return P8(e.length);let n=this.textDirectionAt(e.from),r;for(let o of this.bidiCache)if(o.from==e.from&&o.dir==n&&(o.fresh||R8(o.isolates,r=ID(this,e))))return o.order;r||(r=ID(this,e));let i=Bve(e.text,n,r);return this.bidiCache.push(new Z0(e.from,e.to,n,r,!0,i)),i}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||tt.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{g8(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(){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={}){return _v.of(new Kf(typeof e=="number"?be.cursor(e):e,n.y,n.x,n.yMargin,n.xMargin))}scrollSnapshot(){let{scrollTop:e,scrollLeft:n}=this.scrollDOM,r=this.viewState.scrollAnchorAt(e);return _v.of(new Kf(be.cursor(r.from),"start","start",r.top-e,n,!0))}static domEventHandlers(e){return tr.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return tr.define(()=>({}),{eventObservers:e})}static theme(e,n){let r=Jl.newName(),i=[Nv.of(r),Wh.of(nE(`.${r}`,e))];return n&&n.dark&&i.push(eE.of(!0)),i}static baseTheme(e){return Fd.lowest(Wh.of(nE("."+tE,e,aB)))}static findFromDOM(e){var n;let r=e.querySelector(".cm-content"),i=r&&An.get(r)||An.get(e);return((n=i==null?void 0:i.rootView)===null||n===void 0?void 0:n.view)||null}}Ge.styleModule=Wh;Ge.inputHandler=I8;Ge.focusChangeEffect=j8;Ge.perLineTextDirection=B8;Ge.exceptionSink=$8;Ge.updateListener=Xk;Ge.editable=S1;Ge.mouseSelectionStyle=L8;Ge.dragMovesSelection=D8;Ge.clickAddsSelectionRange=M8;Ge.decorations=dm;Ge.outerDecorations=V8;Ge.atomicRanges=wT;Ge.bidiIsolatedRanges=U8;Ge.scrollMargins=W8;Ge.darkTheme=eE;Ge.cspNonce=Je.define({combine:t=>t.length?t[0]:""});Ge.contentAttributes=bT;Ge.editorAttributes=z8;Ge.lineWrapping=Ge.contentAttributes.of({class:"cm-lineWrapping"});Ge.announce=Ot.define();const Wye=4096,aL={};class Z0{constructor(e,n,r,i,o,s){this.from=e,this.to=n,this.dir=r,this.isolates=i,this.fresh=o,this.order=s}static update(e,n){if(n.empty&&!e.some(o=>o.fresh))return e;let r=[],i=e.length?e[e.length-1].dir:Rn.LTR;for(let o=Math.max(0,e.length-10);o<e.length;o++){let s=e[o];s.dir==i&&!n.touchesRange(s.from,s.to)&&r.push(new Z0(n.mapPos(s.from,1),n.mapPos(s.to,-1),s.dir,s.isolates,!1,s.order))}return r}}function lL(t,e,n){for(let r=t.state.facet(e),i=r.length-1;i>=0;i--){let o=r[i],s=typeof o=="function"?o(t):o;s&&Wk(s,n)}return n}const Hye=tt.mac?"mac":tt.windows?"win":tt.linux?"linux":"key";function qye(t,e){const n=t.split(/-(?!$)/);let r=n[n.length-1];r=="Space"&&(r=" ");let i,o,s,a;for(let l=0;l<n.length-1;++l){const c=n[l];if(/^(cmd|meta|m)$/i.test(c))a=!0;else if(/^a(lt)?$/i.test(c))i=!0;else if(/^(c|ctrl|control)$/i.test(c))o=!0;else if(/^s(hift)?$/i.test(c))s=!0;else if(/^mod$/i.test(c))e=="mac"?a=!0:o=!0;else throw new Error("Unrecognized modifier name: "+c)}return i&&(r="Alt-"+r),o&&(r="Ctrl-"+r),a&&(r="Meta-"+r),s&&(r="Shift-"+r),r}function Mv(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 Kye=Fd.default(Ge.domEventHandlers({keydown(t,e){return uB(cB(e.state),t,e,"editor")}})),C1=Je.define({enables:Kye}),cL=new WeakMap;function cB(t){let e=t.facet(C1),n=cL.get(e);return n||cL.set(e,n=Xye(e.reduce((r,i)=>r.concat(i),[]))),n}function Gye(t,e,n){return uB(cB(t.state),e,t,n)}let Sl=null;const Yye=4e3;function Xye(t,e=Hye){let n=Object.create(null),r=Object.create(null),i=(s,a)=>{let l=r[s];if(l==null)r[s]=a;else if(l!=a)throw new Error("Key binding "+s+" is used both as a regular binding and as a multi-stroke prefix")},o=(s,a,l,c,f)=>{var d,p;let m=n[s]||(n[s]=Object.create(null)),v=a.split(/ (?!$)/).map(x=>qye(x,e));for(let x=1;x<v.length;x++){let w=v.slice(0,x).join(" ");i(w,!0),m[w]||(m[w]={preventDefault:!0,stopPropagation:!1,run:[C=>{let T=Sl={view:C,prefix:w,scope:s};return setTimeout(()=>{Sl==T&&(Sl=null)},Yye),!0}]})}let b=v.join(" ");i(b,!1);let S=m[b]||(m[b]={preventDefault:!1,stopPropagation:!1,run:((p=(d=m._any)===null||d===void 0?void 0:d.run)===null||p===void 0?void 0:p.slice())||[]});l&&S.run.push(l),c&&(S.preventDefault=!0),f&&(S.stopPropagation=!0)};for(let s of t){let a=s.scope?s.scope.split(" "):["editor"];if(s.any)for(let c of a){let f=n[c]||(n[c]=Object.create(null));f._any||(f._any={preventDefault:!1,stopPropagation:!1,run:[]});for(let d in f)f[d].run.push(s.any)}let l=s[e]||s.key;if(l)for(let c of a)o(c,l,s.run,s.preventDefault,s.stopPropagation),s.shift&&o(c,"Shift-"+l,s.shift,s.preventDefault,s.stopPropagation)}return n}function uB(t,e,n,r){let i=wve(e),o=Mr(i,0),s=Oo(o)==i.length&&i!=" ",a="",l=!1,c=!1,f=!1;Sl&&Sl.view==n&&Sl.scope==r&&(a=Sl.prefix+" ",X8.indexOf(e.keyCode)<0&&(c=!0,Sl=null));let d=new Set,p=S=>{if(S){for(let x of S.run)if(!d.has(x)&&(d.add(x),x(n,e)))return S.stopPropagation&&(f=!0),!0;S.preventDefault&&(S.stopPropagation&&(f=!0),c=!0)}return!1},m=t[r],v,b;return m&&(p(m[a+Mv(i,e,!s)])?l=!0:s&&(e.altKey||e.metaKey||e.ctrlKey)&&!(tt.windows&&e.ctrlKey&&e.altKey)&&(v=ec[e.keyCode])&&v!=i?(p(m[a+Mv(v,e,!0)])||e.shiftKey&&(b=um[e.keyCode])!=i&&b!=v&&p(m[a+Mv(b,e,!1)]))&&(l=!0):s&&e.shiftKey&&p(m[a+Mv(i,e,!0)])&&(l=!0),!l&&p(m._any)&&(l=!0)),c&&(l=!0),l&&f&&e.stopPropagation(),l}class Wm{constructor(e,n,r,i,o){this.className=e,this.left=n,this.top=r,this.width=i,this.height=o}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 i=e.coordsAtPos(r.head,r.assoc||1);if(!i)return[];let o=fB(e);return[new Wm(n,i.left-o.left,i.top-o.top,null,i.bottom-i.top)]}else return Zye(e,n,r)}}function fB(t){let e=t.scrollDOM.getBoundingClientRect();return{left:(t.textDirection==Rn.LTR?e.left:e.right-t.scrollDOM.clientWidth*t.scaleX)-t.scrollDOM.scrollLeft*t.scaleX,top:e.top-t.scrollDOM.scrollTop*t.scaleY}}function uL(t,e,n){let r=be.cursor(e);return{from:Math.max(n.from,t.moveToLineBoundary(r,!1,!0).from),to:Math.min(n.to,t.moveToLineBoundary(r,!0,!0).from),type:ui.Text}}function Zye(t,e,n){if(n.to<=t.viewport.from||n.from>=t.viewport.to)return[];let r=Math.max(n.from,t.viewport.from),i=Math.min(n.to,t.viewport.to),o=t.textDirection==Rn.LTR,s=t.contentDOM,a=s.getBoundingClientRect(),l=fB(t),c=s.querySelector(".cm-line"),f=c&&window.getComputedStyle(c),d=a.left+(f?parseInt(f.paddingLeft)+Math.min(0,parseInt(f.textIndent)):0),p=a.right-(f?parseInt(f.paddingRight):0),m=Qk(t,r),v=Qk(t,i),b=m.type==ui.Text?m:null,S=v.type==ui.Text?v:null;if(b&&(t.lineWrapping||m.widgetLineBreaks)&&(b=uL(t,r,b)),S&&(t.lineWrapping||v.widgetLineBreaks)&&(S=uL(t,i,S)),b&&S&&b.from==S.from)return w(C(n.from,n.to,b));{let A=b?C(n.from,null,b):T(m,!1),_=S?C(null,n.to,S):T(v,!0),R=[];return(b||m).to<(S||v).from-(b&&S?1:0)||m.widgetLineBreaks>1&&A.bottom+t.defaultLineHeight/2<_.top?R.push(x(d,A.bottom,p,_.top)):A.bottom<_.top&&t.elementAtHeight((A.bottom+_.top)/2).type==ui.Text&&(A.bottom=_.top=(A.bottom+_.top)/2),w(A).concat(R).concat(w(_))}function x(A,_,R,M){return new Wm(e,A-l.left,_-l.top-.01,R-A,M-_+.01)}function w({top:A,bottom:_,horizontal:R}){let M=[];for(let I=0;I<R.length;I+=2)M.push(x(R[I],A,R[I+1],_));return M}function C(A,_,R){let M=1e9,I=-1e9,V=[];function U(K,F,ie,ae,re){let W=t.coordsAtPos(K,K==R.to?-2:2),P=t.coordsAtPos(ie,ie==R.from?2:-2);!W||!P||(M=Math.min(W.top,P.top,M),I=Math.max(W.bottom,P.bottom,I),re==Rn.LTR?V.push(o&&F?d:W.left,o&&ae?p:P.right):V.push(!o&&ae?d:P.left,!o&&F?p:W.right))}let L=A??R.from,G=_??R.to;for(let K of t.visibleRanges)if(K.to>L&&K.from<G)for(let F=Math.max(K.from,L),ie=Math.min(K.to,G);;){let ae=t.state.doc.lineAt(F);for(let re of t.bidiSpans(ae)){let W=re.from+ae.from,P=re.to+ae.from;if(W>=ie)break;P>F&&U(Math.max(W,F),A==null&&W<=L,Math.min(P,ie),_==null&&P>=G,re.dir)}if(F=ae.to+1,F>=ie)break}return V.length==0&&U(L,A==null,G,_==null,t.textDirection),{top:M,bottom:I,horizontal:V}}function T(A,_){let R=a.top+(_?A.top:A.bottom);return{top:R,bottom:R,horizontal:[]}}}function Qye(t,e){return t.constructor==e.constructor&&t.eq(e)}class Jye{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(Cy)!=e.state.facet(Cy)&&this.setOrder(e.state),(this.layer.update(e,this.dom)||e.geometryChanged)&&(this.scale(),e.view.requestMeasure(this.measureReq))}setOrder(e){let n=0,r=e.facet(Cy);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)=>!Qye(n,this.drawn[r]))){let n=this.dom.firstChild,r=0;for(let i of e)i.update&&n&&i.constructor&&this.drawn[r].constructor&&i.update(n,this.drawn[r])?(n=n.nextSibling,r++):this.dom.insertBefore(i.draw(),n);for(;n;){let i=n.nextSibling;n.remove(),n=i}this.drawn=e}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const Cy=Je.define();function dB(t){return[tr.define(e=>new Jye(e,t)),Cy.of(t)]}const hB=!tt.ios,hm=Je.define({combine(t){return sa(t,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(e,n)=>Math.min(e,n),drawRangeCursor:(e,n)=>e||n})}});function e0e(t={}){return[hm.of(t),t0e,n0e,r0e,F8.of(!0)]}function pB(t){return t.startState.facet(hm)!=t.state.facet(hm)}const t0e=dB({above:!0,markers(t){let{state:e}=t,n=e.facet(hm),r=[];for(let i of e.selection.ranges){let o=i==e.selection.main;if(i.empty?!o||hB:n.drawRangeCursor){let s=o?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",a=i.empty?i:be.cursor(i.head,i.head>i.anchor?-1:1);for(let l of Wm.forRange(t,s,a))r.push(l)}}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=pB(t);return n&&fL(t.state,e),t.docChanged||t.selectionSet||n},mount(t,e){fL(e.state,t)},class:"cm-cursorLayer"});function fL(t,e){e.style.animationDuration=t.facet(hm).cursorBlinkRate+"ms"}const n0e=dB({above:!1,markers(t){return t.state.selection.ranges.map(e=>e.empty?[]:Wm.forRange(t,"cm-selectionBackground",e)).reduce((e,n)=>e.concat(n))},update(t,e){return t.docChanged||t.selectionSet||t.viewportChanged||pB(t)},class:"cm-selectionLayer"}),rE={".cm-line":{"& ::selection":{backgroundColor:"transparent !important"},"&::selection":{backgroundColor:"transparent !important"}}};hB&&(rE[".cm-line"].caretColor="transparent !important",rE[".cm-content"]={caretColor:"transparent !important"});const r0e=Fd.highest(Ge.theme(rE)),mB=Ot.define({map(t,e){return t==null?null:e.mapPos(t)}}),Kh=Fr.define({create(){return null},update(t,e){return t!=null&&(t=e.changes.mapPos(t)),e.effects.reduce((n,r)=>r.is(mB)?r.value:n,t)}}),i0e=tr.fromClass(class{constructor(t){this.view=t,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(t){var e;let n=t.state.field(Kh);n==null?this.cursor!=null&&((e=this.cursor)===null||e===void 0||e.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(t.startState.field(Kh)!=n||t.docChanged||t.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:t}=this,e=t.state.field(Kh),n=e!=null&&t.coordsAtPos(e);if(!n)return null;let r=t.scrollDOM.getBoundingClientRect();return{left:n.left-r.left+t.scrollDOM.scrollLeft*t.scaleX,top:n.top-r.top+t.scrollDOM.scrollTop*t.scaleY,height:n.bottom-n.top}}drawCursor(t){if(this.cursor){let{scaleX:e,scaleY:n}=this.view;t?(this.cursor.style.left=t.left/e+"px",this.cursor.style.top=t.top/n+"px",this.cursor.style.height=t.height/n+"px"):this.cursor.style.left="-100000px"}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(t){this.view.state.field(Kh)!=t&&this.view.dispatch({effects:mB.of(t)})}},{eventObservers:{dragover(t){this.setDropPos(this.view.posAtCoords({x:t.clientX,y:t.clientY}))},dragleave(t){(t.target==this.view.contentDOM||!this.view.contentDOM.contains(t.relatedTarget))&&this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function o0e(){return[Kh,i0e]}function dL(t,e,n,r,i){e.lastIndex=0;for(let o=t.iterRange(n,r),s=n,a;!o.next().done;s+=o.value.length)if(!o.lineBreak)for(;a=e.exec(o.value);)i(s+a.index,a)}function s0e(t,e){let n=t.visibleRanges;if(n.length==1&&n[0].from==t.viewport.from&&n[0].to==t.viewport.to)return n;let r=[];for(let{from:i,to:o}of n)i=Math.max(t.state.doc.lineAt(i).from,i-e),o=Math.min(t.state.doc.lineAt(o).to,o+e),r.length&&r[r.length-1].to>=i?r[r.length-1].to=o:r.push({from:i,to:o});return r}class a0e{constructor(e){const{regexp:n,decoration:r,decorate:i,boundary:o,maxLength:s=1e3}=e;if(!n.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=n,i)this.addMatch=(a,l,c,f)=>i(f,c,c+a[0].length,a,l);else if(typeof r=="function")this.addMatch=(a,l,c,f)=>{let d=r(a,l,c);d&&f(c,c+a[0].length,d)};else if(r)this.addMatch=(a,l,c,f)=>f(c,c+a[0].length,r);else throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=o,this.maxLength=s}createDeco(e){let n=new Ql,r=n.add.bind(n);for(let{from:i,to:o}of s0e(e,this.maxLength))dL(e.state.doc,this.regexp,i,o,(s,a)=>this.addMatch(a,e,s,r));return n.finish()}updateDeco(e,n){let r=1e9,i=-1;return e.docChanged&&e.changes.iterChanges((o,s,a,l)=>{l>e.view.viewport.from&&a<e.view.viewport.to&&(r=Math.min(a,r),i=Math.max(l,i))}),e.viewportChanged||i-r>1e3?this.createDeco(e.view):i>-1?this.updateRange(e.view,n.map(e.changes),r,i):n}updateRange(e,n,r,i){for(let o of e.visibleRanges){let s=Math.max(o.from,r),a=Math.min(o.to,i);if(a>s){let l=e.state.doc.lineAt(s),c=l.to<a?e.state.doc.lineAt(a):l,f=Math.max(o.from,l.from),d=Math.min(o.to,c.to);if(this.boundary){for(;s>l.from;s--)if(this.boundary.test(l.text[s-1-l.from])){f=s;break}for(;a<c.to;a++)if(this.boundary.test(c.text[a-c.from])){d=a;break}}let p=[],m,v=(b,S,x)=>p.push(x.range(b,S));if(l==c)for(this.regexp.lastIndex=f-l.from;(m=this.regexp.exec(l.text))&&m.index<d-l.from;)this.addMatch(m,e,m.index+l.from,v);else dL(e.state.doc,this.regexp,f,d,(b,S)=>this.addMatch(S,e,b,v));n=n.update({filterFrom:f,filterTo:d,filter:(b,S)=>b<f||S>d,add:p})}}return n}}const iE=/x/.unicode!=null?"gu":"g",l0e=new RegExp(`[\0-\b
218
+ --Ÿ­؜​‎‏\u2028\u2029‭‮⁦⁧⁩\uFEFF-]`,iE),c0e={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let bS=null;function u0e(){var t;if(bS==null&&typeof document<"u"&&document.body){let e=document.body.style;bS=((t=e.tabSize)!==null&&t!==void 0?t:e.MozTabSize)!=null}return bS||!1}const ky=Je.define({combine(t){let e=sa(t,{render:null,specialChars:l0e,addSpecialChars:null});return(e.replaceTabs=!u0e())&&(e.specialChars=new RegExp(" |"+e.specialChars.source,iE)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,iE)),e}});function f0e(t={}){return[ky.of(t),d0e()]}let hL=null;function d0e(){return hL||(hL=tr.fromClass(class{constructor(t){this.view=t,this.decorations=dt.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(t.state.facet(ky)),this.decorations=this.decorator.createDeco(t)}makeDecorator(t){return new a0e({regexp:t.specialChars,decoration:(e,n,r)=>{let{doc:i}=n.state,o=Mr(e[0],0);if(o==9){let s=i.lineAt(r),a=n.state.tabSize,l=zd(s.text,a,r-s.from);return dt.replace({widget:new g0e((a-l%a)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[o]||(this.decorationCache[o]=dt.replace({widget:new m0e(t,o)}))},boundary:t.replaceTabs?void 0:/[^]/})}update(t){let e=t.state.facet(ky);t.startState.facet(ky)!=e?(this.decorator=this.makeDecorator(e),this.decorations=this.decorator.createDeco(t.view)):this.decorations=this.decorator.updateDeco(t,this.decorations)}},{decorations:t=>t.decorations}))}const h0e="•";function p0e(t){return t>=32?h0e:t==10?"␤":String.fromCharCode(9216+t)}class m0e extends Ga{constructor(e,n){super(),this.options=e,this.code=n}eq(e){return e.code==this.code}toDOM(e){let n=p0e(this.code),r=e.state.phrase("Control character")+" "+(c0e[this.code]||"0x"+this.code.toString(16)),i=this.options.render&&this.options.render(this.code,r,n);if(i)return i;let o=document.createElement("span");return o.textContent=n,o.title=r,o.setAttribute("aria-label",r),o.className="cm-specialChar",o}ignoreEvent(){return!1}}class g0e extends Ga{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement("span");return e.textContent=" ",e.className="cm-tab",e.style.width=this.width+"px",e}ignoreEvent(){return!1}}function v0e(){return b0e}const y0e=dt.line({class:"cm-activeLine"}),b0e=tr.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 i=t.lineBlockAt(r.head);i.from>e&&(n.push(y0e.range(i.from)),e=i.from)}return dt.set(n)}},{decorations:t=>t.decorations});class w0e extends Ga{constructor(e){super(),this.content=e}toDOM(){let e=document.createElement("span");return e.className="cm-placeholder",e.style.pointerEvents="none",e.appendChild(typeof this.content=="string"?document.createTextNode(this.content):this.content),typeof this.content=="string"?e.setAttribute("aria-label","placeholder "+this.content):e.setAttribute("aria-hidden","true"),e}coordsAt(e){let n=e.firstChild?pd(e.firstChild):[];if(!n.length)return null;let r=window.getComputedStyle(e.parentNode),i=w1(n[0],r.direction!="rtl"),o=parseInt(r.lineHeight);return i.bottom-i.top>o*1.5?{left:i.left,right:i.right,top:i.top,bottom:i.top+o}:i}ignoreEvent(){return!1}}function x0e(t){return tr.fromClass(class{constructor(e){this.view=e,this.placeholder=t?dt.set([dt.widget({widget:new w0e(t),side:1}).range(0)]):dt.none}get decorations(){return this.view.state.doc.length?dt.none:this.placeholder}},{decorations:e=>e.decorations})}const oE=2e3;function S0e(t,e,n){let r=Math.min(e.line,n.line),i=Math.max(e.line,n.line),o=[];if(e.off>oE||n.off>oE||e.col<0||n.col<0){let s=Math.min(e.off,n.off),a=Math.max(e.off,n.off);for(let l=r;l<=i;l++){let c=t.doc.line(l);c.length<=a&&o.push(be.range(c.from+s,c.to+a))}}else{let s=Math.min(e.col,n.col),a=Math.max(e.col,n.col);for(let l=r;l<=i;l++){let c=t.doc.line(l),f=Ik(c.text,s,t.tabSize,!0);if(f<0)o.push(be.cursor(c.to));else{let d=Ik(c.text,a,t.tabSize);o.push(be.range(c.from+f,c.from+d))}}}return o}function C0e(t,e){let n=t.coordsAtPos(t.viewport.from);return n?Math.round(Math.abs((n.left-e)/t.defaultCharacterWidth)):-1}function pL(t,e){let n=t.posAtCoords({x:e.clientX,y:e.clientY},!1),r=t.state.doc.lineAt(n),i=n-r.from,o=i>oE?-1:i==r.length?C0e(t,e.clientX):zd(r.text,t.state.tabSize,n-r.from);return{line:r.number,col:o,off:i}}function k0e(t,e){let n=pL(t,e),r=t.state.selection;return n?{update(i){if(i.docChanged){let o=i.changes.mapPos(i.startState.doc.line(n.line).from),s=i.state.doc.lineAt(o);n={line:s.number,col:n.col,off:Math.min(n.off,s.length)},r=r.map(i.changes)}},get(i,o,s){let a=pL(t,i);if(!a)return r;let l=S0e(t.state,n,a);return l.length?s?be.create(l.concat(r.ranges)):be.create(l):r}}:null}function E0e(t){let e=(t==null?void 0:t.eventFilter)||(n=>n.altKey&&n.button==0);return Ge.mouseSelectionStyle.of((n,r)=>e(r)?k0e(n,r):null)}const _0e={Alt:[18,t=>!!t.altKey],Control:[17,t=>!!t.ctrlKey],Shift:[16,t=>!!t.shiftKey],Meta:[91,t=>!!t.metaKey]},T0e={style:"cursor: crosshair"};function A0e(t={}){let[e,n]=_0e[t.key||"Alt"],r=tr.fromClass(class{constructor(i){this.view=i,this.isDown=!1}set(i){this.isDown!=i&&(this.isDown=i,this.view.update([]))}},{eventObservers:{keydown(i){this.set(i.keyCode==e||n(i))},keyup(i){(i.keyCode==e||!n(i))&&this.set(!1)},mousemove(i){this.set(n(i))}}});return[r,Ge.contentAttributes.of(i=>{var o;return!((o=i.plugin(r))===null||o===void 0)&&o.isDown?T0e:null})]}const Nh="-10000px";class gB{constructor(e,n,r,i){this.facet=n,this.createTooltipView=r,this.removeTooltipView=i,this.input=e.state.facet(n),this.tooltips=this.input.filter(s=>s);let o=null;this.tooltipViews=this.tooltips.map(s=>o=r(s,o))}update(e,n){var r;let i=e.state.facet(this.facet),o=i.filter(l=>l);if(i===this.input){for(let l of this.tooltipViews)l.update&&l.update(e);return!1}let s=[],a=n?[]:null;for(let l=0;l<o.length;l++){let c=o[l],f=-1;if(c){for(let d=0;d<this.tooltips.length;d++){let p=this.tooltips[d];p&&p.create==c.create&&(f=d)}if(f<0)s[l]=this.createTooltipView(c,l?s[l-1]:null),a&&(a[l]=!!c.above);else{let d=s[l]=this.tooltipViews[f];a&&(a[l]=n[f]),d.update&&d.update(e)}}}for(let l of this.tooltipViews)s.indexOf(l)<0&&(this.removeTooltipView(l),(r=l.destroy)===null||r===void 0||r.call(l));return n&&(a.forEach((l,c)=>n[c]=l),n.length=a.length),this.input=i,this.tooltips=o,this.tooltipViews=s,!0}}function O0e(t){let{win:e}=t;return{top:0,left:0,bottom:e.innerHeight,right:e.innerWidth}}const wS=Je.define({combine:t=>{var e,n,r;return{position:tt.ios?"absolute":((e=t.find(i=>i.position))===null||e===void 0?void 0:e.position)||"fixed",parent:((n=t.find(i=>i.parent))===null||n===void 0?void 0:n.parent)||null,tooltipSpace:((r=t.find(i=>i.tooltipSpace))===null||r===void 0?void 0:r.tooltipSpace)||O0e}}}),mL=new WeakMap,ST=tr.fromClass(class{constructor(t){this.view=t,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let e=t.state.facet(wS);this.position=e.position,this.parent=e.parent,this.classes=t.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver=typeof ResizeObserver=="function"?new ResizeObserver(()=>this.measureSoon()):null,this.manager=new gB(t,CT,(n,r)=>this.createTooltip(n,r),n=>{this.resizeObserver&&this.resizeObserver.unobserve(n.dom),n.dom.remove()}),this.above=this.manager.tooltips.map(n=>!!n.above),this.intersectionObserver=typeof IntersectionObserver=="function"?new IntersectionObserver(n=>{Date.now()>this.lastTransaction-50&&n.length>0&&n[n.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),t.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let t of this.manager.tooltipViews)this.intersectionObserver.observe(t.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(t){t.transactions.length&&(this.lastTransaction=Date.now());let e=this.manager.update(t,this.above);e&&this.observeIntersection();let n=e||t.geometryChanged,r=t.state.facet(wS);if(r.position!=this.position&&!this.madeAbsolute){this.position=r.position;for(let i of this.manager.tooltipViews)i.dom.style.position=this.position;n=!0}if(r.parent!=this.parent){this.parent&&this.container.remove(),this.parent=r.parent,this.createContainer();for(let i of this.manager.tooltipViews)this.container.appendChild(i.dom);n=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);n&&this.maybeMeasure()}createTooltip(t,e){let n=t.create(this.view),r=e?e.dom:null;if(n.dom.classList.add("cm-tooltip"),t.arrow&&!n.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let i=document.createElement("div");i.className="cm-tooltip-arrow",n.dom.insertBefore(i,r)}return n.dom.style.position=this.position,n.dom.style.top=Nh,n.dom.style.left="0px",this.container.insertBefore(n.dom,r),n.mount&&n.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(n.dom),n}destroy(){var t,e,n;this.view.win.removeEventListener("resize",this.measureSoon);for(let r of this.manager.tooltipViews)r.dom.remove(),(t=r.destroy)===null||t===void 0||t.call(r);this.parent&&this.container.remove(),(e=this.resizeObserver)===null||e===void 0||e.disconnect(),(n=this.intersectionObserver)===null||n===void 0||n.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let t=this.view.dom.getBoundingClientRect(),e=1,n=1,r=!1;if(this.position=="fixed"&&this.manager.tooltipViews.length){let{dom:i}=this.manager.tooltipViews[0];if(tt.gecko)r=i.offsetParent!=this.container.ownerDocument.body;else if(i.style.top==Nh&&i.style.left=="0px"){let o=i.getBoundingClientRect();r=Math.abs(o.top+1e4)>1||Math.abs(o.left)>1}}if(r||this.position=="absolute")if(this.parent){let i=this.parent.getBoundingClientRect();i.width&&i.height&&(e=i.width/this.parent.offsetWidth,n=i.height/this.parent.offsetHeight)}else({scaleX:e,scaleY:n}=this.view.viewState);return{editor:t,parent:this.parent?this.container.getBoundingClientRect():t,pos:this.manager.tooltips.map((i,o)=>{let s=this.manager.tooltipViews[o];return s.getCoords?s.getCoords(i.pos):this.view.coordsAtPos(i.pos)}),size:this.manager.tooltipViews.map(({dom:i})=>i.getBoundingClientRect()),space:this.view.state.facet(wS).tooltipSpace(this.view),scaleX:e,scaleY:n,makeAbsolute:r}}writeMeasure(t){var e;if(t.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let a of this.manager.tooltipViews)a.dom.style.position="absolute"}let{editor:n,space:r,scaleX:i,scaleY:o}=t,s=[];for(let a=0;a<this.manager.tooltips.length;a++){let l=this.manager.tooltips[a],c=this.manager.tooltipViews[a],{dom:f}=c,d=t.pos[a],p=t.size[a];if(!d||d.bottom<=Math.max(n.top,r.top)||d.top>=Math.min(n.bottom,r.bottom)||d.right<Math.max(n.left,r.left)-.1||d.left>Math.min(n.right,r.right)+.1){f.style.top=Nh;continue}let m=l.arrow?c.dom.querySelector(".cm-tooltip-arrow"):null,v=m?7:0,b=p.right-p.left,S=(e=mL.get(c))!==null&&e!==void 0?e:p.bottom-p.top,x=c.offset||P0e,w=this.view.textDirection==Rn.LTR,C=p.width>r.right-r.left?w?r.left:r.right-p.width:w?Math.min(d.left-(m?14:0)+x.x,r.right-b):Math.max(r.left,d.left-b+(m?14:0)-x.x),T=this.above[a];!l.strictSide&&(T?d.top-(p.bottom-p.top)-x.y<r.top:d.bottom+(p.bottom-p.top)+x.y>r.bottom)&&T==r.bottom-d.bottom>d.top-r.top&&(T=this.above[a]=!T);let A=(T?d.top-r.top:r.bottom-d.bottom)-v;if(A<S&&c.resize!==!1){if(A<this.view.defaultLineHeight){f.style.top=Nh;continue}mL.set(c,S),f.style.height=(S=A)/o+"px"}else f.style.height&&(f.style.height="");let _=T?d.top-S-v-x.y:d.bottom+v+x.y,R=C+b;if(c.overlap!==!0)for(let M of s)M.left<R&&M.right>C&&M.top<_+S&&M.bottom>_&&(_=T?M.top-S-2-v:M.bottom+v+2);if(this.position=="absolute"?(f.style.top=(_-t.parent.top)/o+"px",f.style.left=(C-t.parent.left)/i+"px"):(f.style.top=_/o+"px",f.style.left=C/i+"px"),m){let M=d.left+(w?x.x:-x.x)-(C+14-7);m.style.left=M/i+"px"}c.overlap!==!0&&s.push({left:C,top:_,right:R,bottom:_+S}),f.classList.toggle("cm-tooltip-above",T),f.classList.toggle("cm-tooltip-below",!T),c.positioned&&c.positioned(t.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let t of this.manager.tooltipViews)t.dom.style.top=Nh}},{eventObservers:{scroll(){this.maybeMeasure()}}}),R0e=Ge.baseTheme({".cm-tooltip":{zIndex:100,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:`${7*2}px`,position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),P0e={x:0,y:0},CT=Je.define({enables:[ST,R0e]}),Q0=Je.define({combine:t=>t.reduce((e,n)=>e.concat(n),[])});class k1{static create(e){return new k1(e)}constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new gB(e,Q0,(n,r)=>this.createHostedView(n,r),n=>n.dom.remove())}createHostedView(e,n){let r=e.create(this.view);return r.dom.classList.add("cm-tooltip-section"),this.dom.insertBefore(r.dom,n?n.dom.nextSibling:this.dom.firstChild),this.mounted&&r.mount&&r.mount(this.view),r}mount(e){for(let n of this.manager.tooltipViews)n.mount&&n.mount(e);this.mounted=!0}positioned(e){for(let n of this.manager.tooltipViews)n.positioned&&n.positioned(e)}update(e){this.manager.update(e)}destroy(){var e;for(let n of this.manager.tooltipViews)(e=n.destroy)===null||e===void 0||e.call(n)}passProp(e){let n;for(let r of this.manager.tooltipViews){let i=r[e];if(i!==void 0){if(n===void 0)n=i;else if(n!==i)return}}return n}get offset(){return this.passProp("offset")}get getCoords(){return this.passProp("getCoords")}get overlap(){return this.passProp("overlap")}get resize(){return this.passProp("resize")}}const N0e=CT.compute([Q0],t=>{let e=t.facet(Q0);return e.length===0?null:{pos:Math.min(...e.map(n=>n.pos)),end:Math.max(...e.map(n=>{var r;return(r=n.end)!==null&&r!==void 0?r:n.pos})),create:k1.create,above:e[0].above,arrow:e.some(n=>n.arrow)}});class M0e{constructor(e,n,r,i,o){this.view=e,this.source=n,this.field=r,this.setHover=i,this.hoverTime=o,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:e.dom,time:0},this.checkHover=this.checkHover.bind(this),e.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),e.dom.addEventListener("mousemove",this.mousemove=this.mousemove.bind(this))}update(){this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout(()=>this.startHover(),20))}get active(){return this.view.state.field(this.field)}checkHover(){if(this.hoverTimeout=-1,this.active.length)return;let e=Date.now()-this.lastMove.time;e<this.hoverTime?this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime-e):this.startHover()}startHover(){clearTimeout(this.restartTimeout);let{view:e,lastMove:n}=this,r=e.docView.nearest(n.target);if(!r)return;let i,o=1;if(r instanceof Al)i=r.posAtStart;else{if(i=e.posAtCoords(n),i==null)return;let a=e.coordsAtPos(i);if(!a||n.y<a.top||n.y>a.bottom||n.x<a.left-e.defaultCharacterWidth||n.x>a.right+e.defaultCharacterWidth)return;let l=e.bidiSpans(e.state.doc.lineAt(i)).find(f=>f.from<=i&&f.to>=i),c=l&&l.dir==Rn.RTL?-1:1;o=n.x<a.left?-c:c}let s=this.source(e,i,o);if(s!=null&&s.then){let a=this.pending={pos:i};s.then(l=>{this.pending==a&&(this.pending=null,l&&!(Array.isArray(l)&&!l.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(l)?l:[l])}))},l=>Do(e.state,l,"hover tooltip"))}else s&&!(Array.isArray(s)&&!s.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(s)?s:[s])})}get tooltip(){let e=this.view.plugin(ST),n=e?e.manager.tooltips.findIndex(r=>r.create==k1.create):-1;return n>-1?e.manager.tooltipViews[n]:null}mousemove(e){var n,r;this.lastMove={x:e.clientX,y:e.clientY,target:e.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let{active:i,tooltip:o}=this;if(i.length&&o&&!D0e(o.dom,e)||this.pending){let{pos:s}=i[0]||this.pending,a=(r=(n=i[0])===null||n===void 0?void 0:n.end)!==null&&r!==void 0?r:s;(s==a?this.view.posAtCoords(this.lastMove)!=s:!L0e(this.view,s,a,e.clientX,e.clientY))&&(this.view.dispatch({effects:this.setHover.of([])}),this.pending=null)}}mouseleave(e){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;let{active:n}=this;if(n.length){let{tooltip:r}=this;r&&r.dom.contains(e.relatedTarget)?this.watchTooltipLeave(r.dom):this.view.dispatch({effects:this.setHover.of([])})}}watchTooltipLeave(e){let n=r=>{e.removeEventListener("mouseleave",n),this.active.length&&!this.view.dom.contains(r.relatedTarget)&&this.view.dispatch({effects:this.setHover.of([])})};e.addEventListener("mouseleave",n)}destroy(){clearTimeout(this.hoverTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}}const Dv=4;function D0e(t,e){let n=t.getBoundingClientRect();return e.clientX>=n.left-Dv&&e.clientX<=n.right+Dv&&e.clientY>=n.top-Dv&&e.clientY<=n.bottom+Dv}function L0e(t,e,n,r,i,o){let s=t.scrollDOM.getBoundingClientRect(),a=t.documentTop+t.documentPadding.top+t.contentHeight;if(s.left>r||s.right<r||s.top>i||Math.min(s.bottom,a)<i)return!1;let l=t.posAtCoords({x:r,y:i},!1);return l>=e&&l<=n}function $0e(t,e={}){let n=Ot.define(),r=Fr.define({create(){return[]},update(i,o){if(i.length&&(e.hideOnChange&&(o.docChanged||o.selection)?i=[]:e.hideOn&&(i=i.filter(s=>!e.hideOn(o,s))),o.docChanged))for(let s of i){let a=o.changes.mapPos(s.pos,-1,li.TrackDel);if(a!=null){let l=Object.assign(Object.create(null),s);l.pos=a,l.end!=null&&(l.end=o.changes.mapPos(l.end))}}for(let s of o.effects)s.is(n)&&(i=s.value),s.is(I0e)&&(i=[]);return i},provide:i=>Q0.from(i)});return[r,tr.define(i=>new M0e(i,t,r,n,e.hoverTime||300)),N0e]}function vB(t,e){let n=t.plugin(ST);if(!n)return null;let r=n.manager.tooltips.indexOf(e);return r<0?null:n.manager.tooltipViews[r]}const I0e=Ot.define(),gL=Je.define({combine(t){let e,n;for(let r of t)e=e||r.topContainer,n=n||r.bottomContainer;return{topContainer:e,bottomContainer:n}}});function pm(t,e){let n=t.plugin(yB),r=n?n.specs.indexOf(e):-1;return r>-1?n.panels[r]:null}const yB=tr.fromClass(class{constructor(t){this.input=t.state.facet(mm),this.specs=this.input.filter(n=>n),this.panels=this.specs.map(n=>n(t));let e=t.state.facet(gL);this.top=new Lv(t,!0,e.topContainer),this.bottom=new Lv(t,!1,e.bottomContainer),this.top.sync(this.panels.filter(n=>n.top)),this.bottom.sync(this.panels.filter(n=>!n.top));for(let n of this.panels)n.dom.classList.add("cm-panel"),n.mount&&n.mount()}update(t){let e=t.state.facet(gL);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new Lv(t.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new Lv(t.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let n=t.state.facet(mm);if(n!=this.input){let r=n.filter(l=>l),i=[],o=[],s=[],a=[];for(let l of r){let c=this.specs.indexOf(l),f;c<0?(f=l(t.view),a.push(f)):(f=this.panels[c],f.update&&f.update(t)),i.push(f),(f.top?o:s).push(f)}this.specs=r,this.panels=i,this.top.sync(o),this.bottom.sync(s);for(let l of a)l.dom.classList.add("cm-panel"),l.mount&&l.mount()}else for(let r of this.panels)r.update&&r.update(t)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:t=>Ge.scrollMargins.of(e=>{let n=e.plugin(t);return n&&{top:n.top.scrollMargin(),bottom:n.bottom.scrollMargin()}})});class Lv{constructor(e,n,r){this.view=e,this.top=n,this.container=r,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(e){for(let n of this.panels)n.destroy&&e.indexOf(n)<0&&n.destroy();this.panels=e,this.syncDOM()}syncDOM(){if(this.panels.length==0){this.dom&&(this.dom.remove(),this.dom=void 0);return}if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let n=this.container||this.view.dom;n.insertBefore(this.dom,this.top?n.firstChild:null)}let e=this.dom.firstChild;for(let n of this.panels)if(n.dom.parentNode==this.dom){for(;e!=n.dom;)e=vL(e);e=e.nextSibling}else this.dom.insertBefore(n.dom,e);for(;e;)e=vL(e)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(!(!this.container||this.classes==this.view.themeClasses)){for(let e of this.classes.split(" "))e&&this.container.classList.remove(e);for(let e of(this.classes=this.view.themeClasses).split(" "))e&&this.container.classList.add(e)}}}function vL(t){let e=t.nextSibling;return t.remove(),e}const mm=Je.define({enables:yB});class Wa extends gu{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}Wa.prototype.elementClass="";Wa.prototype.toDOM=void 0;Wa.prototype.mapMode=li.TrackBefore;Wa.prototype.startSide=Wa.prototype.endSide=-1;Wa.prototype.point=!0;const Ey=Je.define(),j0e={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>Gt.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{}},vp=Je.define();function B0e(t){return[bB(),vp.of(Object.assign(Object.assign({},j0e),t))]}const sE=Je.define({combine:t=>t.some(e=>e)});function bB(t){let e=[F0e];return t&&t.fixed===!1&&e.push(sE.of(!0)),e}const F0e=tr.fromClass(class{constructor(t){this.view=t,this.prevViewport=t.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=t.state.facet(vp).map(e=>new bL(t,e));for(let e of this.gutters)this.dom.appendChild(e.dom);this.fixed=!t.state.facet(sE),this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),t.scrollDOM.insertBefore(this.dom,t.contentDOM)}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)}t.geometryChanged&&(this.dom.style.minHeight=this.view.contentHeight+"px"),this.view.state.facet(sE)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":""),this.prevViewport=t.view.viewport}syncGutters(t){let e=this.dom.nextSibling;t&&this.dom.remove();let n=Gt.iter(this.view.state.facet(Ey),this.view.viewport.from),r=[],i=this.gutters.map(o=>new z0e(o,this.view.viewport,-this.view.documentPadding.top));for(let o of this.view.viewportLineBlocks)if(r.length&&(r=[]),Array.isArray(o.type)){let s=!0;for(let a of o.type)if(a.type==ui.Text&&s){aE(n,r,a.from);for(let l of i)l.line(this.view,a,r);s=!1}else if(a.widget)for(let l of i)l.widget(this.view,a)}else if(o.type==ui.Text){aE(n,r,o.from);for(let s of i)s.line(this.view,o,r)}else if(o.widget)for(let s of i)s.widget(this.view,o);for(let o of i)o.finish();t&&this.view.scrollDOM.insertBefore(this.dom,e)}updateGutters(t){let e=t.startState.facet(vp),n=t.state.facet(vp),r=t.docChanged||t.heightChanged||t.viewportChanged||!Gt.eq(t.startState.facet(Ey),t.state.facet(Ey),t.view.viewport.from,t.view.viewport.to);if(e==n)for(let i of this.gutters)i.update(t)&&(r=!0);else{r=!0;let i=[];for(let o of n){let s=e.indexOf(o);s<0?i.push(new bL(this.view,o)):(this.gutters[s].update(t),i.push(this.gutters[s]))}for(let o of this.gutters)o.dom.remove(),i.indexOf(o)<0&&o.destroy();for(let o of i)this.dom.appendChild(o.dom);this.gutters=i}return r}destroy(){for(let t of this.gutters)t.destroy();this.dom.remove()}},{provide:t=>Ge.scrollMargins.of(e=>{let n=e.plugin(t);return!n||n.gutters.length==0||!n.fixed?null:e.textDirection==Rn.LTR?{left:n.dom.offsetWidth*e.scaleX}:{right:n.dom.offsetWidth*e.scaleX}})});function yL(t){return Array.isArray(t)?t:[t]}function aE(t,e,n){for(;t.value&&t.from<=n;)t.from==n&&e.push(t.value),t.next()}class z0e{constructor(e,n,r){this.gutter=e,this.height=r,this.i=0,this.cursor=Gt.iter(e.markers,n.from)}addElement(e,n,r){let{gutter:i}=this,o=(n.top-this.height)/e.scaleY,s=n.height/e.scaleY;if(this.i==i.elements.length){let a=new wB(e,s,o,r);i.elements.push(a),i.dom.appendChild(a.dom)}else i.elements[this.i].update(e,s,o,r);this.height=n.bottom,this.i++}line(e,n,r){let i=[];aE(this.cursor,i,n.from),r.length&&(i=i.concat(r));let o=this.gutter.config.lineMarker(e,n,i);o&&i.unshift(o);let s=this.gutter;i.length==0&&!s.config.renderEmptyElements||this.addElement(e,n,i)}widget(e,n){let r=this.gutter.config.widgetMarker(e,n.widget,n);r&&this.addElement(e,n,[r])}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let n=e.elements.pop();e.dom.removeChild(n.dom),n.destroy()}}}class bL{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,i=>{let o=i.target,s;if(o!=this.dom&&this.dom.contains(o)){for(;o.parentNode!=this.dom;)o=o.parentNode;let l=o.getBoundingClientRect();s=(l.top+l.bottom)/2}else s=i.clientY;let a=e.lineBlockAtHeight(s-e.documentTop);n.domEventHandlers[r](e,a,i)&&i.preventDefault()});this.markers=yL(n.markers(e)),n.initialSpacer&&(this.spacer=new wB(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=yL(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let i=this.config.updateSpacer(this.spacer.markers[0],e);i!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[i])}let r=e.view.viewport;return!Gt.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 wB{constructor(e,n,r,i){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,n,r,i)}update(e,n,r,i){this.height!=n&&(this.height=n,this.dom.style.height=n+"px"),this.above!=r&&(this.dom.style.marginTop=(this.above=r)?r+"px":""),V0e(this.markers,i)||this.setMarkers(e,i)}setMarkers(e,n){let r="cm-gutterElement",i=this.dom.firstChild;for(let o=0,s=0;;){let a=s,l=o<n.length?n[o++]:null,c=!1;if(l){let f=l.elementClass;f&&(r+=" "+f);for(let d=s;d<this.markers.length;d++)if(this.markers[d].compare(l)){a=d,c=!0;break}}else a=this.markers.length;for(;s<a;){let f=this.markers[s++];if(f.toDOM){f.destroy(i);let d=i.nextSibling;i.remove(),i=d}}if(!l)break;l.toDOM&&(c?i=i.nextSibling:this.dom.insertBefore(l.toDOM(e),i)),c&&s++}this.dom.className=r,this.markers=n}destroy(){this.setMarkers(null,[])}}function V0e(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 U0e=Je.define(),Of=Je.define({combine(t){return sa(t,{formatNumber:String,domEventHandlers:{}},{domEventHandlers(e,n){let r=Object.assign({},e);for(let i in n){let o=r[i],s=n[i];r[i]=o?(a,l,c)=>o(a,l,c)||s(a,l,c):s}return r}})}});class xS extends Wa{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function SS(t,e){return t.state.facet(Of).formatNumber(e,t.state)}const W0e=vp.compute([Of],t=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(e){return e.state.facet(U0e)},lineMarker(e,n,r){return r.some(i=>i.toDOM)?null:new xS(SS(e,e.state.doc.lineAt(n.from).number))},widgetMarker:()=>null,lineMarkerChange:e=>e.startState.facet(Of)!=e.state.facet(Of),initialSpacer(e){return new xS(SS(e,wL(e.state.doc.lines)))},updateSpacer(e,n){let r=SS(n.view,wL(n.view.state.doc.lines));return r==e.number?e:new xS(r)},domEventHandlers:t.facet(Of).domEventHandlers}));function H0e(t={}){return[Of.of(t),bB(),W0e]}function wL(t){let e=9;for(;e<t;)e=e*10+9;return e}const q0e=new class extends Wa{constructor(){super(...arguments),this.elementClass="cm-activeLineGutter"}},K0e=Ey.compute(["selection"],t=>{let e=[],n=-1;for(let r of t.selection.ranges){let i=t.doc.lineAt(r.head).from;i>n&&(n=i,e.push(q0e.range(i)))}return Gt.of(e)});function G0e(){return K0e}var CS;const Rf=new $t;function Y0e(t){return Je.define({combine:t?e=>e.concat(t):void 0})}const X0e=new $t;class us{constructor(e,n,r=[],i=""){this.data=e,this.name=i,Ht.prototype.hasOwnProperty("tree")||Object.defineProperty(Ht.prototype,"tree",{get(){return Zr(this)}}),this.parser=n,this.extension=[nc.of(this),Ht.languageData.of((o,s,a)=>{let l=xL(o,s,a),c=l.type.prop(Rf);if(!c)return[];let f=o.facet(c),d=l.type.prop(X0e);if(d){let p=l.resolve(s-l.from,a);for(let m of d)if(m.test(p,o)){let v=o.facet(m.facet);return m.type=="replace"?v:v.concat(f)}}return f})].concat(r)}isActiveAt(e,n,r=-1){return xL(e,n,r).type.prop(Rf)==this.data}findRegions(e){let n=e.facet(nc);if((n==null?void 0:n.data)==this.data)return[{from:0,to:e.doc.length}];if(!n||!n.allowsNesting)return[];let r=[],i=(o,s)=>{if(o.prop(Rf)==this.data){r.push({from:s,to:s+o.length});return}let a=o.prop($t.mounted);if(a){if(a.tree.prop(Rf)==this.data){if(a.overlay)for(let l of a.overlay)r.push({from:l.from+s,to:l.to+s});else r.push({from:s,to:s+o.length});return}else if(a.overlay){let l=r.length;if(i(a.tree,a.overlay[0].from+s),r.length>l)return}}for(let l=0;l<o.children.length;l++){let c=o.children[l];c instanceof sr&&i(c,o.positions[l]+s)}};return i(Zr(e),0),r}get allowsNesting(){return!0}}us.setState=Ot.define();function xL(t,e,n){let r=t.facet(nc),i=Zr(t).topNode;if(!r||r.allowsNesting)for(let o=i;o;o=o.enter(e,n,xr.ExcludeBuffers))o.type.isTop&&(i=o);return i}class J0 extends us{constructor(e,n,r){super(e,n,[],r),this.parser=n}static define(e){let n=Y0e(e.languageData);return new J0(n,e.parser.configure({props:[Rf.add(r=>r.isTop?n:void 0)]}),e.name)}configure(e,n){return new J0(this.data,this.parser.configure(e),n||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function Zr(t){let e=t.field(us.state,!1);return e?e.tree:sr.empty}class Z0e{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 Mh=null;class eb{constructor(e,n,r=[],i,o,s,a,l){this.parser=e,this.state=n,this.fragments=r,this.tree=i,this.treeLen=o,this.viewport=s,this.skipped=a,this.scheduleOn=l,this.parse=null,this.tempSkipped=[]}static create(e,n,r){return new eb(e,n,[],sr.empty,0,r,[],null)}startParse(){return this.parser.startParse(new Z0e(this.state.doc),this.fragments)}work(e,n){return n!=null&&n>=this.state.doc.length&&(n=void 0),this.tree!=sr.empty&&this.isDone(n??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var r;if(typeof e=="number"){let i=Date.now()+e;e=()=>Date.now()>i}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 i=this.parse.advance();if(i)if(this.fragments=this.withoutTempSkipped(Zc.addTree(i,this.fragments,this.parse.stoppedAt!=null)),this.treeLen=(r=this.parse.stoppedAt)!==null&&r!==void 0?r:this.state.doc.length,this.tree=i,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(Zc.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let n=Mh;Mh=this;try{return e()}finally{Mh=n}}withoutTempSkipped(e){for(let n;n=this.tempSkipped.pop();)e=SL(e,n.from,n.to);return e}changes(e,n){let{fragments:r,tree:i,treeLen:o,viewport:s,skipped:a}=this;if(this.takeTree(),!e.empty){let l=[];if(e.iterChangedRanges((c,f,d,p)=>l.push({fromA:c,toA:f,fromB:d,toB:p})),r=Zc.applyChanges(r,l),i=sr.empty,o=0,s={from:e.mapPos(s.from,-1),to:e.mapPos(s.to,1)},this.skipped.length){a=[];for(let c of this.skipped){let f=e.mapPos(c.from,1),d=e.mapPos(c.to,-1);f<d&&a.push({from:f,to:d})}}}return new eb(this.parser,n,r,i,o,s,a,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:i,to:o}=this.skipped[r];i<e.to&&o>e.from&&(this.fragments=SL(this.fragments,i,o),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 G9{createParse(n,r,i){let o=i[0].from,s=i[i.length-1].to;return{parsedPos:o,advance(){let l=Mh;if(l){for(let c of i)l.tempSkipped.push(c);e&&(l.scheduleOn=l.scheduleOn?Promise.all([l.scheduleOn,e]):e)}return this.parsedPos=s,new sr(Ni.none,[],[],s-o)},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 Mh}}function SL(t,e,n){return Zc.applyChanges(t,[{fromA:e,toA:n,fromB:e,toB:n}])}class gd{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 gd(n)}static init(e){let n=Math.min(3e3,e.doc.length),r=eb.create(e.facet(nc).parser,e,{from:0,to:n});return r.work(20,n)||r.takeTree(),new gd(r)}}us.state=Fr.define({create:gd.init,update(t,e){for(let n of e.effects)if(n.is(us.setState))return n.value;return e.startState.facet(nc)!=e.state.facet(nc)?gd.init(e.state):t.apply(e)}});let xB=t=>{let e=setTimeout(()=>t(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(xB=t=>{let e=-1,n=setTimeout(()=>{e=requestIdleCallback(t,{timeout:400})},100);return()=>e<0?clearTimeout(n):cancelIdleCallback(e)});const kS=typeof navigator<"u"&&(!((CS=navigator.scheduling)===null||CS===void 0)&&CS.isInputPending)?()=>navigator.scheduling.isInputPending():null,Q0e=tr.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(us.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(us.state);(n.tree!=n.context.tree||!n.context.isDone(e.doc.length))&&(this.working=xB(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:i}}=this.view,o=r.field(us.state);if(o.tree==o.context.tree&&o.context.isDone(i+1e5))return;let s=Date.now()+Math.min(this.chunkBudget,100,e&&!kS?Math.max(25,e.timeRemaining()-5):1e9),a=o.context.treeLen<i&&r.doc.length>i+1e3,l=o.context.work(()=>kS&&kS()||Date.now()>s,i+(a?0:1e5));this.chunkBudget-=Date.now()-n,(l||this.chunkBudget<=0)&&(o.context.takeTree(),this.view.dispatch({effects:us.setState.of(new gd(o.context))})),this.chunkBudget>0&&!(l&&!a)&&this.scheduleWork(),this.checkAsyncSchedule(o.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(n=>Do(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()}}}),nc=Je.define({combine(t){return t.length?t[0]:null},enables:t=>[us.state,Q0e,Ge.contentAttributes.compute([t],e=>{let n=e.facet(t);return n&&n.name?{"data-language":n.name}:{}})]});class J0e{constructor(e,n=[]){this.language=e,this.support=n,this.extension=[e,n]}}const ebe=Je.define(),E1=Je.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 tb(t){let e=t.facet(E1);return e.charCodeAt(0)==9?t.tabSize*e.length:e.length}function gm(t,e){let n="",r=t.tabSize,i=t.facet(E1)[0];if(i==" "){for(;e>=r;)n+=" ",e-=r;i=" "}for(let o=0;o<e;o++)n+=i;return n}function kT(t,e){t instanceof Ht&&(t=new _1(t));for(let r of t.state.facet(ebe)){let i=r(t,e);if(i!==void 0)return i}let n=Zr(t.state);return n.length>=e?tbe(t,n,e):null}class _1{constructor(e,n={}){this.state=e,this.options=n,this.unit=tb(e)}lineAt(e,n=1){let r=this.state.doc.lineAt(e),{simulateBreak:i,simulateDoubleBreak:o}=this.options;return i!=null&&i>=r.from&&i<=r.to?o&&i==e?{text:"",from:e}:(n<0?i<e:i<=e)?{text:r.text.slice(i-r.from),from:i}:{text:r.text.slice(0,i-r.from),from:r.from}:r}textAfterPos(e,n=1){if(this.options.simulateDoubleBreak&&e==this.options.simulateBreak)return"";let{text:r,from:i}=this.lineAt(e,n);return r.slice(e-i,Math.min(r.length,e+100-i))}column(e,n=1){let{text:r,from:i}=this.lineAt(e,n),o=this.countColumn(r,e-i),s=this.options.overrideIndentation?this.options.overrideIndentation(i):-1;return s>-1&&(o+=s-this.countColumn(r,r.search(/\S|$/))),o}countColumn(e,n=e.length){return zd(e,this.state.tabSize,n)}lineIndent(e,n=1){let{text:r,from:i}=this.lineAt(e,n),o=this.options.overrideIndentation;if(o){let s=o(i);if(s>-1)return s}return this.countColumn(r,r.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const SB=new $t;function tbe(t,e,n){let r=e.resolveStack(n),i=r.node.enterUnfinishedNodesBefore(n);if(i!=r.node){let o=[];for(let s=i;s!=r.node;s=s.parent)o.push(s);for(let s=o.length-1;s>=0;s--)r={node:o[s],next:r}}return CB(r,t,n)}function CB(t,e,n){for(let r=t;r;r=r.next){let i=rbe(r.node);if(i)return i(ET.create(e,n,r))}return 0}function nbe(t){return t.pos==t.options.simulateBreak&&t.options.simulateDoubleBreak}function rbe(t){let e=t.type.prop(SB);if(e)return e;let n=t.firstChild,r;if(n&&(r=n.type.prop($t.closedBy))){let i=t.lastChild,o=i&&r.indexOf(i.name)>-1;return s=>abe(s,!0,1,void 0,o&&!nbe(s)?i.from:void 0)}return t.parent==null?ibe:null}function ibe(){return 0}class ET extends _1{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 ET(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(obe(r,e))break;n=this.state.doc.lineAt(r.from)}return this.lineIndent(n.from)}continue(){return CB(this.context.next,this.base,this.pos)}}function obe(t,e){for(let n=e;n;n=n.parent)if(t==n)return!0;return!1}function sbe(t){let e=t.node,n=e.childAfter(e.from),r=e.lastChild;if(!n)return null;let i=t.options.simulateBreak,o=t.state.doc.lineAt(n.from),s=i==null||i<=o.from?o.to:Math.min(o.to,i);for(let a=n.to;;){let l=e.childAfter(a);if(!l||l==r)return null;if(!l.type.isSkipped)return l.from<s?n:null;a=l.to}}function abe(t,e,n,r,i){let o=t.textAfter,s=o.match(/^\s*/)[0].length,a=r&&o.slice(s,s+r.length)==r||i==t.pos+s,l=e?sbe(t):null;return l?a?t.column(l.from):t.column(l.to):t.baseIndent+(a?0:t.unit*n)}function CL({except:t,units:e=1}={}){return n=>{let r=t&&t.test(n.textAfter);return n.baseIndent+(r?0:e*n.unit)}}const lbe=200;function cbe(){return Ht.transactionFilter.of(t=>{if(!t.docChanged||!t.isUserEvent("input.type")&&!t.isUserEvent("input.complete"))return t;let e=t.startState.languageDataAt("indentOnInput",t.startState.selection.main.head);if(!e.length)return t;let n=t.newDoc,{head:r}=t.newSelection.main,i=n.lineAt(r);if(r>i.from+lbe)return t;let o=n.sliceString(i.from,r);if(!e.some(c=>c.test(o)))return t;let{state:s}=t,a=-1,l=[];for(let{head:c}of s.selection.ranges){let f=s.doc.lineAt(c);if(f.from==a)continue;a=f.from;let d=kT(s,f.from);if(d==null)continue;let p=/^\s*/.exec(f.text)[0],m=gm(s,d);p!=m&&l.push({from:f.from,to:f.from+p.length,insert:m})}return l.length?[t,{changes:l,sequential:!0}]:t})}const ube=Je.define(),kB=new $t;function fbe(t){let e=t.firstChild,n=t.lastChild;return e&&e.to<n.from?{from:e.to,to:n.type.isError?t.to:n.from}:null}function dbe(t,e,n){let r=Zr(t);if(r.length<n)return null;let i=r.resolveStack(n,1),o=null;for(let s=i;s;s=s.next){let a=s.node;if(a.to<=n||a.from>n)continue;if(o&&a.from<e)break;let l=a.type.prop(kB);if(l&&(a.to<r.length-50||r.length==t.doc.length||!hbe(a))){let c=l(a,t);c&&c.from<=n&&c.from>=e&&c.to>n&&(o=c)}}return o}function hbe(t){let e=t.lastChild;return e&&e.to==t.to&&e.type.isError}function nb(t,e,n){for(let r of t.facet(ube)){let i=r(t,e,n);if(i)return i}return dbe(t,e,n)}function EB(t,e){let n=e.mapPos(t.from,1),r=e.mapPos(t.to,-1);return n>=r?void 0:{from:n,to:r}}const T1=Ot.define({map:EB}),Hm=Ot.define({map:EB});function _B(t){let e=[];for(let{head:n}of t.state.selection.ranges)e.some(r=>r.from<=n&&r.to>=n)||e.push(t.lineBlockAt(n));return e}const bu=Fr.define({create(){return dt.none},update(t,e){t=t.map(e.changes);for(let n of e.effects)if(n.is(T1)&&!pbe(t,n.value.from,n.value.to)){let{preparePlaceholder:r}=e.state.facet(_T),i=r?dt.replace({widget:new xbe(r(e.state,n.value))}):kL;t=t.update({add:[i.range(n.value.from,n.value.to)]})}else n.is(Hm)&&(t=t.update({filter:(r,i)=>n.value.from!=r||n.value.to!=i,filterFrom:n.value.from,filterTo:n.value.to}));if(e.selection){let n=!1,{head:r}=e.selection.main;t.between(r,r,(i,o)=>{i<r&&o>r&&(n=!0)}),n&&(t=t.update({filterFrom:r,filterTo:r,filter:(i,o)=>o<=r||i>=r}))}return t},provide:t=>Ge.decorations.from(t),toJSON(t,e){let n=[];return t.between(0,e.doc.length,(r,i)=>{n.push(r,i)}),n},fromJSON(t){if(!Array.isArray(t)||t.length%2)throw new RangeError("Invalid JSON for fold state");let e=[];for(let n=0;n<t.length;){let r=t[n++],i=t[n++];if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid JSON for fold state");e.push(kL.range(r,i))}return dt.set(e,!0)}});function rb(t,e,n){var r;let i=null;return(r=t.field(bu,!1))===null||r===void 0||r.between(e,n,(o,s)=>{(!i||i.from>o)&&(i={from:o,to:s})}),i}function pbe(t,e,n){let r=!1;return t.between(e,e,(i,o)=>{i==e&&o==n&&(r=!0)}),r}function TB(t,e){return t.field(bu,!1)?e:e.concat(Ot.appendConfig.of(OB()))}const mbe=t=>{for(let e of _B(t)){let n=nb(t.state,e.from,e.to);if(n)return t.dispatch({effects:TB(t.state,[T1.of(n),AB(t,n)])}),!0}return!1},gbe=t=>{if(!t.state.field(bu,!1))return!1;let e=[];for(let n of _B(t)){let r=rb(t.state,n.from,n.to);r&&e.push(Hm.of(r),AB(t,r,!1))}return e.length&&t.dispatch({effects:e}),e.length>0};function AB(t,e,n=!0){let r=t.state.doc.lineAt(e.from).number,i=t.state.doc.lineAt(e.to).number;return Ge.announce.of(`${t.state.phrase(n?"Folded lines":"Unfolded lines")} ${r} ${t.state.phrase("to")} ${i}.`)}const vbe=t=>{let{state:e}=t,n=[];for(let r=0;r<e.doc.length;){let i=t.lineBlockAt(r),o=nb(e,i.from,i.to);o&&n.push(T1.of(o)),r=(o?t.lineBlockAt(o.to):i).to+1}return n.length&&t.dispatch({effects:TB(t.state,n)}),!!n.length},ybe=t=>{let e=t.state.field(bu,!1);if(!e||!e.size)return!1;let n=[];return e.between(0,t.state.doc.length,(r,i)=>{n.push(Hm.of({from:r,to:i}))}),t.dispatch({effects:n}),!0},bbe=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:mbe},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:gbe},{key:"Ctrl-Alt-[",run:vbe},{key:"Ctrl-Alt-]",run:ybe}],wbe={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},_T=Je.define({combine(t){return sa(t,wbe)}});function OB(t){let e=[bu,kbe];return t&&e.push(_T.of(t)),e}function RB(t,e){let{state:n}=t,r=n.facet(_T),i=s=>{let a=t.lineBlockAt(t.posAtDOM(s.target)),l=rb(t.state,a.from,a.to);l&&t.dispatch({effects:Hm.of(l)}),s.preventDefault()};if(r.placeholderDOM)return r.placeholderDOM(t,i,e);let o=document.createElement("span");return o.textContent=r.placeholderText,o.setAttribute("aria-label",n.phrase("folded code")),o.title=n.phrase("unfold"),o.className="cm-foldPlaceholder",o.onclick=i,o}const kL=dt.replace({widget:new class extends Ga{toDOM(t){return RB(t,null)}}});class xbe extends Ga{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return RB(e,this.value)}}const Sbe={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class ES extends Wa{constructor(e,n){super(),this.config=e,this.open=n}eq(e){return this.config==e.config&&this.open==e.open}toDOM(e){if(this.config.markerDOM)return this.config.markerDOM(this.open);let n=document.createElement("span");return n.textContent=this.open?this.config.openText:this.config.closedText,n.title=e.state.phrase(this.open?"Fold line":"Unfold line"),n}}function Cbe(t={}){let e=Object.assign(Object.assign({},Sbe),t),n=new ES(e,!0),r=new ES(e,!1),i=tr.fromClass(class{constructor(s){this.from=s.viewport.from,this.markers=this.buildMarkers(s)}update(s){(s.docChanged||s.viewportChanged||s.startState.facet(nc)!=s.state.facet(nc)||s.startState.field(bu,!1)!=s.state.field(bu,!1)||Zr(s.startState)!=Zr(s.state)||e.foldingChanged(s))&&(this.markers=this.buildMarkers(s.view))}buildMarkers(s){let a=new Ql;for(let l of s.viewportLineBlocks){let c=rb(s.state,l.from,l.to)?r:nb(s.state,l.from,l.to)?n:null;c&&a.add(l.from,l.from,c)}return a.finish()}}),{domEventHandlers:o}=e;return[i,B0e({class:"cm-foldGutter",markers(s){var a;return((a=s.plugin(i))===null||a===void 0?void 0:a.markers)||Gt.empty},initialSpacer(){return new ES(e,!1)},domEventHandlers:Object.assign(Object.assign({},o),{click:(s,a,l)=>{if(o.click&&o.click(s,a,l))return!0;let c=rb(s.state,a.from,a.to);if(c)return s.dispatch({effects:Hm.of(c)}),!0;let f=nb(s.state,a.from,a.to);return f?(s.dispatch({effects:T1.of(f)}),!0):!1}})}),OB()]}const kbe=Ge.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class qm{constructor(e,n){this.specs=e;let r;function i(a){let l=Jl.newName();return(r||(r=Object.create(null)))["."+l]=a,l}const o=typeof n.all=="string"?n.all:n.all?i(n.all):void 0,s=n.scope;this.scope=s instanceof us?a=>a.prop(Rf)==s.data:s?a=>a==s:void 0,this.style=Z9(e.map(a=>({tag:a.tag,class:a.class||i(Object.assign({},a,{tag:null}))})),{all:o}).style,this.module=r?new Jl(r):null,this.themeType=n.themeType}static define(e,n){return new qm(e,n||{})}}const lE=Je.define(),PB=Je.define({combine(t){return t.length?[t[0]]:null}});function _S(t){let e=t.facet(lE);return e.length?e:t.facet(PB)}function NB(t,e){let n=[_be],r;return t instanceof qm&&(t.module&&n.push(Ge.styleModule.of(t.module)),r=t.themeType),e!=null&&e.fallback?n.push(PB.of(t)):r?n.push(lE.computeN([Ge.darkTheme],i=>i.facet(Ge.darkTheme)==(r=="dark")?[t]:[])):n.push(lE.of(t)),n}class Ebe{constructor(e){this.markCache=Object.create(null),this.tree=Zr(e.state),this.decorations=this.buildDeco(e,_S(e.state)),this.decoratedTo=e.viewport.to}update(e){let n=Zr(e.state),r=_S(e.state),i=r!=_S(e.startState),{viewport:o}=e.view,s=e.changes.mapPos(this.decoratedTo,1);n.length<o.to&&!i&&n.type==this.tree.type&&s>=o.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=s):(n!=this.tree||e.viewportChanged||i)&&(this.tree=n,this.decorations=this.buildDeco(e.view,r),this.decoratedTo=o.to)}buildDeco(e,n){if(!n||!this.tree.length)return dt.none;let r=new Ql;for(let{from:i,to:o}of e.visibleRanges)Xge(this.tree,n,(s,a,l)=>{r.add(s,a,this.markCache[l]||(this.markCache[l]=dt.mark({class:l})))},i,o);return r.finish()}}const _be=Fd.high(tr.fromClass(Ebe,{decorations:t=>t.decorations})),Tbe=qm.define([{tag:me.meta,color:"#404740"},{tag:me.link,textDecoration:"underline"},{tag:me.heading,textDecoration:"underline",fontWeight:"bold"},{tag:me.emphasis,fontStyle:"italic"},{tag:me.strong,fontWeight:"bold"},{tag:me.strikethrough,textDecoration:"line-through"},{tag:me.keyword,color:"#708"},{tag:[me.atom,me.bool,me.url,me.contentSeparator,me.labelName],color:"#219"},{tag:[me.literal,me.inserted],color:"#164"},{tag:[me.string,me.deleted],color:"#a11"},{tag:[me.regexp,me.escape,me.special(me.string)],color:"#e40"},{tag:me.definition(me.variableName),color:"#00f"},{tag:me.local(me.variableName),color:"#30a"},{tag:[me.typeName,me.namespace],color:"#085"},{tag:me.className,color:"#167"},{tag:[me.special(me.variableName),me.macroName],color:"#256"},{tag:me.definition(me.propertyName),color:"#00c"},{tag:me.comment,color:"#940"},{tag:me.invalid,color:"#f00"}]),Abe=Ge.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),MB=1e4,DB="()[]{}",LB=Je.define({combine(t){return sa(t,{afterCursor:!0,brackets:DB,maxScanDistance:MB,renderMatch:Pbe})}}),Obe=dt.mark({class:"cm-matchingBracket"}),Rbe=dt.mark({class:"cm-nonmatchingBracket"});function Pbe(t){let e=[],n=t.matched?Obe:Rbe;return e.push(n.range(t.start.from,t.start.to)),t.end&&e.push(n.range(t.end.from,t.end.to)),e}const Nbe=Fr.define({create(){return dt.none},update(t,e){if(!e.docChanged&&!e.selection)return t;let n=[],r=e.state.facet(LB);for(let i of e.state.selection.ranges){if(!i.empty)continue;let o=Ws(e.state,i.head,-1,r)||i.head>0&&Ws(e.state,i.head-1,1,r)||r.afterCursor&&(Ws(e.state,i.head,1,r)||i.head<e.state.doc.length&&Ws(e.state,i.head+1,-1,r));o&&(n=n.concat(r.renderMatch(o,e.state)))}return dt.set(n,!0)},provide:t=>Ge.decorations.from(t)}),Mbe=[Nbe,Abe];function Dbe(t={}){return[LB.of(t),Mbe]}const Lbe=new $t;function cE(t,e,n){let r=t.prop(e<0?$t.openedBy:$t.closedBy);if(r)return r;if(t.name.length==1){let i=n.indexOf(t.name);if(i>-1&&i%2==(e<0?1:0))return[n[i+e]]}return null}function uE(t){let e=t.type.prop(Lbe);return e?e(t.node):t}function Ws(t,e,n,r={}){let i=r.maxScanDistance||MB,o=r.brackets||DB,s=Zr(t),a=s.resolveInner(e,n);for(let l=a;l;l=l.parent){let c=cE(l.type,n,o);if(c&&l.from<l.to){let f=uE(l);if(f&&(n>0?e>=f.from&&e<f.to:e>f.from&&e<=f.to))return $be(t,e,n,l,f,c,o)}}return Ibe(t,e,n,s,a.type,i,o)}function $be(t,e,n,r,i,o,s){let a=r.parent,l={from:i.from,to:i.to},c=0,f=a==null?void 0:a.cursor();if(f&&(n<0?f.childBefore(r.from):f.childAfter(r.to)))do if(n<0?f.to<=r.from:f.from>=r.to){if(c==0&&o.indexOf(f.type.name)>-1&&f.from<f.to){let d=uE(f);return{start:l,end:d?{from:d.from,to:d.to}:void 0,matched:!0}}else if(cE(f.type,n,s))c++;else if(cE(f.type,-n,s)){if(c==0){let d=uE(f);return{start:l,end:d&&d.from<d.to?{from:d.from,to:d.to}:void 0,matched:!1}}c--}}while(n<0?f.prevSibling():f.nextSibling());return{start:l,matched:!1}}function Ibe(t,e,n,r,i,o,s){let a=n<0?t.sliceDoc(e-1,e):t.sliceDoc(e,e+1),l=s.indexOf(a);if(l<0||l%2==0!=n>0)return null;let c={from:n<0?e-1:e,to:n>0?e+1:e},f=t.doc.iterRange(e,n>0?t.doc.length:0),d=0;for(let p=0;!f.next().done&&p<=o;){let m=f.value;n<0&&(p+=m.length);let v=e+p*n;for(let b=n>0?0:m.length-1,S=n>0?m.length:-1;b!=S;b+=n){let x=s.indexOf(m[b]);if(!(x<0||r.resolveInner(v+b,1).type!=i))if(x%2==0==n>0)d++;else{if(d==1)return{start:c,end:{from:v+b,to:v+b+1},matched:x>>1==l>>1};d--}}n>0&&(p+=m.length)}return f.done?{start:c,matched:!1}:null}const jbe=Object.create(null),EL=[Ni.none],_L=[],TL=Object.create(null),Bbe=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"]])Bbe[t]=Fbe(jbe,e);function TS(t,e){_L.indexOf(t)>-1||(_L.push(t),console.warn(e))}function Fbe(t,e){let n=[];for(let a of e.split(" ")){let l=[];for(let c of a.split(".")){let f=t[c]||me[c];f?typeof f=="function"?l.length?l=l.map(f):TS(c,`Modifier ${c} used at start of tag`):l.length?TS(c,`Tag ${c} used as modifier`):l=Array.isArray(f)?f:[f]:TS(c,`Unknown highlighting tag ${c}`)}for(let c of l)n.push(c)}if(!n.length)return 0;let r=e.replace(/ /g,"_"),i=r+" "+n.map(a=>a.id),o=TL[i];if(o)return o.id;let s=TL[i]=Ni.define({id:EL.length,name:r,props:[Y9({[r]:n})]});return EL.push(s),s.id}Rn.RTL,Rn.LTR;const zbe=J0.define({name:"json",parser:eve.configure({props:[SB.add({Object:CL({except:/^\s*\}/}),Array:CL({except:/^\s*\]/})}),kB.add({"Object Array":fbe})]}),languageData:{closeBrackets:{brackets:["[","{",'"']},indentOnInput:/^\s*[\}\]]$/}});function Vbe(){return new J0e(zbe)}const Ube=t=>{let{state:e}=t,n=e.doc.lineAt(e.selection.main.from),r=AT(t.state,n.from);return r.line?Wbe(t):r.block?qbe(t):!1};function TT(t,e){return({state:n,dispatch:r})=>{if(n.readOnly)return!1;let i=t(e,n);return i?(r(n.update(i)),!0):!1}}const Wbe=TT(Ybe,0),Hbe=TT($B,0),qbe=TT((t,e)=>$B(t,e,Gbe(e)),0);function AT(t,e){let n=t.languageDataAt("commentTokens",e);return n.length?n[0]:{}}const Dh=50;function Kbe(t,{open:e,close:n},r,i){let o=t.sliceDoc(r-Dh,r),s=t.sliceDoc(i,i+Dh),a=/\s*$/.exec(o)[0].length,l=/^\s*/.exec(s)[0].length,c=o.length-a;if(o.slice(c-e.length,c)==e&&s.slice(l,l+n.length)==n)return{open:{pos:r-a,margin:a&&1},close:{pos:i+l,margin:l&&1}};let f,d;i-r<=2*Dh?f=d=t.sliceDoc(r,i):(f=t.sliceDoc(r,r+Dh),d=t.sliceDoc(i-Dh,i));let p=/^\s*/.exec(f)[0].length,m=/\s*$/.exec(d)[0].length,v=d.length-m-n.length;return f.slice(p,p+e.length)==e&&d.slice(v,v+n.length)==n?{open:{pos:r+p+e.length,margin:/\s/.test(f.charAt(p+e.length))?1:0},close:{pos:i-m-n.length,margin:/\s/.test(d.charAt(v-1))?1:0}}:null}function Gbe(t){let e=[];for(let n of t.selection.ranges){let r=t.doc.lineAt(n.from),i=n.to<=r.to?r:t.doc.lineAt(n.to),o=e.length-1;o>=0&&e[o].to>r.from?e[o].to=i.to:e.push({from:r.from+/^\s*/.exec(r.text)[0].length,to:i.to})}return e}function $B(t,e,n=e.selection.ranges){let r=n.map(o=>AT(e,o.from).block);if(!r.every(o=>o))return null;let i=n.map((o,s)=>Kbe(e,r[s],o.from,o.to));if(t!=2&&!i.every(o=>o))return{changes:e.changes(n.map((o,s)=>i[s]?[]:[{from:o.from,insert:r[s].open+" "},{from:o.to,insert:" "+r[s].close}]))};if(t!=1&&i.some(o=>o)){let o=[];for(let s=0,a;s<i.length;s++)if(a=i[s]){let l=r[s],{open:c,close:f}=a;o.push({from:c.pos-l.open.length,to:c.pos+c.margin},{from:f.pos-f.margin,to:f.pos+l.close.length})}return{changes:o}}return null}function Ybe(t,e,n=e.selection.ranges){let r=[],i=-1;for(let{from:o,to:s}of n){let a=r.length,l=1e9,c=AT(e,o).line;if(c){for(let f=o;f<=s;){let d=e.doc.lineAt(f);if(d.from>i&&(o==s||s>d.from)){i=d.from;let p=/^\s*/.exec(d.text)[0].length,m=p==d.length,v=d.text.slice(p,p+c.length)==c?p:-1;p<d.text.length&&p<l&&(l=p),r.push({line:d,comment:v,token:c,indent:p,empty:m,single:!1})}f=d.to+1}if(l<1e9)for(let f=a;f<r.length;f++)r[f].indent<r[f].line.text.length&&(r[f].indent=l);r.length==a+1&&(r[a].single=!0)}}if(t!=2&&r.some(o=>o.comment<0&&(!o.empty||o.single))){let o=[];for(let{line:a,token:l,indent:c,empty:f,single:d}of r)(d||!f)&&o.push({from:a.from+c,insert:l+" "});let s=e.changes(o);return{changes:s,selection:e.selection.map(s,1)}}else if(t!=1&&r.some(o=>o.comment>=0)){let o=[];for(let{line:s,comment:a,token:l}of r)if(a>=0){let c=s.from+a,f=c+l.length;s.text[f-s.from]==" "&&f++,o.push({from:c,to:f})}return{changes:o}}return null}const fE=oa.define(),Xbe=oa.define(),Zbe=Je.define(),IB=Je.define({combine(t){return sa(t,{minDepth:100,newGroupDelay:500,joinToEvent:(e,n)=>n},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,n)=>(r,i)=>e(r,i)||n(r,i)})}}),jB=Fr.define({create(){return Hs.empty},update(t,e){let n=e.state.facet(IB),r=e.annotation(fE);if(r){let l=Ei.fromTransaction(e,r.selection),c=r.side,f=c==0?t.undone:t.done;return l?f=ib(f,f.length,n.minDepth,l):f=zB(f,e.startState.selection),new Hs(c==0?r.rest:f,c==0?f:r.rest)}let i=e.annotation(Xbe);if((i=="full"||i=="before")&&(t=t.isolate()),e.annotation(gr.addToHistory)===!1)return e.changes.empty?t:t.addMapping(e.changes.desc);let o=Ei.fromTransaction(e),s=e.annotation(gr.time),a=e.annotation(gr.userEvent);return o?t=t.addChanges(o,s,a,n,e):e.selection&&(t=t.addSelection(e.startState.selection,s,a,n.newGroupDelay)),(i=="full"||i=="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 Hs(t.done.map(Ei.fromJSON),t.undone.map(Ei.fromJSON))}});function Qbe(t={}){return[jB,IB.of(t),Ge.domEventHandlers({beforeinput(e,n){let r=e.inputType=="historyUndo"?BB:e.inputType=="historyRedo"?dE:null;return r?(e.preventDefault(),r(n)):!1}})]}function A1(t,e){return function({state:n,dispatch:r}){if(!e&&n.readOnly)return!1;let i=n.field(jB,!1);if(!i)return!1;let o=i.pop(t,n,e);return o?(r(o),!0):!1}}const BB=A1(0,!1),dE=A1(1,!1),Jbe=A1(0,!0),e1e=A1(1,!0);class Ei{constructor(e,n,r,i,o){this.changes=e,this.effects=n,this.mapped=r,this.startSelection=i,this.selectionsAfter=o}setSelAfter(e){return new Ei(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(i=>i.toJSON())}}static fromJSON(e){return new Ei(e.changes&&pr.fromJSON(e.changes),[],e.mapped&&Gs.fromJSON(e.mapped),e.startSelection&&be.fromJSON(e.startSelection),e.selectionsAfter.map(be.fromJSON))}static fromTransaction(e,n){let r=Po;for(let i of e.startState.facet(Zbe)){let o=i(e);o.length&&(r=r.concat(o))}return!r.length&&e.changes.empty?null:new Ei(e.changes.invert(e.startState.doc),r,void 0,n||e.startState.selection,Po)}static selection(e){return new Ei(void 0,Po,void 0,void 0,e)}}function ib(t,e,n,r){let i=e+1>n+20?e-n-1:0,o=t.slice(i,e);return o.push(r),o}function t1e(t,e){let n=[],r=!1;return t.iterChangedRanges((i,o)=>n.push(i,o)),e.iterChangedRanges((i,o,s,a)=>{for(let l=0;l<n.length;){let c=n[l++],f=n[l++];a>=c&&s<=f&&(r=!0)}}),r}function n1e(t,e){return t.ranges.length==e.ranges.length&&t.ranges.filter((n,r)=>n.empty!=e.ranges[r].empty).length===0}function FB(t,e){return t.length?e.length?t.concat(e):t:e}const Po=[],r1e=200;function zB(t,e){if(t.length){let n=t[t.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-r1e));return r.length&&r[r.length-1].eq(e)?t:(r.push(e),ib(t,t.length-1,1e9,n.setSelAfter(r)))}else return[Ei.selection([e])]}function i1e(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 AS(t,e){if(!t.length)return t;let n=t.length,r=Po;for(;n;){let i=o1e(t[n-1],e,r);if(i.changes&&!i.changes.empty||i.effects.length){let o=t.slice(0,n);return o[n-1]=i,o}else e=i.mapped,n--,r=i.selectionsAfter}return r.length?[Ei.selection(r)]:Po}function o1e(t,e,n){let r=FB(t.selectionsAfter.length?t.selectionsAfter.map(a=>a.map(e)):Po,n);if(!t.changes)return Ei.selection(r);let i=t.changes.map(e),o=e.mapDesc(t.changes,!0),s=t.mapped?t.mapped.composeDesc(o):o;return new Ei(i,Ot.mapEffects(t.effects,e),s,t.startSelection.map(o),r)}const s1e=/^(input\.type|delete)($|\.)/;class Hs{constructor(e,n,r=0,i=void 0){this.done=e,this.undone=n,this.prevTime=r,this.prevUserEvent=i}isolate(){return this.prevTime?new Hs(this.done,this.undone):this}addChanges(e,n,r,i,o){let s=this.done,a=s[s.length-1];return a&&a.changes&&!a.changes.empty&&e.changes&&(!r||s1e.test(r))&&(!a.selectionsAfter.length&&n-this.prevTime<i.newGroupDelay&&i.joinToEvent(o,t1e(a.changes,e.changes))||r=="input.type.compose")?s=ib(s,s.length-1,i.minDepth,new Ei(e.changes.compose(a.changes),FB(e.effects,a.effects),a.mapped,a.startSelection,Po)):s=ib(s,s.length,i.minDepth,e),new Hs(s,Po,n,r)}addSelection(e,n,r,i){let o=this.done.length?this.done[this.done.length-1].selectionsAfter:Po;return o.length>0&&n-this.prevTime<i&&r==this.prevUserEvent&&r&&/^select($|\.)/.test(r)&&n1e(o[o.length-1],e)?this:new Hs(zB(this.done,e),this.undone,n,r)}addMapping(e){return new Hs(AS(this.done,e),AS(this.undone,e),this.prevTime,this.prevUserEvent)}pop(e,n,r){let i=e==0?this.done:this.undone;if(i.length==0)return null;let o=i[i.length-1],s=o.selectionsAfter[0]||n.selection;if(r&&o.selectionsAfter.length)return n.update({selection:o.selectionsAfter[o.selectionsAfter.length-1],annotations:fE.of({side:e,rest:i1e(i),selection:s}),userEvent:e==0?"select.undo":"select.redo",scrollIntoView:!0});if(o.changes){let a=i.length==1?Po:i.slice(0,i.length-1);return o.mapped&&(a=AS(a,o.mapped)),n.update({changes:o.changes,selection:o.startSelection,effects:o.effects,annotations:fE.of({side:e,rest:a,selection:s}),filter:!1,userEvent:e==0?"undo":"redo",scrollIntoView:!0})}else return null}}Hs.empty=new Hs(Po,Po);const a1e=[{key:"Mod-z",run:BB,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:dE,preventDefault:!0},{linux:"Ctrl-Shift-z",run:dE,preventDefault:!0},{key:"Mod-u",run:Jbe,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:e1e,preventDefault:!0}];function Vd(t,e){return be.create(t.ranges.map(e),t.mainIndex)}function aa(t,e){return t.update({selection:e,scrollIntoView:!0,userEvent:"select"})}function Cs({state:t,dispatch:e},n){let r=Vd(t.selection,n);return r.eq(t.selection,!0)?!1:(e(aa(t,r)),!0)}function O1(t,e){return be.cursor(e?t.to:t.from)}function VB(t,e){return Cs(t,n=>n.empty?t.moveByChar(n,e):O1(n,e))}function Jr(t){return t.textDirectionAt(t.state.selection.main.head)==Rn.LTR}const UB=t=>VB(t,!Jr(t)),WB=t=>VB(t,Jr(t));function HB(t,e){return Cs(t,n=>n.empty?t.moveByGroup(n,e):O1(n,e))}const l1e=t=>HB(t,!Jr(t)),c1e=t=>HB(t,Jr(t));function u1e(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 R1(t,e,n){let r=Zr(t).resolveInner(e.head),i=n?$t.closedBy:$t.openedBy;for(let l=e.head;;){let c=n?r.childAfter(l):r.childBefore(l);if(!c)break;u1e(t,c,i)?r=c:l=n?c.to:c.from}let o=r.type.prop(i),s,a;return o&&(s=n?Ws(t,r.from,1):Ws(t,r.to,-1))&&s.matched?a=n?s.end.to:s.end.from:a=n?r.to:r.from,be.cursor(a,n?-1:1)}const f1e=t=>Cs(t,e=>R1(t.state,e,!Jr(t))),d1e=t=>Cs(t,e=>R1(t.state,e,Jr(t)));function qB(t,e){return Cs(t,n=>{if(!n.empty)return O1(n,e);let r=t.moveVertically(n,e);return r.head!=n.head?r:t.moveToLineBoundary(n,e)})}const KB=t=>qB(t,!1),GB=t=>qB(t,!0);function YB(t){let e=t.scrollDOM.clientHeight<t.scrollDOM.scrollHeight-2,n=0,r=0,i;if(e){for(let o of t.state.facet(Ge.scrollMargins)){let s=o(t);s!=null&&s.top&&(n=Math.max(s==null?void 0:s.top,n)),s!=null&&s.bottom&&(r=Math.max(s==null?void 0:s.bottom,r))}i=t.scrollDOM.clientHeight-n-r}else i=(t.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:n,marginBottom:r,selfScroll:e,height:Math.max(t.defaultLineHeight,i-5)}}function XB(t,e){let n=YB(t),{state:r}=t,i=Vd(r.selection,s=>s.empty?t.moveVertically(s,e,n.height):O1(s,e));if(i.eq(r.selection))return!1;let o;if(n.selfScroll){let s=t.coordsAtPos(r.selection.main.head),a=t.scrollDOM.getBoundingClientRect(),l=a.top+n.marginTop,c=a.bottom-n.marginBottom;s&&s.top>l&&s.bottom<c&&(o=Ge.scrollIntoView(i.main.head,{y:"start",yMargin:s.top-l}))}return t.dispatch(aa(r,i),{effects:o}),!0}const AL=t=>XB(t,!1),hE=t=>XB(t,!0);function cc(t,e,n){let r=t.lineBlockAt(e.head),i=t.moveToLineBoundary(e,n);if(i.head==e.head&&i.head!=(n?r.to:r.from)&&(i=t.moveToLineBoundary(e,n,!1)),!n&&i.head==r.from&&r.length){let o=/^\s*/.exec(t.state.sliceDoc(r.from,Math.min(r.from+100,r.to)))[0].length;o&&e.head!=r.from+o&&(i=be.cursor(r.from+o))}return i}const h1e=t=>Cs(t,e=>cc(t,e,!0)),p1e=t=>Cs(t,e=>cc(t,e,!1)),m1e=t=>Cs(t,e=>cc(t,e,!Jr(t))),g1e=t=>Cs(t,e=>cc(t,e,Jr(t))),v1e=t=>Cs(t,e=>be.cursor(t.lineBlockAt(e.head).from,1)),y1e=t=>Cs(t,e=>be.cursor(t.lineBlockAt(e.head).to,-1));function b1e(t,e,n){let r=!1,i=Vd(t.selection,o=>{let s=Ws(t,o.head,-1)||Ws(t,o.head,1)||o.head>0&&Ws(t,o.head-1,1)||o.head<t.doc.length&&Ws(t,o.head+1,-1);if(!s||!s.end)return o;r=!0;let a=s.start.from==o.head?s.end.to:s.end.from;return n?be.range(o.anchor,a):be.cursor(a)});return r?(e(aa(t,i)),!0):!1}const w1e=({state:t,dispatch:e})=>b1e(t,e,!1);function Uo(t,e){let n=Vd(t.state.selection,r=>{let i=e(r);return be.range(r.anchor,i.head,i.goalColumn,i.bidiLevel||void 0)});return n.eq(t.state.selection)?!1:(t.dispatch(aa(t.state,n)),!0)}function ZB(t,e){return Uo(t,n=>t.moveByChar(n,e))}const QB=t=>ZB(t,!Jr(t)),JB=t=>ZB(t,Jr(t));function eF(t,e){return Uo(t,n=>t.moveByGroup(n,e))}const x1e=t=>eF(t,!Jr(t)),S1e=t=>eF(t,Jr(t)),C1e=t=>Uo(t,e=>R1(t.state,e,!Jr(t))),k1e=t=>Uo(t,e=>R1(t.state,e,Jr(t)));function tF(t,e){return Uo(t,n=>t.moveVertically(n,e))}const nF=t=>tF(t,!1),rF=t=>tF(t,!0);function iF(t,e){return Uo(t,n=>t.moveVertically(n,e,YB(t).height))}const OL=t=>iF(t,!1),RL=t=>iF(t,!0),E1e=t=>Uo(t,e=>cc(t,e,!0)),_1e=t=>Uo(t,e=>cc(t,e,!1)),T1e=t=>Uo(t,e=>cc(t,e,!Jr(t))),A1e=t=>Uo(t,e=>cc(t,e,Jr(t))),O1e=t=>Uo(t,e=>be.cursor(t.lineBlockAt(e.head).from)),R1e=t=>Uo(t,e=>be.cursor(t.lineBlockAt(e.head).to)),PL=({state:t,dispatch:e})=>(e(aa(t,{anchor:0})),!0),NL=({state:t,dispatch:e})=>(e(aa(t,{anchor:t.doc.length})),!0),ML=({state:t,dispatch:e})=>(e(aa(t,{anchor:t.selection.main.anchor,head:0})),!0),DL=({state:t,dispatch:e})=>(e(aa(t,{anchor:t.selection.main.anchor,head:t.doc.length})),!0),P1e=({state:t,dispatch:e})=>(e(t.update({selection:{anchor:0,head:t.doc.length},userEvent:"select"})),!0),N1e=({state:t,dispatch:e})=>{let n=P1(t).map(({from:r,to:i})=>be.range(r,Math.min(i+1,t.doc.length)));return e(t.update({selection:be.create(n),userEvent:"select"})),!0},M1e=({state:t,dispatch:e})=>{let n=Vd(t.selection,r=>{var i;let o=Zr(t).resolveStack(r.from,1);for(let s=o;s;s=s.next){let{node:a}=s;if((a.from<r.from&&a.to>=r.to||a.to>r.to&&a.from<=r.from)&&(!((i=a.parent)===null||i===void 0)&&i.parent))return be.range(a.to,a.from)}return r});return e(aa(t,n)),!0},D1e=({state:t,dispatch:e})=>{let n=t.selection,r=null;return n.ranges.length>1?r=be.create([n.main]):n.main.empty||(r=be.create([be.cursor(n.main.head)])),r?(e(aa(t,r)),!0):!1};function Km(t,e){if(t.state.readOnly)return!1;let n="delete.selection",{state:r}=t,i=r.changeByRange(o=>{let{from:s,to:a}=o;if(s==a){let l=e(o);l<s?(n="delete.backward",l=$v(t,l,!1)):l>s&&(n="delete.forward",l=$v(t,l,!0)),s=Math.min(s,l),a=Math.max(a,l)}else s=$v(t,s,!1),a=$v(t,a,!0);return s==a?{range:o}:{changes:{from:s,to:a},range:be.cursor(s,s<o.head?-1:1)}});return i.changes.empty?!1:(t.dispatch(r.update(i,{scrollIntoView:!0,userEvent:n,effects:n=="delete.selection"?Ge.announce.of(r.phrase("Selection deleted")):void 0})),!0)}function $v(t,e,n){if(t instanceof Ge)for(let r of t.state.facet(Ge.atomicRanges).map(i=>i(t)))r.between(e,e,(i,o)=>{i<e&&o>e&&(e=n?o:i)});return e}const oF=(t,e)=>Km(t,n=>{let r=n.from,{state:i}=t,o=i.doc.lineAt(r),s,a;if(!e&&r>o.from&&r<o.from+200&&!/[^ \t]/.test(s=o.text.slice(0,r-o.from))){if(s[s.length-1]==" ")return r-1;let l=zd(s,i.tabSize),c=l%tb(i)||tb(i);for(let f=0;f<c&&s[s.length-1-f]==" ";f++)r--;a=r}else a=$r(o.text,r-o.from,e,e)+o.from,a==r&&o.number!=(e?i.doc.lines:1)?a+=e?1:-1:!e&&/[\ufe00-\ufe0f]/.test(o.text.slice(a-o.from,r-o.from))&&(a=$r(o.text,a-o.from,!1,!1)+o.from);return a}),pE=t=>oF(t,!1),sF=t=>oF(t,!0),aF=(t,e)=>Km(t,n=>{let r=n.head,{state:i}=t,o=i.doc.lineAt(r),s=i.charCategorizer(r);for(let a=null;;){if(r==(e?o.to:o.from)){r==n.head&&o.number!=(e?i.doc.lines:1)&&(r+=e?1:-1);break}let l=$r(o.text,r-o.from,e)+o.from,c=o.text.slice(Math.min(r,l)-o.from,Math.max(r,l)-o.from),f=s(c);if(a!=null&&f!=a)break;(c!=" "||r!=n.head)&&(a=f),r=l}return r}),lF=t=>aF(t,!1),L1e=t=>aF(t,!0),$1e=t=>Km(t,e=>{let n=t.lineBlockAt(e.head).to;return e.head<n?n:Math.min(t.state.doc.length,e.head+1)}),I1e=t=>Km(t,e=>{let n=t.moveToLineBoundary(e,!1).head;return e.head>n?n:Math.max(0,e.head-1)}),j1e=t=>Km(t,e=>{let n=t.moveToLineBoundary(e,!0).head;return e.head<n?n:Math.min(t.state.doc.length,e.head+1)}),B1e=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=t.changeByRange(r=>({changes:{from:r.from,to:r.to,insert:tn.of(["",""])},range:be.cursor(r.from)}));return e(t.update(n,{scrollIntoView:!0,userEvent:"input"})),!0},F1e=({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 i=r.from,o=t.doc.lineAt(i),s=i==o.from?i-1:$r(o.text,i-o.from,!1)+o.from,a=i==o.to?i+1:$r(o.text,i-o.from,!0)+o.from;return{changes:{from:s,to:a,insert:t.doc.slice(i,a).append(t.doc.slice(s,i))},range:be.cursor(a)}});return n.changes.empty?!1:(e(t.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function P1(t){let e=[],n=-1;for(let r of t.selection.ranges){let i=t.doc.lineAt(r.from),o=t.doc.lineAt(r.to);if(!r.empty&&r.to==o.from&&(o=t.doc.lineAt(r.to-1)),n>=i.number){let s=e[e.length-1];s.to=o.to,s.ranges.push(r)}else e.push({from:i.from,to:o.to,ranges:[r]});n=o.number+1}return e}function cF(t,e,n){if(t.readOnly)return!1;let r=[],i=[];for(let o of P1(t)){if(n?o.to==t.doc.length:o.from==0)continue;let s=t.doc.lineAt(n?o.to+1:o.from-1),a=s.length+1;if(n){r.push({from:o.to,to:s.to},{from:o.from,insert:s.text+t.lineBreak});for(let l of o.ranges)i.push(be.range(Math.min(t.doc.length,l.anchor+a),Math.min(t.doc.length,l.head+a)))}else{r.push({from:s.from,to:o.from},{from:o.to,insert:t.lineBreak+s.text});for(let l of o.ranges)i.push(be.range(l.anchor-a,l.head-a))}}return r.length?(e(t.update({changes:r,scrollIntoView:!0,selection:be.create(i,t.selection.mainIndex),userEvent:"move.line"})),!0):!1}const z1e=({state:t,dispatch:e})=>cF(t,e,!1),V1e=({state:t,dispatch:e})=>cF(t,e,!0);function uF(t,e,n){if(t.readOnly)return!1;let r=[];for(let i of P1(t))n?r.push({from:i.from,insert:t.doc.slice(i.from,i.to)+t.lineBreak}):r.push({from:i.to,insert:t.lineBreak+t.doc.slice(i.from,i.to)});return e(t.update({changes:r,scrollIntoView:!0,userEvent:"input.copyline"})),!0}const U1e=({state:t,dispatch:e})=>uF(t,e,!1),W1e=({state:t,dispatch:e})=>uF(t,e,!0),H1e=t=>{if(t.state.readOnly)return!1;let{state:e}=t,n=e.changes(P1(e).map(({from:i,to:o})=>(i>0?i--:o<e.doc.length&&o++,{from:i,to:o}))),r=Vd(e.selection,i=>t.moveVertically(i,!0)).map(n);return t.dispatch({changes:n,selection:r,scrollIntoView:!0,userEvent:"delete.line"}),!0};function q1e(t,e){if(/\(\)|\[\]|\{\}/.test(t.sliceDoc(e-1,e+1)))return{from:e,to:e};let n=Zr(t).resolveInner(e),r=n.childBefore(e),i=n.childAfter(e),o;return r&&i&&r.to<=e&&i.from>=e&&(o=r.type.prop($t.closedBy))&&o.indexOf(i.name)>-1&&t.doc.lineAt(r.to).from==t.doc.lineAt(i.from).from&&!/\S/.test(t.sliceDoc(r.to,i.from))?{from:r.to,to:i.from}:null}const K1e=fF(!1),G1e=fF(!0);function fF(t){return({state:e,dispatch:n})=>{if(e.readOnly)return!1;let r=e.changeByRange(i=>{let{from:o,to:s}=i,a=e.doc.lineAt(o),l=!t&&o==s&&q1e(e,o);t&&(o=s=(s<=a.to?a:e.doc.lineAt(s)).to);let c=new _1(e,{simulateBreak:o,simulateDoubleBreak:!!l}),f=kT(c,o);for(f==null&&(f=zd(/^\s*/.exec(e.doc.lineAt(o).text)[0],e.tabSize));s<a.to&&/\s/.test(a.text[s-a.from]);)s++;l?{from:o,to:s}=l:o>a.from&&o<a.from+100&&!/\S/.test(a.text.slice(0,o))&&(o=a.from);let d=["",gm(e,f)];return l&&d.push(gm(e,c.lineIndent(a.from,-1))),{changes:{from:o,to:s,insert:tn.of(d)},range:be.cursor(o+1+d[1].length)}});return n(e.update(r,{scrollIntoView:!0,userEvent:"input"})),!0}}function OT(t,e){let n=-1;return t.changeByRange(r=>{let i=[];for(let s=r.from;s<=r.to;){let a=t.doc.lineAt(s);a.number>n&&(r.empty||r.to>a.from)&&(e(a,i,r),n=a.number),s=a.to+1}let o=t.changes(i);return{changes:i,range:be.range(o.mapPos(r.anchor,1),o.mapPos(r.head,1))}})}const Y1e=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=Object.create(null),r=new _1(t,{overrideIndentation:o=>{let s=n[o];return s??-1}}),i=OT(t,(o,s,a)=>{let l=kT(r,o.from);if(l==null)return;/\S/.test(o.text)||(l=0);let c=/^\s*/.exec(o.text)[0],f=gm(t,l);(c!=f||a.from<o.from+c.length)&&(n[o.from]=l,s.push({from:o.from,to:o.from+c.length,insert:f}))});return i.changes.empty||e(t.update(i,{userEvent:"indent"})),!0},dF=({state:t,dispatch:e})=>t.readOnly?!1:(e(t.update(OT(t,(n,r)=>{r.push({from:n.from,insert:t.facet(E1)})}),{userEvent:"input.indent"})),!0),hF=({state:t,dispatch:e})=>t.readOnly?!1:(e(t.update(OT(t,(n,r)=>{let i=/^\s*/.exec(n.text)[0];if(!i)return;let o=zd(i,t.tabSize),s=0,a=gm(t,Math.max(0,o-tb(t)));for(;s<i.length&&s<a.length&&i.charCodeAt(s)==a.charCodeAt(s);)s++;r.push({from:n.from+s,to:n.from+i.length,insert:a.slice(s)})}),{userEvent:"delete.dedent"})),!0),X1e=[{key:"Ctrl-b",run:UB,shift:QB,preventDefault:!0},{key:"Ctrl-f",run:WB,shift:JB},{key:"Ctrl-p",run:KB,shift:nF},{key:"Ctrl-n",run:GB,shift:rF},{key:"Ctrl-a",run:v1e,shift:O1e},{key:"Ctrl-e",run:y1e,shift:R1e},{key:"Ctrl-d",run:sF},{key:"Ctrl-h",run:pE},{key:"Ctrl-k",run:$1e},{key:"Ctrl-Alt-h",run:lF},{key:"Ctrl-o",run:B1e},{key:"Ctrl-t",run:F1e},{key:"Ctrl-v",run:hE}],Z1e=[{key:"ArrowLeft",run:UB,shift:QB,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:l1e,shift:x1e,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:m1e,shift:T1e,preventDefault:!0},{key:"ArrowRight",run:WB,shift:JB,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:c1e,shift:S1e,preventDefault:!0},{mac:"Cmd-ArrowRight",run:g1e,shift:A1e,preventDefault:!0},{key:"ArrowUp",run:KB,shift:nF,preventDefault:!0},{mac:"Cmd-ArrowUp",run:PL,shift:ML},{mac:"Ctrl-ArrowUp",run:AL,shift:OL},{key:"ArrowDown",run:GB,shift:rF,preventDefault:!0},{mac:"Cmd-ArrowDown",run:NL,shift:DL},{mac:"Ctrl-ArrowDown",run:hE,shift:RL},{key:"PageUp",run:AL,shift:OL},{key:"PageDown",run:hE,shift:RL},{key:"Home",run:p1e,shift:_1e,preventDefault:!0},{key:"Mod-Home",run:PL,shift:ML},{key:"End",run:h1e,shift:E1e,preventDefault:!0},{key:"Mod-End",run:NL,shift:DL},{key:"Enter",run:K1e},{key:"Mod-a",run:P1e},{key:"Backspace",run:pE,shift:pE},{key:"Delete",run:sF},{key:"Mod-Backspace",mac:"Alt-Backspace",run:lF},{key:"Mod-Delete",mac:"Alt-Delete",run:L1e},{mac:"Mod-Backspace",run:I1e},{mac:"Mod-Delete",run:j1e}].concat(X1e.map(t=>({mac:t.key,run:t.run,shift:t.shift}))),Q1e=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:f1e,shift:C1e},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:d1e,shift:k1e},{key:"Alt-ArrowUp",run:z1e},{key:"Shift-Alt-ArrowUp",run:U1e},{key:"Alt-ArrowDown",run:V1e},{key:"Shift-Alt-ArrowDown",run:W1e},{key:"Escape",run:D1e},{key:"Mod-Enter",run:G1e},{key:"Alt-l",mac:"Ctrl-l",run:N1e},{key:"Mod-i",run:M1e,preventDefault:!0},{key:"Mod-[",run:hF},{key:"Mod-]",run:dF},{key:"Mod-Alt-\\",run:Y1e},{key:"Shift-Mod-k",run:H1e},{key:"Shift-Mod-\\",run:w1e},{key:"Mod-/",run:Ube},{key:"Alt-A",run:Hbe}].concat(Z1e),J1e={key:"Tab",run:dF,shift:hF};function bn(){var t=arguments[0];typeof t=="string"&&(t=document.createElement(t));var e=1,n=arguments[1];if(n&&typeof n=="object"&&n.nodeType==null&&!Array.isArray(n)){for(var r in n)if(Object.prototype.hasOwnProperty.call(n,r)){var i=n[r];typeof i=="string"?t.setAttribute(r,i):i!=null&&(t[r]=i)}e++}for(;e<arguments.length;e++)pF(t,arguments[e]);return t}function pF(t,e){if(typeof e=="string")t.appendChild(document.createTextNode(e));else if(e!=null)if(e.nodeType!=null)t.appendChild(e);else if(Array.isArray(e))for(var n=0;n<e.length;n++)pF(t,e[n]);else throw new RangeError("Unsupported child node: "+e)}const LL=typeof String.prototype.normalize=="function"?t=>t.normalize("NFKD"):t=>t;class vd{constructor(e,n,r=0,i=e.length,o,s){this.test=s,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(r,i),this.bufferStart=r,this.normalize=o?a=>o(LL(a)):LL,this.query=this.normalize(n)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return Mr(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let n=dT(e),r=this.bufferStart+this.bufferPos;this.bufferPos+=Oo(e);let i=this.normalize(n);for(let o=0,s=r;;o++){let a=i.charCodeAt(o),l=this.match(a,s,this.bufferPos+this.bufferStart);if(o==i.length-1){if(l)return this.value=l,this;break}s==r&&o<n.length&&n.charCodeAt(o)==a&&s++}}}match(e,n,r){let i=null;for(let o=0;o<this.matches.length;o+=2){let s=this.matches[o],a=!1;this.query.charCodeAt(s)==e&&(s==this.query.length-1?i={from:this.matches[o+1],to:r}:(this.matches[o]++,a=!0)),a||(this.matches.splice(o,2),o-=2)}return this.query.charCodeAt(0)==e&&(this.query.length==1?i={from:n,to:r}:this.matches.push(1,n)),i&&this.test&&!this.test(i.from,i.to,this.buffer,this.bufferStart)&&(i=null),i}}typeof Symbol<"u"&&(vd.prototype[Symbol.iterator]=function(){return this});const mF={from:-1,to:-1,match:/.*/.exec("")},RT="gm"+(/x/.unicode==null?"":"u");class gF{constructor(e,n,r,i=0,o=e.length){if(this.text=e,this.to=o,this.curLine="",this.done=!1,this.value=mF,/\\[sWDnr]|\n|\r|\[\^/.test(n))return new vF(e,n,r,i,o);this.re=new RegExp(n,RT+(r!=null&&r.ignoreCase?"i":"")),this.test=r==null?void 0:r.test,this.iter=e.iter();let s=e.lineAt(i);this.curLineStart=s.from,this.matchPos=ob(e,i),this.getLine(this.curLineStart)}getLine(e){this.iter.next(e),this.iter.lineBreak?this.curLine="":(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let n=this.matchPos<=this.to&&this.re.exec(this.curLine);if(n){let r=this.curLineStart+n.index,i=r+n[0].length;if(this.matchPos=ob(this.text,i+(r==i?1:0)),r==this.curLineStart+this.curLine.length&&this.nextLine(),(r<i||r>this.value.to)&&(!this.test||this.test(r,i,n)))return this.value={from:r,to:i,match:n},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length<this.to)this.nextLine(),e=0;else return this.done=!0,this}}}const OS=new WeakMap;class Gf{constructor(e,n){this.from=e,this.text=n}get to(){return this.from+this.text.length}static get(e,n,r){let i=OS.get(e);if(!i||i.from>=r||i.to<=n){let a=new Gf(n,e.sliceString(n,r));return OS.set(e,a),a}if(i.from==n&&i.to==r)return i;let{text:o,from:s}=i;return s>n&&(o=e.sliceString(n,s)+o,s=n),i.to<r&&(o+=e.sliceString(i.to,r)),OS.set(e,new Gf(s,o)),new Gf(n,o.slice(n-s,r-s))}}class vF{constructor(e,n,r,i,o){this.text=e,this.to=o,this.done=!1,this.value=mF,this.matchPos=ob(e,i),this.re=new RegExp(n,RT+(r!=null&&r.ignoreCase?"i":"")),this.test=r==null?void 0:r.test,this.flat=Gf.get(e,i,this.chunkEnd(i+5e3))}chunkEnd(e){return e>=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,n=this.re.exec(this.flat.text);if(n&&!n[0]&&n.index==e&&(this.re.lastIndex=e+1,n=this.re.exec(this.flat.text)),n){let r=this.flat.from+n.index,i=r+n[0].length;if((this.flat.to>=this.to||n.index+n[0].length<=this.flat.text.length-10)&&(!this.test||this.test(r,i,n)))return this.value={from:r,to:i,match:n},this.matchPos=ob(this.text,i+(r==i?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=Gf.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(gF.prototype[Symbol.iterator]=vF.prototype[Symbol.iterator]=function(){return this});function ewe(t){try{return new RegExp(t,RT),!0}catch{return!1}}function ob(t,e){if(e>=t.length)return e;let n=t.lineAt(e),r;for(;e<n.to&&(r=n.text.charCodeAt(e-n.from))>=56320&&r<57344;)e++;return e}function mE(t){let e=String(t.state.doc.lineAt(t.state.selection.main.head).number),n=bn("input",{class:"cm-textfield",name:"line",value:e}),r=bn("form",{class:"cm-gotoLine",onkeydown:o=>{o.keyCode==27?(o.preventDefault(),t.dispatch({effects:sb.of(!1)}),t.focus()):o.keyCode==13&&(o.preventDefault(),i())},onsubmit:o=>{o.preventDefault(),i()}},bn("label",t.state.phrase("Go to line"),": ",n)," ",bn("button",{class:"cm-button",type:"submit"},t.state.phrase("go")));function i(){let o=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(n.value);if(!o)return;let{state:s}=t,a=s.doc.lineAt(s.selection.main.head),[,l,c,f,d]=o,p=f?+f.slice(1):0,m=c?+c:a.number;if(c&&d){let S=m/100;l&&(S=S*(l=="-"?-1:1)+a.number/s.doc.lines),m=Math.round(s.doc.lines*S)}else c&&l&&(m=m*(l=="-"?-1:1)+a.number);let v=s.doc.line(Math.max(1,Math.min(s.doc.lines,m))),b=be.cursor(v.from+Math.max(0,Math.min(p,v.length)));t.dispatch({effects:[sb.of(!1),Ge.scrollIntoView(b.from,{y:"center"})],selection:b}),t.focus()}return{dom:r}}const sb=Ot.define(),$L=Fr.define({create(){return!0},update(t,e){for(let n of e.effects)n.is(sb)&&(t=n.value);return t},provide:t=>mm.from(t,e=>e?mE:null)}),twe=t=>{let e=pm(t,mE);if(!e){let n=[sb.of(!0)];t.state.field($L,!1)==null&&n.push(Ot.appendConfig.of([$L,nwe])),t.dispatch({effects:n}),e=pm(t,mE)}return e&&e.dom.querySelector("input").select(),!0},nwe=Ge.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px","& label":{fontSize:"80%"}}}),rwe={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},yF=Je.define({combine(t){return sa(t,rwe,{highlightWordAroundCursor:(e,n)=>e||n,minSelectionLength:Math.min,maxMatches:Math.min})}});function iwe(t){let e=[cwe,lwe];return t&&e.push(yF.of(t)),e}const owe=dt.mark({class:"cm-selectionMatch"}),swe=dt.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function IL(t,e,n,r){return(n==0||t(e.sliceDoc(n-1,n))!=Ln.Word)&&(r==e.doc.length||t(e.sliceDoc(r,r+1))!=Ln.Word)}function awe(t,e,n,r){return t(e.sliceDoc(n,n+1))==Ln.Word&&t(e.sliceDoc(r-1,r))==Ln.Word}const lwe=tr.fromClass(class{constructor(t){this.decorations=this.getDeco(t)}update(t){(t.selectionSet||t.docChanged||t.viewportChanged)&&(this.decorations=this.getDeco(t.view))}getDeco(t){let e=t.state.facet(yF),{state:n}=t,r=n.selection;if(r.ranges.length>1)return dt.none;let i=r.main,o,s=null;if(i.empty){if(!e.highlightWordAroundCursor)return dt.none;let l=n.wordAt(i.head);if(!l)return dt.none;s=n.charCategorizer(i.head),o=n.sliceDoc(l.from,l.to)}else{let l=i.to-i.from;if(l<e.minSelectionLength||l>200)return dt.none;if(e.wholeWords){if(o=n.sliceDoc(i.from,i.to),s=n.charCategorizer(i.head),!(IL(s,n,i.from,i.to)&&awe(s,n,i.from,i.to)))return dt.none}else if(o=n.sliceDoc(i.from,i.to),!o)return dt.none}let a=[];for(let l of t.visibleRanges){let c=new vd(n.doc,o,l.from,l.to);for(;!c.next().done;){let{from:f,to:d}=c.value;if((!s||IL(s,n,f,d))&&(i.empty&&f<=i.from&&d>=i.to?a.push(swe.range(f,d)):(f>=i.to||d<=i.from)&&a.push(owe.range(f,d)),a.length>e.maxMatches))return dt.none}}return dt.set(a)}},{decorations:t=>t.decorations}),cwe=Ge.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),uwe=({state:t,dispatch:e})=>{let{selection:n}=t,r=be.create(n.ranges.map(i=>t.wordAt(i.head)||be.cursor(i.head)),n.mainIndex);return r.eq(n)?!1:(e(t.update({selection:r})),!0)};function fwe(t,e){let{main:n,ranges:r}=t.selection,i=t.wordAt(n.head),o=i&&i.from==n.from&&i.to==n.to;for(let s=!1,a=new vd(t.doc,e,r[r.length-1].to);;)if(a.next(),a.done){if(s)return null;a=new vd(t.doc,e,0,Math.max(0,r[r.length-1].from-1)),s=!0}else{if(s&&r.some(l=>l.from==a.value.from))continue;if(o){let l=t.wordAt(a.value.from);if(!l||l.from!=a.value.from||l.to!=a.value.to)continue}return a.value}}const dwe=({state:t,dispatch:e})=>{let{ranges:n}=t.selection;if(n.some(o=>o.from===o.to))return uwe({state:t,dispatch:e});let r=t.sliceDoc(n[0].from,n[0].to);if(t.selection.ranges.some(o=>t.sliceDoc(o.from,o.to)!=r))return!1;let i=fwe(t,r);return i?(e(t.update({selection:t.selection.addRange(be.range(i.from,i.to),!1),effects:Ge.scrollIntoView(i.to)})),!0):!1},Ud=Je.define({combine(t){return sa(t,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new kwe(e),scrollToMatch:e=>Ge.scrollIntoView(e)})}});class bF{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||"",this.valid=!!this.search&&(!this.regexp||ewe(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(n,r)=>r=="n"?`
219
+ `:r=="r"?"\r":r=="t"?" ":"\\")}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord}create(){return this.regexp?new gwe(this):new pwe(this)}getCursor(e,n=0,r){let i=e.doc?e:Ht.create({doc:e});return r==null&&(r=i.doc.length),this.regexp?cf(this,i,n,r):lf(this,i,n,r)}}class wF{constructor(e){this.spec=e}}function lf(t,e,n,r){return new vd(e.doc,t.unquoted,n,r,t.caseSensitive?void 0:i=>i.toLowerCase(),t.wholeWord?hwe(e.doc,e.charCategorizer(e.selection.main.head)):void 0)}function hwe(t,e){return(n,r,i,o)=>((o>n||o+i.length<r)&&(o=Math.max(0,n-2),i=t.sliceString(o,Math.min(t.length,r+2))),(e(ab(i,n-o))!=Ln.Word||e(lb(i,n-o))!=Ln.Word)&&(e(lb(i,r-o))!=Ln.Word||e(ab(i,r-o))!=Ln.Word))}class pwe extends wF{constructor(e){super(e)}nextMatch(e,n,r){let i=lf(this.spec,e,r,e.doc.length).nextOverlapping();return i.done&&(i=lf(this.spec,e,0,n).nextOverlapping()),i.done?null:i.value}prevMatchInRange(e,n,r){for(let i=r;;){let o=Math.max(n,i-1e4-this.spec.unquoted.length),s=lf(this.spec,e,o,i),a=null;for(;!s.nextOverlapping().done;)a=s.value;if(a)return a;if(o==n)return null;i-=1e4}}prevMatch(e,n,r){return this.prevMatchInRange(e,0,n)||this.prevMatchInRange(e,r,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace)}matchAll(e,n){let r=lf(this.spec,e,0,e.doc.length),i=[];for(;!r.next().done;){if(i.length>=n)return null;i.push(r.value)}return i}highlight(e,n,r,i){let o=lf(this.spec,e,Math.max(0,n-this.spec.unquoted.length),Math.min(r+this.spec.unquoted.length,e.doc.length));for(;!o.next().done;)i(o.value.from,o.value.to)}}function cf(t,e,n,r){return new gF(e.doc,t.search,{ignoreCase:!t.caseSensitive,test:t.wholeWord?mwe(e.charCategorizer(e.selection.main.head)):void 0},n,r)}function ab(t,e){return t.slice($r(t,e,!1),e)}function lb(t,e){return t.slice(e,$r(t,e))}function mwe(t){return(e,n,r)=>!r[0].length||(t(ab(r.input,r.index))!=Ln.Word||t(lb(r.input,r.index))!=Ln.Word)&&(t(lb(r.input,r.index+r[0].length))!=Ln.Word||t(ab(r.input,r.index+r[0].length))!=Ln.Word)}class gwe extends wF{nextMatch(e,n,r){let i=cf(this.spec,e,r,e.doc.length).next();return i.done&&(i=cf(this.spec,e,0,n).next()),i.done?null:i.value}prevMatchInRange(e,n,r){for(let i=1;;i++){let o=Math.max(n,r-i*1e4),s=cf(this.spec,e,o,r),a=null;for(;!s.next().done;)a=s.value;if(a&&(o==n||a.from>o+10))return a;if(o==n)return null}}prevMatch(e,n,r){return this.prevMatchInRange(e,0,n)||this.prevMatchInRange(e,r,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&\d+])/g,(n,r)=>r=="$"?"$":r=="&"?e.match[0]:r!="0"&&+r<e.match.length?e.match[r]:n)}matchAll(e,n){let r=cf(this.spec,e,0,e.doc.length),i=[];for(;!r.next().done;){if(i.length>=n)return null;i.push(r.value)}return i}highlight(e,n,r,i){let o=cf(this.spec,e,Math.max(0,n-250),Math.min(r+250,e.doc.length));for(;!o.next().done;)i(o.value.from,o.value.to)}}const vm=Ot.define(),PT=Ot.define(),Fl=Fr.define({create(t){return new RS(gE(t).create(),null)},update(t,e){for(let n of e.effects)n.is(vm)?t=new RS(n.value.create(),t.panel):n.is(PT)&&(t=new RS(t.query,n.value?NT:null));return t},provide:t=>mm.from(t,e=>e.panel)});class RS{constructor(e,n){this.query=e,this.panel=n}}const vwe=dt.mark({class:"cm-searchMatch"}),ywe=dt.mark({class:"cm-searchMatch cm-searchMatch-selected"}),bwe=tr.fromClass(class{constructor(t){this.view=t,this.decorations=this.highlight(t.state.field(Fl))}update(t){let e=t.state.field(Fl);(e!=t.startState.field(Fl)||t.docChanged||t.selectionSet||t.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:t,panel:e}){if(!e||!t.spec.valid)return dt.none;let{view:n}=this,r=new Ql;for(let i=0,o=n.visibleRanges,s=o.length;i<s;i++){let{from:a,to:l}=o[i];for(;i<s-1&&l>o[i+1].from-2*250;)l=o[++i].to;t.highlight(n.state,a,l,(c,f)=>{let d=n.state.selection.ranges.some(p=>p.from==c&&p.to==f);r.add(c,f,d?ywe:vwe)})}return r.finish()}},{decorations:t=>t.decorations});function Gm(t){return e=>{let n=e.state.field(Fl,!1);return n&&n.query.spec.valid?t(e,n):CF(e)}}const cb=Gm((t,{query:e})=>{let{to:n}=t.state.selection.main,r=e.nextMatch(t.state,n,n);if(!r)return!1;let i=be.single(r.from,r.to),o=t.state.facet(Ud);return t.dispatch({selection:i,effects:[MT(t,r),o.scrollToMatch(i.main,t)],userEvent:"select.search"}),SF(t),!0}),ub=Gm((t,{query:e})=>{let{state:n}=t,{from:r}=n.selection.main,i=e.prevMatch(n,r,r);if(!i)return!1;let o=be.single(i.from,i.to),s=t.state.facet(Ud);return t.dispatch({selection:o,effects:[MT(t,i),s.scrollToMatch(o.main,t)],userEvent:"select.search"}),SF(t),!0}),wwe=Gm((t,{query:e})=>{let n=e.matchAll(t.state,1e3);return!n||!n.length?!1:(t.dispatch({selection:be.create(n.map(r=>be.range(r.from,r.to))),userEvent:"select.search.matches"}),!0)}),xwe=({state:t,dispatch:e})=>{let n=t.selection;if(n.ranges.length>1||n.main.empty)return!1;let{from:r,to:i}=n.main,o=[],s=0;for(let a=new vd(t.doc,t.sliceDoc(r,i));!a.next().done;){if(o.length>1e3)return!1;a.value.from==r&&(s=o.length),o.push(be.range(a.value.from,a.value.to))}return e(t.update({selection:be.create(o,s),userEvent:"select.search.matches"})),!0},jL=Gm((t,{query:e})=>{let{state:n}=t,{from:r,to:i}=n.selection.main;if(n.readOnly)return!1;let o=e.nextMatch(n,r,r);if(!o)return!1;let s=[],a,l,c=[];if(o.from==r&&o.to==i&&(l=n.toText(e.getReplacement(o)),s.push({from:o.from,to:o.to,insert:l}),o=e.nextMatch(n,o.from,o.to),c.push(Ge.announce.of(n.phrase("replaced match on line $",n.doc.lineAt(r).number)+"."))),o){let f=s.length==0||s[0].from>=o.to?0:o.to-o.from-l.length;a=be.single(o.from-f,o.to-f),c.push(MT(t,o)),c.push(n.facet(Ud).scrollToMatch(a.main,t))}return t.dispatch({changes:s,selection:a,effects:c,userEvent:"input.replace"}),!0}),Swe=Gm((t,{query:e})=>{if(t.state.readOnly)return!1;let n=e.matchAll(t.state,1e9).map(i=>{let{from:o,to:s}=i;return{from:o,to:s,insert:e.getReplacement(i)}});if(!n.length)return!1;let r=t.state.phrase("replaced $ matches",n.length)+".";return t.dispatch({changes:n,effects:Ge.announce.of(r),userEvent:"input.replace.all"}),!0});function NT(t){return t.state.facet(Ud).createPanel(t)}function gE(t,e){var n,r,i,o,s;let a=t.selection.main,l=a.empty||a.to>a.from+100?"":t.sliceDoc(a.from,a.to);if(e&&!l)return e;let c=t.facet(Ud);return new bF({search:((n=e==null?void 0:e.literal)!==null&&n!==void 0?n:c.literal)?l:l.replace(/\n/g,"\\n"),caseSensitive:(r=e==null?void 0:e.caseSensitive)!==null&&r!==void 0?r:c.caseSensitive,literal:(i=e==null?void 0:e.literal)!==null&&i!==void 0?i:c.literal,regexp:(o=e==null?void 0:e.regexp)!==null&&o!==void 0?o:c.regexp,wholeWord:(s=e==null?void 0:e.wholeWord)!==null&&s!==void 0?s:c.wholeWord})}function xF(t){let e=pm(t,NT);return e&&e.dom.querySelector("[main-field]")}function SF(t){let e=xF(t);e&&e==t.root.activeElement&&e.select()}const CF=t=>{let e=t.state.field(Fl,!1);if(e&&e.panel){let n=xF(t);if(n&&n!=t.root.activeElement){let r=gE(t.state,e.query.spec);r.valid&&t.dispatch({effects:vm.of(r)}),n.focus(),n.select()}}else t.dispatch({effects:[PT.of(!0),e?vm.of(gE(t.state,e.query.spec)):Ot.appendConfig.of(_we)]});return!0},kF=t=>{let e=t.state.field(Fl,!1);if(!e||!e.panel)return!1;let n=pm(t,NT);return n&&n.dom.contains(t.root.activeElement)&&t.focus(),t.dispatch({effects:PT.of(!1)}),!0},Cwe=[{key:"Mod-f",run:CF,scope:"editor search-panel"},{key:"F3",run:cb,shift:ub,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:cb,shift:ub,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:kF,scope:"editor search-panel"},{key:"Mod-Shift-l",run:xwe},{key:"Mod-Alt-g",run:twe},{key:"Mod-d",run:dwe,preventDefault:!0}];class kwe{constructor(e){this.view=e;let n=this.query=e.state.field(Fl).query.spec;this.commit=this.commit.bind(this),this.searchField=bn("input",{value:n.search,placeholder:Wi(e,"Find"),"aria-label":Wi(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=bn("input",{value:n.replace,placeholder:Wi(e,"Replace"),"aria-label":Wi(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=bn("input",{type:"checkbox",name:"case",form:"",checked:n.caseSensitive,onchange:this.commit}),this.reField=bn("input",{type:"checkbox",name:"re",form:"",checked:n.regexp,onchange:this.commit}),this.wordField=bn("input",{type:"checkbox",name:"word",form:"",checked:n.wholeWord,onchange:this.commit});function r(i,o,s){return bn("button",{class:"cm-button",name:i,onclick:o,type:"button"},s)}this.dom=bn("div",{onkeydown:i=>this.keydown(i),class:"cm-search"},[this.searchField,r("next",()=>cb(e),[Wi(e,"next")]),r("prev",()=>ub(e),[Wi(e,"previous")]),r("select",()=>wwe(e),[Wi(e,"all")]),bn("label",null,[this.caseField,Wi(e,"match case")]),bn("label",null,[this.reField,Wi(e,"regexp")]),bn("label",null,[this.wordField,Wi(e,"by word")]),...e.state.readOnly?[]:[bn("br"),this.replaceField,r("replace",()=>jL(e),[Wi(e,"replace")]),r("replaceAll",()=>Swe(e),[Wi(e,"replace all")])],bn("button",{name:"close",onclick:()=>kF(e),"aria-label":Wi(e,"close"),type:"button"},["×"])])}commit(){let e=new bF({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:vm.of(e)}))}keydown(e){Gye(this.view,e,"search-panel")?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?ub:cb)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),jL(this.view))}update(e){for(let n of e.transactions)for(let r of n.effects)r.is(vm)&&!r.value.eq(this.query)&&this.setQuery(r.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(Ud).top}}function Wi(t,e){return t.state.phrase(e)}const Iv=30,jv=/[\s\.,:;?!]/;function MT(t,{from:e,to:n}){let r=t.state.doc.lineAt(e),i=t.state.doc.lineAt(n).to,o=Math.max(r.from,e-Iv),s=Math.min(i,n+Iv),a=t.state.sliceDoc(o,s);if(o!=r.from){for(let l=0;l<Iv;l++)if(!jv.test(a[l+1])&&jv.test(a[l])){a=a.slice(l);break}}if(s!=i){for(let l=a.length-1;l>a.length-Iv;l--)if(!jv.test(a[l-1])&&jv.test(a[l])){a=a.slice(0,l);break}}return Ge.announce.of(`${t.state.phrase("current match")}. ${a} ${t.state.phrase("on line")} ${r.number}.`)}const Ewe=Ge.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),_we=[Fl,Fd.low(bwe),Ewe];class EF{constructor(e,n,r){this.state=e,this.pos=n,this.explicit=r,this.abortListeners=[]}tokenBefore(e){let n=Zr(this.state).resolveInner(this.pos,-1);for(;n&&e.indexOf(n.name)<0;)n=n.parent;return n?{from:n.from,to:this.pos,text:this.state.sliceDoc(n.from,this.pos),type:n.type}:null}matchBefore(e){let n=this.state.doc.lineAt(this.pos),r=Math.max(n.from,this.pos-250),i=n.text.slice(r-n.from,this.pos-n.from),o=i.search(_F(e,!1));return o<0?null:{from:r+o,to:this.pos,text:i.slice(o)}}get aborted(){return this.abortListeners==null}addEventListener(e,n){e=="abort"&&this.abortListeners&&this.abortListeners.push(n)}}function BL(t){let e=Object.keys(t).join(""),n=/\w/.test(e);return n&&(e=e.replace(/\w/g,"")),`[${n?"\\w":""}${e.replace(/[^\w\s]/g,"\\$&")}]`}function Twe(t){let e=Object.create(null),n=Object.create(null);for(let{label:i}of t){e[i[0]]=!0;for(let o=1;o<i.length;o++)n[i[o]]=!0}let r=BL(e)+BL(n)+"*$";return[new RegExp("^"+r),new RegExp(r)]}function Awe(t){let e=t.map(i=>typeof i=="string"?{label:i}:i),[n,r]=e.every(i=>/^\w+$/.test(i.label))?[/\w*$/,/\w+$/]:Twe(e);return i=>{let o=i.matchBefore(r);return o||i.explicit?{from:o?o.from:i.pos,options:e,validFor:n}:null}}class FL{constructor(e,n,r,i){this.completion=e,this.source=n,this.match=r,this.score=i}}function zl(t){return t.selection.main.from}function _F(t,e){var n;let{source:r}=t,i=e&&r[0]!="^",o=r[r.length-1]!="$";return!i&&!o?t:new RegExp(`${i?"^":""}(?:${r})${o?"$":""}`,(n=t.flags)!==null&&n!==void 0?n:t.ignoreCase?"i":"")}const Owe=oa.define();function Rwe(t,e,n,r){let{main:i}=t.selection,o=n-i.from,s=r-i.from;return Object.assign(Object.assign({},t.changeByRange(a=>a!=i&&n!=r&&t.sliceDoc(a.from+o,a.from+s)!=t.sliceDoc(n,r)?{range:a}:{changes:{from:a.from+o,to:r==i.from?a.to:a.from+s,insert:e},range:be.cursor(a.from+o+e.length)})),{scrollIntoView:!0,userEvent:"input.complete"})}const zL=new WeakMap;function Pwe(t){if(!Array.isArray(t))return t;let e=zL.get(t);return e||zL.set(t,e=Awe(t)),e}const fb=Ot.define(),ym=Ot.define();class Nwe{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let n=0;n<e.length;){let r=Mr(e,n),i=Oo(r);this.chars.push(r);let o=e.slice(n,n+i),s=o.toUpperCase();this.folded.push(Mr(s==o?o.toLowerCase():s,0)),n+=i}this.astral=e.length!=this.chars.length}ret(e,n){return this.score=e,this.matched=n,!0}match(e){if(this.pattern.length==0)return this.ret(-100,[]);if(e.length<this.pattern.length)return!1;let{chars:n,folded:r,any:i,precise:o,byWord:s}=this;if(n.length==1){let w=Mr(e,0),C=Oo(w),T=C==e.length?0:-100;if(w!=n[0])if(w==r[0])T+=-200;else return!1;return this.ret(T,[0,C])}let a=e.indexOf(this.pattern);if(a==0)return this.ret(e.length==this.pattern.length?0:-100,[0,this.pattern.length]);let l=n.length,c=0;if(a<0){for(let w=0,C=Math.min(e.length,200);w<C&&c<l;){let T=Mr(e,w);(T==n[c]||T==r[c])&&(i[c++]=w),w+=Oo(T)}if(c<l)return!1}let f=0,d=0,p=!1,m=0,v=-1,b=-1,S=/[a-z]/.test(e),x=!0;for(let w=0,C=Math.min(e.length,200),T=0;w<C&&d<l;){let A=Mr(e,w);a<0&&(f<l&&A==n[f]&&(o[f++]=w),m<l&&(A==n[m]||A==r[m]?(m==0&&(v=w),b=w+1,m++):m=0));let _,R=A<255?A>=48&&A<=57||A>=97&&A<=122?2:A>=65&&A<=90?1:0:(_=dT(A))!=_.toLowerCase()?1:_!=_.toUpperCase()?2:0;(!w||R==1&&S||T==0&&R!=0)&&(n[d]==A||r[d]==A&&(p=!0)?s[d++]=w:s.length&&(x=!1)),T=R,w+=Oo(A)}return d==l&&s[0]==0&&x?this.result(-100+(p?-200:0),s,e):m==l&&v==0?this.ret(-200-e.length+(b==e.length?0:-100),[0,b]):a>-1?this.ret(-700-e.length,[a,a+this.pattern.length]):m==l?this.ret(-900-e.length,[v,b]):d==l?this.result(-100+(p?-200:0)+-700+(x?0:-1100),s,e):n.length==2?!1:this.result((i[0]?-700:0)+-200+-1100,i,e)}result(e,n,r){let i=[],o=0;for(let s of n){let a=s+(this.astral?Oo(Mr(r,s)):1);o&&i[o-1]==s?i[o-1]=a:(i[o++]=s,i[o++]=a)}return this.ret(e-r.length,i)}}const Lr=Je.define({combine(t){return sa(t,{activateOnTyping:!0,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:Mwe,compareCompletions:(e,n)=>e.label.localeCompare(n.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(e,n)=>e&&n,closeOnBlur:(e,n)=>e&&n,icons:(e,n)=>e&&n,tooltipClass:(e,n)=>r=>VL(e(r),n(r)),optionClass:(e,n)=>r=>VL(e(r),n(r)),addToOptions:(e,n)=>e.concat(n)})}});function VL(t,e){return t?e?t+" "+e:t:e}function Mwe(t,e,n,r,i,o){let s=t.textDirection==Rn.RTL,a=s,l=!1,c="top",f,d,p=e.left-i.left,m=i.right-e.right,v=r.right-r.left,b=r.bottom-r.top;if(a&&p<Math.min(v,m)?a=!1:!a&&m<Math.min(v,p)&&(a=!0),v<=(a?p:m))f=Math.max(i.top,Math.min(n.top,i.bottom-b))-e.top,d=Math.min(400,a?p:m);else{l=!0,d=Math.min(400,(s?e.right:i.right-e.left)-30);let w=i.bottom-e.bottom;w>=b||w>e.top?f=n.bottom-e.top:(c="bottom",f=e.bottom-n.top)}let S=(e.bottom-e.top)/o.offsetHeight,x=(e.right-e.left)/o.offsetWidth;return{style:`${c}: ${f/S}px; max-width: ${d/x}px`,class:"cm-completionInfo-"+(l?s?"left-narrow":"right-narrow":a?"left":"right")}}function Dwe(t){let e=t.addToOptions.slice();return t.icons&&e.push({render(n){let r=document.createElement("div");return r.classList.add("cm-completionIcon"),n.type&&r.classList.add(...n.type.split(/\s+/g).map(i=>"cm-completionIcon-"+i)),r.setAttribute("aria-hidden","true"),r},position:20}),e.push({render(n,r,i,o){let s=document.createElement("span");s.className="cm-completionLabel";let a=n.displayLabel||n.label,l=0;for(let c=0;c<o.length;){let f=o[c++],d=o[c++];f>l&&s.appendChild(document.createTextNode(a.slice(l,f)));let p=s.appendChild(document.createElement("span"));p.appendChild(document.createTextNode(a.slice(f,d))),p.className="cm-completionMatchedText",l=d}return l<a.length&&s.appendChild(document.createTextNode(a.slice(l))),s},position:50},{render(n){if(!n.detail)return null;let r=document.createElement("span");return r.className="cm-completionDetail",r.textContent=n.detail,r},position:80}),e.sort((n,r)=>n.position-r.position).map(n=>n.render)}function PS(t,e,n){if(t<=n)return{from:0,to:t};if(e<0&&(e=0),e<=t>>1){let i=Math.floor(e/n);return{from:i*n,to:(i+1)*n}}let r=Math.floor((t-e)/n);return{from:t-(r+1)*n,to:t-r*n}}class Lwe{constructor(e,n,r){this.view=e,this.stateField=n,this.applyCompletion=r,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:l=>this.placeInfo(l),key:this},this.space=null,this.currentClass="";let i=e.state.field(n),{options:o,selected:s}=i.open,a=e.state.facet(Lr);this.optionContent=Dwe(a),this.optionClass=a.optionClass,this.tooltipClass=a.tooltipClass,this.range=PS(o.length,s,a.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(e.state),this.dom.addEventListener("mousedown",l=>{let{options:c}=e.state.field(n).open;for(let f=l.target,d;f&&f!=this.dom;f=f.parentNode)if(f.nodeName=="LI"&&(d=/-(\d+)$/.exec(f.id))&&+d[1]<c.length){this.applyCompletion(e,c[+d[1]]),l.preventDefault();return}}),this.dom.addEventListener("focusout",l=>{let c=e.state.field(this.stateField,!1);c&&c.tooltip&&e.state.facet(Lr).closeOnBlur&&l.relatedTarget!=e.contentDOM&&e.dispatch({effects:ym.of(null)})}),this.showOptions(o,i.id)}mount(){this.updateSel()}showOptions(e,n){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(e,n,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(e){var n;let r=e.state.field(this.stateField),i=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),r!=i){let{options:o,selected:s,disabled:a}=r.open;(!i.open||i.open.options!=o)&&(this.range=PS(o.length,s,e.state.facet(Lr).maxRenderedOptions),this.showOptions(o,r.id)),this.updateSel(),a!=((n=i.open)===null||n===void 0?void 0:n.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!a)}}updateTooltipClass(e){let n=this.tooltipClass(e);if(n!=this.currentClass){for(let r of this.currentClass.split(" "))r&&this.dom.classList.remove(r);for(let r of n.split(" "))r&&this.dom.classList.add(r);this.currentClass=n}}positioned(e){this.space=e,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let e=this.view.state.field(this.stateField),n=e.open;if((n.selected>-1&&n.selected<this.range.from||n.selected>=this.range.to)&&(this.range=PS(n.options.length,n.selected,this.view.state.facet(Lr).maxRenderedOptions),this.showOptions(n.options,e.id)),this.updateSelectedOption(n.selected)){this.destroyInfo();let{completion:r}=n.options[n.selected],{info:i}=r;if(!i)return;let o=typeof i=="string"?document.createTextNode(i):i(r);if(!o)return;"then"in o?o.then(s=>{s&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(s,r)}).catch(s=>Do(this.view.state,s,"completion info")):this.addInfoPane(o,r)}}addInfoPane(e,n){this.destroyInfo();let r=this.info=document.createElement("div");if(r.className="cm-tooltip cm-completionInfo",e.nodeType!=null)r.appendChild(e),this.infoDestroy=null;else{let{dom:i,destroy:o}=e;r.appendChild(i),this.infoDestroy=o||null}this.dom.appendChild(r),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){let n=null;for(let r=this.list.firstChild,i=this.range.from;r;r=r.nextSibling,i++)r.nodeName!="LI"||!r.id?i--:i==e?r.hasAttribute("aria-selected")||(r.setAttribute("aria-selected","true"),n=r):r.hasAttribute("aria-selected")&&r.removeAttribute("aria-selected");return n&&Iwe(this.list,n),n}measureInfo(){let e=this.dom.querySelector("[aria-selected]");if(!e||!this.info)return null;let n=this.dom.getBoundingClientRect(),r=this.info.getBoundingClientRect(),i=e.getBoundingClientRect(),o=this.space;if(!o){let s=this.dom.ownerDocument.defaultView||window;o={left:0,top:0,right:s.innerWidth,bottom:s.innerHeight}}return i.top>Math.min(o.bottom,n.bottom)-10||i.bottom<Math.max(o.top,n.top)+10?null:this.view.state.facet(Lr).positionInfo(this.view,n,i,r,o,this.dom)}placeInfo(e){this.info&&(e?(e.style&&(this.info.style.cssText=e.style),this.info.className="cm-tooltip cm-completionInfo "+(e.class||"")):this.info.style.cssText="top: -1e6px")}createListBox(e,n,r){const i=document.createElement("ul");i.id=n,i.setAttribute("role","listbox"),i.setAttribute("aria-expanded","true"),i.setAttribute("aria-label",this.view.state.phrase("Completions"));let o=null;for(let s=r.from;s<r.to;s++){let{completion:a,match:l}=e[s],{section:c}=a;if(c){let p=typeof c=="string"?c:c.name;if(p!=o&&(s>r.from||r.from==0))if(o=p,typeof c!="string"&&c.header)i.appendChild(c.header(c));else{let m=i.appendChild(document.createElement("completion-section"));m.textContent=p}}const f=i.appendChild(document.createElement("li"));f.id=n+"-"+s,f.setAttribute("role","option");let d=this.optionClass(a);d&&(f.className=d);for(let p of this.optionContent){let m=p(a,this.view.state,this.view,l);m&&f.appendChild(m)}}return r.from&&i.classList.add("cm-completionListIncompleteTop"),r.to<e.length&&i.classList.add("cm-completionListIncompleteBottom"),i}destroyInfo(){this.info&&(this.infoDestroy&&this.infoDestroy(),this.info.remove(),this.info=null)}destroy(){this.destroyInfo()}}function $we(t,e){return n=>new Lwe(n,t,e)}function Iwe(t,e){let n=t.getBoundingClientRect(),r=e.getBoundingClientRect(),i=n.height/t.offsetHeight;r.top<n.top?t.scrollTop-=(n.top-r.top)/i:r.bottom>n.bottom&&(t.scrollTop+=(r.bottom-n.bottom)/i)}function UL(t){return(t.boost||0)*100+(t.apply?10:0)+(t.info?5:0)+(t.type?1:0)}function jwe(t,e){let n=[],r=null,i=l=>{n.push(l);let{section:c}=l.completion;if(c){r||(r=[]);let f=typeof c=="string"?c:c.name;r.some(d=>d.name==f)||r.push(typeof c=="string"?{name:f}:c)}};for(let l of t)if(l.hasResult()){let c=l.result.getMatch;if(l.result.filter===!1)for(let f of l.result.options)i(new FL(f,l.source,c?c(f):[],1e9-n.length));else{let f=new Nwe(e.sliceDoc(l.from,l.to));for(let d of l.result.options)if(f.match(d.label)){let p=d.displayLabel?c?c(d,f.matched):[]:f.matched;i(new FL(d,l.source,p,f.score+(d.boost||0)))}}}if(r){let l=Object.create(null),c=0,f=(d,p)=>{var m,v;return((m=d.rank)!==null&&m!==void 0?m:1e9)-((v=p.rank)!==null&&v!==void 0?v:1e9)||(d.name<p.name?-1:1)};for(let d of r.sort(f))c-=1e5,l[d.name]=c;for(let d of n){let{section:p}=d.completion;p&&(d.score+=l[typeof p=="string"?p:p.name])}}let o=[],s=null,a=e.facet(Lr).compareCompletions;for(let l of n.sort((c,f)=>f.score-c.score||a(c.completion,f.completion))){let c=l.completion;!s||s.label!=c.label||s.detail!=c.detail||s.type!=null&&c.type!=null&&s.type!=c.type||s.apply!=c.apply||s.boost!=c.boost?o.push(l):UL(l.completion)>UL(s)&&(o[o.length-1]=l),s=l.completion}return o}class Pf{constructor(e,n,r,i,o,s){this.options=e,this.attrs=n,this.tooltip=r,this.timestamp=i,this.selected=o,this.disabled=s}setSelected(e,n){return e==this.selected||e>=this.options.length?this:new Pf(this.options,WL(n,e),this.tooltip,this.timestamp,e,this.disabled)}static build(e,n,r,i,o){let s=jwe(e,n);if(!s.length)return i&&e.some(l=>l.state==1)?new Pf(i.options,i.attrs,i.tooltip,i.timestamp,i.selected,!0):null;let a=n.facet(Lr).selectOnOpen?0:-1;if(i&&i.selected!=a&&i.selected!=-1){let l=i.options[i.selected].completion;for(let c=0;c<s.length;c++)if(s[c].completion==l){a=c;break}}return new Pf(s,WL(r,a),{pos:e.reduce((l,c)=>c.hasResult()?Math.min(l,c.from):l,1e8),create:Uwe,above:o.aboveCursor},i?i.timestamp:Date.now(),a,!1)}map(e){return new Pf(this.options,this.attrs,Object.assign(Object.assign({},this.tooltip),{pos:e.mapPos(this.tooltip.pos)}),this.timestamp,this.selected,this.disabled)}}class db{constructor(e,n,r){this.active=e,this.id=n,this.open=r}static start(){return new db(zwe,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(e){let{state:n}=e,r=n.facet(Lr),o=(r.override||n.languageDataAt("autocomplete",zl(n)).map(Pwe)).map(a=>(this.active.find(c=>c.source==a)||new Ci(a,this.active.some(c=>c.state!=0)?1:0)).update(e,r));o.length==this.active.length&&o.every((a,l)=>a==this.active[l])&&(o=this.active);let s=this.open;s&&e.docChanged&&(s=s.map(e.changes)),e.selection||o.some(a=>a.hasResult()&&e.changes.touchesRange(a.from,a.to))||!Bwe(o,this.active)?s=Pf.build(o,n,this.id,s,r):s&&s.disabled&&!o.some(a=>a.state==1)&&(s=null),!s&&o.every(a=>a.state!=1)&&o.some(a=>a.hasResult())&&(o=o.map(a=>a.hasResult()?new Ci(a.source,0):a));for(let a of e.effects)a.is(AF)&&(s=s&&s.setSelected(a.value,this.id));return o==this.active&&s==this.open?this:new db(o,this.id,s)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:Fwe}}function Bwe(t,e){if(t==e)return!0;for(let n=0,r=0;;){for(;n<t.length&&!t[n].hasResult;)n++;for(;r<e.length&&!e[r].hasResult;)r++;let i=n==t.length,o=r==e.length;if(i||o)return i==o;if(t[n++].result!=e[r++].result)return!1}}const Fwe={"aria-autocomplete":"list"};function WL(t,e){let n={"aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":t};return e>-1&&(n["aria-activedescendant"]=t+"-"+e),n}const zwe=[];function vE(t){return t.isUserEvent("input.type")?"input":t.isUserEvent("delete.backward")?"delete":null}class Ci{constructor(e,n,r=-1){this.source=e,this.state=n,this.explicitPos=r}hasResult(){return!1}update(e,n){let r=vE(e),i=this;r?i=i.handleUserEvent(e,r,n):e.docChanged?i=i.handleChange(e):e.selection&&i.state!=0&&(i=new Ci(i.source,0));for(let o of e.effects)if(o.is(fb))i=new Ci(i.source,1,o.value?zl(e.state):-1);else if(o.is(ym))i=new Ci(i.source,0);else if(o.is(TF))for(let s of o.value)s.source==i.source&&(i=s);return i}handleUserEvent(e,n,r){return n=="delete"||!r.activateOnTyping?this.map(e.changes):new Ci(this.source,1)}handleChange(e){return e.changes.touchesRange(zl(e.startState))?new Ci(this.source,0):this.map(e.changes)}map(e){return e.empty||this.explicitPos<0?this:new Ci(this.source,this.state,e.mapPos(this.explicitPos))}}class Yf extends Ci{constructor(e,n,r,i,o){super(e,2,n),this.result=r,this.from=i,this.to=o}hasResult(){return!0}handleUserEvent(e,n,r){var i;let o=e.changes.mapPos(this.from),s=e.changes.mapPos(this.to,1),a=zl(e.state);if((this.explicitPos<0?a<=o:a<this.from)||a>s||n=="delete"&&zl(e.startState)==this.from)return new Ci(this.source,n=="input"&&r.activateOnTyping?1:0);let l=this.explicitPos<0?-1:e.changes.mapPos(this.explicitPos),c;return Vwe(this.result.validFor,e.state,o,s)?new Yf(this.source,l,this.result,o,s):this.result.update&&(c=this.result.update(this.result,o,s,new EF(e.state,a,l>=0)))?new Yf(this.source,l,c,c.from,(i=c.to)!==null&&i!==void 0?i:zl(e.state)):new Ci(this.source,1,l)}handleChange(e){return e.changes.touchesRange(this.from,this.to)?new Ci(this.source,0):this.map(e.changes)}map(e){return e.empty?this:new Yf(this.source,this.explicitPos<0?-1:e.mapPos(this.explicitPos),this.result,e.mapPos(this.from),e.mapPos(this.to,1))}}function Vwe(t,e,n,r){if(!t)return!1;let i=e.sliceDoc(n,r);return typeof t=="function"?t(i,n,r,e):_F(t,!0).test(i)}const TF=Ot.define({map(t,e){return t.map(n=>n.map(e))}}),AF=Ot.define(),Xi=Fr.define({create(){return db.start()},update(t,e){return t.update(e)},provide:t=>[CT.from(t,e=>e.tooltip),Ge.contentAttributes.from(t,e=>e.attrs)]});function OF(t,e){const n=e.completion.apply||e.completion.label;let r=t.state.field(Xi).active.find(i=>i.source==e.source);return r instanceof Yf?(typeof n=="string"?t.dispatch(Object.assign(Object.assign({},Rwe(t.state,n,r.from,r.to)),{annotations:Owe.of(e.completion)})):n(t,e.completion,r.from,r.to),!0):!1}const Uwe=$we(Xi,OF);function Bv(t,e="option"){return n=>{let r=n.state.field(Xi,!1);if(!r||!r.open||r.open.disabled||Date.now()-r.open.timestamp<n.state.facet(Lr).interactionDelay)return!1;let i=1,o;e=="page"&&(o=vB(n,r.open.tooltip))&&(i=Math.max(2,Math.floor(o.dom.offsetHeight/o.dom.querySelector("li").offsetHeight)-1));let{length:s}=r.open.options,a=r.open.selected>-1?r.open.selected+i*(t?1:-1):t?0:s-1;return a<0?a=e=="page"?0:s-1:a>=s&&(a=e=="page"?s-1:0),n.dispatch({effects:AF.of(a)}),!0}}const Wwe=t=>{let e=t.state.field(Xi,!1);return t.state.readOnly||!e||!e.open||e.open.selected<0||e.open.disabled||Date.now()-e.open.timestamp<t.state.facet(Lr).interactionDelay?!1:OF(t,e.open.options[e.open.selected])},Hwe=t=>t.state.field(Xi,!1)?(t.dispatch({effects:fb.of(!0)}),!0):!1,qwe=t=>{let e=t.state.field(Xi,!1);return!e||!e.active.some(n=>n.state!=0)?!1:(t.dispatch({effects:ym.of(null)}),!0)};class Kwe{constructor(e,n){this.active=e,this.context=n,this.time=Date.now(),this.updates=[],this.done=void 0}}const Gwe=50,Ywe=1e3,Xwe=tr.fromClass(class{constructor(t){this.view=t,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let e of t.state.field(Xi).active)e.state==1&&this.startQuery(e)}update(t){let e=t.state.field(Xi);if(!t.selectionSet&&!t.docChanged&&t.startState.field(Xi)==e)return;let n=t.transactions.some(i=>(i.selection||i.docChanged)&&!vE(i));for(let i=0;i<this.running.length;i++){let o=this.running[i];if(n||o.updates.length+t.transactions.length>Gwe&&Date.now()-o.time>Ywe){for(let s of o.context.abortListeners)try{s()}catch(a){Do(this.view.state,a)}o.context.abortListeners=null,this.running.splice(i--,1)}else o.updates.push(...t.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),t.transactions.some(i=>i.effects.some(o=>o.is(fb)))&&(this.pendingStart=!0);let r=this.pendingStart?50:t.state.facet(Lr).activateOnTypingDelay;if(this.debounceUpdate=e.active.some(i=>i.state==1&&!this.running.some(o=>o.active.source==i.source))?setTimeout(()=>this.startUpdate(),r):-1,this.composing!=0)for(let i of t.transactions)vE(i)=="input"?this.composing=2:this.composing==2&&i.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:t}=this.view,e=t.field(Xi);for(let n of e.active)n.state==1&&!this.running.some(r=>r.active.source==n.source)&&this.startQuery(n)}startQuery(t){let{state:e}=this.view,n=zl(e),r=new EF(e,n,t.explicitPos==n),i=new Kwe(t,r);this.running.push(i),Promise.resolve(t.source(r)).then(o=>{i.context.aborted||(i.done=o||null,this.scheduleAccept())},o=>{this.view.dispatch({effects:ym.of(null)}),Do(this.view.state,o)})}scheduleAccept(){this.running.every(t=>t.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(Lr).updateSyncTime))}accept(){var t;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],n=this.view.state.facet(Lr);for(let r=0;r<this.running.length;r++){let i=this.running[r];if(i.done===void 0)continue;if(this.running.splice(r--,1),i.done){let s=new Yf(i.active.source,i.active.explicitPos,i.done,i.done.from,(t=i.done.to)!==null&&t!==void 0?t:zl(i.updates.length?i.updates[0].startState:this.view.state));for(let a of i.updates)s=s.update(a,n);if(s.hasResult()){e.push(s);continue}}let o=this.view.state.field(Xi).active.find(s=>s.source==i.active.source);if(o&&o.state==1)if(i.done==null){let s=new Ci(i.active.source,0);for(let a of i.updates)s=s.update(a,n);s.state!=1&&e.push(s)}else this.startQuery(o)}e.length&&this.view.dispatch({effects:TF.of(e)})}},{eventHandlers:{blur(t){let e=this.view.state.field(Xi,!1);if(e&&e.tooltip&&this.view.state.facet(Lr).closeOnBlur){let n=e.open&&vB(this.view,e.open.tooltip);(!n||!n.dom.contains(t.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:ym.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:fb.of(!1)}),20),this.composing=0}}}),Zwe=Ge.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}}),bm={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},Wc=Ot.define({map(t,e){let n=e.mapPos(t,-1,li.TrackAfter);return n??void 0}}),DT=new class extends gu{};DT.startSide=1;DT.endSide=-1;const RF=Fr.define({create(){return Gt.empty},update(t,e){if(t=t.map(e.changes),e.selection){let n=e.state.doc.lineAt(e.selection.main.head);t=t.update({filter:r=>r>=n.from&&r<=n.to})}for(let n of e.effects)n.is(Wc)&&(t=t.update({add:[DT.range(n.value,n.value+1)]}));return t}});function Qwe(){return[exe,RF]}const NS="()[]{}<>";function PF(t){for(let e=0;e<NS.length;e+=2)if(NS.charCodeAt(e)==t)return NS.charAt(e+1);return dT(t<128?t:t+1)}function NF(t,e){return t.languageDataAt("closeBrackets",e)[0]||bm}const Jwe=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),exe=Ge.inputHandler.of((t,e,n,r)=>{if((Jwe?t.composing:t.compositionStarted)||t.state.readOnly)return!1;let i=t.state.selection.main;if(r.length>2||r.length==2&&Oo(Mr(r,0))==1||e!=i.from||n!=i.to)return!1;let o=rxe(t.state,r);return o?(t.dispatch(o),!0):!1}),txe=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let r=NF(t,t.selection.main.head).brackets||bm.brackets,i=null,o=t.changeByRange(s=>{if(s.empty){let a=ixe(t.doc,s.head);for(let l of r)if(l==a&&N1(t.doc,s.head)==PF(Mr(l,0)))return{changes:{from:s.head-l.length,to:s.head+l.length},range:be.cursor(s.head-l.length)}}return{range:i=s}});return i||e(t.update(o,{scrollIntoView:!0,userEvent:"delete.backward"})),!i},nxe=[{key:"Backspace",run:txe}];function rxe(t,e){let n=NF(t,t.selection.main.head),r=n.brackets||bm.brackets;for(let i of r){let o=PF(Mr(i,0));if(e==i)return o==i?axe(t,i,r.indexOf(i+i+i)>-1,n):oxe(t,i,o,n.before||bm.before);if(e==o&&MF(t,t.selection.main.from))return sxe(t,i,o)}return null}function MF(t,e){let n=!1;return t.field(RF).between(0,t.doc.length,r=>{r==e&&(n=!0)}),n}function N1(t,e){let n=t.sliceString(e,e+2);return n.slice(0,Oo(Mr(n,0)))}function ixe(t,e){let n=t.sliceString(e-2,e);return Oo(Mr(n,0))==n.length?n:n.slice(1)}function oxe(t,e,n,r){let i=null,o=t.changeByRange(s=>{if(!s.empty)return{changes:[{insert:e,from:s.from},{insert:n,from:s.to}],effects:Wc.of(s.to+e.length),range:be.range(s.anchor+e.length,s.head+e.length)};let a=N1(t.doc,s.head);return!a||/\s/.test(a)||r.indexOf(a)>-1?{changes:{insert:e+n,from:s.head},effects:Wc.of(s.head+e.length),range:be.cursor(s.head+e.length)}:{range:i=s}});return i?null:t.update(o,{scrollIntoView:!0,userEvent:"input.type"})}function sxe(t,e,n){let r=null,i=t.changeByRange(o=>o.empty&&N1(t.doc,o.head)==n?{changes:{from:o.head,to:o.head+n.length,insert:n},range:be.cursor(o.head+n.length)}:r={range:o});return r?null:t.update(i,{scrollIntoView:!0,userEvent:"input.type"})}function axe(t,e,n,r){let i=r.stringPrefixes||bm.stringPrefixes,o=null,s=t.changeByRange(a=>{if(!a.empty)return{changes:[{insert:e,from:a.from},{insert:e,from:a.to}],effects:Wc.of(a.to+e.length),range:be.range(a.anchor+e.length,a.head+e.length)};let l=a.head,c=N1(t.doc,l),f;if(c==e){if(HL(t,l))return{changes:{insert:e+e,from:l},effects:Wc.of(l+e.length),range:be.cursor(l+e.length)};if(MF(t,l)){let p=n&&t.sliceDoc(l,l+e.length*3)==e+e+e?e+e+e:e;return{changes:{from:l,to:l+p.length,insert:p},range:be.cursor(l+p.length)}}}else{if(n&&t.sliceDoc(l-2*e.length,l)==e+e&&(f=qL(t,l-2*e.length,i))>-1&&HL(t,f))return{changes:{insert:e+e+e+e,from:l},effects:Wc.of(l+e.length),range:be.cursor(l+e.length)};if(t.charCategorizer(l)(c)!=Ln.Word&&qL(t,l,i)>-1&&!lxe(t,l,e,i))return{changes:{insert:e+e,from:l},effects:Wc.of(l+e.length),range:be.cursor(l+e.length)}}return{range:o=a}});return o?null:t.update(s,{scrollIntoView:!0,userEvent:"input.type"})}function HL(t,e){let n=Zr(t).resolveInner(e+1);return n.parent&&n.from==e}function lxe(t,e,n,r){let i=Zr(t).resolveInner(e,-1),o=r.reduce((s,a)=>Math.max(s,a.length),0);for(let s=0;s<5;s++){let a=t.sliceDoc(i.from,Math.min(i.to,i.from+n.length+o)),l=a.indexOf(n);if(!l||l>-1&&r.indexOf(a.slice(0,l))>-1){let f=i.firstChild;for(;f&&f.from==i.from&&f.to-f.from>n.length+l;){if(t.sliceDoc(f.to-n.length,f.to)==n)return!1;f=f.firstChild}return!0}let c=i.to==e&&i.parent;if(!c)break;i=c}return!1}function qL(t,e,n){let r=t.charCategorizer(e);if(r(t.sliceDoc(e-1,e))!=Ln.Word)return e;for(let i of n){let o=e-i.length;if(t.sliceDoc(o,e)==i&&r(t.sliceDoc(o-1,o))!=Ln.Word)return o}return-1}function cxe(t={}){return[Xi,Lr.of(t),Xwe,uxe,Zwe]}const DF=[{key:"Ctrl-Space",run:Hwe},{key:"Escape",run:qwe},{key:"ArrowDown",run:Bv(!0)},{key:"ArrowUp",run:Bv(!1)},{key:"PageDown",run:Bv(!0,"page")},{key:"PageUp",run:Bv(!1,"page")},{key:"Enter",run:Wwe}],uxe=Fd.highest(C1.computeN([Lr],t=>t.facet(Lr).defaultKeymap?[DF]:[]));class fxe{constructor(e,n,r){this.from=e,this.to=n,this.diagnostic=r}}class Nc{constructor(e,n,r){this.diagnostics=e,this.panel=n,this.selected=r}static init(e,n,r){let i=e,o=r.facet(IF).markerFilter;o&&(i=o(i,r));let s=dt.set(i.map(a=>a.from==a.to||a.from==a.to-1&&r.doc.lineAt(a.from).to==a.from?dt.widget({widget:new wxe(a),diagnostic:a}).range(a.from):dt.mark({attributes:{class:"cm-lintRange cm-lintRange-"+a.severity+(a.markClass?" "+a.markClass:"")},diagnostic:a,inclusive:!0}).range(a.from,a.to)),!0);return new Nc(s,n,yd(s))}}function yd(t,e=null,n=0){let r=null;return t.between(n,1e9,(i,o,{spec:s})=>{if(!(e&&s.diagnostic!=e))return r=new fxe(i,o,s.diagnostic),!1}),r}function dxe(t,e){let n=t.startState.doc.lineAt(e.pos);return!!(t.effects.some(r=>r.is(LF))||t.changes.touchesRange(n.from,n.to))}function hxe(t,e){return t.field(to,!1)?e:e.concat(Ot.appendConfig.of(Cxe))}const LF=Ot.define(),LT=Ot.define(),$F=Ot.define(),to=Fr.define({create(){return new Nc(dt.none,null,null)},update(t,e){if(e.docChanged){let n=t.diagnostics.map(e.changes),r=null;if(t.selected){let i=e.changes.mapPos(t.selected.from,1);r=yd(n,t.selected.diagnostic,i)||yd(n,null,i)}t=new Nc(n,t.panel,r)}for(let n of e.effects)n.is(LF)?t=Nc.init(n.value,t.panel,e.state):n.is(LT)?t=new Nc(t.diagnostics,n.value?M1.open:null,t.selected):n.is($F)&&(t=new Nc(t.diagnostics,t.panel,n.value));return t},provide:t=>[mm.from(t,e=>e.panel),Ge.decorations.from(t,e=>e.diagnostics)]}),pxe=dt.mark({class:"cm-lintRange cm-lintRange-active",inclusive:!0});function mxe(t,e,n){let{diagnostics:r}=t.state.field(to),i=[],o=2e8,s=0;r.between(e-(n<0?1:0),e+(n>0?1:0),(l,c,{spec:f})=>{e>=l&&e<=c&&(l==c||(e>l||n>0)&&(e<c||n<0))&&(i.push(f.diagnostic),o=Math.min(l,o),s=Math.max(c,s))});let a=t.state.facet(IF).tooltipFilter;return a&&(i=a(i,t.state)),i.length?{pos:o,end:s,above:t.state.doc.lineAt(o).to<s,create(){return{dom:gxe(t,i)}}}:null}function gxe(t,e){return bn("ul",{class:"cm-tooltip-lint"},e.map(n=>BF(t,n,!1)))}const vxe=t=>{let e=t.state.field(to,!1);(!e||!e.panel)&&t.dispatch({effects:hxe(t.state,[LT.of(!0)])});let n=pm(t,M1.open);return n&&n.dom.querySelector(".cm-panel-lint ul").focus(),!0},KL=t=>{let e=t.state.field(to,!1);return!e||!e.panel?!1:(t.dispatch({effects:LT.of(!1)}),!0)},yxe=t=>{let e=t.state.field(to,!1);if(!e)return!1;let n=t.state.selection.main,r=e.diagnostics.iter(n.to+1);return!r.value&&(r=e.diagnostics.iter(0),!r.value||r.from==n.from&&r.to==n.to)?!1:(t.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0}),!0)},bxe=[{key:"Mod-Shift-m",run:vxe,preventDefault:!0},{key:"F8",run:yxe}],IF=Je.define({combine(t){return Object.assign({sources:t.map(e=>e.source).filter(e=>e!=null)},sa(t.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null},{needsRefresh:(e,n)=>e?n?r=>e(r)||n(r):e:n}))}});function jF(t){let e=[];if(t)e:for(let{name:n}of t){for(let r=0;r<n.length;r++){let i=n[r];if(/[a-zA-Z]/.test(i)&&!e.some(o=>o.toLowerCase()==i.toLowerCase())){e.push(i);continue e}}e.push("")}return e}function BF(t,e,n){var r;let i=n?jF(e.actions):[];return bn("li",{class:"cm-diagnostic cm-diagnostic-"+e.severity},bn("span",{class:"cm-diagnosticText"},e.renderMessage?e.renderMessage():e.message),(r=e.actions)===null||r===void 0?void 0:r.map((o,s)=>{let a=!1,l=p=>{if(p.preventDefault(),a)return;a=!0;let m=yd(t.state.field(to).diagnostics,e);m&&o.apply(t,m.from,m.to)},{name:c}=o,f=i[s]?c.indexOf(i[s]):-1,d=f<0?c:[c.slice(0,f),bn("u",c.slice(f,f+1)),c.slice(f+1)];return bn("button",{type:"button",class:"cm-diagnosticAction",onclick:l,onmousedown:l,"aria-label":` Action: ${c}${f<0?"":` (access key "${i[s]})"`}.`},d)}),e.source&&bn("div",{class:"cm-diagnosticSource"},e.source))}class wxe extends Ga{constructor(e){super(),this.diagnostic=e}eq(e){return e.diagnostic==this.diagnostic}toDOM(){return bn("span",{class:"cm-lintPoint cm-lintPoint-"+this.diagnostic.severity})}}class GL{constructor(e,n){this.diagnostic=n,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=BF(e,n,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class M1{constructor(e){this.view=e,this.items=[];let n=i=>{if(i.keyCode==27)KL(this.view),this.view.focus();else if(i.keyCode==38||i.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(i.keyCode==40||i.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(i.keyCode==36)this.moveSelection(0);else if(i.keyCode==35)this.moveSelection(this.items.length-1);else if(i.keyCode==13)this.view.focus();else if(i.keyCode>=65&&i.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:o}=this.items[this.selectedIndex],s=jF(o.actions);for(let a=0;a<s.length;a++)if(s[a].toUpperCase().charCodeAt(0)==i.keyCode){let l=yd(this.view.state.field(to).diagnostics,o);l&&o.actions[a].apply(e,l.from,l.to)}}else return;i.preventDefault()},r=i=>{for(let o=0;o<this.items.length;o++)this.items[o].dom.contains(i.target)&&this.moveSelection(o)};this.list=bn("ul",{tabIndex:0,role:"listbox","aria-label":this.view.state.phrase("Diagnostics"),onkeydown:n,onclick:r}),this.dom=bn("div",{class:"cm-panel-lint"},this.list,bn("button",{type:"button",name:"close","aria-label":this.view.state.phrase("close"),onclick:()=>KL(this.view)},"×")),this.update()}get selectedIndex(){let e=this.view.state.field(to).selected;if(!e)return-1;for(let n=0;n<this.items.length;n++)if(this.items[n].diagnostic==e.diagnostic)return n;return-1}update(){let{diagnostics:e,selected:n}=this.view.state.field(to),r=0,i=!1,o=null;for(e.between(0,this.view.state.doc.length,(s,a,{spec:l})=>{let c=-1,f;for(let d=r;d<this.items.length;d++)if(this.items[d].diagnostic==l.diagnostic){c=d;break}c<0?(f=new GL(this.view,l.diagnostic),this.items.splice(r,0,f),i=!0):(f=this.items[c],c>r&&(this.items.splice(r,c-r),i=!0)),n&&f.diagnostic==n.diagnostic?f.dom.hasAttribute("aria-selected")||(f.dom.setAttribute("aria-selected","true"),o=f):f.dom.hasAttribute("aria-selected")&&f.dom.removeAttribute("aria-selected"),r++});r<this.items.length&&!(this.items.length==1&&this.items[0].diagnostic.from<0);)i=!0,this.items.pop();this.items.length==0&&(this.items.push(new GL(this.view,{from:-1,to:-1,severity:"info",message:this.view.state.phrase("No diagnostics")})),i=!0),o?(this.list.setAttribute("aria-activedescendant",o.id),this.view.requestMeasure({key:this,read:()=>({sel:o.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:s,panel:a})=>{let l=a.height/this.list.offsetHeight;s.top<a.top?this.list.scrollTop-=(a.top-s.top)/l:s.bottom>a.bottom&&(this.list.scrollTop+=(s.bottom-a.bottom)/l)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),i&&this.sync()}sync(){let e=this.list.firstChild;function n(){let r=e;e=r.nextSibling,r.remove()}for(let r of this.items)if(r.dom.parentNode==this.list){for(;e!=r.dom;)n();e=r.dom.nextSibling}else this.list.insertBefore(r.dom,e);for(;e;)n()}moveSelection(e){if(this.selectedIndex<0)return;let n=this.view.state.field(to),r=yd(n.diagnostics,this.items[e].diagnostic);r&&this.view.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0,effects:$F.of(r)})}static open(e){return new M1(e)}}function xxe(t,e='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${e}>${encodeURIComponent(t)}</svg>')`}function Fv(t){return xxe(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${t}" fill="none" stroke-width=".7"/>`,'width="6" height="3"')}const Sxe=Ge.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnostic-hint":{borderLeft:"5px solid #66d"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:Fv("#d11")},".cm-lintRange-warning":{backgroundImage:Fv("orange")},".cm-lintRange-info":{backgroundImage:Fv("#999")},".cm-lintRange-hint":{backgroundImage:Fv("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}}}),Cxe=[to,Ge.decorations.compute([to],t=>{let{selected:e,panel:n}=t.field(to);return!e||!n||e.from==e.to?dt.none:dt.set([pxe.range(e.from,e.to)])}),$0e(mxe,{hideOn:dxe}),Sxe];var YL=function(e){e===void 0&&(e={});var{crosshairCursor:n=!1}=e,r=[];e.closeBracketsKeymap!==!1&&(r=r.concat(nxe)),e.defaultKeymap!==!1&&(r=r.concat(Q1e)),e.searchKeymap!==!1&&(r=r.concat(Cwe)),e.historyKeymap!==!1&&(r=r.concat(a1e)),e.foldKeymap!==!1&&(r=r.concat(bbe)),e.completionKeymap!==!1&&(r=r.concat(DF)),e.lintKeymap!==!1&&(r=r.concat(bxe));var i=[];return e.lineNumbers!==!1&&i.push(H0e()),e.highlightActiveLineGutter!==!1&&i.push(G0e()),e.highlightSpecialChars!==!1&&i.push(f0e()),e.history!==!1&&i.push(Qbe()),e.foldGutter!==!1&&i.push(Cbe()),e.drawSelection!==!1&&i.push(e0e()),e.dropCursor!==!1&&i.push(o0e()),e.allowMultipleSelections!==!1&&i.push(Ht.allowMultipleSelections.of(!0)),e.indentOnInput!==!1&&i.push(cbe()),e.syntaxHighlighting!==!1&&i.push(NB(Tbe,{fallback:!0})),e.bracketMatching!==!1&&i.push(Dbe()),e.closeBrackets!==!1&&i.push(Qwe()),e.autocompletion!==!1&&i.push(cxe()),e.rectangularSelection!==!1&&i.push(E0e()),n!==!1&&i.push(A0e()),e.highlightActiveLine!==!1&&i.push(v0e()),e.highlightSelectionMatches!==!1&&i.push(iwe()),e.tabSize&&typeof e.tabSize=="number"&&i.push(E1.of(" ".repeat(e.tabSize))),i.concat([C1.of(r.flat())]).filter(Boolean)};const kxe="#e5c07b",XL="#e06c75",Exe="#56b6c2",_xe="#ffffff",_y="#abb2bf",yE="#7d8799",Txe="#61afef",Axe="#98c379",ZL="#d19a66",Oxe="#c678dd",Rxe="#21252b",QL="#2c313a",JL="#282c34",MS="#353a42",Pxe="#3E4451",e$="#528bff",Nxe=Ge.theme({"&":{color:_y,backgroundColor:JL},".cm-content":{caretColor:e$},".cm-cursor, .cm-dropCursor":{borderLeftColor:e$},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:Pxe},".cm-panels":{backgroundColor:Rxe,color:_y},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:"1px solid #457dff"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:"#6699ff0b"},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847"},".cm-gutters":{backgroundColor:JL,color:yE,border:"none"},".cm-activeLineGutter":{backgroundColor:QL},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:MS},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:MS,borderBottomColor:MS},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:QL,color:_y}}},{dark:!0}),Mxe=qm.define([{tag:me.keyword,color:Oxe},{tag:[me.name,me.deleted,me.character,me.propertyName,me.macroName],color:XL},{tag:[me.function(me.variableName),me.labelName],color:Txe},{tag:[me.color,me.constant(me.name),me.standard(me.name)],color:ZL},{tag:[me.definition(me.name),me.separator],color:_y},{tag:[me.typeName,me.className,me.number,me.changed,me.annotation,me.modifier,me.self,me.namespace],color:kxe},{tag:[me.operator,me.operatorKeyword,me.url,me.escape,me.regexp,me.link,me.special(me.string)],color:Exe},{tag:[me.meta,me.comment],color:yE},{tag:me.strong,fontWeight:"bold"},{tag:me.emphasis,fontStyle:"italic"},{tag:me.strikethrough,textDecoration:"line-through"},{tag:me.link,color:yE,textDecoration:"underline"},{tag:me.heading,fontWeight:"bold",color:XL},{tag:[me.atom,me.bool,me.special(me.variableName)],color:ZL},{tag:[me.processingInstruction,me.string,me.inserted],color:Axe},{tag:me.invalid,color:_xe}]),Dxe=[Nxe,NB(Mxe)];var Lxe=Ge.theme({"&":{backgroundColor:"#fff"}},{dark:!1}),$xe=function(e){e===void 0&&(e={});var{indentWithTab:n=!0,editable:r=!0,readOnly:i=!1,theme:o="light",placeholder:s="",basicSetup:a=!0}=e,l=[];switch(n&&l.unshift(C1.of([J1e])),a&&(typeof a=="boolean"?l.unshift(YL()):l.unshift(YL(a))),s&&l.unshift(x0e(s)),o){case"light":l.push(Lxe);break;case"dark":l.push(Dxe);break;case"none":break;default:l.push(o);break}return r===!1&&l.push(Ge.editable.of(!1)),i&&l.push(Ht.readOnly.of(!0)),[...l]},Ixe=t=>({line:t.state.doc.lineAt(t.state.selection.main.from),lineCount:t.state.doc.lines,lineBreak:t.state.lineBreak,length:t.state.doc.length,readOnly:t.state.readOnly,tabSize:t.state.tabSize,selection:t.state.selection,selectionAsSingle:t.state.selection.asSingle().main,ranges:t.state.selection.ranges,selectionCode:t.state.sliceDoc(t.state.selection.main.from,t.state.selection.main.to),selections:t.state.selection.ranges.map(e=>t.state.sliceDoc(e.from,e.to)),selectedText:t.state.selection.ranges.some(e=>!e.empty)}),t$=oa.define(),jxe=[];function Bxe(t){var{value:e,selection:n,onChange:r,onStatistics:i,onCreateEditor:o,onUpdate:s,extensions:a=jxe,autoFocus:l,theme:c="light",height:f=null,minHeight:d=null,maxHeight:p=null,width:m=null,minWidth:v=null,maxWidth:b=null,placeholder:S="",editable:x=!0,readOnly:w=!1,indentWithTab:C=!0,basicSetup:T=!0,root:A,initialState:_}=t,[R,M]=g.useState(),[I,V]=g.useState(),[U,L]=g.useState(),G=Ge.theme({"&":{height:f,minHeight:d,maxHeight:p,width:m,minWidth:v,maxWidth:b},"& .cm-scroller":{height:"100% !important"}}),K=Ge.updateListener.of(ae=>{if(ae.docChanged&&typeof r=="function"&&!ae.transactions.some(P=>P.annotation(t$))){var re=ae.state.doc,W=re.toString();r(W,ae)}i&&i(Ixe(ae))}),F=$xe({theme:c,editable:x,readOnly:w,placeholder:S,indentWithTab:C,basicSetup:T}),ie=[K,G,...F];return s&&typeof s=="function"&&ie.push(Ge.updateListener.of(s)),ie=ie.concat(a),g.useEffect(()=>{if(R&&!U){var ae={doc:e,selection:n,extensions:ie},re=_?Ht.fromJSON(_.json,ae,_.fields):Ht.create(ae);if(L(re),!I){var W=new Ge({state:re,parent:R,root:A});V(W),o&&o(W,re)}}return()=>{I&&(L(void 0),V(void 0))}},[R,U]),g.useEffect(()=>M(t.container),[t.container]),g.useEffect(()=>()=>{I&&(I.destroy(),V(void 0))},[I]),g.useEffect(()=>{l&&I&&I.focus()},[l,I]),g.useEffect(()=>{I&&I.dispatch({effects:Ot.reconfigure.of(ie)})},[c,a,f,d,p,m,v,b,S,x,w,C,T,r,s]),g.useEffect(()=>{if(e!==void 0){var ae=I?I.state.doc.toString():"";I&&e!==ae&&I.dispatch({changes:{from:0,to:ae.length,insert:e||""},annotations:[t$.of(!0)]})}},[e,I]),{state:U,setState:L,view:I,setView:V,container:R,setContainer:M}}var Fxe=["className","value","selection","extensions","onChange","onStatistics","onCreateEditor","onUpdate","autoFocus","theme","height","minHeight","maxHeight","width","minWidth","maxWidth","basicSetup","placeholder","indentWithTab","editable","readOnly","root","initialState"],FF=g.forwardRef((t,e)=>{var{className:n,value:r="",selection:i,extensions:o=[],onChange:s,onStatistics:a,onCreateEditor:l,onUpdate:c,autoFocus:f,theme:d="light",height:p,minHeight:m,maxHeight:v,width:b,minWidth:S,maxWidth:x,basicSetup:w,placeholder:C,indentWithTab:T,editable:A,readOnly:_,root:R,initialState:M}=t,I=Bt(t,Fxe),V=g.useRef(null),{state:U,view:L,container:G}=Bxe({container:V.current,root:R,value:r,autoFocus:f,theme:d,height:p,minHeight:m,maxHeight:v,width:b,minWidth:S,maxWidth:x,basicSetup:w,placeholder:C,indentWithTab:T,editable:A,readOnly:_,selection:i,onChange:s,onStatistics:a,onCreateEditor:l,onUpdate:c,extensions:o,initialState:M});if(g.useImperativeHandle(e,()=>({editor:V.current,state:U,view:L}),[V,G,U,L]),typeof r!="string")throw new Error("value must be typeof string but got "+typeof r);var K=typeof d=="string"?"cm-theme-"+d:"cm-theme";return k.jsx("div",H({ref:V,className:""+K+(n?" "+n:"")},I))});FF.displayName="CodeMirror";const zxe=({value:t,onChange:e})=>k.jsx(FF,{value:t,extensions:[Vbe()],onChange:e}),n$=JSON.stringify({},null,2),Vxe=t=>{const e=t.command.body?"json":"none";return k.jsxs(_2,{children:[k.jsx(T2,{asChild:!0,children:k.jsx(Tn,{variant:"plain",size:"icon",className:"h-8 w-8",children:k.jsx(gse,{className:"h-7 w-7",strokeWidth:1})})}),k.jsxs(Jb,{className:"max-w-2xl",children:[k.jsx(e1,{children:k.jsx(t1,{children:"Edit request"})}),k.jsxs("div",{className:"space-y-6",children:[k.jsxs("div",{className:"grid grid-cols-[auto_1fr] gap-2",children:[k.jsxs(g9,{value:t.command.method,onValueChange:n=>{t.onChange({...t.command,method:n})},children:[k.jsx(iT,{children:k.jsx(v9,{placeholder:"Select a method"})}),k.jsxs(oT,{children:[k.jsx(Rc,{value:"GET",children:"GET"}),k.jsx(Rc,{value:"POST",children:"POST"}),k.jsx(Rc,{value:"PUT",children:"PUT"}),k.jsx(Rc,{value:"DELETE",children:"DELETE"}),k.jsx(Rc,{value:"PATCH",children:"PATCH"})]})]}),k.jsx(jl,{type:"url",placeholder:"https://example.com/api",value:t.command.url,onChange:n=>{t.onChange({...t.command,url:n.target.value})}})]}),k.jsxs(bge,{defaultValue:"params",children:[k.jsxs(z9,{children:[k.jsx(py,{value:"params",children:"Params"}),k.jsx(py,{value:"headers",children:"Headers"}),k.jsx(py,{value:"body",children:"Body"})]}),k.jsx(my,{value:"params",children:k.jsx(oD,{data:t.command.params||{"":""},onChange:n=>{t.onChange({...t.command,params:n})}})}),k.jsx(my,{value:"headers",children:k.jsx(oD,{data:t.command.headers||{"":""},onChange:n=>{t.onChange({...t.command,headers:n})}})}),k.jsxs(my,{value:"body",className:"space-y-2",children:[k.jsxs(M9,{className:"auto-cols-min grid-flow-col gap-4",value:e,onValueChange:n=>{if(n==="none"){t.onChange({...t.command,body:void 0});return}t.onChange({...t.command,body:n$})},children:[k.jsxs("div",{className:"flex items-center space-x-2",children:[k.jsx(Ck,{value:"none",id:"r1"}),k.jsx(xi,{htmlFor:"r1",children:"None"})]}),k.jsxs("div",{className:"flex items-center space-x-2",children:[k.jsx(Ck,{value:"json",id:"r2"}),k.jsx(xi,{htmlFor:"r2",children:"JSON"})]})]}),e==="json"?k.jsx(zxe,{value:t.command.body||n$,onChange:n=>{t.onChange({...t.command,body:n})}}):null]})]})]})]})]})},xo=g.forwardRef(({hint:t,...e},n)=>{const[r,i]=g.useState(!1);return k.jsxs(c1,{open:e.readOnly?!1:r,children:[k.jsx(u1,{asChild:!0,children:k.jsx(B0,{className:"resize-none px-2 py-0 pr-6 text-base leading-8 shadow-none",ref:n,...e,onFocus:()=>i(!0),onBlur:()=>i(!1)})}),k.jsx(Bm,{onOpenAutoFocus:o=>o.preventDefault(),side:"bottom",align:"start",className:"w-max",children:t})]})});xo.displayName="TextareaAutosizeWithHint";const Lh=`#### Tips for describing an element
220
+
221
+ - Use quotes when describing page content (e.g. the 'Submit' button).
222
+ - If an element is located incorrectly, change or delete the step to clear caching.
223
+ - Avoid locating elements that are hidden, blocked, or animating.
224
+ - Distinguish between similar elements by using parent-child relationships (e.g. underneath the title).
225
+ `,Uxe=`#### Tips for writing an AI action
226
+
227
+ - Be as specific as possible (e.g. click the 'Confirm' button next to the email field)
228
+ - Use quotes when describing page content or user input (e.g. type 'mypassword')
229
+ - Avoid combining actions that navigate to different pages in the same step
230
+ - Separate subtasks with commas or periods (e.g. Click the 'Submit' button, then click the 'Cancel' button)`,Wxe=`#### Tips for writing an assertion
231
+
232
+ - Start with \`Assert that\` or \`There is\` and describe the condition in detail.
233
+ - Use the visual mode to test appearance (e.g. element color and visibility) and general conditions (e.g. "the user is logged in").
234
+ - Use the normal mode to test the presence of text on the page.
235
+ - Use quotes when describing page content (e.g. the 'Submit' button).`,Hxe="Text that will be typed using the keyboard.",qxe="Keys that will be pressed using the keyboard such as `ArrowLeft` or `Control+Shift+T`. Multiple keys can be pressed at the same time by separating them with a `+`.",Kxe=`
236
+ Domain name or URL fragment of the tab to switch to.
237
+ The first tab with a URL that contains your input as a substring will be selected.
238
+ `,Gxe="\n Set a cookie in the browser using the HTTP Set-Cookie [format](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie). \n Options can be specified through key-value pairs separated by a semicolon (e.g. `id=1; domain=google.com; secure`). \n For a cookie to apply to all subdomains, prefix domain with a dot like `.google.com`.\n ",Yxe=t=>{var r,i,o;const e=t.step;if(e.type===$e.AI_ACTION)return k.jsx(xo,{autoFocus:t.autofocus,hint:k.jsx(Zo,{className:"prose prose-sm dark:prose-invert",children:Uxe}),disabled:t.disabled,value:e.text,placeholder:"Add 'buy groceries' to the todo list",onChange:s=>{var a;(a=t.onStepChange)==null||a.call(t,{type:e.type,text:s.target.value})}});if(e.type==="RESOLVED_MODULE")return k.jsx("div",{className:"h-8 px-2 text-base leading-8",children:e.name});const n=e.command;switch(n.type){case Le.SUCCESS:case Le.AI_ASSERTION:const s=n.type===Le.AI_ASSERTION?n:n.condition;return k.jsx(xo,{autoFocus:t.autofocus,hint:k.jsx(Zo,{className:"prose prose-sm dark:prose-invert",children:Wxe}),disabled:t.disabled,value:(s==null?void 0:s.assertion)??"",placeholder:n.type===Le.AI_ASSERTION?"Verify the login page is visible":"Success condition (optional)",onChange:l=>{var f,d,p;if(n.type===Le.AI_ASSERTION){(f=t.onStepChange)==null||f.call(t,{type:$e.PRESET_ACTION,command:{type:n.type,assertion:l.target.value,useVision:n.useVision,disableCache:n.disableCache,cancelOnFailure:n.cancelOnFailure}});return}const c=l.target.value;if(c){const m=n.condition?n.condition:Y_(Le.AI_ASSERTION);(d=t.onStepChange)==null||d.call(t,{type:$e.PRESET_ACTION,command:{...n,condition:{...m,assertion:c}}});return}(p=t.onStepChange)==null||p.call(t,{type:$e.PRESET_ACTION,command:{...n,condition:void 0}})}});case Le.CLICK:return k.jsxs("div",{className:"relative w-full",children:[k.jsx(xo,{autoFocus:t.autofocus,hint:k.jsx(Zo,{className:"prose prose-sm dark:prose-invert",children:Lh}),disabled:t.disabled,placeholder:"The submit button",value:n.target.elementDescriptor,onChange:l=>{var c;(c=t.onStepChange)==null||c.call(t,{type:$e.PRESET_ACTION,command:{type:n.type,target:{elementDescriptor:l.target.value},doubleClick:n.doubleClick,rightClick:n.rightClick,useVision:n.useVision}})}}),k.jsx(Ah,{disabled:t.disabled,locateStatus:t.locateStatus,className:"absolute right-0 top-0",onLocate:()=>{var l;(l=t.onLocate)==null||l.call(t,n.target.elementDescriptor)}})]});case Le.HOVER:return k.jsxs("div",{className:"relative w-full",children:[k.jsx(xo,{autoFocus:t.autofocus,hint:k.jsx(Zo,{className:"prose prose-sm dark:prose-invert",children:Lh}),disabled:t.disabled,placeholder:"The link for more details",value:n.target.elementDescriptor,onChange:l=>{var c;(c=t.onStepChange)==null||c.call(t,{type:$e.PRESET_ACTION,command:{type:n.type,target:{elementDescriptor:l.target.value},useVision:n.useVision}})}}),k.jsx(Ah,{disabled:t.disabled,locateStatus:t.locateStatus,className:"absolute right-0 top-0",onLocate:()=>{var l;(l=t.onLocate)==null||l.call(t,n.target.elementDescriptor)}})]});case Le.TYPE:return k.jsxs("div",{className:"w-full space-y-2",children:[k.jsxs("div",{className:"relative",children:[k.jsx(xo,{autoFocus:t.autofocus,hint:k.jsx(Zo,{className:"prose prose-sm dark:prose-invert",children:Lh}),disabled:t.disabled,value:n.target.elementDescriptor,placeholder:"The password input",onChange:l=>{var c;(c=t.onStepChange)==null||c.call(t,{type:$e.PRESET_ACTION,command:{type:n.type,target:{elementDescriptor:l.target.value},value:n.value,clearContent:n.clearContent,pressEnter:n.pressEnter,pressKeysSequentially:!1,useVision:n.useVision}})}}),k.jsx(Ah,{disabled:t.disabled,locateStatus:t.locateStatus,className:"absolute right-0 top-0",onLocate:()=>{var l;(l=t.onLocate)==null||l.call(t,n.target.elementDescriptor)}})]}),k.jsx(xo,{hint:k.jsx(Zo,{className:"prose prose-sm dark:prose-invert",children:Hxe}),disabled:t.disabled,value:n.value,placeholder:"hello world",onChange:l=>{var c;(c=t.onStepChange)==null||c.call(t,{type:$e.PRESET_ACTION,command:{type:n.type,target:n.target,value:l.target.value,clearContent:n.clearContent,pressEnter:n.pressEnter,pressKeysSequentially:!1,useVision:n.useVision}})}})]});case Le.PRESS:return k.jsx(xo,{autoFocus:t.autofocus,hint:k.jsx(Zo,{className:"prose prose-sm dark:prose-invert",children:qxe}),disabled:t.disabled,value:n.value,placeholder:"Shift+Enter",onChange:l=>{var c;(c=t.onStepChange)==null||c.call(t,{type:$e.PRESET_ACTION,command:{type:n.type,value:l.target.value}})}});case Le.NAVIGATE:return k.jsx(jl,{autoFocus:t.autofocus,disabled:t.disabled,className:"h-8 px-2 py-0 text-base leading-8 shadow-none",value:n.url,placeholder:"https://example.com",onChange:l=>{var c;(c=t.onStepChange)==null||c.call(t,{type:$e.PRESET_ACTION,command:{type:n.type,url:l.target.value}})}});case Le.WAIT:return k.jsx(jl,{autoFocus:t.autofocus,disabled:t.disabled,type:"number",className:"h-8 px-2 py-0 text-base leading-8 shadow-none",value:n.delay,placeholder:"1",min:0,onChange:l=>{var c;(c=t.onStepChange)==null||c.call(t,{type:$e.PRESET_ACTION,command:{type:n.type,delay:parseInt(l.target.value)}})}});case Le.SELECT_OPTION:return k.jsxs("div",{className:"w-full space-y-2",children:[k.jsxs("div",{className:"relative",children:[k.jsx(xo,{autoFocus:t.autofocus,hint:k.jsx(Zo,{className:"prose prose-sm dark:prose-invert",children:Lh}),disabled:t.disabled,placeholder:"The max price select",value:n.target.elementDescriptor,onChange:l=>{var c;(c=t.onStepChange)==null||c.call(t,{type:$e.PRESET_ACTION,command:{type:n.type,target:{elementDescriptor:l.target.value},option:n.option}})}}),k.jsx(Ah,{disabled:t.disabled,locateStatus:t.locateStatus,className:"absolute right-0 top-0",onLocate:()=>{var l;(l=t.onLocate)==null||l.call(t,n.target.elementDescriptor)}})]}),(r=t.options)!=null&&r.length?k.jsxs(g9,{value:t.options.includes(n.option)?n.option:void 0,onValueChange:l=>{var c;(c=t.onStepChange)==null||c.call(t,{type:$e.PRESET_ACTION,command:{type:n.type,target:n.target,option:l}})},children:[k.jsx(iT,{className:"h-8 text-base leading-8",children:k.jsx(v9,{placeholder:"Select an option"})}),k.jsx(oT,{children:t.options.map(l=>k.jsx(Rc,{value:l,children:l},l))})]}):k.jsx("div",{className:"h-8 text-base leading-8",children:n.option||"No option selected."})]});case Le.TAB:return k.jsx("div",{className:"relative w-full",children:k.jsx(xo,{autoFocus:t.autofocus,hint:k.jsx(Zo,{className:"prose prose-sm dark:prose-invert",children:Kxe}),disabled:t.disabled,placeholder:"othertab.yoursite.com",value:n.url,onChange:l=>{var c;(c=t.onStepChange)==null||c.call(t,{type:$e.PRESET_ACTION,command:{type:n.type,url:l.target.value.trim()}})}})});case Le.COOKIE:return k.jsx("div",{className:"relative w-full",children:k.jsx(xo,{autoFocus:t.autofocus,hint:k.jsx(Zo,{className:"prose prose-sm dark:prose-invert",children:Gxe}),disabled:t.disabled,placeholder:"id=1; domain=google.com; path=/",value:n.value,onChange:l=>{var c;(c=t.onStepChange)==null||c.call(t,{type:$e.PRESET_ACTION,command:{...n,value:l.target.value}})}})});case Le.LOCAL_STORAGE:return k.jsxs("div",{className:"w-full space-y-2",children:[k.jsx(B0,{autoFocus:t.autofocus,disabled:t.disabled,value:n.key,placeholder:"key",onChange:l=>{var c;(c=t.onStepChange)==null||c.call(t,{type:$e.PRESET_ACTION,command:{...n,key:l.target.value}})}}),k.jsx(B0,{disabled:t.disabled,value:n.value,placeholder:"value",onChange:l=>{var c;(c=t.onStepChange)==null||c.call(t,{type:$e.PRESET_ACTION,command:{...n,value:l.target.value}})}})]});case Le.SCROLL_UP:case Le.SCROLL_DOWN:return k.jsxs("div",{className:"w-full space-y-2",children:[k.jsxs("div",{className:"relative w-full",children:[k.jsx(xo,{autoFocus:t.autofocus,hint:k.jsx(Zo,{className:"prose prose-sm dark:prose-invert",children:Lh}),disabled:t.disabled,placeholder:"(Optional) Element to hover",value:((i=n.target)==null?void 0:i.elementDescriptor)??"",onChange:l=>{var c;(c=t.onStepChange)==null||c.call(t,{type:$e.PRESET_ACTION,command:{type:n.type,target:{elementDescriptor:l.target.value},useVision:n.useVision}})}}),k.jsx(Ah,{disabled:t.disabled||!((o=n.target)!=null&&o.elementDescriptor.trim()),locateStatus:t.locateStatus,className:"absolute right-0 top-0",onLocate:()=>{var l,c;(c=t.onLocate)==null||c.call(t,((l=n.target)==null?void 0:l.elementDescriptor.trim())||"")}})]}),k.jsx(jl,{autoFocus:t.autofocus,disabled:t.disabled,type:"number",className:"h-8 px-2 py-0 text-base leading-8 shadow-none",value:n.deltaY,placeholder:"(Optional) pixels to scroll",min:0,onChange:l=>{var f;let c;l.target.value&&(c=parseInt(l.target.value)),(f=t.onStepChange)==null||f.call(t,{type:$e.PRESET_ACTION,command:{type:n.type,target:n.target,useVision:n.useVision,deltaY:c}})}})]});case Le.REQUEST:return k.jsxs("div",{className:"flex w-full items-center justify-between gap-2",children:[k.jsxs("span",{className:"max-w-[300px] truncate",children:[n.method," ",n.url]}),k.jsx(Vxe,{command:n,onChange:l=>{var c;(c=t.onStepChange)==null||c.call(t,{type:$e.PRESET_ACTION,command:l})}})]});case Le.CAPTCHA:case Le.GO_BACK:case Le.GO_FORWARD:case Le.REFRESH:return;default:return(l=>{throw"If Typescript complains about the line below, you missed a case or break in the switch above"})()}},bE=t=>{const{modules:e,state:n,disabled:r,showCheckbox:i,inAIStep:o,inModule:s,onExpandChange:a,onSelectChange:l,onDelete:c,onStepChange:f,onLocate:d,onAddBefore:p,onAddAfter:m,onMoveDown:v,onMoveUp:b,onExecute:S}=t,{selected:x,step:w,expanded:C,locateStatus:T,status:A,children:_,options:R,message:M,output:I}=n,V=g.useId();let U;switch(w.type){case $e.AI_ACTION:U={type:w.type};break;case"RESOLVED_MODULE":U={type:w.type,moduleId:w.moduleId,name:w.name,steps:w.steps};break;case $e.PRESET_ACTION:U={type:w.type,command:w.command.type};break;default:return(G=>{throw"If Typescript complains about the line below, you missed a case or break in the switch above"})()}return k.jsxs("div",{className:"space-y-2",children:[t.parentCardId&&k.jsx(zN,{start:t.parentCardId,end:V,startAnchor:"left",endAnchor:"left",path:"grid",showHead:!1,strokeWidth:2,color:"hsl(var(--border))"}),k.jsxs("div",{className:"group/card bg-background relative z-10 flex items-start gap-2 rounded border pl-4 shadow",id:V,children:[k.jsx("div",{className:"bg-background invisible absolute left-[50%] top-0 z-10 flex h-9 w-max translate-x-[-50%] translate-y-[-50%] rounded-md shadow group-hover/card:visible [&:has([data-state=open])]:visible",children:k.jsx(Xce,{modules:e,onAddBefore:L=>p==null?void 0:p(L,[]),onAddAfter:L=>m==null?void 0:m(L,[]),onDelete:()=>c==null?void 0:c([]),onMoveDown:()=>v==null?void 0:v([]),onMoveUp:()=>b==null?void 0:b([]),canAddChild:w.type!==$e.PRESET_ACTION,disallowModification:w.type===$e.PRESET_ACTION&&w.command.type===Le.SUCCESS,canAddAfter:!(w.type===$e.PRESET_ACTION&&w.command.type===Le.SUCCESS),hideModules:s||o,aiSuggestibleCommandsOnly:o,aiSuggestibleCommandsChildrenOnly:w.type===$e.AI_ACTION,disabled:r,onAddChild:L=>p==null?void 0:p(L,[_.length])})}),i&&k.jsx("div",{className:"flex flex-col justify-between self-stretch py-4",children:k.jsx("div",{className:"group/checkbox flex h-9 items-center",children:k.jsx(d6,{checked:x,disabled:r,onCheckedChange:L=>{l==null||l(!!L,[])}})})}),k.jsxs("div",{className:"w-full space-y-2 py-4",children:[k.jsxs("div",{className:"flex items-start gap-2",children:[k.jsx(Yce,{modules:e,disabled:r,value:U,onChange:L=>{if(L.type===$e.AI_ACTION){f==null||f({type:L.type,text:""},[]);return}if(L.type==="RESOLVED_MODULE"){f==null||f({type:L.type,moduleId:L.moduleId,name:L.name,steps:L.steps},[]);return}f==null||f({type:L.type,command:Y_(L.command)},[])}}),k.jsx("div",{className:"w-full space-y-2",children:k.jsx(Yxe,{autofocus:t.autofocusInput,disabled:r,step:w,options:R,locateStatus:T,onStepChange:L=>f==null?void 0:f(L,[]),onLocate:L=>{const G=w.type===$e.PRESET_ACTION&&"useVision"in w.command?w.command.useVision:!1;d==null||d(L,G,[])}})}),w.type==="RESOLVED_MODULE"&&k.jsx(Tn,{variant:"plain",size:"icon",className:"ml-auto h-8 w-8",onClick:()=>{a==null||a(!C,[])},children:C?k.jsx(yse,{className:"h-7 w-7",strokeWidth:1}):k.jsx(sse,{className:"h-7 w-7",strokeWidth:1})}),k.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[k.jsx(oue,{disabled:r,step:w,onStepChange:L=>f==null?void 0:f(L,[])}),k.jsx(Tn,{variant:"plain",size:"icon",className:"h-8 w-8",disabled:r,onClick:()=>S==null?void 0:S([]),children:A===Mn.RUNNING?k.jsx(o6,{className:"h-7 w-7 animate-spin",strokeWidth:1}):k.jsx(fse,{className:"h-7 w-7",strokeWidth:1})})]})]}),w.type==="RESOLVED_MODULE"&&k.jsx("div",{className:"text-muted-foreground font-mono text-sm",children:"Editing a module will update it everywhere it is used."}),w.type===$e.PRESET_ACTION&&w.command.type===Le.SELECT_OPTION&&k.jsx("div",{className:"text-muted-foreground font-mono text-sm",children:"Locate the dropdown to view possible options."}),w.type===$e.PRESET_ACTION&&w.command.type===Le.SUCCESS&&k.jsx("div",{className:"text-muted-foreground font-mono text-sm",children:"Leave blank to succeed after all commands run."}),k.jsx(Jae,{output:I})]}),k.jsx("div",{className:ft("bg-muted w-2 shrink-0 self-stretch rounded-r",{"bg-green-600":A===Mn.SUCCESS,"bg-yellow-600":A===Mn.CANCELLED,"bg-destructive":A===Mn.FAILED})})]}),w.type===$e.AI_ACTION&&k.jsxs("div",{className:"ml-14 space-y-2",children:[_.map((L,G)=>{const K=F=>[G,...F];return k.jsx(bE,{modules:e,index:G,state:L,inAIStep:!0,disabled:r,showCheckbox:!1,autofocusInput:!1,onStepChange:(F,ie)=>f==null?void 0:f(F,K(ie)),onAddBefore:(F,ie)=>p==null?void 0:p(F,K(ie)),onAddAfter:(F,ie)=>m==null?void 0:m(F,K(ie)),onMoveDown:F=>v==null?void 0:v(K(F)),onMoveUp:F=>b==null?void 0:b(K(F)),onExecute:F=>S==null?void 0:S(K(F)),onDelete:F=>c==null?void 0:c(K(F)),onSelectChange:(F,ie)=>l==null?void 0:l(F,K(ie)),onExpandChange:(F,ie)=>a==null?void 0:a(F,K(ie)),onLocate:(F,ie,ae)=>d==null?void 0:d(F,ie,K(ae)),parentCardId:V},L.uniqueId)}),M&&k.jsxs("div",{id:`${V}-log`,className:ft("text-muted-foreground relative rounded border p-4 font-mono text-sm shadow",{"text-destructive":A===Mn.FAILED}),children:[k.jsx(zN,{start:V,startAnchor:"left",endAnchor:"left",end:`${V}-log`,path:"grid",showHead:!1,strokeWidth:2,color:"hsl(var(--border))"}),k.jsx("div",{className:"overflow-auto",children:M})]})]}),C&&k.jsx("div",{className:"ml-14 space-y-2",children:_.map((L,G)=>{const K=F=>[G,...F];return k.jsx(bE,{modules:e,index:G,state:L,disabled:r,showCheckbox:!1,autofocusInput:!1,inModule:!0,inAIStep:!1,onStepChange:(F,ie)=>f==null?void 0:f(F,K(ie)),onAddBefore:(F,ie)=>p==null?void 0:p(F,K(ie)),onAddAfter:(F,ie)=>m==null?void 0:m(F,K(ie)),onMoveDown:F=>v==null?void 0:v(K(F)),onMoveUp:F=>b==null?void 0:b(K(F)),onExecute:F=>S==null?void 0:S(K(F)),onDelete:F=>c==null?void 0:c(K(F)),onSelectChange:(F,ie)=>l==null?void 0:l(F,K(ie)),onExpandChange:(F,ie)=>a==null?void 0:a(F,K(ie)),onLocate:(F,ie,ae)=>d==null?void 0:d(F,ie,K(ae)),parentCardId:V},L.uniqueId)})})]})},Xxe={Date:!0,RegExp:!0,String:!0,Number:!0};function Ty(t,e,n={cyclesFix:!0},r=[]){var a,l;let i=[];const o=Array.isArray(t);for(const c in t){const f=t[c],d=o?+c:c;if(!(c in e)){i.push({type:"REMOVE",path:[d],oldValue:t[c]});continue}const p=e[c],m=typeof f=="object"&&typeof p=="object";if(f&&p&&m&&!Xxe[(l=(a=Object.getPrototypeOf(f))==null?void 0:a.constructor)==null?void 0:l.name]&&(!n.cyclesFix||!r.includes(f))){const v=Ty(f,p,n,n.cyclesFix?r.concat([f]):[]);i.push.apply(i,v.map(b=>(b.path.unshift(d),b)))}else f!==p&&!(m&&(isNaN(f)?f+""==p+"":+f==+p))&&i.push({path:[d],type:"CHANGE",value:p,oldValue:f})}const s=Array.isArray(e);for(const c in e)c in t||i.push({type:"CREATE",path:[s?+c:c],value:e[c]});return i}const ta=Object.create(null);ta.open="0";ta.close="1";ta.ping="2";ta.pong="3";ta.message="4";ta.upgrade="5";ta.noop="6";const Ay=Object.create(null);Object.keys(ta).forEach(t=>{Ay[ta[t]]=t});const wE={type:"error",data:"parser error"},zF=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",VF=typeof ArrayBuffer=="function",UF=t=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(t):t&&t.buffer instanceof ArrayBuffer,$T=({type:t,data:e},n,r)=>zF&&e instanceof Blob?n?r(e):r$(e,r):VF&&(e instanceof ArrayBuffer||UF(e))?n?r(e):r$(new Blob([e]),r):r(ta[t]+(e||"")),r$=(t,e)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];e("b"+(r||""))},n.readAsDataURL(t)};function i$(t){return t instanceof Uint8Array?t:t instanceof ArrayBuffer?new Uint8Array(t):new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}let DS;function Zxe(t,e){if(zF&&t.data instanceof Blob)return t.data.arrayBuffer().then(i$).then(e);if(VF&&(t.data instanceof ArrayBuffer||UF(t.data)))return e(i$(t.data));$T(t,!1,n=>{DS||(DS=new TextEncoder),e(DS.encode(n))})}const o$="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Gh=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let t=0;t<o$.length;t++)Gh[o$.charCodeAt(t)]=t;const Qxe=t=>{let e=t.length*.75,n=t.length,r,i=0,o,s,a,l;t[t.length-1]==="="&&(e--,t[t.length-2]==="="&&e--);const c=new ArrayBuffer(e),f=new Uint8Array(c);for(r=0;r<n;r+=4)o=Gh[t.charCodeAt(r)],s=Gh[t.charCodeAt(r+1)],a=Gh[t.charCodeAt(r+2)],l=Gh[t.charCodeAt(r+3)],f[i++]=o<<2|s>>4,f[i++]=(s&15)<<4|a>>2,f[i++]=(a&3)<<6|l&63;return c},Jxe=typeof ArrayBuffer=="function",IT=(t,e)=>{if(typeof t!="string")return{type:"message",data:WF(t,e)};const n=t.charAt(0);return n==="b"?{type:"message",data:eSe(t.substring(1),e)}:Ay[n]?t.length>1?{type:Ay[n],data:t.substring(1)}:{type:Ay[n]}:wE},eSe=(t,e)=>{if(Jxe){const n=Qxe(t);return WF(n,e)}else return{base64:!0,data:t}},WF=(t,e)=>{switch(e){case"blob":return t instanceof Blob?t:new Blob([t]);case"arraybuffer":default:return t instanceof ArrayBuffer?t:t.buffer}},HF="",tSe=(t,e)=>{const n=t.length,r=new Array(n);let i=0;t.forEach((o,s)=>{$T(o,!1,a=>{r[s]=a,++i===n&&e(r.join(HF))})})},nSe=(t,e)=>{const n=t.split(HF),r=[];for(let i=0;i<n.length;i++){const o=IT(n[i],e);if(r.push(o),o.type==="error")break}return r};function rSe(){return new TransformStream({transform(t,e){Zxe(t,n=>{const r=n.length;let i;if(r<126)i=new Uint8Array(1),new DataView(i.buffer).setUint8(0,r);else if(r<65536){i=new Uint8Array(3);const o=new DataView(i.buffer);o.setUint8(0,126),o.setUint16(1,r)}else{i=new Uint8Array(9);const o=new DataView(i.buffer);o.setUint8(0,127),o.setBigUint64(1,BigInt(r))}t.data&&typeof t.data!="string"&&(i[0]|=128),e.enqueue(i),e.enqueue(n)})}})}let LS;function zv(t){return t.reduce((e,n)=>e+n.length,0)}function Vv(t,e){if(t[0].length===e)return t.shift();const n=new Uint8Array(e);let r=0;for(let i=0;i<e;i++)n[i]=t[0][r++],r===t[0].length&&(t.shift(),r=0);return t.length&&r<t[0].length&&(t[0]=t[0].slice(r)),n}function iSe(t,e){LS||(LS=new TextDecoder);const n=[];let r=0,i=-1,o=!1;return new TransformStream({transform(s,a){for(n.push(s);;){if(r===0){if(zv(n)<1)break;const l=Vv(n,1);o=(l[0]&128)===128,i=l[0]&127,i<126?r=3:i===126?r=1:r=2}else if(r===1){if(zv(n)<2)break;const l=Vv(n,2);i=new DataView(l.buffer,l.byteOffset,l.length).getUint16(0),r=3}else if(r===2){if(zv(n)<8)break;const l=Vv(n,8),c=new DataView(l.buffer,l.byteOffset,l.length),f=c.getUint32(0);if(f>Math.pow(2,21)-1){a.enqueue(wE);break}i=f*Math.pow(2,32)+c.getUint32(4),r=3}else{if(zv(n)<i)break;const l=Vv(n,i);a.enqueue(IT(o?l:LS.decode(l),e)),r=0}if(i===0||i>t){a.enqueue(wE);break}}}})}const qF=4;function ar(t){if(t)return oSe(t)}function oSe(t){for(var e in ar.prototype)t[e]=ar.prototype[e];return t}ar.prototype.on=ar.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(e),this};ar.prototype.once=function(t,e){function n(){this.off(t,n),e.apply(this,arguments)}return n.fn=e,this.on(t,n),this};ar.prototype.off=ar.prototype.removeListener=ar.prototype.removeAllListeners=ar.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks["$"+t];if(!n)return this;if(arguments.length==1)return delete this._callbacks["$"+t],this;for(var r,i=0;i<n.length;i++)if(r=n[i],r===e||r.fn===e){n.splice(i,1);break}return n.length===0&&delete this._callbacks["$"+t],this};ar.prototype.emit=function(t){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),n=this._callbacks["$"+t],r=1;r<arguments.length;r++)e[r-1]=arguments[r];if(n){n=n.slice(0);for(var r=0,i=n.length;r<i;++r)n[r].apply(this,e)}return this};ar.prototype.emitReserved=ar.prototype.emit;ar.prototype.listeners=function(t){return this._callbacks=this._callbacks||{},this._callbacks["$"+t]||[]};ar.prototype.hasListeners=function(t){return!!this.listeners(t).length};const Ao=typeof self<"u"?self:typeof window<"u"?window:Function("return this")();function KF(t,...e){return e.reduce((n,r)=>(t.hasOwnProperty(r)&&(n[r]=t[r]),n),{})}const sSe=Ao.setTimeout,aSe=Ao.clearTimeout;function D1(t,e){e.useNativeTimers?(t.setTimeoutFn=sSe.bind(Ao),t.clearTimeoutFn=aSe.bind(Ao)):(t.setTimeoutFn=Ao.setTimeout.bind(Ao),t.clearTimeoutFn=Ao.clearTimeout.bind(Ao))}const lSe=1.33;function cSe(t){return typeof t=="string"?uSe(t):Math.ceil((t.byteLength||t.size)*lSe)}function uSe(t){let e=0,n=0;for(let r=0,i=t.length;r<i;r++)e=t.charCodeAt(r),e<128?n+=1:e<2048?n+=2:e<55296||e>=57344?n+=3:(r++,n+=4);return n}function fSe(t){let e="";for(let n in t)t.hasOwnProperty(n)&&(e.length&&(e+="&"),e+=encodeURIComponent(n)+"="+encodeURIComponent(t[n]));return e}function dSe(t){let e={},n=t.split("&");for(let r=0,i=n.length;r<i;r++){let o=n[r].split("=");e[decodeURIComponent(o[0])]=decodeURIComponent(o[1])}return e}class hSe extends Error{constructor(e,n,r){super(e),this.description=n,this.context=r,this.type="TransportError"}}class jT extends ar{constructor(e){super(),this.writable=!1,D1(this,e),this.opts=e,this.query=e.query,this.socket=e.socket}onError(e,n,r){return super.emitReserved("error",new hSe(e,n,r)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(e){this.readyState==="open"&&this.write(e)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(e){const n=IT(e,this.socket.binaryType);this.onPacket(n)}onPacket(e){super.emitReserved("packet",e)}onClose(e){this.readyState="closed",super.emitReserved("close",e)}pause(e){}createUri(e,n={}){return e+"://"+this._hostname()+this._port()+this.opts.path+this._query(n)}_hostname(){const e=this.opts.hostname;return e.indexOf(":")===-1?e:"["+e+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(e){const n=fSe(e);return n.length?"?"+n:""}}const GF="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),xE=64,pSe={};let s$=0,Uv=0,a$;function l$(t){let e="";do e=GF[t%xE]+e,t=Math.floor(t/xE);while(t>0);return e}function YF(){const t=l$(+new Date);return t!==a$?(s$=0,a$=t):t+"."+l$(s$++)}for(;Uv<xE;Uv++)pSe[GF[Uv]]=Uv;let XF=!1;try{XF=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const mSe=XF;function ZF(t){const e=t.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!e||mSe))return new XMLHttpRequest}catch{}if(!e)try{return new Ao[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}function gSe(){}const vSe=function(){return new ZF({xdomain:!1}).responseType!=null}();class ySe extends jT{constructor(e){if(super(e),this.polling=!1,typeof location<"u"){const r=location.protocol==="https:";let i=location.port;i||(i=r?"443":"80"),this.xd=typeof location<"u"&&e.hostname!==location.hostname||i!==e.port}const n=e&&e.forceBase64;this.supportsBinary=vSe&&!n,this.opts.withCredentials&&(this.cookieJar=void 0)}get name(){return"polling"}doOpen(){this.poll()}pause(e){this.readyState="pausing";const n=()=>{this.readyState="paused",e()};if(this.polling||!this.writable){let r=0;this.polling&&(r++,this.once("pollComplete",function(){--r||n()})),this.writable||(r++,this.once("drain",function(){--r||n()}))}else n()}poll(){this.polling=!0,this.doPoll(),this.emitReserved("poll")}onData(e){const n=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};nSe(e,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this.polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this.poll())}doClose(){const e=()=>{this.write([{type:"close"}])};this.readyState==="open"?e():this.once("open",e)}write(e){this.writable=!1,tSe(e,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const e=this.opts.secure?"https":"http",n=this.query||{};return this.opts.timestampRequests!==!1&&(n[this.opts.timestampParam]=YF()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(e,n)}request(e={}){return Object.assign(e,{xd:this.xd,cookieJar:this.cookieJar},this.opts),new Xf(this.uri(),e)}doWrite(e,n){const r=this.request({method:"POST",data:e});r.on("success",n),r.on("error",(i,o)=>{this.onError("xhr post error",i,o)})}doPoll(){const e=this.request();e.on("data",this.onData.bind(this)),e.on("error",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=e}}let Xf=class Oy extends ar{constructor(e,n){super(),D1(this,n),this.opts=n,this.method=n.method||"GET",this.uri=e,this.data=n.data!==void 0?n.data:null,this.create()}create(){var e;const n=KF(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");n.xdomain=!!this.opts.xd;const r=this.xhr=new ZF(n);try{r.open(this.method,this.uri,!0);try{if(this.opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let i in this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(i)&&r.setRequestHeader(i,this.opts.extraHeaders[i])}}catch{}if(this.method==="POST")try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{r.setRequestHeader("Accept","*/*")}catch{}(e=this.opts.cookieJar)===null||e===void 0||e.addCookies(r),"withCredentials"in r&&(r.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(r.timeout=this.opts.requestTimeout),r.onreadystatechange=()=>{var i;r.readyState===3&&((i=this.opts.cookieJar)===null||i===void 0||i.parseCookies(r)),r.readyState===4&&(r.status===200||r.status===1223?this.onLoad():this.setTimeoutFn(()=>{this.onError(typeof r.status=="number"?r.status:0)},0))},r.send(this.data)}catch(i){this.setTimeoutFn(()=>{this.onError(i)},0);return}typeof document<"u"&&(this.index=Oy.requestsCount++,Oy.requests[this.index]=this)}onError(e){this.emitReserved("error",e,this.xhr),this.cleanup(!0)}cleanup(e){if(!(typeof this.xhr>"u"||this.xhr===null)){if(this.xhr.onreadystatechange=gSe,e)try{this.xhr.abort()}catch{}typeof document<"u"&&delete Oy.requests[this.index],this.xhr=null}}onLoad(){const e=this.xhr.responseText;e!==null&&(this.emitReserved("data",e),this.emitReserved("success"),this.cleanup())}abort(){this.cleanup()}};Xf.requestsCount=0;Xf.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",c$);else if(typeof addEventListener=="function"){const t="onpagehide"in Ao?"pagehide":"unload";addEventListener(t,c$,!1)}}function c$(){for(let t in Xf.requests)Xf.requests.hasOwnProperty(t)&&Xf.requests[t].abort()}const BT=typeof Promise=="function"&&typeof Promise.resolve=="function"?e=>Promise.resolve().then(e):(e,n)=>n(e,0),Wv=Ao.WebSocket||Ao.MozWebSocket,u$=!0,bSe="arraybuffer",f$=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class wSe extends jT{constructor(e){super(e),this.supportsBinary=!e.forceBase64}get name(){return"websocket"}doOpen(){if(!this.check())return;const e=this.uri(),n=this.opts.protocols,r=f$?{}:KF(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=u$&&!f$?n?new Wv(e,n):new Wv(e):new Wv(e,n,r)}catch(i){return this.emitReserved("error",i)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=e=>this.onClose({description:"websocket connection closed",context:e}),this.ws.onmessage=e=>this.onData(e.data),this.ws.onerror=e=>this.onError("websocket error",e)}write(e){this.writable=!1;for(let n=0;n<e.length;n++){const r=e[n],i=n===e.length-1;$T(r,this.supportsBinary,o=>{const s={};try{u$&&this.ws.send(o)}catch{}i&&BT(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.close(),this.ws=null)}uri(){const e=this.opts.secure?"wss":"ws",n=this.query||{};return this.opts.timestampRequests&&(n[this.opts.timestampParam]=YF()),this.supportsBinary||(n.b64=1),this.createUri(e,n)}check(){return!!Wv}}class xSe extends jT{get name(){return"webtransport"}doOpen(){typeof WebTransport=="function"&&(this.transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name]),this.transport.closed.then(()=>{this.onClose()}).catch(e=>{this.onError("webtransport error",e)}),this.transport.ready.then(()=>{this.transport.createBidirectionalStream().then(e=>{const n=iSe(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=e.readable.pipeThrough(n).getReader(),i=rSe();i.readable.pipeTo(e.writable),this.writer=i.writable.getWriter();const o=()=>{r.read().then(({done:a,value:l})=>{a||(this.onPacket(l),o())}).catch(a=>{})};o();const s={type:"open"};this.query.sid&&(s.data=`{"sid":"${this.query.sid}"}`),this.writer.write(s).then(()=>this.onOpen())})}))}write(e){this.writable=!1;for(let n=0;n<e.length;n++){const r=e[n],i=n===e.length-1;this.writer.write(r).then(()=>{i&&BT(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var e;(e=this.transport)===null||e===void 0||e.close()}}const SSe={websocket:wSe,webtransport:xSe,polling:ySe},CSe=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,kSe=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function SE(t){const e=t,n=t.indexOf("["),r=t.indexOf("]");n!=-1&&r!=-1&&(t=t.substring(0,n)+t.substring(n,r).replace(/:/g,";")+t.substring(r,t.length));let i=CSe.exec(t||""),o={},s=14;for(;s--;)o[kSe[s]]=i[s]||"";return n!=-1&&r!=-1&&(o.source=e,o.host=o.host.substring(1,o.host.length-1).replace(/;/g,":"),o.authority=o.authority.replace("[","").replace("]","").replace(/;/g,":"),o.ipv6uri=!0),o.pathNames=ESe(o,o.path),o.queryKey=_Se(o,o.query),o}function ESe(t,e){const n=/\/{2,9}/g,r=e.replace(n,"/").split("/");return(e.slice(0,1)=="/"||e.length===0)&&r.splice(0,1),e.slice(-1)=="/"&&r.splice(r.length-1,1),r}function _Se(t,e){const n={};return e.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,i,o){i&&(n[i]=o)}),n}let QF=class uf extends ar{constructor(e,n={}){super(),this.binaryType=bSe,this.writeBuffer=[],e&&typeof e=="object"&&(n=e,e=null),e?(e=SE(e),n.hostname=e.host,n.secure=e.protocol==="https"||e.protocol==="wss",n.port=e.port,e.query&&(n.query=e.query)):n.host&&(n.hostname=SE(n.host).host),D1(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=n.transports||["polling","websocket","webtransport"],this.writeBuffer=[],this.prevBufferLen=0,this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},n),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=dSe(this.opts.query)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingTimeoutTimer=null,typeof addEventListener=="function"&&(this.opts.closeOnBeforeunload&&(this.beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this.beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this.offlineEventListener=()=>{this.onClose("transport close",{description:"network connection lost"})},addEventListener("offline",this.offlineEventListener,!1))),this.open()}createTransport(e){const n=Object.assign({},this.opts.query);n.EIO=qF,n.transport=e,this.id&&(n.sid=this.id);const r=Object.assign({},this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[e]);return new SSe[e](r)}open(){let e;if(this.opts.rememberUpgrade&&uf.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1)e="websocket";else if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}else e=this.transports[0];this.readyState="opening";try{e=this.createTransport(e)}catch{this.transports.shift(),this.open();return}e.open(),this.setTransport(e)}setTransport(e){this.transport&&this.transport.removeAllListeners(),this.transport=e,e.on("drain",this.onDrain.bind(this)).on("packet",this.onPacket.bind(this)).on("error",this.onError.bind(this)).on("close",n=>this.onClose("transport close",n))}probe(e){let n=this.createTransport(e),r=!1;uf.priorWebsocketSuccess=!1;const i=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",d=>{if(!r)if(d.type==="pong"&&d.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;uf.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(f(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const p=new Error("probe error");p.transport=n.name,this.emitReserved("upgradeError",p)}}))};function o(){r||(r=!0,f(),n.close(),n=null)}const s=d=>{const p=new Error("probe error: "+d);p.transport=n.name,o(),this.emitReserved("upgradeError",p)};function a(){s("transport closed")}function l(){s("socket closed")}function c(d){n&&d.name!==n.name&&o()}const f=()=>{n.removeListener("open",i),n.removeListener("error",s),n.removeListener("close",a),this.off("close",l),this.off("upgrading",c)};n.once("open",i),n.once("error",s),n.once("close",a),this.once("close",l),this.once("upgrading",c),this.upgrades.indexOf("webtransport")!==-1&&e!=="webtransport"?this.setTimeoutFn(()=>{r||n.open()},200):n.open()}onOpen(){if(this.readyState="open",uf.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush(),this.readyState==="open"&&this.opts.upgrade){let e=0;const n=this.upgrades.length;for(;e<n;e++)this.probe(this.upgrades[e])}}onPacket(e){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",e),this.emitReserved("heartbeat"),this.resetPingTimeout(),e.type){case"open":this.onHandshake(JSON.parse(e.data));break;case"ping":this.sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong");break;case"error":const n=new Error("server error");n.code=e.data,this.onError(n);break;case"message":this.emitReserved("data",e.data),this.emitReserved("message",e.data);break}}onHandshake(e){this.emitReserved("handshake",e),this.id=e.sid,this.transport.query.sid=e.sid,this.upgrades=this.filterUpgrades(e.upgrades),this.pingInterval=e.pingInterval,this.pingTimeout=e.pingTimeout,this.maxPayload=e.maxPayload,this.onOpen(),this.readyState!=="closed"&&this.resetPingTimeout()}resetPingTimeout(){this.clearTimeoutFn(this.pingTimeoutTimer),this.pingTimeoutTimer=this.setTimeoutFn(()=>{this.onClose("ping timeout")},this.pingInterval+this.pingTimeout),this.opts.autoUnref&&this.pingTimeoutTimer.unref()}onDrain(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const e=this.getWritablePackets();this.transport.send(e),this.prevBufferLen=e.length,this.emitReserved("flush")}}getWritablePackets(){if(!(this.maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let r=0;r<this.writeBuffer.length;r++){const i=this.writeBuffer[r].data;if(i&&(n+=cSe(i)),r>0&&n>this.maxPayload)return this.writeBuffer.slice(0,r);n+=2}return this.writeBuffer}write(e,n,r){return this.sendPacket("message",e,n,r),this}send(e,n,r){return this.sendPacket("message",e,n,r),this}sendPacket(e,n,r,i){if(typeof n=="function"&&(i=n,n=void 0),typeof r=="function"&&(i=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const o={type:e,data:n,options:r};this.emitReserved("packetCreate",o),this.writeBuffer.push(o),i&&this.once("flush",i),this.flush()}close(){const e=()=>{this.onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),e()},r=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():e()}):this.upgrading?r():e()),this}onError(e){uf.priorWebsocketSuccess=!1,this.emitReserved("error",e),this.onClose("transport error",e)}onClose(e,n){(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")&&(this.clearTimeoutFn(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),typeof removeEventListener=="function"&&(removeEventListener("beforeunload",this.beforeunloadEventListener,!1),removeEventListener("offline",this.offlineEventListener,!1)),this.readyState="closed",this.id=null,this.emitReserved("close",e,n),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(e){const n=[];let r=0;const i=e.length;for(;r<i;r++)~this.transports.indexOf(e[r])&&n.push(e[r]);return n}};QF.protocol=qF;function TSe(t,e="",n){let r=t;n=n||typeof location<"u"&&location,t==null&&(t=n.protocol+"//"+n.host),typeof t=="string"&&(t.charAt(0)==="/"&&(t.charAt(1)==="/"?t=n.protocol+t:t=n.host+t),/^(https?|wss?):\/\//.test(t)||(typeof n<"u"?t=n.protocol+"//"+t:t="https://"+t),r=SE(t)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const o=r.host.indexOf(":")!==-1?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+o+":"+r.port+e,r.href=r.protocol+"://"+o+(n&&n.port===r.port?"":":"+r.port),r}const ASe=typeof ArrayBuffer=="function",OSe=t=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(t):t.buffer instanceof ArrayBuffer,JF=Object.prototype.toString,RSe=typeof Blob=="function"||typeof Blob<"u"&&JF.call(Blob)==="[object BlobConstructor]",PSe=typeof File=="function"||typeof File<"u"&&JF.call(File)==="[object FileConstructor]";function FT(t){return ASe&&(t instanceof ArrayBuffer||OSe(t))||RSe&&t instanceof Blob||PSe&&t instanceof File}function Ry(t,e){if(!t||typeof t!="object")return!1;if(Array.isArray(t)){for(let n=0,r=t.length;n<r;n++)if(Ry(t[n]))return!0;return!1}if(FT(t))return!0;if(t.toJSON&&typeof t.toJSON=="function"&&arguments.length===1)return Ry(t.toJSON(),!0);for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&Ry(t[n]))return!0;return!1}function NSe(t){const e=[],n=t.data,r=t;return r.data=CE(n,e),r.attachments=e.length,{packet:r,buffers:e}}function CE(t,e){if(!t)return t;if(FT(t)){const n={_placeholder:!0,num:e.length};return e.push(t),n}else if(Array.isArray(t)){const n=new Array(t.length);for(let r=0;r<t.length;r++)n[r]=CE(t[r],e);return n}else if(typeof t=="object"&&!(t instanceof Date)){const n={};for(const r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=CE(t[r],e));return n}return t}function MSe(t,e){return t.data=kE(t.data,e),delete t.attachments,t}function kE(t,e){if(!t)return t;if(t&&t._placeholder===!0){if(typeof t.num=="number"&&t.num>=0&&t.num<e.length)return e[t.num];throw new Error("illegal attachments")}else if(Array.isArray(t))for(let n=0;n<t.length;n++)t[n]=kE(t[n],e);else if(typeof t=="object")for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&(t[n]=kE(t[n],e));return t}const DSe=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],LSe=5;var Wt;(function(t){t[t.CONNECT=0]="CONNECT",t[t.DISCONNECT=1]="DISCONNECT",t[t.EVENT=2]="EVENT",t[t.ACK=3]="ACK",t[t.CONNECT_ERROR=4]="CONNECT_ERROR",t[t.BINARY_EVENT=5]="BINARY_EVENT",t[t.BINARY_ACK=6]="BINARY_ACK"})(Wt||(Wt={}));class $Se{constructor(e){this.replacer=e}encode(e){return(e.type===Wt.EVENT||e.type===Wt.ACK)&&Ry(e)?this.encodeAsBinary({type:e.type===Wt.EVENT?Wt.BINARY_EVENT:Wt.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id}):[this.encodeAsString(e)]}encodeAsString(e){let n=""+e.type;return(e.type===Wt.BINARY_EVENT||e.type===Wt.BINARY_ACK)&&(n+=e.attachments+"-"),e.nsp&&e.nsp!=="/"&&(n+=e.nsp+","),e.id!=null&&(n+=e.id),e.data!=null&&(n+=JSON.stringify(e.data,this.replacer)),n}encodeAsBinary(e){const n=NSe(e),r=this.encodeAsString(n.packet),i=n.buffers;return i.unshift(r),i}}function d$(t){return Object.prototype.toString.call(t)==="[object Object]"}class zT extends ar{constructor(e){super(),this.reviver=e}add(e){let n;if(typeof e=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");n=this.decodeString(e);const r=n.type===Wt.BINARY_EVENT;r||n.type===Wt.BINARY_ACK?(n.type=r?Wt.EVENT:Wt.ACK,this.reconstructor=new ISe(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(FT(e)||e.base64)if(this.reconstructor)n=this.reconstructor.takeBinaryData(e),n&&(this.reconstructor=null,super.emitReserved("decoded",n));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+e)}decodeString(e){let n=0;const r={type:Number(e.charAt(0))};if(Wt[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===Wt.BINARY_EVENT||r.type===Wt.BINARY_ACK){const o=n+1;for(;e.charAt(++n)!=="-"&&n!=e.length;);const s=e.substring(o,n);if(s!=Number(s)||e.charAt(n)!=="-")throw new Error("Illegal attachments");r.attachments=Number(s)}if(e.charAt(n+1)==="/"){const o=n+1;for(;++n&&!(e.charAt(n)===","||n===e.length););r.nsp=e.substring(o,n)}else r.nsp="/";const i=e.charAt(n+1);if(i!==""&&Number(i)==i){const o=n+1;for(;++n;){const s=e.charAt(n);if(s==null||Number(s)!=s){--n;break}if(n===e.length)break}r.id=Number(e.substring(o,n+1))}if(e.charAt(++n)){const o=this.tryParse(e.substr(n));if(zT.isPayloadValid(r.type,o))r.data=o;else throw new Error("invalid payload")}return r}tryParse(e){try{return JSON.parse(e,this.reviver)}catch{return!1}}static isPayloadValid(e,n){switch(e){case Wt.CONNECT:return d$(n);case Wt.DISCONNECT:return n===void 0;case Wt.CONNECT_ERROR:return typeof n=="string"||d$(n);case Wt.EVENT:case Wt.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&DSe.indexOf(n[0])===-1);case Wt.ACK:case Wt.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class ISe{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){const n=MSe(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const jSe=Object.freeze(Object.defineProperty({__proto__:null,Decoder:zT,Encoder:$Se,get PacketType(){return Wt},protocol:LSe},Symbol.toStringTag,{value:"Module"}));function is(t,e,n){return t.on(e,n),function(){t.off(e,n)}}const BSe=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class ez extends ar{constructor(e,n,r){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=e,this.nsp=n,r&&r.auth&&(this.auth=r.auth),this._opts=Object.assign({},r),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const e=this.io;this.subs=[is(e,"open",this.onopen.bind(this)),is(e,"packet",this.onpacket.bind(this)),is(e,"error",this.onerror.bind(this)),is(e,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...e){return e.unshift("message"),this.emit.apply(this,e),this}emit(e,...n){if(BSe.hasOwnProperty(e))throw new Error('"'+e.toString()+'" is a reserved event name');if(n.unshift(e),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(n),this;const r={type:Wt.EVENT,data:n};if(r.options={},r.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const s=this.ids++,a=n.pop();this._registerAckCallback(s,a),r.id=s}const i=this.io.engine&&this.io.engine.transport&&this.io.engine.transport.writable;return this.flags.volatile&&(!i||!this.connected)||(this.connected?(this.notifyOutgoingListeners(r),this.packet(r)):this.sendBuffer.push(r)),this.flags={},this}_registerAckCallback(e,n){var r;const i=(r=this.flags.timeout)!==null&&r!==void 0?r:this._opts.ackTimeout;if(i===void 0){this.acks[e]=n;return}const o=this.io.setTimeoutFn(()=>{delete this.acks[e];for(let s=0;s<this.sendBuffer.length;s++)this.sendBuffer[s].id===e&&this.sendBuffer.splice(s,1);n.call(this,new Error("operation has timed out"))},i);this.acks[e]=(...s)=>{this.io.clearTimeoutFn(o),n.apply(this,[null,...s])}}emitWithAck(e,...n){const r=this.flags.timeout!==void 0||this._opts.ackTimeout!==void 0;return new Promise((i,o)=>{n.push((s,a)=>r?s?o(s):i(a):i(s)),this.emit(e,...n)})}_addToQueue(e){let n;typeof e[e.length-1]=="function"&&(n=e.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:e,flags:Object.assign({fromQueue:!0},this.flags)};e.push((i,...o)=>r!==this._queue[0]?void 0:(i!==null?r.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(i)):(this._queue.shift(),n&&n(null,...o)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(e=!1){if(!this.connected||this._queue.length===0)return;const n=this._queue[0];n.pending&&!e||(n.pending=!0,n.tryCount++,this.flags=n.flags,this.emit.apply(this,n.args))}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){typeof this.auth=="function"?this.auth(e=>{this._sendConnectPacket(e)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(e){this.packet({type:Wt.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},e):e})}onerror(e){this.connected||this.emitReserved("connect_error",e)}onclose(e,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",e,n)}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case Wt.CONNECT:e.data&&e.data.sid?this.onconnect(e.data.sid,e.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case Wt.EVENT:case Wt.BINARY_EVENT:this.onevent(e);break;case Wt.ACK:case Wt.BINARY_ACK:this.onack(e);break;case Wt.DISCONNECT:this.ondisconnect();break;case Wt.CONNECT_ERROR:this.destroy();const r=new Error(e.data.message);r.data=e.data.data,this.emitReserved("connect_error",r);break}}onevent(e){const n=e.data||[];e.id!=null&&n.push(this.ack(e.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.apply(this,e)}super.emit.apply(this,e),this._pid&&e.length&&typeof e[e.length-1]=="string"&&(this._lastOffset=e[e.length-1])}ack(e){const n=this;let r=!1;return function(...i){r||(r=!0,n.packet({type:Wt.ACK,id:e,data:i}))}}onack(e){const n=this.acks[e.id];typeof n=="function"&&(n.apply(this,e.data),delete this.acks[e.id])}onconnect(e,n){this.id=e,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(e=>this.emitEvent(e)),this.receiveBuffer=[],this.sendBuffer.forEach(e=>{this.notifyOutgoingListeners(e),this.packet(e)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(e=>e()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:Wt.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}timeout(e){return this.flags.timeout=e,this}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){const n=this._anyListeners;for(let r=0;r<n.length;r++)if(e===n[r])return n.splice(r,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(e),this}prependAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(e),this}offAnyOutgoing(e){if(!this._anyOutgoingListeners)return this;if(e){const n=this._anyOutgoingListeners;for(let r=0;r<n.length;r++)if(e===n[r])return n.splice(r,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(e){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const n=this._anyOutgoingListeners.slice();for(const r of n)r.apply(this,e.data)}}}function Wd(t){t=t||{},this.ms=t.min||100,this.max=t.max||1e4,this.factor=t.factor||2,this.jitter=t.jitter>0&&t.jitter<=1?t.jitter:0,this.attempts=0}Wd.prototype.duration=function(){var t=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var e=Math.random(),n=Math.floor(e*this.jitter*t);t=Math.floor(e*10)&1?t+n:t-n}return Math.min(t,this.max)|0};Wd.prototype.reset=function(){this.attempts=0};Wd.prototype.setMin=function(t){this.ms=t};Wd.prototype.setMax=function(t){this.max=t};Wd.prototype.setJitter=function(t){this.jitter=t};class EE extends ar{constructor(e,n){var r;super(),this.nsps={},this.subs=[],e&&typeof e=="object"&&(n=e,e=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,D1(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((r=n.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new Wd({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=e;const i=n.parser||jSe;this.encoder=new i.Encoder,this.decoder=new i.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,this):this._reconnection}reconnectionAttempts(e){return e===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var n;return e===void 0?this._reconnectionDelay:(this._reconnectionDelay=e,(n=this.backoff)===null||n===void 0||n.setMin(e),this)}randomizationFactor(e){var n;return e===void 0?this._randomizationFactor:(this._randomizationFactor=e,(n=this.backoff)===null||n===void 0||n.setJitter(e),this)}reconnectionDelayMax(e){var n;return e===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,(n=this.backoff)===null||n===void 0||n.setMax(e),this)}timeout(e){return arguments.length?(this._timeout=e,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(e){if(~this._readyState.indexOf("open"))return this;this.engine=new QF(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const i=is(n,"open",function(){r.onopen(),e&&e()}),o=a=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",a),e?e(a):this.maybeReconnectOnOpen()},s=is(n,"error",o);if(this._timeout!==!1){const a=this._timeout,l=this.setTimeoutFn(()=>{i(),o(new Error("timeout")),n.close()},a);this.opts.autoUnref&&l.unref(),this.subs.push(()=>{this.clearTimeoutFn(l)})}return this.subs.push(i),this.subs.push(s),this}connect(e){return this.open(e)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const e=this.engine;this.subs.push(is(e,"ping",this.onping.bind(this)),is(e,"data",this.ondata.bind(this)),is(e,"error",this.onerror.bind(this)),is(e,"close",this.onclose.bind(this)),is(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(e){try{this.decoder.add(e)}catch(n){this.onclose("parse error",n)}}ondecoded(e){BT(()=>{this.emitReserved("packet",e)},this.setTimeoutFn)}onerror(e){this.emitReserved("error",e)}socket(e,n){let r=this.nsps[e];return r?this._autoConnect&&!r.active&&r.connect():(r=new ez(this,e,n),this.nsps[e]=r),r}_destroy(e){const n=Object.keys(this.nsps);for(const r of n)if(this.nsps[r].active)return;this._close()}_packet(e){const n=this.encoder.encode(e);for(let r=0;r<n.length;r++)this.engine.write(n[r],e.options)}cleanup(){this.subs.forEach(e=>e()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close"),this.engine&&this.engine.close()}disconnect(){return this._close()}onclose(e,n){this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const e=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const r=this.setTimeoutFn(()=>{e.skipReconnect||(this.emitReserved("reconnect_attempt",e.backoff.attempts),!e.skipReconnect&&e.open(i=>{i?(e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",i)):e.onreconnect()}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){const e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}}const $h={};function Py(t,e){typeof t=="object"&&(e=t,t=void 0),e=e||{};const n=TSe(t,e.path||"/socket.io"),r=n.source,i=n.id,o=n.path,s=$h[i]&&o in $h[i].nsps,a=e.forceNew||e["force new connection"]||e.multiplex===!1||s;let l;return a?l=new EE(r,e):($h[i]||($h[i]=new EE(r,e)),l=$h[i]),n.query&&!e.query&&(e.query=n.queryKey),l.socket(n.path,e)}Object.assign(Py,{Manager:EE,Socket:ez,io:Py,connect:Py});var tz=Symbol.for("immer-nothing"),h$=Symbol.for("immer-draftable"),oo=Symbol.for("immer-state");function ls(t,...e){throw new Error(`[Immer] minified error nr: ${t}. Full error at: https://bit.ly/3cXEKWf`)}var bd=Object.getPrototypeOf;function wd(t){return!!t&&!!t[oo]}function wu(t){var e;return t?nz(t)||Array.isArray(t)||!!t[h$]||!!((e=t.constructor)!=null&&e[h$])||$1(t)||I1(t):!1}var FSe=Object.prototype.constructor.toString();function nz(t){if(!t||typeof t!="object")return!1;const e=bd(t);if(e===null)return!0;const n=Object.hasOwnProperty.call(e,"constructor")&&e.constructor;return n===Object?!0:typeof n=="function"&&Function.toString.call(n)===FSe}function wm(t,e){L1(t)===0?Object.entries(t).forEach(([n,r])=>{e(n,r,t)}):t.forEach((n,r)=>e(r,n,t))}function L1(t){const e=t[oo];return e?e.type_:Array.isArray(t)?1:$1(t)?2:I1(t)?3:0}function _E(t,e){return L1(t)===2?t.has(e):Object.prototype.hasOwnProperty.call(t,e)}function rz(t,e,n){const r=L1(t);r===2?t.set(e,n):r===3?t.add(n):t[e]=n}function zSe(t,e){return t===e?t!==0||1/t===1/e:t!==t&&e!==e}function $1(t){return t instanceof Map}function I1(t){return t instanceof Set}function Tc(t){return t.copy_||t.base_}function TE(t,e){if($1(t))return new Map(t);if(I1(t))return new Set(t);if(Array.isArray(t))return Array.prototype.slice.call(t);if(!e&&nz(t))return bd(t)?{...t}:Object.assign(Object.create(null),t);const n=Object.getOwnPropertyDescriptors(t);delete n[oo];let r=Reflect.ownKeys(n);for(let i=0;i<r.length;i++){const o=r[i],s=n[o];s.writable===!1&&(s.writable=!0,s.configurable=!0),(s.get||s.set)&&(n[o]={configurable:!0,writable:!0,enumerable:s.enumerable,value:t[o]})}return Object.create(bd(t),n)}function xm(t,e=!1){return j1(t)||wd(t)||!wu(t)||(L1(t)>1&&(t.set=t.add=t.clear=t.delete=VSe),Object.freeze(t),e&&wm(t,(n,r)=>xm(r,!0))),t}function VSe(){ls(2)}function j1(t){return Object.isFrozen(t)}var USe={};function xu(t){const e=USe[t];return e||ls(0,t),e}var Sm;function iz(){return Sm}function WSe(t,e){return{drafts_:[],parent_:t,immer_:e,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function p$(t,e){e&&(xu("Patches"),t.patches_=[],t.inversePatches_=[],t.patchListener_=e)}function AE(t){OE(t),t.drafts_.forEach(HSe),t.drafts_=null}function OE(t){t===Sm&&(Sm=t.parent_)}function m$(t){return Sm=WSe(Sm,t)}function HSe(t){const e=t[oo];e.type_===0||e.type_===1?e.revoke_():e.revoked_=!0}function g$(t,e){e.unfinalizedDrafts_=e.drafts_.length;const n=e.drafts_[0];return t!==void 0&&t!==n?(n[oo].modified_&&(AE(e),ls(4)),wu(t)&&(t=hb(e,t),e.parent_||pb(e,t)),e.patches_&&xu("Patches").generateReplacementPatches_(n[oo].base_,t,e.patches_,e.inversePatches_)):t=hb(e,n,[]),AE(e),e.patches_&&e.patchListener_(e.patches_,e.inversePatches_),t!==tz?t:void 0}function hb(t,e,n){if(j1(e))return e;const r=e[oo];if(!r)return wm(e,(i,o)=>v$(t,r,e,i,o,n)),e;if(r.scope_!==t)return e;if(!r.modified_)return pb(t,r.base_,!0),r.base_;if(!r.finalized_){r.finalized_=!0,r.scope_.unfinalizedDrafts_--;const i=r.copy_;let o=i,s=!1;r.type_===3&&(o=new Set(i),i.clear(),s=!0),wm(o,(a,l)=>v$(t,r,i,a,l,n,s)),pb(t,i,!1),n&&t.patches_&&xu("Patches").generatePatches_(r,n,t.patches_,t.inversePatches_)}return r.copy_}function v$(t,e,n,r,i,o,s){if(wd(i)){const a=o&&e&&e.type_!==3&&!_E(e.assigned_,r)?o.concat(r):void 0,l=hb(t,i,a);if(rz(n,r,l),wd(l))t.canAutoFreeze_=!1;else return}else s&&n.add(i);if(wu(i)&&!j1(i)){if(!t.immer_.autoFreeze_&&t.unfinalizedDrafts_<1)return;hb(t,i),(!e||!e.scope_.parent_)&&pb(t,i)}}function pb(t,e,n=!1){!t.parent_&&t.immer_.autoFreeze_&&t.canAutoFreeze_&&xm(e,n)}function qSe(t,e){const n=Array.isArray(t),r={type_:n?1:0,scope_:e?e.scope_:iz(),modified_:!1,finalized_:!1,assigned_:{},parent_:e,base_:t,draft_:null,copy_:null,revoke_:null,isManual_:!1};let i=r,o=VT;n&&(i=[r],o=Cm);const{revoke:s,proxy:a}=Proxy.revocable(i,o);return r.draft_=a,r.revoke_=s,a}var VT={get(t,e){if(e===oo)return t;const n=Tc(t);if(!_E(n,e))return KSe(t,n,e);const r=n[e];return t.finalized_||!wu(r)?r:r===$S(t.base_,e)?(IS(t),t.copy_[e]=PE(r,t)):r},has(t,e){return e in Tc(t)},ownKeys(t){return Reflect.ownKeys(Tc(t))},set(t,e,n){const r=oz(Tc(t),e);if(r!=null&&r.set)return r.set.call(t.draft_,n),!0;if(!t.modified_){const i=$S(Tc(t),e),o=i==null?void 0:i[oo];if(o&&o.base_===n)return t.copy_[e]=n,t.assigned_[e]=!1,!0;if(zSe(n,i)&&(n!==void 0||_E(t.base_,e)))return!0;IS(t),RE(t)}return t.copy_[e]===n&&(n!==void 0||e in t.copy_)||Number.isNaN(n)&&Number.isNaN(t.copy_[e])||(t.copy_[e]=n,t.assigned_[e]=!0),!0},deleteProperty(t,e){return $S(t.base_,e)!==void 0||e in t.base_?(t.assigned_[e]=!1,IS(t),RE(t)):delete t.assigned_[e],t.copy_&&delete t.copy_[e],!0},getOwnPropertyDescriptor(t,e){const n=Tc(t),r=Reflect.getOwnPropertyDescriptor(n,e);return r&&{writable:!0,configurable:t.type_!==1||e!=="length",enumerable:r.enumerable,value:n[e]}},defineProperty(){ls(11)},getPrototypeOf(t){return bd(t.base_)},setPrototypeOf(){ls(12)}},Cm={};wm(VT,(t,e)=>{Cm[t]=function(){return arguments[0]=arguments[0][0],e.apply(this,arguments)}});Cm.deleteProperty=function(t,e){return Cm.set.call(this,t,e,void 0)};Cm.set=function(t,e,n){return VT.set.call(this,t[0],e,n,t[0])};function $S(t,e){const n=t[oo];return(n?Tc(n):t)[e]}function KSe(t,e,n){var i;const r=oz(e,n);return r?"value"in r?r.value:(i=r.get)==null?void 0:i.call(t.draft_):void 0}function oz(t,e){if(!(e in t))return;let n=bd(t);for(;n;){const r=Object.getOwnPropertyDescriptor(n,e);if(r)return r;n=bd(n)}}function RE(t){t.modified_||(t.modified_=!0,t.parent_&&RE(t.parent_))}function IS(t){t.copy_||(t.copy_=TE(t.base_,t.scope_.immer_.useStrictShallowCopy_))}var GSe=class{constructor(t){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(e,n,r)=>{if(typeof e=="function"&&typeof n!="function"){const o=n;n=e;const s=this;return function(l=o,...c){return s.produce(l,f=>n.call(this,f,...c))}}typeof n!="function"&&ls(6),r!==void 0&&typeof r!="function"&&ls(7);let i;if(wu(e)){const o=m$(this),s=PE(e,void 0);let a=!0;try{i=n(s),a=!1}finally{a?AE(o):OE(o)}return p$(o,r),g$(i,o)}else if(!e||typeof e!="object"){if(i=n(e),i===void 0&&(i=e),i===tz&&(i=void 0),this.autoFreeze_&&xm(i,!0),r){const o=[],s=[];xu("Patches").generateReplacementPatches_(e,i,o,s),r(o,s)}return i}else ls(1,e)},this.produceWithPatches=(e,n)=>{if(typeof e=="function")return(s,...a)=>this.produceWithPatches(s,l=>e(l,...a));let r,i;return[this.produce(e,n,(s,a)=>{r=s,i=a}),r,i]},typeof(t==null?void 0:t.autoFreeze)=="boolean"&&this.setAutoFreeze(t.autoFreeze),typeof(t==null?void 0:t.useStrictShallowCopy)=="boolean"&&this.setUseStrictShallowCopy(t.useStrictShallowCopy)}createDraft(t){wu(t)||ls(8),wd(t)&&(t=YSe(t));const e=m$(this),n=PE(t,void 0);return n[oo].isManual_=!0,OE(e),n}finishDraft(t,e){const n=t&&t[oo];(!n||!n.isManual_)&&ls(9);const{scope_:r}=n;return p$(r,e),g$(void 0,r)}setAutoFreeze(t){this.autoFreeze_=t}setUseStrictShallowCopy(t){this.useStrictShallowCopy_=t}applyPatches(t,e){let n;for(n=e.length-1;n>=0;n--){const i=e[n];if(i.path.length===0&&i.op==="replace"){t=i.value;break}}n>-1&&(e=e.slice(n+1));const r=xu("Patches").applyPatches_;return wd(t)?r(t,e):this.produce(t,i=>r(i,e))}};function PE(t,e){const n=$1(t)?xu("MapSet").proxyMap_(t,e):I1(t)?xu("MapSet").proxySet_(t,e):qSe(t,e);return(e?e.scope_:iz()).drafts_.push(n),n}function YSe(t){return wd(t)||ls(10,t),sz(t)}function sz(t){if(!wu(t)||j1(t))return t;const e=t[oo];let n;if(e){if(!e.modified_)return e.base_;e.finalized_=!0,n=TE(t,e.scope_.immer_.useStrictShallowCopy_)}else n=TE(t,!0);return wm(n,(r,i)=>{rz(n,r,sz(i))}),e&&(e.finalized_=!1),n}var so=new GSe,XSe=so.produce;so.produceWithPatches.bind(so);so.setAutoFreeze.bind(so);so.setUseStrictShallowCopy.bind(so);so.applyPatches.bind(so);so.createDraft.bind(so);so.finishDraft.bind(so);function ZSe(t){var e=g.useState(function(){return xm(typeof t=="function"?t():t,!0)}),n=e[1];return[e[0],g.useCallback(function(r){n(typeof r=="function"?XSe(r):xm(r))},[])]}var QSe="Expected a function",y$=NaN,JSe="[object Symbol]",eCe=/^\s+|\s+$/g,tCe=/^[-+]0x[0-9a-f]+$/i,nCe=/^0b[01]+$/i,rCe=/^0o[0-7]+$/i,iCe=parseInt,oCe=typeof fn=="object"&&fn&&fn.Object===Object&&fn,sCe=typeof self=="object"&&self&&self.Object===Object&&self,aCe=oCe||sCe||Function("return this")(),lCe=Object.prototype,cCe=lCe.toString,uCe=Math.max,fCe=Math.min,jS=function(){return aCe.Date.now()};function dCe(t,e,n){var r,i,o,s,a,l,c=0,f=!1,d=!1,p=!0;if(typeof t!="function")throw new TypeError(QSe);e=b$(e)||0,NE(n)&&(f=!!n.leading,d="maxWait"in n,o=d?uCe(b$(n.maxWait)||0,e):o,p="trailing"in n?!!n.trailing:p);function m(_){var R=r,M=i;return r=i=void 0,c=_,s=t.apply(M,R),s}function v(_){return c=_,a=setTimeout(x,e),f?m(_):s}function b(_){var R=_-l,M=_-c,I=e-R;return d?fCe(I,o-M):I}function S(_){var R=_-l,M=_-c;return l===void 0||R>=e||R<0||d&&M>=o}function x(){var _=jS();if(S(_))return w(_);a=setTimeout(x,b(_))}function w(_){return a=void 0,p&&r?m(_):(r=i=void 0,s)}function C(){a!==void 0&&clearTimeout(a),c=0,r=l=i=a=void 0}function T(){return a===void 0?s:w(jS())}function A(){var _=jS(),R=S(_);if(r=arguments,i=this,l=_,R){if(a===void 0)return v(l);if(d)return a=setTimeout(x,e),m(l)}return a===void 0&&(a=setTimeout(x,e)),s}return A.cancel=C,A.flush=T,A}function NE(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function hCe(t){return!!t&&typeof t=="object"}function pCe(t){return typeof t=="symbol"||hCe(t)&&cCe.call(t)==JSe}function b$(t){if(typeof t=="number")return t;if(pCe(t))return y$;if(NE(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=NE(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=t.replace(eCe,"");var n=nCe.test(t);return n||rCe.test(t)?iCe(t.slice(2),n?2:8):tCe.test(t)?y$:+t}var mCe=dCe;const w$=Su(mCe);function gCe(t){const e=g.useRef(t);e.current=t,g.useEffect(()=>()=>{e.current()},[])}function vCe(t,e=500,n){const r=g.useRef();gCe(()=>{r.current&&r.current.cancel()});const i=g.useMemo(()=>{const o=w$(t,e,n),s=(...a)=>o(...a);return s.cancel=()=>{o.cancel()},s.isPending=()=>!!r.current,s.flush=()=>o.flush(),s},[t,e,n]);return g.useEffect(()=>{r.current=w$(t,e,n)},[t,e,n]),i}function yCe(t,e,n){const r=(n==null?void 0:n.equalityFn)??((c,f)=>c===f),i=t instanceof Function?t():t,[o,s]=g.useState(i),a=g.useRef(i),l=vCe(s,e,n);return r(a.current,i)||(l(i),a.current=i),[o,l]}let Hv;const bCe=new Uint8Array(16);function wCe(){if(!Hv&&(Hv=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Hv))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Hv(bCe)}const Or=[];for(let t=0;t<256;++t)Or.push((t+256).toString(16).slice(1));function xCe(t,e=0){return Or[t[e+0]]+Or[t[e+1]]+Or[t[e+2]]+Or[t[e+3]]+"-"+Or[t[e+4]]+Or[t[e+5]]+"-"+Or[t[e+6]]+Or[t[e+7]]+"-"+Or[t[e+8]]+Or[t[e+9]]+"-"+Or[t[e+10]]+Or[t[e+11]]+Or[t[e+12]]+Or[t[e+13]]+Or[t[e+14]]+Or[t[e+15]]}const SCe=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),x$={randomUUID:SCe};function az(t,e,n){if(x$.randomUUID&&!e&&!t)return x$.randomUUID();t=t||{};const r=t.random||(t.rng||wCe)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,e){n=n||0;for(let i=0;i<16;++i)e[n+i]=r[i];return e}return xCe(r)}const S$=t=>!!t;function ts(t){return{uniqueId:az(),step:t,status:Mn.IDLE,locateStatus:Us.IDLE,selected:!1,expanded:!1,children:[]}}function C$(t,e,n){const r=t[e];t[e]=t[n],t[n]=r}const ff=(t,e)=>{let n=t,r;for(let i=0;i<e.length-1;i++){const o=e[i];if(o>=n.length)throw new Error(`Invalid indices: ${e}`);i===e.length-2?r=n[o]:n=n[o].children}if(!r)throw new Error(`Invalid indices: ${e}`);return r},Hi=(t,e)=>{if(e.length===1)return t[e[0]];const n=ff(t,e),r=e[e.length-1];return n.children[r]},k$=t=>(t.commands??[]).map(e=>{const n={type:$e.PRESET_ACTION,command:F3.parse(e)};return ts(n)}),CCe=t=>t.map(e=>{let n=[];J_(e)?n=e.steps.map(i=>{const o=ts(i);return o.step.type===$e.AI_ACTION&&(o.children=k$(o.step)),o}):e.type===$e.AI_ACTION&&(n=k$(e));const r=ts(e);return r.children=n,r});function Ac(t,e){t.status=e,t.children.forEach(n=>{Ac(n,e)})}function Yh(t){t.output=void 0,t.children.forEach(e=>{Yh(e)})}const lz=t=>t.map(e=>{const n=e.step;if(J_(n)){const r=lz(e.children).map(i=>ld(i)?i:null).filter(S$);return{...n,steps:r}}else if(n.type===$e.AI_ACTION)return{...n,commands:e.children.map(r=>r.step.type!==$e.PRESET_ACTION?null:Pd.parse(r.step.command)).filter(S$)};return n}),kCe=t=>{t.forEach(e=>{const n=e.step;J_(n)?e.children.forEach(r=>{if(!ld(r.step))throw new Error(`Step type ${r.step.type} is not allowed in a module.`)}):n.type===$e.AI_ACTION&&e.children.forEach(r=>{if(r.step.type!==$e.PRESET_ACTION)throw new Error(`Step type ${r.step.type} is not allowed in a module.`)})})},ECe=2e3,_Ce=({websocketUrl:t,test:e})=>{const[n,r]=g.useState(),[i,o]=g.useState(),[s,a]=g.useState(""),[l,c]=g.useState(e.baseUrl),[f,d]=g.useState(!1),[p,m]=g.useState(!1),[v,b]=g.useState(""),[S,x]=g.useState(!1),[w,C]=g.useState(),[T,A]=ZSe(()=>CCe(e.steps)),_=g.useMemo(()=>lz(T),[T]),[R,M]=yCe(_,ECe);g.useEffect(()=>{M(_)},[M,_]);const[I,V]=g.useState(_),U=g.useMemo(()=>Ty(I,_).length>0,[I,_]),L=g.useMemo(()=>{try{const oe=_re(_);if(kCe(T),oe)return{valid:!0,message:oe}}catch(oe){if(oe instanceof Error)return{valid:!1,message:oe.message}}return{valid:!0}},[_,T]),G=gj(()=>{const oe=Py(t,{transports:["websocket"],query:{testId:e.id,baseUrl:e.baseUrl},reconnection:!0,reconnectionAttempts:3});return oe.on("connect",()=>{b("")}),oe.on("disconnect",()=>{b("Disconnected!"),m(!1)}),oe.on("error",se=>{b(se.message)}),oe.on("connect_error",se=>{b(se.message)}),oe.on("session",({url:se,userAgent:ue,viewport:we,localApp:nt})=>{d(!0),c(se),a(ue),o(we),C(nt)}),oe.on("finished",()=>{m(!1)}),oe.on("screenshot",({viewport:se,buffer:ue,url:we})=>{o(se),r(ue),c(we)}),oe.on("started",({indices:se})=>{A(ue=>{var nt;const we=Hi(ue,se);we.status=Mn.RUNNING,we.step.type===$e.AI_ACTION&&!((nt=we.step.commands)!=null&&nt.length)&&(we.message="Generating command...")})}),oe.on("commandGenerated",({indices:se,message:ue})=>{A(we=>{const nt=se.slice(0,-1),et=Hi(we,nt),wt=se[se.length-1];if(et.step.type!==$e.AI_ACTION)throw new Error(`Unexpected command chain emitted commandExecuted event:
239
+ Parent:${et.step}`);wt<et.children.length?et.children[wt].status=Mn.RUNNING:et.message=`Executing command: ${ue}`})}),oe.on("commandExecuted",({indices:se,command:ue,output:we})=>{const nt=se.slice(0,-1);A(et=>{const wt=Hi(et,nt),nn=wt.step,z=se[se.length-1],X=wt.children[z];if(nn.type!==$e.AI_ACTION)throw new Error(`Unexpected command chain emitted commandExecuted event:
240
+ Parent:${nn}
241
+ Child:${ue}`);if(we&&X){const ne=X.status;ne!==Mn.FAILED&&ne!==Mn.CANCELLED&&(X.status=we.status,X.output=we)}if(!X){const ne=ts({type:$e.PRESET_ACTION,command:ue});we&&(ne.output=we,ne.status=we.status),wt.children.push(ne),wt.message="Generating command...";return}if(X&&X.step.type===$e.PRESET_ACTION&&Ty(X.step.command,ue).length>0){const ne=ts({type:$e.PRESET_ACTION,command:ue});ne.status=X.status,we&&(ne.status=we==null?void 0:we.status,ne.output=we),wt.children.splice(z,1,ne)}})}),oe.on("commandRetrying",({indices:se})=>{A(ue=>{const we=Hi(ue,se);we.message="Retrying command..."})}),oe.on("success",({indices:se,message:ue,command:we,output:nt})=>{A(et=>{const wt=Hi(et,se);wt.status=Mn.SUCCESS,wt.message=`Step succeeded: ${ue}`,wt.output=nt,wt.step.type===$e.AI_ACTION&&Ac(wt,Mn.SUCCESS),we&&wt.step.type===$e.PRESET_ACTION&&Ty(wt.step.command,we).length>0&&(wt.step.command=we)})}),oe.on("failure",({indices:se,message:ue,output:we})=>{A(nt=>{const et=Hi(nt,se);et.status=Mn.FAILED,et.message=`Step failed: ${ue}`,et.output=we,et.step.type===$e.AI_ACTION&&Ac(et,Mn.FAILED)})}),oe.on("cancelled",({indices:se,message:ue,output:we})=>{A(nt=>{const et=Hi(nt,se);et.status=Mn.CANCELLED,et.message=`Step cancelled: ${ue}`,et.output=we})}),oe}),K=g.useRef(),F=K.current;return g.useEffect(()=>(K.current||(K.current=G()),K.current.connect(),()=>{var oe,se;(oe=K.current)!=null&&oe.connected&&((se=K.current)==null||se.disconnect())}),[G]),{validState:L,hasDiff:U,screenshot:n,userAgent:s,viewport:i,url:l,initialized:f,executing:p,error:v,creatingModule:S,stepsState:T,steps:_,debouncedSteps:R,lastSavedSteps:I,localApp:w,handleReset:()=>{F==null||F.disconnect(),d(!1),r(void 0),m(!1),A(oe=>{oe.forEach(se=>{Ac(se,Mn.IDLE),Yh(se)})}),F==null||F.connect()},handleAbort:()=>{F==null||F.disconnect(),d(!1),r(void 0),m(!1),A(oe=>{oe.forEach(se=>{Ac(se,Mn.IDLE),Yh(se)})}),F==null||F.connect()},handleRunAllSteps:()=>{if(!L.valid){cd.error("Invalid test.",{description:L.message});return}m(!0),F==null||F.emit("execute",{reInitialize:!0,steps:_,testMetadata:e}),A(oe=>{oe.forEach(se=>{Ac(se,Mn.IDLE),Yh(se)})})},handleExecute:oe=>{if(!L.valid){cd.error("Invalid test.",{description:L.message});return}m(!0),F==null||F.emit("execute",{reInitialize:!1,steps:_,indicesFilter:oe,testMetadata:e}),A(se=>{const ue=Hi(se,oe);Ac(ue,Mn.IDLE),Yh(ue)})},handleAdd:(oe,se)=>{A(ue=>{let we;if(oe.type===$e.AI_ACTION?we=ts({type:oe.type,text:""}):oe.type==="RESOLVED_MODULE"?(we=ts(oe),we.children=oe.steps.map(nt=>ts(nt))):we=ts({type:$e.PRESET_ACTION,command:Y_(oe.command)}),se.length===0)ue.push(we);else if(se.length===1)ue.splice(se[0],0,we);else{const nt=ff(ue,se);let et=se[se.length-1];nt.step.type===$e.AI_ACTION&&we.step.type===$e.PRESET_ACTION&&we.step.command.type!==Le.SUCCESS&&et===nt.children.length&&(et=nt.children.length-1),nt.children.splice(et,0,we)}})},handleStepChange:(oe,se)=>{A(ue=>{const we=Hi(ue,se);if(we.step=oe,we.status=Mn.IDLE,we.output=void 0,oe.type==="RESOLVED_MODULE"&&(we.children=oe.steps.map(nt=>ts(nt))),oe.type===$e.AI_ACTION&&(we.children=[]),se.length>1){const nt=ff(ue,se),et=se[se.length-1];nt.children[et].step=oe,nt.status=Mn.IDLE,nt.output=void 0}})},handleDelete:oe=>{A(se=>{if(oe.length===1)se.splice(oe[0],1);else if(oe.length>1){const ue=ff(se,oe),we=oe[oe.length-1];ue.children.splice(we,1)}})},handleMoveUp:oe=>{A(se=>{if(oe.length===1){const ue=oe[0];if(ue===0)return;const we=se[ue];se[ue]=se[ue-1],se[ue-1]=we}else if(oe.length>1){const ue=oe[oe.length-1];if(ue===0)return;const we=ff(se,oe);C$(we.children,ue,ue-1)}})},handleMoveDown:oe=>{A(se=>{if(oe.length===1){const ue=oe[0];if(ue===se.length-1)return;const we=se[ue];se[ue]=se[ue+1],se[ue+1]=we}else if(oe.length>1){const ue=ff(se,oe),we=oe[oe.length-1];if(we===ue.children.length-1)return;C$(ue.children,we,we+1)}})},handleSelectChange:(oe,se)=>{A(ue=>{const we=Hi(ue,se);we.selected=oe})},handleExpandChange:(oe,se)=>{A(ue=>{const we=Hi(ue,se);we.expanded=oe})},handleLocate:(oe,se,ue)=>{A(we=>{const nt=Hi(we,ue);nt.locateStatus=Us.LOCATING}),F==null||F.emit("locate",{description:oe,useVision:se,testMetadata:e},({found:we,locator:nt,a11yData:et})=>{A(wt=>{const nn=Hi(wt,ue);nn.locateStatus=we?Us.LOCATED:Us.FAILED,et&&nn.step.type===$e.PRESET_ACTION&&"target"in nn.step.command&&nn.step.command.target&&(nn.step.command.target.a11yData=et),nt!=null&&nt.options&&(nn.options=nt.options)})})},handleStartCreatingModule:()=>{x(!0)},handleCreateModuleSuccess:oe=>{const se=T.findIndex(ue=>ue.selected&&ld(ue.step));A(ue=>ue.filter(we=>!(we.selected&&ld(we.step)))),A(ue=>{ue.splice(se,0,{uniqueId:az(),step:oe,status:Mn.IDLE,locateStatus:Us.IDLE,selected:!1,expanded:!0,children:oe.steps.map(we=>ts(we))})}),x(!1)},handleCancelCreateModule:()=>{x(!1),A(oe=>{oe.forEach(se=>{se.selected=!1})})},handleSaveTestSuccess:oe=>{V(oe)}}},TCe=t=>{const e=O2.useXarrow();return k.jsx("div",{...t,onScroll:e})},ME="horizontal",ACe=["horizontal","vertical"],cz=g.forwardRef((t,e)=>{const{decorative:n,orientation:r=ME,...i}=t,o=uz(r)?r:ME,a=n?{role:"none"}:{"aria-orientation":o==="vertical"?o:void 0,role:"separator"};return g.createElement(Dt.div,H({"data-orientation":o},a,i,{ref:e}))});cz.propTypes={orientation(t,e,n){const r=t[e],i=String(r);return r&&!uz(r)?new Error(OCe(i,n)):null}};function OCe(t,e){return`Invalid prop \`orientation\` of value \`${t}\` supplied to \`${e}\`, expected one of:
242
+ - horizontal
243
+ - vertical
244
+
245
+ Defaulting to \`${ME}\`.`}function uz(t){return ACe.includes(t)}const fz=cz,dz=g.forwardRef(({className:t,orientation:e="horizontal",decorative:n=!0,...r},i)=>k.jsx(fz,{ref:i,decorative:n,orientation:e,className:ft("bg-border shrink-0",e==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",t),...r}));dz.displayName=fz.displayName;const RCe=ot({name:t2}),PCe=t=>{const[e,n]=g.useState(!1),r=c4({resolver:f4(RCe),defaultValues:{name:""},mode:"onChange"}),[i,o]=d2(async l=>{var f;const c={name:l.name,steps:t.steps};try{const d=await ud(`${hu}/api/modules`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(c)});(f=t.onSuccess)==null||f.call(t,d),n(!1)}catch(d){cd.error("Failed to create test.",{description:`${d}`})}},[t.steps,t.onSuccess]),{isDirty:s,isValid:a}=r.formState;return g.useEffect(()=>{r.reset()},[r,e]),k.jsxs(_2,{open:e,onOpenChange:n,children:[k.jsx(T2,{asChild:!0,children:k.jsx(Tn,{variant:"outline",disabled:t.disabled,children:"Save module"})}),k.jsxs(Jb,{children:[k.jsxs(e1,{children:[k.jsx(t1,{children:"Create module"}),k.jsx(Z4,{children:"Group and reuse steps across different tests."})]}),k.jsx(J4,{...r,children:k.jsxs("form",{onSubmit:r.handleSubmit(o),className:"space-y-6",children:[k.jsx(ek,{control:r.control,name:"name",render:({field:l,fieldState:c})=>k.jsxs(_0,{children:[k.jsx(T0,{children:"Name"}),k.jsx(A0,{children:k.jsx(jl,{placeholder:"Login flow",...l})}),k.jsxs(O0,{children:["A short identifier, such as what functionality this module covers.",l.value&&!c.invalid?k.jsxs("span",{className:"block pt-2",children:["✓ Your module path will be"," ",k.jsx("span",{className:"font-mono font-medium text-green-600",children:H3(l.value)})]}):null]}),k.jsx(R0,{})]})}),k.jsx(A2,{children:k.jsx(Tn,{type:"submit",disabled:!s||!a||i.loading,children:"Create module"})})]})})]})]})};async function NCe({params:t}){const e=await ud(`${hu}/api/tests/${encodeURIComponent(t.testPath)}`),n=ine.parse(e),r=await ud(`${hu}/api/modules`),i=one.parse(r);return{test:n,modules:i}}const MCe=()=>{const{testPath:t}=DZ(),{test:e,modules:n}=n3(),{validState:r,hasDiff:i,initialized:o,executing:s,creatingModule:a,steps:l,stepsState:c,viewport:f,screenshot:d,url:p,userAgent:m,error:v,localApp:b,handleReset:S,handleSaveTestSuccess:x,handleAbort:w,handleRunAllSteps:C,handleStepChange:T,handleAdd:A,handleMoveDown:_,handleMoveUp:R,handleExecute:M,handleDelete:I,handleSelectChange:V,handleExpandChange:U,handleLocate:L,handleStartCreatingModule:G,handleCreateModuleSuccess:K,handleCancelCreateModule:F}=_Ce({websocketUrl:hu,test:e}),[ie,ae]=d2(async P=>{const he={steps:P};try{await ud(`${hu}/api/tests/${encodeURIComponent(t)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(he)}),cd.success("Test saved!"),x(P)}catch(fe){cd.error("Failed to save test.",{description:`${fe}`})}},[t,x]),re=()=>{i&&r.valid&&ae(l)},W=c.filter(P=>P.selected).length;return k.jsxs("div",{className:"grid max-h-screen min-h-screen grid-rows-[auto_minmax(0px,_1fr)]",children:[k.jsxs("div",{className:"flex h-16 items-center gap-2 border-b px-6",children:[k.jsx(dQ,{to:"..",children:k.jsx(d4,{className:"h-6 w-6"})}),k.jsx("div",{className:"font-semibold",children:e.name}),k.jsx("span",{className:"text-muted-foreground",children:e.baseUrl.length>70?`${e.baseUrl.slice(0,70)}...`:e.baseUrl}),k.jsx("div",{className:"ml-auto flex items-center gap-2"})]}),k.jsxs("div",{className:"grid grid-cols-[auto_minmax(0px,_1fr)]",children:[k.jsxs("div",{className:"grid w-[25vw] min-w-[600px] grid-rows-[auto_auto_auto_1fr] overflow-auto border-r",children:[k.jsxs("div",{className:"flex flex-col border-b",children:[k.jsxs("div",{className:"flex items-center justify-end gap-2 p-2",children:[r.message&&k.jsxs(Ls,{children:[k.jsx($s,{children:k.jsx(ise,{className:"text-destructive h-4 w-4"})}),k.jsx(ss,{children:r.message})]}),k.jsxs(Tn,{variant:"outline",disabled:!i||ie.loading,onClick:re,children:[ie.loading?k.jsx(pse,{className:"mr-2 h-4 w-4 animate-spin"}):k.jsx(mse,{className:"mr-2 h-4 w-4"}),ie.loading?"Saving test...":i?"Save test":"Test saved"]}),k.jsxs(Tn,{variant:"outline",onClick:G,disabled:a||s||!o,children:[k.jsx(use,{className:"mr-2 h-4 w-4"}),"Create module"]}),s?k.jsxs(Tn,{variant:"outline",disabled:!s,className:"text-destructive hover:text-destructive",onClick:w,children:[k.jsx(xse,{className:"mr-2 h-4 w-4"}),"Cancel execution"]}):k.jsxs(Tn,{disabled:s||!o,onClick:C,children:[k.jsx(dse,{className:"mr-2 h-4 w-4"}),"Run from start"]})]}),a&&k.jsxs(k.Fragment,{children:[k.jsx(dz,{}),k.jsxs("div",{className:"flex items-center justify-end gap-2 p-2",children:[k.jsx("div",{children:"Select steps using the checkboxes."}),k.jsx(PCe,{disabled:W<1||s||!o,steps:c.filter(P=>P.selected).map(({step:P})=>P).filter(ld),onSuccess:K}),k.jsx(Tn,{variant:"outline",size:"icon",onClick:F,children:k.jsx(Sse,{className:"h-4 w-4"})})]})]})]}),k.jsx(O2.Xwrapper,{children:k.jsx(TCe,{className:"relative space-y-2 overflow-auto p-4",children:c.map((P,he)=>{const fe=$=>[he,...$];return k.jsx(bE,{modules:n,index:he,state:P,disabled:s||!o,showCheckbox:a&&ld(P.step),autofocusInput:!0,onStepChange:($,Ne)=>T($,fe(Ne)),onAddBefore:($,Ne)=>A($,fe(Ne)),onAddAfter:($,Ne)=>{const He=fe(Ne);He[He.length-1]+=1,A($,He)},onMoveDown:$=>_(fe($)),onMoveUp:$=>R(fe($)),onExecute:$=>M(fe($)),onDelete:$=>I(fe($)),onSelectChange:($,Ne)=>V($,fe(Ne)),onExpandChange:($,Ne)=>U($,fe(Ne)),onLocate:($,Ne,He)=>L($,Ne,fe(He))},P.uniqueId)})})}),k.jsx("div",{className:"mb-2 flex items-center justify-center",children:k.jsx(fy,{modules:n,onAdd:P=>A(P,[]),disabled:s||!o})})]}),b==="web"?k.jsx("div",{className:"m-2 grid grid-rows-[auto_auto_auto_minmax(0px,_1fr)] overflow-hidden",children:k.jsx(Lse,{viewport:f,image:d,url:p,userAgent:m,error:v,onReset:S,onReconnect:w})}):k.jsx("div",{className:ft("grid grid-rows-1 overflow-auto",{invisible:!b}),children:k.jsx("iframe",{title:"momentic-frame-0",name:"momentic-frame-0",id:"momentic-frame-0",sandbox:"allow-forms allow-modals allow-orientation-lock allow-pointer-lock allow-popups allow-presentation allow-same-origin allow-scripts",style:{boxSizing:"border-box",overflowClipMargin:"content-box !important",overflow:"clip !important",border:"none",width:1920,height:1080},src:e.baseUrl})})]})]})},DCe=JZ([{path:"/",element:k.jsx(tse,{}),loader:ese},{path:"tests/:testPath",element:k.jsx(MCe,{}),loader:NCe}]);BS.createRoot(document.getElementById("root")).render(k.jsx(ut.StrictMode,{children:k.jsx(Cee,{children:k.jsx(lQ,{router:DCe})})}));